/*:
@plugindesc
3D rendering for RPG Maker MZ, 
version 0.9.2.5 
@author Cutievirus
@target MZ

@help
Requires RPG Maker MZ
	
This is the full version of MZ3D. Please do not use it unless you are a
patron or have purchased a perpetual license from itch.io.

https://cutievirus.itch.io/mz3d
https://www.patreon.com/cutievirus


For assistance with the plugin, please join the discord:

Discord: http://cutievirus.com/discord  


For full documentation, please see the wiki:

https://mv3d.cutievirus.com/documentation




## Patron Heroes:

- Rikyu
- AMemoryofEternity 
- Fyoha
- 冬空 橙
- hsumi1 .
- EGA EROGE
- Kevin Eng
- Julius Liu
- pixelhans
- Haldarc
- GUIDING HAND SOCIAL CLUB
- KRS_Makoto
- Christopher W Formet
- Michael Summers
- Juan vargas
- Silkhaze
- Infinity Realms Hunt
- Eternal Wanderer
- Schnorr Bert
- Bitsy Princess
- Kal
- Kyle
- Lonewulf123
- Clint G




## Patron Knights:

- Christian Young
- Nemo Ma
- Jai R - Fisher
- Joseph Reyes
- RPG BlackSaiyan2
- Jacenya
- Lucas Smith
- Poppy JR
- Hideout Wallet
- Matt Ziegler
- Simpgod
- Re:Pingers



@command command
@text Legacy Command
@desc Use the old command syntax

@arg command
@text Command
@desc Enter the command without the mv3d/mz3d prefix.


@command animation
@text Play Animation
@desc 

@arg id
@text Animation
@type animation
@default 1

@arg target
@text Target
@desc Enter the event id or "player". Blank for current event.

@arg scale
@text Scale
@type number
@decimals 4
@min 0.0001
@default 1

@arg rot
@text Rotation
@desc The rotation angle of the animation. If "auto", matches camera rotation.
@type number
@decimals 0
@min 0 @max 360
@default auto

@arg depth
@text Depth
@desc Controls whether the animation will be drawn with depth, or on top of everything else.
@type boolean
@default true

@arg height
@text Height Offset
@desc Offsets the z position of the animation.
@type number
@decimals 4
@min -9999 @max 9999
@default 0


@command camera
@text Camera
@desc Change the camera settings.

@arg pitch
@text Pitch
@desc Aims the camera up and down
@type number
@decimals 0
@min 0
@max 180

@arg yaw
@text Yaw
@desc Rotates the camera around the target
@type number
@decimals 0
@min 0
@max 360

@arg roll
@text Roll
@desc Tilts the camera side to side
@type number
@decimals 0
@min -360
@max 360

@arg dist
@text Distance
@desc The distance of the camera to the target (0=first person)
@type number
@decimals 3
@min 0

@arg zoom
@text Zoom
@desc Modifies the FOV to zoom the camera.
@type number
@decimals 4
@min -9999
@max 9999

@arg height
@text Height
@desc The height of the camera.
@type number
@decimals 3

@arg mode
@text Mode
@desc Switch between perspective mode and orthographic mode.
@type select
@option perspective
@option orthographic
@option 2D

@arg follow
@text Follow Target
@desc Which character should the camera follow?
(enter the event id, or the word "player")

@arg pan
@text Pan
@desc Pan the camera away from the target
@type struct<XY>

@arg time
@text Time
@desc Time in seconds to complete transition
@type number
@decimals 3
@min 0
@default 1


@command cameraTrack
@text Camera Tracking
@desc Automatically rotate the camera to face the tracking target.

@arg target
@text Target
@desc Enter the event id or "player". Leave blank to disable.

@arg trackYaw
@text Track Yaw
@type boolean
@default true

@arg trackPitch
@text Track Pitch
@type boolean
@default true

@arg time
@text Smoothness
@desc How smoothly the target will be tracked. Higher number = slower.
@type number
@decimals 3
@default 0


@command fog
@text Fog
@desc Change fog settings.

@arg color
@text Fog Color

@arg near
@text Start Distance
@type number
@decimals 3

@arg far
@text End Distance
@type number
@decimals 3

@arg time
@text Time
@type number
@decimals 3
@default 1


@command light
@text Lighting
@desc Change light settings.

@arg color
@text Ambient Color
@desc The ambient light lights everything in the scene.

@arg time
@text Time
@type number
@decimals 0
@default 1


@command lamp
@text Lamp
@desc Add a lamp lightsource to a character.

@arg target
@text Target
@desc Enter the event id or "player". Blank for current event.

@arg color
@text Color

@arg intensity
@text Intensity
@type number
@decimals 3
@min 0

@arg dist
@text Distance
@desc How far the light will travel.
@type number
@decimals 3
@min 0

@arg time
@text Time
@type number
@decimals 3
@default 1

@arg shadow
@text Casts Shadows
@type boolean
@default false


@command flashlight
@text Flashlight
@desc Add a flashlight lightsource to a character.

@arg target
@text Target
@desc Enter the event id or "player". Blank for current event.

@arg color
@text Color

@arg intensity
@text Intensity
@type number
@decimals 3
@min 0

@arg dist
@text Distance
@desc How far the light will travel.
@type number
@decimals 3
@min 0

@arg angle
@text Beam Width
@desc An angle that describes the width of the beam.
@type number
@min 0 @max 360

@arg yaw
@text Yaw
@desc The horizontal angle of the flashlight beam.
@type number
@decimals 0
@min 0
@max 360

@arg pitch
@text Pitch
@desc The vertical angle of the flashlight beam.
@type number
@decimals 0
@min 0
@max 180

@arg time
@text Time
@type number
@decimals 3
@default 1

@arg shadow
@text Casts Shadows
@type boolean
@default false


@command elevation
@text Elevation
@desc Sets a character's elevation

@arg target
@text Target
@desc Enter the event id or "player". Blank for current event.

@arg elevation
@text Elevation
@type number
@decimals 3
@default 0

@arg time
@text Time
@type number
@decimals 3
@default 1


@command resolution
@text Resolution Scale
@desc Scale the resolution for a pixellated effect.

@arg scale
@text Scale
@desc Should be between 0 and 1.
@type number
@decimals 4
@min 0 @max 1
@default 1.0000

@arg time
@text Time
@type number
@decimals 3
@default 1


@command configure
@text Configure
@desc Change the target event's configuration

@arg target
@text Target
@desc Enter the event id or "player". Blank for current event.

@arg config
@text Configuration
@type note

@arg time
@text Time
@type number
@decimals 3
@default 0

@command set
@text Set Property
@desc Change the value of one of these properties

@arg property
@text Property
@type select
@option Lock Camera             @value lockCamera
@option Allow Rotation          @value allowRotation
@option Allow Pitch             @value allowPitch
@option Allow Diagonal Movement @value diagonalMovement
@option Turn Increment          @value turnIncrement
@option Turn Speed              @value turnSpeed
@option Instant Movement        @value instantMovement
@option Mouse Camera Input      @value inputCameraMouse
@option Gamepad Camera Input    @value inputCameraGamepad
@option Camera Collision        @value cameraCollision    
@option Airship Height          @value airshipHeight
@option Allow Glide             @value allowGlide
@option Animation Depth         @value animationDepth
@option Alpha Fog               @value alphaFog
@option Glow Intensity          @value glowIntensity
@option Glow Radius             @value glowRadius
@option Glow Through Walls      @value glowThroughWalls
@option Highlight               @value highlight
@option Highlight Radius        @value highlightRadius
@option Highlight Through Walls @value highlightThroughWalls
@option Chromatic Aberration    @value chromaticAberration
@option Chromatic Aberration Angle @value chromaticAberrationAngle
@option Aperture                @value aperture
@option Blur Strength           @value blurStrength
@option Focus Distance          @value focusDistance
@option Bloom                   @value bloom
@option Bloom Threshold         @value bloomThreshold
@option Bloom Radius            @value bloomRadius

@arg value
@text Value

@arg time
@text Time
@type number
@decimals 3
@default 0


@command enable
@text Enable / Disable
@desc Enable or Disable the 3D rendering

@arg enabled
@text Enabled
@type boolean
@default true

@arg fadeType
@text Fade Type
@type select
@option Instant @value 2
@option Fade Black @value 0
@option Fade White @value 1
@default 2



@command light
@text Lighting
@desc Change light settings.

@arg color
@text Ambient Color
@desc The ambient light lights everything in the scene. When sunlight is enabled, this is the color of the shadows.

@arg sunColor
@text Sunlight Color
@desc The color of the sunlight. Set to black to disable sunlight.

@arg sunYaw
@text Sunlight Yaw
@desc The horizontal angle of the sunlight and shadows.
@type number
@decimals 3
@min 0
@max 360

@arg sunPitch
@text Sunlight Pitch
@desc The vertical angle of the sunlight. Closer to 90 = longer shadows.
@type number
@decimals 0
@min -180
@max 180

@arg time
@text Time
@type number
@decimals 0
@default 1


@command skybox
@text Skybox
@desc skybox settings

@arg index
@text Index
@desc Which skybox to modify
@type number
@default 0
@min 0

@arg default
@text Default
@desc this texture will be used for any sides not defined.
@type file
@dir img/parallaxes/
@require 1
@default clear

@arg north
@text North
@type file
@dir img/parallaxes/
@require 1

@arg south
@text South
@type file
@dir img/parallaxes/
@require 1

@arg east
@text East
@type file
@dir img/parallaxes/
@require 1

@arg west
@text West
@type file
@dir img/parallaxes/
@require 1

@arg top
@text Top
@type file
@dir img/parallaxes/
@require 1

@arg bottom
@text Bottom
@type file
@dir img/parallaxes/
@require 1

@arg alpha
@text Alpha
@desc transparency of the skybox layer
@type number
@decimals 3
@min 0 @max 1
@default 1.0

@arg time
@text Time
@desc transition time in seconds (for alpha)
@type number
@decimals 3
@min 0
@default 0.0

@arg autoRotate
@text Auto Rotate
@desc In degrees per second.
@type struct<Rotation>


@command skyball
@text Skyball
@desc spherical skybox settings

@arg index
@text Index
@desc Which skybox to modify
@type number
@default 0
@min 0

@arg texture
@text Texture
@type file
@dir img/parallaxes/
@require 1

@arg repeat
@text Repeat Texture
@desc How many times the texture should be repeated
@type number
@min 1
@default 1

@arg alpha
@text Alpha
@desc transparency of the skybox layer
@type number
@decimals 3
@min 0 @max 1
@default 1.0

@arg time
@text Time
@desc transition time in seconds (for alpha)
@type number
@decimals 3
@min 0
@default 0.0

@arg autoRotate
@text Auto Rotate
@desc In degrees per second.
@type struct<Rotation>


@command action
@text Action
@desc Play/Pause/Stop animations for imported models

@arg playback
@text playback
@type select
@option Play @value play
@option Pause @value pause
@option Stop @value stop
@default play

@arg loop
@text Loop
@desc Whether the action should loop
@type boolean
@default false

@arg name
@text Name
@desc The name of the action to play/pause/stop
@type text
@default

@arg target
@text Target
@desc Enter the event id or "player". Blank for current event

@arg important
@text important
@desc Prevents the action from being cancelled when changing states
@type boolean
@default false

@arg wait
@text Wait
@desc Wait for the action to finish before continuing
@type boolean
@default false

@param options
@text Option Settings

@param 3dMenu
@text 3D Options Menu
@desc Whether 3D options will be in a submenu, regular options menu, or disabled.
@parent options
@type select
@option SUBMENU
@option ENABLE
@option DISABLE
@default ENABLE


@param renderDistOptionName
@text Render Distance Option Name
@desc symbol name: mv3d-renderDist
@parent options
@type text
@default Render Distance

@param renderDist
@text Render Distance Default
@desc The maximum distance that can be rendered by the camera.
@parent renderDistOptionName
@type number
@default 25
@min 0

@param renderDistOption
@text Render Distance Option
@desc Should Render Distance appear on options menu?
@parent renderDistOptionName
@type boolean
@default true

@param renderDistMin
@text Render Distance Min
@parent renderDistOptionName
@type number
@default 10
@min 0

@param renderDistMax
@text Render Distance Max
@parent renderDistOptionName
@type number
@default 100
@min 0


@param mipmapOptionName
@text Mipmapping Option Name
@desc symbol name: mv3d-mipmap
@parent options
@type text
@default Mipmapping

@param mipmap
@text Mipmapping Default
@parent mipmapOptionName
@type boolean
@default true

@param mipmapOption
@text Mipmapping Option
@desc Should Mipmapping appear on options menu?
@parent mipmapOptionName
@type boolean
@default false


@param fovOptionName
@text FOV Option Name
@desc symbol name: mv3d-fov
@parent options
@type text
@default FOV

@param fov
@text FOV Default
@parent fovOptionName
@type number
@default 70
@min 0 @max 180

@param fovOption
@text FOV Option
@desc Should FOV appear on options menu?
@parent fovOptionName
@type boolean
@default false

@param fovMin
@text FOV Min
@parent fovOptionName
@type number
@default 50
@min 0 @max 180

@param fovMax
@text FOV Max
@parent fovOptionName
@type number
@default 100
@min 0 @max 180

@param invertYOptionName
@text Invert Y Axis Option Name
@desc symbol name: mv3d-inverty
@parent options
@type text
@default Invert Y Axis

@param invertYOption
@text Invert Y Axis Option
@desc Should invert Y axis appear on options menu?
@parent invertYOptionName
@type boolean
@default true

@param lookSensitivityOptionName
@text Look Sensitivity Option Name
@desc symbol name: mv3d-looksensitivity
@parent options
@type text
@default Look Sensitivity

@param lookSensitivityOption
@text Look Sensitivity Option
@desc Should look sensitivity appear in options menu
@parent lookSensitivityOptionName
@type boolean
@default true

@param spacer|graphics @text‏‏‎ ‎@desc ===============================================

@param graphics
@text Graphics

#param webgpu
#text Enable WebGPU
#desc Experimental! Not compatible with Effekseer until future update
#parent graphics
#type boolean
#default false

@param samplingMode
@text Sampling Mode
@desc The sampling mode used for textures.
@parent graphics
@type select
@option NEAREST_SAMPLINGMODE
@option BILINEAR_SAMPLINGMODE
@option TRILINEAR_SAMPLINGMODE
@option NEAREST_LINEAR_MIPLINEAR
@default NEAREST_LINEAR_MIPLINEAR

@param antialiasing
@text Antialiasing
@parent graphics
@type boolean
@default true

@param edgefix
@text Edge Fix
@desc Fixes rendering issues at the edges of tiles.
@parent graphics
@type number
@decimals 1
@default 0.5

@param alphatest
@text Alpha Cutoff
@desc Pixels with alpha below this value will not be rendered.
@parent graphics
@type number
@decimals 2
@min 0.01 @max 1
@default 0.51

@param lightLimit
@text Lights Per Mesh
@parent graphics
@type number
@min 4
@max 11
@default 8

@param backfaceCulling
@text Backface Culling
@parent graphics
@type boolean
@default true

@param cameraCollision
@text Camera Collision
@desc Type2 allows objects to be between the camera and player, Type1 does not.
@parent graphics
@type combo
@option Off
@option Type1
@option Type2
@option Type1 Smoothed
@option Type2 Smoothed
@default Type2 Smoothed

@param resScale
@text Resolution Scale
@desc Scale the resolution
@parent graphics
@type number
@decimals 2
@min 0 @max 1
@default 1

@param spacer|map @text‏‏‎ ‎@desc ===============================================

@param map
@text Map Settings

@param cellSize
@text Cell Size
@desc The size of the chunks the map is divided into.
@parent map
@type number
@default 10

@param unloadCells
@text Unload Far Cells
@desc Unload cells outside the render distance.
@parent map
@type boolean
@default false

@param eventsUpdateNear
@text Update All Events in Render Distance
@parent map
@type boolean
@default true

@param mapDefaults
@text Map Defaults
@parent map
@type note
@default
"enable(true)\nsun(white)\nambient(default)\nfog(black|20,100)\nceiling(backface:true)"


@param spacer|input @text‏‏‎ ‎@desc ===============================================

@param input
@text Input & Gameplay

@param inputCameraMouse
@text Mouse Camera Control
@parent input
@type boolean
@default false

@param inputCameraGamepad
@text Gamepad Camera Control
@parent input
@type boolean
@default true

@param inputGamepadTurnButton
@text Gamepad Turn Button
@parent input
@type select
@option Bumpers
@option Triggers
@option Unchanged
@default Bumpers

@param WASD
@text WASD
@parent input
@type boolean
@default true

@param dir8Movement
@text Diagonal Movement
@desc In smart mode, when diagonal movement fails, try moving straight.
@parent input
@type combo
@option Off
@option Diagonal Basic
@option Diagonal Basic 3D Only
@option Diagonal Smart
@option Diagonal Smart 3D Only
@default Diagonal Smart

@param keyboardPitch
@text Control Pitch
@parent input
@desc Allow player to change pitch with pageup & pagedown.
@type boolean
@default true

@param keyboardTurn
@text Allow Turning
@parent input
@desc Allows rotating camera with keyboard in 3rd person. Rotating is always allowed in 1st person.
@type select
@option Turn with Q+E (requires WASD) @value QE
@option Turn with A+D and left+right @value AD
@option disabled
@default QE

@param keyboardStrafe
@text Allow Strafing
@parent input
@desc Allows strafing in 1st person mode.
@type select
@option Strafe with Q+E (requires WASD) @value QE
@option Strafe with A+D and left+right @value AD
@option disabled
@default QE

@param turnIncrement
@text Turn Increment
@parent input
@desc How many degrees the camera will turn when you press the turn button. Other numbers may also be entered.
@type combo
@option 90
@option 45
@option SMOOTH
@default 90

@param yawSpeed
@text Turn Speed
@parent input
@desc Speed when turning with keyboard (in degrees per second).
@type number
@default 180

@param pitchSpeed
@text Pitch Speed
@parent input
@desc Speed when changing pitch with keyboard (in degrees per second).
@type number
@default 90


@param stairThresh
@text Stair Threshold
@desc If the distance in height between two tiles is less than this, they will be passable.
@parent input
@type number
@decimals 2
@default 0.1

@param walkOffEdge
@text Walk off Edge
@parent input
@type number
@decimals 2
@default 0
@desc With drops smaller than this, characters will be able to walk off edges. 0 or false to disable. true for always.

@param walkOnEvents
@text Walk on Events
@parent input
@type boolean
@default true

@param gravity
@text Gravity
@desc The speed characters will fall, in tiles per second.
@parent input
@type number
@decimals 2
@default 8

@param spacer|tileconfig @text‏‏‎ ‎@desc ===============================================

@param tileconfig
@text Tile Config

@param wallTileSettings
@text Wall Tile Settings
@desc The default tile settings for wall tiles.
@parent tileconfig
@type note
@default "height(2)"

@param tableTileSettings
@text Table Tile Settings
@desc The default tile settings for table tiles.
@parent tileconfig
@type note
@default "height(0.33)"

@param starTileSettings
@text Star Tile Settings
@desc The default tile settings for star tiles.
@parent tileconfig
@type note
@default "tileOffset(y:1)\npass(*)"

@param ceilingHeight
@text Ceiling Height
@desc Default height of ceiling for maps with ceiling enabled.
@parent tileconfig
@type number
@min -9999 @max 9999
@decimals 3
@default 2.0

@param baseHeight
@text Base Height
@desc Extra height added to every tile on the map.
@parent tileconfig
@type number
@min 0 @max 1
@decimals 3
@default 0.25

@param layerDist
@text Layering Distance
@desc The distance between tile layers. If this is too small
there may be z-fighting issues. (default: 0.0100)
@parent tileconfig
@type number
@decimals 4
@default 0.0100

@param animDelay
@text Animation Speed
@desc The number of milliseconds between each frame in tile animations.
@parent tileconfig
@type number
@default 333

@param regions
@text Regions
@desc use regions to determine tile height.
@parent tileconfig
@type struct<RegionHeight>[]
@default ["{\"regionId\":\"1\",\"conf\":\"height(1)\"}","{\"regionId\":\"2\",\"conf\":\"height(2)\"}","{\"regionId\":\"3\",\"conf\":\"height(3)\"}","{\"regionId\":\"4\",\"conf\":\"height(4)\"}","{\"regionId\":\"5\",\"conf\":\"height(5)\"}","{\"regionId\":\"6\",\"conf\":\"height(6)\"}","{\"regionId\":\"7\",\"conf\":\"height(7)\"}"]

@param ttags
@text Terrain Tags
@desc use terrain tags to determine tile height.
@parent tileconfig
@type struct<TTagHeight>[]
@default ["{\"terrainTag\":\"1\",\"conf\":\"shape(xcross),height(1),fringe(0)\"}","{\"terrainTag\":\"2\",\"conf\":\"shape(fence),height(1)\"}"]

@param spacer|characters @text‏‏‎ ‎@desc ===============================================

@param characters
@text Characters

@param heightTrigger
@text Event Trigger Height
@desc If true, events will need to be at the same elevation as the player to be triggered.
@parent characters
@type boolean
@default true

@param eventCharDefaults
@text Character Event Settings
@parent characters
@type note
@default "shadow(0.8,4)\nshape(sprite,0.45p)\nscale(1)"

@param eventObjDefaults
@text Object Event Settings
@parent characters
@type note
@default "shadow(0)\nshape(sprite,0.45)\nscale(1)"

@param eventTileDefaults
@text Tile Event Settings
@parent characters
@type note
@default "shadow(0)\nshape(flat)\nscale(1)"

@param eventHeight
@text Event "Above Characters" Default Height
@parent characters
@type number
@decimals 1
@default 2.0

@param boatSettings
@text Boat Settings
@parent characters
@type struct<BoatStruct>
@default {"conf":"shadow(0.8,4),shape(sprite),scale(1),bush(false)"}

@param shipSettings
@text Ship Settings
@parent characters
@type struct<BoatStruct>
@default {"conf":"shadow(0.8,4),shape(sprite),scale(1),bush(false)"}

@param airshipSettings
@text Airship Settings
@parent characters
@type struct<AirshipStruct>
@default {"conf":"shadow(1,6),shape(sprite),scale(1),bush(false)","height":"2.0","bushLanding":"false"}

@param allowGlide
@text Allow Glide
@desc If true, collision detection for flying characters will use only current elevation and not target elevation.
@parent characters
@type boolean
@default true

@param spriteDynamicOffset
@text Sprite Dynamic Offset
@desc Moves sprites slightly closer to the camera. Between 0 and 0.5. Values with "p" will be adjusted based on pitch.
@parent characters
@type combo
@option 0
@option 0.25
@option 0.45
@option 0.5
@option 0.25p
@option 0.45p
@option 0.5p
@default 0.45

@param animationDepth
@text Animation Depth
@desc Whether animations should be drawn with depth (true) or on top of everything else (false)
@parent characters
@type boolean
@default false

@param spacer|assets @text‏‏‎ ‎@desc ===============================================

@param assets
@text Assets

@param diagSymbol
@text Diagonal Sprite Symbol
@desc Character sheets with this symbol contain diagonal sprites. Leave blank to use diagonal sprites with all images.
@parent assets
@type text
@default {d}

@param shadowTexture
@text Shadow Texture
@parent assets
@type file
@dir img/MZ3D
@require 1
@default shadow

@param alphaMask
@text Bush Alpha Texture
@parent assets
@type file
@dir img/MZ3D
@require 1
@default bushAlpha

@param errorTexture
@text Error Texture
@parent assets
@type file
@dir img/MZ3D
@require 1
@default errorTexture

@param requiredImages
@text Other Required Images
@desc Specify additional images here to prevent them from being excluded during deployment.
@parent assets
@type file[]
@dir img/MZ3D
@require 1

@param useTextureData
@text Use Texture Data
@parent assets
@desc Allow tile data to be loaded through json files.
@type boolean
@default true


@param spacer|shadow @text‏‏‎ ‎@desc ===============================================

@param shadow
@text Light & Shadow

@param dynShadowEnabled
@text Use Dynamic Shadows
@parent shadow
@type boolean
@default true

@param defShadowQuality
@text Default Shadow Quality
@parent shadow
@type combo
@option OFF
@option LOW
@option MEDIUM
@option HIGH
@option ULTRA
@default MEDIUM

@param shadowQualityOptionName
@text Shadow Quality Option Name
@desc symbol name: mv3d-dynShadow
@parent shadow
@type text
@default Shadow Quality

@param softShadows
@text Soft Shadows
@parent shadow
@type boolean
@default true

@param abnormal
@text Cross Normals Face Up
@desc Removes the darkness on fence and cross back faces.
@parent shadow
@type boolean
@default true

@param dynamicNormals
@text Dynamic Normals
@desc Characters won't be shaded when facing away from the sun.
@parent shadow
@type boolean
@default true

@param specularMode
@text Specular Mode
@desc How a light's specular color is determined
@parent shadow
@type select
@option WHITE
@option SAME_AS_DIFFUSE
@option AVERAGE_DIFFUSE
@default AVERAGE_DIFFUSE

@param spacer|postProcessing @text‏‏‎ ‎@desc ===============================================

@param postProcessing
@text Post-Processing and Effects

@param alphaFog
@text Alpha Fog
@parent postProcessing
@desc How far the alpha fog will reach. 0=off, 1=full
@type number
@decimals 4
@min 0 @max 1
@default 0.1

@param glow
@text Glow Effect
@parent postProcessing
@desc The intensity of the glow effect.
@type combo
@option Off
@option 0.5
@option 1.0
@option 2.0
@default Off

@param glowRadius
@text Glow Radius
@parent glow
@desc The size of the glow effect.
@type number
@decimals 0
@min 0
@default 48

@param glowThroughWalls
@text Glow Through Walls
@parent glow
@desc Makes the glow effect visible through walls
@type boolean
@default false

@param highlight
@text Highlight
@parent postProcessing
@desc if higher than zero, enables the highlight effect and defines the size of the highlight.
@type select
@option Disabled @value false
@option Enabled @value true
@option Inner @value inner
@option Outer @value outer
@default true

@param highlightRadius
@text Highlight Radius
@parent highlight
@desc if higher than zero, enables the highlight effect and defines the size of the highlight.
@type number
@decimals 3
@min 0
@default 1.0

@param highlightThroughWalls
@text Highlight Through Walls
@parent highlight
@desc Makes the highlight effect visible through walls
@type boolean
@default false


@param chromaticAberration
@text Chromatic Aberration
@parent postProcessing
@dexc The intensity of the chromatic aberration effect
@type number
@default 0

@param chromaticAberrationAngle
@text Chromatic Aberration Angle
@parent chromaticAberration
@dexc The angle of the chromatic aberration effect
@type number
@default 45

@param aperture
@text Depth Of Field Aperture
@parent postProcessing
@desc Larger values cause things outside of focus to blur more quickly
@type number
@default 36

@param blurStrength
@text Depth Of Field Blur Strength
@parent aperture
@desc The strength of the blur effect for depth of field
@type number
@decimals 3
@default 1

@param focusDistance
@text Focus Distance
@parent aperture
@desc If auto, focuses on the camera target. If mouse, focuses on the mouse position. Can also be a number.
@type combo
@option auto
@option mouse
@option center
@default auto

@param bloom
@text Bloom
@parent postProcessing
@desc The intensity of the bloom effect
@type number
@decimals 3
@default 1

@param bloomThreshold
@text Bloom Threshold
@parent bloom
@desc the brightness threshold for the bloom effect. Values brighter than this will be bloomed (0-1)
@type number
@min 0 @max 1
@decimals 3
@default .9

@param bloomRadius
@text Bloom Radius
@parent bloom
@desc The size of the bloom effect
@type number
@min 0
@default 128

@param bloomSkyboxes
@text Apply Bloom to Skyboxes
@parent bloom
@desc Whether to apply the bloom effect to skyboxes
@type boolean
@default true


@param preloadModels
@text Preload Models
@desc Waits for models to load during map load. Fixes automatic height on models during map generation.
@parent assets
@type boolean
@default true

@param modelOptimization
@text Model Optimization
@parent assets
@type select
@option None
@option Instancing
@option Cloning
@default Cloning
@desc Instancing works best for performance. Cloning works better with lighting.

@param useBumpTexture
@text Use Bump Texture
@parent assets
@desc uses .bump.png extension
@type boolean
@default true

@param useParallaxOcclusion
@text Parallax Occlusion
@parent assets
@desc Uses the alpha channel of the bump texture.
@type boolean
@default false

@param parallaxScale
@text Parallax Scale
@parent assets
@desc The size of the parallax occlusion effect
@type number
@default 0.05
@min 0.001
@max 0.2
@decimals 3

@param useSpecularTexture
@text Use Specular Texture
@parent assets
@desc uses .specular.png extension
@type boolean
@default true

@param diffuseAsSpecular
@text Diffuse as Specular
@parent assets
@desc If there is no specular texture, use the diffuse texture.
@type boolean
@default false

@param useEmissiveTexture
@text Use Emissive Texture
@parent assets
@desc uses .emissive.png extension
@type boolean
@default true

@param useAmbientTexture
@text Use Ambient Texture
@parent assets
@desc uses .ambient.png extension
@type boolean
@default false



@param dofOptionName
@text Depth of Field Option Name
@desc symbol name: mv3d-blurLevel
@parent options
@type text
@default Depth of Field

@param dofDefault
@text Depth of Field Default
@desc Default level for the depth of field option
@parent dofOptionName
@type select
@option OFF
@option LOW
@option MEDIUM
@option HIGH
@default MEDIUM

@param dofOption
@text Depth of Field Option
@desc Should Depth of Field appear on options menu?
@parent dofOptionName
@type boolean
@default true


@param bloomOptionName
@text Bloom Option Name
@desc symbol name: mv3d-bloomLevel
@parent options
@type text
@default Bloom

@param bloomDefault
@text Bloom Default
@desc Default level for the bloom option
@parent bloomOptionName
@type select
@option OFF
@option LOW
@option MEDIUM
@option HIGH
@default MEDIUM

@param bloomOption
@text Depth of Field Option
@desc Should Bloom appear on options menu?
@parent bloomOptionName
@type boolean
@default true



@param chromaticAberrationOptionName
@text Chromatic Aberration Option Name
@desc symbol name: mv3d-chromaticAberration
@parent options
@type text
@default Chromatic Aberration

@param chromaticAberrationDefault
@text Chromatic Aberration Default
@desc Default level for the chromatic aberration option
@parent chromaticAberrationOptionName
@type boolean
@default true

@param chromaticAberrationOption
@text Chromatic Aberration Option
@desc Should Chromatic Aberration appear on options menu?
@parent chromaticAberrationOptionName
@type boolean
@default true
*/
/*~struct~RegionHeight:
@param regionId
@text Region Id
@type number
@min 1 @max 255
@default 1

@param conf
@text Configuration Functions
@desc See tileset configuration for list of functions
@type text
@default height(2)
*/

/*~struct~TTagHeight:
@param terrainTag
@text Terrain Tag
@type number
@min 1 @max 7
@default 1

@param conf
@text Configuration Functions
@desc See tileset configuration for list of functions
@type text
@default shape(flat),height(0)
*/

/*~struct~BoatStruct:
@param conf
@text Settings
@type text
@default shadow(0.8,4),shape(sprite),scale(1),bush(false)

*/

/*~struct~AirshipStruct:
@param conf
@text Settings
@type text
@default shadow(1,6),shape(sprite),scale(1),bush(false)

@param height
@text Elevation
@type number
@decimals 1
@default 2.0

@param bushLanding
@text Land on Bush Tiles
@desc Whether the airship can land on bush tiles.
@type boolean
@default false

*/

/*~struct~XY:
@param x
@text X
@type number
@decimals 3
@default 0

@param y
@text Y
@type number
@decimals 3
@default 0

*/


/*~struct~XYZ:
@param x
@text X
@type number
@decimals 3
@default 0

@param y
@text Y
@type number
@decimals 3
@default 0

@param z
@text Z
@type number
@decimals 3
@default 0
*/


/*~struct~Rotation:
@param y
@text Yaw
@type number
@decimals 3
@default 0

@param x
@text Pitch
@type number
@decimals 3
@default 0

@param z
@text Roll
@type number
@decimals 3
@default 0
*/


/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
/***/ ((module) => {

function _arrayLikeToArray(arr, len) {(null == len || len > arr.length) && (len = arr.length);for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}module.exports = _arrayLikeToArray, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js":
/***/ ((module) => {

function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}module.exports = _arrayWithHoles, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var arrayLikeToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return arrayLikeToArray(arr);}module.exports = _arrayWithoutHoles, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js":
/***/ ((module) => {

function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");}module.exports = _classCallCheck, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/createClass.js":
/***/ ((module) => {

function _defineProperties(target, props) {for (var descriptor, i = 0; i < props.length; i++) descriptor = props[i], descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);}function _createClass(Constructor, protoProps, staticProps) {return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;}module.exports = _createClass, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
/***/ ((module) => {

function _defineProperty(obj, key, value) {return key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = value, obj;}module.exports = _defineProperty, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/extends.js":
/***/ ((module) => {

function _extends() {return module.exports = _extends = Object.assign || function (target) {for (var source, i = 1; i < arguments.length; i++) for (var key in source = arguments[i], source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);return target;}, module.exports["default"] = module.exports, module.exports.__esModule = !0, _extends.apply(this, arguments);}module.exports = _extends, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js":
/***/ ((module) => {

function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}module.exports = _interopRequireDefault, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js":
/***/ ((module) => {

function _iterableToArray(iter) {if ("undefined" != typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) return Array.from(iter);}module.exports = _iterableToArray, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
/***/ ((module) => {

function _iterableToArrayLimit(arr, i) {var _i = arr && ("undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]);if (null != _i) {var _s,_e,_arr = [],_n = !0,_d = !1;try {for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0);} catch (err) {_d = !0, _e = err;} finally {try {_n || null == _i["return"] || _i["return"]();} finally {if (_d) throw _e;}}return _arr;}}module.exports = _iterableToArrayLimit, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/nonIterableRest.js":
/***/ ((module) => {

function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}module.exports = _nonIterableRest, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js":
/***/ ((module) => {

function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}module.exports = _nonIterableSpread, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/slicedToArray.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var arrayWithHoles = __webpack_require__("./node_modules/@babel/runtime/helpers/arrayWithHoles.js"),iterableToArrayLimit = __webpack_require__("./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"),unsupportedIterableToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"),nonIterableRest = __webpack_require__("./node_modules/@babel/runtime/helpers/nonIterableRest.js");function _slicedToArray(arr, i) {return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();}module.exports = _slicedToArray, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var arrayWithoutHoles = __webpack_require__("./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"),iterableToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/iterableToArray.js"),unsupportedIterableToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"),nonIterableSpread = __webpack_require__("./node_modules/@babel/runtime/helpers/nonIterableSpread.js");function _toConsumableArray(arr) {return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();}module.exports = _toConsumableArray, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/typeof.js":
/***/ ((module) => {

function _typeof(obj) {"@babel/helpers - typeof";return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? (module.exports = _typeof = function (obj) {return typeof obj;}, module.exports["default"] = module.exports, module.exports.__esModule = !0) : (module.exports = _typeof = function (obj) {return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;}, module.exports["default"] = module.exports, module.exports.__esModule = !0), _typeof(obj);}module.exports = _typeof, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var arrayLikeToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");function _unsupportedIterableToArray(o, minLen) {if (o) {if ("string" == typeof o) return arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);return "Object" === n && o.constructor && (n = o.constructor.name), "Map" === n || "Set" === n ? Array.from(o) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? arrayLikeToArray(o, minLen) : void 0;}}module.exports = _unsupportedIterableToArray, module.exports["default"] = module.exports, module.exports.__esModule = !0;

/***/ }),

/***/ "./node_modules/@babel/runtime/regenerator/index.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = __webpack_require__("./node_modules/regenerator-runtime/runtime.js");

/***/ }),

/***/ "./node_modules/complex.js/complex.js":
/***/ (function(module, exports) {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root) {"use strict";function logHypot(a, b) {var _a = Math.abs(a),_b = Math.abs(b);return 0 === a ? Math.log(_b) : 0 === b ? Math.log(_a) : 3e3 > _a && 3e3 > _b ? .5 * Math.log(a * a + b * b) : Math.log(a / Math.cos(Math.atan2(b, a)));}function Complex(a, b) {if (!(this instanceof Complex)) return new Complex(a, b);var z = parse(a, b);this.re = z.re, this.im = z.im;}var cosh = function (x) {return .5 * (Math.exp(x) + Math.exp(-x));},sinh = function (x) {return .5 * (Math.exp(x) - Math.exp(-x));},cosm1 = function (x) {var limit = Math.PI / 4;if (x < -limit || x > limit) return Math.cos(x) - 1;var xx = x * x;return xx * (-.5 + xx * (1 / 24 + xx * (-1 / 720 + xx * (1 / 40320 + xx * (-1 / 3628800 + xx * (1 / 4790014600 + xx * (-1 / 87178291200 + xx * (1 / 20922789888e3))))))));},hypot = function (x, y) {var a = Math.abs(x),b = Math.abs(y);return 3e3 > a && 3e3 > b ? Math.sqrt(a * a + b * b) : (a < b ? (a = b, b = x / y) : b = y / x, a * Math.sqrt(1 + b * b));},parser_exit = function () {throw SyntaxError("Invalid Param");},parse = function (a, b) {var z = { re: 0, im: 0 };if (void 0 === a || null === a) z.re = z.im = 0;else if (void 0 !== b) z.re = a, z.im = b;else switch (typeof a) {case "object":if ("im" in a && "re" in a) z.re = a.re, z.im = a.im;else if ("abs" in a && "arg" in a) {if (!Number.isFinite(a.abs) && Number.isFinite(a.arg)) return Complex.INFINITY;z.re = a.abs * Math.cos(a.arg), z.im = a.abs * Math.sin(a.arg);} else if ("r" in a && "phi" in a) {if (!Number.isFinite(a.r) && Number.isFinite(a.phi)) return Complex.INFINITY;z.re = a.r * Math.cos(a.phi), z.im = a.r * Math.sin(a.phi);} else 2 === a.length ? (z.re = a[0], z.im = a[1]) : parser_exit();break;case "string":z.im = z.re = 0;var tokens = a.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),plus = 1,minus = 0;null === tokens && parser_exit();for (var c, i = 0; i < tokens.length; i++) c = tokens[i], " " === c || "\t" === c || "\n" === c || ("+" === c ? plus++ : "-" === c ? minus++ : "i" === c || "I" === c ? (0 === plus + minus && parser_exit(), " " === tokens[i + 1] || isNaN(tokens[i + 1]) ? z.im += parseFloat((minus % 2 ? "-" : "") + "1") : (z.im += parseFloat((minus % 2 ? "-" : "") + tokens[i + 1]), i++), plus = minus = 0) : ((0 === plus + minus || isNaN(c)) && parser_exit(), "i" === tokens[i + 1] || "I" === tokens[i + 1] ? (z.im += parseFloat((minus % 2 ? "-" : "") + c), i++) : z.re += parseFloat((minus % 2 ? "-" : "") + c), plus = minus = 0));0 < plus + minus && parser_exit();break;case "number":z.im = 0, z.re = a;break;default:parser_exit();}return isNaN(z.re) || isNaN(z.im), z;};Complex.prototype = { re: 0, im: 0, sign: function () {var abs = this.abs();return new Complex(this.re / abs, this.im / abs);}, add: function (a, b) {var z = new Complex(a, b);return this.isInfinite() && z.isInfinite() ? Complex.NAN : this.isInfinite() || z.isInfinite() ? Complex.INFINITY : new Complex(this.re + z.re, this.im + z.im);}, sub: function (a, b) {var z = new Complex(a, b);return this.isInfinite() && z.isInfinite() ? Complex.NAN : this.isInfinite() || z.isInfinite() ? Complex.INFINITY : new Complex(this.re - z.re, this.im - z.im);}, mul: function (a, b) {var z = new Complex(a, b);return this.isInfinite() && z.isZero() || this.isZero() && z.isInfinite() ? Complex.NAN : this.isInfinite() || z.isInfinite() ? Complex.INFINITY : 0 === z.im && 0 === this.im ? new Complex(this.re * z.re, 0) : new Complex(this.re * z.re - this.im * z.im, this.re * z.im + this.im * z.re);}, div: function (a, b) {var z = new Complex(a, b);if (this.isZero() && z.isZero() || this.isInfinite() && z.isInfinite()) return Complex.NAN;if (this.isInfinite() || z.isZero()) return Complex.INFINITY;if (this.isZero() || z.isInfinite()) return Complex.ZERO;a = this.re, b = this.im;var t,x,c = z.re,d = z.im;return 0 === d ? new Complex(a / c, b / c) : Math.abs(c) < Math.abs(d) ? (x = c / d, t = c * x + d, new Complex((a * x + b) / t, (b * x - a) / t)) : (x = d / c, t = d * x + c, new Complex((a + b * x) / t, (b - a * x) / t));}, pow: function (a, b) {var z = new Complex(a, b);if (a = this.re, b = this.im, z.isZero()) return Complex.ONE;if (0 === z.im) {if (0 === b && 0 < a) return new Complex(Math.pow(a, z.re), 0);if (0 === a) switch ((z.re % 4 + 4) % 4) {case 0:return new Complex(Math.pow(b, z.re), 0);case 1:return new Complex(0, Math.pow(b, z.re));case 2:return new Complex(-Math.pow(b, z.re), 0);case 3:return new Complex(0, -Math.pow(b, z.re));}}if (0 === a && 0 === b && 0 < z.re && 0 <= z.im) return Complex.ZERO;var arg = Math.atan2(b, a),loh = logHypot(a, b);return a = Math.exp(z.re * loh - z.im * arg), b = z.im * loh + z.re * arg, new Complex(a * Math.cos(b), a * Math.sin(b));}, sqrt: function () {var re,im,a = this.re,b = this.im,r = this.abs();if (0 <= a) {if (0 === b) return new Complex(Math.sqrt(a), 0);re = .5 * Math.sqrt(2 * (r + a));} else re = Math.abs(b) / Math.sqrt(2 * (r - a));return im = 0 >= a ? .5 * Math.sqrt(2 * (r - a)) : Math.abs(b) / Math.sqrt(2 * (r + a)), new Complex(re, 0 > b ? -im : im);}, exp: function () {var tmp = Math.exp(this.re);return 0 === this.im, new Complex(tmp * Math.cos(this.im), tmp * Math.sin(this.im));}, expm1: function () {var a = this.re,b = this.im;return new Complex(Math.expm1(a) * Math.cos(b) + cosm1(b), Math.exp(a) * Math.sin(b));}, log: function () {var a = this.re,b = this.im;return 0 === b && 0 < a, new Complex(logHypot(a, b), Math.atan2(b, a));}, abs: function () {return hypot(this.re, this.im);}, arg: function () {return Math.atan2(this.im, this.re);}, sin: function () {var a = this.re,b = this.im;return new Complex(Math.sin(a) * cosh(b), Math.cos(a) * sinh(b));}, cos: function () {var a = this.re,b = this.im;return new Complex(Math.cos(a) * cosh(b), -Math.sin(a) * sinh(b));}, tan: function () {var a = 2 * this.re,b = 2 * this.im,d = Math.cos(a) + cosh(b);return new Complex(Math.sin(a) / d, sinh(b) / d);}, cot: function () {var a = 2 * this.re,b = 2 * this.im,d = Math.cos(a) - cosh(b);return new Complex(-Math.sin(a) / d, sinh(b) / d);}, sec: function () {var a = this.re,b = this.im,d = .5 * cosh(2 * b) + .5 * Math.cos(2 * a);return new Complex(Math.cos(a) * cosh(b) / d, Math.sin(a) * sinh(b) / d);}, csc: function () {var a = this.re,b = this.im,d = .5 * cosh(2 * b) - .5 * Math.cos(2 * a);return new Complex(Math.sin(a) * cosh(b) / d, -Math.cos(a) * sinh(b) / d);}, asin: function () {var a = this.re,b = this.im,t1 = new Complex(b * b - a * a + 1, -2 * a * b).sqrt(),t2 = new Complex(t1.re - b, t1.im + a).log();return new Complex(t2.im, -t2.re);}, acos: function () {var a = this.re,b = this.im,t1 = new Complex(b * b - a * a + 1, -2 * a * b).sqrt(),t2 = new Complex(t1.re - b, t1.im + a).log();return new Complex(Math.PI / 2 - t2.im, t2.re);}, atan: function () {var a = this.re,b = this.im;if (0 === a) {if (1 === b) return new Complex(0, 1 / 0);if (-1 === b) return new Complex(0, -Infinity);}var d = a * a + (1 - b) * (1 - b),t1 = new Complex((1 - b * b - a * a) / d, -2 * a / d).log();return new Complex(-.5 * t1.im, .5 * t1.re);}, acot: function () {var a = this.re,b = this.im;if (0 === b) return new Complex(Math.atan2(1, a), 0);var d = a * a + b * b;return 0 == d ? new Complex(0 === a ? 0 : a / 0, 0 === b ? 0 : -b / 0).atan() : new Complex(a / d, -b / d).atan();}, asec: function () {var a = this.re,b = this.im;if (0 === a && 0 === b) return new Complex(0, 1 / 0);var d = a * a + b * b;return 0 == d ? new Complex(0 === a ? 0 : a / 0, 0 === b ? 0 : -b / 0).acos() : new Complex(a / d, -b / d).acos();}, acsc: function () {var a = this.re,b = this.im;if (0 === a && 0 === b) return new Complex(Math.PI / 2, 1 / 0);var d = a * a + b * b;return 0 == d ? new Complex(0 === a ? 0 : a / 0, 0 === b ? 0 : -b / 0).asin() : new Complex(a / d, -b / d).asin();}, sinh: function () {var a = this.re,b = this.im;return new Complex(sinh(a) * Math.cos(b), cosh(a) * Math.sin(b));}, cosh: function () {var a = this.re,b = this.im;return new Complex(cosh(a) * Math.cos(b), sinh(a) * Math.sin(b));}, tanh: function () {var a = 2 * this.re,b = 2 * this.im,d = cosh(a) + Math.cos(b);return new Complex(sinh(a) / d, Math.sin(b) / d);}, coth: function () {var a = 2 * this.re,b = 2 * this.im,d = cosh(a) - Math.cos(b);return new Complex(sinh(a) / d, -Math.sin(b) / d);}, csch: function () {var a = this.re,b = this.im,d = Math.cos(2 * b) - cosh(2 * a);return new Complex(-2 * sinh(a) * Math.cos(b) / d, 2 * cosh(a) * Math.sin(b) / d);}, sech: function () {var a = this.re,b = this.im,d = Math.cos(2 * b) + cosh(2 * a);return new Complex(2 * cosh(a) * Math.cos(b) / d, -2 * sinh(a) * Math.sin(b) / d);}, asinh: function () {var tmp = this.im;this.im = -this.re, this.re = tmp;var res = this.asin();return this.re = -this.im, this.im = tmp, tmp = res.re, res.re = -res.im, res.im = tmp, res;}, acosh: function () {var res = this.acos();if (0 >= res.im) {var tmp = res.re;res.re = -res.im, res.im = tmp;} else {var tmp = res.im;res.im = -res.re, res.re = tmp;}return res;}, atanh: function () {var a = this.re,b = this.im,oneMinus = 1 - a,onePlus = 1 + a,d = oneMinus * oneMinus + b * b,x = 0 === d ? new Complex(-1 === a ? 0 : a / 0, 0 === b ? 0 : b / 0) : new Complex((onePlus * oneMinus - b * b) / d, (b * oneMinus + onePlus * b) / d),temp = x.re;return x.re = logHypot(x.re, x.im) / 2, x.im = Math.atan2(x.im, temp) / 2, 1 < a && 0 === b && (x.im = -x.im), x;}, acoth: function () {var a = this.re,b = this.im;if (0 === a && 0 === b) return new Complex(0, Math.PI / 2);var d = a * a + b * b;return 0 == d ? new Complex(0 === a ? 0 : a / 0, 0 === b ? 0 : -b / 0).atanh() : new Complex(a / d, -b / d).atanh();}, acsch: function () {var a = this.re,b = this.im;if (0 === b) return new Complex(0 === a ? 1 / 0 : Math.log(a + Math.sqrt(a * a + 1)), 0);var d = a * a + b * b;return 0 == d ? new Complex(0 === a ? 0 : a / 0, 0 === b ? 0 : -b / 0).asinh() : new Complex(a / d, -b / d).asinh();}, asech: function () {var a = this.re,b = this.im;if (this.isZero()) return Complex.INFINITY;var d = a * a + b * b;return 0 == d ? new Complex(0 === a ? 0 : a / 0, 0 === b ? 0 : -b / 0).acosh() : new Complex(a / d, -b / d).acosh();}, inverse: function () {if (this.isZero()) return Complex.INFINITY;if (this.isInfinite()) return Complex.ZERO;var a = this.re,b = this.im,d = a * a + b * b;return new Complex(a / d, -b / d);}, conjugate: function () {return new Complex(this.re, -this.im);}, neg: function () {return new Complex(-this.re, -this.im);}, ceil: function (places) {return places = Math.pow(10, places || 0), new Complex(Math.ceil(this.re * places) / places, Math.ceil(this.im * places) / places);}, floor: function (places) {return places = Math.pow(10, places || 0), new Complex(Math.floor(this.re * places) / places, Math.floor(this.im * places) / places);}, round: function (places) {return places = Math.pow(10, places || 0), new Complex(Math.round(this.re * places) / places, Math.round(this.im * places) / places);}, equals: function (a, b) {var z = new Complex(a, b);return Math.abs(z.re - this.re) <= Complex.EPSILON && Math.abs(z.im - this.im) <= Complex.EPSILON;}, clone: function () {return new Complex(this.re, this.im);}, toString: function () {var a = this.re,b = this.im,ret = "";return this.isNaN() ? "NaN" : this.isInfinite() ? "Infinity" : (Math.abs(a) < Complex.EPSILON && (a = 0), Math.abs(b) < Complex.EPSILON && (b = 0), 0 === b) ? ret + a : (0 === a ? 0 > b && (b = -b, ret += "-") : (ret += a, ret += " ", 0 > b ? (b = -b, ret += "-") : ret += "+", ret += " "), 1 !== b && (ret += b), ret + "i");}, toVector: function () {return [this.re, this.im];}, valueOf: function () {return 0 === this.im ? this.re : null;}, isNaN: function () {return isNaN(this.re) || isNaN(this.im);}, isZero: function () {return 0 === this.im && 0 === this.re;}, isFinite: function () {return isFinite(this.re) && isFinite(this.im);}, isInfinite: function () {return !(this.isNaN() || this.isFinite());} }, Complex.ZERO = new Complex(0, 0), Complex.ONE = new Complex(1, 0), Complex.I = new Complex(0, 1), Complex.PI = new Complex(Math.PI, 0), Complex.E = new Complex(Math.E, 0), Complex.INFINITY = new Complex(1 / 0, 1 / 0), Complex.NAN = new Complex(NaN, NaN), Complex.EPSILON = 1e-15,  true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {return Complex;}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;})(this);

/***/ }),

/***/ "./node_modules/core-js/internals/a-callable.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),tryToString = __webpack_require__("./node_modules/core-js/internals/try-to-string.js");module.exports = function (argument) {if (isCallable(argument)) return argument;throw TypeError(tryToString(argument) + " is not a function");};

/***/ }),

/***/ "./node_modules/core-js/internals/add-to-unscopables.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),create = __webpack_require__("./node_modules/core-js/internals/object-create.js"),definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js"),UNSCOPABLES = wellKnownSymbol("unscopables"),ArrayPrototype = Array.prototype;ArrayPrototype[UNSCOPABLES] == null && definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { configurable: !0, value: create(null) }), module.exports = function (key) {ArrayPrototype[UNSCOPABLES][key] = !0;};

/***/ }),

/***/ "./node_modules/core-js/internals/an-object.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js");module.exports = function (argument) {if (isObject(argument)) return argument;throw TypeError(argument + "" + " is not an object");};

/***/ }),

/***/ "./node_modules/core-js/internals/array-from-async.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var bind = __webpack_require__("./node_modules/core-js/internals/function-bind-context.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),isConstructor = __webpack_require__("./node_modules/core-js/internals/is-constructor.js"),getAsyncIterator = __webpack_require__("./node_modules/core-js/internals/get-async-iterator.js"),getIterator = __webpack_require__("./node_modules/core-js/internals/get-iterator.js"),getIteratorMethod = __webpack_require__("./node_modules/core-js/internals/get-iterator-method.js"),getMethod = __webpack_require__("./node_modules/core-js/internals/get-method.js"),getVirtual = __webpack_require__("./node_modules/core-js/internals/entry-virtual.js"),wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),AsyncFromSyncIterator = __webpack_require__("./node_modules/core-js/internals/async-from-sync-iterator.js"),toArray = (__webpack_require__("./node_modules/core-js/internals/async-iterator-iteration.js").toArray),ASYNC_ITERATOR = wellKnownSymbol("asyncIterator"),arrayIterator = getVirtual("Array").values;module.exports = function (asyncItems) {var O = toObject(asyncItems),argumentsLength = arguments.length,mapfn = 1 < argumentsLength ? arguments[1] : void 0;mapfn !== void 0 && (mapfn = bind(mapfn, 2 < argumentsLength ? arguments[2] : void 0, 2));var usingAsyncIterator = getMethod(O, ASYNC_ITERATOR),usingSyncIterator = usingAsyncIterator ? void 0 : getIteratorMethod(O) || arrayIterator,A = isConstructor(this) ? new this() : [],iterator = usingAsyncIterator ? getAsyncIterator(O, usingAsyncIterator) : new AsyncFromSyncIterator(getIterator(O, usingSyncIterator));return toArray(iterator, mapfn, A);};

/***/ }),

/***/ "./node_modules/core-js/internals/array-from-constructor-and-list.js":
/***/ ((module) => {

module.exports = function (Constructor, list) {for (var index = 0, length = list.length, result = new Constructor(length); length > index;) result[index] = list[index++];return result;};

/***/ }),

/***/ "./node_modules/core-js/internals/array-group-by.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var bind = __webpack_require__("./node_modules/core-js/internals/function-bind-context.js"),IndexedObject = __webpack_require__("./node_modules/core-js/internals/indexed-object.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"),toPropertyKey = __webpack_require__("./node_modules/core-js/internals/to-property-key.js"),objectCreate = __webpack_require__("./node_modules/core-js/internals/object-create.js"),arrayFromConstructorAndList = __webpack_require__("./node_modules/core-js/internals/array-from-constructor-and-list.js"),push = [].push;module.exports = function ($this, callbackfn, that, specificConstructor) {for (var Constructor, key, value, O = toObject($this), self = IndexedObject(O), boundFunction = bind(callbackfn, that, 3), target = objectCreate(null), length = toLength(self.length), index = 0; length > index; index++) value = self[index], key = toPropertyKey(boundFunction(value, index, O)), key in target ? push.call(target[key], value) : target[key] = [value];if (specificConstructor && (Constructor = specificConstructor(O), Constructor !== Array)) for (key in target) target[key] = arrayFromConstructorAndList(Constructor, target[key]);return target;};

/***/ }),

/***/ "./node_modules/core-js/internals/array-includes.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var toIndexedObject = __webpack_require__("./node_modules/core-js/internals/to-indexed-object.js"),toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"),toAbsoluteIndex = __webpack_require__("./node_modules/core-js/internals/to-absolute-index.js"),createMethod = function (IS_INCLUDES) {return function ($this, el, fromIndex) {var value,O = toIndexedObject($this),length = toLength(O.length),index = toAbsoluteIndex(fromIndex, length);if (IS_INCLUDES && el != el) {for (; length > index;) if (value = O[index++], value != value) return !0;} else for (; length > index; index++) if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;return !IS_INCLUDES && -1;};};module.exports = { includes: createMethod(!0), indexOf: createMethod(!1) };

/***/ }),

/***/ "./node_modules/core-js/internals/array-iteration-from-last.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var bind = __webpack_require__("./node_modules/core-js/internals/function-bind-context.js"),IndexedObject = __webpack_require__("./node_modules/core-js/internals/indexed-object.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"),createMethod = function (TYPE) {return function ($this, callbackfn, that) {for (var value, result, O = toObject($this), self = IndexedObject(O), boundFunction = bind(callbackfn, that, 3), index = toLength(self.length); 0 < index--;) if (value = self[index], result = boundFunction(value, index, O), result) switch (TYPE) {case 0:return value;case 1:return index;}return 1 == TYPE ? -1 : void 0;};};module.exports = { findLast: createMethod(0), findLastIndex: createMethod(1) };

/***/ }),

/***/ "./node_modules/core-js/internals/array-iteration.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var bind = __webpack_require__("./node_modules/core-js/internals/function-bind-context.js"),IndexedObject = __webpack_require__("./node_modules/core-js/internals/indexed-object.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"),arraySpeciesCreate = __webpack_require__("./node_modules/core-js/internals/array-species-create.js"),push = [].push,createMethod = function (TYPE) {var IS_MAP = 1 == TYPE,IS_EVERY = 4 == TYPE,IS_FIND_INDEX = 6 == TYPE;return function ($this, callbackfn, that, specificCreate) {for (var value, result, O = toObject($this), self = IndexedObject(O), boundFunction = bind(callbackfn, that, 3), length = toLength(self.length), index = 0, create = specificCreate || arraySpeciesCreate, target = IS_MAP ? create($this, length) : 2 == TYPE || 7 == TYPE ? create($this, 0) : void 0; length > index; index++) if ((5 == TYPE || IS_FIND_INDEX || index in self) && (value = self[index], result = boundFunction(value, index, O), TYPE)) if (IS_MAP) target[index] = result;else if (result) switch (TYPE) {case 3:return !0;case 5:return value;case 6:return index;case 2:push.call(target, value);} else switch (TYPE) {case 4:return !1;case 7:push.call(target, value);}return IS_FIND_INDEX ? -1 : 3 == TYPE || IS_EVERY ? IS_EVERY : target;};};module.exports = { forEach: createMethod(0), map: createMethod(1), filter: createMethod(2), some: createMethod(3), every: createMethod(4), find: createMethod(5), findIndex: createMethod(6), filterReject: createMethod(7) };

/***/ }),

/***/ "./node_modules/core-js/internals/array-species-constructor.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var isArray = __webpack_require__("./node_modules/core-js/internals/is-array.js"),isConstructor = __webpack_require__("./node_modules/core-js/internals/is-constructor.js"),isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js"),wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),SPECIES = wellKnownSymbol("species");module.exports = function (originalArray) {var C;return isArray(originalArray) && (C = originalArray.constructor, isConstructor(C) && (C === Array || isArray(C.prototype)) ? C = void 0 : isObject(C) && (C = C[SPECIES], null === C && (C = void 0))), void 0 === C ? Array : C;};

/***/ }),

/***/ "./node_modules/core-js/internals/array-species-create.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var arraySpeciesConstructor = __webpack_require__("./node_modules/core-js/internals/array-species-constructor.js");module.exports = function (originalArray, length) {return new (arraySpeciesConstructor(originalArray))(0 === length ? 0 : length);};

/***/ }),

/***/ "./node_modules/core-js/internals/array-unique-by.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var aCallable = __webpack_require__("./node_modules/core-js/internals/a-callable.js"),toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),getBuiltIn = __webpack_require__("./node_modules/core-js/internals/get-built-in.js"),arraySpeciesCreate = __webpack_require__("./node_modules/core-js/internals/array-species-create.js"),push = [].push;module.exports = function (resolver) {var resolverFunction,index,item,key,that = toObject(this),length = toLength(that.length),result = arraySpeciesCreate(that, 0),Map = getBuiltIn("Map"),map = new Map();for (resolverFunction = null == resolver ? function (value) {return value;} : aCallable(resolver), index = 0; index < length; index++) item = that[index], key = resolverFunction(item), map.has(key) || map.set(key, item);return map.forEach(function (value) {push.call(result, value);}), result;};

/***/ }),

/***/ "./node_modules/core-js/internals/async-from-sync-iterator.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"),create = __webpack_require__("./node_modules/core-js/internals/object-create.js"),getMethod = __webpack_require__("./node_modules/core-js/internals/get-method.js"),redefineAll = __webpack_require__("./node_modules/core-js/internals/redefine-all.js"),InternalStateModule = __webpack_require__("./node_modules/core-js/internals/internal-state.js"),getBuiltIn = __webpack_require__("./node_modules/core-js/internals/get-built-in.js"),AsyncIteratorPrototype = __webpack_require__("./node_modules/core-js/internals/async-iterator-prototype.js"),Promise = getBuiltIn("Promise"),setInternalState = InternalStateModule.set,getInternalState = InternalStateModule.get,asyncFromSyncIteratorContinuation = function (result, resolve, reject) {var done = result.done;Promise.resolve(result.value).then(function (value) {resolve({ done: done, value: value });}, reject);},AsyncFromSyncIterator = function (iterator) {setInternalState(this, { iterator: anObject(iterator), next: iterator.next });};AsyncFromSyncIterator.prototype = redefineAll(create(AsyncIteratorPrototype), { next: function (arg) {var state = getInternalState(this),hasArg = !!arguments.length;return new Promise(function (resolve, reject) {var result = anObject(state.next.apply(state.iterator, hasArg ? [arg] : []));asyncFromSyncIteratorContinuation(result, resolve, reject);});}, return: function (arg) {var iterator = getInternalState(this).iterator,hasArg = !!arguments.length;return new Promise(function (resolve, reject) {var $return = getMethod(iterator, "return");if (void 0 === $return) return resolve({ done: !0, value: arg });var result = anObject($return.apply(iterator, hasArg ? [arg] : []));asyncFromSyncIteratorContinuation(result, resolve, reject);});}, throw: function (arg) {var iterator = getInternalState(this).iterator,hasArg = !!arguments.length;return new Promise(function (resolve, reject) {var $throw = getMethod(iterator, "throw");if (void 0 === $throw) return reject(arg);var result = anObject($throw.apply(iterator, hasArg ? [arg] : []));asyncFromSyncIteratorContinuation(result, resolve, reject);});} }), module.exports = AsyncFromSyncIterator;

/***/ }),

/***/ "./node_modules/core-js/internals/async-iterator-iteration.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var aCallable = __webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"),getBuiltIn = __webpack_require__("./node_modules/core-js/internals/get-built-in.js"),getMethod = __webpack_require__("./node_modules/core-js/internals/get-method.js"),MAX_SAFE_INTEGER = 9007199254740991,createMethod = function (TYPE) {var IS_TO_ARRAY = 0 == TYPE,IS_EVERY = 2 == TYPE,IS_SOME = 3 == TYPE;return function (iterator, fn, target) {anObject(iterator);var Promise = getBuiltIn("Promise"),next = aCallable(iterator.next),index = 0,MAPPING = void 0 !== fn;return (MAPPING || !IS_TO_ARRAY) && aCallable(fn), new Promise(function (resolve, reject) {var closeIteration = function (method, argument) {try {var returnMethod = getMethod(iterator, "return");if (returnMethod) return Promise.resolve(returnMethod.call(iterator)).then(function () {method(argument);}, function (error) {reject(error);});} catch (error2) {return reject(error2);}method(argument);},onError = function (error) {closeIteration(reject, error);},loop = function () {try {if (IS_TO_ARRAY && index > MAX_SAFE_INTEGER && MAPPING) throw TypeError("The allowed number of iterations has been exceeded");Promise.resolve(anObject(next.call(iterator))).then(function (step) {try {if (anObject(step).done) IS_TO_ARRAY ? (target.length = index, resolve(target)) : resolve(!IS_SOME && (IS_EVERY || void 0));else {var value = step.value;MAPPING ? Promise.resolve(IS_TO_ARRAY ? fn(value, index) : fn(value)).then(function (result) {1 == TYPE ? loop() : IS_EVERY ? result ? loop() : closeIteration(resolve, !1) : IS_TO_ARRAY ? (target[index++] = result, loop()) : result ? closeIteration(resolve, IS_SOME || value) : loop();}, onError) : (target[index++] = value, loop());}} catch (error) {onError(error);}}, onError);} catch (error2) {onError(error2);}};loop();});};};module.exports = { toArray: createMethod(0), forEach: createMethod(1), every: createMethod(2), some: createMethod(3), find: createMethod(4) };

/***/ }),

/***/ "./node_modules/core-js/internals/async-iterator-prototype.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var AsyncIteratorPrototype,prototype,global = __webpack_require__("./node_modules/core-js/internals/global.js"),shared = __webpack_require__("./node_modules/core-js/internals/shared-store.js"),isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),create = __webpack_require__("./node_modules/core-js/internals/object-create.js"),getPrototypeOf = __webpack_require__("./node_modules/core-js/internals/object-get-prototype-of.js"),redefine = __webpack_require__("./node_modules/core-js/internals/redefine.js"),wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),IS_PURE = __webpack_require__("./node_modules/core-js/internals/is-pure.js"),USE_FUNCTION_CONSTRUCTOR = "USE_FUNCTION_CONSTRUCTOR",ASYNC_ITERATOR = wellKnownSymbol("asyncIterator"),AsyncIterator = global.AsyncIterator,PassedAsyncIteratorPrototype = shared.AsyncIteratorPrototype;if (PassedAsyncIteratorPrototype) AsyncIteratorPrototype = PassedAsyncIteratorPrototype;else if (isCallable(AsyncIterator)) AsyncIteratorPrototype = AsyncIterator.prototype;else if (shared[USE_FUNCTION_CONSTRUCTOR] || global[USE_FUNCTION_CONSTRUCTOR]) try {prototype = getPrototypeOf(getPrototypeOf(getPrototypeOf(Function("return async function*(){}()")()))), getPrototypeOf(prototype) === Object.prototype && (AsyncIteratorPrototype = prototype);} catch (error) {}AsyncIteratorPrototype ? IS_PURE && (AsyncIteratorPrototype = create(AsyncIteratorPrototype)) : AsyncIteratorPrototype = {}, isCallable(AsyncIteratorPrototype[ASYNC_ITERATOR]) || redefine(AsyncIteratorPrototype, ASYNC_ITERATOR, function () {return this;}), module.exports = AsyncIteratorPrototype;

/***/ }),

/***/ "./node_modules/core-js/internals/classof-raw.js":
/***/ ((module) => {

var toString = {}.toString;module.exports = function (it) {return toString.call(it).slice(8, -1);};

/***/ }),

/***/ "./node_modules/core-js/internals/classof.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var TO_STRING_TAG_SUPPORT = __webpack_require__("./node_modules/core-js/internals/to-string-tag-support.js"),isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),classofRaw = __webpack_require__("./node_modules/core-js/internals/classof-raw.js"),wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),TO_STRING_TAG = wellKnownSymbol("toStringTag"),CORRECT_ARGUMENTS = "Arguments" == classofRaw(function () {return arguments;}()),tryGet = function (it, key) {try {return it[key];} catch (error) {}};module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {var O, tag, result;return it === void 0 ? "Undefined" : null === it ? "Null" : "string" == typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : "Object" == (result = classofRaw(O)) && isCallable(O.callee) ? "Arguments" : result;};

/***/ }),

/***/ "./node_modules/core-js/internals/copy-constructor-properties.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var has = __webpack_require__("./node_modules/core-js/internals/has.js"),ownKeys = __webpack_require__("./node_modules/core-js/internals/own-keys.js"),getOwnPropertyDescriptorModule = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-descriptor.js"),definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js");module.exports = function (target, source) {for (var key, keys = ownKeys(source), defineProperty = definePropertyModule.f, getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f, i = 0; i < keys.length; i++) key = keys[i], has(target, key) || defineProperty(target, key, getOwnPropertyDescriptor(source, key));};

/***/ }),

/***/ "./node_modules/core-js/internals/correct-prototype-getter.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var fails = __webpack_require__("./node_modules/core-js/internals/fails.js");module.exports = !fails(function () {function F() {}return F.prototype.constructor = null, Object.getPrototypeOf(new F()) !== F.prototype;});

/***/ }),

/***/ "./node_modules/core-js/internals/create-iterator-constructor.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var IteratorPrototype = (__webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype),create = __webpack_require__("./node_modules/core-js/internals/object-create.js"),createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js"),setToStringTag = __webpack_require__("./node_modules/core-js/internals/set-to-string-tag.js"),Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js"),returnThis = function () {return this;};module.exports = function (IteratorConstructor, NAME, next) {var TO_STRING_TAG = NAME + " Iterator";return IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }), setToStringTag(IteratorConstructor, TO_STRING_TAG, !1, !0), Iterators[TO_STRING_TAG] = returnThis, IteratorConstructor;};

/***/ }),

/***/ "./node_modules/core-js/internals/create-non-enumerable-property.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"),definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js"),createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js");module.exports = DESCRIPTORS ? function (object, key, value) {return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));} : function (object, key, value) {return object[key] = value, object;};

/***/ }),

/***/ "./node_modules/core-js/internals/create-property-descriptor.js":
/***/ ((module) => {

module.exports = function (bitmap, value) {return { enumerable: !(1 & bitmap), configurable: !(2 & bitmap), writable: !(4 & bitmap), value: value };};

/***/ }),

/***/ "./node_modules/core-js/internals/descriptors.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var fails = __webpack_require__("./node_modules/core-js/internals/fails.js");module.exports = !fails(function () {return 7 != Object.defineProperty({}, 1, { get: function () {return 7;} })[1];});

/***/ }),

/***/ "./node_modules/core-js/internals/document-create-element.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js"),isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js"),document = global.document,EXISTS = isObject(document) && isObject(document.createElement);module.exports = function (it) {return EXISTS ? document.createElement(it) : {};};

/***/ }),

/***/ "./node_modules/core-js/internals/engine-user-agent.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var getBuiltIn = __webpack_require__("./node_modules/core-js/internals/get-built-in.js");module.exports = getBuiltIn("navigator", "userAgent") || "";

/***/ }),

/***/ "./node_modules/core-js/internals/engine-v8-version.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var match,version,global = __webpack_require__("./node_modules/core-js/internals/global.js"),userAgent = __webpack_require__("./node_modules/core-js/internals/engine-user-agent.js"),process = global.process,Deno = global.Deno,versions = process && process.versions || Deno && Deno.version,v8 = versions && versions.v8;v8 ? (match = v8.split("."), version = 4 > match[0] ? 1 : match[0] + match[1]) : userAgent && (match = userAgent.match(/Edge\/(\d+)/), (!match || 74 <= match[1]) && (match = userAgent.match(/Chrome\/(\d+)/), match && (version = match[1]))), module.exports = version && +version;

/***/ }),

/***/ "./node_modules/core-js/internals/entry-virtual.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js");module.exports = function (CONSTRUCTOR) {return global[CONSTRUCTOR].prototype;};

/***/ }),

/***/ "./node_modules/core-js/internals/enum-bug-keys.js":
/***/ ((module) => {

module.exports = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"];

/***/ }),

/***/ "./node_modules/core-js/internals/export.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js"),getOwnPropertyDescriptor = (__webpack_require__("./node_modules/core-js/internals/object-get-own-property-descriptor.js").f),createNonEnumerableProperty = __webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),redefine = __webpack_require__("./node_modules/core-js/internals/redefine.js"),setGlobal = __webpack_require__("./node_modules/core-js/internals/set-global.js"),copyConstructorProperties = __webpack_require__("./node_modules/core-js/internals/copy-constructor-properties.js"),isForced = __webpack_require__("./node_modules/core-js/internals/is-forced.js");module.exports = function (options, source) {var FORCED,target,key,targetProperty,sourceProperty,descriptor,TARGET = options.target,GLOBAL = options.global,STATIC = options.stat;if (target = GLOBAL ? global : STATIC ? global[TARGET] || setGlobal(TARGET, {}) : (global[TARGET] || {}).prototype, target) for (key in source) {if (sourceProperty = source[key], options.noTargetGet ? (descriptor = getOwnPropertyDescriptor(target, key), targetProperty = descriptor && descriptor.value) : targetProperty = target[key], FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced), !FORCED && void 0 !== targetProperty) {if (typeof sourceProperty == typeof targetProperty) continue;copyConstructorProperties(sourceProperty, targetProperty);}(options.sham || targetProperty && targetProperty.sham) && createNonEnumerableProperty(sourceProperty, "sham", !0), redefine(target, key, sourceProperty, options);}};

/***/ }),

/***/ "./node_modules/core-js/internals/fails.js":
/***/ ((module) => {

module.exports = function (exec) {try {return !!exec();} catch (error) {return !0;}};

/***/ }),

/***/ "./node_modules/core-js/internals/function-bind-context.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var aCallable = __webpack_require__("./node_modules/core-js/internals/a-callable.js");module.exports = function (fn, that, length) {return (aCallable(fn), void 0 === that) ? fn : 0 === length ? function () {return fn.call(that);} : 1 === length ? function (a) {return fn.call(that, a);} : 2 === length ? function (a, b) {return fn.call(that, a, b);} : 3 === length ? function (a, b, c) {return fn.call(that, a, b, c);} : function () {return fn.apply(that, arguments);};};

/***/ }),

/***/ "./node_modules/core-js/internals/function-name.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"),has = __webpack_require__("./node_modules/core-js/internals/has.js"),FunctionPrototype = Function.prototype,getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor,EXISTS = has(FunctionPrototype, "name"),PROPER = EXISTS && "something" === function () {}.name,CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);module.exports = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE };

/***/ }),

/***/ "./node_modules/core-js/internals/get-async-iterator.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var AsyncFromSyncIterator = __webpack_require__("./node_modules/core-js/internals/async-from-sync-iterator.js"),anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"),getIterator = __webpack_require__("./node_modules/core-js/internals/get-iterator.js"),getMethod = __webpack_require__("./node_modules/core-js/internals/get-method.js"),wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),ASYNC_ITERATOR = wellKnownSymbol("asyncIterator");module.exports = function (it, usingIterator) {var method = 2 > arguments.length ? getMethod(it, ASYNC_ITERATOR) : usingIterator;return method ? anObject(method.call(it)) : new AsyncFromSyncIterator(getIterator(it));};

/***/ }),

/***/ "./node_modules/core-js/internals/get-built-in.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js"),isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),aFunction = function (argument) {return isCallable(argument) ? argument : void 0;};module.exports = function (namespace, method) {return 2 > arguments.length ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];};

/***/ }),

/***/ "./node_modules/core-js/internals/get-iterator-method.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var classof = __webpack_require__("./node_modules/core-js/internals/classof.js"),getMethod = __webpack_require__("./node_modules/core-js/internals/get-method.js"),Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js"),wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),ITERATOR = wellKnownSymbol("iterator");module.exports = function (it) {if (it != null) return getMethod(it, ITERATOR) || getMethod(it, "@@iterator") || Iterators[classof(it)];};

/***/ }),

/***/ "./node_modules/core-js/internals/get-iterator.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var aCallable = __webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorMethod = __webpack_require__("./node_modules/core-js/internals/get-iterator-method.js");module.exports = function (argument, usingIterator) {var iteratorMethod = 2 > arguments.length ? getIteratorMethod(argument) : usingIterator;if (aCallable(iteratorMethod)) return anObject(iteratorMethod.call(argument));throw TypeError(argument + "" + " is not iterable");};

/***/ }),

/***/ "./node_modules/core-js/internals/get-method.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var aCallable = __webpack_require__("./node_modules/core-js/internals/a-callable.js");module.exports = function (V, P) {var func = V[P];return null == func ? void 0 : aCallable(func);};

/***/ }),

/***/ "./node_modules/core-js/internals/global.js":
/***/ ((module) => {

var check = function (it) {return it && it.Math == Math && it;};module.exports = check("object" == typeof globalThis && globalThis) || check("object" == typeof window && window) || check("object" == typeof self && self) || check("object" == typeof global && global) || function () {return this;}() || Function("return this")();

/***/ }),

/***/ "./node_modules/core-js/internals/has.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),hasOwnProperty = {}.hasOwnProperty;module.exports = Object.hasOwn || function (it, key) {return hasOwnProperty.call(toObject(it), key);};

/***/ }),

/***/ "./node_modules/core-js/internals/hidden-keys.js":
/***/ ((module) => {

module.exports = {};

/***/ }),

/***/ "./node_modules/core-js/internals/html.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var getBuiltIn = __webpack_require__("./node_modules/core-js/internals/get-built-in.js");module.exports = getBuiltIn("document", "documentElement");

/***/ }),

/***/ "./node_modules/core-js/internals/ie8-dom-define.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"),fails = __webpack_require__("./node_modules/core-js/internals/fails.js"),createElement = __webpack_require__("./node_modules/core-js/internals/document-create-element.js");module.exports = !DESCRIPTORS && !fails(function () {return 7 != Object.defineProperty(createElement("div"), "a", { get: function () {return 7;} }).a;});

/***/ }),

/***/ "./node_modules/core-js/internals/indexed-object.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"),classof = __webpack_require__("./node_modules/core-js/internals/classof-raw.js"),split = "".split;module.exports = fails(function () {return !Object("z").propertyIsEnumerable(0);}) ? function (it) {return "String" == classof(it) ? split.call(it, "") : Object(it);} : Object;

/***/ }),

/***/ "./node_modules/core-js/internals/inspect-source.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),store = __webpack_require__("./node_modules/core-js/internals/shared-store.js"),functionToString = Function.toString;isCallable(store.inspectSource) || (store.inspectSource = function (it) {return functionToString.call(it);}), module.exports = store.inspectSource;

/***/ }),

/***/ "./node_modules/core-js/internals/internal-state.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var set,get,has,NATIVE_WEAK_MAP = __webpack_require__("./node_modules/core-js/internals/native-weak-map.js"),global = __webpack_require__("./node_modules/core-js/internals/global.js"),isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js"),createNonEnumerableProperty = __webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),objectHas = __webpack_require__("./node_modules/core-js/internals/has.js"),shared = __webpack_require__("./node_modules/core-js/internals/shared-store.js"),sharedKey = __webpack_require__("./node_modules/core-js/internals/shared-key.js"),hiddenKeys = __webpack_require__("./node_modules/core-js/internals/hidden-keys.js"),OBJECT_ALREADY_INITIALIZED = "Object already initialized",WeakMap = global.WeakMap,enforce = function (it) {return has(it) ? get(it) : set(it, {});},getterFor = function (TYPE) {return function (it) {var state;if (!isObject(it) || (state = get(it)).type !== TYPE) throw TypeError("Incompatible receiver, " + TYPE + " required");return state;};};if (NATIVE_WEAK_MAP || shared.state) {var store = shared.state || (shared.state = new WeakMap()),wmget = store.get,wmhas = store.has,wmset = store.set;set = function (it, metadata) {if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);return metadata.facade = it, wmset.call(store, it, metadata), metadata;}, get = function (it) {return wmget.call(store, it) || {};}, has = function (it) {return wmhas.call(store, it);};} else {var STATE = sharedKey("state");hiddenKeys[STATE] = !0, set = function (it, metadata) {if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);return metadata.facade = it, createNonEnumerableProperty(it, STATE, metadata), metadata;}, get = function (it) {return objectHas(it, STATE) ? it[STATE] : {};}, has = function (it) {return objectHas(it, STATE);};}module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor };

/***/ }),

/***/ "./node_modules/core-js/internals/is-array.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var classof = __webpack_require__("./node_modules/core-js/internals/classof-raw.js");module.exports = Array.isArray || function (argument) {return "Array" == classof(argument);};

/***/ }),

/***/ "./node_modules/core-js/internals/is-callable.js":
/***/ ((module) => {

module.exports = function (argument) {return "function" == typeof argument;};

/***/ }),

/***/ "./node_modules/core-js/internals/is-constructor.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"),isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),classof = __webpack_require__("./node_modules/core-js/internals/classof.js"),getBuiltIn = __webpack_require__("./node_modules/core-js/internals/get-built-in.js"),inspectSource = __webpack_require__("./node_modules/core-js/internals/inspect-source.js"),empty = [],construct = getBuiltIn("Reflect", "construct"),constructorRegExp = /^\s*(?:class|function)\b/,exec = constructorRegExp.exec,INCORRECT_TO_STRING = !constructorRegExp.exec(function () {}),isConstructorModern = function (argument) {if (!isCallable(argument)) return !1;try {return construct(Object, empty, argument), !0;} catch (error) {return !1;}},isConstructorLegacy = function (argument) {if (!isCallable(argument)) return !1;switch (classof(argument)) {case "AsyncFunction":case "GeneratorFunction":case "AsyncGeneratorFunction":return !1;}return INCORRECT_TO_STRING || !!exec.call(constructorRegExp, inspectSource(argument));};module.exports = !construct || fails(function () {var called;return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () {called = !0;}) || called;}) ? isConstructorLegacy : isConstructorModern;

/***/ }),

/***/ "./node_modules/core-js/internals/is-forced.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"),isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),replacement = /#|\.prototype\./,isForced = function (feature, detection) {var value = data[normalize(feature)];return !(value != POLYFILL) || value != NATIVE && (isCallable(detection) ? fails(detection) : !!detection);},normalize = isForced.normalize = function (string) {return (string + "").replace(replacement, ".").toLowerCase();},data = isForced.data = {},NATIVE = isForced.NATIVE = "N",POLYFILL = isForced.POLYFILL = "P";module.exports = isForced;

/***/ }),

/***/ "./node_modules/core-js/internals/is-object.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js");module.exports = function (it) {return "object" == typeof it ? null !== it : isCallable(it);};

/***/ }),

/***/ "./node_modules/core-js/internals/is-pure.js":
/***/ ((module) => {

module.exports = !1;

/***/ }),

/***/ "./node_modules/core-js/internals/is-symbol.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),getBuiltIn = __webpack_require__("./node_modules/core-js/internals/get-built-in.js"),USE_SYMBOL_AS_UID = __webpack_require__("./node_modules/core-js/internals/use-symbol-as-uid.js");module.exports = USE_SYMBOL_AS_UID ? function (it) {return "symbol" == typeof it;} : function (it) {var $Symbol = getBuiltIn("Symbol");return isCallable($Symbol) && Object(it) instanceof $Symbol;};

/***/ }),

/***/ "./node_modules/core-js/internals/iterators-core.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var IteratorPrototype,PrototypeOfArrayIteratorPrototype,arrayIterator,fails = __webpack_require__("./node_modules/core-js/internals/fails.js"),isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),create = __webpack_require__("./node_modules/core-js/internals/object-create.js"),getPrototypeOf = __webpack_require__("./node_modules/core-js/internals/object-get-prototype-of.js"),redefine = __webpack_require__("./node_modules/core-js/internals/redefine.js"),wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),IS_PURE = __webpack_require__("./node_modules/core-js/internals/is-pure.js"),ITERATOR = wellKnownSymbol("iterator"),BUGGY_SAFARI_ITERATORS = !1;[].keys && (arrayIterator = [].keys(), "next" in arrayIterator ? (PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)), PrototypeOfArrayIteratorPrototype !== Object.prototype && (IteratorPrototype = PrototypeOfArrayIteratorPrototype)) : BUGGY_SAFARI_ITERATORS = !0);var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == null || fails(function () {var test = {};return IteratorPrototype[ITERATOR].call(test) !== test;});NEW_ITERATOR_PROTOTYPE ? IteratorPrototype = {} : IS_PURE && (IteratorPrototype = create(IteratorPrototype)), isCallable(IteratorPrototype[ITERATOR]) || redefine(IteratorPrototype, ITERATOR, function () {return this;}), module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS };

/***/ }),

/***/ "./node_modules/core-js/internals/iterators.js":
/***/ ((module) => {

module.exports = {};

/***/ }),

/***/ "./node_modules/core-js/internals/math-fround.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var sign = __webpack_require__("./node_modules/core-js/internals/math-sign.js"),abs = Math.abs,pow = Math.pow,EPSILON = pow(2, -52),EPSILON32 = pow(2, -23),MAX32 = pow(2, 127) * (2 - EPSILON32),MIN32 = pow(2, -126),roundTiesToEven = function (n) {return n + 1 / EPSILON - 1 / EPSILON;};module.exports = Math.fround || function (x) {var a,result,$abs = abs(x),$sign = sign(x);return $abs < MIN32 ? $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32 : (a = (1 + EPSILON32 / EPSILON) * $abs, result = a - (a - $abs), result > MAX32 || result != result ? $sign * (1 / 0) : $sign * result);};

/***/ }),

/***/ "./node_modules/core-js/internals/math-scale.js":
/***/ ((module) => {

module.exports = Math.scale || function (x, inLow, inHigh, outLow, outHigh) {return 0 === arguments.length || x != x || inLow != inLow || inHigh != inHigh || outLow != outLow || outHigh != outHigh ? NaN : x === 1 / 0 || x === -Infinity ? x : (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;};

/***/ }),

/***/ "./node_modules/core-js/internals/math-sign.js":
/***/ ((module) => {

module.exports = Math.sign || function (x) {return 0 == (x = +x) || x != x ? x : 0 > x ? -1 : 1;};

/***/ }),

/***/ "./node_modules/core-js/internals/native-symbol.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var V8_VERSION = __webpack_require__("./node_modules/core-js/internals/engine-v8-version.js"),fails = __webpack_require__("./node_modules/core-js/internals/fails.js");module.exports = !!Object.getOwnPropertySymbols && !fails(function () {var symbol = Symbol();return !(symbol + "") || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && 41 > V8_VERSION;});

/***/ }),

/***/ "./node_modules/core-js/internals/native-weak-map.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js"),isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),inspectSource = __webpack_require__("./node_modules/core-js/internals/inspect-source.js"),WeakMap = global.WeakMap;module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));

/***/ }),

/***/ "./node_modules/core-js/internals/number-is-finite.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js"),globalIsFinite = global.isFinite;module.exports = Number.isFinite || function (it) {return "number" == typeof it && globalIsFinite(it);};

/***/ }),

/***/ "./node_modules/core-js/internals/object-create.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var activeXDocument,anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"),defineProperties = __webpack_require__("./node_modules/core-js/internals/object-define-properties.js"),enumBugKeys = __webpack_require__("./node_modules/core-js/internals/enum-bug-keys.js"),hiddenKeys = __webpack_require__("./node_modules/core-js/internals/hidden-keys.js"),html = __webpack_require__("./node_modules/core-js/internals/html.js"),documentCreateElement = __webpack_require__("./node_modules/core-js/internals/document-create-element.js"),sharedKey = __webpack_require__("./node_modules/core-js/internals/shared-key.js"),GT = ">",LT = "<",PROTOTYPE = "prototype",SCRIPT = "script",IE_PROTO = sharedKey("IE_PROTO"),EmptyConstructor = function () {},scriptTag = function (content) {return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT;},NullProtoObjectViaActiveX = function (activeXDocument) {activeXDocument.write(scriptTag("")), activeXDocument.close();var temp = activeXDocument.parentWindow.Object;return activeXDocument = null, temp;},NullProtoObjectViaIFrame = function () {var iframeDocument,iframe = documentCreateElement("iframe");return iframe.style.display = "none", html.appendChild(iframe), iframe.src = "java" + SCRIPT + ":" + "", iframeDocument = iframe.contentWindow.document, iframeDocument.open(), iframeDocument.write(scriptTag("document.F=Object")), iframeDocument.close(), iframeDocument.F;},NullProtoObject = function () {try {activeXDocument = new ActiveXObject("htmlfile");} catch (error) {}NullProtoObject = "undefined" == typeof document ? NullProtoObjectViaActiveX(activeXDocument) : document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();for (var length = enumBugKeys.length; length--;) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];return NullProtoObject();};hiddenKeys[IE_PROTO] = !0, module.exports = Object.create || function (O, Properties) {var result;return null === O ? result = NullProtoObject() : (EmptyConstructor[PROTOTYPE] = anObject(O), result = new EmptyConstructor(), EmptyConstructor[PROTOTYPE] = null, result[IE_PROTO] = O), void 0 === Properties ? result : defineProperties(result, Properties);};

/***/ }),

/***/ "./node_modules/core-js/internals/object-define-properties.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"),definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js"),anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"),objectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys.js");module.exports = DESCRIPTORS ? Object.defineProperties : function (O, Properties) {anObject(O);for (var key, keys = objectKeys(Properties), length = keys.length, index = 0; length > index;) definePropertyModule.f(O, key = keys[index++], Properties[key]);return O;};

/***/ }),

/***/ "./node_modules/core-js/internals/object-define-property.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"),IE8_DOM_DEFINE = __webpack_require__("./node_modules/core-js/internals/ie8-dom-define.js"),anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"),toPropertyKey = __webpack_require__("./node_modules/core-js/internals/to-property-key.js"),$defineProperty = Object.defineProperty;exports.f = DESCRIPTORS ? $defineProperty : function (O, P, Attributes) {if (anObject(O), P = toPropertyKey(P), anObject(Attributes), IE8_DOM_DEFINE) try {return $defineProperty(O, P, Attributes);} catch (error) {}if ("get" in Attributes || "set" in Attributes) throw TypeError("Accessors not supported");return "value" in Attributes && (O[P] = Attributes.value), O;};

/***/ }),

/***/ "./node_modules/core-js/internals/object-get-own-property-descriptor.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"),propertyIsEnumerableModule = __webpack_require__("./node_modules/core-js/internals/object-property-is-enumerable.js"),createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js"),toIndexedObject = __webpack_require__("./node_modules/core-js/internals/to-indexed-object.js"),toPropertyKey = __webpack_require__("./node_modules/core-js/internals/to-property-key.js"),has = __webpack_require__("./node_modules/core-js/internals/has.js"),IE8_DOM_DEFINE = __webpack_require__("./node_modules/core-js/internals/ie8-dom-define.js"),$getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function (O, P) {if (O = toIndexedObject(O), P = toPropertyKey(P), IE8_DOM_DEFINE) try {return $getOwnPropertyDescriptor(O, P);} catch (error) {}return has(O, P) ? createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]) : void 0;};

/***/ }),

/***/ "./node_modules/core-js/internals/object-get-own-property-names.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

var internalObjectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys-internal.js"),enumBugKeys = __webpack_require__("./node_modules/core-js/internals/enum-bug-keys.js"),hiddenKeys = enumBugKeys.concat("length", "prototype");exports.f = Object.getOwnPropertyNames || function (O) {return internalObjectKeys(O, hiddenKeys);};

/***/ }),

/***/ "./node_modules/core-js/internals/object-get-own-property-symbols.js":
/***/ ((__unused_webpack_module, exports) => {

exports.f = Object.getOwnPropertySymbols;

/***/ }),

/***/ "./node_modules/core-js/internals/object-get-prototype-of.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var has = __webpack_require__("./node_modules/core-js/internals/has.js"),isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),sharedKey = __webpack_require__("./node_modules/core-js/internals/shared-key.js"),CORRECT_PROTOTYPE_GETTER = __webpack_require__("./node_modules/core-js/internals/correct-prototype-getter.js"),IE_PROTO = sharedKey("IE_PROTO"),ObjectPrototype = Object.prototype;module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {var object = toObject(O);if (has(object, IE_PROTO)) return object[IE_PROTO];var constructor = object.constructor;return isCallable(constructor) && object instanceof constructor ? constructor.prototype : object instanceof Object ? ObjectPrototype : null;};

/***/ }),

/***/ "./node_modules/core-js/internals/object-iterator.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var InternalStateModule = __webpack_require__("./node_modules/core-js/internals/internal-state.js"),createIteratorConstructor = __webpack_require__("./node_modules/core-js/internals/create-iterator-constructor.js"),has = __webpack_require__("./node_modules/core-js/internals/has.js"),objectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),OBJECT_ITERATOR = "Object Iterator",setInternalState = InternalStateModule.set,getInternalState = InternalStateModule.getterFor(OBJECT_ITERATOR);module.exports = createIteratorConstructor(function (source, mode) {var object = toObject(source);setInternalState(this, { type: OBJECT_ITERATOR, mode: mode, object: object, keys: objectKeys(object), index: 0 });}, "Object", function () {for (var state = getInternalState(this), keys = state.keys;;) {if (null === keys || state.index >= keys.length) return state.object = state.keys = null, { value: void 0, done: !0 };var key = keys[state.index++],object = state.object;if (has(object, key)) {switch (state.mode) {case "keys":return { value: key, done: !1 };case "values":return { value: object[key], done: !1 };}return { value: [key, object[key]], done: !1 };}}});

/***/ }),

/***/ "./node_modules/core-js/internals/object-keys-internal.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var has = __webpack_require__("./node_modules/core-js/internals/has.js"),toIndexedObject = __webpack_require__("./node_modules/core-js/internals/to-indexed-object.js"),indexOf = (__webpack_require__("./node_modules/core-js/internals/array-includes.js").indexOf),hiddenKeys = __webpack_require__("./node_modules/core-js/internals/hidden-keys.js");module.exports = function (object, names) {var key,O = toIndexedObject(object),i = 0,result = [];for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);for (; names.length > i;) has(O, key = names[i++]) && (~indexOf(result, key) || result.push(key));return result;};

/***/ }),

/***/ "./node_modules/core-js/internals/object-keys.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var internalObjectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys-internal.js"),enumBugKeys = __webpack_require__("./node_modules/core-js/internals/enum-bug-keys.js");module.exports = Object.keys || function (O) {return internalObjectKeys(O, enumBugKeys);};

/***/ }),

/***/ "./node_modules/core-js/internals/object-property-is-enumerable.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
var $propertyIsEnumerable = {}.propertyIsEnumerable,getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);exports.f = NASHORN_BUG ? function (V) {var descriptor = getOwnPropertyDescriptor(this, V);return !!descriptor && descriptor.enumerable;} : $propertyIsEnumerable;

/***/ }),

/***/ "./node_modules/core-js/internals/ordinary-to-primitive.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js");module.exports = function (input, pref) {var fn, val;if ("string" === pref && isCallable(fn = input.toString) && !isObject(val = fn.call(input))) return val;if (isCallable(fn = input.valueOf) && !isObject(val = fn.call(input))) return val;if ("string" !== pref && isCallable(fn = input.toString) && !isObject(val = fn.call(input))) return val;throw TypeError("Can't convert object to primitive value");};

/***/ }),

/***/ "./node_modules/core-js/internals/own-keys.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var getBuiltIn = __webpack_require__("./node_modules/core-js/internals/get-built-in.js"),getOwnPropertyNamesModule = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-names.js"),getOwnPropertySymbolsModule = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-symbols.js"),anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js");module.exports = getBuiltIn("Reflect", "ownKeys") || function (it) {var keys = getOwnPropertyNamesModule.f(anObject(it)),getOwnPropertySymbols = getOwnPropertySymbolsModule.f;return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;};

/***/ }),

/***/ "./node_modules/core-js/internals/redefine-all.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var redefine = __webpack_require__("./node_modules/core-js/internals/redefine.js");module.exports = function (target, src, options) {for (var key in src) redefine(target, key, src[key], options);return target;};

/***/ }),

/***/ "./node_modules/core-js/internals/redefine.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js"),isCallable = __webpack_require__("./node_modules/core-js/internals/is-callable.js"),has = __webpack_require__("./node_modules/core-js/internals/has.js"),createNonEnumerableProperty = __webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),setGlobal = __webpack_require__("./node_modules/core-js/internals/set-global.js"),inspectSource = __webpack_require__("./node_modules/core-js/internals/inspect-source.js"),InternalStateModule = __webpack_require__("./node_modules/core-js/internals/internal-state.js"),CONFIGURABLE_FUNCTION_NAME = (__webpack_require__("./node_modules/core-js/internals/function-name.js").CONFIGURABLE),getInternalState = InternalStateModule.get,enforceInternalState = InternalStateModule.enforce,TEMPLATE = (String + "").split("String");(module.exports = function (O, key, value, options) {var state,unsafe = !!options && !!options.unsafe,simple = !!options && !!options.enumerable,noTargetGet = !!options && !!options.noTargetGet,name = options && void 0 !== options.name ? options.name : key;return (isCallable(value) && ("Symbol(" === (name + "").slice(0, 7) && (name = "[" + (name + "").replace(/^Symbol\(([^)]*)\)/, "$1") + "]"), (!has(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) && createNonEnumerableProperty(value, "name", name), state = enforceInternalState(value), !state.source && (state.source = TEMPLATE.join("string" == typeof name ? name : ""))), O === global) ? void (simple ? O[key] = value : setGlobal(key, value)) : void (unsafe ? !noTargetGet && O[key] && (simple = !0) : delete O[key], simple ? O[key] = value : createNonEnumerableProperty(O, key, value));})(Function.prototype, "toString", function () {return isCallable(this) && getInternalState(this).source || inspectSource(this);});

/***/ }),

/***/ "./node_modules/core-js/internals/require-object-coercible.js":
/***/ ((module) => {

module.exports = function (it) {if (it == null) throw TypeError("Can't call method on " + it);return it;};

/***/ }),

/***/ "./node_modules/core-js/internals/set-global.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js");module.exports = function (key, value) {try {Object.defineProperty(global, key, { value: value, configurable: !0, writable: !0 });} catch (error) {global[key] = value;}return value;};

/***/ }),

/***/ "./node_modules/core-js/internals/set-to-string-tag.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var defineProperty = (__webpack_require__("./node_modules/core-js/internals/object-define-property.js").f),has = __webpack_require__("./node_modules/core-js/internals/has.js"),wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),TO_STRING_TAG = wellKnownSymbol("toStringTag");module.exports = function (it, TAG, STATIC) {it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG) && defineProperty(it, TO_STRING_TAG, { configurable: !0, value: TAG });};

/***/ }),

/***/ "./node_modules/core-js/internals/shared-key.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var shared = __webpack_require__("./node_modules/core-js/internals/shared.js"),uid = __webpack_require__("./node_modules/core-js/internals/uid.js"),keys = shared("keys");module.exports = function (key) {return keys[key] || (keys[key] = uid(key));};

/***/ }),

/***/ "./node_modules/core-js/internals/shared-store.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js"),setGlobal = __webpack_require__("./node_modules/core-js/internals/set-global.js"),SHARED = "__core-js_shared__",store = global[SHARED] || setGlobal(SHARED, {});module.exports = store;

/***/ }),

/***/ "./node_modules/core-js/internals/shared.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var IS_PURE = __webpack_require__("./node_modules/core-js/internals/is-pure.js"),store = __webpack_require__("./node_modules/core-js/internals/shared-store.js");(module.exports = function (key, value) {return store[key] || (store[key] = value === void 0 ? {} : value);})("versions", []).push({ version: "3.18.1", mode: IS_PURE ? "pure" : "global", copyright: "\xA9 2021 Denis Pushkarev (zloirock.ru)" });

/***/ }),

/***/ "./node_modules/core-js/internals/string-multibyte.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js"),toString = __webpack_require__("./node_modules/core-js/internals/to-string.js"),requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js"),createMethod = function (CONVERT_TO_STRING) {return function ($this, pos) {var first,second,S = toString(requireObjectCoercible($this)),position = toInteger(pos),size = S.length;return 0 > position || position >= size ? CONVERT_TO_STRING ? "" : void 0 : (first = S.charCodeAt(position), 55296 > first || 56319 < first || position + 1 === size || 56320 > (second = S.charCodeAt(position + 1)) || 57343 < second ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536);};};module.exports = { codeAt: createMethod(!1), charAt: createMethod(!0) };

/***/ }),

/***/ "./node_modules/core-js/internals/to-absolute-index.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js"),max = Math.max,min = Math.min;module.exports = function (index, length) {var integer = toInteger(index);return 0 > integer ? max(integer + length, 0) : min(integer, length);};

/***/ }),

/***/ "./node_modules/core-js/internals/to-indexed-object.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var IndexedObject = __webpack_require__("./node_modules/core-js/internals/indexed-object.js"),requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js");module.exports = function (it) {return IndexedObject(requireObjectCoercible(it));};

/***/ }),

/***/ "./node_modules/core-js/internals/to-integer.js":
/***/ ((module) => {

var ceil = Math.ceil,floor = Math.floor;module.exports = function (argument) {return isNaN(argument = +argument) ? 0 : (0 < argument ? floor : ceil)(argument);};

/***/ }),

/***/ "./node_modules/core-js/internals/to-length.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js"),min = Math.min;module.exports = function (argument) {return 0 < argument ? min(toInteger(argument), 9007199254740991) : 0;};

/***/ }),

/***/ "./node_modules/core-js/internals/to-object.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js");module.exports = function (argument) {return Object(requireObjectCoercible(argument));};

/***/ }),

/***/ "./node_modules/core-js/internals/to-primitive.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js"),isSymbol = __webpack_require__("./node_modules/core-js/internals/is-symbol.js"),getMethod = __webpack_require__("./node_modules/core-js/internals/get-method.js"),ordinaryToPrimitive = __webpack_require__("./node_modules/core-js/internals/ordinary-to-primitive.js"),wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),TO_PRIMITIVE = wellKnownSymbol("toPrimitive");module.exports = function (input, pref) {if (!isObject(input) || isSymbol(input)) return input;var result,exoticToPrim = getMethod(input, TO_PRIMITIVE);if (exoticToPrim) {if (void 0 === pref && (pref = "default"), result = exoticToPrim.call(input, pref), !isObject(result) || isSymbol(result)) return result;throw TypeError("Can't convert object to primitive value");}return void 0 === pref && (pref = "number"), ordinaryToPrimitive(input, pref);};

/***/ }),

/***/ "./node_modules/core-js/internals/to-property-key.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var toPrimitive = __webpack_require__("./node_modules/core-js/internals/to-primitive.js"),isSymbol = __webpack_require__("./node_modules/core-js/internals/is-symbol.js");module.exports = function (argument) {var key = toPrimitive(argument, "string");return isSymbol(key) ? key : key + "";};

/***/ }),

/***/ "./node_modules/core-js/internals/to-string-tag-support.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),TO_STRING_TAG = wellKnownSymbol("toStringTag"),test = {};test[TO_STRING_TAG] = "z", module.exports = "[object z]" === test + "";

/***/ }),

/***/ "./node_modules/core-js/internals/to-string.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var classof = __webpack_require__("./node_modules/core-js/internals/classof.js");module.exports = function (argument) {if ("Symbol" === classof(argument)) throw TypeError("Cannot convert a Symbol value to a string");return argument + "";};

/***/ }),

/***/ "./node_modules/core-js/internals/try-to-string.js":
/***/ ((module) => {

module.exports = function (argument) {try {return argument + "";} catch (error) {return "Object";}};

/***/ }),

/***/ "./node_modules/core-js/internals/uid.js":
/***/ ((module) => {

var id = 0,postfix = Math.random();module.exports = function (key) {return "Symbol(" + ((key === void 0 ? "" : key) + "") + ")_" + (++id + postfix).toString(36);};

/***/ }),

/***/ "./node_modules/core-js/internals/use-symbol-as-uid.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var NATIVE_SYMBOL = __webpack_require__("./node_modules/core-js/internals/native-symbol.js");module.exports = NATIVE_SYMBOL && !Symbol.sham && "symbol" == typeof Symbol.iterator;

/***/ }),

/***/ "./node_modules/core-js/internals/well-known-symbol.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var global = __webpack_require__("./node_modules/core-js/internals/global.js"),shared = __webpack_require__("./node_modules/core-js/internals/shared.js"),has = __webpack_require__("./node_modules/core-js/internals/has.js"),uid = __webpack_require__("./node_modules/core-js/internals/uid.js"),NATIVE_SYMBOL = __webpack_require__("./node_modules/core-js/internals/native-symbol.js"),USE_SYMBOL_AS_UID = __webpack_require__("./node_modules/core-js/internals/use-symbol-as-uid.js"),WellKnownSymbolsStore = shared("wks"),Symbol = global.Symbol,createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;module.exports = function (name) {return has(WellKnownSymbolsStore, name) && (NATIVE_SYMBOL || "string" == typeof WellKnownSymbolsStore[name]) || (NATIVE_SYMBOL && has(Symbol, name) ? WellKnownSymbolsStore[name] = Symbol[name] : WellKnownSymbolsStore[name] = createWellKnownSymbol("Symbol." + name)), WellKnownSymbolsStore[name];};

/***/ }),

/***/ "./node_modules/core-js/modules/es.array.at.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"),toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js"),addToUnscopables = __webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js");$({ target: "Array", proto: !0 }, { at: function (index) {var O = toObject(this),len = toLength(O.length),relativeIndex = toInteger(index),k = 0 <= relativeIndex ? relativeIndex : len + relativeIndex;return 0 > k || k >= len ? void 0 : O[k];} }), addToUnscopables("at");

/***/ }),

/***/ "./node_modules/core-js/modules/es.object.has-own.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),hasOwn = __webpack_require__("./node_modules/core-js/internals/has.js");$({ target: "Object", stat: !0 }, { hasOwn: hasOwn });

/***/ }),

/***/ "./node_modules/core-js/modules/es.reflect.to-string-tag.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),global = __webpack_require__("./node_modules/core-js/internals/global.js"),setToStringTag = __webpack_require__("./node_modules/core-js/internals/set-to-string-tag.js");$({ global: !0 }, { Reflect: {} }), setToStringTag(global.Reflect, "Reflect", !0);

/***/ }),

/***/ "./node_modules/core-js/modules/es.string.at-alternative.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js"),toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js"),toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"),toString = __webpack_require__("./node_modules/core-js/internals/to-string.js"),fails = __webpack_require__("./node_modules/core-js/internals/fails.js"),FORCED = fails(function () {return "\uD842" !== "\uD842\uDFB7".at(0);});$({ target: "String", proto: !0, forced: FORCED }, { at: function (index) {var S = toString(requireObjectCoercible(this)),len = toLength(S.length),relativeIndex = toInteger(index),k = 0 <= relativeIndex ? relativeIndex : len + relativeIndex;return 0 > k || k >= len ? void 0 : S.charAt(k);} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.filter-out.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),$filterReject = (__webpack_require__("./node_modules/core-js/internals/array-iteration.js").filterReject),addToUnscopables = __webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js");$({ target: "Array", proto: !0 }, { filterOut: function (callbackfn) {return $filterReject(this, callbackfn, 1 < arguments.length ? arguments[1] : void 0);} }), addToUnscopables("filterOut");

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.filter-reject.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),$filterReject = (__webpack_require__("./node_modules/core-js/internals/array-iteration.js").filterReject),addToUnscopables = __webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js");$({ target: "Array", proto: !0 }, { filterReject: function (callbackfn) {return $filterReject(this, callbackfn, 1 < arguments.length ? arguments[1] : void 0);} }), addToUnscopables("filterReject");

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.find-last-index.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),$findLastIndex = (__webpack_require__("./node_modules/core-js/internals/array-iteration-from-last.js").findLastIndex),addToUnscopables = __webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js");$({ target: "Array", proto: !0 }, { findLastIndex: function (callbackfn) {return $findLastIndex(this, callbackfn, 1 < arguments.length ? arguments[1] : void 0);} }), addToUnscopables("findLastIndex");

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.find-last.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),$findLast = (__webpack_require__("./node_modules/core-js/internals/array-iteration-from-last.js").findLast),addToUnscopables = __webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js");$({ target: "Array", proto: !0 }, { findLast: function (callbackfn) {return $findLast(this, callbackfn, 1 < arguments.length ? arguments[1] : void 0);} }), addToUnscopables("findLast");

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.from-async.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),fromAsync = __webpack_require__("./node_modules/core-js/internals/array-from-async.js");$({ target: "Array", stat: !0 }, { fromAsync: fromAsync });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.group-by.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),$groupBy = __webpack_require__("./node_modules/core-js/internals/array-group-by.js"),arraySpeciesConstructor = __webpack_require__("./node_modules/core-js/internals/array-species-constructor.js"),addToUnscopables = __webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js");$({ target: "Array", proto: !0 }, { groupBy: function (callbackfn) {var thisArg = 1 < arguments.length ? arguments[1] : void 0;return $groupBy(this, callbackfn, thisArg, arraySpeciesConstructor);} }), addToUnscopables("groupBy");

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.is-template-object.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),isArray = __webpack_require__("./node_modules/core-js/internals/is-array.js"),isFrozen = Object.isFrozen,isFrozenStringArray = function (array, allowUndefined) {if (!isFrozen || !isArray(array) || !isFrozen(array)) return !1;for (var element, index = 0, length = array.length; index < length;) if (element = array[index++], !("string" == typeof element || allowUndefined && "undefined" == typeof element)) return !1;return 0 !== length;};$({ target: "Array", stat: !0 }, { isTemplateObject: function (value) {if (!isFrozenStringArray(value, !0)) return !1;var raw = value.raw;return !!(raw.length === value.length && isFrozenStringArray(raw, !1));} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.last-index.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"),addToUnscopables = __webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"),defineProperty = (__webpack_require__("./node_modules/core-js/internals/object-define-property.js").f);DESCRIPTORS && !("lastIndex" in []) && (defineProperty(Array.prototype, "lastIndex", { configurable: !0, get: function () {var O = toObject(this),len = toLength(O.length);return 0 == len ? 0 : len - 1;} }), addToUnscopables("lastIndex"));

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.last-item.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"),addToUnscopables = __webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js"),toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"),toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"),defineProperty = (__webpack_require__("./node_modules/core-js/internals/object-define-property.js").f);DESCRIPTORS && !("lastItem" in []) && (defineProperty(Array.prototype, "lastItem", { configurable: !0, get: function () {var O = toObject(this),len = toLength(O.length);return 0 == len ? void 0 : O[len - 1];}, set: function (value) {var O = toObject(this),len = toLength(O.length);return O[0 == len ? 0 : len - 1] = value;} }), addToUnscopables("lastItem"));

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.array.unique-by.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),addToUnscopables = __webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js"),uniqueBy = __webpack_require__("./node_modules/core-js/internals/array-unique-by.js");$({ target: "Array", proto: !0 }, { uniqueBy: uniqueBy }), addToUnscopables("uniqueBy");

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.clamp.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),min = Math.min,max = Math.max;$({ target: "Math", stat: !0 }, { clamp: function (x, lower, upper) {return min(upper, max(lower, x));} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.deg-per-rad.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js");$({ target: "Math", stat: !0 }, { DEG_PER_RAD: Math.PI / 180 });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.degrees.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),RAD_PER_DEG = 180 / Math.PI;$({ target: "Math", stat: !0 }, { degrees: function (radians) {return radians * RAD_PER_DEG;} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.fscale.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),scale = __webpack_require__("./node_modules/core-js/internals/math-scale.js"),fround = __webpack_require__("./node_modules/core-js/internals/math-fround.js");$({ target: "Math", stat: !0 }, { fscale: function (x, inLow, inHigh, outLow, outHigh) {return fround(scale(x, inLow, inHigh, outLow, outHigh));} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.iaddh.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js");$({ target: "Math", stat: !0 }, { iaddh: function (x0, x1, y0, y1) {var $x0 = x0 >>> 0,$y0 = y0 >>> 0;return 0 | (x1 >>> 0) + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31);} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.imulh.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js");$({ target: "Math", stat: !0 }, { imulh: function (u, v) {var $u = +u,$v = +v,u0 = $u & 65535,v0 = $v & 65535,u1 = $u >> 16,v1 = $v >> 16,t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & 65535) >> 16);} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.isubh.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js");$({ target: "Math", stat: !0 }, { isubh: function (x0, x1, y0, y1) {var $x0 = x0 >>> 0,$y0 = y0 >>> 0;return 0 | (x1 >>> 0) - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31);} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.rad-per-deg.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js");$({ target: "Math", stat: !0 }, { RAD_PER_DEG: 180 / Math.PI });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.radians.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),DEG_PER_RAD = Math.PI / 180;$({ target: "Math", stat: !0 }, { radians: function (degrees) {return degrees * DEG_PER_RAD;} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.scale.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),scale = __webpack_require__("./node_modules/core-js/internals/math-scale.js");$({ target: "Math", stat: !0 }, { scale: scale });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.seeded-prng.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"),numberIsFinite = __webpack_require__("./node_modules/core-js/internals/number-is-finite.js"),createIteratorConstructor = __webpack_require__("./node_modules/core-js/internals/create-iterator-constructor.js"),InternalStateModule = __webpack_require__("./node_modules/core-js/internals/internal-state.js"),SEEDED_RANDOM = "Seeded Random",SEEDED_RANDOM_GENERATOR = SEEDED_RANDOM + " Generator",setInternalState = InternalStateModule.set,getInternalState = InternalStateModule.getterFor(SEEDED_RANDOM_GENERATOR),SEED_TYPE_ERROR = "Math.seededPRNG() argument should have a \"seed\" field with a finite value.",$SeededRandomGenerator = createIteratorConstructor(function (seed) {setInternalState(this, { type: SEEDED_RANDOM_GENERATOR, seed: seed % 2147483647 });}, SEEDED_RANDOM, function () {var state = getInternalState(this),seed = state.seed = (1103515245 * state.seed + 12345) % 2147483647;return { value: (1073741823 & seed) / 1073741823, done: !1 };});$({ target: "Math", stat: !0, forced: !0 }, { seededPRNG: function (it) {var seed = anObject(it).seed;if (!numberIsFinite(seed)) throw TypeError(SEED_TYPE_ERROR);return new $SeededRandomGenerator(seed);} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.signbit.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js");$({ target: "Math", stat: !0 }, { signbit: function (x) {return (x = +x) == x && 0 == x ? 1 / x == -Infinity : 0 > x;} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.math.umulh.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var $ = __webpack_require__("./node_modules/core-js/internals/export.js");$({ target: "Math", stat: !0 }, { umulh: function (u, v) {var $u = +u,$v = +v,u0 = $u & 65535,v0 = $v & 65535,u1 = $u >>> 16,v1 = $v >>> 16,t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & 65535) >>> 16);} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.object.iterate-entries.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),ObjectIterator = __webpack_require__("./node_modules/core-js/internals/object-iterator.js");$({ target: "Object", stat: !0 }, { iterateEntries: function (object) {return new ObjectIterator(object, "entries");} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.object.iterate-keys.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),ObjectIterator = __webpack_require__("./node_modules/core-js/internals/object-iterator.js");$({ target: "Object", stat: !0 }, { iterateKeys: function (object) {return new ObjectIterator(object, "keys");} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.object.iterate-values.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),ObjectIterator = __webpack_require__("./node_modules/core-js/internals/object-iterator.js");$({ target: "Object", stat: !0 }, { iterateValues: function (object) {return new ObjectIterator(object, "values");} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.string.at.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),charAt = (__webpack_require__("./node_modules/core-js/internals/string-multibyte.js").charAt),fails = __webpack_require__("./node_modules/core-js/internals/fails.js"),FORCED = fails(function () {return "\uD842\uDFB7" !== "\uD842\uDFB7".at(0);});$({ target: "String", proto: !0, forced: FORCED }, { at: function (pos) {return charAt(this, pos);} });

/***/ }),

/***/ "./node_modules/core-js/modules/esnext.string.code-points.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var $ = __webpack_require__("./node_modules/core-js/internals/export.js"),createIteratorConstructor = __webpack_require__("./node_modules/core-js/internals/create-iterator-constructor.js"),requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js"),toString = __webpack_require__("./node_modules/core-js/internals/to-string.js"),InternalStateModule = __webpack_require__("./node_modules/core-js/internals/internal-state.js"),StringMultibyteModule = __webpack_require__("./node_modules/core-js/internals/string-multibyte.js"),codeAt = StringMultibyteModule.codeAt,charAt = StringMultibyteModule.charAt,STRING_ITERATOR = "String Iterator",setInternalState = InternalStateModule.set,getInternalState = InternalStateModule.getterFor(STRING_ITERATOR),$StringIterator = createIteratorConstructor(function (string) {setInternalState(this, { type: STRING_ITERATOR, string: string, index: 0 });}, "String", function () {var point,state = getInternalState(this),string = state.string,index = state.index;return index >= string.length ? { value: void 0, done: !0 } : (point = charAt(string, index), state.index += point.length, { value: { codePoint: codeAt(point, 0), position: index }, done: !1 });});$({ target: "String", proto: !0 }, { codePoints: function () {return new $StringIterator(toString(requireObjectCoercible(this)));} });

/***/ }),

/***/ "./node_modules/escape-latex/dist/index.js":
/***/ ((module) => {

"use strict";
var _extends = Object.assign || function (target) {for (var source, i = 1; i < arguments.length; i++) for (var key in source = arguments[i], source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);return target;},defaultEscapes = { "{": "\\{", "}": "\\}", "\\": "\\textbackslash{}", "#": "\\#", $: "\\$", "%": "\\%", "&": "\\&", "^": "\\textasciicircum{}", _: "\\_", "~": "\\textasciitilde{}" },formatEscapes = { "–": "\\--", "—": "\\---", " ": "~", "	": "\\qquad{}", "\r\n": "\\newline{}", "\n": "\\newline{}" },defaultEscapeMapFn = function (defaultEscapes, formatEscapes) {return _extends({}, defaultEscapes, formatEscapes);};module.exports = function (str) {for (var _ref = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}, _ref$preserveFormatti = _ref.preserveFormatting, _ref$escapeMapFn = _ref.escapeMapFn, escapeMapFn = void 0 === _ref$escapeMapFn ? defaultEscapeMapFn : _ref$escapeMapFn, runningStr = str + "", result = "", escapes = escapeMapFn(_extends({}, defaultEscapes), void 0 !== _ref$preserveFormatti && _ref$preserveFormatti ? _extends({}, formatEscapes) : {}), escapeKeys = Object.keys(escapes), _loop = function _loop() {var specialCharFound = !1;escapeKeys.forEach(function (key, index) {specialCharFound || runningStr.length >= key.length && runningStr.slice(0, key.length) === key && (result += escapes[escapeKeys[index]], runningStr = runningStr.slice(key.length, runningStr.length), specialCharFound = !0);}), specialCharFound || (result += runningStr.slice(0, 1), runningStr = runningStr.slice(1, runningStr.length));}; runningStr;) _loop();return result;};

/***/ }),

/***/ "./node_modules/fraction.js/fraction.js":
/***/ (function(module, exports) {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root) {"use strict";function createError(name) {function errorConstructor() {var temp = Error.apply(this, arguments);temp.name = this.name = name, this.stack = temp.stack, this.message = temp.message;}function IntermediateInheritor() {}return IntermediateInheritor.prototype = Error.prototype, errorConstructor.prototype = new IntermediateInheritor(), errorConstructor;}function assign(n, s) {return isNaN(n = parseInt(n, 10)) && throwInvalidParam(), n * s;}function throwInvalidParam() {throw new InvalidParameter();}function factorize(num) {for (var factors = {}, n = num, i = 2, s = 4; s <= n;) {for (; 0 == n % i;) n /= i, factors[i] = (factors[i] || 0) + 1;s += 1 + 2 * i++;}return n === num ? factors[num] = (factors[num] || 0) + 1 : 1 < n && (factors[n] = (factors[n] || 0) + 1), factors;}function modpow(b, e, m) {for (var r = 1; 0 < e; b = b * b % m, e >>= 1) 1 & e && (r = r * b % m);return r;}function cycleLen(n, d) {for (; 0 == d % 2; d /= 2);for (; 0 == d % 5; d /= 5);if (1 === d) return 0;for (var rem = 10 % d, t = 1; 1 !== rem; t++) if (rem = 10 * rem % d, 2000 < t) return 0;return t;}function cycleStart(n, d, len) {for (var rem1 = 1, rem2 = modpow(10, len, d), t = 0; 300 > t; t++) {if (rem1 === rem2) return t;rem1 = 10 * rem1 % d, rem2 = 10 * rem2 % d;}return 0;}function gcd(a, b) {if (!a) return b;if (!b) return a;for (;;) {if (a %= b, !a) return b;if (b %= a, !b) return a;}}function Fraction(a, b) {return this instanceof Fraction ? void (parse(a, b), a = Fraction.REDUCE ? gcd(P.d, P.n) : 1, this.s = P.s, this.n = P.n / a, this.d = P.d / a) : new Fraction(a, b);}var P = { s: 1, n: 0, d: 1 },DivisionByZero = Fraction.DivisionByZero = createError("DivisionByZero"),InvalidParameter = Fraction.InvalidParameter = createError("InvalidParameter"),parse = function (p1, p2) {var M,n = 0,d = 1,s = 1,v = 0,w = 0,x = 0,y = 1,z = 1,A = 0,B = 1,C = 1,D = 1,N = 1e7;if (p1 === void 0 || null === p1) ;else if (p2 !== void 0) n = p1, d = p2, s = n * d;else switch (typeof p1) {case "object":{"d" in p1 && "n" in p1 ? (n = p1.n, d = p1.d, "s" in p1 && (n *= p1.s)) : 0 in p1 ? (n = p1[0], 1 in p1 && (d = p1[1])) : throwInvalidParam(), s = n * d;break;}case "number":{if (0 > p1 && (s = p1, p1 = -p1), 0 == p1 % 1) n = p1;else if (0 < p1) {for (1 <= p1 && (z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10)), p1 /= z); B <= N && D <= N;) if (M = (A + C) / (B + D), p1 === M) {B + D <= N ? (n = A + C, d = B + D) : D > B ? (n = C, d = D) : (n = A, d = B);break;} else p1 > M ? (A += C, B += D) : (C += A, D += B), B > N ? (n = C, d = D) : (n = A, d = B);n *= z;} else (isNaN(p1) || isNaN(p2)) && (d = n = NaN);break;}case "string":if (B = p1.match(/\d+|./g), null === B && throwInvalidParam(), "-" === B[A] ? (s = -1, A++) : "+" === B[A] && A++, B.length === A + 1 ? w = assign(B[A++], s) : "." === B[A + 1] || "." === B[A] ? ("." !== B[A] && (v = assign(B[A++], s)), A++, (A + 1 === B.length || "(" === B[A + 1] && ")" === B[A + 3] || "'" === B[A + 1] && "'" === B[A + 3]) && (w = assign(B[A], s), y = Math.pow(10, B[A].length), A++), ("(" === B[A] && ")" === B[A + 2] || "'" === B[A] && "'" === B[A + 2]) && (x = assign(B[A + 1], s), z = Math.pow(10, B[A + 1].length) - 1, A += 3)) : "/" === B[A + 1] || ":" === B[A + 1] ? (w = assign(B[A], s), y = assign(B[A + 2], 1), A += 3) : "/" === B[A + 3] && " " === B[A + 1] && (v = assign(B[A], s), w = assign(B[A + 2], s), y = assign(B[A + 4], 1), A += 5), B.length <= A) {d = y * z, s = n = x + d * v + z * w;break;}default:throwInvalidParam();}if (0 === d) throw new DivisionByZero();P.s = 0 > s ? -1 : 1, P.n = Math.abs(n), P.d = Math.abs(d);};Fraction.REDUCE = 1, Fraction.prototype = { s: 1, n: 0, d: 1, abs: function () {return new Fraction(this.n, this.d);}, neg: function () {return new Fraction(-this.s * this.n, this.d);}, add: function (a, b) {return parse(a, b), new Fraction(this.s * this.n * P.d + P.s * this.d * P.n, this.d * P.d);}, sub: function (a, b) {return parse(a, b), new Fraction(this.s * this.n * P.d - P.s * this.d * P.n, this.d * P.d);}, mul: function (a, b) {return parse(a, b), new Fraction(this.s * P.s * this.n * P.n, this.d * P.d);}, div: function (a, b) {return parse(a, b), new Fraction(this.s * P.s * this.n * P.d, this.d * P.n);}, clone: function () {return new Fraction(this);}, mod: function (a, b) {return isNaN(this.n) || isNaN(this.d) ? new Fraction(NaN) : void 0 === a ? new Fraction(this.s * this.n % this.d, 1) : (parse(a, b), 0 === P.n && 0 === this.d && Fraction(0, 0), new Fraction(this.s * (P.d * this.n) % (P.n * this.d), P.d * this.d));}, gcd: function (a, b) {return parse(a, b), new Fraction(gcd(P.n, this.n) * gcd(P.d, this.d), P.d * this.d);}, lcm: function (a, b) {return parse(a, b), 0 === P.n && 0 === this.n ? new Fraction() : new Fraction(P.n * this.n, gcd(P.n, this.n) * gcd(P.d, this.d));}, ceil: function (places) {return places = Math.pow(10, places || 0), isNaN(this.n) || isNaN(this.d) ? new Fraction(NaN) : new Fraction(Math.ceil(places * this.s * this.n / this.d), places);}, floor: function (places) {return places = Math.pow(10, places || 0), isNaN(this.n) || isNaN(this.d) ? new Fraction(NaN) : new Fraction(Math.floor(places * this.s * this.n / this.d), places);}, round: function (places) {return places = Math.pow(10, places || 0), isNaN(this.n) || isNaN(this.d) ? new Fraction(NaN) : new Fraction(Math.round(places * this.s * this.n / this.d), places);}, inverse: function () {return new Fraction(this.s * this.d, this.n);}, pow: function (a, b) {if (parse(a, b), 1 === P.d) return 0 > P.s ? new Fraction(Math.pow(this.s * this.d, P.n), Math.pow(this.n, P.n)) : new Fraction(Math.pow(this.s * this.n, P.n), Math.pow(this.d, P.n));if (0 > this.s) return null;var N = factorize(this.n),D = factorize(this.d),n = 1,d = 1;for (var k in N) if ("1" != k) {if ("0" === k) {n = 0;break;}if (N[k] *= P.n, 0 == N[k] % P.d) N[k] /= P.d;else return null;n *= Math.pow(k, N[k]);}for (var k in D) if ("1" != k) {if (D[k] *= P.n, 0 == D[k] % P.d) D[k] /= P.d;else return null;d *= Math.pow(k, D[k]);}return 0 > P.s ? new Fraction(d, n) : new Fraction(n, d);}, equals: function (a, b) {return parse(a, b), this.s * this.n * P.d == P.s * P.n * this.d;}, compare: function (a, b) {parse(a, b);var t = this.s * this.n * P.d - P.s * P.n * this.d;return (0 < t) - (0 > t);}, simplify: function (eps) {function rec(a) {return 1 === a.length ? new Fraction(a[0]) : rec(a.slice(1)).inverse().add(a[0]);}if (isNaN(this.n) || isNaN(this.d)) return this;var cont = this.abs().toContinued();eps = eps || .001;for (var tmp, i = 0; i < cont.length; i++) if (tmp = rec(cont.slice(0, i + 1)), tmp.sub(this.abs()).abs().valueOf() < eps) return tmp.mul(this.s);return this;}, divisible: function (a, b) {return parse(a, b), P.n * this.d && !(this.n * P.d % (P.n * this.d));}, valueOf: function () {return this.s * this.n / this.d;}, toFraction: function (excludeWhole) {var whole,str = "",n = this.n,d = this.d;return 0 > this.s && (str += "-"), 1 === d ? str += n : (excludeWhole && 0 < (whole = Math.floor(n / d)) && (str += whole, str += " ", n %= d), str += n, str += "/", str += d), str;}, toLatex: function (excludeWhole) {var whole,str = "",n = this.n,d = this.d;return 0 > this.s && (str += "-"), 1 === d ? str += n : (excludeWhole && 0 < (whole = Math.floor(n / d)) && (str += whole, n %= d), str += "\\frac{", str += n, str += "}{", str += d, str += "}"), str;}, toContinued: function () {var t,a = this.n,b = this.d,res = [];if (isNaN(a) || isNaN(b)) return res;do res.push(Math.floor(a / b)), t = a % b, a = b, b = t; while (1 !== a);return res;}, toString: function (dec) {var g,N = this.n,D = this.d;if (isNaN(N) || isNaN(D)) return "NaN";Fraction.REDUCE || (g = gcd(N, D), N /= g, D /= g), dec = dec || 15;var cycLen = cycleLen(N, D),cycOff = cycleStart(N, D, cycLen),str = -1 === this.s ? "-" : "";if (str += 0 | N / D, N %= D, N *= 10, N && (str += "."), cycLen) {for (var i = cycOff; i--;) str += 0 | N / D, N %= D, N *= 10;str += "(";for (var i = cycLen; i--;) str += 0 | N / D, N %= D, N *= 10;str += ")";} else for (var i = dec; N && i--;) str += 0 | N / D, N %= D, N *= 10;return str;} },  true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {return Fraction;}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;})(this);

/***/ }),

/***/ "./node_modules/hash-int/hashint.js":
/***/ ((module) => {

"use strict";
var A = void 0 === typeof Uint32Array ? [0] : new Uint32Array(1);function hashInt(x) {return A[0] = 0 | x, A[0] -= A[0] << 6, A[0] ^= A[0] >>> 17, A[0] -= A[0] << 9, A[0] ^= A[0] << 4, A[0] -= A[0] << 3, A[0] ^= A[0] << 10, A[0] ^= A[0] >>> 15, A[0];}module.exports = hashInt;

/***/ }),

/***/ "./node_modules/javascript-natural-sort/naturalSort.js":
/***/ ((module) => {

module.exports = function naturalSort(a, b) {"use strict";var oFxNcL,oFyNcL,re = /(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,sre = /(^[ ]*|[ ]*$)/g,dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,hre = /^0x[0-9a-f]+$/i,ore = /^0/,i = function (s) {return naturalSort.insensitive && ("" + s).toLowerCase() || "" + s;},x = i(a).replace(sre, "") || "",y = i(b).replace(sre, "") || "",xN = x.replace(re, "\0$1\0").replace(/\0$/, "").replace(/^\0/, "").split("\0"),yN = y.replace(re, "\0$1\0").replace(/\0$/, "").replace(/^\0/, "").split("\0"),xD = parseInt(x.match(hre), 16) || 1 !== xN.length && x.match(dre) && Date.parse(x),yD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null;if (yD) {if (xD < yD) return -1;if (xD > yD) return 1;}for (var cLoc = 0, numS = Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {if (oFxNcL = !(xN[cLoc] || "").match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0, oFyNcL = !(yN[cLoc] || "").match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0, isNaN(oFxNcL) !== isNaN(oFyNcL)) return isNaN(oFxNcL) ? 1 : -1;if (typeof oFxNcL != typeof oFyNcL && (oFxNcL += "", oFyNcL += ""), oFxNcL < oFyNcL) return -1;if (oFxNcL > oFyNcL) return 1;}return 0;};

/***/ }),

/***/ "./node_modules/regenerator-runtime/runtime.js":
/***/ ((module) => {

var runtime = function (exports) {"use strict";function define(obj, key, value) {return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key];}function wrap(innerFn, outerFn, self, tryLocsList) {var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,generator = Object.create(protoGenerator.prototype),context = new Context(tryLocsList || []);return generator._invoke = makeInvokeMethod(innerFn, self, context), generator;}function tryCatch(fn, obj, arg) {try {return { type: "normal", arg: fn.call(obj, arg) };} catch (err) {return { type: "throw", arg: err };}}function Generator() {}function GeneratorFunction() {}function GeneratorFunctionPrototype() {}function defineIteratorMethods(prototype) {["next", "throw", "return"].forEach(function (method) {define(prototype, method, function (arg) {return this._invoke(method, arg);});});}function AsyncIterator(generator, PromiseImpl) {function invoke(method, arg, resolve, reject) {var record = tryCatch(generator[method], generator, arg);if ("throw" === record.type) reject(record.arg);else {var result = record.arg,value = result.value;return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {invoke("next", value, resolve, reject);}, function (err) {invoke("throw", err, resolve, reject);}) : PromiseImpl.resolve(value).then(function (unwrapped) {result.value = unwrapped, resolve(result);}, function (error) {return invoke("throw", error, resolve, reject);});}}function enqueue(method, arg) {function callInvokeWithMethodAndArg() {return new PromiseImpl(function (resolve, reject) {invoke(method, arg, resolve, reject);});}return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();}var previousPromise;this._invoke = enqueue;}function makeInvokeMethod(innerFn, self, context) {var state = "suspendedStart";return function invoke(method, arg) {if ("executing" === state) throw new Error("Generator is already running");if ("completed" === state) {if ("throw" === method) throw arg;return doneResult();}for (context.method = method, context.arg = arg; !0;) {var delegate = context.delegate;if (delegate) {var delegateResult = maybeInvokeDelegate(delegate, context);if (delegateResult) {if (delegateResult === ContinueSentinel) continue;return delegateResult;}}if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {if ("suspendedStart" === state) throw state = "completed", context.arg;context.dispatchException(context.arg);} else "return" === context.method && context.abrupt("return", context.arg);state = "executing";var record = tryCatch(innerFn, self, context);if ("normal" === record.type) {if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;return { value: record.arg, done: context.done };}"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);}};}function maybeInvokeDelegate(delegate, context) {var method = delegate.iterator[context.method];if (void 0 === method) {if (context.delegate = null, "throw" === context.method) {if (delegate.iterator["return"] && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");}return ContinueSentinel;}var record = tryCatch(method, delegate.iterator, context.arg);if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;var info = record.arg;if (!info) return context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel;if (info.done) context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0);else return info;return context.delegate = null, ContinueSentinel;}function pushTryEntry(locs) {var entry = { tryLoc: locs[0] };1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);}function resetTryEntry(entry) {var record = entry.completion || {};record.type = "normal", delete record.arg, entry.completion = record;}function Context(tryLocsList) {this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);}function values(iterable) {if (iterable) {var iteratorMethod = iterable[iteratorSymbol];if (iteratorMethod) return iteratorMethod.call(iterable);if ("function" == typeof iterable.next) return iterable;if (!isNaN(iterable.length)) {var i = -1,next = function next() {for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;return next.value = void 0, next.done = !0, next;};return next.next = next;}}return { next: doneResult };}function doneResult() {return { value: void 0, done: !0 };}var Op = Object.prototype,hasOwn = Op.hasOwnProperty,$Symbol = "function" == typeof Symbol ? Symbol : {},iteratorSymbol = $Symbol.iterator || "@@iterator",asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";try {define({}, "");} catch (err) {define = function (obj, key, value) {return obj[key] = value;};}exports.wrap = wrap;var ContinueSentinel = {},IteratorPrototype = {};IteratorPrototype[iteratorSymbol] = function () {return this;};var getProto = Object.getPrototypeOf,NativeIteratorPrototype = getProto && getProto(getProto(values([])));NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);return GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype, GeneratorFunctionPrototype.constructor = GeneratorFunction, GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {var ctor = "function" == typeof genFun && genFun.constructor;return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));}, exports.mark = function (genFun) {return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;}, exports.awrap = function (arg) {return { __await: arg };}, defineIteratorMethods(AsyncIterator.prototype), AsyncIterator.prototype[asyncIteratorSymbol] = function () {return this;}, exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {void 0 === PromiseImpl && (PromiseImpl = Promise);var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {return result.done ? result.value : iter.next();});}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), Gp[iteratorSymbol] = function () {return this;}, Gp.toString = function () {return "[object Generator]";}, exports.keys = function (object) {var keys = [];for (var key in object) keys.push(key);return keys.reverse(), function next() {for (; keys.length;) {var key = keys.pop();if (key in object) return next.value = key, next.done = !1, next;}return next.done = !0, next;};}, exports.values = values, Context.prototype = { constructor: Context, reset: function (skipTempReset) {if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);}, stop: function () {this.done = !0;var rootEntry = this.tryEntries[0],rootRecord = rootEntry.completion;if ("throw" === rootRecord.type) throw rootRecord.arg;return this.rval;}, dispatchException: function (exception) {function handle(loc, caught) {return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;}if (this.done) throw exception;for (var context = this, i = this.tryEntries.length - 1; 0 <= i; --i) {var entry = this.tryEntries[i],record = entry.completion;if ("root" === entry.tryLoc) return handle("end");if (entry.tryLoc <= this.prev) {var hasCatch = hasOwn.call(entry, "catchLoc"),hasFinally = hasOwn.call(entry, "finallyLoc");if (hasCatch && hasFinally) {if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);} else if (hasCatch) {if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);} else if (!hasFinally) throw new Error("try statement without catch or finally");else if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);}}}, abrupt: function (type, arg) {for (var entry, i = this.tryEntries.length - 1; 0 <= i; --i) if (entry = this.tryEntries[i], entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {var finallyEntry = entry;break;}finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);var record = finallyEntry ? finallyEntry.completion : {};return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);}, complete: function (record, afterLoc) {if ("throw" === record.type) throw record.arg;return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;}, finish: function (finallyLoc) {for (var entry, i = this.tryEntries.length - 1; 0 <= i; --i) if (entry = this.tryEntries[i], entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;}, catch: function (tryLoc) {for (var entry, i = this.tryEntries.length - 1; 0 <= i; --i) if (entry = this.tryEntries[i], entry.tryLoc === tryLoc) {var record = entry.completion;if ("throw" === record.type) {var thrown = record.arg;resetTryEntry(entry);}return thrown;}throw new Error("illegal catch attempt");}, delegateYield: function (iterable, resultName, nextLoc) {return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;} }, exports;}( true ? module.exports : 0);try {regeneratorRuntime = runtime;} catch (accidentalStrictMode) {Function("r", "regeneratorRuntime = r")(runtime);}

/***/ }),

/***/ "./node_modules/seedrandom/index.js":
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var alea = __webpack_require__("./node_modules/seedrandom/lib/alea.js"),xor128 = __webpack_require__("./node_modules/seedrandom/lib/xor128.js"),xorwow = __webpack_require__("./node_modules/seedrandom/lib/xorwow.js"),xorshift7 = __webpack_require__("./node_modules/seedrandom/lib/xorshift7.js"),xor4096 = __webpack_require__("./node_modules/seedrandom/lib/xor4096.js"),tychei = __webpack_require__("./node_modules/seedrandom/lib/tychei.js"),sr = __webpack_require__("./node_modules/seedrandom/seedrandom.js");sr.alea = alea, sr.xor128 = xor128, sr.xorwow = xorwow, sr.xorshift7 = xorshift7, sr.xor4096 = xor4096, sr.tychei = tychei, module.exports = sr;

/***/ }),

/***/ "./node_modules/seedrandom/lib/alea.js":
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var __WEBPACK_AMD_DEFINE_RESULT__;(function (global, module, define) {function Alea(seed) {var me = this,mash = Mash();me.next = function () {var t = 2091639 * me.s0 + 23283064365386963e-26 * me.c;return me.s0 = me.s1, me.s1 = me.s2, me.s2 = t - (me.c = 0 | t);}, me.c = 1, me.s0 = mash(" "), me.s1 = mash(" "), me.s2 = mash(" "), me.s0 -= mash(seed), 0 > me.s0 && (me.s0 += 1), me.s1 -= mash(seed), 0 > me.s1 && (me.s1 += 1), me.s2 -= mash(seed), 0 > me.s2 && (me.s2 += 1), mash = null;}function copy(f, t) {return t.c = f.c, t.s0 = f.s0, t.s1 = f.s1, t.s2 = f.s2, t;}function impl(seed, opts) {var xg = new Alea(seed),state = opts && opts.state,prng = xg.next;return prng.int32 = function () {return 0 | 4294967296 * xg.next();}, prng.double = function () {return prng() + 11102230246251565e-32 * (0 | 2097152 * prng());}, prng.quick = prng, state && ("object" == typeof state && copy(state, xg), prng.state = function () {return copy(xg, {});}), prng;}function Mash() {var n = 4022871197,mash = function (data) {data = data + "";for (var i = 0; i < data.length; i++) {n += data.charCodeAt(i);var h = .02519603282416938 * n;n = h >>> 0, h -= n, h *= n, n = h >>> 0, h -= n, n += 4294967296 * h;}return 23283064365386963e-26 * (n >>> 0);};return mash;}module && module.exports ? module.exports = impl : __webpack_require__.amdD && __webpack_require__.amdO ? !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return impl;}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : this.alea = impl;})(this,  true && module, __webpack_require__.amdD);

/***/ }),

/***/ "./node_modules/seedrandom/lib/tychei.js":
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var __WEBPACK_AMD_DEFINE_RESULT__;(function (global, module, define) {function XorGen(seed) {var me = this,strseed = "";me.next = function () {var b = me.b,c = me.c,d = me.d,a = me.a;return b = b << 25 ^ b >>> 7 ^ c, c = 0 | c - d, d = d << 24 ^ d >>> 8 ^ a, a = 0 | a - b, me.b = b = b << 20 ^ b >>> 12 ^ c, me.c = c = 0 | c - d, me.d = d << 16 ^ c >>> 16 ^ a, me.a = 0 | a - b;}, me.a = 0, me.b = 0, me.c = -1640531527, me.d = 1367130551, seed === Math.floor(seed) ? (me.a = 0 | seed / 4294967296, me.b = 0 | seed) : strseed += seed;for (var k = 0; k < strseed.length + 20; k++) me.b ^= 0 | strseed.charCodeAt(k), me.next();}function copy(f, t) {return t.a = f.a, t.b = f.b, t.c = f.c, t.d = f.d, t;}function impl(seed, opts) {var xg = new XorGen(seed),state = opts && opts.state,prng = function () {return (xg.next() >>> 0) / 4294967296;};return prng.double = function () {do var top = xg.next() >>> 11,bot = (xg.next() >>> 0) / 4294967296,result = (top + bot) / 2097152; while (0 === result);return result;}, prng.int32 = xg.next, prng.quick = prng, state && ("object" == typeof state && copy(state, xg), prng.state = function () {return copy(xg, {});}), prng;}module && module.exports ? module.exports = impl : __webpack_require__.amdD && __webpack_require__.amdO ? !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return impl;}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : this.tychei = impl;})(this,  true && module, __webpack_require__.amdD);

/***/ }),

/***/ "./node_modules/seedrandom/lib/xor128.js":
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var __WEBPACK_AMD_DEFINE_RESULT__;(function (global, module, define) {function XorGen(seed) {var me = this,strseed = "";me.x = 0, me.y = 0, me.z = 0, me.w = 0, me.next = function () {var t = me.x ^ me.x << 11;return me.x = me.y, me.y = me.z, me.z = me.w, me.w ^= me.w >>> 19 ^ t ^ t >>> 8;}, seed === (0 | seed) ? me.x = seed : strseed += seed;for (var k = 0; k < strseed.length + 64; k++) me.x ^= 0 | strseed.charCodeAt(k), me.next();}function copy(f, t) {return t.x = f.x, t.y = f.y, t.z = f.z, t.w = f.w, t;}function impl(seed, opts) {var xg = new XorGen(seed),state = opts && opts.state,prng = function () {return (xg.next() >>> 0) / 4294967296;};return prng.double = function () {do var top = xg.next() >>> 11,bot = (xg.next() >>> 0) / 4294967296,result = (top + bot) / 2097152; while (0 === result);return result;}, prng.int32 = xg.next, prng.quick = prng, state && ("object" == typeof state && copy(state, xg), prng.state = function () {return copy(xg, {});}), prng;}module && module.exports ? module.exports = impl : __webpack_require__.amdD && __webpack_require__.amdO ? !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return impl;}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : this.xor128 = impl;})(this,  true && module, __webpack_require__.amdD);

/***/ }),

/***/ "./node_modules/seedrandom/lib/xor4096.js":
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var __WEBPACK_AMD_DEFINE_RESULT__;(function (global, module, define) {function XorGen(seed) {var me = this;me.next = function () {var t,v,w = me.w,X = me.X,i = me.i;return me.w = w = 0 | w + 1640531527, v = X[127 & i + 34], t = X[i = 127 & i + 1], v ^= v << 13, t ^= t << 17, v ^= v >>> 15, t ^= t >>> 12, v = X[i] = v ^ t, me.i = i, 0 | v + (w ^ w >>> 16);}, function (me, seed) {var t,v,i,j,w,X = [],limit = 128;for (seed === (0 | seed) ? (v = seed, seed = null) : (seed += "\0", v = 0, limit = Math.max(limit, seed.length)), i = 0, j = -32; j < limit; ++j) seed && (v ^= seed.charCodeAt((j + 32) % seed.length)), 0 === j && (w = v), v ^= v << 10, v ^= v >>> 15, v ^= v << 4, v ^= v >>> 13, 0 <= j && (w = 0 | w + 1640531527, t = X[127 & j] ^= v + w, i = 0 == t ? i + 1 : 0);for (128 <= i && (X[127 & (seed && seed.length || 0)] = -1), i = 127, j = 512; 0 < j; --j) v = X[127 & i + 34], t = X[i = 127 & i + 1], v ^= v << 13, t ^= t << 17, v ^= v >>> 15, t ^= t >>> 12, X[i] = v ^ t;me.w = w, me.X = X, me.i = i;}(me, seed);}function copy(f, t) {return t.i = f.i, t.w = f.w, t.X = f.X.slice(), t;}function impl(seed, opts) {null == seed && (seed = +new Date());var xg = new XorGen(seed),state = opts && opts.state,prng = function () {return (xg.next() >>> 0) / 4294967296;};return prng.double = function () {do var top = xg.next() >>> 11,bot = (xg.next() >>> 0) / 4294967296,result = (top + bot) / 2097152; while (0 === result);return result;}, prng.int32 = xg.next, prng.quick = prng, state && (state.X && copy(state, xg), prng.state = function () {return copy(xg, {});}), prng;}module && module.exports ? module.exports = impl : __webpack_require__.amdD && __webpack_require__.amdO ? !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return impl;}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : this.xor4096 = impl;})(this,  true && module, __webpack_require__.amdD);

/***/ }),

/***/ "./node_modules/seedrandom/lib/xorshift7.js":
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var __WEBPACK_AMD_DEFINE_RESULT__;(function (global, module, define) {function XorGen(seed) {var me = this;me.next = function () {var t,v,X = me.x,i = me.i;return t = X[i], t ^= t >>> 7, v = t ^ t << 24, t = X[7 & i + 1], v ^= t ^ t >>> 10, t = X[7 & i + 3], v ^= t ^ t >>> 3, t = X[7 & i + 4], v ^= t ^ t << 7, t = X[7 & i + 7], t ^= t << 13, v ^= t ^ t << 9, X[i] = v, me.i = 7 & i + 1, v;}, function (me, seed) {var j,w,X = [];if (seed === (0 | seed)) w = X[0] = seed;else for (seed = "" + seed, j = 0; j < seed.length; ++j) X[7 & j] = X[7 & j] << 15 ^ seed.charCodeAt(j) + X[7 & j + 1] << 13;for (; 8 > X.length;) X.push(0);for (j = 0; 8 > j && 0 === X[j]; ++j);for (w = 8 == j ? X[7] = -1 : X[j], me.x = X, me.i = 0, j = 256; 0 < j; --j) me.next();}(me, seed);}function copy(f, t) {return t.x = f.x.slice(), t.i = f.i, t;}function impl(seed, opts) {null == seed && (seed = +new Date());var xg = new XorGen(seed),state = opts && opts.state,prng = function () {return (xg.next() >>> 0) / 4294967296;};return prng.double = function () {do var top = xg.next() >>> 11,bot = (xg.next() >>> 0) / 4294967296,result = (top + bot) / 2097152; while (0 === result);return result;}, prng.int32 = xg.next, prng.quick = prng, state && (state.x && copy(state, xg), prng.state = function () {return copy(xg, {});}), prng;}module && module.exports ? module.exports = impl : __webpack_require__.amdD && __webpack_require__.amdO ? !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return impl;}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : this.xorshift7 = impl;})(this,  true && module, __webpack_require__.amdD);

/***/ }),

/***/ "./node_modules/seedrandom/lib/xorwow.js":
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var __WEBPACK_AMD_DEFINE_RESULT__;(function (global, module, define) {function XorGen(seed) {var me = this,strseed = "";me.next = function () {var t = me.x ^ me.x >>> 2;return me.x = me.y, me.y = me.z, me.z = me.w, me.w = me.v, 0 | (me.d = 0 | me.d + 362437) + (me.v = me.v ^ me.v << 4 ^ (t ^ t << 1));}, me.x = 0, me.y = 0, me.z = 0, me.w = 0, me.v = 0, seed === (0 | seed) ? me.x = seed : strseed += seed;for (var k = 0; k < strseed.length + 64; k++) me.x ^= 0 | strseed.charCodeAt(k), k == strseed.length && (me.d = me.x << 10 ^ me.x >>> 4), me.next();}function copy(f, t) {return t.x = f.x, t.y = f.y, t.z = f.z, t.w = f.w, t.v = f.v, t.d = f.d, t;}function impl(seed, opts) {var xg = new XorGen(seed),state = opts && opts.state,prng = function () {return (xg.next() >>> 0) / 4294967296;};return prng.double = function () {do var top = xg.next() >>> 11,bot = (xg.next() >>> 0) / 4294967296,result = (top + bot) / 2097152; while (0 === result);return result;}, prng.int32 = xg.next, prng.quick = prng, state && ("object" == typeof state && copy(state, xg), prng.state = function () {return copy(xg, {});}), prng;}module && module.exports ? module.exports = impl : __webpack_require__.amdD && __webpack_require__.amdO ? !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return impl;}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : this.xorwow = impl;})(this,  true && module, __webpack_require__.amdD);

/***/ }),

/***/ "./node_modules/seedrandom/seedrandom.js":
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_RESULT__;(function (global, pool, math) {function seedrandom(seed, options, callback) {var key = [];options = !0 == options ? { entropy: !0 } : options || {};var shortseed = mixkey(flatten(options.entropy ? [seed, tostring(pool)] : null == seed ? autoseed() : seed, 3), key),arc4 = new ARC4(key),prng = function () {for (var n = arc4.g(6), d = startdenom, x = 0; n < significance;) n = 256 * (n + x), d *= 256, x = arc4.g(1);for (; n >= overflow;) n /= 2, d /= 2, x >>>= 1;return (n + x) / d;};return prng.int32 = function () {return 0 | arc4.g(4);}, prng.quick = function () {return arc4.g(4) / 4294967296;}, prng.double = prng, mixkey(tostring(arc4.S), pool), (options.pass || callback || function (prng, seed, is_math_call, state) {return state && (state.S && copy(state, arc4), prng.state = function () {return copy(arc4, {});}), is_math_call ? (math.random = prng, seed) : prng;})(prng, shortseed, "global" in options ? options.global : this == math, options.state);}function ARC4(key) {var t,keylen = key.length,me = this,i = 0,j = me.i = me.j = 0,s = me.S = [];for (keylen || (key = [keylen++]); 256 > i;) s[i] = i++;for (i = 0; 256 > i; i++) s[i] = s[j = 255 & j + key[i % keylen] + (t = s[i])], s[j] = t;(me.g = function (count) {for (var t, r = 0, i = me.i, j = me.j, s = me.S; count--;) t = s[i = 255 & i + 1], r = 256 * r + s[255 & (s[i] = s[j = 255 & j + t]) + (s[j] = t)];return me.i = i, me.j = j, r;})(256);}function copy(f, t) {return t.i = f.i, t.j = f.j, t.S = f.S.slice(), t;}function flatten(obj, depth) {var prop,result = [],typ = typeof obj;if (depth && "object" == typ) for (prop in obj) try {result.push(flatten(obj[prop], depth - 1));} catch (e) {}return result.length ? result : "string" == typ ? obj : obj + "\0";}function mixkey(seed, key) {for (var smear, stringseed = seed + "", j = 0; j < stringseed.length;) key[255 & j] = 255 & (smear ^= 19 * key[255 & j]) + stringseed.charCodeAt(j++);return tostring(key);}function autoseed() {try {var out;return nodecrypto && (out = nodecrypto.randomBytes) ? out = out(256) : (out = new Uint8Array(256), (global.crypto || global.msCrypto).getRandomValues(out)), tostring(out);} catch (e) {var browser = global.navigator,plugins = browser && browser.plugins;return [+new Date(), global, plugins, global.screen, tostring(pool)];}}function tostring(a) {return String.fromCharCode.apply(0, a);}var nodecrypto,startdenom = math.pow(256, 6),significance = math.pow(2, 52),overflow = 2 * significance;if (mixkey(math.random(), pool),  true && module.exports) {module.exports = seedrandom;try {nodecrypto = __webpack_require__("crypto");} catch (ex) {}} else  true ? !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return seedrandom;}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;})("undefined" == typeof self ? this : self, [], Math);

/***/ }),

/***/ "./node_modules/tiny-emitter/index.js":
/***/ ((module) => {

function E() {}E.prototype = { on: function (name, callback, ctx) {var e = this.e || (this.e = {});return (e[name] || (e[name] = [])).push({ fn: callback, ctx: ctx }), this;}, once: function (name, callback, ctx) {function listener() {self.off(name, listener), callback.apply(ctx, arguments);}var self = this;return listener._ = callback, this.on(name, listener, ctx);}, emit: function (name) {var data = [].slice.call(arguments, 1),evtArr = ((this.e || (this.e = {}))[name] || []).slice(),i = 0,len = evtArr.length;for (i; i < len; i++) evtArr[i].fn.apply(evtArr[i].ctx, data);return this;}, off: function (name, callback) {var e = this.e || (this.e = {}),evts = e[name],liveEvents = [];if (evts && callback) for (var i = 0, len = evts.length; i < len; i++) evts[i].fn !== callback && evts[i].fn._ !== callback && liveEvents.push(evts[i]);return liveEvents.length ? e[name] = liveEvents : delete e[name], this;} }, module.exports = E, module.exports.TinyEmitter = E;

/***/ }),

/***/ "./node_modules/typed-function/typed-function.js":
/***/ (function(module, exports) {

"use strict";
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
		__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
		(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;})(this, function () {function ok() {return !0;}function notOk() {return !1;}function undef() {}function create() {function findTypeByName(typeName) {var entry = findInArray(typed.types, function (entry) {return entry.name === typeName;});if (entry) return entry;if ("any" === typeName) return anyType;var hint = findInArray(typed.types, function (entry) {return entry.name.toLowerCase() === typeName.toLowerCase();});throw new TypeError("Unknown type \"" + typeName + "\"" + (hint ? ". Did you mean \"" + hint.name + "\"?" : ""));}function findTypeIndex(type) {return type === anyType ? 999 : typed.types.indexOf(type);}function findTypeName(value) {var entry = findInArray(typed.types, function (entry) {return entry.test(value);});if (entry) return entry.name;throw new TypeError("Value has unknown type. Value: " + value);}function convert(value, type) {var from = findTypeName(value);if (type === from) return value;for (var conversion, i = 0; i < typed.conversions.length; i++) if (conversion = typed.conversions[i], conversion.from === from && conversion.to === type) return conversion.convert(value);throw new Error("Cannot convert from " + from + " to " + type);}function stringifyParams(params) {return params.map(function (param) {var typeNames = param.types.map(getTypeName);return (param.restParam ? "..." : "") + typeNames.join("|");}).join(",");}function parseParam(param, conversions) {var restParam = 0 === param.indexOf("..."),types = restParam ? 3 < param.length ? param.slice(3) : "any" : param,typeNames = types.split("|").map(trim).filter(notEmpty).filter(notIgnore),matchingConversions = filterConversions(conversions, typeNames),exactTypes = typeNames.map(function (typeName) {var type = findTypeByName(typeName);return { name: typeName, typeIndex: findTypeIndex(type), test: type.test, conversion: null, conversionIndex: -1 };}),convertibleTypes = matchingConversions.map(function (conversion) {var type = findTypeByName(conversion.from);return { name: conversion.from, typeIndex: findTypeIndex(type), test: type.test, conversion: conversion, conversionIndex: conversions.indexOf(conversion) };});return { types: exactTypes.concat(convertibleTypes), restParam: restParam };}function parseSignature(signature, fn, conversions) {var params = [];return "" !== signature.trim() && (params = signature.split(",").map(trim).map(function (param, index, array) {var parsedParam = parseParam(param, conversions);if (parsedParam.restParam && index !== array.length - 1) throw new SyntaxError("Unexpected rest parameter \"" + param + "\": only allowed for the last parameter");return parsedParam;})), params.some(isInvalidParam) ? null : { params: params, fn: fn };}function hasRestParam(params) {var param = last(params);return !!param && param.restParam;}function hasConversions(param) {return param.types.some(function (type) {return null != type.conversion;});}function compileTest(param) {if (!param || 0 === param.types.length) return ok;if (1 === param.types.length) return findTypeByName(param.types[0].name).test;if (2 === param.types.length) {var test0 = findTypeByName(param.types[0].name).test,test1 = findTypeByName(param.types[1].name).test;return function or(x) {return test0(x) || test1(x);};}var tests = param.types.map(function (type) {return findTypeByName(type.name).test;});return function or(x) {for (var i = 0; i < tests.length; i++) if (tests[i](x)) return !0;return !1;};}function compileTests(params) {var tests, test0, test1;if (hasRestParam(params)) {tests = initial(params).map(compileTest);var varIndex = tests.length,lastTest = compileTest(last(params)),testRestParam = function (args) {for (var i = varIndex; i < args.length; i++) if (!lastTest(args[i])) return !1;return !0;};return function testArgs(args) {for (var i = 0; i < tests.length; i++) if (!tests[i](args[i])) return !1;return testRestParam(args) && args.length >= varIndex + 1;};}return 0 === params.length ? function testArgs(args) {return 0 === args.length;} : 1 === params.length ? (test0 = compileTest(params[0]), function testArgs(args) {return test0(args[0]) && 1 === args.length;}) : 2 === params.length ? (test0 = compileTest(params[0]), test1 = compileTest(params[1]), function testArgs(args) {return test0(args[0]) && test1(args[1]) && 2 === args.length;}) : (tests = params.map(compileTest), function testArgs(args) {for (var i = 0; i < tests.length; i++) if (!tests[i](args[i])) return !1;return args.length === tests.length;});}function getParamAtIndex(signature, index) {return index < signature.params.length ? signature.params[index] : hasRestParam(signature.params) ? last(signature.params) : null;}function getExpectedTypeNames(signature, index, excludeConversions) {var param = getParamAtIndex(signature, index),types = param ? excludeConversions ? param.types.filter(isExactType) : param.types : [];return types.map(getTypeName);}function getTypeName(type) {return type.name;}function isExactType(type) {return null === type.conversion || void 0 === type.conversion;}function mergeExpectedParams(signatures, index) {var typeNames = uniq(flatMap(signatures, function (signature) {return getExpectedTypeNames(signature, index, !1);}));return -1 === typeNames.indexOf("any") ? typeNames : ["any"];}function createError(name, args, signatures) {var err,expected,index,_name = name || "unnamed",matchingSignatures = signatures;for (index = 0; index < args.length; index++) {var nextMatchingDefs = matchingSignatures.filter(function (signature) {var test = compileTest(getParamAtIndex(signature, index));return (index < signature.params.length || hasRestParam(signature.params)) && test(args[index]);});if (0 !== nextMatchingDefs.length) matchingSignatures = nextMatchingDefs;else if (expected = mergeExpectedParams(matchingSignatures, index), 0 < expected.length) {var actualType = findTypeName(args[index]);return err = new TypeError("Unexpected type of argument in function " + _name + " (expected: " + expected.join(" or ") + ", actual: " + actualType + ", index: " + index + ")"), err.data = { category: "wrongType", fn: _name, index: index, actual: actualType, expected: expected }, err;}}var lengths = matchingSignatures.map(function (signature) {return hasRestParam(signature.params) ? 1 / 0 : signature.params.length;});if (args.length < Math.min.apply(null, lengths)) return expected = mergeExpectedParams(matchingSignatures, index), err = new TypeError("Too few arguments in function " + _name + " (expected: " + expected.join(" or ") + ", index: " + args.length + ")"), err.data = { category: "tooFewArgs", fn: _name, index: args.length, expected: expected }, err;var maxLength = Math.max.apply(null, lengths);return args.length > maxLength ? (err = new TypeError("Too many arguments in function " + _name + " (expected: " + maxLength + ", actual: " + args.length + ")"), err.data = { category: "tooManyArgs", fn: _name, index: args.length, expectedLength: maxLength }, err) : (err = new TypeError("Arguments of type \"" + args.join(", ") + "\" do not match any of the defined signatures of function " + _name + "."), err.data = { category: "mismatch", actual: args.map(findTypeName) }, err);}function getLowestTypeIndex(param) {for (var min = 999, i = 0; i < param.types.length; i++) isExactType(param.types[i]) && (min = Math.min(min, param.types[i].typeIndex));return min;}function getLowestConversionIndex(param) {for (var min = 999, i = 0; i < param.types.length; i++) isExactType(param.types[i]) || (min = Math.min(min, param.types[i].conversionIndex));return min;}function compareParams(param1, param2) {var c;return (c = param1.restParam - param2.restParam, 0 !== c) ? c : (c = hasConversions(param1) - hasConversions(param2), 0 !== c) ? c : (c = getLowestTypeIndex(param1) - getLowestTypeIndex(param2), 0 === c ? getLowestConversionIndex(param1) - getLowestConversionIndex(param2) : c);}function compareSignatures(signature1, signature2) {var i,c,len = Math.min(signature1.params.length, signature2.params.length);if (c = signature1.params.some(hasConversions) - signature2.params.some(hasConversions), 0 !== c) return c;for (i = 0; i < len; i++) if (c = hasConversions(signature1.params[i]) - hasConversions(signature2.params[i]), 0 !== c) return c;for (i = 0; i < len; i++) if (c = compareParams(signature1.params[i], signature2.params[i]), 0 !== c) return c;return signature1.params.length - signature2.params.length;}function filterConversions(conversions, typeNames) {var matches = {};return conversions.forEach(function (conversion) {-1 !== typeNames.indexOf(conversion.from) || -1 === typeNames.indexOf(conversion.to) || matches[conversion.from] || (matches[conversion.from] = conversion);}), Object.keys(matches).map(function (from) {return matches[from];});}function compileArgsPreprocessing(params, fn) {var fnConvert = fn;if (params.some(hasConversions)) {var restParam = hasRestParam(params),compiledConversions = params.map(compileArgConversion);fnConvert = function convertArgs() {for (var args = [], last = restParam ? arguments.length - 1 : arguments.length, i = 0; i < last; i++) args[i] = compiledConversions[i](arguments[i]);return restParam && (args[last] = arguments[last].map(compiledConversions[last])), fn.apply(this, args);};}var fnPreprocess = fnConvert;if (hasRestParam(params)) {var offset = params.length - 1;fnPreprocess = function preprocessRestParams() {return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)]));};}return fnPreprocess;}function compileArgConversion(param) {var test0,test1,conversion0,conversion1,tests = [],conversions = [];switch (param.types.forEach(function (type) {type.conversion && (tests.push(findTypeByName(type.conversion.from).test), conversions.push(type.conversion.convert));}), conversions.length) {case 0:return function convertArg(arg) {return arg;};case 1:return test0 = tests[0], conversion0 = conversions[0], function convertArg(arg) {return test0(arg) ? conversion0(arg) : arg;};case 2:return test0 = tests[0], test1 = tests[1], conversion0 = conversions[0], conversion1 = conversions[1], function convertArg(arg) {return test0(arg) ? conversion0(arg) : test1(arg) ? conversion1(arg) : arg;};default:return function convertArg(arg) {for (var i = 0; i < conversions.length; i++) if (tests[i](arg)) return conversions[i](arg);return arg;};}}function createSignaturesMap(signatures) {var signaturesMap = {};return signatures.forEach(function (signature) {signature.params.some(hasConversions) || splitParams(signature.params, !0).forEach(function (params) {signaturesMap[stringifyParams(params)] = signature.fn;});}), signaturesMap;}function splitParams(params, ignoreConversionTypes) {function _splitParams(params, index, types) {if (index < params.length) {var typeGroups,param = params[index],filteredTypes = ignoreConversionTypes ? param.types.filter(isExactType) : param.types;if (param.restParam) {var exactTypes = filteredTypes.filter(isExactType);typeGroups = exactTypes.length < filteredTypes.length ? [exactTypes, filteredTypes] : [filteredTypes];} else typeGroups = filteredTypes.map(function (type) {return [type];});return flatMap(typeGroups, function (typeGroup) {return _splitParams(params, index + 1, types.concat([typeGroup]));});}var splittedParams = types.map(function (type, typeIndex) {return { types: type, restParam: typeIndex === params.length - 1 && hasRestParam(params) };});return [splittedParams];}return _splitParams(params, 0, []);}function hasConflictingParams(signature1, signature2) {for (var ii = Math.max(signature1.params.length, signature2.params.length), i = 0; i < ii; i++) {var typesNames1 = getExpectedTypeNames(signature1, i, !0),typesNames2 = getExpectedTypeNames(signature2, i, !0);if (!hasOverlap(typesNames1, typesNames2)) return !1;}var len1 = signature1.params.length,len2 = signature2.params.length,restParam1 = hasRestParam(signature1.params),restParam2 = hasRestParam(signature2.params);return restParam1 ? restParam2 ? len1 === len2 : len2 >= len1 : restParam2 ? len1 >= len2 : len1 === len2;}function createTypedFunction(name, signaturesMap) {if (0 === Object.keys(signaturesMap).length) throw new SyntaxError("No signatures provided");var parsedSignatures = [];Object.keys(signaturesMap).map(function (signature) {return parseSignature(signature, signaturesMap[signature], typed.conversions);}).filter(notNull).forEach(function (parsedSignature) {var conflictingSignature = findInArray(parsedSignatures, function (s) {return hasConflictingParams(s, parsedSignature);});if (conflictingSignature) throw new TypeError("Conflicting signatures \"" + stringifyParams(conflictingSignature.params) + "\" and \"" + stringifyParams(parsedSignature.params) + "\".");parsedSignatures.push(parsedSignature);});var signatures = flatMap(parsedSignatures, function (parsedSignature) {var params = parsedSignature ? splitParams(parsedSignature.params, !1) : [];return params.map(function (params) {return { params: params, fn: parsedSignature.fn };});}).filter(notNull);signatures.sort(compareSignatures);var ok0 = signatures[0] && 2 >= signatures[0].params.length && !hasRestParam(signatures[0].params),ok1 = signatures[1] && 2 >= signatures[1].params.length && !hasRestParam(signatures[1].params),ok2 = signatures[2] && 2 >= signatures[2].params.length && !hasRestParam(signatures[2].params),ok3 = signatures[3] && 2 >= signatures[3].params.length && !hasRestParam(signatures[3].params),ok4 = signatures[4] && 2 >= signatures[4].params.length && !hasRestParam(signatures[4].params),ok5 = signatures[5] && 2 >= signatures[5].params.length && !hasRestParam(signatures[5].params),allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5,tests = signatures.map(function (signature) {return compileTests(signature.params);}),test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk,test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk,test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk,test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk,test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk,test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk,test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk,test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk,test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk,test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk,test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk,test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk,fns = signatures.map(function (signature) {return compileArgsPreprocessing(signature.params, signature.fn);}),fn0 = ok0 ? fns[0] : undef,fn1 = ok1 ? fns[1] : undef,fn2 = ok2 ? fns[2] : undef,fn3 = ok3 ? fns[3] : undef,fn4 = ok4 ? fns[4] : undef,fn5 = ok5 ? fns[5] : undef,len0 = ok0 ? signatures[0].params.length : -1,len1 = ok1 ? signatures[1].params.length : -1,len2 = ok2 ? signatures[2].params.length : -1,len3 = ok3 ? signatures[3].params.length : -1,len4 = ok4 ? signatures[4].params.length : -1,len5 = ok5 ? signatures[5].params.length : -1,iStart = allOk ? 6 : 0,iEnd = signatures.length,generic = function generic() {"use strict";for (var i = iStart; i < iEnd; i++) if (tests[i](arguments)) return fns[i].apply(this, arguments);throw createError(name, arguments, signatures);},fn = function fn(arg0, arg1) {"use strict";return arguments.length === len0 && test00(arg0) && test01(arg1) ? fn0.apply(fn, arguments) : arguments.length === len1 && test10(arg0) && test11(arg1) ? fn1.apply(fn, arguments) : arguments.length === len2 && test20(arg0) && test21(arg1) ? fn2.apply(fn, arguments) : arguments.length === len3 && test30(arg0) && test31(arg1) ? fn3.apply(fn, arguments) : arguments.length === len4 && test40(arg0) && test41(arg1) ? fn4.apply(fn, arguments) : arguments.length === len5 && test50(arg0) && test51(arg1) ? fn5.apply(fn, arguments) : generic.apply(fn, arguments);};try {Object.defineProperty(fn, "name", { value: name });} catch (err) {}return fn.signatures = createSignaturesMap(signatures), fn;}function notIgnore(typeName) {return -1 === typed.ignore.indexOf(typeName);}function trim(str) {return str.trim();}function notEmpty(str) {return !!str;}function notNull(value) {return null !== value;}function isInvalidParam(param) {return 0 === param.types.length;}function initial(arr) {return arr.slice(0, arr.length - 1);}function last(arr) {return arr[arr.length - 1];}function slice(arr, start, end) {return Array.prototype.slice.call(arr, start, end);}function contains(array, item) {return -1 !== array.indexOf(item);}function hasOverlap(array1, array2) {for (var i = 0; i < array1.length; i++) if (contains(array2, array1[i])) return !0;return !1;}function findInArray(arr, test) {for (var i = 0; i < arr.length; i++) if (test(arr[i])) return arr[i];}function uniq(arr) {for (var entries = {}, i = 0; i < arr.length; i++) entries[arr[i]] = !0;return Object.keys(entries);}function flatMap(arr, callback) {return Array.prototype.concat.apply([], arr.map(callback));}function getName(fns) {for (var fn, name = "", i = 0; i < fns.length; i++) if (fn = fns[i], ("object" == typeof fn.signatures || "string" == typeof fn.signature) && "" !== fn.name) if ("" === name) name = fn.name;else if (name !== fn.name) {var err = new Error("Function names do not match (expected: " + name + ", actual: " + fn.name + ")");throw err.data = { actual: fn.name, expected: name }, err;}return name;}function extractSignatures(fns) {function validateUnique(_signature, _fn) {if (signaturesMap.hasOwnProperty(_signature) && _fn !== signaturesMap[_signature]) throw err = new Error("Signature \"" + _signature + "\" is defined twice"), err.data = { signature: _signature }, err;}for (var err, fn, signaturesMap = {}, i = 0; i < fns.length; i++) if (fn = fns[i], "object" == typeof fn.signatures) for (var signature in fn.signatures) fn.signatures.hasOwnProperty(signature) && (validateUnique(signature, fn.signatures[signature]), signaturesMap[signature] = fn.signatures[signature]);else if ("string" == typeof fn.signature) validateUnique(fn.signature, fn), signaturesMap[fn.signature] = fn;else throw err = new TypeError("Function is no typed-function (index: " + i + ")"), err.data = { index: i }, err;return signaturesMap;}var _types = [{ name: "number", test: function (x) {return "number" == typeof x;} }, { name: "string", test: function (x) {return "string" == typeof x;} }, { name: "boolean", test: function (x) {return "boolean" == typeof x;} }, { name: "Function", test: function (x) {return "function" == typeof x;} }, { name: "Array", test: Array.isArray }, { name: "Date", test: function (x) {return x instanceof Date;} }, { name: "RegExp", test: function (x) {return x instanceof RegExp;} }, { name: "Object", test: function (x) {return "object" == typeof x && null !== x && x.constructor === Object;} }, { name: "null", test: function (x) {return null === x;} }, { name: "undefined", test: function (x) {return void 0 === x;} }],anyType = { name: "any", test: ok },_ignore = [],_conversions = [],typed = { types: _types, conversions: _conversions, ignore: _ignore };return typed = createTypedFunction("typed", { "string, Object": createTypedFunction, Object: function (signaturesMap) {var fns = [];for (var signature in signaturesMap) signaturesMap.hasOwnProperty(signature) && fns.push(signaturesMap[signature]);var name = getName(fns);return createTypedFunction(name, signaturesMap);}, "...Function": function (fns) {return createTypedFunction(getName(fns), extractSignatures(fns));}, "string, ...Function": function (name, fns) {return createTypedFunction(name, extractSignatures(fns));} }), typed.create = create, typed.types = _types, typed.conversions = _conversions, typed.ignore = _ignore, typed.convert = convert, typed.find = function find(fn, signature) {if (!fn.signatures) throw new TypeError("Function is no typed-function");var arr;if ("string" == typeof signature) {arr = signature.split(",");for (var i = 0; i < arr.length; i++) arr[i] = arr[i].trim();} else if (Array.isArray(signature)) arr = signature;else throw new TypeError("String array or a comma separated string expected");var str = arr.join(","),match = fn.signatures[str];if (match) return match;throw new TypeError("Signature not found (signature: " + (fn.name || "unnamed") + "(" + arr.join(", ") + "))");}, typed.addType = function (type, beforeObjectTest) {if (!type || "string" != typeof type.name || "function" != typeof type.test) throw new TypeError("Object with properties {name: string, test: function} expected");if (!1 !== beforeObjectTest) for (var i = 0; i < typed.types.length; i++) if ("Object" === typed.types[i].name) return void typed.types.splice(i, 0, type);typed.types.push(type);}, typed.addConversion = function (conversion) {if (!conversion || "string" != typeof conversion.from || "string" != typeof conversion.to || "function" != typeof conversion.convert) throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");typed.conversions.push(conversion);}, typed;}return create();});

/***/ }),

/***/ "./src/MeshBuilder.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AL": () => (/* binding */ AbstractMeshBuilder),
/* harmony export */   "VO": () => (/* binding */ MeshBuilder),
/* harmony export */   "x1": () => (/* binding */ AbstractSubMeshBuilder)
/* harmony export */ });
/* unused harmony export SubMeshBuilder */
/* harmony import */ var _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/index.js");


const mz3d = window.mz3d;

class AbstractMeshBuilder {
  constructor(SubMeshBuilder) {
    this.SubMeshBuilder = SubMeshBuilder;
    this.submeshBuilders = {};
  }
  build() {
    const submeshBuildersArray = Object.values(this.submeshBuilders);
    if (!submeshBuildersArray.length) {return null;}
    const submeshes = submeshBuildersArray.map((builder) => builder.build()).filter((s) => s.getTotalVertices());
    const totalVertices = submeshes.reduce((total, mesh) => {
      if (typeof total !== 'number') {total = total.getTotalVertices();}
      return total + mesh.getTotalVertices();
    });
    const mesh = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Mesh.MergeMeshes(submeshes, true, totalVertices > 64000, undefined, false, true);
    return mesh;
  }
  importBuilder(otherBuilder) {
    const otherSubmeshBuilders = otherBuilder.submeshBuilders;
    for (materialName in otherSubmeshBuilders) {
      const subMeshBuilder = this.getBuilder(materialName);
      const otherSubMeshBuilder = otherSubmeshBuilders[materialName];
      subMeshBuilder.pushNewData(otherSubMeshBuilder.positions, otherSubMeshBuilder.indices, otherSubMeshBuilder.normals, otherSubMeshBuilder.uvs);
    }
  }
  getBuilder(material) {
    const materialName = typeof material === 'string' ? material : material.name;
    if (!(materialName in this.submeshBuilders)) {
      this.submeshBuilders[materialName] = new this.SubMeshBuilder(material);
    }
    return this.submeshBuilders[materialName];
  }

  getUvRect(tsTexture, rect) {
    const { width, height } = tsTexture.getBaseSize();
    rect = mz3d.finalizeTextureRect(rect, width, height);
    let { x, y, width: w, height: h } = rect;
    if (mz3d.EDGE_FIX) {x += mz3d.EDGE_FIX;y += mz3d.EDGE_FIX;w -= mz3d.EDGE_FIX * 2;h -= mz3d.EDGE_FIX * 2;}
    return {
      x1: x / width,
      y1: (height - y) / height,
      x2: (x + w) / width,
      y2: (height - y - h) / height };

  }}


class AbstractSubMeshBuilder {
  constructor(material) {
    this.positions = [];
    this.indices = [];
    this.normals = [];
    this.uvs = [];
    this.submeshName = 'submesh';
    this.material = material;
  }

  build() {
    const mesh = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Mesh(this.submeshName, mz3d.scene);
    //VertexData.ComputeNormals(this.positions,this.indices,this.normals);
    const vdata = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.VertexData();
    vdata.positions = this.positions;
    vdata.indices = this.indices;
    vdata.normals = this.normals;
    vdata.uvs = this.uvs;
    vdata.applyToMesh(mesh);
    mesh.material = this.material;
    return mesh;
  }

  pushNewData(positions, indices, normals, uvs) {
    this.indices.push(...indices.map((i) => i + this.positions.length / 3));
    this.positions.push(...positions);
    this.normals.push(...normals);
    this.uvs.push(...uvs);
  }}


class MeshBuilder extends AbstractMeshBuilder {
  constructor() {
    super(SubMeshBuilder);
  }

  addPointData(material, rect, positions, indices, uvs, options = {}) {
    for (let i = 0; i < positions.length - 2; i += 3) {
      const z = -positions[i + 1];
      positions[i + 1] = positions[i + 2];
      positions[i + 2] = z;
    }
    positions.map((p, i) => {
      switch (i % 3) {
        case 0:return p;
        case 1:}

    });
    const builder = this.getBuilder(material);
    const uvRect = this.getUvRect(material.diffuseTexture, rect);

    if (!options.flip || options.backface) {
      builder.addPointData(positions, indices, uvs, uvRect);
    }
    if (options.flip || options.backface) {
      builder.addPointData(positions, indices.reverse(), uvs, uvRect);
    }
  }

  addQuad(material, rect, xsize, ysize, x, y, z, yaw, pitch, roll, options = {}) {
    const builder = this.getBuilder(material);
    const uvRect = this.getUvRect(material.diffuseTexture, rect);
    builder.addQuad(xsize, ysize, yaw, pitch, roll, x, y, z, uvRect, options);
    if (options.backface) builder.addQuad(xsize, ysize, yaw, pitch, roll, x, y, z, uvRect, { ...options, flip: !options.flip });
  }

  addCube(materials, rects, xsize, ysize, zsize, x, y, z, yaw, pitch, roll, options = {}) {
    const hxs = xsize / 2,hys = ysize / 2,hzs = zsize / 2;
    z += hzs;
    //options.flip=true;
    //const pitch2 = pitch-Math.PI/2;
    for (let i = 0; i < 6; ++i) {
      const material = materials[Math.min(materials.length - 1, i)];
      const rect = rects[Math.min(rects.length - 1, i)];
      if (!material || !rect) continue;
      const builder = this.getBuilder(material);
      const uvRect = this.getUvRect(material.diffuseTexture, rect);
      switch (i) {
        case 0:builder.addCubeFace(xsize, ysize, 0, 0, 0, 0, 0, hzs, yaw, pitch, roll, x, y, z, uvRect, options);break;
        case 1:builder.addCubeFace(xsize, ysize, 0, 0, Math.PI, 0, 0, -hzs, yaw, pitch, roll, x, y, z, { x1: uvRect.x2, x2: uvRect.x1, y1: uvRect.y1, y2: uvRect.y2 }, options);break;
        case 2:builder.addCubeFace(xsize, zsize, 0, Math.PI / 2, 0, 0, hys, 0, yaw, pitch, roll, x, y, z, uvRect, options);break;
        case 3:builder.addCubeFace(ysize, zsize, Math.PI / 2, Math.PI / 2, 0, hxs, 0, 0, yaw, pitch, roll, x, y, z, uvRect, options);break;
        case 4:builder.addCubeFace(xsize, zsize, Math.PI, Math.PI / 2, 0, 0, -hys, 0, yaw, pitch, roll, x, y, z, uvRect, options);break;
        case 5:builder.addCubeFace(ysize, zsize, Math.PI * 3 / 2, Math.PI / 2, 0, -hxs, 0, 0, yaw, pitch, roll, x, y, z, uvRect, options);break;}

    }
  }

  static flipFace(indices, normals) {
    indices.reverse();
    for (let i = 0; i < normals.length; ++i) {normals[i] *= -1;}
  }}


class SubMeshBuilder extends AbstractSubMeshBuilder {
  constructor(material) {
    super(material);
  }

  addPointData(positions, indices, uvs, uvr) {
    for (let i = 0; i < uvs.length - 1; i += 2) {
      uvs[i] = uvr.x1 + (uvr.x2 - uvr.x1) * uvs[i];
      uvs[i + 1] = uvr.y1 + (uvr.y2 - uvr.y1) * uvs[i + 1];
    }
    const normals = [];
    _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.VertexData.ComputeNormals(positions, indices, normals);
    this.pushNewData(positions, indices, normals, uvs);
  }

  addQuad(xsize, zsize, yaw, pitch, roll, xpos, zpos, ypos, uvr, options = {}) {
    zpos = -zpos;
    // q{ 1,1 | 0,0,1 | 0,0,0 | {A,0,0} }
    const hxs = xsize / 2;
    const hzs = zsize / 2;
    const transformationArguments = [yaw, pitch, roll, xpos, ypos, zpos];
    const positions = [
    ...transformPoint(-hxs, 0, hzs, ...transformationArguments),
    ...transformPoint(hxs, 0, hzs, ...transformationArguments),
    ...transformPoint(-hxs, 0, -hzs, ...transformationArguments),
    ...transformPoint(hxs, 0, -hzs, ...transformationArguments)];

    const uvs = [
    uvr.x1, uvr.y1,
    uvr.x2, uvr.y1,
    uvr.x1, uvr.y2,
    uvr.x2, uvr.y2];

    const normals = new Array(4).fill(rotateVector(_babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Up(), yaw, pitch, roll).asArray()).flat();
    const indices = [1, 0, 2, 1, 2, 3];
    if (options.flip) {MeshBuilder.flipFace(indices, normals);}
    this.pushNewData(positions, indices, normals, uvs);
  }
  addCubeFace(xsize, zsize, yaw, pitch, roll, xpos, zpos, ypos, yaw2, pitch2, roll2, xpos2, zpos2, ypos2, uvr, options = {}) {
    zpos = -zpos;zpos2 = -zpos2;
    const hxs = xsize / 2;
    const hzs = zsize / 2;
    const transformationArguments = [yaw, pitch, roll, xpos, ypos, zpos, yaw2, pitch2, roll2, xpos2, ypos2, zpos2];
    const positions = [
    ...doubleTransformPoint(-hxs, 0, hzs, ...transformationArguments),
    ...doubleTransformPoint(hxs, 0, hzs, ...transformationArguments),
    ...doubleTransformPoint(-hxs, 0, -hzs, ...transformationArguments),
    ...doubleTransformPoint(hxs, 0, -hzs, ...transformationArguments)];

    const uvs = [
    uvr.x1, uvr.y1,
    uvr.x2, uvr.y1,
    uvr.x1, uvr.y2,
    uvr.x2, uvr.y2];


    /* // uvs for rotated texture:
    const uvs = [
        uvr.x1,uvr.y2,
    uvr.x1,uvr.y1,
    uvr.x2,uvr.y2,
        uvr.x2,uvr.y1,
    ];
    */
    const normals = new Array(4).fill(rotateVector(rotateVector(_babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Up(), yaw, pitch, roll), yaw2, pitch2, roll2).asArray()).flat();
    const indices = [1, 0, 2, 1, 2, 3];
    if (options.flip) {MeshBuilder.flipFace(indices, normals);}
    this.pushNewData(positions, indices, normals, uvs);
  }}





function transformPoint(x, y, z, yaw, pitch, roll, xpos, ypos, zpos) {
  return rotateVector(new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3(x, y, z), yaw, pitch, roll).addInPlaceFromFloats(xpos, ypos, zpos).asArray();
}

function doubleTransformPoint(x, y, z, yaw, pitch, roll, xpos, ypos, zpos, yaw2, pitch2, roll2, xpos2, ypos2, zpos2) {
  let v = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3(x, y, z);
  v = rotateVector(v, yaw, pitch, roll).addInPlaceFromFloats(xpos, ypos, zpos);
  v = rotateVector(v, yaw2, pitch2, roll2).addInPlaceFromFloats(xpos2, ypos2, zpos2);
  return v.asArray();
}

function rotateVector(v, yaw, pitch, roll) {
  if (roll) v = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.TransformCoordinates(v, _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Matrix.RotationAxis(BABYLON.Axis.Z, -roll));
  if (pitch) v = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.TransformCoordinates(v, _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Matrix.RotationAxis(BABYLON.Axis.X, -pitch));
  if (yaw) v = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.TransformCoordinates(v, _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Matrix.RotationAxis(BABYLON.Axis.Y, -yaw));
  return v;
}

/***/ }),

/***/ "./src/attributes.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "a": () => (/* binding */ Attribute)
/* harmony export */ });
/* unused harmony export AttributeAlias */
const mz3d = window.mz3d;

mz3d.attributes = {};

class AbstractAttribute {}

class Attribute extends AbstractAttribute {
  constructor(name, dfault, reader) {
    super();
    this.name = name.toLowerCase();
    this.reader = reader ? reader : (v) => v;
    this.default = this.reader(dfault);
    this.descriptor = {
      get: () => this.get(),
      set: (v) => {var _this$_onChange;
        this.set(this.reader(v));
        (_this$_onChange = this._onChange) === null || _this$_onChange === void 0 ? void 0 : _this$_onChange.call(this, this.get());
      } };

    Object.defineProperty(mz3d.attributes, this.name, this.descriptor);
    Attribute.instances.push(this);
    Attribute.instances[this.name] = this;
  }
  get() {
    const storage = Attribute.getStorageLocation();
    if (!storage || !(this.name in storage)) {return this.default;}
    return storage[this.name];
  }
  set(v) {
    const storage = Attribute.getStorageLocation();
    if (!storage) {console.warn(`MV3D: Couldn't get Attribute storage location.`);return;}
    storage[this.name] = v;
  }
  static getStorageLocation() {
    if (!$gameVariables) {return null;}
    const store = mz3d.$saveData._attributes || $gameVariables.mv3d_attributes || {};
    if (!mz3d.$saveData._attributes) {
      mz3d.$saveData._attributes = store;
      delete $gameVariables.mv3d_attributes;
    }
    return store;
  }
  onChange(func) {
    this._onChange = func;
    return this;
  }
  static onLoad() {
    for (const attribute of Attribute.instances) {var _attribute$_onChange;
      (_attribute$_onChange = attribute._onChange) === null || _attribute$_onChange === void 0 ? void 0 : _attribute$_onChange.call(attribute, attribute.get());
    }
  }
  alias(name, getter, setter) {
    new AttributeAlias(this.name, name, getter, setter);
    return this;
  }
  static alias(aliasOf, name, getter, setter) {
    return new AttributeAlias(aliasOf, name, getter, setter);
  }}

mz3d.Attribute = Attribute;
Attribute.instances = [];

class AttributeAlias extends AbstractAttribute {// TODO: fix this pls
  constructor(aliasOf, name, getter, setter) {
    super();
    console.log(`creating alias ${name} for attribute ${aliasOf}`, getter, setter);
    this.aliasOf = aliasOf.toLowerCase();
    this.name = name.toLowerCase();
    this.descriptor = {
      get: getter ?? (() => mz3d.attributes[this.aliasOf]),
      set: setter ?? ((v) => mz3d.attributes[this.aliasOf] = v),
      set: (v) => mz3d.attributes[this.aliasOf] = setter ? setter(v) : v };

    Object.defineProperty(mz3d.attributes, this.name, this.descriptor);
  }}

mz3d.Attribute.Alias = AttributeAlias;
mz3d.Attribute.Abstract = AbstractAttribute;

/***/ }),

/***/ "./src/blendModes.js":
/***/ (() => {

const mz3d = window.mz3d;

mz3d.blendModes = {
  [PIXI.BLEND_MODES.NORMAL]: BABYLON.Engine.ALPHA_COMBINE,
  [PIXI.BLEND_MODES.ADD]: BABYLON.Engine.ALPHA_ADD,
  [PIXI.BLEND_MODES.MULTIPLY]: BABYLON.Engine.ALPHA_MULTIPLY,
  [PIXI.BLEND_MODES.SCREEN]: BABYLON.Engine.ALPHA_SCREENMODE,

  NORMAL: BABYLON.Engine.ALPHA_COMBINE,
  ADD: BABYLON.Engine.ALPHA_ADD,
  MULTIPLY: BABYLON.Engine.ALPHA_MULTIPLY,
  SCREEN: BABYLON.Engine.ALPHA_SCREENMODE };

/***/ }),

/***/ "./src/blenders.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "j$": () => (/* binding */ Blender),
/* harmony export */   "sO": () => (/* binding */ ColorBlender)
/* harmony export */ });
/* unused harmony export EasingFunctions */
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/util.js");
/* harmony import */ var _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/index.js");
/* harmony import */ var _mod_babylon_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/mod_babylon.js");
/* harmony import */ var _main_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/main.js");







const raycastPredicate = (mesh) => {
  if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable || mesh.character) {return false;}
  return true;
};

Object.assign(_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {

  cameraTargets: [],
  getCameraTarget() {
    return this.cameraTargets[0];
  },
  setCameraTarget(char, time) {
    if (!char) {this.cameraTargets.length = 0;return;}
    this.cameraTargets.unshift(char);
    if (this.cameraTargets.length > 2) {this.cameraTargets.length = 2;}
    this.saveData('cameraTarget', this.getTargetString(char));
    this.blendCameraTransition.value = 1;
    this.blendCameraTransition.setValue(0, time);
  },
  clearCameraTarget() {
    this.cameraTargets.length = 0;
  },
  resetCameraTarget() {
    this.clearCameraTarget();
    this.setCameraTarget($gamePlayer, 0);
  },
  rememberCameraTarget() {
    const target = this.loadData('cameraTarget');
    if (target) {
      this.setCameraTarget(this.targetChar(target), 0);
    }
  },

  cameraTrack: null,
  cameraTrackTime: 0,
  cameraTrackMode: 0,
  setCameraTrack(target, time = 0, mode = 3) {
    if (!target) {this.cameraTrack = null;return;}
    this.cameraTrack = target;
    this.cameraTrackTime = time;
    this.cameraTrackMode = mode;
  },

  setupBlenders() {
    this.blendFogColor = new ColorBlender('fogColor', this.FOG_COLOR);
    this.blendFogNear = new Blender('fogNear', this.FOG_NEAR);
    this.blendFogFar = new Blender('fogFar', this.FOG_FAR);
    this.blendCameraRoll = new Blender('cameraRoll', 0);
    this.blendCameraRoll.cycle = 360;
    this.blendCameraYaw = new Blender('cameraYaw', 0);
    this.blendCameraYaw.cycle = 360;
    this.blendCameraPitch = new Blender('cameraPitch', 60);
    this.blendCameraPitch.min = 0;
    this.blendCameraPitch.max = 180;
    this.blendCameraDist = new Blender('cameraDist', this.getDistForFov());
    this.blendCameraZoom = new Blender('cameraZoom', 1);
    this.blendCameraDist.min = 0;
    this.blendCameraHeight = new Blender('cameraHeight', 0.7);
    this.blendAmbientColor = new ColorBlender('ambientColor', this.AMBIENT_COLOR);
    this.blendPanX = new Blender('panX', 0);
    this.blendPanY = new Blender('panY', 0);
    this.blendCameraTransition = new Blender('cameraTransition', 0);
    this.blendResolutionScale = new Blender('resolutionScale', _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].RES_SCALE */ .Z.RES_SCALE);
  },

  updateBlenders(reorient) {
    if (!_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].is3D */ .Z.is3D()) {
      return;
    }


    // camera target & pan
    if (!this.cameraTargets.length) {
      if ($gamePlayer) {
        this.cameraTargets[0] = $gamePlayer;
      }
    }

    // camera tracking
    if (this.cameraTrack && this.cameraTrack !== this.cameraTargets[0]) {
      // TODO: fix for looping maps
      if (this.cameraTrackMode & 1) {
        const yaw = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.radtodeg)(Math.atan2(-(this.cameraTrack._realY - this.cameraStick.y), this.cameraTrack._realX - this.cameraStick.x)) - 90;
        if (this.blendCameraYaw.targetValue() !== yaw) {this.blendCameraYaw.setValue(yaw, this.cameraTrackTime);}
      }
      if (this.cameraTrackMode & 2) {
        const dist = _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector2.Distance(new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector2(this.cameraTrack._realX, this.cameraTrack._realY), new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector2(this.cameraStick.absolutePosition.x, -this.cameraStick.absolutePosition.z));
        const zdist = this.cameraTrack.z - this.cameraStick.absolutePosition.y;
        const pitch = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.radtodeg)(Math.atan(zdist / dist)) + 90;
        if (this.blendCameraPitch.targetValue() !== pitch && isFinite(pitch)) {this.blendCameraPitch.setValue(pitch, this.cameraTrackTime);}
      }
    }

    // camera following
    /*
    if(mv3d.getCameraTarget()===$gamePlayer && $gamePlayer._vehicleGettingOn){
    	mv3d.setCameraTarget($gamePlayer.vehicle(),0.5);
    }else if(mv3d.getCameraTarget()===$gamePlayer.vehicle() && $gamePlayer._vehicleGettingOff){
    	mv3d.setCameraTarget($gamePlayer,0.5);
    }
    */
    if (this.blendCameraTransition.update() && this.cameraTargets.length >= 2) {
      const t = this.blendCameraTransition.currentValue();
      let char1 = this.cameraTargets[0];
      //if(char1===$gamePlayer&&$gamePlayer.isInVehicle()){ char1=$gamePlayer.vehicle(); }
      let char2 = this.cameraTargets[1];
      //if(char2===$gamePlayer&&$gamePlayer.isInVehicle()){ char2=$gamePlayer.vehicle(); }
      if (char1.mv3d_sprite && char2.mv3d_sprite && char1.mv3d_sprite.isEnabled() && char2.mv3d_sprite.isEnabled()) {
        let pos1, pos2;
        if (this.is1stPerson(true)) {
          char1.mv3d_sprite._isDirty = true;
          char2.mv3d_sprite._isDirty = true;
          pos1 = char1.mv3d_sprite.getAbsolutePosition();
          pos2 = char2.mv3d_sprite.getAbsolutePosition();
        } else {
          char1.mv3d_sprite.spriteOrigin._isDirty = true;
          char2.mv3d_sprite.spriteOrigin._isDirty = true;
          pos1 = char1.mv3d_sprite.spriteOrigin.getAbsolutePosition();
          pos2 = char2.mv3d_sprite.spriteOrigin.getAbsolutePosition();
        }
        this.cameraStick.position.x = pos1.x * (1 - t) + pos2.x * t;
        this.cameraStick.position.y = pos1.y * (1 - t) + pos2.y * t;
        this.cameraStick.position.z = pos1.z * (1 - t) + pos2.z * t;
      } else {
        this.cameraStick.x = char1._realX * (1 - t) + char2._realX * t;
        this.cameraStick.y = char1._realY * (1 - t) + char2._realY * t;
        this.cameraStick.z = (char1.z || 0) * (1 - t) + (char2.z || 0) * t;
        //if(char1.mv3d_sprite){
        //	this.cameraStick.z=char1.mv3d_sprite.z;
        //}
      }
    } else if (this.cameraTargets.length) {
      let char = this.getCameraTarget();
      //if(char===$gamePlayer&&$gamePlayer.isInVehicle()){ char=$gamePlayer.vehicle(); }

      if (char.mv3d_sprite && char.mv3d_sprite.isEnabled()) {
        let pos;
        if (this.is1stPerson(true)) {
          pos = char.mv3d_sprite.getAbsolutePosition();
        } else {
          pos = char.mv3d_sprite.spriteOrigin.getAbsolutePosition();
        }
        this.cameraStick.position.copyFrom(pos);
      } else {
        this.cameraStick.x = char._realX;
        this.cameraStick.y = char._realY;
        this.cameraStick.z = char.z || 0;

      }

    }
    this.blendPanX.update();
    this.blendPanY.update();
    this.cameraStick.x += this.blendPanX.currentValue();
    this.cameraStick.y += this.blendPanY.currentValue();
    this.cameraStick.z += this.blendCameraHeight.currentValue();
    //this.cameraStick.markAsDirty();
    //this.cameraStick.computeWorldMatrix(true);

    if (this.cameraMode === '2D' && this.blendCameraPitch.targetValue() !== 45) {
      this.blendCameraPitch.setValue(45);
    }

    _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"]._cameraUpdated */ .Z._cameraUpdated = false;
    // camera yaw, pitch, dist & height
    if (reorient || this.blendCameraPitch.update() | this.blendCameraYaw.update() | this.blendCameraRoll.update() |
    this.blendCameraDist.update() | this.blendCameraHeight.update() | this.blendCameraZoom.update() ||
    $gameScreen._shake !== 0 ||
    _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].cameraCollision.type */ .Z.cameraCollision.type && $gamePlayer.mv3d_temp._positionUpdated ||
    this.cameraCollision.smooth && this.camera.dist !== this.camera._target_dist) {
      _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"]._cameraUpdated */ .Z._cameraUpdated = true;
      //this.cameraStick.pitch = this.cameraMode==='2D'?-45:this.blendCameraPitch.currentValue()-90;
      this.cameraStick.pitch = this.blendCameraPitch.currentValue() - 90;
      this.cameraStick.yaw = this.blendCameraYaw.currentValue();
      this.cameraStick.roll = this.blendCameraRoll.currentValue();
      this.cameraNode.position.set(0, 0, 0);
      let dist = this.blendCameraDist.currentValue();
      if (_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].cameraCollision.type */ .Z.cameraCollision.type && this.camera.mode !== _mod_babylon_js__WEBPACK_IMPORTED_MODULE_2__/* .ORTHOGRAPHIC_CAMERA */ ._P) {
        let doCollide = true;
        if (_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].cameraCollision.type */ .Z.cameraCollision.type > 1) {
          this.cameraNode.position.z = -dist;
          //this.cameraNode.translate(ZAxis,-dist,LOCALSPACE);
          const gpos = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].globalPosition */ .Z.globalPosition(this.cameraNode);
          //this.cameraNode.position.set(0,0,0);
          const z = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].getWalkHeight */ .Z.getWalkHeight(gpos.x, -gpos.z);
          if (gpos.y > z) {doCollide = false;}
        }
        if (doCollide) {
          const raycastOrigin = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector3().copyFrom(this.cameraStick.position);
          //raycastOrigin.y+=this.blendCameraHeight.currentValue()+0.1;
          raycastOrigin.y += 0.1;
          const ray = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Ray(raycastOrigin, _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformCoordinates(_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].camera.getTarget */ .Z.camera.getTarget().negate(), _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].getRotationMatrix */ .Z.getRotationMatrix(_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].camera */ .Z.camera)), dist);
          const intersections = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].scene.multiPickWithRay */ .Z.scene.multiPickWithRay(ray, raycastPredicate);
          for (const intersection of intersections) {
            if (!intersection.hit) {continue;}
            let material = intersection.pickedMesh.material;if (!material) {continue;}
            if (material.subMaterials) {
              material = material.subMaterials[intersection.pickedMesh.subMeshes[intersection.subMeshId].materialIndex];
            }
            if (material.mv3d_through) {continue;}
            dist = intersection.distance;
            break;
          }
        }
      }
      if (this.cameraCollision.smooth) {
        if (this.camera.dist == null) {this.camera.dist = dist;}
        this.camera._target_dist = dist;
        this.camera.dist = this.camera.dist + (dist - this.camera.dist) / 2;
        dist = this.camera.dist;
      } else {
        this.camera.dist = this.camera._target_dist = dist;
      }
      //this.cameraNode.translate(ZAxis,-dist,LOCALSPACE);
      this.cameraNode.position.z = -dist;
      this.cameraNode.pitch = -this.cameraStick.pitch;
      this.camera.pitch = this.cameraStick.pitch;
      if (this.camera.mode === _mod_babylon_js__WEBPACK_IMPORTED_MODULE_2__/* .ORTHOGRAPHIC_CAMERA */ ._P) {
        const fieldSize = this.getFieldSize();
        this.camera.orthoLeft = -fieldSize.width / 2;
        this.camera.orthoRight = fieldSize.width / 2;
        this.camera.orthoTop = fieldSize.height / 2;
        this.camera.orthoBottom = -fieldSize.height / 2;
      } else {
        // TODO: allow camera to view from low angles
        if (this.cameraNode.z < 0) {this.cameraNode.z = 0;}
      }
      if (this.cameraMode === '2D') {
        //this.cameraNode.scaling.z=Math.abs(Math.sin(this.cameraNode.rotation.x)) * 1/Math.max(.01,Math.min(45,mv3d.blendCameraPitch.currentValue())/45);
        //this.cameraNode.scaling.y=Math.abs(Math.cos(this.cameraNode.rotation.x)) * 1/Math.max(.01,Math.min(45,90-mv3d.blendCameraPitch.currentValue())/45);
        this.cameraNode.scaling.z = Math.abs(Math.sin(this.cameraNode.rotation.x));
        this.cameraNode.scaling.y = Math.abs(Math.cos(this.cameraNode.rotation.x));
      } else {
        this.cameraNode.scaling.set(1, 1, 1);
      }
      //this.cameraNode.z += this.blendCameraHeight.currentValue();
      this.cameraNode.translate(_util_js__WEBPACK_IMPORTED_MODULE_0__.XAxis, -$gameScreen._shake / 48, _mod_babylon_js__WEBPACK_IMPORTED_MODULE_2__/* .LOCALSPACE */ .vf);
      this.updateDirection();
      this.updateFov();

      if (_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].DYNAMIC_NORMALS */ .Z.DYNAMIC_NORMALS && (reorient || this.blendCameraPitch.updated || this.blendSunColor && this.blendSunColor.updated)) {
        this.updateDynamicNormals();
      }

    }

    //fog
    if (reorient || this.blendFogColor.update() | this.blendFogNear.update() | this.blendFogFar.update()) {
      if (_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].hasAlphaFog */ .Z.hasAlphaFog) {
        this.scene.fogStart = this.blendFogNear.currentValue();
        this.scene.fogEnd = this.blendFogFar.currentValue();
      } else {
        this.scene.fogStart = Math.min(_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].RENDER_DIST */ .Z.RENDER_DIST - 1, this.blendFogNear.currentValue());
        this.scene.fogEnd = Math.min(_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].RENDER_DIST */ .Z.RENDER_DIST, this.blendFogFar.currentValue());
      }
      this.scene.fogColor.copyFromFloats(
      this.blendFogColor.r.currentValue() / 255,
      this.blendFogColor.g.currentValue() / 255,
      this.blendFogColor.b.currentValue() / 255);

      _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].updateClearColor */ .Z.updateClearColor();
      _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].updateRenderDist */ .Z.updateRenderDist();
    }

    //light
    if (reorient || this.blendAmbientColor.update()) {
      this.scene.ambientColor.copyFromFloats(
      this.blendAmbientColor.r.currentValue() / 255,
      this.blendAmbientColor.g.currentValue() / 255,
      this.blendAmbientColor.b.currentValue() / 255);

    }

    // res scale
    if (reorient || this.blendResolutionScale.update()) {
      const resScale = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.minmax)(0, 1, this.blendResolutionScale.currentValue());
      _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].RES_SCALE */ .Z.RES_SCALE = resScale;
      if (resScale < 1) {
        _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].pixiSprite.scale.set */ .Z.pixiSprite.scale.set(
        1 / ((Graphics.width * resScale - 1) / Graphics.width),
        1 / ((Graphics.height * resScale - 1) / Graphics.height));
      } else {
        _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].pixiSprite.scale.set */ .Z.pixiSprite.scale.set(1, 1);
      }
      _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].updateCanvas */ .Z.updateCanvas();
    }

    if (!reorient && _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders */ .Z.$saveData.tempBlenders) for (let i = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders.length */ .Z.$saveData.tempBlenders.length - 1; i >= 0; --i) {
      const tempBlender = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders */ .Z.$saveData.tempBlenders[i];
      //++tempBlender.elapsed;
      tempBlender.elapsed += _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].deltaTime */ .Z.deltaTime;
      const value = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.interpolateValue)(tempBlender.startValue, tempBlender.endValue, tempBlender.elapsed / tempBlender.duration);

      if (tempBlender.applyTo) {var _tempBlender$callback;
        let target = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z;
        let i = 0;
        for (; i < tempBlender.applyTo.length - 1; ++i) {
          target = target[tempBlender.applyTo[i]];
          //console.log(tempBlender.applyTo[i],target);
        }
        target[tempBlender.applyTo[i]] = value;
        (_tempBlender$callback = tempBlender.callback) === null || _tempBlender$callback === void 0 ? void 0 : _tempBlender$callback.call(tempBlender);
      }if (tempBlender.attribute) {
        _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].attributes */ .Z.attributes[tempBlender.attribute] = value;
      } else if (tempBlender.target) {var _target$mv3d_sprite;
        const target = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].targetChar */ .Z.targetChar(tempBlender.target);
        (_target$mv3d_sprite = target.mv3d_sprite) === null || _target$mv3d_sprite === void 0 ? void 0 : _target$mv3d_sprite.blendConfigure(value);
      }
      if (tempBlender.elapsed >= tempBlender.duration) {
        _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders.splice */ .Z.$saveData.tempBlenders.splice(i, 1);
      }
    }

    this.callFeatures('blend', reorient);
  },

  updateClearColor() {
    if (_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].hasBackground */ .Z.hasBackground) {
      if (_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].hasAlphaPostProcess */ .Z.hasAlphaPostProcess) {
        _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].scene.clearColor.set */ .Z.scene.clearColor.set(..._main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].blendFogColor.currentComponents */ .Z.blendFogColor.currentComponents(), 0);
      } else {
        _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].scene.clearColor.set */ .Z.scene.clearColor.set(0, 0, 0, 0);
      }
    } else {
      _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].scene.clearColor.set */ .Z.scene.clearColor.set(..._main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].blendFogColor.currentComponents */ .Z.blendFogColor.currentComponents(), 1);
    }
  },

  blendAttribute(attribute, newValue, time = 1) {
    attribute = String(attribute).toLowerCase();
    //const duration = Math.max(1,Math.floor(time*60));
    const duration = Math.max(0.0001, time);
    _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders */ .Z.$saveData.tempBlenders ??= [];

    for (let i = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders.length */ .Z.$saveData.tempBlenders.length - 1; i >= 0; --i) {
      const tempBlender = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders */ .Z.$saveData.tempBlenders[i];
      if (tempBlender.attribute !== attribute) {continue;}
      _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders.splice */ .Z.$saveData.tempBlenders.splice(i, 1);
    }

    _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders.push */ .Z.$saveData.tempBlenders.push({
      attribute, duration, elapsed: 0,
      startValue: _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].attributes */ .Z.attributes[attribute],
      endValue: _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].Attribute.instances */ .Z.Attribute.instances[attribute].reader(newValue) });

  },

  createTempBlender(applyTo, startValue, endValue, duration, callback) {

    if (typeof startValue === 'string' && !isNaN(startValue)) startValue = Number(startValue);
    if (typeof endValue === 'string' && !isNaN(endValue)) endValue = Number(endValue);

    _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders */ .Z.$saveData.tempBlenders ??= [];

    removeBlenders: for (let i = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders.length */ .Z.$saveData.tempBlenders.length - 1; i >= 0; --i) {
      const tempBlender = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders */ .Z.$saveData.tempBlenders[i];
      if (!tempBlender.applyTo) continue;
      compareBlenders: for (let j = 0; j < Math.max(tempBlender.applyTo.length, applyTo.length); ++j) {
        if (tempBlender.applyTo[j] != applyTo[j]) continue removeBlenders;
        _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders.splice */ .Z.$saveData.tempBlenders.splice(i, 1);
      }
    }

    _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData.tempBlenders.push */ .Z.$saveData.tempBlenders.push({
      //applyTo,duration:duration*60,elapsed:0,
      applyTo, duration: duration, elapsed: 0,
      startValue: startValue,
      endValue: endValue,
      callback });

  } });



const _changeParallax = Game_Map.prototype.changeParallax;
Game_Map.prototype.changeParallax = function () {
  _changeParallax.apply(this, arguments);
  _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].updateClearColor */ .Z.updateClearColor();
};


class Blender {
  constructor(key, dfault, track = true) {
    this.key = key;
    this.dfault = _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].loadData */ .Z.loadData(key, dfault);
    this.value = dfault;
    this.startValue = this.value;
    this.duration = 0;
    this.time = 0;
    //this.speed=1;
    this.max = Infinity;
    this.min = -Infinity;
    this.cycle = false;
    this.easing = EasingFunctions.linear;
    if (track) {
      Blender.list.push(this);
    }
  }
  inputValue(increment, time = 0, normalize = true) {
    this.setValue((this._wasInputValue ? this.targetValue() : this.currentValue()) + increment, time, normalize);
    this._wasInputValue = true;
  }
  setValue(target, time = 0, normalize = true) {
    delete this._wasInputValue;
    target = Math.min(this.max, Math.max(this.min, target));
    this.duration = time;
    this.time = 0;
    let diff = target - this.value;
    if (this.cycle) {
      while (target > this.cycle) {target -= this.cycle;}
      while (target < -this.cycle) {target += this.cycle;}
      this.value = target - diff;
    }
    this.saveValue(this.key, target);
    if (!time) {this.instantChanged = true;this.value = target;} else
    if (time < 0) {time = -time;}
    if (normalize && this.cycle) {
      while (Math.abs(diff) > this.cycle / 2) {
        this.value += Math.sign(diff) * this.cycle;
        diff = target - this.value;
      }
    }
    this.startValue = this.value;
    //this.speed = Math.abs(diff)/time;
  }
  currentValue() {return this.value;}
  targetValue() {return this.loadValue(this.key);}
  defaultValue() {return this.dfault;}
  update() {
    if (this.time >= this.duration) {
      this.updatedFinal = this.updated;
      if (this.instantChanged) {
        this.updated = true;
        delete this.instantChanged;
        return true;
      } else {
        this.updated = false;
        return false;
      }
    }
    const target = this.targetValue();
    /*
    const diff = target - this.value;
    if(isNaN(this.speed)){ this.speed=Infinity; }
    const speed = this.speed * mv3d.deltaTime;
    if(speed > Math.abs(diff)){
    	this.value=target;
    }else{
    	this.value+=speed*Math.sign(diff);
    }
    */
    this.time += _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].deltaTime */ .Z.deltaTime;
    const t = this.easing(Math.clamp(this.time / this.duration, 0, 1));
    this.value = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.lerp)(this.startValue, target, t);
    this.updated = true;
    this.updatedFinal = false;
    return true;
  }
  storageLocation() {
    if (!$gameVariables) {
      console.warn(`MV3D: Couldn't get Blend storage location.`);
      return {};
    }
    return _main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].$saveData */ .Z.$saveData;
  }
  loadValue(key) {
    const storage = this.storageLocation();
    if (!(key in storage)) {return this.dfault;}
    return storage[key];
  }
  saveValue(key, value) {
    const storage = this.storageLocation();
    storage[key] = value;
  }
  static reset() {
    for (const blender of Blender.list) {
      //blender.speed=Infinity;
      blender.value = blender.targetValue();
    }
  }}

Blender.list = [];

const EasingFunctions = {
  linear: (t) => t,
  easeIn: (t, y = 2) => Math.pow(t, y),
  easeOut: (t, y = 2) => 1 - Math.pow(1 - t, y),
  easeInOut: (t, y = 2) => (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.lerp)(EasingFunctions.easeIn(t, y), EasingFunctions.easeOut(t, y), t) };


_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].EasingFunctions */ .Z.EasingFunctions = EasingFunctions;

class ColorBlender {
  constructor(key, dfault, track = true) {
    this.dfault = dfault;
    this.r = new Blender(`${key}_r`, dfault >> 16, track);
    this.g = new Blender(`${key}_g`, dfault >> 8 & 0xff, track);
    this.b = new Blender(`${key}_b`, dfault & 0xff, track);
  }
  get updated() {
    return this.r.updated || this.g.updated || this.b.updated;
  }
  setValue(color, time) {
    this.r.setValue(color >> 16, time);
    this.g.setValue(color >> 8 & 0xff, time);
    this.b.setValue(color & 0xff, time);
  }
  averageCurrentValue() {
    return (this.r.value + this.g.value + this.b.value) / 3 | 0;
  }
  averageTargetValue() {
    return (this.r.targetValue() + this.g.targetValue() + this.b.targetValue()) / 3 | 0;
  }
  currentValue() {
    return this.r.value << 16 | this.g.value << 8 | this.b.value;
  }
  targetValue() {
    return this.r.targetValue() << 16 | this.g.targetValue() << 8 | this.b.targetValue();
  }
  defaultValue() {return this.dfault;}
  update() {
    let ret = 0;
    ret |= this.r.update();
    ret |= this.g.update();
    ret |= this.b.update();
    return Boolean(ret);
  }
  get storageLocation() {return this.r.storageLocation;}
  set storageLocation(v) {
    this.r.storageLocation = v;
    this.g.storageLocation = v;
    this.b.storageLocation = v;
  }
  currentComponents() {
    return [this.r.currentValue() / 255, this.g.currentValue() / 255, this.b.currentValue() / 255];
  }
  targetComponents() {
    return [this.r.targetValue() / 255, this.g.targetValue() / 255, this.b.targetValue() / 255];
  }}


_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].Blender */ .Z.Blender = Blender;
_main_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"].ColorBlender */ .Z.ColorBlender = ColorBlender;

/***/ }),

/***/ "./src/characters.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "z": () => (/* binding */ Character)
/* harmony export */ });
/* unused harmony export Action */
/* harmony import */ var _main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/main.js");
/* harmony import */ var _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/index.js");
/* harmony import */ var _mod_babylon_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/mod_babylon.js");
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/util.js");
/* harmony import */ var _blenders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./src/blenders.js");
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./src/model.js");







const { BILLBOARDMODE_X, BILLBOARDMODE_Y, BILLBOARDMODE_Z, BILLBOARDMODE_ALL, BILLBOARDMODE_NONE } = BABYLON.Mesh;

Object.assign(_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z, {
  createCharacters() {
    const events = $gameMap.events();
    for (const event of events) {
      this.createCharacterFor(event, 0);
    }
    const vehicles = $gameMap.vehicles();
    for (const vehicle of vehicles) {
      this.createCharacterFor(vehicle, 1);
    }
    const followers = $gamePlayer.followers()._data;
    for (let f = followers.length - 1; f >= 0; --f) {
      this.createCharacterFor(followers[f], 29 - f);
    }
    this.createCharacterFor($gamePlayer, 30);
  },

  createCharacterFor(char, order) {
    if (!char.mv3d_sprite || char.mv3d_sprite.isDisposed()) {
      const sprite = new Character(char, order);
      //delete char.mv3d_sprite;
      Object.defineProperty(char, 'mv3d_sprite', {
        value: sprite,
        enumerable: false,
        configurable: true });

      this.characters.push(sprite);
      return sprite;
    }
    return char.mv3d_sprite;
  },

  updateCharacters() {
    for (let i = this.characters.length - 1; i >= 0; --i) {
      this.characters[i].update();
    }
  },

  beforeRenderCharacters() {
    for (let i = this.characters.length - 1; i >= 0; --i) {
      this.characters[i].beforeRender();
    }
  },

  updateDynamicNormals() {
    if (!_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].DYNAMIC_NORMALS */ .Z.DYNAMIC_NORMALS) {return;}
    if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].cameraMode */ .Z.cameraMode === '2D') {
      this.Meshes.SPRITE.updateVerticesData(BABYLON.VertexBuffer.NormalKind, [0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0]);
    } else {
      if (!this.blendSunColor) {return;}
      const pitch = this.blendSunColor.averageCurrentValue() < 128 ? this.blendSunColor.averageCurrentValue() / 128 * this.blendCameraPitch.currentValue() : this.blendCameraPitch.currentValue();
      const y = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.sin)((0,_util_js__WEBPACK_IMPORTED_MODULE_3__.degtorad)(pitch));
      const z = -(0,_util_js__WEBPACK_IMPORTED_MODULE_3__.cos)((0,_util_js__WEBPACK_IMPORTED_MODULE_3__.degtorad)(pitch));
      this.Meshes.SPRITE.updateVerticesData(BABYLON.VertexBuffer.NormalKind, [0, y, z, 0, y, z, 0, y, z, 0, y, z]);
    }
  },

  setupSpriteMeshes() {
    const meshes = this.Meshes = {};

    const vdata = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.VertexData();
    vdata.indices = [1, 0, 2, 1, 2, 3];
    vdata.uvs = [0, 1, 1, 1, 0, 0, 1, 0];
    const normals_up = [0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0];
    const normals_front = [0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1];

    vdata.positions = [-0.5, 0.5, 0, 0.5, 0.5, 0, -0.5, -0.5, 0, 0.5, -0.5, 0];
    vdata.normals = normals_front;
    meshes.BASIC = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Mesh('basic mesh', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    vdata.applyToMesh(meshes.BASIC, false);

    vdata.positions = [-0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0, -0.5, 0.5, 0, -0.5];
    vdata.normals = normals_up;
    meshes.FLAT = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Mesh('flat mesh', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    vdata.applyToMesh(meshes.FLAT, false);

    vdata.positions = [-0.5, 1, 0, 0.5, 1, 0, -0.5, 0, 0, 0.5, 0, 0];
    vdata.normals = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].DYNAMIC_NORMALS */ .Z.DYNAMIC_NORMALS ? normals_up : normals_front;
    meshes.SPRITE = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Mesh('sprite mesh', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    vdata.applyToMesh(meshes.SPRITE, true);
    meshes.BOARD = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Mesh('board mesh', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    vdata.applyToMesh(meshes.BOARD, false);
    meshes.SPRITE.billboardMode = BILLBOARDMODE_X | BILLBOARDMODE_Y;
    meshes.BOARD.billboardMode = BILLBOARDMODE_Y;

    vdata.normals = normals_front;
    meshes.WALL = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Mesh('wall mesh', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    vdata.applyToMesh(meshes.WALL, false);

    vdata.normals = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].ABNORMAL */ .Z.ABNORMAL ? normals_up : normals_front;
    meshes.TEMP_CROSS = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Mesh('cross mesh', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    vdata.applyToMesh(meshes.TEMP_CROSS, false);
    meshes.CROSS = _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Mesh.MergeMeshes([
    meshes.TEMP_CROSS.clone(),
    meshes.TEMP_CROSS.clone().rotate(_util_js__WEBPACK_IMPORTED_MODULE_3__.YAxis, Math.PI / 2, _mod_babylon_js__WEBPACK_IMPORTED_MODULE_2__/* .WORLDSPACE */ .i_)]);

    meshes['8CROSS'] = _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Mesh.MergeMeshes([
    meshes.CROSS.clone(),
    meshes.CROSS.clone().rotate(_util_js__WEBPACK_IMPORTED_MODULE_3__.YAxis, Math.PI / 4, _mod_babylon_js__WEBPACK_IMPORTED_MODULE_2__/* .WORLDSPACE */ .i_)]);


    for (const key in meshes) {
      meshes[key].renderingGroupId = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumRenderGroups.MAIN */ .Z.enumRenderGroups.MAIN;
      _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene.removeMesh */ .Z.scene.removeMesh(meshes[key]);
      if (key.startsWith('TEMP_')) {
        meshes[key].dispose();
        delete meshes[key];
      }
    }
  },

  async getShadowMaterial() {
    if (this._shadowMaterial) {return this._shadowMaterial;}
    const shadowTexture = await _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].createTexture */ .Z.createTexture(`${_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].MV3D_FOLDER */ .Z.MV3D_FOLDER}/${_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TEXTURE_SHADOW */ .Z.TEXTURE_SHADOW}.png`);
    const shadowMaterial = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.StandardMaterial('shadow material', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    this._shadowMaterial = shadowMaterial;
    shadowMaterial.diffuseTexture = shadowTexture;
    shadowMaterial.opacityTexture = shadowTexture;
    shadowMaterial.alphaCutOff = 0;
    shadowMaterial.specularColor.set(0, 0, 0);
    shadowMaterial.dispose = () => {};
    return shadowMaterial;
  },
  async getShadowMesh() {
    let shadowMesh;
    while (this.getShadowMesh.getting) {await (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.sleep)(100);}
    if (this._shadowMesh) {shadowMesh = this._shadowMesh;} else
    {
      this.getShadowMesh.getting = true;
      shadowMesh = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].Meshes.FLAT.clone */ .Z.Meshes.FLAT.clone('shadow mesh');
      shadowMesh.material = await this.getShadowMaterial();
      this._shadowMesh = shadowMesh;
      _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene.removeMesh */ .Z.scene.removeMesh(shadowMesh);
      this.getShadowMesh.getting = false;
    }
    const shadowClone = shadowMesh.clone();
    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].callFeature */ .Z.callFeature('highlight', 'excludeHighlightMesh', shadowClone);
    return shadowClone;
  },

  ACTOR_SETTINGS: [] });


const z_descriptor = {
  configurable: true,
  enumerable: false,
  get() {return this.mv3d_data.z;},
  set(v) {
    this.mv3d_data.z = v;
    if (this.mv3d_sprite) {this.mv3d_sprite.position.y = v;}
  } };

const z_descriptor2 = {
  configurable: true,
  enumerable: false,
  get() {return this.char.mv3d_data.z;},
  set(v) {
    this.char.mv3d_data.z = v;
    this.position.y = v;
  } };


class Character extends _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.TransformNode {
  constructor(char, order) {
    super('character', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    this.spriteOrigin = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.TransformNode('sprite origin', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    this.spriteOrigin.parent = this;
    this.model = new _model_js__WEBPACK_IMPORTED_MODULE_5__/* .Model */ .Hn({ orphan: false });
    this.model.parent = this.spriteOrigin;
    this.model.order = order;
    this.model.character = this;

    //this.order=order;
    //this.mesh.order=this.order;
    //this.mesh.character=this;

    this._character = this.char = char;
    this.charName = '';
    this.charIndex = 0;

    if (this.char.mv_sprite) {
      this.char.mv_sprite.updateBitmap();
    }

    this.char.mv3d_data.blenders ??= this.char.mv3d_blenders ?? {};
    this.char.mv3d_data.settings ??= this.char.mv3d_settings ?? {};

    this.isVehicle = this.char instanceof Game_Vehicle;
    this.isBoat = this.isVehicle && this.char.isBoat();
    this.isShip = this.isVehicle && this.char.isShip();
    this.isAirship = this.isVehicle && this.char.isAirship();
    this.isEvent = this.char instanceof Game_Event;
    this.isPlayer = this.char instanceof Game_Player;
    this.isFollower = this.char instanceof Game_Follower;

    if (!('z' in this.char.mv3d_data)) {
      this.char.mv3d_data.z = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getWalkHeight */ .Z.getWalkHeight(this.char.x, this.char.y);
    }
    Object.defineProperty(this.char, 'z', z_descriptor);
    Object.defineProperty(this, 'z', z_descriptor2);
    this.z = this.z;
    this.platformHeight = this.z;
    this.targetElevation = this.z;
    this.prevZ = this.z;
    this.needsPositionUpdate = true;
    this.needsMaterialUpdate = true;
    this.needsScaleUpdate = false;
    //this.elevation = 0;

    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getShadowMesh */ .Z.getShadowMesh().then((shadow) => {
      this.shadow = shadow;
      this.shadow.parent = this;
    });

    this.blendElevation = this.makeBlender('elevation', 0);

    this.lightOrigin = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.TransformNode('light origin', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    this.lightOrigin.parent = this;
    this.setupLights();

    this.updatePosition();

    if (this.isEvent) {
      this.eventConfigure();
    } else {
      this.initialConfigure();
      this.needsMaterialUpdate = true;
    }

    this.updateCharacter();
    this.updateShape();

    this.intensiveUpdate();

    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].callFeatures */ .Z.callFeatures('createCharacter', this);
  }

  //===========================
  //  Texture & Model
  //===========================

  async setMaterial(src) {
    await this.model.setMaterial(src);
    this.updateScale();
    this.needsMaterialUpdate = true;
  }

  get settings() {return this.char.mv3d_data.settings;}
  get blenders() {return this.char.mv3d_data.blenders;}
  get data() {return this.char.mv3d_data;}

  get currentAction() {return this.data.currentAction;}
  set currentAction(v) {this.data.currentAction = v;}
  get playingActions() {return this.data.playingActions;}
  set playingActions(v) {this.data.playingActions = v;}

  isBitmapReady() {
    return Boolean(this.mv_sprite && this.bitmap && this.bitmap.isReady() && !this._waitingForBitmap);
  }

  isTextureReady() {
    const texture = this.model.texture;
    return Boolean(
    texture && texture.isReady() && this.isBitmapReady());

  }

  get mv_sprite() {
    return this.char.mv_sprite;
  }
  get bitmap() {
    return this.mv_sprite.bitmap;
  }
  get shape() {
    return this.model.shape;
  }
  get tileId() {
    return this.getConfig('texture_id', this._tileId);
  }

  setTileMaterial(tileId) {
    const textureSrc = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getTsImgUrl */ .Z.getTsImgUrl(_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getSetName */ .Z.getSetName(tileId));
    this.setMaterial(textureSrc);
  }
  async setRectMaterial(img, rect) {
    const textureSrc = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getTsImgUrl */ .Z.getTsImgUrl(img);
    await this.setMaterial(textureSrc);
    this.dontCrop = true;
    const { width, height } = this.model.texture.getBaseSize();
    rect = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].finalizeTextureRect */ .Z.finalizeTextureRect(rect, width, height);
    this.textureRect = rect;
    this.model.cropTexture(rect.x, rect.y, rect.width, rect.height);
    this.updateScale();
  }

  async waitBitmapLoaded() {
    if (!this.char.mv_sprite) {
      await (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.sleep)();
      if (!this.char.mv_sprite) {
        console.warn('mv_sprite is undefined');
        return;
      }
    }
    this._waitingForBitmap = true;
    this.char.mv_sprite.updateBitmap();
    await _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].waitBitmapLoaded */ .Z.waitBitmapLoaded(this.char.mv_sprite.bitmap);
    this._waitingForBitmap = false;
  }

  async waitTextureLoaded(texture = this.model.texture) {
    await this.waitBitmapLoaded();
    await _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].waitTextureLoaded */ .Z.waitTextureLoaded(texture);
  }

  isImageChanged() {
    return this._tilesetId !== $gameMap.tilesetId() ||
    this._tileId !== this._character._tileId ||
    this._characterName !== this._character.characterName() ||
    this._characterIndex !== this._character.characterIndex() ||
    this._texture_symbol !== this.getConfig('texture_symbol') ||
    this.isComplex !== this.model.isComplexMesh();

  }
  updateCharacter() {
    //if(!this.isBitmapReady()){ return; }
    this.needsPositionUpdate = true;
    this._tilesetId = $gameMap.tilesetId();
    this._tileId = this._character._tileId;
    this._characterName = this._character.characterName();
    this._characterIndex = this._character.characterIndex();
    this._isBigCharacter = ImageManager.isBigCharacter(this._characterName);
    this._texture_symbol = this.getConfig('texture_symbol');
    this.isEmpty = false;
    this.isComplex = this.model.isComplexMesh();
    this.model.setEnabled(true);
    this.dontCrop = false;
    delete this.textureRect;
    if (this.hasConfig('texture_rect')) {
      this.setRectMaterial(this.getConfig('texture_img', 'B'), this.getConfig('texture_rect'));
    } else if (this.tileId > 0 || this.isComplex) {
      this.setTileMaterial(this.tileId);
    } else if (this._characterName) {
      this.setMaterial(`img/characters/${this._characterName}.png`);
    } else {
      this.isEmpty = true;
      this.model.textureLoaded = false;
      this.model.loaded = false;
      this.model.disposeMaterial();
      this.model.setEnabled(false);
      //this.spriteWidth=1;
      this.spriteHeight = 1;
      this.updateScale();
    }
    this.updateShape();
  }
  setFrame(x, y, w, h) {
    if (!this.isTextureReady() || this.dontCrop) {return;}
    this.model.cropTexture(x, y, w, h);
  }

  async updateScale() {
    if (this.updatingShape) {return;}
    this.needsScaleUpdate = false;
    if (this.isEmpty) {
      //this.spriteWidth=1;
      this.spriteHeight = 1;
      if (this.model.mesh) this.model.scaling.set(1, 1, 1);
      return;
    }
    const configScale = this.getConfig('scale', new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector2(1, 1));
    const hasZ = configScale instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector3;
    const spriteScale = _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector2.One();
    if (!this.isComplex) {
      if (!this.isBitmapReady()) {this.needsScaleUpdate = true;return;}
      this.mv_sprite.updateBitmap();
      if (this.textureRect) {
        var width = this.textureRect.width;
        var height = this.textureRect.height;
      } else {
        var width = this.mv_sprite.patternWidth();
        var height = this.mv_sprite.patternHeight();
      }
      spriteScale.set(width / (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.tileWidth)(), height / (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.tileHeight)());
    }
    //this.spriteWidth = spriteScale.x * configScale.x;
    this.spriteHeight = spriteScale.y * (hasZ ? configScale.z : configScale.y);

    const xscale = spriteScale.x * configScale.x;
    const yscale = spriteScale.y * configScale.y;
    const zscale = this.spriteHeight;
    if (this.model.mesh) {
      if (this.model.shape === _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.SPRITE */ .Z.enumShapes.SPRITE) {
        this.model.scaling.set(1, 1, 1);
        this.model.mesh.scaling.set(xscale, zscale, 1);
      } else if (this.model.shape === _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.FLAT */ .Z.enumShapes.FLAT) {
        this.model.scaling.set(xscale, 1, yscale);
        this.model.mesh.scaling.set(1, 1, 1);
      } else if (this.model.isComplexMesh() && this.model.mesh.mv3d_importedModelData) {
        if (hasZ) {
          this.model.scaling.set(xscale, zscale, yscale);
        } else {
          this.model.scaling.set(xscale, yscale, xscale);
        }
        //const flip = this.getConfig('model_flip');
        const { isObj, isGltf } = this.model.mesh.mv3d_importedModelData;
        if (this.model.mesh.mv3d_needsFlip) {
          if (isObj) {
            this.model.mesh.scaling.set(1, 1, -1);
          } else if (isGltf) {
            this.model.mesh.scaling.set(-1, 1, -1);
          }
        }
      } else {
        if (hasZ) {
          this.model.scaling.set(xscale, zscale, yscale);
        } else {
          this.model.scaling.set(xscale, yscale, xscale);
        }
        this.model.mesh.scaling.set(1, 1, 1);
      }
    }
  }

  getShape() {
    return this.getConfig('shape', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.SPRITE */ .Z.enumShapes.SPRITE);
  }
  async updateShape() {
    this.updatingShape = true;
    const shape = this.getShape();
    if (shape === _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.MODEL */ .Z.enumShapes.MODEL) {
      await this.model.importModel(this.getConfig('model'), {
        flip: this.getConfig('model_flip'),
        alpha: this.getConfig('model_alpha'),
        textures: this.getConfig('model_textures'),
        useInstance: this.useInstance(),
        eventId: this.char._eventId });

    } else if (shape === _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.MESH */ .Z.enumShapes.MESH) {
      await this.model.buildMesh(this.getConfig('meshparts'), this.initialX, this.initialY, 0);
    } else {
      this.model.setMeshForShape(shape);
    }
    this.updateVisibility();
    this.updateConfiguration();
    this.dirtyNearbyCells();
    this.needsMaterialUpdate = true;
    this.updatingShape = false;
    this.model._needsProjectionFix = this.getConfig('projectionfix', this.isGltf);
    if (this.model.mesh) {
      this.updateModelProperties();
    }
  }

  updateModelProperties() {
    if (this.model.mesh.skeletons) {
      this.bones = {};
      for (const skeleton of this.model.mesh.skeletons)
      for (const bone of skeleton.bones) {
        this.bones[bone.name.toLowerCase()] = bone;
      }
      this.boneData = this.getConfig('boneData', {});
    } else {
      delete this.bones;
      delete this.boneData;
    }
    if (this.model.mesh.animationGroups) {
      this.actionData = this.getConfig('actionData', {});
      this.actions = {};
      for (const animationGroup of this.model.mesh.animationGroups) {
        const name = animationGroup.name.toLowerCase().replace(/\.\d+$/, '');
        this.actions[name] ??= new Action();
        const action = this.actions[name];
        action.push(animationGroup);
        //const data = this.actionData[name];
        //if(data&&data.alias)this.actions[data.alias]=action;
      }
      // loop again to ensure aliases can always overwrite actions
      for (const name in this.actions) {
        const action = this.actions[name];
        const data = this.actionData[name];
        if (data && data.alias) this.actions[data.alias] = action;
      }

      if (this.currentAction) {var _this$actions$this$cu;
        (_this$actions$this$cu = this.actions[this.currentAction]) === null || _this$actions$this$cu === void 0 ? void 0 : _this$actions$this$cu.play(true);
      }
      if (this.playingActions) for (const playingAction of this.playingActions) {var _this$actions$playing;
        (_this$actions$playing = this.actions[playingAction.name]) === null || _this$actions$playing === void 0 ? void 0 : _this$actions$playing.play(playingAction.loop);
      }

    } else {
      delete this.actions;
      delete this.actionData;
      delete this.data.currentAction;
      delete this.data.playingActions;
    }
  }

  get isObj() {
    return this.model.isObj;
  }
  get isGltf() {
    return this.model.isGltf;
  }

  useInstance() {
    if (!_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].isComplexShape */ .Z.isComplexShape(this.getShape())) {return false;}
    return this.getConfig('model_instance', !this.hasConfig("glow") && !this.hasConfig('alpha') ? _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].MODEL_OPTIMIZATION */ .Z.MODEL_OPTIMIZATION : _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumModelOptimization.NONE */ .Z.enumModelOptimization.NONE);
  }

  isInstance() {var _this$model$mesh;
    return (_this$model$mesh = this.model.mesh) === null || _this$model$mesh === void 0 ? void 0 : _this$model$mesh.isAnInstance;
  }

  updateEmissive() {
    if (this.isInstance()) {return;}
    const materials = this.model.materials;
    if (!materials.length) {return;}
    const glow = this.getConfig('glow', new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Color4(0, 0, 0, 0));
    if (this.lamp) {
      var lampColor = this.lamp.diffuse;
      var intensity = Math.max(0, Math.min(1, this.lamp.intensity, this.lamp.range, this.lamp.intensity / 4 + this.lamp.range / 4));
    }
    const blendColor = this.mv_sprite._blendColor;
    const blendAlpha = blendColor[3] / 255;
    const noShadow = !this.getConfig('dynShadow', true);
    for (const material of materials) {
      if (material.mv3d_glowColor_extra) {continue;}
      const emissiveColor = material.emissiveColor;
      if (!material._mv3d_orig_emissiveColor) {material._mv3d_orig_emissiveColor = emissiveColor.clone();}
      const orig_emissive = material._mv3d_orig_emissiveColor;
      material.mv3d_glowColor = glow;
      if (this.lamp) {
        emissiveColor.set(
        Math.max(glow.r, lampColor.r * intensity, orig_emissive.r),
        Math.max(glow.g, lampColor.g * intensity, orig_emissive.g),
        Math.max(glow.b, lampColor.b * intensity, orig_emissive.b));

      } else {
        emissiveColor.set(
        Math.max(glow.r, orig_emissive.r),
        Math.max(glow.g, orig_emissive.g),
        Math.max(glow.b, orig_emissive.b));

      }
      emissiveColor.r += (2 - emissiveColor.r) * Math.pow(blendColor[0] / 255 * blendAlpha, 0.5);
      emissiveColor.g += (2 - emissiveColor.g) * Math.pow(blendColor[1] / 255 * blendAlpha, 0.5);
      emissiveColor.b += (2 - emissiveColor.b) * Math.pow(blendColor[2] / 255 * blendAlpha, 0.5);

      if (this.hasConfig('ambient')) {
        material.ambientColor.copyFrom(this.getConfig('ambient'));
      } else {
        material.ambientColor.set(1, 1, 1);
      }

      material.mv3d_noShadow = noShadow;
    }
  }

  setupMesh() {
    if (!this.model.mesh) {return;}
    if (this.isEmpty) {
      this.model.setEnabled(false);
    } else {
      this.model.setEnabled(true);
    }
    if (this.flashlight) {
      this.flashlight.excludedMeshes.splice(0, Infinity);
      this.flashlight.excludedMeshes.push(...this.model.meshes);
    }
    this.updateScale();
    this.model.mesh.character = this;
  }

  //===========================
  //	CONFIGURATION & LIGHTS
  //===========================

  getDefaultConfigObject() {
    if (this.isVehicle) {
      return _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z[`${this.char._type.toUpperCase()}_SETTINGS`].conf;
    }
    if (this.char.isTile()) {
      return _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].EVENT_TILE_SETTINGS */ .Z.EVENT_TILE_SETTINGS;
    } else if (this.isEvent && this.char.isObjectCharacter()) {
      return _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].EVENT_OBJ_SETTINGS */ .Z.EVENT_OBJ_SETTINGS;
    } else {
      return _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].EVENT_CHAR_SETTINGS */ .Z.EVENT_CHAR_SETTINGS;
    }
  }

  getActorConfigObject() {
    const id = $gameParty._actors[this.isFollower ? this.char._memberIndex : 0];
    if (!id) {return {};}
    if (!(id in _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].ACTOR_SETTINGS */ .Z.ACTOR_SETTINGS)) {
      const data = $dataActors[id];
      _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].ACTOR_SETTINGS */ .Z.ACTOR_SETTINGS[id] = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readConfigurationFunctions */ .Z.readConfigurationFunctions(
      _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readConfigurationBlocksAndTags */ .Z.readConfigurationBlocksAndTags(data.note),
      _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].eventConfigurationFunctions */ .Z.eventConfigurationFunctions);

    }
    return _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].ACTOR_SETTINGS */ .Z.ACTOR_SETTINGS[id];
  }

  get initialX() {return this.isEvent ? this.char.event().x : 0;}
  get initialY() {return this.isEvent ? this.char.event().y : 0;}

  getConfig(key, dfault = undefined) {
    let value = this._getConfig(key) ?? dfault;
    //if(value instanceof Vector2 || value instanceof Vector3){
    if (value && typeof value === 'object') {
      for (let key in value) {
        value[key] = this._finalizeConfig(value[key]);
      }
    } else {
      return this._finalizeConfig(value);
    }
    return value;
  }
  _finalizeConfig(value) {
    if (value instanceof _util_js__WEBPACK_IMPORTED_MODULE_3__.MathExpression) {
      const r = this.initialX * 10 + this.initialY * 1000 + (this.char._mapId | 0) * 10000;
      value = value.evaluate({
        ..._util_js__WEBPACK_IMPORTED_MODULE_3__._default_scope,
        x: this.initialX,
        y: this.initialY,
        yaw: this.model.yaw,
        pitch: this.model.pitch,
        roll: this.model.roll,
        rot: this.model.rotNode.yaw,
        l: 0,
        r: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.hashRand)(r),
        rand(n = 0) {return (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.hashRand)(r + n);} });

    }
    return value;
  }
  doesConfigExist(settings, key) {
    if (!settings) return false;
    if (settings._isProxied) settings = settings._proxyTarget;
    return key in settings;
  }
  _getConfig(key) {
    if (this.doesConfigExist(this.settings, key)) return this.settings[key];
    if (this.isEvent) {
      if (this.doesConfigExist(this.settings_event_page, key)) {
        return this.settings_event_page[key];
      } else if (this.doesConfigExist(this.settings_event, key)) {
        return this.settings_event[key];
      }
    } else if (this.isPlayer || this.isFollower) {
      const ACTOR_SETTINGS = this.getActorConfigObject();
      if (this.doesConfigExist(ACTOR_SETTINGS, key)) {
        return ACTOR_SETTINGS[key];
      }
    }
    const EVENT_SETTINGS = this.getDefaultConfigObject();
    if (this.doesConfigExist(EVENT_SETTINGS, key)) {
      return EVENT_SETTINGS[key];
    }
    return undefined;
  }
  hasConfig(key) {
    return this._getConfig(key) != null;
  }

  eventConfigure() {
    if (!this.settings_event) {
      this.settings_event = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.ProxyConf)();
      const note = this.char.event().note;
      this.settings_event._eventTileId = this.char._tileId;
      _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readConfigurationFunctions */ .Z.readConfigurationFunctions(
      _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readConfigurationTags */ .Z.readConfigurationTags(note),
      _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].eventConfigurationFunctions */ .Z.eventConfigurationFunctions,
      this.settings_event);


      this.initialConfigure();
    }
    this.settings_event_page = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.ProxyConf)();
    const page = this.char.page();
    if (!page) {return;}
    let comments = '';
    for (const command of page.list) {
      if (command.code === 108 || command.code === 408) {
        comments += command.parameters[0];
      }
    }
    this.settings_event_page._eventTileId = this.char._tileId;
    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readConfigurationFunctions */ .Z.readConfigurationFunctions(
    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readConfigurationTags */ .Z.readConfigurationTags(comments),
    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].eventConfigurationFunctions */ .Z.eventConfigurationFunctions,
    this.settings_event_page);

    this.updateShape();

    if (this.char.mv3d_needsConfigure) {
      this.char.mv3d_needsConfigure = false;
      this.needsPositionUpdate = true;
    } else {return;}

    this.pageConfigure();

  }

  initialConfigure() {
    this.configureHeight();
    this.updateConfiguration();
  }

  pageConfigure(settings = this.settings_event_page) {
    const transient = settings === this.settings;
    if ('pos' in settings && this.isEvent) {
      const event = this.char.event();
      const pos = settings.pos;
      if ('x' in pos || 'y' in pos) {
        this.char.locate(
        'x' in pos ? (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.relativeNumber)(event.x, pos.x) : this.char.x,
        'y' in pos ? (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.relativeNumber)(event.y, pos.y) : this.char.y);

      }
      if ('z' in pos) {
        this.z = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.relativeNumber)(_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getWalkHeight */ .Z.getWalkHeight(event.x, event.y), pos.z);
      }
      if (transient) delete settings.pos;
    }
    this.setupEventLights();

    if (this.lamp) {
      if ('lamp' in settings) {
        const lampConfig = this.getConfig('lamp');
        this.blendLampColor.setValue(lampConfig.color, 0.5);
        this.blendLampIntensity.setValue(lampConfig.intensity, 0.5);
        this.blendLampDistance.setValue(lampConfig.distance, 0.5);
        if (transient) delete settings.lamp;
      }
    }
    if (this.flashlight) {
      if ('flashlight' in settings) {
        const flashlightConfig = this.getConfig('flashlight');
        this.blendFlashlightColor.setValue(flashlightConfig.color, 0.5);
        this.blendFlashlightIntensity.setValue(flashlightConfig.intensity, 0.5);
        this.blendFlashlightDistance.setValue(flashlightConfig.distance, 0.5);
        this.blendFlashlightAngle.setValue(flashlightConfig.angle, 0.5);
        if (transient) delete settings.flashlight;
      }
      if ('flashlightPitch' in settings) {
        this.blendFlashlightPitch.setValue(this.getConfig('flashlightPitch', 90), 0.25);
        if (transient) delete settings.flashlightPitch;
      }
    }
    if ('height' in settings || this.isAbove !== (this.char._priorityType === 2)) {
      this.configureHeight();
      if (transient) delete settings.height;
    }

    this.updateScale();
    this.updateShape();
    this.needsMaterialUpdate = true;
    this.needsPositionUpdate = true;
    this.updateLightOffsets();
  }

  blendConfigure(settings) {
    Object.assign(this.settings, settings);
    this.pageConfigure(this.settings);
  }

  configureHeight() {
    this.isAbove = this.char._priorityType === 2;
    let height = Math.max(0, this.getConfig('height', this.isAbove && !this.hasConfig('zlock') && !this.isAirship ? _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].EVENT_HEIGHT */ .Z.EVENT_HEIGHT : 0));
    this.blendElevation.setValue(height, 0);
    if (this.isEvent) this.z = this.platformHeight + height;
  }

  updateConfiguration() {
    const shapes = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes */ .Z.enumShapes;
    if (this.model.shape === shapes.SPRITE) {
      this.model.pitch = 0;
      this.model.yaw = 0;
      this.model.roll = 0;
    } else if (this.model.shape === shapes.BOARD) {
      this.model.pitch = this.getConfig('pitch', 0);
      this.model.yaw = this.getConfig('yaw', 0);
      this.model.mesh.billboardMode = this.model.pitch || this.model.yaw ? BILLBOARDMODE_NONE : _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].Meshes.BOARD.billboardMode */ .Z.Meshes.BOARD.billboardMode;
    } else {
      if (!this.getConfig('autoRot', this.model.isComplexMesh())) {
        this.model.rotNode.yaw = this.getConfig('rot', 0);
        this.model.yaw = this.getConfig('yaw', 0);
      }
      if (!this.getConfig('autoPitch')) {
        this.model.pitch = this.getConfig('pitch', 0);
        this.model.roll = this.getConfig('roll', 0);
      }
    }
    this.updateScale();

    if (this.model.mesh) _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].callFeatures */ .Z.callFeatures('configureChar', this);
  }

  dirtyNearbyCells() {
    if (!this.cell) {return;}
    Character.dirtyNearbyCells(this.cell.cx, this.cell.cy);
  }
  static dirtyNearbyCells(cx, cy) {
    for (let ix = cx - 1; ix <= cx + 1; ++ix)
    for (let iy = cy - 1; iy <= cy + 1; ++iy) {
      let x = ix,y = iy;
      if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].loopHorizontal */ .Z.loopHorizontal()) {x = x.mod(Math.ceil(_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].mapWidth */ .Z.mapWidth() / _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].CELL_SIZE */ .Z.CELL_SIZE));}
      if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].loopVertical */ .Z.loopVertical()) {y = y.mod(Math.ceil(_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].mapHeight */ .Z.mapHeight() / _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].CELL_SIZE */ .Z.CELL_SIZE));}
      const cell = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].cells */ .Z.cells[[x, y]];
      if (!cell) {continue;}
      if (!cell._needsIntensiveUpdate) {
        cell._needsIntensiveUpdate = true;
        _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]._cellsNeedingIntensiveUpdate.push */ .Z._cellsNeedingIntensiveUpdate.push(cell);
      }
    }
  }

  intensiveUpdate() {
    this.setupLightInclusionLists();
    this.updateScale();
    this.updatePosition();
  }


  setupLightInclusionLists() {
    this._setupLightInclusionList(this.flashlight);
    this._setupLightInclusionList(this.lamp);
  }
  _setupLightInclusionList(lightsource) {
    if (!lightsource) {return;}

    const meshesInRange = this.getMeshesInRangeOfLight(lightsource);
    for (const mesh of meshesInRange) {
      this.buildLightListForMesh(mesh);
    }
    lightsource.mv3d_meshesInRange = meshesInRange;
    //lightsource.includedOnlyMeshes = meshesInRange;
    if (lightsource.mv3d_excludedParentMesh !== this.model.mesh) {
      lightsource.mv3d_excludedParentMesh = this.model.mesh;
      lightsource.excludedMeshes = [...this.model.meshes];
    }

    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].callFeatures */ .Z.callFeatures('setupLightInclusionList', lightsource);

  }

  clearLightInclusionLists() {
    this._clearLightInclusionList(this.flashlight);
    this._clearLightInclusionList(this.lamp);
  }
  _clearLightInclusionList(lightsource) {
    if (!lightsource) {return;}

    /*
    for(const mesh of lightsource.includedOnlyMeshes){
    	mesh.mv3d_lightInclusionList ??=[];
    	const index = mesh.mv3d_lightInclusionList.indexOf(lightsource);
    	if(index>=0){ mesh.mv3d_lightInclusionList.splice(index,1); }
    }
    lightsource.includedOnlyMeshes.splice(0,Infinity);
    */
    for (const mesh of this.model.meshes) {
      delete mesh.mv3d_lightInclusionListTime;
      delete mesh.mv3d_lightInclusionList;
    }
    lightsource.excludedMeshes.splice(0, Infinity);

  }

  getMeshesInRangeOfLight(light) {
    if (!this.cell) {return [];}
    const pos = _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformCoordinates(light.position, light.getWorldMatrix());

    const meshes = [];
    for (let _cx = this.cell.cx - 1; _cx <= this.cell.cx + 1; ++_cx)
    for (let _cy = this.cell.cy - 1; _cy <= this.cell.cy + 1; ++_cy) {
      let cx = _cx,cy = _cy;
      if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].loopHorizontal */ .Z.loopHorizontal()) {cx = cx.mod(Math.ceil(_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].mapWidth */ .Z.mapWidth() / _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].CELL_SIZE */ .Z.CELL_SIZE));}
      if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].loopVertical */ .Z.loopVertical()) {cy = cy.mod(Math.ceil(_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].mapHeight */ .Z.mapHeight() / _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].CELL_SIZE */ .Z.CELL_SIZE));}
      const cell = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].cells */ .Z.cells[[cx, cy]];
      if (!cell || !cell.mesh) {continue;}
      const overlap = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.overlapSphereBox)(pos, light.range, cell.mesh.getBoundingInfo().boundingBox);
      if (overlap <= 0) {continue;}
      //const sphere = cell.mesh.getBoundingInfo().boundingSphere;
      //const dist = Vector3.Distance(pos,sphere.centerWorld);
      //if(dist>=sphere.radiusWorld+light.range){ continue; }
      meshes.push(cell.mesh);
      const models = [...cell.characters.filter((c) => c !== this).map((c) => c.model), ...cell.doodads];
      for (const model of models) for (const mesh of model.meshes) {
        const overlap = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.overlapSphereBox)(pos, light.range, mesh.getBoundingInfo().boundingBox);
        if (overlap <= 0) {continue;}
        //const sphere = mesh.getBoundingInfo().boundingSphere;
        //const dist = Vector3.Distance(pos,sphere.centerWorld);
        //if(dist>=sphere.radiusWorld+light.range){ continue; }
        meshes.push(mesh);
      }
    }
    return meshes;
  }

  buildLightListForMesh(mesh) {
    if (Date.now() - mesh.mv3d_lightInclusionListTime < _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].intensiveUpdate.interval */ .Z.intensiveUpdate.interval) {return;}
    mesh.mv3d_lightInclusionListTime = Date.now();
    const bbox = mesh.getBoundingInfo().boundingBox;

    const lightList = [];
    for (const light of _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene.lights */ .Z.scene.lights) {
      if (!light.isEnabled() || !light._mv3d_original_canAffectMesh(mesh)) {
        continue;
      }
      if (light instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.DirectionalLight) {
        lightList.push(light);
      };

      const pos = light.getAbsolutePosition();
      if (!pos) continue;

      const overlap = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.overlapSphereBox)(pos, light.range, bbox);
      light.mv3d_overlap = overlap;
      if (overlap > 0) {
        lightList.push(light);
      }

    }

    while (lightList.length > _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].LIGHT_LIMIT */ .Z.LIGHT_LIMIT) {
      const { m: min, i: index } = lightList.reduce(({ m, i }, { mv3d_overlap: overlap }, index) => overlap < m ? { m: overlap, i: index } : { m, i }, { m: Infinity, i: -1 });
      if (!(index >= 0)) {break;}
      lightList.splice(index, 1);
    }
    mesh.mv3d_lightInclusionList = lightList;
    mesh._resyncLightSources();
  }

  setupEventLights() {
    const flashlightConfig = this.getConfig('flashlight');
    const lampConfig = this.getConfig('lamp');
    if (flashlightConfig) {
      if (!this.flashlight) {
        this.setupFlashlight();
      }
      if (flashlightConfig.shadow) {var _this$setupFlashlight;
        (_this$setupFlashlight = this.setupFlashlightShadow) === null || _this$setupFlashlight === void 0 ? void 0 : _this$setupFlashlight.call(this);
      }
    }
    if (lampConfig) {
      if (!this.lamp) {
        this.setupLamp();
      }
      if (lampConfig.shadow) {var _this$setupLampShadow;
        (_this$setupLampShadow = this.setupLampShadow) === null || _this$setupLampShadow === void 0 ? void 0 : _this$setupLampShadow.call(this);
      }
    }
  }
  setupLights() {
    if ('flashlightColor' in this.blenders) {
      this.setupFlashlight();
    }
    if ('lampColor' in this.blenders) {
      this.setupLamp();
    }
  }

  setupFlashlight() {
    if (this.flashlight) {return;}
    const config = this.getConfig('flashlight', {
      color: 0xffffff,
      intensity: 1,
      distance: _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].LIGHT_DIST */ .Z.LIGHT_DIST,
      angle: _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].LIGHT_ANGLE */ .Z.LIGHT_ANGLE });

    this.blendFlashlightColor = this.makeColorBlender('flashlightColor', config.color);
    this.blendFlashlightIntensity = this.makeBlender('flashlightIntensity', config.intensity);
    this.blendFlashlightDistance = this.makeBlender('flashlightDistance', config.distance);
    const lightDist = this.blendFlashlightDistance.targetValue();
    this.blendFlashlightDistance.setValue(0, 0);this.blendFlashlightDistance.setValue(lightDist, 0.25);
    this.blendFlashlightAngle = this.makeBlender('flashlightAngle', config.angle);
    this.flashlight = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.SpotLight('flashlight', _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero(), _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero(),
    (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.degtorad)(this.blendFlashlightAngle.targetValue() + _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].FLASHLIGHT_EXTRA_ANGLE */ .Z.FLASHLIGHT_EXTRA_ANGLE), 0, _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    this.flashlight.renderPriority = 2;
    if (this.isPlayer) this.flashlight.renderPriority += .1;
    this.updateFlashlightExp();
    this.flashlight.range = this.blendFlashlightDistance.targetValue();
    this.flashlight.intensity = this.blendFlashlightIntensity.targetValue() * _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].FLASHLIGHT_INTENSITY_MULTIPLIER */ .Z.FLASHLIGHT_INTENSITY_MULTIPLIER;
    this.flashlight.diffuse.set(...this.blendFlashlightColor.targetComponents());
    this.flashlight.mv3d_updateSpecularFromDiffuse();
    //this.flashlight.projectionTexture = mv3d.getFlashlightTexture();
    this.flashlight.direction.y = -1;
    this.flashlightOrigin = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.TransformNode('flashlight origin', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    this.flashlightOrigin.parent = this.lightOrigin;
    this.flashlight.parent = this.flashlightOrigin;
    this.blendFlashlightPitch = this.makeBlender('flashlightPitch', 90);
    this.blendFlashlightYaw = this.makeBlender('flashlightYaw', 0);
    this.blendFlashlightYaw.cycle = 360;
    this.updateFlashlightDirection();
    this.setupMesh();
    this.updateLightOffsets();
  }

  updateFlashlightExp() {
    this.flashlight.exponent = 64800 * Math.pow(this.blendFlashlightAngle.currentValue(), -2);
  }

  setupLamp() {
    if (this.lamp) {return;}
    const config = this.getConfig('lamp', {
      color: 0xffffff,
      intensity: 1,
      distance: _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].LIGHT_DIST */ .Z.LIGHT_DIST });

    this.blendLampColor = this.makeColorBlender('lampColor', config.color);
    this.blendLampIntensity = this.makeBlender('lampIntensity', config.intensity);
    this.blendLampDistance = this.makeBlender('lampDistance', config.distance);
    const lightDist = this.blendLampDistance.targetValue();
    this.blendLampDistance.setValue(0, 0);this.blendLampDistance.setValue(lightDist, 0.25);
    this.lamp = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.PointLight('lamp', _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero(), _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    this.lamp.renderPriority = 1;
    if (this.isPlayer) this.lamp.renderPriority += .1;
    this.lamp.diffuse.set(...this.blendLampColor.targetComponents());
    this.lamp.mv3d_updateSpecularFromDiffuse();
    this.lamp.intensity = this.blendLampIntensity.targetValue();
    this.lamp.range = this.blendLampDistance.targetValue();
    this.lampOrigin = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.TransformNode('lamp origin', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].scene */ .Z.scene);
    this.lampOrigin.parent = this.lightOrigin;
    this.lamp.parent = this.lampOrigin;
    this.updateLightOffsets();
  }

  updateFlashlightDirection() {
    this.flashlightOrigin.yaw = this.blendFlashlightYaw.currentValue();
    this.flashlightOrigin.pitch = -this.blendFlashlightPitch.currentValue();
    //this.flashlightOrigin.position.set(0,0,0);
    //let flashlightOffset = Math.tan(degtorad(90-this.blendFlashlightAngle.currentValue()-Math.max(90,this.blendFlashlightPitch.currentValue())+90))*mv3d.LIGHT_HEIGHT;
    //flashlightOffset = Math.max(0,Math.min(1,flashlightOffset));
    //this.flashlight.range+=flashlightOffset;
    //this.flashlightOrigin.translate(YAxis,flashlightOffset,LOCALSPACE);
  }

  getDirection() {
    return 180 + _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].dirToYaw */ .Z.dirToYaw(this.char.mv3d_direction(), _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].DIR8MOVE */ .Z.DIR8MOVE);
  }

  updateDirection() {
    this.direction = this.getDirection();

    const turnSpeed = this.getConfig('autoRotSpeed', 360);

    if (this.getConfig('autoRot', this.isComplex)) {
      const needsInitialize = !this.blendDirection;
      if (needsInitialize) {
        this.blendDirection = this.makeBlender('direction', this.direction);
        this.blendDirection.cycle = 360;
      }
      if (this.direction !== this.blendDirection.targetValue()) {
        const blendTime = Math.abs((0,_util_js__WEBPACK_IMPORTED_MODULE_3__.degDiff)(this.direction, this.blendDirection.currentValue()) / turnSpeed);
        this.blendDirection.setValue(this.direction, blendTime);
      }
      if (this.blendDirection.update() || this.needsPositionUpdate || needsInitialize) {
        this.model.yaw = this.blendDirection.currentValue() + this.getConfig('yaw', 0);
        this.model.rotNode.yaw = this.getConfig('rot', 0);
      }
    }
    if (this.getConfig('autoPitch')) {
      if (!this.blendPitch) {
        this.blendPitch = this.makeBlender('pitch', 90);
      }
      // TODO: calculate proper pitch based on slope
    }


  }

  updateLights() {
    if (this.flashlight) {
      let flashlightYaw = 180 + (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.relativeNumber)(-180 + (this.direction || 0), this.getConfig('flashlightYaw', '+0'));
      let flashlightPitch = this.getConfig('flashlightPitch', 90);
      let firstPerson = this.isPlayer && _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].is1stPerson */ .Z.is1stPerson();
      let instantYaw = false;
      let instantPitch = false;
      if (firstPerson) {
        flashlightYaw = 180 + _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendCameraYaw.currentValue */ .Z.blendCameraYaw.currentValue();
        flashlightPitch = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendCameraPitch.currentValue */ .Z.blendCameraPitch.currentValue();
        instantYaw = true;
        instantPitch = true;
      } else {
        if (this.blendDirection && this.getConfig('autoRot', this.isComplex)) {
          flashlightYaw = this.blendDirection.currentValue();
          instantYaw = true;
        }
        if (this.blendPitch && this.getConfig('autoPitch')) {
          flashlightPitch = this.blendPitch.currentValue();
          instantPitch = true;
        }
      }
      if (flashlightYaw !== this.blendFlashlightYaw.targetValue()) {
        this.blendFlashlightYaw.setValue(flashlightYaw, instantYaw ? 0 : 0.25);
      }
      if (flashlightPitch !== this.blendFlashlightPitch.targetValue()) {
        this.blendFlashlightPitch.setValue(flashlightPitch, instantPitch ? 0 : 0.25);
      }
      if (this.blendFlashlightColor.update() | this.blendFlashlightIntensity.update() |
      this.blendFlashlightDistance.update() | this.blendFlashlightAngle.update() |
      this.blendFlashlightYaw.update() | this.blendFlashlightPitch.update()) {
        this.flashlight.diffuse.set(...this.blendFlashlightColor.currentComponents());
        this.flashlight.mv3d_updateSpecularFromDiffuse();
        this.flashlight.intensity = this.blendFlashlightIntensity.currentValue() * _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].FLASHLIGHT_INTENSITY_MULTIPLIER */ .Z.FLASHLIGHT_INTENSITY_MULTIPLIER;
        this.flashlight.range = this.blendFlashlightDistance.currentValue();
        this.flashlight.angle = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.degtorad)(this.blendFlashlightAngle.currentValue() + _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].FLASHLIGHT_EXTRA_ANGLE */ .Z.FLASHLIGHT_EXTRA_ANGLE);
        this.updateFlashlightExp();
        this.updateFlashlightDirection();
        this.dirtyNearbyCells();
      }
    }
    if (this.lamp) {
      if (this.blendLampColor.update() | this.blendLampIntensity.update() | this.blendLampDistance.update()) {
        this.lamp.diffuse.set(...this.blendLampColor.currentComponents());
        this.lamp.mv3d_updateSpecularFromDiffuse();
        this.lamp.intensity = this.blendLampIntensity.currentValue();
        this.lamp.range = this.blendLampDistance.currentValue();
        this.needsMaterialUpdate = true;
        this.dirtyNearbyCells();
      }
    }
  }

  makeBlender(key, dfault, clazz = _blenders_js__WEBPACK_IMPORTED_MODULE_4__/* .Blender */ .j$) {
    if (key in this.blenders) {
      dfault = this.blenders[key];
    } else {
      this.blenders[key] = dfault;
    }
    const blender = new clazz(key, dfault, false);
    blender.storageLocation = () => this.blenders;
    return blender;
  }
  makeColorBlender(key, dfault) {
    return this.makeBlender(key, dfault, _blenders_js__WEBPACK_IMPORTED_MODULE_4__/* .ColorBlender */ .sO);
  }

  hasBush() {
    if (this.platformChar) {return false;}
    return this.getConfig('bush', !(
    this.char.isTile() || this.isVehicle ||
    this.isEvent && this.char.isObjectCharacter())) &&
    !(this.blendElevation.currentValue() || this.falling);
  }

  //===========================
  //	Update Functions
  //===========================

  boundsInRenderDist() {
    if (!this.model.isReady()) return false;
    const bsphere = this.model.mesh.getBoundingInfo().boundingSphere;
    const loopPos = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].loopCoords */ .Z.loopCoords(this.char.x + bsphere.center.x, this.char.y - bsphere.center.z);
    const radius = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].renderDist */ .Z.renderDist + bsphere.radiusWorld;
    return Math.abs(loopPos.x - _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].cameraStick.x */ .Z.cameraStick.x) <= radius &&
    Math.abs(loopPos.y - _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].cameraStick.y */ .Z.cameraStick.y) <= radius;
  }

  getActionName() {
    if (this.falling || this.char.isJumping() && this.char._jumpCount < this.char._jumpPeak) {
      if ('fall' in this.actions) return 'fall';
    }
    if (this.char.isJumping()) {
      if ('jump' in this.actions) return 'jump';
    }
    if (this.platform && Tilemap.isWaterTile(this.platform.tileId)) {
      if (this.idleCount <= 1) {
        if ('swimmove' in this.actions) return 'swimmove';
      }
      if ('swim' in this.actions) return 'swim';
    }
    if (this.idleCount <= 1) {
      if (this.char.isDashing() || this.isFollower && $gamePlayer.isDashing()) {
        if ('run' in this.actions) return 'run';
      }
      if ('walk' in this.actions) return 'walk';
    }
    if ('idle' in this.actions) return 'idle';
  }

  getActionSpeedMultiplier() {
    return Math.pow(2, this.char.realMoveSpeed()) / 16;
  }

  updateActions() {
    if (!this.actions) return;
    if (this.char.isMoving()) {
      this.idleCount = 0;
    } else {
      this.idleCount = this.idleCount + 1 || 2;
    }
    const actionName = this.getActionName();
    if (this.playingActions) for (let i = this.playingActions.length - 1; i >= 0; --i) {
      const playingAction = this.playingActions[i];
      const action = this.actions[playingAction.name];
      if (!(action !== null && action !== void 0 && action.isPlaying) && !(action !== null && action !== void 0 && action._isPaused)) {
        this.playingActions.splice(i, 1);
        //this.stopAction(this.currentAction);
        this.resetActions();
      }
    }
    if (actionName !== this.currentAction) {
      this.stopAction(this.currentAction);
      this.currentAction = actionName;
      if (this.actions[actionName]) {
        this.stopAllActions();
        if (this._firstAction) {
          this.actions[actionName].enableBlending = false;
          delete this._firstAction;
        } else {
          this.actions[actionName].enableBlending = true;
        }
        this.actions[actionName].play(true);
        this.resetActions();
      }
    }
    if (this.actions[this.currentAction]) {
      const data = this.actionData[this.currentAction] || {};
      const action = this.actions[this.currentAction];
      const speed = Number(data.speed ?? 1) * this.getActionSpeedMultiplier();
      if (speed !== action.speedRatio) {
        action.speedRatio = speed;
      }
    }
  }

  resetActions() {var _this$actions$this$cu2;
    (_this$actions$this$cu2 = this.actions[this.currentAction]) === null || _this$actions$this$cu2 === void 0 ? void 0 : _this$actions$this$cu2.bump();
    if (this.playingActions) for (const playingAction of this.playingActions) {var _this$actions$playing2;
      (_this$actions$playing2 = this.actions[playingAction.name]) === null || _this$actions$playing2 === void 0 ? void 0 : _this$actions$playing2.bump();
    }
  }

  stopAllActions(stopImportant) {
    if (!this.actions) return;
    if (this.playingActions) for (let i = this.playingActions.length - 1; i >= 0; --i) {
      const playingAction = this.playingActions[i];
      if (!playingAction.important || stopImportant) {
        this.actions[playingAction.name].stop();
        this.playingActions.splice(i, 1);
      }
    }
  }

  playAction(name, loop, important) {var _this$actions;
    name = String(name).toLowerCase();
    const action = (_this$actions = this.actions) === null || _this$actions === void 0 ? void 0 : _this$actions[name];
    if (!action) return;
    this.playingActions ??= [];
    action.play(loop);
    const playingIndex = this.playingActions.findIndex((a) => a.name === name);
    const alreadyPlaying = playingIndex >= 0;
    if (alreadyPlaying) this.playingActions.splice(playingIndex, 1);
    this.playingActions.push({
      name, loop, important });

    if (alreadyPlaying) this.resetActions();
  }

  pauseAction(name) {var _this$actions2;
    name = String(name).toLowerCase();
    const action = (_this$actions2 = this.actions) === null || _this$actions2 === void 0 ? void 0 : _this$actions2[name];
    if (!action) return;
    action.pause();
  }

  stopAction(name) {var _this$actions3, _this$playingActions;
    name = String(name).toLowerCase();
    const action = (_this$actions3 = this.actions) === null || _this$actions3 === void 0 ? void 0 : _this$actions3[name];
    const playingIndex = (_this$playingActions = this.playingActions) === null || _this$playingActions === void 0 ? void 0 : _this$playingActions.findIndex((a) => a.name === name);
    if (playingIndex >= 0) {
      this.playingActions.splice(playingIndex, 1);
    }
    if (!action) return;
    action.stop();
    this.resetActions();
  }

  async waitForAction(name) {var _this$actions4;
    name = String(name).toLowerCase();
    const action = (_this$actions4 = this.actions) === null || _this$actions4 === void 0 ? void 0 : _this$actions4[name];
    if (!action) return;
    await (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.sleepUntil)(() => !action.isPlaying);
  }



  beforeRender() {
    // update blenders
    if (this.blendElevation.update()) {
      this.needsPositionUpdate = true;
    }
    if (this.flashlight || this.isComplex || this.getConfig('autoRot', this.isComplex) || this.getConfig('autoPitch')) {
      this.updateDirection();
    }
    this.updateLights();
    // do bone transforms if applicable
    const boneData = this.getConfig('boneData');
    if (boneData && this.bones) for (const key in boneData) {
      const data = boneData[key];
      const bone = this.bones[key];
      if (bone && data) {
        if (data.scale) {
          const boneScale = +data.scale;
          if (bone._linkedTransformNode) {
            bone._linkedTransformNode.scaling.set(boneScale, boneScale, boneScale);
          } else {
            bone.setScale(new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector3(boneScale, boneScale, boneScale));
          }
        }
      }
    }
    //this.model.meshes[1].skeleton.bones[6]._linkedTransformNode.scaling.set(.8,.8,.8)
  }

  updateVisibility() {
    const bitmapReady = this.isBitmapReady();
    this.visible = bitmapReady && !(this.mv_sprite._hiding || this.mv_sprite._hidden);
    if (typeof this.char.isVisible === 'function') {
      this.visible = this.visible && this.char.isVisible();
    }
    const inRenderDist = this.isPlayer || (this.isComplex ? this.boundsInRenderDist() : this.char.mv3d_inRenderDist());
    if (this.char.isTransparent() || !inRenderDist ||
    !this.model.isReady() ||
    (this.char._characterName || this.tileId) && !this.model.textureLoaded && !this.isComplex ||
    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].is1stPerson */ .Z.is1stPerson() && this.isFollower && this.char._realX === $gamePlayer._realX && this.char._realY === $gamePlayer._realY) {
      this.visible = false;
    }

    if (!this.isEnabled()) {
      if (this.visible) {this.setEnabled(true);this.needsPositionUpdate = true;}
    } else {
      if (!this.visible) {this.setEnabled(false);}
    }

    this._noUpdate = !inRenderDist || !bitmapReady;
  }

  update() {
    if (this.char._erased) {
      if (!this.isDisposed()) this.dispose();
      return;
    }

    this.updateVisibility();

    if (this.isImageChanged()) {
      this.updateCharacter();
    }
    //if(this.patternChanged()){
    //	this.updateFrame();
    //}

    if (this._noUpdate) {
      //this.updateAnimations();
      return;
    }

    if (this.isPlayer && this.char.isInVehicle() && this.char.vehicle().mv3d_temp._positionUpdated) {
      this.needsPositionUpdate = true;
    } else if (this.x !== this.char._realX || this.y !== this.char._realY ||
    this.isVehicle && this._altitude !== this.char._altitude
    //|| this.isPlayer && this.char.isInVehicle()
    || this.falling || this.prevZ !== this.z ||
    this.platformChar && this.platformChar.needsPositionUpdate)
    {
      this.needsPositionUpdate = true;
      this.prevZ = this.z;
    }

    if (!this.isEmpty && this.isEnabled()) {
      this.updateNormal();
    } else {
      this.updateEmpty();
    }
    this.updateAnimations();

    if (this.needsMaterialUpdate) {
      this.updateEmissive();
      this.needsMaterialUpdate = false;
    }
    if (this.needsScaleUpdate) {
      this.updateScale();
      this.needsScaleUpdate = false;
    }
    this.char.mv3d_temp._positionUpdated = this.needsPositionUpdate;
    this.needsPositionUpdate = false;
    //this.mesh.renderOutline=true;
    //this.mesh.outlineWidth=1;
  }
  //get needsPositionUpdate(){return this._needsPositionUpdate; }
  //set needsPositionUpdate(v){ this._needsPositionUpdate=v; }

  updateNormal() {

    this.model.update();

    if (this.isPlayer) {
      //if(this.model.mesh) this.model.mesh.visibility = +!mv3d.is1stPerson(true);
      if (this.model.mesh) this.model.mesh.isVisible = !_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].is1stPerson */ .Z.is1stPerson(true);
    }

    if (this.needsMaterialUpdate || this.needsPositionUpdate) {
      this.updateAlpha();
    }

    if (this.needsPositionUpdate || _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendCameraYaw.updated */ .Z.blendCameraYaw.updated) {
      this.updatePosition();
    } else if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendCameraPitch.updated */ .Z.blendCameraPitch.updated || _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendCameraYaw.updated */ .Z.blendCameraYaw.updated) {
      this.updatePositionOffsets();
    }
    this.updateElevation();

    //if(this.flashlight||this.isComplex||this.getConfig('autoRot',this.isComplex)||this.getConfig('autoPitch')){
    //	this.updateDirection();
    //}

    if (this.shadow) {this.updateShadow();}
    //this.updateLights();
    if (this.isGltf) this.updateActions();
  }

  updateEmpty() {
    if (this.needsPositionUpdate) {
      this.updatePosition();
      this.updateElevation();
    }
    //this.updateLights();
    if (this.shadow && this.shadow.isEnabled()) {this.shadow.setEnabled(false);}
  }

  updateAlpha() {
    if (this.isInstance()) {return;}
    const materials = this.model.materials;
    if (!materials.length) {return;}

    this.bush = Boolean(this.char.bushDepth());
    if (!this.isComplex && this.model.material) {
      const material = this.model.material;
      if (this.bush && this.hasBush()) {
        if (!material.opacityTexture) {
          const bushAlpha = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getBushAlphaTextureSync */ .Z.getBushAlphaTextureSync();
          if (bushAlpha && bushAlpha.isReady()) {
            material.opacityTexture = bushAlpha;
          }
        }
      } else {
        if (material.opacityTexture) {
          material.opacityTexture = null;
        }
      }
    }

    const alpha = this.getConfig('alpha', 1) * this.char.opacity() / 255;
    const _hasAlpha = this.hasConfig('alpha') || alpha < 1;
    const blendMode = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendModes */ .Z.blendModes[this.char.blendMode()];
    for (const material of materials) {
      if (!material._mv3d_orig_alpha) {material._mv3d_orig_alpha = material.alpha;}
      let hasAlpha = _hasAlpha || material._mv3d_orig_alpha < 1;
      if (material.alphaMode !== blendMode) {
        material.alphaMode = blendMode;
      }
      if (blendMode !== _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendModes.NORMAL */ .Z.blendModes.NORMAL) {
        hasAlpha = true;
      }
      if (hasAlpha || material.opacityTexture) {
        material.useAlphaFromDiffuseTexture = true;
        material.alpha = alpha * material._mv3d_orig_alpha;
        material.alphaCutOff = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].ALPHA_NO_CUTOFF */ .Z.ALPHA_NO_CUTOFF;
      } else {
        material.useAlphaFromDiffuseTexture = false;
        material.alpha = 1;
        material.alphaCutOff = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].ALPHA_CUTOFF */ .Z.ALPHA_CUTOFF;
      }
    }
    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].callFeatures */ .Z.callFeatures('updateCharacterAlpha', this);
  }

  updateLightOffsets() {
    if (this.lamp) {
      const offset = {
        x: this.getConfig('lampXoff', 0),
        y: this.getConfig('lampYoff', 0),
        z: this.getConfig('lampZoff', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].LAMP_HEIGHT */ .Z.LAMP_HEIGHT) };

      this.lampOrigin.x = offset.x;
      this.lampOrigin.y = offset.y;
      this.lampOrigin.z = offset.z;
    }
    if (this.flashlight) {
      const offset = {
        x: this.getConfig('flashlightXoff', 0),
        y: this.getConfig('flashlightYoff', 0),
        z: this.getConfig('flashlightZoff', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].FLASHLIGHT_HEIGHT */ .Z.FLASHLIGHT_HEIGHT) };

      this.flashlightOrigin.x = offset.x;
      this.flashlightOrigin.y = offset.y;
      this.flashlightOrigin.z = offset.z;
    }
  }

  updatePositionOffsets() {
    this.spriteOrigin.position.set(0, 0, 0);
    if (this.model.shape === _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.FLAT */ .Z.enumShapes.FLAT) {
      const elevation = this.blendElevation.currentValue();
      const offsetDist = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].LAYER_DIST */ .Z.LAYER_DIST * 4;
      if (this.hasConfig('zlock')) {
        this.spriteOrigin.z = 0;
      } else if (elevation) {
        this.spriteOrigin.z = Math.max(0, offsetDist - elevation);
      } else {
        this.spriteOrigin.z = offsetDist;
      }
    } else if (this.model.shape === _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.SPRITE */ .Z.enumShapes.SPRITE) {
      this.spriteOrigin.z = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].LAYER_DIST */ .Z.LAYER_DIST * 4 * (1 - Math.max(0, Math.min(90, _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendCameraPitch.currentValue */ .Z.blendCameraPitch.currentValue())) / 90);
    }
    const useSpriteOffset = this.model.shape === _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.SPRITE */ .Z.enumShapes.SPRITE || this.model.needsProjectionFix();
    const doff = this.getConfig('dynamicOffset', useSpriteOffset ? _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].SPRITE_OFFSET */ .Z.SPRITE_OFFSET : 0);
    if (doff) {
      const cameraRotation = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].cameraRotation */ .Z.cameraRotation();
      const billboardOffset = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_1__.Vector2(Math.sin(-cameraRotation.y), Math.cos(cameraRotation.y));
      const dpitch = this.getConfig('dynamicOffsetPitch', this.model.shape === _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.SPRITE */ .Z.enumShapes.SPRITE ? _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].SPRITE_OFFSET_PITCH */ .Z.SPRITE_OFFSET_PITCH : false);
      const spriteOffset = doff * (dpitch ? Math.sin(Math.max(0, cameraRotation.x)) : 1);
      this.spriteOrigin.x = billboardOffset.x * spriteOffset;
      this.spriteOrigin.y = billboardOffset.y * spriteOffset;
    }

    if (this.isPlayer && _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].is1stPerson */ .Z.is1stPerson()) {
      this.lightOrigin.x = 0;
      this.lightOrigin.y = 0;
    } else {
      this.lightOrigin.x = this.spriteOrigin.x;
      this.lightOrigin.y = this.spriteOrigin.y;
    }

    this.spriteOrigin.x += this.getConfig('xoff', 0);
    this.spriteOrigin.y += this.getConfig('yoff', 0);
    this.spriteOrigin.z += this.getConfig('zoff', 0);

  }

  updatePosition() {
    this.updatePositionOffsets();

    const loopPos = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].loopCoords */ .Z.loopCoords(this.char._realX, this.char._realY);
    this.x = loopPos.x;
    this.y = loopPos.y;

    if (!this.needsPositionUpdate &&
    !this.isPlayer && this.char !== $gamePlayer.vehicle()) {return;}

    const cellX = Math.floor(Math.round(this.char._realX) / _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].CELL_SIZE */ .Z.CELL_SIZE);
    const cellY = Math.floor(Math.round(this.char._realY) / _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].CELL_SIZE */ .Z.CELL_SIZE);
    const cell = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].cells */ .Z.cells[[cellX, cellY]];
    if (this.cell && this.cell !== cell) {
      this.removeFromCell();
    }
    if (cell && !this.cell) {
      this.cell = cell;
      cell.characters.push(this);
    }
    if (this.needsPositionUpdate) {
      this.dirtyNearbyCells();
      this.markAsDirty();
    }

  }

  updateElevation() {
    if (!this.needsPositionUpdate && !this.char.isJumping()) {return;}

    //don't update when moving on tile corners
    if (this.char.isMoving() && !((this.x - 0.5) % 1) && !((this.y - 0.5) % 1)) {return;}

    //if(this.isPlayer) console.log('player update elevation');

    this.falling = false;

    if (this.isPlayer) {
      const vehicle = this.char.vehicle();
      if (vehicle && vehicle.mv3d_sprite) {
        //if(vehicle&&vehicle._driving){
        const vehicle_sprite = vehicle.mv3d_sprite;
        this.z = vehicle_sprite.z;
        this.targetElevation = vehicle_sprite.targetElevation;
        this.platformChar = vehicle_sprite.platformChar;
        this.platformHeight = vehicle_sprite.platformHeight;
        //if(vehicle._driving){ return; }
        return;
      }
      //console.log(this.z,vehicle?.z);
    }

    if (this.hasConfig('zlock')) {
      this.z = this.getConfig('zlock', 0);
      this.z += this.blendElevation.currentValue();
      this.targetElevation = this.z;
      return;
    }

    this.hasFloat = this.isVehicle || (this.isPlayer || this.isFollower) && $gamePlayer.vehicle();

    const platform = this.getPlatform(this.char._realX, this.char._realY);
    this.platform = platform;
    this.platformHeight = platform.z2;
    this.platformChar = platform.char;

    this.targetElevation = this.getTargetElevation(this.char._realX, this.char._realY, { platform });
    let gravity = this.getConfig('gravity', _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].GRAVITY */ .Z.GRAVITY) / 60;

    if (this.char.isJumping()) {
      let jumpProgress = 1 - this.char._jumpCount / (this.char._jumpPeak * 2);
      let jumpHeight = Math.pow(jumpProgress - 0.5, 2) * -4 + 1;
      let jumpDiff = Math.abs(this.char.mv3d_jumpHeightEnd - this.char.mv3d_jumpHeightStart);
      this.z = this.char.mv3d_jumpHeightStart * (1 - jumpProgress) +
      this.char.mv3d_jumpHeightEnd * jumpProgress + jumpHeight * jumpDiff / 2 +
      this.char.jumpHeight() / (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.tileSize)();
    } else if (gravity) {
      const gap = Math.abs(this.targetElevation - this.z);
      if (gap < gravity) {gravity = gap;}
      //if(this.z>this.targetElevation||this.z<this.platformHeight){
      if (this.z < this.platformHeight) {
        this.z = this.platformHeight;
      }
      if (this.z > this.targetElevation) {
        this.z -= gravity;
        if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tileCollision */ .Z.tileCollision(this, this.char._realX, this.char._realY, false, false)) {
          this.z = this.platformHeight;
        }
      } else if (this.z < this.targetElevation) {
        this.z += gravity;
        if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tileCollision */ .Z.tileCollision(this, this.char._realX, this.char._realY, false, false)) {
          this.z -= gravity;
        }
      }
      this.falling = this.z > this.targetElevation;
    }
    return;
  }

  getTargetElevation(x = this.char._realX, y = this.char._realY, opts = {}) {
    if (this.isPlayer) {
      const vehicle = this.char.vehicle();
      if (vehicle && vehicle.mv3d_sprite && vehicle._driving) {
        return vehicle.mv3d_sprite.getTargetElevation(x, y);
      }
    }
    if (this.hasConfig('zlock')) {
      return this.getConfig('zlock', 0) + this.blendElevation.currentValue();
    }

    if (!opts.platform) {opts.platform = this.getPlatform(x, y, opts);}
    const colliderZ = this.getPlatformFloat(x, y, { platform: opts.platform });
    const platformZ = this.getPlatformFloat(x, y, { platform: this.getPlatform(x, y, { ...opts, onlyPlatforms: true }) });
    let targetElevation = platformZ;

    targetElevation += this.blendElevation.currentValue();

    if (this.isVehicle) {
      this._altitude = this.char._altitude;
      targetElevation += _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].airshipHeight */ .Z.airshipHeight * this.char._altitude / this.char.maxAltitude();
    }

    targetElevation = Math.max(targetElevation, colliderZ);

    return targetElevation;
  }

  getPlatform(x = this.char._realX, y = this.char._realY, opts = {}) {
    return _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getPlatformForCharacter */ .Z.getPlatformForCharacter(this, x, y, opts);
  }

  getPlatformFloat(x = this.char._realX, y = this.char._realY, opts = {}) {
    if (!opts.platform) {opts.platform = this.getPlatform(x, y, opts);}
    const platform = opts.platform;
    let z = platform.z2;
    if (this.hasFloat && !platform.char) {
      const cHeight = this.getCHeight();
      z += _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getFloatHeight */ .Z.getFloatHeight(Math.round(x), Math.round(y), this.z + Math.max(cHeight, _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].STAIR_THRESH */ .Z.STAIR_THRESH), _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].STAIR_THRESH */ .Z.STAIR_THRESH >= cHeight);
    }
    return z;
  }

  updateShadow() {
    let shadowVisible = Boolean(this.getConfig('shadow', this.model.shape != _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.FLAT */ .Z.enumShapes.FLAT));

    if (shadowVisible && (this.isPlayer || this.isFollower)) {
      const myIndex = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].characters.indexOf */ .Z.characters.indexOf(this);
      if (myIndex >= 0)
      for (let i = myIndex + 1; i < _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].characters.length */ .Z.characters.length; ++i) {
        const other = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].characters */ .Z.characters[i];
        if (!other.shadow || !other.visible) {continue;}
        if (other.char._realX === this.char._realX && other.char._realY === this.char._realY) {
          shadowVisible = false;
          break;
        }
      }
    }
    if (!this.shadow.isEnabled()) {
      if (shadowVisible) {this.shadow.setEnabled(true);}
    } else {
      if (!shadowVisible) {this.shadow.setEnabled(false);}
    }
    if (!shadowVisible) {return;}

    const shadowDist = Math.max(this.z - this.platformHeight, 0);
    const shadowFadeDist = this.getConfig('shadowDist', 4);
    const shadowStrength = Math.max(0, 1 - Math.abs(shadowDist) / shadowFadeDist);
    this.shadow.z = -shadowDist + _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].LAYER_DIST */ .Z.LAYER_DIST * 3.5;
    this.shadow.x = this.spriteOrigin.x;this.shadow.y = this.spriteOrigin.y;
    const shadowScale = this.getConfig('shadow', 1);
    this.shadow.scaling.setAll(shadowScale * shadowStrength);
    if (!this.shadow.isAnInstance) {
      this.shadow.visibility = shadowStrength - 0.5 * this.bush; //visibility doesn't work with instancing
    }
  }

  updateAnimations() {
    if (this.char.isBalloonPlaying()) {
      if (!this._balloon) {
        this._balloon = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].showBalloon */ .Z.showBalloon(this);
      }
      this._balloon.update();
    } else {
      this.disposeBalloon();
    }

    if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].isMV */ .Z.isMV) {
      for (const animation of this.char.mv_sprite._animationSprites) {
        if (animation.mv3d_animation) {
          animation.mv3d_animation.update();
        }
      }
      if (this.char.mv_sprite._animationSprites.length) {
        this.needsMaterialUpdate = true;
      }
    }
  }

  disposeBalloon() {
    if (this._balloon) {
      this._balloon.dispose();
      this._balloon = null;
    }
  }

  dispose(...args) {
    super.dispose(...args);
    this.model.dispose();
    this.model.clearMesh();
    //console.log('disposing char');
    //delete this.char.mv3d_sprite;
    const index = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].characters.indexOf */ .Z.characters.indexOf(this);
    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].characters.splice */ .Z.characters.splice(index, 1);
    this.disposeBalloon();
    this.removeFromCell();
    _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].callFeatures */ .Z.callFeatures('disposeCharacter', this);
  }

  removeFromCell() {
    if (this.cell) {
      const index = this.cell.characters.indexOf(this);
      if (index >= 0) {this.cell.characters.splice(index, 1);}
      this.cell = null;
    }
  }

  getCHeight() {
    let dfault = this.model.shape === _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].enumShapes.FLAT */ .Z.enumShapes.FLAT || this.char._priorityType === 0 ? 0 : this.spriteHeight;
    if (this.isComplex && this.model.isReady()) dfault *= this.model.mesh.getBoundingInfo().boundingBox.maximum.y;
    let collide = this.getConfig('collide', dfault);
    return collide === true ? dfault : Number(collide);
  }

  getCollider() {
    if (this._collider) {return this._collider;}
    const collider = { char: this };
    this._collider = collider;
    Object.defineProperties(collider, {
      z1: { get: () => this.z },
      z2: { get: () => {
          return Math.max(this.z, this.z + this.getCHeight());
        } } });

    return collider;
  }
  getTriggerCollider() {
    if (this._triggerCollider) {return this._triggerCollider;}
    const collider = {};
    this._triggerCollider = collider;
    Object.defineProperties(collider, {
      z1: { get: () => {
          const trigger = this.getConfig('trigger');
          if (trigger) {
            return this.z - trigger.down;
          } else if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRIGGER_INFINITE */ .Z.TRIGGER_INFINITE || this.isEmpty) {
            return -Infinity;
          } else {
            return this.getCollider().z1;
          }
        } },
      z2: { get: () => {
          const trigger = this.getConfig('trigger');
          if (trigger) {
            return this.z - trigger.up;
          } else if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRIGGER_INFINITE */ .Z.TRIGGER_INFINITE || this.isEmpty) {
            return Infinity;
          } else {
            return this.getCollider().z2;
          }
        } } });

    return collider;
  }

  getCollisionHeight(z = this.z) {
    const cHeight = this.getCHeight();
    return { z1: z, z2: z + cHeight, char: this };
  }

  getTriggerHeight(z = this.z) {
    const trigger = this.getConfig('trigger');
    if (trigger) {
      return { z1: z - trigger.down, z2: z + trigger.up };
    } else if (_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRIGGER_INFINITE */ .Z.TRIGGER_INFINITE || this.isEmpty) {
      return { z1: -Infinity, z2: Infinity };
    } else {
      return this.getCollisionHeight();
    }
  }}


_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].Character */ .Z.Character = Character;

(0,_util_js__WEBPACK_IMPORTED_MODULE_3__.override)(Sprite_Character.prototype, 'characterPatternY', (o) => function () {
  const sprite = this._character.mv3d_sprite;
  if (!sprite) {return o.apply(this, arguments);}
  const dirfix = sprite.getConfig('dirfix', sprite.isEvent && sprite.char.isObjectCharacter());
  const ddir = this._character.mv3d_direction();
  const useDiagonal = !this._isBigCharacter && this._characterIndex < 4 && this._characterName.includes(_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].DIAG_SYMBOL */ .Z.DIAG_SYMBOL);
  let dir;
  if (dirfix || _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].isDisabled */ .Z.isDisabled()) {
    if (useDiagonal) {dir = ddir;} else
    {dir = this._character.direction();}
  } else if (useDiagonal) {
    dir = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].transformFacing */ .Z.transformFacing(ddir, _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendCameraYaw.currentValue */ .Z.blendCameraYaw.currentValue(), true);
  } else {
    dir = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].transformFacing */ .Z.transformFacing(ddir, _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].blendCameraYaw.currentValue */ .Z.blendCameraYaw.currentValue(), false);
  }
  if (dir % 2) {
    return diagRow[dir];
  } else {
    return dir / 2 - 1;
  }
}, () => !_main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].isDisabled */ .Z.isDisabled() || _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].DIR8MOVE */ .Z.DIR8MOVE && _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].DIR8_2D */ .Z.DIR8_2D);
const diagRow = {
  3: 4,
  1: 5,
  9: 6,
  7: 7 };


(0,_util_js__WEBPACK_IMPORTED_MODULE_3__.override)(Sprite_Character.prototype, 'setFrame', (o) => function (x, y, width, height) {
  o.apply(this, arguments);
  const sprite = this._character.mv3d_sprite;if (!sprite) {return;}
  if (sprite.isImageChanged()) {return;}
  sprite.setFrame(x, y, this.patternWidth(), this.patternHeight());
});

(0,_util_js__WEBPACK_IMPORTED_MODULE_3__.override)(Sprite_Character.prototype, 'setBlendColor', (o) => function () {
  o.apply(this, arguments);
  const sprite = this._character.mv3d_sprite;if (!sprite) {return;}
  sprite.needsMaterialUpdate = true;
});

(0,_util_js__WEBPACK_IMPORTED_MODULE_3__.override)(Game_CharacterBase.prototype, 'setOpacity', (o) => function () {
  o.apply(this, arguments);
  const sprite = this.mv3d_sprite;if (!sprite) {return;}
  sprite.needsMaterialUpdate = true;
});

(0,_util_js__WEBPACK_IMPORTED_MODULE_3__.override)(Game_CharacterBase.prototype, 'setBlendMode', (o) => function () {
  o.apply(this, arguments);
  const sprite = this.mv3d_sprite;if (!sprite) {return;}
  sprite.needsMaterialUpdate = true;
});


(0,_util_js__WEBPACK_IMPORTED_MODULE_3__.override)(Game_CharacterBase.prototype, 'tileId', (o) => function () {
  if (this.mv3d_sprite) {return this.mv3d_sprite.tileId;}
  return this._tileId;
});

(0,_util_js__WEBPACK_IMPORTED_MODULE_3__.override)(Game_CharacterBase.prototype, 'isOnBush', (o) => function () {
  if (!this.mv3d_sprite) {return o.apply(this, arguments);}
  const rx = Math.round(this._realX),ry = Math.round(this._realY);
  const tileData = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getTileData */ .Z.getTileData(rx, ry);
  const layers = _main_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"].getTileLayers */ .Z.getTileLayers(rx, ry, this.mv3d_sprite.z + this.mv3d_sprite.getCHeight(), false);
  const flags = $gameMap.tilesetFlags();
  for (const l of layers) {
    if ((flags[tileData[l]] & 0x40) !== 0) {return true;}
  }
  return false;
});

class Action extends Array {

  get speedRatio() {var _this$;return ((_this$ = this[0]) === null || _this$ === void 0 ? void 0 : _this$.speedRatio) ?? 1;}
  set speedRatio(v) {this.forEach((a) => a.speedRatio = v);}

  get enableBlending() {var _this$2, _this$2$targetedAnima;return (_this$2 = this[0]) === null || _this$2 === void 0 ? void 0 : (_this$2$targetedAnima = _this$2.targetedAnimations[0]) === null || _this$2$targetedAnima === void 0 ? void 0 : _this$2$targetedAnima.animation.enableBlending;}
  set enableBlending(v) {this.forEach((ag) => ag.targetedAnimations.forEach((ta) => ta.animation.enableBlending = v));}

  get blendingSpeed() {var _this$3, _this$3$targetedAnima;return (_this$3 = this[0]) === null || _this$3 === void 0 ? void 0 : (_this$3$targetedAnima = _this$3.targetedAnimations[0]) === null || _this$3$targetedAnima === void 0 ? void 0 : _this$3$targetedAnima.animation.blendingSpeed;}
  set blendingSpeed(v) {this.forEach((ag) => ag.targetedAnimations.forEach((ta) => ta.animation.blendingSpeed = v));}

  get isPaused() {return this.some((a) => a._isPaused);}
  get isPlaying() {return this.some((a) => a.isPlaying);}
  get loopAnimation() {return this.some((a) => a.loopAnimation);}
  play(loop) {this.forEach((a) => a.play(loop));}
  stop() {this.forEach((a) => a.stop());}
  pause() {this.forEach((a) => a.pause());}

  //get masterFrame(){ return Math.max(...this.map(a=>a.animatables[0]?.masterFrame??0)); }
  bump() {
    for (const action of this) {var _action$animatables$;
      if (!action.isPlaying && !action._isPaused) continue;
      const paused = action._isPaused;
      const loop = action.loopAnimation;
      const frame = ((_action$animatables$ = action.animatables[0]) === null || _action$animatables$ === void 0 ? void 0 : _action$animatables$.masterFrame) ?? 0;
      action.stop();
      action.play(loop);
      action.goToFrame(frame);
      if (paused) {action.pause;}
    }
  }}

/***/ }),

/***/ "./src/configuration.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Ce": () => (/* binding */ interpretTextureParameters),
/* harmony export */   "Mr": () => (/* binding */ TextureConfigurator),
/* harmony export */   "aK": () => (/* binding */ textureParameters),
/* harmony export */   "oX": () => (/* binding */ createTextureSymbol),
/* harmony export */   "py": () => (/* binding */ ConfigurationFunction)
/* harmony export */ });
/* unused harmony export createRectString */
/* harmony import */ var _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/index.js");
/* harmony import */ var _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/mod_babylon.js");
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/util.js");
/* harmony import */ var _blenders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/blenders.js");
/* harmony import */ var _util_parsing_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./src/util_parsing.js");
/* harmony import */ var _main_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./src/main.js");







BABYLON.Collider.DoubleSidedCheck = true;

class ConfigurationFunction {
  constructor(parameters, func) {
    this.func = func;
    this.descriptor = parameters;
    if (!parameters) {
      this.useRawParams = true;
      return;
    }
  }
  run(conf, rawparams) {
    if (this.useRawParams) {
      this.func(conf, rawparams);
      return;
    }
    const params = (0,_util_parsing_js__WEBPACK_IMPORTED_MODULE_4__.parseParameters)(rawparams, this.descriptor);
    this.func(conf, params);
  }}

_main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].ConfigurationFunction */ .Z.ConfigurationFunction = ConfigurationFunction;

const textureParameters_basic = 'img,x,y,w,h';
const textureParameters_extended = 'alpha|glow,glowintensity[anim]animx,animy';
const textureParameters = `${textureParameters_basic}|${textureParameters_extended}`;

function TextureConfigurator(name, extraParams = '', apply) {
  const paramlist = !extraParams ? textureParameters : `${textureParameters_basic}|${extraParams}|${textureParameters_extended}`;
  return new ConfigurationFunction(paramlist, function (conf, params) {
    interpretTextureParameters(name, params, conf);
    if (apply) {
      apply.call(this, conf, params);
    }
  });
}
/* // possible feature: rotate uvs
const clockwiseUvRotChars='⮤⮧';
const counterUvRotChars='⮦⮥';
const uvRotChars=clockwiseUvRotChars+counterUvRotChars;
*/
const interpretTextureParameters = function (name, params, conf = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.ProxyConf)()) {
  /*
  let item1 = params[0][0];
  const rot=0;
  while(uvRotChars.includes(item1[0])){
  	if(clockwiseUvRotChars.includes(item1[0])){
  		++rot;
  	}else{
  		--rot;
  	}
  	item1=item1.slice(1);
  }
  if(rot){
  	conf[`${name}_uvrot`]=(rot%4+4)%4;
  }
  */
  switch (params[0].length) {
    case 5:{
        const [img, x, y, w, h] = params[0];
        readTextureConfigurations(name, conf, img, x, y, w, h);
        break;}
    case 4:{
        const [x, y, w, h] = params[0];
        readTextureConfigurations(name, conf, null, x, y, w, h);
        break;}
    case 3:{
        const [img, x, y] = params[0];
        readTextureConfigurations(name, conf, img, x, y, '1', '1');
        break;}
    case 2:{
        const [x, y] = params[0];
        readTextureConfigurations(name, conf, null, x, y, '1', '1');
        break;}
    case 1:{
        if (isNaN(params[0][0])) {
          const img = params[0][0];
          readTextureConfigurations(name, conf, img, 0, 0, '100%', '100%');
        } else {
          const tileId = Number(params[0][0]);
          const [img, x, y] = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].deconstructTileId */ .Z.deconstructTileId(tileId);
          readTextureConfigurations(name, conf, img, x, y, '1', '1');
        }
        //conf[`${name}_img`]=img;
        //conf[`${name}_id`] = 1;
        //conf[`${name}_rect`] = new PIXI.Rectangle(x,y,w,h);
        break;}}

  if (params.animx || params.animy) {
    conf[`${name}_animData`] = { animX: Number(params.animx | 0), animY: Number(params.animy | 0) };
  }
  if (params.alpha) {
    conf[`${name}_alpha`] = Number(params.alpha);
  }
  if (params.glow) {
    if (isNaN(params.glow)) {
      conf[`${name}_glow`] = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.makeColor)(params.glow);
    } else {
      conf[`${name}_glow`] = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Color4(Number(params.glow), Number(params.glow), Number(params.glow), 1);
    }
    if (params.glowintensity) {
      conf[`${name}_glow`].a = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanNumber)(params.glowintensity);
    }
  }
  return conf;
};
_main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].interpretTextureParameters */ .Z.interpretTextureParameters = interpretTextureParameters;

function readTextureConfigurations(name, conf, img, xstr, ystr, wstr = '1', hstr = '1') {
  delete conf[`${name}_id`];
  delete conf[`${name}_img`];
  delete conf[`${name}_rect`];
  delete conf[`${name}_offset`];
  delete conf[`${name}_texture`];
  const validImg = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].validTilesheetName */ .Z.validTilesheetName(img);
  if (validImg) {img = img.toUpperCase();}
  conf[`${name}_img`] = img;
  conf[`${name}_changed`] = true;
  let hasPixelValue = false;
  let hasPercentValue = false;
  const coords = [xstr, ystr, wstr, hstr].map((str) => {
    const coord = interpretTextureCoodinate(str);
    if (coord.isPixelValue) {hasPixelValue = true;}
    if (coord.percentValue) {hasPercentValue = true;}
    return coord;
  });
  coords.forEach((coord) => {
    if (hasPixelValue) {coord.usePixelValue();}
  });
  let [xcoord, ycoord, wcoord, hcoord] = coords;
  let [x, y, w, h] = coords.map((coord) => coord.collapseValue());
  if (hasPercentValue) {
  } else if (hasPixelValue) {
    if (validImg && !xcoord.isOffsetValue && !ycoord.isOffsetValue) {
      conf[`${name}_id`] = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].constructTileId */ .Z.constructTileId(img, 1, 0);
      conf[`${name}_rect`] = new PIXI.Rectangle(x, y, w, h);
      return;
    }
  } else if (w === 1 && h === 1) {
    if ((!img || validImg) && xcoord.isOffsetValue && ycoord.isOffsetValue) {
      conf[`${name}_offset`] = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector2(Number(x), Number(y));
      return;
    }
    if (validImg && !xcoord.isOffsetValue && !ycoord.isOffsetValue) {
      conf[`${name}_id`] = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].constructTileId */ .Z.constructTileId(img, x, y);
      return;
    }
  }
  wcoord.usePixelValue();hcoord.usePixelValue();
  const textureCoords = { x: xcoord, y: ycoord, w: wcoord.collapseValue(), h: hcoord.collapseValue() };
  if (hasPercentValue) {
    textureCoords.percentRect = new PIXI.Rectangle(xcoord.percentValue, ycoord.percentValue, wcoord.percentValue, hcoord.percentValue);
  }
  conf[`${name}_texture`] = textureCoords;
}

_main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].finalizeTextureRect */ .Z.finalizeTextureRect = function (rect, width, height) {
  let { x, y, width: w, height: h } = rect;
  if (rect.percentRect) {
    const pr = rect.percentRect;
    x += pr.x * width;
    y += pr.y * height;
    w += pr.width * width;
    h += pr.height * height;
  }
  if (height) while (y >= height) {
    y -= height;
    x += width / 2;
  }
  return new PIXI.Rectangle(x, y, w, h);
};

function interpretTextureCoodinate(nstr) {
  const r = /(\+?-?)(\d+\.\d*|\d*\.?\d+)(px?|t|%)?/g;
  const coord = new TextureCoordinate();
  let match;
  while (match = r.exec(nstr)) {
    const isRelative = Boolean(match[1]);
    const isNegative = match[1].includes('-');
    let unit = (match[3] || 't')[0];
    let num = Number(match[2]);
    if (isNegative) {num *= -1;}
    if (unit === 't' && num % 1 || !match[3] && match[2].includes('.')) {num = num * (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.tileSize)();unit = 'p';}
    if (unit === 't') {
      if (isRelative) coord.offsetTileValue(num);else
      coord.setTileValue(num);
    } else if (unit === 'p') {
      if (isRelative) coord.offsetPixelValue(num);else
      coord.setPixelValue(num);
    } else if (unit === '%') {
      if (isRelative) coord.offsetPercentValue(num);else
      coord.setPercentValue(num);
    }
  }
  return coord;
}

class TextureCoordinate {
  constructor() {
    this.isPixelValue = false;
    this.baseValue = null;
    this.offsetValue = 0;
    this.percentValue = 0;
  }
  usePixelValue() {
    if (this.isPixelValue) {return;}
    this.isPixelValue = true;
    if (this.baseValue != null) {this.baseValue *= (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.tileSize)();}
    this.offsetValue *= (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.tileSize)();
  }
  setTileValue(v) {
    if (this.isPixelValue) {
      this.setPixelValue(v * (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.tileSize)());
      return;
    }
    this.baseValue = v;
  }
  setPixelValue(v) {
    this.usePixelValue();
    this.baseValue = v;
  }
  offsetTileValue(v) {
    if (this.isPixelValue) {
      this.offsetPixelValue(v * (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.tileSize)());
      return;
    }
    this.offsetValue += v;
  }
  offsetPixelValue(v) {
    this.usePixelValue();
    this.offsetValue += v;
  }
  setPercentValue(v) {
    this.usePixelValue();
    if (this.baseValue === null) {this.baseValue = 0;}
    this.percentValue = v / 100;
  }
  offsetPercentValue(v) {
    this.usePixelValue();
    this.percentValue += v / 100;
  }
  collapseValue() {
    return (this.baseValue || 0) + this.offsetValue;
  }
  get isOffsetValue() {
    return this.baseValue == null;
  }}


Object.assign(_main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
  tilesetConfigurations: {},
  async loadTilesetSettings() {
    //tileset
    this.tilesetConfigurations = {};

    _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].tilesetLoaded */ .Z.tilesetLoaded = 'loading';

    if (_main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].USE_TEXTURE_DATA */ .Z.USE_TEXTURE_DATA) {
      const tilesetNames = $gameMap.tileset().tilesetNames;
      const keyReg = /^\s*(\d+(?:-\d+)?)\s*,\s*(\d+(?:-\d+)?)\s*(?::(.*))?$/mi;
      for (let i = 0; i < tilesetNames.length; ++i) {
        const tilesetName = tilesetNames[i];
        const tilesetLetter = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].SETNAMES */ .Z.SETNAMES[i];
        if (!tilesetName) continue;
        const dataSrc = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.file)('img/tilesets/', tilesetName, 'json');
        //console.log(`trying to load tileset data from ${dataSrc}`);
        const dataFile = await _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].getDataFile */ .Z.getDataFile(dataSrc);
        //console.log(`loaded datafile ${dataFile}`);
        for (const key in dataFile) {
          let match = keyReg.exec(key);
          if (!match) continue;
          const coords = [];
          do {
            const [x1, x2 = x1] = match[1].split('-').map(Number);
            const [y1, y2 = y1] = match[2].split('-').map(Number);
            for (let kx = x1; kx <= x2; ++kx) for (let ky = y1; ky <= y2; ++ky) {
              coords.push([tilesetLetter, kx, ky]);
            }
            if (!match[3]) break;
            match = keyReg.exec(match[3]);
          } while (match);
          this.applyTilesetSettings(coords, dataFile[key]);
        }
      }
    }

    console.log("Finished loading external data");

    const lines = this.readConfigurationBlocks($gameMap.tileset().note) +
    '\n' + this.readConfigurationBlocks(this.getDataMap().note, 'm[vz]3d-tiles');
    //const readLines = /^\s*([abcde]\d?\s*,\s*\d+\s*,\s*\d+)\s*:(.*)$/gmi;
    const readLines = /^\s*([abcde]\d?)\s*,\s*(\d+(?:-\d+)?)\s*,\s*(\d+(?:-\d+)?)\s*:((?:(?:\\\n)|.)+)$/gmi;
    let match;
    while (match = readLines.exec(lines)) {
      let body = match[4].replaceAll('\\\n', ' ');
      const coords = [];
      const lastIndex = readLines.lastIndex;
      do {
        const [x1, x2 = x1] = match[2].split('-').map(Number);
        const [y1, y2 = y1] = match[3].split('-').map(Number);
        for (let kx = x1; kx <= x2; ++kx)
        for (let ky = y1; ky <= y2; ++ky) {
          coords.push([match[1], kx, ky]);
        }
        readLines.lastIndex = 0;
        match = readLines.exec(body);
        if (match) body = match[4];
      } while (match);
      readLines.lastIndex = lastIndex;
      this.applyTilesetSettings(coords, body);
    }

    _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].tilesetLoaded */ .Z.tilesetLoaded = true;

  },

  applyTilesetSettings(coords, body) {
    const conf = this.readConfigurationFunctions(body, this.tilesetConfigurationFunctions);
    for (const [img, kx, ky] of coords) {
      const tileId = this.constructTileId(img, kx, ky);
      const appliedConf = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].applyTextureConfigs */ .Z.applyTextureConfigs((0,_util_js__WEBPACK_IMPORTED_MODULE_2__.assign)({}, conf), img, kx, ky);
      this.tilesetConfigurations[tileId] ??= {};
      (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.assign)(this.tilesetConfigurations[tileId], appliedConf);
    }
  },

  mapConfigurations: {},
  loadMapSettings() {
    const dataMap = this.getDataMap();
    //map
    const mapconf = this.mapConfigurations = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.assignCopies)({}, this.MAP_DEFAULTS);
    this.readConfigurationFunctions(
    this.readConfigurationBlocks(dataMap.note),
    this.mapConfigurationFunctions,
    mapconf);

    this._REGION_DATA_MAP = {};
    const regionBlocks = this.readConfigurationBlocks(dataMap.note, 'm[vz]3d-regions');
    if (regionBlocks) {
      const readLines = /^\s*(\d+)\s*(?:,\s*(\d)(?:-(\d))?\s*)?:((?:(?:\\\n)|.)*)$/gm;
      let match;
      while (match = readLines.exec(regionBlocks)) {
        const regionId = match[1];
        const layer1 = match[2] || 1;
        const layer2 = match[3] || layer1;
        const configs = match[4].replaceAll('\\\n', ' ');
        for (let l = layer1; l <= layer2; ++l) {
          const key = `${regionId},${l}`;
          if (!(key in this._REGION_DATA_MAP)) {
            if (key in this._REGION_DATA) {
              this._REGION_DATA_MAP[key] = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.assignCopies)({}, this._REGION_DATA[key]);
            } else {
              this._REGION_DATA_MAP[key] = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.ProxyConf)();
            }
          }
          this.readConfigurationFunctions(
          configs,
          _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].tilesetConfigurationFunctions */ .Z.tilesetConfigurationFunctions,
          this._REGION_DATA_MAP[key]);

        }
      }
    }
    for (const id in this._REGION_DATA_MAP) {
      this.applyTextureConfigs(this._REGION_DATA_MAP[id], 'B', 0, 0);
      this.collapseCeilingOffsets(this._REGION_DATA_MAP[id]);
    }
  },
  applyMapSettings() {
    const mapconf = this.mapConfigurations;
    if ('fog' in mapconf) {
      const fog = mapconf.fog;
      if ('color' in fog) {this.blendFogColor.setValue(fog.color, 0);}
      if ('near' in fog) {this.blendFogNear.setValue(fog.near, 0);}
      if ('far' in fog) {this.blendFogFar.setValue(fog.far, 0);}
      this.blendFogColor.update();
    }
    if ('light' in mapconf) {
      this.blendAmbientColor.setValue(mapconf.light.color, 0);
      //this.blendLightIntensity.setValue(mapconf.light.intensity,0);
    }
    if ('cameraDist' in mapconf) {
      this.blendCameraDist.setValue(mapconf.cameraDist, 0);
    }
    if ('cameraHeight' in mapconf) {
      this.blendCameraHeight.setValue(mapconf.cameraHeight, 0);
    }
    if ('cameraMode' in mapconf) {
      this.cameraMode = mapconf.cameraMode;
    }
    if ('cameraPitch' in mapconf) {
      this.blendCameraPitch.setValue(mapconf.cameraPitch, 0);
    }
    if ('cameraYaw' in mapconf) {
      this.blendCameraYaw.setValue(mapconf.cameraYaw, 0);
    }

    this.callFeatures('applyMapSettings', mapconf);
  },

  beforeMapLoad(newmap) {
    if (newmap) {
      delete _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].$saveData.disabled */ .Z.$saveData.disabled;
      delete $gamePlayer.mv3d_data.z;
    }
    this.callFeatures('beforeMapLoad', newmap);
  },

  afterMapLoad(newmap) {
    _blenders_js__WEBPACK_IMPORTED_MODULE_3__/* .Blender.reset */ .j$.reset();

    _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].updateClearColor */ .Z.updateClearColor();

    this.callFeatures('afterMapLoad', newmap);
  },


  getMapConfig(key, dfault) {
    return this.getConfig(this.mapConfigurations, key, dfault);
  },

  getConfig(conf, key, dfault) {
    var value = dfault;
    if (conf[key] != null) {
      value = conf[key];
    }
    if (value instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector2 || value instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3) {
      value = value.clone();
      for (let key in value) {
        value[key] = this._finalizeConfig(conf, value[key]);
      }
    } else {
      value = this._finalizeConfig(conf, value);
    }
    return value;
  },

  _finalizeConfig(conf, value) {
    if (value instanceof _util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression) {
      const x = conf._x || 0;
      const y = conf._y || 0;
      const l = conf._l || 0;
      const r = (l + 1) * 10 + x * 10 + y * 1000 + $gameMap._mapId * 10000;
      value = value.evaluate({
        ..._util_js__WEBPACK_IMPORTED_MODULE_2__._default_scope,
        x, y, l,
        r: (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.hashRand)(r),
        rand(n = 0) {return (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.hashRand)(r + n);} });

    }
    return value;
  },

  finalizeConfigs(conf) {
    const newconf = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.ProxyConf)();
    for (const key in conf) {
      newconf[key] = this.getConfig(conf, key, undefined);
    }
    return newconf;
  },

  getCeilingConfig(tileConf = {}) {
    let conf = {};
    const reassign = (entry) => {
      const [key, value] = entry;
      if (key.startsWith('ceiling_')) {
        conf[key.replace('ceiling_', 'bottom_')] = value;
      }
    };
    Object.entries(this.mapConfigurations).forEach(reassign);
    Object.entries(tileConf).forEach(reassign);
    const getConfig = (key, dfault) => {
      return this.getConfig(tileConf, key, this.getMapConfig(key, dfault));
    };
    conf.bottom_id = getConfig('ceiling_id', 0);
    conf.height = getConfig('ceiling_height', this.CEILING_HEIGHT);
    conf.twosided = getConfig('ceiling_backface', true);
    conf.isCeiling = true;
    return conf;
  },

  readConfigurationBlocksAndTags(note, tag = 'm[vz]3d') {
    const findBlocks = new RegExp(`<${tag}>([\\s\\S]*?)</${tag}>|<${tag}[: ](.*?)>`, 'gi');
    let contents = '';
    let match;
    while (match = findBlocks.exec(note)) {
      contents += (match[1] ?? match[2]) + '\n';
    }
    return contents;
  },

  get readConfigurationBlocks() {return this.readConfigurationBlocksAndTags;},
  get readConfigurationTags() {return this.readConfigurationBlocksAndTags;},

  readConfigurationFunctions(full_line, functionset = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].tilesetConfigurationFunctions */ .Z.tilesetConfigurationFunctions, conf = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.ProxyConf)()) {
    if (!conf._isProxied) {
      conf = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.ProxyConf)(conf);
    }
    // find start of function
    const r = /([a-z_]\w*)\s*\(/i;
    let line = full_line;
    let match;
    conf.functionset = functionset;
    // loop through each character to find end of function, allowing nested parentheses
    while (match = line.match(r)) {
      line = line.substr(match.index + match[0].length);
      const content = (0,_util_parsing_js__WEBPACK_IMPORTED_MODULE_4__.parseNestedParentheses)('(', ')', line, { replaceCommas: true });
      const key = match[1].toLowerCase();
      line = line.substr(content.length + 1); //the +1 is for the closing ')'
      // run the function
      if (key in functionset) {
        if (functionset[key] instanceof ConfigurationFunction) {
          functionset[key].run(conf, content);
        } else {
          const args = content.split('，');
          if (args.length === 1 && args[0] === '') {args.length = 0;}
          functionset[key](conf, ...args);
        }
      }
    }
    delete conf._proxyTarget.functionset;
    return conf;
  },
  get configurationSides() {return this.enumSides;},
  get configurationShapes() {return this.enumShapes;},
  get configurationPassage() {return this.enumPassage;},
  enumSides: {
    front: _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .FRONTSIDE */ .UP,
    back: _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .BACKSIDE */ .Ym,
    double: _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .DOUBLESIDE */ .FO },

  enumShapes: {
    FLAT: 1,
    TREE: 2,
    BOARD: 2,
    BILLBOARD: 2,
    CARDBOARD: 2,
    SPRITE: 3,
    FENCE: 4,
    WALL: 5,
    CROSS: 6,
    XCROSS: 7,
    '8CROSS': 8,
    SLOPE: 9,
    MESH: 91,
    MODEL: 92 },

  enumPassage: {
    WALL: 0,
    FLOOR: 1,
    THROUGH: 2 },

  enumRenderGroups: {
    BACK: 0,
    MAIN: 1,
    FRONT: 2 },

  enumModelOptimization: {
    NONE: 0,
    INSTANCING: 1,
    CLONING: 2 },

  enumSpecularMode: {
    WHITE: 0,
    SAME_AS_DIFFUSE: 1,
    AVERAGE_DIFFUSE: 2 },


  tilesetConfigurationFunctions: {
    width(conf, n) {if (n) conf.width = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    height(conf, n) {conf.height = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    depth(conf, n) {conf.depth = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    fringe(conf, n) {conf.fringe = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    float(conf, n) {conf.float = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    slope: new ConfigurationFunction(`n,d|top{${textureParameters}},side{${textureParameters}}|texrot`, function (conf, params) {
      let { n, d, top, side, texrot } = params;
      if (n) {
        delete conf.dynamicOffset;
        delete conf.dynamicOffsetPitch;
        conf.shape = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumShapes.SLOPE */ .Z.enumShapes.SLOPE;
        conf.slopeHeight = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);
      }
      if (d) {
        d = d.toLowerCase();
        //conf.slopeDirection=({n:2, s:8, e:4, w:6})[d.toLowerCase()[0]];
        let sd = 5;
        if (d.includes('n')) {sd -= 3;} else
        if (d.includes('s')) {sd += 3;}
        if (d.includes('e')) {sd -= 1;} else
        if (d.includes('w')) {sd += 1;}
        conf.slopeDirection = sd;
        if (d.includes('i')) conf.slopeInner = true;else
        if (d.includes('o')) conf.slopeOuter = true;

      }
      if (top) {
        interpretTextureParameters('slopeTop', top, conf);
      }
      if (side) {
        interpretTextureParameters('slopeSide', side, conf);
      }
      if (texrot) {
        conf.slopeTexrot = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(texrot);
        if (conf.slopeTexrot) conf.slopeTexrotDiag = texrot.toLowerCase() !== 'basic';
      }
    }),
    slant(conf, n) {
      conf.slant = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);
    },
    top: TextureConfigurator('top'),
    side: TextureConfigurator('side'),
    inside: TextureConfigurator('inside'),
    bottom: TextureConfigurator('bottom'),
    north: TextureConfigurator('north'),
    south: TextureConfigurator('south'),
    east: TextureConfigurator('east'),
    west: TextureConfigurator('west'),
    texture: Object.assign(TextureConfigurator('hybrid'), {
      func(conf, params) {
        _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].tilesetConfigurationFunctions.top.func */ .Z.tilesetConfigurationFunctions.top.func(conf, params);
        _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].tilesetConfigurationFunctions.side.func */ .Z.tilesetConfigurationFunctions.side.func(conf, params);
      } }),

    get ceiling() {return _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].mapConfigurationFunctions.ceiling */ .Z.mapConfigurationFunctions.ceiling;},
    shape(conf, name, data) {
      delete conf.dynamicOffset;
      delete conf.dynamicOffsetPitch;
      conf.shape = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumShapes */ .Z.enumShapes[name.toUpperCase()];
      if (conf.shape === _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumShapes.SLOPE */ .Z.enumShapes.SLOPE && (data || !('slopeHeight' in conf))) {conf.slopeHeight = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(data) || 1;}
      if (data) {
        switch (conf.shape) {
          case _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumShapes.FENCE */ .Z.enumShapes.FENCE:conf.fencePosts = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(data);break;
          case _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumShapes.SPRITE */ .Z.enumShapes.SPRITE:
          case _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumShapes.BOARD */ .Z.enumShapes.BOARD:
            _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].eventConfigurationFunctions.doff */ .Z.eventConfigurationFunctions.doff(conf, data);
            break;}

      }
    },
    alpha(conf, n) {
      conf.transparent = true;
      conf.alpha = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);
    },
    get glow() {return _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].eventConfigurationFunctions.glow */ .Z.eventConfigurationFunctions.glow;},
    ambient(conf, c) {
      if (isNaN(c)) {
        conf.ambient = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.makeColor)(c);
      } else {
        conf.ambient = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Color3(Number(c), Number(c), Number(c));
      }
    },
    pass(conf, s = '') {
      s = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.falseString)(s.toLowerCase());
      if (!s || s[0] === 'x') {
        conf.pass = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumPassage.WALL */ .Z.enumPassage.WALL;
      } else if (s[0] === 'o') {
        conf.pass = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumPassage.FLOOR */ .Z.enumPassage.FLOOR;
      } else {
        conf.pass = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumPassage.THROUGH */ .Z.enumPassage.THROUGH;
      }
    },
    shadow(conf, b = true) {
      conf.shadow = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(b);
    },

    rot(conf, n) {conf.rot = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    yaw(conf, n) {conf.yaw = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    pitch(conf, n) {conf.pitch = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    roll(conf, n) {conf.roll = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},


    get xoff() {return _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].eventConfigurationFunctions.xoff */ .Z.eventConfigurationFunctions.xoff;},
    get yoff() {return _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].eventConfigurationFunctions.yoff */ .Z.eventConfigurationFunctions.yoff;},
    get zoff() {return _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].eventConfigurationFunctions.zoff */ .Z.eventConfigurationFunctions.zoff;},
    get offset() {return _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].eventConfigurationFunctions.offset */ .Z.eventConfigurationFunctions.offset;},
    get doff() {return _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].eventConfigurationFunctions.doff */ .Z.eventConfigurationFunctions.doff;},

    tileoffset: new ConfigurationFunction('x,y', function (conf, params) {
      const { x = 0, y = 0 } = params;
      conf.tileOffset = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector2(+x, +y);
      conf.pass = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumPassage.THROUGH */ .Z.enumPassage.THROUGH;
    }) },

  eventConfigurationFunctions: {
    height(conf, n) {
      const height = Number(n);
      if (height < 0) {
        conf.zoff = height;
      } else {
        conf.height = height;
      }
      (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.deprecated)('event config height() is deprecated. Use elevation(), offset(), or zoff() instead.');
    },
    elevation(conf, n) {conf.height = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    z(conf, n) {conf.zlock = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    x(conf, n) {conf.xoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);(0,_util_js__WEBPACK_IMPORTED_MODULE_2__.deprecated)('event config x() is deprecated. Use offset() or xoff() instead.');},
    y(conf, n) {conf.yoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);(0,_util_js__WEBPACK_IMPORTED_MODULE_2__.deprecated)('event config y() is deprecated. Use offset() or yoff() instead.');},
    xoff(conf, n) {conf.xoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    yoff(conf, n) {conf.yoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    zoff(conf, n) {conf.zoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},
    offset: new ConfigurationFunction('x,y,z', function (conf, params) {
      if (params.x) conf.xoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.x);
      if (params.y) conf.yoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.y);
      if (params.z) conf.zoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.z);
    }),
    doff(conf, n) {
      const offset = parseFloat(n);
      if (!isNaN(offset)) conf.dynamicOffset = offset;
      conf.dynamicOffsetPitch = String(n).includes('p');
      //if(conf.shape) conf.dynamicOffsetShape = conf.shape;
    },
    pos: new ConfigurationFunction('x,y,z', function (conf, params) {
      if (!conf.pos) {conf.pos = {};}
      if (params.x) {conf.pos.x = params.x;}
      if (params.y) {conf.pos.y = params.y;}
      if (params.z) {conf.pos.z = params.z;}
    }),
    scale(conf, x, y = x) {conf.scale = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector2((0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(x), (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(y));},
    scale: new ConfigurationFunction('x,y,z', function (conf, params) {
      let { x, y, z } = params;
      if (z) {
        x ||= 1;
        y ||= 1;
        conf.scale = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3((0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(x), (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(y), (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(z));
      } else if (y) {
        x ||= 1;
        conf.scale = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector2((0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(x), (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(y));
      } else if (x) {
        conf.scale = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector2((0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(x), (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(x));
      }
    }),

    rot: configureAutoRotation('rot', 'autoRot'),
    yaw: configureAutoRotation('yaw', 'autoRot'),
    pitch: configureAutoRotation('pitch', 'autoPitch'),
    roll(conf, n) {conf.roll = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);},

    bush(conf, bool) {conf.bush = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(bool);},
    shadow: new ConfigurationFunction('size,dist|3d', function (conf, params) {
      let { size, dist, '3d': dyn } = params;
      if (dyn == null) {dyn = size == null || isFinite(size) ? true : size;}
      conf.dynShadow = dyn = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(dyn);
      if (size != null) {conf.shadow = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanNumber)(size);}
      if (dist != null) {conf.shadowDist = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(dist);}
    }),
    get shape() {return _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].tilesetConfigurationFunctions.shape */ .Z.tilesetConfigurationFunctions.shape;},
    lamp: new ConfigurationFunction('color,intensity,range|shadow', function (conf, params) {
      const { color = 'white', intensity = 1, range = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].LIGHT_DIST */ .Z.LIGHT_DIST } = params;
      conf.lamp = { color: (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.makeColor)(color).toNumber(), intensity: (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(intensity), distance: (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(range) };
      if (params.shadow) {conf.lamp.shadow = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(params.shadow);}
    }),
    flashlight: new ConfigurationFunction('color,intensity,range,angle[dir]yaw,pitch|shadow', function (conf, params) {
      const { color = 'white', intensity = 1, range = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].LIGHT_DIST */ .Z.LIGHT_DIST, angle = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].LIGHT_ANGLE */ .Z.LIGHT_ANGLE } = params;
      conf.flashlight = { color: (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.makeColor)(color).toNumber(), intensity: (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(intensity), distance: (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(range), angle: (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(angle) };
      if (params.yaw) {conf.flashlightYaw = params.yaw;}
      if (params.pitch) {conf.flashlightPitch = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.pitch);}
      if (params.shadow) {conf.flashlight.shadow = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(params.shadow);}
    }),
    flashlightpitch(conf, deg = '90') {conf.flashlightPitch = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(deg);},
    flashlightyaw(conf, deg = '+0') {conf.flashlightYaw = deg;},
    lightoffset: new ConfigurationFunction('x,y,z', function (conf, params) {
      if (params.x) {conf.lampXoff = conf.flashlightXoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.x);}
      if (params.y) {conf.lampYoff = conf.flashlightYoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.y);}
      if (params.z) {conf.lampZoff = conf.flashlightZoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.z);}
    }),
    lampoffset: new ConfigurationFunction('x,y,z', function (conf, params) {
      if (params.x) {conf.lampXoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.x);}
      if (params.y) {conf.lampYoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.y);}
      if (params.z) {conf.lampZoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.z);}
    }),
    flashlightoffset: new ConfigurationFunction('x,y,z', function (conf, params) {
      if (params.x) {conf.flashlightXoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.x);}
      if (params.y) {conf.flashlightYoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.y);}
      if (params.z) {conf.flashlightZoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(params.z);}
    }),
    lightheight(conf, n = 1) {
      (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.deprecated)('event lightHeight() is deprecated. Use lightOffset(z:) instead.');
      conf.lampZoff = conf.flashlightZoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);
    },
    lampheight(conf, n = 1) {
      conf.lampZoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);
      (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.deprecated)('event lampHeight() is deprecated. Use lampOffset(z:) instead.');
    },
    flashlightheight(conf, n = 1) {
      (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.deprecated)('event flashlightheight() is deprecated. Use flashlightOffset(z:) instead.');
      conf.flashlightZoff = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);
    },

    alpha(conf, n) {
      conf.alpha = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);
    },
    glow(conf, n, a = 1) {
      if (isNaN(n)) {
        conf.glow = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.makeColor)(n);
      } else {
        conf.glow = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Color4(Number(n), Number(n), Number(n), 1);
      }
      conf.glow.a = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanNumber)(a);
    },
    get ambient() {return _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].tilesetConfigurationFunctions.ambient */ .Z.tilesetConfigurationFunctions.ambient;},
    dirfix(conf, b) {
      conf.dirfix = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(b);
    },
    gravity(conf, b) {
      conf.gravity = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanNumber)(b);
    },
    platform(conf, b) {
      conf.platform = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(b);
    },
    collide(conf, n) {conf.collide = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanNumber)(n);},
    trigger(conf, up, down = 0) {
      conf.trigger = {
        up: Number(up),
        down: Number(down) };

    },
    pass(conf, s = '') {
      s = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.falseString)(s.toLowerCase());
      if (!s || s[0] === 'x') {
        conf.platform = false;
        conf.collide = true;
      } else if (s[0] === 'o') {
        conf.platform = true;
        if (conf.collide === false || conf.collide == null) conf.collide = true;
      } else {
        conf.platform = false;
        conf.collide = false;
      }
    },
    texture: TextureConfigurator('texture', null, function (conf, params) {
      _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].applyEventTextureSideConfigs */ .Z.applyEventTextureSideConfigs(conf, 'texture');
      conf.texture_symbol = createTextureSymbol(conf, 'texture');
    }) },

  mapConfigurationFunctions: {
    get ambient() {return this.light;},
    light(conf, color) {
      if (color.toLowerCase() === 'default') {color = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].AMBIENT_COLOR */ .Z.AMBIENT_COLOR;} else
      {color = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.makeColor)(color).toNumber();}
      conf.light = { color: color };
    },
    fog: new ConfigurationFunction('color|near,far', function (conf, params) {
      const { color, near, far } = params;
      if (!conf.fog) {conf.fog = {};}
      if (color) {conf.fog.color = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.makeColor)(color).toNumber();}
      if (near) {conf.fog.near = Number(near);}
      if (far) {conf.fog.far = Number(far);}
    }),
    camera: new ConfigurationFunction('yaw,pitch|dist|height|mode', function (conf, params) {
      const { yaw, pitch, dist, height, mode } = params;
      if (yaw) {conf.cameraYaw = Number(yaw);}
      if (pitch) {conf.cameraPitch = Number(pitch);}
      if (dist) {conf.cameraDist = Number(dist);}
      if (height) {conf.cameraHeight = Number(height);}
      if (mode) {conf.cameraMode = mode;}
    }),
    ceiling: TextureConfigurator('ceiling', 'height,backface', function (conf, params) {
      if (params.height) {
        conf[`ceiling_height`] = Number(params.height);
      }
      if (params.backface) {
        conf[`ceiling_backface`] = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(params.backface);
      }
    }),
    edge(conf, b, data) {
      b = b.toLowerCase();
      switch (b) {
        case 'clamp':
          conf.edgeData = data == null ? 1 : Number(data);
          conf.edge = b;
          break;
        default:
          conf.edge = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(b);}

    },
    disable(conf, b = true) {
      conf.disabled = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(b);
    },
    enable(conf, b = true) {
      conf.disabled = !(0,_util_js__WEBPACK_IMPORTED_MODULE_2__.booleanString)(b);
    },
    base(conf, n) {
      conf.baseHeight = Number(n);
    } },


  validTilesheetName(img) {
    return /^(?:a[12345]|[bcde])$/i.test(img);
  },
  applyTextureConfigs(conf, img, tx, ty) {
    for (const side of ['top', 'side', 'inside', 'bottom', 'north', 'south', 'east', 'west', 'ceiling']) {
      this.applyTextureSideConfigs(conf, side, img, tx, ty);
    }
    for (const side of ['slopeTop', 'slopeSide']) {
      if (!conf[`${side}_changed`]) {continue;}
      this.applyTextureSideConfigs(conf, side, img, tx, ty);
    }
    this.callFeatures('applyTextureConfigs', conf, img, tx, ty);
    return conf;
  },
  applyTextureSideConfigs(conf, side, img, tx, ty) {
    let textureCoords = conf[`${side}_texture`];
    if (conf[`${side}_img`]) {img = conf[`${side}_img`];}
    //else{ conf[`${side}_img`]=img; }
    if (textureCoords) {
      const { x: xcoord, y: ycoord, w, h } = textureCoords;
      if (!xcoord.isPixelValue) {
        if (xcoord.isOffsetValue) {tx += xcoord.offsetValue;} else
        {tx = xcoord.collapseValue();}
      }
      if (!ycoord.isPixelValue) {
        if (ycoord.isOffsetValue) {ty += ycoord.offsetValue;} else
        {ty = ycoord.collapseValue();}
      }
      let corner;
      const validImg = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].validTilesheetName */ .Z.validTilesheetName(img);
      if (validImg) {
        let id = this.constructTileId(img, tx, ty);
        corner = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].getTileCorner */ .Z.getTileCorner(id);
        corner.x *= (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.tileWidth)();corner.y *= (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.tileHeight)();
      } else {
        corner = { x: tx * (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.tileWidth)(), y: ty * (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.tileHeight)() };
      }
      if (xcoord.isPixelValue) {
        if (xcoord.isOffsetValue) {corner.x += xcoord.offsetValue;} else
        {corner.x = xcoord.collapseValue();}
      }
      if (ycoord.isPixelValue) {
        if (ycoord.isOffsetValue) {corner.y += ycoord.offsetValue;} else
        {corner.y = ycoord.collapseValue();}
      }

      const rect = new PIXI.Rectangle(corner.x, corner.y, w, h);
      if (textureCoords.percentRect) {
        rect.percentRect = textureCoords.percentRect;
      }
      conf[`${side}_id`] = validImg ? _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].constructTileId */ .Z.constructTileId(img, 1, 0) : 1;
      conf[`${side}_rect`] = rect;
    }
  },
  collapseCeilingOffsets(conf) {
    const img = conf.ceiling_img || 'B';
    let defaultTileId = `TILE_ID_${img}` in Tilemap ? Tilemap[`TILE_ID_${img}`] : 0;
    this._tileTextureOffset(conf, 'ceiling', defaultTileId, defaultTileId);
  },
  applyEventTextureSideConfigs(conf, side) {
    const tileId = conf._eventTileId || 0;
    const [img, tx, ty] = _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].deconstructTileId */ .Z.deconstructTileId(tileId);
    _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].applyTextureSideConfigs */ .Z.applyTextureSideConfigs(conf, side, img, tx, ty);
    _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"]._tileTextureOffset */ .Z._tileTextureOffset(conf, side, tileId, tileId);
  },
  applyCropTexture(conf, side, opts) {
    const configRect = conf[`${side}_rect`];
    if (!configRect) {return;}
    conf.cropTexture = configRect;
    if (opts) {
      if (opts.flip) {
        conf.cropTexture.y++;
        conf.cropTexture.height *= -1;
        if (conf.cropTexture.percentRect) {
          conf.cropTexture.percentRect.height *= -1;
        }
      }
    }
  },


  defaultEventConfigurations: {
    glow: new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Color4(0, 0, 0, 0),
    alpha: 1,
    ambient: _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Color3.White(),
    gravity: _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].GRAVITY */ .Z.GRAVITY,
    shadow: 1,

    xoff: 0,
    yoff: 0,
    zoff: 0,
    height: 0,
    scale: new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector2(1, 1),
    rot: 0,
    roll: 0,
    yaw: 0,
    pitch: 0,


    height() {
      return this.blendElevation.currentValue();
    },

    lamp() {
      return this.lamp ? {
        color: this.blendLampColor.currentValue(),
        intensity: this.blendLampIntensity.currentValue(),
        distance: this.blendLampDistance.currentValue() } :
      { color: 0, intensity: 0, distance: 0 };
    },
    flashlight() {
      return this.flashlight ? {
        color: this.blendFlashlightColor.currentValue(),
        intensity: this.blendFlashlightIntensity.currentValue(),
        distance: this.blendFlashlightDistance.currentValue(),
        angle: this.blendFlashlightAngle.currentValue() } :
      { color: 0, intensity: 0, distance: 0, angle: _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].LIGHT_ANGLE */ .Z.LIGHT_ANGLE };
    },
    flashlightPitch() {return this.flashlight ? this.blendFlashlightPitch.currentValue() : 0;},
    flashlightYaw() {return this.flashlight ? this.blendFlashlightYaw.currentValue() : 0;},
    lampXoff: 0,
    lampYoff: 0,
    lampZoff: 0,
    flashlightXoff: 0,
    flashlightYoff: 0,
    flashlightZoff: 0,

    zlock() {return this.z;},
    dynamicOffset() {
      return this.model.shape === _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].enumShapes.SPRITE */ .Z.enumShapes.SPRITE ? _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].SPRITE_OFFSET */ .Z.SPRITE_OFFSET : 0;
    } } });




// event config
const _event_setupPage = Game_Event.prototype.setupPage;
Game_Event.prototype.setupPage = function () {
  _event_setupPage.apply(this, arguments);
  if (this.mv3d_sprite) {
    this.mv3d_needsConfigure = true;
    this.mv3d_sprite.eventConfigure();
  }
};

Object.defineProperty(Game_CharacterBase.prototype, 'mv3d_data', {
  get() {
    this._mv3d_data ??= {};
    return this._mv3d_data;
  } });

Object.defineProperty(Game_CharacterBase.prototype, 'mv3d_temp', {
  get() {
    if (!Object.hasOwn(this, 'mv3d_temp')) Object.defineProperty(this, 'mv3d_temp', {
      value: {},
      enumerable: false,
      configurable: true });

    return this.mv3d_temp;
  },
  enumerable: false,
  configurable: true });


const _event_init = Game_Event.prototype.initialize;
Game_Event.prototype.initialize = async function () {
  _event_init.apply(this, arguments);
  const event = this.event();
  let config = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.ProxyConf)();
  _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].readConfigurationFunctions */ .Z.readConfigurationFunctions(
  _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].readConfigurationTags */ .Z.readConfigurationTags(event.note),
  _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].eventConfigurationFunctions */ .Z.eventConfigurationFunctions,
  config);

  if ('pos' in config) {
    const pos = config.pos;
    if ('x' in pos || 'y' in pos) {
      this.locate(
      (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.relativeNumber)(event.x, pos.x),
      (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.relativeNumber)(event.y, pos.y));

    }
    if ('z' in pos) {
      this.mv3d_data.z = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.relativeNumber)(_main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].getWalkHeight */ .Z.getWalkHeight(event.x, event.y), pos.z);
    }
  }
  this.mv3d_data.blenders ??= this.mv3d_blenders ?? {};
  const blenders = this.mv3d_data.blenders;
  if ('lamp' in config) {
    blenders.lampColor_r = config.lamp.color >> 16;
    blenders.lampColor_g = config.lamp.color >> 8 & 0xff;
    blenders.lampColor_b = config.lamp.color & 0xff;
    blenders.lampIntensity = config.lamp.intensity;
    blenders.lampDistance = config.lamp.distance;
  }
  if ('flashlight' in config) {
    blenders.flashlightColor_r = config.flashlight.color >> 16;
    blenders.flashlightColor_g = config.flashlight.color >> 8 & 0xff;
    blenders.flashlightColor_b = config.flashlight.color & 0xff;
    blenders.flashlightIntensity = config.flashlight.intensity;
    blenders.flashlightDistance = config.flashlight.distance;
    blenders.flashlightAngle = config.flashlight.angle;
  }
  if ('flashlightPitch' in config) {
    blenders.flashlightPitch = Number(config.flashlightPitch);
  }
  if ('flashlightYaw' in config) {
    blenders.flashlightYaw = config.flashlightYaw;
  }
  this.mv3d_needsConfigure = true;

  await (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.sleep)();
  if (_main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].mapLoaded */ .Z.mapLoaded) {
    _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].createCharacterFor */ .Z.createCharacterFor(this);
  }
};

function createTextureSymbol(conf, name = 'texture') {
  if (!conf[`${name}_changed`]) return '';
  const img = conf[`${name}_img`];
  const id = conf[`${name}_id`];

  const rect = conf[`${name}_rect`];
  let rectKey = rect ? createRectString(rect) : '';

  const alpha = conf[`${name}_alpha`];
  const glow = conf[`${name}_glow`];
  const animData = conf[`${name}_animData`];

  return arrayToSymbol([
  img || _main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].getSetName */ .Z.getSetName(id) || '',
  id ?? '',
  rectKey,
  alpha ?? '',
  glow ? glow.toHexString() : '',
  animData ? `${animData.animX},${animData.animY}` : '']);

}
_main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].createTextureSymbol */ .Z.createTextureSymbol = createTextureSymbol;

function createRectString(rect) {
  let rectKey;
  if (rect.percentRect) {
    rectKey = `${rect.x}%${rect.percentRect.x},${rect.y}%${rect.percentRect.y},${rect.width}%${rect.percentRect.width},${rect.height}%${rect.percentRect.height}`;
  } else {
    rectKey = `${rect.x},${rect.y},${rect.width},${rect.height}`;
  }
  return rectKey;
}
_main_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"].createRectString */ .Z.createRectString = createRectString;

function configureAutoRotation(rot, autoRot) {
  return function (conf, n, speed) {
    if (String(n).toLowerCase() === 'auto') {
      conf[rot] = 0;
      conf[autoRot] = true;
    } else if (String(n).startsWith('+')) {
      conf[autoRot] = true;
      conf[rot] = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);
    } else {
      conf[autoRot] = false;
      conf[rot] = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(n);
    }
    if (speed && conf[autoRot]) {
      conf.autoRotSpeed = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.MathExpression)(speed);
    }
  };
}

function relativeConfig(conf, n) {

}

const arrayToSymbol = (arr, sep = '|') => arr.map((s) => s instanceof Array ? arrayToSymbol(s, ',') : String(s ?? '')).join(sep).replace(new RegExp(`[${sep}]+$`), '');

/***/ }),

/***/ "./src/data.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

const { mean } = __webpack_require__("./node_modules/mathjs/lib/cjs/index.js");
const { file, sleepUntil, filename } = __webpack_require__("./src/util.js");

const mz3d = window.mz3d;

//const isPlaytest = Utils.isOptionValid('test');

const isPlaytest =  true && typeof process === 'object' && Object.prototype.toString.call(process) === '[object process]';
Object.defineProperty(mz3d, 'isPlaytest', {
  value: isPlaytest });


// polyfill fs.promises
if (isPlaytest) {
  const fs = __webpack_require__("fs");
  if (!fs.promises) {
    const util = __webpack_require__("util");
    fs.promises = new Proxy(fs, {
      get(target, property) {
        if (property in target && typeof target[property] === 'function') {
          if (!target[property]._mv3d_promisified) target[property]._mv3d_promisified = util.promisify(target[property]);
          return target[property]._mv3d_promisified;
        }
        return target[property];
      } });

  } else {
    if (!fs.promises.constants) {
      fs.promises.constants = fs.constants;
    }
  }
}

/*
new DataProxy('mv3d_data','mv3d_data.json',()=>({
	id: (()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,a=>(a^Math.random()*16>>a/4).toString(16)))(),
}));
*/

class DataFile {
  constructor(fileName) {
    this._data_handler = {
      get: (target, key) => {
        if (target[key] && typeof target[key] === 'object') {
          return new Proxy(target[key], this._data_handler);
        } else {
          return target[key];
        }
      },
      set: (target, key, value) => {
        target[key] = value;
        this.save();
      },
      deleteProperty: (target, key) => {
        delete target[key];
        this.save();
      } };

    this._writing = false;
    this._needsWrite = false;
    this.fileName = file('./data/', fileName, 'json');
  }
  async initialize(defaultData = {}) {
    try {
      this._data = await DataFile.load(this.fileName);
    } catch (err) {
      console.error(err);
      this._data = typeof defaultData === 'function' ? defaultData() : defaultData;
    }
  }
  async save() {
    if (!isPlaytest) {return;}
    this._needsWrite = true;
    if (this._writing) await sleepUntil(() => !this._writing);
    if (this._needsWrite) {
      this._needsWrite = false;
      this._writing = true;
      await DataFile.save(this.fileName, JSON.stringify(this._data));
      this._writing = false;
    }
  }

  static async save(fileName, fileData) {
    if (!isPlaytest) return;
    const fs = (__webpack_require__("fs").promises);
    const path = __webpack_require__("path");
    const filePath = path.resolve(global.__dirname, fileName);
    //await this.ensureDirectory(path.dirname(filePath));
    if (this.writable(filePath)) {
      await fs.writeFile(filePath, fileData);
    }
  }
  static async ensureDirectory(dirName) {
    if (!isPlaytest) return;
    const fs = (__webpack_require__("fs").promises);
    const path = __webpack_require__("path");
    fs.mkdir(path.resolve(global.__dirname, dirName), { recursive: true });
  }
  static async load(fileName, defaultData = {}) {
    const filePath = file('./data/', fileName, 'json');
    if (!(await mz3d.checkFileExists(filePath))) {
      return typeof defaultData === 'function' ? defaultData() : defaultData;
    }
    const response = await fetch(filePath);
    return await response.json();
  }
  static async writable(fileName) {
    if (!isPlaytest) return false;
    const fs = (__webpack_require__("fs").promises);
    const path = __webpack_require__("path");
    try {
      await fs.access(path.dirname(fileName), fs.constants.W_OK);
      return true;
    } catch (err) {
      return false;
    }
  }}


DataFile.instances = {};
DataFile.proxies = {};

Object.assign(mz3d, {
  async getDataFile(fileName, defaultData = {}) {
    fileName = file('./data/', fileName, 'json');
    if (fileName in DataFile.instances) {
      const dataFile = DataFile.instances[fileName];
      if (!dataFile._data) await sleepUntil(() => Boolean(dataFile._data));
      if (isPlaytest && fileName in DataFile.proxies) {
        return DataFile.proxies[fileName];
      } else {
        return dataFile._data;
      }
    }
    const dataFile = new DataFile(fileName);
    DataFile.instances[fileName] = dataFile;
    await dataFile.initialize(defaultData);
    if (isPlaytest && (await DataFile.writable(fileName))) {
      const proxy = new Proxy(dataFile._data, dataFile._data_handler);
      DataFile.proxies[fileName] = proxy;
      return proxy;
    } else {
      return dataFile._data;
    }
  } });




class DatabaseFile extends DataFile {
  constructor(varName, fileName, defaultData) {
    super(fileName);
    this.varName = varName;
    if (defaultData) {
      this.initialize(defaultData);
    }
  }
  initialize(defaultData = {}) {
    if (isPlaytest) {
      const fs = __webpack_require__("fs");
      const path = __webpack_require__("path");
      const filePath = path.resolve(global.__dirname, this.fileName);
      if (!fs.existsSync(filePath)) {
        fs.writeFileSync(filePath, JSON.stringify(typeof defaultData === 'function' ? defaultData() : defaultData));
      }
    }
    DatabaseFile.list.push(this);
  }

  setup() {
    this._data = window[this.varName];
    if (isPlaytest) {
      window[this.varName] = new Proxy(this._data, this._data_handler);
    }
  }}


DatabaseFile.list = [];

const _onBoot = Scene_Boot.prototype.start;
Scene_Boot.prototype.start = function () {
  _onBoot.apply(this, arguments);
  for (const dbFile of DatabaseFile.list) {
    dbFile.setup();
  }
};

/***/ }),

/***/ "./src/feature-effekseer.js":
/***/ (() => {

// NOTE: This file should only be imported in MZ
const mz3d = window.mz3d;
const effekseer = window.effekseer;
const { Feature } = mz3d;
const { override, degtorad } = mz3d.util;
const { Vector3, PostProcess } = window.BABYLON;

let context;

let renderOnTop = false;

new Feature('effekseer', {
  setup() {
    context = Graphics._effekseer;
  },

  render() {
    if (renderOnTop) return;
    render();
  },
  afterRender() {
    if (!renderOnTop) return;
    render();
  } });


function render() {
  if (!using3DContext) {return;}
  context.setProjectionMatrix(mz3d.camera._projectionMatrix.toArray());
  context.setCameraMatrix(mz3d.camera.getWorldMatrix().invert().toArray());
  context.draw();
}

let using3DContext = false;

function releaseAllEffects() {
  for (const key in EffectManager._cache) {
    Graphics.effekseer.releaseEffect(EffectManager._cache[key]);
    delete EffectManager._cache[key];
  }
}

function releaseContext() {
  if (Graphics.effekseer) {
    releaseAllEffects();
    effekseer.releaseContext(Graphics.effekseer);
  }
}

function createContext() {
  releaseContext();
  context = effekseer.createContext();
  Graphics._effekseer = context;
}

function create3DContext() {
  createContext();
  using3DContext = true;
  context.init(mz3d.context);
}

function create2DContext() {
  createContext();
  using3DContext = false;
  context.init(Graphics._app.renderer.gl);
}

override(Sprite_Animation.prototype, '_render', (o) => function () {}, () => using3DContext);

function scene_start() {
  if (mz3d.is3D()) {
    if (!using3DContext) {
      console.log("Switching to 3D effekseer context");
      create3DContext();
    }
  } else {
    if (using3DContext) {
      console.log("Switching to 2D effekseer context");
      create2DContext();
    }
  }
}

for (const scene of [Scene_Map, Scene_Battle]) override(scene.prototype, 'start', (o) => function () {
  o.apply(this, arguments);
  scene_start();
}, true);


override(Sprite_Animation.prototype, 'updateEffectGeometry', (o) => function () {
  const pos = new Vector3();
  let targetCount = 0;
  for (const target of this._targets) {
    if (!target._character && !target._character.mv3d_sprite) {continue;}
    const sprite = target._character.mv3d_sprite;
    if (sprite) {
      pos.addInPlace(sprite.position);
    } else {
      const char = target._character;
      pos.addInPlace(new Vector3(char.x, char.z || 0, -char.y));
    }
    ++targetCount;
  }
  if (targetCount) {
    pos.x /= targetCount;
    pos.y /= targetCount;
    pos.z /= targetCount;
  }
  if (this.mz3d_height) {
    pos.y += this.mz3d_height;
  }

  let scale = this._animation.scale / 100;
  if (this.mz3d_scale) {scale *= this.mz3d_scale;}
  const rx = degtorad(this._animation.rotation.x);
  const ry = degtorad(180 + this._animation.rotation.y - Number(this.mz3d_rot || 0));
  const rz = degtorad(this._animation.rotation.z);
  if (this._handle) {
    this._handle.setLocation(pos.x, pos.y, pos.z);
    this._handle.setRotation(rx, ry, rz);
    this._handle.setScale(scale * -1, scale, scale);
    this._handle.setSpeed(this._animation.speed / 100);

    pos.x /= this._targets.length;
    pos.y /= this._targets.length;
  }
}, mz3d.is3D);

override(Spriteset_Base.prototype, 'createAnimationSprite', (o) => function (targets, animation, mirror, delay) {
  if (typeof mirror !== 'object' || this.isMVAnimation(animation)) {
    o.apply(this, arguments);
    const newAnimation = this._animationSprites[this._animationSprites.length - 1];
    if (!mz3d.animationDepth && newAnimation instanceof Sprite_Animation) {
      topAnimations.push(newAnimation);
      renderOnTop = true;
    }
  } else {
    const opts = mirror;
    o.call(this, targets, animation, false, delay);
    const newAnimation = this._animationSprites[this._animationSprites.length - 1];
    newAnimation.mz3d_scale = opts.scale || 1;
    newAnimation.mz3d_rot = opts.rot || 0;
    newAnimation.mz3d_height = opts.height || 0;
    /*
    if(opts.depth){
        depthAnimations.push(newAnimation);
        mz3d.scene.postProcessesEnabled=false;
        if(mz3d.highlightLayer)mz3d.highlightLayer.isEnabled=false;
        mz3d.updateBlenders(true);
    }
    */
    if (!opts.depth && newAnimation instanceof Sprite_Animation) {
      topAnimations.push(newAnimation);
      renderOnTop = true;
    }
  }
}, mz3d.is3D);

//const depthAnimations=[];
const topAnimations = [];

override(Sprite_Animation.prototype, 'destroy', (o) => function () {
  o.apply(this, arguments);
  const index = topAnimations.indexOf(this);
  if (index >= 0) {
    topAnimations.splice(index, 1);
    /*
    if(!depthAnimations.length){
        mz3d.scene.postProcessesEnabled=true;
        if(mz3d.highlightLayer)mz3d.highlightLayer.isEnabled=true;
        mz3d.updateBlenders(true);
    }
    */
    if (!topAnimations.length) {
      renderOnTop = false;
    }
  }
}, true);

/***/ }),

/***/ "./src/features.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "L": () => (/* binding */ Feature)
/* harmony export */ });
/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/model.js");


const mz3d = window.mz3d;

mz3d.features = {};

mz3d.callFeature = function (name, method, ...args) {
  if (!this.featureEnabled(name)) {return;}
  if (args[0] instanceof _model__WEBPACK_IMPORTED_MODULE_0__/* .MeshGroup */ .BM) {
    for (const mesh of args[0].meshes) mz3d.callFeature(name, method, mesh, ...args.slice(1));
    return;
  }
  const feature = this.features[name];
  if (method in feature.methods) {
    feature.methods[method](...args);
  }
};

mz3d.callFeatures = function (method, ...args) {
  if (args[0] instanceof _model__WEBPACK_IMPORTED_MODULE_0__/* .MeshGroup */ .BM) {
    for (const mesh of args[0].meshes) mz3d.callFeatures(method, mesh, ...args.slice(1));
    return;
  }
  for (const name in this.features) {
    this.callFeature(name, method, ...args);
  }
};

mz3d.featureEnabled = function (name) {
  if (!(name in this.features)) {return false;}
  if (!this.features[name].enabled()) {return false;}
  return true;
};

class Feature {
  constructor(name, methods, condition = true) {
    Object.assign(this, { name, condition, methods });
    mz3d.features[name] = this;
  }
  enabled() {
    if (typeof this.condition === 'function') {
      return this.condition();
    }
    return Boolean(this.condition);
  }}

mz3d.Feature = Feature;

/***/ }),

/***/ "./src/main.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/index.js");
/* harmony import */ var _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/mod_babylon.js");
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/util.js");
/* harmony import */ var _util_parsing_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/util_parsing.js");






const debugMode = false;

const mz3d = {
  util: _util_js__WEBPACK_IMPORTED_MODULE_2__,
  effects: {},

  async setup() {
    this.setupParameters();
    (0,_mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .setupBabylonMods */ .oJ)();

    this.canvas = document.createElement('canvas');
    this.texture = PIXI.Texture.from(this.canvas);
    this.texture.destroy = function () {};
    this.texture.baseTexture.scaleMode = PIXI.SCALE_MODES.NEAREST;
    if (navigator.gpu && this.ALLOW_WEBGPU) {// experimental
      this.engine = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.WebGPUEngine(this.canvas, {
        antialiasing: this.ANTIALIASING,
        stencil: true });

      await this.engine.initAsync();
    } else {
      this.engine = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Engine(this.canvas, this.ANTIALIASING, {
        //premultipliedAlpha:false,
        stencil: true });

    }

    if (debugMode) {
      document.body.appendChild(this.canvas);
      this.canvas.style.position = 'absolute';
      this.canvas.style.top = '0';
      this.canvas.style.left = '0';
      /*
      const debugScene = new Scene(this.engine);
      		const debugCamera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 2, new BABYLON.Vector3(0,0,5), debugScene);
      debugCamera.attachControl(this.canvas, true);
      		// Add lights to the scene
      const light1 = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(1, 1, 0), debugScene);
      const light2 = new BABYLON.PointLight("light2", new BABYLON.Vector3(0, 1, -1), debugScene);
      
      // Add and manipulate meshes in the scene
      const sphere = BABYLON.MeshBuilder.CreateSphere("sphere", {diameter:2}, debugScene);
      
      this.engine.runRenderLoop(function () { 
      	debugScene.render();
      });
      */


    }

    this.context = this.engine._gl ?? gl;
    this.scene = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Scene(this.engine);
    //this.scene.clearColor.a=0;
    this.scene.clearColor.set(0, 0, 0, 0);

    //this.engine.forcePOTTextures=true;

    this.cameraStick = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.TransformNode("cameraStick", this.scene);
    this.cameraNode = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.TransformNode("cameraNode", this.scene);
    this.cameraNode.parent = this.cameraStick;
    this.camera = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.FreeCamera("camera", new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3(0, 0, 0), this.scene);
    this.camera.parent = this.cameraNode;
    this.camera.fov = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.degtorad)(mz3d.FOV);
    /*
    this.camera.orthoLeft=-Graphics.width/2/tileSize();
    this.camera.orthoRight=Graphics.width/2/tileSize();
    this.camera.orthoTop=Graphics.height/2/tileSize();
    this.camera.orthoBottom=-Graphics.height/2/tileSize();
    */
    this.camera.minZ = 0.1;
    this.camera.maxZ = this.RENDER_DIST;

    //this.scene.activeCameras.push(this.camera);

    this.scene.ambientColor = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Color3(1, 1, 1);
    this.scene.fogMode = _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .FOGMODE_LINEAR */ .xK;

    this.map = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Node("map", this.scene);
    this.cells = {};
    this.characters = [];

    this.setupBlenders();
    //this.updateBlenders(true);
    this.setupInput();

    this.setupSpriteMeshes();

    //this.callFeatures('earlySetup');
    this.callFeatures('setup');
    this.callFeatures('lateSetup');

    //await util.sleepUntil(DataManager.isDatabaseLoaded.bind(DataManager));

    this.Attribute.onLoad();

    this.setupComplete = true;

    this._updateCycle = 0;

    this.scene.onBeforeRenderObservable.add(() => {
      this.updateBlenders();
      this.beforeRenderCharacters();
      this.callFeatures('beforeRender');
    });
    this.scene.onAfterRenderObservable.add(() => {
      this.callFeatures('afterRender');
    });
    this.scene.onAfterDrawPhaseObservable.add(() => {
      if (this.scene.activeCamera !== this.camera) return;
      this.callFeatures('render');
    });

    console.log(`${mz3d.pluginName} starting in ${this.isWebGPU() ? 'webGPU' : 'webgl'} mode.`);
    this.engine.runRenderLoop(() => {
      this._renderLoopStarted ||= true;
      this.render();
    });
  },

  updateCanvas() {
    this.canvas.width = Graphics._width * mz3d.RES_SCALE;
    this.canvas.height = Graphics._height * mz3d.RES_SCALE;
  },

  render() {var _SceneManager$_scene;
    if (mz3d._lastUpdate === mz3d._lastRender) {return;}
    if (!this.texture.baseTexture) {return;}
    const sceneStarted = this.isMV ? SceneManager.isCurrentSceneStarted() : (_SceneManager$_scene = SceneManager._scene) === null || _SceneManager$_scene === void 0 ? void 0 : _SceneManager$_scene.isStarted();
    if (!debugMode && (!this.is3D() || !sceneStarted)) {
      return;
    }
    this.scene.render();

    this.texture.update();

    mz3d._lastRender = mz3d._lastUpdate;
  },

  lastMapUpdate: 0,
  update() {

    this._updateCycle = (this._updateCycle + 1) % 60;

    if (performance.now() - this.lastMapUpdate > 1000 && !this.mapUpdating) {
      this.updateMap();
      this.lastMapUpdate = performance.now();
    }

    this.updateAnimations();

    this.updateCharacters();

    this.intensiveUpdate();

    //this.updateBlenders();

    // input
    this.updateInput();

    for (const key in this.cells) {
      this.cells[key].update();
    }

    this.callFeatures('update');

    //this.updateData();

    mz3d._lastUpdate = Date.now();
  },

  get $saveData() {
    if (!$gameVariables) {return console.warn(`MV3D: Couldn't get data location`);}
    if (!$gameVariables['mv3d']) {$gameVariables['mv3d'] = {};}
    return $gameVariables['mv3d'];
  },

  loadData(key, dfault) {
    if (!$gameVariables || !this.$saveData || !(key in this.$saveData)) {return dfault;}
    return this.$saveData[key];
  },
  saveData(key, value) {
    if (!$gameVariables) {return console.warn(`MV3D: Couldn't save data ${key}:${value}`);}
    this.$saveData[key] = value;
  },
  clearData(key) {
    if (!$gameVariables) {return console.warn(`MV3D: Couldn't clear data ${key}`);}
    delete this.$saveData[key];
  },

  updateCameraMode(updated = false) {
    const mode = this.cameraMode;
    switch (String(mode)[0]) {
      case 'O':
      case '2':
        if (this.camera.mode !== _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .ORTHOGRAPHIC_CAMERA */ ._P) {this.camera.mode = _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .ORTHOGRAPHIC_CAMERA */ ._P;updated = true;}
        break;
      case 'P':
      default:
        if (this.camera.mode !== _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .PERSPECTIVE_CAMERA */ .xJ) {this.camera.mode = _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .PERSPECTIVE_CAMERA */ .xJ;updated = true;}
        break;}

    if (updated) {
      this.updateBlenders(true);
      this.callFeatures('updateCameraMode');
      this.updateParameters();
      for (const model of this.modelList) {
        model.updateCameraMode();
      }
    }
  },
  get cameraMode() {
    return this.loadData('cameraMode', this.CAMERA_MODE).toUpperCase();
  },
  set cameraMode(v) {
    switch (String(String(v)[0]).toUpperCase()) {
      case '2':v = '2D';break;
      case 'O':v = 'ORTHOGRAPHIC';break;
      case 'P':default:v = 'PERSPECTIVE';}

    this.saveData('cameraMode', v);
    //this.updateBlenders(true);
    this.updateCameraMode(true);
  },

  cameraRotation() {
    return this.cameraStick.rotation;
  },

  get hasBackground() {
    return window.$gameMap && $gameMap.parallaxName() || mz3d.hasSkybox;
  },

  get hasAlphaPostProcess() {
    return (this.hasAlphaFog || mz3d.lensEffect) && mz3d.scene.postProcessesEnabled;
  },

  is1stPerson(useCurrent) {
    const k = useCurrent ? 'currentValue' : 'targetValue';
    return $gamePlayer && (mz3d.getCameraTarget() === $gamePlayer || mz3d.getCameraTarget() === $gamePlayer.vehicle()) && mz3d.blendCameraTransition[k]() <= 0 &&
    mz3d.blendCameraDist[k]() <= 0 && mz3d.blendPanX[k]() === 0 && mz3d.blendPanY[k]() === 0;
  },

  isVR() {
    return false;
  },

  isWebGPU() {
    return this.engine instanceof BABYLON.WebGPUEngine;
  },

  isWebGl() {
    return !this.isWebGPU();
  },

  is3D() {
    return !mz3d.isDisabled() && SceneManager._scene instanceof Scene_Map;
  },

  isDisabled() {
    return mz3d.loadData('disabled', mz3d.getMapConfig('disabled', false));
  },
  disable(fadeType = 2) {
    mz3d.saveData('disabled', true);
    //SceneManager.goto(Scene_Map);
    $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y, $gamePlayer.direction(), fadeType);
  },
  enable(fadeType = 2) {
    mz3d.saveData('disabled', false);
    //SceneManager.goto(Scene_Map);
    $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y, $gamePlayer.direction(), fadeType);
    mz3d.createCharacters();
  },

  loopCoords(x, y) {
    if (this.loopHorizontal()) {
      const mapWidth = mz3d.mapWidth();
      const ox = this.cameraStick.x - mapWidth / 2;
      x = (x - ox).mod(mapWidth) + ox;
    }
    if (this.loopVertical()) {
      const mapHeight = mz3d.mapHeight();
      const oy = this.cameraStick.y - mapHeight / 2;
      y = (y - oy).mod(mapHeight) + oy;
    }
    return new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector2(x, y);
  },

  getFieldSize(dist = mz3d.blendCameraDist.currentValue()) {
    const size = Math.tan(mz3d.camera.fov / 2) * dist * 2;
    return {
      width: size * mz3d.engine.getAspectRatio(mz3d.camera),
      height: size };

  },
  getScaleForDist(dist = mz3d.blendCameraDist.currentValue()) {
    return Graphics.height / this.getFieldSize(dist).height / 48;
  },
  getFovForDist(dist = mz3d.blendCameraDist.currentValue(), height = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.optimalFrustrumHeight)()) {
    return 2 * Math.atan(height / 2 / dist);
  },
  getDistForFov(fov = mz3d.camera.fov, height = (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.optimalFrustrumHeight)()) {
    return height / 2 / Math.tan(fov / 2);
  },
  getFrustrumHeight(dist = mz3d.blendCameraDist.currentValue(), fov = mz3d.camera.fov) {
    return 2 * dist * Math.tan(fov / 2);
  },


  getScreenPosition(node, offset = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero()) {
    const matrix = node.parent ? node.parent.getWorldMatrix() : _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Matrix.Identity();
    const pos = node instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3 ? node.add(offset) : node.position.add(offset);
    const projected = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Project(pos, matrix, mz3d.scene.getTransformMatrix(), mz3d.camera.viewport);
    return { x: projected.x * Graphics.width, y: projected.y * Graphics.height, behindCamera: projected.z > 1 };
  },

  getScreenDepth(node, offset = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero()) {
    const matrix = node.parent ? node.parent.getWorldMatrix() : _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Matrix.Identity();
    const pos = node instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3 ? node.add(offset) : node.position.add(offset);
    const projected = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Project(pos, matrix, mz3d.scene.getTransformMatrix(), mz3d.camera.viewport);
    return _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Unproject(projected, 1, 1, BABYLON.Matrix.Identity(), BABYLON.Matrix.Identity(), mz3d.scene.getProjectionMatrix()).z;
  },

  getUnscaledMatrix(mesh) {
    const matrix = mesh.getWorldMatrix();
    const qrot = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Quaternion(),vtrans = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3();
    matrix.decompose(null, qrot, vtrans);
    return _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Matrix.Compose(_babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.One(), qrot, vtrans);
  },
  getTranslationMatrix(mesh) {
    const matrix = mesh.getWorldMatrix();
    const vrot = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero(),vtrans = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3();
    vrot.y = -(0,_util_js__WEBPACK_IMPORTED_MODULE_2__.degtorad)(mz3d.blendCameraYaw.currentValue());
    vrot.x = -(0,_util_js__WEBPACK_IMPORTED_MODULE_2__.degtorad)(mz3d.blendCameraPitch.currentValue() - 90);
    matrix.decompose(null, null, vtrans);
    return _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Matrix.Compose(_babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.One(), vrot.toQuaternion(), vtrans);
  },
  getRotationMatrix(mesh) {
    const matrix = mesh.getWorldMatrix();
    const qrot = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Quaternion();
    matrix.decompose(null, qrot, null);
    return _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Matrix.Compose(_babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.One(), qrot, _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero());
  },

  globalPosition(node) {
    const matrix = node.parent ? node.parent.getWorldMatrix() : _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Matrix.Identity();
    return _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.TransformCoordinates(node.position, matrix);
  },

  get deltaTime() {
    return Math.min(0.03, this.scene.deltaTime / 1000 || 0);
  },

  Vector3: class {
    constructor(x, y, z) {
      Object.setPrototypeOf(this, BABYLON.Vector3.prototype);
      this.$x = x;
      this.$y = y;
      this.$z = z;
    }} };



window['mv3d'] = window['mz3d'] = mz3d;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mz3d);

Object.assign(mz3d, {
  ParameterList: _util_parsing_js__WEBPACK_IMPORTED_MODULE_3__.ParameterList,
  ParameterGroup: _util_parsing_js__WEBPACK_IMPORTED_MODULE_3__.ParameterGroup });

/***/ }),

/***/ "./src/mod_babylon.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Ym": () => (/* binding */ BACKSIDE),
  "FO": () => (/* binding */ DOUBLESIDE),
  "xK": () => (/* binding */ FOGMODE_LINEAR),
  "UP": () => (/* binding */ FRONTSIDE),
  "vf": () => (/* binding */ LOCALSPACE),
  "_P": () => (/* binding */ ORTHOGRAPHIC_CAMERA),
  "xJ": () => (/* binding */ PERSPECTIVE_CAMERA),
  "i_": () => (/* binding */ WORLDSPACE),
  "oJ": () => (/* binding */ setupBabylonMods)
});

// UNUSED EXPORTS: BONESPACE, FOGMODE_EXP, FOGMODE_EXP2, FOGMODE_NONE

// EXTERNAL MODULE: ./src/main.js
var main = __webpack_require__("./src/main.js");
// EXTERNAL MODULE: ./src/util.js + 917 modules
var util = __webpack_require__("./src/util.js");
;// CONCATENATED MODULE: ./src/shaders.js

function hackShaders() {
  //hackShaderAlphaCutoff('shadowMapPixelShader');
  hackShaderAlphaCutoff('depthPixelShader');
  hackDefaultShader();
  hackShaderInsert('shadowMapPixelShader', '', 'precision mediump float;');
  hackShaderInsert('shadowMapVertexShader', '', 'precision mediump float;');

  Object.assign(mz3d, { hackShaderReplace, hackShaderInsert });
  mz3d.callFeatures('hackShaders');
  delete mz3d.hackShaderReplace;
  delete mz3d.hackShaderInsert;
}

function hackShaderAlphaCutoff(shader) {
  hackShaderReplace(shader,
  'if (texture2D(diffuseSampler,vUV).a<0.4)',
  `if (texture2D(diffuseSampler,vUV).a<${mz3d.ALPHA_CUTOFF})`);

}
function hackShaderReplace(shader, find, replace) {
  BABYLON.Effect.ShadersStore[shader] = BABYLON.Effect.ShadersStore[shader].replace(find, replace);
}
function hackShaderInsert(shader, find, insert) {
  hackShaderReplace(shader, find, `${find}\n${insert}\n`);
}

function hackDefaultShader() {
  // When no diffuse texture, use diffuseColor as baseColor
  hackShaderReplace('defaultPixelShader',
  'vec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;',
  `#ifdef DIFFUSE
	vec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
	#else
	vec3 finalDiffuse=clamp(diffuseBase+emissiveColor+vAmbientColor,0.0,1.0)*diffuseColor.rgb;
	#endif
	`);
  // When emissive color higher than one, use illumination.
  hackShaderReplace('defaultPixelShader',
  'vec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+refractionColor,alpha);',
  `vec3 mv3d_extra_emissiveColor = max(emissiveColor-1.,0.);
		vec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+mv3d_extra_emissiveColor+refractionColor,0.0,1.0),alpha);`);

}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/index.js + 828 modules
var core = __webpack_require__("./node_modules/@babylonjs/core/index.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Loading/sceneLoader.js
var sceneLoader = __webpack_require__("./node_modules/@babylonjs/core/Loading/sceneLoader.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/assetContainer.js
var assetContainer = __webpack_require__("./node_modules/@babylonjs/core/assetContainer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/dataReader.js
var dataReader = __webpack_require__("./node_modules/@babylonjs/core/Misc/dataReader.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/glTFValidation.js
function validateAsync(data, rootUrl, fileName, getExternalResource) {const options = { externalResourceFunction: (uri) => getExternalResource(uri).then((value) => new Uint8Array(value)) };return fileName && (options.uri = "file:" === rootUrl ? fileName : rootUrl + fileName), data instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(data), options) : GLTFValidator.validateString(data, options);}function workerFunc() {const pendingExternalResources = [];onmessage = (message) => {const data = message.data;switch (data.id) {case "init":{importScripts(data.url);break;}case "validate":{validateAsync(data.data, data.rootUrl, data.fileName, (uri) => new Promise((resolve, reject) => {const index = pendingExternalResources.length;pendingExternalResources.push({ resolve, reject }), postMessage({ id: "getExternalResource", index: index, uri: uri });})).then((value) => {postMessage({ id: "validate.resolve", value: value });}, (reason) => {postMessage({ id: "validate.reject", reason: reason });});break;}case "getExternalResource.resolve":{pendingExternalResources[data.index].resolve(data.value);break;}case "getExternalResource.reject":{pendingExternalResources[data.index].reject(data.reason);break;}}};}class GLTFValidation {static ValidateAsync(data, rootUrl, fileName, getExternalResource) {return "function" == typeof Worker ? new Promise((resolve, reject) => {const workerBlobUrl = URL.createObjectURL(new Blob([`${validateAsync}(${workerFunc})()`], { type: "application/javascript" })),worker = new Worker(workerBlobUrl),onError = (error) => {worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), reject(error);},onMessage = (message) => {const data = message.data;switch (data.id) {case "getExternalResource":{getExternalResource(data.uri).then((value) => {worker.postMessage({ id: "getExternalResource.resolve", index: data.index, value: value }, [value]);}, (reason) => {worker.postMessage({ id: "getExternalResource.reject", index: data.index, reason: reason });});break;}case "validate.resolve":{worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), resolve(data.value), worker.terminate();break;}case "validate.reject":worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), reject(data.reason), worker.terminate();}};worker.addEventListener("error", onError), worker.addEventListener("message", onMessage), worker.postMessage({ id: "init", url: this.Configuration.url }), worker.postMessage({ id: "validate", data: data, rootUrl: rootUrl, fileName: fileName });}) : (this._LoadScriptPromise || (this._LoadScriptPromise = tools/* Tools.LoadScriptAsync */.w1.LoadScriptAsync(this.Configuration.url)), this._LoadScriptPromise.then(() => validateAsync(data, rootUrl, fileName, getExternalResource)));}}GLTFValidation.Configuration = { url: "https://preview.babylonjs.com/gltf_validator.js" };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/fileTools.js
var fileTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/fileTools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/error.js
var error = __webpack_require__("./node_modules/@babylonjs/core/Misc/error.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/glTFFileLoader.js
function readAsync(arrayBuffer, byteOffset, byteLength) {try {return Promise.resolve(new Uint8Array(arrayBuffer, byteOffset, byteLength));} catch (e) {return Promise.reject(e);}}var GLTFLoaderCoordinateSystemMode;(function (GLTFLoaderCoordinateSystemMode) {GLTFLoaderCoordinateSystemMode[GLTFLoaderCoordinateSystemMode.AUTO = 0] = "AUTO", GLTFLoaderCoordinateSystemMode[GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED = 1] = "FORCE_RIGHT_HANDED";})(GLTFLoaderCoordinateSystemMode || (GLTFLoaderCoordinateSystemMode = {}));var GLTFLoaderAnimationStartMode;(function (GLTFLoaderAnimationStartMode) {GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode.NONE = 0] = "NONE", GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode.FIRST = 1] = "FIRST", GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode.ALL = 2] = "ALL";})(GLTFLoaderAnimationStartMode || (GLTFLoaderAnimationStartMode = {}));var GLTFLoaderState;(function (GLTFLoaderState) {GLTFLoaderState[GLTFLoaderState.LOADING = 0] = "LOADING", GLTFLoaderState[GLTFLoaderState.READY = 1] = "READY", GLTFLoaderState[GLTFLoaderState.COMPLETE = 2] = "COMPLETE";})(GLTFLoaderState || (GLTFLoaderState = {}));class GLTFFileLoader {constructor() {this.onParsedObservable = new observable/* Observable */.y$(), this.coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO, this.animationStartMode = GLTFLoaderAnimationStartMode.FIRST, this.compileMaterials = !1, this.useClipPlane = !1, this.compileShadowGenerators = !1, this.transparencyAsCoverage = !1, this.useRangeRequests = !1, this.createInstances = !0, this.alwaysComputeBoundingBox = !1, this.loadAllMaterials = !1, this.loadOnlyMaterials = !1, this.skipMaterials = !1, this.useSRGBBuffers = !0, this.targetFps = 60, this.alwaysComputeSkeletonRootNode = !1, this.preprocessUrlAsync = (url) => Promise.resolve(url), this.onMeshLoadedObservable = new observable/* Observable */.y$(), this.onSkinLoadedObservable = new observable/* Observable */.y$(), this.onTextureLoadedObservable = new observable/* Observable */.y$(), this.onMaterialLoadedObservable = new observable/* Observable */.y$(), this.onCameraLoadedObservable = new observable/* Observable */.y$(), this.onCompleteObservable = new observable/* Observable */.y$(), this.onErrorObservable = new observable/* Observable */.y$(), this.onDisposeObservable = new observable/* Observable */.y$(), this.onExtensionLoadedObservable = new observable/* Observable */.y$(), this.validate = !1, this.onValidatedObservable = new observable/* Observable */.y$(), this._loader = null, this._state = null, this._requests = [], this.name = "gltf", this.extensions = { ".gltf": { isBinary: !1 }, ".glb": { isBinary: !0 } }, this.onLoaderStateChangedObservable = new observable/* Observable */.y$(), this._logIndentLevel = 0, this._loggingEnabled = !1, this._log = this._logDisabled, this._capturePerformanceCounters = !1, this._startPerformanceCounter = this._startPerformanceCounterDisabled, this._endPerformanceCounter = this._endPerformanceCounterDisabled;}set onParsed(callback) {this._onParsedObserver && this.onParsedObservable.remove(this._onParsedObserver), this._onParsedObserver = this.onParsedObservable.add(callback);}set onMeshLoaded(callback) {this._onMeshLoadedObserver && this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver), this._onMeshLoadedObserver = this.onMeshLoadedObservable.add(callback);}set onTextureLoaded(callback) {this._onTextureLoadedObserver && this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver), this._onTextureLoadedObserver = this.onTextureLoadedObservable.add(callback);}set onMaterialLoaded(callback) {this._onMaterialLoadedObserver && this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver), this._onMaterialLoadedObserver = this.onMaterialLoadedObservable.add(callback);}set onCameraLoaded(callback) {this._onCameraLoadedObserver && this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver), this._onCameraLoadedObserver = this.onCameraLoadedObservable.add(callback);}set onComplete(callback) {this._onCompleteObserver && this.onCompleteObservable.remove(this._onCompleteObserver), this._onCompleteObserver = this.onCompleteObservable.add(callback);}set onError(callback) {this._onErrorObserver && this.onErrorObservable.remove(this._onErrorObserver), this._onErrorObserver = this.onErrorObservable.add(callback);}set onDispose(callback) {this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(callback);}set onExtensionLoaded(callback) {this._onExtensionLoadedObserver && this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver), this._onExtensionLoadedObserver = this.onExtensionLoadedObservable.add(callback);}get loggingEnabled() {return this._loggingEnabled;}set loggingEnabled(value) {this._loggingEnabled === value || (this._loggingEnabled = value, this._log = this._loggingEnabled ? this._logEnabled : this._logDisabled);}get capturePerformanceCounters() {return this._capturePerformanceCounters;}set capturePerformanceCounters(value) {this._capturePerformanceCounters === value || (this._capturePerformanceCounters = value, this._capturePerformanceCounters ? (this._startPerformanceCounter = this._startPerformanceCounterEnabled, this._endPerformanceCounter = this._endPerformanceCounterEnabled) : (this._startPerformanceCounter = this._startPerformanceCounterDisabled, this._endPerformanceCounter = this._endPerformanceCounterDisabled));}set onValidated(callback) {this._onValidatedObserver && this.onValidatedObservable.remove(this._onValidatedObserver), this._onValidatedObserver = this.onValidatedObservable.add(callback);}dispose() {this._loader && (this._loader.dispose(), this._loader = null);for (const request of this._requests) request.abort();this._requests.length = 0, delete this._progressCallback, this.preprocessUrlAsync = (url) => Promise.resolve(url), this.onMeshLoadedObservable.clear(), this.onSkinLoadedObservable.clear(), this.onTextureLoadedObservable.clear(), this.onMaterialLoadedObservable.clear(), this.onCameraLoadedObservable.clear(), this.onCompleteObservable.clear(), this.onExtensionLoadedObservable.clear(), this.onDisposeObservable.notifyObservers(void 0), this.onDisposeObservable.clear();}loadFile(scene, fileOrUrl, onSuccess, onProgress, useArrayBuffer, onError) {this._progressCallback = onProgress;const rootUrl = fileOrUrl.name ? "file:" : tools/* Tools.GetFolderPath */.w1.GetFolderPath(fileOrUrl),fileName = fileOrUrl.name || tools/* Tools.GetFilename */.w1.GetFilename(fileOrUrl);if (useArrayBuffer) {if (this.useRangeRequests) {this.validate && logger/* Logger.Warn */.Y.Warn("glTF validation is not supported when range requests are enabled");const fileRequest = { abort: () => {}, onCompleteObservable: new observable/* Observable */.y$() };return this._unpackBinaryAsync(new dataReader/* DataReader */.d({ readAsync: (byteOffset, byteLength) => new Promise((resolve, reject) => {this._loadFile(scene, fileOrUrl, (data) => {resolve(new Uint8Array(data));}, !0, (error) => {reject(error);}, (webRequest) => {webRequest.setRequestHeader("Range", `bytes=${byteOffset}-${byteOffset + byteLength - 1}`);});}), byteLength: 0 })).then((loaderData) => {fileRequest.onCompleteObservable.notifyObservers(fileRequest), onSuccess(loaderData);}, onError ? (error) => onError(void 0, error) : void 0), fileRequest;}return this._loadFile(scene, fileOrUrl, (data) => {this._validate(scene, data, rootUrl, fileName), this._unpackBinaryAsync(new dataReader/* DataReader */.d({ readAsync: (byteOffset, byteLength) => readAsync(data, byteOffset, byteLength), byteLength: data.byteLength })).then((loaderData) => {onSuccess(loaderData);}, onError ? (error) => onError(void 0, error) : void 0);}, !0, onError);}return this._loadFile(scene, fileOrUrl, (data) => {this._validate(scene, data, rootUrl, fileName), onSuccess({ json: this._parseJson(data) });}, useArrayBuffer, onError);}importMeshAsync(meshesNames, scene, data, rootUrl, onProgress, fileName) {return Promise.resolve().then(() => (this.onParsedObservable.notifyObservers(data), this.onParsedObservable.clear(), this._log(`Loading ${fileName || ""}`), this._loader = this._getLoader(data), this._loader.importMeshAsync(meshesNames, scene, null, data, rootUrl, onProgress, fileName)));}loadAsync(scene, data, rootUrl, onProgress, fileName) {return Promise.resolve().then(() => (this.onParsedObservable.notifyObservers(data), this.onParsedObservable.clear(), this._log(`Loading ${fileName || ""}`), this._loader = this._getLoader(data), this._loader.loadAsync(scene, data, rootUrl, onProgress, fileName)));}loadAssetContainerAsync(scene, data, rootUrl, onProgress, fileName) {return Promise.resolve().then(() => {this.onParsedObservable.notifyObservers(data), this.onParsedObservable.clear(), this._log(`Loading ${fileName || ""}`), this._loader = this._getLoader(data);const container = new assetContainer/* AssetContainer */.TJ(scene),materials = [];this.onMaterialLoadedObservable.add((material) => {materials.push(material);});const textures = [];this.onTextureLoadedObservable.add((texture) => {textures.push(texture);});const cameras = [];return this.onCameraLoadedObservable.add((camera) => {cameras.push(camera);}), this._loader.importMeshAsync(null, scene, container, data, rootUrl, onProgress, fileName).then((result) => (Array.prototype.push.apply(container.geometries, result.geometries), Array.prototype.push.apply(container.meshes, result.meshes), Array.prototype.push.apply(container.particleSystems, result.particleSystems), Array.prototype.push.apply(container.skeletons, result.skeletons), Array.prototype.push.apply(container.animationGroups, result.animationGroups), Array.prototype.push.apply(container.materials, materials), Array.prototype.push.apply(container.textures, textures), Array.prototype.push.apply(container.lights, result.lights), Array.prototype.push.apply(container.transformNodes, result.transformNodes), Array.prototype.push.apply(container.cameras, cameras), container));});}canDirectLoad(data) {return -1 !== data.indexOf("asset") && -1 !== data.indexOf("version") || data.startsWith("data:base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("data:;base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("data:application/octet-stream;base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("data:model/gltf-binary;base64," + GLTFFileLoader._MagicBase64Encoded);}directLoad(scene, data) {if (data.startsWith("base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith(";base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("application/octet-stream;base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("model/gltf-binary;base64," + GLTFFileLoader._MagicBase64Encoded)) {const arrayBuffer = (0,fileTools/* DecodeBase64UrlToBinary */.$K)(data);return this._validate(scene, arrayBuffer), this._unpackBinaryAsync(new dataReader/* DataReader */.d({ readAsync: (byteOffset, byteLength) => readAsync(arrayBuffer, byteOffset, byteLength), byteLength: arrayBuffer.byteLength }));}return this._validate(scene, data), Promise.resolve({ json: this._parseJson(data) });}createPlugin() {return new GLTFFileLoader();}get loaderState() {return this._state;}whenCompleteAsync() {return new Promise((resolve, reject) => {this.onCompleteObservable.addOnce(() => {resolve();}), this.onErrorObservable.addOnce((reason) => {reject(reason);});});}_setState(state) {this._state === state || (this._state = state, this.onLoaderStateChangedObservable.notifyObservers(this._state), this._log(GLTFLoaderState[this._state]));}_loadFile(scene, fileOrUrl, onSuccess, useArrayBuffer, onError, onOpened) {const request = scene._loadFile(fileOrUrl, onSuccess, (event) => {this._onProgress(event, request);}, !0, useArrayBuffer, onError, onOpened);return request.onCompleteObservable.add((request) => {this._requests.splice(this._requests.indexOf(request), 1);}), this._requests.push(request), request;}_onProgress(event, request) {if (!this._progressCallback) return;request._lengthComputable = event.lengthComputable, request._loaded = event.loaded, request._total = event.total;let lengthComputable = !0,loaded = 0,total = 0;for (const request of this._requests) {if (request._lengthComputable === void 0 || request._loaded === void 0 || request._total === void 0) return;lengthComputable = lengthComputable && request._lengthComputable, loaded += request._loaded, total += request._total;}this._progressCallback({ lengthComputable: lengthComputable, loaded: loaded, total: lengthComputable ? total : 0 });}_validate(scene, data, rootUrl = "", fileName = "") {this.validate && (this._startPerformanceCounter("Validate JSON"), GLTFValidation.ValidateAsync(data, rootUrl, fileName, (uri) => this.preprocessUrlAsync(rootUrl + uri).then((url) => scene._loadFileAsync(url, void 0, !0, !0))).then((result) => {this._endPerformanceCounter("Validate JSON"), this.onValidatedObservable.notifyObservers(result), this.onValidatedObservable.clear();}, (reason) => {this._endPerformanceCounter("Validate JSON"), tools/* Tools.Warn */.w1.Warn(`Failed to validate: ${reason.message}`), this.onValidatedObservable.clear();}));}_getLoader(loaderData) {const asset = loaderData.json.asset || {};this._log(`Asset version: ${asset.version}`), asset.minVersion && this._log(`Asset minimum version: ${asset.minVersion}`), asset.generator && this._log(`Asset generator: ${asset.generator}`);const version = GLTFFileLoader._parseVersion(asset.version);if (!version) throw new Error("Invalid version: " + asset.version);if (void 0 !== asset.minVersion) {const minVersion = GLTFFileLoader._parseVersion(asset.minVersion);if (!minVersion) throw new Error("Invalid minimum version: " + asset.minVersion);if (0 < GLTFFileLoader._compareVersion(minVersion, { major: 2, minor: 0 })) throw new Error("Incompatible minimum version: " + asset.minVersion);}const createLoaders = { 1: GLTFFileLoader._CreateGLTF1Loader, 2: GLTFFileLoader._CreateGLTF2Loader },createLoader = createLoaders[version.major];if (!createLoader) throw new Error("Unsupported version: " + asset.version);return createLoader(this);}_parseJson(json) {this._startPerformanceCounter("Parse JSON"), this._log(`JSON length: ${json.length}`);const parsed = JSON.parse(json);return this._endPerformanceCounter("Parse JSON"), parsed;}_unpackBinaryAsync(dataReader) {return this._startPerformanceCounter("Unpack Binary"), dataReader.loadAsync(20).then(() => {const magic = dataReader.readUint32();if (magic !== { Magic: 1179937895 }.Magic) throw new error/* RuntimeError */.LH("Unexpected magic: " + magic, error/* ErrorCodes.GLTFLoaderUnexpectedMagicError */.SM.GLTFLoaderUnexpectedMagicError);const version = dataReader.readUint32();this.loggingEnabled && this._log(`Binary version: ${version}`);const length = dataReader.readUint32();if (0 !== dataReader.buffer.byteLength && length !== dataReader.buffer.byteLength) throw new Error(`Length in header does not match actual data length: ${length} != ${dataReader.buffer.byteLength}`);let unpacked;switch (version) {case 1:{unpacked = this._unpackBinaryV1Async(dataReader, length);break;}case 2:{unpacked = this._unpackBinaryV2Async(dataReader, length);break;}default:throw new Error("Unsupported version: " + version);}return this._endPerformanceCounter("Unpack Binary"), unpacked;});}_unpackBinaryV1Async(dataReader, length) {const contentLength = dataReader.readUint32(),contentFormat = dataReader.readUint32();if (contentFormat !== { JSON: 0 }.JSON) throw new Error(`Unexpected content format: ${contentFormat}`);const bodyLength = length - dataReader.byteOffset,data = { json: this._parseJson(dataReader.readString(contentLength)), bin: null };if (0 != bodyLength) {const startByteOffset = dataReader.byteOffset;data.bin = { readAsync: (byteOffset, byteLength) => dataReader.buffer.readAsync(startByteOffset + byteOffset, byteLength), byteLength: bodyLength };}return Promise.resolve(data);}_unpackBinaryV2Async(dataReader, length) {const ChunkFormat = { JSON: 1313821514, BIN: 5130562 },chunkLength = dataReader.readUint32(),chunkFormat = dataReader.readUint32();if (chunkFormat !== ChunkFormat.JSON) throw new Error("First chunk format is not JSON");return dataReader.byteOffset + chunkLength === length ? dataReader.loadAsync(chunkLength).then(() => ({ json: this._parseJson(dataReader.readString(chunkLength)), bin: null })) : dataReader.loadAsync(chunkLength + 8).then(() => {const data = { json: this._parseJson(dataReader.readString(chunkLength)), bin: null },readAsync = () => {const chunkLength = dataReader.readUint32(),chunkFormat = dataReader.readUint32();switch (chunkFormat) {case ChunkFormat.JSON:throw new Error("Unexpected JSON chunk");case ChunkFormat.BIN:{const startByteOffset = dataReader.byteOffset;data.bin = { readAsync: (byteOffset, byteLength) => dataReader.buffer.readAsync(startByteOffset + byteOffset, byteLength), byteLength: chunkLength }, dataReader.skipBytes(chunkLength);break;}default:{dataReader.skipBytes(chunkLength);break;}}return dataReader.byteOffset === length ? Promise.resolve(data) : dataReader.loadAsync(8).then(readAsync);};return readAsync();});}static _parseVersion(version) {if ("1.0" === version || "1.0.1" === version) return { major: 1, minor: 0 };const match = (version + "").match(/^(\d+)\.(\d+)/);return match ? { major: parseInt(match[1]), minor: parseInt(match[2]) } : null;}static _compareVersion(a, b) {return a.major > b.major ? 1 : a.major < b.major ? -1 : a.minor > b.minor ? 1 : a.minor < b.minor ? -1 : 0;}_logOpen(message) {this._log(message), this._logIndentLevel++;}_logClose() {--this._logIndentLevel;}_logEnabled(message) {const spaces = GLTFFileLoader._logSpaces.substr(0, 2 * this._logIndentLevel);logger/* Logger.Log */.Y.Log(`${spaces}${message}`);}_logDisabled() {}_startPerformanceCounterEnabled(counterName) {tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter(counterName);}_startPerformanceCounterDisabled() {}_endPerformanceCounterEnabled(counterName) {tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter(counterName);}_endPerformanceCounterDisabled() {}}GLTFFileLoader.IncrementalLoading = !0, GLTFFileLoader.HomogeneousCoordinates = !1, GLTFFileLoader._MagicBase64Encoded = "Z2xURg", GLTFFileLoader._logSpaces = "                                ", sceneLoader/* SceneLoader */.n && sceneLoader/* SceneLoader.RegisterPlugin */.n.RegisterPlugin(new GLTFFileLoader());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/1.0/glTFLoaderInterfaces.js
var EComponentType;(function (EComponentType) {EComponentType[EComponentType.BYTE = 5120] = "BYTE", EComponentType[EComponentType.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", EComponentType[EComponentType.SHORT = 5122] = "SHORT", EComponentType[EComponentType.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", EComponentType[EComponentType.FLOAT = 5126] = "FLOAT";})(EComponentType || (EComponentType = {}));var EShaderType;(function (EShaderType) {EShaderType[EShaderType.FRAGMENT = 35632] = "FRAGMENT", EShaderType[EShaderType.VERTEX = 35633] = "VERTEX";})(EShaderType || (EShaderType = {}));var EParameterType;(function (EParameterType) {EParameterType[EParameterType.BYTE = 5120] = "BYTE", EParameterType[EParameterType.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", EParameterType[EParameterType.SHORT = 5122] = "SHORT", EParameterType[EParameterType.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", EParameterType[EParameterType.INT = 5124] = "INT", EParameterType[EParameterType.UNSIGNED_INT = 5125] = "UNSIGNED_INT", EParameterType[EParameterType.FLOAT = 5126] = "FLOAT", EParameterType[EParameterType.FLOAT_VEC2 = 35664] = "FLOAT_VEC2", EParameterType[EParameterType.FLOAT_VEC3 = 35665] = "FLOAT_VEC3", EParameterType[EParameterType.FLOAT_VEC4 = 35666] = "FLOAT_VEC4", EParameterType[EParameterType.INT_VEC2 = 35667] = "INT_VEC2", EParameterType[EParameterType.INT_VEC3 = 35668] = "INT_VEC3", EParameterType[EParameterType.INT_VEC4 = 35669] = "INT_VEC4", EParameterType[EParameterType.BOOL = 35670] = "BOOL", EParameterType[EParameterType.BOOL_VEC2 = 35671] = "BOOL_VEC2", EParameterType[EParameterType.BOOL_VEC3 = 35672] = "BOOL_VEC3", EParameterType[EParameterType.BOOL_VEC4 = 35673] = "BOOL_VEC4", EParameterType[EParameterType.FLOAT_MAT2 = 35674] = "FLOAT_MAT2", EParameterType[EParameterType.FLOAT_MAT3 = 35675] = "FLOAT_MAT3", EParameterType[EParameterType.FLOAT_MAT4 = 35676] = "FLOAT_MAT4", EParameterType[EParameterType.SAMPLER_2D = 35678] = "SAMPLER_2D";})(EParameterType || (EParameterType = {}));var ETextureWrapMode;(function (ETextureWrapMode) {ETextureWrapMode[ETextureWrapMode.CLAMP_TO_EDGE = 33071] = "CLAMP_TO_EDGE", ETextureWrapMode[ETextureWrapMode.MIRRORED_REPEAT = 33648] = "MIRRORED_REPEAT", ETextureWrapMode[ETextureWrapMode.REPEAT = 10497] = "REPEAT";})(ETextureWrapMode || (ETextureWrapMode = {}));var ETextureFilterType;(function (ETextureFilterType) {ETextureFilterType[ETextureFilterType.NEAREST = 9728] = "NEAREST", ETextureFilterType[ETextureFilterType.LINEAR = 9728] = "LINEAR", ETextureFilterType[ETextureFilterType.NEAREST_MIPMAP_NEAREST = 9984] = "NEAREST_MIPMAP_NEAREST", ETextureFilterType[ETextureFilterType.LINEAR_MIPMAP_NEAREST = 9985] = "LINEAR_MIPMAP_NEAREST", ETextureFilterType[ETextureFilterType.NEAREST_MIPMAP_LINEAR = 9986] = "NEAREST_MIPMAP_LINEAR", ETextureFilterType[ETextureFilterType.LINEAR_MIPMAP_LINEAR = 9987] = "LINEAR_MIPMAP_LINEAR";})(ETextureFilterType || (ETextureFilterType = {}));var ETextureFormat;(function (ETextureFormat) {ETextureFormat[ETextureFormat.ALPHA = 6406] = "ALPHA", ETextureFormat[ETextureFormat.RGB = 6407] = "RGB", ETextureFormat[ETextureFormat.RGBA = 6408] = "RGBA", ETextureFormat[ETextureFormat.LUMINANCE = 6409] = "LUMINANCE", ETextureFormat[ETextureFormat.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA";})(ETextureFormat || (ETextureFormat = {}));var ECullingType;(function (ECullingType) {ECullingType[ECullingType.FRONT = 1028] = "FRONT", ECullingType[ECullingType.BACK = 1029] = "BACK", ECullingType[ECullingType.FRONT_AND_BACK = 1032] = "FRONT_AND_BACK";})(ECullingType || (ECullingType = {}));var EBlendingFunction;(function (EBlendingFunction) {EBlendingFunction[EBlendingFunction.ZERO = 0] = "ZERO", EBlendingFunction[EBlendingFunction.ONE = 1] = "ONE", EBlendingFunction[EBlendingFunction.SRC_COLOR = 768] = "SRC_COLOR", EBlendingFunction[EBlendingFunction.ONE_MINUS_SRC_COLOR = 769] = "ONE_MINUS_SRC_COLOR", EBlendingFunction[EBlendingFunction.DST_COLOR = 774] = "DST_COLOR", EBlendingFunction[EBlendingFunction.ONE_MINUS_DST_COLOR = 775] = "ONE_MINUS_DST_COLOR", EBlendingFunction[EBlendingFunction.SRC_ALPHA = 770] = "SRC_ALPHA", EBlendingFunction[EBlendingFunction.ONE_MINUS_SRC_ALPHA = 771] = "ONE_MINUS_SRC_ALPHA", EBlendingFunction[EBlendingFunction.DST_ALPHA = 772] = "DST_ALPHA", EBlendingFunction[EBlendingFunction.ONE_MINUS_DST_ALPHA = 773] = "ONE_MINUS_DST_ALPHA", EBlendingFunction[EBlendingFunction.CONSTANT_COLOR = 32769] = "CONSTANT_COLOR", EBlendingFunction[EBlendingFunction.ONE_MINUS_CONSTANT_COLOR = 32770] = "ONE_MINUS_CONSTANT_COLOR", EBlendingFunction[EBlendingFunction.CONSTANT_ALPHA = 32771] = "CONSTANT_ALPHA", EBlendingFunction[EBlendingFunction.ONE_MINUS_CONSTANT_ALPHA = 32772] = "ONE_MINUS_CONSTANT_ALPHA", EBlendingFunction[EBlendingFunction.SRC_ALPHA_SATURATE = 776] = "SRC_ALPHA_SATURATE";})(EBlendingFunction || (EBlendingFunction = {}));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.color.js
var math_color = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/camera.js
var Cameras_camera = __webpack_require__("./node_modules/@babylonjs/core/Cameras/camera.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/freeCamera.js
var freeCamera = __webpack_require__("./node_modules/@babylonjs/core/Cameras/freeCamera.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animation.js
var Animations_animation = __webpack_require__("./node_modules/@babylonjs/core/Animations/animation.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Bones/bone.js
var Bones_bone = __webpack_require__("./node_modules/@babylonjs/core/Bones/bone.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Bones/skeleton.js
var skeleton = __webpack_require__("./node_modules/@babylonjs/core/Bones/skeleton.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effect.js
var effect = __webpack_require__("./node_modules/@babylonjs/core/Materials/effect.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/material.js + 1 modules
var Materials_material = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/multiMaterial.js
var multiMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/multiMaterial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/standardMaterial.js + 6 modules
var Materials_standardMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/standardMaterial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/shaderMaterial.js
var Materials_shaderMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/shaderMaterial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/texture.js
var Textures_texture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js
var mesh_vertexData = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/buffer.js
var Buffers_buffer = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/geometry.js
var geometry = __webpack_require__("./node_modules/@babylonjs/core/Meshes/geometry.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/subMesh.js
var subMesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/subMesh.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/abstractMesh.js
var abstractMesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/abstractMesh.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/mesh.js
var Meshes_mesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/hemisphericLight.js
var hemisphericLight = __webpack_require__("./node_modules/@babylonjs/core/Lights/hemisphericLight.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/directionalLight.js
var Lights_directionalLight = __webpack_require__("./node_modules/@babylonjs/core/Lights/directionalLight.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/pointLight.js
var Lights_pointLight = __webpack_require__("./node_modules/@babylonjs/core/Lights/pointLight.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/spotLight.js
var Lights_spotLight = __webpack_require__("./node_modules/@babylonjs/core/Lights/spotLight.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/1.0/glTFLoaderUtils.js
class GLTFUtils {static SetMatrix(scene, source, parameter, uniformName, shaderMaterial) {let mat = null;if ("MODEL" === parameter.semantic ? mat = source.getWorldMatrix() : "PROJECTION" === parameter.semantic ? mat = scene.getProjectionMatrix() : "VIEW" === parameter.semantic ? mat = scene.getViewMatrix() : "MODELVIEWINVERSETRANSPOSE" === parameter.semantic ? mat = math_vector/* Matrix.Transpose */.y3.Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert()) : "MODELVIEW" === parameter.semantic ? mat = source.getWorldMatrix().multiply(scene.getViewMatrix()) : "MODELVIEWPROJECTION" === parameter.semantic ? mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()) : "MODELINVERSE" === parameter.semantic ? mat = source.getWorldMatrix().invert() : "VIEWINVERSE" === parameter.semantic ? mat = scene.getViewMatrix().invert() : "PROJECTIONINVERSE" === parameter.semantic ? mat = scene.getProjectionMatrix().invert() : "MODELVIEWINVERSE" === parameter.semantic ? mat = source.getWorldMatrix().multiply(scene.getViewMatrix()).invert() : "MODELVIEWPROJECTIONINVERSE" === parameter.semantic ? mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert() : "MODELINVERSETRANSPOSE" === parameter.semantic && (mat = math_vector/* Matrix.Transpose */.y3.Transpose(source.getWorldMatrix().invert())), mat) switch (parameter.type) {case EParameterType.FLOAT_MAT2:shaderMaterial.setMatrix2x2(uniformName, math_vector/* Matrix.GetAsMatrix2x2 */.y3.GetAsMatrix2x2(mat));break;case EParameterType.FLOAT_MAT3:shaderMaterial.setMatrix3x3(uniformName, math_vector/* Matrix.GetAsMatrix3x3 */.y3.GetAsMatrix3x3(mat));break;case EParameterType.FLOAT_MAT4:shaderMaterial.setMatrix(uniformName, mat);break;default:}}static SetUniform(shaderMaterial, uniform, value, type) {return type === EParameterType.FLOAT ? (shaderMaterial.setFloat(uniform, value), !0) : type === EParameterType.FLOAT_VEC2 ? (shaderMaterial.setVector2(uniform, math_vector/* Vector2.FromArray */.FM.FromArray(value)), !0) : type === EParameterType.FLOAT_VEC3 ? (shaderMaterial.setVector3(uniform, math_vector/* Vector3.FromArray */.P.FromArray(value)), !0) : !(type !== EParameterType.FLOAT_VEC4) && (shaderMaterial.setVector4(uniform, math_vector/* Vector4.FromArray */.Lt.FromArray(value)), !0);}static GetWrapMode(mode) {return mode === ETextureWrapMode.CLAMP_TO_EDGE ? Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE : mode === ETextureWrapMode.MIRRORED_REPEAT ? Textures_texture/* Texture.MIRROR_ADDRESSMODE */.x.MIRROR_ADDRESSMODE : mode === ETextureWrapMode.REPEAT ? Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE : Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE;}static GetByteStrideFromType(accessor) {const type = accessor.type;return "VEC2" === type ? 2 : "VEC3" === type ? 3 : "VEC4" === type ? 4 : "MAT2" === type ? 4 : "MAT3" === type ? 9 : "MAT4" === type ? 16 : 1;}static GetTextureFilterMode(mode) {return mode === ETextureFilterType.LINEAR || mode === ETextureFilterType.LINEAR_MIPMAP_NEAREST || mode === ETextureFilterType.LINEAR_MIPMAP_LINEAR ? Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE : mode === ETextureFilterType.NEAREST || mode === ETextureFilterType.NEAREST_MIPMAP_NEAREST ? Textures_texture/* Texture.NEAREST_SAMPLINGMODE */.x.NEAREST_SAMPLINGMODE : Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE;}static GetBufferFromBufferView(gltfRuntime, bufferView, byteOffset, byteLength, componentType) {byteOffset = bufferView.byteOffset + byteOffset;const loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer];if (byteOffset + byteLength > loadedBufferView.byteLength) throw new Error("Buffer access is out of range");const buffer = loadedBufferView.buffer;return byteOffset += loadedBufferView.byteOffset, componentType === EComponentType.BYTE ? new Int8Array(buffer, byteOffset, byteLength) : componentType === EComponentType.UNSIGNED_BYTE ? new Uint8Array(buffer, byteOffset, byteLength) : componentType === EComponentType.SHORT ? new Int16Array(buffer, byteOffset, byteLength) : componentType === EComponentType.UNSIGNED_SHORT ? new Uint16Array(buffer, byteOffset, byteLength) : new Float32Array(buffer, byteOffset, byteLength);}static GetBufferFromAccessor(gltfRuntime, accessor) {const bufferView = gltfRuntime.bufferViews[accessor.bufferView],byteLength = accessor.count * GLTFUtils.GetByteStrideFromType(accessor);return GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, accessor.byteOffset, byteLength, accessor.componentType);}static DecodeBufferToText(view) {let result = "";const length = view.byteLength;for (let i = 0; i < length; ++i) result += String.fromCharCode(view[i]);return result;}static GetDefaultMaterial(scene) {if (!GLTFUtils._DefaultMaterial) {effect/* Effect.ShadersStore.GLTFDefaultMaterialVertexShader */.Q.ShadersStore.GLTFDefaultMaterialVertexShader = "precision highp float;\n\nuniform mat4 worldView;\nuniform mat4 projection;\n\nattribute vec3 position;\n\nvoid main(void)\n{\n    gl_Position = projection * worldView * vec4(position, 1.0);\n}", effect/* Effect.ShadersStore.GLTFDefaultMaterialPixelShader */.Q.ShadersStore.GLTFDefaultMaterialPixelShader = "precision highp float;\n\nuniform vec4 u_emission;\n\nvoid main(void)\n{\n    gl_FragColor = u_emission;\n}";GLTFUtils._DefaultMaterial = new Materials_shaderMaterial/* ShaderMaterial */.j("GLTFDefaultMaterial", scene, { vertex: "GLTFDefaultMaterial", fragment: "GLTFDefaultMaterial" }, { attributes: ["position"], uniforms: ["worldView", "projection", "u_emission"], samplers: [], needAlphaBlending: !1 }), GLTFUtils._DefaultMaterial.setColor4("u_emission", new math_color/* Color4 */.HE(.5, .5, .5, 1));}return GLTFUtils._DefaultMaterial;}}GLTFUtils._DefaultMaterial = null;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/constants.js
var constants = __webpack_require__("./node_modules/@babylonjs/core/Engines/constants.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/1.0/glTFLoader.js
var ETokenType;(function (ETokenType) {ETokenType[ETokenType.IDENTIFIER = 1] = "IDENTIFIER", ETokenType[ETokenType.UNKNOWN = 2] = "UNKNOWN", ETokenType[ETokenType.END_OF_INPUT = 3] = "END_OF_INPUT";})(ETokenType || (ETokenType = {}));class Tokenizer {constructor(toParse) {this._pos = 0, this.currentToken = ETokenType.UNKNOWN, this.currentIdentifier = "", this.currentString = "", this.isLetterOrDigitPattern = /^[a-zA-Z0-9]+$/, this._toParse = toParse, this._maxPos = toParse.length;}getNextToken() {if (this.isEnd()) return ETokenType.END_OF_INPUT;if (this.currentString = this.read(), this.currentToken = ETokenType.UNKNOWN, "_" === this.currentString || this.isLetterOrDigitPattern.test(this.currentString)) for (this.currentToken = ETokenType.IDENTIFIER, this.currentIdentifier = this.currentString; !this.isEnd() && (this.isLetterOrDigitPattern.test(this.currentString = this.peek()) || "_" === this.currentString);) this.currentIdentifier += this.currentString, this.forward();return this.currentToken;}peek() {return this._toParse[this._pos];}read() {return this._toParse[this._pos++];}forward() {this._pos++;}isEnd() {return this._pos >= this._maxPos;}}const glTFTransforms = ["MODEL", "VIEW", "PROJECTION", "MODELVIEW", "MODELVIEWPROJECTION", "JOINTMATRIX"],babylonTransforms = ["world", "view", "projection", "worldView", "worldViewProjection", "mBones"],glTFAnimationPaths = ["translation", "rotation", "scale"],babylonAnimationPaths = ["position", "rotationQuaternion", "scaling"],parseBuffers = (parsedBuffers, gltfRuntime) => {for (const buf in parsedBuffers) {const parsedBuffer = parsedBuffers[buf];gltfRuntime.buffers[buf] = parsedBuffer, gltfRuntime.buffersCount++;}},parseShaders = (parsedShaders, gltfRuntime) => {for (const sha in parsedShaders) {const parsedShader = parsedShaders[sha];gltfRuntime.shaders[sha] = parsedShader, gltfRuntime.shaderscount++;}},parseObject = (parsedObjects, runtimeProperty, gltfRuntime) => {for (const object in parsedObjects) {const parsedObject = parsedObjects[object];gltfRuntime[runtimeProperty][object] = parsedObject;}},normalizeUVs = (buffer) => {if (buffer) for (let i = 0; i < buffer.length / 2; i++) buffer[2 * i + 1] = 1 - buffer[2 * i + 1];},getAttribute = (attributeParameter) => {if ("NORMAL" === attributeParameter.semantic) return "normal";if ("POSITION" === attributeParameter.semantic) return "position";if ("JOINT" === attributeParameter.semantic) return "matricesIndices";if ("WEIGHT" === attributeParameter.semantic) return "matricesWeights";if ("COLOR" === attributeParameter.semantic) return "color";if (attributeParameter.semantic && -1 !== attributeParameter.semantic.indexOf("TEXCOORD_")) {const channel = +attributeParameter.semantic.split("_")[1];return "uv" + (0 == channel ? "" : channel + 1);}return null;},loadAnimations = (gltfRuntime) => {for (const anim in gltfRuntime.animations) {const animation = gltfRuntime.animations[anim];if (!animation.channels || !animation.samplers) continue;let lastAnimation = null;for (let i = 0; i < animation.channels.length; i++) {const channel = animation.channels[i],sampler = animation.samplers[channel.sampler];if (!sampler) continue;let inputData = null,outputData = null;animation.parameters ? (inputData = animation.parameters[sampler.input], outputData = animation.parameters[sampler.output]) : (inputData = sampler.input, outputData = sampler.output);const bufferInput = GLTFUtils.GetBufferFromAccessor(gltfRuntime, gltfRuntime.accessors[inputData]),bufferOutput = GLTFUtils.GetBufferFromAccessor(gltfRuntime, gltfRuntime.accessors[outputData]),targetId = channel.target.id;let targetNode = gltfRuntime.scene.getNodeById(targetId);if (null === targetNode && (targetNode = gltfRuntime.scene.getNodeByName(targetId)), null === targetNode) {tools/* Tools.Warn */.w1.Warn("Creating animation named " + anim + ". But cannot find node named " + targetId + " to attach to");continue;}const isBone = targetNode instanceof Bones_bone/* Bone */.N;let targetPath = channel.target.path;const targetPathIndex = glTFAnimationPaths.indexOf(targetPath);-1 !== targetPathIndex && (targetPath = babylonAnimationPaths[targetPathIndex]);let animationType = Animations_animation/* Animation.ANIMATIONTYPE_MATRIX */.f.ANIMATIONTYPE_MATRIX;isBone || ("rotationQuaternion" === targetPath ? (animationType = Animations_animation/* Animation.ANIMATIONTYPE_QUATERNION */.f.ANIMATIONTYPE_QUATERNION, targetNode.rotationQuaternion = new math_vector/* Quaternion */._f()) : animationType = Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3);let babylonAnimation = null;const keys = [];let arrayOffset = 0,modifyKey = !1;isBone && lastAnimation && lastAnimation.getKeys().length === bufferInput.length && (babylonAnimation = lastAnimation, modifyKey = !0), modifyKey || (gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer, babylonAnimation = new Animations_animation/* Animation */.f(anim, isBone ? "_matrix" : targetPath, 1, animationType, Animations_animation/* Animation.ANIMATIONLOOPMODE_CYCLE */.f.ANIMATIONLOOPMODE_CYCLE), gltfRuntime.scene._blockEntityCollection = !1);for (let value, j = 0; j < bufferInput.length; j++) {if (value = null, "rotationQuaternion" === targetPath ? (value = math_vector/* Quaternion.FromArray */._f.FromArray([bufferOutput[arrayOffset], bufferOutput[arrayOffset + 1], bufferOutput[arrayOffset + 2], bufferOutput[arrayOffset + 3]]), arrayOffset += 4) : (value = math_vector/* Vector3.FromArray */.P.FromArray([bufferOutput[arrayOffset], bufferOutput[arrayOffset + 1], bufferOutput[arrayOffset + 2]]), arrayOffset += 3), isBone) {const bone = targetNode;let translation = math_vector/* Vector3.Zero */.P.Zero(),rotationQuaternion = new math_vector/* Quaternion */._f(),scaling = math_vector/* Vector3.Zero */.P.Zero(),mat = bone.getBaseMatrix();modifyKey && lastAnimation && (mat = lastAnimation.getKeys()[j].value), mat.decompose(scaling, rotationQuaternion, translation), "position" === targetPath ? translation = value : "rotationQuaternion" === targetPath ? rotationQuaternion = value : scaling = value, value = math_vector/* Matrix.Compose */.y3.Compose(scaling, rotationQuaternion, translation);}modifyKey ? lastAnimation && (lastAnimation.getKeys()[j].value = value) : keys.push({ frame: bufferInput[j], value: value });}!modifyKey && babylonAnimation && (babylonAnimation.setKeys(keys), targetNode.animations.push(babylonAnimation)), lastAnimation = babylonAnimation, gltfRuntime.scene.stopAnimation(targetNode), gltfRuntime.scene.beginAnimation(targetNode, 0, bufferInput[bufferInput.length - 1], !0, 1);}}},configureBoneTransformation = (node) => {let mat = null;if (node.translation || node.rotation || node.scale) {const scale = math_vector/* Vector3.FromArray */.P.FromArray(node.scale || [1, 1, 1]),rotation = math_vector/* Quaternion.FromArray */._f.FromArray(node.rotation || [0, 0, 0, 1]),position = math_vector/* Vector3.FromArray */.P.FromArray(node.translation || [0, 0, 0]);mat = math_vector/* Matrix.Compose */.y3.Compose(scale, rotation, position);} else mat = math_vector/* Matrix.FromArray */.y3.FromArray(node.matrix);return mat;},getParentBone = (gltfRuntime, skins, jointName, newSkeleton) => {for (let i = 0; i < newSkeleton.bones.length; i++) if (newSkeleton.bones[i].name === jointName) return newSkeleton.bones[i];const nodes = gltfRuntime.nodes;for (const nde in nodes) {const node = nodes[nde];if (!node.jointName) continue;const children = node.children;for (let i = 0; i < children.length; i++) {const child = gltfRuntime.nodes[children[i]];if (child.jointName && child.jointName === jointName) {const mat = configureBoneTransformation(node),bone = new Bones_bone/* Bone */.N(node.name || "", newSkeleton, getParentBone(gltfRuntime, skins, node.jointName, newSkeleton), mat);return bone.id = nde, bone;}}}return null;},getNodeToRoot = (nodesToRoot, id) => {for (let i = 0; i < nodesToRoot.length; i++) {const nodeToRoot = nodesToRoot[i];for (let j = 0; j < nodeToRoot.node.children.length; j++) {const child = nodeToRoot.node.children[j];if (child === id) return nodeToRoot.bone;}}return null;},getJointNode = (gltfRuntime, jointName) => {const nodes = gltfRuntime.nodes;let node = nodes[jointName];if (node) return { node: node, id: jointName };for (const nde in nodes) if (node = nodes[nde], node.jointName === jointName) return { node: node, id: nde };return null;},nodeIsInJoints = (skins, id) => {for (let i = 0; i < skins.jointNames.length; i++) if (skins.jointNames[i] === id) return !0;return !1;},getNodesToRoot = (gltfRuntime, newSkeleton, skins, nodesToRoot) => {for (const nde in gltfRuntime.nodes) {const node = gltfRuntime.nodes[nde],id = nde;if (!node.jointName || nodeIsInJoints(skins, node.jointName)) continue;const mat = configureBoneTransformation(node),bone = new Bones_bone/* Bone */.N(node.name || "", newSkeleton, null, mat);bone.id = id, nodesToRoot.push({ bone: bone, node: node, id: id });}for (let i = 0; i < nodesToRoot.length; i++) {const nodeToRoot = nodesToRoot[i],children = nodeToRoot.node.children;for (let child, j = 0; j < children.length; j++) {child = null;for (let k = 0; k < nodesToRoot.length; k++) if (nodesToRoot[k].id === children[j]) {child = nodesToRoot[k];break;}child && (child.bone._parent = nodeToRoot.bone, nodeToRoot.bone.children.push(child.bone));}}},importSkeleton = (gltfRuntime, skins, mesh, newSkeleton) => {if (newSkeleton || (newSkeleton = new skeleton/* Skeleton */.O(skins.name || "", "", gltfRuntime.scene)), !skins.babylonSkeleton) return newSkeleton;const nodesToRoot = [],nodesToRootToAdd = [];getNodesToRoot(gltfRuntime, newSkeleton, skins, nodesToRoot), newSkeleton.bones = [];for (let i = 0; i < skins.jointNames.length; i++) {const jointNode = getJointNode(gltfRuntime, skins.jointNames[i]);if (!jointNode) continue;const node = jointNode.node;if (!node) {tools/* Tools.Warn */.w1.Warn("Joint named " + skins.jointNames[i] + " does not exist");continue;}const id = jointNode.id,existingBone = gltfRuntime.scene.getBoneById(id);if (existingBone) {newSkeleton.bones.push(existingBone);continue;}let foundBone = !1,parentBone = null;for (let j = 0; j < i; j++) {const jointNode = getJointNode(gltfRuntime, skins.jointNames[j]);if (!jointNode) continue;const joint = jointNode.node;if (!joint) {tools/* Tools.Warn */.w1.Warn("Joint named " + skins.jointNames[j] + " does not exist when looking for parent");continue;}const children = joint.children;if (children) {foundBone = !1;for (let k = 0; k < children.length; k++) if (children[k] === id) {parentBone = getParentBone(gltfRuntime, skins, skins.jointNames[j], newSkeleton), foundBone = !0;break;}if (foundBone) break;}}const mat = configureBoneTransformation(node);!parentBone && 0 < nodesToRoot.length && (parentBone = getNodeToRoot(nodesToRoot, id), parentBone && -1 === nodesToRootToAdd.indexOf(parentBone) && nodesToRootToAdd.push(parentBone));const bone = new Bones_bone/* Bone */.N(node.jointName || "", newSkeleton, parentBone, mat);bone.id = id;}const bones = newSkeleton.bones;newSkeleton.bones = [];for (let i = 0; i < skins.jointNames.length; i++) {const jointNode = getJointNode(gltfRuntime, skins.jointNames[i]);if (jointNode) for (let j = 0; j < bones.length; j++) if (bones[j].id === jointNode.id) {newSkeleton.bones.push(bones[j]);break;}}newSkeleton.prepare();for (let i = 0; i < nodesToRootToAdd.length; i++) newSkeleton.bones.push(nodesToRootToAdd[i]);return newSkeleton;},importMesh = (gltfRuntime, node, meshes, id, newMesh) => {if (newMesh || (gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer, newMesh = new Meshes_mesh/* Mesh */.Kj(node.name || "", gltfRuntime.scene), newMesh._parentContainer = gltfRuntime.assetContainer, gltfRuntime.scene._blockEntityCollection = !1, newMesh.id = id), !node.babylonNode) return newMesh;const subMaterials = [];let vertexData = null;const verticesStarts = [],verticesCounts = [],indexStarts = [],indexCounts = [];for (let meshIndex = 0; meshIndex < meshes.length; meshIndex++) {const meshId = meshes[meshIndex],mesh = gltfRuntime.meshes[meshId];if (mesh) for (let i = 0; i < mesh.primitives.length; i++) {const tempVertexData = new mesh_vertexData/* VertexData */.x(),primitive = mesh.primitives[i];4 !== primitive.mode;const attributes = primitive.attributes;let accessor = null,buffer = null;for (const semantic in attributes) if (accessor = gltfRuntime.accessors[attributes[semantic]], buffer = GLTFUtils.GetBufferFromAccessor(gltfRuntime, accessor), "NORMAL" == semantic) tempVertexData.normals = new Float32Array(buffer.length), tempVertexData.normals.set(buffer);else if ("POSITION" === semantic) {if (GLTFFileLoader.HomogeneousCoordinates) {tempVertexData.positions = new Float32Array(buffer.length - buffer.length / 4);for (let j = 0; j < buffer.length; j += 4) tempVertexData.positions[j] = buffer[j], tempVertexData.positions[j + 1] = buffer[j + 1], tempVertexData.positions[j + 2] = buffer[j + 2];} else tempVertexData.positions = new Float32Array(buffer.length), tempVertexData.positions.set(buffer);verticesCounts.push(tempVertexData.positions.length);} else if (-1 !== semantic.indexOf("TEXCOORD_")) {const channel = +semantic.split("_")[1],uvKind = Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind + (0 === channel ? "" : channel + 1),uvs = new Float32Array(buffer.length);uvs.set(buffer), normalizeUVs(uvs), tempVertexData.set(uvs, uvKind);} else "JOINT" === semantic ? (tempVertexData.matricesIndices = new Float32Array(buffer.length), tempVertexData.matricesIndices.set(buffer)) : "WEIGHT" === semantic ? (tempVertexData.matricesWeights = new Float32Array(buffer.length), tempVertexData.matricesWeights.set(buffer)) : "COLOR" === semantic && (tempVertexData.colors = new Float32Array(buffer.length), tempVertexData.colors.set(buffer));if (accessor = gltfRuntime.accessors[primitive.indices], accessor) buffer = GLTFUtils.GetBufferFromAccessor(gltfRuntime, accessor), tempVertexData.indices = new Int32Array(buffer.length), tempVertexData.indices.set(buffer), indexCounts.push(tempVertexData.indices.length);else {const indices = [];for (let j = 0; j < tempVertexData.positions.length / 3; j++) indices.push(j);tempVertexData.indices = new Int32Array(indices), indexCounts.push(tempVertexData.indices.length);}vertexData ? vertexData.merge(tempVertexData) : vertexData = tempVertexData;const material = gltfRuntime.scene.getMaterialById(primitive.material);subMaterials.push(null === material ? GLTFUtils.GetDefaultMaterial(gltfRuntime.scene) : material), verticesStarts.push(0 === verticesStarts.length ? 0 : verticesStarts[verticesStarts.length - 1] + verticesCounts[verticesCounts.length - 2]), indexStarts.push(0 === indexStarts.length ? 0 : indexStarts[indexStarts.length - 1] + indexCounts[indexCounts.length - 2]);}}let material;gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer, 1 < subMaterials.length ? (material = new multiMaterial/* MultiMaterial */.G("multimat" + id, gltfRuntime.scene), material.subMaterials = subMaterials) : material = new Materials_standardMaterial/* StandardMaterial */.K("multimat" + id, gltfRuntime.scene), 1 === subMaterials.length && (material = subMaterials[0]), material._parentContainer = gltfRuntime.assetContainer, newMesh.material || (newMesh.material = material), new geometry/* Geometry */.Z(id, gltfRuntime.scene, vertexData, !1, newMesh), newMesh.computeWorldMatrix(!0), gltfRuntime.scene._blockEntityCollection = !1, newMesh.subMeshes = [];let index = 0;for (let meshIndex = 0; meshIndex < meshes.length; meshIndex++) {const meshId = meshes[meshIndex],mesh = gltfRuntime.meshes[meshId];if (mesh) for (let i = 0; i < mesh.primitives.length; i++) 4 !== mesh.primitives[i].mode, subMesh/* SubMesh.AddToMesh */.P.AddToMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, !0), index++;}return newMesh;},configureNode = (newNode, position, rotation, scaling) => {newNode.position && (newNode.position = position), (newNode.rotationQuaternion || newNode.rotation) && (newNode.rotationQuaternion = rotation), newNode.scaling && (newNode.scaling = scaling);},configureNodeFromMatrix = (newNode, node) => {if (node.matrix) {const position = new math_vector/* Vector3 */.P(0, 0, 0),rotation = new math_vector/* Quaternion */._f(),scaling = new math_vector/* Vector3 */.P(0, 0, 0),mat = math_vector/* Matrix.FromArray */.y3.FromArray(node.matrix);mat.decompose(scaling, rotation, position), configureNode(newNode, position, rotation, scaling);} else node.translation && node.rotation && node.scale && configureNode(newNode, math_vector/* Vector3.FromArray */.P.FromArray(node.translation), math_vector/* Quaternion.FromArray */._f.FromArray(node.rotation), math_vector/* Vector3.FromArray */.P.FromArray(node.scale));newNode.computeWorldMatrix(!0);},importNode = (gltfRuntime, node, id) => {let lastNode = null;if (gltfRuntime.importOnlyMeshes && (node.skin || node.meshes) && gltfRuntime.importMeshesNames && 0 < gltfRuntime.importMeshesNames.length && -1 === gltfRuntime.importMeshesNames.indexOf(node.name || "")) return null;if (node.skin) {if (node.meshes) {const skin = gltfRuntime.skins[node.skin],newMesh = importMesh(gltfRuntime, node, node.meshes, id, node.babylonNode);newMesh.skeleton = gltfRuntime.scene.getLastSkeletonById(node.skin), null === newMesh.skeleton && (newMesh.skeleton = importSkeleton(gltfRuntime, skin, newMesh, skin.babylonSkeleton), !skin.babylonSkeleton && (skin.babylonSkeleton = newMesh.skeleton)), lastNode = newMesh;}} else if (node.meshes) {const newMesh = importMesh(gltfRuntime, node, node.mesh ? [node.mesh] : node.meshes, id, node.babylonNode);lastNode = newMesh;} else if (node.light && !node.babylonNode && !gltfRuntime.importOnlyMeshes) {const light = gltfRuntime.lights[node.light];if (light) if ("ambient" === light.type) {const ambienLight = light[light.type],hemiLight = new hemisphericLight/* HemisphericLight */.e(node.light, math_vector/* Vector3.Zero */.P.Zero(), gltfRuntime.scene);hemiLight.name = node.name || "", ambienLight.color && (hemiLight.diffuse = math_color/* Color3.FromArray */.Wo.FromArray(ambienLight.color)), lastNode = hemiLight;} else if ("directional" === light.type) {const directionalLight = light[light.type],dirLight = new Lights_directionalLight/* DirectionalLight */.O(node.light, math_vector/* Vector3.Zero */.P.Zero(), gltfRuntime.scene);dirLight.name = node.name || "", directionalLight.color && (dirLight.diffuse = math_color/* Color3.FromArray */.Wo.FromArray(directionalLight.color)), lastNode = dirLight;} else if ("point" === light.type) {const pointLight = light[light.type],ptLight = new Lights_pointLight/* PointLight */.c(node.light, math_vector/* Vector3.Zero */.P.Zero(), gltfRuntime.scene);ptLight.name = node.name || "", pointLight.color && (ptLight.diffuse = math_color/* Color3.FromArray */.Wo.FromArray(pointLight.color)), lastNode = ptLight;} else if ("spot" === light.type) {const spotLight = light[light.type],spLight = new Lights_spotLight/* SpotLight */.P(node.light, math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero(), 0, 0, gltfRuntime.scene);spLight.name = node.name || "", spotLight.color && (spLight.diffuse = math_color/* Color3.FromArray */.Wo.FromArray(spotLight.color)), spotLight.fallOfAngle && (spLight.angle = spotLight.fallOfAngle), spotLight.fallOffExponent && (spLight.exponent = spotLight.fallOffExponent), lastNode = spLight;}} else if (node.camera && !node.babylonNode && !gltfRuntime.importOnlyMeshes) {const camera = gltfRuntime.cameras[node.camera];if (camera) {if (gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer, "orthographic" === camera.type) {const orthoCamera = new freeCamera/* FreeCamera */.c(node.camera, math_vector/* Vector3.Zero */.P.Zero(), gltfRuntime.scene, !1);orthoCamera.name = node.name || "", orthoCamera.mode = Cameras_camera/* Camera.ORTHOGRAPHIC_CAMERA */.V.ORTHOGRAPHIC_CAMERA, orthoCamera.attachControl(), lastNode = orthoCamera, orthoCamera._parentContainer = gltfRuntime.assetContainer;} else if ("perspective" === camera.type) {const perspectiveCamera = camera[camera.type],persCamera = new freeCamera/* FreeCamera */.c(node.camera, math_vector/* Vector3.Zero */.P.Zero(), gltfRuntime.scene, !1);persCamera.name = node.name || "", persCamera.attachControl(), perspectiveCamera.aspectRatio || (perspectiveCamera.aspectRatio = gltfRuntime.scene.getEngine().getRenderWidth() / gltfRuntime.scene.getEngine().getRenderHeight()), perspectiveCamera.znear && perspectiveCamera.zfar && (persCamera.maxZ = perspectiveCamera.zfar, persCamera.minZ = perspectiveCamera.znear), lastNode = persCamera, persCamera._parentContainer = gltfRuntime.assetContainer;}gltfRuntime.scene._blockEntityCollection = !1;}}if (!node.jointName) {if (node.babylonNode) return node.babylonNode;if (null === lastNode) {gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer;const dummy = new Meshes_mesh/* Mesh */.Kj(node.name || "", gltfRuntime.scene);dummy._parentContainer = gltfRuntime.assetContainer, gltfRuntime.scene._blockEntityCollection = !1, node.babylonNode = dummy, lastNode = dummy;}}if (null !== lastNode) {if (node.matrix && lastNode instanceof Meshes_mesh/* Mesh */.Kj) configureNodeFromMatrix(lastNode, node);else {const translation = node.translation || [0, 0, 0],rotation = node.rotation || [0, 0, 0, 1],scale = node.scale || [1, 1, 1];configureNode(lastNode, math_vector/* Vector3.FromArray */.P.FromArray(translation), math_vector/* Quaternion.FromArray */._f.FromArray(rotation), math_vector/* Vector3.FromArray */.P.FromArray(scale));}lastNode.updateCache(!0), node.babylonNode = lastNode;}return lastNode;},traverseNodes = (gltfRuntime, id, parent, meshIncluded = !1) => {const node = gltfRuntime.nodes[id];let newNode = null;if (meshIncluded = !(gltfRuntime.importOnlyMeshes && !meshIncluded && gltfRuntime.importMeshesNames) || -1 !== gltfRuntime.importMeshesNames.indexOf(node.name || "") || 0 === gltfRuntime.importMeshesNames.length, !node.jointName && meshIncluded && (newNode = importNode(gltfRuntime, node, id), null !== newNode && (newNode.id = id, newNode.parent = parent)), node.children) for (let i = 0; i < node.children.length; i++) traverseNodes(gltfRuntime, node.children[i], newNode, meshIncluded);},postLoad = (gltfRuntime) => {let currentScene = gltfRuntime.currentScene;if (currentScene) for (let i = 0; i < currentScene.nodes.length; i++) traverseNodes(gltfRuntime, currentScene.nodes[i], null);else for (const thing in gltfRuntime.scenes) {currentScene = gltfRuntime.scenes[thing];for (let i = 0; i < currentScene.nodes.length; i++) traverseNodes(gltfRuntime, currentScene.nodes[i], null);}loadAnimations(gltfRuntime);for (let i = 0; i < gltfRuntime.scene.skeletons.length; i++) {const skeleton = gltfRuntime.scene.skeletons[i];gltfRuntime.scene.beginAnimation(skeleton, 0, Number.MAX_VALUE, !0, 1);}},onBindShaderMaterial = (mesh, gltfRuntime, unTreatedUniforms, shaderMaterial, technique, material, onSuccess) => {const materialValues = material.values || technique.parameters;for (const unif in unTreatedUniforms) {const uniform = unTreatedUniforms[unif],type = uniform.type;if (!(type === EParameterType.FLOAT_MAT2 || type === EParameterType.FLOAT_MAT3 || type === EParameterType.FLOAT_MAT4)) {const value = materialValues[technique.uniforms[unif]];if (!value) continue;if (type === EParameterType.SAMPLER_2D) {const texture = gltfRuntime.textures[material.values ? value : uniform.value].babylonTexture;if (null === texture || void 0 === texture) continue;shaderMaterial.getEffect().setTexture(unif, texture);} else GLTFUtils.SetUniform(shaderMaterial.getEffect(), unif, value, type);} else if (uniform.semantic && !uniform.source && !uniform.node) GLTFUtils.SetMatrix(gltfRuntime.scene, mesh, uniform, unif, shaderMaterial.getEffect());else if (uniform.semantic && (uniform.source || uniform.node)) {let source = gltfRuntime.scene.getNodeByName(uniform.source || uniform.node || "");if (null === source && (source = gltfRuntime.scene.getNodeById(uniform.source || uniform.node || "")), null === source) continue;GLTFUtils.SetMatrix(gltfRuntime.scene, source, uniform, unif, shaderMaterial.getEffect());}}onSuccess(shaderMaterial);},prepareShaderMaterialUniforms = (gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms) => {const materialValues = material.values || technique.parameters,techniqueUniforms = technique.uniforms;for (const unif in unTreatedUniforms) {const uniform = unTreatedUniforms[unif],type = uniform.type;let value = materialValues[techniqueUniforms[unif]];if (void 0 === value && (value = uniform.value), !value) continue;const onLoadTexture = (uniformName) => (texture) => {uniform.value && uniformName && (shaderMaterial.setTexture(uniformName, texture), delete unTreatedUniforms[uniformName]);};type === EParameterType.SAMPLER_2D ? GLTFLoaderExtension.LoadTextureAsync(gltfRuntime, material.values ? value : uniform.value, onLoadTexture(unif), () => onLoadTexture(null)) : uniform.value && GLTFUtils.SetUniform(shaderMaterial, unif, material.values ? value : uniform.value, type) && delete unTreatedUniforms[unif];}},onShaderCompileError = (program, shaderMaterial, onError) => (effect, error) => {shaderMaterial.dispose(!0), onError("Cannot compile program named " + program.name + ". Error: " + error + ". Default material will be applied");},onShaderCompileSuccess = (gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms, onSuccess) => () => {prepareShaderMaterialUniforms(gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms), shaderMaterial.onBind = (mesh) => {onBindShaderMaterial(mesh, gltfRuntime, unTreatedUniforms, shaderMaterial, technique, material, onSuccess);};},parseShaderUniforms = (tokenizer, technique, unTreatedUniforms) => {for (const unif in technique.uniforms) {const uniform = technique.uniforms[unif],uniformParameter = technique.parameters[uniform];if (tokenizer.currentIdentifier === unif && uniformParameter.semantic && !uniformParameter.source && !uniformParameter.node) {const transformIndex = glTFTransforms.indexOf(uniformParameter.semantic);if (-1 !== transformIndex) return delete unTreatedUniforms[unif], babylonTransforms[transformIndex];}}return tokenizer.currentIdentifier;},importMaterials = (gltfRuntime) => {for (const mat in gltfRuntime.materials) GLTFLoaderExtension.LoadMaterialAsync(gltfRuntime, mat, () => {}, () => {});};class GLTFLoaderBase {static CreateRuntime(parsedData, scene, rootUrl) {const gltfRuntime = { extensions: {}, accessors: {}, buffers: {}, bufferViews: {}, meshes: {}, lights: {}, cameras: {}, nodes: {}, images: {}, textures: {}, shaders: {}, programs: {}, samplers: {}, techniques: {}, materials: {}, animations: {}, skins: {}, extensionsUsed: [], scenes: {}, buffersCount: 0, shaderscount: 0, scene: scene, rootUrl: rootUrl, loadedBufferCount: 0, loadedBufferViews: {}, loadedShaderCount: 0, importOnlyMeshes: !1, dummyNodes: [], assetContainer: null };return parsedData.extensions && parseObject(parsedData.extensions, "extensions", gltfRuntime), parsedData.extensionsUsed && parseObject(parsedData.extensionsUsed, "extensionsUsed", gltfRuntime), parsedData.buffers && parseBuffers(parsedData.buffers, gltfRuntime), parsedData.bufferViews && parseObject(parsedData.bufferViews, "bufferViews", gltfRuntime), parsedData.accessors && parseObject(parsedData.accessors, "accessors", gltfRuntime), parsedData.meshes && parseObject(parsedData.meshes, "meshes", gltfRuntime), parsedData.lights && parseObject(parsedData.lights, "lights", gltfRuntime), parsedData.cameras && parseObject(parsedData.cameras, "cameras", gltfRuntime), parsedData.nodes && parseObject(parsedData.nodes, "nodes", gltfRuntime), parsedData.images && parseObject(parsedData.images, "images", gltfRuntime), parsedData.textures && parseObject(parsedData.textures, "textures", gltfRuntime), parsedData.shaders && parseShaders(parsedData.shaders, gltfRuntime), parsedData.programs && parseObject(parsedData.programs, "programs", gltfRuntime), parsedData.samplers && parseObject(parsedData.samplers, "samplers", gltfRuntime), parsedData.techniques && parseObject(parsedData.techniques, "techniques", gltfRuntime), parsedData.materials && parseObject(parsedData.materials, "materials", gltfRuntime), parsedData.animations && parseObject(parsedData.animations, "animations", gltfRuntime), parsedData.skins && parseObject(parsedData.skins, "skins", gltfRuntime), parsedData.scenes && (gltfRuntime.scenes = parsedData.scenes), parsedData.scene && parsedData.scenes && (gltfRuntime.currentScene = parsedData.scenes[parsedData.scene]), gltfRuntime;}static LoadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress) {const buffer = gltfRuntime.buffers[id];tools/* Tools.IsBase64 */.w1.IsBase64(buffer.uri) ? setTimeout(() => onSuccess(new Uint8Array(tools/* Tools.DecodeBase64 */.w1.DecodeBase64(buffer.uri)))) : tools/* Tools.LoadFile */.w1.LoadFile(gltfRuntime.rootUrl + buffer.uri, (data) => onSuccess(new Uint8Array(data)), onProgress, void 0, !0, (request) => {request && onError(request.status + " " + request.statusText);});}static LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError) {const texture = gltfRuntime.textures[id];if (!texture || !texture.source) return void onError("");if (texture.babylonTexture) return void onSuccess(null);const source = gltfRuntime.images[texture.source];tools/* Tools.IsBase64 */.w1.IsBase64(source.uri) ? setTimeout(() => onSuccess(new Uint8Array(tools/* Tools.DecodeBase64 */.w1.DecodeBase64(source.uri)))) : tools/* Tools.LoadFile */.w1.LoadFile(gltfRuntime.rootUrl + source.uri, (data) => onSuccess(new Uint8Array(data)), void 0, void 0, !0, (request) => {request && onError(request.status + " " + request.statusText);});}static CreateTextureAsync(gltfRuntime, id, buffer, onSuccess) {const texture = gltfRuntime.textures[id];if (texture.babylonTexture) return void onSuccess(texture.babylonTexture);const sampler = gltfRuntime.samplers[texture.sampler],createMipMaps = sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_NEAREST || sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_LINEAR || sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_NEAREST || sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_LINEAR,samplingMode = Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE,blob = null == buffer ? new Blob() : new Blob([buffer]),blobURL = URL.createObjectURL(blob),revokeBlobURL = () => URL.revokeObjectURL(blobURL),newTexture = new Textures_texture/* Texture */.x(blobURL, gltfRuntime.scene, !createMipMaps, !0, samplingMode, revokeBlobURL, revokeBlobURL);sampler.wrapS !== void 0 && (newTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS)), sampler.wrapT !== void 0 && (newTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT)), newTexture.name = id, texture.babylonTexture = newTexture, onSuccess(newTexture);}static LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError) {const shader = gltfRuntime.shaders[id];if (tools/* Tools.IsBase64 */.w1.IsBase64(shader.uri)) {const shaderString = atob(shader.uri.split(",")[1]);onSuccess && onSuccess(shaderString);} else tools/* Tools.LoadFile */.w1.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, void 0, void 0, !1, (request) => {request && onError && onError(request.status + " " + request.statusText);});}static LoadMaterialAsync(gltfRuntime, id, onSuccess, onError) {const material = gltfRuntime.materials[id];if (!material.technique) return void (onError && onError("No technique found."));const technique = gltfRuntime.techniques[material.technique];if (!technique) {gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer;const defaultMaterial = new Materials_standardMaterial/* StandardMaterial */.K(id, gltfRuntime.scene);return defaultMaterial._parentContainer = gltfRuntime.assetContainer, gltfRuntime.scene._blockEntityCollection = !1, defaultMaterial.diffuseColor = new math_color/* Color3 */.Wo(.5, .5, .5), defaultMaterial.sideOrientation = Materials_material/* Material.CounterClockWiseSideOrientation */.F.CounterClockWiseSideOrientation, void onSuccess(defaultMaterial);}const program = gltfRuntime.programs[technique.program],states = technique.states,vertexShader = effect/* Effect.ShadersStore */.Q.ShadersStore[program.vertexShader + "VertexShader"],pixelShader = effect/* Effect.ShadersStore */.Q.ShadersStore[program.fragmentShader + "PixelShader"];let newVertexShader = "",newPixelShader = "";const vertexTokenizer = new Tokenizer(vertexShader),pixelTokenizer = new Tokenizer(pixelShader),unTreatedUniforms = {},uniforms = [],attributes = [],samplers = [];for (const unif in technique.uniforms) {const uniform = technique.uniforms[unif],uniformParameter = technique.parameters[uniform];if (unTreatedUniforms[unif] = uniformParameter, uniformParameter.semantic && !uniformParameter.node && !uniformParameter.source) {const transformIndex = glTFTransforms.indexOf(uniformParameter.semantic);-1 === transformIndex ? uniforms.push(unif) : (uniforms.push(babylonTransforms[transformIndex]), delete unTreatedUniforms[unif]);} else uniformParameter.type === EParameterType.SAMPLER_2D ? samplers.push(unif) : uniforms.push(unif);}for (const attr in technique.attributes) {const attribute = technique.attributes[attr],attributeParameter = technique.parameters[attribute];if (attributeParameter.semantic) {const name = getAttribute(attributeParameter);name && attributes.push(name);}}for (; !vertexTokenizer.isEnd() && vertexTokenizer.getNextToken();) {const tokenType = vertexTokenizer.currentToken;if (tokenType !== ETokenType.IDENTIFIER) {newVertexShader += vertexTokenizer.currentString;continue;}let foundAttribute = !1;for (const attr in technique.attributes) {const attribute = technique.attributes[attr],attributeParameter = technique.parameters[attribute];if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) {newVertexShader += getAttribute(attributeParameter), foundAttribute = !0;break;}}foundAttribute || (newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms));}for (; !pixelTokenizer.isEnd() && pixelTokenizer.getNextToken();) {const tokenType = pixelTokenizer.currentToken;if (tokenType !== ETokenType.IDENTIFIER) {newPixelShader += pixelTokenizer.currentString;continue;}newPixelShader += parseShaderUniforms(pixelTokenizer, technique, unTreatedUniforms);}const shaderPath = { vertex: program.vertexShader + id, fragment: program.fragmentShader + id },options = { attributes: attributes, uniforms: uniforms, samplers: samplers, needAlphaBlending: states && states.enable && -1 !== states.enable.indexOf(3042) };effect/* Effect.ShadersStore */.Q.ShadersStore[program.vertexShader + id + "VertexShader"] = newVertexShader, effect/* Effect.ShadersStore */.Q.ShadersStore[program.fragmentShader + id + "PixelShader"] = newPixelShader;const shaderMaterial = new Materials_shaderMaterial/* ShaderMaterial */.j(id, gltfRuntime.scene, shaderPath, options);if (shaderMaterial.onError = onShaderCompileError(program, shaderMaterial, onError), shaderMaterial.onCompiled = onShaderCompileSuccess(gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms, onSuccess), shaderMaterial.sideOrientation = Materials_material/* Material.CounterClockWiseSideOrientation */.F.CounterClockWiseSideOrientation, states && states.functions) {const functions = states.functions;functions.cullFace && functions.cullFace[0] !== ECullingType.BACK && (shaderMaterial.backFaceCulling = !1);const blendFunc = functions.blendFuncSeparate;blendFunc && (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_ALPHA && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE ? shaderMaterial.alphaMode = constants/* Constants.ALPHA_COMBINE */.g.ALPHA_COMBINE : blendFunc[0] === EBlendingFunction.ONE && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE ? shaderMaterial.alphaMode = constants/* Constants.ALPHA_ONEONE */.g.ALPHA_ONEONE : blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE ? shaderMaterial.alphaMode = constants/* Constants.ALPHA_ADD */.g.ALPHA_ADD : blendFunc[0] === EBlendingFunction.ZERO && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE ? shaderMaterial.alphaMode = constants/* Constants.ALPHA_SUBTRACT */.g.ALPHA_SUBTRACT : blendFunc[0] === EBlendingFunction.DST_COLOR && blendFunc[1] === EBlendingFunction.ZERO && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE ? shaderMaterial.alphaMode = constants/* Constants.ALPHA_MULTIPLY */.g.ALPHA_MULTIPLY : blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE && (shaderMaterial.alphaMode = constants/* Constants.ALPHA_MAXIMIZED */.g.ALPHA_MAXIMIZED));}}}class GLTFLoader {static RegisterExtension(extension) {return GLTFLoader.Extensions[extension.name] ? void tools/* Tools.Error */.w1.Error("Tool with the same name \"" + extension.name + "\" already exists") : void (GLTFLoader.Extensions[extension.name] = extension);}dispose() {}_importMeshAsync(meshesNames, scene, data, rootUrl, assetContainer, onSuccess, onProgress, onError) {return scene.useRightHandedSystem = !0, GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, (gltfRuntime) => {gltfRuntime.assetContainer = assetContainer, gltfRuntime.importOnlyMeshes = !0, "" === meshesNames ? gltfRuntime.importMeshesNames = [] : "string" == typeof meshesNames ? gltfRuntime.importMeshesNames = [meshesNames] : meshesNames && !(meshesNames instanceof Array) ? gltfRuntime.importMeshesNames = [meshesNames] : (gltfRuntime.importMeshesNames = [], tools/* Tools.Warn */.w1.Warn("Argument meshesNames must be of type string or string[]")), this._createNodes(gltfRuntime);const meshes = [],skeletons = [];for (const nde in gltfRuntime.nodes) {const node = gltfRuntime.nodes[nde];node.babylonNode instanceof abstractMesh/* AbstractMesh */.x && meshes.push(node.babylonNode);}for (const skl in gltfRuntime.skins) {const skin = gltfRuntime.skins[skl];skin.babylonSkeleton instanceof skeleton/* Skeleton */.O && skeletons.push(skin.babylonSkeleton);}this._loadBuffersAsync(gltfRuntime, () => {this._loadShadersAsync(gltfRuntime, () => {importMaterials(gltfRuntime), postLoad(gltfRuntime), !GLTFFileLoader.IncrementalLoading && onSuccess && onSuccess(meshes, skeletons);});}), GLTFFileLoader.IncrementalLoading && onSuccess && onSuccess(meshes, skeletons);}, onError), !0;}importMeshAsync(meshesNames, scene, assetContainer, data, rootUrl, onProgress) {return new Promise((resolve, reject) => {this._importMeshAsync(meshesNames, scene, data, rootUrl, assetContainer, (meshes, skeletons) => {resolve({ meshes: meshes, particleSystems: [], skeletons: skeletons, animationGroups: [], lights: [], transformNodes: [], geometries: [] });}, onProgress, (message) => {reject(new Error(message));});});}_loadAsync(scene, data, rootUrl, onSuccess, onProgress, onError) {scene.useRightHandedSystem = !0, GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, (gltfRuntime) => {GLTFLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => {this._createNodes(gltfRuntime), this._loadBuffersAsync(gltfRuntime, () => {this._loadShadersAsync(gltfRuntime, () => {importMaterials(gltfRuntime), postLoad(gltfRuntime), GLTFFileLoader.IncrementalLoading || onSuccess();});}), GLTFFileLoader.IncrementalLoading && onSuccess();}, onError);}, onError);}loadAsync(scene, data, rootUrl, onProgress) {return new Promise((resolve, reject) => {this._loadAsync(scene, data, rootUrl, () => {resolve();}, onProgress, (message) => {reject(new Error(message));});});}_loadShadersAsync(gltfRuntime, onload) {let hasShaders = !1;const processShader = (sha, shader) => {GLTFLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, (shaderString) => {shaderString instanceof ArrayBuffer || (gltfRuntime.loadedShaderCount++, shaderString && (effect/* Effect.ShadersStore */.Q.ShadersStore[sha + (shader.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString), gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount && onload());}, () => {tools/* Tools.Error */.w1.Error("Error when loading shader program named " + sha + " located at " + shader.uri);});};for (const sha in gltfRuntime.shaders) {hasShaders = !0;const shader = gltfRuntime.shaders[sha];shader ? processShader.bind(this, sha, shader)() : tools/* Tools.Error */.w1.Error("No shader named: " + sha);}hasShaders || onload();}_loadBuffersAsync(gltfRuntime, onLoad) {let hasBuffers = !1;const processBuffer = (buf, buffer) => {GLTFLoaderExtension.LoadBufferAsync(gltfRuntime, buf, (bufferView) => {gltfRuntime.loadedBufferCount++, bufferView && (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength && tools/* Tools.Error */.w1.Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer.byteLength), gltfRuntime.loadedBufferViews[buf] = bufferView), gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount && onLoad();}, () => {tools/* Tools.Error */.w1.Error("Error when loading buffer named " + buf + " located at " + buffer.uri);});};for (const buf in gltfRuntime.buffers) {hasBuffers = !0;const buffer = gltfRuntime.buffers[buf];buffer ? processBuffer.bind(this, buf, buffer)() : tools/* Tools.Error */.w1.Error("No buffer named: " + buf);}hasBuffers || onLoad();}_createNodes(gltfRuntime) {let currentScene = gltfRuntime.currentScene;if (currentScene) for (let i = 0; i < currentScene.nodes.length; i++) traverseNodes(gltfRuntime, currentScene.nodes[i], null);else for (const thing in gltfRuntime.scenes) {currentScene = gltfRuntime.scenes[thing];for (let i = 0; i < currentScene.nodes.length; i++) traverseNodes(gltfRuntime, currentScene.nodes[i], null);}}}GLTFLoader.Extensions = {};class GLTFLoaderExtension {constructor(name) {this._name = name;}get name() {return this._name;}loadRuntimeAsync() {return !1;}loadRuntimeExtensionsAsync() {return !1;}loadBufferAsync() {return !1;}loadTextureBufferAsync() {return !1;}createTextureAsync() {return !1;}loadShaderStringAsync() {return !1;}loadMaterialAsync() {return !1;}static LoadRuntimeAsync(scene, data, rootUrl, onSuccess, onError) {GLTFLoaderExtension._ApplyExtensions((loaderExtension) => loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError), () => {setTimeout(() => {onSuccess && onSuccess(GLTFLoaderBase.CreateRuntime(data.json, scene, rootUrl));});});}static LoadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError) {GLTFLoaderExtension._ApplyExtensions((loaderExtension) => loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError), () => {setTimeout(() => {onSuccess();});});}static LoadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress) {GLTFLoaderExtension._ApplyExtensions((loaderExtension) => loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress), () => {GLTFLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress);});}static LoadTextureAsync(gltfRuntime, id, onSuccess, onError) {GLTFLoaderExtension._LoadTextureBufferAsync(gltfRuntime, id, (buffer) => {buffer && GLTFLoaderExtension._CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);}, onError);}static LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError) {GLTFLoaderExtension._ApplyExtensions((loaderExtension) => loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError), () => {GLTFLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError);});}static LoadMaterialAsync(gltfRuntime, id, onSuccess, onError) {GLTFLoaderExtension._ApplyExtensions((loaderExtension) => loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError), () => {GLTFLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError);});}static _LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError) {GLTFLoaderExtension._ApplyExtensions((loaderExtension) => loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError), () => {GLTFLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);});}static _CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError) {GLTFLoaderExtension._ApplyExtensions((loaderExtension) => loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), () => {GLTFLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess);});}static _ApplyExtensions(func, defaultFunc) {for (const extensionName in GLTFLoader.Extensions) {const loaderExtension = GLTFLoader.Extensions[extensionName];if (func(loaderExtension)) return;}defaultFunc();}}GLTFFileLoader._CreateGLTF1Loader = () => new GLTFLoader();
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/1.0/glTFBinaryExtension.js
const BinaryExtensionBufferName = "binary_glTF";class GLTFBinaryExtension extends GLTFLoaderExtension {constructor() {super("KHR_binary_glTF");}loadRuntimeAsync(scene, data, rootUrl, onSuccess) {const extensionsUsed = data.json.extensionsUsed;return !!(extensionsUsed && -1 !== extensionsUsed.indexOf(this.name) && data.bin) && (this._bin = data.bin, onSuccess(GLTFLoaderBase.CreateRuntime(data.json, scene, rootUrl)), !0);}loadBufferAsync(gltfRuntime, id, onSuccess, onError) {return -1 !== gltfRuntime.extensionsUsed.indexOf(this.name) && !(id !== BinaryExtensionBufferName) && (this._bin.readAsync(0, this._bin.byteLength).then(onSuccess, (error) => onError(error.message)), !0);}loadTextureBufferAsync(gltfRuntime, id, onSuccess) {const texture = gltfRuntime.textures[id],source = gltfRuntime.images[texture.source];if (!source.extensions || !(this.name in source.extensions)) return !1;const sourceExt = source.extensions[this.name],bufferView = gltfRuntime.bufferViews[sourceExt.bufferView],buffer = GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE);return onSuccess(buffer), !0;}loadShaderStringAsync(gltfRuntime, id, onSuccess) {const shader = gltfRuntime.shaders[id];if (!shader.extensions || !(this.name in shader.extensions)) return !1;const binaryExtensionShader = shader.extensions[this.name],bufferView = gltfRuntime.bufferViews[binaryExtensionShader.bufferView],shaderBytes = GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE);return setTimeout(() => {const shaderString = GLTFUtils.DecodeBufferToText(shaderBytes);onSuccess(shaderString);}), !0;}}GLTFLoader.RegisterExtension(new GLTFBinaryExtension());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/1.0/glTFMaterialsCommonExtension.js
class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {constructor() {super("KHR_materials_common");}loadRuntimeExtensionsAsync(gltfRuntime) {if (!gltfRuntime.extensions) return !1;const extension = gltfRuntime.extensions[this.name];if (!extension) return !1;const lights = extension.lights;if (lights) for (const thing in lights) {const light = lights[thing];switch (light.type) {case "ambient":{const ambientLight = new hemisphericLight/* HemisphericLight */.e(light.name, new math_vector/* Vector3 */.P(0, 1, 0), gltfRuntime.scene),ambient = light.ambient;ambient && (ambientLight.diffuse = math_color/* Color3.FromArray */.Wo.FromArray(ambient.color || [1, 1, 1]));break;}case "point":{const pointLight = new Lights_pointLight/* PointLight */.c(light.name, new math_vector/* Vector3 */.P(10, 10, 10), gltfRuntime.scene),point = light.point;point && (pointLight.diffuse = math_color/* Color3.FromArray */.Wo.FromArray(point.color || [1, 1, 1]));break;}case "directional":{const dirLight = new Lights_directionalLight/* DirectionalLight */.O(light.name, new math_vector/* Vector3 */.P(0, -1, 0), gltfRuntime.scene),directional = light.directional;directional && (dirLight.diffuse = math_color/* Color3.FromArray */.Wo.FromArray(directional.color || [1, 1, 1]));break;}case "spot":{const spot = light.spot;if (spot) {const spotLight = new Lights_spotLight/* SpotLight */.P(light.name, new math_vector/* Vector3 */.P(0, 10, 0), new math_vector/* Vector3 */.P(0, -1, 0), spot.fallOffAngle || Math.PI, spot.fallOffExponent || 0, gltfRuntime.scene);spotLight.diffuse = math_color/* Color3.FromArray */.Wo.FromArray(spot.color || [1, 1, 1]);}break;}default:tools/* Tools.Warn */.w1.Warn("GLTF Material Common extension: light type \"" + light.type + "\u201D not supported");}}return !1;}loadMaterialAsync(gltfRuntime, id, onSuccess, onError) {const material = gltfRuntime.materials[id];if (!material || !material.extensions) return !1;const extension = material.extensions[this.name];if (!extension) return !1;const standardMaterial = new Materials_standardMaterial/* StandardMaterial */.K(id, gltfRuntime.scene);return standardMaterial.sideOrientation = Materials_material/* Material.CounterClockWiseSideOrientation */.F.CounterClockWiseSideOrientation, "CONSTANT" === extension.technique && (standardMaterial.disableLighting = !0), standardMaterial.backFaceCulling = void 0 !== extension.doubleSided && !extension.doubleSided, standardMaterial.alpha = void 0 === extension.values.transparency ? 1 : extension.values.transparency, standardMaterial.specularPower = void 0 === extension.values.shininess ? 0 : extension.values.shininess, "string" == typeof extension.values.ambient ? this._loadTexture(gltfRuntime, extension.values.ambient, standardMaterial, "ambientTexture", onError) : standardMaterial.ambientColor = math_color/* Color3.FromArray */.Wo.FromArray(extension.values.ambient || [0, 0, 0]), "string" == typeof extension.values.diffuse ? this._loadTexture(gltfRuntime, extension.values.diffuse, standardMaterial, "diffuseTexture", onError) : standardMaterial.diffuseColor = math_color/* Color3.FromArray */.Wo.FromArray(extension.values.diffuse || [0, 0, 0]), "string" == typeof extension.values.emission ? this._loadTexture(gltfRuntime, extension.values.emission, standardMaterial, "emissiveTexture", onError) : standardMaterial.emissiveColor = math_color/* Color3.FromArray */.Wo.FromArray(extension.values.emission || [0, 0, 0]), "string" == typeof extension.values.specular ? this._loadTexture(gltfRuntime, extension.values.specular, standardMaterial, "specularTexture", onError) : standardMaterial.specularColor = math_color/* Color3.FromArray */.Wo.FromArray(extension.values.specular || [0, 0, 0]), !0;}_loadTexture(gltfRuntime, id, material, propertyPath, onError) {GLTFLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, (buffer) => {GLTFLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, (texture) => material[propertyPath] = texture);}, onError);}}GLTFLoader.RegisterExtension(new GLTFMaterialsCommonExtension());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/1.0/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/deferred.js
var Misc_deferred = __webpack_require__("./node_modules/@babylonjs/core/Misc/deferred.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationKey.js
var animationKey = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationKey.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationGroup.js
var animationGroup = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationGroup.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.js
var PBR_pbrMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/transformNode.js
var Meshes_transformNode = __webpack_require__("./node_modules/@babylonjs/core/Meshes/transformNode.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Morph/morphTarget.js
var morphTarget = __webpack_require__("./node_modules/@babylonjs/core/Morph/morphTarget.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Morph/morphTargetManager.js
var morphTargetManager = __webpack_require__("./node_modules/@babylonjs/core/Morph/morphTargetManager.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/boundingInfo.js
var boundingInfo = __webpack_require__("./node_modules/@babylonjs/core/Culling/boundingInfo.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/glTFLoaderAnimation.js
function getVector3(_target, source, offset, scale) {return math_vector/* Vector3.FromArray */.P.FromArray(source, offset).scaleInPlace(scale);}function getQuaternion(_target, source, offset, scale) {return math_vector/* Quaternion.FromArray */._f.FromArray(source, offset).scaleInPlace(scale);}function getWeights(target, source, offset, scale) {const value = Array(target._numMorphTargets);for (let i = 0; i < value.length; i++) value[i] = source[offset++] * scale;return value;}class AnimationPropertyInfo {constructor(type, name, getValue, getStride) {this.type = type, this.name = name, this.getValue = getValue, this.getStride = getStride;}_buildAnimation(name, fps, keys) {const babylonAnimation = new Animations_animation/* Animation */.f(name, this.name, fps, this.type);return babylonAnimation.setKeys(keys), babylonAnimation;}}class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {buildAnimations(target, name, fps, keys, callback) {callback(target._babylonTransformNode, this._buildAnimation(name, fps, keys));}}class WeightAnimationPropertyInfo extends AnimationPropertyInfo {buildAnimations(target, name, fps, keys, callback) {if (target._numMorphTargets) for (let targetIndex = 0; targetIndex < target._numMorphTargets; targetIndex++) {const babylonAnimation = new Animations_animation/* Animation */.f(`${name}_${targetIndex}`, this.name, fps, this.type);if (babylonAnimation.setKeys(keys.map((key) => ({ frame: key.frame, inTangent: key.inTangent ? key.inTangent[targetIndex] : void 0, value: key.value[targetIndex], outTangent: key.outTangent ? key.outTangent[targetIndex] : void 0, interpolation: key.interpolation }))), target._primitiveBabylonMeshes) for (const babylonMesh of target._primitiveBabylonMeshes) if (babylonMesh.morphTargetManager) {const morphTarget = babylonMesh.morphTargetManager.getTarget(targetIndex),babylonAnimationClone = babylonAnimation.clone();morphTarget.animations.push(babylonAnimationClone), callback(morphTarget, babylonAnimationClone);}}}}const nodeAnimationData = { translation: [new TransformNodeAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3, "position", getVector3, () => 3)], rotation: [new TransformNodeAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_QUATERNION */.f.ANIMATIONTYPE_QUATERNION, "rotationQuaternion", getQuaternion, () => 4)], scale: [new TransformNodeAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3, "scaling", getVector3, () => 3)], weights: [new WeightAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "influence", getWeights, (target) => target._numMorphTargets)] };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/glTFLoader.js
function mergeDeep(...objects) {const isObject = (obj) => obj && "object" == typeof obj;return objects.reduce((prev, obj) => (Object.keys(obj).forEach((key) => {const pVal = prev[key],oVal = obj[key];prev[key] = Array.isArray(pVal) && Array.isArray(oVal) ? pVal.concat(...oVal) : isObject(pVal) && isObject(oVal) ? mergeDeep(pVal, oVal) : oVal;}), prev), {});}class ArrayItem {static Get(context, array, index) {if (!array || index == null || !array[index]) throw new Error(`${context}: Failed to find index (${index})`);return array[index];}static Assign(array) {if (array) for (let index = 0; index < array.length; index++) array[index].index = index;}}class glTFLoader_GLTFLoader {constructor(parent) {this._completePromises = [], this._assetContainer = null, this._babylonLights = [], this._disableInstancedMesh = 0, this._extensions = [], this._disposed = !1, this._rootUrl = null, this._fileName = null, this._uniqueRootUrl = null, this._bin = null, this._rootBabylonMesh = null, this._defaultBabylonMaterialData = {}, this._postSceneLoadActions = [], this._parent = parent;}static RegisterExtension(name, factory) {glTFLoader_GLTFLoader.UnregisterExtension(name) && logger/* Logger.Warn */.Y.Warn(`Extension with the name '${name}' already exists`), glTFLoader_GLTFLoader._RegisteredExtensions[name] = { factory: factory };}static UnregisterExtension(name) {return !!glTFLoader_GLTFLoader._RegisteredExtensions[name] && (delete glTFLoader_GLTFLoader._RegisteredExtensions[name], !0);}get gltf() {if (!this._gltf) throw new Error("glTF JSON is not available");return this._gltf;}get bin() {return this._bin;}get parent() {return this._parent;}get babylonScene() {if (!this._babylonScene) throw new Error("Scene is not available");return this._babylonScene;}get rootBabylonMesh() {return this._rootBabylonMesh;}dispose() {this._disposed || (this._disposed = !0, this._completePromises.length = 0, this._extensions.forEach((extension) => extension.dispose && extension.dispose()), this._extensions.length = 0, this._gltf = null, this._bin = null, this._babylonScene = null, this._rootBabylonMesh = null, this._defaultBabylonMaterialData = {}, this._postSceneLoadActions.length = 0, this._parent.dispose());}importMeshAsync(meshesNames, scene, container, data, rootUrl, onProgress, fileName = "") {return Promise.resolve().then(() => {this._babylonScene = scene, this._assetContainer = container, this._loadData(data);let nodes = null;if (meshesNames) {const nodeMap = {};if (this._gltf.nodes) for (const node of this._gltf.nodes) node.name && (nodeMap[node.name] = node.index);const names = meshesNames instanceof Array ? meshesNames : [meshesNames];nodes = names.map((name) => {const node = nodeMap[name];if (node === void 0) throw new Error(`Failed to find node '${name}'`);return node;});}return this._loadAsync(rootUrl, fileName, nodes, () => ({ meshes: this._getMeshes(), particleSystems: [], skeletons: this._getSkeletons(), animationGroups: this._getAnimationGroups(), lights: this._babylonLights, transformNodes: this._getTransformNodes(), geometries: this._getGeometries() }));});}loadAsync(scene, data, rootUrl, onProgress, fileName = "") {return Promise.resolve().then(() => (this._babylonScene = scene, this._loadData(data), this._loadAsync(rootUrl, fileName, null, () => void 0)));}_loadAsync(rootUrl, fileName, nodes, resultFunc) {return Promise.resolve().then(() => {this._rootUrl = rootUrl, this._uniqueRootUrl = !rootUrl.startsWith("file:") && fileName ? rootUrl : `${rootUrl}${Date.now()}/`, this._fileName = fileName, this._loadExtensions(), this._checkExtensions();const loadingToReadyCounterName = `${GLTFLoaderState[GLTFLoaderState.LOADING]} => ${GLTFLoaderState[GLTFLoaderState.READY]}`,loadingToCompleteCounterName = `${GLTFLoaderState[GLTFLoaderState.LOADING]} => ${GLTFLoaderState[GLTFLoaderState.COMPLETE]}`;this._parent._startPerformanceCounter(loadingToReadyCounterName), this._parent._startPerformanceCounter(loadingToCompleteCounterName), this._parent._setState(GLTFLoaderState.LOADING), this._extensionsOnLoading();const promises = [],oldBlockMaterialDirtyMechanism = this._babylonScene.blockMaterialDirtyMechanism;if (this._babylonScene.blockMaterialDirtyMechanism = !0, !this.parent.loadOnlyMaterials) if (nodes) promises.push(this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));else if (null != this._gltf.scene || this._gltf.scenes && this._gltf.scenes[0]) {const scene = ArrayItem.Get(`/scene`, this._gltf.scenes, this._gltf.scene || 0);promises.push(this.loadSceneAsync(`/scenes/${scene.index}`, scene));}if (!this.parent.skipMaterials && this.parent.loadAllMaterials && this._gltf.materials) for (let m = 0; m < this._gltf.materials.length; ++m) {const material = this._gltf.materials[m],context = "/materials/" + m,babylonDrawMode = Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode;promises.push(this._loadMaterialAsync(context, material, null, babylonDrawMode, () => {}));}this._babylonScene.blockMaterialDirtyMechanism = oldBlockMaterialDirtyMechanism, this._parent.compileMaterials && promises.push(this._compileMaterialsAsync()), this._parent.compileShadowGenerators && promises.push(this._compileShadowGeneratorsAsync());const resultPromise = Promise.all(promises).then(() => (this._rootBabylonMesh && this._rootBabylonMesh.setEnabled(!0), this._extensionsOnReady(), this._parent._setState(GLTFLoaderState.READY), this._startAnimations(), resultFunc()));return resultPromise.then((result) => (this._parent._endPerformanceCounter(loadingToReadyCounterName), tools/* Tools.SetImmediate */.w1.SetImmediate(() => {this._disposed || Promise.all(this._completePromises).then(() => {this._parent._endPerformanceCounter(loadingToCompleteCounterName), this._parent._setState(GLTFLoaderState.COMPLETE), this._parent.onCompleteObservable.notifyObservers(void 0), this._parent.onCompleteObservable.clear(), this.dispose();}, (error) => {this._parent.onErrorObservable.notifyObservers(error), this._parent.onErrorObservable.clear(), this.dispose();});}), result));}).catch((error) => {throw this._disposed || (this._parent.onErrorObservable.notifyObservers(error), this._parent.onErrorObservable.clear(), this.dispose()), error;});}_loadData(data) {if (this._gltf = data.json, this._setupData(), data.bin) {const buffers = this._gltf.buffers;if (buffers && buffers[0] && !buffers[0].uri) {const binaryBuffer = buffers[0];(binaryBuffer.byteLength < data.bin.byteLength - 3 || binaryBuffer.byteLength > data.bin.byteLength) && logger/* Logger.Warn */.Y.Warn(`Binary buffer length (${binaryBuffer.byteLength}) from JSON does not match chunk length (${data.bin.byteLength})`), this._bin = data.bin;} else logger/* Logger.Warn */.Y.Warn("Unexpected BIN chunk");}}_setupData() {if (ArrayItem.Assign(this._gltf.accessors), ArrayItem.Assign(this._gltf.animations), ArrayItem.Assign(this._gltf.buffers), ArrayItem.Assign(this._gltf.bufferViews), ArrayItem.Assign(this._gltf.cameras), ArrayItem.Assign(this._gltf.images), ArrayItem.Assign(this._gltf.materials), ArrayItem.Assign(this._gltf.meshes), ArrayItem.Assign(this._gltf.nodes), ArrayItem.Assign(this._gltf.samplers), ArrayItem.Assign(this._gltf.scenes), ArrayItem.Assign(this._gltf.skins), ArrayItem.Assign(this._gltf.textures), this._gltf.nodes) {const nodeParents = {};for (const node of this._gltf.nodes) if (node.children) for (const index of node.children) nodeParents[index] = node.index;const rootNode = this._createRootNode();for (const node of this._gltf.nodes) {const parentIndex = nodeParents[node.index];node.parent = void 0 === parentIndex ? rootNode : this._gltf.nodes[parentIndex];}}}_loadExtensions() {for (const name in glTFLoader_GLTFLoader._RegisteredExtensions) {const extension = glTFLoader_GLTFLoader._RegisteredExtensions[name].factory(this);extension.name !== name && logger/* Logger.Warn */.Y.Warn(`The name of the glTF loader extension instance does not match the registered name: ${extension.name} !== ${name}`), this._extensions.push(extension), this._parent.onExtensionLoadedObservable.notifyObservers(extension);}this._extensions.sort((a, b) => (a.order || Number.MAX_VALUE) - (b.order || Number.MAX_VALUE)), this._parent.onExtensionLoadedObservable.clear();}_checkExtensions() {if (this._gltf.extensionsRequired) for (const name of this._gltf.extensionsRequired) {const available = this._extensions.some((extension) => extension.name === name && extension.enabled);if (!available) throw new Error(`Require extension ${name} is not available`);}}_createRootNode() {this._babylonScene._blockEntityCollection = !!this._assetContainer, this._rootBabylonMesh = new Meshes_mesh/* Mesh */.Kj("__root__", this._babylonScene), this._rootBabylonMesh._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, this._rootBabylonMesh.setEnabled(!1);const rootNode = { _babylonTransformNode: this._rootBabylonMesh, index: -1 };switch (this._parent.coordinateSystemMode) {case GLTFLoaderCoordinateSystemMode.AUTO:{this._babylonScene.useRightHandedSystem || (rootNode.rotation = [0, 1, 0, 0], rootNode.scale = [1, 1, -1], glTFLoader_GLTFLoader._LoadTransform(rootNode, this._rootBabylonMesh));break;}case GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED:{this._babylonScene.useRightHandedSystem = !0;break;}default:throw new Error(`Invalid coordinate system mode (${this._parent.coordinateSystemMode})`);}return this._parent.onMeshLoadedObservable.notifyObservers(this._rootBabylonMesh), rootNode;}loadSceneAsync(context, scene) {const extensionPromise = this._extensionsLoadSceneAsync(context, scene);if (extensionPromise) return extensionPromise;const promises = [];if (this.logOpen(`${context} ${scene.name || ""}`), scene.nodes) for (const index of scene.nodes) {const node = ArrayItem.Get(`${context}/nodes/${index}`, this._gltf.nodes, index);promises.push(this.loadNodeAsync(`/nodes/${node.index}`, node, (babylonMesh) => {babylonMesh.parent = this._rootBabylonMesh;}));}for (const action of this._postSceneLoadActions) action();return promises.push(this._loadAnimationsAsync()), this.logClose(), Promise.all(promises).then(() => {});}_forEachPrimitive(node, callback) {if (node._primitiveBabylonMeshes) for (const babylonMesh of node._primitiveBabylonMeshes) callback(babylonMesh);}_getGeometries() {const geometries = [],nodes = this._gltf.nodes;if (nodes) for (const node of nodes) this._forEachPrimitive(node, (babylonMesh) => {const geometry = babylonMesh.geometry;geometry && -1 === geometries.indexOf(geometry) && geometries.push(geometry);});return geometries;}_getMeshes() {const meshes = [];this._rootBabylonMesh && meshes.push(this._rootBabylonMesh);const nodes = this._gltf.nodes;if (nodes) for (const node of nodes) this._forEachPrimitive(node, (babylonMesh) => {meshes.push(babylonMesh);});return meshes;}_getTransformNodes() {const transformNodes = [],nodes = this._gltf.nodes;if (nodes) for (const node of nodes) node._babylonTransformNode && "TransformNode" === node._babylonTransformNode.getClassName() && transformNodes.push(node._babylonTransformNode), node._babylonTransformNodeForSkin && transformNodes.push(node._babylonTransformNodeForSkin);return transformNodes;}_getSkeletons() {const skeletons = [],skins = this._gltf.skins;if (skins) for (const skin of skins) skin._data && skeletons.push(skin._data.babylonSkeleton);return skeletons;}_getAnimationGroups() {const animationGroups = [],animations = this._gltf.animations;if (animations) for (const animation of animations) animation._babylonAnimationGroup && animationGroups.push(animation._babylonAnimationGroup);return animationGroups;}_startAnimations() {switch (this._parent.animationStartMode) {case GLTFLoaderAnimationStartMode.NONE:break;case GLTFLoaderAnimationStartMode.FIRST:{const babylonAnimationGroups = this._getAnimationGroups();0 !== babylonAnimationGroups.length && babylonAnimationGroups[0].start(!0);break;}case GLTFLoaderAnimationStartMode.ALL:{const babylonAnimationGroups = this._getAnimationGroups();for (const babylonAnimationGroup of babylonAnimationGroups) babylonAnimationGroup.start(!0);break;}default:return void logger/* Logger.Error */.Y.Error(`Invalid animation start mode (${this._parent.animationStartMode})`);}}loadNodeAsync(context, node, assign = () => {}) {const extensionPromise = this._extensionsLoadNodeAsync(context, node, assign);if (extensionPromise) return extensionPromise;if (node._babylonTransformNode) throw new Error(`${context}: Invalid recursive node hierarchy`);const promises = [];this.logOpen(`${context} ${node.name || ""}`);const loadNode = (babylonTransformNode) => {if (glTFLoader_GLTFLoader.AddPointerMetadata(babylonTransformNode, context), glTFLoader_GLTFLoader._LoadTransform(node, babylonTransformNode), null != node.camera) {const camera = ArrayItem.Get(`${context}/camera`, this._gltf.cameras, node.camera);promises.push(this.loadCameraAsync(`/cameras/${camera.index}`, camera, (babylonCamera) => {babylonCamera.parent = babylonTransformNode;}));}if (node.children) for (const index of node.children) {const childNode = ArrayItem.Get(`${context}/children/${index}`, this._gltf.nodes, index);promises.push(this.loadNodeAsync(`/nodes/${childNode.index}`, childNode, (childBabylonMesh) => {childBabylonMesh.parent = babylonTransformNode;}));}assign(babylonTransformNode);};if (null == node.mesh || null != node.skin) {const nodeName = node.name || `node${node.index}`;this._babylonScene._blockEntityCollection = !!this._assetContainer;const transformNode = new Meshes_transformNode/* TransformNode */.Y(nodeName, this._babylonScene);transformNode._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, null == node.mesh ? node._babylonTransformNode = transformNode : node._babylonTransformNodeForSkin = transformNode, loadNode(transformNode);}if (null != node.mesh) if (null == node.skin) {const mesh = ArrayItem.Get(`${context}/mesh`, this._gltf.meshes, node.mesh);promises.push(this._loadMeshAsync(`/meshes/${mesh.index}`, node, mesh, loadNode));} else {const mesh = ArrayItem.Get(`${context}/mesh`, this._gltf.meshes, node.mesh);promises.push(this._loadMeshAsync(`/meshes/${mesh.index}`, node, mesh, (babylonTransformNode) => {const babylonTransformNodeForSkin = node._babylonTransformNodeForSkin;babylonTransformNode.metadata = mergeDeep(babylonTransformNodeForSkin.metadata, babylonTransformNode.metadata || {});const skin = ArrayItem.Get(`${context}/skin`, this._gltf.skins, node.skin);promises.push(this._loadSkinAsync(`/skins/${skin.index}`, node, skin, (babylonSkeleton) => {this._forEachPrimitive(node, (babylonMesh) => {babylonMesh.skeleton = babylonSkeleton;}), this._postSceneLoadActions.push(() => {if (null != skin.skeleton) {const parentNode = ArrayItem.Get(`/skins/${skin.index}/skeleton`, this._gltf.nodes, skin.skeleton).parent;babylonTransformNode.parent = node.index === parentNode.index ? babylonTransformNodeForSkin.parent : parentNode._babylonTransformNode;} else babylonTransformNode.parent = this._rootBabylonMesh;this._parent.onSkinLoadedObservable.notifyObservers({ node: babylonTransformNodeForSkin, skinnedNode: babylonTransformNode });});}));}));}return this.logClose(), Promise.all(promises).then(() => (this._forEachPrimitive(node, (babylonMesh) => {babylonMesh.geometry && babylonMesh.geometry.useBoundingInfoFromGeometry ? babylonMesh._updateBoundingInfo() : babylonMesh.refreshBoundingInfo(!0);}), node._babylonTransformNode));}_loadMeshAsync(context, node, mesh, assign) {const primitives = mesh.primitives;if (!primitives || !primitives.length) throw new Error(`${context}: Primitives are missing`);null == primitives[0].index && ArrayItem.Assign(primitives);const promises = [];this.logOpen(`${context} ${mesh.name || ""}`);const name = node.name || `node${node.index}`;if (1 === primitives.length) {const primitive = mesh.primitives[0];promises.push(this._loadMeshPrimitiveAsync(`${context}/primitives/${primitive.index}`, name, node, mesh, primitive, (babylonMesh) => {node._babylonTransformNode = babylonMesh, node._primitiveBabylonMeshes = [babylonMesh];}));} else {this._babylonScene._blockEntityCollection = !!this._assetContainer, node._babylonTransformNode = new Meshes_transformNode/* TransformNode */.Y(name, this._babylonScene), node._babylonTransformNode._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, node._primitiveBabylonMeshes = [];for (const primitive of primitives) promises.push(this._loadMeshPrimitiveAsync(`${context}/primitives/${primitive.index}`, `${name}_primitive${primitive.index}`, node, mesh, primitive, (babylonMesh) => {babylonMesh.parent = node._babylonTransformNode, node._primitiveBabylonMeshes.push(babylonMesh);}));}return assign(node._babylonTransformNode), this.logClose(), Promise.all(promises).then(() => node._babylonTransformNode);}_loadMeshPrimitiveAsync(context, name, node, mesh, primitive, assign) {const extensionPromise = this._extensionsLoadMeshPrimitiveAsync(context, name, node, mesh, primitive, assign);if (extensionPromise) return extensionPromise;this.logOpen(`${context}`);const shouldInstance = 0 === this._disableInstancedMesh && this._parent.createInstances && null == node.skin && !mesh.primitives[0].targets;let babylonAbstractMesh, promise;if (shouldInstance && primitive._instanceData) this._babylonScene._blockEntityCollection = !!this._assetContainer, babylonAbstractMesh = primitive._instanceData.babylonSourceMesh.createInstance(name), babylonAbstractMesh._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, promise = primitive._instanceData.promise;else {const promises = [];this._babylonScene._blockEntityCollection = !!this._assetContainer;const babylonMesh = new Meshes_mesh/* Mesh */.Kj(name, this._babylonScene);babylonMesh._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, babylonMesh.overrideMaterialSideOrientation = this._babylonScene.useRightHandedSystem ? Materials_material/* Material.CounterClockWiseSideOrientation */.F.CounterClockWiseSideOrientation : Materials_material/* Material.ClockWiseSideOrientation */.F.ClockWiseSideOrientation, this._createMorphTargets(context, node, mesh, primitive, babylonMesh), promises.push(this._loadVertexDataAsync(context, primitive, babylonMesh).then((babylonGeometry) => this._loadMorphTargetsAsync(context, primitive, babylonMesh, babylonGeometry).then(() => {this._disposed || (this._babylonScene._blockEntityCollection = !!this._assetContainer, babylonGeometry.applyToMesh(babylonMesh), babylonGeometry._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1);})));const babylonDrawMode = glTFLoader_GLTFLoader._GetDrawMode(context, primitive.mode);if (null == primitive.material) {let babylonMaterial = this._defaultBabylonMaterialData[babylonDrawMode];babylonMaterial || (babylonMaterial = this._createDefaultMaterial("__GLTFLoader._default", babylonDrawMode), this._parent.onMaterialLoadedObservable.notifyObservers(babylonMaterial), this._defaultBabylonMaterialData[babylonDrawMode] = babylonMaterial), babylonMesh.material = babylonMaterial;} else if (!this.parent.skipMaterials) {const material = ArrayItem.Get(`${context}/material`, this._gltf.materials, primitive.material);promises.push(this._loadMaterialAsync(`/materials/${material.index}`, material, babylonMesh, babylonDrawMode, (babylonMaterial) => {babylonMesh.material = babylonMaterial;}));}promise = Promise.all(promises), shouldInstance && (primitive._instanceData = { babylonSourceMesh: babylonMesh, promise: promise }), babylonAbstractMesh = babylonMesh;}return glTFLoader_GLTFLoader.AddPointerMetadata(babylonAbstractMesh, context), this._parent.onMeshLoadedObservable.notifyObservers(babylonAbstractMesh), assign(babylonAbstractMesh), this.logClose(), promise.then(() => babylonAbstractMesh);}_loadVertexDataAsync(context, primitive, babylonMesh) {const extensionPromise = this._extensionsLoadVertexDataAsync(context, primitive, babylonMesh);if (extensionPromise) return extensionPromise;const attributes = primitive.attributes;if (!attributes) throw new Error(`${context}: Attributes are missing`);const promises = [],babylonGeometry = new geometry/* Geometry */.Z(babylonMesh.name, this._babylonScene);if (null == primitive.indices) babylonMesh.isUnIndexed = !0;else {const accessor = ArrayItem.Get(`${context}/indices`, this._gltf.accessors, primitive.indices);promises.push(this._loadIndicesAccessorAsync(`/accessors/${accessor.index}`, accessor).then((data) => {babylonGeometry.setIndices(data);}));}const loadAttribute = (attribute, kind, callback) => {if (null == attributes[attribute]) return;babylonMesh._delayInfo = babylonMesh._delayInfo || [], -1 === babylonMesh._delayInfo.indexOf(kind) && babylonMesh._delayInfo.push(kind);const accessor = ArrayItem.Get(`${context}/attributes/${attribute}`, this._gltf.accessors, attributes[attribute]);promises.push(this._loadVertexAccessorAsync(`/accessors/${accessor.index}`, accessor, kind).then((babylonVertexBuffer) => {if (babylonVertexBuffer.getKind() === Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind && !this.parent.alwaysComputeBoundingBox && !babylonMesh.skeleton) {const mmin = accessor.min,mmax = accessor.max;if (void 0 !== mmin && void 0 !== mmax) {if (accessor.normalized && 5126 !== accessor.componentType) {let divider = 1;switch (accessor.componentType) {case 5120:divider = 127;break;case 5121:divider = 255;break;case 5122:divider = 32767;break;case 5123:divider = 65535;}for (let i = 0; 3 > i; ++i) mmin[i] = Math.max(mmin[i] / divider, -1), mmax[i] = Math.max(mmax[i] / divider, -1);}const min = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],max = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];min.copyFromFloats(...mmin), max.copyFromFloats(...mmax), babylonGeometry._boundingInfo = new boundingInfo/* BoundingInfo */.j(min, max), babylonGeometry.useBoundingInfoFromGeometry = !0;}}babylonGeometry.setVerticesBuffer(babylonVertexBuffer, accessor.count);})), kind == Buffers_buffer/* VertexBuffer.MatricesIndicesExtraKind */.o.MatricesIndicesExtraKind && (babylonMesh.numBoneInfluencers = 8), callback && callback(accessor);};return loadAttribute("POSITION", Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind), loadAttribute("NORMAL", Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind), loadAttribute("TANGENT", Buffers_buffer/* VertexBuffer.TangentKind */.o.TangentKind), loadAttribute("TEXCOORD_0", Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), loadAttribute("TEXCOORD_1", Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind), loadAttribute("TEXCOORD_2", Buffers_buffer/* VertexBuffer.UV3Kind */.o.UV3Kind), loadAttribute("TEXCOORD_3", Buffers_buffer/* VertexBuffer.UV4Kind */.o.UV4Kind), loadAttribute("TEXCOORD_4", Buffers_buffer/* VertexBuffer.UV5Kind */.o.UV5Kind), loadAttribute("TEXCOORD_5", Buffers_buffer/* VertexBuffer.UV6Kind */.o.UV6Kind), loadAttribute("JOINTS_0", Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind), loadAttribute("WEIGHTS_0", Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind), loadAttribute("JOINTS_1", Buffers_buffer/* VertexBuffer.MatricesIndicesExtraKind */.o.MatricesIndicesExtraKind), loadAttribute("WEIGHTS_1", Buffers_buffer/* VertexBuffer.MatricesWeightsExtraKind */.o.MatricesWeightsExtraKind), loadAttribute("COLOR_0", Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, (accessor) => {"VEC4" === accessor.type && (babylonMesh.hasVertexAlpha = !0);}), Promise.all(promises).then(() => babylonGeometry);}_createMorphTargets(context, node, mesh, primitive, babylonMesh) {if (primitive.targets) {if (null == node._numMorphTargets) node._numMorphTargets = primitive.targets.length;else if (primitive.targets.length !== node._numMorphTargets) throw new Error(`${context}: Primitives do not have the same number of targets`);const targetNames = mesh.extras ? mesh.extras.targetNames : null;babylonMesh.morphTargetManager = new morphTargetManager/* MorphTargetManager */.O(babylonMesh.getScene()), babylonMesh.morphTargetManager.areUpdatesFrozen = !0;for (let index = 0; index < primitive.targets.length; index++) {const weight = node.weights ? node.weights[index] : mesh.weights ? mesh.weights[index] : 0,name = targetNames ? targetNames[index] : `morphTarget${index}`;babylonMesh.morphTargetManager.addTarget(new morphTarget/* MorphTarget */.Y(name, weight, babylonMesh.getScene()));}}}_loadMorphTargetsAsync(context, primitive, babylonMesh, babylonGeometry) {if (!primitive.targets) return Promise.resolve();const promises = [],morphTargetManager = babylonMesh.morphTargetManager;for (let index = 0; index < morphTargetManager.numTargets; index++) {const babylonMorphTarget = morphTargetManager.getTarget(index);promises.push(this._loadMorphTargetVertexDataAsync(`${context}/targets/${index}`, babylonGeometry, primitive.targets[index], babylonMorphTarget));}return Promise.all(promises).then(() => {morphTargetManager.areUpdatesFrozen = !1;});}_loadMorphTargetVertexDataAsync(context, babylonGeometry, attributes, babylonMorphTarget) {const promises = [],loadAttribute = (attribute, kind, setData) => {if (null == attributes[attribute]) return;const babylonVertexBuffer = babylonGeometry.getVertexBuffer(kind);if (babylonVertexBuffer) {const accessor = ArrayItem.Get(`${context}/${attribute}`, this._gltf.accessors, attributes[attribute]);promises.push(this._loadFloatAccessorAsync(`/accessors/${accessor.index}`, accessor).then((data) => {setData(babylonVertexBuffer, data);}));}};return loadAttribute("POSITION", Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, (babylonVertexBuffer, data) => {const positions = new Float32Array(data.length);babylonVertexBuffer.forEach(data.length, (value, index) => {positions[index] = data[index] + value;}), babylonMorphTarget.setPositions(positions);}), loadAttribute("NORMAL", Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, (babylonVertexBuffer, data) => {const normals = new Float32Array(data.length);babylonVertexBuffer.forEach(normals.length, (value, index) => {normals[index] = data[index] + value;}), babylonMorphTarget.setNormals(normals);}), loadAttribute("TANGENT", Buffers_buffer/* VertexBuffer.TangentKind */.o.TangentKind, (babylonVertexBuffer, data) => {const tangents = new Float32Array(4 * (data.length / 3));let dataIndex = 0;babylonVertexBuffer.forEach(4 * (data.length / 3), (value, index) => {0 != (index + 1) % 4 && (tangents[dataIndex] = data[dataIndex] + value, dataIndex++);}), babylonMorphTarget.setTangents(tangents);}), Promise.all(promises).then(() => {});}static _LoadTransform(node, babylonNode) {if (null != node.skin) return;let position = math_vector/* Vector3.Zero */.P.Zero(),rotation = math_vector/* Quaternion.Identity */._f.Identity(),scaling = math_vector/* Vector3.One */.P.One();if (node.matrix) {const matrix = math_vector/* Matrix.FromArray */.y3.FromArray(node.matrix);matrix.decompose(scaling, rotation, position);} else node.translation && (position = math_vector/* Vector3.FromArray */.P.FromArray(node.translation)), node.rotation && (rotation = math_vector/* Quaternion.FromArray */._f.FromArray(node.rotation)), node.scale && (scaling = math_vector/* Vector3.FromArray */.P.FromArray(node.scale));babylonNode.position = position, babylonNode.rotationQuaternion = rotation, babylonNode.scaling = scaling;}_loadSkinAsync(context, node, skin, assign) {const extensionPromise = this._extensionsLoadSkinAsync(context, node, skin);if (extensionPromise) return extensionPromise;if (skin._data) return assign(skin._data.babylonSkeleton), skin._data.promise;const skeletonId = `skeleton${skin.index}`;this._babylonScene._blockEntityCollection = !!this._assetContainer;const babylonSkeleton = new skeleton/* Skeleton */.O(skin.name || skeletonId, skeletonId, this._babylonScene);babylonSkeleton._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, this._loadBones(context, skin, babylonSkeleton);const promise = this._loadSkinInverseBindMatricesDataAsync(context, skin).then((inverseBindMatricesData) => {this._updateBoneMatrices(babylonSkeleton, inverseBindMatricesData);});return skin._data = { babylonSkeleton: babylonSkeleton, promise: promise }, assign(babylonSkeleton), promise;}_loadBones(context, skin, babylonSkeleton) {if (skin.skeleton == null || this._parent.alwaysComputeSkeletonRootNode) {const rootNode = this._findSkeletonRootNode(`${context}/joints`, skin.joints);if (!rootNode) logger/* Logger.Warn */.Y.Warn(`${context}: Failed to find common root`);else if (void 0 === skin.skeleton) skin.skeleton = rootNode.index;else {const skeletonNode = ArrayItem.Get(`${context}/skeleton`, this._gltf.nodes, skin.skeleton);skeletonNode === rootNode || ((a, b) => {for (; b.parent; b = b.parent) if (b.parent === a) return !0;return !1;})(skeletonNode, rootNode) || (logger/* Logger.Warn */.Y.Warn(`${context}/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root`), skin.skeleton = rootNode.index);}}const babylonBones = {};for (const index of skin.joints) {const node = ArrayItem.Get(`${context}/joints/${index}`, this._gltf.nodes, index);this._loadBone(node, skin, babylonSkeleton, babylonBones);}}_findSkeletonRootNode(context, joints) {if (0 === joints.length) return null;const paths = {};for (const index of joints) {const path = [];for (let node = ArrayItem.Get(`${context}/${index}`, this._gltf.nodes, index); -1 !== node.index;) path.unshift(node), node = node.parent;paths[index] = path;}let rootNode = null;for (let path, i = 0;; ++i) {if (path = paths[joints[0]], i >= path.length) return rootNode;const node = path[i];for (let j = 1; j < joints.length; ++j) if (path = paths[joints[j]], i >= path.length || node !== path[i]) return rootNode;rootNode = node;}}_loadBone(node, skin, babylonSkeleton, babylonBones) {let babylonBone = babylonBones[node.index];if (babylonBone) return babylonBone;let parentBabylonBone = null;node.index !== skin.skeleton && (node.parent && -1 !== node.parent.index ? parentBabylonBone = this._loadBone(node.parent, skin, babylonSkeleton, babylonBones) : void 0 !== skin.skeleton && logger/* Logger.Warn */.Y.Warn(`/skins/${skin.index}/skeleton: Skeleton node is not a common root`));const boneIndex = skin.joints.indexOf(node.index);return babylonBone = new Bones_bone/* Bone */.N(node.name || `joint${node.index}`, babylonSkeleton, parentBabylonBone, this._getNodeMatrix(node), null, null, boneIndex), babylonBones[node.index] = babylonBone, this._postSceneLoadActions.push(() => {babylonBone.linkTransformNode(node._babylonTransformNode);}), babylonBone;}_loadSkinInverseBindMatricesDataAsync(context, skin) {if (skin.inverseBindMatrices == null) return Promise.resolve(null);const accessor = ArrayItem.Get(`${context}/inverseBindMatrices`, this._gltf.accessors, skin.inverseBindMatrices);return this._loadFloatAccessorAsync(`/accessors/${accessor.index}`, accessor);}_updateBoneMatrices(babylonSkeleton, inverseBindMatricesData) {for (const babylonBone of babylonSkeleton.bones) {const baseMatrix = math_vector/* Matrix.Identity */.y3.Identity(),boneIndex = babylonBone._index;inverseBindMatricesData && -1 !== boneIndex && (math_vector/* Matrix.FromArrayToRef */.y3.FromArrayToRef(inverseBindMatricesData, 16 * boneIndex, baseMatrix), baseMatrix.invertToRef(baseMatrix));const babylonParentBone = babylonBone.getParent();babylonParentBone && baseMatrix.multiplyToRef(babylonParentBone.getInvertedAbsoluteTransform(), baseMatrix), babylonBone.updateMatrix(baseMatrix, !1, !1), babylonBone._updateDifferenceMatrix(void 0, !1);}}_getNodeMatrix(node) {return node.matrix ? math_vector/* Matrix.FromArray */.y3.FromArray(node.matrix) : math_vector/* Matrix.Compose */.y3.Compose(node.scale ? math_vector/* Vector3.FromArray */.P.FromArray(node.scale) : math_vector/* Vector3.One */.P.One(), node.rotation ? math_vector/* Quaternion.FromArray */._f.FromArray(node.rotation) : math_vector/* Quaternion.Identity */._f.Identity(), node.translation ? math_vector/* Vector3.FromArray */.P.FromArray(node.translation) : math_vector/* Vector3.Zero */.P.Zero());}loadCameraAsync(context, camera, assign = () => {}) {const extensionPromise = this._extensionsLoadCameraAsync(context, camera, assign);if (extensionPromise) return extensionPromise;this.logOpen(`${context} ${camera.name || ""}`), this._babylonScene._blockEntityCollection = !!this._assetContainer;const babylonCamera = new freeCamera/* FreeCamera */.c(camera.name || `camera${camera.index}`, math_vector/* Vector3.Zero */.P.Zero(), this._babylonScene, !1);switch (babylonCamera._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, babylonCamera.ignoreParentScaling = !0, camera._babylonCamera = babylonCamera, babylonCamera.rotation = new math_vector/* Vector3 */.P(0, Math.PI, 0), camera.type) {case "perspective":{const perspective = camera.perspective;if (!perspective) throw new Error(`${context}: Camera perspective properties are missing`);babylonCamera.fov = perspective.yfov, babylonCamera.minZ = perspective.znear, babylonCamera.maxZ = perspective.zfar || 0;break;}case "orthographic":{if (!camera.orthographic) throw new Error(`${context}: Camera orthographic properties are missing`);babylonCamera.mode = Cameras_camera/* Camera.ORTHOGRAPHIC_CAMERA */.V.ORTHOGRAPHIC_CAMERA, babylonCamera.orthoLeft = -camera.orthographic.xmag, babylonCamera.orthoRight = camera.orthographic.xmag, babylonCamera.orthoBottom = -camera.orthographic.ymag, babylonCamera.orthoTop = camera.orthographic.ymag, babylonCamera.minZ = camera.orthographic.znear, babylonCamera.maxZ = camera.orthographic.zfar;break;}default:throw new Error(`${context}: Invalid camera type (${camera.type})`);}return glTFLoader_GLTFLoader.AddPointerMetadata(babylonCamera, context), this._parent.onCameraLoadedObservable.notifyObservers(babylonCamera), assign(babylonCamera), this.logClose(), Promise.all([]).then(() => babylonCamera);}_loadAnimationsAsync() {const animations = this._gltf.animations;if (!animations) return Promise.resolve();const promises = [];for (let index = 0; index < animations.length; index++) {const animation = animations[index];promises.push(this.loadAnimationAsync(`/animations/${animation.index}`, animation).then((animationGroup) => {0 === animationGroup.targetedAnimations.length && animationGroup.dispose();}));}return Promise.all(promises).then(() => {});}loadAnimationAsync(context, animation) {const promise = this._extensionsLoadAnimationAsync(context, animation);if (promise) return promise;this._babylonScene._blockEntityCollection = !!this._assetContainer;const babylonAnimationGroup = new animationGroup/* AnimationGroup */.O(animation.name || `animation${animation.index}`, this._babylonScene);babylonAnimationGroup._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, animation._babylonAnimationGroup = babylonAnimationGroup;const promises = [];ArrayItem.Assign(animation.channels), ArrayItem.Assign(animation.samplers);for (const channel of animation.channels) promises.push(this._loadAnimationChannelAsync(`${context}/channels/${channel.index}`, context, animation, channel, (babylonTarget, babylonAnimation) => {babylonTarget.animations = babylonTarget.animations || [], babylonTarget.animations.push(babylonAnimation), babylonAnimationGroup.addTargetedAnimation(babylonAnimation, babylonTarget);}));return Promise.all(promises).then(() => (babylonAnimationGroup.normalize(0), babylonAnimationGroup));}_loadAnimationChannelAsync(context, animationContext, animation, channel, onLoad) {const promise = this._extensionsLoadAnimationChannelAsync(context, animationContext, animation, channel, onLoad);if (promise) return promise;if (null == channel.target.node) return Promise.resolve();const targetNode = ArrayItem.Get(`${context}/target/node`, this._gltf.nodes, channel.target.node);if ("weights" === channel.target.path && !targetNode._numMorphTargets || "weights" !== channel.target.path && !targetNode._babylonTransformNode) return Promise.resolve();let properties;switch (channel.target.path) {case "translation":{properties = nodeAnimationData.translation;break;}case "rotation":{properties = nodeAnimationData.rotation;break;}case "scale":{properties = nodeAnimationData.scale;break;}case "weights":{properties = nodeAnimationData.weights;break;}default:throw new Error(`${context}/target/path: Invalid value (${channel.target.path})`);}const targetInfo = { target: targetNode, properties: properties };return this._loadAnimationChannelFromTargetInfoAsync(context, animationContext, animation, channel, targetInfo, onLoad);}_loadAnimationChannelFromTargetInfoAsync(context, animationContext, animation, channel, targetInfo, onLoad) {const fps = this.parent.targetFps,invfps = 1 / fps,sampler = ArrayItem.Get(`${context}/sampler`, animation.samplers, channel.sampler);return this._loadAnimationSamplerAsync(`${animationContext}/samplers/${channel.sampler}`, sampler).then((data) => {let numAnimations = 0;for (const property of targetInfo.properties) {const stride = property.getStride(targetInfo.target),input = data.input,output = data.output,keys = Array(input.length);let outputOffset = 0;switch (data.interpolation) {case "STEP":{for (let index = 0; index < input.length; index++) {const value = property.getValue(targetInfo.target, output, outputOffset, 1);outputOffset += stride, keys[index] = { frame: input[index] * fps, value: value, interpolation: animationKey/* AnimationKeyInterpolation.STEP */.N.STEP };}break;}case "CUBICSPLINE":{for (let index = 0; index < input.length; index++) {const inTangent = property.getValue(targetInfo.target, output, outputOffset, invfps);outputOffset += stride;const value = property.getValue(targetInfo.target, output, outputOffset, 1);outputOffset += stride;const outTangent = property.getValue(targetInfo.target, output, outputOffset, invfps);outputOffset += stride, keys[index] = { frame: input[index] * fps, inTangent: inTangent, value: value, outTangent: outTangent };}break;}case "LINEAR":{for (let index = 0; index < input.length; index++) {const value = property.getValue(targetInfo.target, output, outputOffset, 1);outputOffset += stride, keys[index] = { frame: input[index] * fps, value: value };}break;}}if (0 < outputOffset) {const name = `${animation.name || `animation${animation.index}`}_channel${channel.index}_${numAnimations}`;property.buildAnimations(targetInfo.target, name, fps, keys, (babylonAnimatable, babylonAnimation) => {++numAnimations, onLoad(babylonAnimatable, babylonAnimation);});}}});}_loadAnimationSamplerAsync(context, sampler) {if (sampler._data) return sampler._data;const interpolation = sampler.interpolation || "LINEAR";switch (interpolation) {case "STEP":case "LINEAR":case "CUBICSPLINE":break;default:throw new Error(`${context}/interpolation: Invalid value (${sampler.interpolation})`);}const inputAccessor = ArrayItem.Get(`${context}/input`, this._gltf.accessors, sampler.input),outputAccessor = ArrayItem.Get(`${context}/output`, this._gltf.accessors, sampler.output);return sampler._data = Promise.all([this._loadFloatAccessorAsync(`/accessors/${inputAccessor.index}`, inputAccessor), this._loadFloatAccessorAsync(`/accessors/${outputAccessor.index}`, outputAccessor)]).then(([inputData, outputData]) => ({ input: inputData, interpolation: interpolation, output: outputData })), sampler._data;}loadBufferAsync(context, buffer, byteOffset, byteLength) {const extensionPromise = this._extensionsLoadBufferAsync(context, buffer, byteOffset, byteLength);if (extensionPromise) return extensionPromise;if (!buffer._data) if (buffer.uri) buffer._data = this.loadUriAsync(`${context}/uri`, buffer, buffer.uri);else {if (!this._bin) throw new Error(`${context}: Uri is missing or the binary glTF is missing its binary chunk`);buffer._data = this._bin.readAsync(0, buffer.byteLength);}return buffer._data.then((data) => {try {return new Uint8Array(data.buffer, data.byteOffset + byteOffset, byteLength);} catch (e) {throw new Error(`${context}: ${e.message}`);}});}loadBufferViewAsync(context, bufferView) {const extensionPromise = this._extensionsLoadBufferViewAsync(context, bufferView);if (extensionPromise) return extensionPromise;if (bufferView._data) return bufferView._data;const buffer = ArrayItem.Get(`${context}/buffer`, this._gltf.buffers, bufferView.buffer);return bufferView._data = this.loadBufferAsync(`/buffers/${buffer.index}`, buffer, bufferView.byteOffset || 0, bufferView.byteLength), bufferView._data;}_loadAccessorAsync(context, accessor, constructor) {if (accessor._data) return accessor._data;const numComponents = glTFLoader_GLTFLoader._GetNumComponents(context, accessor.type),byteStride = numComponents * Buffers_buffer/* VertexBuffer.GetTypeByteLength */.o.GetTypeByteLength(accessor.componentType),length = numComponents * accessor.count;if (accessor.bufferView == null) accessor._data = Promise.resolve(new constructor(length));else {const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView);accessor._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => {if (5126 === accessor.componentType && !accessor.normalized && (!bufferView.byteStride || bufferView.byteStride === byteStride)) return glTFLoader_GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length);else {const typedArray = new constructor(length);return Buffers_buffer/* VertexBuffer.ForEach */.o.ForEach(data, accessor.byteOffset || 0, bufferView.byteStride || byteStride, numComponents, accessor.componentType, typedArray.length, accessor.normalized || !1, (value, index) => {typedArray[index] = value;}), typedArray;}});}if (accessor.sparse) {const sparse = accessor.sparse;accessor._data = accessor._data.then((data) => {const typedArray = data,indicesBufferView = ArrayItem.Get(`${context}/sparse/indices/bufferView`, this._gltf.bufferViews, sparse.indices.bufferView),valuesBufferView = ArrayItem.Get(`${context}/sparse/values/bufferView`, this._gltf.bufferViews, sparse.values.bufferView);return Promise.all([this.loadBufferViewAsync(`/bufferViews/${indicesBufferView.index}`, indicesBufferView), this.loadBufferViewAsync(`/bufferViews/${valuesBufferView.index}`, valuesBufferView)]).then(([indicesData, valuesData]) => {const indices = glTFLoader_GLTFLoader._GetTypedArray(`${context}/sparse/indices`, sparse.indices.componentType, indicesData, sparse.indices.byteOffset, sparse.count),sparseLength = numComponents * sparse.count;let values;if (5126 === accessor.componentType && !accessor.normalized) values = glTFLoader_GLTFLoader._GetTypedArray(`${context}/sparse/values`, accessor.componentType, valuesData, sparse.values.byteOffset, sparseLength);else {const sparseData = glTFLoader_GLTFLoader._GetTypedArray(`${context}/sparse/values`, accessor.componentType, valuesData, sparse.values.byteOffset, sparseLength);values = new constructor(sparseLength), Buffers_buffer/* VertexBuffer.ForEach */.o.ForEach(sparseData, 0, byteStride, numComponents, accessor.componentType, values.length, accessor.normalized || !1, (value, index) => {values[index] = value;});}let valuesIndex = 0;for (let dataIndex, indicesIndex = 0; indicesIndex < indices.length; indicesIndex++) {dataIndex = indices[indicesIndex] * numComponents;for (let componentIndex = 0; componentIndex < numComponents; componentIndex++) typedArray[dataIndex++] = values[valuesIndex++];}return typedArray;});});}return accessor._data;}_loadFloatAccessorAsync(context, accessor) {return this._loadAccessorAsync(context, accessor, Float32Array);}_loadIndicesAccessorAsync(context, accessor) {if ("SCALAR" !== accessor.type) throw new Error(`${context}/type: Invalid value ${accessor.type}`);if (5121 !== accessor.componentType && 5123 !== accessor.componentType && 5125 !== accessor.componentType) throw new Error(`${context}/componentType: Invalid value ${accessor.componentType}`);if (accessor._data) return accessor._data;if (accessor.sparse) {const constructor = glTFLoader_GLTFLoader._GetTypedArrayConstructor(`${context}/componentType`, accessor.componentType);accessor._data = this._loadAccessorAsync(context, accessor, constructor);} else {const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView);accessor._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => glTFLoader_GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, accessor.count));}return accessor._data;}_loadVertexBufferViewAsync(bufferView) {if (bufferView._babylonBuffer) return bufferView._babylonBuffer;const engine = this._babylonScene.getEngine();return bufferView._babylonBuffer = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => new Buffers_buffer/* Buffer */.l(engine, data, !1)), bufferView._babylonBuffer;}_loadVertexAccessorAsync(context, accessor, kind) {var _accessor$_babylonVer;if ((_accessor$_babylonVer = accessor._babylonVertexBuffer) !== null && _accessor$_babylonVer !== void 0 && _accessor$_babylonVer[kind]) return accessor._babylonVertexBuffer[kind];accessor._babylonVertexBuffer || (accessor._babylonVertexBuffer = {});const engine = this._babylonScene.getEngine();if (accessor.sparse) accessor._babylonVertexBuffer[kind] = this._loadFloatAccessorAsync(context, accessor).then((data) => new Buffers_buffer/* VertexBuffer */.o(engine, data, kind, !1));else if (kind === Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind || kind === Buffers_buffer/* VertexBuffer.MatricesIndicesExtraKind */.o.MatricesIndicesExtraKind) accessor._babylonVertexBuffer[kind] = this._loadFloatAccessorAsync(context, accessor).then((data) => new Buffers_buffer/* VertexBuffer */.o(engine, data, kind, !1));else {const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView);accessor._babylonVertexBuffer[kind] = this._loadVertexBufferViewAsync(bufferView).then((babylonBuffer) => {const size = glTFLoader_GLTFLoader._GetNumComponents(context, accessor.type);return new Buffers_buffer/* VertexBuffer */.o(engine, babylonBuffer, kind, !1, !1, bufferView.byteStride, !1, accessor.byteOffset, size, accessor.componentType, accessor.normalized, !0, 1, !0);});}return accessor._babylonVertexBuffer[kind];}_loadMaterialMetallicRoughnessPropertiesAsync(context, properties, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const promises = [];return properties && (properties.baseColorFactor ? (babylonMaterial.albedoColor = math_color/* Color3.FromArray */.Wo.FromArray(properties.baseColorFactor), babylonMaterial.alpha = properties.baseColorFactor[3]) : babylonMaterial.albedoColor = math_color/* Color3.White */.Wo.White(), babylonMaterial.metallic = null == properties.metallicFactor ? 1 : properties.metallicFactor, babylonMaterial.roughness = null == properties.roughnessFactor ? 1 : properties.roughnessFactor, properties.baseColorTexture && promises.push(this.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, (texture) => {texture.name = `${babylonMaterial.name} (Base Color)`, babylonMaterial.albedoTexture = texture;})), properties.metallicRoughnessTexture && (properties.metallicRoughnessTexture.nonColorData = !0, promises.push(this.loadTextureInfoAsync(`${context}/metallicRoughnessTexture`, properties.metallicRoughnessTexture, (texture) => {texture.name = `${babylonMaterial.name} (Metallic Roughness)`, babylonMaterial.metallicTexture = texture;})), babylonMaterial.useMetallnessFromMetallicTextureBlue = !0, babylonMaterial.useRoughnessFromMetallicTextureGreen = !0, babylonMaterial.useRoughnessFromMetallicTextureAlpha = !1)), Promise.all(promises).then(() => {});}_loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign = () => {}) {const extensionPromise = this._extensionsLoadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign);if (extensionPromise) return extensionPromise;material._data = material._data || {};let babylonData = material._data[babylonDrawMode];if (!babylonData) {this.logOpen(`${context} ${material.name || ""}`);const babylonMaterial = this.createMaterial(context, material, babylonDrawMode);babylonData = { babylonMaterial: babylonMaterial, babylonMeshes: [], promise: this.loadMaterialPropertiesAsync(context, material, babylonMaterial) }, material._data[babylonDrawMode] = babylonData, glTFLoader_GLTFLoader.AddPointerMetadata(babylonMaterial, context), this._parent.onMaterialLoadedObservable.notifyObservers(babylonMaterial), this.logClose();}return babylonMesh && (babylonData.babylonMeshes.push(babylonMesh), babylonMesh.onDisposeObservable.addOnce(() => {const index = babylonData.babylonMeshes.indexOf(babylonMesh);-1 !== index && babylonData.babylonMeshes.splice(index, 1);})), assign(babylonData.babylonMaterial), babylonData.promise.then(() => babylonData.babylonMaterial);}_createDefaultMaterial(name, babylonDrawMode) {this._babylonScene._blockEntityCollection = !!this._assetContainer;const babylonMaterial = new PBR_pbrMaterial/* PBRMaterial */.Y(name, this._babylonScene);return babylonMaterial._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, babylonMaterial.fillMode = babylonDrawMode, babylonMaterial.enableSpecularAntiAliasing = !0, babylonMaterial.useRadianceOverAlpha = !this._parent.transparencyAsCoverage, babylonMaterial.useSpecularOverAlpha = !this._parent.transparencyAsCoverage, babylonMaterial.transparencyMode = PBR_pbrMaterial/* PBRMaterial.PBRMATERIAL_OPAQUE */.Y.PBRMATERIAL_OPAQUE, babylonMaterial.metallic = 1, babylonMaterial.roughness = 1, babylonMaterial;}createMaterial(context, material, babylonDrawMode) {const extensionPromise = this._extensionsCreateMaterial(context, material, babylonDrawMode);if (extensionPromise) return extensionPromise;const name = material.name || `material${material.index}`,babylonMaterial = this._createDefaultMaterial(name, babylonDrawMode);return babylonMaterial;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {const extensionPromise = this._extensionsLoadMaterialPropertiesAsync(context, material, babylonMaterial);if (extensionPromise) return extensionPromise;const promises = [];return promises.push(this.loadMaterialBasePropertiesAsync(context, material, babylonMaterial)), material.pbrMetallicRoughness && promises.push(this._loadMaterialMetallicRoughnessPropertiesAsync(`${context}/pbrMetallicRoughness`, material.pbrMetallicRoughness, babylonMaterial)), this.loadMaterialAlphaProperties(context, material, babylonMaterial), Promise.all(promises).then(() => {});}loadMaterialBasePropertiesAsync(context, material, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const promises = [];return babylonMaterial.emissiveColor = material.emissiveFactor ? math_color/* Color3.FromArray */.Wo.FromArray(material.emissiveFactor) : new math_color/* Color3 */.Wo(0, 0, 0), material.doubleSided && (babylonMaterial.backFaceCulling = !1, babylonMaterial.twoSidedLighting = !0), material.normalTexture && (material.normalTexture.nonColorData = !0, promises.push(this.loadTextureInfoAsync(`${context}/normalTexture`, material.normalTexture, (texture) => {texture.name = `${babylonMaterial.name} (Normal)`, babylonMaterial.bumpTexture = texture;})), babylonMaterial.invertNormalMapX = !this._babylonScene.useRightHandedSystem, babylonMaterial.invertNormalMapY = this._babylonScene.useRightHandedSystem, null != material.normalTexture.scale && babylonMaterial.bumpTexture && (babylonMaterial.bumpTexture.level = material.normalTexture.scale), babylonMaterial.forceIrradianceInFragment = !0), material.occlusionTexture && (material.occlusionTexture.nonColorData = !0, promises.push(this.loadTextureInfoAsync(`${context}/occlusionTexture`, material.occlusionTexture, (texture) => {texture.name = `${babylonMaterial.name} (Occlusion)`, babylonMaterial.ambientTexture = texture;})), babylonMaterial.useAmbientInGrayScale = !0, null != material.occlusionTexture.strength && (babylonMaterial.ambientTextureStrength = material.occlusionTexture.strength)), material.emissiveTexture && promises.push(this.loadTextureInfoAsync(`${context}/emissiveTexture`, material.emissiveTexture, (texture) => {texture.name = `${babylonMaterial.name} (Emissive)`, babylonMaterial.emissiveTexture = texture;})), Promise.all(promises).then(() => {});}loadMaterialAlphaProperties(context, material, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const alphaMode = material.alphaMode || "OPAQUE";switch (alphaMode) {case "OPAQUE":{babylonMaterial.transparencyMode = PBR_pbrMaterial/* PBRMaterial.PBRMATERIAL_OPAQUE */.Y.PBRMATERIAL_OPAQUE;break;}case "MASK":{babylonMaterial.transparencyMode = PBR_pbrMaterial/* PBRMaterial.PBRMATERIAL_ALPHATEST */.Y.PBRMATERIAL_ALPHATEST, babylonMaterial.alphaCutOff = material.alphaCutoff == null ? .5 : material.alphaCutoff, babylonMaterial.albedoTexture && (babylonMaterial.albedoTexture.hasAlpha = !0);break;}case "BLEND":{babylonMaterial.transparencyMode = PBR_pbrMaterial/* PBRMaterial.PBRMATERIAL_ALPHABLEND */.Y.PBRMATERIAL_ALPHABLEND, babylonMaterial.albedoTexture && (babylonMaterial.albedoTexture.hasAlpha = !0, babylonMaterial.useAlphaFromAlbedoTexture = !0);break;}default:throw new Error(`${context}/alphaMode: Invalid value (${material.alphaMode})`);}}loadTextureInfoAsync(context, textureInfo, assign = () => {}) {const extensionPromise = this._extensionsLoadTextureInfoAsync(context, textureInfo, assign);if (extensionPromise) return extensionPromise;if (this.logOpen(`${context}`), 6 <= textureInfo.texCoord) throw new Error(`${context}/texCoord: Invalid value (${textureInfo.texCoord})`);const texture = ArrayItem.Get(`${context}/index`, this._gltf.textures, textureInfo.index);texture._textureInfo = textureInfo;const promise = this._loadTextureAsync(`/textures/${textureInfo.index}`, texture, (babylonTexture) => {babylonTexture.coordinatesIndex = textureInfo.texCoord || 0, glTFLoader_GLTFLoader.AddPointerMetadata(babylonTexture, context), this._parent.onTextureLoadedObservable.notifyObservers(babylonTexture), assign(babylonTexture);});return this.logClose(), promise;}_loadTextureAsync(context, texture, assign = () => {}) {const extensionPromise = this._extensionsLoadTextureAsync(context, texture, assign);if (extensionPromise) return extensionPromise;this.logOpen(`${context} ${texture.name || ""}`);const sampler = null == texture.sampler ? glTFLoader_GLTFLoader.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._gltf.samplers, texture.sampler),image = ArrayItem.Get(`${context}/source`, this._gltf.images, texture.source),promise = this._createTextureAsync(context, sampler, image, assign, void 0, !texture._textureInfo.nonColorData);return this.logClose(), promise;}_createTextureAsync(context, sampler, image, assign = () => {}, textureLoaderOptions, useSRGBBuffer) {const samplerData = this._loadSampler(`/samplers/${sampler.index}`, sampler),promises = [],deferred = new Misc_deferred/* Deferred */.B();this._babylonScene._blockEntityCollection = !!this._assetContainer;const textureCreationOptions = { noMipmap: samplerData.noMipMaps, invertY: !1, samplingMode: samplerData.samplingMode, onLoad: () => {this._disposed || deferred.resolve();}, onError: (message, exception) => {this._disposed || deferred.reject(new Error(`${context}: ${exception && exception.message ? exception.message : message || "Failed to load texture"}`));}, mimeType: image.mimeType, loaderOptions: textureLoaderOptions, useSRGBBuffer: !!useSRGBBuffer && this._parent.useSRGBBuffers },babylonTexture = new Textures_texture/* Texture */.x(null, this._babylonScene, textureCreationOptions);return babylonTexture._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, promises.push(deferred.promise), promises.push(this.loadImageAsync(`/images/${image.index}`, image).then((data) => {const name = image.uri || `${this._fileName}#image${image.index}`,dataUrl = `data:${this._uniqueRootUrl}${name}`;babylonTexture.updateURL(dataUrl, data);})), babylonTexture.wrapU = samplerData.wrapU, babylonTexture.wrapV = samplerData.wrapV, assign(babylonTexture), Promise.all(promises).then(() => babylonTexture);}_loadSampler(context, sampler) {return sampler._data || (sampler._data = { noMipMaps: 9728 === sampler.minFilter || 9729 === sampler.minFilter, samplingMode: glTFLoader_GLTFLoader._GetTextureSamplingMode(context, sampler), wrapU: glTFLoader_GLTFLoader._GetTextureWrapMode(`${context}/wrapS`, sampler.wrapS), wrapV: glTFLoader_GLTFLoader._GetTextureWrapMode(`${context}/wrapT`, sampler.wrapT) }), sampler._data;}loadImageAsync(context, image) {if (!image._data) {if (this.logOpen(`${context} ${image.name || ""}`), image.uri) image._data = this.loadUriAsync(`${context}/uri`, image, image.uri);else {const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, image.bufferView);image._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView);}this.logClose();}return image._data;}loadUriAsync(context, property, uri) {const extensionPromise = this._extensionsLoadUriAsync(context, property, uri);if (extensionPromise) return extensionPromise;if (!glTFLoader_GLTFLoader._ValidateUri(uri)) throw new Error(`${context}: '${uri}' is invalid`);if ((0,fileTools/* IsBase64DataUrl */.VL)(uri)) {const data = new Uint8Array((0,fileTools/* DecodeBase64UrlToBinary */.$K)(uri));return this.log(`${context}: Decoded ${uri.substr(0, 64)}... (${data.length} bytes)`), Promise.resolve(data);}return this.log(`${context}: Loading ${uri}`), this._parent.preprocessUrlAsync(this._rootUrl + uri).then((url) => new Promise((resolve, reject) => {this._parent._loadFile(this._babylonScene, url, (data) => {this._disposed || (this.log(`${context}: Loaded ${uri} (${data.byteLength} bytes)`), resolve(new Uint8Array(data)));}, !0, (request) => {reject(new fileTools/* LoadFileError */.eh(`${context}: Failed to load '${uri}'${request ? ": " + request.status + " " + request.statusText : ""}`, request));});}));}static AddPointerMetadata(babylonObject, pointer) {const metadata = babylonObject.metadata = babylonObject.metadata || {},gltf = metadata.gltf = metadata.gltf || {},pointers = gltf.pointers = gltf.pointers || [];pointers.push(pointer);}static _GetTextureWrapMode(context, mode) {return mode = null == mode ? 10497 : mode, 33071 === mode ? Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE : 33648 === mode ? Textures_texture/* Texture.MIRROR_ADDRESSMODE */.x.MIRROR_ADDRESSMODE : 10497 === mode ? Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE : (logger/* Logger.Warn */.Y.Warn(`${context}: Invalid value (${mode})`), Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE);}static _GetTextureSamplingMode(context, sampler) {const magFilter = sampler.magFilter == null ? 9729 : sampler.magFilter,minFilter = sampler.minFilter == null ? 9987 : sampler.minFilter;return 9729 === magFilter ? 9728 === minFilter ? Textures_texture/* Texture.LINEAR_NEAREST */.x.LINEAR_NEAREST : 9729 === minFilter ? Textures_texture/* Texture.LINEAR_LINEAR */.x.LINEAR_LINEAR : 9984 === minFilter ? Textures_texture/* Texture.LINEAR_NEAREST_MIPNEAREST */.x.LINEAR_NEAREST_MIPNEAREST : 9985 === minFilter ? Textures_texture/* Texture.LINEAR_LINEAR_MIPNEAREST */.x.LINEAR_LINEAR_MIPNEAREST : 9986 === minFilter ? Textures_texture/* Texture.LINEAR_NEAREST_MIPLINEAR */.x.LINEAR_NEAREST_MIPLINEAR : 9987 === minFilter ? Textures_texture/* Texture.LINEAR_LINEAR_MIPLINEAR */.x.LINEAR_LINEAR_MIPLINEAR : (logger/* Logger.Warn */.Y.Warn(`${context}/minFilter: Invalid value (${minFilter})`), Textures_texture/* Texture.LINEAR_LINEAR_MIPLINEAR */.x.LINEAR_LINEAR_MIPLINEAR) : (9728 !== magFilter && logger/* Logger.Warn */.Y.Warn(`${context}/magFilter: Invalid value (${magFilter})`), 9728 === minFilter ? Textures_texture/* Texture.NEAREST_NEAREST */.x.NEAREST_NEAREST : 9729 === minFilter ? Textures_texture/* Texture.NEAREST_LINEAR */.x.NEAREST_LINEAR : 9984 === minFilter ? Textures_texture/* Texture.NEAREST_NEAREST_MIPNEAREST */.x.NEAREST_NEAREST_MIPNEAREST : 9985 === minFilter ? Textures_texture/* Texture.NEAREST_LINEAR_MIPNEAREST */.x.NEAREST_LINEAR_MIPNEAREST : 9986 === minFilter ? Textures_texture/* Texture.NEAREST_NEAREST_MIPLINEAR */.x.NEAREST_NEAREST_MIPLINEAR : 9987 === minFilter ? Textures_texture/* Texture.NEAREST_LINEAR_MIPLINEAR */.x.NEAREST_LINEAR_MIPLINEAR : (logger/* Logger.Warn */.Y.Warn(`${context}/minFilter: Invalid value (${minFilter})`), Textures_texture/* Texture.NEAREST_NEAREST_MIPNEAREST */.x.NEAREST_NEAREST_MIPNEAREST));}static _GetTypedArrayConstructor(context, componentType) {switch (componentType) {case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error(`${context}: Invalid component type ${componentType}`);}}static _GetTypedArray(context, componentType, bufferView, byteOffset, length) {const buffer = bufferView.buffer;byteOffset = bufferView.byteOffset + (byteOffset || 0);const constructor = glTFLoader_GLTFLoader._GetTypedArrayConstructor(`${context}/componentType`, componentType),componentTypeLength = Buffers_buffer/* VertexBuffer.GetTypeByteLength */.o.GetTypeByteLength(componentType);return 0 == byteOffset % componentTypeLength ? new constructor(buffer, byteOffset, length) : (logger/* Logger.Warn */.Y.Warn(`${context}: Copying buffer as byte offset (${byteOffset}) is not a multiple of component type byte length (${componentTypeLength})`), new constructor(buffer.slice(byteOffset, byteOffset + length * componentTypeLength), 0));}static _GetNumComponents(context, type) {switch (type) {case "SCALAR":return 1;case "VEC2":return 2;case "VEC3":return 3;case "VEC4":return 4;case "MAT2":return 4;case "MAT3":return 9;case "MAT4":return 16;}throw new Error(`${context}: Invalid type (${type})`);}static _ValidateUri(uri) {return tools/* Tools.IsBase64 */.w1.IsBase64(uri) || -1 === uri.indexOf("..");}static _GetDrawMode(context, mode) {switch (null == mode && (mode = 4), mode) {case 0:return Materials_material/* Material.PointListDrawMode */.F.PointListDrawMode;case 1:return Materials_material/* Material.LineListDrawMode */.F.LineListDrawMode;case 2:return Materials_material/* Material.LineLoopDrawMode */.F.LineLoopDrawMode;case 3:return Materials_material/* Material.LineStripDrawMode */.F.LineStripDrawMode;case 4:return Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode;case 5:return Materials_material/* Material.TriangleStripDrawMode */.F.TriangleStripDrawMode;case 6:return Materials_material/* Material.TriangleFanDrawMode */.F.TriangleFanDrawMode;}throw new Error(`${context}: Invalid mesh primitive mode (${mode})`);}_compileMaterialsAsync() {this._parent._startPerformanceCounter("Compile materials");const promises = [];if (this._gltf.materials) for (const material of this._gltf.materials) if (material._data) for (const babylonDrawMode in material._data) {const babylonData = material._data[babylonDrawMode];for (const babylonMesh of babylonData.babylonMeshes) {babylonMesh.computeWorldMatrix(!0);const babylonMaterial = babylonData.babylonMaterial;promises.push(babylonMaterial.forceCompilationAsync(babylonMesh)), promises.push(babylonMaterial.forceCompilationAsync(babylonMesh, { useInstances: !0 })), this._parent.useClipPlane && (promises.push(babylonMaterial.forceCompilationAsync(babylonMesh, { clipPlane: !0 })), promises.push(babylonMaterial.forceCompilationAsync(babylonMesh, { clipPlane: !0, useInstances: !0 })));}}return Promise.all(promises).then(() => {this._parent._endPerformanceCounter("Compile materials");});}_compileShadowGeneratorsAsync() {this._parent._startPerformanceCounter("Compile shadow generators");const promises = [],lights = this._babylonScene.lights;for (const light of lights) {const generator = light.getShadowGenerator();generator && promises.push(generator.forceCompilationAsync());}return Promise.all(promises).then(() => {this._parent._endPerformanceCounter("Compile shadow generators");});}_forEachExtensions(action) {for (const extension of this._extensions) extension.enabled && action(extension);}_applyExtensions(property, functionName, actionAsync) {for (const extension of this._extensions) if (extension.enabled) {const id = `${extension.name}.${functionName}`,loaderProperty = property;loaderProperty._activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions || {};const activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions;if (!activeLoaderExtensionFunctions[id]) {activeLoaderExtensionFunctions[id] = !0;try {const result = actionAsync(extension);if (result) return result;} finally {delete activeLoaderExtensionFunctions[id];}}}return null;}_extensionsOnLoading() {this._forEachExtensions((extension) => extension.onLoading && extension.onLoading());}_extensionsOnReady() {this._forEachExtensions((extension) => extension.onReady && extension.onReady());}_extensionsLoadSceneAsync(context, scene) {return this._applyExtensions(scene, "loadScene", (extension) => extension.loadSceneAsync && extension.loadSceneAsync(context, scene));}_extensionsLoadNodeAsync(context, node, assign) {return this._applyExtensions(node, "loadNode", (extension) => extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign));}_extensionsLoadCameraAsync(context, camera, assign) {return this._applyExtensions(camera, "loadCamera", (extension) => extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign));}_extensionsLoadVertexDataAsync(context, primitive, babylonMesh) {return this._applyExtensions(primitive, "loadVertexData", (extension) => extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh));}_extensionsLoadMeshPrimitiveAsync(context, name, node, mesh, primitive, assign) {return this._applyExtensions(primitive, "loadMeshPrimitive", (extension) => extension._loadMeshPrimitiveAsync && extension._loadMeshPrimitiveAsync(context, name, node, mesh, primitive, assign));}_extensionsLoadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign) {return this._applyExtensions(material, "loadMaterial", (extension) => extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign));}_extensionsCreateMaterial(context, material, babylonDrawMode) {return this._applyExtensions(material, "createMaterial", (extension) => extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode));}_extensionsLoadMaterialPropertiesAsync(context, material, babylonMaterial) {return this._applyExtensions(material, "loadMaterialProperties", (extension) => extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial));}_extensionsLoadTextureInfoAsync(context, textureInfo, assign) {return this._applyExtensions(textureInfo, "loadTextureInfo", (extension) => extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign));}_extensionsLoadTextureAsync(context, texture, assign) {return this._applyExtensions(texture, "loadTexture", (extension) => extension._loadTextureAsync && extension._loadTextureAsync(context, texture, assign));}_extensionsLoadAnimationAsync(context, animation) {return this._applyExtensions(animation, "loadAnimation", (extension) => extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation));}_extensionsLoadAnimationChannelAsync(context, animationContext, animation, channel, onLoad) {return this._applyExtensions(animation, "loadAnimationChannel", (extension) => extension._loadAnimationChannelAsync && extension._loadAnimationChannelAsync(context, animationContext, animation, channel, onLoad));}_extensionsLoadSkinAsync(context, node, skin) {return this._applyExtensions(skin, "loadSkin", (extension) => extension._loadSkinAsync && extension._loadSkinAsync(context, node, skin));}_extensionsLoadUriAsync(context, property, uri) {return this._applyExtensions(property, "loadUri", (extension) => extension._loadUriAsync && extension._loadUriAsync(context, property, uri));}_extensionsLoadBufferViewAsync(context, bufferView) {return this._applyExtensions(bufferView, "loadBufferView", (extension) => extension.loadBufferViewAsync && extension.loadBufferViewAsync(context, bufferView));}_extensionsLoadBufferAsync(context, buffer, byteOffset, byteLength) {return this._applyExtensions(buffer, "loadBuffer", (extension) => extension.loadBufferAsync && extension.loadBufferAsync(context, buffer, byteOffset, byteLength));}static LoadExtensionAsync(context, property, extensionName, actionAsync) {if (!property.extensions) return null;const extensions = property.extensions,extension = extensions[extensionName];return extension ? actionAsync(`${context}/extensions/${extensionName}`, extension) : null;}static LoadExtraAsync(context, property, extensionName, actionAsync) {if (!property.extras) return null;const extras = property.extras,extra = extras[extensionName];return extra ? actionAsync(`${context}/extras/${extensionName}`, extra) : null;}isExtensionUsed(name) {return !!this._gltf.extensionsUsed && -1 !== this._gltf.extensionsUsed.indexOf(name);}logOpen(message) {this._parent._logOpen(message);}logClose() {this._parent._logClose();}log(message) {this._parent._log(message);}startPerformanceCounter(counterName) {this._parent._startPerformanceCounter(counterName);}endPerformanceCounter(counterName) {this._parent._endPerformanceCounter(counterName);}}glTFLoader_GLTFLoader._RegisteredExtensions = {}, glTFLoader_GLTFLoader.DefaultSampler = { index: -1 }, GLTFFileLoader._CreateGLTF2Loader = (parent) => new glTFLoader_GLTFLoader(parent);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/glTFLoaderExtension.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/glTFLoaderInterfaces.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.scalar.js
var math_scalar = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/sphericalPolynomial.js
var Maths_sphericalPolynomial = __webpack_require__("./node_modules/@babylonjs/core/Maths/sphericalPolynomial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/rawCubeTexture.js
var rawCubeTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/rawCubeTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_lights_image_based.js
const NAME = "EXT_lights_image_based";class EXT_lights_image_based {constructor(loader) {this.name = NAME, this._loader = loader, this.enabled = this._loader.isExtensionUsed(NAME);}dispose() {this._loader = null, delete this._lights;}onLoading() {const extensions = this._loader.gltf.extensions;if (extensions && extensions[this.name]) {const extension = extensions[this.name];this._lights = extension.lights;}}loadSceneAsync(context, scene) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, scene, this.name, (extensionContext, extension) => {const promises = [];promises.push(this._loader.loadSceneAsync(context, scene)), this._loader.logOpen(`${extensionContext}`);const light = ArrayItem.Get(`${extensionContext}/light`, this._lights, extension.light);return promises.push(this._loadLightAsync(`/extensions/${this.name}/lights/${extension.light}`, light).then((texture) => {this._loader.babylonScene.environmentTexture = texture;})), this._loader.logClose(), Promise.all(promises).then(() => {});});}_loadLightAsync(context, light) {if (!light._loaded) {const promises = [];this._loader.logOpen(`${context}`);const imageData = Array(light.specularImages.length);for (let mipmap = 0; mipmap < light.specularImages.length; mipmap++) {const faces = light.specularImages[mipmap];imageData[mipmap] = Array(faces.length);for (let face = 0; face < faces.length; face++) {const specularImageContext = `${context}/specularImages/${mipmap}/${face}`;this._loader.logOpen(`${specularImageContext}`);const index = faces[face],image = ArrayItem.Get(specularImageContext, this._loader.gltf.images, index);promises.push(this._loader.loadImageAsync(`/images/${index}`, image).then((data) => {imageData[mipmap][face] = data;})), this._loader.logClose();}}this._loader.logClose(), light._loaded = Promise.all(promises).then(() => {const babylonTexture = new rawCubeTexture/* RawCubeTexture */.N(this._loader.babylonScene, null, light.specularImageSize);if (babylonTexture.name = light.name || "environment", light._babylonTexture = babylonTexture, null != light.intensity && (babylonTexture.level = light.intensity), light.rotation) {let rotation = math_vector/* Quaternion.FromArray */._f.FromArray(light.rotation);this._loader.babylonScene.useRightHandedSystem || (rotation = math_vector/* Quaternion.Inverse */._f.Inverse(rotation)), math_vector/* Matrix.FromQuaternionToRef */.y3.FromQuaternionToRef(rotation, babylonTexture.getReflectionTextureMatrix());}if (!light.irradianceCoefficients) throw new Error(`${context}: Irradiance coefficients are missing`);const sphericalHarmonics = Maths_sphericalPolynomial/* SphericalHarmonics.FromArray */._.FromArray(light.irradianceCoefficients);sphericalHarmonics.scaleInPlace(light.intensity), sphericalHarmonics.convertIrradianceToLambertianRadiance();const sphericalPolynomial = Maths_sphericalPolynomial/* SphericalPolynomial.FromHarmonics */.i.FromHarmonics(sphericalHarmonics),lodGenerationScale = (imageData.length - 1) / math_scalar/* Scalar.Log2 */.R.Log2(light.specularImageSize);return babylonTexture.updateRGBDAsync(imageData, sphericalPolynomial, lodGenerationScale);});}return light._loaded.then(() => light._babylonTexture);}}glTFLoader_GLTFLoader.RegisterExtension("EXT_lights_image_based", (loader) => new EXT_lights_image_based(loader));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/thinInstanceMesh.js
var thinInstanceMesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/thinInstanceMesh.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js
const EXT_mesh_gpu_instancing_NAME = "EXT_mesh_gpu_instancing";class EXT_mesh_gpu_instancing {constructor(loader) {this.name = EXT_mesh_gpu_instancing_NAME, this._loader = loader, this.enabled = this._loader.isExtensionUsed(EXT_mesh_gpu_instancing_NAME);}dispose() {this._loader = null;}loadNodeAsync(context, node, assign) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, node, this.name, (extensionContext, extension) => {this._loader._disableInstancedMesh++;const promise = this._loader.loadNodeAsync(`/nodes/${node.index}`, node, assign);if (this._loader._disableInstancedMesh--, !node._primitiveBabylonMeshes) return promise;const promises = [];let instanceCount = 0;const loadAttribute = (attribute) => {if (null == extension.attributes[attribute]) return void promises.push(Promise.resolve(null));const accessor = ArrayItem.Get(`${extensionContext}/attributes/${attribute}`, this._loader.gltf.accessors, extension.attributes[attribute]);if (promises.push(this._loader._loadFloatAccessorAsync(`/accessors/${accessor.bufferView}`, accessor)), 0 === instanceCount) instanceCount = accessor.count;else if (instanceCount !== accessor.count) throw new Error(`${extensionContext}/attributes: Instance buffer accessors do not have the same count.`);};return loadAttribute("TRANSLATION"), loadAttribute("ROTATION"), loadAttribute("SCALE"), promise.then((babylonTransformNode) => Promise.all(promises).then(([translationBuffer, rotationBuffer, scaleBuffer]) => {const matrices = new Float32Array(16 * instanceCount);math_vector/* TmpVectors.Vector3.0.copyFromFloats */.jp.Vector3[0].copyFromFloats(0, 0, 0), math_vector/* TmpVectors.Quaternion.0.copyFromFloats */.jp.Quaternion[0].copyFromFloats(0, 0, 0, 1), math_vector/* TmpVectors.Vector3.1.copyFromFloats */.jp.Vector3[1].copyFromFloats(1, 1, 1);for (let i = 0; i < instanceCount; ++i) translationBuffer && math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(translationBuffer, 3 * i, math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]), rotationBuffer && math_vector/* Quaternion.FromArrayToRef */._f.FromArrayToRef(rotationBuffer, 4 * i, math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0]), scaleBuffer && math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(scaleBuffer, 3 * i, math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1]), math_vector/* Matrix.ComposeToRef */.y3.ComposeToRef(math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1], math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0], math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), math_vector/* TmpVectors.Matrix.0.copyToArray */.jp.Matrix[0].copyToArray(matrices, 16 * i);for (const babylonMesh of node._primitiveBabylonMeshes) babylonMesh.thinInstanceSetBuffer("matrix", matrices, 16, !0);return babylonTransformNode;}));});}}glTFLoader_GLTFLoader.RegisterExtension("EXT_mesh_gpu_instancing", (loader) => new EXT_mesh_gpu_instancing(loader));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/Compression/meshoptCompression.js
var meshoptCompression = __webpack_require__("./node_modules/@babylonjs/core/Meshes/Compression/meshoptCompression.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_meshopt_compression.js
const EXT_meshopt_compression_NAME = "EXT_meshopt_compression";class EXT_meshopt_compression {constructor(loader) {this.name = EXT_meshopt_compression_NAME, this.enabled = loader.isExtensionUsed(EXT_meshopt_compression_NAME), this._loader = loader;}dispose() {this._loader = null;}loadBufferViewAsync(context, bufferView) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, bufferView, this.name, (extensionContext, extension) => {const bufferViewMeshopt = bufferView;if (bufferViewMeshopt._meshOptData) return bufferViewMeshopt._meshOptData;const buffer = ArrayItem.Get(`${context}/buffer`, this._loader.gltf.buffers, extension.buffer);return bufferViewMeshopt._meshOptData = this._loader.loadBufferAsync(`/buffers/${buffer.index}`, buffer, extension.byteOffset || 0, extension.byteLength).then((buffer) => meshoptCompression/* MeshoptCompression.Default.decodeGltfBufferAsync */.K.Default.decodeGltfBufferAsync(buffer, extension.count, extension.byteStride, extension.mode, extension.filter)), bufferViewMeshopt._meshOptData;});}}glTFLoader_GLTFLoader.RegisterExtension("EXT_meshopt_compression", (loader) => new EXT_meshopt_compression(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_texture_webp.js
const EXT_texture_webp_NAME = "EXT_texture_webp";class EXT_texture_webp {constructor(loader) {this.name = EXT_texture_webp_NAME, this._loader = loader, this.enabled = loader.isExtensionUsed(EXT_texture_webp_NAME);}dispose() {this._loader = null;}_loadTextureAsync(context, texture, assign) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, texture, this.name, (extensionContext, extension) => {const sampler = texture.sampler == null ? glTFLoader_GLTFLoader.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture.sampler),image = ArrayItem.Get(`${extensionContext}/source`, this._loader.gltf.images, extension.source);return this._loader._createTextureAsync(context, sampler, image, (babylonTexture) => {assign(babylonTexture);}, void 0, !texture._textureInfo.nonColorData);});}}glTFLoader_GLTFLoader.RegisterExtension("EXT_texture_webp", (loader) => new EXT_texture_webp(loader));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.js
var Compression_dracoCompression = __webpack_require__("./node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression.js
const KHR_draco_mesh_compression_NAME = "KHR_draco_mesh_compression";class KHR_draco_mesh_compression {constructor(loader) {this.name = KHR_draco_mesh_compression_NAME, this._loader = loader, this.enabled = Compression_dracoCompression/* DracoCompression.DecoderAvailable */.J.DecoderAvailable && this._loader.isExtensionUsed(KHR_draco_mesh_compression_NAME);}dispose() {delete this.dracoCompression, this._loader = null;}_loadVertexDataAsync(context, primitive, babylonMesh) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, primitive, this.name, (extensionContext, extension) => {if (null != primitive.mode) {if (5 !== primitive.mode && 4 !== primitive.mode) throw new Error(`${context}: Unsupported mode ${primitive.mode}`);if (5 === primitive.mode) throw new Error(`${context}: Mode ${primitive.mode} is not currently supported`);}const attributes = {},dividers = {},loadAttribute = (name, kind) => {const uniqueId = extension.attributes[name];if (void 0 !== uniqueId && void 0 !== primitive.attributes[name]) {attributes[kind] = uniqueId;const accessor = ArrayItem.Get(`${context}/attributes/${name}`, this._loader.gltf.accessors, primitive.attributes[name]);if (accessor.normalized && 5126 !== accessor.componentType) {let divider = 1;switch (accessor.componentType) {case 5120:divider = 127;break;case 5121:divider = 255;break;case 5122:divider = 32767;break;case 5123:divider = 65535;}dividers[kind] = divider;}babylonMesh._delayInfo = babylonMesh._delayInfo || [], -1 === babylonMesh._delayInfo.indexOf(kind) && babylonMesh._delayInfo.push(kind);}};loadAttribute("POSITION", Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind), loadAttribute("NORMAL", Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind), loadAttribute("TANGENT", Buffers_buffer/* VertexBuffer.TangentKind */.o.TangentKind), loadAttribute("TEXCOORD_0", Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), loadAttribute("TEXCOORD_1", Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind), loadAttribute("TEXCOORD_2", Buffers_buffer/* VertexBuffer.UV3Kind */.o.UV3Kind), loadAttribute("TEXCOORD_3", Buffers_buffer/* VertexBuffer.UV4Kind */.o.UV4Kind), loadAttribute("TEXCOORD_4", Buffers_buffer/* VertexBuffer.UV5Kind */.o.UV5Kind), loadAttribute("TEXCOORD_5", Buffers_buffer/* VertexBuffer.UV6Kind */.o.UV6Kind), loadAttribute("JOINTS_0", Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind), loadAttribute("WEIGHTS_0", Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind), loadAttribute("COLOR_0", Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind);const bufferView = ArrayItem.Get(extensionContext, this._loader.gltf.bufferViews, extension.bufferView);return bufferView._dracoBabylonGeometry || (bufferView._dracoBabylonGeometry = this._loader.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => {const dracoCompression = this.dracoCompression || Compression_dracoCompression/* DracoCompression.Default */.J.Default;return dracoCompression.decodeMeshAsync(data, attributes, dividers).then((babylonVertexData) => {const babylonGeometry = new geometry/* Geometry */.Z(babylonMesh.name, this._loader.babylonScene);return babylonVertexData.applyToGeometry(babylonGeometry), babylonGeometry;}).catch((error) => {throw new Error(`${context}: ${error.message}`);});})), bufferView._dracoBabylonGeometry;});}}glTFLoader_GLTFLoader.RegisterExtension("KHR_draco_mesh_compression", (loader) => new KHR_draco_mesh_compression(loader));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/light.js
var Lights_light = __webpack_require__("./node_modules/@babylonjs/core/Lights/light.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_lights_punctual.js
const KHR_lights_punctual_NAME = "KHR_lights_punctual";class KHR_lights {constructor(loader) {this.name = KHR_lights_punctual_NAME, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_lights_punctual_NAME);}dispose() {this._loader = null, delete this._lights;}onLoading() {const extensions = this._loader.gltf.extensions;if (extensions && extensions[this.name]) {const extension = extensions[this.name];this._lights = extension.lights, ArrayItem.Assign(this._lights);}}loadNodeAsync(context, node, assign) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, node, this.name, (extensionContext, extension) => this._loader.loadNodeAsync(context, node, (babylonMesh) => {let babylonLight;const light = ArrayItem.Get(extensionContext, this._lights, extension.light),name = light.name || babylonMesh.name;switch (this._loader.babylonScene._blockEntityCollection = !!this._loader._assetContainer, light.type) {case "directional":{babylonLight = new Lights_directionalLight/* DirectionalLight */.O(name, math_vector/* Vector3.Backward */.P.Backward(), this._loader.babylonScene);break;}case "point":{babylonLight = new Lights_pointLight/* PointLight */.c(name, math_vector/* Vector3.Zero */.P.Zero(), this._loader.babylonScene);break;}case "spot":{const babylonSpotLight = new Lights_spotLight/* SpotLight */.P(name, math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Backward */.P.Backward(), 0, 1, this._loader.babylonScene);babylonSpotLight.angle = 2 * (light.spot && light.spot.outerConeAngle || Math.PI / 4), babylonSpotLight.innerAngle = 2 * (light.spot && light.spot.innerConeAngle || 0), babylonLight = babylonSpotLight;break;}default:throw this._loader.babylonScene._blockEntityCollection = !1, new Error(`${extensionContext}: Invalid light type (${light.type})`);}babylonLight._parentContainer = this._loader._assetContainer, this._loader.babylonScene._blockEntityCollection = !1, light._babylonLight = babylonLight, babylonLight.falloffType = Lights_light/* Light.FALLOFF_GLTF */._.FALLOFF_GLTF, babylonLight.diffuse = light.color ? math_color/* Color3.FromArray */.Wo.FromArray(light.color) : math_color/* Color3.White */.Wo.White(), babylonLight.intensity = null == light.intensity ? 1 : light.intensity, babylonLight.range = null == light.range ? Number.MAX_VALUE : light.range, babylonLight.parent = babylonMesh, this._loader._babylonLights.push(babylonLight), glTFLoader_GLTFLoader.AddPointerMetadata(babylonLight, extensionContext), assign(babylonMesh);}));}}glTFLoader_GLTFLoader.RegisterExtension("KHR_lights_punctual", (loader) => new KHR_lights(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js
const KHR_materials_pbrSpecularGlossiness_NAME = "KHR_materials_pbrSpecularGlossiness";class KHR_materials_pbrSpecularGlossiness {constructor(loader) {this.name = KHR_materials_pbrSpecularGlossiness_NAME, this.order = 200, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_pbrSpecularGlossiness_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial)), promises.push(this._loadSpecularGlossinessPropertiesAsync(extensionContext, material, extension, babylonMaterial)), this._loader.loadMaterialAlphaProperties(context, material, babylonMaterial), Promise.all(promises).then(() => {});});}_loadSpecularGlossinessPropertiesAsync(context, material, properties, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const promises = [];return babylonMaterial.metallic = null, babylonMaterial.roughness = null, properties.diffuseFactor ? (babylonMaterial.albedoColor = math_color/* Color3.FromArray */.Wo.FromArray(properties.diffuseFactor), babylonMaterial.alpha = properties.diffuseFactor[3]) : babylonMaterial.albedoColor = math_color/* Color3.White */.Wo.White(), babylonMaterial.reflectivityColor = properties.specularFactor ? math_color/* Color3.FromArray */.Wo.FromArray(properties.specularFactor) : math_color/* Color3.White */.Wo.White(), babylonMaterial.microSurface = null == properties.glossinessFactor ? 1 : properties.glossinessFactor, properties.diffuseTexture && promises.push(this._loader.loadTextureInfoAsync(`${context}/diffuseTexture`, properties.diffuseTexture, (texture) => {texture.name = `${babylonMaterial.name} (Diffuse)`, babylonMaterial.albedoTexture = texture;})), properties.specularGlossinessTexture && (promises.push(this._loader.loadTextureInfoAsync(`${context}/specularGlossinessTexture`, properties.specularGlossinessTexture, (texture) => {texture.name = `${babylonMaterial.name} (Specular Glossiness)`, babylonMaterial.reflectivityTexture = texture, babylonMaterial.reflectivityTexture.hasAlpha = !0;})), babylonMaterial.useMicroSurfaceFromReflectivityMapAlpha = !0), Promise.all(promises).then(() => {});}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_pbrSpecularGlossiness", (loader) => new KHR_materials_pbrSpecularGlossiness(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_unlit.js
const KHR_materials_unlit_NAME = "KHR_materials_unlit";class KHR_materials_unlit {constructor(loader) {this.name = KHR_materials_unlit_NAME, this.order = 210, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_unlit_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, () => this._loadUnlitPropertiesAsync(context, material, babylonMaterial));}_loadUnlitPropertiesAsync(context, material, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const promises = [];babylonMaterial.unlit = !0;const properties = material.pbrMetallicRoughness;return properties && (properties.baseColorFactor ? (babylonMaterial.albedoColor = math_color/* Color3.FromArray */.Wo.FromArray(properties.baseColorFactor), babylonMaterial.alpha = properties.baseColorFactor[3]) : babylonMaterial.albedoColor = math_color/* Color3.White */.Wo.White(), properties.baseColorTexture && promises.push(this._loader.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, (texture) => {texture.name = `${babylonMaterial.name} (Base Color)`, babylonMaterial.albedoTexture = texture;}))), material.doubleSided && (babylonMaterial.backFaceCulling = !1, babylonMaterial.twoSidedLighting = !0), this._loader.loadMaterialAlphaProperties(context, material, babylonMaterial), Promise.all(promises).then(() => {});}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_unlit", (loader) => new KHR_materials_unlit(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_clearcoat.js
const KHR_materials_clearcoat_NAME = "KHR_materials_clearcoat";class KHR_materials_clearcoat {constructor(loader) {this.name = KHR_materials_clearcoat_NAME, this.order = 190, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_clearcoat_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial)), promises.push(this._loadClearCoatPropertiesAsync(extensionContext, extension, babylonMaterial)), Promise.all(promises).then(() => {});});}_loadClearCoatPropertiesAsync(context, properties, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const promises = [];return babylonMaterial.clearCoat.isEnabled = !0, babylonMaterial.clearCoat.useRoughnessFromMainTexture = !1, babylonMaterial.clearCoat.remapF0OnInterfaceChange = !1, babylonMaterial.clearCoat.intensity = null == properties.clearcoatFactor ? 0 : properties.clearcoatFactor, properties.clearcoatTexture && promises.push(this._loader.loadTextureInfoAsync(`${context}/clearcoatTexture`, properties.clearcoatTexture, (texture) => {texture.name = `${babylonMaterial.name} (ClearCoat Intensity)`, babylonMaterial.clearCoat.texture = texture;})), babylonMaterial.clearCoat.roughness = null == properties.clearcoatRoughnessFactor ? 0 : properties.clearcoatRoughnessFactor, properties.clearcoatRoughnessTexture && (properties.clearcoatRoughnessTexture.nonColorData = !0, promises.push(this._loader.loadTextureInfoAsync(`${context}/clearcoatRoughnessTexture`, properties.clearcoatRoughnessTexture, (texture) => {texture.name = `${babylonMaterial.name} (ClearCoat Roughness)`, babylonMaterial.clearCoat.textureRoughness = texture;}))), properties.clearcoatNormalTexture && (properties.clearcoatNormalTexture.nonColorData = !0, promises.push(this._loader.loadTextureInfoAsync(`${context}/clearcoatNormalTexture`, properties.clearcoatNormalTexture, (texture) => {texture.name = `${babylonMaterial.name} (ClearCoat Normal)`, babylonMaterial.clearCoat.bumpTexture = texture;})), babylonMaterial.invertNormalMapX = !babylonMaterial.getScene().useRightHandedSystem, babylonMaterial.invertNormalMapY = babylonMaterial.getScene().useRightHandedSystem, null != properties.clearcoatNormalTexture.scale && (babylonMaterial.clearCoat.bumpTexture.level = properties.clearcoatNormalTexture.scale)), Promise.all(promises).then(() => {});}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_clearcoat", (loader) => new KHR_materials_clearcoat(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_iridescence.js
const KHR_materials_iridescence_NAME = "KHR_materials_iridescence";class KHR_materials_iridescence {constructor(loader) {this.name = KHR_materials_iridescence_NAME, this.order = 195, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_iridescence_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial)), promises.push(this._loadIridescencePropertiesAsync(extensionContext, extension, babylonMaterial)), Promise.all(promises).then(() => {});});}_loadIridescencePropertiesAsync(context, properties, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const promises = [];return babylonMaterial.iridescence.isEnabled = !0, babylonMaterial.iridescence.intensity = properties.iridescenceFactor ?? 0, babylonMaterial.iridescence.indexOfRefraction = properties.iridescenceIor ?? properties.iridescenceIOR ?? 1.3, babylonMaterial.iridescence.minimumThickness = properties.iridescenceThicknessMinimum ?? 100, babylonMaterial.iridescence.maximumThickness = properties.iridescenceThicknessMaximum ?? 400, properties.iridescenceTexture && promises.push(this._loader.loadTextureInfoAsync(`${context}/iridescenceTexture`, properties.iridescenceTexture, (texture) => {texture.name = `${babylonMaterial.name} (Iridescence Intensity)`, babylonMaterial.iridescence.texture = texture;})), properties.iridescenceThicknessTexture && promises.push(this._loader.loadTextureInfoAsync(`${context}/iridescenceThicknessTexture`, properties.iridescenceThicknessTexture, (texture) => {texture.name = `${babylonMaterial.name} (Iridescence Thickness)`, babylonMaterial.iridescence.thicknessTexture = texture;})), Promise.all(promises).then(() => {});}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_iridescence", (loader) => new KHR_materials_iridescence(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_emissive_strength.js
const KHR_materials_emissive_strength_NAME = "KHR_materials_emissive_strength";class KHR_materials_emissive_strength {constructor(loader) {this.name = KHR_materials_emissive_strength_NAME, this.order = 170, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_emissive_strength_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial).then(() => {this._loadEmissiveProperties(extensionContext, extension, babylonMaterial);}));}_loadEmissiveProperties(context, properties, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);properties.emissiveStrength !== void 0 && babylonMaterial.emissiveColor.scaleToRef(properties.emissiveStrength, babylonMaterial.emissiveColor);}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_emissive_strength", (loader) => new KHR_materials_emissive_strength(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_sheen.js
const KHR_materials_sheen_NAME = "KHR_materials_sheen";class KHR_materials_sheen {constructor(loader) {this.name = KHR_materials_sheen_NAME, this.order = 190, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_sheen_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial)), promises.push(this._loadSheenPropertiesAsync(extensionContext, extension, babylonMaterial)), Promise.all(promises).then(() => {});});}_loadSheenPropertiesAsync(context, properties, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const promises = [];return babylonMaterial.sheen.isEnabled = !0, babylonMaterial.sheen.intensity = 1, babylonMaterial.sheen.color = null == properties.sheenColorFactor ? math_color/* Color3.Black */.Wo.Black() : math_color/* Color3.FromArray */.Wo.FromArray(properties.sheenColorFactor), properties.sheenColorTexture && promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenColorTexture`, properties.sheenColorTexture, (texture) => {texture.name = `${babylonMaterial.name} (Sheen Color)`, babylonMaterial.sheen.texture = texture;})), babylonMaterial.sheen.roughness = void 0 === properties.sheenRoughnessFactor ? 0 : properties.sheenRoughnessFactor, properties.sheenRoughnessTexture && (properties.sheenRoughnessTexture.nonColorData = !0, promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenRoughnessTexture`, properties.sheenRoughnessTexture, (texture) => {texture.name = `${babylonMaterial.name} (Sheen Roughness)`, babylonMaterial.sheen.textureRoughness = texture;}))), babylonMaterial.sheen.albedoScaling = !0, babylonMaterial.sheen.useRoughnessFromMainTexture = !1, Promise.all(promises).then(() => {});}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_sheen", (loader) => new KHR_materials_sheen(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_specular.js
const KHR_materials_specular_NAME = "KHR_materials_specular";class KHR_materials_specular {constructor(loader) {this.name = KHR_materials_specular_NAME, this.order = 190, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_specular_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial)), promises.push(this._loadSpecularPropertiesAsync(extensionContext, extension, babylonMaterial)), Promise.all(promises).then(() => {});});}_loadSpecularPropertiesAsync(context, properties, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const promises = [];return void 0 !== properties.specularFactor && (babylonMaterial.metallicF0Factor = properties.specularFactor), void 0 !== properties.specularColorFactor && (babylonMaterial.metallicReflectanceColor = math_color/* Color3.FromArray */.Wo.FromArray(properties.specularColorFactor)), properties.specularTexture && (properties.specularTexture.nonColorData = !0, promises.push(this._loader.loadTextureInfoAsync(`${context}/specularTexture`, properties.specularTexture, (texture) => {texture.name = `${babylonMaterial.name} (Specular F0 Strength)`, babylonMaterial.metallicReflectanceTexture = texture, babylonMaterial.useOnlyMetallicFromMetallicReflectanceTexture = !0;}))), properties.specularColorTexture && promises.push(this._loader.loadTextureInfoAsync(`${context}/specularColorTexture`, properties.specularColorTexture, (texture) => {texture.name = `${babylonMaterial.name} (Specular F0 Color)`, babylonMaterial.reflectanceTexture = texture;})), Promise.all(promises).then(() => {});}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_specular", (loader) => new KHR_materials_specular(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_ior.js
const KHR_materials_ior_NAME = "KHR_materials_ior";class KHR_materials_ior {constructor(loader) {this.name = KHR_materials_ior_NAME, this.order = 180, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_ior_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial)), promises.push(this._loadIorPropertiesAsync(extensionContext, extension, babylonMaterial)), Promise.all(promises).then(() => {});});}_loadIorPropertiesAsync(context, properties, babylonMaterial) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);return babylonMaterial.indexOfRefraction = void 0 === properties.ior ? KHR_materials_ior._DEFAULT_IOR : properties.ior, Promise.resolve();}}KHR_materials_ior._DEFAULT_IOR = 1.5, glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_ior", (loader) => new KHR_materials_ior(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_variants.js
const KHR_materials_variants_NAME = "KHR_materials_variants";class KHR_materials_variants {constructor(loader) {this.name = KHR_materials_variants_NAME, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_variants_NAME);}dispose() {this._loader = null;}static GetAvailableVariants(rootMesh) {const extensionMetadata = this._GetExtensionMetadata(rootMesh);return extensionMetadata ? Object.keys(extensionMetadata.variants) : [];}getAvailableVariants(rootMesh) {return KHR_materials_variants.GetAvailableVariants(rootMesh);}static SelectVariant(rootMesh, variantName) {const extensionMetadata = this._GetExtensionMetadata(rootMesh);if (!extensionMetadata) throw new Error(`Cannot select variant on a glTF mesh that does not have the ${KHR_materials_variants_NAME} extension`);const select = (variantName) => {const entries = extensionMetadata.variants[variantName];if (entries) for (const entry of entries) entry.mesh.material = entry.material;};if (variantName instanceof Array) for (const name of variantName) select(name);else select(variantName);extensionMetadata.lastSelected = variantName;}selectVariant(rootMesh, variantName) {return KHR_materials_variants.SelectVariant(rootMesh, variantName);}static Reset(rootMesh) {const extensionMetadata = this._GetExtensionMetadata(rootMesh);if (!extensionMetadata) throw new Error(`Cannot reset on a glTF mesh that does not have the ${KHR_materials_variants_NAME} extension`);for (const entry of extensionMetadata.original) entry.mesh.material = entry.material;extensionMetadata.lastSelected = null;}reset(rootMesh) {return KHR_materials_variants.Reset(rootMesh);}static GetLastSelectedVariant(rootMesh) {const extensionMetadata = this._GetExtensionMetadata(rootMesh);if (!extensionMetadata) throw new Error(`Cannot get the last selected variant on a glTF mesh that does not have the ${KHR_materials_variants_NAME} extension`);return extensionMetadata.lastSelected;}getLastSelectedVariant(rootMesh) {return KHR_materials_variants.GetLastSelectedVariant(rootMesh);}static _GetExtensionMetadata(rootMesh) {var _rootMesh$metadata, _rootMesh$metadata$gl;return (rootMesh === null || rootMesh === void 0 ? void 0 : (_rootMesh$metadata = rootMesh.metadata) === null || _rootMesh$metadata === void 0 ? void 0 : (_rootMesh$metadata$gl = _rootMesh$metadata.gltf) === null || _rootMesh$metadata$gl === void 0 ? void 0 : _rootMesh$metadata$gl[KHR_materials_variants_NAME]) || null;}onLoading() {const extensions = this._loader.gltf.extensions;if (extensions && extensions[this.name]) {const extension = extensions[this.name];this._variants = extension.variants;}}_loadMeshPrimitiveAsync(context, name, node, mesh, primitive, assign) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, primitive, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader._loadMeshPrimitiveAsync(context, name, node, mesh, primitive, (babylonMesh) => {if (assign(babylonMesh), babylonMesh instanceof Meshes_mesh/* Mesh */.Kj) {const babylonDrawMode = glTFLoader_GLTFLoader._GetDrawMode(context, primitive.mode),root = this._loader.rootBabylonMesh,metadata = root ? root.metadata = root.metadata || {} : {},gltf = metadata.gltf = metadata.gltf || {},extensionMetadata = gltf[KHR_materials_variants_NAME] = gltf[KHR_materials_variants_NAME] || { lastSelected: null, original: [], variants: {} };extensionMetadata.original.push({ mesh: babylonMesh, material: babylonMesh.material });for (let mappingIndex = 0; mappingIndex < extension.mappings.length; ++mappingIndex) {const mapping = extension.mappings[mappingIndex],material = ArrayItem.Get(`${extensionContext}/mappings/${mappingIndex}/material`, this._loader.gltf.materials, mapping.material);promises.push(this._loader._loadMaterialAsync(`#/materials/${mapping.material}`, material, babylonMesh, babylonDrawMode, (babylonMaterial) => {for (let mappingVariantIndex = 0; mappingVariantIndex < mapping.variants.length; ++mappingVariantIndex) {const variantIndex = mapping.variants[mappingVariantIndex],variant = ArrayItem.Get(`/extensions/${KHR_materials_variants_NAME}/variants/${variantIndex}`, this._variants, variantIndex);extensionMetadata.variants[variant.name] = extensionMetadata.variants[variant.name] || [], extensionMetadata.variants[variant.name].push({ mesh: babylonMesh, material: babylonMaterial }), babylonMesh.onClonedObservable.add((newOne) => {const newMesh = newOne;let metadata = null,newRoot = newMesh;do {if (newRoot = newRoot.parent, !newRoot) return;metadata = KHR_materials_variants._GetExtensionMetadata(newRoot);} while (null === metadata);if (root && metadata === KHR_materials_variants._GetExtensionMetadata(root)) {for (const key in newRoot.metadata = {}, root.metadata) newRoot.metadata[key] = root.metadata[key];for (const key in newRoot.metadata.gltf = [], root.metadata.gltf) newRoot.metadata.gltf[key] = root.metadata.gltf[key];newRoot.metadata.gltf[KHR_materials_variants_NAME] = { lastSelected: null, original: [], variants: {} };for (const original of metadata.original) newRoot.metadata.gltf[KHR_materials_variants_NAME].original.push({ mesh: original.mesh, material: original.material });for (const key in metadata.variants) if (Object.prototype.hasOwnProperty.call(metadata.variants, key)) {newRoot.metadata.gltf[KHR_materials_variants_NAME].variants[key] = [];for (const variantEntry of metadata.variants[key]) newRoot.metadata.gltf[KHR_materials_variants_NAME].variants[key].push({ mesh: variantEntry.mesh, material: variantEntry.material });}metadata = newRoot.metadata.gltf[KHR_materials_variants_NAME];}for (const target of metadata.original) target.mesh === babylonMesh && (target.mesh = newMesh);for (const target of metadata.variants[variant.name]) target.mesh === babylonMesh && (target.mesh = newMesh);});}}));}}})), Promise.all(promises).then(([babylonMesh]) => babylonMesh);});}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_variants", (loader) => new KHR_materials_variants(loader));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.js
var renderTargetTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_transmission.js
class TransmissionHelper {constructor(options, scene) {this._opaqueRenderTarget = null, this._opaqueMeshesCache = [], this._transparentMeshesCache = [], this._materialObservers = {}, this._options = { ...TransmissionHelper._GetDefaultOptions(), ...options }, this._scene = scene, this._scene._transmissionHelper = this, this.onErrorObservable = new observable/* Observable */.y$(), this._scene.onDisposeObservable.addOnce(() => {this.dispose();}), this._parseScene(), this._setupRenderTargets();}static _GetDefaultOptions() {return { renderSize: 1024, samples: 4, lodGenerationScale: 1, lodGenerationOffset: -4, renderTargetTextureType: constants/* Constants.TEXTURETYPE_HALF_FLOAT */.g.TEXTURETYPE_HALF_FLOAT, generateMipmaps: !0 };}updateOptions(options) {const newValues = Object.keys(options).filter((key) => this._options[key] !== options[key]);if (!newValues.length) return;const newOptions = { ...this._options, ...options },oldOptions = this._options;this._options = newOptions, newOptions.renderSize === oldOptions.renderSize && newOptions.renderTargetTextureType === oldOptions.renderTargetTextureType && newOptions.generateMipmaps === oldOptions.generateMipmaps && this._opaqueRenderTarget ? (this._opaqueRenderTarget.samples = newOptions.samples, this._opaqueRenderTarget.lodGenerationScale = newOptions.lodGenerationScale, this._opaqueRenderTarget.lodGenerationOffset = newOptions.lodGenerationOffset) : this._setupRenderTargets();}getOpaqueTarget() {return this._opaqueRenderTarget;}_shouldRenderAsTransmission(material) {return !!material && !!(material instanceof PBR_pbrMaterial/* PBRMaterial */.Y && material.subSurface.isRefractionEnabled);}_addMesh(mesh) {this._materialObservers[mesh.uniqueId] = mesh.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)), tools/* Tools.SetImmediate */.w1.SetImmediate(() => {this._shouldRenderAsTransmission(mesh.material) ? (mesh.material.refractionTexture = this._opaqueRenderTarget, this._transparentMeshesCache.push(mesh)) : this._opaqueMeshesCache.push(mesh);});}_removeMesh(mesh) {mesh.onMaterialChangedObservable.remove(this._materialObservers[mesh.uniqueId]), delete this._materialObservers[mesh.uniqueId];let idx = this._transparentMeshesCache.indexOf(mesh);-1 !== idx && this._transparentMeshesCache.splice(idx, 1), idx = this._opaqueMeshesCache.indexOf(mesh), -1 !== idx && this._opaqueMeshesCache.splice(idx, 1);}_parseScene() {this._scene.meshes.forEach(this._addMesh.bind(this)), this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)), this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));}_onMeshMaterialChanged(mesh) {const transparentIdx = this._transparentMeshesCache.indexOf(mesh),opaqueIdx = this._opaqueMeshesCache.indexOf(mesh),useTransmission = this._shouldRenderAsTransmission(mesh.material);useTransmission ? (mesh.material instanceof PBR_pbrMaterial/* PBRMaterial */.Y && (mesh.material.subSurface.refractionTexture = this._opaqueRenderTarget), -1 === opaqueIdx ? -1 === transparentIdx && this._transparentMeshesCache.push(mesh) : (this._opaqueMeshesCache.splice(opaqueIdx, 1), this._transparentMeshesCache.push(mesh))) : -1 === transparentIdx ? -1 === opaqueIdx && this._opaqueMeshesCache.push(mesh) : (this._transparentMeshesCache.splice(transparentIdx, 1), this._opaqueMeshesCache.push(mesh));}_setupRenderTargets() {var _this$_options$clearC;this._opaqueRenderTarget && this._opaqueRenderTarget.dispose(), this._opaqueRenderTarget = new renderTargetTexture/* RenderTargetTexture */._("opaqueSceneTexture", this._options.renderSize, this._scene, this._options.generateMipmaps, void 0, this._options.renderTargetTextureType), this._opaqueRenderTarget.ignoreCameraViewport = !0, this._opaqueRenderTarget.renderList = this._opaqueMeshesCache, this._opaqueRenderTarget.clearColor = ((_this$_options$clearC = this._options.clearColor) === null || _this$_options$clearC === void 0 ? void 0 : _this$_options$clearC.clone()) ?? this._scene.clearColor.clone(), this._opaqueRenderTarget.gammaSpace = !1, this._opaqueRenderTarget.lodGenerationScale = this._options.lodGenerationScale, this._opaqueRenderTarget.lodGenerationOffset = this._options.lodGenerationOffset, this._opaqueRenderTarget.samples = this._options.samples;let sceneImageProcessingapplyByPostProcess, saveSceneEnvIntensity;this._opaqueRenderTarget.onBeforeBindObservable.add((opaqueRenderTarget) => {saveSceneEnvIntensity = this._scene.environmentIntensity, this._scene.environmentIntensity = 1, sceneImageProcessingapplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess, this._options.clearColor ? opaqueRenderTarget.clearColor.copyFrom(this._options.clearColor) : this._scene.clearColor.toLinearSpaceToRef(opaqueRenderTarget.clearColor), this._scene.imageProcessingConfiguration._applyByPostProcess = !0;}), this._opaqueRenderTarget.onAfterUnbindObservable.add(() => {this._scene.environmentIntensity = saveSceneEnvIntensity, this._scene.imageProcessingConfiguration._applyByPostProcess = sceneImageProcessingapplyByPostProcess;}), this._transparentMeshesCache.forEach((mesh) => {this._shouldRenderAsTransmission(mesh.material) && (mesh.material.refractionTexture = this._opaqueRenderTarget);});}dispose() {this._scene._transmissionHelper = void 0, this._opaqueRenderTarget && (this._opaqueRenderTarget.dispose(), this._opaqueRenderTarget = null), this._transparentMeshesCache = [], this._opaqueMeshesCache = [];}}const KHR_materials_transmission_NAME = "KHR_materials_transmission";class KHR_materials_transmission {constructor(loader) {this.name = KHR_materials_transmission_NAME, this.order = 175, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_transmission_NAME), this.enabled && (loader.parent.transparencyAsCoverage = !0);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial)), promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial)), promises.push(this._loadTransparentPropertiesAsync(extensionContext, material, babylonMaterial, extension)), Promise.all(promises).then(() => {});});}_loadTransparentPropertiesAsync(context, material, babylonMaterial, extension) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const pbrMaterial = babylonMaterial;if (pbrMaterial.subSurface.isRefractionEnabled = !0, pbrMaterial.subSurface.volumeIndexOfRefraction = 1, pbrMaterial.subSurface.useAlbedoToTintRefraction = !0, void 0 !== extension.transmissionFactor) {pbrMaterial.subSurface.refractionIntensity = extension.transmissionFactor;const scene = pbrMaterial.getScene();pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper && new TransmissionHelper({}, pbrMaterial.getScene());} else return pbrMaterial.subSurface.refractionIntensity = 0, pbrMaterial.subSurface.isRefractionEnabled = !1, Promise.resolve();return pbrMaterial.subSurface.minimumThickness = 0, pbrMaterial.subSurface.maximumThickness = 0, extension.transmissionTexture ? (extension.transmissionTexture.nonColorData = !0, this._loader.loadTextureInfoAsync(`${context}/transmissionTexture`, extension.transmissionTexture, void 0).then((texture) => {pbrMaterial.subSurface.refractionIntensityTexture = texture, pbrMaterial.subSurface.useGltfStyleTextures = !0;})) : Promise.resolve();}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_transmission", (loader) => new KHR_materials_transmission(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_translucency.js
const KHR_materials_translucency_NAME = "KHR_materials_translucency";class KHR_materials_translucency {constructor(loader) {this.name = KHR_materials_translucency_NAME, this.order = 174, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_translucency_NAME), this.enabled && (loader.parent.transparencyAsCoverage = !0);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial)), promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial)), promises.push(this._loadTranslucentPropertiesAsync(extensionContext, material, babylonMaterial, extension)), Promise.all(promises).then(() => {});});}_loadTranslucentPropertiesAsync(context, material, babylonMaterial, extension) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);const pbrMaterial = babylonMaterial;if (pbrMaterial.subSurface.isTranslucencyEnabled = !0, pbrMaterial.subSurface.volumeIndexOfRefraction = 1, pbrMaterial.subSurface.minimumThickness = 0, pbrMaterial.subSurface.maximumThickness = 0, pbrMaterial.subSurface.useAlbedoToTintTranslucency = !0, void 0 !== extension.translucencyFactor) pbrMaterial.subSurface.translucencyIntensity = extension.translucencyFactor;else return pbrMaterial.subSurface.translucencyIntensity = 0, pbrMaterial.subSurface.isTranslucencyEnabled = !1, Promise.resolve();return extension.translucencyTexture ? (extension.translucencyTexture.nonColorData = !0, this._loader.loadTextureInfoAsync(`${context}/translucencyTexture`, extension.translucencyTexture).then((texture) => {pbrMaterial.subSurface.translucencyIntensityTexture = texture;})) : Promise.resolve();}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_translucency", (loader) => new KHR_materials_translucency(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_volume.js
const KHR_materials_volume_NAME = "KHR_materials_volume";class KHR_materials_volume {constructor(loader) {this.name = KHR_materials_volume_NAME, this.order = 173, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_materials_volume_NAME), this.enabled && this._loader._disableInstancedMesh++;}dispose() {this.enabled && this._loader._disableInstancedMesh--, this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {const promises = [];return promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial)), promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial)), promises.push(this._loadVolumePropertiesAsync(extensionContext, material, babylonMaterial, extension)), Promise.all(promises).then(() => {});});}_loadVolumePropertiesAsync(context, material, babylonMaterial, extension) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${context}: Material type not supported`);if (!babylonMaterial.subSurface.isRefractionEnabled && !babylonMaterial.subSurface.isTranslucencyEnabled || !extension.thicknessFactor) return Promise.resolve();babylonMaterial.subSurface.volumeIndexOfRefraction = babylonMaterial.indexOfRefraction;const attenuationDistance = void 0 === extension.attenuationDistance ? Number.MAX_VALUE : extension.attenuationDistance;return babylonMaterial.subSurface.tintColorAtDistance = attenuationDistance, void 0 !== extension.attenuationColor && 3 == extension.attenuationColor.length && babylonMaterial.subSurface.tintColor.copyFromFloats(extension.attenuationColor[0], extension.attenuationColor[1], extension.attenuationColor[2]), babylonMaterial.subSurface.minimumThickness = 0, babylonMaterial.subSurface.maximumThickness = extension.thicknessFactor, babylonMaterial.subSurface.useThicknessAsDepth = !0, extension.thicknessTexture ? (extension.thicknessTexture.nonColorData = !0, this._loader.loadTextureInfoAsync(`${context}/thicknessTexture`, extension.thicknessTexture).then((texture) => {babylonMaterial.subSurface.thicknessTexture = texture, babylonMaterial.subSurface.useGltfStyleTextures = !0;})) : Promise.resolve();}}glTFLoader_GLTFLoader.RegisterExtension("KHR_materials_volume", (loader) => new KHR_materials_volume(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_mesh_quantization.js
const KHR_mesh_quantization_NAME = "KHR_mesh_quantization";class KHR_mesh_quantization {constructor(loader) {this.name = KHR_mesh_quantization_NAME, this.enabled = loader.isExtensionUsed(KHR_mesh_quantization_NAME);}dispose() {}}glTFLoader_GLTFLoader.RegisterExtension("KHR_mesh_quantization", (loader) => new KHR_mesh_quantization(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_texture_basisu.js
const KHR_texture_basisu_NAME = "KHR_texture_basisu";class KHR_texture_basisu {constructor(loader) {this.name = KHR_texture_basisu_NAME, this._loader = loader, this.enabled = loader.isExtensionUsed(KHR_texture_basisu_NAME);}dispose() {this._loader = null;}_loadTextureAsync(context, texture, assign) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, texture, this.name, (extensionContext, extension) => {const sampler = texture.sampler == null ? glTFLoader_GLTFLoader.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture.sampler),image = ArrayItem.Get(`${extensionContext}/source`, this._loader.gltf.images, extension.source);return this._loader._createTextureAsync(context, sampler, image, (babylonTexture) => {assign(babylonTexture);}, texture._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: !0 } : void 0, !texture._textureInfo.nonColorData);});}}glTFLoader_GLTFLoader.RegisterExtension("KHR_texture_basisu", (loader) => new KHR_texture_basisu(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_texture_transform.js
const KHR_texture_transform_NAME = "KHR_texture_transform";class KHR_texture_transform {constructor(loader) {this.name = KHR_texture_transform_NAME, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_texture_transform_NAME);}dispose() {this._loader = null;}loadTextureInfoAsync(context, textureInfo, assign) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, textureInfo, this.name, (extensionContext, extension) => this._loader.loadTextureInfoAsync(context, textureInfo, (babylonTexture) => {if (!(babylonTexture instanceof Textures_texture/* Texture */.x)) throw new Error(`${extensionContext}: Texture type not supported`);extension.offset && (babylonTexture.uOffset = extension.offset[0], babylonTexture.vOffset = extension.offset[1]), babylonTexture.uRotationCenter = 0, babylonTexture.vRotationCenter = 0, extension.rotation && (babylonTexture.wAng = -extension.rotation), extension.scale && (babylonTexture.uScale = extension.scale[0], babylonTexture.vScale = extension.scale[1]), null != extension.texCoord && (babylonTexture.coordinatesIndex = extension.texCoord), assign(babylonTexture);}));}}glTFLoader_GLTFLoader.RegisterExtension("KHR_texture_transform", (loader) => new KHR_texture_transform(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_xmp_json_ld.js
const KHR_xmp_json_ld_NAME = "KHR_xmp_json_ld";class KHR_xmp_json_ld {constructor(loader) {this.name = KHR_xmp_json_ld_NAME, this.order = 100, this._loader = loader, this.enabled = this._loader.isExtensionUsed(KHR_xmp_json_ld_NAME);}dispose() {this._loader = null;}onLoading() {var _this$_loader$gltf$ex, _this$_loader$gltf$as, _this$_loader$gltf$as2;if (null === this._loader.rootBabylonMesh) return;const xmp_gltf = (_this$_loader$gltf$ex = this._loader.gltf.extensions) === null || _this$_loader$gltf$ex === void 0 ? void 0 : _this$_loader$gltf$ex.KHR_xmp_json_ld,xmp_node = (_this$_loader$gltf$as = this._loader.gltf.asset) === null || _this$_loader$gltf$as === void 0 ? void 0 : (_this$_loader$gltf$as2 = _this$_loader$gltf$as.extensions) === null || _this$_loader$gltf$as2 === void 0 ? void 0 : _this$_loader$gltf$as2.KHR_xmp_json_ld;if (xmp_gltf && xmp_node) {const packet = +xmp_node.packet;xmp_gltf.packets && packet < xmp_gltf.packets.length && (this._loader.rootBabylonMesh.metadata = this._loader.rootBabylonMesh.metadata || {}, this._loader.rootBabylonMesh.metadata.xmp = xmp_gltf.packets[packet]);}}}glTFLoader_GLTFLoader.RegisterExtension("KHR_xmp_json_ld", (loader) => new KHR_xmp_json_ld(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_animation_pointer.data.js
function getColor3(_target, source, offset, scale) {return math_color/* Color3.FromArray */.Wo.FromArray(source, offset).scale(scale);}function getAlpha(_target, source, offset, scale) {return source[offset + 3] * scale;}function getFloat(_target, source, offset, scale) {return source[offset] * scale;}function getMinusFloat(_target, source, offset, scale) {return -source[offset] * scale;}function getNextFloat(_target, source, offset, scale) {return source[offset + 1] * scale;}function getFloatBy2(_target, source, offset, scale) {return 2 * (source[offset] * scale);}function getTextureTransformTree(textureName) {return { scale: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, `${textureName}.uScale`, getFloat, () => 2), new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, `${textureName}.vScale`, getNextFloat, () => 2)], offset: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, `${textureName}.uOffset`, getFloat, () => 2), new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, `${textureName}.vOffset`, getNextFloat, () => 2)], rotation: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, `${textureName}.wAng`, getMinusFloat, () => 1)] };}class CameraAnimationPropertyInfo extends AnimationPropertyInfo {buildAnimations(target, name, fps, keys, callback) {callback(target._babylonCamera, this._buildAnimation(name, fps, keys));}}class MaterialAnimationPropertyInfo extends AnimationPropertyInfo {buildAnimations(target, name, fps, keys, callback) {for (const fillMode in target._data) callback(target._data[fillMode].babylonMaterial, this._buildAnimation(name, fps, keys));}}class LightAnimationPropertyInfo extends AnimationPropertyInfo {buildAnimations(target, name, fps, keys, callback) {callback(target._babylonLight, this._buildAnimation(name, fps, keys));}}const nodesTree = { __array__: { __target__: !0, ...nodeAnimationData } },camerasTree = { __array__: { __target__: !0, orthographic: { xmag: [new CameraAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "orthoLeft", getMinusFloat, () => 1), new CameraAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "orthoRight", getNextFloat, () => 1)], ymag: [new CameraAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "orthoBottom", getMinusFloat, () => 1), new CameraAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "orthoTop", getNextFloat, () => 1)], zfar: [new CameraAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "maxZ", getFloat, () => 1)], znear: [new CameraAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "minZ", getFloat, () => 1)] }, perspective: { yfov: [new CameraAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "fov", getFloat, () => 1)], zfar: [new CameraAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "maxZ", getFloat, () => 1)], znear: [new CameraAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "minZ", getFloat, () => 1)] } } },materialsTree = { __array__: { __target__: !0, pbrMetallicRoughness: { baseColorFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_COLOR3 */.f.ANIMATIONTYPE_COLOR3, "albedoColor", getColor3, () => 4), new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "alpha", getAlpha, () => 4)], metallicFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "metallic", getFloat, () => 1)], roughnessFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "roughness", getFloat, () => 1)], baseColorTexture: { extensions: { KHR_texture_transform: getTextureTransformTree("albedoTexture") } } }, emissiveFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_COLOR3 */.f.ANIMATIONTYPE_COLOR3, "emissiveColor", getColor3, () => 3)], normalTexture: { scale: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "bumpTexture.level", getFloat, () => 1)] }, occlusionTexture: { strength: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "ambientTextureStrength", getFloat, () => 1)], extensions: { KHR_texture_transform: getTextureTransformTree("ambientTexture") } }, emissiveTexture: { extensions: { KHR_texture_transform: getTextureTransformTree("emissiveTexture") } }, extensions: { KHR_materials_ior: { ior: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "indexOfRefraction", getFloat, () => 1)] }, KHR_materials_clearcoat: { clearcoatFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "clearCoat.intensity", getFloat, () => 1)], clearcoatRoughnessFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "clearCoat.roughness", getFloat, () => 1)] }, KHR_materials_sheen: { sheenColorFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_COLOR3 */.f.ANIMATIONTYPE_COLOR3, "sheen.color", getColor3, () => 3)], sheenRoughnessFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "sheen.roughness", getFloat, () => 1)] }, KHR_materials_specular: { specularFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "metallicF0Factor", getFloat, () => 1)], specularColorFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_COLOR3 */.f.ANIMATIONTYPE_COLOR3, "metallicReflectanceColor", getColor3, () => 3)] }, KHR_materials_emissive_strength: { emissiveStrength: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "emissiveIntensity", getFloat, () => 1)] }, KHR_materials_transmission: { transmissionFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "subSurface.refractionIntensity", getFloat, () => 1)] }, KHR_materials_volume: { attenuationColor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_COLOR3 */.f.ANIMATIONTYPE_COLOR3, "subSurface.tintColor", getColor3, () => 3)], attenuationDistance: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "subSurface.tintColorAtDistance", getFloat, () => 1)], thicknessFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "subSurface.maximumThickness", getFloat, () => 1)] }, KHR_materials_iridescence: { iridescenceFactor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "iridescence.intensity", getFloat, () => 1)], iridescenceIor: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "iridescence.indexOfRefraction", getFloat, () => 1)], iridescenceThicknessMinimum: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "iridescence.minimumThickness", getFloat, () => 1)], iridescenceThicknessMaximum: [new MaterialAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "iridescence.maximumThickness", getFloat, () => 1)] } } } },extensionsTree = { KHR_lights_punctual: { lights: { __array__: { __target__: !0, color: [new LightAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_COLOR3 */.f.ANIMATIONTYPE_COLOR3, "diffuse", getColor3, () => 3)], intensity: [new LightAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "intensity", getFloat, () => 1)], range: [new LightAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "range", getFloat, () => 1)], spot: { innerConeAngle: [new LightAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "innerAngle", getFloatBy2, () => 1)], outerConeAngle: [new LightAnimationPropertyInfo(Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, "angle", getFloatBy2, () => 1)] } } } } };const animationPointerTree = { nodes: nodesTree, materials: materialsTree, cameras: camerasTree, extensions: extensionsTree };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_animation_pointer.js
const KHR_animation_pointer_NAME = "KHR_animation_pointer";class KHR_animation_pointer {constructor(loader) {this.name = KHR_animation_pointer_NAME, this._loader = loader;}get enabled() {return this._loader.isExtensionUsed(KHR_animation_pointer_NAME);}dispose() {this._loader = null;}_loadAnimationChannelAsync(context, animationContext, animation, channel, onLoad) {var _channel$target$exten;const extension = (_channel$target$exten = channel.target.extensions) === null || _channel$target$exten === void 0 ? void 0 : _channel$target$exten.KHR_animation_pointer;if (!extension) return null;"pointer" !== channel.target.path && logger/* Logger.Warn */.Y.Warn(`${context}/target/path: Value (${channel.target.path}) must be (${"pointer"}) when using the ${this.name} extension`), channel.target.node != null && logger/* Logger.Warn */.Y.Warn(`${context}/target/node: Value (${channel.target.node}) must not be present when using the ${this.name} extension`);const extensionContext = `${context}/extensions/${this.name}`,pointer = extension.pointer;if (!pointer) throw new Error(`${extensionContext}: Pointer is missing`);const targetInfo = this._parseAnimationPointer(`${extensionContext}/pointer`, pointer);return targetInfo ? this._loader._loadAnimationChannelFromTargetInfoAsync(context, animationContext, animation, channel, targetInfo, onLoad) : (logger/* Logger.Warn */.Y.Warn(`${extensionContext}/pointer: Invalid pointer (${pointer}) skipped`), null);}_parseAnimationPointer(context, pointer) {if (!pointer.startsWith("/")) return logger/* Logger.Warn */.Y.Warn(`${context}: Value (${pointer}) must start with a slash`), null;const parts = pointer.split("/");parts.shift();let gltfTargetNode,node = animationPointerTree,gltfCurrentNode = this._loader.gltf;for (const part of parts) {if (node.__array__) node = node.__array__;else if (node = node[part], !node) return null;gltfCurrentNode = gltfCurrentNode && gltfCurrentNode[part], node.__target__ && (gltfTargetNode = gltfCurrentNode);}return gltfTargetNode && Array.isArray(node) ? { target: gltfTargetNode, properties: node } : null;}}glTFLoader_GLTFLoader.RegisterExtension("KHR_animation_pointer", (loader) => new KHR_animation_pointer(loader));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationEvent.js
var animationEvent = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationEvent.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Audio/sound.js
var Audio_sound = __webpack_require__("./node_modules/@babylonjs/core/Audio/sound.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Audio/weightedsound.js
var weightedsound = __webpack_require__("./node_modules/@babylonjs/core/Audio/weightedsound.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_audio_emitter.js
const MSFT_audio_emitter_NAME = "MSFT_audio_emitter";class MSFT_audio_emitter {constructor(loader) {this.name = MSFT_audio_emitter_NAME, this._loader = loader, this.enabled = this._loader.isExtensionUsed(MSFT_audio_emitter_NAME);}dispose() {this._loader = null, this._clips = null, this._emitters = null;}onLoading() {const extensions = this._loader.gltf.extensions;if (extensions && extensions[this.name]) {const extension = extensions[this.name];this._clips = extension.clips, this._emitters = extension.emitters, ArrayItem.Assign(this._clips), ArrayItem.Assign(this._emitters);}}loadSceneAsync(context, scene) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, scene, this.name, (extensionContext, extension) => {const promises = [];promises.push(this._loader.loadSceneAsync(context, scene));for (const emitterIndex of extension.emitters) {const emitter = ArrayItem.Get(`${extensionContext}/emitters`, this._emitters, emitterIndex);if (emitter.refDistance != null || emitter.maxDistance != null || emitter.rolloffFactor != null || emitter.distanceModel != null || emitter.innerAngle != null || emitter.outerAngle != null) throw new Error(`${extensionContext}: Direction or Distance properties are not allowed on emitters attached to a scene`);promises.push(this._loadEmitterAsync(`${extensionContext}/emitters/${emitter.index}`, emitter));}return Promise.all(promises).then(() => {});});}loadNodeAsync(context, node, assign) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, node, this.name, (extensionContext, extension) => {const promises = [];return this._loader.loadNodeAsync(extensionContext, node, (babylonMesh) => {for (const emitterIndex of extension.emitters) {const emitter = ArrayItem.Get(`${extensionContext}/emitters`, this._emitters, emitterIndex);promises.push(this._loadEmitterAsync(`${extensionContext}/emitters/${emitter.index}`, emitter).then(() => {for (const sound of emitter._babylonSounds) sound.attachToMesh(babylonMesh), (null != emitter.innerAngle || null != emitter.outerAngle) && (sound.setLocalDirectionToMesh(math_vector/* Vector3.Forward */.P.Forward()), sound.setDirectionalCone(2 * tools/* Tools.ToDegrees */.w1.ToDegrees(null == emitter.innerAngle ? Math.PI : emitter.innerAngle), 2 * tools/* Tools.ToDegrees */.w1.ToDegrees(null == emitter.outerAngle ? Math.PI : emitter.outerAngle), 0));}));}assign(babylonMesh);}).then((babylonMesh) => Promise.all(promises).then(() => babylonMesh));});}loadAnimationAsync(context, animation) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, animation, this.name, (extensionContext, extension) => this._loader.loadAnimationAsync(context, animation).then((babylonAnimationGroup) => {const promises = [];ArrayItem.Assign(extension.events);for (const event of extension.events) promises.push(this._loadAnimationEventAsync(`${extensionContext}/events/${event.index}`, context, animation, event, babylonAnimationGroup));return Promise.all(promises).then(() => babylonAnimationGroup);}));}_loadClipAsync(context, clip) {if (clip._objectURL) return clip._objectURL;let promise;if (clip.uri) promise = this._loader.loadUriAsync(context, clip, clip.uri);else {const bufferView = ArrayItem.Get(`${context}/bufferView`, this._loader.gltf.bufferViews, clip.bufferView);promise = this._loader.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView);}return clip._objectURL = promise.then((data) => URL.createObjectURL(new Blob([data], { type: clip.mimeType }))), clip._objectURL;}_loadEmitterAsync(context, emitter) {if (emitter._babylonSounds = emitter._babylonSounds || [], !emitter._babylonData) {const clipPromises = [],name = emitter.name || `emitter${emitter.index}`,options = { loop: !1, autoplay: !1, volume: null == emitter.volume ? 1 : emitter.volume };for (let i = 0; i < emitter.clips.length; i++) {const clipContext = `/extensions/${this.name}/clips`,clip = ArrayItem.Get(clipContext, this._clips, emitter.clips[i].clip);clipPromises.push(this._loadClipAsync(`${clipContext}/${emitter.clips[i].clip}`, clip).then((objectURL) => {const sound = emitter._babylonSounds[i] = new Audio_sound/* Sound */.$(name, objectURL, this._loader.babylonScene, null, options);sound.refDistance = emitter.refDistance || 1, sound.maxDistance = emitter.maxDistance || 256, sound.rolloffFactor = emitter.rolloffFactor || 1, sound.distanceModel = emitter.distanceModel || "exponential";}));}const promise = Promise.all(clipPromises).then(() => {const weights = emitter.clips.map((clip) => clip.weight || 1),weightedSound = new weightedsound/* WeightedSound */.s(emitter.loop || !1, emitter._babylonSounds, weights);emitter.innerAngle && (weightedSound.directionalConeInnerAngle = 2 * tools/* Tools.ToDegrees */.w1.ToDegrees(emitter.innerAngle)), emitter.outerAngle && (weightedSound.directionalConeOuterAngle = 2 * tools/* Tools.ToDegrees */.w1.ToDegrees(emitter.outerAngle)), emitter.volume && (weightedSound.volume = emitter.volume), emitter._babylonData.sound = weightedSound;});emitter._babylonData = { loaded: promise };}return emitter._babylonData.loaded;}_getEventAction(context, sound, action, time, startOffset) {switch (action) {case "play":return (currentFrame) => {sound.play((startOffset || 0) + (currentFrame - time));};case "stop":return () => {sound.stop();};case "pause":return () => {sound.pause();};default:throw new Error(`${context}: Unsupported action ${action}`);}}_loadAnimationEventAsync(context, animationContext, animation, event, babylonAnimationGroup) {if (0 == babylonAnimationGroup.targetedAnimations.length) return Promise.resolve();const babylonAnimation = babylonAnimationGroup.targetedAnimations[0],emitterIndex = event.emitter,emitter = ArrayItem.Get(`/extensions/${this.name}/emitters`, this._emitters, emitterIndex);return this._loadEmitterAsync(context, emitter).then(() => {const sound = emitter._babylonData.sound;if (sound) {const babylonAnimationEvent = new animationEvent/* AnimationEvent */.O(event.time, this._getEventAction(context, sound, event.action, event.time, event.startOffset));babylonAnimation.animation.addEvent(babylonAnimationEvent), babylonAnimationGroup.onAnimationGroupEndObservable.add(() => {sound.stop();}), babylonAnimationGroup.onAnimationGroupPauseObservable.add(() => {sound.pause();});}});}}glTFLoader_GLTFLoader.RegisterExtension("MSFT_audio_emitter", (loader) => new MSFT_audio_emitter(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_lod.js
const MSFT_lod_NAME = "MSFT_lod";class MSFT_lod {constructor(loader) {this.name = MSFT_lod_NAME, this.order = 100, this.maxLODsToLoad = 10, this.onNodeLODsLoadedObservable = new observable/* Observable */.y$(), this.onMaterialLODsLoadedObservable = new observable/* Observable */.y$(), this._bufferLODs = [], this._nodeIndexLOD = null, this._nodeSignalLODs = [], this._nodePromiseLODs = [], this._nodeBufferLODs = [], this._materialIndexLOD = null, this._materialSignalLODs = [], this._materialPromiseLODs = [], this._materialBufferLODs = [], this._loader = loader, this.enabled = this._loader.isExtensionUsed(MSFT_lod_NAME);}dispose() {this._loader = null, this._nodeIndexLOD = null, this._nodeSignalLODs.length = 0, this._nodePromiseLODs.length = 0, this._nodeBufferLODs.length = 0, this._materialIndexLOD = null, this._materialSignalLODs.length = 0, this._materialPromiseLODs.length = 0, this._materialBufferLODs.length = 0, this.onMaterialLODsLoadedObservable.clear(), this.onNodeLODsLoadedObservable.clear();}onReady() {for (let indexLOD = 0; indexLOD < this._nodePromiseLODs.length; indexLOD++) {const promise = Promise.all(this._nodePromiseLODs[indexLOD]).then(() => {0 !== indexLOD && (this._loader.endPerformanceCounter(`Node LOD ${indexLOD}`), this._loader.log(`Loaded node LOD ${indexLOD}`)), this.onNodeLODsLoadedObservable.notifyObservers(indexLOD), indexLOD !== this._nodePromiseLODs.length - 1 && (this._loader.startPerformanceCounter(`Node LOD ${indexLOD + 1}`), this._loadBufferLOD(this._nodeBufferLODs, indexLOD + 1), this._nodeSignalLODs[indexLOD] && this._nodeSignalLODs[indexLOD].resolve());});this._loader._completePromises.push(promise);}for (let indexLOD = 0; indexLOD < this._materialPromiseLODs.length; indexLOD++) {const promise = Promise.all(this._materialPromiseLODs[indexLOD]).then(() => {0 !== indexLOD && (this._loader.endPerformanceCounter(`Material LOD ${indexLOD}`), this._loader.log(`Loaded material LOD ${indexLOD}`)), this.onMaterialLODsLoadedObservable.notifyObservers(indexLOD), indexLOD !== this._materialPromiseLODs.length - 1 && (this._loader.startPerformanceCounter(`Material LOD ${indexLOD + 1}`), this._loadBufferLOD(this._materialBufferLODs, indexLOD + 1), this._materialSignalLODs[indexLOD] && this._materialSignalLODs[indexLOD].resolve());});this._loader._completePromises.push(promise);}}loadSceneAsync(context, scene) {const promise = this._loader.loadSceneAsync(context, scene);return this._loadBufferLOD(this._bufferLODs, 0), promise;}loadNodeAsync(context, node, assign) {return glTFLoader_GLTFLoader.LoadExtensionAsync(context, node, this.name, (extensionContext, extension) => {let firstPromise;const nodeLODs = this._getLODs(extensionContext, node, this._loader.gltf.nodes, extension.ids);this._loader.logOpen(`${extensionContext}`);for (let indexLOD = 0; indexLOD < nodeLODs.length; indexLOD++) {const nodeLOD = nodeLODs[indexLOD];0 != indexLOD && (this._nodeIndexLOD = indexLOD, this._nodeSignalLODs[indexLOD] = this._nodeSignalLODs[indexLOD] || new Misc_deferred/* Deferred */.B());const promise = this._loader.loadNodeAsync(`/nodes/${nodeLOD.index}`, nodeLOD, (babylonTransformNode) => {assign(babylonTransformNode), babylonTransformNode.setEnabled(!1);}).then((babylonMesh) => {if (0 !== indexLOD) {const previousNodeLOD = nodeLODs[indexLOD - 1];previousNodeLOD._babylonTransformNode && (this._disposeTransformNode(previousNodeLOD._babylonTransformNode), delete previousNodeLOD._babylonTransformNode);}return babylonMesh.setEnabled(!0), babylonMesh;});this._nodePromiseLODs[indexLOD] = this._nodePromiseLODs[indexLOD] || [], 0 == indexLOD ? firstPromise = promise : (this._nodeIndexLOD = null, this._nodePromiseLODs[indexLOD].push(promise));}return this._loader.logClose(), firstPromise;});}_loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign) {return this._nodeIndexLOD ? null : glTFLoader_GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {let firstPromise;const materialLODs = this._getLODs(extensionContext, material, this._loader.gltf.materials, extension.ids);this._loader.logOpen(`${extensionContext}`);for (let indexLOD = 0; indexLOD < materialLODs.length; indexLOD++) {const materialLOD = materialLODs[indexLOD];0 != indexLOD && (this._materialIndexLOD = indexLOD);const promise = this._loader._loadMaterialAsync(`/materials/${materialLOD.index}`, materialLOD, babylonMesh, babylonDrawMode, (babylonMaterial) => {0 === indexLOD && assign(babylonMaterial);}).then((babylonMaterial) => {if (0 !== indexLOD) {assign(babylonMaterial);const previousDataLOD = materialLODs[indexLOD - 1]._data;previousDataLOD[babylonDrawMode] && (this._disposeMaterials([previousDataLOD[babylonDrawMode].babylonMaterial]), delete previousDataLOD[babylonDrawMode]);}return babylonMaterial;});this._materialPromiseLODs[indexLOD] = this._materialPromiseLODs[indexLOD] || [], 0 == indexLOD ? firstPromise = promise : (this._materialIndexLOD = null, this._materialPromiseLODs[indexLOD].push(promise));}return this._loader.logClose(), firstPromise;});}_loadUriAsync(context, property, uri) {if (null !== this._nodeIndexLOD) {this._loader.log(`deferred`);const previousIndexLOD = this._nodeIndexLOD - 1;return this._nodeSignalLODs[previousIndexLOD] = this._nodeSignalLODs[previousIndexLOD] || new Misc_deferred/* Deferred */.B(), this._nodeSignalLODs[this._nodeIndexLOD - 1].promise.then(() => this._loader.loadUriAsync(context, property, uri));}if (null !== this._materialIndexLOD) {this._loader.log(`deferred`);const previousIndexLOD = this._materialIndexLOD - 1;return this._materialSignalLODs[previousIndexLOD] = this._materialSignalLODs[previousIndexLOD] || new Misc_deferred/* Deferred */.B(), this._materialSignalLODs[previousIndexLOD].promise.then(() => this._loader.loadUriAsync(context, property, uri));}return null;}loadBufferAsync(context, buffer, byteOffset, byteLength) {if (this._loader.parent.useRangeRequests && !buffer.uri) {if (!this._loader.bin) throw new Error(`${context}: Uri is missing or the binary glTF is missing its binary chunk`);const loadAsync = (bufferLODs, indexLOD) => {const start = byteOffset,end = start + byteLength - 1;let bufferLOD = bufferLODs[indexLOD];return bufferLOD ? (bufferLOD.start = Math.min(bufferLOD.start, start), bufferLOD.end = Math.max(bufferLOD.end, end)) : (bufferLOD = { start: start, end: end, loaded: new Misc_deferred/* Deferred */.B() }, bufferLODs[indexLOD] = bufferLOD), bufferLOD.loaded.promise.then((data) => new Uint8Array(data.buffer, data.byteOffset + byteOffset - bufferLOD.start, byteLength));};return this._loader.log(`deferred`), null === this._nodeIndexLOD ? null === this._materialIndexLOD ? loadAsync(this._bufferLODs, 0) : loadAsync(this._materialBufferLODs, this._materialIndexLOD) : loadAsync(this._nodeBufferLODs, this._nodeIndexLOD);}return null;}_loadBufferLOD(bufferLODs, indexLOD) {const bufferLOD = bufferLODs[indexLOD];bufferLOD && (this._loader.log(`Loading buffer range [${bufferLOD.start}-${bufferLOD.end}]`), this._loader.bin.readAsync(bufferLOD.start, bufferLOD.end - bufferLOD.start + 1).then((data) => {bufferLOD.loaded.resolve(data);}, (error) => {bufferLOD.loaded.reject(error);}));}_getLODs(context, property, array, ids) {if (0 >= this.maxLODsToLoad) throw new Error("maxLODsToLoad must be greater than zero");const properties = [];for (let i = ids.length - 1; 0 <= i; i--) if (properties.push(ArrayItem.Get(`${context}/ids/${ids[i]}`, array, ids[i])), properties.length === this.maxLODsToLoad) return properties;return properties.push(property), properties;}_disposeTransformNode(babylonTransformNode) {const babylonMaterials = [],babylonMaterial = babylonTransformNode.material;babylonMaterial && babylonMaterials.push(babylonMaterial);for (const babylonMesh of babylonTransformNode.getChildMeshes()) babylonMesh.material && babylonMaterials.push(babylonMesh.material);babylonTransformNode.dispose();const babylonMaterialsToDispose = babylonMaterials.filter((babylonMaterial) => this._loader.babylonScene.meshes.every((mesh) => mesh.material != babylonMaterial));this._disposeMaterials(babylonMaterialsToDispose);}_disposeMaterials(babylonMaterials) {const babylonTextures = {};for (const babylonMaterial of babylonMaterials) {for (const babylonTexture of babylonMaterial.getActiveTextures()) babylonTextures[babylonTexture.uniqueId] = babylonTexture;babylonMaterial.dispose();}for (const uniqueId in babylonTextures) for (const babylonMaterial of this._loader.babylonScene.materials) babylonMaterial.hasTexture(babylonTextures[uniqueId]) && delete babylonTextures[uniqueId];for (const uniqueId in babylonTextures) babylonTextures[uniqueId].dispose();}}glTFLoader_GLTFLoader.RegisterExtension("MSFT_lod", (loader) => new MSFT_lod(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_minecraftMesh.js
const MSFT_minecraftMesh_NAME = "MSFT_minecraftMesh";class MSFT_minecraftMesh {constructor(loader) {this.name = MSFT_minecraftMesh_NAME, this._loader = loader, this.enabled = this._loader.isExtensionUsed(MSFT_minecraftMesh_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtraAsync(context, material, this.name, (extraContext, extra) => {if (extra) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${extraContext}: Material type not supported`);const promise = this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);return babylonMaterial.needAlphaBlending() && (babylonMaterial.forceDepthWrite = !0, babylonMaterial.separateCullingPass = !0), babylonMaterial.backFaceCulling = babylonMaterial.forceDepthWrite, babylonMaterial.twoSidedLighting = !0, promise;}return null;});}}glTFLoader_GLTFLoader.RegisterExtension("MSFT_minecraftMesh", (loader) => new MSFT_minecraftMesh(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_sRGBFactors.js
const MSFT_sRGBFactors_NAME = "MSFT_sRGBFactors";class MSFT_sRGBFactors {constructor(loader) {this.name = MSFT_sRGBFactors_NAME, this._loader = loader, this.enabled = this._loader.isExtensionUsed(MSFT_sRGBFactors_NAME);}dispose() {this._loader = null;}loadMaterialPropertiesAsync(context, material, babylonMaterial) {return glTFLoader_GLTFLoader.LoadExtraAsync(context, material, this.name, (extraContext, extra) => {if (extra) {if (!(babylonMaterial instanceof PBR_pbrMaterial/* PBRMaterial */.Y)) throw new Error(`${extraContext}: Material type not supported`);const promise = this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);return babylonMaterial.albedoTexture || babylonMaterial.albedoColor.toLinearSpaceToRef(babylonMaterial.albedoColor), babylonMaterial.reflectivityTexture || babylonMaterial.reflectivityColor.toLinearSpaceToRef(babylonMaterial.reflectivityColor), promise;}return null;});}}glTFLoader_GLTFLoader.RegisterExtension("MSFT_sRGBFactors", (loader) => new MSFT_sRGBFactors(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/ExtrasAsMetadata.js
const ExtrasAsMetadata_NAME = "ExtrasAsMetadata";class ExtrasAsMetadata {constructor(loader) {this.name = ExtrasAsMetadata_NAME, this.enabled = !0, this._loader = loader;}_assignExtras(babylonObject, gltfProp) {if (gltfProp.extras && 0 < Object.keys(gltfProp.extras).length) {const metadata = babylonObject.metadata = babylonObject.metadata || {},gltf = metadata.gltf = metadata.gltf || {};gltf.extras = gltfProp.extras;}}dispose() {this._loader = null;}loadNodeAsync(context, node, assign) {return this._loader.loadNodeAsync(context, node, (babylonTransformNode) => {this._assignExtras(babylonTransformNode, node), assign(babylonTransformNode);});}loadCameraAsync(context, camera, assign) {return this._loader.loadCameraAsync(context, camera, (babylonCamera) => {this._assignExtras(babylonCamera, camera), assign(babylonCamera);});}createMaterial(context, material, babylonDrawMode) {const babylonMaterial = this._loader.createMaterial(context, material, babylonDrawMode);return this._assignExtras(babylonMaterial, material), babylonMaterial;}}glTFLoader_GLTFLoader.RegisterExtension("ExtrasAsMetadata", (loader) => new ExtrasAsMetadata(loader));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/Extensions/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/2.0/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/glTF/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/OBJ/mtlFileLoader.js
class MTLFileLoader {constructor() {this.materials = [];}parseMTL(scene, data, rootUrl, assetContainer) {if (data instanceof ArrayBuffer) return;const lines = data.split("\n"),delimiter_pattern = /\s+/;let color,material = null;for (let i = 0; i < lines.length; i++) {const line = lines[i].trim();if (0 === line.length || "#" === line.charAt(0)) continue;const pos = line.indexOf(" ");let key = 0 <= pos ? line.substring(0, pos) : line;key = key.toLowerCase();const value = 0 <= pos ? line.substring(pos + 1).trim() : "";if ("newmtl" === key) material && this.materials.push(material), scene._blockEntityCollection = !!assetContainer, material = new Materials_standardMaterial/* StandardMaterial */.K(value, scene), material._parentContainer = assetContainer, scene._blockEntityCollection = !1;else if ("kd" === key && material) color = value.split(delimiter_pattern, 3).map(parseFloat), material.diffuseColor = math_color/* Color3.FromArray */.Wo.FromArray(color);else if ("ka" === key && material) color = value.split(delimiter_pattern, 3).map(parseFloat), material.ambientColor = math_color/* Color3.FromArray */.Wo.FromArray(color);else if ("ks" === key && material) color = value.split(delimiter_pattern, 3).map(parseFloat), material.specularColor = math_color/* Color3.FromArray */.Wo.FromArray(color);else if ("ke" === key && material) color = value.split(delimiter_pattern, 3).map(parseFloat), material.emissiveColor = math_color/* Color3.FromArray */.Wo.FromArray(color);else if ("ns" === key && material) material.specularPower = parseFloat(value);else if ("d" === key && material) material.alpha = parseFloat(value);else if ("map_ka" === key && material) material.ambientTexture = MTLFileLoader._GetTexture(rootUrl, value, scene);else if ("map_kd" === key && material) material.diffuseTexture = MTLFileLoader._GetTexture(rootUrl, value, scene);else if ("map_ks" === key && material) material.specularTexture = MTLFileLoader._GetTexture(rootUrl, value, scene);else if ("map_ns" === key) ;else if ("map_bump" === key && material) {const values = value.split(delimiter_pattern),bumpMultiplierIndex = values.indexOf("-bm");let bumpMultiplier = null;0 <= bumpMultiplierIndex && (bumpMultiplier = values[bumpMultiplierIndex + 1], values.splice(bumpMultiplierIndex, 2)), material.bumpTexture = MTLFileLoader._GetTexture(rootUrl, values.join(" "), scene), material.bumpTexture && null !== bumpMultiplier && (material.bumpTexture.level = parseFloat(bumpMultiplier));} else if ("map_d" === key && material) material.opacityTexture = MTLFileLoader._GetTexture(rootUrl, value, scene);else if ("illum" === key) ;else ;}material && this.materials.push(material);}static _GetTexture(rootUrl, value, scene) {if (!value) return null;let url = rootUrl;if ("file:" === rootUrl) {let lastDelimiter = value.lastIndexOf("\\");-1 === lastDelimiter && (lastDelimiter = value.lastIndexOf("/")), url += -1 < lastDelimiter ? value.substr(lastDelimiter + 1) : value;} else url += value;return new Textures_texture/* Texture */.x(url, scene, !1, MTLFileLoader.INVERT_TEXTURE_Y);}}MTLFileLoader.INVERT_TEXTURE_Y = !0;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/OBJ/objLoadingOptions.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/OBJ/solidParser.js
class SolidParser {constructor(materialToUse, babylonMeshesArray, loadingOptions) {this._positions = [], this._normals = [], this._uvs = [], this._colors = [], this._meshesFromObj = [], this._indicesForBabylon = [], this._wrappedPositionForBabylon = [], this._wrappedUvsForBabylon = [], this._wrappedColorsForBabylon = [], this._wrappedNormalsForBabylon = [], this._tuplePosNorm = [], this._curPositionInIndices = 0, this._hasMeshes = !1, this._unwrappedPositionsForBabylon = [], this._unwrappedColorsForBabylon = [], this._unwrappedNormalsForBabylon = [], this._unwrappedUVForBabylon = [], this._triangles = [], this._materialNameFromObj = "", this._objMeshName = "", this._increment = 1, this._isFirstMaterial = !0, this._grayColor = new math_color/* Color4 */.HE(.5, .5, .5, 1), this._materialToUse = materialToUse, this._babylonMeshesArray = babylonMeshesArray, this._loadingOptions = loadingOptions;}_isInArray(arr, obj) {arr[obj[0]] || (arr[obj[0]] = { normals: [], idx: [] });const idx = arr[obj[0]].normals.indexOf(obj[1]);return -1 === idx ? -1 : arr[obj[0]].idx[idx];}_isInArrayUV(arr, obj) {arr[obj[0]] || (arr[obj[0]] = { normals: [], idx: [], uv: [] });const idx = arr[obj[0]].normals.indexOf(obj[1]);return 1 != idx && obj[2] === arr[obj[0]].uv[idx] ? arr[obj[0]].idx[idx] : -1;}_setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positionVectorFromOBJ, textureVectorFromOBJ, normalsVectorFromOBJ, positionColorsFromOBJ) {let _index;_index = this._loadingOptions.optimizeWithUV ? this._isInArrayUV(this._tuplePosNorm, [indicePositionFromObj, indiceNormalFromObj, indiceUvsFromObj]) : this._isInArray(this._tuplePosNorm, [indicePositionFromObj, indiceNormalFromObj]), -1 === _index ? (this._indicesForBabylon.push(this._wrappedPositionForBabylon.length), this._wrappedPositionForBabylon.push(positionVectorFromOBJ), this._wrappedUvsForBabylon.push(textureVectorFromOBJ), this._wrappedNormalsForBabylon.push(normalsVectorFromOBJ), positionColorsFromOBJ !== void 0 && this._wrappedColorsForBabylon.push(positionColorsFromOBJ), this._tuplePosNorm[indicePositionFromObj].normals.push(indiceNormalFromObj), this._tuplePosNorm[indicePositionFromObj].idx.push(this._curPositionInIndices++), this._loadingOptions.optimizeWithUV && this._tuplePosNorm[indicePositionFromObj].uv.push(indiceUvsFromObj)) : this._indicesForBabylon.push(_index);}_unwrapData() {for (let l = 0; l < this._wrappedPositionForBabylon.length; l++) this._unwrappedPositionsForBabylon.push(this._wrappedPositionForBabylon[l].x, this._wrappedPositionForBabylon[l].y, this._wrappedPositionForBabylon[l].z), this._unwrappedNormalsForBabylon.push(this._wrappedNormalsForBabylon[l].x, this._wrappedNormalsForBabylon[l].y, this._wrappedNormalsForBabylon[l].z), this._unwrappedUVForBabylon.push(this._wrappedUvsForBabylon[l].x, this._wrappedUvsForBabylon[l].y), this._loadingOptions.importVertexColors && this._unwrappedColorsForBabylon.push(this._wrappedColorsForBabylon[l].r, this._wrappedColorsForBabylon[l].g, this._wrappedColorsForBabylon[l].b, this._wrappedColorsForBabylon[l].a);this._wrappedPositionForBabylon.length = 0, this._wrappedNormalsForBabylon.length = 0, this._wrappedUvsForBabylon.length = 0, this._wrappedColorsForBabylon.length = 0, this._tuplePosNorm.length = 0, this._curPositionInIndices = 0;}_getTriangles(faces, v) {for (let faceIndex = v; faceIndex < faces.length - 1; faceIndex++) this._triangles.push(faces[0], faces[faceIndex], faces[faceIndex + 1]);}_setDataForCurrentFaceWithPattern1(face, v) {this._getTriangles(face, v);for (let k = 0; k < this._triangles.length; k++) {const indicePositionFromObj = parseInt(this._triangles[k]) - 1;this._setData(indicePositionFromObj, 0, 0, this._positions[indicePositionFromObj], math_vector/* Vector2.Zero */.FM.Zero(), math_vector/* Vector3.Up */.P.Up(), this._loadingOptions.importVertexColors ? this._colors[indicePositionFromObj] : void 0);}this._triangles.length = 0;}_setDataForCurrentFaceWithPattern2(face, v) {this._getTriangles(face, v);for (let k = 0; k < this._triangles.length; k++) {const point = this._triangles[k].split("/"),indicePositionFromObj = parseInt(point[0]) - 1,indiceUvsFromObj = parseInt(point[1]) - 1;this._setData(indicePositionFromObj, indiceUvsFromObj, 0, this._positions[indicePositionFromObj], this._uvs[indiceUvsFromObj], math_vector/* Vector3.Up */.P.Up(), this._loadingOptions.importVertexColors ? this._colors[indicePositionFromObj] : void 0);}this._triangles.length = 0;}_setDataForCurrentFaceWithPattern3(face, v) {this._getTriangles(face, v);for (let k = 0; k < this._triangles.length; k++) {const point = this._triangles[k].split("/"),indicePositionFromObj = parseInt(point[0]) - 1,indiceUvsFromObj = parseInt(point[1]) - 1,indiceNormalFromObj = parseInt(point[2]) - 1;this._setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, this._positions[indicePositionFromObj], this._uvs[indiceUvsFromObj], this._normals[indiceNormalFromObj]);}this._triangles.length = 0;}_setDataForCurrentFaceWithPattern4(face, v) {this._getTriangles(face, v);for (let k = 0; k < this._triangles.length; k++) {const point = this._triangles[k].split("//"),indicePositionFromObj = parseInt(point[0]) - 1,indiceNormalFromObj = parseInt(point[1]) - 1;this._setData(indicePositionFromObj, 1, indiceNormalFromObj, this._positions[indicePositionFromObj], math_vector/* Vector2.Zero */.FM.Zero(), this._normals[indiceNormalFromObj], this._loadingOptions.importVertexColors ? this._colors[indicePositionFromObj] : void 0);}this._triangles.length = 0;}_setDataForCurrentFaceWithPattern5(face, v) {this._getTriangles(face, v);for (let k = 0; k < this._triangles.length; k++) {const point = this._triangles[k].split("/"),indicePositionFromObj = this._positions.length + parseInt(point[0]),indiceUvsFromObj = this._uvs.length + parseInt(point[1]),indiceNormalFromObj = this._normals.length + parseInt(point[2]);this._setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, this._positions[indicePositionFromObj], this._uvs[indiceUvsFromObj], this._normals[indiceNormalFromObj], this._loadingOptions.importVertexColors ? this._colors[indicePositionFromObj] : void 0);}this._triangles.length = 0;}_addPreviousObjMesh() {0 < this._meshesFromObj.length && (this._handledMesh = this._meshesFromObj[this._meshesFromObj.length - 1], this._unwrapData(), this._indicesForBabylon.reverse(), this._handledMesh.indices = this._indicesForBabylon.slice(), this._handledMesh.positions = this._unwrappedPositionsForBabylon.slice(), this._handledMesh.normals = this._unwrappedNormalsForBabylon.slice(), this._handledMesh.uvs = this._unwrappedUVForBabylon.slice(), this._loadingOptions.importVertexColors && (this._handledMesh.colors = this._unwrappedColorsForBabylon.slice()), this._indicesForBabylon.length = 0, this._unwrappedPositionsForBabylon.length = 0, this._unwrappedColorsForBabylon.length = 0, this._unwrappedNormalsForBabylon.length = 0, this._unwrappedUVForBabylon.length = 0);}_optimizeNormals(mesh) {const positions = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),normals = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind),mapVertices = {};if (positions && normals) {for (let i = 0; i < positions.length / 3; i++) {const x = positions[3 * i + 0],y = positions[3 * i + 1],z = positions[3 * i + 2],key = x + "_" + y + "_" + z;let lst = mapVertices[key];lst || (lst = [], mapVertices[key] = lst), lst.push(i);}const normal = new math_vector/* Vector3 */.P();for (const key in mapVertices) {const lst = mapVertices[key];if (2 > lst.length) continue;const v0Idx = lst[0];for (let i = 1; i < lst.length; ++i) {const vIdx = lst[i];normals[3 * v0Idx + 0] += normals[3 * vIdx + 0], normals[3 * v0Idx + 1] += normals[3 * vIdx + 1], normals[3 * v0Idx + 2] += normals[3 * vIdx + 2];}normal.copyFromFloats(normals[3 * v0Idx + 0], normals[3 * v0Idx + 1], normals[3 * v0Idx + 2]), normal.normalize();for (let i = 0; i < lst.length; ++i) {const vIdx = lst[i];normals[3 * vIdx + 0] = normal.x, normals[3 * vIdx + 1] = normal.y, normals[3 * vIdx + 2] = normal.z;}}mesh.setVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, normals);}}parse(meshesNames, data, scene, assetContainer, onFileToLoadFound) {const lines = data.split("\n");for (let i = 0; i < lines.length; i++) {const line = lines[i].trim().replace(/\s\s/g, " ");let result;if (0 === line.length || "#" === line.charAt(0)) continue;else if (SolidParser.VertexPattern.test(line)) {if (result = line.match(/[^ ]+/g), this._positions.push(new math_vector/* Vector3 */.P(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]))), this._loadingOptions.importVertexColors) if (7 <= result.length) {const r = parseFloat(result[4]),g = parseFloat(result[5]),b = parseFloat(result[6]);this._colors.push(new math_color/* Color4 */.HE(1 < r ? r / 255 : r, 1 < g ? g / 255 : g, 1 < b ? b / 255 : b, 7 === result.length || void 0 === result[7] ? 1 : parseFloat(result[7])));} else this._colors.push(this._grayColor);} else if (null !== (result = SolidParser.NormalPattern.exec(line))) this._normals.push(new math_vector/* Vector3 */.P(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3])));else if (null !== (result = SolidParser.UVPattern.exec(line))) this._uvs.push(new math_vector/* Vector2 */.FM(parseFloat(result[1]) * this._loadingOptions.UVScaling.x, parseFloat(result[2]) * this._loadingOptions.UVScaling.y));else if (null !== (result = SolidParser.FacePattern3.exec(line))) this._setDataForCurrentFaceWithPattern3(result[1].trim().split(" "), 1);else if (null !== (result = SolidParser.FacePattern4.exec(line))) this._setDataForCurrentFaceWithPattern4(result[1].trim().split(" "), 1);else if (null !== (result = SolidParser.FacePattern5.exec(line))) this._setDataForCurrentFaceWithPattern5(result[1].trim().split(" "), 1);else if (null !== (result = SolidParser.FacePattern2.exec(line))) this._setDataForCurrentFaceWithPattern2(result[1].trim().split(" "), 1);else if (null !== (result = SolidParser.FacePattern1.exec(line))) this._setDataForCurrentFaceWithPattern1(result[1].trim().split(" "), 1);else if (SolidParser.GroupDescriptor.test(line) || SolidParser.ObjectDescriptor.test(line)) {const objMesh = { name: line.substring(2).trim(), indices: void 0, positions: void 0, normals: void 0, uvs: void 0, colors: void 0, materialName: this._materialNameFromObj };this._addPreviousObjMesh(), this._meshesFromObj.push(objMesh), this._hasMeshes = !0, this._isFirstMaterial = !0, this._increment = 1;} else if (SolidParser.UseMtlDescriptor.test(line)) {if (this._materialNameFromObj = line.substring(7).trim(), !this._isFirstMaterial || !this._hasMeshes) {this._addPreviousObjMesh();const objMesh = { name: (this._objMeshName || "mesh") + "_mm" + this._increment.toString(), indices: void 0, positions: void 0, normals: void 0, uvs: void 0, colors: void 0, materialName: this._materialNameFromObj };this._increment++, this._meshesFromObj.push(objMesh), this._hasMeshes = !0;}this._hasMeshes && this._isFirstMaterial && (this._meshesFromObj[this._meshesFromObj.length - 1].materialName = this._materialNameFromObj, this._isFirstMaterial = !1);} else if (SolidParser.MtlLibGroupDescriptor.test(line)) onFileToLoadFound(line.substring(7).trim());else if (SolidParser.SmoothDescriptor.test(line)) ;else console.log("Unhandled expression at line : " + line);}if (this._hasMeshes && (this._handledMesh = this._meshesFromObj[this._meshesFromObj.length - 1], this._indicesForBabylon.reverse(), this._unwrapData(), this._handledMesh.indices = this._indicesForBabylon, this._handledMesh.positions = this._unwrappedPositionsForBabylon, this._handledMesh.normals = this._unwrappedNormalsForBabylon, this._handledMesh.uvs = this._unwrappedUVForBabylon, this._loadingOptions.importVertexColors && (this._handledMesh.colors = this._unwrappedColorsForBabylon)), !this._hasMeshes) {let newMaterial = null;if (this._indicesForBabylon.length) this._indicesForBabylon.reverse(), this._unwrapData();else {for (const pos of this._positions) this._unwrappedPositionsForBabylon.push(pos.x, pos.y, pos.z);if (this._normals.length) for (const normal of this._normals) this._unwrappedNormalsForBabylon.push(normal.x, normal.y, normal.z);if (this._uvs.length) for (const uv of this._uvs) this._unwrappedUVForBabylon.push(uv.x, uv.y);if (this._colors.length) for (const color of this._colors) this._unwrappedColorsForBabylon.push(color.r, color.g, color.b, color.a);this._materialNameFromObj || (newMaterial = new Materials_standardMaterial/* StandardMaterial */.K(geometry/* Geometry.RandomId */.Z.RandomId(), scene), newMaterial.pointsCloud = !0, this._materialNameFromObj = newMaterial.name, !this._normals.length && (newMaterial.disableLighting = !0, newMaterial.emissiveColor = math_color/* Color3.White */.Wo.White()));}this._meshesFromObj.push({ name: geometry/* Geometry.RandomId */.Z.RandomId(), indices: this._indicesForBabylon, positions: this._unwrappedPositionsForBabylon, colors: this._unwrappedColorsForBabylon, normals: this._unwrappedNormalsForBabylon, uvs: this._unwrappedUVForBabylon, materialName: this._materialNameFromObj, directMaterial: newMaterial });}for (let j = 0; j < this._meshesFromObj.length; j++) {var _this$_handledMesh$po;if (meshesNames && this._meshesFromObj[j].name) if (meshesNames instanceof Array) {if (-1 === meshesNames.indexOf(this._meshesFromObj[j].name)) continue;} else if (this._meshesFromObj[j].name !== meshesNames) continue;this._handledMesh = this._meshesFromObj[j], scene._blockEntityCollection = !!assetContainer;const babylonMesh = new Meshes_mesh/* Mesh */.Kj(this._meshesFromObj[j].name, scene);if (babylonMesh._parentContainer = assetContainer, scene._blockEntityCollection = !1, this._materialToUse.push(this._meshesFromObj[j].materialName), 0 === ((_this$_handledMesh$po = this._handledMesh.positions) === null || _this$_handledMesh$po === void 0 ? void 0 : _this$_handledMesh$po.length)) {this._babylonMeshesArray.push(babylonMesh);continue;}const vertexData = new mesh_vertexData/* VertexData */.x();if (vertexData.uvs = this._handledMesh.uvs, vertexData.indices = this._handledMesh.indices, vertexData.positions = this._handledMesh.positions, this._loadingOptions.computeNormals) {const normals = [];mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(this._handledMesh.positions, this._handledMesh.indices, normals), vertexData.normals = normals;} else vertexData.normals = this._handledMesh.normals;this._loadingOptions.importVertexColors && (vertexData.colors = this._handledMesh.colors), vertexData.applyToMesh(babylonMesh), this._loadingOptions.invertY && (babylonMesh.scaling.y *= -1), this._loadingOptions.optimizeNormals && this._optimizeNormals(babylonMesh), this._babylonMeshesArray.push(babylonMesh), this._handledMesh.directMaterial && (babylonMesh.material = this._handledMesh.directMaterial);}}}SolidParser.ObjectDescriptor = /^o/, SolidParser.GroupDescriptor = /^g/, SolidParser.MtlLibGroupDescriptor = /^mtllib /, SolidParser.UseMtlDescriptor = /^usemtl /, SolidParser.SmoothDescriptor = /^s /, SolidParser.VertexPattern = /v(\s+[\d|.|+|\-|e|E]+){3,7}/, SolidParser.NormalPattern = /vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/, SolidParser.UVPattern = /vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/, SolidParser.FacePattern1 = /f\s+(([\d]{1,}[\s]?){3,})+/, SolidParser.FacePattern2 = /f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/, SolidParser.FacePattern3 = /f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/, SolidParser.FacePattern4 = /f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/, SolidParser.FacePattern5 = /f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/OBJ/objFileLoader.js
class OBJFileLoader {constructor(loadingOptions) {this.name = "obj", this.extensions = ".obj", this._assetContainer = null, this._loadingOptions = loadingOptions || OBJFileLoader._DefaultLoadingOptions;}static get INVERT_TEXTURE_Y() {return MTLFileLoader.INVERT_TEXTURE_Y;}static set INVERT_TEXTURE_Y(value) {MTLFileLoader.INVERT_TEXTURE_Y = value;}static get _DefaultLoadingOptions() {return { computeNormals: OBJFileLoader.COMPUTE_NORMALS, optimizeNormals: OBJFileLoader.OPTIMIZE_NORMALS, importVertexColors: OBJFileLoader.IMPORT_VERTEX_COLORS, invertY: OBJFileLoader.INVERT_Y, invertTextureY: OBJFileLoader.INVERT_TEXTURE_Y, UVScaling: OBJFileLoader.UV_SCALING, materialLoadingFailsSilently: OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY, optimizeWithUV: OBJFileLoader.OPTIMIZE_WITH_UV, skipMaterials: OBJFileLoader.SKIP_MATERIALS };}_loadMTL(url, rootUrl, onSuccess, onFailure) {const pathOfFile = rootUrl + url;tools/* Tools.LoadFile */.w1.LoadFile(pathOfFile, onSuccess, void 0, void 0, !1, (request, exception) => {onFailure(pathOfFile, exception);});}createPlugin() {return new OBJFileLoader(OBJFileLoader._DefaultLoadingOptions);}canDirectLoad() {return !1;}importMeshAsync(meshesNames, scene, data, rootUrl) {return this._parseSolid(meshesNames, scene, data, rootUrl).then((meshes) => ({ meshes: meshes, particleSystems: [], skeletons: [], animationGroups: [], transformNodes: [], geometries: [], lights: [] }));}loadAsync(scene, data, rootUrl) {return this.importMeshAsync(null, scene, data, rootUrl).then(() => {});}loadAssetContainerAsync(scene, data, rootUrl) {const container = new assetContainer/* AssetContainer */.TJ(scene);return this._assetContainer = container, this.importMeshAsync(null, scene, data, rootUrl).then((result) => (result.meshes.forEach((mesh) => container.meshes.push(mesh)), result.meshes.forEach((mesh) => {const material = mesh.material;if (material && -1 == container.materials.indexOf(material)) {container.materials.push(material);const textures = material.getActiveTextures();textures.forEach((t) => {-1 == container.textures.indexOf(t) && container.textures.push(t);});}}), this._assetContainer = null, container)).catch((ex) => {throw this._assetContainer = null, ex;});}_parseSolid(meshesNames, scene, data, rootUrl) {let fileToLoad = "";const materialsFromMTLFile = new MTLFileLoader(),materialToUse = [],babylonMeshesArray = [],solidParser = new SolidParser(materialToUse, babylonMeshesArray, this._loadingOptions);solidParser.parse(meshesNames, data, scene, this._assetContainer, (fileName) => {fileToLoad = fileName;});const mtlPromises = [];return "" === fileToLoad || this._loadingOptions.skipMaterials || mtlPromises.push(new Promise((resolve, reject) => {this._loadMTL(fileToLoad, rootUrl, (dataLoaded) => {try {materialsFromMTLFile.parseMTL(scene, dataLoaded, rootUrl, this._assetContainer);for (let startIndex, n = 0; n < materialsFromMTLFile.materials.length; n++) {startIndex = 0;const _indices = [];let _index;for (; -1 < (_index = materialToUse.indexOf(materialsFromMTLFile.materials[n].name, startIndex));) _indices.push(_index), startIndex = _index + 1;if (-1 === _index && 0 === _indices.length) materialsFromMTLFile.materials[n].dispose();else for (let o = 0; o < _indices.length; o++) {const mesh = babylonMeshesArray[_indices[o]],material = materialsFromMTLFile.materials[n];mesh.material = material, mesh.getTotalIndices() || (material.pointsCloud = !0);}}resolve();} catch (e) {tools/* Tools.Warn */.w1.Warn(`Error processing MTL file: '${fileToLoad}'`), this._loadingOptions.materialLoadingFailsSilently ? resolve() : reject(e);}}, (pathOfFile, exception) => {tools/* Tools.Warn */.w1.Warn(`Error downloading MTL file: '${fileToLoad}'`), this._loadingOptions.materialLoadingFailsSilently ? resolve() : reject(exception);});})), Promise.all(mtlPromises).then(() => babylonMeshesArray);}}OBJFileLoader.OPTIMIZE_WITH_UV = !0, OBJFileLoader.INVERT_Y = !1, OBJFileLoader.IMPORT_VERTEX_COLORS = !1, OBJFileLoader.COMPUTE_NORMALS = !1, OBJFileLoader.OPTIMIZE_NORMALS = !1, OBJFileLoader.UV_SCALING = new math_vector/* Vector2 */.FM(1, 1), OBJFileLoader.SKIP_MATERIALS = !1, OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY = !0, sceneLoader/* SceneLoader */.n && sceneLoader/* SceneLoader.RegisterPlugin */.n.RegisterPlugin(new OBJFileLoader());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/OBJ/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/STL/stlFileLoader.js
class STLFileLoader {constructor() {this.solidPattern = /solid (\S*)([\S\s]*?)endsolid[ ]*(\S*)/g, this.facetsPattern = /facet([\s\S]*?)endfacet/g, this.normalPattern = /normal[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g, this.vertexPattern = /vertex[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g, this.name = "stl", this.extensions = { ".stl": { isBinary: !0 } };}importMesh(meshesNames, scene, data, rootUrl, meshes) {let matches;if ("string" != typeof data) {if (this._isBinary(data)) {const babylonMesh = new Meshes_mesh/* Mesh */.Kj("stlmesh", scene);return this._parseBinary(babylonMesh, data, scene.useRightHandedSystem), meshes && meshes.push(babylonMesh), !0;}const array_buffer = new Uint8Array(data);let str = "";for (let i = 0; i < data.byteLength; i++) str += String.fromCharCode(array_buffer[i]);data = str;}for (; matches = this.solidPattern.exec(data);) {let meshName = matches[1];const meshNameFromEnd = matches[3];if (meshName != meshNameFromEnd) return tools/* Tools.Error */.w1.Error("Error in STL, solid name != endsolid name"), !1;if (meshesNames && meshName) if (meshesNames instanceof Array) {if (!meshesNames.indexOf(meshName)) continue;} else if (meshName !== meshesNames) continue;meshName = meshName || "stlmesh";const babylonMesh = new Meshes_mesh/* Mesh */.Kj(meshName, scene);this._parseASCII(babylonMesh, matches[2], scene.useRightHandedSystem), meshes && meshes.push(babylonMesh);}return !0;}load(scene, data, rootUrl) {const result = this.importMesh(null, scene, data, rootUrl, null);return result;}loadAssetContainer(scene, data, rootUrl) {const container = new assetContainer/* AssetContainer */.TJ(scene);return scene._blockEntityCollection = !0, this.importMesh(null, scene, data, rootUrl, container.meshes), scene._blockEntityCollection = !1, container;}_isBinary(data) {const reader = new DataView(data);if (80 >= reader.byteLength) return !1;const nFaces = reader.getUint32(80, !0);if (84 + nFaces * 50 === reader.byteLength) return !0;const fileLength = reader.byteLength;for (let index = 0; index < fileLength; index++) if (127 < reader.getUint8(index)) return !0;return !1;}_parseBinary(mesh, data, rightHanded) {const reader = new DataView(data),faces = reader.getUint32(80, !0);let offset = 0;const positions = new Float32Array(3 * (3 * faces)),normals = new Float32Array(3 * (3 * faces)),indices = new Uint32Array(3 * faces);let indicesCount = 0;for (let face = 0; face < faces; face++) {const start = 84 + face * 50,normalX = reader.getFloat32(start, !0),normalY = reader.getFloat32(start + 4, !0),normalZ = reader.getFloat32(start + 8, !0);for (let i = 1; 3 >= i; i++) {const vertexstart = start + 12 * i;positions[offset] = reader.getFloat32(vertexstart, !0), normals[offset] = normalX, STLFileLoader.DO_NOT_ALTER_FILE_COORDINATES ? (positions[offset + 1] = reader.getFloat32(vertexstart + 4, !0), positions[offset + 2] = reader.getFloat32(vertexstart + 8, !0), normals[offset + 1] = normalY, normals[offset + 2] = normalZ) : (positions[offset + 2] = reader.getFloat32(vertexstart + 4, !0), positions[offset + 1] = reader.getFloat32(vertexstart + 8, !0), normals[offset + 2] = normalY, normals[offset + 1] = normalZ), offset += 3;}rightHanded ? (indices[indicesCount] = indicesCount, indices[indicesCount + 1] = indicesCount + 2, indices[indicesCount + 2] = indicesCount + 1, indicesCount += 3) : (indices[indicesCount] = indicesCount++, indices[indicesCount] = indicesCount++, indices[indicesCount] = indicesCount++);}mesh.setVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, positions), mesh.setVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, normals), mesh.setIndices(indices), mesh.computeWorldMatrix(!0);}_parseASCII(mesh, solidData, rightHanded) {const positions = [],normals = [],indices = [];let matches,indicesCount = 0;for (; matches = this.facetsPattern.exec(solidData);) {const facet = matches[1],normalMatches = this.normalPattern.exec(facet);if (this.normalPattern.lastIndex = 0, !normalMatches) continue;const normal = [+normalMatches[1], +normalMatches[5], +normalMatches[3]];for (let vertexMatch; vertexMatch = this.vertexPattern.exec(facet);) STLFileLoader.DO_NOT_ALTER_FILE_COORDINATES ? (positions.push(+vertexMatch[1], +vertexMatch[3], +vertexMatch[5]), normals.push(normal[0], normal[2], normal[1])) : (positions.push(+vertexMatch[1], +vertexMatch[5], +vertexMatch[3]), normals.push(normal[0], normal[1], normal[2]));rightHanded ? (indices.push(indicesCount, indicesCount + 2, indicesCount + 1), indicesCount += 3) : indices.push(indicesCount++, indicesCount++, indicesCount++), this.vertexPattern.lastIndex = 0;}this.facetsPattern.lastIndex = 0, mesh.setVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, positions), mesh.setVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, normals), mesh.setIndices(indices), mesh.computeWorldMatrix(!0);}}STLFileLoader.DO_NOT_ALTER_FILE_COORDINATES = !1, sceneLoader/* SceneLoader */.n && sceneLoader/* SceneLoader.RegisterPlugin */.n.RegisterPlugin(new STLFileLoader());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/STL/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/loaders/index.js

;// CONCATENATED MODULE: ./src/mod_babylon.js







window.BABYLON = core;

const {
  FRONTSIDE, BACKSIDE, DOUBLESIDE } =
core.Mesh;

const {
  PERSPECTIVE_CAMERA,
  ORTHOGRAPHIC_CAMERA } =
core.Camera;

const {
  FOGMODE_NONE,
  FOGMODE_EXP,
  FOGMODE_EXP2,
  FOGMODE_LINEAR } =
core.Scene;

const {
  WORLD: WORLDSPACE,
  LOCAL: LOCALSPACE,
  BONE: BONESPACE } =
core.Space;

core.Texture.prototype.crop = function (x = 0, y = 0, w = 0, h = 0) {
  const { width, height } = this.getBaseSize();
  if (!w) w = width - x;
  if (!h) h = height - y;
  if (main/* default.EDGE_FIX */.Z.EDGE_FIX) {x += main/* default.EDGE_FIX */.Z.EDGE_FIX;y += main/* default.EDGE_FIX */.Z.EDGE_FIX;w -= main/* default.EDGE_FIX */.Z.EDGE_FIX * 2;h -= main/* default.EDGE_FIX */.Z.EDGE_FIX * 2;}
  this.uScale = w / width;
  this.vScale = h / height;
  this.uOffset = x / width;
  this.vOffset = 1 - y / height - this.vScale;
};

const _mixin_xyz = {
  x: {
    get() {return this.position ? this.position.x : undefined;},
    set(v) {if (this.position) {this.position.x = v;}} },

  y: {
    get() {return this.position ? -this.position.z : undefined;},
    set(v) {if (this.position) {this.position.z = -v;}} },

  z: {
    get() {return this.position ? this.position.y : undefined;},
    set(v) {if (this.position) {this.position.y = v;}} } };


const _mixin_angles = {
  pitch: {
    get() {return this.rotation ? -(0,util.radtodeg)(this.rotation.x) : undefined;},
    set(v) {if (this.rotation) {this.rotation.x = -(0,util.degtorad)(v);}} },

  yaw: {
    get() {return this.rotation ? -(0,util.radtodeg)(this.rotation.y) : undefined;},
    set(v) {if (this.rotation) {this.rotation.y = -(0,util.degtorad)(v);}} },

  roll: {
    get() {return this.rotation ? -(0,util.radtodeg)(this.rotation.z) : undefined;},
    set(v) {if (this.rotation) {this.rotation.z = -(0,util.degtorad)(v);}} } };


Object.defineProperties(core.Node.prototype, _mixin_xyz);
Object.defineProperties(core.Node.prototype, _mixin_angles);
Object.defineProperties(core.Sprite.prototype, _mixin_xyz);

Object.defineProperties(core.Vector3.prototype, {
  $x: {
    get() {return this.x;},
    set(v) {this.x = v;} },

  $y: {
    get() {return -this.z;},
    set(v) {this.z = -v;} },

  $z: {
    get() {return this.y;},
    set(v) {this.y = v;} } });



// mesh orientation fix
const _shouldConvertRHS = core.Mesh.prototype._shouldConvertRHS;
core.Mesh.prototype._shouldConvertRHS = function () {
  if (this.absoluteScaling.x * this.absoluteScaling.y * this.absoluteScaling.z < 0) {
    return !_shouldConvertRHS.apply(this, arguments);
  }
  return _shouldConvertRHS.apply(this, arguments);
};

// mesh sorting

Object.defineProperty(core.Mesh.prototype, 'order', {
  get() {return this._order;},
  set(v) {this._order = v;this._scene.sortMeshes();} });

const meshSorter = (m1, m2) => (m1._order | 0) - (m2._order | 0);
core.Scene.prototype.sortMeshes = function () {
  this.meshes.sort(meshSorter);
};
const _addMesh = core.Scene.prototype.addMesh;
core.Scene.prototype.addMesh = function (mesh) {
  _addMesh.apply(this, arguments);
  if (typeof mesh._order === 'number') {
    this.sortMeshes();
  }
};
const _removeMesh = core.Scene.prototype.removeMesh;
core.Scene.prototype.removeMesh = function (mesh) {
  _removeMesh.apply(this, arguments);
  this.sortMeshes();
};

// color
core.Color3.prototype.toNumber = core.Color4.prototype.toNumber = function () {return this.r * 255 << 16 | this.g * 255 << 8 | this.b * 255;};

// hack babylon
function setupBabylonMods() {
  hackShaders();
};

core.StandardMaterial.prototype._shouldTurnAlphaTestOn = function (mesh) {
  return this.needAlphaTesting();
};

//dispose
/*
const _dispose = Mesh.prototype.dispose;
Mesh.prototype.dispose = function(){
	_dispose.apply(this,arguments);
	for(const light of this._scene.lights){
		if(light.mv3d_affectedMeshes){
			const index = light.mv3d_affectedMeshes.indexOf(this);
			if(index>=0){
				light.mv3d_affectedMeshes.splice(index,1);
			}
		}
	}
}
*/

core.Mesh.prototype.mv3d_o_dispose = core.Mesh.prototype.dispose;
core.Material.prototype.mv3d_o_dispose = core.Material.prototype.dispose;
core.Mesh.prototype.dispose = core.Material.prototype.dispose = function () {
  if (this.mv3d_noDispose) return;
  this.mv3d_o_dispose.apply(this, arguments);
};
core.Mesh.prototype.mv3d_dispose = core.Material.prototype.mv3d_dispose = function () {
  delete this.mv3d_noDispose;
  this.mv3d_o_dispose.apply(this, arguments);
};

core.Light.prototype.mv3d_updateSpecularFromDiffuse = function () {
  if (main/* default.SPECULAR_MODE */.Z.SPECULAR_MODE === main/* default.enumSpecularMode.SAME_AS_DIFFUSE */.Z.enumSpecularMode.SAME_AS_DIFFUSE) {
    this.specular.copyFrom(this.diffuse);
  } else if (main/* default.SPECULAR_MODE */.Z.SPECULAR_MODE === main/* default.enumSpecularMode.AVERAGE_DIFFUSE */.Z.enumSpecularMode.AVERAGE_DIFFUSE) {
    const average = (this.diffuse.r + this.diffuse.g + this.diffuse.b) / 3;
    this.specular.set(average, average, average);
  } else if (main/* default.SPECULAR_MODE */.Z.SPECULAR_MODE === main/* default.enumSpecularMode.WHITE */.Z.enumSpecularMode.WHITE) {
    this.specular.set(1, 1, 1);
  }
  // limit specular intensity
  if (this.intensity > 1) {
    const limiter = 1 / this.intensity;
    this.specular.r *= limiter;
    this.specular.g *= limiter;
    this.specular.b *= limiter;
  }
};

core.Light.prototype._mv3d_original_canAffectMesh = core.Light.prototype.canAffectMesh;
core.Light.prototype.canAffectMesh = function (mesh) {
  const _returnValue = core.Light.prototype._mv3d_original_canAffectMesh.apply(this, arguments);
  if (!_returnValue) return false;

  if (mesh.mv3d_lightInclusionList) {
    const index = mesh.mv3d_lightInclusionList.indexOf(this);
    if (index < 0) return false;
  }

  return true;
};

/*
const _resyncLightSources = AbstractMesh.prototype._resyncLightSources;
AbstractMesh.prototype._resyncLightSources = function(){
	_resyncLightSources.apply(this,arguments);

	if(this._lightSources.length>mv3d.LIGHT_LIMIT){
		const bbox = this.getBoundingInfo().boundingBox;

		for(const light of this._lightSources){
			if(light instanceof DirectionalLight) continue;

			const pos = light.getAbsolutePosition();
			if(!pos) continue;

			const overlap = overlapSphereBox(pos,light.range,bbox);
			light.mv3d_overlap = overlap;

		}

		while(this._lightSources.length>mv3d.LIGHT_LIMIT){
			const {m:min,i:index} = this._lightSources.reduce(({m,i},{mv3d_overlap:overlap},index)=>overlap<m?{m:overlap,i:index}:{m,i},{m:Infinity,i:-1});
			if(!(index>=0)){ break; }
			this._lightSources.splice(index,1);
		}

		//this._markSubMeshesAsLightDirty();

	}
}
*/


// fix weird problem with deepCopy.
// for some reason, the array prototype has a property named "Symbol(Symbol.unscopables)_3.4rwb8et877" which causes problems.
/*
const _getOwnPropertyNames = Object.getOwnPropertyNames;
Object.getOwnPropertyNames=obj=>_getOwnPropertyNames(obj).filter(name=>!name.startsWith('Symbol(Symbol.unscopables)'))
*/
// prevent a bunch of warnings being printed when copying arrays
const _deepCopy = core.DeepCopier.DeepCopy;
core.DeepCopier.DeepCopy = function (source, destination, doNotCopyList, mustCopyList) {
  const _getOwnPropertyNames = Object.getOwnPropertyNames;
  Object.getOwnPropertyNames = (obj) => obj === Array.prototype ? [] : _getOwnPropertyNames(obj);
  _deepCopy.apply(this, arguments);
  Object.getOwnPropertyNames = _getOwnPropertyNames;

};

/***/ }),

/***/ "./src/model.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "BM": () => (/* binding */ MeshGroup),
/* harmony export */   "Hn": () => (/* binding */ Model),
/* harmony export */   "gn": () => (/* binding */ withMesh)
/* harmony export */ });
/* harmony import */ var _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/index.js");
/* harmony import */ var _characters_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/characters.js");
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/util.js");
const mz3d = window.mz3d;




const { BILLBOARDMODE_X, BILLBOARDMODE_Y, BILLBOARDMODE_Z, BILLBOARDMODE_ALL, BILLBOARDMODE_NONE } = BABYLON.Mesh;

const modelInstanceCache = {};
mz3d.modelInstanceCache = modelInstanceCache;
const assetContainerCache = {};
mz3d.assetContainerCache = assetContainerCache;

const orphanModelList = [];
mz3d.orphanModelList = orphanModelList;

const modelList = [];
mz3d.modelList = modelList;

mz3d.clearModelCache = function () {
  for (const key in modelInstanceCache) {
    const mesh = modelInstanceCache[key];
    delete modelInstanceCache[key];

    if (mesh.cloneMeshMap) for (const clone of Object.values(mesh.cloneMeshMap)) {var _clone$mv3d_disposeCl;
      if (!clone) continue;
      clone.dispose();
      (_clone$mv3d_disposeCl = clone.mv3d_disposeClonedMesh) === null || _clone$mv3d_disposeCl === void 0 ? void 0 : _clone$mv3d_disposeCl.call(clone);
    }

    mesh.dispose(false, true);
  }
  for (const key in assetContainerCache) {
    const container = assetContainerCache[key];
    delete assetContainerCache[key];
    container.dispose();
  }
};

mz3d._model_textures_loaded = 0;
mz3d._model_textures_loaded_total = 0;

class Model extends _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.TransformNode {
  constructor(opts = {}) {
    super('model', mz3d.scene);
    this.rotNode = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.TransformNode('rot Node', mz3d.scene);
    this.rotNode.parent = this;
    this.mesh = null;
    this.textureLoaded = false;
    const { orphan = true } = opts;
    if (orphan) {orphanModelList.push(this);}
    modelList.push(this);
  }

  get isObj() {var _this$mesh, _this$mesh$mv3d_impor;
    return Boolean((_this$mesh = this.mesh) === null || _this$mesh === void 0 ? void 0 : (_this$mesh$mv3d_impor = _this$mesh.mv3d_importedModelData) === null || _this$mesh$mv3d_impor === void 0 ? void 0 : _this$mesh$mv3d_impor.isObj);
  }
  get isGltf() {var _this$mesh2, _this$mesh2$mv3d_impo;
    return Boolean((_this$mesh2 = this.mesh) === null || _this$mesh2 === void 0 ? void 0 : (_this$mesh2$mv3d_impo = _this$mesh2.mv3d_importedModelData) === null || _this$mesh2$mv3d_impo === void 0 ? void 0 : _this$mesh2$mv3d_impo.isGltf);
  }

  get meshes() {return this.mesh instanceof MeshGroup ? this.mesh.meshes : this.mesh ? [this.mesh] : [];}
  get materials() {return !this.mesh ? [] : this.mesh.mv3d_materials ? this.mesh.mv3d_materials : this.material ? [this.material] : [];}
  setupMesh() {
    if (!this.mesh || this.mesh.mv3d_isSetup) {return;}
    this.mesh.mv3d_isSetup = true;
    mz3d.callFeatures('createCharMesh', this.mesh);
    this.mesh.parent = this.rotNode;
    this.mesh.yaw = 0;
    this.mesh.pitch = 0;
    if (this.shape === mz3d.enumShapes.XCROSS) {
      this.mesh.yaw = 45;
    }
    if (this.material && !this.isComplexMesh()) {
      this.mesh.material = this.material;
    }
    if (this.character) {
      this.character.setupMesh();
    }
    if (this.order != null) {this.mesh.order = this.order;}
    this.updateCameraMode();
  }
  isComplexMesh() {
    return mz3d.isComplexShape(this.shape);
  }
  async setMaterial(src) {
    let newTexture;
    if (src === 'error') {
      newTexture = await mz3d.getErrorTexture();
    } else {
      newTexture = await mz3d.createTexture(src);
    }
    await mz3d.waitTextureLoaded(newTexture);
    this.disposeMaterial();
    this.texture = newTexture;
    this.texture.hasAlpha = true;
    //this.texture.updateSamplingMode(1);
    this.textureLoaded = true;
    this.material = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.StandardMaterial('sprite material', mz3d.scene);
    this.material.diffuseTexture = this.texture;
    this.material.alphaCutOff = mz3d.ALPHA_CUTOFF;
    this.material.ambientColor.set(1, 1, 1);
    this.material.specularColor.set(0, 0, 0);
    this.material.maxSimultaneousLights = mz3d.LIGHT_LIMIT;
    this.material.backFaceCulling = false;
    this.material.twoSidedLighting = true;
    if (!this.isComplexMesh()) {
      this.mesh.material = this.material;
    }

    let textureData = undefined;
    if (mz3d.USE_TEXTURE_DATA) {
      const dataSrc = src.replace(/\.[0-9a-z]+$/i, '.json');
      textureData = await mz3d.getDataFile(dataSrc);
    }

    const promises = [];

    if (mz3d.USE_BUMP_TEXTURE) promises.push(this.createModelTexture(src, '.bump').
    then(mz3d._applyTextureDataCallback.bump(this.material, textureData)));
    if (mz3d.USE_SPECULAR_TEXTURE) promises.push(this.createModelTexture(src, '.specular').
    then(mz3d._applyTextureDataCallback.specular(this.material, textureData)));
    if (mz3d.USE_EMISSIVE_TEXTURE) promises.push(this.createModelTexture(src, '.emissive').
    then(mz3d._applyTextureDataCallback.emissive(this.material, textureData)));
    if (mz3d.USE_AMBIENT_TEXTURE) promises.push(this.createModelTexture(src, '.ambient').
    then(mz3d._applyTextureDataCallback.ambient(this.material, textureData)));

    if (!mz3d.mapReady) {
      await Promise.all(promises);
    }
  }
  async createModelTexture(src, extension) {
    src = mz3d.insertTextureExtension(src, extension);
    const exists = await mz3d.checkFileExists(src);
    if (!exists) {
      return undefined;
    }
    const newTexture = await mz3d.createTexture(src);
    await mz3d.waitTextureLoaded(newTexture);
    return newTexture;
  }
  cropTexture(x, y, w, h) {var _this$material$bumpTe, _this$material$specul, _this$material$emissi, _this$material$ambien;
    this.texture.crop(x, y, w, h);
    (_this$material$bumpTe = this.material.bumpTexture) === null || _this$material$bumpTe === void 0 ? void 0 : _this$material$bumpTe.crop(x, y, w, h);
    (_this$material$specul = this.material.specularTexture) === null || _this$material$specul === void 0 ? void 0 : _this$material$specul.crop(x, y, w, h);
    (_this$material$emissi = this.material.emissiveTexture) === null || _this$material$emissi === void 0 ? void 0 : _this$material$emissi.crop(x, y, w, h);
    (_this$material$ambien = this.material.ambientTexture) === null || _this$material$ambien === void 0 ? void 0 : _this$material$ambien.crop(x, y, w, h);
  }
  disposeMaterial() {
    if (this.material && !this.material.mv3d_noDispose) {
      this.material.dispose();
      this.texture.dispose();
      this.material = null;
      this.texture = null;
    }
  }
  dispose(...args) {
    this.disposeMaterial();
    if (this.isComplexMesh()) {
      if (this.mesh instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.InstancedMesh) {
        super.dispose(false, false);
      } else {
        super.dispose(false, true);
      }
    } else {
      super.dispose(...args);
    }
    let index = orphanModelList.indexOf(this);
    if (index >= 0) {
      orphanModelList.splice(index, 1);
    }
    index = modelList.indexOf(this);
    if (index >= 0) {
      modelList.splice(index, 1);
    }
  }
  clearShape() {
    this.shape = null;
    this.model_key = null;
  }
  clearMesh() {
    if (!this.mesh) {return;}
    mz3d.callFeatures('destroyCharMesh', this.mesh);
    this.mesh.dispose();
  }
  setMesh(mesh) {
    /*
    if(this.mesh?.mv3d_lightInclusionList)for(const lightsource of this.mesh.mv3d_lightInclusionList){
    	const index = lightsource.includedOnlyMeshes.indexOf(this.mesh);
    	lightsource.includedOnlyMeshes.splice(index,1);
    	lightsource.includedOnlyMeshes.push(mesh);
    }
    */
    this.clearMesh();
    this.mesh = mesh;
    this.setupMesh();
  }
  setMeshForShape(shape) {
    if (this.shape === shape) {return;}
    this.clearShape();
    this.shape = shape;
    let geometry = mz3d.Meshes.SPRITE;
    const shapes = mz3d.enumShapes;
    switch (this.shape) {
      case shapes.FLAT:
        geometry = mz3d.Meshes.FLAT;
        break;
      case shapes.XCROSS:
      case shapes.CROSS:
        geometry = mz3d.Meshes.CROSS;
        break;
      case shapes['8CROSS']:
        geometry = mz3d.Meshes['8CROSS'];
        break;
      case shapes.FENCE:
      case shapes.WALL:
        geometry = mz3d.Meshes.WALL;
        break;
      case shapes.BOARD:
        geometry = mz3d.Meshes.BOARD;
        break;}

    this.setMesh(geometry.clone());
  }
  async buildMesh(parts, x = 0, y = 0, l = 0) {
    parts = mz3d.finalizeMeshParts(parts, x, y, l);
    const cacheKey = parts.cacheKey;
    if (this.shape === mz3d.enumShapes.MESH && this.model_key === cacheKey) {
      return;
    }
    this.clearShape();
    this.model_key = cacheKey;
    this.shape = mz3d.enumShapes.MESH;

    if (cacheKey in modelInstanceCache) {
      while (modelInstanceCache[cacheKey] === 'loading') {await (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.sleep)(10);}
      var mesh = modelInstanceCache[cacheKey];
      if (!mesh) return void this.clearMesh();
      //console.log("loaded cached mesh",mesh,cacheKey);
    } else {
      modelInstanceCache[cacheKey] = 'loading';
      var mesh = await mz3d.buildMesh(parts);
      modelInstanceCache[cacheKey] = mesh;
      if (!mesh) return void this.clearMesh();
      mz3d.scene.removeMesh(mesh);
      mesh._mv3d_receiveShadows = mesh.receiveShadows;
      //console.log("Creating first instance",mesh,cacheKey);
    }
    if (mz3d.MODEL_OPTIMIZATION !== mz3d.enumModelOptimization.INSTANCING) {
      mesh = getClone(mesh);
    } else {
      mesh = mesh.createInstance();
    }
    //mesh.mv3d_materialsShared=true;
    mesh.position.y = mz3d.LAYER_DIST;
    this.setMesh(mesh);
  }

  async importModel(filename, opts = {}) {
    const cacheKey = filename + `|${(+opts.alpha).toString(36)}${opts.useInstance ? '|' + '_ic'[opts.useInstance] : ''}|` + (
    opts.textures ? `{${Object.entries(opts.textures).map(([k, v]) => `${k}:{${mz3d.createTextureSymbol(v)}}`).join(',')}}` : '');

    if (this.shape === mz3d.enumShapes.MODEL && this.model_key === cacheKey) {
      return;
    }
    this.clearShape();
    this.model_key = cacheKey;
    this.shape = mz3d.enumShapes.MODEL;

    if (opts.useInstance) {
      if (modelInstanceCache[cacheKey] === 'loading') await (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.sleepUntil)(() => modelInstanceCache[cacheKey] !== 'loading');

      if (cacheKey in assetContainerCache) {
        const container = assetContainerCache[cacheKey];
        var mesh = MeshGroup.cloneAssetContainer(container);
      } else if (cacheKey in modelInstanceCache) {
        var mesh = modelInstanceCache[cacheKey];
        mesh.receiveShadows = true;
        mesh = cloneMesh(mesh, opts.useInstance);
      } else {
        modelInstanceCache[cacheKey] = 'loading';
        const container = await mz3d.loadAssetContainer(filename, opts);
        if (opts.merge) {
          var mesh = mz3d.mergeAssetContainer(container);
          modelInstanceCache[cacheKey] = mesh;
          //withMesh(mesh,mesh=>mz3d.scene.removeMesh(mesh));
          mz3d.scene.removeMesh(mesh);
          mesh = cloneMesh(mesh, opts.useInstance);
        } else {
          delete modelInstanceCache[cacheKey];
          assetContainerCache[cacheKey] = container;
          var mesh = MeshGroup.cloneAssetContainer(container);
        }
      }
      //mesh.mv3d_materialsShared=true;
    } else {
      const container = await mz3d.loadAssetContainer(filename, opts);
      var mesh = MeshGroup.fromAssetContainer(container);
    }

    if (opts.textures && !(mesh instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.InstancedMesh)) {
      for (const textureKey in opts.textures) {
        const textureConf = opts.textures[textureKey];
        let newMaterial;
        let getMaterial = async () => newMaterial ||= await mz3d.getCachedTilesetMaterialForTile(textureConf, 'texture');
        await withMesh(mesh, async (mesh) => {
          const mat = mesh.material;
          if (!mat) return;
          if (mat instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.MultiMaterial) {
            for (let i = 0; i < mat._subMaterials.length; ++i) {
              const subMat = mat._subMaterials[i];
              const matName = subMat.name;
              if (textureKey === matName || textureKey == i) {
                mat._subMaterials[i] = await getMaterial();
              }
            }
          } else {
            if (textureKey === mat.name || +textureKey === 0) {
              mesh.material = await getMaterial();
            }
          }
        });
      }
    }

    if (!opts.nodelay && this.mesh) {
      //mesh.setEnabled(false);
      //await sleep(100);
      //mesh.setEnabled(true);
    }
    mesh.mv3d_needsFlip = !opts.flip;
    this.setMesh(mesh);
    //if(!opts.flip){
    //	mesh.scaling.z=-1;
    //}
    if (this.character) {
      this.character._firstAction = true;
    }
  }
  update() {
    if (this.mesh && this.shape) {
      if (this.shape === mz3d.enumShapes.SPRITE) {
        //this.mesh.pitch = mz3d.blendCameraPitch.currentValue()-90;
        //this.mesh.yaw = mz3d.blendCameraYaw.currentValue();
      } else if (this.shape === mz3d.enumShapes.BOARD) {
        if (!this.mesh.billboardMode) {
          this.mesh.yaw = mz3d.blendCameraYaw.currentValue();
          this.mesh.yaw -= this.yaw;
        }
      }
    }

    if (this.needsProjectionFix()) {
      if (!this.projectionFixer) {
        this.projectionFixer = new ProjectionFixer();
        this.projectionFixer.attachTo(this);
      }
      this.projectionFixer.update();
    } else if (this.projectionFixer) {
      this.projectionFixer.detach();
      delete this.projectionFixer;
    }
  }
  needsProjectionFix() {
    return Boolean(this._needsProjectionFix && mz3d.cameraMode === '2D');
  }
  isReady() {var _this$mesh3;
    return Boolean((_this$mesh3 = this.mesh) === null || _this$mesh3 === void 0 ? void 0 : _this$mesh3.isReady(true, true));
    //return this.mesh&&(!this.texture||this.textureLoaded)&&(!this.isComplexMesh()||modelInstanceCache[this.model_key]&&modelInstanceCache[this.model_key]!=='loading')
    //return Boolean(this.mesh);
  }
  updateCameraMode() {
    if (this.shape === mz3d.enumShapes.SPRITE) {
      if (mz3d.cameraMode === '2D') {
        if (this.mesh.billboardMode & BILLBOARDMODE_X) {
          this.mesh.billboardMode = this.mesh.billboardMode & ~BILLBOARDMODE_X;
        }
      } else {
        if (~this.mesh.billboardMode & BILLBOARDMODE_X) {
          this.mesh.billboardMode = this.mesh.billboardMode | BILLBOARDMODE_X;
        }
      }
    }
  }}

mz3d.Model = Model;

class MeshGroup extends _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.TransformNode {
  constructor() {
    super('meshGroup', mz3d.scene);
    this.meshes = [];
  }
  addMesh(...meshes) {
    for (const mesh of meshes) {
      mesh.parent = this;
    }
    this._addToMeshList(...meshes);
  }
  _addToMeshList(...meshes) {
    for (const mesh of meshes) {
      if (mesh instanceof _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Mesh && this.meshes.indexOf(mesh) < 0) {
        this.meshes.push(mesh);
      }
      if (mesh._children) {
        this._addToMeshList(...mesh._children);
      }
    }
  }
  dispose(doNotRecurse, disposeMaterialAndTextures) {
    //const usesSharedMaterials = Boolean(this.mesh?.mv3d_materialsShared);
    //if(usesSharedMaterials) disposeMaterialAndTextures = false;
    super.dispose(doNotRecurse, disposeMaterialAndTextures);
    if (doNotRecurse) for (const mesh of this.meshes) {
      mesh.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
  }
  getBoundingInfo() {
    const meshes = this.meshes.filter((m) => {var _m$getTotalVertices;return (_m$getTotalVertices = m.getTotalVertices) === null || _m$getTotalVertices === void 0 ? void 0 : _m$getTotalVertices.call(m);});
    if (!meshes.length) {
      const zero = _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero();
      return new BABYLON.BoundingInfo(zero, zero, this.getWorldMatrix());
    }
    let boundingInfo = meshes[0].getBoundingInfo();
    let min = boundingInfo.minimum.add(meshes[0].position);
    let max = boundingInfo.maximum.add(meshes[0].position);
    for (let i = 1; i < meshes.length; ++i) {
      boundingInfo = meshes[i].getBoundingInfo();
      min = BABYLON.Vector3.Minimize(min, boundingInfo.minimum.add(meshes[i].position));
      max = BABYLON.Vector3.Maximize(max, boundingInfo.maximum.add(meshes[i].position));
    }
    return new BABYLON.BoundingInfo(min, max, this.getWorldMatrix());
  }
  clone() {
    const c = new MeshGroup();
    c.addMesh(...this.meshes.map((m) => m.clone()));
    return c;
  }
  createInstance() {
    const c = new MeshGroup();
    c.addMesh(...this.meshes.map((m) => m.createInstance()));
    return c;
  }}

mz3d.MeshGroup = MeshGroup;
for (const property of ['receiveShadows', 'renderingGroupId', 'visibility', 'isVisible', 'character', 'showBoundingBox']) {
  Object.defineProperty(MeshGroup.prototype, property, {
    get() {const p = this[`_${property}`];return p !== undefined ? p : this.meshes[0][property];},
    set(v) {
      this[`_${property}`] = v;
      for (const mesh of this.meshes) {
        mesh[property] = v;
      }
    } });

}
for (const method of ['_resyncLightSources']) {
  MeshGroup.prototype[method] = function () {
    withMesh(this, (mesh) => mesh._resyncLightSources.apply(mesh, arguments));
  };
}

function setupCloneDisposal(clone) {
  clone.mv3d_disposeClonedMesh = clone.dispose;
  clone.dispose = disposeClonedMesh;
  clone.mv3d_restoreClonedMesh = restoreClonedMesh;
}

function disposeClonedMesh() {
  this.mv3d_unusedClone = true;
  //mz3d.scene.removeMesh(this);
  withMesh(this, (mesh) => mz3d.scene.removeMesh(mesh));
}

function restoreClonedMesh() {
  delete this.mv3d_unusedClone;
  delete this.mv3d_isSetup;
  //mz3d.scene.addMesh(this);
  withMesh(this, (mesh) => mz3d.scene.addMesh(mesh));
}

function cloneMesh(mesh, useInstance) {
  const materials = mesh.mv3d_materials;
  const importedModelData = mesh.mv3d_importedModelData;
  if (useInstance === mz3d.enumModelOptimization.CLONING) {
    mesh = getClone(mesh);
  } else {
    mesh = mesh.createInstance();
  }
  mesh.mv3d_importedModelData = importedModelData;
  mesh.mv3d_materials = materials;
  return mesh;
}

function getClone(mesh) {
  if (mesh.cloneMeshMap) for (const clone of Object.values(mesh.cloneMeshMap)) {
    if (clone && clone.mv3d_unusedClone) {var _clone$mv3d_restoreCl;
      (_clone$mv3d_restoreCl = clone.mv3d_restoreClonedMesh) === null || _clone$mv3d_restoreCl === void 0 ? void 0 : _clone$mv3d_restoreCl.call(clone);
      return clone;
    }
  }
  const clone = mesh.clone();
  setupCloneDisposal(clone);
  return clone;
}

async function withMesh(mesh, action) {
  if (mesh instanceof MeshGroup) {
    const group = mesh;
    for (const mesh of group.meshes) {
      await action(mesh);
    }
  } else {
    await action(mesh);
  }
}

class ProjectionFixer extends _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.TransformNode {
  constructor() {
    super('projection fixer', mz3d.scene);
    this.subNode = new _babylonjs_core__WEBPACK_IMPORTED_MODULE_0__.TransformNode('projection fixer subNode', mz3d.scene);
    this.subNode.parent = this;
  }
  attachTo(target) {
    if (target instanceof Model) {
      this.target = target;
      this.parent = target.parent;
      target.parent = this.subNode;
    }
  }
  detach() {
    if (this.target instanceof Model) {
      this.target.parent = this.parent;
      this.parent = null;
      this.target = null;
    }
  }
  update() {
    const cameraRotation = mz3d.cameraRotation();
    this.rotation.y = cameraRotation.y;
    this.subNode.rotation.y = -cameraRotation.y;
    this.scaling.z = mz3d.cameraNode.scaling.z;
    //this._isDirty=true;
    //this.subNode._isDirty=true;
  }}

/***/ }),

/***/ "./src/parameters.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   "o": () => (/* binding */ parameter)
/* harmony export */ });
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/util.js");
/* harmony import */ var _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/mod_babylon.js");
/* harmony import */ var _attributes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/attributes.js");
const mz3d = window.mz3d;




const pluginNames = ['mz3d', 'mv3d', 'mv3d-babylon'];
mz3d.pluginName = PluginManager._scripts.filter((v) => pluginNames.includes(v))[0] || 'mz3d';

const parameters = PluginManager.parameters(mz3d.pluginName);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parameters);

function parameter(name, dfault, type) {
  return name in parameters ? type ? type(parameters[name]) : parameters[name] : dfault;
}
mz3d.parameter = parameter;
mz3d.parameters = parameters;

Object.assign(mz3d, {
  enumOptionModes: {
    DISABLE: 0,
    ENABLE: 1,
    SUBMENU: 2 } });



function tryParseString(s) {
  try {
    return JSON.parse(s);
  } catch (err) {
    return s;
  }
}

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.assign)(mz3d, {
  CAMERA_MODE: "PERSPECTIVE",
  ORTHOGRAPHIC_DIST: 100,
  MV3D_FOLDER: "img/MV3D",
  get MZ3D_FOLDER() {return this.MV3D_FOLDER;},

  ANIM_DELAY: Number(parameters.animDelay),
  ALPHA_CUTOFF: Math.max(0.01, parameters.alphatest),
  ALPHA_NO_CUTOFF: 0.01,

  get EDGE_FIX() {return Number(parameters.edgefix) * (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.tileSize)() / 48;},
  ANTIALIASING: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.antialiasing),
  FOV: Number(parameters.fov),
  RES_SCALE: parameter('resScale', 1, Number) || 1,

  //WALL_HEIGHT:Number(parameters.wallHeight),
  //TABLE_HEIGHT:Number(parameters.tableHeight),
  //FRINGE_HEIGHT:Number(parameters.fringeHeight),
  CEILING_HEIGHT: Number(parameters.ceilingHeight),
  BASE_HEIGHT: parameter('baseHeight', 0, Number),
  LAYER_DIST: Number(parameters.layerDist),

  //ENABLED_DEFAULT: booleanString(parameters.enabledDefault),
  EVENTS_UPDATE_NEAR: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.eventsUpdateNear),

  UNLOAD_CELLS: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.unloadCells),
  CELL_SIZE: Number(parameters.cellSize),
  RENDER_DIST: Number(parameters.renderDist),
  MIPMAP: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.mipmap),
  SAMPLING_MODE: parameter('samplingMode', BABYLON.Texture.NEAREST_LINEAR_MIPLINEAR, (p) => BABYLON.Texture[p] ?? BABYLON.Texture.NEAREST_LINEAR_MIPLINEAR),

  TILE_SETTINGS_WALL: parameter('wallTileSettings', "height(2)", JSON.parse),
  TILE_SETTINGS_TABLE: parameter('tableTileSettings', "height(0.33)", JSON.parse),
  TILE_SETTINGS_STAR: parameter('starTileSettings', "fringe(2),pass(*)", JSON.parse),
  MAP_DEFAULTS: parameter('mapDefaults', "", JSON.parse),

  get renderDist() {return Math.min(this.RENDER_DIST, mz3d.blendFogFar.currentValue() + 7.5);},

  OPTION_MIPMAP: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.mipmapOption),
  OPTION_NAME_MIPMAP: parameter('mipmapOptionName', "Mipmapping", String),
  OPTION_RENDER_DIST: parameter('renderDistOption', true, _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  OPTION_NAME_RENDER_DIST: parameter('renderDistOptionName', "Render Distance", String),
  OPTION_RENDER_DIST_MIN: parameter('renderDistMin', 10, Number),
  OPTION_RENDER_DIST_MAX: parameter('renderDistMax', 100, Number),
  OPTION_FOV: parameter('fovOption', false, _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  OPTION_NAME_FOV: parameter('fovOptionName', "FOV", String),
  OPTION_FOV_MIN: parameter('fovMin', 50, Number),
  OPTION_FOV_MAX: parameter('fovMax', 100, Number),
  OPTION_INVERTY: parameter('invertYOption', true, _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  OPTION_NAME_INVERTY: parameter('invertYOptionName', "Invert Y Axis", String),
  OPTION_LOOKSENSITIVITY: parameter('lookSensitivityOption', true, _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  OPTION_NAME_LOOKSENSITIVITY: parameter('lookSensitivityOptionName', "Look Sensitivity", String),

  STAIR_THRESH: Number(parameters.stairThresh),
  WALK_OFF_EDGE: parameter('walkOffEdge', false, (p) => {p = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanNumber)(p);return p === true ? Infinity : p;}),
  WALK_ON_EVENTS: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.walkOnEvents),
  GRAVITY: Number(parameters.gravity),

  FOG_COLOR: 0,
  FOG_NEAR: 20,
  FOG_FAR: 30,
  //AMBIENT_COLOR: makeColor(parameters.ambientColor).toNumber(),
  get AMBIENT_COLOR() {return mz3d.featureEnabled('dynamicShadows') ? 0x888888 : 0xffffff;},

  LIGHT_LIMIT: parameter('lightLimit', 8, (n) => {n = Number(n);return isFinite(n) ? n : 8;}),
  LIGHT_HEIGHT: 0.5,
  LAMP_HEIGHT: 0.5,
  FLASHLIGHT_HEIGHT: 0.25,
  LIGHT_DECAY: 1,
  LIGHT_DIST: 3,
  LIGHT_ANGLE: 60,
  FLASHLIGHT_EXTRA_ANGLE: 10,
  FLASHLIGHT_INTENSITY_MULTIPLIER: 2,

  REGION_DATA: {},
  _REGION_DATA: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.ProxyConf)(),
  _REGION_DATA_MAP: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.ProxyConf)(),
  TTAG_DATA: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.ProxyConf)(),

  EVENT_HEIGHT: Number(parameters.eventHeight),
  //VEHICLE_BUSH:booleanString(parameters.vehicleBush),
  BOAT_SETTINGS: JSON.parse(parameters.boatSettings),
  SHIP_SETTINGS: JSON.parse(parameters.shipSettings),
  AIRSHIP_SETTINGS: JSON.parse(parameters.airshipSettings),

  EVENT_CHAR_SETTINGS: parameter('eventCharDefaults', "", tryParseString),
  EVENT_OBJ_SETTINGS: parameter('eventObjDefaults', "", tryParseString),
  EVENT_TILE_SETTINGS: parameter('eventTileDefaults', "", tryParseString),

  allowGlide: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('allowGlide', (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.allowGlide), _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  get ALLOW_GLIDE() {return this.allowGlide;},

  SPRITE_OFFSET: parameter('spriteDynamicOffset', 0.45, parseFloat),
  SPRITE_OFFSET_PITCH: String(parameters.spriteDynamicOffset).includes('p'),

  ENABLE_3D_OPTIONS: mz3d.enumOptionModes[parameters['3dMenu'].toUpperCase()],

  TEXTURE_SHADOW: parameters.shadowTexture || 'shadow',
  TEXTURE_BUSHALPHA: parameters.alphaMask || 'bushAlpha',
  TEXTURE_ERROR: parameters.errorTexture || 'errorTexture',

  diagonalMovement: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('diagonalMovement', String(parameters.dir8Movement), function (v) {
    v = String(v).toUpperCase();
    return {
      enabled: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(v),
      smart: v.includes('SMART'),
      '2D': !v.includes('3D') };

  }),
  get DIR8MOVE() {return this.diagonalMovement.enabled;},
  get DIR8SMART() {return this.diagonalMovement.smart;},
  get DIR8_2D() {return this.diagonalMovement['2D'];},

  turnIncrement: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('turnIncrement', String(parameters.turnIncrement), (v) => Number(v)),
  get TURN_INCREMENT() {return mz3d.turnIncrement;},
  WASD: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.WASD),

  inputCameraMouse: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('inputCameraMouse', String(parameters.inputCameraMouse), _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  inputCameraGamepad: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('inputCameraGamepad', String(parameters.inputCameraGamepad), _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  GAMEPAD_TURN_BUTTON: parameter('inputGamepadTurnButton', 0, (v) => {return { 'U': 0, 'B': 1, 'T': 2 }[v[0]] || 0;}),

  lockCamera: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('lockCamera', false, _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  allowPitch: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('allowPitch', (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.keyboardPitch), _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  allowRotation: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('allowRotation', (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.keyboardTurn), _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  KEYBOARD_STRAFE: (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.falseString)(parameters.keyboardStrafe),

  get KEYBOARD_PITCH() {return this.allowPitch;},
  get KEYBOARD_TURN() {return this.allowRotation;},

  instantMovement: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('instantMovement', false, _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  turnSpeed: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('turnSpeed', parameters.yawSpeed, (n) => {n = Number(n);return n && isFinite(n) ? n : Infinity;}),
  get YAW_SPEED() {return this.turnSpeed;},
  PITCH_SPEED: Number(parameters.pitchSpeed) || 90,

  TRIGGER_INFINITE: !(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(parameters.heightTrigger),

  BACKFACE_CULLING: parameter('backfaceCulling', true, _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),
  cameraCollision: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('cameraCollision', String(parameters.cameraCollision), function (v) {
    if (typeof v === 'string') {
      const values = v.split(' ');v = values[0];
      const ret = { type: !(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(v) ? 0 : Number((v.match(/\d+/) || '1')[0]) };
      for (let v of values) if (v.toUpperCase().includes("SMOOTH")) {ret.smooth = true;}
      return ret;
    } else if (typeof v == 'object') {
      return Object.assign(this.get(), v);
    }
    const ret = this.get();ret.type = Number(v);return ret;
  }),

  DIAG_SYMBOL: parameter('diagSymbol', '{d}', String),

  ALLOW_WEBGPU: parameter('webgpu', false, _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),

  USE_TEXTURE_DATA: parameter('useTextureData', true, _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),

  animationDepth: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('animationDepth', parameter('animationDepth', 'false'), _util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString),

  setupParameters() {
    this.REGION_DATA = new Proxy(this._REGION_DATA, {
      get: (target, key) => {
        if (this._REGION_DATA_MAP[key] != null) {return this._REGION_DATA_MAP[key];}
        if (this._REGION_DATA[key] != null) {return this._REGION_DATA[key];}
      },
      set: (target, key, value) => {
        target[key] = value;
      },
      has: (target, key) => {
        return this._REGION_DATA_MAP[key] != null || this._REGION_DATA[key] != null;
      } });

    for (let entry of JSON.parse(parameters.regions)) {
      entry = JSON.parse(entry);
      const [, regionId, layer1 = 1, layer2 = layer1] = /(\d+)\s*(?:,\s*(\d)(?:-(\d))?)?/.exec(entry.regionId);
      const regionData = this.readConfigurationFunctions(entry.conf, this.tilesetConfigurationFunctions);
      for (let l = layer1; l <= layer2; ++l) {
        this._REGION_DATA[`${regionId},${l}`] = regionData;
      }

    }
    for (const id in this._REGION_DATA) {
      this.applyTextureConfigs(this._REGION_DATA[id], 'B', 0, 0);
      this.collapseCeilingOffsets(this._REGION_DATA[id]);
    }
    for (let entry of JSON.parse(parameters.ttags)) {
      entry = JSON.parse(entry);
      this.TTAG_DATA[entry.terrainTag] = this.readConfigurationFunctions(entry.conf, this.tilesetConfigurationFunctions);
    }
    for (const id in this.TTAG_DATA) {
      this.applyTextureConfigs(this.TTAG_DATA[id], 'B', 0, 0);
      this.collapseCeilingOffsets(this.TTAG_DATA[id]);
    }

    this.EVENT_CHAR_SETTINGS = this.readConfigurationFunctions(
    this.EVENT_CHAR_SETTINGS,
    this.eventConfigurationFunctions);

    this.EVENT_OBJ_SETTINGS = this.readConfigurationFunctions(
    this.EVENT_OBJ_SETTINGS,
    this.eventConfigurationFunctions);

    this.EVENT_TILE_SETTINGS = this.readConfigurationFunctions(
    this.EVENT_TILE_SETTINGS,
    this.eventConfigurationFunctions);


    this.BOAT_SETTINGS.big = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(this.BOAT_SETTINGS.big);
    this.SHIP_SETTINGS.big = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(this.SHIP_SETTINGS.big);
    this.AIRSHIP_SETTINGS.height = Number(this.AIRSHIP_SETTINGS.height);
    this.AIRSHIP_SETTINGS.big = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(this.AIRSHIP_SETTINGS.big);
    this.AIRSHIP_SETTINGS.bushLanding = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.booleanString)(this.AIRSHIP_SETTINGS.bushLanding);

    this.BOAT_SETTINGS.conf = this.readConfigurationFunctions(
    this.BOAT_SETTINGS.conf,
    this.eventConfigurationFunctions);

    this.SHIP_SETTINGS.conf = this.readConfigurationFunctions(
    this.SHIP_SETTINGS.conf,
    this.eventConfigurationFunctions);

    this.AIRSHIP_SETTINGS.conf = this.readConfigurationFunctions(
    this.AIRSHIP_SETTINGS.conf,
    this.eventConfigurationFunctions);


    //Texture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=0;

    this.TILE_SETTINGS_WALL = this.readConfigurationFunctions(this.TILE_SETTINGS_WALL, this.tilesetConfigurationFunctions);
    this.TILE_SETTINGS_TABLE = this.readConfigurationFunctions(this.TILE_SETTINGS_TABLE, this.tilesetConfigurationFunctions);
    this.TILE_SETTINGS_STAR = this.readConfigurationFunctions(this.TILE_SETTINGS_STAR, this.tilesetConfigurationFunctions);

    this.MAP_DEFAULTS = this.readConfigurationFunctions(this.MAP_DEFAULTS, this.mapConfigurationFunctions);

    (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.assign)(mz3d, {
      airshipHeight: new _attributes_js__WEBPACK_IMPORTED_MODULE_2__/* .Attribute */ .a('airshipHeight', this.AIRSHIP_SETTINGS.height, Number) });


  },

  updateParameters() {
    this.updateRenderDist();
    this.updateFov();
    this.callFeatures('updateParameters');
  },
  updateRenderDist() {
    if (this.camera.mode === _mod_babylon_js__WEBPACK_IMPORTED_MODULE_1__/* .ORTHOGRAPHIC_CAMERA */ ._P) {
      this.camera.maxZ = this.renderDist;
      this.camera.minZ = -this.renderDist;
    } else {
      this.camera.maxZ = this.renderDist;
      this.camera.minZ = 0.1;
    }
  },
  updateFov() {
    const dist = this.blendCameraDist.currentValue() || 0.1;
    const frustrumHeight = this.getFrustrumHeight(dist, (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.degtorad)(this.FOV));
    const fov = this.getFovForDist(dist, frustrumHeight / this.blendCameraZoom.currentValue());
    this.camera.fov = fov;
  } });

/***/ }),

/***/ "./src/plugin_commands_mz.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

const mz3d = window.mz3d;
const { relativeBlend, booleanString, falseString, makeColor } = __webpack_require__("./src/util.js");


PluginManager.registerCommand('mz3d', 'command', function (args) {
  if (args.command) {mz3d.command.interpret(this, args.command);}
});

PluginManager.registerCommand('mz3d', 'camera', function (args) {
  const time = Number(args.time) || 0;
  if (args.pitch) {relativeBlend(mz3d.blendCameraPitch, args.pitch, time);}
  if (args.yaw) {relativeBlend(mz3d.blendCameraYaw, args.yaw, time);}
  if (args.roll) {relativeBlend(mz3d.blendCameraRoll, args.roll, time);}
  if (args.dist) {relativeBlend(mz3d.blendCameraDist, args.dist, time);}
  if (args.zoom) {relativeBlend(mz3d.blendCameraZoom, args.zoom, time);}
  if (args.height) {relativeBlend(mz3d.blendCameraHeight, args.height, time);}
  if (args.mode) {mz3d.cameraMode = args.mode;}
  if (args.follow) {mz3d.setCameraTarget(mz3d.targetChar(args.follow, this.character()), time);}
  if (args.pan) {
    const pan = JSON.parse(args.pan);
    relativeBlend(mz3d.blendPanX, pan.x, time);
    relativeBlend(mz3d.blendPanY, pan.y, time);
  }
});

PluginManager.registerCommand('mz3d', 'cameraTrack', function (args) {
  let mode = 0;
  if (booleanString(args.trackYaw)) {mode |= 1;}
  if (booleanString(args.trackPitch)) {mode |= 2;}
  let target = falseString(args.target);
  if (target) {target = mz3d.targetChar(target, this.character());}
  const time = Number(args.time) || 0;
  mz3d.setCameraTrack(target, time, mode);
});

PluginManager.registerCommand('mz3d', 'fog', function (args) {
  const time = Number(args.time) || 0;
  if (args.color) {mz3d.blendFogColor.setValue(makeColor(args.color).toNumber(), time);}
  if (args.near) {relativeBlend(mz3d.blendFogNear, args.near, time);}
  if (args.far) {relativeBlend(mz3d.blendFogFar, args.far, time);}
});

PluginManager.registerCommand('mz3d', 'light', function (args) {
  const time = Number(args.time) || 0;
  if (args.color) {mz3d.blendAmbientColor.setValue(makeColor(args.color).toNumber(), time);}
  if (mz3d.isPremium) {
    if (args.sunColor) {mz3d.blendSunColor.setValue(makeColor(args.sunColor).toNumber(), time);}
    if (args.sunYaw) {relativeBlend(mz3d.blendSunYaw, args.sunYaw, time);}
    if (args.sunPitch) {relativeBlend(mz3d.blendSunPitch, args.sunPitch, time);}
  }
});

PluginManager.registerCommand('mz3d', 'lamp', function (args) {
  const time = Number(args.time) || 0;
  const target = mz3d.targetChar(args.target, this.character());
  if (!target || !target.mv3d_sprite) {return;}
  const char = target.mv3d_sprite;
  char.setupLamp();
  if (args.color) {char.blendLampColor.setValue(makeColor(args.color).toNumber(), time);}
  if (args.intensity) {relativeBlend(char.blendLampIntensity, args.intensity, time);}
  if (args.dist) {relativeBlend(char.blendLampDistance, args.dist, time);}
  if (booleanString(args.shadow)) {var _char$setupLampShadow;(_char$setupLampShadow = char.setupLampShadow) === null || _char$setupLampShadow === void 0 ? void 0 : _char$setupLampShadow.call(char);}
});

PluginManager.registerCommand('mz3d', 'flashlight', function (args) {
  const time = Number(args.time) || 0;
  const target = mz3d.targetChar(args.target, this.character());
  if (!target || !target.mv3d_sprite) {return;}
  const char = target.mv3d_sprite;
  char.setupFlashlight();
  if (args.color) {char.blendFlashlightColor.setValue(makeColor(args.color).toNumber(), time);}
  if (args.intensity) {relativeBlend(char.blendFlashlightIntensity, args.intensity, time);}
  if (args.dist) {relativeBlend(char.blendFlashlightDistance, args.dist, time);}
  if (args.angle) {relativeBlend(char.blendFlashlightAngle, args.angle, time);}
  if (args.pitch) {relativeBlend(char.blendFlashlightPitch, args.pitch, time);}
  if (args.yaw) {target.mv3d_configure(`flashlightYaw(${args.yaw})`);}
  if (booleanString(args.shadow)) {var _char$setupFlashlight;(_char$setupFlashlight = char.setupFlashlightShadow) === null || _char$setupFlashlight === void 0 ? void 0 : _char$setupFlashlight.call(char);}
});

PluginManager.registerCommand('mz3d', 'configure', function (args) {
  const target = mz3d.targetChar(args.target, this.character());
  if (!target) {return;}
  if (args.config) {target.mv3d_configure(args.config, args.time);}
});

PluginManager.registerCommand('mz3d', 'resolution', function (args) {
  const time = Number(args.time) || 0;
  if (args.scale) {relativeBlend(mz3d.blendResolutionScale, args.scale, time);}
});

PluginManager.registerCommand('mz3d', 'set', function (args) {
  const key = args.property.toLowerCase();
  const value = args.value;
  const time = Number(args.time) || 0;
  if (key in mz3d.attributes) {
    if (time) {
      mz3d.blendAttribute(key, value, time);
    } else {
      mz3d.attributes[key] = value;
    }
  }
});

PluginManager.registerCommand('mz3d', 'enable', function (args) {
  const enabled = booleanString(args.enabled);
  const fadeType = Number(args.fadeType);
  if (enabled) {
    mz3d.enable(fadeType);
  } else {
    mz3d.disable(fadeType);
  }
});

PluginManager.registerCommand('mz3d', 'elevation', function (args) {
  const time = Number(args.time) || 0;
  const target = mz3d.targetChar(args.target, this.character());
  if (!target || !target.mv3d_sprite) {return;}
  const char = target.mv3d_sprite;
  relativeBlend(char.blendElevation, args.elevation, time);
});

PluginManager.registerCommand('mz3d', 'animation', function (args) {
  const target = mz3d.targetChar(args.target, this.character());
  const scale = Number(args.scale) || 1;
  const mirror = booleanString(args.mirror);
  const depth = booleanString(args.depth);
  const rot = isNaN(args.rot) ? mz3d.blendCameraYaw.currentValue() : Number(args.rot);
  const height = Number(args.height) || 0;
  $gameTemp.requestAnimation([target], args.id, { mirror, scale, depth, rot, height });
});

mz3d.PluginCommand.prototype.animation = async function animation(id, ...a) {
  const char = (await this.AWAIT_CHAR(this.CHAR)).char;
  if (mz3d.isDisabled()) {return;}
  let mirror = false,scale = 1,depth = false,rot = NaN,height = 0;
  for (let i = 0; i < a.length; ++i) {
    switch (a[i].toLowerCase()) {
      //mirror seems to do nothing? I'll leave it here anyway.
      case 'mirror':if (a[i + 1] != null) mirror = booleanString(a[i + 1]);break;
      case 'scale':if (a[i + 1] != null) scale = Number(a[i + 1]) || 1;break;
      case 'depth':if (a[i + 1] != null) depth = booleanString(a[i + 1]);break;
      case 'rot':if (a[i + 1] != null) rot = Number(a[i + 1]);break;
      case 'height':if (a[i + 1] != null) height = Number(a[i + 1]) || 0;break;}

  }
  if (isNaN(rot)) {rot = mz3d.blendCameraYaw.currentValue();}
  $gameTemp.requestAnimation([char], id, { mirror, scale, depth, rot, height });
};

/***/ }),

/***/ "./src/plugin_support/movement/movement_Altimit.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/util.js");
const mz3d = window.mz3d;


(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'moveByInput', (o) => function () {
  $gameTemp._mv3d_altimit_moveByInput = true;
  o.apply(this, arguments);
  $gameTemp._mv3d_altimit_moveByInput = false;
});

mz3d.getInputDirection = function () {
  let dir = mz3d.DIR8MOVE ? Input.dir8 : Input.dir4;
  return dir;
};

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'moveVector', (o) => function (vx, vy) {
  if ($gameTemp._mv3d_altimit_moveByInput && !this._touchTarget) {
    const _vx = vx,_vy = vy;
    const yaw = (0,_util__WEBPACK_IMPORTED_MODULE_0__.degtorad)(mz3d.blendCameraYaw.currentValue());
    vx = (0,_util__WEBPACK_IMPORTED_MODULE_0__.cos)(yaw) * _vx + (0,_util__WEBPACK_IMPORTED_MODULE_0__.sin)(yaw) * _vy;
    vy = -(0,_util__WEBPACK_IMPORTED_MODULE_0__.sin)(yaw) * _vx + (0,_util__WEBPACK_IMPORTED_MODULE_0__.cos)(yaw) * _vy;
    //console.log(_vx,_vy,vx,vy);
  }
  if (this.mv3d_sprite && this.mv3d_sprite.platform && this.mv3d_sprite.platform.isSlope) {
    if (Math.abs(vx) > Math.abs(vy)) {
      vx = Math.round(this._x) - this._x + Math.sign(vx);
      vy = Math.round(this._y) - this._y;
    } else {
      vx = Math.round(this._x) - this._x;
      vy = Math.round(this._y) - this._y + Math.sign(vy);
    }
    if ($gamePlayer._touchTarget) {
      $gamePlayer._touchTarget.x = Math.round($gamePlayer._touchTarget.x);
      $gamePlayer._touchTarget.y = Math.round($gamePlayer._touchTarget.y);
    }
  }

  o.call(this, vx, vy);
});

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_CharacterBase.prototype, 'setDirectionVector', (o) => function (vx, vy) {
  this.mv3d_setDirection(mz3d.yawToDir((0,_util__WEBPACK_IMPORTED_MODULE_0__.pointtodeg)(vx, vy), true));
});

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_CharacterBase.prototype, 'moveVectorMap', (o) => function (owner, collider, bboxTests, move, vx, vy) {
  o.apply(this, arguments);
  const sprite = owner.mv3d_sprite;
  if (!sprite) {return;}

  const x = Math.floor(owner.x + collider.x);
  const y = Math.floor(owner.y + collider.y);
  const x1 = Math.floor(owner.x + move.x + collider.aabbox.left),x2 = Math.ceil(owner.x + move.x + collider.aabbox.right);
  const y1 = Math.floor(owner.y + move.y + collider.aabbox.top),y2 = Math.ceil(owner.y + move.y + collider.aabbox.bottom);

  //const d = Input._makeNumpadDirection(Math.sign(move.x),Math.sign(move.y));
  //const d = this.direction();

  for (let tx = x1; tx < x2; ++tx)
  for (let ty = y1; ty < y2; ++ty) {
    const d = Input._makeNumpadDirection(Math.sign(tx - x), Math.sign(ty - y));
    //if(tx===x&&ty===y){continue;}
    let slope;
    let realign = false;
    if (slope = mz3d.isRampAt(tx, ty, sprite.z)) {
      if (mz3d.canPassRamp(10 - d, slope, { z: sprite.z })) {continue;}
    }
    const tx2 = $gameMap.roundXWithDirection(tx, 10 - d);
    const ty2 = $gameMap.roundYWithDirection(ty, 10 - d);
    if (slope = mz3d.isRampAt(tx2, ty2, sprite.z)) {
      if (mz3d.canPassRamp(d, slope)) {continue;}
    }

    let collided = false;
    if (this._mv3d_isFlying()) {
      if (!mz3d.allowGlide && mz3d.tileCollision(this, tx, ty, true, true) || mz3d.tileCollision(this, tx, ty, true, false)) {collided = true;}
    } else {
      if (sprite.falling) {collided = true;} else
      if (mz3d.tileCollision(this, tx, ty, true, true)) {collided = true;} else
      if (mz3d.WALK_OFF_EDGE < Infinity) {
        const platformz = mz3d.getPlatformFloatForCharacter(this, tx, ty);
        if (mz3d.WALK_OFF_EDGE < sprite.targetElevation - platformz &&
        (0,_util__WEBPACK_IMPORTED_MODULE_0__.unround)(Math.abs(platformz - sprite.targetElevation)) > mz3d.STAIR_THRESH) {
          collided = true;
        }
      }
    }
    if (collided) {
      if (tx !== x) {move.x = 0;}
      if (ty !== y) {move.y = 0;}
    }
  }
});

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_CharacterBase.prototype, 'moveVectorCharacters', (o) => function (owner, collider, characters, loopMap, move) {
  const spr1 = this.mv3d_sprite;if (!spr1) {return o.apply(this, arguments);}
  const zcol1 = spr1.getCollisionHeight();
  characters = characters.filter((character) => {
    const spr2 = character.mv3d_sprite;if (!spr2) {return true;}
    const zcol2 = spr2.getCollisionHeight();
    return zcol1.z1 < zcol2.z2 && zcol1.z2 > zcol2.z1;
  });
  return o.call(this, owner, collider, characters, loopMap, move);
});

mz3d.Character.prototype.getPlatform = function (x = this.char._realX, y = this.char._realY, opts = {}) {
  const collider = this.char.collider();
  if (collider.type === 0) {
    x += collider.x - 0.5;y += collider.y - 0.5;
    const r = collider.radius * 0.95;

    const platform = [
    mz3d.getPlatformForCharacter(this, x, y),
    mz3d.getPlatformForCharacter(this, x, y - r, opts),
    mz3d.getPlatformForCharacter(this, x - r, y, opts),
    mz3d.getPlatformForCharacter(this, x, y + r, opts),
    mz3d.getPlatformForCharacter(this, x + r, y, opts)];

    const diagPlatforms = [
    -Infinity,
    mz3d.getPlatformForCharacter(this, x - r * Math.SQRT1_2, y - r * Math.SQRT1_2, opts),
    mz3d.getPlatformForCharacter(this, x - r * Math.SQRT1_2, y + r * Math.SQRT1_2, opts),
    mz3d.getPlatformForCharacter(this, x + r * Math.SQRT1_2, y + r * Math.SQRT1_2, opts),
    mz3d.getPlatformForCharacter(this, x + r * Math.SQRT1_2, y - r * Math.SQRT1_2, opts)].
    filter((c) => c.z2 <= this.z);
    return platform.concat(diagPlatforms).reduce((a, b) => a.z2 >= b.z2 ? a : b);
  } else {
    x -= 0.5;y -= 0.5;
    const b = {
      l: collider.aabbox.left * 0.99,
      r: collider.aabbox.right * 0.99,
      t: collider.aabbox.top * 0.99,
      b: collider.aabbox.bottom * 0.99 };

    const platform = [
    mz3d.getPlatformForCharacter(this, x, y),
    mz3d.getPlatformForCharacter(this, x + b.l, y + b.t, opts),
    mz3d.getPlatformForCharacter(this, x + b.l, y + b.b, opts),
    mz3d.getPlatformForCharacter(this, x + b.r, y + b.t, opts),
    mz3d.getPlatformForCharacter(this, x + b.r, y + b.b, opts)].
    reduce((a, b) => a.z2 >= b.z2 ? a : b);
    return platform;
  }
};

mz3d.getEventsAt = function (x, y) {
  x = Math.round(x);y = Math.round(y);
  return $gameMap.events().filter((character) => {
    if (character.isThrough()) {return false;}
    const { x: cx, y: cy } = character;
    const { left, right, top, bottom } = character.collider().aabbox;
    return cx + left < x + 1 && cx + right > x && cy + top < y + 1 && cy + bottom > y;
  });
};

// give followers through if they fall behind
/*
const _FOLLOWER_THROUGH_THRESH=3;
override(Game_Follower.prototype,'isThrough',o=>function(){
	const precedingCharacter = (this._memberIndex > 1 ? $gamePlayer._followers._data[this._memberIndex - 2] : $gamePlayer);
	if(Math.abs(precedingCharacter.x-this.x)+Math.abs(precedingCharacter.y-this.y)>_FOLLOWER_THROUGH_THRESH){ return true; }
	return o.apply(this,arguments);
});
*/

function zCollidersOverlap(s1, s2) {
  s1 = s1.getCollisionHeight();s2 = s2.getCollisionHeight();
  if (s1.z1 === s1.z2 || s2.z1 === s2.z2) {return s1.z1 <= s2.z2 && s1.z2 >= s2.z1;}
  return s1.z1 < s2.z2 && s1.z2 > s2.z1;
}

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Map.prototype, 'events', (o) => function () {
  const events = o.apply(this, arguments);
  if (!$gameTemp._mv3d_altimit_eventsHeightFilter) {return events;}
  delete $gameTemp._mv3d_altimit_eventsHeightFilter;
  const player = $gamePlayer.mv3d_sprite;
  if (!player) {return events;}
  return events.filter((e) => {
    const sprite = e.mv3d_sprite;
    if (!sprite) {return true;}
    return zCollidersOverlap(sprite, player);
  });
});

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Event.prototype, 'checkEventTriggerTouch', (o) => function () {
  const sprite = this.mv3d_sprite,player = $gamePlayer.mv3d_sprite;
  if (sprite && player) {
    if (!zCollidersOverlap(sprite, player)) {return false;}
  }
  return o.apply(this, arguments);
});

const _eventsHeightFilter = (o) => function () {
  $gameTemp._mv3d_altimit_eventsHeightFilter = true;
  return o.apply(this, arguments);
};
(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'checkEventTriggerHere', _eventsHeightFilter);
(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'checkEventTriggerThere', _eventsHeightFilter);

/***/ }),

/***/ "./src/plugin_support/movement/movement_Q.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/util.js");

const mz3d = window.mz3d;

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(ColliderManager, 'update', (o) => function () {
  this.hide();
});

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(ColliderManager.container, 'update', (o) => function () {
  if (this.visible) {o.apply(this, arguments);}
}, true);

let _tileColliders = {};
mz3d.getQTileColliders = () => _tileColliders;

function mv3d_makeTileCollider(x, y, zcollider, extra) {
  const tc = new Box_Collider($gameMap.tileWidth(), $gameMap.tileHeight());
  tc.x = x * $gameMap.tileWidth();
  tc.y = y * $gameMap.tileHeight();
  tc.mv3d_collider = zcollider;
  tc.mv3d_collider_type = extra;
  return tc;
}

const infiniteHeightCollider = { z1: -Infinity, z2: Infinity };

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Map.prototype, 'setupMapColliders', (o) => function () {
  this._tileCounter = 0;
  _tileColliders = {};
  for (let x = 0; x < this.width(); x++)
  for (let y = 0; y < this.height(); y++) {
    const px = x * this.tileWidth(),py = y * this.tileHeight();
    const flags = this.tilesetFlags();
    const tiles = mz3d.getTileData(x, y);
    const zColliders = mz3d.getCollisionHeights(x, y, { layers: true, slopeMin: true });
    const tileCollider_list = _tileColliders[[x, y]] = [];
    for (let i = 0; i < zColliders.length; ++i) {
      tileCollider_list[i] = mv3d_makeTileCollider(x, y, zColliders[i], 'mv3d');
    }
    _tileColliders[[x, y, 'x']] = mv3d_makeTileCollider(x, y, infiniteHeightCollider, 'mv3d_x');
    for (let l = 0; l < tiles.length; ++l) {
      const flag = flags[tiles[l]];
      const passage = mz3d.getTilePassage(tiles[l], x, y, l);
      if (passage === mz3d.enumPassage.THROUGH) {continue;}
      const conf = mz3d.getTileConfig(x, y, l);
      if (conf.shape === mz3d.enumShapes.SLOPE) {
        const rampData = mz3d.getRampData(x, y, l, conf);
        let dcol = 0;
        if (!mz3d.canPassRamp(2, rampData)) {dcol |= 0b0001;}
        if (!mz3d.canPassRamp(4, rampData)) {dcol |= 0b0010;}
        if (!mz3d.canPassRamp(6, rampData)) {dcol |= 0b0100;}
        if (!mz3d.canPassRamp(8, rampData)) {dcol |= 0b1000;}
        dcol += 1536;
        const slopeZ2 = rampData.z2;
        const slopeZ1 = rampData.z1;
        //const data = Array.from(QMovement.tileBoxes[flag]);
        let data = QMovement.tileBoxes[dcol];
        const key = [x, y, l, 'slope'].toString();
        _tileColliders[key] = [];
        if (data) {
          if (data[0].constructor !== Array) {data = [data];}
          for (const box of data) {
            const c = new Box_Collider(box[0] || 0, box[1] || 0, box[2], box[3]);
            c.slopeZ1 = slopeZ1;c.slopeZ2 = slopeZ2;
            c.moveTo(px, py);
            c.mv3d_collider = infiniteHeightCollider;
            _tileColliders[key].push(c);
          }
        }
      }
      let mv3d_collider;
      if (zColliders.layers[l]) {
        mv3d_collider = zColliders.layers[l];
        mv3d_collider.passage = passage;
        mv3d_collider.l = l;
      }
      let data = this.getMapCollider(x, y, flag);
      if (!data) {continue;}
      data = Array.from(data);
      if (data[0].constructor === Array) {
        for (var j = 0; j < data.length; j++) {
          data[j].mv3d_collider = mv3d_collider;
          data[j].isRegionCollider = true;
          this.makeTileCollider(x, y, flag, data[j], j);
        }
      } else {
        data.mv3d_collider = mv3d_collider;
        data.isQCollider = true;
        this.makeTileCollider(x, y, flag, data, 0);
      }
    }
  }
}, true);

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Map.prototype, 'makeTileCollider', (o) => function (x, y, flag, boxData, index) {
  const collider = o.apply(this, arguments);
  if (boxData.mv3d_collider) {
    if (boxData.isRegionCollider) {
      collider.mv3d_collider = infiniteHeightCollider;
    } else if (boxData.isQCollider) {
      collider.mv3d_collider = { z1: -Infinity, z2: Infinity };
      if (boxData.mv3d_collider) {
        collider.mv3d_collider.l = boxData.mv3d_collider.l;
      }
      /*
      collider.mv3d_collider = {
      	z1: boxData.mv3d_collider.z2,
      	z2: boxData.mv3d_collider.z2 + mv3d.STAIR_THRESH + 0.01,
      };
      */
    } else {
      collider.mv3d_collider = boxData.mv3d_collider;
    }
  }
  return collider;
}, true);

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_CharacterBase.prototype, 'collider', (o) => function collider() {
  const collider = o.apply(this, arguments);
  if (!this.mv3d_sprite) {return collider;}
  if (!collider.mv3d_collider) {
    Object.defineProperty(collider, 'mv3d_collider', {
      configurable: true, enumerable: false, value: this.mv3d_sprite.getCollider() });

    Object.defineProperty(collider, 'mv3d_triggerCollider', {
      configurable: true, enumerable: false, value: this.mv3d_sprite.getTriggerCollider() });

  }
  return collider;
});

function QzCollidersOverlap(c1, c2) {
  if (!c1.mv3d_collider || !c2.mv3d_collider) {return true;}
  c1 = c1.mv3d_collider;c2 = c2.mv3d_collider;
  return zCollidersOverlap(c1, c2);
}
function zCollidersOverlap(c1, c2) {
  if (c1.z1 < c2.z2 && c1.z2 > c2.z1 && c1.z1 + mz3d.STAIR_THRESH < c2.z2 && c1.z2 + mz3d.STAIR_THRESH > c2.z1) {
    return true;
  }
  return false;
}

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(ColliderManager, 'getCollidersNear', (o) => function getCollidersNear(collider, only, debug) {
  // Q colliders
  let isBreak = false;
  const near = o.call(this, collider, (c) => {
    if (QzCollidersOverlap(collider, c) === false) {return false;}
    if (collider.mv3d_collider) {
      const cx = Math.round(c.x / QMovement.tileSize);
      const cy = Math.round(c.y / QMovement.tileSize);
      if (collider.mv3d_collider.char) {
        // if we're standing on a character, ignore Q colliders.
        //const platform = collider.mv3d_collider.char.getPlatform();
        const platform = collider.mv3d_collider.char.getPlatform(cx, cy);
        if (platform.char) {return false;}
      }
      if (c.mv3d_collider) {
        // ignore Q colliders not on current layer
        const tileLayers = mz3d.getTileLayers(cx, cy, collider.mv3d_collider.z1 + mz3d.STAIR_THRESH);
        if (!tileLayers.includes(c.mv3d_collider.l)) {return false;}
      }
    }
    if (only) {
      const value = only(c);
      if (value === 'break') {isBreak = true;}
      return value;
    }
    return true;
  }, debug);
  if (isBreak) {return near;}
  const x1 = (collider.x + collider._offset.x - 1) / QMovement.tileSize;
  const y1 = (collider.y + collider._offset.y - 1) / QMovement.tileSize;
  const x2 = (collider.x + collider._offset.x + collider.width + 1) / QMovement.tileSize;
  const y2 = (collider.y + collider._offset.y + collider.height + 1) / QMovement.tileSize;
  if (collider.mv3d_collider)
  for (let tx = Math.floor(x1); tx < Math.ceil(x2); ++tx)
  for (let ty = Math.floor(y1); ty < Math.ceil(y2); ++ty) {
    const colliderList = _tileColliders[[tx, ty]];
    const xCollider = _tileColliders[[tx, ty, 'x']];
    let slopeColliders = null;
    let isWall = false;
    const tileLayers = mz3d.getTileLayers(tx, ty, collider.mv3d_collider.z1 + mz3d.STAIR_THRESH);
    for (const l of tileLayers) {
      if (mz3d.getTilePassage(tx, ty, l) === mz3d.enumPassage.WALL) {isWall = true;}
      const slopeKey = [tx, ty, l, 'slope'].toString();
      if (slopeKey in _tileColliders) {slopeColliders = _tileColliders[slopeKey];}
    }
    let shouldCollide = false;
    if (xCollider && collider.mv3d_collider.char) {
      const char = collider.mv3d_collider.char;
      const opts = { slopeMin: true };
      const platform = char.getPlatform(tx, ty, opts);
      opts.platform = platform;
      // collide if falling
      if (char.falling && !char.char._mv3d_isFlying()) {shouldCollide = true;}
      // x passage
      else if (isWall && !platform.char) {
        shouldCollide = true;
      }
      // collide slopes
      else if (slopeColliders && !char.platform.char && !platform.char) {
        for (const c of slopeColliders) {
          if (mz3d.WALK_OFF_EDGE >= char.z - c.slopeZ1 && char.z > c.slopeZ1) {continue;}
          let value = true;
          if (only) {value = only(c);}
          if (value !== false) {
            near.push(c);
            if (value === 'break') {return near;}
            continue;
          }
        }
      }
      // collide ledges
      else {
        const platformz = char.getPlatformFloat(tx, ty, opts);
        if (mz3d.WALK_OFF_EDGE < char.targetElevation - platformz && !char.char._mv3d_isFlying() && (!char.platform || !char.platform.isSlope) &&
        (0,_util__WEBPACK_IMPORTED_MODULE_0__.unround)(Math.abs(platformz - char.targetElevation)) > mz3d.STAIR_THRESH) {
          shouldCollide = true;
        }
      }

      if (shouldCollide) {
        let value = true;
        if (only) {value = only(xCollider);}
        if (value !== false) {
          near.push(xCollider);
          if (value === 'break') {return near;}
          continue;
        }
      }
    }
    // collide with wall
    if (colliderList) for (let i = 0; i < colliderList.length; ++i) {
      if (QzCollidersOverlap(collider, colliderList[i])) {
        if (only) {
          const value = only(colliderList[i]);
          if (value !== false) {near.push(colliderList[i]);}
          if (value === 'break') {return near;}
        } else {
          near.push(colliderList[i]);
        }
      }
    }
  }
  return near;
});

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(ColliderManager, 'getCharactersNear', (o) => function (collider, only) {
  return o.call(this, collider, (char) => {
    const sprite = char.mv3d_sprite;if (!sprite) {return true;}
    const c1 = collider.mv3d_collider;
    const c2 = $gameTemp._mv3d_Q_getCharactersTriggerHeight ? sprite.getTriggerHeight() : sprite.getCollisionHeight();
    if (!c1 || !c2) {return true;}
    if (zCollidersOverlap(c1, c2) === false) {return false;}
    if (only) {return only(char);}
    return true;
  });
});

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'startMapEvent', (o) => function (x, y, triggers, normal) {
  $gameTemp._mv3d_Q_getCharactersTriggerHeight = true;
  o.apply(this, arguments);
  $gameTemp._mv3d_Q_getCharactersTriggerHeight = false;
});

mz3d.Character.prototype.getPlatform = function (x = this.char._realX, y = this.char._realY, opts = {}) {
  const px = (x - 0.5) * QMovement.tileSize;
  const py = (y - 0.5) * QMovement.tileSize;
  const collider = this.char.collider();

  const x1 = (px + collider._offset.x + 1) / QMovement.tileSize;
  const y1 = (py + collider._offset.y + 1) / QMovement.tileSize;
  const x2 = (px + collider._offset.x + collider.width - 1) / QMovement.tileSize;
  const y2 = (py + collider._offset.y + collider.height - 1) / QMovement.tileSize;

  const platform = [
  //mv3d.getPlatformForCharacter(this,x,y),
  mz3d.getPlatformForCharacter(this, x1, y1, opts),
  mz3d.getPlatformForCharacter(this, x2, y1, opts),
  mz3d.getPlatformForCharacter(this, x2, y2, opts),
  mz3d.getPlatformForCharacter(this, x1, y2, opts)].
  reduce((a, b) => a.z2 >= b.z2 ? a : b);
  return platform;
};

mz3d.getEventsAt = function (x, y) {
  let events;
  try {
    events = ColliderManager._characterGrid[Math.round(x)][Math.round(y)];
  } catch (err) {
    return [];
  }
  if (!events) {return [];}
  return events.filter((event) => {
    if (!(event instanceof Game_Event) || event.isThrough()) {return false;}
    return true;
  });
};

mz3d.setDestination = function (x, y) {
  $gameTemp.setPixelDestination(Math.round(x * $gameMap.tileWidth()), Math.round(y * $gameMap.tileHeight()));
};

const _clearMouseMove = Game_Player.prototype.clearMouseMove;
Game_Player.prototype.clearMouseMove = function () {
  _clearMouseMove.apply(this, arguments);
  if (this._pathfind) {
    this.clearPathfind();
  }
};


const _QdiagMap = {
  1: [4, 2], 3: [6, 2],
  7: [4, 8], 9: [6, 8] };

const _QMoveVH = (o) => function (dir) {
  if ($gameMap.offGrid()) {
    this.mv3d_QMoveRadian(dir);
    return;
  }
  dir = mz3d.transformDirection(dir);
  if (dir % 2) {
    const diag = _QdiagMap[dir];
    this.moveDiagonally(diag[0], diag[1]);
  } else {
    this.moveStraight(dir);
  }

};
(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'moveInputHorizontal', _QMoveVH);
(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'moveInputVertical', _QMoveVH);
(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'moveInputDiagonal', _QMoveVH);

Game_Player.prototype.mv3d_QMoveRadian = function (dir, dist = this.moveTiles()) {
  this.moveRadian(-(0,_util__WEBPACK_IMPORTED_MODULE_0__.degtorad)(mz3d.blendCameraYaw.currentValue() + 90 + mz3d.dirToYaw(dir)), dist);
  //this.mv3d_setDirection(mv3d.transformDirection(dir));
};

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Character.prototype, 'moveRadian', (o) => function (radian, dist) {
  o.apply(this, arguments);
  const d = mz3d.yawToDir((0,_util__WEBPACK_IMPORTED_MODULE_0__.radtodeg)(-radian) - 90, true);
  this.mv3d_setDirection(d);
});

(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Character.prototype, 'moveDiagonally', (o) => function (h, v) {
  o.apply(this, arguments);
  const d = (0,_util__WEBPACK_IMPORTED_MODULE_0__.hvtodir)(h, v);
  this.mv3d_setDirection(d);
});

if (Game_Follower.prototype.updateMoveList)
(0,_util__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Follower.prototype, 'updateMoveList', (o) => function () {
  const move = this._moveList[0];
  o.apply(this, arguments);
  if (!move) {return;}
  this.mv3d_setDirection(move[3]);
});

/***/ }),

/***/ "./src/plugin_support/movement/movement_main.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/util.js");
const mz3d = window.mz3d;


Object.assign(mz3d, {
  vehicleObstructed(vehicle, ...args) {
    return vehicleObstructed.apply(vehicle, args);
  },
  tileCollision(char, x, y, useStairThresh = false, useTargetZ = false) {
    if (!(char instanceof mz3d.Character)) {if (!char.mv3d_sprite) {return false;}char = char.mv3d_sprite;}
    const z = typeof useTargetZ === 'number' ? useTargetZ :
    useTargetZ ? char.getTargetElevation(x, y) : char.z;
    const cc = char.getCollisionHeight(z);
    const tcs = this.getCollisionHeights(x, y);
    if (useStairThresh == 2) {cc.z1 += mz3d.STAIR_THRESH;cc.z2 += mz3d.STAIR_THRESH;}
    for (const tc of tcs) {
      if (cc.z1 < tc.z2 && cc.z2 > tc.z1) {
        if (useStairThresh == 1 && mz3d.STAIR_THRESH) {return this.tileCollision(char, x, y, 2, useTargetZ);}
        return true;
      }
    }
    return false;
  },
  charCollision(char1, char2, useStairThresh = false, useTargetZ1 = false, useTargetZ2 = useTargetZ1, triggerMode = false) {
    if (!(char1 instanceof mz3d.Character)) {if (!char1.mv3d_sprite) {return false;}char1 = char1.mv3d_sprite;}
    if (!(char2 instanceof mz3d.Character)) {if (!char2.mv3d_sprite) {return false;}char2 = char2.mv3d_sprite;}
    if (!triggerMode && (!char1.char._mv3d_hasCollide() || !char2.char._mv3d_hasCollide())) {return false;}
    const c1z = typeof useTargetZ1 === 'number' ? useTargetZ1 : useTargetZ1 ? char1.getTargetElevation(char2.x, char2.y) : char1.z;
    const c2z = typeof useTargetZ2 === 'number' ? useTargetZ2 : useTargetZ2 ? char2.targetElevation : char2.z;
    const cc1 = char1.getCollisionHeight(c1z);
    const cc2 = triggerMode ? char2.getTriggerHeight(c2z) : char2.getCollisionHeight(c2z);
    if (useStairThresh == 2) {cc1.z1 += mz3d.STAIR_THRESH;cc1.z2 += mz3d.STAIR_THRESH;}
    if (!triggerMode && cc1.z1 < cc2.z2 && cc1.z2 > cc2.z1 || triggerMode && cc1.z1 <= cc2.z2 && cc1.z2 >= cc2.z1) {
      if (useStairThresh == 1 && mz3d.STAIR_THRESH) {return this.charCollision(char1, char2, 2, useTargetZ1, useTargetZ2);}
      return true;
    }
    return false;
  },
  getPlatformFloatForCharacter(char, x, y, opts = {}) {
    if (!(char instanceof mz3d.Character)) {if (!char.mv3d_sprite) {return 0;}char = char.mv3d_sprite;}
    let z = mz3d.getPlatformForCharacter(char, x, y, opts).z2;
    if (char.hasFloat) {
      const cHeight = char.getCHeight();
      z += mz3d.getFloatHeight(x, y, char.z + Math.max(cHeight, mz3d.STAIR_THRESH), mz3d.STAIR_THRESH >= cHeight);
    }
    return z;
  },
  getPlatformForCharacter(char, x, y, opts = {}) {
    if (!(char instanceof mz3d.Character)) {if (!char.mv3d_sprite) {return false;}char = char.mv3d_sprite;}
    const cHeight = char.getCHeight();
    const useStairThresh = mz3d.STAIR_THRESH >= cHeight;
    Object.assign(opts, { char: char, gte: useStairThresh });
    return this.getPlatformAtLocation(x, y, char.z + Math.max(cHeight, mz3d.STAIR_THRESH), opts);
  },
  getPlatformAtLocation(x, y, z, opts = {}) {
    const char = opts.char;
    //if(!('onlyPlatforms' in opts)){ opts.onlyPlatforms=true; }
    const cs = this.getCollisionHeights(x, y, opts);
    cs.push(...mz3d.getEventsAt(x, y).
    filter((event) => {
      if (!(event.mv3d_sprite && event._mv3d_isPlatform() && event._mv3d_hasCollide() && event.mv3d_sprite.visible)) {return false;}
      if (char) {
        if (char.char === event || event.isMoving()) {return false;}
        let pc = event.mv3d_sprite;
        while (pc = pc.platformChar) {
          if (pc === char || pc === event.mv3d_sprite) {return false;}
        }
      }
      return true;
    }).
    map((event) => event.mv3d_sprite.getCollisionHeight()));

    let closest = cs[0];
    for (const c of cs) {
      if (c.z2 > closest.z2 && (opts.gte ? c.z2 <= z : c.z2 < z)) {
        closest = c;
      }
    }
    return closest;
  },

  getEventsAt(x, y) {
    return $gameMap.eventsXyNt(Math.round(x), Math.round(y));
  },

  isRampAt(x, y, z) {
    const tileData = this.getTileData(x, y);
    if (tileData.pass === mz3d.enumPassage.THROUGH) {return false;}
    let height = 0;
    for (let l = 0; l < 4; ++l) {
      height += this.getTileFringe(x, y, l);
      height += this.getTileHeight(x, y, l);
      const conf = this.getTileConfig(tileData[l], x, y, l);
      if (conf.shape !== this.enumShapes.SLOPE) {continue;}
      let slopeHeight = conf.slopeHeight || 1;
      const slopeBase = height - slopeHeight;
      const slopeData = this.getSlopeDirection(x, y, l, true);
      if (slopeData.diag && !slopeData.inner && !slopeData.outer) {slopeHeight *= 2;}
      if (z >= slopeBase && z <= slopeBase + slopeHeight) {
        return { id: tileData[l], x, y, l, conf, z1: slopeBase, z2: slopeBase + slopeHeight, data: slopeData };
      }
    }
    return false;
  },

  getRampData(x, y, l, conf = null) {
    const tileId = mz3d.getTileId(x, y, l);
    if (!conf) {conf = this.getTileConfig(tileId, x, y, l);}
    if (conf.shape !== this.enumShapes.SLOPE) {return false;}
    const height = mz3d.getStackHeight(x, y, l);
    let slopeHeight = conf.slopeHeight || 1;
    const slopeBase = height - slopeHeight;
    const slopeData = this.getSlopeDirection(x, y, l, true);
    if (slopeData.diag && !slopeData.inner && !slopeData.outer) {slopeHeight *= 2;}
    return { id: tileId, x, y, l, conf, z1: slopeBase, z2: slopeBase + slopeHeight, data: slopeData };
  },

  canPassRamp(d, slope, opts = {}) {
    // d is the movement direction
    // return true for invalid directions
    if (d === 5 || d <= 0 || d >= 10) {return true;}

    /*
    const {x,y,l} = slope;
    const vec = dirtovec(d);
    const step = 1/3;
    let sx=x+vec.x*step, sy=y+vec.y*step, sl=l;
    let sz = mv3d.getSlopeHeight(x,y,l);
    let currentTile = {x,y,slope,slopeHeight:slope.conf.slopeHeight||1};
    // step through increments measuring heights
    for(let p=step; p<=1; p+=step){
    	const rx = Math.round(sx), ry = Math.round(sy);
    	if(currentTile.x!==rx||currentTile.y!==ry){
    		currentTile={x:rx,y:ry};
    		const checkHeight = sz + (currentTile.slopeHeight)*step;
    		currentTile.slope = this.isRampAt(currentTile.x,currentTile.y,checkHeight);
    		currentTile.slopeHeight = currentTile.slope?(currentTile.slope.conf.slopeHeight||1):0;
    		if(!currentTile.slope){ currentTile.height = mv3d.getPlatformAtLocation(currentTile.x,currentTile.y,checkHeight).z2; }
    	}
    	let h = currentTile.slope?mv3d.getSlopeHeight(sx,sy,sl):currentTile.height;
    	console.log(p/step,h-sz);
    			sx+=vec.x*step;
    	sy+=vec.y*step;
    	sz=h;
    }
    		return true;
    */




    // get slope direction
    const slopeData = slope.data;
    const { dir: sd } = slopeData;
    // get position at movement direction
    const x2 = $gameMap.roundXWithDirection(slope.x, d);
    const y2 = $gameMap.roundYWithDirection(slope.y, d);

    const sh = _getSlopeEdgeHeight(d, slope, slopeData);
    if (sh === false) return false;

    // check for second ramp
    const slope2 = this.isRampAt(x2, y2, sh);
    if (slope2) {
      const slopeData2 = slope2.data;
      const sh2 = _getSlopeEdgeHeight(10 - d, slope2, slopeData2);
      if (sh2 === false) return false;
      return Math.abs(sh - sh2) <= mz3d.STAIR_THRESH;
    }

    // get height at movement direction 
    const dh = this.getPlatformAtLocation(x2, y2, (opts.z ?? sh) + mz3d.STAIR_THRESH).z2;
    // compare slope's height to destination height
    return Math.abs(dh - sh) <= mz3d.STAIR_THRESH;



    /*
    return true;
    		if(d===5||d<=0||d>=10){ return true; }
    // get direction of slope
    const slopeData = mv3d.getSlopeDirection(slope.x,slope.y,slope.l,true);
    const {dir:sd} = slopeData;
    // get position moving to/from
    const x2 = $gameMap.roundXWithDirection(slope.x,d);
    const y2 = $gameMap.roundYWithDirection(slope.y,d);
    // check for second ramp
    const slope2 = this.isRampAt(x2,y2,sd===d?slope.z1:sd===10-d?slope.z2:(slope.z1+slope.z2)/2);
    if(slope2){
    	const  {dir:sd2} = mv3d.getSlopeDirection(x2,y2,slope2.l,true);
    	if(sd!==d&&sd!==10-d){
    		if(sd===sd2&&slope.z1===slope2.z1&&slope.z2===slope2.z2){ return true; }
    		return false;
    	}
    	return sd===sd2 && (sd===d?(slope.z1===slope2.z2):(slope.z2===slope2.z1));
    }
    if(slopeData.diag){
    	const xd = dirtoh(sd);
    	const yd = dirtov(sd);
    }else{
    	if(sd!==d&&sd!==10-d){ return false; }
    }
    const dh = this.getPlatformAtLocation(x2,y2, (opts.z!=null?opts.z:sd===d?slope.z1:slope.z2)+mv3d.STAIR_THRESH ).z2;
    return Math.abs(dh-(sd===d?slope.z1:slope.z2))<=mv3d.STAIR_THRESH;
    */

  } });


function _getSlopeEdgeHeight(d, slope, slopeData) {
  const { dir: sd } = slopeData;
  // determine vertical direction
  let zDir;
  if (slopeData.diag) {
    const xd = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.dirtoh)(sd);
    const yd = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.dirtov)(sd);
    if (xd === d || yd === d) {zDir = -1;} else
    if (xd === 10 - d || yd === 10 - d) {zDir = 1;} else
    {zDir = 0;}
  } else {
    zDir = sd === d ? -1 : sd === 10 - d ? 1 : 0;
  }

  // if zDir is zero then we can't move in this direction.
  //if(!zDir) return false;

  // get slopes's height at tile edge
  let { z1, z2 } = slope;
  if (slopeData.diag) {
    const zh = z2 - z1;
    if (slopeData.outer) {
      z2 = z1 + zh / 2;
    } else if (slopeData.inner) {
      z1 = z1 + zh / 2;
    } else {
      z2 = z1 + zh * 3 / 4;
      z1 = z1 + zh / 4;
    }
  }
  const sh = zDir < 0 ? z1 : zDir > 0 ? z2 : (z1 + z2) / 2;
  return sh;
}

Game_CharacterBase.prototype._mv3d_isFlying = function () {
  if (!this.mv3d_sprite) {return false;}
  return this.mv3d_sprite.blendElevation.currentValue() > 0 || this.mv3d_sprite.hasConfig('zlock') || !this.mv3d_sprite.getConfig('gravity', mz3d.GRAVITY);
};
Game_Vehicle.prototype._mv3d_isFlying = function () {
  return this.isAirship() || Game_CharacterBase.prototype._mv3d_isFlying.apply(this, arguments);
};
Game_Player.prototype._mv3d_isFlying = function () {
  if (this.isInVehicle() && this.vehicle().isAirship()) {return true;}
  return Game_CharacterBase.prototype._mv3d_isFlying.apply(this, arguments);
};

Game_CharacterBase.prototype._mv3d_isPlatform = function () {
  return this.mv3d_sprite && this.mv3d_sprite.getConfig('platform', mz3d.WALK_ON_EVENTS);
};

Game_CharacterBase.prototype._mv3d_hasCollide = function () {
  const sprite = this.mv3d_sprite;
  if (!sprite || sprite.getConfig('collide') === false) {return false;}
  return this._mv3d_isPlatform() || Boolean(sprite.getCHeight());
};

if (window.Imported && Imported.QMovement) {
  __webpack_require__("./src/plugin_support/movement/movement_Q.js");
} else if (PluginManager._scripts.includes("AltimitMovement") && Game_CharacterBase.prototype.moveVector) {
  __webpack_require__("./src/plugin_support/movement/movement_Altimit.js");
} else {
  __webpack_require__("./src/plugin_support/movement/movement_vanilla.js");
}

// jump
const _charBase_jump = Game_CharacterBase.prototype.jump;
Game_CharacterBase.prototype.jump = function (xPlus, yPlus) {
  if (mz3d.isDisabled()) {return _charBase_jump.apply(this, arguments);}
  this.mv3d_jumpHeightStart = this.z != null ? this.z : mz3d.getWalkHeight(this.x, this.y);
  this.mv3d_jumpHeightEnd = mz3d.getWalkHeight(this.x + xPlus, this.y + yPlus);
  _charBase_jump.apply(this, arguments);
};

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Map.prototype, 'allTiles', (o) => function (x, y) {
  return this.layeredTiles(x, y);
});

/***/ }),

/***/ "./src/plugin_support/movement/movement_vanilla.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/util.js");
const mz3d = window.mz3d;


const _characterBase_canPass = Game_CharacterBase.prototype.canPass;
Game_CharacterBase.prototype.canPass = function (x, y, d) {

  if (!_characterBase_canPass.apply(this, arguments)) {
    return false;
  }
  if (mz3d.isDisabled() || this.isDebugThrough() || this.isThrough()) {return true;}

  return true;
};

function charCollidesWithChars(char1, charlist, x, y) {
  return charlist.some((char2) => {
    const isPlatform = char2._mv3d_isPlatform();
    if (mz3d.WALK_OFF_EDGE && !isPlatform) {
      const platformHeight = mz3d.getPlatformForCharacter(char1, x, y).z2;
      if (mz3d.WALK_OFF_EDGE >= char1.z - platformHeight &&
      mz3d.charCollision(char1, char2, false, platformHeight)) {return true;}
    }
    const targetElevation = char1.mv3d_sprite.getTargetElevation(char2.x, char2.y);
    const useTargetZ = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.unround)(Math.abs(char1.z - targetElevation)) < mz3d.STAIR_THRESH;
    return mz3d.charCollision(char1, char2, isPlatform, useTargetZ);
  });
}

const _isCollidedWithEvents = (o) => function (x, y) {
  return charCollidesWithChars(this, $gameMap.eventsXyNt(x, y), x, y);
};

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_CharacterBase.prototype, 'isCollidedWithEvents', _isCollidedWithEvents);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Event.prototype, 'isCollidedWithEvents', _isCollidedWithEvents);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Event.prototype, 'isCollidedWithPlayerCharacters', (o) => function (x, y) {
  if ($gamePlayer.isThrough()) {return false;}
  const chars = [$gamePlayer, ...$gamePlayer.followers()._data.filter((f) => f.isVisible() && f.mv3d_sprite && f.mv3d_sprite.visible)].
  filter((char) => char.pos(x, y));
  return charCollidesWithChars(this, chars, x, y);
});

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_CharacterBase.prototype, 'isCollidedWithVehicles', (o) => function (x, y) {
  const boat = $gameMap.boat(),ship = $gameMap.ship();
  return boat.posNt(x, y) && mz3d.charCollision(this, boat, boat._mv3d_isPlatform(), true) || ship.posNt(x, y) && mz3d.charCollision(this, ship, ship._mv3d_isPlatform(), true);
});

const _isMapPassable = (o) => function (x, y, d) {
  const sprite = this.mv3d_sprite;
  if (!sprite) {return o.apply(this, arguments);}

  $gameTemp._mv3d_collision_char = sprite;
  let collided = !o.apply(this, arguments);
  delete $gameTemp._mv3d_collision_char;
  if (collided) {return false;}


  let slope;
  if (slope = mz3d.isRampAt(x, y, sprite.z)) {
    if (mz3d.canPassRamp(d, slope)) {return true;}
  }

  var x2 = $gameMap.roundXWithDirection(x, d);
  var y2 = $gameMap.roundYWithDirection(y, d);

  if (slope = mz3d.isRampAt(x2, y2, sprite.z)) {
    if (mz3d.canPassRamp(10 - d, slope, { z: sprite.z })) {return true;}
  }

  if (this._mv3d_isFlying()) {
    if (!mz3d.allowGlide && mz3d.tileCollision(this, x2, y2, true, sprite.targetElevation) || mz3d.tileCollision(this, x2, y2, true, false)) {return false;}
  } else {
    if (mz3d.tileCollision(this, x2, y2, true, false)) {return false;}

    if (sprite.falling) {return false;}
    if (mz3d.WALK_OFF_EDGE < Infinity) {
      const platformz = mz3d.getPlatformFloatForCharacter(this, x2, y2);
      if (mz3d.WALK_OFF_EDGE < sprite.targetElevation - platformz &&
      (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.unround)(Math.abs(platformz - sprite.targetElevation)) > mz3d.STAIR_THRESH) {
        return false;
      }
    }
  }
  return true;
};

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_CharacterBase.prototype, 'isMapPassable', _isMapPassable);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Vehicle.prototype, 'isMapPassable', _isMapPassable);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'startMapEvent', (o) => function (x, y, triggers, normal) {
  if ($gameMap.isEventRunning()) {return;}
  $gameMap.eventsXy(x, y).
  filter((event) => mz3d.charCollision(this, event, false, false, false, true)).
  forEach((event) => {
    if (event.isTriggerIn(triggers) && event.isNormalPriority() === normal) {
      event.start();
    }
  });
});

const _checkPassage = Game_Map.prototype.checkPassage;
Game_Map.prototype.checkPassage = function (x, y, bit) {
  if (!('_mv3d_collision_char' in $gameTemp)) {
    return _checkPassage.apply(this, arguments);
  }
  const char = $gameTemp._mv3d_collision_char;
  const cHeight = char.getCHeight();
  const z = char.z + Math.max(cHeight, mz3d.STAIR_THRESH);
  const platform = mz3d.getPlatformForCharacter(char, x, y);
  if (platform.char) {return true;}
  var flags = this.tilesetFlags();
  //var tiles = this.allTiles(x, y);
  const layers = mz3d.getTileLayers(x, y, z, mz3d.STAIR_THRESH >= cHeight);
  const tiles = mz3d.getTileData(x, y);
  for (var i = layers.length - 1; i >= 0; --i) {
    const l = layers[i];
    if (bit & 0x0f) {
      const conf = mz3d.getTileConfig(x, y, l);
      if ('pass' in conf) {
        //const passage = mv3d.getTilePassage(x,y,l);
        if (conf.pass === mz3d.enumPassage.THROUGH) {continue;}
        if (conf.pass === mz3d.enumPassage.FLOOR) {return true;}
        if (conf.pass === mz3d.enumPassage.WALL) {return false;}
      }
    }
    const flag = flags[tiles[l]];
    if ((flag & 0x10) !== 0) // [*] No effect on passage
      continue;
    if ((flag & bit) === 0) // [o] Passable
      return true;
    if ((flag & bit) === bit) // [x] Impassable
      return false;
  }
  return false;
};

const _dir8Condition = () => !mz3d.isDisabled() || mz3d.DIR8MOVE && mz3d.DIR8_2D;

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'moveStraight', (o) => function (d) {
  if (!mz3d.DIR8MOVE) {return o.apply(this, arguments);}
  switch (d) {
    case 1:this.moveDiagonally(4, 2);break;
    case 3:this.moveDiagonally(6, 2);break;
    case 7:this.moveDiagonally(4, 8);break;
    case 9:this.moveDiagonally(6, 8);break;
    default:o.apply(this, arguments);}


}, _dir8Condition);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Character.prototype, 'moveDiagonally', (o) => function (h, v) {
  o.apply(this, arguments);

  let adjustDirection = false;

  if (this.isMovementSucceeded()) {
    adjustDirection = true;
  } else if (mz3d.DIR8SMART && !this.isDebugThrough()) {
    this.moveStraight(h);
    if (!this.isMovementSucceeded()) {
      this.moveStraight(v);
      if (!this.isMovementSucceeded()) {
        adjustDirection = true;
      }
    }
  } else {adjustDirection = true;}

  if (adjustDirection) {
    const d = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.hvtodir)(h, v);
    this.mv3d_setDirection(d);
  }

}, _dir8Condition);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_CharacterBase.prototype, 'canPassDiagonally', (o) => function (x, y, horz, vert) {
  if (this.isDebugThrough()) {return true;}
  if (this.mv3d_sprite) {
    const x2 = $gameMap.roundXWithDirection(x, horz);
    const y2 = $gameMap.roundYWithDirection(y, vert);
    const tzx = this.mv3d_sprite.getTargetElevation(x2, y);
    const tzy = this.mv3d_sprite.getTargetElevation(x, y2);
    if ((mz3d.tileCollision(this, x, y2, true, false) || mz3d.tileCollision(this, x2, y, true, false)) &&
    !mz3d.isRampAt(x2, y, tzx) && !mz3d.isRampAt(x, y2, tzy)) {
      return false;
    }
  }
  return o.apply(this, arguments);
});

const _dontSnapRealXY = (o) => function () {
  const realX = this._realX,realY = this._realY;
  o.apply(this, arguments);
  if (Math.abs(realX - this._realX) > 2 || Math.abs(realY - this._realY) > 2) {return;}
  this._realX = realX;this._realY = realY;
};
(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Follower.prototype, 'moveDiagonally', _dontSnapRealXY, _dir8Condition);
(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Follower.prototype, 'moveStraight', _dontSnapRealXY, _dir8Condition);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_CharacterBase.prototype, 'distancePerFrame', (o) => function () {
  const dist = o.apply(this, arguments);
  if (this.mv3d_data.direction % 2) {
    return dist * Math.SQRT1_2;
  }
  return dist;
}, _dir8Condition);

// triggering

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Player.prototype, 'checkEventTriggerThere', (o) => function (triggers) {
  if (!this.canStartLocalEvents()) {return;}
  const dir = this.mv3d_direction();
  if (dir % 2 === 0) {return o.apply(this, arguments);}
  const horz = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.dirtoh)(dir),vert = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.dirtov)(dir);
  const x2 = $gameMap.roundXWithDirection(this.x, horz);
  const y2 = $gameMap.roundYWithDirection(this.y, vert);
  this.startMapEvent(x2, y2, triggers, true);
  if (!$gameMap.isAnyEventStarting()) {
    return o.apply(this, arguments);
  }
}, _dir8Condition);


// VEHICLES

const _airship_land_ok = Game_Map.prototype.isAirshipLandOk;
Game_Map.prototype.isAirshipLandOk = function (x, y) {
  if (mz3d.isDisabled()) {return _airship_land_ok.apply(this, arguments);}
  if (mz3d.AIRSHIP_SETTINGS.bushLanding) {
    return this.checkPassage(x, y, 0x0f);
  } else {
    return _airship_land_ok.apply(this, arguments);
  }

};

const _player_updateVehicleGetOn = Game_Player.prototype.updateVehicleGetOn;
Game_Player.prototype.updateVehicleGetOn = function () {
  if (mz3d.isDisabled()) {return _player_updateVehicleGetOn.apply(this, arguments);}
  const vehicle = this.vehicle();
  //const speed = mv3d.loadData(`${vehicle._type}_speed`,vehicle._moveSpeed);
  //vehicle.setMoveSpeed(speed);
  _player_updateVehicleGetOn.apply(this, arguments);
  this.setThrough(false);
};

// get on off vehicle

const _getOnVehicle = Game_Player.prototype.getOnVehicle;
Game_Player.prototype.getOnVehicle = function () {
  if (mz3d.isDisabled()) {return _getOnVehicle.apply(this, arguments);}
  var d = this.direction();
  var x1 = Math.round(this.x);
  var y1 = Math.round(this.y);
  var x2 = $gameMap.roundXWithDirection(x1, d);
  var y2 = $gameMap.roundYWithDirection(y1, d);

  if ($gameMap.airship().pos(x1, y1) && mz3d.charCollision(this, $gameMap.airship(), false, false, false, true)) {
    this._vehicleType = 'airship';
  } else if ($gameMap.ship().pos(x2, y2) && mz3d.charCollision(this, $gameMap.ship())) {
    this._vehicleType = 'ship';
  } else if ($gameMap.boat().pos(x2, y2) && mz3d.charCollision(this, $gameMap.boat())) {
    this._vehicleType = 'boat';
  }
  if (this.isInVehicle()) {
    this._vehicleGettingOn = true;
    if (!this.isInAirship()) {
      this.forceMoveForward();
    }
    this.gatherFollowers();
  }
  return this._vehicleGettingOn;
};


(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Vehicle.prototype, 'isLandOk', (o) => function (x, y, d) {
  $gameTemp._mv3d_collision_char = $gamePlayer.mv3d_sprite;
  let landOk = o.apply(this, arguments);
  delete $gameTemp._mv3d_collision_char;
  if (this.isAirship()) {return landOk;}
  var x2 = $gameMap.roundXWithDirection(x, d);
  var y2 = $gameMap.roundYWithDirection(y, d);
  const platform = mz3d.getPlatformForCharacter($gamePlayer, x2, y2);
  if (platform.char) {landOk = true;}
  const diff = Math.abs(platform.z2 - this.z);
  return landOk && diff < Math.max($gamePlayer.mv3d_sprite.getCHeight(), this.mv3d_sprite.getCHeight());
});

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Game_Event.prototype, 'checkEventTriggerTouch', (o) => function (x, y) {
  const sprite = this.mv3d_sprite,player = $gamePlayer.mv3d_sprite;
  if (sprite && player) {
    if (!mz3d.charCollision(sprite, player)) {return false;}
  }
  return o.apply(this, arguments);
});

/***/ }),

/***/ "./src/plugin_support/options/options_enabled.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/util.js");
const mz3d = window.mz3d;



const _option_command_list = Window_Options.prototype.makeCommandList;
Window_Options.prototype.makeCommandList = function () {
  _option_command_list.apply(this, arguments);
  if (mz3d.ENABLE_3D_OPTIONS === mz3d.enumOptionModes.SUBMENU && Object.keys(mz3d.options).length) {
    this.addCommand("3D Options", 'mv3d-options');
  } else if (mz3d.ENABLE_3D_OPTIONS === mz3d.enumOptionModes.ENABLE) {
    for (const key in mz3d.options) {
      this.addCommand(mz3d.options[key].name, key);
    }
  }
};

const _option_status_text = Window_Options.prototype.statusText;
Window_Options.prototype.statusText = function (index) {
  const symbol = this.commandSymbol(index);
  const value = this.getConfigValue(symbol);
  if (symbol === 'mv3d-options') {return '';}
  return _option_status_text.apply(this, arguments);
};

Object.defineProperty(ConfigManager, 'mv3d-options', {
  get() {return undefined;},
  set(v) {SceneManager.push(Scene_3D_Options);},
  configurable: true,
  enumerable: false });


const _config_makeData = ConfigManager.makeData;
ConfigManager.makeData = function () {
  const config = _config_makeData.apply(this, arguments);
  Object.assign(config, mz3d['option-store']);
  return config;
};
const _config_applyData = ConfigManager.applyData;
ConfigManager.applyData = function (config) {
  _config_applyData.apply(this, arguments);

  const applyOptions = () => {
    for (const key in mz3d.options) {
      try {
        if (key in config) {
          mz3d['option-store'][key] = config[key];
          mz3d.options[key].apply(config[key]);
        } else if ('default' in mz3d.options[key]) {
          mz3d['option-store'][key] = mz3d.options[key].default;
          mz3d.options[key].apply(mz3d.options[key].default);
        }
      } catch (err) {
        console.error('Error applying option', key, err);
      }
    }
    mz3d.updateParameters();
  };

  if (mz3d.setupComplete) {
    applyOptions();
  } else {
    mz3d.util.sleepUntil(() => mz3d.setupComplete).then(applyOptions);
  }
};



class Scene_3D_Options extends Scene_Options {
  createOptionsWindow() {
    this._optionsWindow = new Window_3D_Options();
    this._optionsWindow.setHandler('cancel', this.popScene.bind(this));
    this.addWindow(this._optionsWindow);
  }
  terminate() {
    super.terminate();
    mz3d.updateParameters();
  }}


class Window_3D_Options extends Window_Options {
  makeCommandList() {
    for (const key in mz3d.options) {
      this.addCommand(mz3d.options[key].name, key);
    }
  }}


if (mz3d.ENABLE_3D_OPTIONS === 1) (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Scene_Options.prototype, 'terminate', (o) => function () {
  o.apply(this, arguments);
  mz3d.updateParameters();
}, true);

Window_Options.prototype._is_mv3d_option = function (symbol) {
  return symbol in mz3d.options;
};

Window_Options.prototype._mv3d_cursor = function (wrap, direction) {
  const index = this.index();
  const symbol = this.commandSymbol(index);
  let value = this.getConfigValue(symbol);
  const option = mz3d.options[symbol];
  if (!option) {return;}
  if (option.type === 'bool') {
    this.changeValue(symbol, direction > 0);
  } else {
    const min = option.min || 0;
    const max = option.values ? option.values.length - 1 : option.max || 1;
    value += (option.increment || 1) * direction;
    if (wrap && option.wrap || wrap === 'ok') {
      if (value > max) {value = min;}
      if (value < min) {value = max;}
    } else {
      value = value.clamp(min, max);
    }
    this.changeValue(symbol, value);
  }
};


(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Window_Options.prototype, 'statusText', (o) => function (index) {
  const symbol = this.commandSymbol(index);
  if (!this._is_mv3d_option(symbol)) {return o.apply(this, arguments);}
  const value = this.getConfigValue(symbol);
  const option = mz3d.options[symbol];
  if (option.type === 'bool') {
    return this.booleanStatusText(value);
  } else if (option.values) {
    return option.values[value];
  }
  return String(value);
}, true);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Window_Options.prototype, 'setConfigValue', (o) => function (symbol, value) {
  if (!this._is_mv3d_option(symbol)) {return o.apply(this, arguments);}
  mz3d['option-store'][symbol] = value;
  const option = mz3d.options[symbol];
  if (option.apply) {option.apply(value);}
}, true);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Window_Options.prototype, 'getConfigValue', (o) => function (symbol) {
  if (!this._is_mv3d_option(symbol)) {return o.apply(this, arguments);}
  const option = mz3d.options[symbol];
  let value = mz3d['option-store'][symbol];
  if (value == null) {value = option.default || option.min || 0;}
  return value;
}, true);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Window_Options.prototype, 'cursorLeft', (o) => function (wrap) {
  const symbol = this.commandSymbol(this.index());
  if (this._is_mv3d_option(symbol)) {
    return this._mv3d_cursor(wrap, -1);
  } else {
    return o.apply(this, arguments);
  }
}, true);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Window_Options.prototype, 'cursorRight', (o) => function (wrap) {
  const symbol = this.commandSymbol(this.index());
  if (this._is_mv3d_option(symbol)) {
    return this._mv3d_cursor(wrap, 1);
  } else {
    return o.apply(this, arguments);
  }
}, true);

(0,_util_js__WEBPACK_IMPORTED_MODULE_0__.override)(Window_Options.prototype, 'processOk', (o) => function () {
  const index = this.index();
  const symbol = this.commandSymbol(index);
  if (!this._is_mv3d_option(symbol)) {
    return o.apply(this, arguments);
  }
  let value = this.getConfigValue(symbol);
  const option = mz3d.options[symbol];
  if (option.type === 'bool') {
    this.changeValue(symbol, !value);
  } else {
    this._mv3d_cursor('ok', 1);
  }
}, true);

/***/ }),

/***/ "./src/plugin_support/options/options_main.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

const mz3d = window.mz3d;

mz3d['option-store'] = {};

mz3d.options = {};

if (mz3d.OPTION_RENDER_DIST) mz3d.options['mv3d-renderDist'] = {
  name: mz3d.OPTION_NAME_RENDER_DIST,
  min: mz3d.OPTION_RENDER_DIST_MIN, max: mz3d.OPTION_RENDER_DIST_MAX,
  increment: 5,
  wrap: false,
  apply(v) {mz3d.RENDER_DIST = v;},
  default: mz3d.RENDER_DIST };


if (mz3d.OPTION_FOV) mz3d.options['mv3d-fov'] = {
  name: mz3d.OPTION_NAME_FOV,
  min: mz3d.OPTION_FOV_MIN, max: mz3d.OPTION_FOV_MAX,
  increment: 5,
  apply(v) {mz3d.FOV = v;},
  default: mz3d.FOV };


if (mz3d.OPTION_MIPMAP) mz3d.options['mv3d-mipmap'] = {
  name: mz3d.OPTION_NAME_MIPMAP,
  type: 'bool',
  apply(v) {mz3d.MIPMAP = v;mz3d.needReloadMap = true;},
  default: mz3d.MIPMAP };


mz3d.invertY = false;
if (mz3d.OPTION_INVERTY) mz3d.options['mv3d-inverty'] = {
  name: mz3d.OPTION_NAME_INVERTY,
  type: 'bool',
  apply(v) {mz3d.invertY = v;},
  default: false };


mz3d.lookSensitivity = 1.0;
if (mz3d.OPTION_LOOKSENSITIVITY) mz3d.options['mv3d-looksensitivity'] = {
  name: mz3d.OPTION_NAME_LOOKSENSITIVITY,
  min: 10, max: 400,
  increment: 10,
  wrap: false,
  apply(v) {mz3d.lookSensitivity = v / 100;},
  default: 100 };


if (mz3d.ENABLE_3D_OPTIONS) {
  __webpack_require__("./src/plugin_support/options/options_enabled.js");
}

/***/ }),

/***/ "./src/plugin_support/plugin_support.js":
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {


__webpack_require__("./src/plugin_support/options/options_main.js");
__webpack_require__("./src/plugin_support/movement/movement_main.js");

if (window.Imported && Imported.YEP_SaveCore) {
  const _onLoadSuccess = Scene_File.prototype.onLoadSuccess;
  Scene_File.prototype.onLoadSuccess = function () {
    _onLoadSuccess.apply(this, arguments);
    mz3d.needClearMap = true;
  };
}

/***/ }),

/***/ "./src/premium/views.js":
/***/ (() => {

const mz3d = window.mz3d;

class View {
  constructor(canvas, camera) {
    let options;
    if (!(canvas instanceof HTMLCanvasElement)) {
      options = canvas;
      if (!camera) {camera = options.camera;}
      canvas = options.canvas;
      this._staticSize = Boolean(this.canvas && (this.canvas.width || this.canvas.height) || options.width || options.height);
      if (!canvas) {canvas = document.createElement('canvas');}
      if (!canvas.width) {
        canvas.width = options.width || Graphics.width;
      }
      if (!canvas.height) {
        canvas.height = options.height || Graphics.height;
      }
    } else {
      options = {};
      this._staticSize = true;
    }
    this.canvas = canvas;
    this.camera = camera;
    //this.view=mv3d.engine.registerView(canvas,camera);
    this.texture = PIXI.Texture.from(canvas);
    this.texture.baseTexture.scaleMode = PIXI.SCALE_MODES.NEAREST;
    this.sprite = new PIXI.Sprite(this.texture);
    this.sprite.destroy = () => {};
    this.index = options.index || 0;
    View.list.push(this);
    View.sort();
    this.enabled = true;
    this.needsRender = null;
  }
  updateSize() {
    this.canvas.width = mz3d.canvas.width;
    this.canvas.height = mz3d.canvas.height;
    this.sprite.scale.copy(mz3d.pixiSprite.scale);
  }
  disable() {
    this.enabled = false;
    this.sprite.visible = false;
  }
  enable() {
    this.enabled = true;
    this.sprite.visible = true;
    this.requestRender();
  }
  requestRender(n = true) {
    if (this.needsRender >= n) {return;}
    this.needsRender = n;
  }
  static sort() {
    View.list.
    sort(View._sortAbs).
    sort(View._sortNeg);
  }
  static _sortFunction(v1, v2) {return Math.abs(v2) - Math.abs(v1);}

  get scene() {
    return this.camera._scene || mz3d.scene;
  }}
;
View._sortAbs = (v1, v2) => Math.abs(v2.index) - Math.abs(v1.index);
View._sortNeg = (v1, v2) => v1.index < 0 && v2.index >= 0 ? -1 : 0;
View.list = [];
mz3d.View = View;

const _createTilemap = Spriteset_Map.prototype.createTilemap;
Spriteset_Map.prototype.createTilemap = function () {
  mz3d.callFeatures('createViews');
  _createTilemap.apply(this, arguments);
  const container = mz3d.viewContainer;
  const index = container.children.indexOf(mz3d.pixiSprite);
  for (view of View.list) {
    container.addChildAt(view.sprite, view.index < 0 ? index : index + 1);
  }
};

mz3d.renderViews = function () {
  if (!View.list.length) {return;}
  if (!mz3d.pixiSprite.transform || !mz3d.is3D()) {return;}
  const width = mz3d.canvas.width;
  const height = mz3d.canvas.height;
  for (const view of View.list) {
    if (!view.enabled || view.needsRender == false) {continue;}

    const scene = view.scene;

    const activeCamera = scene.activeCamera;
    const clearColor = scene.clearColor.clone();
    scene.clearColor.set(0, 0, 0, 0);

    const canvas = view.canvas;
    const context = canvas.getContext("2d");
    if (!context) {continue;}
    if (view.needsRender) {
      if (view.needsRender > 1) {
        --view.needsRender;
      } else {
        view.needsRender = false;
      }
    }
    view.updateSize();
    const camera = view.camera || activeCamera;
    scene.activeCamera = camera;
    mz3d.canvas.width = canvas.width;
    mz3d.canvas.height = canvas.height;

    scene.render();
    context.clearRect(0, 0, canvas.width, canvas.height);
    context.drawImage(mz3d.canvas, 0, 0);
    view.texture.update();

    scene.activeCamera = activeCamera;
    scene.clearColor.copyFrom(clearColor);
  }
  mz3d.canvas.width = width;
  mz3d.canvas.height = height;

};

const _render = mz3d.render;
mz3d.render = function () {
  mz3d.renderViews();
  _render.apply(this, arguments);
};

/***/ }),

/***/ "./src/util.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "DefaultMap": () => (/* binding */ DefaultMap),
  "MathExpression": () => (/* binding */ MathExpression),
  "PI": () => (/* binding */ PI),
  "PI2": () => (/* binding */ PI2),
  "ProxyConf": () => (/* binding */ ProxyConf),
  "XAxis": () => (/* binding */ XAxis),
  "YAxis": () => (/* binding */ YAxis),
  "ZAxis": () => (/* binding */ ZAxis),
  "_default_scope": () => (/* binding */ _default_scope),
  "access": () => (/* binding */ access),
  "assign": () => (/* binding */ util_assign),
  "assignCopies": () => (/* binding */ assignCopies),
  "booleanNumber": () => (/* binding */ booleanNumber),
  "booleanString": () => (/* binding */ booleanString),
  "box": () => (/* binding */ box),
  "cos": () => (/* binding */ util_cos),
  "degDiff": () => (/* binding */ degDiff),
  "degtorad": () => (/* binding */ degtorad),
  "deprecated": () => (/* binding */ deprecated),
  "dirtoh": () => (/* binding */ dirtoh),
  "dirtov": () => (/* binding */ dirtov),
  "dirtovec": () => (/* binding */ dirtovec),
  "falseString": () => (/* binding */ falseString),
  "file": () => (/* binding */ file),
  "filename": () => (/* binding */ filename),
  "flattenHierarchy": () => (/* binding */ flattenHierarchy),
  "foldername": () => (/* binding */ foldername),
  "hashInt": () => (/* binding */ hashInt),
  "hashRand": () => (/* binding */ hashRand),
  "hexNumber": () => (/* binding */ hexNumber),
  "hvtodir": () => (/* binding */ hvtodir),
  "identity": () => (/* binding */ util_identity),
  "interpolateValue": () => (/* binding */ interpolateValue),
  "isBoolean": () => (/* binding */ util_isBoolean),
  "lerp": () => (/* binding */ lerp),
  "lerpValue": () => (/* binding */ lerpValue),
  "makeColor": () => (/* binding */ makeColor),
  "math": () => (/* binding */ util_math),
  "minmax": () => (/* binding */ minmax),
  "optimalFrustrumHeight": () => (/* binding */ optimalFrustrumHeight),
  "optimalFrustrumWidth": () => (/* binding */ optimalFrustrumWidth),
  "overlapSphereBox": () => (/* binding */ overlapSphereBox),
  "overload": () => (/* binding */ overload),
  "override": () => (/* binding */ override),
  "parseVector2": () => (/* binding */ parseVector2),
  "parseVector3": () => (/* binding */ parseVector3),
  "parsing": () => (/* binding */ parsing),
  "pointtodeg": () => (/* binding */ pointtodeg),
  "pointtorad": () => (/* binding */ pointtorad),
  "radtodeg": () => (/* binding */ radtodeg),
  "relativeBlend": () => (/* binding */ relativeBlend),
  "relativeNumber": () => (/* binding */ relativeNumber),
  "sin": () => (/* binding */ util_sin),
  "sleep": () => (/* binding */ sleep),
  "sleepUntil": () => (/* binding */ sleepUntil),
  "softBoolean": () => (/* binding */ softBoolean),
  "throttle": () => (/* binding */ throttle),
  "tileHeight": () => (/* binding */ tileHeight),
  "tileSize": () => (/* binding */ tileSize),
  "tileWidth": () => (/* binding */ tileWidth),
  "unbox": () => (/* binding */ unbox),
  "unround": () => (/* binding */ unround),
  "v2origin": () => (/* binding */ v2origin),
  "v3origin": () => (/* binding */ v3origin),
  "vectodir": () => (/* binding */ vectodir),
  "voidNaN": () => (/* binding */ voidNaN)
});

// NAMESPACE OBJECT: ./node_modules/mathjs/lib/esm/factoriesAny.js
var factoriesAny_namespaceObject = {};
__webpack_require__.r(factoriesAny_namespaceObject);
__webpack_require__.d(factoriesAny_namespaceObject, {
  "createAbs": () => (createAbs),
  "createAccessorNode": () => (createAccessorNode),
  "createAcos": () => (createAcos),
  "createAcosh": () => (createAcosh),
  "createAcot": () => (createAcot),
  "createAcoth": () => (createAcoth),
  "createAcsc": () => (createAcsc),
  "createAcsch": () => (createAcsch),
  "createAdd": () => (createAdd),
  "createAddScalar": () => (createAddScalar),
  "createAnd": () => (createAnd),
  "createApply": () => (createApply),
  "createApplyTransform": () => (createApplyTransform),
  "createArg": () => (createArg),
  "createArrayNode": () => (createArrayNode),
  "createAsec": () => (createAsec),
  "createAsech": () => (createAsech),
  "createAsin": () => (createAsin),
  "createAsinh": () => (createAsinh),
  "createAssignmentNode": () => (createAssignmentNode),
  "createAtan": () => (createAtan),
  "createAtan2": () => (createAtan2),
  "createAtanh": () => (createAtanh),
  "createAtomicMass": () => (createAtomicMass),
  "createAvogadro": () => (createAvogadro),
  "createBellNumbers": () => (createBellNumbers),
  "createBigNumberClass": () => (createBigNumberClass),
  "createBignumber": () => (createBignumber),
  "createBin": () => (createBin),
  "createBitAnd": () => (createBitAnd),
  "createBitNot": () => (createBitNot),
  "createBitOr": () => (createBitOr),
  "createBitXor": () => (createBitXor),
  "createBlockNode": () => (createBlockNode),
  "createBohrMagneton": () => (createBohrMagneton),
  "createBohrRadius": () => (createBohrRadius),
  "createBoltzmann": () => (createBoltzmann),
  "createBoolean": () => (createBoolean),
  "createCatalan": () => (createCatalan),
  "createCbrt": () => (createCbrt),
  "createCeil": () => (createCeil),
  "createChain": () => (createChain),
  "createChainClass": () => (createChainClass),
  "createClassicalElectronRadius": () => (createClassicalElectronRadius),
  "createClone": () => (createClone),
  "createColumn": () => (createColumn),
  "createColumnTransform": () => (createColumnTransform),
  "createCombinations": () => (createCombinations),
  "createCombinationsWithRep": () => (createCombinationsWithRep),
  "createCompare": () => (createCompare),
  "createCompareNatural": () => (createCompareNatural),
  "createCompareText": () => (createCompareText),
  "createCompile": () => (createCompile),
  "createComplex": () => (createComplex),
  "createComplexClass": () => (createComplexClass),
  "createComposition": () => (createComposition),
  "createConcat": () => (createConcat),
  "createConcatTransform": () => (createConcatTransform),
  "createConditionalNode": () => (createConditionalNode),
  "createConductanceQuantum": () => (createConductanceQuantum),
  "createConj": () => (createConj),
  "createConstantNode": () => (createConstantNode),
  "createCos": () => (createCos),
  "createCosh": () => (createCosh),
  "createCot": () => (createCot),
  "createCoth": () => (createCoth),
  "createCoulomb": () => (createCoulomb),
  "createCount": () => (createCount),
  "createCreateUnit": () => (createCreateUnit),
  "createCross": () => (createCross),
  "createCsc": () => (createCsc),
  "createCsch": () => (createCsch),
  "createCtranspose": () => (createCtranspose),
  "createCube": () => (createCube),
  "createDeepEqual": () => (createDeepEqual),
  "createDenseMatrixClass": () => (createDenseMatrixClass),
  "createDerivative": () => (createDerivative),
  "createDet": () => (createDet),
  "createDeuteronMass": () => (createDeuteronMass),
  "createDiag": () => (createDiag),
  "createDiff": () => (createDiff),
  "createDiffTransform": () => (createDiffTransform),
  "createDistance": () => (createDistance),
  "createDivide": () => (createDivide),
  "createDivideScalar": () => (createDivideScalar),
  "createDot": () => (createDot),
  "createDotDivide": () => (createDotDivide),
  "createDotMultiply": () => (createDotMultiply),
  "createDotPow": () => (createDotPow),
  "createE": () => (createE),
  "createEfimovFactor": () => (createEfimovFactor),
  "createEigs": () => (createEigs),
  "createElectricConstant": () => (createElectricConstant),
  "createElectronMass": () => (createElectronMass),
  "createElementaryCharge": () => (createElementaryCharge),
  "createEqual": () => (createEqual),
  "createEqualScalar": () => (createEqualScalar),
  "createEqualText": () => (createEqualText),
  "createErf": () => (createErf),
  "createEvaluate": () => (createEvaluate),
  "createExp": () => (createExp),
  "createExpm": () => (createExpm),
  "createExpm1": () => (createExpm1),
  "createFactorial": () => (createFactorial),
  "createFalse": () => (createFalse),
  "createFaraday": () => (createFaraday),
  "createFermiCoupling": () => (createFermiCoupling),
  "createFibonacciHeapClass": () => (createFibonacciHeapClass),
  "createFilter": () => (createFilter),
  "createFilterTransform": () => (createFilterTransform),
  "createFineStructure": () => (createFineStructure),
  "createFirstRadiation": () => (createFirstRadiation),
  "createFix": () => (createFix),
  "createFlatten": () => (createFlatten),
  "createFloor": () => (createFloor),
  "createForEach": () => (createForEach),
  "createForEachTransform": () => (createForEachTransform),
  "createFormat": () => (createFormat),
  "createFraction": () => (createFraction),
  "createFractionClass": () => (createFractionClass),
  "createFunctionAssignmentNode": () => (createFunctionAssignmentNode),
  "createFunctionNode": () => (createFunctionNode),
  "createGamma": () => (createGamma),
  "createGasConstant": () => (createGasConstant),
  "createGcd": () => (createGcd),
  "createGetMatrixDataType": () => (createGetMatrixDataType),
  "createGravitationConstant": () => (createGravitationConstant),
  "createGravity": () => (createGravity),
  "createHartreeEnergy": () => (createHartreeEnergy),
  "createHasNumericValue": () => (createHasNumericValue),
  "createHelp": () => (createHelp),
  "createHelpClass": () => (createHelpClass),
  "createHex": () => (createHex),
  "createHypot": () => (createHypot),
  "createI": () => (createI),
  "createIdentity": () => (createIdentity),
  "createIm": () => (createIm),
  "createImmutableDenseMatrixClass": () => (createImmutableDenseMatrixClass),
  "createIndex": () => (createIndex),
  "createIndexClass": () => (createIndexClass),
  "createIndexNode": () => (createIndexNode),
  "createIndexTransform": () => (createIndexTransform),
  "createInfinity": () => (createInfinity),
  "createIntersect": () => (createIntersect),
  "createInv": () => (createInv),
  "createInverseConductanceQuantum": () => (createInverseConductanceQuantum),
  "createIsInteger": () => (createIsInteger),
  "createIsNaN": () => (createIsNaN),
  "createIsNegative": () => (createIsNegative),
  "createIsNumeric": () => (createIsNumeric),
  "createIsPositive": () => (createIsPositive),
  "createIsPrime": () => (createIsPrime),
  "createIsZero": () => (createIsZero),
  "createKldivergence": () => (createKldivergence),
  "createKlitzing": () => (createKlitzing),
  "createKron": () => (createKron),
  "createLN10": () => (createLN10),
  "createLN2": () => (createLN2),
  "createLOG10E": () => (createLOG10E),
  "createLOG2E": () => (createLOG2E),
  "createLarger": () => (createLarger),
  "createLargerEq": () => (createLargerEq),
  "createLcm": () => (createLcm),
  "createLeftShift": () => (createLeftShift),
  "createLog": () => (createLog),
  "createLog10": () => (createLog10),
  "createLog1p": () => (createLog1p),
  "createLog2": () => (createLog2),
  "createLoschmidt": () => (createLoschmidt),
  "createLsolve": () => (createLsolve),
  "createLsolveAll": () => (createLsolveAll),
  "createLup": () => (createLup),
  "createLusolve": () => (createLusolve),
  "createMad": () => (createMad),
  "createMagneticConstant": () => (createMagneticConstant),
  "createMagneticFluxQuantum": () => (createMagneticFluxQuantum),
  "createMap": () => (map_createMap),
  "createMapTransform": () => (createMapTransform),
  "createMatrix": () => (createMatrix),
  "createMatrixClass": () => (createMatrixClass),
  "createMatrixFromColumns": () => (createMatrixFromColumns),
  "createMatrixFromFunction": () => (createMatrixFromFunction),
  "createMatrixFromRows": () => (createMatrixFromRows),
  "createMax": () => (createMax),
  "createMaxTransform": () => (createMaxTransform),
  "createMean": () => (createMean),
  "createMeanTransform": () => (createMeanTransform),
  "createMedian": () => (createMedian),
  "createMin": () => (createMin),
  "createMinTransform": () => (createMinTransform),
  "createMod": () => (createMod),
  "createMode": () => (createMode),
  "createMolarMass": () => (createMolarMass),
  "createMolarMassC12": () => (createMolarMassC12),
  "createMolarPlanckConstant": () => (createMolarPlanckConstant),
  "createMolarVolume": () => (createMolarVolume),
  "createMultinomial": () => (createMultinomial),
  "createMultiply": () => (createMultiply),
  "createMultiplyScalar": () => (createMultiplyScalar),
  "createNaN": () => (createNaN),
  "createNeutronMass": () => (createNeutronMass),
  "createNode": () => (createNode),
  "createNorm": () => (createNorm),
  "createNot": () => (createNot),
  "createNthRoot": () => (createNthRoot),
  "createNthRoots": () => (createNthRoots),
  "createNuclearMagneton": () => (createNuclearMagneton),
  "createNull": () => (createNull),
  "createNumber": () => (createNumber),
  "createNumeric": () => (createNumeric),
  "createObjectNode": () => (createObjectNode),
  "createOct": () => (createOct),
  "createOnes": () => (createOnes),
  "createOperatorNode": () => (createOperatorNode),
  "createOr": () => (createOr),
  "createParenthesisNode": () => (createParenthesisNode),
  "createParse": () => (createParse),
  "createParser": () => (createParser),
  "createParserClass": () => (createParserClass),
  "createPartitionSelect": () => (createPartitionSelect),
  "createPermutations": () => (createPermutations),
  "createPhi": () => (createPhi),
  "createPi": () => (createPi),
  "createPickRandom": () => (createPickRandom),
  "createPlanckCharge": () => (createPlanckCharge),
  "createPlanckConstant": () => (createPlanckConstant),
  "createPlanckLength": () => (createPlanckLength),
  "createPlanckMass": () => (createPlanckMass),
  "createPlanckTemperature": () => (createPlanckTemperature),
  "createPlanckTime": () => (createPlanckTime),
  "createPow": () => (createPow),
  "createPrint": () => (createPrint),
  "createProd": () => (createProd),
  "createProtonMass": () => (createProtonMass),
  "createQr": () => (createQr),
  "createQuantileSeq": () => (createQuantileSeq),
  "createQuantumOfCirculation": () => (createQuantumOfCirculation),
  "createRandom": () => (createRandom),
  "createRandomInt": () => (createRandomInt),
  "createRange": () => (createRange),
  "createRangeClass": () => (createRangeClass),
  "createRangeNode": () => (createRangeNode),
  "createRangeTransform": () => (createRangeTransform),
  "createRationalize": () => (createRationalize),
  "createRe": () => (createRe),
  "createReducedPlanckConstant": () => (createReducedPlanckConstant),
  "createRelationalNode": () => (createRelationalNode),
  "createReplacer": () => (createReplacer),
  "createReshape": () => (createReshape),
  "createResize": () => (createResize),
  "createResultSet": () => (createResultSet),
  "createReviver": () => (createReviver),
  "createRightArithShift": () => (createRightArithShift),
  "createRightLogShift": () => (createRightLogShift),
  "createRotate": () => (createRotate),
  "createRotationMatrix": () => (createRotationMatrix),
  "createRound": () => (createRound),
  "createRow": () => (createRow),
  "createRowTransform": () => (createRowTransform),
  "createRydberg": () => (createRydberg),
  "createSQRT1_2": () => (createSQRT1_2),
  "createSQRT2": () => (createSQRT2),
  "createSackurTetrode": () => (createSackurTetrode),
  "createSec": () => (createSec),
  "createSech": () => (createSech),
  "createSecondRadiation": () => (createSecondRadiation),
  "createSetCartesian": () => (createSetCartesian),
  "createSetDifference": () => (createSetDifference),
  "createSetDistinct": () => (createSetDistinct),
  "createSetIntersect": () => (createSetIntersect),
  "createSetIsSubset": () => (createSetIsSubset),
  "createSetMultiplicity": () => (createSetMultiplicity),
  "createSetPowerset": () => (createSetPowerset),
  "createSetSize": () => (createSetSize),
  "createSetSymDifference": () => (createSetSymDifference),
  "createSetUnion": () => (createSetUnion),
  "createSign": () => (createSign),
  "createSimplify": () => (createSimplify),
  "createSin": () => (createSin),
  "createSinh": () => (createSinh),
  "createSize": () => (createSize),
  "createSlu": () => (createSlu),
  "createSmaller": () => (createSmaller),
  "createSmallerEq": () => (createSmallerEq),
  "createSort": () => (createSort),
  "createSpaClass": () => (createSpaClass),
  "createSparse": () => (createSparse),
  "createSparseMatrixClass": () => (createSparseMatrixClass),
  "createSpeedOfLight": () => (createSpeedOfLight),
  "createSplitUnit": () => (createSplitUnit),
  "createSqrt": () => (createSqrt),
  "createSqrtm": () => (createSqrtm),
  "createSquare": () => (createSquare),
  "createSqueeze": () => (createSqueeze),
  "createStd": () => (createStd),
  "createStdTransform": () => (createStdTransform),
  "createStefanBoltzmann": () => (createStefanBoltzmann),
  "createStirlingS2": () => (createStirlingS2),
  "createString": () => (createString),
  "createSubset": () => (createSubset),
  "createSubsetTransform": () => (createSubsetTransform),
  "createSubtract": () => (createSubtract),
  "createSum": () => (createSum),
  "createSumTransform": () => (createSumTransform),
  "createSymbolNode": () => (createSymbolNode),
  "createTan": () => (createTan),
  "createTanh": () => (createTanh),
  "createTau": () => (createTau),
  "createThomsonCrossSection": () => (createThomsonCrossSection),
  "createTo": () => (createTo),
  "createTrace": () => (createTrace),
  "createTranspose": () => (createTranspose),
  "createTrue": () => (createTrue),
  "createTypeOf": () => (createTypeOf),
  "createTyped": () => (createTyped),
  "createUnaryMinus": () => (createUnaryMinus),
  "createUnaryPlus": () => (createUnaryPlus),
  "createUnequal": () => (createUnequal),
  "createUnitClass": () => (createUnitClass),
  "createUnitFunction": () => (createUnitFunction),
  "createUppercaseE": () => (createUppercaseE),
  "createUppercasePi": () => (createUppercasePi),
  "createUsolve": () => (createUsolve),
  "createUsolveAll": () => (createUsolveAll),
  "createVacuumImpedance": () => (createVacuumImpedance),
  "createVariance": () => (createVariance),
  "createVarianceTransform": () => (createVarianceTransform),
  "createVersion": () => (createVersion),
  "createWeakMixingAngle": () => (createWeakMixingAngle),
  "createWienDisplacement": () => (createWienDisplacement),
  "createXgcd": () => (createXgcd),
  "createXor": () => (createXor),
  "createZeros": () => (createZeros)
});

// NAMESPACE OBJECT: ./node_modules/mathjs/lib/esm/index.js
var esm_namespaceObject = {};
__webpack_require__.r(esm_namespaceObject);
__webpack_require__.d(esm_namespaceObject, {
  "AccessorNode": () => (AccessorNode),
  "AccessorNodeDependencies": () => (AccessorNodeDependencies),
  "ArgumentsError": () => (ArgumentsError),
  "ArrayNode": () => (ArrayNode),
  "ArrayNodeDependencies": () => (ArrayNodeDependencies),
  "AssignmentNode": () => (AssignmentNode),
  "AssignmentNodeDependencies": () => (AssignmentNodeDependencies),
  "BigNumber": () => (BigNumber),
  "BigNumberDependencies": () => (BigNumberDependencies),
  "BlockNode": () => (BlockNode),
  "BlockNodeDependencies": () => (BlockNodeDependencies),
  "Chain": () => (Chain),
  "ChainDependencies": () => (ChainDependencies),
  "Complex": () => (Complex),
  "ComplexDependencies": () => (ComplexDependencies),
  "ConditionalNode": () => (ConditionalNode),
  "ConditionalNodeDependencies": () => (ConditionalNodeDependencies),
  "ConstantNode": () => (ConstantNode),
  "ConstantNodeDependencies": () => (ConstantNodeDependencies),
  "DenseMatrix": () => (DenseMatrix),
  "DenseMatrixDependencies": () => (DenseMatrixDependencies),
  "DimensionError": () => (DimensionError),
  "EDependencies": () => (EDependencies),
  "FibonacciHeap": () => (FibonacciHeap),
  "FibonacciHeapDependencies": () => (FibonacciHeapDependencies),
  "Fraction": () => (Fraction),
  "FractionDependencies": () => (FractionDependencies),
  "FunctionAssignmentNode": () => (FunctionAssignmentNode),
  "FunctionAssignmentNodeDependencies": () => (FunctionAssignmentNodeDependencies),
  "FunctionNode": () => (FunctionNode),
  "FunctionNodeDependencies": () => (FunctionNodeDependencies),
  "Help": () => (Help),
  "HelpDependencies": () => (HelpDependencies),
  "ImmutableDenseMatrix": () => (ImmutableDenseMatrix),
  "ImmutableDenseMatrixDependencies": () => (ImmutableDenseMatrixDependencies),
  "Index": () => (Index),
  "IndexDependencies": () => (IndexDependencies),
  "IndexError": () => (IndexError),
  "IndexNode": () => (IndexNode),
  "IndexNodeDependencies": () => (IndexNodeDependencies),
  "InfinityDependencies": () => (InfinityDependencies),
  "LN10": () => (LN10),
  "LN10Dependencies": () => (LN10Dependencies),
  "LN2": () => (LN2),
  "LN2Dependencies": () => (LN2Dependencies),
  "LOG10E": () => (LOG10E),
  "LOG10EDependencies": () => (LOG10EDependencies),
  "LOG2E": () => (LOG2E),
  "LOG2EDependencies": () => (LOG2EDependencies),
  "Matrix": () => (Matrix),
  "MatrixDependencies": () => (MatrixDependencies),
  "NaNDependencies": () => (NaNDependencies),
  "Node": () => (Node),
  "NodeDependencies": () => (NodeDependencies),
  "ObjectNode": () => (ObjectNode),
  "ObjectNodeDependencies": () => (ObjectNodeDependencies),
  "OperatorNode": () => (OperatorNode),
  "OperatorNodeDependencies": () => (OperatorNodeDependencies),
  "PIDependencies": () => (PIDependencies),
  "ParenthesisNode": () => (ParenthesisNode),
  "ParenthesisNodeDependencies": () => (ParenthesisNodeDependencies),
  "Parser": () => (Parser),
  "ParserDependencies": () => (ParserDependencies),
  "Range": () => (Range),
  "RangeDependencies": () => (RangeDependencies),
  "RangeNode": () => (RangeNode),
  "RangeNodeDependencies": () => (RangeNodeDependencies),
  "RelationalNode": () => (RelationalNode),
  "RelationalNodeDependencies": () => (RelationalNodeDependencies),
  "ResultSet": () => (ResultSet),
  "ResultSetDependencies": () => (ResultSetDependencies),
  "SQRT1_2": () => (SQRT1_2),
  "SQRT1_2Dependencies": () => (SQRT1_2Dependencies),
  "SQRT2": () => (SQRT2),
  "SQRT2Dependencies": () => (SQRT2Dependencies),
  "Spa": () => (Spa),
  "SpaDependencies": () => (SpaDependencies),
  "SparseMatrix": () => (SparseMatrix),
  "SparseMatrixDependencies": () => (SparseMatrixDependencies),
  "SymbolNode": () => (SymbolNode),
  "SymbolNodeDependencies": () => (SymbolNodeDependencies),
  "Unit": () => (Unit),
  "UnitDependencies": () => (UnitDependencies),
  "_Infinity": () => (_Infinity),
  "_NaN": () => (_NaN),
  "_false": () => (_false),
  "_null": () => (_null),
  "_true": () => (_true),
  "abs": () => (abs),
  "absDependencies": () => (absDependencies),
  "acos": () => (acos),
  "acosDependencies": () => (acosDependencies),
  "acosh": () => (pureFunctionsAny_generated_acosh),
  "acoshDependencies": () => (acoshDependencies),
  "acot": () => (acot),
  "acotDependencies": () => (acotDependencies),
  "acoth": () => (acoth),
  "acothDependencies": () => (acothDependencies),
  "acsc": () => (acsc),
  "acscDependencies": () => (acscDependencies),
  "acsch": () => (acsch),
  "acschDependencies": () => (acschDependencies),
  "add": () => (add),
  "addDependencies": () => (addDependencies),
  "addScalar": () => (addScalar),
  "addScalarDependencies": () => (addScalarDependencies),
  "all": () => (allFactoriesAny_all),
  "and": () => (and),
  "andDependencies": () => (andDependencies),
  "apply": () => (apply),
  "applyDependencies": () => (applyDependencies),
  "applyTransformDependencies": () => (applyTransformDependencies),
  "arg": () => (arg),
  "argDependencies": () => (argDependencies),
  "asec": () => (asec),
  "asecDependencies": () => (asecDependencies),
  "asech": () => (asech),
  "asechDependencies": () => (asechDependencies),
  "asin": () => (asin),
  "asinDependencies": () => (asinDependencies),
  "asinh": () => (pureFunctionsAny_generated_asinh),
  "asinhDependencies": () => (asinhDependencies),
  "atan": () => (atan),
  "atan2": () => (atan2),
  "atan2Dependencies": () => (atan2Dependencies),
  "atanDependencies": () => (atanDependencies),
  "atanh": () => (pureFunctionsAny_generated_atanh),
  "atanhDependencies": () => (atanhDependencies),
  "atomicMass": () => (atomicMass),
  "atomicMassDependencies": () => (atomicMassDependencies),
  "avogadro": () => (avogadro),
  "avogadroDependencies": () => (avogadroDependencies),
  "bellNumbers": () => (bellNumbers),
  "bellNumbersDependencies": () => (bellNumbersDependencies),
  "bignumber": () => (bignumber),
  "bignumberDependencies": () => (bignumberDependencies),
  "bin": () => (bin),
  "binDependencies": () => (binDependencies),
  "bitAnd": () => (bitAnd),
  "bitAndDependencies": () => (bitAndDependencies),
  "bitNot": () => (bitNot),
  "bitNotDependencies": () => (bitNotDependencies),
  "bitOr": () => (bitOr),
  "bitOrDependencies": () => (bitOrDependencies),
  "bitXor": () => (pureFunctionsAny_generated_bitXor),
  "bitXorDependencies": () => (bitXorDependencies),
  "bohrMagneton": () => (bohrMagneton),
  "bohrMagnetonDependencies": () => (bohrMagnetonDependencies),
  "bohrRadius": () => (bohrRadius),
  "bohrRadiusDependencies": () => (bohrRadiusDependencies),
  "boltzmann": () => (boltzmann),
  "boltzmannDependencies": () => (boltzmannDependencies),
  "boolean": () => (pureFunctionsAny_generated_boolean),
  "booleanDependencies": () => (booleanDependencies),
  "catalan": () => (catalan),
  "catalanDependencies": () => (catalanDependencies),
  "cbrt": () => (pureFunctionsAny_generated_cbrt),
  "cbrtDependencies": () => (cbrtDependencies),
  "ceil": () => (ceil),
  "ceilDependencies": () => (ceilDependencies),
  "chain": () => (chain),
  "chainDependencies": () => (chainDependencies),
  "classicalElectronRadius": () => (classicalElectronRadius),
  "classicalElectronRadiusDependencies": () => (classicalElectronRadiusDependencies),
  "clone": () => (pureFunctionsAny_generated_clone),
  "cloneDependencies": () => (cloneDependencies),
  "column": () => (column),
  "columnDependencies": () => (columnDependencies),
  "columnTransformDependencies": () => (columnTransformDependencies),
  "combinations": () => (combinations),
  "combinationsDependencies": () => (combinationsDependencies),
  "combinationsWithRep": () => (combinationsWithRep),
  "combinationsWithRepDependencies": () => (combinationsWithRepDependencies),
  "compare": () => (compare),
  "compareDependencies": () => (compareDependencies),
  "compareNatural": () => (compareNatural),
  "compareNaturalDependencies": () => (compareNaturalDependencies),
  "compareText": () => (pureFunctionsAny_generated_compareText),
  "compareTextDependencies": () => (compareTextDependencies),
  "compile": () => (compile),
  "compileDependencies": () => (compileDependencies),
  "complex": () => (pureFunctionsAny_generated_complex),
  "complexDependencies": () => (complexDependencies),
  "composition": () => (composition),
  "compositionDependencies": () => (compositionDependencies),
  "concat": () => (concat),
  "concatDependencies": () => (concatDependencies),
  "concatTransformDependencies": () => (concatTransformDependencies),
  "conductanceQuantum": () => (conductanceQuantum),
  "conductanceQuantumDependencies": () => (conductanceQuantumDependencies),
  "config": () => (config),
  "conj": () => (conj),
  "conjDependencies": () => (conjDependencies),
  "cos": () => (cos),
  "cosDependencies": () => (cosDependencies),
  "cosh": () => (pureFunctionsAny_generated_cosh),
  "coshDependencies": () => (coshDependencies),
  "cot": () => (cot),
  "cotDependencies": () => (cotDependencies),
  "coth": () => (coth),
  "cothDependencies": () => (cothDependencies),
  "coulomb": () => (coulomb),
  "coulombDependencies": () => (coulombDependencies),
  "count": () => (count),
  "countDependencies": () => (countDependencies),
  "create": () => (create_create),
  "createAbs": () => (createAbs),
  "createAccessorNode": () => (createAccessorNode),
  "createAcos": () => (createAcos),
  "createAcosh": () => (createAcosh),
  "createAcot": () => (createAcot),
  "createAcoth": () => (createAcoth),
  "createAcsc": () => (createAcsc),
  "createAcsch": () => (createAcsch),
  "createAdd": () => (createAdd),
  "createAddScalar": () => (createAddScalar),
  "createAnd": () => (createAnd),
  "createApply": () => (createApply),
  "createApplyTransform": () => (createApplyTransform),
  "createArg": () => (createArg),
  "createArrayNode": () => (createArrayNode),
  "createAsec": () => (createAsec),
  "createAsech": () => (createAsech),
  "createAsin": () => (createAsin),
  "createAsinh": () => (createAsinh),
  "createAssignmentNode": () => (createAssignmentNode),
  "createAtan": () => (createAtan),
  "createAtan2": () => (createAtan2),
  "createAtanh": () => (createAtanh),
  "createAtomicMass": () => (createAtomicMass),
  "createAvogadro": () => (createAvogadro),
  "createBellNumbers": () => (createBellNumbers),
  "createBigNumberClass": () => (createBigNumberClass),
  "createBignumber": () => (createBignumber),
  "createBin": () => (createBin),
  "createBitAnd": () => (createBitAnd),
  "createBitNot": () => (createBitNot),
  "createBitOr": () => (createBitOr),
  "createBitXor": () => (createBitXor),
  "createBlockNode": () => (createBlockNode),
  "createBohrMagneton": () => (createBohrMagneton),
  "createBohrRadius": () => (createBohrRadius),
  "createBoltzmann": () => (createBoltzmann),
  "createBoolean": () => (createBoolean),
  "createCatalan": () => (createCatalan),
  "createCbrt": () => (createCbrt),
  "createCeil": () => (createCeil),
  "createChain": () => (createChain),
  "createChainClass": () => (createChainClass),
  "createClassicalElectronRadius": () => (createClassicalElectronRadius),
  "createClone": () => (createClone),
  "createColumn": () => (createColumn),
  "createColumnTransform": () => (createColumnTransform),
  "createCombinations": () => (createCombinations),
  "createCombinationsWithRep": () => (createCombinationsWithRep),
  "createCompare": () => (createCompare),
  "createCompareNatural": () => (createCompareNatural),
  "createCompareText": () => (createCompareText),
  "createCompile": () => (createCompile),
  "createComplex": () => (createComplex),
  "createComplexClass": () => (createComplexClass),
  "createComposition": () => (createComposition),
  "createConcat": () => (createConcat),
  "createConcatTransform": () => (createConcatTransform),
  "createConditionalNode": () => (createConditionalNode),
  "createConductanceQuantum": () => (createConductanceQuantum),
  "createConj": () => (createConj),
  "createConstantNode": () => (createConstantNode),
  "createCos": () => (createCos),
  "createCosh": () => (createCosh),
  "createCot": () => (createCot),
  "createCoth": () => (createCoth),
  "createCoulomb": () => (createCoulomb),
  "createCount": () => (createCount),
  "createCreateUnit": () => (createCreateUnit),
  "createCross": () => (createCross),
  "createCsc": () => (createCsc),
  "createCsch": () => (createCsch),
  "createCtranspose": () => (createCtranspose),
  "createCube": () => (createCube),
  "createDeepEqual": () => (createDeepEqual),
  "createDenseMatrixClass": () => (createDenseMatrixClass),
  "createDerivative": () => (createDerivative),
  "createDet": () => (createDet),
  "createDeuteronMass": () => (createDeuteronMass),
  "createDiag": () => (createDiag),
  "createDiff": () => (createDiff),
  "createDiffTransform": () => (createDiffTransform),
  "createDistance": () => (createDistance),
  "createDivide": () => (createDivide),
  "createDivideScalar": () => (createDivideScalar),
  "createDot": () => (createDot),
  "createDotDivide": () => (createDotDivide),
  "createDotMultiply": () => (createDotMultiply),
  "createDotPow": () => (createDotPow),
  "createE": () => (createE),
  "createEfimovFactor": () => (createEfimovFactor),
  "createEigs": () => (createEigs),
  "createElectricConstant": () => (createElectricConstant),
  "createElectronMass": () => (createElectronMass),
  "createElementaryCharge": () => (createElementaryCharge),
  "createEqual": () => (createEqual),
  "createEqualScalar": () => (createEqualScalar),
  "createEqualText": () => (createEqualText),
  "createErf": () => (createErf),
  "createEvaluate": () => (createEvaluate),
  "createExp": () => (createExp),
  "createExpm": () => (createExpm),
  "createExpm1": () => (createExpm1),
  "createFactorial": () => (createFactorial),
  "createFalse": () => (createFalse),
  "createFaraday": () => (createFaraday),
  "createFermiCoupling": () => (createFermiCoupling),
  "createFibonacciHeapClass": () => (createFibonacciHeapClass),
  "createFilter": () => (createFilter),
  "createFilterTransform": () => (createFilterTransform),
  "createFineStructure": () => (createFineStructure),
  "createFirstRadiation": () => (createFirstRadiation),
  "createFix": () => (createFix),
  "createFlatten": () => (createFlatten),
  "createFloor": () => (createFloor),
  "createForEach": () => (createForEach),
  "createForEachTransform": () => (createForEachTransform),
  "createFormat": () => (createFormat),
  "createFraction": () => (createFraction),
  "createFractionClass": () => (createFractionClass),
  "createFunctionAssignmentNode": () => (createFunctionAssignmentNode),
  "createFunctionNode": () => (createFunctionNode),
  "createGamma": () => (createGamma),
  "createGasConstant": () => (createGasConstant),
  "createGcd": () => (createGcd),
  "createGetMatrixDataType": () => (createGetMatrixDataType),
  "createGravitationConstant": () => (createGravitationConstant),
  "createGravity": () => (createGravity),
  "createHartreeEnergy": () => (createHartreeEnergy),
  "createHasNumericValue": () => (createHasNumericValue),
  "createHelp": () => (createHelp),
  "createHelpClass": () => (createHelpClass),
  "createHex": () => (createHex),
  "createHypot": () => (createHypot),
  "createI": () => (createI),
  "createIdentity": () => (createIdentity),
  "createIm": () => (createIm),
  "createImmutableDenseMatrixClass": () => (createImmutableDenseMatrixClass),
  "createIndex": () => (createIndex),
  "createIndexClass": () => (createIndexClass),
  "createIndexNode": () => (createIndexNode),
  "createIndexTransform": () => (createIndexTransform),
  "createInfinity": () => (createInfinity),
  "createIntersect": () => (createIntersect),
  "createInv": () => (createInv),
  "createInverseConductanceQuantum": () => (createInverseConductanceQuantum),
  "createIsInteger": () => (createIsInteger),
  "createIsNaN": () => (createIsNaN),
  "createIsNegative": () => (createIsNegative),
  "createIsNumeric": () => (createIsNumeric),
  "createIsPositive": () => (createIsPositive),
  "createIsPrime": () => (createIsPrime),
  "createIsZero": () => (createIsZero),
  "createKldivergence": () => (createKldivergence),
  "createKlitzing": () => (createKlitzing),
  "createKron": () => (createKron),
  "createLN10": () => (createLN10),
  "createLN2": () => (createLN2),
  "createLOG10E": () => (createLOG10E),
  "createLOG2E": () => (createLOG2E),
  "createLarger": () => (createLarger),
  "createLargerEq": () => (createLargerEq),
  "createLcm": () => (createLcm),
  "createLeftShift": () => (createLeftShift),
  "createLog": () => (createLog),
  "createLog10": () => (createLog10),
  "createLog1p": () => (createLog1p),
  "createLog2": () => (createLog2),
  "createLoschmidt": () => (createLoschmidt),
  "createLsolve": () => (createLsolve),
  "createLsolveAll": () => (createLsolveAll),
  "createLup": () => (createLup),
  "createLusolve": () => (createLusolve),
  "createMad": () => (createMad),
  "createMagneticConstant": () => (createMagneticConstant),
  "createMagneticFluxQuantum": () => (createMagneticFluxQuantum),
  "createMap": () => (map_createMap),
  "createMapTransform": () => (createMapTransform),
  "createMatrix": () => (createMatrix),
  "createMatrixClass": () => (createMatrixClass),
  "createMatrixFromColumns": () => (createMatrixFromColumns),
  "createMatrixFromFunction": () => (createMatrixFromFunction),
  "createMatrixFromRows": () => (createMatrixFromRows),
  "createMax": () => (createMax),
  "createMaxTransform": () => (createMaxTransform),
  "createMean": () => (createMean),
  "createMeanTransform": () => (createMeanTransform),
  "createMedian": () => (createMedian),
  "createMin": () => (createMin),
  "createMinTransform": () => (createMinTransform),
  "createMod": () => (createMod),
  "createMode": () => (createMode),
  "createMolarMass": () => (createMolarMass),
  "createMolarMassC12": () => (createMolarMassC12),
  "createMolarPlanckConstant": () => (createMolarPlanckConstant),
  "createMolarVolume": () => (createMolarVolume),
  "createMultinomial": () => (createMultinomial),
  "createMultiply": () => (createMultiply),
  "createMultiplyScalar": () => (createMultiplyScalar),
  "createNaN": () => (createNaN),
  "createNeutronMass": () => (createNeutronMass),
  "createNode": () => (createNode),
  "createNorm": () => (createNorm),
  "createNot": () => (createNot),
  "createNthRoot": () => (createNthRoot),
  "createNthRoots": () => (createNthRoots),
  "createNuclearMagneton": () => (createNuclearMagneton),
  "createNull": () => (createNull),
  "createNumber": () => (createNumber),
  "createNumeric": () => (createNumeric),
  "createObjectNode": () => (createObjectNode),
  "createOct": () => (createOct),
  "createOnes": () => (createOnes),
  "createOperatorNode": () => (createOperatorNode),
  "createOr": () => (createOr),
  "createParenthesisNode": () => (createParenthesisNode),
  "createParse": () => (createParse),
  "createParser": () => (createParser),
  "createParserClass": () => (createParserClass),
  "createPartitionSelect": () => (createPartitionSelect),
  "createPermutations": () => (createPermutations),
  "createPhi": () => (createPhi),
  "createPi": () => (createPi),
  "createPickRandom": () => (createPickRandom),
  "createPlanckCharge": () => (createPlanckCharge),
  "createPlanckConstant": () => (createPlanckConstant),
  "createPlanckLength": () => (createPlanckLength),
  "createPlanckMass": () => (createPlanckMass),
  "createPlanckTemperature": () => (createPlanckTemperature),
  "createPlanckTime": () => (createPlanckTime),
  "createPow": () => (createPow),
  "createPrint": () => (createPrint),
  "createProd": () => (createProd),
  "createProtonMass": () => (createProtonMass),
  "createQr": () => (createQr),
  "createQuantileSeq": () => (createQuantileSeq),
  "createQuantumOfCirculation": () => (createQuantumOfCirculation),
  "createRandom": () => (createRandom),
  "createRandomInt": () => (createRandomInt),
  "createRange": () => (createRange),
  "createRangeClass": () => (createRangeClass),
  "createRangeNode": () => (createRangeNode),
  "createRangeTransform": () => (createRangeTransform),
  "createRationalize": () => (createRationalize),
  "createRe": () => (createRe),
  "createReducedPlanckConstant": () => (createReducedPlanckConstant),
  "createRelationalNode": () => (createRelationalNode),
  "createReplacer": () => (createReplacer),
  "createReshape": () => (createReshape),
  "createResize": () => (createResize),
  "createResultSet": () => (createResultSet),
  "createReviver": () => (createReviver),
  "createRightArithShift": () => (createRightArithShift),
  "createRightLogShift": () => (createRightLogShift),
  "createRotate": () => (createRotate),
  "createRotationMatrix": () => (createRotationMatrix),
  "createRound": () => (createRound),
  "createRow": () => (createRow),
  "createRowTransform": () => (createRowTransform),
  "createRydberg": () => (createRydberg),
  "createSQRT1_2": () => (createSQRT1_2),
  "createSQRT2": () => (createSQRT2),
  "createSackurTetrode": () => (createSackurTetrode),
  "createSec": () => (createSec),
  "createSech": () => (createSech),
  "createSecondRadiation": () => (createSecondRadiation),
  "createSetCartesian": () => (createSetCartesian),
  "createSetDifference": () => (createSetDifference),
  "createSetDistinct": () => (createSetDistinct),
  "createSetIntersect": () => (createSetIntersect),
  "createSetIsSubset": () => (createSetIsSubset),
  "createSetMultiplicity": () => (createSetMultiplicity),
  "createSetPowerset": () => (createSetPowerset),
  "createSetSize": () => (createSetSize),
  "createSetSymDifference": () => (createSetSymDifference),
  "createSetUnion": () => (createSetUnion),
  "createSign": () => (createSign),
  "createSimplify": () => (createSimplify),
  "createSin": () => (createSin),
  "createSinh": () => (createSinh),
  "createSize": () => (createSize),
  "createSlu": () => (createSlu),
  "createSmaller": () => (createSmaller),
  "createSmallerEq": () => (createSmallerEq),
  "createSort": () => (createSort),
  "createSpaClass": () => (createSpaClass),
  "createSparse": () => (createSparse),
  "createSparseMatrixClass": () => (createSparseMatrixClass),
  "createSpeedOfLight": () => (createSpeedOfLight),
  "createSplitUnit": () => (createSplitUnit),
  "createSqrt": () => (createSqrt),
  "createSqrtm": () => (createSqrtm),
  "createSquare": () => (createSquare),
  "createSqueeze": () => (createSqueeze),
  "createStd": () => (createStd),
  "createStdTransform": () => (createStdTransform),
  "createStefanBoltzmann": () => (createStefanBoltzmann),
  "createStirlingS2": () => (createStirlingS2),
  "createString": () => (createString),
  "createSubset": () => (createSubset),
  "createSubsetTransform": () => (createSubsetTransform),
  "createSubtract": () => (createSubtract),
  "createSum": () => (createSum),
  "createSumTransform": () => (createSumTransform),
  "createSymbolNode": () => (createSymbolNode),
  "createTan": () => (createTan),
  "createTanh": () => (createTanh),
  "createTau": () => (createTau),
  "createThomsonCrossSection": () => (createThomsonCrossSection),
  "createTo": () => (createTo),
  "createTrace": () => (createTrace),
  "createTranspose": () => (createTranspose),
  "createTrue": () => (createTrue),
  "createTypeOf": () => (createTypeOf),
  "createTyped": () => (createTyped),
  "createUnaryMinus": () => (createUnaryMinus),
  "createUnaryPlus": () => (createUnaryPlus),
  "createUnequal": () => (createUnequal),
  "createUnit": () => (createUnit),
  "createUnitClass": () => (createUnitClass),
  "createUnitDependencies": () => (createUnitDependencies),
  "createUnitFunction": () => (createUnitFunction),
  "createUppercaseE": () => (createUppercaseE),
  "createUppercasePi": () => (createUppercasePi),
  "createUsolve": () => (createUsolve),
  "createUsolveAll": () => (createUsolveAll),
  "createVacuumImpedance": () => (createVacuumImpedance),
  "createVariance": () => (createVariance),
  "createVarianceTransform": () => (createVarianceTransform),
  "createVersion": () => (createVersion),
  "createWeakMixingAngle": () => (createWeakMixingAngle),
  "createWienDisplacement": () => (createWienDisplacement),
  "createXgcd": () => (createXgcd),
  "createXor": () => (createXor),
  "createZeros": () => (createZeros),
  "cross": () => (cross),
  "crossDependencies": () => (crossDependencies),
  "csc": () => (csc),
  "cscDependencies": () => (cscDependencies),
  "csch": () => (csch),
  "cschDependencies": () => (cschDependencies),
  "ctranspose": () => (ctranspose),
  "ctransposeDependencies": () => (ctransposeDependencies),
  "cube": () => (cube),
  "cubeDependencies": () => (cubeDependencies),
  "deepEqual": () => (deepEqual),
  "deepEqualDependencies": () => (deepEqualDependencies),
  "derivative": () => (derivative),
  "derivativeDependencies": () => (derivativeDependencies),
  "det": () => (det),
  "detDependencies": () => (detDependencies),
  "deuteronMass": () => (deuteronMass),
  "deuteronMassDependencies": () => (deuteronMassDependencies),
  "diag": () => (diag),
  "diagDependencies": () => (diagDependencies),
  "diff": () => (diff),
  "diffDependencies": () => (diffDependencies),
  "diffTransformDependencies": () => (diffTransformDependencies),
  "distance": () => (distance),
  "distanceDependencies": () => (distanceDependencies),
  "divide": () => (divide),
  "divideDependencies": () => (divideDependencies),
  "divideScalar": () => (divideScalar),
  "divideScalarDependencies": () => (divideScalarDependencies),
  "docs": () => (embeddedDocs),
  "dot": () => (dot),
  "dotDependencies": () => (dotDependencies),
  "dotDivide": () => (dotDivide),
  "dotDivideDependencies": () => (dotDivideDependencies),
  "dotMultiply": () => (dotMultiply),
  "dotMultiplyDependencies": () => (dotMultiplyDependencies),
  "dotPow": () => (dotPow),
  "dotPowDependencies": () => (dotPowDependencies),
  "e": () => (pureFunctionsAny_generated_e),
  "eDependencies": () => (eDependencies),
  "efimovFactor": () => (efimovFactor),
  "efimovFactorDependencies": () => (efimovFactorDependencies),
  "eigs": () => (eigs),
  "eigsDependencies": () => (eigsDependencies),
  "electricConstant": () => (electricConstant),
  "electricConstantDependencies": () => (electricConstantDependencies),
  "electronMass": () => (electronMass),
  "electronMassDependencies": () => (electronMassDependencies),
  "elementaryCharge": () => (elementaryCharge),
  "elementaryChargeDependencies": () => (elementaryChargeDependencies),
  "equal": () => (equal),
  "equalDependencies": () => (equalDependencies),
  "equalScalar": () => (equalScalar),
  "equalScalarDependencies": () => (equalScalarDependencies),
  "equalText": () => (equalText),
  "equalTextDependencies": () => (equalTextDependencies),
  "erf": () => (erf),
  "erfDependencies": () => (erfDependencies),
  "evaluate": () => (evaluate),
  "evaluateDependencies": () => (evaluateDependencies),
  "exp": () => (exp),
  "expDependencies": () => (expDependencies),
  "expm": () => (expm),
  "expm1": () => (pureFunctionsAny_generated_expm1),
  "expm1Dependencies": () => (expm1Dependencies),
  "expmDependencies": () => (expmDependencies),
  "factorial": () => (factorial),
  "factorialDependencies": () => (factorialDependencies),
  "factory": () => (factory),
  "falseDependencies": () => (falseDependencies),
  "faraday": () => (faraday),
  "faradayDependencies": () => (faradayDependencies),
  "fermiCoupling": () => (fermiCoupling),
  "fermiCouplingDependencies": () => (fermiCouplingDependencies),
  "filter": () => (pureFunctionsAny_generated_filter),
  "filterDependencies": () => (filterDependencies),
  "filterTransformDependencies": () => (filterTransformDependencies),
  "fineStructure": () => (fineStructure),
  "fineStructureDependencies": () => (fineStructureDependencies),
  "firstRadiation": () => (firstRadiation),
  "firstRadiationDependencies": () => (firstRadiationDependencies),
  "fix": () => (fix),
  "fixDependencies": () => (fixDependencies),
  "flatten": () => (pureFunctionsAny_generated_flatten),
  "flattenDependencies": () => (flattenDependencies),
  "floor": () => (floor),
  "floorDependencies": () => (floorDependencies),
  "forEach": () => (pureFunctionsAny_generated_forEach),
  "forEachDependencies": () => (forEachDependencies),
  "forEachTransformDependencies": () => (forEachTransformDependencies),
  "format": () => (pureFunctionsAny_generated_format),
  "formatDependencies": () => (formatDependencies),
  "fraction": () => (pureFunctionsAny_generated_fraction),
  "fractionDependencies": () => (fractionDependencies),
  "gamma": () => (gamma),
  "gammaDependencies": () => (gammaDependencies),
  "gasConstant": () => (gasConstant),
  "gasConstantDependencies": () => (gasConstantDependencies),
  "gcd": () => (gcd),
  "gcdDependencies": () => (gcdDependencies),
  "getMatrixDataType": () => (getMatrixDataType),
  "getMatrixDataTypeDependencies": () => (getMatrixDataTypeDependencies),
  "gravitationConstant": () => (gravitationConstant),
  "gravitationConstantDependencies": () => (gravitationConstantDependencies),
  "gravity": () => (gravity),
  "gravityDependencies": () => (gravityDependencies),
  "hartreeEnergy": () => (hartreeEnergy),
  "hartreeEnergyDependencies": () => (hartreeEnergyDependencies),
  "hasNumericValue": () => (hasNumericValue),
  "hasNumericValueDependencies": () => (hasNumericValueDependencies),
  "help": () => (help),
  "helpDependencies": () => (helpDependencies),
  "hex": () => (hex),
  "hexDependencies": () => (hexDependencies),
  "hypot": () => (hypot),
  "hypotDependencies": () => (hypotDependencies),
  "i": () => (i),
  "iDependencies": () => (iDependencies),
  "identity": () => (identity),
  "identityDependencies": () => (identityDependencies),
  "im": () => (im),
  "imDependencies": () => (imDependencies),
  "index": () => (index),
  "indexDependencies": () => (indexDependencies),
  "indexTransformDependencies": () => (indexTransformDependencies),
  "intersect": () => (intersect),
  "intersectDependencies": () => (intersectDependencies),
  "inv": () => (inv),
  "invDependencies": () => (invDependencies),
  "inverseConductanceQuantum": () => (inverseConductanceQuantum),
  "inverseConductanceQuantumDependencies": () => (inverseConductanceQuantumDependencies),
  "isAccessorNode": () => (isAccessorNode),
  "isArray": () => (isArray),
  "isArrayNode": () => (isArrayNode),
  "isAssignmentNode": () => (isAssignmentNode),
  "isBigNumber": () => (isBigNumber),
  "isBlockNode": () => (isBlockNode),
  "isBoolean": () => (isBoolean),
  "isChain": () => (isChain),
  "isCollection": () => (isCollection),
  "isComplex": () => (isComplex),
  "isConditionalNode": () => (isConditionalNode),
  "isConstantNode": () => (isConstantNode),
  "isDate": () => (isDate),
  "isDenseMatrix": () => (isDenseMatrix),
  "isFraction": () => (isFraction),
  "isFunction": () => (isFunction),
  "isFunctionAssignmentNode": () => (isFunctionAssignmentNode),
  "isFunctionNode": () => (isFunctionNode),
  "isHelp": () => (isHelp),
  "isIndex": () => (isIndex),
  "isIndexNode": () => (isIndexNode),
  "isInteger": () => (pureFunctionsAny_generated_isInteger),
  "isIntegerDependencies": () => (isIntegerDependencies),
  "isMatrix": () => (isMatrix),
  "isNaN": () => (pureFunctionsAny_generated_isNaN),
  "isNaNDependencies": () => (isNaNDependencies),
  "isNegative": () => (isNegative),
  "isNegativeDependencies": () => (isNegativeDependencies),
  "isNode": () => (isNode),
  "isNull": () => (isNull),
  "isNumber": () => (isNumber),
  "isNumeric": () => (isNumeric),
  "isNumericDependencies": () => (isNumericDependencies),
  "isObject": () => (isObject),
  "isObjectNode": () => (isObjectNode),
  "isOperatorNode": () => (isOperatorNode),
  "isParenthesisNode": () => (isParenthesisNode),
  "isPositive": () => (isPositive),
  "isPositiveDependencies": () => (isPositiveDependencies),
  "isPrime": () => (isPrime),
  "isPrimeDependencies": () => (isPrimeDependencies),
  "isRange": () => (isRange),
  "isRangeNode": () => (isRangeNode),
  "isRegExp": () => (isRegExp),
  "isResultSet": () => (isResultSet),
  "isSparseMatrix": () => (isSparseMatrix),
  "isString": () => (isString),
  "isSymbolNode": () => (isSymbolNode),
  "isUndefined": () => (isUndefined),
  "isUnit": () => (isUnit),
  "isZero": () => (isZero),
  "isZeroDependencies": () => (isZeroDependencies),
  "kldivergence": () => (kldivergence),
  "kldivergenceDependencies": () => (kldivergenceDependencies),
  "klitzing": () => (klitzing),
  "klitzingDependencies": () => (klitzingDependencies),
  "kron": () => (kron),
  "kronDependencies": () => (kronDependencies),
  "larger": () => (larger),
  "largerDependencies": () => (largerDependencies),
  "largerEq": () => (largerEq),
  "largerEqDependencies": () => (largerEqDependencies),
  "lcm": () => (lcm),
  "lcmDependencies": () => (lcmDependencies),
  "leftShift": () => (leftShift),
  "leftShiftDependencies": () => (leftShiftDependencies),
  "log": () => (log),
  "log10": () => (pureFunctionsAny_generated_log10),
  "log10Dependencies": () => (log10Dependencies),
  "log1p": () => (pureFunctionsAny_generated_log1p),
  "log1pDependencies": () => (log1pDependencies),
  "log2": () => (pureFunctionsAny_generated_log2),
  "log2Dependencies": () => (log2Dependencies),
  "logDependencies": () => (logDependencies),
  "loschmidt": () => (loschmidt),
  "loschmidtDependencies": () => (loschmidtDependencies),
  "lsolve": () => (lsolve),
  "lsolveAll": () => (lsolveAll),
  "lsolveAllDependencies": () => (lsolveAllDependencies),
  "lsolveDependencies": () => (lsolveDependencies),
  "lup": () => (lup),
  "lupDependencies": () => (lupDependencies),
  "lusolve": () => (lusolve),
  "lusolveDependencies": () => (lusolveDependencies),
  "mad": () => (mad),
  "madDependencies": () => (madDependencies),
  "magneticConstant": () => (magneticConstant),
  "magneticConstantDependencies": () => (magneticConstantDependencies),
  "magneticFluxQuantum": () => (magneticFluxQuantum),
  "magneticFluxQuantumDependencies": () => (magneticFluxQuantumDependencies),
  "map": () => (pureFunctionsAny_generated_map),
  "mapDependencies": () => (mapDependencies),
  "mapTransformDependencies": () => (mapTransformDependencies),
  "matrix": () => (matrix),
  "matrixDependencies": () => (matrixDependencies),
  "matrixFromColumns": () => (matrixFromColumns),
  "matrixFromColumnsDependencies": () => (matrixFromColumnsDependencies),
  "matrixFromFunction": () => (matrixFromFunction),
  "matrixFromFunctionDependencies": () => (matrixFromFunctionDependencies),
  "matrixFromRows": () => (matrixFromRows),
  "matrixFromRowsDependencies": () => (matrixFromRowsDependencies),
  "max": () => (max),
  "maxDependencies": () => (maxDependencies),
  "maxTransformDependencies": () => (maxTransformDependencies),
  "mean": () => (mean),
  "meanDependencies": () => (meanDependencies),
  "meanTransformDependencies": () => (meanTransformDependencies),
  "median": () => (median),
  "medianDependencies": () => (medianDependencies),
  "min": () => (min),
  "minDependencies": () => (minDependencies),
  "minTransformDependencies": () => (minTransformDependencies),
  "mod": () => (mod),
  "modDependencies": () => (modDependencies),
  "mode": () => (mode),
  "modeDependencies": () => (modeDependencies),
  "molarMass": () => (molarMass),
  "molarMassC12": () => (molarMassC12),
  "molarMassC12Dependencies": () => (molarMassC12Dependencies),
  "molarMassDependencies": () => (molarMassDependencies),
  "molarPlanckConstant": () => (molarPlanckConstant),
  "molarPlanckConstantDependencies": () => (molarPlanckConstantDependencies),
  "molarVolume": () => (molarVolume),
  "molarVolumeDependencies": () => (molarVolumeDependencies),
  "multinomial": () => (multinomial),
  "multinomialDependencies": () => (multinomialDependencies),
  "multiply": () => (multiply),
  "multiplyDependencies": () => (multiplyDependencies),
  "multiplyScalar": () => (multiplyScalar),
  "multiplyScalarDependencies": () => (multiplyScalarDependencies),
  "neutronMass": () => (neutronMass),
  "neutronMassDependencies": () => (neutronMassDependencies),
  "norm": () => (norm),
  "normDependencies": () => (normDependencies),
  "not": () => (not),
  "notDependencies": () => (notDependencies),
  "nthRoot": () => (nthRoot),
  "nthRootDependencies": () => (nthRootDependencies),
  "nthRoots": () => (nthRoots),
  "nthRootsDependencies": () => (nthRootsDependencies),
  "nuclearMagneton": () => (nuclearMagneton),
  "nuclearMagnetonDependencies": () => (nuclearMagnetonDependencies),
  "nullDependencies": () => (nullDependencies),
  "number": () => (number),
  "numberDependencies": () => (numberDependencies),
  "numeric": () => (numeric),
  "numericDependencies": () => (numericDependencies),
  "oct": () => (oct),
  "octDependencies": () => (octDependencies),
  "ones": () => (ones),
  "onesDependencies": () => (onesDependencies),
  "or": () => (or),
  "orDependencies": () => (orDependencies),
  "parse": () => (parse),
  "parseDependencies": () => (parseDependencies),
  "parser": () => (parser),
  "parserDependencies": () => (parserDependencies),
  "partitionSelect": () => (partitionSelect),
  "partitionSelectDependencies": () => (partitionSelectDependencies),
  "permutations": () => (permutations),
  "permutationsDependencies": () => (permutationsDependencies),
  "phi": () => (pureFunctionsAny_generated_phi),
  "phiDependencies": () => (phiDependencies),
  "pi": () => (pureFunctionsAny_generated_pi),
  "piDependencies": () => (piDependencies),
  "pickRandom": () => (pickRandom),
  "pickRandomDependencies": () => (pickRandomDependencies),
  "planckCharge": () => (planckCharge),
  "planckChargeDependencies": () => (planckChargeDependencies),
  "planckConstant": () => (planckConstant),
  "planckConstantDependencies": () => (planckConstantDependencies),
  "planckLength": () => (planckLength),
  "planckLengthDependencies": () => (planckLengthDependencies),
  "planckMass": () => (planckMass),
  "planckMassDependencies": () => (planckMassDependencies),
  "planckTemperature": () => (planckTemperature),
  "planckTemperatureDependencies": () => (planckTemperatureDependencies),
  "planckTime": () => (planckTime),
  "planckTimeDependencies": () => (planckTimeDependencies),
  "pow": () => (pow),
  "powDependencies": () => (powDependencies),
  "print": () => (print),
  "printDependencies": () => (printDependencies),
  "prod": () => (prod),
  "prodDependencies": () => (prodDependencies),
  "protonMass": () => (protonMass),
  "protonMassDependencies": () => (protonMassDependencies),
  "qr": () => (qr),
  "qrDependencies": () => (qrDependencies),
  "quantileSeq": () => (quantileSeq),
  "quantileSeqDependencies": () => (quantileSeqDependencies),
  "quantumOfCirculation": () => (quantumOfCirculation),
  "quantumOfCirculationDependencies": () => (quantumOfCirculationDependencies),
  "random": () => (random),
  "randomDependencies": () => (randomDependencies),
  "randomInt": () => (randomInt),
  "randomIntDependencies": () => (randomIntDependencies),
  "range": () => (range),
  "rangeDependencies": () => (rangeDependencies),
  "rangeTransformDependencies": () => (rangeTransformDependencies),
  "rationalize": () => (rationalize),
  "rationalizeDependencies": () => (rationalizeDependencies),
  "re": () => (re),
  "reDependencies": () => (reDependencies),
  "reducedPlanckConstant": () => (reducedPlanckConstant),
  "reducedPlanckConstantDependencies": () => (reducedPlanckConstantDependencies),
  "replacer": () => (replacer),
  "replacerDependencies": () => (replacerDependencies),
  "reshape": () => (pureFunctionsAny_generated_reshape),
  "reshapeDependencies": () => (reshapeDependencies),
  "resize": () => (pureFunctionsAny_generated_resize),
  "resizeDependencies": () => (resizeDependencies),
  "reviver": () => (reviver),
  "reviverDependencies": () => (reviverDependencies),
  "rightArithShift": () => (rightArithShift),
  "rightArithShiftDependencies": () => (rightArithShiftDependencies),
  "rightLogShift": () => (rightLogShift),
  "rightLogShiftDependencies": () => (rightLogShiftDependencies),
  "rotate": () => (rotate),
  "rotateDependencies": () => (rotateDependencies),
  "rotationMatrix": () => (rotationMatrix),
  "rotationMatrixDependencies": () => (rotationMatrixDependencies),
  "round": () => (round),
  "roundDependencies": () => (roundDependencies),
  "row": () => (row),
  "rowDependencies": () => (rowDependencies),
  "rowTransformDependencies": () => (rowTransformDependencies),
  "rydberg": () => (rydberg),
  "rydbergDependencies": () => (rydbergDependencies),
  "sackurTetrode": () => (sackurTetrode),
  "sackurTetrodeDependencies": () => (sackurTetrodeDependencies),
  "sec": () => (sec),
  "secDependencies": () => (secDependencies),
  "sech": () => (sech),
  "sechDependencies": () => (sechDependencies),
  "secondRadiation": () => (secondRadiation),
  "secondRadiationDependencies": () => (secondRadiationDependencies),
  "setCartesian": () => (setCartesian),
  "setCartesianDependencies": () => (setCartesianDependencies),
  "setDifference": () => (setDifference),
  "setDifferenceDependencies": () => (setDifferenceDependencies),
  "setDistinct": () => (setDistinct),
  "setDistinctDependencies": () => (setDistinctDependencies),
  "setIntersect": () => (setIntersect),
  "setIntersectDependencies": () => (setIntersectDependencies),
  "setIsSubset": () => (setIsSubset),
  "setIsSubsetDependencies": () => (setIsSubsetDependencies),
  "setMultiplicity": () => (setMultiplicity),
  "setMultiplicityDependencies": () => (setMultiplicityDependencies),
  "setPowerset": () => (setPowerset),
  "setPowersetDependencies": () => (setPowersetDependencies),
  "setSize": () => (setSize),
  "setSizeDependencies": () => (setSizeDependencies),
  "setSymDifference": () => (setSymDifference),
  "setSymDifferenceDependencies": () => (setSymDifferenceDependencies),
  "setUnion": () => (setUnion),
  "setUnionDependencies": () => (setUnionDependencies),
  "sign": () => (pureFunctionsAny_generated_sign),
  "signDependencies": () => (signDependencies),
  "simplify": () => (simplify),
  "simplifyDependencies": () => (simplifyDependencies),
  "sin": () => (sin),
  "sinDependencies": () => (sinDependencies),
  "sinh": () => (pureFunctionsAny_generated_sinh),
  "sinhDependencies": () => (sinhDependencies),
  "size": () => (size),
  "sizeDependencies": () => (sizeDependencies),
  "slu": () => (slu),
  "sluDependencies": () => (sluDependencies),
  "smaller": () => (smaller),
  "smallerDependencies": () => (smallerDependencies),
  "smallerEq": () => (smallerEq),
  "smallerEqDependencies": () => (smallerEqDependencies),
  "sort": () => (sort),
  "sortDependencies": () => (sortDependencies),
  "sparse": () => (sparse),
  "sparseDependencies": () => (sparseDependencies),
  "speedOfLight": () => (speedOfLight),
  "speedOfLightDependencies": () => (speedOfLightDependencies),
  "splitUnit": () => (splitUnit),
  "splitUnitDependencies": () => (splitUnitDependencies),
  "sqrt": () => (sqrt),
  "sqrtDependencies": () => (sqrtDependencies),
  "sqrtm": () => (sqrtm),
  "sqrtmDependencies": () => (sqrtmDependencies),
  "square": () => (square),
  "squareDependencies": () => (squareDependencies),
  "squeeze": () => (pureFunctionsAny_generated_squeeze),
  "squeezeDependencies": () => (squeezeDependencies),
  "std": () => (std),
  "stdDependencies": () => (stdDependencies),
  "stdTransformDependencies": () => (stdTransformDependencies),
  "stefanBoltzmann": () => (stefanBoltzmann),
  "stefanBoltzmannDependencies": () => (stefanBoltzmannDependencies),
  "stirlingS2": () => (stirlingS2),
  "stirlingS2Dependencies": () => (stirlingS2Dependencies),
  "string": () => (string),
  "stringDependencies": () => (stringDependencies),
  "subset": () => (subset),
  "subsetDependencies": () => (subsetDependencies),
  "subsetTransformDependencies": () => (subsetTransformDependencies),
  "subtract": () => (subtract),
  "subtractDependencies": () => (subtractDependencies),
  "sum": () => (sum),
  "sumDependencies": () => (sumDependencies),
  "sumTransformDependencies": () => (sumTransformDependencies),
  "tan": () => (tan),
  "tanDependencies": () => (tanDependencies),
  "tanh": () => (pureFunctionsAny_generated_tanh),
  "tanhDependencies": () => (tanhDependencies),
  "tau": () => (pureFunctionsAny_generated_tau),
  "tauDependencies": () => (tauDependencies),
  "thomsonCrossSection": () => (thomsonCrossSection),
  "thomsonCrossSectionDependencies": () => (thomsonCrossSectionDependencies),
  "to": () => (to),
  "toDependencies": () => (toDependencies),
  "trace": () => (trace),
  "traceDependencies": () => (traceDependencies),
  "transpose": () => (transpose),
  "transposeDependencies": () => (transposeDependencies),
  "trueDependencies": () => (trueDependencies),
  "typeOf": () => (pureFunctionsAny_generated_typeOf),
  "typeOfDependencies": () => (typeOfDependencies),
  "typed": () => (typed),
  "typedDependencies": () => (typedDependencies),
  "unaryMinus": () => (unaryMinus),
  "unaryMinusDependencies": () => (unaryMinusDependencies),
  "unaryPlus": () => (unaryPlus),
  "unaryPlusDependencies": () => (unaryPlusDependencies),
  "unequal": () => (unequal),
  "unequalDependencies": () => (unequalDependencies),
  "unit": () => (unit),
  "unitDependencies": () => (unitDependencies),
  "usolve": () => (usolve),
  "usolveAll": () => (usolveAll),
  "usolveAllDependencies": () => (usolveAllDependencies),
  "usolveDependencies": () => (usolveDependencies),
  "vacuumImpedance": () => (vacuumImpedance),
  "vacuumImpedanceDependencies": () => (vacuumImpedanceDependencies),
  "variance": () => (variance),
  "varianceDependencies": () => (varianceDependencies),
  "varianceTransformDependencies": () => (varianceTransformDependencies),
  "version": () => (pureFunctionsAny_generated_version),
  "versionDependencies": () => (versionDependencies),
  "weakMixingAngle": () => (weakMixingAngle),
  "weakMixingAngleDependencies": () => (weakMixingAngleDependencies),
  "wienDisplacement": () => (wienDisplacement),
  "wienDisplacementDependencies": () => (wienDisplacementDependencies),
  "xgcd": () => (xgcd),
  "xgcdDependencies": () => (xgcdDependencies),
  "xor": () => (xor),
  "xorDependencies": () => (xorDependencies),
  "zeros": () => (pureFunctionsAny_generated_zeros),
  "zerosDependencies": () => (zerosDependencies)
});

// EXTERNAL MODULE: ./src/main.js
var main = __webpack_require__("./src/main.js");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/extends.js
var helpers_extends = __webpack_require__("./node_modules/@babel/runtime/helpers/extends.js");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/core/config.js
var DEFAULT_CONFIG = { epsilon: 1e-12, matrix: "Matrix", number: "number", precision: 64, predictable: !1, randomSeed: null };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/is.js
function isNumber(x) {return "number" == typeof x;}function isBigNumber(x) {return x && !0 === x.constructor.prototype.isBigNumber || !1;}function isComplex(x) {return x && "object" == typeof x && !0 === Object.getPrototypeOf(x).isComplex || !1;}function isFraction(x) {return x && "object" == typeof x && !0 === Object.getPrototypeOf(x).isFraction || !1;}function isUnit(x) {return x && !0 === x.constructor.prototype.isUnit || !1;}function isString(x) {return "string" == typeof x;}var isArray = Array.isArray;function isMatrix(x) {return x && !0 === x.constructor.prototype.isMatrix || !1;}function isCollection(x) {return Array.isArray(x) || isMatrix(x);}function isDenseMatrix(x) {return x && x.isDenseMatrix && !0 === x.constructor.prototype.isMatrix || !1;}function isSparseMatrix(x) {return x && x.isSparseMatrix && !0 === x.constructor.prototype.isMatrix || !1;}function isRange(x) {return x && !0 === x.constructor.prototype.isRange || !1;}function isIndex(x) {return x && !0 === x.constructor.prototype.isIndex || !1;}function isBoolean(x) {return "boolean" == typeof x;}function isResultSet(x) {return x && !0 === x.constructor.prototype.isResultSet || !1;}function isHelp(x) {return x && !0 === x.constructor.prototype.isHelp || !1;}function isFunction(x) {return "function" == typeof x;}function isDate(x) {return x instanceof Date;}function isRegExp(x) {return x instanceof RegExp;}function isObject(x) {return !(!x || "object" != typeof x || x.constructor !== Object || isComplex(x) || isFraction(x));}function isNull(x) {return null === x;}function isUndefined(x) {return x === void 0;}function isAccessorNode(x) {return x && !0 === x.isAccessorNode && !0 === x.constructor.prototype.isNode || !1;}function isArrayNode(x) {return x && !0 === x.isArrayNode && !0 === x.constructor.prototype.isNode || !1;}function isAssignmentNode(x) {return x && !0 === x.isAssignmentNode && !0 === x.constructor.prototype.isNode || !1;}function isBlockNode(x) {return x && !0 === x.isBlockNode && !0 === x.constructor.prototype.isNode || !1;}function isConditionalNode(x) {return x && !0 === x.isConditionalNode && !0 === x.constructor.prototype.isNode || !1;}function isConstantNode(x) {return x && !0 === x.isConstantNode && !0 === x.constructor.prototype.isNode || !1;}function isFunctionAssignmentNode(x) {return x && !0 === x.isFunctionAssignmentNode && !0 === x.constructor.prototype.isNode || !1;}function isFunctionNode(x) {return x && !0 === x.isFunctionNode && !0 === x.constructor.prototype.isNode || !1;}function isIndexNode(x) {return x && !0 === x.isIndexNode && !0 === x.constructor.prototype.isNode || !1;}function isNode(x) {return x && !0 === x.isNode && !0 === x.constructor.prototype.isNode || !1;}function isObjectNode(x) {return x && !0 === x.isObjectNode && !0 === x.constructor.prototype.isNode || !1;}function isOperatorNode(x) {return x && !0 === x.isOperatorNode && !0 === x.constructor.prototype.isNode || !1;}function isParenthesisNode(x) {return x && !0 === x.isParenthesisNode && !0 === x.constructor.prototype.isNode || !1;}function isRangeNode(x) {return x && !0 === x.isRangeNode && !0 === x.constructor.prototype.isNode || !1;}function isSymbolNode(x) {return x && !0 === x.isSymbolNode && !0 === x.constructor.prototype.isNode || !1;}function isChain(x) {return x && !0 === x.constructor.prototype.isChain || !1;}function typeOf(x) {var t = typeof x;return "object" == t ? null === x ? "null" : Array.isArray(x) ? "Array" : x instanceof Date ? "Date" : x instanceof RegExp ? "RegExp" : isBigNumber(x) ? "BigNumber" : isComplex(x) ? "Complex" : isFraction(x) ? "Fraction" : isMatrix(x) ? "Matrix" : isUnit(x) ? "Unit" : isIndex(x) ? "Index" : isRange(x) ? "Range" : isResultSet(x) ? "ResultSet" : isNode(x) ? x.type : isChain(x) ? "Chain" : isHelp(x) ? "Help" : "Object" : "function" == t ? "Function" : t;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/object.js
function clone(x) {var type = typeof x;if ("number" == type || "string" === type || "boolean" === type || null === x || x === void 0) return x;if ("function" == typeof x.clone) return x.clone();if (Array.isArray(x)) return x.map(function (value) {return clone(value);});if (x instanceof Date) return new Date(x.valueOf());if (isBigNumber(x)) return x;if (x instanceof RegExp) throw new TypeError("Cannot clone " + x);return mapObject(x, clone);}function mapObject(object, callback) {var clone = {};for (var key in object) object_hasOwnProperty(object, key) && (clone[key] = callback(object[key]));return clone;}function extend(a, b) {for (var prop in b) object_hasOwnProperty(b, prop) && (a[prop] = b[prop]);return a;}function deepExtend(a, b) {if (Array.isArray(b)) throw new TypeError("Arrays are not supported by deepExtend");for (var prop in b) if (object_hasOwnProperty(b, prop) && !(prop in Object.prototype) && !(prop in Function.prototype)) if (b[prop] && b[prop].constructor === Object) void 0 === a[prop] && (a[prop] = {}), a[prop] && a[prop].constructor === Object ? deepExtend(a[prop], b[prop]) : a[prop] = b[prop];else if (Array.isArray(b[prop])) throw new TypeError("Arrays are not supported by deepExtend");else a[prop] = b[prop];return a;}function deepStrictEqual(a, b) {var prop, i, len;if (Array.isArray(a)) {if (!Array.isArray(b)) return !1;if (a.length !== b.length) return !1;for (i = 0, len = a.length; i < len; i++) if (!deepStrictEqual(a[i], b[i])) return !1;return !0;}if ("function" == typeof a) return a === b;if (a instanceof Object) {if (Array.isArray(b) || !(b instanceof Object)) return !1;for (prop in a) if (!(prop in b) || !deepStrictEqual(a[prop], b[prop])) return !1;for (prop in b) if (!(prop in a) || !deepStrictEqual(a[prop], b[prop])) return !1;return !0;}return a === b;}function deepFlatten(nestedObject) {var flattenedObject = {};return _deepFlatten(nestedObject, flattenedObject), flattenedObject;}function _deepFlatten(nestedObject, flattenedObject) {for (var prop in nestedObject) if (object_hasOwnProperty(nestedObject, prop)) {var value = nestedObject[prop];"object" == typeof value && null !== value ? _deepFlatten(value, flattenedObject) : flattenedObject[prop] = value;}}function canDefineProperty() {try {if (Object.defineProperty) return Object.defineProperty({}, "x", { get: function () {} }), !0;} catch (e) {}return !1;}function lazy(object, prop, valueResolver) {var _value,_uninitialized = !0;Object.defineProperty(object, prop, { get: function () {return _uninitialized && (_value = valueResolver(), _uninitialized = !1), _value;}, set: function (value) {_value = value, _uninitialized = !1;}, configurable: !0, enumerable: !0 });}function traverse(object, path) {if (path && "string" == typeof path) return traverse(object, path.split("."));var obj = object;if (path) for (var key, i = 0; i < path.length; i++) key = path[i], key in obj || (obj[key] = {}), obj = obj[key];return obj;}function object_hasOwnProperty(object, property) {return object && Object.hasOwnProperty.call(object, property);}function isLegacyFactory(object) {return object && "function" == typeof object.factory;}function get(object, path) {if ("string" == typeof path) return isPath(path) ? get(object, path.split(".")) : object[path];for (var key, child = object, i = 0; i < path.length; i++) key = path[i], child = child ? child[key] : void 0;return child;}function set(object, path, value) {if ("string" == typeof path) return isPath(path) ? set(object, path.split("."), value) : (object[path] = value, object);for (var key, child = object, i = 0; i < path.length - 1; i++) key = path[i], void 0 === child[key] && (child[key] = {}), child = child[key];if (0 < path.length) {var lastKey = path[path.length - 1];child[lastKey] = value;}return object;}function pick(object, properties, transform) {for (var copy = {}, i = 0; i < properties.length; i++) {var key = properties[i],value = get(object, key);value !== void 0 && set(copy, key, transform ? transform(value, key) : value);}return copy;}function pickShallow(object, properties) {for (var copy = {}, i = 0; i < properties.length; i++) {var key = properties[i],value = object[key];value !== void 0 && (copy[key] = value);}return copy;}function values(object) {return Object.keys(object).map((key) => object[key]);}function isPath(str) {return -1 !== str.indexOf(".");}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/core/function/config.js
var MATRIX_OPTIONS = ["Matrix", "Array"];var NUMBER_OPTIONS = ["number", "BigNumber", "Fraction"];function configFactory(config, emit) {function _config(options) {if (options) {var prev = mapObject(config, clone);validateOption(options, "matrix", MATRIX_OPTIONS), validateOption(options, "number", NUMBER_OPTIONS), deepExtend(config, options);var curr = mapObject(config, clone),changes = mapObject(options, clone);return emit("config", curr, prev, changes), curr;}return mapObject(config, clone);}return _config.MATRIX_OPTIONS = MATRIX_OPTIONS, _config.NUMBER_OPTIONS = NUMBER_OPTIONS, Object.keys(DEFAULT_CONFIG).forEach((key) => {Object.defineProperty(_config, key, { get: () => config[key], enumerable: !0, configurable: !0 });}), _config;}function config_contains(array, item) {return -1 !== array.indexOf(item);}function validateOption(options, name, values) {options[name] === void 0 || config_contains(values, options[name]) || console.warn("Warning: Unknown value \"" + options[name] + "\" for configuration option \"" + name + "\". Available options: " + values.map((value) => JSON.stringify(value)).join(", ") + ".");}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/configReadonly.js
var config = function (options) {if (options) throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n  import { create, all } from 'mathjs';\n  const mathjs = create(all);\n  mathjs.config({ number: 'BigNumber' });\n");return Object.freeze(DEFAULT_CONFIG);};helpers_extends(config, DEFAULT_CONFIG, { MATRIX_OPTIONS: MATRIX_OPTIONS, NUMBER_OPTIONS: NUMBER_OPTIONS });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/factory.js
function factory(name, dependencies, create, meta) {function assertAndCreate(scope) {var deps = pickShallow(scope, dependencies.map(stripOptionalNotation));return assertDependencies(name, dependencies, scope), create(deps);}return assertAndCreate.isFactory = !0, assertAndCreate.fn = name, assertAndCreate.dependencies = dependencies.slice().sort(), meta && (assertAndCreate.meta = meta), assertAndCreate;}function sortFactories(factories) {function containsDependency(factory, dependency) {if (isFactory(factory)) {if (contains(factory.dependencies, dependency.fn || dependency.name)) return !0;if (factory.dependencies.some((d) => containsDependency(factoriesByName[d], dependency))) return !0;}return !1;}function addFactory(factory) {for (var index = 0; index < sorted.length && !containsDependency(sorted[index], factory);) index++;sorted.splice(index, 0, factory);}var factoriesByName = {};factories.forEach((factory) => {factoriesByName[factory.fn] = factory;});var sorted = [];return factories.filter(isFactory).forEach(addFactory), factories.filter((factory) => !isFactory(factory)).forEach(addFactory), sorted;}function create(factories) {var scope = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};return sortFactories(factories).forEach((factory) => factory(scope)), scope;}function isFactory(obj) {return "function" == typeof obj && "string" == typeof obj.fn && Array.isArray(obj.dependencies);}function assertDependencies(name, dependencies, scope) {var allDefined = dependencies.filter((dependency) => !isOptionalDependency(dependency)).every((dependency) => scope[dependency] !== void 0);if (!allDefined) {var missingDependencies = dependencies.filter((dependency) => scope[dependency] === void 0);throw new Error("Cannot create function \"".concat(name, "\", ") + "some dependencies are missing: ".concat(missingDependencies.map((d) => "\"".concat(d, "\"")).join(", "), "."));}}function isOptionalDependency(dependency) {return dependency && "?" === dependency[0];}function stripOptionalNotation(dependency) {return dependency && "?" === dependency[0] ? dependency.slice(1) : dependency;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/resultset/ResultSet.js
var ResultSet_name = "ResultSet",dependencies = [];var createResultSet = factory("ResultSet", dependencies, () => {function ResultSet(entries) {if (!(this instanceof ResultSet)) throw new SyntaxError("Constructor must be called with the new operator");this.entries = entries || [];}return ResultSet.prototype.type = "ResultSet", ResultSet.prototype.isResultSet = !0, ResultSet.prototype.valueOf = function () {return this.entries;}, ResultSet.prototype.toString = function () {return "[" + this.entries.join(", ") + "]";}, ResultSet.prototype.toJSON = function () {return { mathjs: "ResultSet", entries: this.entries };}, ResultSet.fromJSON = function (json) {return new ResultSet(json.entries);}, ResultSet;}, { isClass: !0 });
// EXTERNAL MODULE: ./node_modules/complex.js/complex.js
var complex = __webpack_require__("./node_modules/complex.js/complex.js");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/number.js
function isInteger(value) {return !("boolean" != typeof value) || !!isFinite(value) && value === Math.round(value);}var sign = Math.sign || function (x) {return 0 < x ? 1 : 0 > x ? -1 : 0;};var log2 = Math.log2 || function (x) {return Math.log(x) / Math.LN2;};var log10 = Math.log10 || function (x) {return Math.log(x) / Math.LN10;};var log1p = Math.log1p || function (x) {return Math.log(x + 1);};var cbrt = Math.cbrt || function (x) {if (0 === x) return x;var result,negate = 0 > x;return negate && (x = -x), isFinite(x) ? (result = Math.exp(Math.log(x) / 3), result = (x / (result * result) + 2 * result) / 3) : result = x, negate ? -result : result;};var expm1 = Math.expm1 || function (x) {return 2e-4 <= x || -2e-4 >= x ? Math.exp(x) - 1 : x + x * x / 2 + x * x * x / 6;};function formatNumberToBase(n, base, size) {var prefix = { 2: "0b", 8: "0o", 16: "0x" }[base],suffix = "";if (size) {if (1 > size) throw new Error("size must be in greater than 0");if (!isInteger(size)) throw new Error("size must be an integer");if (n > 2 ** (size - 1) - 1 || n < -(2 ** (size - 1))) throw new Error("Value must be in range [-2^".concat(size - 1, ", 2^").concat(size - 1, "-1]"));if (!isInteger(n)) throw new Error("Value must be an integer");0 > n && (n += 2 ** size), suffix = "i".concat(size);}var sign = "";return 0 > n && (n = -n, sign = "-"), "".concat(sign).concat(prefix).concat(n.toString(base)).concat(suffix);}function format(value, options) {if ("function" == typeof options) return options(value);if (value === 1 / 0) return "Infinity";if (value === -Infinity) return "-Infinity";if (isNaN(value)) return "NaN";var precision,wordSize,notation = "auto";if (options && (options.notation && (notation = options.notation), isNumber(options) ? precision = options : isNumber(options.precision) && (precision = options.precision), options.wordSize && (wordSize = options.wordSize, "number" != typeof wordSize))) throw new Error("Option \"wordSize\" must be a number");switch (notation) {case "fixed":return toFixed(value, precision);case "exponential":return toExponential(value, precision);case "engineering":return toEngineering(value, precision);case "bin":return formatNumberToBase(value, 2, wordSize);case "oct":return formatNumberToBase(value, 8, wordSize);case "hex":return formatNumberToBase(value, 16, wordSize);case "auto":return toPrecision(value, precision, options && options).replace(/((\.\d*?)(0+))($|e)/, function () {var digits = arguments[2],e = arguments[4];return "." === digits ? e : digits + e;});default:throw new Error("Unknown notation \"" + notation + "\". Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.");}}function splitNumber(value) {var match = (value + "").toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if (!match) throw new SyntaxError("Invalid number " + value);var sign = match[1],digits = match[2],exponent = parseFloat(match[4] || "0"),dot = digits.indexOf(".");exponent += -1 === dot ? digits.length - 1 : dot - 1;var coefficients = digits.replace(".", "").replace(/^0*/, function (zeros) {return exponent -= zeros.length, "";}).replace(/0*$/, "").split("").map(function (d) {return parseInt(d);});return 0 === coefficients.length && (coefficients.push(0), exponent++), { sign: sign, coefficients: coefficients, exponent: exponent };}function toEngineering(value, precision) {if (isNaN(value) || !isFinite(value)) return value + "";var split = splitNumber(value),rounded = roundDigits(split, precision),e = rounded.exponent,c = rounded.coefficients,newExp = 0 == e % 3 ? e : 0 > e ? e - 3 - e % 3 : e - e % 3;if (isNumber(precision)) for (; precision > c.length || e - newExp + 1 > c.length;) c.push(0);else for (var missingZeros = Math.abs(e - newExp) - (c.length - 1), i = 0; i < missingZeros; i++) c.push(0);for (var expDiff = Math.abs(e - newExp), decimalIdx = 1; 0 < expDiff;) decimalIdx++, expDiff--;var decimals = c.slice(decimalIdx).join(""),decimalVal = isNumber(precision) && decimals.length || decimals.match(/[1-9]/) ? "." + decimals : "",str = c.slice(0, decimalIdx).join("") + decimalVal + "e" + (0 <= e ? "+" : "") + newExp.toString();return rounded.sign + str;}function toFixed(value, precision) {if (isNaN(value) || !isFinite(value)) return value + "";var splitValue = splitNumber(value),rounded = "number" == typeof precision ? roundDigits(splitValue, splitValue.exponent + 1 + precision) : splitValue,c = rounded.coefficients,p = rounded.exponent + 1,pp = p + (precision || 0);return c.length < pp && (c = c.concat(zeros(pp - c.length))), 0 > p && (c = zeros(-p + 1).concat(c), p = 1), p < c.length && c.splice(p, 0, 0 === p ? "0." : "."), rounded.sign + c.join("");}function toExponential(value, precision) {if (isNaN(value) || !isFinite(value)) return value + "";var split = splitNumber(value),rounded = precision ? roundDigits(split, precision) : split,c = rounded.coefficients,e = rounded.exponent;c.length < precision && (c = c.concat(zeros(precision - c.length)));var first = c.shift();return rounded.sign + first + (0 < c.length ? "." + c.join("") : "") + "e" + (0 <= e ? "+" : "") + e;}function toPrecision(value, precision, options) {if (isNaN(value) || !isFinite(value)) return value + "";var lowerExp = options && options.lowerExp !== void 0 ? options.lowerExp : -3,upperExp = options && options.upperExp !== void 0 ? options.upperExp : 5,split = splitNumber(value),rounded = precision ? roundDigits(split, precision) : split;if (rounded.exponent < lowerExp || rounded.exponent >= upperExp) return toExponential(value, precision);var c = rounded.coefficients,e = rounded.exponent;c.length < precision && (c = c.concat(zeros(precision - c.length))), c = c.concat(zeros(e - c.length + 1 + (c.length < precision ? precision - c.length : 0))), c = zeros(-e).concat(c);var dot = 0 < e ? e : 0;return dot < c.length - 1 && c.splice(dot + 1, 0, "."), rounded.sign + c.join("");}function roundDigits(split, precision) {for (var rounded = { sign: split.sign, coefficients: split.coefficients, exponent: split.exponent }, c = rounded.coefficients; 0 >= precision;) c.unshift(0), rounded.exponent++, precision++;if (c.length > precision) {var removed = c.splice(precision, c.length - precision);if (5 <= removed[0]) {var i = precision - 1;for (c[i]++; 10 === c[i];) c.pop(), 0 === i && (c.unshift(0), rounded.exponent++, i++), i--, c[i]++;}}return rounded;}function zeros(length) {for (var arr = [], i = 0; i < length; i++) arr.push(0);return arr;}function digits(value) {return value.toExponential().replace(/e.*$/, "").replace(/^0\.?0*|\./, "").length;}var DBL_EPSILON = Number.EPSILON || 2220446049250313e-31;function nearlyEqual(x, y, epsilon) {if (null === epsilon || epsilon === void 0) return x === y;if (x === y) return !0;if (isNaN(x) || isNaN(y)) return !1;if (isFinite(x) && isFinite(y)) {var diff = Math.abs(x - y);return !!(diff < DBL_EPSILON) || diff <= Math.max(Math.abs(x), Math.abs(y)) * epsilon;}return !1;}var acosh = Math.acosh || function (x) {return Math.log(Math.sqrt(x * x - 1) + x);};var asinh = Math.asinh || function (x) {return Math.log(Math.sqrt(x * x + 1) + x);};var atanh = Math.atanh || function (x) {return Math.log((1 + x) / (1 - x)) / 2;};var cosh = Math.cosh || function (x) {return (Math.exp(x) + Math.exp(-x)) / 2;};var sinh = Math.sinh || function (x) {return (Math.exp(x) - Math.exp(-x)) / 2;};var tanh = Math.tanh || function (x) {var e = Math.exp(2 * x);return (e - 1) / (e + 1);};
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/complex/Complex.js
var Complex_name = "Complex",Complex_dependencies = [];var createComplexClass = factory("Complex", Complex_dependencies, () => (complex.prototype.type = "Complex", complex.prototype.isComplex = !0, complex.prototype.toJSON = function () {return { mathjs: "Complex", re: this.re, im: this.im };}, complex.prototype.toPolar = function () {return { r: this.abs(), phi: this.arg() };}, complex.prototype.format = function (options) {var str = "",im = this.im,re = this.re,strRe = format(this.re, options),strIm = format(this.im, options),precision = isNumber(options) ? options : options ? options.precision : null;if (null !== precision) {var epsilon = Math.pow(10, -precision);Math.abs(re / im) < epsilon && (re = 0), Math.abs(im / re) < epsilon && (im = 0);}return str = 0 === im ? strRe : 0 === re ? 1 === im ? "i" : -1 === im ? "-i" : strIm + "i" : 0 > im ? -1 === im ? strRe + " - i" : strRe + " - " + strIm.substring(1) + "i" : 1 === im ? strRe + " + i" : strRe + " + " + strIm + "i", str;}, complex.fromPolar = function () {switch (arguments.length) {case 1:{var arg = arguments[0];if ("object" == typeof arg) return complex(arg);throw new TypeError("Input has to be an object with r and phi keys.");}case 2:{var r = arguments[0],phi = arguments[1];if (isNumber(r)) {if (isUnit(phi) && phi.hasBase("ANGLE") && (phi = phi.toNumber("rad")), isNumber(phi)) return new complex({ r: r, phi: phi });throw new TypeError("Phi is not a number nor an angle unit.");} else throw new TypeError("Radius r is not a number.");}default:throw new SyntaxError("Wrong number of arguments in function fromPolar");}}, complex.prototype.valueOf = complex.prototype.toString, complex.fromJSON = function (json) {return new complex(json);}, complex.compare = function (a, b) {return a.re > b.re ? 1 : a.re < b.re ? -1 : a.im > b.im ? 1 : a.im < b.im ? -1 : 0;}, complex), { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/Range.js
var Range_name = "Range",Range_dependencies = [];var createRangeClass = factory("Range", Range_dependencies, () => {function Range(start, end, step) {if (!(this instanceof Range)) throw new SyntaxError("Constructor must be called with the new operator");var hasStart = null !== start && void 0 !== start,hasEnd = null !== end && void 0 !== end,hasStep = null !== step && void 0 !== step;if (hasStart) if (isBigNumber(start)) start = start.toNumber();else if ("number" != typeof start) throw new TypeError("Parameter start must be a number");if (hasEnd) if (isBigNumber(end)) end = end.toNumber();else if ("number" != typeof end) throw new TypeError("Parameter end must be a number");if (hasStep) if (isBigNumber(step)) step = step.toNumber();else if ("number" != typeof step) throw new TypeError("Parameter step must be a number");this.start = hasStart ? parseFloat(start) : 0, this.end = hasEnd ? parseFloat(end) : 0, this.step = hasStep ? parseFloat(step) : 1;}return Range.prototype.type = "Range", Range.prototype.isRange = !0, Range.parse = function (str) {if ("string" != typeof str) return null;var args = str.split(":"),nums = args.map(function (arg) {return parseFloat(arg);}),invalid = nums.some(function (num) {return isNaN(num);});if (invalid) return null;switch (nums.length) {case 2:return new Range(nums[0], nums[1]);case 3:return new Range(nums[0], nums[2], nums[1]);default:return null;}}, Range.prototype.clone = function () {return new Range(this.start, this.end, this.step);}, Range.prototype.size = function () {var len = 0,start = this.start,step = this.step,end = this.end,diff = end - start;return sign(step) === sign(diff) ? len = Math.ceil(diff / step) : 0 === diff && (len = 0), isNaN(len) && (len = 0), [len];}, Range.prototype.min = function () {var size = this.size()[0];return 0 < size ? 0 < this.step ? this.start : this.start + (size - 1) * this.step : void 0;}, Range.prototype.max = function () {var size = this.size()[0];return 0 < size ? 0 < this.step ? this.start + (size - 1) * this.step : this.start : void 0;}, Range.prototype.forEach = function (callback) {var x = this.start,step = this.step,end = this.end,i = 0;if (0 < step) for (; x < end;) callback(x, [i], this), x += step, i++;else if (0 > step) for (; x > end;) callback(x, [i], this), x += step, i++;}, Range.prototype.map = function (callback) {var array = [];return this.forEach(function (value, index, obj) {array[index[0]] = callback(value, index, obj);}), array;}, Range.prototype.toArray = function () {var array = [];return this.forEach(function (value, index) {array[index[0]] = value;}), array;}, Range.prototype.valueOf = function () {return this.toArray();}, Range.prototype.format = function (options) {var str = format(this.start, options);return 1 !== this.step && (str += ":" + format(this.step, options)), str += ":" + format(this.end, options), str;}, Range.prototype.toString = function () {return this.format();}, Range.prototype.toJSON = function () {return { mathjs: "Range", start: this.start, end: this.end, step: this.step };}, Range.fromJSON = function (json) {return new Range(json.start, json.end, json.step);}, Range;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/version.js
var version = "9.4.1";
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/lruQueue.js
function lruQueue(limit) {var size = 0,base = 1,queue = Object.create(null),map = Object.create(null),index = 0,del = function (id) {var oldIndex = map[id];if (oldIndex && (delete queue[oldIndex], delete map[id], --size, base === oldIndex)) {if (!size) return index = 0, void (base = 1);for (; !hasOwnProperty.call(queue, ++base);) continue;}};return limit = Math.abs(limit), { hit: function (id) {var oldIndex = map[id],nuIndex = ++index;if (queue[nuIndex] = id, map[id] = nuIndex, !oldIndex) return (++size, size <= limit) ? void 0 : (id = queue[base], del(id), id);if (delete queue[oldIndex], base === oldIndex) for (; !hasOwnProperty.call(queue, ++base);) continue;}, delete: del, clear: function () {size = index = 0, base = 1, queue = Object.create(null), map = Object.create(null);} };}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/function.js
function memoize(fn) {var { hasher, limit } = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};return limit = null == limit ? Number.POSITIVE_INFINITY : limit, hasher = null == hasher ? JSON.stringify : hasher, function memoize() {"object" != typeof memoize.cache && (memoize.cache = { values: new Map(), lru: lruQueue(limit || Number.POSITIVE_INFINITY) });for (var args = [], i = 0; i < arguments.length; i++) args[i] = arguments[i];var hash = hasher(args);if (memoize.cache.values.has(hash)) return memoize.cache.lru.hit(hash), memoize.cache.values.get(hash);var newVal = fn.apply(fn, args);return memoize.cache.values.set(hash, newVal), memoize.cache.values.delete(memoize.cache.lru.hit(hash)), newVal;};}function memoizeCompare(fn, isEqual) {var memoize = function memoize() {for (var args = [], i = 0; i < arguments.length; i++) args[i] = arguments[i];for (var cached, c = 0; c < memoize.cache.length; c++) if (cached = memoize.cache[c], isEqual(args, cached.args)) return cached.res;var res = fn.apply(fn, args);return memoize.cache.unshift({ args, res }), res;};return memoize.cache = [], memoize;}function maxArgumentCount(fn) {return Object.keys(fn.signatures || {}).reduce(function (args, signature) {var count = (signature.match(/,/g) || []).length + 1;return Math.max(args, count);}, -1);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/bignumber/constants.js
var createBigNumberE = memoize(function (BigNumber) {return new BigNumber(1).exp();}, { hasher });var createBigNumberPhi = memoize(function (BigNumber) {return new BigNumber(1).plus(new BigNumber(5).sqrt()).div(2);}, { hasher });var createBigNumberPi = memoize(function (BigNumber) {return BigNumber.acos(-1);}, { hasher });var createBigNumberTau = memoize(function (BigNumber) {return createBigNumberPi(BigNumber).times(2);}, { hasher });function hasher(args) {return args[0].precision;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/plain/number/constants.js
var pi = Math.PI;var tau = 2 * Math.PI;var e = Math.E;var phi = 1.618033988749895;
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/constants.js
var createTrue = factory("true", [], () => !0);var createFalse = factory("false", [], () => !1);var createNull = factory("null", [], () => null);var createInfinity = recreateFactory("Infinity", ["config", "?BigNumber"], (_ref) => {var { config, BigNumber } = _ref;return "BigNumber" === config.number ? new BigNumber(1 / 0) : 1 / 0;});var createNaN = recreateFactory("NaN", ["config", "?BigNumber"], (_ref2) => {var { config, BigNumber } = _ref2;return "BigNumber" === config.number ? new BigNumber(NaN) : NaN;});var createPi = recreateFactory("pi", ["config", "?BigNumber"], (_ref3) => {var { config, BigNumber } = _ref3;return "BigNumber" === config.number ? createBigNumberPi(BigNumber) : pi;});var createTau = recreateFactory("tau", ["config", "?BigNumber"], (_ref4) => {var { config, BigNumber } = _ref4;return "BigNumber" === config.number ? createBigNumberTau(BigNumber) : tau;});var createE = recreateFactory("e", ["config", "?BigNumber"], (_ref5) => {var { config, BigNumber } = _ref5;return "BigNumber" === config.number ? createBigNumberE(BigNumber) : e;});var createPhi = recreateFactory("phi", ["config", "?BigNumber"], (_ref6) => {var { config, BigNumber } = _ref6;return "BigNumber" === config.number ? createBigNumberPhi(BigNumber) : phi;});var createLN2 = recreateFactory("LN2", ["config", "?BigNumber"], (_ref7) => {var { config, BigNumber } = _ref7;return "BigNumber" === config.number ? new BigNumber(2).ln() : Math.LN2;});var createLN10 = recreateFactory("LN10", ["config", "?BigNumber"], (_ref8) => {var { config, BigNumber } = _ref8;return "BigNumber" === config.number ? new BigNumber(10).ln() : Math.LN10;});var createLOG2E = recreateFactory("LOG2E", ["config", "?BigNumber"], (_ref9) => {var { config, BigNumber } = _ref9;return "BigNumber" === config.number ? new BigNumber(1).div(new BigNumber(2).ln()) : Math.LOG2E;});var createLOG10E = recreateFactory("LOG10E", ["config", "?BigNumber"], (_ref10) => {var { config, BigNumber } = _ref10;return "BigNumber" === config.number ? new BigNumber(1).div(new BigNumber(10).ln()) : Math.LOG10E;});var createSQRT1_2 = recreateFactory("SQRT1_2", ["config", "?BigNumber"], (_ref11) => {var { config, BigNumber } = _ref11;return "BigNumber" === config.number ? new BigNumber("0.5").sqrt() : Math.SQRT1_2;});var createSQRT2 = recreateFactory("SQRT2", ["config", "?BigNumber"], (_ref12) => {var { config, BigNumber } = _ref12;return "BigNumber" === config.number ? new BigNumber(2).sqrt() : Math.SQRT2;});var createI = recreateFactory("i", ["Complex"], (_ref13) => {var { Complex } = _ref13;return Complex.I;});var createUppercasePi = factory("PI", ["pi"], (_ref14) => {var { pi } = _ref14;return pi;});var createUppercaseE = factory("E", ["e"], (_ref15) => {var { e } = _ref15;return e;});var createVersion = factory("version", [], () => version);function recreateFactory(name, dependencies, create) {return factory(name, dependencies, create, { recreateOnConfigChange: !0 });}
// EXTERNAL MODULE: ./node_modules/decimal.js/decimal.mjs
var decimal = __webpack_require__("./node_modules/decimal.js/decimal.mjs");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/bignumber/BigNumber.js
var BigNumber_name = "BigNumber",BigNumber_dependencies = ["?on", "config"];var createBigNumberClass = factory("BigNumber", BigNumber_dependencies, (_ref) => {var { on, config } = _ref,BigNumber = decimal["default"].clone({ precision: config.precision, modulo: 9 });return BigNumber.prototype.type = "BigNumber", BigNumber.prototype.isBigNumber = !0, BigNumber.prototype.toJSON = function () {return { mathjs: "BigNumber", value: this.toString() };}, BigNumber.fromJSON = function (json) {return new BigNumber(json.value);}, on && on("config", function (curr, prev) {curr.precision !== prev.precision && BigNumber.config({ precision: curr.precision });}), BigNumber;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/Matrix.js
var Matrix_name = "Matrix",Matrix_dependencies = [];var createMatrixClass = factory("Matrix", Matrix_dependencies, () => {function Matrix() {if (!(this instanceof Matrix)) throw new SyntaxError("Constructor must be called with the new operator");}return Matrix.prototype.type = "Matrix", Matrix.prototype.isMatrix = !0, Matrix.prototype.storage = function () {throw new Error("Cannot invoke storage on a Matrix interface");}, Matrix.prototype.datatype = function () {throw new Error("Cannot invoke datatype on a Matrix interface");}, Matrix.prototype.create = function () {throw new Error("Cannot invoke create on a Matrix interface");}, Matrix.prototype.subset = function () {throw new Error("Cannot invoke subset on a Matrix interface");}, Matrix.prototype.get = function () {throw new Error("Cannot invoke get on a Matrix interface");}, Matrix.prototype.set = function () {throw new Error("Cannot invoke set on a Matrix interface");}, Matrix.prototype.resize = function () {throw new Error("Cannot invoke resize on a Matrix interface");}, Matrix.prototype.reshape = function () {throw new Error("Cannot invoke reshape on a Matrix interface");}, Matrix.prototype.clone = function () {throw new Error("Cannot invoke clone on a Matrix interface");}, Matrix.prototype.size = function () {throw new Error("Cannot invoke size on a Matrix interface");}, Matrix.prototype.map = function () {throw new Error("Cannot invoke map on a Matrix interface");}, Matrix.prototype.forEach = function () {throw new Error("Cannot invoke forEach on a Matrix interface");}, Matrix.prototype[Symbol.iterator] = function () {throw new Error("Cannot iterate a Matrix interface");}, Matrix.prototype.toArray = function () {throw new Error("Cannot invoke toArray on a Matrix interface");}, Matrix.prototype.valueOf = function () {throw new Error("Cannot invoke valueOf on a Matrix interface");}, Matrix.prototype.format = function () {throw new Error("Cannot invoke format on a Matrix interface");}, Matrix.prototype.toString = function () {throw new Error("Cannot invoke toString on a Matrix interface");}, Matrix;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/json/replacer.js
var replacer_name = "replacer",replacer_dependencies = [];var createReplacer = factory("replacer", replacer_dependencies, () => function (key, value) {return "number" == typeof value && (!isFinite(value) || isNaN(value)) ? { mathjs: "number", value: value + "" } : value;});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/unit/physicalConstants.js
var createSpeedOfLight = unitFactory("speedOfLight", "299792458", "m s^-1");var createGravitationConstant = unitFactory("gravitationConstant", "6.67430e-11", "m^3 kg^-1 s^-2");var createPlanckConstant = unitFactory("planckConstant", "6.62607015e-34", "J s");var createReducedPlanckConstant = unitFactory("reducedPlanckConstant", "1.0545718176461565e-34", "J s");var createMagneticConstant = unitFactory("magneticConstant", "1.25663706212e-6", "N A^-2");var createElectricConstant = unitFactory("electricConstant", "8.8541878128e-12", "F m^-1");var createVacuumImpedance = unitFactory("vacuumImpedance", "376.730313667", "ohm");var createCoulomb = unitFactory("coulomb", "8.987551792261171e9", "N m^2 C^-2");var createElementaryCharge = unitFactory("elementaryCharge", "1.602176634e-19", "C");var createBohrMagneton = unitFactory("bohrMagneton", "9.2740100783e-24", "J T^-1");var createConductanceQuantum = unitFactory("conductanceQuantum", "7.748091729863649e-5", "S");var createInverseConductanceQuantum = unitFactory("inverseConductanceQuantum", "12906.403729652257", "ohm");var createMagneticFluxQuantum = unitFactory("magneticFluxQuantum", "2.0678338484619295e-15", "Wb");var createNuclearMagneton = unitFactory("nuclearMagneton", "5.0507837461e-27", "J T^-1");var createKlitzing = unitFactory("klitzing", "25812.807459304513", "ohm");var createJosephson = unitFactory("josephson", "4.835978484169836e14 Hz V", "Hz V^-1");var createBohrRadius = unitFactory("bohrRadius", "5.29177210903e-11", "m");var createClassicalElectronRadius = unitFactory("classicalElectronRadius", "2.8179403262e-15", "m");var createElectronMass = unitFactory("electronMass", "9.1093837015e-31", "kg");var createFermiCoupling = unitFactory("fermiCoupling", "1.1663787e-5", "GeV^-2");var createFineStructure = numberFactory("fineStructure", .0072973525693);var createHartreeEnergy = unitFactory("hartreeEnergy", "4.3597447222071e-18", "J");var createProtonMass = unitFactory("protonMass", "1.67262192369e-27", "kg");var createDeuteronMass = unitFactory("deuteronMass", "3.3435830926e-27", "kg");var createNeutronMass = unitFactory("neutronMass", "1.6749271613e-27", "kg");var createQuantumOfCirculation = unitFactory("quantumOfCirculation", "3.6369475516e-4", "m^2 s^-1");var createRydberg = unitFactory("rydberg", "10973731.568160", "m^-1");var createThomsonCrossSection = unitFactory("thomsonCrossSection", "6.6524587321e-29", "m^2");var createWeakMixingAngle = numberFactory("weakMixingAngle", .2229);var createEfimovFactor = numberFactory("efimovFactor", 22.7);var createAtomicMass = unitFactory("atomicMass", "1.66053906660e-27", "kg");var createAvogadro = unitFactory("avogadro", "6.02214076e23", "mol^-1");var createBoltzmann = unitFactory("boltzmann", "1.380649e-23", "J K^-1");var createFaraday = unitFactory("faraday", "96485.33212331001", "C mol^-1");var createFirstRadiation = unitFactory("firstRadiation", "3.7417718521927573e-16", "W m^2");var createLoschmidt = unitFactory("loschmidt", "2.686780111798444e25", "m^-3");var createGasConstant = unitFactory("gasConstant", "8.31446261815324", "J K^-1 mol^-1");var createMolarPlanckConstant = unitFactory("molarPlanckConstant", "3.990312712893431e-10", "J s mol^-1");var createMolarVolume = unitFactory("molarVolume", "0.022413969545014137", "m^3 mol^-1");var createSackurTetrode = numberFactory("sackurTetrode", -1.16487052358);var createSecondRadiation = unitFactory("secondRadiation", "0.014387768775039337", "m K");var createStefanBoltzmann = unitFactory("stefanBoltzmann", "5.67037441918443e-8", "W m^-2 K^-4");var createWienDisplacement = unitFactory("wienDisplacement", "2.897771955e-3", "m K");var createMolarMass = unitFactory("molarMass", "0.99999999965e-3", "kg mol^-1");var createMolarMassC12 = unitFactory("molarMassC12", "11.9999999958e-3", "kg mol^-1");var createGravity = unitFactory("gravity", "9.80665", "m s^-2");var createPlanckLength = unitFactory("planckLength", "1.616255e-35", "m");var createPlanckMass = unitFactory("planckMass", "2.176435e-8", "kg");var createPlanckTime = unitFactory("planckTime", "5.391245e-44", "s");var createPlanckCharge = unitFactory("planckCharge", "1.87554603778e-18", "C");var createPlanckTemperature = unitFactory("planckTemperature", "1.416785e+32", "K");function unitFactory(name, valueStr, unitStr) {return factory(name, ["config", "Unit", "BigNumber"], (_ref) => {var { config, Unit, BigNumber } = _ref,value = "BigNumber" === config.number ? new BigNumber(valueStr) : parseFloat(valueStr),unit = new Unit(value, unitStr);return unit.fixPrefix = !0, unit;});}function numberFactory(name, value) {return factory(name, ["config", "BigNumber"], (_ref2) => {var { config, BigNumber } = _ref2;return "BigNumber" === config.number ? new BigNumber(value) : value;});}
// EXTERNAL MODULE: ./node_modules/fraction.js/fraction.js
var fraction = __webpack_require__("./node_modules/fraction.js/fraction.js");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/fraction/Fraction.js
var Fraction_name = "Fraction",Fraction_dependencies = [];var createFractionClass = factory("Fraction", Fraction_dependencies, () => (fraction.prototype.type = "Fraction", fraction.prototype.isFraction = !0, fraction.prototype.toJSON = function () {return { mathjs: "Fraction", n: this.s * this.n, d: this.d };}, fraction.fromJSON = function (json) {return new fraction(json);}, fraction), { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/bignumber/formatter.js
function formatBigNumberToBase(n, base, size) {var BigNumberCtor = n.constructor,big2 = new BigNumberCtor(2),suffix = "";if (size) {if (1 > size) throw new Error("size must be in greater than 0");if (!isInteger(size)) throw new Error("size must be an integer");if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) throw new Error("Value must be in range [-2^".concat(size - 1, ", 2^").concat(size - 1, "-1]"));if (!n.isInteger()) throw new Error("Value must be an integer");n.lessThan(0) && (n = n.add(big2.pow(size))), suffix = "i".concat(size);}switch (base) {case 2:return "".concat(n.toBinary()).concat(suffix);case 8:return "".concat(n.toOctal()).concat(suffix);case 16:return "".concat(n.toHexadecimal()).concat(suffix);default:throw new Error("Base ".concat(base, " not supported "));}}function formatter_format(value, options) {if ("function" == typeof options) return options(value);if (!value.isFinite()) return value.isNaN() ? "NaN" : value.gt(0) ? "Infinity" : "-Infinity";var precision,wordSize,notation = "auto";if (void 0 !== options && (options.notation && (notation = options.notation), "number" == typeof options ? precision = options : options.precision && (precision = options.precision), options.wordSize && (wordSize = options.wordSize, "number" != typeof wordSize))) throw new Error("Option \"wordSize\" must be a number");switch (notation) {case "fixed":return formatter_toFixed(value, precision);case "exponential":return formatter_toExponential(value, precision);case "engineering":return formatter_toEngineering(value, precision);case "bin":return formatBigNumberToBase(value, 2, wordSize);case "oct":return formatBigNumberToBase(value, 8, wordSize);case "hex":return formatBigNumberToBase(value, 16, wordSize);case "auto":{var lowerExp = options && options.lowerExp !== void 0 ? options.lowerExp : -3,upperExp = options && options.upperExp !== void 0 ? options.upperExp : 5;if (value.isZero()) return "0";var str,rounded = value.toSignificantDigits(precision),exp = rounded.e;return str = exp >= lowerExp && exp < upperExp ? rounded.toFixed() : formatter_toExponential(value, precision), str.replace(/((\.\d*?)(0+))($|e)/, function () {var digits = arguments[2],e = arguments[4];return "." === digits ? e : digits + e;});}default:throw new Error("Unknown notation \"" + notation + "\". Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.");}}function formatter_toEngineering(value, precision) {var e = value.e,newExp = 0 == e % 3 ? e : 0 > e ? e - 3 - e % 3 : e - e % 3,valueWithoutExp = value.mul(Math.pow(10, -newExp)),valueStr = valueWithoutExp.toPrecision(precision);return -1 !== valueStr.indexOf("e") && (valueStr = valueWithoutExp.toString()), valueStr + "e" + (0 <= e ? "+" : "") + newExp.toString();}function formatter_toExponential(value, precision) {return void 0 === precision ? value.toExponential() : value.toExponential(precision - 1);}function formatter_toFixed(value, precision) {return value.toFixed(precision);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/string.js
function endsWith(text, search) {var start = text.length - search.length,end = text.length;return text.substring(start, end) === search;}function string_format(value, options) {if ("number" == typeof value) return format(value, options);if (isBigNumber(value)) return formatter_format(value, options);if (looksLikeFraction(value)) return options && "decimal" === options.fraction ? value.toString() : value.s * value.n + "/" + value.d;if (Array.isArray(value)) return formatArray(value, options);if (isString(value)) return "\"" + value + "\"";if ("function" == typeof value) return value.syntax ? value.syntax + "" : "function";if (value && "object" == typeof value) {if ("function" == typeof value.format) return value.format(options);if (value && value.toString(options) !== {}.toString()) return value.toString(options);var entries = Object.keys(value).map((key) => "\"" + key + "\": " + string_format(value[key], options));return "{" + entries.join(", ") + "}";}return value + "";}function stringify(value) {for (var text = value + "", escaped = "", i = 0; i < text.length;) {var c = text.charAt(i);"\\" === c ? (escaped += c, i++, c = text.charAt(i), ("" === c || -1 === "\"\\/bfnrtu".indexOf(c)) && (escaped += "\\"), escaped += c) : "\"" === c ? escaped += "\\\"" : escaped += c, i++;}return "\"" + escaped + "\"";}function string_escape(value) {var text = value + "";return text = text.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), text;}function formatArray(array, options) {if (Array.isArray(array)) {for (var str = "[", len = array.length, i = 0; i < len; i++) 0 != i && (str += ", "), str += formatArray(array[i], options);return str += "]", str;}return string_format(array, options);}function looksLikeFraction(value) {return value && "object" == typeof value && "number" == typeof value.s && "number" == typeof value.n && "number" == typeof value.d || !1;}function compareText(x, y) {if (!isString(x)) throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: " + typeOf(x) + ", index: 0)");if (!isString(y)) throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: " + typeOf(y) + ", index: 1)");return x === y ? 0 : x > y ? 1 : -1;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/error/DimensionError.js
function DimensionError(actual, expected, relation) {if (!(this instanceof DimensionError)) throw new SyntaxError("Constructor must be called with the new operator");this.actual = actual, this.expected = expected, this.relation = relation, this.message = "Dimension mismatch (" + (Array.isArray(actual) ? "[" + actual.join(", ") + "]" : actual) + " " + (this.relation || "!=") + " " + (Array.isArray(expected) ? "[" + expected.join(", ") + "]" : expected) + ")", this.stack = new Error().stack;}DimensionError.prototype = new RangeError(), DimensionError.prototype.constructor = RangeError, DimensionError.prototype.name = "DimensionError", DimensionError.prototype.isDimensionError = !0;
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/error/IndexError.js
function IndexError(index, min, max) {if (!(this instanceof IndexError)) throw new SyntaxError("Constructor must be called with the new operator");this.index = index, 3 > arguments.length ? (this.min = 0, this.max = min) : (this.min = min, this.max = max), this.message = void 0 !== this.min && this.index < this.min ? "Index out of range (" + this.index + " < " + this.min + ")" : void 0 !== this.max && this.index >= this.max ? "Index out of range (" + this.index + " > " + (this.max - 1) + ")" : "Index out of range (" + this.index + ")", this.stack = new Error().stack;}IndexError.prototype = new RangeError(), IndexError.prototype.constructor = RangeError, IndexError.prototype.name = "IndexError", IndexError.prototype.isIndexError = !0;
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/array.js
function arraySize(x) {for (var s = []; Array.isArray(x);) s.push(x.length), x = x[0];return s;}function _validate(array, size, dim) {var i,len = array.length;if (len !== size[dim]) throw new DimensionError(len, size[dim]);if (dim < size.length - 1) {for (i = 0; i < len; i++) {var child = array[i];if (!Array.isArray(child)) throw new DimensionError(size.length - 1, size.length, "<");_validate(array[i], size, dim + 1);}} else for (i = 0; i < len; i++) if (Array.isArray(array[i])) throw new DimensionError(size.length + 1, size.length, ">");}function validate(array, size) {var isScalar = 0 === size.length;if (!isScalar) _validate(array, size, 0);else if (Array.isArray(array)) throw new DimensionError(array.length, 0);}function validateIndex(index, length) {if (!isNumber(index) || !isInteger(index)) throw new TypeError("Index must be an integer (value: " + index + ")");if (0 > index || "number" == typeof length && index >= length) throw new IndexError(index, length);}function resize(array, size, defaultValue) {if (!Array.isArray(array) || !Array.isArray(size)) throw new TypeError("Array expected");if (0 === size.length) throw new Error("Resizing to scalar is not supported");size.forEach(function (value) {if (!isNumber(value) || !isInteger(value) || 0 > value) throw new TypeError("Invalid size, must contain positive integers (size: " + string_format(size) + ")");});var _defaultValue = void 0 === defaultValue ? 0 : defaultValue;return _resize(array, size, 0, _defaultValue), array;}function _resize(array, size, dim, defaultValue) {var i,elem,oldLen = array.length,newLen = size[dim],minLen = Math.min(oldLen, newLen);if (array.length = newLen, dim < size.length - 1) {var dimNext = dim + 1;for (i = 0; i < minLen; i++) elem = array[i], Array.isArray(elem) || (elem = [elem], array[i] = elem), _resize(elem, size, dimNext, defaultValue);for (i = minLen; i < newLen; i++) elem = [], array[i] = elem, _resize(elem, size, dimNext, defaultValue);} else {for (i = 0; i < minLen; i++) for (; Array.isArray(array[i]);) array[i] = array[i][0];for (i = minLen; i < newLen; i++) array[i] = defaultValue;}}function reshape(array, sizes) {var flatArray = flatten(array),currentLength = flatArray.length;if (!Array.isArray(array) || !Array.isArray(sizes)) throw new TypeError("Array expected");if (0 === sizes.length) throw new DimensionError(0, currentLength, "!=");sizes = processSizesWildcard(sizes, currentLength);var newLength = product(sizes);if (currentLength !== newLength) throw new DimensionError(newLength, currentLength, "!=");try {return _reshape(flatArray, sizes);} catch (e) {if (e instanceof DimensionError) throw new DimensionError(newLength, currentLength, "!=");throw e;}}function processSizesWildcard(sizes, currentLength) {var newLength = product(sizes),processedSizes = sizes.slice(),WILDCARD = -1,wildCardIndex = sizes.indexOf(WILDCARD),isMoreThanOneWildcard = 0 <= sizes.indexOf(WILDCARD, wildCardIndex + 1);if (isMoreThanOneWildcard) throw new Error("More than one wildcard in sizes");if (0 <= wildCardIndex) if (0 == currentLength % newLength) processedSizes[wildCardIndex] = -currentLength / newLength;else throw new Error("Could not replace wildcard, since " + currentLength + " is no multiple of " + -newLength);return processedSizes;}function product(array) {return array.reduce((prev, curr) => prev * curr, 1);}function _reshape(array, sizes) {for (var tmpArray2, size, tmpArray = array, sizeIndex = sizes.length - 1; 0 < sizeIndex; sizeIndex--) {size = sizes[sizeIndex], tmpArray2 = [];for (var length = tmpArray.length / size, i = 0; i < length; i++) tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size));tmpArray = tmpArray2;}return tmpArray;}function squeeze(array, size) {for (var s = size || arraySize(array); Array.isArray(array) && 1 === array.length;) array = array[0], s.shift();for (var dims = s.length; 1 === s[dims - 1];) dims--;return dims < s.length && (array = _squeeze(array, dims, 0), s.length = dims), array;}function _squeeze(array, dims, dim) {var i, ii;if (dim < dims) {for (i = 0, ii = array.length; i < ii; i++) array[i] = _squeeze(array[i], dims, dim + 1);} else for (; Array.isArray(array);) array = array[0];return array;}function unsqueeze(array, dims, outer, size) {var s = size || arraySize(array);if (outer) for (var i = 0; i < outer; i++) array = [array], s.unshift(1);for (array = _unsqueeze(array, dims, 0); s.length < dims;) s.push(1);return array;}function _unsqueeze(array, dims, dim) {var i, ii;if (Array.isArray(array)) {for (i = 0, ii = array.length; i < ii; i++) array[i] = _unsqueeze(array[i], dims, dim + 1);} else for (var d = dim; d < dims; d++) array = [array];return array;}function flatten(array) {if (!Array.isArray(array)) return array;var flat = [];return array.forEach(function callback(value) {Array.isArray(value) ? value.forEach(callback) : flat.push(value);}), flat;}function map(array, callback) {return Array.prototype.map.call(array, callback);}function forEach(array, callback) {Array.prototype.forEach.call(array, callback);}function filter(array, callback) {if (1 !== arraySize(array).length) throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(array, callback);}function filterRegExp(array, regexp) {if (1 !== arraySize(array).length) throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(array, (entry) => regexp.test(entry));}function join(array, separator) {return Array.prototype.join.call(array, separator);}function identify(a) {if (!Array.isArray(a)) throw new TypeError("Array input expected");if (0 === a.length) return a;var b = [],count = 0;b[0] = { value: a[0], identifier: 0 };for (var i = 1; i < a.length; i++) a[i] === a[i - 1] ? count++ : count = 0, b.push({ value: a[i], identifier: count });return b;}function generalize(a) {if (!Array.isArray(a)) throw new TypeError("Array input expected");if (0 === a.length) return a;for (var b = [], i = 0; i < a.length; i++) b.push(a[i].value);return b;}function getArrayDataType(array, typeOf) {for (var type, length = 0, i = 0; i < array.length; i++) {var item = array[i],isArray = Array.isArray(item);if (0 == i && isArray && (length = item.length), isArray && item.length !== length) return;var itemType = isArray ? getArrayDataType(item, typeOf) : typeOf(item);if (void 0 === type) type = itemType;else if (type !== itemType) return "mixed";}return type;}function last(array) {return array[array.length - 1];}function initial(array) {return array.slice(0, array.length - 1);}function array_contains(array, item) {return -1 !== array.indexOf(item);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/DenseMatrix.js
var DenseMatrix_name = "DenseMatrix",DenseMatrix_dependencies = ["Matrix"];var createDenseMatrixClass = factory("DenseMatrix", DenseMatrix_dependencies, (_ref) => {function DenseMatrix(data, datatype) {if (!(this instanceof DenseMatrix)) throw new SyntaxError("Constructor must be called with the new operator");if (datatype && !isString(datatype)) throw new Error("Invalid datatype: " + datatype);if (isMatrix(data)) "DenseMatrix" === data.type ? (this._data = clone(data._data), this._size = clone(data._size), this._datatype = datatype || data._datatype) : (this._data = data.toArray(), this._size = data.size(), this._datatype = datatype || data._datatype);else if (data && isArray(data.data) && isArray(data.size)) this._data = data.data, this._size = data.size, validate(this._data, this._size), this._datatype = datatype || data.datatype;else if (isArray(data)) this._data = preprocess(data), this._size = arraySize(this._data), validate(this._data, this._size), this._datatype = datatype;else if (data) throw new TypeError("Unsupported type of data (" + typeOf(data) + ")");else this._data = [], this._size = [0], this._datatype = datatype;}function _get(matrix, index) {if (!isIndex(index)) throw new TypeError("Invalid index");var isScalar = index.isScalar();if (isScalar) return matrix.get(index.min());var size = index.size();if (size.length !== matrix._size.length) throw new DimensionError(size.length, matrix._size.length);for (var min = index.min(), max = index.max(), i = 0, ii = matrix._size.length; i < ii; i++) validateIndex(min[i], matrix._size[i]), validateIndex(max[i], matrix._size[i]);return new DenseMatrix(_getSubmatrix(matrix._data, index, size.length, 0), matrix._datatype);}function _getSubmatrix(data, index, dims, dim) {var range = index.dimension(dim);return dim === dims - 1 ? range.map(function (i) {return validateIndex(i, data.length), data[i];}).valueOf() : range.map(function (i) {validateIndex(i, data.length);var child = data[i];return _getSubmatrix(child, index, dims, dim + 1);}).valueOf();}function _set(matrix, index, submatrix, defaultValue) {if (!index || !0 !== index.isIndex) throw new TypeError("Invalid index");var sSize,iSize = index.size(),isScalar = index.isScalar();if (isMatrix(submatrix) ? (sSize = submatrix.size(), submatrix = submatrix.valueOf()) : sSize = arraySize(submatrix), isScalar) {if (0 !== sSize.length) throw new TypeError("Scalar expected");matrix.set(index.min(), submatrix, defaultValue);} else {if (iSize.length < matrix._size.length) throw new DimensionError(iSize.length, matrix._size.length, "<");if (sSize.length < iSize.length) {for (var i = 0, outer = 0; 1 === iSize[i] && 1 === sSize[i];) i++;for (; 1 === iSize[i];) outer++, i++;submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);}if (!deepStrictEqual(iSize, sSize)) throw new DimensionError(iSize, sSize, ">");var size = index.max().map(function (i) {return i + 1;});_fit(matrix, size, defaultValue);var dims = iSize.length;_setSubmatrix(matrix._data, index, submatrix, dims, 0);}return matrix;}function _setSubmatrix(data, index, submatrix, dims, dim) {var range = index.dimension(dim);dim === dims - 1 ? range.forEach(function (dataIndex, subIndex) {validateIndex(dataIndex), data[dataIndex] = submatrix[subIndex[0]];}) : range.forEach(function (dataIndex, subIndex) {validateIndex(dataIndex), _setSubmatrix(data[dataIndex], index, submatrix[subIndex[0]], dims, dim + 1);});}function _resize(matrix, size, defaultValue) {if (0 === size.length) {for (var v = matrix._data; isArray(v);) v = v[0];return v;}return matrix._size = size.slice(0), matrix._data = resize(matrix._data, matrix._size, defaultValue), matrix;}function _fit(matrix, size, defaultValue) {for (var newSize = matrix._size.slice(0), changed = !1; newSize.length < size.length;) newSize.push(0), changed = !0;for (var i = 0, ii = size.length; i < ii; i++) size[i] > newSize[i] && (newSize[i] = size[i], changed = !0);changed && _resize(matrix, newSize, defaultValue);}function preprocess(data) {for (var elem, i = 0, ii = data.length; i < ii; i++) elem = data[i], isArray(elem) ? data[i] = preprocess(elem) : elem && !0 === elem.isMatrix && (data[i] = preprocess(elem.valueOf()));return data;}var { Matrix } = _ref;return DenseMatrix.prototype = new Matrix(), DenseMatrix.prototype.createDenseMatrix = function (data, datatype) {return new DenseMatrix(data, datatype);}, DenseMatrix.prototype.type = "DenseMatrix", DenseMatrix.prototype.isDenseMatrix = !0, DenseMatrix.prototype.getDataType = function () {return getArrayDataType(this._data, typeOf);}, DenseMatrix.prototype.storage = function () {return "dense";}, DenseMatrix.prototype.datatype = function () {return this._datatype;}, DenseMatrix.prototype.create = function (data, datatype) {return new DenseMatrix(data, datatype);}, DenseMatrix.prototype.subset = function (index, replacement, defaultValue) {switch (arguments.length) {case 1:return _get(this, index);case 2:case 3:return _set(this, index, replacement, defaultValue);default:throw new SyntaxError("Wrong number of arguments");}}, DenseMatrix.prototype.get = function (index) {if (!isArray(index)) throw new TypeError("Array expected");if (index.length !== this._size.length) throw new DimensionError(index.length, this._size.length);for (var x = 0; x < index.length; x++) validateIndex(index[x], this._size[x]);for (var indexI, data = this._data, i = 0, ii = index.length; i < ii; i++) indexI = index[i], validateIndex(indexI, data.length), data = data[indexI];return data;}, DenseMatrix.prototype.set = function (index, value, defaultValue) {if (!isArray(index)) throw new TypeError("Array expected");if (index.length < this._size.length) throw new DimensionError(index.length, this._size.length, "<");var i,ii,indexI,size = index.map(function (i) {return i + 1;});_fit(this, size, defaultValue);var data = this._data;for (i = 0, ii = index.length - 1; i < ii; i++) indexI = index[i], validateIndex(indexI, data.length), data = data[indexI];return indexI = index[index.length - 1], validateIndex(indexI, data.length), data[indexI] = value, this;}, DenseMatrix.prototype.resize = function (size, defaultValue, copy) {if (!isCollection(size)) throw new TypeError("Array or Matrix expected");var sizeArray = size.valueOf().map((value) => Array.isArray(value) && 1 === value.length ? value[0] : value),m = copy ? this.clone() : this;return _resize(m, sizeArray, defaultValue);}, DenseMatrix.prototype.reshape = function (size, copy) {var m = copy ? this.clone() : this;m._data = reshape(m._data, size);var currentLength = m._size.reduce((length, size) => length * size);return m._size = processSizesWildcard(size, currentLength), m;}, DenseMatrix.prototype.clone = function () {var m = new DenseMatrix({ data: clone(this._data), size: clone(this._size), datatype: this._datatype });return m;}, DenseMatrix.prototype.size = function () {return this._size.slice(0);}, DenseMatrix.prototype.map = function (callback) {var me = this,data = function recurse(value, index) {return isArray(value) ? value.map(function (child, i) {return recurse(child, index.concat(i));}) : callback(value, index, me);}(this._data, []),datatype = void 0 === this._datatype ? void 0 : getArrayDataType(data, typeOf);return new DenseMatrix(data, datatype);}, DenseMatrix.prototype.forEach = function (callback) {var me = this;(function recurse(value, index) {isArray(value) ? value.forEach(function (child, i) {recurse(child, index.concat(i));}) : callback(value, index, me);})(this._data, []);}, DenseMatrix.prototype[Symbol.iterator] = function* () {yield* function* recurse(value, index) {if (isArray(value)) for (var i = 0; i < value.length; i++) yield* recurse(value[i], index.concat(i));else yield { value, index };}(this._data, []);}, DenseMatrix.prototype.rows = function () {var result = [],s = this.size();if (2 !== s.length) throw new TypeError("Rows can only be returned for a 2D matrix.");var data = this._data;for (var row of data) result.push(new DenseMatrix([row], this._datatype));return result;}, DenseMatrix.prototype.columns = function () {var _this = this,result = [],s = this.size();if (2 !== s.length) throw new TypeError("Rows can only be returned for a 2D matrix.");for (var data = this._data, _loop = function _loop(i) {var col = data.map((row) => [row[i]]);result.push(new DenseMatrix(col, _this._datatype));}, i = 0; i < s[1]; i++) _loop(i);return result;}, DenseMatrix.prototype.toArray = function () {return clone(this._data);}, DenseMatrix.prototype.valueOf = function () {return this._data;}, DenseMatrix.prototype.format = function (options) {return string_format(this._data, options);}, DenseMatrix.prototype.toString = function () {return string_format(this._data);}, DenseMatrix.prototype.toJSON = function () {return { mathjs: "DenseMatrix", data: this._data, size: this._size, datatype: this._datatype };}, DenseMatrix.prototype.diagonal = function (k) {if (!k) k = 0;else if (isBigNumber(k) && (k = k.toNumber()), !isNumber(k) || !isInteger(k)) throw new TypeError("The parameter k must be an integer number");for (var kSuper = 0 < k ? k : 0, kSub = 0 > k ? -k : 0, rows = this._size[0], columns = this._size[1], n = Math.min(rows - kSub, columns - kSuper), data = [], i = 0; i < n; i++) data[i] = this._data[i + kSub][i + kSuper];return new DenseMatrix({ data: data, size: [n], datatype: this._datatype });}, DenseMatrix.diagonal = function (size, value, k, defaultValue) {if (!isArray(size)) throw new TypeError("Array expected, size parameter");if (2 !== size.length) throw new Error("Only two dimensions matrix are supported");if (size = size.map(function (s) {if (isBigNumber(s) && (s = s.toNumber()), !isNumber(s) || !isInteger(s) || 1 > s) throw new Error("Size values must be positive integers");return s;}), !k) k = 0;else if (isBigNumber(k) && (k = k.toNumber()), !isNumber(k) || !isInteger(k)) throw new TypeError("The parameter k must be an integer number");var _value,kSuper = 0 < k ? k : 0,kSub = 0 > k ? -k : 0,rows = size[0],columns = size[1],n = Math.min(rows - kSub, columns - kSuper);if (isArray(value)) {if (value.length !== n) throw new Error("Invalid value array length");_value = function _value(i) {return value[i];};} else if (isMatrix(value)) {var ms = value.size();if (1 !== ms.length || ms[0] !== n) throw new Error("Invalid matrix length");_value = function _value(i) {return value.get([i]);};} else _value = function _value() {return value;};defaultValue || (defaultValue = isBigNumber(_value(0)) ? _value(0).mul(0) : 0);var data = [];if (0 < size.length) {data = resize(data, size, defaultValue);for (var d = 0; d < n; d++) data[d + kSub][d + kSuper] = _value(d);}return new DenseMatrix({ data: data, size: [rows, columns] });}, DenseMatrix.fromJSON = function (json) {return new DenseMatrix(json);}, DenseMatrix.prototype.swapRows = function (i, j) {if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) throw new Error("Row index must be positive integers");if (2 !== this._size.length) throw new Error("Only two dimensional matrix is supported");return validateIndex(i, this._size[0]), validateIndex(j, this._size[0]), DenseMatrix._swapRows(i, j, this._data), this;}, DenseMatrix._swapRows = function (i, j, data) {var vi = data[i];data[i] = data[j], data[j] = vi;}, DenseMatrix;}, { isClass: !0 });
// EXTERNAL MODULE: ./node_modules/typed-function/typed-function.js
var typed_function = __webpack_require__("./node_modules/typed-function/typed-function.js");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/customs.js
function getSafeProperty(object, prop) {if (isPlainObject(object) && isSafeProperty(object, prop)) return object[prop];if ("function" == typeof object[prop] && isSafeMethod(object, prop)) throw new Error("Cannot access method \"" + prop + "\" as a property");throw new Error("No access to property \"" + prop + "\"");}function setSafeProperty(object, prop, value) {if (isPlainObject(object) && isSafeProperty(object, prop)) return object[prop] = value, value;throw new Error("No access to property \"" + prop + "\"");}function getSafeProperties(object) {return Object.keys(object).filter((prop) => hasOwnProperty(object, prop));}function hasSafeProperty(object, prop) {return prop in object;}function isSafeProperty(object, prop) {return !!(object && "object" == typeof object) && (!!object_hasOwnProperty(safeNativeProperties, prop) || !(prop in Object.prototype) && !(prop in Function.prototype));}function validateSafeMethod(object, method) {if (!isSafeMethod(object, method)) throw new Error("No access to method \"" + method + "\"");}function isSafeMethod(object, method) {return null !== object && void 0 !== object && "function" == typeof object[method] && !(object_hasOwnProperty(object, method) && Object.getPrototypeOf && method in Object.getPrototypeOf(object)) && (!!object_hasOwnProperty(safeNativeMethods, method) || !(method in Object.prototype) && !(method in Function.prototype));}function isPlainObject(object) {return "object" == typeof object && object && object.constructor === Object;}var safeNativeProperties = { length: !0, name: !0 },safeNativeMethods = { toString: !0, valueOf: !0, toLocaleString: !0 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/map.js
class ObjectWrappingMap {constructor(object) {this.wrappedObject = object;}keys() {return Object.keys(this.wrappedObject);}get(key) {return getSafeProperty(this.wrappedObject, key);}set(key, value) {return setSafeProperty(this.wrappedObject, key, value), this;}has(key) {return hasSafeProperty(this.wrappedObject, key);}}function createEmptyMap() {return new Map();}function createMap(mapOrObject) {if (!mapOrObject) return createEmptyMap();if (isMap(mapOrObject)) return mapOrObject;if (isObject(mapOrObject)) return new ObjectWrappingMap(mapOrObject);throw new Error("createMap can create maps from objects or Maps");}function toObject(map) {if (map instanceof ObjectWrappingMap) return map.wrappedObject;var object = {};for (var key of map.keys()) {var value = map.get(key);setSafeProperty(object, key, value);}return object;}function isMap(object) {return !!object && (object instanceof Map || object instanceof ObjectWrappingMap || "function" == typeof object.set && "function" == typeof object.get && "function" == typeof object.keys && "function" == typeof object.has);}function map_assign(map) {for (var _len = arguments.length, objects = Array(1 < _len ? _len - 1 : 0), _key = 1; _key < _len; _key++) objects[_key - 1] = arguments[_key];for (var args of objects) if (args) if (isMap(args)) for (var key of args.keys()) map.set(key, args.get(key));else if (isObject(args)) for (var _key2 of Object.keys(args)) map.set(_key2, args[_key2]);return map;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/core/function/typed.js
var _createTyped2 = function () {return _createTyped2 = typed_function.create, typed_function;},typed_dependencies = ["?BigNumber", "?Complex", "?DenseMatrix", "?Fraction"];var createTyped = factory("typed", typed_dependencies, function (_ref) {var { BigNumber, Complex, DenseMatrix, Fraction } = _ref,typed = _createTyped2();return typed.types = [{ name: "number", test: isNumber }, { name: "Complex", test: isComplex }, { name: "BigNumber", test: isBigNumber }, { name: "Fraction", test: isFraction }, { name: "Unit", test: isUnit }, { name: "string", test: isString }, { name: "Chain", test: isChain }, { name: "Array", test: isArray }, { name: "Matrix", test: isMatrix }, { name: "DenseMatrix", test: isDenseMatrix }, { name: "SparseMatrix", test: isSparseMatrix }, { name: "Range", test: isRange }, { name: "Index", test: isIndex }, { name: "boolean", test: isBoolean }, { name: "ResultSet", test: isResultSet }, { name: "Help", test: isHelp }, { name: "function", test: isFunction }, { name: "Date", test: isDate }, { name: "RegExp", test: isRegExp }, { name: "null", test: isNull }, { name: "undefined", test: isUndefined }, { name: "AccessorNode", test: isAccessorNode }, { name: "ArrayNode", test: isArrayNode }, { name: "AssignmentNode", test: isAssignmentNode }, { name: "BlockNode", test: isBlockNode }, { name: "ConditionalNode", test: isConditionalNode }, { name: "ConstantNode", test: isConstantNode }, { name: "FunctionNode", test: isFunctionNode }, { name: "FunctionAssignmentNode", test: isFunctionAssignmentNode }, { name: "IndexNode", test: isIndexNode }, { name: "Node", test: isNode }, { name: "ObjectNode", test: isObjectNode }, { name: "OperatorNode", test: isOperatorNode }, { name: "ParenthesisNode", test: isParenthesisNode }, { name: "RangeNode", test: isRangeNode }, { name: "SymbolNode", test: isSymbolNode }, { name: "Map", test: isMap }, { name: "Object", test: isObject }], typed.conversions = [{ from: "number", to: "BigNumber", convert: function (x) {if (BigNumber || throwNoBignumber(x), 15 < digits(x)) throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: " + x + "). Use function bignumber(x) to convert to BigNumber.");return new BigNumber(x);} }, { from: "number", to: "Complex", convert: function (x) {return Complex || throwNoComplex(x), new Complex(x, 0);} }, { from: "number", to: "string", convert: function (x) {return x + "";} }, { from: "BigNumber", to: "Complex", convert: function (x) {return Complex || throwNoComplex(x), new Complex(x.toNumber(), 0);} }, { from: "Fraction", to: "BigNumber", convert: function () {throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.");} }, { from: "Fraction", to: "Complex", convert: function (x) {return Complex || throwNoComplex(x), new Complex(x.valueOf(), 0);} }, { from: "number", to: "Fraction", convert: function (x) {Fraction || throwNoFraction(x);var f = new Fraction(x);if (f.valueOf() !== x) throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: " + x + "). Use function fraction(x) to convert to Fraction.");return f;} }, { from: "string", to: "number", convert: function (x) {var n = +x;if (isNaN(n)) throw new Error("Cannot convert \"" + x + "\" to a number");return n;} }, { from: "string", to: "BigNumber", convert: function (x) {BigNumber || throwNoBignumber(x);try {return new BigNumber(x);} catch (err) {throw new Error("Cannot convert \"" + x + "\" to BigNumber");}} }, { from: "string", to: "Fraction", convert: function (x) {Fraction || throwNoFraction(x);try {return new Fraction(x);} catch (err) {throw new Error("Cannot convert \"" + x + "\" to Fraction");}} }, { from: "string", to: "Complex", convert: function (x) {Complex || throwNoComplex(x);try {return new Complex(x);} catch (err) {throw new Error("Cannot convert \"" + x + "\" to Complex");}} }, { from: "boolean", to: "number", convert: function (x) {return +x;} }, { from: "boolean", to: "BigNumber", convert: function (x) {return BigNumber || throwNoBignumber(x), new BigNumber(+x);} }, { from: "boolean", to: "Fraction", convert: function (x) {return Fraction || throwNoFraction(x), new Fraction(+x);} }, { from: "boolean", to: "string", convert: function (x) {return x + "";} }, { from: "Array", to: "Matrix", convert: function (array) {return DenseMatrix || throwNoMatrix(), new DenseMatrix(array);} }, { from: "Matrix", to: "Array", convert: function (matrix) {return matrix.valueOf();} }], typed;});function throwNoBignumber(x) {throw new Error("Cannot convert value ".concat(x, " into a BigNumber: no class 'BigNumber' provided"));}function throwNoComplex(x) {throw new Error("Cannot convert value ".concat(x, " into a Complex number: no class 'Complex' provided"));}function throwNoMatrix() {throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided");}function throwNoFraction(x) {throw new Error("Cannot convert value ".concat(x, " into a Fraction, no class 'Fraction' provided."));}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/collection.js
function containsCollections(array) {for (var i = 0; i < array.length; i++) if (isCollection(array[i])) return !0;return !1;}function deepForEach(array, callback) {isMatrix(array) && (array = array.valueOf());for (var value, i = 0, ii = array.length; i < ii; i++) value = array[i], Array.isArray(value) ? deepForEach(value, callback) : callback(value);}function deepMap(array, callback, skipZeros) {return array && "function" == typeof array.map ? array.map(function (x) {return deepMap(x, callback, skipZeros);}) : callback(array);}function reduce(mat, dim, callback) {var size = Array.isArray(mat) ? arraySize(mat) : mat.size();if (0 > dim || dim >= size.length) throw new IndexError(dim, size.length);return isMatrix(mat) ? mat.create(_reduce(mat.valueOf(), dim, callback)) : _reduce(mat, dim, callback);}function _reduce(mat, dim, callback) {var i, ret, val, tran;if (0 >= dim) {if (!Array.isArray(mat[0])) {for (val = mat[0], i = 1; i < mat.length; i++) val = callback(val, mat[i]);return val;}for (tran = _switch(mat), ret = [], i = 0; i < tran.length; i++) ret[i] = _reduce(tran[i], dim - 1, callback);return ret;}for (ret = [], i = 0; i < mat.length; i++) ret[i] = _reduce(mat[i], dim - 1, callback);return ret;}function _switch(mat) {var i,j,I = mat.length,J = mat[0].length,ret = [];for (j = 0; j < J; j++) {var tmp = [];for (i = 0; i < I; i++) tmp.push(mat[i][j]);ret.push(tmp);}return ret;}function scatter(a, j, w, x, u, mark, cindex, f, inverse, update, value) {var k,k0,k1,i,avalues = a._values,aindex = a._index,aptr = a._ptr;if (x) for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) i = aindex[k], w[i] === mark ? (x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k]), u[i] = mark) : (w[i] = mark, cindex.push(i), update ? (x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k]), u[i] = mark) : x[i] = avalues[k]);else for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) i = aindex[k], w[i] === mark ? u[i] = mark : (w[i] = mark, cindex.push(i));}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/isInteger.js
var isInteger_name = "isInteger",isInteger_dependencies = ["typed"];var createIsInteger = factory("isInteger", isInteger_dependencies, (_ref) => {var { typed } = _ref;return typed(isInteger_name, { number: isInteger, BigNumber: function (x) {return x.isInt();}, Fraction: function (x) {return 1 === x.d && isFinite(x.n);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/isNumeric.js
var isNumeric_name = "isNumeric",isNumeric_dependencies = ["typed"];var createIsNumeric = factory("isNumeric", isNumeric_dependencies, (_ref) => {var { typed } = _ref;return typed(isNumeric_name, { "number | BigNumber | Fraction | boolean": function () {return !0;}, "Complex | Unit | string | null | undefined | Node": function () {return !1;}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/plain/number/utils.js
var n1 = "number";function isIntegerNumber(x) {return isInteger(x);}isIntegerNumber.signature = "number";function isNegativeNumber(x) {return 0 > x;}isNegativeNumber.signature = "number";function isPositiveNumber(x) {return 0 < x;}isPositiveNumber.signature = "number";function isZeroNumber(x) {return 0 === x;}isZeroNumber.signature = "number";function isNaNNumber(x) {return Number.isNaN(x);}isNaNNumber.signature = "number";
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/isPositive.js
var isPositive_name = "isPositive",isPositive_dependencies = ["typed"];var createIsPositive = factory("isPositive", isPositive_dependencies, (_ref) => {var { typed } = _ref;return typed(isPositive_name, { number: isPositiveNumber, BigNumber: function (x) {return !x.isNeg() && !x.isZero() && !x.isNaN();}, Fraction: function (x) {return 0 < x.s && 0 < x.n;}, Unit: function (x) {return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/isNaN.js
var isNaN_name = "isNaN",isNaN_dependencies = ["typed"];var createIsNaN = factory("isNaN", isNaN_dependencies, (_ref) => {var { typed } = _ref;return typed(isNaN_name, { number: isNaNNumber, BigNumber: function (x) {return x.isNaN();}, Fraction: function () {return !1;}, Complex: function (x) {return x.isNaN();}, Unit: function (x) {return Number.isNaN(x.value);}, "Array | Matrix": function (x) {return deepMap(x, Number.isNaN);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/bignumber/nearlyEqual.js
function nearlyEqual_nearlyEqual(x, y, epsilon) {if (null === epsilon || epsilon === void 0) return x.eq(y);if (x.eq(y)) return !0;if (x.isNaN() || y.isNaN()) return !1;if (x.isFinite() && y.isFinite()) {var diff = x.minus(y).abs();if (diff.isZero()) return !0;var max = x.constructor.max(x.abs(), y.abs());return diff.lte(max.times(epsilon));}return !1;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/complex.js
function complexEquals(x, y, epsilon) {return nearlyEqual(x.re, y.re, epsilon) && nearlyEqual(x.im, y.im, epsilon);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/equalScalar.js
var equalScalar_name = "equalScalar",equalScalar_dependencies = ["typed", "config"];var createEqualScalar = factory("equalScalar", equalScalar_dependencies, (_ref) => {var { typed, config } = _ref;return typed(equalScalar_name, { "boolean, boolean": function (x, y) {return x === y;}, "number, number": function (x, y) {return nearlyEqual(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.eq(y) || nearlyEqual_nearlyEqual(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return x.equals(y);}, "Complex, Complex": function (x, y) {return complexEquals(x, y, config.epsilon);}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);} });});var createEqualScalarNumber = factory("equalScalar", ["typed", "config"], (_ref2) => {var { typed, config } = _ref2;return typed(equalScalar_name, { "number, number": function (x, y) {return nearlyEqual(x, y, config.epsilon);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/number.js
var number_name = "number",number_dependencies = ["typed"];function getNonDecimalNumberParts(input) {var nonDecimalWithRadixMatch = input.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if (nonDecimalWithRadixMatch) {var radix = { "0b": 2, "0o": 8, "0x": 16 }[nonDecimalWithRadixMatch[1]],integerPart = nonDecimalWithRadixMatch[2],fractionalPart = nonDecimalWithRadixMatch[3];return { input, radix, integerPart, fractionalPart };}return null;}function makeNumberFromNonDecimalParts(parts) {for (var digitValue, n = parseInt(parts.integerPart, parts.radix), f = 0, i = 0; i < parts.fractionalPart.length; i++) digitValue = parseInt(parts.fractionalPart[i], parts.radix), f += digitValue / Math.pow(parts.radix, i + 1);var result = n + f;if (isNaN(result)) throw new SyntaxError("String \"" + parts.input + "\" is no valid number");return result;}var createNumber = factory("number", number_dependencies, (_ref) => {var { typed } = _ref,number = typed("number", { "": function () {return 0;}, number: function (x) {return x;}, string: function (x) {if ("NaN" === x) return NaN;var nonDecimalNumberParts = getNonDecimalNumberParts(x);if (nonDecimalNumberParts) return makeNumberFromNonDecimalParts(nonDecimalNumberParts);var size = 0,wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);wordSizeSuffixMatch && (size = +wordSizeSuffixMatch[2], x = wordSizeSuffixMatch[1]);var num = +x;if (isNaN(num)) throw new SyntaxError("String \"" + x + "\" is no valid number");if (wordSizeSuffixMatch) {if (num > 2 ** size - 1) throw new SyntaxError("String \"".concat(x, "\" is out of range"));num >= 2 ** (size - 1) && (num -= 2 ** size);}return num;}, BigNumber: function (x) {return x.toNumber();}, Fraction: function (x) {return x.valueOf();}, Unit: function () {throw new Error("Second argument with valueless unit expected");}, null: function () {return 0;}, "Unit, string | Unit": function (unit, valuelessUnit) {return unit.toNumber(valuelessUnit);}, "Array | Matrix": function (x) {return deepMap(x, this);} });return number.fromJSON = function (json) {return parseFloat(json.value);}, number;});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/boolean.js
var boolean_name = "boolean",boolean_dependencies = ["typed"];var createBoolean = factory("boolean", boolean_dependencies, (_ref) => {var { typed } = _ref;return typed(boolean_name, { "": function () {return !1;}, boolean: function (x) {return x;}, number: function (x) {return !!x;}, null: function () {return !1;}, BigNumber: function (x) {return !x.isZero();}, string: function (x) {var lcase = x.toLowerCase();if ("true" === lcase) return !0;if ("false" === lcase) return !1;var num = +x;if ("" !== x && !isNaN(num)) return !!num;throw new Error("Cannot convert \"" + x + "\" to a boolean");}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/complex/function/complex.js
var complex_name = "complex",complex_dependencies = ["typed", "Complex"];var createComplex = factory("complex", complex_dependencies, (_ref) => {var { typed, Complex } = _ref;return typed("complex", { "": function () {return Complex.ZERO;}, number: function (x) {return new Complex(x, 0);}, "number, number": function (re, im) {return new Complex(re, im);}, "BigNumber, BigNumber": function (re, im) {return new Complex(re.toNumber(), im.toNumber());}, Fraction: function (x) {return new Complex(x.valueOf(), 0);}, Complex: function (x) {return x.clone();}, string: function (x) {return Complex(x);}, null: function () {return Complex(0);}, Object: function (x) {if ("re" in x && "im" in x) return new Complex(x.re, x.im);if ("r" in x && "phi" in x || "abs" in x && "arg" in x) return new Complex(x);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)");}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/unit/function/splitUnit.js
var splitUnit_name = "splitUnit",splitUnit_dependencies = ["typed"];var createSplitUnit = factory("splitUnit", splitUnit_dependencies, (_ref) => {var { typed } = _ref;return typed(splitUnit_name, { "Unit, Array": function (unit, parts) {return unit.splitUnit(parts);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/plain/number/arithmetic.js
var arithmetic_n1 = "number",n2 = "number, number";function absNumber(a) {return Math.abs(a);}absNumber.signature = "number";function addNumber(a, b) {return a + b;}addNumber.signature = n2;function subtractNumber(a, b) {return a - b;}subtractNumber.signature = n2;function multiplyNumber(a, b) {return a * b;}multiplyNumber.signature = n2;function divideNumber(a, b) {return a / b;}divideNumber.signature = n2;function unaryMinusNumber(x) {return -x;}unaryMinusNumber.signature = "number";function unaryPlusNumber(x) {return x;}unaryPlusNumber.signature = "number";function cbrtNumber(x) {return cbrt(x);}cbrtNumber.signature = "number";function ceilNumber(x) {return Math.ceil(x);}ceilNumber.signature = "number";function cubeNumber(x) {return x * x * x;}cubeNumber.signature = "number";function expNumber(x) {return Math.exp(x);}expNumber.signature = "number";function expm1Number(x) {return expm1(x);}expm1Number.signature = "number";function fixNumber(x) {return 0 < x ? Math.floor(x) : Math.ceil(x);}fixNumber.signature = "number";function floorNumber(x) {return Math.floor(x);}floorNumber.signature = "number";function gcdNumber(a, b) {if (!isInteger(a) || !isInteger(b)) throw new Error("Parameters in function gcd must be integer numbers");for (var r; 0 !== b;) r = a % b, a = b, b = r;return 0 > a ? -a : a;}gcdNumber.signature = n2;function lcmNumber(a, b) {if (!isInteger(a) || !isInteger(b)) throw new Error("Parameters in function lcm must be integer numbers");if (0 === a || 0 === b) return 0;for (var t, prod = a * b; 0 !== b;) t = b, b = a % t, a = t;return Math.abs(prod / a);}lcmNumber.signature = n2;function logNumber(x) {return Math.log(x);}logNumber.signature = "number";function log10Number(x) {return log10(x);}log10Number.signature = "number";function log2Number(x) {return log2(x);}log2Number.signature = "number";function log1pNumber(x) {return log1p(x);}log1pNumber.signature = "number";function modNumber(x, y) {if (0 < y) return x - y * Math.floor(x / y);if (0 === y) return x;throw new Error("Cannot calculate mod for a negative divisor");}modNumber.signature = n2;function nthRootNumber(a, root) {var inv = 0 > root;if (inv && (root = -root), 0 === root) throw new Error("Root must be non-zero");if (0 > a && 1 != Math.abs(root) % 2) throw new Error("Root must be odd when a is negative.");if (0 === a) return inv ? 1 / 0 : 0;if (!isFinite(a)) return inv ? 0 : a;var x = Math.pow(Math.abs(a), 1 / root);return x = 0 > a ? -x : x, inv ? 1 / x : x;}nthRootNumber.signature = n2;function signNumber(x) {return sign(x);}signNumber.signature = "number";function sqrtNumber(x) {return Math.sqrt(x);}sqrtNumber.signature = "number";function squareNumber(x) {return x * x;}squareNumber.signature = "number";function xgcdNumber(a, b) {var t,q,r,x = 0,lastx = 1,y = 1,lasty = 0;if (!isInteger(a) || !isInteger(b)) throw new Error("Parameters in function xgcd must be integer numbers");for (; b;) q = Math.floor(a / b), r = a - q * b, t = x, x = lastx - q * x, lastx = t, t = y, y = lasty - q * y, lasty = t, a = b, b = r;var res;return res = 0 > a ? [-a, -lastx, -lasty] : [a, a ? lastx : 0, lasty], res;}xgcdNumber.signature = n2;function powNumber(x, y) {return 1 > x * x && y === 1 / 0 || 1 < x * x && y === -Infinity ? 0 : Math.pow(x, y);}powNumber.signature = n2;function roundNumber(value) {var decimals = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 0;return parseFloat(toFixed(value, decimals));}roundNumber.signature = n2;function normNumber(x) {return Math.abs(x);}normNumber.signature = "number";
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/unaryPlus.js
var unaryPlus_name = "unaryPlus",unaryPlus_dependencies = ["typed", "config", "BigNumber"];var createUnaryPlus = factory("unaryPlus", unaryPlus_dependencies, (_ref) => {var { typed, config, BigNumber } = _ref;return typed(unaryPlus_name, { number: unaryPlusNumber, Complex: function (x) {return x;}, BigNumber: function (x) {return x;}, Fraction: function (x) {return x;}, Unit: function (x) {return x.clone();}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, "boolean | string": function (x) {return "BigNumber" === config.number ? new BigNumber(+x) : +x;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/apply.js
var apply_name = "apply",apply_dependencies = ["typed", "isInteger"];var createApply = factory("apply", apply_dependencies, (_ref) => {var { typed, isInteger } = _ref;return typed(apply_name, { "Array | Matrix, number | BigNumber, function": function (mat, dim, callback) {if (!isInteger(dim)) throw new TypeError("Integer number expected for dimension");var size = Array.isArray(mat) ? arraySize(mat) : mat.size();if (0 > dim || dim >= size.length) throw new IndexError(dim, size.length);return isMatrix(mat) ? mat.create(_apply(mat.valueOf(), dim, callback)) : _apply(mat, dim, callback);} });});function _apply(mat, dim, callback) {var i, ret, tran;if (0 >= dim) {if (!Array.isArray(mat[0])) return callback(mat);for (tran = apply_switch(mat), ret = [], i = 0; i < tran.length; i++) ret[i] = _apply(tran[i], dim - 1, callback);return ret;}for (ret = [], i = 0; i < mat.length; i++) ret[i] = _apply(mat[i], dim - 1, callback);return ret;}function apply_switch(mat) {var i,j,I = mat.length,J = mat[0].length,ret = [];for (j = 0; j < J; j++) {var tmp = [];for (i = 0; i < I; i++) tmp.push(mat[i][j]);ret.push(tmp);}return ret;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/cube.js
var cube_name = "cube",cube_dependencies = ["typed"];var createCube = factory("cube", cube_dependencies, (_ref) => {var { typed } = _ref;return typed(cube_name, { number: cubeNumber, Complex: function (x) {return x.mul(x).mul(x);}, BigNumber: function (x) {return x.times(x).times(x);}, Fraction: function (x) {return x.pow(3);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, Unit: function (x) {return x.pow(3);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/expm1.js
var expm1_name = "expm1",expm1_dependencies = ["typed", "Complex"];var createExpm1 = factory("expm1", expm1_dependencies, (_ref) => {var { typed, Complex: _Complex } = _ref;return typed(expm1_name, { number: expm1Number, Complex: function (x) {var r = Math.exp(x.re);return new _Complex(r * Math.cos(x.im) - 1, r * Math.sin(x.im));}, BigNumber: function (x) {return x.exp().minus(1);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/log10.js
var log10_name = "log10",log10_dependencies = ["typed", "config", "Complex"];var createLog10 = factory("log10", log10_dependencies, (_ref) => {var { typed, config, Complex: _Complex } = _ref;return typed(log10_name, { number: function (x) {return 0 <= x || config.predictable ? log10Number(x) : new _Complex(x, 0).log().div(Math.LN10);}, Complex: function (x) {return new _Complex(x).log().div(Math.LN10);}, BigNumber: function (x) {return !x.isNegative() || config.predictable ? x.log() : new _Complex(x.toNumber(), 0).log().div(Math.LN10);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/multiplyScalar.js
var multiplyScalar_name = "multiplyScalar",multiplyScalar_dependencies = ["typed"];var createMultiplyScalar = factory("multiplyScalar", multiplyScalar_dependencies, (_ref) => {var { typed } = _ref;return typed("multiplyScalar", { "number, number": multiplyNumber, "Complex, Complex": function (x, y) {return x.mul(y);}, "BigNumber, BigNumber": function (x, y) {return x.times(y);}, "Fraction, Fraction": function (x, y) {return x.mul(y);}, "number | Fraction | BigNumber | Complex, Unit": function (x, y) {var res = y.clone();return res.value = null === res.value ? res._normalize(x) : this(res.value, x), res;}, "Unit, number | Fraction | BigNumber | Complex": function (x, y) {var res = x.clone();return res.value = null === res.value ? res._normalize(y) : this(res.value, y), res;}, "Unit, Unit": function (x, y) {return x.multiply(y);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/sign.js
var sign_name = "sign",sign_dependencies = ["typed", "BigNumber", "Fraction", "complex"];var createSign = factory("sign", sign_dependencies, (_ref) => {var { typed, BigNumber: _BigNumber, complex, Fraction: _Fraction } = _ref;return typed(sign_name, { number: signNumber, Complex: function (x) {return 0 === x.im ? complex(signNumber(x.re)) : x.sign();}, BigNumber: function (x) {return new _BigNumber(x.cmp(0));}, Fraction: function (x) {return new _Fraction(x.s, 1);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, Unit: function (x) {return this(x.value);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/square.js
var square_name = "square",square_dependencies = ["typed"];var createSquare = factory("square", square_dependencies, (_ref) => {var { typed } = _ref;return typed(square_name, { number: squareNumber, Complex: function (x) {return x.mul(x);}, BigNumber: function (x) {return x.times(x);}, Fraction: function (x) {return x.mul(x);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, Unit: function (x) {return x.pow(2);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/bignumber/bitwise.js
function bitAndBigNumber(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function bitAnd");var BigNumber = x.constructor;if (x.isNaN() || y.isNaN()) return new BigNumber(NaN);if (x.isZero() || y.eq(-1) || x.eq(y)) return x;if (y.isZero() || x.eq(-1)) return y;if (!x.isFinite() || !y.isFinite()) {if (!x.isFinite() && !y.isFinite()) return x.isNegative() === y.isNegative() ? x : new BigNumber(0);if (!x.isFinite()) return y.isNegative() ? x : x.isNegative() ? new BigNumber(0) : y;if (!y.isFinite()) return x.isNegative() ? y : y.isNegative() ? new BigNumber(0) : x;}return bitwise(x, y, function (a, b) {return a & b;});}function bitNotBigNumber(x) {if (x.isFinite() && !x.isInteger()) throw new Error("Integer expected in function bitNot");var BigNumber = x.constructor,prevPrec = BigNumber.precision;BigNumber.config({ precision: 1E9 });var result = x.plus(new BigNumber(1));return result.s = -result.s || null, BigNumber.config({ precision: prevPrec }), result;}function bitOrBigNumber(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function bitOr");var BigNumber = x.constructor;if (x.isNaN() || y.isNaN()) return new BigNumber(NaN);var negOne = new BigNumber(-1);return x.isZero() || y.eq(negOne) || x.eq(y) ? y : y.isZero() || x.eq(negOne) ? x : x.isFinite() && y.isFinite() ? bitwise(x, y, function (a, b) {return a | b;}) : (x.isFinite() || x.isNegative() || !y.isNegative()) && (!x.isNegative() || y.isNegative() || y.isFinite()) ? x.isNegative() && y.isNegative() ? x.isFinite() ? x : y : x.isFinite() ? y : x : negOne;}function bitwise(x, y, func) {var xBits,yBits,BigNumber = x.constructor,xSign = +(0 > x.s),ySign = +(0 > y.s);if (xSign) {xBits = decCoefficientToBinaryString(bitNotBigNumber(x));for (var i = 0; i < xBits.length; ++i) xBits[i] ^= 1;} else xBits = decCoefficientToBinaryString(x);if (ySign) {yBits = decCoefficientToBinaryString(bitNotBigNumber(y));for (var _i = 0; _i < yBits.length; ++_i) yBits[_i] ^= 1;} else yBits = decCoefficientToBinaryString(y);var minBits, maxBits, minSign;xBits.length <= yBits.length ? (minBits = xBits, maxBits = yBits, minSign = xSign) : (minBits = yBits, maxBits = xBits, minSign = ySign);var shortLen = minBits.length,longLen = maxBits.length,expFuncVal = 1 ^ func(xSign, ySign),outVal = new BigNumber(1 ^ expFuncVal),twoPower = new BigNumber(1),two = new BigNumber(2),prevPrec = BigNumber.precision;for (BigNumber.config({ precision: 1E9 }); 0 < shortLen;) func(minBits[--shortLen], maxBits[--longLen]) === expFuncVal && (outVal = outVal.plus(twoPower)), twoPower = twoPower.times(two);for (; 0 < longLen;) func(minSign, maxBits[--longLen]) === expFuncVal && (outVal = outVal.plus(twoPower)), twoPower = twoPower.times(two);return BigNumber.config({ precision: prevPrec }), 0 === expFuncVal && (outVal.s = -outVal.s), outVal;}function decCoefficientToBinaryString(x) {for (var s, a = x.d, r = a[0] + "", i = 1; i < a.length; ++i) {s = a[i] + "";for (var z = 7 - s.length; z--;) s = "0" + s;r += s;}for (var j = r.length; "0" === r.charAt(j);) j--;var xe = x.e,str = r.slice(0, j + 1 || 1),strL = str.length;if (0 < xe) if (++xe > strL) for (xe -= strL; xe--;) str += "0";else xe < strL && (str = str.slice(0, xe) + "." + str.slice(xe));for (var arrL, arr = [0], _i2 = 0; _i2 < str.length;) {for (arrL = arr.length; arrL--;) arr[arrL] *= 10;arr[0] += parseInt(str.charAt(_i2++));for (var _j = 0; _j < arr.length; ++_j) 1 < arr[_j] && ((null === arr[_j + 1] || void 0 === arr[_j + 1]) && (arr[_j + 1] = 0), arr[_j + 1] += arr[_j] >> 1, arr[_j] &= 1);}return arr.reverse();}function bitXor(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function bitXor");var BigNumber = x.constructor;if (x.isNaN() || y.isNaN()) return new BigNumber(NaN);if (x.isZero()) return y;if (y.isZero()) return x;if (x.eq(y)) return new BigNumber(0);var negOne = new BigNumber(-1);return x.eq(negOne) ? bitNotBigNumber(y) : y.eq(negOne) ? bitNotBigNumber(x) : x.isFinite() && y.isFinite() ? bitwise(x, y, function (a, b) {return a ^ b;}) : x.isFinite() || y.isFinite() ? new BigNumber(x.isNegative() === y.isNegative() ? 1 / 0 : -Infinity) : negOne;}function leftShiftBigNumber(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function leftShift");var BigNumber = x.constructor;return x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero() ? new BigNumber(NaN) : x.isZero() || y.isZero() ? x : x.isFinite() || y.isFinite() ? y.lt(55) ? x.times(Math.pow(2, y.toNumber()) + "") : x.times(new BigNumber(2).pow(y)) : new BigNumber(NaN);}function rightArithShiftBigNumber(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function rightArithShift");var BigNumber = x.constructor;return x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero() ? new BigNumber(NaN) : x.isZero() || y.isZero() ? x : y.isFinite() ? y.lt(55) ? x.div(Math.pow(2, y.toNumber()) + "").floor() : x.div(new BigNumber(2).pow(y)).floor() : x.isNegative() ? new BigNumber(-1) : x.isFinite() ? new BigNumber(0) : new BigNumber(NaN);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/plain/number/bitwise.js
var bitwise_n1 = "number",bitwise_n2 = "number, number";function bitAndNumber(x, y) {if (!isInteger(x) || !isInteger(y)) throw new Error("Integers expected in function bitAnd");return x & y;}bitAndNumber.signature = bitwise_n2;function bitNotNumber(x) {if (!isInteger(x)) throw new Error("Integer expected in function bitNot");return ~x;}bitNotNumber.signature = "number";function bitOrNumber(x, y) {if (!isInteger(x) || !isInteger(y)) throw new Error("Integers expected in function bitOr");return x | y;}bitOrNumber.signature = bitwise_n2;function bitXorNumber(x, y) {if (!isInteger(x) || !isInteger(y)) throw new Error("Integers expected in function bitXor");return x ^ y;}bitXorNumber.signature = bitwise_n2;function leftShiftNumber(x, y) {if (!isInteger(x) || !isInteger(y)) throw new Error("Integers expected in function leftShift");return x << y;}leftShiftNumber.signature = bitwise_n2;function rightArithShiftNumber(x, y) {if (!isInteger(x) || !isInteger(y)) throw new Error("Integers expected in function rightArithShift");return x >> y;}rightArithShiftNumber.signature = bitwise_n2;function rightLogShiftNumber(x, y) {if (!isInteger(x) || !isInteger(y)) throw new Error("Integers expected in function rightLogShift");return x >>> y;}rightLogShiftNumber.signature = bitwise_n2;
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/bitwise/bitNot.js
var bitNot_name = "bitNot",bitNot_dependencies = ["typed"];var createBitNot = factory("bitNot", bitNot_dependencies, (_ref) => {var { typed } = _ref;return typed(bitNot_name, { number: bitNotNumber, BigNumber: bitNotBigNumber, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/complex/arg.js
var arg_name = "arg",arg_dependencies = ["typed"];var createArg = factory("arg", arg_dependencies, (_ref) => {var { typed } = _ref;return typed(arg_name, { number: function (x) {return Math.atan2(0, x);}, BigNumber: function (x) {return x.constructor.atan2(0, x);}, Complex: function (x) {return x.arg();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/complex/im.js
var im_name = "im",im_dependencies = ["typed"];var createIm = factory("im", im_dependencies, (_ref) => {var { typed } = _ref;return typed(im_name, { number: function () {return 0;}, BigNumber: function (x) {return x.mul(0);}, Fraction: function (x) {return x.mul(0);}, Complex: function (x) {return x.im;}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/plain/number/logical.js
var logical_n1 = "number",logical_n2 = "number, number";function notNumber(x) {return !x;}notNumber.signature = "number";function orNumber(x, y) {return !!(x || y);}orNumber.signature = logical_n2;function xorNumber(x, y) {return !!x != !!y;}xorNumber.signature = logical_n2;function andNumber(x, y) {return !!(x && y);}andNumber.signature = logical_n2;
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/logical/not.js
var not_name = "not",not_dependencies = ["typed"];var createNot = factory("not", not_dependencies, (_ref) => {var { typed } = _ref;return typed(not_name, { number: notNumber, Complex: function (x) {return 0 === x.re && 0 === x.im;}, BigNumber: function (x) {return x.isZero() || x.isNaN();}, Unit: function (x) {return !(null !== x.value) || this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/filter.js
var filter_name = "filter",filter_dependencies = ["typed"];var createFilter = factory("filter", filter_dependencies, (_ref) => {var { typed } = _ref;return typed("filter", { "Array, function": _filterCallback, "Matrix, function": function (x, test) {return x.create(_filterCallback(x.toArray(), test));}, "Array, RegExp": filterRegExp, "Matrix, RegExp": function (x, test) {return x.create(filterRegExp(x.toArray(), test));} });});function _filterCallback(x, callback) {var args = maxArgumentCount(callback);return filter(x, function (value, index, array) {return 1 === args ? callback(value) : 2 === args ? callback(value, [index]) : callback(value, [index], array);});}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/forEach.js
var forEach_name = "forEach",forEach_dependencies = ["typed"];var createForEach = factory("forEach", forEach_dependencies, (_ref) => {var { typed } = _ref;return typed(forEach_name, { "Array, function": _forEach, "Matrix, function": function (x, callback) {return x.forEach(callback);} });});function _forEach(array, callback) {var args = maxArgumentCount(callback);(function recurse(value, index) {Array.isArray(value) ? forEach(value, function (child, i) {recurse(child, index.concat(i));}) : 1 === args ? callback(value) : 2 === args ? callback(value, index) : callback(value, index, array);})(array, []);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/map.js
var map_name = "map",map_dependencies = ["typed"];var map_createMap = factory("map", map_dependencies, (_ref) => {var { typed } = _ref;return typed(map_name, { "Array, function": _map, "Matrix, function": function (x, callback) {return x.map(callback);} });});function _map(array, callback) {var args = maxArgumentCount(callback);return function recurse(value, index) {return Array.isArray(value) ? value.map(function (child, i) {return recurse(child, index.concat(i));}) : 1 === args ? callback(value) : 2 === args ? callback(value, index) : callback(value, index, array);}(array, []);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/special/erf.js
var erf_name = "erf",erf_dependencies = ["typed"];var createErf = factory("erf", erf_dependencies, (_ref) => {function erf1(y) {var i,ysq = y * y,xnum = P[0][4] * ysq,xden = ysq;for (i = 0; 3 > i; i += 1) xnum = (xnum + P[0][i]) * ysq, xden = (xden + Q[0][i]) * ysq;return y * (xnum + P[0][3]) / (xden + Q[0][3]);}function erfc2(y) {var i,xnum = P[1][8] * y,xden = y;for (i = 0; 7 > i; i += 1) xnum = (xnum + P[1][i]) * y, xden = (xden + Q[1][i]) * y;var result = (xnum + P[1][7]) / (xden + Q[1][7]),ysq = parseInt(16 * y) / 16;return Math.exp(-ysq * ysq) * Math.exp(-((y - ysq) * (y + ysq))) * result;}function erfc3(y) {var i,ysq = 1 / (y * y),xnum = P[2][5] * ysq,xden = ysq;for (i = 0; 4 > i; i += 1) xnum = (xnum + P[2][i]) * ysq, xden = (xden + Q[2][i]) * ysq;var result = ysq * (xnum + P[2][4]) / (xden + Q[2][4]);result = (SQRPI - result) / y, ysq = parseInt(16 * y) / 16;var del = (y - ysq) * (y + ysq);return Math.exp(-ysq * ysq) * Math.exp(-del) * result;}var { typed } = _ref;return typed("name", { number: function (x) {var y = Math.abs(x);return y >= MAX_NUM ? sign(x) : y <= THRESH ? sign(x) * erf1(y) : 4 >= y ? sign(x) * (1 - erfc2(y)) : sign(x) * (1 - erfc3(y));}, "Array | Matrix": function (n) {return deepMap(n, this);} });});var THRESH = .46875,SQRPI = .5641895835477563,P = [[3.1611237438705655, 113.86415415105016, 377.485237685302, 3209.3775891384694, .18577770618460315], [.5641884969886701, 8.883149794388377, 66.11919063714163, 298.6351381974001, 881.952221241769, 1712.0476126340707, 2051.0783778260716, 1230.3393547979972, 2.1531153547440383e-8], [.30532663496123236, .36034489994980445, .12578172611122926, .016083785148742275, .0006587491615298378, .016315387137302097]],Q = [[23.601290952344122, 244.02463793444417, 1282.6165260773723, 2844.236833439171], [15.744926110709835, 117.6939508913125, 537.1811018620099, 1621.3895745666903, 3290.7992357334597, 4362.619090143247, 3439.3676741437216, 1230.3393548037495], [2.568520192289822, 1.8729528499234604, .5279051029514285, .06051834131244132, .0023352049762686918]],MAX_NUM = Math.pow(2, 53);
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/string/format.js
var format_name = "format",format_dependencies = ["typed"];var createFormat = factory("format", format_dependencies, (_ref) => {var { typed } = _ref;return typed(format_name, { any: string_format, "any, Object | function | number": string_format });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/string/oct.js
var oct_name = "oct",oct_dependencies = ["typed", "format"];var createOct = factory("oct", oct_dependencies, (_ref) => {var { typed, format } = _ref;return typed(oct_name, { "number | BigNumber": function (n) {return format(n, { notation: "oct" });}, "number | BigNumber, number": function (n, wordSize) {return format(n, { notation: "oct", wordSize: wordSize });} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/string/print.js
var print_name = "print",print_dependencies = ["typed"];var createPrint = factory("print", print_dependencies, (_ref) => {var { typed } = _ref;return typed(print_name, { "string, Object | Array": _print, "string, Object | Array, number | Object": _print });});function _print(template, values, options) {return template.replace(/\$([\w.]+)/g, function (original, key) {for (var keys = key.split("."), value = values[keys.shift()]; keys.length && value !== void 0;) {var k = keys.shift();value = k ? value[k] : value + ".";}return void 0 === value ? original : isString(value) ? value : string_format(value, options);});}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/isPrime.js
var isPrime_name = "isPrime",isPrime_dependencies = ["typed"];var createIsPrime = factory("isPrime", isPrime_dependencies, (_ref) => {var { typed } = _ref;return typed(isPrime_name, { number: function (x) {if (0 != 0 * x) return !1;if (3 >= x) return 1 < x;if (0 == x % 2 || 0 == x % 3) return !1;for (var i = 5; i * i <= x; i += 6) if (0 == x % i || 0 == x % (i + 2)) return !1;return !0;}, BigNumber: function (n) {function modPow(base, exponent, modulus) {for (var accumulator = 1; !exponent.eq(0);) exponent.mod(2).eq(0) ? (exponent = exponent.div(2), base = base.mul(base).mod(modulus)) : (exponent = exponent.sub(1), accumulator = base.mul(accumulator).mod(modulus));return accumulator;}if (0 != 0 * n.toNumber()) return !1;if (n.lte(3)) return n.gt(1);if (n.mod(2).eq(0) || n.mod(3).eq(0)) return !1;if (n.lt(Math.pow(2, 32))) {for (var x = n.toNumber(), i = 5; i * i <= x; i += 6) if (0 == x % i || 0 == x % (i + 2)) return !1;return !0;}var Decimal = n.constructor.clone({ precision: 2 * n.toFixed(0).length });n = new Decimal(n);for (var r = 0, d = n.sub(1); d.mod(2).eq(0);) d = d.div(2), r += 1;var bases = null;if (n.lt("3317044064679887385961981")) bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41].filter((x) => x < n);else {var max = Math.min(n.toNumber() - 2, Math.floor(2 * Math.pow(n.toFixed(0).length * Math.log(10), 2)));bases = [];for (var _i = 2; _i <= max; _i += 1) bases.push(max);}for (var _i2 = 0; _i2 < bases.length; _i2 += 1) {var a = bases[_i2],adn = modPow(n.sub(n).add(a), d, n);if (!adn.eq(1)) for (var _i3 = 0, _x = adn; !_x.eq(n.sub(1)); _i3 += 1, _x = _x.mul(_x).mod(n)) if (_i3 == r - 1) return !1;}return !0;}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/acos.js
var acos_name = "acos",acos_dependencies = ["typed", "config", "Complex"];var createAcos = factory("acos", acos_dependencies, (_ref) => {var { typed, config, Complex } = _ref;return typed(acos_name, { number: function (x) {return -1 <= x && 1 >= x || config.predictable ? Math.acos(x) : new Complex(x, 0).acos();}, Complex: function (x) {return x.acos();}, BigNumber: function (x) {return x.acos();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/plain/number/trigonometry.js
var trigonometry_n1 = "number",trigonometry_n2 = "number, number";function acosNumber(x) {return Math.acos(x);}acosNumber.signature = "number";function acoshNumber(x) {return acosh(x);}acoshNumber.signature = "number";function acotNumber(x) {return Math.atan(1 / x);}acotNumber.signature = "number";function acothNumber(x) {return isFinite(x) ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2 : 0;}acothNumber.signature = "number";function acscNumber(x) {return Math.asin(1 / x);}acscNumber.signature = "number";function acschNumber(x) {var xInv = 1 / x;return Math.log(xInv + Math.sqrt(xInv * xInv + 1));}acschNumber.signature = "number";function asecNumber(x) {return Math.acos(1 / x);}asecNumber.signature = "number";function asechNumber(x) {var xInv = 1 / x,ret = Math.sqrt(xInv * xInv - 1);return Math.log(ret + xInv);}asechNumber.signature = "number";function asinNumber(x) {return Math.asin(x);}asinNumber.signature = "number";function asinhNumber(x) {return asinh(x);}asinhNumber.signature = "number";function atanNumber(x) {return Math.atan(x);}atanNumber.signature = "number";function atan2Number(y, x) {return Math.atan2(y, x);}atan2Number.signature = trigonometry_n2;function atanhNumber(x) {return atanh(x);}atanhNumber.signature = "number";function cosNumber(x) {return Math.cos(x);}cosNumber.signature = "number";function coshNumber(x) {return cosh(x);}coshNumber.signature = "number";function cotNumber(x) {return 1 / Math.tan(x);}cotNumber.signature = "number";function cothNumber(x) {var e = Math.exp(2 * x);return (e + 1) / (e - 1);}cothNumber.signature = "number";function cscNumber(x) {return 1 / Math.sin(x);}cscNumber.signature = "number";function cschNumber(x) {return 0 === x ? Number.POSITIVE_INFINITY : Math.abs(2 / (Math.exp(x) - Math.exp(-x))) * sign(x);}cschNumber.signature = "number";function secNumber(x) {return 1 / Math.cos(x);}secNumber.signature = "number";function sechNumber(x) {return 2 / (Math.exp(x) + Math.exp(-x));}sechNumber.signature = "number";function sinNumber(x) {return Math.sin(x);}sinNumber.signature = "number";function sinhNumber(x) {return sinh(x);}sinhNumber.signature = "number";function tanNumber(x) {return Math.tan(x);}tanNumber.signature = "number";function tanhNumber(x) {return tanh(x);}tanhNumber.signature = "number";
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/acot.js
var acot_name = "acot",acot_dependencies = ["typed", "BigNumber"];var createAcot = factory("acot", acot_dependencies, (_ref) => {var { typed, BigNumber: _BigNumber } = _ref;return typed(acot_name, { number: acotNumber, Complex: function (x) {return x.acot();}, BigNumber: function (x) {return new _BigNumber(1).div(x).atan();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/acsc.js
var acsc_name = "acsc",acsc_dependencies = ["typed", "config", "Complex", "BigNumber"];var createAcsc = factory("acsc", acsc_dependencies, (_ref) => {var { typed, config, Complex, BigNumber: _BigNumber } = _ref;return typed(acsc_name, { number: function (x) {return -1 >= x || 1 <= x || config.predictable ? acscNumber(x) : new Complex(x, 0).acsc();}, Complex: function (x) {return x.acsc();}, BigNumber: function (x) {return new _BigNumber(1).div(x).asin();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/asec.js
var asec_name = "asec",asec_dependencies = ["typed", "config", "Complex", "BigNumber"];var createAsec = factory("asec", asec_dependencies, (_ref) => {var { typed, config, Complex, BigNumber: _BigNumber } = _ref;return typed(asec_name, { number: function (x) {return -1 >= x || 1 <= x || config.predictable ? asecNumber(x) : new Complex(x, 0).asec();}, Complex: function (x) {return x.asec();}, BigNumber: function (x) {return new _BigNumber(1).div(x).acos();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/asin.js
var asin_name = "asin",asin_dependencies = ["typed", "config", "Complex"];var createAsin = factory("asin", asin_dependencies, (_ref) => {var { typed, config, Complex } = _ref;return typed(asin_name, { number: function (x) {return -1 <= x && 1 >= x || config.predictable ? Math.asin(x) : new Complex(x, 0).asin();}, Complex: function (x) {return x.asin();}, BigNumber: function (x) {return x.asin();}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/atan.js
var atan_name = "atan",atan_dependencies = ["typed"];var createAtan = factory("atan", atan_dependencies, (_ref) => {var { typed } = _ref;return typed("atan", { number: function (x) {return Math.atan(x);}, Complex: function (x) {return x.atan();}, BigNumber: function (x) {return x.atan();}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/atanh.js
var atanh_name = "atanh",atanh_dependencies = ["typed", "config", "Complex"];var createAtanh = factory("atanh", atanh_dependencies, (_ref) => {var { typed, config, Complex } = _ref;return typed(atanh_name, { number: function (x) {return 1 >= x && -1 <= x || config.predictable ? atanhNumber(x) : new Complex(x, 0).atanh();}, Complex: function (x) {return x.atanh();}, BigNumber: function (x) {return x.atanh();}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/cosh.js
var cosh_name = "cosh",cosh_dependencies = ["typed"];var createCosh = factory("cosh", cosh_dependencies, (_ref) => {var { typed } = _ref;return typed(cosh_name, { number: cosh, Complex: function (x) {return x.cosh();}, BigNumber: function (x) {return x.cosh();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function cosh is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/coth.js
var coth_name = "coth",coth_dependencies = ["typed", "BigNumber"];var createCoth = factory("coth", coth_dependencies, (_ref) => {var { typed, BigNumber: _BigNumber } = _ref;return typed(coth_name, { number: cothNumber, Complex: function (x) {return x.coth();}, BigNumber: function (x) {return new _BigNumber(1).div(x.tanh());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function coth is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/csch.js
var csch_name = "csch",csch_dependencies = ["typed", "BigNumber"];var createCsch = factory("csch", csch_dependencies, (_ref) => {var { typed, BigNumber: _BigNumber } = _ref;return typed(csch_name, { number: cschNumber, Complex: function (x) {return x.csch();}, BigNumber: function (x) {return new _BigNumber(1).div(x.sinh());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function csch is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/sech.js
var sech_name = "sech",sech_dependencies = ["typed", "BigNumber"];var createSech = factory("sech", sech_dependencies, (_ref) => {var { typed, BigNumber: _BigNumber } = _ref;return typed(sech_name, { number: sechNumber, Complex: function (x) {return x.sech();}, BigNumber: function (x) {return new _BigNumber(1).div(x.cosh());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function sech is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/sinh.js
var sinh_name = "sinh",sinh_dependencies = ["typed"];var createSinh = factory("sinh", sinh_dependencies, (_ref) => {var { typed } = _ref;return typed(sinh_name, { number: sinhNumber, Complex: function (x) {return x.sinh();}, BigNumber: function (x) {return x.sinh();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function sinh is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/tanh.js
var tanh_name = "tanh",tanh_dependencies = ["typed"];var createTanh = factory("tanh", tanh_dependencies, (_ref) => {var { typed } = _ref;return typed("tanh", { number: tanh, Complex: function (x) {return x.tanh();}, BigNumber: function (x) {return x.tanh();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function tanh is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/product.js
function product_product(i, n) {if (n < i) return 1;if (n === i) return n;var half = n + i >> 1;return product_product(i, half) * product_product(half + 1, n);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/plain/number/combinations.js
function combinationsNumber(n, k) {if (!isInteger(n) || 0 > n) throw new TypeError("Positive integer value expected in function combinations");if (!isInteger(k) || 0 > k) throw new TypeError("Positive integer value expected in function combinations");if (k > n) throw new TypeError("k must be less than or equal to n");var prodrange,nMinusk = n - k;return k < nMinusk ? (prodrange = product_product(nMinusk + 1, n), prodrange / product_product(1, k)) : (prodrange = product_product(k + 1, n), prodrange / product_product(1, nMinusk));}combinationsNumber.signature = "number, number";
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/combinations.js
var combinations_name = "combinations",combinations_dependencies = ["typed"];var createCombinations = factory("combinations", combinations_dependencies, (_ref) => {var { typed } = _ref;return typed(combinations_name, { "number, number": combinationsNumber, "BigNumber, BigNumber": function (n, k) {var result,i,BigNumber = n.constructor,nMinusk = n.minus(k),one = new BigNumber(1);if (!isPositiveInteger(n) || !isPositiveInteger(k)) throw new TypeError("Positive integer value expected in function combinations");if (k.gt(n)) throw new TypeError("k must be less than n in function combinations");if (result = one, k.lt(nMinusk)) for (i = one; i.lte(nMinusk); i = i.plus(one)) result = result.times(k.plus(i)).dividedBy(i);else for (i = one; i.lte(k); i = i.plus(one)) result = result.times(nMinusk.plus(i)).dividedBy(i);return result;} });});function isPositiveInteger(n) {return n.isInteger() && n.gte(0);}
// EXTERNAL MODULE: ./node_modules/seedrandom/index.js
var seedrandom = __webpack_require__("./node_modules/seedrandom/index.js");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/util/seededRNG.js
var singletonRandom = seedrandom(Date.now());function createRng(randomSeed) {function rng() {return random();}var random;return function setSeed(seed) {random = null === seed ? singletonRandom : seedrandom(seed + "");}(randomSeed), rng;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/pickRandom.js
var pickRandom_name = "pickRandom",pickRandom_dependencies = ["typed", "config", "?on"];var createPickRandom = factory("pickRandom", pickRandom_dependencies, (_ref) => {function _pickRandom(possibles, _ref2) {var { number, weights, elementWise = !0 } = _ref2,single = "undefined" == typeof number;single && (number = 1);var createMatrix = isMatrix(possibles) ? possibles.create : isMatrix(weights) ? weights.create : null;possibles = possibles.valueOf(), weights && (weights = weights.valueOf()), !0 === elementWise && (possibles = flatten(possibles), weights = flatten(weights));var totalWeights = 0;if ("undefined" != typeof weights) {if (weights.length !== possibles.length) throw new Error("Weights must have the same length as possibles");for (var i = 0, len = weights.length; i < len; i++) {if (!isNumber(weights[i]) || 0 > weights[i]) throw new Error("Weights must be an array of positive numbers");totalWeights += weights[i];}}for (var pick, length = possibles.length, result = []; result.length < number;) {if ("undefined" == typeof weights) pick = possibles[Math.floor(rng() * length)];else for (var randKey = rng() * totalWeights, _i = 0, _len = possibles.length; _i < _len; _i++) if (randKey -= weights[_i], 0 > randKey) {pick = possibles[_i];break;}result.push(pick);}return single ? result[0] : createMatrix ? createMatrix(result) : result;}var { typed, config, on } = _ref,rng = createRng(config.randomSeed);return on && on("config", function (curr, prev) {curr.randomSeed !== prev.randomSeed && (rng = createRng(curr.randomSeed));}), typed(pickRandom_name, { "Array | Matrix": function (possibles) {return _pickRandom(possibles, {});}, "Array | Matrix, Object": function (possibles, options) {return _pickRandom(possibles, options);}, "Array | Matrix, number": function (possibles, number) {return _pickRandom(possibles, { number });}, "Array | Matrix, Array | Matrix": function (possibles, weights) {return _pickRandom(possibles, { weights });}, "Array | Matrix, Array | Matrix, number": function (possibles, weights, number) {return _pickRandom(possibles, { number, weights });}, "Array | Matrix, number, Array | Matrix": function (possibles, number, weights) {return _pickRandom(possibles, { number, weights });} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/util/randomMatrix.js
function randomMatrix(size, random) {var data = [];if (size = size.slice(0), 1 < size.length) for (var i = 0, length = size.shift(); i < length; i++) data.push(randomMatrix(size, random));else for (var _i = 0, _length = size.shift(); _i < _length; _i++) data.push(random());return data;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/randomInt.js
var randomInt_name = "randomInt",randomInt_dependencies = ["typed", "config", "?on"];var createRandomInt = factory("randomInt", randomInt_dependencies, (_ref) => {function _randomIntMatrix(size, min, max) {var res = randomMatrix(size.valueOf(), () => _randomInt(min, max));return isMatrix(size) ? size.create(res) : res;}function _randomInt(min, max) {return Math.floor(min + rng() * (max - min));}var { typed, config, on } = _ref,rng = createRng(config.randomSeed);return on && on("config", function (curr, prev) {curr.randomSeed !== prev.randomSeed && (rng = createRng(curr.randomSeed));}), typed(randomInt_name, { "": () => _randomInt(0, 1), number: (max) => _randomInt(0, max), "number, number": (min, max) => _randomInt(min, max), "Array | Matrix": (size) => _randomIntMatrix(size, 0, 1), "Array | Matrix, number": (size, max) => _randomIntMatrix(size, 0, max), "Array | Matrix, number, number": (size, min, max) => _randomIntMatrix(size, min, max) });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/clone.js
var clone_name = "clone",clone_dependencies = ["typed"];var createClone = factory("clone", clone_dependencies, (_ref) => {var { typed } = _ref;return typed(clone_name, { any: clone });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/hasNumericValue.js
var hasNumericValue_name = "hasNumericValue",hasNumericValue_dependencies = ["typed", "isNumeric"];var createHasNumericValue = factory("hasNumericValue", hasNumericValue_dependencies, (_ref) => {var { typed, isNumeric } = _ref;return typed(hasNumericValue_name, { string: function (x) {return 0 < x.trim().length && !isNaN(+x);}, any: function (x) {return isNumeric(x);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/typeOf.js
var typeOf_name = "typeOf",typeOf_dependencies = ["typed"];var createTypeOf = factory("typeOf", typeOf_dependencies, (_ref) => {var { typed } = _ref;return typed(typeOf_name, { any: typeOf });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/string.js
var string_name = "string",string_dependencies = ["typed"];var createString = factory("string", string_dependencies, (_ref) => {var { typed } = _ref;return typed(string_name, { "": function () {return "";}, number: format, null: function () {return "null";}, boolean: function (x) {return x + "";}, string: function (x) {return x;}, "Array | Matrix": function (x) {return deepMap(x, this);}, any: function (x) {return x + "";} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/fraction/function/fraction.js
var fraction_name = "fraction",fraction_dependencies = ["typed", "Fraction"];var createFraction = factory("fraction", fraction_dependencies, (_ref) => {var { typed, Fraction } = _ref;return typed("fraction", { number: function (x) {if (!isFinite(x) || isNaN(x)) throw new Error(x + " cannot be represented as a fraction");return new Fraction(x);}, string: function (x) {return new Fraction(x);}, "number, number": function (numerator, denominator) {return new Fraction(numerator, denominator);}, null: function () {return new Fraction(0);}, BigNumber: function (x) {return new Fraction(x.toString());}, Fraction: function (x) {return x;}, Object: function (x) {return new Fraction(x);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/unaryMinus.js
var unaryMinus_name = "unaryMinus",unaryMinus_dependencies = ["typed"];var createUnaryMinus = factory("unaryMinus", unaryMinus_dependencies, (_ref) => {var { typed } = _ref;return typed(unaryMinus_name, { number: unaryMinusNumber, Complex: function (x) {return x.neg();}, BigNumber: function (x) {return x.neg();}, Fraction: function (x) {return x.neg();}, Unit: function (x) {var res = x.clone();return res.value = this(x.value), res;}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/addScalar.js
var addScalar_name = "addScalar",addScalar_dependencies = ["typed"];var createAddScalar = factory("addScalar", addScalar_dependencies, (_ref) => {var { typed } = _ref;return typed(addScalar_name, { "number, number": addNumber, "Complex, Complex": function (x, y) {return x.add(y);}, "BigNumber, BigNumber": function (x, y) {return x.plus(y);}, "Fraction, Fraction": function (x, y) {return x.add(y);}, "Unit, Unit": function (x, y) {if (null === x.value || void 0 === x.value) throw new Error("Parameter x contains a unit with undefined value");if (null === y.value || void 0 === y.value) throw new Error("Parameter y contains a unit with undefined value");if (!x.equalBase(y)) throw new Error("Units do not match");var res = x.clone();return res.value = this(res.value, y.value), res.fixPrefix = !1, res;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/exp.js
var exp_name = "exp",exp_dependencies = ["typed"];var createExp = factory("exp", exp_dependencies, (_ref) => {var { typed } = _ref;return typed(exp_name, { number: expNumber, Complex: function (x) {return x.exp();}, BigNumber: function (x) {return x.exp();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/log2.js
var log2_name = "log2",log2_dependencies = ["typed", "config", "Complex"];var createLog2 = factory("log2", log2_dependencies, (_ref) => {function _log2Complex(x) {var newX = Math.sqrt(x.re * x.re + x.im * x.im);return new Complex(Math.log2 ? Math.log2(newX) : Math.log(newX) / Math.LN2, Math.atan2(x.im, x.re) / Math.LN2);}var { typed, config, Complex } = _ref;return typed(log2_name, { number: function (x) {return 0 <= x || config.predictable ? log2Number(x) : _log2Complex(new Complex(x, 0));}, Complex: _log2Complex, BigNumber: function (x) {return !x.isNegative() || config.predictable ? x.log(2) : _log2Complex(new Complex(x.toNumber(), 0));}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/sqrt.js
var sqrt_name = "sqrt",sqrt_dependencies = ["config", "typed", "Complex"];var createSqrt = factory("sqrt", sqrt_dependencies, (_ref) => {function _sqrtNumber(x) {return isNaN(x) ? NaN : 0 <= x || config.predictable ? Math.sqrt(x) : new Complex(x, 0).sqrt();}var { config, typed, Complex } = _ref;return typed("sqrt", { number: _sqrtNumber, Complex: function (x) {return x.sqrt();}, BigNumber: function (x) {return !x.isNegative() || config.predictable ? x.sqrt() : _sqrtNumber(x.toNumber());}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, Unit: function (x) {return x.pow(.5);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/complex/conj.js
var conj_name = "conj",conj_dependencies = ["typed"];var createConj = factory("conj", conj_dependencies, (_ref) => {var { typed } = _ref;return typed(conj_name, { number: function (x) {return x;}, BigNumber: function (x) {return x;}, Complex: function (x) {return x.conjugate();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/getMatrixDataType.js
var getMatrixDataType_name = "getMatrixDataType",getMatrixDataType_dependencies = ["typed"];var createGetMatrixDataType = factory("getMatrixDataType", getMatrixDataType_dependencies, (_ref) => {var { typed } = _ref;return typed(getMatrixDataType_name, { Array: function (x) {return getArrayDataType(x, typeOf);}, Matrix: function (x) {return x.getDataType();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/mode.js
var mode_name = "mode",mode_dependencies = ["typed", "isNaN", "isNumeric"];var createMode = factory("mode", mode_dependencies, (_ref) => {function _mode(values) {values = flatten(values.valueOf());var num = values.length;if (0 === num) throw new Error("Cannot calculate mode of an empty array");for (var value, count = {}, mode = [], max = 0, i = 0; i < values.length; i++) {if (value = values[i], isNumeric(value) && isNaN(value)) throw new Error("Cannot calculate mode of an array containing NaN values");value in count || (count[value] = 0), count[value]++, count[value] === max ? mode.push(value) : count[value] > max && (max = count[value], mode = [value]);}return mode;}var { typed, isNaN, isNumeric } = _ref;return typed(mode_name, { "Array | Matrix": _mode, "...": function (args) {return _mode(args);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/string/bin.js
var bin_name = "bin",bin_dependencies = ["typed", "format"];var createBin = factory("bin", bin_dependencies, (_ref) => {var { typed, format } = _ref;return typed(bin_name, { "number | BigNumber": function (n) {return format(n, { notation: "bin" });}, "number | BigNumber, number": function (n, wordSize) {return format(n, { notation: "bin", wordSize: wordSize });} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/acosh.js
var acosh_name = "acosh",acosh_dependencies = ["typed", "config", "Complex"];var createAcosh = factory("acosh", acosh_dependencies, (_ref) => {var { typed, config, Complex } = _ref;return typed(acosh_name, { number: function (x) {return 1 <= x || config.predictable ? acoshNumber(x) : -1 >= x ? new Complex(Math.log(Math.sqrt(x * x - 1) - x), Math.PI) : new Complex(x, 0).acosh();}, Complex: function (x) {return x.acosh();}, BigNumber: function (x) {return x.acosh();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/acsch.js
var acsch_name = "acsch",acsch_dependencies = ["typed", "BigNumber"];var createAcsch = factory("acsch", acsch_dependencies, (_ref) => {var { typed, BigNumber: _BigNumber } = _ref;return typed(acsch_name, { number: acschNumber, Complex: function (x) {return x.acsch();}, BigNumber: function (x) {return new _BigNumber(1).div(x).asinh();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/asinh.js
var asinh_name = "asinh",asinh_dependencies = ["typed"];var createAsinh = factory("asinh", asinh_dependencies, (_ref) => {var { typed } = _ref;return typed("asinh", { number: asinhNumber, Complex: function (x) {return x.asinh();}, BigNumber: function (x) {return x.asinh();}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/cos.js
var cos_name = "cos",cos_dependencies = ["typed"];var createCos = factory("cos", cos_dependencies, (_ref) => {var { typed } = _ref;return typed(cos_name, { number: Math.cos, Complex: function (x) {return x.cos();}, BigNumber: function (x) {return x.cos();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function cos is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/csc.js
var csc_name = "csc",csc_dependencies = ["typed", "BigNumber"];var createCsc = factory("csc", csc_dependencies, (_ref) => {var { typed, BigNumber: _BigNumber } = _ref;return typed(csc_name, { number: cscNumber, Complex: function (x) {return x.csc();}, BigNumber: function (x) {return new _BigNumber(1).div(x.sin());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function csc is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/sin.js
var sin_name = "sin",sin_dependencies = ["typed"];var createSin = factory("sin", sin_dependencies, (_ref) => {var { typed } = _ref;return typed(sin_name, { number: Math.sin, Complex: function (x) {return x.sin();}, BigNumber: function (x) {return x.sin();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function sin is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/combinationsWithRep.js
var combinationsWithRep_name = "combinationsWithRep",combinationsWithRep_dependencies = ["typed"];var createCombinationsWithRep = factory("combinationsWithRep", combinationsWithRep_dependencies, (_ref) => {var { typed } = _ref;return typed(combinationsWithRep_name, { "number, number": function (n, k) {if (!isInteger(n) || 0 > n) throw new TypeError("Positive integer value expected in function combinationsWithRep");if (!isInteger(k) || 0 > k) throw new TypeError("Positive integer value expected in function combinationsWithRep");if (1 > n) throw new TypeError("k must be less than or equal to n + k - 1");if (k < n - 1) {var _prodrange = product_product(n, n + k - 1);return _prodrange / product_product(1, k);}var prodrange = product_product(k + 1, n + k - 1);return prodrange / product_product(1, n - 1);}, "BigNumber, BigNumber": function (n, k) {var result,i,BigNumber = n.constructor,one = new BigNumber(1),nMinusOne = n.minus(one);if (!combinationsWithRep_isPositiveInteger(n) || !combinationsWithRep_isPositiveInteger(k)) throw new TypeError("Positive integer value expected in function combinationsWithRep");if (n.lt(one)) throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if (result = one, k.lt(nMinusOne)) for (i = one; i.lte(nMinusOne); i = i.plus(one)) result = result.times(k.plus(i)).dividedBy(i);else for (i = one; i.lte(k); i = i.plus(one)) result = result.times(nMinusOne.plus(i)).dividedBy(i);return result;} });});function combinationsWithRep_isPositiveInteger(n) {return n.isInteger() && n.gte(0);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/random.js
var random_name = "random",random_dependencies = ["typed", "config", "?on"];var createRandom = factory("random", random_dependencies, (_ref) => {function _randomMatrix(size, min, max) {var res = randomMatrix(size.valueOf(), () => _random(min, max));return isMatrix(size) ? size.create(res) : res;}function _random(min, max) {return min + rng() * (max - min);}var { typed, config, on } = _ref,rng = createRng(config.randomSeed);return on && on("config", function (curr, prev) {curr.randomSeed !== prev.randomSeed && (rng = createRng(curr.randomSeed));}), typed(random_name, { "": () => _random(0, 1), number: (max) => _random(0, max), "number, number": (min, max) => _random(min, max), "Array | Matrix": (size) => _randomMatrix(size, 0, 1), "Array | Matrix, number": (size, max) => _randomMatrix(size, 0, max), "Array | Matrix, number, number": (size, min, max) => _randomMatrix(size, min, max) });});var createRandomNumber = factory("random", ["typed", "config", "?on"], (_ref2) => {function _random(min, max) {return min + rng() * (max - min);}var { typed, config, on, matrix } = _ref2,rng = createRng(config.randomSeed);return on && on("config", function (curr, prev) {curr.randomSeed !== prev.randomSeed && (rng = createRng(curr.randomSeed));}), typed(random_name, { "": () => _random(0, 1), number: (max) => _random(0, max), "number, number": (min, max) => _random(min, max) });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/isNegative.js
var isNegative_name = "isNegative",isNegative_dependencies = ["typed"];var createIsNegative = factory("isNegative", isNegative_dependencies, (_ref) => {var { typed } = _ref;return typed(isNegative_name, { number: isNegativeNumber, BigNumber: function (x) {return x.isNeg() && !x.isZero() && !x.isNaN();}, Fraction: function (x) {return 0 > x.s;}, Unit: function (x) {return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/SparseMatrix.js
var SparseMatrix_name = "SparseMatrix",SparseMatrix_dependencies = ["typed", "equalScalar", "Matrix"];var createSparseMatrixClass = factory("SparseMatrix", SparseMatrix_dependencies, (_ref) => {function SparseMatrix(data, datatype) {if (!(this instanceof SparseMatrix)) throw new SyntaxError("Constructor must be called with the new operator");if (datatype && !isString(datatype)) throw new Error("Invalid datatype: " + datatype);if (isMatrix(data)) _createFromMatrix(this, data, datatype);else if (data && isArray(data.index) && isArray(data.ptr) && isArray(data.size)) this._values = data.values, this._index = data.index, this._ptr = data.ptr, this._size = data.size, this._datatype = datatype || data.datatype;else if (isArray(data)) _createFromArray(this, data, datatype);else if (data) throw new TypeError("Unsupported type of data (" + typeOf(data) + ")");else this._values = [], this._index = [], this._ptr = [0], this._size = [0, 0], this._datatype = datatype;}function _createFromMatrix(matrix, source, datatype) {"SparseMatrix" === source.type ? (matrix._values = source._values ? clone(source._values) : void 0, matrix._index = clone(source._index), matrix._ptr = clone(source._ptr), matrix._size = clone(source._size), matrix._datatype = datatype || source._datatype) : _createFromArray(matrix, source.valueOf(), datatype || source._datatype);}function _createFromArray(matrix, data, datatype) {matrix._values = [], matrix._index = [], matrix._ptr = [], matrix._datatype = datatype;var rows = data.length,columns = 0,eq = equalScalar,zero = 0;if (isString(datatype) && (eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar, zero = typed.convert(0, datatype)), 0 < rows) {var j = 0;do {matrix._ptr.push(matrix._index.length);for (var row, i = 0; i < rows; i++) if (row = data[i], !isArray(row)) 0 === j && 1 > columns && (columns = 1), eq(row, zero) || (matrix._values.push(row), matrix._index.push(i));else if (0 === j && columns < row.length && (columns = row.length), j < row.length) {var v = row[j];eq(v, zero) || (matrix._values.push(v), matrix._index.push(i));}j++;} while (j < columns);}matrix._ptr.push(matrix._index.length), matrix._size = [rows, columns];}function _getsubset(matrix, idx) {if (!isIndex(idx)) throw new TypeError("Invalid index");var isScalar = idx.isScalar();if (isScalar) return matrix.get(idx.min());var size = idx.size();if (size.length !== matrix._size.length) throw new DimensionError(size.length, matrix._size.length);var i,ii,k,kk,min = idx.min(),max = idx.max();for (i = 0, ii = matrix._size.length; i < ii; i++) validateIndex(min[i], matrix._size[i]), validateIndex(max[i], matrix._size[i]);var mvalues = matrix._values,mindex = matrix._index,mptr = matrix._ptr,rows = idx.dimension(0),columns = idx.dimension(1),w = [],pv = [];rows.forEach(function (i, r) {pv[i] = r[0], w[i] = !0;});var values = mvalues ? [] : void 0,index = [],ptr = [];return columns.forEach(function (j) {for (ptr.push(index.length), k = mptr[j], kk = mptr[j + 1]; k < kk; k++) i = mindex[k], !0 === w[i] && (index.push(pv[i]), values && values.push(mvalues[k]));}), ptr.push(index.length), new SparseMatrix({ values: values, index: index, ptr: ptr, size: size, datatype: matrix._datatype });}function _setsubset(matrix, index, submatrix, defaultValue) {if (!index || !0 !== index.isIndex) throw new TypeError("Invalid index");var sSize,iSize = index.size(),isScalar = index.isScalar();if (isMatrix(submatrix) ? (sSize = submatrix.size(), submatrix = submatrix.toArray()) : sSize = arraySize(submatrix), isScalar) {if (0 !== sSize.length) throw new TypeError("Scalar expected");matrix.set(index.min(), submatrix, defaultValue);} else {if (1 !== iSize.length && 2 !== iSize.length) throw new DimensionError(iSize.length, matrix._size.length, "<");if (sSize.length < iSize.length) {for (var i = 0, outer = 0; 1 === iSize[i] && 1 === sSize[i];) i++;for (; 1 === iSize[i];) outer++, i++;submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);}if (!deepStrictEqual(iSize, sSize)) throw new DimensionError(iSize, sSize, ">");for (var x0 = index.min()[0], y0 = index.min()[1], m = sSize[0], n = sSize[1], x = 0; x < m; x++) for (var v, y = 0; y < n; y++) v = submatrix[x][y], matrix.set([x + x0, y + y0], v, defaultValue);}return matrix;}function _getValueIndex(i, top, bottom, index) {if (0 == bottom - top) return bottom;for (var r = top; r < bottom; r++) if (index[r] === i) return r;return top;}function _remove(k, j, values, index, ptr) {values.splice(k, 1), index.splice(k, 1);for (var x = j + 1; x < ptr.length; x++) ptr[x]--;}function _insert(k, i, j, v, values, index, ptr) {values.splice(k, 0, v), index.splice(k, 0, i);for (var x = j + 1; x < ptr.length; x++) ptr[x]++;}function _resize(matrix, rows, columns, defaultValue) {var value = defaultValue || 0,eq = equalScalar,zero = 0;isString(matrix._datatype) && (eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar, zero = typed.convert(0, matrix._datatype), value = typed.convert(value, matrix._datatype));var i,j,k,ins = !eq(value, zero),r = matrix._size[0],c = matrix._size[1];if (columns > c) {for (j = c; j < columns; j++) if (matrix._ptr[j] = matrix._values.length, ins) for (i = 0; i < r; i++) matrix._values.push(value), matrix._index.push(i);matrix._ptr[columns] = matrix._values.length;} else columns < c && (matrix._ptr.splice(columns + 1, c - columns), matrix._values.splice(matrix._ptr[columns], matrix._values.length), matrix._index.splice(matrix._ptr[columns], matrix._index.length));if (c = columns, rows > r) {if (ins) {var n = 0;for (j = 0; j < c; j++) {matrix._ptr[j] += n, k = matrix._ptr[j + 1] + n;var p = 0;for (i = r; i < rows; i++, p++) matrix._values.splice(k + p, 0, value), matrix._index.splice(k + p, 0, i), n++;}matrix._ptr[c] = matrix._values.length;}} else if (rows < r) {var d = 0;for (j = 0; j < c; j++) {matrix._ptr[j] -= d;var k0 = matrix._ptr[j],k1 = matrix._ptr[j + 1] - d;for (k = k0; k < k1; k++) i = matrix._index[k], i > rows - 1 && (matrix._values.splice(k, 1), matrix._index.splice(k, 1), d++);}matrix._ptr[j] = matrix._values.length;}return matrix._size[0] = rows, matrix._size[1] = columns, matrix;}function _map(matrix, minRow, maxRow, minColumn, maxColumn, callback, skipZeros) {var values = [],index = [],ptr = [],eq = equalScalar,zero = 0;isString(matrix._datatype) && (eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar, zero = typed.convert(0, matrix._datatype));for (var invoke = function (v, x, y) {v = callback(v, x, y), eq(v, zero) || (values.push(v), index.push(x));}, j = minColumn; j <= maxColumn; j++) {ptr.push(values.length);var k0 = matrix._ptr[j],k1 = matrix._ptr[j + 1];if (skipZeros) for (var i, k = k0; k < k1; k++) i = matrix._index[k], i >= minRow && i <= maxRow && invoke(matrix._values[k], i - minRow, j - minColumn);else {for (var _i4, _values = {}, _k = k0; _k < k1; _k++) _i4 = matrix._index[_k], _values[_i4] = matrix._values[_k];for (var value, _i5 = minRow; _i5 <= maxRow; _i5++) value = _i5 in _values ? _values[_i5] : 0, invoke(value, _i5 - minRow, j - minColumn);}}return ptr.push(values.length), new SparseMatrix({ values: values, index: index, ptr: ptr, size: [maxRow - minRow + 1, maxColumn - minColumn + 1] });}function _toArray(values, index, ptr, size, copy) {var i,j,rows = size[0],columns = size[1],a = [];for (i = 0; i < rows; i++) for (a[i] = [], j = 0; j < columns; j++) a[i][j] = 0;for (j = 0; j < columns; j++) for (var k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) i = index[k], a[i][j] = values ? copy ? clone(values[k]) : values[k] : 1;return a;}var { typed, equalScalar, Matrix } = _ref;return SparseMatrix.prototype = new Matrix(), SparseMatrix.prototype.createSparseMatrix = function (data, datatype) {return new SparseMatrix(data, datatype);}, SparseMatrix.prototype.type = "SparseMatrix", SparseMatrix.prototype.isSparseMatrix = !0, SparseMatrix.prototype.getDataType = function () {return getArrayDataType(this._values, typeOf);}, SparseMatrix.prototype.storage = function () {return "sparse";}, SparseMatrix.prototype.datatype = function () {return this._datatype;}, SparseMatrix.prototype.create = function (data, datatype) {return new SparseMatrix(data, datatype);}, SparseMatrix.prototype.density = function () {var rows = this._size[0],columns = this._size[1];return 0 !== rows && 0 !== columns ? this._index.length / (rows * columns) : 0;}, SparseMatrix.prototype.subset = function (index, replacement, defaultValue) {if (!this._values) throw new Error("Cannot invoke subset on a Pattern only matrix");switch (arguments.length) {case 1:return _getsubset(this, index);case 2:case 3:return _setsubset(this, index, replacement, defaultValue);default:throw new SyntaxError("Wrong number of arguments");}}, SparseMatrix.prototype.get = function (index) {if (!isArray(index)) throw new TypeError("Array expected");if (index.length !== this._size.length) throw new DimensionError(index.length, this._size.length);if (!this._values) throw new Error("Cannot invoke get on a Pattern only matrix");var i = index[0],j = index[1];validateIndex(i, this._size[0]), validateIndex(j, this._size[1]);var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);return k < this._ptr[j + 1] && this._index[k] === i ? this._values[k] : 0;}, SparseMatrix.prototype.set = function (index, v, defaultValue) {if (!isArray(index)) throw new TypeError("Array expected");if (index.length !== this._size.length) throw new DimensionError(index.length, this._size.length);if (!this._values) throw new Error("Cannot invoke set on a Pattern only matrix");var i = index[0],j = index[1],rows = this._size[0],columns = this._size[1],eq = equalScalar,zero = 0;isString(this._datatype) && (eq = typed.find(equalScalar, [this._datatype, this._datatype]) || equalScalar, zero = typed.convert(0, this._datatype)), (i > rows - 1 || j > columns - 1) && (_resize(this, Math.max(i + 1, rows), Math.max(j + 1, columns), defaultValue), rows = this._size[0], columns = this._size[1]), validateIndex(i, rows), validateIndex(j, columns);var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);return k < this._ptr[j + 1] && this._index[k] === i ? eq(v, zero) ? _remove(k, j, this._values, this._index, this._ptr) : this._values[k] = v : _insert(k, i, j, v, this._values, this._index, this._ptr), this;}, SparseMatrix.prototype.resize = function (size, defaultValue, copy) {if (!isCollection(size)) throw new TypeError("Array or Matrix expected");var sizeArray = size.valueOf().map((value) => Array.isArray(value) && 1 === value.length ? value[0] : value);if (2 !== sizeArray.length) throw new Error("Only two dimensions matrix are supported");sizeArray.forEach(function (value) {if (!isNumber(value) || !isInteger(value) || 0 > value) throw new TypeError("Invalid size, must contain positive integers (size: " + string_format(sizeArray) + ")");});var m = copy ? this.clone() : this;return _resize(m, sizeArray[0], sizeArray[1], defaultValue);}, SparseMatrix.prototype.reshape = function (sizes, copy) {if (!isArray(sizes)) throw new TypeError("Array expected");if (2 !== sizes.length) throw new Error("Sparse matrices can only be reshaped in two dimensions");sizes.forEach(function (value) {if (!isNumber(value) || !isInteger(value) || -2 >= value || 0 === value) throw new TypeError("Invalid size, must contain positive integers or -1 (size: " + string_format(sizes) + ")");});var currentLength = this._size[0] * this._size[1];sizes = processSizesWildcard(sizes, currentLength);var newLength = sizes[0] * sizes[1];if (currentLength != newLength) throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var m = copy ? this.clone() : this;if (this._size[0] === sizes[0] && this._size[1] === sizes[1]) return m;for (var colIndex = [], i = 0; i < m._ptr.length; i++) for (var j = 0; j < m._ptr[i + 1] - m._ptr[i]; j++) colIndex.push(i);for (var values = m._values.slice(), rowIndex = m._index.slice(), _i = 0; _i < m._index.length; _i++) {var r1 = rowIndex[_i],c1 = colIndex[_i],flat = r1 * m._size[1] + c1;colIndex[_i] = flat % sizes[1], rowIndex[_i] = Math.floor(flat / sizes[1]);}m._values.length = 0, m._index.length = 0, m._ptr.length = sizes[1] + 1, m._size = sizes.slice();for (var _i2 = 0; _i2 < m._ptr.length; _i2++) m._ptr[_i2] = 0;for (var h = 0; h < values.length; h++) {var _i3 = rowIndex[h],_j = colIndex[h],v = values[h],k = _getValueIndex(_i3, m._ptr[_j], m._ptr[_j + 1], m._index);_insert(k, _i3, _j, v, m._values, m._index, m._ptr);}return m;}, SparseMatrix.prototype.clone = function () {var m = new SparseMatrix({ values: this._values ? clone(this._values) : void 0, index: clone(this._index), ptr: clone(this._ptr), size: clone(this._size), datatype: this._datatype });return m;}, SparseMatrix.prototype.size = function () {return this._size.slice(0);}, SparseMatrix.prototype.map = function (callback, skipZeros) {if (!this._values) throw new Error("Cannot invoke map on a Pattern only matrix");var me = this,rows = this._size[0],columns = this._size[1];return _map(this, 0, rows - 1, 0, columns - 1, function (v, i, j) {return callback(v, [i, j], me);}, skipZeros);}, SparseMatrix.prototype.forEach = function (callback, skipZeros) {if (!this._values) throw new Error("Cannot invoke forEach on a Pattern only matrix");for (var me = this, rows = this._size[0], columns = this._size[1], j = 0; j < columns; j++) {var k0 = this._ptr[j],k1 = this._ptr[j + 1];if (skipZeros) for (var i, k = k0; k < k1; k++) i = this._index[k], callback(this._values[k], [i, j], me);else {for (var _i6, values = {}, _k2 = k0; _k2 < k1; _k2++) _i6 = this._index[_k2], values[_i6] = this._values[_k2];for (var value, _i7 = 0; _i7 < rows; _i7++) value = _i7 in values ? values[_i7] : 0, callback(value, [_i7, j], me);}}}, SparseMatrix.prototype[Symbol.iterator] = function* () {if (!this._values) throw new Error("Cannot iterate a Pattern only matrix");for (var columns = this._size[1], j = 0; j < columns; j++) for (var i, k0 = this._ptr[j], k1 = this._ptr[j + 1], k = k0; k < k1; k++) i = this._index[k], yield { value: this._values[k], index: [i, j] };}, SparseMatrix.prototype.toArray = function () {return _toArray(this._values, this._index, this._ptr, this._size, !0);}, SparseMatrix.prototype.valueOf = function () {return _toArray(this._values, this._index, this._ptr, this._size, !1);}, SparseMatrix.prototype.format = function (options) {for (var rows = this._size[0], columns = this._size[1], density = this.density(), str = "Sparse Matrix [" + string_format(rows, options) + " x " + string_format(columns, options) + "] density: " + string_format(density, options) + "\n", j = 0; j < columns; j++) for (var i, k0 = this._ptr[j], k1 = this._ptr[j + 1], k = k0; k < k1; k++) i = this._index[k], str += "\n    (" + string_format(i, options) + ", " + string_format(j, options) + ") ==> " + (this._values ? string_format(this._values[k], options) : "X");return str;}, SparseMatrix.prototype.toString = function () {return string_format(this.toArray());}, SparseMatrix.prototype.toJSON = function () {return { mathjs: "SparseMatrix", values: this._values, index: this._index, ptr: this._ptr, size: this._size, datatype: this._datatype };}, SparseMatrix.prototype.diagonal = function (k) {if (!k) k = 0;else if (isBigNumber(k) && (k = k.toNumber()), !isNumber(k) || !isInteger(k)) throw new TypeError("The parameter k must be an integer number");var kSuper = 0 < k ? k : 0,kSub = 0 > k ? -k : 0,rows = this._size[0],columns = this._size[1],n = Math.min(rows - kSub, columns - kSuper),values = [],index = [],ptr = [];ptr[0] = 0;for (var j = kSuper; j < columns && values.length < n; j++) for (var i, k0 = this._ptr[j], k1 = this._ptr[j + 1], x = k0; x < k1; x++) if (i = this._index[x], i === j - kSuper + kSub) {values.push(this._values[x]), index[values.length - 1] = i - kSub;break;}return ptr.push(values.length), new SparseMatrix({ values: values, index: index, ptr: ptr, size: [n, 1] });}, SparseMatrix.fromJSON = function (json) {return new SparseMatrix(json);}, SparseMatrix.diagonal = function (size, value, k, defaultValue, datatype) {if (!isArray(size)) throw new TypeError("Array expected, size parameter");if (2 !== size.length) throw new Error("Only two dimensions matrix are supported");if (size = size.map(function (s) {if (isBigNumber(s) && (s = s.toNumber()), !isNumber(s) || !isInteger(s) || 1 > s) throw new Error("Size values must be positive integers");return s;}), !k) k = 0;else if (isBigNumber(k) && (k = k.toNumber()), !isNumber(k) || !isInteger(k)) throw new TypeError("The parameter k must be an integer number");var eq = equalScalar,zero = 0;isString(datatype) && (eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar, zero = typed.convert(0, datatype));var _value,kSuper = 0 < k ? k : 0,kSub = 0 > k ? -k : 0,rows = size[0],columns = size[1],n = Math.min(rows - kSub, columns - kSuper);if (isArray(value)) {if (value.length !== n) throw new Error("Invalid value array length");_value = function (i) {return value[i];};} else if (isMatrix(value)) {var ms = value.size();if (1 !== ms.length || ms[0] !== n) throw new Error("Invalid matrix length");_value = function (i) {return value.get([i]);};} else _value = function () {return value;};for (var values = [], index = [], ptr = [], j = 0; j < columns; j++) {ptr.push(values.length);var i = j - kSuper;if (0 <= i && i < n) {var v = _value(i);eq(v, zero) || (index.push(i + kSub), values.push(v));}}return ptr.push(values.length), new SparseMatrix({ values: values, index: index, ptr: ptr, size: [rows, columns] });}, SparseMatrix.prototype.swapRows = function (i, j) {if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) throw new Error("Row index must be positive integers");if (2 !== this._size.length) throw new Error("Only two dimensional matrix is supported");return validateIndex(i, this._size[0]), validateIndex(j, this._size[0]), SparseMatrix._swapRows(i, j, this._size[1], this._values, this._index, this._ptr), this;}, SparseMatrix._forEachRow = function (j, values, index, ptr, callback) {for (var k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) callback(index[k], values[k]);}, SparseMatrix._swapRows = function (x, y, columns, values, index, ptr) {for (var j = 0; j < columns; j++) {var k0 = ptr[j],k1 = ptr[j + 1],kx = _getValueIndex(x, k0, k1, index),ky = _getValueIndex(y, k0, k1, index);if (kx < k1 && ky < k1 && index[kx] === x && index[ky] === y) {if (values) {var v = values[kx];values[kx] = values[ky], values[ky] = v;}continue;}if (kx < k1 && index[kx] === x && (ky >= k1 || index[ky] !== y)) {var vx = values ? values[kx] : void 0;index.splice(ky, 0, y), values && values.splice(ky, 0, vx), index.splice(ky <= kx ? kx + 1 : kx, 1), values && values.splice(ky <= kx ? kx + 1 : kx, 1);continue;}if (ky < k1 && index[ky] === y && (kx >= k1 || index[kx] !== x)) {var vy = values ? values[ky] : void 0;index.splice(kx, 0, x), values && values.splice(kx, 0, vy), index.splice(kx <= ky ? ky + 1 : ky, 1), values && values.splice(kx <= ky ? ky + 1 : ky, 1);}}}, SparseMatrix;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/function/matrix.js
var matrix_name = "matrix",matrix_dependencies = ["typed", "Matrix", "DenseMatrix", "SparseMatrix"];var createMatrix = factory("matrix", matrix_dependencies, (_ref) => {function _create(data, format, datatype) {if ("dense" === format || "default" === format || format === void 0) return new DenseMatrix(data, datatype);if ("sparse" === format) return new SparseMatrix(data, datatype);throw new TypeError("Unknown matrix type " + JSON.stringify(format) + ".");}var { typed, Matrix, DenseMatrix, SparseMatrix } = _ref;return typed(matrix_name, { "": function () {return _create([]);}, string: function (format) {return _create([], format);}, "string, string": function (format, datatype) {return _create([], format, datatype);}, Array: function (data) {return _create(data);}, Matrix: function (data) {return _create(data, data.storage());}, "Array | Matrix, string": _create, "Array | Matrix, string, string": _create });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/abs.js
var abs_name = "abs",abs_dependencies = ["typed"];var createAbs = factory("abs", abs_dependencies, (_ref) => {var { typed } = _ref;return typed(abs_name, { number: absNumber, Complex: function (x) {return x.abs();}, BigNumber: function (x) {return x.abs();}, Fraction: function (x) {return x.abs();}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, Unit: function (x) {return x.abs();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm01.js
var algorithm01_name = "algorithm01",algorithm01_dependencies = ["typed"];var createAlgorithm01 = factory("algorithm01", algorithm01_dependencies, (_ref) => {var { typed } = _ref;return function (denseMatrix, sparseMatrix, callback, inverse) {var adata = denseMatrix._data,asize = denseMatrix._size,adt = denseMatrix._datatype,bvalues = sparseMatrix._values,bindex = sparseMatrix._index,bptr = sparseMatrix._ptr,bsize = sparseMatrix._size,bdt = sparseMatrix._datatype;if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");if (!bvalues) throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var i,j,rows = asize[0],columns = asize[1],dt = "string" == typeof adt && adt === bdt ? adt : void 0,cf = dt ? typed.find(callback, [dt, dt]) : callback,cdata = [];for (i = 0; i < rows; i++) cdata[i] = [];var x = [],w = [];for (j = 0; j < columns; j++) {for (var mark = j + 1, k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) i = bindex[k], x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]), w[i] = mark;for (i = 0; i < rows; i++) cdata[i][j] = w[i] === mark ? x[i] : adata[i][j];}return denseMatrix.createDenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm04.js
var algorithm04_name = "algorithm04",algorithm04_dependencies = ["typed", "equalScalar"];var createAlgorithm04 = factory("algorithm04", algorithm04_dependencies, (_ref) => {var { typed, equalScalar } = _ref;return function (a, b, callback) {var avalues = a._values,aindex = a._index,aptr = a._ptr,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));var i,j,k,k0,k1,cvalues = avalues && bvalues ? [] : void 0,cindex = [],cptr = [],xa = avalues && bvalues ? [] : void 0,xb = avalues && bvalues ? [] : void 0,wa = [],wb = [];for (j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) i = aindex[k], cindex.push(i), wa[i] = mark, xa && (xa[i] = avalues[k]);for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) if (i = bindex[k], wa[i] !== mark) cindex.push(i), wb[i] = mark, xb && (xb[i] = bvalues[k]);else if (xa) {var v = cf(xa[i], bvalues[k]);eq(v, zero) ? wa[i] = null : xa[i] = v;}if (xa && xb) for (k = cptr[j]; k < cindex.length;) i = cindex[k], wa[i] === mark ? (cvalues[k] = xa[i], k++) : wb[i] === mark ? (cvalues[k] = xb[i], k++) : cindex.splice(k, 1);}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm10.js
var algorithm10_name = "algorithm10",algorithm10_dependencies = ["typed", "DenseMatrix"];var createAlgorithm10 = factory("algorithm10", algorithm10_dependencies, (_ref) => {var { typed, DenseMatrix } = _ref;return function (s, b, callback, inverse) {var avalues = s._values,aindex = s._index,aptr = s._ptr,asize = s._size,adt = s._datatype;if (!avalues) throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var dt,rows = asize[0],columns = asize[1],cf = callback;"string" == typeof adt && (dt = adt, b = typed.convert(b, dt), cf = typed.find(callback, [dt, dt]));for (var mark, cdata = [], x = [], w = [], j = 0; j < columns; j++) {mark = j + 1;for (var r, k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) r = aindex[k], x[r] = avalues[k], w[r] = mark;for (var i = 0; i < rows; i++) 0 === j && (cdata[i] = []), cdata[i][j] = w[i] === mark ? inverse ? cf(b, x[i]) : cf(x[i], b) : b;}return new DenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm13.js
var algorithm13_name = "algorithm13",algorithm13_dependencies = ["typed"];var createAlgorithm13 = factory("algorithm13", algorithm13_dependencies, (_ref) => {function _iterate(f, level, s, n, av, bv) {var cv = [];if (level === s.length - 1) for (var i = 0; i < n; i++) cv[i] = f(av[i], bv[i]);else for (var j = 0; j < n; j++) cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv[j]);return cv;}var { typed } = _ref;return function (a, b, callback) {var adata = a._data,asize = a._size,adt = a._datatype,bdata = b._data,bsize = b._size,bdt = b._datatype,csize = [];if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);for (var s = 0; s < asize.length; s++) {if (asize[s] !== bsize[s]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");csize[s] = asize[s];}var dt,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, cf = typed.find(callback, [dt, dt]));var cdata = 0 < csize.length ? _iterate(cf, 0, csize, csize[0], adata, bdata) : [];return a.createDenseMatrix({ data: cdata, size: csize, datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm14.js
var algorithm14_name = "algorithm14",algorithm14_dependencies = ["typed"];var createAlgorithm14 = factory("algorithm14", algorithm14_dependencies, (_ref) => {function _iterate(f, level, s, n, av, bv, inverse) {var cv = [];if (level === s.length - 1) for (var i = 0; i < n; i++) cv[i] = inverse ? f(bv, av[i]) : f(av[i], bv);else for (var j = 0; j < n; j++) cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv, inverse);return cv;}var { typed } = _ref;return function (a, b, callback, inverse) {var dt,adata = a._data,asize = a._size,adt = a._datatype,cf = callback;"string" == typeof adt && (dt = adt, b = typed.convert(b, dt), cf = typed.find(callback, [dt, dt]));var cdata = 0 < asize.length ? _iterate(cf, 0, asize, asize[0], adata, b, inverse) : [];return a.createDenseMatrix({ data: cdata, size: clone(asize), datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/gcd.js
var gcd_name = "gcd",gcd_dependencies = ["typed", "matrix", "equalScalar", "BigNumber", "DenseMatrix"];var createGcd = factory("gcd", gcd_dependencies, (_ref) => {var { typed, matrix, equalScalar, BigNumber, DenseMatrix } = _ref,algorithm01 = createAlgorithm01({ typed }),algorithm04 = createAlgorithm04({ typed, equalScalar }),algorithm10 = createAlgorithm10({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(gcd_name, { "number, number": gcdNumber, "BigNumber, BigNumber": function (a, b) {if (!a.isInt() || !b.isInt()) throw new Error("Parameters in function gcd must be integer numbers");for (var zero = new BigNumber(0); !b.isZero();) {var r = a.mod(b);a = b, b = r;}return a.lt(zero) ? a.neg() : a;}, "Fraction, Fraction": function (x, y) {return x.gcd(y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm04(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm01(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm10(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return algorithm10(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "number | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();}, "Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber": function (a, b, args) {for (var res = this(a, b), i = 0; i < args.length; i++) res = this(res, args[i]);return res;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm02.js
var algorithm02_name = "algorithm02",algorithm02_dependencies = ["typed", "equalScalar"];var createAlgorithm02 = factory("algorithm02", algorithm02_dependencies, (_ref) => {var { typed, equalScalar } = _ref;return function (denseMatrix, sparseMatrix, callback, inverse) {var adata = denseMatrix._data,asize = denseMatrix._size,adt = denseMatrix._datatype,bvalues = sparseMatrix._values,bindex = sparseMatrix._index,bptr = sparseMatrix._ptr,bsize = sparseMatrix._size,bdt = sparseMatrix._datatype;if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");if (!bvalues) throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));for (var cvalues = [], cindex = [], cptr = [], j = 0; j < columns; j++) {cptr[j] = cindex.length;for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {var i = bindex[k],cij = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);eq(cij, zero) || (cindex.push(i), cvalues.push(cij));}}return cptr[columns] = cindex.length, sparseMatrix.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm03.js
var algorithm03_name = "algorithm03",algorithm03_dependencies = ["typed"];var createAlgorithm03 = factory("algorithm03", algorithm03_dependencies, (_ref) => {var { typed } = _ref;return function (denseMatrix, sparseMatrix, callback, inverse) {var adata = denseMatrix._data,asize = denseMatrix._size,adt = denseMatrix._datatype,bvalues = sparseMatrix._values,bindex = sparseMatrix._index,bptr = sparseMatrix._ptr,bsize = sparseMatrix._size,bdt = sparseMatrix._datatype;if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");if (!bvalues) throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var dt,rows = asize[0],columns = asize[1],zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));for (var cdata = [], z = 0; z < rows; z++) cdata[z] = [];for (var mark, x = [], w = [], j = 0; j < columns; j++) {mark = j + 1;for (var i, k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) i = bindex[k], x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]), w[i] = mark;for (var y = 0; y < rows; y++) cdata[y][j] = w[y] === mark ? x[y] : inverse ? cf(zero, adata[y][j]) : cf(adata[y][j], zero);}return denseMatrix.createDenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm05.js
var algorithm05_name = "algorithm05",algorithm05_dependencies = ["typed", "equalScalar"];var createAlgorithm05 = factory("algorithm05", algorithm05_dependencies, (_ref) => {var { typed, equalScalar } = _ref;return function (a, b, callback) {var avalues = a._values,aindex = a._index,aptr = a._ptr,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));var i,j,k,k1,cvalues = avalues && bvalues ? [] : void 0,cindex = [],cptr = [],xa = cvalues ? [] : void 0,xb = cvalues ? [] : void 0,wa = [],wb = [];for (j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;for (k = aptr[j], k1 = aptr[j + 1]; k < k1; k++) i = aindex[k], cindex.push(i), wa[i] = mark, xa && (xa[i] = avalues[k]);for (k = bptr[j], k1 = bptr[j + 1]; k < k1; k++) i = bindex[k], wa[i] !== mark && cindex.push(i), wb[i] = mark, xb && (xb[i] = bvalues[k]);if (cvalues) for (k = cptr[j]; k < cindex.length;) {i = cindex[k];var wai = wa[i],wbi = wb[i];if (wai === mark || wbi === mark) {var va = wai === mark ? xa[i] : zero,vb = wbi === mark ? xb[i] : zero,vc = cf(va, vb);eq(vc, zero) ? cindex.splice(k, 1) : (cvalues.push(vc), k++);}}}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm11.js
var algorithm11_name = "algorithm11",algorithm11_dependencies = ["typed", "equalScalar"];var createAlgorithm11 = factory("algorithm11", algorithm11_dependencies, (_ref) => {var { typed, equalScalar } = _ref;return function (s, b, callback, inverse) {var avalues = s._values,aindex = s._index,aptr = s._ptr,asize = s._size,adt = s._datatype;if (!avalues) throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), b = typed.convert(b, dt), cf = typed.find(callback, [dt, dt]));for (var cvalues = [], cindex = [], cptr = [], j = 0; j < columns; j++) {cptr[j] = cindex.length;for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {var i = aindex[k],v = inverse ? cf(b, avalues[k]) : cf(avalues[k], b);eq(v, zero) || (cindex.push(i), cvalues.push(v));}}return cptr[columns] = cindex.length, s.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm12.js
var algorithm12_name = "algorithm12",algorithm12_dependencies = ["typed", "DenseMatrix"];var createAlgorithm12 = factory("algorithm12", algorithm12_dependencies, (_ref) => {var { typed, DenseMatrix } = _ref;return function (s, b, callback, inverse) {var avalues = s._values,aindex = s._index,aptr = s._ptr,asize = s._size,adt = s._datatype;if (!avalues) throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var dt,rows = asize[0],columns = asize[1],cf = callback;"string" == typeof adt && (dt = adt, b = typed.convert(b, dt), cf = typed.find(callback, [dt, dt]));for (var mark, cdata = [], x = [], w = [], j = 0; j < columns; j++) {mark = j + 1;for (var r, k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) r = aindex[k], x[r] = avalues[k], w[r] = mark;for (var i = 0; i < rows; i++) 0 === j && (cdata[i] = []), cdata[i][j] = w[i] === mark ? inverse ? cf(b, x[i]) : cf(x[i], b) : inverse ? cf(b, 0) : cf(0, b);}return new DenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/mod.js
var mod_name = "mod",mod_dependencies = ["typed", "matrix", "equalScalar", "DenseMatrix"];var createMod = factory("mod", mod_dependencies, (_ref) => {var { typed, matrix, equalScalar, DenseMatrix } = _ref,algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm03 = createAlgorithm03({ typed }),algorithm05 = createAlgorithm05({ typed, equalScalar }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(mod_name, { "number, number": modNumber, "BigNumber, BigNumber": function (x, y) {if (y.isNeg()) throw new Error("Cannot calculate mod for a negative divisor");return y.isZero() ? x : x.mod(y);}, "Fraction, Fraction": function (x, y) {if (0 > y.compare(0)) throw new Error("Cannot calculate mod for a negative divisor");return 0 <= x.compare(0) ? x.mod(y) : x.mod(y).add(y).mod(y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm05(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm06.js
var algorithm06_name = "algorithm06",algorithm06_dependencies = ["typed", "equalScalar"];var createAlgorithm06 = factory("algorithm06", algorithm06_dependencies, (_ref) => {var { typed, equalScalar } = _ref;return function (a, b, callback) {var avalues = a._values,asize = a._size,adt = a._datatype,bvalues = b._values,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));for (var cvalues = avalues && bvalues ? [] : void 0, cindex = [], cptr = [], x = cvalues ? [] : void 0, w = [], u = [], j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;if (scatter(a, j, w, x, u, mark, cindex, cf), scatter(b, j, w, x, u, mark, cindex, cf), x) {for (var i, k = cptr[j]; k < cindex.length;) if (i = cindex[k], u[i] === mark) {var v = x[i];eq(v, zero) ? cindex.splice(k, 1) : (cvalues.push(v), k++);} else cindex.splice(k, 1);} else for (var r, p = cptr[j]; p < cindex.length;) r = cindex[p], u[r] === mark ? p++ : cindex.splice(p, 1);}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/nthRoot.js
var nthRoot_name = "nthRoot",nthRoot_dependencies = ["typed", "matrix", "equalScalar", "BigNumber"];var createNthRoot = factory("nthRoot", nthRoot_dependencies, (_ref) => {function _bigNthRoot(a, root) {var precision = _BigNumber.precision,Big = _BigNumber.clone({ precision: precision + 2 }),zero = new _BigNumber(0),one = new Big(1),inv = root.isNegative();if (inv && (root = root.neg()), root.isZero()) throw new Error("Root must be non-zero");if (a.isNegative() && !root.abs().mod(2).equals(1)) throw new Error("Root must be odd when a is negative.");if (a.isZero()) return inv ? new Big(1 / 0) : 0;if (!a.isFinite()) return inv ? zero : a;var x = a.abs().pow(one.div(root));return x = a.isNeg() ? x.neg() : x, new _BigNumber((inv ? one.div(x) : x).toPrecision(precision));}var { typed, matrix, equalScalar, BigNumber: _BigNumber } = _ref,algorithm01 = createAlgorithm01({ typed }),algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm06 = createAlgorithm06({ typed, equalScalar }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed }),complexErr = "Complex number not supported in function nthRoot. Use nthRoots instead.";return typed(nthRoot_name, { number: function (x) {return nthRootNumber(x, 2);}, "number, number": nthRootNumber, BigNumber: function (x) {return _bigNthRoot(x, new _BigNumber(2));}, Complex: function () {throw new Error(complexErr);}, "Complex, number": function () {throw new Error(complexErr);}, "BigNumber, BigNumber": _bigNthRoot, "Array | Matrix": function (x) {return this(x, 2);}, "SparseMatrix, SparseMatrix": function (x, y) {if (1 === y.density()) return algorithm06(x, y, this);throw new Error("Root must be non-zero");}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {if (1 === y.density()) return algorithm01(x, y, this, !1);throw new Error("Root must be non-zero");}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {if (1 === y.density()) return algorithm11(y, x, this, !0);throw new Error("Root must be non-zero");}, "number | BigNumber, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return this(matrix(x), y).valueOf();}, "number | BigNumber, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});var createNthRootNumber = factory("nthRoot", ["typed"], (_ref2) => {var { typed } = _ref2;return typed(nthRoot_name, { number: nthRootNumber, "number, number": nthRootNumber });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/xgcd.js
var xgcd_name = "xgcd",xgcd_dependencies = ["typed", "config", "matrix", "BigNumber"];var createXgcd = factory("xgcd", xgcd_dependencies, (_ref) => {var { typed, config, matrix, BigNumber } = _ref;return typed(xgcd_name, { "number, number": function (a, b) {var res = xgcdNumber(a, b);return "Array" === config.matrix ? res : matrix(res);}, "BigNumber, BigNumber": function (a, b) {var t,q,r,zero = new BigNumber(0),one = new BigNumber(1),x = zero,lastx = one,y = one,lasty = zero;if (!a.isInt() || !b.isInt()) throw new Error("Parameters in function xgcd must be integer numbers");for (; !b.isZero();) q = a.div(b).floor(), r = a.mod(b), t = x, x = lastx.minus(q.times(x)), lastx = t, t = y, y = lasty.minus(q.times(y)), lasty = t, a = b, b = r;var res;return res = a.lt(zero) ? [a.neg(), lastx.neg(), lasty.neg()] : [a, a.isZero() ? 0 : lastx, lasty], "Array" === config.matrix ? res : matrix(res);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/bitwise/bitAnd.js
var bitAnd_name = "bitAnd",bitAnd_dependencies = ["typed", "matrix", "equalScalar"];var createBitAnd = factory("bitAnd", bitAnd_dependencies, (_ref) => {var { typed, matrix, equalScalar } = _ref,algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm06 = createAlgorithm06({ typed, equalScalar }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(bitAnd_name, { "number, number": bitAndNumber, "BigNumber, BigNumber": bitAndBigNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm06(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm02(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm11(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm07.js
var algorithm07_name = "algorithm07",algorithm07_dependencies = ["typed", "DenseMatrix"];var createAlgorithm07 = factory("algorithm07", algorithm07_dependencies, (_ref) => {function _scatter(m, j, w, x, mark) {for (var i, values = m._values, index = m._index, ptr = m._ptr, k = ptr[j], k1 = ptr[j + 1]; k < k1; k++) i = index[k], w[i] = mark, x[i] = values[k];}var { typed, DenseMatrix } = _ref;return function (a, b, callback) {var asize = a._size,adt = a._datatype,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));var i,j,cdata = [];for (i = 0; i < rows; i++) cdata[i] = [];var xa = [],xb = [],wa = [],wb = [];for (j = 0; j < columns; j++) {var mark = j + 1;for (_scatter(a, j, wa, xa, mark), _scatter(b, j, wb, xb, mark), i = 0; i < rows; i++) {var va = wa[i] === mark ? xa[i] : zero,vb = wb[i] === mark ? xb[i] : zero;cdata[i][j] = cf(va, vb);}}return new DenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/bitwise/bitXor.js
var bitXor_name = "bitXor",bitXor_dependencies = ["typed", "matrix", "DenseMatrix"];var createBitXor = factory("bitXor", bitXor_dependencies, (_ref) => {var { typed, matrix, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(bitXor_name, { "number, number": bitXorNumber, "BigNumber, BigNumber": bitXor, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/logical/or.js
var or_name = "or",or_dependencies = ["typed", "matrix", "equalScalar", "DenseMatrix"];var createOr = factory("or", or_dependencies, (_ref) => {var { typed, matrix, equalScalar, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm05 = createAlgorithm05({ typed, equalScalar }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(or_name, { "number, number": orNumber, "Complex, Complex": function (x, y) {return 0 !== x.re || 0 !== x.im || 0 !== y.re || 0 !== y.im;}, "BigNumber, BigNumber": function (x, y) {return !x.isZero() && !x.isNaN() || !y.isZero() && !y.isNaN();}, "Unit, Unit": function (x, y) {return this(x.value || 0, y.value || 0);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm05(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/concat.js
var concat_name = "concat",concat_dependencies = ["typed", "matrix", "isInteger"];var createConcat = factory("concat", concat_dependencies, (_ref) => {var { typed, matrix, isInteger } = _ref;return typed(concat_name, { "...Array | Matrix | number | BigNumber": function (args) {var i,prevDim,len = args.length,dim = -1,asMatrix = !1,matrices = [];for (i = 0; i < len; i++) {var arg = args[i];if (isMatrix(arg) && (asMatrix = !0), isNumber(arg) || isBigNumber(arg)) {if (i !== len - 1) throw new Error("Dimension must be specified as last argument");if (prevDim = dim, dim = arg.valueOf(), !isInteger(dim)) throw new TypeError("Integer number expected for dimension");if (0 > dim || 0 < i && dim > prevDim) throw new IndexError(dim, prevDim + 1);} else {var m = clone(arg).valueOf(),size = arraySize(m);if (matrices[i] = m, prevDim = dim, dim = size.length - 1, 0 < i && dim !== prevDim) throw new DimensionError(prevDim + 1, dim + 1);}}if (0 === matrices.length) throw new SyntaxError("At least one matrix expected");for (var res = matrices.shift(); matrices.length;) res = _concat(res, matrices.shift(), dim, 0);return asMatrix ? matrix(res) : res;}, "...string": function (args) {return args.join("");} });});function _concat(a, b, concatDim, dim) {if (dim < concatDim) {if (a.length !== b.length) throw new DimensionError(a.length, b.length);for (var c = [], i = 0; i < a.length; i++) c[i] = _concat(a[i], b[i], concatDim, dim + 1);return c;}return a.concat(b);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/diag.js
var diag_name = "diag",diag_dependencies = ["typed", "matrix", "DenseMatrix", "SparseMatrix"];var createDiag = factory("diag", diag_dependencies, (_ref) => {function _diag(x, k, size, format) {if (!isInteger(k)) throw new TypeError("Second parameter in function diag must be an integer");var kSuper = 0 < k ? k : 0,kSub = 0 > k ? -k : 0;switch (size.length) {case 1:return _createDiagonalMatrix(x, k, format, size[0], kSub, kSuper);case 2:return _getDiagonal(x, k, format, size, kSub, kSuper);}throw new RangeError("Matrix for function diag must be 2 dimensional");}function _createDiagonalMatrix(x, k, format, l, kSub, kSuper) {var ms = [l + kSub, l + kSuper];if (format && "sparse" !== format && "dense" !== format) throw new TypeError("Unknown matrix type ".concat(format, "\""));var m = "sparse" === format ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix.diagonal(ms, x, k);return null === format ? m.valueOf() : m;}function _getDiagonal(x, k, format, s, kSub, kSuper) {if (isMatrix(x)) {var dm = x.diagonal(k);return null === format ? dm.valueOf() : format === dm.storage() ? dm : matrix(dm, format);}for (var n = Math.min(s[0] - kSub, s[1] - kSuper), vector = [], i = 0; i < n; i++) vector[i] = x[i + kSub][i + kSuper];return null === format ? vector : matrix(vector);}var { typed, matrix, DenseMatrix, SparseMatrix } = _ref;return typed(diag_name, { Array: function (x) {return _diag(x, 0, arraySize(x), null);}, "Array, number": function (x, k) {return _diag(x, k, arraySize(x), null);}, "Array, BigNumber": function (x, k) {return _diag(x, k.toNumber(), arraySize(x), null);}, "Array, string": function (x, format) {return _diag(x, 0, arraySize(x), format);}, "Array, number, string": function (x, k, format) {return _diag(x, k, arraySize(x), format);}, "Array, BigNumber, string": function (x, k, format) {return _diag(x, k.toNumber(), arraySize(x), format);}, Matrix: function (x) {return _diag(x, 0, x.size(), x.storage());}, "Matrix, number": function (x, k) {return _diag(x, k, x.size(), x.storage());}, "Matrix, BigNumber": function (x, k) {return _diag(x, k.toNumber(), x.size(), x.storage());}, "Matrix, string": function (x, format) {return _diag(x, 0, x.size(), format);}, "Matrix, number, string": function (x, k, format) {return _diag(x, k, x.size(), format);}, "Matrix, BigNumber, string": function (x, k, format) {return _diag(x, k.toNumber(), x.size(), format);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/identity.js
var identity_name = "identity",identity_dependencies = ["typed", "config", "matrix", "BigNumber", "DenseMatrix", "SparseMatrix"];var createIdentity = factory("identity", identity_dependencies, (_ref) => {function _identityVector(size, format) {switch (size.length) {case 0:return format ? matrix(format) : [];case 1:return _identity(size[0], size[0], format);case 2:return _identity(size[0], size[1], format);default:throw new Error("Vector containing two values expected");}}function _identity(rows, cols, format) {var Big = isBigNumber(rows) || isBigNumber(cols) ? BigNumber : null;if (isBigNumber(rows) && (rows = rows.toNumber()), isBigNumber(cols) && (cols = cols.toNumber()), !isInteger(rows) || 1 > rows) throw new Error("Parameters in function identity must be positive integers");if (!isInteger(cols) || 1 > cols) throw new Error("Parameters in function identity must be positive integers");var one = Big ? new BigNumber(1) : 1,defaultValue = Big ? new Big(0) : 0,size = [rows, cols];if (format) {if ("sparse" === format) return SparseMatrix.diagonal(size, one, 0, defaultValue);if ("dense" === format) return DenseMatrix.diagonal(size, one, 0, defaultValue);throw new TypeError("Unknown matrix type \"".concat(format, "\""));}for (var res = resize([], size, defaultValue), minimum = rows < cols ? rows : cols, d = 0; d < minimum; d++) res[d][d] = one;return res;}var { typed, config, matrix, BigNumber, DenseMatrix, SparseMatrix } = _ref;return typed(identity_name, { "": function () {return "Matrix" === config.matrix ? matrix([]) : [];}, string: function (format) {return matrix(format);}, "number | BigNumber": function (rows) {return _identity(rows, rows, "Matrix" === config.matrix ? "dense" : void 0);}, "number | BigNumber, string": function (rows, format) {return _identity(rows, rows, format);}, "number | BigNumber, number | BigNumber": function (rows, cols) {return _identity(rows, cols, "Matrix" === config.matrix ? "dense" : void 0);}, "number | BigNumber, number | BigNumber, string": function (rows, cols, format) {return _identity(rows, cols, format);}, Array: function (size) {return _identityVector(size);}, "Array, string": function (size, format) {return _identityVector(size, format);}, Matrix: function (size) {return _identityVector(size.valueOf(), size.storage());}, "Matrix, string": function (size, format) {return _identityVector(size.valueOf(), format);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/ones.js
var ones_name = "ones",ones_dependencies = ["typed", "config", "matrix", "BigNumber"];var createOnes = factory("ones", ones_dependencies, (_ref) => {function _ones(size, format) {var hasBigNumbers = _normalize(size),defaultValue = hasBigNumbers ? new BigNumber(1) : 1;if (_validate(size), format) {var m = matrix(format);return 0 < size.length ? m.resize(size, defaultValue) : m;}var arr = [];return 0 < size.length ? resize(arr, size, defaultValue) : arr;}function _normalize(size) {var hasBigNumbers = !1;return size.forEach(function (value, index, arr) {isBigNumber(value) && (hasBigNumbers = !0, arr[index] = value.toNumber());}), hasBigNumbers;}function _validate(size) {size.forEach(function (value) {if ("number" != typeof value || !isInteger(value) || 0 > value) throw new Error("Parameters in function ones must be positive integers");});}var { typed, config, matrix, BigNumber } = _ref;return typed("ones", { "": function () {return "Array" === config.matrix ? _ones([]) : _ones([], "default");}, "...number | BigNumber | string": function (size) {var last = size[size.length - 1];if ("string" == typeof last) {var format = size.pop();return _ones(size, format);}return "Array" === config.matrix ? _ones(size) : _ones(size, "default");}, Array: _ones, Matrix: function (size) {var format = size.storage();return _ones(size.valueOf(), format);}, "Array | Matrix, string": function (size, format) {return _ones(size.valueOf(), format);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/reshape.js
var reshape_name = "reshape",reshape_dependencies = ["typed", "isInteger", "matrix"];var createReshape = factory("reshape", reshape_dependencies, (_ref) => {var { typed, isInteger } = _ref;return typed(reshape_name, { "Matrix, Array": function (x, sizes) {return x.reshape(sizes);}, "Array, Array": function (x, sizes) {return sizes.forEach(function (size) {if (!isInteger(size)) throw new TypeError("Invalid size for dimension: " + size);}), reshape(x, sizes);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/noop.js
function noBignumber() {throw new Error("No \"bignumber\" implementation available");}function noFraction() {throw new Error("No \"fraction\" implementation available");}function noMatrix() {throw new Error("No \"matrix\" implementation available");}function noIndex() {throw new Error("No \"index\" implementation available");}function noSubset() {throw new Error("No \"matrix\" implementation available");}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/size.js
var size_name = "size",size_dependencies = ["typed", "config", "?matrix"];var createSize = factory("size", size_dependencies, (_ref) => {var { typed, config, matrix } = _ref;return typed(size_name, { Matrix: function (x) {return x.create(x.size());}, Array: arraySize, string: function (x) {return "Array" === config.matrix ? [x.length] : matrix([x.length]);}, "number | Complex | BigNumber | Unit | boolean | null": function () {return "Array" === config.matrix ? [] : matrix ? matrix([]) : noMatrix();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/subset.js
var subset_name = "subset",subset_dependencies = ["typed", "matrix"];var createSubset = factory("subset", subset_dependencies, (_ref) => {var { typed, matrix } = _ref;return typed(subset_name, { "Array, Index": function (value, index) {var m = matrix(value),subset = m.subset(index);return index.isScalar() ? subset : subset.valueOf();}, "Matrix, Index": function (value, index) {return value.subset(index);}, "Object, Index": _getObjectProperty, "string, Index": _getSubstring, "Array, Index, any": function (value, index, replacement) {return matrix(clone(value)).subset(index, replacement, void 0).valueOf();}, "Array, Index, any, any": function (value, index, replacement, defaultValue) {return matrix(clone(value)).subset(index, replacement, defaultValue).valueOf();}, "Matrix, Index, any": function (value, index, replacement) {return value.clone().subset(index, replacement);}, "Matrix, Index, any, any": function (value, index, replacement, defaultValue) {return value.clone().subset(index, replacement, defaultValue);}, "string, Index, string": _setSubstring, "string, Index, string, string": _setSubstring, "Object, Index, any": _setObjectProperty });});function _getSubstring(str, index) {if (!isIndex(index)) throw new TypeError("Index expected");if (1 !== index.size().length) throw new DimensionError(index.size().length, 1);var strLen = str.length;validateIndex(index.min()[0], strLen), validateIndex(index.max()[0], strLen);var range = index.dimension(0),substr = "";return range.forEach(function (v) {substr += str.charAt(v);}), substr;}function _setSubstring(str, index, replacement, defaultValue) {if (!index || !0 !== index.isIndex) throw new TypeError("Index expected");if (1 !== index.size().length) throw new DimensionError(index.size().length, 1);if (void 0 === defaultValue) defaultValue = " ";else if ("string" != typeof defaultValue || 1 !== defaultValue.length) throw new TypeError("Single character expected as defaultValue");var range = index.dimension(0),len = range.size()[0];if (len !== replacement.length) throw new DimensionError(range.size()[0], replacement.length);var strLen = str.length;validateIndex(index.min()[0]), validateIndex(index.max()[0]);for (var chars = [], i = 0; i < strLen; i++) chars[i] = str.charAt(i);if (range.forEach(function (v, i) {chars[v] = replacement.charAt(i[0]);}), chars.length > strLen) for (var _i = strLen - 1, _len = chars.length; _i < _len; _i++) chars[_i] || (chars[_i] = defaultValue);return chars.join("");}function _getObjectProperty(object, index) {if (1 !== index.size().length) throw new DimensionError(index.size(), 1);var key = index.dimension(0);if ("string" != typeof key) throw new TypeError("String expected as index to retrieve an object property");return getSafeProperty(object, key);}function _setObjectProperty(object, index, replacement) {if (1 !== index.size().length) throw new DimensionError(index.size(), 1);var key = index.dimension(0);if ("string" != typeof key) throw new TypeError("String expected as index to retrieve an object property");var updated = clone(object);return setSafeProperty(updated, key, replacement), updated;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/zeros.js
var zeros_name = "zeros",zeros_dependencies = ["typed", "config", "matrix", "BigNumber"];var createZeros = factory("zeros", zeros_dependencies, (_ref) => {function _zeros(size, format) {var hasBigNumbers = _normalize(size),defaultValue = hasBigNumbers ? new BigNumber(0) : 0;if (_validate(size), format) {var m = matrix(format);return 0 < size.length ? m.resize(size, defaultValue) : m;}var arr = [];return 0 < size.length ? resize(arr, size, defaultValue) : arr;}function _normalize(size) {var hasBigNumbers = !1;return size.forEach(function (value, index, arr) {isBigNumber(value) && (hasBigNumbers = !0, arr[index] = value.toNumber());}), hasBigNumbers;}function _validate(size) {size.forEach(function (value) {if ("number" != typeof value || !isInteger(value) || 0 > value) throw new Error("Parameters in function zeros must be positive integers");});}var { typed, config, matrix, BigNumber } = _ref;return typed(zeros_name, { "": function () {return "Array" === config.matrix ? _zeros([]) : _zeros([], "default");}, "...number | BigNumber | string": function (size) {var last = size[size.length - 1];if ("string" == typeof last) {var format = size.pop();return _zeros(size, format);}return "Array" === config.matrix ? _zeros(size) : _zeros(size, "default");}, Array: _zeros, Matrix: function (size) {var format = size.storage();return _zeros(size.valueOf(), format);}, "Array | Matrix, string": function (size, format) {return _zeros(size.valueOf(), format);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/string/hex.js
var hex_name = "hex",hex_dependencies = ["typed", "format"];var createHex = factory("hex", hex_dependencies, (_ref) => {var { typed, format } = _ref;return typed(hex_name, { "number | BigNumber": function (n) {return format(n, { notation: "hex" });}, "number | BigNumber, number": function (n, wordSize) {return format(n, { notation: "hex", wordSize: wordSize });} });});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/round.js
function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);enumerableOnly && (symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;})), keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var source, i = 1; i < arguments.length; i++) source = null == arguments[i] ? {} : arguments[i], i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {defineProperty(target, key, source[key]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});return target;}var NO_INT = "Number of decimals in function round must be an integer",round_name = "round",round_dependencies = ["typed", "matrix", "equalScalar", "zeros", "BigNumber", "DenseMatrix"];var createRound = factory(round_name, round_dependencies, (_ref) => {var { typed, matrix, equalScalar, zeros, BigNumber, DenseMatrix } = _ref,algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm14 = createAlgorithm14({ typed });return typed(round_name, _objectSpread(_objectSpread({}, roundNumberSignatures), {}, { Complex: function (x) {return x.round();}, "Complex, number": function (x, n) {if (n % 1) throw new TypeError(NO_INT);return x.round(n);}, "Complex, BigNumber": function (x, n) {if (!n.isInteger()) throw new TypeError(NO_INT);var _n = n.toNumber();return x.round(_n);}, "number, BigNumber": function (x, n) {if (!n.isInteger()) throw new TypeError(NO_INT);return new BigNumber(x).toDecimalPlaces(n.toNumber());}, BigNumber: function (x) {return x.toDecimalPlaces(0);}, "BigNumber, BigNumber": function (x, n) {if (!n.isInteger()) throw new TypeError(NO_INT);return x.toDecimalPlaces(n.toNumber());}, Fraction: function (x) {return x.round();}, "Fraction, number": function (x, n) {if (n % 1) throw new TypeError(NO_INT);return x.round(n);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | Complex | BigNumber, SparseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm12(y, x, this, !0);}, "number | Complex | BigNumber, DenseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "number | Complex | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} }));});var roundNumberSignatures = { number: roundNumber, "number, number": function (x, n) {if (!isInteger(n)) throw new TypeError(NO_INT);if (0 > n || 15 < n) throw new Error("Number of decimals in function round must be in the range of 0-15");return roundNumber(x, n);} };var createRoundNumber = factory(round_name, ["typed"], (_ref2) => {var { typed } = _ref2;return typed(round_name, roundNumberSignatures);});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm08.js
var algorithm08_name = "algorithm08",algorithm08_dependencies = ["typed", "equalScalar"];var createAlgorithm08 = factory("algorithm08", algorithm08_dependencies, (_ref) => {var { typed, equalScalar } = _ref;return function (a, b, callback) {var avalues = a._values,aindex = a._index,aptr = a._ptr,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");if (!avalues || !bvalues) throw new Error("Cannot perform operation on Pattern Sparse Matrices");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));for (var k, k0, k1, i, cvalues = [], cindex = [], cptr = [], x = [], w = [], j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) i = aindex[k], w[i] = mark, x[i] = avalues[k], cindex.push(i);for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) i = bindex[k], w[i] === mark && (x[i] = cf(x[i], bvalues[k]));for (k = cptr[j]; k < cindex.length;) {i = cindex[k];var v = x[i];eq(v, zero) ? cindex.splice(k, 1) : (cvalues.push(v), k++);}}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/bitwise/leftShift.js
var leftShift_name = "leftShift",leftShift_dependencies = ["typed", "matrix", "equalScalar", "zeros", "DenseMatrix"];var createLeftShift = factory("leftShift", leftShift_dependencies, (_ref) => {var { typed, matrix, equalScalar, zeros, DenseMatrix } = _ref,algorithm01 = createAlgorithm01({ typed }),algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm08 = createAlgorithm08({ typed, equalScalar }),algorithm10 = createAlgorithm10({ typed, DenseMatrix }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(leftShift_name, { "number, number": leftShiftNumber, "BigNumber, BigNumber": leftShiftBigNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm08(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm10(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return this(matrix(x), y).valueOf();}, "number | BigNumber, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/bitwise/rightLogShift.js
var rightLogShift_name = "rightLogShift",rightLogShift_dependencies = ["typed", "matrix", "equalScalar", "zeros", "DenseMatrix"];var createRightLogShift = factory("rightLogShift", rightLogShift_dependencies, (_ref) => {var { typed, matrix, equalScalar, zeros, DenseMatrix } = _ref,algorithm01 = createAlgorithm01({ typed }),algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm08 = createAlgorithm08({ typed, equalScalar }),algorithm10 = createAlgorithm10({ typed, DenseMatrix }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(rightLogShift_name, { "number, number": rightLogShiftNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm08(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm10(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return this(matrix(x), y).valueOf();}, "number | BigNumber, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/compare.js
var compare_name = "compare",compare_dependencies = ["typed", "config", "matrix", "equalScalar", "BigNumber", "Fraction", "DenseMatrix"];var createCompare = factory("compare", compare_dependencies, (_ref) => {var { typed, config, equalScalar, matrix, BigNumber, Fraction, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm05 = createAlgorithm05({ typed, equalScalar }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(compare_name, { "boolean, boolean": function (x, y) {return x === y ? 0 : x > y ? 1 : -1;}, "number, number": function (x, y) {return nearlyEqual(x, y, config.epsilon) ? 0 : x > y ? 1 : -1;}, "BigNumber, BigNumber": function (x, y) {return nearlyEqual_nearlyEqual(x, y, config.epsilon) ? new BigNumber(0) : new BigNumber(x.cmp(y));}, "Fraction, Fraction": function (x, y) {return new Fraction(x.compare(y));}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm05(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});var createCompareNumber = factory("compare", ["typed", "config"], (_ref2) => {var { typed, config } = _ref2;return typed(compare_name, { "number, number": function (x, y) {return nearlyEqual(x, y, config.epsilon) ? 0 : x > y ? 1 : -1;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/compareText.js
var compareText_name = "compareText",compareText_dependencies = ["typed", "matrix"];var createCompareText = factory("compareText", compareText_dependencies, (_ref) => {var { typed, matrix } = _ref,algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(compareText_name, { "any, any": compareText, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, compareText);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, compareText, !1);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, compareText, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, compareText, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, compareText, !0).valueOf();} });});var createCompareTextNumber = factory("compareText", ["typed"], (_ref2) => {var { typed } = _ref2;return typed(compareText_name, { "any, any": compareText });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/smaller.js
var smaller_name = "smaller",smaller_dependencies = ["typed", "config", "matrix", "DenseMatrix"];var createSmaller = factory("smaller", smaller_dependencies, (_ref) => {var { typed, config, matrix, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(smaller_name, { "boolean, boolean": function (x, y) {return x < y;}, "number, number": function (x, y) {return x < y && !nearlyEqual(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.lt(y) && !nearlyEqual_nearlyEqual(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return -1 === x.compare(y);}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});var createSmallerNumber = factory("smaller", ["typed", "config"], (_ref2) => {var { typed, config } = _ref2;return typed(smaller_name, { "number, number": function (x, y) {return x < y && !nearlyEqual(x, y, config.epsilon);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/larger.js
var larger_name = "larger",larger_dependencies = ["typed", "config", "matrix", "DenseMatrix"];var createLarger = factory("larger", larger_dependencies, (_ref) => {var { typed, config, matrix, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(larger_name, { "boolean, boolean": function (x, y) {return x > y;}, "number, number": function (x, y) {return x > y && !nearlyEqual(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.gt(y) && !nearlyEqual_nearlyEqual(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return 1 === x.compare(y);}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});var createLargerNumber = factory("larger", ["typed", "config"], (_ref2) => {var { typed, config } = _ref2;return typed(larger_name, { "number, number": function (x, y) {return x > y && !nearlyEqual(x, y, config.epsilon);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/unequal.js
var unequal_name = "unequal",unequal_dependencies = ["typed", "config", "equalScalar", "matrix", "DenseMatrix"];var createUnequal = factory("unequal", unequal_dependencies, (_ref) => {function _unequal(x, y) {return !equalScalar(x, y);}var { typed, config, equalScalar, matrix, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed("unequal", { "any, any": function (x, y) {return null === x ? null !== y : null === y ? null !== x : void 0 === x ? void 0 !== y : void 0 === y ? void 0 !== x : _unequal(x, y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, _unequal);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, _unequal, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, _unequal, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, _unequal);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, _unequal, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, _unequal, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, _unequal, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, _unequal, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, _unequal, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, _unequal, !0).valueOf();} });});var createUnequalNumber = factory("unequal", ["typed", "equalScalar"], (_ref2) => {var { typed, equalScalar } = _ref2;return typed(unequal_name, { "any, any": function (x, y) {return null === x ? null !== y : null === y ? null !== x : void 0 === x ? void 0 !== y : void 0 === y ? void 0 !== x : !equalScalar(x, y);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/ImmutableDenseMatrix.js
var ImmutableDenseMatrix_name = "ImmutableDenseMatrix",ImmutableDenseMatrix_dependencies = ["smaller", "DenseMatrix"];var createImmutableDenseMatrixClass = factory("ImmutableDenseMatrix", ImmutableDenseMatrix_dependencies, (_ref) => {function ImmutableDenseMatrix(data, datatype) {if (!(this instanceof ImmutableDenseMatrix)) throw new SyntaxError("Constructor must be called with the new operator");if (datatype && !isString(datatype)) throw new Error("Invalid datatype: " + datatype);if (isMatrix(data) || isArray(data)) {var matrix = new DenseMatrix(data, datatype);this._data = matrix._data, this._size = matrix._size, this._datatype = matrix._datatype, this._min = null, this._max = null;} else if (data && isArray(data.data) && isArray(data.size)) this._data = data.data, this._size = data.size, this._datatype = data.datatype, this._min = "undefined" == typeof data.min ? null : data.min, this._max = "undefined" == typeof data.max ? null : data.max;else if (data) throw new TypeError("Unsupported type of data (" + typeOf(data) + ")");else this._data = [], this._size = [0], this._datatype = datatype, this._min = null, this._max = null;}var { smaller, DenseMatrix } = _ref;return ImmutableDenseMatrix.prototype = new DenseMatrix(), ImmutableDenseMatrix.prototype.type = "ImmutableDenseMatrix", ImmutableDenseMatrix.prototype.isImmutableDenseMatrix = !0, ImmutableDenseMatrix.prototype.subset = function (index) {switch (arguments.length) {case 1:{var m = DenseMatrix.prototype.subset.call(this, index);return isMatrix(m) ? new ImmutableDenseMatrix({ data: m._data, size: m._size, datatype: m._datatype }) : m;}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments");}}, ImmutableDenseMatrix.prototype.set = function () {throw new Error("Cannot invoke set on an Immutable Matrix instance");}, ImmutableDenseMatrix.prototype.resize = function () {throw new Error("Cannot invoke resize on an Immutable Matrix instance");}, ImmutableDenseMatrix.prototype.reshape = function () {throw new Error("Cannot invoke reshape on an Immutable Matrix instance");}, ImmutableDenseMatrix.prototype.clone = function () {return new ImmutableDenseMatrix({ data: clone(this._data), size: clone(this._size), datatype: this._datatype });}, ImmutableDenseMatrix.prototype.toJSON = function () {return { mathjs: "ImmutableDenseMatrix", data: this._data, size: this._size, datatype: this._datatype };}, ImmutableDenseMatrix.fromJSON = function (json) {return new ImmutableDenseMatrix(json);}, ImmutableDenseMatrix.prototype.swapRows = function () {throw new Error("Cannot invoke swapRows on an Immutable Matrix instance");}, ImmutableDenseMatrix.prototype.min = function () {if (null === this._min) {var m = null;this.forEach(function (v) {(null === m || smaller(v, m)) && (m = v);}), this._min = null === m ? void 0 : m;}return this._min;}, ImmutableDenseMatrix.prototype.max = function () {if (null === this._max) {var m = null;this.forEach(function (v) {(null === m || smaller(m, v)) && (m = v);}), this._max = null === m ? void 0 : m;}return this._max;}, ImmutableDenseMatrix;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/FibonacciHeap.js
var FibonacciHeap_name = "FibonacciHeap",FibonacciHeap_dependencies = ["smaller", "larger"];var createFibonacciHeapClass = factory("FibonacciHeap", FibonacciHeap_dependencies, (_ref) => {function FibonacciHeap() {if (!(this instanceof FibonacciHeap)) throw new SyntaxError("Constructor must be called with the new operator");this._minimum = null, this._size = 0;}function _decreaseKey(minimum, node, key) {node.key = key;var parent = node.parent;return parent && smaller(node.key, parent.key) && (_cut(minimum, node, parent), _cascadingCut(minimum, parent)), smaller(node.key, minimum.key) && (minimum = node), minimum;}function _cut(minimum, node, parent) {node.left.right = node.right, node.right.left = node.left, parent.degree--, parent.child === node && (parent.child = node.right), 0 === parent.degree && (parent.child = null), node.left = minimum, node.right = minimum.right, minimum.right = node, node.right.left = node, node.parent = null, node.mark = !1;}function _cascadingCut(minimum, node) {var parent = node.parent;parent && (node.mark ? (_cut(minimum, node, parent), _cascadingCut(parent)) : node.mark = !0);}function _findMinimumNode(minimum, size) {var arraySize = Math.floor(Math.log(size) * oneOverLogPhi) + 1,array = Array(arraySize),numRoots = 0,x = minimum;if (x) for (numRoots++, x = x.right; x !== minimum;) numRoots++, x = x.right;for (var y; 0 < numRoots;) {for (var d = x.degree, next = x.right; y = array[d], !!y;) {if (larger(x.key, y.key)) {var temp = y;y = x, x = temp;}_linkNodes(y, x), array[d] = null, d++;}array[d] = x, x = next, numRoots--;}minimum = null;for (var i = 0; i < arraySize; i++) (y = array[i], !!y) && (minimum ? (y.left.right = y.right, y.right.left = y.left, y.left = minimum, y.right = minimum.right, minimum.right = y, y.right.left = y, smaller(y.key, minimum.key) && (minimum = y)) : minimum = y);return minimum;}var { smaller, larger } = _ref,oneOverLogPhi = 1 / Math.log((1 + Math.sqrt(5)) / 2);FibonacciHeap.prototype.type = "FibonacciHeap", FibonacciHeap.prototype.isFibonacciHeap = !0, FibonacciHeap.prototype.insert = function (key, value) {var node = { key: key, value: value, degree: 0 };if (this._minimum) {var minimum = this._minimum;node.left = minimum, node.right = minimum.right, minimum.right = node, node.right.left = node, smaller(key, minimum.key) && (this._minimum = node);} else node.left = node, node.right = node, this._minimum = node;return this._size++, node;}, FibonacciHeap.prototype.size = function () {return this._size;}, FibonacciHeap.prototype.clear = function () {this._minimum = null, this._size = 0;}, FibonacciHeap.prototype.isEmpty = function () {return 0 === this._size;}, FibonacciHeap.prototype.extractMinimum = function () {var node = this._minimum;if (null === node) return node;for (var tempRight, minimum = this._minimum, numberOfChildren = node.degree, x = node.child; 0 < numberOfChildren;) tempRight = x.right, x.left.right = x.right, x.right.left = x.left, x.left = minimum, x.right = minimum.right, minimum.right = x, x.right.left = x, x.parent = null, x = tempRight, numberOfChildren--;return node.left.right = node.right, node.right.left = node.left, node === node.right ? minimum = null : (minimum = node.right, minimum = _findMinimumNode(minimum, this._size)), this._size--, this._minimum = minimum, node;}, FibonacciHeap.prototype.remove = function (node) {this._minimum = _decreaseKey(this._minimum, node, -1), this.extractMinimum();};var _linkNodes = function (node, parent) {node.left.right = node.right, node.right.left = node.left, node.parent = parent, parent.child ? (node.left = parent.child, node.right = parent.child.right, parent.child.right = node, node.right.left = node) : (parent.child = node, node.right = node, node.left = node), parent.degree++, node.mark = !1;};return FibonacciHeap;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/function/sparse.js
var sparse_name = "sparse",sparse_dependencies = ["typed", "SparseMatrix"];var createSparse = factory("sparse", sparse_dependencies, (_ref) => {var { typed, SparseMatrix } = _ref;return typed(sparse_name, { "": function () {return new SparseMatrix([]);}, string: function (datatype) {return new SparseMatrix([], datatype);}, "Array | Matrix": function (data) {return new SparseMatrix(data);}, "Array | Matrix, string": function (data, datatype) {return new SparseMatrix(data, datatype);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/acoth.js
var acoth_name = "acoth",acoth_dependencies = ["typed", "config", "Complex", "BigNumber"];var createAcoth = factory("acoth", acoth_dependencies, (_ref) => {var { typed, config, Complex, BigNumber: _BigNumber } = _ref;return typed(acoth_name, { number: function (x) {return 1 <= x || -1 >= x || config.predictable ? acothNumber(x) : new Complex(x, 0).acoth();}, Complex: function (x) {return x.acoth();}, BigNumber: function (x) {return new _BigNumber(1).div(x).atanh();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/utils/algorithm09.js
var algorithm09_name = "algorithm09",algorithm09_dependencies = ["typed", "equalScalar"];var createAlgorithm09 = factory("algorithm09", algorithm09_dependencies, (_ref) => {var { typed, equalScalar } = _ref;return function (a, b, callback) {var avalues = a._values,aindex = a._index,aptr = a._ptr,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));var i,j,k,k0,k1,cvalues = avalues && bvalues ? [] : void 0,cindex = [],cptr = [],x = cvalues ? [] : void 0,w = [];for (j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;if (x) for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) i = bindex[k], w[i] = mark, x[i] = bvalues[k];for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) if (i = aindex[k], x) {var vb = w[i] === mark ? x[i] : zero,vc = cf(avalues[k], vb);eq(vc, zero) || (cindex.push(i), cvalues.push(vc));} else cindex.push(i);}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/atan2.js
var atan2_name = "atan2",atan2_dependencies = ["typed", "matrix", "equalScalar", "BigNumber", "DenseMatrix"];var createAtan2 = factory("atan2", atan2_dependencies, (_ref) => {var { typed, matrix, equalScalar, BigNumber, DenseMatrix } = _ref,algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm03 = createAlgorithm03({ typed }),algorithm09 = createAlgorithm09({ typed, equalScalar }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(atan2_name, { "number, number": Math.atan2, "BigNumber, BigNumber": function (y, x) {return BigNumber.atan2(y, x);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm09(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "number | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/sec.js
var sec_name = "sec",sec_dependencies = ["typed", "BigNumber"];var createSec = factory("sec", sec_dependencies, (_ref) => {var { typed, BigNumber: _BigNumber } = _ref;return typed(sec_name, { number: secNumber, Complex: function (x) {return x.sec();}, BigNumber: function (x) {return new _BigNumber(1).div(x.cos());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function sec is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/add.js
var add_name = "add",add_dependencies = ["typed", "matrix", "addScalar", "equalScalar", "DenseMatrix", "SparseMatrix"];var createAdd = factory("add", add_dependencies, (_ref) => {var { typed, matrix, addScalar, equalScalar, DenseMatrix, SparseMatrix } = _ref,algorithm01 = createAlgorithm01({ typed }),algorithm04 = createAlgorithm04({ typed, equalScalar }),algorithm10 = createAlgorithm10({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(add_name, extend({ "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, addScalar);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, addScalar, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm01(y, x, addScalar, !0);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm04(x, y, addScalar);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, addScalar, !1);}, "SparseMatrix, any": function (x, y) {return algorithm10(x, y, addScalar, !1);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, addScalar, !0);}, "any, SparseMatrix": function (x, y) {return algorithm10(y, x, addScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, addScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, addScalar, !0).valueOf();}, "any, any": addScalar, "any, any, ...any": function (x, y, rest) {for (var result = this(x, y), i = 0; i < rest.length; i++) result = this(result, rest[i]);return result;} }, addScalar.signatures));});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/dot.js
var dot_name = "dot",dot_dependencies = ["typed", "addScalar", "multiplyScalar", "conj", "size"];var createDot = factory("dot", dot_dependencies, (_ref) => {function _validateDim(x, y) {var xLen,yLen,xSize = _size(x),ySize = _size(y);if (1 === xSize.length) xLen = xSize[0];else if (2 === xSize.length && 1 === xSize[1]) xLen = xSize[0];else throw new RangeError("Expected a column vector, instead got a matrix of size (" + xSize.join(", ") + ")");if (1 === ySize.length) yLen = ySize[0];else if (2 === ySize.length && 1 === ySize[1]) yLen = ySize[0];else throw new RangeError("Expected a column vector, instead got a matrix of size (" + ySize.join(", ") + ")");if (xLen !== yLen) throw new RangeError("Vectors must have equal length (" + xLen + " != " + yLen + ")");if (0 === xLen) throw new RangeError("Cannot calculate the dot product of empty vectors");return xLen;}function _size(x) {return isMatrix(x) ? x.size() : size(x);}var { typed, addScalar, multiplyScalar, conj, size } = _ref;return typed(dot_name, { "Array | DenseMatrix, Array | DenseMatrix": function (a, b) {var N = _validateDim(a, b),adata = isMatrix(a) ? a._data : a,adt = isMatrix(a) ? a._datatype : void 0,bdata = isMatrix(b) ? b._data : b,bdt = isMatrix(b) ? b._datatype : void 0,aIsColumn = 2 === _size(a).length,bIsColumn = 2 === _size(b).length,add = addScalar,mul = multiplyScalar;if (adt && bdt && adt === bdt && "string" == typeof adt) {var dt = adt;add = typed.find(addScalar, [dt, dt]), mul = typed.find(multiplyScalar, [dt, dt]);}if (!aIsColumn && !bIsColumn) {for (var c = mul(conj(adata[0]), bdata[0]), i = 1; i < N; i++) c = add(c, mul(conj(adata[i]), bdata[i]));return c;}if (!aIsColumn && bIsColumn) {for (var _c = mul(conj(adata[0]), bdata[0][0]), _i = 1; _i < N; _i++) _c = add(_c, mul(conj(adata[_i]), bdata[_i][0]));return _c;}if (aIsColumn && !bIsColumn) {for (var _c2 = mul(conj(adata[0][0]), bdata[0]), _i2 = 1; _i2 < N; _i2++) _c2 = add(_c2, mul(conj(adata[_i2][0]), bdata[_i2]));return _c2;}if (aIsColumn && bIsColumn) {for (var _c3 = mul(conj(adata[0][0]), bdata[0][0]), _i3 = 1; _i3 < N; _i3++) _c3 = add(_c3, mul(conj(adata[_i3][0]), bdata[_i3][0]));return _c3;}}, "SparseMatrix, SparseMatrix": function (x, y) {_validateDim(x, y);for (var xindex = x._index, xvalues = x._values, yindex = y._index, yvalues = y._values, c = 0, i = 0, j = 0; i < xindex.length && j < yindex.length;) {var I = xindex[i],J = yindex[j];if (I < J) {i++;continue;}if (I > J) {j++;continue;}I === J && (c = addScalar(c, multiplyScalar(xvalues[i], yvalues[j])), i++, j++);}return c;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/combinatorics/composition.js
var composition_name = "composition",composition_dependencies = ["typed", "addScalar", "combinations", "isNegative", "isPositive", "isInteger", "larger"];var createComposition = factory("composition", composition_dependencies, (_ref) => {var { typed, addScalar, combinations, isPositive, isNegative, isInteger, larger } = _ref;return typed(composition_name, { "number | BigNumber, number | BigNumber": function (n, k) {if (!isInteger(n) || !isPositive(n) || !isInteger(k) || !isPositive(k)) throw new TypeError("Positive integer value expected in function composition");else if (larger(k, n)) throw new TypeError("k must be less than or equal to n in function composition");return combinations(addScalar(n, -1), addScalar(k, -1));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/isZero.js
var isZero_name = "isZero",isZero_dependencies = ["typed"];var createIsZero = factory("isZero", isZero_dependencies, (_ref) => {var { typed } = _ref;return typed(isZero_name, { number: isZeroNumber, BigNumber: function (x) {return x.isZero();}, Complex: function (x) {return 0 === x.re && 0 === x.im;}, Fraction: function (x) {return 1 === x.d && 0 === x.n;}, Unit: function (x) {return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/matrixFromFunction.js
var matrixFromFunction_name = "matrixFromFunction",matrixFromFunction_dependencies = ["typed", "matrix", "isZero"];var createMatrixFromFunction = factory("matrixFromFunction", matrixFromFunction_dependencies, (_ref) => {function _create(size, fn, format, datatype) {var m;return m = void 0 === datatype ? matrix(format) : matrix(format, datatype), m.resize(size), m.forEach(function (_, index) {var val = fn(index);isZero(val) || m.set(index, val);}), m;}var { typed, matrix, isZero } = _ref;return typed(matrixFromFunction_name, { "Array | Matrix, function, string, string": function (size, fn, format, datatype) {return _create(size, fn, format, datatype);}, "Array | Matrix, function, string": function (size, fn, format) {return _create(size, fn, format);}, "Matrix, function": function (size, fn) {return _create(size, fn, "dense");}, "Array, function": function (size, fn) {return _create(size, fn, "dense").toArray();}, "Array | Matrix, string, function": function (size, format, fn) {return _create(size, fn, format);}, "Array | Matrix, string, string, function": function (size, format, datatype, fn) {return _create(size, fn, format, datatype);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/cbrt.js
var cbrt_name = "cbrt",cbrt_dependencies = ["config", "typed", "isNegative", "unaryMinus", "matrix", "Complex", "BigNumber", "Fraction"];var createCbrt = factory("cbrt", cbrt_dependencies, (_ref) => {function _cbrtComplex(x, allRoots) {var arg3 = x.arg() / 3,abs = x.abs(),principal = new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3).exp());if (allRoots) {var all = [principal, new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 + 2 * Math.PI / 3).exp()), new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 - 2 * Math.PI / 3).exp())];return "Array" === config.matrix ? all : matrix(all);}return principal;}var { config, typed, isNegative, unaryMinus, matrix, Complex, BigNumber, Fraction } = _ref;return typed(cbrt_name, { number: cbrtNumber, Complex: _cbrtComplex, "Complex, boolean": _cbrtComplex, BigNumber: function (x) {return x.cbrt();}, Unit: function (x) {if (x.value && isComplex(x.value)) {var result = x.clone();return result.value = 1, result = result.pow(1 / 3), result.value = _cbrtComplex(x.value), result;}var negate = isNegative(x.value);negate && (x.value = unaryMinus(x.value));var third = isBigNumber(x.value) ? new BigNumber(1).div(3) : isFraction(x.value) ? new Fraction(1, 3) : 1 / 3;var _result = x.pow(third);return negate && (_result.value = unaryMinus(_result.value)), _result;}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/floor.js
var floor_name = "floor",floor_dependencies = ["typed", "config", "round", "matrix", "equalScalar"];var createFloor = factory("floor", floor_dependencies, (_ref) => {var { typed, config, round, matrix, equalScalar } = _ref,algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm14 = createAlgorithm14({ typed });return typed("floor", { number: function (x) {return nearlyEqual(x, round(x), config.epsilon) ? round(x) : Math.floor(x);}, "number, number": function (x, n) {if (nearlyEqual(x, round(x, n), config.epsilon)) return round(x, n);var [number, exponent] = "".concat(x, "e").split("e"),result = Math.floor(+"".concat(number, "e").concat(+exponent + n));return [number, exponent] = "".concat(result, "e").split("e"), +"".concat(number, "e").concat(+exponent - n);}, Complex: function (x) {return x.floor();}, "Complex, number": function (x, n) {return x.floor(n);}, BigNumber: function (x) {return nearlyEqual_nearlyEqual(x, round(x), config.epsilon) ? round(x) : x.floor();}, "BigNumber, BigNumber": function (x, n) {return nearlyEqual_nearlyEqual(x, round(x, n), config.epsilon) ? round(x, n) : x.toDecimalPlaces(n.toNumber(), decimal["default"].ROUND_FLOOR);}, Fraction: function (x) {return x.floor();}, "Fraction, number": function (x, n) {return x.floor(n);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, "Array | Matrix, number": function (x, n) {return deepMap(x, (i) => this(i, n), !0);}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | Complex | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/multiply.js
var multiply_name = "multiply",multiply_dependencies = ["typed", "matrix", "addScalar", "multiplyScalar", "equalScalar", "dot"];var createMultiply = factory("multiply", multiply_dependencies, (_ref) => {function _validateMatrixDimensions(size1, size2) {switch (size1.length) {case 1:switch (size2.length) {case 1:if (size1[0] !== size2[0]) throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if (size1[0] !== size2[0]) throw new RangeError("Dimension mismatch in multiplication. Vector length (" + size1[0] + ") must match Matrix rows (" + size2[0] + ")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has " + size2.length + " dimensions)");}break;case 2:switch (size2.length) {case 1:if (size1[1] !== size2[0]) throw new RangeError("Dimension mismatch in multiplication. Matrix columns (" + size1[1] + ") must match Vector length (" + size2[0] + ")");break;case 2:if (size1[1] !== size2[0]) throw new RangeError("Dimension mismatch in multiplication. Matrix A columns (" + size1[1] + ") must match Matrix B rows (" + size2[0] + ")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has " + size2.length + " dimensions)");}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has " + size1.length + " dimensions)");}}function _multiplyVectorVector(a, b, n) {if (0 === n) throw new Error("Cannot multiply two empty vectors");return dot(a, b);}function _multiplyVectorMatrix(a, b) {if ("dense" !== b.storage()) throw new Error("Support for SparseMatrix not implemented");return _multiplyVectorDenseMatrix(a, b);}function _multiplyVectorDenseMatrix(a, b) {var dt,adata = a._data,asize = a._size,adt = a._datatype,bdata = b._data,bsize = b._size,bdt = b._datatype,alength = asize[0],bcolumns = bsize[1],af = addScalar,mf = multiplyScalar;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]));for (var sum, c = [], j = 0; j < bcolumns; j++) {sum = mf(adata[0], bdata[0][j]);for (var i = 1; i < alength; i++) sum = af(sum, mf(adata[i], bdata[i][j]));c[j] = sum;}return a.createDenseMatrix({ data: c, size: [bcolumns], datatype: dt });}var { typed, matrix, addScalar, multiplyScalar, equalScalar, dot } = _ref,algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm14 = createAlgorithm14({ typed }),_multiplyMatrixVector = typed("_multiplyMatrixVector", { "DenseMatrix, any": function (a, b) {var dt,adata = a._data,asize = a._size,adt = a._datatype,bdata = b._data,bdt = b._datatype,arows = asize[0],acolumns = asize[1],af = addScalar,mf = multiplyScalar;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]));for (var c = [], i = 0; i < arows; i++) {for (var row = adata[i], sum = mf(row[0], bdata[0]), j = 1; j < acolumns; j++) sum = af(sum, mf(row[j], bdata[j]));c[i] = sum;}return a.createDenseMatrix({ data: c, size: [arows], datatype: dt });}, "SparseMatrix, any": function (a, b) {var avalues = a._values,aindex = a._index,aptr = a._ptr,adt = a._datatype;if (!avalues) throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var dt,bdata = b._data,bdt = b._datatype,arows = a._size[0],brows = b._size[0],cvalues = [],cindex = [],cptr = [],af = addScalar,mf = multiplyScalar,eq = equalScalar,zero = 0;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]), eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt));var x = [],w = [];cptr[0] = 0;for (var vbi, ib = 0; ib < brows; ib++) if (vbi = bdata[ib], !eq(vbi, zero)) for (var ia, ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) ia = aindex[ka], w[ia] ? x[ia] = af(x[ia], mf(vbi, avalues[ka])) : (w[ia] = !0, cindex.push(ia), x[ia] = mf(vbi, avalues[ka]));for (var ic, p1 = cindex.length, p = 0; p < p1; p++) ic = cindex[p], cvalues[p] = x[ic];return cptr[1] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [arows, 1], datatype: dt });} }),_multiplyMatrixMatrix = typed("_multiplyMatrixMatrix", { "DenseMatrix, DenseMatrix": function (a, b) {var dt,adata = a._data,asize = a._size,adt = a._datatype,bdata = b._data,bsize = b._size,bdt = b._datatype,arows = asize[0],acolumns = asize[1],bcolumns = bsize[1],af = addScalar,mf = multiplyScalar;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]));for (var row, c = [], i = 0; i < arows; i++) {row = adata[i], c[i] = [];for (var sum, j = 0; j < bcolumns; j++) {sum = mf(row[0], bdata[0][j]);for (var x = 1; x < acolumns; x++) sum = af(sum, mf(row[x], bdata[x][j]));c[i][j] = sum;}}return a.createDenseMatrix({ data: c, size: [arows, bcolumns], datatype: dt });}, "DenseMatrix, SparseMatrix": function (a, b) {var adata = a._data,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (!bvalues) throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var dt,arows = asize[0],bcolumns = bsize[1],af = addScalar,mf = multiplyScalar,eq = equalScalar,zero = 0;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]), eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt));for (var cvalues = [], cindex = [], cptr = [], c = b.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [arows, bcolumns], datatype: dt }), jb = 0; jb < bcolumns; jb++) {cptr[jb] = cindex.length;var kb0 = bptr[jb],kb1 = bptr[jb + 1];if (kb1 > kb0) for (var last = 0, i = 0; i < arows; i++) {for (var ib, mark = i + 1, cij = void 0, kb = kb0; kb < kb1; kb++) ib = bindex[kb], last === mark ? cij = af(cij, mf(adata[i][ib], bvalues[kb])) : (cij = mf(adata[i][ib], bvalues[kb]), last = mark);last !== mark || eq(cij, zero) || (cindex.push(i), cvalues.push(cij));}}return cptr[bcolumns] = cindex.length, c;}, "SparseMatrix, DenseMatrix": function (a, b) {var avalues = a._values,aindex = a._index,aptr = a._ptr,adt = a._datatype;if (!avalues) throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var dt,bdata = b._data,bdt = b._datatype,arows = a._size[0],brows = b._size[0],bcolumns = b._size[1],af = addScalar,mf = multiplyScalar,eq = equalScalar,zero = 0;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]), eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt));for (var cvalues = [], cindex = [], cptr = [], c = a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [arows, bcolumns], datatype: dt }), x = [], w = [], jb = 0; jb < bcolumns; jb++) {cptr[jb] = cindex.length;for (var vbij, mark = jb + 1, ib = 0; ib < brows; ib++) if (vbij = bdata[ib][jb], !eq(vbij, zero)) for (var ia, ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) ia = aindex[ka], w[ia] === mark ? x[ia] = af(x[ia], mf(vbij, avalues[ka])) : (w[ia] = mark, cindex.push(ia), x[ia] = mf(vbij, avalues[ka]));for (var ic, p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) ic = cindex[p], cvalues[p] = x[ic];}return cptr[bcolumns] = cindex.length, c;}, "SparseMatrix, SparseMatrix": function (a, b) {var dt,avalues = a._values,aindex = a._index,aptr = a._ptr,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bdt = b._datatype,arows = a._size[0],bcolumns = b._size[1],values = avalues && bvalues,af = addScalar,mf = multiplyScalar;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]));for (var ka, ka0, ka1, kb, kb0, kb1, ia, ib, cvalues = values ? [] : void 0, cindex = [], cptr = [], c = a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [arows, bcolumns], datatype: dt }), x = values ? [] : void 0, w = [], jb = 0; jb < bcolumns; jb++) {cptr[jb] = cindex.length;var mark = jb + 1;for (kb0 = bptr[jb], kb1 = bptr[jb + 1], kb = kb0; kb < kb1; kb++) if (ib = bindex[kb], values) for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) ia = aindex[ka], w[ia] === mark ? x[ia] = af(x[ia], mf(bvalues[kb], avalues[ka])) : (w[ia] = mark, cindex.push(ia), x[ia] = mf(bvalues[kb], avalues[ka]));else for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) ia = aindex[ka], w[ia] !== mark && (w[ia] = mark, cindex.push(ia));if (values) for (var ic, p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) ic = cindex[p], cvalues[p] = x[ic];}return cptr[bcolumns] = cindex.length, c;} });return typed(multiply_name, extend({ "Array, Array": function (x, y) {_validateMatrixDimensions(arraySize(x), arraySize(y));var m = this(matrix(x), matrix(y));return isMatrix(m) ? m.valueOf() : m;}, "Matrix, Matrix": function (x, y) {var xsize = x.size(),ysize = y.size();return _validateMatrixDimensions(xsize, ysize), 1 === xsize.length ? 1 === ysize.length ? _multiplyVectorVector(x, y, xsize[0]) : _multiplyVectorMatrix(x, y) : 1 === ysize.length ? _multiplyMatrixVector(x, y) : _multiplyMatrixMatrix(x, y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "Array, Matrix": function (x, y) {return this(matrix(x, y.storage()), y);}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, multiplyScalar, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, multiplyScalar, !1);}, "any, SparseMatrix": function (x, y) {return algorithm11(y, x, multiplyScalar, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, multiplyScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, multiplyScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, multiplyScalar, !0).valueOf();}, "any, any": multiplyScalar, "any, any, ...any": function (x, y, rest) {for (var result = this(x, y), i = 0; i < rest.length; i++) result = this(result, rest[i]);return result;} }, multiplyScalar.signatures));});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/dotMultiply.js
var dotMultiply_name = "dotMultiply",dotMultiply_dependencies = ["typed", "matrix", "equalScalar", "multiplyScalar"];var createDotMultiply = factory("dotMultiply", dotMultiply_dependencies, (_ref) => {var { typed, matrix, equalScalar, multiplyScalar } = _ref,algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm09 = createAlgorithm09({ typed, equalScalar }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(dotMultiply_name, { "any, any": multiplyScalar, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm09(x, y, multiplyScalar, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, multiplyScalar, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm02(x, y, multiplyScalar, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, multiplyScalar);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, multiplyScalar, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, multiplyScalar, !1);}, "any, SparseMatrix": function (x, y) {return algorithm11(y, x, multiplyScalar, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, multiplyScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, multiplyScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, multiplyScalar, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/complex/re.js
var re_name = "re",re_dependencies = ["typed"];var createRe = factory("re", re_dependencies, (_ref) => {var { typed } = _ref;return typed(re_name, { number: function (x) {return x;}, BigNumber: function (x) {return x;}, Fraction: function (x) {return x;}, Complex: function (x) {return x.re;}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/flatten.js
var flatten_name = "flatten",flatten_dependencies = ["typed", "matrix"];var createFlatten = factory("flatten", flatten_dependencies, (_ref) => {var { typed, matrix } = _ref;return typed(flatten_name, { Array: function (x) {return flatten(clone(x));}, Matrix: function (x) {var flat = flatten(clone(x.toArray()));return matrix(flat);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/error/ArgumentsError.js
function ArgumentsError(fn, count, min, max) {if (!(this instanceof ArgumentsError)) throw new SyntaxError("Constructor must be called with the new operator");this.fn = fn, this.count = count, this.min = min, this.max = max, this.message = "Wrong number of arguments in function " + fn + " (" + count + " provided, " + min + (max !== void 0 && null !== max ? "-" + max : "") + " expected)", this.stack = new Error().stack;}ArgumentsError.prototype = new Error(), ArgumentsError.prototype.constructor = Error, ArgumentsError.prototype.name = "ArgumentsError", ArgumentsError.prototype.isArgumentsError = !0;
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/resize.js
var resize_name = "resize",resize_dependencies = ["config", "matrix"];var createResize = factory("resize", resize_dependencies, (_ref) => {function _resizeString(str, size, defaultChar) {if (!(defaultChar !== void 0)) defaultChar = " ";else if ("string" != typeof defaultChar || 1 !== defaultChar.length) throw new TypeError("Single character expected as defaultValue");if (1 !== size.length) throw new DimensionError(size.length, 1);var len = size[0];if ("number" != typeof len || !isInteger(len)) throw new TypeError("Invalid size, must contain positive integers (size: " + string_format(size) + ")");if (str.length > len) return str.substring(0, len);if (str.length < len) {for (var res = str, i = 0, ii = len - str.length; i < ii; i++) res += defaultChar;return res;}return str;}var { config, matrix } = _ref;return function (x, size, defaultValue) {if (2 !== arguments.length && 3 !== arguments.length) throw new ArgumentsError("resize", arguments.length, 2, 3);if (isMatrix(size) && (size = size.valueOf()), isBigNumber(size[0]) && (size = size.map(function (value) {return isBigNumber(value) ? value.toNumber() : value;})), isMatrix(x)) return x.resize(size, defaultValue, !0);if ("string" == typeof x) return _resizeString(x, size, defaultValue);var asMatrix = !Array.isArray(x) && "Array" !== config.matrix;if (0 === size.length) {for (; Array.isArray(x);) x = x[0];return clone(x);}Array.isArray(x) || (x = [x]), x = clone(x);var res = resize(x, size, defaultValue);return asMatrix ? matrix(res) : res;};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/squeeze.js
var squeeze_name = "squeeze",squeeze_dependencies = ["typed", "matrix"];var createSqueeze = factory("squeeze", squeeze_dependencies, (_ref) => {var { typed, matrix } = _ref;return typed(squeeze_name, { Array: function (x) {return squeeze(clone(x));}, Matrix: function (x) {var res = squeeze(x.toArray());return Array.isArray(res) ? matrix(res) : res;}, any: function (x) {return clone(x);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/unit/to.js
var to_name = "to",to_dependencies = ["typed", "matrix"];var createTo = factory("to", to_dependencies, (_ref) => {var { typed, matrix } = _ref,algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(to_name, { "Unit, Unit | string": function (x, unit) {return x.to(unit);}, "Matrix, Matrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "Matrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, Matrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/pow.js
var pow_name = "pow",pow_dependencies = ["typed", "config", "identity", "multiply", "matrix", "fraction", "number", "Complex"];var createPow = factory("pow", pow_dependencies, (_ref) => {function _pow(x, y) {if (config.predictable && !isInteger(y) && 0 > x) try {var yFrac = fraction(y),yNum = number(yFrac);if ((y === yNum || 1e-14 > Math.abs((y - yNum) / y)) && 1 == yFrac.d % 2) return (0 == yFrac.n % 2 ? 1 : -1) * Math.pow(-x, y);} catch (ex) {}return config.predictable && (-1 > x && y === 1 / 0 || -1 < x && 0 > x && y === -Infinity) ? NaN : isInteger(y) || 0 <= x || config.predictable ? powNumber(x, y) : 1 > x * x && y === 1 / 0 || 1 < x * x && y === -Infinity ? 0 : new Complex(x, 0).pow(y, 0);}function _powArray(x, y) {if (!isInteger(y) || 0 > y) throw new TypeError("For A^b, b must be a positive integer (value is " + y + ")");var s = arraySize(x);if (2 !== s.length) throw new Error("For A^b, A must be 2 dimensional (A has " + s.length + " dimensions)");if (s[0] !== s[1]) throw new Error("For A^b, A must be square (size is " + s[0] + "x" + s[1] + ")");for (var res = identity(s[0]).valueOf(), px = x; 1 <= y;) 1 == (1 & y) && (res = multiply(px, res)), y >>= 1, px = multiply(px, px);return res;}function _powMatrix(x, y) {return matrix(_powArray(x.valueOf(), y));}var { typed, config, identity, multiply, matrix, number, fraction, Complex } = _ref;return typed(pow_name, { "number, number": _pow, "Complex, Complex": function (x, y) {return x.pow(y);}, "BigNumber, BigNumber": function (x, y) {return y.isInteger() || 0 <= x || config.predictable ? x.pow(y) : new Complex(x.toNumber(), 0).pow(y.toNumber(), 0);}, "Fraction, Fraction": function (x, y) {var result = x.pow(y);if (null != result) return result;if (config.predictable) throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");else return _pow(x.valueOf(), y.valueOf());}, "Array, number": _powArray, "Array, BigNumber": function (x, y) {return _powArray(x, y.toNumber());}, "Matrix, number": _powMatrix, "Matrix, BigNumber": function (x, y) {return _powMatrix(x, y.toNumber());}, "Unit, number | BigNumber": function (x, y) {return x.pow(y);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/dotPow.js
var dotPow_name = "dotPow",dotPow_dependencies = ["typed", "equalScalar", "matrix", "pow", "DenseMatrix"];var createDotPow = factory("dotPow", dotPow_dependencies, (_ref) => {var { typed, equalScalar, matrix, pow, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(dotPow_name, { "any, any": pow, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, pow, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, pow, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, pow, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, pow);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/bitwise/rightArithShift.js
var rightArithShift_name = "rightArithShift",rightArithShift_dependencies = ["typed", "matrix", "equalScalar", "zeros", "DenseMatrix"];var createRightArithShift = factory("rightArithShift", rightArithShift_dependencies, (_ref) => {var { typed, matrix, equalScalar, zeros, DenseMatrix } = _ref,algorithm01 = createAlgorithm01({ typed }),algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm08 = createAlgorithm08({ typed, equalScalar }),algorithm10 = createAlgorithm10({ typed, DenseMatrix }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(rightArithShift_name, { "number, number": rightArithShiftNumber, "BigNumber, BigNumber": rightArithShiftBigNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm08(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm10(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return this(matrix(x), y).valueOf();}, "number | BigNumber, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});
// EXTERNAL MODULE: ./node_modules/javascript-natural-sort/naturalSort.js
var naturalSort = __webpack_require__("./node_modules/javascript-natural-sort/naturalSort.js");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/compareNatural.js
var compareNatural_name = "compareNatural",compareNatural_dependencies = ["typed", "compare"];var createCompareNatural = factory("compareNatural", compareNatural_dependencies, (_ref) => {function compareMatricesAndArrays(compareNatural, x, y) {return isSparseMatrix(x) && isSparseMatrix(y) ? compareArrays(compareNatural, x.toJSON().values, y.toJSON().values) : isSparseMatrix(x) ? compareMatricesAndArrays(compareNatural, x.toArray(), y) : isSparseMatrix(y) ? compareMatricesAndArrays(compareNatural, x, y.toArray()) : isDenseMatrix(x) ? compareMatricesAndArrays(compareNatural, x.toJSON().data, y) : isDenseMatrix(y) ? compareMatricesAndArrays(compareNatural, x, y.toJSON().data) : Array.isArray(x) ? Array.isArray(y) ? compareArrays(compareNatural, x, y) : compareMatricesAndArrays(compareNatural, x, [y]) : compareMatricesAndArrays(compareNatural, [x], y);}function compareArrays(compareNatural, x, y) {for (var v, i = 0, ii = Math.min(x.length, y.length); i < ii; i++) if (v = compareNatural(x[i], y[i]), 0 !== v) return v;return x.length > y.length ? 1 : x.length < y.length ? -1 : 0;}function compareObjects(compareNatural, x, y) {var keysX = Object.keys(x),keysY = Object.keys(y);keysX.sort(naturalSort), keysY.sort(naturalSort);var c = compareArrays(compareNatural, keysX, keysY);if (0 !== c) return c;for (var v, i = 0; i < keysX.length; i++) if (v = compareNatural(x[keysX[i]], y[keysY[i]]), 0 !== v) return v;return 0;}var { typed, compare } = _ref,compareBooleans = compare.signatures["boolean,boolean"];return typed(compareNatural_name, { "any, any": function (x, y) {var c,typeX = typeOf(x),typeY = typeOf(y);if (("number" === typeX || "BigNumber" === typeX || "Fraction" === typeX) && ("number" === typeY || "BigNumber" === typeY || "Fraction" === typeY)) return c = compare(x, y), "0" === c.toString() ? naturalSort(typeX, typeY) : 0 < c ? 1 : -1;if ("Array" === typeX || "Matrix" === typeX || "Array" === typeY || "Matrix" === typeY) return c = compareMatricesAndArrays(this, x, y), 0 === c ? naturalSort(typeX, typeY) : c;if (typeX !== typeY) return naturalSort(typeX, typeY);if ("Complex" === typeX) return compareComplexNumbers(x, y);if ("Unit" === typeX) return x.equalBase(y) ? this(x.value, y.value) : compareArrays(this, x.formatUnits(), y.formatUnits());if ("boolean" === typeX) return compareBooleans(x, y);if ("string" === typeX) return naturalSort(x, y);if ("Object" === typeX) return compareObjects(this, x, y);if ("null" === typeX) return 0;if ("undefined" === typeX) return 0;throw new TypeError("Unsupported type of value \"" + typeX + "\"");} });});function compareComplexNumbers(x, y) {return x.re > y.re ? 1 : x.re < y.re ? -1 : x.im > y.im ? 1 : x.im < y.im ? -1 : 0;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/equalText.js
var equalText_name = "equalText",equalText_dependencies = ["typed", "compareText", "isZero"];var createEqualText = factory("equalText", equalText_dependencies, (_ref) => {var { typed, compareText, isZero } = _ref;return typed(equalText_name, { "any, any": function (x, y) {return isZero(compareText(x, y));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/largerEq.js
var largerEq_name = "largerEq",largerEq_dependencies = ["typed", "config", "matrix", "DenseMatrix"];var createLargerEq = factory("largerEq", largerEq_dependencies, (_ref) => {var { typed, config, matrix, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(largerEq_name, { "boolean, boolean": function (x, y) {return x >= y;}, "number, number": function (x, y) {return x >= y || nearlyEqual(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.gte(y) || nearlyEqual_nearlyEqual(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return -1 !== x.compare(y);}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});var createLargerEqNumber = factory("largerEq", ["typed", "config"], (_ref2) => {var { typed, config } = _ref2;return typed(largerEq_name, { "number, number": function (x, y) {return x >= y || nearlyEqual(x, y, config.epsilon);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/partitionSelect.js
var partitionSelect_name = "partitionSelect",partitionSelect_dependencies = ["typed", "isNumeric", "isNaN", "compare"];var createPartitionSelect = factory("partitionSelect", partitionSelect_dependencies, (_ref) => {function _partitionSelect(x, k, compare) {if (!isInteger(k) || 0 > k) throw new Error("k must be a non-negative integer");if (isMatrix(x)) {var size = x.size();if (1 < size.length) throw new Error("Only one dimensional matrices supported");return quickSelect(x.valueOf(), k, compare);}return Array.isArray(x) ? quickSelect(x, k, compare) : void 0;}function quickSelect(arr, k, compare) {if (k >= arr.length) throw new Error("k out of bounds");for (var i = 0; i < arr.length; i++) if (isNumeric(arr[i]) && isNaN(arr[i])) return arr[i];for (var from = 0, to = arr.length - 1; from < to;) {for (var r = from, w = to, pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from]; r < w;) if (0 <= compare(arr[r], pivot)) {var tmp = arr[w];arr[w] = arr[r], arr[r] = tmp, --w;} else ++r;0 < compare(arr[r], pivot) && --r, k <= r ? to = r : from = r + 1;}return arr[k];}var { typed, isNumeric, isNaN, compare } = _ref,asc = compare,desc = (a, b) => -compare(a, b);return typed(partitionSelect_name, { "Array | Matrix, number": function (x, k) {return _partitionSelect(x, k, asc);}, "Array | Matrix, number, string": function (x, k, compare) {if ("asc" === compare) return _partitionSelect(x, k, asc);if ("desc" === compare) return _partitionSelect(x, k, desc);throw new Error("Compare string must be \"asc\" or \"desc\"");}, "Array | Matrix, number, function": _partitionSelect });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/MatrixIndex.js
var MatrixIndex_name = "Index",MatrixIndex_dependencies = ["ImmutableDenseMatrix"];var createIndexClass = factory("Index", MatrixIndex_dependencies, (_ref) => {function Index() {if (!(this instanceof Index)) throw new SyntaxError("Constructor must be called with the new operator");this._dimensions = [], this._isScalar = !0;for (var arg, i = 0, ii = arguments.length; i < ii; i++) if (arg = arguments[i], isRange(arg)) this._dimensions.push(arg), this._isScalar = !1;else if (Array.isArray(arg) || isMatrix(arg)) {var m = _createImmutableMatrix(arg.valueOf());this._dimensions.push(m);var size = m.size();(1 !== size.length || 1 !== size[0]) && (this._isScalar = !1);} else if ("number" == typeof arg) this._dimensions.push(_createImmutableMatrix([arg]));else if ("string" == typeof arg) this._dimensions.push(arg);else throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");}function _createImmutableMatrix(arg) {for (var i = 0, l = arg.length; i < l; i++) if ("number" != typeof arg[i] || !isInteger(arg[i])) throw new TypeError("Index parameters must be positive integer numbers");return new ImmutableDenseMatrix(arg);}var { ImmutableDenseMatrix } = _ref;return Index.prototype.type = "Index", Index.prototype.isIndex = !0, Index.prototype.clone = function () {var index = new Index();return index._dimensions = clone(this._dimensions), index._isScalar = this._isScalar, index;}, Index.create = function (ranges) {var index = new Index();return Index.apply(index, ranges), index;}, Index.prototype.size = function () {for (var d, size = [], i = 0, ii = this._dimensions.length; i < ii; i++) d = this._dimensions[i], size[i] = "string" == typeof d ? 1 : d.size()[0];return size;}, Index.prototype.max = function () {for (var range, values = [], i = 0, ii = this._dimensions.length; i < ii; i++) range = this._dimensions[i], values[i] = "string" == typeof range ? range : range.max();return values;}, Index.prototype.min = function () {for (var range, values = [], i = 0, ii = this._dimensions.length; i < ii; i++) range = this._dimensions[i], values[i] = "string" == typeof range ? range : range.min();return values;}, Index.prototype.forEach = function (callback) {for (var i = 0, ii = this._dimensions.length; i < ii; i++) callback(this._dimensions[i], i, this);}, Index.prototype.dimension = function (dim) {return this._dimensions[dim] || null;}, Index.prototype.isObjectProperty = function () {return 1 === this._dimensions.length && "string" == typeof this._dimensions[0];}, Index.prototype.getObjectProperty = function () {return this.isObjectProperty() ? this._dimensions[0] : null;}, Index.prototype.isScalar = function () {return this._isScalar;}, Index.prototype.toArray = function () {for (var dimension, array = [], i = 0, ii = this._dimensions.length; i < ii; i++) dimension = this._dimensions[i], array.push("string" == typeof dimension ? dimension : dimension.toArray());return array;}, Index.prototype.valueOf = Index.prototype.toArray, Index.prototype.toString = function () {for (var dimension, strings = [], i = 0, ii = this._dimensions.length; i < ii; i++) dimension = this._dimensions[i], "string" == typeof dimension ? strings.push(JSON.stringify(dimension)) : strings.push(dimension.toString());return "[" + strings.join(", ") + "]";}, Index.prototype.toJSON = function () {return { mathjs: "Index", dimensions: this._dimensions };}, Index.fromJSON = function (json) {return Index.create(json.dimensions);}, Index;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/asech.js
var asech_name = "asech",asech_dependencies = ["typed", "config", "Complex", "BigNumber"];var createAsech = factory("asech", asech_dependencies, (_ref) => {var { typed, config, Complex, BigNumber: _BigNumber } = _ref;return typed(asech_name, { number: function (x) {if (1 >= x && -1 <= x || config.predictable) {var xInv = 1 / x;if (0 < xInv || config.predictable) return asechNumber(x);var ret = Math.sqrt(xInv * xInv - 1);return new Complex(Math.log(ret - xInv), Math.PI);}return new Complex(x, 0).asech();}, Complex: function (x) {return x.asech();}, BigNumber: function (x) {return new _BigNumber(1).div(x).acosh();}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/tan.js
var tan_name = "tan",tan_dependencies = ["typed"];var createTan = factory("tan", tan_dependencies, (_ref) => {var { typed } = _ref;return typed(tan_name, { number: Math.tan, Complex: function (x) {return x.tan();}, BigNumber: function (x) {return x.tan();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function tan is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setDifference.js
var setDifference_name = "setDifference",setDifference_dependencies = ["typed", "size", "subset", "compareNatural", "Index", "DenseMatrix"];var createSetDifference = factory("setDifference", setDifference_dependencies, (_ref) => {var { typed, size, subset, compareNatural, Index, DenseMatrix } = _ref;return typed(setDifference_name, { "Array | Matrix, Array | Matrix": function (a1, a2) {var result;if (0 === subset(size(a1), new Index(0))) result = [];else {if (0 === subset(size(a2), new Index(0))) return flatten(a1.toArray());var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)),b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));result = [];for (var inb2, i = 0; i < b1.length; i++) {inb2 = !1;for (var j = 0; j < b2.length; j++) if (0 === compareNatural(b1[i].value, b2[j].value) && b1[i].identifier === b2[j].identifier) {inb2 = !0;break;}inb2 || result.push(b1[i]);}}return Array.isArray(a1) && Array.isArray(a2) ? generalize(result) : new DenseMatrix(generalize(result));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setIntersect.js
var setIntersect_name = "setIntersect",setIntersect_dependencies = ["typed", "size", "subset", "compareNatural", "Index", "DenseMatrix"];var createSetIntersect = factory("setIntersect", setIntersect_dependencies, (_ref) => {var { typed, size, subset, compareNatural, Index, DenseMatrix } = _ref;return typed(setIntersect_name, { "Array | Matrix, Array | Matrix": function (a1, a2) {var result;if (0 === subset(size(a1), new Index(0)) || 0 === subset(size(a2), new Index(0))) result = [];else {var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)),b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));result = [];for (var i = 0; i < b1.length; i++) for (var j = 0; j < b2.length; j++) if (0 === compareNatural(b1[i].value, b2[j].value) && b1[i].identifier === b2[j].identifier) {result.push(b1[i]);break;}}return Array.isArray(a1) && Array.isArray(a2) ? generalize(result) : new DenseMatrix(generalize(result));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setMultiplicity.js
var setMultiplicity_name = "setMultiplicity",setMultiplicity_dependencies = ["typed", "size", "subset", "compareNatural", "Index"];var createSetMultiplicity = factory("setMultiplicity", setMultiplicity_dependencies, (_ref) => {var { typed, size, subset, compareNatural, Index } = _ref;return typed(setMultiplicity_name, { "number | BigNumber | Fraction | Complex, Array | Matrix": function (e, a) {if (0 === subset(size(a), new Index(0))) return 0;for (var b = flatten(Array.isArray(a) ? a : a.toArray()), count = 0, i = 0; i < b.length; i++) 0 === compareNatural(b[i], e) && count++;return count;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setSize.js
var setSize_name = "setSize",setSize_dependencies = ["typed", "compareNatural"];var createSetSize = factory("setSize", setSize_dependencies, (_ref) => {var { typed, compareNatural } = _ref;return typed(setSize_name, { "Array | Matrix": function (a) {return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;}, "Array | Matrix, boolean": function (a, unique) {if (!1 === unique || 0 === a.length) return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;for (var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural), count = 1, i = 1; i < b.length; i++) 0 !== compareNatural(b[i], b[i - 1]) && count++;return count;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/trace.js
var trace_name = "trace",trace_dependencies = ["typed", "matrix", "add"];var createTrace = factory("trace", trace_dependencies, (_ref) => {function _denseTrace(m) {var size = m._size,data = m._data;switch (size.length) {case 1:if (1 === size[0]) return clone(data[0]);throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");case 2:{var rows = size[0],cols = size[1];if (rows === cols) {for (var sum = 0, i = 0; i < rows; i++) sum = add(sum, data[i][i]);return sum;}throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");}default:throw new RangeError("Matrix must be two dimensional (size: " + string_format(size) + ")");}}var { typed, matrix, add } = _ref;return typed("trace", { Array: function (x) {return _denseTrace(matrix(x));}, SparseMatrix: function (m) {var values = m._values,index = m._index,ptr = m._ptr,size = m._size,rows = size[0],columns = size[1];if (rows === columns) {var sum = 0;if (0 < values.length) for (var j = 0; j < columns; j++) for (var i, k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) {if (i = index[k], i === j) {sum = add(sum, values[k]);break;}if (i > j) break;}return sum;}throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");}, DenseMatrix: _denseTrace, any: clone });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/quantileSeq.js
var quantileSeq_name = "quantileSeq",quantileSeq_dependencies = ["typed", "add", "multiply", "partitionSelect", "compare"];var createQuantileSeq = factory("quantileSeq", quantileSeq_dependencies, (_ref) => {function _quantileSeq(array, prob, sorted) {var flat = flatten(array),len = flat.length;if (0 === len) throw new Error("Cannot calculate quantile of an empty sequence");if (isNumber(prob)) {var _index = prob * (len - 1),_fracPart = _index % 1;if (0 === _fracPart) {var value = sorted ? flat[_index] : partitionSelect(flat, _index);return validate(value), value;}var _left,_right,_integerPart = Math.floor(_index);if (sorted) _left = flat[_integerPart], _right = flat[_integerPart + 1];else {_right = partitionSelect(flat, _integerPart + 1), _left = flat[_integerPart];for (var i = 0; i < _integerPart; ++i) 0 < compare(flat[i], _left) && (_left = flat[i]);}return validate(_left), validate(_right), add(multiply(_left, 1 - _fracPart), multiply(_right, _fracPart));}var index = prob.times(len - 1);if (index.isInteger()) {index = index.toNumber();var _value = sorted ? flat[index] : partitionSelect(flat, index);return validate(_value), _value;}var left,right,integerPart = index.floor(),fracPart = index.minus(integerPart),integerPartNumber = integerPart.toNumber();if (sorted) left = flat[integerPartNumber], right = flat[integerPartNumber + 1];else {right = partitionSelect(flat, integerPartNumber + 1), left = flat[integerPartNumber];for (var _i3 = 0; _i3 < integerPartNumber; ++_i3) 0 < compare(flat[_i3], left) && (left = flat[_i3]);}validate(left), validate(right);var one = new fracPart.constructor(1);return add(multiply(left, one.minus(fracPart)), multiply(right, fracPart));}var { typed, add, multiply, partitionSelect, compare } = _ref,validate = typed({ "number | BigNumber | Unit": function (x) {return x;} });return function (data, probOrN, sorted) {var probArr, dataArr, one;if (2 > arguments.length || 3 < arguments.length) throw new SyntaxError("Function quantileSeq requires two or three parameters");if (isCollection(data)) {if (sorted = sorted || !1, "boolean" == typeof sorted) {if (dataArr = data.valueOf(), isNumber(probOrN)) {if (0 > probOrN) throw new Error("N/prob must be non-negative");if (1 >= probOrN) return _quantileSeq(dataArr, probOrN, sorted);if (1 < probOrN) {if (!isInteger(probOrN)) throw new Error("N must be a positive integer");probArr = Array(probOrN);for (var i = 0; i < probOrN;) probArr[i] = _quantileSeq(dataArr, ++i / (probOrN + 1), sorted);return probArr;}}if (isBigNumber(probOrN)) {var BigNumber = probOrN.constructor;if (probOrN.isNegative()) throw new Error("N/prob must be non-negative");if (one = new BigNumber(1), probOrN.lte(one)) return new BigNumber(_quantileSeq(dataArr, probOrN, sorted));if (probOrN.gt(one)) {if (!probOrN.isInteger()) throw new Error("N must be a positive integer");var intN = probOrN.toNumber();if (4294967295 < intN) throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var _nPlusOne = new BigNumber(intN + 1);probArr = Array(intN);for (var _i = 0; _i < intN;) probArr[_i] = new BigNumber(_quantileSeq(dataArr, new BigNumber(++_i).div(_nPlusOne), sorted));return probArr;}}if (Array.isArray(probOrN)) {probArr = Array(probOrN.length);for (var currProb, _i2 = 0; _i2 < probArr.length; ++_i2) {if (currProb = probOrN[_i2], isNumber(currProb)) {if (0 > currProb || 1 < currProb) throw new Error("Probability must be between 0 and 1, inclusive");} else if (!isBigNumber(currProb)) throw new TypeError("Unexpected type of argument in function quantileSeq");else if (one = new currProb.constructor(1), currProb.isNegative() || currProb.gt(one)) throw new Error("Probability must be between 0 and 1, inclusive");probArr[_i2] = _quantileSeq(dataArr, currProb, sorted);}return probArr;}throw new TypeError("Unexpected type of argument in function quantileSeq");}throw new TypeError("Unexpected type of argument in function quantileSeq");}throw new TypeError("Unexpected type of argument in function quantileSeq");};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/plain/number/probability.js
function gammaNumber(n) {var x;if (isInteger(n)) return 0 >= n ? isFinite(n) ? 1 / 0 : NaN : 171 < n ? 1 / 0 : product_product(1, n - 1);if (.5 > n) return Math.PI / (Math.sin(Math.PI * n) * gammaNumber(1 - n));if (171.35 <= n) return 1 / 0;if (85 < n) {var twoN = n * n,threeN = twoN * n,fourN = threeN * n,fiveN = fourN * n;return Math.sqrt(2 * Math.PI / n) * Math.pow(n / Math.E, n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n));}--n, x = gammaP[0];for (var i = 1; i < gammaP.length; ++i) x += gammaP[i] / (n + i);var t = n + gammaG + .5;return Math.sqrt(2 * Math.PI) * Math.pow(t, n + .5) * Math.exp(-t) * x;}gammaNumber.signature = "number";var gammaG = 4.7421875;var gammaP = [.9999999999999971, 57.15623566586292, -59.59796035547549, 14.136097974741746, -.4919138160976202, 3399464998481189e-20, 4652362892704858e-20, -9837447530487956e-20, .0001580887032249125, -.00021026444172410488, .00021743961811521265, -.0001643181065367639, 8441822398385275e-20, -26190838401581408e-21, 36899182659531625e-22];
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/gamma.js
var gamma_name = "gamma",gamma_dependencies = ["typed", "config", "multiplyScalar", "pow", "BigNumber", "Complex"];var createGamma = factory("gamma", gamma_dependencies, (_ref) => {function bigFactorial(n) {if (8 > n) return new _BigNumber([1, 1, 2, 6, 24, 120, 720, 5040][n]);var precision = config.precision + (0 | Math.log(n.toNumber())),Big = _BigNumber.clone({ precision: precision });if (1 == n % 2) return n.times(bigFactorial(new _BigNumber(n - 1)));for (var p = n, prod = new Big(n), sum = n.toNumber(); 2 < p;) p -= 2, sum += p, prod = prod.times(sum);return new _BigNumber(prod.toPrecision(_BigNumber.precision));}var { typed, config, multiplyScalar, pow, BigNumber: _BigNumber, Complex: _Complex } = _ref;return typed(gamma_name, { number: gammaNumber, Complex: function (n) {if (0 === n.im) return this(n.re);n = new _Complex(n.re - 1, n.im);for (var x = new _Complex(gammaP[0], 0), i = 1; i < gammaP.length; ++i) {var real = n.re + i,den = real * real + n.im * n.im;0 === den ? x.re = 0 > gammaP[i] ? -Infinity : 1 / 0 : (x.re += gammaP[i] * real / den, x.im += -(gammaP[i] * n.im) / den);}var t = new _Complex(n.re + gammaG + .5, n.im),twoPiSqrt = Math.sqrt(2 * Math.PI);n.re += .5;var result = pow(t, n);0 === result.im ? result.re *= twoPiSqrt : 0 === result.re ? result.im *= twoPiSqrt : (result.re *= twoPiSqrt, result.im *= twoPiSqrt);var r = Math.exp(-t.re);return t.re = r * Math.cos(-t.im), t.im = r * Math.sin(-t.im), multiplyScalar(multiplyScalar(result, t), x);}, BigNumber: function (n) {if (n.isInteger()) return n.isNegative() || n.isZero() ? new _BigNumber(1 / 0) : bigFactorial(n.minus(1));if (!n.isFinite()) return new _BigNumber(n.isNegative() ? NaN : 1 / 0);throw new Error("Integer BigNumber expected");}, "Array | Matrix": function (n) {return deepMap(n, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/bignumber/function/bignumber.js
var bignumber_name = "bignumber",bignumber_dependencies = ["typed", "BigNumber"];var createBignumber = factory("bignumber", bignumber_dependencies, (_ref) => {var { typed, BigNumber } = _ref;return typed("bignumber", { "": function () {return new BigNumber(0);}, number: function (x) {return new BigNumber(x + "");}, string: function (x) {var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if (wordSizeSuffixMatch) {var size = wordSizeSuffixMatch[2],n = BigNumber(wordSizeSuffixMatch[1]),twoPowSize = new BigNumber(2).pow(+size);if (n.gt(twoPowSize.sub(1))) throw new SyntaxError("String \"".concat(x, "\" is out of range"));var twoPowSizeSubOne = new BigNumber(2).pow(+size - 1);return n.gte(twoPowSizeSubOne) ? n.sub(twoPowSize) : n;}return new BigNumber(x);}, BigNumber: function (x) {return x;}, Fraction: function (x) {return new BigNumber(x.n).div(x.d).times(x.s);}, null: function () {return new BigNumber(0);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/matrixFromColumns.js
var matrixFromColumns_name = "matrixFromColumns",matrixFromColumns_dependencies = ["typed", "matrix", "flatten", "size"];var createMatrixFromColumns = factory("matrixFromColumns", matrixFromColumns_dependencies, (_ref) => {function _createArray(arr) {if (0 === arr.length) throw new TypeError("At least one column is needed to construct a matrix.");for (var N = checkVectorTypeAndReturnLength(arr[0]), result = [], i = 0; i < N; i++) result[i] = [];for (var col of arr) {var colLength = checkVectorTypeAndReturnLength(col);if (colLength !== N) throw new TypeError("The vectors had different length: " + (0 | N) + " \u2260 " + (0 | colLength));for (var f = flatten(col), _i = 0; _i < N; _i++) result[_i].push(f[_i]);}return result;}function checkVectorTypeAndReturnLength(vec) {var s = size(vec);if (1 === s.length) return s[0];if (2 === s.length) {if (1 === s[0]) return s[1];if (1 === s[1]) return s[0];throw new TypeError("At least one of the arguments is not a vector.");} else throw new TypeError("Only one- or two-dimensional vectors are supported.");}var { typed, matrix, flatten, size } = _ref;return typed(matrixFromColumns_name, { "...Array": function (arr) {return _createArray(arr);}, "...Matrix": function (arr) {return matrix(_createArray(arr.map((m) => m.toArray())));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/lcm.js
var lcm_name = "lcm",lcm_dependencies = ["typed", "matrix", "equalScalar"];var createLcm = factory("lcm", lcm_dependencies, (_ref) => {var { typed, matrix, equalScalar } = _ref,algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm06 = createAlgorithm06({ typed, equalScalar }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(lcm_name, { "number, number": lcmNumber, "BigNumber, BigNumber": function (a, b) {if (!a.isInt() || !b.isInt()) throw new Error("Parameters in function lcm must be integer numbers");if (a.isZero()) return a;if (b.isZero()) return b;for (var prod = a.times(b); !b.isZero();) {var t = b;b = a.mod(t), a = t;}return prod.div(a).abs();}, "Fraction, Fraction": function (x, y) {return x.lcm(y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm06(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm02(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return algorithm11(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "number | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();}, "Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber": function (a, b, args) {for (var res = this(a, b), i = 0; i < args.length; i++) res = this(res, args[i]);return res;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/bitwise/bitOr.js
var bitOr_name = "bitOr",bitOr_dependencies = ["typed", "matrix", "equalScalar", "DenseMatrix"];var createBitOr = factory("bitOr", bitOr_dependencies, (_ref) => {var { typed, matrix, equalScalar, DenseMatrix } = _ref,algorithm01 = createAlgorithm01({ typed }),algorithm04 = createAlgorithm04({ typed, equalScalar }),algorithm10 = createAlgorithm10({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(bitOr_name, { "number, number": bitOrNumber, "BigNumber, BigNumber": bitOrBigNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm04(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm01(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm10(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm10(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/kron.js
var kron_name = "kron",kron_dependencies = ["typed", "matrix", "multiplyScalar"];var createKron = factory("kron", kron_dependencies, (_ref) => {function _kron(a, b) {if (1 === arraySize(a).length && (a = [a]), 1 === arraySize(b).length && (b = [b]), 2 < arraySize(a).length || 2 < arraySize(b).length) throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = " + JSON.stringify(a.length) + ", y = " + JSON.stringify(b.length) + ")");var t = [],r = [];return a.map(function (a) {return b.map(function (b) {return r = [], t.push(r), a.map(function (y) {return b.map(function (x) {return r.push(multiplyScalar(y, x));});});});}) && t;}var { typed, matrix, multiplyScalar } = _ref;return typed(kron_name, { "Matrix, Matrix": function (x, y) {return matrix(_kron(x.toArray(), y.toArray()));}, "Matrix, Array": function (x, y) {return matrix(_kron(x.toArray(), y));}, "Array, Matrix": function (x, y) {return matrix(_kron(x, y.toArray()));}, "Array, Array": _kron });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/transpose.js
var transpose_name = "transpose",transpose_dependencies = ["typed", "matrix"];var createTranspose = factory("transpose", transpose_dependencies, (_ref) => {function _denseTranspose(m, rows, columns) {for (var transposedRow, data = m._data, transposed = [], j = 0; j < columns; j++) {transposedRow = transposed[j] = [];for (var i = 0; i < rows; i++) transposedRow[i] = clone(data[i][j]);}return m.createDenseMatrix({ data: transposed, size: [columns, rows], datatype: m._datatype });}function _sparseTranspose(m, rows, columns) {for (var values = m._values, index = m._index, ptr = m._ptr, cvalues = values ? [] : void 0, cindex = [], cptr = [], w = [], x = 0; x < rows; x++) w[x] = 0;var p, l, j;for (p = 0, l = index.length; p < l; p++) w[index[p]]++;for (var sum = 0, i = 0; i < rows; i++) cptr.push(sum), sum += w[i], w[i] = cptr[i];for (cptr.push(sum), j = 0; j < columns; j++) for (var q, k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) q = w[index[k]]++, cindex[q] = j, values && (cvalues[q] = clone(values[k]));return m.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [columns, rows], datatype: m._datatype });}var { typed, matrix } = _ref;return typed("transpose", { Array: function (x) {return this(matrix(x)).valueOf();}, Matrix: function (x) {var c,size = x.size();switch (size.length) {case 1:c = x.clone();break;case 2:{var rows = size[0],columns = size[1];if (0 === columns) throw new RangeError("Cannot transpose a 2D matrix with no columns (size: " + string_format(size) + ")");switch (x.storage()) {case "dense":c = _denseTranspose(x, rows, columns);break;case "sparse":c = _sparseTranspose(x, rows, columns);}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: " + string_format(this._size) + ")");}return c;}, any: function (x) {return clone(x);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/utils/numeric.js
var numeric_name = "numeric",numeric_dependencies = ["number", "?bignumber", "?fraction"];var createNumeric = factory("numeric", numeric_dependencies, (_ref) => {var { number: _number, bignumber, fraction } = _ref,validInputTypes = { string: !0, number: !0, BigNumber: !0, Fraction: !0 },validOutputTypes = { number: (x) => _number(x), BigNumber: bignumber ? (x) => bignumber(x) : noBignumber, Fraction: fraction ? (x) => fraction(x) : noFraction };return function (value, outputType) {var inputType = typeOf(value);if (!(inputType in validInputTypes)) throw new TypeError("Cannot convert " + value + " of type \"" + inputType + "\"; valid input types are " + Object.keys(validInputTypes).join(", "));if (!(outputType in validOutputTypes)) throw new TypeError("Cannot convert " + value + " to type \"" + outputType + "\"; valid output types are " + Object.keys(validOutputTypes).join(", "));return outputType === inputType ? value : validOutputTypes[outputType](value);};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/logical/and.js
var and_name = "and",and_dependencies = ["typed", "matrix", "equalScalar", "zeros", "not"];var createAnd = factory("and", and_dependencies, (_ref) => {var { typed, matrix, equalScalar, zeros, not } = _ref,algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm06 = createAlgorithm06({ typed, equalScalar }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(and_name, { "number, number": andNumber, "Complex, Complex": function (x, y) {return (0 !== x.re || 0 !== x.im) && (0 !== y.re || 0 !== y.im);}, "BigNumber, BigNumber": function (x, y) {return !x.isZero() && !y.isZero() && !x.isNaN() && !y.isNaN();}, "Unit, Unit": function (x, y) {return this(x.value || 0, y.value || 0);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm06(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm02(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return not(y) ? zeros(x.size(), x.storage()) : algorithm11(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return not(y) ? zeros(x.size(), x.storage()) : algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return not(x) ? zeros(x.size(), x.storage()) : algorithm11(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return not(x) ? zeros(x.size(), x.storage()) : algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return this(matrix(x), y).valueOf();}, "any, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/smallerEq.js
var smallerEq_name = "smallerEq",smallerEq_dependencies = ["typed", "config", "matrix", "DenseMatrix"];var createSmallerEq = factory("smallerEq", smallerEq_dependencies, (_ref) => {var { typed, config, matrix, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(smallerEq_name, { "boolean, boolean": function (x, y) {return x <= y;}, "number, number": function (x, y) {return x <= y || nearlyEqual(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.lte(y) || nearlyEqual_nearlyEqual(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return 1 !== x.compare(y);}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});var createSmallerEqNumber = factory("smallerEq", ["typed", "config"], (_ref2) => {var { typed, config } = _ref2;return typed(smallerEq_name, { "number, number": function (x, y) {return x <= y || nearlyEqual(x, y, config.epsilon);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/sort.js
var sort_name = "sort",sort_dependencies = ["typed", "matrix", "compare", "compareNatural"];var createSort = factory("sort", sort_dependencies, (_ref) => {function _comparator(order) {if ("asc" === order) return compareAsc;if ("desc" === order) return compareDesc;if ("natural" === order) return compareNatural;throw new Error("String \"asc\", \"desc\", or \"natural\" expected");}function _arrayIsVector(array) {if (1 !== arraySize(array).length) throw new Error("One dimensional array expected");}function _matrixIsVector(matrix) {if (1 !== matrix.size().length) throw new Error("One dimensional matrix expected");}var { typed, matrix, compare, compareNatural } = _ref,compareAsc = compare,compareDesc = (a, b) => -compare(a, b);return typed(sort_name, { Array: function (x) {return _arrayIsVector(x), x.sort(compareAsc);}, Matrix: function (x) {return _matrixIsVector(x), matrix(x.toArray().sort(compareAsc), x.storage());}, "Array, function": function (x, _comparator) {return _arrayIsVector(x), x.sort(_comparator);}, "Matrix, function": function (x, _comparator) {return _matrixIsVector(x), matrix(x.toArray().sort(_comparator), x.storage());}, "Array, string": function (x, order) {return _arrayIsVector(x), x.sort(_comparator(order));}, "Matrix, string": function (x, order) {return _matrixIsVector(x), matrix(x.toArray().sort(_comparator(order)), x.storage());} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/utils/improveErrorMessage.js
function improveErrorMessage(err, fnName, value) {var details;return -1 === (err + "").indexOf("Unexpected type") ? -1 === (err + "").indexOf("complex numbers") ? err : (details = 2 < arguments.length ? " (type: " + typeOf(value) + ", value: " + JSON.stringify(value) + ")" : "", new TypeError("Cannot calculate " + fnName + ", no ordering relation is defined for complex numbers" + details)) : (details = 2 < arguments.length ? " (type: " + typeOf(value) + ", value: " + JSON.stringify(value) + ")" : " (type: " + err.data.actual + ")", new TypeError("Cannot calculate " + fnName + ", unexpected type of argument" + details));}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/min.js
var min_name = "min",min_dependencies = ["typed", "config", "numeric", "smaller"];var createMin = factory("min", min_dependencies, (_ref) => {function _smallest(x, y) {try {return smaller(x, y) ? x : y;} catch (err) {throw improveErrorMessage(err, "min", y);}}function _min(array) {var min;if (deepForEach(array, function (value) {try {isNaN(value) && "number" == typeof value ? min = NaN : (void 0 === min || smaller(value, min)) && (min = value);} catch (err) {throw improveErrorMessage(err, "min", value);}}), void 0 === min) throw new Error("Cannot calculate min of an empty array");return "string" == typeof min && (min = numeric(min, config.number)), min;}var { typed, config, numeric, smaller } = _ref;return typed(min_name, { "Array | Matrix": _min, "Array | Matrix, number | BigNumber": function (array, dim) {return reduce(array, dim.valueOf(), _smallest);}, "...": function (args) {if (containsCollections(args)) throw new TypeError("Scalar values expected in function min");return _min(args);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/trigonometry/cot.js
var cot_name = "cot",cot_dependencies = ["typed", "BigNumber"];var createCot = factory("cot", cot_dependencies, (_ref) => {var { typed, BigNumber: _BigNumber } = _ref;return typed(cot_name, { number: cotNumber, Complex: function (x) {return x.cot();}, BigNumber: function (x) {return new _BigNumber(1).div(x.tan());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function cot is no angle");return this(x.value);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setDistinct.js
var setDistinct_name = "setDistinct",setDistinct_dependencies = ["typed", "size", "subset", "compareNatural", "Index", "DenseMatrix"];var createSetDistinct = factory("setDistinct", setDistinct_dependencies, (_ref) => {var { typed, size, subset, compareNatural, Index, DenseMatrix } = _ref;return typed(setDistinct_name, { "Array | Matrix": function (a) {var result;if (0 === subset(size(a), new Index(0))) result = [];else {var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);result = [], result.push(b[0]);for (var i = 1; i < b.length; i++) 0 !== compareNatural(b[i], b[i - 1]) && result.push(b[i]);}return Array.isArray(a) ? result : new DenseMatrix(result);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setPowerset.js
var setPowerset_name = "setPowerset",setPowerset_dependencies = ["typed", "size", "subset", "compareNatural", "Index"];var createSetPowerset = factory("setPowerset", setPowerset_dependencies, (_ref) => {function _subset(array, bitarray) {for (var result = [], i = 0; i < bitarray.length; i++) "1" === bitarray[i] && result.push(array[i]);return result;}function _sort(array) {for (var temp = [], i = array.length - 1; 0 < i; i--) for (var j = 0; j < i; j++) array[j].length > array[j + 1].length && (temp = array[j], array[j] = array[j + 1], array[j + 1] = temp);return array;}var { typed, size, subset, compareNatural, Index } = _ref;return typed(setPowerset_name, { "Array | Matrix": function (a) {if (0 === subset(size(a), new Index(0))) return [];for (var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural), result = [], number = 0; number.toString(2).length <= b.length;) result.push(_subset(b, number.toString(2).split("").reverse())), number++;return _sort(result);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/function/index.js
var function_name = "index",function_dependencies = ["typed", "Index"];var createIndex = factory("index", function_dependencies, (_ref) => {var { typed, Index } = _ref;return typed(function_name, { "...number | string | BigNumber | Range | Array | Matrix": function (args) {var ranges = args.map(function (arg) {return isBigNumber(arg) ? arg.toNumber() : Array.isArray(arg) || isMatrix(arg) ? arg.map(function (elem) {return isBigNumber(elem) ? elem.toNumber() : elem;}) : arg;}),res = new Index();return Index.apply(res, ranges), res;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/sum.js
var sum_name = "sum",sum_dependencies = ["typed", "config", "add", "numeric"];var createSum = factory("sum", sum_dependencies, (_ref) => {function _sum(array) {var sum;return deepForEach(array, function (value) {try {sum = void 0 === sum ? value : add(sum, value);} catch (err) {throw improveErrorMessage(err, "sum", value);}}), void 0 === sum && (sum = numeric(0, config.number)), "string" == typeof sum && (sum = numeric(sum, config.number)), sum;}var { typed, config, add, numeric } = _ref;return typed(sum_name, { "Array | Matrix": _sum, "Array | Matrix, number | BigNumber": function (array, dim) {try {var sum = reduce(array, dim, add);return sum;} catch (err) {throw improveErrorMessage(err, "sum");}}, "...": function (args) {if (containsCollections(args)) throw new TypeError("Scalar values expected in function sum");return _sum(args);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/factorial.js
var factorial_name = "factorial",factorial_dependencies = ["typed", "gamma"];var createFactorial = factory("factorial", factorial_dependencies, (_ref) => {var { typed, gamma } = _ref;return typed(factorial_name, { number: function (n) {if (0 > n) throw new Error("Value must be non-negative");return gamma(n + 1);}, BigNumber: function (n) {if (n.isNegative()) throw new Error("Value must be non-negative");return gamma(n.plus(1));}, "Array | Matrix": function (n) {return deepMap(n, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/permutations.js
var permutations_name = "permutations",permutations_dependencies = ["typed", "factorial"];var createPermutations = factory("permutations", permutations_dependencies, (_ref) => {var { typed, factorial } = _ref;return typed(permutations_name, { "number | BigNumber": factorial, "number, number": function (n, k) {if (!isInteger(n) || 0 > n) throw new TypeError("Positive integer value expected in function permutations");if (!isInteger(k) || 0 > k) throw new TypeError("Positive integer value expected in function permutations");if (k > n) throw new TypeError("second argument k must be less than or equal to first argument n");return product_product(n - k + 1, n);}, "BigNumber, BigNumber": function (n, k) {var result, i;if (!permutations_isPositiveInteger(n) || !permutations_isPositiveInteger(k)) throw new TypeError("Positive integer value expected in function permutations");if (k.gt(n)) throw new TypeError("second argument k must be less than or equal to first argument n");var one = n.mul(0).add(1);for (result = one, i = n.minus(k).plus(1); i.lte(n); i = i.plus(1)) result = result.times(i);return result;} });});function permutations_isPositiveInteger(n) {return n.isInteger() && n.gte(0);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/matrixFromRows.js
var matrixFromRows_name = "matrixFromRows",matrixFromRows_dependencies = ["typed", "matrix", "flatten", "size"];var createMatrixFromRows = factory("matrixFromRows", matrixFromRows_dependencies, (_ref) => {function _createArray(arr) {if (0 === arr.length) throw new TypeError("At least one row is needed to construct a matrix.");var N = checkVectorTypeAndReturnLength(arr[0]),result = [];for (var row of arr) {var rowLength = checkVectorTypeAndReturnLength(row);if (rowLength !== N) throw new TypeError("The vectors had different length: " + (0 | N) + " \u2260 " + (0 | rowLength));result.push(flatten(row));}return result;}function checkVectorTypeAndReturnLength(vec) {var s = size(vec);if (1 === s.length) return s[0];if (2 === s.length) {if (1 === s[0]) return s[1];if (1 === s[1]) return s[0];throw new TypeError("At least one of the arguments is not a vector.");} else throw new TypeError("Only one- or two-dimensional vectors are supported.");}var { typed, matrix, flatten, size } = _ref;return typed(matrixFromRows_name, { "...Array": function (arr) {return _createArray(arr);}, "...Matrix": function (arr) {return matrix(_createArray(arr.map((m) => m.toArray())));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/subtract.js
var subtract_name = "subtract",subtract_dependencies = ["typed", "matrix", "equalScalar", "addScalar", "unaryMinus", "DenseMatrix"];var createSubtract = factory("subtract", subtract_dependencies, (_ref) => {var { typed, matrix, equalScalar, addScalar, unaryMinus, DenseMatrix } = _ref,algorithm01 = createAlgorithm01({ typed }),algorithm03 = createAlgorithm03({ typed }),algorithm05 = createAlgorithm05({ typed, equalScalar }),algorithm10 = createAlgorithm10({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(subtract_name, { "number, number": function (x, y) {return x - y;}, "Complex, Complex": function (x, y) {return x.sub(y);}, "BigNumber, BigNumber": function (x, y) {return x.minus(y);}, "Fraction, Fraction": function (x, y) {return x.sub(y);}, "Unit, Unit": function (x, y) {if (null === x.value) throw new Error("Parameter x contains a unit with undefined value");if (null === y.value) throw new Error("Parameter y contains a unit with undefined value");if (!x.equalBase(y)) throw new Error("Units do not match");var res = x.clone();return res.value = this(res.value, y.value), res.fixPrefix = !1, res;}, "SparseMatrix, SparseMatrix": function (x, y) {return checkEqualDimensions(x, y), algorithm05(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return checkEqualDimensions(x, y), algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return checkEqualDimensions(x, y), algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return checkEqualDimensions(x, y), algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm10(x, unaryMinus(y), addScalar);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this);}, "any, SparseMatrix": function (x, y) {return algorithm10(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});function checkEqualDimensions(x, y) {var xsize = x.size(),ysize = y.size();if (xsize.length !== ysize.length) throw new DimensionError(xsize.length, ysize.length);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/cross.js
var cross_name = "cross",cross_dependencies = ["typed", "matrix", "subtract", "multiply"];var createCross = factory("cross", cross_dependencies, (_ref) => {function _cross(x, y) {var highestDimension = Math.max(arraySize(x).length, arraySize(y).length);x = squeeze(x), y = squeeze(y);var xSize = arraySize(x),ySize = arraySize(y);if (1 !== xSize.length || 1 !== ySize.length || 3 !== xSize[0] || 3 !== ySize[0]) throw new RangeError("Vectors with length 3 expected (Size A = [" + xSize.join(", ") + "], B = [" + ySize.join(", ") + "])");var product = [subtract(multiply(x[1], y[2]), multiply(x[2], y[1])), subtract(multiply(x[2], y[0]), multiply(x[0], y[2])), subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))];return 1 < highestDimension ? [product] : product;}var { typed, matrix, subtract, multiply } = _ref;return typed(cross_name, { "Matrix, Matrix": function (x, y) {return matrix(_cross(x.toArray(), y.toArray()));}, "Matrix, Array": function (x, y) {return matrix(_cross(x.toArray(), y));}, "Array, Matrix": function (x, y) {return matrix(_cross(x, y.toArray()));}, "Array, Array": _cross });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/range.js
var range_name = "range",range_dependencies = ["typed", "config", "?matrix", "?bignumber", "smaller", "smallerEq", "larger", "largerEq"];var createRange = factory("range", range_dependencies, (_ref) => {function _out(arr) {return "Matrix" === config.matrix ? matrix ? matrix(arr) : noMatrix() : arr;}function _strRange(str, includeEnd) {var r = _parse(str);if (!r) throw new SyntaxError("String \"" + str + "\" is no valid range");var fn;return "BigNumber" === config.number ? (void 0 === bignumber && noBignumber(), fn = includeEnd ? _bigRangeInc : _bigRangeEx, _out(fn(bignumber(r.start), bignumber(r.end), bignumber(r.step)))) : (fn = includeEnd ? _rangeInc : _rangeEx, _out(fn(r.start, r.end, r.step)));}function _rangeEx(start, end, step) {var array = [],x = start;if (0 < step) for (; smaller(x, end);) array.push(x), x += step;else if (0 > step) for (; larger(x, end);) array.push(x), x += step;return array;}function _rangeInc(start, end, step) {var array = [],x = start;if (0 < step) for (; smallerEq(x, end);) array.push(x), x += step;else if (0 > step) for (; largerEq(x, end);) array.push(x), x += step;return array;}function _bigRangeEx(start, end, step) {var zero = bignumber(0),array = [],x = start;if (step.gt(zero)) for (; smaller(x, end);) array.push(x), x = x.plus(step);else if (step.lt(zero)) for (; larger(x, end);) array.push(x), x = x.plus(step);return array;}function _bigRangeInc(start, end, step) {var zero = bignumber(0),array = [],x = start;if (step.gt(zero)) for (; smallerEq(x, end);) array.push(x), x = x.plus(step);else if (step.lt(zero)) for (; largerEq(x, end);) array.push(x), x = x.plus(step);return array;}function _parse(str) {var args = str.split(":"),nums = args.map(function (arg) {return +arg;}),invalid = nums.some(function (num) {return isNaN(num);});if (invalid) return null;switch (nums.length) {case 2:return { start: nums[0], end: nums[1], step: 1 };case 3:return { start: nums[0], end: nums[2], step: nums[1] };default:return null;}}var { typed, config, matrix, bignumber, smaller, smallerEq, larger, largerEq } = _ref;return typed(range_name, { string: _strRange, "string, boolean": _strRange, "number, number": function (start, end) {return _out(_rangeEx(start, end, 1));}, "number, number, number": function (start, end, step) {return _out(_rangeEx(start, end, step));}, "number, number, boolean": function (start, end, includeEnd) {return includeEnd ? _out(_rangeInc(start, end, 1)) : _out(_rangeEx(start, end, 1));}, "number, number, number, boolean": function (start, end, step, includeEnd) {return includeEnd ? _out(_rangeInc(start, end, step)) : _out(_rangeEx(start, end, step));}, "BigNumber, BigNumber": function (start, end) {var BigNumber = start.constructor;return _out(_bigRangeEx(start, end, new BigNumber(1)));}, "BigNumber, BigNumber, BigNumber": function (start, end, step) {return _out(_bigRangeEx(start, end, step));}, "BigNumber, BigNumber, boolean": function (start, end, includeEnd) {var BigNumber = start.constructor;return includeEnd ? _out(_bigRangeInc(start, end, new BigNumber(1))) : _out(_bigRangeEx(start, end, new BigNumber(1)));}, "BigNumber, BigNumber, BigNumber, boolean": function (start, end, step, includeEnd) {return includeEnd ? _out(_bigRangeInc(start, end, step)) : _out(_bigRangeEx(start, end, step));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/row.js
var row_name = "row",row_dependencies = ["typed", "Index", "matrix", "range"];var createRow = factory("row", row_dependencies, (_ref) => {function _row(value, row) {if (2 !== value.size().length) throw new Error("Only two dimensional matrix is supported");validateIndex(row, value.size()[0]);var columnRange = range(0, value.size()[1]),index = new Index(row, columnRange);return value.subset(index);}var { typed, Index, matrix, range } = _ref;return typed(row_name, { "Matrix, number": _row, "Array, number": function (value, row) {return _row(matrix(clone(value)), row).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/prod.js
var prod_name = "prod",prod_dependencies = ["typed", "config", "multiplyScalar", "numeric"];var createProd = factory("prod", prod_dependencies, (_ref) => {function _prod(array) {var prod;if (deepForEach(array, function (value) {try {prod = void 0 === prod ? value : multiplyScalar(prod, value);} catch (err) {throw improveErrorMessage(err, "prod", value);}}), "string" == typeof prod && (prod = numeric(prod, config.number)), void 0 === prod) throw new Error("Cannot calculate prod of an empty array");return prod;}var { typed, config, multiplyScalar, numeric } = _ref;return typed(prod_name, { "Array | Matrix": _prod, "Array | Matrix, number | BigNumber": function () {throw new Error("prod(A, dim) is not yet supported");}, "...": function (args) {return _prod(args);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/equal.js
var equal_name = "equal",equal_dependencies = ["typed", "matrix", "equalScalar", "DenseMatrix"];var createEqual = factory("equal", equal_dependencies, (_ref) => {var { typed, matrix, equalScalar, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(equal_name, { "any, any": function (x, y) {return null === x ? null === y : null === y ? null === x : void 0 === x ? void 0 === y : void 0 === y ? void 0 === x : equalScalar(x, y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, equalScalar);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, equalScalar, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, equalScalar, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, equalScalar);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, equalScalar, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, equalScalar, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, equalScalar, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, equalScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, equalScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, equalScalar, !0).valueOf();} });});var createEqualNumber = factory("equal", ["typed", "equalScalar"], (_ref2) => {var { typed, equalScalar } = _ref2;return typed(equal_name, { "any, any": function (x, y) {return null === x ? null === y : null === y ? null === x : void 0 === x ? void 0 === y : void 0 === y ? void 0 === x : equalScalar(x, y);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/max.js
var max_name = "max",max_dependencies = ["typed", "config", "numeric", "larger"];var createMax = factory("max", max_dependencies, (_ref) => {function _largest(x, y) {try {return larger(x, y) ? x : y;} catch (err) {throw improveErrorMessage(err, "max", y);}}function _max(array) {var res;if (deepForEach(array, function (value) {try {isNaN(value) && "number" == typeof value ? res = NaN : (void 0 === res || larger(value, res)) && (res = value);} catch (err) {throw improveErrorMessage(err, "max", value);}}), void 0 === res) throw new Error("Cannot calculate max of an empty array");return "string" == typeof res && (res = numeric(res, config.number)), res;}var { typed, config, numeric, larger } = _ref;return typed(max_name, { "Array | Matrix": _max, "Array | Matrix, number | BigNumber": function (array, dim) {return reduce(array, dim.valueOf(), _largest);}, "...": function (args) {if (containsCollections(args)) throw new TypeError("Scalar values expected in function max");return _max(args);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setCartesian.js
var setCartesian_name = "setCartesian",setCartesian_dependencies = ["typed", "size", "subset", "compareNatural", "Index", "DenseMatrix"];var createSetCartesian = factory("setCartesian", setCartesian_dependencies, (_ref) => {var { typed, size, subset, compareNatural, Index, DenseMatrix } = _ref;return typed(setCartesian_name, { "Array | Matrix, Array | Matrix": function (a1, a2) {var result = [];if (0 !== subset(size(a1), new Index(0)) && 0 !== subset(size(a2), new Index(0))) {var b1 = flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural),b2 = flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural);result = [];for (var i = 0; i < b1.length; i++) for (var j = 0; j < b2.length; j++) result.push([b1[i], b2[j]]);}return Array.isArray(a1) && Array.isArray(a2) ? result : new DenseMatrix(result);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setSymDifference.js
var setSymDifference_name = "setSymDifference",setSymDifference_dependencies = ["typed", "size", "concat", "subset", "setDifference", "Index"];var createSetSymDifference = factory("setSymDifference", setSymDifference_dependencies, (_ref) => {var { typed, size, concat, subset, setDifference, Index } = _ref;return typed(setSymDifference_name, { "Array | Matrix, Array | Matrix": function (a1, a2) {if (0 === subset(size(a1), new Index(0))) return flatten(a2);if (0 === subset(size(a2), new Index(0))) return flatten(a1);var b1 = flatten(a1),b2 = flatten(a2);return concat(setDifference(b1, b2), setDifference(b2, b1));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/ceil.js
var ceil_name = "ceil",ceil_dependencies = ["typed", "config", "round", "matrix", "equalScalar"];var createCeil = factory("ceil", ceil_dependencies, (_ref) => {var { typed, config, round, matrix, equalScalar } = _ref,algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm14 = createAlgorithm14({ typed });return typed("ceil", { number: function (x) {return nearlyEqual(x, round(x), config.epsilon) ? round(x) : ceilNumber(x);}, "number, number": function (x, n) {if (nearlyEqual(x, round(x, n), config.epsilon)) return round(x, n);var [number, exponent] = "".concat(x, "e").split("e"),result = Math.ceil(+"".concat(number, "e").concat(+exponent + n));return [number, exponent] = "".concat(result, "e").split("e"), +"".concat(number, "e").concat(+exponent - n);}, Complex: function (x) {return x.ceil();}, "Complex, number": function (x, n) {return x.ceil(n);}, BigNumber: function (x) {return nearlyEqual_nearlyEqual(x, round(x), config.epsilon) ? round(x) : x.ceil();}, "BigNumber, BigNumber": function (x, n) {return nearlyEqual_nearlyEqual(x, round(x, n), config.epsilon) ? round(x, n) : x.toDecimalPlaces(n.toNumber(), decimal["default"].ROUND_CEIL);}, Fraction: function (x) {return x.ceil();}, "Fraction, number": function (x, n) {return x.ceil(n);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, "Array | Matrix, number": function (x, n) {return deepMap(x, (i) => this(i, n), !0);}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | Complex | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/logical/xor.js
var xor_name = "xor",xor_dependencies = ["typed", "matrix", "DenseMatrix"];var createXor = factory("xor", xor_dependencies, (_ref) => {var { typed, matrix, DenseMatrix } = _ref,algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(xor_name, { "number, number": xorNumber, "Complex, Complex": function (x, y) {return (0 !== x.re || 0 !== x.im) != (0 !== y.re || 0 !== y.im);}, "BigNumber, BigNumber": function (x, y) {return (!x.isZero() && !x.isNaN()) != (!y.isZero() && !y.isNaN());}, "Unit, Unit": function (x, y) {return this(x.value || 0, y.value || 0);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/count.js
var count_name = "count",count_dependencies = ["typed", "size", "prod"];var createCount = factory("count", count_dependencies, (_ref) => {var { typed, size, prod } = _ref;return typed(count_name, { string: function (x) {return x.length;}, "Matrix | Array": function (x) {return prod(size(x));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/ctranspose.js
var ctranspose_name = "ctranspose",ctranspose_dependencies = ["typed", "transpose", "conj"];var createCtranspose = factory("ctranspose", ctranspose_dependencies, (_ref) => {var { typed, transpose, conj } = _ref;return typed(ctranspose_name, { any: function (x) {return conj(transpose(x));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/relational/deepEqual.js
var deepEqual_name = "deepEqual",deepEqual_dependencies = ["typed", "equal"];var createDeepEqual = factory("deepEqual", deepEqual_dependencies, (_ref) => {function _deepEqual(x, y) {if (Array.isArray(x)) {if (Array.isArray(y)) {var len = x.length;if (len !== y.length) return !1;for (var i = 0; i < len; i++) if (!_deepEqual(x[i], y[i])) return !1;return !0;}return !1;}return !Array.isArray(y) && equal(x, y);}var { typed, equal } = _ref;return typed(deepEqual_name, { "any, any": function (x, y) {return _deepEqual(x.valueOf(), y.valueOf());} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setIsSubset.js
var setIsSubset_name = "setIsSubset",setIsSubset_dependencies = ["typed", "size", "subset", "compareNatural", "Index"];var createSetIsSubset = factory("setIsSubset", setIsSubset_dependencies, (_ref) => {var { typed, size, subset, compareNatural, Index } = _ref;return typed(setIsSubset_name, { "Array | Matrix, Array | Matrix": function (a1, a2) {if (0 === subset(size(a1), new Index(0))) return !0;if (0 === subset(size(a2), new Index(0))) return !1;for (var inb2, b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)), b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural)), i = 0; i < b1.length; i++) {inb2 = !1;for (var j = 0; j < b2.length; j++) if (0 === compareNatural(b1[i].value, b2[j].value) && b1[i].identifier === b2[j].identifier) {inb2 = !0;break;}if (!1 === inb2) return !1;}return !0;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/fix.js
var fix_name = "fix",fix_dependencies = ["typed", "Complex", "matrix", "ceil", "floor"];var createFix = factory("fix", fix_dependencies, (_ref) => {var { typed, Complex: _Complex, matrix, ceil, floor } = _ref,algorithm14 = createAlgorithm14({ typed });return typed("fix", { number: function (x) {return 0 < x ? floor(x) : ceil(x);}, "number, number | BigNumber": function (x, n) {return 0 < x ? floor(x, n) : ceil(x, n);}, Complex: function (x) {return new _Complex(0 < x.re ? Math.floor(x.re) : Math.ceil(x.re), 0 < x.im ? Math.floor(x.im) : Math.ceil(x.im));}, "Complex, number | BigNumber": function (x, n) {return new _Complex(0 < x.re ? floor(x.re, n) : ceil(x.re, n), 0 < x.im ? floor(x.im, n) : ceil(x.im, n));}, BigNumber: function (x) {return x.isNegative() ? ceil(x) : floor(x);}, "BigNumber, number | BigNumber": function (x, n) {return x.isNegative() ? ceil(x, n) : floor(x, n);}, Fraction: function (x) {return 0 > x.s ? x.ceil() : x.floor();}, "Fraction, number | BigNumber": function (x, n) {return 0 > x.s ? x.ceil(n) : x.floor(n);}, "Array | Matrix": function (x) {return deepMap(x, this, !0);}, "Array | Matrix, number | BigNumber": function (x, n) {return deepMap(x, (i) => this(i, n), !0);}, "number | Complex | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/diff.js
var diff_name = "diff",diff_dependencies = ["typed", "matrix", "subtract", "number"];var createDiff = factory("diff", diff_dependencies, (_ref) => {function _recursive(arr, dim) {if (isMatrix(arr) && (arr = arr.toArray()), !Array.isArray(arr)) throw RangeError("Array/Matrix does not have that many dimensions");if (0 < dim) {var result = [];return arr.forEach((element) => {result.push(_recursive(element, dim - 1));}), result;}if (0 === dim) return _diff(arr);throw RangeError("Cannot have negative dimension");}function _diff(arr) {var result = [],size = arr.length;if (2 > size) return arr;for (var i = 1; i < size; i++) result.push(_ElementDiff(arr[i - 1], arr[i]));return result;}function _ElementDiff(obj1, obj2) {isMatrix(obj1) && (obj1 = obj1.toArray()), isMatrix(obj2) && (obj2 = obj2.toArray());var obj1IsArray = Array.isArray(obj1),obj2IsArray = Array.isArray(obj2);if (obj1IsArray && obj2IsArray) return _ArrayDiff(obj1, obj2);if (!obj1IsArray && !obj2IsArray) return subtract(obj2, obj1);throw TypeError("Cannot calculate difference between 1 array and 1 non-array");}function _ArrayDiff(arr1, arr2) {if (arr1.length !== arr2.length) throw RangeError("Not all sub-arrays have the same length");for (var result = [], size = arr1.length, i = 0; i < size; i++) result.push(_ElementDiff(arr1[i], arr2[i]));return result;}var { typed, matrix, subtract, number } = _ref;return typed(diff_name, { "Array | Matrix": function (arr) {return isMatrix(arr) ? matrix(_diff(arr.toArray())) : _diff(arr);}, "Array | Matrix, number": function (arr, dim) {if (!isInteger(dim)) throw new RangeError("Dimension must be a whole number");return isMatrix(arr) ? matrix(_recursive(arr.toArray(), dim)) : _recursive(arr, dim);}, "Array | Matrix, BigNumber": function (arr, dim) {return this(arr, number(dim));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/divideScalar.js
var divideScalar_name = "divideScalar",divideScalar_dependencies = ["typed", "numeric"];var createDivideScalar = factory("divideScalar", divideScalar_dependencies, (_ref) => {var { typed, numeric } = _ref;return typed(divideScalar_name, { "number, number": function (x, y) {return x / y;}, "Complex, Complex": function (x, y) {return x.div(y);}, "BigNumber, BigNumber": function (x, y) {return x.div(y);}, "Fraction, Fraction": function (x, y) {return x.div(y);}, "Unit, number | Fraction | BigNumber": function (x, y) {var res = x.clone(),one = numeric(1, typeOf(y));return res.value = this(null === res.value ? res._normalize(one) : res.value, y), res;}, "number | Fraction | BigNumber, Unit": function (x, y) {var res = y.clone();res = res.pow(-1);var one = numeric(1, typeOf(x));return res.value = this(x, null === y.value ? y._normalize(one) : y.value), res;}, "Unit, Unit": function (x, y) {return x.divide(y);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/nthRoots.js
var nthRoots_name = "nthRoots",nthRoots_dependencies = ["config", "typed", "divideScalar", "Complex"];var createNthRoots = factory("nthRoots", nthRoots_dependencies, (_ref) => {function _nthComplexRoots(a, root) {if (0 > root) throw new Error("Root must be greater than zero");if (0 === root) throw new Error("Root must be non-zero");if (0 != root % 1) throw new Error("Root must be an integer");if (0 === a || 0 === a.abs()) return [new Complex(0, 0)];var offset,aIsNumeric = "number" == typeof a;(aIsNumeric || 0 === a.re || 0 === a.im) && (aIsNumeric ? offset = 2 * +(0 > a) : 0 === a.im ? offset = 2 * +(0 > a.re) : offset = 2 * +(0 > a.im) + 1);for (var halfPiFactor, arg = a.arg(), abs = a.abs(), roots = [], r = Math.pow(abs, 1 / root), k = 0; k < root; k++) {if (halfPiFactor = (offset + 4 * k) / root, halfPiFactor === Math.round(halfPiFactor)) {roots.push(_calculateExactResult[halfPiFactor % 4](r));continue;}roots.push(new Complex({ r: r, phi: (arg + 2 * Math.PI * k) / root }));}return roots;}var { typed, config, divideScalar, Complex } = _ref,_calculateExactResult = [function (val) {return new Complex(val, 0);}, function (val) {return new Complex(0, val);}, function (val) {return new Complex(-val, 0);}, function (val) {return new Complex(0, -val);}];return typed(nthRoots_name, { Complex: function (x) {return _nthComplexRoots(x, 2);}, "Complex, number": _nthComplexRoots });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/solver/utils/solveValidation.js
function createSolveValidation(_ref) {var { DenseMatrix } = _ref;return function (m, b, copy) {var mSize = m.size();if (2 !== mSize.length) throw new RangeError("Matrix must be two dimensional (size: " + string_format(mSize) + ")");var rows = mSize[0],columns = mSize[1];if (rows !== columns) throw new RangeError("Matrix must be square (size: " + string_format(mSize) + ")");var data = [];if (isMatrix(b)) {var bSize = b.size(),bdata = b._data;if (1 === bSize.length) {if (bSize[0] !== rows) throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for (var i = 0; i < rows; i++) data[i] = [bdata[i]];return new DenseMatrix({ data: data, size: [rows, 1], datatype: b._datatype });}if (2 === bSize.length) {if (bSize[0] !== rows || 1 !== bSize[1]) throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if (isDenseMatrix(b)) {if (copy) {data = [];for (var _i = 0; _i < rows; _i++) data[_i] = [bdata[_i][0]];return new DenseMatrix({ data: data, size: [rows, 1], datatype: b._datatype });}return b;}if (isSparseMatrix(b)) {for (var _i2 = 0; _i2 < rows; _i2++) data[_i2] = [0];for (var _i3, values = b._values, index = b._index, ptr = b._ptr, k1 = ptr[1], k = ptr[0]; k < k1; k++) _i3 = index[k], data[_i3][0] = values[k];return new DenseMatrix({ data: data, size: [rows, 1], datatype: b._datatype });}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.");}if (isArray(b)) {var bsize = arraySize(b);if (1 === bsize.length) {if (bsize[0] !== rows) throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for (var _i4 = 0; _i4 < rows; _i4++) data[_i4] = [b[_i4]];return new DenseMatrix({ data: data, size: [rows, 1] });}if (2 === bsize.length) {if (bsize[0] !== rows || 1 !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for (var _i5 = 0; _i5 < rows; _i5++) data[_i5] = [b[_i5][0]];return new DenseMatrix({ data: data, size: [rows, 1] });}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.");}};}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/solver/lsolve.js
var lsolve_name = "lsolve",lsolve_dependencies = ["typed", "matrix", "divideScalar", "multiplyScalar", "subtract", "equalScalar", "DenseMatrix"];var createLsolve = factory("lsolve", lsolve_dependencies, (_ref) => {function _denseForwardSubstitution(m, b) {b = solveValidation(m, b, !0);for (var bdata = b._data, rows = m._size[0], columns = m._size[1], x = [], mdata = m._data, j = 0; j < columns; j++) {var bj = bdata[j][0] || 0,xj = void 0;if (!equalScalar(bj, 0)) {var vjj = mdata[j][j];if (equalScalar(vjj, 0)) throw new Error("Linear system cannot be solved since matrix is singular");xj = divideScalar(bj, vjj);for (var i = j + 1; i < rows; i++) bdata[i] = [subtract(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];} else xj = 0;x[j] = [xj];}return new DenseMatrix({ data: x, size: [rows, 1] });}function _sparseForwardSubstitution(m, b) {b = solveValidation(m, b, !0);for (var bj, bdata = b._data, rows = m._size[0], columns = m._size[1], values = m._values, index = m._index, ptr = m._ptr, x = [], j = 0; j < columns; j++) if (bj = bdata[j][0] || 0, !equalScalar(bj, 0)) {for (var i, vjj = 0, jValues = [], jIndices = [], firstIndex = ptr[j], lastIndex = ptr[j + 1], k = firstIndex; k < lastIndex; k++) i = index[k], i === j ? vjj = values[k] : i > j && (jValues.push(values[k]), jIndices.push(i));if (equalScalar(vjj, 0)) throw new Error("Linear system cannot be solved since matrix is singular");for (var _i, xj = divideScalar(bj, vjj), _k = 0, l = jIndices.length; _k < l; _k++) _i = jIndices[_k], bdata[_i] = [subtract(bdata[_i][0] || 0, multiplyScalar(xj, jValues[_k]))];x[j] = [xj];} else x[j] = [0];return new DenseMatrix({ data: x, size: [rows, 1] });}var { typed, matrix, divideScalar, multiplyScalar, subtract, equalScalar, DenseMatrix } = _ref,solveValidation = createSolveValidation({ DenseMatrix });return typed(lsolve_name, { "SparseMatrix, Array | Matrix": function (m, b) {return _sparseForwardSubstitution(m, b);}, "DenseMatrix, Array | Matrix": function (m, b) {return _denseForwardSubstitution(m, b);}, "Array, Array | Matrix": function (a, b) {var m = matrix(a),r = _denseForwardSubstitution(m, b);return r.valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/solver/lsolveAll.js
var lsolveAll_name = "lsolveAll",lsolveAll_dependencies = ["typed", "matrix", "divideScalar", "multiplyScalar", "subtract", "equalScalar", "DenseMatrix"];var createLsolveAll = factory("lsolveAll", lsolveAll_dependencies, (_ref) => {function _denseForwardSubstitution(m, b_) {for (var L, B = [solveValidation(m, b_, !0)._data.map((e) => e[0])], M = m._data, rows = m._size[0], columns = m._size[1], i = 0; i < columns; i++) {L = B.length;for (var b, k = 0; k < L; k++) if (b = B[k], !equalScalar(M[i][i], 0)) {b[i] = divideScalar(b[i], M[i][i]);for (var j = i + 1; j < columns; j++) b[j] = subtract(b[j], multiplyScalar(b[i], M[j][i]));} else if (!equalScalar(b[i], 0)) {if (0 === k) return [];B.splice(k, 1), k -= 1, L -= 1;} else if (0 === k) {var bNew = [...b];bNew[i] = 1;for (var _j = i + 1; _j < columns; _j++) bNew[_j] = subtract(bNew[_j], M[_j][i]);B.push(bNew);}}return B.map((x) => new DenseMatrix({ data: x.map((e) => [e]), size: [rows, 1] }));}function _sparseForwardSubstitution(m, b_) {for (var L, B = [solveValidation(m, b_, !0)._data.map((e) => e[0])], rows = m._size[0], columns = m._size[1], values = m._values, index = m._index, ptr = m._ptr, i = 0; i < columns; i++) {L = B.length;for (var k = 0; k < L; k++) {for (var J, b = B[k], iValues = [], iIndices = [], firstIndex = ptr[i], lastIndex = ptr[i + 1], Mii = 0, j = firstIndex; j < lastIndex; j++) J = index[j], J === i ? Mii = values[j] : J > i && (iValues.push(values[j]), iIndices.push(J));if (!equalScalar(Mii, 0)) {b[i] = divideScalar(b[i], Mii);for (var _J, _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) _J = iIndices[_j2], b[_J] = subtract(b[_J], multiplyScalar(b[i], iValues[_j2]));} else if (!equalScalar(b[i], 0)) {if (0 === k) return [];B.splice(k, 1), k -= 1, L -= 1;} else if (0 === k) {var bNew = [...b];bNew[i] = 1;for (var _J2, _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) _J2 = iIndices[_j3], bNew[_J2] = subtract(bNew[_J2], iValues[_j3]);B.push(bNew);}}}return B.map((x) => new DenseMatrix({ data: x.map((e) => [e]), size: [rows, 1] }));}var { typed, matrix, divideScalar, multiplyScalar, subtract, equalScalar, DenseMatrix } = _ref,solveValidation = createSolveValidation({ DenseMatrix });return typed(lsolveAll_name, { "SparseMatrix, Array | Matrix": function (m, b) {return _sparseForwardSubstitution(m, b);}, "DenseMatrix, Array | Matrix": function (m, b) {return _denseForwardSubstitution(m, b);}, "Array, Array | Matrix": function (a, b) {var m = matrix(a),R = _denseForwardSubstitution(m, b);return R.map((r) => r.valueOf());} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/matrix/Spa.js
var Spa_name = "Spa",Spa_dependencies = ["addScalar", "equalScalar", "FibonacciHeap"];var createSpaClass = factory("Spa", Spa_dependencies, (_ref) => {function Spa() {if (!(this instanceof Spa)) throw new SyntaxError("Constructor must be called with the new operator");this._values = [], this._heap = new FibonacciHeap();}var { addScalar, equalScalar, FibonacciHeap } = _ref;return Spa.prototype.type = "Spa", Spa.prototype.isSpa = !0, Spa.prototype.set = function (i, v) {if (!this._values[i]) {var node = this._heap.insert(i, v);this._values[i] = node;} else this._values[i].value = v;}, Spa.prototype.get = function (i) {var node = this._values[i];return node ? node.value : 0;}, Spa.prototype.accumulate = function (i, v) {var node = this._values[i];node ? node.value = addScalar(node.value, v) : (node = this._heap.insert(i, v), this._values[i] = node);}, Spa.prototype.forEach = function (from, to, callback) {var heap = this._heap,values = this._values,nodes = [],node = heap.extractMinimum();for (node && nodes.push(node); node && node.key <= to;) node.key >= from && !equalScalar(node.value, 0) && callback(node.key, node.value, this), node = heap.extractMinimum(), node && nodes.push(node);for (var n, i = 0; i < nodes.length; i++) n = nodes[i], node = heap.insert(n.key, n.value), values[node.key] = node;}, Spa.prototype.swap = function (i, j) {var nodei = this._values[i],nodej = this._values[j];if (!nodei && nodej) nodei = this._heap.insert(i, nodej.value), this._heap.remove(nodej), this._values[i] = nodei, this._values[j] = void 0;else if (nodei && !nodej) nodej = this._heap.insert(j, nodei.value), this._heap.remove(nodei), this._values[j] = nodej, this._values[i] = void 0;else if (nodei && nodej) {var v = nodei.value;nodei.value = nodej.value, nodej.value = v;}}, Spa;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/set/setUnion.js
var setUnion_name = "setUnion",setUnion_dependencies = ["typed", "size", "concat", "subset", "setIntersect", "setSymDifference", "Index"];var createSetUnion = factory("setUnion", setUnion_dependencies, (_ref) => {var { typed, size, concat, subset, setIntersect, setSymDifference, Index } = _ref;return typed(setUnion_name, { "Array | Matrix, Array | Matrix": function (a1, a2) {if (0 === subset(size(a1), new Index(0))) return flatten(a2);if (0 === subset(size(a2), new Index(0))) return flatten(a1);var b1 = flatten(a1),b2 = flatten(a2);return concat(setSymDifference(b1, b2), setIntersect(b1, b2));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/decomposition/lup.js
var lup_name = "lup",lup_dependencies = ["typed", "matrix", "abs", "addScalar", "divideScalar", "multiplyScalar", "subtract", "larger", "equalScalar", "unaryMinus", "DenseMatrix", "SparseMatrix", "Spa"];var createLup = factory("lup", lup_dependencies, (_ref) => {function _denseLUP(m) {var i,j,k,rows = m._size[0],columns = m._size[1],n = Math.min(rows, columns),data = clone(m._data),ldata = [],lsize = [rows, n],udata = [],usize = [n, columns],p = [];for (i = 0; i < rows; i++) p[i] = i;for (j = 0; j < columns; j++) {if (0 < j) for (i = 0; i < rows; i++) {var min = Math.min(i, j),s = 0;for (k = 0; k < min; k++) s = addScalar(s, multiplyScalar(data[i][k], data[k][j]));data[i][j] = subtract(data[i][j], s);}var pi = j,pabsv = 0,vjj = 0;for (i = j; i < rows; i++) {var v = data[i][j],absv = abs(v);larger(absv, pabsv) && (pi = i, pabsv = absv, vjj = v);}if (j !== pi && (p[j] = p[pi], DenseMatrix._swapRows(j, pi, data)), j < rows) for (i = j + 1; i < rows; i++) {var vij = data[i][j];equalScalar(vij, 0) || (data[i][j] = divideScalar(data[i][j], vjj));}}for (j = 0; j < columns; j++) for (i = 0; i < rows; i++) {if (0 === j && (i < columns && (udata[i] = []), ldata[i] = []), i < j) {i < columns && (udata[i][j] = data[i][j]), j < rows && (ldata[i][j] = 0);continue;}if (i === j) {i < columns && (udata[i][j] = data[i][j]), j < rows && (ldata[i][j] = 1);continue;}i < columns && (udata[i][j] = 0), j < rows && (ldata[i][j] = data[i][j]);}var l = new DenseMatrix({ data: ldata, size: lsize }),u = new DenseMatrix({ data: udata, size: usize }),pv = [];for (i = 0, n = p.length; i < n; i++) pv[p[i]] = i;return { L: l, U: u, p: pv, toString: function () {return "L: " + this.L.toString() + "\nU: " + this.U.toString() + "\nP: " + this.p;} };}function _sparseLUP(m) {var i,j,k,rows = m._size[0],columns = m._size[1],n = Math.min(rows, columns),values = m._values,index = m._index,ptr = m._ptr,lvalues = [],lindex = [],lptr = [],lsize = [rows, n],uvalues = [],uindex = [],uptr = [],usize = [n, columns],pvCo = [],pvOc = [];for (i = 0; i < rows; i++) pvCo[i] = i, pvOc[i] = i;var swapIndeces = function swapIndeces(x, y) {var kx = pvOc[x],ky = pvOc[y];pvCo[kx] = y, pvCo[ky] = x, pvOc[x] = ky, pvOc[y] = kx;},_loop = function _loop() {var spa = new Spa();j < rows && (lptr.push(lvalues.length), lvalues.push(1), lindex.push(j)), uptr.push(uvalues.length);var k0 = ptr[j],k1 = ptr[j + 1];for (k = k0; k < k1; k++) i = index[k], spa.set(pvCo[i], values[k]);0 < j && spa.forEach(0, j - 1, function (k, vkj) {SparseMatrix._forEachRow(k, lvalues, lindex, lptr, function (i, vik) {i > k && spa.accumulate(i, unaryMinus(multiplyScalar(vik, vkj)));});});var pi = j,vjj = spa.get(j),pabsv = abs(vjj);spa.forEach(j + 1, rows - 1, function (x, v) {var absv = abs(v);larger(absv, pabsv) && (pi = x, pabsv = absv, vjj = v);}), j !== pi && (SparseMatrix._swapRows(j, pi, lsize[1], lvalues, lindex, lptr), SparseMatrix._swapRows(j, pi, usize[1], uvalues, uindex, uptr), spa.swap(j, pi), swapIndeces(j, pi)), spa.forEach(0, rows - 1, function (x, v) {x <= j ? (uvalues.push(v), uindex.push(x)) : (v = divideScalar(v, vjj), !equalScalar(v, 0) && (lvalues.push(v), lindex.push(x)));});};for (j = 0; j < columns; j++) _loop();return uptr.push(uvalues.length), lptr.push(lvalues.length), { L: new SparseMatrix({ values: lvalues, index: lindex, ptr: lptr, size: lsize }), U: new SparseMatrix({ values: uvalues, index: uindex, ptr: uptr, size: usize }), p: pvCo, toString: function toString() {return "L: " + this.L.toString() + "\nU: " + this.U.toString() + "\nP: " + this.p;} };}var { typed, matrix, abs, addScalar, divideScalar, multiplyScalar, subtract, larger, equalScalar, unaryMinus, DenseMatrix, SparseMatrix, Spa } = _ref;return typed(lup_name, { DenseMatrix: function DenseMatrix(m) {return _denseLUP(m);}, SparseMatrix: function SparseMatrix(m) {return _sparseLUP(m);}, Array: function Array(a) {var m = matrix(a),r = _denseLUP(m);return { L: r.L.valueOf(), U: r.U.valueOf(), p: r.p };} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csPermute.js
function csPermute(a, pinv, q, values) {for (var avalues = a._values, aindex = a._index, aptr = a._ptr, asize = a._size, adt = a._datatype, m = asize[0], n = asize[1], cvalues = values && a._values ? [] : null, cindex = [], cptr = [], nz = 0, k = 0; k < n; k++) {cptr[k] = nz;for (var r, j = q ? q[k] : k, t0 = aptr[j], t1 = aptr[j + 1], t = t0; t < t1; t++) r = pinv ? pinv[aindex[t]] : aindex[t], cindex[nz] = r, cvalues && (cvalues[nz] = avalues[t]), nz++;}return cptr[n] = nz, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [m, n], datatype: adt });}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csTdfs.js
function csTdfs(j, k, w, head, next, post, stack) {var top = 0;for (w[stack] = j; 0 <= top;) {var p = w[stack + top],i = w[head + p];-1 === i ? (top--, post[k++] = p) : (w[head + p] = w[next + i], ++top, w[stack + top] = i);}return k;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csPost.js
function csPost(parent, n) {if (!parent) return null;var j,k = 0,post = [],w = [],head = 0,next = n;for (j = 0; j < n; j++) w[head + j] = -1;for (j = n - 1; 0 <= j; j--) -1 !== parent[j] && (w[next + j] = w[head + parent[j]], w[head + parent[j]] = j);for (j = 0; j < n; j++) -1 === parent[j] && (k = csTdfs(j, k, w, head, next, post, 2 * n));return post;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csEtree.js
function csEtree(a, ata) {if (!a) return null;var i,inext,aindex = a._index,aptr = a._ptr,asize = a._size,m = asize[0],n = asize[1],parent = [],w = [],ancestor = 0,prev = n;if (ata) for (i = 0; i < m; i++) w[prev + i] = -1;for (var k = 0; k < n; k++) {parent[k] = -1, w[ancestor + k] = -1;for (var r, p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {for (r = aindex[p], i = ata ? w[prev + r] : r; -1 !== i && i < k; i = inext) inext = w[ancestor + i], w[ancestor + i] = k, -1 === inext && (parent[i] = k);ata && (w[prev + r] = k);}}return parent;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csFkeep.js
function csFkeep(a, callback, other) {for (var p, avalues = a._values, aindex = a._index, aptr = a._ptr, asize = a._size, n = asize[1], nz = 0, j = 0; j < n; j++) for (p = aptr[j], aptr[j] = nz; p < aptr[j + 1]; p++) callback(aindex[p], j, avalues ? avalues[p] : 1, other) && (aindex[nz] = aindex[p], avalues && (avalues[nz] = avalues[p]), nz++);return aptr[n] = nz, aindex.splice(nz, aindex.length - nz), avalues && avalues.splice(nz, avalues.length - nz), nz;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csFlip.js
function csFlip(i) {return -i - 2;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csAmd.js
var csAmd_name = "csAmd",csAmd_dependencies = ["add", "multiply", "transpose"];var createCsAmd = factory("csAmd", csAmd_dependencies, (_ref) => {function _createTargetMatrix(order, a, m, n, dense) {var at = transpose(a);if (1 === order && n === m) return add(a, at);if (2 === order) {for (var p, tindex = at._index, tptr = at._ptr, p2 = 0, j = 0; j < m; j++) if (p = tptr[j], tptr[j] = p2, !(tptr[j + 1] - p > dense)) for (var p1 = tptr[j + 1]; p < p1; p++) tindex[p2++] = tindex[p];return tptr[m] = p2, a = transpose(at), multiply(at, a);}return multiply(at, a);}function _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree) {for (var k = 0; k < n; k++) W[len + k] = cptr[k + 1] - cptr[k];W[len + n] = 0;for (var i = 0; i <= n; i++) W[head + i] = -1, last[i] = -1, W[next + i] = -1, W[hhead + i] = -1, W[nv + i] = 1, W[w + i] = 1, W[elen + i] = 0, W[degree + i] = W[len + i];var mark = _wclear(0, 0, W, w, n);return W[elen + n] = -2, cptr[n] = -1, W[w + n] = 0, mark;}function _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next) {for (var d, nel = 0, i = 0; i < n; i++) if (d = W[degree + i], 0 === d) W[elen + i] = -2, nel++, cptr[i] = -1, W[w + i] = 0;else if (d > dense) W[nv + i] = 0, W[elen + i] = -1, nel++, cptr[i] = csFlip(n), W[nv + n]++;else {var h = W[head + d];-1 !== h && (last[h] = i), W[next + i] = W[head + d], W[head + d] = i;}return nel;}function _wclear(mark, lemax, W, w, n) {if (2 > mark || 0 > mark + lemax) {for (var k = 0; k < n; k++) 0 !== W[w + k] && (W[w + k] = 1);mark = 2;}return mark;}function _diag(i, j) {return i !== j;}var { add, multiply, transpose } = _ref;return function (order, a) {if (!a || 0 >= order || 3 < order) return null;var asize = a._size,m = asize[0],n = asize[1],lemax = 0,dense = Math.max(16, 10 * Math.sqrt(n));dense = Math.min(n - 2, dense);var cm = _createTargetMatrix(order, a, m, n, dense);csFkeep(cm, _diag, null);for (var i, j, k, k1, k2, e, pj, ln, nvi, pk, eln, p1, p2, pn, h, d, cindex = cm._index, cptr = cm._ptr, cnz = cptr[n], P = [], W = [], len = 0, nv = n + 1, next = 2 * (n + 1), head = 3 * (n + 1), elen = 4 * (n + 1), degree = 5 * (n + 1), w = 6 * (n + 1), hhead = 7 * (n + 1), last = P, mark = _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree), nel = _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next), mindeg = 0; nel < n;) {for (k = -1; mindeg < n && -1 === (k = W[head + mindeg]); mindeg++);-1 !== W[next + k] && (last[W[next + k]] = -1), W[head + mindeg] = W[next + k];var elenk = W[elen + k],nvk = W[nv + k];nel += nvk;var dk = 0;W[nv + k] = -nvk;var p = cptr[k],pk1 = 0 === elenk ? p : cnz,pk2 = pk1;for (k1 = 1; k1 <= elenk + 1; k1++) {for (k1 > elenk ? (e = k, pj = p, ln = W[len + k] - elenk) : (e = cindex[p++], pj = cptr[e], ln = W[len + e]), k2 = 1; k2 <= ln; k2++) (i = cindex[pj++], !(0 >= (nvi = W[nv + i]))) && (dk += nvi, W[nv + i] = -nvi, cindex[pk2++] = i, -1 !== W[next + i] && (last[W[next + i]] = last[i]), -1 === last[i] ? W[head + W[degree + i]] = W[next + i] : W[next + last[i]] = W[next + i]);e !== k && (cptr[e] = csFlip(k), W[w + e] = 0);}for (0 !== elenk && (cnz = pk2), W[degree + k] = dk, cptr[k] = pk1, W[len + k] = pk2 - pk1, W[elen + k] = -2, mark = _wclear(mark, lemax, W, w, n), pk = pk1; pk < pk2; pk++) if (i = cindex[pk], !(0 >= (eln = W[elen + i]))) {nvi = -W[nv + i];var wnvi = mark - nvi;for (p = cptr[i], p1 = cptr[i] + eln - 1; p <= p1; p++) e = cindex[p], W[w + e] >= mark ? W[w + e] -= nvi : 0 !== W[w + e] && (W[w + e] = W[degree + e] + wnvi);}for (pk = pk1; pk < pk2; pk++) {for (i = cindex[pk], p1 = cptr[i], p2 = p1 + W[elen + i] - 1, pn = p1, (h = 0, d = 0, p = p1); p <= p2; p++) if (e = cindex[p], 0 !== W[w + e]) {var dext = W[w + e] - mark;0 < dext ? (d += dext, cindex[pn++] = e, h += e) : (cptr[e] = csFlip(k), W[w + e] = 0);}W[elen + i] = pn - p1 + 1;var p3 = pn,p4 = p1 + W[len + i];for (p = p2 + 1; p < p4; p++) {j = cindex[p];var nvj = W[nv + j];0 >= nvj || (d += nvj, cindex[pn++] = j, h += j);}0 === d ? (cptr[i] = csFlip(k), nvi = -W[nv + i], dk -= nvi, nvk += nvi, nel += nvi, W[nv + i] = 0, W[elen + i] = -1) : (W[degree + i] = Math.min(W[degree + i], d), cindex[pn] = cindex[p3], cindex[p3] = cindex[p1], cindex[p1] = k, W[len + i] = pn - p1 + 1, h = (0 > h ? -h : h) % n, W[next + i] = W[hhead + h], W[hhead + h] = i, last[i] = h);}for (W[degree + k] = dk, lemax = Math.max(lemax, dk), mark = _wclear(mark + lemax, lemax, W, w, n), pk = pk1; pk < pk2; pk++) if (i = cindex[pk], !(0 <= W[nv + i])) for (h = last[i], i = W[hhead + h], W[hhead + h] = -1; -1 !== i && -1 !== W[next + i]; i = W[next + i], mark++) {for (ln = W[len + i], eln = W[elen + i], p = cptr[i] + 1; p <= cptr[i] + ln - 1; p++) W[w + cindex[p]] = mark;var jlast = i;for (j = W[next + i]; -1 !== j;) {var ok = W[len + j] === ln && W[elen + j] === eln;for (p = cptr[j] + 1; ok && p <= cptr[j] + ln - 1; p++) W[w + cindex[p]] !== mark && (ok = 0);ok ? (cptr[j] = csFlip(i), W[nv + i] += W[nv + j], W[nv + j] = 0, W[elen + j] = -1, j = W[next + j], W[next + jlast] = j) : (jlast = j, j = W[next + j]);}}for (p = pk1, pk = pk1; pk < pk2; pk++) (i = cindex[pk], !(0 >= (nvi = -W[nv + i]))) && (W[nv + i] = nvi, d = W[degree + i] + dk - nvi, d = Math.min(d, n - nel - nvi), -1 !== W[head + d] && (last[W[head + d]] = i), W[next + i] = W[head + d], last[i] = -1, W[head + d] = i, mindeg = Math.min(mindeg, d), W[degree + i] = d, cindex[p++] = i);W[nv + k] = nvk, 0 == (W[len + k] = p - pk1) && (cptr[k] = -1, W[w + k] = 0), 0 !== elenk && (cnz = p);}for (i = 0; i < n; i++) cptr[i] = csFlip(cptr[i]);for (j = 0; j <= n; j++) W[head + j] = -1;for (j = n; 0 <= j; j--) 0 < W[nv + j] || (W[next + j] = W[head + cptr[j]], W[head + cptr[j]] = j);for (e = n; 0 <= e; e--) 0 >= W[nv + e] || -1 !== cptr[e] && (W[next + e] = W[head + cptr[e]], W[head + cptr[e]] = e);for (k = 0, i = 0; i <= n; i++) -1 === cptr[i] && (k = csTdfs(i, k, W, head, next, P, w));return P.splice(P.length - 1, 1), P;};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csLeaf.js
function csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor) {var s,sparent,q,jleaf = 0;if (i <= j || w[first + j] <= w[maxfirst + i]) return -1;w[maxfirst + i] = w[first + j];var jprev = w[prevleaf + i];if (w[prevleaf + i] = j, -1 === jprev) jleaf = 1, q = i;else {for (jleaf = 2, q = jprev; q !== w[ancestor + q]; q = w[ancestor + q]);for (s = jprev; s !== q; s = sparent) sparent = w[ancestor + s], w[ancestor + s] = q;}return { jleaf: jleaf, q: q };}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csCounts.js
var csCounts_name = "csCounts",csCounts_dependencies = ["transpose"];var createCsCounts = factory("csCounts", csCounts_dependencies, (_ref) => {var { transpose } = _ref;return function (a, parent, post, ata) {if (!a || !parent || !post) return null;var i,j,k,J,p,p0,p1,asize = a._size,m = asize[0],n = asize[1],s = 4 * n + (ata ? n + m + 1 : 0),w = [],ancestor = 0,first = 3 * n,head = 4 * n,next = 5 * n + 1;for (k = 0; k < s; k++) w[k] = -1;var colcount = [],at = transpose(a),tindex = at._index,tptr = at._ptr;for (k = 0; k < n; k++) for (j = post[k], colcount[j] = -1 === w[first + j] ? 1 : 0; -1 !== j && -1 === w[first + j]; j = parent[j]) w[first + j] = k;if (ata) {for (k = 0; k < n; k++) w[post[k]] = k;for (i = 0; i < m; i++) {for (k = n, p0 = tptr[i], p1 = tptr[i + 1], p = p0; p < p1; p++) k = Math.min(k, w[tindex[p]]);w[next + i] = w[head + k], w[head + k] = i;}}for (i = 0; i < n; i++) w[ancestor + i] = i;for (k = 0; k < n; k++) {for (j = post[k], -1 !== parent[j] && colcount[parent[j]]--, J = ata ? w[head + k] : j; -1 !== J; J = ata ? w[next + J] : -1) for (p = tptr[J]; p < tptr[J + 1]; p++) {i = tindex[p];var r = csLeaf(i, j, w, first, n, 2 * n, ancestor);1 <= r.jleaf && colcount[j]++, 2 === r.jleaf && colcount[r.q]--;}-1 !== parent[j] && (w[ancestor + j] = parent[j]);}for (j = 0; j < n; j++) -1 !== parent[j] && (colcount[parent[j]] += colcount[j]);return colcount;};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csSqr.js
var csSqr_name = "csSqr",csSqr_dependencies = ["add", "multiply", "transpose"];var createCsSqr = factory("csSqr", csSqr_dependencies, (_ref) => {function _vcount(a, s) {var aptr = a._ptr,aindex = a._index,asize = a._size,m = asize[0],n = asize[1];s.pinv = [], s.leftmost = [];var i,k,p,p0,p1,parent = s.parent,pinv = s.pinv,leftmost = s.leftmost,w = [],next = 0,head = m,tail = m + n,nque = m + 2 * n;for (k = 0; k < n; k++) w[head + k] = -1, w[tail + k] = -1, w[nque + k] = 0;for (i = 0; i < m; i++) leftmost[i] = -1;for (k = n - 1; 0 <= k; k--) for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) leftmost[aindex[p]] = k;for (i = m - 1; 0 <= i; i--) (pinv[i] = -1, k = leftmost[i], -1 !== k) && (0 == w[nque + k]++ && (w[tail + k] = i), w[next + i] = w[head + k], w[head + k] = i);for (s.lnz = 0, s.m2 = m, k = 0; k < n; k++) if (i = w[head + k], s.lnz++, 0 > i && (i = s.m2++), pinv[i] = k, !(0 >= --nque[k])) {s.lnz += w[nque + k];var pa = parent[k];-1 !== pa && (0 === w[nque + pa] && (w[tail + pa] = w[tail + k]), w[next + w[tail + k]] = w[head + pa], w[head + pa] = w[next + i], w[nque + pa] += w[nque + k]);}for (i = 0; i < m; i++) 0 > pinv[i] && (pinv[i] = k++);return !0;}var { add, multiply, transpose } = _ref,csAmd = createCsAmd({ add, multiply, transpose }),csCounts = createCsCounts({ transpose });return function (order, a, qr) {var k,aptr = a._ptr,asize = a._size,n = asize[1],s = {};if (s.q = csAmd(order, a), order && !s.q) return null;if (qr) {var c = order ? csPermute(a, null, s.q, 0) : a;s.parent = csEtree(c, 1);var post = csPost(s.parent, n);if (s.cp = csCounts(c, s.parent, post, 1), c && s.parent && s.cp && _vcount(c, s)) for (s.unz = 0, k = 0; k < n; k++) s.unz += s.cp[k];} else s.unz = 4 * aptr[n] + n, s.lnz = s.unz;return s;};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csMarked.js
function csMarked(w, j) {return 0 > w[j];}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csMark.js
function csMark(w, j) {w[j] = csFlip(w[j]);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csUnflip.js
function csUnflip(i) {return 0 > i ? csFlip(i) : i;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csDfs.js
function csDfs(j, g, top, xi, pinv) {var i,p,p2,index = g._index,ptr = g._ptr,size = g._size,n = size[1],head = 0;for (xi[0] = j; 0 <= head;) {j = xi[head];var jnew = pinv ? pinv[j] : j;csMarked(ptr, j) || (csMark(ptr, j), xi[n + head] = 0 > jnew ? 0 : csUnflip(ptr[jnew]));var done = 1;for (p = xi[n + head], p2 = 0 > jnew ? 0 : csUnflip(ptr[jnew + 1]); p < p2; p++) if (i = index[p], !csMarked(ptr, i)) {xi[n + head] = p, xi[++head] = i, done = 0;break;}done && (head--, xi[--top] = j);}return top;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csReach.js
function csReach(g, b, k, xi, pinv) {var p,p0,p1,gptr = g._ptr,gsize = g._size,bindex = b._index,bptr = b._ptr,n = gsize[1],top = n;for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {var i = bindex[p];csMarked(gptr, i) || (top = csDfs(i, g, top, xi, pinv));}for (p = top; p < n; p++) csMark(gptr, xi[p]);return top;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csSpsolve.js
var csSpsolve_name = "csSpsolve",csSpsolve_dependencies = ["divideScalar", "multiply", "subtract"];var createCsSpsolve = factory("csSpsolve", csSpsolve_dependencies, (_ref) => {var { divideScalar, multiply, subtract } = _ref;return function (g, b, k, xi, x, pinv, lo) {var p,p0,p1,q,gvalues = g._values,gindex = g._index,gptr = g._ptr,gsize = g._size,n = gsize[1],bvalues = b._values,bindex = b._index,bptr = b._ptr,top = csReach(g, b, k, xi, pinv);for (p = top; p < n; p++) x[xi[p]] = 0;for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) x[bindex[p]] = bvalues[p];for (var px = top; px < n; px++) {var j = xi[px],J = pinv ? pinv[j] : j;if (!(0 > J)) for (p0 = gptr[J], p1 = gptr[J + 1], x[j] = divideScalar(x[j], gvalues[lo ? p0 : p1 - 1]), p = lo ? p0 + 1 : p0, q = lo ? p1 : p1 - 1; p < q; p++) {var i = gindex[p];x[i] = subtract(x[i], multiply(gvalues[p], x[j]));}}return top;};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csLu.js
var csLu_name = "csLu",csLu_dependencies = ["abs", "divideScalar", "multiply", "subtract", "larger", "largerEq", "SparseMatrix"];var createCsLu = factory("csLu", csLu_dependencies, (_ref) => {var { abs, divideScalar, multiply, subtract, larger, largerEq, SparseMatrix } = _ref,csSpsolve = createCsSpsolve({ divideScalar, multiply, subtract });return function (m, s, tol) {if (!m) return null;var q,size = m._size,n = size[1],lnz = 100,unz = 100;s && (q = s.q, lnz = s.lnz || lnz, unz = s.unz || unz);var i,p,lvalues = [],lindex = [],lptr = [],L = new SparseMatrix({ values: lvalues, index: lindex, ptr: lptr, size: [n, n] }),uvalues = [],uindex = [],uptr = [],U = new SparseMatrix({ values: uvalues, index: uindex, ptr: uptr, size: [n, n] }),pinv = [],x = [],xi = [];for (i = 0; i < n; i++) x[i] = 0, pinv[i] = -1, lptr[i + 1] = 0;lnz = 0, unz = 0;for (var k = 0; k < n; k++) {lptr[k] = lnz, uptr[k] = unz;var col = q ? q[k] : k,top = csSpsolve(L, m, col, xi, x, pinv, 1),ipiv = -1,a = -1;for (p = top; p < n; p++) if (i = xi[p], 0 > pinv[i]) {var xabs = abs(x[i]);larger(xabs, a) && (a = xabs, ipiv = i);} else uindex[unz] = pinv[i], uvalues[unz++] = x[i];if (-1 === ipiv || 0 >= a) return null;0 > pinv[col] && largerEq(abs(x[col]), multiply(a, tol)) && (ipiv = col);var pivot = x[ipiv];for (uindex[unz] = k, uvalues[unz++] = pivot, pinv[ipiv] = k, lindex[lnz] = ipiv, lvalues[lnz++] = 1, p = top; p < n; p++) i = xi[p], 0 > pinv[i] && (lindex[lnz] = i, lvalues[lnz++] = divideScalar(x[i], pivot)), x[i] = 0;}for (lptr[n] = lnz, uptr[n] = unz, p = 0; p < lnz; p++) lindex[p] = pinv[lindex[p]];return lvalues.splice(lnz, lvalues.length - lnz), lindex.splice(lnz, lindex.length - lnz), uvalues.splice(unz, uvalues.length - unz), uindex.splice(unz, uindex.length - unz), { L: L, U: U, pinv: pinv };};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/decomposition/slu.js
var slu_name = "slu",slu_dependencies = ["typed", "abs", "add", "multiply", "transpose", "divideScalar", "subtract", "larger", "largerEq", "SparseMatrix"];var createSlu = factory("slu", slu_dependencies, (_ref) => {var { typed, abs, add, multiply, transpose, divideScalar, subtract, larger, largerEq, SparseMatrix } = _ref,csSqr = createCsSqr({ add, multiply, transpose }),csLu = createCsLu({ abs, divideScalar, multiply, subtract, larger, largerEq, SparseMatrix });return typed(slu_name, { "SparseMatrix, number, number": function (a, order, threshold) {if (!isInteger(order) || 0 > order || 3 < order) throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if (0 > threshold || 1 < threshold) throw new Error("Partial pivoting threshold must be a number from 0 to 1");var s = csSqr(order, a, !1),f = csLu(a, s, threshold);return { L: f.L, U: f.U, p: f.pinv, q: s.q, toString: function () {return "L: " + this.L.toString() + "\nU: " + this.U.toString() + "\np: " + this.p.toString() + (this.q ? "\nq: " + this.q.toString() : "") + "\n";} };} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/det.js
var det_name = "det",det_dependencies = ["typed", "matrix", "subtract", "multiply", "unaryMinus", "lup"];var createDet = factory("det", det_dependencies, (_ref) => {function _det(matrix, rows) {if (1 === rows) return clone(matrix[0][0]);if (2 === rows) return subtract(multiply(matrix[0][0], matrix[1][1]), multiply(matrix[1][0], matrix[0][1]));for (var decomp = lup(matrix), det = decomp.U[0][0], _i = 1; _i < rows; _i++) det = multiply(det, decomp.U[_i][_i]);for (var evenCycles = 0, i = 0, visited = [];;) {for (; visited[i];) i++;if (i >= rows) break;for (var j = i, cycleLen = 0; !visited[decomp.p[j]];) visited[decomp.p[j]] = !0, j = decomp.p[j], cycleLen++;0 == cycleLen % 2 && evenCycles++;}return 0 == evenCycles % 2 ? det : unaryMinus(det);}var { typed, matrix, subtract, multiply, unaryMinus, lup } = _ref;return typed(det_name, { any: function (x) {return clone(x);}, "Array | Matrix": function (x) {var size;switch (isMatrix(x) ? size = x.size() : Array.isArray(x) ? (x = matrix(x), size = x.size()) : size = [], size.length) {case 0:return clone(x);case 1:if (1 === size[0]) return clone(x.valueOf()[0]);throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");case 2:{var rows = size[0],cols = size[1];if (rows === cols) return _det(x.clone().valueOf(), rows, cols);throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");}default:throw new RangeError("Matrix must be two dimensional (size: " + string_format(size) + ")");}} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/geometry/distance.js
var distance_name = "distance",distance_dependencies = ["typed", "addScalar", "subtract", "divideScalar", "multiplyScalar", "unaryMinus", "sqrt", "abs"];var createDistance = factory("distance", distance_dependencies, (_ref) => {function _isNumber(a) {return "number" == typeof a || isBigNumber(a);}function _2d(a) {return a.constructor !== Array && (a = _objectToArray(a)), _isNumber(a[0]) && _isNumber(a[1]);}function _3d(a) {return a.constructor !== Array && (a = _objectToArray(a)), _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]);}function _containsOnlyNumbers(a) {return Array.isArray(a) || (a = _objectToArray(a)), a.every(_isNumber);}function _parametricLine(a) {return a.constructor !== Array && (a = _objectToArray(a)), _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]) && _isNumber(a[3]) && _isNumber(a[4]) && _isNumber(a[5]);}function _objectToArray(o) {for (var keys = Object.keys(o), a = [], i = 0; i < keys.length; i++) a.push(o[keys[i]]);return a;}function _pairwise(a) {if (2 === a[0].length && _isNumber(a[0][0]) && _isNumber(a[0][1])) {if (a.some((aI) => 2 !== aI.length || !_isNumber(aI[0]) || !_isNumber(aI[1]))) return !1;} else if (!(3 === a[0].length && _isNumber(a[0][0]) && _isNumber(a[0][1]) && _isNumber(a[0][2]))) return !1;else if (a.some((aI) => 3 !== aI.length || !_isNumber(aI[0]) || !_isNumber(aI[1]) || !_isNumber(aI[2]))) return !1;return !0;}function _distancePointLine2D(x, y, a, b, c) {var num = abs(addScalar(addScalar(multiplyScalar(a, x), multiplyScalar(b, y)), c)),den = sqrt(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)));return divideScalar(num, den);}function _distancePointLine3D(x, y, z, x0, y0, z0, a, b, c) {var num = [subtract(multiplyScalar(subtract(y0, y), c), multiplyScalar(subtract(z0, z), b)), subtract(multiplyScalar(subtract(z0, z), a), multiplyScalar(subtract(x0, x), c)), subtract(multiplyScalar(subtract(x0, x), b), multiplyScalar(subtract(y0, y), a))];num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2])));var den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c)));return divideScalar(num, den);}function _euclideanDistance(x, y) {for (var vectorSize = x.length, result = 0, diff = 0, i = 0; i < vectorSize; i++) diff = subtract(x[i], y[i]), result = addScalar(multiplyScalar(diff, diff), result);return sqrt(result);}function _distancePairwise(a) {for (var result = [], pointA = [], pointB = [], i = 0; i < a.length - 1; i++) for (var j = i + 1; j < a.length; j++) 2 === a[0].length ? (pointA = [a[i][0], a[i][1]], pointB = [a[j][0], a[j][1]]) : 3 === a[0].length && (pointA = [a[i][0], a[i][1], a[i][2]], pointB = [a[j][0], a[j][1], a[j][2]]), result.push(_euclideanDistance(pointA, pointB));return result;}var { typed, addScalar, subtract, multiplyScalar, divideScalar, unaryMinus, sqrt, abs } = _ref;return typed(distance_name, { "Array, Array, Array": function (x, y, z) {if (2 === x.length && 2 === y.length && 2 === z.length) {if (!_2d(x)) throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if (!_2d(y)) throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if (!_2d(z)) throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var m = divideScalar(subtract(z[1], z[0]), subtract(y[1], y[0])),xCoeff = multiplyScalar(multiplyScalar(m, m), y[0]),yCoeff = unaryMinus(multiplyScalar(m, y[0])),constant = x[1];return _distancePointLine2D(x[0], x[1], xCoeff, yCoeff, constant);}throw new TypeError("Invalid Arguments: Try again");}, "Object, Object, Object": function (x, y, z) {if (2 === Object.keys(x).length && 2 === Object.keys(y).length && 2 === Object.keys(z).length) {if (!_2d(x)) throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if (!_2d(y)) throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if (!_2d(z)) throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if ("pointX" in x && "pointY" in x && "lineOnePtX" in y && "lineOnePtY" in y && "lineTwoPtX" in z && "lineTwoPtY" in z) {var m = divideScalar(subtract(z.lineTwoPtY, z.lineTwoPtX), subtract(y.lineOnePtY, y.lineOnePtX)),xCoeff = multiplyScalar(multiplyScalar(m, m), y.lineOnePtX),yCoeff = unaryMinus(multiplyScalar(m, y.lineOnePtX)),constant = x.pointX;return _distancePointLine2D(x.pointX, x.pointY, xCoeff, yCoeff, constant);}throw new TypeError("Key names do not match");} else throw new TypeError("Invalid Arguments: Try again");}, "Array, Array": function (x, y) {if (2 === x.length && 3 === y.length) {if (!_2d(x)) throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if (!_3d(y)) throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return _distancePointLine2D(x[0], x[1], y[0], y[1], y[2]);}if (3 === x.length && 6 === y.length) {if (!_3d(x)) throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if (!_parametricLine(y)) throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return _distancePointLine3D(x[0], x[1], x[2], y[0], y[1], y[2], y[3], y[4], y[5]);}if (x.length === y.length && 0 < x.length) {if (!_containsOnlyNumbers(x)) throw new TypeError("All values of an array should be numbers or BigNumbers");if (!_containsOnlyNumbers(y)) throw new TypeError("All values of an array should be numbers or BigNumbers");return _euclideanDistance(x, y);}throw new TypeError("Invalid Arguments: Try again");}, "Object, Object": function (x, y) {if (2 === Object.keys(x).length && 3 === Object.keys(y).length) {if (!_2d(x)) throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if (!_3d(y)) throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if ("pointX" in x && "pointY" in x && "xCoeffLine" in y && "yCoeffLine" in y && "constant" in y) return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant);throw new TypeError("Key names do not match");} else if (3 === Object.keys(x).length && 6 === Object.keys(y).length) {if (!_3d(x)) throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if (!_parametricLine(y)) throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if ("pointX" in x && "pointY" in x && "x0" in y && "y0" in y && "z0" in y && "a" in y && "b" in y && "c" in y) return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c);throw new TypeError("Key names do not match");} else if (2 === Object.keys(x).length && 2 === Object.keys(y).length) {if (!_2d(x)) throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if (!_2d(y)) throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if ("pointOneX" in x && "pointOneY" in x && "pointTwoX" in y && "pointTwoY" in y) return _euclideanDistance([x.pointOneX, x.pointOneY], [y.pointTwoX, y.pointTwoY]);throw new TypeError("Key names do not match");} else if (3 === Object.keys(x).length && 3 === Object.keys(y).length) {if (!_3d(x)) throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if (!_3d(y)) throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if ("pointOneX" in x && "pointOneY" in x && "pointOneZ" in x && "pointTwoX" in y && "pointTwoY" in y && "pointTwoZ" in y) return _euclideanDistance([x.pointOneX, x.pointOneY, x.pointOneZ], [y.pointTwoX, y.pointTwoY, y.pointTwoZ]);throw new TypeError("Key names do not match");} else throw new TypeError("Invalid Arguments: Try again");}, Array: function (arr) {if (!_pairwise(arr)) throw new TypeError("Incorrect array format entered for pairwise distance calculation");return _distancePairwise(arr);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/combinatorics/stirlingS2.js
var stirlingS2_name = "stirlingS2",stirlingS2_dependencies = ["typed", "addScalar", "subtract", "multiplyScalar", "divideScalar", "pow", "factorial", "combinations", "isNegative", "isInteger", "larger"];var createStirlingS2 = factory("stirlingS2", stirlingS2_dependencies, (_ref) => {var { typed, addScalar, subtract, multiplyScalar, divideScalar, pow, factorial, combinations, isNegative, isInteger, larger } = _ref;return typed(stirlingS2_name, { "number | BigNumber, number | BigNumber": function (n, k) {if (!isInteger(n) || isNegative(n) || !isInteger(k) || isNegative(k)) throw new TypeError("Non-negative integer value expected in function stirlingS2");else if (larger(k, n)) throw new TypeError("k must be less than or equal to n in function stirlingS2");for (var kFactorial = factorial(k), result = 0, i = 0; i <= k; i++) {var negativeOne = pow(-1, subtract(k, i)),kChooseI = combinations(k, i),iPower = pow(i, n);result = addScalar(result, multiplyScalar(multiplyScalar(kChooseI, iPower), negativeOne));}return divideScalar(result, kFactorial);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/combinatorics/catalan.js
var catalan_name = "catalan",catalan_dependencies = ["typed", "addScalar", "divideScalar", "multiplyScalar", "combinations", "isNegative", "isInteger"];var createCatalan = factory("catalan", catalan_dependencies, (_ref) => {var { typed, addScalar, divideScalar, multiplyScalar, combinations, isNegative, isInteger } = _ref;return typed(catalan_name, { "number | BigNumber": function (n) {if (!isInteger(n) || isNegative(n)) throw new TypeError("Non-negative integer value expected in function catalan");return divideScalar(combinations(multiplyScalar(n, 2), n), addScalar(n, 1));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/column.js
var column_name = "column",column_dependencies = ["typed", "Index", "matrix", "range"];var createColumn = factory("column", column_dependencies, (_ref) => {function _column(value, column) {if (2 !== value.size().length) throw new Error("Only two dimensional matrix is supported");validateIndex(column, value.size()[1]);var rowRange = range(0, value.size()[0]),index = new Index(rowRange, column);return value.subset(index);}var { typed, Index, matrix, range } = _ref;return typed(column_name, { "Matrix, number": _column, "Array, number": function (value, column) {return _column(matrix(clone(value)), column).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/log.js
var log_name = "log",log_dependencies = ["config", "typed", "divideScalar", "Complex"];var createLog = factory("log", log_dependencies, (_ref) => {var { typed, config, divideScalar, Complex } = _ref;return typed(log_name, { number: function (x) {return 0 <= x || config.predictable ? logNumber(x) : new Complex(x, 0).log();}, Complex: function (x) {return x.log();}, BigNumber: function (x) {return !x.isNegative() || config.predictable ? x.ln() : new Complex(x.toNumber(), 0).log();}, "Array | Matrix": function (x) {return deepMap(x, this);}, "any, any": function (x, base) {return divideScalar(this(x), this(base));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/dotDivide.js
var dotDivide_name = "dotDivide",dotDivide_dependencies = ["typed", "matrix", "equalScalar", "divideScalar", "DenseMatrix"];var createDotDivide = factory("dotDivide", dotDivide_dependencies, (_ref) => {var { typed, matrix, equalScalar, divideScalar, DenseMatrix } = _ref,algorithm02 = createAlgorithm02({ typed, equalScalar }),algorithm03 = createAlgorithm03({ typed }),algorithm07 = createAlgorithm07({ typed, DenseMatrix }),algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm12 = createAlgorithm12({ typed, DenseMatrix }),algorithm13 = createAlgorithm13({ typed }),algorithm14 = createAlgorithm14({ typed });return typed(dotDivide_name, { "any, any": divideScalar, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, divideScalar, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, divideScalar, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, divideScalar, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, divideScalar);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, divideScalar, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, divideScalar, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, divideScalar, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, divideScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, divideScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, divideScalar, !0).valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/solver/usolveAll.js
var usolveAll_name = "usolveAll",usolveAll_dependencies = ["typed", "matrix", "divideScalar", "multiplyScalar", "subtract", "equalScalar", "DenseMatrix"];var createUsolveAll = factory("usolveAll", usolveAll_dependencies, (_ref) => {function _denseBackwardSubstitution(m, b_) {for (var L, B = [solveValidation(m, b_, !0)._data.map((e) => e[0])], M = m._data, rows = m._size[0], columns = m._size[1], i = columns - 1; 0 <= i; i--) {L = B.length;for (var b, k = 0; k < L; k++) if (b = B[k], !equalScalar(M[i][i], 0)) {b[i] = divideScalar(b[i], M[i][i]);for (var j = i - 1; 0 <= j; j--) b[j] = subtract(b[j], multiplyScalar(b[i], M[j][i]));} else if (!equalScalar(b[i], 0)) {if (0 === k) return [];B.splice(k, 1), k -= 1, L -= 1;} else if (0 === k) {var bNew = [...b];bNew[i] = 1;for (var _j = i - 1; 0 <= _j; _j--) bNew[_j] = subtract(bNew[_j], M[_j][i]);B.push(bNew);}}return B.map((x) => new DenseMatrix({ data: x.map((e) => [e]), size: [rows, 1] }));}function _sparseBackwardSubstitution(m, b_) {for (var L, B = [solveValidation(m, b_, !0)._data.map((e) => e[0])], rows = m._size[0], columns = m._size[1], values = m._values, index = m._index, ptr = m._ptr, i = columns - 1; 0 <= i; i--) {L = B.length;for (var k = 0; k < L; k++) {for (var J, b = B[k], iValues = [], iIndices = [], firstIndex = ptr[i], lastIndex = ptr[i + 1], Mii = 0, j = lastIndex - 1; j >= firstIndex; j--) J = index[j], J === i ? Mii = values[j] : J < i && (iValues.push(values[j]), iIndices.push(J));if (!equalScalar(Mii, 0)) {b[i] = divideScalar(b[i], Mii);for (var _J, _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) _J = iIndices[_j2], b[_J] = subtract(b[_J], multiplyScalar(b[i], iValues[_j2]));} else if (!equalScalar(b[i], 0)) {if (0 === k) return [];B.splice(k, 1), k -= 1, L -= 1;} else if (0 === k) {var bNew = [...b];bNew[i] = 1;for (var _J2, _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) _J2 = iIndices[_j3], bNew[_J2] = subtract(bNew[_J2], iValues[_j3]);B.push(bNew);}}}return B.map((x) => new DenseMatrix({ data: x.map((e) => [e]), size: [rows, 1] }));}var { typed, matrix, divideScalar, multiplyScalar, subtract, equalScalar, DenseMatrix } = _ref,solveValidation = createSolveValidation({ DenseMatrix });return typed(usolveAll_name, { "SparseMatrix, Array | Matrix": function (m, b) {return _sparseBackwardSubstitution(m, b);}, "DenseMatrix, Array | Matrix": function (m, b) {return _denseBackwardSubstitution(m, b);}, "Array, Array | Matrix": function (a, b) {var m = matrix(a),R = _denseBackwardSubstitution(m, b);return R.map((r) => r.valueOf());} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/hypot.js
var hypot_name = "hypot",hypot_dependencies = ["typed", "abs", "addScalar", "divideScalar", "multiplyScalar", "sqrt", "smaller", "isPositive"];var createHypot = factory("hypot", hypot_dependencies, (_ref) => {var { typed, abs, addScalar, divideScalar, multiplyScalar, sqrt, smaller, isPositive } = _ref;return typed(hypot_name, { "... number | BigNumber": function (args) {for (var value, result = 0, largest = 0, i = 0; i < args.length; i++) value = abs(args[i]), smaller(largest, value) ? (result = multiplyScalar(result, multiplyScalar(divideScalar(largest, value), divideScalar(largest, value))), result = addScalar(result, 1), largest = value) : result = addScalar(result, isPositive(value) ? multiplyScalar(divideScalar(value, largest), divideScalar(value, largest)) : value);return multiplyScalar(largest, sqrt(result));}, Array: function (x) {return this.apply(this, flatten(x));}, Matrix: function (x) {return this.apply(this, flatten(x.toArray()));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/decomposition/qr.js
var qr_name = "qr",qr_dependencies = ["typed", "matrix", "zeros", "identity", "isZero", "equal", "sign", "sqrt", "conj", "unaryMinus", "addScalar", "divideScalar", "multiplyScalar", "subtract", "complex"];var createQr = factory("qr", qr_dependencies, (_ref) => {function _denseQRimpl(m) {var i,j,k,rows = m._size[0],cols = m._size[1],Q = identity([rows], "dense"),Qdata = Q._data,R = m.clone(),Rdata = R._data,w = zeros([rows], "");for (k = 0; k < Math.min(cols, rows); ++k) {var pivot = Rdata[k][k],sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot)),conjSgn = conj(sgn),alphaSquared = 0;for (i = k; i < rows; i++) alphaSquared = addScalar(alphaSquared, multiplyScalar(Rdata[i][k], conj(Rdata[i][k])));var alpha = multiplyScalar(sgn, sqrt(alphaSquared));if (!isZero(alpha)) {var u1 = subtract(pivot, alpha);for (w[k] = 1, i = k + 1; i < rows; i++) w[i] = divideScalar(Rdata[i][k], u1);var tau = unaryMinus(conj(divideScalar(u1, alpha))),s = void 0;for (j = k; j < cols; j++) {for (s = 0, i = k; i < rows; i++) s = addScalar(s, multiplyScalar(conj(w[i]), Rdata[i][j]));for (s = multiplyScalar(s, tau), i = k; i < rows; i++) Rdata[i][j] = multiplyScalar(subtract(Rdata[i][j], multiplyScalar(w[i], s)), conjSgn);}for (i = 0; i < rows; i++) {for (s = 0, j = k; j < rows; j++) s = addScalar(s, multiplyScalar(Qdata[i][j], w[j]));for (s = multiplyScalar(s, tau), j = k; j < rows; ++j) Qdata[i][j] = divideScalar(subtract(Qdata[i][j], multiplyScalar(s, conj(w[j]))), conjSgn);}}}return { Q: Q, R: R, toString: function () {return "Q: " + this.Q.toString() + "\nR: " + this.R.toString();} };}function _denseQR(m) {var ret = _denseQRimpl(m),Rdata = ret.R._data;if (0 < m._data.length) for (var zero = "Complex" === Rdata[0][0].type ? complex(0) : 0, i = 0; i < Rdata.length; ++i) for (var j = 0; j < i && j < (Rdata[0] || []).length; ++j) Rdata[i][j] = zero;return ret;}function _sparseQR() {throw new Error("qr not implemented for sparse matrices yet");}var { typed, matrix, zeros, identity, isZero, equal, sign, sqrt, conj, unaryMinus, addScalar, divideScalar, multiplyScalar, subtract, complex } = _ref;return helpers_extends(typed(qr_name, { DenseMatrix: function (m) {return _denseQR(m);}, SparseMatrix: function (m) {return _sparseQR(m);}, Array: function (a) {var m = matrix(a),r = _denseQR(m);return { Q: r.Q.valueOf(), R: r.R.valueOf() };} }), { _denseQRimpl });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/inv.js
var inv_name = "inv",inv_dependencies = ["typed", "matrix", "divideScalar", "addScalar", "multiply", "unaryMinus", "det", "identity", "abs"];var createInv = factory("inv", inv_dependencies, (_ref) => {function _inv(mat, rows, cols) {var r, s, f, value, temp;if (1 === rows) {if (value = mat[0][0], 0 === value) throw Error("Cannot calculate inverse, determinant is zero");return [[divideScalar(1, value)]];}if (2 === rows) {var d = det(mat);if (0 === d) throw Error("Cannot calculate inverse, determinant is zero");return [[divideScalar(mat[1][1], d), divideScalar(unaryMinus(mat[0][1]), d)], [divideScalar(unaryMinus(mat[1][0]), d), divideScalar(mat[0][0], d)]];}var A = mat.concat();for (r = 0; r < rows; r++) A[r] = A[r].concat();for (var B = identity(rows).valueOf(), c = 0; c < cols; c++) {var ABig = abs(A[c][c]),rBig = c;for (r = c + 1; r < rows;) abs(A[r][c]) > ABig && (ABig = abs(A[r][c]), rBig = r), r++;if (0 === ABig) throw Error("Cannot calculate inverse, determinant is zero");r = rBig, r !== c && (temp = A[c], A[c] = A[r], A[r] = temp, temp = B[c], B[c] = B[r], B[r] = temp);var Ac = A[c],Bc = B[c];for (r = 0; r < rows; r++) {var Ar = A[r],Br = B[r];if (r === c) {for (f = Ac[c], s = c; s < cols; s++) Ar[s] = divideScalar(Ar[s], f);for (s = 0; s < cols; s++) Br[s] = divideScalar(Br[s], f);} else if (0 !== Ar[c]) {for (f = divideScalar(unaryMinus(Ar[c]), Ac[c]), s = c; s < cols; s++) Ar[s] = addScalar(Ar[s], multiply(f, Ac[s]));for (s = 0; s < cols; s++) Br[s] = addScalar(Br[s], multiply(f, Bc[s]));}}}return B;}var { typed, matrix, divideScalar, addScalar, multiply, unaryMinus, det, identity, abs } = _ref;return typed(inv_name, { "Array | Matrix": function (x) {var size = isMatrix(x) ? x.size() : arraySize(x);switch (size.length) {case 1:if (1 === size[0]) return isMatrix(x) ? matrix([divideScalar(1, x.valueOf()[0])]) : [divideScalar(1, x[0])];throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");case 2:{var rows = size[0],cols = size[1];if (rows === cols) return isMatrix(x) ? matrix(_inv(x.valueOf(), rows, cols), x.storage()) : _inv(x, rows, cols);throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");}default:throw new RangeError("Matrix must be two dimensional (size: " + string_format(size) + ")");}}, any: function (x) {return divideScalar(1, x);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/expm.js
var expm_name = "expm",expm_dependencies = ["typed", "abs", "add", "identity", "inv", "multiply"];var createExpm = factory("expm", expm_dependencies, (_ref) => {function infinityNorm(A) {for (var rowSum, n = A.size()[0], infNorm = 0, i = 0; i < n; i++) {rowSum = 0;for (var j = 0; j < n; j++) rowSum += abs(A.get([i, j]));infNorm = Math.max(rowSum, infNorm);}return infNorm;}function findParams(infNorm, eps) {for (var k = 0; k < 30; k++) for (var j, q = 0; q <= k; q++) if (j = k - q, errorEstimate(infNorm, q, j) < eps) return { q: q, j: j };throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)");}function errorEstimate(infNorm, q, j) {for (var qfac = 1, i = 2; i <= q; i++) qfac *= i;for (var twoqfac = qfac, _i2 = q + 1; _i2 <= 2 * q; _i2++) twoqfac *= _i2;var twoqp1fac = twoqfac * (2 * q + 1);return 8 * Math.pow(infNorm / Math.pow(2, j), 2 * q) * qfac * qfac / (twoqfac * twoqp1fac);}var { typed, abs, add, identity, inv, multiply } = _ref;return typed(expm_name, { Matrix: function (A) {var size = A.size();if (2 !== size.length || size[0] !== size[1]) throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");for (var n = size[0], infNorm = infinityNorm(A), params = findParams(infNorm, 1e-15), q = params.q, j = params.j, Apos = multiply(A, Math.pow(2, -j)), N = identity(n), D = identity(n), factor = 1, AposToI = Apos, alternate = -1, i = 1; i <= q; i++) 1 < i && (AposToI = multiply(AposToI, Apos), alternate = -alternate), factor = factor * (q - i + 1) / ((2 * q - i + 1) * i), N = add(N, multiply(factor, AposToI)), D = add(D, multiply(factor * alternate, AposToI));for (var R = multiply(inv(D), N), _i = 0; _i < j; _i++) R = multiply(R, R);return isSparseMatrix(A) ? A.createSparseMatrix(R) : R;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/divide.js
var divide_name = "divide",divide_dependencies = ["typed", "matrix", "multiply", "equalScalar", "divideScalar", "inv"];var createDivide = factory("divide", divide_dependencies, (_ref) => {var { typed, matrix, multiply, equalScalar, divideScalar, inv } = _ref,algorithm11 = createAlgorithm11({ typed, equalScalar }),algorithm14 = createAlgorithm14({ typed });return typed("divide", extend({ "Array | Matrix, Array | Matrix": function (x, y) {return multiply(x, inv(y));}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, divideScalar, !1);}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, divideScalar, !1);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, divideScalar, !1).valueOf();}, "any, Array | Matrix": function (x, y) {return multiply(x, inv(y));} }, divideScalar.signatures));});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/mean.js
var mean_name = "mean",mean_dependencies = ["typed", "add", "divide"];var createMean = factory("mean", mean_dependencies, (_ref) => {function _mean(array) {var sum,num = 0;if (deepForEach(array, function (value) {try {sum = void 0 === sum ? value : add(sum, value), num++;} catch (err) {throw improveErrorMessage(err, "mean", value);}}), 0 === num) throw new Error("Cannot calculate the mean of an empty array");return divide(sum, num);}var { typed, add, divide } = _ref;return typed(mean_name, { "Array | Matrix": _mean, "Array | Matrix, number | BigNumber": function (array, dim) {try {var sum = reduce(array, dim, add),s = Array.isArray(array) ? arraySize(array) : array.size();return divide(sum, s[dim]);} catch (err) {throw improveErrorMessage(err, "mean");}}, "...": function (args) {if (containsCollections(args)) throw new TypeError("Scalar values expected in function mean");return _mean(args);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/variance.js
var DEFAULT_NORMALIZATION = "unbiased",variance_name = "variance",variance_dependencies = ["typed", "add", "subtract", "multiply", "divide", "apply", "isNaN"];var createVariance = factory(variance_name, variance_dependencies, (_ref) => {function _var(array, normalization) {var sum,num = 0;if (0 === array.length) throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if (deepForEach(array, function (value) {try {sum = void 0 === sum ? value : add(sum, value), num++;} catch (err) {throw improveErrorMessage(err, "variance", value);}}), 0 === num) throw new Error("Cannot calculate variance of an empty array");var mean = divide(sum, num);if (sum = void 0, deepForEach(array, function (value) {var diff = subtract(value, mean);sum = void 0 === sum ? multiply(diff, diff) : add(sum, multiply(diff, diff));}), isNaN(sum)) return sum;switch (normalization) {case "uncorrected":return divide(sum, num);case "biased":return divide(sum, num + 1);case "unbiased":{var zero = isBigNumber(sum) ? sum.mul(0) : 0;return 1 === num ? zero : divide(sum, num - 1);}default:throw new Error("Unknown normalization \"" + normalization + "\". Choose \"unbiased\" (default), \"uncorrected\", or \"biased\".");}}function _varDim(array, dim, normalization) {try {if (0 === array.length) throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return apply(array, dim, (x) => _var(x, normalization));} catch (err) {throw improveErrorMessage(err, "variance");}}var { typed, add, subtract, multiply, divide, apply, isNaN } = _ref;return typed(variance_name, { "Array | Matrix": function (array) {return _var(array, DEFAULT_NORMALIZATION);}, "Array | Matrix, string": _var, "Array | Matrix, number | BigNumber": function (array, dim) {return _varDim(array, dim, DEFAULT_NORMALIZATION);}, "Array | Matrix, number | BigNumber, string": _varDim, "...": function (args) {return _var(args, DEFAULT_NORMALIZATION);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/kldivergence.js
var kldivergence_name = "kldivergence",kldivergence_dependencies = ["typed", "matrix", "divide", "sum", "multiply", "dotDivide", "log", "isNumeric"];var createKldivergence = factory("kldivergence", kldivergence_dependencies, (_ref) => {function _kldiv(q, p) {var plength = p.size().length,qlength = q.size().length;if (1 < plength) throw new Error("first object must be one dimensional");if (1 < qlength) throw new Error("second object must be one dimensional");if (plength !== qlength) throw new Error("Length of two vectors must be equal");var sumq = sum(q);if (0 === sumq) throw new Error("Sum of elements in first object must be non zero");var sump = sum(p);if (0 === sump) throw new Error("Sum of elements in second object must be non zero");var qnorm = divide(q, sum(q)),pnorm = divide(p, sum(p)),result = sum(multiply(qnorm, log(dotDivide(qnorm, pnorm))));return isNumeric(result) ? result : Number.NaN;}var { typed, matrix, divide, sum, multiply, dotDivide, log, isNumeric } = _ref;return typed(kldivergence_name, { "Array, Array": function (q, p) {return _kldiv(matrix(q), matrix(p));}, "Matrix, Array": function (q, p) {return _kldiv(q, matrix(p));}, "Array, Matrix": function (q, p) {return _kldiv(matrix(q), p);}, "Matrix, Matrix": function (q, p) {return _kldiv(q, p);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/combinatorics/bellNumbers.js
var bellNumbers_name = "bellNumbers",bellNumbers_dependencies = ["typed", "addScalar", "isNegative", "isInteger", "stirlingS2"];var createBellNumbers = factory("bellNumbers", bellNumbers_dependencies, (_ref) => {var { typed, addScalar, isNegative, isInteger, stirlingS2 } = _ref;return typed(bellNumbers_name, { "number | BigNumber": function (n) {if (!isInteger(n) || isNegative(n)) throw new TypeError("Non-negative integer value expected in function bellNumbers");for (var result = 0, i = 0; i <= n; i++) result = addScalar(result, stirlingS2(n, i));return result;} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/log1p.js
var log1p_name = "log1p",log1p_dependencies = ["typed", "config", "divideScalar", "log", "Complex"];var createLog1p = factory("log1p", log1p_dependencies, (_ref) => {function _log1pComplex(x) {var xRe1p = x.re + 1;return new Complex(Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)), Math.atan2(x.im, xRe1p));}var { typed, config, divideScalar, log, Complex } = _ref;return typed(log1p_name, { number: function (x) {return -1 <= x || config.predictable ? log1p(x) : _log1pComplex(new Complex(x, 0));}, Complex: _log1pComplex, BigNumber: function (x) {var y = x.plus(1);return !y.isNegative() || config.predictable ? y.ln() : _log1pComplex(new Complex(x.toNumber(), 0));}, "Array | Matrix": function (x) {return deepMap(x, this);}, "any, any": function (x, base) {return divideScalar(this(x), log(base));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/unit/Unit.js
function Unit_ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);enumerableOnly && (symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;})), keys.push.apply(keys, symbols);}return keys;}function Unit_objectSpread(target) {for (var source, i = 1; i < arguments.length; i++) source = null == arguments[i] ? {} : arguments[i], i % 2 ? Unit_ownKeys(Object(source), !0).forEach(function (key) {defineProperty(target, key, source[key]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Unit_ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});return target;}var Unit_name = "Unit",Unit_dependencies = ["?on", "config", "addScalar", "subtract", "multiplyScalar", "divideScalar", "pow", "abs", "fix", "round", "equal", "isNumeric", "format", "number", "Complex", "BigNumber", "Fraction"];var createUnitClass = factory("Unit", Unit_dependencies, (_ref) => {function Unit(value, name) {if (!(this instanceof Unit)) throw new Error("Constructor must be called with the new operator");if (!(null === value || void 0 === value || isNumeric(value) || isComplex(value))) throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if (void 0 !== name && ("string" != typeof name || "" === name)) throw new TypeError("Second parameter in Unit constructor must be a string");if (void 0 !== name) {var u = Unit.parse(name);this.units = u.units, this.dimensions = u.dimensions;} else {this.units = [{ unit: UNIT_NONE, prefix: PREFIXES.NONE, power: 0 }], this.dimensions = [];for (var i = 0; i < BASE_DIMENSIONS.length; i++) this.dimensions[i] = 0;}this.value = void 0 !== value && null !== value ? this._normalize(value) : null, this.fixPrefix = !1, this.skipAutomaticSimplification = !0;}function skipWhitespace() {for (; " " === c || "\t" === c;) next();}function isDigitDot(c) {return "0" <= c && "9" >= c || "." === c;}function isDigit(c) {return "0" <= c && "9" >= c;}function next() {index++, c = text.charAt(index);}function revert(oldIndex) {index = oldIndex, c = text.charAt(index);}function parseNumber() {var number = "",oldIndex = index;if ("+" === c ? next() : "-" === c && (number += c, next()), !isDigitDot(c)) return revert(oldIndex), null;if ("." !== c) {for (; isDigit(c);) number += c, next();"." === c && (number += c, next());} else if (number += c, next(), !isDigit(c)) return revert(oldIndex), null;for (; isDigit(c);) number += c, next();if ("E" === c || "e" === c) {var tentativeNumber = "",tentativeIndex = index;if (tentativeNumber += c, next(), ("+" === c || "-" === c) && (tentativeNumber += c, next()), !isDigit(c)) return revert(tentativeIndex), number;for (number += tentativeNumber; isDigit(c);) number += c, next();}return number;}function parseUnit() {for (var unitName = ""; isDigit(c) || Unit.isValidAlpha(c);) unitName += c, next();var firstC = unitName.charAt(0);return Unit.isValidAlpha(firstC) ? unitName : null;}function parseCharacter(toFind) {return c === toFind ? (next(), toFind) : null;}function getNumericIfUnitless(unit) {return unit.equalBase(BASE_UNITS.NONE) && null !== unit.value && !config.predictable ? unit.value : unit;}function calculateAngleValues(config) {if ("BigNumber" === config.number) {var pi = createBigNumberPi(_BigNumber);UNITS.rad.value = new _BigNumber(1), UNITS.deg.value = pi.div(180), UNITS.grad.value = pi.div(200), UNITS.cycle.value = pi.times(2), UNITS.arcsec.value = pi.div(648e3), UNITS.arcmin.value = pi.div(10800);} else UNITS.rad.value = 1, UNITS.deg.value = Math.PI / 180, UNITS.grad.value = Math.PI / 200, UNITS.cycle.value = 2 * Math.PI, UNITS.arcsec.value = Math.PI / 648e3, UNITS.arcmin.value = Math.PI / 10800;UNITS.radian.value = UNITS.rad.value, UNITS.degree.value = UNITS.deg.value, UNITS.gradian.value = UNITS.grad.value;}function assertUnitNameIsValid(name) {for (var i = 0; i < name.length; i++) {if (c = name.charAt(i), 0 == i && !Unit.isValidAlpha(c)) throw new Error("Invalid unit name (must begin with alpha character): \"" + name + "\"");if (0 < i && !(Unit.isValidAlpha(c) || isDigit(c))) throw new Error("Invalid unit name (only alphanumeric characters are allowed): \"" + name + "\"");}}var { on, config, addScalar, subtract, multiplyScalar, divideScalar, pow, abs, fix, round, equal, isNumeric, format, number, Complex, BigNumber: _BigNumber, Fraction: _Fraction } = _ref;Unit.prototype.type = "Unit", Unit.prototype.isUnit = !0;var text, index, c;Unit.parse = function (str, options) {if (options = options || {}, text = str, index = -1, c = "", "string" != typeof text) throw new TypeError("Invalid argument in Unit.parse, string expected");var unit = new Unit();unit.units = [];var powerMultiplierCurrent = 1,expectingUnit = !1;next(), skipWhitespace();var valueStr = parseNumber(),value = null;if (valueStr) {if ("BigNumber" === config.number) value = new _BigNumber(valueStr);else if ("Fraction" === config.number) try {value = new _Fraction(valueStr);} catch (err) {value = parseFloat(valueStr);} else value = parseFloat(valueStr);skipWhitespace(), parseCharacter("*") ? (powerMultiplierCurrent = 1, expectingUnit = !0) : parseCharacter("/") && (powerMultiplierCurrent = -1, expectingUnit = !0);}for (var powerMultiplierStack = [], powerMultiplierStackProduct = 1; !0;) {for (skipWhitespace(); "(" === c;) powerMultiplierStack.push(powerMultiplierCurrent), powerMultiplierStackProduct *= powerMultiplierCurrent, powerMultiplierCurrent = 1, next(), skipWhitespace();var uStr = void 0;if (c) {var oldC = c;if (uStr = parseUnit(), null === uStr) throw new SyntaxError("Unexpected \"" + oldC + "\" in \"" + text + "\" at index " + index.toString());} else break;var res = _findUnit(uStr);if (null === res) throw new SyntaxError("Unit \"" + uStr + "\" not found.");var power = powerMultiplierCurrent * powerMultiplierStackProduct;if (skipWhitespace(), parseCharacter("^")) {skipWhitespace();var p = parseNumber();if (null === p) throw new SyntaxError("In \"" + str + "\", \"^\" must be followed by a floating-point number");power *= p;}unit.units.push({ unit: res.unit, prefix: res.prefix, power: power });for (var i = 0; i < BASE_DIMENSIONS.length; i++) unit.dimensions[i] += (res.unit.dimensions[i] || 0) * power;for (skipWhitespace(); ")" === c;) {if (0 === powerMultiplierStack.length) throw new SyntaxError("Unmatched \")\" in \"" + text + "\" at index " + index.toString());powerMultiplierStackProduct /= powerMultiplierStack.pop(), next(), skipWhitespace();}if (expectingUnit = !1, parseCharacter("*") ? (powerMultiplierCurrent = 1, expectingUnit = !0) : parseCharacter("/") ? (powerMultiplierCurrent = -1, expectingUnit = !0) : powerMultiplierCurrent = 1, res.unit.base) {var baseDim = res.unit.base.key;UNIT_SYSTEMS.auto[baseDim] = { unit: res.unit, prefix: res.prefix };}}if (skipWhitespace(), c) throw new SyntaxError("Could not parse: \"" + str + "\"");if (expectingUnit) throw new SyntaxError("Trailing characters: \"" + str + "\"");if (0 !== powerMultiplierStack.length) throw new SyntaxError("Unmatched \"(\" in \"" + text + "\"");if (0 === unit.units.length && !options.allowNoUnits) throw new SyntaxError("\"" + str + "\" contains no units");return unit.value = void 0 === value ? null : unit._normalize(value), unit;}, Unit.prototype.clone = function () {var unit = new Unit();unit.fixPrefix = this.fixPrefix, unit.skipAutomaticSimplification = this.skipAutomaticSimplification, unit.value = clone(this.value), unit.dimensions = this.dimensions.slice(0), unit.units = [];for (var i = 0; i < this.units.length; i++) for (var p in unit.units[i] = {}, this.units[i]) object_hasOwnProperty(this.units[i], p) && (unit.units[i][p] = this.units[i][p]);return unit;}, Unit.prototype._isDerived = function () {return 0 !== this.units.length && (1 < this.units.length || 1e-15 < Math.abs(this.units[0].power - 1));}, Unit.prototype._normalize = function (value) {var unitValue, unitOffset, unitPower, unitPrefixValue, convert;if (null === value || void 0 === value || 0 === this.units.length) return value;if (this._isDerived()) {var res = value;convert = Unit._getNumberConverter(typeOf(value));for (var i = 0; i < this.units.length; i++) unitValue = convert(this.units[i].unit.value), unitPrefixValue = convert(this.units[i].prefix.value), unitPower = convert(this.units[i].power), res = multiplyScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));return res;}return convert = Unit._getNumberConverter(typeOf(value)), unitValue = convert(this.units[0].unit.value), unitOffset = convert(this.units[0].unit.offset), unitPrefixValue = convert(this.units[0].prefix.value), multiplyScalar(addScalar(value, unitOffset), multiplyScalar(unitValue, unitPrefixValue));}, Unit.prototype._denormalize = function (value, prefixValue) {var unitValue, unitOffset, unitPower, unitPrefixValue, convert;if (null === value || void 0 === value || 0 === this.units.length) return value;if (this._isDerived()) {var res = value;convert = Unit._getNumberConverter(typeOf(value));for (var i = 0; i < this.units.length; i++) unitValue = convert(this.units[i].unit.value), unitPrefixValue = convert(this.units[i].prefix.value), unitPower = convert(this.units[i].power), res = divideScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));return res;}return convert = Unit._getNumberConverter(typeOf(value)), unitValue = convert(this.units[0].unit.value), unitPrefixValue = convert(this.units[0].prefix.value), unitOffset = convert(this.units[0].unit.offset), void 0 === prefixValue || null === prefixValue ? subtract(divideScalar(divideScalar(value, unitValue), unitPrefixValue), unitOffset) : subtract(divideScalar(divideScalar(value, unitValue), prefixValue), unitOffset);};var _findUnit = memoize((str) => {if (object_hasOwnProperty(UNITS, str)) {var unit = UNITS[str],prefix = unit.prefixes[""];return { unit, prefix };}for (var _name in UNITS) if (object_hasOwnProperty(UNITS, _name) && endsWith(str, _name)) {var _unit = UNITS[_name],prefixLen = str.length - _name.length,prefixName = str.substring(0, prefixLen),_prefix = object_hasOwnProperty(_unit.prefixes, prefixName) ? _unit.prefixes[prefixName] : void 0;if (void 0 !== _prefix) return { unit: _unit, prefix: _prefix };}return null;}, { hasher: (args) => args[0], limit: 100 });Unit.isValuelessUnit = function (name) {return null !== _findUnit(name);}, Unit.prototype.hasBase = function (base) {if ("string" == typeof base && (base = BASE_UNITS[base]), !base) return !1;for (var i = 0; i < BASE_DIMENSIONS.length; i++) if (1e-12 < Math.abs((this.dimensions[i] || 0) - (base.dimensions[i] || 0))) return !1;return !0;}, Unit.prototype.equalBase = function (other) {for (var i = 0; i < BASE_DIMENSIONS.length; i++) if (1e-12 < Math.abs((this.dimensions[i] || 0) - (other.dimensions[i] || 0))) return !1;return !0;}, Unit.prototype.equals = function (other) {return this.equalBase(other) && equal(this.value, other.value);}, Unit.prototype.multiply = function (other) {for (var res = this.clone(), i = 0; i < BASE_DIMENSIONS.length; i++) res.dimensions[i] = (this.dimensions[i] || 0) + (other.dimensions[i] || 0);for (var inverted, _i = 0; _i < other.units.length; _i++) inverted = Unit_objectSpread({}, other.units[_i]), res.units.push(inverted);if (null !== this.value || null !== other.value) {var valThis = null === this.value ? this._normalize(1) : this.value,valOther = null === other.value ? other._normalize(1) : other.value;res.value = multiplyScalar(valThis, valOther);} else res.value = null;return res.skipAutomaticSimplification = !1, getNumericIfUnitless(res);}, Unit.prototype.divide = function (other) {for (var res = this.clone(), i = 0; i < BASE_DIMENSIONS.length; i++) res.dimensions[i] = (this.dimensions[i] || 0) - (other.dimensions[i] || 0);for (var inverted, _i2 = 0; _i2 < other.units.length; _i2++) inverted = Unit_objectSpread(Unit_objectSpread({}, other.units[_i2]), {}, { power: -other.units[_i2].power }), res.units.push(inverted);if (null !== this.value || null !== other.value) {var valThis = null === this.value ? this._normalize(1) : this.value,valOther = null === other.value ? other._normalize(1) : other.value;res.value = divideScalar(valThis, valOther);} else res.value = null;return res.skipAutomaticSimplification = !1, getNumericIfUnitless(res);}, Unit.prototype.pow = function (p) {for (var res = this.clone(), i = 0; i < BASE_DIMENSIONS.length; i++) res.dimensions[i] = (this.dimensions[i] || 0) * p;for (var _i3 = 0; _i3 < res.units.length; _i3++) res.units[_i3].power *= p;return res.value = null === res.value ? null : pow(res.value, p), res.skipAutomaticSimplification = !1, getNumericIfUnitless(res);}, Unit.prototype.abs = function () {var ret = this.clone();for (var i in ret.value = null === ret.value ? null : abs(ret.value), ret.units) ("VA" === ret.units[i].unit.name || "VAR" === ret.units[i].unit.name) && (ret.units[i].unit = UNITS.W);return ret;}, Unit.prototype.to = function (valuelessUnit) {var other,value = null === this.value ? this._normalize(1) : this.value;if ("string" == typeof valuelessUnit) {if (other = Unit.parse(valuelessUnit), !this.equalBase(other)) throw new Error("Units do not match ('".concat(other.toString(), "' != '").concat(this.toString(), "')"));if (null !== other.value) throw new Error("Cannot convert to a unit with a value");return other.value = clone(value), other.fixPrefix = !0, other.skipAutomaticSimplification = !0, other;}if (isUnit(valuelessUnit)) {if (!this.equalBase(valuelessUnit)) throw new Error("Units do not match ('".concat(valuelessUnit.toString(), "' != '").concat(this.toString(), "')"));if (null !== valuelessUnit.value) throw new Error("Cannot convert to a unit with a value");return other = valuelessUnit.clone(), other.value = clone(value), other.fixPrefix = !0, other.skipAutomaticSimplification = !0, other;}throw new Error("String or Unit expected as parameter");}, Unit.prototype.toNumber = function (valuelessUnit) {return number(this.toNumeric(valuelessUnit));}, Unit.prototype.toNumeric = function (valuelessUnit) {var other;return other = valuelessUnit ? this.to(valuelessUnit) : this.clone(), other._isDerived() || 0 === other.units.length ? other._denormalize(other.value) : other._denormalize(other.value, other.units[0].prefix.value);}, Unit.prototype.toString = function () {return this.format();}, Unit.prototype.toJSON = function () {return { mathjs: "Unit", value: this._denormalize(this.value), unit: this.formatUnits(), fixPrefix: this.fixPrefix };}, Unit.fromJSON = function (json) {var unit = new Unit(json.value, json.unit);return unit.fixPrefix = json.fixPrefix || !1, unit;}, Unit.prototype.valueOf = Unit.prototype.toString, Unit.prototype.simplify = function () {var matchingBase,ret = this.clone(),proposedUnitList = [];for (var key in currentUnitSystem) if (object_hasOwnProperty(currentUnitSystem, key) && ret.hasBase(BASE_UNITS[key])) {matchingBase = key;break;}if ("NONE" === matchingBase) ret.units = [];else {var matchingUnit;if (matchingBase && object_hasOwnProperty(currentUnitSystem, matchingBase) && (matchingUnit = currentUnitSystem[matchingBase]), matchingUnit) ret.units = [{ unit: matchingUnit.unit, prefix: matchingUnit.prefix, power: 1 }];else {for (var baseDim, missingBaseDim = !1, i = 0; i < BASE_DIMENSIONS.length; i++) baseDim = BASE_DIMENSIONS[i], 1e-12 < Math.abs(ret.dimensions[i] || 0) && (object_hasOwnProperty(currentUnitSystem, baseDim) ? proposedUnitList.push({ unit: currentUnitSystem[baseDim].unit, prefix: currentUnitSystem[baseDim].prefix, power: ret.dimensions[i] || 0 }) : missingBaseDim = !0);proposedUnitList.length < ret.units.length && !missingBaseDim && (ret.units = proposedUnitList);}}return ret;}, Unit.prototype.toSI = function () {for (var baseDim, ret = this.clone(), proposedUnitList = [], i = 0; i < BASE_DIMENSIONS.length; i++) if (baseDim = BASE_DIMENSIONS[i], 1e-12 < Math.abs(ret.dimensions[i] || 0)) if (object_hasOwnProperty(UNIT_SYSTEMS.si, baseDim)) proposedUnitList.push({ unit: UNIT_SYSTEMS.si[baseDim].unit, prefix: UNIT_SYSTEMS.si[baseDim].prefix, power: ret.dimensions[i] || 0 });else throw new Error("Cannot express custom unit " + baseDim + " in SI units");return ret.units = proposedUnitList, ret.fixPrefix = !0, ret.skipAutomaticSimplification = !0, ret;}, Unit.prototype.formatUnits = function () {for (var strNum = "", strDen = "", nNum = 0, nDen = 0, i = 0; i < this.units.length; i++) 0 < this.units[i].power ? (nNum++, strNum += " " + this.units[i].prefix.name + this.units[i].unit.name, 1e-15 < Math.abs(this.units[i].power - 1) && (strNum += "^" + this.units[i].power)) : 0 > this.units[i].power && nDen++;if (0 < nDen) for (var _i4 = 0; _i4 < this.units.length; _i4++) 0 > this.units[_i4].power && (0 < nNum ? (strDen += " " + this.units[_i4].prefix.name + this.units[_i4].unit.name, 1e-15 < Math.abs(this.units[_i4].power + 1) && (strDen += "^" + -this.units[_i4].power)) : (strDen += " " + this.units[_i4].prefix.name + this.units[_i4].unit.name, strDen += "^" + this.units[_i4].power));strNum = strNum.substr(1), strDen = strDen.substr(1), 1 < nNum && 0 < nDen && (strNum = "(" + strNum + ")"), 1 < nDen && 0 < nNum && (strDen = "(" + strDen + ")");var str = strNum;return 0 < nNum && 0 < nDen && (str += " / "), str += strDen, str;}, Unit.prototype.format = function (options) {var simp = this.skipAutomaticSimplification || null === this.value ? this.clone() : this.simplify(),isImaginary = !1;for (var i in "undefined" != typeof simp.value && null !== simp.value && isComplex(simp.value) && (isImaginary = 1e-14 > Math.abs(simp.value.re)), simp.units) object_hasOwnProperty(simp.units, i) && simp.units[i].unit && ("VA" === simp.units[i].unit.name && isImaginary ? simp.units[i].unit = UNITS.VAR : "VAR" === simp.units[i].unit.name && !isImaginary && (simp.units[i].unit = UNITS.VA));1 === simp.units.length && !simp.fixPrefix && 1e-14 > Math.abs(simp.units[0].power - Math.round(simp.units[0].power)) && (simp.units[0].prefix = simp._bestPrefix());var value = simp._denormalize(simp.value),str = null === simp.value ? "" : format(value, options || {}),unitStr = simp.formatUnits();return simp.value && isComplex(simp.value) && (str = "(" + str + ")"), 0 < unitStr.length && 0 < str.length && (str += " "), str += unitStr, str;}, Unit.prototype._bestPrefix = function () {if (1 !== this.units.length) throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if (1e-14 <= Math.abs(this.units[0].power - Math.round(this.units[0].power))) throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var absValue = null === this.value ? 0 : abs(this.value),absUnitValue = abs(this.units[0].unit.value),bestPrefix = this.units[0].prefix;if (0 === absValue) return bestPrefix;var power = this.units[0].power,bestDiff = Math.log(absValue / Math.pow(bestPrefix.value * absUnitValue, power)) / Math.LN10 - 1.2;if (-2.200001 < bestDiff && 1.800001 > bestDiff) return bestPrefix;bestDiff = Math.abs(bestDiff);var prefixes = this.units[0].unit.prefixes;for (var p in prefixes) if (object_hasOwnProperty(prefixes, p)) {var prefix = prefixes[p];if (prefix.scientific) {var diff = Math.abs(Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2);(diff < bestDiff || diff === bestDiff && prefix.name.length < bestPrefix.name.length) && (bestPrefix = prefix, bestDiff = diff);}}return bestPrefix;}, Unit.prototype.splitUnit = function (parts) {for (var x = this.clone(), ret = [], i = 0; i < parts.length && (x = x.to(parts[i]), i != parts.length - 1); i++) {var xNumeric = x.toNumeric(),xRounded = round(xNumeric),xFixed = void 0,isNearlyEqual = equal(xRounded, xNumeric);xFixed = isNearlyEqual ? xRounded : fix(x.toNumeric());var y = new Unit(xFixed, parts[i].toString());ret.push(y), x = subtract(x, y);}for (var testSum = 0, _i5 = 0; _i5 < ret.length; _i5++) testSum = addScalar(testSum, ret[_i5].value);return equal(testSum, this.value) && (x.value = 0), ret.push(x), ret;};var PREFIXES = { NONE: { "": { name: "", value: 1, scientific: !0 } }, SHORT: { "": { name: "", value: 1, scientific: !0 }, da: { name: "da", value: 10, scientific: !1 }, h: { name: "h", value: 100, scientific: !1 }, k: { name: "k", value: 1e3, scientific: !0 }, M: { name: "M", value: 1e6, scientific: !0 }, G: { name: "G", value: 1e9, scientific: !0 }, T: { name: "T", value: 1e12, scientific: !0 }, P: { name: "P", value: 1e15, scientific: !0 }, E: { name: "E", value: 1e18, scientific: !0 }, Z: { name: "Z", value: 1e21, scientific: !0 }, Y: { name: "Y", value: 1e24, scientific: !0 }, d: { name: "d", value: .1, scientific: !1 }, c: { name: "c", value: .01, scientific: !1 }, m: { name: "m", value: 1e-3, scientific: !0 }, u: { name: "u", value: 1e-6, scientific: !0 }, n: { name: "n", value: 1e-9, scientific: !0 }, p: { name: "p", value: 1e-12, scientific: !0 }, f: { name: "f", value: 1e-15, scientific: !0 }, a: { name: "a", value: 1e-18, scientific: !0 }, z: { name: "z", value: 1e-21, scientific: !0 }, y: { name: "y", value: 1e-24, scientific: !0 } }, LONG: { "": { name: "", value: 1, scientific: !0 }, deca: { name: "deca", value: 10, scientific: !1 }, hecto: { name: "hecto", value: 100, scientific: !1 }, kilo: { name: "kilo", value: 1e3, scientific: !0 }, mega: { name: "mega", value: 1e6, scientific: !0 }, giga: { name: "giga", value: 1e9, scientific: !0 }, tera: { name: "tera", value: 1e12, scientific: !0 }, peta: { name: "peta", value: 1e15, scientific: !0 }, exa: { name: "exa", value: 1e18, scientific: !0 }, zetta: { name: "zetta", value: 1e21, scientific: !0 }, yotta: { name: "yotta", value: 1e24, scientific: !0 }, deci: { name: "deci", value: .1, scientific: !1 }, centi: { name: "centi", value: .01, scientific: !1 }, milli: { name: "milli", value: 1e-3, scientific: !0 }, micro: { name: "micro", value: 1e-6, scientific: !0 }, nano: { name: "nano", value: 1e-9, scientific: !0 }, pico: { name: "pico", value: 1e-12, scientific: !0 }, femto: { name: "femto", value: 1e-15, scientific: !0 }, atto: { name: "atto", value: 1e-18, scientific: !0 }, zepto: { name: "zepto", value: 1e-21, scientific: !0 }, yocto: { name: "yocto", value: 1e-24, scientific: !0 } }, SQUARED: { "": { name: "", value: 1, scientific: !0 }, da: { name: "da", value: 100, scientific: !1 }, h: { name: "h", value: 1e4, scientific: !1 }, k: { name: "k", value: 1e6, scientific: !0 }, M: { name: "M", value: 1e12, scientific: !0 }, G: { name: "G", value: 1e18, scientific: !0 }, T: { name: "T", value: 1e24, scientific: !0 }, P: { name: "P", value: 1e30, scientific: !0 }, E: { name: "E", value: 1e36, scientific: !0 }, Z: { name: "Z", value: 1e42, scientific: !0 }, Y: { name: "Y", value: 1e48, scientific: !0 }, d: { name: "d", value: .01, scientific: !1 }, c: { name: "c", value: 1e-4, scientific: !1 }, m: { name: "m", value: 1e-6, scientific: !0 }, u: { name: "u", value: 1e-12, scientific: !0 }, n: { name: "n", value: 1e-18, scientific: !0 }, p: { name: "p", value: 1e-24, scientific: !0 }, f: { name: "f", value: 1e-30, scientific: !0 }, a: { name: "a", value: 1e-36, scientific: !0 }, z: { name: "z", value: 1e-42, scientific: !0 }, y: { name: "y", value: 1e-48, scientific: !0 } }, CUBIC: { "": { name: "", value: 1, scientific: !0 }, da: { name: "da", value: 1e3, scientific: !1 }, h: { name: "h", value: 1e6, scientific: !1 }, k: { name: "k", value: 1e9, scientific: !0 }, M: { name: "M", value: 1e18, scientific: !0 }, G: { name: "G", value: 1e27, scientific: !0 }, T: { name: "T", value: 1e36, scientific: !0 }, P: { name: "P", value: 1e45, scientific: !0 }, E: { name: "E", value: 1e54, scientific: !0 }, Z: { name: "Z", value: 1e63, scientific: !0 }, Y: { name: "Y", value: 1e72, scientific: !0 }, d: { name: "d", value: 1e-3, scientific: !1 }, c: { name: "c", value: 1e-6, scientific: !1 }, m: { name: "m", value: 1e-9, scientific: !0 }, u: { name: "u", value: 1e-18, scientific: !0 }, n: { name: "n", value: 1e-27, scientific: !0 }, p: { name: "p", value: 1e-36, scientific: !0 }, f: { name: "f", value: 1e-45, scientific: !0 }, a: { name: "a", value: 1e-54, scientific: !0 }, z: { name: "z", value: 1e-63, scientific: !0 }, y: { name: "y", value: 1e-72, scientific: !0 } }, BINARY_SHORT_SI: { "": { name: "", value: 1, scientific: !0 }, k: { name: "k", value: 1e3, scientific: !0 }, M: { name: "M", value: 1e6, scientific: !0 }, G: { name: "G", value: 1e9, scientific: !0 }, T: { name: "T", value: 1e12, scientific: !0 }, P: { name: "P", value: 1e15, scientific: !0 }, E: { name: "E", value: 1e18, scientific: !0 }, Z: { name: "Z", value: 1e21, scientific: !0 }, Y: { name: "Y", value: 1e24, scientific: !0 } }, BINARY_SHORT_IEC: { "": { name: "", value: 1, scientific: !0 }, Ki: { name: "Ki", value: 1024, scientific: !0 }, Mi: { name: "Mi", value: Math.pow(1024, 2), scientific: !0 }, Gi: { name: "Gi", value: Math.pow(1024, 3), scientific: !0 }, Ti: { name: "Ti", value: Math.pow(1024, 4), scientific: !0 }, Pi: { name: "Pi", value: Math.pow(1024, 5), scientific: !0 }, Ei: { name: "Ei", value: Math.pow(1024, 6), scientific: !0 }, Zi: { name: "Zi", value: Math.pow(1024, 7), scientific: !0 }, Yi: { name: "Yi", value: Math.pow(1024, 8), scientific: !0 } }, BINARY_LONG_SI: { "": { name: "", value: 1, scientific: !0 }, kilo: { name: "kilo", value: 1e3, scientific: !0 }, mega: { name: "mega", value: 1e6, scientific: !0 }, giga: { name: "giga", value: 1e9, scientific: !0 }, tera: { name: "tera", value: 1e12, scientific: !0 }, peta: { name: "peta", value: 1e15, scientific: !0 }, exa: { name: "exa", value: 1e18, scientific: !0 }, zetta: { name: "zetta", value: 1e21, scientific: !0 }, yotta: { name: "yotta", value: 1e24, scientific: !0 } }, BINARY_LONG_IEC: { "": { name: "", value: 1, scientific: !0 }, kibi: { name: "kibi", value: 1024, scientific: !0 }, mebi: { name: "mebi", value: Math.pow(1024, 2), scientific: !0 }, gibi: { name: "gibi", value: Math.pow(1024, 3), scientific: !0 }, tebi: { name: "tebi", value: Math.pow(1024, 4), scientific: !0 }, pebi: { name: "pebi", value: Math.pow(1024, 5), scientific: !0 }, exi: { name: "exi", value: Math.pow(1024, 6), scientific: !0 }, zebi: { name: "zebi", value: Math.pow(1024, 7), scientific: !0 }, yobi: { name: "yobi", value: Math.pow(1024, 8), scientific: !0 } }, BTU: { "": { name: "", value: 1, scientific: !0 }, MM: { name: "MM", value: 1e6, scientific: !0 } } };PREFIXES.SHORTLONG = helpers_extends({}, PREFIXES.SHORT, PREFIXES.LONG), PREFIXES.BINARY_SHORT = helpers_extends({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC), PREFIXES.BINARY_LONG = helpers_extends({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC);var BASE_DIMENSIONS = ["MASS", "LENGTH", "TIME", "CURRENT", "TEMPERATURE", "LUMINOUS_INTENSITY", "AMOUNT_OF_SUBSTANCE", "ANGLE", "BIT"],BASE_UNITS = { NONE: { dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 0] }, MASS: { dimensions: [1, 0, 0, 0, 0, 0, 0, 0, 0] }, LENGTH: { dimensions: [0, 1, 0, 0, 0, 0, 0, 0, 0] }, TIME: { dimensions: [0, 0, 1, 0, 0, 0, 0, 0, 0] }, CURRENT: { dimensions: [0, 0, 0, 1, 0, 0, 0, 0, 0] }, TEMPERATURE: { dimensions: [0, 0, 0, 0, 1, 0, 0, 0, 0] }, LUMINOUS_INTENSITY: { dimensions: [0, 0, 0, 0, 0, 1, 0, 0, 0] }, AMOUNT_OF_SUBSTANCE: { dimensions: [0, 0, 0, 0, 0, 0, 1, 0, 0] }, FORCE: { dimensions: [1, 1, -2, 0, 0, 0, 0, 0, 0] }, SURFACE: { dimensions: [0, 2, 0, 0, 0, 0, 0, 0, 0] }, VOLUME: { dimensions: [0, 3, 0, 0, 0, 0, 0, 0, 0] }, ENERGY: { dimensions: [1, 2, -2, 0, 0, 0, 0, 0, 0] }, POWER: { dimensions: [1, 2, -3, 0, 0, 0, 0, 0, 0] }, PRESSURE: { dimensions: [1, -1, -2, 0, 0, 0, 0, 0, 0] }, ELECTRIC_CHARGE: { dimensions: [0, 0, 1, 1, 0, 0, 0, 0, 0] }, ELECTRIC_CAPACITANCE: { dimensions: [-1, -2, 4, 2, 0, 0, 0, 0, 0] }, ELECTRIC_POTENTIAL: { dimensions: [1, 2, -3, -1, 0, 0, 0, 0, 0] }, ELECTRIC_RESISTANCE: { dimensions: [1, 2, -3, -2, 0, 0, 0, 0, 0] }, ELECTRIC_INDUCTANCE: { dimensions: [1, 2, -2, -2, 0, 0, 0, 0, 0] }, ELECTRIC_CONDUCTANCE: { dimensions: [-1, -2, 3, 2, 0, 0, 0, 0, 0] }, MAGNETIC_FLUX: { dimensions: [1, 2, -2, -1, 0, 0, 0, 0, 0] }, MAGNETIC_FLUX_DENSITY: { dimensions: [1, 0, -2, -1, 0, 0, 0, 0, 0] }, FREQUENCY: { dimensions: [0, 0, -1, 0, 0, 0, 0, 0, 0] }, ANGLE: { dimensions: [0, 0, 0, 0, 0, 0, 0, 1, 0] }, BIT: { dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 1] } };for (var key in BASE_UNITS) object_hasOwnProperty(BASE_UNITS, key) && (BASE_UNITS[key].key = key);var UNIT_NONE = { name: "", base: {}, value: 1, offset: 0, dimensions: BASE_DIMENSIONS.map((x) => 0) },UNITS = { meter: { name: "meter", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, inch: { name: "inch", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .0254, offset: 0 }, foot: { name: "foot", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .3048, offset: 0 }, yard: { name: "yard", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .9144, offset: 0 }, mile: { name: "mile", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 1609.344, offset: 0 }, link: { name: "link", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .201168, offset: 0 }, rod: { name: "rod", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 5.0292, offset: 0 }, chain: { name: "chain", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 20.1168, offset: 0 }, angstrom: { name: "angstrom", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 1e-10, offset: 0 }, m: { name: "m", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, in: { name: "in", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .0254, offset: 0 }, ft: { name: "ft", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .3048, offset: 0 }, yd: { name: "yd", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .9144, offset: 0 }, mi: { name: "mi", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 1609.344, offset: 0 }, li: { name: "li", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .201168, offset: 0 }, rd: { name: "rd", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 5.02921, offset: 0 }, ch: { name: "ch", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 20.1168, offset: 0 }, mil: { name: "mil", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 254e-7, offset: 0 }, m2: { name: "m2", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.SQUARED, value: 1, offset: 0 }, sqin: { name: "sqin", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 64516e-8, offset: 0 }, sqft: { name: "sqft", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: .09290304, offset: 0 }, sqyd: { name: "sqyd", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: .83612736, offset: 0 }, sqmi: { name: "sqmi", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 2589988.110336, offset: 0 }, sqrd: { name: "sqrd", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 25.29295, offset: 0 }, sqch: { name: "sqch", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 404.6873, offset: 0 }, sqmil: { name: "sqmil", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 64516e-14, offset: 0 }, acre: { name: "acre", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 4046.86, offset: 0 }, hectare: { name: "hectare", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 1e4, offset: 0 }, m3: { name: "m3", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.CUBIC, value: 1, offset: 0 }, L: { name: "L", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.SHORT, value: .001, offset: 0 }, l: { name: "l", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.SHORT, value: .001, offset: 0 }, litre: { name: "litre", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.LONG, value: .001, offset: 0 }, cuin: { name: "cuin", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 1.6387064e-5, offset: 0 }, cuft: { name: "cuft", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .028316846592, offset: 0 }, cuyd: { name: "cuyd", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .764554857984, offset: 0 }, teaspoon: { name: "teaspoon", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 5e-6, offset: 0 }, tablespoon: { name: "tablespoon", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 15e-6, offset: 0 }, drop: { name: "drop", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 5e-8, offset: 0 }, gtt: { name: "gtt", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 5e-8, offset: 0 }, minim: { name: "minim", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 6.161152e-8, offset: 0 }, fluiddram: { name: "fluiddram", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 36966911e-13, offset: 0 }, fluidounce: { name: "fluidounce", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 2957353e-11, offset: 0 }, gill: { name: "gill", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0001182941, offset: 0 }, cc: { name: "cc", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 1e-6, offset: 0 }, cup: { name: "cup", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0002365882, offset: 0 }, pint: { name: "pint", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0004731765, offset: 0 }, quart: { name: "quart", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0009463529, offset: 0 }, gallon: { name: "gallon", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .003785412, offset: 0 }, beerbarrel: { name: "beerbarrel", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .1173478, offset: 0 }, oilbarrel: { name: "oilbarrel", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .1589873, offset: 0 }, hogshead: { name: "hogshead", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .238481, offset: 0 }, fldr: { name: "fldr", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 36966911e-13, offset: 0 }, floz: { name: "floz", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 2957353e-11, offset: 0 }, gi: { name: "gi", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0001182941, offset: 0 }, cp: { name: "cp", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0002365882, offset: 0 }, pt: { name: "pt", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0004731765, offset: 0 }, qt: { name: "qt", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0009463529, offset: 0 }, gal: { name: "gal", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .003785412, offset: 0 }, bbl: { name: "bbl", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .1173478, offset: 0 }, obl: { name: "obl", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .1589873, offset: 0 }, g: { name: "g", base: BASE_UNITS.MASS, prefixes: PREFIXES.SHORT, value: .001, offset: 0 }, gram: { name: "gram", base: BASE_UNITS.MASS, prefixes: PREFIXES.LONG, value: .001, offset: 0 }, ton: { name: "ton", base: BASE_UNITS.MASS, prefixes: PREFIXES.SHORT, value: 907.18474, offset: 0 }, t: { name: "t", base: BASE_UNITS.MASS, prefixes: PREFIXES.SHORT, value: 1e3, offset: 0 }, tonne: { name: "tonne", base: BASE_UNITS.MASS, prefixes: PREFIXES.LONG, value: 1e3, offset: 0 }, grain: { name: "grain", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 64.79891e-6, offset: 0 }, dram: { name: "dram", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .0017718451953125, offset: 0 }, ounce: { name: "ounce", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .028349523125, offset: 0 }, poundmass: { name: "poundmass", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .45359237, offset: 0 }, hundredweight: { name: "hundredweight", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 45.359237, offset: 0 }, stick: { name: "stick", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .115, offset: 0 }, stone: { name: "stone", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 6.35029318, offset: 0 }, gr: { name: "gr", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 64.79891e-6, offset: 0 }, dr: { name: "dr", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .0017718451953125, offset: 0 }, oz: { name: "oz", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .028349523125, offset: 0 }, lbm: { name: "lbm", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .45359237, offset: 0 }, cwt: { name: "cwt", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 45.359237, offset: 0 }, s: { name: "s", base: BASE_UNITS.TIME, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, min: { name: "min", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 60, offset: 0 }, h: { name: "h", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 3600, offset: 0 }, second: { name: "second", base: BASE_UNITS.TIME, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, sec: { name: "sec", base: BASE_UNITS.TIME, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, minute: { name: "minute", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 60, offset: 0 }, hour: { name: "hour", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 3600, offset: 0 }, day: { name: "day", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 86400, offset: 0 }, week: { name: "week", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 604800, offset: 0 }, month: { name: "month", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 2629800, offset: 0 }, year: { name: "year", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 31557600, offset: 0 }, decade: { name: "decade", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 315576e3, offset: 0 }, century: { name: "century", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 315576e4, offset: 0 }, millennium: { name: "millennium", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 315576e5, offset: 0 }, hertz: { name: "Hertz", base: BASE_UNITS.FREQUENCY, prefixes: PREFIXES.LONG, value: 1, offset: 0, reciprocal: !0 }, Hz: { name: "Hz", base: BASE_UNITS.FREQUENCY, prefixes: PREFIXES.SHORT, value: 1, offset: 0, reciprocal: !0 }, rad: { name: "rad", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, radian: { name: "radian", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, deg: { name: "deg", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.SHORT, value: null, offset: 0 }, degree: { name: "degree", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.LONG, value: null, offset: 0 }, grad: { name: "grad", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.SHORT, value: null, offset: 0 }, gradian: { name: "gradian", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.LONG, value: null, offset: 0 }, cycle: { name: "cycle", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.NONE, value: null, offset: 0 }, arcsec: { name: "arcsec", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.NONE, value: null, offset: 0 }, arcmin: { name: "arcmin", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.NONE, value: null, offset: 0 }, A: { name: "A", base: BASE_UNITS.CURRENT, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, ampere: { name: "ampere", base: BASE_UNITS.CURRENT, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, K: { name: "K", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1, offset: 0 }, degC: { name: "degC", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1, offset: 273.15 }, degF: { name: "degF", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1 / 1.8, offset: 459.67 }, degR: { name: "degR", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1 / 1.8, offset: 0 }, kelvin: { name: "kelvin", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1, offset: 0 }, celsius: { name: "celsius", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1, offset: 273.15 }, fahrenheit: { name: "fahrenheit", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1 / 1.8, offset: 459.67 }, rankine: { name: "rankine", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1 / 1.8, offset: 0 }, mol: { name: "mol", base: BASE_UNITS.AMOUNT_OF_SUBSTANCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, mole: { name: "mole", base: BASE_UNITS.AMOUNT_OF_SUBSTANCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, cd: { name: "cd", base: BASE_UNITS.LUMINOUS_INTENSITY, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, candela: { name: "candela", base: BASE_UNITS.LUMINOUS_INTENSITY, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, N: { name: "N", base: BASE_UNITS.FORCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, newton: { name: "newton", base: BASE_UNITS.FORCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, dyn: { name: "dyn", base: BASE_UNITS.FORCE, prefixes: PREFIXES.SHORT, value: 1e-5, offset: 0 }, dyne: { name: "dyne", base: BASE_UNITS.FORCE, prefixes: PREFIXES.LONG, value: 1e-5, offset: 0 }, lbf: { name: "lbf", base: BASE_UNITS.FORCE, prefixes: PREFIXES.NONE, value: 4.4482216152605, offset: 0 }, poundforce: { name: "poundforce", base: BASE_UNITS.FORCE, prefixes: PREFIXES.NONE, value: 4.4482216152605, offset: 0 }, kip: { name: "kip", base: BASE_UNITS.FORCE, prefixes: PREFIXES.LONG, value: 4448.2216, offset: 0 }, kilogramforce: { name: "kilogramforce", base: BASE_UNITS.FORCE, prefixes: PREFIXES.NONE, value: 9.80665, offset: 0 }, J: { name: "J", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, joule: { name: "joule", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, erg: { name: "erg", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.NONE, value: 1e-7, offset: 0 }, Wh: { name: "Wh", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.SHORT, value: 3600, offset: 0 }, BTU: { name: "BTU", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.BTU, value: 1055.05585262, offset: 0 }, eV: { name: "eV", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.SHORT, value: 1602176565e-28, offset: 0 }, electronvolt: { name: "electronvolt", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.LONG, value: 1602176565e-28, offset: 0 }, W: { name: "W", base: BASE_UNITS.POWER, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, watt: { name: "watt", base: BASE_UNITS.POWER, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, hp: { name: "hp", base: BASE_UNITS.POWER, prefixes: PREFIXES.NONE, value: 745.6998715386, offset: 0 }, VAR: { name: "VAR", base: BASE_UNITS.POWER, prefixes: PREFIXES.SHORT, value: Complex.I, offset: 0 }, VA: { name: "VA", base: BASE_UNITS.POWER, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, Pa: { name: "Pa", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, psi: { name: "psi", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 6894.75729276459, offset: 0 }, atm: { name: "atm", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 101325, offset: 0 }, bar: { name: "bar", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.SHORTLONG, value: 1e5, offset: 0 }, torr: { name: "torr", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 133.322, offset: 0 }, mmHg: { name: "mmHg", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 133.322, offset: 0 }, mmH2O: { name: "mmH2O", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 9.80665, offset: 0 }, cmH2O: { name: "cmH2O", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 98.0665, offset: 0 }, coulomb: { name: "coulomb", base: BASE_UNITS.ELECTRIC_CHARGE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, C: { name: "C", base: BASE_UNITS.ELECTRIC_CHARGE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, farad: { name: "farad", base: BASE_UNITS.ELECTRIC_CAPACITANCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, F: { name: "F", base: BASE_UNITS.ELECTRIC_CAPACITANCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, volt: { name: "volt", base: BASE_UNITS.ELECTRIC_POTENTIAL, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, V: { name: "V", base: BASE_UNITS.ELECTRIC_POTENTIAL, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, ohm: { name: "ohm", base: BASE_UNITS.ELECTRIC_RESISTANCE, prefixes: PREFIXES.SHORTLONG, value: 1, offset: 0 }, henry: { name: "henry", base: BASE_UNITS.ELECTRIC_INDUCTANCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, H: { name: "H", base: BASE_UNITS.ELECTRIC_INDUCTANCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, siemens: { name: "siemens", base: BASE_UNITS.ELECTRIC_CONDUCTANCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, S: { name: "S", base: BASE_UNITS.ELECTRIC_CONDUCTANCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, weber: { name: "weber", base: BASE_UNITS.MAGNETIC_FLUX, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, Wb: { name: "Wb", base: BASE_UNITS.MAGNETIC_FLUX, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, tesla: { name: "tesla", base: BASE_UNITS.MAGNETIC_FLUX_DENSITY, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, T: { name: "T", base: BASE_UNITS.MAGNETIC_FLUX_DENSITY, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, b: { name: "b", base: BASE_UNITS.BIT, prefixes: PREFIXES.BINARY_SHORT, value: 1, offset: 0 }, bits: { name: "bits", base: BASE_UNITS.BIT, prefixes: PREFIXES.BINARY_LONG, value: 1, offset: 0 }, B: { name: "B", base: BASE_UNITS.BIT, prefixes: PREFIXES.BINARY_SHORT, value: 8, offset: 0 }, bytes: { name: "bytes", base: BASE_UNITS.BIT, prefixes: PREFIXES.BINARY_LONG, value: 8, offset: 0 } },ALIASES = { meters: "meter", inches: "inch", feet: "foot", yards: "yard", miles: "mile", links: "link", rods: "rod", chains: "chain", angstroms: "angstrom", lt: "l", litres: "litre", liter: "litre", liters: "litre", teaspoons: "teaspoon", tablespoons: "tablespoon", minims: "minim", fluiddrams: "fluiddram", fluidounces: "fluidounce", gills: "gill", cups: "cup", pints: "pint", quarts: "quart", gallons: "gallon", beerbarrels: "beerbarrel", oilbarrels: "oilbarrel", hogsheads: "hogshead", gtts: "gtt", grams: "gram", tons: "ton", tonnes: "tonne", grains: "grain", drams: "dram", ounces: "ounce", poundmasses: "poundmass", hundredweights: "hundredweight", sticks: "stick", lb: "lbm", lbs: "lbm", kips: "kip", kgf: "kilogramforce", acres: "acre", hectares: "hectare", sqfeet: "sqft", sqyard: "sqyd", sqmile: "sqmi", sqmiles: "sqmi", mmhg: "mmHg", mmh2o: "mmH2O", cmh2o: "cmH2O", seconds: "second", secs: "second", minutes: "minute", mins: "minute", hours: "hour", hr: "hour", hrs: "hour", days: "day", weeks: "week", months: "month", years: "year", decades: "decade", centuries: "century", millennia: "millennium", hertz: "hertz", radians: "radian", degrees: "degree", gradians: "gradian", cycles: "cycle", arcsecond: "arcsec", arcseconds: "arcsec", arcminute: "arcmin", arcminutes: "arcmin", BTUs: "BTU", watts: "watt", joules: "joule", amperes: "ampere", coulombs: "coulomb", volts: "volt", ohms: "ohm", farads: "farad", webers: "weber", teslas: "tesla", electronvolts: "electronvolt", moles: "mole", bit: "bits", byte: "bytes" };calculateAngleValues(config), on && on("config", function (curr, prev) {curr.number !== prev.number && calculateAngleValues(curr);});var UNIT_SYSTEMS = { si: { NONE: { unit: UNIT_NONE, prefix: PREFIXES.NONE[""] }, LENGTH: { unit: UNITS.m, prefix: PREFIXES.SHORT[""] }, MASS: { unit: UNITS.g, prefix: PREFIXES.SHORT.k }, TIME: { unit: UNITS.s, prefix: PREFIXES.SHORT[""] }, CURRENT: { unit: UNITS.A, prefix: PREFIXES.SHORT[""] }, TEMPERATURE: { unit: UNITS.K, prefix: PREFIXES.SHORT[""] }, LUMINOUS_INTENSITY: { unit: UNITS.cd, prefix: PREFIXES.SHORT[""] }, AMOUNT_OF_SUBSTANCE: { unit: UNITS.mol, prefix: PREFIXES.SHORT[""] }, ANGLE: { unit: UNITS.rad, prefix: PREFIXES.SHORT[""] }, BIT: { unit: UNITS.bits, prefix: PREFIXES.SHORT[""] }, FORCE: { unit: UNITS.N, prefix: PREFIXES.SHORT[""] }, ENERGY: { unit: UNITS.J, prefix: PREFIXES.SHORT[""] }, POWER: { unit: UNITS.W, prefix: PREFIXES.SHORT[""] }, PRESSURE: { unit: UNITS.Pa, prefix: PREFIXES.SHORT[""] }, ELECTRIC_CHARGE: { unit: UNITS.C, prefix: PREFIXES.SHORT[""] }, ELECTRIC_CAPACITANCE: { unit: UNITS.F, prefix: PREFIXES.SHORT[""] }, ELECTRIC_POTENTIAL: { unit: UNITS.V, prefix: PREFIXES.SHORT[""] }, ELECTRIC_RESISTANCE: { unit: UNITS.ohm, prefix: PREFIXES.SHORT[""] }, ELECTRIC_INDUCTANCE: { unit: UNITS.H, prefix: PREFIXES.SHORT[""] }, ELECTRIC_CONDUCTANCE: { unit: UNITS.S, prefix: PREFIXES.SHORT[""] }, MAGNETIC_FLUX: { unit: UNITS.Wb, prefix: PREFIXES.SHORT[""] }, MAGNETIC_FLUX_DENSITY: { unit: UNITS.T, prefix: PREFIXES.SHORT[""] }, FREQUENCY: { unit: UNITS.Hz, prefix: PREFIXES.SHORT[""] } } };UNIT_SYSTEMS.cgs = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)), UNIT_SYSTEMS.cgs.LENGTH = { unit: UNITS.m, prefix: PREFIXES.SHORT.c }, UNIT_SYSTEMS.cgs.MASS = { unit: UNITS.g, prefix: PREFIXES.SHORT[""] }, UNIT_SYSTEMS.cgs.FORCE = { unit: UNITS.dyn, prefix: PREFIXES.SHORT[""] }, UNIT_SYSTEMS.cgs.ENERGY = { unit: UNITS.erg, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)), UNIT_SYSTEMS.us.LENGTH = { unit: UNITS.ft, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.MASS = { unit: UNITS.lbm, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.TEMPERATURE = { unit: UNITS.degF, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.FORCE = { unit: UNITS.lbf, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.ENERGY = { unit: UNITS.BTU, prefix: PREFIXES.BTU[""] }, UNIT_SYSTEMS.us.POWER = { unit: UNITS.hp, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.PRESSURE = { unit: UNITS.psi, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.auto = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));var currentUnitSystem = UNIT_SYSTEMS.auto;for (var _key2 in Unit.setUnitSystem = function (name) {if (object_hasOwnProperty(UNIT_SYSTEMS, name)) currentUnitSystem = UNIT_SYSTEMS[name];else throw new Error("Unit system " + name + " does not exist. Choices are: " + Object.keys(UNIT_SYSTEMS).join(", "));}, Unit.getUnitSystem = function () {for (var _key in UNIT_SYSTEMS) if (object_hasOwnProperty(UNIT_SYSTEMS, _key) && UNIT_SYSTEMS[_key] === currentUnitSystem) return _key;}, Unit.typeConverters = { BigNumber: function BigNumber(x) {return new _BigNumber(x + "");}, Fraction: function Fraction(x) {return new _Fraction(x);}, Complex: function Complex(x) {return x;}, number: function number(x) {return x;} }, Unit._getNumberConverter = function (type) {if (!Unit.typeConverters[type]) throw new TypeError("Unsupported type \"" + type + "\"");return Unit.typeConverters[type];}, UNITS) if (object_hasOwnProperty(UNITS, _key2)) {var unit = UNITS[_key2];unit.dimensions = unit.base.dimensions;}for (var _name2 in ALIASES) if (object_hasOwnProperty(ALIASES, _name2)) {var _unit2 = UNITS[ALIASES[_name2]],alias = {};for (var _key3 in _unit2) object_hasOwnProperty(_unit2, _key3) && (alias[_key3] = _unit2[_key3]);alias.name = _name2, UNITS[_name2] = alias;}return Unit.isValidAlpha = function isValidAlpha(c) {return /^[a-zA-Z]$/.test(c);}, Unit.createUnit = function (obj, options) {if ("object" != typeof obj) throw new TypeError("createUnit expects first parameter to be of type 'Object'");if (options && options.override) for (var _key4 in obj) if (object_hasOwnProperty(obj, _key4) && Unit.deleteUnit(_key4), obj[_key4].aliases) for (var i = 0; i < obj[_key4].aliases.length; i++) Unit.deleteUnit(obj[_key4].aliases[i]);var lastUnit;for (var _key5 in obj) object_hasOwnProperty(obj, _key5) && (lastUnit = Unit.createUnitSingle(_key5, obj[_key5]));return lastUnit;}, Unit.createUnitSingle = function (name, obj, options) {if (("undefined" == typeof obj || null === obj) && (obj = {}), "string" != typeof name) throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if (object_hasOwnProperty(UNITS, name)) throw new Error("Cannot create unit \"" + name + "\": a unit with that name already exists");assertUnitNameIsValid(name);var definition,prefixes,baseName,defUnit = null,aliases = [],offset = 0;if (obj && "Unit" === obj.type) defUnit = obj.clone();else if ("string" == typeof obj) "" != obj && (definition = obj);else if ("object" == typeof obj) definition = obj.definition, prefixes = obj.prefixes, offset = obj.offset, baseName = obj.baseName, obj.aliases && (aliases = obj.aliases.valueOf());else throw new TypeError("Cannot create unit \"" + name + "\" from \"" + obj.toString() + "\": expecting \"string\" or \"Unit\" or \"Object\"");if (aliases) for (var i = 0; i < aliases.length; i++) if (object_hasOwnProperty(UNITS, aliases[i])) throw new Error("Cannot create alias \"" + aliases[i] + "\": a unit with that name already exists");if (definition && "string" == typeof definition && !defUnit) try {defUnit = Unit.parse(definition, { allowNoUnits: !0 });} catch (ex) {throw ex.message = "Could not create unit \"" + name + "\" from \"" + definition + "\": " + ex.message, ex;} else definition && "Unit" === definition.type && (defUnit = definition.clone());aliases = aliases || [], offset = offset || 0, prefixes = prefixes && prefixes.toUpperCase ? PREFIXES[prefixes.toUpperCase()] || PREFIXES.NONE : PREFIXES.NONE;var newUnit = {};if (!defUnit) {if (baseName = baseName || name + "_STUFF", 0 <= BASE_DIMENSIONS.indexOf(baseName)) throw new Error("Cannot create new base unit \"" + name + "\": a base unit with that name already exists (and cannot be overridden)");for (var b in BASE_DIMENSIONS.push(baseName), BASE_UNITS) object_hasOwnProperty(BASE_UNITS, b) && (BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0);for (var newBaseUnit = { dimensions: [] }, _i6 = 0; _i6 < BASE_DIMENSIONS.length; _i6++) newBaseUnit.dimensions[_i6] = 0;newBaseUnit.dimensions[BASE_DIMENSIONS.length - 1] = 1, newBaseUnit.key = baseName, BASE_UNITS[baseName] = newBaseUnit, newUnit = { name: name, value: 1, dimensions: BASE_UNITS[baseName].dimensions.slice(0), prefixes: prefixes, offset: offset, base: BASE_UNITS[baseName] }, currentUnitSystem[baseName] = { unit: newUnit, prefix: PREFIXES.NONE[""] };} else {newUnit = { name: name, value: defUnit.value, dimensions: defUnit.dimensions.slice(0), prefixes: prefixes, offset: offset };var anyMatch = !1;for (var _i7 in BASE_UNITS) if (object_hasOwnProperty(BASE_UNITS, _i7)) {for (var match = !0, j = 0; j < BASE_DIMENSIONS.length; j++) if (1e-12 < Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[_i7].dimensions[j] || 0))) {match = !1;break;}if (match) {anyMatch = !0, newUnit.base = BASE_UNITS[_i7];break;}}if (!anyMatch) {baseName = baseName || name + "_STUFF";var _newBaseUnit = { dimensions: defUnit.dimensions.slice(0) };_newBaseUnit.key = baseName, BASE_UNITS[baseName] = _newBaseUnit, currentUnitSystem[baseName] = { unit: newUnit, prefix: PREFIXES.NONE[""] }, newUnit.base = BASE_UNITS[baseName];}}Unit.UNITS[name] = newUnit;for (var _i8 = 0; _i8 < aliases.length; _i8++) {var aliasName = aliases[_i8],_alias = {};for (var _key6 in newUnit) object_hasOwnProperty(newUnit, _key6) && (_alias[_key6] = newUnit[_key6]);_alias.name = aliasName, Unit.UNITS[aliasName] = _alias;}return delete _findUnit.cache, new Unit(null, name);}, Unit.deleteUnit = function (name) {delete Unit.UNITS[name];}, Unit.PREFIXES = PREFIXES, Unit.BASE_DIMENSIONS = BASE_DIMENSIONS, Unit.BASE_UNITS = BASE_UNITS, Unit.UNIT_SYSTEMS = UNIT_SYSTEMS, Unit.UNITS = UNITS, Unit;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/unit/function/createUnit.js
var createUnit_name = "createUnit",createUnit_dependencies = ["typed", "Unit"];var createCreateUnit = factory("createUnit", createUnit_dependencies, (_ref) => {var { typed, Unit } = _ref;return typed(createUnit_name, { "Object, Object": function (obj, options) {return Unit.createUnit(obj, options);}, Object: function (obj) {return Unit.createUnit(obj, {});}, "string, Unit | string | Object, Object": function (name, def, options) {var obj = {};return obj[name] = def, Unit.createUnit(obj, options);}, "string, Unit | string | Object": function (name, def) {var obj = {};return obj[name] = def, Unit.createUnit(obj, {});}, string: function (name) {var obj = {};return obj[name] = {}, Unit.createUnit(obj, {});} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/eigs/complexEigs.js
function createComplexEigs(_ref) {function balance(arr, N, prec, type, findVectors) {var Rdiag,big = "BigNumber" === type,cplx = "Complex" === type,zero = big ? bignumber(0) : cplx ? complex(0) : 0,one = big ? bignumber(1) : cplx ? complex(1) : 1,radix = big ? bignumber(10) : 2,radixSq = multiplyScalar(radix, radix);findVectors && (Rdiag = Array(N).fill(one));for (var last = !1; !last;) {last = !0;for (var i = 0; i < N; i++) {for (var colNorm = zero, rowNorm = zero, j = 0; j < N; j++) if (i !== j) {var c = abs(arr[i][j]);colNorm = addScalar(colNorm, c), rowNorm = addScalar(rowNorm, c);}if (!equal(colNorm, 0) && !equal(rowNorm, 0)) {for (var f = one, _c = colNorm, rowDivRadix = divideScalar(rowNorm, radix), rowMulRadix = multiplyScalar(rowNorm, radix); smaller(_c, rowDivRadix);) _c = multiplyScalar(_c, radixSq), f = multiplyScalar(f, radix);for (; larger(_c, rowMulRadix);) _c = divideScalar(_c, radixSq), f = divideScalar(f, radix);var condition = smaller(divideScalar(addScalar(_c, rowNorm), f), multiplyScalar(addScalar(colNorm, rowNorm), .95));if (condition) {last = !1;for (var g = divideScalar(1, f), _j = 0; _j < N; _j++) i !== _j && (arr[i][_j] = multiplyScalar(arr[i][_j], f), arr[_j][i] = multiplyScalar(arr[_j][i], g));findVectors && (Rdiag[i] = multiplyScalar(Rdiag[i], f));}}}}return diag(Rdiag);}function reduceToHessenberg(arr, N, prec, type, findVectors, R) {var big = "BigNumber" === type,zero = big ? bignumber(0) : "Complex" === type ? complex(0) : 0;big && (prec = bignumber(prec));for (var i = 0; i < N - 2; i++) {for (var el, maxIndex = 0, max = zero, j = i + 1; j < N; j++) el = arr[j][i], smaller(abs(max), abs(el)) && (max = el, maxIndex = j);if (!smaller(abs(max), prec)) {if (maxIndex !== i + 1) {var tmp1 = arr[maxIndex];arr[maxIndex] = arr[i + 1], arr[i + 1] = tmp1;for (var tmp2, _j2 = 0; _j2 < N; _j2++) tmp2 = arr[_j2][maxIndex], arr[_j2][maxIndex] = arr[_j2][i + 1], arr[_j2][i + 1] = tmp2;if (findVectors) {var tmp3 = R[maxIndex];R[maxIndex] = R[i + 1], R[i + 1] = tmp3;}}for (var n, _j3 = i + 2; _j3 < N; _j3++) if (n = divideScalar(arr[_j3][i], max), 0 !== n) {for (var k = 0; k < N; k++) arr[_j3][k] = subtract(arr[_j3][k], multiplyScalar(n, arr[i + 1][k]));for (var _k = 0; _k < N; _k++) arr[_k][i + 1] = addScalar(arr[_k][i + 1], multiplyScalar(n, arr[_k][_j3]));if (findVectors) for (var _k2 = 0; _k2 < N; _k2++) R[_j3][_k2] = subtract(R[_j3][_k2], multiplyScalar(n, R[i + 1][_k2]));}}}return R;}function iterateUntilTriangular(A, N, prec, type, findVectors) {var big = "BigNumber" === type,one = big ? bignumber(1) : "Complex" === type ? complex(1) : 1;big && (prec = bignumber(prec));for (var arr = clone(A), lambdas = [], n = N, Sdiag = [], Qtotal = findVectors ? diag(Array(N).fill(one)) : void 0, Qpartial = findVectors ? diag(Array(n).fill(one)) : void 0, lastConvergenceBefore = 0; 100 >= lastConvergenceBefore;) {lastConvergenceBefore += 1;for (var k = 0, i = 0; i < n; i++) arr[i][i] = subtract(arr[i][i], k);var { Q, R } = qr(arr);arr = multiply(R, Q);for (var _i = 0; _i < n; _i++) arr[_i][_i] = addScalar(arr[_i][_i], k);if (findVectors && (Qpartial = multiply(Qpartial, Q)), 1 === n || smaller(abs(arr[n - 1][n - 2]), prec)) {lastConvergenceBefore = 0, lambdas.push(arr[n - 1][n - 1]), findVectors && (Sdiag.unshift([[1]]), inflateMatrix(Qpartial, N), Qtotal = multiply(Qtotal, Qpartial), 1 < n && (Qpartial = diag(Array(n - 1).fill(one)))), n -= 1, arr.pop();for (var _i2 = 0; _i2 < n; _i2++) arr[_i2].pop();} else if (2 === n || smaller(abs(arr[n - 2][n - 3]), prec)) {lastConvergenceBefore = 0;var ll = eigenvalues2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1]);lambdas.push(...ll), findVectors && (Sdiag.unshift(jordanBase2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1], ll[0], ll[1], prec, type)), inflateMatrix(Qpartial, N), Qtotal = multiply(Qtotal, Qpartial), 2 < n && (Qpartial = diag(Array(n - 2).fill(one)))), n -= 2, arr.pop(), arr.pop();for (var _i3 = 0; _i3 < n; _i3++) arr[_i3].pop(), arr[_i3].pop();}if (0 === n) break;}if (lambdas.sort((a, b) => +subtract(abs(a), abs(b))), 100 < lastConvergenceBefore) {var err = Error("The eigenvalues failed to converge. Only found these eigenvalues: " + lambdas.join(", "));throw err.values = lambdas, err.vectors = [], err;}var C = findVectors ? multiply(Qtotal, blockDiag(Sdiag, N)) : void 0;return { values: lambdas, C };}function findEigenvectors(A, N, C, values, prec) {var Cinv = inv(C),U = multiply(Cinv, A, C),uniqueValues = [],multiplicities = [];for (var λ of values) {var i = indexOf(uniqueValues, λ, equal);if (-1 === i) {var rounded = round(λ, subtract(-1, round(log10(prec))));uniqueValues.push(rounded), multiplicities.push(1);} else multiplicities[i] += 1;}for (var vectors = [], len = uniqueValues.length, b = Array(N).fill(0), E = diag(Array(N).fill(1)), failedLambdas = [], _i4 = 0; _i4 < len; _i4++) {var _λ = uniqueValues[_i4],solutions = usolveAll(subtract(U, multiply(_λ, E)), b);solutions = solutions.map((v) => multiply(C, v)), solutions.shift(), solutions.length < multiplicities[_i4] && failedLambdas.push(_λ), vectors.push(...solutions.map((v) => flatten(v)));}if (0 !== failedLambdas.length) {var err = new Error("Failed to find eigenvectors for the following eigenvalues: " + failedLambdas.join(", "));throw err.values = values, err.vectors = vectors, err;}return vectors;}function eigenvalues2x2(a, b, c, d) {var trA = addScalar(a, d),detA = subtract(multiplyScalar(a, d), multiplyScalar(b, c)),x = multiplyScalar(trA, .5),y = multiplyScalar(sqrt(subtract(multiplyScalar(trA, trA), multiplyScalar(4, detA))), .5);return [addScalar(x, y), subtract(x, y)];}function jordanBase2x2(a, b, c, d, l1, l2, prec, type) {var big = "BigNumber" === type,cplx = "Complex" === type,zero = big ? bignumber(0) : cplx ? complex(0) : 0,one = big ? bignumber(1) : cplx ? complex(1) : 1;if (smaller(abs(c), prec)) return [[one, zero], [zero, one]];if (larger(abs(subtract(l1, l2)), prec)) return [[subtract(l1, d), subtract(l2, d)], [c, c]];var na = subtract(a, l1),nb = subtract(b, l1),nc = subtract(c, l1),nd = subtract(d, l1);return smaller(abs(nb), prec) ? [[na, one], [nc, zero]] : [[nb, zero], [nd, one]];}function inflateMatrix(arr, N) {for (var i = 0; i < arr.length; i++) arr[i].push(...Array(N - arr[i].length).fill(0));for (var _i5 = arr.length; _i5 < N; _i5++) arr.push(Array(N).fill(0)), arr[_i5][_i5] = 1;return arr;}function blockDiag(arr, N) {for (var M = [], i = 0; i < N; i++) M[i] = Array(N).fill(0);var I = 0;for (var sub of arr) {for (var n = sub.length, _i6 = 0; _i6 < n; _i6++) for (var j = 0; j < n; j++) M[I + _i6][I + j] = sub[_i6][j];I += n;}return M;}function indexOf(arr, el, fn) {for (var i = 0; i < arr.length; i++) if (fn(arr[i], el)) return i;return -1;}var { addScalar, subtract, flatten, multiply, multiplyScalar, divideScalar, sqrt, abs, bignumber, diag, inv, qr, usolveAll, equal, complex, larger, smaller, round, log10, transpose, matrixFromColumns } = _ref;return function (arr, N, prec, type, findVectors) {void 0 === findVectors && (findVectors = !0);var R = balance(arr, N, prec, type, findVectors);reduceToHessenberg(arr, N, prec, type, findVectors, R);var { values, C } = iterateUntilTriangular(arr, N, prec, type, findVectors);C = multiply(inv(R), C);var vectors;return findVectors && (vectors = findEigenvectors(arr, N, C, values, prec), vectors = matrixFromColumns(...vectors)), { values, vectors };};}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/eigs/realSymetric.js
function createRealSymmetric(_ref) {function diag(x, precision) {for (var psi, N = x.length, e0 = Math.abs(precision / N), Sij = Array(N), i = 0; i < N; i++) Sij[i] = createArray(N, 0), Sij[i][i] = 1;for (var Vab = getAij(x); Math.abs(Vab[1]) >= Math.abs(e0);) {var _i = Vab[0][0],j = Vab[0][1];psi = getTheta(x[_i][_i], x[j][j], x[_i][j]), x = x1(x, psi, _i, j), Sij = Sij1(Sij, psi, _i, j), Vab = getAij(x);}for (var Ei = createArray(N, 0), _i2 = 0; _i2 < N; _i2++) Ei[_i2] = x[_i2][_i2];return sorting(clone(Ei), clone(Sij));}function diagBig(x, precision) {for (var psi, N = x.length, e0 = abs(precision / N), Sij = Array(N), i = 0; i < N; i++) Sij[i] = createArray(N, 0), Sij[i][i] = 1;for (var Vab = getAijBig(x); abs(Vab[1]) >= abs(e0);) {var _i3 = Vab[0][0],j = Vab[0][1];psi = getThetaBig(x[_i3][_i3], x[j][j], x[_i3][j]), x = x1Big(x, psi, _i3, j), Sij = Sij1Big(Sij, psi, _i3, j), Vab = getAijBig(x);}for (var Ei = createArray(N, 0), _i4 = 0; _i4 < N; _i4++) Ei[_i4] = x[_i4][_i4];return sorting(clone(Ei), clone(Sij));}function getTheta(aii, ajj, aij) {return Math.abs(ajj - aii) <= config.epsilon ? Math.PI / 4 : .5 * Math.atan(2 * aij / (ajj - aii));}function getThetaBig(aii, ajj, aij) {var denom = subtract(ajj, aii);return abs(denom) <= config.epsilon ? bignumber(-1).acos().div(4) : multiplyScalar(.5, atan(multiply(2, aij, inv(denom))));}function Sij1(Sij, theta, i, j) {for (var N = Sij.length, c = Math.cos(theta), s = Math.sin(theta), Ski = createArray(N, 0), Skj = createArray(N, 0), k = 0; k < N; k++) Ski[k] = c * Sij[k][i] - s * Sij[k][j], Skj[k] = s * Sij[k][i] + c * Sij[k][j];for (var _k = 0; _k < N; _k++) Sij[_k][i] = Ski[_k], Sij[_k][j] = Skj[_k];return Sij;}function Sij1Big(Sij, theta, i, j) {for (var N = Sij.length, c = cos(theta), s = sin(theta), Ski = createArray(N, bignumber(0)), Skj = createArray(N, bignumber(0)), k = 0; k < N; k++) Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j])), Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j]));for (var _k2 = 0; _k2 < N; _k2++) Sij[_k2][i] = Ski[_k2], Sij[_k2][j] = Skj[_k2];return Sij;}function x1Big(Hij, theta, i, j) {for (var N = Hij.length, c = bignumber(cos(theta)), s = bignumber(sin(theta)), c2 = multiplyScalar(c, c), s2 = multiplyScalar(s, s), Aki = createArray(N, bignumber(0)), Akj = createArray(N, bignumber(0)), csHij = multiply(bignumber(2), c, s, Hij[i][j]), Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j])), Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j])), k = 0; k < N; k++) Aki[k] = subtract(multiplyScalar(c, Hij[i][k]), multiplyScalar(s, Hij[j][k])), Akj[k] = addScalar(multiplyScalar(s, Hij[i][k]), multiplyScalar(c, Hij[j][k]));Hij[i][i] = Aii, Hij[j][j] = Ajj, Hij[i][j] = bignumber(0), Hij[j][i] = bignumber(0);for (var _k3 = 0; _k3 < N; _k3++) _k3 !== i && _k3 !== j && (Hij[i][_k3] = Aki[_k3], Hij[_k3][i] = Aki[_k3], Hij[j][_k3] = Akj[_k3], Hij[_k3][j] = Akj[_k3]);return Hij;}function x1(Hij, theta, i, j) {for (var N = Hij.length, c = Math.cos(theta), s = Math.sin(theta), c2 = c * c, s2 = s * s, Aki = createArray(N, 0), Akj = createArray(N, 0), Aii = c2 * Hij[i][i] - 2 * c * s * Hij[i][j] + s2 * Hij[j][j], Ajj = s2 * Hij[i][i] + 2 * c * s * Hij[i][j] + c2 * Hij[j][j], k = 0; k < N; k++) Aki[k] = c * Hij[i][k] - s * Hij[j][k], Akj[k] = s * Hij[i][k] + c * Hij[j][k];Hij[i][i] = Aii, Hij[j][j] = Ajj, Hij[i][j] = 0, Hij[j][i] = 0;for (var _k4 = 0; _k4 < N; _k4++) _k4 !== i && _k4 !== j && (Hij[i][_k4] = Aki[_k4], Hij[_k4][i] = Aki[_k4], Hij[j][_k4] = Akj[_k4], Hij[_k4][j] = Akj[_k4]);return Hij;}function getAij(Mij) {for (var N = Mij.length, maxMij = 0, maxIJ = [0, 1], i = 0; i < N; i++) for (var j = i + 1; j < N; j++) Math.abs(maxMij) < Math.abs(Mij[i][j]) && (maxMij = Math.abs(Mij[i][j]), maxIJ = [i, j]);return [maxIJ, maxMij];}function getAijBig(Mij) {for (var N = Mij.length, maxMij = 0, maxIJ = [0, 1], i = 0; i < N; i++) for (var j = i + 1; j < N; j++) abs(maxMij) < abs(Mij[i][j]) && (maxMij = abs(Mij[i][j]), maxIJ = [i, j]);return [maxIJ, maxMij];}function sorting(E, S) {for (var N = E.length, values = Array(N), vectors = Array(N), k = 0; k < N; k++) vectors[k] = Array(N);for (var i = 0; i < N; i++) {for (var minID = 0, minE = E[0], j = 0; j < E.length; j++) abs(E[j]) < abs(minE) && (minID = j, minE = E[minID]);values[i] = E.splice(minID, 1)[0];for (var _k5 = 0; _k5 < N; _k5++) vectors[_k5][i] = S[_k5][minID], S[_k5].splice(minID, 1);}return { values, vectors };}function createArray(size, value) {for (var array = Array(size), i = 0; i < size; i++) array[i] = value;return array;}var { config, addScalar, subtract, abs, atan, cos, sin, multiplyScalar, inv, bignumber, multiply, add } = _ref;return function (arr) {var prec = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : config.epsilon,type = 3 < arguments.length ? arguments[3] : void 0;if ("number" === type) return diag(arr, prec);if ("BigNumber" === type) return diagBig(arr, prec);throw TypeError("Unsupported data type: " + type);};}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/eigs.js
var eigs_name = "eigs",eigs_dependencies = ["config", "typed", "matrix", "addScalar", "equal", "subtract", "abs", "atan", "cos", "sin", "multiplyScalar", "divideScalar", "inv", "bignumber", "multiply", "add", "larger", "column", "flatten", "number", "complex", "sqrt", "diag", "qr", "usolveAll", "im", "re", "smaller", "round", "log10", "transpose", "matrixFromColumns"];var createEigs = factory("eigs", eigs_dependencies, (_ref) => {function computeValuesAndVectors(mat, prec) {prec === void 0 && (prec = config.epsilon);var size = mat.size();if (2 !== size.length || size[0] !== size[1]) throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");var arr = mat.toArray(),N = size[0];if (isReal(arr, N, prec) && (coerceReal(arr, N), isSymmetric(arr, N, prec))) {var _type = coerceTypes(mat, arr, N);return doRealSymetric(arr, N, prec, _type);}var type = coerceTypes(mat, arr, N);return doComplexEigs(arr, N, prec, type);}function isSymmetric(arr, N, prec) {for (var i = 0; i < N; i++) for (var j = i; j < N; j++) if (larger(bignumber(abs(subtract(arr[i][j], arr[j][i]))), prec)) return !1;return !0;}function isReal(arr, N, prec) {for (var i = 0; i < N; i++) for (var j = 0; j < N; j++) if (larger(bignumber(abs(im(arr[i][j]))), prec)) return !1;return !0;}function coerceReal(arr, N) {for (var i = 0; i < N; i++) for (var j = 0; j < N; j++) arr[i][j] = re(arr[i][j]);}function coerceTypes(mat, arr, N) {var type = mat.datatype();if ("number" === type || "BigNumber" === type || "Complex" === type) return type;for (var hasNumber = !1, hasBig = !1, hasComplex = !1, i = 0; i < N; i++) for (var el, j = 0; j < N; j++) if (el = arr[i][j], isNumber(el) || isFraction(el)) hasNumber = !0;else if (isBigNumber(el)) hasBig = !0;else if (isComplex(el)) hasComplex = !0;else throw TypeError("Unsupported type in Matrix: " + typeOf(el));if (hasBig && hasComplex && console.warn("Complex BigNumbers not supported, this operation will lose precission."), hasComplex) {for (var _i = 0; _i < N; _i++) for (var _j = 0; _j < N; _j++) arr[_i][_j] = complex(arr[_i][_j]);return "Complex";}if (hasBig) {for (var _i2 = 0; _i2 < N; _i2++) for (var _j2 = 0; _j2 < N; _j2++) arr[_i2][_j2] = bignumber(arr[_i2][_j2]);return "BigNumber";}if (hasNumber) {for (var _i3 = 0; _i3 < N; _i3++) for (var _j3 = 0; _j3 < N; _j3++) arr[_i3][_j3] = number(arr[_i3][_j3]);return "number";}throw TypeError("Matrix contains unsupported types only.");}var { config, typed, matrix, addScalar, subtract, equal, abs, atan, cos, sin, multiplyScalar, divideScalar, inv, bignumber, multiply, add, larger, column, flatten, number, complex, sqrt, diag, qr, usolveAll, im, re, smaller, round, log10, transpose, matrixFromColumns } = _ref,doRealSymetric = createRealSymmetric({ config, addScalar, subtract, column, flatten, equal, abs, atan, cos, sin, multiplyScalar, inv, bignumber, complex, multiply, add }),doComplexEigs = createComplexEigs({ config, addScalar, subtract, multiply, multiplyScalar, flatten, divideScalar, sqrt, abs, bignumber, diag, qr, inv, usolveAll, equal, complex, larger, smaller, round, log10, transpose, matrixFromColumns });return typed("eigs", { Array: function (x) {var mat = matrix(x);return computeValuesAndVectors(mat);}, "Array, number|BigNumber": function (x, prec) {var mat = matrix(x);return computeValuesAndVectors(mat, prec);}, Matrix: function (mat) {var { values, vectors } = computeValuesAndVectors(mat);return { values: matrix(values), vectors: matrix(vectors) };}, "Matrix, number|BigNumber": function (mat, prec) {var { values, vectors } = computeValuesAndVectors(mat, prec);return { values: matrix(values), vectors: matrix(vectors) };} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/geometry/intersect.js
var intersect_name = "intersect",intersect_dependencies = ["typed", "config", "abs", "add", "addScalar", "matrix", "multiply", "multiplyScalar", "divideScalar", "subtract", "smaller", "equalScalar"];var createIntersect = factory("intersect", intersect_dependencies, (_ref) => {function _isNumeric(a) {return "number" == typeof a || isBigNumber(a);}function _2d(x) {return 2 === x.length && _isNumeric(x[0]) && _isNumeric(x[1]);}function _3d(x) {return 3 === x.length && _isNumeric(x[0]) && _isNumeric(x[1]) && _isNumeric(x[2]);}function _4d(x) {return 4 === x.length && _isNumeric(x[0]) && _isNumeric(x[1]) && _isNumeric(x[2]) && _isNumeric(x[3]);}function _intersect2d(p1a, p1b, p2a, p2b) {var o1 = p1a,o2 = p2a,d1 = subtract(o1, p1b),d2 = subtract(o2, p2b),det = subtract(multiplyScalar(d1[0], d2[1]), multiplyScalar(d2[0], d1[1]));if (smaller(abs(det), config.epsilon)) return null;var d20o11 = multiplyScalar(d2[0], o1[1]),d21o10 = multiplyScalar(d2[1], o1[0]),d20o21 = multiplyScalar(d2[0], o2[1]),d21o20 = multiplyScalar(d2[1], o2[0]),t = divideScalar(addScalar(subtract(subtract(d20o11, d21o10), d20o21), d21o20), det);return add(multiply(d1, t), o1);}function _intersect3dHelper(a, b, c, d, e, f, g, h, i, j, k, l) {var add1 = multiplyScalar(subtract(a, b), subtract(c, d)),add2 = multiplyScalar(subtract(e, f), subtract(g, h)),add3 = multiplyScalar(subtract(i, j), subtract(k, l));return addScalar(addScalar(add1, add2), add3);}function _intersect3d(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) {var d1343 = _intersect3dHelper(x1, x3, x4, x3, y1, y3, y4, y3, z1, z3, z4, z3),d4321 = _intersect3dHelper(x4, x3, x2, x1, y4, y3, y2, y1, z4, z3, z2, z1),d1321 = _intersect3dHelper(x1, x3, x2, x1, y1, y3, y2, y1, z1, z3, z2, z1),d4343 = _intersect3dHelper(x4, x3, x4, x3, y4, y3, y4, y3, z4, z3, z4, z3),d2121 = _intersect3dHelper(x2, x1, x2, x1, y2, y1, y2, y1, z2, z1, z2, z1),ta = divideScalar(subtract(multiplyScalar(d1343, d4321), multiplyScalar(d1321, d4343)), subtract(multiplyScalar(d2121, d4343), multiplyScalar(d4321, d4321))),tb = divideScalar(addScalar(d1343, multiplyScalar(ta, d4321)), d4343),pax = addScalar(x1, multiplyScalar(ta, subtract(x2, x1))),pay = addScalar(y1, multiplyScalar(ta, subtract(y2, y1))),paz = addScalar(z1, multiplyScalar(ta, subtract(z2, z1))),pbx = addScalar(x3, multiplyScalar(tb, subtract(x4, x3))),pby = addScalar(y3, multiplyScalar(tb, subtract(y4, y3))),pbz = addScalar(z3, multiplyScalar(tb, subtract(z4, z3)));return equalScalar(pax, pbx) && equalScalar(pay, pby) && equalScalar(paz, pbz) ? [pax, pay, paz] : null;}function _intersectLinePlane(x1, y1, z1, x2, y2, z2, x, y, z, c) {var x1x = multiplyScalar(x1, x),x2x = multiplyScalar(x2, x),y1y = multiplyScalar(y1, y),y2y = multiplyScalar(y2, y),z1z = multiplyScalar(z1, z),z2z = multiplyScalar(z2, z),t = divideScalar(subtract(subtract(subtract(c, x1x), y1y), z1z), subtract(subtract(subtract(addScalar(addScalar(x2x, y2y), z2z), x1x), y1y), z1z)),px = addScalar(x1, multiplyScalar(t, subtract(x2, x1))),py = addScalar(y1, multiplyScalar(t, subtract(y2, y1))),pz = addScalar(z1, multiplyScalar(t, subtract(z2, z1)));return [px, py, pz];}var { typed, config, abs, add, addScalar, matrix, multiply, multiplyScalar, divideScalar, subtract, smaller, equalScalar } = _ref;return typed("intersect", { "Array, Array, Array": function (x, y, plane) {if (!_3d(x)) throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if (!_3d(y)) throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if (!_4d(plane)) throw new TypeError("Array with 4 numbers expected as third argument");return _intersectLinePlane(x[0], x[1], x[2], y[0], y[1], y[2], plane[0], plane[1], plane[2], plane[3]);}, "Array, Array, Array, Array": function (w, x, y, z) {if (2 === w.length) {if (!_2d(w)) throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if (!_2d(x)) throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if (!_2d(y)) throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if (!_2d(z)) throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return _intersect2d(w, x, y, z);}if (3 === w.length) {if (!_3d(w)) throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if (!_3d(x)) throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if (!_3d(y)) throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if (!_3d(z)) throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return _intersect3d(w[0], w[1], w[2], x[0], x[1], x[2], y[0], y[1], y[2], z[0], z[1], z[2]);}throw new TypeError("Arrays with two or thee dimensional points expected");}, "Matrix, Matrix, Matrix": function (x, y, plane) {return matrix(this(x.valueOf(), y.valueOf(), plane.valueOf()));}, "Matrix, Matrix, Matrix, Matrix": function (w, x, y, z) {return matrix(this(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf()));} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/std.js
var std_name = "std",std_dependencies = ["typed", "sqrt", "variance"];var createStd = factory("std", std_dependencies, (_ref) => {function _std(array) {if (0 === array.length) throw new SyntaxError("Function std requires one or more parameters (0 provided)");try {return sqrt(variance.apply(null, arguments));} catch (err) {if (err instanceof TypeError && -1 !== err.message.indexOf(" variance")) throw new TypeError(err.message.replace(" variance", " std"));else throw err;}}var { typed, sqrt, variance } = _ref;return typed(std_name, { "Array | Matrix": _std, "Array | Matrix, string": _std, "Array | Matrix, number | BigNumber": _std, "Array | Matrix, number | BigNumber, string": _std, "...": function (args) {return _std(args);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/solver/usolve.js
var usolve_name = "usolve",usolve_dependencies = ["typed", "matrix", "divideScalar", "multiplyScalar", "subtract", "equalScalar", "DenseMatrix"];var createUsolve = factory("usolve", usolve_dependencies, (_ref) => {function _denseBackwardSubstitution(m, b) {b = solveValidation(m, b, !0);for (var bdata = b._data, rows = m._size[0], columns = m._size[1], x = [], mdata = m._data, j = columns - 1; 0 <= j; j--) {var bj = bdata[j][0] || 0,xj = void 0;if (!equalScalar(bj, 0)) {var vjj = mdata[j][j];if (equalScalar(vjj, 0)) throw new Error("Linear system cannot be solved since matrix is singular");xj = divideScalar(bj, vjj);for (var i = j - 1; 0 <= i; i--) bdata[i] = [subtract(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];} else xj = 0;x[j] = [xj];}return new DenseMatrix({ data: x, size: [rows, 1] });}function _sparseBackwardSubstitution(m, b) {b = solveValidation(m, b, !0);for (var bj, bdata = b._data, rows = m._size[0], columns = m._size[1], values = m._values, index = m._index, ptr = m._ptr, x = [], j = columns - 1; 0 <= j; j--) if (bj = bdata[j][0] || 0, !equalScalar(bj, 0)) {for (var i, vjj = 0, jValues = [], jIndices = [], firstIndex = ptr[j], lastIndex = ptr[j + 1], k = lastIndex - 1; k >= firstIndex; k--) i = index[k], i === j ? vjj = values[k] : i < j && (jValues.push(values[k]), jIndices.push(i));if (equalScalar(vjj, 0)) throw new Error("Linear system cannot be solved since matrix is singular");for (var _i, xj = divideScalar(bj, vjj), _k = 0, _lastIndex = jIndices.length; _k < _lastIndex; _k++) _i = jIndices[_k], bdata[_i] = [subtract(bdata[_i][0], multiplyScalar(xj, jValues[_k]))];x[j] = [xj];} else x[j] = [0];return new DenseMatrix({ data: x, size: [rows, 1] });}var { typed, matrix, divideScalar, multiplyScalar, subtract, equalScalar, DenseMatrix } = _ref,solveValidation = createSolveValidation({ DenseMatrix });return typed(usolve_name, { "SparseMatrix, Array | Matrix": function (m, b) {return _sparseBackwardSubstitution(m, b);}, "DenseMatrix, Array | Matrix": function (m, b) {return _denseBackwardSubstitution(m, b);}, "Array, Array | Matrix": function (a, b) {var m = matrix(a),r = _denseBackwardSubstitution(m, b);return r.valueOf();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/arithmetic/norm.js
var norm_name = "norm",norm_dependencies = ["typed", "abs", "add", "pow", "conj", "sqrt", "multiply", "equalScalar", "larger", "smaller", "matrix", "ctranspose", "eigs"];var createNorm = factory("norm", norm_dependencies, (_ref) => {function _vectorNormPlusInfinity(x) {var pinf = 0;return x.forEach(function (value) {var v = abs(value);larger(v, pinf) && (pinf = v);}, !0), pinf;}function _vectorNormMinusInfinity(x) {var ninf;return x.forEach(function (value) {var v = abs(value);(!ninf || smaller(v, ninf)) && (ninf = v);}, !0), ninf || 0;}function _vectorNorm(x, p) {if (p === Number.POSITIVE_INFINITY || "inf" === p) return _vectorNormPlusInfinity(x);if (p === Number.NEGATIVE_INFINITY || "-inf" === p) return _vectorNormMinusInfinity(x);if ("fro" === p) return _norm(x, 2);if ("number" == typeof p && !isNaN(p)) {if (!equalScalar(p, 0)) {var n = 0;return x.forEach(function (value) {n = add(pow(abs(value), p), n);}, !0), pow(n, 1 / p);}return Number.POSITIVE_INFINITY;}throw new Error("Unsupported parameter value");}function _matrixNormFrobenius(x) {var fro = 0;return x.forEach(function (value) {fro = add(fro, multiply(value, conj(value)));}), abs(sqrt(fro));}function _matrixNormOne(x) {var c = [],maxc = 0;return x.forEach(function (value, index) {var j = index[1],cj = add(c[j] || 0, abs(value));larger(cj, maxc) && (maxc = cj), c[j] = cj;}, !0), maxc;}function _matrixNormTwo(x) {var sizeX = x.size();if (sizeX[0] !== sizeX[1]) throw new RangeError("Invalid matrix dimensions");var tx = ctranspose(x),squaredX = multiply(tx, x),eigenVals = eigs(squaredX).values.toArray(),rho = eigenVals[eigenVals.length - 1];return abs(sqrt(rho));}function _matrixNormInfinity(x) {var r = [],maxr = 0;return x.forEach(function (value, index) {var i = index[0],ri = add(r[i] || 0, abs(value));larger(ri, maxr) && (maxr = ri), r[i] = ri;}, !0), maxr;}function _matrixNorm(x, p) {if (1 === p) return _matrixNormOne(x);if (p === Number.POSITIVE_INFINITY || "inf" === p) return _matrixNormInfinity(x);if ("fro" === p) return _matrixNormFrobenius(x);if (2 === p) return _matrixNormTwo(x);throw new Error("Unsupported parameter value " + p);}function _norm(x, p) {var sizeX = x.size();if (1 === sizeX.length) return _vectorNorm(x, p);if (2 === sizeX.length) {if (sizeX[0] && sizeX[1]) return _matrixNorm(x, p);throw new RangeError("Invalid matrix dimensions");}}var { typed, abs, add, pow, conj, sqrt, multiply, equalScalar, larger, smaller, matrix, ctranspose, eigs } = _ref;return typed(norm_name, { number: Math.abs, Complex: function (x) {return x.abs();}, BigNumber: function (x) {return x.abs();}, boolean: function (x) {return Math.abs(x);}, Array: function (x) {return _norm(matrix(x), 2);}, Matrix: function (x) {return _norm(x, 2);}, "number | Complex | BigNumber | boolean, number | BigNumber | string": function (x) {return this(x);}, "Array, number | BigNumber | string": function (x, p) {return _norm(matrix(x), p);}, "Matrix, number | BigNumber | string": function (x, p) {return _norm(x, p);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/sparse/csIpvec.js
function csIpvec(p, b) {var k,n = b.length,x = [];if (p) for (k = 0; k < n; k++) x[p[k]] = b[k];else for (k = 0; k < n; k++) x[k] = b[k];return x;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/solver/lusolve.js
var lusolve_name = "lusolve",lusolve_dependencies = ["typed", "matrix", "lup", "slu", "usolve", "lsolve", "DenseMatrix"];var createLusolve = factory("lusolve", lusolve_dependencies, (_ref) => {function _toMatrix(a) {if (isMatrix(a)) return a;if (isArray(a)) return matrix(a);throw new TypeError("Invalid Matrix LU decomposition");}function _lusolve(l, u, p, q, b) {l = _toMatrix(l), u = _toMatrix(u), p && (b = solveValidation(l, b, !0), b._data = csIpvec(p, b._data));var y = lsolve(l, b),x = usolve(u, y);return q && (x._data = csIpvec(q, x._data)), x;}var { typed, matrix, lup, slu, usolve, lsolve, DenseMatrix } = _ref,solveValidation = createSolveValidation({ DenseMatrix });return typed(lusolve_name, { "Array, Array | Matrix": function (a, b) {a = matrix(a);var d = lup(a),x = _lusolve(d.L, d.U, d.p, null, b);return x.valueOf();}, "DenseMatrix, Array | Matrix": function (a, b) {var d = lup(a);return _lusolve(d.L, d.U, d.p, null, b);}, "SparseMatrix, Array | Matrix": function (a, b) {var d = lup(a);return _lusolve(d.L, d.U, d.p, null, b);}, "SparseMatrix, Array | Matrix, number, number": function (a, b, order, threshold) {var d = slu(a, order, threshold);return _lusolve(d.L, d.U, d.p, d.q, b);}, "Object, Array | Matrix": function (d, b) {return _lusolve(d.L, d.U, d.p, d.q, b);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/sqrtm.js
var sqrtm_name = "sqrtm",sqrtm_dependencies = ["typed", "abs", "add", "multiply", "sqrt", "subtract", "inv", "size", "max", "identity"];var createSqrtm = factory("sqrtm", sqrtm_dependencies, (_ref) => {function _denmanBeavers(A) {var error,iterations = 0,Y = A,Z = identity(size(A));do {var Yk = Y;if (Y = multiply(.5, add(Yk, inv(Z))), Z = multiply(.5, add(Z, inv(Yk))), error = max(abs(subtract(Y, Yk))), error > _tolerance && 1000 < ++iterations) throw new Error("computing square root of matrix: iterative method could not converge");} while (error > _tolerance);return Y;}var { typed, abs, add, multiply, sqrt, subtract, inv, size, max, identity } = _ref,_tolerance = 1e-6;return typed(sqrtm_name, { "Array | Matrix": function (A) {var size = isMatrix(A) ? A.size() : arraySize(A);switch (size.length) {case 1:if (1 === size[0]) return sqrt(A);throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");case 2:{var rows = size[0],cols = size[1];if (rows === cols) return _denmanBeavers(A);throw new RangeError("Matrix must be square (size: " + string_format(size) + ")");}default:throw new RangeError("Matrix must be at most two dimensional (size: " + string_format(size) + ")");}} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/probability/multinomial.js
var multinomial_name = "multinomial",multinomial_dependencies = ["typed", "add", "divide", "multiply", "factorial", "isInteger", "isPositive"];var createMultinomial = factory("multinomial", multinomial_dependencies, (_ref) => {var { typed, add, divide, multiply, factorial, isInteger, isPositive } = _ref;return typed(multinomial_name, { "Array | Matrix": function (a) {var sum = 0,denom = 1;return deepForEach(a, function (ai) {if (!isInteger(ai) || !isPositive(ai)) throw new TypeError("Positive integer value expected in function multinomial");sum = add(sum, ai), denom = multiply(denom, factorial(ai));}), divide(factorial(sum), denom);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/rotationMatrix.js
var rotationMatrix_name = "rotationMatrix",rotationMatrix_dependencies = ["typed", "config", "multiplyScalar", "addScalar", "unaryMinus", "norm", "matrix", "BigNumber", "DenseMatrix", "SparseMatrix", "cos", "sin"];var createRotationMatrix = factory("rotationMatrix", rotationMatrix_dependencies, (_ref) => {function _rotationMatrix2x2(theta, format) {var Big = isBigNumber(theta),minusOne = Big ? new BigNumber(-1) : -1,cosTheta = cos(theta),sinTheta = sin(theta),data = [[cosTheta, multiplyScalar(minusOne, sinTheta)], [sinTheta, cosTheta]];return _convertToFormat(data, format);}function _validateVector(v) {var size = v.size();if (1 > size.length || 3 !== size[0]) throw new RangeError("Vector must be of dimensions 1x3");}function _mul(array) {return array.reduce((p, curr) => multiplyScalar(p, curr));}function _convertToFormat(data, format) {if (format) {if ("sparse" === format) return new SparseMatrix(data);if ("dense" === format) return new DenseMatrix(data);throw new TypeError("Unknown matrix type \"".concat(format, "\""));}return data;}function _rotationMatrix3x3(theta, v, format) {var normV = norm(v);if (0 === normV) throw new RangeError("Rotation around zero vector");var Big = isBigNumber(theta) ? BigNumber : null,one = Big ? new Big(1) : 1,minusOne = Big ? new Big(-1) : -1,vx = Big ? new Big(v.get([0]) / normV) : v.get([0]) / normV,vy = Big ? new Big(v.get([1]) / normV) : v.get([1]) / normV,vz = Big ? new Big(v.get([2]) / normV) : v.get([2]) / normV,c = cos(theta),oneMinusC = addScalar(one, unaryMinus(c)),s = sin(theta),r11 = addScalar(c, _mul([vx, vx, oneMinusC])),r12 = addScalar(_mul([vx, vy, oneMinusC]), _mul([minusOne, vz, s])),r13 = addScalar(_mul([vx, vz, oneMinusC]), _mul([vy, s])),r21 = addScalar(_mul([vx, vy, oneMinusC]), _mul([vz, s])),r22 = addScalar(c, _mul([vy, vy, oneMinusC])),r23 = addScalar(_mul([vy, vz, oneMinusC]), _mul([minusOne, vx, s])),r31 = addScalar(_mul([vx, vz, oneMinusC]), _mul([minusOne, vy, s])),r32 = addScalar(_mul([vy, vz, oneMinusC]), _mul([vx, s])),r33 = addScalar(c, _mul([vz, vz, oneMinusC]));return _convertToFormat([[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]], format);}var { typed, config, multiplyScalar, addScalar, unaryMinus, norm, BigNumber, matrix, DenseMatrix, SparseMatrix, cos, sin } = _ref;return typed(rotationMatrix_name, { "": function () {return "Matrix" === config.matrix ? matrix([]) : [];}, string: function (format) {return matrix(format);}, "number | BigNumber | Complex | Unit": function (theta) {return _rotationMatrix2x2(theta, "Matrix" === config.matrix ? "dense" : void 0);}, "number | BigNumber | Complex | Unit, string": function (theta, format) {return _rotationMatrix2x2(theta, format);}, "number | BigNumber | Complex | Unit, Array": function (theta, v) {var matrixV = matrix(v);return _validateVector(matrixV), _rotationMatrix3x3(theta, matrixV, void 0);}, "number | BigNumber | Complex | Unit, Matrix": function (theta, v) {_validateVector(v);var storageType = v.storage() || ("Matrix" === config.matrix ? "dense" : void 0);return _rotationMatrix3x3(theta, v, storageType);}, "number | BigNumber | Complex | Unit, Array, string": function (theta, v, format) {var matrixV = matrix(v);return _validateVector(matrixV), _rotationMatrix3x3(theta, matrixV, format);}, "number | BigNumber | Complex | Unit, Matrix, string": function (theta, v, format) {return _validateVector(v), _rotationMatrix3x3(theta, v, format);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/median.js
var median_name = "median",median_dependencies = ["typed", "add", "divide", "compare", "partitionSelect"];var createMedian = factory("median", median_dependencies, (_ref) => {function _median(array) {try {array = flatten(array.valueOf());var num = array.length;if (0 === num) throw new Error("Cannot calculate median of an empty array");if (0 == num % 2) {for (var mid = num / 2 - 1, right = partitionSelect(array, mid + 1), left = array[mid], i = 0; i < mid; ++i) 0 < compare(array[i], left) && (left = array[i]);return middle2(left, right);}var m = partitionSelect(array, (num - 1) / 2);return middle(m);} catch (err) {throw improveErrorMessage(err, "median");}}var { typed, add, divide, compare, partitionSelect } = _ref,middle = typed({ "number | BigNumber | Complex | Unit": function (value) {return value;} }),middle2 = typed({ "number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit": function (left, right) {return divide(add(left, right), 2);} });return typed(median_name, { "Array | Matrix": _median, "Array | Matrix, number | BigNumber": function () {throw new Error("median(A, dim) is not yet supported");}, "...": function (args) {if (containsCollections(args)) throw new TypeError("Scalar values expected in function median");return _median(args);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/matrix/rotate.js
var rotate_name = "rotate",rotate_dependencies = ["typed", "multiply", "rotationMatrix"];var createRotate = factory("rotate", rotate_dependencies, (_ref) => {function _validateSize(v, expectedSize) {var actualSize = Array.isArray(v) ? arraySize(v) : v.size();if (2 < actualSize.length) throw new RangeError("Vector must be of dimensions 1x".concat(expectedSize));if (2 === actualSize.length && 1 !== actualSize[1]) throw new RangeError("Vector must be of dimensions 1x".concat(expectedSize));if (actualSize[0] !== expectedSize) throw new RangeError("Vector must be of dimensions 1x".concat(expectedSize));}var { typed, multiply, rotationMatrix } = _ref;return typed(rotate_name, { "Array , number | BigNumber | Complex | Unit": function (w, theta) {_validateSize(w, 2);var matrixRes = multiply(rotationMatrix(theta), w);return matrixRes.toArray();}, "Matrix , number | BigNumber | Complex | Unit": function (w, theta) {return _validateSize(w, 2), multiply(rotationMatrix(theta), w);}, "Array, number | BigNumber | Complex | Unit, Array | Matrix": function (w, theta, v) {_validateSize(w, 3);var matrixRes = multiply(rotationMatrix(theta, v), w);return matrixRes;}, "Matrix, number | BigNumber | Complex | Unit, Array | Matrix": function (w, theta, v) {return _validateSize(w, 3), multiply(rotationMatrix(theta, v), w);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/statistics/mad.js
var mad_name = "mad",mad_dependencies = ["typed", "abs", "map", "median", "subtract"];var createMad = factory("mad", mad_dependencies, (_ref) => {function _mad(array) {if (array = flatten(array.valueOf()), 0 === array.length) throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try {var med = median(array);return median(map(array, function (value) {return abs(subtract(value, med));}));} catch (err) {if (err instanceof TypeError && -1 !== err.message.indexOf("median")) throw new TypeError(err.message.replace("median", "mad"));else throw improveErrorMessage(err, "mad");}}var { typed, abs, map, median, subtract } = _ref;return typed(mad_name, { "Array | Matrix": _mad, "...": function (args) {return _mad(args);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/unit/function/unit.js
var unit_name = "unit",unit_dependencies = ["typed", "Unit"];var createUnitFunction = factory("unit", unit_dependencies, (_ref) => {var { typed, Unit } = _ref;return typed(unit_name, { Unit: function (x) {return x.clone();}, string: function (x) {return Unit.isValuelessUnit(x) ? new Unit(null, x) : Unit.parse(x, { allowNoUnits: !0 });}, "number | BigNumber | Fraction | Complex, string": function (value, unit) {return new Unit(value, unit);}, "Array | Matrix": function (x) {return deepMap(x, this);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/pureFunctionsAny.generated.js
var ResultSet = createResultSet({});var Complex = createComplexClass({});var Range = createRangeClass({});var _false = createFalse({});var _null = createNull({});var _true = createTrue({});var BigNumber = createBigNumberClass({ config: config });var Matrix = createMatrixClass({});var replacer = createReplacer({});var i = createI({ Complex });var LN10 = createLN10({ BigNumber, config: config });var LOG10E = createLOG10E({ BigNumber, config: config });var _NaN = createNaN({ BigNumber, config: config });var pureFunctionsAny_generated_pi = createPi({ BigNumber, config: config });var SQRT1_2 = createSQRT1_2({ BigNumber, config: config });var pureFunctionsAny_generated_tau = createTau({ BigNumber, config: config });var efimovFactor = createEfimovFactor({ BigNumber, config: config });var fineStructure = createFineStructure({ BigNumber, config: config });var sackurTetrode = createSackurTetrode({ BigNumber, config: config });var weakMixingAngle = createWeakMixingAngle({ BigNumber, config: config });var Fraction = createFractionClass({});var pureFunctionsAny_generated_e = createE({ BigNumber, config: config });var _Infinity = createInfinity({ BigNumber, config: config });var LOG2E = createLOG2E({ BigNumber, config: config });var pureFunctionsAny_generated_version = createVersion({});var DenseMatrix = createDenseMatrixClass({ Matrix });var pureFunctionsAny_generated_phi = createPhi({ BigNumber, config: config });var typed = createTyped({ BigNumber, Complex, DenseMatrix, Fraction });var pureFunctionsAny_generated_isInteger = createIsInteger({ typed });var isNumeric = createIsNumeric({ typed });var isPositive = createIsPositive({ typed });var pureFunctionsAny_generated_isNaN = createIsNaN({ typed });var equalScalar = createEqualScalar({ config: config, typed });var number = createNumber({ typed });var pureFunctionsAny_generated_boolean = createBoolean({ typed });var pureFunctionsAny_generated_complex = createComplex({ Complex, typed });var splitUnit = createSplitUnit({ typed });var unaryPlus = createUnaryPlus({ BigNumber, config: config, typed });var apply = createApply({ isInteger: pureFunctionsAny_generated_isInteger, typed });var cube = createCube({ typed });var pureFunctionsAny_generated_expm1 = createExpm1({ Complex, typed });var pureFunctionsAny_generated_log10 = createLog10({ Complex, config: config, typed });var multiplyScalar = createMultiplyScalar({ typed });var pureFunctionsAny_generated_sign = createSign({ BigNumber, Fraction, complex: pureFunctionsAny_generated_complex, typed });var square = createSquare({ typed });var bitNot = createBitNot({ typed });var arg = createArg({ typed });var im = createIm({ typed });var not = createNot({ typed });var pureFunctionsAny_generated_filter = createFilter({ typed });var pureFunctionsAny_generated_forEach = createForEach({ typed });var pureFunctionsAny_generated_map = map_createMap({ typed });var erf = createErf({ typed });var pureFunctionsAny_generated_format = createFormat({ typed });var oct = createOct({ format: pureFunctionsAny_generated_format, typed });var print = createPrint({ typed });var isPrime = createIsPrime({ typed });var acos = createAcos({ Complex, config: config, typed });var acot = createAcot({ BigNumber, typed });var acsc = createAcsc({ BigNumber, Complex, config: config, typed });var asec = createAsec({ BigNumber, Complex, config: config, typed });var asin = createAsin({ Complex, config: config, typed });var atan = createAtan({ typed });var pureFunctionsAny_generated_atanh = createAtanh({ Complex, config: config, typed });var pureFunctionsAny_generated_cosh = createCosh({ typed });var coth = createCoth({ BigNumber, typed });var csch = createCsch({ BigNumber, typed });var sech = createSech({ BigNumber, typed });var pureFunctionsAny_generated_sinh = createSinh({ typed });var pureFunctionsAny_generated_tanh = createTanh({ typed });var combinations = createCombinations({ typed });var pickRandom = createPickRandom({ config: config, typed });var randomInt = createRandomInt({ config: config, typed });var LN2 = createLN2({ BigNumber, config: config });var pureFunctionsAny_generated_clone = createClone({ typed });var hasNumericValue = createHasNumericValue({ isNumeric, typed });var pureFunctionsAny_generated_typeOf = createTypeOf({ typed });var string = createString({ typed });var pureFunctionsAny_generated_fraction = createFraction({ Fraction, typed });var unaryMinus = createUnaryMinus({ typed });var addScalar = createAddScalar({ typed });var exp = createExp({ typed });var pureFunctionsAny_generated_log2 = createLog2({ Complex, config: config, typed });var sqrt = createSqrt({ Complex, config: config, typed });var conj = createConj({ typed });var getMatrixDataType = createGetMatrixDataType({ typed });var mode = createMode({ isNaN: pureFunctionsAny_generated_isNaN, isNumeric, typed });var bin = createBin({ format: pureFunctionsAny_generated_format, typed });var pureFunctionsAny_generated_acosh = createAcosh({ Complex, config: config, typed });var acsch = createAcsch({ BigNumber, typed });var pureFunctionsAny_generated_asinh = createAsinh({ typed });var cos = createCos({ typed });var csc = createCsc({ BigNumber, typed });var sin = createSin({ typed });var combinationsWithRep = createCombinationsWithRep({ typed });var random = createRandom({ config: config, typed });var SQRT2 = createSQRT2({ BigNumber, config: config });var isNegative = createIsNegative({ typed });var SparseMatrix = createSparseMatrixClass({ Matrix, equalScalar, typed });var matrix = createMatrix({ DenseMatrix, Matrix, SparseMatrix, typed });var abs = createAbs({ typed });var gcd = createGcd({ BigNumber, DenseMatrix, equalScalar, matrix, typed });var mod = createMod({ DenseMatrix, equalScalar, matrix, typed });var nthRoot = createNthRoot({ BigNumber, equalScalar, matrix, typed });var xgcd = createXgcd({ BigNumber, config: config, matrix, typed });var bitAnd = createBitAnd({ equalScalar, matrix, typed });var pureFunctionsAny_generated_bitXor = createBitXor({ DenseMatrix, matrix, typed });var or = createOr({ DenseMatrix, equalScalar, matrix, typed });var concat = createConcat({ isInteger: pureFunctionsAny_generated_isInteger, matrix, typed });var diag = createDiag({ DenseMatrix, SparseMatrix, matrix, typed });var identity = createIdentity({ BigNumber, DenseMatrix, SparseMatrix, config: config, matrix, typed });var ones = createOnes({ BigNumber, config: config, matrix, typed });var pureFunctionsAny_generated_reshape = createReshape({ isInteger: pureFunctionsAny_generated_isInteger, matrix, typed });var size = createSize({ matrix, config: config, typed });var subset = createSubset({ matrix, typed });var pureFunctionsAny_generated_zeros = createZeros({ BigNumber, config: config, matrix, typed });var hex = createHex({ format: pureFunctionsAny_generated_format, typed });var round = createRound({ BigNumber, DenseMatrix, equalScalar, matrix, typed, zeros: pureFunctionsAny_generated_zeros });var leftShift = createLeftShift({ DenseMatrix, equalScalar, matrix, typed, zeros: pureFunctionsAny_generated_zeros });var rightLogShift = createRightLogShift({ DenseMatrix, equalScalar, matrix, typed, zeros: pureFunctionsAny_generated_zeros });var compare = createCompare({ BigNumber, DenseMatrix, Fraction, config: config, equalScalar, matrix, typed });var pureFunctionsAny_generated_compareText = createCompareText({ matrix, typed });var smaller = createSmaller({ DenseMatrix, config: config, matrix, typed });var larger = createLarger({ DenseMatrix, config: config, matrix, typed });var unequal = createUnequal({ DenseMatrix, config: config, equalScalar, matrix, typed });var ImmutableDenseMatrix = createImmutableDenseMatrixClass({ DenseMatrix, smaller });var FibonacciHeap = createFibonacciHeapClass({ larger, smaller });var sparse = createSparse({ SparseMatrix, typed });var acoth = createAcoth({ BigNumber, Complex, config: config, typed });var atan2 = createAtan2({ BigNumber, DenseMatrix, equalScalar, matrix, typed });var sec = createSec({ BigNumber, typed });var add = createAdd({ DenseMatrix, SparseMatrix, addScalar, equalScalar, matrix, typed });var dot = createDot({ addScalar, conj, multiplyScalar, size, typed });var composition = createComposition({ addScalar, combinations, isInteger: pureFunctionsAny_generated_isInteger, isNegative, isPositive, larger, typed });var isZero = createIsZero({ typed });var matrixFromFunction = createMatrixFromFunction({ isZero, matrix, typed });var pureFunctionsAny_generated_cbrt = createCbrt({ BigNumber, Complex, Fraction, config: config, isNegative, matrix, typed, unaryMinus });var floor = createFloor({ config: config, equalScalar, matrix, round, typed });var multiply = createMultiply({ addScalar, dot, equalScalar, matrix, multiplyScalar, typed });var dotMultiply = createDotMultiply({ equalScalar, matrix, multiplyScalar, typed });var re = createRe({ typed });var pureFunctionsAny_generated_flatten = createFlatten({ matrix, typed });var pureFunctionsAny_generated_resize = createResize({ config: config, matrix });var pureFunctionsAny_generated_squeeze = createSqueeze({ matrix, typed });var to = createTo({ matrix, typed });var pow = createPow({ Complex, config: config, fraction: pureFunctionsAny_generated_fraction, identity, matrix, multiply, number, typed });var dotPow = createDotPow({ DenseMatrix, equalScalar, matrix, pow, typed });var rightArithShift = createRightArithShift({ DenseMatrix, equalScalar, matrix, typed, zeros: pureFunctionsAny_generated_zeros });var compareNatural = createCompareNatural({ compare, typed });var equalText = createEqualText({ compareText: pureFunctionsAny_generated_compareText, isZero, typed });var largerEq = createLargerEq({ DenseMatrix, config: config, matrix, typed });var partitionSelect = createPartitionSelect({ compare, isNaN: pureFunctionsAny_generated_isNaN, isNumeric, typed });var Index = createIndexClass({ ImmutableDenseMatrix });var asech = createAsech({ BigNumber, Complex, config: config, typed });var tan = createTan({ typed });var setDifference = createSetDifference({ DenseMatrix, Index, compareNatural, size, subset, typed });var setIntersect = createSetIntersect({ DenseMatrix, Index, compareNatural, size, subset, typed });var setMultiplicity = createSetMultiplicity({ Index, compareNatural, size, subset, typed });var setSize = createSetSize({ compareNatural, typed });var trace = createTrace({ add, matrix, typed });var quantileSeq = createQuantileSeq({ add, compare, multiply, partitionSelect, typed });var gamma = createGamma({ BigNumber, Complex, config: config, multiplyScalar, pow, typed });var bignumber = createBignumber({ BigNumber, typed });var matrixFromColumns = createMatrixFromColumns({ flatten: pureFunctionsAny_generated_flatten, matrix, size, typed });var lcm = createLcm({ equalScalar, matrix, typed });var bitOr = createBitOr({ DenseMatrix, equalScalar, matrix, typed });var kron = createKron({ matrix, multiplyScalar, typed });var transpose = createTranspose({ matrix, typed });var numeric = createNumeric({ bignumber, fraction: pureFunctionsAny_generated_fraction, number });var and = createAnd({ equalScalar, matrix, not, typed, zeros: pureFunctionsAny_generated_zeros });var smallerEq = createSmallerEq({ DenseMatrix, config: config, matrix, typed });var sort = createSort({ compare, compareNatural, matrix, typed });var min = createMin({ config: config, numeric, smaller, typed });var cot = createCot({ BigNumber, typed });var setDistinct = createSetDistinct({ DenseMatrix, Index, compareNatural, size, subset, typed });var setPowerset = createSetPowerset({ Index, compareNatural, size, subset, typed });var index = createIndex({ Index, typed });var sum = createSum({ add, config: config, numeric, typed });var factorial = createFactorial({ gamma, typed });var permutations = createPermutations({ factorial, typed });var matrixFromRows = createMatrixFromRows({ flatten: pureFunctionsAny_generated_flatten, matrix, size, typed });var subtract = createSubtract({ DenseMatrix, addScalar, equalScalar, matrix, typed, unaryMinus });var cross = createCross({ matrix, multiply, subtract, typed });var range = createRange({ bignumber, matrix, config: config, larger, largerEq, smaller, smallerEq, typed });var row = createRow({ Index, matrix, range, typed });var prod = createProd({ config: config, multiplyScalar, numeric, typed });var equal = createEqual({ DenseMatrix, equalScalar, matrix, typed });var max = createMax({ config: config, larger, numeric, typed });var setCartesian = createSetCartesian({ DenseMatrix, Index, compareNatural, size, subset, typed });var setSymDifference = createSetSymDifference({ Index, concat, setDifference, size, subset, typed });var ceil = createCeil({ config: config, equalScalar, matrix, round, typed });var xor = createXor({ DenseMatrix, matrix, typed });var count = createCount({ prod, size, typed });var ctranspose = createCtranspose({ conj, transpose, typed });var deepEqual = createDeepEqual({ equal, typed });var setIsSubset = createSetIsSubset({ Index, compareNatural, size, subset, typed });var fix = createFix({ Complex, ceil, floor, matrix, typed });var diff = createDiff({ matrix, number, subtract, typed });var divideScalar = createDivideScalar({ numeric, typed });var nthRoots = createNthRoots({ Complex, config: config, divideScalar, typed });var lsolve = createLsolve({ DenseMatrix, divideScalar, equalScalar, matrix, multiplyScalar, subtract, typed });var lsolveAll = createLsolveAll({ DenseMatrix, divideScalar, equalScalar, matrix, multiplyScalar, subtract, typed });var Spa = createSpaClass({ FibonacciHeap, addScalar, equalScalar });var setUnion = createSetUnion({ Index, concat, setIntersect, setSymDifference, size, subset, typed });var lup = createLup({ DenseMatrix, Spa, SparseMatrix, abs, addScalar, divideScalar, equalScalar, larger, matrix, multiplyScalar, subtract, typed, unaryMinus });var slu = createSlu({ SparseMatrix, abs, add, divideScalar, larger, largerEq, multiply, subtract, transpose, typed });var det = createDet({ lup, matrix, multiply, subtract, typed, unaryMinus });var distance = createDistance({ abs, addScalar, divideScalar, multiplyScalar, sqrt, subtract, typed, unaryMinus });var stirlingS2 = createStirlingS2({ addScalar, combinations, divideScalar, factorial, isInteger: pureFunctionsAny_generated_isInteger, isNegative, larger, multiplyScalar, pow, subtract, typed });var catalan = createCatalan({ addScalar, combinations, divideScalar, isInteger: pureFunctionsAny_generated_isInteger, isNegative, multiplyScalar, typed });var column = createColumn({ Index, matrix, range, typed });var log = createLog({ Complex, config: config, divideScalar, typed });var dotDivide = createDotDivide({ DenseMatrix, divideScalar, equalScalar, matrix, typed });var usolveAll = createUsolveAll({ DenseMatrix, divideScalar, equalScalar, matrix, multiplyScalar, subtract, typed });var hypot = createHypot({ abs, addScalar, divideScalar, isPositive, multiplyScalar, smaller, sqrt, typed });var qr = createQr({ addScalar, complex: pureFunctionsAny_generated_complex, conj, divideScalar, equal, identity, isZero, matrix, multiplyScalar, sign: pureFunctionsAny_generated_sign, sqrt, subtract, typed, unaryMinus, zeros: pureFunctionsAny_generated_zeros });var inv = createInv({ abs, addScalar, det, divideScalar, identity, matrix, multiply, typed, unaryMinus });var expm = createExpm({ abs, add, identity, inv, multiply, typed });var divide = createDivide({ divideScalar, equalScalar, inv, matrix, multiply, typed });var mean = createMean({ add, divide, typed });var variance = createVariance({ add, apply, divide, isNaN: pureFunctionsAny_generated_isNaN, multiply, subtract, typed });var kldivergence = createKldivergence({ divide, dotDivide, isNumeric, log, matrix, multiply, sum, typed });var bellNumbers = createBellNumbers({ addScalar, isInteger: pureFunctionsAny_generated_isInteger, isNegative, stirlingS2, typed });var pureFunctionsAny_generated_log1p = createLog1p({ Complex, config: config, divideScalar, log, typed });var Unit = createUnitClass({ BigNumber, Complex, Fraction, abs, addScalar, config: config, divideScalar, equal, fix, format: pureFunctionsAny_generated_format, isNumeric, multiplyScalar, number, pow, round, subtract });var createUnit = createCreateUnit({ Unit, typed });var eigs = createEigs({ abs, add, addScalar, atan, bignumber, column, complex: pureFunctionsAny_generated_complex, config: config, cos, diag, divideScalar, equal, flatten: pureFunctionsAny_generated_flatten, im, inv, larger, log10: pureFunctionsAny_generated_log10, matrix, matrixFromColumns, multiply, multiplyScalar, number, qr, re, round, sin, smaller, sqrt, subtract, transpose, typed, usolveAll });var intersect = createIntersect({ abs, add, addScalar, config: config, divideScalar, equalScalar, matrix, multiply, multiplyScalar, smaller, subtract, typed });var std = createStd({ sqrt, typed, variance });var atomicMass = createAtomicMass({ BigNumber, Unit, config: config });var bohrMagneton = createBohrMagneton({ BigNumber, Unit, config: config });var boltzmann = createBoltzmann({ BigNumber, Unit, config: config });var conductanceQuantum = createConductanceQuantum({ BigNumber, Unit, config: config });var deuteronMass = createDeuteronMass({ BigNumber, Unit, config: config });var electronMass = createElectronMass({ BigNumber, Unit, config: config });var faraday = createFaraday({ BigNumber, Unit, config: config });var firstRadiation = createFirstRadiation({ BigNumber, Unit, config: config });var gravitationConstant = createGravitationConstant({ BigNumber, Unit, config: config });var hartreeEnergy = createHartreeEnergy({ BigNumber, Unit, config: config });var klitzing = createKlitzing({ BigNumber, Unit, config: config });var magneticConstant = createMagneticConstant({ BigNumber, Unit, config: config });var molarMass = createMolarMass({ BigNumber, Unit, config: config });var molarPlanckConstant = createMolarPlanckConstant({ BigNumber, Unit, config: config });var neutronMass = createNeutronMass({ BigNumber, Unit, config: config });var planckCharge = createPlanckCharge({ BigNumber, Unit, config: config });var planckLength = createPlanckLength({ BigNumber, Unit, config: config });var planckTemperature = createPlanckTemperature({ BigNumber, Unit, config: config });var protonMass = createProtonMass({ BigNumber, Unit, config: config });var reducedPlanckConstant = createReducedPlanckConstant({ BigNumber, Unit, config: config });var secondRadiation = createSecondRadiation({ BigNumber, Unit, config: config });var stefanBoltzmann = createStefanBoltzmann({ BigNumber, Unit, config: config });var vacuumImpedance = createVacuumImpedance({ BigNumber, Unit, config: config });var usolve = createUsolve({ DenseMatrix, divideScalar, equalScalar, matrix, multiplyScalar, subtract, typed });var norm = createNorm({ abs, add, conj, ctranspose, eigs, equalScalar, larger, matrix, multiply, pow, smaller, sqrt, typed });var lusolve = createLusolve({ DenseMatrix, lsolve, lup, matrix, slu, typed, usolve });var sqrtm = createSqrtm({ abs, add, identity, inv, max, multiply, size, sqrt, subtract, typed });var multinomial = createMultinomial({ add, divide, factorial, isInteger: pureFunctionsAny_generated_isInteger, isPositive, multiply, typed });var avogadro = createAvogadro({ BigNumber, Unit, config: config });var classicalElectronRadius = createClassicalElectronRadius({ BigNumber, Unit, config: config });var electricConstant = createElectricConstant({ BigNumber, Unit, config: config });var fermiCoupling = createFermiCoupling({ BigNumber, Unit, config: config });var gravity = createGravity({ BigNumber, Unit, config: config });var loschmidt = createLoschmidt({ BigNumber, Unit, config: config });var molarMassC12 = createMolarMassC12({ BigNumber, Unit, config: config });var nuclearMagneton = createNuclearMagneton({ BigNumber, Unit, config: config });var planckMass = createPlanckMass({ BigNumber, Unit, config: config });var quantumOfCirculation = createQuantumOfCirculation({ BigNumber, Unit, config: config });var speedOfLight = createSpeedOfLight({ BigNumber, Unit, config: config });var wienDisplacement = createWienDisplacement({ BigNumber, Unit, config: config });var rotationMatrix = createRotationMatrix({ BigNumber, DenseMatrix, SparseMatrix, addScalar, config: config, cos, matrix, multiplyScalar, norm, sin, typed, unaryMinus });var median = createMedian({ add, compare, divide, partitionSelect, typed });var bohrRadius = createBohrRadius({ BigNumber, Unit, config: config });var elementaryCharge = createElementaryCharge({ BigNumber, Unit, config: config });var inverseConductanceQuantum = createInverseConductanceQuantum({ BigNumber, Unit, config: config });var molarVolume = createMolarVolume({ BigNumber, Unit, config: config });var planckTime = createPlanckTime({ BigNumber, Unit, config: config });var thomsonCrossSection = createThomsonCrossSection({ BigNumber, Unit, config: config });var rotate = createRotate({ multiply, rotationMatrix, typed });var mad = createMad({ abs, map: pureFunctionsAny_generated_map, median, subtract, typed });var coulomb = createCoulomb({ BigNumber, Unit, config: config });var magneticFluxQuantum = createMagneticFluxQuantum({ BigNumber, Unit, config: config });var rydberg = createRydberg({ BigNumber, Unit, config: config });var unit = createUnitFunction({ Unit, typed });var gasConstant = createGasConstant({ BigNumber, Unit, config: config });var planckConstant = createPlanckConstant({ BigNumber, Unit, config: config });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/keywords.js
var keywords = new Set(["end"]);
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/Node.js
var Node_name = "Node",Node_dependencies = ["mathWithTransform"];var createNode = factory("Node", Node_dependencies, (_ref) => {function Node() {if (!(this instanceof Node)) throw new SyntaxError("Constructor must be called with the new operator");}function _validateScope(scope) {for (var symbol of [...keywords]) if (scope.has(symbol)) throw new Error("Scope contains an illegal symbol, \"" + symbol + "\" is a reserved keyword");}var { mathWithTransform } = _ref;return Node.prototype.evaluate = function (scope) {return this.compile().evaluate(scope);}, Node.prototype.type = "Node", Node.prototype.isNode = !0, Node.prototype.comment = "", Node.prototype.compile = function () {var expr = this._compile(mathWithTransform, {}),args = {};return { evaluate: function (scope) {var s = createMap(scope);return _validateScope(s), expr(s, args, null);} };}, Node.prototype._compile = function () {throw new Error("Method _compile should be implemented by type " + this.type);}, Node.prototype.forEach = function () {throw new Error("Cannot run forEach on a Node interface");}, Node.prototype.map = function () {throw new Error("Cannot run map on a Node interface");}, Node.prototype._ifNode = function (node) {if (!isNode(node)) throw new TypeError("Callback function must return a Node");return node;}, Node.prototype.traverse = function (callback) {function _traverse(node, callback) {node.forEach(function (child, path, parent) {callback(child, path, parent), _traverse(child, callback);});}callback(this, null, null), _traverse(this, callback);}, Node.prototype.transform = function (callback) {function _transform(child, path, parent) {var replacement = callback(child, path, parent);return replacement === child ? child.map(_transform) : replacement;}return _transform(this, null, null);}, Node.prototype.filter = function (callback) {var nodes = [];return this.traverse(function (node, path, parent) {callback(node, path, parent) && nodes.push(node);}), nodes;}, Node.prototype.clone = function () {throw new Error("Cannot clone a Node interface");}, Node.prototype.cloneDeep = function () {return this.map(function (node) {return node.cloneDeep();});}, Node.prototype.equals = function (other) {return !!other && deepStrictEqual(this, other);}, Node.prototype.toString = function (options) {var customString = this._getCustomString(options);return "undefined" == typeof customString ? this._toString(options) : customString;}, Node.prototype.toJSON = function () {throw new Error("Cannot serialize object: toJSON not implemented by " + this.type);}, Node.prototype.toHTML = function (options) {var customString = this._getCustomString(options);return "undefined" == typeof customString ? this.toHTML(options) : customString;}, Node.prototype._toString = function () {throw new Error("_toString not implemented for " + this.type);}, Node.prototype.toTex = function (options) {var customString = this._getCustomString(options);return "undefined" == typeof customString ? this._toTex(options) : customString;}, Node.prototype._toTex = function () {throw new Error("_toTex not implemented for " + this.type);}, Node.prototype._getCustomString = function (options) {if (options && "object" == typeof options) switch (typeof options.handler) {case "object":case "undefined":return;case "function":return options.handler(this, options);default:throw new TypeError("Object or function expected as callback");}}, Node.prototype.getIdentifier = function () {return this.type;}, Node.prototype.getContent = function () {return this;}, Node;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/ArrayNode.js
var ArrayNode_name = "ArrayNode",ArrayNode_dependencies = ["Node"];var createArrayNode = factory("ArrayNode", ArrayNode_dependencies, (_ref) => {function ArrayNode(items) {if (!(this instanceof ArrayNode)) throw new SyntaxError("Constructor must be called with the new operator");if (this.items = items || [], !Array.isArray(this.items) || !this.items.every(isNode)) throw new TypeError("Array containing Nodes expected");}var { Node } = _ref;return ArrayNode.prototype = new Node(), ArrayNode.prototype.type = "ArrayNode", ArrayNode.prototype.isArrayNode = !0, ArrayNode.prototype._compile = function (math, argNames) {var evalItems = map(this.items, function (item) {return item._compile(math, argNames);}),asMatrix = "Array" !== math.config.matrix;if (asMatrix) {var matrix = math.matrix;return function (scope, args, context) {return matrix(map(evalItems, function (evalItem) {return evalItem(scope, args, context);}));};}return function (scope, args, context) {return map(evalItems, function (evalItem) {return evalItem(scope, args, context);});};}, ArrayNode.prototype.forEach = function (callback) {for (var node, i = 0; i < this.items.length; i++) node = this.items[i], callback(node, "items[" + i + "]", this);}, ArrayNode.prototype.map = function (callback) {for (var items = [], i = 0; i < this.items.length; i++) items[i] = this._ifNode(callback(this.items[i], "items[" + i + "]", this));return new ArrayNode(items);}, ArrayNode.prototype.clone = function () {return new ArrayNode(this.items.slice(0));}, ArrayNode.prototype._toString = function (options) {var items = this.items.map(function (node) {return node.toString(options);});return "[" + items.join(", ") + "]";}, ArrayNode.prototype.toJSON = function () {return { mathjs: "ArrayNode", items: this.items };}, ArrayNode.fromJSON = function (json) {return new ArrayNode(json.items);}, ArrayNode.prototype.toHTML = function (options) {var items = this.items.map(function (node) {return node.toHTML(options);});return "<span class=\"math-parenthesis math-square-parenthesis\">[</span>" + items.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-parenthesis math-square-parenthesis\">]</span>";}, ArrayNode.prototype._toTex = function (options) {var s = "\\begin{bmatrix}";return this.items.forEach(function (node) {s += node.items ? node.items.map(function (childNode) {return childNode.toTex(options);}).join("&") : node.toTex(options), s += "\\\\";}), s += "\\end{bmatrix}", s;}, ArrayNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/BlockNode.js
var BlockNode_name = "BlockNode",BlockNode_dependencies = ["ResultSet", "Node"];var createBlockNode = factory("BlockNode", BlockNode_dependencies, (_ref) => {function BlockNode(blocks) {if (!(this instanceof BlockNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!Array.isArray(blocks)) throw new Error("Array expected");this.blocks = blocks.map(function (block) {var node = block && block.node,visible = !(block && void 0 !== block.visible) || block.visible;if (!isNode(node)) throw new TypeError("Property \"node\" must be a Node");if ("boolean" != typeof visible) throw new TypeError("Property \"visible\" must be a boolean");return { node: node, visible: visible };});}var { ResultSet, Node } = _ref;return BlockNode.prototype = new Node(), BlockNode.prototype.type = "BlockNode", BlockNode.prototype.isBlockNode = !0, BlockNode.prototype._compile = function (math, argNames) {var evalBlocks = map(this.blocks, function (block) {return { evaluate: block.node._compile(math, argNames), visible: block.visible };});return function (scope, args, context) {var results = [];return forEach(evalBlocks, function (block) {var result = block.evaluate(scope, args, context);block.visible && results.push(result);}), new ResultSet(results);};}, BlockNode.prototype.forEach = function (callback) {for (var i = 0; i < this.blocks.length; i++) callback(this.blocks[i].node, "blocks[" + i + "].node", this);}, BlockNode.prototype.map = function (callback) {for (var blocks = [], i = 0; i < this.blocks.length; i++) {var block = this.blocks[i],node = this._ifNode(callback(block.node, "blocks[" + i + "].node", this));blocks[i] = { node: node, visible: block.visible };}return new BlockNode(blocks);}, BlockNode.prototype.clone = function () {var blocks = this.blocks.map(function (block) {return { node: block.node, visible: block.visible };});return new BlockNode(blocks);}, BlockNode.prototype._toString = function (options) {return this.blocks.map(function (param) {return param.node.toString(options) + (param.visible ? "" : ";");}).join("\n");}, BlockNode.prototype.toJSON = function () {return { mathjs: "BlockNode", blocks: this.blocks };}, BlockNode.fromJSON = function (json) {return new BlockNode(json.blocks);}, BlockNode.prototype.toHTML = function (options) {return this.blocks.map(function (param) {return param.node.toHTML(options) + (param.visible ? "" : "<span class=\"math-separator\">;</span>");}).join("<span class=\"math-separator\"><br /></span>");}, BlockNode.prototype._toTex = function (options) {return this.blocks.map(function (param) {return param.node.toTex(options) + (param.visible ? "" : ";");}).join("\\;\\;\n");}, BlockNode;}, { isClass: !0, isNode: !0 });
// EXTERNAL MODULE: ./node_modules/escape-latex/dist/index.js
var dist = __webpack_require__("./node_modules/escape-latex/dist/index.js");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/latex.js
var latexSymbols = { Alpha: "A", alpha: "\\alpha", Beta: "B", beta: "\\beta", Gamma: "\\Gamma", gamma: "\\gamma", Delta: "\\Delta", delta: "\\delta", Epsilon: "E", epsilon: "\\epsilon", varepsilon: "\\varepsilon", Zeta: "Z", zeta: "\\zeta", Eta: "H", eta: "\\eta", Theta: "\\Theta", theta: "\\theta", vartheta: "\\vartheta", Iota: "I", iota: "\\iota", Kappa: "K", kappa: "\\kappa", varkappa: "\\varkappa", Lambda: "\\Lambda", lambda: "\\lambda", Mu: "M", mu: "\\mu", Nu: "N", nu: "\\nu", Xi: "\\Xi", xi: "\\xi", Omicron: "O", omicron: "o", Pi: "\\Pi", pi: "\\pi", varpi: "\\varpi", Rho: "P", rho: "\\rho", varrho: "\\varrho", Sigma: "\\Sigma", sigma: "\\sigma", varsigma: "\\varsigma", Tau: "T", tau: "\\tau", Upsilon: "\\Upsilon", upsilon: "\\upsilon", Phi: "\\Phi", phi: "\\phi", varphi: "\\varphi", Chi: "X", chi: "\\chi", Psi: "\\Psi", psi: "\\psi", Omega: "\\Omega", omega: "\\omega", true: "\\mathrm{True}", false: "\\mathrm{False}", i: "i", inf: "\\infty", Inf: "\\infty", infinity: "\\infty", Infinity: "\\infty", oo: "\\infty", lim: "\\lim", undefined: "\\mathbf{?}" };var latexOperators = { transpose: "^\\top", ctranspose: "^H", factorial: "!", pow: "^", dotPow: ".^\\wedge", unaryPlus: "+", unaryMinus: "-", bitNot: "\\~", not: "\\neg", multiply: "\\cdot", divide: "\\frac", dotMultiply: ".\\cdot", dotDivide: ".:", mod: "\\mod", add: "+", subtract: "-", to: "\\rightarrow", leftShift: "<<", rightArithShift: ">>", rightLogShift: ">>>", equal: "=", unequal: "\\neq", smaller: "<", larger: ">", smallerEq: "\\leq", largerEq: "\\geq", bitAnd: "\\&", bitXor: "\\underline{|}", bitOr: "|", and: "\\wedge", xor: "\\veebar", or: "\\vee" };var latexFunctions = { abs: { 1: "\\left|${args[0]}\\right|" }, add: { 2: "\\left(${args[0]}".concat(latexOperators.add, "${args[1]}\\right)") }, cbrt: { 1: "\\sqrt[3]{${args[0]}}" }, ceil: { 1: "\\left\\lceil${args[0]}\\right\\rceil" }, cube: { 1: "\\left(${args[0]}\\right)^3" }, divide: { 2: "\\frac{${args[0]}}{${args[1]}}" }, dotDivide: { 2: "\\left(${args[0]}".concat(latexOperators.dotDivide, "${args[1]}\\right)") }, dotMultiply: { 2: "\\left(${args[0]}".concat(latexOperators.dotMultiply, "${args[1]}\\right)") }, dotPow: { 2: "\\left(${args[0]}".concat(latexOperators.dotPow, "${args[1]}\\right)") }, exp: { 1: "\\exp\\left(${args[0]}\\right)" }, expm1: "\\left(e".concat(latexOperators.pow, "{${args[0]}}-1\\right)"), fix: { 1: "\\mathrm{${name}}\\left(${args[0]}\\right)" }, floor: { 1: "\\left\\lfloor${args[0]}\\right\\rfloor" }, gcd: "\\gcd\\left(${args}\\right)", hypot: "\\hypot\\left(${args}\\right)", log: { 1: "\\ln\\left(${args[0]}\\right)", 2: "\\log_{${args[1]}}\\left(${args[0]}\\right)" }, log10: { 1: "\\log_{10}\\left(${args[0]}\\right)" }, log1p: { 1: "\\ln\\left(${args[0]}+1\\right)", 2: "\\log_{${args[1]}}\\left(${args[0]}+1\\right)" }, log2: "\\log_{2}\\left(${args[0]}\\right)", mod: { 2: "\\left(${args[0]}".concat(latexOperators.mod, "${args[1]}\\right)") }, multiply: { 2: "\\left(${args[0]}".concat(latexOperators.multiply, "${args[1]}\\right)") }, norm: { 1: "\\left\\|${args[0]}\\right\\|", 2: void 0 }, nthRoot: { 2: "\\sqrt[${args[1]}]{${args[0]}}" }, nthRoots: { 2: "\\{y : $y^{args[1]} = {${args[0]}}\\}" }, pow: { 2: "\\left(${args[0]}\\right)".concat(latexOperators.pow, "{${args[1]}}") }, round: { 1: "\\left\\lfloor${args[0]}\\right\\rceil", 2: void 0 }, sign: { 1: "\\mathrm{${name}}\\left(${args[0]}\\right)" }, sqrt: { 1: "\\sqrt{${args[0]}}" }, square: { 1: "\\left(${args[0]}\\right)^2" }, subtract: { 2: "\\left(${args[0]}".concat(latexOperators.subtract, "${args[1]}\\right)") }, unaryMinus: { 1: "".concat(latexOperators.unaryMinus, "\\left(${args[0]}\\right)") }, unaryPlus: { 1: "".concat(latexOperators.unaryPlus, "\\left(${args[0]}\\right)") }, bitAnd: { 2: "\\left(${args[0]}".concat(latexOperators.bitAnd, "${args[1]}\\right)") }, bitNot: { 1: latexOperators.bitNot + "\\left(${args[0]}\\right)" }, bitOr: { 2: "\\left(${args[0]}".concat(latexOperators.bitOr, "${args[1]}\\right)") }, bitXor: { 2: "\\left(${args[0]}".concat(latexOperators.bitXor, "${args[1]}\\right)") }, leftShift: { 2: "\\left(${args[0]}".concat(latexOperators.leftShift, "${args[1]}\\right)") }, rightArithShift: { 2: "\\left(${args[0]}".concat(latexOperators.rightArithShift, "${args[1]}\\right)") }, rightLogShift: { 2: "\\left(${args[0]}".concat(latexOperators.rightLogShift, "${args[1]}\\right)") }, bellNumbers: { 1: "\\mathrm{B}_{${args[0]}}" }, catalan: { 1: "\\mathrm{C}_{${args[0]}}" }, stirlingS2: { 2: "\\mathrm{S}\\left(${args}\\right)" }, arg: { 1: "\\arg\\left(${args[0]}\\right)" }, conj: { 1: "\\left(${args[0]}\\right)^*" }, im: { 1: "\\Im\\left\\lbrace${args[0]}\\right\\rbrace" }, re: { 1: "\\Re\\left\\lbrace${args[0]}\\right\\rbrace" }, and: { 2: "\\left(${args[0]}".concat(latexOperators.and, "${args[1]}\\right)") }, not: { 1: latexOperators.not + "\\left(${args[0]}\\right)" }, or: { 2: "\\left(${args[0]}".concat(latexOperators.or, "${args[1]}\\right)") }, xor: { 2: "\\left(${args[0]}".concat(latexOperators.xor, "${args[1]}\\right)") }, cross: { 2: "\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)" }, ctranspose: { 1: "\\left(${args[0]}\\right)".concat(latexOperators.ctranspose) }, det: { 1: "\\det\\left(${args[0]}\\right)" }, dot: { 2: "\\left(${args[0]}\\cdot${args[1]}\\right)" }, expm: { 1: "\\exp\\left(${args[0]}\\right)" }, inv: { 1: "\\left(${args[0]}\\right)^{-1}" }, sqrtm: { 1: "{${args[0]}}".concat(latexOperators.pow, "{\\frac{1}{2}}") }, trace: { 1: "\\mathrm{tr}\\left(${args[0]}\\right)" }, transpose: { 1: "\\left(${args[0]}\\right)".concat(latexOperators.transpose) }, combinations: { 2: "\\binom{${args[0]}}{${args[1]}}" }, combinationsWithRep: { 2: "\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)" }, factorial: { 1: "\\left(${args[0]}\\right)".concat(latexOperators.factorial) }, gamma: { 1: "\\Gamma\\left(${args[0]}\\right)" }, equal: { 2: "\\left(${args[0]}".concat(latexOperators.equal, "${args[1]}\\right)") }, larger: { 2: "\\left(${args[0]}".concat(latexOperators.larger, "${args[1]}\\right)") }, largerEq: { 2: "\\left(${args[0]}".concat(latexOperators.largerEq, "${args[1]}\\right)") }, smaller: { 2: "\\left(${args[0]}".concat(latexOperators.smaller, "${args[1]}\\right)") }, smallerEq: { 2: "\\left(${args[0]}".concat(latexOperators.smallerEq, "${args[1]}\\right)") }, unequal: { 2: "\\left(${args[0]}".concat(latexOperators.unequal, "${args[1]}\\right)") }, erf: { 1: "erf\\left(${args[0]}\\right)" }, max: "\\max\\left(${args}\\right)", min: "\\min\\left(${args}\\right)", variance: "\\mathrm{Var}\\left(${args}\\right)", acos: { 1: "\\cos^{-1}\\left(${args[0]}\\right)" }, acosh: { 1: "\\cosh^{-1}\\left(${args[0]}\\right)" }, acot: { 1: "\\cot^{-1}\\left(${args[0]}\\right)" }, acoth: { 1: "\\coth^{-1}\\left(${args[0]}\\right)" }, acsc: { 1: "\\csc^{-1}\\left(${args[0]}\\right)" }, acsch: { 1: "\\mathrm{csch}^{-1}\\left(${args[0]}\\right)" }, asec: { 1: "\\sec^{-1}\\left(${args[0]}\\right)" }, asech: { 1: "\\mathrm{sech}^{-1}\\left(${args[0]}\\right)" }, asin: { 1: "\\sin^{-1}\\left(${args[0]}\\right)" }, asinh: { 1: "\\sinh^{-1}\\left(${args[0]}\\right)" }, atan: { 1: "\\tan^{-1}\\left(${args[0]}\\right)" }, atan2: { 2: "\\mathrm{atan2}\\left(${args}\\right)" }, atanh: { 1: "\\tanh^{-1}\\left(${args[0]}\\right)" }, cos: { 1: "\\cos\\left(${args[0]}\\right)" }, cosh: { 1: "\\cosh\\left(${args[0]}\\right)" }, cot: { 1: "\\cot\\left(${args[0]}\\right)" }, coth: { 1: "\\coth\\left(${args[0]}\\right)" }, csc: { 1: "\\csc\\left(${args[0]}\\right)" }, csch: { 1: "\\mathrm{csch}\\left(${args[0]}\\right)" }, sec: { 1: "\\sec\\left(${args[0]}\\right)" }, sech: { 1: "\\mathrm{sech}\\left(${args[0]}\\right)" }, sin: { 1: "\\sin\\left(${args[0]}\\right)" }, sinh: { 1: "\\sinh\\left(${args[0]}\\right)" }, tan: { 1: "\\tan\\left(${args[0]}\\right)" }, tanh: { 1: "\\tanh\\left(${args[0]}\\right)" }, to: { 2: "\\left(${args[0]}".concat(latexOperators.to, "${args[1]}\\right)") }, numeric: function (node) {return node.args[0].toTex();}, number: { 0: "0", 1: "\\left(${args[0]}\\right)", 2: "\\left(\\left(${args[0]}\\right)${args[1]}\\right)" }, string: { 0: "\\mathtt{\"\"}", 1: "\\mathrm{string}\\left(${args[0]}\\right)" }, bignumber: { 0: "0", 1: "\\left(${args[0]}\\right)" }, complex: { 0: "0", 1: "\\left(${args[0]}\\right)", 2: "\\left(\\left(${args[0]}\\right)+".concat(latexSymbols.i, "\\cdot\\left(${args[1]}\\right)\\right)") }, matrix: { 0: "\\begin{bmatrix}\\end{bmatrix}", 1: "\\left(${args[0]}\\right)", 2: "\\left(${args[0]}\\right)" }, sparse: { 0: "\\begin{bsparse}\\end{bsparse}", 1: "\\left(${args[0]}\\right)" }, unit: { 1: "\\left(${args[0]}\\right)", 2: "\\left(\\left(${args[0]}\\right)${args[1]}\\right)" } };var defaultTemplate = "\\mathrm{${name}}\\left(${args}\\right)";var latexUnits = { deg: "^\\circ" };function escapeLatex(string) {return dist(string, { preserveFormatting: !0 });}function toSymbol(name, isUnit) {return isUnit = "undefined" != typeof isUnit && isUnit, isUnit ? object_hasOwnProperty(latexUnits, name) ? latexUnits[name] : "\\mathrm{" + escapeLatex(name) + "}" : object_hasOwnProperty(latexSymbols, name) ? latexSymbols[name] : escapeLatex(name);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/ConstantNode.js
var ConstantNode_name = "ConstantNode",ConstantNode_dependencies = ["Node"];var createConstantNode = factory("ConstantNode", ConstantNode_dependencies, (_ref) => {function ConstantNode(value) {if (!(this instanceof ConstantNode)) throw new SyntaxError("Constructor must be called with the new operator");this.value = value;}var { Node } = _ref;return ConstantNode.prototype = new Node(), ConstantNode.prototype.type = "ConstantNode", ConstantNode.prototype.isConstantNode = !0, ConstantNode.prototype._compile = function () {var value = this.value;return function () {return value;};}, ConstantNode.prototype.forEach = function () {}, ConstantNode.prototype.map = function () {return this.clone();}, ConstantNode.prototype.clone = function () {return new ConstantNode(this.value);}, ConstantNode.prototype._toString = function (options) {return string_format(this.value, options);}, ConstantNode.prototype.toHTML = function (options) {var value = this._toString(options);switch (typeOf(this.value)) {case "number":case "BigNumber":case "Fraction":return "<span class=\"math-number\">" + value + "</span>";case "string":return "<span class=\"math-string\">" + value + "</span>";case "boolean":return "<span class=\"math-boolean\">" + value + "</span>";case "null":return "<span class=\"math-null-symbol\">" + value + "</span>";case "undefined":return "<span class=\"math-undefined\">" + value + "</span>";default:return "<span class=\"math-symbol\">" + value + "</span>";}}, ConstantNode.prototype.toJSON = function () {return { mathjs: "ConstantNode", value: this.value };}, ConstantNode.fromJSON = function (json) {return new ConstantNode(json.value);}, ConstantNode.prototype._toTex = function (options) {var value = this._toString(options);switch (typeOf(this.value)) {case "string":return "\\mathtt{" + escapeLatex(value) + "}";case "number":case "BigNumber":{if (!isFinite(this.value)) return 0 > this.value.valueOf() ? "-\\infty" : "\\infty";var index = value.toLowerCase().indexOf("e");if (-1 !== index) return value.substring(0, index) + "\\cdot10^{" + value.substring(index + 1) + "}";}return value;case "Fraction":return this.value.toLatex();default:return value;}}, ConstantNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/ObjectNode.js
var ObjectNode_name = "ObjectNode",ObjectNode_dependencies = ["Node"];var createObjectNode = factory("ObjectNode", ObjectNode_dependencies, (_ref) => {function ObjectNode(properties) {if (!(this instanceof ObjectNode)) throw new SyntaxError("Constructor must be called with the new operator");if (this.properties = properties || {}, properties && ("object" != typeof properties || !Object.keys(properties).every(function (key) {return isNode(properties[key]);}))) throw new TypeError("Object containing Nodes expected");}var { Node } = _ref;return ObjectNode.prototype = new Node(), ObjectNode.prototype.type = "ObjectNode", ObjectNode.prototype.isObjectNode = !0, ObjectNode.prototype._compile = function (math, argNames) {var evalEntries = {};for (var key in this.properties) if (object_hasOwnProperty(this.properties, key)) {var stringifiedKey = stringify(key),parsedKey = JSON.parse(stringifiedKey);if (!isSafeProperty(this.properties, parsedKey)) throw new Error("No access to property \"" + parsedKey + "\"");evalEntries[parsedKey] = this.properties[key]._compile(math, argNames);}return function (scope, args, context) {var obj = {};for (var _key in evalEntries) object_hasOwnProperty(evalEntries, _key) && (obj[_key] = evalEntries[_key](scope, args, context));return obj;};}, ObjectNode.prototype.forEach = function (callback) {for (var key in this.properties) object_hasOwnProperty(this.properties, key) && callback(this.properties[key], "properties[" + stringify(key) + "]", this);}, ObjectNode.prototype.map = function (callback) {var properties = {};for (var key in this.properties) object_hasOwnProperty(this.properties, key) && (properties[key] = this._ifNode(callback(this.properties[key], "properties[" + stringify(key) + "]", this)));return new ObjectNode(properties);}, ObjectNode.prototype.clone = function () {var properties = {};for (var key in this.properties) object_hasOwnProperty(this.properties, key) && (properties[key] = this.properties[key]);return new ObjectNode(properties);}, ObjectNode.prototype._toString = function (options) {var entries = [];for (var key in this.properties) object_hasOwnProperty(this.properties, key) && entries.push(stringify(key) + ": " + this.properties[key].toString(options));return "{" + entries.join(", ") + "}";}, ObjectNode.prototype.toJSON = function () {return { mathjs: "ObjectNode", properties: this.properties };}, ObjectNode.fromJSON = function (json) {return new ObjectNode(json.properties);}, ObjectNode.prototype.toHTML = function (options) {var entries = [];for (var key in this.properties) object_hasOwnProperty(this.properties, key) && entries.push("<span class=\"math-symbol math-property\">" + string_escape(key) + "</span><span class=\"math-operator math-assignment-operator math-property-assignment-operator math-binary-operator\">:</span>" + this.properties[key].toHTML(options));return "<span class=\"math-parenthesis math-curly-parenthesis\">{</span>" + entries.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-parenthesis math-curly-parenthesis\">}</span>";}, ObjectNode.prototype._toTex = function (options) {var entries = [];for (var key in this.properties) object_hasOwnProperty(this.properties, key) && entries.push("\\mathbf{" + key + ":} & " + this.properties[key].toTex(options) + "\\\\");return "\\left\\{\\begin{array}{ll}".concat(entries.join("\n"), "\\end{array}\\right\\}");}, ObjectNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js
var ParenthesisNode_name = "ParenthesisNode",ParenthesisNode_dependencies = ["Node"];var createParenthesisNode = factory("ParenthesisNode", ParenthesisNode_dependencies, (_ref) => {function ParenthesisNode(content) {if (!(this instanceof ParenthesisNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!isNode(content)) throw new TypeError("Node expected for parameter \"content\"");this.content = content;}var { Node } = _ref;return ParenthesisNode.prototype = new Node(), ParenthesisNode.prototype.type = "ParenthesisNode", ParenthesisNode.prototype.isParenthesisNode = !0, ParenthesisNode.prototype._compile = function (math, argNames) {return this.content._compile(math, argNames);}, ParenthesisNode.prototype.getContent = function () {return this.content.getContent();}, ParenthesisNode.prototype.forEach = function (callback) {callback(this.content, "content", this);}, ParenthesisNode.prototype.map = function (callback) {var content = callback(this.content, "content", this);return new ParenthesisNode(content);}, ParenthesisNode.prototype.clone = function () {return new ParenthesisNode(this.content);}, ParenthesisNode.prototype._toString = function (options) {return !options || options && !options.parenthesis || options && "keep" === options.parenthesis ? "(" + this.content.toString(options) + ")" : this.content.toString(options);}, ParenthesisNode.prototype.toJSON = function () {return { mathjs: "ParenthesisNode", content: this.content };}, ParenthesisNode.fromJSON = function (json) {return new ParenthesisNode(json.content);}, ParenthesisNode.prototype.toHTML = function (options) {return !options || options && !options.parenthesis || options && "keep" === options.parenthesis ? "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + this.content.toHTML(options) + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>" : this.content.toHTML(options);}, ParenthesisNode.prototype._toTex = function (options) {return !options || options && !options.parenthesis || options && "keep" === options.parenthesis ? "\\left(".concat(this.content.toTex(options), "\\right)") : this.content.toTex(options);}, ParenthesisNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/operators.js
var properties = [{ AssignmentNode: {}, FunctionAssignmentNode: {} }, { ConditionalNode: { latexLeftParens: !1, latexRightParens: !1, latexParens: !1 } }, { "OperatorNode:or": { associativity: "left", associativeWith: [] } }, { "OperatorNode:xor": { associativity: "left", associativeWith: [] } }, { "OperatorNode:and": { associativity: "left", associativeWith: [] } }, { "OperatorNode:bitOr": { associativity: "left", associativeWith: [] } }, { "OperatorNode:bitXor": { associativity: "left", associativeWith: [] } }, { "OperatorNode:bitAnd": { associativity: "left", associativeWith: [] } }, { "OperatorNode:equal": { associativity: "left", associativeWith: [] }, "OperatorNode:unequal": { associativity: "left", associativeWith: [] }, "OperatorNode:smaller": { associativity: "left", associativeWith: [] }, "OperatorNode:larger": { associativity: "left", associativeWith: [] }, "OperatorNode:smallerEq": { associativity: "left", associativeWith: [] }, "OperatorNode:largerEq": { associativity: "left", associativeWith: [] }, RelationalNode: { associativity: "left", associativeWith: [] } }, { "OperatorNode:leftShift": { associativity: "left", associativeWith: [] }, "OperatorNode:rightArithShift": { associativity: "left", associativeWith: [] }, "OperatorNode:rightLogShift": { associativity: "left", associativeWith: [] } }, { "OperatorNode:to": { associativity: "left", associativeWith: [] } }, { RangeNode: {} }, { "OperatorNode:add": { associativity: "left", associativeWith: ["OperatorNode:add", "OperatorNode:subtract"] }, "OperatorNode:subtract": { associativity: "left", associativeWith: [] } }, { "OperatorNode:multiply": { associativity: "left", associativeWith: ["OperatorNode:multiply", "OperatorNode:divide", "Operator:dotMultiply", "Operator:dotDivide"] }, "OperatorNode:divide": { associativity: "left", associativeWith: [], latexLeftParens: !1, latexRightParens: !1, latexParens: !1 }, "OperatorNode:dotMultiply": { associativity: "left", associativeWith: ["OperatorNode:multiply", "OperatorNode:divide", "OperatorNode:dotMultiply", "OperatorNode:doDivide"] }, "OperatorNode:dotDivide": { associativity: "left", associativeWith: [] }, "OperatorNode:mod": { associativity: "left", associativeWith: [] } }, { "OperatorNode:unaryPlus": { associativity: "right" }, "OperatorNode:unaryMinus": { associativity: "right" }, "OperatorNode:bitNot": { associativity: "right" }, "OperatorNode:not": { associativity: "right" } }, { "OperatorNode:pow": { associativity: "right", associativeWith: [], latexRightParens: !1 }, "OperatorNode:dotPow": { associativity: "right", associativeWith: [] } }, { "OperatorNode:factorial": { associativity: "left" } }, { "OperatorNode:transpose": { associativity: "left" } }];function getPrecedence(_node, parenthesis) {var node = _node;"keep" !== parenthesis && (node = _node.getContent());for (var identifier = node.getIdentifier(), i = 0; i < properties.length; i++) if (identifier in properties[i]) return i;return null;}function getAssociativity(_node, parenthesis) {var node = _node;"keep" !== parenthesis && (node = _node.getContent());var identifier = node.getIdentifier(),index = getPrecedence(node, parenthesis);if (null === index) return null;var property = properties[index][identifier];if (object_hasOwnProperty(property, "associativity")) {if ("left" === property.associativity) return "left";if ("right" === property.associativity) return "right";throw Error("'" + identifier + "' has the invalid associativity '" + property.associativity + "'.");}return null;}function isAssociativeWith(nodeA, nodeB, parenthesis) {var a = "keep" === parenthesis ? nodeA : nodeA.getContent(),b = "keep" === parenthesis ? nodeB : nodeA.getContent(),identifierA = a.getIdentifier(),identifierB = b.getIdentifier(),index = getPrecedence(a, parenthesis);if (null === index) return null;var property = properties[index][identifierA];if (object_hasOwnProperty(property, "associativeWith") && property.associativeWith instanceof Array) {for (var i = 0; i < property.associativeWith.length; i++) if (property.associativeWith[i] === identifierB) return !0;return !1;}return null;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/RelationalNode.js
var RelationalNode_name = "RelationalNode",RelationalNode_dependencies = ["Node"];var createRelationalNode = factory("RelationalNode", RelationalNode_dependencies, (_ref) => {function RelationalNode(conditionals, params) {if (!(this instanceof RelationalNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!Array.isArray(conditionals)) throw new TypeError("Parameter conditionals must be an array");if (!Array.isArray(params)) throw new TypeError("Parameter params must be an array");if (conditionals.length !== params.length - 1) throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals = conditionals, this.params = params;}var { Node } = _ref;return RelationalNode.prototype = new Node(), RelationalNode.prototype.type = "RelationalNode", RelationalNode.prototype.isRelationalNode = !0, RelationalNode.prototype._compile = function (math, argNames) {var self = this,compiled = this.params.map((p) => p._compile(math, argNames));return function (scope, args, context) {for (var evalLhs, evalRhs = compiled[0](scope, args, context), i = 0; i < self.conditionals.length; i++) {evalLhs = evalRhs, evalRhs = compiled[i + 1](scope, args, context);var condFn = getSafeProperty(math, self.conditionals[i]);if (!condFn(evalLhs, evalRhs)) return !1;}return !0;};}, RelationalNode.prototype.forEach = function (callback) {this.params.forEach((n, i) => callback(n, "params[" + i + "]", this), this);}, RelationalNode.prototype.map = function (callback) {return new RelationalNode(this.conditionals.slice(), this.params.map((n, i) => this._ifNode(callback(n, "params[" + i + "]", this)), this));}, RelationalNode.prototype.clone = function () {return new RelationalNode(this.conditionals, this.params);}, RelationalNode.prototype._toString = function (options) {for (var parenthesis = options && options.parenthesis ? options.parenthesis : "keep", precedence = getPrecedence(this, parenthesis), paramStrings = this.params.map(function (p) {var paramPrecedence = getPrecedence(p, parenthesis);return "all" === parenthesis || null !== paramPrecedence && paramPrecedence <= precedence ? "(" + p.toString(options) + ")" : p.toString(options);}), operatorMap = { equal: "==", unequal: "!=", smaller: "<", larger: ">", smallerEq: "<=", largerEq: ">=" }, ret = paramStrings[0], i = 0; i < this.conditionals.length; i++) ret += " " + operatorMap[this.conditionals[i]] + " " + paramStrings[i + 1];return ret;}, RelationalNode.prototype.toJSON = function () {return { mathjs: "RelationalNode", conditionals: this.conditionals, params: this.params };}, RelationalNode.fromJSON = function (json) {return new RelationalNode(json.conditionals, json.params);}, RelationalNode.prototype.toHTML = function (options) {for (var parenthesis = options && options.parenthesis ? options.parenthesis : "keep", precedence = getPrecedence(this, parenthesis), paramStrings = this.params.map(function (p) {var paramPrecedence = getPrecedence(p, parenthesis);return "all" === parenthesis || null !== paramPrecedence && paramPrecedence <= precedence ? "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + p.toHTML(options) + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>" : p.toHTML(options);}), operatorMap = { equal: "==", unequal: "!=", smaller: "<", larger: ">", smallerEq: "<=", largerEq: ">=" }, ret = paramStrings[0], i = 0; i < this.conditionals.length; i++) ret += "<span class=\"math-operator math-binary-operator math-explicit-binary-operator\">" + string_escape(operatorMap[this.conditionals[i]]) + "</span>" + paramStrings[i + 1];return ret;}, RelationalNode.prototype._toTex = function (options) {for (var parenthesis = options && options.parenthesis ? options.parenthesis : "keep", precedence = getPrecedence(this, parenthesis), paramStrings = this.params.map(function (p) {var paramPrecedence = getPrecedence(p, parenthesis);return "all" === parenthesis || null !== paramPrecedence && paramPrecedence <= precedence ? "\\left(" + p.toTex(options) + "\right)" : p.toTex(options);}), ret = paramStrings[0], i = 0; i < this.conditionals.length; i++) ret += latexOperators[this.conditionals[i]] + paramStrings[i + 1];return ret;}, RelationalNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/chain/Chain.js
var Chain_name = "Chain",Chain_dependencies = ["?on", "math"];var createChainClass = factory("Chain", Chain_dependencies, (_ref) => {function Chain(value) {if (!(this instanceof Chain)) throw new SyntaxError("Constructor must be called with the new operator");this.value = isChain(value) ? value.value : value;}function createProxy(name, fn) {"function" == typeof fn && (Chain.prototype[name] = chainify(fn));}function createLazyProxy(name, resolver) {lazy(Chain.prototype, name, function () {var fn = resolver();return "function" == typeof fn ? chainify(fn) : void 0;});}function chainify(fn) {return function () {for (var args = [this.value], i = 0; i < arguments.length; i++) args[i + 1] = arguments[i];return new Chain(fn.apply(fn, args));};}var { on, math } = _ref;Chain.prototype.type = "Chain", Chain.prototype.isChain = !0, Chain.prototype.done = function () {return this.value;}, Chain.prototype.valueOf = function () {return this.value;}, Chain.prototype.toString = function () {return string_format(this.value);}, Chain.prototype.toJSON = function () {return { mathjs: "Chain", value: this.value };}, Chain.fromJSON = function (json) {return new Chain(json.value);}, Chain.createProxy = function (arg0, arg1) {if ("string" == typeof arg0) createProxy(arg0, arg1);else {var _loop = function (_name) {object_hasOwnProperty(arg0, _name) && void 0 === excludedNames[_name] && createLazyProxy(_name, () => arg0[_name]);};for (var _name in arg0) _loop(_name);}};var excludedNames = { expression: !0, docs: !0, type: !0, classes: !0, json: !0, error: !0, isChain: !0 };return Chain.createProxy(math), on && on("import", function (name, resolver, path) {path || createLazyProxy(name, resolver);}), Chain;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/json/reviver.js
var reviver_name = "reviver",reviver_dependencies = ["classes"];var createReviver = factory("reviver", reviver_dependencies, (_ref) => {var { classes } = _ref;return function (key, value) {var constructor = classes[value && value.mathjs];return constructor && "function" == typeof constructor.fromJSON ? constructor.fromJSON(value) : value;};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js
var ConditionalNode_name = "ConditionalNode",ConditionalNode_dependencies = ["Node"];var createConditionalNode = factory("ConditionalNode", ConditionalNode_dependencies, (_ref) => {function ConditionalNode(condition, trueExpr, falseExpr) {if (!(this instanceof ConditionalNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!isNode(condition)) throw new TypeError("Parameter condition must be a Node");if (!isNode(trueExpr)) throw new TypeError("Parameter trueExpr must be a Node");if (!isNode(falseExpr)) throw new TypeError("Parameter falseExpr must be a Node");this.condition = condition, this.trueExpr = trueExpr, this.falseExpr = falseExpr;}function testCondition(condition) {if ("number" == typeof condition || "boolean" == typeof condition || "string" == typeof condition) return !!condition;if (condition) {if (isBigNumber(condition)) return !condition.isZero();if (isComplex(condition)) return !!(condition.re || condition.im);if (isUnit(condition)) return !!condition.value;}if (null === condition || void 0 === condition) return !1;throw new TypeError("Unsupported type of condition \"" + typeOf(condition) + "\"");}var { Node } = _ref;return ConditionalNode.prototype = new Node(), ConditionalNode.prototype.type = "ConditionalNode", ConditionalNode.prototype.isConditionalNode = !0, ConditionalNode.prototype._compile = function (math, argNames) {var evalCondition = this.condition._compile(math, argNames),evalTrueExpr = this.trueExpr._compile(math, argNames),evalFalseExpr = this.falseExpr._compile(math, argNames);return function (scope, args, context) {return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context);};}, ConditionalNode.prototype.forEach = function (callback) {callback(this.condition, "condition", this), callback(this.trueExpr, "trueExpr", this), callback(this.falseExpr, "falseExpr", this);}, ConditionalNode.prototype.map = function (callback) {return new ConditionalNode(this._ifNode(callback(this.condition, "condition", this)), this._ifNode(callback(this.trueExpr, "trueExpr", this)), this._ifNode(callback(this.falseExpr, "falseExpr", this)));}, ConditionalNode.prototype.clone = function () {return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr);}, ConditionalNode.prototype._toString = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",precedence = getPrecedence(this, parenthesis),condition = this.condition.toString(options),conditionPrecedence = getPrecedence(this.condition, parenthesis);("all" === parenthesis || "OperatorNode" === this.condition.type || null !== conditionPrecedence && conditionPrecedence <= precedence) && (condition = "(" + condition + ")");var trueExpr = this.trueExpr.toString(options),truePrecedence = getPrecedence(this.trueExpr, parenthesis);("all" === parenthesis || "OperatorNode" === this.trueExpr.type || null !== truePrecedence && truePrecedence <= precedence) && (trueExpr = "(" + trueExpr + ")");var falseExpr = this.falseExpr.toString(options),falsePrecedence = getPrecedence(this.falseExpr, parenthesis);return ("all" === parenthesis || "OperatorNode" === this.falseExpr.type || null !== falsePrecedence && falsePrecedence <= precedence) && (falseExpr = "(" + falseExpr + ")"), condition + " ? " + trueExpr + " : " + falseExpr;}, ConditionalNode.prototype.toJSON = function () {return { mathjs: "ConditionalNode", condition: this.condition, trueExpr: this.trueExpr, falseExpr: this.falseExpr };}, ConditionalNode.fromJSON = function (json) {return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr);}, ConditionalNode.prototype.toHTML = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",precedence = getPrecedence(this, parenthesis),condition = this.condition.toHTML(options),conditionPrecedence = getPrecedence(this.condition, parenthesis);("all" === parenthesis || "OperatorNode" === this.condition.type || null !== conditionPrecedence && conditionPrecedence <= precedence) && (condition = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + condition + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>");var trueExpr = this.trueExpr.toHTML(options),truePrecedence = getPrecedence(this.trueExpr, parenthesis);("all" === parenthesis || "OperatorNode" === this.trueExpr.type || null !== truePrecedence && truePrecedence <= precedence) && (trueExpr = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + trueExpr + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>");var falseExpr = this.falseExpr.toHTML(options),falsePrecedence = getPrecedence(this.falseExpr, parenthesis);return ("all" === parenthesis || "OperatorNode" === this.falseExpr.type || null !== falsePrecedence && falsePrecedence <= precedence) && (falseExpr = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + falseExpr + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), condition + "<span class=\"math-operator math-conditional-operator\">?</span>" + trueExpr + "<span class=\"math-operator math-conditional-operator\">:</span>" + falseExpr;}, ConditionalNode.prototype._toTex = function (options) {return "\\begin{cases} {" + this.trueExpr.toTex(options) + "}, &\\quad{\\text{if }\\;" + this.condition.toTex(options) + "}\\\\{" + this.falseExpr.toTex(options) + "}, &\\quad{\\text{otherwise}}\\end{cases}";}, ConditionalNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/OperatorNode.js
var OperatorNode_name = "OperatorNode",OperatorNode_dependencies = ["Node"];var createOperatorNode = factory("OperatorNode", OperatorNode_dependencies, (_ref) => {function OperatorNode(op, fn, args, implicit) {if (!(this instanceof OperatorNode)) throw new SyntaxError("Constructor must be called with the new operator");if ("string" != typeof op) throw new TypeError("string expected for parameter \"op\"");if ("string" != typeof fn) throw new TypeError("string expected for parameter \"fn\"");if (!Array.isArray(args) || !args.every(isNode)) throw new TypeError("Array containing Nodes expected for parameter \"args\"");this.implicit = !0 === implicit, this.op = op, this.fn = fn, this.args = args || [];}function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) {var precedence = getPrecedence(root, parenthesis),associativity = getAssociativity(root, parenthesis);if ("all" === parenthesis || 2 < args.length && "OperatorNode:add" !== root.getIdentifier() && "OperatorNode:multiply" !== root.getIdentifier()) return args.map(function (arg) {switch (arg.getContent().type) {case "ArrayNode":case "ConstantNode":case "SymbolNode":case "ParenthesisNode":return !1;default:return !0;}});var result;switch (args.length) {case 0:result = [];break;case 1:{var operandPrecedence = getPrecedence(args[0], parenthesis);if (latex && null !== operandPrecedence) {var operandIdentifier, rootIdentifier;if ("keep" === parenthesis ? (operandIdentifier = args[0].getIdentifier(), rootIdentifier = root.getIdentifier()) : (operandIdentifier = args[0].getContent().getIdentifier(), rootIdentifier = root.getContent().getIdentifier()), !1 === properties[precedence][rootIdentifier].latexLeftParens) {result = [!1];break;}if (!1 === properties[operandPrecedence][operandIdentifier].latexParens) {result = [!1];break;}}if (null === operandPrecedence) {result = [!1];break;}if (operandPrecedence <= precedence) {result = [!0];break;}result = [!1];}break;case 2:{var lhsParens,lhsPrecedence = getPrecedence(args[0], parenthesis),assocWithLhs = isAssociativeWith(root, args[0], parenthesis);lhsParens = null !== lhsPrecedence && (!(lhsPrecedence !== precedence || "right" !== associativity || assocWithLhs) || !!(lhsPrecedence < precedence));var rhsParens,rhsPrecedence = getPrecedence(args[1], parenthesis),assocWithRhs = isAssociativeWith(root, args[1], parenthesis);if (rhsParens = null !== rhsPrecedence && (!(rhsPrecedence !== precedence || "left" !== associativity || assocWithRhs) || !!(rhsPrecedence < precedence)), latex) {var _rootIdentifier, lhsIdentifier, rhsIdentifier;"keep" === parenthesis ? (_rootIdentifier = root.getIdentifier(), lhsIdentifier = root.args[0].getIdentifier(), rhsIdentifier = root.args[1].getIdentifier()) : (_rootIdentifier = root.getContent().getIdentifier(), lhsIdentifier = root.args[0].getContent().getIdentifier(), rhsIdentifier = root.args[1].getContent().getIdentifier()), null !== lhsPrecedence && (!1 === properties[precedence][_rootIdentifier].latexLeftParens && (lhsParens = !1), !1 === properties[lhsPrecedence][lhsIdentifier].latexParens && (lhsParens = !1)), null !== rhsPrecedence && (!1 === properties[precedence][_rootIdentifier].latexRightParens && (rhsParens = !1), !1 === properties[rhsPrecedence][rhsIdentifier].latexParens && (rhsParens = !1));}result = [lhsParens, rhsParens];}break;default:("OperatorNode:add" === root.getIdentifier() || "OperatorNode:multiply" === root.getIdentifier()) && (result = args.map(function (arg) {var argPrecedence = getPrecedence(arg, parenthesis),assocWithArg = isAssociativeWith(root, arg, parenthesis),argAssociativity = getAssociativity(arg, parenthesis);return null !== argPrecedence && (!(precedence !== argPrecedence || associativity !== argAssociativity || assocWithArg) || !!(argPrecedence < precedence));}));}return 2 <= args.length && "OperatorNode:multiply" === root.getIdentifier() && root.implicit && "auto" === parenthesis && "hide" === implicit && (result = args.map(function (arg, index) {var isParenthesisNode = "ParenthesisNode" === arg.getIdentifier();return !!(result[index] || isParenthesisNode);})), result;}var { Node } = _ref;return OperatorNode.prototype = new Node(), OperatorNode.prototype.type = "OperatorNode", OperatorNode.prototype.isOperatorNode = !0, OperatorNode.prototype._compile = function (math, argNames) {if ("string" != typeof this.fn || !isSafeMethod(math, this.fn)) if (!math[this.fn]) throw new Error("Function " + this.fn + " missing in provided namespace \"math\"");else throw new Error("No access to function \"" + this.fn + "\"");var fn = getSafeProperty(math, this.fn),evalArgs = map(this.args, function (arg) {return arg._compile(math, argNames);});if (1 === evalArgs.length) {var evalArg0 = evalArgs[0];return function (scope, args, context) {return fn(evalArg0(scope, args, context));};}if (2 === evalArgs.length) {var _evalArg = evalArgs[0],evalArg1 = evalArgs[1];return function (scope, args, context) {return fn(_evalArg(scope, args, context), evalArg1(scope, args, context));};}return function (scope, args, context) {return fn.apply(null, map(evalArgs, function (evalArg) {return evalArg(scope, args, context);}));};}, OperatorNode.prototype.forEach = function (callback) {for (var i = 0; i < this.args.length; i++) callback(this.args[i], "args[" + i + "]", this);}, OperatorNode.prototype.map = function (callback) {for (var args = [], i = 0; i < this.args.length; i++) args[i] = this._ifNode(callback(this.args[i], "args[" + i + "]", this));return new OperatorNode(this.op, this.fn, args, this.implicit);}, OperatorNode.prototype.clone = function () {return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit);}, OperatorNode.prototype.isUnary = function () {return 1 === this.args.length;}, OperatorNode.prototype.isBinary = function () {return 2 === this.args.length;}, OperatorNode.prototype._toString = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",implicit = options && options.implicit ? options.implicit : "hide",args = this.args,parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, !1);if (1 === args.length) {var assoc = getAssociativity(this, parenthesis),operand = args[0].toString(options);parens[0] && (operand = "(" + operand + ")");var opIsNamed = /[a-zA-Z]+/.test(this.op);return "right" === assoc ? this.op + (opIsNamed ? " " : "") + operand : "left" === assoc ? operand + (opIsNamed ? " " : "") + this.op : operand + this.op;}if (2 === args.length) {var lhs = args[0].toString(options),rhs = args[1].toString(options);return parens[0] && (lhs = "(" + lhs + ")"), parens[1] && (rhs = "(" + rhs + ")"), this.implicit && "OperatorNode:multiply" === this.getIdentifier() && "hide" === implicit ? lhs + " " + rhs : lhs + " " + this.op + " " + rhs;}if (2 < args.length && ("OperatorNode:add" === this.getIdentifier() || "OperatorNode:multiply" === this.getIdentifier())) {var stringifiedArgs = args.map(function (arg, index) {return arg = arg.toString(options), parens[index] && (arg = "(" + arg + ")"), arg;});return this.implicit && "OperatorNode:multiply" === this.getIdentifier() && "hide" === implicit ? stringifiedArgs.join(" ") : stringifiedArgs.join(" " + this.op + " ");}return this.fn + "(" + this.args.join(", ") + ")";}, OperatorNode.prototype.toJSON = function () {return { mathjs: "OperatorNode", op: this.op, fn: this.fn, args: this.args, implicit: this.implicit };}, OperatorNode.fromJSON = function (json) {return new OperatorNode(json.op, json.fn, json.args, json.implicit);}, OperatorNode.prototype.toHTML = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",implicit = options && options.implicit ? options.implicit : "hide",args = this.args,parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, !1);if (1 === args.length) {var assoc = getAssociativity(this, parenthesis),operand = args[0].toHTML(options);return parens[0] && (operand = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + operand + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), "right" === assoc ? "<span class=\"math-operator math-unary-operator math-lefthand-unary-operator\">" + string_escape(this.op) + "</span>" + operand : operand + "<span class=\"math-operator math-unary-operator math-righthand-unary-operator\">" + string_escape(this.op) + "</span>";}if (2 === args.length) {var lhs = args[0].toHTML(options),rhs = args[1].toHTML(options);return parens[0] && (lhs = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + lhs + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), parens[1] && (rhs = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + rhs + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), this.implicit && "OperatorNode:multiply" === this.getIdentifier() && "hide" === implicit ? lhs + "<span class=\"math-operator math-binary-operator math-implicit-binary-operator\"></span>" + rhs : lhs + "<span class=\"math-operator math-binary-operator math-explicit-binary-operator\">" + string_escape(this.op) + "</span>" + rhs;}var stringifiedArgs = args.map(function (arg, index) {return arg = arg.toHTML(options), parens[index] && (arg = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + arg + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), arg;});return 2 < args.length && ("OperatorNode:add" === this.getIdentifier() || "OperatorNode:multiply" === this.getIdentifier()) ? this.implicit && "OperatorNode:multiply" === this.getIdentifier() && "hide" === implicit ? stringifiedArgs.join("<span class=\"math-operator math-binary-operator math-implicit-binary-operator\"></span>") : stringifiedArgs.join("<span class=\"math-operator math-binary-operator math-explicit-binary-operator\">" + string_escape(this.op) + "</span>") : "<span class=\"math-function\">" + string_escape(this.fn) + "</span><span class=\"math-paranthesis math-round-parenthesis\">(</span>" + stringifiedArgs.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-paranthesis math-round-parenthesis\">)</span>";}, OperatorNode.prototype._toTex = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",implicit = options && options.implicit ? options.implicit : "hide",args = this.args,parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, !0),op = latexOperators[this.fn];if (op = "undefined" == typeof op ? this.op : op, 1 === args.length) {var assoc = getAssociativity(this, parenthesis),operand = args[0].toTex(options);return (parens[0] && (operand = "\\left(".concat(operand, "\\right)")), "right" === assoc) ? op + operand : "left" === assoc ? operand + op : operand + op;}if (2 === args.length) {var lhs = args[0],lhsTex = lhs.toTex(options);parens[0] && (lhsTex = "\\left(".concat(lhsTex, "\\right)"));var rhs = args[1],rhsTex = rhs.toTex(options);parens[1] && (rhsTex = "\\left(".concat(rhsTex, "\\right)"));var lhsIdentifier;switch (lhsIdentifier = "keep" === parenthesis ? lhs.getIdentifier() : lhs.getContent().getIdentifier(), this.getIdentifier()) {case "OperatorNode:divide":return op + "{" + lhsTex + "}{" + rhsTex + "}";case "OperatorNode:pow":lhsTex = "{" + lhsTex + "}", rhsTex = "{" + rhsTex + "}", "ConditionalNode" === lhsIdentifier || "OperatorNode:divide" === lhsIdentifier ? lhsTex = "\\left(".concat(lhsTex, "\\right)") : void 0;break;case "OperatorNode:multiply":if (this.implicit && "hide" === implicit) return lhsTex + "~" + rhsTex;}return lhsTex + op + rhsTex;}if (2 < args.length && ("OperatorNode:add" === this.getIdentifier() || "OperatorNode:multiply" === this.getIdentifier())) {var texifiedArgs = args.map(function (arg, index) {return arg = arg.toTex(options), parens[index] && (arg = "\\left(".concat(arg, "\\right)")), arg;});return "OperatorNode:multiply" === this.getIdentifier() && this.implicit ? texifiedArgs.join("~") : texifiedArgs.join(op);}return "\\mathrm{" + this.fn + "}\\left(" + args.map(function (arg) {return arg.toTex(options);}).join(",") + "\\right)";}, OperatorNode.prototype.getIdentifier = function () {return this.type + ":" + this.fn;}, OperatorNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/RangeNode.js
var RangeNode_name = "RangeNode",RangeNode_dependencies = ["Node"];var createRangeNode = factory("RangeNode", RangeNode_dependencies, (_ref) => {function RangeNode(start, end, step) {if (!(this instanceof RangeNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!isNode(start)) throw new TypeError("Node expected");if (!isNode(end)) throw new TypeError("Node expected");if (step && !isNode(step)) throw new TypeError("Node expected");if (3 < arguments.length) throw new Error("Too many arguments");this.start = start, this.end = end, this.step = step || null;}function calculateNecessaryParentheses(node, parenthesis) {var precedence = getPrecedence(node, parenthesis),parens = {},startPrecedence = getPrecedence(node.start, parenthesis);if (parens.start = null !== startPrecedence && startPrecedence <= precedence || "all" === parenthesis, node.step) {var stepPrecedence = getPrecedence(node.step, parenthesis);parens.step = null !== stepPrecedence && stepPrecedence <= precedence || "all" === parenthesis;}var endPrecedence = getPrecedence(node.end, parenthesis);return parens.end = null !== endPrecedence && endPrecedence <= precedence || "all" === parenthesis, parens;}var { Node } = _ref;return RangeNode.prototype = new Node(), RangeNode.prototype.type = "RangeNode", RangeNode.prototype.isRangeNode = !0, RangeNode.prototype.needsEnd = function () {var endSymbols = this.filter(function (node) {return isSymbolNode(node) && "end" === node.name;});return 0 < endSymbols.length;}, RangeNode.prototype._compile = function (math, argNames) {var range = math.range,evalStart = this.start._compile(math, argNames),evalEnd = this.end._compile(math, argNames);if (this.step) {var evalStep = this.step._compile(math, argNames);return function (scope, args, context) {return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context));};}return function (scope, args, context) {return range(evalStart(scope, args, context), evalEnd(scope, args, context));};}, RangeNode.prototype.forEach = function (callback) {callback(this.start, "start", this), callback(this.end, "end", this), this.step && callback(this.step, "step", this);}, RangeNode.prototype.map = function (callback) {return new RangeNode(this._ifNode(callback(this.start, "start", this)), this._ifNode(callback(this.end, "end", this)), this.step && this._ifNode(callback(this.step, "step", this)));}, RangeNode.prototype.clone = function () {return new RangeNode(this.start, this.end, this.step && this.step);}, RangeNode.prototype._toString = function (options) {var str,parenthesis = options && options.parenthesis ? options.parenthesis : "keep",parens = calculateNecessaryParentheses(this, parenthesis),start = this.start.toString(options);if (parens.start && (start = "(" + start + ")"), str = start, this.step) {var step = this.step.toString(options);parens.step && (step = "(" + step + ")"), str += ":" + step;}var end = this.end.toString(options);return parens.end && (end = "(" + end + ")"), str += ":" + end, str;}, RangeNode.prototype.toJSON = function () {return { mathjs: "RangeNode", start: this.start, end: this.end, step: this.step };}, RangeNode.fromJSON = function (json) {return new RangeNode(json.start, json.end, json.step);}, RangeNode.prototype.toHTML = function (options) {var str,parenthesis = options && options.parenthesis ? options.parenthesis : "keep",parens = calculateNecessaryParentheses(this, parenthesis),start = this.start.toHTML(options);if (parens.start && (start = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + start + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), str = start, this.step) {var step = this.step.toHTML(options);parens.step && (step = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + step + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), str += "<span class=\"math-operator math-range-operator\">:</span>" + step;}var end = this.end.toHTML(options);return parens.end && (end = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + end + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), str += "<span class=\"math-operator math-range-operator\">:</span>" + end, str;}, RangeNode.prototype._toTex = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",parens = calculateNecessaryParentheses(this, parenthesis),str = this.start.toTex(options);if (parens.start && (str = "\\left(".concat(str, "\\right)")), this.step) {var step = this.step.toTex(options);parens.step && (step = "\\left(".concat(step, "\\right)")), str += ":" + step;}var end = this.end.toTex(options);return parens.end && (end = "\\left(".concat(end, "\\right)")), str += ":" + end, str;}, RangeNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js
var FunctionAssignmentNode_name = "FunctionAssignmentNode",FunctionAssignmentNode_dependencies = ["typed", "Node"];var createFunctionAssignmentNode = factory("FunctionAssignmentNode", FunctionAssignmentNode_dependencies, (_ref) => {function FunctionAssignmentNode(name, params, expr) {if (!(this instanceof FunctionAssignmentNode)) throw new SyntaxError("Constructor must be called with the new operator");if ("string" != typeof name) throw new TypeError("String expected for parameter \"name\"");if (!Array.isArray(params)) throw new TypeError("Array containing strings or objects expected for parameter \"params\"");if (!isNode(expr)) throw new TypeError("Node expected for parameter \"expr\"");if (keywords.has(name)) throw new Error("Illegal function name, \"" + name + "\" is a reserved keyword");this.name = name, this.params = params.map(function (param) {return param && param.name || param;}), this.types = params.map(function (param) {return param && param.type || "any";}), this.expr = expr;}function needParenthesis(node, parenthesis) {var precedence = getPrecedence(node, parenthesis),exprPrecedence = getPrecedence(node.expr, parenthesis);return "all" === parenthesis || null !== exprPrecedence && exprPrecedence <= precedence;}var { typed, Node } = _ref;return FunctionAssignmentNode.prototype = new Node(), FunctionAssignmentNode.prototype.type = "FunctionAssignmentNode", FunctionAssignmentNode.prototype.isFunctionAssignmentNode = !0, FunctionAssignmentNode.prototype._compile = function (math, argNames) {var childArgNames = Object.create(argNames);forEach(this.params, function (param) {childArgNames[param] = !0;});var evalExpr = this.expr._compile(math, childArgNames),name = this.name,params = this.params,signature = join(this.types, ","),syntax = "FunctionAssignmentNode(" + join(this.params, ", ") + ")";return function (scope, args, context) {var signatures = {};signatures[signature] = function () {for (var childArgs = Object.create(args), i = 0; i < params.length; i++) childArgs[params[i]] = arguments[i];return evalExpr(scope, childArgs, context);};var fn = typed(name, signatures);return fn.syntax = syntax, scope.set(name, fn), fn;};}, FunctionAssignmentNode.prototype.forEach = function (callback) {callback(this.expr, "expr", this);}, FunctionAssignmentNode.prototype.map = function (callback) {var expr = this._ifNode(callback(this.expr, "expr", this));return new FunctionAssignmentNode(this.name, this.params.slice(0), expr);}, FunctionAssignmentNode.prototype.clone = function () {return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr);}, FunctionAssignmentNode.prototype._toString = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",expr = this.expr.toString(options);return needParenthesis(this, parenthesis) && (expr = "(" + expr + ")"), this.name + "(" + this.params.join(", ") + ") = " + expr;}, FunctionAssignmentNode.prototype.toJSON = function () {var types = this.types;return { mathjs: "FunctionAssignmentNode", name: this.name, params: this.params.map(function (param, index) {return { name: param, type: types[index] };}), expr: this.expr };}, FunctionAssignmentNode.fromJSON = function (json) {return new FunctionAssignmentNode(json.name, json.params, json.expr);}, FunctionAssignmentNode.prototype.toHTML = function (options) {for (var parenthesis = options && options.parenthesis ? options.parenthesis : "keep", params = [], i = 0; i < this.params.length; i++) params.push("<span class=\"math-symbol math-parameter\">" + string_escape(this.params[i]) + "</span>");var expr = this.expr.toHTML(options);return needParenthesis(this, parenthesis) && (expr = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + expr + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), "<span class=\"math-function\">" + string_escape(this.name) + "</span><span class=\"math-parenthesis math-round-parenthesis\">(</span>" + params.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-parenthesis math-round-parenthesis\">)</span><span class=\"math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator\">=</span>" + expr;}, FunctionAssignmentNode.prototype._toTex = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",expr = this.expr.toTex(options);return needParenthesis(this, parenthesis) && (expr = "\\left(".concat(expr, "\\right)")), "\\mathrm{" + this.name + "}\\left(" + this.params.map(toSymbol).join(",") + "\\right):=" + expr;}, FunctionAssignmentNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/type/chain/function/chain.js
var chain_name = "chain",chain_dependencies = ["typed", "Chain"];var createChain = factory("chain", chain_dependencies, (_ref) => {var { typed, Chain } = _ref;return typed(chain_name, { "": function () {return new Chain();}, any: function (value) {return new Chain(value);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js
function errorTransform(err) {return err && err.isIndexError ? new IndexError(err.index + 1, err.min + 1, void 0 === err.max ? void 0 : err.max + 1) : err;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/utils/access.js
function accessFactory(_ref) {var { subset } = _ref;return function (object, index) {try {if (Array.isArray(object)) return subset(object, index);if (object && "function" == typeof object.subset) return object.subset(index);if ("string" == typeof object) return subset(object, index);if ("object" == typeof object) {if (!index.isObjectProperty()) throw new TypeError("Cannot apply a numeric index as object property");return getSafeProperty(object, index.getObjectProperty());}throw new TypeError("Cannot apply index: unsupported type of object");} catch (err) {throw errorTransform(err);}};}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/AccessorNode.js
var AccessorNode_name = "AccessorNode",AccessorNode_dependencies = ["subset", "Node"];var createAccessorNode = factory("AccessorNode", AccessorNode_dependencies, (_ref) => {function AccessorNode(object, index) {if (!(this instanceof AccessorNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!isNode(object)) throw new TypeError("Node expected for parameter \"object\"");if (!isIndexNode(index)) throw new TypeError("IndexNode expected for parameter \"index\"");this.object = object || null, this.index = index, Object.defineProperty(this, "name", { get: function () {return this.index ? this.index.isObjectProperty() ? this.index.getObjectProperty() : "" : this.object.name || "";}.bind(this), set: function () {throw new Error("Cannot assign a new name, name is read-only");} });}function needParenthesis(node) {return !(isAccessorNode(node) || isArrayNode(node) || isConstantNode(node) || isFunctionNode(node) || isObjectNode(node) || isParenthesisNode(node) || isSymbolNode(node));}var { subset, Node } = _ref,access = accessFactory({ subset });return AccessorNode.prototype = new Node(), AccessorNode.prototype.type = "AccessorNode", AccessorNode.prototype.isAccessorNode = !0, AccessorNode.prototype._compile = function (math, argNames) {var evalObject = this.object._compile(math, argNames),evalIndex = this.index._compile(math, argNames);if (this.index.isObjectProperty()) {var prop = this.index.getObjectProperty();return function (scope, args, context) {return getSafeProperty(evalObject(scope, args, context), prop);};}return function (scope, args, context) {var object = evalObject(scope, args, context),index = evalIndex(scope, args, object);return access(object, index);};}, AccessorNode.prototype.forEach = function (callback) {callback(this.object, "object", this), callback(this.index, "index", this);}, AccessorNode.prototype.map = function (callback) {return new AccessorNode(this._ifNode(callback(this.object, "object", this)), this._ifNode(callback(this.index, "index", this)));}, AccessorNode.prototype.clone = function () {return new AccessorNode(this.object, this.index);}, AccessorNode.prototype._toString = function (options) {var object = this.object.toString(options);return needParenthesis(this.object) && (object = "(" + object + ")"), object + this.index.toString(options);}, AccessorNode.prototype.toHTML = function (options) {var object = this.object.toHTML(options);return needParenthesis(this.object) && (object = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + object + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), object + this.index.toHTML(options);}, AccessorNode.prototype._toTex = function (options) {var object = this.object.toTex(options);return needParenthesis(this.object) && (object = "\\left(' + object + '\\right)"), object + this.index.toTex(options);}, AccessorNode.prototype.toJSON = function () {return { mathjs: "AccessorNode", object: this.object, index: this.index };}, AccessorNode.fromJSON = function (json) {return new AccessorNode(json.object, json.index);}, AccessorNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/IndexNode.js
var IndexNode_name = "IndexNode",IndexNode_dependencies = ["Range", "Node", "size"];var createIndexNode = factory("IndexNode", IndexNode_dependencies, (_ref) => {function IndexNode(dimensions, dotNotation) {if (!(this instanceof IndexNode)) throw new SyntaxError("Constructor must be called with the new operator");if (this.dimensions = dimensions, this.dotNotation = dotNotation || !1, !Array.isArray(dimensions) || !dimensions.every(isNode)) throw new TypeError("Array containing Nodes expected for parameter \"dimensions\"");if (this.dotNotation && !this.isObjectProperty()) throw new Error("dotNotation only applicable for object properties");}function createRange(start, end, step) {return new Range(isBigNumber(start) ? start.toNumber() : start, isBigNumber(end) ? end.toNumber() : end, isBigNumber(step) ? step.toNumber() : step);}var { Range, Node, size } = _ref;return IndexNode.prototype = new Node(), IndexNode.prototype.type = "IndexNode", IndexNode.prototype.isIndexNode = !0, IndexNode.prototype._compile = function (math, argNames) {var evalDimensions = map(this.dimensions, function (range, i) {if (isRangeNode(range)) {if (range.needsEnd()) {var childArgNames = Object.create(argNames);childArgNames.end = !0;var evalStart = range.start._compile(math, childArgNames),evalEnd = range.end._compile(math, childArgNames),evalStep = range.step ? range.step._compile(math, childArgNames) : function () {return 1;};return function (scope, args, context) {var s = size(context).valueOf(),childArgs = Object.create(args);return childArgs.end = s[i], createRange(evalStart(scope, childArgs, context), evalEnd(scope, childArgs, context), evalStep(scope, childArgs, context));};}var _evalStart = range.start._compile(math, argNames),_evalEnd = range.end._compile(math, argNames),_evalStep = range.step ? range.step._compile(math, argNames) : function () {return 1;};return function (scope, args, context) {return createRange(_evalStart(scope, args, context), _evalEnd(scope, args, context), _evalStep(scope, args, context));};}if (isSymbolNode(range) && "end" === range.name) {var _childArgNames = Object.create(argNames);_childArgNames.end = !0;var evalRange = range._compile(math, _childArgNames);return function (scope, args, context) {var s = size(context).valueOf(),childArgs = Object.create(args);return childArgs.end = s[i], evalRange(scope, childArgs, context);};}var _evalRange = range._compile(math, argNames);return function (scope, args, context) {return _evalRange(scope, args, context);};}),index = getSafeProperty(math, "index");return function (scope, args, context) {var dimensions = map(evalDimensions, function (evalDimension) {return evalDimension(scope, args, context);});return index(...dimensions);};}, IndexNode.prototype.forEach = function (callback) {for (var i = 0; i < this.dimensions.length; i++) callback(this.dimensions[i], "dimensions[" + i + "]", this);}, IndexNode.prototype.map = function (callback) {for (var dimensions = [], i = 0; i < this.dimensions.length; i++) dimensions[i] = this._ifNode(callback(this.dimensions[i], "dimensions[" + i + "]", this));return new IndexNode(dimensions, this.dotNotation);}, IndexNode.prototype.clone = function () {return new IndexNode(this.dimensions.slice(0), this.dotNotation);}, IndexNode.prototype.isObjectProperty = function () {return 1 === this.dimensions.length && isConstantNode(this.dimensions[0]) && "string" == typeof this.dimensions[0].value;}, IndexNode.prototype.getObjectProperty = function () {return this.isObjectProperty() ? this.dimensions[0].value : null;}, IndexNode.prototype._toString = function () {return this.dotNotation ? "." + this.getObjectProperty() : "[" + this.dimensions.join(", ") + "]";}, IndexNode.prototype.toJSON = function () {return { mathjs: "IndexNode", dimensions: this.dimensions, dotNotation: this.dotNotation };}, IndexNode.fromJSON = function (json) {return new IndexNode(json.dimensions, json.dotNotation);}, IndexNode.prototype.toHTML = function () {for (var dimensions = [], i = 0; i < this.dimensions.length; i++) dimensions[i] = this.dimensions[i].toHTML();return this.dotNotation ? "<span class=\"math-operator math-accessor-operator\">.</span><span class=\"math-symbol math-property\">" + string_escape(this.getObjectProperty()) + "</span>" : "<span class=\"math-parenthesis math-square-parenthesis\">[</span>" + dimensions.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-parenthesis math-square-parenthesis\">]</span>";}, IndexNode.prototype._toTex = function (options) {var dimensions = this.dimensions.map(function (range) {return range.toTex(options);});return this.dotNotation ? "." + this.getObjectProperty() + "" : "_{" + dimensions.join(",") + "}";}, IndexNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/utils/assign.js
function assignFactory(_ref) {var { subset, matrix } = _ref;return function (object, index, value) {try {if (Array.isArray(object)) return matrix(object).subset(index, value).valueOf();if (object && "function" == typeof object.subset) return object.subset(index, value);if ("string" == typeof object) return subset(object, index, value);if ("object" == typeof object) {if (!index.isObjectProperty()) throw TypeError("Cannot apply a numeric index as object property");return setSafeProperty(object, index.getObjectProperty(), value), object;}throw new TypeError("Cannot apply index: unsupported type of object");} catch (err) {throw errorTransform(err);}};}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js
var AssignmentNode_name = "AssignmentNode",AssignmentNode_dependencies = ["subset", "?matrix", "Node"];var createAssignmentNode = factory("AssignmentNode", AssignmentNode_dependencies, (_ref) => {function AssignmentNode(object, index, value) {if (!(this instanceof AssignmentNode)) throw new SyntaxError("Constructor must be called with the new operator");if (this.object = object, this.index = value ? index : null, this.value = value || index, !isSymbolNode(object) && !isAccessorNode(object)) throw new TypeError("SymbolNode or AccessorNode expected as \"object\"");if (isSymbolNode(object) && "end" === object.name) throw new Error("Cannot assign to symbol \"end\"");if (this.index && !isIndexNode(this.index)) throw new TypeError("IndexNode expected as \"index\"");if (!isNode(this.value)) throw new TypeError("Node expected as \"value\"");Object.defineProperty(this, "name", { get: function () {return this.index ? this.index.isObjectProperty() ? this.index.getObjectProperty() : "" : this.object.name || "";}.bind(this), set: function () {throw new Error("Cannot assign a new name, name is read-only");} });}function needParenthesis(node, parenthesis) {parenthesis || (parenthesis = "keep");var precedence = getPrecedence(node, parenthesis),exprPrecedence = getPrecedence(node.value, parenthesis);return "all" === parenthesis || null !== exprPrecedence && exprPrecedence <= precedence;}var { subset, matrix, Node } = _ref,access = accessFactory({ subset }),assign = assignFactory({ subset, matrix });return AssignmentNode.prototype = new Node(), AssignmentNode.prototype.type = "AssignmentNode", AssignmentNode.prototype.isAssignmentNode = !0, AssignmentNode.prototype._compile = function (math, argNames) {var evalObject = this.object._compile(math, argNames),evalIndex = this.index ? this.index._compile(math, argNames) : null,evalValue = this.value._compile(math, argNames),name = this.object.name;if (!this.index) {if (!isSymbolNode(this.object)) throw new TypeError("SymbolNode expected as object");return function (scope, args, context) {var value = evalValue(scope, args, context);return scope.set(name, value), value;};}if (this.index.isObjectProperty()) {var prop = this.index.getObjectProperty();return function (scope, args, context) {var object = evalObject(scope, args, context),value = evalValue(scope, args, context);return setSafeProperty(object, prop, value), value;};}if (isSymbolNode(this.object)) return function (scope, args, context) {var childObject = evalObject(scope, args, context),value = evalValue(scope, args, context),index = evalIndex(scope, args, childObject);return scope.set(name, assign(childObject, index, value)), value;};var evalParentObject = this.object.object._compile(math, argNames);if (this.object.index.isObjectProperty()) {var parentProp = this.object.index.getObjectProperty();return function (scope, args, context) {var parent = evalParentObject(scope, args, context),childObject = getSafeProperty(parent, parentProp),index = evalIndex(scope, args, childObject),value = evalValue(scope, args, context);return setSafeProperty(parent, parentProp, assign(childObject, index, value)), value;};}var evalParentIndex = this.object.index._compile(math, argNames);return function (scope, args, context) {var parent = evalParentObject(scope, args, context),parentIndex = evalParentIndex(scope, args, parent),childObject = access(parent, parentIndex),index = evalIndex(scope, args, childObject),value = evalValue(scope, args, context);return assign(parent, parentIndex, assign(childObject, index, value)), value;};}, AssignmentNode.prototype.forEach = function (callback) {callback(this.object, "object", this), this.index && callback(this.index, "index", this), callback(this.value, "value", this);}, AssignmentNode.prototype.map = function (callback) {var object = this._ifNode(callback(this.object, "object", this)),index = this.index ? this._ifNode(callback(this.index, "index", this)) : null,value = this._ifNode(callback(this.value, "value", this));return new AssignmentNode(object, index, value);}, AssignmentNode.prototype.clone = function () {return new AssignmentNode(this.object, this.index, this.value);}, AssignmentNode.prototype._toString = function (options) {var object = this.object.toString(options),index = this.index ? this.index.toString(options) : "",value = this.value.toString(options);return needParenthesis(this, options && options.parenthesis) && (value = "(" + value + ")"), object + index + " = " + value;}, AssignmentNode.prototype.toJSON = function () {return { mathjs: "AssignmentNode", object: this.object, index: this.index, value: this.value };}, AssignmentNode.fromJSON = function (json) {return new AssignmentNode(json.object, json.index, json.value);}, AssignmentNode.prototype.toHTML = function (options) {var object = this.object.toHTML(options),index = this.index ? this.index.toHTML(options) : "",value = this.value.toHTML(options);return needParenthesis(this, options && options.parenthesis) && (value = "<span class=\"math-paranthesis math-round-parenthesis\">(</span>" + value + "<span class=\"math-paranthesis math-round-parenthesis\">)</span>"), object + index + "<span class=\"math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator\">=</span>" + value;}, AssignmentNode.prototype._toTex = function (options) {var object = this.object.toTex(options),index = this.index ? this.index.toTex(options) : "",value = this.value.toTex(options);return needParenthesis(this, options && options.parenthesis) && (value = "\\left(".concat(value, "\\right)")), object + index + ":=" + value;}, AssignmentNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/SymbolNode.js
var SymbolNode_name = "SymbolNode",SymbolNode_dependencies = ["math", "?Unit", "Node"];var createSymbolNode = factory("SymbolNode", SymbolNode_dependencies, (_ref) => {function isValuelessUnit(name) {return !!Unit && Unit.isValuelessUnit(name);}function SymbolNode(name) {if (!(this instanceof SymbolNode)) throw new SyntaxError("Constructor must be called with the new operator");if ("string" != typeof name) throw new TypeError("String expected for parameter \"name\"");this.name = name;}var { math, Unit, Node } = _ref;return SymbolNode.prototype = new Node(), SymbolNode.prototype.type = "SymbolNode", SymbolNode.prototype.isSymbolNode = !0, SymbolNode.prototype._compile = function (math, argNames) {var name = this.name;if (!0 === argNames[name]) return function (scope, args) {return args[name];};if (name in math) return function (scope) {return scope.has(name) ? scope.get(name) : getSafeProperty(math, name);};var isUnit = isValuelessUnit(name);return function (scope) {return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name);};}, SymbolNode.prototype.forEach = function () {}, SymbolNode.prototype.map = function () {return this.clone();}, SymbolNode.onUndefinedSymbol = function (name) {throw new Error("Undefined symbol " + name);}, SymbolNode.prototype.clone = function () {return new SymbolNode(this.name);}, SymbolNode.prototype._toString = function () {return this.name;}, SymbolNode.prototype.toHTML = function () {var name = string_escape(this.name);return "true" === name || "false" === name ? "<span class=\"math-symbol math-boolean\">" + name + "</span>" : "i" === name ? "<span class=\"math-symbol math-imaginary-symbol\">" + name + "</span>" : "Infinity" === name ? "<span class=\"math-symbol math-infinity-symbol\">" + name + "</span>" : "NaN" === name ? "<span class=\"math-symbol math-nan-symbol\">" + name + "</span>" : "null" === name ? "<span class=\"math-symbol math-null-symbol\">" + name + "</span>" : "undefined" === name ? "<span class=\"math-symbol math-undefined-symbol\">" + name + "</span>" : "<span class=\"math-symbol\">" + name + "</span>";}, SymbolNode.prototype.toJSON = function () {return { mathjs: "SymbolNode", name: this.name };}, SymbolNode.fromJSON = function (json) {return new SymbolNode(json.name);}, SymbolNode.prototype._toTex = function () {var isUnit = !1;"undefined" == typeof math[this.name] && isValuelessUnit(this.name) && (isUnit = !0);var symbol = toSymbol(this.name, isUnit);return "\\" === symbol[0] ? symbol : " " + symbol;}, SymbolNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/scope.js
function createSubScope(parentScope) {for (var _len = arguments.length, args = Array(1 < _len ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];return "function" == typeof parentScope.createSubScope ? map_assign(parentScope.createSubScope(), ...args) : map_assign(createEmptyMap(), parentScope, ...args);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/node/FunctionNode.js
var FunctionNode_name = "FunctionNode",FunctionNode_dependencies = ["math", "Node", "SymbolNode"];var createFunctionNode = factory("FunctionNode", FunctionNode_dependencies, (_ref) => {function FunctionNode(fn, args) {if (!(this instanceof FunctionNode)) throw new SyntaxError("Constructor must be called with the new operator");if ("string" == typeof fn && (fn = new SymbolNode(fn)), !isNode(fn)) throw new TypeError("Node expected as parameter \"fn\"");if (!Array.isArray(args) || !args.every(isNode)) throw new TypeError("Array containing Nodes expected for parameter \"args\"");this.fn = fn, this.args = args || [], Object.defineProperty(this, "name", { get: function () {return this.fn.name || "";}.bind(this), set: function () {throw new Error("Cannot assign a new name, name is read-only");} });}function expandTemplate(template, node, options) {for (var match, latex = "", regex = /\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi, inputPos = 0; null !== (match = regex.exec(template));) if (latex += template.substring(inputPos, match.index), inputPos = match.index, "$$" === match[0]) latex += "$", inputPos++;else {inputPos += match[0].length;var property = node[match[1]];if (!property) throw new ReferenceError("Template: Property " + match[1] + " does not exist.");if (void 0 === match[2]) switch (typeof property) {case "string":latex += property;break;case "object":if (isNode(property)) latex += property.toTex(options);else if (Array.isArray(property)) latex += property.map(function (arg, index) {if (isNode(arg)) return arg.toTex(options);throw new TypeError("Template: " + match[1] + "[" + index + "] is not a Node.");}).join(",");else throw new TypeError("Template: " + match[1] + " has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: " + match[1] + " has to be a Node, String or array of Nodes");} else if (isNode(property[match[2]] && property[match[2]])) latex += property[match[2]].toTex(options);else throw new TypeError("Template: " + match[1] + "[" + match[2] + "] is not a Node.");}return latex += template.slice(inputPos), latex;}var { math, Node, SymbolNode } = _ref;FunctionNode.prototype = new Node(), FunctionNode.prototype.type = "FunctionNode", FunctionNode.prototype.isFunctionNode = !0, FunctionNode.prototype._compile = function (math, argNames) {if (!(this instanceof FunctionNode)) throw new TypeError("No valid FunctionNode");var evalArgs = this.args.map((arg) => arg._compile(math, argNames));if (isSymbolNode(this.fn)) {var _name = this.fn.name,fn = _name in math ? getSafeProperty(math, _name) : void 0,isRaw = "function" == typeof fn && !0 === fn.rawArgs,resolveFn = (scope) => scope.has(_name) ? scope.get(_name) : _name in math ? getSafeProperty(math, _name) : FunctionNode.onUndefinedFunction(_name);if (isRaw) {var rawArgs = this.args;return function (scope, args) {var fn = resolveFn(scope);return fn(rawArgs, math, createSubScope(scope, args), scope);};}switch (evalArgs.length) {case 0:return function (scope) {var fn = resolveFn(scope);return fn();};case 1:return function (scope, args, context) {var fn = resolveFn(scope),evalArg0 = evalArgs[0];return fn(evalArg0(scope, args, context));};case 2:return function (scope, args, context) {var fn = resolveFn(scope),evalArg0 = evalArgs[0],evalArg1 = evalArgs[1];return fn(evalArg0(scope, args, context), evalArg1(scope, args, context));};default:return function (scope, args, context) {var fn = resolveFn(scope),values = evalArgs.map((evalArg) => evalArg(scope, args, context));return fn(...values);};}} else {if (isAccessorNode(this.fn) && isIndexNode(this.fn.index) && this.fn.index.isObjectProperty()) {var evalObject = this.fn.object._compile(math, argNames),prop = this.fn.index.getObjectProperty(),_rawArgs = this.args;return function (scope, args, context) {var object = evalObject(scope, args, context);validateSafeMethod(object, prop);var isRaw = object[prop] && object[prop].rawArgs;if (isRaw) return object[prop](_rawArgs, math, createSubScope(scope, args), scope);var values = evalArgs.map((evalArg) => evalArg(scope, args, context));return object[prop].apply(object, values);};}var evalFn = this.fn._compile(math, argNames),_rawArgs2 = this.args;return function (scope, args, context) {var fn = evalFn(scope, args, context),isRaw = fn && fn.rawArgs;if (isRaw) return fn(_rawArgs2, math, createSubScope(scope, args), scope);var values = evalArgs.map((evalArg) => evalArg(scope, args, context));return fn.apply(fn, values);};}}, FunctionNode.prototype.forEach = function (callback) {callback(this.fn, "fn", this);for (var i = 0; i < this.args.length; i++) callback(this.args[i], "args[" + i + "]", this);}, FunctionNode.prototype.map = function (callback) {for (var fn = this._ifNode(callback(this.fn, "fn", this)), args = [], i = 0; i < this.args.length; i++) args[i] = this._ifNode(callback(this.args[i], "args[" + i + "]", this));return new FunctionNode(fn, args);}, FunctionNode.prototype.clone = function () {return new FunctionNode(this.fn, this.args.slice(0));}, FunctionNode.onUndefinedFunction = function (name) {throw new Error("Undefined function " + name);};var nodeToString = FunctionNode.prototype.toString;FunctionNode.prototype.toString = function (options) {var customString,name = this.fn.toString(options);return options && "object" == typeof options.handler && object_hasOwnProperty(options.handler, name) && (customString = options.handler[name](this, options)), "undefined" == typeof customString ? nodeToString.call(this, options) : customString;}, FunctionNode.prototype._toString = function (options) {var args = this.args.map(function (arg) {return arg.toString(options);}),fn = isFunctionAssignmentNode(this.fn) ? "(" + this.fn.toString(options) + ")" : this.fn.toString(options);return fn + "(" + args.join(", ") + ")";}, FunctionNode.prototype.toJSON = function () {return { mathjs: "FunctionNode", fn: this.fn, args: this.args };}, FunctionNode.fromJSON = function (json) {return new FunctionNode(json.fn, json.args);}, FunctionNode.prototype.toHTML = function (options) {var args = this.args.map(function (arg) {return arg.toHTML(options);});return "<span class=\"math-function\">" + string_escape(this.fn) + "</span><span class=\"math-paranthesis math-round-parenthesis\">(</span>" + args.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-paranthesis math-round-parenthesis\">)</span>";};var nodeToTex = FunctionNode.prototype.toTex;return FunctionNode.prototype.toTex = function (options) {var customTex;return options && "object" == typeof options.handler && object_hasOwnProperty(options.handler, this.name) && (customTex = options.handler[this.name](this, options)), "undefined" == typeof customTex ? nodeToTex.call(this, options) : customTex;}, FunctionNode.prototype._toTex = function (options) {var latexConverter,args = this.args.map(function (arg) {return arg.toTex(options);});latexFunctions[this.name] && (latexConverter = latexFunctions[this.name]), math[this.name] && ("function" == typeof math[this.name].toTex || "object" == typeof math[this.name].toTex || "string" == typeof math[this.name].toTex) && (latexConverter = math[this.name].toTex);var customToTex;switch (typeof latexConverter) {case "function":customToTex = latexConverter(this, options);break;case "string":customToTex = expandTemplate(latexConverter, this, options);break;case "object":switch (typeof latexConverter[args.length]) {case "function":customToTex = latexConverter[args.length](this, options);break;case "string":customToTex = expandTemplate(latexConverter[args.length], this, options);}}return "undefined" == typeof customToTex ? expandTemplate(defaultTemplate, this, options) : customToTex;}, FunctionNode.prototype.getIdentifier = function () {return this.type + ":" + this.name;}, FunctionNode;}, { isClass: !0, isNode: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/parse.js
var parse_name = "parse",parse_dependencies = ["typed", "numeric", "config", "AccessorNode", "ArrayNode", "AssignmentNode", "BlockNode", "ConditionalNode", "ConstantNode", "FunctionAssignmentNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "RangeNode", "RelationalNode", "SymbolNode"];var createParse = factory("parse", parse_dependencies, (_ref) => {function parseMultiple(expressions) {var options = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},extraNodes = void 0 === options.nodes ? {} : options.nodes;return deepMap(expressions, function (elem) {if ("string" != typeof elem) throw new TypeError("String expected");return parseStart(elem, extraNodes);});}function initialState() {return { extraNodes: {}, expression: "", comment: "", index: 0, token: "", tokenType: TOKENTYPE.NULL, nestingLevel: 0, conditionalLevel: null };}function currentString(state, length) {return state.expression.substr(state.index, length);}function currentCharacter(state) {return currentString(state, 1);}function next(state) {state.index++;}function prevCharacter(state) {return state.expression.charAt(state.index - 1);}function nextCharacter(state) {return state.expression.charAt(state.index + 1);}function getToken(state) {for (state.tokenType = TOKENTYPE.NULL, state.token = "", state.comment = ""; parse.isWhitespace(currentCharacter(state), state.nestingLevel);) next(state);if ("#" === currentCharacter(state)) for (; "\n" !== currentCharacter(state) && "" !== currentCharacter(state);) state.comment += currentCharacter(state), next(state);if ("" === currentCharacter(state)) return void (state.tokenType = TOKENTYPE.DELIMITER);if ("\n" === currentCharacter(state) && !state.nestingLevel) return state.tokenType = TOKENTYPE.DELIMITER, state.token = currentCharacter(state), void next(state);var c1 = currentCharacter(state),c2 = currentString(state, 2),c3 = currentString(state, 3);if (3 === c3.length && DELIMITERS[c3]) return state.tokenType = TOKENTYPE.DELIMITER, state.token = c3, next(state), next(state), void next(state);if (2 === c2.length && DELIMITERS[c2]) return state.tokenType = TOKENTYPE.DELIMITER, state.token = c2, next(state), void next(state);if (DELIMITERS[c1]) return state.tokenType = TOKENTYPE.DELIMITER, state.token = c1, void next(state);if (parse.isDigitDot(c1)) {state.tokenType = TOKENTYPE.NUMBER;var _c = currentString(state, 2);if ("0b" === _c || "0o" === _c || "0x" === _c) {for (state.token += currentCharacter(state), next(state), state.token += currentCharacter(state), next(state); parse.isHexDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);if ("." === currentCharacter(state)) for (state.token += ".", next(state); parse.isHexDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);else if ("i" === currentCharacter(state)) for (state.token += "i", next(state); parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);return;}if ("." === currentCharacter(state)) state.token += currentCharacter(state), next(state), parse.isDigit(currentCharacter(state)) || (state.tokenType = TOKENTYPE.DELIMITER);else {for (; parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);parse.isDecimalMark(currentCharacter(state), nextCharacter(state)) && (state.token += currentCharacter(state), next(state));}for (; parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);if ("E" === currentCharacter(state) || "e" === currentCharacter(state)) if (parse.isDigit(nextCharacter(state)) || "-" === nextCharacter(state) || "+" === nextCharacter(state)) {if (state.token += currentCharacter(state), next(state), ("+" === currentCharacter(state) || "-" === currentCharacter(state)) && (state.token += currentCharacter(state), next(state)), !parse.isDigit(currentCharacter(state))) throw createSyntaxError(state, "Digit expected, got \"" + currentCharacter(state) + "\"");for (; parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) throw createSyntaxError(state, "Digit expected, got \"" + currentCharacter(state) + "\"");} else if ("." === nextCharacter(state)) throw next(state), createSyntaxError(state, "Digit expected, got \"" + currentCharacter(state) + "\"");return;}if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {for (; parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);return void (state.tokenType = object_hasOwnProperty(NAMED_DELIMITERS, state.token) ? TOKENTYPE.DELIMITER : TOKENTYPE.SYMBOL);}for (state.tokenType = TOKENTYPE.UNKNOWN; "" !== currentCharacter(state);) state.token += currentCharacter(state), next(state);throw createSyntaxError(state, "Syntax error in part \"" + state.token + "\"");}function getTokenSkipNewline(state) {do getToken(state); while ("\n" === state.token);}function openParams(state) {state.nestingLevel++;}function closeParams(state) {state.nestingLevel--;}function parseStart(expression, extraNodes) {var state = initialState();helpers_extends(state, { expression, extraNodes }), getToken(state);var node = parseBlock(state);if ("" !== state.token) if (state.tokenType === TOKENTYPE.DELIMITER) throw createError(state, "Unexpected operator " + state.token);else throw createSyntaxError(state, "Unexpected part \"" + state.token + "\"");return node;}function parseBlock(state) {var node,visible,blocks = [];for ("" !== state.token && "\n" !== state.token && ";" !== state.token && (node = parseAssignment(state), node.comment = state.comment); "\n" === state.token || ";" === state.token;) 0 === blocks.length && node && (visible = ";" !== state.token, blocks.push({ node: node, visible: visible })), getToken(state), "\n" !== state.token && ";" !== state.token && "" !== state.token && (node = parseAssignment(state), node.comment = state.comment, visible = ";" !== state.token, blocks.push({ node: node, visible: visible }));return 0 < blocks.length ? new BlockNode(blocks) : (node || (node = new ConstantNode(void 0), node.comment = state.comment), node);}function parseAssignment(state) {var name,args,value,valid,node = parseConditional(state);if ("=" === state.token) {if (isSymbolNode(node)) return name = node.name, getTokenSkipNewline(state), value = parseAssignment(state), new AssignmentNode(new SymbolNode(name), value);if (isAccessorNode(node)) return getTokenSkipNewline(state), value = parseAssignment(state), new AssignmentNode(node.object, node.index, value);if (isFunctionNode(node) && isSymbolNode(node.fn) && (valid = !0, args = [], name = node.name, node.args.forEach(function (arg, index) {isSymbolNode(arg) ? args[index] = arg.name : valid = !1;}), valid)) return getTokenSkipNewline(state), value = parseAssignment(state), new FunctionAssignmentNode(name, args, value);throw createSyntaxError(state, "Invalid left hand side of assignment operator =");}return node;}function parseConditional(state) {for (var prev, node = parseLogicalOr(state); "?" === state.token;) {prev = state.conditionalLevel, state.conditionalLevel = state.nestingLevel, getTokenSkipNewline(state);var condition = node,trueExpr = parseAssignment(state);if (":" !== state.token) throw createSyntaxError(state, "False part of conditional expression expected");state.conditionalLevel = null, getTokenSkipNewline(state);var falseExpr = parseAssignment(state);node = new ConditionalNode(condition, trueExpr, falseExpr), state.conditionalLevel = prev;}return node;}function parseLogicalOr(state) {for (var node = parseLogicalXor(state); "or" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("or", "or", [node, parseLogicalXor(state)]);return node;}function parseLogicalXor(state) {for (var node = parseLogicalAnd(state); "xor" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("xor", "xor", [node, parseLogicalAnd(state)]);return node;}function parseLogicalAnd(state) {for (var node = parseBitwiseOr(state); "and" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("and", "and", [node, parseBitwiseOr(state)]);return node;}function parseBitwiseOr(state) {for (var node = parseBitwiseXor(state); "|" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("|", "bitOr", [node, parseBitwiseXor(state)]);return node;}function parseBitwiseXor(state) {for (var node = parseBitwiseAnd(state); "^|" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("^|", "bitXor", [node, parseBitwiseAnd(state)]);return node;}function parseBitwiseAnd(state) {for (var node = parseRelational(state); "&" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("&", "bitAnd", [node, parseRelational(state)]);return node;}function parseRelational(state) {for (var cond, params = [parseShift(state)], conditionals = [], operators = { "==": "equal", "!=": "unequal", "<": "smaller", ">": "larger", "<=": "smallerEq", ">=": "largerEq" }; object_hasOwnProperty(operators, state.token);) cond = { name: state.token, fn: operators[state.token] }, conditionals.push(cond), getTokenSkipNewline(state), params.push(parseShift(state));return 1 === params.length ? params[0] : 2 === params.length ? new OperatorNode(conditionals[0].name, conditionals[0].fn, params) : new RelationalNode(conditionals.map((c) => c.fn), params);}function parseShift(state) {var node, name, fn, params;node = parseConversion(state);for (var operators = { "<<": "leftShift", ">>": "rightArithShift", ">>>": "rightLogShift" }; object_hasOwnProperty(operators, state.token);) name = state.token, fn = operators[name], getTokenSkipNewline(state), params = [node, parseConversion(state)], node = new OperatorNode(name, fn, params);return node;}function parseConversion(state) {var node, name, fn, params;node = parseRange(state);for (var operators = { to: "to", in: "to" }; object_hasOwnProperty(operators, state.token);) name = state.token, fn = operators[name], getTokenSkipNewline(state), "in" === name && "" === state.token ? node = new OperatorNode("*", "multiply", [node, new SymbolNode("in")], !0) : (params = [node, parseRange(state)], node = new OperatorNode(name, fn, params));return node;}function parseRange(state) {var node,params = [];if (node = ":" === state.token ? new ConstantNode(1) : parseAddSubtract(state), ":" === state.token && state.conditionalLevel !== state.nestingLevel) {for (params.push(node); ":" === state.token && 3 > params.length;) getTokenSkipNewline(state), ")" === state.token || "]" === state.token || "," === state.token || "" === state.token ? params.push(new SymbolNode("end")) : params.push(parseAddSubtract(state));node = 3 === params.length ? new RangeNode(params[0], params[2], params[1]) : new RangeNode(params[0], params[1]);}return node;}function parseAddSubtract(state) {var node, name, fn, params;node = parseMultiplyDivide(state);for (var operators = { "+": "add", "-": "subtract" }; object_hasOwnProperty(operators, state.token);) name = state.token, fn = operators[name], getTokenSkipNewline(state), params = [node, parseMultiplyDivide(state)], node = new OperatorNode(name, fn, params);return node;}function parseMultiplyDivide(state) {var node, last, name, fn;node = parseImplicitMultiplication(state), last = node;for (var operators = { "*": "multiply", ".*": "dotMultiply", "/": "divide", "./": "dotDivide", "%": "mod", mod: "mod" }; object_hasOwnProperty(operators, state.token);) name = state.token, fn = operators[name], getTokenSkipNewline(state), last = parseImplicitMultiplication(state), node = new OperatorNode(name, fn, [node, last]);return node;}function parseImplicitMultiplication(state) {var node, last;for (node = parseRule2(state), last = node; state.tokenType === TOKENTYPE.SYMBOL || "in" === state.token && isConstantNode(node) || state.tokenType === TOKENTYPE.NUMBER && !isConstantNode(last) && (!isOperatorNode(last) || "!" === last.op) || "(" === state.token;) last = parseRule2(state), node = new OperatorNode("*", "multiply", [node, last], !0);return node;}function parseRule2(state) {for (var node = parseUnary(state), last = node, tokenStates = []; !!("/" === state.token && isConstantNode(last));) if (tokenStates.push(helpers_extends({}, state)), getTokenSkipNewline(state), state.tokenType !== TOKENTYPE.NUMBER) {helpers_extends(state, tokenStates.pop());break;} else if (tokenStates.push(helpers_extends({}, state)), getTokenSkipNewline(state), state.tokenType === TOKENTYPE.SYMBOL || "(" === state.token) helpers_extends(state, tokenStates.pop()), tokenStates.pop(), last = parseUnary(state), node = new OperatorNode("/", "divide", [node, last]);else {tokenStates.pop(), helpers_extends(state, tokenStates.pop());break;}return node;}function parseUnary(state) {var name,params,fn,operators = { "-": "unaryMinus", "+": "unaryPlus", "~": "bitNot", not: "not" };return object_hasOwnProperty(operators, state.token) ? (fn = operators[state.token], name = state.token, getTokenSkipNewline(state), params = [parseUnary(state)], new OperatorNode(name, fn, params)) : parsePow(state);}function parsePow(state) {var node, name, fn, params;return node = parseLeftHandOperators(state), ("^" === state.token || ".^" === state.token) && (name = state.token, fn = "^" === name ? "pow" : "dotPow", getTokenSkipNewline(state), params = [node, parseUnary(state)], node = new OperatorNode(name, fn, params)), node;}function parseLeftHandOperators(state) {var node, name, fn, params;node = parseCustomNodes(state);for (var operators = { "!": "factorial", "'": "ctranspose" }; object_hasOwnProperty(operators, state.token);) name = state.token, fn = operators[name], getToken(state), params = [node], node = new OperatorNode(name, fn, params), node = parseAccessors(state, node);return node;}function parseCustomNodes(state) {var params = [];if (state.tokenType === TOKENTYPE.SYMBOL && object_hasOwnProperty(state.extraNodes, state.token)) {var CustomNode = state.extraNodes[state.token];if (getToken(state), "(" === state.token) {if (params = [], openParams(state), getToken(state), ")" !== state.token) for (params.push(parseAssignment(state)); "," === state.token;) getToken(state), params.push(parseAssignment(state));if (")" !== state.token) throw createSyntaxError(state, "Parenthesis ) expected");closeParams(state), getToken(state);}return new CustomNode(params);}return parseSymbol(state);}function parseSymbol(state) {var node, name;return state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS ? (name = state.token, getToken(state), node = object_hasOwnProperty(CONSTANTS, name) ? new ConstantNode(CONSTANTS[name]) : -1 === NUMERIC_CONSTANTS.indexOf(name) ? new SymbolNode(name) : new ConstantNode(numeric(name, "number")), node = parseAccessors(state, node), node) : parseDoubleQuotesString(state);}function parseAccessors(state, node, types) {for (var params; ("(" === state.token || "[" === state.token || "." === state.token) && (!types || -1 !== types.indexOf(state.token));) if (params = [], "(" === state.token) {if (isSymbolNode(node) || isAccessorNode(node)) {if (openParams(state), getToken(state), ")" !== state.token) for (params.push(parseAssignment(state)); "," === state.token;) getToken(state), params.push(parseAssignment(state));if (")" !== state.token) throw createSyntaxError(state, "Parenthesis ) expected");closeParams(state), getToken(state), node = new FunctionNode(node, params);} else return node;} else if ("[" === state.token) {if (openParams(state), getToken(state), "]" !== state.token) for (params.push(parseAssignment(state)); "," === state.token;) getToken(state), params.push(parseAssignment(state));if ("]" !== state.token) throw createSyntaxError(state, "Parenthesis ] expected");closeParams(state), getToken(state), node = new AccessorNode(node, new IndexNode(params));} else {if (getToken(state), state.tokenType !== TOKENTYPE.SYMBOL) throw createSyntaxError(state, "Property name expected after dot");params.push(new ConstantNode(state.token)), getToken(state);node = new AccessorNode(node, new IndexNode(params, !0));}return node;}function parseDoubleQuotesString(state) {var node, str;return "\"" === state.token ? (str = parseDoubleQuotesStringToken(state), node = new ConstantNode(str), node = parseAccessors(state, node), node) : parseSingleQuotesString(state);}function parseDoubleQuotesStringToken(state) {for (var str = ""; "" !== currentCharacter(state) && "\"" !== currentCharacter(state);) "\\" === currentCharacter(state) && (str += currentCharacter(state), next(state)), str += currentCharacter(state), next(state);if (getToken(state), "\"" !== state.token) throw createSyntaxError(state, "End of string \" expected");return getToken(state), JSON.parse("\"" + str + "\"");}function parseSingleQuotesString(state) {var node, str;return "'" === state.token ? (str = parseSingleQuotesStringToken(state), node = new ConstantNode(str), node = parseAccessors(state, node), node) : parseMatrix(state);}function parseSingleQuotesStringToken(state) {for (var str = ""; "" !== currentCharacter(state) && "'" !== currentCharacter(state);) "\\" === currentCharacter(state) && (str += currentCharacter(state), next(state)), str += currentCharacter(state), next(state);if (getToken(state), "'" !== state.token) throw createSyntaxError(state, "End of string ' expected");return getToken(state), JSON.parse("\"" + str + "\"");}function parseMatrix(state) {var array, params, rows, cols;if ("[" === state.token) {if (openParams(state), getToken(state), "]" !== state.token) {var row = parseRow(state);if (";" === state.token) {for (rows = 1, params = [row]; ";" === state.token;) getToken(state), params[rows] = parseRow(state), rows++;if ("]" !== state.token) throw createSyntaxError(state, "End of matrix ] expected");closeParams(state), getToken(state), cols = params[0].items.length;for (var r = 1; r < rows; r++) if (params[r].items.length !== cols) throw createError(state, "Column dimensions mismatch (" + params[r].items.length + " !== " + cols + ")");array = new ArrayNode(params);} else {if ("]" !== state.token) throw createSyntaxError(state, "End of matrix ] expected");closeParams(state), getToken(state), array = row;}} else closeParams(state), getToken(state), array = new ArrayNode([]);return parseAccessors(state, array);}return parseObject(state);}function parseRow(state) {for (var params = [parseAssignment(state)], len = 1; "," === state.token;) getToken(state), params[len] = parseAssignment(state), len++;return new ArrayNode(params);}function parseObject(state) {if ("{" === state.token) {openParams(state);var key,properties = {};do if (getToken(state), "}" !== state.token) {if ("\"" === state.token) key = parseDoubleQuotesStringToken(state);else if ("'" === state.token) key = parseSingleQuotesStringToken(state);else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) key = state.token, getToken(state);else throw createSyntaxError(state, "Symbol or string expected as object key");if (":" !== state.token) throw createSyntaxError(state, "Colon : expected after object key");getToken(state), properties[key] = parseAssignment(state);} while ("," === state.token);if ("}" !== state.token) throw createSyntaxError(state, "Comma , or bracket } expected after object value");closeParams(state), getToken(state);var node = new ObjectNode(properties);return node = parseAccessors(state, node), node;}return parseNumber(state);}function parseNumber(state) {var numberStr;return state.tokenType === TOKENTYPE.NUMBER ? (numberStr = state.token, getToken(state), new ConstantNode(numeric(numberStr, config.number))) : parseParentheses(state);}function parseParentheses(state) {var node;if ("(" === state.token) {if (openParams(state), getToken(state), node = parseAssignment(state), ")" !== state.token) throw createSyntaxError(state, "Parenthesis ) expected");return closeParams(state), getToken(state), node = new ParenthesisNode(node), node = parseAccessors(state, node), node;}return parseEnd(state);}function parseEnd(state) {if ("" === state.token) throw createSyntaxError(state, "Unexpected end of expression");else throw createSyntaxError(state, "Value expected");}function col(state) {return state.index - state.token.length + 1;}function createSyntaxError(state, message) {var c = col(state),error = new SyntaxError(message + " (char " + c + ")");return error.char = c, error;}function createError(state, message) {var c = col(state),error = new SyntaxError(message + " (char " + c + ")");return error.char = c, error;}var { typed, numeric, config, AccessorNode, ArrayNode, AssignmentNode, BlockNode, ConditionalNode, ConstantNode, FunctionAssignmentNode, FunctionNode, IndexNode, ObjectNode, OperatorNode, ParenthesisNode, RangeNode, RelationalNode, SymbolNode } = _ref,parse = typed(parse_name, { string: function (expression) {return parseStart(expression, {});}, "Array | Matrix": function (expressions) {return parseMultiple(expressions, {});}, "string, Object": function (expression, options) {var extraNodes = void 0 === options.nodes ? {} : options.nodes;return parseStart(expression, extraNodes);}, "Array | Matrix, Object": parseMultiple }),TOKENTYPE = { NULL: 0, DELIMITER: 1, NUMBER: 2, SYMBOL: 3, UNKNOWN: 4 },DELIMITERS = { ",": !0, "(": !0, ")": !0, "[": !0, "]": !0, "{": !0, "}": !0, '"': !0, "'": !0, ";": !0, "+": !0, "-": !0, "*": !0, ".*": !0, "/": !0, "./": !0, "%": !0, "^": !0, ".^": !0, "~": !0, "!": !0, "&": !0, "|": !0, "^|": !0, "=": !0, ":": !0, "?": !0, "==": !0, "!=": !0, "<": !0, ">": !0, "<=": !0, ">=": !0, "<<": !0, ">>": !0, ">>>": !0 },NAMED_DELIMITERS = { mod: !0, to: !0, in: !0, and: !0, xor: !0, or: !0, not: !0 },CONSTANTS = { true: !0, false: !1, null: null, undefined: void 0 },NUMERIC_CONSTANTS = ["NaN", "Infinity"];return parse.isAlpha = function (c, cPrev, cNext) {return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c);}, parse.isValidLatinOrGreek = function (c) {return /^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(c);}, parse.isValidMathSymbol = function (high, low) {return /^[\uD835]$/.test(high) && /^[\uDC00-\uDFFF]$/.test(low) && /^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(low);}, parse.isWhitespace = function (c, nestingLevel) {return " " === c || "\t" === c || "\n" === c && 0 < nestingLevel;}, parse.isDecimalMark = function (c, cNext) {return "." === c && "/" !== cNext && "*" !== cNext && "^" !== cNext;}, parse.isDigitDot = function (c) {return "0" <= c && "9" >= c || "." === c;}, parse.isDigit = function (c) {return "0" <= c && "9" >= c;}, parse.isHexDigit = function (c) {return "0" <= c && "9" >= c || "a" <= c && "f" >= c || "A" <= c && "F" >= c;}, parse;});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/function/evaluate.js
var evaluate_name = "evaluate",evaluate_dependencies = ["typed", "parse"];var createEvaluate = factory("evaluate", evaluate_dependencies, (_ref) => {var { typed, parse } = _ref;return typed(evaluate_name, { string: function (expr) {var scope = createEmptyMap();return parse(expr).compile().evaluate(scope);}, "string, Map | Object": function (expr, scope) {return parse(expr).compile().evaluate(scope);}, "Array | Matrix": function (expr) {var scope = createEmptyMap();return deepMap(expr, function (entry) {return parse(entry).compile().evaluate(scope);});}, "Array | Matrix, Map | Object": function (expr, scope) {return deepMap(expr, function (entry) {return parse(entry).compile().evaluate(scope);});} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/Help.js
var Help_name = "Help",Help_dependencies = ["parse"];var createHelpClass = factory("Help", Help_dependencies, (_ref) => {function Help(doc) {if (!(this instanceof Help)) throw new SyntaxError("Constructor must be called with the new operator");if (!doc) throw new Error("Argument \"doc\" missing");this.doc = doc;}var { parse } = _ref;return Help.prototype.type = "Help", Help.prototype.isHelp = !0, Help.prototype.toString = function () {var doc = this.doc || {},desc = "\n";if (doc.name && (desc += "Name: " + doc.name + "\n\n"), doc.category && (desc += "Category: " + doc.category + "\n\n"), doc.description && (desc += "Description:\n    " + doc.description + "\n\n"), doc.syntax && (desc += "Syntax:\n    " + doc.syntax.join("\n    ") + "\n\n"), doc.examples) {desc += "Examples:\n";for (var expr, scope = {}, i = 0; i < doc.examples.length; i++) {expr = doc.examples[i], desc += "    " + expr + "\n";var res = void 0;try {res = parse(expr).compile().evaluate(scope);} catch (e) {res = e;}void 0 === res || isHelp(res) || (desc += "        " + string_format(res, { precision: 14 }) + "\n");}desc += "\n";}return doc.seealso && doc.seealso.length && (desc += "See also: " + doc.seealso.join(", ") + "\n"), desc;}, Help.prototype.toJSON = function () {var obj = clone(this.doc);return obj.mathjs = "Help", obj;}, Help.fromJSON = function (json) {var doc = {};return Object.keys(json).filter((prop) => "mathjs" !== prop).forEach((prop) => {doc[prop] = json[prop];}), new Help(doc);}, Help.prototype.valueOf = Help.prototype.toString, Help;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/Parser.js
var Parser_name = "Parser",Parser_dependencies = ["parse"];var createParserClass = factory("Parser", Parser_dependencies, (_ref) => {function Parser() {if (!(this instanceof Parser)) throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this, "scope", { value: createEmptyMap(), writable: !1 });}var { parse } = _ref;return Parser.prototype.type = "Parser", Parser.prototype.isParser = !0, Parser.prototype.evaluate = function (expr) {return parse(expr).compile().evaluate(this.scope);}, Parser.prototype.get = function (name) {if (this.scope.has(name)) return this.scope.get(name);}, Parser.prototype.getAll = function () {return toObject(this.scope);}, Parser.prototype.getAllAsMap = function () {return this.scope;}, Parser.prototype.set = function (name, value) {return this.scope.set(name, value), value;}, Parser.prototype.remove = function (name) {this.scope.delete(name);}, Parser.prototype.clear = function () {this.scope.clear();}, Parser;}, { isClass: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js
var bignumberDocs = { name: "bignumber", category: "Construction", syntax: ["bignumber(x)"], description: "Create a big number from a number or string.", examples: ["0.1 + 0.2", "bignumber(0.1) + bignumber(0.2)", "bignumber(\"7.2\")", "bignumber(\"7.2e500\")", "bignumber([0.1, 0.2, 0.3])"], seealso: ["boolean", "complex", "fraction", "index", "matrix", "string", "unit"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js
var typeOfDocs = { name: "typeOf", category: "Utils", syntax: ["typeOf(x)"], description: "Get the type of a variable.", examples: ["typeOf(3.5)", "typeOf(2 - 4i)", "typeOf(45 deg)", "typeOf(\"hello world\")"], seealso: ["getMatrixDataType"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js
var isZeroDocs = { name: "isZero", category: "Utils", syntax: ["isZero(x)"], description: "Test whether a value is zero.", examples: ["isZero(2)", "isZero(0)", "isZero(-4)", "isZero([3, 0, -2, 0])"], seealso: ["isInteger", "isNumeric", "isNegative", "isPositive"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js
var isPrimeDocs = { name: "isPrime", category: "Utils", syntax: ["isPrime(x)"], description: "Test whether a value is prime: has no divisors other than itself and one.", examples: ["isPrime(3)", "isPrime(-2)", "isPrime([2, 17, 100])"], seealso: ["isInteger", "isNumeric", "isNegative", "isZero"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js
var isPositiveDocs = { name: "isPositive", category: "Utils", syntax: ["isPositive(x)"], description: "Test whether a value is positive: larger than zero.", examples: ["isPositive(2)", "isPositive(0)", "isPositive(-4)", "isPositive([3, 0.5, -2])"], seealso: ["isInteger", "isNumeric", "isNegative", "isZero"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js
var isNumericDocs = { name: "isNumeric", category: "Utils", syntax: ["isNumeric(x)"], description: "Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.", examples: ["isNumeric(2)", "isNumeric(\"2\")", "hasNumericValue(\"2\")", "isNumeric(0)", "isNumeric(bignumber(500))", "isNumeric(fraction(0.125))", "isNumeric(2 + 3i)", "isNumeric([2.3, \"foo\", false])"], seealso: ["isInteger", "isZero", "isNegative", "isPositive", "isNaN", "hasNumericValue"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js
var hasNumericValueDocs = { name: "hasNumericValue", category: "Utils", syntax: ["hasNumericValue(x)"], description: "Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.", examples: ["hasNumericValue(2)", "hasNumericValue(\"2\")", "isNumeric(\"2\")", "hasNumericValue(0)", "hasNumericValue(bignumber(500))", "hasNumericValue(fraction(0.125))", "hasNumericValue(2 + 3i)", "hasNumericValue([2.3, \"foo\", false])"], seealso: ["isInteger", "isZero", "isNegative", "isPositive", "isNaN", "isNumeric"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js
var isNegativeDocs = { name: "isNegative", category: "Utils", syntax: ["isNegative(x)"], description: "Test whether a value is negative: smaller than zero.", examples: ["isNegative(2)", "isNegative(0)", "isNegative(-4)", "isNegative([3, 0.5, -2])"], seealso: ["isInteger", "isNumeric", "isPositive", "isZero"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js
var isIntegerDocs = { name: "isInteger", category: "Utils", syntax: ["isInteger(x)"], description: "Test whether a value is an integer number.", examples: ["isInteger(2)", "isInteger(3.5)", "isInteger([3, 0.5, -2])"], seealso: ["isNegative", "isNumeric", "isPositive", "isZero"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js
var isNaNDocs = { name: "isNaN", category: "Utils", syntax: ["isNaN(x)"], description: "Test whether a value is NaN (not a number)", examples: ["isNaN(2)", "isNaN(0 / 0)", "isNaN(NaN)", "isNaN(Infinity)"], seealso: ["isNegative", "isNumeric", "isPositive", "isZero"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js
var formatDocs = { name: "format", category: "Utils", syntax: ["format(value)", "format(value, precision)"], description: "Format a value of any type as string.", examples: ["format(2.3)", "format(3 - 4i)", "format([])", "format(pi, 3)"], seealso: ["print"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js
var binDocs = { name: "bin", category: "Utils", syntax: ["bin(value)"], description: "Format a number as binary", examples: ["bin(2)"], seealso: ["oct", "hex"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js
var octDocs = { name: "oct", category: "Utils", syntax: ["oct(value)"], description: "Format a number as octal", examples: ["oct(56)"], seealso: ["bin", "hex"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js
var hexDocs = { name: "hex", category: "Utils", syntax: ["hex(value)"], description: "Format a number as hexadecimal", examples: ["hex(240)"], seealso: ["bin", "oct"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js
var cloneDocs = { name: "clone", category: "Utils", syntax: ["clone(x)"], description: "Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices", examples: ["clone(3.5)", "clone(2 - 4i)", "clone(45 deg)", "clone([1, 2; 3, 4])", "clone(\"hello world\")"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js
var toDocs = { name: "to", category: "Units", syntax: ["x to unit", "to(x, unit)"], description: "Change the unit of a value.", examples: ["5 inch to cm", "3.2kg to g", "16 bytes in bits"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js
var tanhDocs = { name: "tanh", category: "Trigonometry", syntax: ["tanh(x)"], description: "Compute the hyperbolic tangent of x in radians.", examples: ["tanh(0.5)", "sinh(0.5) / cosh(0.5)"], seealso: ["sinh", "cosh"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js
var tanDocs = { name: "tan", category: "Trigonometry", syntax: ["tan(x)"], description: "Compute the tangent of x in radians.", examples: ["tan(0.5)", "sin(0.5) / cos(0.5)", "tan(pi / 4)", "tan(45 deg)"], seealso: ["atan", "sin", "cos"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js
var sinhDocs = { name: "sinh", category: "Trigonometry", syntax: ["sinh(x)"], description: "Compute the hyperbolic sine of x in radians.", examples: ["sinh(0.5)"], seealso: ["cosh", "tanh"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js
var sechDocs = { name: "sech", category: "Trigonometry", syntax: ["sech(x)"], description: "Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)", examples: ["sech(2)", "1 / cosh(2)"], seealso: ["coth", "csch", "cosh"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js
var secDocs = { name: "sec", category: "Trigonometry", syntax: ["sec(x)"], description: "Compute the secant of x in radians. Defined as 1/cos(x)", examples: ["sec(2)", "1 / cos(2)"], seealso: ["cot", "csc", "cos"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js
var cschDocs = { name: "csch", category: "Trigonometry", syntax: ["csch(x)"], description: "Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)", examples: ["csch(2)", "1 / sinh(2)"], seealso: ["sech", "coth", "sinh"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js
var cscDocs = { name: "csc", category: "Trigonometry", syntax: ["csc(x)"], description: "Compute the cosecant of x in radians. Defined as 1/sin(x)", examples: ["csc(2)", "1 / sin(2)"], seealso: ["sec", "cot", "sin"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js
var cothDocs = { name: "coth", category: "Trigonometry", syntax: ["coth(x)"], description: "Compute the hyperbolic cotangent of x in radians.", examples: ["coth(2)", "1 / tanh(2)"], seealso: ["sech", "csch", "tanh"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js
var cotDocs = { name: "cot", category: "Trigonometry", syntax: ["cot(x)"], description: "Compute the cotangent of x in radians. Defined as 1/tan(x)", examples: ["cot(2)", "1 / tan(2)"], seealso: ["sec", "csc", "tan"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js
var coshDocs = { name: "cosh", category: "Trigonometry", syntax: ["cosh(x)"], description: "Compute the hyperbolic cosine of x in radians.", examples: ["cosh(0.5)"], seealso: ["sinh", "tanh", "coth"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js
var cosDocs = { name: "cos", category: "Trigonometry", syntax: ["cos(x)"], description: "Compute the cosine of x in radians.", examples: ["cos(2)", "cos(pi / 4) ^ 2", "cos(180 deg)", "cos(60 deg)", "sin(0.2)^2 + cos(0.2)^2"], seealso: ["acos", "sin", "tan"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js
var atan2Docs = { name: "atan2", category: "Trigonometry", syntax: ["atan2(y, x)"], description: "Computes the principal value of the arc tangent of y/x in radians.", examples: ["atan2(2, 2) / pi", "angle = 60 deg in rad", "x = cos(angle)", "y = sin(angle)", "atan2(y, x)"], seealso: ["sin", "cos", "tan"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js
var atanhDocs = { name: "atanh", category: "Trigonometry", syntax: ["atanh(x)"], description: "Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.", examples: ["atanh(0.5)"], seealso: ["acosh", "asinh"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js
var atanDocs = { name: "atan", category: "Trigonometry", syntax: ["atan(x)"], description: "Compute the inverse tangent of a value in radians.", examples: ["atan(0.5)", "atan(tan(0.5))"], seealso: ["tan", "acos", "asin"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js
var asinhDocs = { name: "asinh", category: "Trigonometry", syntax: ["asinh(x)"], description: "Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.", examples: ["asinh(0.5)"], seealso: ["acosh", "atanh"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js
var asinDocs = { name: "asin", category: "Trigonometry", syntax: ["asin(x)"], description: "Compute the inverse sine of a value in radians.", examples: ["asin(0.5)", "asin(sin(0.5))"], seealso: ["sin", "acos", "atan"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js
var asechDocs = { name: "asech", category: "Trigonometry", syntax: ["asech(x)"], description: "Calculate the inverse secant of a value.", examples: ["asech(0.5)"], seealso: ["acsch", "acoth"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js
var asecDocs = { name: "asec", category: "Trigonometry", syntax: ["asec(x)"], description: "Calculate the inverse secant of a value.", examples: ["asec(0.5)", "asec(sec(0.5))", "asec(2)"], seealso: ["acos", "acot", "acsc"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js
var acschDocs = { name: "acsch", category: "Trigonometry", syntax: ["acsch(x)"], description: "Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.", examples: ["acsch(0.5)"], seealso: ["asech", "acoth"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js
var acscDocs = { name: "acsc", category: "Trigonometry", syntax: ["acsc(x)"], description: "Calculate the inverse cotangent of a value.", examples: ["acsc(2)", "acsc(csc(0.5))", "acsc(0.5)"], seealso: ["csc", "asin", "asec"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js
var acothDocs = { name: "acoth", category: "Trigonometry", syntax: ["acoth(x)"], description: "Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.", examples: ["acoth(2)", "acoth(0.5)"], seealso: ["acsch", "asech"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js
var acotDocs = { name: "acot", category: "Trigonometry", syntax: ["acot(x)"], description: "Calculate the inverse cotangent of a value.", examples: ["acot(0.5)", "acot(cot(0.5))", "acot(2)"], seealso: ["cot", "atan"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js
var acoshDocs = { name: "acosh", category: "Trigonometry", syntax: ["acosh(x)"], description: "Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.", examples: ["acosh(1.5)"], seealso: ["cosh", "asinh", "atanh"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js
var acosDocs = { name: "acos", category: "Trigonometry", syntax: ["acos(x)"], description: "Compute the inverse cosine of a value in radians.", examples: ["acos(0.5)", "acos(cos(2.3))"], seealso: ["cos", "atan", "asin"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js
var sumDocs = { name: "sum", category: "Statistics", syntax: ["sum(a, b, c, ...)", "sum(A)"], description: "Compute the sum of all values.", examples: ["sum(2, 3, 4, 1)", "sum([2, 3, 4, 1])", "sum([2, 5; 4, 3])"], seealso: ["max", "mean", "median", "min", "prod", "std", "sum", "variance"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js
var stdDocs = { name: "std", category: "Statistics", syntax: ["std(a, b, c, ...)", "std(A)", "std(A, normalization)"], description: "Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".", examples: ["std(2, 4, 6)", "std([2, 4, 6, 8])", "std([2, 4, 6, 8], \"uncorrected\")", "std([2, 4, 6, 8], \"biased\")", "std([1, 2, 3; 4, 5, 6])"], seealso: ["max", "mean", "min", "median", "prod", "sum", "variance"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js
var quantileSeqDocs = { name: "quantileSeq", category: "Statistics", syntax: ["quantileSeq(A, prob[, sorted])", "quantileSeq(A, [prob1, prob2, ...][, sorted])", "quantileSeq(A, N[, sorted])"], description: "Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.", examples: ["quantileSeq([3, -1, 5, 7], 0.5)", "quantileSeq([3, -1, 5, 7], [1/3, 2/3])", "quantileSeq([3, -1, 5, 7], 2)", "quantileSeq([-1, 3, 5, 7], 0.5, true)"], seealso: ["mean", "median", "min", "max", "prod", "std", "sum", "variance"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js
var prodDocs = { name: "prod", category: "Statistics", syntax: ["prod(a, b, c, ...)", "prod(A)"], description: "Compute the product of all values.", examples: ["prod(2, 3, 4)", "prod([2, 3, 4])", "prod([2, 5; 4, 3])"], seealso: ["max", "mean", "min", "median", "min", "std", "sum", "variance"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js
var modeDocs = { name: "mode", category: "Statistics", syntax: ["mode(a, b, c, ...)", "mode(A)", "mode(A, a, b, B, c, ...)"], description: "Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.", examples: ["mode(2, 1, 4, 3, 1)", "mode([1, 2.7, 3.2, 4, 2.7])", "mode(1, 4, 6, 1, 6)"], seealso: ["max", "mean", "min", "median", "prod", "std", "sum", "variance"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js
var minDocs = { name: "min", category: "Statistics", syntax: ["min(a, b, c, ...)", "min(A)", "min(A, dim)"], description: "Compute the minimum value of a list of values.", examples: ["min(2, 3, 4, 1)", "min([2, 3, 4, 1])", "min([2, 5; 4, 3])", "min([2, 5; 4, 3], 1)", "min([2, 5; 4, 3], 2)", "min(2.7, 7.1, -4.5, 2.0, 4.1)", "max(2.7, 7.1, -4.5, 2.0, 4.1)"], seealso: ["max", "mean", "median", "prod", "std", "sum", "variance"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js
var medianDocs = { name: "median", category: "Statistics", syntax: ["median(a, b, c, ...)", "median(A)"], description: "Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.", examples: ["median(5, 2, 7)", "median([3, -1, 5, 7])"], seealso: ["max", "mean", "min", "prod", "std", "sum", "variance", "quantileSeq"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js
var meanDocs = { name: "mean", category: "Statistics", syntax: ["mean(a, b, c, ...)", "mean(A)", "mean(A, dim)"], description: "Compute the arithmetic mean of a list of values.", examples: ["mean(2, 3, 4, 1)", "mean([2, 3, 4, 1])", "mean([2, 5; 4, 3])", "mean([2, 5; 4, 3], 1)", "mean([2, 5; 4, 3], 2)", "mean([1.0, 2.7, 3.2, 4.0])"], seealso: ["max", "median", "min", "prod", "std", "sum", "variance"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js
var maxDocs = { name: "max", category: "Statistics", syntax: ["max(a, b, c, ...)", "max(A)", "max(A, dim)"], description: "Compute the maximum value of a list of values.", examples: ["max(2, 3, 4, 1)", "max([2, 3, 4, 1])", "max([2, 5; 4, 3])", "max([2, 5; 4, 3], 1)", "max([2, 5; 4, 3], 2)", "max(2.7, 7.1, -4.5, 2.0, 4.1)", "min(2.7, 7.1, -4.5, 2.0, 4.1)"], seealso: ["mean", "median", "min", "prod", "std", "sum", "variance"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js
var madDocs = { name: "mad", category: "Statistics", syntax: ["mad(a, b, c, ...)", "mad(A)"], description: "Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.", examples: ["mad(10, 20, 30)", "mad([1, 2, 3])"], seealso: ["mean", "median", "std", "abs"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js
var erfDocs = { name: "erf", category: "Special", syntax: ["erf(x)"], description: "Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x", examples: ["erf(0.2)", "erf(-0.5)", "erf(4)"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js
var setUnionDocs = { name: "setUnion", category: "Set", syntax: ["setUnion(set1, set2)"], description: "Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setUnion([1, 2, 3, 4], [3, 4, 5, 6])", "setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"], seealso: ["setIntersect", "setDifference"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js
var setSymDifferenceDocs = { name: "setSymDifference", category: "Set", syntax: ["setSymDifference(set1, set2)"], description: "Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])", "setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"], seealso: ["setUnion", "setIntersect", "setDifference"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js
var setSizeDocs = { name: "setSize", category: "Set", syntax: ["setSize(set)", "setSize(set, unique)"], description: "Count the number of elements of a (multi)set. When the second parameter \"unique\" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.", examples: ["setSize([1, 2, 2, 4])", "setSize([1, 2, 2, 4], true)"], seealso: ["setUnion", "setIntersect", "setDifference"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js
var setPowersetDocs = { name: "setPowerset", category: "Set", syntax: ["setPowerset(set)"], description: "Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.", examples: ["setPowerset([1, 2, 3])"], seealso: ["setCartesian"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js
var setMultiplicityDocs = { name: "setMultiplicity", category: "Set", syntax: ["setMultiplicity(element, set)"], description: "Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.", examples: ["setMultiplicity(1, [1, 2, 2, 4])", "setMultiplicity(2, [1, 2, 2, 4])"], seealso: ["setDistinct", "setSize"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js
var setIsSubsetDocs = { name: "setIsSubset", category: "Set", syntax: ["setIsSubset(set1, set2)"], description: "Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setIsSubset([1, 2], [3, 4, 5, 6])", "setIsSubset([3, 4], [3, 4, 5, 6])"], seealso: ["setUnion", "setIntersect", "setDifference"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js
var setIntersectDocs = { name: "setIntersect", category: "Set", syntax: ["setIntersect(set1, set2)"], description: "Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])", "setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"], seealso: ["setUnion", "setDifference"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js
var setDistinctDocs = { name: "setDistinct", category: "Set", syntax: ["setDistinct(set)"], description: "Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.", examples: ["setDistinct([1, 1, 1, 2, 2, 3])"], seealso: ["setMultiplicity"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js
var setDifferenceDocs = { name: "setDifference", category: "Set", syntax: ["setDifference(set1, set2)"], description: "Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setDifference([1, 2, 3, 4], [3, 4, 5, 6])", "setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"], seealso: ["setUnion", "setIntersect", "setSymDifference"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js
var setCartesianDocs = { name: "setCartesian", category: "Set", syntax: ["setCartesian(set1, set2)"], description: "Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setCartesian([1, 2], [3, 4])"], seealso: ["setUnion", "setIntersect", "setDifference", "setPowerset"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js
var unequalDocs = { name: "unequal", category: "Relational", syntax: ["x != y", "unequal(x, y)"], description: "Check unequality of two values. Returns true if the values are unequal, and false if they are equal.", examples: ["2+2 != 3", "2+2 != 4", "a = 3.2", "b = 6-2.8", "a != b", "50cm != 0.5m", "5 cm != 2 inch"], seealso: ["equal", "smaller", "larger", "smallerEq", "largerEq", "compare", "deepEqual"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js
var smallerEqDocs = { name: "smallerEq", category: "Relational", syntax: ["x <= y", "smallerEq(x, y)"], description: "Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.", examples: ["2 <= 1+1", "2 < 1+1", "a = 3.2", "b = 6-2.8", "(a <= b)"], seealso: ["equal", "unequal", "larger", "smaller", "largerEq", "compare"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js
var smallerDocs = { name: "smaller", category: "Relational", syntax: ["x < y", "smaller(x, y)"], description: "Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.", examples: ["2 < 3", "5 < 2*2", "a = 3.3", "b = 6-2.8", "(a < b)", "5 cm < 2 inch"], seealso: ["equal", "unequal", "larger", "smallerEq", "largerEq", "compare"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js
var largerEqDocs = { name: "largerEq", category: "Relational", syntax: ["x >= y", "largerEq(x, y)"], description: "Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.", examples: ["2 >= 1+1", "2 > 1+1", "a = 3.2", "b = 6-2.8", "(a >= b)"], seealso: ["equal", "unequal", "smallerEq", "smaller", "compare"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js
var largerDocs = { name: "larger", category: "Relational", syntax: ["x > y", "larger(x, y)"], description: "Check if value x is larger than y. Returns true if x is larger than y, and false if not.", examples: ["2 > 3", "5 > 2*2", "a = 3.3", "b = 6-2.8", "(a > b)", "(b < a)", "5 cm > 2 inch"], seealso: ["equal", "unequal", "smaller", "smallerEq", "largerEq", "compare"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js
var equalTextDocs = { name: "equalText", category: "Relational", syntax: ["equalText(x, y)"], description: "Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.", examples: ["equalText(\"Hello\", \"Hello\")", "equalText(\"a\", \"A\")", "equal(\"2e3\", \"2000\")", "equalText(\"2e3\", \"2000\")", "equalText(\"B\", [\"A\", \"B\", \"C\"])"], seealso: ["compare", "compareNatural", "compareText", "equal"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js
var equalDocs = { name: "equal", category: "Relational", syntax: ["x == y", "equal(x, y)"], description: "Check equality of two values. Returns true if the values are equal, and false if not.", examples: ["2+2 == 3", "2+2 == 4", "a = 3.2", "b = 6-2.8", "a == b", "50cm == 0.5m"], seealso: ["unequal", "smaller", "larger", "smallerEq", "largerEq", "compare", "deepEqual", "equalText"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js
var deepEqualDocs = { name: "deepEqual", category: "Relational", syntax: ["deepEqual(x, y)"], description: "Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.", examples: ["deepEqual([1,3,4], [1,3,4])", "deepEqual([1,3,4], [1,3])"], seealso: ["equal", "unequal", "smaller", "larger", "smallerEq", "largerEq", "compare"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js
var compareTextDocs = { name: "compareText", category: "Relational", syntax: ["compareText(x, y)"], description: "Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.", examples: ["compareText(\"B\", \"A\")", "compareText(\"A\", \"B\")", "compareText(\"A\", \"A\")", "compareText(\"2\", \"10\")", "compare(\"2\", \"10\")", "compare(2, 10)", "compareNatural(\"2\", \"10\")", "compareText(\"B\", [\"A\", \"B\", \"C\"])"], seealso: ["compare", "compareNatural"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js
var compareNaturalDocs = { name: "compareNatural", category: "Relational", syntax: ["compareNatural(x, y)"], description: "Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.", examples: ["compareNatural(2, 3)", "compareNatural(3, 2)", "compareNatural(2, 2)", "compareNatural(5cm, 40mm)", "compareNatural(\"2\", \"10\")", "compareNatural(2 + 3i, 2 + 4i)", "compareNatural([1, 2, 4], [1, 2, 3])", "compareNatural([1, 5], [1, 2, 3])", "compareNatural([1, 2], [1, 2])", "compareNatural({a: 2}, {a: 4})"], seealso: ["equal", "unequal", "smaller", "smallerEq", "largerEq", "compare", "compareText"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js
var compareDocs = { name: "compare", category: "Relational", syntax: ["compare(x, y)"], description: "Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.", examples: ["compare(2, 3)", "compare(3, 2)", "compare(2, 2)", "compare(5cm, 40mm)", "compare(2, [1, 2, 3])"], seealso: ["equal", "unequal", "smaller", "smallerEq", "largerEq", "compareNatural", "compareText"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js
var randomIntDocs = { name: "randomInt", category: "Probability", syntax: ["randomInt(max)", "randomInt(min, max)", "randomInt(size)", "randomInt(size, max)", "randomInt(size, min, max)"], description: "Return a random integer number", examples: ["randomInt(10, 20)", "randomInt([2, 3], 10)"], seealso: ["pickRandom", "random"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js
var randomDocs = { name: "random", category: "Probability", syntax: ["random()", "random(max)", "random(min, max)", "random(size)", "random(size, max)", "random(size, min, max)"], description: "Return a random number.", examples: ["random()", "random(10, 20)", "random([2, 3])"], seealso: ["pickRandom", "randomInt"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js
var pickRandomDocs = { name: "pickRandom", category: "Probability", syntax: ["pickRandom(array)", "pickRandom(array, number)", "pickRandom(array, weights)", "pickRandom(array, number, weights)", "pickRandom(array, weights, number)"], description: "Pick a random entry from a given array.", examples: ["pickRandom(0:10)", "pickRandom([1, 3, 1, 6])", "pickRandom([1, 3, 1, 6], 2)", "pickRandom([1, 3, 1, 6], [2, 3, 2, 1])", "pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])", "pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"], seealso: ["random", "randomInt"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js
var permutationsDocs = { name: "permutations", category: "Probability", syntax: ["permutations(n)", "permutations(n, k)"], description: "Compute the number of permutations of n items taken k at a time", examples: ["permutations(5)", "permutations(5, 3)"], seealso: ["combinations", "combinationsWithRep", "factorial"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js
var multinomialDocs = { name: "multinomial", category: "Probability", syntax: ["multinomial(A)"], description: "Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.", examples: ["multinomial([1, 2, 1])"], seealso: ["combinations", "factorial"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js
var kldivergenceDocs = { name: "kldivergence", category: "Probability", syntax: ["kldivergence(x, y)"], description: "Calculate the Kullback-Leibler (KL) divergence  between two distributions.", examples: ["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js
var gammaDocs = { name: "gamma", category: "Probability", syntax: ["gamma(n)"], description: "Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.", examples: ["gamma(4)", "3!", "gamma(1/2)", "sqrt(pi)"], seealso: ["factorial"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js
var factorialDocs = { name: "factorial", category: "Probability", syntax: ["n!", "factorial(n)"], description: "Compute the factorial of a value", examples: ["5!", "5 * 4 * 3 * 2 * 1", "3!"], seealso: ["combinations", "combinationsWithRep", "permutations", "gamma"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js
var combinationsDocs = { name: "combinations", category: "Probability", syntax: ["combinations(n, k)"], description: "Compute the number of combinations of n items taken k at a time", examples: ["combinations(7, 5)"], seealso: ["combinationsWithRep", "permutations", "factorial"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js
var combinationsWithRepDocs = { name: "combinationsWithRep", category: "Probability", syntax: ["combinationsWithRep(n, k)"], description: "Compute the number of combinations of n items taken k at a time with replacements.", examples: ["combinationsWithRep(7, 5)"], seealso: ["combinations", "permutations", "factorial"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js
var zerosDocs = { name: "zeros", category: "Matrix", syntax: ["zeros(m)", "zeros(m, n)", "zeros(m, n, p, ...)", "zeros([m])", "zeros([m, n])", "zeros([m, n, p, ...])"], description: "Create a matrix containing zeros.", examples: ["zeros(3)", "zeros(3, 5)", "a = [1, 2, 3; 4, 5, 6]", "zeros(size(a))"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js
var transposeDocs = { name: "transpose", category: "Matrix", syntax: ["x'", "transpose(x)"], description: "Transpose a matrix", examples: ["a = [1, 2, 3; 4, 5, 6]", "a'", "transpose(a)"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js
var traceDocs = { name: "trace", category: "Matrix", syntax: ["trace(A)"], description: "Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.", examples: ["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]", "trace(A)"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js
var subsetDocs = { name: "subset", category: "Matrix", syntax: ["value(index)", "value(index) = replacement", "subset(value, [index])", "subset(value, [index], replacement)"], description: "Get or set a subset of a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.", examples: ["d = [1, 2; 3, 4]", "e = []", "e[1, 1:2] = [5, 6]", "e[2, :] = [7, 8]", "f = d * e", "f[2, 1]", "f[:, 1]"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js
var squeezeDocs = { name: "squeeze", category: "Matrix", syntax: ["squeeze(x)"], description: "Remove inner and outer singleton dimensions from a matrix.", examples: ["a = zeros(3,2,1)", "size(squeeze(a))", "b = zeros(1,1,3)", "size(squeeze(b))"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "subset", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js
var sortDocs = { name: "sort", category: "Matrix", syntax: ["sort(x)", "sort(x, compare)"], description: "Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.", examples: ["sort([5, 10, 1])", "sort([\"C\", \"B\", \"A\", \"D\"])", "sortByLength(a, b) = size(a)[1] - size(b)[1]", "sort([\"Langdon\", \"Tom\", \"Sara\"], sortByLength)", "sort([\"10\", \"1\", \"2\"], \"natural\")"], seealso: ["map", "filter", "forEach"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js
var sizeDocs = { name: "size", category: "Matrix", syntax: ["size(x)"], description: "Calculate the size of a matrix.", examples: ["size(2.3)", "size(\"hello world\")", "a = [1, 2; 3, 4; 5, 6]", "size(a)", "size(1:6)"], seealso: ["concat", "count", "det", "diag", "identity", "inv", "ones", "range", "squeeze", "subset", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js
var diffDocs = { name: "diff", category: "Matrix", syntax: ["diff(arr)", "diff(arr, dim)"], description: ["Create a new matrix or array with the difference of the passed matrix or array.", "Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference", "If no dimension parameter is passed it is assumed as dimension 0", "Dimension is zero-based in javascript and one-based in the parser", "Arrays must be 'rectangular' meaning arrays like [1, 2]", "If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"], examples: ["diff([1, 2, 4, 7, 0])", "diff([1, 2, 4, 7, 0], 0)", "diff(matrix([1, 2, 4, 7, 0]))", "diff([[1, 2], [3, 4]])", "diff([[1, 2], [3, 4]], 0)", "diff([[1, 2], [3, 4]], 1)", "diff([[1, 2], [3, 4]], bignumber(1))", "diff(matrix([[1, 2], [3, 4]]), 1)", "diff([[1, 2], matrix([3, 4])], 1)"], seealso: ["subtract", "partitionSelect"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js
var reshapeDocs = { name: "reshape", category: "Matrix", syntax: ["reshape(x, sizes)"], description: "Reshape a multi dimensional array to fit the specified dimensions.", examples: ["reshape([1, 2, 3, 4, 5, 6], [2, 3])", "reshape([[1, 2], [3, 4]], [1, 4])", "reshape([[1, 2], [3, 4]], [4])"], seealso: ["size", "squeeze", "resize"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js
var resizeDocs = { name: "resize", category: "Matrix", syntax: ["resize(x, size)", "resize(x, size, defaultValue)"], description: "Resize a matrix.", examples: ["resize([1,2,3,4,5], [3])", "resize([1,2,3], [5])", "resize([1,2,3], [5], -1)", "resize(2, [2, 3])", "resize(\"hello\", [8], \"!\")"], seealso: ["size", "subset", "squeeze", "reshape"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js
var rangeDocs = { name: "range", category: "Type", syntax: ["start:end", "start:step:end", "range(start, end)", "range(start, end, step)", "range(string)"], description: "Create a range. Lower bound of the range is included, upper bound is excluded.", examples: ["1:5", "3:-1:-3", "range(3, 7)", "range(0, 12, 2)", "range(\"4:10\")", "a = [1, 2, 3, 4; 5, 6, 7, 8]", "a[1:2, 1:2]"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js
var partitionSelectDocs = { name: "partitionSelect", category: "Matrix", syntax: ["partitionSelect(x, k)", "partitionSelect(x, k, compare)"], description: "Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.", examples: ["partitionSelect([5, 10, 1], 2)", "partitionSelect([\"C\", \"B\", \"A\", \"D\"], 1)"], seealso: ["sort"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js
var onesDocs = { name: "ones", category: "Matrix", syntax: ["ones(m)", "ones(m, n)", "ones(m, n, p, ...)", "ones([m])", "ones([m, n])", "ones([m, n, p, ...])"], description: "Create a matrix containing ones.", examples: ["ones(3)", "ones(3, 5)", "ones([2,3]) * 4.5", "a = [1, 2, 3; 4, 5, 6]", "ones(size(a))"], seealso: ["concat", "det", "diag", "identity", "inv", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js
var mapDocs = { name: "map", category: "Matrix", syntax: ["map(x, callback)"], description: "Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.", examples: ["map([1, 2, 3], square)"], seealso: ["filter", "forEach"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js
var kronDocs = { name: "kron", category: "Matrix", syntax: ["kron(x, y)"], description: "Calculates the kronecker product of 2 matrices or vectors.", examples: ["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])", "kron([1,1], [2,3,4])"], seealso: ["multiply", "dot", "cross"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js
var invDocs = { name: "inv", category: "Matrix", syntax: ["inv(x)"], description: "Calculate the inverse of a matrix", examples: ["inv([1, 2; 3, 4])", "inv(4)", "1 / 4"], seealso: ["concat", "det", "diag", "identity", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js
var forEachDocs = { name: "forEach", category: "Matrix", syntax: ["forEach(x, callback)"], description: "Iterates over all elements of a matrix/array, and executes the given callback function.", examples: ["forEach([1, 2, 3], function(val) { console.log(val) })"], seealso: ["map", "sort", "filter"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js
var flattenDocs = { name: "flatten", category: "Matrix", syntax: ["flatten(x)"], description: "Flatten a multi dimensional matrix into a single dimensional matrix.", examples: ["a = [1, 2, 3; 4, 5, 6]", "size(a)", "b = flatten(a)", "size(b)"], seealso: ["concat", "resize", "size", "squeeze"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js
var filterDocs = { name: "filter", category: "Matrix", syntax: ["filter(x, test)"], description: "Filter items in a matrix.", examples: ["isPositive(x) = x > 0", "filter([6, -2, -1, 4, 3], isPositive)", "filter([6, -2, 0, 1, 0], x != 0)"], seealso: ["sort", "map", "forEach"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js
var identityDocs = { name: "identity", category: "Matrix", syntax: ["identity(n)", "identity(m, n)", "identity([m, n])"], description: "Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.", examples: ["identity(3)", "identity(3, 5)", "a = [1, 2, 3; 4, 5, 6]", "identity(size(a))"], seealso: ["concat", "det", "diag", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js
var getMatrixDataTypeDocs = { name: "getMatrixDataType", category: "Matrix", syntax: ["getMatrixDataType(x)"], description: "Find the data type of all elements in a matrix or array, for example \"number\" if all items are a number and \"Complex\" if all values are complex numbers. If a matrix contains more than one data type, it will return \"mixed\".", examples: ["getMatrixDataType([1, 2, 3])", "getMatrixDataType([[5 cm], [2 inch]])", "getMatrixDataType([1, \"text\"])", "getMatrixDataType([1, bignumber(4)])"], seealso: ["matrix", "sparse", "typeOf"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js
var dotDocs = { name: "dot", category: "Matrix", syntax: ["dot(A, B)", "A * B"], description: "Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn", examples: ["dot([2, 4, 1], [2, 2, 3])", "[2, 4, 1] * [2, 2, 3]"], seealso: ["multiply", "cross"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js
var diagDocs = { name: "diag", category: "Matrix", syntax: ["diag(x)", "diag(x, k)"], description: "Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.", examples: ["diag(1:3)", "diag(1:3, 1)", "a = [1, 2, 3; 4, 5, 6; 7, 8, 9]", "diag(a)"], seealso: ["concat", "det", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js
var detDocs = { name: "det", category: "Matrix", syntax: ["det(x)"], description: "Calculate the determinant of a matrix", examples: ["det([1, 2; 3, 4])", "det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"], seealso: ["concat", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js
var ctransposeDocs = { name: "ctranspose", category: "Matrix", syntax: ["x'", "ctranspose(x)"], description: "Complex Conjugate and Transpose a matrix", examples: ["a = [1, 2, 3; 4, 5, 6]", "a'", "ctranspose(a)"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js
var crossDocs = { name: "cross", category: "Matrix", syntax: ["cross(A, B)"], description: "Calculate the cross product for two vectors in three dimensional space.", examples: ["cross([1, 1, 0],  [0, 1, 1])", "cross([3, -3, 1], [4, 9, 2])", "cross([2, 3, 4],  [5, 6, 7])"], seealso: ["multiply", "dot"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js
var concatDocs = { name: "concat", category: "Matrix", syntax: ["concat(A, B, C, ...)", "concat(A, B, C, ..., dim)"], description: "Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.", examples: ["A = [1, 2; 5, 6]", "B = [3, 4; 7, 8]", "concat(A, B)", "concat(A, B, 1)", "concat(A, B, 2)"], seealso: ["det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js
var countDocs = { name: "count", category: "Matrix", syntax: ["count(x)"], description: "Count the number of elements of a matrix, array or string.", examples: ["a = [1, 2; 3, 4; 5, 6]", "count(a)", "size(a)", "count(\"hello world\")"], seealso: ["size"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js
var xorDocs = { name: "xor", category: "Logical", syntax: ["x xor y", "xor(x, y)"], description: "Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.", examples: ["true xor false", "false xor false", "true xor true", "0 xor 4"], seealso: ["not", "and", "or"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js
var orDocs = { name: "or", category: "Logical", syntax: ["x or y", "or(x, y)"], description: "Logical or. Test if at least one value is defined with a nonzero/nonempty value.", examples: ["true or false", "false or false", "0 or 4"], seealso: ["not", "and", "xor"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js
var notDocs = { name: "not", category: "Logical", syntax: ["not x", "not(x)"], description: "Logical not. Flips the boolean value of given argument.", examples: ["not true", "not false", "not 2", "not 0"], seealso: ["and", "or", "xor"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js
var andDocs = { name: "and", category: "Logical", syntax: ["x and y", "and(x, y)"], description: "Logical and. Test whether two values are both defined with a nonzero/nonempty value.", examples: ["true and false", "true and true", "2 and 4"], seealso: ["not", "or", "xor"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js
var intersectDocs = { name: "intersect", category: "Geometry", syntax: ["intersect(expr1, expr2, expr3, expr4)", "intersect(expr1, expr2, expr3)"], description: "Computes the intersection point of lines and/or planes.", examples: ["intersect([0, 0], [10, 10], [10, 0], [0, 10])", "intersect([1, 0, 1],  [4, -2, 2], [1, 1, 1, 6])"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js
var distanceDocs = { name: "distance", category: "Geometry", syntax: ["distance([x1, y1], [x2, y2])", "distance([[x1, y1], [x2, y2]])"], description: "Calculates the Euclidean distance between two points.", examples: ["distance([0,0], [4,4])", "distance([[0,0], [4,4]])"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js
var helpDocs = { name: "help", category: "Expression", syntax: ["help(object)", "help(string)"], description: "Display documentation on a function or data type.", examples: ["help(sqrt)", "help(\"complex\")"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js
var evaluateDocs = { name: "evaluate", category: "Expression", syntax: ["evaluate(expression)", "evaluate([expr1, expr2, expr3, ...])"], description: "Evaluate an expression or an array with expressions.", examples: ["evaluate(\"2 + 3\")", "evaluate(\"sqrt(\" + 4 + \")\")"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js
var imDocs = { name: "im", category: "Complex", syntax: ["im(x)"], description: "Get the imaginary part of a complex number.", examples: ["im(2 + 3i)", "re(2 + 3i)", "im(-5.2i)", "im(2.4)"], seealso: ["re", "conj", "abs", "arg"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js
var reDocs = { name: "re", category: "Complex", syntax: ["re(x)"], description: "Get the real part of a complex number.", examples: ["re(2 + 3i)", "im(2 + 3i)", "re(-5.2i)", "re(2.4)"], seealso: ["im", "conj", "abs", "arg"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js
var conjDocs = { name: "conj", category: "Complex", syntax: ["conj(x)"], description: "Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.", examples: ["conj(2 + 3i)", "conj(2 - 3i)", "conj(-5.2i)"], seealso: ["re", "im", "abs", "arg"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js
var argDocs = { name: "arg", category: "Complex", syntax: ["arg(x)"], description: "Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).", examples: ["arg(2 + 2i)", "atan2(3, 2)", "arg(2 + 3i)"], seealso: ["re", "im", "conj", "abs"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js
var typedDocs = { name: "typed", category: "Core", syntax: ["typed(signatures)", "typed(name, signatures)"], description: "Create a typed function.", examples: ["double = typed({ \"number, number\": f(x)=x+x })", "double(2)", "double(\"hello\")"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js
var importDocs = { name: "import", category: "Core", syntax: ["import(functions)", "import(functions, options)"], description: "Import functions or constants from an object.", examples: ["import({myFn: f(x)=x^2, myConstant: 32 })", "myFn(2)", "myConstant"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js
var configDocs = { name: "config", category: "Core", syntax: ["config()", "config(options)"], description: "Get configuration or change configuration.", examples: ["config()", "1/3 + 1/4", "config({number: \"Fraction\"})", "1/3 + 1/4"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js
var stirlingS2Docs = { name: "stirlingS2", category: "Combinatorics", syntax: ["stirlingS2(n, k)"], description: "he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.", examples: ["stirlingS2(5, 3)"], seealso: ["bellNumbers"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js
var compositionDocs = { name: "composition", category: "Combinatorics", syntax: ["composition(n, k)"], description: "The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.", examples: ["composition(5, 3)"], seealso: ["combinations"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js
var catalanDocs = { name: "catalan", category: "Combinatorics", syntax: ["catalan(n)"], description: "The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.", examples: ["catalan(3)", "catalan(8)"], seealso: ["bellNumbers"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js
var bellNumbersDocs = { name: "bellNumbers", category: "Combinatorics", syntax: ["bellNumbers(n)"], description: "The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.", examples: ["bellNumbers(3)", "bellNumbers(8)"], seealso: ["stirlingS2"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js
var rightLogShiftDocs = { name: "rightLogShift", category: "Bitwise", syntax: ["x >>> y", "rightLogShift(x, y)"], description: "Bitwise right logical shift of a value x by y number of bits.", examples: ["8 >>> 1", "4 << 1", "-12 >>> 2"], seealso: ["bitAnd", "bitNot", "bitOr", "bitXor", "leftShift", "rightArithShift"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js
var rightArithShiftDocs = { name: "rightArithShift", category: "Bitwise", syntax: ["x >> y", "rightArithShift(x, y)"], description: "Bitwise right arithmetic shift of a value x by y number of bits.", examples: ["8 >> 1", "4 << 1", "-12 >> 2"], seealso: ["bitAnd", "bitNot", "bitOr", "bitXor", "leftShift", "rightLogShift"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js
var leftShiftDocs = { name: "leftShift", category: "Bitwise", syntax: ["x << y", "leftShift(x, y)"], description: "Bitwise left logical shift of a value x by y number of bits.", examples: ["4 << 1", "8 >> 1"], seealso: ["bitAnd", "bitNot", "bitOr", "bitXor", "rightArithShift", "rightLogShift"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js
var bitXorDocs = { name: "bitXor", category: "Bitwise", syntax: ["bitXor(x, y)"], description: "Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.", examples: ["bitOr(1, 2)", "bitXor([2, 3, 4], 4)"], seealso: ["bitAnd", "bitNot", "bitOr", "leftShift", "rightArithShift", "rightLogShift"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js
var bitOrDocs = { name: "bitOr", category: "Bitwise", syntax: ["x | y", "bitOr(x, y)"], description: "Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.", examples: ["5 | 3", "bitOr([1, 2, 3], 4)"], seealso: ["bitAnd", "bitNot", "bitXor", "leftShift", "rightArithShift", "rightLogShift"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js
var bitNotDocs = { name: "bitNot", category: "Bitwise", syntax: ["~x", "bitNot(x)"], description: "Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.", examples: ["~1", "~2", "bitNot([2, -3, 4])"], seealso: ["bitAnd", "bitOr", "bitXor", "leftShift", "rightArithShift", "rightLogShift"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js
var bitAndDocs = { name: "bitAnd", category: "Bitwise", syntax: ["x & y", "bitAnd(x, y)"], description: "Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0", examples: ["5 & 3", "bitAnd(53, 131)", "[1, 12, 31] & 42"], seealso: ["bitNot", "bitOr", "bitXor", "leftShift", "rightArithShift", "rightLogShift"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js
var xgcdDocs = { name: "xgcd", category: "Arithmetic", syntax: ["xgcd(a, b)"], description: "Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.", examples: ["xgcd(8, 12)", "gcd(8, 12)", "xgcd(36163, 21199)"], seealso: ["gcd", "lcm"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js
var unaryPlusDocs = { name: "unaryPlus", category: "Operators", syntax: ["+x", "unaryPlus(x)"], description: "Converts booleans and strings to numbers.", examples: ["+true", "+\"2\""], seealso: ["add", "subtract", "unaryMinus"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js
var unaryMinusDocs = { name: "unaryMinus", category: "Operators", syntax: ["-x", "unaryMinus(x)"], description: "Inverse the sign of a value. Converts booleans and strings to numbers.", examples: ["-4.5", "-(-5.6)", "-\"22\""], seealso: ["add", "subtract", "unaryPlus"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js
var squareDocs = { name: "square", category: "Arithmetic", syntax: ["square(x)"], description: "Compute the square of a value. The square of x is x * x.", examples: ["square(3)", "sqrt(9)", "3^2", "3 * 3"], seealso: ["multiply", "pow", "sqrt", "cube"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js
var sqrtmDocs = { name: "sqrtm", category: "Arithmetic", syntax: ["sqrtm(x)"], description: "Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.", examples: ["sqrtm([[1, 2], [3, 4]])"], seealso: ["sqrt", "abs", "square", "multiply"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js
var sqrtDocs = { name: "sqrt", category: "Arithmetic", syntax: ["sqrt(x)"], description: "Compute the square root value. If x = y * y, then y is the square root of x.", examples: ["sqrt(25)", "5 * 5", "sqrt(-1)"], seealso: ["square", "sqrtm", "multiply", "nthRoot", "nthRoots", "pow"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js
var signDocs = { name: "sign", category: "Arithmetic", syntax: ["sign(x)"], description: "Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.", examples: ["sign(3.5)", "sign(-4.2)", "sign(0)"], seealso: ["abs"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js
var roundDocs = { name: "round", category: "Arithmetic", syntax: ["round(x)", "round(x, n)"], description: "round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.", examples: ["round(3.2)", "round(3.8)", "round(-4.2)", "round(-4.8)", "round(pi, 3)", "round(123.45678, 2)"], seealso: ["ceil", "floor", "fix"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js
var powDocs = { name: "pow", category: "Operators", syntax: ["x ^ y", "pow(x, y)"], description: "Calculates the power of x to y, x^y.", examples: ["2^3", "2*2*2", "1 + e ^ (pi * i)"], seealso: ["multiply", "nthRoot", "nthRoots", "sqrt"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js
var nthRootsDocs = { name: "nthRoots", category: "Arithmetic", syntax: ["nthRoots(A)", "nthRoots(A, root)"], description: "Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation \"x^root = A\". This function returns an array of complex values.", examples: ["nthRoots(1)", "nthRoots(1, 3)"], seealso: ["sqrt", "pow", "nthRoot"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js
var nthRootDocs = { name: "nthRoot", category: "Arithmetic", syntax: ["nthRoot(a)", "nthRoot(a, root)"], description: "Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation \"x^root = A\".", examples: ["4 ^ 3", "nthRoot(64, 3)", "nthRoot(9, 2)", "sqrt(9)"], seealso: ["nthRoots", "pow", "sqrt"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js
var normDocs = { name: "norm", category: "Arithmetic", syntax: ["norm(x)", "norm(x, p)"], description: "Calculate the norm of a number, vector or matrix.", examples: ["abs(-3.5)", "norm(-3.5)", "norm(3 - 4i)", "norm([1, 2, -3], Infinity)", "norm([1, 2, -3], -Infinity)", "norm([3, 4], 2)", "norm([[1, 2], [3, 4]], 1)", "norm([[1, 2], [3, 4]], \"inf\")", "norm([[1, 2], [3, 4]], \"fro\")"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js
var multiplyDocs = { name: "multiply", category: "Operators", syntax: ["x * y", "multiply(x, y)"], description: "multiply two values.", examples: ["a = 2.1 * 3.4", "a / 3.4", "2 * 3 + 4", "2 * (3 + 4)", "3 * 2.1 km"], seealso: ["divide"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js
var modDocs = { name: "mod", category: "Operators", syntax: ["x % y", "x mod y", "mod(x, y)"], description: "Calculates the modulus, the remainder of an integer division.", examples: ["7 % 3", "11 % 2", "10 mod 4", "isOdd(x) = x % 2", "isOdd(2)", "isOdd(3)"], seealso: ["divide"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js
var log10Docs = { name: "log10", category: "Arithmetic", syntax: ["log10(x)"], description: "Compute the 10-base logarithm of a value.", examples: ["log10(0.00001)", "log10(10000)", "10 ^ 4", "log(10000) / log(10)", "log(10000, 10)"], seealso: ["exp", "log"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js
var log1pDocs = { name: "log1p", category: "Arithmetic", syntax: ["log1p(x)", "log1p(x, base)"], description: "Calculate the logarithm of a `value+1`", examples: ["log1p(2.5)", "exp(log1p(1.4))", "pow(10, 4)", "log1p(9999, 10)", "log1p(9999) / log(10)"], seealso: ["exp", "log", "log2", "log10"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js
var log2Docs = { name: "log2", category: "Arithmetic", syntax: ["log2(x)"], description: "Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.", examples: ["log2(0.03125)", "log2(16)", "log2(16) / log2(2)", "pow(2, 4)"], seealso: ["exp", "log1p", "log", "log10"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js
var logDocs = { name: "log", category: "Arithmetic", syntax: ["log(x)", "log(x, base)"], description: "Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).", examples: ["log(3.5)", "a = log(2.4)", "exp(a)", "10 ^ 4", "log(10000, 10)", "log(10000) / log(10)", "b = log(1024, 2)", "2 ^ b"], seealso: ["exp", "log1p", "log2", "log10"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js
var lcmDocs = { name: "lcm", category: "Arithmetic", syntax: ["lcm(x, y)"], description: "Compute the least common multiple.", examples: ["lcm(4, 6)", "lcm(6, 21)", "lcm(6, 21, 5)"], seealso: ["gcd"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js
var hypotDocs = { name: "hypot", category: "Arithmetic", syntax: ["hypot(a, b, c, ...)", "hypot([a, b, c, ...])"], description: "Calculate the hypotenusa of a list with values. ", examples: ["hypot(3, 4)", "sqrt(3^2 + 4^2)", "hypot(-2)", "hypot([3, 4, 5])"], seealso: ["abs", "norm"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js
var gcdDocs = { name: "gcd", category: "Arithmetic", syntax: ["gcd(a, b)", "gcd(a, b, c, ...)"], description: "Compute the greatest common divisor.", examples: ["gcd(8, 12)", "gcd(-4, 6)", "gcd(25, 15, -10)"], seealso: ["lcm", "xgcd"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js
var floorDocs = { name: "floor", category: "Arithmetic", syntax: ["floor(x)"], description: "Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.", examples: ["floor(3.2)", "floor(3.8)", "floor(-4.2)"], seealso: ["ceil", "fix", "round"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js
var fixDocs = { name: "fix", category: "Arithmetic", syntax: ["fix(x)"], description: "Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.", examples: ["fix(3.2)", "fix(3.8)", "fix(-4.2)", "fix(-4.8)"], seealso: ["ceil", "floor", "round"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js
var expm1Docs = { name: "expm1", category: "Arithmetic", syntax: ["expm1(x)"], description: "Calculate the value of subtracting 1 from the exponential value.", examples: ["expm1(2)", "pow(e, 2) - 1", "log(expm1(2) + 1)"], seealso: ["exp", "pow", "log"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js
var expmDocs = { name: "expm", category: "Arithmetic", syntax: ["exp(x)"], description: "Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.", examples: ["expm([[0,2],[0,0]])"], seealso: ["exp"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js
var eigsDocs = { name: "eigs", category: "Matrix", syntax: ["eigs(x)"], description: "Calculate the eigenvalues and eigenvectors of a real symmetric matrix", examples: ["eigs([[5, 2.3], [2.3, 1]])"], seealso: ["inv"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js
var expDocs = { name: "exp", category: "Arithmetic", syntax: ["exp(x)"], description: "Calculate the exponent of a value.", examples: ["exp(1.3)", "e ^ 1.3", "log(exp(1.3))", "x = 2.4", "(exp(i*x) == cos(x) + i*sin(x))   # Euler's formula"], seealso: ["expm", "expm1", "pow", "log"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js
var dotMultiplyDocs = { name: "dotMultiply", category: "Operators", syntax: ["x .* y", "dotMultiply(x, y)"], description: "Multiply two values element wise.", examples: ["a = [1, 2, 3; 4, 5, 6]", "b = [2, 1, 1; 3, 2, 5]", "a .* b"], seealso: ["multiply", "divide", "dotDivide"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js
var dotDivideDocs = { name: "dotDivide", category: "Operators", syntax: ["x ./ y", "dotDivide(x, y)"], description: "Divide two values element wise.", examples: ["a = [1, 2, 3; 4, 5, 6]", "b = [2, 1, 1; 3, 2, 5]", "a ./ b"], seealso: ["multiply", "dotMultiply", "divide"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js
var divideDocs = { name: "divide", category: "Operators", syntax: ["x / y", "divide(x, y)"], description: "Divide two values.", examples: ["a = 2 / 3", "a * 3", "4.5 / 2", "3 + 4 / 2", "(3 + 4) / 2", "18 km / 4.5"], seealso: ["multiply"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js
var cubeDocs = { name: "cube", category: "Arithmetic", syntax: ["cube(x)"], description: "Compute the cube of a value. The cube of x is x * x * x.", examples: ["cube(2)", "2^3", "2 * 2 * 2"], seealso: ["multiply", "square", "pow"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js
var ceilDocs = { name: "ceil", category: "Arithmetic", syntax: ["ceil(x)"], description: "Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.", examples: ["ceil(3.2)", "ceil(3.8)", "ceil(-4.2)"], seealso: ["floor", "fix", "round"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js
var cbrtDocs = { name: "cbrt", category: "Arithmetic", syntax: ["cbrt(x)", "cbrt(x, allRoots)"], description: "Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned", examples: ["cbrt(64)", "cube(4)", "cbrt(-8)", "cbrt(2 + 3i)", "cbrt(8i)", "cbrt(8i, true)", "cbrt(27 m^3)"], seealso: ["square", "sqrt", "cube", "multiply"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js
var addDocs = { name: "add", category: "Operators", syntax: ["x + y", "add(x, y)"], description: "Add two values.", examples: ["a = 2.1 + 3.6", "a - 3.6", "3 + 2i", "3 cm + 2 inch", "\"2.3\" + \"4\""], seealso: ["subtract"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js
var absDocs = { name: "abs", category: "Arithmetic", syntax: ["abs(x)"], description: "Compute the absolute value.", examples: ["abs(3.5)", "abs(-4.2)"], seealso: ["sign"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js
var qrDocs = { name: "qr", category: "Algebra", syntax: ["qr(A)"], description: "Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.", examples: ["qr([[1, -1,  4], [1,  4, -2], [1,  4,  2], [1,  -1, 0]])"], seealso: ["lup", "slu", "matrix"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js
var usolveDocs = { name: "usolve", category: "Algebra", syntax: ["x=usolve(U, b)"], description: "Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.", examples: ["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"], seealso: ["usolveAll", "lup", "lusolve", "lsolve", "matrix", "sparse"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js
var usolveAllDocs = { name: "usolveAll", category: "Algebra", syntax: ["x=usolve(U, b)"], description: "Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.", examples: ["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"], seealso: ["usolve", "lup", "lusolve", "lsolve", "matrix", "sparse"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js
var sluDocs = { name: "slu", category: "Algebra", syntax: ["slu(A, order, threshold)"], description: "Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U", examples: ["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"], seealso: ["lusolve", "lsolve", "usolve", "matrix", "sparse", "lup", "qr"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js
var rationalizeDocs = { name: "rationalize", category: "Algebra", syntax: ["rationalize(expr)", "rationalize(expr, scope)", "rationalize(expr, scope, detailed)"], description: "Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.", examples: ["rationalize(\"2x/y - y/(x+1)\")", "rationalize(\"2x/y - y/(x+1)\", true)"], seealso: ["simplify"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js
var simplifyDocs = { name: "simplify", category: "Algebra", syntax: ["simplify(expr)", "simplify(expr, rules)"], description: "Simplify an expression tree.", examples: ["simplify(\"3 + 2 / 4\")", "simplify(\"2x + x\")", "f = parse(\"x * (x + 2 + x)\")", "simplified = simplify(f)", "simplified.evaluate({x: 2})"], seealso: ["derivative", "parse", "evaluate"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js
var lupDocs = { name: "lup", category: "Algebra", syntax: ["lup(m)"], description: "Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U", examples: ["lup([[2, 1], [1, 4]])", "lup(matrix([[2, 1], [1, 4]]))", "lup(sparse([[2, 1], [1, 4]]))"], seealso: ["lusolve", "lsolve", "usolve", "matrix", "sparse", "slu", "qr"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js
var lsolveDocs = { name: "lsolve", category: "Algebra", syntax: ["x=lsolve(L, b)"], description: "Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.", examples: ["a = [-2, 3; 2, 1]", "b = [11, 9]", "x = lsolve(a, b)"], seealso: ["lsolveAll", "lup", "lusolve", "usolve", "matrix", "sparse"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js
var lsolveAllDocs = { name: "lsolveAll", category: "Algebra", syntax: ["x=lsolveAll(L, b)"], description: "Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.", examples: ["a = [-2, 3; 2, 1]", "b = [11, 9]", "x = lsolve(a, b)"], seealso: ["lsolve", "lup", "lusolve", "usolve", "matrix", "sparse"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js
var derivativeDocs = { name: "derivative", category: "Algebra", syntax: ["derivative(expr, variable)", "derivative(expr, variable, {simplify: boolean})"], description: "Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.", examples: ["derivative(\"2x^3\", \"x\")", "derivative(\"2x^3\", \"x\", {simplify: false})", "derivative(\"2x^2 + 3x + 4\", \"x\")", "derivative(\"sin(2x)\", \"x\")", "f = parse(\"x^2 + x\")", "x = parse(\"x\")", "df = derivative(f, x)", "df.evaluate({x: 3})"], seealso: ["simplify", "parse", "evaluate"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js
var versionDocs = { name: "version", category: "Constants", syntax: ["version"], description: "A string with the version number of math.js", examples: ["version"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js
var trueDocs = { name: "true", category: "Constants", syntax: ["true"], description: "Boolean value true", examples: ["true"], seealso: ["false"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js
var tauDocs = { name: "tau", category: "Constants", syntax: ["tau"], description: "Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.", examples: ["tau", "2 * pi"], seealso: ["pi"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js
var SQRT2Docs = { name: "SQRT2", category: "Constants", syntax: ["SQRT2"], description: "Returns the square root of 2, approximately equal to 1.414", examples: ["SQRT2", "sqrt(2)"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js
var SQRT12Docs = { name: "SQRT1_2", category: "Constants", syntax: ["SQRT1_2"], description: "Returns the square root of 1/2, approximately equal to 0.707", examples: ["SQRT1_2", "sqrt(1/2)"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js
var phiDocs = { name: "phi", category: "Constants", syntax: ["phi"], description: "Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...", examples: ["phi"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js
var piDocs = { name: "pi", category: "Constants", syntax: ["pi"], description: "The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159", examples: ["pi", "sin(pi/2)"], seealso: ["tau"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js
var nullDocs = { name: "null", category: "Constants", syntax: ["null"], description: "Value null", examples: ["null"], seealso: ["true", "false"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js
var NaNDocs = { name: "NaN", category: "Constants", syntax: ["NaN"], description: "Not a number", examples: ["NaN", "0 / 0"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js
var LOG10EDocs = { name: "LOG10E", category: "Constants", syntax: ["LOG10E"], description: "Returns the base-10 logarithm of E, approximately equal to 0.434", examples: ["LOG10E", "log(e, 10)"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js
var LOG2EDocs = { name: "LOG2E", category: "Constants", syntax: ["LOG2E"], description: "Returns the base-2 logarithm of E, approximately equal to 1.442", examples: ["LOG2E", "log(e, 2)"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js
var LN10Docs = { name: "LN10", category: "Constants", syntax: ["LN10"], description: "Returns the natural logarithm of 10, approximately equal to 2.302", examples: ["LN10", "log(10)"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js
var LN2Docs = { name: "LN2", category: "Constants", syntax: ["LN2"], description: "Returns the natural logarithm of 2, approximately equal to 0.693", examples: ["LN2", "log(2)"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js
var InfinityDocs = { name: "Infinity", category: "Constants", syntax: ["Infinity"], description: "Infinity, a number which is larger than the maximum number that can be handled by a floating point number.", examples: ["Infinity", "1 / 0"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js
var iDocs = { name: "i", category: "Constants", syntax: ["i"], description: "Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.", examples: ["i", "i * i", "sqrt(-1)"], seealso: [] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js
var falseDocs = { name: "false", category: "Constants", syntax: ["false"], description: "Boolean value false", examples: ["false"], seealso: ["true"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js
var eDocs = { name: "e", category: "Constants", syntax: ["e"], description: "Euler's number, the base of the natural logarithm. Approximately equal to 2.71828", examples: ["e", "e ^ 2", "exp(2)", "log(e)"], seealso: ["exp"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js
var unitDocs = { name: "unit", category: "Construction", syntax: ["value unit", "unit(value, unit)", "unit(string)"], description: "Create a unit.", examples: ["5.5 mm", "3 inch", "unit(7.1, \"kilogram\")", "unit(\"23 deg\")"], seealso: ["bignumber", "boolean", "complex", "index", "matrix", "number", "string"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js
var stringDocs = { name: "string", category: "Construction", syntax: ["\"text\"", "string(x)"], description: "Create a string or convert a value to a string", examples: ["\"Hello World!\"", "string(4.2)", "string(3 + 2i)"], seealso: ["bignumber", "boolean", "complex", "index", "matrix", "number", "unit"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js
var splitUnitDocs = { name: "splitUnit", category: "Construction", syntax: ["splitUnit(unit: Unit, parts: Unit[])"], description: "Split a unit in an array of units whose sum is equal to the original unit.", examples: ["splitUnit(1 m, [\"feet\", \"inch\"])"], seealso: ["unit", "createUnit"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js
var sparseDocs = { name: "sparse", category: "Construction", syntax: ["sparse()", "sparse([a1, b1, ...; a1, b2, ...])", "sparse([a1, b1, ...; a1, b2, ...], \"number\")"], description: "Create a sparse matrix.", examples: ["sparse()", "sparse([3, 4; 5, 6])", "sparse([3, 0; 5, 0], \"number\")"], seealso: ["bignumber", "boolean", "complex", "index", "number", "string", "unit", "matrix"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js
var numberDocs = { name: "number", category: "Construction", syntax: ["x", "number(x)", "number(unit, valuelessUnit)"], description: "Create a number or convert a string or boolean into a number.", examples: ["2", "2e3", "4.05", "number(2)", "number(\"7.2\")", "number(true)", "number([true, false, true, true])", "number(unit(\"52cm\"), \"m\")"], seealso: ["bignumber", "boolean", "complex", "fraction", "index", "matrix", "string", "unit"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js
var matrixDocs = { name: "matrix", category: "Construction", syntax: ["[]", "[a1, b1, ...; a2, b2, ...]", "matrix()", "matrix(\"dense\")", "matrix([...])"], description: "Create a matrix.", examples: ["[]", "[1, 2, 3]", "[1, 2, 3; 4, 5, 6]", "matrix()", "matrix([3, 4])", "matrix([3, 4; 5, 6], \"sparse\")", "matrix([3, 4; 5, 6], \"sparse\", \"number\")"], seealso: ["bignumber", "boolean", "complex", "index", "number", "string", "unit", "sparse"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js
var matrixFromFunctionDocs = { name: "matrixFromFunction", category: "Matrix", syntax: ["math.matrixFromFunction(size, fn)", "math.matrixFromFunction(size, fn, format)", "math.matrixFromFunction(size, fn, format, datatype)", "math.matrixFromFunction(size, format, fn)", "math.matrixFromFunction(size, format, datatype, fn)"], description: "Create a matrix by evaluating a generating function at each index.", examples: ["f(I) = I[1] - I[2]", "matrixFromFunction([3,3], f)", "g(I) = I[1] - I[2] == 1 ? 4 : 0", "matrixFromFunction([100, 100], \"sparse\", g)", "matrixFromFunction([5], random)"], seealso: ["matrix", "matrixFromRows", "matrixFromColumns", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js
var matrixFromRowsDocs = { name: "matrixFromRows", category: "Matrix", syntax: ["math.matrixFromRows(...arr)", "math.matrixFromRows(row1, row2)", "math.matrixFromRows(row1, row2, row3)"], description: "Create a dense matrix from vectors as individual rows.", examples: ["matrixFromRows([1, 2, 3], [[4],[5],[6]])"], seealso: ["matrix", "matrixFromColumns", "matrixFromFunction", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js
var matrixFromColumnsDocs = { name: "matrixFromColumns", category: "Matrix", syntax: ["math.matrixFromColumns(...arr)", "math.matrixFromColumns(row1, row2)", "math.matrixFromColumns(row1, row2, row3)"], description: "Create a dense matrix from vectors as individual columns.", examples: ["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"], seealso: ["matrix", "matrixFromRows", "matrixFromFunction", "zeros"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js
var indexDocs = { name: "index", category: "Construction", syntax: ["[start]", "[start:end]", "[start:step:end]", "[start1, start 2, ...]", "[start1:end1, start2:end2, ...]", "[start1:step1:end1, start2:step2:end2, ...]"], description: "Create an index to get or replace a subset of a matrix", examples: ["[]", "[1, 2, 3]", "A = [1, 2, 3; 4, 5, 6]", "A[1, :]", "A[1, 2] = 50", "A[0:2, 0:2] = ones(2, 2)"], seealso: ["bignumber", "boolean", "complex", "matrix,", "number", "range", "string", "unit"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js
var fractionDocs = { name: "fraction", category: "Construction", syntax: ["fraction(num)", "fraction(num,den)"], description: "Create a fraction from a number or from a numerator and denominator.", examples: ["fraction(0.125)", "fraction(1, 3) + fraction(2, 5)"], seealso: ["bignumber", "boolean", "complex", "index", "matrix", "string", "unit"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js
var createUnitDocs = { name: "createUnit", category: "Construction", syntax: ["createUnit(definitions)", "createUnit(name, definition)"], description: "Create a user-defined unit and register it with the Unit type.", examples: ["createUnit(\"foo\")", "createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})", "createUnit(\"mph\", \"1 mile/hour\")"], seealso: ["unit", "splitUnit"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js
var complexDocs = { name: "complex", category: "Construction", syntax: ["complex()", "complex(re, im)", "complex(string)"], description: "Create a complex number.", examples: ["complex()", "complex(2, 3)", "complex(\"7 - 2i\")"], seealso: ["bignumber", "boolean", "index", "matrix", "number", "string", "unit"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js
var booleanDocs = { name: "boolean", category: "Construction", syntax: ["x", "boolean(x)"], description: "Convert a string or number into a boolean.", examples: ["boolean(0)", "boolean(1)", "boolean(3)", "boolean(\"true\")", "boolean(\"false\")", "boolean([1, 0, 1, 1])"], seealso: ["bignumber", "complex", "index", "matrix", "number", "string", "unit"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js
var dotPowDocs = { name: "dotPow", category: "Operators", syntax: ["x .^ y", "dotPow(x, y)"], description: "Calculates the power of x to y element wise.", examples: ["a = [1, 2, 3; 4, 5, 6]", "a .^ 2"], seealso: ["pow"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js
var lusolveDocs = { name: "lusolve", category: "Algebra", syntax: ["x=lusolve(A, b)", "x=lusolve(lu, b)"], description: "Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.", examples: ["a = [-2, 3; 2, 1]", "b = [11, 9]", "x = lusolve(a, b)"], seealso: ["lup", "slu", "lsolve", "usolve", "matrix", "sparse"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js
var subtractDocs = { name: "subtract", category: "Operators", syntax: ["x - y", "subtract(x, y)"], description: "subtract two values.", examples: ["a = 5.3 - 2", "a + 2", "2/3 - 1/6", "2 * 3 - 3", "2.1 km - 500m"], seealso: ["add"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js
var varianceDocs = { name: "variance", category: "Statistics", syntax: ["variance(a, b, c, ...)", "variance(A)", "variance(A, normalization)"], description: "Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".", examples: ["variance(2, 4, 6)", "variance([2, 4, 6, 8])", "variance([2, 4, 6, 8], \"uncorrected\")", "variance([2, 4, 6, 8], \"biased\")", "variance([1, 2, 3; 4, 5, 6])"], seealso: ["max", "mean", "min", "median", "min", "prod", "std", "sum"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js
var sinDocs = { name: "sin", category: "Trigonometry", syntax: ["sin(x)"], description: "Compute the sine of x in radians.", examples: ["sin(2)", "sin(pi / 4) ^ 2", "sin(90 deg)", "sin(30 deg)", "sin(0.2)^2 + cos(0.2)^2"], seealso: ["asin", "cos", "tan"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js
var numericDocs = { name: "numeric", category: "Utils", syntax: ["numeric(x)"], description: "Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.", examples: ["numeric(\"4\")", "numeric(\"4\", \"number\")", "numeric(\"4\", \"BigNumber\")", "numeric(\"4\", \"Fraction)", "numeric(4, \"Fraction\")", "numeric(fraction(2, 5), \"number)"], seealso: ["number", "fraction", "bignumber", "string", "format"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js
var columnDocs = { name: "column", category: "Matrix", syntax: ["column(x, index)"], description: "Return a column from a matrix or array.", examples: ["A = [[1, 2], [3, 4]]", "column(A, 1)", "column(A, 2)"], seealso: ["row", "matrixFromColumns"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js
var rowDocs = { name: "row", category: "Matrix", syntax: ["row(x, index)"], description: "Return a row from a matrix or array.", examples: ["A = [[1, 2], [3, 4]]", "row(A, 1)", "row(A, 2)"], seealso: ["column", "matrixFromRows"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js
var rotationMatrixDocs = { name: "rotationMatrix", category: "Matrix", syntax: ["rotationMatrix(theta)", "rotationMatrix(theta, v)", "rotationMatrix(theta, v, format)"], description: "Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.", examples: ["rotationMatrix(pi / 2)", "rotationMatrix(unit(\"45deg\"), [0, 0, 1])", "rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")"], seealso: ["cos", "sin"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js
var rotateDocs = { name: "rotate", category: "Matrix", syntax: ["rotate(w, theta)", "rotate(w, theta, v)"], description: "Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.", examples: ["rotate([1, 0], math.pi / 2)", "rotate(matrix([1, 0]), unit(\"35deg\"))", "rotate([1, 0, 0], unit(\"90deg\"), [0, 0, 1])", "rotate(matrix([1, 0, 0]), unit(\"90deg\"), matrix([0, 0, 1]))"], seealso: ["matrix", "rotationMatrix"] };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js
var embeddedDocs = { bignumber: bignumberDocs, boolean: booleanDocs, complex: complexDocs, createUnit: createUnitDocs, fraction: fractionDocs, index: indexDocs, matrix: matrixDocs, number: numberDocs, sparse: sparseDocs, splitUnit: splitUnitDocs, string: stringDocs, unit: unitDocs, e: eDocs, E: eDocs, false: falseDocs, i: iDocs, Infinity: InfinityDocs, LN2: LN2Docs, LN10: LN10Docs, LOG2E: LOG2EDocs, LOG10E: LOG10EDocs, NaN: NaNDocs, null: nullDocs, pi: piDocs, PI: piDocs, phi: phiDocs, SQRT1_2: SQRT12Docs, SQRT2: SQRT2Docs, tau: tauDocs, true: trueDocs, version: versionDocs, speedOfLight: { description: "Speed of light in vacuum", examples: ["speedOfLight"] }, gravitationConstant: { description: "Newtonian constant of gravitation", examples: ["gravitationConstant"] }, planckConstant: { description: "Planck constant", examples: ["planckConstant"] }, reducedPlanckConstant: { description: "Reduced Planck constant", examples: ["reducedPlanckConstant"] }, magneticConstant: { description: "Magnetic constant (vacuum permeability)", examples: ["magneticConstant"] }, electricConstant: { description: "Electric constant (vacuum permeability)", examples: ["electricConstant"] }, vacuumImpedance: { description: "Characteristic impedance of vacuum", examples: ["vacuumImpedance"] }, coulomb: { description: "Coulomb's constant", examples: ["coulomb"] }, elementaryCharge: { description: "Elementary charge", examples: ["elementaryCharge"] }, bohrMagneton: { description: "Borh magneton", examples: ["bohrMagneton"] }, conductanceQuantum: { description: "Conductance quantum", examples: ["conductanceQuantum"] }, inverseConductanceQuantum: { description: "Inverse conductance quantum", examples: ["inverseConductanceQuantum"] }, magneticFluxQuantum: { description: "Magnetic flux quantum", examples: ["magneticFluxQuantum"] }, nuclearMagneton: { description: "Nuclear magneton", examples: ["nuclearMagneton"] }, klitzing: { description: "Von Klitzing constant", examples: ["klitzing"] }, bohrRadius: { description: "Borh radius", examples: ["bohrRadius"] }, classicalElectronRadius: { description: "Classical electron radius", examples: ["classicalElectronRadius"] }, electronMass: { description: "Electron mass", examples: ["electronMass"] }, fermiCoupling: { description: "Fermi coupling constant", examples: ["fermiCoupling"] }, fineStructure: { description: "Fine-structure constant", examples: ["fineStructure"] }, hartreeEnergy: { description: "Hartree energy", examples: ["hartreeEnergy"] }, protonMass: { description: "Proton mass", examples: ["protonMass"] }, deuteronMass: { description: "Deuteron Mass", examples: ["deuteronMass"] }, neutronMass: { description: "Neutron mass", examples: ["neutronMass"] }, quantumOfCirculation: { description: "Quantum of circulation", examples: ["quantumOfCirculation"] }, rydberg: { description: "Rydberg constant", examples: ["rydberg"] }, thomsonCrossSection: { description: "Thomson cross section", examples: ["thomsonCrossSection"] }, weakMixingAngle: { description: "Weak mixing angle", examples: ["weakMixingAngle"] }, efimovFactor: { description: "Efimov factor", examples: ["efimovFactor"] }, atomicMass: { description: "Atomic mass constant", examples: ["atomicMass"] }, avogadro: { description: "Avogadro's number", examples: ["avogadro"] }, boltzmann: { description: "Boltzmann constant", examples: ["boltzmann"] }, faraday: { description: "Faraday constant", examples: ["faraday"] }, firstRadiation: { description: "First radiation constant", examples: ["firstRadiation"] }, loschmidt: { description: "Loschmidt constant at T=273.15 K and p=101.325 kPa", examples: ["loschmidt"] }, gasConstant: { description: "Gas constant", examples: ["gasConstant"] }, molarPlanckConstant: { description: "Molar Planck constant", examples: ["molarPlanckConstant"] }, molarVolume: { description: "Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa", examples: ["molarVolume"] }, sackurTetrode: { description: "Sackur-Tetrode constant at T=1 K and p=101.325 kPa", examples: ["sackurTetrode"] }, secondRadiation: { description: "Second radiation constant", examples: ["secondRadiation"] }, stefanBoltzmann: { description: "Stefan-Boltzmann constant", examples: ["stefanBoltzmann"] }, wienDisplacement: { description: "Wien displacement law constant", examples: ["wienDisplacement"] }, molarMass: { description: "Molar mass constant", examples: ["molarMass"] }, molarMassC12: { description: "Molar mass constant of carbon-12", examples: ["molarMassC12"] }, gravity: { description: "Standard acceleration of gravity (standard acceleration of free-fall on Earth)", examples: ["gravity"] }, planckLength: { description: "Planck length", examples: ["planckLength"] }, planckMass: { description: "Planck mass", examples: ["planckMass"] }, planckTime: { description: "Planck time", examples: ["planckTime"] }, planckCharge: { description: "Planck charge", examples: ["planckCharge"] }, planckTemperature: { description: "Planck temperature", examples: ["planckTemperature"] }, derivative: derivativeDocs, lsolve: lsolveDocs, lsolveAll: lsolveAllDocs, lup: lupDocs, lusolve: lusolveDocs, simplify: simplifyDocs, rationalize: rationalizeDocs, slu: sluDocs, usolve: usolveDocs, usolveAll: usolveAllDocs, qr: qrDocs, abs: absDocs, add: addDocs, cbrt: cbrtDocs, ceil: ceilDocs, cube: cubeDocs, divide: divideDocs, dotDivide: dotDivideDocs, dotMultiply: dotMultiplyDocs, dotPow: dotPowDocs, exp: expDocs, expm: expmDocs, expm1: expm1Docs, fix: fixDocs, floor: floorDocs, gcd: gcdDocs, hypot: hypotDocs, lcm: lcmDocs, log: logDocs, log2: log2Docs, log1p: log1pDocs, log10: log10Docs, mod: modDocs, multiply: multiplyDocs, norm: normDocs, nthRoot: nthRootDocs, nthRoots: nthRootsDocs, pow: powDocs, round: roundDocs, sign: signDocs, sqrt: sqrtDocs, sqrtm: sqrtmDocs, square: squareDocs, subtract: subtractDocs, unaryMinus: unaryMinusDocs, unaryPlus: unaryPlusDocs, xgcd: xgcdDocs, bitAnd: bitAndDocs, bitNot: bitNotDocs, bitOr: bitOrDocs, bitXor: bitXorDocs, leftShift: leftShiftDocs, rightArithShift: rightArithShiftDocs, rightLogShift: rightLogShiftDocs, bellNumbers: bellNumbersDocs, catalan: catalanDocs, composition: compositionDocs, stirlingS2: stirlingS2Docs, config: configDocs, import: importDocs, typed: typedDocs, arg: argDocs, conj: conjDocs, re: reDocs, im: imDocs, evaluate: evaluateDocs, help: helpDocs, distance: distanceDocs, intersect: intersectDocs, and: andDocs, not: notDocs, or: orDocs, xor: xorDocs, concat: concatDocs, count: countDocs, cross: crossDocs, column: columnDocs, ctranspose: ctransposeDocs, det: detDocs, diag: diagDocs, diff: diffDocs, dot: dotDocs, getMatrixDataType: getMatrixDataTypeDocs, identity: identityDocs, filter: filterDocs, flatten: flattenDocs, forEach: forEachDocs, inv: invDocs, eigs: eigsDocs, kron: kronDocs, matrixFromFunction: matrixFromFunctionDocs, matrixFromRows: matrixFromRowsDocs, matrixFromColumns: matrixFromColumnsDocs, map: mapDocs, ones: onesDocs, partitionSelect: partitionSelectDocs, range: rangeDocs, resize: resizeDocs, reshape: reshapeDocs, rotate: rotateDocs, rotationMatrix: rotationMatrixDocs, row: rowDocs, size: sizeDocs, sort: sortDocs, squeeze: squeezeDocs, subset: subsetDocs, trace: traceDocs, transpose: transposeDocs, zeros: zerosDocs, combinations: combinationsDocs, combinationsWithRep: combinationsWithRepDocs, factorial: factorialDocs, gamma: gammaDocs, kldivergence: kldivergenceDocs, multinomial: multinomialDocs, permutations: permutationsDocs, pickRandom: pickRandomDocs, random: randomDocs, randomInt: randomIntDocs, compare: compareDocs, compareNatural: compareNaturalDocs, compareText: compareTextDocs, deepEqual: deepEqualDocs, equal: equalDocs, equalText: equalTextDocs, larger: largerDocs, largerEq: largerEqDocs, smaller: smallerDocs, smallerEq: smallerEqDocs, unequal: unequalDocs, setCartesian: setCartesianDocs, setDifference: setDifferenceDocs, setDistinct: setDistinctDocs, setIntersect: setIntersectDocs, setIsSubset: setIsSubsetDocs, setMultiplicity: setMultiplicityDocs, setPowerset: setPowersetDocs, setSize: setSizeDocs, setSymDifference: setSymDifferenceDocs, setUnion: setUnionDocs, erf: erfDocs, mad: madDocs, max: maxDocs, mean: meanDocs, median: medianDocs, min: minDocs, mode: modeDocs, prod: prodDocs, quantileSeq: quantileSeqDocs, std: stdDocs, sum: sumDocs, variance: varianceDocs, acos: acosDocs, acosh: acoshDocs, acot: acotDocs, acoth: acothDocs, acsc: acscDocs, acsch: acschDocs, asec: asecDocs, asech: asechDocs, asin: asinDocs, asinh: asinhDocs, atan: atanDocs, atanh: atanhDocs, atan2: atan2Docs, cos: cosDocs, cosh: coshDocs, cot: cotDocs, coth: cothDocs, csc: cscDocs, csch: cschDocs, sec: secDocs, sech: sechDocs, sin: sinDocs, sinh: sinhDocs, tan: tanDocs, tanh: tanhDocs, to: toDocs, clone: cloneDocs, format: formatDocs, bin: binDocs, oct: octDocs, hex: hexDocs, isNaN: isNaNDocs, isInteger: isIntegerDocs, isNegative: isNegativeDocs, isNumeric: isNumericDocs, hasNumericValue: hasNumericValueDocs, isPositive: isPositiveDocs, isPrime: isPrimeDocs, isZero: isZeroDocs, typeOf: typeOfDocs, numeric: numericDocs };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/function/help.js
var help_name = "help",help_dependencies = ["typed", "mathWithTransform", "Help"];var createHelp = factory("help", help_dependencies, (_ref) => {var { typed, mathWithTransform, Help } = _ref;return typed(help_name, { any: function (search) {var prop,searchName = search;if ("string" != typeof search) for (prop in mathWithTransform) if (object_hasOwnProperty(mathWithTransform, prop) && search === mathWithTransform[prop]) {searchName = prop;break;}var doc = getSafeProperty(embeddedDocs, searchName);if (!doc) {var searchText = "function" == typeof searchName ? searchName.name : searchName;throw new Error("No documentation found on \"" + searchText + "\"");}return new Help(doc);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/function/compile.js
var compile_name = "compile",compile_dependencies = ["typed", "parse"];var createCompile = factory("compile", compile_dependencies, (_ref) => {var { typed, parse } = _ref;return typed(compile_name, { string: function (expr) {return parse(expr).compile();}, "Array | Matrix": function (expr) {return deepMap(expr, function (entry) {return parse(entry).compile();});} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/simplify/util.js
var util_name = "simplifyUtil",util_dependencies = ["FunctionNode", "OperatorNode", "SymbolNode"];var createUtil = factory("simplifyUtil", util_dependencies, (_ref) => {function isAssociative(node, context) {if (!isOperatorNode(node)) return !1;var name = node.fn.toString();return context && object_hasOwnProperty(context, name) && object_hasOwnProperty(context[name], "associative") ? context[name].associative : associative[name] || !1;}function flatten(node) {if (!node.args || 0 === node.args.length) return node;node.args = allChildren(node);for (var i = 0; i < node.args.length; i++) flatten(node.args[i]);}function allChildren(node) {var op,children = [];return isAssociative(node) ? (op = node.op, function findChildren(node) {for (var child, i = 0; i < node.args.length; i++) child = node.args[i], isOperatorNode(child) && op === child.op ? findChildren(child) : children.push(child);}(node), children) : node.args;}function unflattenr(node) {if (node.args && 0 !== node.args.length) {for (var makeNode = createMakeNodeFunction(node), l = node.args.length, i = 0; i < l; i++) unflattenr(node.args[i]);if (2 < l && isAssociative(node)) {for (var curnode = node.args.pop(); 0 < node.args.length;) curnode = makeNode([node.args.pop(), curnode]);node.args = curnode.args;}}}function unflattenl(node) {if (node.args && 0 !== node.args.length) {for (var makeNode = createMakeNodeFunction(node), l = node.args.length, i = 0; i < l; i++) unflattenl(node.args[i]);if (2 < l && isAssociative(node)) {for (var curnode = node.args.shift(); 0 < node.args.length;) curnode = makeNode([curnode, node.args.shift()]);node.args = curnode.args;}}}function createMakeNodeFunction(node) {return isOperatorNode(node) ? function (args) {try {return new OperatorNode(node.op, node.fn, args, node.implicit);} catch (err) {return console.error(err), [];}} : function (args) {return new FunctionNode(new SymbolNode(node.name), args);};}var { FunctionNode, OperatorNode, SymbolNode } = _ref,commutative = { add: !0, multiply: !0 },associative = { add: !0, multiply: !0 };return { createMakeNodeFunction, isCommutative: function isCommutative(node, context) {if (!isOperatorNode(node)) return !0;var name = node.fn.toString();return context && object_hasOwnProperty(context, name) && object_hasOwnProperty(context[name], "commutative") ? context[name].commutative : commutative[name] || !1;}, isAssociative, flatten, allChildren, unflattenr, unflattenl };});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/simplify/simplifyCore.js
var simplifyCore_name = "simplifyCore",simplifyCore_dependencies = ["equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "ConstantNode", "OperatorNode", "FunctionNode", "ParenthesisNode"];var createSimplifyCore = factory("simplifyCore", simplifyCore_dependencies, (_ref) => {function simplifyCore(node) {if (isOperatorNode(node) && node.isUnary()) {var a0 = simplifyCore(node.args[0]);if ("+" === node.op) return a0;if ("-" === node.op) {if (isOperatorNode(a0)) {if (a0.isUnary() && "-" === a0.op) return a0.args[0];if (a0.isBinary() && "subtract" === a0.fn) return new OperatorNode("-", "subtract", [a0.args[1], a0.args[0]]);}return new OperatorNode(node.op, node.fn, [a0]);}} else if (isOperatorNode(node) && node.isBinary()) {var _a = simplifyCore(node.args[0]),a1 = simplifyCore(node.args[1]);if ("+" === node.op) {if (isConstantNode(_a)) {if (isZero(_a.value)) return a1;if (isConstantNode(a1)) return new ConstantNode(add(_a.value, a1.value));}return isConstantNode(a1) && isZero(a1.value) ? _a : isOperatorNode(a1) && a1.isUnary() && "-" === a1.op ? new OperatorNode("-", "subtract", [_a, a1.args[0]]) : new OperatorNode(node.op, node.fn, a1 ? [_a, a1] : [_a]);}if ("-" === node.op) {if (isConstantNode(_a) && a1) {if (isConstantNode(a1)) return new ConstantNode(subtract(_a.value, a1.value));if (isZero(_a.value)) return new OperatorNode("-", "unaryMinus", [a1]);}if ("subtract" === node.fn) return isConstantNode(a1) && isZero(a1.value) ? _a : isOperatorNode(a1) && a1.isUnary() && "-" === a1.op ? simplifyCore(new OperatorNode("+", "add", [_a, a1.args[0]])) : new OperatorNode(node.op, node.fn, [_a, a1]);} else {if ("*" === node.op) {if (isConstantNode(_a)) {if (isZero(_a.value)) return node0;if (equal(_a.value, 1)) return a1;if (isConstantNode(a1)) return new ConstantNode(multiply(_a.value, a1.value));}if (isConstantNode(a1)) {if (isZero(a1.value)) return node0;if (equal(a1.value, 1)) return _a;if (isOperatorNode(_a) && _a.isBinary() && _a.op === node.op) {var a00 = _a.args[0];if (isConstantNode(a00)) {var a00a1 = new ConstantNode(multiply(a00.value, a1.value));return new OperatorNode(node.op, node.fn, [a00a1, _a.args[1]], node.implicit);}}return new OperatorNode(node.op, node.fn, [a1, _a], node.implicit);}return new OperatorNode(node.op, node.fn, [_a, a1], node.implicit);}if ("/" === node.op) {if (isConstantNode(_a)) {if (isZero(_a.value)) return node0;if (isConstantNode(a1) && (equal(a1.value, 1) || equal(a1.value, 2) || equal(a1.value, 4))) return new ConstantNode(divide(_a.value, a1.value));}return new OperatorNode(node.op, node.fn, [_a, a1]);}if ("^" === node.op) {if (isConstantNode(a1)) {if (isZero(a1.value)) return node1;if (equal(a1.value, 1)) return _a;if (isConstantNode(_a)) return new ConstantNode(pow(_a.value, a1.value));if (isOperatorNode(_a) && _a.isBinary() && "^" === _a.op) {var a01 = _a.args[1];if (isConstantNode(a01)) return new OperatorNode(node.op, node.fn, [_a.args[0], new ConstantNode(multiply(a01.value, a1.value))]);}}return new OperatorNode(node.op, node.fn, [_a, a1]);}}} else {if (isParenthesisNode(node)) {var c = simplifyCore(node.content);return isParenthesisNode(c) || isSymbolNode(c) || isConstantNode(c) ? c : new ParenthesisNode(c);}if (isFunctionNode(node)) {var args = node.args.map(simplifyCore).map(function (arg) {return isParenthesisNode(arg) ? arg.content : arg;});return new FunctionNode(simplifyCore(node.fn), args);}}return node;}var { equal, isZero, add, subtract, multiply, divide, pow, ConstantNode, OperatorNode, FunctionNode, ParenthesisNode } = _ref,node0 = new ConstantNode(0),node1 = new ConstantNode(1);return simplifyCore;});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/simplify/simplifyConstant.js
var simplifyConstant_name = "simplifyConstant",simplifyConstant_dependencies = ["typed", "config", "mathWithTransform", "?fraction", "?bignumber", "ConstantNode", "OperatorNode", "FunctionNode", "SymbolNode"];var createSimplifyConstant = factory("simplifyConstant", simplifyConstant_dependencies, (_ref) => {function _eval(fnname, args, options) {try {return _toNumber(mathWithTransform[fnname].apply(null, args), options);} catch (ignore) {return args = args.map(function (x) {return isFraction(x) ? x.valueOf() : x;}), _toNumber(mathWithTransform[fnname].apply(null, args), options);}}function _exactFraction(n, options) {var exactFractions = options && !1 !== options.exactFractions;if (exactFractions && isFinite(n) && fraction) {var f = fraction(n),fractionsLimit = options && "number" == typeof options.fractionsLimit ? options.fractionsLimit : 1 / 0;if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) return f;}return n;}function unaryMinusNode(n) {return new OperatorNode("-", "unaryMinus", [n]);}function foldOp(fn, args, makeNode, options) {return args.reduce(function (a, b) {if (!isNode(a) && !isNode(b)) {try {return _eval(fn, [a, b], options);} catch (ignoreandcontinue) {}a = _toNode(a), b = _toNode(b);} else isNode(a) ? isNode(b) || (b = _toNode(b)) : a = _toNode(a);return makeNode([a, b]);});}function foldFraction(node, options) {switch (node.type) {case "SymbolNode":return node;case "ConstantNode":return "number" != typeof node.value && isNaN(node.value) ? node : _toNumber(node.value, options);case "FunctionNode":if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) return node;{if (-1 === ["add", "multiply"].indexOf(node.name)) {var args = node.args.map((arg) => foldFraction(arg, options));if (!args.some(isNode)) try {return _eval(node.name, args, options);} catch (ignoreandcontine) {}return args = args.map(function (arg) {return isNode(arg) ? arg : _toNode(arg);}), new FunctionNode(node.name, args);}}case "OperatorNode":{var _args,res,fn = node.fn.toString(),makeNode = createMakeNodeFunction(node);if (isOperatorNode(node) && node.isUnary()) _args = [foldFraction(node.args[0], options)], res = isNode(_args[0]) ? makeNode(_args) : _eval(fn, _args, options);else if (!isAssociative(node)) _args = node.args.map((arg) => foldFraction(arg, options)), res = foldOp(fn, _args, makeNode, options);else if (_args = allChildren(node), _args = _args.map((arg) => foldFraction(arg, options)), isCommutative(fn)) {for (var consts = [], vars = [], i = 0; i < _args.length; i++) isNode(_args[i]) ? vars.push(_args[i]) : consts.push(_args[i]);1 < consts.length ? (res = foldOp(fn, consts, makeNode, options), vars.unshift(res), res = foldOp(fn, vars, makeNode, options)) : res = foldOp(fn, _args, makeNode, options);} else res = foldOp(fn, _args, makeNode, options);return res;}case "ParenthesisNode":return foldFraction(node.content, options);case "AccessorNode":case "ArrayNode":case "AssignmentNode":case "BlockNode":case "FunctionAssignmentNode":case "IndexNode":case "ObjectNode":case "RangeNode":case "ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(node.type));}}var { typed, config, mathWithTransform, fraction, bignumber, ConstantNode, OperatorNode, FunctionNode, SymbolNode } = _ref,{ isCommutative, isAssociative, allChildren, createMakeNodeFunction } = createUtil({ FunctionNode, OperatorNode, SymbolNode }),_toNode = typed({ Fraction: function (f) {var n,vn = f.s * f.n;return n = 0 > vn ? new OperatorNode("-", "unaryMinus", [new ConstantNode(-vn)]) : new ConstantNode(vn), 1 === f.d ? n : new OperatorNode("/", "divide", [n, new ConstantNode(f.d)]);}, number: function (n) {return 0 > n ? unaryMinusNode(new ConstantNode(-n)) : new ConstantNode(n);}, BigNumber: function (n) {return 0 > n ? unaryMinusNode(new ConstantNode(-n)) : new ConstantNode(n);}, Complex: function () {throw new Error("Cannot convert Complex number to Node");} }),_toNumber = typed({ "string, Object": function (s, options) {if ("BigNumber" === config.number) return void 0 === bignumber && noBignumber(), bignumber(s);if ("Fraction" === config.number) return void 0 === fraction && noFraction(), fraction(s);var n = parseFloat(s);return _exactFraction(n, options);}, "Fraction, Object": function (s) {return s;}, "BigNumber, Object": function (s) {return s;}, "number, Object": function (s, options) {return _exactFraction(s, options);}, "Complex, Object": function (s, options) {return 0 === s.im ? _exactFraction(s.re, options) : s;} });return function (expr, options) {var res = foldFraction(expr, options);return isNode(res) ? res : _toNode(res);};});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/simplify/resolve.js
var resolve_name = "resolve",resolve_dependencies = ["parse", "FunctionNode", "OperatorNode", "ParenthesisNode"];var createResolve = factory("resolve", resolve_dependencies, (_ref) => {function resolve(node, scope) {if (!scope) return node;if (isMap(scope) || (scope = createMap(scope)), isSymbolNode(node)) {var value = scope.get(node.name);if (isNode(value)) return resolve(value, scope);if ("number" == typeof value) return parse(value + "");} else {if (isOperatorNode(node)) {var args = node.args.map(function (arg) {return resolve(arg, scope);});return new OperatorNode(node.op, node.fn, args, node.implicit);}if (isParenthesisNode(node)) return new ParenthesisNode(resolve(node.content, scope));if (isFunctionNode(node)) {var _args = node.args.map(function (arg) {return resolve(arg, scope);});return new FunctionNode(node.name, _args);}}return node;}var { parse, FunctionNode, OperatorNode, ParenthesisNode } = _ref;return resolve;});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/simplify.js
var simplify_name = "simplify",simplify_dependencies = ["config", "typed", "parse", "add", "subtract", "multiply", "divide", "pow", "isZero", "equal", "?fraction", "?bignumber", "mathWithTransform", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "SymbolNode"];var createSimplify = factory("simplify", simplify_dependencies, (_ref) => {function removeParens(node) {return node.transform(function (node, path, parent) {return isParenthesisNode(node) ? removeParens(node.content) : node;});}function _buildRules(rules) {for (var ruleSet = [], i = 0; i < rules.length; i++) {var rule = rules[i],newRule = void 0,ruleType = typeof rule;switch (ruleType) {case "string":{var lr = rule.split("->");if (2 === lr.length) rule = { l: lr[0], r: lr[1] };else throw SyntaxError("Could not parse rule: " + rule);}case "object":if (newRule = { l: removeParens(parse(rule.l)), r: removeParens(parse(rule.r)) }, rule.context && (newRule.evaluate = rule.context), rule.evaluate && (newRule.evaluate = parse(rule.evaluate)), isAssociative(newRule.l)) {var makeNode = createMakeNodeFunction(newRule.l),expandsym = _getExpandPlaceholderSymbol();newRule.expanded = {}, newRule.expanded.l = makeNode([newRule.l.clone(), expandsym]), flatten(newRule.expanded.l), unflattenr(newRule.expanded.l), newRule.expanded.r = makeNode([newRule.r, expandsym]);}break;case "function":newRule = rule;break;default:throw TypeError("Unsupported type of rule: " + ruleType);}ruleSet.push(newRule);}return ruleSet;}function _getExpandPlaceholderSymbol() {return new SymbolNode("_p" + _lastsym++);}function getSplits(node, context) {var right,rightArgs,res = [],makeNode = createMakeNodeFunction(node);if (isCommutative(node, context)) for (var i = 0; i < node.args.length; i++) rightArgs = node.args.slice(0), rightArgs.splice(i, 1), right = 1 === rightArgs.length ? rightArgs[0] : makeNode(rightArgs), res.push(makeNode([node.args[i], right]));else rightArgs = node.args.slice(1), right = 1 === rightArgs.length ? rightArgs[0] : makeNode(rightArgs), res.push(makeNode([node.args[0], right]));return res;}function mergeMatch(match1, match2) {var res = { placeholders: {} };if (!match1.placeholders && !match2.placeholders) return res;if (!match1.placeholders) return match2;if (!match2.placeholders) return match1;for (var key in match1.placeholders) if (object_hasOwnProperty(match1.placeholders, key) && (res.placeholders[key] = match1.placeholders[key], object_hasOwnProperty(match2.placeholders, key) && !_exactMatch(match1.placeholders[key], match2.placeholders[key]))) return null;for (var _key in match2.placeholders) object_hasOwnProperty(match2.placeholders, _key) && (res.placeholders[_key] = match2.placeholders[_key]);return res;}function combineChildMatches(list1, list2) {var res = [];if (0 === list1.length || 0 === list2.length) return res;for (var merged, i1 = 0; i1 < list1.length; i1++) for (var i2 = 0; i2 < list2.length; i2++) merged = mergeMatch(list1[i1], list2[i2]), merged && res.push(merged);return res;}function mergeChildMatches(childMatches) {if (0 === childMatches.length) return childMatches;for (var s, sets = childMatches.reduce(combineChildMatches), uniqueSets = [], unique = {}, i = 0; i < sets.length; i++) s = JSON.stringify(sets[i]), unique[s] || (unique[s] = !0, uniqueSets.push(sets[i]));return uniqueSets;}function _ruleMatch(rule, node, isSplit) {var res = [{ placeholders: {} }];if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) {if (rule instanceof OperatorNode) {if (rule.op !== node.op || rule.fn !== node.fn) return [];} else if (rule instanceof FunctionNode && rule.name !== node.name) return [];if (1 === node.args.length && 1 === rule.args.length || !isAssociative(node) && node.args.length === rule.args.length || isSplit) {for (var childMatch, childMatches = [], i = 0; i < rule.args.length; i++) {if (childMatch = _ruleMatch(rule.args[i], node.args[i]), 0 === childMatch.length) return [];childMatches.push(childMatch);}res = mergeChildMatches(childMatches);} else {if (2 <= node.args.length && 2 === rule.args.length) {for (var matchSet, splits = getSplits(node, rule.context), splitMatches = [], _i = 0; _i < splits.length; _i++) matchSet = _ruleMatch(rule, splits[_i], !0), splitMatches = splitMatches.concat(matchSet);return splitMatches;}if (2 < rule.args.length) throw Error("Unexpected non-binary associative function: " + rule.toString());else return [];}} else if (rule instanceof SymbolNode) {if (0 === rule.name.length) throw new Error("Symbol in rule has 0 length...!?");if (SUPPORTED_CONSTANTS[rule.name]) {if (rule.name !== node.name) return [];} else if ("n" === rule.name[0] || "_p" === rule.name.substring(0, 2)) res[0].placeholders[rule.name] = node;else if ("v" === rule.name[0]) {if (!isConstantNode(node)) res[0].placeholders[rule.name] = node;else return [];} else if ("c" !== rule.name[0]) throw new Error("Invalid symbol in rule: " + rule.name);else if (node instanceof ConstantNode) res[0].placeholders[rule.name] = node;else return [];} else if (!(rule instanceof ConstantNode)) return [];else if (!equal(rule.value, node.value)) return [];return res;}function _exactMatch(p, q) {if (p instanceof ConstantNode && q instanceof ConstantNode) {if (!equal(p.value, q.value)) return !1;} else if (p instanceof SymbolNode && q instanceof SymbolNode) {if (p.name !== q.name) return !1;} else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) {if (p instanceof OperatorNode) {if (p.op !== q.op || p.fn !== q.fn) return !1;} else if (p instanceof FunctionNode && p.name !== q.name) return !1;if (p.args.length !== q.args.length) return !1;for (var i = 0; i < p.args.length; i++) if (!_exactMatch(p.args[i], q.args[i])) return !1;} else return !1;return !0;}var { config, typed, parse, add, subtract, multiply, divide, pow, isZero, equal, fraction, bignumber, mathWithTransform, ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode } = _ref,simplifyConstant = createSimplifyConstant({ typed, config, mathWithTransform, fraction, bignumber, ConstantNode, OperatorNode, FunctionNode, SymbolNode }),simplifyCore = createSimplifyCore({ equal, isZero, add, subtract, multiply, divide, pow, ConstantNode, OperatorNode, FunctionNode, ParenthesisNode }),resolve = createResolve({ parse, FunctionNode, OperatorNode, ParenthesisNode }),{ isCommutative, isAssociative, flatten, unflattenr, unflattenl, createMakeNodeFunction } = createUtil({ FunctionNode, OperatorNode, SymbolNode }),simplify = typed("simplify", { string: function string(expr) {return this(parse(expr), this.rules, createEmptyMap(), {});}, "string, Map | Object": function stringMapObject(expr, scope) {return this(parse(expr), this.rules, scope, {});}, "string, Map | Object, Object": function stringMapObjectObject(expr, scope, options) {return this(parse(expr), this.rules, scope, options);}, "string, Array": function stringArray(expr, rules) {return this(parse(expr), rules, createEmptyMap(), {});}, "string, Array, Map | Object": function stringArrayMapObject(expr, rules, scope) {return this(parse(expr), rules, scope, {});}, "string, Array, Map | Object, Object": function stringArrayMapObjectObject(expr, rules, scope, options) {return this(parse(expr), rules, scope, options);}, "Node, Map | Object": function NodeMapObject(expr, scope) {return this(expr, this.rules, scope, {});}, "Node, Map | Object, Object": function NodeMapObjectObject(expr, scope, options) {return this(expr, this.rules, scope, options);}, Node: function Node(expr) {return this(expr, this.rules, createEmptyMap(), {});}, "Node, Array": function NodeArray(expr, rules) {return this(expr, rules, createEmptyMap(), {});}, "Node, Array, Map | Object": function NodeArrayMapObject(expr, rules, scope) {return this(expr, rules, scope, {});}, "Node, Array, Object, Object": function NodeArrayObjectObject(expr, rules, scope, options) {return this(expr, rules, createMap(scope), options);}, "Node, Array, Map, Object": function NodeArrayMapObject(expr, rules, scope, options) {rules = _buildRules(rules);var res = resolve(expr, scope);res = removeParens(res);for (var visited = {}, str = res.toString({ parenthesis: "all" }); !visited[str];) {visited[str] = !0, _lastsym = 0;for (var i = 0; i < rules.length; i++) "function" == typeof rules[i] ? res = rules[i](res, options) : (flatten(res), res = applyRule(res, rules[i])), unflattenl(res);str = res.toString({ parenthesis: "all" });}return res;} });simplify.simplifyCore = simplifyCore, simplify.resolve = resolve;var SUPPORTED_CONSTANTS = { true: !0, false: !0, e: !0, i: !0, Infinity: !0, LN2: !0, LN10: !0, LOG2E: !0, LOG10E: !0, NaN: !0, phi: !0, pi: !0, SQRT1_2: !0, SQRT2: !0, tau: !0 };simplify.rules = [simplifyCore, { l: "log(e)", r: "1" }, { l: "n-n1", r: "n+-n1" }, { l: "-(c*v)", r: "(-c) * v" }, { l: "-v", r: "(-1) * v" }, { l: "n/n1^n2", r: "n*n1^-n2" }, { l: "n/n1", r: "n*n1^-1" }, { l: "(n ^ n1) ^ n2", r: "n ^ (n1 * n2)" }, { l: "n*n", r: "n^2" }, { l: "n * n^n1", r: "n^(n1+1)" }, { l: "n^n1 * n^n2", r: "n^(n1+n2)" }, { l: "n+n", r: "2*n" }, { l: "n+-n", r: "0" }, { l: "n1*n2 + n2", r: "(n1+1)*n2" }, { l: "n1*n3 + n2*n3", r: "(n1+n2)*n3" }, { l: "n1 + -1 * (n2 + n3)", r: "n1 + -1 * n2 + -1 * n3" }, simplifyConstant, { l: "(-n)*n1", r: "-(n*n1)" }, { l: "c+v", r: "v+c", context: { add: { commutative: !1 } } }, { l: "v*c", r: "c*v", context: { multiply: { commutative: !1 } } }, { l: "n+-n1", r: "n-n1" }, { l: "n*(n1^-1)", r: "n/n1" }, { l: "n*n1^-n2", r: "n/n1^n2" }, { l: "n1^-1", r: "1/n1" }, { l: "n*(n1/n2)", r: "(n*n1)/n2" }, { l: "n-(n1+n2)", r: "n-n1-n2" }, { l: "1*n", r: "n" }, { l: "n1/(n2/n3)", r: "(n1*n3)/n2" }];var _lastsym = 0,applyRule = typed("applyRule", { "Node, Object": function NodeObject(node, rule) {var res = node;if (!(res instanceof OperatorNode || res instanceof FunctionNode)) res instanceof ParenthesisNode && res.content && (res.content = applyRule(res.content, rule));else if (res.args) for (var i = 0; i < res.args.length; i++) res.args[i] = applyRule(res.args[i], rule);var repl = rule.r,matches = _ruleMatch(rule.l, res)[0];if (!matches && rule.expanded && (repl = rule.expanded.r, matches = _ruleMatch(rule.expanded.l, res)[0]), matches) {var implicit = res.implicit;res = repl.clone(), implicit && "implicit" in repl && (res.implicit = !0), res = res.transform(function (node) {return node.isSymbolNode && object_hasOwnProperty(matches.placeholders, node.name) ? matches.placeholders[node.name].clone() : node;});}return res;} });return simplify;});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/rationalize.js
var rationalize_name = "rationalize",rationalize_dependencies = ["config", "typed", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "parse", "simplify", "?bignumber", "?fraction", "mathWithTransform", "ConstantNode", "OperatorNode", "FunctionNode", "SymbolNode", "ParenthesisNode"];var createRationalize = factory("rationalize", rationalize_dependencies, (_ref) => {function polynomial(expr, scope, extended, rules) {function recPoly(node) {var tp = node.type;if ("FunctionNode" === tp) throw new Error("There is an unsolved function call");else if ("OperatorNode" === tp) {if ("^" !== node.op) {if (-1 === oper.indexOf(node.op)) throw new Error("Operator " + node.op + " invalid in polynomial expression");for (var i = 0; i < node.args.length; i++) recPoly(node.args[i]);} else if ("ConstantNode" !== node.args[1].type || !isInteger(parseFloat(node.args[1].value))) throw new Error("There is a non-integer exponent");else recPoly(node.args[0]);} else if ("SymbolNode" === tp) {var _name = node.name,pos = variables.indexOf(_name);-1 === pos && variables.push(_name);} else if ("ParenthesisNode" === tp) recPoly(node.content);else if ("ConstantNode" !== tp) throw new Error("type " + tp + " is not allowed in polynomial expression");}var variables = [],node = simplify(expr, rules, scope, { exactFractions: !1 });extended = !!extended;var oper = "+-*" + (extended ? "/" : "");recPoly(node);return { expression: node, variables: variables };}function rulesRationalize() {var oldRules = [simplifyCore, { l: "n+n", r: "2*n" }, { l: "n+-n", r: "0" }, simplifyConstant, { l: "n*(n1^-1)", r: "n/n1" }, { l: "n*n1^-n2", r: "n/n1^n2" }, { l: "n1^-1", r: "1/n1" }, { l: "n*(n1/n2)", r: "(n*n1)/n2" }, { l: "1*n", r: "n" }],rulesFirst = [{ l: "(-n1)/(-n2)", r: "n1/n2" }, { l: "(-n1)*(-n2)", r: "n1*n2" }, { l: "n1--n2", r: "n1+n2" }, { l: "n1-n2", r: "n1+(-n2)" }, { l: "(n1+n2)*n3", r: "(n1*n3 + n2*n3)" }, { l: "n1*(n2+n3)", r: "(n1*n2+n1*n3)" }, { l: "c1*n + c2*n", r: "(c1+c2)*n" }, { l: "c1*n + n", r: "(c1+1)*n" }, { l: "c1*n - c2*n", r: "(c1-c2)*n" }, { l: "c1*n - n", r: "(c1-1)*n" }, { l: "v/c", r: "(1/c)*v" }, { l: "v/-c", r: "-(1/c)*v" }, { l: "-v*-c", r: "c*v" }, { l: "-v*c", r: "-c*v" }, { l: "v*-c", r: "-c*v" }, { l: "v*c", r: "c*v" }, { l: "-(-n1*n2)", r: "(n1*n2)" }, { l: "-(n1*n2)", r: "(-n1*n2)" }, { l: "-(-n1+n2)", r: "(n1-n2)" }, { l: "-(n1+n2)", r: "(-n1-n2)" }, { l: "(n1^n2)^n3", r: "(n1^(n2*n3))" }, { l: "-(-n1/n2)", r: "(n1/n2)" }, { l: "-(n1/n2)", r: "(-n1/n2)" }],rulesSucDiv = [{ l: "(n1/(n2/n3))", r: "((n1*n3)/n2)" }, { l: "(n1/n2/n3)", r: "(n1/(n2*n3))" }],setRules = {};return setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv), setRules.distrDivRules = [{ l: "(n1/n2 + n3/n4)", r: "((n1*n4 + n3*n2)/(n2*n4))" }, { l: "(n1/n2 + n3)", r: "((n1 + n3*n2)/n2)" }, { l: "(n1 + n2/n3)", r: "((n1*n3 + n2)/n3)" }], setRules.sucDivRules = rulesSucDiv, setRules.firstRulesAgain = oldRules.concat(rulesFirst), setRules.finalRules = [simplifyCore, { l: "n*-n", r: "-n^2" }, { l: "n*n", r: "n^2" }, simplifyConstant, { l: "n*-n^n1", r: "-n^(n1+1)" }, { l: "n*n^n1", r: "n^(n1+1)" }, { l: "n^n1*-n^n2", r: "-n^(n1+n2)" }, { l: "n^n1*n^n2", r: "n^(n1+n2)" }, { l: "n^n1*-n", r: "-n^(n1+1)" }, { l: "n^n1*n", r: "n^(n1+1)" }, { l: "n^n1/-n", r: "-n^(n1-1)" }, { l: "n^n1/n", r: "n^(n1-1)" }, { l: "n/-n^n1", r: "-n^(1-n1)" }, { l: "n/n^n1", r: "n^(1-n1)" }, { l: "n^n1/-n^n2", r: "n^(n1-n2)" }, { l: "n^n1/n^n2", r: "n^(n1-n2)" }, { l: "n1+(-n2*n3)", r: "n1-n2*n3" }, { l: "v*(-c)", r: "-c*v" }, { l: "n1+-n2", r: "n1-n2" }, { l: "v*c", r: "c*v" }, { l: "(n1^n2)^n3", r: "(n1^(n2*n3))" }], setRules;}function expandPower(node, parent, indParent) {var tp = node.type,internal = 1 < arguments.length;if ("OperatorNode" === tp && node.isBinary()) {var val,does = !1;if ("^" === node.op && ("ParenthesisNode" === node.args[0].type || "OperatorNode" === node.args[0].type) && "ConstantNode" === node.args[1].type && (val = parseFloat(node.args[1].value), does = 2 <= val && isInteger(val)), does) {if (2 < val) {var nEsqTopo = node.args[0],nDirTopo = new OperatorNode("^", "pow", [node.args[0].cloneDeep(), new ConstantNode(val - 1)]);node = new OperatorNode("*", "multiply", [nEsqTopo, nDirTopo]);} else node = new OperatorNode("*", "multiply", [node.args[0], node.args[0].cloneDeep()]);internal && ("content" === indParent ? parent.content = node : parent.args[indParent] = node);}}if ("ParenthesisNode" === tp) expandPower(node.content, node, "content");else if ("ConstantNode" !== tp && "SymbolNode" !== tp) for (var i = 0; i < node.args.length; i++) expandPower(node.args[i], node, i);return internal ? void 0 : node;}function polyToCanonical(node, coefficients) {function recurPol(node, noPai, o) {var tp = node.type;if ("FunctionNode" === tp) throw new Error("There is an unsolved function call");else if ("OperatorNode" === tp) {if (-1 === "+-*^".indexOf(node.op)) throw new Error("Operator " + node.op + " invalid");if (null !== noPai) {if (("unaryMinus" === node.fn || "pow" === node.fn) && "add" !== noPai.fn && "subtract" !== noPai.fn && "multiply" !== noPai.fn) throw new Error("Invalid " + node.op + " placing");if (("subtract" === node.fn || "add" === node.fn || "multiply" === node.fn) && "add" !== noPai.fn && "subtract" !== noPai.fn) throw new Error("Invalid " + node.op + " placing");if (("subtract" === node.fn || "add" === node.fn || "unaryMinus" === node.fn) && 0 !== o.noFil) throw new Error("Invalid " + node.op + " placing");}("^" === node.op || "*" === node.op) && (o.fire = node.op);for (var _i = 0; _i < node.args.length; _i++) "unaryMinus" === node.fn && (o.oper = "-"), ("+" === node.op || "subtract" === node.fn) && (o.fire = "", o.cte = 1, o.oper = 0 === _i ? "+" : node.op), o.noFil = _i, recurPol(node.args[_i], node, o);} else if ("SymbolNode" === tp) {if (node.name !== varname && "" !== varname) throw new Error("There is more than one variable");if (varname = node.name, null === noPai) return void (coefficients[1] = 1);if ("^" === noPai.op && 0 !== o.noFil) throw new Error("In power the variable should be the first parameter");if ("*" === noPai.op && 1 !== o.noFil) throw new Error("In multiply the variable should be the second parameter");("" === o.fire || "*" === o.fire) && (1 > maxExpo && (coefficients[1] = 0), coefficients[1] += o.cte * ("+" === o.oper ? 1 : -1), maxExpo = Math.max(1, maxExpo));} else if ("ConstantNode" === tp) {var valor = parseFloat(node.value);if (null === noPai) return void (coefficients[0] = valor);if ("^" === noPai.op) {if (1 !== o.noFil) throw new Error("Constant cannot be powered");if (!isInteger(valor) || 0 >= valor) throw new Error("Non-integer exponent is not allowed");for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) coefficients[_i2] = 0;return valor > maxExpo && (coefficients[valor] = 0), coefficients[valor] += o.cte * ("+" === o.oper ? 1 : -1), void (maxExpo = Math.max(valor, maxExpo));}o.cte = valor, "" === o.fire && (coefficients[0] += o.cte * ("+" === o.oper ? 1 : -1));} else throw new Error("Type " + tp + " is not allowed");}coefficients === void 0 && (coefficients = []), coefficients[0] = 0;var maxExpo = 0,varname = "";recurPol(node, null, { cte: 1, oper: "+", fire: "" }), maxExpo = coefficients.length - 1;for (var no, first = !0, i = maxExpo; 0 <= i; i--) if (0 !== coefficients[i]) {var n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i])),op = 0 > coefficients[i] ? "-" : "+";if (0 < i) {var n2 = new SymbolNode(varname);if (1 < i) {var n3 = new ConstantNode(i);n2 = new OperatorNode("^", "pow", [n2, n3]);}n1 = -1 === coefficients[i] && first ? new OperatorNode("-", "unaryMinus", [n2]) : 1 === Math.abs(coefficients[i]) ? n2 : new OperatorNode("*", "multiply", [n1, n2]);}no = first ? n1 : "+" === op ? new OperatorNode("+", "add", [no, n1]) : new OperatorNode("-", "subtract", [no, n1]), first = !1;}return first ? new ConstantNode(0) : no;}var { config, typed, equal, isZero, add, subtract, multiply, divide, pow, parse, simplify, fraction, bignumber, mathWithTransform, ConstantNode, OperatorNode, FunctionNode, SymbolNode, ParenthesisNode } = _ref,simplifyConstant = createSimplifyConstant({ typed, config, mathWithTransform, fraction, bignumber, ConstantNode, OperatorNode, FunctionNode, SymbolNode }),simplifyCore = createSimplifyCore({ equal, isZero, add, subtract, multiply, divide, pow, ConstantNode, OperatorNode, FunctionNode, ParenthesisNode });return typed(rationalize_name, { string: function (expr) {return this(parse(expr), {}, !1);}, "string, boolean": function (expr, detailed) {return this(parse(expr), {}, detailed);}, "string, Object": function (expr, scope) {return this(parse(expr), scope, !1);}, "string, Object, boolean": function (expr, scope, detailed) {return this(parse(expr), scope, detailed);}, Node: function (expr) {return this(expr, {}, !1);}, "Node, boolean": function (expr, detailed) {return this(expr, {}, detailed);}, "Node, Object": function (expr, scope) {return this(expr, scope, !1);}, "Node, Object, boolean": function (expr, scope, detailed) {var setRules = rulesRationalize(),polyRet = polynomial(expr, scope, !0, setRules.firstRules),nVars = polyRet.variables.length;if (expr = polyRet.expression, 1 <= nVars) {expr = expandPower(expr);var sBefore,rules,eDistrDiv = !0,redoInic = !1;expr = simplify(expr, setRules.firstRules, {}, { exactFractions: !1 });for (var s; rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules, expr = simplify(expr, rules), eDistrDiv = !eDistrDiv, s = expr.toString(), s !== sBefore;) redoInic = !0, sBefore = s;redoInic && (expr = simplify(expr, setRules.firstRulesAgain, {}, { exactFractions: !1 })), expr = simplify(expr, setRules.finalRules, {}, { exactFractions: !1 });}var coefficients = [],retRationalize = {};return ("OperatorNode" === expr.type && expr.isBinary() && "/" === expr.op ? (1 === nVars && (expr.args[0] = polyToCanonical(expr.args[0], coefficients), expr.args[1] = polyToCanonical(expr.args[1])), detailed && (retRationalize.numerator = expr.args[0], retRationalize.denominator = expr.args[1])) : (1 === nVars && (expr = polyToCanonical(expr, coefficients)), detailed && (retRationalize.numerator = expr, retRationalize.denominator = null)), !detailed) ? expr : (retRationalize.coefficients = coefficients, retRationalize.variables = polyRet.variables, retRationalize.expression = expr, retRationalize);} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/function/parser.js
var parser_name = "parser",parser_dependencies = ["typed", "Parser"];var createParser = factory("parser", parser_dependencies, (_ref) => {var { typed, Parser } = _ref;return typed(parser_name, { "": function () {return new Parser();} });});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/function/algebra/derivative.js
var derivative_name = "derivative",derivative_dependencies = ["typed", "config", "parse", "simplify", "equal", "isZero", "numeric", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "SymbolNode"];var createDerivative = factory("derivative", derivative_dependencies, (_ref) => {function funcArgsCheck(node) {if ("log" !== node.name && "nthRoot" !== node.name && "pow" !== node.name || 2 !== node.args.length) {for (var i = 0; i < node.args.length; ++i) node.args[i] = createConstantNode(0);throw node.compile().evaluate(), new Error("Expected TypeError, but none found");}}function createConstantNode(value, valueType) {return new ConstantNode(numeric(value, valueType || config.number));}var { typed, config, parse, simplify, equal, isZero, numeric, ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode } = _ref,derivative = typed("derivative", { "Node, SymbolNode, Object": function (expr, variable, options) {var constNodes = {};constTag(constNodes, expr, variable.name);var res = _derivative(expr, constNodes);return options.simplify ? simplify(res) : res;}, "Node, SymbolNode": function (expr, variable) {return this(expr, variable, { simplify: !0 });}, "string, SymbolNode": function (expr, variable) {return this(parse(expr), variable);}, "string, SymbolNode, Object": function (expr, variable, options) {return this(parse(expr), variable, options);}, "string, string": function (expr, variable) {return this(parse(expr), parse(variable));}, "string, string, Object": function (expr, variable, options) {return this(parse(expr), parse(variable), options);}, "Node, string": function (expr, variable) {return this(expr, parse(variable));}, "Node, string, Object": function (expr, variable, options) {return this(expr, parse(variable), options);} });derivative._simplify = !0, derivative.toTex = function (deriv) {return _derivTex.apply(null, deriv.args);};var _derivTex = typed("_derivTex", { "Node, SymbolNode": function (expr, x) {return isConstantNode(expr) && "string" === typeOf(expr.value) ? _derivTex(parse(expr.value).toString(), x.toString(), 1) : _derivTex(expr.toString(), x.toString(), 1);}, "Node, ConstantNode": function (expr, x) {if ("string" === typeOf(x.value)) return _derivTex(expr, parse(x.value));throw new Error("The second parameter to 'derivative' is a non-string constant");}, "Node, SymbolNode, ConstantNode": function (expr, x, order) {return _derivTex(expr.toString(), x.name, order.value);}, "string, string, number": function (expr, x, order) {var d;return d = 1 === order ? "{d\\over d" + x + "}" : "{d^{" + order + "}\\over d" + x + "^{" + order + "}}", d + "\\left[".concat(expr, "\\right]");} }),constTag = typed("constTag", { "Object, ConstantNode, string": function (constNodes, node) {return constNodes[node] = !0, !0;}, "Object, SymbolNode, string": function (constNodes, node, varName) {return node.name !== varName && (constNodes[node] = !0, !0);}, "Object, ParenthesisNode, string": function (constNodes, node, varName) {return constTag(constNodes, node.content, varName);}, "Object, FunctionAssignmentNode, string": function (constNodes, node, varName) {return -1 === node.params.indexOf(varName) ? (constNodes[node] = !0, !0) : constTag(constNodes, node.expr, varName);}, "Object, FunctionNode | OperatorNode, string": function (constNodes, node, varName) {if (0 < node.args.length) {for (var isConst = constTag(constNodes, node.args[0], varName), i = 1; i < node.args.length; ++i) isConst = constTag(constNodes, node.args[i], varName) && isConst;if (isConst) return constNodes[node] = !0, !0;}return !1;} }),_derivative = typed("_derivative", { "ConstantNode, Object": function () {return createConstantNode(0);}, "SymbolNode, Object": function (node, constNodes) {return void 0 === constNodes[node] ? createConstantNode(1) : createConstantNode(0);}, "ParenthesisNode, Object": function (node, constNodes) {return new ParenthesisNode(_derivative(node.content, constNodes));}, "FunctionAssignmentNode, Object": function (node, constNodes) {return void 0 === constNodes[node] ? _derivative(node.expr, constNodes) : createConstantNode(0);}, "FunctionNode, Object": function (node, constNodes) {if (1 !== node.args.length && funcArgsCheck(node), void 0 !== constNodes[node]) return createConstantNode(0);var arg1,funcDerivative,arg0 = node.args[0],div = !1,negative = !1;switch (node.name) {case "cbrt":div = !0, funcDerivative = new OperatorNode("*", "multiply", [createConstantNode(3), new OperatorNode("^", "pow", [arg0, new OperatorNode("/", "divide", [createConstantNode(2), createConstantNode(3)])])]);break;case "sqrt":case "nthRoot":if (1 === node.args.length) div = !0, funcDerivative = new OperatorNode("*", "multiply", [createConstantNode(2), new FunctionNode("sqrt", [arg0])]);else if (2 === node.args.length) return arg1 = new OperatorNode("/", "divide", [createConstantNode(1), node.args[1]]), constNodes[arg1] = constNodes[node.args[1]], _derivative(new OperatorNode("^", "pow", [arg0, arg1]), constNodes);break;case "log10":arg1 = createConstantNode(10);case "log":if (!arg1 && 1 === node.args.length) funcDerivative = arg0.clone(), div = !0;else if (1 === node.args.length && arg1 || 2 === node.args.length && void 0 !== constNodes[node.args[1]]) funcDerivative = new OperatorNode("*", "multiply", [arg0.clone(), new FunctionNode("log", [arg1 || node.args[1]])]), div = !0;else if (2 === node.args.length) return _derivative(new OperatorNode("/", "divide", [new FunctionNode("log", [arg0]), new FunctionNode("log", [node.args[1]])]), constNodes);break;case "pow":return constNodes[arg1] = constNodes[node.args[1]], _derivative(new OperatorNode("^", "pow", [arg0, node.args[1]]), constNodes);case "exp":funcDerivative = new FunctionNode("exp", [arg0.clone()]);break;case "sin":funcDerivative = new FunctionNode("cos", [arg0.clone()]);break;case "cos":funcDerivative = new OperatorNode("-", "unaryMinus", [new FunctionNode("sin", [arg0.clone()])]);break;case "tan":funcDerivative = new OperatorNode("^", "pow", [new FunctionNode("sec", [arg0.clone()]), createConstantNode(2)]);break;case "sec":funcDerivative = new OperatorNode("*", "multiply", [node, new FunctionNode("tan", [arg0.clone()])]);break;case "csc":negative = !0, funcDerivative = new OperatorNode("*", "multiply", [node, new FunctionNode("cot", [arg0.clone()])]);break;case "cot":negative = !0, funcDerivative = new OperatorNode("^", "pow", [new FunctionNode("csc", [arg0.clone()]), createConstantNode(2)]);break;case "asin":div = !0, funcDerivative = new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])])]);break;case "acos":div = !0, negative = !0, funcDerivative = new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])])]);break;case "atan":div = !0, funcDerivative = new OperatorNode("+", "add", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);break;case "asec":div = !0, funcDerivative = new OperatorNode("*", "multiply", [new FunctionNode("abs", [arg0.clone()]), new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);break;case "acsc":div = !0, negative = !0, funcDerivative = new OperatorNode("*", "multiply", [new FunctionNode("abs", [arg0.clone()]), new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);break;case "acot":div = !0, negative = !0, funcDerivative = new OperatorNode("+", "add", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);break;case "sinh":funcDerivative = new FunctionNode("cosh", [arg0.clone()]);break;case "cosh":funcDerivative = new FunctionNode("sinh", [arg0.clone()]);break;case "tanh":funcDerivative = new OperatorNode("^", "pow", [new FunctionNode("sech", [arg0.clone()]), createConstantNode(2)]);break;case "sech":negative = !0, funcDerivative = new OperatorNode("*", "multiply", [node, new FunctionNode("tanh", [arg0.clone()])]);break;case "csch":negative = !0, funcDerivative = new OperatorNode("*", "multiply", [node, new FunctionNode("coth", [arg0.clone()])]);break;case "coth":negative = !0, funcDerivative = new OperatorNode("^", "pow", [new FunctionNode("csch", [arg0.clone()]), createConstantNode(2)]);break;case "asinh":div = !0, funcDerivative = new FunctionNode("sqrt", [new OperatorNode("+", "add", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);break;case "acosh":div = !0, funcDerivative = new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);break;case "atanh":div = !0, funcDerivative = new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])]);break;case "asech":div = !0, negative = !0, funcDerivative = new OperatorNode("*", "multiply", [arg0.clone(), new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])])])]);break;case "acsch":div = !0, negative = !0, funcDerivative = new OperatorNode("*", "multiply", [new FunctionNode("abs", [arg0.clone()]), new FunctionNode("sqrt", [new OperatorNode("+", "add", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);break;case "acoth":div = !0, negative = !0, funcDerivative = new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])]);break;case "abs":funcDerivative = new OperatorNode("/", "divide", [new FunctionNode(new SymbolNode("abs"), [arg0.clone()]), arg0.clone()]);break;case "gamma":default:throw new Error("Function \"" + node.name + "\" is not supported by derivative, or a wrong number of arguments is passed");}var op, func;div ? (op = "/", func = "divide") : (op = "*", func = "multiply");var chainDerivative = _derivative(arg0, constNodes);return negative && (chainDerivative = new OperatorNode("-", "unaryMinus", [chainDerivative])), new OperatorNode(op, func, [chainDerivative, funcDerivative]);}, "OperatorNode, Object": function (node, constNodes) {if (void 0 !== constNodes[node]) return createConstantNode(0);if ("+" === node.op) return new OperatorNode(node.op, node.fn, node.args.map(function (arg) {return _derivative(arg, constNodes);}));if ("-" === node.op) {if (node.isUnary()) return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes)]);if (node.isBinary()) return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes), _derivative(node.args[1], constNodes)]);}if ("*" === node.op) {var constantTerms = node.args.filter(function (arg) {return void 0 !== constNodes[arg];});if (0 < constantTerms.length) {var nonConstantTerms = node.args.filter(function (arg) {return void 0 === constNodes[arg];}),nonConstantNode = 1 === nonConstantTerms.length ? nonConstantTerms[0] : new OperatorNode("*", "multiply", nonConstantTerms),newArgs = constantTerms.concat(_derivative(nonConstantNode, constNodes));return new OperatorNode("*", "multiply", newArgs);}return new OperatorNode("+", "add", node.args.map(function (argOuter) {return new OperatorNode("*", "multiply", node.args.map(function (argInner) {return argInner === argOuter ? _derivative(argInner, constNodes) : argInner.clone();}));}));}if ("/" === node.op && node.isBinary()) {var arg0 = node.args[0],arg1 = node.args[1];return void 0 === constNodes[arg1] ? void 0 === constNodes[arg0] ? new OperatorNode("/", "divide", [new OperatorNode("-", "subtract", [new OperatorNode("*", "multiply", [_derivative(arg0, constNodes), arg1.clone()]), new OperatorNode("*", "multiply", [arg0.clone(), _derivative(arg1, constNodes)])]), new OperatorNode("^", "pow", [arg1.clone(), createConstantNode(2)])]) : new OperatorNode("*", "multiply", [new OperatorNode("-", "unaryMinus", [arg0]), new OperatorNode("/", "divide", [_derivative(arg1, constNodes), new OperatorNode("^", "pow", [arg1.clone(), createConstantNode(2)])])]) : new OperatorNode("/", "divide", [_derivative(arg0, constNodes), arg1]);}if ("^" === node.op && node.isBinary()) {var _arg = node.args[0],_arg2 = node.args[1];if (void 0 !== constNodes[_arg]) return isConstantNode(_arg) && (isZero(_arg.value) || equal(_arg.value, 1)) ? createConstantNode(0) : new OperatorNode("*", "multiply", [node, new OperatorNode("*", "multiply", [new FunctionNode("log", [_arg.clone()]), _derivative(_arg2.clone(), constNodes)])]);if (void 0 !== constNodes[_arg2]) {if (isConstantNode(_arg2)) {if (isZero(_arg2.value)) return createConstantNode(0);if (equal(_arg2.value, 1)) return _derivative(_arg, constNodes);}var powMinusOne = new OperatorNode("^", "pow", [_arg.clone(), new OperatorNode("-", "subtract", [_arg2, createConstantNode(1)])]);return new OperatorNode("*", "multiply", [_arg2.clone(), new OperatorNode("*", "multiply", [_derivative(_arg, constNodes), powMinusOne])]);}return new OperatorNode("*", "multiply", [new OperatorNode("^", "pow", [_arg.clone(), _arg2.clone()]), new OperatorNode("+", "add", [new OperatorNode("*", "multiply", [_derivative(_arg, constNodes), new OperatorNode("/", "divide", [_arg2.clone(), _arg.clone()])]), new OperatorNode("*", "multiply", [_derivative(_arg2, constNodes), new FunctionNode("log", [_arg.clone()])])])]);}throw new Error("Operator \"" + node.op + "\" is not supported by derivative, or a wrong number of arguments is passed");} });return derivative;});
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/apply.transform.js
var apply_transform_name = "apply",apply_transform_dependencies = ["typed", "isInteger"];var createApplyTransform = factory("apply", apply_transform_dependencies, (_ref) => {var { typed, isInteger } = _ref,apply = createApply({ typed, isInteger });return typed("apply", { "...any": function (args) {var dim = args[1];isNumber(dim) ? args[1] = dim - 1 : isBigNumber(dim) && (args[1] = dim.minus(1));try {return apply.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js
function compileInlineExpression(expression, math, scope) {var symbol = expression.filter(function (node) {return isSymbolNode(node) && !(node.name in math) && !scope.has(node.name);})[0];if (!symbol) throw new Error("No undefined variable found in inline expression \"" + expression + "\"");var name = symbol.name,subScope = createSubScope(scope),eq = expression.compile();return function (x) {return subScope.set(name, x), eq.evaluate(subScope);};}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/filter.transform.js
var filter_transform_name = "filter",filter_transform_dependencies = ["typed"];var createFilterTransform = factory("filter", filter_transform_dependencies, (_ref) => {function filterTransform(args, math, scope) {var x, callback;return args[0] && (x = args[0].compile().evaluate(scope)), args[1] && (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1]) ? callback = args[1].compile().evaluate(scope) : callback = compileInlineExpression(args[1], math, scope)), filter(x, callback);}var { typed } = _ref;filterTransform.rawArgs = !0;var filter = typed("filter", { "Array, function": _filter, "Matrix, function": function (x, test) {return x.create(_filter(x.toArray(), test));}, "Array, RegExp": filterRegExp, "Matrix, RegExp": function (x, test) {return x.create(filterRegExp(x.toArray(), test));} });return filterTransform;}, { isTransformFunction: !0 });function _filter(x, callback) {var args = maxArgumentCount(callback);return filter(x, function (value, index, array) {return 1 === args ? callback(value) : 2 === args ? callback(value, [index + 1]) : callback(value, [index + 1], array);});}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/map.transform.js
var map_transform_name = "map",map_transform_dependencies = ["typed"];var createMapTransform = factory("map", map_transform_dependencies, (_ref) => {function mapTransform(args, math, scope) {var x, callback;return args[0] && (x = args[0].compile().evaluate(scope)), args[1] && (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1]) ? callback = args[1].compile().evaluate(scope) : callback = compileInlineExpression(args[1], math, scope)), map(x, callback);}var { typed } = _ref;mapTransform.rawArgs = !0;var map = typed("map", { "Array, function": function (x, callback) {return map_transform_map(x, callback, x);}, "Matrix, function": function (x, callback) {return x.create(map_transform_map(x.valueOf(), callback, x));} });return mapTransform;}, { isTransformFunction: !0 });function map_transform_map(array, callback, orig) {function recurse(value, index) {return Array.isArray(value) ? map(value, function (child, i) {return recurse(child, index.concat(i + 1));}) : 1 === argsCount ? callback(value) : 2 === argsCount ? callback(value, index) : callback(value, index, orig);}var argsCount = maxArgumentCount(callback);return recurse(array, []);}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js
var forEach_transform_name = "forEach",forEach_transform_dependencies = ["typed"];var createForEachTransform = factory("forEach", forEach_transform_dependencies, (_ref) => {function forEachTransform(args, math, scope) {var x, callback;return args[0] && (x = args[0].compile().evaluate(scope)), args[1] && (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1]) ? callback = args[1].compile().evaluate(scope) : callback = compileInlineExpression(args[1], math, scope)), _forEach(x, callback);}var { typed } = _ref;forEachTransform.rawArgs = !0;var _forEach = typed("forEach", { "Array | Matrix, function": function (array, callback) {var args = maxArgumentCount(callback);(function recurse(value, index) {Array.isArray(value) ? forEach(value, function (child, i) {recurse(child, index.concat(i + 1));}) : 1 === args ? callback(value) : 2 === args ? callback(value, index) : callback(value, index, array);})(array.valueOf(), []);} });return forEachTransform;}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/subset.transform.js
var subset_transform_name = "subset",subset_transform_dependencies = ["typed", "matrix"];var createSubsetTransform = factory("subset", subset_transform_dependencies, (_ref) => {var { typed, matrix } = _ref,subset = createSubset({ typed, matrix });return typed("subset", { "...any": function (args) {try {return subset.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/index.transform.js
var index_transform_name = "index",index_transform_dependencies = ["Index"];var createIndexTransform = factory("index", index_transform_dependencies, (_ref) => {var { Index } = _ref;return function () {for (var arg, args = [], i = 0, ii = arguments.length; i < ii; i++) {if (arg = arguments[i], isRange(arg)) arg.start--, arg.end -= 0 < arg.step ? 0 : 2;else if (arg && !0 === arg.isSet) arg = arg.map(function (v) {return v - 1;});else if (isArray(arg) || isMatrix(arg)) arg = arg.map(function (v) {return v - 1;});else if (isNumber(arg)) arg--;else if (isBigNumber(arg)) arg = arg.toNumber() - 1;else if ("string" == typeof arg) ;else throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");args[i] = arg;}var res = new Index();return Index.apply(res, args), res;};}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/concat.transform.js
var concat_transform_name = "concat",concat_transform_dependencies = ["typed", "matrix", "isInteger"];var createConcatTransform = factory("concat", concat_transform_dependencies, (_ref) => {var { typed, matrix, isInteger } = _ref,concat = createConcat({ typed, matrix, isInteger });return typed("concat", { "...any": function (args) {var lastIndex = args.length - 1,last = args[lastIndex];isNumber(last) ? args[lastIndex] = last - 1 : isBigNumber(last) && (args[lastIndex] = last.minus(1));try {return concat.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js
function lastDimToZeroBase(args) {if (2 === args.length && isCollection(args[0])) {args = args.slice();var dim = args[1];isNumber(dim) ? args[1] = dim - 1 : isBigNumber(dim) && (args[1] = dim.minus(1));}return args;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/max.transform.js
var max_transform_name = "max",max_transform_dependencies = ["typed", "config", "numeric", "larger"];var createMaxTransform = factory("max", max_transform_dependencies, (_ref) => {var { typed, config, numeric, larger } = _ref,max = createMax({ typed, config, numeric, larger });return typed("max", { "...any": function (args) {args = lastDimToZeroBase(args);try {return max.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/min.transform.js
var min_transform_name = "min",min_transform_dependencies = ["typed", "config", "numeric", "smaller"];var createMinTransform = factory("min", min_transform_dependencies, (_ref) => {var { typed, config, numeric, smaller } = _ref,min = createMin({ typed, config, numeric, smaller });return typed("min", { "...any": function (args) {args = lastDimToZeroBase(args);try {return min.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/sum.transform.js
var sum_transform_name = "sum",sum_transform_dependencies = ["typed", "config", "add", "numeric"];var createSumTransform = factory("sum", sum_transform_dependencies, (_ref) => {var { typed, config, add, numeric } = _ref,sum = createSum({ typed, config, add, numeric });return typed(sum_transform_name, { "...any": function (args) {args = lastDimToZeroBase(args);try {return sum.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/column.transform.js
var column_transform_name = "column",column_transform_dependencies = ["typed", "Index", "matrix", "range"];var createColumnTransform = factory("column", column_transform_dependencies, (_ref) => {var { typed, Index, matrix, range } = _ref,column = createColumn({ typed, Index, matrix, range });return typed("column", { "...any": function (args) {var lastIndex = args.length - 1,last = args[lastIndex];isNumber(last) && (args[lastIndex] = last - 1);try {return column.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/range.transform.js
var range_transform_name = "range",range_transform_dependencies = ["typed", "config", "?matrix", "?bignumber", "smaller", "smallerEq", "larger", "largerEq"];var createRangeTransform = factory("range", range_transform_dependencies, (_ref) => {var { typed, config, matrix, bignumber, smaller, smallerEq, larger, largerEq } = _ref,range = createRange({ typed, config, matrix, bignumber, smaller, smallerEq, larger, largerEq });return typed("range", { "...any": function (args) {var lastIndex = args.length - 1,last = args[lastIndex];return "boolean" != typeof last && args.push(!0), range.apply(null, args);} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/diff.transform.js
var diff_transform_name = "diff",diff_transform_dependencies = ["typed", "matrix", "subtract", "number", "bignumber"];var createDiffTransform = factory("diff", diff_transform_dependencies, (_ref) => {var { typed, matrix, subtract, number, bignumber } = _ref,diff = createDiff({ typed, matrix, subtract, number, bignumber });return typed(diff_transform_name, { "...any": function (args) {args = lastDimToZeroBase(args);try {return diff.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/row.transform.js
var row_transform_name = "row",row_transform_dependencies = ["typed", "Index", "matrix", "range"];var createRowTransform = factory("row", row_transform_dependencies, (_ref) => {var { typed, Index, matrix, range } = _ref,row = createRow({ typed, Index, matrix, range });return typed("row", { "...any": function (args) {var lastIndex = args.length - 1,last = args[lastIndex];isNumber(last) && (args[lastIndex] = last - 1);try {return row.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/mean.transform.js
var mean_transform_name = "mean",mean_transform_dependencies = ["typed", "add", "divide"];var createMeanTransform = factory("mean", mean_transform_dependencies, (_ref) => {var { typed, add, divide } = _ref,mean = createMean({ typed, add, divide });return typed("mean", { "...any": function (args) {args = lastDimToZeroBase(args);try {return mean.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/variance.transform.js
var variance_transform_name = "variance",variance_transform_dependencies = ["typed", "add", "subtract", "multiply", "divide", "apply", "isNaN"];var createVarianceTransform = factory("variance", variance_transform_dependencies, (_ref) => {var { typed, add, subtract, multiply, divide, apply, isNaN } = _ref,variance = createVariance({ typed, add, subtract, multiply, divide, apply, isNaN });return typed(variance_transform_name, { "...any": function (args) {args = lastDimToZeroBase(args);try {return variance.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/expression/transform/std.transform.js
var std_transform_name = "std",std_transform_dependencies = ["typed", "sqrt", "variance"];var createStdTransform = factory("std", std_transform_dependencies, (_ref) => {var { typed, sqrt, variance } = _ref,std = createStd({ typed, sqrt, variance });return typed("std", { "...any": function (args) {args = lastDimToZeroBase(args);try {return std.apply(null, args);} catch (err) {throw errorTransform(err);}} });}, { isTransformFunction: !0 });
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/impureFunctionsAny.generated.js
var math = {},mathWithTransform = {},classes = {};var Node = createNode({ mathWithTransform });var ArrayNode = createArrayNode({ Node });var BlockNode = createBlockNode({ Node, ResultSet: ResultSet });var ConstantNode = createConstantNode({ Node });var ObjectNode = createObjectNode({ Node });var ParenthesisNode = createParenthesisNode({ Node });var RelationalNode = createRelationalNode({ Node });var Chain = createChainClass({ math });var reviver = createReviver({ classes });var ConditionalNode = createConditionalNode({ Node });var OperatorNode = createOperatorNode({ Node });var RangeNode = createRangeNode({ Node });var FunctionAssignmentNode = createFunctionAssignmentNode({ Node, typed: typed });var chain = createChain({ Chain, typed: typed });var AccessorNode = createAccessorNode({ Node, subset: subset });var IndexNode = createIndexNode({ Node, Range: Range, size: size });var AssignmentNode = createAssignmentNode({ matrix: matrix, Node, subset: subset });var SymbolNode = createSymbolNode({ Unit: Unit, Node, math });var FunctionNode = createFunctionNode({ Node, SymbolNode, math });var parse = createParse({ AccessorNode, ArrayNode, AssignmentNode, BlockNode, ConditionalNode, ConstantNode, FunctionAssignmentNode, FunctionNode, IndexNode, ObjectNode, OperatorNode, ParenthesisNode, RangeNode, RelationalNode, SymbolNode, config: config, numeric: numeric, typed: typed });var evaluate = createEvaluate({ parse, typed: typed });var Help = createHelpClass({ parse });var Parser = createParserClass({ parse });var help = createHelp({ Help, mathWithTransform, typed: typed });var compile = createCompile({ parse, typed: typed });var simplify = createSimplify({ bignumber: bignumber, fraction: pureFunctionsAny_generated_fraction, ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, add: add, config: config, divide: divide, equal: equal, isZero: isZero, mathWithTransform, multiply: multiply, parse, pow: pow, subtract: subtract, typed: typed });var rationalize = createRationalize({ bignumber: bignumber, fraction: pureFunctionsAny_generated_fraction, ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, add: add, config: config, divide: divide, equal: equal, isZero: isZero, mathWithTransform, multiply: multiply, parse, pow: pow, simplify, subtract: subtract, typed: typed });var parser = createParser({ Parser, typed: typed });var derivative = createDerivative({ ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, config: config, equal: equal, isZero: isZero, numeric: numeric, parse, simplify, typed: typed });helpers_extends(math, { reviver, false: _false, null: _null, true: _true, replacer: replacer, i: i, LN10: LN10, LOG10E: LOG10E, NaN: _NaN, pi: pureFunctionsAny_generated_pi, SQRT1_2: SQRT1_2, tau: pureFunctionsAny_generated_tau, efimovFactor: efimovFactor, fineStructure: fineStructure, sackurTetrode: sackurTetrode, weakMixingAngle: weakMixingAngle, e: pureFunctionsAny_generated_e, Infinity: _Infinity, LOG2E: LOG2E, PI: pureFunctionsAny_generated_pi, version: pureFunctionsAny_generated_version, E: pureFunctionsAny_generated_e, phi: pureFunctionsAny_generated_phi, typed: typed, isInteger: pureFunctionsAny_generated_isInteger, isNumeric: isNumeric, isPositive: isPositive, isNaN: pureFunctionsAny_generated_isNaN, equalScalar: equalScalar, number: number, boolean: pureFunctionsAny_generated_boolean, complex: pureFunctionsAny_generated_complex, splitUnit: splitUnit, unaryPlus: unaryPlus, apply: apply, cube: cube, expm1: pureFunctionsAny_generated_expm1, log10: pureFunctionsAny_generated_log10, multiplyScalar: multiplyScalar, sign: pureFunctionsAny_generated_sign, square: square, bitNot: bitNot, arg: arg, im: im, not: not, filter: pureFunctionsAny_generated_filter, forEach: pureFunctionsAny_generated_forEach, map: pureFunctionsAny_generated_map, erf: erf, format: pureFunctionsAny_generated_format, oct: oct, print: print, isPrime: isPrime, acos: acos, acot: acot, acsc: acsc, asec: asec, asin: asin, atan: atan, atanh: pureFunctionsAny_generated_atanh, cosh: pureFunctionsAny_generated_cosh, coth: coth, csch: csch, sech: sech, sinh: pureFunctionsAny_generated_sinh, tanh: pureFunctionsAny_generated_tanh, chain, combinations: combinations, pickRandom: pickRandom, randomInt: randomInt, LN2: LN2, clone: pureFunctionsAny_generated_clone, hasNumericValue: hasNumericValue, typeOf: pureFunctionsAny_generated_typeOf, string: string, fraction: pureFunctionsAny_generated_fraction, unaryMinus: unaryMinus, addScalar: addScalar, exp: exp, log2: pureFunctionsAny_generated_log2, sqrt: sqrt, conj: conj, getMatrixDataType: getMatrixDataType, mode: mode, bin: bin, acosh: pureFunctionsAny_generated_acosh, acsch: acsch, asinh: pureFunctionsAny_generated_asinh, cos: cos, csc: csc, sin: sin, combinationsWithRep: combinationsWithRep, random: random, SQRT2: SQRT2, isNegative: isNegative, matrix: matrix, abs: abs, gcd: gcd, mod: mod, nthRoot: nthRoot, xgcd: xgcd, bitAnd: bitAnd, bitXor: pureFunctionsAny_generated_bitXor, or: or, concat: concat, diag: diag, identity: identity, ones: ones, reshape: pureFunctionsAny_generated_reshape, size: size, subset: subset, zeros: pureFunctionsAny_generated_zeros, hex: hex, round: round, leftShift: leftShift, rightLogShift: rightLogShift, compare: compare, compareText: pureFunctionsAny_generated_compareText, smaller: smaller, larger: larger, unequal: unequal, sparse: sparse, acoth: acoth, atan2: atan2, sec: sec, add: add, dot: dot, composition: composition, isZero: isZero, matrixFromFunction: matrixFromFunction, cbrt: pureFunctionsAny_generated_cbrt, floor: floor, multiply: multiply, dotMultiply: dotMultiply, re: re, flatten: pureFunctionsAny_generated_flatten, resize: pureFunctionsAny_generated_resize, squeeze: pureFunctionsAny_generated_squeeze, to: to, pow: pow, dotPow: dotPow, rightArithShift: rightArithShift, compareNatural: compareNatural, equalText: equalText, largerEq: largerEq, partitionSelect: partitionSelect, asech: asech, tan: tan, setDifference: setDifference, setIntersect: setIntersect, setMultiplicity: setMultiplicity, setSize: setSize, trace: trace, quantileSeq: quantileSeq, gamma: gamma, bignumber: bignumber, matrixFromColumns: matrixFromColumns, lcm: lcm, bitOr: bitOr, kron: kron, transpose: transpose, numeric: numeric, and: and, smallerEq: smallerEq, sort: sort, min: min, cot: cot, setDistinct: setDistinct, setPowerset: setPowerset, index: index, sum: sum, factorial: factorial, permutations: permutations, matrixFromRows: matrixFromRows, subtract: subtract, cross: cross, range: range, row: row, prod: prod, equal: equal, max: max, setCartesian: setCartesian, setSymDifference: setSymDifference, ceil: ceil, xor: xor, count: count, ctranspose: ctranspose, deepEqual: deepEqual, setIsSubset: setIsSubset, fix: fix, diff: diff, divideScalar: divideScalar, nthRoots: nthRoots, lsolve: lsolve, lsolveAll: lsolveAll, setUnion: setUnion, lup: lup, slu: slu, det: det, distance: distance, stirlingS2: stirlingS2, catalan: catalan, column: column, log: log, dotDivide: dotDivide, usolveAll: usolveAll, hypot: hypot, qr: qr, inv: inv, expm: expm, divide: divide, mean: mean, variance: variance, kldivergence: kldivergence, bellNumbers: bellNumbers, log1p: pureFunctionsAny_generated_log1p, createUnit: createUnit, eigs: eigs, intersect: intersect, std: std, atomicMass: atomicMass, bohrMagneton: bohrMagneton, boltzmann: boltzmann, conductanceQuantum: conductanceQuantum, deuteronMass: deuteronMass, electronMass: electronMass, faraday: faraday, firstRadiation: firstRadiation, gravitationConstant: gravitationConstant, hartreeEnergy: hartreeEnergy, klitzing: klitzing, magneticConstant: magneticConstant, molarMass: molarMass, molarPlanckConstant: molarPlanckConstant, neutronMass: neutronMass, planckCharge: planckCharge, planckLength: planckLength, planckTemperature: planckTemperature, protonMass: protonMass, reducedPlanckConstant: reducedPlanckConstant, secondRadiation: secondRadiation, stefanBoltzmann: stefanBoltzmann, vacuumImpedance: vacuumImpedance, usolve: usolve, norm: norm, lusolve: lusolve, sqrtm: sqrtm, multinomial: multinomial, avogadro: avogadro, classicalElectronRadius: classicalElectronRadius, electricConstant: electricConstant, fermiCoupling: fermiCoupling, gravity: gravity, loschmidt: loschmidt, molarMassC12: molarMassC12, nuclearMagneton: nuclearMagneton, planckMass: planckMass, quantumOfCirculation: quantumOfCirculation, speedOfLight: speedOfLight, wienDisplacement: wienDisplacement, rotationMatrix: rotationMatrix, median: median, bohrRadius: bohrRadius, elementaryCharge: elementaryCharge, inverseConductanceQuantum: inverseConductanceQuantum, molarVolume: molarVolume, planckTime: planckTime, thomsonCrossSection: thomsonCrossSection, rotate: rotate, parse, evaluate, mad: mad, coulomb: coulomb, magneticFluxQuantum: magneticFluxQuantum, rydberg: rydberg, unit: unit, help, gasConstant: gasConstant, compile, simplify, rationalize, parser, planckConstant: planckConstant, derivative, config: config }), helpers_extends(mathWithTransform, math, { apply: createApplyTransform({ isInteger: pureFunctionsAny_generated_isInteger, typed: typed }), filter: createFilterTransform({ typed: typed }), map: createMapTransform({ typed: typed }), forEach: createForEachTransform({ typed: typed }), subset: createSubsetTransform({ matrix: matrix, typed: typed }), index: createIndexTransform({ Index: Index }), concat: createConcatTransform({ isInteger: pureFunctionsAny_generated_isInteger, matrix: matrix, typed: typed }), max: createMaxTransform({ config: config, larger: larger, numeric: numeric, typed: typed }), min: createMinTransform({ config: config, numeric: numeric, smaller: smaller, typed: typed }), sum: createSumTransform({ add: add, config: config, numeric: numeric, typed: typed }), column: createColumnTransform({ Index: Index, matrix: matrix, range: range, typed: typed }), range: createRangeTransform({ bignumber: bignumber, matrix: matrix, config: config, larger: larger, largerEq: largerEq, smaller: smaller, smallerEq: smallerEq, typed: typed }), diff: createDiffTransform({ bignumber: bignumber, matrix: matrix, number: number, subtract: subtract, typed: typed }), row: createRowTransform({ Index: Index, matrix: matrix, range: range, typed: typed }), mean: createMeanTransform({ add: add, divide: divide, typed: typed }), variance: createVarianceTransform({ add: add, apply: apply, divide: divide, isNaN: pureFunctionsAny_generated_isNaN, multiply: multiply, subtract: subtract, typed: typed }), std: createStdTransform({ sqrt: sqrt, typed: typed, variance: variance }) }), helpers_extends(classes, { ResultSet: ResultSet, Complex: Complex, Range: Range, Node, ArrayNode, BlockNode, ConstantNode, ObjectNode, ParenthesisNode, RelationalNode, Chain, BigNumber: BigNumber, Matrix: Matrix, ConditionalNode, OperatorNode, Fraction: Fraction, RangeNode, DenseMatrix: DenseMatrix, FunctionAssignmentNode, SparseMatrix: SparseMatrix, ImmutableDenseMatrix: ImmutableDenseMatrix, FibonacciHeap: FibonacciHeap, AccessorNode, IndexNode, Index: Index, AssignmentNode, Spa: Spa, Unit: Unit, SymbolNode, FunctionNode, Help, Parser }), Chain.createProxy(math);
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/typeChecks.js

;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigNumberClass.generated.js
var BigNumberDependencies = { createBigNumberClass: createBigNumberClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplexClass.generated.js
var ComplexDependencies = { createComplexClass: createComplexClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixClass.generated.js
var MatrixDependencies = { createMatrixClass: createMatrixClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js
var DenseMatrixDependencies = { MatrixDependencies: MatrixDependencies, createDenseMatrixClass: createDenseMatrixClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFractionClass.generated.js
var FractionDependencies = { createFractionClass: createFractionClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTyped.generated.js
var typedDependencies = { BigNumberDependencies: BigNumberDependencies, ComplexDependencies: ComplexDependencies, DenseMatrixDependencies: DenseMatrixDependencies, FractionDependencies: FractionDependencies, createTyped: createTyped };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResultSet.generated.js
var ResultSetDependencies = { createResultSet: createResultSet };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeClass.generated.js
var RangeDependencies = { createRangeClass: createRangeClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClone.generated.js
var cloneDependencies = { typedDependencies: typedDependencies, createClone: createClone };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsInteger.generated.js
var isIntegerDependencies = { typedDependencies: typedDependencies, createIsInteger: createIsInteger };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNegative.generated.js
var isNegativeDependencies = { typedDependencies: typedDependencies, createIsNegative: createIsNegative };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNumeric.generated.js
var isNumericDependencies = { typedDependencies: typedDependencies, createIsNumeric: createIsNumeric };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHasNumericValue.generated.js
var hasNumericValueDependencies = { isNumericDependencies: isNumericDependencies, typedDependencies: typedDependencies, createHasNumericValue: createHasNumericValue };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPositive.generated.js
var isPositiveDependencies = { typedDependencies: typedDependencies, createIsPositive: createIsPositive };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsZero.generated.js
var isZeroDependencies = { typedDependencies: typedDependencies, createIsZero: createIsZero };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNaN.generated.js
var isNaNDependencies = { typedDependencies: typedDependencies, createIsNaN: createIsNaN };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTypeOf.generated.js
var typeOfDependencies = { typedDependencies: typedDependencies, createTypeOf: createTypeOf };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualScalar.generated.js
var equalScalarDependencies = { typedDependencies: typedDependencies, createEqualScalar: createEqualScalar };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js
var SparseMatrixDependencies = { MatrixDependencies: MatrixDependencies, equalScalarDependencies: equalScalarDependencies, typedDependencies: typedDependencies, createSparseMatrixClass: createSparseMatrixClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumber.generated.js
var numberDependencies = { typedDependencies: typedDependencies, createNumber: createNumber };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesString.generated.js
var stringDependencies = { typedDependencies: typedDependencies, createString: createString };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoolean.generated.js
var booleanDependencies = { typedDependencies: typedDependencies, createBoolean: createBoolean };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBignumber.generated.js
var bignumberDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createBignumber: createBignumber };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplex.generated.js
var complexDependencies = { ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createComplex: createComplex };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFraction.generated.js
var fractionDependencies = { FractionDependencies: FractionDependencies, typedDependencies: typedDependencies, createFraction: createFraction };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrix.generated.js
var matrixDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, MatrixDependencies: MatrixDependencies, SparseMatrixDependencies: SparseMatrixDependencies, typedDependencies: typedDependencies, createMatrix: createMatrix };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js
var matrixFromFunctionDependencies = { isZeroDependencies: isZeroDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createMatrixFromFunction: createMatrixFromFunction };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFlatten.generated.js
var flattenDependencies = { matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createFlatten: createFlatten };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSize.generated.js
var sizeDependencies = { matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createSize: createSize };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js
var matrixFromRowsDependencies = { flattenDependencies: flattenDependencies, matrixDependencies: matrixDependencies, sizeDependencies: sizeDependencies, typedDependencies: typedDependencies, createMatrixFromRows: createMatrixFromRows };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js
var matrixFromColumnsDependencies = { flattenDependencies: flattenDependencies, matrixDependencies: matrixDependencies, sizeDependencies: sizeDependencies, typedDependencies: typedDependencies, createMatrixFromColumns: createMatrixFromColumns };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSplitUnit.generated.js
var splitUnitDependencies = { typedDependencies: typedDependencies, createSplitUnit: createSplitUnit };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryMinus.generated.js
var unaryMinusDependencies = { typedDependencies: typedDependencies, createUnaryMinus: createUnaryMinus };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryPlus.generated.js
var unaryPlusDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createUnaryPlus: createUnaryPlus };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAbs.generated.js
var absDependencies = { typedDependencies: typedDependencies, createAbs: createAbs };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesApply.generated.js
var applyDependencies = { isIntegerDependencies: isIntegerDependencies, typedDependencies: typedDependencies, createApply: createApply };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAddScalar.generated.js
var addScalarDependencies = { typedDependencies: typedDependencies, createAddScalar: createAddScalar };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCbrt.generated.js
var cbrtDependencies = { BigNumberDependencies: BigNumberDependencies, ComplexDependencies: ComplexDependencies, FractionDependencies: FractionDependencies, isNegativeDependencies: isNegativeDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, unaryMinusDependencies: unaryMinusDependencies, createCbrt: createCbrt };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeros.generated.js
var zerosDependencies = { BigNumberDependencies: BigNumberDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createZeros: createZeros };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRound.generated.js
var roundDependencies = { BigNumberDependencies: BigNumberDependencies, DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, zerosDependencies: zerosDependencies, createRound: createRound };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCeil.generated.js
var ceilDependencies = { equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, roundDependencies: roundDependencies, typedDependencies: typedDependencies, createCeil: createCeil };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCube.generated.js
var cubeDependencies = { typedDependencies: typedDependencies, createCube: createCube };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExp.generated.js
var expDependencies = { typedDependencies: typedDependencies, createExp: createExp };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm1.generated.js
var expm1Dependencies = { ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createExpm1: createExpm1 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFloor.generated.js
var floorDependencies = { equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, roundDependencies: roundDependencies, typedDependencies: typedDependencies, createFloor: createFloor };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFix.generated.js
var fixDependencies = { ComplexDependencies: ComplexDependencies, ceilDependencies: ceilDependencies, floorDependencies: floorDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createFix: createFix };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGcd.generated.js
var gcdDependencies = { BigNumberDependencies: BigNumberDependencies, DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createGcd: createGcd };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLcm.generated.js
var lcmDependencies = { equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createLcm: createLcm };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog10.generated.js
var log10Dependencies = { ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createLog10: createLog10 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog2.generated.js
var log2Dependencies = { ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createLog2: createLog2 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMod.generated.js
var modDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createMod: createMod };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js
var multiplyScalarDependencies = { typedDependencies: typedDependencies, createMultiplyScalar: createMultiplyScalar };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConj.generated.js
var conjDependencies = { typedDependencies: typedDependencies, createConj: createConj };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDot.generated.js
var dotDependencies = { addScalarDependencies: addScalarDependencies, conjDependencies: conjDependencies, multiplyScalarDependencies: multiplyScalarDependencies, sizeDependencies: sizeDependencies, typedDependencies: typedDependencies, createDot: createDot };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiply.generated.js
var multiplyDependencies = { addScalarDependencies: addScalarDependencies, dotDependencies: dotDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, typedDependencies: typedDependencies, createMultiply: createMultiply };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoot.generated.js
var nthRootDependencies = { BigNumberDependencies: BigNumberDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createNthRoot: createNthRoot };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSign.generated.js
var signDependencies = { BigNumberDependencies: BigNumberDependencies, FractionDependencies: FractionDependencies, complexDependencies: complexDependencies, typedDependencies: typedDependencies, createSign: createSign };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrt.generated.js
var sqrtDependencies = { ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createSqrt: createSqrt };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSquare.generated.js
var squareDependencies = { typedDependencies: typedDependencies, createSquare: createSquare };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtract.generated.js
var subtractDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, addScalarDependencies: addScalarDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, unaryMinusDependencies: unaryMinusDependencies, createSubtract: createSubtract };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXgcd.generated.js
var xgcdDependencies = { BigNumberDependencies: BigNumberDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createXgcd: createXgcd };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotMultiply.generated.js
var dotMultiplyDependencies = { equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, typedDependencies: typedDependencies, createDotMultiply: createDotMultiply };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAnd.generated.js
var bitAndDependencies = { equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createBitAnd: createBitAnd };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitNot.generated.js
var bitNotDependencies = { typedDependencies: typedDependencies, createBitNot: createBitNot };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOr.generated.js
var bitOrDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createBitOr: createBitOr };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js
var bitXorDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createBitXor: createBitXor };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArg.generated.js
var argDependencies = { typedDependencies: typedDependencies, createArg: createArg };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIm.generated.js
var imDependencies = { typedDependencies: typedDependencies, createIm: createIm };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRe.generated.js
var reDependencies = { typedDependencies: typedDependencies, createRe: createRe };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNot.generated.js
var notDependencies = { typedDependencies: typedDependencies, createNot: createNot };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOr.generated.js
var orDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createOr: createOr };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js
var xorDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createXor: createXor };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcat.generated.js
var concatDependencies = { isIntegerDependencies: isIntegerDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createConcat: createConcat };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js
var smallerDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createSmaller: createSmaller };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js
var ImmutableDenseMatrixDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, smallerDependencies: smallerDependencies, createImmutableDenseMatrixClass: createImmutableDenseMatrixClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexClass.generated.js
var IndexDependencies = { ImmutableDenseMatrixDependencies: ImmutableDenseMatrixDependencies, createIndexClass: createIndexClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js
var largerDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createLarger: createLarger };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js
var largerEqDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createLargerEq: createLargerEq };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js
var smallerEqDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createSmallerEq: createSmallerEq };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRange.generated.js
var rangeDependencies = { bignumberDependencies: bignumberDependencies, matrixDependencies: matrixDependencies, largerDependencies: largerDependencies, largerEqDependencies: largerEqDependencies, smallerDependencies: smallerDependencies, smallerEqDependencies: smallerEqDependencies, typedDependencies: typedDependencies, createRange: createRange };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumn.generated.js
var columnDependencies = { IndexDependencies: IndexDependencies, matrixDependencies: matrixDependencies, rangeDependencies: rangeDependencies, typedDependencies: typedDependencies, createColumn: createColumn };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumeric.generated.js
var numericDependencies = { bignumberDependencies: bignumberDependencies, fractionDependencies: fractionDependencies, numberDependencies: numberDependencies, createNumeric: createNumeric };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProd.generated.js
var prodDependencies = { multiplyScalarDependencies: multiplyScalarDependencies, numericDependencies: numericDependencies, typedDependencies: typedDependencies, createProd: createProd };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCount.generated.js
var countDependencies = { prodDependencies: prodDependencies, sizeDependencies: sizeDependencies, typedDependencies: typedDependencies, createCount: createCount };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCross.generated.js
var crossDependencies = { matrixDependencies: matrixDependencies, multiplyDependencies: multiplyDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createCross: createCross };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiag.generated.js
var diagDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, SparseMatrixDependencies: SparseMatrixDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createDiag: createDiag };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilter.generated.js
var filterDependencies = { typedDependencies: typedDependencies, createFilter: createFilter };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEach.generated.js
var forEachDependencies = { typedDependencies: typedDependencies, createForEach: createForEach };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js
var getMatrixDataTypeDependencies = { typedDependencies: typedDependencies, createGetMatrixDataType: createGetMatrixDataType };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIdentity.generated.js
var identityDependencies = { BigNumberDependencies: BigNumberDependencies, DenseMatrixDependencies: DenseMatrixDependencies, SparseMatrixDependencies: SparseMatrixDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createIdentity: createIdentity };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKron.generated.js
var kronDependencies = { matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, typedDependencies: typedDependencies, createKron: createKron };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMap.generated.js
var mapDependencies = { typedDependencies: typedDependencies, createMap: map_createMap };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiff.generated.js
var diffDependencies = { matrixDependencies: matrixDependencies, numberDependencies: numberDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createDiff: createDiff };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOnes.generated.js
var onesDependencies = { BigNumberDependencies: BigNumberDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createOnes: createOnes };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReshape.generated.js
var reshapeDependencies = { isIntegerDependencies: isIntegerDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createReshape: createReshape };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResize.generated.js
var resizeDependencies = { matrixDependencies: matrixDependencies, createResize: createResize };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCos.generated.js
var cosDependencies = { typedDependencies: typedDependencies, createCos: createCos };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAdd.generated.js
var addDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, SparseMatrixDependencies: SparseMatrixDependencies, addScalarDependencies: addScalarDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createAdd: createAdd };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTranspose.generated.js
var transposeDependencies = { matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createTranspose: createTranspose };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCtranspose.generated.js
var ctransposeDependencies = { conjDependencies: conjDependencies, transposeDependencies: transposeDependencies, typedDependencies: typedDependencies, createCtranspose: createCtranspose };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan.generated.js
var atanDependencies = { typedDependencies: typedDependencies, createAtan: createAtan };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivideScalar.generated.js
var divideScalarDependencies = { numericDependencies: numericDependencies, typedDependencies: typedDependencies, createDivideScalar: createDivideScalar };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js
var equalDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createEqual: createEqual };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js
var FibonacciHeapDependencies = { largerDependencies: largerDependencies, smallerDependencies: smallerDependencies, createFibonacciHeapClass: createFibonacciHeapClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpaClass.generated.js
var SpaDependencies = { FibonacciHeapDependencies: FibonacciHeapDependencies, addScalarDependencies: addScalarDependencies, equalScalarDependencies: equalScalarDependencies, createSpaClass: createSpaClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLup.generated.js
var lupDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, SpaDependencies: SpaDependencies, SparseMatrixDependencies: SparseMatrixDependencies, absDependencies: absDependencies, addScalarDependencies: addScalarDependencies, divideScalarDependencies: divideScalarDependencies, equalScalarDependencies: equalScalarDependencies, largerDependencies: largerDependencies, matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, unaryMinusDependencies: unaryMinusDependencies, createLup: createLup };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDet.generated.js
var detDependencies = { lupDependencies: lupDependencies, matrixDependencies: matrixDependencies, multiplyDependencies: multiplyDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, unaryMinusDependencies: unaryMinusDependencies, createDet: createDet };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInv.generated.js
var invDependencies = { absDependencies: absDependencies, addScalarDependencies: addScalarDependencies, detDependencies: detDependencies, divideScalarDependencies: divideScalarDependencies, identityDependencies: identityDependencies, matrixDependencies: matrixDependencies, multiplyDependencies: multiplyDependencies, typedDependencies: typedDependencies, unaryMinusDependencies: unaryMinusDependencies, createInv: createInv };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQr.generated.js
var qrDependencies = { addScalarDependencies: addScalarDependencies, complexDependencies: complexDependencies, conjDependencies: conjDependencies, divideScalarDependencies: divideScalarDependencies, equalDependencies: equalDependencies, identityDependencies: identityDependencies, isZeroDependencies: isZeroDependencies, matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, signDependencies: signDependencies, sqrtDependencies: sqrtDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, unaryMinusDependencies: unaryMinusDependencies, zerosDependencies: zerosDependencies, createQr: createQr };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSin.generated.js
var sinDependencies = { typedDependencies: typedDependencies, createSin: createSin };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolveAll.generated.js
var usolveAllDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, divideScalarDependencies: divideScalarDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createUsolveAll: createUsolveAll };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js
var eigsDependencies = { absDependencies: absDependencies, addDependencies: addDependencies, addScalarDependencies: addScalarDependencies, atanDependencies: atanDependencies, bignumberDependencies: bignumberDependencies, columnDependencies: columnDependencies, complexDependencies: complexDependencies, cosDependencies: cosDependencies, diagDependencies: diagDependencies, divideScalarDependencies: divideScalarDependencies, equalDependencies: equalDependencies, flattenDependencies: flattenDependencies, imDependencies: imDependencies, invDependencies: invDependencies, largerDependencies: largerDependencies, log10Dependencies: log10Dependencies, matrixDependencies: matrixDependencies, matrixFromColumnsDependencies: matrixFromColumnsDependencies, multiplyDependencies: multiplyDependencies, multiplyScalarDependencies: multiplyScalarDependencies, numberDependencies: numberDependencies, qrDependencies: qrDependencies, reDependencies: reDependencies, roundDependencies: roundDependencies, sinDependencies: sinDependencies, smallerDependencies: smallerDependencies, sqrtDependencies: sqrtDependencies, subtractDependencies: subtractDependencies, transposeDependencies: transposeDependencies, typedDependencies: typedDependencies, usolveAllDependencies: usolveAllDependencies, createEigs: createEigs };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPow.generated.js
var powDependencies = { ComplexDependencies: ComplexDependencies, fractionDependencies: fractionDependencies, identityDependencies: identityDependencies, matrixDependencies: matrixDependencies, multiplyDependencies: multiplyDependencies, numberDependencies: numberDependencies, typedDependencies: typedDependencies, createPow: createPow };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNorm.generated.js
var normDependencies = { absDependencies: absDependencies, addDependencies: addDependencies, conjDependencies: conjDependencies, ctransposeDependencies: ctransposeDependencies, eigsDependencies: eigsDependencies, equalScalarDependencies: equalScalarDependencies, largerDependencies: largerDependencies, matrixDependencies: matrixDependencies, multiplyDependencies: multiplyDependencies, powDependencies: powDependencies, smallerDependencies: smallerDependencies, sqrtDependencies: sqrtDependencies, typedDependencies: typedDependencies, createNorm: createNorm };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotationMatrix.generated.js
var rotationMatrixDependencies = { BigNumberDependencies: BigNumberDependencies, DenseMatrixDependencies: DenseMatrixDependencies, SparseMatrixDependencies: SparseMatrixDependencies, addScalarDependencies: addScalarDependencies, cosDependencies: cosDependencies, matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, normDependencies: normDependencies, sinDependencies: sinDependencies, typedDependencies: typedDependencies, unaryMinusDependencies: unaryMinusDependencies, createRotationMatrix: createRotationMatrix };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotate.generated.js
var rotateDependencies = { multiplyDependencies: multiplyDependencies, rotationMatrixDependencies: rotationMatrixDependencies, typedDependencies: typedDependencies, createRotate: createRotate };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRow.generated.js
var rowDependencies = { IndexDependencies: IndexDependencies, matrixDependencies: matrixDependencies, rangeDependencies: rangeDependencies, typedDependencies: typedDependencies, createRow: createRow };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqueeze.generated.js
var squeezeDependencies = { matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createSqueeze: createSqueeze };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubset.generated.js
var subsetDependencies = { matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createSubset: createSubset };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesErf.generated.js
var erfDependencies = { typedDependencies: typedDependencies, createErf: createErf };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMode.generated.js
var modeDependencies = { isNaNDependencies: isNaNDependencies, isNumericDependencies: isNumericDependencies, typedDependencies: typedDependencies, createMode: createMode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFormat.generated.js
var formatDependencies = { typedDependencies: typedDependencies, createFormat: createFormat };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBin.generated.js
var binDependencies = { formatDependencies: formatDependencies, typedDependencies: typedDependencies, createBin: createBin };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOct.generated.js
var octDependencies = { formatDependencies: formatDependencies, typedDependencies: typedDependencies, createOct: createOct };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHex.generated.js
var hexDependencies = { formatDependencies: formatDependencies, typedDependencies: typedDependencies, createHex: createHex };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrint.generated.js
var printDependencies = { typedDependencies: typedDependencies, createPrint: createPrint };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTo.generated.js
var toDependencies = { matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createTo: createTo };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPrime.generated.js
var isPrimeDependencies = { typedDependencies: typedDependencies, createIsPrime: createIsPrime };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog.generated.js
var logDependencies = { ComplexDependencies: ComplexDependencies, divideScalarDependencies: divideScalarDependencies, typedDependencies: typedDependencies, createLog: createLog };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog1p.generated.js
var log1pDependencies = { ComplexDependencies: ComplexDependencies, divideScalarDependencies: divideScalarDependencies, logDependencies: logDependencies, typedDependencies: typedDependencies, createLog1p: createLog1p };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoots.generated.js
var nthRootsDependencies = { ComplexDependencies: ComplexDependencies, divideScalarDependencies: divideScalarDependencies, typedDependencies: typedDependencies, createNthRoots: createNthRoots };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js
var dotPowDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, powDependencies: powDependencies, typedDependencies: typedDependencies, createDotPow: createDotPow };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js
var dotDivideDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, divideScalarDependencies: divideScalarDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createDotDivide: createDotDivide };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolve.generated.js
var lsolveDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, divideScalarDependencies: divideScalarDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createLsolve: createLsolve };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolve.generated.js
var usolveDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, divideScalarDependencies: divideScalarDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createUsolve: createUsolve };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolveAll.generated.js
var lsolveAllDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, divideScalarDependencies: divideScalarDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, multiplyScalarDependencies: multiplyScalarDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createLsolveAll: createLsolveAll };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeftShift.generated.js
var leftShiftDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, zerosDependencies: zerosDependencies, createLeftShift: createLeftShift };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightArithShift.generated.js
var rightArithShiftDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, zerosDependencies: zerosDependencies, createRightArithShift: createRightArithShift };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightLogShift.generated.js
var rightLogShiftDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, zerosDependencies: zerosDependencies, createRightLogShift: createRightLogShift };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAnd.generated.js
var andDependencies = { equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, notDependencies: notDependencies, typedDependencies: typedDependencies, zerosDependencies: zerosDependencies, createAnd: createAnd };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompare.generated.js
var compareDependencies = { BigNumberDependencies: BigNumberDependencies, DenseMatrixDependencies: DenseMatrixDependencies, FractionDependencies: FractionDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createCompare: createCompare };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareNatural.generated.js
var compareNaturalDependencies = { compareDependencies: compareDependencies, typedDependencies: typedDependencies, createCompareNatural: createCompareNatural };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareText.generated.js
var compareTextDependencies = { matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createCompareText: createCompareText };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualText.generated.js
var equalTextDependencies = { compareTextDependencies: compareTextDependencies, isZeroDependencies: isZeroDependencies, typedDependencies: typedDependencies, createEqualText: createEqualText };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeepEqual.generated.js
var deepEqualDependencies = { equalDependencies: equalDependencies, typedDependencies: typedDependencies, createDeepEqual: createDeepEqual };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js
var unequalDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createUnequal: createUnequal };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPartitionSelect.generated.js
var partitionSelectDependencies = { compareDependencies: compareDependencies, isNaNDependencies: isNaNDependencies, isNumericDependencies: isNumericDependencies, typedDependencies: typedDependencies, createPartitionSelect: createPartitionSelect };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSort.generated.js
var sortDependencies = { compareDependencies: compareDependencies, compareNaturalDependencies: compareNaturalDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createSort: createSort };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMax.generated.js
var maxDependencies = { largerDependencies: largerDependencies, numericDependencies: numericDependencies, typedDependencies: typedDependencies, createMax: createMax };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMin.generated.js
var minDependencies = { numericDependencies: numericDependencies, smallerDependencies: smallerDependencies, typedDependencies: typedDependencies, createMin: createMin };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitClass.generated.js
var UnitDependencies = { BigNumberDependencies: BigNumberDependencies, ComplexDependencies: ComplexDependencies, FractionDependencies: FractionDependencies, absDependencies: absDependencies, addScalarDependencies: addScalarDependencies, divideScalarDependencies: divideScalarDependencies, equalDependencies: equalDependencies, fixDependencies: fixDependencies, formatDependencies: formatDependencies, isNumericDependencies: isNumericDependencies, multiplyScalarDependencies: multiplyScalarDependencies, numberDependencies: numberDependencies, powDependencies: powDependencies, roundDependencies: roundDependencies, subtractDependencies: subtractDependencies, createUnitClass: createUnitClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitFunction.generated.js
var unitDependencies = { UnitDependencies: UnitDependencies, typedDependencies: typedDependencies, createUnitFunction: createUnitFunction };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparse.generated.js
var sparseDependencies = { SparseMatrixDependencies: SparseMatrixDependencies, typedDependencies: typedDependencies, createSparse: createSparse };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCreateUnit.generated.js
var createUnitDependencies = { UnitDependencies: UnitDependencies, typedDependencies: typedDependencies, createCreateUnit: createCreateUnit };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcos.generated.js
var acosDependencies = { ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createAcos: createAcos };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcosh.generated.js
var acoshDependencies = { ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createAcosh: createAcosh };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcot.generated.js
var acotDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createAcot: createAcot };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcoth.generated.js
var acothDependencies = { BigNumberDependencies: BigNumberDependencies, ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createAcoth: createAcoth };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsc.generated.js
var acscDependencies = { BigNumberDependencies: BigNumberDependencies, ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createAcsc: createAcsc };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsch.generated.js
var acschDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createAcsch: createAcsch };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsec.generated.js
var asecDependencies = { BigNumberDependencies: BigNumberDependencies, ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createAsec: createAsec };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsech.generated.js
var asechDependencies = { BigNumberDependencies: BigNumberDependencies, ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createAsech: createAsech };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsin.generated.js
var asinDependencies = { ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createAsin: createAsin };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsinh.generated.js
var asinhDependencies = { typedDependencies: typedDependencies, createAsinh: createAsinh };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan2.generated.js
var atan2Dependencies = { BigNumberDependencies: BigNumberDependencies, DenseMatrixDependencies: DenseMatrixDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createAtan2: createAtan2 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtanh.generated.js
var atanhDependencies = { ComplexDependencies: ComplexDependencies, typedDependencies: typedDependencies, createAtanh: createAtanh };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCosh.generated.js
var coshDependencies = { typedDependencies: typedDependencies, createCosh: createCosh };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCot.generated.js
var cotDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createCot: createCot };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoth.generated.js
var cothDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createCoth: createCoth };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsc.generated.js
var cscDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createCsc: createCsc };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsch.generated.js
var cschDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createCsch: createCsch };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSec.generated.js
var secDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createSec: createSec };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSech.generated.js
var sechDependencies = { BigNumberDependencies: BigNumberDependencies, typedDependencies: typedDependencies, createSech: createSech };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSinh.generated.js
var sinhDependencies = { typedDependencies: typedDependencies, createSinh: createSinh };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTan.generated.js
var tanDependencies = { typedDependencies: typedDependencies, createTan: createTan };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTanh.generated.js
var tanhDependencies = { typedDependencies: typedDependencies, createTanh: createTanh };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetCartesian.generated.js
var setCartesianDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, IndexDependencies: IndexDependencies, compareNaturalDependencies: compareNaturalDependencies, sizeDependencies: sizeDependencies, subsetDependencies: subsetDependencies, typedDependencies: typedDependencies, createSetCartesian: createSetCartesian };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDifference.generated.js
var setDifferenceDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, IndexDependencies: IndexDependencies, compareNaturalDependencies: compareNaturalDependencies, sizeDependencies: sizeDependencies, subsetDependencies: subsetDependencies, typedDependencies: typedDependencies, createSetDifference: createSetDifference };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDistinct.generated.js
var setDistinctDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, IndexDependencies: IndexDependencies, compareNaturalDependencies: compareNaturalDependencies, sizeDependencies: sizeDependencies, subsetDependencies: subsetDependencies, typedDependencies: typedDependencies, createSetDistinct: createSetDistinct };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIntersect.generated.js
var setIntersectDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, IndexDependencies: IndexDependencies, compareNaturalDependencies: compareNaturalDependencies, sizeDependencies: sizeDependencies, subsetDependencies: subsetDependencies, typedDependencies: typedDependencies, createSetIntersect: createSetIntersect };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIsSubset.generated.js
var setIsSubsetDependencies = { IndexDependencies: IndexDependencies, compareNaturalDependencies: compareNaturalDependencies, sizeDependencies: sizeDependencies, subsetDependencies: subsetDependencies, typedDependencies: typedDependencies, createSetIsSubset: createSetIsSubset };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js
var setMultiplicityDependencies = { IndexDependencies: IndexDependencies, compareNaturalDependencies: compareNaturalDependencies, sizeDependencies: sizeDependencies, subsetDependencies: subsetDependencies, typedDependencies: typedDependencies, createSetMultiplicity: createSetMultiplicity };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetPowerset.generated.js
var setPowersetDependencies = { IndexDependencies: IndexDependencies, compareNaturalDependencies: compareNaturalDependencies, sizeDependencies: sizeDependencies, subsetDependencies: subsetDependencies, typedDependencies: typedDependencies, createSetPowerset: createSetPowerset };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSize.generated.js
var setSizeDependencies = { compareNaturalDependencies: compareNaturalDependencies, typedDependencies: typedDependencies, createSetSize: createSetSize };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSymDifference.generated.js
var setSymDifferenceDependencies = { IndexDependencies: IndexDependencies, concatDependencies: concatDependencies, setDifferenceDependencies: setDifferenceDependencies, sizeDependencies: sizeDependencies, subsetDependencies: subsetDependencies, typedDependencies: typedDependencies, createSetSymDifference: createSetSymDifference };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetUnion.generated.js
var setUnionDependencies = { IndexDependencies: IndexDependencies, concatDependencies: concatDependencies, setIntersectDependencies: setIntersectDependencies, setSymDifferenceDependencies: setSymDifferenceDependencies, sizeDependencies: sizeDependencies, subsetDependencies: subsetDependencies, typedDependencies: typedDependencies, createSetUnion: createSetUnion };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHypot.generated.js
var hypotDependencies = { absDependencies: absDependencies, addScalarDependencies: addScalarDependencies, divideScalarDependencies: divideScalarDependencies, isPositiveDependencies: isPositiveDependencies, multiplyScalarDependencies: multiplyScalarDependencies, smallerDependencies: smallerDependencies, sqrtDependencies: sqrtDependencies, typedDependencies: typedDependencies, createHypot: createHypot };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrace.generated.js
var traceDependencies = { addDependencies: addDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createTrace: createTrace };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndex.generated.js
var indexDependencies = { IndexDependencies: IndexDependencies, typedDependencies: typedDependencies, createIndex: createIndex };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNode.generated.js
var NodeDependencies = { createNode: createNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAccessorNode.generated.js
var AccessorNodeDependencies = { NodeDependencies: NodeDependencies, subsetDependencies: subsetDependencies, createAccessorNode: createAccessorNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArrayNode.generated.js
var ArrayNodeDependencies = { NodeDependencies: NodeDependencies, createArrayNode: createArrayNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAssignmentNode.generated.js
var AssignmentNodeDependencies = { matrixDependencies: matrixDependencies, NodeDependencies: NodeDependencies, subsetDependencies: subsetDependencies, createAssignmentNode: createAssignmentNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBlockNode.generated.js
var BlockNodeDependencies = { NodeDependencies: NodeDependencies, ResultSetDependencies: ResultSetDependencies, createBlockNode: createBlockNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConditionalNode.generated.js
var ConditionalNodeDependencies = { NodeDependencies: NodeDependencies, createConditionalNode: createConditionalNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConstantNode.generated.js
var ConstantNodeDependencies = { NodeDependencies: NodeDependencies, createConstantNode: createConstantNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js
var FunctionAssignmentNodeDependencies = { NodeDependencies: NodeDependencies, typedDependencies: typedDependencies, createFunctionAssignmentNode: createFunctionAssignmentNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexNode.generated.js
var IndexNodeDependencies = { NodeDependencies: NodeDependencies, RangeDependencies: RangeDependencies, sizeDependencies: sizeDependencies, createIndexNode: createIndexNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesObjectNode.generated.js
var ObjectNodeDependencies = { NodeDependencies: NodeDependencies, createObjectNode: createObjectNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOperatorNode.generated.js
var OperatorNodeDependencies = { NodeDependencies: NodeDependencies, createOperatorNode: createOperatorNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParenthesisNode.generated.js
var ParenthesisNodeDependencies = { NodeDependencies: NodeDependencies, createParenthesisNode: createParenthesisNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeNode.generated.js
var RangeNodeDependencies = { NodeDependencies: NodeDependencies, createRangeNode: createRangeNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRelationalNode.generated.js
var RelationalNodeDependencies = { NodeDependencies: NodeDependencies, createRelationalNode: createRelationalNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolNode.generated.js
var SymbolNodeDependencies = { UnitDependencies: UnitDependencies, NodeDependencies: NodeDependencies, createSymbolNode: createSymbolNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionNode.generated.js
var FunctionNodeDependencies = { NodeDependencies: NodeDependencies, SymbolNodeDependencies: SymbolNodeDependencies, createFunctionNode: createFunctionNode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParse.generated.js
var parseDependencies = { AccessorNodeDependencies: AccessorNodeDependencies, ArrayNodeDependencies: ArrayNodeDependencies, AssignmentNodeDependencies: AssignmentNodeDependencies, BlockNodeDependencies: BlockNodeDependencies, ConditionalNodeDependencies: ConditionalNodeDependencies, ConstantNodeDependencies: ConstantNodeDependencies, FunctionAssignmentNodeDependencies: FunctionAssignmentNodeDependencies, FunctionNodeDependencies: FunctionNodeDependencies, IndexNodeDependencies: IndexNodeDependencies, ObjectNodeDependencies: ObjectNodeDependencies, OperatorNodeDependencies: OperatorNodeDependencies, ParenthesisNodeDependencies: ParenthesisNodeDependencies, RangeNodeDependencies: RangeNodeDependencies, RelationalNodeDependencies: RelationalNodeDependencies, SymbolNodeDependencies: SymbolNodeDependencies, numericDependencies: numericDependencies, typedDependencies: typedDependencies, createParse: createParse };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompile.generated.js
var compileDependencies = { parseDependencies: parseDependencies, typedDependencies: typedDependencies, createCompile: createCompile };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEvaluate.generated.js
var evaluateDependencies = { parseDependencies: parseDependencies, typedDependencies: typedDependencies, createEvaluate: createEvaluate };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParserClass.generated.js
var ParserDependencies = { parseDependencies: parseDependencies, createParserClass: createParserClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParser.generated.js
var parserDependencies = { ParserDependencies: ParserDependencies, typedDependencies: typedDependencies, createParser: createParser };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSlu.generated.js
var sluDependencies = { SparseMatrixDependencies: SparseMatrixDependencies, absDependencies: absDependencies, addDependencies: addDependencies, divideScalarDependencies: divideScalarDependencies, largerDependencies: largerDependencies, largerEqDependencies: largerEqDependencies, multiplyDependencies: multiplyDependencies, subtractDependencies: subtractDependencies, transposeDependencies: transposeDependencies, typedDependencies: typedDependencies, createSlu: createSlu };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLusolve.generated.js
var lusolveDependencies = { DenseMatrixDependencies: DenseMatrixDependencies, lsolveDependencies: lsolveDependencies, lupDependencies: lupDependencies, matrixDependencies: matrixDependencies, sluDependencies: sluDependencies, typedDependencies: typedDependencies, usolveDependencies: usolveDependencies, createLusolve: createLusolve };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelpClass.generated.js
var HelpDependencies = { parseDependencies: parseDependencies, createHelpClass: createHelpClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChainClass.generated.js
var ChainDependencies = { createChainClass: createChainClass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelp.generated.js
var helpDependencies = { HelpDependencies: HelpDependencies, typedDependencies: typedDependencies, createHelp: createHelp };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChain.generated.js
var chainDependencies = { ChainDependencies: ChainDependencies, typedDependencies: typedDependencies, createChain: createChain };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm.generated.js
var expmDependencies = { absDependencies: absDependencies, addDependencies: addDependencies, identityDependencies: identityDependencies, invDependencies: invDependencies, multiplyDependencies: multiplyDependencies, typedDependencies: typedDependencies, createExpm: createExpm };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrtm.generated.js
var sqrtmDependencies = { absDependencies: absDependencies, addDependencies: addDependencies, identityDependencies: identityDependencies, invDependencies: invDependencies, maxDependencies: maxDependencies, multiplyDependencies: multiplyDependencies, sizeDependencies: sizeDependencies, sqrtDependencies: sqrtDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createSqrtm: createSqrtm };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivide.generated.js
var divideDependencies = { divideScalarDependencies: divideScalarDependencies, equalScalarDependencies: equalScalarDependencies, invDependencies: invDependencies, matrixDependencies: matrixDependencies, multiplyDependencies: multiplyDependencies, typedDependencies: typedDependencies, createDivide: createDivide };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDistance.generated.js
var distanceDependencies = { absDependencies: absDependencies, addScalarDependencies: addScalarDependencies, divideScalarDependencies: divideScalarDependencies, multiplyScalarDependencies: multiplyScalarDependencies, sqrtDependencies: sqrtDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, unaryMinusDependencies: unaryMinusDependencies, createDistance: createDistance };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIntersect.generated.js
var intersectDependencies = { absDependencies: absDependencies, addDependencies: addDependencies, addScalarDependencies: addScalarDependencies, divideScalarDependencies: divideScalarDependencies, equalScalarDependencies: equalScalarDependencies, matrixDependencies: matrixDependencies, multiplyDependencies: multiplyDependencies, multiplyScalarDependencies: multiplyScalarDependencies, smallerDependencies: smallerDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createIntersect: createIntersect };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSum.generated.js
var sumDependencies = { addDependencies: addDependencies, numericDependencies: numericDependencies, typedDependencies: typedDependencies, createSum: createSum };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMean.generated.js
var meanDependencies = { addDependencies: addDependencies, divideDependencies: divideDependencies, typedDependencies: typedDependencies, createMean: createMean };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMedian.generated.js
var medianDependencies = { addDependencies: addDependencies, compareDependencies: compareDependencies, divideDependencies: divideDependencies, partitionSelectDependencies: partitionSelectDependencies, typedDependencies: typedDependencies, createMedian: createMedian };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMad.generated.js
var madDependencies = { absDependencies: absDependencies, mapDependencies: mapDependencies, medianDependencies: medianDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createMad: createMad };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVariance.generated.js
var varianceDependencies = { addDependencies: addDependencies, applyDependencies: applyDependencies, divideDependencies: divideDependencies, isNaNDependencies: isNaNDependencies, multiplyDependencies: multiplyDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createVariance: createVariance };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeq.generated.js
var quantileSeqDependencies = { addDependencies: addDependencies, compareDependencies: compareDependencies, multiplyDependencies: multiplyDependencies, partitionSelectDependencies: partitionSelectDependencies, typedDependencies: typedDependencies, createQuantileSeq: createQuantileSeq };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStd.generated.js
var stdDependencies = { sqrtDependencies: sqrtDependencies, typedDependencies: typedDependencies, varianceDependencies: varianceDependencies, createStd: createStd };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinations.generated.js
var combinationsDependencies = { typedDependencies: typedDependencies, createCombinations: createCombinations };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js
var combinationsWithRepDependencies = { typedDependencies: typedDependencies, createCombinationsWithRep: createCombinationsWithRep };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGamma.generated.js
var gammaDependencies = { BigNumberDependencies: BigNumberDependencies, ComplexDependencies: ComplexDependencies, multiplyScalarDependencies: multiplyScalarDependencies, powDependencies: powDependencies, typedDependencies: typedDependencies, createGamma: createGamma };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFactorial.generated.js
var factorialDependencies = { gammaDependencies: gammaDependencies, typedDependencies: typedDependencies, createFactorial: createFactorial };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKldivergence.generated.js
var kldivergenceDependencies = { divideDependencies: divideDependencies, dotDivideDependencies: dotDivideDependencies, isNumericDependencies: isNumericDependencies, logDependencies: logDependencies, matrixDependencies: matrixDependencies, multiplyDependencies: multiplyDependencies, sumDependencies: sumDependencies, typedDependencies: typedDependencies, createKldivergence: createKldivergence };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultinomial.generated.js
var multinomialDependencies = { addDependencies: addDependencies, divideDependencies: divideDependencies, factorialDependencies: factorialDependencies, isIntegerDependencies: isIntegerDependencies, isPositiveDependencies: isPositiveDependencies, multiplyDependencies: multiplyDependencies, typedDependencies: typedDependencies, createMultinomial: createMultinomial };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPermutations.generated.js
var permutationsDependencies = { factorialDependencies: factorialDependencies, typedDependencies: typedDependencies, createPermutations: createPermutations };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPickRandom.generated.js
var pickRandomDependencies = { typedDependencies: typedDependencies, createPickRandom: createPickRandom };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandom.generated.js
var randomDependencies = { typedDependencies: typedDependencies, createRandom: createRandom };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandomInt.generated.js
var randomIntDependencies = { typedDependencies: typedDependencies, createRandomInt: createRandomInt };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStirlingS2.generated.js
var stirlingS2Dependencies = { addScalarDependencies: addScalarDependencies, combinationsDependencies: combinationsDependencies, divideScalarDependencies: divideScalarDependencies, factorialDependencies: factorialDependencies, isIntegerDependencies: isIntegerDependencies, isNegativeDependencies: isNegativeDependencies, largerDependencies: largerDependencies, multiplyScalarDependencies: multiplyScalarDependencies, powDependencies: powDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createStirlingS2: createStirlingS2 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBellNumbers.generated.js
var bellNumbersDependencies = { addScalarDependencies: addScalarDependencies, isIntegerDependencies: isIntegerDependencies, isNegativeDependencies: isNegativeDependencies, stirlingS2Dependencies: stirlingS2Dependencies, typedDependencies: typedDependencies, createBellNumbers: createBellNumbers };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCatalan.generated.js
var catalanDependencies = { addScalarDependencies: addScalarDependencies, combinationsDependencies: combinationsDependencies, divideScalarDependencies: divideScalarDependencies, isIntegerDependencies: isIntegerDependencies, isNegativeDependencies: isNegativeDependencies, multiplyScalarDependencies: multiplyScalarDependencies, typedDependencies: typedDependencies, createCatalan: createCatalan };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComposition.generated.js
var compositionDependencies = { addScalarDependencies: addScalarDependencies, combinationsDependencies: combinationsDependencies, isIntegerDependencies: isIntegerDependencies, isNegativeDependencies: isNegativeDependencies, isPositiveDependencies: isPositiveDependencies, largerDependencies: largerDependencies, typedDependencies: typedDependencies, createComposition: createComposition };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js
var simplifyDependencies = { bignumberDependencies: bignumberDependencies, fractionDependencies: fractionDependencies, ConstantNodeDependencies: ConstantNodeDependencies, FunctionNodeDependencies: FunctionNodeDependencies, OperatorNodeDependencies: OperatorNodeDependencies, ParenthesisNodeDependencies: ParenthesisNodeDependencies, SymbolNodeDependencies: SymbolNodeDependencies, addDependencies: addDependencies, divideDependencies: divideDependencies, equalDependencies: equalDependencies, isZeroDependencies: isZeroDependencies, multiplyDependencies: multiplyDependencies, parseDependencies: parseDependencies, powDependencies: powDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createSimplify: createSimplify };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDerivative.generated.js
var derivativeDependencies = { ConstantNodeDependencies: ConstantNodeDependencies, FunctionNodeDependencies: FunctionNodeDependencies, OperatorNodeDependencies: OperatorNodeDependencies, ParenthesisNodeDependencies: ParenthesisNodeDependencies, SymbolNodeDependencies: SymbolNodeDependencies, equalDependencies: equalDependencies, isZeroDependencies: isZeroDependencies, numericDependencies: numericDependencies, parseDependencies: parseDependencies, simplifyDependencies: simplifyDependencies, typedDependencies: typedDependencies, createDerivative: createDerivative };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRationalize.generated.js
var rationalizeDependencies = { bignumberDependencies: bignumberDependencies, fractionDependencies: fractionDependencies, ConstantNodeDependencies: ConstantNodeDependencies, FunctionNodeDependencies: FunctionNodeDependencies, OperatorNodeDependencies: OperatorNodeDependencies, ParenthesisNodeDependencies: ParenthesisNodeDependencies, SymbolNodeDependencies: SymbolNodeDependencies, addDependencies: addDependencies, divideDependencies: divideDependencies, equalDependencies: equalDependencies, isZeroDependencies: isZeroDependencies, multiplyDependencies: multiplyDependencies, parseDependencies: parseDependencies, powDependencies: powDependencies, simplifyDependencies: simplifyDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createRationalize: createRationalize };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReviver.generated.js
var reviverDependencies = { createReviver: createReviver };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReplacer.generated.js
var replacerDependencies = { createReplacer: createReplacer };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesE.generated.js
var eDependencies = { BigNumberDependencies: BigNumberDependencies, createE: createE };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercaseE.generated.js
var EDependencies = { eDependencies: eDependencies, createUppercaseE: createUppercaseE };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFalse.generated.js
var falseDependencies = { createFalse: createFalse };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesI.generated.js
var iDependencies = { ComplexDependencies: ComplexDependencies, createI: createI };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInfinity.generated.js
var InfinityDependencies = { BigNumberDependencies: BigNumberDependencies, createInfinity: createInfinity };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN10.generated.js
var LN10Dependencies = { BigNumberDependencies: BigNumberDependencies, createLN10: createLN10 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN2.generated.js
var LN2Dependencies = { BigNumberDependencies: BigNumberDependencies, createLN2: createLN2 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG10E.generated.js
var LOG10EDependencies = { BigNumberDependencies: BigNumberDependencies, createLOG10E: createLOG10E };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG2E.generated.js
var LOG2EDependencies = { BigNumberDependencies: BigNumberDependencies, createLOG2E: createLOG2E };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNaN.generated.js
var NaNDependencies = { BigNumberDependencies: BigNumberDependencies, createNaN: createNaN };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNull.generated.js
var nullDependencies = { createNull: createNull };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPhi.generated.js
var phiDependencies = { BigNumberDependencies: BigNumberDependencies, createPhi: createPhi };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPi.generated.js
var piDependencies = { BigNumberDependencies: BigNumberDependencies, createPi: createPi };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercasePi.generated.js
var PIDependencies = { piDependencies: piDependencies, createUppercasePi: createUppercasePi };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT1_2.generated.js
var SQRT1_2Dependencies = { BigNumberDependencies: BigNumberDependencies, createSQRT1_2: createSQRT1_2 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT2.generated.js
var SQRT2Dependencies = { BigNumberDependencies: BigNumberDependencies, createSQRT2: createSQRT2 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTau.generated.js
var tauDependencies = { BigNumberDependencies: BigNumberDependencies, createTau: createTau };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrue.generated.js
var trueDependencies = { createTrue: createTrue };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVersion.generated.js
var versionDependencies = { createVersion: createVersion };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtomicMass.generated.js
var atomicMassDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createAtomicMass: createAtomicMass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAvogadro.generated.js
var avogadroDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createAvogadro: createAvogadro };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrMagneton.generated.js
var bohrMagnetonDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createBohrMagneton: createBohrMagneton };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrRadius.generated.js
var bohrRadiusDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createBohrRadius: createBohrRadius };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoltzmann.generated.js
var boltzmannDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createBoltzmann: createBoltzmann };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js
var classicalElectronRadiusDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createClassicalElectronRadius: createClassicalElectronRadius };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js
var conductanceQuantumDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createConductanceQuantum: createConductanceQuantum };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulomb.generated.js
var coulombDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createCoulomb: createCoulomb };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeuteronMass.generated.js
var deuteronMassDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createDeuteronMass: createDeuteronMass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEfimovFactor.generated.js
var efimovFactorDependencies = { BigNumberDependencies: BigNumberDependencies, createEfimovFactor: createEfimovFactor };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectricConstant.generated.js
var electricConstantDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createElectricConstant: createElectricConstant };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectronMass.generated.js
var electronMassDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createElectronMass: createElectronMass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElementaryCharge.generated.js
var elementaryChargeDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createElementaryCharge: createElementaryCharge };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFaraday.generated.js
var faradayDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createFaraday: createFaraday };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFermiCoupling.generated.js
var fermiCouplingDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createFermiCoupling: createFermiCoupling };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFineStructure.generated.js
var fineStructureDependencies = { BigNumberDependencies: BigNumberDependencies, createFineStructure: createFineStructure };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFirstRadiation.generated.js
var firstRadiationDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createFirstRadiation: createFirstRadiation };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGasConstant.generated.js
var gasConstantDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createGasConstant: createGasConstant };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravitationConstant.generated.js
var gravitationConstantDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createGravitationConstant: createGravitationConstant };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravity.generated.js
var gravityDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createGravity: createGravity };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js
var hartreeEnergyDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createHartreeEnergy: createHartreeEnergy };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js
var inverseConductanceQuantumDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createInverseConductanceQuantum: createInverseConductanceQuantum };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKlitzing.generated.js
var klitzingDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createKlitzing: createKlitzing };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLoschmidt.generated.js
var loschmidtDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createLoschmidt: createLoschmidt };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticConstant.generated.js
var magneticConstantDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createMagneticConstant: createMagneticConstant };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js
var magneticFluxQuantumDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createMagneticFluxQuantum: createMagneticFluxQuantum };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMass.generated.js
var molarMassDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createMolarMass: createMolarMass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMassC12.generated.js
var molarMassC12Dependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createMolarMassC12: createMolarMassC12 };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js
var molarPlanckConstantDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createMolarPlanckConstant: createMolarPlanckConstant };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarVolume.generated.js
var molarVolumeDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createMolarVolume: createMolarVolume };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNeutronMass.generated.js
var neutronMassDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createNeutronMass: createNeutronMass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js
var nuclearMagnetonDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createNuclearMagneton: createNuclearMagneton };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckCharge.generated.js
var planckChargeDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createPlanckCharge: createPlanckCharge };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckConstant.generated.js
var planckConstantDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createPlanckConstant: createPlanckConstant };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckLength.generated.js
var planckLengthDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createPlanckLength: createPlanckLength };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckMass.generated.js
var planckMassDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createPlanckMass: createPlanckMass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js
var planckTemperatureDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createPlanckTemperature: createPlanckTemperature };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTime.generated.js
var planckTimeDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createPlanckTime: createPlanckTime };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProtonMass.generated.js
var protonMassDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createProtonMass: createProtonMass };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js
var quantumOfCirculationDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createQuantumOfCirculation: createQuantumOfCirculation };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js
var reducedPlanckConstantDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createReducedPlanckConstant: createReducedPlanckConstant };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRydberg.generated.js
var rydbergDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createRydberg: createRydberg };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSackurTetrode.generated.js
var sackurTetrodeDependencies = { BigNumberDependencies: BigNumberDependencies, createSackurTetrode: createSackurTetrode };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSecondRadiation.generated.js
var secondRadiationDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createSecondRadiation: createSecondRadiation };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js
var speedOfLightDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createSpeedOfLight: createSpeedOfLight };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js
var stefanBoltzmannDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createStefanBoltzmann: createStefanBoltzmann };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js
var thomsonCrossSectionDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createThomsonCrossSection: createThomsonCrossSection };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js
var vacuumImpedanceDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createVacuumImpedance: createVacuumImpedance };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js
var weakMixingAngleDependencies = { BigNumberDependencies: BigNumberDependencies, createWeakMixingAngle: createWeakMixingAngle };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWienDisplacement.generated.js
var wienDisplacementDependencies = { BigNumberDependencies: BigNumberDependencies, UnitDependencies: UnitDependencies, createWienDisplacement: createWienDisplacement };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesApplyTransform.generated.js
var applyTransformDependencies = { isIntegerDependencies: isIntegerDependencies, typedDependencies: typedDependencies, createApplyTransform: createApplyTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumnTransform.generated.js
var columnTransformDependencies = { IndexDependencies: IndexDependencies, matrixDependencies: matrixDependencies, rangeDependencies: rangeDependencies, typedDependencies: typedDependencies, createColumnTransform: createColumnTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilterTransform.generated.js
var filterTransformDependencies = { typedDependencies: typedDependencies, createFilterTransform: createFilterTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEachTransform.generated.js
var forEachTransformDependencies = { typedDependencies: typedDependencies, createForEachTransform: createForEachTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexTransform.generated.js
var indexTransformDependencies = { IndexDependencies: IndexDependencies, createIndexTransform: createIndexTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapTransform.generated.js
var mapTransformDependencies = { typedDependencies: typedDependencies, createMapTransform: createMapTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMaxTransform.generated.js
var maxTransformDependencies = { largerDependencies: largerDependencies, numericDependencies: numericDependencies, typedDependencies: typedDependencies, createMaxTransform: createMaxTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMeanTransform.generated.js
var meanTransformDependencies = { addDependencies: addDependencies, divideDependencies: divideDependencies, typedDependencies: typedDependencies, createMeanTransform: createMeanTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMinTransform.generated.js
var minTransformDependencies = { numericDependencies: numericDependencies, smallerDependencies: smallerDependencies, typedDependencies: typedDependencies, createMinTransform: createMinTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeTransform.generated.js
var rangeTransformDependencies = { bignumberDependencies: bignumberDependencies, matrixDependencies: matrixDependencies, largerDependencies: largerDependencies, largerEqDependencies: largerEqDependencies, smallerDependencies: smallerDependencies, smallerEqDependencies: smallerEqDependencies, typedDependencies: typedDependencies, createRangeTransform: createRangeTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRowTransform.generated.js
var rowTransformDependencies = { IndexDependencies: IndexDependencies, matrixDependencies: matrixDependencies, rangeDependencies: rangeDependencies, typedDependencies: typedDependencies, createRowTransform: createRowTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubsetTransform.generated.js
var subsetTransformDependencies = { matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createSubsetTransform: createSubsetTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcatTransform.generated.js
var concatTransformDependencies = { isIntegerDependencies: isIntegerDependencies, matrixDependencies: matrixDependencies, typedDependencies: typedDependencies, createConcatTransform: createConcatTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiffTransform.generated.js
var diffTransformDependencies = { bignumberDependencies: bignumberDependencies, matrixDependencies: matrixDependencies, numberDependencies: numberDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createDiffTransform: createDiffTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStdTransform.generated.js
var stdTransformDependencies = { sqrtDependencies: sqrtDependencies, typedDependencies: typedDependencies, varianceDependencies: varianceDependencies, createStdTransform: createStdTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSumTransform.generated.js
var sumTransformDependencies = { addDependencies: addDependencies, numericDependencies: numericDependencies, typedDependencies: typedDependencies, createSumTransform: createSumTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVarianceTransform.generated.js
var varianceTransformDependencies = { addDependencies: addDependencies, applyDependencies: applyDependencies, divideDependencies: divideDependencies, isNaNDependencies: isNaNDependencies, multiplyDependencies: multiplyDependencies, subtractDependencies: subtractDependencies, typedDependencies: typedDependencies, createVarianceTransform: createVarianceTransform };
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/factoriesAny.js

;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/allFactoriesAny.js
var allFactoriesAny_all = factoriesAny_namespaceObject;
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/dependenciesAny.generated.js

// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
var tiny_emitter = __webpack_require__("./node_modules/tiny-emitter/index.js");
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/utils/emitter.js
function mixin(obj) {var emitter = new tiny_emitter();return obj.on = emitter.on.bind(emitter), obj.off = emitter.off.bind(emitter), obj.once = emitter.once.bind(emitter), obj.emit = emitter.emit.bind(emitter), obj;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/core/function/import.js
function importFactory(typed, load, math, importedFactories) {function _import(name, value, options) {if (options.wrap && "function" == typeof value && (value = _wrap(value)), hasTypedFunctionSignature(value) && (value = typed(name, { [value.signature]: value })), isTypedFunction(math[name]) && isTypedFunction(value)) return value = options.override ? typed(name, value.signatures) : typed(math[name], value), math[name] = value, delete importedFactories[name], _importTransform(name, value), void math.emit("import", name, function () {return value;});if (void 0 === math[name] || options.override) return math[name] = value, delete importedFactories[name], _importTransform(name, value), void math.emit("import", name, function () {return value;});if (!options.silent) throw new Error("Cannot import \"" + name + "\": already exists");}function _importTransform(name, value) {value && "function" == typeof value.transform ? (math.expression.transform[name] = value.transform, allowedInExpressions(name) && (math.expression.mathWithTransform[name] = value.transform)) : (delete math.expression.transform[name], allowedInExpressions(name) && (math.expression.mathWithTransform[name] = value));}function _deleteTransform(name) {delete math.expression.transform[name], allowedInExpressions(name) ? math.expression.mathWithTransform[name] = math[name] : delete math.expression.mathWithTransform[name];}function _wrap(fn) {var wrapper = function () {for (var arg, args = [], i = 0, len = arguments.length; i < len; i++) arg = arguments[i], args[i] = arg && arg.valueOf();return fn.apply(math, args);};return fn.transform && (wrapper.transform = fn.transform), wrapper;}function _importFactory(factory, options) {var name = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : factory.fn;if (array_contains(name, ".")) throw new Error("Factory name should not contain a nested path. Name: " + JSON.stringify(name));var namespace = isTransformFunctionFactory(factory) ? math.expression.transform : math,existingTransform = (name in math.expression.transform),existing = object_hasOwnProperty(namespace, name) ? namespace[name] : void 0,resolver = function () {var dependencies = {};factory.dependencies.map(stripOptionalNotation).forEach((dependency) => {if (array_contains(dependency, ".")) throw new Error("Factory dependency should not contain a nested path. Name: " + JSON.stringify(dependency));"math" === dependency ? dependencies.math = math : "mathWithTransform" === dependency ? dependencies.mathWithTransform = math.expression.mathWithTransform : "classes" === dependency ? dependencies.classes = math : dependencies[dependency] = math[dependency];});var instance = factory(dependencies);if (instance && "function" == typeof instance.transform) throw new Error("Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path=\"expression.transform\"");if (void 0 === existing || options.override) return instance;if (isTypedFunction(existing) && isTypedFunction(instance)) return typed(existing, instance);if (options.silent) return existing;throw new Error("Cannot import \"" + name + "\": already exists");};factory.meta && !1 === factory.meta.lazy ? (namespace[name] = resolver(), existing && existingTransform ? _deleteTransform(name) : (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) && lazy(math.expression.mathWithTransform, name, () => namespace[name])) : (lazy(namespace, name, resolver), existing && existingTransform ? _deleteTransform(name) : (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) && lazy(math.expression.mathWithTransform, name, () => namespace[name])), importedFactories[name] = factory, math.emit("import", name, resolver);}function isSupportedType(object) {return "function" == typeof object || "number" == typeof object || "string" == typeof object || "boolean" == typeof object || null === object || isUnit(object) || isComplex(object) || isBigNumber(object) || isFraction(object) || isMatrix(object) || Array.isArray(object);}function isTypedFunction(fn) {return "function" == typeof fn && "object" == typeof fn.signatures;}function hasTypedFunctionSignature(fn) {return "function" == typeof fn && "string" == typeof fn.signature;}function allowedInExpressions(name) {return !object_hasOwnProperty(unsafe, name);}function factoryAllowedInExpressions(factory) {return -1 === factory.fn.indexOf(".") && !object_hasOwnProperty(unsafe, factory.fn) && (!factory.meta || !factory.meta.isClass);}function isTransformFunctionFactory(factory) {return factory !== void 0 && factory.meta !== void 0 && !0 === factory.meta.isTransformFunction || !1;}var unsafe = { expression: !0, type: !0, docs: !0, error: !0, json: !0, chain: !0 };return function (functions, options) {function flattenImports(flatValues, value, name) {if (Array.isArray(value)) value.forEach((item) => flattenImports(flatValues, item));else if ("object" == typeof value) for (var _name in value) object_hasOwnProperty(value, _name) && flattenImports(flatValues, value[_name], _name);else if (isFactory(value) || void 0 !== name) {var flatName = isFactory(value) ? isTransformFunctionFactory(value) ? value.fn + ".transform" : value.fn : name;if (object_hasOwnProperty(flatValues, flatName) && flatValues[flatName] !== value && !options.silent) throw new Error("Cannot import \"" + flatName + "\" twice");flatValues[flatName] = value;} else if (!options.silent) throw new TypeError("Factory, Object, or Array expected");}var num = arguments.length;if (1 !== num && 2 !== num) throw new ArgumentsError("import", num, 1, 2);options || (options = {});var flatValues = {};for (var name in flattenImports(flatValues, functions), flatValues) if (object_hasOwnProperty(flatValues, name)) {var value = flatValues[name];if (isFactory(value)) _importFactory(value, options);else if (isSupportedType(value)) _import(name, value, options);else if (!options.silent) throw new TypeError("Factory, Object, or Array expected");}};}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/core/create.js
function create_create(factories, config) {function load(factory) {if (isFactory(factory)) return factory(math);var firstProperty = factory[Object.keys(factory)[0]];if (isFactory(firstProperty)) return firstProperty(math);if (!isLegacyFactory(factory)) throw console.warn("Factory object with properties `type`, `name`, and `factory` expected", factory), new Error("Factory object with properties `type`, `name`, and `factory` expected");var instance,index = legacyFactories.indexOf(factory);return -1 === index ? (instance = !0 === factory.math ? factory.factory(math.type, configInternal, load, math.typed, math) : factory.factory(math.type, configInternal, load, math.typed), legacyFactories.push(factory), legacyInstances.push(instance)) : instance = legacyInstances[index], instance;}var configInternal = helpers_extends({}, DEFAULT_CONFIG, config);if ("function" != typeof Object.create) throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var math = mixin({ isNumber: isNumber, isComplex: isComplex, isBigNumber: isBigNumber, isFraction: isFraction, isUnit: isUnit, isString: isString, isArray: isArray, isMatrix: isMatrix, isCollection: isCollection, isDenseMatrix: isDenseMatrix, isSparseMatrix: isSparseMatrix, isRange: isRange, isIndex: isIndex, isBoolean: isBoolean, isResultSet: isResultSet, isHelp: isHelp, isFunction: isFunction, isDate: isDate, isRegExp: isRegExp, isObject: isObject, isNull: isNull, isUndefined: isUndefined, isAccessorNode: isAccessorNode, isArrayNode: isArrayNode, isAssignmentNode: isAssignmentNode, isBlockNode: isBlockNode, isConditionalNode: isConditionalNode, isConstantNode: isConstantNode, isFunctionAssignmentNode: isFunctionAssignmentNode, isFunctionNode: isFunctionNode, isIndexNode: isIndexNode, isNode: isNode, isObjectNode: isObjectNode, isOperatorNode: isOperatorNode, isParenthesisNode: isParenthesisNode, isRangeNode: isRangeNode, isSymbolNode: isSymbolNode, isChain: isChain });math.config = configFactory(configInternal, math.emit), math.expression = { transform: {}, mathWithTransform: { config: math.config } };var legacyFactories = [],legacyInstances = [],importedFactories = {},internalImport = importFactory(function () {for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];return math.typed.apply(math.typed, args);}, load, math, importedFactories);return math.import = internalImport, math.on("config", () => {values(importedFactories).forEach((factory) => {factory && factory.meta && factory.meta.recreateOnConfigChange && internalImport(factory, { override: !0 });});}), math.create = create_create.bind(null, factories), math.factory = factory, math.import(values(deepFlatten(factories))), math.ArgumentsError = ArgumentsError, math.DimensionError = DimensionError, math.IndexError = IndexError, math;}
;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/entry/mainAny.js

;// CONCATENATED MODULE: ./node_modules/mathjs/lib/esm/index.js

// EXTERNAL MODULE: ./src/util_parsing.js
var util_parsing = __webpack_require__("./src/util_parsing.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/index.js + 828 modules
var core = __webpack_require__("./node_modules/@babylonjs/core/index.js");
;// CONCATENATED MODULE: ./src/util.js






const util_math = esm_namespaceObject;
const parsing = util_parsing;
const hashInt = __webpack_require__("./node_modules/hash-int/hashint.js");

const makeColor = (color) => {
  if (typeof color === 'number') {
    return {
      r: (color >> 16) / 255,
      g: (color >> 8 & 255) / 255,
      b: (color & 255) / 255,
      a: 1 };

  } else if (color instanceof core.Color3) {
    return color.toColor4();
  } else if (color instanceof core.Color4) {
    return color;
  } else {
    const canvas = document.createElement('canvas');
    canvas.width = 1;canvas.height = 1;
    const context = canvas.getContext('2d');
    context.fillStyle = color;context.fillRect(0, 0, 1, 1);
    const bytes = context.getImageData(0, 0, 1, 1).data;
    return new core.Color4(bytes[0] / 255, bytes[1] / 255, bytes[2] / 255, bytes[3] / 255);
  }
};


const hexNumber = (n) => {
  n = String(n);
  if (n.startsWith('#')) {
    n = n.substr(1);
  }
  return Number.parseInt(n, 16);
};

const relativeNumber = (current, n) => {
  if (n === '') {return +current;}
  const relative = /^[+]/.test(n);
  if (relative) {n = n.substr(1);}
  n = Number(n);
  if (Number.isNaN(n)) {return +current;}
  if (relative) {
    return +current + n;
  } else {
    return +n;
  }
};

const relativeBlend = (blender, n, time) => {
  const relative = String(n).startsWith('+');
  blender.setValue(relativeNumber(blender.targetValue(), n), Number(time), !relative);
};

const booleanNumber = (s) => {
  if (!isNaN(s)) {return Number(s);}
  return booleanString(s);
};
const booleanString = (s, ...otherValues) => {
  const found = otherValues.find((v) => String(v).toLowerCase() == String(s).toLowerCase());
  if (found) {
    return found;
  } else {
    return Boolean(falseString(s));
  }
};
const falseString = (s) => {
  if (!s) {return false;}
  if (typeof s !== 'string') {s = String(s);}
  if (booleanString.falsyValues.includes(s.toUpperCase())) {
    return false;
  }
  return s;
};
booleanString.falsyValues = ['OFF', 'FALSE', 'UNDEFINED', 'NULL', 'DISABLE', 'DISABLED', 'CLEAR', 'CLEARED', 'NO', 'NONE', '0'];
booleanString.truthyValues = ['ON', 'TRUE', 'ENABLE', 'ENABLED', 'YES', '1'];
const softBoolean = (s) => {
  s = falseString(s);
  if (!s) {return false;}
  if (booleanString.truthyValues.includes(s.toUpperCase())) {
    return true;
  }
  return s;
};
const util_isBoolean = (s) => {
  return typeof softBoolean(s) === 'boolean';
};

const parseVector2 = (str) => {
  if (!str) return undefined;
  try {
    if (str instanceof Array) {
      return new core.Vector2(+str[0], +str[1]);
    } else if (typeof str === 'object') {
      return new core.Vector2(+str.x, +str.y);
    }
    const parsed = JSON.parse(str);
    return new core.Vector2(+parsed.x, +parsed.y);
  } catch (err) {
    return undefined;
  }
};

const parseVector3 = (str) => {
  if (!str) return undefined;
  try {
    if (str instanceof Array) {
      return new core.Vector3(+str[0], +str[1], +str[2]);
    } else if (typeof str === 'object') {
      return new core.Vector3(+str.x, +str.y, +str.z);
    }
    const parsed = JSON.parse(str);
    return new core.Vector3(+parsed.x, +parsed.y, +parsed.z);
  } catch (err) {
    return undefined;
  }
};

const voidNaN = (n) => {
  return isNaN(parseFloat(n)) ? undefined : Number(n);
};

const box = (v) => v != null ? Object.prototype.valueOf(v) : v;
const unbox = (v) => v != null && typeof v.valueOf === 'function' ? v.valueOf() : v;

const sleep = (ms = 0) => new Promise((resolve) => setTimeout(resolve, ms));
const sleepUntil = (condition) => new Promise((resolve) => {
  const callback = () => {
    if (condition()) {return void resolve();}
    requestAnimationFrame(callback);
  };
  requestAnimationFrame(callback);
});
const lerpValue = (ms, lerpFunc) => {
  const started = Date.now();
  const callback = () => {
    const t = Date.now() - started;
    lerpFunc(Math.min(1, t / ms));
    if (t < ms) requestAnimationFrame(callback);
  };
  callback();
};

const lerp = (start, end, t) => {
  return start + (end - start) * t;
};

const degDiff = (a, b, cycle = 360) => {
  let diff = b - a;
  while (Math.abs(diff) > 360 / 2) {
    diff -= Math.sign(diff) * cycle;
  }
  return diff;
};

const degtorad = (deg) => deg * Math.PI / 180;
const radtodeg = (rad) => rad * 180 / Math.PI;

const pointtorad = (x, y) => Math.atan2(-y, x) - Math.PI / 2;
const pointtodeg = (x, y) => radtodeg(pointtorad(x, y));

const util_sin = (r) => unround(Math.sin(r), 1e15);
const util_cos = (r) => unround(Math.cos(r), 1e15);

const unround = (n, m = 1e15) => Math.round(n * m) / m;

const minmax = (min, max, v) => Math.min(max, Math.max(min, v));

const tileSize = () => tileWidth();
const tileWidth = () => Game_Map.prototype.tileWidth();
const tileHeight = () => Game_Map.prototype.tileHeight();
const optimalFrustrumWidth = () => Graphics.width / 48;
const optimalFrustrumHeight = () => Graphics.height / 48;

const file = (folder = main/* default.MV3D_FOLDER */.Z.MV3D_FOLDER, name, ext) => {
  if (/(?:data|file|https?):/.test(name)) {return name;}
  if (ext && !filename(name).contains('.')) {name = name + (ext.startsWith('.') ? '' : '.') + ext;}
  if (name.startsWith('/')) {return '.' + name;} else
  if (name.startsWith('./')) {return name;}
  if (folder.startsWith('/')) {folder = '.' + folder;} else
  if (!folder.startsWith('./') && folder !== '.') {folder = './' + folder;}
  return `${folder}${folder.endsWith('/') ? '' : '/'}${name}`;
};

const filename = (path) => {path = path.split('/');return path[path.length - 1];};
const foldername = (path) => {path = path.split('/');path.pop();return path.join('/') + '/';};

const issuedWarnings = {};
const deprecated = (message) => {
  if (message in issuedWarnings) {return;}
  issuedWarnings[message] = true;
  console.warn(message);
};

const throttle = (func, interval = 100) => {
  let last_call = 0;
  return function () {
    if (Date.now() - last_call > interval) {
      func.apply(this, arguments);
      last_call = Date.now();
    }
  };
};

const interpolateValue = (start, end, t) => {
  t = Math.clamp(t, 0, 1);
  if (typeof start === 'number' && isFinite(start) && typeof end === 'number' && isFinite(end)) {
    return start + (end - start) * t;
  } else if (typeof start === 'object' && start !== null && typeof end === 'object' && end !== null) {
    const value = end instanceof Array ? [] : {};
    for (const key of Object.keys(end)) {
      value[key] = interpolateValue(start[key], end[key], t);
    }
    if (end.constructor !== Object && end.constructor !== Array) {
      Object.setPrototypeOf(value, end.constructor.prototype);
    }
    return value;
  } else {
    return end;
  }
};

// directions

const dirtoh = (d) => (d - 1) % 3 + 4;
const dirtov = (d) => Math.ceil(d / 3) * 3 - 1;
const hvtodir = (h, v) => 5 + (Math.floor((v - 1) / 3) - 1) * 3 + ((h - 1) % 3 - 1);
const dirtovec = (d) => new core.Vector2(dirtoh(d) - 5, (dirtov(d) - 5) / 3);
const vectodir = (vec) => 5 - Math.sign(vec.y) * 3 + Math.sign(vec.x);

// overloading

const overload = (funcs) => {
  const overloaded = function () {
    const l = arguments.length;
    if (typeof funcs[l] === 'function') {
      return funcs[l].apply(this, arguments);
    } else if (typeof funcs.default === 'function') {
      return funcs.default.apply(this, arguments);
    } else {console.warn("Unsupported number of arguments.");}
  };
  for (const key in funcs) {
    overloaded[key] = funcs[key].bind;
  }
  return overloaded;
};

// override
const _override_default_condition = () => !main/* default.isDisabled */.Z.isDisabled();
const override = (obj, methodName, getNewMethod, condition = _override_default_condition) => {
  const oldMethod = obj[methodName];
  const newMethod = getNewMethod(oldMethod);
  const overrider = function () {
    if (!(typeof condition === 'function' ? condition() : condition)) {return oldMethod.apply(this, arguments);}
    return newMethod.apply(this, arguments);
  };
  Object.defineProperty(overrider, 'name', { value: `${methodName}<mv3d_override>` });
  Object.defineProperty(newMethod, 'name', { value: `${methodName}<mv3d>` });
  overrider.oldMethod = oldMethod;overrider.newMethod = newMethod;
  return obj[methodName] = overrider;
};

// assign
const util_assign = (obj, methods, opts = {}) => {
  if (methods._isProxied) {
    obj = ProxyConf(obj);
  }
  for (const key in methods) {
    const descriptor = Object.getOwnPropertyDescriptor(methods, key);
    if (!descriptor) continue;
    if (descriptor.get || descriptor.set) {
      Object.defineProperty(obj, key, descriptor);
    } else if (methods[key] instanceof main/* default.Attribute.Abstract */.Z.Attribute.Abstract) {
      const attribute = methods[key];
      Object.defineProperty(obj, key, attribute.descriptor);
      Object.defineProperty(obj, '$' + key, attribute.descriptor);
    } else {
      if (opts.recursive && methods[key] && typeof methods[key] === 'object') {
        if (!obj[key] || obj[key].constructor !== methods[key].constructor) {
          const value = methods[key] instanceof Array ? [] : {};
          if (value.constructor !== methods[key].constructor) Object.setPrototypeOf(value, methods[key].constructor.prototype);
          obj[key] = obj[key] ? util_assign(value, obj[key], opts) : value;
        }
        util_assign(obj[key], methods[key], opts);
      } else {
        obj[key] = methods[key];
      }
    }
  }
  return obj;
};

const assignCopies = (obj, properties) => {
  return util_assign(obj, properties, { recursive: true });
};

//access
const access = (obj, key, context = obj) => {
  if (typeof obj[key] === 'function') {
    return obj[key].call(context);
  } else {
    return obj[key];
  }
};

// proxy
function ProxyConf(conf = {}) {
  if (conf._isProxied) return conf;
  return new Proxy(conf, ProxyConf.handler);
}
ProxyConf.handler = {
  has(target, prop) {return target[prop] !== undefined;},
  deleteProperty(target, prop) {target[prop] = undefined;return true;},
  get(target, prop) {
    switch (prop) {
      case '_isProxied':return true;
      case '_proxyTarget':return target;
      default:return target[prop];}

  } };



const _reserved_math_words = ['end'];
class DefaultMap extends Map {
  get(key) {if (!super.has(key)) {return typeof this.default === 'function' ? this.default() : this.default;}return super.get(key);}
  has(key) {return _reserved_math_words.indexOf(key) < 0 && !(key in util_math);}
  constructor(dfault, entries) {super(entries);this.default = dfault;}}

const _default_scope = {
  x: 0, y: 0, z: 0, r: 0, l: 0,
  yaw: 0, pitch: 0, roll: 0, rot: 0,
  rand: () => 0,
  var(n) {return $gameVariables.value(n);} };


class _MathExpression extends Number {
  constructor(n) {
    if (!n) {n = 0;}
    super(util_math.evaluate(n, _default_scope));
    this.expression = n;
  }
  evaluate(scope) {
    return util_math.evaluate(this.expression, scope);
  }}

function new_MathExpression(n) {
  if (!n) {n = 0;}
  try {
    var simplified = util_math.simplify(n);
  } catch (err) {
    console.error("Invalid MathExpression", n);
    return 0;
  }
  if (simplified instanceof util_math.ConstantNode) {
    return simplified.value;
  } else {
    return new _MathExpression(n);
  }
}
const MathExpression = new Proxy(_MathExpression, {
  construct(target, args) {return new _MathExpression(...args);},
  apply(target, context, args) {return new_MathExpression(...args);} });


function hashRand(n) {
  return hashInt(n) / 4294967296;
}

const overlapSphereBox = (pos, radius, bbox) => {
  const clampedPoint = new core.Vector3(
  Math.clamp(pos.x, bbox.minimumWorld.x, bbox.maximumWorld.x),
  Math.clamp(pos.y, bbox.minimumWorld.y, bbox.maximumWorld.y),
  Math.clamp(pos.z, bbox.minimumWorld.z, bbox.maximumWorld.z));

  const dist = core.Vector3.Distance(pos, clampedPoint);
  const overlap = radius - dist;
  return overlap;
};


const flattenHierarchy = (node) => node !== null && node !== void 0 && node._children ? [node, ...node._children.flatMap(flattenHierarchy)] : [node];

const util_identity = (_) => _;

// useful consts
const XAxis = new core.Vector3(1, 0, 0);
const YAxis = new core.Vector3(0, 1, 0);
const ZAxis = new core.Vector3(0, 0, 1);
const v2origin = new core.Vector2(0, 0);
const v3origin = new core.Vector3(0, 0, 0);

const PI = Math.PI;
const PI2 = Math.PI * 2;

/***/ }),

/***/ "./src/util_parsing.js":
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ParameterGroup": () => (/* binding */ ParameterGroup),
/* harmony export */   "ParameterList": () => (/* binding */ ParameterList),
/* harmony export */   "breakdownParameterDescriptor": () => (/* binding */ breakdownParameterDescriptor),
/* harmony export */   "parseNestedParentheses": () => (/* binding */ parseNestedParentheses),
/* harmony export */   "parseParameters": () => (/* binding */ parseParameters)
/* harmony export */ });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/util.js");


// nested parentheses




//pass in string including everything after initial opening char, return everything until final closing char.
function parseNestedParentheses(startChar, endChar, line, opts = {}) {
  let nest_level = 0;
  let i;
  for (i = 0; i < line.length; ++i) {
    const char = line[i];
    if (char === startChar) {
      ++nest_level;
    } else if (char === endChar) {
      if (nest_level > 0) {
        --nest_level;
      } else {
        break;
      }
    } else if (char === ',') {
      if (nest_level === 0 && opts.replaceCommas) {
        line = line.substr(0, i) + '，' + line.substr(i + 1);
      }
    }
  }
  return line.substr(0, i);
}

function parseParameters(line, descriptor, opts = {}) {
  if (typeof descriptor === 'string') {
    descriptor = breakdownParameterDescriptor(descriptor);
  }
  const paramlist = new ParameterList();
  // create all groups from descriptor
  if (descriptor) for (let gi = 0; gi < descriptor.length; ++gi) {
    paramlist[gi] = new ParameterGroup();
    //paramlist[`group${gi+1}`]=paramlist[gi];//for compatability with old group system
  }
  let i = 0;
  let gi = 0,pi = 0;
  let label = null;
  let jumped = false;
  let referencing = false;
  while (i <= line.length) {
    if (!line) {break;}
    const char = line[i];
    if (!char || '，,|:{'.indexOf(char) > -1) {
      let word = line.slice(0, i).trim();
      let addParam = false;
      let nextGroup = false;
      if (!char) {
        if (word) addParam = true;
      } else if (char === '|') {
        addParam = true;
        nextGroup = true;
      } else if (char === ',' || char === '，') {
        addParam = true;
      } else if (char === '{') {
        if (word) {
          // if there's content before the bracket, act like there's a comma before it.
          addParam = true;
          --i;
        } else {var _descriptor;
          const content = parseNestedParentheses('{', '}', line.slice(i + 1));
          i += content.length + 1; //puts us at the closing '}'
          // allow closing comma or pipe
          const char = line[i + 1];
          if (char === '|') {
            nextGroup = true;++i;
          } else if (char === ',' || char === '，') {
            ++i;
          }
          // if we're going recursive, parse the parameters held within the brackets
          // else just add the content as a parameter
          let recursive = Boolean(opts.recursive);
          let nest;
          if ((_descriptor = descriptor) !== null && _descriptor !== void 0 && _descriptor[gi]) {
            const param = descriptor[gi][pi] ?? descriptor[gi].wildcard ?? descriptor[gi].overflow;
            if (param) {
              if (opts.recursive == null) recursive = Boolean(param.nest || param.recursive);
              nest = param.nest;
            }
          }
          if (recursive) {
            if (nest) {
              word = parseParameters(content, typeof nest === 'object' ? nest : undefined, opts);
            } else {
              word = parseParameters(content, undefined, { ...opts, recursive: true });
            }
          } else {
            word = content;
          }
          addParam = true;
        }
      } else if (char === ':') {
        if (word) {
          // jump to the label
          label = word.toLowerCase();
          if (descriptor && word in descriptor.labels) {
            const indexes = descriptor.labels[label];
            gi = indexes.gi;pi = indexes.i;
            jumped = true;
          }
        } else {
          referencing = true;
        }

      }
      if (addParam) {var _descriptor2, _descriptor2$gi;
        if (descriptor && gi >= descriptor.length) {break;}
        if (referencing) {
          referencing = false;
          if (word in paramlist) {word = paramlist[word];}
        }
        if (!(gi in paramlist)) {
          paramlist[gi] = new ParameterGroup();
          //paramlist[`group${gi+1}`]=paramlist[gi];//for compatability with old group system
        }
        const wildcard = (_descriptor2 = descriptor) === null || _descriptor2 === void 0 ? void 0 : (_descriptor2$gi = _descriptor2[gi]) === null || _descriptor2$gi === void 0 ? void 0 : _descriptor2$gi.wildcard;
        if (descriptor && label && !jumped && !wildcard) {} else {
          paramlist[gi][pi] = word;
          if (descriptor) {
            if (!jumped && !(label && wildcard)) label = (0,_util__WEBPACK_IMPORTED_MODULE_0__.unbox)(descriptor[gi][pi] ?? descriptor[gi].overflow);
            if (descriptor[gi].overflow && label === (0,_util__WEBPACK_IMPORTED_MODULE_0__.unbox)(descriptor[gi].overflow)) {
              paramlist[label] ??= [];
              paramlist[label].push(word);
            } else if (label) {
              paramlist[label] = word;
            }
          } else if (label) {
            paramlist[label] = word;
          }
        }
        label = null;
        ++pi;
        if (descriptor && descriptor[gi] && pi >= descriptor[gi].length && !descriptor[gi].overflow && !wildcard) {nextGroup = true;}
      }
      if (nextGroup) {
        ++gi;pi = 0;
        //if(descriptor && gi>=descriptor.length){ break; }
      }
      line = line.slice(i + 1);
      i = 0;
    } else {
      ++i;
    }

  }
  return paramlist;
}

function breakdownParameterDescriptor(descriptor) {
  const groups = [[]];
  groups.labels = {};
  let gi = 0; //group id
  let s = 0; //word start position
  const length = descriptor.length;
  for (let i = 0; i <= length; ++i) {
    const char = i < length ? descriptor[i] : ',';
    let addLabel = false;
    let addParam = false;
    let nextGroup = false;
    let nest = null;
    if (char === ',') {
      if (i > s) {
        addLabel = true;
        addParam = true;
      } else {++s;}
    } else if (char === '|' || char === '[') {
      if (i > s) {
        addLabel = true;
        addParam = true;
      } else {++s;}
      nextGroup = true;
    } else if (char === ']') {
      addLabel = true;
    } else if (char === '{') {
      nest = parseNestedParentheses('{', '}', descriptor.slice(i + 1));
      addLabel = true;
    }
    if (addLabel || addParam) {
      let label = descriptor.slice(s, i);
      if (label.endsWith('...')) {
        label = label.slice(0, label.length - 3);
        groups[gi].overflow = label;
      }
      s = i + 1;
      if (addLabel && label && label !== '*') {
        groups.labels[label] = { gi, i: groups[gi].length };
      }
      if (nest != null) {
        const param = new String(label);
        if (groups[gi].overflow === label) groups[gi].overflow = param;
        if (nest === '...') {
          param.recursive = true;
        } else if (nest) {
          param.nest = breakdownParameterDescriptor(nest);
        } else {
          param.nest = true;
        }
        if (label === '*') {
          groups[gi].wildcard = param;
        } else {
          groups[gi].push(param);
        }
        i += nest.length + 1;
        s = i + 1;
      } else if (addParam) {
        groups[gi].push(label);
      }
    }

    if (nextGroup) {
      ++gi;
      groups.push([]);
    }
  }
  if (s < length) {
    const label = descriptor.slice(s);
    groups.labels[label] = { gi, i: groups[gi].length };
    groups[gi].push(label);
  }
  return groups;
}

class ParameterList extends Array {
  get groups() {
    return Array.from(this);
  }
  get namedParameters() {
    const params = {};
    for (const label in this) if (!(label < this.length)) params[label] = this[label];
    return params;
  }
  get parameters() {
    const namedParams = this.namedParameters;
    const namedValues = Object.values(this.namedParameters);
    const params = this.groups.flat().filter((p) => !namedValues.includes(p));
    return Object.assign(params, namedParams);
  }

  toArray() {
    return this.groups.map((group) => group instanceof ParameterGroup ? group.toArray() : group);
  }
  toObject() {
    const params = this.namedParameters;
    for (const label in params) if (params[label] instanceof ParameterList) params[label] = params[label].toObject();
    return params;
    //return Object.fromEntries(Object.entries(this.namedParameters).map(([key,value])=>value instanceof ParameterList?[key,value.toObject()]:[key,value]));
  }}



class ParameterGroup extends Array {
  toArray() {
    return Array.from(this).map((p) => p instanceof ParameterList ? p.toArray() : p);
  }}

/***/ }),

/***/ "crypto":
/***/ ((module) => {

"use strict";
module.exports = require("crypto");

/***/ }),

/***/ "fs":
/***/ ((module) => {

"use strict";
module.exports = require("fs");

/***/ }),

/***/ "path":
/***/ ((module) => {

"use strict";
module.exports = require("path");

/***/ }),

/***/ "util":
/***/ ((module) => {

"use strict";
module.exports = require("util");

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/constants.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createVersion = exports.createUppercaseE = exports.createUppercasePi = exports.createI = exports.createSQRT2 = exports.createSQRT1_2 = exports.createLOG10E = exports.createLOG2E = exports.createLN10 = exports.createLN2 = exports.createPhi = exports.createE = exports.createTau = exports.createPi = exports.createNaN = exports.createInfinity = exports.createNull = exports.createFalse = exports.createTrue = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_version = __webpack_require__("./node_modules/mathjs/lib/cjs/version.js"),_constants = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/constants.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),createTrue = (0, _factory.factory)("true", [], function () {return !0;});exports.createTrue = createTrue;var createFalse = (0, _factory.factory)("false", [], function () {return !1;});exports.createFalse = createFalse;var createNull = (0, _factory.factory)("null", [], function () {return null;});exports.createNull = createNull;var createInfinity = recreateFactory("Infinity", ["config", "?BigNumber"], function (_ref) {var config = _ref.config,BigNumber = _ref.BigNumber;return "BigNumber" === config.number ? new BigNumber(1 / 0) : 1 / 0;});exports.createInfinity = createInfinity;var createNaN = recreateFactory("NaN", ["config", "?BigNumber"], function (_ref2) {var config = _ref2.config,BigNumber = _ref2.BigNumber;return "BigNumber" === config.number ? new BigNumber(NaN) : NaN;});exports.createNaN = createNaN;var createPi = recreateFactory("pi", ["config", "?BigNumber"], function (_ref3) {var config = _ref3.config,BigNumber = _ref3.BigNumber;return "BigNumber" === config.number ? (0, _constants.createBigNumberPi)(BigNumber) : _index.pi;});exports.createPi = createPi;var createTau = recreateFactory("tau", ["config", "?BigNumber"], function (_ref4) {var config = _ref4.config,BigNumber = _ref4.BigNumber;return "BigNumber" === config.number ? (0, _constants.createBigNumberTau)(BigNumber) : _index.tau;});exports.createTau = createTau;var createE = recreateFactory("e", ["config", "?BigNumber"], function (_ref5) {var config = _ref5.config,BigNumber = _ref5.BigNumber;return "BigNumber" === config.number ? (0, _constants.createBigNumberE)(BigNumber) : _index.e;});exports.createE = createE;var createPhi = recreateFactory("phi", ["config", "?BigNumber"], function (_ref6) {var config = _ref6.config,BigNumber = _ref6.BigNumber;return "BigNumber" === config.number ? (0, _constants.createBigNumberPhi)(BigNumber) : _index.phi;});exports.createPhi = createPhi;var createLN2 = recreateFactory("LN2", ["config", "?BigNumber"], function (_ref7) {var config = _ref7.config,BigNumber = _ref7.BigNumber;return "BigNumber" === config.number ? new BigNumber(2).ln() : Math.LN2;});exports.createLN2 = createLN2;var createLN10 = recreateFactory("LN10", ["config", "?BigNumber"], function (_ref8) {var config = _ref8.config,BigNumber = _ref8.BigNumber;return "BigNumber" === config.number ? new BigNumber(10).ln() : Math.LN10;});exports.createLN10 = createLN10;var createLOG2E = recreateFactory("LOG2E", ["config", "?BigNumber"], function (_ref9) {var config = _ref9.config,BigNumber = _ref9.BigNumber;return "BigNumber" === config.number ? new BigNumber(1).div(new BigNumber(2).ln()) : Math.LOG2E;});exports.createLOG2E = createLOG2E;var createLOG10E = recreateFactory("LOG10E", ["config", "?BigNumber"], function (_ref10) {var config = _ref10.config,BigNumber = _ref10.BigNumber;return "BigNumber" === config.number ? new BigNumber(1).div(new BigNumber(10).ln()) : Math.LOG10E;});exports.createLOG10E = createLOG10E;var createSQRT1_2 = recreateFactory("SQRT1_2", ["config", "?BigNumber"], function (_ref11) {var config = _ref11.config,BigNumber = _ref11.BigNumber;return "BigNumber" === config.number ? new BigNumber("0.5").sqrt() : Math.SQRT1_2;});exports.createSQRT1_2 = createSQRT1_2;var createSQRT2 = recreateFactory("SQRT2", ["config", "?BigNumber"], function (_ref12) {var config = _ref12.config,BigNumber = _ref12.BigNumber;return "BigNumber" === config.number ? new BigNumber(2).sqrt() : Math.SQRT2;});exports.createSQRT2 = createSQRT2;var createI = recreateFactory("i", ["Complex"], function (_ref13) {var Complex = _ref13.Complex;return Complex.I;});exports.createI = createI;var createUppercasePi = (0, _factory.factory)("PI", ["pi"], function (_ref14) {var pi = _ref14.pi;return pi;});exports.createUppercasePi = createUppercasePi;var createUppercaseE = (0, _factory.factory)("E", ["e"], function (_ref15) {var e = _ref15.e;return e;});exports.createUppercaseE = createUppercaseE;var createVersion = (0, _factory.factory)("version", [], function () {return _version.version;});exports.createVersion = createVersion;function recreateFactory(name, dependencies, create) {return (0, _factory.factory)(name, dependencies, create, { recreateOnConfigChange: !0 });}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/core/config.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.DEFAULT_CONFIG = void 0;var DEFAULT_CONFIG = { epsilon: 1e-12, matrix: "Matrix", number: "number", precision: 64, predictable: !1, randomSeed: null };exports.DEFAULT_CONFIG = DEFAULT_CONFIG;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/core/create.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.create = create;var _extends2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/extends.js"));__webpack_require__("./node_modules/mathjs/lib/cjs/utils/polyfills.js");var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),emitter = _interopRequireWildcard(__webpack_require__("./node_modules/mathjs/lib/cjs/utils/emitter.js")),_import = __webpack_require__("./node_modules/mathjs/lib/cjs/core/function/import.js"),_config = __webpack_require__("./node_modules/mathjs/lib/cjs/core/function/config.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_ArgumentsError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/ArgumentsError.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),_IndexError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/IndexError.js"),_config2 = __webpack_require__("./node_modules/mathjs/lib/cjs/core/config.js");function _getRequireWildcardCache(nodeInterop) {if ("function" != typeof WeakMap) return null;var cacheBabelInterop = new WeakMap(),cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function (nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) return obj;if (null === obj || "object" !== _typeof(obj) && "function" != typeof obj) return { default: obj };var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) return cache.get(obj);var newObj = {},hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) if ("default" != key && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;desc && (desc.get || desc.set) ? Object.defineProperty(newObj, key, desc) : newObj[key] = obj[key];}return newObj["default"] = obj, cache && cache.set(obj, newObj), newObj;}function create(factories, config) {function load(factory) {if ((0, _factory.isFactory)(factory)) return factory(math);var firstProperty = factory[Object.keys(factory)[0]];if ((0, _factory.isFactory)(firstProperty)) return firstProperty(math);if (!(0, _object.isLegacyFactory)(factory)) throw console.warn("Factory object with properties `type`, `name`, and `factory` expected", factory), new Error("Factory object with properties `type`, `name`, and `factory` expected");var instance,index = legacyFactories.indexOf(factory);return -1 === index ? (instance = !0 === factory.math ? factory.factory(math.type, configInternal, load, math.typed, math) : factory.factory(math.type, configInternal, load, math.typed), legacyFactories.push(factory), legacyInstances.push(instance)) : instance = legacyInstances[index], instance;}var configInternal = (0, _extends2["default"])({}, _config2.DEFAULT_CONFIG, config);if ("function" != typeof Object.create) throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var math = emitter.mixin({ isNumber: _is.isNumber, isComplex: _is.isComplex, isBigNumber: _is.isBigNumber, isFraction: _is.isFraction, isUnit: _is.isUnit, isString: _is.isString, isArray: _is.isArray, isMatrix: _is.isMatrix, isCollection: _is.isCollection, isDenseMatrix: _is.isDenseMatrix, isSparseMatrix: _is.isSparseMatrix, isRange: _is.isRange, isIndex: _is.isIndex, isBoolean: _is.isBoolean, isResultSet: _is.isResultSet, isHelp: _is.isHelp, isFunction: _is.isFunction, isDate: _is.isDate, isRegExp: _is.isRegExp, isObject: _is.isObject, isNull: _is.isNull, isUndefined: _is.isUndefined, isAccessorNode: _is.isAccessorNode, isArrayNode: _is.isArrayNode, isAssignmentNode: _is.isAssignmentNode, isBlockNode: _is.isBlockNode, isConditionalNode: _is.isConditionalNode, isConstantNode: _is.isConstantNode, isFunctionAssignmentNode: _is.isFunctionAssignmentNode, isFunctionNode: _is.isFunctionNode, isIndexNode: _is.isIndexNode, isNode: _is.isNode, isObjectNode: _is.isObjectNode, isOperatorNode: _is.isOperatorNode, isParenthesisNode: _is.isParenthesisNode, isRangeNode: _is.isRangeNode, isSymbolNode: _is.isSymbolNode, isChain: _is.isChain });math.config = (0, _config.configFactory)(configInternal, math.emit), math.expression = { transform: {}, mathWithTransform: { config: math.config } };var legacyFactories = [],legacyInstances = [],importedFactories = {},internalImport = (0, _import.importFactory)(function () {for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];return math.typed.apply(math.typed, args);}, load, math, importedFactories);return math["import"] = internalImport, math.on("config", function () {(0, _object.values)(importedFactories).forEach(function (factory) {factory && factory.meta && factory.meta.recreateOnConfigChange && internalImport(factory, { override: !0 });});}), math.create = create.bind(null, factories), math.factory = _factory.factory, math["import"]((0, _object.values)((0, _object.deepFlatten)(factories))), math.ArgumentsError = _ArgumentsError.ArgumentsError, math.DimensionError = _DimensionError.DimensionError, math.IndexError = _IndexError.IndexError, math;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/core/function/config.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.configFactory = configFactory, exports.NUMBER_OPTIONS = exports.MATRIX_OPTIONS = void 0;var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_config2 = __webpack_require__("./node_modules/mathjs/lib/cjs/core/config.js"),MATRIX_OPTIONS = ["Matrix", "Array"];exports.MATRIX_OPTIONS = MATRIX_OPTIONS;var NUMBER_OPTIONS = ["number", "BigNumber", "Fraction"];exports.NUMBER_OPTIONS = NUMBER_OPTIONS;function configFactory(config, emit) {function _config(options) {if (options) {var prev = (0, _object.mapObject)(config, _object.clone);validateOption(options, "matrix", MATRIX_OPTIONS), validateOption(options, "number", NUMBER_OPTIONS), (0, _object.deepExtend)(config, options);var curr = (0, _object.mapObject)(config, _object.clone),changes = (0, _object.mapObject)(options, _object.clone);return emit("config", curr, prev, changes), curr;}return (0, _object.mapObject)(config, _object.clone);}return _config.MATRIX_OPTIONS = MATRIX_OPTIONS, _config.NUMBER_OPTIONS = NUMBER_OPTIONS, Object.keys(_config2.DEFAULT_CONFIG).forEach(function (key) {Object.defineProperty(_config, key, { get: function () {return config[key];}, enumerable: !0, configurable: !0 });}), _config;}function contains(array, item) {return -1 !== array.indexOf(item);}function validateOption(options, name, values) {options[name] === void 0 || contains(values, options[name]) || console.warn("Warning: Unknown value \"" + options[name] + "\" for configuration option \"" + name + "\". Available options: " + values.map(function (value) {return JSON.stringify(value);}).join(", ") + ".");}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/core/function/import.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.importFactory = importFactory;var _defineProperty2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),_typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_ArgumentsError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/ArgumentsError.js");function importFactory(typed, load, math, importedFactories) {function _import(name, value, options) {if (options.wrap && "function" == typeof value && (value = _wrap(value)), hasTypedFunctionSignature(value) && (value = typed(name, (0, _defineProperty2["default"])({}, value.signature, value))), isTypedFunction(math[name]) && isTypedFunction(value)) return value = options.override ? typed(name, value.signatures) : typed(math[name], value), math[name] = value, delete importedFactories[name], _importTransform(name, value), void math.emit("import", name, function () {return value;});if (void 0 === math[name] || options.override) return math[name] = value, delete importedFactories[name], _importTransform(name, value), void math.emit("import", name, function () {return value;});if (!options.silent) throw new Error("Cannot import \"" + name + "\": already exists");}function _importTransform(name, value) {value && "function" == typeof value.transform ? (math.expression.transform[name] = value.transform, allowedInExpressions(name) && (math.expression.mathWithTransform[name] = value.transform)) : (delete math.expression.transform[name], allowedInExpressions(name) && (math.expression.mathWithTransform[name] = value));}function _deleteTransform(name) {delete math.expression.transform[name], allowedInExpressions(name) ? math.expression.mathWithTransform[name] = math[name] : delete math.expression.mathWithTransform[name];}function _wrap(fn) {var wrapper = function () {for (var arg, args = [], i = 0, len = arguments.length; i < len; i++) arg = arguments[i], args[i] = arg && arg.valueOf();return fn.apply(math, args);};return fn.transform && (wrapper.transform = fn.transform), wrapper;}function _importFactory(factory, options) {var name = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : factory.fn;if ((0, _array.contains)(name, ".")) throw new Error("Factory name should not contain a nested path. Name: " + JSON.stringify(name));var namespace = isTransformFunctionFactory(factory) ? math.expression.transform : math,existingTransform = (name in math.expression.transform),existing = (0, _object.hasOwnProperty)(namespace, name) ? namespace[name] : void 0,resolver = function () {var dependencies = {};factory.dependencies.map(_factory.stripOptionalNotation).forEach(function (dependency) {if ((0, _array.contains)(dependency, ".")) throw new Error("Factory dependency should not contain a nested path. Name: " + JSON.stringify(dependency));"math" === dependency ? dependencies.math = math : "mathWithTransform" === dependency ? dependencies.mathWithTransform = math.expression.mathWithTransform : "classes" === dependency ? dependencies.classes = math : dependencies[dependency] = math[dependency];});var instance = factory(dependencies);if (instance && "function" == typeof instance.transform) throw new Error("Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path=\"expression.transform\"");if (void 0 === existing || options.override) return instance;if (isTypedFunction(existing) && isTypedFunction(instance)) return typed(existing, instance);if (options.silent) return existing;throw new Error("Cannot import \"" + name + "\": already exists");};factory.meta && !1 === factory.meta.lazy ? (namespace[name] = resolver(), existing && existingTransform ? _deleteTransform(name) : (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) && (0, _object.lazy)(math.expression.mathWithTransform, name, function () {return namespace[name];})) : ((0, _object.lazy)(namespace, name, resolver), existing && existingTransform ? _deleteTransform(name) : (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) && (0, _object.lazy)(math.expression.mathWithTransform, name, function () {return namespace[name];})), importedFactories[name] = factory, math.emit("import", name, resolver);}function isSupportedType(object) {return "function" == typeof object || "number" == typeof object || "string" == typeof object || "boolean" == typeof object || null === object || (0, _is.isUnit)(object) || (0, _is.isComplex)(object) || (0, _is.isBigNumber)(object) || (0, _is.isFraction)(object) || (0, _is.isMatrix)(object) || Array.isArray(object);}function isTypedFunction(fn) {return "function" == typeof fn && "object" === (0, _typeof2["default"])(fn.signatures);}function hasTypedFunctionSignature(fn) {return "function" == typeof fn && "string" == typeof fn.signature;}function allowedInExpressions(name) {return !(0, _object.hasOwnProperty)(unsafe, name);}function factoryAllowedInExpressions(factory) {return -1 === factory.fn.indexOf(".") && !(0, _object.hasOwnProperty)(unsafe, factory.fn) && (!factory.meta || !factory.meta.isClass);}function isTransformFunctionFactory(factory) {return factory !== void 0 && factory.meta !== void 0 && !0 === factory.meta.isTransformFunction || !1;}var unsafe = { expression: !0, type: !0, docs: !0, error: !0, json: !0, chain: !0 };return function (functions, options) {function flattenImports(flatValues, value, name) {if (Array.isArray(value)) value.forEach(function (item) {return flattenImports(flatValues, item);});else if ("object" === (0, _typeof2["default"])(value)) for (var _name in value) (0, _object.hasOwnProperty)(value, _name) && flattenImports(flatValues, value[_name], _name);else if ((0, _factory.isFactory)(value) || void 0 !== name) {var flatName = (0, _factory.isFactory)(value) ? isTransformFunctionFactory(value) ? value.fn + ".transform" : value.fn : name;if ((0, _object.hasOwnProperty)(flatValues, flatName) && flatValues[flatName] !== value && !options.silent) throw new Error("Cannot import \"" + flatName + "\" twice");flatValues[flatName] = value;} else if (!options.silent) throw new TypeError("Factory, Object, or Array expected");}var num = arguments.length;if (1 !== num && 2 !== num) throw new _ArgumentsError.ArgumentsError("import", num, 1, 2);options || (options = {});var flatValues = {};for (var name in flattenImports(flatValues, functions), flatValues) if ((0, _object.hasOwnProperty)(flatValues, name)) {var value = flatValues[name];if ((0, _factory.isFactory)(value)) _importFactory(value, options);else if (isSupportedType(value)) _import(name, value, options);else if (!options.silent) throw new TypeError("Factory, Object, or Array expected");}};}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/core/function/typed.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createTyped = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_typedFunction = _interopRequireDefault(__webpack_require__("./node_modules/typed-function/typed-function.js")),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_map = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/map.js"),_createTyped2 = function () {return _createTyped2 = _typedFunction["default"].create, _typedFunction["default"];},dependencies = ["?BigNumber", "?Complex", "?DenseMatrix", "?Fraction"],createTyped = (0, _factory.factory)("typed", dependencies, function (_ref) {var BigNumber = _ref.BigNumber,Complex = _ref.Complex,DenseMatrix = _ref.DenseMatrix,Fraction = _ref.Fraction,typed = _createTyped2();return typed.types = [{ name: "number", test: _is.isNumber }, { name: "Complex", test: _is.isComplex }, { name: "BigNumber", test: _is.isBigNumber }, { name: "Fraction", test: _is.isFraction }, { name: "Unit", test: _is.isUnit }, { name: "string", test: _is.isString }, { name: "Chain", test: _is.isChain }, { name: "Array", test: _is.isArray }, { name: "Matrix", test: _is.isMatrix }, { name: "DenseMatrix", test: _is.isDenseMatrix }, { name: "SparseMatrix", test: _is.isSparseMatrix }, { name: "Range", test: _is.isRange }, { name: "Index", test: _is.isIndex }, { name: "boolean", test: _is.isBoolean }, { name: "ResultSet", test: _is.isResultSet }, { name: "Help", test: _is.isHelp }, { name: "function", test: _is.isFunction }, { name: "Date", test: _is.isDate }, { name: "RegExp", test: _is.isRegExp }, { name: "null", test: _is.isNull }, { name: "undefined", test: _is.isUndefined }, { name: "AccessorNode", test: _is.isAccessorNode }, { name: "ArrayNode", test: _is.isArrayNode }, { name: "AssignmentNode", test: _is.isAssignmentNode }, { name: "BlockNode", test: _is.isBlockNode }, { name: "ConditionalNode", test: _is.isConditionalNode }, { name: "ConstantNode", test: _is.isConstantNode }, { name: "FunctionNode", test: _is.isFunctionNode }, { name: "FunctionAssignmentNode", test: _is.isFunctionAssignmentNode }, { name: "IndexNode", test: _is.isIndexNode }, { name: "Node", test: _is.isNode }, { name: "ObjectNode", test: _is.isObjectNode }, { name: "OperatorNode", test: _is.isOperatorNode }, { name: "ParenthesisNode", test: _is.isParenthesisNode }, { name: "RangeNode", test: _is.isRangeNode }, { name: "SymbolNode", test: _is.isSymbolNode }, { name: "Map", test: _map.isMap }, { name: "Object", test: _is.isObject }], typed.conversions = [{ from: "number", to: "BigNumber", convert: function (x) {if (BigNumber || throwNoBignumber(x), 15 < (0, _number.digits)(x)) throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: " + x + "). Use function bignumber(x) to convert to BigNumber.");return new BigNumber(x);} }, { from: "number", to: "Complex", convert: function (x) {return Complex || throwNoComplex(x), new Complex(x, 0);} }, { from: "number", to: "string", convert: function (x) {return x + "";} }, { from: "BigNumber", to: "Complex", convert: function (x) {return Complex || throwNoComplex(x), new Complex(x.toNumber(), 0);} }, { from: "Fraction", to: "BigNumber", convert: function () {throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.");} }, { from: "Fraction", to: "Complex", convert: function (x) {return Complex || throwNoComplex(x), new Complex(x.valueOf(), 0);} }, { from: "number", to: "Fraction", convert: function (x) {Fraction || throwNoFraction(x);var f = new Fraction(x);if (f.valueOf() !== x) throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: " + x + "). Use function fraction(x) to convert to Fraction.");return f;} }, { from: "string", to: "number", convert: function (x) {var n = +x;if (isNaN(n)) throw new Error("Cannot convert \"" + x + "\" to a number");return n;} }, { from: "string", to: "BigNumber", convert: function (x) {BigNumber || throwNoBignumber(x);try {return new BigNumber(x);} catch (err) {throw new Error("Cannot convert \"" + x + "\" to BigNumber");}} }, { from: "string", to: "Fraction", convert: function (x) {Fraction || throwNoFraction(x);try {return new Fraction(x);} catch (err) {throw new Error("Cannot convert \"" + x + "\" to Fraction");}} }, { from: "string", to: "Complex", convert: function (x) {Complex || throwNoComplex(x);try {return new Complex(x);} catch (err) {throw new Error("Cannot convert \"" + x + "\" to Complex");}} }, { from: "boolean", to: "number", convert: function (x) {return +x;} }, { from: "boolean", to: "BigNumber", convert: function (x) {return BigNumber || throwNoBignumber(x), new BigNumber(+x);} }, { from: "boolean", to: "Fraction", convert: function (x) {return Fraction || throwNoFraction(x), new Fraction(+x);} }, { from: "boolean", to: "string", convert: function (x) {return x + "";} }, { from: "Array", to: "Matrix", convert: function (array) {return DenseMatrix || throwNoMatrix(), new DenseMatrix(array);} }, { from: "Matrix", to: "Array", convert: function (matrix) {return matrix.valueOf();} }], typed;});exports.createTyped = createTyped;function throwNoBignumber(x) {throw new Error("Cannot convert value ".concat(x, " into a BigNumber: no class 'BigNumber' provided"));}function throwNoComplex(x) {throw new Error("Cannot convert value ".concat(x, " into a Complex number: no class 'Complex' provided"));}function throwNoMatrix() {throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided");}function throwNoFraction(x) {throw new Error("Cannot convert value ".concat(x, " into a Fraction, no class 'Fraction' provided."));}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/allFactoriesAny.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.all = void 0;var allFactories = _interopRequireWildcard(__webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"));function _getRequireWildcardCache(nodeInterop) {if ("function" != typeof WeakMap) return null;var cacheBabelInterop = new WeakMap(),cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function (nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) return obj;if (null === obj || "object" !== _typeof(obj) && "function" != typeof obj) return { default: obj };var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) return cache.get(obj);var newObj = {},hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) if ("default" != key && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;desc && (desc.get || desc.set) ? Object.defineProperty(newObj, key, desc) : newObj[key] = obj[key];}return newObj["default"] = obj, cache && cache.set(obj, newObj), newObj;}var all = allFactories;exports.all = all;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/configReadonly.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.config = void 0;var _extends2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/extends.js")),_config = __webpack_require__("./node_modules/mathjs/lib/cjs/core/config.js"),_config2 = __webpack_require__("./node_modules/mathjs/lib/cjs/core/function/config.js"),config = function (options) {if (options) throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n  import { create, all } from 'mathjs';\n  const mathjs = create(all);\n  mathjs.config({ number: 'BigNumber' });\n");return Object.freeze(_config.DEFAULT_CONFIG);};exports.config = config, (0, _extends2["default"])(config, _config.DEFAULT_CONFIG, { MATRIX_OPTIONS: _config2.MATRIX_OPTIONS, NUMBER_OPTIONS: _config2.NUMBER_OPTIONS });

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), Object.defineProperty(exports, "typedDependencies", ({ enumerable: !0, get: function () {return _dependenciesTypedGenerated.typedDependencies;} })), Object.defineProperty(exports, "ResultSetDependencies", ({ enumerable: !0, get: function () {return _dependenciesResultSetGenerated.ResultSetDependencies;} })), Object.defineProperty(exports, "BigNumberDependencies", ({ enumerable: !0, get: function () {return _dependenciesBigNumberClassGenerated.BigNumberDependencies;} })), Object.defineProperty(exports, "ComplexDependencies", ({ enumerable: !0, get: function () {return _dependenciesComplexClassGenerated.ComplexDependencies;} })), Object.defineProperty(exports, "FractionDependencies", ({ enumerable: !0, get: function () {return _dependenciesFractionClassGenerated.FractionDependencies;} })), Object.defineProperty(exports, "RangeDependencies", ({ enumerable: !0, get: function () {return _dependenciesRangeClassGenerated.RangeDependencies;} })), Object.defineProperty(exports, "MatrixDependencies", ({ enumerable: !0, get: function () {return _dependenciesMatrixClassGenerated.MatrixDependencies;} })), Object.defineProperty(exports, "DenseMatrixDependencies", ({ enumerable: !0, get: function () {return _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies;} })), Object.defineProperty(exports, "cloneDependencies", ({ enumerable: !0, get: function () {return _dependenciesCloneGenerated.cloneDependencies;} })), Object.defineProperty(exports, "isIntegerDependencies", ({ enumerable: !0, get: function () {return _dependenciesIsIntegerGenerated.isIntegerDependencies;} })), Object.defineProperty(exports, "isNegativeDependencies", ({ enumerable: !0, get: function () {return _dependenciesIsNegativeGenerated.isNegativeDependencies;} })), Object.defineProperty(exports, "isNumericDependencies", ({ enumerable: !0, get: function () {return _dependenciesIsNumericGenerated.isNumericDependencies;} })), Object.defineProperty(exports, "hasNumericValueDependencies", ({ enumerable: !0, get: function () {return _dependenciesHasNumericValueGenerated.hasNumericValueDependencies;} })), Object.defineProperty(exports, "isPositiveDependencies", ({ enumerable: !0, get: function () {return _dependenciesIsPositiveGenerated.isPositiveDependencies;} })), Object.defineProperty(exports, "isZeroDependencies", ({ enumerable: !0, get: function () {return _dependenciesIsZeroGenerated.isZeroDependencies;} })), Object.defineProperty(exports, "isNaNDependencies", ({ enumerable: !0, get: function () {return _dependenciesIsNaNGenerated.isNaNDependencies;} })), Object.defineProperty(exports, "typeOfDependencies", ({ enumerable: !0, get: function () {return _dependenciesTypeOfGenerated.typeOfDependencies;} })), Object.defineProperty(exports, "equalScalarDependencies", ({ enumerable: !0, get: function () {return _dependenciesEqualScalarGenerated.equalScalarDependencies;} })), Object.defineProperty(exports, "SparseMatrixDependencies", ({ enumerable: !0, get: function () {return _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies;} })), Object.defineProperty(exports, "numberDependencies", ({ enumerable: !0, get: function () {return _dependenciesNumberGenerated.numberDependencies;} })), Object.defineProperty(exports, "stringDependencies", ({ enumerable: !0, get: function () {return _dependenciesStringGenerated.stringDependencies;} })), Object.defineProperty(exports, "booleanDependencies", ({ enumerable: !0, get: function () {return _dependenciesBooleanGenerated.booleanDependencies;} })), Object.defineProperty(exports, "bignumberDependencies", ({ enumerable: !0, get: function () {return _dependenciesBignumberGenerated.bignumberDependencies;} })), Object.defineProperty(exports, "complexDependencies", ({ enumerable: !0, get: function () {return _dependenciesComplexGenerated.complexDependencies;} })), Object.defineProperty(exports, "fractionDependencies", ({ enumerable: !0, get: function () {return _dependenciesFractionGenerated.fractionDependencies;} })), Object.defineProperty(exports, "matrixDependencies", ({ enumerable: !0, get: function () {return _dependenciesMatrixGenerated.matrixDependencies;} })), Object.defineProperty(exports, "matrixFromFunctionDependencies", ({ enumerable: !0, get: function () {return _dependenciesMatrixFromFunctionGenerated.matrixFromFunctionDependencies;} })), Object.defineProperty(exports, "matrixFromRowsDependencies", ({ enumerable: !0, get: function () {return _dependenciesMatrixFromRowsGenerated.matrixFromRowsDependencies;} })), Object.defineProperty(exports, "matrixFromColumnsDependencies", ({ enumerable: !0, get: function () {return _dependenciesMatrixFromColumnsGenerated.matrixFromColumnsDependencies;} })), Object.defineProperty(exports, "splitUnitDependencies", ({ enumerable: !0, get: function () {return _dependenciesSplitUnitGenerated.splitUnitDependencies;} })), Object.defineProperty(exports, "unaryMinusDependencies", ({ enumerable: !0, get: function () {return _dependenciesUnaryMinusGenerated.unaryMinusDependencies;} })), Object.defineProperty(exports, "unaryPlusDependencies", ({ enumerable: !0, get: function () {return _dependenciesUnaryPlusGenerated.unaryPlusDependencies;} })), Object.defineProperty(exports, "absDependencies", ({ enumerable: !0, get: function () {return _dependenciesAbsGenerated.absDependencies;} })), Object.defineProperty(exports, "applyDependencies", ({ enumerable: !0, get: function () {return _dependenciesApplyGenerated.applyDependencies;} })), Object.defineProperty(exports, "addScalarDependencies", ({ enumerable: !0, get: function () {return _dependenciesAddScalarGenerated.addScalarDependencies;} })), Object.defineProperty(exports, "cbrtDependencies", ({ enumerable: !0, get: function () {return _dependenciesCbrtGenerated.cbrtDependencies;} })), Object.defineProperty(exports, "ceilDependencies", ({ enumerable: !0, get: function () {return _dependenciesCeilGenerated.ceilDependencies;} })), Object.defineProperty(exports, "cubeDependencies", ({ enumerable: !0, get: function () {return _dependenciesCubeGenerated.cubeDependencies;} })), Object.defineProperty(exports, "expDependencies", ({ enumerable: !0, get: function () {return _dependenciesExpGenerated.expDependencies;} })), Object.defineProperty(exports, "expm1Dependencies", ({ enumerable: !0, get: function () {return _dependenciesExpm1Generated.expm1Dependencies;} })), Object.defineProperty(exports, "fixDependencies", ({ enumerable: !0, get: function () {return _dependenciesFixGenerated.fixDependencies;} })), Object.defineProperty(exports, "floorDependencies", ({ enumerable: !0, get: function () {return _dependenciesFloorGenerated.floorDependencies;} })), Object.defineProperty(exports, "gcdDependencies", ({ enumerable: !0, get: function () {return _dependenciesGcdGenerated.gcdDependencies;} })), Object.defineProperty(exports, "lcmDependencies", ({ enumerable: !0, get: function () {return _dependenciesLcmGenerated.lcmDependencies;} })), Object.defineProperty(exports, "log10Dependencies", ({ enumerable: !0, get: function () {return _dependenciesLog10Generated.log10Dependencies;} })), Object.defineProperty(exports, "log2Dependencies", ({ enumerable: !0, get: function () {return _dependenciesLog2Generated.log2Dependencies;} })), Object.defineProperty(exports, "modDependencies", ({ enumerable: !0, get: function () {return _dependenciesModGenerated.modDependencies;} })), Object.defineProperty(exports, "multiplyScalarDependencies", ({ enumerable: !0, get: function () {return _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies;} })), Object.defineProperty(exports, "multiplyDependencies", ({ enumerable: !0, get: function () {return _dependenciesMultiplyGenerated.multiplyDependencies;} })), Object.defineProperty(exports, "nthRootDependencies", ({ enumerable: !0, get: function () {return _dependenciesNthRootGenerated.nthRootDependencies;} })), Object.defineProperty(exports, "signDependencies", ({ enumerable: !0, get: function () {return _dependenciesSignGenerated.signDependencies;} })), Object.defineProperty(exports, "sqrtDependencies", ({ enumerable: !0, get: function () {return _dependenciesSqrtGenerated.sqrtDependencies;} })), Object.defineProperty(exports, "squareDependencies", ({ enumerable: !0, get: function () {return _dependenciesSquareGenerated.squareDependencies;} })), Object.defineProperty(exports, "subtractDependencies", ({ enumerable: !0, get: function () {return _dependenciesSubtractGenerated.subtractDependencies;} })), Object.defineProperty(exports, "xgcdDependencies", ({ enumerable: !0, get: function () {return _dependenciesXgcdGenerated.xgcdDependencies;} })), Object.defineProperty(exports, "dotMultiplyDependencies", ({ enumerable: !0, get: function () {return _dependenciesDotMultiplyGenerated.dotMultiplyDependencies;} })), Object.defineProperty(exports, "bitAndDependencies", ({ enumerable: !0, get: function () {return _dependenciesBitAndGenerated.bitAndDependencies;} })), Object.defineProperty(exports, "bitNotDependencies", ({ enumerable: !0, get: function () {return _dependenciesBitNotGenerated.bitNotDependencies;} })), Object.defineProperty(exports, "bitOrDependencies", ({ enumerable: !0, get: function () {return _dependenciesBitOrGenerated.bitOrDependencies;} })), Object.defineProperty(exports, "bitXorDependencies", ({ enumerable: !0, get: function () {return _dependenciesBitXorGenerated.bitXorDependencies;} })), Object.defineProperty(exports, "argDependencies", ({ enumerable: !0, get: function () {return _dependenciesArgGenerated.argDependencies;} })), Object.defineProperty(exports, "conjDependencies", ({ enumerable: !0, get: function () {return _dependenciesConjGenerated.conjDependencies;} })), Object.defineProperty(exports, "imDependencies", ({ enumerable: !0, get: function () {return _dependenciesImGenerated.imDependencies;} })), Object.defineProperty(exports, "reDependencies", ({ enumerable: !0, get: function () {return _dependenciesReGenerated.reDependencies;} })), Object.defineProperty(exports, "notDependencies", ({ enumerable: !0, get: function () {return _dependenciesNotGenerated.notDependencies;} })), Object.defineProperty(exports, "orDependencies", ({ enumerable: !0, get: function () {return _dependenciesOrGenerated.orDependencies;} })), Object.defineProperty(exports, "xorDependencies", ({ enumerable: !0, get: function () {return _dependenciesXorGenerated.xorDependencies;} })), Object.defineProperty(exports, "concatDependencies", ({ enumerable: !0, get: function () {return _dependenciesConcatGenerated.concatDependencies;} })), Object.defineProperty(exports, "columnDependencies", ({ enumerable: !0, get: function () {return _dependenciesColumnGenerated.columnDependencies;} })), Object.defineProperty(exports, "countDependencies", ({ enumerable: !0, get: function () {return _dependenciesCountGenerated.countDependencies;} })), Object.defineProperty(exports, "crossDependencies", ({ enumerable: !0, get: function () {return _dependenciesCrossGenerated.crossDependencies;} })), Object.defineProperty(exports, "diagDependencies", ({ enumerable: !0, get: function () {return _dependenciesDiagGenerated.diagDependencies;} })), Object.defineProperty(exports, "filterDependencies", ({ enumerable: !0, get: function () {return _dependenciesFilterGenerated.filterDependencies;} })), Object.defineProperty(exports, "flattenDependencies", ({ enumerable: !0, get: function () {return _dependenciesFlattenGenerated.flattenDependencies;} })), Object.defineProperty(exports, "forEachDependencies", ({ enumerable: !0, get: function () {return _dependenciesForEachGenerated.forEachDependencies;} })), Object.defineProperty(exports, "getMatrixDataTypeDependencies", ({ enumerable: !0, get: function () {return _dependenciesGetMatrixDataTypeGenerated.getMatrixDataTypeDependencies;} })), Object.defineProperty(exports, "identityDependencies", ({ enumerable: !0, get: function () {return _dependenciesIdentityGenerated.identityDependencies;} })), Object.defineProperty(exports, "kronDependencies", ({ enumerable: !0, get: function () {return _dependenciesKronGenerated.kronDependencies;} })), Object.defineProperty(exports, "mapDependencies", ({ enumerable: !0, get: function () {return _dependenciesMapGenerated.mapDependencies;} })), Object.defineProperty(exports, "diffDependencies", ({ enumerable: !0, get: function () {return _dependenciesDiffGenerated.diffDependencies;} })), Object.defineProperty(exports, "onesDependencies", ({ enumerable: !0, get: function () {return _dependenciesOnesGenerated.onesDependencies;} })), Object.defineProperty(exports, "rangeDependencies", ({ enumerable: !0, get: function () {return _dependenciesRangeGenerated.rangeDependencies;} })), Object.defineProperty(exports, "reshapeDependencies", ({ enumerable: !0, get: function () {return _dependenciesReshapeGenerated.reshapeDependencies;} })), Object.defineProperty(exports, "resizeDependencies", ({ enumerable: !0, get: function () {return _dependenciesResizeGenerated.resizeDependencies;} })), Object.defineProperty(exports, "rotateDependencies", ({ enumerable: !0, get: function () {return _dependenciesRotateGenerated.rotateDependencies;} })), Object.defineProperty(exports, "rotationMatrixDependencies", ({ enumerable: !0, get: function () {return _dependenciesRotationMatrixGenerated.rotationMatrixDependencies;} })), Object.defineProperty(exports, "rowDependencies", ({ enumerable: !0, get: function () {return _dependenciesRowGenerated.rowDependencies;} })), Object.defineProperty(exports, "sizeDependencies", ({ enumerable: !0, get: function () {return _dependenciesSizeGenerated.sizeDependencies;} })), Object.defineProperty(exports, "squeezeDependencies", ({ enumerable: !0, get: function () {return _dependenciesSqueezeGenerated.squeezeDependencies;} })), Object.defineProperty(exports, "subsetDependencies", ({ enumerable: !0, get: function () {return _dependenciesSubsetGenerated.subsetDependencies;} })), Object.defineProperty(exports, "transposeDependencies", ({ enumerable: !0, get: function () {return _dependenciesTransposeGenerated.transposeDependencies;} })), Object.defineProperty(exports, "ctransposeDependencies", ({ enumerable: !0, get: function () {return _dependenciesCtransposeGenerated.ctransposeDependencies;} })), Object.defineProperty(exports, "zerosDependencies", ({ enumerable: !0, get: function () {return _dependenciesZerosGenerated.zerosDependencies;} })), Object.defineProperty(exports, "erfDependencies", ({ enumerable: !0, get: function () {return _dependenciesErfGenerated.erfDependencies;} })), Object.defineProperty(exports, "modeDependencies", ({ enumerable: !0, get: function () {return _dependenciesModeGenerated.modeDependencies;} })), Object.defineProperty(exports, "prodDependencies", ({ enumerable: !0, get: function () {return _dependenciesProdGenerated.prodDependencies;} })), Object.defineProperty(exports, "formatDependencies", ({ enumerable: !0, get: function () {return _dependenciesFormatGenerated.formatDependencies;} })), Object.defineProperty(exports, "binDependencies", ({ enumerable: !0, get: function () {return _dependenciesBinGenerated.binDependencies;} })), Object.defineProperty(exports, "octDependencies", ({ enumerable: !0, get: function () {return _dependenciesOctGenerated.octDependencies;} })), Object.defineProperty(exports, "hexDependencies", ({ enumerable: !0, get: function () {return _dependenciesHexGenerated.hexDependencies;} })), Object.defineProperty(exports, "printDependencies", ({ enumerable: !0, get: function () {return _dependenciesPrintGenerated.printDependencies;} })), Object.defineProperty(exports, "toDependencies", ({ enumerable: !0, get: function () {return _dependenciesToGenerated.toDependencies;} })), Object.defineProperty(exports, "isPrimeDependencies", ({ enumerable: !0, get: function () {return _dependenciesIsPrimeGenerated.isPrimeDependencies;} })), Object.defineProperty(exports, "numericDependencies", ({ enumerable: !0, get: function () {return _dependenciesNumericGenerated.numericDependencies;} })), Object.defineProperty(exports, "divideScalarDependencies", ({ enumerable: !0, get: function () {return _dependenciesDivideScalarGenerated.divideScalarDependencies;} })), Object.defineProperty(exports, "powDependencies", ({ enumerable: !0, get: function () {return _dependenciesPowGenerated.powDependencies;} })), Object.defineProperty(exports, "roundDependencies", ({ enumerable: !0, get: function () {return _dependenciesRoundGenerated.roundDependencies;} })), Object.defineProperty(exports, "logDependencies", ({ enumerable: !0, get: function () {return _dependenciesLogGenerated.logDependencies;} })), Object.defineProperty(exports, "log1pDependencies", ({ enumerable: !0, get: function () {return _dependenciesLog1pGenerated.log1pDependencies;} })), Object.defineProperty(exports, "nthRootsDependencies", ({ enumerable: !0, get: function () {return _dependenciesNthRootsGenerated.nthRootsDependencies;} })), Object.defineProperty(exports, "dotPowDependencies", ({ enumerable: !0, get: function () {return _dependenciesDotPowGenerated.dotPowDependencies;} })), Object.defineProperty(exports, "dotDivideDependencies", ({ enumerable: !0, get: function () {return _dependenciesDotDivideGenerated.dotDivideDependencies;} })), Object.defineProperty(exports, "lsolveDependencies", ({ enumerable: !0, get: function () {return _dependenciesLsolveGenerated.lsolveDependencies;} })), Object.defineProperty(exports, "usolveDependencies", ({ enumerable: !0, get: function () {return _dependenciesUsolveGenerated.usolveDependencies;} })), Object.defineProperty(exports, "lsolveAllDependencies", ({ enumerable: !0, get: function () {return _dependenciesLsolveAllGenerated.lsolveAllDependencies;} })), Object.defineProperty(exports, "usolveAllDependencies", ({ enumerable: !0, get: function () {return _dependenciesUsolveAllGenerated.usolveAllDependencies;} })), Object.defineProperty(exports, "leftShiftDependencies", ({ enumerable: !0, get: function () {return _dependenciesLeftShiftGenerated.leftShiftDependencies;} })), Object.defineProperty(exports, "rightArithShiftDependencies", ({ enumerable: !0, get: function () {return _dependenciesRightArithShiftGenerated.rightArithShiftDependencies;} })), Object.defineProperty(exports, "rightLogShiftDependencies", ({ enumerable: !0, get: function () {return _dependenciesRightLogShiftGenerated.rightLogShiftDependencies;} })), Object.defineProperty(exports, "andDependencies", ({ enumerable: !0, get: function () {return _dependenciesAndGenerated.andDependencies;} })), Object.defineProperty(exports, "compareDependencies", ({ enumerable: !0, get: function () {return _dependenciesCompareGenerated.compareDependencies;} })), Object.defineProperty(exports, "compareNaturalDependencies", ({ enumerable: !0, get: function () {return _dependenciesCompareNaturalGenerated.compareNaturalDependencies;} })), Object.defineProperty(exports, "compareTextDependencies", ({ enumerable: !0, get: function () {return _dependenciesCompareTextGenerated.compareTextDependencies;} })), Object.defineProperty(exports, "equalDependencies", ({ enumerable: !0, get: function () {return _dependenciesEqualGenerated.equalDependencies;} })), Object.defineProperty(exports, "equalTextDependencies", ({ enumerable: !0, get: function () {return _dependenciesEqualTextGenerated.equalTextDependencies;} })), Object.defineProperty(exports, "smallerDependencies", ({ enumerable: !0, get: function () {return _dependenciesSmallerGenerated.smallerDependencies;} })), Object.defineProperty(exports, "smallerEqDependencies", ({ enumerable: !0, get: function () {return _dependenciesSmallerEqGenerated.smallerEqDependencies;} })), Object.defineProperty(exports, "largerDependencies", ({ enumerable: !0, get: function () {return _dependenciesLargerGenerated.largerDependencies;} })), Object.defineProperty(exports, "largerEqDependencies", ({ enumerable: !0, get: function () {return _dependenciesLargerEqGenerated.largerEqDependencies;} })), Object.defineProperty(exports, "deepEqualDependencies", ({ enumerable: !0, get: function () {return _dependenciesDeepEqualGenerated.deepEqualDependencies;} })), Object.defineProperty(exports, "unequalDependencies", ({ enumerable: !0, get: function () {return _dependenciesUnequalGenerated.unequalDependencies;} })), Object.defineProperty(exports, "partitionSelectDependencies", ({ enumerable: !0, get: function () {return _dependenciesPartitionSelectGenerated.partitionSelectDependencies;} })), Object.defineProperty(exports, "sortDependencies", ({ enumerable: !0, get: function () {return _dependenciesSortGenerated.sortDependencies;} })), Object.defineProperty(exports, "maxDependencies", ({ enumerable: !0, get: function () {return _dependenciesMaxGenerated.maxDependencies;} })), Object.defineProperty(exports, "minDependencies", ({ enumerable: !0, get: function () {return _dependenciesMinGenerated.minDependencies;} })), Object.defineProperty(exports, "ImmutableDenseMatrixDependencies", ({ enumerable: !0, get: function () {return _dependenciesImmutableDenseMatrixClassGenerated.ImmutableDenseMatrixDependencies;} })), Object.defineProperty(exports, "IndexDependencies", ({ enumerable: !0, get: function () {return _dependenciesIndexClassGenerated.IndexDependencies;} })), Object.defineProperty(exports, "FibonacciHeapDependencies", ({ enumerable: !0, get: function () {return _dependenciesFibonacciHeapClassGenerated.FibonacciHeapDependencies;} })), Object.defineProperty(exports, "SpaDependencies", ({ enumerable: !0, get: function () {return _dependenciesSpaClassGenerated.SpaDependencies;} })), Object.defineProperty(exports, "UnitDependencies", ({ enumerable: !0, get: function () {return _dependenciesUnitClassGenerated.UnitDependencies;} })), Object.defineProperty(exports, "unitDependencies", ({ enumerable: !0, get: function () {return _dependenciesUnitFunctionGenerated.unitDependencies;} })), Object.defineProperty(exports, "sparseDependencies", ({ enumerable: !0, get: function () {return _dependenciesSparseGenerated.sparseDependencies;} })), Object.defineProperty(exports, "createUnitDependencies", ({ enumerable: !0, get: function () {return _dependenciesCreateUnitGenerated.createUnitDependencies;} })), Object.defineProperty(exports, "acosDependencies", ({ enumerable: !0, get: function () {return _dependenciesAcosGenerated.acosDependencies;} })), Object.defineProperty(exports, "acoshDependencies", ({ enumerable: !0, get: function () {return _dependenciesAcoshGenerated.acoshDependencies;} })), Object.defineProperty(exports, "acotDependencies", ({ enumerable: !0, get: function () {return _dependenciesAcotGenerated.acotDependencies;} })), Object.defineProperty(exports, "acothDependencies", ({ enumerable: !0, get: function () {return _dependenciesAcothGenerated.acothDependencies;} })), Object.defineProperty(exports, "acscDependencies", ({ enumerable: !0, get: function () {return _dependenciesAcscGenerated.acscDependencies;} })), Object.defineProperty(exports, "acschDependencies", ({ enumerable: !0, get: function () {return _dependenciesAcschGenerated.acschDependencies;} })), Object.defineProperty(exports, "asecDependencies", ({ enumerable: !0, get: function () {return _dependenciesAsecGenerated.asecDependencies;} })), Object.defineProperty(exports, "asechDependencies", ({ enumerable: !0, get: function () {return _dependenciesAsechGenerated.asechDependencies;} })), Object.defineProperty(exports, "asinDependencies", ({ enumerable: !0, get: function () {return _dependenciesAsinGenerated.asinDependencies;} })), Object.defineProperty(exports, "asinhDependencies", ({ enumerable: !0, get: function () {return _dependenciesAsinhGenerated.asinhDependencies;} })), Object.defineProperty(exports, "atanDependencies", ({ enumerable: !0, get: function () {return _dependenciesAtanGenerated.atanDependencies;} })), Object.defineProperty(exports, "atan2Dependencies", ({ enumerable: !0, get: function () {return _dependenciesAtan2Generated.atan2Dependencies;} })), Object.defineProperty(exports, "atanhDependencies", ({ enumerable: !0, get: function () {return _dependenciesAtanhGenerated.atanhDependencies;} })), Object.defineProperty(exports, "cosDependencies", ({ enumerable: !0, get: function () {return _dependenciesCosGenerated.cosDependencies;} })), Object.defineProperty(exports, "coshDependencies", ({ enumerable: !0, get: function () {return _dependenciesCoshGenerated.coshDependencies;} })), Object.defineProperty(exports, "cotDependencies", ({ enumerable: !0, get: function () {return _dependenciesCotGenerated.cotDependencies;} })), Object.defineProperty(exports, "cothDependencies", ({ enumerable: !0, get: function () {return _dependenciesCothGenerated.cothDependencies;} })), Object.defineProperty(exports, "cscDependencies", ({ enumerable: !0, get: function () {return _dependenciesCscGenerated.cscDependencies;} })), Object.defineProperty(exports, "cschDependencies", ({ enumerable: !0, get: function () {return _dependenciesCschGenerated.cschDependencies;} })), Object.defineProperty(exports, "secDependencies", ({ enumerable: !0, get: function () {return _dependenciesSecGenerated.secDependencies;} })), Object.defineProperty(exports, "sechDependencies", ({ enumerable: !0, get: function () {return _dependenciesSechGenerated.sechDependencies;} })), Object.defineProperty(exports, "sinDependencies", ({ enumerable: !0, get: function () {return _dependenciesSinGenerated.sinDependencies;} })), Object.defineProperty(exports, "sinhDependencies", ({ enumerable: !0, get: function () {return _dependenciesSinhGenerated.sinhDependencies;} })), Object.defineProperty(exports, "tanDependencies", ({ enumerable: !0, get: function () {return _dependenciesTanGenerated.tanDependencies;} })), Object.defineProperty(exports, "tanhDependencies", ({ enumerable: !0, get: function () {return _dependenciesTanhGenerated.tanhDependencies;} })), Object.defineProperty(exports, "setCartesianDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetCartesianGenerated.setCartesianDependencies;} })), Object.defineProperty(exports, "setDifferenceDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetDifferenceGenerated.setDifferenceDependencies;} })), Object.defineProperty(exports, "setDistinctDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetDistinctGenerated.setDistinctDependencies;} })), Object.defineProperty(exports, "setIntersectDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetIntersectGenerated.setIntersectDependencies;} })), Object.defineProperty(exports, "setIsSubsetDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetIsSubsetGenerated.setIsSubsetDependencies;} })), Object.defineProperty(exports, "setMultiplicityDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetMultiplicityGenerated.setMultiplicityDependencies;} })), Object.defineProperty(exports, "setPowersetDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetPowersetGenerated.setPowersetDependencies;} })), Object.defineProperty(exports, "setSizeDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetSizeGenerated.setSizeDependencies;} })), Object.defineProperty(exports, "setSymDifferenceDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetSymDifferenceGenerated.setSymDifferenceDependencies;} })), Object.defineProperty(exports, "setUnionDependencies", ({ enumerable: !0, get: function () {return _dependenciesSetUnionGenerated.setUnionDependencies;} })), Object.defineProperty(exports, "addDependencies", ({ enumerable: !0, get: function () {return _dependenciesAddGenerated.addDependencies;} })), Object.defineProperty(exports, "hypotDependencies", ({ enumerable: !0, get: function () {return _dependenciesHypotGenerated.hypotDependencies;} })), Object.defineProperty(exports, "normDependencies", ({ enumerable: !0, get: function () {return _dependenciesNormGenerated.normDependencies;} })), Object.defineProperty(exports, "dotDependencies", ({ enumerable: !0, get: function () {return _dependenciesDotGenerated.dotDependencies;} })), Object.defineProperty(exports, "traceDependencies", ({ enumerable: !0, get: function () {return _dependenciesTraceGenerated.traceDependencies;} })), Object.defineProperty(exports, "indexDependencies", ({ enumerable: !0, get: function () {return _dependenciesIndexGenerated.indexDependencies;} })), Object.defineProperty(exports, "NodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesNodeGenerated.NodeDependencies;} })), Object.defineProperty(exports, "AccessorNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesAccessorNodeGenerated.AccessorNodeDependencies;} })), Object.defineProperty(exports, "ArrayNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesArrayNodeGenerated.ArrayNodeDependencies;} })), Object.defineProperty(exports, "AssignmentNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesAssignmentNodeGenerated.AssignmentNodeDependencies;} })), Object.defineProperty(exports, "BlockNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesBlockNodeGenerated.BlockNodeDependencies;} })), Object.defineProperty(exports, "ConditionalNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesConditionalNodeGenerated.ConditionalNodeDependencies;} })), Object.defineProperty(exports, "ConstantNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesConstantNodeGenerated.ConstantNodeDependencies;} })), Object.defineProperty(exports, "FunctionAssignmentNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesFunctionAssignmentNodeGenerated.FunctionAssignmentNodeDependencies;} })), Object.defineProperty(exports, "IndexNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesIndexNodeGenerated.IndexNodeDependencies;} })), Object.defineProperty(exports, "ObjectNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesObjectNodeGenerated.ObjectNodeDependencies;} })), Object.defineProperty(exports, "OperatorNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesOperatorNodeGenerated.OperatorNodeDependencies;} })), Object.defineProperty(exports, "ParenthesisNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies;} })), Object.defineProperty(exports, "RangeNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesRangeNodeGenerated.RangeNodeDependencies;} })), Object.defineProperty(exports, "RelationalNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesRelationalNodeGenerated.RelationalNodeDependencies;} })), Object.defineProperty(exports, "SymbolNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesSymbolNodeGenerated.SymbolNodeDependencies;} })), Object.defineProperty(exports, "FunctionNodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesFunctionNodeGenerated.FunctionNodeDependencies;} })), Object.defineProperty(exports, "parseDependencies", ({ enumerable: !0, get: function () {return _dependenciesParseGenerated.parseDependencies;} })), Object.defineProperty(exports, "compileDependencies", ({ enumerable: !0, get: function () {return _dependenciesCompileGenerated.compileDependencies;} })), Object.defineProperty(exports, "evaluateDependencies", ({ enumerable: !0, get: function () {return _dependenciesEvaluateGenerated.evaluateDependencies;} })), Object.defineProperty(exports, "ParserDependencies", ({ enumerable: !0, get: function () {return _dependenciesParserClassGenerated.ParserDependencies;} })), Object.defineProperty(exports, "parserDependencies", ({ enumerable: !0, get: function () {return _dependenciesParserGenerated.parserDependencies;} })), Object.defineProperty(exports, "lupDependencies", ({ enumerable: !0, get: function () {return _dependenciesLupGenerated.lupDependencies;} })), Object.defineProperty(exports, "qrDependencies", ({ enumerable: !0, get: function () {return _dependenciesQrGenerated.qrDependencies;} })), Object.defineProperty(exports, "sluDependencies", ({ enumerable: !0, get: function () {return _dependenciesSluGenerated.sluDependencies;} })), Object.defineProperty(exports, "lusolveDependencies", ({ enumerable: !0, get: function () {return _dependenciesLusolveGenerated.lusolveDependencies;} })), Object.defineProperty(exports, "HelpDependencies", ({ enumerable: !0, get: function () {return _dependenciesHelpClassGenerated.HelpDependencies;} })), Object.defineProperty(exports, "ChainDependencies", ({ enumerable: !0, get: function () {return _dependenciesChainClassGenerated.ChainDependencies;} })), Object.defineProperty(exports, "helpDependencies", ({ enumerable: !0, get: function () {return _dependenciesHelpGenerated.helpDependencies;} })), Object.defineProperty(exports, "chainDependencies", ({ enumerable: !0, get: function () {return _dependenciesChainGenerated.chainDependencies;} })), Object.defineProperty(exports, "detDependencies", ({ enumerable: !0, get: function () {return _dependenciesDetGenerated.detDependencies;} })), Object.defineProperty(exports, "invDependencies", ({ enumerable: !0, get: function () {return _dependenciesInvGenerated.invDependencies;} })), Object.defineProperty(exports, "eigsDependencies", ({ enumerable: !0, get: function () {return _dependenciesEigsGenerated.eigsDependencies;} })), Object.defineProperty(exports, "expmDependencies", ({ enumerable: !0, get: function () {return _dependenciesExpmGenerated.expmDependencies;} })), Object.defineProperty(exports, "sqrtmDependencies", ({ enumerable: !0, get: function () {return _dependenciesSqrtmGenerated.sqrtmDependencies;} })), Object.defineProperty(exports, "divideDependencies", ({ enumerable: !0, get: function () {return _dependenciesDivideGenerated.divideDependencies;} })), Object.defineProperty(exports, "distanceDependencies", ({ enumerable: !0, get: function () {return _dependenciesDistanceGenerated.distanceDependencies;} })), Object.defineProperty(exports, "intersectDependencies", ({ enumerable: !0, get: function () {return _dependenciesIntersectGenerated.intersectDependencies;} })), Object.defineProperty(exports, "sumDependencies", ({ enumerable: !0, get: function () {return _dependenciesSumGenerated.sumDependencies;} })), Object.defineProperty(exports, "meanDependencies", ({ enumerable: !0, get: function () {return _dependenciesMeanGenerated.meanDependencies;} })), Object.defineProperty(exports, "medianDependencies", ({ enumerable: !0, get: function () {return _dependenciesMedianGenerated.medianDependencies;} })), Object.defineProperty(exports, "madDependencies", ({ enumerable: !0, get: function () {return _dependenciesMadGenerated.madDependencies;} })), Object.defineProperty(exports, "varianceDependencies", ({ enumerable: !0, get: function () {return _dependenciesVarianceGenerated.varianceDependencies;} })), Object.defineProperty(exports, "quantileSeqDependencies", ({ enumerable: !0, get: function () {return _dependenciesQuantileSeqGenerated.quantileSeqDependencies;} })), Object.defineProperty(exports, "stdDependencies", ({ enumerable: !0, get: function () {return _dependenciesStdGenerated.stdDependencies;} })), Object.defineProperty(exports, "combinationsDependencies", ({ enumerable: !0, get: function () {return _dependenciesCombinationsGenerated.combinationsDependencies;} })), Object.defineProperty(exports, "combinationsWithRepDependencies", ({ enumerable: !0, get: function () {return _dependenciesCombinationsWithRepGenerated.combinationsWithRepDependencies;} })), Object.defineProperty(exports, "gammaDependencies", ({ enumerable: !0, get: function () {return _dependenciesGammaGenerated.gammaDependencies;} })), Object.defineProperty(exports, "factorialDependencies", ({ enumerable: !0, get: function () {return _dependenciesFactorialGenerated.factorialDependencies;} })), Object.defineProperty(exports, "kldivergenceDependencies", ({ enumerable: !0, get: function () {return _dependenciesKldivergenceGenerated.kldivergenceDependencies;} })), Object.defineProperty(exports, "multinomialDependencies", ({ enumerable: !0, get: function () {return _dependenciesMultinomialGenerated.multinomialDependencies;} })), Object.defineProperty(exports, "permutationsDependencies", ({ enumerable: !0, get: function () {return _dependenciesPermutationsGenerated.permutationsDependencies;} })), Object.defineProperty(exports, "pickRandomDependencies", ({ enumerable: !0, get: function () {return _dependenciesPickRandomGenerated.pickRandomDependencies;} })), Object.defineProperty(exports, "randomDependencies", ({ enumerable: !0, get: function () {return _dependenciesRandomGenerated.randomDependencies;} })), Object.defineProperty(exports, "randomIntDependencies", ({ enumerable: !0, get: function () {return _dependenciesRandomIntGenerated.randomIntDependencies;} })), Object.defineProperty(exports, "stirlingS2Dependencies", ({ enumerable: !0, get: function () {return _dependenciesStirlingS2Generated.stirlingS2Dependencies;} })), Object.defineProperty(exports, "bellNumbersDependencies", ({ enumerable: !0, get: function () {return _dependenciesBellNumbersGenerated.bellNumbersDependencies;} })), Object.defineProperty(exports, "catalanDependencies", ({ enumerable: !0, get: function () {return _dependenciesCatalanGenerated.catalanDependencies;} })), Object.defineProperty(exports, "compositionDependencies", ({ enumerable: !0, get: function () {return _dependenciesCompositionGenerated.compositionDependencies;} })), Object.defineProperty(exports, "simplifyDependencies", ({ enumerable: !0, get: function () {return _dependenciesSimplifyGenerated.simplifyDependencies;} })), Object.defineProperty(exports, "derivativeDependencies", ({ enumerable: !0, get: function () {return _dependenciesDerivativeGenerated.derivativeDependencies;} })), Object.defineProperty(exports, "rationalizeDependencies", ({ enumerable: !0, get: function () {return _dependenciesRationalizeGenerated.rationalizeDependencies;} })), Object.defineProperty(exports, "reviverDependencies", ({ enumerable: !0, get: function () {return _dependenciesReviverGenerated.reviverDependencies;} })), Object.defineProperty(exports, "replacerDependencies", ({ enumerable: !0, get: function () {return _dependenciesReplacerGenerated.replacerDependencies;} })), Object.defineProperty(exports, "eDependencies", ({ enumerable: !0, get: function () {return _dependenciesEGenerated.eDependencies;} })), Object.defineProperty(exports, "EDependencies", ({ enumerable: !0, get: function () {return _dependenciesUppercaseEGenerated.EDependencies;} })), Object.defineProperty(exports, "falseDependencies", ({ enumerable: !0, get: function () {return _dependenciesFalseGenerated.falseDependencies;} })), Object.defineProperty(exports, "iDependencies", ({ enumerable: !0, get: function () {return _dependenciesIGenerated.iDependencies;} })), Object.defineProperty(exports, "InfinityDependencies", ({ enumerable: !0, get: function () {return _dependenciesInfinityGenerated.InfinityDependencies;} })), Object.defineProperty(exports, "LN10Dependencies", ({ enumerable: !0, get: function () {return _dependenciesLN10Generated.LN10Dependencies;} })), Object.defineProperty(exports, "LN2Dependencies", ({ enumerable: !0, get: function () {return _dependenciesLN2Generated.LN2Dependencies;} })), Object.defineProperty(exports, "LOG10EDependencies", ({ enumerable: !0, get: function () {return _dependenciesLOG10EGenerated.LOG10EDependencies;} })), Object.defineProperty(exports, "LOG2EDependencies", ({ enumerable: !0, get: function () {return _dependenciesLOG2EGenerated.LOG2EDependencies;} })), Object.defineProperty(exports, "NaNDependencies", ({ enumerable: !0, get: function () {return _dependenciesNaNGenerated.NaNDependencies;} })), Object.defineProperty(exports, "nullDependencies", ({ enumerable: !0, get: function () {return _dependenciesNullGenerated.nullDependencies;} })), Object.defineProperty(exports, "phiDependencies", ({ enumerable: !0, get: function () {return _dependenciesPhiGenerated.phiDependencies;} })), Object.defineProperty(exports, "piDependencies", ({ enumerable: !0, get: function () {return _dependenciesPiGenerated.piDependencies;} })), Object.defineProperty(exports, "PIDependencies", ({ enumerable: !0, get: function () {return _dependenciesUppercasePiGenerated.PIDependencies;} })), Object.defineProperty(exports, "SQRT1_2Dependencies", ({ enumerable: !0, get: function () {return _dependenciesSQRT1_2Generated.SQRT1_2Dependencies;} })), Object.defineProperty(exports, "SQRT2Dependencies", ({ enumerable: !0, get: function () {return _dependenciesSQRT2Generated.SQRT2Dependencies;} })), Object.defineProperty(exports, "tauDependencies", ({ enumerable: !0, get: function () {return _dependenciesTauGenerated.tauDependencies;} })), Object.defineProperty(exports, "trueDependencies", ({ enumerable: !0, get: function () {return _dependenciesTrueGenerated.trueDependencies;} })), Object.defineProperty(exports, "versionDependencies", ({ enumerable: !0, get: function () {return _dependenciesVersionGenerated.versionDependencies;} })), Object.defineProperty(exports, "atomicMassDependencies", ({ enumerable: !0, get: function () {return _dependenciesAtomicMassGenerated.atomicMassDependencies;} })), Object.defineProperty(exports, "avogadroDependencies", ({ enumerable: !0, get: function () {return _dependenciesAvogadroGenerated.avogadroDependencies;} })), Object.defineProperty(exports, "bohrMagnetonDependencies", ({ enumerable: !0, get: function () {return _dependenciesBohrMagnetonGenerated.bohrMagnetonDependencies;} })), Object.defineProperty(exports, "bohrRadiusDependencies", ({ enumerable: !0, get: function () {return _dependenciesBohrRadiusGenerated.bohrRadiusDependencies;} })), Object.defineProperty(exports, "boltzmannDependencies", ({ enumerable: !0, get: function () {return _dependenciesBoltzmannGenerated.boltzmannDependencies;} })), Object.defineProperty(exports, "classicalElectronRadiusDependencies", ({ enumerable: !0, get: function () {return _dependenciesClassicalElectronRadiusGenerated.classicalElectronRadiusDependencies;} })), Object.defineProperty(exports, "conductanceQuantumDependencies", ({ enumerable: !0, get: function () {return _dependenciesConductanceQuantumGenerated.conductanceQuantumDependencies;} })), Object.defineProperty(exports, "coulombDependencies", ({ enumerable: !0, get: function () {return _dependenciesCoulombGenerated.coulombDependencies;} })), Object.defineProperty(exports, "deuteronMassDependencies", ({ enumerable: !0, get: function () {return _dependenciesDeuteronMassGenerated.deuteronMassDependencies;} })), Object.defineProperty(exports, "efimovFactorDependencies", ({ enumerable: !0, get: function () {return _dependenciesEfimovFactorGenerated.efimovFactorDependencies;} })), Object.defineProperty(exports, "electricConstantDependencies", ({ enumerable: !0, get: function () {return _dependenciesElectricConstantGenerated.electricConstantDependencies;} })), Object.defineProperty(exports, "electronMassDependencies", ({ enumerable: !0, get: function () {return _dependenciesElectronMassGenerated.electronMassDependencies;} })), Object.defineProperty(exports, "elementaryChargeDependencies", ({ enumerable: !0, get: function () {return _dependenciesElementaryChargeGenerated.elementaryChargeDependencies;} })), Object.defineProperty(exports, "faradayDependencies", ({ enumerable: !0, get: function () {return _dependenciesFaradayGenerated.faradayDependencies;} })), Object.defineProperty(exports, "fermiCouplingDependencies", ({ enumerable: !0, get: function () {return _dependenciesFermiCouplingGenerated.fermiCouplingDependencies;} })), Object.defineProperty(exports, "fineStructureDependencies", ({ enumerable: !0, get: function () {return _dependenciesFineStructureGenerated.fineStructureDependencies;} })), Object.defineProperty(exports, "firstRadiationDependencies", ({ enumerable: !0, get: function () {return _dependenciesFirstRadiationGenerated.firstRadiationDependencies;} })), Object.defineProperty(exports, "gasConstantDependencies", ({ enumerable: !0, get: function () {return _dependenciesGasConstantGenerated.gasConstantDependencies;} })), Object.defineProperty(exports, "gravitationConstantDependencies", ({ enumerable: !0, get: function () {return _dependenciesGravitationConstantGenerated.gravitationConstantDependencies;} })), Object.defineProperty(exports, "gravityDependencies", ({ enumerable: !0, get: function () {return _dependenciesGravityGenerated.gravityDependencies;} })), Object.defineProperty(exports, "hartreeEnergyDependencies", ({ enumerable: !0, get: function () {return _dependenciesHartreeEnergyGenerated.hartreeEnergyDependencies;} })), Object.defineProperty(exports, "inverseConductanceQuantumDependencies", ({ enumerable: !0, get: function () {return _dependenciesInverseConductanceQuantumGenerated.inverseConductanceQuantumDependencies;} })), Object.defineProperty(exports, "klitzingDependencies", ({ enumerable: !0, get: function () {return _dependenciesKlitzingGenerated.klitzingDependencies;} })), Object.defineProperty(exports, "loschmidtDependencies", ({ enumerable: !0, get: function () {return _dependenciesLoschmidtGenerated.loschmidtDependencies;} })), Object.defineProperty(exports, "magneticConstantDependencies", ({ enumerable: !0, get: function () {return _dependenciesMagneticConstantGenerated.magneticConstantDependencies;} })), Object.defineProperty(exports, "magneticFluxQuantumDependencies", ({ enumerable: !0, get: function () {return _dependenciesMagneticFluxQuantumGenerated.magneticFluxQuantumDependencies;} })), Object.defineProperty(exports, "molarMassDependencies", ({ enumerable: !0, get: function () {return _dependenciesMolarMassGenerated.molarMassDependencies;} })), Object.defineProperty(exports, "molarMassC12Dependencies", ({ enumerable: !0, get: function () {return _dependenciesMolarMassC12Generated.molarMassC12Dependencies;} })), Object.defineProperty(exports, "molarPlanckConstantDependencies", ({ enumerable: !0, get: function () {return _dependenciesMolarPlanckConstantGenerated.molarPlanckConstantDependencies;} })), Object.defineProperty(exports, "molarVolumeDependencies", ({ enumerable: !0, get: function () {return _dependenciesMolarVolumeGenerated.molarVolumeDependencies;} })), Object.defineProperty(exports, "neutronMassDependencies", ({ enumerable: !0, get: function () {return _dependenciesNeutronMassGenerated.neutronMassDependencies;} })), Object.defineProperty(exports, "nuclearMagnetonDependencies", ({ enumerable: !0, get: function () {return _dependenciesNuclearMagnetonGenerated.nuclearMagnetonDependencies;} })), Object.defineProperty(exports, "planckChargeDependencies", ({ enumerable: !0, get: function () {return _dependenciesPlanckChargeGenerated.planckChargeDependencies;} })), Object.defineProperty(exports, "planckConstantDependencies", ({ enumerable: !0, get: function () {return _dependenciesPlanckConstantGenerated.planckConstantDependencies;} })), Object.defineProperty(exports, "planckLengthDependencies", ({ enumerable: !0, get: function () {return _dependenciesPlanckLengthGenerated.planckLengthDependencies;} })), Object.defineProperty(exports, "planckMassDependencies", ({ enumerable: !0, get: function () {return _dependenciesPlanckMassGenerated.planckMassDependencies;} })), Object.defineProperty(exports, "planckTemperatureDependencies", ({ enumerable: !0, get: function () {return _dependenciesPlanckTemperatureGenerated.planckTemperatureDependencies;} })), Object.defineProperty(exports, "planckTimeDependencies", ({ enumerable: !0, get: function () {return _dependenciesPlanckTimeGenerated.planckTimeDependencies;} })), Object.defineProperty(exports, "protonMassDependencies", ({ enumerable: !0, get: function () {return _dependenciesProtonMassGenerated.protonMassDependencies;} })), Object.defineProperty(exports, "quantumOfCirculationDependencies", ({ enumerable: !0, get: function () {return _dependenciesQuantumOfCirculationGenerated.quantumOfCirculationDependencies;} })), Object.defineProperty(exports, "reducedPlanckConstantDependencies", ({ enumerable: !0, get: function () {return _dependenciesReducedPlanckConstantGenerated.reducedPlanckConstantDependencies;} })), Object.defineProperty(exports, "rydbergDependencies", ({ enumerable: !0, get: function () {return _dependenciesRydbergGenerated.rydbergDependencies;} })), Object.defineProperty(exports, "sackurTetrodeDependencies", ({ enumerable: !0, get: function () {return _dependenciesSackurTetrodeGenerated.sackurTetrodeDependencies;} })), Object.defineProperty(exports, "secondRadiationDependencies", ({ enumerable: !0, get: function () {return _dependenciesSecondRadiationGenerated.secondRadiationDependencies;} })), Object.defineProperty(exports, "speedOfLightDependencies", ({ enumerable: !0, get: function () {return _dependenciesSpeedOfLightGenerated.speedOfLightDependencies;} })), Object.defineProperty(exports, "stefanBoltzmannDependencies", ({ enumerable: !0, get: function () {return _dependenciesStefanBoltzmannGenerated.stefanBoltzmannDependencies;} })), Object.defineProperty(exports, "thomsonCrossSectionDependencies", ({ enumerable: !0, get: function () {return _dependenciesThomsonCrossSectionGenerated.thomsonCrossSectionDependencies;} })), Object.defineProperty(exports, "vacuumImpedanceDependencies", ({ enumerable: !0, get: function () {return _dependenciesVacuumImpedanceGenerated.vacuumImpedanceDependencies;} })), Object.defineProperty(exports, "weakMixingAngleDependencies", ({ enumerable: !0, get: function () {return _dependenciesWeakMixingAngleGenerated.weakMixingAngleDependencies;} })), Object.defineProperty(exports, "wienDisplacementDependencies", ({ enumerable: !0, get: function () {return _dependenciesWienDisplacementGenerated.wienDisplacementDependencies;} })), Object.defineProperty(exports, "applyTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesApplyTransformGenerated.applyTransformDependencies;} })), Object.defineProperty(exports, "columnTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesColumnTransformGenerated.columnTransformDependencies;} })), Object.defineProperty(exports, "filterTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesFilterTransformGenerated.filterTransformDependencies;} })), Object.defineProperty(exports, "forEachTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesForEachTransformGenerated.forEachTransformDependencies;} })), Object.defineProperty(exports, "indexTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesIndexTransformGenerated.indexTransformDependencies;} })), Object.defineProperty(exports, "mapTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesMapTransformGenerated.mapTransformDependencies;} })), Object.defineProperty(exports, "maxTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesMaxTransformGenerated.maxTransformDependencies;} })), Object.defineProperty(exports, "meanTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesMeanTransformGenerated.meanTransformDependencies;} })), Object.defineProperty(exports, "minTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesMinTransformGenerated.minTransformDependencies;} })), Object.defineProperty(exports, "rangeTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesRangeTransformGenerated.rangeTransformDependencies;} })), Object.defineProperty(exports, "rowTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesRowTransformGenerated.rowTransformDependencies;} })), Object.defineProperty(exports, "subsetTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesSubsetTransformGenerated.subsetTransformDependencies;} })), Object.defineProperty(exports, "concatTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesConcatTransformGenerated.concatTransformDependencies;} })), Object.defineProperty(exports, "diffTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesDiffTransformGenerated.diffTransformDependencies;} })), Object.defineProperty(exports, "stdTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesStdTransformGenerated.stdTransformDependencies;} })), Object.defineProperty(exports, "sumTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesSumTransformGenerated.sumTransformDependencies;} })), Object.defineProperty(exports, "varianceTransformDependencies", ({ enumerable: !0, get: function () {return _dependenciesVarianceTransformGenerated.varianceTransformDependencies;} })), Object.defineProperty(exports, "all", ({ enumerable: !0, get: function () {return _allFactoriesAny.all;} }));var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesResultSetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResultSet.generated.js"),_dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesFractionClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js"),_dependenciesRangeClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeClass.generated.js"),_dependenciesMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js"),_dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesCloneGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClone.generated.js"),_dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesIsNegativeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js"),_dependenciesIsNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js"),_dependenciesHasNumericValueGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHasNumericValue.generated.js"),_dependenciesIsPositiveGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js"),_dependenciesIsZeroGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js"),_dependenciesIsNaNGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js"),_dependenciesTypeOfGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTypeOf.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesSparseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js"),_dependenciesNumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js"),_dependenciesStringGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesString.generated.js"),_dependenciesBooleanGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoolean.generated.js"),_dependenciesBignumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js"),_dependenciesComplexGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js"),_dependenciesFractionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMatrixFromFunctionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js"),_dependenciesMatrixFromRowsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js"),_dependenciesMatrixFromColumnsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js"),_dependenciesSplitUnitGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSplitUnit.generated.js"),_dependenciesUnaryMinusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js"),_dependenciesUnaryPlusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryPlus.generated.js"),_dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesApplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApply.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesCbrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCbrt.generated.js"),_dependenciesCeilGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js"),_dependenciesCubeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCube.generated.js"),_dependenciesExpGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExp.generated.js"),_dependenciesExpm1Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm1.generated.js"),_dependenciesFixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js"),_dependenciesFloorGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js"),_dependenciesGcdGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js"),_dependenciesLcmGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js"),_dependenciesLog10Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog10.generated.js"),_dependenciesLog2Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog2.generated.js"),_dependenciesModGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesNthRootGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js"),_dependenciesSignGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSign.generated.js"),_dependenciesSqrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js"),_dependenciesSquareGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSquare.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesXgcdGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXgcd.generated.js"),_dependenciesDotMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js"),_dependenciesBitAndGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js"),_dependenciesBitNotGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitNot.generated.js"),_dependenciesBitOrGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js"),_dependenciesBitXorGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js"),_dependenciesArgGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArg.generated.js"),_dependenciesConjGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js"),_dependenciesImGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIm.generated.js"),_dependenciesReGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRe.generated.js"),_dependenciesNotGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNot.generated.js"),_dependenciesOrGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js"),_dependenciesXorGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js"),_dependenciesConcatGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js"),_dependenciesColumnGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumn.generated.js"),_dependenciesCountGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCount.generated.js"),_dependenciesCrossGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCross.generated.js"),_dependenciesDiagGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiag.generated.js"),_dependenciesFilterGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilter.generated.js"),_dependenciesFlattenGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js"),_dependenciesForEachGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEach.generated.js"),_dependenciesGetMatrixDataTypeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js"),_dependenciesIdentityGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js"),_dependenciesKronGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKron.generated.js"),_dependenciesMapGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMap.generated.js"),_dependenciesDiffGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiff.generated.js"),_dependenciesOnesGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOnes.generated.js"),_dependenciesRangeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js"),_dependenciesReshapeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReshape.generated.js"),_dependenciesResizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResize.generated.js"),_dependenciesRotateGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotate.generated.js"),_dependenciesRotationMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotationMatrix.generated.js"),_dependenciesRowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRow.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSqueezeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqueeze.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTransposeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js"),_dependenciesCtransposeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCtranspose.generated.js"),_dependenciesZerosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js"),_dependenciesErfGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesErf.generated.js"),_dependenciesModeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMode.generated.js"),_dependenciesProdGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProd.generated.js"),_dependenciesFormatGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js"),_dependenciesBinGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBin.generated.js"),_dependenciesOctGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOct.generated.js"),_dependenciesHexGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHex.generated.js"),_dependenciesPrintGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrint.generated.js"),_dependenciesToGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js"),_dependenciesIsPrimeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPrime.generated.js"),_dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesPowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js"),_dependenciesRoundGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js"),_dependenciesLogGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js"),_dependenciesLog1pGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog1p.generated.js"),_dependenciesNthRootsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoots.generated.js"),_dependenciesDotPowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js"),_dependenciesDotDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js"),_dependenciesLsolveGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js"),_dependenciesUsolveGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js"),_dependenciesLsolveAllGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolveAll.generated.js"),_dependenciesUsolveAllGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js"),_dependenciesLeftShiftGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js"),_dependenciesRightArithShiftGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js"),_dependenciesRightLogShiftGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js"),_dependenciesAndGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js"),_dependenciesCompareGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js"),_dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesCompareTextGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js"),_dependenciesEqualGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js"),_dependenciesEqualTextGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualText.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_dependenciesSmallerEqGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js"),_dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesLargerEqGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js"),_dependenciesDeepEqualGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeepEqual.generated.js"),_dependenciesUnequalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js"),_dependenciesPartitionSelectGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js"),_dependenciesSortGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSort.generated.js"),_dependenciesMaxGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMax.generated.js"),_dependenciesMinGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMin.generated.js"),_dependenciesImmutableDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js"),_dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesFibonacciHeapClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js"),_dependenciesSpaClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_dependenciesUnitFunctionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitFunction.generated.js"),_dependenciesSparseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparse.generated.js"),_dependenciesCreateUnitGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCreateUnit.generated.js"),_dependenciesAcosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcos.generated.js"),_dependenciesAcoshGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcosh.generated.js"),_dependenciesAcotGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcot.generated.js"),_dependenciesAcothGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcoth.generated.js"),_dependenciesAcscGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsc.generated.js"),_dependenciesAcschGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsch.generated.js"),_dependenciesAsecGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsec.generated.js"),_dependenciesAsechGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsech.generated.js"),_dependenciesAsinGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsin.generated.js"),_dependenciesAsinhGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsinh.generated.js"),_dependenciesAtanGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan.generated.js"),_dependenciesAtan2Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js"),_dependenciesAtanhGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtanh.generated.js"),_dependenciesCosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js"),_dependenciesCoshGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCosh.generated.js"),_dependenciesCotGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCot.generated.js"),_dependenciesCothGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoth.generated.js"),_dependenciesCscGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsc.generated.js"),_dependenciesCschGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsch.generated.js"),_dependenciesSecGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSec.generated.js"),_dependenciesSechGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSech.generated.js"),_dependenciesSinGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js"),_dependenciesSinhGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSinh.generated.js"),_dependenciesTanGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTan.generated.js"),_dependenciesTanhGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTanh.generated.js"),_dependenciesSetCartesianGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetCartesian.generated.js"),_dependenciesSetDifferenceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDifference.generated.js"),_dependenciesSetDistinctGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDistinct.generated.js"),_dependenciesSetIntersectGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIntersect.generated.js"),_dependenciesSetIsSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIsSubset.generated.js"),_dependenciesSetMultiplicityGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js"),_dependenciesSetPowersetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetPowerset.generated.js"),_dependenciesSetSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSize.generated.js"),_dependenciesSetSymDifferenceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSymDifference.generated.js"),_dependenciesSetUnionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetUnion.generated.js"),_dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesHypotGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHypot.generated.js"),_dependenciesNormGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js"),_dependenciesDotGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDot.generated.js"),_dependenciesTraceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrace.generated.js"),_dependenciesIndexGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndex.generated.js"),_dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_dependenciesAccessorNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAccessorNode.generated.js"),_dependenciesArrayNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArrayNode.generated.js"),_dependenciesAssignmentNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAssignmentNode.generated.js"),_dependenciesBlockNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBlockNode.generated.js"),_dependenciesConditionalNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConditionalNode.generated.js"),_dependenciesConstantNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js"),_dependenciesFunctionAssignmentNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js"),_dependenciesIndexNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js"),_dependenciesObjectNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesObjectNode.generated.js"),_dependenciesOperatorNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js"),_dependenciesParenthesisNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js"),_dependenciesRangeNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeNode.generated.js"),_dependenciesRelationalNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRelationalNode.generated.js"),_dependenciesSymbolNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js"),_dependenciesFunctionNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js"),_dependenciesParseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js"),_dependenciesCompileGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompile.generated.js"),_dependenciesEvaluateGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEvaluate.generated.js"),_dependenciesParserClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParserClass.generated.js"),_dependenciesParserGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParser.generated.js"),_dependenciesLupGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js"),_dependenciesQrGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js"),_dependenciesSluGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSlu.generated.js"),_dependenciesLusolveGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLusolve.generated.js"),_dependenciesHelpClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelpClass.generated.js"),_dependenciesChainClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js"),_dependenciesHelpGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelp.generated.js"),_dependenciesChainGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChain.generated.js"),_dependenciesDetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js"),_dependenciesInvGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js"),_dependenciesEigsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js"),_dependenciesExpmGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm.generated.js"),_dependenciesSqrtmGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrtm.generated.js"),_dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesDistanceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDistance.generated.js"),_dependenciesIntersectGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIntersect.generated.js"),_dependenciesSumGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSum.generated.js"),_dependenciesMeanGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMean.generated.js"),_dependenciesMedianGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js"),_dependenciesMadGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMad.generated.js"),_dependenciesVarianceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js"),_dependenciesQuantileSeqGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeq.generated.js"),_dependenciesStdGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStd.generated.js"),_dependenciesCombinationsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js"),_dependenciesCombinationsWithRepGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js"),_dependenciesGammaGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGamma.generated.js"),_dependenciesFactorialGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js"),_dependenciesKldivergenceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKldivergence.generated.js"),_dependenciesMultinomialGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultinomial.generated.js"),_dependenciesPermutationsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPermutations.generated.js"),_dependenciesPickRandomGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPickRandom.generated.js"),_dependenciesRandomGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandom.generated.js"),_dependenciesRandomIntGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandomInt.generated.js"),_dependenciesStirlingS2Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js"),_dependenciesBellNumbersGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBellNumbers.generated.js"),_dependenciesCatalanGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCatalan.generated.js"),_dependenciesCompositionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComposition.generated.js"),_dependenciesSimplifyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js"),_dependenciesDerivativeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDerivative.generated.js"),_dependenciesRationalizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js"),_dependenciesReviverGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReviver.generated.js"),_dependenciesReplacerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReplacer.generated.js"),_dependenciesEGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesE.generated.js"),_dependenciesUppercaseEGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercaseE.generated.js"),_dependenciesFalseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFalse.generated.js"),_dependenciesIGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesI.generated.js"),_dependenciesInfinityGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInfinity.generated.js"),_dependenciesLN10Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN10.generated.js"),_dependenciesLN2Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN2.generated.js"),_dependenciesLOG10EGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG10E.generated.js"),_dependenciesLOG2EGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG2E.generated.js"),_dependenciesNaNGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNaN.generated.js"),_dependenciesNullGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNull.generated.js"),_dependenciesPhiGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPhi.generated.js"),_dependenciesPiGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPi.generated.js"),_dependenciesUppercasePiGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercasePi.generated.js"),_dependenciesSQRT1_2Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT1_2.generated.js"),_dependenciesSQRT2Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT2.generated.js"),_dependenciesTauGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTau.generated.js"),_dependenciesTrueGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrue.generated.js"),_dependenciesVersionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVersion.generated.js"),_dependenciesAtomicMassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtomicMass.generated.js"),_dependenciesAvogadroGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAvogadro.generated.js"),_dependenciesBohrMagnetonGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrMagneton.generated.js"),_dependenciesBohrRadiusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrRadius.generated.js"),_dependenciesBoltzmannGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoltzmann.generated.js"),_dependenciesClassicalElectronRadiusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js"),_dependenciesConductanceQuantumGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js"),_dependenciesCoulombGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulomb.generated.js"),_dependenciesDeuteronMassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeuteronMass.generated.js"),_dependenciesEfimovFactorGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEfimovFactor.generated.js"),_dependenciesElectricConstantGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectricConstant.generated.js"),_dependenciesElectronMassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectronMass.generated.js"),_dependenciesElementaryChargeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElementaryCharge.generated.js"),_dependenciesFaradayGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFaraday.generated.js"),_dependenciesFermiCouplingGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFermiCoupling.generated.js"),_dependenciesFineStructureGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFineStructure.generated.js"),_dependenciesFirstRadiationGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFirstRadiation.generated.js"),_dependenciesGasConstantGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGasConstant.generated.js"),_dependenciesGravitationConstantGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravitationConstant.generated.js"),_dependenciesGravityGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravity.generated.js"),_dependenciesHartreeEnergyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js"),_dependenciesInverseConductanceQuantumGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js"),_dependenciesKlitzingGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKlitzing.generated.js"),_dependenciesLoschmidtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLoschmidt.generated.js"),_dependenciesMagneticConstantGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticConstant.generated.js"),_dependenciesMagneticFluxQuantumGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js"),_dependenciesMolarMassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMass.generated.js"),_dependenciesMolarMassC12Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMassC12.generated.js"),_dependenciesMolarPlanckConstantGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js"),_dependenciesMolarVolumeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarVolume.generated.js"),_dependenciesNeutronMassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNeutronMass.generated.js"),_dependenciesNuclearMagnetonGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js"),_dependenciesPlanckChargeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckCharge.generated.js"),_dependenciesPlanckConstantGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckConstant.generated.js"),_dependenciesPlanckLengthGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckLength.generated.js"),_dependenciesPlanckMassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckMass.generated.js"),_dependenciesPlanckTemperatureGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js"),_dependenciesPlanckTimeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTime.generated.js"),_dependenciesProtonMassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProtonMass.generated.js"),_dependenciesQuantumOfCirculationGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js"),_dependenciesReducedPlanckConstantGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js"),_dependenciesRydbergGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRydberg.generated.js"),_dependenciesSackurTetrodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSackurTetrode.generated.js"),_dependenciesSecondRadiationGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSecondRadiation.generated.js"),_dependenciesSpeedOfLightGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js"),_dependenciesStefanBoltzmannGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js"),_dependenciesThomsonCrossSectionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js"),_dependenciesVacuumImpedanceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js"),_dependenciesWeakMixingAngleGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js"),_dependenciesWienDisplacementGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWienDisplacement.generated.js"),_dependenciesApplyTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApplyTransform.generated.js"),_dependenciesColumnTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumnTransform.generated.js"),_dependenciesFilterTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilterTransform.generated.js"),_dependenciesForEachTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEachTransform.generated.js"),_dependenciesIndexTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexTransform.generated.js"),_dependenciesMapTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapTransform.generated.js"),_dependenciesMaxTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMaxTransform.generated.js"),_dependenciesMeanTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMeanTransform.generated.js"),_dependenciesMinTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMinTransform.generated.js"),_dependenciesRangeTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js"),_dependenciesRowTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRowTransform.generated.js"),_dependenciesSubsetTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubsetTransform.generated.js"),_dependenciesConcatTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcatTransform.generated.js"),_dependenciesDiffTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiffTransform.generated.js"),_dependenciesStdTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStdTransform.generated.js"),_dependenciesSumTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSumTransform.generated.js"),_dependenciesVarianceTransformGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVarianceTransform.generated.js"),_allFactoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/allFactoriesAny.js");

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.absDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),absDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAbs: _factoriesAny.createAbs };exports.absDependencies = absDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAccessorNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.AccessorNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),AccessorNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, createAccessorNode: _factoriesAny.createAccessorNode };exports.AccessorNodeDependencies = AccessorNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcos.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acosDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),acosDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAcos: _factoriesAny.createAcos };exports.acosDependencies = acosDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcosh.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acoshDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),acoshDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAcosh: _factoriesAny.createAcosh };exports.acoshDependencies = acoshDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcot.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acotDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),acotDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAcot: _factoriesAny.createAcot };exports.acotDependencies = acotDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcoth.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acothDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),acothDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAcoth: _factoriesAny.createAcoth };exports.acothDependencies = acothDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsc.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acscDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),acscDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAcsc: _factoriesAny.createAcsc };exports.acscDependencies = acscDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsch.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acschDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),acschDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAcsch: _factoriesAny.createAcsch };exports.acschDependencies = acschDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.addDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesSparseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),addDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAdd: _factoriesAny.createAdd };exports.addDependencies = addDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.addScalarDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),addScalarDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAddScalar: _factoriesAny.createAddScalar };exports.addScalarDependencies = addScalarDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.andDependencies = void 0;var _dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesNotGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNot.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesZerosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),andDependencies = { equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, notDependencies: _dependenciesNotGenerated.notDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, createAnd: _factoriesAny.createAnd };exports.andDependencies = andDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApply.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.applyDependencies = void 0;var _dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),applyDependencies = { isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createApply: _factoriesAny.createApply };exports.applyDependencies = applyDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApplyTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.applyTransformDependencies = void 0;var _dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),applyTransformDependencies = { isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createApplyTransform: _factoriesAny.createApplyTransform };exports.applyTransformDependencies = applyTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArg.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.argDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),argDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createArg: _factoriesAny.createArg };exports.argDependencies = argDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArrayNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ArrayNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ArrayNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, createArrayNode: _factoriesAny.createArrayNode };exports.ArrayNodeDependencies = ArrayNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsec.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.asecDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),asecDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAsec: _factoriesAny.createAsec };exports.asecDependencies = asecDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsech.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.asechDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),asechDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAsech: _factoriesAny.createAsech };exports.asechDependencies = asechDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsin.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.asinDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),asinDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAsin: _factoriesAny.createAsin };exports.asinDependencies = asinDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsinh.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.asinhDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),asinhDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAsinh: _factoriesAny.createAsinh };exports.asinhDependencies = asinhDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAssignmentNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.AssignmentNodeDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),AssignmentNodeDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, createAssignmentNode: _factoriesAny.createAssignmentNode };exports.AssignmentNodeDependencies = AssignmentNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.atanDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),atanDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAtan: _factoriesAny.createAtan };exports.atanDependencies = atanDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.atan2Dependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),atan2Dependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAtan2: _factoriesAny.createAtan2 };exports.atan2Dependencies = atan2Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtanh.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.atanhDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),atanhDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createAtanh: _factoriesAny.createAtanh };exports.atanhDependencies = atanhDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtomicMass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.atomicMassDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),atomicMassDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createAtomicMass: _factoriesAny.createAtomicMass };exports.atomicMassDependencies = atomicMassDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAvogadro.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.avogadroDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),avogadroDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createAvogadro: _factoriesAny.createAvogadro };exports.avogadroDependencies = avogadroDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBellNumbers.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bellNumbersDependencies = void 0;var _dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesIsNegativeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js"),_dependenciesStirlingS2Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),bellNumbersDependencies = { addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, stirlingS2Dependencies: _dependenciesStirlingS2Generated.stirlingS2Dependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createBellNumbers: _factoriesAny.createBellNumbers };exports.bellNumbersDependencies = bellNumbersDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.BigNumberDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),BigNumberDependencies = { createBigNumberClass: _factoriesAny.createBigNumberClass };exports.BigNumberDependencies = BigNumberDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bignumberDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),bignumberDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createBignumber: _factoriesAny.createBignumber };exports.bignumberDependencies = bignumberDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBin.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.binDependencies = void 0;var _dependenciesFormatGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),binDependencies = { formatDependencies: _dependenciesFormatGenerated.formatDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createBin: _factoriesAny.createBin };exports.binDependencies = binDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitAndDependencies = void 0;var _dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),bitAndDependencies = { equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createBitAnd: _factoriesAny.createBitAnd };exports.bitAndDependencies = bitAndDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitNot.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitNotDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),bitNotDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createBitNot: _factoriesAny.createBitNot };exports.bitNotDependencies = bitNotDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitOrDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),bitOrDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createBitOr: _factoriesAny.createBitOr };exports.bitOrDependencies = bitOrDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitXorDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),bitXorDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createBitXor: _factoriesAny.createBitXor };exports.bitXorDependencies = bitXorDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBlockNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.BlockNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_dependenciesResultSetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResultSet.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),BlockNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, ResultSetDependencies: _dependenciesResultSetGenerated.ResultSetDependencies, createBlockNode: _factoriesAny.createBlockNode };exports.BlockNodeDependencies = BlockNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrMagneton.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bohrMagnetonDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),bohrMagnetonDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createBohrMagneton: _factoriesAny.createBohrMagneton };exports.bohrMagnetonDependencies = bohrMagnetonDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrRadius.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bohrRadiusDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),bohrRadiusDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createBohrRadius: _factoriesAny.createBohrRadius };exports.bohrRadiusDependencies = bohrRadiusDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoltzmann.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.boltzmannDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),boltzmannDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createBoltzmann: _factoriesAny.createBoltzmann };exports.boltzmannDependencies = boltzmannDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoolean.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.booleanDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),booleanDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createBoolean: _factoriesAny.createBoolean };exports.booleanDependencies = booleanDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCatalan.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.catalanDependencies = void 0;var _dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesCombinationsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesIsNegativeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),catalanDependencies = { addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, combinationsDependencies: _dependenciesCombinationsGenerated.combinationsDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCatalan: _factoriesAny.createCatalan };exports.catalanDependencies = catalanDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCbrt.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cbrtDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesFractionClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js"),_dependenciesIsNegativeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUnaryMinusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),cbrtDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, createCbrt: _factoriesAny.createCbrt };exports.cbrtDependencies = cbrtDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ceilDependencies = void 0;var _dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesRoundGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ceilDependencies = { equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, roundDependencies: _dependenciesRoundGenerated.roundDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCeil: _factoriesAny.createCeil };exports.ceilDependencies = ceilDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChain.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.chainDependencies = void 0;var _dependenciesChainClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),chainDependencies = { ChainDependencies: _dependenciesChainClassGenerated.ChainDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createChain: _factoriesAny.createChain };exports.chainDependencies = chainDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ChainDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ChainDependencies = { createChainClass: _factoriesAny.createChainClass };exports.ChainDependencies = ChainDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.classicalElectronRadiusDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),classicalElectronRadiusDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createClassicalElectronRadius: _factoriesAny.createClassicalElectronRadius };exports.classicalElectronRadiusDependencies = classicalElectronRadiusDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClone.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cloneDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),cloneDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createClone: _factoriesAny.createClone };exports.cloneDependencies = cloneDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumn.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.columnDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesRangeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),columnDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, rangeDependencies: _dependenciesRangeGenerated.rangeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createColumn: _factoriesAny.createColumn };exports.columnDependencies = columnDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumnTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.columnTransformDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesRangeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),columnTransformDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, rangeDependencies: _dependenciesRangeGenerated.rangeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createColumnTransform: _factoriesAny.createColumnTransform };exports.columnTransformDependencies = columnTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.combinationsDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),combinationsDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCombinations: _factoriesAny.createCombinations };exports.combinationsDependencies = combinationsDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.combinationsWithRepDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),combinationsWithRepDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCombinationsWithRep: _factoriesAny.createCombinationsWithRep };exports.combinationsWithRepDependencies = combinationsWithRepDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compareDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesFractionClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),compareDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCompare: _factoriesAny.createCompare };exports.compareDependencies = compareDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compareNaturalDependencies = void 0;var _dependenciesCompareGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),compareNaturalDependencies = { compareDependencies: _dependenciesCompareGenerated.compareDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCompareNatural: _factoriesAny.createCompareNatural };exports.compareNaturalDependencies = compareNaturalDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compareTextDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),compareTextDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCompareText: _factoriesAny.createCompareText };exports.compareTextDependencies = compareTextDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompile.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compileDependencies = void 0;var _dependenciesParseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),compileDependencies = { parseDependencies: _dependenciesParseGenerated.parseDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCompile: _factoriesAny.createCompile };exports.compileDependencies = compileDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.complexDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),complexDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createComplex: _factoriesAny.createComplex };exports.complexDependencies = complexDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ComplexDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ComplexDependencies = { createComplexClass: _factoriesAny.createComplexClass };exports.ComplexDependencies = ComplexDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComposition.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compositionDependencies = void 0;var _dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesCombinationsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js"),_dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesIsNegativeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js"),_dependenciesIsPositiveGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js"),_dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),compositionDependencies = { addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, combinationsDependencies: _dependenciesCombinationsGenerated.combinationsDependencies, isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, largerDependencies: _dependenciesLargerGenerated.largerDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createComposition: _factoriesAny.createComposition };exports.compositionDependencies = compositionDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.concatDependencies = void 0;var _dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),concatDependencies = { isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createConcat: _factoriesAny.createConcat };exports.concatDependencies = concatDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcatTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.concatTransformDependencies = void 0;var _dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),concatTransformDependencies = { isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createConcatTransform: _factoriesAny.createConcatTransform };exports.concatTransformDependencies = concatTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConditionalNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ConditionalNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ConditionalNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, createConditionalNode: _factoriesAny.createConditionalNode };exports.ConditionalNodeDependencies = ConditionalNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.conductanceQuantumDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),conductanceQuantumDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createConductanceQuantum: _factoriesAny.createConductanceQuantum };exports.conductanceQuantumDependencies = conductanceQuantumDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.conjDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),conjDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createConj: _factoriesAny.createConj };exports.conjDependencies = conjDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ConstantNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ConstantNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, createConstantNode: _factoriesAny.createConstantNode };exports.ConstantNodeDependencies = ConstantNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cosDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),cosDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCos: _factoriesAny.createCos };exports.cosDependencies = cosDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCosh.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.coshDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),coshDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCosh: _factoriesAny.createCosh };exports.coshDependencies = coshDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCot.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cotDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),cotDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCot: _factoriesAny.createCot };exports.cotDependencies = cotDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoth.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cothDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),cothDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCoth: _factoriesAny.createCoth };exports.cothDependencies = cothDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulomb.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.coulombDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),coulombDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createCoulomb: _factoriesAny.createCoulomb };exports.coulombDependencies = coulombDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCount.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.countDependencies = void 0;var _dependenciesProdGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProd.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),countDependencies = { prodDependencies: _dependenciesProdGenerated.prodDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCount: _factoriesAny.createCount };exports.countDependencies = countDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCreateUnit.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUnitDependencies = void 0;var _dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),createUnitDependencies = { UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCreateUnit: _factoriesAny.createCreateUnit };exports.createUnitDependencies = createUnitDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCross.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.crossDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),crossDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCross: _factoriesAny.createCross };exports.crossDependencies = crossDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsc.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cscDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),cscDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCsc: _factoriesAny.createCsc };exports.cscDependencies = cscDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsch.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cschDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),cschDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCsch: _factoriesAny.createCsch };exports.cschDependencies = cschDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCtranspose.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ctransposeDependencies = void 0;var _dependenciesConjGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js"),_dependenciesTransposeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ctransposeDependencies = { conjDependencies: _dependenciesConjGenerated.conjDependencies, transposeDependencies: _dependenciesTransposeGenerated.transposeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCtranspose: _factoriesAny.createCtranspose };exports.ctransposeDependencies = ctransposeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCube.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cubeDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),cubeDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createCube: _factoriesAny.createCube };exports.cubeDependencies = cubeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeepEqual.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.deepEqualDependencies = void 0;var _dependenciesEqualGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),deepEqualDependencies = { equalDependencies: _dependenciesEqualGenerated.equalDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDeepEqual: _factoriesAny.createDeepEqual };exports.deepEqualDependencies = deepEqualDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.DenseMatrixDependencies = void 0;var _dependenciesMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),DenseMatrixDependencies = { MatrixDependencies: _dependenciesMatrixClassGenerated.MatrixDependencies, createDenseMatrixClass: _factoriesAny.createDenseMatrixClass };exports.DenseMatrixDependencies = DenseMatrixDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDerivative.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.derivativeDependencies = void 0;var _dependenciesConstantNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js"),_dependenciesFunctionNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js"),_dependenciesOperatorNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js"),_dependenciesParenthesisNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js"),_dependenciesSymbolNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js"),_dependenciesEqualGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js"),_dependenciesIsZeroGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js"),_dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesParseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js"),_dependenciesSimplifyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),derivativeDependencies = { ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, equalDependencies: _dependenciesEqualGenerated.equalDependencies, isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, numericDependencies: _dependenciesNumericGenerated.numericDependencies, parseDependencies: _dependenciesParseGenerated.parseDependencies, simplifyDependencies: _dependenciesSimplifyGenerated.simplifyDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDerivative: _factoriesAny.createDerivative };exports.derivativeDependencies = derivativeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.detDependencies = void 0;var _dependenciesLupGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUnaryMinusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),detDependencies = { lupDependencies: _dependenciesLupGenerated.lupDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, createDet: _factoriesAny.createDet };exports.detDependencies = detDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeuteronMass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.deuteronMassDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),deuteronMassDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createDeuteronMass: _factoriesAny.createDeuteronMass };exports.deuteronMassDependencies = deuteronMassDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiag.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.diagDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesSparseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),diagDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDiag: _factoriesAny.createDiag };exports.diagDependencies = diagDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiff.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.diffDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesNumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),diffDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, numberDependencies: _dependenciesNumberGenerated.numberDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDiff: _factoriesAny.createDiff };exports.diffDependencies = diffDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiffTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.diffTransformDependencies = void 0;var _dependenciesBignumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesNumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),diffTransformDependencies = { bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, numberDependencies: _dependenciesNumberGenerated.numberDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDiffTransform: _factoriesAny.createDiffTransform };exports.diffTransformDependencies = diffTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDistance.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.distanceDependencies = void 0;var _dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSqrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUnaryMinusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),distanceDependencies = { absDependencies: _dependenciesAbsGenerated.absDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, createDistance: _factoriesAny.createDistance };exports.distanceDependencies = distanceDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.divideDependencies = void 0;var _dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesInvGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),divideDependencies = { divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, invDependencies: _dependenciesInvGenerated.invDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDivide: _factoriesAny.createDivide };exports.divideDependencies = divideDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.divideScalarDependencies = void 0;var _dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),divideScalarDependencies = { numericDependencies: _dependenciesNumericGenerated.numericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDivideScalar: _factoriesAny.createDivideScalar };exports.divideScalarDependencies = divideScalarDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDot.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.dotDependencies = void 0;var _dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesConjGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),dotDependencies = { addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, conjDependencies: _dependenciesConjGenerated.conjDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDot: _factoriesAny.createDot };exports.dotDependencies = dotDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.dotDivideDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),dotDivideDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDotDivide: _factoriesAny.createDotDivide };exports.dotDivideDependencies = dotDivideDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.dotMultiplyDependencies = void 0;var _dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),dotMultiplyDependencies = { equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDotMultiply: _factoriesAny.createDotMultiply };exports.dotMultiplyDependencies = dotMultiplyDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.dotPowDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesPowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),dotPowDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, powDependencies: _dependenciesPowGenerated.powDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createDotPow: _factoriesAny.createDotPow };exports.dotPowDependencies = dotPowDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesE.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.eDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),eDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createE: _factoriesAny.createE };exports.eDependencies = eDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEfimovFactor.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.efimovFactorDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),efimovFactorDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createEfimovFactor: _factoriesAny.createEfimovFactor };exports.efimovFactorDependencies = efimovFactorDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.eigsDependencies = void 0;var _dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesAtanGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan.generated.js"),_dependenciesBignumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js"),_dependenciesColumnGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumn.generated.js"),_dependenciesComplexGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js"),_dependenciesCosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js"),_dependenciesDiagGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiag.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js"),_dependenciesFlattenGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js"),_dependenciesImGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIm.generated.js"),_dependenciesInvGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js"),_dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesLog10Generated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog10.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMatrixFromColumnsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesNumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js"),_dependenciesQrGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js"),_dependenciesReGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRe.generated.js"),_dependenciesRoundGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js"),_dependenciesSinGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_dependenciesSqrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTransposeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUsolveAllGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),eigsDependencies = { absDependencies: _dependenciesAbsGenerated.absDependencies, addDependencies: _dependenciesAddGenerated.addDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, atanDependencies: _dependenciesAtanGenerated.atanDependencies, bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, columnDependencies: _dependenciesColumnGenerated.columnDependencies, complexDependencies: _dependenciesComplexGenerated.complexDependencies, cosDependencies: _dependenciesCosGenerated.cosDependencies, diagDependencies: _dependenciesDiagGenerated.diagDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalDependencies: _dependenciesEqualGenerated.equalDependencies, flattenDependencies: _dependenciesFlattenGenerated.flattenDependencies, imDependencies: _dependenciesImGenerated.imDependencies, invDependencies: _dependenciesInvGenerated.invDependencies, largerDependencies: _dependenciesLargerGenerated.largerDependencies, log10Dependencies: _dependenciesLog10Generated.log10Dependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, matrixFromColumnsDependencies: _dependenciesMatrixFromColumnsGenerated.matrixFromColumnsDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, numberDependencies: _dependenciesNumberGenerated.numberDependencies, qrDependencies: _dependenciesQrGenerated.qrDependencies, reDependencies: _dependenciesReGenerated.reDependencies, roundDependencies: _dependenciesRoundGenerated.roundDependencies, sinDependencies: _dependenciesSinGenerated.sinDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, transposeDependencies: _dependenciesTransposeGenerated.transposeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, usolveAllDependencies: _dependenciesUsolveAllGenerated.usolveAllDependencies, createEigs: _factoriesAny.createEigs };exports.eigsDependencies = eigsDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectricConstant.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.electricConstantDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),electricConstantDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createElectricConstant: _factoriesAny.createElectricConstant };exports.electricConstantDependencies = electricConstantDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectronMass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.electronMassDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),electronMassDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createElectronMass: _factoriesAny.createElectronMass };exports.electronMassDependencies = electronMassDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElementaryCharge.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.elementaryChargeDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),elementaryChargeDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createElementaryCharge: _factoriesAny.createElementaryCharge };exports.elementaryChargeDependencies = elementaryChargeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.equalDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),equalDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createEqual: _factoriesAny.createEqual };exports.equalDependencies = equalDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.equalScalarDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),equalScalarDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createEqualScalar: _factoriesAny.createEqualScalar };exports.equalScalarDependencies = equalScalarDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualText.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.equalTextDependencies = void 0;var _dependenciesCompareTextGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js"),_dependenciesIsZeroGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),equalTextDependencies = { compareTextDependencies: _dependenciesCompareTextGenerated.compareTextDependencies, isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createEqualText: _factoriesAny.createEqualText };exports.equalTextDependencies = equalTextDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesErf.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.erfDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),erfDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createErf: _factoriesAny.createErf };exports.erfDependencies = erfDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEvaluate.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.evaluateDependencies = void 0;var _dependenciesParseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),evaluateDependencies = { parseDependencies: _dependenciesParseGenerated.parseDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createEvaluate: _factoriesAny.createEvaluate };exports.evaluateDependencies = evaluateDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExp.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.expDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),expDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createExp: _factoriesAny.createExp };exports.expDependencies = expDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.expmDependencies = void 0;var _dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesIdentityGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js"),_dependenciesInvGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),expmDependencies = { absDependencies: _dependenciesAbsGenerated.absDependencies, addDependencies: _dependenciesAddGenerated.addDependencies, identityDependencies: _dependenciesIdentityGenerated.identityDependencies, invDependencies: _dependenciesInvGenerated.invDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createExpm: _factoriesAny.createExpm };exports.expmDependencies = expmDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm1.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.expm1Dependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),expm1Dependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createExpm1: _factoriesAny.createExpm1 };exports.expm1Dependencies = expm1Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.factorialDependencies = void 0;var _dependenciesGammaGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGamma.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),factorialDependencies = { gammaDependencies: _dependenciesGammaGenerated.gammaDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createFactorial: _factoriesAny.createFactorial };exports.factorialDependencies = factorialDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFalse.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.falseDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),falseDependencies = { createFalse: _factoriesAny.createFalse };exports.falseDependencies = falseDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFaraday.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.faradayDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),faradayDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createFaraday: _factoriesAny.createFaraday };exports.faradayDependencies = faradayDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFermiCoupling.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.fermiCouplingDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),fermiCouplingDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createFermiCoupling: _factoriesAny.createFermiCoupling };exports.fermiCouplingDependencies = fermiCouplingDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.FibonacciHeapDependencies = void 0;var _dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),FibonacciHeapDependencies = { largerDependencies: _dependenciesLargerGenerated.largerDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, createFibonacciHeapClass: _factoriesAny.createFibonacciHeapClass };exports.FibonacciHeapDependencies = FibonacciHeapDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilter.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.filterDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),filterDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createFilter: _factoriesAny.createFilter };exports.filterDependencies = filterDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilterTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.filterTransformDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),filterTransformDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createFilterTransform: _factoriesAny.createFilterTransform };exports.filterTransformDependencies = filterTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFineStructure.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.fineStructureDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),fineStructureDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createFineStructure: _factoriesAny.createFineStructure };exports.fineStructureDependencies = fineStructureDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFirstRadiation.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.firstRadiationDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),firstRadiationDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createFirstRadiation: _factoriesAny.createFirstRadiation };exports.firstRadiationDependencies = firstRadiationDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.fixDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesCeilGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js"),_dependenciesFloorGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),fixDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, ceilDependencies: _dependenciesCeilGenerated.ceilDependencies, floorDependencies: _dependenciesFloorGenerated.floorDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createFix: _factoriesAny.createFix };exports.fixDependencies = fixDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.flattenDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),flattenDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createFlatten: _factoriesAny.createFlatten };exports.flattenDependencies = flattenDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.floorDependencies = void 0;var _dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesRoundGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),floorDependencies = { equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, roundDependencies: _dependenciesRoundGenerated.roundDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createFloor: _factoriesAny.createFloor };exports.floorDependencies = floorDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEach.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.forEachDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),forEachDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createForEach: _factoriesAny.createForEach };exports.forEachDependencies = forEachDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEachTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.forEachTransformDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),forEachTransformDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createForEachTransform: _factoriesAny.createForEachTransform };exports.forEachTransformDependencies = forEachTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.formatDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),formatDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createFormat: _factoriesAny.createFormat };exports.formatDependencies = formatDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.fractionDependencies = void 0;var _dependenciesFractionClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),fractionDependencies = { FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createFraction: _factoriesAny.createFraction };exports.fractionDependencies = fractionDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.FractionDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),FractionDependencies = { createFractionClass: _factoriesAny.createFractionClass };exports.FractionDependencies = FractionDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.FunctionAssignmentNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),FunctionAssignmentNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createFunctionAssignmentNode: _factoriesAny.createFunctionAssignmentNode };exports.FunctionAssignmentNodeDependencies = FunctionAssignmentNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.FunctionNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_dependenciesSymbolNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),FunctionNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, createFunctionNode: _factoriesAny.createFunctionNode };exports.FunctionNodeDependencies = FunctionNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGamma.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.gammaDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesPowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),gammaDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, powDependencies: _dependenciesPowGenerated.powDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createGamma: _factoriesAny.createGamma };exports.gammaDependencies = gammaDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGasConstant.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.gasConstantDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),gasConstantDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createGasConstant: _factoriesAny.createGasConstant };exports.gasConstantDependencies = gasConstantDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.gcdDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),gcdDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createGcd: _factoriesAny.createGcd };exports.gcdDependencies = gcdDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.getMatrixDataTypeDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),getMatrixDataTypeDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createGetMatrixDataType: _factoriesAny.createGetMatrixDataType };exports.getMatrixDataTypeDependencies = getMatrixDataTypeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravitationConstant.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.gravitationConstantDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),gravitationConstantDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createGravitationConstant: _factoriesAny.createGravitationConstant };exports.gravitationConstantDependencies = gravitationConstantDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravity.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.gravityDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),gravityDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createGravity: _factoriesAny.createGravity };exports.gravityDependencies = gravityDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.hartreeEnergyDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),hartreeEnergyDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createHartreeEnergy: _factoriesAny.createHartreeEnergy };exports.hartreeEnergyDependencies = hartreeEnergyDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHasNumericValue.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.hasNumericValueDependencies = void 0;var _dependenciesIsNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),hasNumericValueDependencies = { isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createHasNumericValue: _factoriesAny.createHasNumericValue };exports.hasNumericValueDependencies = hasNumericValueDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelp.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.helpDependencies = void 0;var _dependenciesHelpClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelpClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),helpDependencies = { HelpDependencies: _dependenciesHelpClassGenerated.HelpDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createHelp: _factoriesAny.createHelp };exports.helpDependencies = helpDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelpClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.HelpDependencies = void 0;var _dependenciesParseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),HelpDependencies = { parseDependencies: _dependenciesParseGenerated.parseDependencies, createHelpClass: _factoriesAny.createHelpClass };exports.HelpDependencies = HelpDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHex.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.hexDependencies = void 0;var _dependenciesFormatGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),hexDependencies = { formatDependencies: _dependenciesFormatGenerated.formatDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createHex: _factoriesAny.createHex };exports.hexDependencies = hexDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHypot.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.hypotDependencies = void 0;var _dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesIsPositiveGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_dependenciesSqrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),hypotDependencies = { absDependencies: _dependenciesAbsGenerated.absDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createHypot: _factoriesAny.createHypot };exports.hypotDependencies = hypotDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesI.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.iDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),iDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, createI: _factoriesAny.createI };exports.iDependencies = iDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.identityDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesSparseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),identityDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIdentity: _factoriesAny.createIdentity };exports.identityDependencies = identityDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIm.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.imDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),imDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIm: _factoriesAny.createIm };exports.imDependencies = imDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ImmutableDenseMatrixDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ImmutableDenseMatrixDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, createImmutableDenseMatrixClass: _factoriesAny.createImmutableDenseMatrixClass };exports.ImmutableDenseMatrixDependencies = ImmutableDenseMatrixDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndex.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.indexDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),indexDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIndex: _factoriesAny.createIndex };exports.indexDependencies = indexDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.IndexDependencies = void 0;var _dependenciesImmutableDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),IndexDependencies = { ImmutableDenseMatrixDependencies: _dependenciesImmutableDenseMatrixClassGenerated.ImmutableDenseMatrixDependencies, createIndexClass: _factoriesAny.createIndexClass };exports.IndexDependencies = IndexDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.IndexNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_dependenciesRangeClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeClass.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),IndexNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, RangeDependencies: _dependenciesRangeClassGenerated.RangeDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, createIndexNode: _factoriesAny.createIndexNode };exports.IndexNodeDependencies = IndexNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.indexTransformDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),indexTransformDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, createIndexTransform: _factoriesAny.createIndexTransform };exports.indexTransformDependencies = indexTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInfinity.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.InfinityDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),InfinityDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createInfinity: _factoriesAny.createInfinity };exports.InfinityDependencies = InfinityDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIntersect.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.intersectDependencies = void 0;var _dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),intersectDependencies = { absDependencies: _dependenciesAbsGenerated.absDependencies, addDependencies: _dependenciesAddGenerated.addDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIntersect: _factoriesAny.createIntersect };exports.intersectDependencies = intersectDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.invDependencies = void 0;var _dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesDetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesIdentityGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUnaryMinusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),invDependencies = { absDependencies: _dependenciesAbsGenerated.absDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, detDependencies: _dependenciesDetGenerated.detDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, identityDependencies: _dependenciesIdentityGenerated.identityDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, createInv: _factoriesAny.createInv };exports.invDependencies = invDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.inverseConductanceQuantumDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),inverseConductanceQuantumDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createInverseConductanceQuantum: _factoriesAny.createInverseConductanceQuantum };exports.inverseConductanceQuantumDependencies = inverseConductanceQuantumDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isIntegerDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),isIntegerDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIsInteger: _factoriesAny.createIsInteger };exports.isIntegerDependencies = isIntegerDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isNaNDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),isNaNDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIsNaN: _factoriesAny.createIsNaN };exports.isNaNDependencies = isNaNDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isNegativeDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),isNegativeDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIsNegative: _factoriesAny.createIsNegative };exports.isNegativeDependencies = isNegativeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isNumericDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),isNumericDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIsNumeric: _factoriesAny.createIsNumeric };exports.isNumericDependencies = isNumericDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isPositiveDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),isPositiveDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIsPositive: _factoriesAny.createIsPositive };exports.isPositiveDependencies = isPositiveDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPrime.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isPrimeDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),isPrimeDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIsPrime: _factoriesAny.createIsPrime };exports.isPrimeDependencies = isPrimeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isZeroDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),isZeroDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createIsZero: _factoriesAny.createIsZero };exports.isZeroDependencies = isZeroDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKldivergence.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.kldivergenceDependencies = void 0;var _dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesDotDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js"),_dependenciesIsNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js"),_dependenciesLogGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesSumGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSum.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),kldivergenceDependencies = { divideDependencies: _dependenciesDivideGenerated.divideDependencies, dotDivideDependencies: _dependenciesDotDivideGenerated.dotDivideDependencies, isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, logDependencies: _dependenciesLogGenerated.logDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, sumDependencies: _dependenciesSumGenerated.sumDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createKldivergence: _factoriesAny.createKldivergence };exports.kldivergenceDependencies = kldivergenceDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKlitzing.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.klitzingDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),klitzingDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createKlitzing: _factoriesAny.createKlitzing };exports.klitzingDependencies = klitzingDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKron.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.kronDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),kronDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createKron: _factoriesAny.createKron };exports.kronDependencies = kronDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN10.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.LN10Dependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),LN10Dependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createLN10: _factoriesAny.createLN10 };exports.LN10Dependencies = LN10Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN2.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.LN2Dependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),LN2Dependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createLN2: _factoriesAny.createLN2 };exports.LN2Dependencies = LN2Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG10E.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.LOG10EDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),LOG10EDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createLOG10E: _factoriesAny.createLOG10E };exports.LOG10EDependencies = LOG10EDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG2E.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.LOG2EDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),LOG2EDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createLOG2E: _factoriesAny.createLOG2E };exports.LOG2EDependencies = LOG2EDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.largerDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),largerDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createLarger: _factoriesAny.createLarger };exports.largerDependencies = largerDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.largerEqDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),largerEqDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createLargerEq: _factoriesAny.createLargerEq };exports.largerEqDependencies = largerEqDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lcmDependencies = void 0;var _dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),lcmDependencies = { equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createLcm: _factoriesAny.createLcm };exports.lcmDependencies = lcmDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.leftShiftDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesZerosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),leftShiftDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, createLeftShift: _factoriesAny.createLeftShift };exports.leftShiftDependencies = leftShiftDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.logDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),logDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createLog: _factoriesAny.createLog };exports.logDependencies = logDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog10.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.log10Dependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),log10Dependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createLog10: _factoriesAny.createLog10 };exports.log10Dependencies = log10Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog1p.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.log1pDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesLogGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),log1pDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, logDependencies: _dependenciesLogGenerated.logDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createLog1p: _factoriesAny.createLog1p };exports.log1pDependencies = log1pDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog2.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.log2Dependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),log2Dependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createLog2: _factoriesAny.createLog2 };exports.log2Dependencies = log2Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLoschmidt.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.loschmidtDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),loschmidtDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createLoschmidt: _factoriesAny.createLoschmidt };exports.loschmidtDependencies = loschmidtDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lsolveDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),lsolveDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createLsolve: _factoriesAny.createLsolve };exports.lsolveDependencies = lsolveDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolveAll.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lsolveAllDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),lsolveAllDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createLsolveAll: _factoriesAny.createLsolveAll };exports.lsolveAllDependencies = lsolveAllDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lupDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesSpaClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js"),_dependenciesSparseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js"),_dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUnaryMinusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),lupDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, SpaDependencies: _dependenciesSpaClassGenerated.SpaDependencies, SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, absDependencies: _dependenciesAbsGenerated.absDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, largerDependencies: _dependenciesLargerGenerated.largerDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, createLup: _factoriesAny.createLup };exports.lupDependencies = lupDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLusolve.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lusolveDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesLsolveGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js"),_dependenciesLupGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesSluGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSlu.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUsolveGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),lusolveDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, lsolveDependencies: _dependenciesLsolveGenerated.lsolveDependencies, lupDependencies: _dependenciesLupGenerated.lupDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, sluDependencies: _dependenciesSluGenerated.sluDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, usolveDependencies: _dependenciesUsolveGenerated.usolveDependencies, createLusolve: _factoriesAny.createLusolve };exports.lusolveDependencies = lusolveDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMad.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.madDependencies = void 0;var _dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesMapGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMap.generated.js"),_dependenciesMedianGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),madDependencies = { absDependencies: _dependenciesAbsGenerated.absDependencies, mapDependencies: _dependenciesMapGenerated.mapDependencies, medianDependencies: _dependenciesMedianGenerated.medianDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMad: _factoriesAny.createMad };exports.madDependencies = madDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticConstant.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.magneticConstantDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),magneticConstantDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createMagneticConstant: _factoriesAny.createMagneticConstant };exports.magneticConstantDependencies = magneticConstantDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.magneticFluxQuantumDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),magneticFluxQuantumDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createMagneticFluxQuantum: _factoriesAny.createMagneticFluxQuantum };exports.magneticFluxQuantumDependencies = magneticFluxQuantumDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMap.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.mapDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),mapDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMap: _factoriesAny.createMap };exports.mapDependencies = mapDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.mapTransformDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),mapTransformDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMapTransform: _factoriesAny.createMapTransform };exports.mapTransformDependencies = mapTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.matrixDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js"),_dependenciesSparseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),matrixDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, MatrixDependencies: _dependenciesMatrixClassGenerated.MatrixDependencies, SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMatrix: _factoriesAny.createMatrix };exports.matrixDependencies = matrixDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.MatrixDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),MatrixDependencies = { createMatrixClass: _factoriesAny.createMatrixClass };exports.MatrixDependencies = MatrixDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.matrixFromColumnsDependencies = void 0;var _dependenciesFlattenGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),matrixFromColumnsDependencies = { flattenDependencies: _dependenciesFlattenGenerated.flattenDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMatrixFromColumns: _factoriesAny.createMatrixFromColumns };exports.matrixFromColumnsDependencies = matrixFromColumnsDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.matrixFromFunctionDependencies = void 0;var _dependenciesIsZeroGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),matrixFromFunctionDependencies = { isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMatrixFromFunction: _factoriesAny.createMatrixFromFunction };exports.matrixFromFunctionDependencies = matrixFromFunctionDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.matrixFromRowsDependencies = void 0;var _dependenciesFlattenGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),matrixFromRowsDependencies = { flattenDependencies: _dependenciesFlattenGenerated.flattenDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMatrixFromRows: _factoriesAny.createMatrixFromRows };exports.matrixFromRowsDependencies = matrixFromRowsDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMax.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.maxDependencies = void 0;var _dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),maxDependencies = { largerDependencies: _dependenciesLargerGenerated.largerDependencies, numericDependencies: _dependenciesNumericGenerated.numericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMax: _factoriesAny.createMax };exports.maxDependencies = maxDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMaxTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.maxTransformDependencies = void 0;var _dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),maxTransformDependencies = { largerDependencies: _dependenciesLargerGenerated.largerDependencies, numericDependencies: _dependenciesNumericGenerated.numericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMaxTransform: _factoriesAny.createMaxTransform };exports.maxTransformDependencies = maxTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMean.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.meanDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),meanDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, divideDependencies: _dependenciesDivideGenerated.divideDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMean: _factoriesAny.createMean };exports.meanDependencies = meanDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMeanTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.meanTransformDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),meanTransformDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, divideDependencies: _dependenciesDivideGenerated.divideDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMeanTransform: _factoriesAny.createMeanTransform };exports.meanTransformDependencies = meanTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.medianDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesCompareGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js"),_dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesPartitionSelectGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),medianDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, compareDependencies: _dependenciesCompareGenerated.compareDependencies, divideDependencies: _dependenciesDivideGenerated.divideDependencies, partitionSelectDependencies: _dependenciesPartitionSelectGenerated.partitionSelectDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMedian: _factoriesAny.createMedian };exports.medianDependencies = medianDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMin.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.minDependencies = void 0;var _dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),minDependencies = { numericDependencies: _dependenciesNumericGenerated.numericDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMin: _factoriesAny.createMin };exports.minDependencies = minDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMinTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.minTransformDependencies = void 0;var _dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),minTransformDependencies = { numericDependencies: _dependenciesNumericGenerated.numericDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMinTransform: _factoriesAny.createMinTransform };exports.minTransformDependencies = minTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.modDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),modDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMod: _factoriesAny.createMod };exports.modDependencies = modDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.modeDependencies = void 0;var _dependenciesIsNaNGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js"),_dependenciesIsNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),modeDependencies = { isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMode: _factoriesAny.createMode };exports.modeDependencies = modeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.molarMassDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),molarMassDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createMolarMass: _factoriesAny.createMolarMass };exports.molarMassDependencies = molarMassDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMassC12.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.molarMassC12Dependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),molarMassC12Dependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createMolarMassC12: _factoriesAny.createMolarMassC12 };exports.molarMassC12Dependencies = molarMassC12Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.molarPlanckConstantDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),molarPlanckConstantDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createMolarPlanckConstant: _factoriesAny.createMolarPlanckConstant };exports.molarPlanckConstantDependencies = molarPlanckConstantDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarVolume.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.molarVolumeDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),molarVolumeDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createMolarVolume: _factoriesAny.createMolarVolume };exports.molarVolumeDependencies = molarVolumeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultinomial.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.multinomialDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesFactorialGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js"),_dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesIsPositiveGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),multinomialDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, divideDependencies: _dependenciesDivideGenerated.divideDependencies, factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMultinomial: _factoriesAny.createMultinomial };exports.multinomialDependencies = multinomialDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.multiplyDependencies = void 0;var _dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesDotGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDot.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),multiplyDependencies = { addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, dotDependencies: _dependenciesDotGenerated.dotDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMultiply: _factoriesAny.createMultiply };exports.multiplyDependencies = multiplyDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.multiplyScalarDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),multiplyScalarDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createMultiplyScalar: _factoriesAny.createMultiplyScalar };exports.multiplyScalarDependencies = multiplyScalarDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNaN.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.NaNDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),NaNDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createNaN: _factoriesAny.createNaN };exports.NaNDependencies = NaNDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNeutronMass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.neutronMassDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),neutronMassDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createNeutronMass: _factoriesAny.createNeutronMass };exports.neutronMassDependencies = neutronMassDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.NodeDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),NodeDependencies = { createNode: _factoriesAny.createNode };exports.NodeDependencies = NodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.normDependencies = void 0;var _dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesConjGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js"),_dependenciesCtransposeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCtranspose.generated.js"),_dependenciesEigsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesPowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_dependenciesSqrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),normDependencies = { absDependencies: _dependenciesAbsGenerated.absDependencies, addDependencies: _dependenciesAddGenerated.addDependencies, conjDependencies: _dependenciesConjGenerated.conjDependencies, ctransposeDependencies: _dependenciesCtransposeGenerated.ctransposeDependencies, eigsDependencies: _dependenciesEigsGenerated.eigsDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, largerDependencies: _dependenciesLargerGenerated.largerDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, powDependencies: _dependenciesPowGenerated.powDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createNorm: _factoriesAny.createNorm };exports.normDependencies = normDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNot.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.notDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),notDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createNot: _factoriesAny.createNot };exports.notDependencies = notDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.nthRootDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),nthRootDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createNthRoot: _factoriesAny.createNthRoot };exports.nthRootDependencies = nthRootDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoots.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.nthRootsDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),nthRootsDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createNthRoots: _factoriesAny.createNthRoots };exports.nthRootsDependencies = nthRootsDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.nuclearMagnetonDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),nuclearMagnetonDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createNuclearMagneton: _factoriesAny.createNuclearMagneton };exports.nuclearMagnetonDependencies = nuclearMagnetonDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNull.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.nullDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),nullDependencies = { createNull: _factoriesAny.createNull };exports.nullDependencies = nullDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.numberDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),numberDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createNumber: _factoriesAny.createNumber };exports.numberDependencies = numberDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.numericDependencies = void 0;var _dependenciesBignumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js"),_dependenciesFractionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js"),_dependenciesNumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),numericDependencies = { bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, fractionDependencies: _dependenciesFractionGenerated.fractionDependencies, numberDependencies: _dependenciesNumberGenerated.numberDependencies, createNumeric: _factoriesAny.createNumeric };exports.numericDependencies = numericDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesObjectNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ObjectNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ObjectNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, createObjectNode: _factoriesAny.createObjectNode };exports.ObjectNodeDependencies = ObjectNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOct.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.octDependencies = void 0;var _dependenciesFormatGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),octDependencies = { formatDependencies: _dependenciesFormatGenerated.formatDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createOct: _factoriesAny.createOct };exports.octDependencies = octDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOnes.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.onesDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),onesDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createOnes: _factoriesAny.createOnes };exports.onesDependencies = onesDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.OperatorNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),OperatorNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, createOperatorNode: _factoriesAny.createOperatorNode };exports.OperatorNodeDependencies = OperatorNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.orDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),orDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createOr: _factoriesAny.createOr };exports.orDependencies = orDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ParenthesisNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ParenthesisNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, createParenthesisNode: _factoriesAny.createParenthesisNode };exports.ParenthesisNodeDependencies = ParenthesisNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.parseDependencies = void 0;var _dependenciesAccessorNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAccessorNode.generated.js"),_dependenciesArrayNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArrayNode.generated.js"),_dependenciesAssignmentNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAssignmentNode.generated.js"),_dependenciesBlockNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBlockNode.generated.js"),_dependenciesConditionalNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConditionalNode.generated.js"),_dependenciesConstantNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js"),_dependenciesFunctionAssignmentNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js"),_dependenciesFunctionNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js"),_dependenciesIndexNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js"),_dependenciesObjectNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesObjectNode.generated.js"),_dependenciesOperatorNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js"),_dependenciesParenthesisNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js"),_dependenciesRangeNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeNode.generated.js"),_dependenciesRelationalNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRelationalNode.generated.js"),_dependenciesSymbolNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js"),_dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),parseDependencies = { AccessorNodeDependencies: _dependenciesAccessorNodeGenerated.AccessorNodeDependencies, ArrayNodeDependencies: _dependenciesArrayNodeGenerated.ArrayNodeDependencies, AssignmentNodeDependencies: _dependenciesAssignmentNodeGenerated.AssignmentNodeDependencies, BlockNodeDependencies: _dependenciesBlockNodeGenerated.BlockNodeDependencies, ConditionalNodeDependencies: _dependenciesConditionalNodeGenerated.ConditionalNodeDependencies, ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, FunctionAssignmentNodeDependencies: _dependenciesFunctionAssignmentNodeGenerated.FunctionAssignmentNodeDependencies, FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, IndexNodeDependencies: _dependenciesIndexNodeGenerated.IndexNodeDependencies, ObjectNodeDependencies: _dependenciesObjectNodeGenerated.ObjectNodeDependencies, OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, RangeNodeDependencies: _dependenciesRangeNodeGenerated.RangeNodeDependencies, RelationalNodeDependencies: _dependenciesRelationalNodeGenerated.RelationalNodeDependencies, SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, numericDependencies: _dependenciesNumericGenerated.numericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createParse: _factoriesAny.createParse };exports.parseDependencies = parseDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParser.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.parserDependencies = void 0;var _dependenciesParserClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParserClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),parserDependencies = { ParserDependencies: _dependenciesParserClassGenerated.ParserDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createParser: _factoriesAny.createParser };exports.parserDependencies = parserDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParserClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ParserDependencies = void 0;var _dependenciesParseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ParserDependencies = { parseDependencies: _dependenciesParseGenerated.parseDependencies, createParserClass: _factoriesAny.createParserClass };exports.ParserDependencies = ParserDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.partitionSelectDependencies = void 0;var _dependenciesCompareGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js"),_dependenciesIsNaNGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js"),_dependenciesIsNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),partitionSelectDependencies = { compareDependencies: _dependenciesCompareGenerated.compareDependencies, isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createPartitionSelect: _factoriesAny.createPartitionSelect };exports.partitionSelectDependencies = partitionSelectDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPermutations.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.permutationsDependencies = void 0;var _dependenciesFactorialGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),permutationsDependencies = { factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createPermutations: _factoriesAny.createPermutations };exports.permutationsDependencies = permutationsDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPhi.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.phiDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),phiDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createPhi: _factoriesAny.createPhi };exports.phiDependencies = phiDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPi.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.piDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),piDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createPi: _factoriesAny.createPi };exports.piDependencies = piDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPickRandom.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.pickRandomDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),pickRandomDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createPickRandom: _factoriesAny.createPickRandom };exports.pickRandomDependencies = pickRandomDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckCharge.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.planckChargeDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),planckChargeDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createPlanckCharge: _factoriesAny.createPlanckCharge };exports.planckChargeDependencies = planckChargeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckConstant.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.planckConstantDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),planckConstantDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createPlanckConstant: _factoriesAny.createPlanckConstant };exports.planckConstantDependencies = planckConstantDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckLength.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.planckLengthDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),planckLengthDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createPlanckLength: _factoriesAny.createPlanckLength };exports.planckLengthDependencies = planckLengthDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckMass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.planckMassDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),planckMassDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createPlanckMass: _factoriesAny.createPlanckMass };exports.planckMassDependencies = planckMassDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.planckTemperatureDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),planckTemperatureDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createPlanckTemperature: _factoriesAny.createPlanckTemperature };exports.planckTemperatureDependencies = planckTemperatureDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTime.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.planckTimeDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),planckTimeDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createPlanckTime: _factoriesAny.createPlanckTime };exports.planckTimeDependencies = planckTimeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.powDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesFractionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js"),_dependenciesIdentityGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesNumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),powDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, fractionDependencies: _dependenciesFractionGenerated.fractionDependencies, identityDependencies: _dependenciesIdentityGenerated.identityDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, numberDependencies: _dependenciesNumberGenerated.numberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createPow: _factoriesAny.createPow };exports.powDependencies = powDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrint.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.printDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),printDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createPrint: _factoriesAny.createPrint };exports.printDependencies = printDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProd.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.prodDependencies = void 0;var _dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),prodDependencies = { multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, numericDependencies: _dependenciesNumericGenerated.numericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createProd: _factoriesAny.createProd };exports.prodDependencies = prodDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProtonMass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.protonMassDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),protonMassDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createProtonMass: _factoriesAny.createProtonMass };exports.protonMassDependencies = protonMassDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.qrDependencies = void 0;var _dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesComplexGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js"),_dependenciesConjGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js"),_dependenciesIdentityGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js"),_dependenciesIsZeroGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSignGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSign.generated.js"),_dependenciesSqrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUnaryMinusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js"),_dependenciesZerosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),qrDependencies = { addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, complexDependencies: _dependenciesComplexGenerated.complexDependencies, conjDependencies: _dependenciesConjGenerated.conjDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalDependencies: _dependenciesEqualGenerated.equalDependencies, identityDependencies: _dependenciesIdentityGenerated.identityDependencies, isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, signDependencies: _dependenciesSignGenerated.signDependencies, sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, createQr: _factoriesAny.createQr };exports.qrDependencies = qrDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeq.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.quantileSeqDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesCompareGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesPartitionSelectGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),quantileSeqDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, compareDependencies: _dependenciesCompareGenerated.compareDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, partitionSelectDependencies: _dependenciesPartitionSelectGenerated.partitionSelectDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createQuantileSeq: _factoriesAny.createQuantileSeq };exports.quantileSeqDependencies = quantileSeqDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.quantumOfCirculationDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),quantumOfCirculationDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createQuantumOfCirculation: _factoriesAny.createQuantumOfCirculation };exports.quantumOfCirculationDependencies = quantumOfCirculationDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandom.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.randomDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),randomDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createRandom: _factoriesAny.createRandom };exports.randomDependencies = randomDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandomInt.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.randomIntDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),randomIntDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createRandomInt: _factoriesAny.createRandomInt };exports.randomIntDependencies = randomIntDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rangeDependencies = void 0;var _dependenciesBignumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesLargerEqGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_dependenciesSmallerEqGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rangeDependencies = { bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, largerDependencies: _dependenciesLargerGenerated.largerDependencies, largerEqDependencies: _dependenciesLargerEqGenerated.largerEqDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createRange: _factoriesAny.createRange };exports.rangeDependencies = rangeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.RangeDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),RangeDependencies = { createRangeClass: _factoriesAny.createRangeClass };exports.RangeDependencies = RangeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.RangeNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),RangeNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, createRangeNode: _factoriesAny.createRangeNode };exports.RangeNodeDependencies = RangeNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rangeTransformDependencies = void 0;var _dependenciesBignumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesLargerEqGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js"),_dependenciesSmallerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js"),_dependenciesSmallerEqGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rangeTransformDependencies = { bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, largerDependencies: _dependenciesLargerGenerated.largerDependencies, largerEqDependencies: _dependenciesLargerEqGenerated.largerEqDependencies, smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, smallerEqDependencies: _dependenciesSmallerEqGenerated.smallerEqDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createRangeTransform: _factoriesAny.createRangeTransform };exports.rangeTransformDependencies = rangeTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rationalizeDependencies = void 0;var _dependenciesBignumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js"),_dependenciesFractionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js"),_dependenciesConstantNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js"),_dependenciesFunctionNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js"),_dependenciesOperatorNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js"),_dependenciesParenthesisNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js"),_dependenciesSymbolNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js"),_dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesEqualGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js"),_dependenciesIsZeroGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesParseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js"),_dependenciesPowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js"),_dependenciesSimplifyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rationalizeDependencies = { bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, fractionDependencies: _dependenciesFractionGenerated.fractionDependencies, ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, addDependencies: _dependenciesAddGenerated.addDependencies, divideDependencies: _dependenciesDivideGenerated.divideDependencies, equalDependencies: _dependenciesEqualGenerated.equalDependencies, isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, parseDependencies: _dependenciesParseGenerated.parseDependencies, powDependencies: _dependenciesPowGenerated.powDependencies, simplifyDependencies: _dependenciesSimplifyGenerated.simplifyDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createRationalize: _factoriesAny.createRationalize };exports.rationalizeDependencies = rationalizeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRe.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.reDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),reDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createRe: _factoriesAny.createRe };exports.reDependencies = reDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.reducedPlanckConstantDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),reducedPlanckConstantDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createReducedPlanckConstant: _factoriesAny.createReducedPlanckConstant };exports.reducedPlanckConstantDependencies = reducedPlanckConstantDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRelationalNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.RelationalNodeDependencies = void 0;var _dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),RelationalNodeDependencies = { NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, createRelationalNode: _factoriesAny.createRelationalNode };exports.RelationalNodeDependencies = RelationalNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReplacer.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.replacerDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),replacerDependencies = { createReplacer: _factoriesAny.createReplacer };exports.replacerDependencies = replacerDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReshape.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.reshapeDependencies = void 0;var _dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),reshapeDependencies = { isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createReshape: _factoriesAny.createReshape };exports.reshapeDependencies = reshapeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResize.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.resizeDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),resizeDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, createResize: _factoriesAny.createResize };exports.resizeDependencies = resizeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResultSet.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ResultSetDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ResultSetDependencies = { createResultSet: _factoriesAny.createResultSet };exports.ResultSetDependencies = ResultSetDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReviver.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.reviverDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),reviverDependencies = { createReviver: _factoriesAny.createReviver };exports.reviverDependencies = reviverDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rightArithShiftDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesZerosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rightArithShiftDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, createRightArithShift: _factoriesAny.createRightArithShift };exports.rightArithShiftDependencies = rightArithShiftDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rightLogShiftDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesZerosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rightLogShiftDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, createRightLogShift: _factoriesAny.createRightLogShift };exports.rightLogShiftDependencies = rightLogShiftDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotate.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rotateDependencies = void 0;var _dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesRotationMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotationMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rotateDependencies = { multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, rotationMatrixDependencies: _dependenciesRotationMatrixGenerated.rotationMatrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createRotate: _factoriesAny.createRotate };exports.rotateDependencies = rotateDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotationMatrix.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rotationMatrixDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesSparseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesCosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesNormGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js"),_dependenciesSinGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUnaryMinusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rotationMatrixDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, cosDependencies: _dependenciesCosGenerated.cosDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, normDependencies: _dependenciesNormGenerated.normDependencies, sinDependencies: _dependenciesSinGenerated.sinDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, createRotationMatrix: _factoriesAny.createRotationMatrix };exports.rotationMatrixDependencies = rotationMatrixDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.roundDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesZerosGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),roundDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, zerosDependencies: _dependenciesZerosGenerated.zerosDependencies, createRound: _factoriesAny.createRound };exports.roundDependencies = roundDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRow.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rowDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesRangeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rowDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, rangeDependencies: _dependenciesRangeGenerated.rangeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createRow: _factoriesAny.createRow };exports.rowDependencies = rowDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRowTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rowTransformDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesRangeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rowTransformDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, rangeDependencies: _dependenciesRangeGenerated.rangeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createRowTransform: _factoriesAny.createRowTransform };exports.rowTransformDependencies = rowTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRydberg.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rydbergDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),rydbergDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createRydberg: _factoriesAny.createRydberg };exports.rydbergDependencies = rydbergDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT1_2.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.SQRT1_2Dependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),SQRT1_2Dependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createSQRT1_2: _factoriesAny.createSQRT1_2 };exports.SQRT1_2Dependencies = SQRT1_2Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT2.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.SQRT2Dependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),SQRT2Dependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createSQRT2: _factoriesAny.createSQRT2 };exports.SQRT2Dependencies = SQRT2Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSackurTetrode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sackurTetrodeDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sackurTetrodeDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createSackurTetrode: _factoriesAny.createSackurTetrode };exports.sackurTetrodeDependencies = sackurTetrodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSec.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.secDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),secDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSec: _factoriesAny.createSec };exports.secDependencies = secDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSech.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sechDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sechDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSech: _factoriesAny.createSech };exports.sechDependencies = sechDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSecondRadiation.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.secondRadiationDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),secondRadiationDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createSecondRadiation: _factoriesAny.createSecondRadiation };exports.secondRadiationDependencies = secondRadiationDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetCartesian.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setCartesianDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setCartesianDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetCartesian: _factoriesAny.createSetCartesian };exports.setCartesianDependencies = setCartesianDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDifference.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setDifferenceDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setDifferenceDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetDifference: _factoriesAny.createSetDifference };exports.setDifferenceDependencies = setDifferenceDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDistinct.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setDistinctDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setDistinctDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetDistinct: _factoriesAny.createSetDistinct };exports.setDistinctDependencies = setDistinctDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIntersect.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setIntersectDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setIntersectDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetIntersect: _factoriesAny.createSetIntersect };exports.setIntersectDependencies = setIntersectDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIsSubset.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setIsSubsetDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setIsSubsetDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetIsSubset: _factoriesAny.createSetIsSubset };exports.setIsSubsetDependencies = setIsSubsetDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setMultiplicityDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setMultiplicityDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetMultiplicity: _factoriesAny.createSetMultiplicity };exports.setMultiplicityDependencies = setMultiplicityDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetPowerset.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setPowersetDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setPowersetDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetPowerset: _factoriesAny.createSetPowerset };exports.setPowersetDependencies = setPowersetDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSize.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setSizeDependencies = void 0;var _dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setSizeDependencies = { compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetSize: _factoriesAny.createSetSize };exports.setSizeDependencies = setSizeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSymDifference.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setSymDifferenceDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesConcatGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js"),_dependenciesSetDifferenceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDifference.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setSymDifferenceDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, concatDependencies: _dependenciesConcatGenerated.concatDependencies, setDifferenceDependencies: _dependenciesSetDifferenceGenerated.setDifferenceDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetSymDifference: _factoriesAny.createSetSymDifference };exports.setSymDifferenceDependencies = setSymDifferenceDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetUnion.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setUnionDependencies = void 0;var _dependenciesIndexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js"),_dependenciesConcatGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js"),_dependenciesSetIntersectGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIntersect.generated.js"),_dependenciesSetSymDifferenceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSymDifference.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSubsetGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),setUnionDependencies = { IndexDependencies: _dependenciesIndexClassGenerated.IndexDependencies, concatDependencies: _dependenciesConcatGenerated.concatDependencies, setIntersectDependencies: _dependenciesSetIntersectGenerated.setIntersectDependencies, setSymDifferenceDependencies: _dependenciesSetSymDifferenceGenerated.setSymDifferenceDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, subsetDependencies: _dependenciesSubsetGenerated.subsetDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSetUnion: _factoriesAny.createSetUnion };exports.setUnionDependencies = setUnionDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSign.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.signDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesFractionClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js"),_dependenciesComplexGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),signDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, complexDependencies: _dependenciesComplexGenerated.complexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSign: _factoriesAny.createSign };exports.signDependencies = signDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.simplifyDependencies = void 0;var _dependenciesBignumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js"),_dependenciesFractionGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js"),_dependenciesConstantNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js"),_dependenciesFunctionNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js"),_dependenciesOperatorNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js"),_dependenciesParenthesisNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js"),_dependenciesSymbolNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js"),_dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesEqualGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js"),_dependenciesIsZeroGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesParseGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js"),_dependenciesPowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),simplifyDependencies = { bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, fractionDependencies: _dependenciesFractionGenerated.fractionDependencies, ConstantNodeDependencies: _dependenciesConstantNodeGenerated.ConstantNodeDependencies, FunctionNodeDependencies: _dependenciesFunctionNodeGenerated.FunctionNodeDependencies, OperatorNodeDependencies: _dependenciesOperatorNodeGenerated.OperatorNodeDependencies, ParenthesisNodeDependencies: _dependenciesParenthesisNodeGenerated.ParenthesisNodeDependencies, SymbolNodeDependencies: _dependenciesSymbolNodeGenerated.SymbolNodeDependencies, addDependencies: _dependenciesAddGenerated.addDependencies, divideDependencies: _dependenciesDivideGenerated.divideDependencies, equalDependencies: _dependenciesEqualGenerated.equalDependencies, isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, parseDependencies: _dependenciesParseGenerated.parseDependencies, powDependencies: _dependenciesPowGenerated.powDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSimplify: _factoriesAny.createSimplify };exports.simplifyDependencies = simplifyDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sinDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sinDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSin: _factoriesAny.createSin };exports.sinDependencies = sinDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSinh.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sinhDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sinhDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSinh: _factoriesAny.createSinh };exports.sinhDependencies = sinhDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sizeDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sizeDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSize: _factoriesAny.createSize };exports.sizeDependencies = sizeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSlu.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sluDependencies = void 0;var _dependenciesSparseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js"),_dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesLargerEqGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTransposeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sluDependencies = { SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, absDependencies: _dependenciesAbsGenerated.absDependencies, addDependencies: _dependenciesAddGenerated.addDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, largerDependencies: _dependenciesLargerGenerated.largerDependencies, largerEqDependencies: _dependenciesLargerEqGenerated.largerEqDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, transposeDependencies: _dependenciesTransposeGenerated.transposeDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSlu: _factoriesAny.createSlu };exports.sluDependencies = sluDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.smallerDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),smallerDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSmaller: _factoriesAny.createSmaller };exports.smallerDependencies = smallerDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.smallerEqDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),smallerEqDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSmallerEq: _factoriesAny.createSmallerEq };exports.smallerEqDependencies = smallerEqDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSort.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sortDependencies = void 0;var _dependenciesCompareGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js"),_dependenciesCompareNaturalGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sortDependencies = { compareDependencies: _dependenciesCompareGenerated.compareDependencies, compareNaturalDependencies: _dependenciesCompareNaturalGenerated.compareNaturalDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSort: _factoriesAny.createSort };exports.sortDependencies = sortDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.SpaDependencies = void 0;var _dependenciesFibonacciHeapClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),SpaDependencies = { FibonacciHeapDependencies: _dependenciesFibonacciHeapClassGenerated.FibonacciHeapDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, createSpaClass: _factoriesAny.createSpaClass };exports.SpaDependencies = SpaDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparse.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sparseDependencies = void 0;var _dependenciesSparseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sparseDependencies = { SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSparse: _factoriesAny.createSparse };exports.sparseDependencies = sparseDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.SparseMatrixDependencies = void 0;var _dependenciesMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),SparseMatrixDependencies = { MatrixDependencies: _dependenciesMatrixClassGenerated.MatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSparseMatrixClass: _factoriesAny.createSparseMatrixClass };exports.SparseMatrixDependencies = SparseMatrixDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.speedOfLightDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),speedOfLightDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createSpeedOfLight: _factoriesAny.createSpeedOfLight };exports.speedOfLightDependencies = speedOfLightDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSplitUnit.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.splitUnitDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),splitUnitDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSplitUnit: _factoriesAny.createSplitUnit };exports.splitUnitDependencies = splitUnitDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sqrtDependencies = void 0;var _dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sqrtDependencies = { ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSqrt: _factoriesAny.createSqrt };exports.sqrtDependencies = sqrtDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrtm.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sqrtmDependencies = void 0;var _dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesIdentityGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js"),_dependenciesInvGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js"),_dependenciesMaxGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMax.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesSizeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js"),_dependenciesSqrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sqrtmDependencies = { absDependencies: _dependenciesAbsGenerated.absDependencies, addDependencies: _dependenciesAddGenerated.addDependencies, identityDependencies: _dependenciesIdentityGenerated.identityDependencies, invDependencies: _dependenciesInvGenerated.invDependencies, maxDependencies: _dependenciesMaxGenerated.maxDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSqrtm: _factoriesAny.createSqrtm };exports.sqrtmDependencies = sqrtmDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSquare.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.squareDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),squareDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSquare: _factoriesAny.createSquare };exports.squareDependencies = squareDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqueeze.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.squeezeDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),squeezeDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSqueeze: _factoriesAny.createSqueeze };exports.squeezeDependencies = squeezeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStd.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.stdDependencies = void 0;var _dependenciesSqrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesVarianceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),stdDependencies = { sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, varianceDependencies: _dependenciesVarianceGenerated.varianceDependencies, createStd: _factoriesAny.createStd };exports.stdDependencies = stdDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStdTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.stdTransformDependencies = void 0;var _dependenciesSqrtGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesVarianceGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),stdTransformDependencies = { sqrtDependencies: _dependenciesSqrtGenerated.sqrtDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, varianceDependencies: _dependenciesVarianceGenerated.varianceDependencies, createStdTransform: _factoriesAny.createStdTransform };exports.stdTransformDependencies = stdTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.stefanBoltzmannDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),stefanBoltzmannDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createStefanBoltzmann: _factoriesAny.createStefanBoltzmann };exports.stefanBoltzmannDependencies = stefanBoltzmannDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.stirlingS2Dependencies = void 0;var _dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesCombinationsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesFactorialGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js"),_dependenciesIsIntegerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js"),_dependenciesIsNegativeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js"),_dependenciesLargerGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesPowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),stirlingS2Dependencies = { addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, combinationsDependencies: _dependenciesCombinationsGenerated.combinationsDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, factorialDependencies: _dependenciesFactorialGenerated.factorialDependencies, isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, isNegativeDependencies: _dependenciesIsNegativeGenerated.isNegativeDependencies, largerDependencies: _dependenciesLargerGenerated.largerDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, powDependencies: _dependenciesPowGenerated.powDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createStirlingS2: _factoriesAny.createStirlingS2 };exports.stirlingS2Dependencies = stirlingS2Dependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesString.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.stringDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),stringDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createString: _factoriesAny.createString };exports.stringDependencies = stringDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.subsetDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),subsetDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSubset: _factoriesAny.createSubset };exports.subsetDependencies = subsetDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubsetTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.subsetTransformDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),subsetTransformDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSubsetTransform: _factoriesAny.createSubsetTransform };exports.subsetTransformDependencies = subsetTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.subtractDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_dependenciesUnaryMinusGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),subtractDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, unaryMinusDependencies: _dependenciesUnaryMinusGenerated.unaryMinusDependencies, createSubtract: _factoriesAny.createSubtract };exports.subtractDependencies = subtractDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSum.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sumDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sumDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, numericDependencies: _dependenciesNumericGenerated.numericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSum: _factoriesAny.createSum };exports.sumDependencies = sumDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSumTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sumTransformDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),sumTransformDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, numericDependencies: _dependenciesNumericGenerated.numericDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createSumTransform: _factoriesAny.createSumTransform };exports.sumTransformDependencies = sumTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.SymbolNodeDependencies = void 0;var _dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_dependenciesNodeGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),SymbolNodeDependencies = { UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, createSymbolNode: _factoriesAny.createSymbolNode };exports.SymbolNodeDependencies = SymbolNodeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTan.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.tanDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),tanDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createTan: _factoriesAny.createTan };exports.tanDependencies = tanDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTanh.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.tanhDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),tanhDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createTanh: _factoriesAny.createTanh };exports.tanhDependencies = tanhDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTau.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.tauDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),tauDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createTau: _factoriesAny.createTau };exports.tauDependencies = tauDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.thomsonCrossSectionDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),thomsonCrossSectionDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createThomsonCrossSection: _factoriesAny.createThomsonCrossSection };exports.thomsonCrossSectionDependencies = thomsonCrossSectionDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.toDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),toDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createTo: _factoriesAny.createTo };exports.toDependencies = toDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrace.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.traceDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),traceDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createTrace: _factoriesAny.createTrace };exports.traceDependencies = traceDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.transposeDependencies = void 0;var _dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),transposeDependencies = { matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createTranspose: _factoriesAny.createTranspose };exports.transposeDependencies = transposeDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrue.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.trueDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),trueDependencies = { createTrue: _factoriesAny.createTrue };exports.trueDependencies = trueDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTypeOf.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.typeOfDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),typeOfDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createTypeOf: _factoriesAny.createTypeOf };exports.typeOfDependencies = typeOfDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.typedDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesFractionClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),typedDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, createTyped: _factoriesAny.createTyped };exports.typedDependencies = typedDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.unaryMinusDependencies = void 0;var _dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),unaryMinusDependencies = { typedDependencies: _dependenciesTypedGenerated.typedDependencies, createUnaryMinus: _factoriesAny.createUnaryMinus };exports.unaryMinusDependencies = unaryMinusDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryPlus.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.unaryPlusDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),unaryPlusDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createUnaryPlus: _factoriesAny.createUnaryPlus };exports.unaryPlusDependencies = unaryPlusDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.unequalDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),unequalDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createUnequal: _factoriesAny.createUnequal };exports.unequalDependencies = unequalDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.UnitDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesComplexClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js"),_dependenciesFractionClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js"),_dependenciesAbsGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js"),_dependenciesAddScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js"),_dependenciesFixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js"),_dependenciesFormatGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js"),_dependenciesIsNumericGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesNumberGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js"),_dependenciesPowGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js"),_dependenciesRoundGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),UnitDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies, FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, absDependencies: _dependenciesAbsGenerated.absDependencies, addScalarDependencies: _dependenciesAddScalarGenerated.addScalarDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalDependencies: _dependenciesEqualGenerated.equalDependencies, fixDependencies: _dependenciesFixGenerated.fixDependencies, formatDependencies: _dependenciesFormatGenerated.formatDependencies, isNumericDependencies: _dependenciesIsNumericGenerated.isNumericDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, numberDependencies: _dependenciesNumberGenerated.numberDependencies, powDependencies: _dependenciesPowGenerated.powDependencies, roundDependencies: _dependenciesRoundGenerated.roundDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, createUnitClass: _factoriesAny.createUnitClass };exports.UnitDependencies = UnitDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitFunction.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.unitDependencies = void 0;var _dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),unitDependencies = { UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createUnitFunction: _factoriesAny.createUnitFunction };exports.unitDependencies = unitDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercaseE.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.EDependencies = void 0;var _dependenciesEGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesE.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),EDependencies = { eDependencies: _dependenciesEGenerated.eDependencies, createUppercaseE: _factoriesAny.createUppercaseE };exports.EDependencies = EDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercasePi.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.PIDependencies = void 0;var _dependenciesPiGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPi.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),PIDependencies = { piDependencies: _dependenciesPiGenerated.piDependencies, createUppercasePi: _factoriesAny.createUppercasePi };exports.PIDependencies = PIDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.usolveDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),usolveDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createUsolve: _factoriesAny.createUsolve };exports.usolveDependencies = usolveDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.usolveAllDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesDivideScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js"),_dependenciesEqualScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesMultiplyScalarGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),usolveAllDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, divideScalarDependencies: _dependenciesDivideScalarGenerated.divideScalarDependencies, equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, multiplyScalarDependencies: _dependenciesMultiplyScalarGenerated.multiplyScalarDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createUsolveAll: _factoriesAny.createUsolveAll };exports.usolveAllDependencies = usolveAllDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.vacuumImpedanceDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),vacuumImpedanceDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createVacuumImpedance: _factoriesAny.createVacuumImpedance };exports.vacuumImpedanceDependencies = vacuumImpedanceDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.varianceDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesApplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApply.generated.js"),_dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesIsNaNGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),varianceDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, applyDependencies: _dependenciesApplyGenerated.applyDependencies, divideDependencies: _dependenciesDivideGenerated.divideDependencies, isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createVariance: _factoriesAny.createVariance };exports.varianceDependencies = varianceDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVarianceTransform.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.varianceTransformDependencies = void 0;var _dependenciesAddGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js"),_dependenciesApplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesApply.generated.js"),_dependenciesDivideGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js"),_dependenciesIsNaNGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js"),_dependenciesMultiplyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js"),_dependenciesSubtractGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),varianceTransformDependencies = { addDependencies: _dependenciesAddGenerated.addDependencies, applyDependencies: _dependenciesApplyGenerated.applyDependencies, divideDependencies: _dependenciesDivideGenerated.divideDependencies, isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createVarianceTransform: _factoriesAny.createVarianceTransform };exports.varianceTransformDependencies = varianceTransformDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVersion.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.versionDependencies = void 0;var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),versionDependencies = { createVersion: _factoriesAny.createVersion };exports.versionDependencies = versionDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.weakMixingAngleDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),weakMixingAngleDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, createWeakMixingAngle: _factoriesAny.createWeakMixingAngle };exports.weakMixingAngleDependencies = weakMixingAngleDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWienDisplacement.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.wienDisplacementDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesUnitClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),wienDisplacementDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, createWienDisplacement: _factoriesAny.createWienDisplacement };exports.wienDisplacementDependencies = wienDisplacementDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXgcd.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.xgcdDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),xgcdDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createXgcd: _factoriesAny.createXgcd };exports.xgcdDependencies = xgcdDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.xorDependencies = void 0;var _dependenciesDenseMatrixClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),xorDependencies = { DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createXor: _factoriesAny.createXor };exports.xorDependencies = xorDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.zerosDependencies = void 0;var _dependenciesBigNumberClassGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js"),_dependenciesMatrixGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js"),_dependenciesTypedGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),zerosDependencies = { BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, typedDependencies: _dependenciesTypedGenerated.typedDependencies, createZeros: _factoriesAny.createZeros };exports.zerosDependencies = zerosDependencies;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/impureFunctionsAny.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), Object.defineProperty(exports, "docs", ({ enumerable: !0, get: function () {return _embeddedDocs.embeddedDocs;} })), exports.derivative = exports.parser = exports.rationalize = exports.simplify = exports.compile = exports.help = exports.Parser = exports.Help = exports.evaluate = exports.parse = exports.FunctionNode = exports.SymbolNode = exports.AssignmentNode = exports.IndexNode = exports.AccessorNode = exports.chain = exports.FunctionAssignmentNode = exports.RangeNode = exports.OperatorNode = exports.ConditionalNode = exports.reviver = exports.Chain = exports.RelationalNode = exports.ParenthesisNode = exports.ObjectNode = exports.ConstantNode = exports.BlockNode = exports.ArrayNode = exports.Node = void 0;var _extends2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/extends.js")),_configReadonly = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/configReadonly.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),_pureFunctionsAnyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js"),_embeddedDocs = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/embeddedDocs.js"),math = {},mathWithTransform = {},classes = {},Node = (0, _factoriesAny.createNode)({ mathWithTransform: mathWithTransform });exports.Node = Node;var ArrayNode = (0, _factoriesAny.createArrayNode)({ Node: Node });exports.ArrayNode = ArrayNode;var BlockNode = (0, _factoriesAny.createBlockNode)({ Node: Node, ResultSet: _pureFunctionsAnyGenerated.ResultSet });exports.BlockNode = BlockNode;var ConstantNode = (0, _factoriesAny.createConstantNode)({ Node: Node });exports.ConstantNode = ConstantNode;var ObjectNode = (0, _factoriesAny.createObjectNode)({ Node: Node });exports.ObjectNode = ObjectNode;var ParenthesisNode = (0, _factoriesAny.createParenthesisNode)({ Node: Node });exports.ParenthesisNode = ParenthesisNode;var RelationalNode = (0, _factoriesAny.createRelationalNode)({ Node: Node });exports.RelationalNode = RelationalNode;var Chain = (0, _factoriesAny.createChainClass)({ math: math });exports.Chain = Chain;var reviver = (0, _factoriesAny.createReviver)({ classes: classes });exports.reviver = reviver;var ConditionalNode = (0, _factoriesAny.createConditionalNode)({ Node: Node });exports.ConditionalNode = ConditionalNode;var OperatorNode = (0, _factoriesAny.createOperatorNode)({ Node: Node });exports.OperatorNode = OperatorNode;var RangeNode = (0, _factoriesAny.createRangeNode)({ Node: Node });exports.RangeNode = RangeNode;var FunctionAssignmentNode = (0, _factoriesAny.createFunctionAssignmentNode)({ Node: Node, typed: _pureFunctionsAnyGenerated.typed });exports.FunctionAssignmentNode = FunctionAssignmentNode;var chain = (0, _factoriesAny.createChain)({ Chain: Chain, typed: _pureFunctionsAnyGenerated.typed });exports.chain = chain;var AccessorNode = (0, _factoriesAny.createAccessorNode)({ Node: Node, subset: _pureFunctionsAnyGenerated.subset });exports.AccessorNode = AccessorNode;var IndexNode = (0, _factoriesAny.createIndexNode)({ Node: Node, Range: _pureFunctionsAnyGenerated.Range, size: _pureFunctionsAnyGenerated.size });exports.IndexNode = IndexNode;var AssignmentNode = (0, _factoriesAny.createAssignmentNode)({ matrix: _pureFunctionsAnyGenerated.matrix, Node: Node, subset: _pureFunctionsAnyGenerated.subset });exports.AssignmentNode = AssignmentNode;var SymbolNode = (0, _factoriesAny.createSymbolNode)({ Unit: _pureFunctionsAnyGenerated.Unit, Node: Node, math: math });exports.SymbolNode = SymbolNode;var FunctionNode = (0, _factoriesAny.createFunctionNode)({ Node: Node, SymbolNode: SymbolNode, math: math });exports.FunctionNode = FunctionNode;var parse = (0, _factoriesAny.createParse)({ AccessorNode: AccessorNode, ArrayNode: ArrayNode, AssignmentNode: AssignmentNode, BlockNode: BlockNode, ConditionalNode: ConditionalNode, ConstantNode: ConstantNode, FunctionAssignmentNode: FunctionAssignmentNode, FunctionNode: FunctionNode, IndexNode: IndexNode, ObjectNode: ObjectNode, OperatorNode: OperatorNode, ParenthesisNode: ParenthesisNode, RangeNode: RangeNode, RelationalNode: RelationalNode, SymbolNode: SymbolNode, config: _configReadonly.config, numeric: _pureFunctionsAnyGenerated.numeric, typed: _pureFunctionsAnyGenerated.typed });exports.parse = parse;var evaluate = (0, _factoriesAny.createEvaluate)({ parse: parse, typed: _pureFunctionsAnyGenerated.typed });exports.evaluate = evaluate;var Help = (0, _factoriesAny.createHelpClass)({ parse: parse });exports.Help = Help;var Parser = (0, _factoriesAny.createParserClass)({ parse: parse });exports.Parser = Parser;var help = (0, _factoriesAny.createHelp)({ Help: Help, mathWithTransform: mathWithTransform, typed: _pureFunctionsAnyGenerated.typed });exports.help = help;var compile = (0, _factoriesAny.createCompile)({ parse: parse, typed: _pureFunctionsAnyGenerated.typed });exports.compile = compile;var simplify = (0, _factoriesAny.createSimplify)({ bignumber: _pureFunctionsAnyGenerated.bignumber, fraction: _pureFunctionsAnyGenerated.fraction, ConstantNode: ConstantNode, FunctionNode: FunctionNode, OperatorNode: OperatorNode, ParenthesisNode: ParenthesisNode, SymbolNode: SymbolNode, add: _pureFunctionsAnyGenerated.add, config: _configReadonly.config, divide: _pureFunctionsAnyGenerated.divide, equal: _pureFunctionsAnyGenerated.equal, isZero: _pureFunctionsAnyGenerated.isZero, mathWithTransform: mathWithTransform, multiply: _pureFunctionsAnyGenerated.multiply, parse: parse, pow: _pureFunctionsAnyGenerated.pow, subtract: _pureFunctionsAnyGenerated.subtract, typed: _pureFunctionsAnyGenerated.typed });exports.simplify = simplify;var rationalize = (0, _factoriesAny.createRationalize)({ bignumber: _pureFunctionsAnyGenerated.bignumber, fraction: _pureFunctionsAnyGenerated.fraction, ConstantNode: ConstantNode, FunctionNode: FunctionNode, OperatorNode: OperatorNode, ParenthesisNode: ParenthesisNode, SymbolNode: SymbolNode, add: _pureFunctionsAnyGenerated.add, config: _configReadonly.config, divide: _pureFunctionsAnyGenerated.divide, equal: _pureFunctionsAnyGenerated.equal, isZero: _pureFunctionsAnyGenerated.isZero, mathWithTransform: mathWithTransform, multiply: _pureFunctionsAnyGenerated.multiply, parse: parse, pow: _pureFunctionsAnyGenerated.pow, simplify: simplify, subtract: _pureFunctionsAnyGenerated.subtract, typed: _pureFunctionsAnyGenerated.typed });exports.rationalize = rationalize;var parser = (0, _factoriesAny.createParser)({ Parser: Parser, typed: _pureFunctionsAnyGenerated.typed });exports.parser = parser;var derivative = (0, _factoriesAny.createDerivative)({ ConstantNode: ConstantNode, FunctionNode: FunctionNode, OperatorNode: OperatorNode, ParenthesisNode: ParenthesisNode, SymbolNode: SymbolNode, config: _configReadonly.config, equal: _pureFunctionsAnyGenerated.equal, isZero: _pureFunctionsAnyGenerated.isZero, numeric: _pureFunctionsAnyGenerated.numeric, parse: parse, simplify: simplify, typed: _pureFunctionsAnyGenerated.typed });exports.derivative = derivative, (0, _extends2["default"])(math, { reviver: reviver, false: _pureFunctionsAnyGenerated._false, null: _pureFunctionsAnyGenerated._null, true: _pureFunctionsAnyGenerated._true, replacer: _pureFunctionsAnyGenerated.replacer, i: _pureFunctionsAnyGenerated.i, LN10: _pureFunctionsAnyGenerated.LN10, LOG10E: _pureFunctionsAnyGenerated.LOG10E, NaN: _pureFunctionsAnyGenerated._NaN, pi: _pureFunctionsAnyGenerated.pi, SQRT1_2: _pureFunctionsAnyGenerated.SQRT1_2, tau: _pureFunctionsAnyGenerated.tau, efimovFactor: _pureFunctionsAnyGenerated.efimovFactor, fineStructure: _pureFunctionsAnyGenerated.fineStructure, sackurTetrode: _pureFunctionsAnyGenerated.sackurTetrode, weakMixingAngle: _pureFunctionsAnyGenerated.weakMixingAngle, e: _pureFunctionsAnyGenerated.e, Infinity: _pureFunctionsAnyGenerated._Infinity, LOG2E: _pureFunctionsAnyGenerated.LOG2E, PI: _pureFunctionsAnyGenerated.pi, version: _pureFunctionsAnyGenerated.version, E: _pureFunctionsAnyGenerated.e, phi: _pureFunctionsAnyGenerated.phi, typed: _pureFunctionsAnyGenerated.typed, isInteger: _pureFunctionsAnyGenerated.isInteger, isNumeric: _pureFunctionsAnyGenerated.isNumeric, isPositive: _pureFunctionsAnyGenerated.isPositive, isNaN: _pureFunctionsAnyGenerated.isNaN, equalScalar: _pureFunctionsAnyGenerated.equalScalar, number: _pureFunctionsAnyGenerated.number, boolean: _pureFunctionsAnyGenerated.boolean, complex: _pureFunctionsAnyGenerated.complex, splitUnit: _pureFunctionsAnyGenerated.splitUnit, unaryPlus: _pureFunctionsAnyGenerated.unaryPlus, apply: _pureFunctionsAnyGenerated.apply, cube: _pureFunctionsAnyGenerated.cube, expm1: _pureFunctionsAnyGenerated.expm1, log10: _pureFunctionsAnyGenerated.log10, multiplyScalar: _pureFunctionsAnyGenerated.multiplyScalar, sign: _pureFunctionsAnyGenerated.sign, square: _pureFunctionsAnyGenerated.square, bitNot: _pureFunctionsAnyGenerated.bitNot, arg: _pureFunctionsAnyGenerated.arg, im: _pureFunctionsAnyGenerated.im, not: _pureFunctionsAnyGenerated.not, filter: _pureFunctionsAnyGenerated.filter, forEach: _pureFunctionsAnyGenerated.forEach, map: _pureFunctionsAnyGenerated.map, erf: _pureFunctionsAnyGenerated.erf, format: _pureFunctionsAnyGenerated.format, oct: _pureFunctionsAnyGenerated.oct, print: _pureFunctionsAnyGenerated.print, isPrime: _pureFunctionsAnyGenerated.isPrime, acos: _pureFunctionsAnyGenerated.acos, acot: _pureFunctionsAnyGenerated.acot, acsc: _pureFunctionsAnyGenerated.acsc, asec: _pureFunctionsAnyGenerated.asec, asin: _pureFunctionsAnyGenerated.asin, atan: _pureFunctionsAnyGenerated.atan, atanh: _pureFunctionsAnyGenerated.atanh, cosh: _pureFunctionsAnyGenerated.cosh, coth: _pureFunctionsAnyGenerated.coth, csch: _pureFunctionsAnyGenerated.csch, sech: _pureFunctionsAnyGenerated.sech, sinh: _pureFunctionsAnyGenerated.sinh, tanh: _pureFunctionsAnyGenerated.tanh, chain: chain, combinations: _pureFunctionsAnyGenerated.combinations, pickRandom: _pureFunctionsAnyGenerated.pickRandom, randomInt: _pureFunctionsAnyGenerated.randomInt, LN2: _pureFunctionsAnyGenerated.LN2, clone: _pureFunctionsAnyGenerated.clone, hasNumericValue: _pureFunctionsAnyGenerated.hasNumericValue, typeOf: _pureFunctionsAnyGenerated.typeOf, string: _pureFunctionsAnyGenerated.string, fraction: _pureFunctionsAnyGenerated.fraction, unaryMinus: _pureFunctionsAnyGenerated.unaryMinus, addScalar: _pureFunctionsAnyGenerated.addScalar, exp: _pureFunctionsAnyGenerated.exp, log2: _pureFunctionsAnyGenerated.log2, sqrt: _pureFunctionsAnyGenerated.sqrt, conj: _pureFunctionsAnyGenerated.conj, getMatrixDataType: _pureFunctionsAnyGenerated.getMatrixDataType, mode: _pureFunctionsAnyGenerated.mode, bin: _pureFunctionsAnyGenerated.bin, acosh: _pureFunctionsAnyGenerated.acosh, acsch: _pureFunctionsAnyGenerated.acsch, asinh: _pureFunctionsAnyGenerated.asinh, cos: _pureFunctionsAnyGenerated.cos, csc: _pureFunctionsAnyGenerated.csc, sin: _pureFunctionsAnyGenerated.sin, combinationsWithRep: _pureFunctionsAnyGenerated.combinationsWithRep, random: _pureFunctionsAnyGenerated.random, SQRT2: _pureFunctionsAnyGenerated.SQRT2, isNegative: _pureFunctionsAnyGenerated.isNegative, matrix: _pureFunctionsAnyGenerated.matrix, abs: _pureFunctionsAnyGenerated.abs, gcd: _pureFunctionsAnyGenerated.gcd, mod: _pureFunctionsAnyGenerated.mod, nthRoot: _pureFunctionsAnyGenerated.nthRoot, xgcd: _pureFunctionsAnyGenerated.xgcd, bitAnd: _pureFunctionsAnyGenerated.bitAnd, bitXor: _pureFunctionsAnyGenerated.bitXor, or: _pureFunctionsAnyGenerated.or, concat: _pureFunctionsAnyGenerated.concat, diag: _pureFunctionsAnyGenerated.diag, identity: _pureFunctionsAnyGenerated.identity, ones: _pureFunctionsAnyGenerated.ones, reshape: _pureFunctionsAnyGenerated.reshape, size: _pureFunctionsAnyGenerated.size, subset: _pureFunctionsAnyGenerated.subset, zeros: _pureFunctionsAnyGenerated.zeros, hex: _pureFunctionsAnyGenerated.hex, round: _pureFunctionsAnyGenerated.round, leftShift: _pureFunctionsAnyGenerated.leftShift, rightLogShift: _pureFunctionsAnyGenerated.rightLogShift, compare: _pureFunctionsAnyGenerated.compare, compareText: _pureFunctionsAnyGenerated.compareText, smaller: _pureFunctionsAnyGenerated.smaller, larger: _pureFunctionsAnyGenerated.larger, unequal: _pureFunctionsAnyGenerated.unequal, sparse: _pureFunctionsAnyGenerated.sparse, acoth: _pureFunctionsAnyGenerated.acoth, atan2: _pureFunctionsAnyGenerated.atan2, sec: _pureFunctionsAnyGenerated.sec, add: _pureFunctionsAnyGenerated.add, dot: _pureFunctionsAnyGenerated.dot, composition: _pureFunctionsAnyGenerated.composition, isZero: _pureFunctionsAnyGenerated.isZero, matrixFromFunction: _pureFunctionsAnyGenerated.matrixFromFunction, cbrt: _pureFunctionsAnyGenerated.cbrt, floor: _pureFunctionsAnyGenerated.floor, multiply: _pureFunctionsAnyGenerated.multiply, dotMultiply: _pureFunctionsAnyGenerated.dotMultiply, re: _pureFunctionsAnyGenerated.re, flatten: _pureFunctionsAnyGenerated.flatten, resize: _pureFunctionsAnyGenerated.resize, squeeze: _pureFunctionsAnyGenerated.squeeze, to: _pureFunctionsAnyGenerated.to, pow: _pureFunctionsAnyGenerated.pow, dotPow: _pureFunctionsAnyGenerated.dotPow, rightArithShift: _pureFunctionsAnyGenerated.rightArithShift, compareNatural: _pureFunctionsAnyGenerated.compareNatural, equalText: _pureFunctionsAnyGenerated.equalText, largerEq: _pureFunctionsAnyGenerated.largerEq, partitionSelect: _pureFunctionsAnyGenerated.partitionSelect, asech: _pureFunctionsAnyGenerated.asech, tan: _pureFunctionsAnyGenerated.tan, setDifference: _pureFunctionsAnyGenerated.setDifference, setIntersect: _pureFunctionsAnyGenerated.setIntersect, setMultiplicity: _pureFunctionsAnyGenerated.setMultiplicity, setSize: _pureFunctionsAnyGenerated.setSize, trace: _pureFunctionsAnyGenerated.trace, quantileSeq: _pureFunctionsAnyGenerated.quantileSeq, gamma: _pureFunctionsAnyGenerated.gamma, bignumber: _pureFunctionsAnyGenerated.bignumber, matrixFromColumns: _pureFunctionsAnyGenerated.matrixFromColumns, lcm: _pureFunctionsAnyGenerated.lcm, bitOr: _pureFunctionsAnyGenerated.bitOr, kron: _pureFunctionsAnyGenerated.kron, transpose: _pureFunctionsAnyGenerated.transpose, numeric: _pureFunctionsAnyGenerated.numeric, and: _pureFunctionsAnyGenerated.and, smallerEq: _pureFunctionsAnyGenerated.smallerEq, sort: _pureFunctionsAnyGenerated.sort, min: _pureFunctionsAnyGenerated.min, cot: _pureFunctionsAnyGenerated.cot, setDistinct: _pureFunctionsAnyGenerated.setDistinct, setPowerset: _pureFunctionsAnyGenerated.setPowerset, index: _pureFunctionsAnyGenerated.index, sum: _pureFunctionsAnyGenerated.sum, factorial: _pureFunctionsAnyGenerated.factorial, permutations: _pureFunctionsAnyGenerated.permutations, matrixFromRows: _pureFunctionsAnyGenerated.matrixFromRows, subtract: _pureFunctionsAnyGenerated.subtract, cross: _pureFunctionsAnyGenerated.cross, range: _pureFunctionsAnyGenerated.range, row: _pureFunctionsAnyGenerated.row, prod: _pureFunctionsAnyGenerated.prod, equal: _pureFunctionsAnyGenerated.equal, max: _pureFunctionsAnyGenerated.max, setCartesian: _pureFunctionsAnyGenerated.setCartesian, setSymDifference: _pureFunctionsAnyGenerated.setSymDifference, ceil: _pureFunctionsAnyGenerated.ceil, xor: _pureFunctionsAnyGenerated.xor, count: _pureFunctionsAnyGenerated.count, ctranspose: _pureFunctionsAnyGenerated.ctranspose, deepEqual: _pureFunctionsAnyGenerated.deepEqual, setIsSubset: _pureFunctionsAnyGenerated.setIsSubset, fix: _pureFunctionsAnyGenerated.fix, diff: _pureFunctionsAnyGenerated.diff, divideScalar: _pureFunctionsAnyGenerated.divideScalar, nthRoots: _pureFunctionsAnyGenerated.nthRoots, lsolve: _pureFunctionsAnyGenerated.lsolve, lsolveAll: _pureFunctionsAnyGenerated.lsolveAll, setUnion: _pureFunctionsAnyGenerated.setUnion, lup: _pureFunctionsAnyGenerated.lup, slu: _pureFunctionsAnyGenerated.slu, det: _pureFunctionsAnyGenerated.det, distance: _pureFunctionsAnyGenerated.distance, stirlingS2: _pureFunctionsAnyGenerated.stirlingS2, catalan: _pureFunctionsAnyGenerated.catalan, column: _pureFunctionsAnyGenerated.column, log: _pureFunctionsAnyGenerated.log, dotDivide: _pureFunctionsAnyGenerated.dotDivide, usolveAll: _pureFunctionsAnyGenerated.usolveAll, hypot: _pureFunctionsAnyGenerated.hypot, qr: _pureFunctionsAnyGenerated.qr, inv: _pureFunctionsAnyGenerated.inv, expm: _pureFunctionsAnyGenerated.expm, divide: _pureFunctionsAnyGenerated.divide, mean: _pureFunctionsAnyGenerated.mean, variance: _pureFunctionsAnyGenerated.variance, kldivergence: _pureFunctionsAnyGenerated.kldivergence, bellNumbers: _pureFunctionsAnyGenerated.bellNumbers, log1p: _pureFunctionsAnyGenerated.log1p, createUnit: _pureFunctionsAnyGenerated.createUnit, eigs: _pureFunctionsAnyGenerated.eigs, intersect: _pureFunctionsAnyGenerated.intersect, std: _pureFunctionsAnyGenerated.std, atomicMass: _pureFunctionsAnyGenerated.atomicMass, bohrMagneton: _pureFunctionsAnyGenerated.bohrMagneton, boltzmann: _pureFunctionsAnyGenerated.boltzmann, conductanceQuantum: _pureFunctionsAnyGenerated.conductanceQuantum, deuteronMass: _pureFunctionsAnyGenerated.deuteronMass, electronMass: _pureFunctionsAnyGenerated.electronMass, faraday: _pureFunctionsAnyGenerated.faraday, firstRadiation: _pureFunctionsAnyGenerated.firstRadiation, gravitationConstant: _pureFunctionsAnyGenerated.gravitationConstant, hartreeEnergy: _pureFunctionsAnyGenerated.hartreeEnergy, klitzing: _pureFunctionsAnyGenerated.klitzing, magneticConstant: _pureFunctionsAnyGenerated.magneticConstant, molarMass: _pureFunctionsAnyGenerated.molarMass, molarPlanckConstant: _pureFunctionsAnyGenerated.molarPlanckConstant, neutronMass: _pureFunctionsAnyGenerated.neutronMass, planckCharge: _pureFunctionsAnyGenerated.planckCharge, planckLength: _pureFunctionsAnyGenerated.planckLength, planckTemperature: _pureFunctionsAnyGenerated.planckTemperature, protonMass: _pureFunctionsAnyGenerated.protonMass, reducedPlanckConstant: _pureFunctionsAnyGenerated.reducedPlanckConstant, secondRadiation: _pureFunctionsAnyGenerated.secondRadiation, stefanBoltzmann: _pureFunctionsAnyGenerated.stefanBoltzmann, vacuumImpedance: _pureFunctionsAnyGenerated.vacuumImpedance, usolve: _pureFunctionsAnyGenerated.usolve, norm: _pureFunctionsAnyGenerated.norm, lusolve: _pureFunctionsAnyGenerated.lusolve, sqrtm: _pureFunctionsAnyGenerated.sqrtm, multinomial: _pureFunctionsAnyGenerated.multinomial, avogadro: _pureFunctionsAnyGenerated.avogadro, classicalElectronRadius: _pureFunctionsAnyGenerated.classicalElectronRadius, electricConstant: _pureFunctionsAnyGenerated.electricConstant, fermiCoupling: _pureFunctionsAnyGenerated.fermiCoupling, gravity: _pureFunctionsAnyGenerated.gravity, loschmidt: _pureFunctionsAnyGenerated.loschmidt, molarMassC12: _pureFunctionsAnyGenerated.molarMassC12, nuclearMagneton: _pureFunctionsAnyGenerated.nuclearMagneton, planckMass: _pureFunctionsAnyGenerated.planckMass, quantumOfCirculation: _pureFunctionsAnyGenerated.quantumOfCirculation, speedOfLight: _pureFunctionsAnyGenerated.speedOfLight, wienDisplacement: _pureFunctionsAnyGenerated.wienDisplacement, rotationMatrix: _pureFunctionsAnyGenerated.rotationMatrix, median: _pureFunctionsAnyGenerated.median, bohrRadius: _pureFunctionsAnyGenerated.bohrRadius, elementaryCharge: _pureFunctionsAnyGenerated.elementaryCharge, inverseConductanceQuantum: _pureFunctionsAnyGenerated.inverseConductanceQuantum, molarVolume: _pureFunctionsAnyGenerated.molarVolume, planckTime: _pureFunctionsAnyGenerated.planckTime, thomsonCrossSection: _pureFunctionsAnyGenerated.thomsonCrossSection, rotate: _pureFunctionsAnyGenerated.rotate, parse: parse, evaluate: evaluate, mad: _pureFunctionsAnyGenerated.mad, coulomb: _pureFunctionsAnyGenerated.coulomb, magneticFluxQuantum: _pureFunctionsAnyGenerated.magneticFluxQuantum, rydberg: _pureFunctionsAnyGenerated.rydberg, unit: _pureFunctionsAnyGenerated.unit, help: help, gasConstant: _pureFunctionsAnyGenerated.gasConstant, compile: compile, simplify: simplify, rationalize: rationalize, parser: parser, planckConstant: _pureFunctionsAnyGenerated.planckConstant, derivative: derivative, config: _configReadonly.config }), (0, _extends2["default"])(mathWithTransform, math, { apply: (0, _factoriesAny.createApplyTransform)({ isInteger: _pureFunctionsAnyGenerated.isInteger, typed: _pureFunctionsAnyGenerated.typed }), filter: (0, _factoriesAny.createFilterTransform)({ typed: _pureFunctionsAnyGenerated.typed }), map: (0, _factoriesAny.createMapTransform)({ typed: _pureFunctionsAnyGenerated.typed }), forEach: (0, _factoriesAny.createForEachTransform)({ typed: _pureFunctionsAnyGenerated.typed }), subset: (0, _factoriesAny.createSubsetTransform)({ matrix: _pureFunctionsAnyGenerated.matrix, typed: _pureFunctionsAnyGenerated.typed }), index: (0, _factoriesAny.createIndexTransform)({ Index: _pureFunctionsAnyGenerated.Index }), concat: (0, _factoriesAny.createConcatTransform)({ isInteger: _pureFunctionsAnyGenerated.isInteger, matrix: _pureFunctionsAnyGenerated.matrix, typed: _pureFunctionsAnyGenerated.typed }), max: (0, _factoriesAny.createMaxTransform)({ config: _configReadonly.config, larger: _pureFunctionsAnyGenerated.larger, numeric: _pureFunctionsAnyGenerated.numeric, typed: _pureFunctionsAnyGenerated.typed }), min: (0, _factoriesAny.createMinTransform)({ config: _configReadonly.config, numeric: _pureFunctionsAnyGenerated.numeric, smaller: _pureFunctionsAnyGenerated.smaller, typed: _pureFunctionsAnyGenerated.typed }), sum: (0, _factoriesAny.createSumTransform)({ add: _pureFunctionsAnyGenerated.add, config: _configReadonly.config, numeric: _pureFunctionsAnyGenerated.numeric, typed: _pureFunctionsAnyGenerated.typed }), column: (0, _factoriesAny.createColumnTransform)({ Index: _pureFunctionsAnyGenerated.Index, matrix: _pureFunctionsAnyGenerated.matrix, range: _pureFunctionsAnyGenerated.range, typed: _pureFunctionsAnyGenerated.typed }), range: (0, _factoriesAny.createRangeTransform)({ bignumber: _pureFunctionsAnyGenerated.bignumber, matrix: _pureFunctionsAnyGenerated.matrix, config: _configReadonly.config, larger: _pureFunctionsAnyGenerated.larger, largerEq: _pureFunctionsAnyGenerated.largerEq, smaller: _pureFunctionsAnyGenerated.smaller, smallerEq: _pureFunctionsAnyGenerated.smallerEq, typed: _pureFunctionsAnyGenerated.typed }), diff: (0, _factoriesAny.createDiffTransform)({ bignumber: _pureFunctionsAnyGenerated.bignumber, matrix: _pureFunctionsAnyGenerated.matrix, number: _pureFunctionsAnyGenerated.number, subtract: _pureFunctionsAnyGenerated.subtract, typed: _pureFunctionsAnyGenerated.typed }), row: (0, _factoriesAny.createRowTransform)({ Index: _pureFunctionsAnyGenerated.Index, matrix: _pureFunctionsAnyGenerated.matrix, range: _pureFunctionsAnyGenerated.range, typed: _pureFunctionsAnyGenerated.typed }), mean: (0, _factoriesAny.createMeanTransform)({ add: _pureFunctionsAnyGenerated.add, divide: _pureFunctionsAnyGenerated.divide, typed: _pureFunctionsAnyGenerated.typed }), variance: (0, _factoriesAny.createVarianceTransform)({ add: _pureFunctionsAnyGenerated.add, apply: _pureFunctionsAnyGenerated.apply, divide: _pureFunctionsAnyGenerated.divide, isNaN: _pureFunctionsAnyGenerated.isNaN, multiply: _pureFunctionsAnyGenerated.multiply, subtract: _pureFunctionsAnyGenerated.subtract, typed: _pureFunctionsAnyGenerated.typed }), std: (0, _factoriesAny.createStdTransform)({ sqrt: _pureFunctionsAnyGenerated.sqrt, typed: _pureFunctionsAnyGenerated.typed, variance: _pureFunctionsAnyGenerated.variance }) }), (0, _extends2["default"])(classes, { ResultSet: _pureFunctionsAnyGenerated.ResultSet, Complex: _pureFunctionsAnyGenerated.Complex, Range: _pureFunctionsAnyGenerated.Range, Node: Node, ArrayNode: ArrayNode, BlockNode: BlockNode, ConstantNode: ConstantNode, ObjectNode: ObjectNode, ParenthesisNode: ParenthesisNode, RelationalNode: RelationalNode, Chain: Chain, BigNumber: _pureFunctionsAnyGenerated.BigNumber, Matrix: _pureFunctionsAnyGenerated.Matrix, ConditionalNode: ConditionalNode, OperatorNode: OperatorNode, Fraction: _pureFunctionsAnyGenerated.Fraction, RangeNode: RangeNode, DenseMatrix: _pureFunctionsAnyGenerated.DenseMatrix, FunctionAssignmentNode: FunctionAssignmentNode, SparseMatrix: _pureFunctionsAnyGenerated.SparseMatrix, ImmutableDenseMatrix: _pureFunctionsAnyGenerated.ImmutableDenseMatrix, FibonacciHeap: _pureFunctionsAnyGenerated.FibonacciHeap, AccessorNode: AccessorNode, IndexNode: IndexNode, Index: _pureFunctionsAnyGenerated.Index, AssignmentNode: AssignmentNode, Spa: _pureFunctionsAnyGenerated.Spa, Unit: _pureFunctionsAnyGenerated.Unit, SymbolNode: SymbolNode, FunctionNode: FunctionNode, Help: Help, Parser: Parser }), Chain.createProxy(math);

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/mainAny.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 }));var _exportNames = { config: !0, IndexError: !0, DimensionError: !0, ArgumentsError: !0, create: !0, factory: !0 };Object.defineProperty(exports, "config", ({ enumerable: !0, get: function () {return _configReadonly.config;} })), Object.defineProperty(exports, "IndexError", ({ enumerable: !0, get: function () {return _IndexError.IndexError;} })), Object.defineProperty(exports, "DimensionError", ({ enumerable: !0, get: function () {return _DimensionError.DimensionError;} })), Object.defineProperty(exports, "ArgumentsError", ({ enumerable: !0, get: function () {return _ArgumentsError.ArgumentsError;} })), Object.defineProperty(exports, "create", ({ enumerable: !0, get: function () {return _create.create;} })), Object.defineProperty(exports, "factory", ({ enumerable: !0, get: function () {return _factory.factory;} }));var _configReadonly = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/configReadonly.js"),_pureFunctionsAnyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js");Object.keys(_pureFunctionsAnyGenerated).forEach(function (key) {"default" === key || "__esModule" === key || Object.prototype.hasOwnProperty.call(_exportNames, key) || key in exports && exports[key] === _pureFunctionsAnyGenerated[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _pureFunctionsAnyGenerated[key];} });});var _impureFunctionsAnyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/impureFunctionsAny.generated.js");Object.keys(_impureFunctionsAnyGenerated).forEach(function (key) {"default" === key || "__esModule" === key || Object.prototype.hasOwnProperty.call(_exportNames, key) || key in exports && exports[key] === _impureFunctionsAnyGenerated[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _impureFunctionsAnyGenerated[key];} });});var _typeChecks = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/typeChecks.js");Object.keys(_typeChecks).forEach(function (key) {"default" === key || "__esModule" === key || Object.prototype.hasOwnProperty.call(_exportNames, key) || key in exports && exports[key] === _typeChecks[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _typeChecks[key];} });});var _IndexError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/IndexError.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),_ArgumentsError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/ArgumentsError.js"),_dependenciesAnyGenerated = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/dependenciesAny.generated.js");Object.keys(_dependenciesAnyGenerated).forEach(function (key) {"default" === key || "__esModule" === key || Object.prototype.hasOwnProperty.call(_exportNames, key) || key in exports && exports[key] === _dependenciesAnyGenerated[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _dependenciesAnyGenerated[key];} });});var _factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js");Object.keys(_factoriesAny).forEach(function (key) {"default" === key || "__esModule" === key || Object.prototype.hasOwnProperty.call(_exportNames, key) || key in exports && exports[key] === _factoriesAny[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _factoriesAny[key];} });});var _create = __webpack_require__("./node_modules/mathjs/lib/cjs/core/create.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js");

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.matrix = exports.SparseMatrix = exports.isNegative = exports.SQRT2 = exports.random = exports.combinationsWithRep = exports.sin = exports.csc = exports.cos = exports.asinh = exports.acsch = exports.acosh = exports.bin = exports.mode = exports.getMatrixDataType = exports.conj = exports.sqrt = exports.log2 = exports.exp = exports.addScalar = exports.unaryMinus = exports.fraction = exports.string = exports.typeOf = exports.hasNumericValue = exports.clone = exports.LN2 = exports.randomInt = exports.pickRandom = exports.combinations = exports.tanh = exports.sinh = exports.sech = exports.csch = exports.coth = exports.cosh = exports.atanh = exports.atan = exports.asin = exports.asec = exports.acsc = exports.acot = exports.acos = exports.isPrime = exports.print = exports.oct = exports.format = exports.erf = exports.map = exports.forEach = exports.filter = exports.not = exports.im = exports.arg = exports.bitNot = exports.square = exports.sign = exports.multiplyScalar = exports.log10 = exports.expm1 = exports.cube = exports.apply = exports.unaryPlus = exports.splitUnit = exports.complex = exports.boolean = exports.number = exports.equalScalar = exports.isNaN = exports.isPositive = exports.isNumeric = exports.isInteger = exports.typed = exports.phi = exports.DenseMatrix = exports.version = exports.LOG2E = exports._Infinity = exports.e = exports.Fraction = exports.weakMixingAngle = exports.sackurTetrode = exports.fineStructure = exports.efimovFactor = exports.tau = exports.SQRT1_2 = exports.pi = exports._NaN = exports.LOG10E = exports.LN10 = exports.i = exports.replacer = exports.Matrix = exports.BigNumber = exports._true = exports._null = exports._false = exports.Range = exports.Complex = exports.ResultSet = void 0, exports.nthRoots = exports.divideScalar = exports.diff = exports.fix = exports.setIsSubset = exports.deepEqual = exports.ctranspose = exports.count = exports.xor = exports.ceil = exports.setSymDifference = exports.setCartesian = exports.max = exports.equal = exports.prod = exports.row = exports.range = exports.cross = exports.subtract = exports.matrixFromRows = exports.permutations = exports.factorial = exports.sum = exports.index = exports.setPowerset = exports.setDistinct = exports.cot = exports.min = exports.sort = exports.smallerEq = exports.and = exports.numeric = exports.transpose = exports.kron = exports.bitOr = exports.lcm = exports.matrixFromColumns = exports.bignumber = exports.gamma = exports.quantileSeq = exports.trace = exports.setSize = exports.setMultiplicity = exports.setIntersect = exports.setDifference = exports.tan = exports.asech = exports.Index = exports.partitionSelect = exports.largerEq = exports.equalText = exports.compareNatural = exports.rightArithShift = exports.dotPow = exports.pow = exports.to = exports.squeeze = exports.resize = exports.flatten = exports.re = exports.dotMultiply = exports.multiply = exports.floor = exports.cbrt = exports.matrixFromFunction = exports.isZero = exports.composition = exports.dot = exports.add = exports.sec = exports.atan2 = exports.acoth = exports.sparse = exports.FibonacciHeap = exports.ImmutableDenseMatrix = exports.unequal = exports.larger = exports.smaller = exports.compareText = exports.compare = exports.rightLogShift = exports.leftShift = exports.round = exports.hex = exports.zeros = exports.subset = exports.size = exports.reshape = exports.ones = exports.identity = exports.diag = exports.concat = exports.or = exports.bitXor = exports.bitAnd = exports.xgcd = exports.nthRoot = exports.mod = exports.gcd = exports.abs = void 0, exports.planckConstant = exports.gasConstant = exports.unit = exports.rydberg = exports.magneticFluxQuantum = exports.coulomb = exports.mad = exports.rotate = exports.thomsonCrossSection = exports.planckTime = exports.molarVolume = exports.inverseConductanceQuantum = exports.elementaryCharge = exports.bohrRadius = exports.median = exports.rotationMatrix = exports.wienDisplacement = exports.speedOfLight = exports.quantumOfCirculation = exports.planckMass = exports.nuclearMagneton = exports.molarMassC12 = exports.loschmidt = exports.gravity = exports.fermiCoupling = exports.electricConstant = exports.classicalElectronRadius = exports.avogadro = exports.multinomial = exports.sqrtm = exports.lusolve = exports.norm = exports.usolve = exports.vacuumImpedance = exports.stefanBoltzmann = exports.secondRadiation = exports.reducedPlanckConstant = exports.protonMass = exports.planckTemperature = exports.planckLength = exports.planckCharge = exports.neutronMass = exports.molarPlanckConstant = exports.molarMass = exports.magneticConstant = exports.klitzing = exports.hartreeEnergy = exports.gravitationConstant = exports.firstRadiation = exports.faraday = exports.electronMass = exports.deuteronMass = exports.conductanceQuantum = exports.boltzmann = exports.bohrMagneton = exports.atomicMass = exports.std = exports.intersect = exports.eigs = exports.createUnit = exports.Unit = exports.log1p = exports.bellNumbers = exports.kldivergence = exports.variance = exports.mean = exports.divide = exports.expm = exports.inv = exports.qr = exports.hypot = exports.usolveAll = exports.dotDivide = exports.log = exports.column = exports.catalan = exports.stirlingS2 = exports.distance = exports.det = exports.slu = exports.lup = exports.setUnion = exports.Spa = exports.lsolveAll = exports.lsolve = void 0;var _configReadonly = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/configReadonly.js"),_factoriesAny = __webpack_require__("./node_modules/mathjs/lib/cjs/factoriesAny.js"),ResultSet = (0, _factoriesAny.createResultSet)({});exports.ResultSet = ResultSet;var Complex = (0, _factoriesAny.createComplexClass)({});exports.Complex = Complex;var Range = (0, _factoriesAny.createRangeClass)({});exports.Range = Range;var _false = (0, _factoriesAny.createFalse)({});exports._false = _false;var _null = (0, _factoriesAny.createNull)({});exports._null = _null;var _true = (0, _factoriesAny.createTrue)({});exports._true = _true;var BigNumber = (0, _factoriesAny.createBigNumberClass)({ config: _configReadonly.config });exports.BigNumber = BigNumber;var Matrix = (0, _factoriesAny.createMatrixClass)({});exports.Matrix = Matrix;var replacer = (0, _factoriesAny.createReplacer)({});exports.replacer = replacer;var i = (0, _factoriesAny.createI)({ Complex: Complex });exports.i = i;var LN10 = (0, _factoriesAny.createLN10)({ BigNumber: BigNumber, config: _configReadonly.config });exports.LN10 = LN10;var LOG10E = (0, _factoriesAny.createLOG10E)({ BigNumber: BigNumber, config: _configReadonly.config });exports.LOG10E = LOG10E;var _NaN = (0, _factoriesAny.createNaN)({ BigNumber: BigNumber, config: _configReadonly.config });exports._NaN = _NaN;var pi = (0, _factoriesAny.createPi)({ BigNumber: BigNumber, config: _configReadonly.config });exports.pi = pi;var SQRT1_2 = (0, _factoriesAny.createSQRT1_2)({ BigNumber: BigNumber, config: _configReadonly.config });exports.SQRT1_2 = SQRT1_2;var tau = (0, _factoriesAny.createTau)({ BigNumber: BigNumber, config: _configReadonly.config });exports.tau = tau;var efimovFactor = (0, _factoriesAny.createEfimovFactor)({ BigNumber: BigNumber, config: _configReadonly.config });exports.efimovFactor = efimovFactor;var fineStructure = (0, _factoriesAny.createFineStructure)({ BigNumber: BigNumber, config: _configReadonly.config });exports.fineStructure = fineStructure;var sackurTetrode = (0, _factoriesAny.createSackurTetrode)({ BigNumber: BigNumber, config: _configReadonly.config });exports.sackurTetrode = sackurTetrode;var weakMixingAngle = (0, _factoriesAny.createWeakMixingAngle)({ BigNumber: BigNumber, config: _configReadonly.config });exports.weakMixingAngle = weakMixingAngle;var Fraction = (0, _factoriesAny.createFractionClass)({});exports.Fraction = Fraction;var e = (0, _factoriesAny.createE)({ BigNumber: BigNumber, config: _configReadonly.config });exports.e = e;var _Infinity = (0, _factoriesAny.createInfinity)({ BigNumber: BigNumber, config: _configReadonly.config });exports._Infinity = _Infinity;var LOG2E = (0, _factoriesAny.createLOG2E)({ BigNumber: BigNumber, config: _configReadonly.config });exports.LOG2E = LOG2E;var version = (0, _factoriesAny.createVersion)({});exports.version = version;var DenseMatrix = (0, _factoriesAny.createDenseMatrixClass)({ Matrix: Matrix });exports.DenseMatrix = DenseMatrix;var phi = (0, _factoriesAny.createPhi)({ BigNumber: BigNumber, config: _configReadonly.config });exports.phi = phi;var typed = (0, _factoriesAny.createTyped)({ BigNumber: BigNumber, Complex: Complex, DenseMatrix: DenseMatrix, Fraction: Fraction });exports.typed = typed;var isInteger = (0, _factoriesAny.createIsInteger)({ typed: typed });exports.isInteger = isInteger;var isNumeric = (0, _factoriesAny.createIsNumeric)({ typed: typed });exports.isNumeric = isNumeric;var isPositive = (0, _factoriesAny.createIsPositive)({ typed: typed });exports.isPositive = isPositive;var isNaN = (0, _factoriesAny.createIsNaN)({ typed: typed });exports.isNaN = isNaN;var equalScalar = (0, _factoriesAny.createEqualScalar)({ config: _configReadonly.config, typed: typed });exports.equalScalar = equalScalar;var number = (0, _factoriesAny.createNumber)({ typed: typed });exports.number = number;var _boolean = (0, _factoriesAny.createBoolean)({ typed: typed });exports.boolean = _boolean;var complex = (0, _factoriesAny.createComplex)({ Complex: Complex, typed: typed });exports.complex = complex;var splitUnit = (0, _factoriesAny.createSplitUnit)({ typed: typed });exports.splitUnit = splitUnit;var unaryPlus = (0, _factoriesAny.createUnaryPlus)({ BigNumber: BigNumber, config: _configReadonly.config, typed: typed });exports.unaryPlus = unaryPlus;var apply = (0, _factoriesAny.createApply)({ isInteger: isInteger, typed: typed });exports.apply = apply;var cube = (0, _factoriesAny.createCube)({ typed: typed });exports.cube = cube;var expm1 = (0, _factoriesAny.createExpm1)({ Complex: Complex, typed: typed });exports.expm1 = expm1;var log10 = (0, _factoriesAny.createLog10)({ Complex: Complex, config: _configReadonly.config, typed: typed });exports.log10 = log10;var multiplyScalar = (0, _factoriesAny.createMultiplyScalar)({ typed: typed });exports.multiplyScalar = multiplyScalar;var sign = (0, _factoriesAny.createSign)({ BigNumber: BigNumber, Fraction: Fraction, complex: complex, typed: typed });exports.sign = sign;var square = (0, _factoriesAny.createSquare)({ typed: typed });exports.square = square;var bitNot = (0, _factoriesAny.createBitNot)({ typed: typed });exports.bitNot = bitNot;var arg = (0, _factoriesAny.createArg)({ typed: typed });exports.arg = arg;var im = (0, _factoriesAny.createIm)({ typed: typed });exports.im = im;var not = (0, _factoriesAny.createNot)({ typed: typed });exports.not = not;var filter = (0, _factoriesAny.createFilter)({ typed: typed });exports.filter = filter;var forEach = (0, _factoriesAny.createForEach)({ typed: typed });exports.forEach = forEach;var map = (0, _factoriesAny.createMap)({ typed: typed });exports.map = map;var erf = (0, _factoriesAny.createErf)({ typed: typed });exports.erf = erf;var format = (0, _factoriesAny.createFormat)({ typed: typed });exports.format = format;var oct = (0, _factoriesAny.createOct)({ format: format, typed: typed });exports.oct = oct;var print = (0, _factoriesAny.createPrint)({ typed: typed });exports.print = print;var isPrime = (0, _factoriesAny.createIsPrime)({ typed: typed });exports.isPrime = isPrime;var acos = (0, _factoriesAny.createAcos)({ Complex: Complex, config: _configReadonly.config, typed: typed });exports.acos = acos;var acot = (0, _factoriesAny.createAcot)({ BigNumber: BigNumber, typed: typed });exports.acot = acot;var acsc = (0, _factoriesAny.createAcsc)({ BigNumber: BigNumber, Complex: Complex, config: _configReadonly.config, typed: typed });exports.acsc = acsc;var asec = (0, _factoriesAny.createAsec)({ BigNumber: BigNumber, Complex: Complex, config: _configReadonly.config, typed: typed });exports.asec = asec;var asin = (0, _factoriesAny.createAsin)({ Complex: Complex, config: _configReadonly.config, typed: typed });exports.asin = asin;var atan = (0, _factoriesAny.createAtan)({ typed: typed });exports.atan = atan;var atanh = (0, _factoriesAny.createAtanh)({ Complex: Complex, config: _configReadonly.config, typed: typed });exports.atanh = atanh;var cosh = (0, _factoriesAny.createCosh)({ typed: typed });exports.cosh = cosh;var coth = (0, _factoriesAny.createCoth)({ BigNumber: BigNumber, typed: typed });exports.coth = coth;var csch = (0, _factoriesAny.createCsch)({ BigNumber: BigNumber, typed: typed });exports.csch = csch;var sech = (0, _factoriesAny.createSech)({ BigNumber: BigNumber, typed: typed });exports.sech = sech;var sinh = (0, _factoriesAny.createSinh)({ typed: typed });exports.sinh = sinh;var tanh = (0, _factoriesAny.createTanh)({ typed: typed });exports.tanh = tanh;var combinations = (0, _factoriesAny.createCombinations)({ typed: typed });exports.combinations = combinations;var pickRandom = (0, _factoriesAny.createPickRandom)({ config: _configReadonly.config, typed: typed });exports.pickRandom = pickRandom;var randomInt = (0, _factoriesAny.createRandomInt)({ config: _configReadonly.config, typed: typed });exports.randomInt = randomInt;var LN2 = (0, _factoriesAny.createLN2)({ BigNumber: BigNumber, config: _configReadonly.config });exports.LN2 = LN2;var clone = (0, _factoriesAny.createClone)({ typed: typed });exports.clone = clone;var hasNumericValue = (0, _factoriesAny.createHasNumericValue)({ isNumeric: isNumeric, typed: typed });exports.hasNumericValue = hasNumericValue;var typeOf = (0, _factoriesAny.createTypeOf)({ typed: typed });exports.typeOf = typeOf;var string = (0, _factoriesAny.createString)({ typed: typed });exports.string = string;var fraction = (0, _factoriesAny.createFraction)({ Fraction: Fraction, typed: typed });exports.fraction = fraction;var unaryMinus = (0, _factoriesAny.createUnaryMinus)({ typed: typed });exports.unaryMinus = unaryMinus;var addScalar = (0, _factoriesAny.createAddScalar)({ typed: typed });exports.addScalar = addScalar;var exp = (0, _factoriesAny.createExp)({ typed: typed });exports.exp = exp;var log2 = (0, _factoriesAny.createLog2)({ Complex: Complex, config: _configReadonly.config, typed: typed });exports.log2 = log2;var sqrt = (0, _factoriesAny.createSqrt)({ Complex: Complex, config: _configReadonly.config, typed: typed });exports.sqrt = sqrt;var conj = (0, _factoriesAny.createConj)({ typed: typed });exports.conj = conj;var getMatrixDataType = (0, _factoriesAny.createGetMatrixDataType)({ typed: typed });exports.getMatrixDataType = getMatrixDataType;var mode = (0, _factoriesAny.createMode)({ isNaN: isNaN, isNumeric: isNumeric, typed: typed });exports.mode = mode;var bin = (0, _factoriesAny.createBin)({ format: format, typed: typed });exports.bin = bin;var acosh = (0, _factoriesAny.createAcosh)({ Complex: Complex, config: _configReadonly.config, typed: typed });exports.acosh = acosh;var acsch = (0, _factoriesAny.createAcsch)({ BigNumber: BigNumber, typed: typed });exports.acsch = acsch;var asinh = (0, _factoriesAny.createAsinh)({ typed: typed });exports.asinh = asinh;var cos = (0, _factoriesAny.createCos)({ typed: typed });exports.cos = cos;var csc = (0, _factoriesAny.createCsc)({ BigNumber: BigNumber, typed: typed });exports.csc = csc;var sin = (0, _factoriesAny.createSin)({ typed: typed });exports.sin = sin;var combinationsWithRep = (0, _factoriesAny.createCombinationsWithRep)({ typed: typed });exports.combinationsWithRep = combinationsWithRep;var random = (0, _factoriesAny.createRandom)({ config: _configReadonly.config, typed: typed });exports.random = random;var SQRT2 = (0, _factoriesAny.createSQRT2)({ BigNumber: BigNumber, config: _configReadonly.config });exports.SQRT2 = SQRT2;var isNegative = (0, _factoriesAny.createIsNegative)({ typed: typed });exports.isNegative = isNegative;var SparseMatrix = (0, _factoriesAny.createSparseMatrixClass)({ Matrix: Matrix, equalScalar: equalScalar, typed: typed });exports.SparseMatrix = SparseMatrix;var matrix = (0, _factoriesAny.createMatrix)({ DenseMatrix: DenseMatrix, Matrix: Matrix, SparseMatrix: SparseMatrix, typed: typed });exports.matrix = matrix;var abs = (0, _factoriesAny.createAbs)({ typed: typed });exports.abs = abs;var gcd = (0, _factoriesAny.createGcd)({ BigNumber: BigNumber, DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.gcd = gcd;var mod = (0, _factoriesAny.createMod)({ DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.mod = mod;var nthRoot = (0, _factoriesAny.createNthRoot)({ BigNumber: BigNumber, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.nthRoot = nthRoot;var xgcd = (0, _factoriesAny.createXgcd)({ BigNumber: BigNumber, config: _configReadonly.config, matrix: matrix, typed: typed });exports.xgcd = xgcd;var bitAnd = (0, _factoriesAny.createBitAnd)({ equalScalar: equalScalar, matrix: matrix, typed: typed });exports.bitAnd = bitAnd;var bitXor = (0, _factoriesAny.createBitXor)({ DenseMatrix: DenseMatrix, matrix: matrix, typed: typed });exports.bitXor = bitXor;var or = (0, _factoriesAny.createOr)({ DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.or = or;var concat = (0, _factoriesAny.createConcat)({ isInteger: isInteger, matrix: matrix, typed: typed });exports.concat = concat;var diag = (0, _factoriesAny.createDiag)({ DenseMatrix: DenseMatrix, SparseMatrix: SparseMatrix, matrix: matrix, typed: typed });exports.diag = diag;var identity = (0, _factoriesAny.createIdentity)({ BigNumber: BigNumber, DenseMatrix: DenseMatrix, SparseMatrix: SparseMatrix, config: _configReadonly.config, matrix: matrix, typed: typed });exports.identity = identity;var ones = (0, _factoriesAny.createOnes)({ BigNumber: BigNumber, config: _configReadonly.config, matrix: matrix, typed: typed });exports.ones = ones;var reshape = (0, _factoriesAny.createReshape)({ isInteger: isInteger, matrix: matrix, typed: typed });exports.reshape = reshape;var size = (0, _factoriesAny.createSize)({ matrix: matrix, config: _configReadonly.config, typed: typed });exports.size = size;var subset = (0, _factoriesAny.createSubset)({ matrix: matrix, typed: typed });exports.subset = subset;var zeros = (0, _factoriesAny.createZeros)({ BigNumber: BigNumber, config: _configReadonly.config, matrix: matrix, typed: typed });exports.zeros = zeros;var hex = (0, _factoriesAny.createHex)({ format: format, typed: typed });exports.hex = hex;var round = (0, _factoriesAny.createRound)({ BigNumber: BigNumber, DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed, zeros: zeros });exports.round = round;var leftShift = (0, _factoriesAny.createLeftShift)({ DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed, zeros: zeros });exports.leftShift = leftShift;var rightLogShift = (0, _factoriesAny.createRightLogShift)({ DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed, zeros: zeros });exports.rightLogShift = rightLogShift;var compare = (0, _factoriesAny.createCompare)({ BigNumber: BigNumber, DenseMatrix: DenseMatrix, Fraction: Fraction, config: _configReadonly.config, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.compare = compare;var compareText = (0, _factoriesAny.createCompareText)({ matrix: matrix, typed: typed });exports.compareText = compareText;var smaller = (0, _factoriesAny.createSmaller)({ DenseMatrix: DenseMatrix, config: _configReadonly.config, matrix: matrix, typed: typed });exports.smaller = smaller;var larger = (0, _factoriesAny.createLarger)({ DenseMatrix: DenseMatrix, config: _configReadonly.config, matrix: matrix, typed: typed });exports.larger = larger;var unequal = (0, _factoriesAny.createUnequal)({ DenseMatrix: DenseMatrix, config: _configReadonly.config, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.unequal = unequal;var ImmutableDenseMatrix = (0, _factoriesAny.createImmutableDenseMatrixClass)({ DenseMatrix: DenseMatrix, smaller: smaller });exports.ImmutableDenseMatrix = ImmutableDenseMatrix;var FibonacciHeap = (0, _factoriesAny.createFibonacciHeapClass)({ larger: larger, smaller: smaller });exports.FibonacciHeap = FibonacciHeap;var sparse = (0, _factoriesAny.createSparse)({ SparseMatrix: SparseMatrix, typed: typed });exports.sparse = sparse;var acoth = (0, _factoriesAny.createAcoth)({ BigNumber: BigNumber, Complex: Complex, config: _configReadonly.config, typed: typed });exports.acoth = acoth;var atan2 = (0, _factoriesAny.createAtan2)({ BigNumber: BigNumber, DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.atan2 = atan2;var sec = (0, _factoriesAny.createSec)({ BigNumber: BigNumber, typed: typed });exports.sec = sec;var add = (0, _factoriesAny.createAdd)({ DenseMatrix: DenseMatrix, SparseMatrix: SparseMatrix, addScalar: addScalar, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.add = add;var dot = (0, _factoriesAny.createDot)({ addScalar: addScalar, conj: conj, multiplyScalar: multiplyScalar, size: size, typed: typed });exports.dot = dot;var composition = (0, _factoriesAny.createComposition)({ addScalar: addScalar, combinations: combinations, isInteger: isInteger, isNegative: isNegative, isPositive: isPositive, larger: larger, typed: typed });exports.composition = composition;var isZero = (0, _factoriesAny.createIsZero)({ typed: typed });exports.isZero = isZero;var matrixFromFunction = (0, _factoriesAny.createMatrixFromFunction)({ isZero: isZero, matrix: matrix, typed: typed });exports.matrixFromFunction = matrixFromFunction;var cbrt = (0, _factoriesAny.createCbrt)({ BigNumber: BigNumber, Complex: Complex, Fraction: Fraction, config: _configReadonly.config, isNegative: isNegative, matrix: matrix, typed: typed, unaryMinus: unaryMinus });exports.cbrt = cbrt;var floor = (0, _factoriesAny.createFloor)({ config: _configReadonly.config, equalScalar: equalScalar, matrix: matrix, round: round, typed: typed });exports.floor = floor;var multiply = (0, _factoriesAny.createMultiply)({ addScalar: addScalar, dot: dot, equalScalar: equalScalar, matrix: matrix, multiplyScalar: multiplyScalar, typed: typed });exports.multiply = multiply;var dotMultiply = (0, _factoriesAny.createDotMultiply)({ equalScalar: equalScalar, matrix: matrix, multiplyScalar: multiplyScalar, typed: typed });exports.dotMultiply = dotMultiply;var re = (0, _factoriesAny.createRe)({ typed: typed });exports.re = re;var flatten = (0, _factoriesAny.createFlatten)({ matrix: matrix, typed: typed });exports.flatten = flatten;var resize = (0, _factoriesAny.createResize)({ config: _configReadonly.config, matrix: matrix });exports.resize = resize;var squeeze = (0, _factoriesAny.createSqueeze)({ matrix: matrix, typed: typed });exports.squeeze = squeeze;var to = (0, _factoriesAny.createTo)({ matrix: matrix, typed: typed });exports.to = to;var pow = (0, _factoriesAny.createPow)({ Complex: Complex, config: _configReadonly.config, fraction: fraction, identity: identity, matrix: matrix, multiply: multiply, number: number, typed: typed });exports.pow = pow;var dotPow = (0, _factoriesAny.createDotPow)({ DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, pow: pow, typed: typed });exports.dotPow = dotPow;var rightArithShift = (0, _factoriesAny.createRightArithShift)({ DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed, zeros: zeros });exports.rightArithShift = rightArithShift;var compareNatural = (0, _factoriesAny.createCompareNatural)({ compare: compare, typed: typed });exports.compareNatural = compareNatural;var equalText = (0, _factoriesAny.createEqualText)({ compareText: compareText, isZero: isZero, typed: typed });exports.equalText = equalText;var largerEq = (0, _factoriesAny.createLargerEq)({ DenseMatrix: DenseMatrix, config: _configReadonly.config, matrix: matrix, typed: typed });exports.largerEq = largerEq;var partitionSelect = (0, _factoriesAny.createPartitionSelect)({ compare: compare, isNaN: isNaN, isNumeric: isNumeric, typed: typed });exports.partitionSelect = partitionSelect;var Index = (0, _factoriesAny.createIndexClass)({ ImmutableDenseMatrix: ImmutableDenseMatrix });exports.Index = Index;var asech = (0, _factoriesAny.createAsech)({ BigNumber: BigNumber, Complex: Complex, config: _configReadonly.config, typed: typed });exports.asech = asech;var tan = (0, _factoriesAny.createTan)({ typed: typed });exports.tan = tan;var setDifference = (0, _factoriesAny.createSetDifference)({ DenseMatrix: DenseMatrix, Index: Index, compareNatural: compareNatural, size: size, subset: subset, typed: typed });exports.setDifference = setDifference;var setIntersect = (0, _factoriesAny.createSetIntersect)({ DenseMatrix: DenseMatrix, Index: Index, compareNatural: compareNatural, size: size, subset: subset, typed: typed });exports.setIntersect = setIntersect;var setMultiplicity = (0, _factoriesAny.createSetMultiplicity)({ Index: Index, compareNatural: compareNatural, size: size, subset: subset, typed: typed });exports.setMultiplicity = setMultiplicity;var setSize = (0, _factoriesAny.createSetSize)({ compareNatural: compareNatural, typed: typed });exports.setSize = setSize;var trace = (0, _factoriesAny.createTrace)({ add: add, matrix: matrix, typed: typed });exports.trace = trace;var quantileSeq = (0, _factoriesAny.createQuantileSeq)({ add: add, compare: compare, multiply: multiply, partitionSelect: partitionSelect, typed: typed });exports.quantileSeq = quantileSeq;var gamma = (0, _factoriesAny.createGamma)({ BigNumber: BigNumber, Complex: Complex, config: _configReadonly.config, multiplyScalar: multiplyScalar, pow: pow, typed: typed });exports.gamma = gamma;var bignumber = (0, _factoriesAny.createBignumber)({ BigNumber: BigNumber, typed: typed });exports.bignumber = bignumber;var matrixFromColumns = (0, _factoriesAny.createMatrixFromColumns)({ flatten: flatten, matrix: matrix, size: size, typed: typed });exports.matrixFromColumns = matrixFromColumns;var lcm = (0, _factoriesAny.createLcm)({ equalScalar: equalScalar, matrix: matrix, typed: typed });exports.lcm = lcm;var bitOr = (0, _factoriesAny.createBitOr)({ DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.bitOr = bitOr;var kron = (0, _factoriesAny.createKron)({ matrix: matrix, multiplyScalar: multiplyScalar, typed: typed });exports.kron = kron;var transpose = (0, _factoriesAny.createTranspose)({ matrix: matrix, typed: typed });exports.transpose = transpose;var numeric = (0, _factoriesAny.createNumeric)({ bignumber: bignumber, fraction: fraction, number: number });exports.numeric = numeric;var and = (0, _factoriesAny.createAnd)({ equalScalar: equalScalar, matrix: matrix, not: not, typed: typed, zeros: zeros });exports.and = and;var smallerEq = (0, _factoriesAny.createSmallerEq)({ DenseMatrix: DenseMatrix, config: _configReadonly.config, matrix: matrix, typed: typed });exports.smallerEq = smallerEq;var sort = (0, _factoriesAny.createSort)({ compare: compare, compareNatural: compareNatural, matrix: matrix, typed: typed });exports.sort = sort;var min = (0, _factoriesAny.createMin)({ config: _configReadonly.config, numeric: numeric, smaller: smaller, typed: typed });exports.min = min;var cot = (0, _factoriesAny.createCot)({ BigNumber: BigNumber, typed: typed });exports.cot = cot;var setDistinct = (0, _factoriesAny.createSetDistinct)({ DenseMatrix: DenseMatrix, Index: Index, compareNatural: compareNatural, size: size, subset: subset, typed: typed });exports.setDistinct = setDistinct;var setPowerset = (0, _factoriesAny.createSetPowerset)({ Index: Index, compareNatural: compareNatural, size: size, subset: subset, typed: typed });exports.setPowerset = setPowerset;var index = (0, _factoriesAny.createIndex)({ Index: Index, typed: typed });exports.index = index;var sum = (0, _factoriesAny.createSum)({ add: add, config: _configReadonly.config, numeric: numeric, typed: typed });exports.sum = sum;var factorial = (0, _factoriesAny.createFactorial)({ gamma: gamma, typed: typed });exports.factorial = factorial;var permutations = (0, _factoriesAny.createPermutations)({ factorial: factorial, typed: typed });exports.permutations = permutations;var matrixFromRows = (0, _factoriesAny.createMatrixFromRows)({ flatten: flatten, matrix: matrix, size: size, typed: typed });exports.matrixFromRows = matrixFromRows;var subtract = (0, _factoriesAny.createSubtract)({ DenseMatrix: DenseMatrix, addScalar: addScalar, equalScalar: equalScalar, matrix: matrix, typed: typed, unaryMinus: unaryMinus });exports.subtract = subtract;var cross = (0, _factoriesAny.createCross)({ matrix: matrix, multiply: multiply, subtract: subtract, typed: typed });exports.cross = cross;var range = (0, _factoriesAny.createRange)({ bignumber: bignumber, matrix: matrix, config: _configReadonly.config, larger: larger, largerEq: largerEq, smaller: smaller, smallerEq: smallerEq, typed: typed });exports.range = range;var row = (0, _factoriesAny.createRow)({ Index: Index, matrix: matrix, range: range, typed: typed });exports.row = row;var prod = (0, _factoriesAny.createProd)({ config: _configReadonly.config, multiplyScalar: multiplyScalar, numeric: numeric, typed: typed });exports.prod = prod;var equal = (0, _factoriesAny.createEqual)({ DenseMatrix: DenseMatrix, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.equal = equal;var max = (0, _factoriesAny.createMax)({ config: _configReadonly.config, larger: larger, numeric: numeric, typed: typed });exports.max = max;var setCartesian = (0, _factoriesAny.createSetCartesian)({ DenseMatrix: DenseMatrix, Index: Index, compareNatural: compareNatural, size: size, subset: subset, typed: typed });exports.setCartesian = setCartesian;var setSymDifference = (0, _factoriesAny.createSetSymDifference)({ Index: Index, concat: concat, setDifference: setDifference, size: size, subset: subset, typed: typed });exports.setSymDifference = setSymDifference;var ceil = (0, _factoriesAny.createCeil)({ config: _configReadonly.config, equalScalar: equalScalar, matrix: matrix, round: round, typed: typed });exports.ceil = ceil;var xor = (0, _factoriesAny.createXor)({ DenseMatrix: DenseMatrix, matrix: matrix, typed: typed });exports.xor = xor;var count = (0, _factoriesAny.createCount)({ prod: prod, size: size, typed: typed });exports.count = count;var ctranspose = (0, _factoriesAny.createCtranspose)({ conj: conj, transpose: transpose, typed: typed });exports.ctranspose = ctranspose;var deepEqual = (0, _factoriesAny.createDeepEqual)({ equal: equal, typed: typed });exports.deepEqual = deepEqual;var setIsSubset = (0, _factoriesAny.createSetIsSubset)({ Index: Index, compareNatural: compareNatural, size: size, subset: subset, typed: typed });exports.setIsSubset = setIsSubset;var fix = (0, _factoriesAny.createFix)({ Complex: Complex, ceil: ceil, floor: floor, matrix: matrix, typed: typed });exports.fix = fix;var diff = (0, _factoriesAny.createDiff)({ matrix: matrix, number: number, subtract: subtract, typed: typed });exports.diff = diff;var divideScalar = (0, _factoriesAny.createDivideScalar)({ numeric: numeric, typed: typed });exports.divideScalar = divideScalar;var nthRoots = (0, _factoriesAny.createNthRoots)({ Complex: Complex, config: _configReadonly.config, divideScalar: divideScalar, typed: typed });exports.nthRoots = nthRoots;var lsolve = (0, _factoriesAny.createLsolve)({ DenseMatrix: DenseMatrix, divideScalar: divideScalar, equalScalar: equalScalar, matrix: matrix, multiplyScalar: multiplyScalar, subtract: subtract, typed: typed });exports.lsolve = lsolve;var lsolveAll = (0, _factoriesAny.createLsolveAll)({ DenseMatrix: DenseMatrix, divideScalar: divideScalar, equalScalar: equalScalar, matrix: matrix, multiplyScalar: multiplyScalar, subtract: subtract, typed: typed });exports.lsolveAll = lsolveAll;var Spa = (0, _factoriesAny.createSpaClass)({ FibonacciHeap: FibonacciHeap, addScalar: addScalar, equalScalar: equalScalar });exports.Spa = Spa;var setUnion = (0, _factoriesAny.createSetUnion)({ Index: Index, concat: concat, setIntersect: setIntersect, setSymDifference: setSymDifference, size: size, subset: subset, typed: typed });exports.setUnion = setUnion;var lup = (0, _factoriesAny.createLup)({ DenseMatrix: DenseMatrix, Spa: Spa, SparseMatrix: SparseMatrix, abs: abs, addScalar: addScalar, divideScalar: divideScalar, equalScalar: equalScalar, larger: larger, matrix: matrix, multiplyScalar: multiplyScalar, subtract: subtract, typed: typed, unaryMinus: unaryMinus });exports.lup = lup;var slu = (0, _factoriesAny.createSlu)({ SparseMatrix: SparseMatrix, abs: abs, add: add, divideScalar: divideScalar, larger: larger, largerEq: largerEq, multiply: multiply, subtract: subtract, transpose: transpose, typed: typed });exports.slu = slu;var det = (0, _factoriesAny.createDet)({ lup: lup, matrix: matrix, multiply: multiply, subtract: subtract, typed: typed, unaryMinus: unaryMinus });exports.det = det;var distance = (0, _factoriesAny.createDistance)({ abs: abs, addScalar: addScalar, divideScalar: divideScalar, multiplyScalar: multiplyScalar, sqrt: sqrt, subtract: subtract, typed: typed, unaryMinus: unaryMinus });exports.distance = distance;var stirlingS2 = (0, _factoriesAny.createStirlingS2)({ addScalar: addScalar, combinations: combinations, divideScalar: divideScalar, factorial: factorial, isInteger: isInteger, isNegative: isNegative, larger: larger, multiplyScalar: multiplyScalar, pow: pow, subtract: subtract, typed: typed });exports.stirlingS2 = stirlingS2;var catalan = (0, _factoriesAny.createCatalan)({ addScalar: addScalar, combinations: combinations, divideScalar: divideScalar, isInteger: isInteger, isNegative: isNegative, multiplyScalar: multiplyScalar, typed: typed });exports.catalan = catalan;var column = (0, _factoriesAny.createColumn)({ Index: Index, matrix: matrix, range: range, typed: typed });exports.column = column;var log = (0, _factoriesAny.createLog)({ Complex: Complex, config: _configReadonly.config, divideScalar: divideScalar, typed: typed });exports.log = log;var dotDivide = (0, _factoriesAny.createDotDivide)({ DenseMatrix: DenseMatrix, divideScalar: divideScalar, equalScalar: equalScalar, matrix: matrix, typed: typed });exports.dotDivide = dotDivide;var usolveAll = (0, _factoriesAny.createUsolveAll)({ DenseMatrix: DenseMatrix, divideScalar: divideScalar, equalScalar: equalScalar, matrix: matrix, multiplyScalar: multiplyScalar, subtract: subtract, typed: typed });exports.usolveAll = usolveAll;var hypot = (0, _factoriesAny.createHypot)({ abs: abs, addScalar: addScalar, divideScalar: divideScalar, isPositive: isPositive, multiplyScalar: multiplyScalar, smaller: smaller, sqrt: sqrt, typed: typed });exports.hypot = hypot;var qr = (0, _factoriesAny.createQr)({ addScalar: addScalar, complex: complex, conj: conj, divideScalar: divideScalar, equal: equal, identity: identity, isZero: isZero, matrix: matrix, multiplyScalar: multiplyScalar, sign: sign, sqrt: sqrt, subtract: subtract, typed: typed, unaryMinus: unaryMinus, zeros: zeros });exports.qr = qr;var inv = (0, _factoriesAny.createInv)({ abs: abs, addScalar: addScalar, det: det, divideScalar: divideScalar, identity: identity, matrix: matrix, multiply: multiply, typed: typed, unaryMinus: unaryMinus });exports.inv = inv;var expm = (0, _factoriesAny.createExpm)({ abs: abs, add: add, identity: identity, inv: inv, multiply: multiply, typed: typed });exports.expm = expm;var divide = (0, _factoriesAny.createDivide)({ divideScalar: divideScalar, equalScalar: equalScalar, inv: inv, matrix: matrix, multiply: multiply, typed: typed });exports.divide = divide;var mean = (0, _factoriesAny.createMean)({ add: add, divide: divide, typed: typed });exports.mean = mean;var variance = (0, _factoriesAny.createVariance)({ add: add, apply: apply, divide: divide, isNaN: isNaN, multiply: multiply, subtract: subtract, typed: typed });exports.variance = variance;var kldivergence = (0, _factoriesAny.createKldivergence)({ divide: divide, dotDivide: dotDivide, isNumeric: isNumeric, log: log, matrix: matrix, multiply: multiply, sum: sum, typed: typed });exports.kldivergence = kldivergence;var bellNumbers = (0, _factoriesAny.createBellNumbers)({ addScalar: addScalar, isInteger: isInteger, isNegative: isNegative, stirlingS2: stirlingS2, typed: typed });exports.bellNumbers = bellNumbers;var log1p = (0, _factoriesAny.createLog1p)({ Complex: Complex, config: _configReadonly.config, divideScalar: divideScalar, log: log, typed: typed });exports.log1p = log1p;var Unit = (0, _factoriesAny.createUnitClass)({ BigNumber: BigNumber, Complex: Complex, Fraction: Fraction, abs: abs, addScalar: addScalar, config: _configReadonly.config, divideScalar: divideScalar, equal: equal, fix: fix, format: format, isNumeric: isNumeric, multiplyScalar: multiplyScalar, number: number, pow: pow, round: round, subtract: subtract });exports.Unit = Unit;var createUnit = (0, _factoriesAny.createCreateUnit)({ Unit: Unit, typed: typed });exports.createUnit = createUnit;var eigs = (0, _factoriesAny.createEigs)({ abs: abs, add: add, addScalar: addScalar, atan: atan, bignumber: bignumber, column: column, complex: complex, config: _configReadonly.config, cos: cos, diag: diag, divideScalar: divideScalar, equal: equal, flatten: flatten, im: im, inv: inv, larger: larger, log10: log10, matrix: matrix, matrixFromColumns: matrixFromColumns, multiply: multiply, multiplyScalar: multiplyScalar, number: number, qr: qr, re: re, round: round, sin: sin, smaller: smaller, sqrt: sqrt, subtract: subtract, transpose: transpose, typed: typed, usolveAll: usolveAll });exports.eigs = eigs;var intersect = (0, _factoriesAny.createIntersect)({ abs: abs, add: add, addScalar: addScalar, config: _configReadonly.config, divideScalar: divideScalar, equalScalar: equalScalar, matrix: matrix, multiply: multiply, multiplyScalar: multiplyScalar, smaller: smaller, subtract: subtract, typed: typed });exports.intersect = intersect;var std = (0, _factoriesAny.createStd)({ sqrt: sqrt, typed: typed, variance: variance });exports.std = std;var atomicMass = (0, _factoriesAny.createAtomicMass)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.atomicMass = atomicMass;var bohrMagneton = (0, _factoriesAny.createBohrMagneton)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.bohrMagneton = bohrMagneton;var boltzmann = (0, _factoriesAny.createBoltzmann)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.boltzmann = boltzmann;var conductanceQuantum = (0, _factoriesAny.createConductanceQuantum)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.conductanceQuantum = conductanceQuantum;var deuteronMass = (0, _factoriesAny.createDeuteronMass)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.deuteronMass = deuteronMass;var electronMass = (0, _factoriesAny.createElectronMass)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.electronMass = electronMass;var faraday = (0, _factoriesAny.createFaraday)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.faraday = faraday;var firstRadiation = (0, _factoriesAny.createFirstRadiation)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.firstRadiation = firstRadiation;var gravitationConstant = (0, _factoriesAny.createGravitationConstant)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.gravitationConstant = gravitationConstant;var hartreeEnergy = (0, _factoriesAny.createHartreeEnergy)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.hartreeEnergy = hartreeEnergy;var klitzing = (0, _factoriesAny.createKlitzing)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.klitzing = klitzing;var magneticConstant = (0, _factoriesAny.createMagneticConstant)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.magneticConstant = magneticConstant;var molarMass = (0, _factoriesAny.createMolarMass)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.molarMass = molarMass;var molarPlanckConstant = (0, _factoriesAny.createMolarPlanckConstant)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.molarPlanckConstant = molarPlanckConstant;var neutronMass = (0, _factoriesAny.createNeutronMass)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.neutronMass = neutronMass;var planckCharge = (0, _factoriesAny.createPlanckCharge)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.planckCharge = planckCharge;var planckLength = (0, _factoriesAny.createPlanckLength)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.planckLength = planckLength;var planckTemperature = (0, _factoriesAny.createPlanckTemperature)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.planckTemperature = planckTemperature;var protonMass = (0, _factoriesAny.createProtonMass)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.protonMass = protonMass;var reducedPlanckConstant = (0, _factoriesAny.createReducedPlanckConstant)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.reducedPlanckConstant = reducedPlanckConstant;var secondRadiation = (0, _factoriesAny.createSecondRadiation)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.secondRadiation = secondRadiation;var stefanBoltzmann = (0, _factoriesAny.createStefanBoltzmann)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.stefanBoltzmann = stefanBoltzmann;var vacuumImpedance = (0, _factoriesAny.createVacuumImpedance)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.vacuumImpedance = vacuumImpedance;var usolve = (0, _factoriesAny.createUsolve)({ DenseMatrix: DenseMatrix, divideScalar: divideScalar, equalScalar: equalScalar, matrix: matrix, multiplyScalar: multiplyScalar, subtract: subtract, typed: typed });exports.usolve = usolve;var norm = (0, _factoriesAny.createNorm)({ abs: abs, add: add, conj: conj, ctranspose: ctranspose, eigs: eigs, equalScalar: equalScalar, larger: larger, matrix: matrix, multiply: multiply, pow: pow, smaller: smaller, sqrt: sqrt, typed: typed });exports.norm = norm;var lusolve = (0, _factoriesAny.createLusolve)({ DenseMatrix: DenseMatrix, lsolve: lsolve, lup: lup, matrix: matrix, slu: slu, typed: typed, usolve: usolve });exports.lusolve = lusolve;var sqrtm = (0, _factoriesAny.createSqrtm)({ abs: abs, add: add, identity: identity, inv: inv, max: max, multiply: multiply, size: size, sqrt: sqrt, subtract: subtract, typed: typed });exports.sqrtm = sqrtm;var multinomial = (0, _factoriesAny.createMultinomial)({ add: add, divide: divide, factorial: factorial, isInteger: isInteger, isPositive: isPositive, multiply: multiply, typed: typed });exports.multinomial = multinomial;var avogadro = (0, _factoriesAny.createAvogadro)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.avogadro = avogadro;var classicalElectronRadius = (0, _factoriesAny.createClassicalElectronRadius)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.classicalElectronRadius = classicalElectronRadius;var electricConstant = (0, _factoriesAny.createElectricConstant)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.electricConstant = electricConstant;var fermiCoupling = (0, _factoriesAny.createFermiCoupling)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.fermiCoupling = fermiCoupling;var gravity = (0, _factoriesAny.createGravity)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.gravity = gravity;var loschmidt = (0, _factoriesAny.createLoschmidt)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.loschmidt = loschmidt;var molarMassC12 = (0, _factoriesAny.createMolarMassC12)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.molarMassC12 = molarMassC12;var nuclearMagneton = (0, _factoriesAny.createNuclearMagneton)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.nuclearMagneton = nuclearMagneton;var planckMass = (0, _factoriesAny.createPlanckMass)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.planckMass = planckMass;var quantumOfCirculation = (0, _factoriesAny.createQuantumOfCirculation)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.quantumOfCirculation = quantumOfCirculation;var speedOfLight = (0, _factoriesAny.createSpeedOfLight)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.speedOfLight = speedOfLight;var wienDisplacement = (0, _factoriesAny.createWienDisplacement)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.wienDisplacement = wienDisplacement;var rotationMatrix = (0, _factoriesAny.createRotationMatrix)({ BigNumber: BigNumber, DenseMatrix: DenseMatrix, SparseMatrix: SparseMatrix, addScalar: addScalar, config: _configReadonly.config, cos: cos, matrix: matrix, multiplyScalar: multiplyScalar, norm: norm, sin: sin, typed: typed, unaryMinus: unaryMinus });exports.rotationMatrix = rotationMatrix;var median = (0, _factoriesAny.createMedian)({ add: add, compare: compare, divide: divide, partitionSelect: partitionSelect, typed: typed });exports.median = median;var bohrRadius = (0, _factoriesAny.createBohrRadius)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.bohrRadius = bohrRadius;var elementaryCharge = (0, _factoriesAny.createElementaryCharge)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.elementaryCharge = elementaryCharge;var inverseConductanceQuantum = (0, _factoriesAny.createInverseConductanceQuantum)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.inverseConductanceQuantum = inverseConductanceQuantum;var molarVolume = (0, _factoriesAny.createMolarVolume)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.molarVolume = molarVolume;var planckTime = (0, _factoriesAny.createPlanckTime)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.planckTime = planckTime;var thomsonCrossSection = (0, _factoriesAny.createThomsonCrossSection)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.thomsonCrossSection = thomsonCrossSection;var rotate = (0, _factoriesAny.createRotate)({ multiply: multiply, rotationMatrix: rotationMatrix, typed: typed });exports.rotate = rotate;var mad = (0, _factoriesAny.createMad)({ abs: abs, map: map, median: median, subtract: subtract, typed: typed });exports.mad = mad;var coulomb = (0, _factoriesAny.createCoulomb)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.coulomb = coulomb;var magneticFluxQuantum = (0, _factoriesAny.createMagneticFluxQuantum)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.magneticFluxQuantum = magneticFluxQuantum;var rydberg = (0, _factoriesAny.createRydberg)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.rydberg = rydberg;var unit = (0, _factoriesAny.createUnitFunction)({ Unit: Unit, typed: typed });exports.unit = unit;var gasConstant = (0, _factoriesAny.createGasConstant)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.gasConstant = gasConstant;var planckConstant = (0, _factoriesAny.createPlanckConstant)({ BigNumber: BigNumber, Unit: Unit, config: _configReadonly.config });exports.planckConstant = planckConstant;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/entry/typeChecks.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), Object.defineProperty(exports, "isAccessorNode", ({ enumerable: !0, get: function () {return _is.isAccessorNode;} })), Object.defineProperty(exports, "isArray", ({ enumerable: !0, get: function () {return _is.isArray;} })), Object.defineProperty(exports, "isArrayNode", ({ enumerable: !0, get: function () {return _is.isArrayNode;} })), Object.defineProperty(exports, "isAssignmentNode", ({ enumerable: !0, get: function () {return _is.isAssignmentNode;} })), Object.defineProperty(exports, "isBigNumber", ({ enumerable: !0, get: function () {return _is.isBigNumber;} })), Object.defineProperty(exports, "isBlockNode", ({ enumerable: !0, get: function () {return _is.isBlockNode;} })), Object.defineProperty(exports, "isBoolean", ({ enumerable: !0, get: function () {return _is.isBoolean;} })), Object.defineProperty(exports, "isChain", ({ enumerable: !0, get: function () {return _is.isChain;} })), Object.defineProperty(exports, "isCollection", ({ enumerable: !0, get: function () {return _is.isCollection;} })), Object.defineProperty(exports, "isComplex", ({ enumerable: !0, get: function () {return _is.isComplex;} })), Object.defineProperty(exports, "isConditionalNode", ({ enumerable: !0, get: function () {return _is.isConditionalNode;} })), Object.defineProperty(exports, "isConstantNode", ({ enumerable: !0, get: function () {return _is.isConstantNode;} })), Object.defineProperty(exports, "isDate", ({ enumerable: !0, get: function () {return _is.isDate;} })), Object.defineProperty(exports, "isDenseMatrix", ({ enumerable: !0, get: function () {return _is.isDenseMatrix;} })), Object.defineProperty(exports, "isFraction", ({ enumerable: !0, get: function () {return _is.isFraction;} })), Object.defineProperty(exports, "isFunction", ({ enumerable: !0, get: function () {return _is.isFunction;} })), Object.defineProperty(exports, "isFunctionAssignmentNode", ({ enumerable: !0, get: function () {return _is.isFunctionAssignmentNode;} })), Object.defineProperty(exports, "isFunctionNode", ({ enumerable: !0, get: function () {return _is.isFunctionNode;} })), Object.defineProperty(exports, "isHelp", ({ enumerable: !0, get: function () {return _is.isHelp;} })), Object.defineProperty(exports, "isIndex", ({ enumerable: !0, get: function () {return _is.isIndex;} })), Object.defineProperty(exports, "isIndexNode", ({ enumerable: !0, get: function () {return _is.isIndexNode;} })), Object.defineProperty(exports, "isMatrix", ({ enumerable: !0, get: function () {return _is.isMatrix;} })), Object.defineProperty(exports, "isNode", ({ enumerable: !0, get: function () {return _is.isNode;} })), Object.defineProperty(exports, "isNull", ({ enumerable: !0, get: function () {return _is.isNull;} })), Object.defineProperty(exports, "isNumber", ({ enumerable: !0, get: function () {return _is.isNumber;} })), Object.defineProperty(exports, "isString", ({ enumerable: !0, get: function () {return _is.isString;} })), Object.defineProperty(exports, "isUndefined", ({ enumerable: !0, get: function () {return _is.isUndefined;} })), Object.defineProperty(exports, "isObject", ({ enumerable: !0, get: function () {return _is.isObject;} })), Object.defineProperty(exports, "isObjectNode", ({ enumerable: !0, get: function () {return _is.isObjectNode;} })), Object.defineProperty(exports, "isOperatorNode", ({ enumerable: !0, get: function () {return _is.isOperatorNode;} })), Object.defineProperty(exports, "isParenthesisNode", ({ enumerable: !0, get: function () {return _is.isParenthesisNode;} })), Object.defineProperty(exports, "isRange", ({ enumerable: !0, get: function () {return _is.isRange;} })), Object.defineProperty(exports, "isRangeNode", ({ enumerable: !0, get: function () {return _is.isRangeNode;} })), Object.defineProperty(exports, "isRegExp", ({ enumerable: !0, get: function () {return _is.isRegExp;} })), Object.defineProperty(exports, "isResultSet", ({ enumerable: !0, get: function () {return _is.isResultSet;} })), Object.defineProperty(exports, "isSparseMatrix", ({ enumerable: !0, get: function () {return _is.isSparseMatrix;} })), Object.defineProperty(exports, "isSymbolNode", ({ enumerable: !0, get: function () {return _is.isSymbolNode;} })), Object.defineProperty(exports, "isUnit", ({ enumerable: !0, get: function () {return _is.isUnit;} }));var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js");

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/error/ArgumentsError.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ArgumentsError = ArgumentsError;function ArgumentsError(fn, count, min, max) {if (!(this instanceof ArgumentsError)) throw new SyntaxError("Constructor must be called with the new operator");this.fn = fn, this.count = count, this.min = min, this.max = max, this.message = "Wrong number of arguments in function " + fn + " (" + count + " provided, " + min + (max !== void 0 && null !== max ? "-" + max : "") + " expected)", this.stack = new Error().stack;}ArgumentsError.prototype = new Error(), ArgumentsError.prototype.constructor = Error, ArgumentsError.prototype.name = "ArgumentsError", ArgumentsError.prototype.isArgumentsError = !0;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/error/DimensionError.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.DimensionError = DimensionError;function DimensionError(actual, expected, relation) {if (!(this instanceof DimensionError)) throw new SyntaxError("Constructor must be called with the new operator");this.actual = actual, this.expected = expected, this.relation = relation, this.message = "Dimension mismatch (" + (Array.isArray(actual) ? "[" + actual.join(", ") + "]" : actual) + " " + (this.relation || "!=") + " " + (Array.isArray(expected) ? "[" + expected.join(", ") + "]" : expected) + ")", this.stack = new Error().stack;}DimensionError.prototype = new RangeError(), DimensionError.prototype.constructor = RangeError, DimensionError.prototype.name = "DimensionError", DimensionError.prototype.isDimensionError = !0;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/error/IndexError.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.IndexError = IndexError;function IndexError(index, min, max) {if (!(this instanceof IndexError)) throw new SyntaxError("Constructor must be called with the new operator");this.index = index, 3 > arguments.length ? (this.min = 0, this.max = min) : (this.min = min, this.max = max), this.message = void 0 !== this.min && this.index < this.min ? "Index out of range (" + this.index + " < " + this.min + ")" : void 0 !== this.max && this.index >= this.max ? "Index out of range (" + this.index + " > " + (this.max - 1) + ")" : "Index out of range (" + this.index + ")", this.stack = new Error().stack;}IndexError.prototype = new RangeError(), IndexError.prototype.constructor = RangeError, IndexError.prototype.name = "IndexError", IndexError.prototype.isIndexError = !0;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/Help.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createHelpClass = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "Help",dependencies = ["parse"],createHelpClass = (0, _factory.factory)(name, dependencies, function (_ref) {function Help(doc) {if (!(this instanceof Help)) throw new SyntaxError("Constructor must be called with the new operator");if (!doc) throw new Error("Argument \"doc\" missing");this.doc = doc;}var parse = _ref.parse;return Help.prototype.type = "Help", Help.prototype.isHelp = !0, Help.prototype.toString = function () {var doc = this.doc || {},desc = "\n";if (doc.name && (desc += "Name: " + doc.name + "\n\n"), doc.category && (desc += "Category: " + doc.category + "\n\n"), doc.description && (desc += "Description:\n    " + doc.description + "\n\n"), doc.syntax && (desc += "Syntax:\n    " + doc.syntax.join("\n    ") + "\n\n"), doc.examples) {desc += "Examples:\n";for (var expr, scope = {}, i = 0; i < doc.examples.length; i++) {expr = doc.examples[i], desc += "    " + expr + "\n";var res = void 0;try {res = parse(expr).compile().evaluate(scope);} catch (e) {res = e;}void 0 === res || (0, _is.isHelp)(res) || (desc += "        " + (0, _string.format)(res, { precision: 14 }) + "\n");}desc += "\n";}return doc.seealso && doc.seealso.length && (desc += "See also: " + doc.seealso.join(", ") + "\n"), desc;}, Help.prototype.toJSON = function () {var obj = (0, _object.clone)(this.doc);return obj.mathjs = "Help", obj;}, Help.fromJSON = function (json) {var doc = {};return Object.keys(json).filter(function (prop) {return "mathjs" !== prop;}).forEach(function (prop) {doc[prop] = json[prop];}), new Help(doc);}, Help.prototype.valueOf = Help.prototype.toString, Help;}, { isClass: !0 });exports.createHelpClass = createHelpClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/Parser.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createParserClass = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_map = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/map.js"),name = "Parser",dependencies = ["parse"],createParserClass = (0, _factory.factory)(name, dependencies, function (_ref) {function Parser() {if (!(this instanceof Parser)) throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this, "scope", { value: (0, _map.createEmptyMap)(), writable: !1 });}var parse = _ref.parse;return Parser.prototype.type = "Parser", Parser.prototype.isParser = !0, Parser.prototype.evaluate = function (expr) {return parse(expr).compile().evaluate(this.scope);}, Parser.prototype.get = function (name) {if (this.scope.has(name)) return this.scope.get(name);}, Parser.prototype.getAll = function () {return (0, _map.toObject)(this.scope);}, Parser.prototype.getAllAsMap = function () {return this.scope;}, Parser.prototype.set = function (name, value) {return this.scope.set(name, value), value;}, Parser.prototype.remove = function (name) {this.scope["delete"](name);}, Parser.prototype.clear = function () {this.scope.clear();}, Parser;}, { isClass: !0 });exports.createParserClass = createParserClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/Infinity.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.InfinityDocs = void 0;var InfinityDocs = { name: "Infinity", category: "Constants", syntax: ["Infinity"], description: "Infinity, a number which is larger than the maximum number that can be handled by a floating point number.", examples: ["Infinity", "1 / 0"], seealso: [] };exports.InfinityDocs = InfinityDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN10.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.LN10Docs = void 0;var LN10Docs = { name: "LN10", category: "Constants", syntax: ["LN10"], description: "Returns the natural logarithm of 10, approximately equal to 2.302", examples: ["LN10", "log(10)"], seealso: [] };exports.LN10Docs = LN10Docs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN2.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.LN2Docs = void 0;var LN2Docs = { name: "LN2", category: "Constants", syntax: ["LN2"], description: "Returns the natural logarithm of 2, approximately equal to 0.693", examples: ["LN2", "log(2)"], seealso: [] };exports.LN2Docs = LN2Docs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG10E.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.LOG10EDocs = void 0;var LOG10EDocs = { name: "LOG10E", category: "Constants", syntax: ["LOG10E"], description: "Returns the base-10 logarithm of E, approximately equal to 0.434", examples: ["LOG10E", "log(e, 10)"], seealso: [] };exports.LOG10EDocs = LOG10EDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG2E.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.LOG2EDocs = void 0;var LOG2EDocs = { name: "LOG2E", category: "Constants", syntax: ["LOG2E"], description: "Returns the base-2 logarithm of E, approximately equal to 1.442", examples: ["LOG2E", "log(e, 2)"], seealso: [] };exports.LOG2EDocs = LOG2EDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/NaN.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.NaNDocs = void 0;var NaNDocs = { name: "NaN", category: "Constants", syntax: ["NaN"], description: "Not a number", examples: ["NaN", "0 / 0"], seealso: [] };exports.NaNDocs = NaNDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT1_2.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.SQRT12Docs = void 0;var SQRT12Docs = { name: "SQRT1_2", category: "Constants", syntax: ["SQRT1_2"], description: "Returns the square root of 1/2, approximately equal to 0.707", examples: ["SQRT1_2", "sqrt(1/2)"], seealso: [] };exports.SQRT12Docs = SQRT12Docs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT2.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.SQRT2Docs = void 0;var SQRT2Docs = { name: "SQRT2", category: "Constants", syntax: ["SQRT2"], description: "Returns the square root of 2, approximately equal to 1.414", examples: ["SQRT2", "sqrt(2)"], seealso: [] };exports.SQRT2Docs = SQRT2Docs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/e.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.eDocs = void 0;var eDocs = { name: "e", category: "Constants", syntax: ["e"], description: "Euler's number, the base of the natural logarithm. Approximately equal to 2.71828", examples: ["e", "e ^ 2", "exp(2)", "log(e)"], seealso: ["exp"] };exports.eDocs = eDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/false.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.falseDocs = void 0;var falseDocs = { name: "false", category: "Constants", syntax: ["false"], description: "Boolean value false", examples: ["false"], seealso: ["true"] };exports.falseDocs = falseDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/i.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.iDocs = void 0;var iDocs = { name: "i", category: "Constants", syntax: ["i"], description: "Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.", examples: ["i", "i * i", "sqrt(-1)"], seealso: [] };exports.iDocs = iDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/null.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.nullDocs = void 0;var nullDocs = { name: "null", category: "Constants", syntax: ["null"], description: "Value null", examples: ["null"], seealso: ["true", "false"] };exports.nullDocs = nullDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/phi.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.phiDocs = void 0;var phiDocs = { name: "phi", category: "Constants", syntax: ["phi"], description: "Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...", examples: ["phi"], seealso: [] };exports.phiDocs = phiDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/pi.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.piDocs = void 0;var piDocs = { name: "pi", category: "Constants", syntax: ["pi"], description: "The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159", examples: ["pi", "sin(pi/2)"], seealso: ["tau"] };exports.piDocs = piDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/tau.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.tauDocs = void 0;var tauDocs = { name: "tau", category: "Constants", syntax: ["tau"], description: "Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.", examples: ["tau", "2 * pi"], seealso: ["pi"] };exports.tauDocs = tauDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/true.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.trueDocs = void 0;var trueDocs = { name: "true", category: "Constants", syntax: ["true"], description: "Boolean value true", examples: ["true"], seealso: ["false"] };exports.trueDocs = trueDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/version.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.versionDocs = void 0;var versionDocs = { name: "version", category: "Constants", syntax: ["version"], description: "A string with the version number of math.js", examples: ["version"], seealso: [] };exports.versionDocs = versionDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bignumber.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bignumberDocs = void 0;var bignumberDocs = { name: "bignumber", category: "Construction", syntax: ["bignumber(x)"], description: "Create a big number from a number or string.", examples: ["0.1 + 0.2", "bignumber(0.1) + bignumber(0.2)", "bignumber(\"7.2\")", "bignumber(\"7.2e500\")", "bignumber([0.1, 0.2, 0.3])"], seealso: ["boolean", "complex", "fraction", "index", "matrix", "string", "unit"] };exports.bignumberDocs = bignumberDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/boolean.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.booleanDocs = void 0;var booleanDocs = { name: "boolean", category: "Construction", syntax: ["x", "boolean(x)"], description: "Convert a string or number into a boolean.", examples: ["boolean(0)", "boolean(1)", "boolean(3)", "boolean(\"true\")", "boolean(\"false\")", "boolean([1, 0, 1, 1])"], seealso: ["bignumber", "complex", "index", "matrix", "number", "string", "unit"] };exports.booleanDocs = booleanDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/complex.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.complexDocs = void 0;var complexDocs = { name: "complex", category: "Construction", syntax: ["complex()", "complex(re, im)", "complex(string)"], description: "Create a complex number.", examples: ["complex()", "complex(2, 3)", "complex(\"7 - 2i\")"], seealso: ["bignumber", "boolean", "index", "matrix", "number", "string", "unit"] };exports.complexDocs = complexDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/createUnit.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUnitDocs = void 0;var createUnitDocs = { name: "createUnit", category: "Construction", syntax: ["createUnit(definitions)", "createUnit(name, definition)"], description: "Create a user-defined unit and register it with the Unit type.", examples: ["createUnit(\"foo\")", "createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})", "createUnit(\"mph\", \"1 mile/hour\")"], seealso: ["unit", "splitUnit"] };exports.createUnitDocs = createUnitDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/fraction.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.fractionDocs = void 0;var fractionDocs = { name: "fraction", category: "Construction", syntax: ["fraction(num)", "fraction(num,den)"], description: "Create a fraction from a number or from a numerator and denominator.", examples: ["fraction(0.125)", "fraction(1, 3) + fraction(2, 5)"], seealso: ["bignumber", "boolean", "complex", "index", "matrix", "string", "unit"] };exports.fractionDocs = fractionDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/index.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.indexDocs = void 0;var indexDocs = { name: "index", category: "Construction", syntax: ["[start]", "[start:end]", "[start:step:end]", "[start1, start 2, ...]", "[start1:end1, start2:end2, ...]", "[start1:step1:end1, start2:step2:end2, ...]"], description: "Create an index to get or replace a subset of a matrix", examples: ["[]", "[1, 2, 3]", "A = [1, 2, 3; 4, 5, 6]", "A[1, :]", "A[1, 2] = 50", "A[0:2, 0:2] = ones(2, 2)"], seealso: ["bignumber", "boolean", "complex", "matrix,", "number", "range", "string", "unit"] };exports.indexDocs = indexDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/matrix.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.matrixDocs = void 0;var matrixDocs = { name: "matrix", category: "Construction", syntax: ["[]", "[a1, b1, ...; a2, b2, ...]", "matrix()", "matrix(\"dense\")", "matrix([...])"], description: "Create a matrix.", examples: ["[]", "[1, 2, 3]", "[1, 2, 3; 4, 5, 6]", "matrix()", "matrix([3, 4])", "matrix([3, 4; 5, 6], \"sparse\")", "matrix([3, 4; 5, 6], \"sparse\", \"number\")"], seealso: ["bignumber", "boolean", "complex", "index", "number", "string", "unit", "sparse"] };exports.matrixDocs = matrixDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/number.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.numberDocs = void 0;var numberDocs = { name: "number", category: "Construction", syntax: ["x", "number(x)", "number(unit, valuelessUnit)"], description: "Create a number or convert a string or boolean into a number.", examples: ["2", "2e3", "4.05", "number(2)", "number(\"7.2\")", "number(true)", "number([true, false, true, true])", "number(unit(\"52cm\"), \"m\")"], seealso: ["bignumber", "boolean", "complex", "fraction", "index", "matrix", "string", "unit"] };exports.numberDocs = numberDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/sparse.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sparseDocs = void 0;var sparseDocs = { name: "sparse", category: "Construction", syntax: ["sparse()", "sparse([a1, b1, ...; a1, b2, ...])", "sparse([a1, b1, ...; a1, b2, ...], \"number\")"], description: "Create a sparse matrix.", examples: ["sparse()", "sparse([3, 4; 5, 6])", "sparse([3, 0; 5, 0], \"number\")"], seealso: ["bignumber", "boolean", "complex", "index", "number", "string", "unit", "matrix"] };exports.sparseDocs = sparseDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/splitUnit.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.splitUnitDocs = void 0;var splitUnitDocs = { name: "splitUnit", category: "Construction", syntax: ["splitUnit(unit: Unit, parts: Unit[])"], description: "Split a unit in an array of units whose sum is equal to the original unit.", examples: ["splitUnit(1 m, [\"feet\", \"inch\"])"], seealso: ["unit", "createUnit"] };exports.splitUnitDocs = splitUnitDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/string.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.stringDocs = void 0;var stringDocs = { name: "string", category: "Construction", syntax: ["\"text\"", "string(x)"], description: "Create a string or convert a value to a string", examples: ["\"Hello World!\"", "string(4.2)", "string(3 + 2i)"], seealso: ["bignumber", "boolean", "complex", "index", "matrix", "number", "unit"] };exports.stringDocs = stringDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/unit.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.unitDocs = void 0;var unitDocs = { name: "unit", category: "Construction", syntax: ["value unit", "unit(value, unit)", "unit(string)"], description: "Create a unit.", examples: ["5.5 mm", "3 inch", "unit(7.1, \"kilogram\")", "unit(\"23 deg\")"], seealso: ["bignumber", "boolean", "complex", "index", "matrix", "number", "string"] };exports.unitDocs = unitDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/config.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.configDocs = void 0;var configDocs = { name: "config", category: "Core", syntax: ["config()", "config(options)"], description: "Get configuration or change configuration.", examples: ["config()", "1/3 + 1/4", "config({number: \"Fraction\"})", "1/3 + 1/4"], seealso: [] };exports.configDocs = configDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/import.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.importDocs = void 0;var importDocs = { name: "import", category: "Core", syntax: ["import(functions)", "import(functions, options)"], description: "Import functions or constants from an object.", examples: ["import({myFn: f(x)=x^2, myConstant: 32 })", "myFn(2)", "myConstant"], seealso: [] };exports.importDocs = importDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/typed.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.typedDocs = void 0;var typedDocs = { name: "typed", category: "Core", syntax: ["typed(signatures)", "typed(name, signatures)"], description: "Create a typed function.", examples: ["double = typed({ \"number, number\": f(x)=x+x })", "double(2)", "double(\"hello\")"], seealso: [] };exports.typedDocs = typedDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/embeddedDocs.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.embeddedDocs = void 0;var _bignumber = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bignumber.js"),_typeOf = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/typeOf.js"),_isZero = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isZero.js"),_isPrime = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPrime.js"),_isPositive = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPositive.js"),_isNumeric = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNumeric.js"),_hasNumericValue = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hasNumericValue.js"),_isNegative = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNegative.js"),_isInteger = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isInteger.js"),_isNaN = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNaN.js"),_format = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/format.js"),_bin = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/bin.js"),_oct = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/oct.js"),_hex = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hex.js"),_clone = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/clone.js"),_to = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/to.js"),_tanh = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tanh.js"),_tan = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tan.js"),_sinh = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sinh.js"),_sech = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sech.js"),_sec = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sec.js"),_csch = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csch.js"),_csc = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csc.js"),_coth = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/coth.js"),_cot = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cot.js"),_cosh = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cosh.js"),_cos = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cos.js"),_atan = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan2.js"),_atanh = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atanh.js"),_atan2 = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan.js"),_asinh = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asinh.js"),_asin = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asin.js"),_asech = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asech.js"),_asec = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asec.js"),_acsch = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsch.js"),_acsc = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsc.js"),_acoth = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acoth.js"),_acot = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acot.js"),_acosh = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acosh.js"),_acos = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acos.js"),_sum = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/sum.js"),_std = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/std.js"),_quantileSeq = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/quantileSeq.js"),_prod = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/prod.js"),_mode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mode.js"),_min = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/min.js"),_median = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/median.js"),_mean = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mean.js"),_max = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/max.js"),_mad = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mad.js"),_erf = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/erf.js"),_setUnion = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setUnion.js"),_setSymDifference = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSymDifference.js"),_setSize = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSize.js"),_setPowerset = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setPowerset.js"),_setMultiplicity = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setMultiplicity.js"),_setIsSubset = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIsSubset.js"),_setIntersect = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIntersect.js"),_setDistinct = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDistinct.js"),_setDifference = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDifference.js"),_setCartesian = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setCartesian.js"),_unequal = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/unequal.js"),_smallerEq = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smallerEq.js"),_smaller = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smaller.js"),_largerEq = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/largerEq.js"),_larger = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/larger.js"),_equalText = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equalText.js"),_equal = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equal.js"),_deepEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/deepEqual.js"),_compareText = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareText.js"),_compareNatural = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareNatural.js"),_compare = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compare.js"),_randomInt = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/randomInt.js"),_random = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/random.js"),_pickRandom = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/pickRandom.js"),_permutations = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/permutations.js"),_multinomial = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/multinomial.js"),_kldivergence = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/kldivergence.js"),_gamma = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/gamma.js"),_factorial = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/factorial.js"),_combinations = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinations.js"),_combinationsWithRep = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinationsWithRep.js"),_zeros = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/zeros.js"),_transpose = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/transpose.js"),_trace = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/trace.js"),_subset = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/subset.js"),_squeeze = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/squeeze.js"),_sort = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/sort.js"),_size = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/size.js"),_diff = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diff.js"),_reshape = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/reshape.js"),_resize = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/resize.js"),_range = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/range.js"),_partitionSelect = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/partitionSelect.js"),_ones = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ones.js"),_map = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/map.js"),_kron = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/kron.js"),_inv = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/inv.js"),_forEach = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/forEach.js"),_flatten = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/flatten.js"),_filter = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/filter.js"),_identity = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/identity.js"),_getMatrixDataType = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/getMatrixDataType.js"),_dot = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/dot.js"),_diag = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diag.js"),_det = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/det.js"),_ctranspose = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ctranspose.js"),_cross = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/cross.js"),_concat = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/concat.js"),_count = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/count.js"),_xor = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/xor.js"),_or = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/or.js"),_not = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/not.js"),_and = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/and.js"),_intersect = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/intersect.js"),_distance = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/distance.js"),_help = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/help.js"),_evaluate = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/evaluate.js"),_im = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/im.js"),_re = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/re.js"),_conj = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/conj.js"),_arg = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/arg.js"),_typed = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/typed.js"),_import = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/import.js"),_config = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/config.js"),_stirlingS = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/stirlingS2.js"),_composition = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/composition.js"),_catalan = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/catalan.js"),_bellNumbers = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/bellNumbers.js"),_rightLogShift = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightLogShift.js"),_rightArithShift = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightArithShift.js"),_leftShift = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/leftShift.js"),_bitXor = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitXor.js"),_bitOr = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitOr.js"),_bitNot = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitNot.js"),_bitAnd = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitAnd.js"),_xgcd = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/xgcd.js"),_unaryPlus = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryPlus.js"),_unaryMinus = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryMinus.js"),_square = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/square.js"),_sqrtm = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrtm.js"),_sqrt = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrt.js"),_sign = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sign.js"),_round = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/round.js"),_pow = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/pow.js"),_nthRoots = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoots.js"),_nthRoot = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoot.js"),_norm = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/norm.js"),_multiply = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/multiply.js"),_mod = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/mod.js"),_log = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log10.js"),_log1p = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log1p.js"),_log2 = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log2.js"),_log3 = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log.js"),_lcm = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/lcm.js"),_hypot = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/hypot.js"),_gcd = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/gcd.js"),_floor = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js"),_fix = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js"),_expm = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm1.js"),_expm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm.js"),_eigs = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/eigs.js"),_exp = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/exp.js"),_dotMultiply = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotMultiply.js"),_dotDivide = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotDivide.js"),_divide = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/divide.js"),_cube = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cube.js"),_ceil = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js"),_cbrt = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cbrt.js"),_add = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/add.js"),_abs = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/abs.js"),_qr = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/qr.js"),_usolve = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolve.js"),_usolveAll = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolveAll.js"),_slu = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/slu.js"),_rationalize = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/rationalize.js"),_simplify = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplify.js"),_lup = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lup.js"),_lsolve = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolve.js"),_lsolveAll = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolveAll.js"),_derivative = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/derivative.js"),_version = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/version.js"),_true = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/true.js"),_tau = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/tau.js"),_SQRT = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT2.js"),_SQRT1_ = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT1_2.js"),_phi = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/phi.js"),_pi = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/pi.js"),_null = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/null.js"),_NaN = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/NaN.js"),_LOG10E = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG10E.js"),_LOG2E = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG2E.js"),_LN = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN10.js"),_LN2 = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN2.js"),_Infinity = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/Infinity.js"),_i = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/i.js"),_false = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/false.js"),_e = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/e.js"),_unit = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/unit.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/string.js"),_splitUnit = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/splitUnit.js"),_sparse = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/sparse.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/number.js"),_matrix = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/matrix.js"),_matrixFromFunction = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromFunction.js"),_matrixFromRows = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromRows.js"),_matrixFromColumns = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromColumns.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/index.js"),_fraction = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/fraction.js"),_createUnit = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/createUnit.js"),_complex = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/complex.js"),_boolean = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/boolean.js"),_dotPow = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotPow.js"),_lusolve = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lusolve.js"),_subtract = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/subtract.js"),_variance = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/variance.js"),_sin = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sin.js"),_numeric = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/numeric.js"),_column = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/column.js"),_row = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/row.js"),_rotationMatrix = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotationMatrix.js"),_rotate = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotate.js"),embeddedDocs = { bignumber: _bignumber.bignumberDocs, boolean: _boolean.booleanDocs, complex: _complex.complexDocs, createUnit: _createUnit.createUnitDocs, fraction: _fraction.fractionDocs, index: _index.indexDocs, matrix: _matrix.matrixDocs, number: _number.numberDocs, sparse: _sparse.sparseDocs, splitUnit: _splitUnit.splitUnitDocs, string: _string.stringDocs, unit: _unit.unitDocs, e: _e.eDocs, E: _e.eDocs, false: _false.falseDocs, i: _i.iDocs, Infinity: _Infinity.InfinityDocs, LN2: _LN2.LN2Docs, LN10: _LN.LN10Docs, LOG2E: _LOG2E.LOG2EDocs, LOG10E: _LOG10E.LOG10EDocs, NaN: _NaN.NaNDocs, null: _null.nullDocs, pi: _pi.piDocs, PI: _pi.piDocs, phi: _phi.phiDocs, SQRT1_2: _SQRT1_.SQRT12Docs, SQRT2: _SQRT.SQRT2Docs, tau: _tau.tauDocs, true: _true.trueDocs, version: _version.versionDocs, speedOfLight: { description: "Speed of light in vacuum", examples: ["speedOfLight"] }, gravitationConstant: { description: "Newtonian constant of gravitation", examples: ["gravitationConstant"] }, planckConstant: { description: "Planck constant", examples: ["planckConstant"] }, reducedPlanckConstant: { description: "Reduced Planck constant", examples: ["reducedPlanckConstant"] }, magneticConstant: { description: "Magnetic constant (vacuum permeability)", examples: ["magneticConstant"] }, electricConstant: { description: "Electric constant (vacuum permeability)", examples: ["electricConstant"] }, vacuumImpedance: { description: "Characteristic impedance of vacuum", examples: ["vacuumImpedance"] }, coulomb: { description: "Coulomb's constant", examples: ["coulomb"] }, elementaryCharge: { description: "Elementary charge", examples: ["elementaryCharge"] }, bohrMagneton: { description: "Borh magneton", examples: ["bohrMagneton"] }, conductanceQuantum: { description: "Conductance quantum", examples: ["conductanceQuantum"] }, inverseConductanceQuantum: { description: "Inverse conductance quantum", examples: ["inverseConductanceQuantum"] }, magneticFluxQuantum: { description: "Magnetic flux quantum", examples: ["magneticFluxQuantum"] }, nuclearMagneton: { description: "Nuclear magneton", examples: ["nuclearMagneton"] }, klitzing: { description: "Von Klitzing constant", examples: ["klitzing"] }, bohrRadius: { description: "Borh radius", examples: ["bohrRadius"] }, classicalElectronRadius: { description: "Classical electron radius", examples: ["classicalElectronRadius"] }, electronMass: { description: "Electron mass", examples: ["electronMass"] }, fermiCoupling: { description: "Fermi coupling constant", examples: ["fermiCoupling"] }, fineStructure: { description: "Fine-structure constant", examples: ["fineStructure"] }, hartreeEnergy: { description: "Hartree energy", examples: ["hartreeEnergy"] }, protonMass: { description: "Proton mass", examples: ["protonMass"] }, deuteronMass: { description: "Deuteron Mass", examples: ["deuteronMass"] }, neutronMass: { description: "Neutron mass", examples: ["neutronMass"] }, quantumOfCirculation: { description: "Quantum of circulation", examples: ["quantumOfCirculation"] }, rydberg: { description: "Rydberg constant", examples: ["rydberg"] }, thomsonCrossSection: { description: "Thomson cross section", examples: ["thomsonCrossSection"] }, weakMixingAngle: { description: "Weak mixing angle", examples: ["weakMixingAngle"] }, efimovFactor: { description: "Efimov factor", examples: ["efimovFactor"] }, atomicMass: { description: "Atomic mass constant", examples: ["atomicMass"] }, avogadro: { description: "Avogadro's number", examples: ["avogadro"] }, boltzmann: { description: "Boltzmann constant", examples: ["boltzmann"] }, faraday: { description: "Faraday constant", examples: ["faraday"] }, firstRadiation: { description: "First radiation constant", examples: ["firstRadiation"] }, loschmidt: { description: "Loschmidt constant at T=273.15 K and p=101.325 kPa", examples: ["loschmidt"] }, gasConstant: { description: "Gas constant", examples: ["gasConstant"] }, molarPlanckConstant: { description: "Molar Planck constant", examples: ["molarPlanckConstant"] }, molarVolume: { description: "Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa", examples: ["molarVolume"] }, sackurTetrode: { description: "Sackur-Tetrode constant at T=1 K and p=101.325 kPa", examples: ["sackurTetrode"] }, secondRadiation: { description: "Second radiation constant", examples: ["secondRadiation"] }, stefanBoltzmann: { description: "Stefan-Boltzmann constant", examples: ["stefanBoltzmann"] }, wienDisplacement: { description: "Wien displacement law constant", examples: ["wienDisplacement"] }, molarMass: { description: "Molar mass constant", examples: ["molarMass"] }, molarMassC12: { description: "Molar mass constant of carbon-12", examples: ["molarMassC12"] }, gravity: { description: "Standard acceleration of gravity (standard acceleration of free-fall on Earth)", examples: ["gravity"] }, planckLength: { description: "Planck length", examples: ["planckLength"] }, planckMass: { description: "Planck mass", examples: ["planckMass"] }, planckTime: { description: "Planck time", examples: ["planckTime"] }, planckCharge: { description: "Planck charge", examples: ["planckCharge"] }, planckTemperature: { description: "Planck temperature", examples: ["planckTemperature"] }, derivative: _derivative.derivativeDocs, lsolve: _lsolve.lsolveDocs, lsolveAll: _lsolveAll.lsolveAllDocs, lup: _lup.lupDocs, lusolve: _lusolve.lusolveDocs, simplify: _simplify.simplifyDocs, rationalize: _rationalize.rationalizeDocs, slu: _slu.sluDocs, usolve: _usolve.usolveDocs, usolveAll: _usolveAll.usolveAllDocs, qr: _qr.qrDocs, abs: _abs.absDocs, add: _add.addDocs, cbrt: _cbrt.cbrtDocs, ceil: _ceil.ceilDocs, cube: _cube.cubeDocs, divide: _divide.divideDocs, dotDivide: _dotDivide.dotDivideDocs, dotMultiply: _dotMultiply.dotMultiplyDocs, dotPow: _dotPow.dotPowDocs, exp: _exp.expDocs, expm: _expm2.expmDocs, expm1: _expm.expm1Docs, fix: _fix.fixDocs, floor: _floor.floorDocs, gcd: _gcd.gcdDocs, hypot: _hypot.hypotDocs, lcm: _lcm.lcmDocs, log: _log3.logDocs, log2: _log2.log2Docs, log1p: _log1p.log1pDocs, log10: _log.log10Docs, mod: _mod.modDocs, multiply: _multiply.multiplyDocs, norm: _norm.normDocs, nthRoot: _nthRoot.nthRootDocs, nthRoots: _nthRoots.nthRootsDocs, pow: _pow.powDocs, round: _round.roundDocs, sign: _sign.signDocs, sqrt: _sqrt.sqrtDocs, sqrtm: _sqrtm.sqrtmDocs, square: _square.squareDocs, subtract: _subtract.subtractDocs, unaryMinus: _unaryMinus.unaryMinusDocs, unaryPlus: _unaryPlus.unaryPlusDocs, xgcd: _xgcd.xgcdDocs, bitAnd: _bitAnd.bitAndDocs, bitNot: _bitNot.bitNotDocs, bitOr: _bitOr.bitOrDocs, bitXor: _bitXor.bitXorDocs, leftShift: _leftShift.leftShiftDocs, rightArithShift: _rightArithShift.rightArithShiftDocs, rightLogShift: _rightLogShift.rightLogShiftDocs, bellNumbers: _bellNumbers.bellNumbersDocs, catalan: _catalan.catalanDocs, composition: _composition.compositionDocs, stirlingS2: _stirlingS.stirlingS2Docs, config: _config.configDocs, import: _import.importDocs, typed: _typed.typedDocs, arg: _arg.argDocs, conj: _conj.conjDocs, re: _re.reDocs, im: _im.imDocs, evaluate: _evaluate.evaluateDocs, help: _help.helpDocs, distance: _distance.distanceDocs, intersect: _intersect.intersectDocs, and: _and.andDocs, not: _not.notDocs, or: _or.orDocs, xor: _xor.xorDocs, concat: _concat.concatDocs, count: _count.countDocs, cross: _cross.crossDocs, column: _column.columnDocs, ctranspose: _ctranspose.ctransposeDocs, det: _det.detDocs, diag: _diag.diagDocs, diff: _diff.diffDocs, dot: _dot.dotDocs, getMatrixDataType: _getMatrixDataType.getMatrixDataTypeDocs, identity: _identity.identityDocs, filter: _filter.filterDocs, flatten: _flatten.flattenDocs, forEach: _forEach.forEachDocs, inv: _inv.invDocs, eigs: _eigs.eigsDocs, kron: _kron.kronDocs, matrixFromFunction: _matrixFromFunction.matrixFromFunctionDocs, matrixFromRows: _matrixFromRows.matrixFromRowsDocs, matrixFromColumns: _matrixFromColumns.matrixFromColumnsDocs, map: _map.mapDocs, ones: _ones.onesDocs, partitionSelect: _partitionSelect.partitionSelectDocs, range: _range.rangeDocs, resize: _resize.resizeDocs, reshape: _reshape.reshapeDocs, rotate: _rotate.rotateDocs, rotationMatrix: _rotationMatrix.rotationMatrixDocs, row: _row.rowDocs, size: _size.sizeDocs, sort: _sort.sortDocs, squeeze: _squeeze.squeezeDocs, subset: _subset.subsetDocs, trace: _trace.traceDocs, transpose: _transpose.transposeDocs, zeros: _zeros.zerosDocs, combinations: _combinations.combinationsDocs, combinationsWithRep: _combinationsWithRep.combinationsWithRepDocs, factorial: _factorial.factorialDocs, gamma: _gamma.gammaDocs, kldivergence: _kldivergence.kldivergenceDocs, multinomial: _multinomial.multinomialDocs, permutations: _permutations.permutationsDocs, pickRandom: _pickRandom.pickRandomDocs, random: _random.randomDocs, randomInt: _randomInt.randomIntDocs, compare: _compare.compareDocs, compareNatural: _compareNatural.compareNaturalDocs, compareText: _compareText.compareTextDocs, deepEqual: _deepEqual.deepEqualDocs, equal: _equal.equalDocs, equalText: _equalText.equalTextDocs, larger: _larger.largerDocs, largerEq: _largerEq.largerEqDocs, smaller: _smaller.smallerDocs, smallerEq: _smallerEq.smallerEqDocs, unequal: _unequal.unequalDocs, setCartesian: _setCartesian.setCartesianDocs, setDifference: _setDifference.setDifferenceDocs, setDistinct: _setDistinct.setDistinctDocs, setIntersect: _setIntersect.setIntersectDocs, setIsSubset: _setIsSubset.setIsSubsetDocs, setMultiplicity: _setMultiplicity.setMultiplicityDocs, setPowerset: _setPowerset.setPowersetDocs, setSize: _setSize.setSizeDocs, setSymDifference: _setSymDifference.setSymDifferenceDocs, setUnion: _setUnion.setUnionDocs, erf: _erf.erfDocs, mad: _mad.madDocs, max: _max.maxDocs, mean: _mean.meanDocs, median: _median.medianDocs, min: _min.minDocs, mode: _mode.modeDocs, prod: _prod.prodDocs, quantileSeq: _quantileSeq.quantileSeqDocs, std: _std.stdDocs, sum: _sum.sumDocs, variance: _variance.varianceDocs, acos: _acos.acosDocs, acosh: _acosh.acoshDocs, acot: _acot.acotDocs, acoth: _acoth.acothDocs, acsc: _acsc.acscDocs, acsch: _acsch.acschDocs, asec: _asec.asecDocs, asech: _asech.asechDocs, asin: _asin.asinDocs, asinh: _asinh.asinhDocs, atan: _atan2.atanDocs, atanh: _atanh.atanhDocs, atan2: _atan.atan2Docs, cos: _cos.cosDocs, cosh: _cosh.coshDocs, cot: _cot.cotDocs, coth: _coth.cothDocs, csc: _csc.cscDocs, csch: _csch.cschDocs, sec: _sec.secDocs, sech: _sech.sechDocs, sin: _sin.sinDocs, sinh: _sinh.sinhDocs, tan: _tan.tanDocs, tanh: _tanh.tanhDocs, to: _to.toDocs, clone: _clone.cloneDocs, format: _format.formatDocs, bin: _bin.binDocs, oct: _oct.octDocs, hex: _hex.hexDocs, isNaN: _isNaN.isNaNDocs, isInteger: _isInteger.isIntegerDocs, isNegative: _isNegative.isNegativeDocs, isNumeric: _isNumeric.isNumericDocs, hasNumericValue: _hasNumericValue.hasNumericValueDocs, isPositive: _isPositive.isPositiveDocs, isPrime: _isPrime.isPrimeDocs, isZero: _isZero.isZeroDocs, typeOf: _typeOf.typeOfDocs, numeric: _numeric.numericDocs };exports.embeddedDocs = embeddedDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/derivative.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.derivativeDocs = void 0;var derivativeDocs = { name: "derivative", category: "Algebra", syntax: ["derivative(expr, variable)", "derivative(expr, variable, {simplify: boolean})"], description: "Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.", examples: ["derivative(\"2x^3\", \"x\")", "derivative(\"2x^3\", \"x\", {simplify: false})", "derivative(\"2x^2 + 3x + 4\", \"x\")", "derivative(\"sin(2x)\", \"x\")", "f = parse(\"x^2 + x\")", "x = parse(\"x\")", "df = derivative(f, x)", "df.evaluate({x: 3})"], seealso: ["simplify", "parse", "evaluate"] };exports.derivativeDocs = derivativeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolve.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lsolveDocs = void 0;var lsolveDocs = { name: "lsolve", category: "Algebra", syntax: ["x=lsolve(L, b)"], description: "Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.", examples: ["a = [-2, 3; 2, 1]", "b = [11, 9]", "x = lsolve(a, b)"], seealso: ["lsolveAll", "lup", "lusolve", "usolve", "matrix", "sparse"] };exports.lsolveDocs = lsolveDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolveAll.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lsolveAllDocs = void 0;var lsolveAllDocs = { name: "lsolveAll", category: "Algebra", syntax: ["x=lsolveAll(L, b)"], description: "Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.", examples: ["a = [-2, 3; 2, 1]", "b = [11, 9]", "x = lsolve(a, b)"], seealso: ["lsolve", "lup", "lusolve", "usolve", "matrix", "sparse"] };exports.lsolveAllDocs = lsolveAllDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lup.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lupDocs = void 0;var lupDocs = { name: "lup", category: "Algebra", syntax: ["lup(m)"], description: "Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U", examples: ["lup([[2, 1], [1, 4]])", "lup(matrix([[2, 1], [1, 4]]))", "lup(sparse([[2, 1], [1, 4]]))"], seealso: ["lusolve", "lsolve", "usolve", "matrix", "sparse", "slu", "qr"] };exports.lupDocs = lupDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lusolve.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lusolveDocs = void 0;var lusolveDocs = { name: "lusolve", category: "Algebra", syntax: ["x=lusolve(A, b)", "x=lusolve(lu, b)"], description: "Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.", examples: ["a = [-2, 3; 2, 1]", "b = [11, 9]", "x = lusolve(a, b)"], seealso: ["lup", "slu", "lsolve", "usolve", "matrix", "sparse"] };exports.lusolveDocs = lusolveDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/qr.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.qrDocs = void 0;var qrDocs = { name: "qr", category: "Algebra", syntax: ["qr(A)"], description: "Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.", examples: ["qr([[1, -1,  4], [1,  4, -2], [1,  4,  2], [1,  -1, 0]])"], seealso: ["lup", "slu", "matrix"] };exports.qrDocs = qrDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/rationalize.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rationalizeDocs = void 0;var rationalizeDocs = { name: "rationalize", category: "Algebra", syntax: ["rationalize(expr)", "rationalize(expr, scope)", "rationalize(expr, scope, detailed)"], description: "Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.", examples: ["rationalize(\"2x/y - y/(x+1)\")", "rationalize(\"2x/y - y/(x+1)\", true)"], seealso: ["simplify"] };exports.rationalizeDocs = rationalizeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplify.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.simplifyDocs = void 0;var simplifyDocs = { name: "simplify", category: "Algebra", syntax: ["simplify(expr)", "simplify(expr, rules)"], description: "Simplify an expression tree.", examples: ["simplify(\"3 + 2 / 4\")", "simplify(\"2x + x\")", "f = parse(\"x * (x + 2 + x)\")", "simplified = simplify(f)", "simplified.evaluate({x: 2})"], seealso: ["derivative", "parse", "evaluate"] };exports.simplifyDocs = simplifyDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/slu.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sluDocs = void 0;var sluDocs = { name: "slu", category: "Algebra", syntax: ["slu(A, order, threshold)"], description: "Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U", examples: ["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"], seealso: ["lusolve", "lsolve", "usolve", "matrix", "sparse", "lup", "qr"] };exports.sluDocs = sluDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolve.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.usolveDocs = void 0;var usolveDocs = { name: "usolve", category: "Algebra", syntax: ["x=usolve(U, b)"], description: "Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.", examples: ["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"], seealso: ["usolveAll", "lup", "lusolve", "lsolve", "matrix", "sparse"] };exports.usolveDocs = usolveDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolveAll.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.usolveAllDocs = void 0;var usolveAllDocs = { name: "usolveAll", category: "Algebra", syntax: ["x=usolve(U, b)"], description: "Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.", examples: ["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"], seealso: ["usolve", "lup", "lusolve", "lsolve", "matrix", "sparse"] };exports.usolveAllDocs = usolveAllDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/abs.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.absDocs = void 0;var absDocs = { name: "abs", category: "Arithmetic", syntax: ["abs(x)"], description: "Compute the absolute value.", examples: ["abs(3.5)", "abs(-4.2)"], seealso: ["sign"] };exports.absDocs = absDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/add.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.addDocs = void 0;var addDocs = { name: "add", category: "Operators", syntax: ["x + y", "add(x, y)"], description: "Add two values.", examples: ["a = 2.1 + 3.6", "a - 3.6", "3 + 2i", "3 cm + 2 inch", "\"2.3\" + \"4\""], seealso: ["subtract"] };exports.addDocs = addDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cbrt.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cbrtDocs = void 0;var cbrtDocs = { name: "cbrt", category: "Arithmetic", syntax: ["cbrt(x)", "cbrt(x, allRoots)"], description: "Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned", examples: ["cbrt(64)", "cube(4)", "cbrt(-8)", "cbrt(2 + 3i)", "cbrt(8i)", "cbrt(8i, true)", "cbrt(27 m^3)"], seealso: ["square", "sqrt", "cube", "multiply"] };exports.cbrtDocs = cbrtDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ceilDocs = void 0;var ceilDocs = { name: "ceil", category: "Arithmetic", syntax: ["ceil(x)"], description: "Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.", examples: ["ceil(3.2)", "ceil(3.8)", "ceil(-4.2)"], seealso: ["floor", "fix", "round"] };exports.ceilDocs = ceilDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cube.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cubeDocs = void 0;var cubeDocs = { name: "cube", category: "Arithmetic", syntax: ["cube(x)"], description: "Compute the cube of a value. The cube of x is x * x * x.", examples: ["cube(2)", "2^3", "2 * 2 * 2"], seealso: ["multiply", "square", "pow"] };exports.cubeDocs = cubeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/divide.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.divideDocs = void 0;var divideDocs = { name: "divide", category: "Operators", syntax: ["x / y", "divide(x, y)"], description: "Divide two values.", examples: ["a = 2 / 3", "a * 3", "4.5 / 2", "3 + 4 / 2", "(3 + 4) / 2", "18 km / 4.5"], seealso: ["multiply"] };exports.divideDocs = divideDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotDivide.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.dotDivideDocs = void 0;var dotDivideDocs = { name: "dotDivide", category: "Operators", syntax: ["x ./ y", "dotDivide(x, y)"], description: "Divide two values element wise.", examples: ["a = [1, 2, 3; 4, 5, 6]", "b = [2, 1, 1; 3, 2, 5]", "a ./ b"], seealso: ["multiply", "dotMultiply", "divide"] };exports.dotDivideDocs = dotDivideDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotMultiply.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.dotMultiplyDocs = void 0;var dotMultiplyDocs = { name: "dotMultiply", category: "Operators", syntax: ["x .* y", "dotMultiply(x, y)"], description: "Multiply two values element wise.", examples: ["a = [1, 2, 3; 4, 5, 6]", "b = [2, 1, 1; 3, 2, 5]", "a .* b"], seealso: ["multiply", "divide", "dotDivide"] };exports.dotMultiplyDocs = dotMultiplyDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotPow.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.dotPowDocs = void 0;var dotPowDocs = { name: "dotPow", category: "Operators", syntax: ["x .^ y", "dotPow(x, y)"], description: "Calculates the power of x to y element wise.", examples: ["a = [1, 2, 3; 4, 5, 6]", "a .^ 2"], seealso: ["pow"] };exports.dotPowDocs = dotPowDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/exp.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.expDocs = void 0;var expDocs = { name: "exp", category: "Arithmetic", syntax: ["exp(x)"], description: "Calculate the exponent of a value.", examples: ["exp(1.3)", "e ^ 1.3", "log(exp(1.3))", "x = 2.4", "(exp(i*x) == cos(x) + i*sin(x))   # Euler's formula"], seealso: ["expm", "expm1", "pow", "log"] };exports.expDocs = expDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.expmDocs = void 0;var expmDocs = { name: "expm", category: "Arithmetic", syntax: ["exp(x)"], description: "Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.", examples: ["expm([[0,2],[0,0]])"], seealso: ["exp"] };exports.expmDocs = expmDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm1.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.expm1Docs = void 0;var expm1Docs = { name: "expm1", category: "Arithmetic", syntax: ["expm1(x)"], description: "Calculate the value of subtracting 1 from the exponential value.", examples: ["expm1(2)", "pow(e, 2) - 1", "log(expm1(2) + 1)"], seealso: ["exp", "pow", "log"] };exports.expm1Docs = expm1Docs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.fixDocs = void 0;var fixDocs = { name: "fix", category: "Arithmetic", syntax: ["fix(x)"], description: "Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.", examples: ["fix(3.2)", "fix(3.8)", "fix(-4.2)", "fix(-4.8)"], seealso: ["ceil", "floor", "round"] };exports.fixDocs = fixDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.floorDocs = void 0;var floorDocs = { name: "floor", category: "Arithmetic", syntax: ["floor(x)"], description: "Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.", examples: ["floor(3.2)", "floor(3.8)", "floor(-4.2)"], seealso: ["ceil", "fix", "round"] };exports.floorDocs = floorDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/gcd.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.gcdDocs = void 0;var gcdDocs = { name: "gcd", category: "Arithmetic", syntax: ["gcd(a, b)", "gcd(a, b, c, ...)"], description: "Compute the greatest common divisor.", examples: ["gcd(8, 12)", "gcd(-4, 6)", "gcd(25, 15, -10)"], seealso: ["lcm", "xgcd"] };exports.gcdDocs = gcdDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/hypot.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.hypotDocs = void 0;var hypotDocs = { name: "hypot", category: "Arithmetic", syntax: ["hypot(a, b, c, ...)", "hypot([a, b, c, ...])"], description: "Calculate the hypotenusa of a list with values. ", examples: ["hypot(3, 4)", "sqrt(3^2 + 4^2)", "hypot(-2)", "hypot([3, 4, 5])"], seealso: ["abs", "norm"] };exports.hypotDocs = hypotDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/lcm.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lcmDocs = void 0;var lcmDocs = { name: "lcm", category: "Arithmetic", syntax: ["lcm(x, y)"], description: "Compute the least common multiple.", examples: ["lcm(4, 6)", "lcm(6, 21)", "lcm(6, 21, 5)"], seealso: ["gcd"] };exports.lcmDocs = lcmDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.logDocs = void 0;var logDocs = { name: "log", category: "Arithmetic", syntax: ["log(x)", "log(x, base)"], description: "Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).", examples: ["log(3.5)", "a = log(2.4)", "exp(a)", "10 ^ 4", "log(10000, 10)", "log(10000) / log(10)", "b = log(1024, 2)", "2 ^ b"], seealso: ["exp", "log1p", "log2", "log10"] };exports.logDocs = logDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log10.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.log10Docs = void 0;var log10Docs = { name: "log10", category: "Arithmetic", syntax: ["log10(x)"], description: "Compute the 10-base logarithm of a value.", examples: ["log10(0.00001)", "log10(10000)", "10 ^ 4", "log(10000) / log(10)", "log(10000, 10)"], seealso: ["exp", "log"] };exports.log10Docs = log10Docs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log1p.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.log1pDocs = void 0;var log1pDocs = { name: "log1p", category: "Arithmetic", syntax: ["log1p(x)", "log1p(x, base)"], description: "Calculate the logarithm of a `value+1`", examples: ["log1p(2.5)", "exp(log1p(1.4))", "pow(10, 4)", "log1p(9999, 10)", "log1p(9999) / log(10)"], seealso: ["exp", "log", "log2", "log10"] };exports.log1pDocs = log1pDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log2.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.log2Docs = void 0;var log2Docs = { name: "log2", category: "Arithmetic", syntax: ["log2(x)"], description: "Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.", examples: ["log2(0.03125)", "log2(16)", "log2(16) / log2(2)", "pow(2, 4)"], seealso: ["exp", "log1p", "log", "log10"] };exports.log2Docs = log2Docs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/mod.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.modDocs = void 0;var modDocs = { name: "mod", category: "Operators", syntax: ["x % y", "x mod y", "mod(x, y)"], description: "Calculates the modulus, the remainder of an integer division.", examples: ["7 % 3", "11 % 2", "10 mod 4", "isOdd(x) = x % 2", "isOdd(2)", "isOdd(3)"], seealso: ["divide"] };exports.modDocs = modDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/multiply.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.multiplyDocs = void 0;var multiplyDocs = { name: "multiply", category: "Operators", syntax: ["x * y", "multiply(x, y)"], description: "multiply two values.", examples: ["a = 2.1 * 3.4", "a / 3.4", "2 * 3 + 4", "2 * (3 + 4)", "3 * 2.1 km"], seealso: ["divide"] };exports.multiplyDocs = multiplyDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/norm.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.normDocs = void 0;var normDocs = { name: "norm", category: "Arithmetic", syntax: ["norm(x)", "norm(x, p)"], description: "Calculate the norm of a number, vector or matrix.", examples: ["abs(-3.5)", "norm(-3.5)", "norm(3 - 4i)", "norm([1, 2, -3], Infinity)", "norm([1, 2, -3], -Infinity)", "norm([3, 4], 2)", "norm([[1, 2], [3, 4]], 1)", "norm([[1, 2], [3, 4]], \"inf\")", "norm([[1, 2], [3, 4]], \"fro\")"] };exports.normDocs = normDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoot.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.nthRootDocs = void 0;var nthRootDocs = { name: "nthRoot", category: "Arithmetic", syntax: ["nthRoot(a)", "nthRoot(a, root)"], description: "Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation \"x^root = A\".", examples: ["4 ^ 3", "nthRoot(64, 3)", "nthRoot(9, 2)", "sqrt(9)"], seealso: ["nthRoots", "pow", "sqrt"] };exports.nthRootDocs = nthRootDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoots.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.nthRootsDocs = void 0;var nthRootsDocs = { name: "nthRoots", category: "Arithmetic", syntax: ["nthRoots(A)", "nthRoots(A, root)"], description: "Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation \"x^root = A\". This function returns an array of complex values.", examples: ["nthRoots(1)", "nthRoots(1, 3)"], seealso: ["sqrt", "pow", "nthRoot"] };exports.nthRootsDocs = nthRootsDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/pow.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.powDocs = void 0;var powDocs = { name: "pow", category: "Operators", syntax: ["x ^ y", "pow(x, y)"], description: "Calculates the power of x to y, x^y.", examples: ["2^3", "2*2*2", "1 + e ^ (pi * i)"], seealso: ["multiply", "nthRoot", "nthRoots", "sqrt"] };exports.powDocs = powDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/round.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.roundDocs = void 0;var roundDocs = { name: "round", category: "Arithmetic", syntax: ["round(x)", "round(x, n)"], description: "round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.", examples: ["round(3.2)", "round(3.8)", "round(-4.2)", "round(-4.8)", "round(pi, 3)", "round(123.45678, 2)"], seealso: ["ceil", "floor", "fix"] };exports.roundDocs = roundDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sign.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.signDocs = void 0;var signDocs = { name: "sign", category: "Arithmetic", syntax: ["sign(x)"], description: "Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.", examples: ["sign(3.5)", "sign(-4.2)", "sign(0)"], seealso: ["abs"] };exports.signDocs = signDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrt.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sqrtDocs = void 0;var sqrtDocs = { name: "sqrt", category: "Arithmetic", syntax: ["sqrt(x)"], description: "Compute the square root value. If x = y * y, then y is the square root of x.", examples: ["sqrt(25)", "5 * 5", "sqrt(-1)"], seealso: ["square", "sqrtm", "multiply", "nthRoot", "nthRoots", "pow"] };exports.sqrtDocs = sqrtDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrtm.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sqrtmDocs = void 0;var sqrtmDocs = { name: "sqrtm", category: "Arithmetic", syntax: ["sqrtm(x)"], description: "Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.", examples: ["sqrtm([[1, 2], [3, 4]])"], seealso: ["sqrt", "abs", "square", "multiply"] };exports.sqrtmDocs = sqrtmDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/square.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.squareDocs = void 0;var squareDocs = { name: "square", category: "Arithmetic", syntax: ["square(x)"], description: "Compute the square of a value. The square of x is x * x.", examples: ["square(3)", "sqrt(9)", "3^2", "3 * 3"], seealso: ["multiply", "pow", "sqrt", "cube"] };exports.squareDocs = squareDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/subtract.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.subtractDocs = void 0;var subtractDocs = { name: "subtract", category: "Operators", syntax: ["x - y", "subtract(x, y)"], description: "subtract two values.", examples: ["a = 5.3 - 2", "a + 2", "2/3 - 1/6", "2 * 3 - 3", "2.1 km - 500m"], seealso: ["add"] };exports.subtractDocs = subtractDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryMinus.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.unaryMinusDocs = void 0;var unaryMinusDocs = { name: "unaryMinus", category: "Operators", syntax: ["-x", "unaryMinus(x)"], description: "Inverse the sign of a value. Converts booleans and strings to numbers.", examples: ["-4.5", "-(-5.6)", "-\"22\""], seealso: ["add", "subtract", "unaryPlus"] };exports.unaryMinusDocs = unaryMinusDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryPlus.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.unaryPlusDocs = void 0;var unaryPlusDocs = { name: "unaryPlus", category: "Operators", syntax: ["+x", "unaryPlus(x)"], description: "Converts booleans and strings to numbers.", examples: ["+true", "+\"2\""], seealso: ["add", "subtract", "unaryMinus"] };exports.unaryPlusDocs = unaryPlusDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/xgcd.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.xgcdDocs = void 0;var xgcdDocs = { name: "xgcd", category: "Arithmetic", syntax: ["xgcd(a, b)"], description: "Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.", examples: ["xgcd(8, 12)", "gcd(8, 12)", "xgcd(36163, 21199)"], seealso: ["gcd", "lcm"] };exports.xgcdDocs = xgcdDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitAnd.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitAndDocs = void 0;var bitAndDocs = { name: "bitAnd", category: "Bitwise", syntax: ["x & y", "bitAnd(x, y)"], description: "Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0", examples: ["5 & 3", "bitAnd(53, 131)", "[1, 12, 31] & 42"], seealso: ["bitNot", "bitOr", "bitXor", "leftShift", "rightArithShift", "rightLogShift"] };exports.bitAndDocs = bitAndDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitNot.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitNotDocs = void 0;var bitNotDocs = { name: "bitNot", category: "Bitwise", syntax: ["~x", "bitNot(x)"], description: "Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.", examples: ["~1", "~2", "bitNot([2, -3, 4])"], seealso: ["bitAnd", "bitOr", "bitXor", "leftShift", "rightArithShift", "rightLogShift"] };exports.bitNotDocs = bitNotDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitOr.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitOrDocs = void 0;var bitOrDocs = { name: "bitOr", category: "Bitwise", syntax: ["x | y", "bitOr(x, y)"], description: "Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.", examples: ["5 | 3", "bitOr([1, 2, 3], 4)"], seealso: ["bitAnd", "bitNot", "bitXor", "leftShift", "rightArithShift", "rightLogShift"] };exports.bitOrDocs = bitOrDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitXor.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitXorDocs = void 0;var bitXorDocs = { name: "bitXor", category: "Bitwise", syntax: ["bitXor(x, y)"], description: "Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.", examples: ["bitOr(1, 2)", "bitXor([2, 3, 4], 4)"], seealso: ["bitAnd", "bitNot", "bitOr", "leftShift", "rightArithShift", "rightLogShift"] };exports.bitXorDocs = bitXorDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/leftShift.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.leftShiftDocs = void 0;var leftShiftDocs = { name: "leftShift", category: "Bitwise", syntax: ["x << y", "leftShift(x, y)"], description: "Bitwise left logical shift of a value x by y number of bits.", examples: ["4 << 1", "8 >> 1"], seealso: ["bitAnd", "bitNot", "bitOr", "bitXor", "rightArithShift", "rightLogShift"] };exports.leftShiftDocs = leftShiftDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightArithShift.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rightArithShiftDocs = void 0;var rightArithShiftDocs = { name: "rightArithShift", category: "Bitwise", syntax: ["x >> y", "rightArithShift(x, y)"], description: "Bitwise right arithmetic shift of a value x by y number of bits.", examples: ["8 >> 1", "4 << 1", "-12 >> 2"], seealso: ["bitAnd", "bitNot", "bitOr", "bitXor", "leftShift", "rightLogShift"] };exports.rightArithShiftDocs = rightArithShiftDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightLogShift.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rightLogShiftDocs = void 0;var rightLogShiftDocs = { name: "rightLogShift", category: "Bitwise", syntax: ["x >>> y", "rightLogShift(x, y)"], description: "Bitwise right logical shift of a value x by y number of bits.", examples: ["8 >>> 1", "4 << 1", "-12 >>> 2"], seealso: ["bitAnd", "bitNot", "bitOr", "bitXor", "leftShift", "rightArithShift"] };exports.rightLogShiftDocs = rightLogShiftDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/bellNumbers.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bellNumbersDocs = void 0;var bellNumbersDocs = { name: "bellNumbers", category: "Combinatorics", syntax: ["bellNumbers(n)"], description: "The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.", examples: ["bellNumbers(3)", "bellNumbers(8)"], seealso: ["stirlingS2"] };exports.bellNumbersDocs = bellNumbersDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/catalan.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.catalanDocs = void 0;var catalanDocs = { name: "catalan", category: "Combinatorics", syntax: ["catalan(n)"], description: "The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.", examples: ["catalan(3)", "catalan(8)"], seealso: ["bellNumbers"] };exports.catalanDocs = catalanDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/composition.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compositionDocs = void 0;var compositionDocs = { name: "composition", category: "Combinatorics", syntax: ["composition(n, k)"], description: "The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.", examples: ["composition(5, 3)"], seealso: ["combinations"] };exports.compositionDocs = compositionDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/stirlingS2.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.stirlingS2Docs = void 0;var stirlingS2Docs = { name: "stirlingS2", category: "Combinatorics", syntax: ["stirlingS2(n, k)"], description: "he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.", examples: ["stirlingS2(5, 3)"], seealso: ["bellNumbers"] };exports.stirlingS2Docs = stirlingS2Docs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/arg.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.argDocs = void 0;var argDocs = { name: "arg", category: "Complex", syntax: ["arg(x)"], description: "Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).", examples: ["arg(2 + 2i)", "atan2(3, 2)", "arg(2 + 3i)"], seealso: ["re", "im", "conj", "abs"] };exports.argDocs = argDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/conj.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.conjDocs = void 0;var conjDocs = { name: "conj", category: "Complex", syntax: ["conj(x)"], description: "Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.", examples: ["conj(2 + 3i)", "conj(2 - 3i)", "conj(-5.2i)"], seealso: ["re", "im", "abs", "arg"] };exports.conjDocs = conjDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/im.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.imDocs = void 0;var imDocs = { name: "im", category: "Complex", syntax: ["im(x)"], description: "Get the imaginary part of a complex number.", examples: ["im(2 + 3i)", "re(2 + 3i)", "im(-5.2i)", "im(2.4)"], seealso: ["re", "conj", "abs", "arg"] };exports.imDocs = imDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/re.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.reDocs = void 0;var reDocs = { name: "re", category: "Complex", syntax: ["re(x)"], description: "Get the real part of a complex number.", examples: ["re(2 + 3i)", "im(2 + 3i)", "re(-5.2i)", "re(2.4)"], seealso: ["im", "conj", "abs", "arg"] };exports.reDocs = reDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/evaluate.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.evaluateDocs = void 0;var evaluateDocs = { name: "evaluate", category: "Expression", syntax: ["evaluate(expression)", "evaluate([expr1, expr2, expr3, ...])"], description: "Evaluate an expression or an array with expressions.", examples: ["evaluate(\"2 + 3\")", "evaluate(\"sqrt(\" + 4 + \")\")"], seealso: [] };exports.evaluateDocs = evaluateDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/help.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.helpDocs = void 0;var helpDocs = { name: "help", category: "Expression", syntax: ["help(object)", "help(string)"], description: "Display documentation on a function or data type.", examples: ["help(sqrt)", "help(\"complex\")"], seealso: [] };exports.helpDocs = helpDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/distance.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.distanceDocs = void 0;var distanceDocs = { name: "distance", category: "Geometry", syntax: ["distance([x1, y1], [x2, y2])", "distance([[x1, y1], [x2, y2]])"], description: "Calculates the Euclidean distance between two points.", examples: ["distance([0,0], [4,4])", "distance([[0,0], [4,4]])"], seealso: [] };exports.distanceDocs = distanceDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/intersect.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.intersectDocs = void 0;var intersectDocs = { name: "intersect", category: "Geometry", syntax: ["intersect(expr1, expr2, expr3, expr4)", "intersect(expr1, expr2, expr3)"], description: "Computes the intersection point of lines and/or planes.", examples: ["intersect([0, 0], [10, 10], [10, 0], [0, 10])", "intersect([1, 0, 1],  [4, -2, 2], [1, 1, 1, 6])"], seealso: [] };exports.intersectDocs = intersectDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/and.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.andDocs = void 0;var andDocs = { name: "and", category: "Logical", syntax: ["x and y", "and(x, y)"], description: "Logical and. Test whether two values are both defined with a nonzero/nonempty value.", examples: ["true and false", "true and true", "2 and 4"], seealso: ["not", "or", "xor"] };exports.andDocs = andDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/not.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.notDocs = void 0;var notDocs = { name: "not", category: "Logical", syntax: ["not x", "not(x)"], description: "Logical not. Flips the boolean value of given argument.", examples: ["not true", "not false", "not 2", "not 0"], seealso: ["and", "or", "xor"] };exports.notDocs = notDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/or.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.orDocs = void 0;var orDocs = { name: "or", category: "Logical", syntax: ["x or y", "or(x, y)"], description: "Logical or. Test if at least one value is defined with a nonzero/nonempty value.", examples: ["true or false", "false or false", "0 or 4"], seealso: ["not", "and", "xor"] };exports.orDocs = orDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/xor.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.xorDocs = void 0;var xorDocs = { name: "xor", category: "Logical", syntax: ["x xor y", "xor(x, y)"], description: "Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.", examples: ["true xor false", "false xor false", "true xor true", "0 xor 4"], seealso: ["not", "and", "or"] };exports.xorDocs = xorDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/column.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.columnDocs = void 0;var columnDocs = { name: "column", category: "Matrix", syntax: ["column(x, index)"], description: "Return a column from a matrix or array.", examples: ["A = [[1, 2], [3, 4]]", "column(A, 1)", "column(A, 2)"], seealso: ["row", "matrixFromColumns"] };exports.columnDocs = columnDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/concat.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.concatDocs = void 0;var concatDocs = { name: "concat", category: "Matrix", syntax: ["concat(A, B, C, ...)", "concat(A, B, C, ..., dim)"], description: "Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.", examples: ["A = [1, 2; 5, 6]", "B = [3, 4; 7, 8]", "concat(A, B)", "concat(A, B, 1)", "concat(A, B, 2)"], seealso: ["det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };exports.concatDocs = concatDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/count.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.countDocs = void 0;var countDocs = { name: "count", category: "Matrix", syntax: ["count(x)"], description: "Count the number of elements of a matrix, array or string.", examples: ["a = [1, 2; 3, 4; 5, 6]", "count(a)", "size(a)", "count(\"hello world\")"], seealso: ["size"] };exports.countDocs = countDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/cross.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.crossDocs = void 0;var crossDocs = { name: "cross", category: "Matrix", syntax: ["cross(A, B)"], description: "Calculate the cross product for two vectors in three dimensional space.", examples: ["cross([1, 1, 0],  [0, 1, 1])", "cross([3, -3, 1], [4, 9, 2])", "cross([2, 3, 4],  [5, 6, 7])"], seealso: ["multiply", "dot"] };exports.crossDocs = crossDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ctranspose.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.ctransposeDocs = void 0;var ctransposeDocs = { name: "ctranspose", category: "Matrix", syntax: ["x'", "ctranspose(x)"], description: "Complex Conjugate and Transpose a matrix", examples: ["a = [1, 2, 3; 4, 5, 6]", "a'", "ctranspose(a)"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "zeros"] };exports.ctransposeDocs = ctransposeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/det.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.detDocs = void 0;var detDocs = { name: "det", category: "Matrix", syntax: ["det(x)"], description: "Calculate the determinant of a matrix", examples: ["det([1, 2; 3, 4])", "det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"], seealso: ["concat", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };exports.detDocs = detDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diag.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.diagDocs = void 0;var diagDocs = { name: "diag", category: "Matrix", syntax: ["diag(x)", "diag(x, k)"], description: "Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.", examples: ["diag(1:3)", "diag(1:3, 1)", "a = [1, 2, 3; 4, 5, 6; 7, 8, 9]", "diag(a)"], seealso: ["concat", "det", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };exports.diagDocs = diagDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diff.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.diffDocs = void 0;var diffDocs = { name: "diff", category: "Matrix", syntax: ["diff(arr)", "diff(arr, dim)"], description: ["Create a new matrix or array with the difference of the passed matrix or array.", "Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference", "If no dimension parameter is passed it is assumed as dimension 0", "Dimension is zero-based in javascript and one-based in the parser", "Arrays must be 'rectangular' meaning arrays like [1, 2]", "If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"], examples: ["diff([1, 2, 4, 7, 0])", "diff([1, 2, 4, 7, 0], 0)", "diff(matrix([1, 2, 4, 7, 0]))", "diff([[1, 2], [3, 4]])", "diff([[1, 2], [3, 4]], 0)", "diff([[1, 2], [3, 4]], 1)", "diff([[1, 2], [3, 4]], bignumber(1))", "diff(matrix([[1, 2], [3, 4]]), 1)", "diff([[1, 2], matrix([3, 4])], 1)"], seealso: ["subtract", "partitionSelect"] };exports.diffDocs = diffDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/dot.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.dotDocs = void 0;var dotDocs = { name: "dot", category: "Matrix", syntax: ["dot(A, B)", "A * B"], description: "Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn", examples: ["dot([2, 4, 1], [2, 2, 3])", "[2, 4, 1] * [2, 2, 3]"], seealso: ["multiply", "cross"] };exports.dotDocs = dotDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/eigs.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.eigsDocs = void 0;var eigsDocs = { name: "eigs", category: "Matrix", syntax: ["eigs(x)"], description: "Calculate the eigenvalues and eigenvectors of a real symmetric matrix", examples: ["eigs([[5, 2.3], [2.3, 1]])"], seealso: ["inv"] };exports.eigsDocs = eigsDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/filter.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.filterDocs = void 0;var filterDocs = { name: "filter", category: "Matrix", syntax: ["filter(x, test)"], description: "Filter items in a matrix.", examples: ["isPositive(x) = x > 0", "filter([6, -2, -1, 4, 3], isPositive)", "filter([6, -2, 0, 1, 0], x != 0)"], seealso: ["sort", "map", "forEach"] };exports.filterDocs = filterDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/flatten.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.flattenDocs = void 0;var flattenDocs = { name: "flatten", category: "Matrix", syntax: ["flatten(x)"], description: "Flatten a multi dimensional matrix into a single dimensional matrix.", examples: ["a = [1, 2, 3; 4, 5, 6]", "size(a)", "b = flatten(a)", "size(b)"], seealso: ["concat", "resize", "size", "squeeze"] };exports.flattenDocs = flattenDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/forEach.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.forEachDocs = void 0;var forEachDocs = { name: "forEach", category: "Matrix", syntax: ["forEach(x, callback)"], description: "Iterates over all elements of a matrix/array, and executes the given callback function.", examples: ["forEach([1, 2, 3], function(val) { console.log(val) })"], seealso: ["map", "sort", "filter"] };exports.forEachDocs = forEachDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/getMatrixDataType.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.getMatrixDataTypeDocs = void 0;var getMatrixDataTypeDocs = { name: "getMatrixDataType", category: "Matrix", syntax: ["getMatrixDataType(x)"], description: "Find the data type of all elements in a matrix or array, for example \"number\" if all items are a number and \"Complex\" if all values are complex numbers. If a matrix contains more than one data type, it will return \"mixed\".", examples: ["getMatrixDataType([1, 2, 3])", "getMatrixDataType([[5 cm], [2 inch]])", "getMatrixDataType([1, \"text\"])", "getMatrixDataType([1, bignumber(4)])"], seealso: ["matrix", "sparse", "typeOf"] };exports.getMatrixDataTypeDocs = getMatrixDataTypeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/identity.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.identityDocs = void 0;var identityDocs = { name: "identity", category: "Matrix", syntax: ["identity(n)", "identity(m, n)", "identity([m, n])"], description: "Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.", examples: ["identity(3)", "identity(3, 5)", "a = [1, 2, 3; 4, 5, 6]", "identity(size(a))"], seealso: ["concat", "det", "diag", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };exports.identityDocs = identityDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/inv.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.invDocs = void 0;var invDocs = { name: "inv", category: "Matrix", syntax: ["inv(x)"], description: "Calculate the inverse of a matrix", examples: ["inv([1, 2; 3, 4])", "inv(4)", "1 / 4"], seealso: ["concat", "det", "diag", "identity", "ones", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };exports.invDocs = invDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/kron.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.kronDocs = void 0;var kronDocs = { name: "kron", category: "Matrix", syntax: ["kron(x, y)"], description: "Calculates the kronecker product of 2 matrices or vectors.", examples: ["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])", "kron([1,1], [2,3,4])"], seealso: ["multiply", "dot", "cross"] };exports.kronDocs = kronDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/map.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.mapDocs = void 0;var mapDocs = { name: "map", category: "Matrix", syntax: ["map(x, callback)"], description: "Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.", examples: ["map([1, 2, 3], square)"], seealso: ["filter", "forEach"] };exports.mapDocs = mapDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromColumns.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.matrixFromColumnsDocs = void 0;var matrixFromColumnsDocs = { name: "matrixFromColumns", category: "Matrix", syntax: ["math.matrixFromColumns(...arr)", "math.matrixFromColumns(row1, row2)", "math.matrixFromColumns(row1, row2, row3)"], description: "Create a dense matrix from vectors as individual columns.", examples: ["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"], seealso: ["matrix", "matrixFromRows", "matrixFromFunction", "zeros"] };exports.matrixFromColumnsDocs = matrixFromColumnsDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromFunction.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.matrixFromFunctionDocs = void 0;var matrixFromFunctionDocs = { name: "matrixFromFunction", category: "Matrix", syntax: ["math.matrixFromFunction(size, fn)", "math.matrixFromFunction(size, fn, format)", "math.matrixFromFunction(size, fn, format, datatype)", "math.matrixFromFunction(size, format, fn)", "math.matrixFromFunction(size, format, datatype, fn)"], description: "Create a matrix by evaluating a generating function at each index.", examples: ["f(I) = I[1] - I[2]", "matrixFromFunction([3,3], f)", "g(I) = I[1] - I[2] == 1 ? 4 : 0", "matrixFromFunction([100, 100], \"sparse\", g)", "matrixFromFunction([5], random)"], seealso: ["matrix", "matrixFromRows", "matrixFromColumns", "zeros"] };exports.matrixFromFunctionDocs = matrixFromFunctionDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromRows.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.matrixFromRowsDocs = void 0;var matrixFromRowsDocs = { name: "matrixFromRows", category: "Matrix", syntax: ["math.matrixFromRows(...arr)", "math.matrixFromRows(row1, row2)", "math.matrixFromRows(row1, row2, row3)"], description: "Create a dense matrix from vectors as individual rows.", examples: ["matrixFromRows([1, 2, 3], [[4],[5],[6]])"], seealso: ["matrix", "matrixFromColumns", "matrixFromFunction", "zeros"] };exports.matrixFromRowsDocs = matrixFromRowsDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ones.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.onesDocs = void 0;var onesDocs = { name: "ones", category: "Matrix", syntax: ["ones(m)", "ones(m, n)", "ones(m, n, p, ...)", "ones([m])", "ones([m, n])", "ones([m, n, p, ...])"], description: "Create a matrix containing ones.", examples: ["ones(3)", "ones(3, 5)", "ones([2,3]) * 4.5", "a = [1, 2, 3; 4, 5, 6]", "ones(size(a))"], seealso: ["concat", "det", "diag", "identity", "inv", "range", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };exports.onesDocs = onesDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/partitionSelect.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.partitionSelectDocs = void 0;var partitionSelectDocs = { name: "partitionSelect", category: "Matrix", syntax: ["partitionSelect(x, k)", "partitionSelect(x, k, compare)"], description: "Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.", examples: ["partitionSelect([5, 10, 1], 2)", "partitionSelect([\"C\", \"B\", \"A\", \"D\"], 1)"], seealso: ["sort"] };exports.partitionSelectDocs = partitionSelectDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/range.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rangeDocs = void 0;var rangeDocs = { name: "range", category: "Type", syntax: ["start:end", "start:step:end", "range(start, end)", "range(start, end, step)", "range(string)"], description: "Create a range. Lower bound of the range is included, upper bound is excluded.", examples: ["1:5", "3:-1:-3", "range(3, 7)", "range(0, 12, 2)", "range(\"4:10\")", "a = [1, 2, 3, 4; 5, 6, 7, 8]", "a[1:2, 1:2]"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "size", "squeeze", "subset", "trace", "transpose", "zeros"] };exports.rangeDocs = rangeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/reshape.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.reshapeDocs = void 0;var reshapeDocs = { name: "reshape", category: "Matrix", syntax: ["reshape(x, sizes)"], description: "Reshape a multi dimensional array to fit the specified dimensions.", examples: ["reshape([1, 2, 3, 4, 5, 6], [2, 3])", "reshape([[1, 2], [3, 4]], [1, 4])", "reshape([[1, 2], [3, 4]], [4])"], seealso: ["size", "squeeze", "resize"] };exports.reshapeDocs = reshapeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/resize.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.resizeDocs = void 0;var resizeDocs = { name: "resize", category: "Matrix", syntax: ["resize(x, size)", "resize(x, size, defaultValue)"], description: "Resize a matrix.", examples: ["resize([1,2,3,4,5], [3])", "resize([1,2,3], [5])", "resize([1,2,3], [5], -1)", "resize(2, [2, 3])", "resize(\"hello\", [8], \"!\")"], seealso: ["size", "subset", "squeeze", "reshape"] };exports.resizeDocs = resizeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotate.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rotateDocs = void 0;var rotateDocs = { name: "rotate", category: "Matrix", syntax: ["rotate(w, theta)", "rotate(w, theta, v)"], description: "Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.", examples: ["rotate([1, 0], math.pi / 2)", "rotate(matrix([1, 0]), unit(\"35deg\"))", "rotate([1, 0, 0], unit(\"90deg\"), [0, 0, 1])", "rotate(matrix([1, 0, 0]), unit(\"90deg\"), matrix([0, 0, 1]))"], seealso: ["matrix", "rotationMatrix"] };exports.rotateDocs = rotateDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotationMatrix.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rotationMatrixDocs = void 0;var rotationMatrixDocs = { name: "rotationMatrix", category: "Matrix", syntax: ["rotationMatrix(theta)", "rotationMatrix(theta, v)", "rotationMatrix(theta, v, format)"], description: "Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.", examples: ["rotationMatrix(pi / 2)", "rotationMatrix(unit(\"45deg\"), [0, 0, 1])", "rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")"], seealso: ["cos", "sin"] };exports.rotationMatrixDocs = rotationMatrixDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/row.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.rowDocs = void 0;var rowDocs = { name: "row", category: "Matrix", syntax: ["row(x, index)"], description: "Return a row from a matrix or array.", examples: ["A = [[1, 2], [3, 4]]", "row(A, 1)", "row(A, 2)"], seealso: ["column", "matrixFromRows"] };exports.rowDocs = rowDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/size.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sizeDocs = void 0;var sizeDocs = { name: "size", category: "Matrix", syntax: ["size(x)"], description: "Calculate the size of a matrix.", examples: ["size(2.3)", "size(\"hello world\")", "a = [1, 2; 3, 4; 5, 6]", "size(a)", "size(1:6)"], seealso: ["concat", "count", "det", "diag", "identity", "inv", "ones", "range", "squeeze", "subset", "trace", "transpose", "zeros"] };exports.sizeDocs = sizeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/sort.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sortDocs = void 0;var sortDocs = { name: "sort", category: "Matrix", syntax: ["sort(x)", "sort(x, compare)"], description: "Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.", examples: ["sort([5, 10, 1])", "sort([\"C\", \"B\", \"A\", \"D\"])", "sortByLength(a, b) = size(a)[1] - size(b)[1]", "sort([\"Langdon\", \"Tom\", \"Sara\"], sortByLength)", "sort([\"10\", \"1\", \"2\"], \"natural\")"], seealso: ["map", "filter", "forEach"] };exports.sortDocs = sortDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/squeeze.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.squeezeDocs = void 0;var squeezeDocs = { name: "squeeze", category: "Matrix", syntax: ["squeeze(x)"], description: "Remove inner and outer singleton dimensions from a matrix.", examples: ["a = zeros(3,2,1)", "size(squeeze(a))", "b = zeros(1,1,3)", "size(squeeze(b))"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "subset", "trace", "transpose", "zeros"] };exports.squeezeDocs = squeezeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/subset.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.subsetDocs = void 0;var subsetDocs = { name: "subset", category: "Matrix", syntax: ["value(index)", "value(index) = replacement", "subset(value, [index])", "subset(value, [index], replacement)"], description: "Get or set a subset of a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.", examples: ["d = [1, 2; 3, 4]", "e = []", "e[1, 1:2] = [5, 6]", "e[2, :] = [7, 8]", "f = d * e", "f[2, 1]", "f[:, 1]"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "trace", "transpose", "zeros"] };exports.subsetDocs = subsetDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/trace.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.traceDocs = void 0;var traceDocs = { name: "trace", category: "Matrix", syntax: ["trace(A)"], description: "Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.", examples: ["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]", "trace(A)"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "transpose", "zeros"] };exports.traceDocs = traceDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/transpose.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.transposeDocs = void 0;var transposeDocs = { name: "transpose", category: "Matrix", syntax: ["x'", "transpose(x)"], description: "Transpose a matrix", examples: ["a = [1, 2, 3; 4, 5, 6]", "a'", "transpose(a)"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "zeros"] };exports.transposeDocs = transposeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/zeros.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.zerosDocs = void 0;var zerosDocs = { name: "zeros", category: "Matrix", syntax: ["zeros(m)", "zeros(m, n)", "zeros(m, n, p, ...)", "zeros([m])", "zeros([m, n])", "zeros([m, n, p, ...])"], description: "Create a matrix containing zeros.", examples: ["zeros(3)", "zeros(3, 5)", "a = [1, 2, 3; 4, 5, 6]", "zeros(size(a))"], seealso: ["concat", "det", "diag", "identity", "inv", "ones", "range", "size", "squeeze", "subset", "trace", "transpose"] };exports.zerosDocs = zerosDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinations.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.combinationsDocs = void 0;var combinationsDocs = { name: "combinations", category: "Probability", syntax: ["combinations(n, k)"], description: "Compute the number of combinations of n items taken k at a time", examples: ["combinations(7, 5)"], seealso: ["combinationsWithRep", "permutations", "factorial"] };exports.combinationsDocs = combinationsDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinationsWithRep.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.combinationsWithRepDocs = void 0;var combinationsWithRepDocs = { name: "combinationsWithRep", category: "Probability", syntax: ["combinationsWithRep(n, k)"], description: "Compute the number of combinations of n items taken k at a time with replacements.", examples: ["combinationsWithRep(7, 5)"], seealso: ["combinations", "permutations", "factorial"] };exports.combinationsWithRepDocs = combinationsWithRepDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/factorial.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.factorialDocs = void 0;var factorialDocs = { name: "factorial", category: "Probability", syntax: ["n!", "factorial(n)"], description: "Compute the factorial of a value", examples: ["5!", "5 * 4 * 3 * 2 * 1", "3!"], seealso: ["combinations", "combinationsWithRep", "permutations", "gamma"] };exports.factorialDocs = factorialDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/gamma.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.gammaDocs = void 0;var gammaDocs = { name: "gamma", category: "Probability", syntax: ["gamma(n)"], description: "Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.", examples: ["gamma(4)", "3!", "gamma(1/2)", "sqrt(pi)"], seealso: ["factorial"] };exports.gammaDocs = gammaDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/kldivergence.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.kldivergenceDocs = void 0;var kldivergenceDocs = { name: "kldivergence", category: "Probability", syntax: ["kldivergence(x, y)"], description: "Calculate the Kullback-Leibler (KL) divergence  between two distributions.", examples: ["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"], seealso: [] };exports.kldivergenceDocs = kldivergenceDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/multinomial.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.multinomialDocs = void 0;var multinomialDocs = { name: "multinomial", category: "Probability", syntax: ["multinomial(A)"], description: "Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.", examples: ["multinomial([1, 2, 1])"], seealso: ["combinations", "factorial"] };exports.multinomialDocs = multinomialDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/permutations.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.permutationsDocs = void 0;var permutationsDocs = { name: "permutations", category: "Probability", syntax: ["permutations(n)", "permutations(n, k)"], description: "Compute the number of permutations of n items taken k at a time", examples: ["permutations(5)", "permutations(5, 3)"], seealso: ["combinations", "combinationsWithRep", "factorial"] };exports.permutationsDocs = permutationsDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/pickRandom.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.pickRandomDocs = void 0;var pickRandomDocs = { name: "pickRandom", category: "Probability", syntax: ["pickRandom(array)", "pickRandom(array, number)", "pickRandom(array, weights)", "pickRandom(array, number, weights)", "pickRandom(array, weights, number)"], description: "Pick a random entry from a given array.", examples: ["pickRandom(0:10)", "pickRandom([1, 3, 1, 6])", "pickRandom([1, 3, 1, 6], 2)", "pickRandom([1, 3, 1, 6], [2, 3, 2, 1])", "pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])", "pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"], seealso: ["random", "randomInt"] };exports.pickRandomDocs = pickRandomDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/random.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.randomDocs = void 0;var randomDocs = { name: "random", category: "Probability", syntax: ["random()", "random(max)", "random(min, max)", "random(size)", "random(size, max)", "random(size, min, max)"], description: "Return a random number.", examples: ["random()", "random(10, 20)", "random([2, 3])"], seealso: ["pickRandom", "randomInt"] };exports.randomDocs = randomDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/randomInt.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.randomIntDocs = void 0;var randomIntDocs = { name: "randomInt", category: "Probability", syntax: ["randomInt(max)", "randomInt(min, max)", "randomInt(size)", "randomInt(size, max)", "randomInt(size, min, max)"], description: "Return a random integer number", examples: ["randomInt(10, 20)", "randomInt([2, 3], 10)"], seealso: ["pickRandom", "random"] };exports.randomIntDocs = randomIntDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compare.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compareDocs = void 0;var compareDocs = { name: "compare", category: "Relational", syntax: ["compare(x, y)"], description: "Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.", examples: ["compare(2, 3)", "compare(3, 2)", "compare(2, 2)", "compare(5cm, 40mm)", "compare(2, [1, 2, 3])"], seealso: ["equal", "unequal", "smaller", "smallerEq", "largerEq", "compareNatural", "compareText"] };exports.compareDocs = compareDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareNatural.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compareNaturalDocs = void 0;var compareNaturalDocs = { name: "compareNatural", category: "Relational", syntax: ["compareNatural(x, y)"], description: "Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.", examples: ["compareNatural(2, 3)", "compareNatural(3, 2)", "compareNatural(2, 2)", "compareNatural(5cm, 40mm)", "compareNatural(\"2\", \"10\")", "compareNatural(2 + 3i, 2 + 4i)", "compareNatural([1, 2, 4], [1, 2, 3])", "compareNatural([1, 5], [1, 2, 3])", "compareNatural([1, 2], [1, 2])", "compareNatural({a: 2}, {a: 4})"], seealso: ["equal", "unequal", "smaller", "smallerEq", "largerEq", "compare", "compareText"] };exports.compareNaturalDocs = compareNaturalDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareText.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compareTextDocs = void 0;var compareTextDocs = { name: "compareText", category: "Relational", syntax: ["compareText(x, y)"], description: "Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.", examples: ["compareText(\"B\", \"A\")", "compareText(\"A\", \"B\")", "compareText(\"A\", \"A\")", "compareText(\"2\", \"10\")", "compare(\"2\", \"10\")", "compare(2, 10)", "compareNatural(\"2\", \"10\")", "compareText(\"B\", [\"A\", \"B\", \"C\"])"], seealso: ["compare", "compareNatural"] };exports.compareTextDocs = compareTextDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/deepEqual.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.deepEqualDocs = void 0;var deepEqualDocs = { name: "deepEqual", category: "Relational", syntax: ["deepEqual(x, y)"], description: "Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.", examples: ["deepEqual([1,3,4], [1,3,4])", "deepEqual([1,3,4], [1,3])"], seealso: ["equal", "unequal", "smaller", "larger", "smallerEq", "largerEq", "compare"] };exports.deepEqualDocs = deepEqualDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equal.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.equalDocs = void 0;var equalDocs = { name: "equal", category: "Relational", syntax: ["x == y", "equal(x, y)"], description: "Check equality of two values. Returns true if the values are equal, and false if not.", examples: ["2+2 == 3", "2+2 == 4", "a = 3.2", "b = 6-2.8", "a == b", "50cm == 0.5m"], seealso: ["unequal", "smaller", "larger", "smallerEq", "largerEq", "compare", "deepEqual", "equalText"] };exports.equalDocs = equalDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equalText.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.equalTextDocs = void 0;var equalTextDocs = { name: "equalText", category: "Relational", syntax: ["equalText(x, y)"], description: "Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.", examples: ["equalText(\"Hello\", \"Hello\")", "equalText(\"a\", \"A\")", "equal(\"2e3\", \"2000\")", "equalText(\"2e3\", \"2000\")", "equalText(\"B\", [\"A\", \"B\", \"C\"])"], seealso: ["compare", "compareNatural", "compareText", "equal"] };exports.equalTextDocs = equalTextDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/larger.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.largerDocs = void 0;var largerDocs = { name: "larger", category: "Relational", syntax: ["x > y", "larger(x, y)"], description: "Check if value x is larger than y. Returns true if x is larger than y, and false if not.", examples: ["2 > 3", "5 > 2*2", "a = 3.3", "b = 6-2.8", "(a > b)", "(b < a)", "5 cm > 2 inch"], seealso: ["equal", "unequal", "smaller", "smallerEq", "largerEq", "compare"] };exports.largerDocs = largerDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/largerEq.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.largerEqDocs = void 0;var largerEqDocs = { name: "largerEq", category: "Relational", syntax: ["x >= y", "largerEq(x, y)"], description: "Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.", examples: ["2 >= 1+1", "2 > 1+1", "a = 3.2", "b = 6-2.8", "(a >= b)"], seealso: ["equal", "unequal", "smallerEq", "smaller", "compare"] };exports.largerEqDocs = largerEqDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smaller.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.smallerDocs = void 0;var smallerDocs = { name: "smaller", category: "Relational", syntax: ["x < y", "smaller(x, y)"], description: "Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.", examples: ["2 < 3", "5 < 2*2", "a = 3.3", "b = 6-2.8", "(a < b)", "5 cm < 2 inch"], seealso: ["equal", "unequal", "larger", "smallerEq", "largerEq", "compare"] };exports.smallerDocs = smallerDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smallerEq.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.smallerEqDocs = void 0;var smallerEqDocs = { name: "smallerEq", category: "Relational", syntax: ["x <= y", "smallerEq(x, y)"], description: "Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.", examples: ["2 <= 1+1", "2 < 1+1", "a = 3.2", "b = 6-2.8", "(a <= b)"], seealso: ["equal", "unequal", "larger", "smaller", "largerEq", "compare"] };exports.smallerEqDocs = smallerEqDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/unequal.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.unequalDocs = void 0;var unequalDocs = { name: "unequal", category: "Relational", syntax: ["x != y", "unequal(x, y)"], description: "Check unequality of two values. Returns true if the values are unequal, and false if they are equal.", examples: ["2+2 != 3", "2+2 != 4", "a = 3.2", "b = 6-2.8", "a != b", "50cm != 0.5m", "5 cm != 2 inch"], seealso: ["equal", "smaller", "larger", "smallerEq", "largerEq", "compare", "deepEqual"] };exports.unequalDocs = unequalDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setCartesian.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setCartesianDocs = void 0;var setCartesianDocs = { name: "setCartesian", category: "Set", syntax: ["setCartesian(set1, set2)"], description: "Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setCartesian([1, 2], [3, 4])"], seealso: ["setUnion", "setIntersect", "setDifference", "setPowerset"] };exports.setCartesianDocs = setCartesianDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDifference.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setDifferenceDocs = void 0;var setDifferenceDocs = { name: "setDifference", category: "Set", syntax: ["setDifference(set1, set2)"], description: "Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setDifference([1, 2, 3, 4], [3, 4, 5, 6])", "setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"], seealso: ["setUnion", "setIntersect", "setSymDifference"] };exports.setDifferenceDocs = setDifferenceDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDistinct.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setDistinctDocs = void 0;var setDistinctDocs = { name: "setDistinct", category: "Set", syntax: ["setDistinct(set)"], description: "Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.", examples: ["setDistinct([1, 1, 1, 2, 2, 3])"], seealso: ["setMultiplicity"] };exports.setDistinctDocs = setDistinctDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIntersect.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setIntersectDocs = void 0;var setIntersectDocs = { name: "setIntersect", category: "Set", syntax: ["setIntersect(set1, set2)"], description: "Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])", "setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"], seealso: ["setUnion", "setDifference"] };exports.setIntersectDocs = setIntersectDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIsSubset.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setIsSubsetDocs = void 0;var setIsSubsetDocs = { name: "setIsSubset", category: "Set", syntax: ["setIsSubset(set1, set2)"], description: "Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setIsSubset([1, 2], [3, 4, 5, 6])", "setIsSubset([3, 4], [3, 4, 5, 6])"], seealso: ["setUnion", "setIntersect", "setDifference"] };exports.setIsSubsetDocs = setIsSubsetDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setMultiplicity.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setMultiplicityDocs = void 0;var setMultiplicityDocs = { name: "setMultiplicity", category: "Set", syntax: ["setMultiplicity(element, set)"], description: "Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.", examples: ["setMultiplicity(1, [1, 2, 2, 4])", "setMultiplicity(2, [1, 2, 2, 4])"], seealso: ["setDistinct", "setSize"] };exports.setMultiplicityDocs = setMultiplicityDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setPowerset.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setPowersetDocs = void 0;var setPowersetDocs = { name: "setPowerset", category: "Set", syntax: ["setPowerset(set)"], description: "Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.", examples: ["setPowerset([1, 2, 3])"], seealso: ["setCartesian"] };exports.setPowersetDocs = setPowersetDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSize.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setSizeDocs = void 0;var setSizeDocs = { name: "setSize", category: "Set", syntax: ["setSize(set)", "setSize(set, unique)"], description: "Count the number of elements of a (multi)set. When the second parameter \"unique\" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.", examples: ["setSize([1, 2, 2, 4])", "setSize([1, 2, 2, 4], true)"], seealso: ["setUnion", "setIntersect", "setDifference"] };exports.setSizeDocs = setSizeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSymDifference.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setSymDifferenceDocs = void 0;var setSymDifferenceDocs = { name: "setSymDifference", category: "Set", syntax: ["setSymDifference(set1, set2)"], description: "Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])", "setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"], seealso: ["setUnion", "setIntersect", "setDifference"] };exports.setSymDifferenceDocs = setSymDifferenceDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setUnion.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.setUnionDocs = void 0;var setUnionDocs = { name: "setUnion", category: "Set", syntax: ["setUnion(set1, set2)"], description: "Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.", examples: ["setUnion([1, 2, 3, 4], [3, 4, 5, 6])", "setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"], seealso: ["setIntersect", "setDifference"] };exports.setUnionDocs = setUnionDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/erf.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.erfDocs = void 0;var erfDocs = { name: "erf", category: "Special", syntax: ["erf(x)"], description: "Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x", examples: ["erf(0.2)", "erf(-0.5)", "erf(4)"], seealso: [] };exports.erfDocs = erfDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mad.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.madDocs = void 0;var madDocs = { name: "mad", category: "Statistics", syntax: ["mad(a, b, c, ...)", "mad(A)"], description: "Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.", examples: ["mad(10, 20, 30)", "mad([1, 2, 3])"], seealso: ["mean", "median", "std", "abs"] };exports.madDocs = madDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/max.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.maxDocs = void 0;var maxDocs = { name: "max", category: "Statistics", syntax: ["max(a, b, c, ...)", "max(A)", "max(A, dim)"], description: "Compute the maximum value of a list of values.", examples: ["max(2, 3, 4, 1)", "max([2, 3, 4, 1])", "max([2, 5; 4, 3])", "max([2, 5; 4, 3], 1)", "max([2, 5; 4, 3], 2)", "max(2.7, 7.1, -4.5, 2.0, 4.1)", "min(2.7, 7.1, -4.5, 2.0, 4.1)"], seealso: ["mean", "median", "min", "prod", "std", "sum", "variance"] };exports.maxDocs = maxDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mean.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.meanDocs = void 0;var meanDocs = { name: "mean", category: "Statistics", syntax: ["mean(a, b, c, ...)", "mean(A)", "mean(A, dim)"], description: "Compute the arithmetic mean of a list of values.", examples: ["mean(2, 3, 4, 1)", "mean([2, 3, 4, 1])", "mean([2, 5; 4, 3])", "mean([2, 5; 4, 3], 1)", "mean([2, 5; 4, 3], 2)", "mean([1.0, 2.7, 3.2, 4.0])"], seealso: ["max", "median", "min", "prod", "std", "sum", "variance"] };exports.meanDocs = meanDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/median.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.medianDocs = void 0;var medianDocs = { name: "median", category: "Statistics", syntax: ["median(a, b, c, ...)", "median(A)"], description: "Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.", examples: ["median(5, 2, 7)", "median([3, -1, 5, 7])"], seealso: ["max", "mean", "min", "prod", "std", "sum", "variance", "quantileSeq"] };exports.medianDocs = medianDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/min.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.minDocs = void 0;var minDocs = { name: "min", category: "Statistics", syntax: ["min(a, b, c, ...)", "min(A)", "min(A, dim)"], description: "Compute the minimum value of a list of values.", examples: ["min(2, 3, 4, 1)", "min([2, 3, 4, 1])", "min([2, 5; 4, 3])", "min([2, 5; 4, 3], 1)", "min([2, 5; 4, 3], 2)", "min(2.7, 7.1, -4.5, 2.0, 4.1)", "max(2.7, 7.1, -4.5, 2.0, 4.1)"], seealso: ["max", "mean", "median", "prod", "std", "sum", "variance"] };exports.minDocs = minDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mode.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.modeDocs = void 0;var modeDocs = { name: "mode", category: "Statistics", syntax: ["mode(a, b, c, ...)", "mode(A)", "mode(A, a, b, B, c, ...)"], description: "Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.", examples: ["mode(2, 1, 4, 3, 1)", "mode([1, 2.7, 3.2, 4, 2.7])", "mode(1, 4, 6, 1, 6)"], seealso: ["max", "mean", "min", "median", "prod", "std", "sum", "variance"] };exports.modeDocs = modeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/prod.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.prodDocs = void 0;var prodDocs = { name: "prod", category: "Statistics", syntax: ["prod(a, b, c, ...)", "prod(A)"], description: "Compute the product of all values.", examples: ["prod(2, 3, 4)", "prod([2, 3, 4])", "prod([2, 5; 4, 3])"], seealso: ["max", "mean", "min", "median", "min", "std", "sum", "variance"] };exports.prodDocs = prodDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/quantileSeq.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.quantileSeqDocs = void 0;var quantileSeqDocs = { name: "quantileSeq", category: "Statistics", syntax: ["quantileSeq(A, prob[, sorted])", "quantileSeq(A, [prob1, prob2, ...][, sorted])", "quantileSeq(A, N[, sorted])"], description: "Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.", examples: ["quantileSeq([3, -1, 5, 7], 0.5)", "quantileSeq([3, -1, 5, 7], [1/3, 2/3])", "quantileSeq([3, -1, 5, 7], 2)", "quantileSeq([-1, 3, 5, 7], 0.5, true)"], seealso: ["mean", "median", "min", "max", "prod", "std", "sum", "variance"] };exports.quantileSeqDocs = quantileSeqDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/std.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.stdDocs = void 0;var stdDocs = { name: "std", category: "Statistics", syntax: ["std(a, b, c, ...)", "std(A)", "std(A, normalization)"], description: "Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".", examples: ["std(2, 4, 6)", "std([2, 4, 6, 8])", "std([2, 4, 6, 8], \"uncorrected\")", "std([2, 4, 6, 8], \"biased\")", "std([1, 2, 3; 4, 5, 6])"], seealso: ["max", "mean", "min", "median", "prod", "sum", "variance"] };exports.stdDocs = stdDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/sum.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sumDocs = void 0;var sumDocs = { name: "sum", category: "Statistics", syntax: ["sum(a, b, c, ...)", "sum(A)"], description: "Compute the sum of all values.", examples: ["sum(2, 3, 4, 1)", "sum([2, 3, 4, 1])", "sum([2, 5; 4, 3])"], seealso: ["max", "mean", "median", "min", "prod", "std", "sum", "variance"] };exports.sumDocs = sumDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/variance.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.varianceDocs = void 0;var varianceDocs = { name: "variance", category: "Statistics", syntax: ["variance(a, b, c, ...)", "variance(A)", "variance(A, normalization)"], description: "Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".", examples: ["variance(2, 4, 6)", "variance([2, 4, 6, 8])", "variance([2, 4, 6, 8], \"uncorrected\")", "variance([2, 4, 6, 8], \"biased\")", "variance([1, 2, 3; 4, 5, 6])"], seealso: ["max", "mean", "min", "median", "min", "prod", "std", "sum"] };exports.varianceDocs = varianceDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acos.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acosDocs = void 0;var acosDocs = { name: "acos", category: "Trigonometry", syntax: ["acos(x)"], description: "Compute the inverse cosine of a value in radians.", examples: ["acos(0.5)", "acos(cos(2.3))"], seealso: ["cos", "atan", "asin"] };exports.acosDocs = acosDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acosh.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acoshDocs = void 0;var acoshDocs = { name: "acosh", category: "Trigonometry", syntax: ["acosh(x)"], description: "Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.", examples: ["acosh(1.5)"], seealso: ["cosh", "asinh", "atanh"] };exports.acoshDocs = acoshDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acot.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acotDocs = void 0;var acotDocs = { name: "acot", category: "Trigonometry", syntax: ["acot(x)"], description: "Calculate the inverse cotangent of a value.", examples: ["acot(0.5)", "acot(cot(0.5))", "acot(2)"], seealso: ["cot", "atan"] };exports.acotDocs = acotDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acoth.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acothDocs = void 0;var acothDocs = { name: "acoth", category: "Trigonometry", syntax: ["acoth(x)"], description: "Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.", examples: ["acoth(2)", "acoth(0.5)"], seealso: ["acsch", "asech"] };exports.acothDocs = acothDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsc.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acscDocs = void 0;var acscDocs = { name: "acsc", category: "Trigonometry", syntax: ["acsc(x)"], description: "Calculate the inverse cotangent of a value.", examples: ["acsc(2)", "acsc(csc(0.5))", "acsc(0.5)"], seealso: ["csc", "asin", "asec"] };exports.acscDocs = acscDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsch.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acschDocs = void 0;var acschDocs = { name: "acsch", category: "Trigonometry", syntax: ["acsch(x)"], description: "Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.", examples: ["acsch(0.5)"], seealso: ["asech", "acoth"] };exports.acschDocs = acschDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asec.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.asecDocs = void 0;var asecDocs = { name: "asec", category: "Trigonometry", syntax: ["asec(x)"], description: "Calculate the inverse secant of a value.", examples: ["asec(0.5)", "asec(sec(0.5))", "asec(2)"], seealso: ["acos", "acot", "acsc"] };exports.asecDocs = asecDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asech.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.asechDocs = void 0;var asechDocs = { name: "asech", category: "Trigonometry", syntax: ["asech(x)"], description: "Calculate the inverse secant of a value.", examples: ["asech(0.5)"], seealso: ["acsch", "acoth"] };exports.asechDocs = asechDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asin.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.asinDocs = void 0;var asinDocs = { name: "asin", category: "Trigonometry", syntax: ["asin(x)"], description: "Compute the inverse sine of a value in radians.", examples: ["asin(0.5)", "asin(sin(0.5))"], seealso: ["sin", "acos", "atan"] };exports.asinDocs = asinDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asinh.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.asinhDocs = void 0;var asinhDocs = { name: "asinh", category: "Trigonometry", syntax: ["asinh(x)"], description: "Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.", examples: ["asinh(0.5)"], seealso: ["acosh", "atanh"] };exports.asinhDocs = asinhDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.atanDocs = void 0;var atanDocs = { name: "atan", category: "Trigonometry", syntax: ["atan(x)"], description: "Compute the inverse tangent of a value in radians.", examples: ["atan(0.5)", "atan(tan(0.5))"], seealso: ["tan", "acos", "asin"] };exports.atanDocs = atanDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan2.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.atan2Docs = void 0;var atan2Docs = { name: "atan2", category: "Trigonometry", syntax: ["atan2(y, x)"], description: "Computes the principal value of the arc tangent of y/x in radians.", examples: ["atan2(2, 2) / pi", "angle = 60 deg in rad", "x = cos(angle)", "y = sin(angle)", "atan2(y, x)"], seealso: ["sin", "cos", "tan"] };exports.atan2Docs = atan2Docs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atanh.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.atanhDocs = void 0;var atanhDocs = { name: "atanh", category: "Trigonometry", syntax: ["atanh(x)"], description: "Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.", examples: ["atanh(0.5)"], seealso: ["acosh", "asinh"] };exports.atanhDocs = atanhDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cos.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cosDocs = void 0;var cosDocs = { name: "cos", category: "Trigonometry", syntax: ["cos(x)"], description: "Compute the cosine of x in radians.", examples: ["cos(2)", "cos(pi / 4) ^ 2", "cos(180 deg)", "cos(60 deg)", "sin(0.2)^2 + cos(0.2)^2"], seealso: ["acos", "sin", "tan"] };exports.cosDocs = cosDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cosh.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.coshDocs = void 0;var coshDocs = { name: "cosh", category: "Trigonometry", syntax: ["cosh(x)"], description: "Compute the hyperbolic cosine of x in radians.", examples: ["cosh(0.5)"], seealso: ["sinh", "tanh", "coth"] };exports.coshDocs = coshDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cot.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cotDocs = void 0;var cotDocs = { name: "cot", category: "Trigonometry", syntax: ["cot(x)"], description: "Compute the cotangent of x in radians. Defined as 1/tan(x)", examples: ["cot(2)", "1 / tan(2)"], seealso: ["sec", "csc", "tan"] };exports.cotDocs = cotDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/coth.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cothDocs = void 0;var cothDocs = { name: "coth", category: "Trigonometry", syntax: ["coth(x)"], description: "Compute the hyperbolic cotangent of x in radians.", examples: ["coth(2)", "1 / tanh(2)"], seealso: ["sech", "csch", "tanh"] };exports.cothDocs = cothDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csc.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cscDocs = void 0;var cscDocs = { name: "csc", category: "Trigonometry", syntax: ["csc(x)"], description: "Compute the cosecant of x in radians. Defined as 1/sin(x)", examples: ["csc(2)", "1 / sin(2)"], seealso: ["sec", "cot", "sin"] };exports.cscDocs = cscDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csch.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cschDocs = void 0;var cschDocs = { name: "csch", category: "Trigonometry", syntax: ["csch(x)"], description: "Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)", examples: ["csch(2)", "1 / sinh(2)"], seealso: ["sech", "coth", "sinh"] };exports.cschDocs = cschDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sec.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.secDocs = void 0;var secDocs = { name: "sec", category: "Trigonometry", syntax: ["sec(x)"], description: "Compute the secant of x in radians. Defined as 1/cos(x)", examples: ["sec(2)", "1 / cos(2)"], seealso: ["cot", "csc", "cos"] };exports.secDocs = secDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sech.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sechDocs = void 0;var sechDocs = { name: "sech", category: "Trigonometry", syntax: ["sech(x)"], description: "Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)", examples: ["sech(2)", "1 / cosh(2)"], seealso: ["coth", "csch", "cosh"] };exports.sechDocs = sechDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sin.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sinDocs = void 0;var sinDocs = { name: "sin", category: "Trigonometry", syntax: ["sin(x)"], description: "Compute the sine of x in radians.", examples: ["sin(2)", "sin(pi / 4) ^ 2", "sin(90 deg)", "sin(30 deg)", "sin(0.2)^2 + cos(0.2)^2"], seealso: ["asin", "cos", "tan"] };exports.sinDocs = sinDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sinh.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.sinhDocs = void 0;var sinhDocs = { name: "sinh", category: "Trigonometry", syntax: ["sinh(x)"], description: "Compute the hyperbolic sine of x in radians.", examples: ["sinh(0.5)"], seealso: ["cosh", "tanh"] };exports.sinhDocs = sinhDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tan.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.tanDocs = void 0;var tanDocs = { name: "tan", category: "Trigonometry", syntax: ["tan(x)"], description: "Compute the tangent of x in radians.", examples: ["tan(0.5)", "sin(0.5) / cos(0.5)", "tan(pi / 4)", "tan(45 deg)"], seealso: ["atan", "sin", "cos"] };exports.tanDocs = tanDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tanh.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.tanhDocs = void 0;var tanhDocs = { name: "tanh", category: "Trigonometry", syntax: ["tanh(x)"], description: "Compute the hyperbolic tangent of x in radians.", examples: ["tanh(0.5)", "sinh(0.5) / cosh(0.5)"], seealso: ["sinh", "cosh"] };exports.tanhDocs = tanhDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/to.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.toDocs = void 0;var toDocs = { name: "to", category: "Units", syntax: ["x to unit", "to(x, unit)"], description: "Change the unit of a value.", examples: ["5 inch to cm", "3.2kg to g", "16 bytes in bits"], seealso: [] };exports.toDocs = toDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/bin.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.binDocs = void 0;var binDocs = { name: "bin", category: "Utils", syntax: ["bin(value)"], description: "Format a number as binary", examples: ["bin(2)"], seealso: ["oct", "hex"] };exports.binDocs = binDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/clone.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.cloneDocs = void 0;var cloneDocs = { name: "clone", category: "Utils", syntax: ["clone(x)"], description: "Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices", examples: ["clone(3.5)", "clone(2 - 4i)", "clone(45 deg)", "clone([1, 2; 3, 4])", "clone(\"hello world\")"], seealso: [] };exports.cloneDocs = cloneDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/format.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.formatDocs = void 0;var formatDocs = { name: "format", category: "Utils", syntax: ["format(value)", "format(value, precision)"], description: "Format a value of any type as string.", examples: ["format(2.3)", "format(3 - 4i)", "format([])", "format(pi, 3)"], seealso: ["print"] };exports.formatDocs = formatDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hasNumericValue.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.hasNumericValueDocs = void 0;var hasNumericValueDocs = { name: "hasNumericValue", category: "Utils", syntax: ["hasNumericValue(x)"], description: "Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.", examples: ["hasNumericValue(2)", "hasNumericValue(\"2\")", "isNumeric(\"2\")", "hasNumericValue(0)", "hasNumericValue(bignumber(500))", "hasNumericValue(fraction(0.125))", "hasNumericValue(2 + 3i)", "hasNumericValue([2.3, \"foo\", false])"], seealso: ["isInteger", "isZero", "isNegative", "isPositive", "isNaN", "isNumeric"] };exports.hasNumericValueDocs = hasNumericValueDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hex.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.hexDocs = void 0;var hexDocs = { name: "hex", category: "Utils", syntax: ["hex(value)"], description: "Format a number as hexadecimal", examples: ["hex(240)"], seealso: ["bin", "oct"] };exports.hexDocs = hexDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isInteger.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isIntegerDocs = void 0;var isIntegerDocs = { name: "isInteger", category: "Utils", syntax: ["isInteger(x)"], description: "Test whether a value is an integer number.", examples: ["isInteger(2)", "isInteger(3.5)", "isInteger([3, 0.5, -2])"], seealso: ["isNegative", "isNumeric", "isPositive", "isZero"] };exports.isIntegerDocs = isIntegerDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNaN.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isNaNDocs = void 0;var isNaNDocs = { name: "isNaN", category: "Utils", syntax: ["isNaN(x)"], description: "Test whether a value is NaN (not a number)", examples: ["isNaN(2)", "isNaN(0 / 0)", "isNaN(NaN)", "isNaN(Infinity)"], seealso: ["isNegative", "isNumeric", "isPositive", "isZero"] };exports.isNaNDocs = isNaNDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNegative.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isNegativeDocs = void 0;var isNegativeDocs = { name: "isNegative", category: "Utils", syntax: ["isNegative(x)"], description: "Test whether a value is negative: smaller than zero.", examples: ["isNegative(2)", "isNegative(0)", "isNegative(-4)", "isNegative([3, 0.5, -2])"], seealso: ["isInteger", "isNumeric", "isPositive", "isZero"] };exports.isNegativeDocs = isNegativeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNumeric.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isNumericDocs = void 0;var isNumericDocs = { name: "isNumeric", category: "Utils", syntax: ["isNumeric(x)"], description: "Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.", examples: ["isNumeric(2)", "isNumeric(\"2\")", "hasNumericValue(\"2\")", "isNumeric(0)", "isNumeric(bignumber(500))", "isNumeric(fraction(0.125))", "isNumeric(2 + 3i)", "isNumeric([2.3, \"foo\", false])"], seealso: ["isInteger", "isZero", "isNegative", "isPositive", "isNaN", "hasNumericValue"] };exports.isNumericDocs = isNumericDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPositive.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isPositiveDocs = void 0;var isPositiveDocs = { name: "isPositive", category: "Utils", syntax: ["isPositive(x)"], description: "Test whether a value is positive: larger than zero.", examples: ["isPositive(2)", "isPositive(0)", "isPositive(-4)", "isPositive([3, 0.5, -2])"], seealso: ["isInteger", "isNumeric", "isNegative", "isZero"] };exports.isPositiveDocs = isPositiveDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPrime.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isPrimeDocs = void 0;var isPrimeDocs = { name: "isPrime", category: "Utils", syntax: ["isPrime(x)"], description: "Test whether a value is prime: has no divisors other than itself and one.", examples: ["isPrime(3)", "isPrime(-2)", "isPrime([2, 17, 100])"], seealso: ["isInteger", "isNumeric", "isNegative", "isZero"] };exports.isPrimeDocs = isPrimeDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isZero.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isZeroDocs = void 0;var isZeroDocs = { name: "isZero", category: "Utils", syntax: ["isZero(x)"], description: "Test whether a value is zero.", examples: ["isZero(2)", "isZero(0)", "isZero(-4)", "isZero([3, 0, -2, 0])"], seealso: ["isInteger", "isNumeric", "isNegative", "isPositive"] };exports.isZeroDocs = isZeroDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/numeric.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.numericDocs = void 0;var numericDocs = { name: "numeric", category: "Utils", syntax: ["numeric(x)"], description: "Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.", examples: ["numeric(\"4\")", "numeric(\"4\", \"number\")", "numeric(\"4\", \"BigNumber\")", "numeric(\"4\", \"Fraction)", "numeric(4, \"Fraction\")", "numeric(fraction(2, 5), \"number)"], seealso: ["number", "fraction", "bignumber", "string", "format"] };exports.numericDocs = numericDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/oct.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.octDocs = void 0;var octDocs = { name: "oct", category: "Utils", syntax: ["oct(value)"], description: "Format a number as octal", examples: ["oct(56)"], seealso: ["bin", "hex"] };exports.octDocs = octDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/typeOf.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.typeOfDocs = void 0;var typeOfDocs = { name: "typeOf", category: "Utils", syntax: ["typeOf(x)"], description: "Get the type of a variable.", examples: ["typeOf(3.5)", "typeOf(2 - 4i)", "typeOf(45 deg)", "typeOf(\"hello world\")"], seealso: ["getMatrixDataType"] };exports.typeOfDocs = typeOfDocs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/function/compile.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCompile = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "compile",dependencies = ["typed", "parse"],createCompile = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,parse = _ref.parse;return typed(name, { string: function (expr) {return parse(expr).compile();}, "Array | Matrix": function (expr) {return (0, _collection.deepMap)(expr, function (entry) {return parse(entry).compile();});} });});exports.createCompile = createCompile;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/function/evaluate.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createEvaluate = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_map = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/map.js"),name = "evaluate",dependencies = ["typed", "parse"],createEvaluate = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,parse = _ref.parse;return typed(name, { string: function (expr) {var scope = (0, _map.createEmptyMap)();return parse(expr).compile().evaluate(scope);}, "string, Map | Object": function (expr, scope) {return parse(expr).compile().evaluate(scope);}, "Array | Matrix": function (expr) {var scope = (0, _map.createEmptyMap)();return (0, _collection.deepMap)(expr, function (entry) {return parse(entry).compile().evaluate(scope);});}, "Array | Matrix, Map | Object": function (expr, scope) {return (0, _collection.deepMap)(expr, function (entry) {return parse(entry).compile().evaluate(scope);});} });});exports.createEvaluate = createEvaluate;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/function/help.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createHelp = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_embeddedDocs = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/embeddedDocs/embeddedDocs.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),name = "help",dependencies = ["typed", "mathWithTransform", "Help"],createHelp = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,mathWithTransform = _ref.mathWithTransform,Help = _ref.Help;return typed(name, { any: function (search) {var prop,searchName = search;if ("string" != typeof search) for (prop in mathWithTransform) if ((0, _object.hasOwnProperty)(mathWithTransform, prop) && search === mathWithTransform[prop]) {searchName = prop;break;}var doc = (0, _customs.getSafeProperty)(_embeddedDocs.embeddedDocs, searchName);if (!doc) {var searchText = "function" == typeof searchName ? searchName.name : searchName;throw new Error("No documentation found on \"" + searchText + "\"");}return new Help(doc);} });});exports.createHelp = createHelp;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/function/parser.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createParser = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "parser",dependencies = ["typed", "Parser"],createParser = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,Parser = _ref.Parser;return typed(name, { "": function () {return new Parser();} });});exports.createParser = createParser;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/keywords.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.keywords = void 0;var keywords = new Set(["end"]);exports.keywords = keywords;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/AccessorNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAccessorNode = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_access = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/utils/access.js"),name = "AccessorNode",dependencies = ["subset", "Node"],createAccessorNode = (0, _factory.factory)(name, dependencies, function (_ref) {function AccessorNode(object, index) {if (!(this instanceof AccessorNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!(0, _is.isNode)(object)) throw new TypeError("Node expected for parameter \"object\"");if (!(0, _is.isIndexNode)(index)) throw new TypeError("IndexNode expected for parameter \"index\"");this.object = object || null, this.index = index, Object.defineProperty(this, "name", { get: function () {return this.index ? this.index.isObjectProperty() ? this.index.getObjectProperty() : "" : this.object.name || "";}.bind(this), set: function () {throw new Error("Cannot assign a new name, name is read-only");} });}function needParenthesis(node) {return !((0, _is.isAccessorNode)(node) || (0, _is.isArrayNode)(node) || (0, _is.isConstantNode)(node) || (0, _is.isFunctionNode)(node) || (0, _is.isObjectNode)(node) || (0, _is.isParenthesisNode)(node) || (0, _is.isSymbolNode)(node));}var subset = _ref.subset,Node = _ref.Node,access = (0, _access.accessFactory)({ subset: subset });return AccessorNode.prototype = new Node(), AccessorNode.prototype.type = "AccessorNode", AccessorNode.prototype.isAccessorNode = !0, AccessorNode.prototype._compile = function (math, argNames) {var evalObject = this.object._compile(math, argNames),evalIndex = this.index._compile(math, argNames);if (this.index.isObjectProperty()) {var prop = this.index.getObjectProperty();return function (scope, args, context) {return (0, _customs.getSafeProperty)(evalObject(scope, args, context), prop);};}return function (scope, args, context) {var object = evalObject(scope, args, context),index = evalIndex(scope, args, object);return access(object, index);};}, AccessorNode.prototype.forEach = function (callback) {callback(this.object, "object", this), callback(this.index, "index", this);}, AccessorNode.prototype.map = function (callback) {return new AccessorNode(this._ifNode(callback(this.object, "object", this)), this._ifNode(callback(this.index, "index", this)));}, AccessorNode.prototype.clone = function () {return new AccessorNode(this.object, this.index);}, AccessorNode.prototype._toString = function (options) {var object = this.object.toString(options);return needParenthesis(this.object) && (object = "(" + object + ")"), object + this.index.toString(options);}, AccessorNode.prototype.toHTML = function (options) {var object = this.object.toHTML(options);return needParenthesis(this.object) && (object = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + object + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), object + this.index.toHTML(options);}, AccessorNode.prototype._toTex = function (options) {var object = this.object.toTex(options);return needParenthesis(this.object) && (object = "\\left(' + object + '\\right)"), object + this.index.toTex(options);}, AccessorNode.prototype.toJSON = function () {return { mathjs: "AccessorNode", object: this.object, index: this.index };}, AccessorNode.fromJSON = function (json) {return new AccessorNode(json.object, json.index);}, AccessorNode;}, { isClass: !0, isNode: !0 });exports.createAccessorNode = createAccessorNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/ArrayNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createArrayNode = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "ArrayNode",dependencies = ["Node"],createArrayNode = (0, _factory.factory)(name, dependencies, function (_ref) {function ArrayNode(items) {if (!(this instanceof ArrayNode)) throw new SyntaxError("Constructor must be called with the new operator");if (this.items = items || [], !Array.isArray(this.items) || !this.items.every(_is.isNode)) throw new TypeError("Array containing Nodes expected");}var Node = _ref.Node;return ArrayNode.prototype = new Node(), ArrayNode.prototype.type = "ArrayNode", ArrayNode.prototype.isArrayNode = !0, ArrayNode.prototype._compile = function (math, argNames) {var evalItems = (0, _array.map)(this.items, function (item) {return item._compile(math, argNames);}),asMatrix = "Array" !== math.config.matrix;if (asMatrix) {var matrix = math.matrix;return function (scope, args, context) {return matrix((0, _array.map)(evalItems, function (evalItem) {return evalItem(scope, args, context);}));};}return function (scope, args, context) {return (0, _array.map)(evalItems, function (evalItem) {return evalItem(scope, args, context);});};}, ArrayNode.prototype.forEach = function (callback) {for (var node, i = 0; i < this.items.length; i++) node = this.items[i], callback(node, "items[" + i + "]", this);}, ArrayNode.prototype.map = function (callback) {for (var items = [], i = 0; i < this.items.length; i++) items[i] = this._ifNode(callback(this.items[i], "items[" + i + "]", this));return new ArrayNode(items);}, ArrayNode.prototype.clone = function () {return new ArrayNode(this.items.slice(0));}, ArrayNode.prototype._toString = function (options) {var items = this.items.map(function (node) {return node.toString(options);});return "[" + items.join(", ") + "]";}, ArrayNode.prototype.toJSON = function () {return { mathjs: "ArrayNode", items: this.items };}, ArrayNode.fromJSON = function (json) {return new ArrayNode(json.items);}, ArrayNode.prototype.toHTML = function (options) {var items = this.items.map(function (node) {return node.toHTML(options);});return "<span class=\"math-parenthesis math-square-parenthesis\">[</span>" + items.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-parenthesis math-square-parenthesis\">]</span>";}, ArrayNode.prototype._toTex = function (options) {var s = "\\begin{bmatrix}";return this.items.forEach(function (node) {s += node.items ? node.items.map(function (childNode) {return childNode.toTex(options);}).join("&") : node.toTex(options), s += "\\\\";}), s += "\\end{bmatrix}", s;}, ArrayNode;}, { isClass: !0, isNode: !0 });exports.createArrayNode = createArrayNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/AssignmentNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAssignmentNode = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_access = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/utils/access.js"),_assign = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/utils/assign.js"),_operators = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/operators.js"),name = "AssignmentNode",dependencies = ["subset", "?matrix", "Node"],createAssignmentNode = (0, _factory.factory)(name, dependencies, function (_ref) {function AssignmentNode(object, index, value) {if (!(this instanceof AssignmentNode)) throw new SyntaxError("Constructor must be called with the new operator");if (this.object = object, this.index = value ? index : null, this.value = value || index, !(0, _is.isSymbolNode)(object) && !(0, _is.isAccessorNode)(object)) throw new TypeError("SymbolNode or AccessorNode expected as \"object\"");if ((0, _is.isSymbolNode)(object) && "end" === object.name) throw new Error("Cannot assign to symbol \"end\"");if (this.index && !(0, _is.isIndexNode)(this.index)) throw new TypeError("IndexNode expected as \"index\"");if (!(0, _is.isNode)(this.value)) throw new TypeError("Node expected as \"value\"");Object.defineProperty(this, "name", { get: function () {return this.index ? this.index.isObjectProperty() ? this.index.getObjectProperty() : "" : this.object.name || "";}.bind(this), set: function () {throw new Error("Cannot assign a new name, name is read-only");} });}function needParenthesis(node, parenthesis) {parenthesis || (parenthesis = "keep");var precedence = (0, _operators.getPrecedence)(node, parenthesis),exprPrecedence = (0, _operators.getPrecedence)(node.value, parenthesis);return "all" === parenthesis || null !== exprPrecedence && exprPrecedence <= precedence;}var subset = _ref.subset,matrix = _ref.matrix,Node = _ref.Node,access = (0, _access.accessFactory)({ subset: subset }),assign = (0, _assign.assignFactory)({ subset: subset, matrix: matrix });return AssignmentNode.prototype = new Node(), AssignmentNode.prototype.type = "AssignmentNode", AssignmentNode.prototype.isAssignmentNode = !0, AssignmentNode.prototype._compile = function (math, argNames) {var evalObject = this.object._compile(math, argNames),evalIndex = this.index ? this.index._compile(math, argNames) : null,evalValue = this.value._compile(math, argNames),name = this.object.name;if (!this.index) {if (!(0, _is.isSymbolNode)(this.object)) throw new TypeError("SymbolNode expected as object");return function (scope, args, context) {var value = evalValue(scope, args, context);return scope.set(name, value), value;};}if (this.index.isObjectProperty()) {var prop = this.index.getObjectProperty();return function (scope, args, context) {var object = evalObject(scope, args, context),value = evalValue(scope, args, context);return (0, _customs.setSafeProperty)(object, prop, value), value;};}if ((0, _is.isSymbolNode)(this.object)) return function (scope, args, context) {var childObject = evalObject(scope, args, context),value = evalValue(scope, args, context),index = evalIndex(scope, args, childObject);return scope.set(name, assign(childObject, index, value)), value;};var evalParentObject = this.object.object._compile(math, argNames);if (this.object.index.isObjectProperty()) {var parentProp = this.object.index.getObjectProperty();return function (scope, args, context) {var parent = evalParentObject(scope, args, context),childObject = (0, _customs.getSafeProperty)(parent, parentProp),index = evalIndex(scope, args, childObject),value = evalValue(scope, args, context);return (0, _customs.setSafeProperty)(parent, parentProp, assign(childObject, index, value)), value;};}var evalParentIndex = this.object.index._compile(math, argNames);return function (scope, args, context) {var parent = evalParentObject(scope, args, context),parentIndex = evalParentIndex(scope, args, parent),childObject = access(parent, parentIndex),index = evalIndex(scope, args, childObject),value = evalValue(scope, args, context);return assign(parent, parentIndex, assign(childObject, index, value)), value;};}, AssignmentNode.prototype.forEach = function (callback) {callback(this.object, "object", this), this.index && callback(this.index, "index", this), callback(this.value, "value", this);}, AssignmentNode.prototype.map = function (callback) {var object = this._ifNode(callback(this.object, "object", this)),index = this.index ? this._ifNode(callback(this.index, "index", this)) : null,value = this._ifNode(callback(this.value, "value", this));return new AssignmentNode(object, index, value);}, AssignmentNode.prototype.clone = function () {return new AssignmentNode(this.object, this.index, this.value);}, AssignmentNode.prototype._toString = function (options) {var object = this.object.toString(options),index = this.index ? this.index.toString(options) : "",value = this.value.toString(options);return needParenthesis(this, options && options.parenthesis) && (value = "(" + value + ")"), object + index + " = " + value;}, AssignmentNode.prototype.toJSON = function () {return { mathjs: "AssignmentNode", object: this.object, index: this.index, value: this.value };}, AssignmentNode.fromJSON = function (json) {return new AssignmentNode(json.object, json.index, json.value);}, AssignmentNode.prototype.toHTML = function (options) {var object = this.object.toHTML(options),index = this.index ? this.index.toHTML(options) : "",value = this.value.toHTML(options);return needParenthesis(this, options && options.parenthesis) && (value = "<span class=\"math-paranthesis math-round-parenthesis\">(</span>" + value + "<span class=\"math-paranthesis math-round-parenthesis\">)</span>"), object + index + "<span class=\"math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator\">=</span>" + value;}, AssignmentNode.prototype._toTex = function (options) {var object = this.object.toTex(options),index = this.index ? this.index.toTex(options) : "",value = this.value.toTex(options);return needParenthesis(this, options && options.parenthesis) && (value = "\\left(".concat(value, "\\right)")), object + index + ":=" + value;}, AssignmentNode;}, { isClass: !0, isNode: !0 });exports.createAssignmentNode = createAssignmentNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/BlockNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBlockNode = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "BlockNode",dependencies = ["ResultSet", "Node"],createBlockNode = (0, _factory.factory)(name, dependencies, function (_ref) {function BlockNode(blocks) {if (!(this instanceof BlockNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!Array.isArray(blocks)) throw new Error("Array expected");this.blocks = blocks.map(function (block) {var node = block && block.node,visible = !(block && void 0 !== block.visible) || block.visible;if (!(0, _is.isNode)(node)) throw new TypeError("Property \"node\" must be a Node");if ("boolean" != typeof visible) throw new TypeError("Property \"visible\" must be a boolean");return { node: node, visible: visible };});}var ResultSet = _ref.ResultSet,Node = _ref.Node;return BlockNode.prototype = new Node(), BlockNode.prototype.type = "BlockNode", BlockNode.prototype.isBlockNode = !0, BlockNode.prototype._compile = function (math, argNames) {var evalBlocks = (0, _array.map)(this.blocks, function (block) {return { evaluate: block.node._compile(math, argNames), visible: block.visible };});return function (scope, args, context) {var results = [];return (0, _array.forEach)(evalBlocks, function (block) {var result = block.evaluate(scope, args, context);block.visible && results.push(result);}), new ResultSet(results);};}, BlockNode.prototype.forEach = function (callback) {for (var i = 0; i < this.blocks.length; i++) callback(this.blocks[i].node, "blocks[" + i + "].node", this);}, BlockNode.prototype.map = function (callback) {for (var blocks = [], i = 0; i < this.blocks.length; i++) {var block = this.blocks[i],node = this._ifNode(callback(block.node, "blocks[" + i + "].node", this));blocks[i] = { node: node, visible: block.visible };}return new BlockNode(blocks);}, BlockNode.prototype.clone = function () {var blocks = this.blocks.map(function (block) {return { node: block.node, visible: block.visible };});return new BlockNode(blocks);}, BlockNode.prototype._toString = function (options) {return this.blocks.map(function (param) {return param.node.toString(options) + (param.visible ? "" : ";");}).join("\n");}, BlockNode.prototype.toJSON = function () {return { mathjs: "BlockNode", blocks: this.blocks };}, BlockNode.fromJSON = function (json) {return new BlockNode(json.blocks);}, BlockNode.prototype.toHTML = function (options) {return this.blocks.map(function (param) {return param.node.toHTML(options) + (param.visible ? "" : "<span class=\"math-separator\">;</span>");}).join("<span class=\"math-separator\"><br /></span>");}, BlockNode.prototype._toTex = function (options) {return this.blocks.map(function (param) {return param.node.toTex(options) + (param.visible ? "" : ";");}).join("\\;\\;\n");}, BlockNode;}, { isClass: !0, isNode: !0 });exports.createBlockNode = createBlockNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/ConditionalNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createConditionalNode = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_operators = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/operators.js"),name = "ConditionalNode",dependencies = ["Node"],createConditionalNode = (0, _factory.factory)(name, dependencies, function (_ref) {function ConditionalNode(condition, trueExpr, falseExpr) {if (!(this instanceof ConditionalNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!(0, _is.isNode)(condition)) throw new TypeError("Parameter condition must be a Node");if (!(0, _is.isNode)(trueExpr)) throw new TypeError("Parameter trueExpr must be a Node");if (!(0, _is.isNode)(falseExpr)) throw new TypeError("Parameter falseExpr must be a Node");this.condition = condition, this.trueExpr = trueExpr, this.falseExpr = falseExpr;}function testCondition(condition) {if ("number" == typeof condition || "boolean" == typeof condition || "string" == typeof condition) return !!condition;if (condition) {if ((0, _is.isBigNumber)(condition)) return !condition.isZero();if ((0, _is.isComplex)(condition)) return !!(condition.re || condition.im);if ((0, _is.isUnit)(condition)) return !!condition.value;}if (null === condition || void 0 === condition) return !1;throw new TypeError("Unsupported type of condition \"" + (0, _is.typeOf)(condition) + "\"");}var Node = _ref.Node;return ConditionalNode.prototype = new Node(), ConditionalNode.prototype.type = "ConditionalNode", ConditionalNode.prototype.isConditionalNode = !0, ConditionalNode.prototype._compile = function (math, argNames) {var evalCondition = this.condition._compile(math, argNames),evalTrueExpr = this.trueExpr._compile(math, argNames),evalFalseExpr = this.falseExpr._compile(math, argNames);return function (scope, args, context) {return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context);};}, ConditionalNode.prototype.forEach = function (callback) {callback(this.condition, "condition", this), callback(this.trueExpr, "trueExpr", this), callback(this.falseExpr, "falseExpr", this);}, ConditionalNode.prototype.map = function (callback) {return new ConditionalNode(this._ifNode(callback(this.condition, "condition", this)), this._ifNode(callback(this.trueExpr, "trueExpr", this)), this._ifNode(callback(this.falseExpr, "falseExpr", this)));}, ConditionalNode.prototype.clone = function () {return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr);}, ConditionalNode.prototype._toString = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",precedence = (0, _operators.getPrecedence)(this, parenthesis),condition = this.condition.toString(options),conditionPrecedence = (0, _operators.getPrecedence)(this.condition, parenthesis);("all" === parenthesis || "OperatorNode" === this.condition.type || null !== conditionPrecedence && conditionPrecedence <= precedence) && (condition = "(" + condition + ")");var trueExpr = this.trueExpr.toString(options),truePrecedence = (0, _operators.getPrecedence)(this.trueExpr, parenthesis);("all" === parenthesis || "OperatorNode" === this.trueExpr.type || null !== truePrecedence && truePrecedence <= precedence) && (trueExpr = "(" + trueExpr + ")");var falseExpr = this.falseExpr.toString(options),falsePrecedence = (0, _operators.getPrecedence)(this.falseExpr, parenthesis);return ("all" === parenthesis || "OperatorNode" === this.falseExpr.type || null !== falsePrecedence && falsePrecedence <= precedence) && (falseExpr = "(" + falseExpr + ")"), condition + " ? " + trueExpr + " : " + falseExpr;}, ConditionalNode.prototype.toJSON = function () {return { mathjs: "ConditionalNode", condition: this.condition, trueExpr: this.trueExpr, falseExpr: this.falseExpr };}, ConditionalNode.fromJSON = function (json) {return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr);}, ConditionalNode.prototype.toHTML = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",precedence = (0, _operators.getPrecedence)(this, parenthesis),condition = this.condition.toHTML(options),conditionPrecedence = (0, _operators.getPrecedence)(this.condition, parenthesis);("all" === parenthesis || "OperatorNode" === this.condition.type || null !== conditionPrecedence && conditionPrecedence <= precedence) && (condition = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + condition + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>");var trueExpr = this.trueExpr.toHTML(options),truePrecedence = (0, _operators.getPrecedence)(this.trueExpr, parenthesis);("all" === parenthesis || "OperatorNode" === this.trueExpr.type || null !== truePrecedence && truePrecedence <= precedence) && (trueExpr = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + trueExpr + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>");var falseExpr = this.falseExpr.toHTML(options),falsePrecedence = (0, _operators.getPrecedence)(this.falseExpr, parenthesis);return ("all" === parenthesis || "OperatorNode" === this.falseExpr.type || null !== falsePrecedence && falsePrecedence <= precedence) && (falseExpr = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + falseExpr + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), condition + "<span class=\"math-operator math-conditional-operator\">?</span>" + trueExpr + "<span class=\"math-operator math-conditional-operator\">:</span>" + falseExpr;}, ConditionalNode.prototype._toTex = function (options) {return "\\begin{cases} {" + this.trueExpr.toTex(options) + "}, &\\quad{\\text{if }\\;" + this.condition.toTex(options) + "}\\\\{" + this.falseExpr.toTex(options) + "}, &\\quad{\\text{otherwise}}\\end{cases}";}, ConditionalNode;}, { isClass: !0, isNode: !0 });exports.createConditionalNode = createConditionalNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/ConstantNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createConstantNode = void 0;var _string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_latex = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/latex.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "ConstantNode",dependencies = ["Node"],createConstantNode = (0, _factory.factory)(name, dependencies, function (_ref) {function ConstantNode(value) {if (!(this instanceof ConstantNode)) throw new SyntaxError("Constructor must be called with the new operator");this.value = value;}var Node = _ref.Node;return ConstantNode.prototype = new Node(), ConstantNode.prototype.type = "ConstantNode", ConstantNode.prototype.isConstantNode = !0, ConstantNode.prototype._compile = function () {var value = this.value;return function () {return value;};}, ConstantNode.prototype.forEach = function () {}, ConstantNode.prototype.map = function () {return this.clone();}, ConstantNode.prototype.clone = function () {return new ConstantNode(this.value);}, ConstantNode.prototype._toString = function (options) {return (0, _string.format)(this.value, options);}, ConstantNode.prototype.toHTML = function (options) {var value = this._toString(options);switch ((0, _is.typeOf)(this.value)) {case "number":case "BigNumber":case "Fraction":return "<span class=\"math-number\">" + value + "</span>";case "string":return "<span class=\"math-string\">" + value + "</span>";case "boolean":return "<span class=\"math-boolean\">" + value + "</span>";case "null":return "<span class=\"math-null-symbol\">" + value + "</span>";case "undefined":return "<span class=\"math-undefined\">" + value + "</span>";default:return "<span class=\"math-symbol\">" + value + "</span>";}}, ConstantNode.prototype.toJSON = function () {return { mathjs: "ConstantNode", value: this.value };}, ConstantNode.fromJSON = function (json) {return new ConstantNode(json.value);}, ConstantNode.prototype._toTex = function (options) {var value = this._toString(options);switch ((0, _is.typeOf)(this.value)) {case "string":return "\\mathtt{" + (0, _latex.escapeLatex)(value) + "}";case "number":case "BigNumber":{if (!isFinite(this.value)) return 0 > this.value.valueOf() ? "-\\infty" : "\\infty";var index = value.toLowerCase().indexOf("e");if (-1 !== index) return value.substring(0, index) + "\\cdot10^{" + value.substring(index + 1) + "}";}return value;case "Fraction":return this.value.toLatex();default:return value;}}, ConstantNode;}, { isClass: !0, isNode: !0 });exports.createConstantNode = createConstantNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/FunctionAssignmentNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFunctionAssignmentNode = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_keywords = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/keywords.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_latex = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/latex.js"),_operators = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/operators.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "FunctionAssignmentNode",dependencies = ["typed", "Node"],createFunctionAssignmentNode = (0, _factory.factory)(name, dependencies, function (_ref) {function FunctionAssignmentNode(name, params, expr) {if (!(this instanceof FunctionAssignmentNode)) throw new SyntaxError("Constructor must be called with the new operator");if ("string" != typeof name) throw new TypeError("String expected for parameter \"name\"");if (!Array.isArray(params)) throw new TypeError("Array containing strings or objects expected for parameter \"params\"");if (!(0, _is.isNode)(expr)) throw new TypeError("Node expected for parameter \"expr\"");if (_keywords.keywords.has(name)) throw new Error("Illegal function name, \"" + name + "\" is a reserved keyword");this.name = name, this.params = params.map(function (param) {return param && param.name || param;}), this.types = params.map(function (param) {return param && param.type || "any";}), this.expr = expr;}function needParenthesis(node, parenthesis) {var precedence = (0, _operators.getPrecedence)(node, parenthesis),exprPrecedence = (0, _operators.getPrecedence)(node.expr, parenthesis);return "all" === parenthesis || null !== exprPrecedence && exprPrecedence <= precedence;}var typed = _ref.typed,Node = _ref.Node;return FunctionAssignmentNode.prototype = new Node(), FunctionAssignmentNode.prototype.type = "FunctionAssignmentNode", FunctionAssignmentNode.prototype.isFunctionAssignmentNode = !0, FunctionAssignmentNode.prototype._compile = function (math, argNames) {var childArgNames = Object.create(argNames);(0, _array.forEach)(this.params, function (param) {childArgNames[param] = !0;});var evalExpr = this.expr._compile(math, childArgNames),name = this.name,params = this.params,signature = (0, _array.join)(this.types, ","),syntax = name + "(" + (0, _array.join)(this.params, ", ") + ")";return function (scope, args, context) {var signatures = {};signatures[signature] = function () {for (var childArgs = Object.create(args), i = 0; i < params.length; i++) childArgs[params[i]] = arguments[i];return evalExpr(scope, childArgs, context);};var fn = typed(name, signatures);return fn.syntax = syntax, scope.set(name, fn), fn;};}, FunctionAssignmentNode.prototype.forEach = function (callback) {callback(this.expr, "expr", this);}, FunctionAssignmentNode.prototype.map = function (callback) {var expr = this._ifNode(callback(this.expr, "expr", this));return new FunctionAssignmentNode(this.name, this.params.slice(0), expr);}, FunctionAssignmentNode.prototype.clone = function () {return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr);}, FunctionAssignmentNode.prototype._toString = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",expr = this.expr.toString(options);return needParenthesis(this, parenthesis) && (expr = "(" + expr + ")"), this.name + "(" + this.params.join(", ") + ") = " + expr;}, FunctionAssignmentNode.prototype.toJSON = function () {var types = this.types;return { mathjs: "FunctionAssignmentNode", name: this.name, params: this.params.map(function (param, index) {return { name: param, type: types[index] };}), expr: this.expr };}, FunctionAssignmentNode.fromJSON = function (json) {return new FunctionAssignmentNode(json.name, json.params, json.expr);}, FunctionAssignmentNode.prototype.toHTML = function (options) {for (var parenthesis = options && options.parenthesis ? options.parenthesis : "keep", params = [], i = 0; i < this.params.length; i++) params.push("<span class=\"math-symbol math-parameter\">" + (0, _string.escape)(this.params[i]) + "</span>");var expr = this.expr.toHTML(options);return needParenthesis(this, parenthesis) && (expr = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + expr + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), "<span class=\"math-function\">" + (0, _string.escape)(this.name) + "</span><span class=\"math-parenthesis math-round-parenthesis\">(</span>" + params.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-parenthesis math-round-parenthesis\">)</span><span class=\"math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator\">=</span>" + expr;}, FunctionAssignmentNode.prototype._toTex = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",expr = this.expr.toTex(options);return needParenthesis(this, parenthesis) && (expr = "\\left(".concat(expr, "\\right)")), "\\mathrm{" + this.name + "}\\left(" + this.params.map(_latex.toSymbol).join(",") + "\\right):=" + expr;}, FunctionAssignmentNode;}, { isClass: !0, isNode: !0 });exports.createFunctionAssignmentNode = createFunctionAssignmentNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/FunctionNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFunctionNode = void 0;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_toConsumableArray2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_scope = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/scope.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_latex = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/latex.js"),name = "FunctionNode",dependencies = ["math", "Node", "SymbolNode"],createFunctionNode = (0, _factory.factory)(name, dependencies, function (_ref) {function FunctionNode(fn, args) {if (!(this instanceof FunctionNode)) throw new SyntaxError("Constructor must be called with the new operator");if ("string" == typeof fn && (fn = new SymbolNode(fn)), !(0, _is.isNode)(fn)) throw new TypeError("Node expected as parameter \"fn\"");if (!Array.isArray(args) || !args.every(_is.isNode)) throw new TypeError("Array containing Nodes expected for parameter \"args\"");this.fn = fn, this.args = args || [], Object.defineProperty(this, "name", { get: function () {return this.fn.name || "";}.bind(this), set: function () {throw new Error("Cannot assign a new name, name is read-only");} });}function expandTemplate(template, node, options) {for (var match, latex = "", regex = /\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi, inputPos = 0; null !== (match = regex.exec(template));) if (latex += template.substring(inputPos, match.index), inputPos = match.index, "$$" === match[0]) latex += "$", inputPos++;else {inputPos += match[0].length;var property = node[match[1]];if (!property) throw new ReferenceError("Template: Property " + match[1] + " does not exist.");if (void 0 === match[2]) switch ((0, _typeof2["default"])(property)) {case "string":latex += property;break;case "object":if ((0, _is.isNode)(property)) latex += property.toTex(options);else if (Array.isArray(property)) latex += property.map(function (arg, index) {if ((0, _is.isNode)(arg)) return arg.toTex(options);throw new TypeError("Template: " + match[1] + "[" + index + "] is not a Node.");}).join(",");else throw new TypeError("Template: " + match[1] + " has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: " + match[1] + " has to be a Node, String or array of Nodes");} else if ((0, _is.isNode)(property[match[2]] && property[match[2]])) latex += property[match[2]].toTex(options);else throw new TypeError("Template: " + match[1] + "[" + match[2] + "] is not a Node.");}return latex += template.slice(inputPos), latex;}var math = _ref.math,Node = _ref.Node,SymbolNode = _ref.SymbolNode;FunctionNode.prototype = new Node(), FunctionNode.prototype.type = "FunctionNode", FunctionNode.prototype.isFunctionNode = !0, FunctionNode.prototype._compile = function (math, argNames) {if (!(this instanceof FunctionNode)) throw new TypeError("No valid FunctionNode");var evalArgs = this.args.map(function (arg) {return arg._compile(math, argNames);});if ((0, _is.isSymbolNode)(this.fn)) {var _name = this.fn.name,fn = _name in math ? (0, _customs.getSafeProperty)(math, _name) : void 0,isRaw = "function" == typeof fn && !0 === fn.rawArgs,resolveFn = function (scope) {return scope.has(_name) ? scope.get(_name) : _name in math ? (0, _customs.getSafeProperty)(math, _name) : FunctionNode.onUndefinedFunction(_name);};if (isRaw) {var rawArgs = this.args;return function (scope, args) {var fn = resolveFn(scope);return fn(rawArgs, math, (0, _scope.createSubScope)(scope, args), scope);};}switch (evalArgs.length) {case 0:return function (scope) {var fn = resolveFn(scope);return fn();};case 1:return function (scope, args, context) {var fn = resolveFn(scope),evalArg0 = evalArgs[0];return fn(evalArg0(scope, args, context));};case 2:return function (scope, args, context) {var fn = resolveFn(scope),evalArg0 = evalArgs[0],evalArg1 = evalArgs[1];return fn(evalArg0(scope, args, context), evalArg1(scope, args, context));};default:return function (scope, args, context) {var fn = resolveFn(scope),values = evalArgs.map(function (evalArg) {return evalArg(scope, args, context);});return fn.apply(void 0, (0, _toConsumableArray2["default"])(values));};}} else {if ((0, _is.isAccessorNode)(this.fn) && (0, _is.isIndexNode)(this.fn.index) && this.fn.index.isObjectProperty()) {var evalObject = this.fn.object._compile(math, argNames),prop = this.fn.index.getObjectProperty(),_rawArgs = this.args;return function (scope, args, context) {var object = evalObject(scope, args, context);(0, _customs.validateSafeMethod)(object, prop);var isRaw = object[prop] && object[prop].rawArgs;if (isRaw) return object[prop](_rawArgs, math, (0, _scope.createSubScope)(scope, args), scope);var values = evalArgs.map(function (evalArg) {return evalArg(scope, args, context);});return object[prop].apply(object, values);};}var evalFn = this.fn._compile(math, argNames),_rawArgs2 = this.args;return function (scope, args, context) {var fn = evalFn(scope, args, context),isRaw = fn && fn.rawArgs;if (isRaw) return fn(_rawArgs2, math, (0, _scope.createSubScope)(scope, args), scope);var values = evalArgs.map(function (evalArg) {return evalArg(scope, args, context);});return fn.apply(fn, values);};}}, FunctionNode.prototype.forEach = function (callback) {callback(this.fn, "fn", this);for (var i = 0; i < this.args.length; i++) callback(this.args[i], "args[" + i + "]", this);}, FunctionNode.prototype.map = function (callback) {for (var fn = this._ifNode(callback(this.fn, "fn", this)), args = [], i = 0; i < this.args.length; i++) args[i] = this._ifNode(callback(this.args[i], "args[" + i + "]", this));return new FunctionNode(fn, args);}, FunctionNode.prototype.clone = function () {return new FunctionNode(this.fn, this.args.slice(0));}, FunctionNode.onUndefinedFunction = function (name) {throw new Error("Undefined function " + name);};var nodeToString = FunctionNode.prototype.toString;FunctionNode.prototype.toString = function (options) {var customString,name = this.fn.toString(options);return options && "object" === (0, _typeof2["default"])(options.handler) && (0, _object.hasOwnProperty)(options.handler, name) && (customString = options.handler[name](this, options)), "undefined" == typeof customString ? nodeToString.call(this, options) : customString;}, FunctionNode.prototype._toString = function (options) {var args = this.args.map(function (arg) {return arg.toString(options);}),fn = (0, _is.isFunctionAssignmentNode)(this.fn) ? "(" + this.fn.toString(options) + ")" : this.fn.toString(options);return fn + "(" + args.join(", ") + ")";}, FunctionNode.prototype.toJSON = function () {return { mathjs: "FunctionNode", fn: this.fn, args: this.args };}, FunctionNode.fromJSON = function (json) {return new FunctionNode(json.fn, json.args);}, FunctionNode.prototype.toHTML = function (options) {var args = this.args.map(function (arg) {return arg.toHTML(options);});return "<span class=\"math-function\">" + (0, _string.escape)(this.fn) + "</span><span class=\"math-paranthesis math-round-parenthesis\">(</span>" + args.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-paranthesis math-round-parenthesis\">)</span>";};var nodeToTex = FunctionNode.prototype.toTex;return FunctionNode.prototype.toTex = function (options) {var customTex;return options && "object" === (0, _typeof2["default"])(options.handler) && (0, _object.hasOwnProperty)(options.handler, this.name) && (customTex = options.handler[this.name](this, options)), "undefined" == typeof customTex ? nodeToTex.call(this, options) : customTex;}, FunctionNode.prototype._toTex = function (options) {var latexConverter,args = this.args.map(function (arg) {return arg.toTex(options);});_latex.latexFunctions[this.name] && (latexConverter = _latex.latexFunctions[this.name]), math[this.name] && ("function" == typeof math[this.name].toTex || "object" === (0, _typeof2["default"])(math[this.name].toTex) || "string" == typeof math[this.name].toTex) && (latexConverter = math[this.name].toTex);var customToTex;switch ((0, _typeof2["default"])(latexConverter)) {case "function":customToTex = latexConverter(this, options);break;case "string":customToTex = expandTemplate(latexConverter, this, options);break;case "object":switch ((0, _typeof2["default"])(latexConverter[args.length])) {case "function":customToTex = latexConverter[args.length](this, options);break;case "string":customToTex = expandTemplate(latexConverter[args.length], this, options);}}return "undefined" == typeof customToTex ? expandTemplate(_latex.defaultTemplate, this, options) : customToTex;}, FunctionNode.prototype.getIdentifier = function () {return this.type + ":" + this.name;}, FunctionNode;}, { isClass: !0, isNode: !0 });exports.createFunctionNode = createFunctionNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/IndexNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIndexNode = void 0;var _toConsumableArray2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),name = "IndexNode",dependencies = ["Range", "Node", "size"],createIndexNode = (0, _factory.factory)(name, dependencies, function (_ref) {function IndexNode(dimensions, dotNotation) {if (!(this instanceof IndexNode)) throw new SyntaxError("Constructor must be called with the new operator");if (this.dimensions = dimensions, this.dotNotation = dotNotation || !1, !Array.isArray(dimensions) || !dimensions.every(_is.isNode)) throw new TypeError("Array containing Nodes expected for parameter \"dimensions\"");if (this.dotNotation && !this.isObjectProperty()) throw new Error("dotNotation only applicable for object properties");}function createRange(start, end, step) {return new Range((0, _is.isBigNumber)(start) ? start.toNumber() : start, (0, _is.isBigNumber)(end) ? end.toNumber() : end, (0, _is.isBigNumber)(step) ? step.toNumber() : step);}var Range = _ref.Range,Node = _ref.Node,size = _ref.size;return IndexNode.prototype = new Node(), IndexNode.prototype.type = "IndexNode", IndexNode.prototype.isIndexNode = !0, IndexNode.prototype._compile = function (math, argNames) {var evalDimensions = (0, _array.map)(this.dimensions, function (range, i) {if ((0, _is.isRangeNode)(range)) {if (range.needsEnd()) {var childArgNames = Object.create(argNames);childArgNames.end = !0;var evalStart = range.start._compile(math, childArgNames),evalEnd = range.end._compile(math, childArgNames),evalStep = range.step ? range.step._compile(math, childArgNames) : function () {return 1;};return function (scope, args, context) {var s = size(context).valueOf(),childArgs = Object.create(args);return childArgs.end = s[i], createRange(evalStart(scope, childArgs, context), evalEnd(scope, childArgs, context), evalStep(scope, childArgs, context));};}var _evalStart = range.start._compile(math, argNames),_evalEnd = range.end._compile(math, argNames),_evalStep = range.step ? range.step._compile(math, argNames) : function () {return 1;};return function (scope, args, context) {return createRange(_evalStart(scope, args, context), _evalEnd(scope, args, context), _evalStep(scope, args, context));};}if ((0, _is.isSymbolNode)(range) && "end" === range.name) {var _childArgNames = Object.create(argNames);_childArgNames.end = !0;var evalRange = range._compile(math, _childArgNames);return function (scope, args, context) {var s = size(context).valueOf(),childArgs = Object.create(args);return childArgs.end = s[i], evalRange(scope, childArgs, context);};}var _evalRange = range._compile(math, argNames);return function (scope, args, context) {return _evalRange(scope, args, context);};}),index = (0, _customs.getSafeProperty)(math, "index");return function (scope, args, context) {var dimensions = (0, _array.map)(evalDimensions, function (evalDimension) {return evalDimension(scope, args, context);});return index.apply(void 0, (0, _toConsumableArray2["default"])(dimensions));};}, IndexNode.prototype.forEach = function (callback) {for (var i = 0; i < this.dimensions.length; i++) callback(this.dimensions[i], "dimensions[" + i + "]", this);}, IndexNode.prototype.map = function (callback) {for (var dimensions = [], i = 0; i < this.dimensions.length; i++) dimensions[i] = this._ifNode(callback(this.dimensions[i], "dimensions[" + i + "]", this));return new IndexNode(dimensions, this.dotNotation);}, IndexNode.prototype.clone = function () {return new IndexNode(this.dimensions.slice(0), this.dotNotation);}, IndexNode.prototype.isObjectProperty = function () {return 1 === this.dimensions.length && (0, _is.isConstantNode)(this.dimensions[0]) && "string" == typeof this.dimensions[0].value;}, IndexNode.prototype.getObjectProperty = function () {return this.isObjectProperty() ? this.dimensions[0].value : null;}, IndexNode.prototype._toString = function () {return this.dotNotation ? "." + this.getObjectProperty() : "[" + this.dimensions.join(", ") + "]";}, IndexNode.prototype.toJSON = function () {return { mathjs: "IndexNode", dimensions: this.dimensions, dotNotation: this.dotNotation };}, IndexNode.fromJSON = function (json) {return new IndexNode(json.dimensions, json.dotNotation);}, IndexNode.prototype.toHTML = function () {for (var dimensions = [], i = 0; i < this.dimensions.length; i++) dimensions[i] = this.dimensions[i].toHTML();return this.dotNotation ? "<span class=\"math-operator math-accessor-operator\">.</span><span class=\"math-symbol math-property\">" + (0, _string.escape)(this.getObjectProperty()) + "</span>" : "<span class=\"math-parenthesis math-square-parenthesis\">[</span>" + dimensions.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-parenthesis math-square-parenthesis\">]</span>";}, IndexNode.prototype._toTex = function (options) {var dimensions = this.dimensions.map(function (range) {return range.toTex(options);});return this.dotNotation ? "." + this.getObjectProperty() + "" : "_{" + dimensions.join(",") + "}";}, IndexNode;}, { isClass: !0, isNode: !0 });exports.createIndexNode = createIndexNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/Node.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createNode = void 0;var _toConsumableArray2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js")),_typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_keywords = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/keywords.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_map = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/map.js"),name = "Node",dependencies = ["mathWithTransform"],createNode = (0, _factory.factory)(name, dependencies, function (_ref) {function Node() {if (!(this instanceof Node)) throw new SyntaxError("Constructor must be called with the new operator");}function _validateScope(scope) {for (var symbol, _i = 0, _arr = (0, _toConsumableArray2["default"])(_keywords.keywords); _i < _arr.length; _i++) if (symbol = _arr[_i], scope.has(symbol)) throw new Error("Scope contains an illegal symbol, \"" + symbol + "\" is a reserved keyword");}var mathWithTransform = _ref.mathWithTransform;return Node.prototype.evaluate = function (scope) {return this.compile().evaluate(scope);}, Node.prototype.type = "Node", Node.prototype.isNode = !0, Node.prototype.comment = "", Node.prototype.compile = function () {var expr = this._compile(mathWithTransform, {}),args = {};return { evaluate: function (scope) {var s = (0, _map.createMap)(scope);return _validateScope(s), expr(s, args, null);} };}, Node.prototype._compile = function () {throw new Error("Method _compile should be implemented by type " + this.type);}, Node.prototype.forEach = function () {throw new Error("Cannot run forEach on a Node interface");}, Node.prototype.map = function () {throw new Error("Cannot run map on a Node interface");}, Node.prototype._ifNode = function (node) {if (!(0, _is.isNode)(node)) throw new TypeError("Callback function must return a Node");return node;}, Node.prototype.traverse = function (callback) {function _traverse(node, callback) {node.forEach(function (child, path, parent) {callback(child, path, parent), _traverse(child, callback);});}callback(this, null, null), _traverse(this, callback);}, Node.prototype.transform = function (callback) {function _transform(child, path, parent) {var replacement = callback(child, path, parent);return replacement === child ? child.map(_transform) : replacement;}return _transform(this, null, null);}, Node.prototype.filter = function (callback) {var nodes = [];return this.traverse(function (node, path, parent) {callback(node, path, parent) && nodes.push(node);}), nodes;}, Node.prototype.clone = function () {throw new Error("Cannot clone a Node interface");}, Node.prototype.cloneDeep = function () {return this.map(function (node) {return node.cloneDeep();});}, Node.prototype.equals = function (other) {return !!other && (0, _object.deepStrictEqual)(this, other);}, Node.prototype.toString = function (options) {var customString = this._getCustomString(options);return "undefined" == typeof customString ? this._toString(options) : customString;}, Node.prototype.toJSON = function () {throw new Error("Cannot serialize object: toJSON not implemented by " + this.type);}, Node.prototype.toHTML = function (options) {var customString = this._getCustomString(options);return "undefined" == typeof customString ? this.toHTML(options) : customString;}, Node.prototype._toString = function () {throw new Error("_toString not implemented for " + this.type);}, Node.prototype.toTex = function (options) {var customString = this._getCustomString(options);return "undefined" == typeof customString ? this._toTex(options) : customString;}, Node.prototype._toTex = function () {throw new Error("_toTex not implemented for " + this.type);}, Node.prototype._getCustomString = function (options) {if (options && "object" === (0, _typeof2["default"])(options)) switch ((0, _typeof2["default"])(options.handler)) {case "object":case "undefined":return;case "function":return options.handler(this, options);default:throw new TypeError("Object or function expected as callback");}}, Node.prototype.getIdentifier = function () {return this.type;}, Node.prototype.getContent = function () {return this;}, Node;}, { isClass: !0, isNode: !0 });exports.createNode = createNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/ObjectNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createObjectNode = void 0;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "ObjectNode",dependencies = ["Node"],createObjectNode = (0, _factory.factory)(name, dependencies, function (_ref) {function ObjectNode(properties) {if (!(this instanceof ObjectNode)) throw new SyntaxError("Constructor must be called with the new operator");if (this.properties = properties || {}, properties && ("object" !== (0, _typeof2["default"])(properties) || !Object.keys(properties).every(function (key) {return (0, _is.isNode)(properties[key]);}))) throw new TypeError("Object containing Nodes expected");}var Node = _ref.Node;return ObjectNode.prototype = new Node(), ObjectNode.prototype.type = "ObjectNode", ObjectNode.prototype.isObjectNode = !0, ObjectNode.prototype._compile = function (math, argNames) {var evalEntries = {};for (var key in this.properties) if ((0, _object.hasOwnProperty)(this.properties, key)) {var stringifiedKey = (0, _string.stringify)(key),parsedKey = JSON.parse(stringifiedKey);if (!(0, _customs.isSafeProperty)(this.properties, parsedKey)) throw new Error("No access to property \"" + parsedKey + "\"");evalEntries[parsedKey] = this.properties[key]._compile(math, argNames);}return function (scope, args, context) {var obj = {};for (var _key in evalEntries) (0, _object.hasOwnProperty)(evalEntries, _key) && (obj[_key] = evalEntries[_key](scope, args, context));return obj;};}, ObjectNode.prototype.forEach = function (callback) {for (var key in this.properties) (0, _object.hasOwnProperty)(this.properties, key) && callback(this.properties[key], "properties[" + (0, _string.stringify)(key) + "]", this);}, ObjectNode.prototype.map = function (callback) {var properties = {};for (var key in this.properties) (0, _object.hasOwnProperty)(this.properties, key) && (properties[key] = this._ifNode(callback(this.properties[key], "properties[" + (0, _string.stringify)(key) + "]", this)));return new ObjectNode(properties);}, ObjectNode.prototype.clone = function () {var properties = {};for (var key in this.properties) (0, _object.hasOwnProperty)(this.properties, key) && (properties[key] = this.properties[key]);return new ObjectNode(properties);}, ObjectNode.prototype._toString = function (options) {var entries = [];for (var key in this.properties) (0, _object.hasOwnProperty)(this.properties, key) && entries.push((0, _string.stringify)(key) + ": " + this.properties[key].toString(options));return "{" + entries.join(", ") + "}";}, ObjectNode.prototype.toJSON = function () {return { mathjs: "ObjectNode", properties: this.properties };}, ObjectNode.fromJSON = function (json) {return new ObjectNode(json.properties);}, ObjectNode.prototype.toHTML = function (options) {var entries = [];for (var key in this.properties) (0, _object.hasOwnProperty)(this.properties, key) && entries.push("<span class=\"math-symbol math-property\">" + (0, _string.escape)(key) + "</span><span class=\"math-operator math-assignment-operator math-property-assignment-operator math-binary-operator\">:</span>" + this.properties[key].toHTML(options));return "<span class=\"math-parenthesis math-curly-parenthesis\">{</span>" + entries.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-parenthesis math-curly-parenthesis\">}</span>";}, ObjectNode.prototype._toTex = function (options) {var entries = [];for (var key in this.properties) (0, _object.hasOwnProperty)(this.properties, key) && entries.push("\\mathbf{" + key + ":} & " + this.properties[key].toTex(options) + "\\\\");return "\\left\\{\\begin{array}{ll}".concat(entries.join("\n"), "\\end{array}\\right\\}");}, ObjectNode;}, { isClass: !0, isNode: !0 });exports.createObjectNode = createObjectNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/OperatorNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createOperatorNode = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_operators = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/operators.js"),_latex = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/latex.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "OperatorNode",dependencies = ["Node"],createOperatorNode = (0, _factory.factory)(name, dependencies, function (_ref) {function OperatorNode(op, fn, args, implicit) {if (!(this instanceof OperatorNode)) throw new SyntaxError("Constructor must be called with the new operator");if ("string" != typeof op) throw new TypeError("string expected for parameter \"op\"");if ("string" != typeof fn) throw new TypeError("string expected for parameter \"fn\"");if (!Array.isArray(args) || !args.every(_is.isNode)) throw new TypeError("Array containing Nodes expected for parameter \"args\"");this.implicit = !0 === implicit, this.op = op, this.fn = fn, this.args = args || [];}function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) {var precedence = (0, _operators.getPrecedence)(root, parenthesis),associativity = (0, _operators.getAssociativity)(root, parenthesis);if ("all" === parenthesis || 2 < args.length && "OperatorNode:add" !== root.getIdentifier() && "OperatorNode:multiply" !== root.getIdentifier()) return args.map(function (arg) {switch (arg.getContent().type) {case "ArrayNode":case "ConstantNode":case "SymbolNode":case "ParenthesisNode":return !1;default:return !0;}});var result;switch (args.length) {case 0:result = [];break;case 1:{var operandPrecedence = (0, _operators.getPrecedence)(args[0], parenthesis);if (latex && null !== operandPrecedence) {var operandIdentifier, rootIdentifier;if ("keep" === parenthesis ? (operandIdentifier = args[0].getIdentifier(), rootIdentifier = root.getIdentifier()) : (operandIdentifier = args[0].getContent().getIdentifier(), rootIdentifier = root.getContent().getIdentifier()), !1 === _operators.properties[precedence][rootIdentifier].latexLeftParens) {result = [!1];break;}if (!1 === _operators.properties[operandPrecedence][operandIdentifier].latexParens) {result = [!1];break;}}if (null === operandPrecedence) {result = [!1];break;}if (operandPrecedence <= precedence) {result = [!0];break;}result = [!1];}break;case 2:{var lhsParens,lhsPrecedence = (0, _operators.getPrecedence)(args[0], parenthesis),assocWithLhs = (0, _operators.isAssociativeWith)(root, args[0], parenthesis);lhsParens = null !== lhsPrecedence && (!(lhsPrecedence !== precedence || "right" !== associativity || assocWithLhs) || !!(lhsPrecedence < precedence));var rhsParens,rhsPrecedence = (0, _operators.getPrecedence)(args[1], parenthesis),assocWithRhs = (0, _operators.isAssociativeWith)(root, args[1], parenthesis);if (rhsParens = null !== rhsPrecedence && (!(rhsPrecedence !== precedence || "left" !== associativity || assocWithRhs) || !!(rhsPrecedence < precedence)), latex) {var _rootIdentifier, lhsIdentifier, rhsIdentifier;"keep" === parenthesis ? (_rootIdentifier = root.getIdentifier(), lhsIdentifier = root.args[0].getIdentifier(), rhsIdentifier = root.args[1].getIdentifier()) : (_rootIdentifier = root.getContent().getIdentifier(), lhsIdentifier = root.args[0].getContent().getIdentifier(), rhsIdentifier = root.args[1].getContent().getIdentifier()), null !== lhsPrecedence && (!1 === _operators.properties[precedence][_rootIdentifier].latexLeftParens && (lhsParens = !1), !1 === _operators.properties[lhsPrecedence][lhsIdentifier].latexParens && (lhsParens = !1)), null !== rhsPrecedence && (!1 === _operators.properties[precedence][_rootIdentifier].latexRightParens && (rhsParens = !1), !1 === _operators.properties[rhsPrecedence][rhsIdentifier].latexParens && (rhsParens = !1));}result = [lhsParens, rhsParens];}break;default:("OperatorNode:add" === root.getIdentifier() || "OperatorNode:multiply" === root.getIdentifier()) && (result = args.map(function (arg) {var argPrecedence = (0, _operators.getPrecedence)(arg, parenthesis),assocWithArg = (0, _operators.isAssociativeWith)(root, arg, parenthesis),argAssociativity = (0, _operators.getAssociativity)(arg, parenthesis);return null !== argPrecedence && (!(precedence !== argPrecedence || associativity !== argAssociativity || assocWithArg) || !!(argPrecedence < precedence));}));}return 2 <= args.length && "OperatorNode:multiply" === root.getIdentifier() && root.implicit && "auto" === parenthesis && "hide" === implicit && (result = args.map(function (arg, index) {var isParenthesisNode = "ParenthesisNode" === arg.getIdentifier();return !!(result[index] || isParenthesisNode);})), result;}var Node = _ref.Node;return OperatorNode.prototype = new Node(), OperatorNode.prototype.type = "OperatorNode", OperatorNode.prototype.isOperatorNode = !0, OperatorNode.prototype._compile = function (math, argNames) {if ("string" != typeof this.fn || !(0, _customs.isSafeMethod)(math, this.fn)) if (!math[this.fn]) throw new Error("Function " + this.fn + " missing in provided namespace \"math\"");else throw new Error("No access to function \"" + this.fn + "\"");var fn = (0, _customs.getSafeProperty)(math, this.fn),evalArgs = (0, _array.map)(this.args, function (arg) {return arg._compile(math, argNames);});if (1 === evalArgs.length) {var evalArg0 = evalArgs[0];return function (scope, args, context) {return fn(evalArg0(scope, args, context));};}if (2 === evalArgs.length) {var _evalArg = evalArgs[0],evalArg1 = evalArgs[1];return function (scope, args, context) {return fn(_evalArg(scope, args, context), evalArg1(scope, args, context));};}return function (scope, args, context) {return fn.apply(null, (0, _array.map)(evalArgs, function (evalArg) {return evalArg(scope, args, context);}));};}, OperatorNode.prototype.forEach = function (callback) {for (var i = 0; i < this.args.length; i++) callback(this.args[i], "args[" + i + "]", this);}, OperatorNode.prototype.map = function (callback) {for (var args = [], i = 0; i < this.args.length; i++) args[i] = this._ifNode(callback(this.args[i], "args[" + i + "]", this));return new OperatorNode(this.op, this.fn, args, this.implicit);}, OperatorNode.prototype.clone = function () {return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit);}, OperatorNode.prototype.isUnary = function () {return 1 === this.args.length;}, OperatorNode.prototype.isBinary = function () {return 2 === this.args.length;}, OperatorNode.prototype._toString = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",implicit = options && options.implicit ? options.implicit : "hide",args = this.args,parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, !1);if (1 === args.length) {var assoc = (0, _operators.getAssociativity)(this, parenthesis),operand = args[0].toString(options);parens[0] && (operand = "(" + operand + ")");var opIsNamed = /[a-zA-Z]+/.test(this.op);return "right" === assoc ? this.op + (opIsNamed ? " " : "") + operand : "left" === assoc ? operand + (opIsNamed ? " " : "") + this.op : operand + this.op;}if (2 === args.length) {var lhs = args[0].toString(options),rhs = args[1].toString(options);return parens[0] && (lhs = "(" + lhs + ")"), parens[1] && (rhs = "(" + rhs + ")"), this.implicit && "OperatorNode:multiply" === this.getIdentifier() && "hide" === implicit ? lhs + " " + rhs : lhs + " " + this.op + " " + rhs;}if (2 < args.length && ("OperatorNode:add" === this.getIdentifier() || "OperatorNode:multiply" === this.getIdentifier())) {var stringifiedArgs = args.map(function (arg, index) {return arg = arg.toString(options), parens[index] && (arg = "(" + arg + ")"), arg;});return this.implicit && "OperatorNode:multiply" === this.getIdentifier() && "hide" === implicit ? stringifiedArgs.join(" ") : stringifiedArgs.join(" " + this.op + " ");}return this.fn + "(" + this.args.join(", ") + ")";}, OperatorNode.prototype.toJSON = function () {return { mathjs: "OperatorNode", op: this.op, fn: this.fn, args: this.args, implicit: this.implicit };}, OperatorNode.fromJSON = function (json) {return new OperatorNode(json.op, json.fn, json.args, json.implicit);}, OperatorNode.prototype.toHTML = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",implicit = options && options.implicit ? options.implicit : "hide",args = this.args,parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, !1);if (1 === args.length) {var assoc = (0, _operators.getAssociativity)(this, parenthesis),operand = args[0].toHTML(options);return parens[0] && (operand = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + operand + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), "right" === assoc ? "<span class=\"math-operator math-unary-operator math-lefthand-unary-operator\">" + (0, _string.escape)(this.op) + "</span>" + operand : operand + "<span class=\"math-operator math-unary-operator math-righthand-unary-operator\">" + (0, _string.escape)(this.op) + "</span>";}if (2 === args.length) {var lhs = args[0].toHTML(options),rhs = args[1].toHTML(options);return parens[0] && (lhs = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + lhs + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), parens[1] && (rhs = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + rhs + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), this.implicit && "OperatorNode:multiply" === this.getIdentifier() && "hide" === implicit ? lhs + "<span class=\"math-operator math-binary-operator math-implicit-binary-operator\"></span>" + rhs : lhs + "<span class=\"math-operator math-binary-operator math-explicit-binary-operator\">" + (0, _string.escape)(this.op) + "</span>" + rhs;}var stringifiedArgs = args.map(function (arg, index) {return arg = arg.toHTML(options), parens[index] && (arg = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + arg + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), arg;});return 2 < args.length && ("OperatorNode:add" === this.getIdentifier() || "OperatorNode:multiply" === this.getIdentifier()) ? this.implicit && "OperatorNode:multiply" === this.getIdentifier() && "hide" === implicit ? stringifiedArgs.join("<span class=\"math-operator math-binary-operator math-implicit-binary-operator\"></span>") : stringifiedArgs.join("<span class=\"math-operator math-binary-operator math-explicit-binary-operator\">" + (0, _string.escape)(this.op) + "</span>") : "<span class=\"math-function\">" + (0, _string.escape)(this.fn) + "</span><span class=\"math-paranthesis math-round-parenthesis\">(</span>" + stringifiedArgs.join("<span class=\"math-separator\">,</span>") + "<span class=\"math-paranthesis math-round-parenthesis\">)</span>";}, OperatorNode.prototype._toTex = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",implicit = options && options.implicit ? options.implicit : "hide",args = this.args,parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, !0),op = _latex.latexOperators[this.fn];if (op = "undefined" == typeof op ? this.op : op, 1 === args.length) {var assoc = (0, _operators.getAssociativity)(this, parenthesis),operand = args[0].toTex(options);return (parens[0] && (operand = "\\left(".concat(operand, "\\right)")), "right" === assoc) ? op + operand : "left" === assoc ? operand + op : operand + op;}if (2 === args.length) {var lhs = args[0],lhsTex = lhs.toTex(options);parens[0] && (lhsTex = "\\left(".concat(lhsTex, "\\right)"));var rhs = args[1],rhsTex = rhs.toTex(options);parens[1] && (rhsTex = "\\left(".concat(rhsTex, "\\right)"));var lhsIdentifier;switch (lhsIdentifier = "keep" === parenthesis ? lhs.getIdentifier() : lhs.getContent().getIdentifier(), this.getIdentifier()) {case "OperatorNode:divide":return op + "{" + lhsTex + "}{" + rhsTex + "}";case "OperatorNode:pow":lhsTex = "{" + lhsTex + "}", rhsTex = "{" + rhsTex + "}", "ConditionalNode" === lhsIdentifier || "OperatorNode:divide" === lhsIdentifier ? lhsTex = "\\left(".concat(lhsTex, "\\right)") : void 0;break;case "OperatorNode:multiply":if (this.implicit && "hide" === implicit) return lhsTex + "~" + rhsTex;}return lhsTex + op + rhsTex;}if (2 < args.length && ("OperatorNode:add" === this.getIdentifier() || "OperatorNode:multiply" === this.getIdentifier())) {var texifiedArgs = args.map(function (arg, index) {return arg = arg.toTex(options), parens[index] && (arg = "\\left(".concat(arg, "\\right)")), arg;});return "OperatorNode:multiply" === this.getIdentifier() && this.implicit ? texifiedArgs.join("~") : texifiedArgs.join(op);}return "\\mathrm{" + this.fn + "}\\left(" + args.map(function (arg) {return arg.toTex(options);}).join(",") + "\\right)";}, OperatorNode.prototype.getIdentifier = function () {return this.type + ":" + this.fn;}, OperatorNode;}, { isClass: !0, isNode: !0 });exports.createOperatorNode = createOperatorNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/ParenthesisNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createParenthesisNode = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "ParenthesisNode",dependencies = ["Node"],createParenthesisNode = (0, _factory.factory)(name, dependencies, function (_ref) {function ParenthesisNode(content) {if (!(this instanceof ParenthesisNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!(0, _is.isNode)(content)) throw new TypeError("Node expected for parameter \"content\"");this.content = content;}var Node = _ref.Node;return ParenthesisNode.prototype = new Node(), ParenthesisNode.prototype.type = "ParenthesisNode", ParenthesisNode.prototype.isParenthesisNode = !0, ParenthesisNode.prototype._compile = function (math, argNames) {return this.content._compile(math, argNames);}, ParenthesisNode.prototype.getContent = function () {return this.content.getContent();}, ParenthesisNode.prototype.forEach = function (callback) {callback(this.content, "content", this);}, ParenthesisNode.prototype.map = function (callback) {var content = callback(this.content, "content", this);return new ParenthesisNode(content);}, ParenthesisNode.prototype.clone = function () {return new ParenthesisNode(this.content);}, ParenthesisNode.prototype._toString = function (options) {return !options || options && !options.parenthesis || options && "keep" === options.parenthesis ? "(" + this.content.toString(options) + ")" : this.content.toString(options);}, ParenthesisNode.prototype.toJSON = function () {return { mathjs: "ParenthesisNode", content: this.content };}, ParenthesisNode.fromJSON = function (json) {return new ParenthesisNode(json.content);}, ParenthesisNode.prototype.toHTML = function (options) {return !options || options && !options.parenthesis || options && "keep" === options.parenthesis ? "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + this.content.toHTML(options) + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>" : this.content.toHTML(options);}, ParenthesisNode.prototype._toTex = function (options) {return !options || options && !options.parenthesis || options && "keep" === options.parenthesis ? "\\left(".concat(this.content.toTex(options), "\\right)") : this.content.toTex(options);}, ParenthesisNode;}, { isClass: !0, isNode: !0 });exports.createParenthesisNode = createParenthesisNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/RangeNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRangeNode = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_operators = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/operators.js"),name = "RangeNode",dependencies = ["Node"],createRangeNode = (0, _factory.factory)(name, dependencies, function (_ref) {function RangeNode(start, end, step) {if (!(this instanceof RangeNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!(0, _is.isNode)(start)) throw new TypeError("Node expected");if (!(0, _is.isNode)(end)) throw new TypeError("Node expected");if (step && !(0, _is.isNode)(step)) throw new TypeError("Node expected");if (3 < arguments.length) throw new Error("Too many arguments");this.start = start, this.end = end, this.step = step || null;}function calculateNecessaryParentheses(node, parenthesis) {var precedence = (0, _operators.getPrecedence)(node, parenthesis),parens = {},startPrecedence = (0, _operators.getPrecedence)(node.start, parenthesis);if (parens.start = null !== startPrecedence && startPrecedence <= precedence || "all" === parenthesis, node.step) {var stepPrecedence = (0, _operators.getPrecedence)(node.step, parenthesis);parens.step = null !== stepPrecedence && stepPrecedence <= precedence || "all" === parenthesis;}var endPrecedence = (0, _operators.getPrecedence)(node.end, parenthesis);return parens.end = null !== endPrecedence && endPrecedence <= precedence || "all" === parenthesis, parens;}var Node = _ref.Node;return RangeNode.prototype = new Node(), RangeNode.prototype.type = "RangeNode", RangeNode.prototype.isRangeNode = !0, RangeNode.prototype.needsEnd = function () {var endSymbols = this.filter(function (node) {return (0, _is.isSymbolNode)(node) && "end" === node.name;});return 0 < endSymbols.length;}, RangeNode.prototype._compile = function (math, argNames) {var range = math.range,evalStart = this.start._compile(math, argNames),evalEnd = this.end._compile(math, argNames);if (this.step) {var evalStep = this.step._compile(math, argNames);return function (scope, args, context) {return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context));};}return function (scope, args, context) {return range(evalStart(scope, args, context), evalEnd(scope, args, context));};}, RangeNode.prototype.forEach = function (callback) {callback(this.start, "start", this), callback(this.end, "end", this), this.step && callback(this.step, "step", this);}, RangeNode.prototype.map = function (callback) {return new RangeNode(this._ifNode(callback(this.start, "start", this)), this._ifNode(callback(this.end, "end", this)), this.step && this._ifNode(callback(this.step, "step", this)));}, RangeNode.prototype.clone = function () {return new RangeNode(this.start, this.end, this.step && this.step);}, RangeNode.prototype._toString = function (options) {var str,parenthesis = options && options.parenthesis ? options.parenthesis : "keep",parens = calculateNecessaryParentheses(this, parenthesis),start = this.start.toString(options);if (parens.start && (start = "(" + start + ")"), str = start, this.step) {var step = this.step.toString(options);parens.step && (step = "(" + step + ")"), str += ":" + step;}var end = this.end.toString(options);return parens.end && (end = "(" + end + ")"), str += ":" + end, str;}, RangeNode.prototype.toJSON = function () {return { mathjs: "RangeNode", start: this.start, end: this.end, step: this.step };}, RangeNode.fromJSON = function (json) {return new RangeNode(json.start, json.end, json.step);}, RangeNode.prototype.toHTML = function (options) {var str,parenthesis = options && options.parenthesis ? options.parenthesis : "keep",parens = calculateNecessaryParentheses(this, parenthesis),start = this.start.toHTML(options);if (parens.start && (start = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + start + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), str = start, this.step) {var step = this.step.toHTML(options);parens.step && (step = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + step + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), str += "<span class=\"math-operator math-range-operator\">:</span>" + step;}var end = this.end.toHTML(options);return parens.end && (end = "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + end + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>"), str += "<span class=\"math-operator math-range-operator\">:</span>" + end, str;}, RangeNode.prototype._toTex = function (options) {var parenthesis = options && options.parenthesis ? options.parenthesis : "keep",parens = calculateNecessaryParentheses(this, parenthesis),str = this.start.toTex(options);if (parens.start && (str = "\\left(".concat(str, "\\right)")), this.step) {var step = this.step.toTex(options);parens.step && (step = "\\left(".concat(step, "\\right)")), str += ":" + step;}var end = this.end.toTex(options);return parens.end && (end = "\\left(".concat(end, "\\right)")), str += ":" + end, str;}, RangeNode;}, { isClass: !0, isNode: !0 });exports.createRangeNode = createRangeNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/RelationalNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRelationalNode = void 0;var _operators = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/operators.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_latex = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/latex.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "RelationalNode",dependencies = ["Node"],createRelationalNode = (0, _factory.factory)(name, dependencies, function (_ref) {function RelationalNode(conditionals, params) {if (!(this instanceof RelationalNode)) throw new SyntaxError("Constructor must be called with the new operator");if (!Array.isArray(conditionals)) throw new TypeError("Parameter conditionals must be an array");if (!Array.isArray(params)) throw new TypeError("Parameter params must be an array");if (conditionals.length !== params.length - 1) throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals = conditionals, this.params = params;}var Node = _ref.Node;return RelationalNode.prototype = new Node(), RelationalNode.prototype.type = "RelationalNode", RelationalNode.prototype.isRelationalNode = !0, RelationalNode.prototype._compile = function (math, argNames) {var self = this,compiled = this.params.map(function (p) {return p._compile(math, argNames);});return function (scope, args, context) {for (var evalLhs, evalRhs = compiled[0](scope, args, context), i = 0; i < self.conditionals.length; i++) {evalLhs = evalRhs, evalRhs = compiled[i + 1](scope, args, context);var condFn = (0, _customs.getSafeProperty)(math, self.conditionals[i]);if (!condFn(evalLhs, evalRhs)) return !1;}return !0;};}, RelationalNode.prototype.forEach = function (callback) {var _this = this;this.params.forEach(function (n, i) {return callback(n, "params[" + i + "]", _this);}, this);}, RelationalNode.prototype.map = function (callback) {var _this2 = this;return new RelationalNode(this.conditionals.slice(), this.params.map(function (n, i) {return _this2._ifNode(callback(n, "params[" + i + "]", _this2));}, this));}, RelationalNode.prototype.clone = function () {return new RelationalNode(this.conditionals, this.params);}, RelationalNode.prototype._toString = function (options) {for (var parenthesis = options && options.parenthesis ? options.parenthesis : "keep", precedence = (0, _operators.getPrecedence)(this, parenthesis), paramStrings = this.params.map(function (p) {var paramPrecedence = (0, _operators.getPrecedence)(p, parenthesis);return "all" === parenthesis || null !== paramPrecedence && paramPrecedence <= precedence ? "(" + p.toString(options) + ")" : p.toString(options);}), operatorMap = { equal: "==", unequal: "!=", smaller: "<", larger: ">", smallerEq: "<=", largerEq: ">=" }, ret = paramStrings[0], i = 0; i < this.conditionals.length; i++) ret += " " + operatorMap[this.conditionals[i]] + " " + paramStrings[i + 1];return ret;}, RelationalNode.prototype.toJSON = function () {return { mathjs: "RelationalNode", conditionals: this.conditionals, params: this.params };}, RelationalNode.fromJSON = function (json) {return new RelationalNode(json.conditionals, json.params);}, RelationalNode.prototype.toHTML = function (options) {for (var parenthesis = options && options.parenthesis ? options.parenthesis : "keep", precedence = (0, _operators.getPrecedence)(this, parenthesis), paramStrings = this.params.map(function (p) {var paramPrecedence = (0, _operators.getPrecedence)(p, parenthesis);return "all" === parenthesis || null !== paramPrecedence && paramPrecedence <= precedence ? "<span class=\"math-parenthesis math-round-parenthesis\">(</span>" + p.toHTML(options) + "<span class=\"math-parenthesis math-round-parenthesis\">)</span>" : p.toHTML(options);}), operatorMap = { equal: "==", unequal: "!=", smaller: "<", larger: ">", smallerEq: "<=", largerEq: ">=" }, ret = paramStrings[0], i = 0; i < this.conditionals.length; i++) ret += "<span class=\"math-operator math-binary-operator math-explicit-binary-operator\">" + (0, _string.escape)(operatorMap[this.conditionals[i]]) + "</span>" + paramStrings[i + 1];return ret;}, RelationalNode.prototype._toTex = function (options) {for (var parenthesis = options && options.parenthesis ? options.parenthesis : "keep", precedence = (0, _operators.getPrecedence)(this, parenthesis), paramStrings = this.params.map(function (p) {var paramPrecedence = (0, _operators.getPrecedence)(p, parenthesis);return "all" === parenthesis || null !== paramPrecedence && paramPrecedence <= precedence ? "\\left(" + p.toTex(options) + "\right)" : p.toTex(options);}), ret = paramStrings[0], i = 0; i < this.conditionals.length; i++) ret += _latex.latexOperators[this.conditionals[i]] + paramStrings[i + 1];return ret;}, RelationalNode;}, { isClass: !0, isNode: !0 });exports.createRelationalNode = createRelationalNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/SymbolNode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSymbolNode = void 0;var _string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_latex = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/latex.js"),name = "SymbolNode",dependencies = ["math", "?Unit", "Node"],createSymbolNode = (0, _factory.factory)(name, dependencies, function (_ref) {function isValuelessUnit(name) {return !!Unit && Unit.isValuelessUnit(name);}function SymbolNode(name) {if (!(this instanceof SymbolNode)) throw new SyntaxError("Constructor must be called with the new operator");if ("string" != typeof name) throw new TypeError("String expected for parameter \"name\"");this.name = name;}var math = _ref.math,Unit = _ref.Unit,Node = _ref.Node;return SymbolNode.prototype = new Node(), SymbolNode.prototype.type = "SymbolNode", SymbolNode.prototype.isSymbolNode = !0, SymbolNode.prototype._compile = function (math, argNames) {var name = this.name;if (!0 === argNames[name]) return function (scope, args) {return args[name];};if (name in math) return function (scope) {return scope.has(name) ? scope.get(name) : (0, _customs.getSafeProperty)(math, name);};var isUnit = isValuelessUnit(name);return function (scope) {return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name);};}, SymbolNode.prototype.forEach = function () {}, SymbolNode.prototype.map = function () {return this.clone();}, SymbolNode.onUndefinedSymbol = function (name) {throw new Error("Undefined symbol " + name);}, SymbolNode.prototype.clone = function () {return new SymbolNode(this.name);}, SymbolNode.prototype._toString = function () {return this.name;}, SymbolNode.prototype.toHTML = function () {var name = (0, _string.escape)(this.name);return "true" === name || "false" === name ? "<span class=\"math-symbol math-boolean\">" + name + "</span>" : "i" === name ? "<span class=\"math-symbol math-imaginary-symbol\">" + name + "</span>" : "Infinity" === name ? "<span class=\"math-symbol math-infinity-symbol\">" + name + "</span>" : "NaN" === name ? "<span class=\"math-symbol math-nan-symbol\">" + name + "</span>" : "null" === name ? "<span class=\"math-symbol math-null-symbol\">" + name + "</span>" : "undefined" === name ? "<span class=\"math-symbol math-undefined-symbol\">" + name + "</span>" : "<span class=\"math-symbol\">" + name + "</span>";}, SymbolNode.prototype.toJSON = function () {return { mathjs: "SymbolNode", name: this.name };}, SymbolNode.fromJSON = function (json) {return new SymbolNode(json.name);}, SymbolNode.prototype._toTex = function () {var isUnit = !1;"undefined" == typeof math[this.name] && isValuelessUnit(this.name) && (isUnit = !0);var symbol = (0, _latex.toSymbol)(this.name, isUnit);return "\\" === symbol[0] ? symbol : " " + symbol;}, SymbolNode;}, { isClass: !0, isNode: !0 });exports.createSymbolNode = createSymbolNode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/utils/access.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.accessFactory = accessFactory;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js");function accessFactory(_ref) {var subset = _ref.subset;return function (object, index) {try {if (Array.isArray(object)) return subset(object, index);if (object && "function" == typeof object.subset) return object.subset(index);if ("string" == typeof object) return subset(object, index);if ("object" === (0, _typeof2["default"])(object)) {if (!index.isObjectProperty()) throw new TypeError("Cannot apply a numeric index as object property");return (0, _customs.getSafeProperty)(object, index.getObjectProperty());}throw new TypeError("Cannot apply index: unsupported type of object");} catch (err) {throw (0, _errorTransform.errorTransform)(err);}};}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/node/utils/assign.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.assignFactory = assignFactory;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js");function assignFactory(_ref) {var subset = _ref.subset,matrix = _ref.matrix;return function (object, index, value) {try {if (Array.isArray(object)) return matrix(object).subset(index, value).valueOf();if (object && "function" == typeof object.subset) return object.subset(index, value);if ("string" == typeof object) return subset(object, index, value);if ("object" === (0, _typeof2["default"])(object)) {if (!index.isObjectProperty()) throw TypeError("Cannot apply a numeric index as object property");return (0, _customs.setSafeProperty)(object, index.getObjectProperty(), value), object;}throw new TypeError("Cannot apply index: unsupported type of object");} catch (err) {throw (0, _errorTransform.errorTransform)(err);}};}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/operators.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.getPrecedence = getPrecedence, exports.getAssociativity = getAssociativity, exports.isAssociativeWith = isAssociativeWith, exports.properties = void 0;var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),properties = [{ AssignmentNode: {}, FunctionAssignmentNode: {} }, { ConditionalNode: { latexLeftParens: !1, latexRightParens: !1, latexParens: !1 } }, { "OperatorNode:or": { associativity: "left", associativeWith: [] } }, { "OperatorNode:xor": { associativity: "left", associativeWith: [] } }, { "OperatorNode:and": { associativity: "left", associativeWith: [] } }, { "OperatorNode:bitOr": { associativity: "left", associativeWith: [] } }, { "OperatorNode:bitXor": { associativity: "left", associativeWith: [] } }, { "OperatorNode:bitAnd": { associativity: "left", associativeWith: [] } }, { "OperatorNode:equal": { associativity: "left", associativeWith: [] }, "OperatorNode:unequal": { associativity: "left", associativeWith: [] }, "OperatorNode:smaller": { associativity: "left", associativeWith: [] }, "OperatorNode:larger": { associativity: "left", associativeWith: [] }, "OperatorNode:smallerEq": { associativity: "left", associativeWith: [] }, "OperatorNode:largerEq": { associativity: "left", associativeWith: [] }, RelationalNode: { associativity: "left", associativeWith: [] } }, { "OperatorNode:leftShift": { associativity: "left", associativeWith: [] }, "OperatorNode:rightArithShift": { associativity: "left", associativeWith: [] }, "OperatorNode:rightLogShift": { associativity: "left", associativeWith: [] } }, { "OperatorNode:to": { associativity: "left", associativeWith: [] } }, { RangeNode: {} }, { "OperatorNode:add": { associativity: "left", associativeWith: ["OperatorNode:add", "OperatorNode:subtract"] }, "OperatorNode:subtract": { associativity: "left", associativeWith: [] } }, { "OperatorNode:multiply": { associativity: "left", associativeWith: ["OperatorNode:multiply", "OperatorNode:divide", "Operator:dotMultiply", "Operator:dotDivide"] }, "OperatorNode:divide": { associativity: "left", associativeWith: [], latexLeftParens: !1, latexRightParens: !1, latexParens: !1 }, "OperatorNode:dotMultiply": { associativity: "left", associativeWith: ["OperatorNode:multiply", "OperatorNode:divide", "OperatorNode:dotMultiply", "OperatorNode:doDivide"] }, "OperatorNode:dotDivide": { associativity: "left", associativeWith: [] }, "OperatorNode:mod": { associativity: "left", associativeWith: [] } }, { "OperatorNode:unaryPlus": { associativity: "right" }, "OperatorNode:unaryMinus": { associativity: "right" }, "OperatorNode:bitNot": { associativity: "right" }, "OperatorNode:not": { associativity: "right" } }, { "OperatorNode:pow": { associativity: "right", associativeWith: [], latexRightParens: !1 }, "OperatorNode:dotPow": { associativity: "right", associativeWith: [] } }, { "OperatorNode:factorial": { associativity: "left" } }, { "OperatorNode:transpose": { associativity: "left" } }];exports.properties = properties;function getPrecedence(_node, parenthesis) {var node = _node;"keep" !== parenthesis && (node = _node.getContent());for (var identifier = node.getIdentifier(), i = 0; i < properties.length; i++) if (identifier in properties[i]) return i;return null;}function getAssociativity(_node, parenthesis) {var node = _node;"keep" !== parenthesis && (node = _node.getContent());var identifier = node.getIdentifier(),index = getPrecedence(node, parenthesis);if (null === index) return null;var property = properties[index][identifier];if ((0, _object.hasOwnProperty)(property, "associativity")) {if ("left" === property.associativity) return "left";if ("right" === property.associativity) return "right";throw Error("'" + identifier + "' has the invalid associativity '" + property.associativity + "'.");}return null;}function isAssociativeWith(nodeA, nodeB, parenthesis) {var a = "keep" === parenthesis ? nodeA : nodeA.getContent(),b = "keep" === parenthesis ? nodeB : nodeA.getContent(),identifierA = a.getIdentifier(),identifierB = b.getIdentifier(),index = getPrecedence(a, parenthesis);if (null === index) return null;var property = properties[index][identifierA];if ((0, _object.hasOwnProperty)(property, "associativeWith") && property.associativeWith instanceof Array) {for (var i = 0; i < property.associativeWith.length; i++) if (property.associativeWith[i] === identifierB) return !0;return !1;}return null;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/parse.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createParse = void 0;var _extends2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/extends.js")),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),name = "parse",dependencies = ["typed", "numeric", "config", "AccessorNode", "ArrayNode", "AssignmentNode", "BlockNode", "ConditionalNode", "ConstantNode", "FunctionAssignmentNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "RangeNode", "RelationalNode", "SymbolNode"],createParse = (0, _factory.factory)(name, dependencies, function (_ref) {function parseMultiple(expressions) {var options = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},extraNodes = void 0 === options.nodes ? {} : options.nodes;return (0, _collection.deepMap)(expressions, function (elem) {if ("string" != typeof elem) throw new TypeError("String expected");return parseStart(elem, extraNodes);});}function initialState() {return { extraNodes: {}, expression: "", comment: "", index: 0, token: "", tokenType: TOKENTYPE.NULL, nestingLevel: 0, conditionalLevel: null };}function currentString(state, length) {return state.expression.substr(state.index, length);}function currentCharacter(state) {return currentString(state, 1);}function next(state) {state.index++;}function prevCharacter(state) {return state.expression.charAt(state.index - 1);}function nextCharacter(state) {return state.expression.charAt(state.index + 1);}function getToken(state) {for (state.tokenType = TOKENTYPE.NULL, state.token = "", state.comment = ""; parse.isWhitespace(currentCharacter(state), state.nestingLevel);) next(state);if ("#" === currentCharacter(state)) for (; "\n" !== currentCharacter(state) && "" !== currentCharacter(state);) state.comment += currentCharacter(state), next(state);if ("" === currentCharacter(state)) return void (state.tokenType = TOKENTYPE.DELIMITER);if ("\n" === currentCharacter(state) && !state.nestingLevel) return state.tokenType = TOKENTYPE.DELIMITER, state.token = currentCharacter(state), void next(state);var c1 = currentCharacter(state),c2 = currentString(state, 2),c3 = currentString(state, 3);if (3 === c3.length && DELIMITERS[c3]) return state.tokenType = TOKENTYPE.DELIMITER, state.token = c3, next(state), next(state), void next(state);if (2 === c2.length && DELIMITERS[c2]) return state.tokenType = TOKENTYPE.DELIMITER, state.token = c2, next(state), void next(state);if (DELIMITERS[c1]) return state.tokenType = TOKENTYPE.DELIMITER, state.token = c1, void next(state);if (parse.isDigitDot(c1)) {state.tokenType = TOKENTYPE.NUMBER;var _c = currentString(state, 2);if ("0b" === _c || "0o" === _c || "0x" === _c) {for (state.token += currentCharacter(state), next(state), state.token += currentCharacter(state), next(state); parse.isHexDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);if ("." === currentCharacter(state)) for (state.token += ".", next(state); parse.isHexDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);else if ("i" === currentCharacter(state)) for (state.token += "i", next(state); parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);return;}if ("." === currentCharacter(state)) state.token += currentCharacter(state), next(state), parse.isDigit(currentCharacter(state)) || (state.tokenType = TOKENTYPE.DELIMITER);else {for (; parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);parse.isDecimalMark(currentCharacter(state), nextCharacter(state)) && (state.token += currentCharacter(state), next(state));}for (; parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);if ("E" === currentCharacter(state) || "e" === currentCharacter(state)) if (parse.isDigit(nextCharacter(state)) || "-" === nextCharacter(state) || "+" === nextCharacter(state)) {if (state.token += currentCharacter(state), next(state), ("+" === currentCharacter(state) || "-" === currentCharacter(state)) && (state.token += currentCharacter(state), next(state)), !parse.isDigit(currentCharacter(state))) throw createSyntaxError(state, "Digit expected, got \"" + currentCharacter(state) + "\"");for (; parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) throw createSyntaxError(state, "Digit expected, got \"" + currentCharacter(state) + "\"");} else if ("." === nextCharacter(state)) throw next(state), createSyntaxError(state, "Digit expected, got \"" + currentCharacter(state) + "\"");return;}if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {for (; parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state));) state.token += currentCharacter(state), next(state);return void (state.tokenType = (0, _object.hasOwnProperty)(NAMED_DELIMITERS, state.token) ? TOKENTYPE.DELIMITER : TOKENTYPE.SYMBOL);}for (state.tokenType = TOKENTYPE.UNKNOWN; "" !== currentCharacter(state);) state.token += currentCharacter(state), next(state);throw createSyntaxError(state, "Syntax error in part \"" + state.token + "\"");}function getTokenSkipNewline(state) {do getToken(state); while ("\n" === state.token);}function openParams(state) {state.nestingLevel++;}function closeParams(state) {state.nestingLevel--;}function parseStart(expression, extraNodes) {var state = initialState();(0, _extends2["default"])(state, { expression: expression, extraNodes: extraNodes }), getToken(state);var node = parseBlock(state);if ("" !== state.token) if (state.tokenType === TOKENTYPE.DELIMITER) throw createError(state, "Unexpected operator " + state.token);else throw createSyntaxError(state, "Unexpected part \"" + state.token + "\"");return node;}function parseBlock(state) {var node,visible,blocks = [];for ("" !== state.token && "\n" !== state.token && ";" !== state.token && (node = parseAssignment(state), node.comment = state.comment); "\n" === state.token || ";" === state.token;) 0 === blocks.length && node && (visible = ";" !== state.token, blocks.push({ node: node, visible: visible })), getToken(state), "\n" !== state.token && ";" !== state.token && "" !== state.token && (node = parseAssignment(state), node.comment = state.comment, visible = ";" !== state.token, blocks.push({ node: node, visible: visible }));return 0 < blocks.length ? new BlockNode(blocks) : (node || (node = new ConstantNode(void 0), node.comment = state.comment), node);}function parseAssignment(state) {var name,args,value,valid,node = parseConditional(state);if ("=" === state.token) {if ((0, _is.isSymbolNode)(node)) return name = node.name, getTokenSkipNewline(state), value = parseAssignment(state), new AssignmentNode(new SymbolNode(name), value);if ((0, _is.isAccessorNode)(node)) return getTokenSkipNewline(state), value = parseAssignment(state), new AssignmentNode(node.object, node.index, value);if ((0, _is.isFunctionNode)(node) && (0, _is.isSymbolNode)(node.fn) && (valid = !0, args = [], name = node.name, node.args.forEach(function (arg, index) {(0, _is.isSymbolNode)(arg) ? args[index] = arg.name : valid = !1;}), valid)) return getTokenSkipNewline(state), value = parseAssignment(state), new FunctionAssignmentNode(name, args, value);throw createSyntaxError(state, "Invalid left hand side of assignment operator =");}return node;}function parseConditional(state) {for (var prev, node = parseLogicalOr(state); "?" === state.token;) {prev = state.conditionalLevel, state.conditionalLevel = state.nestingLevel, getTokenSkipNewline(state);var condition = node,trueExpr = parseAssignment(state);if (":" !== state.token) throw createSyntaxError(state, "False part of conditional expression expected");state.conditionalLevel = null, getTokenSkipNewline(state);var falseExpr = parseAssignment(state);node = new ConditionalNode(condition, trueExpr, falseExpr), state.conditionalLevel = prev;}return node;}function parseLogicalOr(state) {for (var node = parseLogicalXor(state); "or" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("or", "or", [node, parseLogicalXor(state)]);return node;}function parseLogicalXor(state) {for (var node = parseLogicalAnd(state); "xor" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("xor", "xor", [node, parseLogicalAnd(state)]);return node;}function parseLogicalAnd(state) {for (var node = parseBitwiseOr(state); "and" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("and", "and", [node, parseBitwiseOr(state)]);return node;}function parseBitwiseOr(state) {for (var node = parseBitwiseXor(state); "|" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("|", "bitOr", [node, parseBitwiseXor(state)]);return node;}function parseBitwiseXor(state) {for (var node = parseBitwiseAnd(state); "^|" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("^|", "bitXor", [node, parseBitwiseAnd(state)]);return node;}function parseBitwiseAnd(state) {for (var node = parseRelational(state); "&" === state.token;) getTokenSkipNewline(state), node = new OperatorNode("&", "bitAnd", [node, parseRelational(state)]);return node;}function parseRelational(state) {for (var cond, params = [parseShift(state)], conditionals = [], operators = { "==": "equal", "!=": "unequal", "<": "smaller", ">": "larger", "<=": "smallerEq", ">=": "largerEq" }; (0, _object.hasOwnProperty)(operators, state.token);) cond = { name: state.token, fn: operators[state.token] }, conditionals.push(cond), getTokenSkipNewline(state), params.push(parseShift(state));return 1 === params.length ? params[0] : 2 === params.length ? new OperatorNode(conditionals[0].name, conditionals[0].fn, params) : new RelationalNode(conditionals.map(function (c) {return c.fn;}), params);}function parseShift(state) {var node, name, fn, params;node = parseConversion(state);for (var operators = { "<<": "leftShift", ">>": "rightArithShift", ">>>": "rightLogShift" }; (0, _object.hasOwnProperty)(operators, state.token);) name = state.token, fn = operators[name], getTokenSkipNewline(state), params = [node, parseConversion(state)], node = new OperatorNode(name, fn, params);return node;}function parseConversion(state) {var node, name, fn, params;node = parseRange(state);for (var operators = { to: "to", in: "to" }; (0, _object.hasOwnProperty)(operators, state.token);) name = state.token, fn = operators[name], getTokenSkipNewline(state), "in" === name && "" === state.token ? node = new OperatorNode("*", "multiply", [node, new SymbolNode("in")], !0) : (params = [node, parseRange(state)], node = new OperatorNode(name, fn, params));return node;}function parseRange(state) {var node,params = [];if (node = ":" === state.token ? new ConstantNode(1) : parseAddSubtract(state), ":" === state.token && state.conditionalLevel !== state.nestingLevel) {for (params.push(node); ":" === state.token && 3 > params.length;) getTokenSkipNewline(state), ")" === state.token || "]" === state.token || "," === state.token || "" === state.token ? params.push(new SymbolNode("end")) : params.push(parseAddSubtract(state));node = 3 === params.length ? new RangeNode(params[0], params[2], params[1]) : new RangeNode(params[0], params[1]);}return node;}function parseAddSubtract(state) {var node, name, fn, params;node = parseMultiplyDivide(state);for (var operators = { "+": "add", "-": "subtract" }; (0, _object.hasOwnProperty)(operators, state.token);) name = state.token, fn = operators[name], getTokenSkipNewline(state), params = [node, parseMultiplyDivide(state)], node = new OperatorNode(name, fn, params);return node;}function parseMultiplyDivide(state) {var node, last, name, fn;node = parseImplicitMultiplication(state), last = node;for (var operators = { "*": "multiply", ".*": "dotMultiply", "/": "divide", "./": "dotDivide", "%": "mod", mod: "mod" }; (0, _object.hasOwnProperty)(operators, state.token);) name = state.token, fn = operators[name], getTokenSkipNewline(state), last = parseImplicitMultiplication(state), node = new OperatorNode(name, fn, [node, last]);return node;}function parseImplicitMultiplication(state) {var node, last;for (node = parseRule2(state), last = node; state.tokenType === TOKENTYPE.SYMBOL || "in" === state.token && (0, _is.isConstantNode)(node) || state.tokenType === TOKENTYPE.NUMBER && !(0, _is.isConstantNode)(last) && (!(0, _is.isOperatorNode)(last) || "!" === last.op) || "(" === state.token;) last = parseRule2(state), node = new OperatorNode("*", "multiply", [node, last], !0);return node;}function parseRule2(state) {for (var node = parseUnary(state), last = node, tokenStates = []; !!("/" === state.token && (0, _is.isConstantNode)(last));) if (tokenStates.push((0, _extends2["default"])({}, state)), getTokenSkipNewline(state), state.tokenType !== TOKENTYPE.NUMBER) {(0, _extends2["default"])(state, tokenStates.pop());break;} else if (tokenStates.push((0, _extends2["default"])({}, state)), getTokenSkipNewline(state), state.tokenType === TOKENTYPE.SYMBOL || "(" === state.token) (0, _extends2["default"])(state, tokenStates.pop()), tokenStates.pop(), last = parseUnary(state), node = new OperatorNode("/", "divide", [node, last]);else {tokenStates.pop(), (0, _extends2["default"])(state, tokenStates.pop());break;}return node;}function parseUnary(state) {var name,params,fn,operators = { "-": "unaryMinus", "+": "unaryPlus", "~": "bitNot", not: "not" };return (0, _object.hasOwnProperty)(operators, state.token) ? (fn = operators[state.token], name = state.token, getTokenSkipNewline(state), params = [parseUnary(state)], new OperatorNode(name, fn, params)) : parsePow(state);}function parsePow(state) {var node, name, fn, params;return node = parseLeftHandOperators(state), ("^" === state.token || ".^" === state.token) && (name = state.token, fn = "^" === name ? "pow" : "dotPow", getTokenSkipNewline(state), params = [node, parseUnary(state)], node = new OperatorNode(name, fn, params)), node;}function parseLeftHandOperators(state) {var node, name, fn, params;node = parseCustomNodes(state);for (var operators = { "!": "factorial", "'": "ctranspose" }; (0, _object.hasOwnProperty)(operators, state.token);) name = state.token, fn = operators[name], getToken(state), params = [node], node = new OperatorNode(name, fn, params), node = parseAccessors(state, node);return node;}function parseCustomNodes(state) {var params = [];if (state.tokenType === TOKENTYPE.SYMBOL && (0, _object.hasOwnProperty)(state.extraNodes, state.token)) {var CustomNode = state.extraNodes[state.token];if (getToken(state), "(" === state.token) {if (params = [], openParams(state), getToken(state), ")" !== state.token) for (params.push(parseAssignment(state)); "," === state.token;) getToken(state), params.push(parseAssignment(state));if (")" !== state.token) throw createSyntaxError(state, "Parenthesis ) expected");closeParams(state), getToken(state);}return new CustomNode(params);}return parseSymbol(state);}function parseSymbol(state) {var node, name;return state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS ? (name = state.token, getToken(state), node = (0, _object.hasOwnProperty)(CONSTANTS, name) ? new ConstantNode(CONSTANTS[name]) : -1 === NUMERIC_CONSTANTS.indexOf(name) ? new SymbolNode(name) : new ConstantNode(numeric(name, "number")), node = parseAccessors(state, node), node) : parseDoubleQuotesString(state);}function parseAccessors(state, node, types) {for (var params; ("(" === state.token || "[" === state.token || "." === state.token) && (!types || -1 !== types.indexOf(state.token));) if (params = [], "(" === state.token) {if ((0, _is.isSymbolNode)(node) || (0, _is.isAccessorNode)(node)) {if (openParams(state), getToken(state), ")" !== state.token) for (params.push(parseAssignment(state)); "," === state.token;) getToken(state), params.push(parseAssignment(state));if (")" !== state.token) throw createSyntaxError(state, "Parenthesis ) expected");closeParams(state), getToken(state), node = new FunctionNode(node, params);} else return node;} else if ("[" === state.token) {if (openParams(state), getToken(state), "]" !== state.token) for (params.push(parseAssignment(state)); "," === state.token;) getToken(state), params.push(parseAssignment(state));if ("]" !== state.token) throw createSyntaxError(state, "Parenthesis ] expected");closeParams(state), getToken(state), node = new AccessorNode(node, new IndexNode(params));} else {if (getToken(state), state.tokenType !== TOKENTYPE.SYMBOL) throw createSyntaxError(state, "Property name expected after dot");params.push(new ConstantNode(state.token)), getToken(state);node = new AccessorNode(node, new IndexNode(params, !0));}return node;}function parseDoubleQuotesString(state) {var node, str;return "\"" === state.token ? (str = parseDoubleQuotesStringToken(state), node = new ConstantNode(str), node = parseAccessors(state, node), node) : parseSingleQuotesString(state);}function parseDoubleQuotesStringToken(state) {for (var str = ""; "" !== currentCharacter(state) && "\"" !== currentCharacter(state);) "\\" === currentCharacter(state) && (str += currentCharacter(state), next(state)), str += currentCharacter(state), next(state);if (getToken(state), "\"" !== state.token) throw createSyntaxError(state, "End of string \" expected");return getToken(state), JSON.parse("\"" + str + "\"");}function parseSingleQuotesString(state) {var node, str;return "'" === state.token ? (str = parseSingleQuotesStringToken(state), node = new ConstantNode(str), node = parseAccessors(state, node), node) : parseMatrix(state);}function parseSingleQuotesStringToken(state) {for (var str = ""; "" !== currentCharacter(state) && "'" !== currentCharacter(state);) "\\" === currentCharacter(state) && (str += currentCharacter(state), next(state)), str += currentCharacter(state), next(state);if (getToken(state), "'" !== state.token) throw createSyntaxError(state, "End of string ' expected");return getToken(state), JSON.parse("\"" + str + "\"");}function parseMatrix(state) {var array, params, rows, cols;if ("[" === state.token) {if (openParams(state), getToken(state), "]" !== state.token) {var row = parseRow(state);if (";" === state.token) {for (rows = 1, params = [row]; ";" === state.token;) getToken(state), params[rows] = parseRow(state), rows++;if ("]" !== state.token) throw createSyntaxError(state, "End of matrix ] expected");closeParams(state), getToken(state), cols = params[0].items.length;for (var r = 1; r < rows; r++) if (params[r].items.length !== cols) throw createError(state, "Column dimensions mismatch (" + params[r].items.length + " !== " + cols + ")");array = new ArrayNode(params);} else {if ("]" !== state.token) throw createSyntaxError(state, "End of matrix ] expected");closeParams(state), getToken(state), array = row;}} else closeParams(state), getToken(state), array = new ArrayNode([]);return parseAccessors(state, array);}return parseObject(state);}function parseRow(state) {for (var params = [parseAssignment(state)], len = 1; "," === state.token;) getToken(state), params[len] = parseAssignment(state), len++;return new ArrayNode(params);}function parseObject(state) {if ("{" === state.token) {openParams(state);var key,properties = {};do if (getToken(state), "}" !== state.token) {if ("\"" === state.token) key = parseDoubleQuotesStringToken(state);else if ("'" === state.token) key = parseSingleQuotesStringToken(state);else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) key = state.token, getToken(state);else throw createSyntaxError(state, "Symbol or string expected as object key");if (":" !== state.token) throw createSyntaxError(state, "Colon : expected after object key");getToken(state), properties[key] = parseAssignment(state);} while ("," === state.token);if ("}" !== state.token) throw createSyntaxError(state, "Comma , or bracket } expected after object value");closeParams(state), getToken(state);var node = new ObjectNode(properties);return node = parseAccessors(state, node), node;}return parseNumber(state);}function parseNumber(state) {var numberStr;return state.tokenType === TOKENTYPE.NUMBER ? (numberStr = state.token, getToken(state), new ConstantNode(numeric(numberStr, config.number))) : parseParentheses(state);}function parseParentheses(state) {var node;if ("(" === state.token) {if (openParams(state), getToken(state), node = parseAssignment(state), ")" !== state.token) throw createSyntaxError(state, "Parenthesis ) expected");return closeParams(state), getToken(state), node = new ParenthesisNode(node), node = parseAccessors(state, node), node;}return parseEnd(state);}function parseEnd(state) {if ("" === state.token) throw createSyntaxError(state, "Unexpected end of expression");else throw createSyntaxError(state, "Value expected");}function col(state) {return state.index - state.token.length + 1;}function createSyntaxError(state, message) {var c = col(state),error = new SyntaxError(message + " (char " + c + ")");return error.char = c, error;}function createError(state, message) {var c = col(state),error = new SyntaxError(message + " (char " + c + ")");return error.char = c, error;}var typed = _ref.typed,numeric = _ref.numeric,config = _ref.config,AccessorNode = _ref.AccessorNode,ArrayNode = _ref.ArrayNode,AssignmentNode = _ref.AssignmentNode,BlockNode = _ref.BlockNode,ConditionalNode = _ref.ConditionalNode,ConstantNode = _ref.ConstantNode,FunctionAssignmentNode = _ref.FunctionAssignmentNode,FunctionNode = _ref.FunctionNode,IndexNode = _ref.IndexNode,ObjectNode = _ref.ObjectNode,OperatorNode = _ref.OperatorNode,ParenthesisNode = _ref.ParenthesisNode,RangeNode = _ref.RangeNode,RelationalNode = _ref.RelationalNode,SymbolNode = _ref.SymbolNode,parse = typed(name, { string: function (expression) {return parseStart(expression, {});}, "Array | Matrix": function (expressions) {return parseMultiple(expressions, {});}, "string, Object": function (expression, options) {var extraNodes = void 0 === options.nodes ? {} : options.nodes;return parseStart(expression, extraNodes);}, "Array | Matrix, Object": parseMultiple }),TOKENTYPE = { NULL: 0, DELIMITER: 1, NUMBER: 2, SYMBOL: 3, UNKNOWN: 4 },DELIMITERS = { ",": !0, "(": !0, ")": !0, "[": !0, "]": !0, "{": !0, "}": !0, '"': !0, "'": !0, ";": !0, "+": !0, "-": !0, "*": !0, ".*": !0, "/": !0, "./": !0, "%": !0, "^": !0, ".^": !0, "~": !0, "!": !0, "&": !0, "|": !0, "^|": !0, "=": !0, ":": !0, "?": !0, "==": !0, "!=": !0, "<": !0, ">": !0, "<=": !0, ">=": !0, "<<": !0, ">>": !0, ">>>": !0 },NAMED_DELIMITERS = { mod: !0, to: !0, in: !0, and: !0, xor: !0, or: !0, not: !0 },CONSTANTS = { true: !0, false: !1, null: null, undefined: void 0 },NUMERIC_CONSTANTS = ["NaN", "Infinity"];return parse.isAlpha = function (c, cPrev, cNext) {return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c);}, parse.isValidLatinOrGreek = function (c) {return /^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(c);}, parse.isValidMathSymbol = function (high, low) {return /^[\uD835]$/.test(high) && /^[\uDC00-\uDFFF]$/.test(low) && /^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(low);}, parse.isWhitespace = function (c, nestingLevel) {return " " === c || "\t" === c || "\n" === c && 0 < nestingLevel;}, parse.isDecimalMark = function (c, cNext) {return "." === c && "/" !== cNext && "*" !== cNext && "^" !== cNext;}, parse.isDigitDot = function (c) {return "0" <= c && "9" >= c || "." === c;}, parse.isDigit = function (c) {return "0" <= c && "9" >= c;}, parse.isHexDigit = function (c) {return "0" <= c && "9" >= c || "a" <= c && "f" >= c || "A" <= c && "F" >= c;}, parse;});exports.createParse = createParse;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/apply.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createApplyTransform = void 0;var _errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_apply = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/apply.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "apply",dependencies = ["typed", "isInteger"],createApplyTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,isInteger = _ref.isInteger,apply = (0, _apply.createApply)({ typed: typed, isInteger: isInteger });return typed("apply", { "...any": function (args) {var dim = args[1];(0, _is.isNumber)(dim) ? args[1] = dim - 1 : (0, _is.isBigNumber)(dim) && (args[1] = dim.minus(1));try {return apply.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createApplyTransform = createApplyTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/column.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createColumnTransform = void 0;var _errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_column = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/column.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "column",dependencies = ["typed", "Index", "matrix", "range"],createColumnTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,Index = _ref.Index,matrix = _ref.matrix,range = _ref.range,column = (0, _column.createColumn)({ typed: typed, Index: Index, matrix: matrix, range: range });return typed("column", { "...any": function (args) {var lastIndex = args.length - 1,last = args[lastIndex];(0, _is.isNumber)(last) && (args[lastIndex] = last - 1);try {return column.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createColumnTransform = createColumnTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/concat.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createConcatTransform = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_concat = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/concat.js"),name = "concat",dependencies = ["typed", "matrix", "isInteger"],createConcatTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,isInteger = _ref.isInteger,concat = (0, _concat.createConcat)({ typed: typed, matrix: matrix, isInteger: isInteger });return typed("concat", { "...any": function (args) {var lastIndex = args.length - 1,last = args[lastIndex];(0, _is.isNumber)(last) ? args[lastIndex] = last - 1 : (0, _is.isBigNumber)(last) && (args[lastIndex] = last.minus(1));try {return concat.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createConcatTransform = createConcatTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/diff.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDiffTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_diff = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/diff.js"),_lastDimToZeroBase = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js"),name = "diff",dependencies = ["typed", "matrix", "subtract", "number", "bignumber"],createDiffTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,subtract = _ref.subtract,number = _ref.number,bignumber = _ref.bignumber,diff = (0, _diff.createDiff)({ typed: typed, matrix: matrix, subtract: subtract, number: number, bignumber: bignumber });return typed(name, { "...any": function (args) {args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args);try {return diff.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createDiffTransform = createDiffTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/filter.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFilterTransform = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_function = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/function.js"),_compileInlineExpression = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "filter",dependencies = ["typed"],createFilterTransform = (0, _factory.factory)(name, dependencies, function (_ref) {function filterTransform(args, math, scope) {var x, callback;return args[0] && (x = args[0].compile().evaluate(scope)), args[1] && ((0, _is.isSymbolNode)(args[1]) || (0, _is.isFunctionAssignmentNode)(args[1]) ? callback = args[1].compile().evaluate(scope) : callback = (0, _compileInlineExpression.compileInlineExpression)(args[1], math, scope)), filter(x, callback);}var typed = _ref.typed;filterTransform.rawArgs = !0;var filter = typed("filter", { "Array, function": _filter, "Matrix, function": function (x, test) {return x.create(_filter(x.toArray(), test));}, "Array, RegExp": _array.filterRegExp, "Matrix, RegExp": function (x, test) {return x.create((0, _array.filterRegExp)(x.toArray(), test));} });return filterTransform;}, { isTransformFunction: !0 });exports.createFilterTransform = createFilterTransform;function _filter(x, callback) {var args = (0, _function.maxArgumentCount)(callback);return (0, _array.filter)(x, function (value, index, array) {return 1 === args ? callback(value) : 2 === args ? callback(value, [index + 1]) : callback(value, [index + 1], array);});}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/forEach.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createForEachTransform = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_function = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/function.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_compileInlineExpression = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js"),name = "forEach",dependencies = ["typed"],createForEachTransform = (0, _factory.factory)(name, dependencies, function (_ref) {function forEachTransform(args, math, scope) {var x, callback;return args[0] && (x = args[0].compile().evaluate(scope)), args[1] && ((0, _is.isSymbolNode)(args[1]) || (0, _is.isFunctionAssignmentNode)(args[1]) ? callback = args[1].compile().evaluate(scope) : callback = (0, _compileInlineExpression.compileInlineExpression)(args[1], math, scope)), _forEach(x, callback);}var typed = _ref.typed;forEachTransform.rawArgs = !0;var _forEach = typed("forEach", { "Array | Matrix, function": function (array, callback) {var args = (0, _function.maxArgumentCount)(callback);(function recurse(value, index) {Array.isArray(value) ? (0, _array.forEach)(value, function (child, i) {recurse(child, index.concat(i + 1));}) : 1 === args ? callback(value) : 2 === args ? callback(value, index) : callback(value, index, array);})(array.valueOf(), []);} });return forEachTransform;}, { isTransformFunction: !0 });exports.createForEachTransform = createForEachTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/index.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIndexTransform = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "index",dependencies = ["Index"],createIndexTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var Index = _ref.Index;return function () {for (var arg, args = [], i = 0, ii = arguments.length; i < ii; i++) {if (arg = arguments[i], (0, _is.isRange)(arg)) arg.start--, arg.end -= 0 < arg.step ? 0 : 2;else if (arg && !0 === arg.isSet) arg = arg.map(function (v) {return v - 1;});else if ((0, _is.isArray)(arg) || (0, _is.isMatrix)(arg)) arg = arg.map(function (v) {return v - 1;});else if ((0, _is.isNumber)(arg)) arg--;else if ((0, _is.isBigNumber)(arg)) arg = arg.toNumber() - 1;else if ("string" == typeof arg) ;else throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");args[i] = arg;}var res = new Index();return Index.apply(res, args), res;};}, { isTransformFunction: !0 });exports.createIndexTransform = createIndexTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/map.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMapTransform = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_function = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/function.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_compileInlineExpression = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js"),name = "map",dependencies = ["typed"],createMapTransform = (0, _factory.factory)(name, dependencies, function (_ref) {function mapTransform(args, math, scope) {var x, callback;return args[0] && (x = args[0].compile().evaluate(scope)), args[1] && ((0, _is.isSymbolNode)(args[1]) || (0, _is.isFunctionAssignmentNode)(args[1]) ? callback = args[1].compile().evaluate(scope) : callback = (0, _compileInlineExpression.compileInlineExpression)(args[1], math, scope)), map(x, callback);}var typed = _ref.typed;mapTransform.rawArgs = !0;var map = typed("map", { "Array, function": function (x, callback) {return _map(x, callback, x);}, "Matrix, function": function (x, callback) {return x.create(_map(x.valueOf(), callback, x));} });return mapTransform;}, { isTransformFunction: !0 });exports.createMapTransform = createMapTransform;function _map(array, callback, orig) {function recurse(value, index) {return Array.isArray(value) ? (0, _array.map)(value, function (child, i) {return recurse(child, index.concat(i + 1));}) : 1 === argsCount ? callback(value) : 2 === argsCount ? callback(value, index) : callback(value, index, orig);}var argsCount = (0, _function.maxArgumentCount)(callback);return recurse(array, []);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/max.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMaxTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_max = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/max.js"),_lastDimToZeroBase = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js"),name = "max",dependencies = ["typed", "config", "numeric", "larger"],createMaxTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,numeric = _ref.numeric,larger = _ref.larger,max = (0, _max.createMax)({ typed: typed, config: config, numeric: numeric, larger: larger });return typed("max", { "...any": function (args) {args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args);try {return max.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createMaxTransform = createMaxTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/mean.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMeanTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_mean = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/mean.js"),_lastDimToZeroBase = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js"),name = "mean",dependencies = ["typed", "add", "divide"],createMeanTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,add = _ref.add,divide = _ref.divide,mean = (0, _mean.createMean)({ typed: typed, add: add, divide: divide });return typed("mean", { "...any": function (args) {args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args);try {return mean.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createMeanTransform = createMeanTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/min.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMinTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_min = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/min.js"),_lastDimToZeroBase = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js"),name = "min",dependencies = ["typed", "config", "numeric", "smaller"],createMinTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,numeric = _ref.numeric,smaller = _ref.smaller,min = (0, _min.createMin)({ typed: typed, config: config, numeric: numeric, smaller: smaller });return typed("min", { "...any": function (args) {args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args);try {return min.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createMinTransform = createMinTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/range.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRangeTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_range = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/range.js"),name = "range",dependencies = ["typed", "config", "?matrix", "?bignumber", "smaller", "smallerEq", "larger", "largerEq"],createRangeTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,bignumber = _ref.bignumber,smaller = _ref.smaller,smallerEq = _ref.smallerEq,larger = _ref.larger,largerEq = _ref.largerEq,range = (0, _range.createRange)({ typed: typed, config: config, matrix: matrix, bignumber: bignumber, smaller: smaller, smallerEq: smallerEq, larger: larger, largerEq: largerEq });return typed("range", { "...any": function (args) {var lastIndex = args.length - 1,last = args[lastIndex];return "boolean" != typeof last && args.push(!0), range.apply(null, args);} });}, { isTransformFunction: !0 });exports.createRangeTransform = createRangeTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/row.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRowTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_row = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/row.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "row",dependencies = ["typed", "Index", "matrix", "range"],createRowTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,Index = _ref.Index,matrix = _ref.matrix,range = _ref.range,row = (0, _row.createRow)({ typed: typed, Index: Index, matrix: matrix, range: range });return typed("row", { "...any": function (args) {var lastIndex = args.length - 1,last = args[lastIndex];(0, _is.isNumber)(last) && (args[lastIndex] = last - 1);try {return row.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createRowTransform = createRowTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/std.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createStdTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_std = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/std.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_lastDimToZeroBase = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js"),name = "std",dependencies = ["typed", "sqrt", "variance"],createStdTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,sqrt = _ref.sqrt,variance = _ref.variance,std = (0, _std.createStd)({ typed: typed, sqrt: sqrt, variance: variance });return typed("std", { "...any": function (args) {args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args);try {return std.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createStdTransform = createStdTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/subset.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSubsetTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_subset = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/subset.js"),name = "subset",dependencies = ["typed", "matrix"],createSubsetTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,subset = (0, _subset.createSubset)({ typed: typed, matrix: matrix });return typed("subset", { "...any": function (args) {try {return subset.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createSubsetTransform = createSubsetTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/sum.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSumTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_sum = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/sum.js"),_lastDimToZeroBase = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js"),name = "sum",dependencies = ["typed", "config", "add", "numeric"],createSumTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,add = _ref.add,numeric = _ref.numeric,sum = (0, _sum.createSum)({ typed: typed, config: config, add: add, numeric: numeric });return typed(name, { "...any": function (args) {args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args);try {return sum.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createSumTransform = createSumTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.compileInlineExpression = compileInlineExpression;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_scope = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/scope.js");function compileInlineExpression(expression, math, scope) {var symbol = expression.filter(function (node) {return (0, _is.isSymbolNode)(node) && !(node.name in math) && !scope.has(node.name);})[0];if (!symbol) throw new Error("No undefined variable found in inline expression \"" + expression + "\"");var name = symbol.name,subScope = (0, _scope.createSubScope)(scope),eq = expression.compile();return function (x) {return subScope.set(name, x), eq.evaluate(subScope);};}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.errorTransform = errorTransform;var _IndexError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/IndexError.js");function errorTransform(err) {return err && err.isIndexError ? new _IndexError.IndexError(err.index + 1, err.min + 1, void 0 === err.max ? void 0 : err.max + 1) : err;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lastDimToZeroBase = lastDimToZeroBase;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js");function lastDimToZeroBase(args) {if (2 === args.length && (0, _is.isCollection)(args[0])) {args = args.slice();var dim = args[1];(0, _is.isNumber)(dim) ? args[1] = dim - 1 : (0, _is.isBigNumber)(dim) && (args[1] = dim.minus(1));}return args;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/expression/transform/variance.transform.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createVarianceTransform = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_errorTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js"),_variance = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/variance.js"),_lastDimToZeroBase = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js"),name = "variance",dependencies = ["typed", "add", "subtract", "multiply", "divide", "apply", "isNaN"],createVarianceTransform = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,add = _ref.add,subtract = _ref.subtract,multiply = _ref.multiply,divide = _ref.divide,apply = _ref.apply,isNaN = _ref.isNaN,variance = (0, _variance.createVariance)({ typed: typed, add: add, subtract: subtract, multiply: multiply, divide: divide, apply: apply, isNaN: isNaN });return typed(name, { "...any": function (args) {args = (0, _lastDimToZeroBase.lastDimToZeroBase)(args);try {return variance.apply(null, args);} catch (err) {throw (0, _errorTransform.errorTransform)(err);}} });}, { isTransformFunction: !0 });exports.createVarianceTransform = createVarianceTransform;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/factoriesAny.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), Object.defineProperty(exports, "createTyped", ({ enumerable: !0, get: function () {return _typed.createTyped;} })), Object.defineProperty(exports, "createResultSet", ({ enumerable: !0, get: function () {return _ResultSet.createResultSet;} })), Object.defineProperty(exports, "createBigNumberClass", ({ enumerable: !0, get: function () {return _BigNumber.createBigNumberClass;} })), Object.defineProperty(exports, "createComplexClass", ({ enumerable: !0, get: function () {return _Complex.createComplexClass;} })), Object.defineProperty(exports, "createFractionClass", ({ enumerable: !0, get: function () {return _Fraction.createFractionClass;} })), Object.defineProperty(exports, "createRangeClass", ({ enumerable: !0, get: function () {return _Range.createRangeClass;} })), Object.defineProperty(exports, "createMatrixClass", ({ enumerable: !0, get: function () {return _Matrix.createMatrixClass;} })), Object.defineProperty(exports, "createDenseMatrixClass", ({ enumerable: !0, get: function () {return _DenseMatrix.createDenseMatrixClass;} })), Object.defineProperty(exports, "createClone", ({ enumerable: !0, get: function () {return _clone.createClone;} })), Object.defineProperty(exports, "createIsInteger", ({ enumerable: !0, get: function () {return _isInteger.createIsInteger;} })), Object.defineProperty(exports, "createIsNegative", ({ enumerable: !0, get: function () {return _isNegative.createIsNegative;} })), Object.defineProperty(exports, "createIsNumeric", ({ enumerable: !0, get: function () {return _isNumeric.createIsNumeric;} })), Object.defineProperty(exports, "createHasNumericValue", ({ enumerable: !0, get: function () {return _hasNumericValue.createHasNumericValue;} })), Object.defineProperty(exports, "createIsPositive", ({ enumerable: !0, get: function () {return _isPositive.createIsPositive;} })), Object.defineProperty(exports, "createIsZero", ({ enumerable: !0, get: function () {return _isZero.createIsZero;} })), Object.defineProperty(exports, "createIsNaN", ({ enumerable: !0, get: function () {return _isNaN.createIsNaN;} })), Object.defineProperty(exports, "createTypeOf", ({ enumerable: !0, get: function () {return _typeOf.createTypeOf;} })), Object.defineProperty(exports, "createEqualScalar", ({ enumerable: !0, get: function () {return _equalScalar.createEqualScalar;} })), Object.defineProperty(exports, "createSparseMatrixClass", ({ enumerable: !0, get: function () {return _SparseMatrix.createSparseMatrixClass;} })), Object.defineProperty(exports, "createNumber", ({ enumerable: !0, get: function () {return _number.createNumber;} })), Object.defineProperty(exports, "createString", ({ enumerable: !0, get: function () {return _string.createString;} })), Object.defineProperty(exports, "createBoolean", ({ enumerable: !0, get: function () {return _boolean.createBoolean;} })), Object.defineProperty(exports, "createBignumber", ({ enumerable: !0, get: function () {return _bignumber.createBignumber;} })), Object.defineProperty(exports, "createComplex", ({ enumerable: !0, get: function () {return _complex.createComplex;} })), Object.defineProperty(exports, "createFraction", ({ enumerable: !0, get: function () {return _fraction.createFraction;} })), Object.defineProperty(exports, "createMatrix", ({ enumerable: !0, get: function () {return _matrix.createMatrix;} })), Object.defineProperty(exports, "createMatrixFromFunction", ({ enumerable: !0, get: function () {return _matrixFromFunction.createMatrixFromFunction;} })), Object.defineProperty(exports, "createMatrixFromRows", ({ enumerable: !0, get: function () {return _matrixFromRows.createMatrixFromRows;} })), Object.defineProperty(exports, "createMatrixFromColumns", ({ enumerable: !0, get: function () {return _matrixFromColumns.createMatrixFromColumns;} })), Object.defineProperty(exports, "createSplitUnit", ({ enumerable: !0, get: function () {return _splitUnit.createSplitUnit;} })), Object.defineProperty(exports, "createUnaryMinus", ({ enumerable: !0, get: function () {return _unaryMinus.createUnaryMinus;} })), Object.defineProperty(exports, "createUnaryPlus", ({ enumerable: !0, get: function () {return _unaryPlus.createUnaryPlus;} })), Object.defineProperty(exports, "createAbs", ({ enumerable: !0, get: function () {return _abs.createAbs;} })), Object.defineProperty(exports, "createApply", ({ enumerable: !0, get: function () {return _apply.createApply;} })), Object.defineProperty(exports, "createAddScalar", ({ enumerable: !0, get: function () {return _addScalar.createAddScalar;} })), Object.defineProperty(exports, "createCbrt", ({ enumerable: !0, get: function () {return _cbrt.createCbrt;} })), Object.defineProperty(exports, "createCeil", ({ enumerable: !0, get: function () {return _ceil.createCeil;} })), Object.defineProperty(exports, "createCube", ({ enumerable: !0, get: function () {return _cube.createCube;} })), Object.defineProperty(exports, "createExp", ({ enumerable: !0, get: function () {return _exp.createExp;} })), Object.defineProperty(exports, "createExpm1", ({ enumerable: !0, get: function () {return _expm.createExpm1;} })), Object.defineProperty(exports, "createFix", ({ enumerable: !0, get: function () {return _fix.createFix;} })), Object.defineProperty(exports, "createFloor", ({ enumerable: !0, get: function () {return _floor.createFloor;} })), Object.defineProperty(exports, "createGcd", ({ enumerable: !0, get: function () {return _gcd.createGcd;} })), Object.defineProperty(exports, "createLcm", ({ enumerable: !0, get: function () {return _lcm.createLcm;} })), Object.defineProperty(exports, "createLog10", ({ enumerable: !0, get: function () {return _log.createLog10;} })), Object.defineProperty(exports, "createLog2", ({ enumerable: !0, get: function () {return _log2.createLog2;} })), Object.defineProperty(exports, "createMod", ({ enumerable: !0, get: function () {return _mod.createMod;} })), Object.defineProperty(exports, "createMultiplyScalar", ({ enumerable: !0, get: function () {return _multiplyScalar.createMultiplyScalar;} })), Object.defineProperty(exports, "createMultiply", ({ enumerable: !0, get: function () {return _multiply.createMultiply;} })), Object.defineProperty(exports, "createNthRoot", ({ enumerable: !0, get: function () {return _nthRoot.createNthRoot;} })), Object.defineProperty(exports, "createSign", ({ enumerable: !0, get: function () {return _sign.createSign;} })), Object.defineProperty(exports, "createSqrt", ({ enumerable: !0, get: function () {return _sqrt.createSqrt;} })), Object.defineProperty(exports, "createSquare", ({ enumerable: !0, get: function () {return _square.createSquare;} })), Object.defineProperty(exports, "createSubtract", ({ enumerable: !0, get: function () {return _subtract.createSubtract;} })), Object.defineProperty(exports, "createXgcd", ({ enumerable: !0, get: function () {return _xgcd.createXgcd;} })), Object.defineProperty(exports, "createDotMultiply", ({ enumerable: !0, get: function () {return _dotMultiply.createDotMultiply;} })), Object.defineProperty(exports, "createBitAnd", ({ enumerable: !0, get: function () {return _bitAnd.createBitAnd;} })), Object.defineProperty(exports, "createBitNot", ({ enumerable: !0, get: function () {return _bitNot.createBitNot;} })), Object.defineProperty(exports, "createBitOr", ({ enumerable: !0, get: function () {return _bitOr.createBitOr;} })), Object.defineProperty(exports, "createBitXor", ({ enumerable: !0, get: function () {return _bitXor.createBitXor;} })), Object.defineProperty(exports, "createArg", ({ enumerable: !0, get: function () {return _arg.createArg;} })), Object.defineProperty(exports, "createConj", ({ enumerable: !0, get: function () {return _conj.createConj;} })), Object.defineProperty(exports, "createIm", ({ enumerable: !0, get: function () {return _im.createIm;} })), Object.defineProperty(exports, "createRe", ({ enumerable: !0, get: function () {return _re.createRe;} })), Object.defineProperty(exports, "createNot", ({ enumerable: !0, get: function () {return _not.createNot;} })), Object.defineProperty(exports, "createOr", ({ enumerable: !0, get: function () {return _or.createOr;} })), Object.defineProperty(exports, "createXor", ({ enumerable: !0, get: function () {return _xor.createXor;} })), Object.defineProperty(exports, "createConcat", ({ enumerable: !0, get: function () {return _concat.createConcat;} })), Object.defineProperty(exports, "createColumn", ({ enumerable: !0, get: function () {return _column.createColumn;} })), Object.defineProperty(exports, "createCount", ({ enumerable: !0, get: function () {return _count.createCount;} })), Object.defineProperty(exports, "createCross", ({ enumerable: !0, get: function () {return _cross.createCross;} })), Object.defineProperty(exports, "createDiag", ({ enumerable: !0, get: function () {return _diag.createDiag;} })), Object.defineProperty(exports, "createFilter", ({ enumerable: !0, get: function () {return _filter.createFilter;} })), Object.defineProperty(exports, "createFlatten", ({ enumerable: !0, get: function () {return _flatten.createFlatten;} })), Object.defineProperty(exports, "createForEach", ({ enumerable: !0, get: function () {return _forEach.createForEach;} })), Object.defineProperty(exports, "createGetMatrixDataType", ({ enumerable: !0, get: function () {return _getMatrixDataType.createGetMatrixDataType;} })), Object.defineProperty(exports, "createIdentity", ({ enumerable: !0, get: function () {return _identity.createIdentity;} })), Object.defineProperty(exports, "createKron", ({ enumerable: !0, get: function () {return _kron.createKron;} })), Object.defineProperty(exports, "createMap", ({ enumerable: !0, get: function () {return _map.createMap;} })), Object.defineProperty(exports, "createDiff", ({ enumerable: !0, get: function () {return _diff.createDiff;} })), Object.defineProperty(exports, "createOnes", ({ enumerable: !0, get: function () {return _ones.createOnes;} })), Object.defineProperty(exports, "createRange", ({ enumerable: !0, get: function () {return _range.createRange;} })), Object.defineProperty(exports, "createReshape", ({ enumerable: !0, get: function () {return _reshape.createReshape;} })), Object.defineProperty(exports, "createResize", ({ enumerable: !0, get: function () {return _resize.createResize;} })), Object.defineProperty(exports, "createRotate", ({ enumerable: !0, get: function () {return _rotate.createRotate;} })), Object.defineProperty(exports, "createRotationMatrix", ({ enumerable: !0, get: function () {return _rotationMatrix.createRotationMatrix;} })), Object.defineProperty(exports, "createRow", ({ enumerable: !0, get: function () {return _row.createRow;} })), Object.defineProperty(exports, "createSize", ({ enumerable: !0, get: function () {return _size.createSize;} })), Object.defineProperty(exports, "createSqueeze", ({ enumerable: !0, get: function () {return _squeeze.createSqueeze;} })), Object.defineProperty(exports, "createSubset", ({ enumerable: !0, get: function () {return _subset.createSubset;} })), Object.defineProperty(exports, "createTranspose", ({ enumerable: !0, get: function () {return _transpose.createTranspose;} })), Object.defineProperty(exports, "createCtranspose", ({ enumerable: !0, get: function () {return _ctranspose.createCtranspose;} })), Object.defineProperty(exports, "createZeros", ({ enumerable: !0, get: function () {return _zeros.createZeros;} })), Object.defineProperty(exports, "createErf", ({ enumerable: !0, get: function () {return _erf.createErf;} })), Object.defineProperty(exports, "createMode", ({ enumerable: !0, get: function () {return _mode.createMode;} })), Object.defineProperty(exports, "createProd", ({ enumerable: !0, get: function () {return _prod.createProd;} })), Object.defineProperty(exports, "createFormat", ({ enumerable: !0, get: function () {return _format.createFormat;} })), Object.defineProperty(exports, "createBin", ({ enumerable: !0, get: function () {return _bin.createBin;} })), Object.defineProperty(exports, "createOct", ({ enumerable: !0, get: function () {return _oct.createOct;} })), Object.defineProperty(exports, "createHex", ({ enumerable: !0, get: function () {return _hex.createHex;} })), Object.defineProperty(exports, "createPrint", ({ enumerable: !0, get: function () {return _print.createPrint;} })), Object.defineProperty(exports, "createTo", ({ enumerable: !0, get: function () {return _to.createTo;} })), Object.defineProperty(exports, "createIsPrime", ({ enumerable: !0, get: function () {return _isPrime.createIsPrime;} })), Object.defineProperty(exports, "createNumeric", ({ enumerable: !0, get: function () {return _numeric.createNumeric;} })), Object.defineProperty(exports, "createDivideScalar", ({ enumerable: !0, get: function () {return _divideScalar.createDivideScalar;} })), Object.defineProperty(exports, "createPow", ({ enumerable: !0, get: function () {return _pow.createPow;} })), Object.defineProperty(exports, "createRound", ({ enumerable: !0, get: function () {return _round.createRound;} })), Object.defineProperty(exports, "createLog", ({ enumerable: !0, get: function () {return _log3.createLog;} })), Object.defineProperty(exports, "createLog1p", ({ enumerable: !0, get: function () {return _log1p.createLog1p;} })), Object.defineProperty(exports, "createNthRoots", ({ enumerable: !0, get: function () {return _nthRoots.createNthRoots;} })), Object.defineProperty(exports, "createDotPow", ({ enumerable: !0, get: function () {return _dotPow.createDotPow;} })), Object.defineProperty(exports, "createDotDivide", ({ enumerable: !0, get: function () {return _dotDivide.createDotDivide;} })), Object.defineProperty(exports, "createLsolve", ({ enumerable: !0, get: function () {return _lsolve.createLsolve;} })), Object.defineProperty(exports, "createUsolve", ({ enumerable: !0, get: function () {return _usolve.createUsolve;} })), Object.defineProperty(exports, "createLsolveAll", ({ enumerable: !0, get: function () {return _lsolveAll.createLsolveAll;} })), Object.defineProperty(exports, "createUsolveAll", ({ enumerable: !0, get: function () {return _usolveAll.createUsolveAll;} })), Object.defineProperty(exports, "createLeftShift", ({ enumerable: !0, get: function () {return _leftShift.createLeftShift;} })), Object.defineProperty(exports, "createRightArithShift", ({ enumerable: !0, get: function () {return _rightArithShift.createRightArithShift;} })), Object.defineProperty(exports, "createRightLogShift", ({ enumerable: !0, get: function () {return _rightLogShift.createRightLogShift;} })), Object.defineProperty(exports, "createAnd", ({ enumerable: !0, get: function () {return _and.createAnd;} })), Object.defineProperty(exports, "createCompare", ({ enumerable: !0, get: function () {return _compare.createCompare;} })), Object.defineProperty(exports, "createCompareNatural", ({ enumerable: !0, get: function () {return _compareNatural.createCompareNatural;} })), Object.defineProperty(exports, "createCompareText", ({ enumerable: !0, get: function () {return _compareText.createCompareText;} })), Object.defineProperty(exports, "createEqual", ({ enumerable: !0, get: function () {return _equal.createEqual;} })), Object.defineProperty(exports, "createEqualText", ({ enumerable: !0, get: function () {return _equalText.createEqualText;} })), Object.defineProperty(exports, "createSmaller", ({ enumerable: !0, get: function () {return _smaller.createSmaller;} })), Object.defineProperty(exports, "createSmallerEq", ({ enumerable: !0, get: function () {return _smallerEq.createSmallerEq;} })), Object.defineProperty(exports, "createLarger", ({ enumerable: !0, get: function () {return _larger.createLarger;} })), Object.defineProperty(exports, "createLargerEq", ({ enumerable: !0, get: function () {return _largerEq.createLargerEq;} })), Object.defineProperty(exports, "createDeepEqual", ({ enumerable: !0, get: function () {return _deepEqual.createDeepEqual;} })), Object.defineProperty(exports, "createUnequal", ({ enumerable: !0, get: function () {return _unequal.createUnequal;} })), Object.defineProperty(exports, "createPartitionSelect", ({ enumerable: !0, get: function () {return _partitionSelect.createPartitionSelect;} })), Object.defineProperty(exports, "createSort", ({ enumerable: !0, get: function () {return _sort.createSort;} })), Object.defineProperty(exports, "createMax", ({ enumerable: !0, get: function () {return _max.createMax;} })), Object.defineProperty(exports, "createMin", ({ enumerable: !0, get: function () {return _min.createMin;} })), Object.defineProperty(exports, "createImmutableDenseMatrixClass", ({ enumerable: !0, get: function () {return _ImmutableDenseMatrix.createImmutableDenseMatrixClass;} })), Object.defineProperty(exports, "createIndexClass", ({ enumerable: !0, get: function () {return _MatrixIndex.createIndexClass;} })), Object.defineProperty(exports, "createFibonacciHeapClass", ({ enumerable: !0, get: function () {return _FibonacciHeap.createFibonacciHeapClass;} })), Object.defineProperty(exports, "createSpaClass", ({ enumerable: !0, get: function () {return _Spa.createSpaClass;} })), Object.defineProperty(exports, "createUnitClass", ({ enumerable: !0, get: function () {return _Unit.createUnitClass;} })), Object.defineProperty(exports, "createUnitFunction", ({ enumerable: !0, get: function () {return _unit.createUnitFunction;} })), Object.defineProperty(exports, "createSparse", ({ enumerable: !0, get: function () {return _sparse.createSparse;} })), Object.defineProperty(exports, "createCreateUnit", ({ enumerable: !0, get: function () {return _createUnit.createCreateUnit;} })), Object.defineProperty(exports, "createAcos", ({ enumerable: !0, get: function () {return _acos.createAcos;} })), Object.defineProperty(exports, "createAcosh", ({ enumerable: !0, get: function () {return _acosh.createAcosh;} })), Object.defineProperty(exports, "createAcot", ({ enumerable: !0, get: function () {return _acot.createAcot;} })), Object.defineProperty(exports, "createAcoth", ({ enumerable: !0, get: function () {return _acoth.createAcoth;} })), Object.defineProperty(exports, "createAcsc", ({ enumerable: !0, get: function () {return _acsc.createAcsc;} })), Object.defineProperty(exports, "createAcsch", ({ enumerable: !0, get: function () {return _acsch.createAcsch;} })), Object.defineProperty(exports, "createAsec", ({ enumerable: !0, get: function () {return _asec.createAsec;} })), Object.defineProperty(exports, "createAsech", ({ enumerable: !0, get: function () {return _asech.createAsech;} })), Object.defineProperty(exports, "createAsin", ({ enumerable: !0, get: function () {return _asin.createAsin;} })), Object.defineProperty(exports, "createAsinh", ({ enumerable: !0, get: function () {return _asinh.createAsinh;} })), Object.defineProperty(exports, "createAtan", ({ enumerable: !0, get: function () {return _atan.createAtan;} })), Object.defineProperty(exports, "createAtan2", ({ enumerable: !0, get: function () {return _atan2.createAtan2;} })), Object.defineProperty(exports, "createAtanh", ({ enumerable: !0, get: function () {return _atanh.createAtanh;} })), Object.defineProperty(exports, "createCos", ({ enumerable: !0, get: function () {return _cos.createCos;} })), Object.defineProperty(exports, "createCosh", ({ enumerable: !0, get: function () {return _cosh.createCosh;} })), Object.defineProperty(exports, "createCot", ({ enumerable: !0, get: function () {return _cot.createCot;} })), Object.defineProperty(exports, "createCoth", ({ enumerable: !0, get: function () {return _coth.createCoth;} })), Object.defineProperty(exports, "createCsc", ({ enumerable: !0, get: function () {return _csc.createCsc;} })), Object.defineProperty(exports, "createCsch", ({ enumerable: !0, get: function () {return _csch.createCsch;} })), Object.defineProperty(exports, "createSec", ({ enumerable: !0, get: function () {return _sec.createSec;} })), Object.defineProperty(exports, "createSech", ({ enumerable: !0, get: function () {return _sech.createSech;} })), Object.defineProperty(exports, "createSin", ({ enumerable: !0, get: function () {return _sin.createSin;} })), Object.defineProperty(exports, "createSinh", ({ enumerable: !0, get: function () {return _sinh.createSinh;} })), Object.defineProperty(exports, "createTan", ({ enumerable: !0, get: function () {return _tan.createTan;} })), Object.defineProperty(exports, "createTanh", ({ enumerable: !0, get: function () {return _tanh.createTanh;} })), Object.defineProperty(exports, "createSetCartesian", ({ enumerable: !0, get: function () {return _setCartesian.createSetCartesian;} })), Object.defineProperty(exports, "createSetDifference", ({ enumerable: !0, get: function () {return _setDifference.createSetDifference;} })), Object.defineProperty(exports, "createSetDistinct", ({ enumerable: !0, get: function () {return _setDistinct.createSetDistinct;} })), Object.defineProperty(exports, "createSetIntersect", ({ enumerable: !0, get: function () {return _setIntersect.createSetIntersect;} })), Object.defineProperty(exports, "createSetIsSubset", ({ enumerable: !0, get: function () {return _setIsSubset.createSetIsSubset;} })), Object.defineProperty(exports, "createSetMultiplicity", ({ enumerable: !0, get: function () {return _setMultiplicity.createSetMultiplicity;} })), Object.defineProperty(exports, "createSetPowerset", ({ enumerable: !0, get: function () {return _setPowerset.createSetPowerset;} })), Object.defineProperty(exports, "createSetSize", ({ enumerable: !0, get: function () {return _setSize.createSetSize;} })), Object.defineProperty(exports, "createSetSymDifference", ({ enumerable: !0, get: function () {return _setSymDifference.createSetSymDifference;} })), Object.defineProperty(exports, "createSetUnion", ({ enumerable: !0, get: function () {return _setUnion.createSetUnion;} })), Object.defineProperty(exports, "createAdd", ({ enumerable: !0, get: function () {return _add.createAdd;} })), Object.defineProperty(exports, "createHypot", ({ enumerable: !0, get: function () {return _hypot.createHypot;} })), Object.defineProperty(exports, "createNorm", ({ enumerable: !0, get: function () {return _norm.createNorm;} })), Object.defineProperty(exports, "createDot", ({ enumerable: !0, get: function () {return _dot.createDot;} })), Object.defineProperty(exports, "createTrace", ({ enumerable: !0, get: function () {return _trace.createTrace;} })), Object.defineProperty(exports, "createIndex", ({ enumerable: !0, get: function () {return _index.createIndex;} })), Object.defineProperty(exports, "createNode", ({ enumerable: !0, get: function () {return _Node.createNode;} })), Object.defineProperty(exports, "createAccessorNode", ({ enumerable: !0, get: function () {return _AccessorNode.createAccessorNode;} })), Object.defineProperty(exports, "createArrayNode", ({ enumerable: !0, get: function () {return _ArrayNode.createArrayNode;} })), Object.defineProperty(exports, "createAssignmentNode", ({ enumerable: !0, get: function () {return _AssignmentNode.createAssignmentNode;} })), Object.defineProperty(exports, "createBlockNode", ({ enumerable: !0, get: function () {return _BlockNode.createBlockNode;} })), Object.defineProperty(exports, "createConditionalNode", ({ enumerable: !0, get: function () {return _ConditionalNode.createConditionalNode;} })), Object.defineProperty(exports, "createConstantNode", ({ enumerable: !0, get: function () {return _ConstantNode.createConstantNode;} })), Object.defineProperty(exports, "createFunctionAssignmentNode", ({ enumerable: !0, get: function () {return _FunctionAssignmentNode.createFunctionAssignmentNode;} })), Object.defineProperty(exports, "createIndexNode", ({ enumerable: !0, get: function () {return _IndexNode.createIndexNode;} })), Object.defineProperty(exports, "createObjectNode", ({ enumerable: !0, get: function () {return _ObjectNode.createObjectNode;} })), Object.defineProperty(exports, "createOperatorNode", ({ enumerable: !0, get: function () {return _OperatorNode.createOperatorNode;} })), Object.defineProperty(exports, "createParenthesisNode", ({ enumerable: !0, get: function () {return _ParenthesisNode.createParenthesisNode;} })), Object.defineProperty(exports, "createRangeNode", ({ enumerable: !0, get: function () {return _RangeNode.createRangeNode;} })), Object.defineProperty(exports, "createRelationalNode", ({ enumerable: !0, get: function () {return _RelationalNode.createRelationalNode;} })), Object.defineProperty(exports, "createSymbolNode", ({ enumerable: !0, get: function () {return _SymbolNode.createSymbolNode;} })), Object.defineProperty(exports, "createFunctionNode", ({ enumerable: !0, get: function () {return _FunctionNode.createFunctionNode;} })), Object.defineProperty(exports, "createParse", ({ enumerable: !0, get: function () {return _parse.createParse;} })), Object.defineProperty(exports, "createCompile", ({ enumerable: !0, get: function () {return _compile.createCompile;} })), Object.defineProperty(exports, "createEvaluate", ({ enumerable: !0, get: function () {return _evaluate.createEvaluate;} })), Object.defineProperty(exports, "createParserClass", ({ enumerable: !0, get: function () {return _Parser.createParserClass;} })), Object.defineProperty(exports, "createParser", ({ enumerable: !0, get: function () {return _parser.createParser;} })), Object.defineProperty(exports, "createLup", ({ enumerable: !0, get: function () {return _lup.createLup;} })), Object.defineProperty(exports, "createQr", ({ enumerable: !0, get: function () {return _qr.createQr;} })), Object.defineProperty(exports, "createSlu", ({ enumerable: !0, get: function () {return _slu.createSlu;} })), Object.defineProperty(exports, "createLusolve", ({ enumerable: !0, get: function () {return _lusolve.createLusolve;} })), Object.defineProperty(exports, "createHelpClass", ({ enumerable: !0, get: function () {return _Help.createHelpClass;} })), Object.defineProperty(exports, "createChainClass", ({ enumerable: !0, get: function () {return _Chain.createChainClass;} })), Object.defineProperty(exports, "createHelp", ({ enumerable: !0, get: function () {return _help.createHelp;} })), Object.defineProperty(exports, "createChain", ({ enumerable: !0, get: function () {return _chain.createChain;} })), Object.defineProperty(exports, "createDet", ({ enumerable: !0, get: function () {return _det.createDet;} })), Object.defineProperty(exports, "createInv", ({ enumerable: !0, get: function () {return _inv.createInv;} })), Object.defineProperty(exports, "createEigs", ({ enumerable: !0, get: function () {return _eigs.createEigs;} })), Object.defineProperty(exports, "createExpm", ({ enumerable: !0, get: function () {return _expm2.createExpm;} })), Object.defineProperty(exports, "createSqrtm", ({ enumerable: !0, get: function () {return _sqrtm.createSqrtm;} })), Object.defineProperty(exports, "createDivide", ({ enumerable: !0, get: function () {return _divide.createDivide;} })), Object.defineProperty(exports, "createDistance", ({ enumerable: !0, get: function () {return _distance.createDistance;} })), Object.defineProperty(exports, "createIntersect", ({ enumerable: !0, get: function () {return _intersect.createIntersect;} })), Object.defineProperty(exports, "createSum", ({ enumerable: !0, get: function () {return _sum.createSum;} })), Object.defineProperty(exports, "createMean", ({ enumerable: !0, get: function () {return _mean.createMean;} })), Object.defineProperty(exports, "createMedian", ({ enumerable: !0, get: function () {return _median.createMedian;} })), Object.defineProperty(exports, "createMad", ({ enumerable: !0, get: function () {return _mad.createMad;} })), Object.defineProperty(exports, "createVariance", ({ enumerable: !0, get: function () {return _variance.createVariance;} })), Object.defineProperty(exports, "createQuantileSeq", ({ enumerable: !0, get: function () {return _quantileSeq.createQuantileSeq;} })), Object.defineProperty(exports, "createStd", ({ enumerable: !0, get: function () {return _std.createStd;} })), Object.defineProperty(exports, "createCombinations", ({ enumerable: !0, get: function () {return _combinations.createCombinations;} })), Object.defineProperty(exports, "createCombinationsWithRep", ({ enumerable: !0, get: function () {return _combinationsWithRep.createCombinationsWithRep;} })), Object.defineProperty(exports, "createGamma", ({ enumerable: !0, get: function () {return _gamma.createGamma;} })), Object.defineProperty(exports, "createFactorial", ({ enumerable: !0, get: function () {return _factorial.createFactorial;} })), Object.defineProperty(exports, "createKldivergence", ({ enumerable: !0, get: function () {return _kldivergence.createKldivergence;} })), Object.defineProperty(exports, "createMultinomial", ({ enumerable: !0, get: function () {return _multinomial.createMultinomial;} })), Object.defineProperty(exports, "createPermutations", ({ enumerable: !0, get: function () {return _permutations.createPermutations;} })), Object.defineProperty(exports, "createPickRandom", ({ enumerable: !0, get: function () {return _pickRandom.createPickRandom;} })), Object.defineProperty(exports, "createRandom", ({ enumerable: !0, get: function () {return _random.createRandom;} })), Object.defineProperty(exports, "createRandomInt", ({ enumerable: !0, get: function () {return _randomInt.createRandomInt;} })), Object.defineProperty(exports, "createStirlingS2", ({ enumerable: !0, get: function () {return _stirlingS.createStirlingS2;} })), Object.defineProperty(exports, "createBellNumbers", ({ enumerable: !0, get: function () {return _bellNumbers.createBellNumbers;} })), Object.defineProperty(exports, "createCatalan", ({ enumerable: !0, get: function () {return _catalan.createCatalan;} })), Object.defineProperty(exports, "createComposition", ({ enumerable: !0, get: function () {return _composition.createComposition;} })), Object.defineProperty(exports, "createSimplify", ({ enumerable: !0, get: function () {return _simplify.createSimplify;} })), Object.defineProperty(exports, "createDerivative", ({ enumerable: !0, get: function () {return _derivative.createDerivative;} })), Object.defineProperty(exports, "createRationalize", ({ enumerable: !0, get: function () {return _rationalize.createRationalize;} })), Object.defineProperty(exports, "createReviver", ({ enumerable: !0, get: function () {return _reviver.createReviver;} })), Object.defineProperty(exports, "createReplacer", ({ enumerable: !0, get: function () {return _replacer.createReplacer;} })), Object.defineProperty(exports, "createE", ({ enumerable: !0, get: function () {return _constants.createE;} })), Object.defineProperty(exports, "createUppercaseE", ({ enumerable: !0, get: function () {return _constants.createUppercaseE;} })), Object.defineProperty(exports, "createFalse", ({ enumerable: !0, get: function () {return _constants.createFalse;} })), Object.defineProperty(exports, "createI", ({ enumerable: !0, get: function () {return _constants.createI;} })), Object.defineProperty(exports, "createInfinity", ({ enumerable: !0, get: function () {return _constants.createInfinity;} })), Object.defineProperty(exports, "createLN10", ({ enumerable: !0, get: function () {return _constants.createLN10;} })), Object.defineProperty(exports, "createLN2", ({ enumerable: !0, get: function () {return _constants.createLN2;} })), Object.defineProperty(exports, "createLOG10E", ({ enumerable: !0, get: function () {return _constants.createLOG10E;} })), Object.defineProperty(exports, "createLOG2E", ({ enumerable: !0, get: function () {return _constants.createLOG2E;} })), Object.defineProperty(exports, "createNaN", ({ enumerable: !0, get: function () {return _constants.createNaN;} })), Object.defineProperty(exports, "createNull", ({ enumerable: !0, get: function () {return _constants.createNull;} })), Object.defineProperty(exports, "createPhi", ({ enumerable: !0, get: function () {return _constants.createPhi;} })), Object.defineProperty(exports, "createPi", ({ enumerable: !0, get: function () {return _constants.createPi;} })), Object.defineProperty(exports, "createUppercasePi", ({ enumerable: !0, get: function () {return _constants.createUppercasePi;} })), Object.defineProperty(exports, "createSQRT1_2", ({ enumerable: !0, get: function () {return _constants.createSQRT1_2;} })), Object.defineProperty(exports, "createSQRT2", ({ enumerable: !0, get: function () {return _constants.createSQRT2;} })), Object.defineProperty(exports, "createTau", ({ enumerable: !0, get: function () {return _constants.createTau;} })), Object.defineProperty(exports, "createTrue", ({ enumerable: !0, get: function () {return _constants.createTrue;} })), Object.defineProperty(exports, "createVersion", ({ enumerable: !0, get: function () {return _constants.createVersion;} })), Object.defineProperty(exports, "createAtomicMass", ({ enumerable: !0, get: function () {return _physicalConstants.createAtomicMass;} })), Object.defineProperty(exports, "createAvogadro", ({ enumerable: !0, get: function () {return _physicalConstants.createAvogadro;} })), Object.defineProperty(exports, "createBohrMagneton", ({ enumerable: !0, get: function () {return _physicalConstants.createBohrMagneton;} })), Object.defineProperty(exports, "createBohrRadius", ({ enumerable: !0, get: function () {return _physicalConstants.createBohrRadius;} })), Object.defineProperty(exports, "createBoltzmann", ({ enumerable: !0, get: function () {return _physicalConstants.createBoltzmann;} })), Object.defineProperty(exports, "createClassicalElectronRadius", ({ enumerable: !0, get: function () {return _physicalConstants.createClassicalElectronRadius;} })), Object.defineProperty(exports, "createConductanceQuantum", ({ enumerable: !0, get: function () {return _physicalConstants.createConductanceQuantum;} })), Object.defineProperty(exports, "createCoulomb", ({ enumerable: !0, get: function () {return _physicalConstants.createCoulomb;} })), Object.defineProperty(exports, "createDeuteronMass", ({ enumerable: !0, get: function () {return _physicalConstants.createDeuteronMass;} })), Object.defineProperty(exports, "createEfimovFactor", ({ enumerable: !0, get: function () {return _physicalConstants.createEfimovFactor;} })), Object.defineProperty(exports, "createElectricConstant", ({ enumerable: !0, get: function () {return _physicalConstants.createElectricConstant;} })), Object.defineProperty(exports, "createElectronMass", ({ enumerable: !0, get: function () {return _physicalConstants.createElectronMass;} })), Object.defineProperty(exports, "createElementaryCharge", ({ enumerable: !0, get: function () {return _physicalConstants.createElementaryCharge;} })), Object.defineProperty(exports, "createFaraday", ({ enumerable: !0, get: function () {return _physicalConstants.createFaraday;} })), Object.defineProperty(exports, "createFermiCoupling", ({ enumerable: !0, get: function () {return _physicalConstants.createFermiCoupling;} })), Object.defineProperty(exports, "createFineStructure", ({ enumerable: !0, get: function () {return _physicalConstants.createFineStructure;} })), Object.defineProperty(exports, "createFirstRadiation", ({ enumerable: !0, get: function () {return _physicalConstants.createFirstRadiation;} })), Object.defineProperty(exports, "createGasConstant", ({ enumerable: !0, get: function () {return _physicalConstants.createGasConstant;} })), Object.defineProperty(exports, "createGravitationConstant", ({ enumerable: !0, get: function () {return _physicalConstants.createGravitationConstant;} })), Object.defineProperty(exports, "createGravity", ({ enumerable: !0, get: function () {return _physicalConstants.createGravity;} })), Object.defineProperty(exports, "createHartreeEnergy", ({ enumerable: !0, get: function () {return _physicalConstants.createHartreeEnergy;} })), Object.defineProperty(exports, "createInverseConductanceQuantum", ({ enumerable: !0, get: function () {return _physicalConstants.createInverseConductanceQuantum;} })), Object.defineProperty(exports, "createKlitzing", ({ enumerable: !0, get: function () {return _physicalConstants.createKlitzing;} })), Object.defineProperty(exports, "createLoschmidt", ({ enumerable: !0, get: function () {return _physicalConstants.createLoschmidt;} })), Object.defineProperty(exports, "createMagneticConstant", ({ enumerable: !0, get: function () {return _physicalConstants.createMagneticConstant;} })), Object.defineProperty(exports, "createMagneticFluxQuantum", ({ enumerable: !0, get: function () {return _physicalConstants.createMagneticFluxQuantum;} })), Object.defineProperty(exports, "createMolarMass", ({ enumerable: !0, get: function () {return _physicalConstants.createMolarMass;} })), Object.defineProperty(exports, "createMolarMassC12", ({ enumerable: !0, get: function () {return _physicalConstants.createMolarMassC12;} })), Object.defineProperty(exports, "createMolarPlanckConstant", ({ enumerable: !0, get: function () {return _physicalConstants.createMolarPlanckConstant;} })), Object.defineProperty(exports, "createMolarVolume", ({ enumerable: !0, get: function () {return _physicalConstants.createMolarVolume;} })), Object.defineProperty(exports, "createNeutronMass", ({ enumerable: !0, get: function () {return _physicalConstants.createNeutronMass;} })), Object.defineProperty(exports, "createNuclearMagneton", ({ enumerable: !0, get: function () {return _physicalConstants.createNuclearMagneton;} })), Object.defineProperty(exports, "createPlanckCharge", ({ enumerable: !0, get: function () {return _physicalConstants.createPlanckCharge;} })), Object.defineProperty(exports, "createPlanckConstant", ({ enumerable: !0, get: function () {return _physicalConstants.createPlanckConstant;} })), Object.defineProperty(exports, "createPlanckLength", ({ enumerable: !0, get: function () {return _physicalConstants.createPlanckLength;} })), Object.defineProperty(exports, "createPlanckMass", ({ enumerable: !0, get: function () {return _physicalConstants.createPlanckMass;} })), Object.defineProperty(exports, "createPlanckTemperature", ({ enumerable: !0, get: function () {return _physicalConstants.createPlanckTemperature;} })), Object.defineProperty(exports, "createPlanckTime", ({ enumerable: !0, get: function () {return _physicalConstants.createPlanckTime;} })), Object.defineProperty(exports, "createProtonMass", ({ enumerable: !0, get: function () {return _physicalConstants.createProtonMass;} })), Object.defineProperty(exports, "createQuantumOfCirculation", ({ enumerable: !0, get: function () {return _physicalConstants.createQuantumOfCirculation;} })), Object.defineProperty(exports, "createReducedPlanckConstant", ({ enumerable: !0, get: function () {return _physicalConstants.createReducedPlanckConstant;} })), Object.defineProperty(exports, "createRydberg", ({ enumerable: !0, get: function () {return _physicalConstants.createRydberg;} })), Object.defineProperty(exports, "createSackurTetrode", ({ enumerable: !0, get: function () {return _physicalConstants.createSackurTetrode;} })), Object.defineProperty(exports, "createSecondRadiation", ({ enumerable: !0, get: function () {return _physicalConstants.createSecondRadiation;} })), Object.defineProperty(exports, "createSpeedOfLight", ({ enumerable: !0, get: function () {return _physicalConstants.createSpeedOfLight;} })), Object.defineProperty(exports, "createStefanBoltzmann", ({ enumerable: !0, get: function () {return _physicalConstants.createStefanBoltzmann;} })), Object.defineProperty(exports, "createThomsonCrossSection", ({ enumerable: !0, get: function () {return _physicalConstants.createThomsonCrossSection;} })), Object.defineProperty(exports, "createVacuumImpedance", ({ enumerable: !0, get: function () {return _physicalConstants.createVacuumImpedance;} })), Object.defineProperty(exports, "createWeakMixingAngle", ({ enumerable: !0, get: function () {return _physicalConstants.createWeakMixingAngle;} })), Object.defineProperty(exports, "createWienDisplacement", ({ enumerable: !0, get: function () {return _physicalConstants.createWienDisplacement;} })), Object.defineProperty(exports, "createApplyTransform", ({ enumerable: !0, get: function () {return _applyTransform.createApplyTransform;} })), Object.defineProperty(exports, "createColumnTransform", ({ enumerable: !0, get: function () {return _columnTransform.createColumnTransform;} })), Object.defineProperty(exports, "createFilterTransform", ({ enumerable: !0, get: function () {return _filterTransform.createFilterTransform;} })), Object.defineProperty(exports, "createForEachTransform", ({ enumerable: !0, get: function () {return _forEachTransform.createForEachTransform;} })), Object.defineProperty(exports, "createIndexTransform", ({ enumerable: !0, get: function () {return _indexTransform.createIndexTransform;} })), Object.defineProperty(exports, "createMapTransform", ({ enumerable: !0, get: function () {return _mapTransform.createMapTransform;} })), Object.defineProperty(exports, "createMaxTransform", ({ enumerable: !0, get: function () {return _maxTransform.createMaxTransform;} })), Object.defineProperty(exports, "createMeanTransform", ({ enumerable: !0, get: function () {return _meanTransform.createMeanTransform;} })), Object.defineProperty(exports, "createMinTransform", ({ enumerable: !0, get: function () {return _minTransform.createMinTransform;} })), Object.defineProperty(exports, "createRangeTransform", ({ enumerable: !0, get: function () {return _rangeTransform.createRangeTransform;} })), Object.defineProperty(exports, "createRowTransform", ({ enumerable: !0, get: function () {return _rowTransform.createRowTransform;} })), Object.defineProperty(exports, "createSubsetTransform", ({ enumerable: !0, get: function () {return _subsetTransform.createSubsetTransform;} })), Object.defineProperty(exports, "createConcatTransform", ({ enumerable: !0, get: function () {return _concatTransform.createConcatTransform;} })), Object.defineProperty(exports, "createDiffTransform", ({ enumerable: !0, get: function () {return _diffTransform.createDiffTransform;} })), Object.defineProperty(exports, "createStdTransform", ({ enumerable: !0, get: function () {return _stdTransform.createStdTransform;} })), Object.defineProperty(exports, "createSumTransform", ({ enumerable: !0, get: function () {return _sumTransform.createSumTransform;} })), Object.defineProperty(exports, "createVarianceTransform", ({ enumerable: !0, get: function () {return _varianceTransform.createVarianceTransform;} }));var _typed = __webpack_require__("./node_modules/mathjs/lib/cjs/core/function/typed.js"),_ResultSet = __webpack_require__("./node_modules/mathjs/lib/cjs/type/resultset/ResultSet.js"),_BigNumber = __webpack_require__("./node_modules/mathjs/lib/cjs/type/bignumber/BigNumber.js"),_Complex = __webpack_require__("./node_modules/mathjs/lib/cjs/type/complex/Complex.js"),_Fraction = __webpack_require__("./node_modules/mathjs/lib/cjs/type/fraction/Fraction.js"),_Range = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/Range.js"),_Matrix = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/Matrix.js"),_DenseMatrix = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/DenseMatrix.js"),_clone = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/clone.js"),_isInteger = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/isInteger.js"),_isNegative = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/isNegative.js"),_isNumeric = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/isNumeric.js"),_hasNumericValue = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/hasNumericValue.js"),_isPositive = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/isPositive.js"),_isZero = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/isZero.js"),_isNaN = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/isNaN.js"),_typeOf = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/typeOf.js"),_equalScalar = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/equalScalar.js"),_SparseMatrix = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/SparseMatrix.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/type/number.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/type/string.js"),_boolean = __webpack_require__("./node_modules/mathjs/lib/cjs/type/boolean.js"),_bignumber = __webpack_require__("./node_modules/mathjs/lib/cjs/type/bignumber/function/bignumber.js"),_complex = __webpack_require__("./node_modules/mathjs/lib/cjs/type/complex/function/complex.js"),_fraction = __webpack_require__("./node_modules/mathjs/lib/cjs/type/fraction/function/fraction.js"),_matrix = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/function/matrix.js"),_matrixFromFunction = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/matrixFromFunction.js"),_matrixFromRows = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/matrixFromRows.js"),_matrixFromColumns = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/matrixFromColumns.js"),_splitUnit = __webpack_require__("./node_modules/mathjs/lib/cjs/type/unit/function/splitUnit.js"),_unaryMinus = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/unaryMinus.js"),_unaryPlus = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/unaryPlus.js"),_abs = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/abs.js"),_apply = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/apply.js"),_addScalar = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/addScalar.js"),_cbrt = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/cbrt.js"),_ceil = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/ceil.js"),_cube = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/cube.js"),_exp = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/exp.js"),_expm = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/expm1.js"),_fix = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/fix.js"),_floor = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/floor.js"),_gcd = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/gcd.js"),_lcm = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/lcm.js"),_log = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/log10.js"),_log2 = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/log2.js"),_mod = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/mod.js"),_multiplyScalar = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/multiplyScalar.js"),_multiply = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/multiply.js"),_nthRoot = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/nthRoot.js"),_sign = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/sign.js"),_sqrt = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/sqrt.js"),_square = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/square.js"),_subtract = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/subtract.js"),_xgcd = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/xgcd.js"),_dotMultiply = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/dotMultiply.js"),_bitAnd = __webpack_require__("./node_modules/mathjs/lib/cjs/function/bitwise/bitAnd.js"),_bitNot = __webpack_require__("./node_modules/mathjs/lib/cjs/function/bitwise/bitNot.js"),_bitOr = __webpack_require__("./node_modules/mathjs/lib/cjs/function/bitwise/bitOr.js"),_bitXor = __webpack_require__("./node_modules/mathjs/lib/cjs/function/bitwise/bitXor.js"),_arg = __webpack_require__("./node_modules/mathjs/lib/cjs/function/complex/arg.js"),_conj = __webpack_require__("./node_modules/mathjs/lib/cjs/function/complex/conj.js"),_im = __webpack_require__("./node_modules/mathjs/lib/cjs/function/complex/im.js"),_re = __webpack_require__("./node_modules/mathjs/lib/cjs/function/complex/re.js"),_not = __webpack_require__("./node_modules/mathjs/lib/cjs/function/logical/not.js"),_or = __webpack_require__("./node_modules/mathjs/lib/cjs/function/logical/or.js"),_xor = __webpack_require__("./node_modules/mathjs/lib/cjs/function/logical/xor.js"),_concat = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/concat.js"),_column = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/column.js"),_count = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/count.js"),_cross = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/cross.js"),_diag = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/diag.js"),_filter = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/filter.js"),_flatten = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/flatten.js"),_forEach = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/forEach.js"),_getMatrixDataType = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/getMatrixDataType.js"),_identity = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/identity.js"),_kron = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/kron.js"),_map = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/map.js"),_diff = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/diff.js"),_ones = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/ones.js"),_range = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/range.js"),_reshape = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/reshape.js"),_resize = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/resize.js"),_rotate = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/rotate.js"),_rotationMatrix = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/rotationMatrix.js"),_row = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/row.js"),_size = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/size.js"),_squeeze = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/squeeze.js"),_subset = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/subset.js"),_transpose = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/transpose.js"),_ctranspose = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js"),_zeros = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/zeros.js"),_erf = __webpack_require__("./node_modules/mathjs/lib/cjs/function/special/erf.js"),_mode = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/mode.js"),_prod = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/prod.js"),_format = __webpack_require__("./node_modules/mathjs/lib/cjs/function/string/format.js"),_bin = __webpack_require__("./node_modules/mathjs/lib/cjs/function/string/bin.js"),_oct = __webpack_require__("./node_modules/mathjs/lib/cjs/function/string/oct.js"),_hex = __webpack_require__("./node_modules/mathjs/lib/cjs/function/string/hex.js"),_print = __webpack_require__("./node_modules/mathjs/lib/cjs/function/string/print.js"),_to = __webpack_require__("./node_modules/mathjs/lib/cjs/function/unit/to.js"),_isPrime = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/isPrime.js"),_numeric = __webpack_require__("./node_modules/mathjs/lib/cjs/function/utils/numeric.js"),_divideScalar = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/divideScalar.js"),_pow = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/pow.js"),_round = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/round.js"),_log3 = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/log.js"),_log1p = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/log1p.js"),_nthRoots = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/nthRoots.js"),_dotPow = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/dotPow.js"),_dotDivide = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/dotDivide.js"),_lsolve = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/lsolve.js"),_usolve = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/usolve.js"),_lsolveAll = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/lsolveAll.js"),_usolveAll = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/usolveAll.js"),_leftShift = __webpack_require__("./node_modules/mathjs/lib/cjs/function/bitwise/leftShift.js"),_rightArithShift = __webpack_require__("./node_modules/mathjs/lib/cjs/function/bitwise/rightArithShift.js"),_rightLogShift = __webpack_require__("./node_modules/mathjs/lib/cjs/function/bitwise/rightLogShift.js"),_and = __webpack_require__("./node_modules/mathjs/lib/cjs/function/logical/and.js"),_compare = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/compare.js"),_compareNatural = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/compareNatural.js"),_compareText = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/compareText.js"),_equal = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/equal.js"),_equalText = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/equalText.js"),_smaller = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/smaller.js"),_smallerEq = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/smallerEq.js"),_larger = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/larger.js"),_largerEq = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/largerEq.js"),_deepEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/deepEqual.js"),_unequal = __webpack_require__("./node_modules/mathjs/lib/cjs/function/relational/unequal.js"),_partitionSelect = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/partitionSelect.js"),_sort = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/sort.js"),_max = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/max.js"),_min = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/min.js"),_ImmutableDenseMatrix = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/ImmutableDenseMatrix.js"),_MatrixIndex = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/MatrixIndex.js"),_FibonacciHeap = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/FibonacciHeap.js"),_Spa = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/Spa.js"),_Unit = __webpack_require__("./node_modules/mathjs/lib/cjs/type/unit/Unit.js"),_unit = __webpack_require__("./node_modules/mathjs/lib/cjs/type/unit/function/unit.js"),_sparse = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/function/sparse.js"),_createUnit = __webpack_require__("./node_modules/mathjs/lib/cjs/type/unit/function/createUnit.js"),_acos = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/acos.js"),_acosh = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/acosh.js"),_acot = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/acot.js"),_acoth = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/acoth.js"),_acsc = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/acsc.js"),_acsch = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/acsch.js"),_asec = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/asec.js"),_asech = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/asech.js"),_asin = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/asin.js"),_asinh = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/asinh.js"),_atan = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/atan.js"),_atan2 = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/atan2.js"),_atanh = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/atanh.js"),_cos = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/cos.js"),_cosh = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/cosh.js"),_cot = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/cot.js"),_coth = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/coth.js"),_csc = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/csc.js"),_csch = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/csch.js"),_sec = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/sec.js"),_sech = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/sech.js"),_sin = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/sin.js"),_sinh = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/sinh.js"),_tan = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/tan.js"),_tanh = __webpack_require__("./node_modules/mathjs/lib/cjs/function/trigonometry/tanh.js"),_setCartesian = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setCartesian.js"),_setDifference = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setDifference.js"),_setDistinct = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setDistinct.js"),_setIntersect = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setIntersect.js"),_setIsSubset = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setIsSubset.js"),_setMultiplicity = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setMultiplicity.js"),_setPowerset = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setPowerset.js"),_setSize = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setSize.js"),_setSymDifference = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setSymDifference.js"),_setUnion = __webpack_require__("./node_modules/mathjs/lib/cjs/function/set/setUnion.js"),_add = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/add.js"),_hypot = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/hypot.js"),_norm = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/norm.js"),_dot = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/dot.js"),_trace = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/trace.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/function/index.js"),_Node = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/Node.js"),_AccessorNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/AccessorNode.js"),_ArrayNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/ArrayNode.js"),_AssignmentNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/AssignmentNode.js"),_BlockNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/BlockNode.js"),_ConditionalNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/ConditionalNode.js"),_ConstantNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/ConstantNode.js"),_FunctionAssignmentNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/FunctionAssignmentNode.js"),_IndexNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/IndexNode.js"),_ObjectNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/ObjectNode.js"),_OperatorNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/OperatorNode.js"),_ParenthesisNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/ParenthesisNode.js"),_RangeNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/RangeNode.js"),_RelationalNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/RelationalNode.js"),_SymbolNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/SymbolNode.js"),_FunctionNode = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/node/FunctionNode.js"),_parse = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/parse.js"),_compile = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/function/compile.js"),_evaluate = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/function/evaluate.js"),_Parser = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/Parser.js"),_parser = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/function/parser.js"),_lup = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/decomposition/lup.js"),_qr = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/decomposition/qr.js"),_slu = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/decomposition/slu.js"),_lusolve = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/lusolve.js"),_Help = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/Help.js"),_Chain = __webpack_require__("./node_modules/mathjs/lib/cjs/type/chain/Chain.js"),_help = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/function/help.js"),_chain = __webpack_require__("./node_modules/mathjs/lib/cjs/type/chain/function/chain.js"),_det = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/det.js"),_inv = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/inv.js"),_eigs = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/eigs.js"),_expm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/expm.js"),_sqrtm = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/sqrtm.js"),_divide = __webpack_require__("./node_modules/mathjs/lib/cjs/function/arithmetic/divide.js"),_distance = __webpack_require__("./node_modules/mathjs/lib/cjs/function/geometry/distance.js"),_intersect = __webpack_require__("./node_modules/mathjs/lib/cjs/function/geometry/intersect.js"),_sum = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/sum.js"),_mean = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/mean.js"),_median = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/median.js"),_mad = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/mad.js"),_variance = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/variance.js"),_quantileSeq = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/quantileSeq.js"),_std = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/std.js"),_combinations = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/combinations.js"),_combinationsWithRep = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/combinationsWithRep.js"),_gamma = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/gamma.js"),_factorial = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/factorial.js"),_kldivergence = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/kldivergence.js"),_multinomial = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/multinomial.js"),_permutations = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/permutations.js"),_pickRandom = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/pickRandom.js"),_random = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/random.js"),_randomInt = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/randomInt.js"),_stirlingS = __webpack_require__("./node_modules/mathjs/lib/cjs/function/combinatorics/stirlingS2.js"),_bellNumbers = __webpack_require__("./node_modules/mathjs/lib/cjs/function/combinatorics/bellNumbers.js"),_catalan = __webpack_require__("./node_modules/mathjs/lib/cjs/function/combinatorics/catalan.js"),_composition = __webpack_require__("./node_modules/mathjs/lib/cjs/function/combinatorics/composition.js"),_simplify = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/simplify.js"),_derivative = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/derivative.js"),_rationalize = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/rationalize.js"),_reviver = __webpack_require__("./node_modules/mathjs/lib/cjs/json/reviver.js"),_replacer = __webpack_require__("./node_modules/mathjs/lib/cjs/json/replacer.js"),_constants = __webpack_require__("./node_modules/mathjs/lib/cjs/constants.js"),_physicalConstants = __webpack_require__("./node_modules/mathjs/lib/cjs/type/unit/physicalConstants.js"),_applyTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/apply.transform.js"),_columnTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/column.transform.js"),_filterTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/filter.transform.js"),_forEachTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/forEach.transform.js"),_indexTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/index.transform.js"),_mapTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/map.transform.js"),_maxTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/max.transform.js"),_meanTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/mean.transform.js"),_minTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/min.transform.js"),_rangeTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/range.transform.js"),_rowTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/row.transform.js"),_subsetTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/subset.transform.js"),_concatTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/concat.transform.js"),_diffTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/diff.transform.js"),_stdTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/std.transform.js"),_sumTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/sum.transform.js"),_varianceTransform = __webpack_require__("./node_modules/mathjs/lib/cjs/expression/transform/variance.transform.js");

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/decomposition/lup.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLup = void 0;var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "lup",dependencies = ["typed", "matrix", "abs", "addScalar", "divideScalar", "multiplyScalar", "subtract", "larger", "equalScalar", "unaryMinus", "DenseMatrix", "SparseMatrix", "Spa"],createLup = (0, _factory.factory)(name, dependencies, function (_ref) {function _denseLUP(m) {var i,j,k,rows = m._size[0],columns = m._size[1],n = Math.min(rows, columns),data = (0, _object.clone)(m._data),ldata = [],lsize = [rows, n],udata = [],usize = [n, columns],p = [];for (i = 0; i < rows; i++) p[i] = i;for (j = 0; j < columns; j++) {if (0 < j) for (i = 0; i < rows; i++) {var min = Math.min(i, j),s = 0;for (k = 0; k < min; k++) s = addScalar(s, multiplyScalar(data[i][k], data[k][j]));data[i][j] = subtract(data[i][j], s);}var pi = j,pabsv = 0,vjj = 0;for (i = j; i < rows; i++) {var v = data[i][j],absv = abs(v);larger(absv, pabsv) && (pi = i, pabsv = absv, vjj = v);}if (j !== pi && (p[j] = p[pi], DenseMatrix._swapRows(j, pi, data)), j < rows) for (i = j + 1; i < rows; i++) {var vij = data[i][j];equalScalar(vij, 0) || (data[i][j] = divideScalar(data[i][j], vjj));}}for (j = 0; j < columns; j++) for (i = 0; i < rows; i++) {if (0 === j && (i < columns && (udata[i] = []), ldata[i] = []), i < j) {i < columns && (udata[i][j] = data[i][j]), j < rows && (ldata[i][j] = 0);continue;}if (i === j) {i < columns && (udata[i][j] = data[i][j]), j < rows && (ldata[i][j] = 1);continue;}i < columns && (udata[i][j] = 0), j < rows && (ldata[i][j] = data[i][j]);}var l = new DenseMatrix({ data: ldata, size: lsize }),u = new DenseMatrix({ data: udata, size: usize }),pv = [];for (i = 0, n = p.length; i < n; i++) pv[p[i]] = i;return { L: l, U: u, p: pv, toString: function () {return "L: " + this.L.toString() + "\nU: " + this.U.toString() + "\nP: " + this.p;} };}function _sparseLUP(m) {var i,j,k,rows = m._size[0],columns = m._size[1],n = Math.min(rows, columns),values = m._values,index = m._index,ptr = m._ptr,lvalues = [],lindex = [],lptr = [],lsize = [rows, n],uvalues = [],uindex = [],uptr = [],usize = [n, columns],pvCo = [],pvOc = [];for (i = 0; i < rows; i++) pvCo[i] = i, pvOc[i] = i;var swapIndeces = function swapIndeces(x, y) {var kx = pvOc[x],ky = pvOc[y];pvCo[kx] = y, pvCo[ky] = x, pvOc[x] = ky, pvOc[y] = kx;},_loop = function _loop() {var spa = new Spa();j < rows && (lptr.push(lvalues.length), lvalues.push(1), lindex.push(j)), uptr.push(uvalues.length);var k0 = ptr[j],k1 = ptr[j + 1];for (k = k0; k < k1; k++) i = index[k], spa.set(pvCo[i], values[k]);0 < j && spa.forEach(0, j - 1, function (k, vkj) {SparseMatrix._forEachRow(k, lvalues, lindex, lptr, function (i, vik) {i > k && spa.accumulate(i, unaryMinus(multiplyScalar(vik, vkj)));});});var pi = j,vjj = spa.get(j),pabsv = abs(vjj);spa.forEach(j + 1, rows - 1, function (x, v) {var absv = abs(v);larger(absv, pabsv) && (pi = x, pabsv = absv, vjj = v);}), j !== pi && (SparseMatrix._swapRows(j, pi, lsize[1], lvalues, lindex, lptr), SparseMatrix._swapRows(j, pi, usize[1], uvalues, uindex, uptr), spa.swap(j, pi), swapIndeces(j, pi)), spa.forEach(0, rows - 1, function (x, v) {x <= j ? (uvalues.push(v), uindex.push(x)) : (v = divideScalar(v, vjj), !equalScalar(v, 0) && (lvalues.push(v), lindex.push(x)));});};for (j = 0; j < columns; j++) _loop();return uptr.push(uvalues.length), lptr.push(lvalues.length), { L: new SparseMatrix({ values: lvalues, index: lindex, ptr: lptr, size: lsize }), U: new SparseMatrix({ values: uvalues, index: uindex, ptr: uptr, size: usize }), p: pvCo, toString: function toString() {return "L: " + this.L.toString() + "\nU: " + this.U.toString() + "\nP: " + this.p;} };}var typed = _ref.typed,matrix = _ref.matrix,abs = _ref.abs,addScalar = _ref.addScalar,divideScalar = _ref.divideScalar,multiplyScalar = _ref.multiplyScalar,subtract = _ref.subtract,larger = _ref.larger,equalScalar = _ref.equalScalar,unaryMinus = _ref.unaryMinus,DenseMatrix = _ref.DenseMatrix,SparseMatrix = _ref.SparseMatrix,Spa = _ref.Spa;return typed(name, { DenseMatrix: function DenseMatrix(m) {return _denseLUP(m);}, SparseMatrix: function SparseMatrix(m) {return _sparseLUP(m);}, Array: function Array(a) {var m = matrix(a),r = _denseLUP(m);return { L: r.L.valueOf(), U: r.U.valueOf(), p: r.p };} });});exports.createLup = createLup;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/decomposition/qr.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createQr = void 0;var _extends2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/extends.js")),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "qr",dependencies = ["typed", "matrix", "zeros", "identity", "isZero", "equal", "sign", "sqrt", "conj", "unaryMinus", "addScalar", "divideScalar", "multiplyScalar", "subtract", "complex"],createQr = (0, _factory.factory)(name, dependencies, function (_ref) {function _denseQRimpl(m) {var i,j,k,rows = m._size[0],cols = m._size[1],Q = identity([rows], "dense"),Qdata = Q._data,R = m.clone(),Rdata = R._data,w = zeros([rows], "");for (k = 0; k < Math.min(cols, rows); ++k) {var pivot = Rdata[k][k],sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot)),conjSgn = conj(sgn),alphaSquared = 0;for (i = k; i < rows; i++) alphaSquared = addScalar(alphaSquared, multiplyScalar(Rdata[i][k], conj(Rdata[i][k])));var alpha = multiplyScalar(sgn, sqrt(alphaSquared));if (!isZero(alpha)) {var u1 = subtract(pivot, alpha);for (w[k] = 1, i = k + 1; i < rows; i++) w[i] = divideScalar(Rdata[i][k], u1);var tau = unaryMinus(conj(divideScalar(u1, alpha))),s = void 0;for (j = k; j < cols; j++) {for (s = 0, i = k; i < rows; i++) s = addScalar(s, multiplyScalar(conj(w[i]), Rdata[i][j]));for (s = multiplyScalar(s, tau), i = k; i < rows; i++) Rdata[i][j] = multiplyScalar(subtract(Rdata[i][j], multiplyScalar(w[i], s)), conjSgn);}for (i = 0; i < rows; i++) {for (s = 0, j = k; j < rows; j++) s = addScalar(s, multiplyScalar(Qdata[i][j], w[j]));for (s = multiplyScalar(s, tau), j = k; j < rows; ++j) Qdata[i][j] = divideScalar(subtract(Qdata[i][j], multiplyScalar(s, conj(w[j]))), conjSgn);}}}return { Q: Q, R: R, toString: function () {return "Q: " + this.Q.toString() + "\nR: " + this.R.toString();} };}function _denseQR(m) {var ret = _denseQRimpl(m),Rdata = ret.R._data;if (0 < m._data.length) for (var zero = "Complex" === Rdata[0][0].type ? complex(0) : 0, i = 0; i < Rdata.length; ++i) for (var j = 0; j < i && j < (Rdata[0] || []).length; ++j) Rdata[i][j] = zero;return ret;}function _sparseQR() {throw new Error("qr not implemented for sparse matrices yet");}var typed = _ref.typed,matrix = _ref.matrix,zeros = _ref.zeros,identity = _ref.identity,isZero = _ref.isZero,equal = _ref.equal,sign = _ref.sign,sqrt = _ref.sqrt,conj = _ref.conj,unaryMinus = _ref.unaryMinus,addScalar = _ref.addScalar,divideScalar = _ref.divideScalar,multiplyScalar = _ref.multiplyScalar,subtract = _ref.subtract,complex = _ref.complex;return (0, _extends2["default"])(typed(name, { DenseMatrix: function (m) {return _denseQR(m);}, SparseMatrix: function (m) {return _sparseQR(m);}, Array: function (a) {var m = matrix(a),r = _denseQR(m);return { Q: r.Q.valueOf(), R: r.R.valueOf() };} }), { _denseQRimpl: _denseQRimpl });});exports.createQr = createQr;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/decomposition/slu.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSlu = void 0;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_csSqr = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csSqr.js"),_csLu = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csLu.js"),name = "slu",dependencies = ["typed", "abs", "add", "multiply", "transpose", "divideScalar", "subtract", "larger", "largerEq", "SparseMatrix"],createSlu = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,abs = _ref.abs,add = _ref.add,multiply = _ref.multiply,transpose = _ref.transpose,divideScalar = _ref.divideScalar,subtract = _ref.subtract,larger = _ref.larger,largerEq = _ref.largerEq,SparseMatrix = _ref.SparseMatrix,csSqr = (0, _csSqr.createCsSqr)({ add: add, multiply: multiply, transpose: transpose }),csLu = (0, _csLu.createCsLu)({ abs: abs, divideScalar: divideScalar, multiply: multiply, subtract: subtract, larger: larger, largerEq: largerEq, SparseMatrix: SparseMatrix });return typed(name, { "SparseMatrix, number, number": function (a, order, threshold) {if (!(0, _number.isInteger)(order) || 0 > order || 3 < order) throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if (0 > threshold || 1 < threshold) throw new Error("Partial pivoting threshold must be a number from 0 to 1");var s = csSqr(order, a, !1),f = csLu(a, s, threshold);return { L: f.L, U: f.U, p: f.pinv, q: s.q, toString: function () {return "L: " + this.L.toString() + "\nU: " + this.U.toString() + "\np: " + this.p.toString() + (this.q ? "\nq: " + this.q.toString() : "") + "\n";} };} });});exports.createSlu = createSlu;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/derivative.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDerivative = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "derivative",dependencies = ["typed", "config", "parse", "simplify", "equal", "isZero", "numeric", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "SymbolNode"],createDerivative = (0, _factory.factory)(name, dependencies, function (_ref) {function funcArgsCheck(node) {if ("log" !== node.name && "nthRoot" !== node.name && "pow" !== node.name || 2 !== node.args.length) {for (var i = 0; i < node.args.length; ++i) node.args[i] = createConstantNode(0);throw node.compile().evaluate(), new Error("Expected TypeError, but none found");}}function createConstantNode(value, valueType) {return new ConstantNode(numeric(value, valueType || config.number));}var typed = _ref.typed,config = _ref.config,parse = _ref.parse,simplify = _ref.simplify,equal = _ref.equal,isZero = _ref.isZero,numeric = _ref.numeric,ConstantNode = _ref.ConstantNode,FunctionNode = _ref.FunctionNode,OperatorNode = _ref.OperatorNode,ParenthesisNode = _ref.ParenthesisNode,SymbolNode = _ref.SymbolNode,derivative = typed("derivative", { "Node, SymbolNode, Object": function (expr, variable, options) {var constNodes = {};constTag(constNodes, expr, variable.name);var res = _derivative(expr, constNodes);return options.simplify ? simplify(res) : res;}, "Node, SymbolNode": function (expr, variable) {return this(expr, variable, { simplify: !0 });}, "string, SymbolNode": function (expr, variable) {return this(parse(expr), variable);}, "string, SymbolNode, Object": function (expr, variable, options) {return this(parse(expr), variable, options);}, "string, string": function (expr, variable) {return this(parse(expr), parse(variable));}, "string, string, Object": function (expr, variable, options) {return this(parse(expr), parse(variable), options);}, "Node, string": function (expr, variable) {return this(expr, parse(variable));}, "Node, string, Object": function (expr, variable, options) {return this(expr, parse(variable), options);} });derivative._simplify = !0, derivative.toTex = function (deriv) {return _derivTex.apply(null, deriv.args);};var _derivTex = typed("_derivTex", { "Node, SymbolNode": function (expr, x) {return (0, _is.isConstantNode)(expr) && "string" === (0, _is.typeOf)(expr.value) ? _derivTex(parse(expr.value).toString(), x.toString(), 1) : _derivTex(expr.toString(), x.toString(), 1);}, "Node, ConstantNode": function (expr, x) {if ("string" === (0, _is.typeOf)(x.value)) return _derivTex(expr, parse(x.value));throw new Error("The second parameter to 'derivative' is a non-string constant");}, "Node, SymbolNode, ConstantNode": function (expr, x, order) {return _derivTex(expr.toString(), x.name, order.value);}, "string, string, number": function (expr, x, order) {var d;return d = 1 === order ? "{d\\over d" + x + "}" : "{d^{" + order + "}\\over d" + x + "^{" + order + "}}", d + "\\left[".concat(expr, "\\right]");} }),constTag = typed("constTag", { "Object, ConstantNode, string": function (constNodes, node) {return constNodes[node] = !0, !0;}, "Object, SymbolNode, string": function (constNodes, node, varName) {return node.name !== varName && (constNodes[node] = !0, !0);}, "Object, ParenthesisNode, string": function (constNodes, node, varName) {return constTag(constNodes, node.content, varName);}, "Object, FunctionAssignmentNode, string": function (constNodes, node, varName) {return -1 === node.params.indexOf(varName) ? (constNodes[node] = !0, !0) : constTag(constNodes, node.expr, varName);}, "Object, FunctionNode | OperatorNode, string": function (constNodes, node, varName) {if (0 < node.args.length) {for (var isConst = constTag(constNodes, node.args[0], varName), i = 1; i < node.args.length; ++i) isConst = constTag(constNodes, node.args[i], varName) && isConst;if (isConst) return constNodes[node] = !0, !0;}return !1;} }),_derivative = typed("_derivative", { "ConstantNode, Object": function () {return createConstantNode(0);}, "SymbolNode, Object": function (node, constNodes) {return void 0 === constNodes[node] ? createConstantNode(1) : createConstantNode(0);}, "ParenthesisNode, Object": function (node, constNodes) {return new ParenthesisNode(_derivative(node.content, constNodes));}, "FunctionAssignmentNode, Object": function (node, constNodes) {return void 0 === constNodes[node] ? _derivative(node.expr, constNodes) : createConstantNode(0);}, "FunctionNode, Object": function (node, constNodes) {if (1 !== node.args.length && funcArgsCheck(node), void 0 !== constNodes[node]) return createConstantNode(0);var arg1,funcDerivative,arg0 = node.args[0],div = !1,negative = !1;switch (node.name) {case "cbrt":div = !0, funcDerivative = new OperatorNode("*", "multiply", [createConstantNode(3), new OperatorNode("^", "pow", [arg0, new OperatorNode("/", "divide", [createConstantNode(2), createConstantNode(3)])])]);break;case "sqrt":case "nthRoot":if (1 === node.args.length) div = !0, funcDerivative = new OperatorNode("*", "multiply", [createConstantNode(2), new FunctionNode("sqrt", [arg0])]);else if (2 === node.args.length) return arg1 = new OperatorNode("/", "divide", [createConstantNode(1), node.args[1]]), constNodes[arg1] = constNodes[node.args[1]], _derivative(new OperatorNode("^", "pow", [arg0, arg1]), constNodes);break;case "log10":arg1 = createConstantNode(10);case "log":if (!arg1 && 1 === node.args.length) funcDerivative = arg0.clone(), div = !0;else if (1 === node.args.length && arg1 || 2 === node.args.length && void 0 !== constNodes[node.args[1]]) funcDerivative = new OperatorNode("*", "multiply", [arg0.clone(), new FunctionNode("log", [arg1 || node.args[1]])]), div = !0;else if (2 === node.args.length) return _derivative(new OperatorNode("/", "divide", [new FunctionNode("log", [arg0]), new FunctionNode("log", [node.args[1]])]), constNodes);break;case "pow":return constNodes[arg1] = constNodes[node.args[1]], _derivative(new OperatorNode("^", "pow", [arg0, node.args[1]]), constNodes);case "exp":funcDerivative = new FunctionNode("exp", [arg0.clone()]);break;case "sin":funcDerivative = new FunctionNode("cos", [arg0.clone()]);break;case "cos":funcDerivative = new OperatorNode("-", "unaryMinus", [new FunctionNode("sin", [arg0.clone()])]);break;case "tan":funcDerivative = new OperatorNode("^", "pow", [new FunctionNode("sec", [arg0.clone()]), createConstantNode(2)]);break;case "sec":funcDerivative = new OperatorNode("*", "multiply", [node, new FunctionNode("tan", [arg0.clone()])]);break;case "csc":negative = !0, funcDerivative = new OperatorNode("*", "multiply", [node, new FunctionNode("cot", [arg0.clone()])]);break;case "cot":negative = !0, funcDerivative = new OperatorNode("^", "pow", [new FunctionNode("csc", [arg0.clone()]), createConstantNode(2)]);break;case "asin":div = !0, funcDerivative = new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])])]);break;case "acos":div = !0, negative = !0, funcDerivative = new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])])]);break;case "atan":div = !0, funcDerivative = new OperatorNode("+", "add", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);break;case "asec":div = !0, funcDerivative = new OperatorNode("*", "multiply", [new FunctionNode("abs", [arg0.clone()]), new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);break;case "acsc":div = !0, negative = !0, funcDerivative = new OperatorNode("*", "multiply", [new FunctionNode("abs", [arg0.clone()]), new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);break;case "acot":div = !0, negative = !0, funcDerivative = new OperatorNode("+", "add", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);break;case "sinh":funcDerivative = new FunctionNode("cosh", [arg0.clone()]);break;case "cosh":funcDerivative = new FunctionNode("sinh", [arg0.clone()]);break;case "tanh":funcDerivative = new OperatorNode("^", "pow", [new FunctionNode("sech", [arg0.clone()]), createConstantNode(2)]);break;case "sech":negative = !0, funcDerivative = new OperatorNode("*", "multiply", [node, new FunctionNode("tanh", [arg0.clone()])]);break;case "csch":negative = !0, funcDerivative = new OperatorNode("*", "multiply", [node, new FunctionNode("coth", [arg0.clone()])]);break;case "coth":negative = !0, funcDerivative = new OperatorNode("^", "pow", [new FunctionNode("csch", [arg0.clone()]), createConstantNode(2)]);break;case "asinh":div = !0, funcDerivative = new FunctionNode("sqrt", [new OperatorNode("+", "add", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);break;case "acosh":div = !0, funcDerivative = new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);break;case "atanh":div = !0, funcDerivative = new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])]);break;case "asech":div = !0, negative = !0, funcDerivative = new OperatorNode("*", "multiply", [arg0.clone(), new FunctionNode("sqrt", [new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])])])]);break;case "acsch":div = !0, negative = !0, funcDerivative = new OperatorNode("*", "multiply", [new FunctionNode("abs", [arg0.clone()]), new FunctionNode("sqrt", [new OperatorNode("+", "add", [new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);break;case "acoth":div = !0, negative = !0, funcDerivative = new OperatorNode("-", "subtract", [createConstantNode(1), new OperatorNode("^", "pow", [arg0.clone(), createConstantNode(2)])]);break;case "abs":funcDerivative = new OperatorNode("/", "divide", [new FunctionNode(new SymbolNode("abs"), [arg0.clone()]), arg0.clone()]);break;case "gamma":default:throw new Error("Function \"" + node.name + "\" is not supported by derivative, or a wrong number of arguments is passed");}var op, func;div ? (op = "/", func = "divide") : (op = "*", func = "multiply");var chainDerivative = _derivative(arg0, constNodes);return negative && (chainDerivative = new OperatorNode("-", "unaryMinus", [chainDerivative])), new OperatorNode(op, func, [chainDerivative, funcDerivative]);}, "OperatorNode, Object": function (node, constNodes) {if (void 0 !== constNodes[node]) return createConstantNode(0);if ("+" === node.op) return new OperatorNode(node.op, node.fn, node.args.map(function (arg) {return _derivative(arg, constNodes);}));if ("-" === node.op) {if (node.isUnary()) return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes)]);if (node.isBinary()) return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes), _derivative(node.args[1], constNodes)]);}if ("*" === node.op) {var constantTerms = node.args.filter(function (arg) {return void 0 !== constNodes[arg];});if (0 < constantTerms.length) {var nonConstantTerms = node.args.filter(function (arg) {return void 0 === constNodes[arg];}),nonConstantNode = 1 === nonConstantTerms.length ? nonConstantTerms[0] : new OperatorNode("*", "multiply", nonConstantTerms),newArgs = constantTerms.concat(_derivative(nonConstantNode, constNodes));return new OperatorNode("*", "multiply", newArgs);}return new OperatorNode("+", "add", node.args.map(function (argOuter) {return new OperatorNode("*", "multiply", node.args.map(function (argInner) {return argInner === argOuter ? _derivative(argInner, constNodes) : argInner.clone();}));}));}if ("/" === node.op && node.isBinary()) {var arg0 = node.args[0],arg1 = node.args[1];return void 0 === constNodes[arg1] ? void 0 === constNodes[arg0] ? new OperatorNode("/", "divide", [new OperatorNode("-", "subtract", [new OperatorNode("*", "multiply", [_derivative(arg0, constNodes), arg1.clone()]), new OperatorNode("*", "multiply", [arg0.clone(), _derivative(arg1, constNodes)])]), new OperatorNode("^", "pow", [arg1.clone(), createConstantNode(2)])]) : new OperatorNode("*", "multiply", [new OperatorNode("-", "unaryMinus", [arg0]), new OperatorNode("/", "divide", [_derivative(arg1, constNodes), new OperatorNode("^", "pow", [arg1.clone(), createConstantNode(2)])])]) : new OperatorNode("/", "divide", [_derivative(arg0, constNodes), arg1]);}if ("^" === node.op && node.isBinary()) {var _arg = node.args[0],_arg2 = node.args[1];if (void 0 !== constNodes[_arg]) return (0, _is.isConstantNode)(_arg) && (isZero(_arg.value) || equal(_arg.value, 1)) ? createConstantNode(0) : new OperatorNode("*", "multiply", [node, new OperatorNode("*", "multiply", [new FunctionNode("log", [_arg.clone()]), _derivative(_arg2.clone(), constNodes)])]);if (void 0 !== constNodes[_arg2]) {if ((0, _is.isConstantNode)(_arg2)) {if (isZero(_arg2.value)) return createConstantNode(0);if (equal(_arg2.value, 1)) return _derivative(_arg, constNodes);}var powMinusOne = new OperatorNode("^", "pow", [_arg.clone(), new OperatorNode("-", "subtract", [_arg2, createConstantNode(1)])]);return new OperatorNode("*", "multiply", [_arg2.clone(), new OperatorNode("*", "multiply", [_derivative(_arg, constNodes), powMinusOne])]);}return new OperatorNode("*", "multiply", [new OperatorNode("^", "pow", [_arg.clone(), _arg2.clone()]), new OperatorNode("+", "add", [new OperatorNode("*", "multiply", [_derivative(_arg, constNodes), new OperatorNode("/", "divide", [_arg2.clone(), _arg.clone()])]), new OperatorNode("*", "multiply", [_derivative(_arg2, constNodes), new FunctionNode("log", [_arg.clone()])])])]);}throw new Error("Operator \"" + node.op + "\" is not supported by derivative, or a wrong number of arguments is passed");} });return derivative;});exports.createDerivative = createDerivative;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/rationalize.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRationalize = void 0;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_simplifyConstant = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/simplify/simplifyConstant.js"),_simplifyCore = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/simplify/simplifyCore.js"),name = "rationalize",dependencies = ["config", "typed", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "parse", "simplify", "?bignumber", "?fraction", "mathWithTransform", "ConstantNode", "OperatorNode", "FunctionNode", "SymbolNode", "ParenthesisNode"],createRationalize = (0, _factory.factory)(name, dependencies, function (_ref) {function polynomial(expr, scope, extended, rules) {function recPoly(node) {var tp = node.type;if ("FunctionNode" === tp) throw new Error("There is an unsolved function call");else if ("OperatorNode" === tp) {if ("^" !== node.op) {if (-1 === oper.indexOf(node.op)) throw new Error("Operator " + node.op + " invalid in polynomial expression");for (var i = 0; i < node.args.length; i++) recPoly(node.args[i]);} else if ("ConstantNode" !== node.args[1].type || !(0, _number.isInteger)(parseFloat(node.args[1].value))) throw new Error("There is a non-integer exponent");else recPoly(node.args[0]);} else if ("SymbolNode" === tp) {var _name = node.name,pos = variables.indexOf(_name);-1 === pos && variables.push(_name);} else if ("ParenthesisNode" === tp) recPoly(node.content);else if ("ConstantNode" !== tp) throw new Error("type " + tp + " is not allowed in polynomial expression");}var variables = [],node = simplify(expr, rules, scope, { exactFractions: !1 });extended = !!extended;var oper = "+-*" + (extended ? "/" : "");recPoly(node);return { expression: node, variables: variables };}function rulesRationalize() {var oldRules = [simplifyCore, { l: "n+n", r: "2*n" }, { l: "n+-n", r: "0" }, simplifyConstant, { l: "n*(n1^-1)", r: "n/n1" }, { l: "n*n1^-n2", r: "n/n1^n2" }, { l: "n1^-1", r: "1/n1" }, { l: "n*(n1/n2)", r: "(n*n1)/n2" }, { l: "1*n", r: "n" }],rulesFirst = [{ l: "(-n1)/(-n2)", r: "n1/n2" }, { l: "(-n1)*(-n2)", r: "n1*n2" }, { l: "n1--n2", r: "n1+n2" }, { l: "n1-n2", r: "n1+(-n2)" }, { l: "(n1+n2)*n3", r: "(n1*n3 + n2*n3)" }, { l: "n1*(n2+n3)", r: "(n1*n2+n1*n3)" }, { l: "c1*n + c2*n", r: "(c1+c2)*n" }, { l: "c1*n + n", r: "(c1+1)*n" }, { l: "c1*n - c2*n", r: "(c1-c2)*n" }, { l: "c1*n - n", r: "(c1-1)*n" }, { l: "v/c", r: "(1/c)*v" }, { l: "v/-c", r: "-(1/c)*v" }, { l: "-v*-c", r: "c*v" }, { l: "-v*c", r: "-c*v" }, { l: "v*-c", r: "-c*v" }, { l: "v*c", r: "c*v" }, { l: "-(-n1*n2)", r: "(n1*n2)" }, { l: "-(n1*n2)", r: "(-n1*n2)" }, { l: "-(-n1+n2)", r: "(n1-n2)" }, { l: "-(n1+n2)", r: "(-n1-n2)" }, { l: "(n1^n2)^n3", r: "(n1^(n2*n3))" }, { l: "-(-n1/n2)", r: "(n1/n2)" }, { l: "-(n1/n2)", r: "(-n1/n2)" }],rulesSucDiv = [{ l: "(n1/(n2/n3))", r: "((n1*n3)/n2)" }, { l: "(n1/n2/n3)", r: "(n1/(n2*n3))" }],setRules = {};return setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv), setRules.distrDivRules = [{ l: "(n1/n2 + n3/n4)", r: "((n1*n4 + n3*n2)/(n2*n4))" }, { l: "(n1/n2 + n3)", r: "((n1 + n3*n2)/n2)" }, { l: "(n1 + n2/n3)", r: "((n1*n3 + n2)/n3)" }], setRules.sucDivRules = rulesSucDiv, setRules.firstRulesAgain = oldRules.concat(rulesFirst), setRules.finalRules = [simplifyCore, { l: "n*-n", r: "-n^2" }, { l: "n*n", r: "n^2" }, simplifyConstant, { l: "n*-n^n1", r: "-n^(n1+1)" }, { l: "n*n^n1", r: "n^(n1+1)" }, { l: "n^n1*-n^n2", r: "-n^(n1+n2)" }, { l: "n^n1*n^n2", r: "n^(n1+n2)" }, { l: "n^n1*-n", r: "-n^(n1+1)" }, { l: "n^n1*n", r: "n^(n1+1)" }, { l: "n^n1/-n", r: "-n^(n1-1)" }, { l: "n^n1/n", r: "n^(n1-1)" }, { l: "n/-n^n1", r: "-n^(1-n1)" }, { l: "n/n^n1", r: "n^(1-n1)" }, { l: "n^n1/-n^n2", r: "n^(n1-n2)" }, { l: "n^n1/n^n2", r: "n^(n1-n2)" }, { l: "n1+(-n2*n3)", r: "n1-n2*n3" }, { l: "v*(-c)", r: "-c*v" }, { l: "n1+-n2", r: "n1-n2" }, { l: "v*c", r: "c*v" }, { l: "(n1^n2)^n3", r: "(n1^(n2*n3))" }], setRules;}function expandPower(node, parent, indParent) {var tp = node.type,internal = 1 < arguments.length;if ("OperatorNode" === tp && node.isBinary()) {var val,does = !1;if ("^" === node.op && ("ParenthesisNode" === node.args[0].type || "OperatorNode" === node.args[0].type) && "ConstantNode" === node.args[1].type && (val = parseFloat(node.args[1].value), does = 2 <= val && (0, _number.isInteger)(val)), does) {if (2 < val) {var nEsqTopo = node.args[0],nDirTopo = new OperatorNode("^", "pow", [node.args[0].cloneDeep(), new ConstantNode(val - 1)]);node = new OperatorNode("*", "multiply", [nEsqTopo, nDirTopo]);} else node = new OperatorNode("*", "multiply", [node.args[0], node.args[0].cloneDeep()]);internal && ("content" === indParent ? parent.content = node : parent.args[indParent] = node);}}if ("ParenthesisNode" === tp) expandPower(node.content, node, "content");else if ("ConstantNode" !== tp && "SymbolNode" !== tp) for (var i = 0; i < node.args.length; i++) expandPower(node.args[i], node, i);return internal ? void 0 : node;}function polyToCanonical(node, coefficients) {function recurPol(node, noPai, o) {var tp = node.type;if ("FunctionNode" === tp) throw new Error("There is an unsolved function call");else if ("OperatorNode" === tp) {if (-1 === "+-*^".indexOf(node.op)) throw new Error("Operator " + node.op + " invalid");if (null !== noPai) {if (("unaryMinus" === node.fn || "pow" === node.fn) && "add" !== noPai.fn && "subtract" !== noPai.fn && "multiply" !== noPai.fn) throw new Error("Invalid " + node.op + " placing");if (("subtract" === node.fn || "add" === node.fn || "multiply" === node.fn) && "add" !== noPai.fn && "subtract" !== noPai.fn) throw new Error("Invalid " + node.op + " placing");if (("subtract" === node.fn || "add" === node.fn || "unaryMinus" === node.fn) && 0 !== o.noFil) throw new Error("Invalid " + node.op + " placing");}("^" === node.op || "*" === node.op) && (o.fire = node.op);for (var _i = 0; _i < node.args.length; _i++) "unaryMinus" === node.fn && (o.oper = "-"), ("+" === node.op || "subtract" === node.fn) && (o.fire = "", o.cte = 1, o.oper = 0 === _i ? "+" : node.op), o.noFil = _i, recurPol(node.args[_i], node, o);} else if ("SymbolNode" === tp) {if (node.name !== varname && "" !== varname) throw new Error("There is more than one variable");if (varname = node.name, null === noPai) return void (coefficients[1] = 1);if ("^" === noPai.op && 0 !== o.noFil) throw new Error("In power the variable should be the first parameter");if ("*" === noPai.op && 1 !== o.noFil) throw new Error("In multiply the variable should be the second parameter");("" === o.fire || "*" === o.fire) && (1 > maxExpo && (coefficients[1] = 0), coefficients[1] += o.cte * ("+" === o.oper ? 1 : -1), maxExpo = Math.max(1, maxExpo));} else if ("ConstantNode" === tp) {var valor = parseFloat(node.value);if (null === noPai) return void (coefficients[0] = valor);if ("^" === noPai.op) {if (1 !== o.noFil) throw new Error("Constant cannot be powered");if (!(0, _number.isInteger)(valor) || 0 >= valor) throw new Error("Non-integer exponent is not allowed");for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) coefficients[_i2] = 0;return valor > maxExpo && (coefficients[valor] = 0), coefficients[valor] += o.cte * ("+" === o.oper ? 1 : -1), void (maxExpo = Math.max(valor, maxExpo));}o.cte = valor, "" === o.fire && (coefficients[0] += o.cte * ("+" === o.oper ? 1 : -1));} else throw new Error("Type " + tp + " is not allowed");}coefficients === void 0 && (coefficients = []), coefficients[0] = 0;var maxExpo = 0,varname = "";recurPol(node, null, { cte: 1, oper: "+", fire: "" }), maxExpo = coefficients.length - 1;for (var no, first = !0, i = maxExpo; 0 <= i; i--) if (0 !== coefficients[i]) {var n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i])),op = 0 > coefficients[i] ? "-" : "+";if (0 < i) {var n2 = new SymbolNode(varname);if (1 < i) {var n3 = new ConstantNode(i);n2 = new OperatorNode("^", "pow", [n2, n3]);}n1 = -1 === coefficients[i] && first ? new OperatorNode("-", "unaryMinus", [n2]) : 1 === Math.abs(coefficients[i]) ? n2 : new OperatorNode("*", "multiply", [n1, n2]);}no = first ? n1 : "+" === op ? new OperatorNode("+", "add", [no, n1]) : new OperatorNode("-", "subtract", [no, n1]), first = !1;}return first ? new ConstantNode(0) : no;}var config = _ref.config,typed = _ref.typed,equal = _ref.equal,isZero = _ref.isZero,add = _ref.add,subtract = _ref.subtract,multiply = _ref.multiply,divide = _ref.divide,pow = _ref.pow,parse = _ref.parse,simplify = _ref.simplify,fraction = _ref.fraction,bignumber = _ref.bignumber,mathWithTransform = _ref.mathWithTransform,ConstantNode = _ref.ConstantNode,OperatorNode = _ref.OperatorNode,FunctionNode = _ref.FunctionNode,SymbolNode = _ref.SymbolNode,ParenthesisNode = _ref.ParenthesisNode,simplifyConstant = (0, _simplifyConstant.createSimplifyConstant)({ typed: typed, config: config, mathWithTransform: mathWithTransform, fraction: fraction, bignumber: bignumber, ConstantNode: ConstantNode, OperatorNode: OperatorNode, FunctionNode: FunctionNode, SymbolNode: SymbolNode }),simplifyCore = (0, _simplifyCore.createSimplifyCore)({ equal: equal, isZero: isZero, add: add, subtract: subtract, multiply: multiply, divide: divide, pow: pow, ConstantNode: ConstantNode, OperatorNode: OperatorNode, FunctionNode: FunctionNode, ParenthesisNode: ParenthesisNode });return typed(name, { string: function (expr) {return this(parse(expr), {}, !1);}, "string, boolean": function (expr, detailed) {return this(parse(expr), {}, detailed);}, "string, Object": function (expr, scope) {return this(parse(expr), scope, !1);}, "string, Object, boolean": function (expr, scope, detailed) {return this(parse(expr), scope, detailed);}, Node: function (expr) {return this(expr, {}, !1);}, "Node, boolean": function (expr, detailed) {return this(expr, {}, detailed);}, "Node, Object": function (expr, scope) {return this(expr, scope, !1);}, "Node, Object, boolean": function (expr, scope, detailed) {var setRules = rulesRationalize(),polyRet = polynomial(expr, scope, !0, setRules.firstRules),nVars = polyRet.variables.length;if (expr = polyRet.expression, 1 <= nVars) {expr = expandPower(expr);var sBefore,rules,eDistrDiv = !0,redoInic = !1;expr = simplify(expr, setRules.firstRules, {}, { exactFractions: !1 });for (var s; rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules, expr = simplify(expr, rules), eDistrDiv = !eDistrDiv, s = expr.toString(), s !== sBefore;) redoInic = !0, sBefore = s;redoInic && (expr = simplify(expr, setRules.firstRulesAgain, {}, { exactFractions: !1 })), expr = simplify(expr, setRules.finalRules, {}, { exactFractions: !1 });}var coefficients = [],retRationalize = {};return ("OperatorNode" === expr.type && expr.isBinary() && "/" === expr.op ? (1 === nVars && (expr.args[0] = polyToCanonical(expr.args[0], coefficients), expr.args[1] = polyToCanonical(expr.args[1])), detailed && (retRationalize.numerator = expr.args[0], retRationalize.denominator = expr.args[1])) : (1 === nVars && (expr = polyToCanonical(expr, coefficients)), detailed && (retRationalize.numerator = expr, retRationalize.denominator = null)), !detailed) ? expr : (retRationalize.coefficients = coefficients, retRationalize.variables = polyRet.variables, retRationalize.expression = expr, retRationalize);} });});exports.createRationalize = createRationalize;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/simplify.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSimplify = void 0;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_util = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/simplify/util.js"),_simplifyCore = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/simplify/simplifyCore.js"),_simplifyConstant = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/simplify/simplifyConstant.js"),_resolve = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/simplify/resolve.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_map = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/map.js"),name = "simplify",dependencies = ["config", "typed", "parse", "add", "subtract", "multiply", "divide", "pow", "isZero", "equal", "?fraction", "?bignumber", "mathWithTransform", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "SymbolNode"],createSimplify = (0, _factory.factory)(name, dependencies, function (_ref) {function removeParens(node) {return node.transform(function (node, path, parent) {return (0, _is.isParenthesisNode)(node) ? removeParens(node.content) : node;});}function _buildRules(rules) {for (var ruleSet = [], i = 0; i < rules.length; i++) {var rule = rules[i],newRule = void 0,ruleType = (0, _typeof2["default"])(rule);switch (ruleType) {case "string":{var lr = rule.split("->");if (2 === lr.length) rule = { l: lr[0], r: lr[1] };else throw SyntaxError("Could not parse rule: " + rule);}case "object":if (newRule = { l: removeParens(parse(rule.l)), r: removeParens(parse(rule.r)) }, rule.context && (newRule.evaluate = rule.context), rule.evaluate && (newRule.evaluate = parse(rule.evaluate)), isAssociative(newRule.l)) {var makeNode = createMakeNodeFunction(newRule.l),expandsym = _getExpandPlaceholderSymbol();newRule.expanded = {}, newRule.expanded.l = makeNode([newRule.l.clone(), expandsym]), flatten(newRule.expanded.l), unflattenr(newRule.expanded.l), newRule.expanded.r = makeNode([newRule.r, expandsym]);}break;case "function":newRule = rule;break;default:throw TypeError("Unsupported type of rule: " + ruleType);}ruleSet.push(newRule);}return ruleSet;}function _getExpandPlaceholderSymbol() {return new SymbolNode("_p" + _lastsym++);}function getSplits(node, context) {var right,rightArgs,res = [],makeNode = createMakeNodeFunction(node);if (isCommutative(node, context)) for (var i = 0; i < node.args.length; i++) rightArgs = node.args.slice(0), rightArgs.splice(i, 1), right = 1 === rightArgs.length ? rightArgs[0] : makeNode(rightArgs), res.push(makeNode([node.args[i], right]));else rightArgs = node.args.slice(1), right = 1 === rightArgs.length ? rightArgs[0] : makeNode(rightArgs), res.push(makeNode([node.args[0], right]));return res;}function mergeMatch(match1, match2) {var res = { placeholders: {} };if (!match1.placeholders && !match2.placeholders) return res;if (!match1.placeholders) return match2;if (!match2.placeholders) return match1;for (var key in match1.placeholders) if ((0, _object.hasOwnProperty)(match1.placeholders, key) && (res.placeholders[key] = match1.placeholders[key], (0, _object.hasOwnProperty)(match2.placeholders, key) && !_exactMatch(match1.placeholders[key], match2.placeholders[key]))) return null;for (var _key in match2.placeholders) (0, _object.hasOwnProperty)(match2.placeholders, _key) && (res.placeholders[_key] = match2.placeholders[_key]);return res;}function combineChildMatches(list1, list2) {var res = [];if (0 === list1.length || 0 === list2.length) return res;for (var merged, i1 = 0; i1 < list1.length; i1++) for (var i2 = 0; i2 < list2.length; i2++) merged = mergeMatch(list1[i1], list2[i2]), merged && res.push(merged);return res;}function mergeChildMatches(childMatches) {if (0 === childMatches.length) return childMatches;for (var s, sets = childMatches.reduce(combineChildMatches), uniqueSets = [], unique = {}, i = 0; i < sets.length; i++) s = JSON.stringify(sets[i]), unique[s] || (unique[s] = !0, uniqueSets.push(sets[i]));return uniqueSets;}function _ruleMatch(rule, node, isSplit) {var res = [{ placeholders: {} }];if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) {if (rule instanceof OperatorNode) {if (rule.op !== node.op || rule.fn !== node.fn) return [];} else if (rule instanceof FunctionNode && rule.name !== node.name) return [];if (1 === node.args.length && 1 === rule.args.length || !isAssociative(node) && node.args.length === rule.args.length || isSplit) {for (var childMatch, childMatches = [], i = 0; i < rule.args.length; i++) {if (childMatch = _ruleMatch(rule.args[i], node.args[i]), 0 === childMatch.length) return [];childMatches.push(childMatch);}res = mergeChildMatches(childMatches);} else {if (2 <= node.args.length && 2 === rule.args.length) {for (var matchSet, splits = getSplits(node, rule.context), splitMatches = [], _i = 0; _i < splits.length; _i++) matchSet = _ruleMatch(rule, splits[_i], !0), splitMatches = splitMatches.concat(matchSet);return splitMatches;}if (2 < rule.args.length) throw Error("Unexpected non-binary associative function: " + rule.toString());else return [];}} else if (rule instanceof SymbolNode) {if (0 === rule.name.length) throw new Error("Symbol in rule has 0 length...!?");if (SUPPORTED_CONSTANTS[rule.name]) {if (rule.name !== node.name) return [];} else if ("n" === rule.name[0] || "_p" === rule.name.substring(0, 2)) res[0].placeholders[rule.name] = node;else if ("v" === rule.name[0]) {if (!(0, _is.isConstantNode)(node)) res[0].placeholders[rule.name] = node;else return [];} else if ("c" !== rule.name[0]) throw new Error("Invalid symbol in rule: " + rule.name);else if (node instanceof ConstantNode) res[0].placeholders[rule.name] = node;else return [];} else if (!(rule instanceof ConstantNode)) return [];else if (!equal(rule.value, node.value)) return [];return res;}function _exactMatch(p, q) {if (p instanceof ConstantNode && q instanceof ConstantNode) {if (!equal(p.value, q.value)) return !1;} else if (p instanceof SymbolNode && q instanceof SymbolNode) {if (p.name !== q.name) return !1;} else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) {if (p instanceof OperatorNode) {if (p.op !== q.op || p.fn !== q.fn) return !1;} else if (p instanceof FunctionNode && p.name !== q.name) return !1;if (p.args.length !== q.args.length) return !1;for (var i = 0; i < p.args.length; i++) if (!_exactMatch(p.args[i], q.args[i])) return !1;} else return !1;return !0;}var config = _ref.config,typed = _ref.typed,parse = _ref.parse,add = _ref.add,subtract = _ref.subtract,multiply = _ref.multiply,divide = _ref.divide,pow = _ref.pow,isZero = _ref.isZero,equal = _ref.equal,fraction = _ref.fraction,bignumber = _ref.bignumber,mathWithTransform = _ref.mathWithTransform,ConstantNode = _ref.ConstantNode,FunctionNode = _ref.FunctionNode,OperatorNode = _ref.OperatorNode,ParenthesisNode = _ref.ParenthesisNode,SymbolNode = _ref.SymbolNode,simplifyConstant = (0, _simplifyConstant.createSimplifyConstant)({ typed: typed, config: config, mathWithTransform: mathWithTransform, fraction: fraction, bignumber: bignumber, ConstantNode: ConstantNode, OperatorNode: OperatorNode, FunctionNode: FunctionNode, SymbolNode: SymbolNode }),simplifyCore = (0, _simplifyCore.createSimplifyCore)({ equal: equal, isZero: isZero, add: add, subtract: subtract, multiply: multiply, divide: divide, pow: pow, ConstantNode: ConstantNode, OperatorNode: OperatorNode, FunctionNode: FunctionNode, ParenthesisNode: ParenthesisNode }),resolve = (0, _resolve.createResolve)({ parse: parse, FunctionNode: FunctionNode, OperatorNode: OperatorNode, ParenthesisNode: ParenthesisNode }),_createUtil = (0, _util.createUtil)({ FunctionNode: FunctionNode, OperatorNode: OperatorNode, SymbolNode: SymbolNode }),isCommutative = _createUtil.isCommutative,isAssociative = _createUtil.isAssociative,flatten = _createUtil.flatten,unflattenr = _createUtil.unflattenr,unflattenl = _createUtil.unflattenl,createMakeNodeFunction = _createUtil.createMakeNodeFunction,simplify = typed("simplify", { string: function string(expr) {return this(parse(expr), this.rules, (0, _map.createEmptyMap)(), {});}, "string, Map | Object": function stringMapObject(expr, scope) {return this(parse(expr), this.rules, scope, {});}, "string, Map | Object, Object": function stringMapObjectObject(expr, scope, options) {return this(parse(expr), this.rules, scope, options);}, "string, Array": function stringArray(expr, rules) {return this(parse(expr), rules, (0, _map.createEmptyMap)(), {});}, "string, Array, Map | Object": function stringArrayMapObject(expr, rules, scope) {return this(parse(expr), rules, scope, {});}, "string, Array, Map | Object, Object": function stringArrayMapObjectObject(expr, rules, scope, options) {return this(parse(expr), rules, scope, options);}, "Node, Map | Object": function NodeMapObject(expr, scope) {return this(expr, this.rules, scope, {});}, "Node, Map | Object, Object": function NodeMapObjectObject(expr, scope, options) {return this(expr, this.rules, scope, options);}, Node: function Node(expr) {return this(expr, this.rules, (0, _map.createEmptyMap)(), {});}, "Node, Array": function NodeArray(expr, rules) {return this(expr, rules, (0, _map.createEmptyMap)(), {});}, "Node, Array, Map | Object": function NodeArrayMapObject(expr, rules, scope) {return this(expr, rules, scope, {});}, "Node, Array, Object, Object": function NodeArrayObjectObject(expr, rules, scope, options) {return this(expr, rules, (0, _map.createMap)(scope), options);}, "Node, Array, Map, Object": function NodeArrayMapObject(expr, rules, scope, options) {rules = _buildRules(rules);var res = resolve(expr, scope);res = removeParens(res);for (var visited = {}, str = res.toString({ parenthesis: "all" }); !visited[str];) {visited[str] = !0, _lastsym = 0;for (var i = 0; i < rules.length; i++) "function" == typeof rules[i] ? res = rules[i](res, options) : (flatten(res), res = applyRule(res, rules[i])), unflattenl(res);str = res.toString({ parenthesis: "all" });}return res;} });simplify.simplifyCore = simplifyCore, simplify.resolve = resolve;var SUPPORTED_CONSTANTS = { true: !0, false: !0, e: !0, i: !0, Infinity: !0, LN2: !0, LN10: !0, LOG2E: !0, LOG10E: !0, NaN: !0, phi: !0, pi: !0, SQRT1_2: !0, SQRT2: !0, tau: !0 };simplify.rules = [simplifyCore, { l: "log(e)", r: "1" }, { l: "n-n1", r: "n+-n1" }, { l: "-(c*v)", r: "(-c) * v" }, { l: "-v", r: "(-1) * v" }, { l: "n/n1^n2", r: "n*n1^-n2" }, { l: "n/n1", r: "n*n1^-1" }, { l: "(n ^ n1) ^ n2", r: "n ^ (n1 * n2)" }, { l: "n*n", r: "n^2" }, { l: "n * n^n1", r: "n^(n1+1)" }, { l: "n^n1 * n^n2", r: "n^(n1+n2)" }, { l: "n+n", r: "2*n" }, { l: "n+-n", r: "0" }, { l: "n1*n2 + n2", r: "(n1+1)*n2" }, { l: "n1*n3 + n2*n3", r: "(n1+n2)*n3" }, { l: "n1 + -1 * (n2 + n3)", r: "n1 + -1 * n2 + -1 * n3" }, simplifyConstant, { l: "(-n)*n1", r: "-(n*n1)" }, { l: "c+v", r: "v+c", context: { add: { commutative: !1 } } }, { l: "v*c", r: "c*v", context: { multiply: { commutative: !1 } } }, { l: "n+-n1", r: "n-n1" }, { l: "n*(n1^-1)", r: "n/n1" }, { l: "n*n1^-n2", r: "n/n1^n2" }, { l: "n1^-1", r: "1/n1" }, { l: "n*(n1/n2)", r: "(n*n1)/n2" }, { l: "n-(n1+n2)", r: "n-n1-n2" }, { l: "1*n", r: "n" }, { l: "n1/(n2/n3)", r: "(n1*n3)/n2" }];var _lastsym = 0,applyRule = typed("applyRule", { "Node, Object": function NodeObject(node, rule) {var res = node;if (!(res instanceof OperatorNode || res instanceof FunctionNode)) res instanceof ParenthesisNode && res.content && (res.content = applyRule(res.content, rule));else if (res.args) for (var i = 0; i < res.args.length; i++) res.args[i] = applyRule(res.args[i], rule);var repl = rule.r,matches = _ruleMatch(rule.l, res)[0];if (!matches && rule.expanded && (repl = rule.expanded.r, matches = _ruleMatch(rule.expanded.l, res)[0]), matches) {var implicit = res.implicit;res = repl.clone(), implicit && "implicit" in repl && (res.implicit = !0), res = res.transform(function (node) {return node.isSymbolNode && (0, _object.hasOwnProperty)(matches.placeholders, node.name) ? matches.placeholders[node.name].clone() : node;});}return res;} });return simplify;});exports.createSimplify = createSimplify;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/simplify/resolve.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createResolve = void 0;var _map = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/map.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "resolve",dependencies = ["parse", "FunctionNode", "OperatorNode", "ParenthesisNode"],createResolve = (0, _factory.factory)(name, dependencies, function (_ref) {function resolve(node, scope) {if (!scope) return node;if ((0, _map.isMap)(scope) || (scope = (0, _map.createMap)(scope)), (0, _is.isSymbolNode)(node)) {var value = scope.get(node.name);if ((0, _is.isNode)(value)) return resolve(value, scope);if ("number" == typeof value) return parse(value + "");} else {if ((0, _is.isOperatorNode)(node)) {var args = node.args.map(function (arg) {return resolve(arg, scope);});return new OperatorNode(node.op, node.fn, args, node.implicit);}if ((0, _is.isParenthesisNode)(node)) return new ParenthesisNode(resolve(node.content, scope));if ((0, _is.isFunctionNode)(node)) {var _args = node.args.map(function (arg) {return resolve(arg, scope);});return new FunctionNode(node.name, _args);}}return node;}var parse = _ref.parse,FunctionNode = _ref.FunctionNode,OperatorNode = _ref.OperatorNode,ParenthesisNode = _ref.ParenthesisNode;return resolve;});exports.createResolve = createResolve;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/simplify/simplifyConstant.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSimplifyConstant = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_util = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/simplify/util.js"),_noop = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/noop.js"),name = "simplifyConstant",dependencies = ["typed", "config", "mathWithTransform", "?fraction", "?bignumber", "ConstantNode", "OperatorNode", "FunctionNode", "SymbolNode"],createSimplifyConstant = (0, _factory.factory)(name, dependencies, function (_ref) {function _eval(fnname, args, options) {try {return _toNumber(mathWithTransform[fnname].apply(null, args), options);} catch (ignore) {return args = args.map(function (x) {return (0, _is.isFraction)(x) ? x.valueOf() : x;}), _toNumber(mathWithTransform[fnname].apply(null, args), options);}}function _exactFraction(n, options) {var exactFractions = options && !1 !== options.exactFractions;if (exactFractions && isFinite(n) && fraction) {var f = fraction(n),fractionsLimit = options && "number" == typeof options.fractionsLimit ? options.fractionsLimit : 1 / 0;if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) return f;}return n;}function unaryMinusNode(n) {return new OperatorNode("-", "unaryMinus", [n]);}function foldOp(fn, args, makeNode, options) {return args.reduce(function (a, b) {if (!(0, _is.isNode)(a) && !(0, _is.isNode)(b)) {try {return _eval(fn, [a, b], options);} catch (ignoreandcontinue) {}a = _toNode(a), b = _toNode(b);} else (0, _is.isNode)(a) ? (0, _is.isNode)(b) || (b = _toNode(b)) : a = _toNode(a);return makeNode([a, b]);});}function foldFraction(node, options) {switch (node.type) {case "SymbolNode":return node;case "ConstantNode":return "number" != typeof node.value && isNaN(node.value) ? node : _toNumber(node.value, options);case "FunctionNode":if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) return node;{if (-1 === ["add", "multiply"].indexOf(node.name)) {var args = node.args.map(function (arg) {return foldFraction(arg, options);});if (!args.some(_is.isNode)) try {return _eval(node.name, args, options);} catch (ignoreandcontine) {}return args = args.map(function (arg) {return (0, _is.isNode)(arg) ? arg : _toNode(arg);}), new FunctionNode(node.name, args);}}case "OperatorNode":{var _args,res,fn = node.fn.toString(),makeNode = createMakeNodeFunction(node);if ((0, _is.isOperatorNode)(node) && node.isUnary()) _args = [foldFraction(node.args[0], options)], res = (0, _is.isNode)(_args[0]) ? makeNode(_args) : _eval(fn, _args, options);else if (!isAssociative(node)) _args = node.args.map(function (arg) {return foldFraction(arg, options);}), res = foldOp(fn, _args, makeNode, options);else if (_args = allChildren(node), _args = _args.map(function (arg) {return foldFraction(arg, options);}), isCommutative(fn)) {for (var consts = [], vars = [], i = 0; i < _args.length; i++) (0, _is.isNode)(_args[i]) ? vars.push(_args[i]) : consts.push(_args[i]);1 < consts.length ? (res = foldOp(fn, consts, makeNode, options), vars.unshift(res), res = foldOp(fn, vars, makeNode, options)) : res = foldOp(fn, _args, makeNode, options);} else res = foldOp(fn, _args, makeNode, options);return res;}case "ParenthesisNode":return foldFraction(node.content, options);case "AccessorNode":case "ArrayNode":case "AssignmentNode":case "BlockNode":case "FunctionAssignmentNode":case "IndexNode":case "ObjectNode":case "RangeNode":case "ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(node.type));}}var typed = _ref.typed,config = _ref.config,mathWithTransform = _ref.mathWithTransform,fraction = _ref.fraction,bignumber = _ref.bignumber,ConstantNode = _ref.ConstantNode,OperatorNode = _ref.OperatorNode,FunctionNode = _ref.FunctionNode,SymbolNode = _ref.SymbolNode,_createUtil = (0, _util.createUtil)({ FunctionNode: FunctionNode, OperatorNode: OperatorNode, SymbolNode: SymbolNode }),isCommutative = _createUtil.isCommutative,isAssociative = _createUtil.isAssociative,allChildren = _createUtil.allChildren,createMakeNodeFunction = _createUtil.createMakeNodeFunction,_toNode = typed({ Fraction: function (f) {var n,vn = f.s * f.n;return n = 0 > vn ? new OperatorNode("-", "unaryMinus", [new ConstantNode(-vn)]) : new ConstantNode(vn), 1 === f.d ? n : new OperatorNode("/", "divide", [n, new ConstantNode(f.d)]);}, number: function (n) {return 0 > n ? unaryMinusNode(new ConstantNode(-n)) : new ConstantNode(n);}, BigNumber: function (n) {return 0 > n ? unaryMinusNode(new ConstantNode(-n)) : new ConstantNode(n);}, Complex: function () {throw new Error("Cannot convert Complex number to Node");} }),_toNumber = typed({ "string, Object": function (s, options) {if ("BigNumber" === config.number) return void 0 === bignumber && (0, _noop.noBignumber)(), bignumber(s);if ("Fraction" === config.number) return void 0 === fraction && (0, _noop.noFraction)(), fraction(s);var n = parseFloat(s);return _exactFraction(n, options);}, "Fraction, Object": function (s) {return s;}, "BigNumber, Object": function (s) {return s;}, "number, Object": function (s, options) {return _exactFraction(s, options);}, "Complex, Object": function (s, options) {return 0 === s.im ? _exactFraction(s.re, options) : s;} });return function (expr, options) {var res = foldFraction(expr, options);return (0, _is.isNode)(res) ? res : _toNode(res);};});exports.createSimplifyConstant = createSimplifyConstant;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/simplify/simplifyCore.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSimplifyCore = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "simplifyCore",dependencies = ["equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "ConstantNode", "OperatorNode", "FunctionNode", "ParenthesisNode"],createSimplifyCore = (0, _factory.factory)(name, dependencies, function (_ref) {function simplifyCore(node) {if ((0, _is.isOperatorNode)(node) && node.isUnary()) {var a0 = simplifyCore(node.args[0]);if ("+" === node.op) return a0;if ("-" === node.op) {if ((0, _is.isOperatorNode)(a0)) {if (a0.isUnary() && "-" === a0.op) return a0.args[0];if (a0.isBinary() && "subtract" === a0.fn) return new OperatorNode("-", "subtract", [a0.args[1], a0.args[0]]);}return new OperatorNode(node.op, node.fn, [a0]);}} else if ((0, _is.isOperatorNode)(node) && node.isBinary()) {var _a = simplifyCore(node.args[0]),a1 = simplifyCore(node.args[1]);if ("+" === node.op) {if ((0, _is.isConstantNode)(_a)) {if (isZero(_a.value)) return a1;if ((0, _is.isConstantNode)(a1)) return new ConstantNode(add(_a.value, a1.value));}return (0, _is.isConstantNode)(a1) && isZero(a1.value) ? _a : (0, _is.isOperatorNode)(a1) && a1.isUnary() && "-" === a1.op ? new OperatorNode("-", "subtract", [_a, a1.args[0]]) : new OperatorNode(node.op, node.fn, a1 ? [_a, a1] : [_a]);}if ("-" === node.op) {if ((0, _is.isConstantNode)(_a) && a1) {if ((0, _is.isConstantNode)(a1)) return new ConstantNode(subtract(_a.value, a1.value));if (isZero(_a.value)) return new OperatorNode("-", "unaryMinus", [a1]);}if ("subtract" === node.fn) return (0, _is.isConstantNode)(a1) && isZero(a1.value) ? _a : (0, _is.isOperatorNode)(a1) && a1.isUnary() && "-" === a1.op ? simplifyCore(new OperatorNode("+", "add", [_a, a1.args[0]])) : new OperatorNode(node.op, node.fn, [_a, a1]);} else {if ("*" === node.op) {if ((0, _is.isConstantNode)(_a)) {if (isZero(_a.value)) return node0;if (equal(_a.value, 1)) return a1;if ((0, _is.isConstantNode)(a1)) return new ConstantNode(multiply(_a.value, a1.value));}if ((0, _is.isConstantNode)(a1)) {if (isZero(a1.value)) return node0;if (equal(a1.value, 1)) return _a;if ((0, _is.isOperatorNode)(_a) && _a.isBinary() && _a.op === node.op) {var a00 = _a.args[0];if ((0, _is.isConstantNode)(a00)) {var a00a1 = new ConstantNode(multiply(a00.value, a1.value));return new OperatorNode(node.op, node.fn, [a00a1, _a.args[1]], node.implicit);}}return new OperatorNode(node.op, node.fn, [a1, _a], node.implicit);}return new OperatorNode(node.op, node.fn, [_a, a1], node.implicit);}if ("/" === node.op) {if ((0, _is.isConstantNode)(_a)) {if (isZero(_a.value)) return node0;if ((0, _is.isConstantNode)(a1) && (equal(a1.value, 1) || equal(a1.value, 2) || equal(a1.value, 4))) return new ConstantNode(divide(_a.value, a1.value));}return new OperatorNode(node.op, node.fn, [_a, a1]);}if ("^" === node.op) {if ((0, _is.isConstantNode)(a1)) {if (isZero(a1.value)) return node1;if (equal(a1.value, 1)) return _a;if ((0, _is.isConstantNode)(_a)) return new ConstantNode(pow(_a.value, a1.value));if ((0, _is.isOperatorNode)(_a) && _a.isBinary() && "^" === _a.op) {var a01 = _a.args[1];if ((0, _is.isConstantNode)(a01)) return new OperatorNode(node.op, node.fn, [_a.args[0], new ConstantNode(multiply(a01.value, a1.value))]);}}return new OperatorNode(node.op, node.fn, [_a, a1]);}}} else {if ((0, _is.isParenthesisNode)(node)) {var c = simplifyCore(node.content);return (0, _is.isParenthesisNode)(c) || (0, _is.isSymbolNode)(c) || (0, _is.isConstantNode)(c) ? c : new ParenthesisNode(c);}if ((0, _is.isFunctionNode)(node)) {var args = node.args.map(simplifyCore).map(function (arg) {return (0, _is.isParenthesisNode)(arg) ? arg.content : arg;});return new FunctionNode(simplifyCore(node.fn), args);}}return node;}var equal = _ref.equal,isZero = _ref.isZero,add = _ref.add,subtract = _ref.subtract,multiply = _ref.multiply,divide = _ref.divide,pow = _ref.pow,ConstantNode = _ref.ConstantNode,OperatorNode = _ref.OperatorNode,FunctionNode = _ref.FunctionNode,ParenthesisNode = _ref.ParenthesisNode,node0 = new ConstantNode(0),node1 = new ConstantNode(1);return simplifyCore;});exports.createSimplifyCore = createSimplifyCore;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/simplify/util.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUtil = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),name = "simplifyUtil",dependencies = ["FunctionNode", "OperatorNode", "SymbolNode"],createUtil = (0, _factory.factory)(name, dependencies, function (_ref) {function isAssociative(node, context) {if (!(0, _is.isOperatorNode)(node)) return !1;var name = node.fn.toString();return context && (0, _object.hasOwnProperty)(context, name) && (0, _object.hasOwnProperty)(context[name], "associative") ? context[name].associative : associative[name] || !1;}function flatten(node) {if (!node.args || 0 === node.args.length) return node;node.args = allChildren(node);for (var i = 0; i < node.args.length; i++) flatten(node.args[i]);}function allChildren(node) {var op,children = [];return isAssociative(node) ? (op = node.op, function findChildren(node) {for (var child, i = 0; i < node.args.length; i++) child = node.args[i], (0, _is.isOperatorNode)(child) && op === child.op ? findChildren(child) : children.push(child);}(node), children) : node.args;}function unflattenr(node) {if (node.args && 0 !== node.args.length) {for (var makeNode = createMakeNodeFunction(node), l = node.args.length, i = 0; i < l; i++) unflattenr(node.args[i]);if (2 < l && isAssociative(node)) {for (var curnode = node.args.pop(); 0 < node.args.length;) curnode = makeNode([node.args.pop(), curnode]);node.args = curnode.args;}}}function unflattenl(node) {if (node.args && 0 !== node.args.length) {for (var makeNode = createMakeNodeFunction(node), l = node.args.length, i = 0; i < l; i++) unflattenl(node.args[i]);if (2 < l && isAssociative(node)) {for (var curnode = node.args.shift(); 0 < node.args.length;) curnode = makeNode([curnode, node.args.shift()]);node.args = curnode.args;}}}function createMakeNodeFunction(node) {return (0, _is.isOperatorNode)(node) ? function (args) {try {return new OperatorNode(node.op, node.fn, args, node.implicit);} catch (err) {return console.error(err), [];}} : function (args) {return new FunctionNode(new SymbolNode(node.name), args);};}var FunctionNode = _ref.FunctionNode,OperatorNode = _ref.OperatorNode,SymbolNode = _ref.SymbolNode,commutative = { add: !0, multiply: !0 },associative = { add: !0, multiply: !0 };return { createMakeNodeFunction: createMakeNodeFunction, isCommutative: function isCommutative(node, context) {if (!(0, _is.isOperatorNode)(node)) return !0;var name = node.fn.toString();return context && (0, _object.hasOwnProperty)(context, name) && (0, _object.hasOwnProperty)(context[name], "commutative") ? context[name].commutative : commutative[name] || !1;}, isAssociative: isAssociative, flatten: flatten, allChildren: allChildren, unflattenr: unflattenr, unflattenl: unflattenl };});exports.createUtil = createUtil;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/solver/lsolve.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLsolve = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_solveValidation = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js"),name = "lsolve",dependencies = ["typed", "matrix", "divideScalar", "multiplyScalar", "subtract", "equalScalar", "DenseMatrix"],createLsolve = (0, _factory.factory)(name, dependencies, function (_ref) {function _denseForwardSubstitution(m, b) {b = solveValidation(m, b, !0);for (var bdata = b._data, rows = m._size[0], columns = m._size[1], x = [], mdata = m._data, j = 0; j < columns; j++) {var bj = bdata[j][0] || 0,xj = void 0;if (!equalScalar(bj, 0)) {var vjj = mdata[j][j];if (equalScalar(vjj, 0)) throw new Error("Linear system cannot be solved since matrix is singular");xj = divideScalar(bj, vjj);for (var i = j + 1; i < rows; i++) bdata[i] = [subtract(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];} else xj = 0;x[j] = [xj];}return new DenseMatrix({ data: x, size: [rows, 1] });}function _sparseForwardSubstitution(m, b) {b = solveValidation(m, b, !0);for (var bj, bdata = b._data, rows = m._size[0], columns = m._size[1], values = m._values, index = m._index, ptr = m._ptr, x = [], j = 0; j < columns; j++) if (bj = bdata[j][0] || 0, !equalScalar(bj, 0)) {for (var i, vjj = 0, jValues = [], jIndices = [], firstIndex = ptr[j], lastIndex = ptr[j + 1], k = firstIndex; k < lastIndex; k++) i = index[k], i === j ? vjj = values[k] : i > j && (jValues.push(values[k]), jIndices.push(i));if (equalScalar(vjj, 0)) throw new Error("Linear system cannot be solved since matrix is singular");for (var _i, xj = divideScalar(bj, vjj), _k = 0, l = jIndices.length; _k < l; _k++) _i = jIndices[_k], bdata[_i] = [subtract(bdata[_i][0] || 0, multiplyScalar(xj, jValues[_k]))];x[j] = [xj];} else x[j] = [0];return new DenseMatrix({ data: x, size: [rows, 1] });}var typed = _ref.typed,matrix = _ref.matrix,divideScalar = _ref.divideScalar,multiplyScalar = _ref.multiplyScalar,subtract = _ref.subtract,equalScalar = _ref.equalScalar,DenseMatrix = _ref.DenseMatrix,solveValidation = (0, _solveValidation.createSolveValidation)({ DenseMatrix: DenseMatrix });return typed(name, { "SparseMatrix, Array | Matrix": function (m, b) {return _sparseForwardSubstitution(m, b);}, "DenseMatrix, Array | Matrix": function (m, b) {return _denseForwardSubstitution(m, b);}, "Array, Array | Matrix": function (a, b) {var m = matrix(a),r = _denseForwardSubstitution(m, b);return r.valueOf();} });});exports.createLsolve = createLsolve;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/solver/lsolveAll.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLsolveAll = void 0;var _toConsumableArray2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js")),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_solveValidation = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js"),name = "lsolveAll",dependencies = ["typed", "matrix", "divideScalar", "multiplyScalar", "subtract", "equalScalar", "DenseMatrix"],createLsolveAll = (0, _factory.factory)(name, dependencies, function (_ref) {function _denseForwardSubstitution(m, b_) {for (var L, B = [solveValidation(m, b_, !0)._data.map(function (e) {return e[0];})], M = m._data, rows = m._size[0], columns = m._size[1], i = 0; i < columns; i++) {L = B.length;for (var b, k = 0; k < L; k++) if (b = B[k], !equalScalar(M[i][i], 0)) {b[i] = divideScalar(b[i], M[i][i]);for (var j = i + 1; j < columns; j++) b[j] = subtract(b[j], multiplyScalar(b[i], M[j][i]));} else if (!equalScalar(b[i], 0)) {if (0 === k) return [];B.splice(k, 1), k -= 1, L -= 1;} else if (0 === k) {var bNew = (0, _toConsumableArray2["default"])(b);bNew[i] = 1;for (var _j = i + 1; _j < columns; _j++) bNew[_j] = subtract(bNew[_j], M[_j][i]);B.push(bNew);}}return B.map(function (x) {return new DenseMatrix({ data: x.map(function (e) {return [e];}), size: [rows, 1] });});}function _sparseForwardSubstitution(m, b_) {for (var L, B = [solveValidation(m, b_, !0)._data.map(function (e) {return e[0];})], rows = m._size[0], columns = m._size[1], values = m._values, index = m._index, ptr = m._ptr, i = 0; i < columns; i++) {L = B.length;for (var k = 0; k < L; k++) {for (var J, b = B[k], iValues = [], iIndices = [], firstIndex = ptr[i], lastIndex = ptr[i + 1], Mii = 0, j = firstIndex; j < lastIndex; j++) J = index[j], J === i ? Mii = values[j] : J > i && (iValues.push(values[j]), iIndices.push(J));if (!equalScalar(Mii, 0)) {b[i] = divideScalar(b[i], Mii);for (var _J, _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) _J = iIndices[_j2], b[_J] = subtract(b[_J], multiplyScalar(b[i], iValues[_j2]));} else if (!equalScalar(b[i], 0)) {if (0 === k) return [];B.splice(k, 1), k -= 1, L -= 1;} else if (0 === k) {var bNew = (0, _toConsumableArray2["default"])(b);bNew[i] = 1;for (var _J2, _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) _J2 = iIndices[_j3], bNew[_J2] = subtract(bNew[_J2], iValues[_j3]);B.push(bNew);}}}return B.map(function (x) {return new DenseMatrix({ data: x.map(function (e) {return [e];}), size: [rows, 1] });});}var typed = _ref.typed,matrix = _ref.matrix,divideScalar = _ref.divideScalar,multiplyScalar = _ref.multiplyScalar,subtract = _ref.subtract,equalScalar = _ref.equalScalar,DenseMatrix = _ref.DenseMatrix,solveValidation = (0, _solveValidation.createSolveValidation)({ DenseMatrix: DenseMatrix });return typed(name, { "SparseMatrix, Array | Matrix": function (m, b) {return _sparseForwardSubstitution(m, b);}, "DenseMatrix, Array | Matrix": function (m, b) {return _denseForwardSubstitution(m, b);}, "Array, Array | Matrix": function (a, b) {var m = matrix(a),R = _denseForwardSubstitution(m, b);return R.map(function (r) {return r.valueOf();});} });});exports.createLsolveAll = createLsolveAll;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/solver/lusolve.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLusolve = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_solveValidation = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js"),_csIpvec = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csIpvec.js"),name = "lusolve",dependencies = ["typed", "matrix", "lup", "slu", "usolve", "lsolve", "DenseMatrix"],createLusolve = (0, _factory.factory)(name, dependencies, function (_ref) {function _toMatrix(a) {if ((0, _is.isMatrix)(a)) return a;if ((0, _is.isArray)(a)) return matrix(a);throw new TypeError("Invalid Matrix LU decomposition");}function _lusolve(l, u, p, q, b) {l = _toMatrix(l), u = _toMatrix(u), p && (b = solveValidation(l, b, !0), b._data = (0, _csIpvec.csIpvec)(p, b._data));var y = lsolve(l, b),x = usolve(u, y);return q && (x._data = (0, _csIpvec.csIpvec)(q, x._data)), x;}var typed = _ref.typed,matrix = _ref.matrix,lup = _ref.lup,slu = _ref.slu,usolve = _ref.usolve,lsolve = _ref.lsolve,DenseMatrix = _ref.DenseMatrix,solveValidation = (0, _solveValidation.createSolveValidation)({ DenseMatrix: DenseMatrix });return typed(name, { "Array, Array | Matrix": function (a, b) {a = matrix(a);var d = lup(a),x = _lusolve(d.L, d.U, d.p, null, b);return x.valueOf();}, "DenseMatrix, Array | Matrix": function (a, b) {var d = lup(a);return _lusolve(d.L, d.U, d.p, null, b);}, "SparseMatrix, Array | Matrix": function (a, b) {var d = lup(a);return _lusolve(d.L, d.U, d.p, null, b);}, "SparseMatrix, Array | Matrix, number, number": function (a, b, order, threshold) {var d = slu(a, order, threshold);return _lusolve(d.L, d.U, d.p, d.q, b);}, "Object, Array | Matrix": function (d, b) {return _lusolve(d.L, d.U, d.p, d.q, b);} });});exports.createLusolve = createLusolve;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/solver/usolve.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUsolve = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_solveValidation = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js"),name = "usolve",dependencies = ["typed", "matrix", "divideScalar", "multiplyScalar", "subtract", "equalScalar", "DenseMatrix"],createUsolve = (0, _factory.factory)(name, dependencies, function (_ref) {function _denseBackwardSubstitution(m, b) {b = solveValidation(m, b, !0);for (var bdata = b._data, rows = m._size[0], columns = m._size[1], x = [], mdata = m._data, j = columns - 1; 0 <= j; j--) {var bj = bdata[j][0] || 0,xj = void 0;if (!equalScalar(bj, 0)) {var vjj = mdata[j][j];if (equalScalar(vjj, 0)) throw new Error("Linear system cannot be solved since matrix is singular");xj = divideScalar(bj, vjj);for (var i = j - 1; 0 <= i; i--) bdata[i] = [subtract(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];} else xj = 0;x[j] = [xj];}return new DenseMatrix({ data: x, size: [rows, 1] });}function _sparseBackwardSubstitution(m, b) {b = solveValidation(m, b, !0);for (var bj, bdata = b._data, rows = m._size[0], columns = m._size[1], values = m._values, index = m._index, ptr = m._ptr, x = [], j = columns - 1; 0 <= j; j--) if (bj = bdata[j][0] || 0, !equalScalar(bj, 0)) {for (var i, vjj = 0, jValues = [], jIndices = [], firstIndex = ptr[j], lastIndex = ptr[j + 1], k = lastIndex - 1; k >= firstIndex; k--) i = index[k], i === j ? vjj = values[k] : i < j && (jValues.push(values[k]), jIndices.push(i));if (equalScalar(vjj, 0)) throw new Error("Linear system cannot be solved since matrix is singular");for (var _i, xj = divideScalar(bj, vjj), _k = 0, _lastIndex = jIndices.length; _k < _lastIndex; _k++) _i = jIndices[_k], bdata[_i] = [subtract(bdata[_i][0], multiplyScalar(xj, jValues[_k]))];x[j] = [xj];} else x[j] = [0];return new DenseMatrix({ data: x, size: [rows, 1] });}var typed = _ref.typed,matrix = _ref.matrix,divideScalar = _ref.divideScalar,multiplyScalar = _ref.multiplyScalar,subtract = _ref.subtract,equalScalar = _ref.equalScalar,DenseMatrix = _ref.DenseMatrix,solveValidation = (0, _solveValidation.createSolveValidation)({ DenseMatrix: DenseMatrix });return typed(name, { "SparseMatrix, Array | Matrix": function (m, b) {return _sparseBackwardSubstitution(m, b);}, "DenseMatrix, Array | Matrix": function (m, b) {return _denseBackwardSubstitution(m, b);}, "Array, Array | Matrix": function (a, b) {var m = matrix(a),r = _denseBackwardSubstitution(m, b);return r.valueOf();} });});exports.createUsolve = createUsolve;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/solver/usolveAll.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUsolveAll = void 0;var _toConsumableArray2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js")),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_solveValidation = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js"),name = "usolveAll",dependencies = ["typed", "matrix", "divideScalar", "multiplyScalar", "subtract", "equalScalar", "DenseMatrix"],createUsolveAll = (0, _factory.factory)(name, dependencies, function (_ref) {function _denseBackwardSubstitution(m, b_) {for (var L, B = [solveValidation(m, b_, !0)._data.map(function (e) {return e[0];})], M = m._data, rows = m._size[0], columns = m._size[1], i = columns - 1; 0 <= i; i--) {L = B.length;for (var b, k = 0; k < L; k++) if (b = B[k], !equalScalar(M[i][i], 0)) {b[i] = divideScalar(b[i], M[i][i]);for (var j = i - 1; 0 <= j; j--) b[j] = subtract(b[j], multiplyScalar(b[i], M[j][i]));} else if (!equalScalar(b[i], 0)) {if (0 === k) return [];B.splice(k, 1), k -= 1, L -= 1;} else if (0 === k) {var bNew = (0, _toConsumableArray2["default"])(b);bNew[i] = 1;for (var _j = i - 1; 0 <= _j; _j--) bNew[_j] = subtract(bNew[_j], M[_j][i]);B.push(bNew);}}return B.map(function (x) {return new DenseMatrix({ data: x.map(function (e) {return [e];}), size: [rows, 1] });});}function _sparseBackwardSubstitution(m, b_) {for (var L, B = [solveValidation(m, b_, !0)._data.map(function (e) {return e[0];})], rows = m._size[0], columns = m._size[1], values = m._values, index = m._index, ptr = m._ptr, i = columns - 1; 0 <= i; i--) {L = B.length;for (var k = 0; k < L; k++) {for (var J, b = B[k], iValues = [], iIndices = [], firstIndex = ptr[i], lastIndex = ptr[i + 1], Mii = 0, j = lastIndex - 1; j >= firstIndex; j--) J = index[j], J === i ? Mii = values[j] : J < i && (iValues.push(values[j]), iIndices.push(J));if (!equalScalar(Mii, 0)) {b[i] = divideScalar(b[i], Mii);for (var _J, _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) _J = iIndices[_j2], b[_J] = subtract(b[_J], multiplyScalar(b[i], iValues[_j2]));} else if (!equalScalar(b[i], 0)) {if (0 === k) return [];B.splice(k, 1), k -= 1, L -= 1;} else if (0 === k) {var bNew = (0, _toConsumableArray2["default"])(b);bNew[i] = 1;for (var _J2, _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) _J2 = iIndices[_j3], bNew[_J2] = subtract(bNew[_J2], iValues[_j3]);B.push(bNew);}}}return B.map(function (x) {return new DenseMatrix({ data: x.map(function (e) {return [e];}), size: [rows, 1] });});}var typed = _ref.typed,matrix = _ref.matrix,divideScalar = _ref.divideScalar,multiplyScalar = _ref.multiplyScalar,subtract = _ref.subtract,equalScalar = _ref.equalScalar,DenseMatrix = _ref.DenseMatrix,solveValidation = (0, _solveValidation.createSolveValidation)({ DenseMatrix: DenseMatrix });return typed(name, { "SparseMatrix, Array | Matrix": function (m, b) {return _sparseBackwardSubstitution(m, b);}, "DenseMatrix, Array | Matrix": function (m, b) {return _denseBackwardSubstitution(m, b);}, "Array, Array | Matrix": function (a, b) {var m = matrix(a),R = _denseBackwardSubstitution(m, b);return R.map(function (r) {return r.valueOf();});} });});exports.createUsolveAll = createUsolveAll;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSolveValidation = createSolveValidation;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js");function createSolveValidation(_ref) {var DenseMatrix = _ref.DenseMatrix;return function (m, b, copy) {var mSize = m.size();if (2 !== mSize.length) throw new RangeError("Matrix must be two dimensional (size: " + (0, _string.format)(mSize) + ")");var rows = mSize[0],columns = mSize[1];if (rows !== columns) throw new RangeError("Matrix must be square (size: " + (0, _string.format)(mSize) + ")");var data = [];if ((0, _is.isMatrix)(b)) {var bSize = b.size(),bdata = b._data;if (1 === bSize.length) {if (bSize[0] !== rows) throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for (var i = 0; i < rows; i++) data[i] = [bdata[i]];return new DenseMatrix({ data: data, size: [rows, 1], datatype: b._datatype });}if (2 === bSize.length) {if (bSize[0] !== rows || 1 !== bSize[1]) throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if ((0, _is.isDenseMatrix)(b)) {if (copy) {data = [];for (var _i = 0; _i < rows; _i++) data[_i] = [bdata[_i][0]];return new DenseMatrix({ data: data, size: [rows, 1], datatype: b._datatype });}return b;}if ((0, _is.isSparseMatrix)(b)) {for (var _i2 = 0; _i2 < rows; _i2++) data[_i2] = [0];for (var _i3, values = b._values, index = b._index, ptr = b._ptr, k1 = ptr[1], k = ptr[0]; k < k1; k++) _i3 = index[k], data[_i3][0] = values[k];return new DenseMatrix({ data: data, size: [rows, 1], datatype: b._datatype });}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.");}if ((0, _is.isArray)(b)) {var bsize = (0, _array.arraySize)(b);if (1 === bsize.length) {if (bsize[0] !== rows) throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for (var _i4 = 0; _i4 < rows; _i4++) data[_i4] = [b[_i4]];return new DenseMatrix({ data: data, size: [rows, 1] });}if (2 === bsize.length) {if (bsize[0] !== rows || 1 !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for (var _i5 = 0; _i5 < rows; _i5++) data[_i5] = [b[_i5][0]];return new DenseMatrix({ data: data, size: [rows, 1] });}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.");}};}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csAmd.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCsAmd = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_csFkeep = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csFkeep.js"),_csFlip = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js"),_csTdfs = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csTdfs.js"),name = "csAmd",dependencies = ["add", "multiply", "transpose"],createCsAmd = (0, _factory.factory)(name, dependencies, function (_ref) {function _createTargetMatrix(order, a, m, n, dense) {var at = transpose(a);if (1 === order && n === m) return add(a, at);if (2 === order) {for (var p, tindex = at._index, tptr = at._ptr, p2 = 0, j = 0; j < m; j++) if (p = tptr[j], tptr[j] = p2, !(tptr[j + 1] - p > dense)) for (var p1 = tptr[j + 1]; p < p1; p++) tindex[p2++] = tindex[p];return tptr[m] = p2, a = transpose(at), multiply(at, a);}return multiply(at, a);}function _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree) {for (var k = 0; k < n; k++) W[len + k] = cptr[k + 1] - cptr[k];W[len + n] = 0;for (var i = 0; i <= n; i++) W[head + i] = -1, last[i] = -1, W[next + i] = -1, W[hhead + i] = -1, W[nv + i] = 1, W[w + i] = 1, W[elen + i] = 0, W[degree + i] = W[len + i];var mark = _wclear(0, 0, W, w, n);return W[elen + n] = -2, cptr[n] = -1, W[w + n] = 0, mark;}function _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next) {for (var d, nel = 0, i = 0; i < n; i++) if (d = W[degree + i], 0 === d) W[elen + i] = -2, nel++, cptr[i] = -1, W[w + i] = 0;else if (d > dense) W[nv + i] = 0, W[elen + i] = -1, nel++, cptr[i] = (0, _csFlip.csFlip)(n), W[nv + n]++;else {var h = W[head + d];-1 !== h && (last[h] = i), W[next + i] = W[head + d], W[head + d] = i;}return nel;}function _wclear(mark, lemax, W, w, n) {if (2 > mark || 0 > mark + lemax) {for (var k = 0; k < n; k++) 0 !== W[w + k] && (W[w + k] = 1);mark = 2;}return mark;}function _diag(i, j) {return i !== j;}var add = _ref.add,multiply = _ref.multiply,transpose = _ref.transpose;return function (order, a) {if (!a || 0 >= order || 3 < order) return null;var asize = a._size,m = asize[0],n = asize[1],lemax = 0,dense = Math.max(16, 10 * Math.sqrt(n));dense = Math.min(n - 2, dense);var cm = _createTargetMatrix(order, a, m, n, dense);(0, _csFkeep.csFkeep)(cm, _diag, null);for (var i, j, k, k1, k2, e, pj, ln, nvi, pk, eln, p1, p2, pn, h, d, cindex = cm._index, cptr = cm._ptr, cnz = cptr[n], P = [], W = [], len = 0, nv = n + 1, next = 2 * (n + 1), head = 3 * (n + 1), elen = 4 * (n + 1), degree = 5 * (n + 1), w = 6 * (n + 1), hhead = 7 * (n + 1), last = P, mark = _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree), nel = _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next), mindeg = 0; nel < n;) {for (k = -1; mindeg < n && -1 === (k = W[head + mindeg]); mindeg++);-1 !== W[next + k] && (last[W[next + k]] = -1), W[head + mindeg] = W[next + k];var elenk = W[elen + k],nvk = W[nv + k];nel += nvk;var dk = 0;W[nv + k] = -nvk;var p = cptr[k],pk1 = 0 === elenk ? p : cnz,pk2 = pk1;for (k1 = 1; k1 <= elenk + 1; k1++) {for (k1 > elenk ? (e = k, pj = p, ln = W[len + k] - elenk) : (e = cindex[p++], pj = cptr[e], ln = W[len + e]), k2 = 1; k2 <= ln; k2++) (i = cindex[pj++], !(0 >= (nvi = W[nv + i]))) && (dk += nvi, W[nv + i] = -nvi, cindex[pk2++] = i, -1 !== W[next + i] && (last[W[next + i]] = last[i]), -1 === last[i] ? W[head + W[degree + i]] = W[next + i] : W[next + last[i]] = W[next + i]);e !== k && (cptr[e] = (0, _csFlip.csFlip)(k), W[w + e] = 0);}for (0 !== elenk && (cnz = pk2), W[degree + k] = dk, cptr[k] = pk1, W[len + k] = pk2 - pk1, W[elen + k] = -2, mark = _wclear(mark, lemax, W, w, n), pk = pk1; pk < pk2; pk++) if (i = cindex[pk], !(0 >= (eln = W[elen + i]))) {nvi = -W[nv + i];var wnvi = mark - nvi;for (p = cptr[i], p1 = cptr[i] + eln - 1; p <= p1; p++) e = cindex[p], W[w + e] >= mark ? W[w + e] -= nvi : 0 !== W[w + e] && (W[w + e] = W[degree + e] + wnvi);}for (pk = pk1; pk < pk2; pk++) {for (i = cindex[pk], p1 = cptr[i], p2 = p1 + W[elen + i] - 1, pn = p1, (h = 0, d = 0, p = p1); p <= p2; p++) if (e = cindex[p], 0 !== W[w + e]) {var dext = W[w + e] - mark;0 < dext ? (d += dext, cindex[pn++] = e, h += e) : (cptr[e] = (0, _csFlip.csFlip)(k), W[w + e] = 0);}W[elen + i] = pn - p1 + 1;var p3 = pn,p4 = p1 + W[len + i];for (p = p2 + 1; p < p4; p++) {j = cindex[p];var nvj = W[nv + j];0 >= nvj || (d += nvj, cindex[pn++] = j, h += j);}0 === d ? (cptr[i] = (0, _csFlip.csFlip)(k), nvi = -W[nv + i], dk -= nvi, nvk += nvi, nel += nvi, W[nv + i] = 0, W[elen + i] = -1) : (W[degree + i] = Math.min(W[degree + i], d), cindex[pn] = cindex[p3], cindex[p3] = cindex[p1], cindex[p1] = k, W[len + i] = pn - p1 + 1, h = (0 > h ? -h : h) % n, W[next + i] = W[hhead + h], W[hhead + h] = i, last[i] = h);}for (W[degree + k] = dk, lemax = Math.max(lemax, dk), mark = _wclear(mark + lemax, lemax, W, w, n), pk = pk1; pk < pk2; pk++) if (i = cindex[pk], !(0 <= W[nv + i])) for (h = last[i], i = W[hhead + h], W[hhead + h] = -1; -1 !== i && -1 !== W[next + i]; i = W[next + i], mark++) {for (ln = W[len + i], eln = W[elen + i], p = cptr[i] + 1; p <= cptr[i] + ln - 1; p++) W[w + cindex[p]] = mark;var jlast = i;for (j = W[next + i]; -1 !== j;) {var ok = W[len + j] === ln && W[elen + j] === eln;for (p = cptr[j] + 1; ok && p <= cptr[j] + ln - 1; p++) W[w + cindex[p]] !== mark && (ok = 0);ok ? (cptr[j] = (0, _csFlip.csFlip)(i), W[nv + i] += W[nv + j], W[nv + j] = 0, W[elen + j] = -1, j = W[next + j], W[next + jlast] = j) : (jlast = j, j = W[next + j]);}}for (p = pk1, pk = pk1; pk < pk2; pk++) (i = cindex[pk], !(0 >= (nvi = -W[nv + i]))) && (W[nv + i] = nvi, d = W[degree + i] + dk - nvi, d = Math.min(d, n - nel - nvi), -1 !== W[head + d] && (last[W[head + d]] = i), W[next + i] = W[head + d], last[i] = -1, W[head + d] = i, mindeg = Math.min(mindeg, d), W[degree + i] = d, cindex[p++] = i);W[nv + k] = nvk, 0 == (W[len + k] = p - pk1) && (cptr[k] = -1, W[w + k] = 0), 0 !== elenk && (cnz = p);}for (i = 0; i < n; i++) cptr[i] = (0, _csFlip.csFlip)(cptr[i]);for (j = 0; j <= n; j++) W[head + j] = -1;for (j = n; 0 <= j; j--) 0 < W[nv + j] || (W[next + j] = W[head + cptr[j]], W[head + cptr[j]] = j);for (e = n; 0 <= e; e--) 0 >= W[nv + e] || -1 !== cptr[e] && (W[next + e] = W[head + cptr[e]], W[head + cptr[e]] = e);for (k = 0, i = 0; i <= n; i++) -1 === cptr[i] && (k = (0, _csTdfs.csTdfs)(i, k, W, head, next, P, w));return P.splice(P.length - 1, 1), P;};});exports.createCsAmd = createCsAmd;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csCounts.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCsCounts = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_csLeaf = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csLeaf.js"),name = "csCounts",dependencies = ["transpose"],createCsCounts = (0, _factory.factory)(name, dependencies, function (_ref) {var transpose = _ref.transpose;return function (a, parent, post, ata) {if (!a || !parent || !post) return null;var i,j,k,J,p,p0,p1,asize = a._size,m = asize[0],n = asize[1],s = 4 * n + (ata ? n + m + 1 : 0),w = [],ancestor = 0,first = 3 * n,head = 4 * n,next = 5 * n + 1;for (k = 0; k < s; k++) w[k] = -1;var colcount = [],at = transpose(a),tindex = at._index,tptr = at._ptr;for (k = 0; k < n; k++) for (j = post[k], colcount[j] = -1 === w[first + j] ? 1 : 0; -1 !== j && -1 === w[first + j]; j = parent[j]) w[first + j] = k;if (ata) {for (k = 0; k < n; k++) w[post[k]] = k;for (i = 0; i < m; i++) {for (k = n, p0 = tptr[i], p1 = tptr[i + 1], p = p0; p < p1; p++) k = Math.min(k, w[tindex[p]]);w[next + i] = w[head + k], w[head + k] = i;}}for (i = 0; i < n; i++) w[ancestor + i] = i;for (k = 0; k < n; k++) {for (j = post[k], -1 !== parent[j] && colcount[parent[j]]--, J = ata ? w[head + k] : j; -1 !== J; J = ata ? w[next + J] : -1) for (p = tptr[J]; p < tptr[J + 1]; p++) {i = tindex[p];var r = (0, _csLeaf.csLeaf)(i, j, w, first, n, 2 * n, ancestor);1 <= r.jleaf && colcount[j]++, 2 === r.jleaf && colcount[r.q]--;}-1 !== parent[j] && (w[ancestor + j] = parent[j]);}for (j = 0; j < n; j++) -1 !== parent[j] && (colcount[parent[j]] += colcount[j]);return colcount;};});exports.createCsCounts = createCsCounts;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csDfs.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csDfs = csDfs;var _csMarked = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csMarked.js"),_csMark = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csMark.js"),_csUnflip = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csUnflip.js");function csDfs(j, g, top, xi, pinv) {var i,p,p2,index = g._index,ptr = g._ptr,size = g._size,n = size[1],head = 0;for (xi[0] = j; 0 <= head;) {j = xi[head];var jnew = pinv ? pinv[j] : j;(0, _csMarked.csMarked)(ptr, j) || ((0, _csMark.csMark)(ptr, j), xi[n + head] = 0 > jnew ? 0 : (0, _csUnflip.csUnflip)(ptr[jnew]));var done = 1;for (p = xi[n + head], p2 = 0 > jnew ? 0 : (0, _csUnflip.csUnflip)(ptr[jnew + 1]); p < p2; p++) if (i = index[p], !(0, _csMarked.csMarked)(ptr, i)) {xi[n + head] = p, xi[++head] = i, done = 0;break;}done && (head--, xi[--top] = j);}return top;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csEtree.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csEtree = csEtree;function csEtree(a, ata) {if (!a) return null;var i,inext,aindex = a._index,aptr = a._ptr,asize = a._size,m = asize[0],n = asize[1],parent = [],w = [],ancestor = 0,prev = n;if (ata) for (i = 0; i < m; i++) w[prev + i] = -1;for (var k = 0; k < n; k++) {parent[k] = -1, w[ancestor + k] = -1;for (var r, p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {for (r = aindex[p], i = ata ? w[prev + r] : r; -1 !== i && i < k; i = inext) inext = w[ancestor + i], w[ancestor + i] = k, -1 === inext && (parent[i] = k);ata && (w[prev + r] = k);}}return parent;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csFkeep.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csFkeep = csFkeep;function csFkeep(a, callback, other) {for (var p, avalues = a._values, aindex = a._index, aptr = a._ptr, asize = a._size, n = asize[1], nz = 0, j = 0; j < n; j++) for (p = aptr[j], aptr[j] = nz; p < aptr[j + 1]; p++) callback(aindex[p], j, avalues ? avalues[p] : 1, other) && (aindex[nz] = aindex[p], avalues && (avalues[nz] = avalues[p]), nz++);return aptr[n] = nz, aindex.splice(nz, aindex.length - nz), avalues && avalues.splice(nz, avalues.length - nz), nz;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csFlip = csFlip;function csFlip(i) {return -i - 2;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csIpvec.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csIpvec = csIpvec;function csIpvec(p, b) {var k,n = b.length,x = [];if (p) for (k = 0; k < n; k++) x[p[k]] = b[k];else for (k = 0; k < n; k++) x[k] = b[k];return x;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csLeaf.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csLeaf = csLeaf;function csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor) {var s,sparent,q,jleaf = 0;if (i <= j || w[first + j] <= w[maxfirst + i]) return -1;w[maxfirst + i] = w[first + j];var jprev = w[prevleaf + i];if (w[prevleaf + i] = j, -1 === jprev) jleaf = 1, q = i;else {for (jleaf = 2, q = jprev; q !== w[ancestor + q]; q = w[ancestor + q]);for (s = jprev; s !== q; s = sparent) sparent = w[ancestor + s], w[ancestor + s] = q;}return { jleaf: jleaf, q: q };}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csLu.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCsLu = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_csSpsolve = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csSpsolve.js"),name = "csLu",dependencies = ["abs", "divideScalar", "multiply", "subtract", "larger", "largerEq", "SparseMatrix"],createCsLu = (0, _factory.factory)(name, dependencies, function (_ref) {var abs = _ref.abs,divideScalar = _ref.divideScalar,multiply = _ref.multiply,subtract = _ref.subtract,larger = _ref.larger,largerEq = _ref.largerEq,SparseMatrix = _ref.SparseMatrix,csSpsolve = (0, _csSpsolve.createCsSpsolve)({ divideScalar: divideScalar, multiply: multiply, subtract: subtract });return function (m, s, tol) {if (!m) return null;var q,size = m._size,n = size[1],lnz = 100,unz = 100;s && (q = s.q, lnz = s.lnz || lnz, unz = s.unz || unz);var i,p,lvalues = [],lindex = [],lptr = [],L = new SparseMatrix({ values: lvalues, index: lindex, ptr: lptr, size: [n, n] }),uvalues = [],uindex = [],uptr = [],U = new SparseMatrix({ values: uvalues, index: uindex, ptr: uptr, size: [n, n] }),pinv = [],x = [],xi = [];for (i = 0; i < n; i++) x[i] = 0, pinv[i] = -1, lptr[i + 1] = 0;lnz = 0, unz = 0;for (var k = 0; k < n; k++) {lptr[k] = lnz, uptr[k] = unz;var col = q ? q[k] : k,top = csSpsolve(L, m, col, xi, x, pinv, 1),ipiv = -1,a = -1;for (p = top; p < n; p++) if (i = xi[p], 0 > pinv[i]) {var xabs = abs(x[i]);larger(xabs, a) && (a = xabs, ipiv = i);} else uindex[unz] = pinv[i], uvalues[unz++] = x[i];if (-1 === ipiv || 0 >= a) return null;0 > pinv[col] && largerEq(abs(x[col]), multiply(a, tol)) && (ipiv = col);var pivot = x[ipiv];for (uindex[unz] = k, uvalues[unz++] = pivot, pinv[ipiv] = k, lindex[lnz] = ipiv, lvalues[lnz++] = 1, p = top; p < n; p++) i = xi[p], 0 > pinv[i] && (lindex[lnz] = i, lvalues[lnz++] = divideScalar(x[i], pivot)), x[i] = 0;}for (lptr[n] = lnz, uptr[n] = unz, p = 0; p < lnz; p++) lindex[p] = pinv[lindex[p]];return lvalues.splice(lnz, lvalues.length - lnz), lindex.splice(lnz, lindex.length - lnz), uvalues.splice(unz, uvalues.length - unz), uindex.splice(unz, uindex.length - unz), { L: L, U: U, pinv: pinv };};});exports.createCsLu = createCsLu;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csMark.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csMark = csMark;var _csFlip = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js");function csMark(w, j) {w[j] = (0, _csFlip.csFlip)(w[j]);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csMarked.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csMarked = csMarked;function csMarked(w, j) {return 0 > w[j];}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csPermute.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csPermute = csPermute;function csPermute(a, pinv, q, values) {for (var avalues = a._values, aindex = a._index, aptr = a._ptr, asize = a._size, adt = a._datatype, m = asize[0], n = asize[1], cvalues = values && a._values ? [] : null, cindex = [], cptr = [], nz = 0, k = 0; k < n; k++) {cptr[k] = nz;for (var r, j = q ? q[k] : k, t0 = aptr[j], t1 = aptr[j + 1], t = t0; t < t1; t++) r = pinv ? pinv[aindex[t]] : aindex[t], cindex[nz] = r, cvalues && (cvalues[nz] = avalues[t]), nz++;}return cptr[n] = nz, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [m, n], datatype: adt });}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csPost.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csPost = csPost;var _csTdfs = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csTdfs.js");function csPost(parent, n) {if (!parent) return null;var j,k = 0,post = [],w = [],head = 0,next = n;for (j = 0; j < n; j++) w[head + j] = -1;for (j = n - 1; 0 <= j; j--) -1 !== parent[j] && (w[next + j] = w[head + parent[j]], w[head + parent[j]] = j);for (j = 0; j < n; j++) -1 === parent[j] && (k = (0, _csTdfs.csTdfs)(j, k, w, head, next, post, 2 * n));return post;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csReach.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csReach = csReach;var _csMarked = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csMarked.js"),_csMark = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csMark.js"),_csDfs = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csDfs.js");function csReach(g, b, k, xi, pinv) {var p,p0,p1,gptr = g._ptr,gsize = g._size,bindex = b._index,bptr = b._ptr,n = gsize[1],top = n;for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {var i = bindex[p];(0, _csMarked.csMarked)(gptr, i) || (top = (0, _csDfs.csDfs)(i, g, top, xi, pinv));}for (p = top; p < n; p++) (0, _csMark.csMark)(gptr, xi[p]);return top;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csSpsolve.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCsSpsolve = void 0;var _csReach = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csReach.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "csSpsolve",dependencies = ["divideScalar", "multiply", "subtract"],createCsSpsolve = (0, _factory.factory)(name, dependencies, function (_ref) {var divideScalar = _ref.divideScalar,multiply = _ref.multiply,subtract = _ref.subtract;return function (g, b, k, xi, x, pinv, lo) {var p,p0,p1,q,gvalues = g._values,gindex = g._index,gptr = g._ptr,gsize = g._size,n = gsize[1],bvalues = b._values,bindex = b._index,bptr = b._ptr,top = (0, _csReach.csReach)(g, b, k, xi, pinv);for (p = top; p < n; p++) x[xi[p]] = 0;for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) x[bindex[p]] = bvalues[p];for (var px = top; px < n; px++) {var j = xi[px],J = pinv ? pinv[j] : j;if (!(0 > J)) for (p0 = gptr[J], p1 = gptr[J + 1], x[j] = divideScalar(x[j], gvalues[lo ? p0 : p1 - 1]), p = lo ? p0 + 1 : p0, q = lo ? p1 : p1 - 1; p < q; p++) {var i = gindex[p];x[i] = subtract(x[i], multiply(gvalues[p], x[j]));}}return top;};});exports.createCsSpsolve = createCsSpsolve;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csSqr.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCsSqr = void 0;var _csPermute = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csPermute.js"),_csPost = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csPost.js"),_csEtree = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csEtree.js"),_csAmd = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csAmd.js"),_csCounts = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csCounts.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "csSqr",dependencies = ["add", "multiply", "transpose"],createCsSqr = (0, _factory.factory)(name, dependencies, function (_ref) {function _vcount(a, s) {var aptr = a._ptr,aindex = a._index,asize = a._size,m = asize[0],n = asize[1];s.pinv = [], s.leftmost = [];var i,k,p,p0,p1,parent = s.parent,pinv = s.pinv,leftmost = s.leftmost,w = [],next = 0,head = m,tail = m + n,nque = m + 2 * n;for (k = 0; k < n; k++) w[head + k] = -1, w[tail + k] = -1, w[nque + k] = 0;for (i = 0; i < m; i++) leftmost[i] = -1;for (k = n - 1; 0 <= k; k--) for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) leftmost[aindex[p]] = k;for (i = m - 1; 0 <= i; i--) (pinv[i] = -1, k = leftmost[i], -1 !== k) && (0 == w[nque + k]++ && (w[tail + k] = i), w[next + i] = w[head + k], w[head + k] = i);for (s.lnz = 0, s.m2 = m, k = 0; k < n; k++) if (i = w[head + k], s.lnz++, 0 > i && (i = s.m2++), pinv[i] = k, !(0 >= --nque[k])) {s.lnz += w[nque + k];var pa = parent[k];-1 !== pa && (0 === w[nque + pa] && (w[tail + pa] = w[tail + k]), w[next + w[tail + k]] = w[head + pa], w[head + pa] = w[next + i], w[nque + pa] += w[nque + k]);}for (i = 0; i < m; i++) 0 > pinv[i] && (pinv[i] = k++);return !0;}var add = _ref.add,multiply = _ref.multiply,transpose = _ref.transpose,csAmd = (0, _csAmd.createCsAmd)({ add: add, multiply: multiply, transpose: transpose }),csCounts = (0, _csCounts.createCsCounts)({ transpose: transpose });return function (order, a, qr) {var k,aptr = a._ptr,asize = a._size,n = asize[1],s = {};if (s.q = csAmd(order, a), order && !s.q) return null;if (qr) {var c = order ? (0, _csPermute.csPermute)(a, null, s.q, 0) : a;s.parent = (0, _csEtree.csEtree)(c, 1);var post = (0, _csPost.csPost)(s.parent, n);if (s.cp = csCounts(c, s.parent, post, 1), c && s.parent && s.cp && _vcount(c, s)) for (s.unz = 0, k = 0; k < n; k++) s.unz += s.cp[k];} else s.unz = 4 * aptr[n] + n, s.lnz = s.unz;return s;};});exports.createCsSqr = createCsSqr;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csTdfs.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csTdfs = csTdfs;function csTdfs(j, k, w, head, next, post, stack) {var top = 0;for (w[stack] = j; 0 <= top;) {var p = w[stack + top],i = w[head + p];-1 === i ? (top--, post[k++] = p) : (w[head + p] = w[next + i], ++top, w[stack + top] = i);}return k;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/algebra/sparse/csUnflip.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.csUnflip = csUnflip;var _csFlip = __webpack_require__("./node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js");function csUnflip(i) {return 0 > i ? (0, _csFlip.csFlip)(i) : i;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/abs.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAbs = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "abs",dependencies = ["typed"],createAbs = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.absNumber, Complex: function (x) {return x.abs();}, BigNumber: function (x) {return x.abs();}, Fraction: function (x) {return x.abs();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, Unit: function (x) {return x.abs();} });});exports.createAbs = createAbs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/add.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAdd = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm01.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm04.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm10.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "add",dependencies = ["typed", "matrix", "addScalar", "equalScalar", "DenseMatrix", "SparseMatrix"],createAdd = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,addScalar = _ref.addScalar,equalScalar = _ref.equalScalar,DenseMatrix = _ref.DenseMatrix,SparseMatrix = _ref.SparseMatrix,algorithm01 = (0, _algorithm.createAlgorithm01)({ typed: typed }),algorithm04 = (0, _algorithm2.createAlgorithm04)({ typed: typed, equalScalar: equalScalar }),algorithm10 = (0, _algorithm3.createAlgorithm10)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm4.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm5.createAlgorithm14)({ typed: typed });return typed(name, (0, _object.extend)({ "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, addScalar);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, addScalar, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm01(y, x, addScalar, !0);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm04(x, y, addScalar);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, addScalar, !1);}, "SparseMatrix, any": function (x, y) {return algorithm10(x, y, addScalar, !1);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, addScalar, !0);}, "any, SparseMatrix": function (x, y) {return algorithm10(y, x, addScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, addScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, addScalar, !0).valueOf();}, "any, any": addScalar, "any, any, ...any": function (x, y, rest) {for (var result = this(x, y), i = 0; i < rest.length; i++) result = this(result, rest[i]);return result;} }, addScalar.signatures));});exports.createAdd = createAdd;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/addScalar.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAddScalar = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "addScalar",dependencies = ["typed"],createAddScalar = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "number, number": _index.addNumber, "Complex, Complex": function (x, y) {return x.add(y);}, "BigNumber, BigNumber": function (x, y) {return x.plus(y);}, "Fraction, Fraction": function (x, y) {return x.add(y);}, "Unit, Unit": function (x, y) {if (null === x.value || void 0 === x.value) throw new Error("Parameter x contains a unit with undefined value");if (null === y.value || void 0 === y.value) throw new Error("Parameter y contains a unit with undefined value");if (!x.equalBase(y)) throw new Error("Units do not match");var res = x.clone();return res.value = this(res.value, y.value), res.fixPrefix = !1, res;} });});exports.createAddScalar = createAddScalar;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/cbrt.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCbrt = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "cbrt",dependencies = ["config", "typed", "isNegative", "unaryMinus", "matrix", "Complex", "BigNumber", "Fraction"],createCbrt = (0, _factory.factory)(name, dependencies, function (_ref) {function _cbrtComplex(x, allRoots) {var arg3 = x.arg() / 3,abs = x.abs(),principal = new Complex((0, _index.cbrtNumber)(abs), 0).mul(new Complex(0, arg3).exp());if (allRoots) {var all = [principal, new Complex((0, _index.cbrtNumber)(abs), 0).mul(new Complex(0, arg3 + 2 * Math.PI / 3).exp()), new Complex((0, _index.cbrtNumber)(abs), 0).mul(new Complex(0, arg3 - 2 * Math.PI / 3).exp())];return "Array" === config.matrix ? all : matrix(all);}return principal;}var config = _ref.config,typed = _ref.typed,isNegative = _ref.isNegative,unaryMinus = _ref.unaryMinus,matrix = _ref.matrix,Complex = _ref.Complex,BigNumber = _ref.BigNumber,Fraction = _ref.Fraction;return typed(name, { number: _index.cbrtNumber, Complex: _cbrtComplex, "Complex, boolean": _cbrtComplex, BigNumber: function (x) {return x.cbrt();}, Unit: function (x) {if (x.value && (0, _is.isComplex)(x.value)) {var result = x.clone();return result.value = 1, result = result.pow(1 / 3), result.value = _cbrtComplex(x.value), result;}var negate = isNegative(x.value);negate && (x.value = unaryMinus(x.value));var third = (0, _is.isBigNumber)(x.value) ? new BigNumber(1).div(3) : (0, _is.isFraction)(x.value) ? new Fraction(1, 3) : 1 / 3;var _result = x.pow(third);return negate && (_result.value = unaryMinus(_result.value)), _result;}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createCbrt = createCbrt;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/ceil.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCeil = void 0;var _slicedToArray2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js")),_decimal = _interopRequireDefault(__webpack_require__("./node_modules/decimal.js/decimal.mjs")),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_nearlyEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "ceil",dependencies = ["typed", "config", "round", "matrix", "equalScalar"],createCeil = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,round = _ref.round,matrix = _ref.matrix,equalScalar = _ref.equalScalar,algorithm11 = (0, _algorithm.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm14 = (0, _algorithm2.createAlgorithm14)({ typed: typed });return typed("ceil", { number: function (x) {return (0, _number.nearlyEqual)(x, round(x), config.epsilon) ? round(x) : (0, _index.ceilNumber)(x);}, "number, number": function (x, n) {if ((0, _number.nearlyEqual)(x, round(x, n), config.epsilon)) return round(x, n);var _$split = "".concat(x, "e").split("e"),_$split2 = (0, _slicedToArray2["default"])(_$split, 2),number = _$split2[0],exponent = _$split2[1],result = Math.ceil(+"".concat(number, "e").concat(+exponent + n)),_$split3 = "".concat(result, "e").split("e"),_$split4 = (0, _slicedToArray2["default"])(_$split3, 2);return number = _$split4[0], exponent = _$split4[1], +"".concat(number, "e").concat(+exponent - n);}, Complex: function (x) {return x.ceil();}, "Complex, number": function (x, n) {return x.ceil(n);}, BigNumber: function (x) {return (0, _nearlyEqual.nearlyEqual)(x, round(x), config.epsilon) ? round(x) : x.ceil();}, "BigNumber, BigNumber": function (x, n) {return (0, _nearlyEqual.nearlyEqual)(x, round(x, n), config.epsilon) ? round(x, n) : x.toDecimalPlaces(n.toNumber(), _decimal["default"].ROUND_CEIL);}, Fraction: function (x) {return x.ceil();}, "Fraction, number": function (x, n) {return x.ceil(n);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, "Array | Matrix, number": function (x, n) {var _this = this;return (0, _collection.deepMap)(x, function (i) {return _this(i, n);}, !0);}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | Complex | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createCeil = createCeil;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/cube.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCube = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "cube",dependencies = ["typed"],createCube = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.cubeNumber, Complex: function (x) {return x.mul(x).mul(x);}, BigNumber: function (x) {return x.times(x).times(x);}, Fraction: function (x) {return x.pow(3);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, Unit: function (x) {return x.pow(3);} });});exports.createCube = createCube;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/divide.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDivide = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "divide",dependencies = ["typed", "matrix", "multiply", "equalScalar", "divideScalar", "inv"],createDivide = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,multiply = _ref.multiply,equalScalar = _ref.equalScalar,divideScalar = _ref.divideScalar,inv = _ref.inv,algorithm11 = (0, _algorithm.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm14 = (0, _algorithm2.createAlgorithm14)({ typed: typed });return typed("divide", (0, _object.extend)({ "Array | Matrix, Array | Matrix": function (x, y) {return multiply(x, inv(y));}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, divideScalar, !1);}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, divideScalar, !1);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, divideScalar, !1).valueOf();}, "any, Array | Matrix": function (x, y) {return multiply(x, inv(y));} }, divideScalar.signatures));});exports.createDivide = createDivide;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/divideScalar.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDivideScalar = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "divideScalar",dependencies = ["typed", "numeric"],createDivideScalar = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,numeric = _ref.numeric;return typed(name, { "number, number": function (x, y) {return x / y;}, "Complex, Complex": function (x, y) {return x.div(y);}, "BigNumber, BigNumber": function (x, y) {return x.div(y);}, "Fraction, Fraction": function (x, y) {return x.div(y);}, "Unit, number | Fraction | BigNumber": function (x, y) {var res = x.clone(),one = numeric(1, (0, _is.typeOf)(y));return res.value = this(null === res.value ? res._normalize(one) : res.value, y), res;}, "number | Fraction | BigNumber, Unit": function (x, y) {var res = y.clone();res = res.pow(-1);var one = numeric(1, (0, _is.typeOf)(x));return res.value = this(x, null === y.value ? y._normalize(one) : y.value), res;}, "Unit, Unit": function (x, y) {return x.divide(y);} });});exports.createDivideScalar = createDivideScalar;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/dotDivide.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDotDivide = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm6 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm7 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "dotDivide",dependencies = ["typed", "matrix", "equalScalar", "divideScalar", "DenseMatrix"],createDotDivide = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,divideScalar = _ref.divideScalar,DenseMatrix = _ref.DenseMatrix,algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm03 = (0, _algorithm2.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm3.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm11 = (0, _algorithm4.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm12 = (0, _algorithm5.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm6.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm7.createAlgorithm14)({ typed: typed });return typed(name, { "any, any": divideScalar, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, divideScalar, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, divideScalar, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, divideScalar, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, divideScalar);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, divideScalar, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, divideScalar, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, divideScalar, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, divideScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, divideScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, divideScalar, !0).valueOf();} });});exports.createDotDivide = createDotDivide;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/dotMultiply.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDotMultiply = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm09.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "dotMultiply",dependencies = ["typed", "matrix", "equalScalar", "multiplyScalar"],createDotMultiply = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,multiplyScalar = _ref.multiplyScalar,algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm09 = (0, _algorithm2.createAlgorithm09)({ typed: typed, equalScalar: equalScalar }),algorithm11 = (0, _algorithm3.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm13 = (0, _algorithm4.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm5.createAlgorithm14)({ typed: typed });return typed(name, { "any, any": multiplyScalar, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm09(x, y, multiplyScalar, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, multiplyScalar, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm02(x, y, multiplyScalar, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, multiplyScalar);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, multiplyScalar, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, multiplyScalar, !1);}, "any, SparseMatrix": function (x, y) {return algorithm11(y, x, multiplyScalar, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, multiplyScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, multiplyScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, multiplyScalar, !0).valueOf();} });});exports.createDotMultiply = createDotMultiply;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/dotPow.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDotPow = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm6 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "dotPow",dependencies = ["typed", "equalScalar", "matrix", "pow", "DenseMatrix"],createDotPow = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,equalScalar = _ref.equalScalar,matrix = _ref.matrix,pow = _ref.pow,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm2.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm11 = (0, _algorithm3.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm12 = (0, _algorithm4.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm5.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm6.createAlgorithm14)({ typed: typed });return typed(name, { "any, any": pow, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, pow, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, pow, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, pow, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, pow);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createDotPow = createDotPow;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/exp.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createExp = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "exp",dependencies = ["typed"],createExp = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.expNumber, Complex: function (x) {return x.exp();}, BigNumber: function (x) {return x.exp();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createExp = createExp;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/expm1.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createExpm1 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "expm1",dependencies = ["typed", "Complex"],createExpm1 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_Complex = _ref.Complex;return typed(name, { number: _index.expm1Number, Complex: function (x) {var r = Math.exp(x.re);return new _Complex(r * Math.cos(x.im) - 1, r * Math.sin(x.im));}, BigNumber: function (x) {return x.exp().minus(1);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createExpm1 = createExpm1;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/fix.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFix = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "fix",dependencies = ["typed", "Complex", "matrix", "ceil", "floor"],createFix = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_Complex = _ref.Complex,matrix = _ref.matrix,ceil = _ref.ceil,floor = _ref.floor,algorithm14 = (0, _algorithm.createAlgorithm14)({ typed: typed });return typed("fix", { number: function (x) {return 0 < x ? floor(x) : ceil(x);}, "number, number | BigNumber": function (x, n) {return 0 < x ? floor(x, n) : ceil(x, n);}, Complex: function (x) {return new _Complex(0 < x.re ? Math.floor(x.re) : Math.ceil(x.re), 0 < x.im ? Math.floor(x.im) : Math.ceil(x.im));}, "Complex, number | BigNumber": function (x, n) {return new _Complex(0 < x.re ? floor(x.re, n) : ceil(x.re, n), 0 < x.im ? floor(x.im, n) : ceil(x.im, n));}, BigNumber: function (x) {return x.isNegative() ? ceil(x) : floor(x);}, "BigNumber, number | BigNumber": function (x, n) {return x.isNegative() ? ceil(x, n) : floor(x, n);}, Fraction: function (x) {return 0 > x.s ? x.ceil() : x.floor();}, "Fraction, number | BigNumber": function (x, n) {return 0 > x.s ? x.ceil(n) : x.floor(n);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, "Array | Matrix, number | BigNumber": function (x, n) {var _this = this;return (0, _collection.deepMap)(x, function (i) {return _this(i, n);}, !0);}, "number | Complex | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createFix = createFix;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/floor.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFloor = void 0;var _slicedToArray2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js")),_decimal = _interopRequireDefault(__webpack_require__("./node_modules/decimal.js/decimal.mjs")),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_nearlyEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "floor",dependencies = ["typed", "config", "round", "matrix", "equalScalar"],createFloor = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,round = _ref.round,matrix = _ref.matrix,equalScalar = _ref.equalScalar,algorithm11 = (0, _algorithm.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm14 = (0, _algorithm2.createAlgorithm14)({ typed: typed });return typed("floor", { number: function (x) {return (0, _number.nearlyEqual)(x, round(x), config.epsilon) ? round(x) : Math.floor(x);}, "number, number": function (x, n) {if ((0, _number.nearlyEqual)(x, round(x, n), config.epsilon)) return round(x, n);var _$split = "".concat(x, "e").split("e"),_$split2 = (0, _slicedToArray2["default"])(_$split, 2),number = _$split2[0],exponent = _$split2[1],result = Math.floor(+"".concat(number, "e").concat(+exponent + n)),_$split3 = "".concat(result, "e").split("e"),_$split4 = (0, _slicedToArray2["default"])(_$split3, 2);return number = _$split4[0], exponent = _$split4[1], +"".concat(number, "e").concat(+exponent - n);}, Complex: function (x) {return x.floor();}, "Complex, number": function (x, n) {return x.floor(n);}, BigNumber: function (x) {return (0, _nearlyEqual.nearlyEqual)(x, round(x), config.epsilon) ? round(x) : x.floor();}, "BigNumber, BigNumber": function (x, n) {return (0, _nearlyEqual.nearlyEqual)(x, round(x, n), config.epsilon) ? round(x, n) : x.toDecimalPlaces(n.toNumber(), _decimal["default"].ROUND_FLOOR);}, Fraction: function (x) {return x.floor();}, "Fraction, number": function (x, n) {return x.floor(n);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, "Array | Matrix, number": function (x, n) {var _this = this;return (0, _collection.deepMap)(x, function (i) {return _this(i, n);}, !0);}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | Complex | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createFloor = createFloor;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/gcd.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createGcd = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm01.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm04.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm10.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "gcd",dependencies = ["typed", "matrix", "equalScalar", "BigNumber", "DenseMatrix"],createGcd = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,BigNumber = _ref.BigNumber,DenseMatrix = _ref.DenseMatrix,algorithm01 = (0, _algorithm.createAlgorithm01)({ typed: typed }),algorithm04 = (0, _algorithm2.createAlgorithm04)({ typed: typed, equalScalar: equalScalar }),algorithm10 = (0, _algorithm3.createAlgorithm10)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm4.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm5.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.gcdNumber, "BigNumber, BigNumber": function (a, b) {if (!a.isInt() || !b.isInt()) throw new Error("Parameters in function gcd must be integer numbers");for (var zero = new BigNumber(0); !b.isZero();) {var r = a.mod(b);a = b, b = r;}return a.lt(zero) ? a.neg() : a;}, "Fraction, Fraction": function (x, y) {return x.gcd(y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm04(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm01(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm10(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return algorithm10(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "number | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();}, "Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber": function (a, b, args) {for (var res = this(a, b), i = 0; i < args.length; i++) res = this(res, args[i]);return res;} });});exports.createGcd = createGcd;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/hypot.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createHypot = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),name = "hypot",dependencies = ["typed", "abs", "addScalar", "divideScalar", "multiplyScalar", "sqrt", "smaller", "isPositive"],createHypot = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,abs = _ref.abs,addScalar = _ref.addScalar,divideScalar = _ref.divideScalar,multiplyScalar = _ref.multiplyScalar,sqrt = _ref.sqrt,smaller = _ref.smaller,isPositive = _ref.isPositive;return typed(name, { "... number | BigNumber": function (args) {for (var value, result = 0, largest = 0, i = 0; i < args.length; i++) value = abs(args[i]), smaller(largest, value) ? (result = multiplyScalar(result, multiplyScalar(divideScalar(largest, value), divideScalar(largest, value))), result = addScalar(result, 1), largest = value) : result = addScalar(result, isPositive(value) ? multiplyScalar(divideScalar(value, largest), divideScalar(value, largest)) : value);return multiplyScalar(largest, sqrt(result));}, Array: function (x) {return this.apply(this, (0, _array.flatten)(x));}, Matrix: function (x) {return this.apply(this, (0, _array.flatten)(x.toArray()));} });});exports.createHypot = createHypot;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/lcm.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLcm = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm06.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "lcm",dependencies = ["typed", "matrix", "equalScalar"],createLcm = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm06 = (0, _algorithm2.createAlgorithm06)({ typed: typed, equalScalar: equalScalar }),algorithm11 = (0, _algorithm3.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm13 = (0, _algorithm4.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm5.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.lcmNumber, "BigNumber, BigNumber": function (a, b) {if (!a.isInt() || !b.isInt()) throw new Error("Parameters in function lcm must be integer numbers");if (a.isZero()) return a;if (b.isZero()) return b;for (var prod = a.times(b); !b.isZero();) {var t = b;b = a.mod(t), a = t;}return prod.div(a).abs();}, "Fraction, Fraction": function (x, y) {return x.lcm(y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm06(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm02(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return algorithm11(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "number | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();}, "Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber": function (a, b, args) {for (var res = this(a, b), i = 0; i < args.length; i++) res = this(res, args[i]);return res;} });});exports.createLcm = createLcm;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/log.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLog = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "log",dependencies = ["config", "typed", "divideScalar", "Complex"],createLog = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,divideScalar = _ref.divideScalar,Complex = _ref.Complex;return typed(name, { number: function (x) {return 0 <= x || config.predictable ? (0, _index.logNumber)(x) : new Complex(x, 0).log();}, Complex: function (x) {return x.log();}, BigNumber: function (x) {return !x.isNegative() || config.predictable ? x.ln() : new Complex(x.toNumber(), 0).log();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);}, "any, any": function (x, base) {return divideScalar(this(x), this(base));} });});exports.createLog = createLog;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/log10.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLog10 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "log10",dependencies = ["typed", "config", "Complex"],createLog10 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,_Complex = _ref.Complex;return typed(name, { number: function (x) {return 0 <= x || config.predictable ? (0, _index.log10Number)(x) : new _Complex(x, 0).log().div(Math.LN10);}, Complex: function (x) {return new _Complex(x).log().div(Math.LN10);}, BigNumber: function (x) {return !x.isNegative() || config.predictable ? x.log() : new _Complex(x.toNumber(), 0).log().div(Math.LN10);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createLog10 = createLog10;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/log1p.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLog1p = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),name = "log1p",dependencies = ["typed", "config", "divideScalar", "log", "Complex"],createLog1p = (0, _factory.factory)(name, dependencies, function (_ref) {function _log1pComplex(x) {var xRe1p = x.re + 1;return new Complex(Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)), Math.atan2(x.im, xRe1p));}var typed = _ref.typed,config = _ref.config,divideScalar = _ref.divideScalar,log = _ref.log,Complex = _ref.Complex;return typed(name, { number: function (x) {return -1 <= x || config.predictable ? (0, _number.log1p)(x) : _log1pComplex(new Complex(x, 0));}, Complex: _log1pComplex, BigNumber: function (x) {var y = x.plus(1);return !y.isNegative() || config.predictable ? y.ln() : _log1pComplex(new Complex(x.toNumber(), 0));}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);}, "any, any": function (x, base) {return divideScalar(this(x), log(base));} });});exports.createLog1p = createLog1p;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/log2.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLog2 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "log2",dependencies = ["typed", "config", "Complex"],createLog2 = (0, _factory.factory)(name, dependencies, function (_ref) {function _log2Complex(x) {var newX = Math.sqrt(x.re * x.re + x.im * x.im);return new Complex(Math.log2 ? Math.log2(newX) : Math.log(newX) / Math.LN2, Math.atan2(x.im, x.re) / Math.LN2);}var typed = _ref.typed,config = _ref.config,Complex = _ref.Complex;return typed(name, { number: function (x) {return 0 <= x || config.predictable ? (0, _index.log2Number)(x) : _log2Complex(new Complex(x, 0));}, Complex: _log2Complex, BigNumber: function (x) {return !x.isNegative() || config.predictable ? x.log(2) : _log2Complex(new Complex(x.toNumber(), 0));}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createLog2 = createLog2;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/mod.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMod = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm05.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm6 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm7 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "mod",dependencies = ["typed", "matrix", "equalScalar", "DenseMatrix"],createMod = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,DenseMatrix = _ref.DenseMatrix,algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm03 = (0, _algorithm2.createAlgorithm03)({ typed: typed }),algorithm05 = (0, _algorithm3.createAlgorithm05)({ typed: typed, equalScalar: equalScalar }),algorithm11 = (0, _algorithm4.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm12 = (0, _algorithm5.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm6.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm7.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.modNumber, "BigNumber, BigNumber": function (x, y) {if (y.isNeg()) throw new Error("Cannot calculate mod for a negative divisor");return y.isZero() ? x : x.mod(y);}, "Fraction, Fraction": function (x, y) {if (0 > y.compare(0)) throw new Error("Cannot calculate mod for a negative divisor");return 0 <= x.compare(0) ? x.mod(y) : x.mod(y).add(y).mod(y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm05(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createMod = createMod;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/multiply.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMultiply = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "multiply",dependencies = ["typed", "matrix", "addScalar", "multiplyScalar", "equalScalar", "dot"],createMultiply = (0, _factory.factory)(name, dependencies, function (_ref) {function _validateMatrixDimensions(size1, size2) {switch (size1.length) {case 1:switch (size2.length) {case 1:if (size1[0] !== size2[0]) throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if (size1[0] !== size2[0]) throw new RangeError("Dimension mismatch in multiplication. Vector length (" + size1[0] + ") must match Matrix rows (" + size2[0] + ")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has " + size2.length + " dimensions)");}break;case 2:switch (size2.length) {case 1:if (size1[1] !== size2[0]) throw new RangeError("Dimension mismatch in multiplication. Matrix columns (" + size1[1] + ") must match Vector length (" + size2[0] + ")");break;case 2:if (size1[1] !== size2[0]) throw new RangeError("Dimension mismatch in multiplication. Matrix A columns (" + size1[1] + ") must match Matrix B rows (" + size2[0] + ")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has " + size2.length + " dimensions)");}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has " + size1.length + " dimensions)");}}function _multiplyVectorVector(a, b, n) {if (0 === n) throw new Error("Cannot multiply two empty vectors");return dot(a, b);}function _multiplyVectorMatrix(a, b) {if ("dense" !== b.storage()) throw new Error("Support for SparseMatrix not implemented");return _multiplyVectorDenseMatrix(a, b);}function _multiplyVectorDenseMatrix(a, b) {var dt,adata = a._data,asize = a._size,adt = a._datatype,bdata = b._data,bsize = b._size,bdt = b._datatype,alength = asize[0],bcolumns = bsize[1],af = addScalar,mf = multiplyScalar;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]));for (var sum, c = [], j = 0; j < bcolumns; j++) {sum = mf(adata[0], bdata[0][j]);for (var i = 1; i < alength; i++) sum = af(sum, mf(adata[i], bdata[i][j]));c[j] = sum;}return a.createDenseMatrix({ data: c, size: [bcolumns], datatype: dt });}var typed = _ref.typed,matrix = _ref.matrix,addScalar = _ref.addScalar,multiplyScalar = _ref.multiplyScalar,equalScalar = _ref.equalScalar,dot = _ref.dot,algorithm11 = (0, _algorithm.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm14 = (0, _algorithm2.createAlgorithm14)({ typed: typed }),_multiplyMatrixVector = typed("_multiplyMatrixVector", { "DenseMatrix, any": function (a, b) {var dt,adata = a._data,asize = a._size,adt = a._datatype,bdata = b._data,bdt = b._datatype,arows = asize[0],acolumns = asize[1],af = addScalar,mf = multiplyScalar;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]));for (var c = [], i = 0; i < arows; i++) {for (var row = adata[i], sum = mf(row[0], bdata[0]), j = 1; j < acolumns; j++) sum = af(sum, mf(row[j], bdata[j]));c[i] = sum;}return a.createDenseMatrix({ data: c, size: [arows], datatype: dt });}, "SparseMatrix, any": function (a, b) {var avalues = a._values,aindex = a._index,aptr = a._ptr,adt = a._datatype;if (!avalues) throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var dt,bdata = b._data,bdt = b._datatype,arows = a._size[0],brows = b._size[0],cvalues = [],cindex = [],cptr = [],af = addScalar,mf = multiplyScalar,eq = equalScalar,zero = 0;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]), eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt));var x = [],w = [];cptr[0] = 0;for (var vbi, ib = 0; ib < brows; ib++) if (vbi = bdata[ib], !eq(vbi, zero)) for (var ia, ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) ia = aindex[ka], w[ia] ? x[ia] = af(x[ia], mf(vbi, avalues[ka])) : (w[ia] = !0, cindex.push(ia), x[ia] = mf(vbi, avalues[ka]));for (var ic, p1 = cindex.length, p = 0; p < p1; p++) ic = cindex[p], cvalues[p] = x[ic];return cptr[1] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [arows, 1], datatype: dt });} }),_multiplyMatrixMatrix = typed("_multiplyMatrixMatrix", { "DenseMatrix, DenseMatrix": function (a, b) {var dt,adata = a._data,asize = a._size,adt = a._datatype,bdata = b._data,bsize = b._size,bdt = b._datatype,arows = asize[0],acolumns = asize[1],bcolumns = bsize[1],af = addScalar,mf = multiplyScalar;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]));for (var row, c = [], i = 0; i < arows; i++) {row = adata[i], c[i] = [];for (var sum, j = 0; j < bcolumns; j++) {sum = mf(row[0], bdata[0][j]);for (var x = 1; x < acolumns; x++) sum = af(sum, mf(row[x], bdata[x][j]));c[i][j] = sum;}}return a.createDenseMatrix({ data: c, size: [arows, bcolumns], datatype: dt });}, "DenseMatrix, SparseMatrix": function (a, b) {var adata = a._data,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (!bvalues) throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var dt,arows = asize[0],bcolumns = bsize[1],af = addScalar,mf = multiplyScalar,eq = equalScalar,zero = 0;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]), eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt));for (var cvalues = [], cindex = [], cptr = [], c = b.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [arows, bcolumns], datatype: dt }), jb = 0; jb < bcolumns; jb++) {cptr[jb] = cindex.length;var kb0 = bptr[jb],kb1 = bptr[jb + 1];if (kb1 > kb0) for (var last = 0, i = 0; i < arows; i++) {for (var ib, mark = i + 1, cij = void 0, kb = kb0; kb < kb1; kb++) ib = bindex[kb], last === mark ? cij = af(cij, mf(adata[i][ib], bvalues[kb])) : (cij = mf(adata[i][ib], bvalues[kb]), last = mark);last !== mark || eq(cij, zero) || (cindex.push(i), cvalues.push(cij));}}return cptr[bcolumns] = cindex.length, c;}, "SparseMatrix, DenseMatrix": function (a, b) {var avalues = a._values,aindex = a._index,aptr = a._ptr,adt = a._datatype;if (!avalues) throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var dt,bdata = b._data,bdt = b._datatype,arows = a._size[0],brows = b._size[0],bcolumns = b._size[1],af = addScalar,mf = multiplyScalar,eq = equalScalar,zero = 0;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]), eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt));for (var cvalues = [], cindex = [], cptr = [], c = a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [arows, bcolumns], datatype: dt }), x = [], w = [], jb = 0; jb < bcolumns; jb++) {cptr[jb] = cindex.length;for (var vbij, mark = jb + 1, ib = 0; ib < brows; ib++) if (vbij = bdata[ib][jb], !eq(vbij, zero)) for (var ia, ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) ia = aindex[ka], w[ia] === mark ? x[ia] = af(x[ia], mf(vbij, avalues[ka])) : (w[ia] = mark, cindex.push(ia), x[ia] = mf(vbij, avalues[ka]));for (var ic, p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) ic = cindex[p], cvalues[p] = x[ic];}return cptr[bcolumns] = cindex.length, c;}, "SparseMatrix, SparseMatrix": function (a, b) {var dt,avalues = a._values,aindex = a._index,aptr = a._ptr,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bdt = b._datatype,arows = a._size[0],bcolumns = b._size[1],values = avalues && bvalues,af = addScalar,mf = multiplyScalar;adt && bdt && adt === bdt && "string" == typeof adt && (dt = adt, af = typed.find(addScalar, [dt, dt]), mf = typed.find(multiplyScalar, [dt, dt]));for (var ka, ka0, ka1, kb, kb0, kb1, ia, ib, cvalues = values ? [] : void 0, cindex = [], cptr = [], c = a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [arows, bcolumns], datatype: dt }), x = values ? [] : void 0, w = [], jb = 0; jb < bcolumns; jb++) {cptr[jb] = cindex.length;var mark = jb + 1;for (kb0 = bptr[jb], kb1 = bptr[jb + 1], kb = kb0; kb < kb1; kb++) if (ib = bindex[kb], values) for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) ia = aindex[ka], w[ia] === mark ? x[ia] = af(x[ia], mf(bvalues[kb], avalues[ka])) : (w[ia] = mark, cindex.push(ia), x[ia] = mf(bvalues[kb], avalues[ka]));else for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) ia = aindex[ka], w[ia] !== mark && (w[ia] = mark, cindex.push(ia));if (values) for (var ic, p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) ic = cindex[p], cvalues[p] = x[ic];}return cptr[bcolumns] = cindex.length, c;} });return typed(name, (0, _object.extend)({ "Array, Array": function (x, y) {_validateMatrixDimensions((0, _array.arraySize)(x), (0, _array.arraySize)(y));var m = this(matrix(x), matrix(y));return (0, _is.isMatrix)(m) ? m.valueOf() : m;}, "Matrix, Matrix": function (x, y) {var xsize = x.size(),ysize = y.size();return _validateMatrixDimensions(xsize, ysize), 1 === xsize.length ? 1 === ysize.length ? _multiplyVectorVector(x, y, xsize[0]) : _multiplyVectorMatrix(x, y) : 1 === ysize.length ? _multiplyMatrixVector(x, y) : _multiplyMatrixMatrix(x, y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "Array, Matrix": function (x, y) {return this(matrix(x, y.storage()), y);}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, multiplyScalar, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, multiplyScalar, !1);}, "any, SparseMatrix": function (x, y) {return algorithm11(y, x, multiplyScalar, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, multiplyScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, multiplyScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, multiplyScalar, !0).valueOf();}, "any, any": multiplyScalar, "any, any, ...any": function (x, y, rest) {for (var result = this(x, y), i = 0; i < rest.length; i++) result = this(result, rest[i]);return result;} }, multiplyScalar.signatures));});exports.createMultiply = createMultiply;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/multiplyScalar.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMultiplyScalar = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "multiplyScalar",dependencies = ["typed"],createMultiplyScalar = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed("multiplyScalar", { "number, number": _index.multiplyNumber, "Complex, Complex": function (x, y) {return x.mul(y);}, "BigNumber, BigNumber": function (x, y) {return x.times(y);}, "Fraction, Fraction": function (x, y) {return x.mul(y);}, "number | Fraction | BigNumber | Complex, Unit": function (x, y) {var res = y.clone();return res.value = null === res.value ? res._normalize(x) : this(res.value, x), res;}, "Unit, number | Fraction | BigNumber | Complex": function (x, y) {var res = x.clone();return res.value = null === res.value ? res._normalize(y) : this(res.value, y), res;}, "Unit, Unit": function (x, y) {return x.multiply(y);} });});exports.createMultiplyScalar = createMultiplyScalar;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/norm.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createNorm = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "norm",dependencies = ["typed", "abs", "add", "pow", "conj", "sqrt", "multiply", "equalScalar", "larger", "smaller", "matrix", "ctranspose", "eigs"],createNorm = (0, _factory.factory)(name, dependencies, function (_ref) {function _vectorNormPlusInfinity(x) {var pinf = 0;return x.forEach(function (value) {var v = abs(value);larger(v, pinf) && (pinf = v);}, !0), pinf;}function _vectorNormMinusInfinity(x) {var ninf;return x.forEach(function (value) {var v = abs(value);(!ninf || smaller(v, ninf)) && (ninf = v);}, !0), ninf || 0;}function _vectorNorm(x, p) {if (p === Number.POSITIVE_INFINITY || "inf" === p) return _vectorNormPlusInfinity(x);if (p === Number.NEGATIVE_INFINITY || "-inf" === p) return _vectorNormMinusInfinity(x);if ("fro" === p) return _norm(x, 2);if ("number" == typeof p && !isNaN(p)) {if (!equalScalar(p, 0)) {var n = 0;return x.forEach(function (value) {n = add(pow(abs(value), p), n);}, !0), pow(n, 1 / p);}return Number.POSITIVE_INFINITY;}throw new Error("Unsupported parameter value");}function _matrixNormFrobenius(x) {var fro = 0;return x.forEach(function (value) {fro = add(fro, multiply(value, conj(value)));}), abs(sqrt(fro));}function _matrixNormOne(x) {var c = [],maxc = 0;return x.forEach(function (value, index) {var j = index[1],cj = add(c[j] || 0, abs(value));larger(cj, maxc) && (maxc = cj), c[j] = cj;}, !0), maxc;}function _matrixNormTwo(x) {var sizeX = x.size();if (sizeX[0] !== sizeX[1]) throw new RangeError("Invalid matrix dimensions");var tx = ctranspose(x),squaredX = multiply(tx, x),eigenVals = eigs(squaredX).values.toArray(),rho = eigenVals[eigenVals.length - 1];return abs(sqrt(rho));}function _matrixNormInfinity(x) {var r = [],maxr = 0;return x.forEach(function (value, index) {var i = index[0],ri = add(r[i] || 0, abs(value));larger(ri, maxr) && (maxr = ri), r[i] = ri;}, !0), maxr;}function _matrixNorm(x, p) {if (1 === p) return _matrixNormOne(x);if (p === Number.POSITIVE_INFINITY || "inf" === p) return _matrixNormInfinity(x);if ("fro" === p) return _matrixNormFrobenius(x);if (2 === p) return _matrixNormTwo(x);throw new Error("Unsupported parameter value " + p);}function _norm(x, p) {var sizeX = x.size();if (1 === sizeX.length) return _vectorNorm(x, p);if (2 === sizeX.length) {if (sizeX[0] && sizeX[1]) return _matrixNorm(x, p);throw new RangeError("Invalid matrix dimensions");}}var typed = _ref.typed,abs = _ref.abs,add = _ref.add,pow = _ref.pow,conj = _ref.conj,sqrt = _ref.sqrt,multiply = _ref.multiply,equalScalar = _ref.equalScalar,larger = _ref.larger,smaller = _ref.smaller,matrix = _ref.matrix,ctranspose = _ref.ctranspose,eigs = _ref.eigs;return typed(name, { number: Math.abs, Complex: function (x) {return x.abs();}, BigNumber: function (x) {return x.abs();}, boolean: function (x) {return Math.abs(x);}, Array: function (x) {return _norm(matrix(x), 2);}, Matrix: function (x) {return _norm(x, 2);}, "number | Complex | BigNumber | boolean, number | BigNumber | string": function (x) {return this(x);}, "Array, number | BigNumber | string": function (x, p) {return _norm(matrix(x), p);}, "Matrix, number | BigNumber | string": function (x, p) {return _norm(x, p);} });});exports.createNorm = createNorm;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/nthRoot.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createNthRootNumber = exports.createNthRoot = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm01.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm06.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm6 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "nthRoot",dependencies = ["typed", "matrix", "equalScalar", "BigNumber"],createNthRoot = (0, _factory.factory)(name, dependencies, function (_ref) {function _bigNthRoot(a, root) {var precision = _BigNumber.precision,Big = _BigNumber.clone({ precision: precision + 2 }),zero = new _BigNumber(0),one = new Big(1),inv = root.isNegative();if (inv && (root = root.neg()), root.isZero()) throw new Error("Root must be non-zero");if (a.isNegative() && !root.abs().mod(2).equals(1)) throw new Error("Root must be odd when a is negative.");if (a.isZero()) return inv ? new Big(1 / 0) : 0;if (!a.isFinite()) return inv ? zero : a;var x = a.abs().pow(one.div(root));return x = a.isNeg() ? x.neg() : x, new _BigNumber((inv ? one.div(x) : x).toPrecision(precision));}var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,_BigNumber = _ref.BigNumber,algorithm01 = (0, _algorithm.createAlgorithm01)({ typed: typed }),algorithm02 = (0, _algorithm2.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm06 = (0, _algorithm3.createAlgorithm06)({ typed: typed, equalScalar: equalScalar }),algorithm11 = (0, _algorithm4.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm13 = (0, _algorithm5.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm6.createAlgorithm14)({ typed: typed }),complexErr = "Complex number not supported in function nthRoot. Use nthRoots instead.";return typed(name, { number: function (x) {return (0, _index.nthRootNumber)(x, 2);}, "number, number": _index.nthRootNumber, BigNumber: function (x) {return _bigNthRoot(x, new _BigNumber(2));}, Complex: function () {throw new Error(complexErr);}, "Complex, number": function () {throw new Error(complexErr);}, "BigNumber, BigNumber": _bigNthRoot, "Array | Matrix": function (x) {return this(x, 2);}, "SparseMatrix, SparseMatrix": function (x, y) {if (1 === y.density()) return algorithm06(x, y, this);throw new Error("Root must be non-zero");}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {if (1 === y.density()) return algorithm01(x, y, this, !1);throw new Error("Root must be non-zero");}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {if (1 === y.density()) return algorithm11(y, x, this, !0);throw new Error("Root must be non-zero");}, "number | BigNumber, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return this(matrix(x), y).valueOf();}, "number | BigNumber, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});exports.createNthRoot = createNthRoot;var createNthRootNumber = (0, _factory.factory)(name, ["typed"], function (_ref2) {var typed = _ref2.typed;return typed(name, { number: _index.nthRootNumber, "number, number": _index.nthRootNumber });});exports.createNthRootNumber = createNthRootNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/nthRoots.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createNthRoots = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "nthRoots",dependencies = ["config", "typed", "divideScalar", "Complex"],createNthRoots = (0, _factory.factory)(name, dependencies, function (_ref) {function _nthComplexRoots(a, root) {if (0 > root) throw new Error("Root must be greater than zero");if (0 === root) throw new Error("Root must be non-zero");if (0 != root % 1) throw new Error("Root must be an integer");if (0 === a || 0 === a.abs()) return [new Complex(0, 0)];var offset,aIsNumeric = "number" == typeof a;(aIsNumeric || 0 === a.re || 0 === a.im) && (aIsNumeric ? offset = 2 * +(0 > a) : 0 === a.im ? offset = 2 * +(0 > a.re) : offset = 2 * +(0 > a.im) + 1);for (var halfPiFactor, arg = a.arg(), abs = a.abs(), roots = [], r = Math.pow(abs, 1 / root), k = 0; k < root; k++) {if (halfPiFactor = (offset + 4 * k) / root, halfPiFactor === Math.round(halfPiFactor)) {roots.push(_calculateExactResult[halfPiFactor % 4](r));continue;}roots.push(new Complex({ r: r, phi: (arg + 2 * Math.PI * k) / root }));}return roots;}var typed = _ref.typed,config = _ref.config,divideScalar = _ref.divideScalar,Complex = _ref.Complex,_calculateExactResult = [function (val) {return new Complex(val, 0);}, function (val) {return new Complex(0, val);}, function (val) {return new Complex(-val, 0);}, function (val) {return new Complex(0, -val);}];return typed(name, { Complex: function (x) {return _nthComplexRoots(x, 2);}, "Complex, number": _nthComplexRoots });});exports.createNthRoots = createNthRoots;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/pow.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createPow = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "pow",dependencies = ["typed", "config", "identity", "multiply", "matrix", "fraction", "number", "Complex"],createPow = (0, _factory.factory)(name, dependencies, function (_ref) {function _pow(x, y) {if (config.predictable && !(0, _number.isInteger)(y) && 0 > x) try {var yFrac = fraction(y),yNum = number(yFrac);if ((y === yNum || 1e-14 > Math.abs((y - yNum) / y)) && 1 == yFrac.d % 2) return (0 == yFrac.n % 2 ? 1 : -1) * Math.pow(-x, y);} catch (ex) {}return config.predictable && (-1 > x && y === 1 / 0 || -1 < x && 0 > x && y === -Infinity) ? NaN : (0, _number.isInteger)(y) || 0 <= x || config.predictable ? (0, _index.powNumber)(x, y) : 1 > x * x && y === 1 / 0 || 1 < x * x && y === -Infinity ? 0 : new Complex(x, 0).pow(y, 0);}function _powArray(x, y) {if (!(0, _number.isInteger)(y) || 0 > y) throw new TypeError("For A^b, b must be a positive integer (value is " + y + ")");var s = (0, _array.arraySize)(x);if (2 !== s.length) throw new Error("For A^b, A must be 2 dimensional (A has " + s.length + " dimensions)");if (s[0] !== s[1]) throw new Error("For A^b, A must be square (size is " + s[0] + "x" + s[1] + ")");for (var res = identity(s[0]).valueOf(), px = x; 1 <= y;) 1 == (1 & y) && (res = multiply(px, res)), y >>= 1, px = multiply(px, px);return res;}function _powMatrix(x, y) {return matrix(_powArray(x.valueOf(), y));}var typed = _ref.typed,config = _ref.config,identity = _ref.identity,multiply = _ref.multiply,matrix = _ref.matrix,number = _ref.number,fraction = _ref.fraction,Complex = _ref.Complex;return typed(name, { "number, number": _pow, "Complex, Complex": function (x, y) {return x.pow(y);}, "BigNumber, BigNumber": function (x, y) {return y.isInteger() || 0 <= x || config.predictable ? x.pow(y) : new Complex(x.toNumber(), 0).pow(y.toNumber(), 0);}, "Fraction, Fraction": function (x, y) {var result = x.pow(y);if (null != result) return result;if (config.predictable) throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");else return _pow(x.valueOf(), y.valueOf());}, "Array, number": _powArray, "Array, BigNumber": function (x, y) {return _powArray(x, y.toNumber());}, "Matrix, number": _powMatrix, "Matrix, BigNumber": function (x, y) {return _powMatrix(x, y.toNumber());}, "Unit, number | BigNumber": function (x, y) {return x.pow(y);} });});exports.createPow = createPow;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/round.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRoundNumber = exports.createRound = void 0;var _defineProperty2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js");function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);enumerableOnly && (symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;})), keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var source, i = 1; i < arguments.length; i++) source = null == arguments[i] ? {} : arguments[i], i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {(0, _defineProperty2["default"])(target, key, source[key]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});return target;}var NO_INT = "Number of decimals in function round must be an integer",name = "round",dependencies = ["typed", "matrix", "equalScalar", "zeros", "BigNumber", "DenseMatrix"],createRound = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,zeros = _ref.zeros,BigNumber = _ref.BigNumber,DenseMatrix = _ref.DenseMatrix,algorithm11 = (0, _algorithm.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm12 = (0, _algorithm2.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm14 = (0, _algorithm3.createAlgorithm14)({ typed: typed });return typed(name, _objectSpread(_objectSpread({}, roundNumberSignatures), {}, { Complex: function (x) {return x.round();}, "Complex, number": function (x, n) {if (n % 1) throw new TypeError(NO_INT);return x.round(n);}, "Complex, BigNumber": function (x, n) {if (!n.isInteger()) throw new TypeError(NO_INT);var _n = n.toNumber();return x.round(_n);}, "number, BigNumber": function (x, n) {if (!n.isInteger()) throw new TypeError(NO_INT);return new BigNumber(x).toDecimalPlaces(n.toNumber());}, BigNumber: function (x) {return x.toDecimalPlaces(0);}, "BigNumber, BigNumber": function (x, n) {if (!n.isInteger()) throw new TypeError(NO_INT);return x.toDecimalPlaces(n.toNumber());}, Fraction: function (x) {return x.round();}, "Fraction, number": function (x, n) {if (n % 1) throw new TypeError(NO_INT);return x.round(n);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | Complex | BigNumber, SparseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm12(y, x, this, !0);}, "number | Complex | BigNumber, DenseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "number | Complex | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} }));});exports.createRound = createRound;var roundNumberSignatures = { number: _index.roundNumber, "number, number": function (x, n) {if (!(0, _number.isInteger)(n)) throw new TypeError(NO_INT);if (0 > n || 15 < n) throw new Error("Number of decimals in function round must be in the range of 0-15");return (0, _index.roundNumber)(x, n);} },createRoundNumber = (0, _factory.factory)(name, ["typed"], function (_ref2) {var typed = _ref2.typed;return typed(name, roundNumberSignatures);});exports.createRoundNumber = createRoundNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/sign.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSign = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "sign",dependencies = ["typed", "BigNumber", "Fraction", "complex"],createSign = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_BigNumber = _ref.BigNumber,complex = _ref.complex,_Fraction = _ref.Fraction;return typed(name, { number: _index.signNumber, Complex: function (x) {return 0 === x.im ? complex((0, _index.signNumber)(x.re)) : x.sign();}, BigNumber: function (x) {return new _BigNumber(x.cmp(0));}, Fraction: function (x) {return new _Fraction(x.s, 1);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, Unit: function (x) {return this(x.value);} });});exports.createSign = createSign;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/sqrt.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSqrt = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "sqrt",dependencies = ["config", "typed", "Complex"],createSqrt = (0, _factory.factory)(name, dependencies, function (_ref) {function _sqrtNumber(x) {return isNaN(x) ? NaN : 0 <= x || config.predictable ? Math.sqrt(x) : new Complex(x, 0).sqrt();}var config = _ref.config,typed = _ref.typed,Complex = _ref.Complex;return typed("sqrt", { number: _sqrtNumber, Complex: function (x) {return x.sqrt();}, BigNumber: function (x) {return !x.isNegative() || config.predictable ? x.sqrt() : _sqrtNumber(x.toNumber());}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, Unit: function (x) {return x.pow(.5);} });});exports.createSqrt = createSqrt;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/square.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSquare = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "square",dependencies = ["typed"],createSquare = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.squareNumber, Complex: function (x) {return x.mul(x);}, BigNumber: function (x) {return x.times(x);}, Fraction: function (x) {return x.mul(x);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, Unit: function (x) {return x.pow(2);} });});exports.createSquare = createSquare;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/subtract.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSubtract = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm01.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm05.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm10.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm6 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "subtract",dependencies = ["typed", "matrix", "equalScalar", "addScalar", "unaryMinus", "DenseMatrix"],createSubtract = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,addScalar = _ref.addScalar,unaryMinus = _ref.unaryMinus,DenseMatrix = _ref.DenseMatrix,algorithm01 = (0, _algorithm.createAlgorithm01)({ typed: typed }),algorithm03 = (0, _algorithm2.createAlgorithm03)({ typed: typed }),algorithm05 = (0, _algorithm3.createAlgorithm05)({ typed: typed, equalScalar: equalScalar }),algorithm10 = (0, _algorithm4.createAlgorithm10)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm5.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm6.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": function (x, y) {return x - y;}, "Complex, Complex": function (x, y) {return x.sub(y);}, "BigNumber, BigNumber": function (x, y) {return x.minus(y);}, "Fraction, Fraction": function (x, y) {return x.sub(y);}, "Unit, Unit": function (x, y) {if (null === x.value) throw new Error("Parameter x contains a unit with undefined value");if (null === y.value) throw new Error("Parameter y contains a unit with undefined value");if (!x.equalBase(y)) throw new Error("Units do not match");var res = x.clone();return res.value = this(res.value, y.value), res.fixPrefix = !1, res;}, "SparseMatrix, SparseMatrix": function (x, y) {return checkEqualDimensions(x, y), algorithm05(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return checkEqualDimensions(x, y), algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return checkEqualDimensions(x, y), algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return checkEqualDimensions(x, y), algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm10(x, unaryMinus(y), addScalar);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this);}, "any, SparseMatrix": function (x, y) {return algorithm10(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createSubtract = createSubtract;function checkEqualDimensions(x, y) {var xsize = x.size(),ysize = y.size();if (xsize.length !== ysize.length) throw new _DimensionError.DimensionError(xsize.length, ysize.length);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/unaryMinus.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUnaryMinus = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "unaryMinus",dependencies = ["typed"],createUnaryMinus = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.unaryMinusNumber, Complex: function (x) {return x.neg();}, BigNumber: function (x) {return x.neg();}, Fraction: function (x) {return x.neg();}, Unit: function (x) {var res = x.clone();return res.value = this(x.value), res;}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createUnaryMinus = createUnaryMinus;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/unaryPlus.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUnaryPlus = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "unaryPlus",dependencies = ["typed", "config", "BigNumber"],createUnaryPlus = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,BigNumber = _ref.BigNumber;return typed(name, { number: _index.unaryPlusNumber, Complex: function (x) {return x;}, BigNumber: function (x) {return x;}, Fraction: function (x) {return x;}, Unit: function (x) {return x.clone();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);}, "boolean | string": function (x) {return "BigNumber" === config.number ? new BigNumber(+x) : +x;} });});exports.createUnaryPlus = createUnaryPlus;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/arithmetic/xgcd.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createXgcd = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "xgcd",dependencies = ["typed", "config", "matrix", "BigNumber"],createXgcd = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,BigNumber = _ref.BigNumber;return typed(name, { "number, number": function (a, b) {var res = (0, _index.xgcdNumber)(a, b);return "Array" === config.matrix ? res : matrix(res);}, "BigNumber, BigNumber": function (a, b) {var t,q,r,zero = new BigNumber(0),one = new BigNumber(1),x = zero,lastx = one,y = one,lasty = zero;if (!a.isInt() || !b.isInt()) throw new Error("Parameters in function xgcd must be integer numbers");for (; !b.isZero();) q = a.div(b).floor(), r = a.mod(b), t = x, x = lastx.minus(q.times(x)), lastx = t, t = y, y = lasty.minus(q.times(y)), lasty = t, a = b, b = r;var res;return res = a.lt(zero) ? [a.neg(), lastx.neg(), lasty.neg()] : [a, a.isZero() ? 0 : lastx, lasty], "Array" === config.matrix ? res : matrix(res);} });});exports.createXgcd = createXgcd;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/bitwise/bitAnd.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBitAnd = void 0;var _bitwise = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm06.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "bitAnd",dependencies = ["typed", "matrix", "equalScalar"],createBitAnd = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm06 = (0, _algorithm5.createAlgorithm06)({ typed: typed, equalScalar: equalScalar }),algorithm11 = (0, _algorithm2.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm13 = (0, _algorithm3.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.bitAndNumber, "BigNumber, BigNumber": _bitwise.bitAndBigNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm06(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm02(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm11(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createBitAnd = createBitAnd;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/bitwise/bitNot.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBitNot = void 0;var _bitwise = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "bitNot",dependencies = ["typed"],createBitNot = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.bitNotNumber, BigNumber: _bitwise.bitNotBigNumber, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createBitNot = createBitNot;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/bitwise/bitOr.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBitOr = void 0;var _bitwise = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm10.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm04.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm01.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "bitOr",dependencies = ["typed", "matrix", "equalScalar", "DenseMatrix"],createBitOr = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,DenseMatrix = _ref.DenseMatrix,algorithm01 = (0, _algorithm5.createAlgorithm01)({ typed: typed }),algorithm04 = (0, _algorithm4.createAlgorithm04)({ typed: typed, equalScalar: equalScalar }),algorithm10 = (0, _algorithm3.createAlgorithm10)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm2.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.bitOrNumber, "BigNumber, BigNumber": _bitwise.bitOrBigNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm04(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm01(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm10(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm10(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createBitOr = createBitOr;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/bitwise/bitXor.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBitXor = void 0;var _bitwise = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "bitXor",dependencies = ["typed", "matrix", "DenseMatrix"],createBitXor = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm2.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm12 = (0, _algorithm3.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm4.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm5.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.bitXorNumber, "BigNumber, BigNumber": _bitwise.bitXor, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createBitXor = createBitXor;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/bitwise/leftShift.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLeftShift = void 0;var _algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm01.js"),_algorithm6 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm10.js"),_algorithm7 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm08.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),_bitwise = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js"),name = "leftShift",dependencies = ["typed", "matrix", "equalScalar", "zeros", "DenseMatrix"],createLeftShift = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,zeros = _ref.zeros,DenseMatrix = _ref.DenseMatrix,algorithm01 = (0, _algorithm5.createAlgorithm01)({ typed: typed }),algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm08 = (0, _algorithm7.createAlgorithm08)({ typed: typed, equalScalar: equalScalar }),algorithm10 = (0, _algorithm6.createAlgorithm10)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm11 = (0, _algorithm2.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm13 = (0, _algorithm3.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.leftShiftNumber, "BigNumber, BigNumber": _bitwise.leftShiftBigNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm08(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm10(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return this(matrix(x), y).valueOf();}, "number | BigNumber, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});exports.createLeftShift = createLeftShift;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/bitwise/rightArithShift.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRightArithShift = void 0;var _bitwise = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm01.js"),_algorithm6 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm10.js"),_algorithm7 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm08.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "rightArithShift",dependencies = ["typed", "matrix", "equalScalar", "zeros", "DenseMatrix"],createRightArithShift = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,zeros = _ref.zeros,DenseMatrix = _ref.DenseMatrix,algorithm01 = (0, _algorithm5.createAlgorithm01)({ typed: typed }),algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm08 = (0, _algorithm7.createAlgorithm08)({ typed: typed, equalScalar: equalScalar }),algorithm10 = (0, _algorithm6.createAlgorithm10)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm11 = (0, _algorithm2.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm13 = (0, _algorithm3.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.rightArithShiftNumber, "BigNumber, BigNumber": _bitwise.rightArithShiftBigNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm08(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm10(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return this(matrix(x), y).valueOf();}, "number | BigNumber, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});exports.createRightArithShift = createRightArithShift;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/bitwise/rightLogShift.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRightLogShift = void 0;var _algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm01.js"),_algorithm6 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm10.js"),_algorithm7 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm08.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "rightLogShift",dependencies = ["typed", "matrix", "equalScalar", "zeros", "DenseMatrix"],createRightLogShift = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,zeros = _ref.zeros,DenseMatrix = _ref.DenseMatrix,algorithm01 = (0, _algorithm5.createAlgorithm01)({ typed: typed }),algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm08 = (0, _algorithm7.createAlgorithm08)({ typed: typed, equalScalar: equalScalar }),algorithm10 = (0, _algorithm6.createAlgorithm10)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm11 = (0, _algorithm2.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm13 = (0, _algorithm3.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.rightLogShiftNumber, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm08(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm01(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return equalScalar(y, 0) ? x.clone() : algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm10(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return equalScalar(x, 0) ? zeros(y.size(), y.storage()) : algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return this(matrix(x), y).valueOf();}, "number | BigNumber, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});exports.createRightLogShift = createRightLogShift;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/combinatorics/bellNumbers.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBellNumbers = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "bellNumbers",dependencies = ["typed", "addScalar", "isNegative", "isInteger", "stirlingS2"],createBellNumbers = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,addScalar = _ref.addScalar,isNegative = _ref.isNegative,isInteger = _ref.isInteger,stirlingS2 = _ref.stirlingS2;return typed(name, { "number | BigNumber": function (n) {if (!isInteger(n) || isNegative(n)) throw new TypeError("Non-negative integer value expected in function bellNumbers");for (var result = 0, i = 0; i <= n; i++) result = addScalar(result, stirlingS2(n, i));return result;} });});exports.createBellNumbers = createBellNumbers;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/combinatorics/catalan.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCatalan = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "catalan",dependencies = ["typed", "addScalar", "divideScalar", "multiplyScalar", "combinations", "isNegative", "isInteger"],createCatalan = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,addScalar = _ref.addScalar,divideScalar = _ref.divideScalar,multiplyScalar = _ref.multiplyScalar,combinations = _ref.combinations,isNegative = _ref.isNegative,isInteger = _ref.isInteger;return typed(name, { "number | BigNumber": function (n) {if (!isInteger(n) || isNegative(n)) throw new TypeError("Non-negative integer value expected in function catalan");return divideScalar(combinations(multiplyScalar(n, 2), n), addScalar(n, 1));} });});exports.createCatalan = createCatalan;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/combinatorics/composition.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createComposition = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "composition",dependencies = ["typed", "addScalar", "combinations", "isNegative", "isPositive", "isInteger", "larger"],createComposition = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,addScalar = _ref.addScalar,combinations = _ref.combinations,isPositive = _ref.isPositive,isNegative = _ref.isNegative,isInteger = _ref.isInteger,larger = _ref.larger;return typed(name, { "number | BigNumber, number | BigNumber": function (n, k) {if (!isInteger(n) || !isPositive(n) || !isInteger(k) || !isPositive(k)) throw new TypeError("Positive integer value expected in function composition");else if (larger(k, n)) throw new TypeError("k must be less than or equal to n in function composition");return combinations(addScalar(n, -1), addScalar(k, -1));} });});exports.createComposition = createComposition;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/combinatorics/stirlingS2.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createStirlingS2 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "stirlingS2",dependencies = ["typed", "addScalar", "subtract", "multiplyScalar", "divideScalar", "pow", "factorial", "combinations", "isNegative", "isInteger", "larger"],createStirlingS2 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,addScalar = _ref.addScalar,subtract = _ref.subtract,multiplyScalar = _ref.multiplyScalar,divideScalar = _ref.divideScalar,pow = _ref.pow,factorial = _ref.factorial,combinations = _ref.combinations,isNegative = _ref.isNegative,isInteger = _ref.isInteger,larger = _ref.larger;return typed(name, { "number | BigNumber, number | BigNumber": function (n, k) {if (!isInteger(n) || isNegative(n) || !isInteger(k) || isNegative(k)) throw new TypeError("Non-negative integer value expected in function stirlingS2");else if (larger(k, n)) throw new TypeError("k must be less than or equal to n in function stirlingS2");for (var kFactorial = factorial(k), result = 0, i = 0; i <= k; i++) {var negativeOne = pow(-1, subtract(k, i)),kChooseI = combinations(k, i),iPower = pow(i, n);result = addScalar(result, multiplyScalar(multiplyScalar(kChooseI, iPower), negativeOne));}return divideScalar(result, kFactorial);} });});exports.createStirlingS2 = createStirlingS2;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/complex/arg.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createArg = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "arg",dependencies = ["typed"],createArg = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: function (x) {return Math.atan2(0, x);}, BigNumber: function (x) {return x.constructor.atan2(0, x);}, Complex: function (x) {return x.arg();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createArg = createArg;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/complex/conj.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createConj = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "conj",dependencies = ["typed"],createConj = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: function (x) {return x;}, BigNumber: function (x) {return x;}, Complex: function (x) {return x.conjugate();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createConj = createConj;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/complex/im.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIm = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "im",dependencies = ["typed"],createIm = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: function () {return 0;}, BigNumber: function (x) {return x.mul(0);}, Fraction: function (x) {return x.mul(0);}, Complex: function (x) {return x.im;}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createIm = createIm;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/complex/re.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRe = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "re",dependencies = ["typed"],createRe = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: function (x) {return x;}, BigNumber: function (x) {return x;}, Fraction: function (x) {return x;}, Complex: function (x) {return x.re;}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createRe = createRe;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/geometry/distance.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDistance = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "distance",dependencies = ["typed", "addScalar", "subtract", "divideScalar", "multiplyScalar", "unaryMinus", "sqrt", "abs"],createDistance = (0, _factory.factory)(name, dependencies, function (_ref) {function _isNumber(a) {return "number" == typeof a || (0, _is.isBigNumber)(a);}function _2d(a) {return a.constructor !== Array && (a = _objectToArray(a)), _isNumber(a[0]) && _isNumber(a[1]);}function _3d(a) {return a.constructor !== Array && (a = _objectToArray(a)), _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]);}function _containsOnlyNumbers(a) {return Array.isArray(a) || (a = _objectToArray(a)), a.every(_isNumber);}function _parametricLine(a) {return a.constructor !== Array && (a = _objectToArray(a)), _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]) && _isNumber(a[3]) && _isNumber(a[4]) && _isNumber(a[5]);}function _objectToArray(o) {for (var keys = Object.keys(o), a = [], i = 0; i < keys.length; i++) a.push(o[keys[i]]);return a;}function _pairwise(a) {if (2 === a[0].length && _isNumber(a[0][0]) && _isNumber(a[0][1])) {if (a.some(function (aI) {return 2 !== aI.length || !_isNumber(aI[0]) || !_isNumber(aI[1]);})) return !1;} else if (!(3 === a[0].length && _isNumber(a[0][0]) && _isNumber(a[0][1]) && _isNumber(a[0][2]))) return !1;else if (a.some(function (aI) {return 3 !== aI.length || !_isNumber(aI[0]) || !_isNumber(aI[1]) || !_isNumber(aI[2]);})) return !1;return !0;}function _distancePointLine2D(x, y, a, b, c) {var num = abs(addScalar(addScalar(multiplyScalar(a, x), multiplyScalar(b, y)), c)),den = sqrt(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)));return divideScalar(num, den);}function _distancePointLine3D(x, y, z, x0, y0, z0, a, b, c) {var num = [subtract(multiplyScalar(subtract(y0, y), c), multiplyScalar(subtract(z0, z), b)), subtract(multiplyScalar(subtract(z0, z), a), multiplyScalar(subtract(x0, x), c)), subtract(multiplyScalar(subtract(x0, x), b), multiplyScalar(subtract(y0, y), a))];num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2])));var den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c)));return divideScalar(num, den);}function _euclideanDistance(x, y) {for (var vectorSize = x.length, result = 0, diff = 0, i = 0; i < vectorSize; i++) diff = subtract(x[i], y[i]), result = addScalar(multiplyScalar(diff, diff), result);return sqrt(result);}function _distancePairwise(a) {for (var result = [], pointA = [], pointB = [], i = 0; i < a.length - 1; i++) for (var j = i + 1; j < a.length; j++) 2 === a[0].length ? (pointA = [a[i][0], a[i][1]], pointB = [a[j][0], a[j][1]]) : 3 === a[0].length && (pointA = [a[i][0], a[i][1], a[i][2]], pointB = [a[j][0], a[j][1], a[j][2]]), result.push(_euclideanDistance(pointA, pointB));return result;}var typed = _ref.typed,addScalar = _ref.addScalar,subtract = _ref.subtract,multiplyScalar = _ref.multiplyScalar,divideScalar = _ref.divideScalar,unaryMinus = _ref.unaryMinus,sqrt = _ref.sqrt,abs = _ref.abs;return typed(name, { "Array, Array, Array": function (x, y, z) {if (2 === x.length && 2 === y.length && 2 === z.length) {if (!_2d(x)) throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if (!_2d(y)) throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if (!_2d(z)) throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var m = divideScalar(subtract(z[1], z[0]), subtract(y[1], y[0])),xCoeff = multiplyScalar(multiplyScalar(m, m), y[0]),yCoeff = unaryMinus(multiplyScalar(m, y[0])),constant = x[1];return _distancePointLine2D(x[0], x[1], xCoeff, yCoeff, constant);}throw new TypeError("Invalid Arguments: Try again");}, "Object, Object, Object": function (x, y, z) {if (2 === Object.keys(x).length && 2 === Object.keys(y).length && 2 === Object.keys(z).length) {if (!_2d(x)) throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if (!_2d(y)) throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if (!_2d(z)) throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if ("pointX" in x && "pointY" in x && "lineOnePtX" in y && "lineOnePtY" in y && "lineTwoPtX" in z && "lineTwoPtY" in z) {var m = divideScalar(subtract(z.lineTwoPtY, z.lineTwoPtX), subtract(y.lineOnePtY, y.lineOnePtX)),xCoeff = multiplyScalar(multiplyScalar(m, m), y.lineOnePtX),yCoeff = unaryMinus(multiplyScalar(m, y.lineOnePtX)),constant = x.pointX;return _distancePointLine2D(x.pointX, x.pointY, xCoeff, yCoeff, constant);}throw new TypeError("Key names do not match");} else throw new TypeError("Invalid Arguments: Try again");}, "Array, Array": function (x, y) {if (2 === x.length && 3 === y.length) {if (!_2d(x)) throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if (!_3d(y)) throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return _distancePointLine2D(x[0], x[1], y[0], y[1], y[2]);}if (3 === x.length && 6 === y.length) {if (!_3d(x)) throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if (!_parametricLine(y)) throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return _distancePointLine3D(x[0], x[1], x[2], y[0], y[1], y[2], y[3], y[4], y[5]);}if (x.length === y.length && 0 < x.length) {if (!_containsOnlyNumbers(x)) throw new TypeError("All values of an array should be numbers or BigNumbers");if (!_containsOnlyNumbers(y)) throw new TypeError("All values of an array should be numbers or BigNumbers");return _euclideanDistance(x, y);}throw new TypeError("Invalid Arguments: Try again");}, "Object, Object": function (x, y) {if (2 === Object.keys(x).length && 3 === Object.keys(y).length) {if (!_2d(x)) throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if (!_3d(y)) throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if ("pointX" in x && "pointY" in x && "xCoeffLine" in y && "yCoeffLine" in y && "constant" in y) return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant);throw new TypeError("Key names do not match");} else if (3 === Object.keys(x).length && 6 === Object.keys(y).length) {if (!_3d(x)) throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if (!_parametricLine(y)) throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if ("pointX" in x && "pointY" in x && "x0" in y && "y0" in y && "z0" in y && "a" in y && "b" in y && "c" in y) return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c);throw new TypeError("Key names do not match");} else if (2 === Object.keys(x).length && 2 === Object.keys(y).length) {if (!_2d(x)) throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if (!_2d(y)) throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if ("pointOneX" in x && "pointOneY" in x && "pointTwoX" in y && "pointTwoY" in y) return _euclideanDistance([x.pointOneX, x.pointOneY], [y.pointTwoX, y.pointTwoY]);throw new TypeError("Key names do not match");} else if (3 === Object.keys(x).length && 3 === Object.keys(y).length) {if (!_3d(x)) throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if (!_3d(y)) throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if ("pointOneX" in x && "pointOneY" in x && "pointOneZ" in x && "pointTwoX" in y && "pointTwoY" in y && "pointTwoZ" in y) return _euclideanDistance([x.pointOneX, x.pointOneY, x.pointOneZ], [y.pointTwoX, y.pointTwoY, y.pointTwoZ]);throw new TypeError("Key names do not match");} else throw new TypeError("Invalid Arguments: Try again");}, Array: function (arr) {if (!_pairwise(arr)) throw new TypeError("Incorrect array format entered for pairwise distance calculation");return _distancePairwise(arr);} });});exports.createDistance = createDistance;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/geometry/intersect.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIntersect = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "intersect",dependencies = ["typed", "config", "abs", "add", "addScalar", "matrix", "multiply", "multiplyScalar", "divideScalar", "subtract", "smaller", "equalScalar"],createIntersect = (0, _factory.factory)(name, dependencies, function (_ref) {function _isNumeric(a) {return "number" == typeof a || (0, _is.isBigNumber)(a);}function _2d(x) {return 2 === x.length && _isNumeric(x[0]) && _isNumeric(x[1]);}function _3d(x) {return 3 === x.length && _isNumeric(x[0]) && _isNumeric(x[1]) && _isNumeric(x[2]);}function _4d(x) {return 4 === x.length && _isNumeric(x[0]) && _isNumeric(x[1]) && _isNumeric(x[2]) && _isNumeric(x[3]);}function _intersect2d(p1a, p1b, p2a, p2b) {var o1 = p1a,o2 = p2a,d1 = subtract(o1, p1b),d2 = subtract(o2, p2b),det = subtract(multiplyScalar(d1[0], d2[1]), multiplyScalar(d2[0], d1[1]));if (smaller(abs(det), config.epsilon)) return null;var d20o11 = multiplyScalar(d2[0], o1[1]),d21o10 = multiplyScalar(d2[1], o1[0]),d20o21 = multiplyScalar(d2[0], o2[1]),d21o20 = multiplyScalar(d2[1], o2[0]),t = divideScalar(addScalar(subtract(subtract(d20o11, d21o10), d20o21), d21o20), det);return add(multiply(d1, t), o1);}function _intersect3dHelper(a, b, c, d, e, f, g, h, i, j, k, l) {var add1 = multiplyScalar(subtract(a, b), subtract(c, d)),add2 = multiplyScalar(subtract(e, f), subtract(g, h)),add3 = multiplyScalar(subtract(i, j), subtract(k, l));return addScalar(addScalar(add1, add2), add3);}function _intersect3d(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) {var d1343 = _intersect3dHelper(x1, x3, x4, x3, y1, y3, y4, y3, z1, z3, z4, z3),d4321 = _intersect3dHelper(x4, x3, x2, x1, y4, y3, y2, y1, z4, z3, z2, z1),d1321 = _intersect3dHelper(x1, x3, x2, x1, y1, y3, y2, y1, z1, z3, z2, z1),d4343 = _intersect3dHelper(x4, x3, x4, x3, y4, y3, y4, y3, z4, z3, z4, z3),d2121 = _intersect3dHelper(x2, x1, x2, x1, y2, y1, y2, y1, z2, z1, z2, z1),ta = divideScalar(subtract(multiplyScalar(d1343, d4321), multiplyScalar(d1321, d4343)), subtract(multiplyScalar(d2121, d4343), multiplyScalar(d4321, d4321))),tb = divideScalar(addScalar(d1343, multiplyScalar(ta, d4321)), d4343),pax = addScalar(x1, multiplyScalar(ta, subtract(x2, x1))),pay = addScalar(y1, multiplyScalar(ta, subtract(y2, y1))),paz = addScalar(z1, multiplyScalar(ta, subtract(z2, z1))),pbx = addScalar(x3, multiplyScalar(tb, subtract(x4, x3))),pby = addScalar(y3, multiplyScalar(tb, subtract(y4, y3))),pbz = addScalar(z3, multiplyScalar(tb, subtract(z4, z3)));return equalScalar(pax, pbx) && equalScalar(pay, pby) && equalScalar(paz, pbz) ? [pax, pay, paz] : null;}function _intersectLinePlane(x1, y1, z1, x2, y2, z2, x, y, z, c) {var x1x = multiplyScalar(x1, x),x2x = multiplyScalar(x2, x),y1y = multiplyScalar(y1, y),y2y = multiplyScalar(y2, y),z1z = multiplyScalar(z1, z),z2z = multiplyScalar(z2, z),t = divideScalar(subtract(subtract(subtract(c, x1x), y1y), z1z), subtract(subtract(subtract(addScalar(addScalar(x2x, y2y), z2z), x1x), y1y), z1z)),px = addScalar(x1, multiplyScalar(t, subtract(x2, x1))),py = addScalar(y1, multiplyScalar(t, subtract(y2, y1))),pz = addScalar(z1, multiplyScalar(t, subtract(z2, z1)));return [px, py, pz];}var typed = _ref.typed,config = _ref.config,abs = _ref.abs,add = _ref.add,addScalar = _ref.addScalar,matrix = _ref.matrix,multiply = _ref.multiply,multiplyScalar = _ref.multiplyScalar,divideScalar = _ref.divideScalar,subtract = _ref.subtract,smaller = _ref.smaller,equalScalar = _ref.equalScalar;return typed("intersect", { "Array, Array, Array": function (x, y, plane) {if (!_3d(x)) throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if (!_3d(y)) throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if (!_4d(plane)) throw new TypeError("Array with 4 numbers expected as third argument");return _intersectLinePlane(x[0], x[1], x[2], y[0], y[1], y[2], plane[0], plane[1], plane[2], plane[3]);}, "Array, Array, Array, Array": function (w, x, y, z) {if (2 === w.length) {if (!_2d(w)) throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if (!_2d(x)) throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if (!_2d(y)) throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if (!_2d(z)) throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return _intersect2d(w, x, y, z);}if (3 === w.length) {if (!_3d(w)) throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if (!_3d(x)) throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if (!_3d(y)) throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if (!_3d(z)) throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return _intersect3d(w[0], w[1], w[2], x[0], x[1], x[2], y[0], y[1], y[2], z[0], z[1], z[2]);}throw new TypeError("Arrays with two or thee dimensional points expected");}, "Matrix, Matrix, Matrix": function (x, y, plane) {return matrix(this(x.valueOf(), y.valueOf(), plane.valueOf()));}, "Matrix, Matrix, Matrix, Matrix": function (w, x, y, z) {return matrix(this(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf()));} });});exports.createIntersect = createIntersect;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/logical/and.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAnd = void 0;var _algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm06.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "and",dependencies = ["typed", "matrix", "equalScalar", "zeros", "not"],createAnd = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,zeros = _ref.zeros,not = _ref.not,algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm06 = (0, _algorithm5.createAlgorithm06)({ typed: typed, equalScalar: equalScalar }),algorithm11 = (0, _algorithm2.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm13 = (0, _algorithm3.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.andNumber, "Complex, Complex": function (x, y) {return (0 !== x.re || 0 !== x.im) && (0 !== y.re || 0 !== y.im);}, "BigNumber, BigNumber": function (x, y) {return !x.isZero() && !y.isZero() && !x.isNaN() && !y.isNaN();}, "Unit, Unit": function (x, y) {return this(x.value || 0, y.value || 0);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm06(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm02(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return not(y) ? zeros(x.size(), x.storage()) : algorithm11(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return not(y) ? zeros(x.size(), x.storage()) : algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return not(x) ? zeros(x.size(), x.storage()) : algorithm11(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return not(x) ? zeros(x.size(), x.storage()) : algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return this(matrix(x), y).valueOf();}, "any, Array": function (x, y) {return this(x, matrix(y)).valueOf();} });});exports.createAnd = createAnd;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/logical/not.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createNot = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "not",dependencies = ["typed"],createNot = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.notNumber, Complex: function (x) {return 0 === x.re && 0 === x.im;}, BigNumber: function (x) {return x.isZero() || x.isNaN();}, Unit: function (x) {return !(null !== x.value) || this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createNot = createNot;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/logical/or.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createOr = void 0;var _algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm05.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "or",dependencies = ["typed", "matrix", "equalScalar", "DenseMatrix"],createOr = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm05 = (0, _algorithm5.createAlgorithm05)({ typed: typed, equalScalar: equalScalar }),algorithm12 = (0, _algorithm2.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm3.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.orNumber, "Complex, Complex": function (x, y) {return 0 !== x.re || 0 !== x.im || 0 !== y.re || 0 !== y.im;}, "BigNumber, BigNumber": function (x, y) {return !x.isZero() && !x.isNaN() || !y.isZero() && !y.isNaN();}, "Unit, Unit": function (x, y) {return this(x.value || 0, y.value || 0);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm05(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createOr = createOr;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/logical/xor.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createXor = void 0;var _algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "xor",dependencies = ["typed", "matrix", "DenseMatrix"],createXor = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm2.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm12 = (0, _algorithm3.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm4.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm5.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": _index.xorNumber, "Complex, Complex": function (x, y) {return (0 !== x.re || 0 !== x.im) != (0 !== y.re || 0 !== y.im);}, "BigNumber, BigNumber": function (x, y) {return (!x.isZero() && !x.isNaN()) != (!y.isZero() && !y.isNaN());}, "Unit, Unit": function (x, y) {return this(x.value || 0, y.value || 0);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createXor = createXor;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/apply.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createApply = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_IndexError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/IndexError.js"),name = "apply",dependencies = ["typed", "isInteger"],createApply = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,isInteger = _ref.isInteger;return typed(name, { "Array | Matrix, number | BigNumber, function": function (mat, dim, callback) {if (!isInteger(dim)) throw new TypeError("Integer number expected for dimension");var size = Array.isArray(mat) ? (0, _array.arraySize)(mat) : mat.size();if (0 > dim || dim >= size.length) throw new _IndexError.IndexError(dim, size.length);return (0, _is.isMatrix)(mat) ? mat.create(_apply(mat.valueOf(), dim, callback)) : _apply(mat, dim, callback);} });});exports.createApply = createApply;function _apply(mat, dim, callback) {var i, ret, tran;if (0 >= dim) {if (!Array.isArray(mat[0])) return callback(mat);for (tran = _switch(mat), ret = [], i = 0; i < tran.length; i++) ret[i] = _apply(tran[i], dim - 1, callback);return ret;}for (ret = [], i = 0; i < mat.length; i++) ret[i] = _apply(mat[i], dim - 1, callback);return ret;}function _switch(mat) {var i,j,I = mat.length,J = mat[0].length,ret = [];for (j = 0; j < J; j++) {var tmp = [];for (i = 0; i < I; i++) tmp.push(mat[i][j]);ret.push(tmp);}return ret;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/column.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createColumn = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),name = "column",dependencies = ["typed", "Index", "matrix", "range"],createColumn = (0, _factory.factory)(name, dependencies, function (_ref) {function _column(value, column) {if (2 !== value.size().length) throw new Error("Only two dimensional matrix is supported");(0, _array.validateIndex)(column, value.size()[1]);var rowRange = range(0, value.size()[0]),index = new Index(rowRange, column);return value.subset(index);}var typed = _ref.typed,Index = _ref.Index,matrix = _ref.matrix,range = _ref.range;return typed(name, { "Matrix, number": _column, "Array, number": function (value, column) {return _column(matrix((0, _object.clone)(value)), column).valueOf();} });});exports.createColumn = createColumn;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/concat.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createConcat = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_IndexError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/IndexError.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "concat",dependencies = ["typed", "matrix", "isInteger"],createConcat = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,isInteger = _ref.isInteger;return typed(name, { "...Array | Matrix | number | BigNumber": function (args) {var i,prevDim,len = args.length,dim = -1,asMatrix = !1,matrices = [];for (i = 0; i < len; i++) {var arg = args[i];if ((0, _is.isMatrix)(arg) && (asMatrix = !0), (0, _is.isNumber)(arg) || (0, _is.isBigNumber)(arg)) {if (i !== len - 1) throw new Error("Dimension must be specified as last argument");if (prevDim = dim, dim = arg.valueOf(), !isInteger(dim)) throw new TypeError("Integer number expected for dimension");if (0 > dim || 0 < i && dim > prevDim) throw new _IndexError.IndexError(dim, prevDim + 1);} else {var m = (0, _object.clone)(arg).valueOf(),size = (0, _array.arraySize)(m);if (matrices[i] = m, prevDim = dim, dim = size.length - 1, 0 < i && dim !== prevDim) throw new _DimensionError.DimensionError(prevDim + 1, dim + 1);}}if (0 === matrices.length) throw new SyntaxError("At least one matrix expected");for (var res = matrices.shift(); matrices.length;) res = _concat(res, matrices.shift(), dim, 0);return asMatrix ? matrix(res) : res;}, "...string": function (args) {return args.join("");} });});exports.createConcat = createConcat;function _concat(a, b, concatDim, dim) {if (dim < concatDim) {if (a.length !== b.length) throw new _DimensionError.DimensionError(a.length, b.length);for (var c = [], i = 0; i < a.length; i++) c[i] = _concat(a[i], b[i], concatDim, dim + 1);return c;}return a.concat(b);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/count.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCount = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "count",dependencies = ["typed", "size", "prod"],createCount = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,size = _ref.size,prod = _ref.prod;return typed(name, { string: function (x) {return x.length;}, "Matrix | Array": function (x) {return prod(size(x));} });});exports.createCount = createCount;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/cross.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCross = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "cross",dependencies = ["typed", "matrix", "subtract", "multiply"],createCross = (0, _factory.factory)(name, dependencies, function (_ref) {function _cross(x, y) {var highestDimension = Math.max((0, _array.arraySize)(x).length, (0, _array.arraySize)(y).length);x = (0, _array.squeeze)(x), y = (0, _array.squeeze)(y);var xSize = (0, _array.arraySize)(x),ySize = (0, _array.arraySize)(y);if (1 !== xSize.length || 1 !== ySize.length || 3 !== xSize[0] || 3 !== ySize[0]) throw new RangeError("Vectors with length 3 expected (Size A = [" + xSize.join(", ") + "], B = [" + ySize.join(", ") + "])");var product = [subtract(multiply(x[1], y[2]), multiply(x[2], y[1])), subtract(multiply(x[2], y[0]), multiply(x[0], y[2])), subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))];return 1 < highestDimension ? [product] : product;}var typed = _ref.typed,matrix = _ref.matrix,subtract = _ref.subtract,multiply = _ref.multiply;return typed(name, { "Matrix, Matrix": function (x, y) {return matrix(_cross(x.toArray(), y.toArray()));}, "Matrix, Array": function (x, y) {return matrix(_cross(x.toArray(), y));}, "Array, Matrix": function (x, y) {return matrix(_cross(x, y.toArray()));}, "Array, Array": _cross });});exports.createCross = createCross;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCtranspose = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "ctranspose",dependencies = ["typed", "transpose", "conj"],createCtranspose = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,transpose = _ref.transpose,conj = _ref.conj;return typed(name, { any: function (x) {return conj(transpose(x));} });});exports.createCtranspose = createCtranspose;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/det.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDet = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "det",dependencies = ["typed", "matrix", "subtract", "multiply", "unaryMinus", "lup"],createDet = (0, _factory.factory)(name, dependencies, function (_ref) {function _det(matrix, rows) {if (1 === rows) return (0, _object.clone)(matrix[0][0]);if (2 === rows) return subtract(multiply(matrix[0][0], matrix[1][1]), multiply(matrix[1][0], matrix[0][1]));for (var decomp = lup(matrix), det = decomp.U[0][0], _i = 1; _i < rows; _i++) det = multiply(det, decomp.U[_i][_i]);for (var evenCycles = 0, i = 0, visited = [];;) {for (; visited[i];) i++;if (i >= rows) break;for (var j = i, cycleLen = 0; !visited[decomp.p[j]];) visited[decomp.p[j]] = !0, j = decomp.p[j], cycleLen++;0 == cycleLen % 2 && evenCycles++;}return 0 == evenCycles % 2 ? det : unaryMinus(det);}var typed = _ref.typed,matrix = _ref.matrix,subtract = _ref.subtract,multiply = _ref.multiply,unaryMinus = _ref.unaryMinus,lup = _ref.lup;return typed(name, { any: function (x) {return (0, _object.clone)(x);}, "Array | Matrix": function (x) {var size;switch ((0, _is.isMatrix)(x) ? size = x.size() : Array.isArray(x) ? (x = matrix(x), size = x.size()) : size = [], size.length) {case 0:return (0, _object.clone)(x);case 1:if (1 === size[0]) return (0, _object.clone)(x.valueOf()[0]);throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");case 2:{var rows = size[0],cols = size[1];if (rows === cols) return _det(x.clone().valueOf(), rows, cols);throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");}default:throw new RangeError("Matrix must be two dimensional (size: " + (0, _string.format)(size) + ")");}} });});exports.createDet = createDet;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/diag.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDiag = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "diag",dependencies = ["typed", "matrix", "DenseMatrix", "SparseMatrix"],createDiag = (0, _factory.factory)(name, dependencies, function (_ref) {function _diag(x, k, size, format) {if (!(0, _number.isInteger)(k)) throw new TypeError("Second parameter in function diag must be an integer");var kSuper = 0 < k ? k : 0,kSub = 0 > k ? -k : 0;switch (size.length) {case 1:return _createDiagonalMatrix(x, k, format, size[0], kSub, kSuper);case 2:return _getDiagonal(x, k, format, size, kSub, kSuper);}throw new RangeError("Matrix for function diag must be 2 dimensional");}function _createDiagonalMatrix(x, k, format, l, kSub, kSuper) {var ms = [l + kSub, l + kSuper];if (format && "sparse" !== format && "dense" !== format) throw new TypeError("Unknown matrix type ".concat(format, "\""));var m = "sparse" === format ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix.diagonal(ms, x, k);return null === format ? m.valueOf() : m;}function _getDiagonal(x, k, format, s, kSub, kSuper) {if ((0, _is.isMatrix)(x)) {var dm = x.diagonal(k);return null === format ? dm.valueOf() : format === dm.storage() ? dm : matrix(dm, format);}for (var n = Math.min(s[0] - kSub, s[1] - kSuper), vector = [], i = 0; i < n; i++) vector[i] = x[i + kSub][i + kSuper];return null === format ? vector : matrix(vector);}var typed = _ref.typed,matrix = _ref.matrix,DenseMatrix = _ref.DenseMatrix,SparseMatrix = _ref.SparseMatrix;return typed(name, { Array: function (x) {return _diag(x, 0, (0, _array.arraySize)(x), null);}, "Array, number": function (x, k) {return _diag(x, k, (0, _array.arraySize)(x), null);}, "Array, BigNumber": function (x, k) {return _diag(x, k.toNumber(), (0, _array.arraySize)(x), null);}, "Array, string": function (x, format) {return _diag(x, 0, (0, _array.arraySize)(x), format);}, "Array, number, string": function (x, k, format) {return _diag(x, k, (0, _array.arraySize)(x), format);}, "Array, BigNumber, string": function (x, k, format) {return _diag(x, k.toNumber(), (0, _array.arraySize)(x), format);}, Matrix: function (x) {return _diag(x, 0, x.size(), x.storage());}, "Matrix, number": function (x, k) {return _diag(x, k, x.size(), x.storage());}, "Matrix, BigNumber": function (x, k) {return _diag(x, k.toNumber(), x.size(), x.storage());}, "Matrix, string": function (x, format) {return _diag(x, 0, x.size(), format);}, "Matrix, number, string": function (x, k, format) {return _diag(x, k, x.size(), format);}, "Matrix, BigNumber, string": function (x, k, format) {return _diag(x, k.toNumber(), x.size(), format);} });});exports.createDiag = createDiag;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/diff.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDiff = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "diff",dependencies = ["typed", "matrix", "subtract", "number"],createDiff = (0, _factory.factory)(name, dependencies, function (_ref) {function _recursive(arr, dim) {if ((0, _is.isMatrix)(arr) && (arr = arr.toArray()), !Array.isArray(arr)) throw RangeError("Array/Matrix does not have that many dimensions");if (0 < dim) {var result = [];return arr.forEach(function (element) {result.push(_recursive(element, dim - 1));}), result;}if (0 === dim) return _diff(arr);throw RangeError("Cannot have negative dimension");}function _diff(arr) {var result = [],size = arr.length;if (2 > size) return arr;for (var i = 1; i < size; i++) result.push(_ElementDiff(arr[i - 1], arr[i]));return result;}function _ElementDiff(obj1, obj2) {(0, _is.isMatrix)(obj1) && (obj1 = obj1.toArray()), (0, _is.isMatrix)(obj2) && (obj2 = obj2.toArray());var obj1IsArray = Array.isArray(obj1),obj2IsArray = Array.isArray(obj2);if (obj1IsArray && obj2IsArray) return _ArrayDiff(obj1, obj2);if (!obj1IsArray && !obj2IsArray) return subtract(obj2, obj1);throw TypeError("Cannot calculate difference between 1 array and 1 non-array");}function _ArrayDiff(arr1, arr2) {if (arr1.length !== arr2.length) throw RangeError("Not all sub-arrays have the same length");for (var result = [], size = arr1.length, i = 0; i < size; i++) result.push(_ElementDiff(arr1[i], arr2[i]));return result;}var typed = _ref.typed,matrix = _ref.matrix,subtract = _ref.subtract,number = _ref.number;return typed(name, { "Array | Matrix": function (arr) {return (0, _is.isMatrix)(arr) ? matrix(_diff(arr.toArray())) : _diff(arr);}, "Array | Matrix, number": function (arr, dim) {if (!(0, _number.isInteger)(dim)) throw new RangeError("Dimension must be a whole number");return (0, _is.isMatrix)(arr) ? matrix(_recursive(arr.toArray(), dim)) : _recursive(arr, dim);}, "Array | Matrix, BigNumber": function (arr, dim) {return this(arr, number(dim));} });});exports.createDiff = createDiff;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/dot.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDot = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "dot",dependencies = ["typed", "addScalar", "multiplyScalar", "conj", "size"],createDot = (0, _factory.factory)(name, dependencies, function (_ref) {function _validateDim(x, y) {var xLen,yLen,xSize = _size(x),ySize = _size(y);if (1 === xSize.length) xLen = xSize[0];else if (2 === xSize.length && 1 === xSize[1]) xLen = xSize[0];else throw new RangeError("Expected a column vector, instead got a matrix of size (" + xSize.join(", ") + ")");if (1 === ySize.length) yLen = ySize[0];else if (2 === ySize.length && 1 === ySize[1]) yLen = ySize[0];else throw new RangeError("Expected a column vector, instead got a matrix of size (" + ySize.join(", ") + ")");if (xLen !== yLen) throw new RangeError("Vectors must have equal length (" + xLen + " != " + yLen + ")");if (0 === xLen) throw new RangeError("Cannot calculate the dot product of empty vectors");return xLen;}function _size(x) {return (0, _is.isMatrix)(x) ? x.size() : size(x);}var typed = _ref.typed,addScalar = _ref.addScalar,multiplyScalar = _ref.multiplyScalar,conj = _ref.conj,size = _ref.size;return typed(name, { "Array | DenseMatrix, Array | DenseMatrix": function (a, b) {var N = _validateDim(a, b),adata = (0, _is.isMatrix)(a) ? a._data : a,adt = (0, _is.isMatrix)(a) ? a._datatype : void 0,bdata = (0, _is.isMatrix)(b) ? b._data : b,bdt = (0, _is.isMatrix)(b) ? b._datatype : void 0,aIsColumn = 2 === _size(a).length,bIsColumn = 2 === _size(b).length,add = addScalar,mul = multiplyScalar;if (adt && bdt && adt === bdt && "string" == typeof adt) {var dt = adt;add = typed.find(addScalar, [dt, dt]), mul = typed.find(multiplyScalar, [dt, dt]);}if (!aIsColumn && !bIsColumn) {for (var c = mul(conj(adata[0]), bdata[0]), i = 1; i < N; i++) c = add(c, mul(conj(adata[i]), bdata[i]));return c;}if (!aIsColumn && bIsColumn) {for (var _c = mul(conj(adata[0]), bdata[0][0]), _i = 1; _i < N; _i++) _c = add(_c, mul(conj(adata[_i]), bdata[_i][0]));return _c;}if (aIsColumn && !bIsColumn) {for (var _c2 = mul(conj(adata[0][0]), bdata[0]), _i2 = 1; _i2 < N; _i2++) _c2 = add(_c2, mul(conj(adata[_i2][0]), bdata[_i2]));return _c2;}if (aIsColumn && bIsColumn) {for (var _c3 = mul(conj(adata[0][0]), bdata[0][0]), _i3 = 1; _i3 < N; _i3++) _c3 = add(_c3, mul(conj(adata[_i3][0]), bdata[_i3][0]));return _c3;}}, "SparseMatrix, SparseMatrix": function (x, y) {_validateDim(x, y);for (var xindex = x._index, xvalues = x._values, yindex = y._index, yvalues = y._values, c = 0, i = 0, j = 0; i < xindex.length && j < yindex.length;) {var I = xindex[i],J = yindex[j];if (I < J) {i++;continue;}if (I > J) {j++;continue;}I === J && (c = addScalar(c, multiplyScalar(xvalues[i], yvalues[j])), i++, j++);}return c;} });});exports.createDot = createDot;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/eigs.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createEigs = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_complexEigs = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/eigs/complexEigs.js"),_realSymetric = __webpack_require__("./node_modules/mathjs/lib/cjs/function/matrix/eigs/realSymetric.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "eigs",dependencies = ["config", "typed", "matrix", "addScalar", "equal", "subtract", "abs", "atan", "cos", "sin", "multiplyScalar", "divideScalar", "inv", "bignumber", "multiply", "add", "larger", "column", "flatten", "number", "complex", "sqrt", "diag", "qr", "usolveAll", "im", "re", "smaller", "round", "log10", "transpose", "matrixFromColumns"],createEigs = (0, _factory.factory)(name, dependencies, function (_ref) {function computeValuesAndVectors(mat, prec) {prec === void 0 && (prec = config.epsilon);var size = mat.size();if (2 !== size.length || size[0] !== size[1]) throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");var arr = mat.toArray(),N = size[0];if (isReal(arr, N, prec) && (coerceReal(arr, N), isSymmetric(arr, N, prec))) {var _type = coerceTypes(mat, arr, N);return doRealSymetric(arr, N, prec, _type);}var type = coerceTypes(mat, arr, N);return doComplexEigs(arr, N, prec, type);}function isSymmetric(arr, N, prec) {for (var i = 0; i < N; i++) for (var j = i; j < N; j++) if (larger(bignumber(abs(subtract(arr[i][j], arr[j][i]))), prec)) return !1;return !0;}function isReal(arr, N, prec) {for (var i = 0; i < N; i++) for (var j = 0; j < N; j++) if (larger(bignumber(abs(im(arr[i][j]))), prec)) return !1;return !0;}function coerceReal(arr, N) {for (var i = 0; i < N; i++) for (var j = 0; j < N; j++) arr[i][j] = re(arr[i][j]);}function coerceTypes(mat, arr, N) {var type = mat.datatype();if ("number" === type || "BigNumber" === type || "Complex" === type) return type;for (var hasNumber = !1, hasBig = !1, hasComplex = !1, i = 0; i < N; i++) for (var el, j = 0; j < N; j++) if (el = arr[i][j], (0, _is.isNumber)(el) || (0, _is.isFraction)(el)) hasNumber = !0;else if ((0, _is.isBigNumber)(el)) hasBig = !0;else if ((0, _is.isComplex)(el)) hasComplex = !0;else throw TypeError("Unsupported type in Matrix: " + (0, _is.typeOf)(el));if (hasBig && hasComplex && console.warn("Complex BigNumbers not supported, this operation will lose precission."), hasComplex) {for (var _i = 0; _i < N; _i++) for (var _j = 0; _j < N; _j++) arr[_i][_j] = complex(arr[_i][_j]);return "Complex";}if (hasBig) {for (var _i2 = 0; _i2 < N; _i2++) for (var _j2 = 0; _j2 < N; _j2++) arr[_i2][_j2] = bignumber(arr[_i2][_j2]);return "BigNumber";}if (hasNumber) {for (var _i3 = 0; _i3 < N; _i3++) for (var _j3 = 0; _j3 < N; _j3++) arr[_i3][_j3] = number(arr[_i3][_j3]);return "number";}throw TypeError("Matrix contains unsupported types only.");}var config = _ref.config,typed = _ref.typed,matrix = _ref.matrix,addScalar = _ref.addScalar,subtract = _ref.subtract,equal = _ref.equal,abs = _ref.abs,atan = _ref.atan,cos = _ref.cos,sin = _ref.sin,multiplyScalar = _ref.multiplyScalar,divideScalar = _ref.divideScalar,inv = _ref.inv,bignumber = _ref.bignumber,multiply = _ref.multiply,add = _ref.add,larger = _ref.larger,column = _ref.column,flatten = _ref.flatten,number = _ref.number,complex = _ref.complex,sqrt = _ref.sqrt,diag = _ref.diag,qr = _ref.qr,usolveAll = _ref.usolveAll,im = _ref.im,re = _ref.re,smaller = _ref.smaller,round = _ref.round,log10 = _ref.log10,transpose = _ref.transpose,matrixFromColumns = _ref.matrixFromColumns,doRealSymetric = (0, _realSymetric.createRealSymmetric)({ config: config, addScalar: addScalar, subtract: subtract, column: column, flatten: flatten, equal: equal, abs: abs, atan: atan, cos: cos, sin: sin, multiplyScalar: multiplyScalar, inv: inv, bignumber: bignumber, complex: complex, multiply: multiply, add: add }),doComplexEigs = (0, _complexEigs.createComplexEigs)({ config: config, addScalar: addScalar, subtract: subtract, multiply: multiply, multiplyScalar: multiplyScalar, flatten: flatten, divideScalar: divideScalar, sqrt: sqrt, abs: abs, bignumber: bignumber, diag: diag, qr: qr, inv: inv, usolveAll: usolveAll, equal: equal, complex: complex, larger: larger, smaller: smaller, round: round, log10: log10, transpose: transpose, matrixFromColumns: matrixFromColumns });return typed("eigs", { Array: function (x) {var mat = matrix(x);return computeValuesAndVectors(mat);}, "Array, number|BigNumber": function (x, prec) {var mat = matrix(x);return computeValuesAndVectors(mat, prec);}, Matrix: function (mat) {var _computeValuesAndVect = computeValuesAndVectors(mat),values = _computeValuesAndVect.values,vectors = _computeValuesAndVect.vectors;return { values: matrix(values), vectors: matrix(vectors) };}, "Matrix, number|BigNumber": function (mat, prec) {var _computeValuesAndVect2 = computeValuesAndVectors(mat, prec),values = _computeValuesAndVect2.values,vectors = _computeValuesAndVect2.vectors;return { values: matrix(values), vectors: matrix(vectors) };} });});exports.createEigs = createEigs;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/eigs/complexEigs.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createComplexEigs = createComplexEigs;var _toConsumableArray2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js")),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js");function _createForOfIteratorHelper(o, allowArrayLike) {var it = "undefined" != typeof Symbol && o[Symbol.iterator] || o["@@iterator"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && "number" == typeof o.length) {it && (o = it);var i = 0,F = function () {};return { s: F, n: function () {return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] };}, e: function (_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var err,normalCompletion = !0,didErr = !1;return { s: function () {it = it.call(o);}, n: function () {var step = it.next();return normalCompletion = step.done, step;}, e: function (_e2) {didErr = !0, err = _e2;}, f: function () {try {normalCompletion || null == it["return"] || it["return"]();} finally {if (didErr) throw err;}} };}function _unsupportedIterableToArray(o, minLen) {if (o) {if ("string" == typeof o) return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);return "Object" === n && o.constructor && (n = o.constructor.name), "Map" === n || "Set" === n ? Array.from(o) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(o, minLen) : void 0;}}function _arrayLikeToArray(arr, len) {(null == len || len > arr.length) && (len = arr.length);for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}function createComplexEigs(_ref) {function balance(arr, N, prec, type, findVectors) {var Rdiag,big = "BigNumber" === type,cplx = "Complex" === type,zero = big ? bignumber(0) : cplx ? complex(0) : 0,one = big ? bignumber(1) : cplx ? complex(1) : 1,radix = big ? bignumber(10) : 2,radixSq = multiplyScalar(radix, radix);findVectors && (Rdiag = Array(N).fill(one));for (var last = !1; !last;) {last = !0;for (var i = 0; i < N; i++) {for (var colNorm = zero, rowNorm = zero, j = 0; j < N; j++) if (i !== j) {var c = abs(arr[i][j]);colNorm = addScalar(colNorm, c), rowNorm = addScalar(rowNorm, c);}if (!equal(colNorm, 0) && !equal(rowNorm, 0)) {for (var f = one, _c = colNorm, rowDivRadix = divideScalar(rowNorm, radix), rowMulRadix = multiplyScalar(rowNorm, radix); smaller(_c, rowDivRadix);) _c = multiplyScalar(_c, radixSq), f = multiplyScalar(f, radix);for (; larger(_c, rowMulRadix);) _c = divideScalar(_c, radixSq), f = divideScalar(f, radix);var condition = smaller(divideScalar(addScalar(_c, rowNorm), f), multiplyScalar(addScalar(colNorm, rowNorm), .95));if (condition) {last = !1;for (var g = divideScalar(1, f), _j = 0; _j < N; _j++) i !== _j && (arr[i][_j] = multiplyScalar(arr[i][_j], f), arr[_j][i] = multiplyScalar(arr[_j][i], g));findVectors && (Rdiag[i] = multiplyScalar(Rdiag[i], f));}}}}return diag(Rdiag);}function reduceToHessenberg(arr, N, prec, type, findVectors, R) {var big = "BigNumber" === type,zero = big ? bignumber(0) : "Complex" === type ? complex(0) : 0;big && (prec = bignumber(prec));for (var i = 0; i < N - 2; i++) {for (var el, maxIndex = 0, max = zero, j = i + 1; j < N; j++) el = arr[j][i], smaller(abs(max), abs(el)) && (max = el, maxIndex = j);if (!smaller(abs(max), prec)) {if (maxIndex !== i + 1) {var tmp1 = arr[maxIndex];arr[maxIndex] = arr[i + 1], arr[i + 1] = tmp1;for (var tmp2, _j2 = 0; _j2 < N; _j2++) tmp2 = arr[_j2][maxIndex], arr[_j2][maxIndex] = arr[_j2][i + 1], arr[_j2][i + 1] = tmp2;if (findVectors) {var tmp3 = R[maxIndex];R[maxIndex] = R[i + 1], R[i + 1] = tmp3;}}for (var n, _j3 = i + 2; _j3 < N; _j3++) if (n = divideScalar(arr[_j3][i], max), 0 !== n) {for (var k = 0; k < N; k++) arr[_j3][k] = subtract(arr[_j3][k], multiplyScalar(n, arr[i + 1][k]));for (var _k = 0; _k < N; _k++) arr[_k][i + 1] = addScalar(arr[_k][i + 1], multiplyScalar(n, arr[_k][_j3]));if (findVectors) for (var _k2 = 0; _k2 < N; _k2++) R[_j3][_k2] = subtract(R[_j3][_k2], multiplyScalar(n, R[i + 1][_k2]));}}}return R;}function iterateUntilTriangular(A, N, prec, type, findVectors) {var big = "BigNumber" === type,one = big ? bignumber(1) : "Complex" === type ? complex(1) : 1;big && (prec = bignumber(prec));for (var arr = (0, _object.clone)(A), lambdas = [], n = N, Sdiag = [], Qtotal = findVectors ? diag(Array(N).fill(one)) : void 0, Qpartial = findVectors ? diag(Array(n).fill(one)) : void 0, lastConvergenceBefore = 0; 100 >= lastConvergenceBefore;) {lastConvergenceBefore += 1;for (var k = 0, i = 0; i < n; i++) arr[i][i] = subtract(arr[i][i], k);var _qr = qr(arr),Q = _qr.Q,R = _qr.R;arr = multiply(R, Q);for (var _i = 0; _i < n; _i++) arr[_i][_i] = addScalar(arr[_i][_i], k);if (findVectors && (Qpartial = multiply(Qpartial, Q)), 1 === n || smaller(abs(arr[n - 1][n - 2]), prec)) {lastConvergenceBefore = 0, lambdas.push(arr[n - 1][n - 1]), findVectors && (Sdiag.unshift([[1]]), inflateMatrix(Qpartial, N), Qtotal = multiply(Qtotal, Qpartial), 1 < n && (Qpartial = diag(Array(n - 1).fill(one)))), n -= 1, arr.pop();for (var _i2 = 0; _i2 < n; _i2++) arr[_i2].pop();} else if (2 === n || smaller(abs(arr[n - 2][n - 3]), prec)) {lastConvergenceBefore = 0;var ll = eigenvalues2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1]);lambdas.push.apply(lambdas, (0, _toConsumableArray2["default"])(ll)), findVectors && (Sdiag.unshift(jordanBase2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1], ll[0], ll[1], prec, type)), inflateMatrix(Qpartial, N), Qtotal = multiply(Qtotal, Qpartial), 2 < n && (Qpartial = diag(Array(n - 2).fill(one)))), n -= 2, arr.pop(), arr.pop();for (var _i3 = 0; _i3 < n; _i3++) arr[_i3].pop(), arr[_i3].pop();}if (0 === n) break;}if (lambdas.sort(function (a, b) {return +subtract(abs(a), abs(b));}), 100 < lastConvergenceBefore) {var err = Error("The eigenvalues failed to converge. Only found these eigenvalues: " + lambdas.join(", "));throw err.values = lambdas, err.vectors = [], err;}var C = findVectors ? multiply(Qtotal, blockDiag(Sdiag, N)) : void 0;return { values: lambdas, C: C };}function findEigenvectors(A, N, C, values, prec) {var _step,Cinv = inv(C),U = multiply(Cinv, A, C),uniqueValues = [],multiplicities = [],_iterator = _createForOfIteratorHelper(values);try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var _λ = _step.value,_i4 = indexOf(uniqueValues, _λ, equal);if (-1 === _i4) {var rounded = round(_λ, subtract(-1, round(log10(prec))));uniqueValues.push(rounded), multiplicities.push(1);} else multiplicities[_i4] += 1;}} catch (err) {_iterator.e(err);} finally {_iterator.f();}for (var vectors = [], len = uniqueValues.length, b = Array(N).fill(0), E = diag(Array(N).fill(1)), failedLambdas = [], i = 0; i < len; i++) {var λ = uniqueValues[i],solutions = usolveAll(subtract(U, multiply(λ, E)), b);solutions = solutions.map(function (v) {return multiply(C, v);}), solutions.shift(), solutions.length < multiplicities[i] && failedLambdas.push(λ), vectors.push.apply(vectors, (0, _toConsumableArray2["default"])(solutions.map(function (v) {return flatten(v);})));}if (0 !== failedLambdas.length) {var err = new Error("Failed to find eigenvectors for the following eigenvalues: " + failedLambdas.join(", "));throw err.values = values, err.vectors = vectors, err;}return vectors;}function eigenvalues2x2(a, b, c, d) {var trA = addScalar(a, d),detA = subtract(multiplyScalar(a, d), multiplyScalar(b, c)),x = multiplyScalar(trA, .5),y = multiplyScalar(sqrt(subtract(multiplyScalar(trA, trA), multiplyScalar(4, detA))), .5);return [addScalar(x, y), subtract(x, y)];}function jordanBase2x2(a, b, c, d, l1, l2, prec, type) {var big = "BigNumber" === type,cplx = "Complex" === type,zero = big ? bignumber(0) : cplx ? complex(0) : 0,one = big ? bignumber(1) : cplx ? complex(1) : 1;if (smaller(abs(c), prec)) return [[one, zero], [zero, one]];if (larger(abs(subtract(l1, l2)), prec)) return [[subtract(l1, d), subtract(l2, d)], [c, c]];var na = subtract(a, l1),nb = subtract(b, l1),nc = subtract(c, l1),nd = subtract(d, l1);return smaller(abs(nb), prec) ? [[na, one], [nc, zero]] : [[nb, zero], [nd, one]];}function inflateMatrix(arr, N) {for (var i = 0; i < arr.length; i++) {var _arr$i;(_arr$i = arr[i]).push.apply(_arr$i, (0, _toConsumableArray2["default"])(Array(N - arr[i].length).fill(0)));}for (var _i5 = arr.length; _i5 < N; _i5++) arr.push(Array(N).fill(0)), arr[_i5][_i5] = 1;return arr;}function blockDiag(arr, N) {for (var M = [], i = 0; i < N; i++) M[i] = Array(N).fill(0);var _step2,I = 0,_iterator2 = _createForOfIteratorHelper(arr);try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {for (var sub = _step2.value, n = sub.length, _i6 = 0; _i6 < n; _i6++) for (var j = 0; j < n; j++) M[I + _i6][I + j] = sub[_i6][j];I += n;}} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}return M;}function indexOf(arr, el, fn) {for (var i = 0; i < arr.length; i++) if (fn(arr[i], el)) return i;return -1;}var addScalar = _ref.addScalar,subtract = _ref.subtract,flatten = _ref.flatten,multiply = _ref.multiply,multiplyScalar = _ref.multiplyScalar,divideScalar = _ref.divideScalar,sqrt = _ref.sqrt,abs = _ref.abs,bignumber = _ref.bignumber,diag = _ref.diag,inv = _ref.inv,qr = _ref.qr,usolveAll = _ref.usolveAll,equal = _ref.equal,complex = _ref.complex,larger = _ref.larger,smaller = _ref.smaller,round = _ref.round,log10 = _ref.log10,transpose = _ref.transpose,matrixFromColumns = _ref.matrixFromColumns;return function (arr, N, prec, type, findVectors) {void 0 === findVectors && (findVectors = !0);var R = balance(arr, N, prec, type, findVectors);reduceToHessenberg(arr, N, prec, type, findVectors, R);var _iterateUntilTriangul = iterateUntilTriangular(arr, N, prec, type, findVectors),values = _iterateUntilTriangul.values,C = _iterateUntilTriangul.C;C = multiply(inv(R), C);var vectors;return findVectors && (vectors = findEigenvectors(arr, N, C, values, prec), vectors = matrixFromColumns.apply(void 0, (0, _toConsumableArray2["default"])(vectors))), { values: values, vectors: vectors };};}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/eigs/realSymetric.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRealSymmetric = createRealSymmetric;var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js");function createRealSymmetric(_ref) {function diag(x, precision) {for (var psi, N = x.length, e0 = Math.abs(precision / N), Sij = Array(N), i = 0; i < N; i++) Sij[i] = createArray(N, 0), Sij[i][i] = 1;for (var Vab = getAij(x); Math.abs(Vab[1]) >= Math.abs(e0);) {var _i = Vab[0][0],j = Vab[0][1];psi = getTheta(x[_i][_i], x[j][j], x[_i][j]), x = x1(x, psi, _i, j), Sij = Sij1(Sij, psi, _i, j), Vab = getAij(x);}for (var Ei = createArray(N, 0), _i2 = 0; _i2 < N; _i2++) Ei[_i2] = x[_i2][_i2];return sorting((0, _object.clone)(Ei), (0, _object.clone)(Sij));}function diagBig(x, precision) {for (var psi, N = x.length, e0 = abs(precision / N), Sij = Array(N), i = 0; i < N; i++) Sij[i] = createArray(N, 0), Sij[i][i] = 1;for (var Vab = getAijBig(x); abs(Vab[1]) >= abs(e0);) {var _i3 = Vab[0][0],j = Vab[0][1];psi = getThetaBig(x[_i3][_i3], x[j][j], x[_i3][j]), x = x1Big(x, psi, _i3, j), Sij = Sij1Big(Sij, psi, _i3, j), Vab = getAijBig(x);}for (var Ei = createArray(N, 0), _i4 = 0; _i4 < N; _i4++) Ei[_i4] = x[_i4][_i4];return sorting((0, _object.clone)(Ei), (0, _object.clone)(Sij));}function getTheta(aii, ajj, aij) {return Math.abs(ajj - aii) <= config.epsilon ? Math.PI / 4 : .5 * Math.atan(2 * aij / (ajj - aii));}function getThetaBig(aii, ajj, aij) {var denom = subtract(ajj, aii);return abs(denom) <= config.epsilon ? bignumber(-1).acos().div(4) : multiplyScalar(.5, atan(multiply(2, aij, inv(denom))));}function Sij1(Sij, theta, i, j) {for (var N = Sij.length, c = Math.cos(theta), s = Math.sin(theta), Ski = createArray(N, 0), Skj = createArray(N, 0), k = 0; k < N; k++) Ski[k] = c * Sij[k][i] - s * Sij[k][j], Skj[k] = s * Sij[k][i] + c * Sij[k][j];for (var _k = 0; _k < N; _k++) Sij[_k][i] = Ski[_k], Sij[_k][j] = Skj[_k];return Sij;}function Sij1Big(Sij, theta, i, j) {for (var N = Sij.length, c = cos(theta), s = sin(theta), Ski = createArray(N, bignumber(0)), Skj = createArray(N, bignumber(0)), k = 0; k < N; k++) Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j])), Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j]));for (var _k2 = 0; _k2 < N; _k2++) Sij[_k2][i] = Ski[_k2], Sij[_k2][j] = Skj[_k2];return Sij;}function x1Big(Hij, theta, i, j) {for (var N = Hij.length, c = bignumber(cos(theta)), s = bignumber(sin(theta)), c2 = multiplyScalar(c, c), s2 = multiplyScalar(s, s), Aki = createArray(N, bignumber(0)), Akj = createArray(N, bignumber(0)), csHij = multiply(bignumber(2), c, s, Hij[i][j]), Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j])), Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j])), k = 0; k < N; k++) Aki[k] = subtract(multiplyScalar(c, Hij[i][k]), multiplyScalar(s, Hij[j][k])), Akj[k] = addScalar(multiplyScalar(s, Hij[i][k]), multiplyScalar(c, Hij[j][k]));Hij[i][i] = Aii, Hij[j][j] = Ajj, Hij[i][j] = bignumber(0), Hij[j][i] = bignumber(0);for (var _k3 = 0; _k3 < N; _k3++) _k3 !== i && _k3 !== j && (Hij[i][_k3] = Aki[_k3], Hij[_k3][i] = Aki[_k3], Hij[j][_k3] = Akj[_k3], Hij[_k3][j] = Akj[_k3]);return Hij;}function x1(Hij, theta, i, j) {for (var N = Hij.length, c = Math.cos(theta), s = Math.sin(theta), c2 = c * c, s2 = s * s, Aki = createArray(N, 0), Akj = createArray(N, 0), Aii = c2 * Hij[i][i] - 2 * c * s * Hij[i][j] + s2 * Hij[j][j], Ajj = s2 * Hij[i][i] + 2 * c * s * Hij[i][j] + c2 * Hij[j][j], k = 0; k < N; k++) Aki[k] = c * Hij[i][k] - s * Hij[j][k], Akj[k] = s * Hij[i][k] + c * Hij[j][k];Hij[i][i] = Aii, Hij[j][j] = Ajj, Hij[i][j] = 0, Hij[j][i] = 0;for (var _k4 = 0; _k4 < N; _k4++) _k4 !== i && _k4 !== j && (Hij[i][_k4] = Aki[_k4], Hij[_k4][i] = Aki[_k4], Hij[j][_k4] = Akj[_k4], Hij[_k4][j] = Akj[_k4]);return Hij;}function getAij(Mij) {for (var N = Mij.length, maxMij = 0, maxIJ = [0, 1], i = 0; i < N; i++) for (var j = i + 1; j < N; j++) Math.abs(maxMij) < Math.abs(Mij[i][j]) && (maxMij = Math.abs(Mij[i][j]), maxIJ = [i, j]);return [maxIJ, maxMij];}function getAijBig(Mij) {for (var N = Mij.length, maxMij = 0, maxIJ = [0, 1], i = 0; i < N; i++) for (var j = i + 1; j < N; j++) abs(maxMij) < abs(Mij[i][j]) && (maxMij = abs(Mij[i][j]), maxIJ = [i, j]);return [maxIJ, maxMij];}function sorting(E, S) {for (var N = E.length, values = Array(N), vectors = Array(N), k = 0; k < N; k++) vectors[k] = Array(N);for (var i = 0; i < N; i++) {for (var minID = 0, minE = E[0], j = 0; j < E.length; j++) abs(E[j]) < abs(minE) && (minID = j, minE = E[minID]);values[i] = E.splice(minID, 1)[0];for (var _k5 = 0; _k5 < N; _k5++) vectors[_k5][i] = S[_k5][minID], S[_k5].splice(minID, 1);}return { values: values, vectors: vectors };}function createArray(size, value) {for (var array = Array(size), i = 0; i < size; i++) array[i] = value;return array;}var config = _ref.config,addScalar = _ref.addScalar,subtract = _ref.subtract,abs = _ref.abs,atan = _ref.atan,cos = _ref.cos,sin = _ref.sin,multiplyScalar = _ref.multiplyScalar,inv = _ref.inv,bignumber = _ref.bignumber,multiply = _ref.multiply,add = _ref.add;return function (arr) {var prec = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : config.epsilon,type = 3 < arguments.length ? arguments[3] : void 0;if ("number" === type) return diag(arr, prec);if ("BigNumber" === type) return diagBig(arr, prec);throw TypeError("Unsupported data type: " + type);};}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/expm.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createExpm = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "expm",dependencies = ["typed", "abs", "add", "identity", "inv", "multiply"],createExpm = (0, _factory.factory)(name, dependencies, function (_ref) {function infinityNorm(A) {for (var rowSum, n = A.size()[0], infNorm = 0, i = 0; i < n; i++) {rowSum = 0;for (var j = 0; j < n; j++) rowSum += abs(A.get([i, j]));infNorm = Math.max(rowSum, infNorm);}return infNorm;}function findParams(infNorm, eps) {for (var k = 0; k < 30; k++) for (var j, q = 0; q <= k; q++) if (j = k - q, errorEstimate(infNorm, q, j) < eps) return { q: q, j: j };throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)");}function errorEstimate(infNorm, q, j) {for (var qfac = 1, i = 2; i <= q; i++) qfac *= i;for (var twoqfac = qfac, _i2 = q + 1; _i2 <= 2 * q; _i2++) twoqfac *= _i2;var twoqp1fac = twoqfac * (2 * q + 1);return 8 * Math.pow(infNorm / Math.pow(2, j), 2 * q) * qfac * qfac / (twoqfac * twoqp1fac);}var typed = _ref.typed,abs = _ref.abs,add = _ref.add,identity = _ref.identity,inv = _ref.inv,multiply = _ref.multiply;return typed(name, { Matrix: function (A) {var size = A.size();if (2 !== size.length || size[0] !== size[1]) throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");for (var n = size[0], infNorm = infinityNorm(A), params = findParams(infNorm, 1e-15), q = params.q, j = params.j, Apos = multiply(A, Math.pow(2, -j)), N = identity(n), D = identity(n), factor = 1, AposToI = Apos, alternate = -1, i = 1; i <= q; i++) 1 < i && (AposToI = multiply(AposToI, Apos), alternate = -alternate), factor = factor * (q - i + 1) / ((2 * q - i + 1) * i), N = add(N, multiply(factor, AposToI)), D = add(D, multiply(factor * alternate, AposToI));for (var R = multiply(inv(D), N), _i = 0; _i < j; _i++) R = multiply(R, R);return (0, _is.isSparseMatrix)(A) ? A.createSparseMatrix(R) : R;} });});exports.createExpm = createExpm;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/filter.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFilter = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_function = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/function.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "filter",dependencies = ["typed"],createFilter = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed("filter", { "Array, function": _filterCallback, "Matrix, function": function (x, test) {return x.create(_filterCallback(x.toArray(), test));}, "Array, RegExp": _array.filterRegExp, "Matrix, RegExp": function (x, test) {return x.create((0, _array.filterRegExp)(x.toArray(), test));} });});exports.createFilter = createFilter;function _filterCallback(x, callback) {var args = (0, _function.maxArgumentCount)(callback);return (0, _array.filter)(x, function (value, index, array) {return 1 === args ? callback(value) : 2 === args ? callback(value, [index]) : callback(value, [index], array);});}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/flatten.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFlatten = void 0;var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "flatten",dependencies = ["typed", "matrix"],createFlatten = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix;return typed(name, { Array: function (x) {return (0, _array.flatten)((0, _object.clone)(x));}, Matrix: function (x) {var flat = (0, _array.flatten)((0, _object.clone)(x.toArray()));return matrix(flat);} });});exports.createFlatten = createFlatten;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/forEach.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createForEach = void 0;var _function = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/function.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "forEach",dependencies = ["typed"],createForEach = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "Array, function": _forEach, "Matrix, function": function (x, callback) {return x.forEach(callback);} });});exports.createForEach = createForEach;function _forEach(array, callback) {var args = (0, _function.maxArgumentCount)(callback);(function recurse(value, index) {Array.isArray(value) ? (0, _array.forEach)(value, function (child, i) {recurse(child, index.concat(i));}) : 1 === args ? callback(value) : 2 === args ? callback(value, index) : callback(value, index, array);})(array, []);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/getMatrixDataType.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createGetMatrixDataType = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "getMatrixDataType",dependencies = ["typed"],createGetMatrixDataType = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { Array: function (x) {return (0, _array.getArrayDataType)(x, _is.typeOf);}, Matrix: function (x) {return x.getDataType();} });});exports.createGetMatrixDataType = createGetMatrixDataType;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/identity.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIdentity = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "identity",dependencies = ["typed", "config", "matrix", "BigNumber", "DenseMatrix", "SparseMatrix"],createIdentity = (0, _factory.factory)(name, dependencies, function (_ref) {function _identityVector(size, format) {switch (size.length) {case 0:return format ? matrix(format) : [];case 1:return _identity(size[0], size[0], format);case 2:return _identity(size[0], size[1], format);default:throw new Error("Vector containing two values expected");}}function _identity(rows, cols, format) {var Big = (0, _is.isBigNumber)(rows) || (0, _is.isBigNumber)(cols) ? BigNumber : null;if ((0, _is.isBigNumber)(rows) && (rows = rows.toNumber()), (0, _is.isBigNumber)(cols) && (cols = cols.toNumber()), !(0, _number.isInteger)(rows) || 1 > rows) throw new Error("Parameters in function identity must be positive integers");if (!(0, _number.isInteger)(cols) || 1 > cols) throw new Error("Parameters in function identity must be positive integers");var one = Big ? new BigNumber(1) : 1,defaultValue = Big ? new Big(0) : 0,size = [rows, cols];if (format) {if ("sparse" === format) return SparseMatrix.diagonal(size, one, 0, defaultValue);if ("dense" === format) return DenseMatrix.diagonal(size, one, 0, defaultValue);throw new TypeError("Unknown matrix type \"".concat(format, "\""));}for (var res = (0, _array.resize)([], size, defaultValue), minimum = rows < cols ? rows : cols, d = 0; d < minimum; d++) res[d][d] = one;return res;}var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,BigNumber = _ref.BigNumber,DenseMatrix = _ref.DenseMatrix,SparseMatrix = _ref.SparseMatrix;return typed(name, { "": function () {return "Matrix" === config.matrix ? matrix([]) : [];}, string: function (format) {return matrix(format);}, "number | BigNumber": function (rows) {return _identity(rows, rows, "Matrix" === config.matrix ? "dense" : void 0);}, "number | BigNumber, string": function (rows, format) {return _identity(rows, rows, format);}, "number | BigNumber, number | BigNumber": function (rows, cols) {return _identity(rows, cols, "Matrix" === config.matrix ? "dense" : void 0);}, "number | BigNumber, number | BigNumber, string": function (rows, cols, format) {return _identity(rows, cols, format);}, Array: function (size) {return _identityVector(size);}, "Array, string": function (size, format) {return _identityVector(size, format);}, Matrix: function (size) {return _identityVector(size.valueOf(), size.storage());}, "Matrix, string": function (size, format) {return _identityVector(size.valueOf(), format);} });});exports.createIdentity = createIdentity;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/inv.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createInv = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),name = "inv",dependencies = ["typed", "matrix", "divideScalar", "addScalar", "multiply", "unaryMinus", "det", "identity", "abs"],createInv = (0, _factory.factory)(name, dependencies, function (_ref) {function _inv(mat, rows, cols) {var r, s, f, value, temp;if (1 === rows) {if (value = mat[0][0], 0 === value) throw Error("Cannot calculate inverse, determinant is zero");return [[divideScalar(1, value)]];}if (2 === rows) {var d = det(mat);if (0 === d) throw Error("Cannot calculate inverse, determinant is zero");return [[divideScalar(mat[1][1], d), divideScalar(unaryMinus(mat[0][1]), d)], [divideScalar(unaryMinus(mat[1][0]), d), divideScalar(mat[0][0], d)]];}var A = mat.concat();for (r = 0; r < rows; r++) A[r] = A[r].concat();for (var B = identity(rows).valueOf(), c = 0; c < cols; c++) {var ABig = abs(A[c][c]),rBig = c;for (r = c + 1; r < rows;) abs(A[r][c]) > ABig && (ABig = abs(A[r][c]), rBig = r), r++;if (0 === ABig) throw Error("Cannot calculate inverse, determinant is zero");r = rBig, r !== c && (temp = A[c], A[c] = A[r], A[r] = temp, temp = B[c], B[c] = B[r], B[r] = temp);var Ac = A[c],Bc = B[c];for (r = 0; r < rows; r++) {var Ar = A[r],Br = B[r];if (r === c) {for (f = Ac[c], s = c; s < cols; s++) Ar[s] = divideScalar(Ar[s], f);for (s = 0; s < cols; s++) Br[s] = divideScalar(Br[s], f);} else if (0 !== Ar[c]) {for (f = divideScalar(unaryMinus(Ar[c]), Ac[c]), s = c; s < cols; s++) Ar[s] = addScalar(Ar[s], multiply(f, Ac[s]));for (s = 0; s < cols; s++) Br[s] = addScalar(Br[s], multiply(f, Bc[s]));}}}return B;}var typed = _ref.typed,matrix = _ref.matrix,divideScalar = _ref.divideScalar,addScalar = _ref.addScalar,multiply = _ref.multiply,unaryMinus = _ref.unaryMinus,det = _ref.det,identity = _ref.identity,abs = _ref.abs;return typed(name, { "Array | Matrix": function (x) {var size = (0, _is.isMatrix)(x) ? x.size() : (0, _array.arraySize)(x);switch (size.length) {case 1:if (1 === size[0]) return (0, _is.isMatrix)(x) ? matrix([divideScalar(1, x.valueOf()[0])]) : [divideScalar(1, x[0])];throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");case 2:{var rows = size[0],cols = size[1];if (rows === cols) return (0, _is.isMatrix)(x) ? matrix(_inv(x.valueOf(), rows, cols), x.storage()) : _inv(x, rows, cols);throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");}default:throw new RangeError("Matrix must be two dimensional (size: " + (0, _string.format)(size) + ")");}}, any: function (x) {return divideScalar(1, x);} });});exports.createInv = createInv;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/kron.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createKron = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "kron",dependencies = ["typed", "matrix", "multiplyScalar"],createKron = (0, _factory.factory)(name, dependencies, function (_ref) {function _kron(a, b) {if (1 === (0, _array.arraySize)(a).length && (a = [a]), 1 === (0, _array.arraySize)(b).length && (b = [b]), 2 < (0, _array.arraySize)(a).length || 2 < (0, _array.arraySize)(b).length) throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = " + JSON.stringify(a.length) + ", y = " + JSON.stringify(b.length) + ")");var t = [],r = [];return a.map(function (a) {return b.map(function (b) {return r = [], t.push(r), a.map(function (y) {return b.map(function (x) {return r.push(multiplyScalar(y, x));});});});}) && t;}var typed = _ref.typed,matrix = _ref.matrix,multiplyScalar = _ref.multiplyScalar;return typed(name, { "Matrix, Matrix": function (x, y) {return matrix(_kron(x.toArray(), y.toArray()));}, "Matrix, Array": function (x, y) {return matrix(_kron(x.toArray(), y));}, "Array, Matrix": function (x, y) {return matrix(_kron(x, y.toArray()));}, "Array, Array": _kron });});exports.createKron = createKron;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/map.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMap = void 0;var _function = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/function.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "map",dependencies = ["typed"],createMap = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "Array, function": _map, "Matrix, function": function (x, callback) {return x.map(callback);} });});exports.createMap = createMap;function _map(array, callback) {var args = (0, _function.maxArgumentCount)(callback);return function recurse(value, index) {return Array.isArray(value) ? value.map(function (child, i) {return recurse(child, index.concat(i));}) : 1 === args ? callback(value) : 2 === args ? callback(value, index) : callback(value, index, array);}(array, []);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/matrixFromColumns.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMatrixFromColumns = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js");function _createForOfIteratorHelper(o, allowArrayLike) {var it = "undefined" != typeof Symbol && o[Symbol.iterator] || o["@@iterator"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && "number" == typeof o.length) {it && (o = it);var i = 0,F = function () {};return { s: F, n: function () {return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] };}, e: function (_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var err,normalCompletion = !0,didErr = !1;return { s: function () {it = it.call(o);}, n: function () {var step = it.next();return normalCompletion = step.done, step;}, e: function (_e2) {didErr = !0, err = _e2;}, f: function () {try {normalCompletion || null == it["return"] || it["return"]();} finally {if (didErr) throw err;}} };}function _unsupportedIterableToArray(o, minLen) {if (o) {if ("string" == typeof o) return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);return "Object" === n && o.constructor && (n = o.constructor.name), "Map" === n || "Set" === n ? Array.from(o) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(o, minLen) : void 0;}}function _arrayLikeToArray(arr, len) {(null == len || len > arr.length) && (len = arr.length);for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}var name = "matrixFromColumns",dependencies = ["typed", "matrix", "flatten", "size"],createMatrixFromColumns = (0, _factory.factory)("matrixFromColumns", dependencies, function (_ref) {function _createArray(arr) {if (0 === arr.length) throw new TypeError("At least one column is needed to construct a matrix.");for (var N = checkVectorTypeAndReturnLength(arr[0]), result = [], i = 0; i < N; i++) result[i] = [];var _step,_iterator = _createForOfIteratorHelper(arr);try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var col = _step.value,colLength = checkVectorTypeAndReturnLength(col);if (colLength !== N) throw new TypeError("The vectors had different length: " + (0 | N) + " \u2260 " + (0 | colLength));for (var f = flatten(col), _i = 0; _i < N; _i++) result[_i].push(f[_i]);}} catch (err) {_iterator.e(err);} finally {_iterator.f();}return result;}function checkVectorTypeAndReturnLength(vec) {var s = size(vec);if (1 === s.length) return s[0];if (2 === s.length) {if (1 === s[0]) return s[1];if (1 === s[1]) return s[0];throw new TypeError("At least one of the arguments is not a vector.");} else throw new TypeError("Only one- or two-dimensional vectors are supported.");}var typed = _ref.typed,matrix = _ref.matrix,flatten = _ref.flatten,size = _ref.size;return typed(name, { "...Array": function (arr) {return _createArray(arr);}, "...Matrix": function (arr) {return matrix(_createArray(arr.map(function (m) {return m.toArray();})));} });});exports.createMatrixFromColumns = createMatrixFromColumns;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/matrixFromFunction.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMatrixFromFunction = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "matrixFromFunction",dependencies = ["typed", "matrix", "isZero"],createMatrixFromFunction = (0, _factory.factory)(name, dependencies, function (_ref) {function _create(size, fn, format, datatype) {var m;return m = void 0 === datatype ? matrix(format) : matrix(format, datatype), m.resize(size), m.forEach(function (_, index) {var val = fn(index);isZero(val) || m.set(index, val);}), m;}var typed = _ref.typed,matrix = _ref.matrix,isZero = _ref.isZero;return typed(name, { "Array | Matrix, function, string, string": function (size, fn, format, datatype) {return _create(size, fn, format, datatype);}, "Array | Matrix, function, string": function (size, fn, format) {return _create(size, fn, format);}, "Matrix, function": function (size, fn) {return _create(size, fn, "dense");}, "Array, function": function (size, fn) {return _create(size, fn, "dense").toArray();}, "Array | Matrix, string, function": function (size, format, fn) {return _create(size, fn, format);}, "Array | Matrix, string, string, function": function (size, format, datatype, fn) {return _create(size, fn, format, datatype);} });});exports.createMatrixFromFunction = createMatrixFromFunction;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/matrixFromRows.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMatrixFromRows = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js");function _createForOfIteratorHelper(o, allowArrayLike) {var it = "undefined" != typeof Symbol && o[Symbol.iterator] || o["@@iterator"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && "number" == typeof o.length) {it && (o = it);var i = 0,F = function () {};return { s: F, n: function () {return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] };}, e: function (_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var err,normalCompletion = !0,didErr = !1;return { s: function () {it = it.call(o);}, n: function () {var step = it.next();return normalCompletion = step.done, step;}, e: function (_e2) {didErr = !0, err = _e2;}, f: function () {try {normalCompletion || null == it["return"] || it["return"]();} finally {if (didErr) throw err;}} };}function _unsupportedIterableToArray(o, minLen) {if (o) {if ("string" == typeof o) return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);return "Object" === n && o.constructor && (n = o.constructor.name), "Map" === n || "Set" === n ? Array.from(o) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(o, minLen) : void 0;}}function _arrayLikeToArray(arr, len) {(null == len || len > arr.length) && (len = arr.length);for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}var name = "matrixFromRows",dependencies = ["typed", "matrix", "flatten", "size"],createMatrixFromRows = (0, _factory.factory)("matrixFromRows", dependencies, function (_ref) {function _createArray(arr) {if (0 === arr.length) throw new TypeError("At least one row is needed to construct a matrix.");var _step,N = checkVectorTypeAndReturnLength(arr[0]),result = [],_iterator = _createForOfIteratorHelper(arr);try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var row = _step.value,rowLength = checkVectorTypeAndReturnLength(row);if (rowLength !== N) throw new TypeError("The vectors had different length: " + (0 | N) + " \u2260 " + (0 | rowLength));result.push(flatten(row));}} catch (err) {_iterator.e(err);} finally {_iterator.f();}return result;}function checkVectorTypeAndReturnLength(vec) {var s = size(vec);if (1 === s.length) return s[0];if (2 === s.length) {if (1 === s[0]) return s[1];if (1 === s[1]) return s[0];throw new TypeError("At least one of the arguments is not a vector.");} else throw new TypeError("Only one- or two-dimensional vectors are supported.");}var typed = _ref.typed,matrix = _ref.matrix,flatten = _ref.flatten,size = _ref.size;return typed(name, { "...Array": function (arr) {return _createArray(arr);}, "...Matrix": function (arr) {return matrix(_createArray(arr.map(function (m) {return m.toArray();})));} });});exports.createMatrixFromRows = createMatrixFromRows;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/ones.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createOnes = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "ones",dependencies = ["typed", "config", "matrix", "BigNumber"],createOnes = (0, _factory.factory)(name, dependencies, function (_ref) {function _ones(size, format) {var hasBigNumbers = _normalize(size),defaultValue = hasBigNumbers ? new BigNumber(1) : 1;if (_validate(size), format) {var m = matrix(format);return 0 < size.length ? m.resize(size, defaultValue) : m;}var arr = [];return 0 < size.length ? (0, _array.resize)(arr, size, defaultValue) : arr;}function _normalize(size) {var hasBigNumbers = !1;return size.forEach(function (value, index, arr) {(0, _is.isBigNumber)(value) && (hasBigNumbers = !0, arr[index] = value.toNumber());}), hasBigNumbers;}function _validate(size) {size.forEach(function (value) {if ("number" != typeof value || !(0, _number.isInteger)(value) || 0 > value) throw new Error("Parameters in function ones must be positive integers");});}var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,BigNumber = _ref.BigNumber;return typed("ones", { "": function () {return "Array" === config.matrix ? _ones([]) : _ones([], "default");}, "...number | BigNumber | string": function (size) {var last = size[size.length - 1];if ("string" == typeof last) {var format = size.pop();return _ones(size, format);}return "Array" === config.matrix ? _ones(size) : _ones(size, "default");}, Array: _ones, Matrix: function (size) {var format = size.storage();return _ones(size.valueOf(), format);}, "Array | Matrix, string": function (size, format) {return _ones(size.valueOf(), format);} });});exports.createOnes = createOnes;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/partitionSelect.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createPartitionSelect = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "partitionSelect",dependencies = ["typed", "isNumeric", "isNaN", "compare"],createPartitionSelect = (0, _factory.factory)(name, dependencies, function (_ref) {function _partitionSelect(x, k, compare) {if (!(0, _number.isInteger)(k) || 0 > k) throw new Error("k must be a non-negative integer");if ((0, _is.isMatrix)(x)) {var size = x.size();if (1 < size.length) throw new Error("Only one dimensional matrices supported");return quickSelect(x.valueOf(), k, compare);}return Array.isArray(x) ? quickSelect(x, k, compare) : void 0;}function quickSelect(arr, k, compare) {if (k >= arr.length) throw new Error("k out of bounds");for (var i = 0; i < arr.length; i++) if (isNumeric(arr[i]) && isNaN(arr[i])) return arr[i];for (var from = 0, to = arr.length - 1; from < to;) {for (var r = from, w = to, pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from]; r < w;) if (0 <= compare(arr[r], pivot)) {var tmp = arr[w];arr[w] = arr[r], arr[r] = tmp, --w;} else ++r;0 < compare(arr[r], pivot) && --r, k <= r ? to = r : from = r + 1;}return arr[k];}var typed = _ref.typed,isNumeric = _ref.isNumeric,isNaN = _ref.isNaN,compare = _ref.compare,asc = compare,desc = function (a, b) {return -compare(a, b);};return typed(name, { "Array | Matrix, number": function (x, k) {return _partitionSelect(x, k, asc);}, "Array | Matrix, number, string": function (x, k, compare) {if ("asc" === compare) return _partitionSelect(x, k, asc);if ("desc" === compare) return _partitionSelect(x, k, desc);throw new Error("Compare string must be \"asc\" or \"desc\"");}, "Array | Matrix, number, function": _partitionSelect });});exports.createPartitionSelect = createPartitionSelect;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/range.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRange = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_noop = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/noop.js"),name = "range",dependencies = ["typed", "config", "?matrix", "?bignumber", "smaller", "smallerEq", "larger", "largerEq"],createRange = (0, _factory.factory)(name, dependencies, function (_ref) {function _out(arr) {return "Matrix" === config.matrix ? matrix ? matrix(arr) : (0, _noop.noMatrix)() : arr;}function _strRange(str, includeEnd) {var r = _parse(str);if (!r) throw new SyntaxError("String \"" + str + "\" is no valid range");var fn;return "BigNumber" === config.number ? (void 0 === bignumber && (0, _noop.noBignumber)(), fn = includeEnd ? _bigRangeInc : _bigRangeEx, _out(fn(bignumber(r.start), bignumber(r.end), bignumber(r.step)))) : (fn = includeEnd ? _rangeInc : _rangeEx, _out(fn(r.start, r.end, r.step)));}function _rangeEx(start, end, step) {var array = [],x = start;if (0 < step) for (; smaller(x, end);) array.push(x), x += step;else if (0 > step) for (; larger(x, end);) array.push(x), x += step;return array;}function _rangeInc(start, end, step) {var array = [],x = start;if (0 < step) for (; smallerEq(x, end);) array.push(x), x += step;else if (0 > step) for (; largerEq(x, end);) array.push(x), x += step;return array;}function _bigRangeEx(start, end, step) {var zero = bignumber(0),array = [],x = start;if (step.gt(zero)) for (; smaller(x, end);) array.push(x), x = x.plus(step);else if (step.lt(zero)) for (; larger(x, end);) array.push(x), x = x.plus(step);return array;}function _bigRangeInc(start, end, step) {var zero = bignumber(0),array = [],x = start;if (step.gt(zero)) for (; smallerEq(x, end);) array.push(x), x = x.plus(step);else if (step.lt(zero)) for (; largerEq(x, end);) array.push(x), x = x.plus(step);return array;}function _parse(str) {var args = str.split(":"),nums = args.map(function (arg) {return +arg;}),invalid = nums.some(function (num) {return isNaN(num);});if (invalid) return null;switch (nums.length) {case 2:return { start: nums[0], end: nums[1], step: 1 };case 3:return { start: nums[0], end: nums[2], step: nums[1] };default:return null;}}var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,bignumber = _ref.bignumber,smaller = _ref.smaller,smallerEq = _ref.smallerEq,larger = _ref.larger,largerEq = _ref.largerEq;return typed(name, { string: _strRange, "string, boolean": _strRange, "number, number": function (start, end) {return _out(_rangeEx(start, end, 1));}, "number, number, number": function (start, end, step) {return _out(_rangeEx(start, end, step));}, "number, number, boolean": function (start, end, includeEnd) {return includeEnd ? _out(_rangeInc(start, end, 1)) : _out(_rangeEx(start, end, 1));}, "number, number, number, boolean": function (start, end, step, includeEnd) {return includeEnd ? _out(_rangeInc(start, end, step)) : _out(_rangeEx(start, end, step));}, "BigNumber, BigNumber": function (start, end) {var BigNumber = start.constructor;return _out(_bigRangeEx(start, end, new BigNumber(1)));}, "BigNumber, BigNumber, BigNumber": function (start, end, step) {return _out(_bigRangeEx(start, end, step));}, "BigNumber, BigNumber, boolean": function (start, end, includeEnd) {var BigNumber = start.constructor;return includeEnd ? _out(_bigRangeInc(start, end, new BigNumber(1))) : _out(_bigRangeEx(start, end, new BigNumber(1)));}, "BigNumber, BigNumber, BigNumber, boolean": function (start, end, step, includeEnd) {return includeEnd ? _out(_bigRangeInc(start, end, step)) : _out(_bigRangeEx(start, end, step));} });});exports.createRange = createRange;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/reshape.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createReshape = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "reshape",dependencies = ["typed", "isInteger", "matrix"],createReshape = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,isInteger = _ref.isInteger;return typed(name, { "Matrix, Array": function (x, sizes) {return x.reshape(sizes);}, "Array, Array": function (x, sizes) {return sizes.forEach(function (size) {if (!isInteger(size)) throw new TypeError("Invalid size for dimension: " + size);}), (0, _array.reshape)(x, sizes);} });});exports.createReshape = createReshape;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/resize.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createResize = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),_ArgumentsError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/ArgumentsError.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "resize",dependencies = ["config", "matrix"],createResize = (0, _factory.factory)(name, dependencies, function (_ref) {function _resizeString(str, size, defaultChar) {if (!(defaultChar !== void 0)) defaultChar = " ";else if ("string" != typeof defaultChar || 1 !== defaultChar.length) throw new TypeError("Single character expected as defaultValue");if (1 !== size.length) throw new _DimensionError.DimensionError(size.length, 1);var len = size[0];if ("number" != typeof len || !(0, _number.isInteger)(len)) throw new TypeError("Invalid size, must contain positive integers (size: " + (0, _string.format)(size) + ")");if (str.length > len) return str.substring(0, len);if (str.length < len) {for (var res = str, i = 0, ii = len - str.length; i < ii; i++) res += defaultChar;return res;}return str;}var config = _ref.config,matrix = _ref.matrix;return function (x, size, defaultValue) {if (2 !== arguments.length && 3 !== arguments.length) throw new _ArgumentsError.ArgumentsError("resize", arguments.length, 2, 3);if ((0, _is.isMatrix)(size) && (size = size.valueOf()), (0, _is.isBigNumber)(size[0]) && (size = size.map(function (value) {return (0, _is.isBigNumber)(value) ? value.toNumber() : value;})), (0, _is.isMatrix)(x)) return x.resize(size, defaultValue, !0);if ("string" == typeof x) return _resizeString(x, size, defaultValue);var asMatrix = !Array.isArray(x) && "Array" !== config.matrix;if (0 === size.length) {for (; Array.isArray(x);) x = x[0];return (0, _object.clone)(x);}Array.isArray(x) || (x = [x]), x = (0, _object.clone)(x);var res = (0, _array.resize)(x, size, defaultValue);return asMatrix ? matrix(res) : res;};});exports.createResize = createResize;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/rotate.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRotate = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),name = "rotate",dependencies = ["typed", "multiply", "rotationMatrix"],createRotate = (0, _factory.factory)(name, dependencies, function (_ref) {function _validateSize(v, expectedSize) {var actualSize = Array.isArray(v) ? (0, _array.arraySize)(v) : v.size();if (2 < actualSize.length) throw new RangeError("Vector must be of dimensions 1x".concat(expectedSize));if (2 === actualSize.length && 1 !== actualSize[1]) throw new RangeError("Vector must be of dimensions 1x".concat(expectedSize));if (actualSize[0] !== expectedSize) throw new RangeError("Vector must be of dimensions 1x".concat(expectedSize));}var typed = _ref.typed,multiply = _ref.multiply,rotationMatrix = _ref.rotationMatrix;return typed(name, { "Array , number | BigNumber | Complex | Unit": function (w, theta) {_validateSize(w, 2);var matrixRes = multiply(rotationMatrix(theta), w);return matrixRes.toArray();}, "Matrix , number | BigNumber | Complex | Unit": function (w, theta) {return _validateSize(w, 2), multiply(rotationMatrix(theta), w);}, "Array, number | BigNumber | Complex | Unit, Array | Matrix": function (w, theta, v) {_validateSize(w, 3);var matrixRes = multiply(rotationMatrix(theta, v), w);return matrixRes;}, "Matrix, number | BigNumber | Complex | Unit, Array | Matrix": function (w, theta, v) {return _validateSize(w, 3), multiply(rotationMatrix(theta, v), w);} });});exports.createRotate = createRotate;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/rotationMatrix.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRotationMatrix = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "rotationMatrix",dependencies = ["typed", "config", "multiplyScalar", "addScalar", "unaryMinus", "norm", "matrix", "BigNumber", "DenseMatrix", "SparseMatrix", "cos", "sin"],createRotationMatrix = (0, _factory.factory)(name, dependencies, function (_ref) {function _rotationMatrix2x2(theta, format) {var Big = (0, _is.isBigNumber)(theta),minusOne = Big ? new BigNumber(-1) : -1,cosTheta = cos(theta),sinTheta = sin(theta),data = [[cosTheta, multiplyScalar(minusOne, sinTheta)], [sinTheta, cosTheta]];return _convertToFormat(data, format);}function _validateVector(v) {var size = v.size();if (1 > size.length || 3 !== size[0]) throw new RangeError("Vector must be of dimensions 1x3");}function _mul(array) {return array.reduce(function (p, curr) {return multiplyScalar(p, curr);});}function _convertToFormat(data, format) {if (format) {if ("sparse" === format) return new SparseMatrix(data);if ("dense" === format) return new DenseMatrix(data);throw new TypeError("Unknown matrix type \"".concat(format, "\""));}return data;}function _rotationMatrix3x3(theta, v, format) {var normV = norm(v);if (0 === normV) throw new RangeError("Rotation around zero vector");var Big = (0, _is.isBigNumber)(theta) ? BigNumber : null,one = Big ? new Big(1) : 1,minusOne = Big ? new Big(-1) : -1,vx = Big ? new Big(v.get([0]) / normV) : v.get([0]) / normV,vy = Big ? new Big(v.get([1]) / normV) : v.get([1]) / normV,vz = Big ? new Big(v.get([2]) / normV) : v.get([2]) / normV,c = cos(theta),oneMinusC = addScalar(one, unaryMinus(c)),s = sin(theta),r11 = addScalar(c, _mul([vx, vx, oneMinusC])),r12 = addScalar(_mul([vx, vy, oneMinusC]), _mul([minusOne, vz, s])),r13 = addScalar(_mul([vx, vz, oneMinusC]), _mul([vy, s])),r21 = addScalar(_mul([vx, vy, oneMinusC]), _mul([vz, s])),r22 = addScalar(c, _mul([vy, vy, oneMinusC])),r23 = addScalar(_mul([vy, vz, oneMinusC]), _mul([minusOne, vx, s])),r31 = addScalar(_mul([vx, vz, oneMinusC]), _mul([minusOne, vy, s])),r32 = addScalar(_mul([vy, vz, oneMinusC]), _mul([vx, s])),r33 = addScalar(c, _mul([vz, vz, oneMinusC]));return _convertToFormat([[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]], format);}var typed = _ref.typed,config = _ref.config,multiplyScalar = _ref.multiplyScalar,addScalar = _ref.addScalar,unaryMinus = _ref.unaryMinus,norm = _ref.norm,BigNumber = _ref.BigNumber,matrix = _ref.matrix,DenseMatrix = _ref.DenseMatrix,SparseMatrix = _ref.SparseMatrix,cos = _ref.cos,sin = _ref.sin;return typed(name, { "": function () {return "Matrix" === config.matrix ? matrix([]) : [];}, string: function (format) {return matrix(format);}, "number | BigNumber | Complex | Unit": function (theta) {return _rotationMatrix2x2(theta, "Matrix" === config.matrix ? "dense" : void 0);}, "number | BigNumber | Complex | Unit, string": function (theta, format) {return _rotationMatrix2x2(theta, format);}, "number | BigNumber | Complex | Unit, Array": function (theta, v) {var matrixV = matrix(v);return _validateVector(matrixV), _rotationMatrix3x3(theta, matrixV, void 0);}, "number | BigNumber | Complex | Unit, Matrix": function (theta, v) {_validateVector(v);var storageType = v.storage() || ("Matrix" === config.matrix ? "dense" : void 0);return _rotationMatrix3x3(theta, v, storageType);}, "number | BigNumber | Complex | Unit, Array, string": function (theta, v, format) {var matrixV = matrix(v);return _validateVector(matrixV), _rotationMatrix3x3(theta, matrixV, format);}, "number | BigNumber | Complex | Unit, Matrix, string": function (theta, v, format) {return _validateVector(v), _rotationMatrix3x3(theta, v, format);} });});exports.createRotationMatrix = createRotationMatrix;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/row.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRow = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),name = "row",dependencies = ["typed", "Index", "matrix", "range"],createRow = (0, _factory.factory)(name, dependencies, function (_ref) {function _row(value, row) {if (2 !== value.size().length) throw new Error("Only two dimensional matrix is supported");(0, _array.validateIndex)(row, value.size()[0]);var columnRange = range(0, value.size()[1]),index = new Index(row, columnRange);return value.subset(index);}var typed = _ref.typed,Index = _ref.Index,matrix = _ref.matrix,range = _ref.range;return typed(name, { "Matrix, number": _row, "Array, number": function (value, row) {return _row(matrix((0, _object.clone)(value)), row).valueOf();} });});exports.createRow = createRow;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/size.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSize = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_noop = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/noop.js"),name = "size",dependencies = ["typed", "config", "?matrix"],createSize = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix;return typed(name, { Matrix: function (x) {return x.create(x.size());}, Array: _array.arraySize, string: function (x) {return "Array" === config.matrix ? [x.length] : matrix([x.length]);}, "number | Complex | BigNumber | Unit | boolean | null": function () {return "Array" === config.matrix ? [] : matrix ? matrix([]) : (0, _noop.noMatrix)();} });});exports.createSize = createSize;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/sort.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSort = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "sort",dependencies = ["typed", "matrix", "compare", "compareNatural"],createSort = (0, _factory.factory)(name, dependencies, function (_ref) {function _comparator(order) {if ("asc" === order) return compareAsc;if ("desc" === order) return compareDesc;if ("natural" === order) return compareNatural;throw new Error("String \"asc\", \"desc\", or \"natural\" expected");}function _arrayIsVector(array) {if (1 !== (0, _array.arraySize)(array).length) throw new Error("One dimensional array expected");}function _matrixIsVector(matrix) {if (1 !== matrix.size().length) throw new Error("One dimensional matrix expected");}var typed = _ref.typed,matrix = _ref.matrix,compare = _ref.compare,compareNatural = _ref.compareNatural,compareAsc = compare,compareDesc = function (a, b) {return -compare(a, b);};return typed(name, { Array: function (x) {return _arrayIsVector(x), x.sort(compareAsc);}, Matrix: function (x) {return _matrixIsVector(x), matrix(x.toArray().sort(compareAsc), x.storage());}, "Array, function": function (x, _comparator) {return _arrayIsVector(x), x.sort(_comparator);}, "Matrix, function": function (x, _comparator) {return _matrixIsVector(x), matrix(x.toArray().sort(_comparator), x.storage());}, "Array, string": function (x, order) {return _arrayIsVector(x), x.sort(_comparator(order));}, "Matrix, string": function (x, order) {return _matrixIsVector(x), matrix(x.toArray().sort(_comparator(order)), x.storage());} });});exports.createSort = createSort;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/sqrtm.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSqrtm = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "sqrtm",dependencies = ["typed", "abs", "add", "multiply", "sqrt", "subtract", "inv", "size", "max", "identity"],createSqrtm = (0, _factory.factory)(name, dependencies, function (_ref) {function _denmanBeavers(A) {var error,iterations = 0,Y = A,Z = identity(size(A));do {var Yk = Y;if (Y = multiply(.5, add(Yk, inv(Z))), Z = multiply(.5, add(Z, inv(Yk))), error = max(abs(subtract(Y, Yk))), error > _tolerance && 1000 < ++iterations) throw new Error("computing square root of matrix: iterative method could not converge");} while (error > _tolerance);return Y;}var typed = _ref.typed,abs = _ref.abs,add = _ref.add,multiply = _ref.multiply,sqrt = _ref.sqrt,subtract = _ref.subtract,inv = _ref.inv,size = _ref.size,max = _ref.max,identity = _ref.identity,_tolerance = 1e-6;return typed(name, { "Array | Matrix": function (A) {var size = (0, _is.isMatrix)(A) ? A.size() : (0, _array.arraySize)(A);switch (size.length) {case 1:if (1 === size[0]) return sqrt(A);throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");case 2:{var rows = size[0],cols = size[1];if (rows === cols) return _denmanBeavers(A);throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");}default:throw new RangeError("Matrix must be at most two dimensional (size: " + (0, _string.format)(size) + ")");}} });});exports.createSqrtm = createSqrtm;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/squeeze.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSqueeze = void 0;var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "squeeze",dependencies = ["typed", "matrix"],createSqueeze = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix;return typed(name, { Array: function (x) {return (0, _array.squeeze)((0, _object.clone)(x));}, Matrix: function (x) {var res = (0, _array.squeeze)(x.toArray());return Array.isArray(res) ? matrix(res) : res;}, any: function (x) {return (0, _object.clone)(x);} });});exports.createSqueeze = createSqueeze;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/subset.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSubset = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "subset",dependencies = ["typed", "matrix"],createSubset = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix;return typed(name, { "Array, Index": function (value, index) {var m = matrix(value),subset = m.subset(index);return index.isScalar() ? subset : subset.valueOf();}, "Matrix, Index": function (value, index) {return value.subset(index);}, "Object, Index": _getObjectProperty, "string, Index": _getSubstring, "Array, Index, any": function (value, index, replacement) {return matrix((0, _object.clone)(value)).subset(index, replacement, void 0).valueOf();}, "Array, Index, any, any": function (value, index, replacement, defaultValue) {return matrix((0, _object.clone)(value)).subset(index, replacement, defaultValue).valueOf();}, "Matrix, Index, any": function (value, index, replacement) {return value.clone().subset(index, replacement);}, "Matrix, Index, any, any": function (value, index, replacement, defaultValue) {return value.clone().subset(index, replacement, defaultValue);}, "string, Index, string": _setSubstring, "string, Index, string, string": _setSubstring, "Object, Index, any": _setObjectProperty });});exports.createSubset = createSubset;function _getSubstring(str, index) {if (!(0, _is.isIndex)(index)) throw new TypeError("Index expected");if (1 !== index.size().length) throw new _DimensionError.DimensionError(index.size().length, 1);var strLen = str.length;(0, _array.validateIndex)(index.min()[0], strLen), (0, _array.validateIndex)(index.max()[0], strLen);var range = index.dimension(0),substr = "";return range.forEach(function (v) {substr += str.charAt(v);}), substr;}function _setSubstring(str, index, replacement, defaultValue) {if (!index || !0 !== index.isIndex) throw new TypeError("Index expected");if (1 !== index.size().length) throw new _DimensionError.DimensionError(index.size().length, 1);if (void 0 === defaultValue) defaultValue = " ";else if ("string" != typeof defaultValue || 1 !== defaultValue.length) throw new TypeError("Single character expected as defaultValue");var range = index.dimension(0),len = range.size()[0];if (len !== replacement.length) throw new _DimensionError.DimensionError(range.size()[0], replacement.length);var strLen = str.length;(0, _array.validateIndex)(index.min()[0]), (0, _array.validateIndex)(index.max()[0]);for (var chars = [], i = 0; i < strLen; i++) chars[i] = str.charAt(i);if (range.forEach(function (v, i) {chars[v] = replacement.charAt(i[0]);}), chars.length > strLen) for (var _i = strLen - 1, _len = chars.length; _i < _len; _i++) chars[_i] || (chars[_i] = defaultValue);return chars.join("");}function _getObjectProperty(object, index) {if (1 !== index.size().length) throw new _DimensionError.DimensionError(index.size(), 1);var key = index.dimension(0);if ("string" != typeof key) throw new TypeError("String expected as index to retrieve an object property");return (0, _customs.getSafeProperty)(object, key);}function _setObjectProperty(object, index, replacement) {if (1 !== index.size().length) throw new _DimensionError.DimensionError(index.size(), 1);var key = index.dimension(0);if ("string" != typeof key) throw new TypeError("String expected as index to retrieve an object property");var updated = (0, _object.clone)(object);return (0, _customs.setSafeProperty)(updated, key, replacement), updated;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/trace.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createTrace = void 0;var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "trace",dependencies = ["typed", "matrix", "add"],createTrace = (0, _factory.factory)(name, dependencies, function (_ref) {function _denseTrace(m) {var size = m._size,data = m._data;switch (size.length) {case 1:if (1 === size[0]) return (0, _object.clone)(data[0]);throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");case 2:{var rows = size[0],cols = size[1];if (rows === cols) {for (var sum = 0, i = 0; i < rows; i++) sum = add(sum, data[i][i]);return sum;}throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");}default:throw new RangeError("Matrix must be two dimensional (size: " + (0, _string.format)(size) + ")");}}var typed = _ref.typed,matrix = _ref.matrix,add = _ref.add;return typed("trace", { Array: function (x) {return _denseTrace(matrix(x));}, SparseMatrix: function (m) {var values = m._values,index = m._index,ptr = m._ptr,size = m._size,rows = size[0],columns = size[1];if (rows === columns) {var sum = 0;if (0 < values.length) for (var j = 0; j < columns; j++) for (var i, k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) {if (i = index[k], i === j) {sum = add(sum, values[k]);break;}if (i > j) break;}return sum;}throw new RangeError("Matrix must be square (size: " + (0, _string.format)(size) + ")");}, DenseMatrix: _denseTrace, any: _object.clone });});exports.createTrace = createTrace;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/transpose.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createTranspose = void 0;var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "transpose",dependencies = ["typed", "matrix"],createTranspose = (0, _factory.factory)(name, dependencies, function (_ref) {function _denseTranspose(m, rows, columns) {for (var transposedRow, data = m._data, transposed = [], j = 0; j < columns; j++) {transposedRow = transposed[j] = [];for (var i = 0; i < rows; i++) transposedRow[i] = (0, _object.clone)(data[i][j]);}return m.createDenseMatrix({ data: transposed, size: [columns, rows], datatype: m._datatype });}function _sparseTranspose(m, rows, columns) {for (var values = m._values, index = m._index, ptr = m._ptr, cvalues = values ? [] : void 0, cindex = [], cptr = [], w = [], x = 0; x < rows; x++) w[x] = 0;var p, l, j;for (p = 0, l = index.length; p < l; p++) w[index[p]]++;for (var sum = 0, i = 0; i < rows; i++) cptr.push(sum), sum += w[i], w[i] = cptr[i];for (cptr.push(sum), j = 0; j < columns; j++) for (var q, k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) q = w[index[k]]++, cindex[q] = j, values && (cvalues[q] = (0, _object.clone)(values[k]));return m.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [columns, rows], datatype: m._datatype });}var typed = _ref.typed,matrix = _ref.matrix;return typed("transpose", { Array: function (x) {return this(matrix(x)).valueOf();}, Matrix: function (x) {var c,size = x.size();switch (size.length) {case 1:c = x.clone();break;case 2:{var rows = size[0],columns = size[1];if (0 === columns) throw new RangeError("Cannot transpose a 2D matrix with no columns (size: " + (0, _string.format)(size) + ")");switch (x.storage()) {case "dense":c = _denseTranspose(x, rows, columns);break;case "sparse":c = _sparseTranspose(x, rows, columns);}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: " + (0, _string.format)(this._size) + ")");}return c;}, any: function (x) {return (0, _object.clone)(x);} });});exports.createTranspose = createTranspose;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/matrix/zeros.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createZeros = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "zeros",dependencies = ["typed", "config", "matrix", "BigNumber"],createZeros = (0, _factory.factory)(name, dependencies, function (_ref) {function _zeros(size, format) {var hasBigNumbers = _normalize(size),defaultValue = hasBigNumbers ? new BigNumber(0) : 0;if (_validate(size), format) {var m = matrix(format);return 0 < size.length ? m.resize(size, defaultValue) : m;}var arr = [];return 0 < size.length ? (0, _array.resize)(arr, size, defaultValue) : arr;}function _normalize(size) {var hasBigNumbers = !1;return size.forEach(function (value, index, arr) {(0, _is.isBigNumber)(value) && (hasBigNumbers = !0, arr[index] = value.toNumber());}), hasBigNumbers;}function _validate(size) {size.forEach(function (value) {if ("number" != typeof value || !(0, _number.isInteger)(value) || 0 > value) throw new Error("Parameters in function zeros must be positive integers");});}var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,BigNumber = _ref.BigNumber;return typed(name, { "": function () {return "Array" === config.matrix ? _zeros([]) : _zeros([], "default");}, "...number | BigNumber | string": function (size) {var last = size[size.length - 1];if ("string" == typeof last) {var format = size.pop();return _zeros(size, format);}return "Array" === config.matrix ? _zeros(size) : _zeros(size, "default");}, Array: _zeros, Matrix: function (size) {var format = size.storage();return _zeros(size.valueOf(), format);}, "Array | Matrix, string": function (size, format) {return _zeros(size.valueOf(), format);} });});exports.createZeros = createZeros;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/combinations.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCombinations = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_combinations = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/combinations.js"),name = "combinations",dependencies = ["typed"],createCombinations = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "number, number": _combinations.combinationsNumber, "BigNumber, BigNumber": function (n, k) {var result,i,BigNumber = n.constructor,nMinusk = n.minus(k),one = new BigNumber(1);if (!isPositiveInteger(n) || !isPositiveInteger(k)) throw new TypeError("Positive integer value expected in function combinations");if (k.gt(n)) throw new TypeError("k must be less than n in function combinations");if (result = one, k.lt(nMinusk)) for (i = one; i.lte(nMinusk); i = i.plus(one)) result = result.times(k.plus(i)).dividedBy(i);else for (i = one; i.lte(k); i = i.plus(one)) result = result.times(nMinusk.plus(i)).dividedBy(i);return result;} });});exports.createCombinations = createCombinations;function isPositiveInteger(n) {return n.isInteger() && n.gte(0);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/combinationsWithRep.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCombinationsWithRep = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_product = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/product.js"),name = "combinationsWithRep",dependencies = ["typed"],createCombinationsWithRep = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "number, number": function (n, k) {if (!(0, _number.isInteger)(n) || 0 > n) throw new TypeError("Positive integer value expected in function combinationsWithRep");if (!(0, _number.isInteger)(k) || 0 > k) throw new TypeError("Positive integer value expected in function combinationsWithRep");if (1 > n) throw new TypeError("k must be less than or equal to n + k - 1");if (k < n - 1) {var _prodrange = (0, _product.product)(n, n + k - 1);return _prodrange / (0, _product.product)(1, k);}var prodrange = (0, _product.product)(k + 1, n + k - 1);return prodrange / (0, _product.product)(1, n - 1);}, "BigNumber, BigNumber": function (n, k) {var result,i,BigNumber = n.constructor,one = new BigNumber(1),nMinusOne = n.minus(one);if (!isPositiveInteger(n) || !isPositiveInteger(k)) throw new TypeError("Positive integer value expected in function combinationsWithRep");if (n.lt(one)) throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if (result = one, k.lt(nMinusOne)) for (i = one; i.lte(nMinusOne); i = i.plus(one)) result = result.times(k.plus(i)).dividedBy(i);else for (i = one; i.lte(k); i = i.plus(one)) result = result.times(nMinusOne.plus(i)).dividedBy(i);return result;} });});exports.createCombinationsWithRep = createCombinationsWithRep;function isPositiveInteger(n) {return n.isInteger() && n.gte(0);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/factorial.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFactorial = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "factorial",dependencies = ["typed", "gamma"],createFactorial = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,gamma = _ref.gamma;return typed(name, { number: function (n) {if (0 > n) throw new Error("Value must be non-negative");return gamma(n + 1);}, BigNumber: function (n) {if (n.isNegative()) throw new Error("Value must be non-negative");return gamma(n.plus(1));}, "Array | Matrix": function (n) {return (0, _collection.deepMap)(n, this);} });});exports.createFactorial = createFactorial;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/gamma.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createGamma = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "gamma",dependencies = ["typed", "config", "multiplyScalar", "pow", "BigNumber", "Complex"],createGamma = (0, _factory.factory)(name, dependencies, function (_ref) {function bigFactorial(n) {if (8 > n) return new _BigNumber([1, 1, 2, 6, 24, 120, 720, 5040][n]);var precision = config.precision + (0 | Math.log(n.toNumber())),Big = _BigNumber.clone({ precision: precision });if (1 == n % 2) return n.times(bigFactorial(new _BigNumber(n - 1)));for (var p = n, prod = new Big(n), sum = n.toNumber(); 2 < p;) p -= 2, sum += p, prod = prod.times(sum);return new _BigNumber(prod.toPrecision(_BigNumber.precision));}var typed = _ref.typed,config = _ref.config,multiplyScalar = _ref.multiplyScalar,pow = _ref.pow,_BigNumber = _ref.BigNumber,_Complex = _ref.Complex;return typed(name, { number: _index.gammaNumber, Complex: function (n) {if (0 === n.im) return this(n.re);n = new _Complex(n.re - 1, n.im);for (var x = new _Complex(_index.gammaP[0], 0), i = 1; i < _index.gammaP.length; ++i) {var real = n.re + i,den = real * real + n.im * n.im;0 === den ? x.re = 0 > _index.gammaP[i] ? -Infinity : 1 / 0 : (x.re += _index.gammaP[i] * real / den, x.im += -(_index.gammaP[i] * n.im) / den);}var t = new _Complex(n.re + _index.gammaG + .5, n.im),twoPiSqrt = Math.sqrt(2 * Math.PI);n.re += .5;var result = pow(t, n);0 === result.im ? result.re *= twoPiSqrt : 0 === result.re ? result.im *= twoPiSqrt : (result.re *= twoPiSqrt, result.im *= twoPiSqrt);var r = Math.exp(-t.re);return t.re = r * Math.cos(-t.im), t.im = r * Math.sin(-t.im), multiplyScalar(multiplyScalar(result, t), x);}, BigNumber: function (n) {if (n.isInteger()) return n.isNegative() || n.isZero() ? new _BigNumber(1 / 0) : bigFactorial(n.minus(1));if (!n.isFinite()) return new _BigNumber(n.isNegative() ? NaN : 1 / 0);throw new Error("Integer BigNumber expected");}, "Array | Matrix": function (n) {return (0, _collection.deepMap)(n, this);} });});exports.createGamma = createGamma;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/kldivergence.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createKldivergence = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "kldivergence",dependencies = ["typed", "matrix", "divide", "sum", "multiply", "dotDivide", "log", "isNumeric"],createKldivergence = (0, _factory.factory)(name, dependencies, function (_ref) {function _kldiv(q, p) {var plength = p.size().length,qlength = q.size().length;if (1 < plength) throw new Error("first object must be one dimensional");if (1 < qlength) throw new Error("second object must be one dimensional");if (plength !== qlength) throw new Error("Length of two vectors must be equal");var sumq = sum(q);if (0 === sumq) throw new Error("Sum of elements in first object must be non zero");var sump = sum(p);if (0 === sump) throw new Error("Sum of elements in second object must be non zero");var qnorm = divide(q, sum(q)),pnorm = divide(p, sum(p)),result = sum(multiply(qnorm, log(dotDivide(qnorm, pnorm))));return isNumeric(result) ? result : Number.NaN;}var typed = _ref.typed,matrix = _ref.matrix,divide = _ref.divide,sum = _ref.sum,multiply = _ref.multiply,dotDivide = _ref.dotDivide,log = _ref.log,isNumeric = _ref.isNumeric;return typed(name, { "Array, Array": function (q, p) {return _kldiv(matrix(q), matrix(p));}, "Matrix, Array": function (q, p) {return _kldiv(q, matrix(p));}, "Array, Matrix": function (q, p) {return _kldiv(matrix(q), p);}, "Matrix, Matrix": function (q, p) {return _kldiv(q, p);} });});exports.createKldivergence = createKldivergence;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/multinomial.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMultinomial = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "multinomial",dependencies = ["typed", "add", "divide", "multiply", "factorial", "isInteger", "isPositive"],createMultinomial = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,add = _ref.add,divide = _ref.divide,multiply = _ref.multiply,factorial = _ref.factorial,isInteger = _ref.isInteger,isPositive = _ref.isPositive;return typed(name, { "Array | Matrix": function (a) {var sum = 0,denom = 1;return (0, _collection.deepForEach)(a, function (ai) {if (!isInteger(ai) || !isPositive(ai)) throw new TypeError("Positive integer value expected in function multinomial");sum = add(sum, ai), denom = multiply(denom, factorial(ai));}), divide(factorial(sum), denom);} });});exports.createMultinomial = createMultinomial;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/permutations.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createPermutations = void 0;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_product = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/product.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "permutations",dependencies = ["typed", "factorial"],createPermutations = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,factorial = _ref.factorial;return typed(name, { "number | BigNumber": factorial, "number, number": function (n, k) {if (!(0, _number.isInteger)(n) || 0 > n) throw new TypeError("Positive integer value expected in function permutations");if (!(0, _number.isInteger)(k) || 0 > k) throw new TypeError("Positive integer value expected in function permutations");if (k > n) throw new TypeError("second argument k must be less than or equal to first argument n");return (0, _product.product)(n - k + 1, n);}, "BigNumber, BigNumber": function (n, k) {var result, i;if (!isPositiveInteger(n) || !isPositiveInteger(k)) throw new TypeError("Positive integer value expected in function permutations");if (k.gt(n)) throw new TypeError("second argument k must be less than or equal to first argument n");var one = n.mul(0).add(1);for (result = one, i = n.minus(k).plus(1); i.lte(n); i = i.plus(1)) result = result.times(i);return result;} });});exports.createPermutations = createPermutations;function isPositiveInteger(n) {return n.isInteger() && n.gte(0);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/pickRandom.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createPickRandom = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_seededRNG = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js"),name = "pickRandom",dependencies = ["typed", "config", "?on"],createPickRandom = (0, _factory.factory)(name, dependencies, function (_ref) {function _pickRandom(possibles, _ref2) {var number = _ref2.number,weights = _ref2.weights,_ref2$elementWise = _ref2.elementWise,single = "undefined" == typeof number;single && (number = 1);var createMatrix = (0, _is.isMatrix)(possibles) ? possibles.create : (0, _is.isMatrix)(weights) ? weights.create : null;possibles = possibles.valueOf(), weights && (weights = weights.valueOf()), !0 === (void 0 === _ref2$elementWise || _ref2$elementWise) && (possibles = (0, _array.flatten)(possibles), weights = (0, _array.flatten)(weights));var totalWeights = 0;if ("undefined" != typeof weights) {if (weights.length !== possibles.length) throw new Error("Weights must have the same length as possibles");for (var i = 0, len = weights.length; i < len; i++) {if (!(0, _is.isNumber)(weights[i]) || 0 > weights[i]) throw new Error("Weights must be an array of positive numbers");totalWeights += weights[i];}}for (var pick, length = possibles.length, result = []; result.length < number;) {if ("undefined" == typeof weights) pick = possibles[Math.floor(rng() * length)];else for (var randKey = rng() * totalWeights, _i = 0, _len = possibles.length; _i < _len; _i++) if (randKey -= weights[_i], 0 > randKey) {pick = possibles[_i];break;}result.push(pick);}return single ? result[0] : createMatrix ? createMatrix(result) : result;}var typed = _ref.typed,config = _ref.config,on = _ref.on,rng = (0, _seededRNG.createRng)(config.randomSeed);return on && on("config", function (curr, prev) {curr.randomSeed !== prev.randomSeed && (rng = (0, _seededRNG.createRng)(curr.randomSeed));}), typed(name, { "Array | Matrix": function (possibles) {return _pickRandom(possibles, {});}, "Array | Matrix, Object": function (possibles, options) {return _pickRandom(possibles, options);}, "Array | Matrix, number": function (possibles, number) {return _pickRandom(possibles, { number: number });}, "Array | Matrix, Array | Matrix": function (possibles, weights) {return _pickRandom(possibles, { weights: weights });}, "Array | Matrix, Array | Matrix, number": function (possibles, weights, number) {return _pickRandom(possibles, { number: number, weights: weights });}, "Array | Matrix, number, Array | Matrix": function (possibles, number, weights) {return _pickRandom(possibles, { number: number, weights: weights });} });});exports.createPickRandom = createPickRandom;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/random.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRandomNumber = exports.createRandom = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_seededRNG = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js"),_randomMatrix2 = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/util/randomMatrix.js"),name = "random",dependencies = ["typed", "config", "?on"],createRandom = (0, _factory.factory)(name, dependencies, function (_ref) {function _randomMatrix(size, min, max) {var res = (0, _randomMatrix2.randomMatrix)(size.valueOf(), function () {return _random(min, max);});return (0, _is.isMatrix)(size) ? size.create(res) : res;}function _random(min, max) {return min + rng() * (max - min);}var typed = _ref.typed,config = _ref.config,on = _ref.on,rng = (0, _seededRNG.createRng)(config.randomSeed);return on && on("config", function (curr, prev) {curr.randomSeed !== prev.randomSeed && (rng = (0, _seededRNG.createRng)(curr.randomSeed));}), typed(name, { "": function () {return _random(0, 1);}, number: function (max) {return _random(0, max);}, "number, number": function (min, max) {return _random(min, max);}, "Array | Matrix": function (size) {return _randomMatrix(size, 0, 1);}, "Array | Matrix, number": function (size, max) {return _randomMatrix(size, 0, max);}, "Array | Matrix, number, number": function (size, min, max) {return _randomMatrix(size, min, max);} });});exports.createRandom = createRandom;var createRandomNumber = (0, _factory.factory)(name, ["typed", "config", "?on"], function (_ref2) {function _random(min, max) {return min + rng() * (max - min);}var typed = _ref2.typed,config = _ref2.config,on = _ref2.on,matrix = _ref2.matrix,rng = (0, _seededRNG.createRng)(config.randomSeed);return on && on("config", function (curr, prev) {curr.randomSeed !== prev.randomSeed && (rng = (0, _seededRNG.createRng)(curr.randomSeed));}), typed(name, { "": function () {return _random(0, 1);}, number: function (max) {return _random(0, max);}, "number, number": function (min, max) {return _random(min, max);} });});exports.createRandomNumber = createRandomNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/randomInt.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRandomInt = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_randomMatrix = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/util/randomMatrix.js"),_seededRNG = __webpack_require__("./node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "randomInt",dependencies = ["typed", "config", "?on"],createRandomInt = (0, _factory.factory)(name, dependencies, function (_ref) {function _randomIntMatrix(size, min, max) {var res = (0, _randomMatrix.randomMatrix)(size.valueOf(), function () {return _randomInt(min, max);});return (0, _is.isMatrix)(size) ? size.create(res) : res;}function _randomInt(min, max) {return Math.floor(min + rng() * (max - min));}var typed = _ref.typed,config = _ref.config,on = _ref.on,rng = (0, _seededRNG.createRng)(config.randomSeed);return on && on("config", function (curr, prev) {curr.randomSeed !== prev.randomSeed && (rng = (0, _seededRNG.createRng)(curr.randomSeed));}), typed(name, { "": function () {return _randomInt(0, 1);}, number: function (max) {return _randomInt(0, max);}, "number, number": function (min, max) {return _randomInt(min, max);}, "Array | Matrix": function (size) {return _randomIntMatrix(size, 0, 1);}, "Array | Matrix, number": function (size, max) {return _randomIntMatrix(size, 0, max);}, "Array | Matrix, number, number": function (size, min, max) {return _randomIntMatrix(size, min, max);} });});exports.createRandomInt = createRandomInt;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/util/randomMatrix.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.randomMatrix = randomMatrix;function randomMatrix(size, random) {var data = [];if (size = size.slice(0), 1 < size.length) for (var i = 0, length = size.shift(); i < length; i++) data.push(randomMatrix(size, random));else for (var _i = 0, _length = size.shift(); _i < _length; _i++) data.push(random());return data;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRng = createRng;var _seedrandom = _interopRequireDefault(__webpack_require__("./node_modules/seedrandom/index.js")),singletonRandom = (0, _seedrandom["default"])(Date.now());function createRng(randomSeed) {function rng() {return random();}var random;return function setSeed(seed) {random = null === seed ? singletonRandom : (0, _seedrandom["default"])(seed + "");}(randomSeed), rng;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/compare.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCompareNumber = exports.createCompare = void 0;var _nearlyEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm05.js"),name = "compare",dependencies = ["typed", "config", "matrix", "equalScalar", "BigNumber", "Fraction", "DenseMatrix"],createCompare = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,equalScalar = _ref.equalScalar,matrix = _ref.matrix,BigNumber = _ref.BigNumber,Fraction = _ref.Fraction,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm05 = (0, _algorithm5.createAlgorithm05)({ typed: typed, equalScalar: equalScalar }),algorithm12 = (0, _algorithm2.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm4.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm3.createAlgorithm14)({ typed: typed });return typed(name, { "boolean, boolean": function (x, y) {return x === y ? 0 : x > y ? 1 : -1;}, "number, number": function (x, y) {return (0, _number.nearlyEqual)(x, y, config.epsilon) ? 0 : x > y ? 1 : -1;}, "BigNumber, BigNumber": function (x, y) {return (0, _nearlyEqual.nearlyEqual)(x, y, config.epsilon) ? new BigNumber(0) : new BigNumber(x.cmp(y));}, "Fraction, Fraction": function (x, y) {return new Fraction(x.compare(y));}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm05(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createCompare = createCompare;var createCompareNumber = (0, _factory.factory)(name, ["typed", "config"], function (_ref2) {var typed = _ref2.typed,config = _ref2.config;return typed(name, { "number, number": function (x, y) {return (0, _number.nearlyEqual)(x, y, config.epsilon) ? 0 : x > y ? 1 : -1;} });});exports.createCompareNumber = createCompareNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/compareNatural.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCompareNatural = void 0;var _javascriptNaturalSort = _interopRequireDefault(__webpack_require__("./node_modules/javascript-natural-sort/naturalSort.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "compareNatural",dependencies = ["typed", "compare"],createCompareNatural = (0, _factory.factory)(name, dependencies, function (_ref) {function compareMatricesAndArrays(compareNatural, x, y) {return (0, _is.isSparseMatrix)(x) && (0, _is.isSparseMatrix)(y) ? compareArrays(compareNatural, x.toJSON().values, y.toJSON().values) : (0, _is.isSparseMatrix)(x) ? compareMatricesAndArrays(compareNatural, x.toArray(), y) : (0, _is.isSparseMatrix)(y) ? compareMatricesAndArrays(compareNatural, x, y.toArray()) : (0, _is.isDenseMatrix)(x) ? compareMatricesAndArrays(compareNatural, x.toJSON().data, y) : (0, _is.isDenseMatrix)(y) ? compareMatricesAndArrays(compareNatural, x, y.toJSON().data) : Array.isArray(x) ? Array.isArray(y) ? compareArrays(compareNatural, x, y) : compareMatricesAndArrays(compareNatural, x, [y]) : compareMatricesAndArrays(compareNatural, [x], y);}function compareArrays(compareNatural, x, y) {for (var v, i = 0, ii = Math.min(x.length, y.length); i < ii; i++) if (v = compareNatural(x[i], y[i]), 0 !== v) return v;return x.length > y.length ? 1 : x.length < y.length ? -1 : 0;}function compareObjects(compareNatural, x, y) {var keysX = Object.keys(x),keysY = Object.keys(y);keysX.sort(_javascriptNaturalSort["default"]), keysY.sort(_javascriptNaturalSort["default"]);var c = compareArrays(compareNatural, keysX, keysY);if (0 !== c) return c;for (var v, i = 0; i < keysX.length; i++) if (v = compareNatural(x[keysX[i]], y[keysY[i]]), 0 !== v) return v;return 0;}var typed = _ref.typed,compare = _ref.compare,compareBooleans = compare.signatures["boolean,boolean"];return typed(name, { "any, any": function (x, y) {var c,typeX = (0, _is.typeOf)(x),typeY = (0, _is.typeOf)(y);if (("number" === typeX || "BigNumber" === typeX || "Fraction" === typeX) && ("number" === typeY || "BigNumber" === typeY || "Fraction" === typeY)) return c = compare(x, y), "0" === c.toString() ? (0, _javascriptNaturalSort["default"])(typeX, typeY) : 0 < c ? 1 : -1;if ("Array" === typeX || "Matrix" === typeX || "Array" === typeY || "Matrix" === typeY) return c = compareMatricesAndArrays(this, x, y), 0 === c ? (0, _javascriptNaturalSort["default"])(typeX, typeY) : c;if (typeX !== typeY) return (0, _javascriptNaturalSort["default"])(typeX, typeY);if ("Complex" === typeX) return compareComplexNumbers(x, y);if ("Unit" === typeX) return x.equalBase(y) ? this(x.value, y.value) : compareArrays(this, x.formatUnits(), y.formatUnits());if ("boolean" === typeX) return compareBooleans(x, y);if ("string" === typeX) return (0, _javascriptNaturalSort["default"])(x, y);if ("Object" === typeX) return compareObjects(this, x, y);if ("null" === typeX) return 0;if ("undefined" === typeX) return 0;throw new TypeError("Unsupported type of value \"" + typeX + "\"");} });});exports.createCompareNatural = createCompareNatural;function compareComplexNumbers(x, y) {return x.re > y.re ? 1 : x.re < y.re ? -1 : x.im > y.im ? 1 : x.im < y.im ? -1 : 0;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/compareText.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCompareTextNumber = exports.createCompareText = void 0;var _string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),name = "compareText",dependencies = ["typed", "matrix"],createCompareText = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,algorithm13 = (0, _algorithm2.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm.createAlgorithm14)({ typed: typed });return typed(name, { "any, any": _string.compareText, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, _string.compareText);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, _string.compareText, !1);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, _string.compareText, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, _string.compareText, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, _string.compareText, !0).valueOf();} });});exports.createCompareText = createCompareText;var createCompareTextNumber = (0, _factory.factory)(name, ["typed"], function (_ref2) {var typed = _ref2.typed;return typed(name, { "any, any": _string.compareText });});exports.createCompareTextNumber = createCompareTextNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/deepEqual.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDeepEqual = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "deepEqual",dependencies = ["typed", "equal"],createDeepEqual = (0, _factory.factory)(name, dependencies, function (_ref) {function _deepEqual(x, y) {if (Array.isArray(x)) {if (Array.isArray(y)) {var len = x.length;if (len !== y.length) return !1;for (var i = 0; i < len; i++) if (!_deepEqual(x[i], y[i])) return !1;return !0;}return !1;}return !Array.isArray(y) && equal(x, y);}var typed = _ref.typed,equal = _ref.equal;return typed(name, { "any, any": function (x, y) {return _deepEqual(x.valueOf(), y.valueOf());} });});exports.createDeepEqual = createDeepEqual;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/equal.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createEqualNumber = exports.createEqual = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "equal",dependencies = ["typed", "matrix", "equalScalar", "DenseMatrix"],createEqual = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm2.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm12 = (0, _algorithm3.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm4.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm5.createAlgorithm14)({ typed: typed });return typed(name, { "any, any": function (x, y) {return null === x ? null === y : null === y ? null === x : void 0 === x ? void 0 === y : void 0 === y ? void 0 === x : equalScalar(x, y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, equalScalar);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, equalScalar, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, equalScalar, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, equalScalar);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, equalScalar, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, equalScalar, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, equalScalar, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, equalScalar, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, equalScalar, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, equalScalar, !0).valueOf();} });});exports.createEqual = createEqual;var createEqualNumber = (0, _factory.factory)(name, ["typed", "equalScalar"], function (_ref2) {var typed = _ref2.typed,equalScalar = _ref2.equalScalar;return typed(name, { "any, any": function (x, y) {return null === x ? null === y : null === y ? null === x : void 0 === x ? void 0 === y : void 0 === y ? void 0 === x : equalScalar(x, y);} });});exports.createEqualNumber = createEqualNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/equalScalar.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createEqualScalarNumber = exports.createEqualScalar = void 0;var _nearlyEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_complex = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/complex.js"),name = "equalScalar",dependencies = ["typed", "config"],createEqualScalar = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config;return typed(name, { "boolean, boolean": function (x, y) {return x === y;}, "number, number": function (x, y) {return (0, _number.nearlyEqual)(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.eq(y) || (0, _nearlyEqual.nearlyEqual)(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return x.equals(y);}, "Complex, Complex": function (x, y) {return (0, _complex.complexEquals)(x, y, config.epsilon);}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);} });});exports.createEqualScalar = createEqualScalar;var createEqualScalarNumber = (0, _factory.factory)(name, ["typed", "config"], function (_ref2) {var typed = _ref2.typed,config = _ref2.config;return typed(name, { "number, number": function (x, y) {return (0, _number.nearlyEqual)(x, y, config.epsilon);} });});exports.createEqualScalarNumber = createEqualScalarNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/equalText.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createEqualText = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "equalText",dependencies = ["typed", "compareText", "isZero"],createEqualText = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,compareText = _ref.compareText,isZero = _ref.isZero;return typed(name, { "any, any": function (x, y) {return isZero(compareText(x, y));} });});exports.createEqualText = createEqualText;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/larger.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLargerNumber = exports.createLarger = void 0;var _nearlyEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),name = "larger",dependencies = ["typed", "config", "matrix", "DenseMatrix"],createLarger = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm2.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm12 = (0, _algorithm3.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm5.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "boolean, boolean": function (x, y) {return x > y;}, "number, number": function (x, y) {return x > y && !(0, _number.nearlyEqual)(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.gt(y) && !(0, _nearlyEqual.nearlyEqual)(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return 1 === x.compare(y);}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createLarger = createLarger;var createLargerNumber = (0, _factory.factory)(name, ["typed", "config"], function (_ref2) {var typed = _ref2.typed,config = _ref2.config;return typed(name, { "number, number": function (x, y) {return x > y && !(0, _number.nearlyEqual)(x, y, config.epsilon);} });});exports.createLargerNumber = createLargerNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/largerEq.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createLargerEqNumber = exports.createLargerEq = void 0;var _nearlyEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),name = "largerEq",dependencies = ["typed", "config", "matrix", "DenseMatrix"],createLargerEq = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm2.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm12 = (0, _algorithm3.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm5.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "boolean, boolean": function (x, y) {return x >= y;}, "number, number": function (x, y) {return x >= y || (0, _number.nearlyEqual)(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.gte(y) || (0, _nearlyEqual.nearlyEqual)(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return -1 !== x.compare(y);}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createLargerEq = createLargerEq;var createLargerEqNumber = (0, _factory.factory)(name, ["typed", "config"], function (_ref2) {var typed = _ref2.typed,config = _ref2.config;return typed(name, { "number, number": function (x, y) {return x >= y || (0, _number.nearlyEqual)(x, y, config.epsilon);} });});exports.createLargerEqNumber = createLargerEqNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/smaller.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSmallerNumber = exports.createSmaller = void 0;var _nearlyEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),name = "smaller",dependencies = ["typed", "config", "matrix", "DenseMatrix"],createSmaller = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm2.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm12 = (0, _algorithm3.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm5.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "boolean, boolean": function (x, y) {return x < y;}, "number, number": function (x, y) {return x < y && !(0, _number.nearlyEqual)(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.lt(y) && !(0, _nearlyEqual.nearlyEqual)(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return -1 === x.compare(y);}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createSmaller = createSmaller;var createSmallerNumber = (0, _factory.factory)(name, ["typed", "config"], function (_ref2) {var typed = _ref2.typed,config = _ref2.config;return typed(name, { "number, number": function (x, y) {return x < y && !(0, _number.nearlyEqual)(x, y, config.epsilon);} });});exports.createSmallerNumber = createSmallerNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/smallerEq.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSmallerEqNumber = exports.createSmallerEq = void 0;var _nearlyEqual = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),name = "smallerEq",dependencies = ["typed", "config", "matrix", "DenseMatrix"],createSmallerEq = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,matrix = _ref.matrix,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm2.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm12 = (0, _algorithm3.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm5.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed(name, { "boolean, boolean": function (x, y) {return x <= y;}, "number, number": function (x, y) {return x <= y || (0, _number.nearlyEqual)(x, y, config.epsilon);}, "BigNumber, BigNumber": function (x, y) {return x.lte(y) || (0, _nearlyEqual.nearlyEqual)(x, y, config.epsilon);}, "Fraction, Fraction": function (x, y) {return 1 !== x.compare(y);}, "Complex, Complex": function () {throw new TypeError("No ordering relation is defined for complex numbers");}, "Unit, Unit": function (x, y) {if (!x.equalBase(y)) throw new Error("Cannot compare units with different base");return this(x.value, y.value);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, this);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, this, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createSmallerEq = createSmallerEq;var createSmallerEqNumber = (0, _factory.factory)(name, ["typed", "config"], function (_ref2) {var typed = _ref2.typed,config = _ref2.config;return typed(name, { "number, number": function (x, y) {return x <= y || (0, _number.nearlyEqual)(x, y, config.epsilon);} });});exports.createSmallerEqNumber = createSmallerEqNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/relational/unequal.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUnequalNumber = exports.createUnequal = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),name = "unequal",dependencies = ["typed", "config", "equalScalar", "matrix", "DenseMatrix"],createUnequal = (0, _factory.factory)(name, dependencies, function (_ref) {function _unequal(x, y) {return !equalScalar(x, y);}var typed = _ref.typed,config = _ref.config,equalScalar = _ref.equalScalar,matrix = _ref.matrix,DenseMatrix = _ref.DenseMatrix,algorithm03 = (0, _algorithm.createAlgorithm03)({ typed: typed }),algorithm07 = (0, _algorithm2.createAlgorithm07)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm12 = (0, _algorithm3.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm5.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm4.createAlgorithm14)({ typed: typed });return typed("unequal", { "any, any": function (x, y) {return null === x ? null !== y : null === y ? null !== x : void 0 === x ? void 0 !== y : void 0 === y ? void 0 !== x : _unequal(x, y);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm07(x, y, _unequal);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm03(y, x, _unequal, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, _unequal, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, _unequal);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, any": function (x, y) {return algorithm12(x, y, _unequal, !1);}, "DenseMatrix, any": function (x, y) {return algorithm14(x, y, _unequal, !1);}, "any, SparseMatrix": function (x, y) {return algorithm12(y, x, _unequal, !0);}, "any, DenseMatrix": function (x, y) {return algorithm14(y, x, _unequal, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, _unequal, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, _unequal, !0).valueOf();} });});exports.createUnequal = createUnequal;var createUnequalNumber = (0, _factory.factory)(name, ["typed", "equalScalar"], function (_ref2) {var typed = _ref2.typed,equalScalar = _ref2.equalScalar;return typed(name, { "any, any": function (x, y) {return null === x ? null !== y : null === y ? null !== x : void 0 === x ? void 0 !== y : void 0 === y ? void 0 !== x : !equalScalar(x, y);} });});exports.createUnequalNumber = createUnequalNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setCartesian.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetCartesian = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setCartesian",dependencies = ["typed", "size", "subset", "compareNatural", "Index", "DenseMatrix"],createSetCartesian = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,size = _ref.size,subset = _ref.subset,compareNatural = _ref.compareNatural,Index = _ref.Index,DenseMatrix = _ref.DenseMatrix;return typed(name, { "Array | Matrix, Array | Matrix": function (a1, a2) {var result = [];if (0 !== subset(size(a1), new Index(0)) && 0 !== subset(size(a2), new Index(0))) {var b1 = (0, _array.flatten)(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural),b2 = (0, _array.flatten)(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural);result = [];for (var i = 0; i < b1.length; i++) for (var j = 0; j < b2.length; j++) result.push([b1[i], b2[j]]);}return Array.isArray(a1) && Array.isArray(a2) ? result : new DenseMatrix(result);} });});exports.createSetCartesian = createSetCartesian;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setDifference.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetDifference = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setDifference",dependencies = ["typed", "size", "subset", "compareNatural", "Index", "DenseMatrix"],createSetDifference = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,size = _ref.size,subset = _ref.subset,compareNatural = _ref.compareNatural,Index = _ref.Index,DenseMatrix = _ref.DenseMatrix;return typed(name, { "Array | Matrix, Array | Matrix": function (a1, a2) {var result;if (0 === subset(size(a1), new Index(0))) result = [];else {if (0 === subset(size(a2), new Index(0))) return (0, _array.flatten)(a1.toArray());var b1 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)),b2 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));result = [];for (var inb2, i = 0; i < b1.length; i++) {inb2 = !1;for (var j = 0; j < b2.length; j++) if (0 === compareNatural(b1[i].value, b2[j].value) && b1[i].identifier === b2[j].identifier) {inb2 = !0;break;}inb2 || result.push(b1[i]);}}return Array.isArray(a1) && Array.isArray(a2) ? (0, _array.generalize)(result) : new DenseMatrix((0, _array.generalize)(result));} });});exports.createSetDifference = createSetDifference;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setDistinct.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetDistinct = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setDistinct",dependencies = ["typed", "size", "subset", "compareNatural", "Index", "DenseMatrix"],createSetDistinct = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,size = _ref.size,subset = _ref.subset,compareNatural = _ref.compareNatural,Index = _ref.Index,DenseMatrix = _ref.DenseMatrix;return typed(name, { "Array | Matrix": function (a) {var result;if (0 === subset(size(a), new Index(0))) result = [];else {var b = (0, _array.flatten)(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);result = [], result.push(b[0]);for (var i = 1; i < b.length; i++) 0 !== compareNatural(b[i], b[i - 1]) && result.push(b[i]);}return Array.isArray(a) ? result : new DenseMatrix(result);} });});exports.createSetDistinct = createSetDistinct;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setIntersect.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetIntersect = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setIntersect",dependencies = ["typed", "size", "subset", "compareNatural", "Index", "DenseMatrix"],createSetIntersect = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,size = _ref.size,subset = _ref.subset,compareNatural = _ref.compareNatural,Index = _ref.Index,DenseMatrix = _ref.DenseMatrix;return typed(name, { "Array | Matrix, Array | Matrix": function (a1, a2) {var result;if (0 === subset(size(a1), new Index(0)) || 0 === subset(size(a2), new Index(0))) result = [];else {var b1 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)),b2 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));result = [];for (var i = 0; i < b1.length; i++) for (var j = 0; j < b2.length; j++) if (0 === compareNatural(b1[i].value, b2[j].value) && b1[i].identifier === b2[j].identifier) {result.push(b1[i]);break;}}return Array.isArray(a1) && Array.isArray(a2) ? (0, _array.generalize)(result) : new DenseMatrix((0, _array.generalize)(result));} });});exports.createSetIntersect = createSetIntersect;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setIsSubset.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetIsSubset = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setIsSubset",dependencies = ["typed", "size", "subset", "compareNatural", "Index"],createSetIsSubset = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,size = _ref.size,subset = _ref.subset,compareNatural = _ref.compareNatural,Index = _ref.Index;return typed(name, { "Array | Matrix, Array | Matrix": function (a1, a2) {if (0 === subset(size(a1), new Index(0))) return !0;if (0 === subset(size(a2), new Index(0))) return !1;for (var inb2, b1 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)), b2 = (0, _array.identify)((0, _array.flatten)(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural)), i = 0; i < b1.length; i++) {inb2 = !1;for (var j = 0; j < b2.length; j++) if (0 === compareNatural(b1[i].value, b2[j].value) && b1[i].identifier === b2[j].identifier) {inb2 = !0;break;}if (!1 === inb2) return !1;}return !0;} });});exports.createSetIsSubset = createSetIsSubset;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setMultiplicity.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetMultiplicity = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setMultiplicity",dependencies = ["typed", "size", "subset", "compareNatural", "Index"],createSetMultiplicity = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,size = _ref.size,subset = _ref.subset,compareNatural = _ref.compareNatural,Index = _ref.Index;return typed(name, { "number | BigNumber | Fraction | Complex, Array | Matrix": function (e, a) {if (0 === subset(size(a), new Index(0))) return 0;for (var b = (0, _array.flatten)(Array.isArray(a) ? a : a.toArray()), count = 0, i = 0; i < b.length; i++) 0 === compareNatural(b[i], e) && count++;return count;} });});exports.createSetMultiplicity = createSetMultiplicity;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setPowerset.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetPowerset = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setPowerset",dependencies = ["typed", "size", "subset", "compareNatural", "Index"],createSetPowerset = (0, _factory.factory)(name, dependencies, function (_ref) {function _subset(array, bitarray) {for (var result = [], i = 0; i < bitarray.length; i++) "1" === bitarray[i] && result.push(array[i]);return result;}function _sort(array) {for (var temp = [], i = array.length - 1; 0 < i; i--) for (var j = 0; j < i; j++) array[j].length > array[j + 1].length && (temp = array[j], array[j] = array[j + 1], array[j + 1] = temp);return array;}var typed = _ref.typed,size = _ref.size,subset = _ref.subset,compareNatural = _ref.compareNatural,Index = _ref.Index;return typed(name, { "Array | Matrix": function (a) {if (0 === subset(size(a), new Index(0))) return [];for (var b = (0, _array.flatten)(Array.isArray(a) ? a : a.toArray()).sort(compareNatural), result = [], number = 0; number.toString(2).length <= b.length;) result.push(_subset(b, number.toString(2).split("").reverse())), number++;return _sort(result);} });});exports.createSetPowerset = createSetPowerset;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setSize.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetSize = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setSize",dependencies = ["typed", "compareNatural"],createSetSize = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,compareNatural = _ref.compareNatural;return typed(name, { "Array | Matrix": function (a) {return Array.isArray(a) ? (0, _array.flatten)(a).length : (0, _array.flatten)(a.toArray()).length;}, "Array | Matrix, boolean": function (a, unique) {if (!1 === unique || 0 === a.length) return Array.isArray(a) ? (0, _array.flatten)(a).length : (0, _array.flatten)(a.toArray()).length;for (var b = (0, _array.flatten)(Array.isArray(a) ? a : a.toArray()).sort(compareNatural), count = 1, i = 1; i < b.length; i++) 0 !== compareNatural(b[i], b[i - 1]) && count++;return count;} });});exports.createSetSize = createSetSize;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setSymDifference.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetSymDifference = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setSymDifference",dependencies = ["typed", "size", "concat", "subset", "setDifference", "Index"],createSetSymDifference = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,size = _ref.size,concat = _ref.concat,subset = _ref.subset,setDifference = _ref.setDifference,Index = _ref.Index;return typed(name, { "Array | Matrix, Array | Matrix": function (a1, a2) {if (0 === subset(size(a1), new Index(0))) return (0, _array.flatten)(a2);if (0 === subset(size(a2), new Index(0))) return (0, _array.flatten)(a1);var b1 = (0, _array.flatten)(a1),b2 = (0, _array.flatten)(a2);return concat(setDifference(b1, b2), setDifference(b2, b1));} });});exports.createSetSymDifference = createSetSymDifference;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/set/setUnion.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSetUnion = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "setUnion",dependencies = ["typed", "size", "concat", "subset", "setIntersect", "setSymDifference", "Index"],createSetUnion = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,size = _ref.size,concat = _ref.concat,subset = _ref.subset,setIntersect = _ref.setIntersect,setSymDifference = _ref.setSymDifference,Index = _ref.Index;return typed(name, { "Array | Matrix, Array | Matrix": function (a1, a2) {if (0 === subset(size(a1), new Index(0))) return (0, _array.flatten)(a2);if (0 === subset(size(a2), new Index(0))) return (0, _array.flatten)(a1);var b1 = (0, _array.flatten)(a1),b2 = (0, _array.flatten)(a2);return concat(setSymDifference(b1, b2), setIntersect(b1, b2));} });});exports.createSetUnion = createSetUnion;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/special/erf.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createErf = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "erf",dependencies = ["typed"],createErf = (0, _factory.factory)(name, dependencies, function (_ref) {function erf1(y) {var i,ysq = y * y,xnum = P[0][4] * ysq,xden = ysq;for (i = 0; 3 > i; i += 1) xnum = (xnum + P[0][i]) * ysq, xden = (xden + Q[0][i]) * ysq;return y * (xnum + P[0][3]) / (xden + Q[0][3]);}function erfc2(y) {var i,xnum = P[1][8] * y,xden = y;for (i = 0; 7 > i; i += 1) xnum = (xnum + P[1][i]) * y, xden = (xden + Q[1][i]) * y;var result = (xnum + P[1][7]) / (xden + Q[1][7]),ysq = parseInt(16 * y) / 16;return Math.exp(-ysq * ysq) * Math.exp(-((y - ysq) * (y + ysq))) * result;}function erfc3(y) {var i,ysq = 1 / (y * y),xnum = P[2][5] * ysq,xden = ysq;for (i = 0; 4 > i; i += 1) xnum = (xnum + P[2][i]) * ysq, xden = (xden + Q[2][i]) * ysq;var result = ysq * (xnum + P[2][4]) / (xden + Q[2][4]);result = (SQRPI - result) / y, ysq = parseInt(16 * y) / 16;var del = (y - ysq) * (y + ysq);return Math.exp(-ysq * ysq) * Math.exp(-del) * result;}var typed = _ref.typed;return typed("name", { number: function (x) {var y = Math.abs(x);return y >= MAX_NUM ? (0, _number.sign)(x) : y <= THRESH ? (0, _number.sign)(x) * erf1(y) : 4 >= y ? (0, _number.sign)(x) * (1 - erfc2(y)) : (0, _number.sign)(x) * (1 - erfc3(y));}, "Array | Matrix": function (n) {return (0, _collection.deepMap)(n, this);} });});exports.createErf = createErf;var THRESH = .46875,SQRPI = .5641895835477563,P = [[3.1611237438705655, 113.86415415105016, 377.485237685302, 3209.3775891384694, .18577770618460315], [.5641884969886701, 8.883149794388377, 66.11919063714163, 298.6351381974001, 881.952221241769, 1712.0476126340707, 2051.0783778260716, 1230.3393547979972, 2.1531153547440383e-8], [.30532663496123236, .36034489994980445, .12578172611122926, .016083785148742275, .0006587491615298378, .016315387137302097]],Q = [[23.601290952344122, 244.02463793444417, 1282.6165260773723, 2844.236833439171], [15.744926110709835, 117.6939508913125, 537.1811018620099, 1621.3895745666903, 3290.7992357334597, 4362.619090143247, 3439.3676741437216, 1230.3393548037495], [2.568520192289822, 1.8729528499234604, .5279051029514285, .06051834131244132, .0023352049762686918]],MAX_NUM = Math.pow(2, 53);

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/mad.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMad = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_improveErrorMessage = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js"),name = "mad",dependencies = ["typed", "abs", "map", "median", "subtract"],createMad = (0, _factory.factory)(name, dependencies, function (_ref) {function _mad(array) {if (array = (0, _array.flatten)(array.valueOf()), 0 === array.length) throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try {var med = median(array);return median(map(array, function (value) {return abs(subtract(value, med));}));} catch (err) {if (err instanceof TypeError && -1 !== err.message.indexOf("median")) throw new TypeError(err.message.replace("median", "mad"));else throw (0, _improveErrorMessage.improveErrorMessage)(err, "mad");}}var typed = _ref.typed,abs = _ref.abs,map = _ref.map,median = _ref.median,subtract = _ref.subtract;return typed(name, { "Array | Matrix": _mad, "...": function (args) {return _mad(args);} });});exports.createMad = createMad;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/max.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMax = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_improveErrorMessage = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js"),name = "max",dependencies = ["typed", "config", "numeric", "larger"],createMax = (0, _factory.factory)(name, dependencies, function (_ref) {function _largest(x, y) {try {return larger(x, y) ? x : y;} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "max", y);}}function _max(array) {var res;if ((0, _collection.deepForEach)(array, function (value) {try {isNaN(value) && "number" == typeof value ? res = NaN : (void 0 === res || larger(value, res)) && (res = value);} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "max", value);}}), void 0 === res) throw new Error("Cannot calculate max of an empty array");return "string" == typeof res && (res = numeric(res, config.number)), res;}var typed = _ref.typed,config = _ref.config,numeric = _ref.numeric,larger = _ref.larger;return typed(name, { "Array | Matrix": _max, "Array | Matrix, number | BigNumber": function (array, dim) {return (0, _collection.reduce)(array, dim.valueOf(), _largest);}, "...": function (args) {if ((0, _collection.containsCollections)(args)) throw new TypeError("Scalar values expected in function max");return _max(args);} });});exports.createMax = createMax;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/mean.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMean = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_improveErrorMessage = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js"),name = "mean",dependencies = ["typed", "add", "divide"],createMean = (0, _factory.factory)(name, dependencies, function (_ref) {function _mean(array) {var sum,num = 0;if ((0, _collection.deepForEach)(array, function (value) {try {sum = void 0 === sum ? value : add(sum, value), num++;} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "mean", value);}}), 0 === num) throw new Error("Cannot calculate the mean of an empty array");return divide(sum, num);}var typed = _ref.typed,add = _ref.add,divide = _ref.divide;return typed(name, { "Array | Matrix": _mean, "Array | Matrix, number | BigNumber": function (array, dim) {try {var sum = (0, _collection.reduce)(array, dim, add),s = Array.isArray(array) ? (0, _array.arraySize)(array) : array.size();return divide(sum, s[dim]);} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "mean");}}, "...": function (args) {if ((0, _collection.containsCollections)(args)) throw new TypeError("Scalar values expected in function mean");return _mean(args);} });});exports.createMean = createMean;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/median.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMedian = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_improveErrorMessage = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js"),name = "median",dependencies = ["typed", "add", "divide", "compare", "partitionSelect"],createMedian = (0, _factory.factory)(name, dependencies, function (_ref) {function _median(array) {try {array = (0, _array.flatten)(array.valueOf());var num = array.length;if (0 === num) throw new Error("Cannot calculate median of an empty array");if (0 == num % 2) {for (var mid = num / 2 - 1, right = partitionSelect(array, mid + 1), left = array[mid], i = 0; i < mid; ++i) 0 < compare(array[i], left) && (left = array[i]);return middle2(left, right);}var m = partitionSelect(array, (num - 1) / 2);return middle(m);} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "median");}}var typed = _ref.typed,add = _ref.add,divide = _ref.divide,compare = _ref.compare,partitionSelect = _ref.partitionSelect,middle = typed({ "number | BigNumber | Complex | Unit": function (value) {return value;} }),middle2 = typed({ "number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit": function (left, right) {return divide(add(left, right), 2);} });return typed(name, { "Array | Matrix": _median, "Array | Matrix, number | BigNumber": function () {throw new Error("median(A, dim) is not yet supported");}, "...": function (args) {if ((0, _collection.containsCollections)(args)) throw new TypeError("Scalar values expected in function median");return _median(args);} });});exports.createMedian = createMedian;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/min.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMin = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_improveErrorMessage = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js"),name = "min",dependencies = ["typed", "config", "numeric", "smaller"],createMin = (0, _factory.factory)(name, dependencies, function (_ref) {function _smallest(x, y) {try {return smaller(x, y) ? x : y;} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "min", y);}}function _min(array) {var min;if ((0, _collection.deepForEach)(array, function (value) {try {isNaN(value) && "number" == typeof value ? min = NaN : (void 0 === min || smaller(value, min)) && (min = value);} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "min", value);}}), void 0 === min) throw new Error("Cannot calculate min of an empty array");return "string" == typeof min && (min = numeric(min, config.number)), min;}var typed = _ref.typed,config = _ref.config,numeric = _ref.numeric,smaller = _ref.smaller;return typed(name, { "Array | Matrix": _min, "Array | Matrix, number | BigNumber": function (array, dim) {return (0, _collection.reduce)(array, dim.valueOf(), _smallest);}, "...": function (args) {if ((0, _collection.containsCollections)(args)) throw new TypeError("Scalar values expected in function min");return _min(args);} });});exports.createMin = createMin;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/mode.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMode = void 0;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "mode",dependencies = ["typed", "isNaN", "isNumeric"],createMode = (0, _factory.factory)(name, dependencies, function (_ref) {function _mode(values) {values = (0, _array.flatten)(values.valueOf());var num = values.length;if (0 === num) throw new Error("Cannot calculate mode of an empty array");for (var value, count = {}, mode = [], max = 0, i = 0; i < values.length; i++) {if (value = values[i], isNumeric(value) && isNaN(value)) throw new Error("Cannot calculate mode of an array containing NaN values");value in count || (count[value] = 0), count[value]++, count[value] === max ? mode.push(value) : count[value] > max && (max = count[value], mode = [value]);}return mode;}var typed = _ref.typed,isNaN = _ref.isNaN,isNumeric = _ref.isNumeric;return typed(name, { "Array | Matrix": _mode, "...": function (args) {return _mode(args);} });});exports.createMode = createMode;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/prod.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createProd = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_improveErrorMessage = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js"),name = "prod",dependencies = ["typed", "config", "multiplyScalar", "numeric"],createProd = (0, _factory.factory)(name, dependencies, function (_ref) {function _prod(array) {var prod;if ((0, _collection.deepForEach)(array, function (value) {try {prod = void 0 === prod ? value : multiplyScalar(prod, value);} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "prod", value);}}), "string" == typeof prod && (prod = numeric(prod, config.number)), void 0 === prod) throw new Error("Cannot calculate prod of an empty array");return prod;}var typed = _ref.typed,config = _ref.config,multiplyScalar = _ref.multiplyScalar,numeric = _ref.numeric;return typed(name, { "Array | Matrix": _prod, "Array | Matrix, number | BigNumber": function () {throw new Error("prod(A, dim) is not yet supported");}, "...": function (args) {return _prod(args);} });});exports.createProd = createProd;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/quantileSeq.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createQuantileSeq = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "quantileSeq",dependencies = ["typed", "add", "multiply", "partitionSelect", "compare"],createQuantileSeq = (0, _factory.factory)(name, dependencies, function (_ref) {function _quantileSeq(array, prob, sorted) {var flat = (0, _array.flatten)(array),len = flat.length;if (0 === len) throw new Error("Cannot calculate quantile of an empty sequence");if ((0, _is.isNumber)(prob)) {var _index = prob * (len - 1),_fracPart = _index % 1;if (0 === _fracPart) {var value = sorted ? flat[_index] : partitionSelect(flat, _index);return validate(value), value;}var _left,_right,_integerPart = Math.floor(_index);if (sorted) _left = flat[_integerPart], _right = flat[_integerPart + 1];else {_right = partitionSelect(flat, _integerPart + 1), _left = flat[_integerPart];for (var i = 0; i < _integerPart; ++i) 0 < compare(flat[i], _left) && (_left = flat[i]);}return validate(_left), validate(_right), add(multiply(_left, 1 - _fracPart), multiply(_right, _fracPart));}var index = prob.times(len - 1);if (index.isInteger()) {index = index.toNumber();var _value = sorted ? flat[index] : partitionSelect(flat, index);return validate(_value), _value;}var left,right,integerPart = index.floor(),fracPart = index.minus(integerPart),integerPartNumber = integerPart.toNumber();if (sorted) left = flat[integerPartNumber], right = flat[integerPartNumber + 1];else {right = partitionSelect(flat, integerPartNumber + 1), left = flat[integerPartNumber];for (var _i3 = 0; _i3 < integerPartNumber; ++_i3) 0 < compare(flat[_i3], left) && (left = flat[_i3]);}validate(left), validate(right);var one = new fracPart.constructor(1);return add(multiply(left, one.minus(fracPart)), multiply(right, fracPart));}var typed = _ref.typed,add = _ref.add,multiply = _ref.multiply,partitionSelect = _ref.partitionSelect,compare = _ref.compare,validate = typed({ "number | BigNumber | Unit": function (x) {return x;} });return function (data, probOrN, sorted) {var probArr, dataArr, one;if (2 > arguments.length || 3 < arguments.length) throw new SyntaxError("Function quantileSeq requires two or three parameters");if ((0, _is.isCollection)(data)) {if (sorted = sorted || !1, "boolean" == typeof sorted) {if (dataArr = data.valueOf(), (0, _is.isNumber)(probOrN)) {if (0 > probOrN) throw new Error("N/prob must be non-negative");if (1 >= probOrN) return _quantileSeq(dataArr, probOrN, sorted);if (1 < probOrN) {if (!(0, _number.isInteger)(probOrN)) throw new Error("N must be a positive integer");probArr = Array(probOrN);for (var i = 0; i < probOrN;) probArr[i] = _quantileSeq(dataArr, ++i / (probOrN + 1), sorted);return probArr;}}if ((0, _is.isBigNumber)(probOrN)) {var BigNumber = probOrN.constructor;if (probOrN.isNegative()) throw new Error("N/prob must be non-negative");if (one = new BigNumber(1), probOrN.lte(one)) return new BigNumber(_quantileSeq(dataArr, probOrN, sorted));if (probOrN.gt(one)) {if (!probOrN.isInteger()) throw new Error("N must be a positive integer");var intN = probOrN.toNumber();if (4294967295 < intN) throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var _nPlusOne = new BigNumber(intN + 1);probArr = Array(intN);for (var _i = 0; _i < intN;) probArr[_i] = new BigNumber(_quantileSeq(dataArr, new BigNumber(++_i).div(_nPlusOne), sorted));return probArr;}}if (Array.isArray(probOrN)) {probArr = Array(probOrN.length);for (var currProb, _i2 = 0; _i2 < probArr.length; ++_i2) {if (currProb = probOrN[_i2], (0, _is.isNumber)(currProb)) {if (0 > currProb || 1 < currProb) throw new Error("Probability must be between 0 and 1, inclusive");} else if (!(0, _is.isBigNumber)(currProb)) throw new TypeError("Unexpected type of argument in function quantileSeq");else if (one = new currProb.constructor(1), currProb.isNegative() || currProb.gt(one)) throw new Error("Probability must be between 0 and 1, inclusive");probArr[_i2] = _quantileSeq(dataArr, currProb, sorted);}return probArr;}throw new TypeError("Unexpected type of argument in function quantileSeq");}throw new TypeError("Unexpected type of argument in function quantileSeq");}throw new TypeError("Unexpected type of argument in function quantileSeq");};});exports.createQuantileSeq = createQuantileSeq;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/std.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createStd = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "std",dependencies = ["typed", "sqrt", "variance"],createStd = (0, _factory.factory)(name, dependencies, function (_ref) {function _std(array) {if (0 === array.length) throw new SyntaxError("Function std requires one or more parameters (0 provided)");try {return sqrt(variance.apply(null, arguments));} catch (err) {if (err instanceof TypeError && -1 !== err.message.indexOf(" variance")) throw new TypeError(err.message.replace(" variance", " std"));else throw err;}}var typed = _ref.typed,sqrt = _ref.sqrt,variance = _ref.variance;return typed(name, { "Array | Matrix": _std, "Array | Matrix, string": _std, "Array | Matrix, number | BigNumber": _std, "Array | Matrix, number | BigNumber, string": _std, "...": function (args) {return _std(args);} });});exports.createStd = createStd;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/sum.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSum = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_improveErrorMessage = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js"),name = "sum",dependencies = ["typed", "config", "add", "numeric"],createSum = (0, _factory.factory)(name, dependencies, function (_ref) {function _sum(array) {var sum;return (0, _collection.deepForEach)(array, function (value) {try {sum = void 0 === sum ? value : add(sum, value);} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "sum", value);}}), void 0 === sum && (sum = numeric(0, config.number)), "string" == typeof sum && (sum = numeric(sum, config.number)), sum;}var typed = _ref.typed,config = _ref.config,add = _ref.add,numeric = _ref.numeric;return typed(name, { "Array | Matrix": _sum, "Array | Matrix, number | BigNumber": function (array, dim) {try {var sum = (0, _collection.reduce)(array, dim, add);return sum;} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "sum");}}, "...": function (args) {if ((0, _collection.containsCollections)(args)) throw new TypeError("Scalar values expected in function sum");return _sum(args);} });});exports.createSum = createSum;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.improveErrorMessage = improveErrorMessage;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js");function improveErrorMessage(err, fnName, value) {var details;return -1 === (err + "").indexOf("Unexpected type") ? -1 === (err + "").indexOf("complex numbers") ? err : (details = 2 < arguments.length ? " (type: " + (0, _is.typeOf)(value) + ", value: " + JSON.stringify(value) + ")" : "", new TypeError("Cannot calculate " + fnName + ", no ordering relation is defined for complex numbers" + details)) : (details = 2 < arguments.length ? " (type: " + (0, _is.typeOf)(value) + ", value: " + JSON.stringify(value) + ")" : " (type: " + err.data.actual + ")", new TypeError("Cannot calculate " + fnName + ", unexpected type of argument" + details));}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/statistics/variance.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createVariance = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_improveErrorMessage = __webpack_require__("./node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js"),DEFAULT_NORMALIZATION = "unbiased",name = "variance",dependencies = ["typed", "add", "subtract", "multiply", "divide", "apply", "isNaN"],createVariance = (0, _factory.factory)(name, dependencies, function (_ref) {function _var(array, normalization) {var sum,num = 0;if (0 === array.length) throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if ((0, _collection.deepForEach)(array, function (value) {try {sum = void 0 === sum ? value : add(sum, value), num++;} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "variance", value);}}), 0 === num) throw new Error("Cannot calculate variance of an empty array");var mean = divide(sum, num);if (sum = void 0, (0, _collection.deepForEach)(array, function (value) {var diff = subtract(value, mean);sum = void 0 === sum ? multiply(diff, diff) : add(sum, multiply(diff, diff));}), isNaN(sum)) return sum;switch (normalization) {case "uncorrected":return divide(sum, num);case "biased":return divide(sum, num + 1);case "unbiased":{var zero = (0, _is.isBigNumber)(sum) ? sum.mul(0) : 0;return 1 === num ? zero : divide(sum, num - 1);}default:throw new Error("Unknown normalization \"" + normalization + "\". Choose \"unbiased\" (default), \"uncorrected\", or \"biased\".");}}function _varDim(array, dim, normalization) {try {if (0 === array.length) throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return apply(array, dim, function (x) {return _var(x, normalization);});} catch (err) {throw (0, _improveErrorMessage.improveErrorMessage)(err, "variance");}}var typed = _ref.typed,add = _ref.add,subtract = _ref.subtract,multiply = _ref.multiply,divide = _ref.divide,apply = _ref.apply,isNaN = _ref.isNaN;return typed(name, { "Array | Matrix": function (array) {return _var(array, DEFAULT_NORMALIZATION);}, "Array | Matrix, string": _var, "Array | Matrix, number | BigNumber": function (array, dim) {return _varDim(array, dim, DEFAULT_NORMALIZATION);}, "Array | Matrix, number | BigNumber, string": _varDim, "...": function (args) {return _var(args, DEFAULT_NORMALIZATION);} });});exports.createVariance = createVariance;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/string/bin.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBin = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "bin",dependencies = ["typed", "format"],createBin = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,format = _ref.format;return typed(name, { "number | BigNumber": function (n) {return format(n, { notation: "bin" });}, "number | BigNumber, number": function (n, wordSize) {return format(n, { notation: "bin", wordSize: wordSize });} });});exports.createBin = createBin;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/string/format.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFormat = void 0;var _string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "format",dependencies = ["typed"],createFormat = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { any: _string.format, "any, Object | function | number": _string.format });});exports.createFormat = createFormat;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/string/hex.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createHex = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "hex",dependencies = ["typed", "format"],createHex = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,format = _ref.format;return typed(name, { "number | BigNumber": function (n) {return format(n, { notation: "hex" });}, "number | BigNumber, number": function (n, wordSize) {return format(n, { notation: "hex", wordSize: wordSize });} });});exports.createHex = createHex;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/string/oct.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createOct = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "oct",dependencies = ["typed", "format"],createOct = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,format = _ref.format;return typed(name, { "number | BigNumber": function (n) {return format(n, { notation: "oct" });}, "number | BigNumber, number": function (n, wordSize) {return format(n, { notation: "oct", wordSize: wordSize });} });});exports.createOct = createOct;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/string/print.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createPrint = void 0;var _string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "print",dependencies = ["typed"],createPrint = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "string, Object | Array": _print, "string, Object | Array, number | Object": _print });});exports.createPrint = createPrint;function _print(template, values, options) {return template.replace(/\$([\w.]+)/g, function (original, key) {for (var keys = key.split("."), value = values[keys.shift()]; keys.length && value !== void 0;) {var k = keys.shift();value = k ? value[k] : value + ".";}return void 0 === value ? original : (0, _is.isString)(value) ? value : (0, _string.format)(value, options);});}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/acos.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAcos = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "acos",dependencies = ["typed", "config", "Complex"],createAcos = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,Complex = _ref.Complex;return typed(name, { number: function (x) {return -1 <= x && 1 >= x || config.predictable ? Math.acos(x) : new Complex(x, 0).acos();}, Complex: function (x) {return x.acos();}, BigNumber: function (x) {return x.acos();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createAcos = createAcos;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/acosh.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAcosh = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "acosh",dependencies = ["typed", "config", "Complex"],createAcosh = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,Complex = _ref.Complex;return typed(name, { number: function (x) {return 1 <= x || config.predictable ? (0, _index.acoshNumber)(x) : -1 >= x ? new Complex(Math.log(Math.sqrt(x * x - 1) - x), Math.PI) : new Complex(x, 0).acosh();}, Complex: function (x) {return x.acosh();}, BigNumber: function (x) {return x.acosh();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createAcosh = createAcosh;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/acot.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAcot = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "acot",dependencies = ["typed", "BigNumber"],createAcot = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_BigNumber = _ref.BigNumber;return typed(name, { number: _index.acotNumber, Complex: function (x) {return x.acot();}, BigNumber: function (x) {return new _BigNumber(1).div(x).atan();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createAcot = createAcot;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/acoth.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAcoth = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "acoth",dependencies = ["typed", "config", "Complex", "BigNumber"],createAcoth = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,Complex = _ref.Complex,_BigNumber = _ref.BigNumber;return typed(name, { number: function (x) {return 1 <= x || -1 >= x || config.predictable ? (0, _index.acothNumber)(x) : new Complex(x, 0).acoth();}, Complex: function (x) {return x.acoth();}, BigNumber: function (x) {return new _BigNumber(1).div(x).atanh();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createAcoth = createAcoth;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/acsc.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAcsc = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "acsc",dependencies = ["typed", "config", "Complex", "BigNumber"],createAcsc = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,Complex = _ref.Complex,_BigNumber = _ref.BigNumber;return typed(name, { number: function (x) {return -1 >= x || 1 <= x || config.predictable ? (0, _index.acscNumber)(x) : new Complex(x, 0).acsc();}, Complex: function (x) {return x.acsc();}, BigNumber: function (x) {return new _BigNumber(1).div(x).asin();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createAcsc = createAcsc;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/acsch.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAcsch = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "acsch",dependencies = ["typed", "BigNumber"],createAcsch = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_BigNumber = _ref.BigNumber;return typed(name, { number: _index.acschNumber, Complex: function (x) {return x.acsch();}, BigNumber: function (x) {return new _BigNumber(1).div(x).asinh();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createAcsch = createAcsch;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/asec.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAsec = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "asec",dependencies = ["typed", "config", "Complex", "BigNumber"],createAsec = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,Complex = _ref.Complex,_BigNumber = _ref.BigNumber;return typed(name, { number: function (x) {return -1 >= x || 1 <= x || config.predictable ? (0, _index.asecNumber)(x) : new Complex(x, 0).asec();}, Complex: function (x) {return x.asec();}, BigNumber: function (x) {return new _BigNumber(1).div(x).acos();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createAsec = createAsec;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/asech.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAsech = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "asech",dependencies = ["typed", "config", "Complex", "BigNumber"],createAsech = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,Complex = _ref.Complex,_BigNumber = _ref.BigNumber;return typed(name, { number: function (x) {if (1 >= x && -1 <= x || config.predictable) {var xInv = 1 / x;if (0 < xInv || config.predictable) return (0, _index.asechNumber)(x);var ret = Math.sqrt(xInv * xInv - 1);return new Complex(Math.log(ret - xInv), Math.PI);}return new Complex(x, 0).asech();}, Complex: function (x) {return x.asech();}, BigNumber: function (x) {return new _BigNumber(1).div(x).acosh();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createAsech = createAsech;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/asin.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAsin = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "asin",dependencies = ["typed", "config", "Complex"],createAsin = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,Complex = _ref.Complex;return typed(name, { number: function (x) {return -1 <= x && 1 >= x || config.predictable ? Math.asin(x) : new Complex(x, 0).asin();}, Complex: function (x) {return x.asin();}, BigNumber: function (x) {return x.asin();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createAsin = createAsin;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/asinh.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAsinh = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "asinh",dependencies = ["typed"],createAsinh = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed("asinh", { number: _index.asinhNumber, Complex: function (x) {return x.asinh();}, BigNumber: function (x) {return x.asinh();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createAsinh = createAsinh;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/atan.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAtan = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "atan",dependencies = ["typed"],createAtan = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed("atan", { number: function (x) {return Math.atan(x);}, Complex: function (x) {return x.atan();}, BigNumber: function (x) {return x.atan();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createAtan = createAtan;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/atan2.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAtan2 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js"),_algorithm3 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm09.js"),_algorithm4 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js"),_algorithm5 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"),_algorithm6 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm7 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "atan2",dependencies = ["typed", "matrix", "equalScalar", "BigNumber", "DenseMatrix"],createAtan2 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,equalScalar = _ref.equalScalar,BigNumber = _ref.BigNumber,DenseMatrix = _ref.DenseMatrix,algorithm02 = (0, _algorithm.createAlgorithm02)({ typed: typed, equalScalar: equalScalar }),algorithm03 = (0, _algorithm2.createAlgorithm03)({ typed: typed }),algorithm09 = (0, _algorithm3.createAlgorithm09)({ typed: typed, equalScalar: equalScalar }),algorithm11 = (0, _algorithm4.createAlgorithm11)({ typed: typed, equalScalar: equalScalar }),algorithm12 = (0, _algorithm5.createAlgorithm12)({ typed: typed, DenseMatrix: DenseMatrix }),algorithm13 = (0, _algorithm6.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm7.createAlgorithm14)({ typed: typed });return typed(name, { "number, number": Math.atan2, "BigNumber, BigNumber": function (y, x) {return BigNumber.atan2(y, x);}, "SparseMatrix, SparseMatrix": function (x, y) {return algorithm09(x, y, this, !1);}, "SparseMatrix, DenseMatrix": function (x, y) {return algorithm02(y, x, this, !0);}, "DenseMatrix, SparseMatrix": function (x, y) {return algorithm03(x, y, this, !1);}, "DenseMatrix, DenseMatrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "SparseMatrix, number | BigNumber": function (x, y) {return algorithm11(x, y, this, !1);}, "DenseMatrix, number | BigNumber": function (x, y) {return algorithm14(x, y, this, !1);}, "number | BigNumber, SparseMatrix": function (x, y) {return algorithm12(y, x, this, !0);}, "number | BigNumber, DenseMatrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, number | BigNumber": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "number | BigNumber, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createAtan2 = createAtan2;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/atanh.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAtanh = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "atanh",dependencies = ["typed", "config", "Complex"],createAtanh = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,config = _ref.config,Complex = _ref.Complex;return typed(name, { number: function (x) {return 1 >= x && -1 <= x || config.predictable ? (0, _index.atanhNumber)(x) : new Complex(x, 0).atanh();}, Complex: function (x) {return x.atanh();}, BigNumber: function (x) {return x.atanh();}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createAtanh = createAtanh;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/cos.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCos = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "cos",dependencies = ["typed"],createCos = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: Math.cos, Complex: function (x) {return x.cos();}, BigNumber: function (x) {return x.cos();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function cos is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createCos = createCos;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/cosh.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCosh = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),name = "cosh",dependencies = ["typed"],createCosh = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _number.cosh, Complex: function (x) {return x.cosh();}, BigNumber: function (x) {return x.cosh();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function cosh is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createCosh = createCosh;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/cot.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCot = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "cot",dependencies = ["typed", "BigNumber"],createCot = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_BigNumber = _ref.BigNumber;return typed(name, { number: _index.cotNumber, Complex: function (x) {return x.cot();}, BigNumber: function (x) {return new _BigNumber(1).div(x.tan());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function cot is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createCot = createCot;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/coth.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCoth = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "coth",dependencies = ["typed", "BigNumber"],createCoth = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_BigNumber = _ref.BigNumber;return typed(name, { number: _index.cothNumber, Complex: function (x) {return x.coth();}, BigNumber: function (x) {return new _BigNumber(1).div(x.tanh());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function coth is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createCoth = createCoth;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/csc.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCsc = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "csc",dependencies = ["typed", "BigNumber"],createCsc = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_BigNumber = _ref.BigNumber;return typed(name, { number: _index.cscNumber, Complex: function (x) {return x.csc();}, BigNumber: function (x) {return new _BigNumber(1).div(x.sin());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function csc is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createCsc = createCsc;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/csch.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCsch = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "csch",dependencies = ["typed", "BigNumber"],createCsch = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_BigNumber = _ref.BigNumber;return typed(name, { number: _index.cschNumber, Complex: function (x) {return x.csch();}, BigNumber: function (x) {return new _BigNumber(1).div(x.sinh());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function csch is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createCsch = createCsch;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/sec.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSec = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "sec",dependencies = ["typed", "BigNumber"],createSec = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_BigNumber = _ref.BigNumber;return typed(name, { number: _index.secNumber, Complex: function (x) {return x.sec();}, BigNumber: function (x) {return new _BigNumber(1).div(x.cos());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function sec is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createSec = createSec;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/sech.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSech = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "sech",dependencies = ["typed", "BigNumber"],createSech = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,_BigNumber = _ref.BigNumber;return typed(name, { number: _index.sechNumber, Complex: function (x) {return x.sech();}, BigNumber: function (x) {return new _BigNumber(1).div(x.cosh());}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function sech is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createSech = createSech;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/sin.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSin = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "sin",dependencies = ["typed"],createSin = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: Math.sin, Complex: function (x) {return x.sin();}, BigNumber: function (x) {return x.sin();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function sin is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createSin = createSin;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/sinh.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSinh = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "sinh",dependencies = ["typed"],createSinh = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.sinhNumber, Complex: function (x) {return x.sinh();}, BigNumber: function (x) {return x.sinh();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function sinh is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createSinh = createSinh;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/tan.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createTan = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "tan",dependencies = ["typed"],createTan = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: Math.tan, Complex: function (x) {return x.tan();}, BigNumber: function (x) {return x.tan();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function tan is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createTan = createTan;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/trigonometry/tanh.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createTanh = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),name = "tanh",dependencies = ["typed"],createTanh = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed("tanh", { number: _number.tanh, Complex: function (x) {return x.tanh();}, BigNumber: function (x) {return x.tanh();}, Unit: function (x) {if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) throw new TypeError("Unit in function tanh is no angle");return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this, !0);} });});exports.createTanh = createTanh;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/unit/to.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createTo = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_algorithm = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js"),_algorithm2 = __webpack_require__("./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js"),name = "to",dependencies = ["typed", "matrix"],createTo = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,matrix = _ref.matrix,algorithm13 = (0, _algorithm.createAlgorithm13)({ typed: typed }),algorithm14 = (0, _algorithm2.createAlgorithm14)({ typed: typed });return typed(name, { "Unit, Unit | string": function (x, unit) {return x.to(unit);}, "Matrix, Matrix": function (x, y) {return algorithm13(x, y, this);}, "Array, Array": function (x, y) {return this(matrix(x), matrix(y)).valueOf();}, "Array, Matrix": function (x, y) {return this(matrix(x), y);}, "Matrix, Array": function (x, y) {return this(x, matrix(y));}, "Matrix, any": function (x, y) {return algorithm14(x, y, this, !1);}, "any, Matrix": function (x, y) {return algorithm14(y, x, this, !0);}, "Array, any": function (x, y) {return algorithm14(matrix(x), y, this, !1).valueOf();}, "any, Array": function (x, y) {return algorithm14(matrix(y), x, this, !0).valueOf();} });});exports.createTo = createTo;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/clone.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createClone = void 0;var _object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "clone",dependencies = ["typed"],createClone = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { any: _object.clone });});exports.createClone = createClone;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/hasNumericValue.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createHasNumericValue = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "hasNumericValue",dependencies = ["typed", "isNumeric"],createHasNumericValue = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,isNumeric = _ref.isNumeric;return typed(name, { string: function (x) {return 0 < x.trim().length && !isNaN(+x);}, any: function (x) {return isNumeric(x);} });});exports.createHasNumericValue = createHasNumericValue;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/isInteger.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIsInteger = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "isInteger",dependencies = ["typed"],createIsInteger = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _number.isInteger, BigNumber: function (x) {return x.isInt();}, Fraction: function (x) {return 1 === x.d && isFinite(x.n);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createIsInteger = createIsInteger;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/isNaN.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIsNaN = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "isNaN",dependencies = ["typed"],createIsNaN = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.isNaNNumber, BigNumber: function (x) {return x.isNaN();}, Fraction: function () {return !1;}, Complex: function (x) {return x.isNaN();}, Unit: function (x) {return Number.isNaN(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, Number.isNaN);} });});exports.createIsNaN = createIsNaN;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/isNegative.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIsNegative = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "isNegative",dependencies = ["typed"],createIsNegative = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.isNegativeNumber, BigNumber: function (x) {return x.isNeg() && !x.isZero() && !x.isNaN();}, Fraction: function (x) {return 0 > x.s;}, Unit: function (x) {return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createIsNegative = createIsNegative;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/isNumeric.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIsNumeric = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "isNumeric",dependencies = ["typed"],createIsNumeric = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "number | BigNumber | Fraction | boolean": function () {return !0;}, "Complex | Unit | string | null | undefined | Node": function () {return !1;}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createIsNumeric = createIsNumeric;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/isPositive.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIsPositive = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "isPositive",dependencies = ["typed"],createIsPositive = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.isPositiveNumber, BigNumber: function (x) {return !x.isNeg() && !x.isZero() && !x.isNaN();}, Fraction: function (x) {return 0 < x.s && 0 < x.n;}, Unit: function (x) {return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createIsPositive = createIsPositive;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/isPrime.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIsPrime = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "isPrime",dependencies = ["typed"],createIsPrime = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: function (x) {if (0 != 0 * x) return !1;if (3 >= x) return 1 < x;if (0 == x % 2 || 0 == x % 3) return !1;for (var i = 5; i * i <= x; i += 6) if (0 == x % i || 0 == x % (i + 2)) return !1;return !0;}, BigNumber: function (n) {function modPow(base, exponent, modulus) {for (var accumulator = 1; !exponent.eq(0);) exponent.mod(2).eq(0) ? (exponent = exponent.div(2), base = base.mul(base).mod(modulus)) : (exponent = exponent.sub(1), accumulator = base.mul(accumulator).mod(modulus));return accumulator;}if (0 != 0 * n.toNumber()) return !1;if (n.lte(3)) return n.gt(1);if (n.mod(2).eq(0) || n.mod(3).eq(0)) return !1;if (n.lt(Math.pow(2, 32))) {for (var x = n.toNumber(), i = 5; i * i <= x; i += 6) if (0 == x % i || 0 == x % (i + 2)) return !1;return !0;}var Decimal = n.constructor.clone({ precision: 2 * n.toFixed(0).length });n = new Decimal(n);for (var r = 0, d = n.sub(1); d.mod(2).eq(0);) d = d.div(2), r += 1;var bases = null;if (n.lt("3317044064679887385961981")) bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41].filter(function (x) {return x < n;});else {var max = Math.min(n.toNumber() - 2, Math.floor(2 * Math.pow(n.toFixed(0).length * Math.log(10), 2)));bases = [];for (var _i = 2; _i <= max; _i += 1) bases.push(max);}for (var _i2 = 0; _i2 < bases.length; _i2 += 1) {var a = bases[_i2],adn = modPow(n.sub(n).add(a), d, n);if (!adn.eq(1)) for (var _i3 = 0, _x = adn; !_x.eq(n.sub(1)); _i3 += 1, _x = _x.mul(_x).mod(n)) if (_i3 == r - 1) return !1;}return !0;}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createIsPrime = createIsPrime;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/isZero.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIsZero = void 0;var _collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_index = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/index.js"),name = "isZero",dependencies = ["typed"],createIsZero = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { number: _index.isZeroNumber, BigNumber: function (x) {return x.isZero();}, Complex: function (x) {return 0 === x.re && 0 === x.im;}, Fraction: function (x) {return 1 === x.d && 0 === x.n;}, Unit: function (x) {return this(x.value);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createIsZero = createIsZero;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/numeric.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createNumeric = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_noop = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/noop.js"),name = "numeric",dependencies = ["number", "?bignumber", "?fraction"],createNumeric = (0, _factory.factory)(name, dependencies, function (_ref) {var _number = _ref.number,bignumber = _ref.bignumber,fraction = _ref.fraction,validInputTypes = { string: !0, number: !0, BigNumber: !0, Fraction: !0 },validOutputTypes = { number: function (x) {return _number(x);}, BigNumber: bignumber ? function (x) {return bignumber(x);} : _noop.noBignumber, Fraction: fraction ? function (x) {return fraction(x);} : _noop.noFraction };return function (value, outputType) {var inputType = (0, _is.typeOf)(value);if (!(inputType in validInputTypes)) throw new TypeError("Cannot convert " + value + " of type \"" + inputType + "\"; valid input types are " + Object.keys(validInputTypes).join(", "));if (!(outputType in validOutputTypes)) throw new TypeError("Cannot convert " + value + " to type \"" + outputType + "\"; valid output types are " + Object.keys(validOutputTypes).join(", "));return outputType === inputType ? value : validOutputTypes[outputType](value);};});exports.createNumeric = createNumeric;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/function/utils/typeOf.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createTypeOf = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "typeOf",dependencies = ["typed"],createTypeOf = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { any: _is.typeOf });});exports.createTypeOf = createTypeOf;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/index.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 }));var _mainAny = __webpack_require__("./node_modules/mathjs/lib/cjs/entry/mainAny.js");Object.keys(_mainAny).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _mainAny[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _mainAny[key];} });});

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/json/replacer.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createReplacer = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "replacer",dependencies = [],createReplacer = (0, _factory.factory)(name, dependencies, function () {return function (key, value) {return "number" == typeof value && (!isFinite(value) || isNaN(value)) ? { mathjs: "number", value: value + "" } : value;};});exports.createReplacer = createReplacer;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/json/reviver.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createReviver = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "reviver",dependencies = ["classes"],createReviver = (0, _factory.factory)(name, dependencies, function (_ref) {var classes = _ref.classes;return function (key, value) {var constructor = classes[value && value.mathjs];return constructor && "function" == typeof constructor.fromJSON ? constructor.fromJSON(value) : value;};});exports.createReviver = createReviver;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/arithmetic.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.absNumber = absNumber, exports.addNumber = addNumber, exports.subtractNumber = subtractNumber, exports.multiplyNumber = multiplyNumber, exports.divideNumber = divideNumber, exports.unaryMinusNumber = unaryMinusNumber, exports.unaryPlusNumber = unaryPlusNumber, exports.cbrtNumber = cbrtNumber, exports.ceilNumber = ceilNumber, exports.cubeNumber = cubeNumber, exports.expNumber = expNumber, exports.expm1Number = expm1Number, exports.fixNumber = fixNumber, exports.floorNumber = floorNumber, exports.gcdNumber = gcdNumber, exports.lcmNumber = lcmNumber, exports.logNumber = logNumber, exports.log10Number = log10Number, exports.log2Number = log2Number, exports.log1pNumber = log1pNumber, exports.modNumber = modNumber, exports.nthRootNumber = nthRootNumber, exports.signNumber = signNumber, exports.sqrtNumber = sqrtNumber, exports.squareNumber = squareNumber, exports.xgcdNumber = xgcdNumber, exports.powNumber = powNumber, exports.roundNumber = roundNumber, exports.normNumber = normNumber;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),n1 = "number",n2 = "number, number";function absNumber(a) {return Math.abs(a);}absNumber.signature = n1;function addNumber(a, b) {return a + b;}addNumber.signature = n2;function subtractNumber(a, b) {return a - b;}subtractNumber.signature = n2;function multiplyNumber(a, b) {return a * b;}multiplyNumber.signature = n2;function divideNumber(a, b) {return a / b;}divideNumber.signature = n2;function unaryMinusNumber(x) {return -x;}unaryMinusNumber.signature = n1;function unaryPlusNumber(x) {return x;}unaryPlusNumber.signature = n1;function cbrtNumber(x) {return (0, _number.cbrt)(x);}cbrtNumber.signature = n1;function ceilNumber(x) {return Math.ceil(x);}ceilNumber.signature = n1;function cubeNumber(x) {return x * x * x;}cubeNumber.signature = n1;function expNumber(x) {return Math.exp(x);}expNumber.signature = n1;function expm1Number(x) {return (0, _number.expm1)(x);}expm1Number.signature = n1;function fixNumber(x) {return 0 < x ? Math.floor(x) : Math.ceil(x);}fixNumber.signature = n1;function floorNumber(x) {return Math.floor(x);}floorNumber.signature = n1;function gcdNumber(a, b) {if (!(0, _number.isInteger)(a) || !(0, _number.isInteger)(b)) throw new Error("Parameters in function gcd must be integer numbers");for (var r; 0 !== b;) r = a % b, a = b, b = r;return 0 > a ? -a : a;}gcdNumber.signature = n2;function lcmNumber(a, b) {if (!(0, _number.isInteger)(a) || !(0, _number.isInteger)(b)) throw new Error("Parameters in function lcm must be integer numbers");if (0 === a || 0 === b) return 0;for (var t, prod = a * b; 0 !== b;) t = b, b = a % t, a = t;return Math.abs(prod / a);}lcmNumber.signature = n2;function logNumber(x) {return Math.log(x);}logNumber.signature = n1;function log10Number(x) {return (0, _number.log10)(x);}log10Number.signature = n1;function log2Number(x) {return (0, _number.log2)(x);}log2Number.signature = n1;function log1pNumber(x) {return (0, _number.log1p)(x);}log1pNumber.signature = n1;function modNumber(x, y) {if (0 < y) return x - y * Math.floor(x / y);if (0 === y) return x;throw new Error("Cannot calculate mod for a negative divisor");}modNumber.signature = n2;function nthRootNumber(a, root) {var inv = 0 > root;if (inv && (root = -root), 0 === root) throw new Error("Root must be non-zero");if (0 > a && 1 != Math.abs(root) % 2) throw new Error("Root must be odd when a is negative.");if (0 === a) return inv ? 1 / 0 : 0;if (!isFinite(a)) return inv ? 0 : a;var x = Math.pow(Math.abs(a), 1 / root);return x = 0 > a ? -x : x, inv ? 1 / x : x;}nthRootNumber.signature = n2;function signNumber(x) {return (0, _number.sign)(x);}signNumber.signature = n1;function sqrtNumber(x) {return Math.sqrt(x);}sqrtNumber.signature = n1;function squareNumber(x) {return x * x;}squareNumber.signature = n1;function xgcdNumber(a, b) {var t,q,r,x = 0,lastx = 1,y = 1,lasty = 0;if (!(0, _number.isInteger)(a) || !(0, _number.isInteger)(b)) throw new Error("Parameters in function xgcd must be integer numbers");for (; b;) q = Math.floor(a / b), r = a - q * b, t = x, x = lastx - q * x, lastx = t, t = y, y = lasty - q * y, lasty = t, a = b, b = r;var res;return res = 0 > a ? [-a, -lastx, -lasty] : [a, a ? lastx : 0, lasty], res;}xgcdNumber.signature = n2;function powNumber(x, y) {return 1 > x * x && y === 1 / 0 || 1 < x * x && y === -Infinity ? 0 : Math.pow(x, y);}powNumber.signature = n2;function roundNumber(value) {var decimals = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 0;return parseFloat((0, _number.toFixed)(value, decimals));}roundNumber.signature = n2;function normNumber(x) {return Math.abs(x);}normNumber.signature = n1;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/bitwise.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitAndNumber = bitAndNumber, exports.bitNotNumber = bitNotNumber, exports.bitOrNumber = bitOrNumber, exports.bitXorNumber = bitXorNumber, exports.leftShiftNumber = leftShiftNumber, exports.rightArithShiftNumber = rightArithShiftNumber, exports.rightLogShiftNumber = rightLogShiftNumber;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),n1 = "number",n2 = "number, number";function bitAndNumber(x, y) {if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) throw new Error("Integers expected in function bitAnd");return x & y;}bitAndNumber.signature = n2;function bitNotNumber(x) {if (!(0, _number.isInteger)(x)) throw new Error("Integer expected in function bitNot");return ~x;}bitNotNumber.signature = n1;function bitOrNumber(x, y) {if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) throw new Error("Integers expected in function bitOr");return x | y;}bitOrNumber.signature = n2;function bitXorNumber(x, y) {if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) throw new Error("Integers expected in function bitXor");return x ^ y;}bitXorNumber.signature = n2;function leftShiftNumber(x, y) {if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) throw new Error("Integers expected in function leftShift");return x << y;}leftShiftNumber.signature = n2;function rightArithShiftNumber(x, y) {if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) throw new Error("Integers expected in function rightArithShift");return x >> y;}rightArithShiftNumber.signature = n2;function rightLogShiftNumber(x, y) {if (!(0, _number.isInteger)(x) || !(0, _number.isInteger)(y)) throw new Error("Integers expected in function rightLogShift");return x >>> y;}rightLogShiftNumber.signature = n2;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/combinations.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.combinationsNumber = combinationsNumber;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_product = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/product.js");function combinationsNumber(n, k) {if (!(0, _number.isInteger)(n) || 0 > n) throw new TypeError("Positive integer value expected in function combinations");if (!(0, _number.isInteger)(k) || 0 > k) throw new TypeError("Positive integer value expected in function combinations");if (k > n) throw new TypeError("k must be less than or equal to n");var prodrange,nMinusk = n - k;return k < nMinusk ? (prodrange = (0, _product.product)(nMinusk + 1, n), prodrange / (0, _product.product)(1, k)) : (prodrange = (0, _product.product)(k + 1, n), prodrange / (0, _product.product)(1, nMinusk));}combinationsNumber.signature = "number, number";

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/constants.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.phi = exports.e = exports.tau = exports.pi = void 0;var pi = Math.PI;exports.pi = pi;var tau = 2 * Math.PI;exports.tau = tau;var e = Math.E;exports.e = e;var phi = 1.618033988749895;exports.phi = phi;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/index.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 }));var _arithmetic = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/arithmetic.js");Object.keys(_arithmetic).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _arithmetic[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _arithmetic[key];} });});var _bitwise = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/bitwise.js");Object.keys(_bitwise).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _bitwise[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _bitwise[key];} });});var _combinations = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/combinations.js");Object.keys(_combinations).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _combinations[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _combinations[key];} });});var _constants = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/constants.js");Object.keys(_constants).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _constants[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _constants[key];} });});var _logical = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/logical.js");Object.keys(_logical).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _logical[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _logical[key];} });});var _relational = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/relational.js");Object.keys(_relational).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _relational[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _relational[key];} });});var _probability = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/probability.js");Object.keys(_probability).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _probability[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _probability[key];} });});var _trigonometry = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/trigonometry.js");Object.keys(_trigonometry).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _trigonometry[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _trigonometry[key];} });});var _utils = __webpack_require__("./node_modules/mathjs/lib/cjs/plain/number/utils.js");Object.keys(_utils).forEach(function (key) {"default" === key || "__esModule" === key || key in exports && exports[key] === _utils[key] || Object.defineProperty(exports, key, { enumerable: !0, get: function () {return _utils[key];} });});

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/logical.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.notNumber = notNumber, exports.orNumber = orNumber, exports.xorNumber = xorNumber, exports.andNumber = andNumber;var n1 = "number",n2 = "number, number";function notNumber(x) {return !x;}notNumber.signature = "number";function orNumber(x, y) {return !!(x || y);}orNumber.signature = n2;function xorNumber(x, y) {return !!x != !!y;}xorNumber.signature = n2;function andNumber(x, y) {return !!(x && y);}andNumber.signature = n2;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/probability.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.gammaNumber = gammaNumber, exports.gammaP = exports.gammaG = void 0;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_product = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/product.js");function gammaNumber(n) {var x;if ((0, _number.isInteger)(n)) return 0 >= n ? isFinite(n) ? 1 / 0 : NaN : 171 < n ? 1 / 0 : (0, _product.product)(1, n - 1);if (.5 > n) return Math.PI / (Math.sin(Math.PI * n) * gammaNumber(1 - n));if (171.35 <= n) return 1 / 0;if (85 < n) {var twoN = n * n,threeN = twoN * n,fourN = threeN * n,fiveN = fourN * n;return Math.sqrt(2 * Math.PI / n) * Math.pow(n / Math.E, n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n));}--n, x = gammaP[0];for (var i = 1; i < gammaP.length; ++i) x += gammaP[i] / (n + i);var t = n + gammaG + .5;return Math.sqrt(2 * Math.PI) * Math.pow(t, n + .5) * Math.exp(-t) * x;}gammaNumber.signature = "number";var gammaG = 4.7421875;exports.gammaG = gammaG;var gammaP = [.9999999999999971, 57.15623566586292, -59.59796035547549, 14.136097974741746, -.4919138160976202, 3399464998481189e-20, 4652362892704858e-20, -9837447530487956e-20, .0001580887032249125, -.00021026444172410488, .00021743961811521265, -.0001643181065367639, 8441822398385275e-20, -26190838401581408e-21, 36899182659531625e-22];exports.gammaP = gammaP;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/relational.js":
/***/ (() => {

"use strict";


/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/trigonometry.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.acosNumber = acosNumber, exports.acoshNumber = acoshNumber, exports.acotNumber = acotNumber, exports.acothNumber = acothNumber, exports.acscNumber = acscNumber, exports.acschNumber = acschNumber, exports.asecNumber = asecNumber, exports.asechNumber = asechNumber, exports.asinNumber = asinNumber, exports.asinhNumber = asinhNumber, exports.atanNumber = atanNumber, exports.atan2Number = atan2Number, exports.atanhNumber = atanhNumber, exports.cosNumber = cosNumber, exports.coshNumber = coshNumber, exports.cotNumber = cotNumber, exports.cothNumber = cothNumber, exports.cscNumber = cscNumber, exports.cschNumber = cschNumber, exports.secNumber = secNumber, exports.sechNumber = sechNumber, exports.sinNumber = sinNumber, exports.sinhNumber = sinhNumber, exports.tanNumber = tanNumber, exports.tanhNumber = tanhNumber;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),n1 = "number",n2 = "number, number";function acosNumber(x) {return Math.acos(x);}acosNumber.signature = n1;function acoshNumber(x) {return (0, _number.acosh)(x);}acoshNumber.signature = n1;function acotNumber(x) {return Math.atan(1 / x);}acotNumber.signature = n1;function acothNumber(x) {return isFinite(x) ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2 : 0;}acothNumber.signature = n1;function acscNumber(x) {return Math.asin(1 / x);}acscNumber.signature = n1;function acschNumber(x) {var xInv = 1 / x;return Math.log(xInv + Math.sqrt(xInv * xInv + 1));}acschNumber.signature = n1;function asecNumber(x) {return Math.acos(1 / x);}asecNumber.signature = n1;function asechNumber(x) {var xInv = 1 / x,ret = Math.sqrt(xInv * xInv - 1);return Math.log(ret + xInv);}asechNumber.signature = n1;function asinNumber(x) {return Math.asin(x);}asinNumber.signature = n1;function asinhNumber(x) {return (0, _number.asinh)(x);}asinhNumber.signature = n1;function atanNumber(x) {return Math.atan(x);}atanNumber.signature = n1;function atan2Number(y, x) {return Math.atan2(y, x);}atan2Number.signature = n2;function atanhNumber(x) {return (0, _number.atanh)(x);}atanhNumber.signature = n1;function cosNumber(x) {return Math.cos(x);}cosNumber.signature = n1;function coshNumber(x) {return (0, _number.cosh)(x);}coshNumber.signature = n1;function cotNumber(x) {return 1 / Math.tan(x);}cotNumber.signature = n1;function cothNumber(x) {var e = Math.exp(2 * x);return (e + 1) / (e - 1);}cothNumber.signature = n1;function cscNumber(x) {return 1 / Math.sin(x);}cscNumber.signature = n1;function cschNumber(x) {return 0 === x ? Number.POSITIVE_INFINITY : Math.abs(2 / (Math.exp(x) - Math.exp(-x))) * (0, _number.sign)(x);}cschNumber.signature = n1;function secNumber(x) {return 1 / Math.cos(x);}secNumber.signature = n1;function sechNumber(x) {return 2 / (Math.exp(x) + Math.exp(-x));}sechNumber.signature = n1;function sinNumber(x) {return Math.sin(x);}sinNumber.signature = n1;function sinhNumber(x) {return (0, _number.sinh)(x);}sinhNumber.signature = n1;function tanNumber(x) {return Math.tan(x);}tanNumber.signature = n1;function tanhNumber(x) {return (0, _number.tanh)(x);}tanhNumber.signature = n1;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/plain/number/utils.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isIntegerNumber = isIntegerNumber, exports.isNegativeNumber = isNegativeNumber, exports.isPositiveNumber = isPositiveNumber, exports.isZeroNumber = isZeroNumber, exports.isNaNNumber = isNaNNumber;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),n1 = "number";function isIntegerNumber(x) {return (0, _number.isInteger)(x);}isIntegerNumber.signature = n1;function isNegativeNumber(x) {return 0 > x;}isNegativeNumber.signature = n1;function isPositiveNumber(x) {return 0 < x;}isPositiveNumber.signature = n1;function isZeroNumber(x) {return 0 === x;}isZeroNumber.signature = n1;function isNaNNumber(x) {return Number.isNaN(x);}isNaNNumber.signature = n1;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/bignumber/BigNumber.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBigNumberClass = void 0;var _decimal = _interopRequireDefault(__webpack_require__("./node_modules/decimal.js/decimal.mjs")),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "BigNumber",dependencies = ["?on", "config"],createBigNumberClass = (0, _factory.factory)(name, dependencies, function (_ref) {var on = _ref.on,config = _ref.config,BigNumber = _decimal["default"].clone({ precision: config.precision, modulo: 9 });return BigNumber.prototype.type = "BigNumber", BigNumber.prototype.isBigNumber = !0, BigNumber.prototype.toJSON = function () {return { mathjs: "BigNumber", value: this.toString() };}, BigNumber.fromJSON = function (json) {return new BigNumber(json.value);}, on && on("config", function (curr, prev) {curr.precision !== prev.precision && BigNumber.config({ precision: curr.precision });}), BigNumber;}, { isClass: !0 });exports.createBigNumberClass = createBigNumberClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/bignumber/function/bignumber.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBignumber = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "bignumber",dependencies = ["typed", "BigNumber"],createBignumber = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,BigNumber = _ref.BigNumber;return typed("bignumber", { "": function () {return new BigNumber(0);}, number: function (x) {return new BigNumber(x + "");}, string: function (x) {var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if (wordSizeSuffixMatch) {var size = wordSizeSuffixMatch[2],n = BigNumber(wordSizeSuffixMatch[1]),twoPowSize = new BigNumber(2).pow(+size);if (n.gt(twoPowSize.sub(1))) throw new SyntaxError("String \"".concat(x, "\" is out of range"));var twoPowSizeSubOne = new BigNumber(2).pow(+size - 1);return n.gte(twoPowSizeSubOne) ? n.sub(twoPowSize) : n;}return new BigNumber(x);}, BigNumber: function (x) {return x;}, Fraction: function (x) {return new BigNumber(x.n).div(x.d).times(x.s);}, null: function () {return new BigNumber(0);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createBignumber = createBignumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/boolean.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBoolean = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "boolean",dependencies = ["typed"],createBoolean = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "": function () {return !1;}, boolean: function (x) {return x;}, number: function (x) {return !!x;}, null: function () {return !1;}, BigNumber: function (x) {return !x.isZero();}, string: function (x) {var lcase = x.toLowerCase();if ("true" === lcase) return !0;if ("false" === lcase) return !1;var num = +x;if ("" !== x && !isNaN(num)) return !!num;throw new Error("Cannot convert \"" + x + "\" to a boolean");}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createBoolean = createBoolean;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/chain/Chain.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createChainClass = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "Chain",dependencies = ["?on", "math"],createChainClass = (0, _factory.factory)(name, dependencies, function (_ref) {function Chain(value) {if (!(this instanceof Chain)) throw new SyntaxError("Constructor must be called with the new operator");this.value = (0, _is.isChain)(value) ? value.value : value;}function createProxy(name, fn) {"function" == typeof fn && (Chain.prototype[name] = chainify(fn));}function createLazyProxy(name, resolver) {(0, _object.lazy)(Chain.prototype, name, function () {var fn = resolver();return "function" == typeof fn ? chainify(fn) : void 0;});}function chainify(fn) {return function () {for (var args = [this.value], i = 0; i < arguments.length; i++) args[i + 1] = arguments[i];return new Chain(fn.apply(fn, args));};}var on = _ref.on,math = _ref.math;Chain.prototype.type = "Chain", Chain.prototype.isChain = !0, Chain.prototype.done = function () {return this.value;}, Chain.prototype.valueOf = function () {return this.value;}, Chain.prototype.toString = function () {return (0, _string.format)(this.value);}, Chain.prototype.toJSON = function () {return { mathjs: "Chain", value: this.value };}, Chain.fromJSON = function (json) {return new Chain(json.value);}, Chain.createProxy = function (arg0, arg1) {if ("string" == typeof arg0) createProxy(arg0, arg1);else {var _loop = function (_name) {(0, _object.hasOwnProperty)(arg0, _name) && void 0 === excludedNames[_name] && createLazyProxy(_name, function () {return arg0[_name];});};for (var _name in arg0) _loop(_name);}};var excludedNames = { expression: !0, docs: !0, type: !0, classes: !0, json: !0, error: !0, isChain: !0 };return Chain.createProxy(math), on && on("import", function (name, resolver, path) {path || createLazyProxy(name, resolver);}), Chain;}, { isClass: !0 });exports.createChainClass = createChainClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/chain/function/chain.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createChain = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "chain",dependencies = ["typed", "Chain"],createChain = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,Chain = _ref.Chain;return typed(name, { "": function () {return new Chain();}, any: function (value) {return new Chain(value);} });});exports.createChain = createChain;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/complex/Complex.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createComplexClass = void 0;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_complex = _interopRequireDefault(__webpack_require__("./node_modules/complex.js/complex.js")),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "Complex",dependencies = [],createComplexClass = (0, _factory.factory)(name, dependencies, function () {return _complex["default"].prototype.type = "Complex", _complex["default"].prototype.isComplex = !0, _complex["default"].prototype.toJSON = function () {return { mathjs: "Complex", re: this.re, im: this.im };}, _complex["default"].prototype.toPolar = function () {return { r: this.abs(), phi: this.arg() };}, _complex["default"].prototype.format = function (options) {var str = "",im = this.im,re = this.re,strRe = (0, _number.format)(this.re, options),strIm = (0, _number.format)(this.im, options),precision = (0, _is.isNumber)(options) ? options : options ? options.precision : null;if (null !== precision) {var epsilon = Math.pow(10, -precision);Math.abs(re / im) < epsilon && (re = 0), Math.abs(im / re) < epsilon && (im = 0);}return str = 0 === im ? strRe : 0 === re ? 1 === im ? "i" : -1 === im ? "-i" : strIm + "i" : 0 > im ? -1 === im ? strRe + " - i" : strRe + " - " + strIm.substring(1) + "i" : 1 === im ? strRe + " + i" : strRe + " + " + strIm + "i", str;}, _complex["default"].fromPolar = function () {switch (arguments.length) {case 1:{var arg = arguments[0];if ("object" === (0, _typeof2["default"])(arg)) return (0, _complex["default"])(arg);throw new TypeError("Input has to be an object with r and phi keys.");}case 2:{var r = arguments[0],phi = arguments[1];if ((0, _is.isNumber)(r)) {if ((0, _is.isUnit)(phi) && phi.hasBase("ANGLE") && (phi = phi.toNumber("rad")), (0, _is.isNumber)(phi)) return new _complex["default"]({ r: r, phi: phi });throw new TypeError("Phi is not a number nor an angle unit.");} else throw new TypeError("Radius r is not a number.");}default:throw new SyntaxError("Wrong number of arguments in function fromPolar");}}, _complex["default"].prototype.valueOf = _complex["default"].prototype.toString, _complex["default"].fromJSON = function (json) {return new _complex["default"](json);}, _complex["default"].compare = function (a, b) {return a.re > b.re ? 1 : a.re < b.re ? -1 : a.im > b.im ? 1 : a.im < b.im ? -1 : 0;}, _complex["default"];}, { isClass: !0 });exports.createComplexClass = createComplexClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/complex/function/complex.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createComplex = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "complex",dependencies = ["typed", "Complex"],createComplex = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,Complex = _ref.Complex;return typed("complex", { "": function () {return Complex.ZERO;}, number: function (x) {return new Complex(x, 0);}, "number, number": function (re, im) {return new Complex(re, im);}, "BigNumber, BigNumber": function (re, im) {return new Complex(re.toNumber(), im.toNumber());}, Fraction: function (x) {return new Complex(x.valueOf(), 0);}, Complex: function (x) {return x.clone();}, string: function (x) {return Complex(x);}, null: function () {return Complex(0);}, Object: function (x) {if ("re" in x && "im" in x) return new Complex(x.re, x.im);if ("r" in x && "phi" in x || "abs" in x && "arg" in x) return new Complex(x);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)");}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createComplex = createComplex;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/fraction/Fraction.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFractionClass = void 0;var _fraction = _interopRequireDefault(__webpack_require__("./node_modules/fraction.js/fraction.js")),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "Fraction",dependencies = [],createFractionClass = (0, _factory.factory)(name, dependencies, function () {return _fraction["default"].prototype.type = "Fraction", _fraction["default"].prototype.isFraction = !0, _fraction["default"].prototype.toJSON = function () {return { mathjs: "Fraction", n: this.s * this.n, d: this.d };}, _fraction["default"].fromJSON = function (json) {return new _fraction["default"](json);}, _fraction["default"];}, { isClass: !0 });exports.createFractionClass = createFractionClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/fraction/function/fraction.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFraction = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "fraction",dependencies = ["typed", "Fraction"],createFraction = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,Fraction = _ref.Fraction;return typed("fraction", { number: function (x) {if (!isFinite(x) || isNaN(x)) throw new Error(x + " cannot be represented as a fraction");return new Fraction(x);}, string: function (x) {return new Fraction(x);}, "number, number": function (numerator, denominator) {return new Fraction(numerator, denominator);}, null: function () {return new Fraction(0);}, BigNumber: function (x) {return new Fraction(x.toString());}, Fraction: function (x) {return x;}, Object: function (x) {return new Fraction(x);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createFraction = createFraction;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/DenseMatrix.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createDenseMatrixClass = void 0;var _regenerator = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js");function _createForOfIteratorHelper(o, allowArrayLike) {var it = "undefined" != typeof Symbol && o[Symbol.iterator] || o["@@iterator"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && "number" == typeof o.length) {it && (o = it);var i = 0,F = function () {};return { s: F, n: function () {return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] };}, e: function (_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var err,normalCompletion = !0,didErr = !1;return { s: function () {it = it.call(o);}, n: function () {var step = it.next();return normalCompletion = step.done, step;}, e: function (_e2) {didErr = !0, err = _e2;}, f: function () {try {normalCompletion || null == it["return"] || it["return"]();} finally {if (didErr) throw err;}} };}function _unsupportedIterableToArray(o, minLen) {if (o) {if ("string" == typeof o) return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);return "Object" === n && o.constructor && (n = o.constructor.name), "Map" === n || "Set" === n ? Array.from(o) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(o, minLen) : void 0;}}function _arrayLikeToArray(arr, len) {(null == len || len > arr.length) && (len = arr.length);for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}var name = "DenseMatrix",dependencies = ["Matrix"],createDenseMatrixClass = (0, _factory.factory)("DenseMatrix", dependencies, function (_ref) {function DenseMatrix(data, datatype) {if (!(this instanceof DenseMatrix)) throw new SyntaxError("Constructor must be called with the new operator");if (datatype && !(0, _is.isString)(datatype)) throw new Error("Invalid datatype: " + datatype);if ((0, _is.isMatrix)(data)) "DenseMatrix" === data.type ? (this._data = (0, _object.clone)(data._data), this._size = (0, _object.clone)(data._size), this._datatype = datatype || data._datatype) : (this._data = data.toArray(), this._size = data.size(), this._datatype = datatype || data._datatype);else if (data && (0, _is.isArray)(data.data) && (0, _is.isArray)(data.size)) this._data = data.data, this._size = data.size, (0, _array.validate)(this._data, this._size), this._datatype = datatype || data.datatype;else if ((0, _is.isArray)(data)) this._data = preprocess(data), this._size = (0, _array.arraySize)(this._data), (0, _array.validate)(this._data, this._size), this._datatype = datatype;else if (data) throw new TypeError("Unsupported type of data (" + (0, _is.typeOf)(data) + ")");else this._data = [], this._size = [0], this._datatype = datatype;}function _get(matrix, index) {if (!(0, _is.isIndex)(index)) throw new TypeError("Invalid index");var isScalar = index.isScalar();if (isScalar) return matrix.get(index.min());var size = index.size();if (size.length !== matrix._size.length) throw new _DimensionError.DimensionError(size.length, matrix._size.length);for (var min = index.min(), max = index.max(), i = 0, ii = matrix._size.length; i < ii; i++) (0, _array.validateIndex)(min[i], matrix._size[i]), (0, _array.validateIndex)(max[i], matrix._size[i]);return new DenseMatrix(_getSubmatrix(matrix._data, index, size.length, 0), matrix._datatype);}function _getSubmatrix(data, index, dims, dim) {var range = index.dimension(dim);return dim === dims - 1 ? range.map(function (i) {return (0, _array.validateIndex)(i, data.length), data[i];}).valueOf() : range.map(function (i) {(0, _array.validateIndex)(i, data.length);var child = data[i];return _getSubmatrix(child, index, dims, dim + 1);}).valueOf();}function _set(matrix, index, submatrix, defaultValue) {if (!index || !0 !== index.isIndex) throw new TypeError("Invalid index");var sSize,iSize = index.size(),isScalar = index.isScalar();if ((0, _is.isMatrix)(submatrix) ? (sSize = submatrix.size(), submatrix = submatrix.valueOf()) : sSize = (0, _array.arraySize)(submatrix), isScalar) {if (0 !== sSize.length) throw new TypeError("Scalar expected");matrix.set(index.min(), submatrix, defaultValue);} else {if (iSize.length < matrix._size.length) throw new _DimensionError.DimensionError(iSize.length, matrix._size.length, "<");if (sSize.length < iSize.length) {for (var i = 0, outer = 0; 1 === iSize[i] && 1 === sSize[i];) i++;for (; 1 === iSize[i];) outer++, i++;submatrix = (0, _array.unsqueeze)(submatrix, iSize.length, outer, sSize);}if (!(0, _object.deepStrictEqual)(iSize, sSize)) throw new _DimensionError.DimensionError(iSize, sSize, ">");var size = index.max().map(function (i) {return i + 1;});_fit(matrix, size, defaultValue);var dims = iSize.length;_setSubmatrix(matrix._data, index, submatrix, dims, 0);}return matrix;}function _setSubmatrix(data, index, submatrix, dims, dim) {var range = index.dimension(dim);dim === dims - 1 ? range.forEach(function (dataIndex, subIndex) {(0, _array.validateIndex)(dataIndex), data[dataIndex] = submatrix[subIndex[0]];}) : range.forEach(function (dataIndex, subIndex) {(0, _array.validateIndex)(dataIndex), _setSubmatrix(data[dataIndex], index, submatrix[subIndex[0]], dims, dim + 1);});}function _resize(matrix, size, defaultValue) {if (0 === size.length) {for (var v = matrix._data; (0, _is.isArray)(v);) v = v[0];return v;}return matrix._size = size.slice(0), matrix._data = (0, _array.resize)(matrix._data, matrix._size, defaultValue), matrix;}function _fit(matrix, size, defaultValue) {for (var newSize = matrix._size.slice(0), changed = !1; newSize.length < size.length;) newSize.push(0), changed = !0;for (var i = 0, ii = size.length; i < ii; i++) size[i] > newSize[i] && (newSize[i] = size[i], changed = !0);changed && _resize(matrix, newSize, defaultValue);}function preprocess(data) {for (var elem, i = 0, ii = data.length; i < ii; i++) elem = data[i], (0, _is.isArray)(elem) ? data[i] = preprocess(elem) : elem && !0 === elem.isMatrix && (data[i] = preprocess(elem.valueOf()));return data;}var Matrix = _ref.Matrix;return DenseMatrix.prototype = new Matrix(), DenseMatrix.prototype.createDenseMatrix = function (data, datatype) {return new DenseMatrix(data, datatype);}, DenseMatrix.prototype.type = "DenseMatrix", DenseMatrix.prototype.isDenseMatrix = !0, DenseMatrix.prototype.getDataType = function () {return (0, _array.getArrayDataType)(this._data, _is.typeOf);}, DenseMatrix.prototype.storage = function () {return "dense";}, DenseMatrix.prototype.datatype = function () {return this._datatype;}, DenseMatrix.prototype.create = function (data, datatype) {return new DenseMatrix(data, datatype);}, DenseMatrix.prototype.subset = function (index, replacement, defaultValue) {switch (arguments.length) {case 1:return _get(this, index);case 2:case 3:return _set(this, index, replacement, defaultValue);default:throw new SyntaxError("Wrong number of arguments");}}, DenseMatrix.prototype.get = function (index) {if (!(0, _is.isArray)(index)) throw new TypeError("Array expected");if (index.length !== this._size.length) throw new _DimensionError.DimensionError(index.length, this._size.length);for (var x = 0; x < index.length; x++) (0, _array.validateIndex)(index[x], this._size[x]);for (var indexI, data = this._data, i = 0, ii = index.length; i < ii; i++) indexI = index[i], (0, _array.validateIndex)(indexI, data.length), data = data[indexI];return data;}, DenseMatrix.prototype.set = function (index, value, defaultValue) {if (!(0, _is.isArray)(index)) throw new TypeError("Array expected");if (index.length < this._size.length) throw new _DimensionError.DimensionError(index.length, this._size.length, "<");var i,ii,indexI,size = index.map(function (i) {return i + 1;});_fit(this, size, defaultValue);var data = this._data;for (i = 0, ii = index.length - 1; i < ii; i++) indexI = index[i], (0, _array.validateIndex)(indexI, data.length), data = data[indexI];return indexI = index[index.length - 1], (0, _array.validateIndex)(indexI, data.length), data[indexI] = value, this;}, DenseMatrix.prototype.resize = function (size, defaultValue, copy) {if (!(0, _is.isCollection)(size)) throw new TypeError("Array or Matrix expected");var sizeArray = size.valueOf().map(function (value) {return Array.isArray(value) && 1 === value.length ? value[0] : value;}),m = copy ? this.clone() : this;return _resize(m, sizeArray, defaultValue);}, DenseMatrix.prototype.reshape = function (size, copy) {var m = copy ? this.clone() : this;m._data = (0, _array.reshape)(m._data, size);var currentLength = m._size.reduce(function (length, size) {return length * size;});return m._size = (0, _array.processSizesWildcard)(size, currentLength), m;}, DenseMatrix.prototype.clone = function () {var m = new DenseMatrix({ data: (0, _object.clone)(this._data), size: (0, _object.clone)(this._size), datatype: this._datatype });return m;}, DenseMatrix.prototype.size = function () {return this._size.slice(0);}, DenseMatrix.prototype.map = function (callback) {var me = this,data = function recurse(value, index) {return (0, _is.isArray)(value) ? value.map(function (child, i) {return recurse(child, index.concat(i));}) : callback(value, index, me);}(this._data, []),datatype = void 0 === this._datatype ? void 0 : (0, _array.getArrayDataType)(data, _is.typeOf);return new DenseMatrix(data, datatype);}, DenseMatrix.prototype.forEach = function (callback) {var me = this;(function recurse(value, index) {(0, _is.isArray)(value) ? value.forEach(function (child, i) {recurse(child, index.concat(i));}) : callback(value, index, me);})(this._data, []);}, DenseMatrix.prototype[Symbol.iterator] = _regenerator["default"].mark(function _callee() {var recurse;return _regenerator["default"].wrap(function (_context2) {for (;;) switch (_context2.prev = _context2.next) {case 0:return recurse = _regenerator["default"].mark(function recurse(value, index) {var i;return _regenerator["default"].wrap(function (_context) {for (;;) switch (_context.prev = _context.next) {case 0:if (!(0, _is.isArray)(value)) {_context.next = 9;break;}i = 0;case 2:if (!(i < value.length)) {_context.next = 7;break;}return _context.delegateYield(recurse(value[i], index.concat(i)), "t0", 4);case 4:i++, _context.next = 2;break;case 7:_context.next = 11;break;case 9:return _context.next = 11, { value: value, index: index };case 11:case "end":return _context.stop();}}, recurse);}), _context2.delegateYield(recurse(this._data, []), "t0", 2);case 2:case "end":return _context2.stop();}}, _callee, this);}), DenseMatrix.prototype.rows = function () {var result = [],s = this.size();if (2 !== s.length) throw new TypeError("Rows can only be returned for a 2D matrix.");var _step,data = this._data,_iterator = _createForOfIteratorHelper(data);try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var row = _step.value;result.push(new DenseMatrix([row], this._datatype));}} catch (err) {_iterator.e(err);} finally {_iterator.f();}return result;}, DenseMatrix.prototype.columns = function () {var _this = this,result = [],s = this.size();if (2 !== s.length) throw new TypeError("Rows can only be returned for a 2D matrix.");for (var data = this._data, _loop = function (i) {var col = data.map(function (row) {return [row[i]];});result.push(new DenseMatrix(col, _this._datatype));}, i = 0; i < s[1]; i++) _loop(i);return result;}, DenseMatrix.prototype.toArray = function () {return (0, _object.clone)(this._data);}, DenseMatrix.prototype.valueOf = function () {return this._data;}, DenseMatrix.prototype.format = function (options) {return (0, _string.format)(this._data, options);}, DenseMatrix.prototype.toString = function () {return (0, _string.format)(this._data);}, DenseMatrix.prototype.toJSON = function () {return { mathjs: "DenseMatrix", data: this._data, size: this._size, datatype: this._datatype };}, DenseMatrix.prototype.diagonal = function (k) {if (!k) k = 0;else if ((0, _is.isBigNumber)(k) && (k = k.toNumber()), !(0, _is.isNumber)(k) || !(0, _number.isInteger)(k)) throw new TypeError("The parameter k must be an integer number");for (var kSuper = 0 < k ? k : 0, kSub = 0 > k ? -k : 0, rows = this._size[0], columns = this._size[1], n = Math.min(rows - kSub, columns - kSuper), data = [], i = 0; i < n; i++) data[i] = this._data[i + kSub][i + kSuper];return new DenseMatrix({ data: data, size: [n], datatype: this._datatype });}, DenseMatrix.diagonal = function (size, value, k, defaultValue) {if (!(0, _is.isArray)(size)) throw new TypeError("Array expected, size parameter");if (2 !== size.length) throw new Error("Only two dimensions matrix are supported");if (size = size.map(function (s) {if ((0, _is.isBigNumber)(s) && (s = s.toNumber()), !(0, _is.isNumber)(s) || !(0, _number.isInteger)(s) || 1 > s) throw new Error("Size values must be positive integers");return s;}), !k) k = 0;else if ((0, _is.isBigNumber)(k) && (k = k.toNumber()), !(0, _is.isNumber)(k) || !(0, _number.isInteger)(k)) throw new TypeError("The parameter k must be an integer number");var _value,kSuper = 0 < k ? k : 0,kSub = 0 > k ? -k : 0,rows = size[0],columns = size[1],n = Math.min(rows - kSub, columns - kSuper);if ((0, _is.isArray)(value)) {if (value.length !== n) throw new Error("Invalid value array length");_value = function (i) {return value[i];};} else if ((0, _is.isMatrix)(value)) {var ms = value.size();if (1 !== ms.length || ms[0] !== n) throw new Error("Invalid matrix length");_value = function (i) {return value.get([i]);};} else _value = function () {return value;};defaultValue || (defaultValue = (0, _is.isBigNumber)(_value(0)) ? _value(0).mul(0) : 0);var data = [];if (0 < size.length) {data = (0, _array.resize)(data, size, defaultValue);for (var d = 0; d < n; d++) data[d + kSub][d + kSuper] = _value(d);}return new DenseMatrix({ data: data, size: [rows, columns] });}, DenseMatrix.fromJSON = function (json) {return new DenseMatrix(json);}, DenseMatrix.prototype.swapRows = function (i, j) {if (!(0, _is.isNumber)(i) || !(0, _number.isInteger)(i) || !(0, _is.isNumber)(j) || !(0, _number.isInteger)(j)) throw new Error("Row index must be positive integers");if (2 !== this._size.length) throw new Error("Only two dimensional matrix is supported");return (0, _array.validateIndex)(i, this._size[0]), (0, _array.validateIndex)(j, this._size[0]), DenseMatrix._swapRows(i, j, this._data), this;}, DenseMatrix._swapRows = function (i, j, data) {var vi = data[i];data[i] = data[j], data[j] = vi;}, DenseMatrix;}, { isClass: !0 });exports.createDenseMatrixClass = createDenseMatrixClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/FibonacciHeap.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createFibonacciHeapClass = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "FibonacciHeap",dependencies = ["smaller", "larger"],createFibonacciHeapClass = (0, _factory.factory)(name, dependencies, function (_ref) {function FibonacciHeap() {if (!(this instanceof FibonacciHeap)) throw new SyntaxError("Constructor must be called with the new operator");this._minimum = null, this._size = 0;}function _decreaseKey(minimum, node, key) {node.key = key;var parent = node.parent;return parent && smaller(node.key, parent.key) && (_cut(minimum, node, parent), _cascadingCut(minimum, parent)), smaller(node.key, minimum.key) && (minimum = node), minimum;}function _cut(minimum, node, parent) {node.left.right = node.right, node.right.left = node.left, parent.degree--, parent.child === node && (parent.child = node.right), 0 === parent.degree && (parent.child = null), node.left = minimum, node.right = minimum.right, minimum.right = node, node.right.left = node, node.parent = null, node.mark = !1;}function _cascadingCut(minimum, node) {var parent = node.parent;parent && (node.mark ? (_cut(minimum, node, parent), _cascadingCut(parent)) : node.mark = !0);}function _findMinimumNode(minimum, size) {var arraySize = Math.floor(Math.log(size) * oneOverLogPhi) + 1,array = Array(arraySize),numRoots = 0,x = minimum;if (x) for (numRoots++, x = x.right; x !== minimum;) numRoots++, x = x.right;for (var y; 0 < numRoots;) {for (var d = x.degree, next = x.right; y = array[d], !!y;) {if (larger(x.key, y.key)) {var temp = y;y = x, x = temp;}_linkNodes(y, x), array[d] = null, d++;}array[d] = x, x = next, numRoots--;}minimum = null;for (var i = 0; i < arraySize; i++) (y = array[i], !!y) && (minimum ? (y.left.right = y.right, y.right.left = y.left, y.left = minimum, y.right = minimum.right, minimum.right = y, y.right.left = y, smaller(y.key, minimum.key) && (minimum = y)) : minimum = y);return minimum;}var smaller = _ref.smaller,larger = _ref.larger,oneOverLogPhi = 1 / Math.log((1 + Math.sqrt(5)) / 2);FibonacciHeap.prototype.type = "FibonacciHeap", FibonacciHeap.prototype.isFibonacciHeap = !0, FibonacciHeap.prototype.insert = function (key, value) {var node = { key: key, value: value, degree: 0 };if (this._minimum) {var minimum = this._minimum;node.left = minimum, node.right = minimum.right, minimum.right = node, node.right.left = node, smaller(key, minimum.key) && (this._minimum = node);} else node.left = node, node.right = node, this._minimum = node;return this._size++, node;}, FibonacciHeap.prototype.size = function () {return this._size;}, FibonacciHeap.prototype.clear = function () {this._minimum = null, this._size = 0;}, FibonacciHeap.prototype.isEmpty = function () {return 0 === this._size;}, FibonacciHeap.prototype.extractMinimum = function () {var node = this._minimum;if (null === node) return node;for (var tempRight, minimum = this._minimum, numberOfChildren = node.degree, x = node.child; 0 < numberOfChildren;) tempRight = x.right, x.left.right = x.right, x.right.left = x.left, x.left = minimum, x.right = minimum.right, minimum.right = x, x.right.left = x, x.parent = null, x = tempRight, numberOfChildren--;return node.left.right = node.right, node.right.left = node.left, node === node.right ? minimum = null : (minimum = node.right, minimum = _findMinimumNode(minimum, this._size)), this._size--, this._minimum = minimum, node;}, FibonacciHeap.prototype.remove = function (node) {this._minimum = _decreaseKey(this._minimum, node, -1), this.extractMinimum();};var _linkNodes = function (node, parent) {node.left.right = node.right, node.right.left = node.left, node.parent = parent, parent.child ? (node.left = parent.child, node.right = parent.child.right, parent.child.right = node, node.right.left = node) : (parent.child = node, node.right = node, node.left = node), parent.degree++, node.mark = !1;};return FibonacciHeap;}, { isClass: !0 });exports.createFibonacciHeapClass = createFibonacciHeapClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/ImmutableDenseMatrix.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createImmutableDenseMatrixClass = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "ImmutableDenseMatrix",dependencies = ["smaller", "DenseMatrix"],createImmutableDenseMatrixClass = (0, _factory.factory)(name, dependencies, function (_ref) {function ImmutableDenseMatrix(data, datatype) {if (!(this instanceof ImmutableDenseMatrix)) throw new SyntaxError("Constructor must be called with the new operator");if (datatype && !(0, _is.isString)(datatype)) throw new Error("Invalid datatype: " + datatype);if ((0, _is.isMatrix)(data) || (0, _is.isArray)(data)) {var matrix = new DenseMatrix(data, datatype);this._data = matrix._data, this._size = matrix._size, this._datatype = matrix._datatype, this._min = null, this._max = null;} else if (data && (0, _is.isArray)(data.data) && (0, _is.isArray)(data.size)) this._data = data.data, this._size = data.size, this._datatype = data.datatype, this._min = "undefined" == typeof data.min ? null : data.min, this._max = "undefined" == typeof data.max ? null : data.max;else if (data) throw new TypeError("Unsupported type of data (" + (0, _is.typeOf)(data) + ")");else this._data = [], this._size = [0], this._datatype = datatype, this._min = null, this._max = null;}var smaller = _ref.smaller,DenseMatrix = _ref.DenseMatrix;return ImmutableDenseMatrix.prototype = new DenseMatrix(), ImmutableDenseMatrix.prototype.type = "ImmutableDenseMatrix", ImmutableDenseMatrix.prototype.isImmutableDenseMatrix = !0, ImmutableDenseMatrix.prototype.subset = function (index) {switch (arguments.length) {case 1:{var m = DenseMatrix.prototype.subset.call(this, index);return (0, _is.isMatrix)(m) ? new ImmutableDenseMatrix({ data: m._data, size: m._size, datatype: m._datatype }) : m;}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments");}}, ImmutableDenseMatrix.prototype.set = function () {throw new Error("Cannot invoke set on an Immutable Matrix instance");}, ImmutableDenseMatrix.prototype.resize = function () {throw new Error("Cannot invoke resize on an Immutable Matrix instance");}, ImmutableDenseMatrix.prototype.reshape = function () {throw new Error("Cannot invoke reshape on an Immutable Matrix instance");}, ImmutableDenseMatrix.prototype.clone = function () {return new ImmutableDenseMatrix({ data: (0, _object.clone)(this._data), size: (0, _object.clone)(this._size), datatype: this._datatype });}, ImmutableDenseMatrix.prototype.toJSON = function () {return { mathjs: "ImmutableDenseMatrix", data: this._data, size: this._size, datatype: this._datatype };}, ImmutableDenseMatrix.fromJSON = function (json) {return new ImmutableDenseMatrix(json);}, ImmutableDenseMatrix.prototype.swapRows = function () {throw new Error("Cannot invoke swapRows on an Immutable Matrix instance");}, ImmutableDenseMatrix.prototype.min = function () {if (null === this._min) {var m = null;this.forEach(function (v) {(null === m || smaller(v, m)) && (m = v);}), this._min = null === m ? void 0 : m;}return this._min;}, ImmutableDenseMatrix.prototype.max = function () {if (null === this._max) {var m = null;this.forEach(function (v) {(null === m || smaller(m, v)) && (m = v);}), this._max = null === m ? void 0 : m;}return this._max;}, ImmutableDenseMatrix;}, { isClass: !0 });exports.createImmutableDenseMatrixClass = createImmutableDenseMatrixClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/Matrix.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMatrixClass = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "Matrix",dependencies = [],createMatrixClass = (0, _factory.factory)(name, dependencies, function () {function Matrix() {if (!(this instanceof Matrix)) throw new SyntaxError("Constructor must be called with the new operator");}return Matrix.prototype.type = "Matrix", Matrix.prototype.isMatrix = !0, Matrix.prototype.storage = function () {throw new Error("Cannot invoke storage on a Matrix interface");}, Matrix.prototype.datatype = function () {throw new Error("Cannot invoke datatype on a Matrix interface");}, Matrix.prototype.create = function () {throw new Error("Cannot invoke create on a Matrix interface");}, Matrix.prototype.subset = function () {throw new Error("Cannot invoke subset on a Matrix interface");}, Matrix.prototype.get = function () {throw new Error("Cannot invoke get on a Matrix interface");}, Matrix.prototype.set = function () {throw new Error("Cannot invoke set on a Matrix interface");}, Matrix.prototype.resize = function () {throw new Error("Cannot invoke resize on a Matrix interface");}, Matrix.prototype.reshape = function () {throw new Error("Cannot invoke reshape on a Matrix interface");}, Matrix.prototype.clone = function () {throw new Error("Cannot invoke clone on a Matrix interface");}, Matrix.prototype.size = function () {throw new Error("Cannot invoke size on a Matrix interface");}, Matrix.prototype.map = function () {throw new Error("Cannot invoke map on a Matrix interface");}, Matrix.prototype.forEach = function () {throw new Error("Cannot invoke forEach on a Matrix interface");}, Matrix.prototype[Symbol.iterator] = function () {throw new Error("Cannot iterate a Matrix interface");}, Matrix.prototype.toArray = function () {throw new Error("Cannot invoke toArray on a Matrix interface");}, Matrix.prototype.valueOf = function () {throw new Error("Cannot invoke valueOf on a Matrix interface");}, Matrix.prototype.format = function () {throw new Error("Cannot invoke format on a Matrix interface");}, Matrix.prototype.toString = function () {throw new Error("Cannot invoke toString on a Matrix interface");}, Matrix;}, { isClass: !0 });exports.createMatrixClass = createMatrixClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/MatrixIndex.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIndexClass = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "Index",dependencies = ["ImmutableDenseMatrix"],createIndexClass = (0, _factory.factory)(name, dependencies, function (_ref) {function Index() {if (!(this instanceof Index)) throw new SyntaxError("Constructor must be called with the new operator");this._dimensions = [], this._isScalar = !0;for (var arg, i = 0, ii = arguments.length; i < ii; i++) if (arg = arguments[i], (0, _is.isRange)(arg)) this._dimensions.push(arg), this._isScalar = !1;else if (Array.isArray(arg) || (0, _is.isMatrix)(arg)) {var m = _createImmutableMatrix(arg.valueOf());this._dimensions.push(m);var size = m.size();(1 !== size.length || 1 !== size[0]) && (this._isScalar = !1);} else if ("number" == typeof arg) this._dimensions.push(_createImmutableMatrix([arg]));else if ("string" == typeof arg) this._dimensions.push(arg);else throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");}function _createImmutableMatrix(arg) {for (var i = 0, l = arg.length; i < l; i++) if ("number" != typeof arg[i] || !(0, _number.isInteger)(arg[i])) throw new TypeError("Index parameters must be positive integer numbers");return new ImmutableDenseMatrix(arg);}var ImmutableDenseMatrix = _ref.ImmutableDenseMatrix;return Index.prototype.type = "Index", Index.prototype.isIndex = !0, Index.prototype.clone = function () {var index = new Index();return index._dimensions = (0, _object.clone)(this._dimensions), index._isScalar = this._isScalar, index;}, Index.create = function (ranges) {var index = new Index();return Index.apply(index, ranges), index;}, Index.prototype.size = function () {for (var d, size = [], i = 0, ii = this._dimensions.length; i < ii; i++) d = this._dimensions[i], size[i] = "string" == typeof d ? 1 : d.size()[0];return size;}, Index.prototype.max = function () {for (var range, values = [], i = 0, ii = this._dimensions.length; i < ii; i++) range = this._dimensions[i], values[i] = "string" == typeof range ? range : range.max();return values;}, Index.prototype.min = function () {for (var range, values = [], i = 0, ii = this._dimensions.length; i < ii; i++) range = this._dimensions[i], values[i] = "string" == typeof range ? range : range.min();return values;}, Index.prototype.forEach = function (callback) {for (var i = 0, ii = this._dimensions.length; i < ii; i++) callback(this._dimensions[i], i, this);}, Index.prototype.dimension = function (dim) {return this._dimensions[dim] || null;}, Index.prototype.isObjectProperty = function () {return 1 === this._dimensions.length && "string" == typeof this._dimensions[0];}, Index.prototype.getObjectProperty = function () {return this.isObjectProperty() ? this._dimensions[0] : null;}, Index.prototype.isScalar = function () {return this._isScalar;}, Index.prototype.toArray = function () {for (var dimension, array = [], i = 0, ii = this._dimensions.length; i < ii; i++) dimension = this._dimensions[i], array.push("string" == typeof dimension ? dimension : dimension.toArray());return array;}, Index.prototype.valueOf = Index.prototype.toArray, Index.prototype.toString = function () {for (var dimension, strings = [], i = 0, ii = this._dimensions.length; i < ii; i++) dimension = this._dimensions[i], "string" == typeof dimension ? strings.push(JSON.stringify(dimension)) : strings.push(dimension.toString());return "[" + strings.join(", ") + "]";}, Index.prototype.toJSON = function () {return { mathjs: "Index", dimensions: this._dimensions };}, Index.fromJSON = function (json) {return Index.create(json.dimensions);}, Index;}, { isClass: !0 });exports.createIndexClass = createIndexClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/Range.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createRangeClass = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "Range",dependencies = [],createRangeClass = (0, _factory.factory)(name, dependencies, function () {function Range(start, end, step) {if (!(this instanceof Range)) throw new SyntaxError("Constructor must be called with the new operator");var hasStart = null !== start && void 0 !== start,hasEnd = null !== end && void 0 !== end,hasStep = null !== step && void 0 !== step;if (hasStart) if ((0, _is.isBigNumber)(start)) start = start.toNumber();else if ("number" != typeof start) throw new TypeError("Parameter start must be a number");if (hasEnd) if ((0, _is.isBigNumber)(end)) end = end.toNumber();else if ("number" != typeof end) throw new TypeError("Parameter end must be a number");if (hasStep) if ((0, _is.isBigNumber)(step)) step = step.toNumber();else if ("number" != typeof step) throw new TypeError("Parameter step must be a number");this.start = hasStart ? parseFloat(start) : 0, this.end = hasEnd ? parseFloat(end) : 0, this.step = hasStep ? parseFloat(step) : 1;}return Range.prototype.type = "Range", Range.prototype.isRange = !0, Range.parse = function (str) {if ("string" != typeof str) return null;var args = str.split(":"),nums = args.map(function (arg) {return parseFloat(arg);}),invalid = nums.some(function (num) {return isNaN(num);});if (invalid) return null;switch (nums.length) {case 2:return new Range(nums[0], nums[1]);case 3:return new Range(nums[0], nums[2], nums[1]);default:return null;}}, Range.prototype.clone = function () {return new Range(this.start, this.end, this.step);}, Range.prototype.size = function () {var len = 0,start = this.start,step = this.step,end = this.end,diff = end - start;return (0, _number.sign)(step) === (0, _number.sign)(diff) ? len = Math.ceil(diff / step) : 0 === diff && (len = 0), isNaN(len) && (len = 0), [len];}, Range.prototype.min = function () {var size = this.size()[0];return 0 < size ? 0 < this.step ? this.start : this.start + (size - 1) * this.step : void 0;}, Range.prototype.max = function () {var size = this.size()[0];return 0 < size ? 0 < this.step ? this.start + (size - 1) * this.step : this.start : void 0;}, Range.prototype.forEach = function (callback) {var x = this.start,step = this.step,end = this.end,i = 0;if (0 < step) for (; x < end;) callback(x, [i], this), x += step, i++;else if (0 > step) for (; x > end;) callback(x, [i], this), x += step, i++;}, Range.prototype.map = function (callback) {var array = [];return this.forEach(function (value, index, obj) {array[index[0]] = callback(value, index, obj);}), array;}, Range.prototype.toArray = function () {var array = [];return this.forEach(function (value, index) {array[index[0]] = value;}), array;}, Range.prototype.valueOf = function () {return this.toArray();}, Range.prototype.format = function (options) {var str = (0, _number.format)(this.start, options);return 1 !== this.step && (str += ":" + (0, _number.format)(this.step, options)), str += ":" + (0, _number.format)(this.end, options), str;}, Range.prototype.toString = function () {return this.format();}, Range.prototype.toJSON = function () {return { mathjs: "Range", start: this.start, end: this.end, step: this.step };}, Range.fromJSON = function (json) {return new Range(json.start, json.end, json.step);}, Range;}, { isClass: !0 });exports.createRangeClass = createRangeClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/Spa.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSpaClass = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "Spa",dependencies = ["addScalar", "equalScalar", "FibonacciHeap"],createSpaClass = (0, _factory.factory)(name, dependencies, function (_ref) {function Spa() {if (!(this instanceof Spa)) throw new SyntaxError("Constructor must be called with the new operator");this._values = [], this._heap = new FibonacciHeap();}var addScalar = _ref.addScalar,equalScalar = _ref.equalScalar,FibonacciHeap = _ref.FibonacciHeap;return Spa.prototype.type = "Spa", Spa.prototype.isSpa = !0, Spa.prototype.set = function (i, v) {if (!this._values[i]) {var node = this._heap.insert(i, v);this._values[i] = node;} else this._values[i].value = v;}, Spa.prototype.get = function (i) {var node = this._values[i];return node ? node.value : 0;}, Spa.prototype.accumulate = function (i, v) {var node = this._values[i];node ? node.value = addScalar(node.value, v) : (node = this._heap.insert(i, v), this._values[i] = node);}, Spa.prototype.forEach = function (from, to, callback) {var heap = this._heap,values = this._values,nodes = [],node = heap.extractMinimum();for (node && nodes.push(node); node && node.key <= to;) node.key >= from && !equalScalar(node.value, 0) && callback(node.key, node.value, this), node = heap.extractMinimum(), node && nodes.push(node);for (var n, i = 0; i < nodes.length; i++) n = nodes[i], node = heap.insert(n.key, n.value), values[node.key] = node;}, Spa.prototype.swap = function (i, j) {var nodei = this._values[i],nodej = this._values[j];if (!nodei && nodej) nodei = this._heap.insert(i, nodej.value), this._heap.remove(nodej), this._values[i] = nodei, this._values[j] = void 0;else if (nodei && !nodej) nodej = this._heap.insert(j, nodei.value), this._heap.remove(nodei), this._values[j] = nodej, this._values[i] = void 0;else if (nodei && nodej) {var v = nodei.value;nodei.value = nodej.value, nodej.value = v;}}, Spa;}, { isClass: !0 });exports.createSpaClass = createSpaClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/SparseMatrix.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSparseMatrixClass = void 0;var _regenerator = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "SparseMatrix",dependencies = ["typed", "equalScalar", "Matrix"],createSparseMatrixClass = (0, _factory.factory)(name, dependencies, function (_ref) {function SparseMatrix(data, datatype) {if (!(this instanceof SparseMatrix)) throw new SyntaxError("Constructor must be called with the new operator");if (datatype && !(0, _is.isString)(datatype)) throw new Error("Invalid datatype: " + datatype);if ((0, _is.isMatrix)(data)) _createFromMatrix(this, data, datatype);else if (data && (0, _is.isArray)(data.index) && (0, _is.isArray)(data.ptr) && (0, _is.isArray)(data.size)) this._values = data.values, this._index = data.index, this._ptr = data.ptr, this._size = data.size, this._datatype = datatype || data.datatype;else if ((0, _is.isArray)(data)) _createFromArray(this, data, datatype);else if (data) throw new TypeError("Unsupported type of data (" + (0, _is.typeOf)(data) + ")");else this._values = [], this._index = [], this._ptr = [0], this._size = [0, 0], this._datatype = datatype;}function _createFromMatrix(matrix, source, datatype) {"SparseMatrix" === source.type ? (matrix._values = source._values ? (0, _object.clone)(source._values) : void 0, matrix._index = (0, _object.clone)(source._index), matrix._ptr = (0, _object.clone)(source._ptr), matrix._size = (0, _object.clone)(source._size), matrix._datatype = datatype || source._datatype) : _createFromArray(matrix, source.valueOf(), datatype || source._datatype);}function _createFromArray(matrix, data, datatype) {matrix._values = [], matrix._index = [], matrix._ptr = [], matrix._datatype = datatype;var rows = data.length,columns = 0,eq = equalScalar,zero = 0;if ((0, _is.isString)(datatype) && (eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar, zero = typed.convert(0, datatype)), 0 < rows) {var j = 0;do {matrix._ptr.push(matrix._index.length);for (var row, i = 0; i < rows; i++) if (row = data[i], !(0, _is.isArray)(row)) 0 === j && 1 > columns && (columns = 1), eq(row, zero) || (matrix._values.push(row), matrix._index.push(i));else if (0 === j && columns < row.length && (columns = row.length), j < row.length) {var v = row[j];eq(v, zero) || (matrix._values.push(v), matrix._index.push(i));}j++;} while (j < columns);}matrix._ptr.push(matrix._index.length), matrix._size = [rows, columns];}function _getsubset(matrix, idx) {if (!(0, _is.isIndex)(idx)) throw new TypeError("Invalid index");var isScalar = idx.isScalar();if (isScalar) return matrix.get(idx.min());var size = idx.size();if (size.length !== matrix._size.length) throw new _DimensionError.DimensionError(size.length, matrix._size.length);var i,ii,k,kk,min = idx.min(),max = idx.max();for (i = 0, ii = matrix._size.length; i < ii; i++) (0, _array.validateIndex)(min[i], matrix._size[i]), (0, _array.validateIndex)(max[i], matrix._size[i]);var mvalues = matrix._values,mindex = matrix._index,mptr = matrix._ptr,rows = idx.dimension(0),columns = idx.dimension(1),w = [],pv = [];rows.forEach(function (i, r) {pv[i] = r[0], w[i] = !0;});var values = mvalues ? [] : void 0,index = [],ptr = [];return columns.forEach(function (j) {for (ptr.push(index.length), k = mptr[j], kk = mptr[j + 1]; k < kk; k++) i = mindex[k], !0 === w[i] && (index.push(pv[i]), values && values.push(mvalues[k]));}), ptr.push(index.length), new SparseMatrix({ values: values, index: index, ptr: ptr, size: size, datatype: matrix._datatype });}function _setsubset(matrix, index, submatrix, defaultValue) {if (!index || !0 !== index.isIndex) throw new TypeError("Invalid index");var sSize,iSize = index.size(),isScalar = index.isScalar();if ((0, _is.isMatrix)(submatrix) ? (sSize = submatrix.size(), submatrix = submatrix.toArray()) : sSize = (0, _array.arraySize)(submatrix), isScalar) {if (0 !== sSize.length) throw new TypeError("Scalar expected");matrix.set(index.min(), submatrix, defaultValue);} else {if (1 !== iSize.length && 2 !== iSize.length) throw new _DimensionError.DimensionError(iSize.length, matrix._size.length, "<");if (sSize.length < iSize.length) {for (var i = 0, outer = 0; 1 === iSize[i] && 1 === sSize[i];) i++;for (; 1 === iSize[i];) outer++, i++;submatrix = (0, _array.unsqueeze)(submatrix, iSize.length, outer, sSize);}if (!(0, _object.deepStrictEqual)(iSize, sSize)) throw new _DimensionError.DimensionError(iSize, sSize, ">");for (var x0 = index.min()[0], y0 = index.min()[1], m = sSize[0], n = sSize[1], x = 0; x < m; x++) for (var v, y = 0; y < n; y++) v = submatrix[x][y], matrix.set([x + x0, y + y0], v, defaultValue);}return matrix;}function _getValueIndex(i, top, bottom, index) {if (0 == bottom - top) return bottom;for (var r = top; r < bottom; r++) if (index[r] === i) return r;return top;}function _remove(k, j, values, index, ptr) {values.splice(k, 1), index.splice(k, 1);for (var x = j + 1; x < ptr.length; x++) ptr[x]--;}function _insert(k, i, j, v, values, index, ptr) {values.splice(k, 0, v), index.splice(k, 0, i);for (var x = j + 1; x < ptr.length; x++) ptr[x]++;}function _resize(matrix, rows, columns, defaultValue) {var value = defaultValue || 0,eq = equalScalar,zero = 0;(0, _is.isString)(matrix._datatype) && (eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar, zero = typed.convert(0, matrix._datatype), value = typed.convert(value, matrix._datatype));var i,j,k,ins = !eq(value, zero),r = matrix._size[0],c = matrix._size[1];if (columns > c) {for (j = c; j < columns; j++) if (matrix._ptr[j] = matrix._values.length, ins) for (i = 0; i < r; i++) matrix._values.push(value), matrix._index.push(i);matrix._ptr[columns] = matrix._values.length;} else columns < c && (matrix._ptr.splice(columns + 1, c - columns), matrix._values.splice(matrix._ptr[columns], matrix._values.length), matrix._index.splice(matrix._ptr[columns], matrix._index.length));if (c = columns, rows > r) {if (ins) {var n = 0;for (j = 0; j < c; j++) {matrix._ptr[j] += n, k = matrix._ptr[j + 1] + n;var p = 0;for (i = r; i < rows; i++, p++) matrix._values.splice(k + p, 0, value), matrix._index.splice(k + p, 0, i), n++;}matrix._ptr[c] = matrix._values.length;}} else if (rows < r) {var d = 0;for (j = 0; j < c; j++) {matrix._ptr[j] -= d;var k0 = matrix._ptr[j],k1 = matrix._ptr[j + 1] - d;for (k = k0; k < k1; k++) i = matrix._index[k], i > rows - 1 && (matrix._values.splice(k, 1), matrix._index.splice(k, 1), d++);}matrix._ptr[j] = matrix._values.length;}return matrix._size[0] = rows, matrix._size[1] = columns, matrix;}function _map(matrix, minRow, maxRow, minColumn, maxColumn, callback, skipZeros) {var values = [],index = [],ptr = [],eq = equalScalar,zero = 0;(0, _is.isString)(matrix._datatype) && (eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar, zero = typed.convert(0, matrix._datatype));for (var invoke = function (v, x, y) {v = callback(v, x, y), eq(v, zero) || (values.push(v), index.push(x));}, j = minColumn; j <= maxColumn; j++) {ptr.push(values.length);var k0 = matrix._ptr[j],k1 = matrix._ptr[j + 1];if (skipZeros) for (var i, k = k0; k < k1; k++) i = matrix._index[k], i >= minRow && i <= maxRow && invoke(matrix._values[k], i - minRow, j - minColumn);else {for (var _i4, _values = {}, _k = k0; _k < k1; _k++) _i4 = matrix._index[_k], _values[_i4] = matrix._values[_k];for (var value, _i5 = minRow; _i5 <= maxRow; _i5++) value = _i5 in _values ? _values[_i5] : 0, invoke(value, _i5 - minRow, j - minColumn);}}return ptr.push(values.length), new SparseMatrix({ values: values, index: index, ptr: ptr, size: [maxRow - minRow + 1, maxColumn - minColumn + 1] });}function _toArray(values, index, ptr, size, copy) {var i,j,rows = size[0],columns = size[1],a = [];for (i = 0; i < rows; i++) for (a[i] = [], j = 0; j < columns; j++) a[i][j] = 0;for (j = 0; j < columns; j++) for (var k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) i = index[k], a[i][j] = values ? copy ? (0, _object.clone)(values[k]) : values[k] : 1;return a;}var typed = _ref.typed,equalScalar = _ref.equalScalar,Matrix = _ref.Matrix;return SparseMatrix.prototype = new Matrix(), SparseMatrix.prototype.createSparseMatrix = function (data, datatype) {return new SparseMatrix(data, datatype);}, SparseMatrix.prototype.type = "SparseMatrix", SparseMatrix.prototype.isSparseMatrix = !0, SparseMatrix.prototype.getDataType = function () {return (0, _array.getArrayDataType)(this._values, _is.typeOf);}, SparseMatrix.prototype.storage = function () {return "sparse";}, SparseMatrix.prototype.datatype = function () {return this._datatype;}, SparseMatrix.prototype.create = function (data, datatype) {return new SparseMatrix(data, datatype);}, SparseMatrix.prototype.density = function () {var rows = this._size[0],columns = this._size[1];return 0 !== rows && 0 !== columns ? this._index.length / (rows * columns) : 0;}, SparseMatrix.prototype.subset = function (index, replacement, defaultValue) {if (!this._values) throw new Error("Cannot invoke subset on a Pattern only matrix");switch (arguments.length) {case 1:return _getsubset(this, index);case 2:case 3:return _setsubset(this, index, replacement, defaultValue);default:throw new SyntaxError("Wrong number of arguments");}}, SparseMatrix.prototype.get = function (index) {if (!(0, _is.isArray)(index)) throw new TypeError("Array expected");if (index.length !== this._size.length) throw new _DimensionError.DimensionError(index.length, this._size.length);if (!this._values) throw new Error("Cannot invoke get on a Pattern only matrix");var i = index[0],j = index[1];(0, _array.validateIndex)(i, this._size[0]), (0, _array.validateIndex)(j, this._size[1]);var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);return k < this._ptr[j + 1] && this._index[k] === i ? this._values[k] : 0;}, SparseMatrix.prototype.set = function (index, v, defaultValue) {if (!(0, _is.isArray)(index)) throw new TypeError("Array expected");if (index.length !== this._size.length) throw new _DimensionError.DimensionError(index.length, this._size.length);if (!this._values) throw new Error("Cannot invoke set on a Pattern only matrix");var i = index[0],j = index[1],rows = this._size[0],columns = this._size[1],eq = equalScalar,zero = 0;(0, _is.isString)(this._datatype) && (eq = typed.find(equalScalar, [this._datatype, this._datatype]) || equalScalar, zero = typed.convert(0, this._datatype)), (i > rows - 1 || j > columns - 1) && (_resize(this, Math.max(i + 1, rows), Math.max(j + 1, columns), defaultValue), rows = this._size[0], columns = this._size[1]), (0, _array.validateIndex)(i, rows), (0, _array.validateIndex)(j, columns);var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);return k < this._ptr[j + 1] && this._index[k] === i ? eq(v, zero) ? _remove(k, j, this._values, this._index, this._ptr) : this._values[k] = v : _insert(k, i, j, v, this._values, this._index, this._ptr), this;}, SparseMatrix.prototype.resize = function (size, defaultValue, copy) {if (!(0, _is.isCollection)(size)) throw new TypeError("Array or Matrix expected");var sizeArray = size.valueOf().map(function (value) {return Array.isArray(value) && 1 === value.length ? value[0] : value;});if (2 !== sizeArray.length) throw new Error("Only two dimensions matrix are supported");sizeArray.forEach(function (value) {if (!(0, _is.isNumber)(value) || !(0, _number.isInteger)(value) || 0 > value) throw new TypeError("Invalid size, must contain positive integers (size: " + (0, _string.format)(sizeArray) + ")");});var m = copy ? this.clone() : this;return _resize(m, sizeArray[0], sizeArray[1], defaultValue);}, SparseMatrix.prototype.reshape = function (sizes, copy) {if (!(0, _is.isArray)(sizes)) throw new TypeError("Array expected");if (2 !== sizes.length) throw new Error("Sparse matrices can only be reshaped in two dimensions");sizes.forEach(function (value) {if (!(0, _is.isNumber)(value) || !(0, _number.isInteger)(value) || -2 >= value || 0 === value) throw new TypeError("Invalid size, must contain positive integers or -1 (size: " + (0, _string.format)(sizes) + ")");});var currentLength = this._size[0] * this._size[1];sizes = (0, _array.processSizesWildcard)(sizes, currentLength);var newLength = sizes[0] * sizes[1];if (currentLength != newLength) throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var m = copy ? this.clone() : this;if (this._size[0] === sizes[0] && this._size[1] === sizes[1]) return m;for (var colIndex = [], i = 0; i < m._ptr.length; i++) for (var j = 0; j < m._ptr[i + 1] - m._ptr[i]; j++) colIndex.push(i);for (var values = m._values.slice(), rowIndex = m._index.slice(), _i = 0; _i < m._index.length; _i++) {var r1 = rowIndex[_i],c1 = colIndex[_i],flat = r1 * m._size[1] + c1;colIndex[_i] = flat % sizes[1], rowIndex[_i] = Math.floor(flat / sizes[1]);}m._values.length = 0, m._index.length = 0, m._ptr.length = sizes[1] + 1, m._size = sizes.slice();for (var _i2 = 0; _i2 < m._ptr.length; _i2++) m._ptr[_i2] = 0;for (var h = 0; h < values.length; h++) {var _i3 = rowIndex[h],_j = colIndex[h],v = values[h],k = _getValueIndex(_i3, m._ptr[_j], m._ptr[_j + 1], m._index);_insert(k, _i3, _j, v, m._values, m._index, m._ptr);}return m;}, SparseMatrix.prototype.clone = function () {var m = new SparseMatrix({ values: this._values ? (0, _object.clone)(this._values) : void 0, index: (0, _object.clone)(this._index), ptr: (0, _object.clone)(this._ptr), size: (0, _object.clone)(this._size), datatype: this._datatype });return m;}, SparseMatrix.prototype.size = function () {return this._size.slice(0);}, SparseMatrix.prototype.map = function (callback, skipZeros) {if (!this._values) throw new Error("Cannot invoke map on a Pattern only matrix");var me = this,rows = this._size[0],columns = this._size[1];return _map(this, 0, rows - 1, 0, columns - 1, function (v, i, j) {return callback(v, [i, j], me);}, skipZeros);}, SparseMatrix.prototype.forEach = function (callback, skipZeros) {if (!this._values) throw new Error("Cannot invoke forEach on a Pattern only matrix");for (var me = this, rows = this._size[0], columns = this._size[1], j = 0; j < columns; j++) {var k0 = this._ptr[j],k1 = this._ptr[j + 1];if (skipZeros) for (var i, k = k0; k < k1; k++) i = this._index[k], callback(this._values[k], [i, j], me);else {for (var _i6, values = {}, _k2 = k0; _k2 < k1; _k2++) _i6 = this._index[_k2], values[_i6] = this._values[_k2];for (var value, _i7 = 0; _i7 < rows; _i7++) value = _i7 in values ? values[_i7] : 0, callback(value, [_i7, j], me);}}}, SparseMatrix.prototype[Symbol.iterator] = _regenerator["default"].mark(function _callee() {var columns, j, k0, k1, k, i;return _regenerator["default"].wrap(function (_context) {for (;;) switch (_context.prev = _context.next) {case 0:if (this._values) {_context.next = 2;break;}throw new Error("Cannot iterate a Pattern only matrix");case 2:columns = this._size[1], j = 0;case 4:if (!(j < columns)) {_context.next = 18;break;}k0 = this._ptr[j], k1 = this._ptr[j + 1], k = k0;case 8:if (!(k < k1)) {_context.next = 15;break;}return i = this._index[k], _context.next = 12, { value: this._values[k], index: [i, j] };case 12:k++, _context.next = 8;break;case 15:j++, _context.next = 4;break;case 18:case "end":return _context.stop();}}, _callee, this);}), SparseMatrix.prototype.toArray = function () {return _toArray(this._values, this._index, this._ptr, this._size, !0);}, SparseMatrix.prototype.valueOf = function () {return _toArray(this._values, this._index, this._ptr, this._size, !1);}, SparseMatrix.prototype.format = function (options) {for (var rows = this._size[0], columns = this._size[1], density = this.density(), str = "Sparse Matrix [" + (0, _string.format)(rows, options) + " x " + (0, _string.format)(columns, options) + "] density: " + (0, _string.format)(density, options) + "\n", j = 0; j < columns; j++) for (var i, k0 = this._ptr[j], k1 = this._ptr[j + 1], k = k0; k < k1; k++) i = this._index[k], str += "\n    (" + (0, _string.format)(i, options) + ", " + (0, _string.format)(j, options) + ") ==> " + (this._values ? (0, _string.format)(this._values[k], options) : "X");return str;}, SparseMatrix.prototype.toString = function () {return (0, _string.format)(this.toArray());}, SparseMatrix.prototype.toJSON = function () {return { mathjs: "SparseMatrix", values: this._values, index: this._index, ptr: this._ptr, size: this._size, datatype: this._datatype };}, SparseMatrix.prototype.diagonal = function (k) {if (!k) k = 0;else if ((0, _is.isBigNumber)(k) && (k = k.toNumber()), !(0, _is.isNumber)(k) || !(0, _number.isInteger)(k)) throw new TypeError("The parameter k must be an integer number");var kSuper = 0 < k ? k : 0,kSub = 0 > k ? -k : 0,rows = this._size[0],columns = this._size[1],n = Math.min(rows - kSub, columns - kSuper),values = [],index = [],ptr = [];ptr[0] = 0;for (var j = kSuper; j < columns && values.length < n; j++) for (var i, k0 = this._ptr[j], k1 = this._ptr[j + 1], x = k0; x < k1; x++) if (i = this._index[x], i === j - kSuper + kSub) {values.push(this._values[x]), index[values.length - 1] = i - kSub;break;}return ptr.push(values.length), new SparseMatrix({ values: values, index: index, ptr: ptr, size: [n, 1] });}, SparseMatrix.fromJSON = function (json) {return new SparseMatrix(json);}, SparseMatrix.diagonal = function (size, value, k, defaultValue, datatype) {if (!(0, _is.isArray)(size)) throw new TypeError("Array expected, size parameter");if (2 !== size.length) throw new Error("Only two dimensions matrix are supported");if (size = size.map(function (s) {if ((0, _is.isBigNumber)(s) && (s = s.toNumber()), !(0, _is.isNumber)(s) || !(0, _number.isInteger)(s) || 1 > s) throw new Error("Size values must be positive integers");return s;}), !k) k = 0;else if ((0, _is.isBigNumber)(k) && (k = k.toNumber()), !(0, _is.isNumber)(k) || !(0, _number.isInteger)(k)) throw new TypeError("The parameter k must be an integer number");var eq = equalScalar,zero = 0;(0, _is.isString)(datatype) && (eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar, zero = typed.convert(0, datatype));var _value,kSuper = 0 < k ? k : 0,kSub = 0 > k ? -k : 0,rows = size[0],columns = size[1],n = Math.min(rows - kSub, columns - kSuper);if ((0, _is.isArray)(value)) {if (value.length !== n) throw new Error("Invalid value array length");_value = function (i) {return value[i];};} else if ((0, _is.isMatrix)(value)) {var ms = value.size();if (1 !== ms.length || ms[0] !== n) throw new Error("Invalid matrix length");_value = function (i) {return value.get([i]);};} else _value = function () {return value;};for (var values = [], index = [], ptr = [], j = 0; j < columns; j++) {ptr.push(values.length);var i = j - kSuper;if (0 <= i && i < n) {var v = _value(i);eq(v, zero) || (index.push(i + kSub), values.push(v));}}return ptr.push(values.length), new SparseMatrix({ values: values, index: index, ptr: ptr, size: [rows, columns] });}, SparseMatrix.prototype.swapRows = function (i, j) {if (!(0, _is.isNumber)(i) || !(0, _number.isInteger)(i) || !(0, _is.isNumber)(j) || !(0, _number.isInteger)(j)) throw new Error("Row index must be positive integers");if (2 !== this._size.length) throw new Error("Only two dimensional matrix is supported");return (0, _array.validateIndex)(i, this._size[0]), (0, _array.validateIndex)(j, this._size[0]), SparseMatrix._swapRows(i, j, this._size[1], this._values, this._index, this._ptr), this;}, SparseMatrix._forEachRow = function (j, values, index, ptr, callback) {for (var k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) callback(index[k], values[k]);}, SparseMatrix._swapRows = function (x, y, columns, values, index, ptr) {for (var j = 0; j < columns; j++) {var k0 = ptr[j],k1 = ptr[j + 1],kx = _getValueIndex(x, k0, k1, index),ky = _getValueIndex(y, k0, k1, index);if (kx < k1 && ky < k1 && index[kx] === x && index[ky] === y) {if (values) {var v = values[kx];values[kx] = values[ky], values[ky] = v;}continue;}if (kx < k1 && index[kx] === x && (ky >= k1 || index[ky] !== y)) {var vx = values ? values[kx] : void 0;index.splice(ky, 0, y), values && values.splice(ky, 0, vx), index.splice(ky <= kx ? kx + 1 : kx, 1), values && values.splice(ky <= kx ? kx + 1 : kx, 1);continue;}if (ky < k1 && index[ky] === y && (kx >= k1 || index[kx] !== x)) {var vy = values ? values[ky] : void 0;index.splice(kx, 0, x), values && values.splice(kx, 0, vy), index.splice(kx <= ky ? ky + 1 : ky, 1), values && values.splice(kx <= ky ? ky + 1 : ky, 1);}}}, SparseMatrix;}, { isClass: !0 });exports.createSparseMatrixClass = createSparseMatrixClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/function/index.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createIndex = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),name = "index",dependencies = ["typed", "Index"],createIndex = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,Index = _ref.Index;return typed(name, { "...number | string | BigNumber | Range | Array | Matrix": function (args) {var ranges = args.map(function (arg) {return (0, _is.isBigNumber)(arg) ? arg.toNumber() : Array.isArray(arg) || (0, _is.isMatrix)(arg) ? arg.map(function (elem) {return (0, _is.isBigNumber)(elem) ? elem.toNumber() : elem;}) : arg;}),res = new Index();return Index.apply(res, ranges), res;} });});exports.createIndex = createIndex;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/function/matrix.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createMatrix = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "matrix",dependencies = ["typed", "Matrix", "DenseMatrix", "SparseMatrix"],createMatrix = (0, _factory.factory)(name, dependencies, function (_ref) {function _create(data, format, datatype) {if ("dense" === format || "default" === format || format === void 0) return new DenseMatrix(data, datatype);if ("sparse" === format) return new SparseMatrix(data, datatype);throw new TypeError("Unknown matrix type " + JSON.stringify(format) + ".");}var typed = _ref.typed,Matrix = _ref.Matrix,DenseMatrix = _ref.DenseMatrix,SparseMatrix = _ref.SparseMatrix;return typed(name, { "": function () {return _create([]);}, string: function (format) {return _create([], format);}, "string, string": function (format, datatype) {return _create([], format, datatype);}, Array: function (data) {return _create(data);}, Matrix: function (data) {return _create(data, data.storage());}, "Array | Matrix, string": _create, "Array | Matrix, string, string": _create });});exports.createMatrix = createMatrix;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/function/sparse.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSparse = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "sparse",dependencies = ["typed", "SparseMatrix"],createSparse = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,SparseMatrix = _ref.SparseMatrix;return typed(name, { "": function () {return new SparseMatrix([]);}, string: function (datatype) {return new SparseMatrix([], datatype);}, "Array | Matrix": function (data) {return new SparseMatrix(data);}, "Array | Matrix, string": function (data, datatype) {return new SparseMatrix(data, datatype);} });});exports.createSparse = createSparse;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm01.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm01 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "algorithm01",dependencies = ["typed"],createAlgorithm01 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return function (denseMatrix, sparseMatrix, callback, inverse) {var adata = denseMatrix._data,asize = denseMatrix._size,adt = denseMatrix._datatype,bvalues = sparseMatrix._values,bindex = sparseMatrix._index,bptr = sparseMatrix._ptr,bsize = sparseMatrix._size,bdt = sparseMatrix._datatype;if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");if (!bvalues) throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var i,j,rows = asize[0],columns = asize[1],dt = "string" == typeof adt && adt === bdt ? adt : void 0,cf = dt ? typed.find(callback, [dt, dt]) : callback,cdata = [];for (i = 0; i < rows; i++) cdata[i] = [];var x = [],w = [];for (j = 0; j < columns; j++) {for (var mark = j + 1, k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) i = bindex[k], x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]), w[i] = mark;for (i = 0; i < rows; i++) cdata[i][j] = w[i] === mark ? x[i] : adata[i][j];}return denseMatrix.createDenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});exports.createAlgorithm01 = createAlgorithm01;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm02.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm02 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "algorithm02",dependencies = ["typed", "equalScalar"],createAlgorithm02 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,equalScalar = _ref.equalScalar;return function (denseMatrix, sparseMatrix, callback, inverse) {var adata = denseMatrix._data,asize = denseMatrix._size,adt = denseMatrix._datatype,bvalues = sparseMatrix._values,bindex = sparseMatrix._index,bptr = sparseMatrix._ptr,bsize = sparseMatrix._size,bdt = sparseMatrix._datatype;if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");if (!bvalues) throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));for (var cvalues = [], cindex = [], cptr = [], j = 0; j < columns; j++) {cptr[j] = cindex.length;for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {var i = bindex[k],cij = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);eq(cij, zero) || (cindex.push(i), cvalues.push(cij));}}return cptr[columns] = cindex.length, sparseMatrix.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});exports.createAlgorithm02 = createAlgorithm02;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm03.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm03 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "algorithm03",dependencies = ["typed"],createAlgorithm03 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return function (denseMatrix, sparseMatrix, callback, inverse) {var adata = denseMatrix._data,asize = denseMatrix._size,adt = denseMatrix._datatype,bvalues = sparseMatrix._values,bindex = sparseMatrix._index,bptr = sparseMatrix._ptr,bsize = sparseMatrix._size,bdt = sparseMatrix._datatype;if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");if (!bvalues) throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var dt,rows = asize[0],columns = asize[1],zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));for (var cdata = [], z = 0; z < rows; z++) cdata[z] = [];for (var mark, x = [], w = [], j = 0; j < columns; j++) {mark = j + 1;for (var i, k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) i = bindex[k], x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]), w[i] = mark;for (var y = 0; y < rows; y++) cdata[y][j] = w[y] === mark ? x[y] : inverse ? cf(zero, adata[y][j]) : cf(adata[y][j], zero);}return denseMatrix.createDenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});exports.createAlgorithm03 = createAlgorithm03;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm04.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm04 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "algorithm04",dependencies = ["typed", "equalScalar"],createAlgorithm04 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,equalScalar = _ref.equalScalar;return function (a, b, callback) {var avalues = a._values,aindex = a._index,aptr = a._ptr,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));var i,j,k,k0,k1,cvalues = avalues && bvalues ? [] : void 0,cindex = [],cptr = [],xa = avalues && bvalues ? [] : void 0,xb = avalues && bvalues ? [] : void 0,wa = [],wb = [];for (j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) i = aindex[k], cindex.push(i), wa[i] = mark, xa && (xa[i] = avalues[k]);for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) if (i = bindex[k], wa[i] !== mark) cindex.push(i), wb[i] = mark, xb && (xb[i] = bvalues[k]);else if (xa) {var v = cf(xa[i], bvalues[k]);eq(v, zero) ? wa[i] = null : xa[i] = v;}if (xa && xb) for (k = cptr[j]; k < cindex.length;) i = cindex[k], wa[i] === mark ? (cvalues[k] = xa[i], k++) : wb[i] === mark ? (cvalues[k] = xb[i], k++) : cindex.splice(k, 1);}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});exports.createAlgorithm04 = createAlgorithm04;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm05.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm05 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "algorithm05",dependencies = ["typed", "equalScalar"],createAlgorithm05 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,equalScalar = _ref.equalScalar;return function (a, b, callback) {var avalues = a._values,aindex = a._index,aptr = a._ptr,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));var i,j,k,k1,cvalues = avalues && bvalues ? [] : void 0,cindex = [],cptr = [],xa = cvalues ? [] : void 0,xb = cvalues ? [] : void 0,wa = [],wb = [];for (j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;for (k = aptr[j], k1 = aptr[j + 1]; k < k1; k++) i = aindex[k], cindex.push(i), wa[i] = mark, xa && (xa[i] = avalues[k]);for (k = bptr[j], k1 = bptr[j + 1]; k < k1; k++) i = bindex[k], wa[i] !== mark && cindex.push(i), wb[i] = mark, xb && (xb[i] = bvalues[k]);if (cvalues) for (k = cptr[j]; k < cindex.length;) {i = cindex[k];var wai = wa[i],wbi = wb[i];if (wai === mark || wbi === mark) {var va = wai === mark ? xa[i] : zero,vb = wbi === mark ? xb[i] : zero,vc = cf(va, vb);eq(vc, zero) ? cindex.splice(k, 1) : (cvalues.push(vc), k++);}}}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});exports.createAlgorithm05 = createAlgorithm05;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm06.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm06 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "algorithm06",dependencies = ["typed", "equalScalar"],createAlgorithm06 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,equalScalar = _ref.equalScalar;return function (a, b, callback) {var avalues = a._values,asize = a._size,adt = a._datatype,bvalues = b._values,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));for (var cvalues = avalues && bvalues ? [] : void 0, cindex = [], cptr = [], x = cvalues ? [] : void 0, w = [], u = [], j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;if ((0, _collection.scatter)(a, j, w, x, u, mark, cindex, cf), (0, _collection.scatter)(b, j, w, x, u, mark, cindex, cf), x) {for (var i, k = cptr[j]; k < cindex.length;) if (i = cindex[k], u[i] === mark) {var v = x[i];eq(v, zero) ? cindex.splice(k, 1) : (cvalues.push(v), k++);} else cindex.splice(k, 1);} else for (var r, p = cptr[j]; p < cindex.length;) r = cindex[p], u[r] === mark ? p++ : cindex.splice(p, 1);}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});exports.createAlgorithm06 = createAlgorithm06;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm07.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm07 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "algorithm07",dependencies = ["typed", "DenseMatrix"],createAlgorithm07 = (0, _factory.factory)(name, dependencies, function (_ref) {function _scatter(m, j, w, x, mark) {for (var i, values = m._values, index = m._index, ptr = m._ptr, k = ptr[j], k1 = ptr[j + 1]; k < k1; k++) i = index[k], w[i] = mark, x[i] = values[k];}var typed = _ref.typed,DenseMatrix = _ref.DenseMatrix;return function (a, b, callback) {var asize = a._size,adt = a._datatype,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));var i,j,cdata = [];for (i = 0; i < rows; i++) cdata[i] = [];var xa = [],xb = [],wa = [],wb = [];for (j = 0; j < columns; j++) {var mark = j + 1;for (_scatter(a, j, wa, xa, mark), _scatter(b, j, wb, xb, mark), i = 0; i < rows; i++) {var va = wa[i] === mark ? xa[i] : zero,vb = wb[i] === mark ? xb[i] : zero;cdata[i][j] = cf(va, vb);}}return new DenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});exports.createAlgorithm07 = createAlgorithm07;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm08.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm08 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "algorithm08",dependencies = ["typed", "equalScalar"],createAlgorithm08 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,equalScalar = _ref.equalScalar;return function (a, b, callback) {var avalues = a._values,aindex = a._index,aptr = a._ptr,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");if (!avalues || !bvalues) throw new Error("Cannot perform operation on Pattern Sparse Matrices");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));for (var k, k0, k1, i, cvalues = [], cindex = [], cptr = [], x = [], w = [], j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) i = aindex[k], w[i] = mark, x[i] = avalues[k], cindex.push(i);for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) i = bindex[k], w[i] === mark && (x[i] = cf(x[i], bvalues[k]));for (k = cptr[j]; k < cindex.length;) {i = cindex[k];var v = x[i];eq(v, zero) ? cindex.splice(k, 1) : (cvalues.push(v), k++);}}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});exports.createAlgorithm08 = createAlgorithm08;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm09.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm09 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "algorithm09",dependencies = ["typed", "equalScalar"],createAlgorithm09 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,equalScalar = _ref.equalScalar;return function (a, b, callback) {var avalues = a._values,aindex = a._index,aptr = a._ptr,asize = a._size,adt = a._datatype,bvalues = b._values,bindex = b._index,bptr = b._ptr,bsize = b._size,bdt = b._datatype;if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), cf = typed.find(callback, [dt, dt]));var i,j,k,k0,k1,cvalues = avalues && bvalues ? [] : void 0,cindex = [],cptr = [],x = cvalues ? [] : void 0,w = [];for (j = 0; j < columns; j++) {cptr[j] = cindex.length;var mark = j + 1;if (x) for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) i = bindex[k], w[i] = mark, x[i] = bvalues[k];for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) if (i = aindex[k], x) {var vb = w[i] === mark ? x[i] : zero,vc = cf(avalues[k], vb);eq(vc, zero) || (cindex.push(i), cvalues.push(vc));} else cindex.push(i);}return cptr[columns] = cindex.length, a.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});exports.createAlgorithm09 = createAlgorithm09;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm10.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm10 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "algorithm10",dependencies = ["typed", "DenseMatrix"],createAlgorithm10 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,DenseMatrix = _ref.DenseMatrix;return function (s, b, callback, inverse) {var avalues = s._values,aindex = s._index,aptr = s._ptr,asize = s._size,adt = s._datatype;if (!avalues) throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var dt,rows = asize[0],columns = asize[1],cf = callback;"string" == typeof adt && (dt = adt, b = typed.convert(b, dt), cf = typed.find(callback, [dt, dt]));for (var mark, cdata = [], x = [], w = [], j = 0; j < columns; j++) {mark = j + 1;for (var r, k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) r = aindex[k], x[r] = avalues[k], w[r] = mark;for (var i = 0; i < rows; i++) 0 === j && (cdata[i] = []), cdata[i][j] = w[i] === mark ? inverse ? cf(b, x[i]) : cf(x[i], b) : b;}return new DenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});exports.createAlgorithm10 = createAlgorithm10;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm11.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm11 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "algorithm11",dependencies = ["typed", "equalScalar"],createAlgorithm11 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,equalScalar = _ref.equalScalar;return function (s, b, callback, inverse) {var avalues = s._values,aindex = s._index,aptr = s._ptr,asize = s._size,adt = s._datatype;if (!avalues) throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var dt,rows = asize[0],columns = asize[1],eq = equalScalar,zero = 0,cf = callback;"string" == typeof adt && (dt = adt, eq = typed.find(equalScalar, [dt, dt]), zero = typed.convert(0, dt), b = typed.convert(b, dt), cf = typed.find(callback, [dt, dt]));for (var cvalues = [], cindex = [], cptr = [], j = 0; j < columns; j++) {cptr[j] = cindex.length;for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {var i = aindex[k],v = inverse ? cf(b, avalues[k]) : cf(avalues[k], b);eq(v, zero) || (cindex.push(i), cvalues.push(v));}}return cptr[columns] = cindex.length, s.createSparseMatrix({ values: cvalues, index: cindex, ptr: cptr, size: [rows, columns], datatype: dt });};});exports.createAlgorithm11 = createAlgorithm11;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm12 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "algorithm12",dependencies = ["typed", "DenseMatrix"],createAlgorithm12 = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,DenseMatrix = _ref.DenseMatrix;return function (s, b, callback, inverse) {var avalues = s._values,aindex = s._index,aptr = s._ptr,asize = s._size,adt = s._datatype;if (!avalues) throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var dt,rows = asize[0],columns = asize[1],cf = callback;"string" == typeof adt && (dt = adt, b = typed.convert(b, dt), cf = typed.find(callback, [dt, dt]));for (var mark, cdata = [], x = [], w = [], j = 0; j < columns; j++) {mark = j + 1;for (var r, k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) r = aindex[k], x[r] = avalues[k], w[r] = mark;for (var i = 0; i < rows; i++) 0 === j && (cdata[i] = []), cdata[i][j] = w[i] === mark ? inverse ? cf(b, x[i]) : cf(x[i], b) : inverse ? cf(b, 0) : cf(0, b);}return new DenseMatrix({ data: cdata, size: [rows, columns], datatype: dt });};});exports.createAlgorithm12 = createAlgorithm12;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm13.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm13 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),name = "algorithm13",dependencies = ["typed"],createAlgorithm13 = (0, _factory.factory)(name, dependencies, function (_ref) {function _iterate(f, level, s, n, av, bv) {var cv = [];if (level === s.length - 1) for (var i = 0; i < n; i++) cv[i] = f(av[i], bv[i]);else for (var j = 0; j < n; j++) cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv[j]);return cv;}var typed = _ref.typed;return function (a, b, callback) {var adata = a._data,asize = a._size,adt = a._datatype,bdata = b._data,bsize = b._size,bdt = b._datatype,csize = [];if (asize.length !== bsize.length) throw new _DimensionError.DimensionError(asize.length, bsize.length);for (var s = 0; s < asize.length; s++) {if (asize[s] !== bsize[s]) throw new RangeError("Dimension mismatch. Matrix A (" + asize + ") must match Matrix B (" + bsize + ")");csize[s] = asize[s];}var dt,cf = callback;"string" == typeof adt && adt === bdt && (dt = adt, cf = typed.find(callback, [dt, dt]));var cdata = 0 < csize.length ? _iterate(cf, 0, csize, csize[0], adata, bdata) : [];return a.createDenseMatrix({ data: cdata, size: csize, datatype: dt });};});exports.createAlgorithm13 = createAlgorithm13;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm14.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createAlgorithm14 = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),name = "algorithm14",dependencies = ["typed"],createAlgorithm14 = (0, _factory.factory)(name, dependencies, function (_ref) {function _iterate(f, level, s, n, av, bv, inverse) {var cv = [];if (level === s.length - 1) for (var i = 0; i < n; i++) cv[i] = inverse ? f(bv, av[i]) : f(av[i], bv);else for (var j = 0; j < n; j++) cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv, inverse);return cv;}var typed = _ref.typed;return function (a, b, callback, inverse) {var dt,adata = a._data,asize = a._size,adt = a._datatype,cf = callback;"string" == typeof adt && (dt = adt, b = typed.convert(b, dt), cf = typed.find(callback, [dt, dt]));var cdata = 0 < asize.length ? _iterate(cf, 0, asize, asize[0], adata, b, inverse) : [];return a.createDenseMatrix({ data: cdata, size: (0, _object.clone)(asize), datatype: dt });};});exports.createAlgorithm14 = createAlgorithm14;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/number.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createNumber = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "number",dependencies = ["typed"];function getNonDecimalNumberParts(input) {var nonDecimalWithRadixMatch = input.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if (nonDecimalWithRadixMatch) {var radix = { "0b": 2, "0o": 8, "0x": 16 }[nonDecimalWithRadixMatch[1]],integerPart = nonDecimalWithRadixMatch[2],fractionalPart = nonDecimalWithRadixMatch[3];return { input: input, radix: radix, integerPart: integerPart, fractionalPart: fractionalPart };}return null;}function makeNumberFromNonDecimalParts(parts) {for (var digitValue, n = parseInt(parts.integerPart, parts.radix), f = 0, i = 0; i < parts.fractionalPart.length; i++) digitValue = parseInt(parts.fractionalPart[i], parts.radix), f += digitValue / Math.pow(parts.radix, i + 1);var result = n + f;if (isNaN(result)) throw new SyntaxError("String \"" + parts.input + "\" is no valid number");return result;}var createNumber = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,number = typed("number", { "": function () {return 0;}, number: function (x) {return x;}, string: function (x) {if ("NaN" === x) return NaN;var nonDecimalNumberParts = getNonDecimalNumberParts(x);if (nonDecimalNumberParts) return makeNumberFromNonDecimalParts(nonDecimalNumberParts);var size = 0,wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);wordSizeSuffixMatch && (size = +wordSizeSuffixMatch[2], x = wordSizeSuffixMatch[1]);var num = +x;if (isNaN(num)) throw new SyntaxError("String \"" + x + "\" is no valid number");if (wordSizeSuffixMatch) {if (num > Math.pow(2, size) - 1) throw new SyntaxError("String \"".concat(x, "\" is out of range"));num >= Math.pow(2, size - 1) && (num -= Math.pow(2, size));}return num;}, BigNumber: function (x) {return x.toNumber();}, Fraction: function (x) {return x.valueOf();}, Unit: function () {throw new Error("Second argument with valueless unit expected");}, null: function () {return 0;}, "Unit, string | Unit": function (unit, valuelessUnit) {return unit.toNumber(valuelessUnit);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });return number.fromJSON = function (json) {return parseFloat(json.value);}, number;});exports.createNumber = createNumber;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/resultset/ResultSet.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createResultSet = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "ResultSet",dependencies = [],createResultSet = (0, _factory.factory)(name, dependencies, function () {function ResultSet(entries) {if (!(this instanceof ResultSet)) throw new SyntaxError("Constructor must be called with the new operator");this.entries = entries || [];}return ResultSet.prototype.type = "ResultSet", ResultSet.prototype.isResultSet = !0, ResultSet.prototype.valueOf = function () {return this.entries;}, ResultSet.prototype.toString = function () {return "[" + this.entries.join(", ") + "]";}, ResultSet.prototype.toJSON = function () {return { mathjs: "ResultSet", entries: this.entries };}, ResultSet.fromJSON = function (json) {return new ResultSet(json.entries);}, ResultSet;}, { isClass: !0 });exports.createResultSet = createResultSet;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/string.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createString = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),name = "string",dependencies = ["typed"],createString = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "": function () {return "";}, number: _number.format, null: function () {return "null";}, boolean: function (x) {return x + "";}, string: function (x) {return x;}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);}, any: function (x) {return x + "";} });});exports.createString = createString;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/unit/Unit.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUnitClass = void 0;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_extends2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/extends.js")),_defineProperty2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_function = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/function.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),_constants = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/constants.js");function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);enumerableOnly && (symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;})), keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var source, i = 1; i < arguments.length; i++) source = null == arguments[i] ? {} : arguments[i], i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {(0, _defineProperty2["default"])(target, key, source[key]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});return target;}var name = "Unit",dependencies = ["?on", "config", "addScalar", "subtract", "multiplyScalar", "divideScalar", "pow", "abs", "fix", "round", "equal", "isNumeric", "format", "number", "Complex", "BigNumber", "Fraction"],createUnitClass = (0, _factory.factory)("Unit", dependencies, function (_ref) {function Unit(value, name) {if (!(this instanceof Unit)) throw new Error("Constructor must be called with the new operator");if (!(null === value || void 0 === value || isNumeric(value) || (0, _is.isComplex)(value))) throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if (void 0 !== name && ("string" != typeof name || "" === name)) throw new TypeError("Second parameter in Unit constructor must be a string");if (void 0 !== name) {var u = Unit.parse(name);this.units = u.units, this.dimensions = u.dimensions;} else {this.units = [{ unit: UNIT_NONE, prefix: PREFIXES.NONE, power: 0 }], this.dimensions = [];for (var i = 0; i < BASE_DIMENSIONS.length; i++) this.dimensions[i] = 0;}this.value = void 0 !== value && null !== value ? this._normalize(value) : null, this.fixPrefix = !1, this.skipAutomaticSimplification = !0;}function skipWhitespace() {for (; " " === c || "\t" === c;) next();}function isDigitDot(c) {return "0" <= c && "9" >= c || "." === c;}function isDigit(c) {return "0" <= c && "9" >= c;}function next() {index++, c = text.charAt(index);}function revert(oldIndex) {index = oldIndex, c = text.charAt(index);}function parseNumber() {var number = "",oldIndex = index;if ("+" === c ? next() : "-" === c && (number += c, next()), !isDigitDot(c)) return revert(oldIndex), null;if ("." !== c) {for (; isDigit(c);) number += c, next();"." === c && (number += c, next());} else if (number += c, next(), !isDigit(c)) return revert(oldIndex), null;for (; isDigit(c);) number += c, next();if ("E" === c || "e" === c) {var tentativeNumber = "",tentativeIndex = index;if (tentativeNumber += c, next(), ("+" === c || "-" === c) && (tentativeNumber += c, next()), !isDigit(c)) return revert(tentativeIndex), number;for (number += tentativeNumber; isDigit(c);) number += c, next();}return number;}function parseUnit() {for (var unitName = ""; isDigit(c) || Unit.isValidAlpha(c);) unitName += c, next();var firstC = unitName.charAt(0);return Unit.isValidAlpha(firstC) ? unitName : null;}function parseCharacter(toFind) {return c === toFind ? (next(), toFind) : null;}function getNumericIfUnitless(unit) {return unit.equalBase(BASE_UNITS.NONE) && null !== unit.value && !config.predictable ? unit.value : unit;}function calculateAngleValues(config) {if ("BigNumber" === config.number) {var pi = (0, _constants.createBigNumberPi)(_BigNumber);UNITS.rad.value = new _BigNumber(1), UNITS.deg.value = pi.div(180), UNITS.grad.value = pi.div(200), UNITS.cycle.value = pi.times(2), UNITS.arcsec.value = pi.div(648e3), UNITS.arcmin.value = pi.div(10800);} else UNITS.rad.value = 1, UNITS.deg.value = Math.PI / 180, UNITS.grad.value = Math.PI / 200, UNITS.cycle.value = 2 * Math.PI, UNITS.arcsec.value = Math.PI / 648e3, UNITS.arcmin.value = Math.PI / 10800;UNITS.radian.value = UNITS.rad.value, UNITS.degree.value = UNITS.deg.value, UNITS.gradian.value = UNITS.grad.value;}function assertUnitNameIsValid(name) {for (var i = 0; i < name.length; i++) {if (c = name.charAt(i), 0 == i && !Unit.isValidAlpha(c)) throw new Error("Invalid unit name (must begin with alpha character): \"" + name + "\"");if (0 < i && !(Unit.isValidAlpha(c) || isDigit(c))) throw new Error("Invalid unit name (only alphanumeric characters are allowed): \"" + name + "\"");}}var on = _ref.on,config = _ref.config,addScalar = _ref.addScalar,subtract = _ref.subtract,multiplyScalar = _ref.multiplyScalar,divideScalar = _ref.divideScalar,pow = _ref.pow,abs = _ref.abs,fix = _ref.fix,round = _ref.round,equal = _ref.equal,isNumeric = _ref.isNumeric,format = _ref.format,number = _ref.number,Complex = _ref.Complex,_BigNumber = _ref.BigNumber,_Fraction = _ref.Fraction;Unit.prototype.type = "Unit", Unit.prototype.isUnit = !0;var text, index, c;Unit.parse = function (str, options) {if (options = options || {}, text = str, index = -1, c = "", "string" != typeof text) throw new TypeError("Invalid argument in Unit.parse, string expected");var unit = new Unit();unit.units = [];var powerMultiplierCurrent = 1,expectingUnit = !1;next(), skipWhitespace();var valueStr = parseNumber(),value = null;if (valueStr) {if ("BigNumber" === config.number) value = new _BigNumber(valueStr);else if ("Fraction" === config.number) try {value = new _Fraction(valueStr);} catch (err) {value = parseFloat(valueStr);} else value = parseFloat(valueStr);skipWhitespace(), parseCharacter("*") ? (powerMultiplierCurrent = 1, expectingUnit = !0) : parseCharacter("/") && (powerMultiplierCurrent = -1, expectingUnit = !0);}for (var powerMultiplierStack = [], powerMultiplierStackProduct = 1; !0;) {for (skipWhitespace(); "(" === c;) powerMultiplierStack.push(powerMultiplierCurrent), powerMultiplierStackProduct *= powerMultiplierCurrent, powerMultiplierCurrent = 1, next(), skipWhitespace();var uStr = void 0;if (c) {var oldC = c;if (uStr = parseUnit(), null === uStr) throw new SyntaxError("Unexpected \"" + oldC + "\" in \"" + text + "\" at index " + index.toString());} else break;var res = _findUnit(uStr);if (null === res) throw new SyntaxError("Unit \"" + uStr + "\" not found.");var power = powerMultiplierCurrent * powerMultiplierStackProduct;if (skipWhitespace(), parseCharacter("^")) {skipWhitespace();var p = parseNumber();if (null === p) throw new SyntaxError("In \"" + str + "\", \"^\" must be followed by a floating-point number");power *= p;}unit.units.push({ unit: res.unit, prefix: res.prefix, power: power });for (var i = 0; i < BASE_DIMENSIONS.length; i++) unit.dimensions[i] += (res.unit.dimensions[i] || 0) * power;for (skipWhitespace(); ")" === c;) {if (0 === powerMultiplierStack.length) throw new SyntaxError("Unmatched \")\" in \"" + text + "\" at index " + index.toString());powerMultiplierStackProduct /= powerMultiplierStack.pop(), next(), skipWhitespace();}if (expectingUnit = !1, parseCharacter("*") ? (powerMultiplierCurrent = 1, expectingUnit = !0) : parseCharacter("/") ? (powerMultiplierCurrent = -1, expectingUnit = !0) : powerMultiplierCurrent = 1, res.unit.base) {var baseDim = res.unit.base.key;UNIT_SYSTEMS.auto[baseDim] = { unit: res.unit, prefix: res.prefix };}}if (skipWhitespace(), c) throw new SyntaxError("Could not parse: \"" + str + "\"");if (expectingUnit) throw new SyntaxError("Trailing characters: \"" + str + "\"");if (0 !== powerMultiplierStack.length) throw new SyntaxError("Unmatched \"(\" in \"" + text + "\"");if (0 === unit.units.length && !options.allowNoUnits) throw new SyntaxError("\"" + str + "\" contains no units");return unit.value = void 0 === value ? null : unit._normalize(value), unit;}, Unit.prototype.clone = function () {var unit = new Unit();unit.fixPrefix = this.fixPrefix, unit.skipAutomaticSimplification = this.skipAutomaticSimplification, unit.value = (0, _object.clone)(this.value), unit.dimensions = this.dimensions.slice(0), unit.units = [];for (var i = 0; i < this.units.length; i++) for (var p in unit.units[i] = {}, this.units[i]) (0, _object.hasOwnProperty)(this.units[i], p) && (unit.units[i][p] = this.units[i][p]);return unit;}, Unit.prototype._isDerived = function () {return 0 !== this.units.length && (1 < this.units.length || 1e-15 < Math.abs(this.units[0].power - 1));}, Unit.prototype._normalize = function (value) {var unitValue, unitOffset, unitPower, unitPrefixValue, convert;if (null === value || void 0 === value || 0 === this.units.length) return value;if (this._isDerived()) {var res = value;convert = Unit._getNumberConverter((0, _is.typeOf)(value));for (var i = 0; i < this.units.length; i++) unitValue = convert(this.units[i].unit.value), unitPrefixValue = convert(this.units[i].prefix.value), unitPower = convert(this.units[i].power), res = multiplyScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));return res;}return convert = Unit._getNumberConverter((0, _is.typeOf)(value)), unitValue = convert(this.units[0].unit.value), unitOffset = convert(this.units[0].unit.offset), unitPrefixValue = convert(this.units[0].prefix.value), multiplyScalar(addScalar(value, unitOffset), multiplyScalar(unitValue, unitPrefixValue));}, Unit.prototype._denormalize = function (value, prefixValue) {var unitValue, unitOffset, unitPower, unitPrefixValue, convert;if (null === value || void 0 === value || 0 === this.units.length) return value;if (this._isDerived()) {var res = value;convert = Unit._getNumberConverter((0, _is.typeOf)(value));for (var i = 0; i < this.units.length; i++) unitValue = convert(this.units[i].unit.value), unitPrefixValue = convert(this.units[i].prefix.value), unitPower = convert(this.units[i].power), res = divideScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));return res;}return convert = Unit._getNumberConverter((0, _is.typeOf)(value)), unitValue = convert(this.units[0].unit.value), unitPrefixValue = convert(this.units[0].prefix.value), unitOffset = convert(this.units[0].unit.offset), void 0 === prefixValue || null === prefixValue ? subtract(divideScalar(divideScalar(value, unitValue), unitPrefixValue), unitOffset) : subtract(divideScalar(divideScalar(value, unitValue), prefixValue), unitOffset);};var _findUnit = (0, _function.memoize)(function (str) {if ((0, _object.hasOwnProperty)(UNITS, str)) {var unit = UNITS[str],prefix = unit.prefixes[""];return { unit: unit, prefix: prefix };}for (var _name in UNITS) if ((0, _object.hasOwnProperty)(UNITS, _name) && (0, _string.endsWith)(str, _name)) {var _unit = UNITS[_name],prefixLen = str.length - _name.length,prefixName = str.substring(0, prefixLen),_prefix = (0, _object.hasOwnProperty)(_unit.prefixes, prefixName) ? _unit.prefixes[prefixName] : void 0;if (void 0 !== _prefix) return { unit: _unit, prefix: _prefix };}return null;}, { hasher: function hasher(args) {return args[0];}, limit: 100 });Unit.isValuelessUnit = function (name) {return null !== _findUnit(name);}, Unit.prototype.hasBase = function (base) {if ("string" == typeof base && (base = BASE_UNITS[base]), !base) return !1;for (var i = 0; i < BASE_DIMENSIONS.length; i++) if (1e-12 < Math.abs((this.dimensions[i] || 0) - (base.dimensions[i] || 0))) return !1;return !0;}, Unit.prototype.equalBase = function (other) {for (var i = 0; i < BASE_DIMENSIONS.length; i++) if (1e-12 < Math.abs((this.dimensions[i] || 0) - (other.dimensions[i] || 0))) return !1;return !0;}, Unit.prototype.equals = function (other) {return this.equalBase(other) && equal(this.value, other.value);}, Unit.prototype.multiply = function (other) {for (var res = this.clone(), i = 0; i < BASE_DIMENSIONS.length; i++) res.dimensions[i] = (this.dimensions[i] || 0) + (other.dimensions[i] || 0);for (var inverted, _i = 0; _i < other.units.length; _i++) inverted = _objectSpread({}, other.units[_i]), res.units.push(inverted);if (null !== this.value || null !== other.value) {var valThis = null === this.value ? this._normalize(1) : this.value,valOther = null === other.value ? other._normalize(1) : other.value;res.value = multiplyScalar(valThis, valOther);} else res.value = null;return res.skipAutomaticSimplification = !1, getNumericIfUnitless(res);}, Unit.prototype.divide = function (other) {for (var res = this.clone(), i = 0; i < BASE_DIMENSIONS.length; i++) res.dimensions[i] = (this.dimensions[i] || 0) - (other.dimensions[i] || 0);for (var inverted, _i2 = 0; _i2 < other.units.length; _i2++) inverted = _objectSpread(_objectSpread({}, other.units[_i2]), {}, { power: -other.units[_i2].power }), res.units.push(inverted);if (null !== this.value || null !== other.value) {var valThis = null === this.value ? this._normalize(1) : this.value,valOther = null === other.value ? other._normalize(1) : other.value;res.value = divideScalar(valThis, valOther);} else res.value = null;return res.skipAutomaticSimplification = !1, getNumericIfUnitless(res);}, Unit.prototype.pow = function (p) {for (var res = this.clone(), i = 0; i < BASE_DIMENSIONS.length; i++) res.dimensions[i] = (this.dimensions[i] || 0) * p;for (var _i3 = 0; _i3 < res.units.length; _i3++) res.units[_i3].power *= p;return res.value = null === res.value ? null : pow(res.value, p), res.skipAutomaticSimplification = !1, getNumericIfUnitless(res);}, Unit.prototype.abs = function () {var ret = this.clone();for (var i in ret.value = null === ret.value ? null : abs(ret.value), ret.units) ("VA" === ret.units[i].unit.name || "VAR" === ret.units[i].unit.name) && (ret.units[i].unit = UNITS.W);return ret;}, Unit.prototype.to = function (valuelessUnit) {var other,value = null === this.value ? this._normalize(1) : this.value;if ("string" == typeof valuelessUnit) {if (other = Unit.parse(valuelessUnit), !this.equalBase(other)) throw new Error("Units do not match ('".concat(other.toString(), "' != '").concat(this.toString(), "')"));if (null !== other.value) throw new Error("Cannot convert to a unit with a value");return other.value = (0, _object.clone)(value), other.fixPrefix = !0, other.skipAutomaticSimplification = !0, other;}if ((0, _is.isUnit)(valuelessUnit)) {if (!this.equalBase(valuelessUnit)) throw new Error("Units do not match ('".concat(valuelessUnit.toString(), "' != '").concat(this.toString(), "')"));if (null !== valuelessUnit.value) throw new Error("Cannot convert to a unit with a value");return other = valuelessUnit.clone(), other.value = (0, _object.clone)(value), other.fixPrefix = !0, other.skipAutomaticSimplification = !0, other;}throw new Error("String or Unit expected as parameter");}, Unit.prototype.toNumber = function (valuelessUnit) {return number(this.toNumeric(valuelessUnit));}, Unit.prototype.toNumeric = function (valuelessUnit) {var other;return other = valuelessUnit ? this.to(valuelessUnit) : this.clone(), other._isDerived() || 0 === other.units.length ? other._denormalize(other.value) : other._denormalize(other.value, other.units[0].prefix.value);}, Unit.prototype.toString = function () {return this.format();}, Unit.prototype.toJSON = function () {return { mathjs: "Unit", value: this._denormalize(this.value), unit: this.formatUnits(), fixPrefix: this.fixPrefix };}, Unit.fromJSON = function (json) {var unit = new Unit(json.value, json.unit);return unit.fixPrefix = json.fixPrefix || !1, unit;}, Unit.prototype.valueOf = Unit.prototype.toString, Unit.prototype.simplify = function () {var matchingBase,ret = this.clone(),proposedUnitList = [];for (var key in currentUnitSystem) if ((0, _object.hasOwnProperty)(currentUnitSystem, key) && ret.hasBase(BASE_UNITS[key])) {matchingBase = key;break;}if ("NONE" === matchingBase) ret.units = [];else {var matchingUnit;if (matchingBase && (0, _object.hasOwnProperty)(currentUnitSystem, matchingBase) && (matchingUnit = currentUnitSystem[matchingBase]), matchingUnit) ret.units = [{ unit: matchingUnit.unit, prefix: matchingUnit.prefix, power: 1 }];else {for (var baseDim, missingBaseDim = !1, i = 0; i < BASE_DIMENSIONS.length; i++) baseDim = BASE_DIMENSIONS[i], 1e-12 < Math.abs(ret.dimensions[i] || 0) && ((0, _object.hasOwnProperty)(currentUnitSystem, baseDim) ? proposedUnitList.push({ unit: currentUnitSystem[baseDim].unit, prefix: currentUnitSystem[baseDim].prefix, power: ret.dimensions[i] || 0 }) : missingBaseDim = !0);proposedUnitList.length < ret.units.length && !missingBaseDim && (ret.units = proposedUnitList);}}return ret;}, Unit.prototype.toSI = function () {for (var baseDim, ret = this.clone(), proposedUnitList = [], i = 0; i < BASE_DIMENSIONS.length; i++) if (baseDim = BASE_DIMENSIONS[i], 1e-12 < Math.abs(ret.dimensions[i] || 0)) if ((0, _object.hasOwnProperty)(UNIT_SYSTEMS.si, baseDim)) proposedUnitList.push({ unit: UNIT_SYSTEMS.si[baseDim].unit, prefix: UNIT_SYSTEMS.si[baseDim].prefix, power: ret.dimensions[i] || 0 });else throw new Error("Cannot express custom unit " + baseDim + " in SI units");return ret.units = proposedUnitList, ret.fixPrefix = !0, ret.skipAutomaticSimplification = !0, ret;}, Unit.prototype.formatUnits = function () {for (var strNum = "", strDen = "", nNum = 0, nDen = 0, i = 0; i < this.units.length; i++) 0 < this.units[i].power ? (nNum++, strNum += " " + this.units[i].prefix.name + this.units[i].unit.name, 1e-15 < Math.abs(this.units[i].power - 1) && (strNum += "^" + this.units[i].power)) : 0 > this.units[i].power && nDen++;if (0 < nDen) for (var _i4 = 0; _i4 < this.units.length; _i4++) 0 > this.units[_i4].power && (0 < nNum ? (strDen += " " + this.units[_i4].prefix.name + this.units[_i4].unit.name, 1e-15 < Math.abs(this.units[_i4].power + 1) && (strDen += "^" + -this.units[_i4].power)) : (strDen += " " + this.units[_i4].prefix.name + this.units[_i4].unit.name, strDen += "^" + this.units[_i4].power));strNum = strNum.substr(1), strDen = strDen.substr(1), 1 < nNum && 0 < nDen && (strNum = "(" + strNum + ")"), 1 < nDen && 0 < nNum && (strDen = "(" + strDen + ")");var str = strNum;return 0 < nNum && 0 < nDen && (str += " / "), str += strDen, str;}, Unit.prototype.format = function (options) {var simp = this.skipAutomaticSimplification || null === this.value ? this.clone() : this.simplify(),isImaginary = !1;for (var i in "undefined" != typeof simp.value && null !== simp.value && (0, _is.isComplex)(simp.value) && (isImaginary = 1e-14 > Math.abs(simp.value.re)), simp.units) (0, _object.hasOwnProperty)(simp.units, i) && simp.units[i].unit && ("VA" === simp.units[i].unit.name && isImaginary ? simp.units[i].unit = UNITS.VAR : "VAR" === simp.units[i].unit.name && !isImaginary && (simp.units[i].unit = UNITS.VA));1 === simp.units.length && !simp.fixPrefix && 1e-14 > Math.abs(simp.units[0].power - Math.round(simp.units[0].power)) && (simp.units[0].prefix = simp._bestPrefix());var value = simp._denormalize(simp.value),str = null === simp.value ? "" : format(value, options || {}),unitStr = simp.formatUnits();return simp.value && (0, _is.isComplex)(simp.value) && (str = "(" + str + ")"), 0 < unitStr.length && 0 < str.length && (str += " "), str += unitStr, str;}, Unit.prototype._bestPrefix = function () {if (1 !== this.units.length) throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if (1e-14 <= Math.abs(this.units[0].power - Math.round(this.units[0].power))) throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var absValue = null === this.value ? 0 : abs(this.value),absUnitValue = abs(this.units[0].unit.value),bestPrefix = this.units[0].prefix;if (0 === absValue) return bestPrefix;var power = this.units[0].power,bestDiff = Math.log(absValue / Math.pow(bestPrefix.value * absUnitValue, power)) / Math.LN10 - 1.2;if (-2.200001 < bestDiff && 1.800001 > bestDiff) return bestPrefix;bestDiff = Math.abs(bestDiff);var prefixes = this.units[0].unit.prefixes;for (var p in prefixes) if ((0, _object.hasOwnProperty)(prefixes, p)) {var prefix = prefixes[p];if (prefix.scientific) {var diff = Math.abs(Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2);(diff < bestDiff || diff === bestDiff && prefix.name.length < bestPrefix.name.length) && (bestPrefix = prefix, bestDiff = diff);}}return bestPrefix;}, Unit.prototype.splitUnit = function (parts) {for (var x = this.clone(), ret = [], i = 0; i < parts.length && (x = x.to(parts[i]), i != parts.length - 1); i++) {var xNumeric = x.toNumeric(),xRounded = round(xNumeric),xFixed = void 0,isNearlyEqual = equal(xRounded, xNumeric);xFixed = isNearlyEqual ? xRounded : fix(x.toNumeric());var y = new Unit(xFixed, parts[i].toString());ret.push(y), x = subtract(x, y);}for (var testSum = 0, _i5 = 0; _i5 < ret.length; _i5++) testSum = addScalar(testSum, ret[_i5].value);return equal(testSum, this.value) && (x.value = 0), ret.push(x), ret;};var PREFIXES = { NONE: { "": { name: "", value: 1, scientific: !0 } }, SHORT: { "": { name: "", value: 1, scientific: !0 }, da: { name: "da", value: 10, scientific: !1 }, h: { name: "h", value: 100, scientific: !1 }, k: { name: "k", value: 1e3, scientific: !0 }, M: { name: "M", value: 1e6, scientific: !0 }, G: { name: "G", value: 1e9, scientific: !0 }, T: { name: "T", value: 1e12, scientific: !0 }, P: { name: "P", value: 1e15, scientific: !0 }, E: { name: "E", value: 1e18, scientific: !0 }, Z: { name: "Z", value: 1e21, scientific: !0 }, Y: { name: "Y", value: 1e24, scientific: !0 }, d: { name: "d", value: .1, scientific: !1 }, c: { name: "c", value: .01, scientific: !1 }, m: { name: "m", value: 1e-3, scientific: !0 }, u: { name: "u", value: 1e-6, scientific: !0 }, n: { name: "n", value: 1e-9, scientific: !0 }, p: { name: "p", value: 1e-12, scientific: !0 }, f: { name: "f", value: 1e-15, scientific: !0 }, a: { name: "a", value: 1e-18, scientific: !0 }, z: { name: "z", value: 1e-21, scientific: !0 }, y: { name: "y", value: 1e-24, scientific: !0 } }, LONG: { "": { name: "", value: 1, scientific: !0 }, deca: { name: "deca", value: 10, scientific: !1 }, hecto: { name: "hecto", value: 100, scientific: !1 }, kilo: { name: "kilo", value: 1e3, scientific: !0 }, mega: { name: "mega", value: 1e6, scientific: !0 }, giga: { name: "giga", value: 1e9, scientific: !0 }, tera: { name: "tera", value: 1e12, scientific: !0 }, peta: { name: "peta", value: 1e15, scientific: !0 }, exa: { name: "exa", value: 1e18, scientific: !0 }, zetta: { name: "zetta", value: 1e21, scientific: !0 }, yotta: { name: "yotta", value: 1e24, scientific: !0 }, deci: { name: "deci", value: .1, scientific: !1 }, centi: { name: "centi", value: .01, scientific: !1 }, milli: { name: "milli", value: 1e-3, scientific: !0 }, micro: { name: "micro", value: 1e-6, scientific: !0 }, nano: { name: "nano", value: 1e-9, scientific: !0 }, pico: { name: "pico", value: 1e-12, scientific: !0 }, femto: { name: "femto", value: 1e-15, scientific: !0 }, atto: { name: "atto", value: 1e-18, scientific: !0 }, zepto: { name: "zepto", value: 1e-21, scientific: !0 }, yocto: { name: "yocto", value: 1e-24, scientific: !0 } }, SQUARED: { "": { name: "", value: 1, scientific: !0 }, da: { name: "da", value: 100, scientific: !1 }, h: { name: "h", value: 1e4, scientific: !1 }, k: { name: "k", value: 1e6, scientific: !0 }, M: { name: "M", value: 1e12, scientific: !0 }, G: { name: "G", value: 1e18, scientific: !0 }, T: { name: "T", value: 1e24, scientific: !0 }, P: { name: "P", value: 1e30, scientific: !0 }, E: { name: "E", value: 1e36, scientific: !0 }, Z: { name: "Z", value: 1e42, scientific: !0 }, Y: { name: "Y", value: 1e48, scientific: !0 }, d: { name: "d", value: .01, scientific: !1 }, c: { name: "c", value: 1e-4, scientific: !1 }, m: { name: "m", value: 1e-6, scientific: !0 }, u: { name: "u", value: 1e-12, scientific: !0 }, n: { name: "n", value: 1e-18, scientific: !0 }, p: { name: "p", value: 1e-24, scientific: !0 }, f: { name: "f", value: 1e-30, scientific: !0 }, a: { name: "a", value: 1e-36, scientific: !0 }, z: { name: "z", value: 1e-42, scientific: !0 }, y: { name: "y", value: 1e-48, scientific: !0 } }, CUBIC: { "": { name: "", value: 1, scientific: !0 }, da: { name: "da", value: 1e3, scientific: !1 }, h: { name: "h", value: 1e6, scientific: !1 }, k: { name: "k", value: 1e9, scientific: !0 }, M: { name: "M", value: 1e18, scientific: !0 }, G: { name: "G", value: 1e27, scientific: !0 }, T: { name: "T", value: 1e36, scientific: !0 }, P: { name: "P", value: 1e45, scientific: !0 }, E: { name: "E", value: 1e54, scientific: !0 }, Z: { name: "Z", value: 1e63, scientific: !0 }, Y: { name: "Y", value: 1e72, scientific: !0 }, d: { name: "d", value: 1e-3, scientific: !1 }, c: { name: "c", value: 1e-6, scientific: !1 }, m: { name: "m", value: 1e-9, scientific: !0 }, u: { name: "u", value: 1e-18, scientific: !0 }, n: { name: "n", value: 1e-27, scientific: !0 }, p: { name: "p", value: 1e-36, scientific: !0 }, f: { name: "f", value: 1e-45, scientific: !0 }, a: { name: "a", value: 1e-54, scientific: !0 }, z: { name: "z", value: 1e-63, scientific: !0 }, y: { name: "y", value: 1e-72, scientific: !0 } }, BINARY_SHORT_SI: { "": { name: "", value: 1, scientific: !0 }, k: { name: "k", value: 1e3, scientific: !0 }, M: { name: "M", value: 1e6, scientific: !0 }, G: { name: "G", value: 1e9, scientific: !0 }, T: { name: "T", value: 1e12, scientific: !0 }, P: { name: "P", value: 1e15, scientific: !0 }, E: { name: "E", value: 1e18, scientific: !0 }, Z: { name: "Z", value: 1e21, scientific: !0 }, Y: { name: "Y", value: 1e24, scientific: !0 } }, BINARY_SHORT_IEC: { "": { name: "", value: 1, scientific: !0 }, Ki: { name: "Ki", value: 1024, scientific: !0 }, Mi: { name: "Mi", value: Math.pow(1024, 2), scientific: !0 }, Gi: { name: "Gi", value: Math.pow(1024, 3), scientific: !0 }, Ti: { name: "Ti", value: Math.pow(1024, 4), scientific: !0 }, Pi: { name: "Pi", value: Math.pow(1024, 5), scientific: !0 }, Ei: { name: "Ei", value: Math.pow(1024, 6), scientific: !0 }, Zi: { name: "Zi", value: Math.pow(1024, 7), scientific: !0 }, Yi: { name: "Yi", value: Math.pow(1024, 8), scientific: !0 } }, BINARY_LONG_SI: { "": { name: "", value: 1, scientific: !0 }, kilo: { name: "kilo", value: 1e3, scientific: !0 }, mega: { name: "mega", value: 1e6, scientific: !0 }, giga: { name: "giga", value: 1e9, scientific: !0 }, tera: { name: "tera", value: 1e12, scientific: !0 }, peta: { name: "peta", value: 1e15, scientific: !0 }, exa: { name: "exa", value: 1e18, scientific: !0 }, zetta: { name: "zetta", value: 1e21, scientific: !0 }, yotta: { name: "yotta", value: 1e24, scientific: !0 } }, BINARY_LONG_IEC: { "": { name: "", value: 1, scientific: !0 }, kibi: { name: "kibi", value: 1024, scientific: !0 }, mebi: { name: "mebi", value: Math.pow(1024, 2), scientific: !0 }, gibi: { name: "gibi", value: Math.pow(1024, 3), scientific: !0 }, tebi: { name: "tebi", value: Math.pow(1024, 4), scientific: !0 }, pebi: { name: "pebi", value: Math.pow(1024, 5), scientific: !0 }, exi: { name: "exi", value: Math.pow(1024, 6), scientific: !0 }, zebi: { name: "zebi", value: Math.pow(1024, 7), scientific: !0 }, yobi: { name: "yobi", value: Math.pow(1024, 8), scientific: !0 } }, BTU: { "": { name: "", value: 1, scientific: !0 }, MM: { name: "MM", value: 1e6, scientific: !0 } } };PREFIXES.SHORTLONG = (0, _extends2["default"])({}, PREFIXES.SHORT, PREFIXES.LONG), PREFIXES.BINARY_SHORT = (0, _extends2["default"])({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC), PREFIXES.BINARY_LONG = (0, _extends2["default"])({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC);var BASE_DIMENSIONS = ["MASS", "LENGTH", "TIME", "CURRENT", "TEMPERATURE", "LUMINOUS_INTENSITY", "AMOUNT_OF_SUBSTANCE", "ANGLE", "BIT"],BASE_UNITS = { NONE: { dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 0] }, MASS: { dimensions: [1, 0, 0, 0, 0, 0, 0, 0, 0] }, LENGTH: { dimensions: [0, 1, 0, 0, 0, 0, 0, 0, 0] }, TIME: { dimensions: [0, 0, 1, 0, 0, 0, 0, 0, 0] }, CURRENT: { dimensions: [0, 0, 0, 1, 0, 0, 0, 0, 0] }, TEMPERATURE: { dimensions: [0, 0, 0, 0, 1, 0, 0, 0, 0] }, LUMINOUS_INTENSITY: { dimensions: [0, 0, 0, 0, 0, 1, 0, 0, 0] }, AMOUNT_OF_SUBSTANCE: { dimensions: [0, 0, 0, 0, 0, 0, 1, 0, 0] }, FORCE: { dimensions: [1, 1, -2, 0, 0, 0, 0, 0, 0] }, SURFACE: { dimensions: [0, 2, 0, 0, 0, 0, 0, 0, 0] }, VOLUME: { dimensions: [0, 3, 0, 0, 0, 0, 0, 0, 0] }, ENERGY: { dimensions: [1, 2, -2, 0, 0, 0, 0, 0, 0] }, POWER: { dimensions: [1, 2, -3, 0, 0, 0, 0, 0, 0] }, PRESSURE: { dimensions: [1, -1, -2, 0, 0, 0, 0, 0, 0] }, ELECTRIC_CHARGE: { dimensions: [0, 0, 1, 1, 0, 0, 0, 0, 0] }, ELECTRIC_CAPACITANCE: { dimensions: [-1, -2, 4, 2, 0, 0, 0, 0, 0] }, ELECTRIC_POTENTIAL: { dimensions: [1, 2, -3, -1, 0, 0, 0, 0, 0] }, ELECTRIC_RESISTANCE: { dimensions: [1, 2, -3, -2, 0, 0, 0, 0, 0] }, ELECTRIC_INDUCTANCE: { dimensions: [1, 2, -2, -2, 0, 0, 0, 0, 0] }, ELECTRIC_CONDUCTANCE: { dimensions: [-1, -2, 3, 2, 0, 0, 0, 0, 0] }, MAGNETIC_FLUX: { dimensions: [1, 2, -2, -1, 0, 0, 0, 0, 0] }, MAGNETIC_FLUX_DENSITY: { dimensions: [1, 0, -2, -1, 0, 0, 0, 0, 0] }, FREQUENCY: { dimensions: [0, 0, -1, 0, 0, 0, 0, 0, 0] }, ANGLE: { dimensions: [0, 0, 0, 0, 0, 0, 0, 1, 0] }, BIT: { dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 1] } };for (var key in BASE_UNITS) (0, _object.hasOwnProperty)(BASE_UNITS, key) && (BASE_UNITS[key].key = key);var UNIT_NONE = { name: "", base: {}, value: 1, offset: 0, dimensions: BASE_DIMENSIONS.map(function (x) {return 0;}) },UNITS = { meter: { name: "meter", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, inch: { name: "inch", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .0254, offset: 0 }, foot: { name: "foot", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .3048, offset: 0 }, yard: { name: "yard", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .9144, offset: 0 }, mile: { name: "mile", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 1609.344, offset: 0 }, link: { name: "link", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .201168, offset: 0 }, rod: { name: "rod", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 5.0292, offset: 0 }, chain: { name: "chain", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 20.1168, offset: 0 }, angstrom: { name: "angstrom", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 1e-10, offset: 0 }, m: { name: "m", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, in: { name: "in", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .0254, offset: 0 }, ft: { name: "ft", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .3048, offset: 0 }, yd: { name: "yd", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .9144, offset: 0 }, mi: { name: "mi", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 1609.344, offset: 0 }, li: { name: "li", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: .201168, offset: 0 }, rd: { name: "rd", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 5.02921, offset: 0 }, ch: { name: "ch", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 20.1168, offset: 0 }, mil: { name: "mil", base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, value: 254e-7, offset: 0 }, m2: { name: "m2", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.SQUARED, value: 1, offset: 0 }, sqin: { name: "sqin", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 64516e-8, offset: 0 }, sqft: { name: "sqft", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: .09290304, offset: 0 }, sqyd: { name: "sqyd", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: .83612736, offset: 0 }, sqmi: { name: "sqmi", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 2589988.110336, offset: 0 }, sqrd: { name: "sqrd", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 25.29295, offset: 0 }, sqch: { name: "sqch", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 404.6873, offset: 0 }, sqmil: { name: "sqmil", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 64516e-14, offset: 0 }, acre: { name: "acre", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 4046.86, offset: 0 }, hectare: { name: "hectare", base: BASE_UNITS.SURFACE, prefixes: PREFIXES.NONE, value: 1e4, offset: 0 }, m3: { name: "m3", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.CUBIC, value: 1, offset: 0 }, L: { name: "L", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.SHORT, value: .001, offset: 0 }, l: { name: "l", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.SHORT, value: .001, offset: 0 }, litre: { name: "litre", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.LONG, value: .001, offset: 0 }, cuin: { name: "cuin", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 1.6387064e-5, offset: 0 }, cuft: { name: "cuft", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .028316846592, offset: 0 }, cuyd: { name: "cuyd", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .764554857984, offset: 0 }, teaspoon: { name: "teaspoon", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 5e-6, offset: 0 }, tablespoon: { name: "tablespoon", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 15e-6, offset: 0 }, drop: { name: "drop", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 5e-8, offset: 0 }, gtt: { name: "gtt", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 5e-8, offset: 0 }, minim: { name: "minim", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 6.161152e-8, offset: 0 }, fluiddram: { name: "fluiddram", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 36966911e-13, offset: 0 }, fluidounce: { name: "fluidounce", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 2957353e-11, offset: 0 }, gill: { name: "gill", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0001182941, offset: 0 }, cc: { name: "cc", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 1e-6, offset: 0 }, cup: { name: "cup", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0002365882, offset: 0 }, pint: { name: "pint", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0004731765, offset: 0 }, quart: { name: "quart", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0009463529, offset: 0 }, gallon: { name: "gallon", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .003785412, offset: 0 }, beerbarrel: { name: "beerbarrel", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .1173478, offset: 0 }, oilbarrel: { name: "oilbarrel", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .1589873, offset: 0 }, hogshead: { name: "hogshead", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .238481, offset: 0 }, fldr: { name: "fldr", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 36966911e-13, offset: 0 }, floz: { name: "floz", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 2957353e-11, offset: 0 }, gi: { name: "gi", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0001182941, offset: 0 }, cp: { name: "cp", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0002365882, offset: 0 }, pt: { name: "pt", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0004731765, offset: 0 }, qt: { name: "qt", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .0009463529, offset: 0 }, gal: { name: "gal", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .003785412, offset: 0 }, bbl: { name: "bbl", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .1173478, offset: 0 }, obl: { name: "obl", base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: .1589873, offset: 0 }, g: { name: "g", base: BASE_UNITS.MASS, prefixes: PREFIXES.SHORT, value: .001, offset: 0 }, gram: { name: "gram", base: BASE_UNITS.MASS, prefixes: PREFIXES.LONG, value: .001, offset: 0 }, ton: { name: "ton", base: BASE_UNITS.MASS, prefixes: PREFIXES.SHORT, value: 907.18474, offset: 0 }, t: { name: "t", base: BASE_UNITS.MASS, prefixes: PREFIXES.SHORT, value: 1e3, offset: 0 }, tonne: { name: "tonne", base: BASE_UNITS.MASS, prefixes: PREFIXES.LONG, value: 1e3, offset: 0 }, grain: { name: "grain", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 64.79891e-6, offset: 0 }, dram: { name: "dram", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .0017718451953125, offset: 0 }, ounce: { name: "ounce", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .028349523125, offset: 0 }, poundmass: { name: "poundmass", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .45359237, offset: 0 }, hundredweight: { name: "hundredweight", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 45.359237, offset: 0 }, stick: { name: "stick", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .115, offset: 0 }, stone: { name: "stone", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 6.35029318, offset: 0 }, gr: { name: "gr", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 64.79891e-6, offset: 0 }, dr: { name: "dr", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .0017718451953125, offset: 0 }, oz: { name: "oz", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .028349523125, offset: 0 }, lbm: { name: "lbm", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: .45359237, offset: 0 }, cwt: { name: "cwt", base: BASE_UNITS.MASS, prefixes: PREFIXES.NONE, value: 45.359237, offset: 0 }, s: { name: "s", base: BASE_UNITS.TIME, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, min: { name: "min", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 60, offset: 0 }, h: { name: "h", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 3600, offset: 0 }, second: { name: "second", base: BASE_UNITS.TIME, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, sec: { name: "sec", base: BASE_UNITS.TIME, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, minute: { name: "minute", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 60, offset: 0 }, hour: { name: "hour", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 3600, offset: 0 }, day: { name: "day", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 86400, offset: 0 }, week: { name: "week", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 604800, offset: 0 }, month: { name: "month", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 2629800, offset: 0 }, year: { name: "year", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 31557600, offset: 0 }, decade: { name: "decade", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 315576e3, offset: 0 }, century: { name: "century", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 315576e4, offset: 0 }, millennium: { name: "millennium", base: BASE_UNITS.TIME, prefixes: PREFIXES.NONE, value: 315576e5, offset: 0 }, hertz: { name: "Hertz", base: BASE_UNITS.FREQUENCY, prefixes: PREFIXES.LONG, value: 1, offset: 0, reciprocal: !0 }, Hz: { name: "Hz", base: BASE_UNITS.FREQUENCY, prefixes: PREFIXES.SHORT, value: 1, offset: 0, reciprocal: !0 }, rad: { name: "rad", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, radian: { name: "radian", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, deg: { name: "deg", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.SHORT, value: null, offset: 0 }, degree: { name: "degree", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.LONG, value: null, offset: 0 }, grad: { name: "grad", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.SHORT, value: null, offset: 0 }, gradian: { name: "gradian", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.LONG, value: null, offset: 0 }, cycle: { name: "cycle", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.NONE, value: null, offset: 0 }, arcsec: { name: "arcsec", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.NONE, value: null, offset: 0 }, arcmin: { name: "arcmin", base: BASE_UNITS.ANGLE, prefixes: PREFIXES.NONE, value: null, offset: 0 }, A: { name: "A", base: BASE_UNITS.CURRENT, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, ampere: { name: "ampere", base: BASE_UNITS.CURRENT, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, K: { name: "K", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1, offset: 0 }, degC: { name: "degC", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1, offset: 273.15 }, degF: { name: "degF", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1 / 1.8, offset: 459.67 }, degR: { name: "degR", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1 / 1.8, offset: 0 }, kelvin: { name: "kelvin", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1, offset: 0 }, celsius: { name: "celsius", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1, offset: 273.15 }, fahrenheit: { name: "fahrenheit", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1 / 1.8, offset: 459.67 }, rankine: { name: "rankine", base: BASE_UNITS.TEMPERATURE, prefixes: PREFIXES.NONE, value: 1 / 1.8, offset: 0 }, mol: { name: "mol", base: BASE_UNITS.AMOUNT_OF_SUBSTANCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, mole: { name: "mole", base: BASE_UNITS.AMOUNT_OF_SUBSTANCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, cd: { name: "cd", base: BASE_UNITS.LUMINOUS_INTENSITY, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, candela: { name: "candela", base: BASE_UNITS.LUMINOUS_INTENSITY, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, N: { name: "N", base: BASE_UNITS.FORCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, newton: { name: "newton", base: BASE_UNITS.FORCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, dyn: { name: "dyn", base: BASE_UNITS.FORCE, prefixes: PREFIXES.SHORT, value: 1e-5, offset: 0 }, dyne: { name: "dyne", base: BASE_UNITS.FORCE, prefixes: PREFIXES.LONG, value: 1e-5, offset: 0 }, lbf: { name: "lbf", base: BASE_UNITS.FORCE, prefixes: PREFIXES.NONE, value: 4.4482216152605, offset: 0 }, poundforce: { name: "poundforce", base: BASE_UNITS.FORCE, prefixes: PREFIXES.NONE, value: 4.4482216152605, offset: 0 }, kip: { name: "kip", base: BASE_UNITS.FORCE, prefixes: PREFIXES.LONG, value: 4448.2216, offset: 0 }, kilogramforce: { name: "kilogramforce", base: BASE_UNITS.FORCE, prefixes: PREFIXES.NONE, value: 9.80665, offset: 0 }, J: { name: "J", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, joule: { name: "joule", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, erg: { name: "erg", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.NONE, value: 1e-7, offset: 0 }, Wh: { name: "Wh", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.SHORT, value: 3600, offset: 0 }, BTU: { name: "BTU", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.BTU, value: 1055.05585262, offset: 0 }, eV: { name: "eV", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.SHORT, value: 1602176565e-28, offset: 0 }, electronvolt: { name: "electronvolt", base: BASE_UNITS.ENERGY, prefixes: PREFIXES.LONG, value: 1602176565e-28, offset: 0 }, W: { name: "W", base: BASE_UNITS.POWER, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, watt: { name: "watt", base: BASE_UNITS.POWER, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, hp: { name: "hp", base: BASE_UNITS.POWER, prefixes: PREFIXES.NONE, value: 745.6998715386, offset: 0 }, VAR: { name: "VAR", base: BASE_UNITS.POWER, prefixes: PREFIXES.SHORT, value: Complex.I, offset: 0 }, VA: { name: "VA", base: BASE_UNITS.POWER, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, Pa: { name: "Pa", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, psi: { name: "psi", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 6894.75729276459, offset: 0 }, atm: { name: "atm", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 101325, offset: 0 }, bar: { name: "bar", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.SHORTLONG, value: 1e5, offset: 0 }, torr: { name: "torr", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 133.322, offset: 0 }, mmHg: { name: "mmHg", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 133.322, offset: 0 }, mmH2O: { name: "mmH2O", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 9.80665, offset: 0 }, cmH2O: { name: "cmH2O", base: BASE_UNITS.PRESSURE, prefixes: PREFIXES.NONE, value: 98.0665, offset: 0 }, coulomb: { name: "coulomb", base: BASE_UNITS.ELECTRIC_CHARGE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, C: { name: "C", base: BASE_UNITS.ELECTRIC_CHARGE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, farad: { name: "farad", base: BASE_UNITS.ELECTRIC_CAPACITANCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, F: { name: "F", base: BASE_UNITS.ELECTRIC_CAPACITANCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, volt: { name: "volt", base: BASE_UNITS.ELECTRIC_POTENTIAL, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, V: { name: "V", base: BASE_UNITS.ELECTRIC_POTENTIAL, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, ohm: { name: "ohm", base: BASE_UNITS.ELECTRIC_RESISTANCE, prefixes: PREFIXES.SHORTLONG, value: 1, offset: 0 }, henry: { name: "henry", base: BASE_UNITS.ELECTRIC_INDUCTANCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, H: { name: "H", base: BASE_UNITS.ELECTRIC_INDUCTANCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, siemens: { name: "siemens", base: BASE_UNITS.ELECTRIC_CONDUCTANCE, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, S: { name: "S", base: BASE_UNITS.ELECTRIC_CONDUCTANCE, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, weber: { name: "weber", base: BASE_UNITS.MAGNETIC_FLUX, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, Wb: { name: "Wb", base: BASE_UNITS.MAGNETIC_FLUX, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, tesla: { name: "tesla", base: BASE_UNITS.MAGNETIC_FLUX_DENSITY, prefixes: PREFIXES.LONG, value: 1, offset: 0 }, T: { name: "T", base: BASE_UNITS.MAGNETIC_FLUX_DENSITY, prefixes: PREFIXES.SHORT, value: 1, offset: 0 }, b: { name: "b", base: BASE_UNITS.BIT, prefixes: PREFIXES.BINARY_SHORT, value: 1, offset: 0 }, bits: { name: "bits", base: BASE_UNITS.BIT, prefixes: PREFIXES.BINARY_LONG, value: 1, offset: 0 }, B: { name: "B", base: BASE_UNITS.BIT, prefixes: PREFIXES.BINARY_SHORT, value: 8, offset: 0 }, bytes: { name: "bytes", base: BASE_UNITS.BIT, prefixes: PREFIXES.BINARY_LONG, value: 8, offset: 0 } },ALIASES = { meters: "meter", inches: "inch", feet: "foot", yards: "yard", miles: "mile", links: "link", rods: "rod", chains: "chain", angstroms: "angstrom", lt: "l", litres: "litre", liter: "litre", liters: "litre", teaspoons: "teaspoon", tablespoons: "tablespoon", minims: "minim", fluiddrams: "fluiddram", fluidounces: "fluidounce", gills: "gill", cups: "cup", pints: "pint", quarts: "quart", gallons: "gallon", beerbarrels: "beerbarrel", oilbarrels: "oilbarrel", hogsheads: "hogshead", gtts: "gtt", grams: "gram", tons: "ton", tonnes: "tonne", grains: "grain", drams: "dram", ounces: "ounce", poundmasses: "poundmass", hundredweights: "hundredweight", sticks: "stick", lb: "lbm", lbs: "lbm", kips: "kip", kgf: "kilogramforce", acres: "acre", hectares: "hectare", sqfeet: "sqft", sqyard: "sqyd", sqmile: "sqmi", sqmiles: "sqmi", mmhg: "mmHg", mmh2o: "mmH2O", cmh2o: "cmH2O", seconds: "second", secs: "second", minutes: "minute", mins: "minute", hours: "hour", hr: "hour", hrs: "hour", days: "day", weeks: "week", months: "month", years: "year", decades: "decade", centuries: "century", millennia: "millennium", hertz: "hertz", radians: "radian", degrees: "degree", gradians: "gradian", cycles: "cycle", arcsecond: "arcsec", arcseconds: "arcsec", arcminute: "arcmin", arcminutes: "arcmin", BTUs: "BTU", watts: "watt", joules: "joule", amperes: "ampere", coulombs: "coulomb", volts: "volt", ohms: "ohm", farads: "farad", webers: "weber", teslas: "tesla", electronvolts: "electronvolt", moles: "mole", bit: "bits", byte: "bytes" };calculateAngleValues(config), on && on("config", function (curr, prev) {curr.number !== prev.number && calculateAngleValues(curr);});var UNIT_SYSTEMS = { si: { NONE: { unit: UNIT_NONE, prefix: PREFIXES.NONE[""] }, LENGTH: { unit: UNITS.m, prefix: PREFIXES.SHORT[""] }, MASS: { unit: UNITS.g, prefix: PREFIXES.SHORT.k }, TIME: { unit: UNITS.s, prefix: PREFIXES.SHORT[""] }, CURRENT: { unit: UNITS.A, prefix: PREFIXES.SHORT[""] }, TEMPERATURE: { unit: UNITS.K, prefix: PREFIXES.SHORT[""] }, LUMINOUS_INTENSITY: { unit: UNITS.cd, prefix: PREFIXES.SHORT[""] }, AMOUNT_OF_SUBSTANCE: { unit: UNITS.mol, prefix: PREFIXES.SHORT[""] }, ANGLE: { unit: UNITS.rad, prefix: PREFIXES.SHORT[""] }, BIT: { unit: UNITS.bits, prefix: PREFIXES.SHORT[""] }, FORCE: { unit: UNITS.N, prefix: PREFIXES.SHORT[""] }, ENERGY: { unit: UNITS.J, prefix: PREFIXES.SHORT[""] }, POWER: { unit: UNITS.W, prefix: PREFIXES.SHORT[""] }, PRESSURE: { unit: UNITS.Pa, prefix: PREFIXES.SHORT[""] }, ELECTRIC_CHARGE: { unit: UNITS.C, prefix: PREFIXES.SHORT[""] }, ELECTRIC_CAPACITANCE: { unit: UNITS.F, prefix: PREFIXES.SHORT[""] }, ELECTRIC_POTENTIAL: { unit: UNITS.V, prefix: PREFIXES.SHORT[""] }, ELECTRIC_RESISTANCE: { unit: UNITS.ohm, prefix: PREFIXES.SHORT[""] }, ELECTRIC_INDUCTANCE: { unit: UNITS.H, prefix: PREFIXES.SHORT[""] }, ELECTRIC_CONDUCTANCE: { unit: UNITS.S, prefix: PREFIXES.SHORT[""] }, MAGNETIC_FLUX: { unit: UNITS.Wb, prefix: PREFIXES.SHORT[""] }, MAGNETIC_FLUX_DENSITY: { unit: UNITS.T, prefix: PREFIXES.SHORT[""] }, FREQUENCY: { unit: UNITS.Hz, prefix: PREFIXES.SHORT[""] } } };UNIT_SYSTEMS.cgs = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)), UNIT_SYSTEMS.cgs.LENGTH = { unit: UNITS.m, prefix: PREFIXES.SHORT.c }, UNIT_SYSTEMS.cgs.MASS = { unit: UNITS.g, prefix: PREFIXES.SHORT[""] }, UNIT_SYSTEMS.cgs.FORCE = { unit: UNITS.dyn, prefix: PREFIXES.SHORT[""] }, UNIT_SYSTEMS.cgs.ENERGY = { unit: UNITS.erg, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si)), UNIT_SYSTEMS.us.LENGTH = { unit: UNITS.ft, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.MASS = { unit: UNITS.lbm, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.TEMPERATURE = { unit: UNITS.degF, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.FORCE = { unit: UNITS.lbf, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.ENERGY = { unit: UNITS.BTU, prefix: PREFIXES.BTU[""] }, UNIT_SYSTEMS.us.POWER = { unit: UNITS.hp, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.us.PRESSURE = { unit: UNITS.psi, prefix: PREFIXES.NONE[""] }, UNIT_SYSTEMS.auto = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));var currentUnitSystem = UNIT_SYSTEMS.auto;for (var _key2 in Unit.setUnitSystem = function (name) {if ((0, _object.hasOwnProperty)(UNIT_SYSTEMS, name)) currentUnitSystem = UNIT_SYSTEMS[name];else throw new Error("Unit system " + name + " does not exist. Choices are: " + Object.keys(UNIT_SYSTEMS).join(", "));}, Unit.getUnitSystem = function () {for (var _key in UNIT_SYSTEMS) if ((0, _object.hasOwnProperty)(UNIT_SYSTEMS, _key) && UNIT_SYSTEMS[_key] === currentUnitSystem) return _key;}, Unit.typeConverters = { BigNumber: function BigNumber(x) {return new _BigNumber(x + "");}, Fraction: function Fraction(x) {return new _Fraction(x);}, Complex: function Complex(x) {return x;}, number: function number(x) {return x;} }, Unit._getNumberConverter = function (type) {if (!Unit.typeConverters[type]) throw new TypeError("Unsupported type \"" + type + "\"");return Unit.typeConverters[type];}, UNITS) if ((0, _object.hasOwnProperty)(UNITS, _key2)) {var unit = UNITS[_key2];unit.dimensions = unit.base.dimensions;}for (var _name2 in ALIASES) if ((0, _object.hasOwnProperty)(ALIASES, _name2)) {var _unit2 = UNITS[ALIASES[_name2]],alias = {};for (var _key3 in _unit2) (0, _object.hasOwnProperty)(_unit2, _key3) && (alias[_key3] = _unit2[_key3]);alias.name = _name2, UNITS[_name2] = alias;}return Unit.isValidAlpha = function isValidAlpha(c) {return /^[a-zA-Z]$/.test(c);}, Unit.createUnit = function (obj, options) {if ("object" !== (0, _typeof2["default"])(obj)) throw new TypeError("createUnit expects first parameter to be of type 'Object'");if (options && options.override) for (var _key4 in obj) if ((0, _object.hasOwnProperty)(obj, _key4) && Unit.deleteUnit(_key4), obj[_key4].aliases) for (var i = 0; i < obj[_key4].aliases.length; i++) Unit.deleteUnit(obj[_key4].aliases[i]);var lastUnit;for (var _key5 in obj) (0, _object.hasOwnProperty)(obj, _key5) && (lastUnit = Unit.createUnitSingle(_key5, obj[_key5]));return lastUnit;}, Unit.createUnitSingle = function (name, obj, options) {if (("undefined" == typeof obj || null === obj) && (obj = {}), "string" != typeof name) throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if ((0, _object.hasOwnProperty)(UNITS, name)) throw new Error("Cannot create unit \"" + name + "\": a unit with that name already exists");assertUnitNameIsValid(name);var definition,prefixes,baseName,defUnit = null,aliases = [],offset = 0;if (obj && "Unit" === obj.type) defUnit = obj.clone();else if ("string" == typeof obj) "" != obj && (definition = obj);else if ("object" === (0, _typeof2["default"])(obj)) definition = obj.definition, prefixes = obj.prefixes, offset = obj.offset, baseName = obj.baseName, obj.aliases && (aliases = obj.aliases.valueOf());else throw new TypeError("Cannot create unit \"" + name + "\" from \"" + obj.toString() + "\": expecting \"string\" or \"Unit\" or \"Object\"");if (aliases) for (var i = 0; i < aliases.length; i++) if ((0, _object.hasOwnProperty)(UNITS, aliases[i])) throw new Error("Cannot create alias \"" + aliases[i] + "\": a unit with that name already exists");if (definition && "string" == typeof definition && !defUnit) try {defUnit = Unit.parse(definition, { allowNoUnits: !0 });} catch (ex) {throw ex.message = "Could not create unit \"" + name + "\" from \"" + definition + "\": " + ex.message, ex;} else definition && "Unit" === definition.type && (defUnit = definition.clone());aliases = aliases || [], offset = offset || 0, prefixes = prefixes && prefixes.toUpperCase ? PREFIXES[prefixes.toUpperCase()] || PREFIXES.NONE : PREFIXES.NONE;var newUnit = {};if (!defUnit) {if (baseName = baseName || name + "_STUFF", 0 <= BASE_DIMENSIONS.indexOf(baseName)) throw new Error("Cannot create new base unit \"" + name + "\": a base unit with that name already exists (and cannot be overridden)");for (var b in BASE_DIMENSIONS.push(baseName), BASE_UNITS) (0, _object.hasOwnProperty)(BASE_UNITS, b) && (BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0);for (var newBaseUnit = { dimensions: [] }, _i6 = 0; _i6 < BASE_DIMENSIONS.length; _i6++) newBaseUnit.dimensions[_i6] = 0;newBaseUnit.dimensions[BASE_DIMENSIONS.length - 1] = 1, newBaseUnit.key = baseName, BASE_UNITS[baseName] = newBaseUnit, newUnit = { name: name, value: 1, dimensions: BASE_UNITS[baseName].dimensions.slice(0), prefixes: prefixes, offset: offset, base: BASE_UNITS[baseName] }, currentUnitSystem[baseName] = { unit: newUnit, prefix: PREFIXES.NONE[""] };} else {newUnit = { name: name, value: defUnit.value, dimensions: defUnit.dimensions.slice(0), prefixes: prefixes, offset: offset };var anyMatch = !1;for (var _i7 in BASE_UNITS) if ((0, _object.hasOwnProperty)(BASE_UNITS, _i7)) {for (var match = !0, j = 0; j < BASE_DIMENSIONS.length; j++) if (1e-12 < Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[_i7].dimensions[j] || 0))) {match = !1;break;}if (match) {anyMatch = !0, newUnit.base = BASE_UNITS[_i7];break;}}if (!anyMatch) {baseName = baseName || name + "_STUFF";var _newBaseUnit = { dimensions: defUnit.dimensions.slice(0) };_newBaseUnit.key = baseName, BASE_UNITS[baseName] = _newBaseUnit, currentUnitSystem[baseName] = { unit: newUnit, prefix: PREFIXES.NONE[""] }, newUnit.base = BASE_UNITS[baseName];}}Unit.UNITS[name] = newUnit;for (var _i8 = 0; _i8 < aliases.length; _i8++) {var aliasName = aliases[_i8],_alias = {};for (var _key6 in newUnit) (0, _object.hasOwnProperty)(newUnit, _key6) && (_alias[_key6] = newUnit[_key6]);_alias.name = aliasName, Unit.UNITS[aliasName] = _alias;}return delete _findUnit.cache, new Unit(null, name);}, Unit.deleteUnit = function (name) {delete Unit.UNITS[name];}, Unit.PREFIXES = PREFIXES, Unit.BASE_DIMENSIONS = BASE_DIMENSIONS, Unit.BASE_UNITS = BASE_UNITS, Unit.UNIT_SYSTEMS = UNIT_SYSTEMS, Unit.UNITS = UNITS, Unit;}, { isClass: !0 });exports.createUnitClass = createUnitClass;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/unit/function/createUnit.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createCreateUnit = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "createUnit",dependencies = ["typed", "Unit"],createCreateUnit = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,Unit = _ref.Unit;return typed(name, { "Object, Object": function (obj, options) {return Unit.createUnit(obj, options);}, Object: function (obj) {return Unit.createUnit(obj, {});}, "string, Unit | string | Object, Object": function (name, def, options) {var obj = {};return obj[name] = def, Unit.createUnit(obj, options);}, "string, Unit | string | Object": function (name, def) {var obj = {};return obj[name] = def, Unit.createUnit(obj, {});}, string: function (name) {var obj = {};return obj[name] = {}, Unit.createUnit(obj, {});} });});exports.createCreateUnit = createCreateUnit;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/unit/function/splitUnit.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSplitUnit = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),name = "splitUnit",dependencies = ["typed"],createSplitUnit = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed;return typed(name, { "Unit, Array": function (unit, parts) {return unit.splitUnit(parts);} });});exports.createSplitUnit = createSplitUnit;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/unit/function/unit.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createUnitFunction = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),_collection = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/collection.js"),name = "unit",dependencies = ["typed", "Unit"],createUnitFunction = (0, _factory.factory)(name, dependencies, function (_ref) {var typed = _ref.typed,Unit = _ref.Unit;return typed(name, { Unit: function (x) {return x.clone();}, string: function (x) {return Unit.isValuelessUnit(x) ? new Unit(null, x) : Unit.parse(x, { allowNoUnits: !0 });}, "number | BigNumber | Fraction | Complex, string": function (value, unit) {return new Unit(value, unit);}, "Array | Matrix": function (x) {return (0, _collection.deepMap)(x, this);} });});exports.createUnitFunction = createUnitFunction;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/type/unit/physicalConstants.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createPlanckTemperature = exports.createPlanckCharge = exports.createPlanckTime = exports.createPlanckMass = exports.createPlanckLength = exports.createGravity = exports.createMolarMassC12 = exports.createMolarMass = exports.createWienDisplacement = exports.createStefanBoltzmann = exports.createSecondRadiation = exports.createSackurTetrode = exports.createMolarVolume = exports.createMolarPlanckConstant = exports.createGasConstant = exports.createLoschmidt = exports.createFirstRadiation = exports.createFaraday = exports.createBoltzmann = exports.createAvogadro = exports.createAtomicMass = exports.createEfimovFactor = exports.createWeakMixingAngle = exports.createThomsonCrossSection = exports.createRydberg = exports.createQuantumOfCirculation = exports.createNeutronMass = exports.createDeuteronMass = exports.createProtonMass = exports.createHartreeEnergy = exports.createFineStructure = exports.createFermiCoupling = exports.createElectronMass = exports.createClassicalElectronRadius = exports.createBohrRadius = exports.createJosephson = exports.createKlitzing = exports.createNuclearMagneton = exports.createMagneticFluxQuantum = exports.createInverseConductanceQuantum = exports.createConductanceQuantum = exports.createBohrMagneton = exports.createElementaryCharge = exports.createCoulomb = exports.createVacuumImpedance = exports.createElectricConstant = exports.createMagneticConstant = exports.createReducedPlanckConstant = exports.createPlanckConstant = exports.createGravitationConstant = exports.createSpeedOfLight = void 0;var _factory = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/factory.js"),createSpeedOfLight = unitFactory("speedOfLight", "299792458", "m s^-1");exports.createSpeedOfLight = createSpeedOfLight;var createGravitationConstant = unitFactory("gravitationConstant", "6.67430e-11", "m^3 kg^-1 s^-2");exports.createGravitationConstant = createGravitationConstant;var createPlanckConstant = unitFactory("planckConstant", "6.62607015e-34", "J s");exports.createPlanckConstant = createPlanckConstant;var createReducedPlanckConstant = unitFactory("reducedPlanckConstant", "1.0545718176461565e-34", "J s");exports.createReducedPlanckConstant = createReducedPlanckConstant;var createMagneticConstant = unitFactory("magneticConstant", "1.25663706212e-6", "N A^-2");exports.createMagneticConstant = createMagneticConstant;var createElectricConstant = unitFactory("electricConstant", "8.8541878128e-12", "F m^-1");exports.createElectricConstant = createElectricConstant;var createVacuumImpedance = unitFactory("vacuumImpedance", "376.730313667", "ohm");exports.createVacuumImpedance = createVacuumImpedance;var createCoulomb = unitFactory("coulomb", "8.987551792261171e9", "N m^2 C^-2");exports.createCoulomb = createCoulomb;var createElementaryCharge = unitFactory("elementaryCharge", "1.602176634e-19", "C");exports.createElementaryCharge = createElementaryCharge;var createBohrMagneton = unitFactory("bohrMagneton", "9.2740100783e-24", "J T^-1");exports.createBohrMagneton = createBohrMagneton;var createConductanceQuantum = unitFactory("conductanceQuantum", "7.748091729863649e-5", "S");exports.createConductanceQuantum = createConductanceQuantum;var createInverseConductanceQuantum = unitFactory("inverseConductanceQuantum", "12906.403729652257", "ohm");exports.createInverseConductanceQuantum = createInverseConductanceQuantum;var createMagneticFluxQuantum = unitFactory("magneticFluxQuantum", "2.0678338484619295e-15", "Wb");exports.createMagneticFluxQuantum = createMagneticFluxQuantum;var createNuclearMagneton = unitFactory("nuclearMagneton", "5.0507837461e-27", "J T^-1");exports.createNuclearMagneton = createNuclearMagneton;var createKlitzing = unitFactory("klitzing", "25812.807459304513", "ohm");exports.createKlitzing = createKlitzing;var createJosephson = unitFactory("josephson", "4.835978484169836e14 Hz V", "Hz V^-1");exports.createJosephson = createJosephson;var createBohrRadius = unitFactory("bohrRadius", "5.29177210903e-11", "m");exports.createBohrRadius = createBohrRadius;var createClassicalElectronRadius = unitFactory("classicalElectronRadius", "2.8179403262e-15", "m");exports.createClassicalElectronRadius = createClassicalElectronRadius;var createElectronMass = unitFactory("electronMass", "9.1093837015e-31", "kg");exports.createElectronMass = createElectronMass;var createFermiCoupling = unitFactory("fermiCoupling", "1.1663787e-5", "GeV^-2");exports.createFermiCoupling = createFermiCoupling;var createFineStructure = numberFactory("fineStructure", .0072973525693);exports.createFineStructure = createFineStructure;var createHartreeEnergy = unitFactory("hartreeEnergy", "4.3597447222071e-18", "J");exports.createHartreeEnergy = createHartreeEnergy;var createProtonMass = unitFactory("protonMass", "1.67262192369e-27", "kg");exports.createProtonMass = createProtonMass;var createDeuteronMass = unitFactory("deuteronMass", "3.3435830926e-27", "kg");exports.createDeuteronMass = createDeuteronMass;var createNeutronMass = unitFactory("neutronMass", "1.6749271613e-27", "kg");exports.createNeutronMass = createNeutronMass;var createQuantumOfCirculation = unitFactory("quantumOfCirculation", "3.6369475516e-4", "m^2 s^-1");exports.createQuantumOfCirculation = createQuantumOfCirculation;var createRydberg = unitFactory("rydberg", "10973731.568160", "m^-1");exports.createRydberg = createRydberg;var createThomsonCrossSection = unitFactory("thomsonCrossSection", "6.6524587321e-29", "m^2");exports.createThomsonCrossSection = createThomsonCrossSection;var createWeakMixingAngle = numberFactory("weakMixingAngle", .2229);exports.createWeakMixingAngle = createWeakMixingAngle;var createEfimovFactor = numberFactory("efimovFactor", 22.7);exports.createEfimovFactor = createEfimovFactor;var createAtomicMass = unitFactory("atomicMass", "1.66053906660e-27", "kg");exports.createAtomicMass = createAtomicMass;var createAvogadro = unitFactory("avogadro", "6.02214076e23", "mol^-1");exports.createAvogadro = createAvogadro;var createBoltzmann = unitFactory("boltzmann", "1.380649e-23", "J K^-1");exports.createBoltzmann = createBoltzmann;var createFaraday = unitFactory("faraday", "96485.33212331001", "C mol^-1");exports.createFaraday = createFaraday;var createFirstRadiation = unitFactory("firstRadiation", "3.7417718521927573e-16", "W m^2");exports.createFirstRadiation = createFirstRadiation;var createLoschmidt = unitFactory("loschmidt", "2.686780111798444e25", "m^-3");exports.createLoschmidt = createLoschmidt;var createGasConstant = unitFactory("gasConstant", "8.31446261815324", "J K^-1 mol^-1");exports.createGasConstant = createGasConstant;var createMolarPlanckConstant = unitFactory("molarPlanckConstant", "3.990312712893431e-10", "J s mol^-1");exports.createMolarPlanckConstant = createMolarPlanckConstant;var createMolarVolume = unitFactory("molarVolume", "0.022413969545014137", "m^3 mol^-1");exports.createMolarVolume = createMolarVolume;var createSackurTetrode = numberFactory("sackurTetrode", -1.16487052358);exports.createSackurTetrode = createSackurTetrode;var createSecondRadiation = unitFactory("secondRadiation", "0.014387768775039337", "m K");exports.createSecondRadiation = createSecondRadiation;var createStefanBoltzmann = unitFactory("stefanBoltzmann", "5.67037441918443e-8", "W m^-2 K^-4");exports.createStefanBoltzmann = createStefanBoltzmann;var createWienDisplacement = unitFactory("wienDisplacement", "2.897771955e-3", "m K");exports.createWienDisplacement = createWienDisplacement;var createMolarMass = unitFactory("molarMass", "0.99999999965e-3", "kg mol^-1");exports.createMolarMass = createMolarMass;var createMolarMassC12 = unitFactory("molarMassC12", "11.9999999958e-3", "kg mol^-1");exports.createMolarMassC12 = createMolarMassC12;var createGravity = unitFactory("gravity", "9.80665", "m s^-2");exports.createGravity = createGravity;var createPlanckLength = unitFactory("planckLength", "1.616255e-35", "m");exports.createPlanckLength = createPlanckLength;var createPlanckMass = unitFactory("planckMass", "2.176435e-8", "kg");exports.createPlanckMass = createPlanckMass;var createPlanckTime = unitFactory("planckTime", "5.391245e-44", "s");exports.createPlanckTime = createPlanckTime;var createPlanckCharge = unitFactory("planckCharge", "1.87554603778e-18", "C");exports.createPlanckCharge = createPlanckCharge;var createPlanckTemperature = unitFactory("planckTemperature", "1.416785e+32", "K");exports.createPlanckTemperature = createPlanckTemperature;function unitFactory(name, valueStr, unitStr) {return (0, _factory.factory)(name, ["config", "Unit", "BigNumber"], function (_ref) {var config = _ref.config,Unit = _ref.Unit,BigNumber = _ref.BigNumber,value = "BigNumber" === config.number ? new BigNumber(valueStr) : parseFloat(valueStr),unit = new Unit(value, unitStr);return unit.fixPrefix = !0, unit;});}function numberFactory(name, value) {return (0, _factory.factory)(name, ["config", "BigNumber"], function (_ref2) {var config = _ref2.config,BigNumber = _ref2.BigNumber;return "BigNumber" === config.number ? new BigNumber(value) : value;});}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/array.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.arraySize = arraySize, exports.validate = validate, exports.validateIndex = validateIndex, exports.resize = resize, exports.reshape = reshape, exports.processSizesWildcard = processSizesWildcard, exports.squeeze = squeeze, exports.unsqueeze = unsqueeze, exports.flatten = flatten, exports.map = map, exports.forEach = forEach, exports.filter = filter, exports.filterRegExp = filterRegExp, exports.join = join, exports.identify = identify, exports.generalize = generalize, exports.getArrayDataType = getArrayDataType, exports.last = last, exports.initial = initial, exports.contains = contains;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_string = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/string.js"),_DimensionError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/DimensionError.js"),_IndexError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/IndexError.js");function arraySize(x) {for (var s = []; Array.isArray(x);) s.push(x.length), x = x[0];return s;}function _validate(array, size, dim) {var i,len = array.length;if (len !== size[dim]) throw new _DimensionError.DimensionError(len, size[dim]);if (dim < size.length - 1) {for (i = 0; i < len; i++) {var child = array[i];if (!Array.isArray(child)) throw new _DimensionError.DimensionError(size.length - 1, size.length, "<");_validate(array[i], size, dim + 1);}} else for (i = 0; i < len; i++) if (Array.isArray(array[i])) throw new _DimensionError.DimensionError(size.length + 1, size.length, ">");}function validate(array, size) {var isScalar = 0 === size.length;if (!isScalar) _validate(array, size, 0);else if (Array.isArray(array)) throw new _DimensionError.DimensionError(array.length, 0);}function validateIndex(index, length) {if (!(0, _is.isNumber)(index) || !(0, _number.isInteger)(index)) throw new TypeError("Index must be an integer (value: " + index + ")");if (0 > index || "number" == typeof length && index >= length) throw new _IndexError.IndexError(index, length);}function resize(array, size, defaultValue) {if (!Array.isArray(array) || !Array.isArray(size)) throw new TypeError("Array expected");if (0 === size.length) throw new Error("Resizing to scalar is not supported");size.forEach(function (value) {if (!(0, _is.isNumber)(value) || !(0, _number.isInteger)(value) || 0 > value) throw new TypeError("Invalid size, must contain positive integers (size: " + (0, _string.format)(size) + ")");});var _defaultValue = void 0 === defaultValue ? 0 : defaultValue;return _resize(array, size, 0, _defaultValue), array;}function _resize(array, size, dim, defaultValue) {var i,elem,oldLen = array.length,newLen = size[dim],minLen = Math.min(oldLen, newLen);if (array.length = newLen, dim < size.length - 1) {var dimNext = dim + 1;for (i = 0; i < minLen; i++) elem = array[i], Array.isArray(elem) || (elem = [elem], array[i] = elem), _resize(elem, size, dimNext, defaultValue);for (i = minLen; i < newLen; i++) elem = [], array[i] = elem, _resize(elem, size, dimNext, defaultValue);} else {for (i = 0; i < minLen; i++) for (; Array.isArray(array[i]);) array[i] = array[i][0];for (i = minLen; i < newLen; i++) array[i] = defaultValue;}}function reshape(array, sizes) {var flatArray = flatten(array),currentLength = flatArray.length;if (!Array.isArray(array) || !Array.isArray(sizes)) throw new TypeError("Array expected");if (0 === sizes.length) throw new _DimensionError.DimensionError(0, currentLength, "!=");sizes = processSizesWildcard(sizes, currentLength);var newLength = product(sizes);if (currentLength !== newLength) throw new _DimensionError.DimensionError(newLength, currentLength, "!=");try {return _reshape(flatArray, sizes);} catch (e) {if (e instanceof _DimensionError.DimensionError) throw new _DimensionError.DimensionError(newLength, currentLength, "!=");throw e;}}function processSizesWildcard(sizes, currentLength) {var newLength = product(sizes),processedSizes = sizes.slice(),WILDCARD = -1,wildCardIndex = sizes.indexOf(WILDCARD),isMoreThanOneWildcard = 0 <= sizes.indexOf(WILDCARD, wildCardIndex + 1);if (isMoreThanOneWildcard) throw new Error("More than one wildcard in sizes");if (0 <= wildCardIndex) if (0 == currentLength % newLength) processedSizes[wildCardIndex] = -currentLength / newLength;else throw new Error("Could not replace wildcard, since " + currentLength + " is no multiple of " + -newLength);return processedSizes;}function product(array) {return array.reduce(function (prev, curr) {return prev * curr;}, 1);}function _reshape(array, sizes) {for (var tmpArray2, size, tmpArray = array, sizeIndex = sizes.length - 1; 0 < sizeIndex; sizeIndex--) {size = sizes[sizeIndex], tmpArray2 = [];for (var length = tmpArray.length / size, i = 0; i < length; i++) tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size));tmpArray = tmpArray2;}return tmpArray;}function squeeze(array, size) {for (var s = size || arraySize(array); Array.isArray(array) && 1 === array.length;) array = array[0], s.shift();for (var dims = s.length; 1 === s[dims - 1];) dims--;return dims < s.length && (array = _squeeze(array, dims, 0), s.length = dims), array;}function _squeeze(array, dims, dim) {var i, ii;if (dim < dims) {for (i = 0, ii = array.length; i < ii; i++) array[i] = _squeeze(array[i], dims, dim + 1);} else for (; Array.isArray(array);) array = array[0];return array;}function unsqueeze(array, dims, outer, size) {var s = size || arraySize(array);if (outer) for (var i = 0; i < outer; i++) array = [array], s.unshift(1);for (array = _unsqueeze(array, dims, 0); s.length < dims;) s.push(1);return array;}function _unsqueeze(array, dims, dim) {var i, ii;if (Array.isArray(array)) {for (i = 0, ii = array.length; i < ii; i++) array[i] = _unsqueeze(array[i], dims, dim + 1);} else for (var d = dim; d < dims; d++) array = [array];return array;}function flatten(array) {if (!Array.isArray(array)) return array;var flat = [];return array.forEach(function callback(value) {Array.isArray(value) ? value.forEach(callback) : flat.push(value);}), flat;}function map(array, callback) {return Array.prototype.map.call(array, callback);}function forEach(array, callback) {Array.prototype.forEach.call(array, callback);}function filter(array, callback) {if (1 !== arraySize(array).length) throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(array, callback);}function filterRegExp(array, regexp) {if (1 !== arraySize(array).length) throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(array, function (entry) {return regexp.test(entry);});}function join(array, separator) {return Array.prototype.join.call(array, separator);}function identify(a) {if (!Array.isArray(a)) throw new TypeError("Array input expected");if (0 === a.length) return a;var b = [],count = 0;b[0] = { value: a[0], identifier: 0 };for (var i = 1; i < a.length; i++) a[i] === a[i - 1] ? count++ : count = 0, b.push({ value: a[i], identifier: count });return b;}function generalize(a) {if (!Array.isArray(a)) throw new TypeError("Array input expected");if (0 === a.length) return a;for (var b = [], i = 0; i < a.length; i++) b.push(a[i].value);return b;}function getArrayDataType(array, typeOf) {for (var type, length = 0, i = 0; i < array.length; i++) {var item = array[i],isArray = Array.isArray(item);if (0 == i && isArray && (length = item.length), isArray && item.length !== length) return;var itemType = isArray ? getArrayDataType(item, typeOf) : typeOf(item);if (void 0 === type) type = itemType;else if (type !== itemType) return "mixed";}return type;}function last(array) {return array[array.length - 1];}function initial(array) {return array.slice(0, array.length - 1);}function contains(array, item) {return -1 !== array.indexOf(item);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.bitAndBigNumber = bitAndBigNumber, exports.bitNotBigNumber = bitNotBigNumber, exports.bitOrBigNumber = bitOrBigNumber, exports.bitwise = bitwise, exports.bitXor = bitXor, exports.leftShiftBigNumber = leftShiftBigNumber, exports.rightArithShiftBigNumber = rightArithShiftBigNumber;function bitAndBigNumber(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function bitAnd");var BigNumber = x.constructor;if (x.isNaN() || y.isNaN()) return new BigNumber(NaN);if (x.isZero() || y.eq(-1) || x.eq(y)) return x;if (y.isZero() || x.eq(-1)) return y;if (!x.isFinite() || !y.isFinite()) {if (!x.isFinite() && !y.isFinite()) return x.isNegative() === y.isNegative() ? x : new BigNumber(0);if (!x.isFinite()) return y.isNegative() ? x : x.isNegative() ? new BigNumber(0) : y;if (!y.isFinite()) return x.isNegative() ? y : y.isNegative() ? new BigNumber(0) : x;}return bitwise(x, y, function (a, b) {return a & b;});}function bitNotBigNumber(x) {if (x.isFinite() && !x.isInteger()) throw new Error("Integer expected in function bitNot");var BigNumber = x.constructor,prevPrec = BigNumber.precision;BigNumber.config({ precision: 1E9 });var result = x.plus(new BigNumber(1));return result.s = -result.s || null, BigNumber.config({ precision: prevPrec }), result;}function bitOrBigNumber(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function bitOr");var BigNumber = x.constructor;if (x.isNaN() || y.isNaN()) return new BigNumber(NaN);var negOne = new BigNumber(-1);return x.isZero() || y.eq(negOne) || x.eq(y) ? y : y.isZero() || x.eq(negOne) ? x : x.isFinite() && y.isFinite() ? bitwise(x, y, function (a, b) {return a | b;}) : (x.isFinite() || x.isNegative() || !y.isNegative()) && (!x.isNegative() || y.isNegative() || y.isFinite()) ? x.isNegative() && y.isNegative() ? x.isFinite() ? x : y : x.isFinite() ? y : x : negOne;}function bitwise(x, y, func) {var xBits,yBits,BigNumber = x.constructor,xSign = +(0 > x.s),ySign = +(0 > y.s);if (xSign) {xBits = decCoefficientToBinaryString(bitNotBigNumber(x));for (var i = 0; i < xBits.length; ++i) xBits[i] ^= 1;} else xBits = decCoefficientToBinaryString(x);if (ySign) {yBits = decCoefficientToBinaryString(bitNotBigNumber(y));for (var _i = 0; _i < yBits.length; ++_i) yBits[_i] ^= 1;} else yBits = decCoefficientToBinaryString(y);var minBits, maxBits, minSign;xBits.length <= yBits.length ? (minBits = xBits, maxBits = yBits, minSign = xSign) : (minBits = yBits, maxBits = xBits, minSign = ySign);var shortLen = minBits.length,longLen = maxBits.length,expFuncVal = 1 ^ func(xSign, ySign),outVal = new BigNumber(1 ^ expFuncVal),twoPower = new BigNumber(1),two = new BigNumber(2),prevPrec = BigNumber.precision;for (BigNumber.config({ precision: 1E9 }); 0 < shortLen;) func(minBits[--shortLen], maxBits[--longLen]) === expFuncVal && (outVal = outVal.plus(twoPower)), twoPower = twoPower.times(two);for (; 0 < longLen;) func(minSign, maxBits[--longLen]) === expFuncVal && (outVal = outVal.plus(twoPower)), twoPower = twoPower.times(two);return BigNumber.config({ precision: prevPrec }), 0 === expFuncVal && (outVal.s = -outVal.s), outVal;}function decCoefficientToBinaryString(x) {for (var s, a = x.d, r = a[0] + "", i = 1; i < a.length; ++i) {s = a[i] + "";for (var z = 7 - s.length; z--;) s = "0" + s;r += s;}for (var j = r.length; "0" === r.charAt(j);) j--;var xe = x.e,str = r.slice(0, j + 1 || 1),strL = str.length;if (0 < xe) if (++xe > strL) for (xe -= strL; xe--;) str += "0";else xe < strL && (str = str.slice(0, xe) + "." + str.slice(xe));for (var arrL, arr = [0], _i2 = 0; _i2 < str.length;) {for (arrL = arr.length; arrL--;) arr[arrL] *= 10;arr[0] += parseInt(str.charAt(_i2++));for (var _j = 0; _j < arr.length; ++_j) 1 < arr[_j] && ((null === arr[_j + 1] || void 0 === arr[_j + 1]) && (arr[_j + 1] = 0), arr[_j + 1] += arr[_j] >> 1, arr[_j] &= 1);}return arr.reverse();}function bitXor(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function bitXor");var BigNumber = x.constructor;if (x.isNaN() || y.isNaN()) return new BigNumber(NaN);if (x.isZero()) return y;if (y.isZero()) return x;if (x.eq(y)) return new BigNumber(0);var negOne = new BigNumber(-1);return x.eq(negOne) ? bitNotBigNumber(y) : y.eq(negOne) ? bitNotBigNumber(x) : x.isFinite() && y.isFinite() ? bitwise(x, y, function (a, b) {return a ^ b;}) : x.isFinite() || y.isFinite() ? new BigNumber(x.isNegative() === y.isNegative() ? 1 / 0 : -Infinity) : negOne;}function leftShiftBigNumber(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function leftShift");var BigNumber = x.constructor;return x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero() ? new BigNumber(NaN) : x.isZero() || y.isZero() ? x : x.isFinite() || y.isFinite() ? y.lt(55) ? x.times(Math.pow(2, y.toNumber()) + "") : x.times(new BigNumber(2).pow(y)) : new BigNumber(NaN);}function rightArithShiftBigNumber(x, y) {if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) throw new Error("Integers expected in function rightArithShift");var BigNumber = x.constructor;return x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero() ? new BigNumber(NaN) : x.isZero() || y.isZero() ? x : y.isFinite() ? y.lt(55) ? x.div(Math.pow(2, y.toNumber()) + "").floor() : x.div(new BigNumber(2).pow(y)).floor() : x.isNegative() ? new BigNumber(-1) : x.isFinite() ? new BigNumber(0) : new BigNumber(NaN);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/bignumber/constants.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createBigNumberTau = exports.createBigNumberPi = exports.createBigNumberPhi = exports.createBigNumberE = void 0;var _function = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/function.js"),createBigNumberE = (0, _function.memoize)(function (BigNumber) {return new BigNumber(1).exp();}, { hasher: hasher });exports.createBigNumberE = createBigNumberE;var createBigNumberPhi = (0, _function.memoize)(function (BigNumber) {return new BigNumber(1).plus(new BigNumber(5).sqrt()).div(2);}, { hasher: hasher });exports.createBigNumberPhi = createBigNumberPhi;var createBigNumberPi = (0, _function.memoize)(function (BigNumber) {return BigNumber.acos(-1);}, { hasher: hasher });exports.createBigNumberPi = createBigNumberPi;var createBigNumberTau = (0, _function.memoize)(function (BigNumber) {return createBigNumberPi(BigNumber).times(2);}, { hasher: hasher });exports.createBigNumberTau = createBigNumberTau;function hasher(args) {return args[0].precision;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/bignumber/formatter.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.format = format, exports.toEngineering = toEngineering, exports.toExponential = toExponential, exports.toFixed = toFixed;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js");function formatBigNumberToBase(n, base, size) {var BigNumberCtor = n.constructor,big2 = new BigNumberCtor(2),suffix = "";if (size) {if (1 > size) throw new Error("size must be in greater than 0");if (!(0, _number.isInteger)(size)) throw new Error("size must be an integer");if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) throw new Error("Value must be in range [-2^".concat(size - 1, ", 2^").concat(size - 1, "-1]"));if (!n.isInteger()) throw new Error("Value must be an integer");n.lessThan(0) && (n = n.add(big2.pow(size))), suffix = "i".concat(size);}switch (base) {case 2:return "".concat(n.toBinary()).concat(suffix);case 8:return "".concat(n.toOctal()).concat(suffix);case 16:return "".concat(n.toHexadecimal()).concat(suffix);default:throw new Error("Base ".concat(base, " not supported "));}}function format(value, options) {if ("function" == typeof options) return options(value);if (!value.isFinite()) return value.isNaN() ? "NaN" : value.gt(0) ? "Infinity" : "-Infinity";var precision,wordSize,notation = "auto";if (void 0 !== options && (options.notation && (notation = options.notation), "number" == typeof options ? precision = options : options.precision && (precision = options.precision), options.wordSize && (wordSize = options.wordSize, "number" != typeof wordSize))) throw new Error("Option \"wordSize\" must be a number");switch (notation) {case "fixed":return toFixed(value, precision);case "exponential":return toExponential(value, precision);case "engineering":return toEngineering(value, precision);case "bin":return formatBigNumberToBase(value, 2, wordSize);case "oct":return formatBigNumberToBase(value, 8, wordSize);case "hex":return formatBigNumberToBase(value, 16, wordSize);case "auto":{var lowerExp = options && options.lowerExp !== void 0 ? options.lowerExp : -3,upperExp = options && options.upperExp !== void 0 ? options.upperExp : 5;if (value.isZero()) return "0";var str,rounded = value.toSignificantDigits(precision),exp = rounded.e;return str = exp >= lowerExp && exp < upperExp ? rounded.toFixed() : toExponential(value, precision), str.replace(/((\.\d*?)(0+))($|e)/, function () {var digits = arguments[2],e = arguments[4];return "." === digits ? e : digits + e;});}default:throw new Error("Unknown notation \"" + notation + "\". Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.");}}function toEngineering(value, precision) {var e = value.e,newExp = 0 == e % 3 ? e : 0 > e ? e - 3 - e % 3 : e - e % 3,valueWithoutExp = value.mul(Math.pow(10, -newExp)),valueStr = valueWithoutExp.toPrecision(precision);return -1 !== valueStr.indexOf("e") && (valueStr = valueWithoutExp.toString()), valueStr + "e" + (0 <= e ? "+" : "") + newExp.toString();}function toExponential(value, precision) {return void 0 === precision ? value.toExponential() : value.toExponential(precision - 1);}function toFixed(value, precision) {return value.toFixed(precision);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.nearlyEqual = nearlyEqual;function nearlyEqual(x, y, epsilon) {if (null === epsilon || epsilon === void 0) return x.eq(y);if (x.eq(y)) return !0;if (x.isNaN() || y.isNaN()) return !1;if (x.isFinite() && y.isFinite()) {var diff = x.minus(y).abs();if (diff.isZero()) return !0;var max = x.constructor.max(x.abs(), y.abs());return diff.lte(max.times(epsilon));}return !1;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/collection.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.containsCollections = containsCollections, exports.deepForEach = deepForEach, exports.deepMap = deepMap, exports.reduce = reduce, exports.scatter = scatter;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_IndexError = __webpack_require__("./node_modules/mathjs/lib/cjs/error/IndexError.js"),_array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js");function containsCollections(array) {for (var i = 0; i < array.length; i++) if ((0, _is.isCollection)(array[i])) return !0;return !1;}function deepForEach(array, callback) {(0, _is.isMatrix)(array) && (array = array.valueOf());for (var value, i = 0, ii = array.length; i < ii; i++) value = array[i], Array.isArray(value) ? deepForEach(value, callback) : callback(value);}function deepMap(array, callback, skipZeros) {return array && "function" == typeof array.map ? array.map(function (x) {return deepMap(x, callback, skipZeros);}) : callback(array);}function reduce(mat, dim, callback) {var size = Array.isArray(mat) ? (0, _array.arraySize)(mat) : mat.size();if (0 > dim || dim >= size.length) throw new _IndexError.IndexError(dim, size.length);return (0, _is.isMatrix)(mat) ? mat.create(_reduce(mat.valueOf(), dim, callback)) : _reduce(mat, dim, callback);}function _reduce(mat, dim, callback) {var i, ret, val, tran;if (0 >= dim) {if (!Array.isArray(mat[0])) {for (val = mat[0], i = 1; i < mat.length; i++) val = callback(val, mat[i]);return val;}for (tran = _switch(mat), ret = [], i = 0; i < tran.length; i++) ret[i] = _reduce(tran[i], dim - 1, callback);return ret;}for (ret = [], i = 0; i < mat.length; i++) ret[i] = _reduce(mat[i], dim - 1, callback);return ret;}function _switch(mat) {var i,j,I = mat.length,J = mat[0].length,ret = [];for (j = 0; j < J; j++) {var tmp = [];for (i = 0; i < I; i++) tmp.push(mat[i][j]);ret.push(tmp);}return ret;}function scatter(a, j, w, x, u, mark, cindex, f, inverse, update, value) {var k,k0,k1,i,avalues = a._values,aindex = a._index,aptr = a._ptr;if (x) for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) i = aindex[k], w[i] === mark ? (x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k]), u[i] = mark) : (w[i] = mark, cindex.push(i), update ? (x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k]), u[i] = mark) : x[i] = avalues[k]);else for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) i = aindex[k], w[i] === mark ? u[i] = mark : (w[i] = mark, cindex.push(i));}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/complex.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.complexEquals = complexEquals;var _number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js");function complexEquals(x, y, epsilon) {return (0, _number.nearlyEqual)(x.re, y.re, epsilon) && (0, _number.nearlyEqual)(x.im, y.im, epsilon);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/customs.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.getSafeProperty = getSafeProperty, exports.setSafeProperty = setSafeProperty, exports.isSafeProperty = isSafeProperty, exports.hasSafeProperty = hasSafeProperty, exports.getSafeProperties = getSafeProperties, exports.validateSafeMethod = validateSafeMethod, exports.isSafeMethod = isSafeMethod, exports.isPlainObject = isPlainObject;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js");function getSafeProperty(object, prop) {if (isPlainObject(object) && isSafeProperty(object, prop)) return object[prop];if ("function" == typeof object[prop] && isSafeMethod(object, prop)) throw new Error("Cannot access method \"" + prop + "\" as a property");throw new Error("No access to property \"" + prop + "\"");}function setSafeProperty(object, prop, value) {if (isPlainObject(object) && isSafeProperty(object, prop)) return object[prop] = value, value;throw new Error("No access to property \"" + prop + "\"");}function getSafeProperties(object) {return Object.keys(object).filter(function (prop) {return (0, _object.hasOwnProperty)(object, prop);});}function hasSafeProperty(object, prop) {return prop in object;}function isSafeProperty(object, prop) {return !!(object && "object" === (0, _typeof2["default"])(object)) && (!!(0, _object.hasOwnProperty)(safeNativeProperties, prop) || !(prop in Object.prototype) && !(prop in Function.prototype));}function validateSafeMethod(object, method) {if (!isSafeMethod(object, method)) throw new Error("No access to method \"" + method + "\"");}function isSafeMethod(object, method) {return null !== object && void 0 !== object && "function" == typeof object[method] && !((0, _object.hasOwnProperty)(object, method) && Object.getPrototypeOf && method in Object.getPrototypeOf(object)) && (!!(0, _object.hasOwnProperty)(safeNativeMethods, method) || !(method in Object.prototype) && !(method in Function.prototype));}function isPlainObject(object) {return "object" === (0, _typeof2["default"])(object) && object && object.constructor === Object;}var safeNativeProperties = { length: !0, name: !0 },safeNativeMethods = { toString: !0, valueOf: !0, toLocaleString: !0 };

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/emitter.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.mixin = mixin;var _tinyEmitter = _interopRequireDefault(__webpack_require__("./node_modules/tiny-emitter/index.js"));function mixin(obj) {var emitter = new _tinyEmitter["default"]();return obj.on = emitter.on.bind(emitter), obj.off = emitter.off.bind(emitter), obj.once = emitter.once.bind(emitter), obj.emit = emitter.emit.bind(emitter), obj;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/factory.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.factory = factory, exports.sortFactories = sortFactories, exports.create = create, exports.isFactory = isFactory, exports.assertDependencies = assertDependencies, exports.isOptionalDependency = isOptionalDependency, exports.stripOptionalNotation = stripOptionalNotation;var _array = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/array.js"),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js");function factory(name, dependencies, create, meta) {function assertAndCreate(scope) {var deps = (0, _object.pickShallow)(scope, dependencies.map(stripOptionalNotation));return assertDependencies(name, dependencies, scope), create(deps);}return assertAndCreate.isFactory = !0, assertAndCreate.fn = name, assertAndCreate.dependencies = dependencies.slice().sort(), meta && (assertAndCreate.meta = meta), assertAndCreate;}function sortFactories(factories) {function containsDependency(factory, dependency) {if (isFactory(factory)) {if ((0, _array.contains)(factory.dependencies, dependency.fn || dependency.name)) return !0;if (factory.dependencies.some(function (d) {return containsDependency(factoriesByName[d], dependency);})) return !0;}return !1;}function addFactory(factory) {for (var index = 0; index < sorted.length && !containsDependency(sorted[index], factory);) index++;sorted.splice(index, 0, factory);}var factoriesByName = {};factories.forEach(function (factory) {factoriesByName[factory.fn] = factory;});var sorted = [];return factories.filter(isFactory).forEach(addFactory), factories.filter(function (factory) {return !isFactory(factory);}).forEach(addFactory), sorted;}function create(factories) {var scope = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};return sortFactories(factories).forEach(function (factory) {return factory(scope);}), scope;}function isFactory(obj) {return "function" == typeof obj && "string" == typeof obj.fn && Array.isArray(obj.dependencies);}function assertDependencies(name, dependencies, scope) {var allDefined = dependencies.filter(function (dependency) {return !isOptionalDependency(dependency);}).every(function (dependency) {return scope[dependency] !== void 0;});if (!allDefined) {var missingDependencies = dependencies.filter(function (dependency) {return scope[dependency] === void 0;});throw new Error("Cannot create function \"".concat(name, "\", ") + "some dependencies are missing: ".concat(missingDependencies.map(function (d) {return "\"".concat(d, "\"");}).join(", "), "."));}}function isOptionalDependency(dependency) {return dependency && "?" === dependency[0];}function stripOptionalNotation(dependency) {return dependency && "?" === dependency[0] ? dependency.slice(1) : dependency;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/function.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.memoize = memoize, exports.memoizeCompare = memoizeCompare, exports.maxArgumentCount = maxArgumentCount;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_lruQueue = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/lruQueue.js");function memoize(fn) {var _ref = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},hasher = _ref.hasher,limit = _ref.limit;return limit = null == limit ? Number.POSITIVE_INFINITY : limit, hasher = null == hasher ? JSON.stringify : hasher, function memoize() {"object" !== (0, _typeof2["default"])(memoize.cache) && (memoize.cache = { values: new Map(), lru: (0, _lruQueue.lruQueue)(limit || Number.POSITIVE_INFINITY) });for (var args = [], i = 0; i < arguments.length; i++) args[i] = arguments[i];var hash = hasher(args);if (memoize.cache.values.has(hash)) return memoize.cache.lru.hit(hash), memoize.cache.values.get(hash);var newVal = fn.apply(fn, args);return memoize.cache.values.set(hash, newVal), memoize.cache.values["delete"](memoize.cache.lru.hit(hash)), newVal;};}function memoizeCompare(fn, isEqual) {var memoize = function memoize() {for (var args = [], i = 0; i < arguments.length; i++) args[i] = arguments[i];for (var cached, c = 0; c < memoize.cache.length; c++) if (cached = memoize.cache[c], isEqual(args, cached.args)) return cached.res;var res = fn.apply(fn, args);return memoize.cache.unshift({ args: args, res: res }), res;};return memoize.cache = [], memoize;}function maxArgumentCount(fn) {return Object.keys(fn.signatures || {}).reduce(function (args, signature) {var count = (signature.match(/,/g) || []).length + 1;return Math.max(args, count);}, -1);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/is.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isNumber = isNumber, exports.isBigNumber = isBigNumber, exports.isComplex = isComplex, exports.isFraction = isFraction, exports.isUnit = isUnit, exports.isString = isString, exports.isMatrix = isMatrix, exports.isCollection = isCollection, exports.isDenseMatrix = isDenseMatrix, exports.isSparseMatrix = isSparseMatrix, exports.isRange = isRange, exports.isIndex = isIndex, exports.isBoolean = isBoolean, exports.isResultSet = isResultSet, exports.isHelp = isHelp, exports.isFunction = isFunction, exports.isDate = isDate, exports.isRegExp = isRegExp, exports.isObject = isObject, exports.isNull = isNull, exports.isUndefined = isUndefined, exports.isAccessorNode = isAccessorNode, exports.isArrayNode = isArrayNode, exports.isAssignmentNode = isAssignmentNode, exports.isBlockNode = isBlockNode, exports.isConditionalNode = isConditionalNode, exports.isConstantNode = isConstantNode, exports.isFunctionAssignmentNode = isFunctionAssignmentNode, exports.isFunctionNode = isFunctionNode, exports.isIndexNode = isIndexNode, exports.isNode = isNode, exports.isObjectNode = isObjectNode, exports.isOperatorNode = isOperatorNode, exports.isParenthesisNode = isParenthesisNode, exports.isRangeNode = isRangeNode, exports.isSymbolNode = isSymbolNode, exports.isChain = isChain, exports.typeOf = typeOf, exports.isArray = void 0;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js"));function isNumber(x) {return "number" == typeof x;}function isBigNumber(x) {return x && !0 === x.constructor.prototype.isBigNumber || !1;}function isComplex(x) {return x && "object" === (0, _typeof2["default"])(x) && !0 === Object.getPrototypeOf(x).isComplex || !1;}function isFraction(x) {return x && "object" === (0, _typeof2["default"])(x) && !0 === Object.getPrototypeOf(x).isFraction || !1;}function isUnit(x) {return x && !0 === x.constructor.prototype.isUnit || !1;}function isString(x) {return "string" == typeof x;}var isArray = Array.isArray;exports.isArray = isArray;function isMatrix(x) {return x && !0 === x.constructor.prototype.isMatrix || !1;}function isCollection(x) {return Array.isArray(x) || isMatrix(x);}function isDenseMatrix(x) {return x && x.isDenseMatrix && !0 === x.constructor.prototype.isMatrix || !1;}function isSparseMatrix(x) {return x && x.isSparseMatrix && !0 === x.constructor.prototype.isMatrix || !1;}function isRange(x) {return x && !0 === x.constructor.prototype.isRange || !1;}function isIndex(x) {return x && !0 === x.constructor.prototype.isIndex || !1;}function isBoolean(x) {return "boolean" == typeof x;}function isResultSet(x) {return x && !0 === x.constructor.prototype.isResultSet || !1;}function isHelp(x) {return x && !0 === x.constructor.prototype.isHelp || !1;}function isFunction(x) {return "function" == typeof x;}function isDate(x) {return x instanceof Date;}function isRegExp(x) {return x instanceof RegExp;}function isObject(x) {return !(!x || "object" !== (0, _typeof2["default"])(x) || x.constructor !== Object || isComplex(x) || isFraction(x));}function isNull(x) {return null === x;}function isUndefined(x) {return x === void 0;}function isAccessorNode(x) {return x && !0 === x.isAccessorNode && !0 === x.constructor.prototype.isNode || !1;}function isArrayNode(x) {return x && !0 === x.isArrayNode && !0 === x.constructor.prototype.isNode || !1;}function isAssignmentNode(x) {return x && !0 === x.isAssignmentNode && !0 === x.constructor.prototype.isNode || !1;}function isBlockNode(x) {return x && !0 === x.isBlockNode && !0 === x.constructor.prototype.isNode || !1;}function isConditionalNode(x) {return x && !0 === x.isConditionalNode && !0 === x.constructor.prototype.isNode || !1;}function isConstantNode(x) {return x && !0 === x.isConstantNode && !0 === x.constructor.prototype.isNode || !1;}function isFunctionAssignmentNode(x) {return x && !0 === x.isFunctionAssignmentNode && !0 === x.constructor.prototype.isNode || !1;}function isFunctionNode(x) {return x && !0 === x.isFunctionNode && !0 === x.constructor.prototype.isNode || !1;}function isIndexNode(x) {return x && !0 === x.isIndexNode && !0 === x.constructor.prototype.isNode || !1;}function isNode(x) {return x && !0 === x.isNode && !0 === x.constructor.prototype.isNode || !1;}function isObjectNode(x) {return x && !0 === x.isObjectNode && !0 === x.constructor.prototype.isNode || !1;}function isOperatorNode(x) {return x && !0 === x.isOperatorNode && !0 === x.constructor.prototype.isNode || !1;}function isParenthesisNode(x) {return x && !0 === x.isParenthesisNode && !0 === x.constructor.prototype.isNode || !1;}function isRangeNode(x) {return x && !0 === x.isRangeNode && !0 === x.constructor.prototype.isNode || !1;}function isSymbolNode(x) {return x && !0 === x.isSymbolNode && !0 === x.constructor.prototype.isNode || !1;}function isChain(x) {return x && !0 === x.constructor.prototype.isChain || !1;}function typeOf(x) {var t = (0, _typeof2["default"])(x);return "object" === t ? null === x ? "null" : Array.isArray(x) ? "Array" : x instanceof Date ? "Date" : x instanceof RegExp ? "RegExp" : isBigNumber(x) ? "BigNumber" : isComplex(x) ? "Complex" : isFraction(x) ? "Fraction" : isMatrix(x) ? "Matrix" : isUnit(x) ? "Unit" : isIndex(x) ? "Index" : isRange(x) ? "Range" : isResultSet(x) ? "ResultSet" : isNode(x) ? x.type : isChain(x) ? "Chain" : isHelp(x) ? "Help" : "Object" : "function" === t ? "Function" : t;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/latex.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.escapeLatex = escapeLatex, exports.toSymbol = toSymbol, exports.defaultTemplate = exports.latexFunctions = exports.latexOperators = exports.latexSymbols = void 0;var _escapeLatex = _interopRequireDefault(__webpack_require__("./node_modules/escape-latex/dist/index.js")),_object = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/object.js"),latexSymbols = { Alpha: "A", alpha: "\\alpha", Beta: "B", beta: "\\beta", Gamma: "\\Gamma", gamma: "\\gamma", Delta: "\\Delta", delta: "\\delta", Epsilon: "E", epsilon: "\\epsilon", varepsilon: "\\varepsilon", Zeta: "Z", zeta: "\\zeta", Eta: "H", eta: "\\eta", Theta: "\\Theta", theta: "\\theta", vartheta: "\\vartheta", Iota: "I", iota: "\\iota", Kappa: "K", kappa: "\\kappa", varkappa: "\\varkappa", Lambda: "\\Lambda", lambda: "\\lambda", Mu: "M", mu: "\\mu", Nu: "N", nu: "\\nu", Xi: "\\Xi", xi: "\\xi", Omicron: "O", omicron: "o", Pi: "\\Pi", pi: "\\pi", varpi: "\\varpi", Rho: "P", rho: "\\rho", varrho: "\\varrho", Sigma: "\\Sigma", sigma: "\\sigma", varsigma: "\\varsigma", Tau: "T", tau: "\\tau", Upsilon: "\\Upsilon", upsilon: "\\upsilon", Phi: "\\Phi", phi: "\\phi", varphi: "\\varphi", Chi: "X", chi: "\\chi", Psi: "\\Psi", psi: "\\psi", Omega: "\\Omega", omega: "\\omega", true: "\\mathrm{True}", false: "\\mathrm{False}", i: "i", inf: "\\infty", Inf: "\\infty", infinity: "\\infty", Infinity: "\\infty", oo: "\\infty", lim: "\\lim", undefined: "\\mathbf{?}" };exports.latexSymbols = latexSymbols;var latexOperators = { transpose: "^\\top", ctranspose: "^H", factorial: "!", pow: "^", dotPow: ".^\\wedge", unaryPlus: "+", unaryMinus: "-", bitNot: "\\~", not: "\\neg", multiply: "\\cdot", divide: "\\frac", dotMultiply: ".\\cdot", dotDivide: ".:", mod: "\\mod", add: "+", subtract: "-", to: "\\rightarrow", leftShift: "<<", rightArithShift: ">>", rightLogShift: ">>>", equal: "=", unequal: "\\neq", smaller: "<", larger: ">", smallerEq: "\\leq", largerEq: "\\geq", bitAnd: "\\&", bitXor: "\\underline{|}", bitOr: "|", and: "\\wedge", xor: "\\veebar", or: "\\vee" };exports.latexOperators = latexOperators;var latexFunctions = { abs: { 1: "\\left|${args[0]}\\right|" }, add: { 2: "\\left(${args[0]}".concat(latexOperators.add, "${args[1]}\\right)") }, cbrt: { 1: "\\sqrt[3]{${args[0]}}" }, ceil: { 1: "\\left\\lceil${args[0]}\\right\\rceil" }, cube: { 1: "\\left(${args[0]}\\right)^3" }, divide: { 2: "\\frac{${args[0]}}{${args[1]}}" }, dotDivide: { 2: "\\left(${args[0]}".concat(latexOperators.dotDivide, "${args[1]}\\right)") }, dotMultiply: { 2: "\\left(${args[0]}".concat(latexOperators.dotMultiply, "${args[1]}\\right)") }, dotPow: { 2: "\\left(${args[0]}".concat(latexOperators.dotPow, "${args[1]}\\right)") }, exp: { 1: "\\exp\\left(${args[0]}\\right)" }, expm1: "\\left(e".concat(latexOperators.pow, "{${args[0]}}-1\\right)"), fix: { 1: "\\mathrm{${name}}\\left(${args[0]}\\right)" }, floor: { 1: "\\left\\lfloor${args[0]}\\right\\rfloor" }, gcd: "\\gcd\\left(${args}\\right)", hypot: "\\hypot\\left(${args}\\right)", log: { 1: "\\ln\\left(${args[0]}\\right)", 2: "\\log_{${args[1]}}\\left(${args[0]}\\right)" }, log10: { 1: "\\log_{10}\\left(${args[0]}\\right)" }, log1p: { 1: "\\ln\\left(${args[0]}+1\\right)", 2: "\\log_{${args[1]}}\\left(${args[0]}+1\\right)" }, log2: "\\log_{2}\\left(${args[0]}\\right)", mod: { 2: "\\left(${args[0]}".concat(latexOperators.mod, "${args[1]}\\right)") }, multiply: { 2: "\\left(${args[0]}".concat(latexOperators.multiply, "${args[1]}\\right)") }, norm: { 1: "\\left\\|${args[0]}\\right\\|", 2: void 0 }, nthRoot: { 2: "\\sqrt[${args[1]}]{${args[0]}}" }, nthRoots: { 2: "\\{y : $y^{args[1]} = {${args[0]}}\\}" }, pow: { 2: "\\left(${args[0]}\\right)".concat(latexOperators.pow, "{${args[1]}}") }, round: { 1: "\\left\\lfloor${args[0]}\\right\\rceil", 2: void 0 }, sign: { 1: "\\mathrm{${name}}\\left(${args[0]}\\right)" }, sqrt: { 1: "\\sqrt{${args[0]}}" }, square: { 1: "\\left(${args[0]}\\right)^2" }, subtract: { 2: "\\left(${args[0]}".concat(latexOperators.subtract, "${args[1]}\\right)") }, unaryMinus: { 1: "".concat(latexOperators.unaryMinus, "\\left(${args[0]}\\right)") }, unaryPlus: { 1: "".concat(latexOperators.unaryPlus, "\\left(${args[0]}\\right)") }, bitAnd: { 2: "\\left(${args[0]}".concat(latexOperators.bitAnd, "${args[1]}\\right)") }, bitNot: { 1: latexOperators.bitNot + "\\left(${args[0]}\\right)" }, bitOr: { 2: "\\left(${args[0]}".concat(latexOperators.bitOr, "${args[1]}\\right)") }, bitXor: { 2: "\\left(${args[0]}".concat(latexOperators.bitXor, "${args[1]}\\right)") }, leftShift: { 2: "\\left(${args[0]}".concat(latexOperators.leftShift, "${args[1]}\\right)") }, rightArithShift: { 2: "\\left(${args[0]}".concat(latexOperators.rightArithShift, "${args[1]}\\right)") }, rightLogShift: { 2: "\\left(${args[0]}".concat(latexOperators.rightLogShift, "${args[1]}\\right)") }, bellNumbers: { 1: "\\mathrm{B}_{${args[0]}}" }, catalan: { 1: "\\mathrm{C}_{${args[0]}}" }, stirlingS2: { 2: "\\mathrm{S}\\left(${args}\\right)" }, arg: { 1: "\\arg\\left(${args[0]}\\right)" }, conj: { 1: "\\left(${args[0]}\\right)^*" }, im: { 1: "\\Im\\left\\lbrace${args[0]}\\right\\rbrace" }, re: { 1: "\\Re\\left\\lbrace${args[0]}\\right\\rbrace" }, and: { 2: "\\left(${args[0]}".concat(latexOperators.and, "${args[1]}\\right)") }, not: { 1: latexOperators.not + "\\left(${args[0]}\\right)" }, or: { 2: "\\left(${args[0]}".concat(latexOperators.or, "${args[1]}\\right)") }, xor: { 2: "\\left(${args[0]}".concat(latexOperators.xor, "${args[1]}\\right)") }, cross: { 2: "\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)" }, ctranspose: { 1: "\\left(${args[0]}\\right)".concat(latexOperators.ctranspose) }, det: { 1: "\\det\\left(${args[0]}\\right)" }, dot: { 2: "\\left(${args[0]}\\cdot${args[1]}\\right)" }, expm: { 1: "\\exp\\left(${args[0]}\\right)" }, inv: { 1: "\\left(${args[0]}\\right)^{-1}" }, sqrtm: { 1: "{${args[0]}}".concat(latexOperators.pow, "{\\frac{1}{2}}") }, trace: { 1: "\\mathrm{tr}\\left(${args[0]}\\right)" }, transpose: { 1: "\\left(${args[0]}\\right)".concat(latexOperators.transpose) }, combinations: { 2: "\\binom{${args[0]}}{${args[1]}}" }, combinationsWithRep: { 2: "\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)" }, factorial: { 1: "\\left(${args[0]}\\right)".concat(latexOperators.factorial) }, gamma: { 1: "\\Gamma\\left(${args[0]}\\right)" }, equal: { 2: "\\left(${args[0]}".concat(latexOperators.equal, "${args[1]}\\right)") }, larger: { 2: "\\left(${args[0]}".concat(latexOperators.larger, "${args[1]}\\right)") }, largerEq: { 2: "\\left(${args[0]}".concat(latexOperators.largerEq, "${args[1]}\\right)") }, smaller: { 2: "\\left(${args[0]}".concat(latexOperators.smaller, "${args[1]}\\right)") }, smallerEq: { 2: "\\left(${args[0]}".concat(latexOperators.smallerEq, "${args[1]}\\right)") }, unequal: { 2: "\\left(${args[0]}".concat(latexOperators.unequal, "${args[1]}\\right)") }, erf: { 1: "erf\\left(${args[0]}\\right)" }, max: "\\max\\left(${args}\\right)", min: "\\min\\left(${args}\\right)", variance: "\\mathrm{Var}\\left(${args}\\right)", acos: { 1: "\\cos^{-1}\\left(${args[0]}\\right)" }, acosh: { 1: "\\cosh^{-1}\\left(${args[0]}\\right)" }, acot: { 1: "\\cot^{-1}\\left(${args[0]}\\right)" }, acoth: { 1: "\\coth^{-1}\\left(${args[0]}\\right)" }, acsc: { 1: "\\csc^{-1}\\left(${args[0]}\\right)" }, acsch: { 1: "\\mathrm{csch}^{-1}\\left(${args[0]}\\right)" }, asec: { 1: "\\sec^{-1}\\left(${args[0]}\\right)" }, asech: { 1: "\\mathrm{sech}^{-1}\\left(${args[0]}\\right)" }, asin: { 1: "\\sin^{-1}\\left(${args[0]}\\right)" }, asinh: { 1: "\\sinh^{-1}\\left(${args[0]}\\right)" }, atan: { 1: "\\tan^{-1}\\left(${args[0]}\\right)" }, atan2: { 2: "\\mathrm{atan2}\\left(${args}\\right)" }, atanh: { 1: "\\tanh^{-1}\\left(${args[0]}\\right)" }, cos: { 1: "\\cos\\left(${args[0]}\\right)" }, cosh: { 1: "\\cosh\\left(${args[0]}\\right)" }, cot: { 1: "\\cot\\left(${args[0]}\\right)" }, coth: { 1: "\\coth\\left(${args[0]}\\right)" }, csc: { 1: "\\csc\\left(${args[0]}\\right)" }, csch: { 1: "\\mathrm{csch}\\left(${args[0]}\\right)" }, sec: { 1: "\\sec\\left(${args[0]}\\right)" }, sech: { 1: "\\mathrm{sech}\\left(${args[0]}\\right)" }, sin: { 1: "\\sin\\left(${args[0]}\\right)" }, sinh: { 1: "\\sinh\\left(${args[0]}\\right)" }, tan: { 1: "\\tan\\left(${args[0]}\\right)" }, tanh: { 1: "\\tanh\\left(${args[0]}\\right)" }, to: { 2: "\\left(${args[0]}".concat(latexOperators.to, "${args[1]}\\right)") }, numeric: function (node) {return node.args[0].toTex();}, number: { 0: "0", 1: "\\left(${args[0]}\\right)", 2: "\\left(\\left(${args[0]}\\right)${args[1]}\\right)" }, string: { 0: "\\mathtt{\"\"}", 1: "\\mathrm{string}\\left(${args[0]}\\right)" }, bignumber: { 0: "0", 1: "\\left(${args[0]}\\right)" }, complex: { 0: "0", 1: "\\left(${args[0]}\\right)", 2: "\\left(\\left(${args[0]}\\right)+".concat(latexSymbols.i, "\\cdot\\left(${args[1]}\\right)\\right)") }, matrix: { 0: "\\begin{bmatrix}\\end{bmatrix}", 1: "\\left(${args[0]}\\right)", 2: "\\left(${args[0]}\\right)" }, sparse: { 0: "\\begin{bsparse}\\end{bsparse}", 1: "\\left(${args[0]}\\right)" }, unit: { 1: "\\left(${args[0]}\\right)", 2: "\\left(\\left(${args[0]}\\right)${args[1]}\\right)" } };exports.latexFunctions = latexFunctions;var defaultTemplate = "\\mathrm{${name}}\\left(${args}\\right)";exports.defaultTemplate = "\\mathrm{${name}}\\left(${args}\\right)";var latexUnits = { deg: "^\\circ" };function escapeLatex(string) {return (0, _escapeLatex["default"])(string, { preserveFormatting: !0 });}function toSymbol(name, isUnit) {return isUnit = "undefined" != typeof isUnit && isUnit, isUnit ? (0, _object.hasOwnProperty)(latexUnits, name) ? latexUnits[name] : "\\mathrm{" + escapeLatex(name) + "}" : (0, _object.hasOwnProperty)(latexSymbols, name) ? latexSymbols[name] : escapeLatex(name);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/lruQueue.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.lruQueue = lruQueue;function lruQueue(limit) {var size = 0,base = 1,queue = Object.create(null),map = Object.create(null),index = 0,del = function (id) {var oldIndex = map[id];if (oldIndex && (delete queue[oldIndex], delete map[id], --size, base === oldIndex)) {if (!size) return index = 0, void (base = 1);for (; !hasOwnProperty.call(queue, ++base);) continue;}};return limit = Math.abs(limit), { hit: function (id) {var oldIndex = map[id],nuIndex = ++index;if (queue[nuIndex] = id, map[id] = nuIndex, !oldIndex) return (++size, size <= limit) ? void 0 : (id = queue[base], del(id), id);if (delete queue[oldIndex], base === oldIndex) for (; !hasOwnProperty.call(queue, ++base);) continue;}, delete: del, clear: function () {size = index = 0, base = 1, queue = Object.create(null), map = Object.create(null);} };}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/map.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createEmptyMap = createEmptyMap, exports.createMap = createMap, exports.toObject = toObject, exports.isMap = isMap, exports.assign = assign, exports.ObjectWrappingMap = void 0;var _classCallCheck2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_customs = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/customs.js"),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js");function _createForOfIteratorHelper(o, allowArrayLike) {var it = "undefined" != typeof Symbol && o[Symbol.iterator] || o["@@iterator"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && "number" == typeof o.length) {it && (o = it);var i = 0,F = function () {};return { s: F, n: function () {return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] };}, e: function (_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var err,normalCompletion = !0,didErr = !1;return { s: function () {it = it.call(o);}, n: function () {var step = it.next();return normalCompletion = step.done, step;}, e: function (_e2) {didErr = !0, err = _e2;}, f: function () {try {normalCompletion || null == it["return"] || it["return"]();} finally {if (didErr) throw err;}} };}function _unsupportedIterableToArray(o, minLen) {if (o) {if ("string" == typeof o) return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);return "Object" === n && o.constructor && (n = o.constructor.name), "Map" === n || "Set" === n ? Array.from(o) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(o, minLen) : void 0;}}function _arrayLikeToArray(arr, len) {(null == len || len > arr.length) && (len = arr.length);for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}var ObjectWrappingMap = function () {function ObjectWrappingMap(object) {(0, _classCallCheck2["default"])(this, ObjectWrappingMap), this.wrappedObject = object;}return (0, _createClass2["default"])(ObjectWrappingMap, [{ key: "keys", value: function () {return Object.keys(this.wrappedObject);} }, { key: "get", value: function (key) {return (0, _customs.getSafeProperty)(this.wrappedObject, key);} }, { key: "set", value: function (key, value) {return (0, _customs.setSafeProperty)(this.wrappedObject, key, value), this;} }, { key: "has", value: function (key) {return (0, _customs.hasSafeProperty)(this.wrappedObject, key);} }]), ObjectWrappingMap;}();exports.ObjectWrappingMap = ObjectWrappingMap;function createEmptyMap() {return new Map();}function createMap(mapOrObject) {if (!mapOrObject) return createEmptyMap();if (isMap(mapOrObject)) return mapOrObject;if ((0, _is.isObject)(mapOrObject)) return new ObjectWrappingMap(mapOrObject);throw new Error("createMap can create maps from objects or Maps");}function toObject(map) {if (map instanceof ObjectWrappingMap) return map.wrappedObject;var _step,object = {},_iterator = _createForOfIteratorHelper(map.keys());try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var key = _step.value,value = map.get(key);(0, _customs.setSafeProperty)(object, key, value);}} catch (err) {_iterator.e(err);} finally {_iterator.f();}return object;}function isMap(object) {return !!object && (object instanceof Map || object instanceof ObjectWrappingMap || "function" == typeof object.set && "function" == typeof object.get && "function" == typeof object.keys && "function" == typeof object.has);}function assign(map) {for (var _len = arguments.length, objects = Array(1 < _len ? _len - 1 : 0), _key = 1; _key < _len; _key++) objects[_key - 1] = arguments[_key];for (var args, _i = 0, _objects = objects; _i < _objects.length; _i++) if (args = _objects[_i], !!args) if (isMap(args)) {var _step2,_iterator2 = _createForOfIteratorHelper(args.keys());try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {var key = _step2.value;map.set(key, args.get(key));}} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}} else if ((0, _is.isObject)(args)) for (var _key2, _i2 = 0, _Object$keys = Object.keys(args); _i2 < _Object$keys.length; _i2++) _key2 = _Object$keys[_i2], map.set(_key2, args[_key2]);return map;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/noop.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.noBignumber = noBignumber, exports.noFraction = noFraction, exports.noMatrix = noMatrix, exports.noIndex = noIndex, exports.noSubset = noSubset;function noBignumber() {throw new Error("No \"bignumber\" implementation available");}function noFraction() {throw new Error("No \"fraction\" implementation available");}function noMatrix() {throw new Error("No \"matrix\" implementation available");}function noIndex() {throw new Error("No \"index\" implementation available");}function noSubset() {throw new Error("No \"matrix\" implementation available");}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/number.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.isInteger = isInteger, exports.format = format, exports.splitNumber = splitNumber, exports.toEngineering = toEngineering, exports.toFixed = toFixed, exports.toExponential = toExponential, exports.toPrecision = toPrecision, exports.roundDigits = roundDigits, exports.digits = digits, exports.nearlyEqual = nearlyEqual, exports.tanh = exports.sinh = exports.cosh = exports.atanh = exports.asinh = exports.acosh = exports.DBL_EPSILON = exports.expm1 = exports.cbrt = exports.log1p = exports.log10 = exports.log2 = exports.sign = void 0;var _is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js");function isInteger(value) {return !("boolean" != typeof value) || !!isFinite(value) && value === Math.round(value);}var sign = Math.sign || function (x) {return 0 < x ? 1 : 0 > x ? -1 : 0;};exports.sign = sign;var log2 = Math.log2 || function (x) {return Math.log(x) / Math.LN2;};exports.log2 = log2;var log10 = Math.log10 || function (x) {return Math.log(x) / Math.LN10;};exports.log10 = log10;var log1p = Math.log1p || function (x) {return Math.log(x + 1);};exports.log1p = log1p;var cbrt = Math.cbrt || function (x) {if (0 === x) return x;var result,negate = 0 > x;return negate && (x = -x), isFinite(x) ? (result = Math.exp(Math.log(x) / 3), result = (x / (result * result) + 2 * result) / 3) : result = x, negate ? -result : result;};exports.cbrt = cbrt;var expm1 = Math.expm1 || function (x) {return 2e-4 <= x || -2e-4 >= x ? Math.exp(x) - 1 : x + x * x / 2 + x * x * x / 6;};exports.expm1 = expm1;function formatNumberToBase(n, base, size) {var prefix = { 2: "0b", 8: "0o", 16: "0x" }[base],suffix = "";if (size) {if (1 > size) throw new Error("size must be in greater than 0");if (!isInteger(size)) throw new Error("size must be an integer");if (n > Math.pow(2, size - 1) - 1 || n < -Math.pow(2, size - 1)) throw new Error("Value must be in range [-2^".concat(size - 1, ", 2^").concat(size - 1, "-1]"));if (!isInteger(n)) throw new Error("Value must be an integer");0 > n && (n += Math.pow(2, size)), suffix = "i".concat(size);}var sign = "";return 0 > n && (n = -n, sign = "-"), "".concat(sign).concat(prefix).concat(n.toString(base)).concat(suffix);}function format(value, options) {if ("function" == typeof options) return options(value);if (value === 1 / 0) return "Infinity";if (value === -Infinity) return "-Infinity";if (isNaN(value)) return "NaN";var precision,wordSize,notation = "auto";if (options && (options.notation && (notation = options.notation), (0, _is.isNumber)(options) ? precision = options : (0, _is.isNumber)(options.precision) && (precision = options.precision), options.wordSize && (wordSize = options.wordSize, "number" != typeof wordSize))) throw new Error("Option \"wordSize\" must be a number");switch (notation) {case "fixed":return toFixed(value, precision);case "exponential":return toExponential(value, precision);case "engineering":return toEngineering(value, precision);case "bin":return formatNumberToBase(value, 2, wordSize);case "oct":return formatNumberToBase(value, 8, wordSize);case "hex":return formatNumberToBase(value, 16, wordSize);case "auto":return toPrecision(value, precision, options && options).replace(/((\.\d*?)(0+))($|e)/, function () {var digits = arguments[2],e = arguments[4];return "." === digits ? e : digits + e;});default:throw new Error("Unknown notation \"" + notation + "\". Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.");}}function splitNumber(value) {var match = (value + "").toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if (!match) throw new SyntaxError("Invalid number " + value);var sign = match[1],digits = match[2],exponent = parseFloat(match[4] || "0"),dot = digits.indexOf(".");exponent += -1 === dot ? digits.length - 1 : dot - 1;var coefficients = digits.replace(".", "").replace(/^0*/, function (zeros) {return exponent -= zeros.length, "";}).replace(/0*$/, "").split("").map(function (d) {return parseInt(d);});return 0 === coefficients.length && (coefficients.push(0), exponent++), { sign: sign, coefficients: coefficients, exponent: exponent };}function toEngineering(value, precision) {if (isNaN(value) || !isFinite(value)) return value + "";var split = splitNumber(value),rounded = roundDigits(split, precision),e = rounded.exponent,c = rounded.coefficients,newExp = 0 == e % 3 ? e : 0 > e ? e - 3 - e % 3 : e - e % 3;if ((0, _is.isNumber)(precision)) for (; precision > c.length || e - newExp + 1 > c.length;) c.push(0);else for (var missingZeros = Math.abs(e - newExp) - (c.length - 1), i = 0; i < missingZeros; i++) c.push(0);for (var expDiff = Math.abs(e - newExp), decimalIdx = 1; 0 < expDiff;) decimalIdx++, expDiff--;var decimals = c.slice(decimalIdx).join(""),decimalVal = (0, _is.isNumber)(precision) && decimals.length || decimals.match(/[1-9]/) ? "." + decimals : "",str = c.slice(0, decimalIdx).join("") + decimalVal + "e" + (0 <= e ? "+" : "") + newExp.toString();return rounded.sign + str;}function toFixed(value, precision) {if (isNaN(value) || !isFinite(value)) return value + "";var splitValue = splitNumber(value),rounded = "number" == typeof precision ? roundDigits(splitValue, splitValue.exponent + 1 + precision) : splitValue,c = rounded.coefficients,p = rounded.exponent + 1,pp = p + (precision || 0);return c.length < pp && (c = c.concat(zeros(pp - c.length))), 0 > p && (c = zeros(-p + 1).concat(c), p = 1), p < c.length && c.splice(p, 0, 0 === p ? "0." : "."), rounded.sign + c.join("");}function toExponential(value, precision) {if (isNaN(value) || !isFinite(value)) return value + "";var split = splitNumber(value),rounded = precision ? roundDigits(split, precision) : split,c = rounded.coefficients,e = rounded.exponent;c.length < precision && (c = c.concat(zeros(precision - c.length)));var first = c.shift();return rounded.sign + first + (0 < c.length ? "." + c.join("") : "") + "e" + (0 <= e ? "+" : "") + e;}function toPrecision(value, precision, options) {if (isNaN(value) || !isFinite(value)) return value + "";var lowerExp = options && options.lowerExp !== void 0 ? options.lowerExp : -3,upperExp = options && options.upperExp !== void 0 ? options.upperExp : 5,split = splitNumber(value),rounded = precision ? roundDigits(split, precision) : split;if (rounded.exponent < lowerExp || rounded.exponent >= upperExp) return toExponential(value, precision);var c = rounded.coefficients,e = rounded.exponent;c.length < precision && (c = c.concat(zeros(precision - c.length))), c = c.concat(zeros(e - c.length + 1 + (c.length < precision ? precision - c.length : 0))), c = zeros(-e).concat(c);var dot = 0 < e ? e : 0;return dot < c.length - 1 && c.splice(dot + 1, 0, "."), rounded.sign + c.join("");}function roundDigits(split, precision) {for (var rounded = { sign: split.sign, coefficients: split.coefficients, exponent: split.exponent }, c = rounded.coefficients; 0 >= precision;) c.unshift(0), rounded.exponent++, precision++;if (c.length > precision) {var removed = c.splice(precision, c.length - precision);if (5 <= removed[0]) {var i = precision - 1;for (c[i]++; 10 === c[i];) c.pop(), 0 === i && (c.unshift(0), rounded.exponent++, i++), i--, c[i]++;}}return rounded;}function zeros(length) {for (var arr = [], i = 0; i < length; i++) arr.push(0);return arr;}function digits(value) {return value.toExponential().replace(/e.*$/, "").replace(/^0\.?0*|\./, "").length;}var DBL_EPSILON = Number.EPSILON || 2220446049250313e-31;exports.DBL_EPSILON = DBL_EPSILON;function nearlyEqual(x, y, epsilon) {if (null === epsilon || epsilon === void 0) return x === y;if (x === y) return !0;if (isNaN(x) || isNaN(y)) return !1;if (isFinite(x) && isFinite(y)) {var diff = Math.abs(x - y);return !!(diff < DBL_EPSILON) || diff <= Math.max(Math.abs(x), Math.abs(y)) * epsilon;}return !1;}var acosh = Math.acosh || function (x) {return Math.log(Math.sqrt(x * x - 1) + x);};exports.acosh = acosh;var asinh = Math.asinh || function (x) {return Math.log(Math.sqrt(x * x + 1) + x);};exports.asinh = asinh;var atanh = Math.atanh || function (x) {return Math.log((1 + x) / (1 - x)) / 2;};exports.atanh = atanh;var cosh = Math.cosh || function (x) {return (Math.exp(x) + Math.exp(-x)) / 2;};exports.cosh = cosh;var sinh = Math.sinh || function (x) {return (Math.exp(x) - Math.exp(-x)) / 2;};exports.sinh = sinh;var tanh = Math.tanh || function (x) {var e = Math.exp(2 * x);return (e - 1) / (e + 1);};exports.tanh = tanh;

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/object.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.clone = clone, exports.mapObject = mapObject, exports.extend = extend, exports.deepExtend = deepExtend, exports.deepStrictEqual = deepStrictEqual, exports.deepFlatten = deepFlatten, exports.canDefineProperty = canDefineProperty, exports.lazy = lazy, exports.traverse = traverse, exports.hasOwnProperty = hasOwnProperty, exports.isLegacyFactory = isLegacyFactory, exports.get = get, exports.set = set, exports.pick = pick, exports.pickShallow = pickShallow, exports.values = values;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js");function clone(x) {var type = (0, _typeof2["default"])(x);if ("number" === type || "string" === type || "boolean" === type || null === x || x === void 0) return x;if ("function" == typeof x.clone) return x.clone();if (Array.isArray(x)) return x.map(function (value) {return clone(value);});if (x instanceof Date) return new Date(x.valueOf());if ((0, _is.isBigNumber)(x)) return x;if (x instanceof RegExp) throw new TypeError("Cannot clone " + x);return mapObject(x, clone);}function mapObject(object, callback) {var clone = {};for (var key in object) hasOwnProperty(object, key) && (clone[key] = callback(object[key]));return clone;}function extend(a, b) {for (var prop in b) hasOwnProperty(b, prop) && (a[prop] = b[prop]);return a;}function deepExtend(a, b) {if (Array.isArray(b)) throw new TypeError("Arrays are not supported by deepExtend");for (var prop in b) if (hasOwnProperty(b, prop) && !(prop in Object.prototype) && !(prop in Function.prototype)) if (b[prop] && b[prop].constructor === Object) void 0 === a[prop] && (a[prop] = {}), a[prop] && a[prop].constructor === Object ? deepExtend(a[prop], b[prop]) : a[prop] = b[prop];else if (Array.isArray(b[prop])) throw new TypeError("Arrays are not supported by deepExtend");else a[prop] = b[prop];return a;}function deepStrictEqual(a, b) {var prop, i, len;if (Array.isArray(a)) {if (!Array.isArray(b)) return !1;if (a.length !== b.length) return !1;for (i = 0, len = a.length; i < len; i++) if (!deepStrictEqual(a[i], b[i])) return !1;return !0;}if ("function" == typeof a) return a === b;if (a instanceof Object) {if (Array.isArray(b) || !(b instanceof Object)) return !1;for (prop in a) if (!(prop in b) || !deepStrictEqual(a[prop], b[prop])) return !1;for (prop in b) if (!(prop in a) || !deepStrictEqual(a[prop], b[prop])) return !1;return !0;}return a === b;}function deepFlatten(nestedObject) {var flattenedObject = {};return _deepFlatten(nestedObject, flattenedObject), flattenedObject;}function _deepFlatten(nestedObject, flattenedObject) {for (var prop in nestedObject) if (hasOwnProperty(nestedObject, prop)) {var value = nestedObject[prop];"object" === (0, _typeof2["default"])(value) && null !== value ? _deepFlatten(value, flattenedObject) : flattenedObject[prop] = value;}}function canDefineProperty() {try {if (Object.defineProperty) return Object.defineProperty({}, "x", { get: function () {} }), !0;} catch (e) {}return !1;}function lazy(object, prop, valueResolver) {var _value,_uninitialized = !0;Object.defineProperty(object, prop, { get: function () {return _uninitialized && (_value = valueResolver(), _uninitialized = !1), _value;}, set: function (value) {_value = value, _uninitialized = !1;}, configurable: !0, enumerable: !0 });}function traverse(object, path) {if (path && "string" == typeof path) return traverse(object, path.split("."));var obj = object;if (path) for (var key, i = 0; i < path.length; i++) key = path[i], key in obj || (obj[key] = {}), obj = obj[key];return obj;}function hasOwnProperty(object, property) {return object && Object.hasOwnProperty.call(object, property);}function isLegacyFactory(object) {return object && "function" == typeof object.factory;}function get(object, path) {if ("string" == typeof path) return isPath(path) ? get(object, path.split(".")) : object[path];for (var key, child = object, i = 0; i < path.length; i++) key = path[i], child = child ? child[key] : void 0;return child;}function set(object, path, value) {if ("string" == typeof path) return isPath(path) ? set(object, path.split("."), value) : (object[path] = value, object);for (var key, child = object, i = 0; i < path.length - 1; i++) key = path[i], void 0 === child[key] && (child[key] = {}), child = child[key];if (0 < path.length) {var lastKey = path[path.length - 1];child[lastKey] = value;}return object;}function pick(object, properties, transform) {for (var copy = {}, i = 0; i < properties.length; i++) {var key = properties[i],value = get(object, key);value !== void 0 && set(copy, key, transform ? transform(value, key) : value);}return copy;}function pickShallow(object, properties) {for (var copy = {}, i = 0; i < properties.length; i++) {var key = properties[i],value = object[key];value !== void 0 && (copy[key] = value);}return copy;}function values(object) {return Object.keys(object).map(function (key) {return object[key];});}function isPath(str) {return -1 !== str.indexOf(".");}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/polyfills.js":
/***/ (() => {

"use strict";
Number.isFinite = Number.isFinite || function (value) {return "number" == typeof value && isFinite(value);}, Number.isNaN = Number.isNaN || function (value) {return value !== value;};

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/product.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.product = product;function product(i, n) {if (n < i) return 1;if (n === i) return n;var half = n + i >> 1;return product(i, half) * product(half + 1, n);}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/scope.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.createSubScope = createSubScope;var _map = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/map.js");function createSubScope(parentScope) {for (var _len = arguments.length, args = Array(1 < _len ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];return "function" == typeof parentScope.createSubScope ? _map.assign.apply(void 0, [parentScope.createSubScope()].concat(args)) : _map.assign.apply(void 0, [(0, _map.createEmptyMap)(), parentScope].concat(args));}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/utils/string.js":
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var _interopRequireDefault = __webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.endsWith = endsWith, exports.format = format, exports.stringify = stringify, exports.escape = escape, exports.compareText = compareText;var _typeof2 = _interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")),_is = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/is.js"),_number = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/number.js"),_formatter = __webpack_require__("./node_modules/mathjs/lib/cjs/utils/bignumber/formatter.js");function endsWith(text, search) {var start = text.length - search.length,end = text.length;return text.substring(start, end) === search;}function format(value, options) {if ("number" == typeof value) return (0, _number.format)(value, options);if ((0, _is.isBigNumber)(value)) return (0, _formatter.format)(value, options);if (looksLikeFraction(value)) return options && "decimal" === options.fraction ? value.toString() : value.s * value.n + "/" + value.d;if (Array.isArray(value)) return formatArray(value, options);if ((0, _is.isString)(value)) return "\"" + value + "\"";if ("function" == typeof value) return value.syntax ? value.syntax + "" : "function";if (value && "object" === (0, _typeof2["default"])(value)) {if ("function" == typeof value.format) return value.format(options);if (value && value.toString(options) !== {}.toString()) return value.toString(options);var entries = Object.keys(value).map(function (key) {return "\"" + key + "\": " + format(value[key], options);});return "{" + entries.join(", ") + "}";}return value + "";}function stringify(value) {for (var text = value + "", escaped = "", i = 0; i < text.length;) {var c = text.charAt(i);"\\" === c ? (escaped += c, i++, c = text.charAt(i), ("" === c || -1 === "\"\\/bfnrtu".indexOf(c)) && (escaped += "\\"), escaped += c) : "\"" === c ? escaped += "\\\"" : escaped += c, i++;}return "\"" + escaped + "\"";}function escape(value) {var text = value + "";return text = text.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), text;}function formatArray(array, options) {if (Array.isArray(array)) {for (var str = "[", len = array.length, i = 0; i < len; i++) 0 != i && (str += ", "), str += formatArray(array[i], options);return str += "]", str;}return format(array, options);}function looksLikeFraction(value) {return value && "object" === (0, _typeof2["default"])(value) && "number" == typeof value.s && "number" == typeof value.n && "number" == typeof value.d || !1;}function compareText(x, y) {if (!(0, _is.isString)(x)) throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: " + (0, _is.typeOf)(x) + ", index: 0)");if (!(0, _is.isString)(y)) throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: " + (0, _is.typeOf)(y) + ", index: 1)");return x === y ? 0 : x > y ? 1 : -1;}

/***/ }),

/***/ "./node_modules/mathjs/lib/cjs/version.js":
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Object.defineProperty(exports, "__esModule", ({ value: !0 })), exports.version = void 0;var version = "9.4.1";exports.version = "9.4.1";

/***/ }),

/***/ "./node_modules/@babylonjs/core/Actions/abstractActionManager.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "O": () => (/* binding */ AbstractActionManager)
/* harmony export */ });
class AbstractActionManager {constructor() {this.hoverCursor = "", this.actions = [], this.isRecursive = !1;}static get HasTriggers() {for (const t in AbstractActionManager.Triggers) if (Object.prototype.hasOwnProperty.call(AbstractActionManager.Triggers, t)) return !0;return !1;}static get HasPickTriggers() {for (const t in AbstractActionManager.Triggers) if (Object.prototype.hasOwnProperty.call(AbstractActionManager.Triggers, t)) {const tAsInt = parseInt(t);if (1 <= tAsInt && 7 >= tAsInt) return !0;}return !1;}static HasSpecificTrigger(trigger) {for (const t in AbstractActionManager.Triggers) if (Object.prototype.hasOwnProperty.call(AbstractActionManager.Triggers, t)) {const tAsInt = parseInt(t);if (tAsInt === trigger) return !0;}return !1;}}AbstractActionManager.Triggers = {};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Actions/actionEvent.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "V": () => (/* binding */ ActionEvent)
/* harmony export */ });
class ActionEvent {constructor(source, pointerX, pointerY, meshUnderPointer, sourceEvent, additionalData) {this.source = source, this.pointerX = pointerX, this.pointerY = pointerY, this.meshUnderPointer = meshUnderPointer, this.sourceEvent = sourceEvent, this.additionalData = additionalData;}static CreateNew(source, evt, additionalData) {const scene = source.getScene();return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer || source, evt, additionalData);}static CreateNewFromSprite(source, scene, evt, additionalData) {return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt, additionalData);}static CreateNewFromScene(scene, evt) {return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt);}static CreateNewFromPrimitive(prim, pointerPos, evt, additionalData) {return new ActionEvent(prim, pointerPos.x, pointerPos.y, null, evt, additionalData);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Animations/animation.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "f": () => (/* binding */ Animation),
/* harmony export */   "u": () => (/* binding */ _IAnimationState)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
/* harmony import */ var _animationKey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationKey.js");
/* harmony import */ var _animationRange_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationRange.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.size.js");
/* harmony import */ var _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/webRequest.js");
class _IAnimationState {}class Animation {static _PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction) {let dataType;if (!isNaN(parseFloat(from)) && isFinite(from) ? dataType = Animation.ANIMATIONTYPE_FLOAT : from instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ ._f ? dataType = Animation.ANIMATIONTYPE_QUATERNION : from instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P ? dataType = Animation.ANIMATIONTYPE_VECTOR3 : from instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .FM ? dataType = Animation.ANIMATIONTYPE_VECTOR2 : from instanceof _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .Wo ? dataType = Animation.ANIMATIONTYPE_COLOR3 : from instanceof _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .HE ? dataType = Animation.ANIMATIONTYPE_COLOR4 : from instanceof _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_8__/* .Size */ .$ && (dataType = Animation.ANIMATIONTYPE_SIZE), null == dataType) return null;const animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);return animation.setKeys([{ frame: 0, value: from }, { frame: totalFrame, value: to }]), void 0 !== easingFunction && animation.setEasingFunction(easingFunction), animation;}static CreateAnimation(property, animationType, framePerSecond, easingFunction) {const animation = new Animation(property + "Animation", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);return animation.setEasingFunction(easingFunction), animation;}static CreateAndStartAnimation(name, target, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd, scene) {const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);return animation ? (target.getScene && (scene = target.getScene()), scene ? scene.beginDirectAnimation(target, [animation], 0, totalFrame, 1 === animation.loopMode, 1, onAnimationEnd) : null) : null;}static CreateAndStartHierarchyAnimation(name, node, directDescendantsOnly, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);if (!animation) return null;const scene = node.getScene();return scene.beginDirectHierarchyAnimation(node, directDescendantsOnly, [animation], 0, totalFrame, 1 === animation.loopMode, 1, onAnimationEnd);}static CreateMergeAndStartAnimation(name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);return animation ? (node.animations.push(animation), node.getScene().beginAnimation(node, 0, totalFrame, 1 === animation.loopMode, 1, onAnimationEnd)) : null;}static MakeAnimationAdditive(sourceAnimation, referenceFrame = 0, range, cloneOriginal = !1, clonedName) {let animation = sourceAnimation;if (cloneOriginal && (animation = sourceAnimation.clone(), animation.name = clonedName || animation.name), !animation._keys.length) return animation;referenceFrame = 0 <= referenceFrame ? referenceFrame : 0;let startIndex = 0;const firstKey = animation._keys[0];let endIndex = animation._keys.length - 1;const lastKey = animation._keys[endIndex],valueStore = { referenceValue: firstKey.value, referencePosition: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0], referenceQuaternion: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0], referenceScaling: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1], keyPosition: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2], keyQuaternion: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Quaternion[1] */ .jp.Quaternion[1], keyScaling: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Vector3[3] */ .jp.Vector3[3] };let referenceFound = !1,from = firstKey.frame,to = lastKey.frame;if (range) {const rangeValue = animation.getRange(range);rangeValue && (from = rangeValue.from, to = rangeValue.to);}let fromKeyFound = firstKey.frame === from,toKeyFound = lastKey.frame === to;if (1 === animation._keys.length) {const value = animation._getKeyValue(animation._keys[0]);valueStore.referenceValue = value.clone ? value.clone() : value, referenceFound = !0;} else if (referenceFrame <= firstKey.frame) {const value = animation._getKeyValue(firstKey.value);valueStore.referenceValue = value.clone ? value.clone() : value, referenceFound = !0;} else if (referenceFrame >= lastKey.frame) {const value = animation._getKeyValue(lastKey.value);valueStore.referenceValue = value.clone ? value.clone() : value, referenceFound = !0;}let index = 0;for (; !referenceFound || !fromKeyFound || !toKeyFound && index < animation._keys.length - 1;) {const currentKey = animation._keys[index],nextKey = animation._keys[index + 1];if (!referenceFound && referenceFrame >= currentKey.frame && referenceFrame <= nextKey.frame) {let value;if (referenceFrame === currentKey.frame) value = animation._getKeyValue(currentKey.value);else if (referenceFrame === nextKey.frame) value = animation._getKeyValue(nextKey.value);else {const animationState = { key: index, repeatCount: 0, loopMode: this.ANIMATIONLOOPMODE_CONSTANT };value = animation._interpolate(referenceFrame, animationState);}valueStore.referenceValue = value.clone ? value.clone() : value, referenceFound = !0;}if (!fromKeyFound && from >= currentKey.frame && from <= nextKey.frame) {if (from === currentKey.frame) startIndex = index;else if (from === nextKey.frame) startIndex = index + 1;else {const animationState = { key: index, repeatCount: 0, loopMode: this.ANIMATIONLOOPMODE_CONSTANT },value = animation._interpolate(from, animationState),key = { frame: from, value: value.clone ? value.clone() : value };animation._keys.splice(index + 1, 0, key), startIndex = index + 1;}fromKeyFound = !0;}if (!toKeyFound && to >= currentKey.frame && to <= nextKey.frame) {if (to === currentKey.frame) endIndex = index;else if (to === nextKey.frame) endIndex = index + 1;else {const animationState = { key: index, repeatCount: 0, loopMode: this.ANIMATIONLOOPMODE_CONSTANT },value = animation._interpolate(to, animationState),key = { frame: to, value: value.clone ? value.clone() : value };animation._keys.splice(index + 1, 0, key), endIndex = index + 1;}toKeyFound = !0;}index++;}for (animation.dataType === Animation.ANIMATIONTYPE_QUATERNION ? valueStore.referenceValue.normalize().conjugateInPlace() : animation.dataType === Animation.ANIMATIONTYPE_MATRIX && (valueStore.referenceValue.decompose(valueStore.referenceScaling, valueStore.referenceQuaternion, valueStore.referencePosition), valueStore.referenceQuaternion.normalize().conjugateInPlace()), index = startIndex; index <= endIndex; index++) {const key = animation._keys[index];if (!(index && animation.dataType !== Animation.ANIMATIONTYPE_FLOAT && key.value === firstKey.value)) switch (animation.dataType) {case Animation.ANIMATIONTYPE_MATRIX:key.value.decompose(valueStore.keyScaling, valueStore.keyQuaternion, valueStore.keyPosition), valueStore.keyPosition.subtractInPlace(valueStore.referencePosition), valueStore.keyScaling.divideInPlace(valueStore.referenceScaling), valueStore.referenceQuaternion.multiplyToRef(valueStore.keyQuaternion, valueStore.keyQuaternion), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.ComposeToRef */ .y3.ComposeToRef(valueStore.keyScaling, valueStore.keyQuaternion, valueStore.keyPosition, key.value);break;case Animation.ANIMATIONTYPE_QUATERNION:valueStore.referenceValue.multiplyToRef(key.value, key.value);break;case Animation.ANIMATIONTYPE_VECTOR2:case Animation.ANIMATIONTYPE_VECTOR3:case Animation.ANIMATIONTYPE_COLOR3:case Animation.ANIMATIONTYPE_COLOR4:key.value.subtractToRef(valueStore.referenceValue, key.value);break;case Animation.ANIMATIONTYPE_SIZE:key.value.width -= valueStore.referenceValue.width, key.value.height -= valueStore.referenceValue.height;break;default:key.value -= valueStore.referenceValue;}}return animation;}static TransitionTo(property, targetValue, host, scene, frameRate, transition, duration, onAnimationEnd = null) {if (0 >= duration) return host[property] = targetValue, onAnimationEnd && onAnimationEnd(), null;const endFrame = frameRate * (duration / 1e3);transition.setKeys([{ frame: 0, value: host[property].clone ? host[property].clone() : host[property] }, { frame: endFrame, value: targetValue }]), host.animations || (host.animations = []), host.animations.push(transition);const animation = scene.beginAnimation(host, 0, endFrame, !1);return animation.onAnimationEnd = onAnimationEnd, animation;}get runtimeAnimations() {return this._runtimeAnimations;}get hasRunningRuntimeAnimations() {for (const runtimeAnimation of this._runtimeAnimations) if (!runtimeAnimation.isStopped()) return !0;return !1;}constructor(name, targetProperty, framePerSecond, dataType, loopMode, enableBlending) {this.name = name, this.targetProperty = targetProperty, this.framePerSecond = framePerSecond, this.dataType = dataType, this.loopMode = loopMode, this.enableBlending = enableBlending, this._easingFunction = null, this._runtimeAnimations = [], this._events = [], this.blendingSpeed = .01, this._ranges = {}, this.targetPropertyPath = targetProperty.split("."), this.dataType = dataType, this.loopMode = loopMode === void 0 ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode, this.uniqueId = Animation._UniqueIdGenerator++;}toString(fullDetails) {let ret = "Name: " + this.name + ", property: " + this.targetProperty;if (ret += ", datatype: " + ["Float", "Vector3", "Quaternion", "Matrix", "Color3", "Vector2"][this.dataType], ret += ", nKeys: " + (this._keys ? this._keys.length : "none"), ret += ", nRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none"), fullDetails) {ret += ", Ranges: {";let first = !0;for (const name in this._ranges) first && (ret += ", ", first = !1), ret += name;ret += "}";}return ret;}addEvent(event) {this._events.push(event), this._events.sort((a, b) => a.frame - b.frame);}removeEvents(frame) {for (let index = 0; index < this._events.length; index++) this._events[index].frame === frame && (this._events.splice(index, 1), index--);}getEvents() {return this._events;}createRange(name, from, to) {this._ranges[name] || (this._ranges[name] = new _animationRange_js__WEBPACK_IMPORTED_MODULE_6__/* .AnimationRange */ .X(name, from, to));}deleteRange(name, deleteFrames = !0) {const range = this._ranges[name];if (range) {if (deleteFrames) {const from = range.from,to = range.to;for (let key = this._keys.length - 1; 0 <= key; key--) this._keys[key].frame >= from && this._keys[key].frame <= to && this._keys.splice(key, 1);}this._ranges[name] = null;}}getRange(name) {return this._ranges[name];}getKeys() {return this._keys;}getHighestFrame() {let ret = 0;for (let key = 0, nKeys = this._keys.length; key < nKeys; key++) ret < this._keys[key].frame && (ret = this._keys[key].frame);return ret;}getEasingFunction() {return this._easingFunction;}setEasingFunction(easingFunction) {this._easingFunction = easingFunction;}floatInterpolateFunction(startValue, endValue, gradient) {return _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_2__/* .Scalar.Lerp */ .R.Lerp(startValue, endValue, gradient);}floatInterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {return _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_2__/* .Scalar.Hermite */ .R.Hermite(startValue, outTangent, endValue, inTangent, gradient);}quaternionInterpolateFunction(startValue, endValue, gradient) {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.Slerp */ ._f.Slerp(startValue, endValue, gradient);}quaternionInterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.Hermite */ ._f.Hermite(startValue, outTangent, endValue, inTangent, gradient).normalize();}vector3InterpolateFunction(startValue, endValue, gradient) {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Lerp */ .P.Lerp(startValue, endValue, gradient);}vector3InterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Hermite */ .P.Hermite(startValue, outTangent, endValue, inTangent, gradient);}vector2InterpolateFunction(startValue, endValue, gradient) {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2.Lerp */ .FM.Lerp(startValue, endValue, gradient);}vector2InterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2.Hermite */ .FM.Hermite(startValue, outTangent, endValue, inTangent, gradient);}sizeInterpolateFunction(startValue, endValue, gradient) {return _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_8__/* .Size.Lerp */ .$.Lerp(startValue, endValue, gradient);}color3InterpolateFunction(startValue, endValue, gradient) {return _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3.Lerp */ .Wo.Lerp(startValue, endValue, gradient);}color3InterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {return _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3.Hermite */ .Wo.Hermite(startValue, outTangent, endValue, inTangent, gradient);}color4InterpolateFunction(startValue, endValue, gradient) {return _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4.Lerp */ .HE.Lerp(startValue, endValue, gradient);}color4InterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {return _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4.Hermite */ .HE.Hermite(startValue, outTangent, endValue, inTangent, gradient);}_getKeyValue(value) {return "function" == typeof value ? value() : value;}evaluate(currentFrame) {return this._interpolate(currentFrame, { key: 0, repeatCount: 0, loopMode: Animation.ANIMATIONLOOPMODE_CONSTANT });}_interpolate(currentFrame, state) {if (state.loopMode === Animation.ANIMATIONLOOPMODE_CONSTANT && 0 < state.repeatCount) return state.highLimitValue.clone ? state.highLimitValue.clone() : state.highLimitValue;const keys = this._keys,keysLength = keys.length;let key = state.key;for (; 0 <= key && currentFrame < keys[key].frame;) --key;for (; key + 1 <= keysLength - 1 && currentFrame >= keys[key + 1].frame;) ++key;if (state.key = key, 0 > key) return this._getKeyValue(keys[0].value);if (key + 1 > keysLength - 1) return this._getKeyValue(keys[keysLength - 1].value);const startKey = keys[key],endKey = keys[key + 1],startValue = this._getKeyValue(startKey.value),endValue = this._getKeyValue(endKey.value);if (startKey.interpolation === _animationKey_js__WEBPACK_IMPORTED_MODULE_5__/* .AnimationKeyInterpolation.STEP */ .N.STEP) return endKey.frame > currentFrame ? startValue : endValue;const useTangent = void 0 !== startKey.outTangent && void 0 !== endKey.inTangent,frameDelta = endKey.frame - startKey.frame;let gradient = (currentFrame - startKey.frame) / frameDelta;const easingFunction = this.getEasingFunction();switch (null !== easingFunction && (gradient = easingFunction.ease(gradient)), this.dataType) {case Animation.ANIMATIONTYPE_FLOAT:{const floatValue = useTangent ? this.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient) : this.floatInterpolateFunction(startValue, endValue, gradient);switch (state.loopMode) {case Animation.ANIMATIONLOOPMODE_CYCLE:case Animation.ANIMATIONLOOPMODE_CONSTANT:return floatValue;case Animation.ANIMATIONLOOPMODE_RELATIVE:return state.offsetValue * state.repeatCount + floatValue;}break;}case Animation.ANIMATIONTYPE_QUATERNION:{const quatValue = useTangent ? this.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.quaternionInterpolateFunction(startValue, endValue, gradient);switch (state.loopMode) {case Animation.ANIMATIONLOOPMODE_CYCLE:case Animation.ANIMATIONLOOPMODE_CONSTANT:return quatValue;case Animation.ANIMATIONLOOPMODE_RELATIVE:return quatValue.addInPlace(state.offsetValue.scale(state.repeatCount));}return quatValue;}case Animation.ANIMATIONTYPE_VECTOR3:{const vec3Value = useTangent ? this.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.vector3InterpolateFunction(startValue, endValue, gradient);switch (state.loopMode) {case Animation.ANIMATIONLOOPMODE_CYCLE:case Animation.ANIMATIONLOOPMODE_CONSTANT:return vec3Value;case Animation.ANIMATIONLOOPMODE_RELATIVE:return vec3Value.add(state.offsetValue.scale(state.repeatCount));}break;}case Animation.ANIMATIONTYPE_VECTOR2:{const vec2Value = useTangent ? this.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.vector2InterpolateFunction(startValue, endValue, gradient);switch (state.loopMode) {case Animation.ANIMATIONLOOPMODE_CYCLE:case Animation.ANIMATIONLOOPMODE_CONSTANT:return vec2Value;case Animation.ANIMATIONLOOPMODE_RELATIVE:return vec2Value.add(state.offsetValue.scale(state.repeatCount));}break;}case Animation.ANIMATIONTYPE_SIZE:{switch (state.loopMode) {case Animation.ANIMATIONLOOPMODE_CYCLE:case Animation.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(startValue, endValue, gradient);case Animation.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(startValue, endValue, gradient).add(state.offsetValue.scale(state.repeatCount));}break;}case Animation.ANIMATIONTYPE_COLOR3:{const color3Value = useTangent ? this.color3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.color3InterpolateFunction(startValue, endValue, gradient);switch (state.loopMode) {case Animation.ANIMATIONLOOPMODE_CYCLE:case Animation.ANIMATIONLOOPMODE_CONSTANT:return color3Value;case Animation.ANIMATIONLOOPMODE_RELATIVE:return color3Value.add(state.offsetValue.scale(state.repeatCount));}break;}case Animation.ANIMATIONTYPE_COLOR4:{const color4Value = useTangent ? this.color4InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.color4InterpolateFunction(startValue, endValue, gradient);switch (state.loopMode) {case Animation.ANIMATIONLOOPMODE_CYCLE:case Animation.ANIMATIONLOOPMODE_CONSTANT:return color4Value;case Animation.ANIMATIONLOOPMODE_RELATIVE:return color4Value.add(state.offsetValue.scale(state.repeatCount));}break;}case Animation.ANIMATIONTYPE_MATRIX:{switch (state.loopMode) {case Animation.ANIMATIONLOOPMODE_CYCLE:case Animation.ANIMATIONLOOPMODE_CONSTANT:return Animation.AllowMatricesInterpolation ? this.matrixInterpolateFunction(startValue, endValue, gradient, state.workValue) : startValue;case Animation.ANIMATIONLOOPMODE_RELATIVE:return startValue;}break;}}return 0;}matrixInterpolateFunction(startValue, endValue, gradient, result) {return Animation.AllowMatrixDecomposeForInterpolation ? result ? (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.DecomposeLerpToRef */ .y3.DecomposeLerpToRef(startValue, endValue, gradient, result), result) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.DecomposeLerp */ .y3.DecomposeLerp(startValue, endValue, gradient) : result ? (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.LerpToRef */ .y3.LerpToRef(startValue, endValue, gradient, result), result) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.Lerp */ .y3.Lerp(startValue, endValue, gradient);}clone() {const clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);if (clone.enableBlending = this.enableBlending, clone.blendingSpeed = this.blendingSpeed, this._keys && clone.setKeys(this._keys), this._ranges) for (const name in clone._ranges = {}, this._ranges) {const range = this._ranges[name];range && (clone._ranges[name] = range.clone());}return clone;}setKeys(values) {this._keys = values.slice(0);}serialize() {const serializationObject = { name: this.name, property: this.targetProperty, framePerSecond: this.framePerSecond, dataType: this.dataType, loopBehavior: this.loopMode, enableBlending: this.enableBlending, blendingSpeed: this.blendingSpeed },dataType = this.dataType;serializationObject.keys = [];const keys = this.getKeys();for (let index = 0; index < keys.length; index++) {const animationKey = keys[index],key = {};key.frame = animationKey.frame, dataType === Animation.ANIMATIONTYPE_FLOAT ? (key.values = [animationKey.value], void 0 !== animationKey.inTangent && key.values.push(animationKey.inTangent), void 0 !== animationKey.outTangent && (void 0 === animationKey.inTangent && key.values.push(void 0), key.values.push(animationKey.outTangent)), void 0 !== animationKey.interpolation && (void 0 === animationKey.inTangent && key.values.push(void 0), void 0 === animationKey.outTangent && key.values.push(void 0), key.values.push(animationKey.interpolation))) : dataType === Animation.ANIMATIONTYPE_QUATERNION || dataType === Animation.ANIMATIONTYPE_MATRIX || dataType === Animation.ANIMATIONTYPE_VECTOR3 || dataType === Animation.ANIMATIONTYPE_COLOR3 || dataType === Animation.ANIMATIONTYPE_COLOR4 ? (key.values = animationKey.value.asArray(), null != animationKey.inTangent && key.values.push(animationKey.inTangent.asArray()), null != animationKey.outTangent && (void 0 === animationKey.inTangent && key.values.push(void 0), key.values.push(animationKey.outTangent.asArray())), void 0 !== animationKey.interpolation && (void 0 === animationKey.inTangent && key.values.push(void 0), void 0 === animationKey.outTangent && key.values.push(void 0), key.values.push(animationKey.interpolation))) : void 0, serializationObject.keys.push(key);}for (const name in serializationObject.ranges = [], this._ranges) {const source = this._ranges[name];if (!source) continue;const range = {};range.name = name, range.from = source.from, range.to = source.to, serializationObject.ranges.push(range);}return serializationObject;}static _UniversalLerp(left, right, amount) {const constructor = left.constructor;return constructor.Lerp ? constructor.Lerp(left, right, amount) : constructor.Slerp ? constructor.Slerp(left, right, amount) : left.toFixed ? left * (1 - amount) + amount * right : right;}static Parse(parsedAnimation) {const animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior),dataType = parsedAnimation.dataType,keys = [];let data, index;for (parsedAnimation.enableBlending && (animation.enableBlending = parsedAnimation.enableBlending), parsedAnimation.blendingSpeed && (animation.blendingSpeed = parsedAnimation.blendingSpeed), index = 0; index < parsedAnimation.keys.length; index++) {const key = parsedAnimation.keys[index];let inTangent, outTangent, interpolation;switch (dataType) {case Animation.ANIMATIONTYPE_FLOAT:data = key.values[0], 2 <= key.values.length && (inTangent = key.values[1]), 3 <= key.values.length && (outTangent = key.values[2]), 4 <= key.values.length && (interpolation = key.values[3]);break;case Animation.ANIMATIONTYPE_QUATERNION:if (data = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.FromArray */ ._f.FromArray(key.values), 8 <= key.values.length) {const _inTangent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.FromArray */ ._f.FromArray(key.values.slice(4, 8));_inTangent.equals(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.Zero */ ._f.Zero()) || (inTangent = _inTangent);}if (12 <= key.values.length) {const _outTangent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.FromArray */ ._f.FromArray(key.values.slice(8, 12));_outTangent.equals(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.Zero */ ._f.Zero()) || (outTangent = _outTangent);}13 <= key.values.length && (interpolation = key.values[12]);break;case Animation.ANIMATIONTYPE_MATRIX:data = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.FromArray */ .y3.FromArray(key.values), 17 <= key.values.length && (interpolation = key.values[16]);break;case Animation.ANIMATIONTYPE_COLOR3:data = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3.FromArray */ .Wo.FromArray(key.values), key.values[3] && (inTangent = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3.FromArray */ .Wo.FromArray(key.values[3])), key.values[4] && (outTangent = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3.FromArray */ .Wo.FromArray(key.values[4])), key.values[5] && (interpolation = key.values[5]);break;case Animation.ANIMATIONTYPE_COLOR4:data = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4.FromArray */ .HE.FromArray(key.values), key.values[4] && (inTangent = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4.FromArray */ .HE.FromArray(key.values[4])), key.values[5] && (outTangent = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4.FromArray */ .HE.FromArray(key.values[5])), key.values[6] && (interpolation = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4.FromArray */ .HE.FromArray(key.values[6]));break;case Animation.ANIMATIONTYPE_VECTOR3:default:data = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(key.values), key.values[3] && (inTangent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(key.values[3])), key.values[4] && (outTangent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(key.values[4])), key.values[5] && (interpolation = key.values[5]);}const keyData = {};keyData.frame = key.frame, keyData.value = data, null != inTangent && (keyData.inTangent = inTangent), null != outTangent && (keyData.outTangent = outTangent), null != interpolation && (keyData.interpolation = interpolation), keys.push(keyData);}if (animation.setKeys(keys), parsedAnimation.ranges) for (index = 0; index < parsedAnimation.ranges.length; index++) data = parsedAnimation.ranges[index], animation.createRange(data.name, data.from, data.to);return animation;}static AppendSerializedAnimations(source, destination) {_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper.AppendSerializedAnimations */ .p4.AppendSerializedAnimations(source, destination);}static ParseFromFileAsync(name, url) {return new Promise((resolve, reject) => {const request = new _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_9__/* .WebRequest */ .g();request.addEventListener("readystatechange", () => {if (4 == request.readyState) if (200 == request.status) {let serializationObject = JSON.parse(request.responseText);if (serializationObject.animations && (serializationObject = serializationObject.animations), serializationObject.length) {const output = [];for (const serializedAnimation of serializationObject) output.push(this.Parse(serializedAnimation));resolve(output);} else {const output = this.Parse(serializationObject);name && (output.name = name), resolve(output);}} else reject("Unable to load the animation");}), request.open("GET", url), request.send();});}static ParseFromSnippetAsync(snippetId) {return new Promise((resolve, reject) => {const request = new _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_9__/* .WebRequest */ .g();request.addEventListener("readystatechange", () => {if (4 == request.readyState) if (200 == request.status) {const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);if (snippet.animations) {const serializationObject = JSON.parse(snippet.animations),outputs = [];for (const serializedAnimation of serializationObject.animations) {const output = this.Parse(serializedAnimation);output.snippetId = snippetId, outputs.push(output);}resolve(outputs);} else {const serializationObject = JSON.parse(snippet.animation),output = this.Parse(serializationObject);output.snippetId = snippetId, resolve(output);}} else reject("Unable to load the snippet " + snippetId);}), request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/")), request.send();});}}Animation._UniqueIdGenerator = 0, Animation.AllowMatricesInterpolation = !1, Animation.AllowMatrixDecomposeForInterpolation = !0, Animation.SnippetUrl = `https://snippet.babylonjs.com`, Animation.ANIMATIONTYPE_FLOAT = 0, Animation.ANIMATIONTYPE_VECTOR3 = 1, Animation.ANIMATIONTYPE_QUATERNION = 2, Animation.ANIMATIONTYPE_MATRIX = 3, Animation.ANIMATIONTYPE_COLOR3 = 4, Animation.ANIMATIONTYPE_COLOR4 = 7, Animation.ANIMATIONTYPE_VECTOR2 = 5, Animation.ANIMATIONTYPE_SIZE = 6, Animation.ANIMATIONLOOPMODE_RELATIVE = 0, Animation.ANIMATIONLOOPMODE_CYCLE = 1, Animation.ANIMATIONLOOPMODE_CONSTANT = 2, Animation.CreateFromSnippetAsync = Animation.ParseFromSnippetAsync, (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_4__/* .RegisterClass */ .H)("BABYLON.Animation", Animation), _node_js__WEBPACK_IMPORTED_MODULE_7__/* .Node._AnimationRangeFactory */ .N._AnimationRangeFactory = (name, from, to) => new _animationRange_js__WEBPACK_IMPORTED_MODULE_6__/* .AnimationRange */ .X(name, from, to);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Animations/animationEvent.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "O": () => (/* binding */ AnimationEvent)
/* harmony export */ });
class AnimationEvent {constructor(frame, action, onlyOnce) {this.frame = frame, this.action = action, this.onlyOnce = onlyOnce, this.isDone = !1;}_clone() {return new AnimationEvent(this.frame, this.action, this.onlyOnce);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Animations/animationGroup.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "O": () => (/* binding */ AnimationGroup),
/* harmony export */   "U": () => (/* binding */ TargetedAnimation)
/* harmony export */ });
/* harmony import */ var _animation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Animations/animation.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tags.js");
class TargetedAnimation {getClassName() {return "TargetedAnimation";}serialize() {const serializationObject = { animation: this.animation.serialize(), targetId: this.target.id };return serializationObject;}}class AnimationGroup {get from() {return this._from;}get to() {return this._to;}get isStarted() {return this._isStarted;}get isPlaying() {return this._isStarted && !this._isPaused;}get speedRatio() {return this._speedRatio;}set speedRatio(value) {if (this._speedRatio !== value) {this._speedRatio = value;for (let index = 0; index < this._animatables.length; index++) {const animatable = this._animatables[index];animatable.speedRatio = this._speedRatio;}}}get loopAnimation() {return this._loopAnimation;}set loopAnimation(value) {if (this._loopAnimation !== value) {this._loopAnimation = value;for (let index = 0; index < this._animatables.length; index++) {const animatable = this._animatables[index];animatable.loopAnimation = this._loopAnimation;}}}get isAdditive() {return this._isAdditive;}set isAdditive(value) {if (this._isAdditive !== value) {this._isAdditive = value;for (let index = 0; index < this._animatables.length; index++) {const animatable = this._animatables[index];animatable.isAdditive = this._isAdditive;}}}get targetedAnimations() {return this._targetedAnimations;}get animatables() {return this._animatables;}get children() {return this._targetedAnimations;}constructor(name, scene = null) {this.name = name, this._targetedAnimations = [], this._animatables = [], this._from = Number.MAX_VALUE, this._to = -Number.MAX_VALUE, this._speedRatio = 1, this._loopAnimation = !1, this._isAdditive = !1, this._parentContainer = null, this.onAnimationEndObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this.onAnimationLoopObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this.onAnimationGroupLoopObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this.onAnimationGroupEndObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this.onAnimationGroupPauseObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this.onAnimationGroupPlayObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this.metadata = null, this._animationLoopFlags = [], this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, this.uniqueId = this._scene.getUniqueId(), this._scene.addAnimationGroup(this);}addTargetedAnimation(animation, target) {const targetedAnimation = new TargetedAnimation();targetedAnimation.animation = animation, targetedAnimation.target = target;const keys = animation.getKeys();return this._from > keys[0].frame && (this._from = keys[0].frame), this._to < keys[keys.length - 1].frame && (this._to = keys[keys.length - 1].frame), this._targetedAnimations.push(targetedAnimation), targetedAnimation;}normalize(beginFrame = null, endFrame = null) {null == beginFrame && (beginFrame = this._from), null == endFrame && (endFrame = this._to);for (let index = 0; index < this._targetedAnimations.length; index++) {const targetedAnimation = this._targetedAnimations[index],keys = targetedAnimation.animation.getKeys(),startKey = keys[0],endKey = keys[keys.length - 1];if (startKey.frame > beginFrame) {const newKey = { frame: beginFrame, value: startKey.value, inTangent: startKey.inTangent, outTangent: startKey.outTangent, interpolation: startKey.interpolation };keys.splice(0, 0, newKey);}if (endKey.frame < endFrame) {const newKey = { frame: endFrame, value: endKey.value, inTangent: endKey.inTangent, outTangent: endKey.outTangent, interpolation: endKey.interpolation };keys.push(newKey);}}return this._from = beginFrame, this._to = endFrame, this;}_processLoop(animatable, targetedAnimation, index) {animatable.onAnimationLoop = () => {this.onAnimationLoopObservable.notifyObservers(targetedAnimation);this._animationLoopFlags[index] || (this._animationLoopFlags[index] = !0, this._animationLoopCount++, this._animationLoopCount === this._targetedAnimations.length && (this.onAnimationGroupLoopObservable.notifyObservers(this), this._animationLoopCount = 0, this._animationLoopFlags.length = 0));};}start(loop = !1, speedRatio = 1, from, to, isAdditive) {if (this._isStarted || 0 === this._targetedAnimations.length) return this;this._loopAnimation = loop, this._animationLoopCount = 0, this._animationLoopFlags.length = 0;for (let index = 0; index < this._targetedAnimations.length; index++) {const targetedAnimation = this._targetedAnimations[index],animatable = this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], void 0 === from ? this._from : from, void 0 === to ? this._to : to, loop, speedRatio, void 0, void 0, void 0 === isAdditive ? this._isAdditive : isAdditive);animatable.onAnimationEnd = () => {this.onAnimationEndObservable.notifyObservers(targetedAnimation), this._checkAnimationGroupEnded(animatable);}, this._processLoop(animatable, targetedAnimation, index), this._animatables.push(animatable);}return this._speedRatio = speedRatio, this._isStarted = !0, this._isPaused = !1, this.onAnimationGroupPlayObservable.notifyObservers(this), this;}pause() {if (!this._isStarted) return this;this._isPaused = !0;for (let index = 0; index < this._animatables.length; index++) {const animatable = this._animatables[index];animatable.pause();}return this.onAnimationGroupPauseObservable.notifyObservers(this), this;}play(loop) {return this.isStarted && this._animatables.length === this._targetedAnimations.length ? (void 0 !== loop && (this.loopAnimation = loop), this.restart()) : (this.stop(), this.start(loop, this._speedRatio)), this._isPaused = !1, this;}reset() {if (!this._isStarted) return this.play(), this.goToFrame(0), this.stop(), this;for (let index = 0; index < this._animatables.length; index++) {const animatable = this._animatables[index];animatable.reset();}return this;}restart() {if (!this._isStarted) return this;for (let index = 0; index < this._animatables.length; index++) {const animatable = this._animatables[index];animatable.restart();}return this.onAnimationGroupPlayObservable.notifyObservers(this), this;}stop() {if (!this._isStarted) return this;const list = this._animatables.slice();for (let index = 0; index < list.length; index++) list[index].stop();return this._isStarted = !1, this;}setWeightForAllAnimatables(weight) {for (let index = 0; index < this._animatables.length; index++) {const animatable = this._animatables[index];animatable.weight = weight;}return this;}syncAllAnimationsWith(root) {for (let index = 0; index < this._animatables.length; index++) {const animatable = this._animatables[index];animatable.syncWith(root);}return this;}goToFrame(frame) {if (!this._isStarted) return this;for (let index = 0; index < this._animatables.length; index++) {const animatable = this._animatables[index];animatable.goToFrame(frame);}return this;}dispose() {this._targetedAnimations.length = 0, this._animatables.length = 0;const index = this._scene.animationGroups.indexOf(this);if (-1 < index && this._scene.animationGroups.splice(index, 1), this._parentContainer) {const index = this._parentContainer.animationGroups.indexOf(this);-1 < index && this._parentContainer.animationGroups.splice(index, 1), this._parentContainer = null;}this.onAnimationEndObservable.clear(), this.onAnimationGroupEndObservable.clear(), this.onAnimationGroupPauseObservable.clear(), this.onAnimationGroupPlayObservable.clear(), this.onAnimationLoopObservable.clear(), this.onAnimationGroupLoopObservable.clear();}_checkAnimationGroupEnded(animatable) {const idx = this._animatables.indexOf(animatable);-1 < idx && this._animatables.splice(idx, 1), 0 === this._animatables.length && (this._isStarted = !1, this.onAnimationGroupEndObservable.notifyObservers(this));}clone(newName, targetConverter, cloneAnimations = !1) {const newGroup = new AnimationGroup(newName || this.name, this._scene);for (const targetAnimation of this._targetedAnimations) newGroup.addTargetedAnimation(cloneAnimations ? targetAnimation.animation.clone() : targetAnimation.animation, targetConverter ? targetConverter(targetAnimation.target) : targetAnimation.target);return newGroup;}serialize() {const serializationObject = { name: this.name, from: this.from, to: this.to, targetedAnimations: [] };for (let targetedAnimationIndex = 0; targetedAnimationIndex < this.targetedAnimations.length; targetedAnimationIndex++) {const targetedAnimation = this.targetedAnimations[targetedAnimationIndex];serializationObject.targetedAnimations[targetedAnimationIndex] = targetedAnimation.serialize();}return _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.HasTags */ .$.HasTags(this) && (serializationObject.tags = _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.GetTags */ .$.GetTags(this)), this.metadata && (serializationObject.metadata = this.metadata), serializationObject;}static Parse(parsedAnimationGroup, scene) {const animationGroup = new AnimationGroup(parsedAnimationGroup.name, scene);for (let i = 0; i < parsedAnimationGroup.targetedAnimations.length; i++) {const targetedAnimation = parsedAnimationGroup.targetedAnimations[i],animation = _animation_js__WEBPACK_IMPORTED_MODULE_0__/* .Animation.Parse */ .f.Parse(targetedAnimation.animation),id = targetedAnimation.targetId;if ("influence" === targetedAnimation.animation.property) {const morphTarget = scene.getMorphTargetById(id);morphTarget && animationGroup.addTargetedAnimation(animation, morphTarget);} else {const targetNode = scene.getNodeById(id);null != targetNode && animationGroup.addTargetedAnimation(animation, targetNode);}}return null !== parsedAnimationGroup.from && null !== parsedAnimationGroup.to && animationGroup.normalize(parsedAnimationGroup.from, parsedAnimationGroup.to), _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.AddTagsTo */ .$.AddTagsTo(animationGroup, parsedAnimationGroup.tags), void 0 !== parsedAnimationGroup.metadata && (animationGroup.metadata = parsedAnimationGroup.metadata), animationGroup;}static MakeAnimationAdditive(sourceAnimationGroup, referenceFrame = 0, range, cloneOriginal = !1, clonedName) {let animationGroup = sourceAnimationGroup;cloneOriginal && (animationGroup = sourceAnimationGroup.clone(clonedName || animationGroup.name));const targetedAnimations = animationGroup.targetedAnimations;for (let index = 0; index < targetedAnimations.length; index++) {const targetedAnimation = targetedAnimations[index];_animation_js__WEBPACK_IMPORTED_MODULE_0__/* .Animation.MakeAnimationAdditive */ .f.MakeAnimationAdditive(targetedAnimation.animation, referenceFrame, range);}return animationGroup.isAdditive = !0, animationGroup;}getClassName() {return "AnimationGroup";}toString(fullDetails) {let ret = "Name: " + this.name;return ret += ", type: " + this.getClassName(), fullDetails && (ret += ", from: " + this._from, ret += ", to: " + this._to, ret += ", isStarted: " + this._isStarted, ret += ", speedRatio: " + this._speedRatio, ret += ", targetedAnimations length: " + this._targetedAnimations.length, ret += ", animatables length: " + this._animatables), ret;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Animations/animationKey.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "N": () => (/* binding */ AnimationKeyInterpolation)
/* harmony export */ });
var AnimationKeyInterpolation;(function (AnimationKeyInterpolation) {AnimationKeyInterpolation[AnimationKeyInterpolation.NONE = 0] = "NONE", AnimationKeyInterpolation[AnimationKeyInterpolation.STEP = 1] = "STEP";})(AnimationKeyInterpolation || (AnimationKeyInterpolation = {}));

/***/ }),

/***/ "./node_modules/@babylonjs/core/Animations/animationRange.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "X": () => (/* binding */ AnimationRange)
/* harmony export */ });
class AnimationRange {constructor(name, from, to) {this.name = name, this.from = from, this.to = to;}clone() {return new AnimationRange(this.name, this.from, this.to);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Audio/sound.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$": () => (/* binding */ Sound)
/* harmony export */ });
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engine.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
class Sound {get loop() {return this._loop;}set loop(value) {value === this._loop || (this._loop = value, this.updateOptions({ loop: value }));}get currentTime() {var _a;if (this._htmlAudioElement) return this._htmlAudioElement.currentTime;if ((null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.audioContext) && (this.isPlaying || this.isPaused)) {const timeSinceLastStart = this.isPaused ? 0 : _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.currentTime */ .D.audioEngine.audioContext.currentTime - this._startTime;return this._currentTime + timeSinceLastStart;}return 0;}get spatialSound() {return this._spatialSound;}set spatialSound(newValue) {var _a;this._spatialSound = newValue, this._spatialSound && (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext */ .D.audioEngine.audioContext && this._createSpatialParameters();}constructor(name, urlOrArrayBuffer, scene, readyToPlayCallback = null, options) {var _a, _b, _c, _d, _e;if (this.autoplay = !1, this._loop = !1, this.useCustomAttenuation = !1, this.isPlaying = !1, this.isPaused = !1, this.refDistance = 1, this.rolloffFactor = 1, this.maxDistance = 100, this.distanceModel = "linear", this.metadata = null, this.onEndedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this._spatialSound = !1, this._panningModel = "equalpower", this._playbackRate = 1, this._streaming = !1, this._startTime = 0, this._currentTime = 0, this._position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), this._localDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(1, 0, 0), this._volume = 1, this._isReadyToPlay = !1, this._isDirectional = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._coneOuterGain = 0, this._isOutputConnected = !1, this._urlType = "Unknown", this.name = name, scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, !!scene) if (this._scene = scene, Sound._SceneComponentInitialization(scene), this._readyToPlayCallback = readyToPlayCallback, this._customAttenuationFunction = (currentVolume, currentDistance, maxDistance) => currentDistance < maxDistance ? currentVolume * (1 - currentDistance / maxDistance) : 0, options && (this.autoplay = options.autoplay || !1, this._loop = options.loop || !1, void 0 !== options.volume && (this._volume = options.volume), this._spatialSound = null !== (_a = options.spatialSound) && void 0 !== _a && _a, this.maxDistance = null !== (_b = options.maxDistance) && void 0 !== _b ? _b : 100, this.useCustomAttenuation = null !== (_c = options.useCustomAttenuation) && void 0 !== _c && _c, this.rolloffFactor = options.rolloffFactor || 1, this.refDistance = options.refDistance || 1, this.distanceModel = options.distanceModel || "linear", this._playbackRate = options.playbackRate || 1, this._streaming = null !== (_d = options.streaming) && void 0 !== _d && _d, this._length = options.length, this._offset = options.offset), (null === (_e = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _e ? void 0 : _e.canUseWebAudio) && _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext */ .D.audioEngine.audioContext) {this._soundGain = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.createGain */ .D.audioEngine.audioContext.createGain(), this._soundGain.gain.value = this._volume, this._inputAudioNode = this._soundGain, this._outputAudioNode = this._soundGain, this._spatialSound && this._createSpatialParameters(), this._scene.mainSoundTrack.addSound(this);let validParameter = !0;if (urlOrArrayBuffer) try {"string" == typeof urlOrArrayBuffer ? this._urlType = "String" : urlOrArrayBuffer instanceof ArrayBuffer ? this._urlType = "ArrayBuffer" : urlOrArrayBuffer instanceof HTMLMediaElement ? this._urlType = "MediaElement" : urlOrArrayBuffer instanceof MediaStream ? this._urlType = "MediaStream" : urlOrArrayBuffer instanceof AudioBuffer ? this._urlType = "AudioBuffer" : Array.isArray(urlOrArrayBuffer) && (this._urlType = "Array");let urls = [],codecSupportedFound = !1;switch (this._urlType) {case "MediaElement":this._streaming = !0, this._isReadyToPlay = !0, this._streamingSource = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.createMediaElementSource */ .D.audioEngine.audioContext.createMediaElementSource(urlOrArrayBuffer), this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback();break;case "MediaStream":this._streaming = !0, this._isReadyToPlay = !0, this._streamingSource = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.createMediaStreamSource */ .D.audioEngine.audioContext.createMediaStreamSource(urlOrArrayBuffer), this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback();break;case "ArrayBuffer":0 < urlOrArrayBuffer.byteLength && (codecSupportedFound = !0, this._soundLoaded(urlOrArrayBuffer));break;case "AudioBuffer":this._audioBufferLoaded(urlOrArrayBuffer);break;case "String":urls.push(urlOrArrayBuffer);case "Array":0 === urls.length && (urls = urlOrArrayBuffer);for (let i = 0; i < urls.length; i++) {const url = urls[i];if (codecSupportedFound = options && options.skipCodecCheck || -1 !== url.indexOf(".mp3", url.length - 4) && _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.isMP3supported */ .D.audioEngine.isMP3supported || -1 !== url.indexOf(".ogg", url.length - 4) && _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.isOGGsupported */ .D.audioEngine.isOGGsupported || -1 !== url.indexOf(".wav", url.length - 4) || -1 !== url.indexOf(".m4a", url.length - 4) || -1 !== url.indexOf(".mp4", url.length - 4) || -1 !== url.indexOf("blob:"), codecSupportedFound) {this._streaming ? (this._htmlAudioElement = new Audio(url), this._htmlAudioElement.controls = !1, this._htmlAudioElement.loop = this.loop, _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.SetCorsBehavior */ .w1.SetCorsBehavior(url, this._htmlAudioElement), this._htmlAudioElement.preload = "auto", this._htmlAudioElement.addEventListener("canplaythrough", () => {this._isReadyToPlay = !0, this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback();}), document.body.appendChild(this._htmlAudioElement), this._htmlAudioElement.load()) : this._scene._loadFile(url, (data) => {this._soundLoaded(data);}, void 0, !0, !0, (exception) => {exception && _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("XHR " + exception.status + " error on: " + url + "."), _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("Sound creation aborted."), this._scene.mainSoundTrack.removeSound(this);});break;}}break;default:validParameter = !1;}validParameter ? !codecSupportedFound && (this._isReadyToPlay = !0, this._readyToPlayCallback && setTimeout(() => {this._readyToPlayCallback && this._readyToPlayCallback();}, 1e3)) : _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.");} catch (ex) {_Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("Unexpected error. Sound creation aborted."), this._scene.mainSoundTrack.removeSound(this);}} else this._scene.mainSoundTrack.addSound(this), _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine && !_Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.WarnedWebAudioUnsupported */ .D.audioEngine.WarnedWebAudioUnsupported && (_Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("Web Audio is not supported by your browser."), _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.WarnedWebAudioUnsupported */ .D.audioEngine.WarnedWebAudioUnsupported = !0), this._readyToPlayCallback && setTimeout(() => {this._readyToPlayCallback && this._readyToPlayCallback();}, 1e3);}dispose() {var _a;(null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && (this.isPlaying && this.stop(), this._isReadyToPlay = !1, -1 === this.soundTrackId ? this._scene.mainSoundTrack.removeSound(this) : this._scene.soundTracks && this._scene.soundTracks[this.soundTrackId].removeSound(this), this._soundGain && (this._soundGain.disconnect(), this._soundGain = null), this._soundPanner && (this._soundPanner.disconnect(), this._soundPanner = null), this._soundSource && (this._soundSource.disconnect(), this._soundSource = null), this._audioBuffer = null, this._htmlAudioElement && (this._htmlAudioElement.pause(), this._htmlAudioElement.src = "", document.body.removeChild(this._htmlAudioElement)), this._streamingSource && this._streamingSource.disconnect(), this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._connectedTransformNode = null));}isReady() {return this._isReadyToPlay;}getClassName() {return "Sound";}_audioBufferLoaded(buffer) {var _a;null !== (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) && void 0 !== _a && _a.audioContext && (this._audioBuffer = buffer, this._isReadyToPlay = !0, this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback());}_soundLoaded(audioData) {var _a;null !== (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) && void 0 !== _a && _a.audioContext && _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.decodeAudioData */ .D.audioEngine.audioContext.decodeAudioData(audioData, (buffer) => {this._audioBufferLoaded(buffer);}, (err) => {_Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("Error while decoding audio data for: " + this.name + " / Error: " + err);});}setAudioBuffer(audioBuffer) {var _a;(null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && (this._audioBuffer = audioBuffer, this._isReadyToPlay = !0);}updateOptions(options) {var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;options && (this.loop = null !== (_a = options.loop) && void 0 !== _a ? _a : this.loop, this.maxDistance = null !== (_b = options.maxDistance) && void 0 !== _b ? _b : this.maxDistance, this.useCustomAttenuation = null !== (_c = options.useCustomAttenuation) && void 0 !== _c ? _c : this.useCustomAttenuation, this.rolloffFactor = null !== (_d = options.rolloffFactor) && void 0 !== _d ? _d : this.rolloffFactor, this.refDistance = null !== (_e = options.refDistance) && void 0 !== _e ? _e : this.refDistance, this.distanceModel = null !== (_f = options.distanceModel) && void 0 !== _f ? _f : this.distanceModel, this._playbackRate = null !== (_g = options.playbackRate) && void 0 !== _g ? _g : this._playbackRate, this._length = null !== (_h = options.length) && void 0 !== _h ? _h : void 0, this._setOffset(null !== (_j = options.offset) && void 0 !== _j ? _j : void 0), this.setVolume(null !== (_k = options.volume) && void 0 !== _k ? _k : this._volume), this._updateSpatialParameters(), this.isPlaying && (this._streaming && this._htmlAudioElement ? (this._htmlAudioElement.playbackRate = this._playbackRate, this._htmlAudioElement.loop !== this.loop && (this._htmlAudioElement.loop = this.loop)) : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate, this._soundSource.loop !== this.loop && (this._soundSource.loop = this.loop), this._offset !== void 0 && this._soundSource.loopStart !== this._offset && (this._soundSource.loopStart = this._offset), this._length !== void 0 && this._length !== this._soundSource.loopEnd && (this._soundSource.loopEnd = (0 | this._offset) + this._length))));}_createSpatialParameters() {var _a, _b;(null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext */ .D.audioEngine.audioContext && (this._scene.headphone && (this._panningModel = "HRTF"), this._soundPanner = null !== (_b = this._soundPanner) && void 0 !== _b ? _b : _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.createPanner */ .D.audioEngine.audioContext.createPanner(), this._soundPanner && this._outputAudioNode && (this._updateSpatialParameters(), this._soundPanner.connect(this._outputAudioNode), this._inputAudioNode = this._soundPanner));}_updateSpatialParameters() {this._spatialSound && this._soundPanner && (this.useCustomAttenuation ? (this._soundPanner.distanceModel = "linear", this._soundPanner.maxDistance = Number.MAX_VALUE, this._soundPanner.refDistance = 1, this._soundPanner.rolloffFactor = 1, this._soundPanner.panningModel = this._panningModel) : (this._soundPanner.distanceModel = this.distanceModel, this._soundPanner.maxDistance = this.maxDistance, this._soundPanner.refDistance = this.refDistance, this._soundPanner.rolloffFactor = this.rolloffFactor, this._soundPanner.panningModel = this._panningModel));}switchPanningModelToHRTF() {this._panningModel = "HRTF", this._switchPanningModel();}switchPanningModelToEqualPower() {this._panningModel = "equalpower", this._switchPanningModel();}_switchPanningModel() {var _a;(null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._spatialSound && this._soundPanner && (this._soundPanner.panningModel = this._panningModel);}connectToSoundTrackAudioNode(soundTrackAudioNode) {var _a;(null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._outputAudioNode && (this._isOutputConnected && this._outputAudioNode.disconnect(), this._outputAudioNode.connect(soundTrackAudioNode), this._isOutputConnected = !0);}setDirectionalCone(coneInnerAngle, coneOuterAngle, coneOuterGain) {return coneOuterAngle < coneInnerAngle ? void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.") : void (this._coneInnerAngle = coneInnerAngle, this._coneOuterAngle = coneOuterAngle, this._coneOuterGain = coneOuterGain, this._isDirectional = !0, this.isPlaying && this.loop && (this.stop(), this.play(0, this._offset, this._length)));}get directionalConeInnerAngle() {return this._coneInnerAngle;}set directionalConeInnerAngle(value) {var _a;if (value != this._coneInnerAngle) {if (this._coneOuterAngle < value) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneInnerAngle = value, (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._spatialSound && this._soundPanner && (this._soundPanner.coneInnerAngle = this._coneInnerAngle);}}get directionalConeOuterAngle() {return this._coneOuterAngle;}set directionalConeOuterAngle(value) {var _a;if (value != this._coneOuterAngle) {if (value < this._coneInnerAngle) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneOuterAngle = value, (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._spatialSound && this._soundPanner && (this._soundPanner.coneOuterAngle = this._coneOuterAngle);}}setPosition(newPosition) {var _a;newPosition.equals(this._position) || (this._position.copyFrom(newPosition), (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._spatialSound && this._soundPanner && !isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z) && (this._soundPanner.positionX.value = this._position.x, this._soundPanner.positionY.value = this._position.y, this._soundPanner.positionZ.value = this._position.z));}setLocalDirectionToMesh(newLocalDirection) {var _a;this._localDirection = newLocalDirection, (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._connectedTransformNode && this.isPlaying && this._updateDirection();}_updateDirection() {if (!this._connectedTransformNode || !this._soundPanner) return;const mat = this._connectedTransformNode.getWorldMatrix(),direction = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformNormal */ .P.TransformNormal(this._localDirection, mat);direction.normalize(), this._soundPanner.orientationX.value = direction.x, this._soundPanner.orientationY.value = direction.y, this._soundPanner.orientationZ.value = direction.z;}updateDistanceFromListener() {var _a;if ((null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._connectedTransformNode && this.useCustomAttenuation && this._soundGain && this._scene.activeCamera) {const distance = this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);this._soundGain.gain.value = this._customAttenuationFunction(this._volume, distance, this.maxDistance, this.refDistance, this.rolloffFactor);}}setAttenuationFunction(callback) {this._customAttenuationFunction = callback;}play(time, offset, length) {var _a, _b, _c, _d;if (this._isReadyToPlay && this._scene.audioEnabled && (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.audioContext)) try {let startTime = time ? (null === (_b = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _b ? void 0 : _b.audioContext.currentTime) + time : null === (_c = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _c ? void 0 : _c.audioContext.currentTime;if ((!this._soundSource || !this._streamingSource) && this._spatialSound && this._soundPanner && (!isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z) && (this._soundPanner.positionX.value = this._position.x, this._soundPanner.positionY.value = this._position.y, this._soundPanner.positionZ.value = this._position.z), this._isDirectional && (this._soundPanner.coneInnerAngle = this._coneInnerAngle, this._soundPanner.coneOuterAngle = this._coneOuterAngle, this._soundPanner.coneOuterGain = this._coneOuterGain, this._connectedTransformNode ? this._updateDirection() : this._soundPanner.setOrientation(this._localDirection.x, this._localDirection.y, this._localDirection.z))), !this._streaming) {const tryToPlay = () => {var _a, _b, _c, _d;if (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.audioContext) {if (length = length || this._length, void 0 !== offset && this._setOffset(offset), this._soundSource) {const oldSource = this._soundSource;oldSource.onended = () => {oldSource.disconnect();};}if (this._soundSource = null === (_b = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _b ? void 0 : _b.audioContext.createBufferSource(), this._soundSource && this._inputAudioNode) {this._soundSource.buffer = this._audioBuffer, this._soundSource.connect(this._inputAudioNode), this._soundSource.loop = this.loop, void 0 !== offset && (this._soundSource.loopStart = offset), void 0 !== length && (this._soundSource.loopEnd = (0 | offset) + length), this._soundSource.playbackRate.value = this._playbackRate, this._soundSource.onended = () => {this._onended();}, startTime = time ? (null === (_c = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _c ? void 0 : _c.audioContext.currentTime) + time : _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.currentTime */ .D.audioEngine.audioContext.currentTime;const actualOffset = ((this.isPaused ? this.currentTime : 0) + (null !== (_d = this._offset) && void 0 !== _d ? _d : 0)) % this._soundSource.buffer.duration;this._soundSource.start(startTime, actualOffset, this.loop ? void 0 : length);}}};"suspended" === (null === (_d = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _d ? void 0 : _d.audioContext.state) ? setTimeout(() => {var _a;"suspended" === (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.audioContext.state) ? (_Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.lock */ .D.audioEngine.lock(), (this.loop || this.autoplay) && _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.onAudioUnlockedObservable.addOnce */ .D.audioEngine.onAudioUnlockedObservable.addOnce(() => {tryToPlay();})) : tryToPlay();}, 500) : tryToPlay();} else if (this._streamingSource || (this._streamingSource = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.createMediaElementSource */ .D.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement), this._htmlAudioElement.onended = () => {this._onended();}, this._htmlAudioElement.playbackRate = this._playbackRate), this._streamingSource.disconnect(), this._inputAudioNode && this._streamingSource.connect(this._inputAudioNode), this._htmlAudioElement) {const tryToPlay = () => {var _a, _b;if (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.unlocked) {const playPromise = this._htmlAudioElement.play();void 0 !== playPromise && playPromise.catch(() => {var _a, _b;null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.lock(), (this.loop || this.autoplay) && (null === (_b = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _b ? void 0 : _b.onAudioUnlockedObservable.addOnce(() => {tryToPlay();}));});} else (this.loop || this.autoplay) && (null === (_b = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _b ? void 0 : _b.onAudioUnlockedObservable.addOnce(() => {tryToPlay();}));};tryToPlay();}this._startTime = startTime, this.isPlaying = !0, this.isPaused = !1;} catch (ex) {_Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger.Error */ .Y.Error("Error while trying to play audio: " + this.name + ", " + ex.message);}}_onended() {this.isPlaying = !1, this._startTime = 0, this._currentTime = 0, this.onended && this.onended(), this.onEndedObservable.notifyObservers(this);}stop(time) {var _a;if (!this.isPlaying) this.isPaused && (this.isPaused = !1, this._startTime = 0, this._currentTime = 0);else if (this._streaming) this._htmlAudioElement ? (this._htmlAudioElement.pause(), 0 < this._htmlAudioElement.currentTime && (this._htmlAudioElement.currentTime = 0)) : this._streamingSource.disconnect(), this.isPlaying = !1;else if ((null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.audioContext) && this._soundSource) {const stopTime = time ? _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.currentTime */ .D.audioEngine.audioContext.currentTime + time : void 0;this._soundSource.onended = () => {this.isPlaying = !1, this.isPaused = !1, this._startTime = 0, this._currentTime = 0, this._soundSource && (this._soundSource.onended = () => void 0), this._onended();}, this._soundSource.stop(stopTime);}}pause() {var _a;this.isPlaying && (this._streaming ? (this._htmlAudioElement ? this._htmlAudioElement.pause() : this._streamingSource.disconnect(), this.isPlaying = !1, this.isPaused = !0) : (null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.audioContext) && this._soundSource && (this._soundSource.onended = () => void 0, this._soundSource.stop(), this.isPlaying = !1, this.isPaused = !0, this._currentTime += _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.currentTime */ .D.audioEngine.audioContext.currentTime - this._startTime));}setVolume(newVolume, time) {var _a;(null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._soundGain && (time && _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext */ .D.audioEngine.audioContext ? (this._soundGain.gain.cancelScheduledValues(_Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.currentTime */ .D.audioEngine.audioContext.currentTime), this._soundGain.gain.setValueAtTime(this._soundGain.gain.value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.currentTime */ .D.audioEngine.audioContext.currentTime), this._soundGain.gain.linearRampToValueAtTime(newVolume, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine.audioContext.currentTime */ .D.audioEngine.audioContext.currentTime + time)) : this._soundGain.gain.value = newVolume), this._volume = newVolume;}setPlaybackRate(newPlaybackRate) {this._playbackRate = newPlaybackRate, this.isPlaying && (this._streaming && this._htmlAudioElement ? this._htmlAudioElement.playbackRate = this._playbackRate : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate));}getPlaybackRate() {return this._playbackRate;}getVolume() {return this._volume;}attachToMesh(transformNode) {this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null), this._connectedTransformNode = transformNode, this._spatialSound || (this._spatialSound = !0, this._createSpatialParameters(), this.isPlaying && this.loop && (this.stop(), this.play(0, this._offset, this._length))), this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode), this._registerFunc = (transformNode) => this._onRegisterAfterWorldMatrixUpdate(transformNode), this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc);}detachFromMesh() {this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null, this._connectedTransformNode = null);}_onRegisterAfterWorldMatrixUpdate(node) {var _a;if (!node.getBoundingInfo) this.setPosition(node.absolutePosition);else {const boundingInfo = node.getBoundingInfo();this.setPosition(boundingInfo.boundingSphere.centerWorld);}(null === (_a = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.audioEngine */ .D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._isDirectional && this.isPlaying && this._updateDirection();}clone() {if (!this._streaming) {const setBufferAndRun = () => {this._isReadyToPlay ? (clonedSound._audioBuffer = this.getAudioBuffer(), clonedSound._isReadyToPlay = !0, clonedSound.autoplay && clonedSound.play(0, this._offset, this._length)) : setTimeout(setBufferAndRun, 300);},currentOptions = { autoplay: this.autoplay, loop: this.loop, volume: this._volume, spatialSound: this._spatialSound, maxDistance: this.maxDistance, useCustomAttenuation: this.useCustomAttenuation, rolloffFactor: this.rolloffFactor, refDistance: this.refDistance, distanceModel: this.distanceModel },clonedSound = new Sound(this.name + "_cloned", new ArrayBuffer(0), this._scene, null, currentOptions);return this.useCustomAttenuation && clonedSound.setAttenuationFunction(this._customAttenuationFunction), clonedSound.setPosition(this._position), clonedSound.setPlaybackRate(this._playbackRate), setBufferAndRun(), clonedSound;}return null;}getAudioBuffer() {return this._audioBuffer;}getSoundSource() {return this._soundSource;}getSoundGain() {return this._soundGain;}serialize() {const serializationObject = { name: this.name, url: this.name, autoplay: this.autoplay, loop: this.loop, volume: this._volume, spatialSound: this._spatialSound, maxDistance: this.maxDistance, rolloffFactor: this.rolloffFactor, refDistance: this.refDistance, distanceModel: this.distanceModel, playbackRate: this._playbackRate, panningModel: this._panningModel, soundTrackId: this.soundTrackId, metadata: this.metadata };return this._spatialSound && (this._connectedTransformNode && (serializationObject.connectedMeshId = this._connectedTransformNode.id), serializationObject.position = this._position.asArray(), serializationObject.refDistance = this.refDistance, serializationObject.distanceModel = this.distanceModel, serializationObject.isDirectional = this._isDirectional, serializationObject.localDirectionToMesh = this._localDirection.asArray(), serializationObject.coneInnerAngle = this._coneInnerAngle, serializationObject.coneOuterAngle = this._coneOuterAngle, serializationObject.coneOuterGain = this._coneOuterGain), serializationObject;}static Parse(parsedSound, scene, rootUrl, sourceSound) {const soundName = parsedSound.name;let soundUrl = parsedSound.url ? rootUrl + parsedSound.url : rootUrl + soundName;const options = { autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume, spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance, rolloffFactor: parsedSound.rolloffFactor, refDistance: parsedSound.refDistance, distanceModel: parsedSound.distanceModel, playbackRate: parsedSound.playbackRate };let newSound;if (!sourceSound) newSound = new Sound(soundName, soundUrl, scene, () => {scene.removePendingData(newSound);}, options), scene.addPendingData(newSound);else {const setBufferAndRun = () => {sourceSound._isReadyToPlay ? (newSound._audioBuffer = sourceSound.getAudioBuffer(), newSound._isReadyToPlay = !0, newSound.autoplay && newSound.play(0, newSound._offset, newSound._length)) : setTimeout(setBufferAndRun, 300);};newSound = new Sound(soundName, new ArrayBuffer(0), scene, null, options), setBufferAndRun();}if (parsedSound.position) {const soundPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.FromArray */ .P.FromArray(parsedSound.position);newSound.setPosition(soundPosition);}if (parsedSound.isDirectional && (newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0), parsedSound.localDirectionToMesh)) {const localDirectionToMesh = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.FromArray */ .P.FromArray(parsedSound.localDirectionToMesh);newSound.setLocalDirectionToMesh(localDirectionToMesh);}if (parsedSound.connectedMeshId) {const connectedMesh = scene.getMeshById(parsedSound.connectedMeshId);connectedMesh && newSound.attachToMesh(connectedMesh);}return parsedSound.metadata && (newSound.metadata = parsedSound.metadata), newSound;}_setOffset(value) {this._offset === value || (this.isPaused && (this.stop(), this.isPaused = !1), this._offset = value);}}Sound._SceneComponentInitialization = () => {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .S)("AudioSceneComponent");};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Audio/weightedsound.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "s": () => (/* binding */ WeightedSound)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
class WeightedSound {constructor(loop, sounds, weights) {if (this.loop = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._volume = 1, this.isPlaying = !1, this.isPaused = !1, this._sounds = [], this._weights = [], sounds.length !== weights.length) throw new Error("Sounds length does not equal weights length");this.loop = loop, this._weights = weights;let weightSum = 0;for (const weight of weights) weightSum += weight;const invWeightSum = 0 < weightSum ? 1 / weightSum : 0;for (let i = 0; i < this._weights.length; i++) this._weights[i] *= invWeightSum;this._sounds = sounds;for (const sound of this._sounds) sound.onEndedObservable.add(() => {this._onended();});}get directionalConeInnerAngle() {return this._coneInnerAngle;}set directionalConeInnerAngle(value) {if (value !== this._coneInnerAngle) {if (this._coneOuterAngle < value) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger.Error */ .Y.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneInnerAngle = value;for (const sound of this._sounds) sound.directionalConeInnerAngle = value;}}get directionalConeOuterAngle() {return this._coneOuterAngle;}set directionalConeOuterAngle(value) {if (value !== this._coneOuterAngle) {if (value < this._coneInnerAngle) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger.Error */ .Y.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneOuterAngle = value;for (const sound of this._sounds) sound.directionalConeOuterAngle = value;}}get volume() {return this._volume;}set volume(value) {if (value !== this._volume) for (const sound of this._sounds) sound.setVolume(value);}_onended() {this._currentIndex !== void 0 && (this._sounds[this._currentIndex].autoplay = !1), this.loop && this.isPlaying ? this.play() : this.isPlaying = !1;}pause() {this.isPaused = !0, this._currentIndex !== void 0 && this._sounds[this._currentIndex].pause();}stop() {this.isPlaying = !1, this._currentIndex !== void 0 && this._sounds[this._currentIndex].stop();}play(startOffset) {if (!this.isPaused) {this.stop();const randomValue = Math.random();let total = 0;for (let i = 0; i < this._weights.length; i++) if (total += this._weights[i], randomValue <= total) {this._currentIndex = i;break;}}const sound = this._sounds[this._currentIndex];sound.isReady() ? sound.play(0, this.isPaused ? void 0 : startOffset) : sound.autoplay = !0, this.isPlaying = !0, this.isPaused = !1;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Bones/bone.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "N": () => (/* binding */ Bone)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/arrayTools.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.axis.js");
class Bone extends _node_js__WEBPACK_IMPORTED_MODULE_2__/* .Node */ .N {get _matrix() {return this._compose(), this._localMatrix;}set _matrix(value) {this._needToCompose = !1;value.updateFlag === this._localMatrix.updateFlag || (this._localMatrix.copyFrom(value), this._markAsDirtyAndDecompose());}constructor(name, skeleton, parentBone = null, localMatrix = null, restPose = null, baseMatrix = null, index = null) {super(name, skeleton.getScene()), this.name = name, this.children = [], this.animations = [], this._index = null, this._absoluteTransform = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .y3(), this._invertedAbsoluteTransform = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .y3(), this._scalingDeterminant = 1, this._worldTransform = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .y3(), this._needToDecompose = !0, this._needToCompose = !1, this._linkedTransformNode = null, this._waitingTransformNodeId = null, this._skeleton = skeleton, this._localMatrix = localMatrix ? localMatrix.clone() : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.Identity */ .y3.Identity(), this._restPose = restPose ? restPose : this._localMatrix.clone(), this._baseMatrix = baseMatrix ? baseMatrix : this._localMatrix.clone(), this._index = index, skeleton.bones.push(this), this.setParent(parentBone, !1), (baseMatrix || localMatrix) && this._updateDifferenceMatrix();}getClassName() {return "Bone";}getSkeleton() {return this._skeleton;}get parent() {return this._parentNode;}getParent() {return this.parent;}getChildren() {return this.children;}getIndex() {return null === this._index ? this.getSkeleton().bones.indexOf(this) : this._index;}set parent(newParent) {this.setParent(newParent);}setParent(parent, updateDifferenceMatrix = !0) {if (this.parent !== parent) {if (this.parent) {const index = this.parent.children.indexOf(this);-1 !== index && this.parent.children.splice(index, 1);}this._parentNode = parent, this.parent && this.parent.children.push(this), updateDifferenceMatrix && this._updateDifferenceMatrix(), this.markAsDirty();}}getLocalMatrix() {return this._compose(), this._localMatrix;}getBaseMatrix() {return this._baseMatrix;}getRestPose() {return this._restPose;}setRestPose(matrix) {this._restPose.copyFrom(matrix);}getBindPose() {return this._baseMatrix;}setBindPose(matrix) {this.updateMatrix(matrix);}getWorldMatrix() {return this._worldTransform;}returnToRest() {var _a;if (this._linkedTransformNode) {const localScaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0],localRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0],localPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1];this.getRestPose().decompose(localScaling, localRotation, localPosition), this._linkedTransformNode.position.copyFrom(localPosition), this._linkedTransformNode.rotationQuaternion = null !== (_a = this._linkedTransformNode.rotationQuaternion) && void 0 !== _a ? _a : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.Identity */ ._f.Identity(), this._linkedTransformNode.rotationQuaternion.copyFrom(localRotation), this._linkedTransformNode.scaling.copyFrom(localScaling);} else this._matrix = this._restPose;}getInvertedAbsoluteTransform() {return this._invertedAbsoluteTransform;}getAbsoluteTransform() {return this._absoluteTransform;}linkTransformNode(transformNode) {this._linkedTransformNode && this._skeleton._numBonesWithLinkedTransformNode--, this._linkedTransformNode = transformNode, this._linkedTransformNode && this._skeleton._numBonesWithLinkedTransformNode++;}getTransformNode() {return this._linkedTransformNode;}get position() {return this._decompose(), this._localPosition;}set position(newPosition) {this._decompose(), this._localPosition.copyFrom(newPosition), this._markAsDirtyAndCompose();}get rotation() {return this.getRotation();}set rotation(newRotation) {this.setRotation(newRotation);}get rotationQuaternion() {return this._decompose(), this._localRotation;}set rotationQuaternion(newRotation) {this.setRotationQuaternion(newRotation);}get scaling() {return this.getScale();}set scaling(newScaling) {this.setScale(newScaling);}get animationPropertiesOverride() {return this._skeleton.animationPropertiesOverride;}_decompose() {this._needToDecompose && (this._needToDecompose = !1, !this._localScaling && (this._localScaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this._localRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.Zero */ ._f.Zero(), this._localPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero()), this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition));}_compose() {return this._needToCompose ? this._localScaling ? void (this._needToCompose = !1, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.ComposeToRef */ .y3.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix)) : void (this._needToCompose = !1) : void 0;}updateMatrix(matrix, updateDifferenceMatrix = !0, updateLocalMatrix = !0) {this._baseMatrix.copyFrom(matrix), updateDifferenceMatrix && this._updateDifferenceMatrix(), updateLocalMatrix ? this._matrix = matrix : this.markAsDirty();}_updateDifferenceMatrix(rootMatrix, updateChildren = !0) {if (rootMatrix || (rootMatrix = this._baseMatrix), this.parent ? rootMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform) : this._absoluteTransform.copyFrom(rootMatrix), this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform), updateChildren) for (let index = 0; index < this.children.length; index++) this.children[index]._updateDifferenceMatrix();this._scalingDeterminant = 0 > this._absoluteTransform.determinant() ? -1 : 1;}markAsDirty() {return this._currentRenderId++, this._childUpdateId++, this._skeleton._markAsDirty(), this;}_markAsDirtyAndCompose() {this.markAsDirty(), this._needToCompose = !0;}_markAsDirtyAndDecompose() {this.markAsDirty(), this._needToDecompose = !0;}translate(vec, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {const lm = this.getLocalMatrix();if (space == _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL) lm.addAtIndex(12, vec.x), lm.addAtIndex(13, vec.y), lm.addAtIndex(14, vec.z);else {let wm = null;tNode && (wm = tNode.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();const tmat = Bone._TmpMats[0],tvec = Bone._TmpVecs[0];this.parent ? tNode && wm ? (tmat.copyFrom(this.parent.getAbsoluteTransform()), tmat.multiplyToRef(wm, tmat)) : tmat.copyFrom(this.parent.getAbsoluteTransform()) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.IdentityToRef */ .y3.IdentityToRef(tmat), tmat.setTranslationFromFloats(0, 0, 0), tmat.invert(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(vec, tmat, tvec), lm.addAtIndex(12, tvec.x), lm.addAtIndex(13, tvec.y), lm.addAtIndex(14, tvec.z);}this._markAsDirtyAndDecompose();}setPosition(position, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {const lm = this.getLocalMatrix();if (space == _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL) lm.setTranslationFromFloats(position.x, position.y, position.z);else {let wm = null;tNode && (wm = tNode.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();const tmat = Bone._TmpMats[0],vec = Bone._TmpVecs[0];this.parent ? (tNode && wm ? (tmat.copyFrom(this.parent.getAbsoluteTransform()), tmat.multiplyToRef(wm, tmat)) : tmat.copyFrom(this.parent.getAbsoluteTransform()), tmat.invert()) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.IdentityToRef */ .y3.IdentityToRef(tmat), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(position, tmat, vec), lm.setTranslationFromFloats(vec.x, vec.y, vec.z);}this._markAsDirtyAndDecompose();}setAbsolutePosition(position, tNode) {this.setPosition(position, _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.WORLD */ .T.WORLD, tNode);}scale(x, y, z, scaleChildren = !1) {const locMat = this.getLocalMatrix(),scaleMat = Bone._TmpMats[0];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.ScalingToRef */ .y3.ScalingToRef(x, y, z, scaleMat), scaleMat.multiplyToRef(locMat, locMat), scaleMat.invert();for (const child of this.children) {const cm = child.getLocalMatrix();cm.multiplyToRef(scaleMat, cm), cm.multiplyAtIndex(12, x), cm.multiplyAtIndex(13, y), cm.multiplyAtIndex(14, z), child._markAsDirtyAndDecompose();}if (this._markAsDirtyAndDecompose(), scaleChildren) for (const child of this.children) child.scale(x, y, z, scaleChildren);}setScale(scale) {this._decompose(), this._localScaling.copyFrom(scale), this._markAsDirtyAndCompose();}getScale() {return this._decompose(), this._localScaling;}getScaleToRef(result) {this._decompose(), result.copyFrom(this._localScaling);}setYawPitchRoll(yaw, pitch, roll, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {if (space === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL) {const quat = Bone._TmpQuat;return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.RotationYawPitchRollToRef */ ._f.RotationYawPitchRollToRef(yaw, pitch, roll, quat), void this.setRotationQuaternion(quat, space, tNode);}const rotMatInv = Bone._TmpMats[0];if (this._getNegativeRotationToRef(rotMatInv, tNode)) {const rotMat = Bone._TmpMats[1];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.RotationYawPitchRollToRef */ .y3.RotationYawPitchRollToRef(yaw, pitch, roll, rotMat), rotMatInv.multiplyToRef(rotMat, rotMat), this._rotateWithMatrix(rotMat, space, tNode);}}rotate(axis, amount, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {const rmat = Bone._TmpMats[0];rmat.setTranslationFromFloats(0, 0, 0), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.RotationAxisToRef */ .y3.RotationAxisToRef(axis, amount, rmat), this._rotateWithMatrix(rmat, space, tNode);}setAxisAngle(axis, angle, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {if (space === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL) {const quat = Bone._TmpQuat;return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.RotationAxisToRef */ ._f.RotationAxisToRef(axis, angle, quat), void this.setRotationQuaternion(quat, space, tNode);}const rotMatInv = Bone._TmpMats[0];if (this._getNegativeRotationToRef(rotMatInv, tNode)) {const rotMat = Bone._TmpMats[1];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.RotationAxisToRef */ .y3.RotationAxisToRef(axis, angle, rotMat), rotMatInv.multiplyToRef(rotMat, rotMat), this._rotateWithMatrix(rotMat, space, tNode);}}setRotation(rotation, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {this.setYawPitchRoll(rotation.y, rotation.x, rotation.z, space, tNode);}setRotationQuaternion(quat, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {if (space === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL) return this._decompose(), this._localRotation.copyFrom(quat), void this._markAsDirtyAndCompose();const rotMatInv = Bone._TmpMats[0];if (this._getNegativeRotationToRef(rotMatInv, tNode)) {const rotMat = Bone._TmpMats[1];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.FromQuaternionToRef */ .y3.FromQuaternionToRef(quat, rotMat), rotMatInv.multiplyToRef(rotMat, rotMat), this._rotateWithMatrix(rotMat, space, tNode);}}setRotationMatrix(rotMat, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {if (space === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL) {const quat = Bone._TmpQuat;return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.FromRotationMatrixToRef */ ._f.FromRotationMatrixToRef(rotMat, quat), void this.setRotationQuaternion(quat, space, tNode);}const rotMatInv = Bone._TmpMats[0];if (this._getNegativeRotationToRef(rotMatInv, tNode)) {const rotMat2 = Bone._TmpMats[1];rotMat2.copyFrom(rotMat), rotMatInv.multiplyToRef(rotMat, rotMat2), this._rotateWithMatrix(rotMat2, space, tNode);}}_rotateWithMatrix(rmat, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {const lmat = this.getLocalMatrix(),lx = lmat.m[12],ly = lmat.m[13],lz = lmat.m[14],parent = this.getParent(),parentScale = Bone._TmpMats[3],parentScaleInv = Bone._TmpMats[4];parent && space == _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.WORLD */ .T.WORLD ? (tNode ? (parentScale.copyFrom(tNode.getWorldMatrix()), parent.getAbsoluteTransform().multiplyToRef(parentScale, parentScale)) : parentScale.copyFrom(parent.getAbsoluteTransform()), parentScaleInv.copyFrom(parentScale), parentScaleInv.invert(), lmat.multiplyToRef(parentScale, lmat), lmat.multiplyToRef(rmat, lmat), lmat.multiplyToRef(parentScaleInv, lmat)) : space == _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.WORLD */ .T.WORLD && tNode ? (parentScale.copyFrom(tNode.getWorldMatrix()), parentScaleInv.copyFrom(parentScale), parentScaleInv.invert(), lmat.multiplyToRef(parentScale, lmat), lmat.multiplyToRef(rmat, lmat), lmat.multiplyToRef(parentScaleInv, lmat)) : lmat.multiplyToRef(rmat, lmat), lmat.setTranslationFromFloats(lx, ly, lz), this.computeAbsoluteTransforms(), this._markAsDirtyAndDecompose();}_getNegativeRotationToRef(rotMatInv, tNode) {const scaleMatrix = Bone._TmpMats[2];return (rotMatInv.copyFrom(this.getAbsoluteTransform()), tNode ? (rotMatInv.multiplyToRef(tNode.getWorldMatrix(), rotMatInv), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.ScalingToRef */ .y3.ScalingToRef(tNode.scaling.x, tNode.scaling.y, tNode.scaling.z, scaleMatrix)) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.IdentityToRef */ .y3.IdentityToRef(scaleMatrix), rotMatInv.invert(), !isNaN(rotMatInv.m[0])) && (scaleMatrix.multiplyAtIndex(0, this._scalingDeterminant), rotMatInv.multiplyToRef(scaleMatrix, rotMatInv), !0);}getPosition(space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode = null) {const pos = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero();return this.getPositionToRef(space, tNode, pos), pos;}getPositionToRef(space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode, result) {if (space == _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL) {const lm = this.getLocalMatrix();result.x = lm.m[12], result.y = lm.m[13], result.z = lm.m[14];} else {let wm = null;tNode && (wm = tNode.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();let tmat = Bone._TmpMats[0];tNode && wm ? (tmat.copyFrom(this.getAbsoluteTransform()), tmat.multiplyToRef(wm, tmat)) : tmat = this.getAbsoluteTransform(), result.x = tmat.m[12], result.y = tmat.m[13], result.z = tmat.m[14];}}getAbsolutePosition(tNode = null) {const pos = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero();return this.getPositionToRef(_Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.WORLD */ .T.WORLD, tNode, pos), pos;}getAbsolutePositionToRef(tNode, result) {this.getPositionToRef(_Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.WORLD */ .T.WORLD, tNode, result);}computeAbsoluteTransforms() {if (this._compose(), this.parent) this._localMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform);else {this._absoluteTransform.copyFrom(this._localMatrix);const poseMatrix = this._skeleton.getPoseMatrix();poseMatrix && this._absoluteTransform.multiplyToRef(poseMatrix, this._absoluteTransform);}const children = this.children,len = children.length;for (let i = 0; i < len; i++) children[i].computeAbsoluteTransforms();}getDirection(localAxis, tNode = null) {const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero();return this.getDirectionToRef(localAxis, tNode, result), result;}getDirectionToRef(localAxis, tNode = null, result) {let wm = null;tNode && (wm = tNode.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();const mat = Bone._TmpMats[0];mat.copyFrom(this.getAbsoluteTransform()), tNode && wm && mat.multiplyToRef(wm, mat), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(localAxis, mat, result), result.normalize();}getRotation(space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode = null) {const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero();return this.getRotationToRef(space, tNode, result), result;}getRotationToRef(space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode = null, result) {const quat = Bone._TmpQuat;this.getRotationQuaternionToRef(space, tNode, quat), quat.toEulerAnglesToRef(result);}getRotationQuaternion(space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode = null) {const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.Identity */ ._f.Identity();return this.getRotationQuaternionToRef(space, tNode, result), result;}getRotationQuaternionToRef(space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode = null, result) {if (space == _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL) this._decompose(), result.copyFrom(this._localRotation);else {const mat = Bone._TmpMats[0],amat = this.getAbsoluteTransform();tNode ? amat.multiplyToRef(tNode.getWorldMatrix(), mat) : mat.copyFrom(amat), mat.multiplyAtIndex(0, this._scalingDeterminant), mat.multiplyAtIndex(1, this._scalingDeterminant), mat.multiplyAtIndex(2, this._scalingDeterminant), mat.decompose(void 0, result, void 0);}}getRotationMatrix(space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode) {const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.Identity */ .y3.Identity();return this.getRotationMatrixToRef(space, tNode, result), result;}getRotationMatrixToRef(space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL, tNode, result) {if (space == _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_3__/* .Space.LOCAL */ .T.LOCAL) this.getLocalMatrix().getRotationMatrixToRef(result);else {const mat = Bone._TmpMats[0],amat = this.getAbsoluteTransform();tNode ? amat.multiplyToRef(tNode.getWorldMatrix(), mat) : mat.copyFrom(amat), mat.multiplyAtIndex(0, this._scalingDeterminant), mat.multiplyAtIndex(1, this._scalingDeterminant), mat.multiplyAtIndex(2, this._scalingDeterminant), mat.getRotationMatrixToRef(result);}}getAbsolutePositionFromLocal(position, tNode = null) {const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero();return this.getAbsolutePositionFromLocalToRef(position, tNode, result), result;}getAbsolutePositionFromLocalToRef(position, tNode = null, result) {let wm = null;tNode && (wm = tNode.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();let tmat = Bone._TmpMats[0];tNode && wm ? (tmat.copyFrom(this.getAbsoluteTransform()), tmat.multiplyToRef(wm, tmat)) : tmat = this.getAbsoluteTransform(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(position, tmat, result);}getLocalPositionFromAbsolute(position, tNode = null) {const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero();return this.getLocalPositionFromAbsoluteToRef(position, tNode, result), result;}getLocalPositionFromAbsoluteToRef(position, tNode = null, result) {let wm = null;tNode && (wm = tNode.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();const tmat = Bone._TmpMats[0];tmat.copyFrom(this.getAbsoluteTransform()), tNode && wm && tmat.multiplyToRef(wm, tmat), tmat.invert(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(position, tmat, result);}setCurrentPoseAsRest() {this.setRestPose(this.getLocalMatrix());}}Bone._TmpVecs = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayTools.BuildArray */ .B.BuildArray(2, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero), Bone._TmpQuat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion.Identity */ ._f.Identity(), Bone._TmpMats = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayTools.BuildArray */ .B.BuildArray(5, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.Identity */ .y3.Identity);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Bones/skeleton.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "O": () => (/* binding */ Skeleton)
/* harmony export */ });
/* harmony import */ var _bone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Bones/bone.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/rawTexture.js");
/* harmony import */ var _Animations_animation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Animations/animation.js");
/* harmony import */ var _Animations_animationRange_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationRange.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/deepCopier.js");
class Skeleton {get useTextureToStoreBoneMatrices() {return this._useTextureToStoreBoneMatrices;}set useTextureToStoreBoneMatrices(value) {this._useTextureToStoreBoneMatrices = value, this._markAsDirty();}get animationPropertiesOverride() {return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride;}set animationPropertiesOverride(value) {this._animationPropertiesOverride = value;}get isUsingTextureForMatrices() {return this.useTextureToStoreBoneMatrices && this._canUseTextureForBones;}get uniqueId() {return this._uniqueId;}constructor(name, id, scene) {this.name = name, this.id = id, this.bones = [], this.needInitialSkinMatrix = !1, this._isDirty = !0, this._meshesWithPoseMatrix = [], this._identity = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.Identity */ .y3.Identity(), this._ranges = {}, this._absoluteTransformIsDirty = !0, this._canUseTextureForBones = !1, this._uniqueId = 0, this._numBonesWithLinkedTransformNode = 0, this._hasWaitingData = null, this._parentContainer = null, this.doNotSerialize = !1, this._useTextureToStoreBoneMatrices = !0, this._animationPropertiesOverride = null, this.onBeforeComputeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this.bones = [], this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, this._uniqueId = this._scene.getUniqueId(), this._scene.addSkeleton(this), this._isDirty = !0;const engineCaps = this._scene.getEngine().getCaps();this._canUseTextureForBones = engineCaps.textureFloat && 0 < engineCaps.maxVertexTextureImageUnits;}getClassName() {return "Skeleton";}getChildren() {return this.bones.filter((b) => !b.getParent());}getTransformMatrices(mesh) {return this.needInitialSkinMatrix ? (mesh._bonesTransformMatrices || this.prepare(), mesh._bonesTransformMatrices) : (this._transformMatrices || this.prepare(), this._transformMatrices);}getTransformMatrixTexture(mesh) {return this.needInitialSkinMatrix && mesh._transformMatrixTexture ? mesh._transformMatrixTexture : this._transformMatrixTexture;}getScene() {return this._scene;}toString(fullDetails) {let ret = `Name: ${this.name}, nBones: ${this.bones.length}`;if (ret += `, nAnimationRanges: ${this._ranges ? Object.keys(this._ranges).length : "none"}`, fullDetails) {ret += ", Ranges: {";let first = !0;for (const name in this._ranges) first && (ret += ", ", first = !1), ret += name;ret += "}";}return ret;}getBoneIndexByName(name) {for (let boneIndex = 0, cache = this.bones.length; boneIndex < cache; boneIndex++) if (this.bones[boneIndex].name === name) return boneIndex;return -1;}createAnimationRange(name, from, to) {if (!this._ranges[name]) {this._ranges[name] = new _Animations_animationRange_js__WEBPACK_IMPORTED_MODULE_5__/* .AnimationRange */ .X(name, from, to);for (let i = 0, nBones = this.bones.length; i < nBones; i++) this.bones[i].animations[0] && this.bones[i].animations[0].createRange(name, from, to);}}deleteAnimationRange(name, deleteFrames = !0) {for (let i = 0, nBones = this.bones.length; i < nBones; i++) this.bones[i].animations[0] && this.bones[i].animations[0].deleteRange(name, deleteFrames);this._ranges[name] = null;}getAnimationRange(name) {return this._ranges[name] || null;}getAnimationRanges() {const animationRanges = [];for (var name in this._ranges) animationRanges.push(this._ranges[name]);return animationRanges;}copyAnimationRange(source, name, rescaleAsRequired = !1) {if (this._ranges[name] || !source.getAnimationRange(name)) return !1;let ret = !0;const frameOffset = this._getHighestAnimationFrame() + 1,boneDict = {},sourceBones = source.bones;let nBones, i;for (i = 0, nBones = sourceBones.length; i < nBones; i++) boneDict[sourceBones[i].name] = sourceBones[i];this.bones.length !== sourceBones.length && (_Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .Logger.Warn */ .Y.Warn(`copyAnimationRange: this rig has ${this.bones.length} bones, while source as ${sourceBones.length}`), ret = !1);const skelDimensionsRatio = rescaleAsRequired && this.dimensionsAtRest && source.dimensionsAtRest ? this.dimensionsAtRest.divide(source.dimensionsAtRest) : null;for (i = 0, nBones = this.bones.length; i < nBones; i++) {const boneName = this.bones[i].name,sourceBone = boneDict[boneName];sourceBone ? ret = ret && this.bones[i].copyAnimationRange(sourceBone, name, frameOffset, rescaleAsRequired, skelDimensionsRatio) : (_Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .Logger.Warn */ .Y.Warn("copyAnimationRange: not same rig, missing source bone " + boneName), ret = !1);}const range = source.getAnimationRange(name);return range && (this._ranges[name] = new _Animations_animationRange_js__WEBPACK_IMPORTED_MODULE_5__/* .AnimationRange */ .X(name, range.from + frameOffset, range.to + frameOffset)), ret;}returnToRest() {for (const bone of this.bones) -1 !== bone._index && bone.returnToRest();}_getHighestAnimationFrame() {let ret = 0;for (let i = 0, nBones = this.bones.length; i < nBones; i++) if (this.bones[i].animations[0]) {const highest = this.bones[i].animations[0].getHighestFrame();ret < highest && (ret = highest);}return ret;}beginAnimation(name, loop, speedRatio, onAnimationEnd) {const range = this.getAnimationRange(name);return range ? this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd) : null;}static MakeAnimationAdditive(skeleton, referenceFrame = 0, range) {const rangeValue = skeleton.getAnimationRange(range);if (!rangeValue) return null;const sceneAnimatables = skeleton._scene.getAllAnimatablesByTarget(skeleton);let rangeAnimatable = null;for (let index = 0; index < sceneAnimatables.length; index++) {const sceneAnimatable = sceneAnimatables[index];if (sceneAnimatable.fromFrame === (null === rangeValue || void 0 === rangeValue ? void 0 : rangeValue.from) && sceneAnimatable.toFrame === (null === rangeValue || void 0 === rangeValue ? void 0 : rangeValue.to)) {rangeAnimatable = sceneAnimatable;break;}}const animatables = skeleton.getAnimatables();for (let index = 0; index < animatables.length; index++) {const animatable = animatables[index],animations = animatable.animations;if (animations) for (let animIndex = 0; animIndex < animations.length; animIndex++) _Animations_animation_js__WEBPACK_IMPORTED_MODULE_4__/* .Animation.MakeAnimationAdditive */ .f.MakeAnimationAdditive(animations[animIndex], referenceFrame, range);}return rangeAnimatable && (rangeAnimatable.isAdditive = !0), skeleton;}_markAsDirty() {this._isDirty = !0, this._absoluteTransformIsDirty = !0;}_registerMeshWithPoseMatrix(mesh) {this._meshesWithPoseMatrix.push(mesh);}_unregisterMeshWithPoseMatrix(mesh) {const index = this._meshesWithPoseMatrix.indexOf(mesh);-1 < index && this._meshesWithPoseMatrix.splice(index, 1);}_computeTransformMatrices(targetMatrix, initialSkinMatrix) {this.onBeforeComputeObservable.notifyObservers(this);for (let index = 0; index < this.bones.length; index++) {const bone = this.bones[index];bone._childUpdateId++;const parentBone = bone.getParent();if (parentBone ? bone.getLocalMatrix().multiplyToRef(parentBone.getWorldMatrix(), bone.getWorldMatrix()) : initialSkinMatrix ? bone.getLocalMatrix().multiplyToRef(initialSkinMatrix, bone.getWorldMatrix()) : bone.getWorldMatrix().copyFrom(bone.getLocalMatrix()), -1 !== bone._index) {const mappedIndex = null === bone._index ? index : bone._index;bone.getInvertedAbsoluteTransform().multiplyToArray(bone.getWorldMatrix(), targetMatrix, 16 * mappedIndex);}}this._identity.copyToArray(targetMatrix, 16 * this.bones.length);}prepare() {if (0 < this._numBonesWithLinkedTransformNode) for (const bone of this.bones) if (bone._linkedTransformNode) {const node = bone._linkedTransformNode;bone.position = node.position, node.rotationQuaternion ? bone.rotationQuaternion = node.rotationQuaternion : bone.rotation = node.rotation, bone.scaling = node.scaling;}if (this.needInitialSkinMatrix) for (const mesh of this._meshesWithPoseMatrix) {const poseMatrix = mesh.getPoseMatrix();let needsUpdate = this._isDirty;if (mesh._bonesTransformMatrices && mesh._bonesTransformMatrices.length === 16 * (this.bones.length + 1) || (mesh._bonesTransformMatrices = new Float32Array(16 * (this.bones.length + 1)), needsUpdate = !0), !!needsUpdate) {if (this._synchronizedWithMesh !== mesh) {this._synchronizedWithMesh = mesh;for (const bone of this.bones) if (!bone.getParent()) {const matrix = bone.getBaseMatrix();matrix.multiplyToRef(poseMatrix, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1]), bone._updateDifferenceMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1]);}if (this.isUsingTextureForMatrices) {const textureWidth = 4 * (this.bones.length + 1);mesh._transformMatrixTexture && mesh._transformMatrixTexture.getSize().width === textureWidth || (mesh._transformMatrixTexture && mesh._transformMatrixTexture.dispose(), mesh._transformMatrixTexture = _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_3__/* .RawTexture.CreateRGBATexture */ .l.CreateRGBATexture(mesh._bonesTransformMatrices, 4 * (this.bones.length + 1), 1, this._scene, !1, !1, 1, 1));}}this._computeTransformMatrices(mesh._bonesTransformMatrices, poseMatrix), this.isUsingTextureForMatrices && mesh._transformMatrixTexture && mesh._transformMatrixTexture.update(mesh._bonesTransformMatrices);}} else {if (!this._isDirty) return;this._transformMatrices && this._transformMatrices.length === 16 * (this.bones.length + 1) || (this._transformMatrices = new Float32Array(16 * (this.bones.length + 1)), this.isUsingTextureForMatrices && (this._transformMatrixTexture && this._transformMatrixTexture.dispose(), this._transformMatrixTexture = _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_3__/* .RawTexture.CreateRGBATexture */ .l.CreateRGBATexture(this._transformMatrices, 4 * (this.bones.length + 1), 1, this._scene, !1, !1, 1, 1))), this._computeTransformMatrices(this._transformMatrices, null), this.isUsingTextureForMatrices && this._transformMatrixTexture && this._transformMatrixTexture.update(this._transformMatrices);}this._isDirty = !1;}getAnimatables() {if (!this._animatables || this._animatables.length !== this.bones.length) {this._animatables = [];for (let index = 0; index < this.bones.length; index++) this._animatables.push(this.bones[index]);}return this._animatables;}clone(name, id) {const result = new Skeleton(name, id || name, this._scene);result.needInitialSkinMatrix = this.needInitialSkinMatrix;for (let index = 0; index < this.bones.length; index++) {const source = this.bones[index];let parentBone = null;const parent = source.getParent();if (parent) {const parentIndex = this.bones.indexOf(parent);parentBone = result.bones[parentIndex];}const bone = new _bone_js__WEBPACK_IMPORTED_MODULE_0__/* .Bone */ .N(source.name, result, parentBone, source.getBaseMatrix().clone(), source.getRestPose().clone());bone._index = source._index, source._linkedTransformNode && bone.linkTransformNode(source._linkedTransformNode), _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_8__/* .DeepCopier.DeepCopy */ .j.DeepCopy(source.animations, bone.animations);}if (this._ranges) for (const rangeName in result._ranges = {}, this._ranges) {const range = this._ranges[rangeName];range && (result._ranges[rangeName] = range.clone());}return this._isDirty = !0, result;}enableBlending(blendingSpeed = .01) {this.bones.forEach((bone) => {bone.animations.forEach((animation) => {animation.enableBlending = !0, animation.blendingSpeed = blendingSpeed;});});}dispose() {if (this._meshesWithPoseMatrix.length = 0, this.getScene().stopAnimation(this), this.getScene().removeSkeleton(this), this._parentContainer) {const index = this._parentContainer.skeletons.indexOf(this);-1 < index && this._parentContainer.skeletons.splice(index, 1), this._parentContainer = null;}this._transformMatrixTexture && (this._transformMatrixTexture.dispose(), this._transformMatrixTexture = null);}serialize() {var _a;const serializationObject = {};serializationObject.name = this.name, serializationObject.id = this.id, this.dimensionsAtRest && (serializationObject.dimensionsAtRest = this.dimensionsAtRest.asArray()), serializationObject.bones = [], serializationObject.needInitialSkinMatrix = this.needInitialSkinMatrix;for (let index = 0; index < this.bones.length; index++) {const bone = this.bones[index],parent = bone.getParent(),serializedBone = { parentBoneIndex: parent ? this.bones.indexOf(parent) : -1, index: bone.getIndex(), name: bone.name, id: bone.id, matrix: bone.getBaseMatrix().toArray(), rest: bone.getRestPose().toArray(), linkedTransformNodeId: null === (_a = bone.getTransformNode()) || void 0 === _a ? void 0 : _a.id };for (const name in serializationObject.bones.push(serializedBone), bone.length && (serializedBone.length = bone.length), bone.metadata && (serializedBone.metadata = bone.metadata), bone.animations && 0 < bone.animations.length && (serializedBone.animation = bone.animations[0].serialize()), serializationObject.ranges = [], this._ranges) {const source = this._ranges[name];if (!source) continue;const range = {};range.name = name, range.from = source.from, range.to = source.to, serializationObject.ranges.push(range);}}return serializationObject;}static Parse(parsedSkeleton, scene) {const skeleton = new Skeleton(parsedSkeleton.name, parsedSkeleton.id, scene);parsedSkeleton.dimensionsAtRest && (skeleton.dimensionsAtRest = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.FromArray */ .P.FromArray(parsedSkeleton.dimensionsAtRest)), skeleton.needInitialSkinMatrix = parsedSkeleton.needInitialSkinMatrix;let index;for (index = 0; index < parsedSkeleton.bones.length; index++) {const parsedBone = parsedSkeleton.bones[index],parsedBoneIndex = parsedSkeleton.bones[index].index;let parentBone = null;-1 < parsedBone.parentBoneIndex && (parentBone = skeleton.bones[parsedBone.parentBoneIndex]);const rest = parsedBone.rest ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.FromArray */ .y3.FromArray(parsedBone.rest) : null,bone = new _bone_js__WEBPACK_IMPORTED_MODULE_0__/* .Bone */ .N(parsedBone.name, skeleton, parentBone, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.FromArray */ .y3.FromArray(parsedBone.matrix), rest, null, parsedBoneIndex);parsedBone.id !== void 0 && null !== parsedBone.id && (bone.id = parsedBone.id), parsedBone.length && (bone.length = parsedBone.length), parsedBone.metadata && (bone.metadata = parsedBone.metadata), parsedBone.animation && bone.animations.push(_Animations_animation_js__WEBPACK_IMPORTED_MODULE_4__/* .Animation.Parse */ .f.Parse(parsedBone.animation)), parsedBone.linkedTransformNodeId !== void 0 && null !== parsedBone.linkedTransformNodeId && (skeleton._hasWaitingData = !0, bone._waitingTransformNodeId = parsedBone.linkedTransformNodeId);}if (parsedSkeleton.ranges) for (index = 0; index < parsedSkeleton.ranges.length; index++) {const data = parsedSkeleton.ranges[index];skeleton.createAnimationRange(data.name, data.from, data.to);}return skeleton;}computeAbsoluteTransforms(forceUpdate = !1) {(this._absoluteTransformIsDirty || forceUpdate) && (this.bones[0].computeAbsoluteTransforms(), this._absoluteTransformIsDirty = !1);}getPoseMatrix() {let poseMatrix = null;return 0 < this._meshesWithPoseMatrix.length && (poseMatrix = this._meshesWithPoseMatrix[0].getPoseMatrix()), poseMatrix;}sortBones() {const bones = [],visited = Array(this.bones.length);for (let index = 0; index < this.bones.length; index++) this._sortBones(index, bones, visited);this.bones = bones;}_sortBones(index, bones, visited) {if (!visited[index]) {visited[index] = !0;const bone = this.bones[index];if (bone) {void 0 === bone._index && (bone._index = index);const parentBone = bone.getParent();parentBone && this._sortBones(this.bones.indexOf(parentBone), bones, visited), bones.push(bone);}}}setCurrentPoseAsRest() {this.bones.forEach((b) => {b.setCurrentPoseAsRest();});}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Buffers/buffer.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "l": () => (/* binding */ Buffer),
/* harmony export */   "o": () => (/* binding */ VertexBuffer)
/* harmony export */ });
/* harmony import */ var _dataBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/dataBuffer.js");
class Buffer {constructor(engine, data, updatable, stride = 0, postponeInternalCreation = !1, instanced = !1, useBytes = !1, divisor) {this._isAlreadyOwned = !1, this._engine = engine.getScene ? engine.getScene().getEngine() : engine, this._updatable = updatable, this._instanced = instanced, this._divisor = divisor || 1, data instanceof _dataBuffer_js__WEBPACK_IMPORTED_MODULE_0__/* .DataBuffer */ .h ? (this._data = null, this._buffer = data) : (this._data = data, this._buffer = null), this.byteStride = useBytes ? stride : stride * Float32Array.BYTES_PER_ELEMENT, postponeInternalCreation || this.create();}createVertexBuffer(kind, offset, size, stride, instanced, useBytes = !1, divisor) {const byteOffset = useBytes ? offset : offset * Float32Array.BYTES_PER_ELEMENT,byteStride = stride ? useBytes ? stride : stride * Float32Array.BYTES_PER_ELEMENT : this.byteStride;return new VertexBuffer(this._engine, this, kind, this._updatable, !0, byteStride, instanced === void 0 ? this._instanced : instanced, byteOffset, size, void 0, void 0, !0, this._divisor || divisor);}isUpdatable() {return this._updatable;}getData() {return this._data;}getBuffer() {return this._buffer;}getStrideSize() {return this.byteStride / Float32Array.BYTES_PER_ELEMENT;}create(data = null) {(data || !this._buffer) && (data = data || this._data, data && (this._buffer ? this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, data), this._data = data) : this._updatable ? (this._buffer = this._engine.createDynamicVertexBuffer(data), this._data = data) : this._buffer = this._engine.createVertexBuffer(data)));}_rebuild() {this._buffer = null, this.create(this._data);}update(data) {this.create(data);}updateDirectly(data, offset, vertexCount, useBytes = !1) {!this._buffer || this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, data, useBytes ? offset : offset * Float32Array.BYTES_PER_ELEMENT, vertexCount ? vertexCount * this.byteStride : void 0), this._data = 0 === offset && void 0 === vertexCount ? data : null);}_increaseReferences() {return this._buffer ? this._isAlreadyOwned ? void this._buffer.references++ : void (this._isAlreadyOwned = !0) : void 0;}dispose() {!this._buffer || this._engine._releaseBuffer(this._buffer) && (this._buffer = null, this._data = null);}}class VertexBuffer {get instanceDivisor() {return this._instanceDivisor;}set instanceDivisor(value) {const isInstanced = 0 != value;this._instanceDivisor = value, isInstanced !== this._instanced && (this._instanced = isInstanced, this._computeHashCode());}constructor(engine, data, kind, updatable, postponeInternalCreation, stride, instanced, offset, size, type, normalized = !1, useBytes = !1, divisor = 1, takeBufferOwnership = !1) {if (data instanceof Buffer ? (this._buffer = data, this._ownsBuffer = takeBufferOwnership) : (this._buffer = new Buffer(engine, data, updatable, stride, postponeInternalCreation, instanced, useBytes), this._ownsBuffer = !0), this.uniqueId = VertexBuffer._Counter++, this._kind = kind, null == type) {const vertexData = this.getData();this.type = VertexBuffer.FLOAT, vertexData instanceof Int8Array ? this.type = VertexBuffer.BYTE : vertexData instanceof Uint8Array ? this.type = VertexBuffer.UNSIGNED_BYTE : vertexData instanceof Int16Array ? this.type = VertexBuffer.SHORT : vertexData instanceof Uint16Array ? this.type = VertexBuffer.UNSIGNED_SHORT : vertexData instanceof Int32Array ? this.type = VertexBuffer.INT : vertexData instanceof Uint32Array && (this.type = VertexBuffer.UNSIGNED_INT);} else this.type = type;const typeByteLength = VertexBuffer.GetTypeByteLength(this.type);useBytes ? (this._size = size || (stride ? stride / typeByteLength : VertexBuffer.DeduceStride(kind)), this.byteStride = stride || this._buffer.byteStride || this._size * typeByteLength, this.byteOffset = offset || 0) : (this._size = size || stride || VertexBuffer.DeduceStride(kind), this.byteStride = stride ? stride * typeByteLength : this._buffer.byteStride || this._size * typeByteLength, this.byteOffset = (offset || 0) * typeByteLength), this.normalized = normalized, this._instanced = void 0 !== instanced && instanced, this._instanceDivisor = instanced ? divisor : 0, this._computeHashCode();}_computeHashCode() {this.hashCode = (this.type - 5120 << 0) + ((this.normalized ? 1 : 0) << 3) + (this._size << 4) + ((this._instanced ? 1 : 0) << 6) + (this.byteStride << 12);}_rebuild() {this._buffer && this._buffer._rebuild();}getKind() {return this._kind;}isUpdatable() {return this._buffer.isUpdatable();}getData() {return this._buffer.getData();}getFloatData(totalVertices, forceCopy) {const data = this.getData();if (!data) return null;const tightlyPackedByteStride = this.getSize() * VertexBuffer.GetTypeByteLength(this.type),count = totalVertices * this.getSize();if (this.type !== VertexBuffer.FLOAT || this.byteStride !== tightlyPackedByteStride) {const copy = new Float32Array(count);return this.forEach(count, (value, index) => copy[index] = value), copy;}if (!(data instanceof Array || data instanceof Float32Array) || 0 !== this.byteOffset || data.length !== count) {if (data instanceof Array) {const offset = this.byteOffset / 4;return data.slice(offset, offset + count);}if (data instanceof ArrayBuffer) return new Float32Array(data, this.byteOffset, count);else {let offset = data.byteOffset + this.byteOffset;if (forceCopy) {const result = new Float32Array(count),source = new Float32Array(data.buffer, offset, count);return result.set(source), result;}const remainder = offset % 4;return remainder && (offset = Math.max(0, offset - remainder)), new Float32Array(data.buffer, offset, count);}}return forceCopy ? data.slice() : data;}getBuffer() {return this._buffer.getBuffer();}getStrideSize() {return this.byteStride / VertexBuffer.GetTypeByteLength(this.type);}getOffset() {return this.byteOffset / VertexBuffer.GetTypeByteLength(this.type);}getSize(sizeInBytes = !1) {return sizeInBytes ? this._size * VertexBuffer.GetTypeByteLength(this.type) : this._size;}getIsInstanced() {return this._instanced;}getInstanceDivisor() {return this._instanceDivisor;}create(data) {this._buffer.create(data);}update(data) {this._buffer.update(data);}updateDirectly(data, offset, useBytes = !1) {this._buffer.updateDirectly(data, offset, void 0, useBytes);}dispose() {this._ownsBuffer && this._buffer.dispose();}forEach(count, callback) {VertexBuffer.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, count, this.normalized, callback);}static DeduceStride(kind) {switch (kind) {case VertexBuffer.UVKind:case VertexBuffer.UV2Kind:case VertexBuffer.UV3Kind:case VertexBuffer.UV4Kind:case VertexBuffer.UV5Kind:case VertexBuffer.UV6Kind:return 2;case VertexBuffer.NormalKind:case VertexBuffer.PositionKind:return 3;case VertexBuffer.ColorKind:case VertexBuffer.MatricesIndicesKind:case VertexBuffer.MatricesIndicesExtraKind:case VertexBuffer.MatricesWeightsKind:case VertexBuffer.MatricesWeightsExtraKind:case VertexBuffer.TangentKind:return 4;default:throw new Error("Invalid kind '" + kind + "'");}}static GetTypeByteLength(type) {switch (type) {case VertexBuffer.BYTE:case VertexBuffer.UNSIGNED_BYTE:return 1;case VertexBuffer.SHORT:case VertexBuffer.UNSIGNED_SHORT:return 2;case VertexBuffer.INT:case VertexBuffer.UNSIGNED_INT:case VertexBuffer.FLOAT:return 4;default:throw new Error(`Invalid type '${type}'`);}}static ForEach(data, byteOffset, byteStride, componentCount, componentType, count, normalized, callback) {if (data instanceof Array) {let offset = byteOffset / 4;for (let index = 0; index < count; index += componentCount) {for (let componentIndex = 0; componentIndex < componentCount; componentIndex++) callback(data[offset + componentIndex], index + componentIndex);offset += byteStride / 4;}} else {const dataView = data instanceof ArrayBuffer ? new DataView(data) : new DataView(data.buffer, data.byteOffset, data.byteLength),componentByteLength = VertexBuffer.GetTypeByteLength(componentType);for (let componentByteOffset, index = 0; index < count; index += componentCount) {componentByteOffset = byteOffset;for (let componentIndex = 0; componentIndex < componentCount; componentIndex++) {const value = VertexBuffer._GetFloatValue(dataView, componentType, componentByteOffset, normalized);callback(value, index + componentIndex), componentByteOffset += componentByteLength;}byteOffset += byteStride;}}}static _GetFloatValue(dataView, type, byteOffset, normalized) {switch (type) {case VertexBuffer.BYTE:{let value = dataView.getInt8(byteOffset);return normalized && (value = Math.max(value / 127, -1)), value;}case VertexBuffer.UNSIGNED_BYTE:{let value = dataView.getUint8(byteOffset);return normalized && (value /= 255), value;}case VertexBuffer.SHORT:{let value = dataView.getInt16(byteOffset, !0);return normalized && (value = Math.max(value / 32767, -1)), value;}case VertexBuffer.UNSIGNED_SHORT:{let value = dataView.getUint16(byteOffset, !0);return normalized && (value /= 65535), value;}case VertexBuffer.INT:return dataView.getInt32(byteOffset, !0);case VertexBuffer.UNSIGNED_INT:return dataView.getUint32(byteOffset, !0);case VertexBuffer.FLOAT:return dataView.getFloat32(byteOffset, !0);default:throw new Error(`Invalid component type ${type}`);}}}VertexBuffer._Counter = 0, VertexBuffer.BYTE = 5120, VertexBuffer.UNSIGNED_BYTE = 5121, VertexBuffer.SHORT = 5122, VertexBuffer.UNSIGNED_SHORT = 5123, VertexBuffer.INT = 5124, VertexBuffer.UNSIGNED_INT = 5125, VertexBuffer.FLOAT = 5126, VertexBuffer.PositionKind = "position", VertexBuffer.NormalKind = "normal", VertexBuffer.TangentKind = "tangent", VertexBuffer.UVKind = "uv", VertexBuffer.UV2Kind = "uv2", VertexBuffer.UV3Kind = "uv3", VertexBuffer.UV4Kind = "uv4", VertexBuffer.UV5Kind = "uv5", VertexBuffer.UV6Kind = "uv6", VertexBuffer.ColorKind = "color", VertexBuffer.ColorInstanceKind = "instanceColor", VertexBuffer.MatricesIndicesKind = "matricesIndices", VertexBuffer.MatricesWeightsKind = "matricesWeights", VertexBuffer.MatricesIndicesExtraKind = "matricesIndicesExtra", VertexBuffer.MatricesWeightsExtraKind = "matricesWeightsExtra";

/***/ }),

/***/ "./node_modules/@babylonjs/core/Buffers/dataBuffer.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "h": () => (/* binding */ DataBuffer)
/* harmony export */ });
class DataBuffer {get underlyingResource() {return null;}constructor() {this.references = 0, this.capacity = 0, this.is32Bits = !1, this.uniqueId = DataBuffer._Counter++;}}DataBuffer._Counter = 0;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraMouseWheelInput.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Y": () => (/* binding */ BaseCameraMouseWheelInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Events/pointerEvents.js");
/* harmony import */ var _Events_deviceInputEvents_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Events/deviceInputEvents.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
class BaseCameraMouseWheelInput {constructor() {this.wheelPrecisionX = 3, this.wheelPrecisionY = 3, this.wheelPrecisionZ = 3, this.onChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), this._wheelDeltaX = 0, this._wheelDeltaY = 0, this._wheelDeltaZ = 0, this._ffMultiplier = 12, this._normalize = 120;}attachControl(noPreventDefault) {noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools.BackCompatCameraNoPreventDefault */ .w1.BackCompatCameraNoPreventDefault(arguments), this._wheel = (pointer) => {if (pointer.type !== _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes.POINTERWHEEL */ .kD.POINTERWHEEL) return;const event = pointer.event,platformScale = event.deltaMode === _Events_deviceInputEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .EventConstants.DOM_DELTA_LINE */ .G.DOM_DELTA_LINE ? this._ffMultiplier : 1;this._wheelDeltaX += this.wheelPrecisionX * platformScale * event.deltaX / this._normalize, this._wheelDeltaY -= this.wheelPrecisionY * platformScale * event.deltaY / this._normalize, this._wheelDeltaZ += this.wheelPrecisionZ * platformScale * event.deltaZ / this._normalize, event.preventDefault && !noPreventDefault && event.preventDefault();}, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel, _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes.POINTERWHEEL */ .kD.POINTERWHEEL);}detachControl() {this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null, this._wheel = null), this.onChangedObservable && this.onChangedObservable.clear();}checkInputs() {this.onChangedObservable.notifyObservers({ wheelDeltaX: this._wheelDeltaX, wheelDeltaY: this._wheelDeltaY, wheelDeltaZ: this._wheelDeltaZ }), this._wheelDeltaX = 0, this._wheelDeltaY = 0, this._wheelDeltaZ = 0;}getClassName() {return "BaseCameraMouseWheelInput";}getSimpleName() {return "mousewheel";}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseCameraMouseWheelInput.prototype, "wheelPrecisionX", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseCameraMouseWheelInput.prototype, "wheelPrecisionY", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseCameraMouseWheelInput.prototype, "wheelPrecisionZ", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraKeyboardMoveInput.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Y": () => (/* binding */ FreeCameraKeyboardMoveInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/cameraInputsManager.js");
/* harmony import */ var _Events_keyboardEvents_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Events/keyboardEvents.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
class FreeCameraKeyboardMoveInput {constructor() {this.keysUp = [38], this.keysUpward = [33], this.keysDown = [40], this.keysDownward = [34], this.keysLeft = [37], this.keysRight = [39], this.rotationSpeed = .5, this.keysRotateLeft = [], this.keysRotateRight = [], this._keys = [];}attachControl(noPreventDefault) {noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools.BackCompatCameraNoPreventDefault */ .w1.BackCompatCameraNoPreventDefault(arguments);this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {this._keys.length = 0;}), this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {const evt = info.event;if (!evt.metaKey) if (info.type === _Events_keyboardEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .KeyboardEventTypes.KEYDOWN */ .OG.KEYDOWN) {if (-1 !== this.keysUp.indexOf(evt.keyCode) || -1 !== this.keysDown.indexOf(evt.keyCode) || -1 !== this.keysLeft.indexOf(evt.keyCode) || -1 !== this.keysRight.indexOf(evt.keyCode) || -1 !== this.keysUpward.indexOf(evt.keyCode) || -1 !== this.keysDownward.indexOf(evt.keyCode) || -1 !== this.keysRotateLeft.indexOf(evt.keyCode) || -1 !== this.keysRotateRight.indexOf(evt.keyCode)) {const index = this._keys.indexOf(evt.keyCode);-1 === index && this._keys.push(evt.keyCode), noPreventDefault || evt.preventDefault();}} else if (-1 !== this.keysUp.indexOf(evt.keyCode) || -1 !== this.keysDown.indexOf(evt.keyCode) || -1 !== this.keysLeft.indexOf(evt.keyCode) || -1 !== this.keysRight.indexOf(evt.keyCode) || -1 !== this.keysUpward.indexOf(evt.keyCode) || -1 !== this.keysDownward.indexOf(evt.keyCode) || -1 !== this.keysRotateLeft.indexOf(evt.keyCode) || -1 !== this.keysRotateRight.indexOf(evt.keyCode)) {const index = this._keys.indexOf(evt.keyCode);0 <= index && this._keys.splice(index, 1), noPreventDefault || evt.preventDefault();}}));}detachControl() {this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys.length = 0;}checkInputs() {if (this._onKeyboardObserver) {const camera = this.camera;for (let index = 0; index < this._keys.length; index++) {const keyCode = this._keys[index],speed = camera._computeLocalCameraSpeed();-1 === this.keysLeft.indexOf(keyCode) ? -1 === this.keysUp.indexOf(keyCode) ? -1 === this.keysRight.indexOf(keyCode) ? -1 === this.keysDown.indexOf(keyCode) ? -1 === this.keysUpward.indexOf(keyCode) ? -1 === this.keysDownward.indexOf(keyCode) ? -1 === this.keysRotateLeft.indexOf(keyCode) ? -1 !== this.keysRotateRight.indexOf(keyCode) && (camera._localDirection.copyFromFloats(0, 0, 0), camera.cameraRotation.y += this._getLocalRotation()) : (camera._localDirection.copyFromFloats(0, 0, 0), camera.cameraRotation.y -= this._getLocalRotation()) : camera._localDirection.copyFromFloats(0, -speed, 0) : camera._localDirection.copyFromFloats(0, speed, 0) : camera._localDirection.copyFromFloats(0, 0, -speed) : camera._localDirection.copyFromFloats(speed, 0, 0) : camera._localDirection.copyFromFloats(0, 0, speed) : camera._localDirection.copyFromFloats(-speed, 0, 0), camera.getScene().useRightHandedSystem && (camera._localDirection.z *= -1), camera.getViewMatrix().invertToRef(camera._cameraTransformMatrix), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(camera._localDirection, camera._cameraTransformMatrix, camera._transformedDirection), camera.cameraDirection.addInPlace(camera._transformedDirection);}}}getClassName() {return "FreeCameraKeyboardMoveInput";}_onLostFocus() {this._keys.length = 0;}getSimpleName() {return "keyboard";}_getLocalRotation() {let rotation = this.rotationSpeed * this._engine.getDeltaTime() / 1e3;return this.camera.getScene().useRightHandedSystem && (rotation *= -1), this.camera.parent && 0 > this.camera.parent._getWorldMatrixDeterminant() && (rotation *= -1), rotation;}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraKeyboardMoveInput.prototype, "keysUp", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraKeyboardMoveInput.prototype, "keysUpward", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraKeyboardMoveInput.prototype, "keysDown", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraKeyboardMoveInput.prototype, "keysDownward", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraKeyboardMoveInput.prototype, "keysLeft", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraKeyboardMoveInput.prototype, "keysRight", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraKeyboardMoveInput.prototype, "rotationSpeed", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraKeyboardMoveInput.prototype, "keysRotateLeft", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraKeyboardMoveInput.prototype, "keysRotateRight", void 0), _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__/* .CameraInputTypes.FreeCameraKeyboardMoveInput */ .u.FreeCameraKeyboardMoveInput = FreeCameraKeyboardMoveInput;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseInput.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "A": () => (/* binding */ FreeCameraMouseInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/cameraInputsManager.js");
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Events/pointerEvents.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
class FreeCameraMouseInput {constructor(touchEnabled = !0) {this.touchEnabled = touchEnabled, this.buttons = [0, 1, 2], this.angularSensibility = 2e3, this._previousPosition = null, this.onPointerMovedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this._allowCameraRotation = !0, this._currentActiveButton = -1, this._activePointerId = -1;}attachControl(noPreventDefault) {noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools.BackCompatCameraNoPreventDefault */ .w1.BackCompatCameraNoPreventDefault(arguments);const engine = this.camera.getEngine(),element = engine.getInputElement();this._pointerInput || (this._pointerInput = (p) => {const evt = p.event,isTouch = "touch" === evt.pointerType;if (!engine.isInVRExclusivePointerMode && (this.touchEnabled || !isTouch) && (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes.POINTERMOVE */ .kD.POINTERMOVE || -1 !== this.buttons.indexOf(evt.button))) {const srcElement = evt.target;if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes.POINTERDOWN */ .kD.POINTERDOWN) {if (isTouch && -1 !== this._activePointerId || !isTouch && -1 !== this._currentActiveButton) return;this._activePointerId = evt.pointerId;try {null === srcElement || void 0 === srcElement ? void 0 : srcElement.setPointerCapture(evt.pointerId);} catch (e) {}-1 === this._currentActiveButton && (this._currentActiveButton = evt.button), this._previousPosition = { x: evt.clientX, y: evt.clientY }, noPreventDefault || (evt.preventDefault(), element && element.focus()), engine.isPointerLock && this._onMouseMove && this._onMouseMove(p.event);} else if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes.POINTERUP */ .kD.POINTERUP) {if (isTouch && this._activePointerId !== evt.pointerId || !isTouch && this._currentActiveButton !== evt.button) return;try {null === srcElement || void 0 === srcElement ? void 0 : srcElement.releasePointerCapture(evt.pointerId);} catch (e) {}this._currentActiveButton = -1, this._previousPosition = null, noPreventDefault || evt.preventDefault(), this._activePointerId = -1;} else if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes.POINTERMOVE */ .kD.POINTERMOVE && (this._activePointerId === evt.pointerId || !isTouch)) if (engine.isPointerLock && this._onMouseMove) this._onMouseMove(p.event);else if (this._previousPosition) {let offsetX = evt.clientX - this._previousPosition.x;const offsetY = evt.clientY - this._previousPosition.y;this.camera.getScene().useRightHandedSystem && (offsetX *= -1), this.camera.parent && 0 > this.camera.parent._getWorldMatrixDeterminant() && (offsetX *= -1), this._allowCameraRotation && (this.camera.cameraRotation.y += offsetX / this.angularSensibility, this.camera.cameraRotation.x += offsetY / this.angularSensibility), this.onPointerMovedObservable.notifyObservers({ offsetX: offsetX, offsetY: offsetY }), this._previousPosition = { x: evt.clientX, y: evt.clientY }, noPreventDefault || evt.preventDefault();}}}), this._onMouseMove = (evt) => {if (!engine.isPointerLock) return;if (engine.isInVRExclusivePointerMode) return;let offsetX = evt.movementX;this.camera.getScene().useRightHandedSystem && (offsetX *= -1), this.camera.parent && 0 > this.camera.parent._getWorldMatrixDeterminant() && (offsetX *= -1), this.camera.cameraRotation.y += offsetX / this.angularSensibility;const offsetY = evt.movementY;this.camera.cameraRotation.x += offsetY / this.angularSensibility, this._previousPosition = null, noPreventDefault || evt.preventDefault();}, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput, _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes.POINTERDOWN */ .kD.POINTERDOWN | _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes.POINTERUP */ .kD.POINTERUP | _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes.POINTERMOVE */ .kD.POINTERMOVE), element && (this._contextMenuBind = this.onContextMenu.bind(this), element.addEventListener("contextmenu", this._contextMenuBind, !1));}onContextMenu(evt) {evt.preventDefault();}detachControl() {if (this._observer) {if (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._contextMenuBind) {const engine = this.camera.getEngine(),element = engine.getInputElement();element && element.removeEventListener("contextmenu", this._contextMenuBind);}this.onPointerMovedObservable && this.onPointerMovedObservable.clear(), this._observer = null, this._onMouseMove = null, this._previousPosition = null;}this._currentActiveButton = -1;}getClassName() {return "FreeCameraMouseInput";}getSimpleName() {return "mouse";}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], FreeCameraMouseInput.prototype, "buttons", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], FreeCameraMouseInput.prototype, "angularSensibility", void 0), _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_3__/* .CameraInputTypes.FreeCameraMouseInput */ .u.FreeCameraMouseInput = FreeCameraMouseInput;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseWheelInput.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "A": () => (/* binding */ FreeCameraMouseWheelInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/cameraInputsManager.js");
/* harmony import */ var _Cameras_Inputs_BaseCameraMouseWheelInput_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraMouseWheelInput.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.axis.js");
var _CameraProperty;(function (_CameraProperty) {_CameraProperty[_CameraProperty.MoveRelative = 0] = "MoveRelative", _CameraProperty[_CameraProperty.RotateRelative = 1] = "RotateRelative", _CameraProperty[_CameraProperty.MoveScene = 2] = "MoveScene";})(_CameraProperty || (_CameraProperty = {}));class FreeCameraMouseWheelInput extends _Cameras_Inputs_BaseCameraMouseWheelInput_js__WEBPACK_IMPORTED_MODULE_3__/* .BaseCameraMouseWheelInput */ .Y {constructor() {super(...arguments), this._moveRelative = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3.Zero */ .P.Zero(), this._rotateRelative = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3.Zero */ .P.Zero(), this._moveScene = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3.Zero */ .P.Zero(), this._wheelXAction = _CameraProperty.MoveRelative, this._wheelXActionCoordinate = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Coordinate.X */ .c7.X, this._wheelYAction = _CameraProperty.MoveRelative, this._wheelYActionCoordinate = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Coordinate.Z */ .c7.Z, this._wheelZAction = null, this._wheelZActionCoordinate = null;}getClassName() {return "FreeCameraMouseWheelInput";}set wheelXMoveRelative(axis) {null === axis && this._wheelXAction !== _CameraProperty.MoveRelative || (this._wheelXAction = _CameraProperty.MoveRelative, this._wheelXActionCoordinate = axis);}get wheelXMoveRelative() {return this._wheelXAction === _CameraProperty.MoveRelative ? this._wheelXActionCoordinate : null;}set wheelYMoveRelative(axis) {null === axis && this._wheelYAction !== _CameraProperty.MoveRelative || (this._wheelYAction = _CameraProperty.MoveRelative, this._wheelYActionCoordinate = axis);}get wheelYMoveRelative() {return this._wheelYAction === _CameraProperty.MoveRelative ? this._wheelYActionCoordinate : null;}set wheelZMoveRelative(axis) {null === axis && this._wheelZAction !== _CameraProperty.MoveRelative || (this._wheelZAction = _CameraProperty.MoveRelative, this._wheelZActionCoordinate = axis);}get wheelZMoveRelative() {return this._wheelZAction === _CameraProperty.MoveRelative ? this._wheelZActionCoordinate : null;}set wheelXRotateRelative(axis) {null === axis && this._wheelXAction !== _CameraProperty.RotateRelative || (this._wheelXAction = _CameraProperty.RotateRelative, this._wheelXActionCoordinate = axis);}get wheelXRotateRelative() {return this._wheelXAction === _CameraProperty.RotateRelative ? this._wheelXActionCoordinate : null;}set wheelYRotateRelative(axis) {null === axis && this._wheelYAction !== _CameraProperty.RotateRelative || (this._wheelYAction = _CameraProperty.RotateRelative, this._wheelYActionCoordinate = axis);}get wheelYRotateRelative() {return this._wheelYAction === _CameraProperty.RotateRelative ? this._wheelYActionCoordinate : null;}set wheelZRotateRelative(axis) {null === axis && this._wheelZAction !== _CameraProperty.RotateRelative || (this._wheelZAction = _CameraProperty.RotateRelative, this._wheelZActionCoordinate = axis);}get wheelZRotateRelative() {return this._wheelZAction === _CameraProperty.RotateRelative ? this._wheelZActionCoordinate : null;}set wheelXMoveScene(axis) {null === axis && this._wheelXAction !== _CameraProperty.MoveScene || (this._wheelXAction = _CameraProperty.MoveScene, this._wheelXActionCoordinate = axis);}get wheelXMoveScene() {return this._wheelXAction === _CameraProperty.MoveScene ? this._wheelXActionCoordinate : null;}set wheelYMoveScene(axis) {null === axis && this._wheelYAction !== _CameraProperty.MoveScene || (this._wheelYAction = _CameraProperty.MoveScene, this._wheelYActionCoordinate = axis);}get wheelYMoveScene() {return this._wheelYAction === _CameraProperty.MoveScene ? this._wheelYActionCoordinate : null;}set wheelZMoveScene(axis) {null === axis && this._wheelZAction !== _CameraProperty.MoveScene || (this._wheelZAction = _CameraProperty.MoveScene, this._wheelZActionCoordinate = axis);}get wheelZMoveScene() {return this._wheelZAction === _CameraProperty.MoveScene ? this._wheelZActionCoordinate : null;}checkInputs() {if (0 !== this._wheelDeltaX || 0 !== this._wheelDeltaY || 0 != this._wheelDeltaZ) {this._moveRelative.setAll(0), this._rotateRelative.setAll(0), this._moveScene.setAll(0), this._updateCamera(), this.camera.getScene().useRightHandedSystem && (this._moveRelative.z *= -1);const cameraTransformMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix.Zero */ .y3.Zero();this.camera.getViewMatrix().invertToRef(cameraTransformMatrix);const transformedDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3.Zero */ .P.Zero();_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(this._moveRelative, cameraTransformMatrix, transformedDirection), this.camera.cameraRotation.x += this._rotateRelative.x / 200, this.camera.cameraRotation.y += this._rotateRelative.y / 200, this.camera.cameraDirection.addInPlace(transformedDirection), this.camera.cameraDirection.addInPlace(this._moveScene), super.checkInputs();}}_updateCamera() {this._updateCameraProperty(this._wheelDeltaX, this._wheelXAction, this._wheelXActionCoordinate), this._updateCameraProperty(this._wheelDeltaY, this._wheelYAction, this._wheelYActionCoordinate), this._updateCameraProperty(this._wheelDeltaZ, this._wheelZAction, this._wheelZActionCoordinate);}_updateCameraProperty(value, cameraProperty, coordinate) {if (0 === value) return;if (null === cameraProperty || null === coordinate) return;let action = null;cameraProperty === _CameraProperty.MoveRelative ? action = this._moveRelative : cameraProperty === _CameraProperty.RotateRelative ? action = this._rotateRelative : cameraProperty === _CameraProperty.MoveScene ? action = this._moveScene : void 0;coordinate === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Coordinate.X */ .c7.X ? action.set(value, 0, 0) : coordinate === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Coordinate.Y */ .c7.Y ? action.set(0, value, 0) : coordinate === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Coordinate.Z */ .c7.Z ? action.set(0, 0, value) : void 0;}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraMouseWheelInput.prototype, "wheelXMoveRelative", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraMouseWheelInput.prototype, "wheelYMoveRelative", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraMouseWheelInput.prototype, "wheelZMoveRelative", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraMouseWheelInput.prototype, "wheelXRotateRelative", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraMouseWheelInput.prototype, "wheelYRotateRelative", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraMouseWheelInput.prototype, "wheelZRotateRelative", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraMouseWheelInput.prototype, "wheelXMoveScene", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraMouseWheelInput.prototype, "wheelYMoveScene", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraMouseWheelInput.prototype, "wheelZMoveScene", null), _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__/* .CameraInputTypes.FreeCameraMouseWheelInput */ .u.FreeCameraMouseWheelInput = FreeCameraMouseWheelInput;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraTouchInput.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "y": () => (/* binding */ FreeCameraTouchInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/cameraInputsManager.js");
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Events/pointerEvents.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
class FreeCameraTouchInput {constructor(allowMouse = !1) {this.allowMouse = allowMouse, this.touchAngularSensibility = 2e5, this.touchMoveSensibility = 250, this.singleFingerRotate = !1, this._offsetX = null, this._offsetY = null, this._pointerPressed = [], this._isSafari = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools.IsSafari */ .w1.IsSafari();}attachControl(noPreventDefault) {noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools.BackCompatCameraNoPreventDefault */ .w1.BackCompatCameraNoPreventDefault(arguments);let previousPosition = null;if (void 0 === this._pointerInput && (this._onLostFocus = () => {this._offsetX = null, this._offsetY = null;}, this._pointerInput = (p) => {const evt = p.event,isMouseEvent = "mouse" === evt.pointerType || this._isSafari && "undefined" == typeof evt.pointerType;if (this.allowMouse || !isMouseEvent) if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes.POINTERDOWN */ .kD.POINTERDOWN) {if (noPreventDefault || evt.preventDefault(), this._pointerPressed.push(evt.pointerId), 1 !== this._pointerPressed.length) return;previousPosition = { x: evt.clientX, y: evt.clientY };} else if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes.POINTERUP */ .kD.POINTERUP) {noPreventDefault || evt.preventDefault();const index = this._pointerPressed.indexOf(evt.pointerId);if (-1 === index) return;if (this._pointerPressed.splice(index, 1), 0 != index) return;previousPosition = null, this._offsetX = null, this._offsetY = null;} else if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes.POINTERMOVE */ .kD.POINTERMOVE) {if (noPreventDefault || evt.preventDefault(), !previousPosition) return;const index = this._pointerPressed.indexOf(evt.pointerId);if (0 != index) return;this._offsetX = evt.clientX - previousPosition.x, this._offsetY = -(evt.clientY - previousPosition.y);}}), this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput, _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes.POINTERDOWN */ .kD.POINTERDOWN | _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes.POINTERUP */ .kD.POINTERUP | _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes.POINTERMOVE */ .kD.POINTERMOVE), this._onLostFocus) {const engine = this.camera.getEngine(),element = engine.getInputElement();element && element.addEventListener("blur", this._onLostFocus);}}detachControl() {if (this._pointerInput) {if (this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null), this._onLostFocus) {const engine = this.camera.getEngine(),element = engine.getInputElement();element && element.removeEventListener("blur", this._onLostFocus), this._onLostFocus = null;}this._pointerPressed.length = 0, this._offsetX = null, this._offsetY = null;}}checkInputs() {if (null !== this._offsetX && null !== this._offsetY && (0 !== this._offsetX || 0 !== this._offsetY)) {const camera = this.camera;camera.cameraRotation.y = this._offsetX / this.touchAngularSensibility;const rotateCamera = this.singleFingerRotate && 1 === this._pointerPressed.length || !this.singleFingerRotate && 1 < this._pointerPressed.length;if (rotateCamera) camera.cameraRotation.x = -this._offsetY / this.touchAngularSensibility;else {const speed = camera._computeLocalCameraSpeed(),direction = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .P(0, 0, 0 === this.touchMoveSensibility ? 0 : speed * this._offsetY / this.touchMoveSensibility);_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix.RotationYawPitchRollToRef */ .y3.RotationYawPitchRollToRef(camera.rotation.y, camera.rotation.x, 0, camera._cameraRotationMatrix), camera.cameraDirection.addInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3.TransformCoordinates */ .P.TransformCoordinates(direction, camera._cameraRotationMatrix));}}}getClassName() {return "FreeCameraTouchInput";}getSimpleName() {return "touch";}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraTouchInput.prototype, "touchAngularSensibility", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCameraTouchInput.prototype, "touchMoveSensibility", void 0), _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__/* .CameraInputTypes.FreeCameraTouchInput */ .u.FreeCameraTouchInput = FreeCameraTouchInput;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/camera.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "V": () => (/* binding */ Camera)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/smartArray.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
/* harmony import */ var _Maths_math_viewport_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.viewport.js");
/* harmony import */ var _Maths_math_frustum_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.frustum.js");
class Camera extends _node_js__WEBPACK_IMPORTED_MODULE_6__/* .Node */ .N {get position() {return this._position;}set position(newPosition) {this._position = newPosition;}set upVector(vec) {this._upVector = vec;}get upVector() {return this._upVector;}get screenArea() {var _a, _b, _c, _d;let x = 0,y = 0;if (this.mode === Camera.PERSPECTIVE_CAMERA) this.fovMode === Camera.FOVMODE_VERTICAL_FIXED ? (y = 2 * this.minZ * Math.tan(this.fov / 2), x = this.getEngine().getAspectRatio(this) * y) : (x = 2 * this.minZ * Math.tan(this.fov / 2), y = x / this.getEngine().getAspectRatio(this));else {const halfWidth = this.getEngine().getRenderWidth() / 2,halfHeight = this.getEngine().getRenderHeight() / 2;x = (null !== (_a = this.orthoRight) && void 0 !== _a ? _a : halfWidth) - (null !== (_b = this.orthoLeft) && void 0 !== _b ? _b : -halfWidth), y = (null !== (_c = this.orthoTop) && void 0 !== _c ? _c : halfHeight) - (null !== (_d = this.orthoBottom) && void 0 !== _d ? _d : -halfHeight);}return x * y;}set orthoLeft(value) {this._orthoLeft = value;for (const rigCamera of this._rigCameras) rigCamera.orthoLeft = value;}get orthoLeft() {return this._orthoLeft;}set orthoRight(value) {this._orthoRight = value;for (const rigCamera of this._rigCameras) rigCamera.orthoRight = value;}get orthoRight() {return this._orthoRight;}set orthoBottom(value) {this._orthoBottom = value;for (const rigCamera of this._rigCameras) rigCamera.orthoBottom = value;}get orthoBottom() {return this._orthoBottom;}set orthoTop(value) {this._orthoTop = value;for (const rigCamera of this._rigCameras) rigCamera.orthoTop = value;}get orthoTop() {return this._orthoTop;}set mode(mode) {this._mode = mode;for (const rigCamera of this._rigCameras) rigCamera.mode = mode;}get mode() {return this._mode;}constructor(name, position, scene, setActiveOnSceneIfNoneActive = !0) {super(name, scene), this._position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3.Zero */ .P.Zero(), this._upVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3.Up */ .P.Up(), this._orthoLeft = null, this._orthoRight = null, this._orthoBottom = null, this._orthoTop = null, this.fov = .8, this.projectionPlaneTilt = 0, this.minZ = 1, this.maxZ = 1e4, this.inertia = .9, this._mode = Camera.PERSPECTIVE_CAMERA, this.isIntermediate = !1, this.viewport = new _Maths_math_viewport_js__WEBPACK_IMPORTED_MODULE_10__/* .Viewport */ .l(0, 0, 1, 1), this.layerMask = 268435455, this.fovMode = Camera.FOVMODE_VERTICAL_FIXED, this.cameraRigMode = Camera.RIG_MODE_NONE, this.customRenderTargets = [], this.outputRenderTarget = null, this.onViewMatrixChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__/* .Observable */ .y$(), this.onProjectionMatrixChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__/* .Observable */ .y$(), this.onAfterCheckInputsObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__/* .Observable */ .y$(), this.onRestoreStateObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__/* .Observable */ .y$(), this.isRigCamera = !1, this._rigCameras = [], this._webvrViewMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.Identity */ .y3.Identity(), this._skipRendering = !1, this._projectionMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .y3(), this._postProcesses = [], this._activeMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_2__/* .SmartArray */ .t(256), this._globalPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3.Zero */ .P.Zero(), this._computedViewMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.Identity */ .y3.Identity(), this._doNotComputeProjectionMatrix = !1, this._transformMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.Zero */ .y3.Zero(), this._refreshFrustumPlanes = !0, this._absoluteRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Quaternion.Identity */ ._f.Identity(), this._isCamera = !0, this._isLeftCamera = !1, this._isRightCamera = !1, this.getScene().addCamera(this), setActiveOnSceneIfNoneActive && !this.getScene().activeCamera && (this.getScene().activeCamera = this), this.position = position, this.renderPassId = this.getScene().getEngine().createRenderPassId(`Camera ${name}`);}storeState() {return this._stateStored = !0, this._storedFov = this.fov, this;}_restoreStateValues() {return !!this._stateStored && (this.fov = this._storedFov, !0);}restoreState() {return !!this._restoreStateValues() && (this.onRestoreStateObservable.notifyObservers(this), !0);}getClassName() {return "Camera";}toString(fullDetails) {let ret = "Name: " + this.name;if (ret += ", type: " + this.getClassName(), this.animations) for (let i = 0; i < this.animations.length; i++) ret += ", animation[0]: " + this.animations[i].toString(fullDetails);return ret;}applyVerticalCorrection() {const rot = this.absoluteRotation.toEulerAngles();this.projectionPlaneTilt = this._scene.useRightHandedSystem ? -rot.x : rot.x;}get globalPosition() {return this._globalPosition;}getActiveMeshes() {return this._activeMeshes;}isActiveMesh(mesh) {return -1 !== this._activeMeshes.indexOf(mesh);}isReady(completeCheck = !1) {if (completeCheck) for (const pp of this._postProcesses) if (pp && !pp.isReady()) return !1;return super.isReady(completeCheck);}_initCache() {super._initCache(), this._cache.position = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.upVector = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.mode = void 0, this._cache.minZ = void 0, this._cache.maxZ = void 0, this._cache.fov = void 0, this._cache.fovMode = void 0, this._cache.aspectRatio = void 0, this._cache.orthoLeft = void 0, this._cache.orthoRight = void 0, this._cache.orthoBottom = void 0, this._cache.orthoTop = void 0, this._cache.renderWidth = void 0, this._cache.renderHeight = void 0;}_updateCache(ignoreParentClass) {ignoreParentClass || super._updateCache(), this._cache.position.copyFrom(this.position), this._cache.upVector.copyFrom(this.upVector);}_isSynchronized() {return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();}_isSynchronizedViewMatrix() {return !!super._isSynchronized() && this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent();}_isSynchronizedProjectionMatrix() {let check = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;if (!check) return !1;const engine = this.getEngine();return check = this.mode === Camera.PERSPECTIVE_CAMERA ? this._cache.fov === this.fov && this._cache.fovMode === this.fovMode && this._cache.aspectRatio === engine.getAspectRatio(this) && this._cache.projectionPlaneTilt === this.projectionPlaneTilt : this._cache.orthoLeft === this.orthoLeft && this._cache.orthoRight === this.orthoRight && this._cache.orthoBottom === this.orthoBottom && this._cache.orthoTop === this.orthoTop && this._cache.renderWidth === engine.getRenderWidth() && this._cache.renderHeight === engine.getRenderHeight(), check;}attachControl() {}detachControl() {}update() {this._checkInputs(), this.cameraRigMode !== Camera.RIG_MODE_NONE && this._updateRigCameras();}_checkInputs() {this.onAfterCheckInputsObservable.notifyObservers(this);}get rigCameras() {return this._rigCameras;}get rigPostProcess() {return this._rigPostProcess;}_getFirstPostProcess() {for (let ppIndex = 0; ppIndex < this._postProcesses.length; ppIndex++) if (null !== this._postProcesses[ppIndex]) return this._postProcesses[ppIndex];return null;}_cascadePostProcessesToRigCams() {const firstPostProcess = this._getFirstPostProcess();firstPostProcess && firstPostProcess.markTextureDirty();for (let i = 0, len = this._rigCameras.length; i < len; i++) {const cam = this._rigCameras[i],rigPostProcess = cam._rigPostProcess;if (rigPostProcess) {const isPass = "pass" === rigPostProcess.getEffectName();isPass && (cam.isIntermediate = 0 === this._postProcesses.length), cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess), rigPostProcess.markTextureDirty();} else cam._postProcesses = this._postProcesses.slice(0);}}attachPostProcess(postProcess, insertAt = null) {return !postProcess.isReusable() && -1 < this._postProcesses.indexOf(postProcess) ? (_Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .Logger.Error */ .Y.Error("You're trying to reuse a post process not defined as reusable."), 0) : (null == insertAt || 0 > insertAt ? this._postProcesses.push(postProcess) : null === this._postProcesses[insertAt] ? this._postProcesses[insertAt] = postProcess : this._postProcesses.splice(insertAt, 0, postProcess), this._cascadePostProcessesToRigCams(), this._scene.prePassRenderer && this._scene.prePassRenderer.markAsDirty(), this._postProcesses.indexOf(postProcess));}detachPostProcess(postProcess) {const idx = this._postProcesses.indexOf(postProcess);-1 !== idx && (this._postProcesses[idx] = null), this._scene.prePassRenderer && this._scene.prePassRenderer.markAsDirty(), this._cascadePostProcessesToRigCams();}getWorldMatrix() {return this._isSynchronizedViewMatrix() ? this._worldMatrix : (this.getViewMatrix(), this._worldMatrix);}_getViewMatrix() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.Identity */ .y3.Identity();}getViewMatrix(force) {return !force && this._isSynchronizedViewMatrix() ? this._computedViewMatrix : (this.updateCache(), this._computedViewMatrix = this._getViewMatrix(), this._currentRenderId = this.getScene().getRenderId(), this._childUpdateId++, this._refreshFrustumPlanes = !0, this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix && this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix), this.parent && this.parent.onViewMatrixChangedObservable && this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent), this.onViewMatrixChangedObservable.notifyObservers(this), this._computedViewMatrix.invertToRef(this._worldMatrix), this._computedViewMatrix);}freezeProjectionMatrix(projection) {this._doNotComputeProjectionMatrix = !0, projection !== void 0 && (this._projectionMatrix = projection);}unfreezeProjectionMatrix() {this._doNotComputeProjectionMatrix = !1;}getProjectionMatrix(force) {var _a, _b, _c, _d, _e, _f, _g, _h;if (this._doNotComputeProjectionMatrix || !force && this._isSynchronizedProjectionMatrix()) return this._projectionMatrix;this._cache.mode = this.mode, this._cache.minZ = this.minZ, this._cache.maxZ = this.maxZ, this._refreshFrustumPlanes = !0;const engine = this.getEngine(),scene = this.getScene(),reverseDepth = engine.useReverseDepthBuffer;if (this.mode === Camera.PERSPECTIVE_CAMERA) {this._cache.fov = this.fov, this._cache.fovMode = this.fovMode, this._cache.aspectRatio = engine.getAspectRatio(this), this._cache.projectionPlaneTilt = this.projectionPlaneTilt, 0 >= this.minZ && (this.minZ = .1);let getProjectionMatrix;getProjectionMatrix = scene.useRightHandedSystem ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.PerspectiveFovRHToRef */ .y3.PerspectiveFovRHToRef : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.PerspectiveFovLHToRef */ .y3.PerspectiveFovLHToRef, getProjectionMatrix(this.fov, engine.getAspectRatio(this), reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED, engine.isNDCHalfZRange, this.projectionPlaneTilt, reverseDepth);} else {const halfWidth = engine.getRenderWidth() / 2,halfHeight = engine.getRenderHeight() / 2;scene.useRightHandedSystem ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.OrthoOffCenterRHToRef */ .y3.OrthoOffCenterRHToRef(null !== (_a = this.orthoLeft) && void 0 !== _a ? _a : -halfWidth, null !== (_b = this.orthoRight) && void 0 !== _b ? _b : halfWidth, null !== (_c = this.orthoBottom) && void 0 !== _c ? _c : -halfHeight, null !== (_d = this.orthoTop) && void 0 !== _d ? _d : halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, engine.isNDCHalfZRange) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.OrthoOffCenterLHToRef */ .y3.OrthoOffCenterLHToRef(null !== (_e = this.orthoLeft) && void 0 !== _e ? _e : -halfWidth, null !== (_f = this.orthoRight) && void 0 !== _f ? _f : halfWidth, null !== (_g = this.orthoBottom) && void 0 !== _g ? _g : -halfHeight, null !== (_h = this.orthoTop) && void 0 !== _h ? _h : halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, engine.isNDCHalfZRange), this._cache.orthoLeft = this.orthoLeft, this._cache.orthoRight = this.orthoRight, this._cache.orthoBottom = this.orthoBottom, this._cache.orthoTop = this.orthoTop, this._cache.renderWidth = engine.getRenderWidth(), this._cache.renderHeight = engine.getRenderHeight();}return this.onProjectionMatrixChangedObservable.notifyObservers(this), this._projectionMatrix;}getTransformationMatrix() {return this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._transformMatrix;}_updateFrustumPlanes() {this._refreshFrustumPlanes && (this.getTransformationMatrix(), this._frustumPlanes ? _Maths_math_frustum_js__WEBPACK_IMPORTED_MODULE_11__/* .Frustum.GetPlanesToRef */ .i.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = _Maths_math_frustum_js__WEBPACK_IMPORTED_MODULE_11__/* .Frustum.GetPlanes */ .i.GetPlanes(this._transformMatrix), this._refreshFrustumPlanes = !1);}isInFrustum(target, checkRigCameras = !1) {if (this._updateFrustumPlanes(), checkRigCameras && 0 < this.rigCameras.length) {let result = !1;return this.rigCameras.forEach((cam) => {cam._updateFrustumPlanes(), result = result || target.isInFrustum(cam._frustumPlanes);}), result;}return target.isInFrustum(this._frustumPlanes);}isCompletelyInFrustum(target) {return this._updateFrustumPlanes(), target.isCompletelyInFrustum(this._frustumPlanes);}getForwardRay(length = 100) {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .S)("Ray");}getForwardRayToRef(length = 100) {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .S)("Ray");}dispose(doNotRecurse, disposeMaterialAndTextures = !1) {for (this.onViewMatrixChangedObservable.clear(), this.onProjectionMatrixChangedObservable.clear(), this.onAfterCheckInputsObservable.clear(), this.onRestoreStateObservable.clear(), this.inputs && this.inputs.clear(), this.getScene().stopAnimation(this), this.getScene().removeCamera(this); 0 < this._rigCameras.length;) {const camera = this._rigCameras.pop();camera && camera.dispose();}if (this._parentContainer) {const index = this._parentContainer.cameras.indexOf(this);-1 < index && this._parentContainer.cameras.splice(index, 1), this._parentContainer = null;}if (this._rigPostProcess) this._rigPostProcess.dispose(this), this._rigPostProcess = null, this._postProcesses.length = 0;else if (this.cameraRigMode !== Camera.RIG_MODE_NONE) this._rigPostProcess = null, this._postProcesses.length = 0;else for (let i = this._postProcesses.length; 0 <= --i;) {const postProcess = this._postProcesses[i];postProcess && postProcess.dispose(this);}for (let i = this.customRenderTargets.length; 0 <= --i;) this.customRenderTargets[i].dispose();this.customRenderTargets.length = 0, this._activeMeshes.dispose(), this.getScene().getEngine().releaseRenderPassId(this.renderPassId), super.dispose(doNotRecurse, disposeMaterialAndTextures);}get isLeftCamera() {return this._isLeftCamera;}get isRightCamera() {return this._isRightCamera;}get leftCamera() {return 1 > this._rigCameras.length ? null : this._rigCameras[0];}get rightCamera() {return 2 > this._rigCameras.length ? null : this._rigCameras[1];}getLeftTarget() {return 1 > this._rigCameras.length ? null : this._rigCameras[0].getTarget();}getRightTarget() {return 2 > this._rigCameras.length ? null : this._rigCameras[1].getTarget();}setCameraRigMode(mode, rigParams) {if (this.cameraRigMode !== mode) {for (; 0 < this._rigCameras.length;) {const camera = this._rigCameras.pop();camera && camera.dispose();}if (this.cameraRigMode = mode, this._cameraRigParams = {}, this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || .0637, this._cameraRigParams.stereoHalfAngle = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools.ToRadians */ .w1.ToRadians(this._cameraRigParams.interaxialDistance / .0637), this.cameraRigMode !== Camera.RIG_MODE_NONE) {const leftCamera = this.createRigCamera(this.name + "_L", 0);leftCamera && (leftCamera._isLeftCamera = !0);const rightCamera = this.createRigCamera(this.name + "_R", 1);rightCamera && (rightCamera._isRightCamera = !0), leftCamera && rightCamera && (this._rigCameras.push(leftCamera), this._rigCameras.push(rightCamera));}this._setRigMode(rigParams), this._cascadePostProcessesToRigCams(), this.update();}}_setRigMode() {}_getVRProjectionMatrix() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.PerspectiveFovLHToRef */ .y3.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix, !0, this.getEngine().isNDCHalfZRange), this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix), this._projectionMatrix;}_updateCameraRotationMatrix() {}_updateWebVRCameraRotationMatrix() {}_getWebVRProjectionMatrix() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.Identity */ .y3.Identity();}_getWebVRViewMatrix() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix.Identity */ .y3.Identity();}setCameraRigParameter(name, value) {this._cameraRigParams || (this._cameraRigParams = {}), this._cameraRigParams[name] = value, "interaxialDistance" === name && (this._cameraRigParams.stereoHalfAngle = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools.ToRadians */ .w1.ToRadians(value / .0637));}createRigCamera() {return null;}_updateRigCameras() {for (let i = 0; i < this._rigCameras.length; i++) this._rigCameras[i].minZ = this.minZ, this._rigCameras[i].maxZ = this.maxZ, this._rigCameras[i].fov = this.fov, this._rigCameras[i].upVector.copyFrom(this.upVector);this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH && (this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport);}_setupInputs() {}serialize() {const serializationObject = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Serialize */ .p4.Serialize(this);return serializationObject.uniqueId = this.uniqueId, serializationObject.type = this.getClassName(), this.parent && this.parent._serializeAsParent(serializationObject), this.inputs && this.inputs.serialize(serializationObject), _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.AppendSerializedAnimations */ .p4.AppendSerializedAnimations(this, serializationObject), serializationObject.ranges = this.serializeAnimationRanges(), serializationObject.isEnabled = this.isEnabled(), serializationObject;}clone(name, newParent = null) {const camera = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Clone */ .p4.Clone(Camera.GetConstructorFromName(this.getClassName(), name, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this);return camera.name = name, camera.parent = newParent, this.onClonedObservable.notifyObservers(camera), camera;}getDirection(localAxis) {const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3.Zero */ .P.Zero();return this.getDirectionToRef(localAxis, result), result;}get absoluteRotation() {return this.getWorldMatrix().decompose(void 0, this._absoluteRotation), this._absoluteRotation;}getDirectionToRef(localAxis, result) {_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(localAxis, this.getWorldMatrix(), result);}static GetConstructorFromName(type, name, scene, interaxial_distance = 0, isStereoscopicSideBySide = !0) {const constructorFunc = _node_js__WEBPACK_IMPORTED_MODULE_6__/* .Node.Construct */ .N.Construct(type, name, scene, { interaxial_distance: interaxial_distance, isStereoscopicSideBySide: isStereoscopicSideBySide });return constructorFunc ? constructorFunc : () => Camera._CreateDefaultParsedCamera(name, scene);}computeWorldMatrix() {return this.getWorldMatrix();}static Parse(parsedCamera, scene) {const type = parsedCamera.type,construct = Camera.GetConstructorFromName(type, parsedCamera.name, scene, parsedCamera.interaxial_distance, parsedCamera.isStereoscopicSideBySide),camera = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(construct, parsedCamera, scene);if (void 0 !== parsedCamera.parentId && (camera._waitingParentId = parsedCamera.parentId), void 0 !== parsedCamera.parentInstanceIndex && (camera._waitingParentInstanceIndex = parsedCamera.parentInstanceIndex), camera.inputs && (camera.inputs.parse(parsedCamera), camera._setupInputs()), parsedCamera.upVector && (camera.upVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3.FromArray */ .P.FromArray(parsedCamera.upVector)), camera.setPosition && (camera.position.copyFromFloats(0, 0, 0), camera.setPosition(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3.FromArray */ .P.FromArray(parsedCamera.position))), parsedCamera.target && camera.setTarget && camera.setTarget(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3.FromArray */ .P.FromArray(parsedCamera.target)), parsedCamera.cameraRigMode) {const rigParams = parsedCamera.interaxial_distance ? { interaxialDistance: parsedCamera.interaxial_distance } : {};camera.setCameraRigMode(parsedCamera.cameraRigMode, rigParams);}if (parsedCamera.animations) {for (let animationIndex = 0; animationIndex < parsedCamera.animations.length; animationIndex++) {const parsedAnimation = parsedCamera.animations[animationIndex],internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__/* .GetClass */ .q)("BABYLON.Animation");internalClass && camera.animations.push(internalClass.Parse(parsedAnimation));}_node_js__WEBPACK_IMPORTED_MODULE_6__/* .Node.ParseAnimationRanges */ .N.ParseAnimationRanges(camera, parsedCamera, scene);}return parsedCamera.autoAnimate && scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1), void 0 !== parsedCamera.isEnabled && camera.setEnabled(parsedCamera.isEnabled), camera;}}Camera._CreateDefaultParsedCamera = () => {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .S)("UniversalCamera");}, Camera.PERSPECTIVE_CAMERA = 0, Camera.ORTHOGRAPHIC_CAMERA = 1, Camera.FOVMODE_VERTICAL_FIXED = 0, Camera.FOVMODE_HORIZONTAL_FIXED = 1, Camera.RIG_MODE_NONE = 0, Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10, Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11, Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12, Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13, Camera.RIG_MODE_STEREOSCOPIC_INTERLACED = 14, Camera.RIG_MODE_VR = 20, Camera.RIG_MODE_WEBVR = 21, Camera.RIG_MODE_CUSTOM = 22, Camera.ForceAttachControlToAlwaysPreventDefault = !1, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)("position")], Camera.prototype, "_position", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)("upVector")], Camera.prototype, "_upVector", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "orthoLeft", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "orthoRight", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "orthoBottom", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "orthoTop", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "fov", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "projectionPlaneTilt", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "minZ", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "maxZ", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "inertia", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "mode", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "layerMask", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "fovMode", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "cameraRigMode", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "interaxialDistance", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Camera.prototype, "isStereoscopicSideBySide", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/cameraInputsManager.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "p": () => (/* binding */ CameraInputsManager),
/* harmony export */   "u": () => (/* binding */ CameraInputTypes)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _camera_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/camera.js");
var CameraInputTypes = {};class CameraInputsManager {constructor(camera) {this.attachedToElement = !1, this.attached = {}, this.camera = camera, this.checkInputs = () => {};}add(input) {const type = input.getSimpleName();return this.attached[type] ? void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger.Warn */ .Y.Warn("camera input of type " + type + " already exists on camera") : void (this.attached[type] = input, input.camera = this.camera, input.checkInputs && (this.checkInputs = this._addCheckInputs(input.checkInputs.bind(input))), this.attachedToElement && input.attachControl(this.noPreventDefault));}remove(inputToRemove) {for (const cam in this.attached) {const input = this.attached[cam];if (input === inputToRemove) return input.detachControl(), input.camera = null, delete this.attached[cam], void this.rebuildInputCheck();}}removeByType(inputType) {for (const cam in this.attached) {const input = this.attached[cam];input.getClassName() === inputType && (input.detachControl(), input.camera = null, delete this.attached[cam], this.rebuildInputCheck());}}_addCheckInputs(fn) {const current = this.checkInputs;return () => {current(), fn();};}attachInput(input) {this.attachedToElement && input.attachControl(this.noPreventDefault);}attachElement(noPreventDefault = !1) {if (!this.attachedToElement) for (const cam in noPreventDefault = !_camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.ForceAttachControlToAlwaysPreventDefault */ .V.ForceAttachControlToAlwaysPreventDefault && noPreventDefault, this.attachedToElement = !0, this.noPreventDefault = noPreventDefault, this.attached) this.attached[cam].attachControl(noPreventDefault);}detachElement(disconnect = !1) {for (const cam in this.attached) this.attached[cam].detachControl(), disconnect && (this.attached[cam].camera = null);this.attachedToElement = !1;}rebuildInputCheck() {for (const cam in this.checkInputs = () => {}, this.attached) {const input = this.attached[cam];input.checkInputs && (this.checkInputs = this._addCheckInputs(input.checkInputs.bind(input)));}}clear() {this.attachedToElement && this.detachElement(!0), this.attached = {}, this.attachedToElement = !1, this.checkInputs = () => {};}serialize(serializedCamera) {const inputs = {};for (const cam in this.attached) {const input = this.attached[cam],res = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Serialize */ .p4.Serialize(input);inputs[input.getClassName()] = res;}serializedCamera.inputsmgr = inputs;}parse(parsedCamera) {const parsedInputs = parsedCamera.inputsmgr;if (parsedInputs) for (const n in this.clear(), parsedInputs) {const construct = CameraInputTypes[n];if (construct) {const parsedinput = parsedInputs[n],input = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(() => new construct(), parsedinput, null);this.add(input);}} else for (const n in this.attached) {const construct = CameraInputTypes[this.attached[n].getClassName()];if (construct) {const input = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(() => new construct(), parsedCamera, null);this.remove(this.attached[n]), this.add(input);}}}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/freeCamera.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "c": () => (/* binding */ FreeCamera)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engine.js");
/* harmony import */ var _targetCamera_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/targetCamera.js");
/* harmony import */ var _freeCameraInputsManager_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/freeCameraInputsManager.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
class FreeCamera extends _targetCamera_js__WEBPACK_IMPORTED_MODULE_4__/* .TargetCamera */ .C {get angularSensibility() {const mouse = this.inputs.attached.mouse;return mouse ? mouse.angularSensibility : 0;}set angularSensibility(value) {const mouse = this.inputs.attached.mouse;mouse && (mouse.angularSensibility = value);}get keysUp() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysUp : [];}set keysUp(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysUp = value);}get keysUpward() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysUpward : [];}set keysUpward(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysUpward = value);}get keysDown() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysDown : [];}set keysDown(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysDown = value);}get keysDownward() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysDownward : [];}set keysDownward(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysDownward = value);}get keysLeft() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysLeft : [];}set keysLeft(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysLeft = value);}get keysRight() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysRight : [];}set keysRight(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysRight = value);}get keysRotateLeft() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysRotateLeft : [];}set keysRotateLeft(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysRotateLeft = value);}get keysRotateRight() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysRotateRight : [];}set keysRotateRight(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysRotateRight = value);}constructor(name, position, scene, setActiveOnSceneIfNoneActive = !0) {super(name, position, scene, setActiveOnSceneIfNoneActive), this.ellipsoid = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(.5, 1, .5), this.ellipsoidOffset = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(0, 0, 0), this.checkCollisions = !1, this.applyGravity = !1, this._needMoveForGravity = !1, this._oldPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), this._diffPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), this._newPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), this._collisionMask = -1, this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {const updatePosition = (newPos) => {this._newPosition.copyFrom(newPos), this._newPosition.subtractToRef(this._oldPosition, this._diffPosition), this._diffPosition.length() > _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.CollisionsEpsilon */ .D.CollisionsEpsilon && (this.position.addInPlace(this._diffPosition), this.onCollide && collidedMesh && this.onCollide(collidedMesh));};updatePosition(newPosition);}, this.inputs = new _freeCameraInputsManager_js__WEBPACK_IMPORTED_MODULE_5__/* .FreeCameraInputsManager */ .a(this), this.inputs.addKeyboard().addMouse();}attachControl(ignored, noPreventDefault) {noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_6__/* .Tools.BackCompatCameraNoPreventDefault */ .w1.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(noPreventDefault);}detachControl() {this.inputs.detachElement(), this.cameraDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(0, 0, 0), this.cameraRotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector2 */ .FM(0, 0);}get collisionMask() {return this._collisionMask;}set collisionMask(mask) {this._collisionMask = isNaN(mask) ? -1 : mask;}_collideWithWorld(displacement) {let globalPosition;globalPosition = this.parent ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinates */ .P.TransformCoordinates(this.position, this.parent.getWorldMatrix()) : this.position, globalPosition.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition), this._oldPosition.addInPlace(this.ellipsoidOffset);const coordinator = this.getScene().collisionCoordinator;this._collider || (this._collider = coordinator.createCollider()), this._collider._radius = this.ellipsoid, this._collider.collisionMask = this._collisionMask;let actualDisplacement = displacement;this.applyGravity && (actualDisplacement = displacement.add(this.getScene().gravity)), coordinator.getNewPosition(this._oldPosition, actualDisplacement, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);}_checkInputs() {this._localDirection || (this._localDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), this._transformedDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero()), this.inputs.checkInputs(), super._checkInputs();}_decideIfNeedsToMove() {return this._needMoveForGravity || 0 < Math.abs(this.cameraDirection.x) || 0 < Math.abs(this.cameraDirection.y) || 0 < Math.abs(this.cameraDirection.z);}_updatePosition() {this.checkCollisions && this.getScene().collisionsEnabled ? this._collideWithWorld(this.cameraDirection) : super._updatePosition();}dispose() {this.inputs.clear(), super.dispose();}getClassName() {return "FreeCamera";}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)()], FreeCamera.prototype, "ellipsoid", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)()], FreeCamera.prototype, "ellipsoidOffset", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCamera.prototype, "checkCollisions", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], FreeCamera.prototype, "applyGravity", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/freeCameraInputsManager.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "a": () => (/* binding */ FreeCameraInputsManager)
/* harmony export */ });
/* harmony import */ var _cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/cameraInputsManager.js");
/* harmony import */ var _Cameras_Inputs_freeCameraKeyboardMoveInput_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraKeyboardMoveInput.js");
/* harmony import */ var _Cameras_Inputs_freeCameraMouseInput_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseInput.js");
/* harmony import */ var _Cameras_Inputs_freeCameraMouseWheelInput_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseWheelInput.js");
/* harmony import */ var _Cameras_Inputs_freeCameraTouchInput_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraTouchInput.js");
class FreeCameraInputsManager extends _cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_0__/* .CameraInputsManager */ .p {constructor(camera) {super(camera), this._mouseInput = null, this._mouseWheelInput = null;}addKeyboard() {return this.add(new _Cameras_Inputs_freeCameraKeyboardMoveInput_js__WEBPACK_IMPORTED_MODULE_1__/* .FreeCameraKeyboardMoveInput */ .Y()), this;}addMouse(touchEnabled = !0) {return this._mouseInput || (this._mouseInput = new _Cameras_Inputs_freeCameraMouseInput_js__WEBPACK_IMPORTED_MODULE_2__/* .FreeCameraMouseInput */ .A(touchEnabled), this.add(this._mouseInput)), this;}removeMouse() {return this._mouseInput && this.remove(this._mouseInput), this;}addMouseWheel() {return this._mouseWheelInput || (this._mouseWheelInput = new _Cameras_Inputs_freeCameraMouseWheelInput_js__WEBPACK_IMPORTED_MODULE_3__/* .FreeCameraMouseWheelInput */ .A(), this.add(this._mouseWheelInput)), this;}removeMouseWheel() {return this._mouseWheelInput && this.remove(this._mouseWheelInput), this;}addTouch() {return this.add(new _Cameras_Inputs_freeCameraTouchInput_js__WEBPACK_IMPORTED_MODULE_4__/* .FreeCameraTouchInput */ .y()), this;}clear() {super.clear(), this._mouseInput = null;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Cameras/targetCamera.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "C": () => (/* binding */ TargetCamera)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _camera_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/camera.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.constants.js");
/* harmony import */ var _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.axis.js");
class TargetCamera extends _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .V {constructor(name, position, scene, setActiveOnSceneIfNoneActive = !0) {super(name, position, scene, setActiveOnSceneIfNoneActive), this._tmpUpVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._tmpTargetVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this.cameraDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(0, 0, 0), this.cameraRotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2 */ .FM(0, 0), this.ignoreParentScaling = !1, this.updateUpVectorFromRotation = !1, this._tmpQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ ._f(), this.rotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(0, 0, 0), this.speed = 2, this.noRotationConstraint = !1, this.invertRotation = !1, this.inverseRotationSpeed = .2, this.lockedTarget = null, this._currentTarget = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._initialFocalDistance = 1, this._viewMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Zero */ .y3.Zero(), this._camMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Zero */ .y3.Zero(), this._cameraTransformMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Zero */ .y3.Zero(), this._cameraRotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Zero */ .y3.Zero(), this._referencePoint = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(0, 0, 1), this._transformedReferencePoint = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._defaultUp = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Up */ .P.Up(), this._cachedRotationZ = 0, this._cachedQuaternionRotationZ = 0;}getFrontPosition(distance) {this.getWorldMatrix();const direction = this.getTarget().subtract(this.position);return direction.normalize(), direction.scaleInPlace(distance), this.globalPosition.add(direction);}_getLockedTargetPosition() {return this.lockedTarget ? (this.lockedTarget.absolutePosition && this.lockedTarget.computeWorldMatrix(), this.lockedTarget.absolutePosition || this.lockedTarget) : null;}storeState() {return this._storedPosition = this.position.clone(), this._storedRotation = this.rotation.clone(), this.rotationQuaternion && (this._storedRotationQuaternion = this.rotationQuaternion.clone()), super.storeState();}_restoreStateValues() {return !!super._restoreStateValues() && (this.position = this._storedPosition.clone(), this.rotation = this._storedRotation.clone(), this.rotationQuaternion && (this.rotationQuaternion = this._storedRotationQuaternion.clone()), this.cameraDirection.copyFromFloats(0, 0, 0), this.cameraRotation.copyFromFloats(0, 0), !0);}_initCache() {super._initCache(), this._cache.lockedTarget = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotationQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ ._f(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);}_updateCache(ignoreParentClass) {ignoreParentClass || super._updateCache();const lockedTargetPosition = this._getLockedTargetPosition();lockedTargetPosition ? this._cache.lockedTarget ? this._cache.lockedTarget.copyFrom(lockedTargetPosition) : this._cache.lockedTarget = lockedTargetPosition.clone() : this._cache.lockedTarget = null, this._cache.rotation.copyFrom(this.rotation), this.rotationQuaternion && this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);}_isSynchronizedViewMatrix() {if (!super._isSynchronizedViewMatrix()) return !1;const lockedTargetPosition = this._getLockedTargetPosition();return (this._cache.lockedTarget ? this._cache.lockedTarget.equals(lockedTargetPosition) : !lockedTargetPosition) && (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation));}_computeLocalCameraSpeed() {const engine = this.getEngine();return this.speed * Math.sqrt(engine.getDeltaTime() / (100 * engine.getFps()));}setTarget(target) {this.upVector.normalize(), this._initialFocalDistance = target.subtract(this.position).length(), this.position.z === target.z && (this.position.z += _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .kn), this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.LookAtLHToRef */ .y3.LookAtLHToRef(this.position, target, this._defaultUp, this._camMatrix), this._camMatrix.invert(), this.rotation.x = Math.atan(this._camMatrix.m[6] / this._camMatrix.m[10]);const vDir = target.subtract(this.position);this.rotation.y = 0 <= vDir.x ? -Math.atan(vDir.z / vDir.x) + Math.PI / 2 : -Math.atan(vDir.z / vDir.x) - Math.PI / 2, this.rotation.z = 0, isNaN(this.rotation.x) && (this.rotation.x = 0), isNaN(this.rotation.y) && (this.rotation.y = 0), isNaN(this.rotation.z) && (this.rotation.z = 0), this.rotationQuaternion && _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRollToRef */ ._f.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion);}get target() {return this.getTarget();}set target(value) {this.setTarget(value);}getTarget() {return this._currentTarget;}_decideIfNeedsToMove() {return 0 < Math.abs(this.cameraDirection.x) || 0 < Math.abs(this.cameraDirection.y) || 0 < Math.abs(this.cameraDirection.z);}_updatePosition() {return this.parent ? (this.parent.getWorldMatrix().invertToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(this.cameraDirection, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0]), void this.position.addInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0])) : void this.position.addInPlace(this.cameraDirection);}_checkInputs() {const directionMultiplier = this.invertRotation ? -this.inverseRotationSpeed : 1,needToMove = this._decideIfNeedsToMove(),needToRotate = 0 < Math.abs(this.cameraRotation.x) || 0 < Math.abs(this.cameraRotation.y);if (needToMove && this._updatePosition(), needToRotate) {if (this.rotationQuaternion && this.rotationQuaternion.toEulerAnglesToRef(this.rotation), this.rotation.x += this.cameraRotation.x * directionMultiplier, this.rotation.y += this.cameraRotation.y * directionMultiplier, !this.noRotationConstraint) {const limit = 1.570796;this.rotation.x > limit && (this.rotation.x = limit), this.rotation.x < -limit && (this.rotation.x = -limit);}if (this.rotationQuaternion) {const len = this.rotation.lengthSquared();len && _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRollToRef */ ._f.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion);}}needToMove && (Math.abs(this.cameraDirection.x) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .kn && (this.cameraDirection.x = 0), Math.abs(this.cameraDirection.y) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .kn && (this.cameraDirection.y = 0), Math.abs(this.cameraDirection.z) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .kn && (this.cameraDirection.z = 0), this.cameraDirection.scaleInPlace(this.inertia)), needToRotate && (Math.abs(this.cameraRotation.x) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .kn && (this.cameraRotation.x = 0), Math.abs(this.cameraRotation.y) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .kn && (this.cameraRotation.y = 0), this.cameraRotation.scaleInPlace(this.inertia)), super._checkInputs();}_updateCameraRotationMatrix() {this.rotationQuaternion ? this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.RotationYawPitchRollToRef */ .y3.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix);}_rotateUpVectorWithCameraRotationMatrix() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(this._defaultUp, this._cameraRotationMatrix, this.upVector), this;}_getViewMatrix() {return this.lockedTarget && this.setTarget(this._getLockedTargetPosition()), this._updateCameraRotationMatrix(), this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z ? (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedQuaternionRotationZ = this.rotationQuaternion.z) : this._cachedRotationZ !== this.rotation.z && (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedRotationZ = this.rotation.z), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint), this.position.addToRef(this._transformedReferencePoint, this._currentTarget), this.updateUpVectorFromRotation && (this.rotationQuaternion ? _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Axis.Y.rotateByQuaternionToRef */ .RD.Y.rotateByQuaternionToRef(this.rotationQuaternion, this.upVector) : (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.FromEulerVectorToRef */ ._f.FromEulerVectorToRef(this.rotation, this._tmpQuaternion), _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Axis.Y.rotateByQuaternionToRef */ .RD.Y.rotateByQuaternionToRef(this._tmpQuaternion, this.upVector))), this._computeViewMatrix(this.position, this._currentTarget, this.upVector), this._viewMatrix;}_computeViewMatrix(position, target, up) {if (this.ignoreParentScaling) {if (this.parent) {const parentWorldMatrix = this.parent.getWorldMatrix();_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(position, parentWorldMatrix, this._globalPosition), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(target, parentWorldMatrix, this._tmpTargetVector), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(up, parentWorldMatrix, this._tmpUpVector), this._markSyncedWithParent();} else this._globalPosition.copyFrom(position), this._tmpTargetVector.copyFrom(target), this._tmpUpVector.copyFrom(up);return void (this.getScene().useRightHandedSystem ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.LookAtRHToRef */ .y3.LookAtRHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.LookAtLHToRef */ .y3.LookAtLHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix));}if (this.getScene().useRightHandedSystem ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.LookAtRHToRef */ .y3.LookAtRHToRef(position, target, up, this._viewMatrix) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.LookAtLHToRef */ .y3.LookAtLHToRef(position, target, up, this._viewMatrix), this.parent) {const parentWorldMatrix = this.parent.getWorldMatrix();this._viewMatrix.invert(), this._viewMatrix.multiplyToRef(parentWorldMatrix, this._viewMatrix), this._viewMatrix.getTranslationToRef(this._globalPosition), this._viewMatrix.invert(), this._markSyncedWithParent();} else this._globalPosition.copyFrom(position);}createRigCamera(name) {if (this.cameraRigMode !== _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_NONE */ .V.RIG_MODE_NONE) {const rigCamera = new TargetCamera(name, this.position.clone(), this.getScene());return rigCamera.isRigCamera = !0, rigCamera.rigParent = this, (this.cameraRigMode === _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_VR */ .V.RIG_MODE_VR || this.cameraRigMode === _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_WEBVR */ .V.RIG_MODE_WEBVR) && (!this.rotationQuaternion && (this.rotationQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ ._f()), rigCamera._cameraRigParams = {}, rigCamera.rotationQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ ._f()), rigCamera.mode = this.mode, rigCamera.orthoLeft = this.orthoLeft, rigCamera.orthoRight = this.orthoRight, rigCamera.orthoTop = this.orthoTop, rigCamera.orthoBottom = this.orthoBottom, rigCamera;}return null;}_updateRigCameras() {const camLeft = this._rigCameras[0],camRight = this._rigCameras[1];switch (this.computeWorldMatrix(), this.cameraRigMode) {case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH */ .V.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL */ .V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED */ .V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER */ .V.RIG_MODE_STEREOSCOPIC_OVERUNDER:case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_STEREOSCOPIC_INTERLACED */ .V.RIG_MODE_STEREOSCOPIC_INTERLACED:{const leftSign = this.cameraRigMode === _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED */ .V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? 1 : -1,rightSign = this.cameraRigMode === _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED */ .V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? -1 : 1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * leftSign, camLeft), this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * rightSign, camRight);break;}case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera.RIG_MODE_VR */ .V.RIG_MODE_VR:camLeft.rotationQuaternion ? (camLeft.rotationQuaternion.copyFrom(this.rotationQuaternion), camRight.rotationQuaternion.copyFrom(this.rotationQuaternion)) : (camLeft.rotation.copyFrom(this.rotation), camRight.rotation.copyFrom(this.rotation)), camLeft.position.copyFrom(this.position), camRight.position.copyFrom(this.position);}super._updateRigCameras();}_getRigCamPositionAndTarget(halfSpace, rigCamera) {const target = this.getTarget();target.subtractToRef(this.position, TargetCamera._TargetFocalPoint), TargetCamera._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);const newFocalTarget = TargetCamera._TargetFocalPoint.addInPlace(this.position);_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.TranslationToRef */ .y3.TranslationToRef(-newFocalTarget.x, -newFocalTarget.y, -newFocalTarget.z, TargetCamera._TargetTransformMatrix), TargetCamera._TargetTransformMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.RotationAxis */ .y3.RotationAxis(rigCamera.upVector, halfSpace), TargetCamera._RigCamTransformMatrix), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.TranslationToRef */ .y3.TranslationToRef(newFocalTarget.x, newFocalTarget.y, newFocalTarget.z, TargetCamera._TargetTransformMatrix), TargetCamera._RigCamTransformMatrix.multiplyToRef(TargetCamera._TargetTransformMatrix, TargetCamera._RigCamTransformMatrix), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(this.position, TargetCamera._RigCamTransformMatrix, rigCamera.position), rigCamera.setTarget(newFocalTarget);}getClassName() {return "TargetCamera";}}TargetCamera._RigCamTransformMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .y3(), TargetCamera._TargetTransformMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .y3(), TargetCamera._TargetFocalPoint = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)()], TargetCamera.prototype, "rotation", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], TargetCamera.prototype, "speed", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsMeshReference */ .RR)("lockedTargetId")], TargetCamera.prototype, "lockedTarget", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Collisions/intersectionInfo.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "c": () => (/* binding */ IntersectionInfo)
/* harmony export */ });
class IntersectionInfo {constructor(bu, bv, distance) {this.bu = bu, this.bv = bv, this.distance = distance, this.faceId = 0, this.subMeshId = 0;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Collisions/meshCollisionData.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "a": () => (/* binding */ _MeshCollisionData)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
class _MeshCollisionData {constructor() {this._checkCollisions = !1, this._collisionMask = -1, this._collisionGroup = -1, this._surroundingMeshes = null, this._collider = null, this._oldPositionForCollisions = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 0, 0), this._diffPositionForCollisions = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 0, 0), this._collisionResponse = !0;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Collisions/pickingInfo.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "p": () => (/* binding */ PickingInfo)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
class PickingInfo {constructor() {this.hit = !1, this.distance = 0, this.pickedPoint = null, this.pickedMesh = null, this.bu = 0, this.bv = 0, this.faceId = -1, this.subMeshFaceId = -1, this.subMeshId = 0, this.pickedSprite = null, this.thinInstanceIndex = -1, this.ray = null, this.originMesh = null, this.aimTransform = null, this.gripTransform = null;}getNormal(useWorldCoordinates = !1, useVerticesNormals = !0) {if (!this.pickedMesh || useVerticesNormals && !this.pickedMesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.NormalKind */ .o.NormalKind)) return null;const indices = this.pickedMesh.getIndices();if (!indices) return null;let result;if (useVerticesNormals) {const normals = this.pickedMesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.NormalKind */ .o.NormalKind);let normal0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(normals, 3 * indices[3 * this.faceId]),normal1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(normals, 3 * indices[3 * this.faceId + 1]),normal2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(normals, 3 * indices[3 * this.faceId + 2]);normal0 = normal0.scale(this.bu), normal1 = normal1.scale(this.bv), normal2 = normal2.scale(1 - this.bu - this.bv), result = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(normal0.x + normal1.x + normal2.x, normal0.y + normal1.y + normal2.y, normal0.z + normal1.z + normal2.z);} else {const positions = this.pickedMesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.PositionKind */ .o.PositionKind),vertex1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(positions, 3 * indices[3 * this.faceId]),vertex2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(positions, 3 * indices[3 * this.faceId + 1]),vertex3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(positions, 3 * indices[3 * this.faceId + 2]),p1p2 = vertex1.subtract(vertex2),p3p2 = vertex3.subtract(vertex2);result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Cross */ .P.Cross(p1p2, p3p2);}const transformNormalToWorld = (pickedMesh, n) => {let wm = pickedMesh.getWorldMatrix();pickedMesh.nonUniformScaling && (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Matrix[0].copyFrom */ .jp.Matrix[0].copyFrom(wm), wm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0], wm.setTranslationFromFloats(0, 0, 0), wm.invert(), wm.transposeToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1]), wm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(n, wm, n);};if (useWorldCoordinates && transformNormalToWorld(this.pickedMesh, result), this.ray) {const normalForDirectionChecking = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Vector3[0].copyFrom */ .jp.Vector3[0].copyFrom(result);useWorldCoordinates || transformNormalToWorld(this.pickedMesh, normalForDirectionChecking), 0 < _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Dot */ .P.Dot(normalForDirectionChecking, this.ray.direction) && result.negateInPlace();}return result.normalize(), result;}getTextureCoordinates() {if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.UVKind */ .o.UVKind)) return null;const indices = this.pickedMesh.getIndices();if (!indices) return null;const uvs = this.pickedMesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.UVKind */ .o.UVKind);if (!uvs) return null;let uv0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2.FromArray */ .FM.FromArray(uvs, 2 * indices[3 * this.faceId]),uv1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2.FromArray */ .FM.FromArray(uvs, 2 * indices[3 * this.faceId + 1]),uv2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2.FromArray */ .FM.FromArray(uvs, 2 * indices[3 * this.faceId + 2]);return uv0 = uv0.scale(this.bu), uv1 = uv1.scale(this.bv), uv2 = uv2.scale(1 - this.bu - this.bv), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .FM(uv0.x + uv1.x + uv2.x, uv0.y + uv1.y + uv2.y);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Compat/compatibilityOptions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "e": () => (/* binding */ CompatibilityOptions)
/* harmony export */ });
class CompatibilityOptions {}CompatibilityOptions.UseOpenGLOrientationForUV = !1;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Culling/boundingBox.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "k": () => (/* binding */ BoundingBox)
/* harmony export */ });
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/arrayTools.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.constants.js");
class BoundingBox {constructor(min, max, worldMatrix) {this.vectors = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .ArrayTools.BuildArray */ .B.BuildArray(8, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero), this.center = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.centerWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.extendSize = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.extendSizeWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.directions = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .ArrayTools.BuildArray */ .B.BuildArray(3, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero), this.vectorsWorld = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .ArrayTools.BuildArray */ .B.BuildArray(8, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero), this.minimumWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.maximumWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.minimum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.maximum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this._drawWrapperFront = null, this._drawWrapperBack = null, this.reConstruct(min, max, worldMatrix);}reConstruct(min, max, worldMatrix) {const minX = min.x,minY = min.y,minZ = min.z,maxX = max.x,maxY = max.y,maxZ = max.z,vectors = this.vectors;this.minimum.copyFromFloats(minX, minY, minZ), this.maximum.copyFromFloats(maxX, maxY, maxZ), vectors[0].copyFromFloats(minX, minY, minZ), vectors[1].copyFromFloats(maxX, maxY, maxZ), vectors[2].copyFromFloats(maxX, minY, minZ), vectors[3].copyFromFloats(minX, maxY, minZ), vectors[4].copyFromFloats(minX, minY, maxZ), vectors[5].copyFromFloats(maxX, maxY, minZ), vectors[6].copyFromFloats(minX, maxY, maxZ), vectors[7].copyFromFloats(maxX, minY, maxZ), max.addToRef(min, this.center).scaleInPlace(.5), max.subtractToRef(min, this.extendSize).scaleInPlace(.5), this._worldMatrix = worldMatrix || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.IdentityReadOnly */ .y3.IdentityReadOnly, this._update(this._worldMatrix);}scale(factor) {const tmpVectors = BoundingBox._TmpVector3,diff = this.maximum.subtractToRef(this.minimum, tmpVectors[0]),len = diff.length();diff.normalizeFromLength(len);const newRadius = diff.scaleInPlace(.5 * (len * factor)),min = this.center.subtractToRef(newRadius, tmpVectors[1]),max = this.center.addToRef(newRadius, tmpVectors[2]);return this.reConstruct(min, max, this._worldMatrix), this;}getWorldMatrix() {return this._worldMatrix;}_update(world) {const minWorld = this.minimumWorld,maxWorld = this.maximumWorld,directions = this.directions,vectorsWorld = this.vectorsWorld,vectors = this.vectors;if (!world.isIdentity()) {minWorld.setAll(Number.MAX_VALUE), maxWorld.setAll(-Number.MAX_VALUE);for (let index = 0; 8 > index; ++index) {const v = vectorsWorld[index];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(vectors[index], world, v), minWorld.minimizeInPlace(v), maxWorld.maximizeInPlace(v);}maxWorld.subtractToRef(minWorld, this.extendSizeWorld).scaleInPlace(.5), maxWorld.addToRef(minWorld, this.centerWorld).scaleInPlace(.5);} else {minWorld.copyFrom(this.minimum), maxWorld.copyFrom(this.maximum);for (let index = 0; 8 > index; ++index) vectorsWorld[index].copyFrom(vectors[index]);this.extendSizeWorld.copyFrom(this.extendSize), this.centerWorld.copyFrom(this.center);}_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(world.m, 0, directions[0]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(world.m, 4, directions[1]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(world.m, 8, directions[2]), this._worldMatrix = world;}isInFrustum(frustumPlanes) {return BoundingBox.IsInFrustum(this.vectorsWorld, frustumPlanes);}isCompletelyInFrustum(frustumPlanes) {return BoundingBox.IsCompletelyInFrustum(this.vectorsWorld, frustumPlanes);}intersectsPoint(point) {const min = this.minimumWorld,max = this.maximumWorld,minX = min.x,minY = min.y,minZ = min.z,maxX = max.x,maxY = max.y,maxZ = max.z,pointX = point.x,pointY = point.y,pointZ = point.z,delta = -_Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .kn;return !(maxX - pointX < delta || delta > pointX - minX) && !(maxY - pointY < delta || delta > pointY - minY) && !(maxZ - pointZ < delta || delta > pointZ - minZ);}intersectsSphere(sphere) {return BoundingBox.IntersectsSphere(this.minimumWorld, this.maximumWorld, sphere.centerWorld, sphere.radiusWorld);}intersectsMinMax(min, max) {const myMin = this.minimumWorld,myMax = this.maximumWorld,myMinX = myMin.x,myMinY = myMin.y,myMinZ = myMin.z,myMaxX = myMax.x,myMaxY = myMax.y,myMaxZ = myMax.z,minX = min.x,minY = min.y,minZ = min.z,maxX = max.x,maxY = max.y,maxZ = max.z;return !(myMaxX < minX || myMinX > maxX) && !(myMaxY < minY || myMinY > maxY) && !(myMaxZ < minZ || myMinZ > maxZ);}dispose() {var _a, _b;null === (_a = this._drawWrapperFront) || void 0 === _a ? void 0 : _a.dispose(), null === (_b = this._drawWrapperBack) || void 0 === _b ? void 0 : _b.dispose();}static Intersects(box0, box1) {return box0.intersectsMinMax(box1.minimumWorld, box1.maximumWorld);}static IntersectsSphere(minPoint, maxPoint, sphereCenter, sphereRadius) {const vector = BoundingBox._TmpVector3[0];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.ClampToRef */ .P.ClampToRef(sphereCenter, minPoint, maxPoint, vector);const num = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.DistanceSquared */ .P.DistanceSquared(sphereCenter, vector);return num <= sphereRadius * sphereRadius;}static IsCompletelyInFrustum(boundingVectors, frustumPlanes) {for (let p = 0; 6 > p; ++p) {const frustumPlane = frustumPlanes[p];for (let i = 0; 8 > i; ++i) if (0 > frustumPlane.dotCoordinate(boundingVectors[i])) return !1;}return !0;}static IsInFrustum(boundingVectors, frustumPlanes) {for (let canReturnFalse, p = 0; 6 > p; ++p) {canReturnFalse = !0;const frustumPlane = frustumPlanes[p];for (let i = 0; 8 > i; ++i) if (0 <= frustumPlane.dotCoordinate(boundingVectors[i])) {canReturnFalse = !1;break;}if (canReturnFalse) return !1;}return !0;}}BoundingBox._TmpVector3 = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .ArrayTools.BuildArray */ .B.BuildArray(3, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Culling/boundingInfo.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "j": () => (/* binding */ BoundingInfo)
/* harmony export */ });
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/arrayTools.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _boundingBox_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Culling/boundingBox.js");
/* harmony import */ var _boundingSphere_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Culling/boundingSphere.js");
const _result0 = { min: 0, max: 0 },_result1 = { min: 0, max: 0 },computeBoxExtents = (axis, box, result) => {const p = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Dot */ .P.Dot(box.centerWorld, axis),r0 = Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Dot */ .P.Dot(box.directions[0], axis)) * box.extendSize.x,r1 = Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Dot */ .P.Dot(box.directions[1], axis)) * box.extendSize.y,r2 = Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Dot */ .P.Dot(box.directions[2], axis)) * box.extendSize.z,r = r0 + r1 + r2;result.min = p - r, result.max = p + r;},axisOverlap = (axis, box0, box1) => (computeBoxExtents(axis, box0, _result0), computeBoxExtents(axis, box1, _result1), !(_result0.min > _result1.max || _result1.min > _result0.max));class BoundingInfo {constructor(minimum, maximum, worldMatrix) {this._isLocked = !1, this.boundingBox = new _boundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* .BoundingBox */ .k(minimum, maximum, worldMatrix), this.boundingSphere = new _boundingSphere_js__WEBPACK_IMPORTED_MODULE_3__/* .BoundingSphere */ .K(minimum, maximum, worldMatrix);}reConstruct(min, max, worldMatrix) {this.boundingBox.reConstruct(min, max, worldMatrix), this.boundingSphere.reConstruct(min, max, worldMatrix);}get minimum() {return this.boundingBox.minimum;}get maximum() {return this.boundingBox.maximum;}get isLocked() {return this._isLocked;}set isLocked(value) {this._isLocked = value;}update(world) {this._isLocked || (this.boundingBox._update(world), this.boundingSphere._update(world));}centerOn(center, extend) {const minimum = BoundingInfo._TmpVector3[0].copyFrom(center).subtractInPlace(extend),maximum = BoundingInfo._TmpVector3[1].copyFrom(center).addInPlace(extend);return this.boundingBox.reConstruct(minimum, maximum, this.boundingBox.getWorldMatrix()), this.boundingSphere.reConstruct(minimum, maximum, this.boundingBox.getWorldMatrix()), this;}encapsulate(point) {const minimum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Minimize */ .P.Minimize(this.minimum, point),maximum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Maximize */ .P.Maximize(this.maximum, point);return this.reConstruct(minimum, maximum, this.boundingBox.getWorldMatrix()), this;}encapsulateBoundingInfo(toEncapsulate) {return this.encapsulate(toEncapsulate.boundingBox.centerWorld.subtract(toEncapsulate.boundingBox.extendSizeWorld)), this.encapsulate(toEncapsulate.boundingBox.centerWorld.add(toEncapsulate.boundingBox.extendSizeWorld)), this;}scale(factor) {return this.boundingBox.scale(factor), this.boundingSphere.scale(factor), this;}isInFrustum(frustumPlanes, strategy = 0) {if ((2 === strategy || 3 === strategy) && this.boundingSphere.isCenterInFrustum(frustumPlanes)) return !0;if (!this.boundingSphere.isInFrustum(frustumPlanes)) return !1;return !!(1 === strategy || 3 === strategy) || this.boundingBox.isInFrustum(frustumPlanes);}get diagonalLength() {const boundingBox = this.boundingBox,diag = boundingBox.maximumWorld.subtractToRef(boundingBox.minimumWorld, BoundingInfo._TmpVector3[0]);return diag.length();}isCompletelyInFrustum(frustumPlanes) {return this.boundingBox.isCompletelyInFrustum(frustumPlanes);}_checkCollision(collider) {return collider._canDoCollision(this.boundingSphere.centerWorld, this.boundingSphere.radiusWorld, this.boundingBox.minimumWorld, this.boundingBox.maximumWorld);}intersectsPoint(point) {return !!this.boundingSphere.centerWorld && !!this.boundingSphere.intersectsPoint(point) && !!this.boundingBox.intersectsPoint(point);}intersects(boundingInfo, precise) {if (!_boundingSphere_js__WEBPACK_IMPORTED_MODULE_3__/* .BoundingSphere.Intersects */ .K.Intersects(this.boundingSphere, boundingInfo.boundingSphere)) return !1;if (!_boundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* .BoundingBox.Intersects */ .k.Intersects(this.boundingBox, boundingInfo.boundingBox)) return !1;if (!precise) return !0;const box0 = this.boundingBox,box1 = boundingInfo.boundingBox;return !!axisOverlap(box0.directions[0], box0, box1) && !!axisOverlap(box0.directions[1], box0, box1) && !!axisOverlap(box0.directions[2], box0, box1) && !!axisOverlap(box1.directions[0], box0, box1) && !!axisOverlap(box1.directions[1], box0, box1) && !!axisOverlap(box1.directions[2], box0, box1) && !!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(box0.directions[0], box1.directions[0]), box0, box1) && !!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(box0.directions[0], box1.directions[1]), box0, box1) && !!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(box0.directions[0], box1.directions[2]), box0, box1) && !!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(box0.directions[1], box1.directions[0]), box0, box1) && !!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(box0.directions[1], box1.directions[1]), box0, box1) && !!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(box0.directions[1], box1.directions[2]), box0, box1) && !!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(box0.directions[2], box1.directions[0]), box0, box1) && !!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(box0.directions[2], box1.directions[1]), box0, box1) && !!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(box0.directions[2], box1.directions[2]), box0, box1);}}BoundingInfo._TmpVector3 = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .ArrayTools.BuildArray */ .B.BuildArray(2, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Culling/boundingSphere.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "K": () => (/* binding */ BoundingSphere)
/* harmony export */ });
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/arrayTools.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
class BoundingSphere {constructor(min, max, worldMatrix) {this.center = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.centerWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.minimum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.maximum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), this.reConstruct(min, max, worldMatrix);}reConstruct(min, max, worldMatrix) {this.minimum.copyFrom(min), this.maximum.copyFrom(max);const distance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Distance */ .P.Distance(min, max);max.addToRef(min, this.center).scaleInPlace(.5), this.radius = .5 * distance, this._update(worldMatrix || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.IdentityReadOnly */ .y3.IdentityReadOnly);}scale(factor) {const newRadius = this.radius * factor,tmpVectors = BoundingSphere._TmpVector3,tempRadiusVector = tmpVectors[0].setAll(newRadius),min = this.center.subtractToRef(tempRadiusVector, tmpVectors[1]),max = this.center.addToRef(tempRadiusVector, tmpVectors[2]);return this.reConstruct(min, max, this._worldMatrix), this;}getWorldMatrix() {return this._worldMatrix;}_update(worldMatrix) {if (!worldMatrix.isIdentity()) {_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(this.center, worldMatrix, this.centerWorld);const tempVector = BoundingSphere._TmpVector3[0];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.TransformNormalFromFloatsToRef */ .P.TransformNormalFromFloatsToRef(1, 1, 1, worldMatrix, tempVector), this.radiusWorld = Math.max(Math.abs(tempVector.x), Math.abs(tempVector.y), Math.abs(tempVector.z)) * this.radius;} else this.centerWorld.copyFrom(this.center), this.radiusWorld = this.radius;}isInFrustum(frustumPlanes) {const center = this.centerWorld,radius = this.radiusWorld;for (let i = 0; 6 > i; i++) if (frustumPlanes[i].dotCoordinate(center) <= -radius) return !1;return !0;}isCenterInFrustum(frustumPlanes) {const center = this.centerWorld;for (let i = 0; 6 > i; i++) if (0 > frustumPlanes[i].dotCoordinate(center)) return !1;return !0;}intersectsPoint(point) {const squareDistance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.DistanceSquared */ .P.DistanceSquared(this.centerWorld, point);return !(this.radiusWorld * this.radiusWorld < squareDistance);}static Intersects(sphere0, sphere1) {const squareDistance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.DistanceSquared */ .P.DistanceSquared(sphere0.centerWorld, sphere1.centerWorld),radiusSum = sphere0.radiusWorld + sphere1.radiusWorld;return !(radiusSum * radiusSum < squareDistance);}static CreateFromCenterAndRadius(center, radius, matrix) {this._TmpVector3[0].copyFrom(center), this._TmpVector3[1].copyFromFloats(0, 0, radius), this._TmpVector3[2].copyFrom(center), this._TmpVector3[0].addInPlace(this._TmpVector3[1]), this._TmpVector3[2].subtractInPlace(this._TmpVector3[1]);const sphere = new BoundingSphere(this._TmpVector3[0], this._TmpVector3[2]);return sphere._worldMatrix = matrix ? matrix : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.Identity */ .y3.Identity(), sphere;}}BoundingSphere._TmpVector3 = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .ArrayTools.BuildArray */ .B.BuildArray(3, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero);

/***/ }),

/***/ "./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$i": () => (/* binding */ XboxInput),
/* harmony export */   "D_": () => (/* binding */ SwitchInput),
/* harmony export */   "FP": () => (/* binding */ NativePointerInput),
/* harmony export */   "Fz": () => (/* binding */ PointerInput),
/* harmony export */   "V7": () => (/* binding */ DualShockInput),
/* harmony export */   "Yi": () => (/* binding */ DeviceType),
/* harmony export */   "s2": () => (/* binding */ DualSenseInput)
/* harmony export */ });
var DeviceType;(function (DeviceType) {DeviceType[DeviceType.Generic = 0] = "Generic", DeviceType[DeviceType.Keyboard = 1] = "Keyboard", DeviceType[DeviceType.Mouse = 2] = "Mouse", DeviceType[DeviceType.Touch = 3] = "Touch", DeviceType[DeviceType.DualShock = 4] = "DualShock", DeviceType[DeviceType.Xbox = 5] = "Xbox", DeviceType[DeviceType.Switch = 6] = "Switch", DeviceType[DeviceType.DualSense = 7] = "DualSense";})(DeviceType || (DeviceType = {}));var PointerInput;(function (PointerInput) {PointerInput[PointerInput.Horizontal = 0] = "Horizontal", PointerInput[PointerInput.Vertical = 1] = "Vertical", PointerInput[PointerInput.LeftClick = 2] = "LeftClick", PointerInput[PointerInput.MiddleClick = 3] = "MiddleClick", PointerInput[PointerInput.RightClick = 4] = "RightClick", PointerInput[PointerInput.BrowserBack = 5] = "BrowserBack", PointerInput[PointerInput.BrowserForward = 6] = "BrowserForward", PointerInput[PointerInput.MouseWheelX = 7] = "MouseWheelX", PointerInput[PointerInput.MouseWheelY = 8] = "MouseWheelY", PointerInput[PointerInput.MouseWheelZ = 9] = "MouseWheelZ", PointerInput[PointerInput.Move = 12] = "Move";})(PointerInput || (PointerInput = {}));var NativePointerInput;(function (NativePointerInput) {NativePointerInput[NativePointerInput.Horizontal = 0] = "Horizontal", NativePointerInput[NativePointerInput.Vertical = 1] = "Vertical", NativePointerInput[NativePointerInput.LeftClick = 2] = "LeftClick", NativePointerInput[NativePointerInput.MiddleClick = 3] = "MiddleClick", NativePointerInput[NativePointerInput.RightClick = 4] = "RightClick", NativePointerInput[NativePointerInput.BrowserBack = 5] = "BrowserBack", NativePointerInput[NativePointerInput.BrowserForward = 6] = "BrowserForward", NativePointerInput[NativePointerInput.MouseWheelX = 7] = "MouseWheelX", NativePointerInput[NativePointerInput.MouseWheelY = 8] = "MouseWheelY", NativePointerInput[NativePointerInput.MouseWheelZ = 9] = "MouseWheelZ", NativePointerInput[NativePointerInput.DeltaHorizontal = 10] = "DeltaHorizontal", NativePointerInput[NativePointerInput.DeltaVertical = 11] = "DeltaVertical";})(NativePointerInput || (NativePointerInput = {}));var DualShockInput;(function (DualShockInput) {DualShockInput[DualShockInput.Cross = 0] = "Cross", DualShockInput[DualShockInput.Circle = 1] = "Circle", DualShockInput[DualShockInput.Square = 2] = "Square", DualShockInput[DualShockInput.Triangle = 3] = "Triangle", DualShockInput[DualShockInput.L1 = 4] = "L1", DualShockInput[DualShockInput.R1 = 5] = "R1", DualShockInput[DualShockInput.L2 = 6] = "L2", DualShockInput[DualShockInput.R2 = 7] = "R2", DualShockInput[DualShockInput.Share = 8] = "Share", DualShockInput[DualShockInput.Options = 9] = "Options", DualShockInput[DualShockInput.L3 = 10] = "L3", DualShockInput[DualShockInput.R3 = 11] = "R3", DualShockInput[DualShockInput.DPadUp = 12] = "DPadUp", DualShockInput[DualShockInput.DPadDown = 13] = "DPadDown", DualShockInput[DualShockInput.DPadLeft = 14] = "DPadLeft", DualShockInput[DualShockInput.DPadRight = 15] = "DPadRight", DualShockInput[DualShockInput.Home = 16] = "Home", DualShockInput[DualShockInput.TouchPad = 17] = "TouchPad", DualShockInput[DualShockInput.LStickXAxis = 18] = "LStickXAxis", DualShockInput[DualShockInput.LStickYAxis = 19] = "LStickYAxis", DualShockInput[DualShockInput.RStickXAxis = 20] = "RStickXAxis", DualShockInput[DualShockInput.RStickYAxis = 21] = "RStickYAxis";})(DualShockInput || (DualShockInput = {}));var DualSenseInput;(function (DualSenseInput) {DualSenseInput[DualSenseInput.Cross = 0] = "Cross", DualSenseInput[DualSenseInput.Circle = 1] = "Circle", DualSenseInput[DualSenseInput.Square = 2] = "Square", DualSenseInput[DualSenseInput.Triangle = 3] = "Triangle", DualSenseInput[DualSenseInput.L1 = 4] = "L1", DualSenseInput[DualSenseInput.R1 = 5] = "R1", DualSenseInput[DualSenseInput.L2 = 6] = "L2", DualSenseInput[DualSenseInput.R2 = 7] = "R2", DualSenseInput[DualSenseInput.Create = 8] = "Create", DualSenseInput[DualSenseInput.Options = 9] = "Options", DualSenseInput[DualSenseInput.L3 = 10] = "L3", DualSenseInput[DualSenseInput.R3 = 11] = "R3", DualSenseInput[DualSenseInput.DPadUp = 12] = "DPadUp", DualSenseInput[DualSenseInput.DPadDown = 13] = "DPadDown", DualSenseInput[DualSenseInput.DPadLeft = 14] = "DPadLeft", DualSenseInput[DualSenseInput.DPadRight = 15] = "DPadRight", DualSenseInput[DualSenseInput.Home = 16] = "Home", DualSenseInput[DualSenseInput.TouchPad = 17] = "TouchPad", DualSenseInput[DualSenseInput.LStickXAxis = 18] = "LStickXAxis", DualSenseInput[DualSenseInput.LStickYAxis = 19] = "LStickYAxis", DualSenseInput[DualSenseInput.RStickXAxis = 20] = "RStickXAxis", DualSenseInput[DualSenseInput.RStickYAxis = 21] = "RStickYAxis";})(DualSenseInput || (DualSenseInput = {}));var XboxInput;(function (XboxInput) {XboxInput[XboxInput.A = 0] = "A", XboxInput[XboxInput.B = 1] = "B", XboxInput[XboxInput.X = 2] = "X", XboxInput[XboxInput.Y = 3] = "Y", XboxInput[XboxInput.LB = 4] = "LB", XboxInput[XboxInput.RB = 5] = "RB", XboxInput[XboxInput.LT = 6] = "LT", XboxInput[XboxInput.RT = 7] = "RT", XboxInput[XboxInput.Back = 8] = "Back", XboxInput[XboxInput.Start = 9] = "Start", XboxInput[XboxInput.LS = 10] = "LS", XboxInput[XboxInput.RS = 11] = "RS", XboxInput[XboxInput.DPadUp = 12] = "DPadUp", XboxInput[XboxInput.DPadDown = 13] = "DPadDown", XboxInput[XboxInput.DPadLeft = 14] = "DPadLeft", XboxInput[XboxInput.DPadRight = 15] = "DPadRight", XboxInput[XboxInput.Home = 16] = "Home", XboxInput[XboxInput.LStickXAxis = 17] = "LStickXAxis", XboxInput[XboxInput.LStickYAxis = 18] = "LStickYAxis", XboxInput[XboxInput.RStickXAxis = 19] = "RStickXAxis", XboxInput[XboxInput.RStickYAxis = 20] = "RStickYAxis";})(XboxInput || (XboxInput = {}));var SwitchInput;(function (SwitchInput) {SwitchInput[SwitchInput.B = 0] = "B", SwitchInput[SwitchInput.A = 1] = "A", SwitchInput[SwitchInput.Y = 2] = "Y", SwitchInput[SwitchInput.X = 3] = "X", SwitchInput[SwitchInput.L = 4] = "L", SwitchInput[SwitchInput.R = 5] = "R", SwitchInput[SwitchInput.ZL = 6] = "ZL", SwitchInput[SwitchInput.ZR = 7] = "ZR", SwitchInput[SwitchInput.Minus = 8] = "Minus", SwitchInput[SwitchInput.Plus = 9] = "Plus", SwitchInput[SwitchInput.LS = 10] = "LS", SwitchInput[SwitchInput.RS = 11] = "RS", SwitchInput[SwitchInput.DPadUp = 12] = "DPadUp", SwitchInput[SwitchInput.DPadDown = 13] = "DPadDown", SwitchInput[SwitchInput.DPadLeft = 14] = "DPadLeft", SwitchInput[SwitchInput.DPadRight = 15] = "DPadRight", SwitchInput[SwitchInput.Home = 16] = "Home", SwitchInput[SwitchInput.Capture = 17] = "Capture", SwitchInput[SwitchInput.LStickXAxis = 18] = "LStickXAxis", SwitchInput[SwitchInput.LStickYAxis = 19] = "LStickYAxis", SwitchInput[SwitchInput.RStickXAxis = 20] = "RStickXAxis", SwitchInput[SwitchInput.RStickYAxis = 21] = "RStickYAxis";})(SwitchInput || (SwitchInput = {}));

/***/ }),

/***/ "./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "p": () => (/* binding */ DeviceSource)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
class DeviceSource {constructor(deviceInputSystem, deviceType, deviceSlot = 0) {this.deviceType = deviceType, this.deviceSlot = deviceSlot, this.onInputChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this._deviceInputSystem = deviceInputSystem;}getInput(inputIndex) {return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, inputIndex);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "U": () => (/* binding */ DeviceSourceManager)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js
var deviceEnums = __webpack_require__("./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/deviceInputEvents.js
var deviceInputEvents = __webpack_require__("./node_modules/@babylonjs/core/Events/deviceInputEvents.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/DeviceInput/eventFactory.js
class DeviceEventFactory {static CreateDeviceEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo, pointerId) {switch (deviceType) {case deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard:return this._CreateKeyboardEvent(inputIndex, currentState, deviceInputSystem, elementToAttachTo);case deviceEnums/* DeviceType.Mouse */.Yi.Mouse:if (inputIndex === deviceEnums/* PointerInput.MouseWheelX */.Fz.MouseWheelX || inputIndex === deviceEnums/* PointerInput.MouseWheelY */.Fz.MouseWheelY || inputIndex === deviceEnums/* PointerInput.MouseWheelZ */.Fz.MouseWheelZ) return this._CreateWheelEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);case deviceEnums/* DeviceType.Touch */.Yi.Touch:return this._CreatePointerEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo, pointerId);default:throw `Unable to generate event for device ${deviceEnums/* DeviceType */.Yi[deviceType]}`;}}static _CreatePointerEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo, pointerId) {const evt = this._CreateMouseEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);return deviceType === deviceEnums/* DeviceType.Mouse */.Yi.Mouse ? (evt.deviceType = deviceEnums/* DeviceType.Mouse */.Yi.Mouse, evt.pointerId = 1, evt.pointerType = "mouse") : (evt.deviceType = deviceEnums/* DeviceType.Touch */.Yi.Touch, evt.pointerId = null !== pointerId && void 0 !== pointerId ? pointerId : deviceSlot, evt.pointerType = "touch"), inputIndex === deviceEnums/* PointerInput.Move */.Fz.Move ? evt.type = "pointermove" : inputIndex >= deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick && inputIndex <= deviceEnums/* PointerInput.RightClick */.Fz.RightClick && (evt.type = 1 === currentState ? "pointerdown" : "pointerup", evt.button = inputIndex - 2), evt;}static _CreateWheelEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo) {const evt = this._CreateMouseEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);return evt.type = "wheel", evt.deltaMode = deviceInputEvents/* EventConstants.DOM_DELTA_PIXEL */.G.DOM_DELTA_PIXEL, evt.deltaX = 0, evt.deltaY = 0, evt.deltaZ = 0, (inputIndex === deviceEnums/* PointerInput.MouseWheelX */.Fz.MouseWheelX ? evt.deltaX = currentState : inputIndex === deviceEnums/* PointerInput.MouseWheelY */.Fz.MouseWheelY ? evt.deltaY = currentState : inputIndex === deviceEnums/* PointerInput.MouseWheelZ */.Fz.MouseWheelZ ? evt.deltaZ = currentState : void 0, evt);}static _CreateMouseEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo) {const evt = this._CreateEvent(elementToAttachTo),pointerX = deviceInputSystem.pollInput(deviceType, deviceSlot, deviceEnums/* PointerInput.Horizontal */.Fz.Horizontal),pointerY = deviceInputSystem.pollInput(deviceType, deviceSlot, deviceEnums/* PointerInput.Vertical */.Fz.Vertical);return elementToAttachTo ? (evt.movementX = 0, evt.movementY = 0, evt.offsetX = evt.movementX - elementToAttachTo.getBoundingClientRect().x, evt.offsetY = evt.movementY - elementToAttachTo.getBoundingClientRect().y) : (evt.movementX = deviceInputSystem.pollInput(deviceType, deviceSlot, deviceEnums/* NativePointerInput.DeltaHorizontal */.FP.DeltaHorizontal), evt.movementY = deviceInputSystem.pollInput(deviceType, deviceSlot, deviceEnums/* NativePointerInput.DeltaVertical */.FP.DeltaVertical), evt.offsetX = 0, evt.offsetY = 0), this._CheckNonCharacterKeys(evt, deviceInputSystem), evt.clientX = pointerX, evt.clientY = pointerY, evt.x = pointerX, evt.y = pointerY, evt.deviceType = deviceType, evt.deviceSlot = deviceSlot, evt.inputIndex = inputIndex, evt;}static _CreateKeyboardEvent(inputIndex, currentState, deviceInputSystem, elementToAttachTo) {const evt = this._CreateEvent(elementToAttachTo);return this._CheckNonCharacterKeys(evt, deviceInputSystem), evt.deviceType = deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, evt.deviceSlot = 0, evt.inputIndex = inputIndex, evt.type = 1 === currentState ? "keydown" : "keyup", evt.key = String.fromCharCode(inputIndex), evt.keyCode = inputIndex, evt;}static _CheckNonCharacterKeys(evt, deviceInputSystem) {const isKeyboardActive = deviceInputSystem.isDeviceAvailable(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard),altKey = isKeyboardActive && 1 === deviceInputSystem.pollInput(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, 18),ctrlKey = isKeyboardActive && 1 === deviceInputSystem.pollInput(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, 17),metaKey = isKeyboardActive && (1 === deviceInputSystem.pollInput(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, 91) || 1 === deviceInputSystem.pollInput(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, 92) || 1 === deviceInputSystem.pollInput(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, 93)),shiftKey = isKeyboardActive && 1 === deviceInputSystem.pollInput(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, 16);evt.altKey = altKey, evt.ctrlKey = ctrlKey, evt.metaKey = metaKey, evt.shiftKey = shiftKey;}static _CreateEvent(elementToAttachTo) {return { preventDefault: () => {}, target: elementToAttachTo };}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/DeviceInput/nativeDeviceInputSystem.js
class NativeDeviceInputSystem {constructor(onDeviceConnected, onDeviceDisconnected, onInputChanged) {this._nativeInput = _native.DeviceInputSystem ? new _native.DeviceInputSystem(onDeviceConnected, onDeviceDisconnected, (deviceType, deviceSlot, inputIndex, currentState) => {const evt = DeviceEventFactory.CreateDeviceEvent(deviceType, deviceSlot, inputIndex, currentState, this);onInputChanged(deviceType, deviceSlot, evt);}) : this._createDummyNativeInput();}pollInput(deviceType, deviceSlot, inputIndex) {return this._nativeInput.pollInput(deviceType, deviceSlot, inputIndex);}isDeviceAvailable(deviceType) {return deviceType === deviceEnums/* DeviceType.Mouse */.Yi.Mouse || deviceType === deviceEnums/* DeviceType.Touch */.Yi.Touch;}dispose() {this._nativeInput.dispose();}_createDummyNativeInput() {return { pollInput: () => 0, isDeviceAvailable: () => !1, dispose: () => {} };}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/domManagement.js
var domManagement = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/DeviceInput/webDeviceInputSystem.js
const MAX_KEYCODES = 255,MAX_POINTER_INPUTS = Object.keys(deviceEnums/* PointerInput */.Fz).length / 2;class WebDeviceInputSystem {constructor(engine, onDeviceConnected, onDeviceDisconnected, onInputChanged) {this._inputs = [], this._keyboardActive = !1, this._pointerActive = !1, this._usingSafari = tools/* Tools.IsSafari */.w1.IsSafari(), this._usingMacOS = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform), this._keyboardDownEvent = () => {}, this._keyboardUpEvent = () => {}, this._keyboardBlurEvent = () => {}, this._pointerMoveEvent = () => {}, this._pointerDownEvent = () => {}, this._pointerUpEvent = () => {}, this._pointerCancelEvent = () => {}, this._pointerWheelEvent = () => {}, this._pointerBlurEvent = () => {}, this._eventsAttached = !1, this._mouseId = -1, this._isUsingFirefox = domManagement/* DomManagement.IsNavigatorAvailable */.MZ.IsNavigatorAvailable() && navigator.userAgent && -1 !== navigator.userAgent.indexOf("Firefox"), this._maxTouchPoints = 0, this._pointerInputClearObserver = null, this._gamepadConnectedEvent = () => {}, this._gamepadDisconnectedEvent = () => {}, this._eventPrefix = tools/* Tools.GetPointerPrefix */.w1.GetPointerPrefix(engine), this._engine = engine, this._onDeviceConnected = onDeviceConnected, this._onDeviceDisconnected = onDeviceDisconnected, this._onInputChanged = onInputChanged, this._enableEvents(), this._usingMacOS && (this._metaKeys = []), this._engine._onEngineViewChanged || (this._engine._onEngineViewChanged = () => {this._enableEvents();});}pollInput(deviceType, deviceSlot, inputIndex) {const device = this._inputs[deviceType][deviceSlot];if (!device) throw `Unable to find device ${deviceEnums/* DeviceType */.Yi[deviceType]}`;deviceType >= deviceEnums/* DeviceType.DualShock */.Yi.DualShock && deviceType <= deviceEnums/* DeviceType.DualSense */.Yi.DualSense && this._updateDevice(deviceType, deviceSlot, inputIndex);const currentValue = device[inputIndex];if (void 0 === currentValue) throw `Unable to find input ${inputIndex} for device ${deviceEnums/* DeviceType */.Yi[deviceType]} in slot ${deviceSlot}`;return inputIndex === deviceEnums/* PointerInput.Move */.Fz.Move && tools/* Tools.Warn */.w1.Warn(`Unable to provide information for PointerInput.Move.  Try using PointerInput.Horizontal or PointerInput.Vertical for move data.`), currentValue;}isDeviceAvailable(deviceType) {return this._inputs[deviceType] !== void 0;}dispose() {this._onDeviceConnected = () => {}, this._onDeviceDisconnected = () => {}, this._onInputChanged = () => {}, delete this._engine._onEngineViewChanged, this._elementToAttachTo && this._disableEvents();}_enableEvents() {const inputElement = null === this || void 0 === this ? void 0 : this._engine.getInputElement();if (inputElement && (!this._eventsAttached || this._elementToAttachTo !== inputElement)) {if (this._disableEvents(), this._inputs) for (const inputs of this._inputs) if (inputs) for (const deviceSlotKey in inputs) {const device = inputs[+deviceSlotKey];if (device) for (let inputIndex = 0; inputIndex < device.length; inputIndex++) device[inputIndex] = 0;}this._elementToAttachTo = inputElement, this._elementToAttachTo.tabIndex = -1 === this._elementToAttachTo.tabIndex ? this._engine.canvasTabIndex : this._elementToAttachTo.tabIndex, this._handleKeyActions(), this._handlePointerActions(), this._handleGamepadActions(), this._eventsAttached = !0, this._checkForConnectedDevices();}}_disableEvents() {this._elementToAttachTo && (this._elementToAttachTo.removeEventListener("blur", this._keyboardBlurEvent), this._elementToAttachTo.removeEventListener("blur", this._pointerBlurEvent), this._elementToAttachTo.removeEventListener("keydown", this._keyboardDownEvent), this._elementToAttachTo.removeEventListener("keyup", this._keyboardUpEvent), this._elementToAttachTo.removeEventListener(this._eventPrefix + "move", this._pointerMoveEvent), this._elementToAttachTo.removeEventListener(this._eventPrefix + "down", this._pointerDownEvent), this._elementToAttachTo.removeEventListener(this._eventPrefix + "up", this._pointerUpEvent), this._elementToAttachTo.removeEventListener(this._eventPrefix + "cancel", this._pointerCancelEvent), this._elementToAttachTo.removeEventListener(this._wheelEventName, this._pointerWheelEvent), window.removeEventListener("gamepadconnected", this._gamepadConnectedEvent), window.removeEventListener("gamepaddisconnected", this._gamepadDisconnectedEvent)), this._pointerInputClearObserver && this._engine.onEndFrameObservable.remove(this._pointerInputClearObserver), this._eventsAttached = !1;}_checkForConnectedDevices() {if (navigator.getGamepads) {const gamepads = navigator.getGamepads();for (const gamepad of gamepads) gamepad && this._addGamePad(gamepad);}"function" == typeof matchMedia && matchMedia("(pointer:fine)").matches && this._addPointerDevice(deviceEnums/* DeviceType.Mouse */.Yi.Mouse, 0, 0, 0);}_addGamePad(gamepad) {const deviceType = this._getGamepadDeviceType(gamepad.id),deviceSlot = gamepad.index;this._gamepads = this._gamepads || Array(gamepad.index + 1), this._registerDevice(deviceType, deviceSlot, gamepad.buttons.length + gamepad.axes.length), this._gamepads[deviceSlot] = deviceType;}_addPointerDevice(deviceType, deviceSlot, currentX, currentY) {this._pointerActive || (this._pointerActive = !0), this._registerDevice(deviceType, deviceSlot, MAX_POINTER_INPUTS);const pointer = this._inputs[deviceType][deviceSlot];pointer[0] = currentX, pointer[1] = currentY;}_registerDevice(deviceType, deviceSlot, numberOfInputs) {if (void 0 === deviceSlot) throw `Unable to register device ${deviceEnums/* DeviceType */.Yi[deviceType]} to undefined slot.`;if (this._inputs[deviceType] || (this._inputs[deviceType] = {}), !this._inputs[deviceType][deviceSlot]) {const device = Array(numberOfInputs);device.fill(0), this._inputs[deviceType][deviceSlot] = device, this._onDeviceConnected(deviceType, deviceSlot);}}_unregisterDevice(deviceType, deviceSlot) {this._inputs[deviceType][deviceSlot] && (delete this._inputs[deviceType][deviceSlot], this._onDeviceDisconnected(deviceType, deviceSlot));}_handleKeyActions() {this._keyboardDownEvent = (evt) => {this._keyboardActive || (this._keyboardActive = !0, this._registerDevice(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, MAX_KEYCODES));const kbKey = this._inputs[deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard][0];if (kbKey) {kbKey[evt.keyCode] = 1;const deviceEvent = evt;deviceEvent.inputIndex = evt.keyCode, this._usingMacOS && evt.metaKey && "Meta" !== evt.key && !this._metaKeys.includes(evt.keyCode) && this._metaKeys.push(evt.keyCode), this._onInputChanged(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, deviceEvent);}}, this._keyboardUpEvent = (evt) => {this._keyboardActive || (this._keyboardActive = !0, this._registerDevice(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, MAX_KEYCODES));const kbKey = this._inputs[deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard][0];if (kbKey) {kbKey[evt.keyCode] = 0;const deviceEvent = evt;if (deviceEvent.inputIndex = evt.keyCode, this._usingMacOS && "Meta" === evt.key && 0 < this._metaKeys.length) {for (const keyCode of this._metaKeys) {const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, keyCode, 0, this, this._elementToAttachTo);kbKey[keyCode] = 0, this._onInputChanged(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, deviceEvent);}this._metaKeys.splice(0, this._metaKeys.length);}this._onInputChanged(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, deviceEvent);}}, this._keyboardBlurEvent = () => {if (this._keyboardActive) {const kbKey = this._inputs[deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard][0];for (let i = 0; i < kbKey.length; i++) if (0 !== kbKey[i]) {kbKey[i] = 0;const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, i, 0, this, this._elementToAttachTo);this._onInputChanged(deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard, 0, deviceEvent);}this._usingMacOS && this._metaKeys.splice(0, this._metaKeys.length);}}, this._elementToAttachTo.addEventListener("keydown", this._keyboardDownEvent), this._elementToAttachTo.addEventListener("keyup", this._keyboardUpEvent), this._elementToAttachTo.addEventListener("blur", this._keyboardBlurEvent);}_handlePointerActions() {this._maxTouchPoints = domManagement/* DomManagement.IsNavigatorAvailable */.MZ.IsNavigatorAvailable() && navigator.maxTouchPoints || 2, this._activeTouchIds || (this._activeTouchIds = Array(this._maxTouchPoints));for (let i = 0; i < this._maxTouchPoints; i++) this._activeTouchIds[i] = -1;this._pointerMoveEvent = (evt) => {const deviceType = this._getPointerType(evt),deviceSlot = deviceType === deviceEnums/* DeviceType.Mouse */.Yi.Mouse ? 0 : this._activeTouchIds.indexOf(evt.pointerId);this._inputs[deviceType] || (this._inputs[deviceType] = {}), this._inputs[deviceType][deviceSlot] || this._addPointerDevice(deviceType, deviceSlot, evt.clientX, evt.clientY);const pointer = this._inputs[deviceType][deviceSlot];if (pointer) {const deviceEvent = evt;deviceEvent.inputIndex = deviceEnums/* PointerInput.Move */.Fz.Move, pointer[deviceEnums/* PointerInput.Horizontal */.Fz.Horizontal] = evt.clientX, pointer[deviceEnums/* PointerInput.Vertical */.Fz.Vertical] = evt.clientY, this._onInputChanged(deviceType, deviceSlot, deviceEvent), this._usingSafari || -1 === evt.button || (deviceEvent.inputIndex = evt.button + 2, pointer[evt.button + 2] = pointer[evt.button + 2] ? 0 : 1, this._onInputChanged(deviceType, deviceSlot, deviceEvent));}}, this._pointerDownEvent = (evt) => {const deviceType = this._getPointerType(evt);let deviceSlot = deviceType === deviceEnums/* DeviceType.Mouse */.Yi.Mouse ? 0 : evt.pointerId;if (deviceType === deviceEnums/* DeviceType.Touch */.Yi.Touch) {const idx = this._activeTouchIds.indexOf(-1);if (0 <= idx) deviceSlot = idx, this._activeTouchIds[idx] = evt.pointerId;else return void tools/* Tools.Warn */.w1.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);}this._inputs[deviceType] || (this._inputs[deviceType] = {}), this._inputs[deviceType][deviceSlot] ? deviceType === deviceEnums/* DeviceType.Touch */.Yi.Touch && this._onDeviceConnected(deviceType, deviceSlot) : this._addPointerDevice(deviceType, deviceSlot, evt.clientX, evt.clientY);const pointer = this._inputs[deviceType][deviceSlot];if (pointer) {const previousHorizontal = pointer[deviceEnums/* PointerInput.Horizontal */.Fz.Horizontal],previousVertical = pointer[deviceEnums/* PointerInput.Vertical */.Fz.Vertical];if (deviceType === deviceEnums/* DeviceType.Mouse */.Yi.Mouse) {if (-1 === this._mouseId && (void 0 === evt.pointerId ? this._mouseId = this._isUsingFirefox ? 0 : 1 : this._mouseId = evt.pointerId), !document.pointerLockElement) try {this._elementToAttachTo.setPointerCapture(this._mouseId);} catch (e) {}} else if (evt.pointerId && !document.pointerLockElement) try {this._elementToAttachTo.setPointerCapture(evt.pointerId);} catch (e) {}pointer[deviceEnums/* PointerInput.Horizontal */.Fz.Horizontal] = evt.clientX, pointer[deviceEnums/* PointerInput.Vertical */.Fz.Vertical] = evt.clientY, pointer[evt.button + 2] = 1;const deviceEvent = evt;deviceEvent.inputIndex = evt.button + 2, this._onInputChanged(deviceType, deviceSlot, deviceEvent), (previousHorizontal !== evt.clientX || previousVertical !== evt.clientY) && (deviceEvent.inputIndex = deviceEnums/* PointerInput.Move */.Fz.Move, this._onInputChanged(deviceType, deviceSlot, deviceEvent));}}, this._pointerUpEvent = (evt) => {var _a, _b, _c, _d, _e;const deviceType = this._getPointerType(evt),deviceSlot = deviceType === deviceEnums/* DeviceType.Mouse */.Yi.Mouse ? 0 : this._activeTouchIds.indexOf(evt.pointerId);if (deviceType === deviceEnums/* DeviceType.Touch */.Yi.Touch) {if (-1 === deviceSlot) return;this._activeTouchIds[deviceSlot] = -1;}const pointer = null === (_a = this._inputs[deviceType]) || void 0 === _a ? void 0 : _a[deviceSlot];if (pointer && 0 !== pointer[evt.button + 2]) {const previousHorizontal = pointer[deviceEnums/* PointerInput.Horizontal */.Fz.Horizontal],previousVertical = pointer[deviceEnums/* PointerInput.Vertical */.Fz.Vertical];pointer[deviceEnums/* PointerInput.Horizontal */.Fz.Horizontal] = evt.clientX, pointer[deviceEnums/* PointerInput.Vertical */.Fz.Vertical] = evt.clientY, pointer[evt.button + 2] = 0;const deviceEvent = evt;(previousHorizontal !== evt.clientX || previousVertical !== evt.clientY) && (deviceEvent.inputIndex = deviceEnums/* PointerInput.Move */.Fz.Move, this._onInputChanged(deviceType, deviceSlot, deviceEvent)), deviceEvent.inputIndex = evt.button + 2, deviceType === deviceEnums/* DeviceType.Mouse */.Yi.Mouse && 0 <= this._mouseId && (null === (_c = (_b = this._elementToAttachTo).hasPointerCapture) || void 0 === _c ? void 0 : _c.call(_b, this._mouseId)) ? this._elementToAttachTo.releasePointerCapture(this._mouseId) : evt.pointerId && (null === (_e = (_d = this._elementToAttachTo).hasPointerCapture) || void 0 === _e ? void 0 : _e.call(_d, evt.pointerId)) && this._elementToAttachTo.releasePointerCapture(evt.pointerId), this._onInputChanged(deviceType, deviceSlot, deviceEvent), deviceType === deviceEnums/* DeviceType.Touch */.Yi.Touch && this._onDeviceDisconnected(deviceType, deviceSlot);}}, this._pointerCancelEvent = (evt) => {var _a, _b, _c, _d;if ("mouse" === evt.pointerType) {const pointer = this._inputs[deviceEnums/* DeviceType.Mouse */.Yi.Mouse][0];0 <= this._mouseId && (null === (_b = (_a = this._elementToAttachTo).hasPointerCapture) || void 0 === _b ? void 0 : _b.call(_a, this._mouseId)) && this._elementToAttachTo.releasePointerCapture(this._mouseId);for (let inputIndex = deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick; inputIndex <= deviceEnums/* PointerInput.BrowserForward */.Fz.BrowserForward; inputIndex++) if (1 === pointer[inputIndex]) {pointer[inputIndex] = 0;const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType.Mouse */.Yi.Mouse, 0, inputIndex, 0, this, this._elementToAttachTo);this._onInputChanged(deviceEnums/* DeviceType.Mouse */.Yi.Mouse, 0, deviceEvent);}} else {const deviceSlot = this._activeTouchIds.indexOf(evt.pointerId);(null === (_d = (_c = this._elementToAttachTo).hasPointerCapture) || void 0 === _d ? void 0 : _d.call(_c, evt.pointerId)) && this._elementToAttachTo.releasePointerCapture(evt.pointerId), this._inputs[deviceEnums/* DeviceType.Touch */.Yi.Touch][deviceSlot][deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick] = 0;const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType.Touch */.Yi.Touch, deviceSlot, deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick, 0, this, this._elementToAttachTo, evt.pointerId);this._onInputChanged(deviceEnums/* DeviceType.Touch */.Yi.Touch, deviceSlot, deviceEvent), this._activeTouchIds[deviceSlot] = -1, this._onDeviceDisconnected(deviceEnums/* DeviceType.Touch */.Yi.Touch, deviceSlot);}}, this._wheelEventName = "onwheel" in document.createElement("div") ? "wheel" : document.onmousewheel === void 0 ? "DOMMouseScroll" : "mousewheel";let passiveSupported = !1;const noop = function () {};try {const options = Object.defineProperty({}, "passive", { get: function () {passiveSupported = !0;} });this._elementToAttachTo.addEventListener("test", noop, options), this._elementToAttachTo.removeEventListener("test", noop, options);} catch (e) {}this._pointerBlurEvent = () => {var _a, _b, _c, _d, _e;if (this.isDeviceAvailable(deviceEnums/* DeviceType.Mouse */.Yi.Mouse)) {const pointer = this._inputs[deviceEnums/* DeviceType.Mouse */.Yi.Mouse][0];0 <= this._mouseId && (null === (_b = (_a = this._elementToAttachTo).hasPointerCapture) || void 0 === _b ? void 0 : _b.call(_a, this._mouseId)) && this._elementToAttachTo.releasePointerCapture(this._mouseId);for (let inputIndex = deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick; inputIndex <= deviceEnums/* PointerInput.BrowserForward */.Fz.BrowserForward; inputIndex++) if (1 === pointer[inputIndex]) {pointer[inputIndex] = 0;const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType.Mouse */.Yi.Mouse, 0, inputIndex, 0, this, this._elementToAttachTo);this._onInputChanged(deviceEnums/* DeviceType.Mouse */.Yi.Mouse, 0, deviceEvent);}}if (this.isDeviceAvailable(deviceEnums/* DeviceType.Touch */.Yi.Touch)) {const pointer = this._inputs[deviceEnums/* DeviceType.Touch */.Yi.Touch];for (let deviceSlot = 0; deviceSlot < this._activeTouchIds.length; deviceSlot++) {const pointerId = this._activeTouchIds[deviceSlot];if ((null === (_d = (_c = this._elementToAttachTo).hasPointerCapture) || void 0 === _d ? void 0 : _d.call(_c, pointerId)) && this._elementToAttachTo.releasePointerCapture(pointerId), -1 !== pointerId && 1 === (null === (_e = pointer[deviceSlot]) || void 0 === _e ? void 0 : _e[deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick])) {pointer[deviceSlot][deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick] = 0;const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType.Touch */.Yi.Touch, deviceSlot, deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick, 0, this, this._elementToAttachTo, pointerId);this._onInputChanged(deviceEnums/* DeviceType.Touch */.Yi.Touch, deviceSlot, deviceEvent), this._activeTouchIds[deviceSlot] = -1, this._onDeviceDisconnected(deviceEnums/* DeviceType.Touch */.Yi.Touch, deviceSlot);}}}}, this._pointerWheelEvent = (evt) => {const deviceType = deviceEnums/* DeviceType.Mouse */.Yi.Mouse,deviceSlot = 0;this._inputs[deviceType] || (this._inputs[deviceType] = []), this._inputs[deviceType][deviceSlot] || (this._pointerActive = !0, this._registerDevice(deviceType, deviceSlot, MAX_POINTER_INPUTS));const pointer = this._inputs[deviceType][deviceSlot];if (pointer) {pointer[deviceEnums/* PointerInput.MouseWheelX */.Fz.MouseWheelX] = evt.deltaX || 0, pointer[deviceEnums/* PointerInput.MouseWheelY */.Fz.MouseWheelY] = evt.deltaY || evt.wheelDelta || 0, pointer[deviceEnums/* PointerInput.MouseWheelZ */.Fz.MouseWheelZ] = evt.deltaZ || 0;const deviceEvent = evt;0 !== pointer[deviceEnums/* PointerInput.MouseWheelX */.Fz.MouseWheelX] && (deviceEvent.inputIndex = deviceEnums/* PointerInput.MouseWheelX */.Fz.MouseWheelX, this._onInputChanged(deviceType, deviceSlot, deviceEvent)), 0 !== pointer[deviceEnums/* PointerInput.MouseWheelY */.Fz.MouseWheelY] && (deviceEvent.inputIndex = deviceEnums/* PointerInput.MouseWheelY */.Fz.MouseWheelY, this._onInputChanged(deviceType, deviceSlot, deviceEvent)), 0 !== pointer[deviceEnums/* PointerInput.MouseWheelZ */.Fz.MouseWheelZ] && (deviceEvent.inputIndex = deviceEnums/* PointerInput.MouseWheelZ */.Fz.MouseWheelZ, this._onInputChanged(deviceType, deviceSlot, deviceEvent));}}, this._elementToAttachTo.addEventListener(this._eventPrefix + "move", this._pointerMoveEvent), this._elementToAttachTo.addEventListener(this._eventPrefix + "down", this._pointerDownEvent), this._elementToAttachTo.addEventListener(this._eventPrefix + "up", this._pointerUpEvent), this._elementToAttachTo.addEventListener(this._eventPrefix + "cancel", this._pointerCancelEvent), this._elementToAttachTo.addEventListener("blur", this._pointerBlurEvent), this._elementToAttachTo.addEventListener(this._wheelEventName, this._pointerWheelEvent, !!passiveSupported && { passive: !1 }), this._pointerInputClearObserver = this._engine.onEndFrameObservable.add(() => {if (this.isDeviceAvailable(deviceEnums/* DeviceType.Mouse */.Yi.Mouse)) {const pointer = this._inputs[deviceEnums/* DeviceType.Mouse */.Yi.Mouse][0];pointer[deviceEnums/* PointerInput.MouseWheelX */.Fz.MouseWheelX] = 0, pointer[deviceEnums/* PointerInput.MouseWheelY */.Fz.MouseWheelY] = 0, pointer[deviceEnums/* PointerInput.MouseWheelZ */.Fz.MouseWheelZ] = 0;}});}_handleGamepadActions() {this._gamepadConnectedEvent = (evt) => {this._addGamePad(evt.gamepad);}, this._gamepadDisconnectedEvent = (evt) => {if (this._gamepads) {const deviceType = this._getGamepadDeviceType(evt.gamepad.id),deviceSlot = evt.gamepad.index;this._unregisterDevice(deviceType, deviceSlot), delete this._gamepads[deviceSlot];}}, window.addEventListener("gamepadconnected", this._gamepadConnectedEvent), window.addEventListener("gamepaddisconnected", this._gamepadDisconnectedEvent);}_updateDevice(deviceType, deviceSlot, inputIndex) {const gp = navigator.getGamepads()[deviceSlot];if (gp && deviceType === this._gamepads[deviceSlot]) {const device = this._inputs[deviceType][deviceSlot];device[inputIndex] = inputIndex >= gp.buttons.length ? gp.axes[inputIndex - gp.buttons.length].valueOf() : gp.buttons[inputIndex].value;}}_getGamepadDeviceType(deviceName) {if (-1 !== deviceName.indexOf("054c")) return -1 === deviceName.indexOf("0ce6") ? deviceEnums/* DeviceType.DualShock */.Yi.DualShock : deviceEnums/* DeviceType.DualSense */.Yi.DualSense;return -1 !== deviceName.indexOf("Xbox One") || -1 !== deviceName.search("Xbox 360") || -1 !== deviceName.search("xinput") ? deviceEnums/* DeviceType.Xbox */.Yi.Xbox : -1 === deviceName.indexOf("057e") ? deviceEnums/* DeviceType.Generic */.Yi.Generic : deviceEnums/* DeviceType.Switch */.Yi.Switch;}_getPointerType(evt) {let deviceType = deviceEnums/* DeviceType.Mouse */.Yi.Mouse;return ("touch" === evt.pointerType || "pen" === evt.pointerType || evt.touches) && (deviceType = deviceEnums/* DeviceType.Touch */.Yi.Touch), deviceType;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.js
var InputDevices_deviceSource = __webpack_require__("./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/DeviceInput/internalDeviceSourceManager.js
class InternalDeviceSourceManager {constructor(engine) {this._registeredManagers = [], this._refCount = 0, this.registerManager = (manager) => {for (let deviceType = 0; deviceType < this._devices.length; deviceType++) {const device = this._devices[deviceType];for (const deviceSlotKey in device) {manager._addDevice(new InputDevices_deviceSource/* DeviceSource */.p(this._deviceInputSystem, deviceType, +deviceSlotKey));}}this._registeredManagers.push(manager);}, this.unregisterManager = (manager) => {const idx = this._registeredManagers.indexOf(manager);-1 < idx && this._registeredManagers.splice(idx, 1);};const numberOfDeviceTypes = Object.keys(deviceEnums/* DeviceType */.Yi).length / 2;this._devices = Array(numberOfDeviceTypes);const onDeviceConnected = (deviceType, deviceSlot) => {this._devices[deviceType] || (this._devices[deviceType] = []), this._devices[deviceType][deviceSlot] || (this._devices[deviceType][deviceSlot] = deviceSlot);for (const manager of this._registeredManagers) {const deviceSource = new InputDevices_deviceSource/* DeviceSource */.p(this._deviceInputSystem, deviceType, deviceSlot);manager._addDevice(deviceSource);}},onDeviceDisconnected = (deviceType, deviceSlot) => {var _a;(null === (_a = this._devices[deviceType]) || void 0 === _a ? void 0 : _a[deviceSlot]) && delete this._devices[deviceType][deviceSlot];for (const manager of this._registeredManagers) manager._removeDevice(deviceType, deviceSlot);},onInputChanged = (deviceType, deviceSlot, eventData) => {if (eventData) for (const manager of this._registeredManagers) manager._onInputChanged(deviceType, deviceSlot, eventData);};this._deviceInputSystem = "undefined" == typeof _native ? new WebDeviceInputSystem(engine, onDeviceConnected, onDeviceDisconnected, onInputChanged) : new NativeDeviceInputSystem(onDeviceConnected, onDeviceDisconnected, onInputChanged);}dispose() {this._deviceInputSystem.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js
class DeviceSourceManager {getDeviceSource(deviceType, deviceSlot) {if (deviceSlot === void 0) {if (this._firstDevice[deviceType] === void 0) return null;deviceSlot = this._firstDevice[deviceType];}return this._devices[deviceType] && void 0 !== this._devices[deviceType][deviceSlot] ? this._devices[deviceType][deviceSlot] : null;}getDeviceSources(deviceType) {return this._devices[deviceType] ? this._devices[deviceType].filter((source) => !!source) : [];}constructor(engine) {const numberOfDeviceTypes = Object.keys(deviceEnums/* DeviceType */.Yi).length / 2;this._devices = Array(numberOfDeviceTypes), this._firstDevice = Array(numberOfDeviceTypes), this._engine = engine, this._engine._deviceSourceManager || (this._engine._deviceSourceManager = new InternalDeviceSourceManager(engine)), this._engine._deviceSourceManager._refCount++, this.onDeviceConnectedObservable = new observable/* Observable */.y$((observer) => {for (const devices of this._devices) if (devices) for (const device of devices) device && this.onDeviceConnectedObservable.notifyObserver(observer, device);}), this.onDeviceDisconnectedObservable = new observable/* Observable */.y$(), this._engine._deviceSourceManager.registerManager(this), this._onDisposeObserver = engine.onDisposeObservable.add(() => {this.dispose();});}dispose() {this.onDeviceConnectedObservable.clear(), this.onDeviceDisconnectedObservable.clear(), this._engine._deviceSourceManager && (this._engine._deviceSourceManager.unregisterManager(this), 1 > --this._engine._deviceSourceManager._refCount && (this._engine._deviceSourceManager.dispose(), delete this._engine._deviceSourceManager)), this._engine.onDisposeObservable.remove(this._onDisposeObserver);}_addDevice(deviceSource) {this._devices[deviceSource.deviceType] || (this._devices[deviceSource.deviceType] = []), this._devices[deviceSource.deviceType][deviceSource.deviceSlot] || (this._devices[deviceSource.deviceType][deviceSource.deviceSlot] = deviceSource, this._updateFirstDevices(deviceSource.deviceType)), this.onDeviceConnectedObservable.notifyObservers(deviceSource);}_removeDevice(deviceType, deviceSlot) {var _a, _b;const deviceSource = null === (_a = this._devices[deviceType]) || void 0 === _a ? void 0 : _a[deviceSlot];this.onDeviceDisconnectedObservable.notifyObservers(deviceSource), (null === (_b = this._devices[deviceType]) || void 0 === _b ? void 0 : _b[deviceSlot]) && delete this._devices[deviceType][deviceSlot], this._updateFirstDevices(deviceType);}_onInputChanged(deviceType, deviceSlot, eventData) {var _a, _b;null === (_b = null === (_a = this._devices[deviceType]) || void 0 === _a ? void 0 : _a[deviceSlot]) || void 0 === _b ? void 0 : _b.onInputChangedObservable.notifyObservers(eventData);}_updateFirstDevices(type) {switch (type) {case deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard:case deviceEnums/* DeviceType.Mouse */.Yi.Mouse:this._firstDevice[type] = 0;break;case deviceEnums/* DeviceType.Touch */.Yi.Touch:case deviceEnums/* DeviceType.DualSense */.Yi.DualSense:case deviceEnums/* DeviceType.DualShock */.Yi.DualShock:case deviceEnums/* DeviceType.Xbox */.Yi.Xbox:case deviceEnums/* DeviceType.Switch */.Yi.Switch:case deviceEnums/* DeviceType.Generic */.Yi.Generic:{delete this._firstDevice[type];const devices = this._devices[type];if (devices) for (let i = 0; i < devices.length; i++) if (devices[i]) {this._firstDevice[type] = i;break;}break;}}}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.alpha.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.setAlphaConstants */ .B.prototype.setAlphaConstants = function (r, g, b, a) {this._alphaState.setAlphaBlendConstants(r, g, b, a);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.setAlphaMode */ .B.prototype.setAlphaMode = function (mode, noDepthWriteChange = !1) {this._alphaMode !== mode && (0 === mode ? this._alphaState.alphaBlend = !1 : 7 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0) : 8 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0) : 2 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0) : 6 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0) : 1 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0) : 3 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0) : 4 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0) : 5 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0) : 9 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA), this._alphaState.alphaBlend = !0) : 10 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0) : 11 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0) : 12 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO), this._alphaState.alphaBlend = !0) : 13 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0) : 14 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0) : 15 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO), this._alphaState.alphaBlend = !0) : 16 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0) : 17 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0) : void 0, noDepthWriteChange || (this.depthCullingState.depthMask = 0 === mode), this._alphaMode = mode);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.getAlphaMode */ .B.prototype.getAlphaMode = function () {return this._alphaMode;}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.setAlphaEquation */ .B.prototype.setAlphaEquation = function (equation) {this._alphaEquation !== equation && (0 === equation ? this._alphaState.setAlphaEquationParameters(32774, 32774) : 1 === equation ? this._alphaState.setAlphaEquationParameters(32778, 32778) : 2 === equation ? this._alphaState.setAlphaEquationParameters(32779, 32779) : 3 === equation ? this._alphaState.setAlphaEquationParameters(32776, 32776) : 4 === equation ? this._alphaState.setAlphaEquationParameters(32775, 32775) : 5 === equation ? this._alphaState.setAlphaEquationParameters(32775, 32774) : void 0, this._alphaEquation = equation);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.getAlphaEquation */ .B.prototype.getAlphaEquation = function () {return this._alphaEquation;};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.cubeTexture.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Misc_fileTools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/fileTools.js");
/* harmony import */ var _Misc_guid_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/guid.js");
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype._createDepthStencilCubeTexture */ .B.prototype._createDepthStencilCubeTexture = function (size, options, rtWrapper) {const internalTexture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTexture */ .l(this, _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTextureSource.DepthStencil */ .S.DepthStencil);if (internalTexture.isCube = !0, 1 === this.webGLVersion) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error("Depth cube texture is not supported by WebGL 1."), internalTexture;const internalOptions = { bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1, ...options },gl = this._gl;this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, internalTexture, !0), this._setupDepthStencilTexture(internalTexture, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction), rtWrapper._depthStencilTexture = internalTexture, rtWrapper._depthStencilTextureWithStencil = internalOptions.generateStencil;for (let face = 0; 6 > face; face++) internalOptions.generateStencil ? gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH24_STENCIL8, size, size, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8, null) : gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH_COMPONENT24, size, size, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null);return this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null), this._internalTexturesCache.push(internalTexture), internalTexture;}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype._partialLoadFile */ .B.prototype._partialLoadFile = function (url, index, loadedFiles, onfinish, onErrorCallBack = null) {this._loadFile(url, (data) => {loadedFiles[index] = data, loadedFiles._internalCount++, 6 === loadedFiles._internalCount && onfinish(loadedFiles);}, void 0, void 0, !0, (request, exception) => {onErrorCallBack && request && onErrorCallBack(request.status + " " + request.statusText, exception);});}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype._cascadeLoadFiles */ .B.prototype._cascadeLoadFiles = function (scene, onfinish, files, onError = null) {const loadedFiles = [];loadedFiles._internalCount = 0;for (let index = 0; 6 > index; index++) this._partialLoadFile(files[index], index, loadedFiles, onfinish, onError);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype._cascadeLoadImgs */ .B.prototype._cascadeLoadImgs = function (scene, texture, onfinish, files, onError = null, mimeType) {const loadedImages = [];loadedImages._internalCount = 0;for (let index = 0; 6 > index; index++) this._partialLoadImg(files[index], index, loadedImages, scene, texture, onfinish, onError, mimeType);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype._partialLoadImg */ .B.prototype._partialLoadImg = function (url, index, loadedImages, scene, texture, onfinish, onErrorCallBack = null, mimeType) {const tokenPendingData = (0,_Misc_guid_js__WEBPACK_IMPORTED_MODULE_4__/* .RandomGUID */ .f)();(0,_Misc_fileTools_js__WEBPACK_IMPORTED_MODULE_3__/* .LoadImage */ .r6)(url, (img) => {loadedImages[index] = img, loadedImages._internalCount++, scene && scene.removePendingData(tokenPendingData), 6 === loadedImages._internalCount && onfinish && onfinish(texture, loadedImages);}, (message, exception) => {scene && scene.removePendingData(tokenPendingData), onErrorCallBack && onErrorCallBack(message, exception);}, scene ? scene.offlineProvider : null, mimeType), scene && scene.addPendingData(tokenPendingData);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype._setCubeMapTextureParams */ .B.prototype._setCubeMapTextureParams = function (texture, loadMipmap, maxLevel) {const gl = this._gl;gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE), texture.samplingMode = loadMipmap ? 3 : 2, loadMipmap && this.getCaps().textureMaxLevel && maxLevel !== void 0 && 0 < maxLevel && (gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAX_LEVEL, maxLevel), texture._maxLodLevel = maxLevel), this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.createCubeTextureBase */ .B.prototype.createCubeTextureBase = function (rootUrl, scene, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = !1, lodScale = 0, lodOffset = 0, fallback = null, beforeLoadCubeDataCallback = null, imageHandler = null, useSRGBBuffer = !1) {const texture = fallback ? fallback : new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTexture */ .l(this, _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTextureSource.Cube */ .S.Cube);texture.isCube = !0, texture.url = rootUrl, texture.generateMipMaps = !noMipmap, texture._lodGenerationScale = lodScale, texture._lodGenerationOffset = lodOffset, texture._useSRGBBuffer = !!useSRGBBuffer && this._caps.supportSRGBBuffers && (1 < this.webGLVersion || this.isWebGPU || !!noMipmap), this._doNotHandleContextLost || (texture._extension = forcedExtension, texture._files = files);const originalRootUrl = rootUrl;this._transformTextureUrl && !fallback && (rootUrl = this._transformTextureUrl(rootUrl));const rootUrlWithoutUriParams = rootUrl.split("?")[0],lastDot = rootUrlWithoutUriParams.lastIndexOf("."),extension = forcedExtension ? forcedExtension : -1 < lastDot ? rootUrlWithoutUriParams.substring(lastDot).toLowerCase() : "";let loader = null;for (const availableLoader of _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine._TextureLoaders */ .B._TextureLoaders) if (availableLoader.canLoad(extension)) {loader = availableLoader;break;}const onInternalError = (request, exception) => {rootUrl === originalRootUrl ? onError && request && onError(request.status + " " + request.statusText, exception) : (_Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Warn */ .Y.Warn(`Failed to load ${rootUrl}, falling back to the ${originalRootUrl}`), this.createCubeTextureBase(originalRootUrl, scene, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, texture, beforeLoadCubeDataCallback, imageHandler, useSRGBBuffer));};if (loader) {const onloaddata = (data) => {beforeLoadCubeDataCallback && beforeLoadCubeDataCallback(texture, data), loader.loadCubeData(data, texture, createPolynomials, onLoad, onError);};files && 6 === files.length ? loader.supportCascades ? this._cascadeLoadFiles(scene, (images) => onloaddata(images.map((image) => new Uint8Array(image))), files, onError) : onError ? onError("Textures type does not support cascades.") : _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Warn */ .Y.Warn("Texture loader does not support cascades.") : this._loadFile(rootUrl, (data) => onloaddata(new Uint8Array(data)), void 0, void 0, !0, onInternalError);} else {if (!files) throw new Error("Cannot load cubemap because files were not defined");this._cascadeLoadImgs(scene, texture, (texture, imgs) => {imageHandler && imageHandler(texture, imgs);}, files, onError);}return this._internalTexturesCache.push(texture), texture;}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.createCubeTexture */ .B.prototype.createCubeTexture = function (rootUrl, scene, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = !1, lodScale = 0, lodOffset = 0, fallback = null, loaderOptions, useSRGBBuffer = !1) {const gl = this._gl;return this.createCubeTextureBase(rootUrl, scene, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback, (texture) => this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, !0), (texture, imgs) => {const width = this.needPOTTextures ? _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.GetExponentOfTwo */ .B.GetExponentOfTwo(imgs[0].width, this._caps.maxCubemapTextureSize) : imgs[0].width,height = width,faces = [gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_POSITIVE_Y, gl.TEXTURE_CUBE_MAP_POSITIVE_Z, gl.TEXTURE_CUBE_MAP_NEGATIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, !0), this._unpackFlipY(!1);const internalFormat = format ? this._getInternalFormat(format, texture._useSRGBBuffer) : texture._useSRGBBuffer ? gl.SRGB8_ALPHA8 : gl.RGBA;let texelFormat = format ? this._getInternalFormat(format) : gl.RGBA;texture._useSRGBBuffer && 1 === this.webGLVersion && (texelFormat = internalFormat);for (let index = 0; index < faces.length; index++) if (imgs[index].width !== width || imgs[index].height !== height) {if (this._prepareWorkingCanvas(), !this._workingCanvas || !this._workingContext) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Warn */ .Y.Warn("Cannot create canvas to resize texture.");this._workingCanvas.width = width, this._workingCanvas.height = height, this._workingContext.drawImage(imgs[index], 0, 0, imgs[index].width, imgs[index].height, 0, 0, width, height), gl.texImage2D(faces[index], 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, this._workingCanvas);} else gl.texImage2D(faces[index], 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, imgs[index]);noMipmap || gl.generateMipmap(gl.TEXTURE_CUBE_MAP), this._setCubeMapTextureParams(texture, !noMipmap), texture.width = width, texture.height = height, texture.isReady = !0, format && (texture.format = format), texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear(), onLoad && onLoad();}, !!useSRGBBuffer);};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicBuffer.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.updateDynamicIndexBuffer */ .B.prototype.updateDynamicIndexBuffer = function (indexBuffer, indices, offset = 0) {this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null, this.bindIndexBuffer(indexBuffer);let view;view = indexBuffer.is32Bits ? indices instanceof Uint32Array ? indices : new Uint32Array(indices) : indices instanceof Uint16Array ? indices : new Uint16Array(indices), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, view, this._gl.DYNAMIC_DRAW), this._resetIndexBufferBinding();}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.updateDynamicVertexBuffer */ .B.prototype.updateDynamicVertexBuffer = function (vertexBuffer, data, byteOffset, byteLength) {this.bindArrayBuffer(vertexBuffer), byteOffset === void 0 && (byteOffset = 0);const dataLength = data.byteLength || data.length;byteLength === void 0 || byteLength >= dataLength && 0 === byteOffset ? data instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, new Float32Array(data)) : this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, data) : data instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(data).subarray(byteOffset, byteOffset + byteLength)) : (data = data instanceof ArrayBuffer ? new Uint8Array(data, byteOffset, byteLength) : new Uint8Array(data.buffer, data.byteOffset + byteOffset, byteLength), this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data)), this._resetVertexBufferBinding();};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicTexture.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.createDynamicTexture */ .B.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {const texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTexture */ .l(this, _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTextureSource.Dynamic */ .S.Dynamic);return texture.baseWidth = width, texture.baseHeight = height, generateMipMaps && (width = this.needPOTTextures ? _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.GetExponentOfTwo */ .B.GetExponentOfTwo(width, this._caps.maxTextureSize) : width, height = this.needPOTTextures ? _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.GetExponentOfTwo */ .B.GetExponentOfTwo(height, this._caps.maxTextureSize) : height), texture.width = width, texture.height = height, texture.isReady = !1, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, this.updateTextureSamplingMode(samplingMode, texture), this._internalTexturesCache.push(texture), texture;}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.updateDynamicTexture */ .B.prototype.updateDynamicTexture = function (texture, source, invertY, premulAlpha = !1, format, forceBindTexture = !1, allowGPUOptimization = !1) {if (!texture) return;const gl = this._gl,target = gl.TEXTURE_2D,wasPreviouslyBound = this._bindTextureDirectly(target, texture, !0, forceBindTexture);this._unpackFlipY(invertY === void 0 ? texture.invertY : invertY), premulAlpha && gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);const textureType = this._getWebGLTextureType(texture.type),glformat = this._getInternalFormat(format ? format : texture.format),internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, glformat);gl.texImage2D(target, 0, internalFormat, glformat, textureType, source), texture.generateMipMaps && gl.generateMipmap(target), wasPreviouslyBound || this._bindTextureDirectly(target, null), premulAlpha && gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), texture.isReady = !0;};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.rawTexture.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _thinEngine_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
_thinEngine_js__WEBPACK_IMPORTED_MODULE_3__/* .ThinEngine.prototype.updateRawTexture */ .B.prototype.updateRawTexture = function (texture, data, format, invertY, compression = null, type = 0, useSRGBBuffer = !1) {if (!texture) return;const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer),internalFormat = this._getInternalFormat(format),textureType = this._getWebGLTextureType(type);this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, !0), this._unpackFlipY(!(invertY !== void 0) || !!invertY), this._doNotHandleContextLost || (texture._bufferView = data, texture.format = format, texture.type = type, texture.invertY = invertY, texture._compression = compression), 0 != texture.width % 4 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), compression && data ? this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, 0, data) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, data), texture.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), texture.isReady = !0;}, _thinEngine_js__WEBPACK_IMPORTED_MODULE_3__/* .ThinEngine.prototype.createRawTexture */ .B.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = !1) {const texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .l(this, _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTextureSource.Raw */ .S.Raw);texture.baseWidth = width, texture.baseHeight = height, texture.width = width, texture.height = height, texture.format = format, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.invertY = invertY, texture._compression = compression, texture.type = type, texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps), this._doNotHandleContextLost || (texture._bufferView = data), this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer), this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, !0);const filters = this._getSamplingParameters(samplingMode, generateMipMaps);return this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min), generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._internalTexturesCache.push(texture), texture;}, _thinEngine_js__WEBPACK_IMPORTED_MODULE_3__/* .ThinEngine.prototype.createRawCubeTexture */ .B.prototype.createRawCubeTexture = function (data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) {const gl = this._gl,texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .l(this, _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTextureSource.CubeRaw */ .S.CubeRaw);texture.isCube = !0, texture.format = format, texture.type = type, this._doNotHandleContextLost || (texture._bufferViewArray = data);const textureType = this._getWebGLTextureType(type);let internalFormat = this._getInternalFormat(format);internalFormat === gl.RGB && (internalFormat = gl.RGBA), textureType !== gl.FLOAT || this._caps.textureFloatLinearFiltering ? textureType !== this._gl.HALF_FLOAT_OES || this._caps.textureHalfFloatLinearFiltering ? textureType !== gl.FLOAT || this._caps.textureFloatRender ? textureType === gl.HALF_FLOAT && !this._caps.colorBufferFloat && (generateMipMaps = !1, _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger.Warn */ .Y.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")) : (generateMipMaps = !1, _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger.Warn */ .Y.Warn("Render to float textures is not supported. Mipmap generation forced to false.")) : (generateMipMaps = !1, samplingMode = 1, _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger.Warn */ .Y.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")) : (generateMipMaps = !1, samplingMode = 1, _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger.Warn */ .Y.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."));const width = size;texture.width = width, texture.height = width, texture.invertY = invertY, texture._compression = compression;const isPot = !this.needPOTTextures || _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.IsExponentOfTwo */ .w1.IsExponentOfTwo(texture.width) && _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.IsExponentOfTwo */ .w1.IsExponentOfTwo(texture.height);if (isPot || (generateMipMaps = !1), data) this.updateRawCubeTexture(texture, data, format, type, invertY, compression);else {const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type),level = 0;this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, !0);for (let faceIndex = 0; 6 > faceIndex; faceIndex++) compression ? gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, void 0) : gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, !0), data && generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);const filters = this._getSamplingParameters(samplingMode, generateMipMaps);return gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE), this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null), texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.isReady = !0, texture;}, _thinEngine_js__WEBPACK_IMPORTED_MODULE_3__/* .ThinEngine.prototype.updateRawCubeTexture */ .B.prototype.updateRawCubeTexture = function (texture, data, format, type, invertY, compression = null, level = 0) {texture._bufferViewArray = data, texture.format = format, texture.type = type, texture.invertY = invertY, texture._compression = compression;const gl = this._gl,textureType = this._getWebGLTextureType(type);let internalFormat = this._getInternalFormat(format);const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);let needConversion = !1;internalFormat === gl.RGB && (internalFormat = gl.RGBA, needConversion = !0), this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, !0), this._unpackFlipY(!(invertY !== void 0) || !!invertY), 0 != texture.width % 4 && gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);for (let faceData, faceIndex = 0; 6 > faceIndex; faceIndex++) faceData = data[faceIndex], compression ? gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, faceData) : (needConversion && (faceData = _convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type)), gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, faceData));const isPot = !this.needPOTTextures || _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.IsExponentOfTwo */ .w1.IsExponentOfTwo(texture.width) && _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.IsExponentOfTwo */ .w1.IsExponentOfTwo(texture.height);isPot && texture.generateMipMaps && 0 === level && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), texture.isReady = !0;}, _thinEngine_js__WEBPACK_IMPORTED_MODULE_3__/* .ThinEngine.prototype.createRawCubeTextureFromUrl */ .B.prototype.createRawCubeTextureFromUrl = function (url, scene, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = 3, invertY = !1) {const gl = this._gl,texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);null === scene || void 0 === scene ? void 0 : scene.addPendingData(texture), texture.url = url, this._internalTexturesCache.push(texture);const internalCallback = (data) => {const width = texture.width,faceDataArrays = callback(data);if (faceDataArrays) {if (mipmapGenerator) {const textureType = this._getWebGLTextureType(type);let internalFormat = this._getInternalFormat(format);const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);let needConversion = !1;internalFormat === gl.RGB && (internalFormat = gl.RGBA, needConversion = !0), this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, !0), this._unpackFlipY(!1);const mipData = mipmapGenerator(faceDataArrays);for (let level = 0; level < mipData.length; level++) {const mipSize = width >> level;for (let mipFaceData, faceIndex = 0; 6 > faceIndex; faceIndex++) mipFaceData = mipData[level][faceIndex], needConversion && (mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type)), gl.texImage2D(faceIndex, level, internalSizedFomat, mipSize, mipSize, 0, internalFormat, textureType, mipFaceData);}this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);} else this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY);texture.isReady = !0, null === scene || void 0 === scene ? void 0 : scene.removePendingData(texture), texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear(), onLoad && onLoad();}};return this._loadFile(url, (data) => {internalCallback(data);}, void 0, null === scene || void 0 === scene ? void 0 : scene.offlineProvider, !0, (request, exception) => {null === scene || void 0 === scene ? void 0 : scene.removePendingData(texture), onError && request && onError(request.status + " " + request.statusText, exception);}), texture;};function _convertRGBtoRGBATextureData(rgbData, width, height, textureType) {let rgbaData,val1 = 1;1 === textureType ? rgbaData = new Float32Array(4 * (width * height)) : 2 === textureType ? (rgbaData = new Uint16Array(4 * (width * height)), val1 = 15360) : 7 === textureType ? rgbaData = new Uint32Array(4 * (width * height)) : rgbaData = new Uint8Array(4 * (width * height));for (let x = 0; x < width; x++) for (let y = 0; y < height; y++) {const index = 3 * (y * width + x),newIndex = 4 * (y * width + x);rgbaData[newIndex + 0] = rgbData[index + 0], rgbaData[newIndex + 1] = rgbData[index + 1], rgbaData[newIndex + 2] = rgbData[index + 2], rgbaData[newIndex + 3] = val1;}return rgbaData;}function _makeCreateRawTextureFunction(is3D) {return function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0) {const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY,source = is3D ? _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTextureSource.Raw3D */ .S.Raw3D : _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTextureSource.Raw2DArray */ .S.Raw2DArray,texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .l(this, source);texture.baseWidth = width, texture.baseHeight = height, texture.baseDepth = depth, texture.width = width, texture.height = height, texture.depth = depth, texture.format = format, texture.type = textureType, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, is3D ? texture.is3D = !0 : texture.is2DArray = !0, this._doNotHandleContextLost || (texture._bufferView = data), is3D ? this.updateRawTexture3D(texture, data, format, invertY, compression, textureType) : this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType), this._bindTextureDirectly(target, texture, !0);const filters = this._getSamplingParameters(samplingMode, generateMipMaps);return this._gl.texParameteri(target, this._gl.TEXTURE_MAG_FILTER, filters.mag), this._gl.texParameteri(target, this._gl.TEXTURE_MIN_FILTER, filters.min), generateMipMaps && this._gl.generateMipmap(target), this._bindTextureDirectly(target, null), this._internalTexturesCache.push(texture), texture;};}_thinEngine_js__WEBPACK_IMPORTED_MODULE_3__/* .ThinEngine.prototype.createRawTexture2DArray */ .B.prototype.createRawTexture2DArray = _makeCreateRawTextureFunction(!1), _thinEngine_js__WEBPACK_IMPORTED_MODULE_3__/* .ThinEngine.prototype.createRawTexture3D */ .B.prototype.createRawTexture3D = _makeCreateRawTextureFunction(!0);function _makeUpdateRawTextureFunction(is3D) {return function (texture, data, format, invertY, compression = null, textureType = 0) {const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY,internalType = this._getWebGLTextureType(textureType),internalFormat = this._getInternalFormat(format),internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);this._bindTextureDirectly(target, texture, !0), this._unpackFlipY(!(invertY !== void 0) || !!invertY), this._doNotHandleContextLost || (texture._bufferView = data, texture.format = format, texture.invertY = invertY, texture._compression = compression), 0 != texture.width % 4 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), compression && data ? this._gl.compressedTexImage3D(target, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data) : this._gl.texImage3D(target, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data), texture.generateMipMaps && this._gl.generateMipmap(target), this._bindTextureDirectly(target, null), texture.isReady = !0;};}_thinEngine_js__WEBPACK_IMPORTED_MODULE_3__/* .ThinEngine.prototype.updateRawTexture2DArray */ .B.prototype.updateRawTexture2DArray = _makeUpdateRawTextureFunction(!1), _thinEngine_js__WEBPACK_IMPORTED_MODULE_3__/* .ThinEngine.prototype.updateRawTexture3D */ .B.prototype.updateRawTexture3D = _makeUpdateRawTextureFunction(!0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.readTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "A": () => (/* binding */ allocateAndCopyTypedBuffer)
/* harmony export */ });
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
function allocateAndCopyTypedBuffer(type, sizeOrDstBuffer, sizeInBytes = !1, copyBuffer) {switch (type) {case 3:{const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Int8Array(sizeOrDstBuffer) : new Int8Array(sizeOrDstBuffer);return copyBuffer && buffer.set(new Int8Array(copyBuffer)), buffer;}case 0:{const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint8Array(sizeOrDstBuffer) : new Uint8Array(sizeOrDstBuffer);return copyBuffer && buffer.set(new Uint8Array(copyBuffer)), buffer;}case 4:{const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Int16Array(sizeOrDstBuffer) : new Int16Array(sizeInBytes ? sizeOrDstBuffer / 2 : sizeOrDstBuffer);return copyBuffer && buffer.set(new Int16Array(copyBuffer)), buffer;}case 5:case 8:case 9:case 10:case 2:{const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint16Array(sizeOrDstBuffer) : new Uint16Array(sizeInBytes ? sizeOrDstBuffer / 2 : sizeOrDstBuffer);return copyBuffer && buffer.set(new Uint16Array(copyBuffer)), buffer;}case 6:{const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Int32Array(sizeOrDstBuffer) : new Int32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer);return copyBuffer && buffer.set(new Int32Array(copyBuffer)), buffer;}case 7:case 11:case 12:case 13:case 14:case 15:{const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint32Array(sizeOrDstBuffer) : new Uint32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer);return copyBuffer && buffer.set(new Uint32Array(copyBuffer)), buffer;}case 1:{const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Float32Array(sizeOrDstBuffer) : new Float32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer);return copyBuffer && buffer.set(new Float32Array(copyBuffer)), buffer;}}const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint8Array(sizeOrDstBuffer) : new Uint8Array(sizeOrDstBuffer);return copyBuffer && buffer.set(new Uint8Array(copyBuffer)), buffer;}_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype._readTexturePixelsSync */ .B.prototype._readTexturePixelsSync = function (texture, width, height, faceIndex = -1, level = 0, buffer = null, flushRenderer = !0, noDataConversion = !1, x = 0, y = 0) {var _a, _b;const gl = this._gl;if (!gl) throw new Error("Engine does not have gl rendering context.");if (!this._dummyFramebuffer) {const dummy = gl.createFramebuffer();if (!dummy) throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer = dummy;}gl.bindFramebuffer(gl.FRAMEBUFFER, this._dummyFramebuffer), -1 < faceIndex ? gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource, level) : gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null === (_b = texture._hardwareTexture) || void 0 === _b ? void 0 : _b.underlyingResource, level);let readType = void 0 === texture.type ? gl.UNSIGNED_BYTE : this._getWebGLTextureType(texture.type);return noDataConversion ? buffer || (buffer = allocateAndCopyTypedBuffer(texture.type, 4 * width * height)) : readType === gl.UNSIGNED_BYTE ? (buffer || (buffer = new Uint8Array(4 * width * height)), readType = gl.UNSIGNED_BYTE) : (buffer || (buffer = new Float32Array(4 * width * height)), readType = gl.FLOAT), flushRenderer && this.flushFramebuffer(), gl.readPixels(x, y, width, height, gl.RGBA, readType, buffer), gl.bindFramebuffer(gl.FRAMEBUFFER, this._currentFramebuffer), buffer;}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype._readTexturePixels */ .B.prototype._readTexturePixels = function (texture, width, height, faceIndex = -1, level = 0, buffer = null, flushRenderer = !0, noDataConversion = !1, x = 0, y = 0) {return Promise.resolve(this._readTexturePixelsSync(texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion, x, y));};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js
var Textures_internalTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/thinEngine.js + 1 modules
var thinEngine = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/renderTargetWrapper.js
var renderTargetWrapper = __webpack_require__("./node_modules/@babylonjs/core/Engines/renderTargetWrapper.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGLRenderTargetWrapper.js
class WebGLRenderTargetWrapper extends renderTargetWrapper/* RenderTargetWrapper */.r {constructor(isMulti, isCube, size, engine, context) {super(isMulti, isCube, size, engine), this._framebuffer = null, this._depthStencilBuffer = null, this._MSAAFramebuffer = null, this._colorTextureArray = null, this._depthStencilTextureArray = null, this._context = context;}_cloneRenderTargetWrapper() {let rtw = null;return this._colorTextureArray && this._depthStencilTextureArray ? (rtw = this._engine.createMultiviewRenderTargetTexture(this.width, this.height), rtw.texture.isReady = !0) : rtw = super._cloneRenderTargetWrapper(), rtw;}_swapRenderTargetWrapper(target) {super._swapRenderTargetWrapper(target), target._framebuffer = this._framebuffer, target._depthStencilBuffer = this._depthStencilBuffer, target._MSAAFramebuffer = this._MSAAFramebuffer, target._colorTextureArray = this._colorTextureArray, target._depthStencilTextureArray = this._depthStencilTextureArray, this._framebuffer = this._depthStencilBuffer = this._MSAAFramebuffer = this._colorTextureArray = this._depthStencilTextureArray = null;}_shareDepth(renderTarget) {super._shareDepth(renderTarget);const gl = this._context,depthbuffer = this._depthStencilBuffer,framebuffer = renderTarget._MSAAFramebuffer || renderTarget._framebuffer;renderTarget._depthStencilBuffer && gl.deleteRenderbuffer(renderTarget._depthStencilBuffer), renderTarget._depthStencilBuffer = this._depthStencilBuffer, this._engine._bindUnboundFramebuffer(framebuffer), gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthbuffer), this._engine._bindUnboundFramebuffer(null);}_bindTextureRenderTarget(texture, attachmentIndex = 0, faceIndex = -1, lodLevel = 0) {if (!texture._hardwareTexture) return;const gl = this._context,framebuffer = this._framebuffer,currentFB = this._engine._currentFramebuffer;this._engine._bindUnboundFramebuffer(framebuffer);const attachment = gl[1 < this._engine.webGLVersion ? "COLOR_ATTACHMENT" + attachmentIndex : "COLOR_ATTACHMENT" + attachmentIndex + "_WEBGL"],target = -1 === faceIndex ? gl.TEXTURE_2D : gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex;gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, target, texture._hardwareTexture.underlyingResource, lodLevel), this._engine._bindUnboundFramebuffer(currentFB);}setTexture(texture, index = 0, disposePrevious = !0) {super.setTexture(texture, index, disposePrevious), this._bindTextureRenderTarget(texture, index);}dispose(disposeOnlyFramebuffers = !1) {const gl = this._context;disposeOnlyFramebuffers || (this._colorTextureArray && (this._context.deleteTexture(this._colorTextureArray), this._colorTextureArray = null), this._depthStencilTextureArray && (this._context.deleteTexture(this._depthStencilTextureArray), this._depthStencilTextureArray = null)), this._framebuffer && (gl.deleteFramebuffer(this._framebuffer), this._framebuffer = null), this._depthStencilBuffer && (gl.deleteRenderbuffer(this._depthStencilBuffer), this._depthStencilBuffer = null), this._MSAAFramebuffer && (gl.deleteFramebuffer(this._MSAAFramebuffer), this._MSAAFramebuffer = null), super.dispose(disposeOnlyFramebuffers);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js
thinEngine/* ThinEngine.prototype._createHardwareRenderTargetWrapper */.B.prototype._createHardwareRenderTargetWrapper = function (isMulti, isCube, size) {const rtWrapper = new WebGLRenderTargetWrapper(isMulti, isCube, size, this, this._gl);return this._renderTargetWrapperCache.push(rtWrapper), rtWrapper;}, thinEngine/* ThinEngine.prototype.createRenderTargetTexture */.B.prototype.createRenderTargetTexture = function (size, options) {var _a, _b;const rtWrapper = this._createHardwareRenderTargetWrapper(!1, !1, size);let colorAttachment,generateDepthBuffer = !0,generateStencilBuffer = !1,noColorAttachment = !1,samples = 1;void 0 !== options && "object" == typeof options && (generateDepthBuffer = null === (_a = options.generateDepthBuffer) || void 0 === _a || _a, generateStencilBuffer = !!options.generateStencilBuffer, noColorAttachment = !!options.noColorAttachment, colorAttachment = options.colorAttachment, samples = null !== (_b = options.samples) && void 0 !== _b ? _b : 1);const texture = colorAttachment || (noColorAttachment ? null : this._createInternalTexture(size, options, !0, Textures_internalTexture/* InternalTextureSource.RenderTarget */.S.RenderTarget)),width = size.width || size,height = size.height || size,currentFrameBuffer = this._currentFramebuffer,gl = this._gl,framebuffer = gl.createFramebuffer();return this._bindUnboundFramebuffer(framebuffer), rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(generateStencilBuffer, generateDepthBuffer, width, height), texture && !texture.is2DArray && gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture._hardwareTexture.underlyingResource, 0), this._bindUnboundFramebuffer(currentFrameBuffer), rtWrapper._framebuffer = framebuffer, rtWrapper._generateDepthBuffer = generateDepthBuffer, rtWrapper._generateStencilBuffer = generateStencilBuffer, rtWrapper.setTextures(texture), this.updateRenderTargetTextureSampleCount(rtWrapper, samples), rtWrapper;}, thinEngine/* ThinEngine.prototype.createDepthStencilTexture */.B.prototype.createDepthStencilTexture = function (size, options, rtWrapper) {if (options.isCube) {const width = size.width || size;return this._createDepthStencilCubeTexture(width, options, rtWrapper);}return this._createDepthStencilTexture(size, options, rtWrapper);}, thinEngine/* ThinEngine.prototype._createDepthStencilTexture */.B.prototype._createDepthStencilTexture = function (size, options, rtWrapper) {const gl = this._gl,layers = size.layers || 0,target = 0 === layers ? gl.TEXTURE_2D : gl.TEXTURE_2D_ARRAY,internalTexture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.DepthStencil */.S.DepthStencil);if (!this._caps.depthTextureExtension) return logger/* Logger.Error */.Y.Error("Depth texture is not supported by your browser or hardware."), internalTexture;const internalOptions = { bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1, ...options };if (this._bindTextureDirectly(target, internalTexture, !0), this._setupDepthStencilTexture(internalTexture, size, internalOptions.generateStencil, 0 !== internalOptions.comparisonFunction && internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples), void 0 !== internalOptions.depthTextureFormat) {if (15 !== internalOptions.depthTextureFormat && 16 !== internalOptions.depthTextureFormat && 17 !== internalOptions.depthTextureFormat && 13 !== internalOptions.depthTextureFormat && 14 !== internalOptions.depthTextureFormat && 18 !== internalOptions.depthTextureFormat) return logger/* Logger.Error */.Y.Error("Depth texture format is not supported."), internalTexture;internalTexture.format = internalOptions.depthTextureFormat;} else internalTexture.format = internalOptions.generateStencil ? 13 : 16;const hasStencil = 17 === internalTexture.format || 13 === internalTexture.format || 18 === internalTexture.format;rtWrapper._depthStencilTexture = internalTexture, rtWrapper._depthStencilTextureWithStencil = hasStencil;let type = gl.UNSIGNED_INT;15 === internalTexture.format ? type = gl.UNSIGNED_SHORT : 17 === internalTexture.format || 13 === internalTexture.format ? type = gl.UNSIGNED_INT_24_8 : 14 === internalTexture.format ? type = gl.FLOAT : 18 === internalTexture.format && (type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV);const format = hasStencil ? gl.DEPTH_STENCIL : gl.DEPTH_COMPONENT;let internalFormat = format;1 < this.webGLVersion && (15 === internalTexture.format ? internalFormat = gl.DEPTH_COMPONENT16 : 16 === internalTexture.format ? internalFormat = gl.DEPTH_COMPONENT24 : 17 === internalTexture.format || 13 === internalTexture.format ? internalFormat = gl.DEPTH24_STENCIL8 : 14 === internalTexture.format ? internalFormat = gl.DEPTH_COMPONENT32F : 18 === internalTexture.format && (internalFormat = gl.DEPTH32F_STENCIL8)), internalTexture.is2DArray ? gl.texImage3D(target, 0, internalFormat, internalTexture.width, internalTexture.height, layers, 0, format, type, null) : gl.texImage2D(target, 0, internalFormat, internalTexture.width, internalTexture.height, 0, format, type, null), this._bindTextureDirectly(target, null), this._internalTexturesCache.push(internalTexture);const glRtWrapper = rtWrapper;if (glRtWrapper._depthStencilBuffer) {const currentFrameBuffer = this._currentFramebuffer;this._bindUnboundFramebuffer(glRtWrapper._framebuffer), gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, null), gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null), gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, null), this._bindUnboundFramebuffer(currentFrameBuffer), gl.deleteRenderbuffer(glRtWrapper._depthStencilBuffer), glRtWrapper._depthStencilBuffer = null;}return internalTexture;}, thinEngine/* ThinEngine.prototype.updateRenderTargetTextureSampleCount */.B.prototype.updateRenderTargetTextureSampleCount = function (rtWrapper, samples) {if (2 > this.webGLVersion || !rtWrapper || !rtWrapper.texture) return 1;if (rtWrapper.samples === samples) return samples;const gl = this._gl;samples = Math.min(samples, this.getCaps().maxMSAASamples), rtWrapper._depthStencilBuffer && (gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer), rtWrapper._depthStencilBuffer = null), rtWrapper._MSAAFramebuffer && (gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer), rtWrapper._MSAAFramebuffer = null);const hardwareTexture = rtWrapper.texture._hardwareTexture;if (hardwareTexture._MSAARenderBuffer && (gl.deleteRenderbuffer(hardwareTexture._MSAARenderBuffer), hardwareTexture._MSAARenderBuffer = null), 1 < samples && "function" == typeof gl.renderbufferStorageMultisample) {const framebuffer = gl.createFramebuffer();if (!framebuffer) throw new Error("Unable to create multi sampled framebuffer");rtWrapper._MSAAFramebuffer = framebuffer, this._bindUnboundFramebuffer(rtWrapper._MSAAFramebuffer);const colorRenderbuffer = this._createRenderBuffer(rtWrapper.texture.width, rtWrapper.texture.height, samples, -1, this._getRGBAMultiSampleBufferFormat(rtWrapper.texture.type), gl.COLOR_ATTACHMENT0, !1);if (!colorRenderbuffer) throw new Error("Unable to create multi sampled framebuffer");hardwareTexture._MSAARenderBuffer = colorRenderbuffer;} else this._bindUnboundFramebuffer(rtWrapper._framebuffer);return rtWrapper.texture.samples = samples, rtWrapper._samples = samples, rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.texture.width, rtWrapper.texture.height, samples), this._bindUnboundFramebuffer(null), samples;};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetCube.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _thinEngine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__/* .ThinEngine.prototype.createRenderTargetCubeTexture */ .B.prototype.createRenderTargetCubeTexture = function (size, options) {const rtWrapper = this._createHardwareRenderTargetWrapper(!1, !0, size),fullOptions = { generateMipMaps: !0, generateDepthBuffer: !0, generateStencilBuffer: !1, type: 0, samplingMode: 3, format: 5, ...options };fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer, 1 !== fullOptions.type || this._caps.textureFloatLinearFiltering ? 2 === fullOptions.type && !this._caps.textureHalfFloatLinearFiltering && (fullOptions.samplingMode = 1) : fullOptions.samplingMode = 1;const gl = this._gl,texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .l(this, _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTextureSource.RenderTarget */ .S.RenderTarget);this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, !0);const filters = this._getSamplingParameters(fullOptions.samplingMode, fullOptions.generateMipMaps);1 !== fullOptions.type || this._caps.textureFloat || (fullOptions.type = 0, _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger.Warn */ .Y.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);for (let face = 0; 6 > face; face++) gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, this._getRGBABufferInternalSizedFormat(fullOptions.type, fullOptions.format), size, size, 0, this._getInternalFormat(fullOptions.format), this._getWebGLTextureType(fullOptions.type), null);const framebuffer = gl.createFramebuffer();return this._bindUnboundFramebuffer(framebuffer), rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(fullOptions.generateStencilBuffer, fullOptions.generateDepthBuffer, size, size), fullOptions.generateMipMaps && gl.generateMipmap(gl.TEXTURE_CUBE_MAP), this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null), this._bindUnboundFramebuffer(null), rtWrapper._framebuffer = framebuffer, rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer, rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer, texture.width = size, texture.height = size, texture.isReady = !0, texture.isCube = !0, texture.samples = 1, texture.generateMipMaps = fullOptions.generateMipMaps, texture.samplingMode = fullOptions.samplingMode, texture.type = fullOptions.type, texture.format = fullOptions.format, this._internalTexturesCache.push(texture), rtWrapper.setTextures(texture), rtWrapper;};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.uniformBuffer.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
/* harmony import */ var _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js");
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.createUniformBuffer */ .B.prototype.createUniformBuffer = function (elements) {const ubo = this._gl.createBuffer();if (!ubo) throw new Error("Unable to create uniform buffer");const result = new _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_1__/* .WebGLDataBuffer */ .M(ubo);return this.bindUniformBuffer(result), elements instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.STATIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.STATIC_DRAW), this.bindUniformBuffer(null), result.references = 1, result;}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.createDynamicUniformBuffer */ .B.prototype.createDynamicUniformBuffer = function (elements) {const ubo = this._gl.createBuffer();if (!ubo) throw new Error("Unable to create dynamic uniform buffer");const result = new _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_1__/* .WebGLDataBuffer */ .M(ubo);return this.bindUniformBuffer(result), elements instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.DYNAMIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.DYNAMIC_DRAW), this.bindUniformBuffer(null), result.references = 1, result;}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.updateUniformBuffer */ .B.prototype.updateUniformBuffer = function (uniformBuffer, elements, offset, count) {this.bindUniformBuffer(uniformBuffer), offset === void 0 && (offset = 0), count === void 0 ? elements instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, elements) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, new Float32Array(elements)) : elements instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, elements.subarray(offset, offset + count)) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(elements).subarray(offset, offset + count)), this.bindUniformBuffer(null);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.bindUniformBuffer */ .B.prototype.bindUniformBuffer = function (buffer) {this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, buffer ? buffer.underlyingResource : null);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.bindUniformBufferBase */ .B.prototype.bindUniformBufferBase = function (buffer, location) {this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, location, buffer ? buffer.underlyingResource : null);}, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.bindUniformBlock */ .B.prototype.bindUniformBlock = function (pipelineContext, blockName, index) {const program = pipelineContext.program,uniformLocation = this._gl.getUniformBlockIndex(program, blockName);4294967295 !== uniformLocation && this._gl.uniformBlockBinding(program, uniformLocation, index);};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Extensions/engine.videoTexture.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine.prototype.updateVideoTexture */ .B.prototype.updateVideoTexture = function (texture, video, invertY) {if (!texture || texture._isDisabled) return;const glformat = this._getInternalFormat(texture.format),internalFormat = this._getRGBABufferInternalSizedFormat(0, texture.format),wasPreviouslyBound = this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, !0);this._unpackFlipY(!invertY);try {if (void 0 === this._videoTextureSupported && (this._gl.getError(), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, video), this._videoTextureSupported = 0 === this._gl.getError()), !this._videoTextureSupported) {if (!texture._workingCanvas) {texture._workingCanvas = this.createCanvas(texture.width, texture.height);const context = texture._workingCanvas.getContext("2d");if (!context) throw new Error("Unable to get 2d context");texture._workingContext = context, texture._workingCanvas.width = texture.width, texture._workingCanvas.height = texture.height;}texture._workingContext.clearRect(0, 0, texture.width, texture.height), texture._workingContext.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, texture.width, texture.height), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, texture._workingCanvas);} else this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, video);texture.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), wasPreviouslyBound || this._bindTextureDirectly(this._gl.TEXTURE_2D, null), texture.isReady = !0;} catch (ex) {texture._isDisabled = !0;}};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "L": () => (/* binding */ ShaderProcessor)
});

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeNode.js
const defaultAttributeKeywordName = "attribute",defaultVaryingKeywordName = "varying";class ShaderCodeNode {constructor() {this.children = [];}isValid() {return !0;}process(preprocessors, options) {var _a, _b, _c, _d, _e, _f;let result = "";if (this.line) {let value = this.line;const processor = options.processor;if (processor) {processor.lineProcessor && (value = processor.lineProcessor(value, options.isFragment, options.processingContext));const attributeKeyword = null !== (_b = null === (_a = options.processor) || void 0 === _a ? void 0 : _a.attributeKeywordName) && void 0 !== _b ? _b : defaultAttributeKeywordName,varyingKeyword = options.isFragment && (null === (_c = options.processor) || void 0 === _c ? void 0 : _c.varyingFragmentKeywordName) ? null === (_d = options.processor) || void 0 === _d ? void 0 : _d.varyingFragmentKeywordName : !options.isFragment && (null === (_e = options.processor) || void 0 === _e ? void 0 : _e.varyingVertexKeywordName) ? null === (_f = options.processor) || void 0 === _f ? void 0 : _f.varyingVertexKeywordName : defaultVaryingKeywordName;if (!options.isFragment && processor.attributeProcessor && this.line.startsWith(attributeKeyword)) value = processor.attributeProcessor(this.line, preprocessors, options.processingContext);else if (processor.varyingProcessor && this.line.startsWith(varyingKeyword)) value = processor.varyingProcessor(this.line, options.isFragment, preprocessors, options.processingContext);else if (processor.uniformProcessor && processor.uniformRegexp && processor.uniformRegexp.test(this.line)) options.lookForClosingBracketForUniformBuffer || (value = processor.uniformProcessor(this.line, options.isFragment, preprocessors, options.processingContext));else if (processor.uniformBufferProcessor && processor.uniformBufferRegexp && processor.uniformBufferRegexp.test(this.line)) options.lookForClosingBracketForUniformBuffer || (value = processor.uniformBufferProcessor(this.line, options.isFragment, options.processingContext), options.lookForClosingBracketForUniformBuffer = !0);else if (processor.textureProcessor && processor.textureRegexp && processor.textureRegexp.test(this.line)) value = processor.textureProcessor(this.line, options.isFragment, preprocessors, options.processingContext);else if ((processor.uniformProcessor || processor.uniformBufferProcessor) && this.line.startsWith("uniform") && !options.lookForClosingBracketForUniformBuffer) {/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line) ? processor.uniformProcessor && (value = processor.uniformProcessor(this.line, options.isFragment, preprocessors, options.processingContext)) : processor.uniformBufferProcessor && (value = processor.uniformBufferProcessor(this.line, options.isFragment, options.processingContext), options.lookForClosingBracketForUniformBuffer = !0);}options.lookForClosingBracketForUniformBuffer && -1 !== this.line.indexOf("}") && (options.lookForClosingBracketForUniformBuffer = !1, processor.endOfUniformBufferProcessor && (value = processor.endOfUniformBufferProcessor(this.line, options.isFragment, options.processingContext)));}result += value + "\r\n";}return this.children.forEach((child) => {result += child.process(preprocessors, options);}), this.additionalDefineKey && (preprocessors[this.additionalDefineKey] = this.additionalDefineValue || "true"), result;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeCursor.js
class ShaderCodeCursor {constructor() {this._lines = [];}get currentLine() {return this._lines[this.lineIndex];}get canRead() {return this.lineIndex < this._lines.length - 1;}set lines(value) {this._lines.length = 0;for (const line of value) {if ("#" === line[0]) {this._lines.push(line);continue;}if (line.trim().startsWith("//")) {this._lines.push(line);continue;}const split = line.split(";");for (let subLine, index = 0; index < split.length; index++) (subLine = split[index], subLine = subLine.trim(), !!subLine) && this._lines.push(subLine + (index == split.length - 1 ? "" : ";"));}}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeConditionNode.js
class ShaderCodeConditionNode extends ShaderCodeNode {process(preprocessors, options) {for (let index = 0; index < this.children.length; index++) {const node = this.children[index];if (node.isValid(preprocessors)) return node.process(preprocessors, options);}return "";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeTestNode.js
class ShaderCodeTestNode extends ShaderCodeNode {isValid(preprocessors) {return this.testExpression.isTrue(preprocessors);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/Expressions/shaderDefineExpression.js
class ShaderDefineExpression {isTrue() {return !0;}static postfixToInfix(postfix) {const stack = [];for (const c of postfix) if (ShaderDefineExpression._OperatorPriority[c] === void 0) stack.push(c);else {const v1 = stack[stack.length - 1],v2 = stack[stack.length - 2];stack.length -= 2, stack.push(`(${v2}${c}${v1})`);}return stack[stack.length - 1];}static infixToPostfix(infix) {const result = [];let stackIdx = -1;const pushOperand = () => {operand = operand.trim(), "" !== operand && (result.push(operand), operand = "");},push = (s) => {stackIdx < ShaderDefineExpression._Stack.length - 1 && (ShaderDefineExpression._Stack[++stackIdx] = s);},peek = () => ShaderDefineExpression._Stack[stackIdx],pop = () => -1 === stackIdx ? "!!INVALID EXPRESSION!!" : ShaderDefineExpression._Stack[stackIdx--];let idx = 0,operand = "";for (; idx < infix.length;) {const c = infix.charAt(idx),token = idx < infix.length - 1 ? infix.substr(idx, 2) : "";if ("(" === c) operand = "", push(c);else if (")" === c) {for (pushOperand(); -1 !== stackIdx && "(" !== peek();) result.push(pop());pop();} else if (1 < ShaderDefineExpression._OperatorPriority[token]) {for (pushOperand(); -1 !== stackIdx && ShaderDefineExpression._OperatorPriority[peek()] >= ShaderDefineExpression._OperatorPriority[token];) result.push(pop());push(token), idx++;} else operand += c;idx++;}for (pushOperand(); -1 != stackIdx;) "(" === peek() ? pop() : result.push(pop());return result;}}ShaderDefineExpression._OperatorPriority = { ")": 0, "(": 1, "||": 2, "&&": 3 }, ShaderDefineExpression._Stack = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""];
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.js
class ShaderDefineIsDefinedOperator extends ShaderDefineExpression {constructor(define, not = !1) {super(), this.define = define, this.not = not;}isTrue(preprocessors) {let condition = void 0 !== preprocessors[this.define];return this.not && (condition = !condition), condition;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineOrOperator.js
class ShaderDefineOrOperator extends ShaderDefineExpression {isTrue(preprocessors) {return this.leftOperand.isTrue(preprocessors) || this.rightOperand.isTrue(preprocessors);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineAndOperator.js
class ShaderDefineAndOperator extends ShaderDefineExpression {isTrue(preprocessors) {return this.leftOperand.isTrue(preprocessors) && this.rightOperand.isTrue(preprocessors);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js
class ShaderDefineArithmeticOperator extends ShaderDefineExpression {constructor(define, operand, testValue) {super(), this.define = define, this.operand = operand, this.testValue = testValue;}isTrue(preprocessors) {let value = preprocessors[this.define];value === void 0 && (value = this.define);let condition = !1;const left = parseInt(value),right = parseInt(this.testValue);switch (this.operand) {case ">":condition = left > right;break;case "<":condition = left < right;break;case "<=":condition = left <= right;break;case ">=":condition = left >= right;break;case "==":condition = left === right;}return condition;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/devTools.js
var devTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/shaderLanguage.js
var shaderLanguage = __webpack_require__("./node_modules/@babylonjs/core/Materials/shaderLanguage.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js
const regexSE = /defined\s*?\((.+?)\)/g,regexSERevert = /defined\s*?\[(.+?)\]/g,regexShaderInclude = /#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g;class ShaderProcessor {static Initialize(options) {options.processor && options.processor.initializeShaders && options.processor.initializeShaders(options.processingContext);}static Process(sourceCode, options, callback, engine) {var _a;(null === (_a = options.processor) || void 0 === _a ? void 0 : _a.preProcessShaderCode) && (sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment)), this._ProcessIncludes(sourceCode, options, (codeWithIncludes) => {options.processCodeAfterIncludes && (codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? "fragment" : "vertex", codeWithIncludes));const migratedCode = this._ProcessShaderConversion(codeWithIncludes, options, engine);callback(migratedCode, codeWithIncludes);});}static PreProcess(sourceCode, options, callback, engine) {var _a;(null === (_a = options.processor) || void 0 === _a ? void 0 : _a.preProcessShaderCode) && (sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment)), this._ProcessIncludes(sourceCode, options, (codeWithIncludes) => {options.processCodeAfterIncludes && (codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? "fragment" : "vertex", codeWithIncludes));const migratedCode = this._ApplyPreProcessing(codeWithIncludes, options, engine);callback(migratedCode, codeWithIncludes);});}static Finalize(vertexCode, fragmentCode, options) {return options.processor && options.processor.finalizeShaders ? options.processor.finalizeShaders(vertexCode, fragmentCode, options.processingContext) : { vertexCode, fragmentCode };}static _ProcessPrecision(source, options) {var _a;if (null === (_a = options.processor) || void 0 === _a ? void 0 : _a.noPrecision) return source;const shouldUseHighPrecisionShader = options.shouldUseHighPrecisionShader;return -1 === source.indexOf("precision highp float") ? shouldUseHighPrecisionShader ? source = "precision highp float;\n" + source : source = "precision mediump float;\n" + source : !shouldUseHighPrecisionShader && (source = source.replace("precision highp float", "precision mediump float")), source;}static _ExtractOperation(expression) {const match = /defined\((.+)\)/.exec(expression);if (match && match.length) return new ShaderDefineIsDefinedOperator(match[1].trim(), "!" === expression[0]);const operators = ["==", ">=", "<=", "<", ">"];let operator = "",indexOperator = 0;for (operator of operators) if (indexOperator = expression.indexOf(operator), -1 < indexOperator) break;if (-1 === indexOperator) return new ShaderDefineIsDefinedOperator(expression);const define = expression.substring(0, indexOperator).trim(),value = expression.substring(indexOperator + operator.length).trim();return new ShaderDefineArithmeticOperator(define, operator, value);}static _BuildSubExpression(expression) {expression = expression.replace(regexSE, "defined[$1]");const postfix = ShaderDefineExpression.infixToPostfix(expression),stack = [];for (const c of postfix) if ("||" !== c && "&&" !== c) stack.push(c);else if (2 <= stack.length) {let v1 = stack[stack.length - 1],v2 = stack[stack.length - 2];stack.length -= 2;const operator = "&&" == c ? new ShaderDefineAndOperator() : new ShaderDefineOrOperator();"string" == typeof v1 && (v1 = v1.replace(regexSERevert, "defined($1)")), "string" == typeof v2 && (v2 = v2.replace(regexSERevert, "defined($1)")), operator.leftOperand = "string" == typeof v2 ? this._ExtractOperation(v2) : v2, operator.rightOperand = "string" == typeof v1 ? this._ExtractOperation(v1) : v1, stack.push(operator);}let result = stack[stack.length - 1];return "string" == typeof result && (result = result.replace(regexSERevert, "defined($1)")), "string" == typeof result ? this._ExtractOperation(result) : result;}static _BuildExpression(line, start) {const node = new ShaderCodeTestNode(),command = line.substring(0, start);let expression = line.substring(start);return expression = expression.substring(0, (expression.indexOf("//") + 1 || expression.length + 1) - 1).trim(), node.testExpression = "#ifdef" === command ? new ShaderDefineIsDefinedOperator(expression) : "#ifndef" === command ? new ShaderDefineIsDefinedOperator(expression, !0) : this._BuildSubExpression(expression), node;}static _MoveCursorWithinIf(cursor, rootNode, ifNode) {for (let line = cursor.currentLine; this._MoveCursor(cursor, ifNode);) {line = cursor.currentLine;const first5 = line.substring(0, 5).toLowerCase();if ("#else" === first5) {const elseNode = new ShaderCodeNode();return rootNode.children.push(elseNode), void this._MoveCursor(cursor, elseNode);}if ("#elif" === first5) {const elifNode = this._BuildExpression(line, 5);rootNode.children.push(elifNode), ifNode = elifNode;}}}static _MoveCursor(cursor, rootNode) {for (; cursor.canRead;) {cursor.lineIndex++;const line = cursor.currentLine,matches = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/.exec(line);if (matches && matches.length) {const keyword = matches[0];switch (keyword) {case "#ifdef":{const newRootNode = new ShaderCodeConditionNode();rootNode.children.push(newRootNode);const ifNode = this._BuildExpression(line, 6);newRootNode.children.push(ifNode), this._MoveCursorWithinIf(cursor, newRootNode, ifNode);break;}case "#else":case "#elif":return !0;case "#endif":return !1;case "#ifndef":{const newRootNode = new ShaderCodeConditionNode();rootNode.children.push(newRootNode);const ifNode = this._BuildExpression(line, 7);newRootNode.children.push(ifNode), this._MoveCursorWithinIf(cursor, newRootNode, ifNode);break;}case "#if":{const newRootNode = new ShaderCodeConditionNode(),ifNode = this._BuildExpression(line, 3);rootNode.children.push(newRootNode), newRootNode.children.push(ifNode), this._MoveCursorWithinIf(cursor, newRootNode, ifNode);break;}}} else {const newNode = new ShaderCodeNode();if (newNode.line = line, rootNode.children.push(newNode), "#" === line[0] && "d" === line[1]) {const split = line.replace(";", "").split(" ");newNode.additionalDefineKey = split[1], 3 === split.length && (newNode.additionalDefineValue = split[2]);}}}return !1;}static _EvaluatePreProcessors(sourceCode, preprocessors, options) {const rootNode = new ShaderCodeNode(),cursor = new ShaderCodeCursor();return cursor.lineIndex = -1, cursor.lines = sourceCode.split("\n"), this._MoveCursor(cursor, rootNode), rootNode.process(preprocessors, options);}static _PreparePreProcessors(options, engine) {var _a;const defines = options.defines,preprocessors = {};for (const define of defines) {const keyValue = define.replace("#define", "").replace(";", "").trim(),split = keyValue.split(" ");preprocessors[split[0]] = 1 < split.length ? split[1] : "";}return (null === (_a = options.processor) || void 0 === _a ? void 0 : _a.shaderLanguage) === shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL && (preprocessors.GL_ES = "true"), preprocessors.__VERSION__ = options.version, preprocessors[options.platformName] = "true", engine._getGlobalDefines(preprocessors), preprocessors;}static _ProcessShaderConversion(sourceCode, options, engine) {let preparedSourceCode = this._ProcessPrecision(sourceCode, options);if (!options.processor) return preparedSourceCode;if (options.processor.shaderLanguage === shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL && -1 !== preparedSourceCode.indexOf("#version 3") && (preparedSourceCode = preparedSourceCode.replace("#version 300 es", ""), !options.processor.parseGLES3)) return preparedSourceCode;const defines = options.defines,preprocessors = this._PreparePreProcessors(options, engine);return options.processor.preProcessor && (preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext)), preparedSourceCode = this._EvaluatePreProcessors(preparedSourceCode, preprocessors, options), options.processor.postProcessor && (preparedSourceCode = options.processor.postProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext, engine)), engine._features.needShaderCodeInlining && (preparedSourceCode = engine.inlineShaderCode(preparedSourceCode)), preparedSourceCode;}static _ApplyPreProcessing(sourceCode, options, engine) {var _a, _b;let preparedSourceCode = sourceCode;const defines = options.defines,preprocessors = this._PreparePreProcessors(options, engine);return (null === (_a = options.processor) || void 0 === _a ? void 0 : _a.preProcessor) && (preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext)), preparedSourceCode = this._EvaluatePreProcessors(preparedSourceCode, preprocessors, options), (null === (_b = options.processor) || void 0 === _b ? void 0 : _b.postProcessor) && (preparedSourceCode = options.processor.postProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext, engine)), engine._features.needShaderCodeInlining && (preparedSourceCode = engine.inlineShaderCode(preparedSourceCode)), preparedSourceCode;}static _ProcessIncludes(sourceCode, options, callback) {let match = regexShaderInclude.exec(sourceCode),returnValue = new String(sourceCode),keepProcessing = !1;for (; null != match;) {let includeFile = match[1];if (-1 !== includeFile.indexOf("__decl__") && (includeFile = includeFile.replace(/__decl__/, ""), options.supportsUniformBuffers && (includeFile = includeFile.replace(/Vertex/, "Ubo"), includeFile = includeFile.replace(/Fragment/, "Ubo")), includeFile += "Declaration"), options.includesShadersStore[includeFile]) {let includeContent = options.includesShadersStore[includeFile];if (match[2]) {const splits = match[3].split(",");for (let index = 0; index < splits.length; index += 2) {const source = new RegExp(splits[index], "g"),dest = splits[index + 1];includeContent = includeContent.replace(source, dest);}}if (match[4]) {const indexString = match[5];if (-1 !== indexString.indexOf("..")) {const indexSplits = indexString.split(".."),minIndex = parseInt(indexSplits[0]);let maxIndex = parseInt(indexSplits[1]),sourceIncludeContent = includeContent.slice(0);includeContent = "", isNaN(maxIndex) && (maxIndex = options.indexParameters[indexSplits[1]]);for (let i = minIndex; i < maxIndex; i++) options.supportsUniformBuffers || (sourceIncludeContent = sourceIncludeContent.replace(/light\{X\}.(\w*)/g, (str, p1) => p1 + "{X}")), includeContent += sourceIncludeContent.replace(/\{X\}/g, i.toString()) + "\n";} else options.supportsUniformBuffers || (includeContent = includeContent.replace(/light\{X\}.(\w*)/g, (str, p1) => p1 + "{X}")), includeContent = includeContent.replace(/\{X\}/g, indexString);}returnValue = returnValue.replace(match[0], includeContent), keepProcessing = keepProcessing || 0 <= includeContent.indexOf("#include<") || 0 <= includeContent.indexOf("#include <");} else {const includeShaderUrl = options.shadersRepository + "ShadersInclude/" + includeFile + ".fx";return void ShaderProcessor._FileToolsLoadFile(includeShaderUrl, (fileContent) => {options.includesShadersStore[includeFile] = fileContent, this._ProcessIncludes(returnValue, options, callback);});}match = regexShaderInclude.exec(sourceCode);}keepProcessing ? this._ProcessIncludes(returnValue.toString(), options, callback) : callback(returnValue);}static _FileToolsLoadFile() {throw (0,devTools/* _WarnImport */.S)("FileTools");}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/WebGL/webGL2ShaderProcessors.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "C": () => (/* binding */ WebGL2ShaderProcessor)
/* harmony export */ });
/* harmony import */ var _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/shaderLanguage.js");
class WebGL2ShaderProcessor {constructor() {this.shaderLanguage = _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderLanguage.GLSL */ .x.GLSL;}attributeProcessor(attribute) {return attribute.replace("attribute", "in");}varyingProcessor(varying, isFragment) {return varying.replace("varying", isFragment ? "in" : "out");}postProcessor(code, defines, isFragment) {const hasDrawBuffersExtension = -1 !== code.search(/#extension.+GL_EXT_draw_buffers.+require/);if (code = code.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g, ""), code = code.replace(/texture2D\s*\(/g, "texture("), isFragment) code = code.replace(/texture2DLodEXT\s*\(/g, "textureLod("), code = code.replace(/textureCubeLodEXT\s*\(/g, "textureLod("), code = code.replace(/textureCube\s*\(/g, "texture("), code = code.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), code = code.replace(/gl_FragColor/g, "glFragColor"), code = code.replace(/gl_FragData/g, "glFragData"), code = code.replace(/void\s+?main\s*\(/g, (hasDrawBuffersExtension ? "" : "layout(location = 0) out vec4 glFragColor;\n") + "void main(");else {const hasMultiviewExtension = -1 !== defines.indexOf("#define MULTIVIEW");if (hasMultiviewExtension) return "#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n" + code;}return code;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "B": () => (/* binding */ WebGLHardwareTexture)
/* harmony export */ });
class WebGLHardwareTexture {get underlyingResource() {return this._webGLTexture;}constructor(existingTexture = null, context) {if (this._MSAARenderBuffer = null, this._context = context, !existingTexture && (existingTexture = context.createTexture(), !existingTexture)) throw new Error("Unable to create webGL texture");this.set(existingTexture);}setUsage() {}set(hardwareTexture) {this._webGLTexture = hardwareTexture;}reset() {this._webGLTexture = null, this._MSAARenderBuffer = null;}release() {this._MSAARenderBuffer && (this._context.deleteRenderbuffer(this._MSAARenderBuffer), this._MSAARenderBuffer = null), this._webGLTexture && this._context.deleteTexture(this._webGLTexture), this.reset();}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/WebGL/webGLPipelineContext.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "y": () => (/* binding */ WebGLPipelineContext)
/* harmony export */ });
const floatNCache = ["Int", "Int2", "Int3", "Int4", "UInt", "UInt2", "UInt3", "UInt4", "Vector2", "Vector3", "Vector4", "Float2", "Float", "Float3", "Float4", "Quaternion", "Color3", "Color4", "DirectColor4"];class WebGLPipelineContext {constructor() {this._valueCache = {}, this.vertexCompilationError = null, this.fragmentCompilationError = null, this.programLinkError = null, this.programValidationError = null;const args = [],prepareArray = function () {args.length = 0, Array.prototype.push.apply(args, arguments), args[0] = this._uniforms[args[0]];},proxyFunction = (functionName) => {const cacheFunction = floatNCache.includes(functionName.substring(3)) && "FloatN";if (cacheFunction) {const cacheFunc = this[`_cache${cacheFunction}`];return function () {const func = this.engine[functionName];prepareArray.apply(this, arguments), cacheFunc.apply(this, arguments) && !func.apply(this.engine, args) && (this._valueCache[arguments[0]] = null);};}return function () {const func = this.engine[functionName];prepareArray.apply(this, arguments), void 0 !== arguments[1] && (this._valueCache[arguments[0]] = null, func.apply(this.engine, args));};};["Int?", "UInt?", "IntArray?", "UIntArray?", "Array?", "Float?", "Matrices", "Matrix3x3", "Matrix2x2"].forEach((functionName) => {const name = `set${functionName}`;this[name] || (name.endsWith("?") ? ["", 2, 3, 4].forEach((n) => {this[name.slice(0, -1) + n] = this[name.slice(0, -1) + n] || proxyFunction(name.slice(0, -1) + n).bind(this);}) : this[name] = this[name] || proxyFunction(name).bind(this));});}get isAsync() {return this.isParallelCompiled;}get isReady() {return !!this.program && (!this.isParallelCompiled || this.engine._isRenderingStateCompiled(this));}_handlesSpectorRebuildCallback(onCompiled) {onCompiled && this.program && onCompiled(this.program);}_fillEffectInformation(effect, uniformBuffersNames, uniformsNames, uniforms, samplerList, samplers, attributesNames, attributes) {const engine = this.engine;if (engine.supportsUniformBuffers) for (const name in uniformBuffersNames) effect.bindUniformBlock(name, uniformBuffersNames[name]);const effectAvailableUniforms = this.engine.getUniforms(this, uniformsNames);effectAvailableUniforms.forEach((uniform, index) => {uniforms[uniformsNames[index]] = uniform;}), this._uniforms = uniforms;let index;for (index = 0; index < samplerList.length; index++) {const sampler = effect.getUniform(samplerList[index]);null == sampler && (samplerList.splice(index, 1), index--);}samplerList.forEach((name, index) => {samplers[name] = index;});for (const attr of engine.getAttributes(this, attributesNames)) attributes.push(attr);}dispose() {this._uniforms = {};}_cacheMatrix(uniformName, matrix) {const cache = this._valueCache[uniformName],flag = matrix.updateFlag;return (void 0 === cache || cache !== flag) && (this._valueCache[uniformName] = flag, !0);}_cacheFloatN() {let cache = this._valueCache[arguments[0]];if (!cache || cache.length !== arguments.length - 1) return cache = Array.prototype.slice.call(arguments, 1), this._valueCache[arguments[0]] = cache, !0;let changed = !1;for (let i = 0; i < cache.length; ++i) cache[i] !== arguments[i + 1] && (cache[i] = arguments[i + 1], changed = !0);return changed;}_cacheFloat2(uniformName, x, y) {return this._cacheFloatN(uniformName, x, y);}_cacheFloat3(uniformName, x, y, z) {return this._cacheFloatN(uniformName, x, y, z);}_cacheFloat4(uniformName, x, y, z, w) {return this._cacheFloatN(uniformName, x, y, z, w);}setMatrix(uniformName, matrix) {this._cacheMatrix(uniformName, matrix) && !this.engine.setMatrices(this._uniforms[uniformName], matrix.toArray()) && (this._valueCache[uniformName] = null);}setVector2(uniformName, vector2) {this.setFloat2(uniformName, vector2.x, vector2.y);}setVector3(uniformName, vector3) {this.setFloat3(uniformName, vector3.x, vector3.y, vector3.z);}setVector4(uniformName, vector4) {this.setFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w);}setQuaternion(uniformName, quaternion) {this.setFloat4(uniformName, quaternion.x, quaternion.y, quaternion.z, quaternion.w);}setColor3(uniformName, color3) {this.setFloat3(uniformName, color3.r, color3.g, color3.b);}setColor4(uniformName, color3, alpha) {this.setFloat4(uniformName, color3.r, color3.g, color3.b, alpha);}setDirectColor4(uniformName, color4) {this.setFloat4(uniformName, color4.r, color4.g, color4.b, color4.a);}_getVertexShaderCode() {return this.vertexShader ? this.engine._getShaderSource(this.vertexShader) : null;}_getFragmentShaderCode() {return this.fragmentShader ? this.engine._getShaderSource(this.fragmentShader) : null;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/constants.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "g": () => (/* binding */ Constants)
/* harmony export */ });
class Constants {}Constants.ALPHA_DISABLE = 0, Constants.ALPHA_ADD = 1, Constants.ALPHA_COMBINE = 2, Constants.ALPHA_SUBTRACT = 3, Constants.ALPHA_MULTIPLY = 4, Constants.ALPHA_MAXIMIZED = 5, Constants.ALPHA_ONEONE = 6, Constants.ALPHA_PREMULTIPLIED = 7, Constants.ALPHA_PREMULTIPLIED_PORTERDUFF = 8, Constants.ALPHA_INTERPOLATE = 9, Constants.ALPHA_SCREENMODE = 10, Constants.ALPHA_ONEONE_ONEONE = 11, Constants.ALPHA_ALPHATOCOLOR = 12, Constants.ALPHA_REVERSEONEMINUS = 13, Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA = 14, Constants.ALPHA_ONEONE_ONEZERO = 15, Constants.ALPHA_EXCLUSION = 16, Constants.ALPHA_LAYER_ACCUMULATE = 17, Constants.ALPHA_EQUATION_ADD = 0, Constants.ALPHA_EQUATION_SUBSTRACT = 1, Constants.ALPHA_EQUATION_REVERSE_SUBTRACT = 2, Constants.ALPHA_EQUATION_MAX = 3, Constants.ALPHA_EQUATION_MIN = 4, Constants.ALPHA_EQUATION_DARKEN = 5, Constants.DELAYLOADSTATE_NONE = 0, Constants.DELAYLOADSTATE_LOADED = 1, Constants.DELAYLOADSTATE_LOADING = 2, Constants.DELAYLOADSTATE_NOTLOADED = 4, Constants.NEVER = 512, Constants.ALWAYS = 519, Constants.LESS = 513, Constants.EQUAL = 514, Constants.LEQUAL = 515, Constants.GREATER = 516, Constants.GEQUAL = 518, Constants.NOTEQUAL = 517, Constants.KEEP = 7680, Constants.ZERO = 0, Constants.REPLACE = 7681, Constants.INCR = 7682, Constants.DECR = 7683, Constants.INVERT = 5386, Constants.INCR_WRAP = 34055, Constants.DECR_WRAP = 34056, Constants.TEXTURE_CLAMP_ADDRESSMODE = 0, Constants.TEXTURE_WRAP_ADDRESSMODE = 1, Constants.TEXTURE_MIRROR_ADDRESSMODE = 2, Constants.TEXTURE_CREATIONFLAG_STORAGE = 1, Constants.TEXTUREFORMAT_ALPHA = 0, Constants.TEXTUREFORMAT_LUMINANCE = 1, Constants.TEXTUREFORMAT_LUMINANCE_ALPHA = 2, Constants.TEXTUREFORMAT_RGB = 4, Constants.TEXTUREFORMAT_RGBA = 5, Constants.TEXTUREFORMAT_RED = 6, Constants.TEXTUREFORMAT_R = 6, Constants.TEXTUREFORMAT_RG = 7, Constants.TEXTUREFORMAT_RED_INTEGER = 8, Constants.TEXTUREFORMAT_R_INTEGER = 8, Constants.TEXTUREFORMAT_RG_INTEGER = 9, Constants.TEXTUREFORMAT_RGB_INTEGER = 10, Constants.TEXTUREFORMAT_RGBA_INTEGER = 11, Constants.TEXTUREFORMAT_BGRA = 12, Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 = 13, Constants.TEXTUREFORMAT_DEPTH32_FLOAT = 14, Constants.TEXTUREFORMAT_DEPTH16 = 15, Constants.TEXTUREFORMAT_DEPTH24 = 16, Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8 = 17, Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8 = 18, Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM = 36492, Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 36493, Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 36495, Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 36494, Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5 = 33779, Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919, Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3 = 33778, Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918, Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1 = 33777, Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1 = 33776, Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917, Constants.TEXTUREFORMAT_COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916, Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4 = 37808, Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840, Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL = 36196, Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2 = 37492, Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ETC2 = 37493, Constants.TEXTUREFORMAT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494, Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495, Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC = 37496, Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497, Constants.TEXTURETYPE_UNSIGNED_BYTE = 0, Constants.TEXTURETYPE_UNSIGNED_INT = 0, Constants.TEXTURETYPE_FLOAT = 1, Constants.TEXTURETYPE_HALF_FLOAT = 2, Constants.TEXTURETYPE_BYTE = 3, Constants.TEXTURETYPE_SHORT = 4, Constants.TEXTURETYPE_UNSIGNED_SHORT = 5, Constants.TEXTURETYPE_INT = 6, Constants.TEXTURETYPE_UNSIGNED_INTEGER = 7, Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8, Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9, Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10, Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11, Constants.TEXTURETYPE_UNSIGNED_INT_24_8 = 12, Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13, Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14, Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15, Constants.TEXTURETYPE_UNDEFINED = 16, Constants.TEXTURE_NEAREST_SAMPLINGMODE = 1, Constants.TEXTURE_NEAREST_NEAREST = 1, Constants.TEXTURE_BILINEAR_SAMPLINGMODE = 2, Constants.TEXTURE_LINEAR_LINEAR = 2, Constants.TEXTURE_TRILINEAR_SAMPLINGMODE = 3, Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3, Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4, Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5, Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6, Constants.TEXTURE_NEAREST_LINEAR = 7, Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8, Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9, Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10, Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11, Constants.TEXTURE_LINEAR_NEAREST = 12, Constants.TEXTURE_EXPLICIT_MODE = 0, Constants.TEXTURE_SPHERICAL_MODE = 1, Constants.TEXTURE_PLANAR_MODE = 2, Constants.TEXTURE_CUBIC_MODE = 3, Constants.TEXTURE_PROJECTION_MODE = 4, Constants.TEXTURE_SKYBOX_MODE = 5, Constants.TEXTURE_INVCUBIC_MODE = 6, Constants.TEXTURE_EQUIRECTANGULAR_MODE = 7, Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8, Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9, Constants.TEXTURE_FILTERING_QUALITY_OFFLINE = 4096, Constants.TEXTURE_FILTERING_QUALITY_HIGH = 64, Constants.TEXTURE_FILTERING_QUALITY_MEDIUM = 16, Constants.TEXTURE_FILTERING_QUALITY_LOW = 8, Constants.SCALEMODE_FLOOR = 1, Constants.SCALEMODE_NEAREST = 2, Constants.SCALEMODE_CEILING = 3, Constants.MATERIAL_TextureDirtyFlag = 1, Constants.MATERIAL_LightDirtyFlag = 2, Constants.MATERIAL_FresnelDirtyFlag = 4, Constants.MATERIAL_AttributesDirtyFlag = 8, Constants.MATERIAL_MiscDirtyFlag = 16, Constants.MATERIAL_PrePassDirtyFlag = 32, Constants.MATERIAL_AllDirtyFlag = 63, Constants.MATERIAL_TriangleFillMode = 0, Constants.MATERIAL_WireFrameFillMode = 1, Constants.MATERIAL_PointFillMode = 2, Constants.MATERIAL_PointListDrawMode = 3, Constants.MATERIAL_LineListDrawMode = 4, Constants.MATERIAL_LineLoopDrawMode = 5, Constants.MATERIAL_LineStripDrawMode = 6, Constants.MATERIAL_TriangleStripDrawMode = 7, Constants.MATERIAL_TriangleFanDrawMode = 8, Constants.MATERIAL_ClockWiseSideOrientation = 0, Constants.MATERIAL_CounterClockWiseSideOrientation = 1, Constants.ACTION_NothingTrigger = 0, Constants.ACTION_OnPickTrigger = 1, Constants.ACTION_OnLeftPickTrigger = 2, Constants.ACTION_OnRightPickTrigger = 3, Constants.ACTION_OnCenterPickTrigger = 4, Constants.ACTION_OnPickDownTrigger = 5, Constants.ACTION_OnDoublePickTrigger = 6, Constants.ACTION_OnPickUpTrigger = 7, Constants.ACTION_OnPickOutTrigger = 16, Constants.ACTION_OnLongPressTrigger = 8, Constants.ACTION_OnPointerOverTrigger = 9, Constants.ACTION_OnPointerOutTrigger = 10, Constants.ACTION_OnEveryFrameTrigger = 11, Constants.ACTION_OnIntersectionEnterTrigger = 12, Constants.ACTION_OnIntersectionExitTrigger = 13, Constants.ACTION_OnKeyDownTrigger = 14, Constants.ACTION_OnKeyUpTrigger = 15, Constants.PARTICLES_BILLBOARDMODE_Y = 2, Constants.PARTICLES_BILLBOARDMODE_ALL = 7, Constants.PARTICLES_BILLBOARDMODE_STRETCHED = 8, Constants.PARTICLES_BILLBOARDMODE_STRETCHED_LOCAL = 9, Constants.MESHES_CULLINGSTRATEGY_STANDARD = 0, Constants.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1, Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2, Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3, Constants.SCENELOADER_NO_LOGGING = 0, Constants.SCENELOADER_MINIMAL_LOGGING = 1, Constants.SCENELOADER_SUMMARY_LOGGING = 2, Constants.SCENELOADER_DETAILED_LOGGING = 3, Constants.PREPASS_IRRADIANCE_TEXTURE_TYPE = 0, Constants.PREPASS_POSITION_TEXTURE_TYPE = 1, Constants.PREPASS_VELOCITY_TEXTURE_TYPE = 2, Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE = 3, Constants.PREPASS_COLOR_TEXTURE_TYPE = 4, Constants.PREPASS_DEPTH_TEXTURE_TYPE = 5, Constants.PREPASS_NORMAL_TEXTURE_TYPE = 6, Constants.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE = 7, Constants.BUFFER_CREATIONFLAG_READ = 1, Constants.BUFFER_CREATIONFLAG_WRITE = 2, Constants.BUFFER_CREATIONFLAG_READWRITE = 3, Constants.BUFFER_CREATIONFLAG_UNIFORM = 4, Constants.BUFFER_CREATIONFLAG_VERTEX = 8, Constants.BUFFER_CREATIONFLAG_INDEX = 16, Constants.BUFFER_CREATIONFLAG_STORAGE = 32, Constants.RENDERPASS_MAIN = 0, Constants.INPUT_ALT_KEY = 18, Constants.INPUT_CTRL_KEY = 17, Constants.INPUT_META_KEY1 = 91, Constants.INPUT_META_KEY2 = 92, Constants.INPUT_META_KEY3 = 93, Constants.INPUT_SHIFT_KEY = 16, Constants.SNAPSHOTRENDERING_STANDARD = 0, Constants.SNAPSHOTRENDERING_FAST = 1, Constants.PERSPECTIVE_CAMERA = 0, Constants.ORTHOGRAPHIC_CAMERA = 1, Constants.FOVMODE_VERTICAL_FIXED = 0, Constants.FOVMODE_HORIZONTAL_FIXED = 1, Constants.RIG_MODE_NONE = 0, Constants.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10, Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11, Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12, Constants.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13, Constants.RIG_MODE_STEREOSCOPIC_INTERLACED = 14, Constants.RIG_MODE_VR = 20, Constants.RIG_MODE_WEBVR = 21, Constants.RIG_MODE_CUSTOM = 22, Constants.MAX_SUPPORTED_UV_SETS = 6, Constants.GL_ALPHA_EQUATION_ADD = 32774, Constants.GL_ALPHA_EQUATION_MIN = 32775, Constants.GL_ALPHA_EQUATION_MAX = 32776, Constants.GL_ALPHA_EQUATION_SUBTRACT = 32778, Constants.GL_ALPHA_EQUATION_REVERSE_SUBTRACT = 32779, Constants.GL_ALPHA_FUNCTION_SRC = 768, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR = 769, Constants.GL_ALPHA_FUNCTION_SRC_ALPHA = 770, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA = 771, Constants.GL_ALPHA_FUNCTION_DST_ALPHA = 772, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA = 773, Constants.GL_ALPHA_FUNCTION_DST_COLOR = 774, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR = 775, Constants.GL_ALPHA_FUNCTION_SRC_ALPHA_SATURATED = 776, Constants.GL_ALPHA_FUNCTION_CONSTANT_COLOR = 32769, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR = 32770, Constants.GL_ALPHA_FUNCTION_CONSTANT_ALPHA = 32771, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA = 32772, Constants.SnippetUrl = "https://snippet.babylonjs.com";

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/engine.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "D": () => (/* binding */ Engine)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
/* harmony import */ var _Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
/* harmony import */ var _engineStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
/* harmony import */ var _thinEngine_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
/* harmony import */ var _Misc_performanceMonitor_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/performanceMonitor.js");
/* harmony import */ var _Misc_perfCounter_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/perfCounter.js");
/* harmony import */ var _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _WebGL_webGLHardwareTexture_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.js");
/* harmony import */ var _Extensions_engine_alpha_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.alpha.js");
/* harmony import */ var _Extensions_engine_readTexture_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.readTexture.js");
/* harmony import */ var _Extensions_engine_dynamicBuffer_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicBuffer.js");
class Engine extends _thinEngine_js__WEBPACK_IMPORTED_MODULE_5__/* .ThinEngine */ .B {static get NpmPackage() {return _thinEngine_js__WEBPACK_IMPORTED_MODULE_5__/* .ThinEngine.NpmPackage */ .B.NpmPackage;}static get Version() {return _thinEngine_js__WEBPACK_IMPORTED_MODULE_5__/* .ThinEngine.Version */ .B.Version;}static get Instances() {return _engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore.Instances */ .l.Instances;}static get LastCreatedEngine() {return _engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore.LastCreatedEngine */ .l.LastCreatedEngine;}static get LastCreatedScene() {return _engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene;}_createImageBitmapFromSource(imageSource, options) {const promise = new Promise((resolve, reject) => {const image = new Image();image.onload = () => {image.decode().then(() => {this.createImageBitmap(image, options).then((imageBitmap) => {resolve(imageBitmap);});});}, image.onerror = () => {reject(`Error loading image ${image.src}`);}, image.src = imageSource;});return promise;}createImageBitmap(image, options) {return createImageBitmap(image, options);}resizeImageBitmap(image, bufferWidth, bufferHeight) {const canvas = this.createCanvas(bufferWidth, bufferHeight),context = canvas.getContext("2d");if (!context) throw new Error("Unable to get 2d context for resizeImageBitmap");context.drawImage(image, 0, 0);const buffer = context.getImageData(0, 0, bufferWidth, bufferHeight).data;return buffer;}static MarkAllMaterialsAsDirty(flag, predicate) {for (let engineIndex = 0; engineIndex < Engine.Instances.length; engineIndex++) {const engine = Engine.Instances[engineIndex];for (let sceneIndex = 0; sceneIndex < engine.scenes.length; sceneIndex++) engine.scenes[sceneIndex].markAllMaterialsAsDirty(flag, predicate);}}static DefaultLoadingScreenFactory() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_4__/* ._WarnImport */ .S)("LoadingScreen");}get _supportsHardwareTextureRescaling() {return !!Engine._RescalePostProcessFactory;}get performanceMonitor() {return this._performanceMonitor;}get compatibilityMode() {return this._compatibilityMode;}set compatibilityMode(mode) {this._compatibilityMode = !0;}getInputElement() {return this._renderingCanvas;}constructor(canvasOrContext, antialias, options, adaptToDeviceRatio = !1) {if (super(canvasOrContext, antialias, options, adaptToDeviceRatio), this.enableOfflineSupport = !1, this.disableManifestCheck = !1, this.disableContextMenu = !0, this.scenes = [], this._virtualScenes = [], this.onNewSceneAddedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.postProcesses = [], this.isPointerLock = !1, this.onResizeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onCanvasBlurObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onCanvasFocusObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onCanvasPointerOutObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onBeginFrameObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.customAnimationFrameRequester = null, this.onEndFrameObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onBeforeShaderCompilationObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onAfterShaderCompilationObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this._deterministicLockstep = !1, this._lockstepMaxSteps = 4, this._timeStep = 1 / 60, this._fps = 60, this._deltaTime = 0, this._drawCalls = new _Misc_perfCounter_js__WEBPACK_IMPORTED_MODULE_7__/* .PerfCounter */ .z(), this.canvasTabIndex = 1, this.disablePerformanceMonitorInBackground = !1, this._performanceMonitor = new _Misc_performanceMonitor_js__WEBPACK_IMPORTED_MODULE_6__/* .PerformanceMonitor */ .A(), this._compatibilityMode = !0, this.currentRenderPassId = 0, this._renderPassNames = ["main"], Engine.Instances.push(this), !!canvasOrContext) {if (this._features.supportRenderPasses = !0, options = this._creationOptions, canvasOrContext.getContext) {const canvas = canvasOrContext;this._sharedInit(canvas, !!options.doNotHandleTouchAction, options.audioEngine), (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_2__/* .IsDocumentAvailable */ .n5)() && (this._onFullscreenChange = () => {this.isFullscreen = !!document.fullscreenElement, this.isFullscreen && this._pointerLockRequested && canvas && Engine._RequestPointerlock(canvas);}, document.addEventListener("fullscreenchange", this._onFullscreenChange, !1), document.addEventListener("webkitfullscreenchange", this._onFullscreenChange, !1), this._onPointerLockChange = () => {this.isPointerLock = document.pointerLockElement === canvas;}, document.addEventListener("pointerlockchange", this._onPointerLockChange, !1), document.addEventListener("webkitpointerlockchange", this._onPointerLockChange, !1), !Engine.audioEngine && options.audioEngine && Engine.AudioEngineFactory && (Engine.audioEngine = Engine.AudioEngineFactory(this.getRenderingCanvas(), this.getAudioContext(), this.getAudioDestination()))), this._connectVREvents(), this.enableOfflineSupport = void 0 !== Engine.OfflineProviderFactory, this._deterministicLockstep = !!options.deterministicLockstep, this._lockstepMaxSteps = options.lockstepMaxSteps || 0, this._timeStep = options.timeStep || 1 / 60;}this._prepareVRComponent(), options.autoEnableWebVR && this.initWebVR();}}_initGLContext() {super._initGLContext(), this._rescalePostProcess = null;}_sharedInit(canvas, doNotHandleTouchAction, audioEngine) {super._sharedInit(canvas, doNotHandleTouchAction, audioEngine), this._onCanvasFocus = () => {this.onCanvasFocusObservable.notifyObservers(this);}, this._onCanvasBlur = () => {this.onCanvasBlurObservable.notifyObservers(this);}, this._onCanvasContextMenu = (evt) => {this.disableContextMenu && evt.preventDefault();}, canvas.addEventListener("focus", this._onCanvasFocus), canvas.addEventListener("blur", this._onCanvasBlur), canvas.addEventListener("contextmenu", this._onCanvasContextMenu), this._onBlur = () => {this.disablePerformanceMonitorInBackground && this._performanceMonitor.disable(), this._windowIsBackground = !0;}, this._onFocus = () => {this.disablePerformanceMonitorInBackground && this._performanceMonitor.enable(), this._windowIsBackground = !1;}, this._onCanvasPointerOut = (ev) => {document.elementFromPoint(ev.clientX, ev.clientY) !== canvas && this.onCanvasPointerOutObservable.notifyObservers(ev);};const hostWindow = this.getHostWindow();hostWindow && "function" == typeof hostWindow.addEventListener && (hostWindow.addEventListener("blur", this._onBlur), hostWindow.addEventListener("focus", this._onFocus)), canvas.addEventListener("pointerout", this._onCanvasPointerOut), doNotHandleTouchAction || this._disableTouchAction(), !Engine.audioEngine && audioEngine && Engine.AudioEngineFactory && (Engine.audioEngine = Engine.AudioEngineFactory(this.getRenderingCanvas(), this.getAudioContext(), this.getAudioDestination()));}getAspectRatio(viewportOwner, useScreen = !1) {const viewport = viewportOwner.viewport;return this.getRenderWidth(useScreen) * viewport.width / (this.getRenderHeight(useScreen) * viewport.height);}getScreenAspectRatio() {return this.getRenderWidth(!0) / this.getRenderHeight(!0);}getRenderingCanvasClientRect() {return this._renderingCanvas ? this._renderingCanvas.getBoundingClientRect() : null;}getInputElementClientRect() {return this._renderingCanvas ? this.getInputElement().getBoundingClientRect() : null;}isDeterministicLockStep() {return this._deterministicLockstep;}getLockstepMaxSteps() {return this._lockstepMaxSteps;}getTimeStep() {return 1e3 * this._timeStep;}generateMipMapsForCubemap(texture, unbind = !0) {if (texture.generateMipMaps) {const gl = this._gl;this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, !0), gl.generateMipmap(gl.TEXTURE_CUBE_MAP), unbind && this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);}}getDepthWrite() {return this._depthCullingState.depthMask;}setDepthWrite(enable) {this._depthCullingState.depthMask = enable;}getStencilBuffer() {return this._stencilState.stencilTest;}setStencilBuffer(enable) {this._stencilState.stencilTest = enable;}getStencilMask() {return this._stencilState.stencilMask;}setStencilMask(mask) {this._stencilState.stencilMask = mask;}getStencilFunction() {return this._stencilState.stencilFunc;}getStencilFunctionReference() {return this._stencilState.stencilFuncRef;}getStencilFunctionMask() {return this._stencilState.stencilFuncMask;}setStencilFunction(stencilFunc) {this._stencilState.stencilFunc = stencilFunc;}setStencilFunctionReference(reference) {this._stencilState.stencilFuncRef = reference;}setStencilFunctionMask(mask) {this._stencilState.stencilFuncMask = mask;}getStencilOperationFail() {return this._stencilState.stencilOpStencilFail;}getStencilOperationDepthFail() {return this._stencilState.stencilOpDepthFail;}getStencilOperationPass() {return this._stencilState.stencilOpStencilDepthPass;}setStencilOperationFail(operation) {this._stencilState.stencilOpStencilFail = operation;}setStencilOperationDepthFail(operation) {this._stencilState.stencilOpDepthFail = operation;}setStencilOperationPass(operation) {this._stencilState.stencilOpStencilDepthPass = operation;}setDitheringState(value) {value ? this._gl.enable(this._gl.DITHER) : this._gl.disable(this._gl.DITHER);}setRasterizerState(value) {value ? this._gl.disable(this._gl.RASTERIZER_DISCARD) : this._gl.enable(this._gl.RASTERIZER_DISCARD);}getDepthFunction() {return this._depthCullingState.depthFunc;}setDepthFunction(depthFunc) {this._depthCullingState.depthFunc = depthFunc;}setDepthFunctionToGreater() {this.setDepthFunction(516);}setDepthFunctionToGreaterOrEqual() {this.setDepthFunction(518);}setDepthFunctionToLess() {this.setDepthFunction(513);}setDepthFunctionToLessOrEqual() {this.setDepthFunction(515);}cacheStencilState() {this._cachedStencilBuffer = this.getStencilBuffer(), this._cachedStencilFunction = this.getStencilFunction(), this._cachedStencilMask = this.getStencilMask(), this._cachedStencilOperationPass = this.getStencilOperationPass(), this._cachedStencilOperationFail = this.getStencilOperationFail(), this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail(), this._cachedStencilReference = this.getStencilFunctionReference();}restoreStencilState() {this.setStencilFunction(this._cachedStencilFunction), this.setStencilMask(this._cachedStencilMask), this.setStencilBuffer(this._cachedStencilBuffer), this.setStencilOperationPass(this._cachedStencilOperationPass), this.setStencilOperationFail(this._cachedStencilOperationFail), this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail), this.setStencilFunctionReference(this._cachedStencilReference);}setDirectViewport(x, y, width, height) {const currentViewport = this._cachedViewport;return this._cachedViewport = null, this._viewport(x, y, width, height), currentViewport;}scissorClear(x, y, width, height, clearColor) {this.enableScissor(x, y, width, height), this.clear(clearColor, !0, !0, !0), this.disableScissor();}enableScissor(x, y, width, height) {const gl = this._gl;gl.enable(gl.SCISSOR_TEST), gl.scissor(x, y, width, height);}disableScissor() {const gl = this._gl;gl.disable(gl.SCISSOR_TEST);}_reportDrawCall(numDrawCalls = 1) {this._drawCalls.addCount(numDrawCalls, !1);}initWebVR() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_4__/* ._WarnImport */ .S)("WebVRCamera");}_prepareVRComponent() {}_connectVREvents() {}_submitVRFrame() {}disableVR() {}isVRPresenting() {return !1;}_requestVRFrame() {}_loadFileAsync(url, offlineProvider, useArrayBuffer) {return new Promise((resolve, reject) => {this._loadFile(url, (data) => {resolve(data);}, void 0, offlineProvider, useArrayBuffer, (request, exception) => {reject(exception);});});}getVertexShaderSource(program) {const shaders = this._gl.getAttachedShaders(program);return shaders ? this._gl.getShaderSource(shaders[0]) : null;}getFragmentShaderSource(program) {const shaders = this._gl.getAttachedShaders(program);return shaders ? this._gl.getShaderSource(shaders[1]) : null;}setDepthStencilTexture(channel, uniform, texture, name) {void 0 === channel || (uniform && (this._boundUniforms[channel] = uniform), texture && texture.depthStencilTexture ? this._setTexture(channel, texture, !1, !0, name) : this._setTexture(channel, null, void 0, void 0, name));}setTextureFromPostProcess(channel, postProcess, name) {var _a;let postProcessInput = null;postProcess && (postProcess._textures.data[postProcess._currentRenderTextureInd] ? postProcessInput = postProcess._textures.data[postProcess._currentRenderTextureInd] : postProcess._forcedOutputTexture && (postProcessInput = postProcess._forcedOutputTexture)), this._bindTexture(channel, null !== (_a = null === postProcessInput || void 0 === postProcessInput ? void 0 : postProcessInput.texture) && void 0 !== _a ? _a : null, name);}setTextureFromPostProcessOutput(channel, postProcess, name) {var _a, _b;this._bindTexture(channel, null !== (_b = null === (_a = null === postProcess || void 0 === postProcess ? void 0 : postProcess._outputTexture) || void 0 === _a ? void 0 : _a.texture) && void 0 !== _b ? _b : null, name);}_rebuildBuffers() {for (const scene of this.scenes) scene.resetCachedMaterial(), scene._rebuildGeometries(), scene._rebuildTextures();for (const scene of this._virtualScenes) scene.resetCachedMaterial(), scene._rebuildGeometries(), scene._rebuildTextures();super._rebuildBuffers();}_renderFrame() {for (let index = 0; index < this._activeRenderLoops.length; index++) {const renderFunction = this._activeRenderLoops[index];renderFunction();}}_renderLoop() {if (!this._contextWasLost) {let shouldRender = !0;!this.renderEvenInBackground && this._windowIsBackground && (shouldRender = !1), shouldRender && (this.beginFrame(), !this._renderViews() && this._renderFrame(), this.endFrame());}0 < this._activeRenderLoops.length ? this.customAnimationFrameRequester ? (this.customAnimationFrameRequester.requestID = this._queueNewFrame(this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction, this.customAnimationFrameRequester), this._frameHandler = this.customAnimationFrameRequester.requestID) : this.isVRPresenting() ? this._requestVRFrame() : this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow()) : this._renderingQueueLaunched = !1;}_renderViews() {return !1;}switchFullscreen(requestPointerLock) {this.isFullscreen ? this.exitFullscreen() : this.enterFullscreen(requestPointerLock);}enterFullscreen(requestPointerLock) {this.isFullscreen || (this._pointerLockRequested = requestPointerLock, this._renderingCanvas && Engine._RequestFullscreen(this._renderingCanvas));}exitFullscreen() {this.isFullscreen && Engine._ExitFullscreen();}enterPointerlock() {this._renderingCanvas && Engine._RequestPointerlock(this._renderingCanvas);}exitPointerlock() {Engine._ExitPointerlock();}beginFrame() {this._measureFps(), this.onBeginFrameObservable.notifyObservers(this), super.beginFrame();}endFrame() {super.endFrame(), this._submitVRFrame(), this.onEndFrameObservable.notifyObservers(this);}resize(forceSetSize = !1) {this.isVRPresenting() || super.resize(forceSetSize);}setSize(width, height, forceSetSize = !1) {if (!this._renderingCanvas) return !1;if (!super.setSize(width, height, forceSetSize)) return !1;if (this.scenes) {for (let index = 0; index < this.scenes.length; index++) {const scene = this.scenes[index];for (let camIndex = 0; camIndex < scene.cameras.length; camIndex++) {const cam = scene.cameras[camIndex];cam._currentRenderId = 0;}}this.onResizeObservable.hasObservers() && this.onResizeObservable.notifyObservers(this);}return !0;}_deletePipelineContext(pipelineContext) {const webGLPipelineContext = pipelineContext;webGLPipelineContext && webGLPipelineContext.program && webGLPipelineContext.transformFeedback && (this.deleteTransformFeedback(webGLPipelineContext.transformFeedback), webGLPipelineContext.transformFeedback = null), super._deletePipelineContext(pipelineContext);}createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings = null) {context = context || this._gl, this.onBeforeShaderCompilationObservable.notifyObservers(this);const program = super.createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings);return this.onAfterShaderCompilationObservable.notifyObservers(this), program;}_createShaderProgram(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings = null) {const shaderProgram = context.createProgram();if (pipelineContext.program = shaderProgram, !shaderProgram) throw new Error("Unable to create program");if (context.attachShader(shaderProgram, vertexShader), context.attachShader(shaderProgram, fragmentShader), 1 < this.webGLVersion && transformFeedbackVaryings) {const transformFeedback = this.createTransformFeedback();this.bindTransformFeedback(transformFeedback), this.setTranformFeedbackVaryings(shaderProgram, transformFeedbackVaryings), pipelineContext.transformFeedback = transformFeedback;}return context.linkProgram(shaderProgram), 1 < this.webGLVersion && transformFeedbackVaryings && this.bindTransformFeedback(null), pipelineContext.context = context, pipelineContext.vertexShader = vertexShader, pipelineContext.fragmentShader = fragmentShader, pipelineContext.isParallelCompiled || this._finalizePipelineContext(pipelineContext), shaderProgram;}_releaseTexture(texture) {super._releaseTexture(texture);}_releaseRenderTargetWrapper(rtWrapper) {super._releaseRenderTargetWrapper(rtWrapper), this.scenes.forEach((scene) => {scene.postProcesses.forEach((postProcess) => {postProcess._outputTexture === rtWrapper && (postProcess._outputTexture = null);}), scene.cameras.forEach((camera) => {camera._postProcesses.forEach((postProcess) => {postProcess && postProcess._outputTexture === rtWrapper && (postProcess._outputTexture = null);});});});}getRenderPassNames() {return this._renderPassNames;}getCurrentRenderPassName() {return this._renderPassNames[this.currentRenderPassId];}createRenderPassId(name) {const id = ++Engine._RenderPassIdCounter;return this._renderPassNames[id] = null !== name && void 0 !== name ? name : "NONAME", id;}releaseRenderPassId(id) {this._renderPassNames[id] = void 0;for (let s = 0; s < this.scenes.length; ++s) {const scene = this.scenes[s];for (let m = 0; m < scene.meshes.length; ++m) {const mesh = scene.meshes[m];if (mesh.subMeshes) for (let b = 0; b < mesh.subMeshes.length; ++b) {const subMesh = mesh.subMeshes[b];subMesh._removeDrawWrapper(id);}}}}_rescaleTexture(source, destination, scene, internalFormat, onComplete) {this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE);const rtt = this.createRenderTargetTexture({ width: destination.width, height: destination.height }, { generateMipMaps: !1, type: 0, samplingMode: 2, generateDepthBuffer: !1, generateStencilBuffer: !1 });!this._rescalePostProcess && Engine._RescalePostProcessFactory && (this._rescalePostProcess = Engine._RescalePostProcessFactory(this)), this._rescalePostProcess && (this._rescalePostProcess.externalTextureSamplerBinding = !0, this._rescalePostProcess.getEffect().executeWhenCompiled(() => {this._rescalePostProcess.onApply = function (effect) {effect._bindTexture("textureSampler", source);};let hostingScene = scene;hostingScene || (hostingScene = this.scenes[this.scenes.length - 1]), hostingScene.postProcessManager.directRender([this._rescalePostProcess], rtt, !0), this._bindTextureDirectly(this._gl.TEXTURE_2D, destination, !0), this._gl.copyTexImage2D(this._gl.TEXTURE_2D, 0, internalFormat, 0, 0, destination.width, destination.height, 0), this.unBindFramebuffer(rtt), rtt.dispose(), onComplete && onComplete();}));}getFps() {return this._fps;}getDeltaTime() {return this._deltaTime;}_measureFps() {this._performanceMonitor.sampleFrame(), this._fps = this._performanceMonitor.averageFPS, this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;}wrapWebGLTexture(texture) {const hardwareTexture = new _WebGL_webGLHardwareTexture_js__WEBPACK_IMPORTED_MODULE_10__/* .WebGLHardwareTexture */ .B(texture, this._gl),internalTexture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTexture */ .l(this, _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTextureSource.Unknown */ .S.Unknown, !0);return internalTexture._hardwareTexture = hardwareTexture, internalTexture.isReady = !0, internalTexture;}_uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) {const gl = this._gl,textureType = this._getWebGLTextureType(texture.type),format = this._getInternalFormat(texture.format),internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, format),bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;this._bindTextureDirectly(bindTarget, texture, !0), this._unpackFlipY(texture.invertY);let target = gl.TEXTURE_2D;texture.isCube && (target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex), gl.texImage2D(target, lod, internalFormat, format, textureType, image), this._bindTextureDirectly(bindTarget, null, !0);}updateTextureComparisonFunction(texture, comparisonFunction) {if (1 === this.webGLVersion) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_9__/* .Logger.Error */ .Y.Error("WebGL 1 does not support texture comparison.");const gl = this._gl;texture.isCube ? (this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, !0), 0 === comparisonFunction ? (gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, 515), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.NONE)) : (gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, comparisonFunction), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null)) : (this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, !0), 0 === comparisonFunction ? (gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, 515), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.NONE)) : (gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, comparisonFunction), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_2D, null)), texture._comparisonFunction = comparisonFunction;}createInstancesBuffer(capacity) {const buffer = this._gl.createBuffer();if (!buffer) throw new Error("Unable to create instance buffer");const result = new _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_8__/* .WebGLDataBuffer */ .M(buffer);return result.capacity = capacity, this.bindArrayBuffer(result), this._gl.bufferData(this._gl.ARRAY_BUFFER, capacity, this._gl.DYNAMIC_DRAW), result.references = 1, result;}deleteInstancesBuffer(buffer) {this._gl.deleteBuffer(buffer);}_clientWaitAsync(sync, flags = 0, intervalms = 10) {const gl = this._gl;return new Promise((resolve, reject) => {const check = () => {const res = gl.clientWaitSync(sync, flags, 0);return res == gl.WAIT_FAILED ? void reject() : res == gl.TIMEOUT_EXPIRED ? void setTimeout(check, intervalms) : void resolve();};check();});}_readPixelsAsync(x, y, w, h, format, type, outputBuffer) {if (2 > this._webGLVersion) throw new Error("_readPixelsAsync only work on WebGL2+");const gl = this._gl,buf = gl.createBuffer();gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf), gl.bufferData(gl.PIXEL_PACK_BUFFER, outputBuffer.byteLength, gl.STREAM_READ), gl.readPixels(x, y, w, h, format, type, 0), gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);const sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);return sync ? (gl.flush(), this._clientWaitAsync(sync, 0, 10).then(() => (gl.deleteSync(sync), gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf), gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, outputBuffer), gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null), gl.deleteBuffer(buf), outputBuffer))) : null;}dispose() {for (this.hideLoadingUI(), this.onNewSceneAddedObservable.clear(); this.postProcesses.length;) this.postProcesses[0].dispose();for (this._rescalePostProcess && this._rescalePostProcess.dispose(); this.scenes.length;) this.scenes[0].dispose();for (; this._virtualScenes.length;) this._virtualScenes[0].dispose();1 === Engine.Instances.length && Engine.audioEngine && (Engine.audioEngine.dispose(), Engine.audioEngine = null), this.disableVR();const hostWindow = this.getHostWindow();hostWindow && "function" == typeof hostWindow.removeEventListener && (hostWindow.removeEventListener("blur", this._onBlur), hostWindow.removeEventListener("focus", this._onFocus)), this._renderingCanvas && (this._renderingCanvas.removeEventListener("focus", this._onCanvasFocus), this._renderingCanvas.removeEventListener("blur", this._onCanvasBlur), this._renderingCanvas.removeEventListener("pointerout", this._onCanvasPointerOut), this._renderingCanvas.removeEventListener("contextmenu", this._onCanvasContextMenu)), (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_2__/* .IsDocumentAvailable */ .n5)() && (document.removeEventListener("fullscreenchange", this._onFullscreenChange), document.removeEventListener("mozfullscreenchange", this._onFullscreenChange), document.removeEventListener("webkitfullscreenchange", this._onFullscreenChange), document.removeEventListener("msfullscreenchange", this._onFullscreenChange), document.removeEventListener("pointerlockchange", this._onPointerLockChange), document.removeEventListener("mspointerlockchange", this._onPointerLockChange), document.removeEventListener("mozpointerlockchange", this._onPointerLockChange), document.removeEventListener("webkitpointerlockchange", this._onPointerLockChange)), super.dispose();const index = Engine.Instances.indexOf(this);0 <= index && Engine.Instances.splice(index, 1), this.onResizeObservable.clear(), this.onCanvasBlurObservable.clear(), this.onCanvasFocusObservable.clear(), this.onCanvasPointerOutObservable.clear(), this.onBeginFrameObservable.clear(), this.onEndFrameObservable.clear();}_disableTouchAction() {this._renderingCanvas && this._renderingCanvas.setAttribute && (this._renderingCanvas.setAttribute("touch-action", "none"), this._renderingCanvas.style.touchAction = "none", this._renderingCanvas.style.webkitTapHighlightColor = "transparent");}displayLoadingUI() {if ((0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_2__/* .IsWindowObjectExist */ .CG)()) {const loadingScreen = this.loadingScreen;loadingScreen && loadingScreen.displayLoadingUI();}}hideLoadingUI() {if ((0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_2__/* .IsWindowObjectExist */ .CG)()) {const loadingScreen = this._loadingScreen;loadingScreen && loadingScreen.hideLoadingUI();}}get loadingScreen() {return !this._loadingScreen && this._renderingCanvas && (this._loadingScreen = Engine.DefaultLoadingScreenFactory(this._renderingCanvas)), this._loadingScreen;}set loadingScreen(loadingScreen) {this._loadingScreen = loadingScreen;}set loadingUIText(text) {this.loadingScreen.loadingUIText = text;}set loadingUIBackgroundColor(color) {this.loadingScreen.loadingUIBackgroundColor = color;}createVideoElement() {return document.createElement("video");}static _RequestPointerlock(element) {if (element.requestPointerLock) {const promise = element.requestPointerLock();promise instanceof Promise ? promise.then(() => {element.focus();}).catch(() => {}) : element.focus();}}static _ExitPointerlock() {document.exitPointerLock && document.exitPointerLock();}static _RequestFullscreen(element) {const requestFunction = element.requestFullscreen || element.webkitRequestFullscreen;requestFunction && requestFunction.call(element);}static _ExitFullscreen() {const anyDoc = document;document.exitFullscreen ? document.exitFullscreen() : anyDoc.webkitCancelFullScreen && anyDoc.webkitCancelFullScreen();}getFontOffset(font) {const text = document.createElement("span");text.innerHTML = "Hg", text.setAttribute("style", `font: ${font} !important`);const block = document.createElement("div");block.style.display = "inline-block", block.style.width = "1px", block.style.height = "0px", block.style.verticalAlign = "bottom";const div = document.createElement("div");div.style.whiteSpace = "nowrap", div.appendChild(text), div.appendChild(block), document.body.appendChild(div);let fontAscent = 0,fontHeight = 0;try {fontHeight = block.getBoundingClientRect().top - text.getBoundingClientRect().top, block.style.verticalAlign = "baseline", fontAscent = block.getBoundingClientRect().top - text.getBoundingClientRect().top;} finally {document.body.removeChild(div);}return { ascent: fontAscent, height: fontHeight, descent: fontHeight - fontAscent };}}Engine.ALPHA_DISABLE = 0, Engine.ALPHA_ADD = 1, Engine.ALPHA_COMBINE = 2, Engine.ALPHA_SUBTRACT = 3, Engine.ALPHA_MULTIPLY = 4, Engine.ALPHA_MAXIMIZED = 5, Engine.ALPHA_ONEONE = 6, Engine.ALPHA_PREMULTIPLIED = 7, Engine.ALPHA_PREMULTIPLIED_PORTERDUFF = 8, Engine.ALPHA_INTERPOLATE = 9, Engine.ALPHA_SCREENMODE = 10, Engine.DELAYLOADSTATE_NONE = 0, Engine.DELAYLOADSTATE_LOADED = 1, Engine.DELAYLOADSTATE_LOADING = 2, Engine.DELAYLOADSTATE_NOTLOADED = 4, Engine.NEVER = 512, Engine.ALWAYS = 519, Engine.LESS = 513, Engine.EQUAL = 514, Engine.LEQUAL = 515, Engine.GREATER = 516, Engine.GEQUAL = 518, Engine.NOTEQUAL = 517, Engine.KEEP = 7680, Engine.REPLACE = 7681, Engine.INCR = 7682, Engine.DECR = 7683, Engine.INVERT = 5386, Engine.INCR_WRAP = 34055, Engine.DECR_WRAP = 34056, Engine.TEXTURE_CLAMP_ADDRESSMODE = 0, Engine.TEXTURE_WRAP_ADDRESSMODE = 1, Engine.TEXTURE_MIRROR_ADDRESSMODE = 2, Engine.TEXTUREFORMAT_ALPHA = 0, Engine.TEXTUREFORMAT_LUMINANCE = 1, Engine.TEXTUREFORMAT_LUMINANCE_ALPHA = 2, Engine.TEXTUREFORMAT_RGB = 4, Engine.TEXTUREFORMAT_RGBA = 5, Engine.TEXTUREFORMAT_RED = 6, Engine.TEXTUREFORMAT_R = 6, Engine.TEXTUREFORMAT_RG = 7, Engine.TEXTUREFORMAT_RED_INTEGER = 8, Engine.TEXTUREFORMAT_R_INTEGER = 8, Engine.TEXTUREFORMAT_RG_INTEGER = 9, Engine.TEXTUREFORMAT_RGB_INTEGER = 10, Engine.TEXTUREFORMAT_RGBA_INTEGER = 11, Engine.TEXTURETYPE_UNSIGNED_BYTE = 0, Engine.TEXTURETYPE_UNSIGNED_INT = 0, Engine.TEXTURETYPE_FLOAT = 1, Engine.TEXTURETYPE_HALF_FLOAT = 2, Engine.TEXTURETYPE_BYTE = 3, Engine.TEXTURETYPE_SHORT = 4, Engine.TEXTURETYPE_UNSIGNED_SHORT = 5, Engine.TEXTURETYPE_INT = 6, Engine.TEXTURETYPE_UNSIGNED_INTEGER = 7, Engine.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8, Engine.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9, Engine.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10, Engine.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11, Engine.TEXTURETYPE_UNSIGNED_INT_24_8 = 12, Engine.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13, Engine.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14, Engine.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15, Engine.TEXTURE_NEAREST_SAMPLINGMODE = 1, Engine.TEXTURE_BILINEAR_SAMPLINGMODE = 2, Engine.TEXTURE_TRILINEAR_SAMPLINGMODE = 3, Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8, Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11, Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3, Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4, Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5, Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6, Engine.TEXTURE_NEAREST_LINEAR = 7, Engine.TEXTURE_NEAREST_NEAREST = 1, Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9, Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10, Engine.TEXTURE_LINEAR_LINEAR = 2, Engine.TEXTURE_LINEAR_NEAREST = 12, Engine.TEXTURE_EXPLICIT_MODE = 0, Engine.TEXTURE_SPHERICAL_MODE = 1, Engine.TEXTURE_PLANAR_MODE = 2, Engine.TEXTURE_CUBIC_MODE = 3, Engine.TEXTURE_PROJECTION_MODE = 4, Engine.TEXTURE_SKYBOX_MODE = 5, Engine.TEXTURE_INVCUBIC_MODE = 6, Engine.TEXTURE_EQUIRECTANGULAR_MODE = 7, Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8, Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9, Engine.SCALEMODE_FLOOR = 1, Engine.SCALEMODE_NEAREST = 2, Engine.SCALEMODE_CEILING = 3, Engine._RescalePostProcessFactory = null, Engine._RenderPassIdCounter = 0;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/engineStore.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "l": () => (/* binding */ EngineStore)
/* harmony export */ });
class EngineStore {static get LastCreatedEngine() {return 0 === this.Instances.length ? null : this.Instances[this.Instances.length - 1];}static get LastCreatedScene() {return this._LastCreatedScene;}}EngineStore.Instances = [], EngineStore._LastCreatedScene = null, EngineStore.UseFallbackTexture = !0, EngineStore.FallbackTexture = "";

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/performanceConfigurator.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ PerformanceConfigurator)
/* harmony export */ });
class PerformanceConfigurator {static SetMatrixPrecision(use64bits) {if (PerformanceConfigurator.MatrixTrackPrecisionChange = !1, use64bits && !PerformanceConfigurator.MatrixUse64Bits && PerformanceConfigurator.MatrixTrackedMatrices) for (let m = 0; m < PerformanceConfigurator.MatrixTrackedMatrices.length; ++m) {const matrix = PerformanceConfigurator.MatrixTrackedMatrices[m],values = matrix._m;matrix._m = Array(16);for (let i = 0; 16 > i; ++i) matrix._m[i] = values[i];}PerformanceConfigurator.MatrixUse64Bits = use64bits, PerformanceConfigurator.MatrixCurrentType = PerformanceConfigurator.MatrixUse64Bits ? Array : Float32Array, PerformanceConfigurator.MatrixTrackedMatrices = null;}}PerformanceConfigurator.MatrixUse64Bits = !1, PerformanceConfigurator.MatrixTrackPrecisionChange = !0, PerformanceConfigurator.MatrixCurrentType = Float32Array, PerformanceConfigurator.MatrixTrackedMatrices = [];

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/renderTargetWrapper.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "r": () => (/* binding */ RenderTargetWrapper)
/* harmony export */ });
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
class RenderTargetWrapper {get depthStencilTexture() {return this._depthStencilTexture;}get depthStencilTextureWithStencil() {return this._depthStencilTextureWithStencil;}get isCube() {return this._isCube;}get isMulti() {return this._isMulti;}get is2DArray() {return 0 < this.layers;}get size() {return this.width;}get width() {return this._size.width || this._size;}get height() {return this._size.height || this._size;}get layers() {return this._size.layers || 0;}get texture() {var _a, _b;return null !== (_b = null === (_a = this._textures) || void 0 === _a ? void 0 : _a[0]) && void 0 !== _b ? _b : null;}get textures() {return this._textures;}get samples() {return this._samples;}setSamples(value, initializeBuffers = !0, force = !1) {if (this.samples === value && !force) return value;const result = this._isMulti ? this._engine.updateMultipleRenderTargetTextureSampleCount(this, value, initializeBuffers) : this._engine.updateRenderTargetTextureSampleCount(this, value);return this._samples = value, result;}constructor(isMulti, isCube, size, engine) {this._textures = null, this._samples = 1, this._attachments = null, this._generateStencilBuffer = !1, this._generateDepthBuffer = !1, this._depthStencilTextureWithStencil = !1, this._isMulti = isMulti, this._isCube = isCube, this._size = size, this._engine = engine, this._depthStencilTexture = null;}setTextures(textures) {this._textures = Array.isArray(textures) ? textures : textures ? [textures] : null;}setTexture(texture, index = 0, disposePrevious = !0) {this._textures || (this._textures = []), this._textures[index] && disposePrevious && this._textures[index].dispose(), this._textures[index] = texture;}createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = !0, generateStencil = !1, samples = 1, format = 14) {var _a;return null === (_a = this._depthStencilTexture) || void 0 === _a ? void 0 : _a.dispose(), this._depthStencilTextureWithStencil = generateStencil, this._depthStencilTexture = this._engine.createDepthStencilTexture(this._size, { bilinearFiltering, comparisonFunction, generateStencil, isCube: this._isCube, samples, depthTextureFormat: format }, this), this._depthStencilTexture;}_shareDepth(renderTarget) {this._depthStencilTexture && (renderTarget._depthStencilTexture && renderTarget._depthStencilTexture.dispose(), renderTarget._depthStencilTexture = this._depthStencilTexture, this._depthStencilTexture.incrementReferences());}_swapAndDie(target) {this.texture && this.texture._swapAndDie(target), this._textures = null, this.dispose(!0);}_cloneRenderTargetWrapper() {var _a, _b, _c, _d, _e, _f;let rtw = null;if (this._isMulti) {const textureArray = this.textures;if (textureArray && 0 < textureArray.length) {let generateDepthTexture = !1,textureCount = textureArray.length;const lastTextureSource = textureArray[textureArray.length - 1]._source;(lastTextureSource === _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTextureSource.Depth */ .S.Depth || lastTextureSource === _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTextureSource.DepthStencil */ .S.DepthStencil) && (generateDepthTexture = !0, textureCount--);const samplingModes = [],types = [];for (let i = 0; i < textureCount; ++i) {const texture = textureArray[i];samplingModes.push(texture.samplingMode), types.push(texture.type);}const optionsMRT = { samplingModes, generateMipMaps: textureArray[0].generateMipMaps, generateDepthBuffer: this._generateDepthBuffer, generateStencilBuffer: this._generateStencilBuffer, generateDepthTexture, types, textureCount },size = { width: this.width, height: this.height };rtw = this._engine.createMultipleRenderTarget(size, optionsMRT);}} else {const options = { generateDepthBuffer: this._generateDepthBuffer, generateMipMaps: !(null === (_b = null === (_a = this.texture) || void 0 === _a ? void 0 : _a.generateMipMaps) || void 0 === _b) && _b, generateStencilBuffer: this._generateStencilBuffer, samplingMode: null === (_c = this.texture) || void 0 === _c ? void 0 : _c.samplingMode, type: null === (_d = this.texture) || void 0 === _d ? void 0 : _d.type, format: null === (_e = this.texture) || void 0 === _e ? void 0 : _e.format };if (this.isCube) rtw = this._engine.createRenderTargetCubeTexture(this.width, options);else {const size = { width: this.width, height: this.height, layers: this.is2DArray ? null === (_f = this.texture) || void 0 === _f ? void 0 : _f.depth : void 0 };rtw = this._engine.createRenderTargetTexture(size, options);}rtw.texture.isReady = !0;}return rtw;}_swapRenderTargetWrapper(target) {if (this._textures && target._textures) for (let i = 0; i < this._textures.length; ++i) this._textures[i]._swapAndDie(target._textures[i], !1), target._textures[i].isReady = !0;this._depthStencilTexture && target._depthStencilTexture && (this._depthStencilTexture._swapAndDie(target._depthStencilTexture), target._depthStencilTexture.isReady = !0), this._textures = null, this._depthStencilTexture = null;}_rebuild() {const rtw = this._cloneRenderTargetWrapper();if (rtw) {if (this._depthStencilTexture) {const samplingMode = this._depthStencilTexture.samplingMode;rtw.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction, 2 === samplingMode || 3 === samplingMode || 11 === samplingMode, this._depthStencilTextureWithStencil, this._depthStencilTexture.samples);}1 < this.samples && rtw.setSamples(this.samples), rtw._swapRenderTargetWrapper(this), rtw.dispose();}}releaseTextures() {var _a, _b;if (this._textures) for (let i = 0; null !== (_b = i < (null === (_a = this._textures) || void 0 === _a ? void 0 : _a.length)) && void 0 !== _b ? _b : 0; ++i) this._textures[i].dispose();this._textures = null;}dispose(disposeOnlyFramebuffers = !1) {var _a;disposeOnlyFramebuffers || (null === (_a = this._depthStencilTexture) || void 0 === _a ? void 0 : _a.dispose(), this._depthStencilTexture = null, this.releaseTextures()), this._engine._releaseRenderTargetWrapper(this);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/shaderStore.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "v": () => (/* binding */ ShaderStore)
/* harmony export */ });
/* harmony import */ var _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/shaderLanguage.js");
class ShaderStore {static GetShadersRepository(shaderLanguage = _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderLanguage.GLSL */ .x.GLSL) {return shaderLanguage === _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderLanguage.GLSL */ .x.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL;}static GetShadersStore(shaderLanguage = _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderLanguage.GLSL */ .x.GLSL) {return shaderLanguage === _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderLanguage.GLSL */ .x.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL;}static GetIncludesShadersStore(shaderLanguage = _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderLanguage.GLSL */ .x.GLSL) {return shaderLanguage === _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderLanguage.GLSL */ .x.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL;}}ShaderStore.ShadersRepository = "src/Shaders/", ShaderStore.ShadersStore = {}, ShaderStore.IncludesShadersStore = {}, ShaderStore.ShadersRepositoryWGSL = "src/ShadersWGSL/", ShaderStore.ShadersStoreWGSL = {}, ShaderStore.IncludesShadersStoreWGSL = {};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Engines/thinEngine.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "B": () => (/* binding */ ThinEngine)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engineStore.js
var engineStore = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effect.js
var Materials_effect = __webpack_require__("./node_modules/@babylonjs/core/Materials/effect.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/devTools.js
var devTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/depthCullingState.js
var depthCullingState = __webpack_require__("./node_modules/@babylonjs/core/States/depthCullingState.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/stencilState.js
var stencilState = __webpack_require__("./node_modules/@babylonjs/core/States/stencilState.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/alphaCullingState.js
var alphaCullingState = __webpack_require__("./node_modules/@babylonjs/core/States/alphaCullingState.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js
var internalTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/domManagement.js
var domManagement = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/shaderLanguage.js
var Materials_shaderLanguage = __webpack_require__("./node_modules/@babylonjs/core/Materials/shaderLanguage.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGLShaderProcessors.js
class WebGLShaderProcessor {constructor() {this.shaderLanguage = Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL;}postProcessor(code, defines, isFragment, processingContext, engine) {if (!engine.getCaps().drawBuffersExtension) {code = code.replace(/#extension.+GL_EXT_draw_buffers.+(enable|require)/g, "");}return code;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGL2ShaderProcessors.js
var webGL2ShaderProcessors = __webpack_require__("./node_modules/@babylonjs/core/Engines/WebGL/webGL2ShaderProcessors.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js
var webGLDataBuffer = __webpack_require__("./node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGLPipelineContext.js
var webGLPipelineContext = __webpack_require__("./node_modules/@babylonjs/core/Engines/WebGL/webGLPipelineContext.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/performanceConfigurator.js
var performanceConfigurator = __webpack_require__("./node_modules/@babylonjs/core/Engines/performanceConfigurator.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.js
var webGLHardwareTexture = __webpack_require__("./node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/drawWrapper.js
var drawWrapper = __webpack_require__("./node_modules/@babylonjs/core/Materials/drawWrapper.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/stencilStateComposer.js
var stencilStateComposer = __webpack_require__("./node_modules/@babylonjs/core/States/stencilStateComposer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/precisionDate.js
var precisionDate = __webpack_require__("./node_modules/@babylonjs/core/Misc/precisionDate.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/thinEngine.js
class BufferPointer {}class ThinEngine {static get NpmPackage() {return "babylonjs@5.47.0";}static get Version() {return "5.47.0";}get description() {let description = this.name + this.webGLVersion;return this._caps.parallelShaderCompile && (description += " - Parallel shader compilation"), description;}get name() {return this._name;}set name(value) {this._name = value;}get version() {return this._webGLVersion;}static get ShadersRepository() {return Materials_effect/* Effect.ShadersRepository */.Q.ShadersRepository;}static set ShadersRepository(value) {Materials_effect/* Effect.ShadersRepository */.Q.ShadersRepository = value;}_getShaderProcessor() {return this._shaderProcessor;}get useReverseDepthBuffer() {return this._useReverseDepthBuffer;}set useReverseDepthBuffer(useReverse) {useReverse === this._useReverseDepthBuffer || (this._useReverseDepthBuffer = useReverse, this._depthCullingState.depthFunc = useReverse ? 518 : 515);}get frameId() {return this._frameId;}get supportsUniformBuffers() {return 1 < this.webGLVersion && !this.disableUniformBuffers;}getCreationOptions() {return this._creationOptions;}get _shouldUseHighPrecisionShader() {return !!(this._caps.highPrecisionShaderSupported && this._highPrecisionShadersAllowed);}get needPOTTextures() {return 2 > this._webGLVersion || this.forcePOTTextures;}get activeRenderLoops() {return this._activeRenderLoops;}get doNotHandleContextLost() {return this._doNotHandleContextLost;}set doNotHandleContextLost(value) {this._doNotHandleContextLost = value;}get _supportsHardwareTextureRescaling() {return !1;}set framebufferDimensionsObject(dimensions) {this._framebufferDimensionsObject = dimensions;}get currentViewport() {return this._cachedViewport;}get emptyTexture() {return this._emptyTexture || (this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, 5, !1, !1, 1)), this._emptyTexture;}get emptyTexture3D() {return this._emptyTexture3D || (this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, 5, !1, !1, 1)), this._emptyTexture3D;}get emptyTexture2DArray() {return this._emptyTexture2DArray || (this._emptyTexture2DArray = this.createRawTexture2DArray(new Uint8Array(4), 1, 1, 1, 5, !1, !1, 1)), this._emptyTexture2DArray;}get emptyCubeTexture() {if (!this._emptyCubeTexture) {const faceData = new Uint8Array(4);this._emptyCubeTexture = this.createRawCubeTexture([faceData, faceData, faceData, faceData, faceData, faceData], 1, 5, 0, !1, !1, 1);}return this._emptyCubeTexture;}get isWebGPU() {return this._isWebGPU;}get shaderPlatformName() {return this._shaderPlatformName;}get snapshotRendering() {return !1;}set snapshotRendering(activate) {}get snapshotRenderingMode() {return this._snapshotRenderingMode;}set snapshotRenderingMode(mode) {this._snapshotRenderingMode = mode;}get useExactSrgbConversions() {return this._useExactSrgbConversions;}snapshotRenderingReset() {this.snapshotRendering = !1;}static _CreateCanvas(width, height) {if ("undefined" == typeof document) return new OffscreenCanvas(width, height);const canvas = document.createElement("canvas");return canvas.width = width, canvas.height = height, canvas;}createCanvas(width, height) {return ThinEngine._CreateCanvas(width, height);}createCanvasImage() {return document.createElement("img");}constructor(canvasOrContext, antialias, options, adaptToDeviceRatio) {this._name = "WebGL", this.forcePOTTextures = !1, this.isFullscreen = !1, this.cullBackFaces = null, this.renderEvenInBackground = !0, this.preventCacheWipeBetweenFrames = !1, this.validateShaderPrograms = !1, this._useReverseDepthBuffer = !1, this.isNDCHalfZRange = !1, this.hasOriginBottomLeft = !0, this.disableUniformBuffers = !1, this.onDisposeObservable = new observable/* Observable */.y$(), this._frameId = 0, this._uniformBuffers = [], this._storageBuffers = [], this._webGLVersion = 1, this._windowIsBackground = !1, this._highPrecisionShadersAllowed = !0, this._badOS = !1, this._badDesktopOS = !1, this._renderingQueueLaunched = !1, this._activeRenderLoops = [], this.onContextLostObservable = new observable/* Observable */.y$(), this.onContextRestoredObservable = new observable/* Observable */.y$(), this._contextWasLost = !1, this._doNotHandleContextLost = !1, this.disableVertexArrayObjects = !1, this._colorWrite = !0, this._colorWriteChanged = !0, this._depthCullingState = new depthCullingState/* DepthCullingState */.k(), this._stencilStateComposer = new stencilStateComposer/* StencilStateComposer */.C(), this._stencilState = new stencilState/* StencilState */.s(), this._alphaState = new alphaCullingState/* AlphaState */.Q(), this._alphaMode = 1, this._alphaEquation = 0, this._internalTexturesCache = [], this._renderTargetWrapperCache = [], this._activeChannel = 0, this._currentTextureChannel = -1, this._boundTexturesCache = {}, this._compiledEffects = {}, this._vertexAttribArraysEnabled = [], this._uintIndicesCurrentlySet = !1, this._currentBoundBuffer = [], this._currentFramebuffer = null, this._dummyFramebuffer = null, this._currentBufferPointers = [], this._currentInstanceLocations = [], this._currentInstanceBuffers = [], this._vaoRecordInProgress = !1, this._mustWipeVertexAttributes = !1, this._nextFreeTextureSlots = [], this._maxSimultaneousTextures = 0, this._maxMSAASamplesOverride = null, this._activeRequests = [], this.adaptToDeviceRatio = !1, this._lastDevicePixelRatio = 1, this._transformTextureUrl = null, this.hostInformation = { isMobile: !1 }, this.premultipliedAlpha = !0, this.onBeforeTextureInitObservable = new observable/* Observable */.y$(), this._isWebGPU = !1, this._snapshotRenderingMode = 0, this._useExactSrgbConversions = !1, this._viewportCached = { x: 0, y: 0, z: 0, w: 0 }, this._unpackFlipYCached = null, this.enableUnpackFlipYCached = !0, this._boundUniforms = {}, this.startTime = precisionDate/* PrecisionDate.Now */.F.Now;let canvas = null;if (options = options || {}, this._creationOptions = options, this.adaptToDeviceRatio = null !== adaptToDeviceRatio && void 0 !== adaptToDeviceRatio && adaptToDeviceRatio, this._stencilStateComposer.stencilGlobal = this._stencilState, performanceConfigurator/* PerformanceConfigurator.SetMatrixPrecision */.Z.SetMatrixPrecision(!!options.useHighPrecisionMatrix), !canvasOrContext) return;if (adaptToDeviceRatio = adaptToDeviceRatio || options.adaptToDeviceRatio || !1, canvasOrContext.getContext) {if (canvas = canvasOrContext, this._renderingCanvas = canvas, void 0 !== antialias && (options.antialias = antialias), void 0 === options.deterministicLockstep && (options.deterministicLockstep = !1), void 0 === options.lockstepMaxSteps && (options.lockstepMaxSteps = 4), void 0 === options.timeStep && (options.timeStep = 1 / 60), void 0 === options.preserveDrawingBuffer && (options.preserveDrawingBuffer = !1), void 0 === options.audioEngine && (options.audioEngine = !0), void 0 !== options.audioEngineOptions && void 0 !== options.audioEngineOptions.audioContext && (this._audioContext = options.audioEngineOptions.audioContext), void 0 !== options.audioEngineOptions && void 0 !== options.audioEngineOptions.audioDestination && (this._audioDestination = options.audioEngineOptions.audioDestination), void 0 === options.stencil && (options.stencil = !0), !1 === options.premultipliedAlpha && (this.premultipliedAlpha = !1), void 0 === options.xrCompatible && (options.xrCompatible = !0), void 0 !== options.useExactSrgbConversions && (this._useExactSrgbConversions = options.useExactSrgbConversions), this._doNotHandleContextLost = !!options.doNotHandleContextLost, navigator && navigator.userAgent) {this._checkForMobile = () => {const currentUA = navigator.userAgent;this.hostInformation.isMobile = -1 !== currentUA.indexOf("Mobile") || -1 !== currentUA.indexOf("Mac") && (0,domManagement/* IsDocumentAvailable */.n5)() && "ontouchend" in document;}, this._checkForMobile(), (0,domManagement/* IsWindowObjectExist */.CG)() && window.addEventListener("resize", this._checkForMobile);const ua = navigator.userAgent;for (const exception of ThinEngine.ExceptionList) {const key = exception.key,targets = exception.targets,check = new RegExp(key);if (check.test(ua)) {if (exception.capture && exception.captureConstraint) {const capture = exception.capture,constraint = exception.captureConstraint,regex = new RegExp(capture),matches = regex.exec(ua);if (matches && 0 < matches.length) {const capturedValue = parseInt(matches[matches.length - 1]);if (capturedValue >= constraint) continue;}}for (const target of targets) "uniformBuffer" === target ? this.disableUniformBuffers = !0 : "vao" === target ? this.disableVertexArrayObjects = !0 : "antialias" === target ? options.antialias = !1 : "maxMSAASamples" === target ? this._maxMSAASamplesOverride = 1 : void 0;}}}if (this._doNotHandleContextLost || (this._onContextLost = (evt) => {evt.preventDefault(), this._contextWasLost = !0, logger/* Logger.Warn */.Y.Warn("WebGL context lost."), this.onContextLostObservable.notifyObservers(this);}, this._onContextRestored = () => {this._restoreEngineAfterContextLost(this._initGLContext.bind(this));}, canvas.addEventListener("webglcontextlost", this._onContextLost, !1), canvas.addEventListener("webglcontextrestored", this._onContextRestored, !1), options.powerPreference = "high-performance"), this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), this._badDesktopOS && (options.xrCompatible = !1), !options.disableWebGL2Support) try {this._gl = canvas.getContext("webgl2", options) || canvas.getContext("experimental-webgl2", options), this._gl && (this._webGLVersion = 2, this._shaderPlatformName = "WEBGL2", !this._gl.deleteQuery && (this._webGLVersion = 1, this._shaderPlatformName = "WEBGL1"));} catch (e) {}if (!this._gl) {if (!canvas) throw new Error("The provided canvas is null or undefined.");try {this._gl = canvas.getContext("webgl", options) || canvas.getContext("experimental-webgl", options);} catch (e) {throw new Error("WebGL not supported");}}if (!this._gl) throw new Error("WebGL not supported");} else {this._gl = canvasOrContext, this._renderingCanvas = this._gl.canvas, this._gl.renderbufferStorageMultisample ? (this._webGLVersion = 2, this._shaderPlatformName = "WEBGL2") : this._shaderPlatformName = "WEBGL1";const attributes = this._gl.getContextAttributes();attributes && (options.stencil = attributes.stencil);}this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE), void 0 !== options.useHighPrecisionFloats && (this._highPrecisionShadersAllowed = options.useHighPrecisionFloats);const devicePixelRatio = (0,domManagement/* IsWindowObjectExist */.CG)() ? window.devicePixelRatio || 1 : 1,limitDeviceRatio = options.limitDeviceRatio || devicePixelRatio;this._hardwareScalingLevel = adaptToDeviceRatio ? 1 / Math.min(limitDeviceRatio, devicePixelRatio) : 1, this._lastDevicePixelRatio = devicePixelRatio, this.resize(), this._isStencilEnable = !!options.stencil, this._initGLContext(), this._initFeatures();for (let i = 0; i < this._caps.maxVertexAttribs; i++) this._currentBufferPointers[i] = new BufferPointer();this._shaderProcessor = 1 < this.webGLVersion ? new webGL2ShaderProcessors/* WebGL2ShaderProcessor */.C() : new WebGLShaderProcessor(), this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent);const versionToLog = `Babylon.js v${ThinEngine.Version}`;console.log(versionToLog + ` - ${this.description}`), this._renderingCanvas && this._renderingCanvas.setAttribute && this._renderingCanvas.setAttribute("data-engine", versionToLog);}_restoreEngineAfterContextLost(initEngine) {setTimeout(async () => {var _a;this._dummyFramebuffer = null;const depthTest = this._depthCullingState.depthTest,depthFunc = this._depthCullingState.depthFunc,depthMask = this._depthCullingState.depthMask,stencilTest = this._stencilState.stencilTest;await initEngine(), this.wipeCaches(!0), this._rebuildEffects(), null === (_a = this._rebuildComputeEffects) || void 0 === _a ? void 0 : _a.call(this), this._rebuildBuffers(), this._rebuildInternalTextures(), this._rebuildRenderTargetWrappers(), this.wipeCaches(!0), this._depthCullingState.depthTest = depthTest, this._depthCullingState.depthFunc = depthFunc, this._depthCullingState.depthMask = depthMask, this._stencilState.stencilTest = stencilTest, logger/* Logger.Warn */.Y.Warn(this.name + " context successfully restored."), this.onContextRestoredObservable.notifyObservers(this), this._contextWasLost = !1;}, 0);}_sharedInit(canvas) {this._renderingCanvas = canvas;}_getShaderProcessingContext() {return null;}_rebuildInternalTextures() {const currentState = this._internalTexturesCache.slice();for (const internalTexture of currentState) internalTexture._rebuild();}_rebuildRenderTargetWrappers() {const currentState = this._renderTargetWrapperCache.slice();for (const renderTargetWrapper of currentState) renderTargetWrapper._rebuild();}_rebuildEffects() {for (const key in this._compiledEffects) {const effect = this._compiledEffects[key];effect._pipelineContext = null, effect._wasPreviouslyReady = !1, effect._prepareEffect();}Materials_effect/* Effect.ResetCache */.Q.ResetCache();}areAllEffectsReady() {for (const key in this._compiledEffects) {const effect = this._compiledEffects[key];if (!effect.isReady()) return !1;}return !0;}_rebuildBuffers() {for (const uniformBuffer of this._uniformBuffers) uniformBuffer._rebuild();for (const storageBuffer of this._storageBuffers) storageBuffer._rebuild();}_initGLContext() {var _a;this._caps = { maxTexturesImageUnits: this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS), maxCombinedTexturesImageUnits: this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS), maxVertexTextureImageUnits: this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS), maxTextureSize: this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE), maxSamples: 1 < this._webGLVersion ? this._gl.getParameter(this._gl.MAX_SAMPLES) : 1, maxCubemapTextureSize: this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE), maxRenderTextureSize: this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE), maxVertexAttribs: this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS), maxVaryingVectors: this._gl.getParameter(this._gl.MAX_VARYING_VECTORS), maxFragmentUniformVectors: this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS), maxVertexUniformVectors: this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS), parallelShaderCompile: this._gl.getExtension("KHR_parallel_shader_compile") || void 0, standardDerivatives: 1 < this._webGLVersion || null !== this._gl.getExtension("OES_standard_derivatives"), maxAnisotropy: 1, astc: this._gl.getExtension("WEBGL_compressed_texture_astc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"), bptc: this._gl.getExtension("EXT_texture_compression_bptc") || this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"), s3tc: this._gl.getExtension("WEBGL_compressed_texture_s3tc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"), s3tc_srgb: this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"), pvrtc: this._gl.getExtension("WEBGL_compressed_texture_pvrtc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"), etc1: this._gl.getExtension("WEBGL_compressed_texture_etc1") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"), etc2: this._gl.getExtension("WEBGL_compressed_texture_etc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc") || this._gl.getExtension("WEBGL_compressed_texture_es3_0"), textureAnisotropicFilterExtension: this._gl.getExtension("EXT_texture_filter_anisotropic") || this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic") || this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"), uintIndices: 1 < this._webGLVersion || null !== this._gl.getExtension("OES_element_index_uint"), fragmentDepthSupported: 1 < this._webGLVersion || null !== this._gl.getExtension("EXT_frag_depth"), highPrecisionShaderSupported: !1, timerQuery: this._gl.getExtension("EXT_disjoint_timer_query_webgl2") || this._gl.getExtension("EXT_disjoint_timer_query"), supportOcclusionQuery: 1 < this._webGLVersion, canUseTimestampForTimerQuery: !1, drawBuffersExtension: !1, maxMSAASamples: 1, colorBufferFloat: !!(1 < this._webGLVersion && this._gl.getExtension("EXT_color_buffer_float")), textureFloat: !!(1 < this._webGLVersion || this._gl.getExtension("OES_texture_float")), textureHalfFloat: !!(1 < this._webGLVersion || this._gl.getExtension("OES_texture_half_float")), textureHalfFloatRender: !1, textureFloatLinearFiltering: !1, textureFloatRender: !1, textureHalfFloatLinearFiltering: !1, vertexArrayObject: !1, instancedArrays: !1, textureLOD: !!(1 < this._webGLVersion || this._gl.getExtension("EXT_shader_texture_lod")), blendMinMax: !1, multiview: this._gl.getExtension("OVR_multiview2"), oculusMultiview: this._gl.getExtension("OCULUS_multiview"), depthTextureExtension: !1, canUseGLInstanceID: 1 < this._webGLVersion, canUseGLVertexID: 1 < this._webGLVersion, supportComputeShaders: !1, supportSRGBBuffers: !1, supportTransformFeedbacks: 1 < this._webGLVersion, textureMaxLevel: 1 < this._webGLVersion, texture2DArrayMaxLayerCount: 1 < this._webGLVersion ? this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS) : 128 }, this._glVersion = this._gl.getParameter(this._gl.VERSION);const rendererInfo = this._gl.getExtension("WEBGL_debug_renderer_info");if (null != rendererInfo && (this._glRenderer = this._gl.getParameter(rendererInfo.UNMASKED_RENDERER_WEBGL), this._glVendor = this._gl.getParameter(rendererInfo.UNMASKED_VENDOR_WEBGL)), this._glVendor || (this._glVendor = this._gl.getParameter(this._gl.VENDOR) || "Unknown vendor"), this._glRenderer || (this._glRenderer = this._gl.getParameter(this._gl.RENDERER) || "Unknown renderer"), 36193 !== this._gl.HALF_FLOAT_OES && (this._gl.HALF_FLOAT_OES = 36193), 34842 !== this._gl.RGBA16F && (this._gl.RGBA16F = 34842), 34836 !== this._gl.RGBA32F && (this._gl.RGBA32F = 34836), 35056 !== this._gl.DEPTH24_STENCIL8 && (this._gl.DEPTH24_STENCIL8 = 35056), this._caps.timerQuery && (1 === this._webGLVersion && (this._gl.getQuery = this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)), this._caps.canUseTimestampForTimerQuery = 0 < (null !== (_a = this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT, this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)) && void 0 !== _a ? _a : 0)), this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0, this._caps.textureFloatLinearFiltering = !!(this._caps.textureFloat && this._gl.getExtension("OES_texture_float_linear")), this._caps.textureFloatRender = !!(this._caps.textureFloat && this._canRenderToFloatFramebuffer()), this._caps.textureHalfFloatLinearFiltering = !!(1 < this._webGLVersion || this._caps.textureHalfFloat && this._gl.getExtension("OES_texture_half_float_linear")), this._caps.astc && (this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR), this._caps.bptc && (this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT), this._caps.s3tc_srgb && (this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT, this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT), this._caps.etc2 && (this._gl.COMPRESSED_SRGB8_ETC2 = this._caps.etc2.COMPRESSED_SRGB8_ETC2, this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC), 1 < this._webGLVersion && 5131 !== this._gl.HALF_FLOAT_OES && (this._gl.HALF_FLOAT_OES = 5131), this._caps.textureHalfFloatRender = this._caps.textureHalfFloat && this._canRenderToHalfFloatFramebuffer(), 1 < this._webGLVersion) this._caps.drawBuffersExtension = !0, this._caps.maxMSAASamples = null === this._maxMSAASamplesOverride ? this._gl.getParameter(this._gl.MAX_SAMPLES) : this._maxMSAASamplesOverride;else {const drawBuffersExtension = this._gl.getExtension("WEBGL_draw_buffers");if (null !== drawBuffersExtension) {this._caps.drawBuffersExtension = !0, this._gl.drawBuffers = drawBuffersExtension.drawBuffersWEBGL.bind(drawBuffersExtension), this._gl.DRAW_FRAMEBUFFER = this._gl.FRAMEBUFFER;for (let i = 0; 16 > i; i++) this._gl["COLOR_ATTACHMENT" + i + "_WEBGL"] = drawBuffersExtension["COLOR_ATTACHMENT" + i + "_WEBGL"];}}if (1 < this._webGLVersion) this._caps.depthTextureExtension = !0;else {const depthTextureExtension = this._gl.getExtension("WEBGL_depth_texture");null != depthTextureExtension && (this._caps.depthTextureExtension = !0, this._gl.UNSIGNED_INT_24_8 = depthTextureExtension.UNSIGNED_INT_24_8_WEBGL);}if (this.disableVertexArrayObjects) this._caps.vertexArrayObject = !1;else if (1 < this._webGLVersion) this._caps.vertexArrayObject = !0;else {const vertexArrayObjectExtension = this._gl.getExtension("OES_vertex_array_object");null != vertexArrayObjectExtension && (this._caps.vertexArrayObject = !0, this._gl.createVertexArray = vertexArrayObjectExtension.createVertexArrayOES.bind(vertexArrayObjectExtension), this._gl.bindVertexArray = vertexArrayObjectExtension.bindVertexArrayOES.bind(vertexArrayObjectExtension), this._gl.deleteVertexArray = vertexArrayObjectExtension.deleteVertexArrayOES.bind(vertexArrayObjectExtension));}if (1 < this._webGLVersion) this._caps.instancedArrays = !0;else {const instanceExtension = this._gl.getExtension("ANGLE_instanced_arrays");null == instanceExtension ? this._caps.instancedArrays = !1 : (this._caps.instancedArrays = !0, this._gl.drawArraysInstanced = instanceExtension.drawArraysInstancedANGLE.bind(instanceExtension), this._gl.drawElementsInstanced = instanceExtension.drawElementsInstancedANGLE.bind(instanceExtension), this._gl.vertexAttribDivisor = instanceExtension.vertexAttribDivisorANGLE.bind(instanceExtension));}if (this._gl.getShaderPrecisionFormat) {const vertexhighp = this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER, this._gl.HIGH_FLOAT),fragmenthighp = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT);vertexhighp && fragmenthighp && (this._caps.highPrecisionShaderSupported = 0 !== vertexhighp.precision && 0 !== fragmenthighp.precision);}if (1 < this._webGLVersion) this._caps.blendMinMax = !0;else {const blendMinMaxExtension = this._gl.getExtension("EXT_blend_minmax");null != blendMinMaxExtension && (this._caps.blendMinMax = !0, this._gl.MAX = blendMinMaxExtension.MAX_EXT, this._gl.MIN = blendMinMaxExtension.MIN_EXT);}if (!this._caps.supportSRGBBuffers) {if (1 < this._webGLVersion) this._caps.supportSRGBBuffers = !0;else {const sRGBExtension = this._gl.getExtension("EXT_sRGB");null != sRGBExtension && (this._caps.supportSRGBBuffers = !0, this._gl.SRGB = sRGBExtension.SRGB_EXT, this._gl.SRGB8 = sRGBExtension.SRGB_ALPHA_EXT, this._gl.SRGB8_ALPHA8 = sRGBExtension.SRGB_ALPHA_EXT);}this._caps.supportSRGBBuffers = this._caps.supportSRGBBuffers && !!(this._creationOptions && this._creationOptions.forceSRGBBufferSupportState);}this._depthCullingState.depthTest = !0, this._depthCullingState.depthFunc = this._gl.LEQUAL, this._depthCullingState.depthMask = !0, this._maxSimultaneousTextures = this._caps.maxCombinedTexturesImageUnits;for (let slot = 0; slot < this._maxSimultaneousTextures; slot++) this._nextFreeTextureSlots.push(slot);}_initFeatures() {this._features = { forceBitmapOverHTMLImageElement: !1, supportRenderAndCopyToLodForFloatTextures: 1 !== this._webGLVersion, supportDepthStencilTexture: 1 !== this._webGLVersion, supportShadowSamplers: 1 !== this._webGLVersion, uniformBufferHardCheckMatrix: !1, allowTexturePrefiltering: 1 !== this._webGLVersion, trackUbosInFrame: !1, checkUbosContentBeforeUpload: !1, supportCSM: 1 !== this._webGLVersion, basisNeedsPOT: 1 === this._webGLVersion, support3DTextures: 1 !== this._webGLVersion, needTypeSuffixInShaderConstants: 1 !== this._webGLVersion, supportMSAA: 1 !== this._webGLVersion, supportSSAO2: 1 !== this._webGLVersion, supportExtendedTextureFormats: 1 !== this._webGLVersion, supportSwitchCaseInShader: 1 !== this._webGLVersion, supportSyncTextureRead: !0, needsInvertingBitmap: !0, useUBOBindingCache: !0, needShaderCodeInlining: !1, needToAlwaysBindUniformBuffers: !1, supportRenderPasses: !1, supportSpriteInstancing: !0, _collectUbosUpdatedInFrame: !1 };}get webGLVersion() {return this._webGLVersion;}getClassName() {return "ThinEngine";}get isStencilEnable() {return this._isStencilEnable;}_prepareWorkingCanvas() {if (!this._workingCanvas) {this._workingCanvas = this.createCanvas(1, 1);const context = this._workingCanvas.getContext("2d");context && (this._workingContext = context);}}resetTextureCache() {for (const key in this._boundTexturesCache) Object.prototype.hasOwnProperty.call(this._boundTexturesCache, key) && (this._boundTexturesCache[key] = null);this._currentTextureChannel = -1;}getInfo() {return this.getGlInfo();}getGlInfo() {return { vendor: this._glVendor, renderer: this._glRenderer, version: this._glVersion };}setHardwareScalingLevel(level) {this._hardwareScalingLevel = level, this.resize();}getHardwareScalingLevel() {return this._hardwareScalingLevel;}getLoadedTexturesCache() {return this._internalTexturesCache;}getCaps() {return this._caps;}stopRenderLoop(renderFunction) {if (!renderFunction) return void (this._activeRenderLoops = []);const index = this._activeRenderLoops.indexOf(renderFunction);0 <= index && this._activeRenderLoops.splice(index, 1);}_renderLoop() {if (!this._contextWasLost) {let shouldRender = !0;if (!this.renderEvenInBackground && this._windowIsBackground && (shouldRender = !1), shouldRender) {this.beginFrame();for (let index = 0; index < this._activeRenderLoops.length; index++) {const renderFunction = this._activeRenderLoops[index];renderFunction();}this.endFrame();}}0 < this._activeRenderLoops.length ? this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow()) : this._renderingQueueLaunched = !1;}getRenderingCanvas() {return this._renderingCanvas;}getAudioContext() {return this._audioContext;}getAudioDestination() {return this._audioDestination;}getHostWindow() {return (0,domManagement/* IsWindowObjectExist */.CG)() ? this._renderingCanvas && this._renderingCanvas.ownerDocument && this._renderingCanvas.ownerDocument.defaultView ? this._renderingCanvas.ownerDocument.defaultView : window : null;}getRenderWidth(useScreen = !1) {return !useScreen && this._currentRenderTarget ? this._currentRenderTarget.width : this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferWidth : this._gl.drawingBufferWidth;}getRenderHeight(useScreen = !1) {return !useScreen && this._currentRenderTarget ? this._currentRenderTarget.height : this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferHeight : this._gl.drawingBufferHeight;}_queueNewFrame(bindedRenderFunction, requester) {return ThinEngine.QueueNewFrame(bindedRenderFunction, requester);}runRenderLoop(renderFunction) {-1 !== this._activeRenderLoops.indexOf(renderFunction) || (this._activeRenderLoops.push(renderFunction), !this._renderingQueueLaunched && (this._renderingQueueLaunched = !0, this._boundRenderFunction = this._renderLoop.bind(this), this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow())));}clear(color, backBuffer, depth, stencil = !1) {const useStencilGlobalOnly = this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly = !0, this.applyStates(), this.stencilStateComposer.useStencilGlobalOnly = useStencilGlobalOnly;let mode = 0;backBuffer && color && (this._gl.clearColor(color.r, color.g, color.b, color.a === void 0 ? 1 : color.a), mode |= this._gl.COLOR_BUFFER_BIT), depth && (this.useReverseDepthBuffer ? (this._depthCullingState.depthFunc = this._gl.GEQUAL, this._gl.clearDepth(0)) : this._gl.clearDepth(1), mode |= this._gl.DEPTH_BUFFER_BIT), stencil && (this._gl.clearStencil(0), mode |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(mode);}_viewport(x, y, width, height) {(x !== this._viewportCached.x || y !== this._viewportCached.y || width !== this._viewportCached.z || height !== this._viewportCached.w) && (this._viewportCached.x = x, this._viewportCached.y = y, this._viewportCached.z = width, this._viewportCached.w = height, this._gl.viewport(x, y, width, height));}setViewport(viewport, requiredWidth, requiredHeight) {const width = requiredWidth || this.getRenderWidth(),height = requiredHeight || this.getRenderHeight(),x = viewport.x || 0,y = viewport.y || 0;this._cachedViewport = viewport, this._viewport(x * width, y * height, width * viewport.width, height * viewport.height);}beginFrame() {}endFrame() {this._badOS && this.flushFramebuffer(), this._frameId++;}resize(forceSetSize = !1) {let width, height;if (this.adaptToDeviceRatio) {const devicePixelRatio = (0,domManagement/* IsWindowObjectExist */.CG)() ? window.devicePixelRatio || 1 : 1,changeRatio = this._lastDevicePixelRatio / devicePixelRatio;this._lastDevicePixelRatio = devicePixelRatio, this._hardwareScalingLevel *= changeRatio;}(0,domManagement/* IsWindowObjectExist */.CG)() ? (width = this._renderingCanvas ? this._renderingCanvas.clientWidth || this._renderingCanvas.width : window.innerWidth, height = this._renderingCanvas ? this._renderingCanvas.clientHeight || this._renderingCanvas.height : window.innerHeight) : (width = this._renderingCanvas ? this._renderingCanvas.width : 100, height = this._renderingCanvas ? this._renderingCanvas.height : 100), this.setSize(width / this._hardwareScalingLevel, height / this._hardwareScalingLevel, forceSetSize);}setSize(width, height, forceSetSize = !1) {return !!this._renderingCanvas && (width |= 0, height |= 0, forceSetSize || this._renderingCanvas.width !== width || this._renderingCanvas.height !== height) && (this._renderingCanvas.width = width, this._renderingCanvas.height = height, !0);}bindFramebuffer(texture, faceIndex = 0, requiredWidth, requiredHeight, forceFullscreenViewport, lodLevel = 0, layer = 0) {var _a, _b, _c, _d, _e;const webglRTWrapper = texture;this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = texture, this._bindUnboundFramebuffer(webglRTWrapper._MSAAFramebuffer ? webglRTWrapper._MSAAFramebuffer : webglRTWrapper._framebuffer);const gl = this._gl;texture.is2DArray ? gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, null === (_a = texture.texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource, lodLevel, layer) : texture.isCube && gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, null === (_b = texture.texture._hardwareTexture) || void 0 === _b ? void 0 : _b.underlyingResource, lodLevel);const depthStencilTexture = texture._depthStencilTexture;if (depthStencilTexture) {const attachment = texture._depthStencilTextureWithStencil ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;texture.is2DArray ? gl.framebufferTextureLayer(gl.FRAMEBUFFER, attachment, null === (_c = depthStencilTexture._hardwareTexture) || void 0 === _c ? void 0 : _c.underlyingResource, lodLevel, layer) : texture.isCube ? gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, null === (_d = depthStencilTexture._hardwareTexture) || void 0 === _d ? void 0 : _d.underlyingResource, lodLevel) : gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, null === (_e = depthStencilTexture._hardwareTexture) || void 0 === _e ? void 0 : _e.underlyingResource, lodLevel);}this._cachedViewport && !forceFullscreenViewport ? this.setViewport(this._cachedViewport, requiredWidth, requiredHeight) : (!requiredWidth && (requiredWidth = texture.width, lodLevel && (requiredWidth /= Math.pow(2, lodLevel))), !requiredHeight && (requiredHeight = texture.height, lodLevel && (requiredHeight /= Math.pow(2, lodLevel))), this._viewport(0, 0, requiredWidth, requiredHeight)), this.wipeCaches();}setState(culling, zOffset = 0, force, reverseSide = !1, cullBackFaces, stencil, zOffsetUnits = 0) {var _a, _b;(this._depthCullingState.cull !== culling || force) && (this._depthCullingState.cull = culling);const cullFace = null === (_b = null !== (_a = this.cullBackFaces) && void 0 !== _a ? _a : cullBackFaces) || void 0 === _b || _b ? this._gl.BACK : this._gl.FRONT;(this._depthCullingState.cullFace !== cullFace || force) && (this._depthCullingState.cullFace = cullFace), this.setZOffset(zOffset), this.setZOffsetUnits(zOffsetUnits);const frontFace = reverseSide ? this._gl.CW : this._gl.CCW;(this._depthCullingState.frontFace !== frontFace || force) && (this._depthCullingState.frontFace = frontFace), this._stencilStateComposer.stencilMaterial = stencil;}getDepthBuffer() {return this._depthCullingState.depthTest;}setDepthBuffer(enable) {this._depthCullingState.depthTest = enable;}setZOffset(value) {this._depthCullingState.zOffset = this.useReverseDepthBuffer ? -value : value;}getZOffset() {const zOffset = this._depthCullingState.zOffset;return this.useReverseDepthBuffer ? -zOffset : zOffset;}setZOffsetUnits(value) {this._depthCullingState.zOffsetUnits = this.useReverseDepthBuffer ? -value : value;}getZOffsetUnits() {const zOffsetUnits = this._depthCullingState.zOffsetUnits;return this.useReverseDepthBuffer ? -zOffsetUnits : zOffsetUnits;}_bindUnboundFramebuffer(framebuffer) {this._currentFramebuffer !== framebuffer && (this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, framebuffer), this._currentFramebuffer = framebuffer);}_currentFrameBufferIsDefaultFrameBuffer() {return null === this._currentFramebuffer;}generateMipmaps(texture) {this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, !0), this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null);}unBindFramebuffer(texture, disableGenerateMipMaps = !1, onBeforeUnbind) {var _a;const webglRTWrapper = texture;this._currentRenderTarget = null;const gl = this._gl;if (webglRTWrapper._MSAAFramebuffer) {if (texture.isMulti) return void this.unBindMultiColorAttachmentFramebuffer(texture, disableGenerateMipMaps, onBeforeUnbind);gl.bindFramebuffer(gl.READ_FRAMEBUFFER, webglRTWrapper._MSAAFramebuffer), gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, webglRTWrapper._framebuffer), gl.blitFramebuffer(0, 0, texture.width, texture.height, 0, 0, texture.width, texture.height, gl.COLOR_BUFFER_BIT, gl.NEAREST);}!(null !== (_a = texture.texture) && void 0 !== _a) || !_a.generateMipMaps || disableGenerateMipMaps || texture.isCube || this.generateMipmaps(texture.texture), onBeforeUnbind && (webglRTWrapper._MSAAFramebuffer && this._bindUnboundFramebuffer(webglRTWrapper._framebuffer), onBeforeUnbind()), this._bindUnboundFramebuffer(null);}flushFramebuffer() {this._gl.flush();}restoreDefaultFramebuffer() {this._currentRenderTarget ? this.unBindFramebuffer(this._currentRenderTarget) : this._bindUnboundFramebuffer(null), this._cachedViewport && this.setViewport(this._cachedViewport), this.wipeCaches();}_resetVertexBufferBinding() {this.bindArrayBuffer(null), this._cachedVertexBuffers = null;}createVertexBuffer(data) {return this._createVertexBuffer(data, this._gl.STATIC_DRAW);}_createVertexBuffer(data, usage) {const vbo = this._gl.createBuffer();if (!vbo) throw new Error("Unable to create vertex buffer");const dataBuffer = new webGLDataBuffer/* WebGLDataBuffer */.M(vbo);return this.bindArrayBuffer(dataBuffer), data instanceof Array ? this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(data), usage) : this._gl.bufferData(this._gl.ARRAY_BUFFER, data, usage), this._resetVertexBufferBinding(), dataBuffer.references = 1, dataBuffer;}createDynamicVertexBuffer(data) {return this._createVertexBuffer(data, this._gl.DYNAMIC_DRAW);}_resetIndexBufferBinding() {this.bindIndexBuffer(null), this._cachedIndexBuffer = null;}createIndexBuffer(indices, updatable) {const vbo = this._gl.createBuffer(),dataBuffer = new webGLDataBuffer/* WebGLDataBuffer */.M(vbo);if (!vbo) throw new Error("Unable to create index buffer");this.bindIndexBuffer(dataBuffer);const data = this._normalizeIndexData(indices);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, data, updatable ? this._gl.DYNAMIC_DRAW : this._gl.STATIC_DRAW), this._resetIndexBufferBinding(), dataBuffer.references = 1, dataBuffer.is32Bits = 4 === data.BYTES_PER_ELEMENT, dataBuffer;}_normalizeIndexData(indices) {const bytesPerElement = indices.BYTES_PER_ELEMENT;if (2 === bytesPerElement) return indices;if (this._caps.uintIndices) {if (indices instanceof Uint32Array) return indices;for (let index = 0; index < indices.length; index++) if (65535 <= indices[index]) return new Uint32Array(indices);return new Uint16Array(indices);}return new Uint16Array(indices);}bindArrayBuffer(buffer) {this._vaoRecordInProgress || this._unbindVertexArrayObject(), this._bindBuffer(buffer, this._gl.ARRAY_BUFFER);}bindUniformBlock(pipelineContext, blockName, index) {const program = pipelineContext.program,uniformLocation = this._gl.getUniformBlockIndex(program, blockName);this._gl.uniformBlockBinding(program, uniformLocation, index);}bindIndexBuffer(buffer) {this._vaoRecordInProgress || this._unbindVertexArrayObject(), this._bindBuffer(buffer, this._gl.ELEMENT_ARRAY_BUFFER);}_bindBuffer(buffer, target) {(this._vaoRecordInProgress || this._currentBoundBuffer[target] !== buffer) && (this._gl.bindBuffer(target, buffer ? buffer.underlyingResource : null), this._currentBoundBuffer[target] = buffer);}updateArrayBuffer(data) {this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data);}_vertexAttribPointer(buffer, indx, size, type, normalized, stride, offset) {const pointer = this._currentBufferPointers[indx];if (!pointer) return;let changed = !1;pointer.active ? (pointer.buffer !== buffer && (pointer.buffer = buffer, changed = !0), pointer.size !== size && (pointer.size = size, changed = !0), pointer.type !== type && (pointer.type = type, changed = !0), pointer.normalized !== normalized && (pointer.normalized = normalized, changed = !0), pointer.stride !== stride && (pointer.stride = stride, changed = !0), pointer.offset !== offset && (pointer.offset = offset, changed = !0)) : (changed = !0, pointer.active = !0, pointer.index = indx, pointer.size = size, pointer.type = type, pointer.normalized = normalized, pointer.stride = stride, pointer.offset = offset, pointer.buffer = buffer), (changed || this._vaoRecordInProgress) && (this.bindArrayBuffer(buffer), type === this._gl.UNSIGNED_INT || type === this._gl.INT ? this._gl.vertexAttribIPointer(indx, size, type, stride, offset) : this._gl.vertexAttribPointer(indx, size, type, normalized, stride, offset));}_bindIndexBufferWithCache(indexBuffer) {null == indexBuffer || this._cachedIndexBuffer !== indexBuffer && (this._cachedIndexBuffer = indexBuffer, this.bindIndexBuffer(indexBuffer), this._uintIndicesCurrentlySet = indexBuffer.is32Bits);}_bindVertexBuffersAttributes(vertexBuffers, effect, overrideVertexBuffers) {const attributes = effect.getAttributesNames();this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.unbindAllAttributes();for (let index = 0; index < attributes.length; index++) {const order = effect.getAttributeLocation(index);if (0 <= order) {const ai = attributes[index];let vertexBuffer = null;if (overrideVertexBuffers && (vertexBuffer = overrideVertexBuffers[ai]), vertexBuffer || (vertexBuffer = vertexBuffers[ai]), !vertexBuffer) continue;this._gl.enableVertexAttribArray(order), this._vaoRecordInProgress || (this._vertexAttribArraysEnabled[order] = !0);const buffer = vertexBuffer.getBuffer();buffer && (this._vertexAttribPointer(buffer, order, vertexBuffer.getSize(), vertexBuffer.type, vertexBuffer.normalized, vertexBuffer.byteStride, vertexBuffer.byteOffset), vertexBuffer.getIsInstanced() && (this._gl.vertexAttribDivisor(order, vertexBuffer.getInstanceDivisor()), !this._vaoRecordInProgress && (this._currentInstanceLocations.push(order), this._currentInstanceBuffers.push(buffer))));}}}recordVertexArrayObject(vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {const vao = this._gl.createVertexArray();if (!vao) throw new Error("Unable to create VAO");return this._vaoRecordInProgress = !0, this._gl.bindVertexArray(vao), this._mustWipeVertexAttributes = !0, this._bindVertexBuffersAttributes(vertexBuffers, effect, overrideVertexBuffers), this.bindIndexBuffer(indexBuffer), this._vaoRecordInProgress = !1, this._gl.bindVertexArray(null), vao;}bindVertexArrayObject(vertexArrayObject, indexBuffer) {this._cachedVertexArrayObject !== vertexArrayObject && (this._cachedVertexArrayObject = vertexArrayObject, this._gl.bindVertexArray(vertexArrayObject), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._uintIndicesCurrentlySet = null != indexBuffer && indexBuffer.is32Bits, this._mustWipeVertexAttributes = !0);}bindBuffersDirectly(vertexBuffer, indexBuffer, vertexDeclaration, vertexStrideSize, effect) {if (this._cachedVertexBuffers !== vertexBuffer || this._cachedEffectForVertexBuffers !== effect) {this._cachedVertexBuffers = vertexBuffer, this._cachedEffectForVertexBuffers = effect;const attributesCount = effect.getAttributesCount();this._unbindVertexArrayObject(), this.unbindAllAttributes();let offset = 0;for (let index = 0; index < attributesCount; index++) if (index < vertexDeclaration.length) {const order = effect.getAttributeLocation(index);0 <= order && (this._gl.enableVertexAttribArray(order), this._vertexAttribArraysEnabled[order] = !0, this._vertexAttribPointer(vertexBuffer, order, vertexDeclaration[index], this._gl.FLOAT, !1, vertexStrideSize, offset)), offset += 4 * vertexDeclaration[index];}}this._bindIndexBufferWithCache(indexBuffer);}_unbindVertexArrayObject() {this._cachedVertexArrayObject && (this._cachedVertexArrayObject = null, this._gl.bindVertexArray(null));}bindBuffers(vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {(this._cachedVertexBuffers !== vertexBuffers || this._cachedEffectForVertexBuffers !== effect) && (this._cachedVertexBuffers = vertexBuffers, this._cachedEffectForVertexBuffers = effect, this._bindVertexBuffersAttributes(vertexBuffers, effect, overrideVertexBuffers)), this._bindIndexBufferWithCache(indexBuffer);}unbindInstanceAttributes() {let boundBuffer;for (let i = 0, ul = this._currentInstanceLocations.length; i < ul; i++) {const instancesBuffer = this._currentInstanceBuffers[i];boundBuffer != instancesBuffer && instancesBuffer.references && (boundBuffer = instancesBuffer, this.bindArrayBuffer(instancesBuffer));const offsetLocation = this._currentInstanceLocations[i];this._gl.vertexAttribDivisor(offsetLocation, 0);}this._currentInstanceBuffers.length = 0, this._currentInstanceLocations.length = 0;}releaseVertexArrayObject(vao) {this._gl.deleteVertexArray(vao);}_releaseBuffer(buffer) {return buffer.references--, 0 === buffer.references && (this._deleteBuffer(buffer), !0);}_deleteBuffer(buffer) {this._gl.deleteBuffer(buffer.underlyingResource);}updateAndBindInstancesBuffer(instancesBuffer, data, offsetLocations) {if (this.bindArrayBuffer(instancesBuffer), data && this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data), void 0 !== offsetLocations[0].index) this.bindInstancesBuffer(instancesBuffer, offsetLocations, !0);else for (let index = 0; 4 > index; index++) {const offsetLocation = offsetLocations[index];this._vertexAttribArraysEnabled[offsetLocation] || (this._gl.enableVertexAttribArray(offsetLocation), this._vertexAttribArraysEnabled[offsetLocation] = !0), this._vertexAttribPointer(instancesBuffer, offsetLocation, 4, this._gl.FLOAT, !1, 64, 16 * index), this._gl.vertexAttribDivisor(offsetLocation, 1), this._currentInstanceLocations.push(offsetLocation), this._currentInstanceBuffers.push(instancesBuffer);}}bindInstancesBuffer(instancesBuffer, attributesInfo, computeStride = !0) {this.bindArrayBuffer(instancesBuffer);let stride = 0;if (computeStride) for (let i = 0; i < attributesInfo.length; i++) {const ai = attributesInfo[i];stride += 4 * ai.attributeSize;}for (let i = 0; i < attributesInfo.length; i++) {const ai = attributesInfo[i];(void 0 === ai.index && (ai.index = this._currentEffect.getAttributeLocationByName(ai.attributeName)), !(0 > ai.index)) && (this._vertexAttribArraysEnabled[ai.index] || (this._gl.enableVertexAttribArray(ai.index), this._vertexAttribArraysEnabled[ai.index] = !0), this._vertexAttribPointer(instancesBuffer, ai.index, ai.attributeSize, ai.attributeType || this._gl.FLOAT, ai.normalized || !1, stride, ai.offset), this._gl.vertexAttribDivisor(ai.index, void 0 === ai.divisor ? 1 : ai.divisor), this._currentInstanceLocations.push(ai.index), this._currentInstanceBuffers.push(instancesBuffer));}}disableInstanceAttributeByName(name) {if (this._currentEffect) {const attributeLocation = this._currentEffect.getAttributeLocationByName(name);this.disableInstanceAttribute(attributeLocation);}}disableInstanceAttribute(attributeLocation) {let index,shouldClean = !1;for (; -1 !== (index = this._currentInstanceLocations.indexOf(attributeLocation));) this._currentInstanceLocations.splice(index, 1), this._currentInstanceBuffers.splice(index, 1), shouldClean = !0, index = this._currentInstanceLocations.indexOf(attributeLocation);shouldClean && (this._gl.vertexAttribDivisor(attributeLocation, 0), this.disableAttributeByIndex(attributeLocation));}disableAttributeByIndex(attributeLocation) {this._gl.disableVertexAttribArray(attributeLocation), this._vertexAttribArraysEnabled[attributeLocation] = !1, this._currentBufferPointers[attributeLocation].active = !1;}draw(useTriangles, indexStart, indexCount, instancesCount) {this.drawElementsType(useTriangles ? 0 : 1, indexStart, indexCount, instancesCount);}drawPointClouds(verticesStart, verticesCount, instancesCount) {this.drawArraysType(2, verticesStart, verticesCount, instancesCount);}drawUnIndexed(useTriangles, verticesStart, verticesCount, instancesCount) {this.drawArraysType(useTriangles ? 0 : 1, verticesStart, verticesCount, instancesCount);}drawElementsType(fillMode, indexStart, indexCount, instancesCount) {this.applyStates(), this._reportDrawCall();const drawMode = this._drawMode(fillMode),indexFormat = this._uintIndicesCurrentlySet ? this._gl.UNSIGNED_INT : this._gl.UNSIGNED_SHORT,mult = this._uintIndicesCurrentlySet ? 4 : 2;instancesCount ? this._gl.drawElementsInstanced(drawMode, indexCount, indexFormat, indexStart * mult, instancesCount) : this._gl.drawElements(drawMode, indexCount, indexFormat, indexStart * mult);}drawArraysType(fillMode, verticesStart, verticesCount, instancesCount) {this.applyStates(), this._reportDrawCall();const drawMode = this._drawMode(fillMode);instancesCount ? this._gl.drawArraysInstanced(drawMode, verticesStart, verticesCount, instancesCount) : this._gl.drawArrays(drawMode, verticesStart, verticesCount);}_drawMode(fillMode) {return 0 === fillMode ? this._gl.TRIANGLES : 2 === fillMode ? this._gl.POINTS : 1 === fillMode ? this._gl.LINES : 3 === fillMode ? this._gl.POINTS : 4 === fillMode ? this._gl.LINES : 5 === fillMode ? this._gl.LINE_LOOP : 6 === fillMode ? this._gl.LINE_STRIP : 7 === fillMode ? this._gl.TRIANGLE_STRIP : 8 === fillMode ? this._gl.TRIANGLE_FAN : this._gl.TRIANGLES;}_reportDrawCall() {}_releaseEffect(effect) {this._compiledEffects[effect._key] && delete this._compiledEffects[effect._key];const pipelineContext = effect.getPipelineContext();pipelineContext && this._deletePipelineContext(pipelineContext);}_deletePipelineContext(pipelineContext) {const webGLPipelineContext = pipelineContext;webGLPipelineContext && webGLPipelineContext.program && (webGLPipelineContext.program.__SPECTOR_rebuildProgram = null, this._gl.deleteProgram(webGLPipelineContext.program));}_getGlobalDefines(defines) {if (defines) return this.isNDCHalfZRange ? defines.IS_NDC_HALF_ZRANGE = "" : delete defines.IS_NDC_HALF_ZRANGE, this.useReverseDepthBuffer ? defines.USE_REVERSE_DEPTHBUFFER = "" : delete defines.USE_REVERSE_DEPTHBUFFER, void (this.useExactSrgbConversions ? defines.USE_EXACT_SRGB_CONVERSIONS = "" : delete defines.USE_EXACT_SRGB_CONVERSIONS);else {let s = "";return this.isNDCHalfZRange && (s += "#define IS_NDC_HALF_ZRANGE"), this.useReverseDepthBuffer && (s && (s += "\n"), s += "#define USE_REVERSE_DEPTHBUFFER"), this.useExactSrgbConversions && (s && (s += "\n"), s += "#define USE_EXACT_SRGB_CONVERSIONS"), s;}}createEffect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, defines, fallbacks, onCompiled, onError, indexParameters, shaderLanguage = Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL) {var _a;const vertex = baseName.vertexElement || baseName.vertex || baseName.vertexToken || baseName.vertexSource || baseName,fragment = baseName.fragmentElement || baseName.fragment || baseName.fragmentToken || baseName.fragmentSource || baseName,globalDefines = this._getGlobalDefines();let fullDefines = null !== (_a = null !== defines && void 0 !== defines ? defines : attributesNamesOrOptions.defines) && void 0 !== _a ? _a : "";globalDefines && (fullDefines += globalDefines);const name = vertex + "+" + fragment + "@" + fullDefines;if (this._compiledEffects[name]) {const compiledEffect = this._compiledEffects[name];return onCompiled && compiledEffect.isReady() && onCompiled(compiledEffect), compiledEffect;}const effect = new Materials_effect/* Effect */.Q(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters, name, shaderLanguage);return this._compiledEffects[name] = effect, effect;}static _ConcatenateShader(source, defines, shaderVersion = "") {return shaderVersion + (defines ? defines + "\n" : "") + source;}_compileShader(source, type, defines, shaderVersion) {return this._compileRawShader(ThinEngine._ConcatenateShader(source, defines, shaderVersion), type);}_compileRawShader(source, type) {const gl = this._gl,shader = gl.createShader("vertex" === type ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);if (!shader) {let error = gl.NO_ERROR,tempError = gl.NO_ERROR;for (; (tempError = gl.getError()) !== gl.NO_ERROR;) error = tempError;throw new Error(`Something went wrong while creating a gl ${type} shader object. gl error=${error}, gl isContextLost=${gl.isContextLost()}, _contextWasLost=${this._contextWasLost}`);}return gl.shaderSource(shader, source), gl.compileShader(shader), shader;}_getShaderSource(shader) {return this._gl.getShaderSource(shader);}createRawShaderProgram(pipelineContext, vertexCode, fragmentCode, context, transformFeedbackVaryings = null) {context = context || this._gl;const vertexShader = this._compileRawShader(vertexCode, "vertex"),fragmentShader = this._compileRawShader(fragmentCode, "fragment");return this._createShaderProgram(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings);}createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings = null) {context = context || this._gl;const shaderVersion = 1 < this._webGLVersion ? "#version 300 es\n#define WEBGL2 \n" : "",vertexShader = this._compileShader(vertexCode, "vertex", defines, shaderVersion),fragmentShader = this._compileShader(fragmentCode, "fragment", defines, shaderVersion);return this._createShaderProgram(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings);}inlineShaderCode(code) {return code;}createPipelineContext() {const pipelineContext = new webGLPipelineContext/* WebGLPipelineContext */.y();return pipelineContext.engine = this, this._caps.parallelShaderCompile && (pipelineContext.isParallelCompiled = !0), pipelineContext;}createMaterialContext() {}createDrawContext() {}_createShaderProgram(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings = null) {const shaderProgram = context.createProgram();if (pipelineContext.program = shaderProgram, !shaderProgram) throw new Error("Unable to create program");return context.attachShader(shaderProgram, vertexShader), context.attachShader(shaderProgram, fragmentShader), context.linkProgram(shaderProgram), pipelineContext.context = context, pipelineContext.vertexShader = vertexShader, pipelineContext.fragmentShader = fragmentShader, pipelineContext.isParallelCompiled || this._finalizePipelineContext(pipelineContext), shaderProgram;}_finalizePipelineContext(pipelineContext) {const context = pipelineContext.context,vertexShader = pipelineContext.vertexShader,fragmentShader = pipelineContext.fragmentShader,program = pipelineContext.program,linked = context.getProgramParameter(program, context.LINK_STATUS);if (!linked) {if (!this._gl.getShaderParameter(vertexShader, this._gl.COMPILE_STATUS)) {const log = this._gl.getShaderInfoLog(vertexShader);if (log) throw pipelineContext.vertexCompilationError = log, new Error("VERTEX SHADER " + log);}if (!this._gl.getShaderParameter(fragmentShader, this._gl.COMPILE_STATUS)) {const log = this._gl.getShaderInfoLog(fragmentShader);if (log) throw pipelineContext.fragmentCompilationError = log, new Error("FRAGMENT SHADER " + log);}const error = context.getProgramInfoLog(program);if (error) throw pipelineContext.programLinkError = error, new Error(error);}if (this.validateShaderPrograms) {context.validateProgram(program);const validated = context.getProgramParameter(program, context.VALIDATE_STATUS);if (!validated) {const error = context.getProgramInfoLog(program);if (error) throw pipelineContext.programValidationError = error, new Error(error);}}context.deleteShader(vertexShader), context.deleteShader(fragmentShader), pipelineContext.vertexShader = void 0, pipelineContext.fragmentShader = void 0, pipelineContext.onCompiled && (pipelineContext.onCompiled(), pipelineContext.onCompiled = void 0);}_preparePipelineContext(pipelineContext, vertexSourceCode, fragmentSourceCode, createAsRaw, rawVertexSourceCode, rawFragmentSourceCode, rebuildRebind, defines, transformFeedbackVaryings) {const webGLRenderingState = pipelineContext;webGLRenderingState.program = createAsRaw ? this.createRawShaderProgram(webGLRenderingState, vertexSourceCode, fragmentSourceCode, void 0, transformFeedbackVaryings) : this.createShaderProgram(webGLRenderingState, vertexSourceCode, fragmentSourceCode, defines, void 0, transformFeedbackVaryings), webGLRenderingState.program.__SPECTOR_rebuildProgram = rebuildRebind;}_isRenderingStateCompiled(pipelineContext) {const webGLPipelineContext = pipelineContext;return !!this._gl.getProgramParameter(webGLPipelineContext.program, this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR) && (this._finalizePipelineContext(webGLPipelineContext), !0);}_executeWhenRenderingStateIsCompiled(pipelineContext, action) {const webGLPipelineContext = pipelineContext;if (!webGLPipelineContext.isParallelCompiled) return void action();const oldHandler = webGLPipelineContext.onCompiled;webGLPipelineContext.onCompiled = oldHandler ? () => {oldHandler(), action();} : action;}getUniforms(pipelineContext, uniformsNames) {const results = [];for (let index = 0; index < uniformsNames.length; index++) results.push(this._gl.getUniformLocation(pipelineContext.program, uniformsNames[index]));return results;}getAttributes(pipelineContext, attributesNames) {const results = [];for (let index = 0; index < attributesNames.length; index++) try {results.push(this._gl.getAttribLocation(pipelineContext.program, attributesNames[index]));} catch (e) {results.push(-1);}return results;}enableEffect(effect) {effect = null !== effect && drawWrapper/* DrawWrapper.IsWrapper */.q.IsWrapper(effect) ? effect.effect : effect;effect && effect !== this._currentEffect && (this._stencilStateComposer.stencilMaterial = void 0, effect = effect, this.bindSamplers(effect), this._currentEffect = effect, effect.onBind && effect.onBind(effect), effect._onBindObservable && effect._onBindObservable.notifyObservers(effect));}setInt(uniform, value) {return !!uniform && (this._gl.uniform1i(uniform, value), !0);}setInt2(uniform, x, y) {return !!uniform && (this._gl.uniform2i(uniform, x, y), !0);}setInt3(uniform, x, y, z) {return !!uniform && (this._gl.uniform3i(uniform, x, y, z), !0);}setInt4(uniform, x, y, z, w) {return !!uniform && (this._gl.uniform4i(uniform, x, y, z, w), !0);}setIntArray(uniform, array) {return !!uniform && (this._gl.uniform1iv(uniform, array), !0);}setIntArray2(uniform, array) {return !!(uniform && 0 == array.length % 2) && (this._gl.uniform2iv(uniform, array), !0);}setIntArray3(uniform, array) {return !!(uniform && 0 == array.length % 3) && (this._gl.uniform3iv(uniform, array), !0);}setIntArray4(uniform, array) {return !!(uniform && 0 == array.length % 4) && (this._gl.uniform4iv(uniform, array), !0);}setUInt(uniform, value) {return !!uniform && (this._gl.uniform1ui(uniform, value), !0);}setUInt2(uniform, x, y) {return !!uniform && (this._gl.uniform2ui(uniform, x, y), !0);}setUInt3(uniform, x, y, z) {return !!uniform && (this._gl.uniform3ui(uniform, x, y, z), !0);}setUInt4(uniform, x, y, z, w) {return !!uniform && (this._gl.uniform4ui(uniform, x, y, z, w), !0);}setUIntArray(uniform, array) {return !!uniform && (this._gl.uniform1uiv(uniform, array), !0);}setUIntArray2(uniform, array) {return !!(uniform && 0 == array.length % 2) && (this._gl.uniform2uiv(uniform, array), !0);}setUIntArray3(uniform, array) {return !!(uniform && 0 == array.length % 3) && (this._gl.uniform3uiv(uniform, array), !0);}setUIntArray4(uniform, array) {return !!(uniform && 0 == array.length % 4) && (this._gl.uniform4uiv(uniform, array), !0);}setArray(uniform, array) {return !!uniform && !(1 > array.length) && (this._gl.uniform1fv(uniform, array), !0);}setArray2(uniform, array) {return !!(uniform && 0 == array.length % 2) && (this._gl.uniform2fv(uniform, array), !0);}setArray3(uniform, array) {return !!(uniform && 0 == array.length % 3) && (this._gl.uniform3fv(uniform, array), !0);}setArray4(uniform, array) {return !!(uniform && 0 == array.length % 4) && (this._gl.uniform4fv(uniform, array), !0);}setMatrices(uniform, matrices) {return !!uniform && (this._gl.uniformMatrix4fv(uniform, !1, matrices), !0);}setMatrix3x3(uniform, matrix) {return !!uniform && (this._gl.uniformMatrix3fv(uniform, !1, matrix), !0);}setMatrix2x2(uniform, matrix) {return !!uniform && (this._gl.uniformMatrix2fv(uniform, !1, matrix), !0);}setFloat(uniform, value) {return !!uniform && (this._gl.uniform1f(uniform, value), !0);}setFloat2(uniform, x, y) {return !!uniform && (this._gl.uniform2f(uniform, x, y), !0);}setFloat3(uniform, x, y, z) {return !!uniform && (this._gl.uniform3f(uniform, x, y, z), !0);}setFloat4(uniform, x, y, z, w) {return !!uniform && (this._gl.uniform4f(uniform, x, y, z, w), !0);}applyStates() {if (this._depthCullingState.apply(this._gl), this._stencilStateComposer.apply(this._gl), this._alphaState.apply(this._gl), this._colorWriteChanged) {this._colorWriteChanged = !1;const enable = this._colorWrite;this._gl.colorMask(enable, enable, enable, enable);}}setColorWrite(enable) {enable !== this._colorWrite && (this._colorWriteChanged = !0, this._colorWrite = enable);}getColorWrite() {return this._colorWrite;}get depthCullingState() {return this._depthCullingState;}get alphaState() {return this._alphaState;}get stencilState() {return this._stencilState;}get stencilStateComposer() {return this._stencilStateComposer;}clearInternalTexturesCache() {this._internalTexturesCache.length = 0;}wipeCaches(bruteForce) {this.preventCacheWipeBetweenFrames && !bruteForce || (this._currentEffect = null, this._viewportCached.x = 0, this._viewportCached.y = 0, this._viewportCached.z = 0, this._viewportCached.w = 0, this._unbindVertexArrayObject(), bruteForce && (this._currentProgram = null, this.resetTextureCache(), this._stencilStateComposer.reset(), this._depthCullingState.reset(), this._depthCullingState.depthFunc = this._gl.LEQUAL, this._alphaState.reset(), this._alphaMode = 1, this._alphaEquation = 0, this._colorWrite = !0, this._colorWriteChanged = !0, this._unpackFlipYCached = null, this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), this._mustWipeVertexAttributes = !0, this.unbindAllAttributes()), this._resetVertexBufferBinding(), this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null, this.bindIndexBuffer(null));}_getSamplingParameters(samplingMode, generateMipMaps) {const gl = this._gl;let magFilter = gl.NEAREST,minFilter = gl.NEAREST;return 11 === samplingMode ? (magFilter = gl.LINEAR, minFilter = generateMipMaps ? gl.LINEAR_MIPMAP_NEAREST : gl.LINEAR) : 3 === samplingMode ? (magFilter = gl.LINEAR, minFilter = generateMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR) : 8 === samplingMode ? (magFilter = gl.NEAREST, minFilter = generateMipMaps ? gl.NEAREST_MIPMAP_LINEAR : gl.NEAREST) : 4 === samplingMode ? (magFilter = gl.NEAREST, minFilter = generateMipMaps ? gl.NEAREST_MIPMAP_NEAREST : gl.NEAREST) : 5 === samplingMode ? (magFilter = gl.NEAREST, minFilter = generateMipMaps ? gl.LINEAR_MIPMAP_NEAREST : gl.LINEAR) : 6 === samplingMode ? (magFilter = gl.NEAREST, minFilter = generateMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR) : 7 === samplingMode ? (magFilter = gl.NEAREST, minFilter = gl.LINEAR) : 1 === samplingMode ? (magFilter = gl.NEAREST, minFilter = gl.NEAREST) : 9 === samplingMode ? (magFilter = gl.LINEAR, minFilter = generateMipMaps ? gl.NEAREST_MIPMAP_NEAREST : gl.NEAREST) : 10 === samplingMode ? (magFilter = gl.LINEAR, minFilter = generateMipMaps ? gl.NEAREST_MIPMAP_LINEAR : gl.NEAREST) : 2 === samplingMode ? (magFilter = gl.LINEAR, minFilter = gl.LINEAR) : 12 === samplingMode ? (magFilter = gl.LINEAR, minFilter = gl.NEAREST) : void 0, { min: minFilter, mag: magFilter };}_createTexture() {const texture = this._gl.createTexture();if (!texture) throw new Error("Unable to create texture");return texture;}_createHardwareTexture() {return new webGLHardwareTexture/* WebGLHardwareTexture */.B(this._createTexture(), this._gl);}_createInternalTexture(size, options, delayGPUTextureCreation = !0, source = internalTexture/* InternalTextureSource.Unknown */.S.Unknown) {var _a;let generateMipMaps = !1,type = 0,samplingMode = 3,format = 5,useSRGBBuffer = !1,samples = 1;void 0 !== options && "object" == typeof options ? (generateMipMaps = !!options.generateMipMaps, type = void 0 === options.type ? 0 : options.type, samplingMode = void 0 === options.samplingMode ? 3 : options.samplingMode, format = void 0 === options.format ? 5 : options.format, useSRGBBuffer = void 0 !== options.useSRGBBuffer && options.useSRGBBuffer, samples = null !== (_a = options.samples) && void 0 !== _a ? _a : 1) : generateMipMaps = !!options, useSRGBBuffer && (useSRGBBuffer = this._caps.supportSRGBBuffers && (1 < this.webGLVersion || this.isWebGPU)), 1 !== type || this._caps.textureFloatLinearFiltering ? 2 === type && !this._caps.textureHalfFloatLinearFiltering && (samplingMode = 1) : samplingMode = 1, 1 !== type || this._caps.textureFloat || (type = 0, logger/* Logger.Warn */.Y.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const gl = this._gl,texture = new internalTexture/* InternalTexture */.l(this, source),width = size.width || size,height = size.height || size,layers = size.layers || 0,filters = this._getSamplingParameters(samplingMode, generateMipMaps),target = 0 === layers ? gl.TEXTURE_2D : gl.TEXTURE_2D_ARRAY,sizedFormat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer),internalFormat = this._getInternalFormat(format),textureType = this._getWebGLTextureType(type);return this._bindTextureDirectly(target, texture), 0 === layers ? gl.texImage2D(target, 0, sizedFormat, width, height, 0, internalFormat, textureType, null) : (texture.is2DArray = !0, gl.texImage3D(target, 0, sizedFormat, width, height, layers, 0, internalFormat, textureType, null)), gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filters.mag), gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filters.min), gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE), gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE), generateMipMaps && this._gl.generateMipmap(target), this._bindTextureDirectly(target, null), texture._useSRGBBuffer = useSRGBBuffer, texture.baseWidth = width, texture.baseHeight = height, texture.width = width, texture.height = height, texture.depth = layers, texture.isReady = !0, texture.samples = samples, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.type = type, texture.format = format, this._internalTexturesCache.push(texture), texture;}_getUseSRGBBuffer(useSRGBBuffer, noMipmap) {return useSRGBBuffer && this._caps.supportSRGBBuffers && (1 < this.webGLVersion || this.isWebGPU || noMipmap);}_createTextureBase(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, prepareTexture, prepareTextureProcessFunction, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, useSRGBBuffer) {url = url || "";const fromData = "data:" === url.substr(0, 5),fromBlob = "blob:" === url.substr(0, 5),isBase64 = fromData && -1 !== url.indexOf(";base64,"),texture = fallback ? fallback : new internalTexture/* InternalTexture */.l(this, internalTexture/* InternalTextureSource.Url */.S.Url),originalUrl = url;!this._transformTextureUrl || isBase64 || fallback || buffer || (url = this._transformTextureUrl(url)), originalUrl !== url && (texture._originalUrl = originalUrl);const lastDot = url.lastIndexOf(".");let extension = forcedExtension ? forcedExtension : -1 < lastDot ? url.substring(lastDot).toLowerCase() : "",loader = null;const queryStringIndex = extension.indexOf("?");-1 < queryStringIndex && (extension = extension.split("?")[0]);for (const availableLoader of ThinEngine._TextureLoaders) if (availableLoader.canLoad(extension, mimeType)) {loader = availableLoader;break;}scene && scene.addPendingData(texture), texture.url = url, texture.generateMipMaps = !noMipmap, texture.samplingMode = samplingMode, texture.invertY = invertY, texture._useSRGBBuffer = this._getUseSRGBBuffer(!!useSRGBBuffer, noMipmap), this._doNotHandleContextLost || (texture._buffer = buffer);let onLoadObserver = null;onLoad && !fallback && (onLoadObserver = texture.onLoadedObservable.add(onLoad)), fallback || this._internalTexturesCache.push(texture);const onInternalError = (message, exception) => {scene && scene.removePendingData(texture), url === originalUrl ? (onLoadObserver && texture.onLoadedObservable.remove(onLoadObserver), engineStore/* EngineStore.UseFallbackTexture */.l.UseFallbackTexture && this._createTextureBase(engineStore/* EngineStore.FallbackTexture */.l.FallbackTexture, noMipmap, texture.invertY, scene, samplingMode, null, onError, prepareTexture, prepareTextureProcessFunction, buffer, texture), message = (message || "Unknown error") + (engineStore/* EngineStore.UseFallbackTexture */.l.UseFallbackTexture ? " - Fallback texture was used" : ""), texture.onErrorObservable.notifyObservers({ message, exception }), onError && onError(message, exception)) : (logger/* Logger.Warn */.Y.Warn(`Failed to load ${url}, falling back to ${originalUrl}`), this._createTextureBase(originalUrl, noMipmap, texture.invertY, scene, samplingMode, onLoad, onError, prepareTexture, prepareTextureProcessFunction, buffer, texture, format, forcedExtension, mimeType, loaderOptions, useSRGBBuffer));};if (loader) {const callback = (data) => {loader.loadData(data, texture, (width, height, loadMipmap, isCompressed, done, loadFailed) => {loadFailed ? onInternalError("TextureLoader failed to load data") : prepareTexture(texture, extension, scene, { width, height }, texture.invertY, !loadMipmap, isCompressed, () => (done(), !1), samplingMode);}, loaderOptions);};buffer ? buffer instanceof ArrayBuffer ? callback(new Uint8Array(buffer)) : ArrayBuffer.isView(buffer) ? callback(buffer) : onError && onError("Unable to load: only ArrayBuffer or ArrayBufferView is supported", null) : this._loadFile(url, (data) => callback(new Uint8Array(data)), void 0, scene ? scene.offlineProvider : void 0, !0, (request, exception) => {onInternalError("Unable to load " + (request ? request.responseURL : url, exception));});} else {const onload = (img) => {fromBlob && !this._doNotHandleContextLost && (texture._buffer = img), prepareTexture(texture, extension, scene, img, texture.invertY, noMipmap, !1, prepareTextureProcessFunction, samplingMode);};!fromData || isBase64 ? buffer && ("string" == typeof buffer.decoding || buffer.close) ? onload(buffer) : ThinEngine._FileToolsLoadImage(url, onload, onInternalError, scene ? scene.offlineProvider : null, mimeType, texture.invertY && this._features.needsInvertingBitmap ? { imageOrientation: "flipY" } : void 0) : "string" == typeof buffer || buffer instanceof ArrayBuffer || ArrayBuffer.isView(buffer) || buffer instanceof Blob ? ThinEngine._FileToolsLoadImage(buffer, onload, onInternalError, scene ? scene.offlineProvider : null, mimeType, texture.invertY && this._features.needsInvertingBitmap ? { imageOrientation: "flipY" } : void 0) : buffer && onload(buffer);}return texture;}createTexture(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, creationFlags, useSRGBBuffer) {return this._createTextureBase(url, noMipmap, invertY, scene, samplingMode, onLoad, onError, this._prepareWebGLTexture.bind(this), (potWidth, potHeight, img, extension, texture, continuationCallback) => {const gl = this._gl,isPot = img.width === potWidth && img.height === potHeight,internalFormat = format ? this._getInternalFormat(format, texture._useSRGBBuffer) : ".jpg" !== extension || texture._useSRGBBuffer ? texture._useSRGBBuffer ? gl.SRGB8_ALPHA8 : gl.RGBA : gl.RGB;let texelFormat = format ? this._getInternalFormat(format) : ".jpg" !== extension || texture._useSRGBBuffer ? gl.RGBA : gl.RGB;if (texture._useSRGBBuffer && 1 === this.webGLVersion && (texelFormat = internalFormat), isPot) return gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, img), !1;const maxTextureSize = this._caps.maxTextureSize;if (img.width > maxTextureSize || img.height > maxTextureSize || !this._supportsHardwareTextureRescaling) return (this._prepareWorkingCanvas(), this._workingCanvas && this._workingContext) && (this._workingCanvas.width = potWidth, this._workingCanvas.height = potHeight, this._workingContext.drawImage(img, 0, 0, img.width, img.height, 0, 0, potWidth, potHeight), gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, this._workingCanvas), texture.width = potWidth, texture.height = potHeight, !1);else {const source = new internalTexture/* InternalTexture */.l(this, internalTexture/* InternalTextureSource.Temp */.S.Temp);this._bindTextureDirectly(gl.TEXTURE_2D, source, !0), gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, img), this._rescaleTexture(source, texture, scene, internalFormat, () => {this._releaseTexture(source), this._bindTextureDirectly(gl.TEXTURE_2D, texture, !0), continuationCallback();});}return !0;}, buffer, fallback, format, forcedExtension, mimeType, loaderOptions, useSRGBBuffer);}static _FileToolsLoadImage() {throw (0,devTools/* _WarnImport */.S)("FileTools");}_rescaleTexture() {}createRawTexture(compression = null, type = 0, creationFlags = 0, useSRGBBuffer = !1) {throw (0,devTools/* _WarnImport */.S)("Engine.RawTexture");}createRawCubeTexture(compression = null) {throw (0,devTools/* _WarnImport */.S)("Engine.RawTexture");}createRawTexture3D(compression = null, textureType = 0) {throw (0,devTools/* _WarnImport */.S)("Engine.RawTexture");}createRawTexture2DArray(compression = null, textureType = 0) {throw (0,devTools/* _WarnImport */.S)("Engine.RawTexture");}_unpackFlipY(value) {this._unpackFlipYCached !== value && (this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, value ? 1 : 0), this.enableUnpackFlipYCached && (this._unpackFlipYCached = value));}_getUnpackAlignement() {return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT);}_getTextureTarget(texture) {if (texture.isCube) return this._gl.TEXTURE_CUBE_MAP;return texture.is3D ? this._gl.TEXTURE_3D : texture.is2DArray || texture.isMultiview ? this._gl.TEXTURE_2D_ARRAY : this._gl.TEXTURE_2D;}updateTextureSamplingMode(samplingMode, texture, generateMipMaps = !1) {const target = this._getTextureTarget(texture),filters = this._getSamplingParameters(samplingMode, texture.generateMipMaps || generateMipMaps);this._setTextureParameterInteger(target, this._gl.TEXTURE_MAG_FILTER, filters.mag, texture), this._setTextureParameterInteger(target, this._gl.TEXTURE_MIN_FILTER, filters.min), generateMipMaps && (texture.generateMipMaps = !0, this._gl.generateMipmap(target)), this._bindTextureDirectly(target, null), texture.samplingMode = samplingMode;}updateTextureDimensions(depth = 1) {}updateTextureWrappingMode(texture, wrapU, wrapV = null, wrapR = null) {const target = this._getTextureTarget(texture);null !== wrapU && (this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(wrapU), texture), texture._cachedWrapU = wrapU), null !== wrapV && (this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(wrapV), texture), texture._cachedWrapV = wrapV), (texture.is2DArray || texture.is3D) && null !== wrapR && (this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(wrapR), texture), texture._cachedWrapR = wrapR), this._bindTextureDirectly(target, null);}_setupDepthStencilTexture(internalTexture, size, generateStencil, bilinearFiltering, comparisonFunction, samples = 1) {const width = size.width || size,height = size.height || size,layers = size.layers || 0;internalTexture.baseWidth = width, internalTexture.baseHeight = height, internalTexture.width = width, internalTexture.height = height, internalTexture.is2DArray = 0 < layers, internalTexture.depth = layers, internalTexture.isReady = !0, internalTexture.samples = samples, internalTexture.generateMipMaps = !1, internalTexture.samplingMode = bilinearFiltering ? 2 : 1, internalTexture.type = 0, internalTexture._comparisonFunction = comparisonFunction;const gl = this._gl,target = this._getTextureTarget(internalTexture),samplingParameters = this._getSamplingParameters(internalTexture.samplingMode, !1);gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, samplingParameters.mag), gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, samplingParameters.min), gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE), gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE), 1 < this.webGLVersion && (0 === comparisonFunction ? (gl.texParameteri(target, gl.TEXTURE_COMPARE_FUNC, 515), gl.texParameteri(target, gl.TEXTURE_COMPARE_MODE, gl.NONE)) : (gl.texParameteri(target, gl.TEXTURE_COMPARE_FUNC, comparisonFunction), gl.texParameteri(target, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE)));}_uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, data, faceIndex = 0, lod = 0) {const gl = this._gl;let target = gl.TEXTURE_2D;texture.isCube && (target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex);texture._useSRGBBuffer && (37492 === internalFormat || 36196 === internalFormat ? this._caps.etc2 ? internalFormat = gl.COMPRESSED_SRGB8_ETC2 : texture._useSRGBBuffer = !1 : 37496 === internalFormat ? this._caps.etc2 ? internalFormat = gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : texture._useSRGBBuffer = !1 : 36492 === internalFormat ? internalFormat = gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : 37808 === internalFormat ? internalFormat = gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : 33776 === internalFormat ? this._caps.s3tc_srgb ? internalFormat = gl.COMPRESSED_SRGB_S3TC_DXT1_EXT : texture._useSRGBBuffer = !1 : 33777 === internalFormat ? this._caps.s3tc_srgb ? internalFormat = gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT : texture._useSRGBBuffer = !1 : 33779 === internalFormat ? this._caps.s3tc_srgb ? internalFormat = gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT : texture._useSRGBBuffer = !1 : texture._useSRGBBuffer = !1);this._gl.compressedTexImage2D(target, lod, internalFormat, width, height, 0, data);}_uploadDataToTextureDirectly(texture, imageData, faceIndex = 0, lod = 0, babylonInternalFormat, useTextureWidthAndHeight = !1) {const gl = this._gl,textureType = this._getWebGLTextureType(texture.type),format = this._getInternalFormat(texture.format),internalFormat = babylonInternalFormat === void 0 ? this._getRGBABufferInternalSizedFormat(texture.type, texture.format, texture._useSRGBBuffer) : this._getInternalFormat(babylonInternalFormat, texture._useSRGBBuffer);this._unpackFlipY(texture.invertY);let target = gl.TEXTURE_2D;texture.isCube && (target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex);const lodMaxWidth = Math.round(Math.log(texture.width) * Math.LOG2E),lodMaxHeight = Math.round(Math.log(texture.height) * Math.LOG2E),width = useTextureWidthAndHeight ? texture.width : Math.pow(2, Math.max(lodMaxWidth - lod, 0)),height = useTextureWidthAndHeight ? texture.height : Math.pow(2, Math.max(lodMaxHeight - lod, 0));gl.texImage2D(target, lod, internalFormat, width, height, 0, format, textureType, imageData);}updateTextureData(texture, imageData, xOffset, yOffset, width, height, faceIndex = 0, lod = 0, generateMipMaps = !1) {const gl = this._gl,textureType = this._getWebGLTextureType(texture.type),format = this._getInternalFormat(texture.format);this._unpackFlipY(texture.invertY);let targetForBinding = gl.TEXTURE_2D,target = gl.TEXTURE_2D;texture.isCube && (target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, targetForBinding = gl.TEXTURE_CUBE_MAP), this._bindTextureDirectly(targetForBinding, texture, !0), gl.texSubImage2D(target, lod, xOffset, yOffset, width, height, format, textureType, imageData), generateMipMaps && this._gl.generateMipmap(target), this._bindTextureDirectly(targetForBinding, null);}_uploadArrayBufferViewToTexture(texture, imageData, faceIndex = 0, lod = 0) {const gl = this._gl,bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;this._bindTextureDirectly(bindTarget, texture, !0), this._uploadDataToTextureDirectly(texture, imageData, faceIndex, lod), this._bindTextureDirectly(bindTarget, null, !0);}_prepareWebGLTextureContinuation(texture, scene, noMipmap, isCompressed, samplingMode) {const gl = this._gl;if (gl) {const filters = this._getSamplingParameters(samplingMode, !noMipmap);gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filters.mag), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filters.min), noMipmap || isCompressed || gl.generateMipmap(gl.TEXTURE_2D), this._bindTextureDirectly(gl.TEXTURE_2D, null), scene && scene.removePendingData(texture), texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear();}}_prepareWebGLTexture(texture, extension, scene, img, invertY, noMipmap, isCompressed, processFunction, samplingMode = 3) {const maxTextureSize = this.getCaps().maxTextureSize,potWidth = Math.min(maxTextureSize, this.needPOTTextures ? ThinEngine.GetExponentOfTwo(img.width, maxTextureSize) : img.width),potHeight = Math.min(maxTextureSize, this.needPOTTextures ? ThinEngine.GetExponentOfTwo(img.height, maxTextureSize) : img.height),gl = this._gl;if (gl) {if (!texture._hardwareTexture) return void (scene && scene.removePendingData(texture));this._bindTextureDirectly(gl.TEXTURE_2D, texture, !0), this._unpackFlipY(void 0 === invertY || !!invertY), texture.baseWidth = img.width, texture.baseHeight = img.height, texture.width = potWidth, texture.height = potHeight, texture.isReady = !0, processFunction(potWidth, potHeight, img, extension, texture, () => {this._prepareWebGLTextureContinuation(texture, scene, noMipmap, isCompressed, samplingMode);}) || this._prepareWebGLTextureContinuation(texture, scene, noMipmap, isCompressed, samplingMode);}}_setupFramebufferDepthAttachments(generateStencilBuffer, generateDepthBuffer, width, height, samples = 1) {const gl = this._gl;if (generateStencilBuffer && generateDepthBuffer) return this._createRenderBuffer(width, height, samples, gl.DEPTH_STENCIL, gl.DEPTH24_STENCIL8, gl.DEPTH_STENCIL_ATTACHMENT);if (generateDepthBuffer) {let depthFormat = gl.DEPTH_COMPONENT16;return 1 < this._webGLVersion && (depthFormat = gl.DEPTH_COMPONENT32F), this._createRenderBuffer(width, height, samples, depthFormat, depthFormat, gl.DEPTH_ATTACHMENT);}return generateStencilBuffer ? this._createRenderBuffer(width, height, samples, gl.STENCIL_INDEX8, gl.STENCIL_INDEX8, gl.STENCIL_ATTACHMENT) : null;}_createRenderBuffer(width, height, samples, internalFormat, msInternalFormat, attachment, unbindBuffer = !0) {const gl = this._gl,renderBuffer = gl.createRenderbuffer();return this._updateRenderBuffer(renderBuffer, width, height, samples, internalFormat, msInternalFormat, attachment, unbindBuffer);}_updateRenderBuffer(renderBuffer, width, height, samples, internalFormat, msInternalFormat, attachment, unbindBuffer = !0) {const gl = this._gl;return gl.bindRenderbuffer(gl.RENDERBUFFER, renderBuffer), 1 < samples && gl.renderbufferStorageMultisample ? gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, msInternalFormat, width, height) : gl.renderbufferStorage(gl.RENDERBUFFER, internalFormat, width, height), gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, renderBuffer), unbindBuffer && gl.bindRenderbuffer(gl.RENDERBUFFER, null), renderBuffer;}_releaseTexture(texture) {var _a;this._deleteTexture(null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource), this.unbindAllTextures();const index = this._internalTexturesCache.indexOf(texture);-1 !== index && this._internalTexturesCache.splice(index, 1), texture._lodTextureHigh && texture._lodTextureHigh.dispose(), texture._lodTextureMid && texture._lodTextureMid.dispose(), texture._lodTextureLow && texture._lodTextureLow.dispose(), texture._irradianceTexture && texture._irradianceTexture.dispose();}_releaseRenderTargetWrapper(rtWrapper) {const index = this._renderTargetWrapperCache.indexOf(rtWrapper);-1 !== index && this._renderTargetWrapperCache.splice(index, 1);}_deleteTexture(texture) {texture && this._gl.deleteTexture(texture);}_setProgram(program) {this._currentProgram !== program && (this._gl.useProgram(program), this._currentProgram = program);}bindSamplers(effect) {const webGLPipelineContext = effect.getPipelineContext();this._setProgram(webGLPipelineContext.program);const samplers = effect.getSamplers();for (let index = 0; index < samplers.length; index++) {const uniform = effect.getUniform(samplers[index]);uniform && (this._boundUniforms[index] = uniform);}this._currentEffect = null;}_activateCurrentTexture() {this._currentTextureChannel !== this._activeChannel && (this._gl.activeTexture(this._gl.TEXTURE0 + this._activeChannel), this._currentTextureChannel = this._activeChannel);}_bindTextureDirectly(target, texture, forTextureDataUpdate = !1, force = !1) {var _a, _b;let wasPreviouslyBound = !1;const isTextureForRendering = texture && -1 < texture._associatedChannel;forTextureDataUpdate && isTextureForRendering && (this._activeChannel = texture._associatedChannel);const currentTextureBound = this._boundTexturesCache[this._activeChannel];if (currentTextureBound !== texture || force) {if (this._activateCurrentTexture(), texture && texture.isMultiview) throw console.error(target, texture), "_bindTextureDirectly called with a multiview texture!";else this._gl.bindTexture(target, null !== (_b = null === (_a = null === texture || void 0 === texture ? void 0 : texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource) && void 0 !== _b ? _b : null);this._boundTexturesCache[this._activeChannel] = texture, texture && (texture._associatedChannel = this._activeChannel);} else forTextureDataUpdate && (wasPreviouslyBound = !0, this._activateCurrentTexture());return isTextureForRendering && !forTextureDataUpdate && this._bindSamplerUniformToChannel(texture._associatedChannel, this._activeChannel), wasPreviouslyBound;}_bindTexture(channel, texture) {if (void 0 !== channel) {texture && (texture._associatedChannel = channel), this._activeChannel = channel;const target = texture ? this._getTextureTarget(texture) : this._gl.TEXTURE_2D;this._bindTextureDirectly(target, texture);}}unbindAllTextures() {for (let channel = 0; channel < this._maxSimultaneousTextures; channel++) this._activeChannel = channel, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), 1 < this.webGLVersion && (this._bindTextureDirectly(this._gl.TEXTURE_3D, null), this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null));}setTexture(channel, uniform, texture) {void 0 === channel || (uniform && (this._boundUniforms[channel] = uniform), this._setTexture(channel, texture));}_bindSamplerUniformToChannel(sourceSlot, destination) {const uniform = this._boundUniforms[sourceSlot];uniform && uniform._currentState !== destination && (this._gl.uniform1i(uniform, destination), uniform._currentState = destination);}_getTextureWrapMode(mode) {return 1 === mode ? this._gl.REPEAT : 0 === mode ? this._gl.CLAMP_TO_EDGE : 2 === mode ? this._gl.MIRRORED_REPEAT : this._gl.REPEAT;}_setTexture(channel, texture, isPartOfTextureArray = !1, depthStencilTexture = !1, name = "") {if (!texture) return null != this._boundTexturesCache[channel] && (this._activeChannel = channel, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), 1 < this.webGLVersion && (this._bindTextureDirectly(this._gl.TEXTURE_3D, null), this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null))), !1;if (texture.video) this._activeChannel = channel, texture.update();else if (4 === texture.delayLoadState) return texture.delayLoad(), !1;let internalTexture;internalTexture = depthStencilTexture ? texture.depthStencilTexture : texture.isReady() ? texture.getInternalTexture() : texture.isCube ? this.emptyCubeTexture : texture.is3D ? this.emptyTexture3D : texture.is2DArray ? this.emptyTexture2DArray : this.emptyTexture, !isPartOfTextureArray && internalTexture && (internalTexture._associatedChannel = channel);let needToBind = !0;this._boundTexturesCache[channel] === internalTexture && (!isPartOfTextureArray && this._bindSamplerUniformToChannel(internalTexture._associatedChannel, channel), needToBind = !1), this._activeChannel = channel;const target = this._getTextureTarget(internalTexture);if (needToBind && this._bindTextureDirectly(target, internalTexture, isPartOfTextureArray), internalTexture && !internalTexture.isMultiview) {if (internalTexture.isCube && internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) {internalTexture._cachedCoordinatesMode = texture.coordinatesMode;const textureWrapMode = 3 !== texture.coordinatesMode && 5 !== texture.coordinatesMode ? 1 : 0;texture.wrapU = textureWrapMode, texture.wrapV = textureWrapMode;}internalTexture._cachedWrapU !== texture.wrapU && (internalTexture._cachedWrapU = texture.wrapU, this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(texture.wrapU), internalTexture)), internalTexture._cachedWrapV !== texture.wrapV && (internalTexture._cachedWrapV = texture.wrapV, this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(texture.wrapV), internalTexture)), internalTexture.is3D && internalTexture._cachedWrapR !== texture.wrapR && (internalTexture._cachedWrapR = texture.wrapR, this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(texture.wrapR), internalTexture)), this._setAnisotropicLevel(target, internalTexture, texture.anisotropicFilteringLevel);}return !0;}setTextureArray(channel, uniform, textures) {if (void 0 !== channel && uniform) {this._textureUnits && this._textureUnits.length === textures.length || (this._textureUnits = new Int32Array(textures.length));for (let i = 0; i < textures.length; i++) {const texture = textures[i].getInternalTexture();texture ? (this._textureUnits[i] = channel + i, texture._associatedChannel = channel + i) : this._textureUnits[i] = -1;}this._gl.uniform1iv(uniform, this._textureUnits);for (let index = 0; index < textures.length; index++) this._setTexture(this._textureUnits[index], textures[index], !0);}}_setAnisotropicLevel(target, internalTexture, anisotropicFilteringLevel) {const anisotropicFilterExtension = this._caps.textureAnisotropicFilterExtension;11 !== internalTexture.samplingMode && 3 !== internalTexture.samplingMode && 2 !== internalTexture.samplingMode && (anisotropicFilteringLevel = 1), anisotropicFilterExtension && internalTexture._cachedAnisotropicFilteringLevel !== anisotropicFilteringLevel && (this._setTextureParameterFloat(target, anisotropicFilterExtension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(anisotropicFilteringLevel, this._caps.maxAnisotropy), internalTexture), internalTexture._cachedAnisotropicFilteringLevel = anisotropicFilteringLevel);}_setTextureParameterFloat(target, parameter, value, texture) {this._bindTextureDirectly(target, texture, !0, !0), this._gl.texParameterf(target, parameter, value);}_setTextureParameterInteger(target, parameter, value, texture) {texture && this._bindTextureDirectly(target, texture, !0, !0), this._gl.texParameteri(target, parameter, value);}unbindAllAttributes() {if (this._mustWipeVertexAttributes) {this._mustWipeVertexAttributes = !1;for (let i = 0; i < this._caps.maxVertexAttribs; i++) this.disableAttributeByIndex(i);return;}for (let i = 0, ul = this._vertexAttribArraysEnabled.length; i < ul; i++) !(i >= this._caps.maxVertexAttribs) && this._vertexAttribArraysEnabled[i] && this.disableAttributeByIndex(i);}releaseEffects() {for (const name in this._compiledEffects) {const webGLPipelineContext = this._compiledEffects[name].getPipelineContext();this._deletePipelineContext(webGLPipelineContext);}this._compiledEffects = {};}dispose() {var _a;this.stopRenderLoop(), this.onBeforeTextureInitObservable && this.onBeforeTextureInitObservable.clear(), this._emptyTexture && (this._releaseTexture(this._emptyTexture), this._emptyTexture = null), this._emptyCubeTexture && (this._releaseTexture(this._emptyCubeTexture), this._emptyCubeTexture = null), this._dummyFramebuffer && this._gl.deleteFramebuffer(this._dummyFramebuffer), this.releaseEffects(), null === (_a = this.releaseComputeEffects) || void 0 === _a ? void 0 : _a.call(this), this.unbindAllAttributes(), this._boundUniforms = {}, (0,domManagement/* IsWindowObjectExist */.CG)() && this._renderingCanvas && (!this._doNotHandleContextLost && (this._renderingCanvas.removeEventListener("webglcontextlost", this._onContextLost), this._renderingCanvas.removeEventListener("webglcontextrestored", this._onContextRestored)), window.removeEventListener("resize", this._checkForMobile)), this._workingCanvas = null, this._workingContext = null, this._currentBufferPointers.length = 0, this._renderingCanvas = null, this._currentProgram = null, this._boundRenderFunction = null, Materials_effect/* Effect.ResetCache */.Q.ResetCache();for (const request of this._activeRequests) request.abort();this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();}attachContextLostEvent(callback) {this._renderingCanvas && this._renderingCanvas.addEventListener("webglcontextlost", callback, !1);}attachContextRestoredEvent(callback) {this._renderingCanvas && this._renderingCanvas.addEventListener("webglcontextrestored", callback, !1);}getError() {return this._gl.getError();}_canRenderToFloatFramebuffer() {return 1 < this._webGLVersion ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(1);}_canRenderToHalfFloatFramebuffer() {return 1 < this._webGLVersion ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(2);}_canRenderToFramebuffer(type) {const gl = this._gl;for (; gl.getError() !== gl.NO_ERROR;);let successful = !0;const texture = gl.createTexture();gl.bindTexture(gl.TEXTURE_2D, texture), gl.texImage2D(gl.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(type), 1, 1, 0, gl.RGBA, this._getWebGLTextureType(type), null), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);const fb = gl.createFramebuffer();gl.bindFramebuffer(gl.FRAMEBUFFER, fb), gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);if (successful = successful && status === gl.FRAMEBUFFER_COMPLETE, successful = successful && gl.getError() === gl.NO_ERROR, successful && (gl.clear(gl.COLOR_BUFFER_BIT), successful = successful && gl.getError() === gl.NO_ERROR), successful) {gl.bindFramebuffer(gl.FRAMEBUFFER, null);const readFormat = gl.RGBA,readType = gl.UNSIGNED_BYTE,buffer = new Uint8Array(4);gl.readPixels(0, 0, 1, 1, readFormat, readType, buffer), successful = successful && gl.getError() === gl.NO_ERROR;}for (gl.deleteTexture(texture), gl.deleteFramebuffer(fb), gl.bindFramebuffer(gl.FRAMEBUFFER, null); !successful && gl.getError() !== gl.NO_ERROR;);return successful;}_getWebGLTextureType(type) {if (1 === this._webGLVersion) return 1 === type ? this._gl.FLOAT : 2 === type ? this._gl.HALF_FLOAT_OES : 0 === type ? this._gl.UNSIGNED_BYTE : 8 === type ? this._gl.UNSIGNED_SHORT_4_4_4_4 : 9 === type ? this._gl.UNSIGNED_SHORT_5_5_5_1 : 10 === type ? this._gl.UNSIGNED_SHORT_5_6_5 : this._gl.UNSIGNED_BYTE;return 3 === type ? this._gl.BYTE : 0 === type ? this._gl.UNSIGNED_BYTE : 4 === type ? this._gl.SHORT : 5 === type ? this._gl.UNSIGNED_SHORT : 6 === type ? this._gl.INT : 7 === type ? this._gl.UNSIGNED_INT : 1 === type ? this._gl.FLOAT : 2 === type ? this._gl.HALF_FLOAT : 8 === type ? this._gl.UNSIGNED_SHORT_4_4_4_4 : 9 === type ? this._gl.UNSIGNED_SHORT_5_5_5_1 : 10 === type ? this._gl.UNSIGNED_SHORT_5_6_5 : 11 === type ? this._gl.UNSIGNED_INT_2_10_10_10_REV : 12 === type ? this._gl.UNSIGNED_INT_24_8 : 13 === type ? this._gl.UNSIGNED_INT_10F_11F_11F_REV : 14 === type ? this._gl.UNSIGNED_INT_5_9_9_9_REV : 15 === type ? this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV : this._gl.UNSIGNED_BYTE;}_getInternalFormat(format, useSRGBBuffer = !1) {let internalFormat = useSRGBBuffer ? this._gl.SRGB8_ALPHA8 : this._gl.RGBA;return 0 === format ? internalFormat = this._gl.ALPHA : 1 === format ? internalFormat = this._gl.LUMINANCE : 2 === format ? internalFormat = this._gl.LUMINANCE_ALPHA : 6 === format ? internalFormat = this._gl.RED : 7 === format ? internalFormat = this._gl.RG : 4 === format ? internalFormat = useSRGBBuffer ? this._gl.SRGB : this._gl.RGB : 5 === format ? internalFormat = useSRGBBuffer ? this._gl.SRGB8_ALPHA8 : this._gl.RGBA : void 0, 1 < this._webGLVersion && (8 === format ? internalFormat = this._gl.RED_INTEGER : 9 === format ? internalFormat = this._gl.RG_INTEGER : 10 === format ? internalFormat = this._gl.RGB_INTEGER : 11 === format ? internalFormat = this._gl.RGBA_INTEGER : void 0), internalFormat;}_getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer = !1) {if (1 === this._webGLVersion) {if (format !== void 0) switch (format) {case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return useSRGBBuffer ? this._gl.SRGB : this._gl.RGB;}return this._gl.RGBA;}return 3 === type ? 6 === format ? this._gl.R8_SNORM : 7 === format ? this._gl.RG8_SNORM : 4 === format ? this._gl.RGB8_SNORM : 8 === format ? this._gl.R8I : 9 === format ? this._gl.RG8I : 10 === format ? this._gl.RGB8I : 11 === format ? this._gl.RGBA8I : this._gl.RGBA8_SNORM : 0 === type ? 6 === format ? this._gl.R8 : 7 === format ? this._gl.RG8 : 4 === format ? useSRGBBuffer ? this._gl.SRGB8 : this._gl.RGB8 : 5 === format ? useSRGBBuffer ? this._gl.SRGB8_ALPHA8 : this._gl.RGBA8 : 8 === format ? this._gl.R8UI : 9 === format ? this._gl.RG8UI : 10 === format ? this._gl.RGB8UI : 11 === format ? this._gl.RGBA8UI : 0 === format ? this._gl.ALPHA : 1 === format ? this._gl.LUMINANCE : 2 === format ? this._gl.LUMINANCE_ALPHA : this._gl.RGBA8 : 4 === type ? 8 === format ? this._gl.R16I : 9 === format ? this._gl.RG16I : 10 === format ? this._gl.RGB16I : 11 === format ? this._gl.RGBA16I : this._gl.RGBA16I : 5 === type ? 8 === format ? this._gl.R16UI : 9 === format ? this._gl.RG16UI : 10 === format ? this._gl.RGB16UI : 11 === format ? this._gl.RGBA16UI : this._gl.RGBA16UI : 6 === type ? 8 === format ? this._gl.R32I : 9 === format ? this._gl.RG32I : 10 === format ? this._gl.RGB32I : 11 === format ? this._gl.RGBA32I : this._gl.RGBA32I : 7 === type ? 8 === format ? this._gl.R32UI : 9 === format ? this._gl.RG32UI : 10 === format ? this._gl.RGB32UI : 11 === format ? this._gl.RGBA32UI : this._gl.RGBA32UI : 1 === type ? 6 === format ? this._gl.R32F : 7 === format ? this._gl.RG32F : 4 === format ? this._gl.RGB32F : 5 === format ? this._gl.RGBA32F : this._gl.RGBA32F : 2 === type ? 6 === format ? this._gl.R16F : 7 === format ? this._gl.RG16F : 4 === format ? this._gl.RGB16F : 5 === format ? this._gl.RGBA16F : this._gl.RGBA16F : 10 === type ? this._gl.RGB565 : 13 === type ? this._gl.R11F_G11F_B10F : 14 === type ? this._gl.RGB9_E5 : 8 === type ? this._gl.RGBA4 : 9 === type ? this._gl.RGB5_A1 : 11 === type ? 5 === format ? this._gl.RGB10_A2 : 11 === format ? this._gl.RGB10_A2UI : this._gl.RGB10_A2 : useSRGBBuffer ? this._gl.SRGB8_ALPHA8 : this._gl.RGBA8;}_getRGBAMultiSampleBufferFormat(type) {if (1 === type) return this._gl.RGBA32F;return 2 === type ? this._gl.RGBA16F : this._gl.RGBA8;}_loadFile(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError) {const request = ThinEngine._FileToolsLoadFile(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError);return this._activeRequests.push(request), request.onCompleteObservable.add((request) => {this._activeRequests.splice(this._activeRequests.indexOf(request), 1);}), request;}static _FileToolsLoadFile() {throw (0,devTools/* _WarnImport */.S)("FileTools");}readPixels(x, y, width, height, hasAlpha = !0, flushRenderer = !0) {const numChannels = hasAlpha ? 4 : 3,format = hasAlpha ? this._gl.RGBA : this._gl.RGB,data = new Uint8Array(height * width * numChannels);return flushRenderer && this.flushFramebuffer(), this._gl.readPixels(x, y, width, height, format, this._gl.UNSIGNED_BYTE, data), Promise.resolve(data);}static get IsSupportedAsync() {return Promise.resolve(this.isSupported());}static get IsSupported() {return this.isSupported();}static isSupported() {if (null !== this._HasMajorPerformanceCaveat) return !this._HasMajorPerformanceCaveat;if (null === this._IsSupported) try {const tempcanvas = this._CreateCanvas(1, 1),gl = tempcanvas.getContext("webgl") || tempcanvas.getContext("experimental-webgl");this._IsSupported = null != gl && !!window.WebGLRenderingContext;} catch (e) {this._IsSupported = !1;}return this._IsSupported;}static get HasMajorPerformanceCaveat() {if (null === this._HasMajorPerformanceCaveat) try {const tempcanvas = this._CreateCanvas(1, 1),gl = tempcanvas.getContext("webgl", { failIfMajorPerformanceCaveat: !0 }) || tempcanvas.getContext("experimental-webgl", { failIfMajorPerformanceCaveat: !0 });this._HasMajorPerformanceCaveat = !gl;} catch (e) {this._HasMajorPerformanceCaveat = !1;}return this._HasMajorPerformanceCaveat;}static CeilingPOT(x) {return x--, x |= x >> 1, x |= x >> 2, x |= x >> 4, x |= x >> 8, x |= x >> 16, x++, x;}static FloorPOT(x) {return x |= x >> 1, x |= x >> 2, x |= x >> 4, x |= x >> 8, x |= x >> 16, x - (x >> 1);}static NearestPOT(x) {const c = ThinEngine.CeilingPOT(x),f = ThinEngine.FloorPOT(x);return c - x > x - f ? f : c;}static GetExponentOfTwo(value, max, mode = 2) {let pot;switch (mode) {case 1:pot = ThinEngine.FloorPOT(value);break;case 2:pot = ThinEngine.NearestPOT(value);break;case 3:default:pot = ThinEngine.CeilingPOT(value);}return Math.min(pot, max);}static QueueNewFrame(func, requester) {if (!!(0,domManagement/* IsWindowObjectExist */.CG)()) {const { requestPostAnimationFrame, requestAnimationFrame } = requester || window;if ("function" == typeof requestPostAnimationFrame) return requestPostAnimationFrame(func);if ("function" == typeof requestAnimationFrame) return requestAnimationFrame(func);} else if ("function" == typeof requestAnimationFrame) return requestAnimationFrame(func);return setTimeout(func, 16);}getHostDocument() {return this._renderingCanvas && this._renderingCanvas.ownerDocument ? this._renderingCanvas.ownerDocument : (0,domManagement/* IsDocumentAvailable */.n5)() ? document : null;}}ThinEngine.ExceptionList = [{ key: "Chrome/63.0", capture: "63\\.0\\.3239\\.(\\d+)", captureConstraint: 108, targets: ["uniformBuffer"] }, { key: "Firefox/58", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, { key: "Firefox/59", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, { key: "Chrome/72.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] }, { key: "Chrome/73.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] }, { key: "Chrome/74.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] }, { key: "Mac OS.+Chrome/71", capture: null, captureConstraint: null, targets: ["vao"] }, { key: "Mac OS.+Chrome/72", capture: null, captureConstraint: null, targets: ["vao"] }, { key: "Mac OS.+Chrome", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, { key: ".*AppleWebKit.*(15.4).*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] }, { key: ".*(15.4).*AppleWebKit.*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] }], ThinEngine._TextureLoaders = [], ThinEngine.CollisionsEpsilon = .001, ThinEngine._IsSupported = null, ThinEngine._HasMajorPerformanceCaveat = null;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Events/deviceInputEvents.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "G": () => (/* binding */ EventConstants),
/* harmony export */   "g": () => (/* binding */ DeviceInputEventType)
/* harmony export */ });
var DeviceInputEventType;(function (DeviceInputEventType) {DeviceInputEventType[DeviceInputEventType.PointerMove = 0] = "PointerMove", DeviceInputEventType[DeviceInputEventType.PointerDown = 1] = "PointerDown", DeviceInputEventType[DeviceInputEventType.PointerUp = 2] = "PointerUp";})(DeviceInputEventType || (DeviceInputEventType = {}));class EventConstants {}EventConstants.DOM_DELTA_PIXEL = 0, EventConstants.DOM_DELTA_LINE = 1, EventConstants.DOM_DELTA_PAGE = 2;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Events/keyboardEvents.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "NG": () => (/* binding */ KeyboardInfo),
/* harmony export */   "OG": () => (/* binding */ KeyboardEventTypes),
/* harmony export */   "WZ": () => (/* binding */ KeyboardInfoPre)
/* harmony export */ });
class KeyboardEventTypes {}KeyboardEventTypes.KEYDOWN = 1, KeyboardEventTypes.KEYUP = 2;class KeyboardInfo {constructor(type, event) {this.type = type, this.event = event;}}class KeyboardInfoPre extends KeyboardInfo {get skipOnPointerObservable() {return this.skipOnKeyboardObservable;}set skipOnPointerObservable(value) {this.skipOnKeyboardObservable = value;}constructor(type, event) {super(type, event), this.type = type, this.event = event, this.skipOnKeyboardObservable = !1;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Events/pointerEvents.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "CU": () => (/* binding */ PointerInfoBase),
/* harmony export */   "FV": () => (/* binding */ PointerInfoPre),
/* harmony export */   "R5": () => (/* binding */ PointerInfo),
/* harmony export */   "kD": () => (/* binding */ PointerEventTypes)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
class PointerEventTypes {}PointerEventTypes.POINTERDOWN = 1, PointerEventTypes.POINTERUP = 2, PointerEventTypes.POINTERMOVE = 4, PointerEventTypes.POINTERWHEEL = 8, PointerEventTypes.POINTERPICK = 16, PointerEventTypes.POINTERTAP = 32, PointerEventTypes.POINTERDOUBLETAP = 64;class PointerInfoBase {constructor(type, event) {this.type = type, this.event = event;}}class PointerInfoPre extends PointerInfoBase {constructor(type, event, localX, localY) {super(type, event), this.ray = null, this.originalPickingInfo = null, this.skipOnPointerObservable = !1, this.localPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .FM(localX, localY);}}class PointerInfo extends PointerInfoBase {get pickInfo() {return this._pickInfo || this._generatePickInfo(), this._pickInfo;}constructor(type, event, pickInfo, inputManager = null) {super(type, event), this._pickInfo = pickInfo, this._inputManager = inputManager;}_generatePickInfo() {this._inputManager && (this._pickInfo = this._inputManager._pickMove(this.event), this._inputManager._setRayOnPointerInfo(this._pickInfo, this.event), this._inputManager = null);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Lights/directionalLight.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "O": () => (/* binding */ DirectionalLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/light.js");
/* harmony import */ var _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/shadowLight.js");
_node_js__WEBPACK_IMPORTED_MODULE_3__/* .Node.AddNodeConstructor */ .N.AddNodeConstructor("Light_Type_1", (name, scene) => () => new DirectionalLight(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), scene));class DirectionalLight extends _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__/* .ShadowLight */ .O {get shadowFrustumSize() {return this._shadowFrustumSize;}set shadowFrustumSize(value) {this._shadowFrustumSize = value, this.forceProjectionMatrixCompute();}get shadowOrthoScale() {return this._shadowOrthoScale;}set shadowOrthoScale(value) {this._shadowOrthoScale = value, this.forceProjectionMatrixCompute();}get orthoLeft() {return this._orthoLeft;}set orthoLeft(left) {this._orthoLeft = left;}get orthoRight() {return this._orthoRight;}set orthoRight(right) {this._orthoRight = right;}get orthoTop() {return this._orthoTop;}set orthoTop(top) {this._orthoTop = top;}get orthoBottom() {return this._orthoBottom;}set orthoBottom(bottom) {this._orthoBottom = bottom;}constructor(name, direction, scene) {super(name, scene), this._shadowFrustumSize = 0, this._shadowOrthoScale = .1, this.autoUpdateExtends = !0, this.autoCalcShadowZBounds = !1, this._orthoLeft = Number.MAX_VALUE, this._orthoRight = Number.MIN_VALUE, this._orthoTop = Number.MIN_VALUE, this._orthoBottom = Number.MAX_VALUE, this.position = direction.scale(-1), this.direction = direction;}getClassName() {return "DirectionalLight";}getTypeID() {return _light_js__WEBPACK_IMPORTED_MODULE_4__/* .Light.LIGHTTYPEID_DIRECTIONALLIGHT */ ._.LIGHTTYPEID_DIRECTIONALLIGHT;}_setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {0 < this.shadowFrustumSize ? this._setDefaultFixedFrustumShadowProjectionMatrix(matrix) : this._setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList);}_setDefaultFixedFrustumShadowProjectionMatrix(matrix) {const activeCamera = this.getScene().activeCamera;activeCamera && _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.OrthoLHToRef */ .y3.OrthoLHToRef(this.shadowFrustumSize, this.shadowFrustumSize, this.shadowMinZ === void 0 ? activeCamera.minZ : this.shadowMinZ, this.shadowMaxZ === void 0 ? activeCamera.maxZ : this.shadowMaxZ, matrix, this.getScene().getEngine().isNDCHalfZRange);}_setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList) {const activeCamera = this.getScene().activeCamera;if (!activeCamera) return;if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {const tempVector3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero();this._orthoLeft = Number.MAX_VALUE, this._orthoRight = Number.MIN_VALUE, this._orthoTop = Number.MIN_VALUE, this._orthoBottom = Number.MAX_VALUE;let shadowMinZ = Number.MAX_VALUE,shadowMaxZ = Number.MIN_VALUE;for (let meshIndex = 0; meshIndex < renderList.length; meshIndex++) {const mesh = renderList[meshIndex];if (!mesh) continue;const boundingInfo = mesh.getBoundingInfo(),boundingBox = boundingInfo.boundingBox;for (let index = 0; index < boundingBox.vectorsWorld.length; index++) _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(boundingBox.vectorsWorld[index], viewMatrix, tempVector3), tempVector3.x < this._orthoLeft && (this._orthoLeft = tempVector3.x), tempVector3.y < this._orthoBottom && (this._orthoBottom = tempVector3.y), tempVector3.x > this._orthoRight && (this._orthoRight = tempVector3.x), tempVector3.y > this._orthoTop && (this._orthoTop = tempVector3.y), this.autoCalcShadowZBounds && (tempVector3.z < shadowMinZ && (shadowMinZ = tempVector3.z), tempVector3.z > shadowMaxZ && (shadowMaxZ = tempVector3.z));}this.autoCalcShadowZBounds && (this._shadowMinZ = shadowMinZ, this._shadowMaxZ = shadowMaxZ);}const xOffset = this._orthoRight - this._orthoLeft,yOffset = this._orthoTop - this._orthoBottom,minZ = this.shadowMinZ === void 0 ? activeCamera.minZ : this.shadowMinZ,maxZ = this.shadowMaxZ === void 0 ? activeCamera.maxZ : this.shadowMaxZ,useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.OrthoOffCenterLHToRef */ .y3.OrthoOffCenterLHToRef(this._orthoLeft - xOffset * this.shadowOrthoScale, this._orthoRight + xOffset * this.shadowOrthoScale, this._orthoBottom - yOffset * this.shadowOrthoScale, this._orthoTop + yOffset * this.shadowOrthoScale, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, this.getScene().getEngine().isNDCHalfZRange);}_buildUniformLayout() {this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 4), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create();}transferToEffect(effect, lightIndex) {return this.computeTransformedInformation() ? (this._uniformBuffer.updateFloat4("vLightData", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, lightIndex), this) : (this._uniformBuffer.updateFloat4("vLightData", this.direction.x, this.direction.y, this.direction.z, 1, lightIndex), this);}transferToNodeMaterialEffect(effect, lightDataUniformName) {return this.computeTransformedInformation() ? (effect.setFloat3(lightDataUniformName, this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z), this) : (effect.setFloat3(lightDataUniformName, this.direction.x, this.direction.y, this.direction.z), this);}getDepthMinZ() {const engine = this._scene.getEngine();return !engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;}getDepthMaxZ() {const engine = this._scene.getEngine();return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;}prepareLightSpecificDefines(defines, lightIndex) {defines["DIRLIGHT" + lightIndex] = !0;}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], DirectionalLight.prototype, "shadowFrustumSize", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], DirectionalLight.prototype, "shadowOrthoScale", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], DirectionalLight.prototype, "autoUpdateExtends", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], DirectionalLight.prototype, "autoCalcShadowZBounds", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("orthoLeft")], DirectionalLight.prototype, "_orthoLeft", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("orthoRight")], DirectionalLight.prototype, "_orthoRight", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("orthoTop")], DirectionalLight.prototype, "_orthoTop", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("orthoBottom")], DirectionalLight.prototype, "_orthoBottom", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Lights/hemisphericLight.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "e": () => (/* binding */ HemisphericLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/light.js");
_node_js__WEBPACK_IMPORTED_MODULE_4__/* .Node.AddNodeConstructor */ .N.AddNodeConstructor("Light_Type_3", (name, scene) => () => new HemisphericLight(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), scene));class HemisphericLight extends _light_js__WEBPACK_IMPORTED_MODULE_5__/* .Light */ ._ {constructor(name, direction, scene) {super(name, scene), this.groundColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .Wo(0, 0, 0), this.direction = direction || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Up */ .P.Up();}_buildUniformLayout() {this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 4), this._uniformBuffer.addUniform("vLightGround", 3), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create();}getClassName() {return "HemisphericLight";}setDirectionToTarget(target) {return this.direction = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Normalize */ .P.Normalize(target.subtract(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero())), this.direction;}getShadowGenerator() {return null;}transferToEffect(_effect, lightIndex) {const normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Normalize */ .P.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0, lightIndex), this._uniformBuffer.updateColor3("vLightGround", this.groundColor.scale(this.intensity), lightIndex), this;}transferToNodeMaterialEffect(effect, lightDataUniformName) {const normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Normalize */ .P.Normalize(this.direction);return effect.setFloat3(lightDataUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z), this;}computeWorldMatrix() {return this._worldMatrix || (this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.Identity */ .y3.Identity()), this._worldMatrix;}getTypeID() {return _light_js__WEBPACK_IMPORTED_MODULE_5__/* .Light.LIGHTTYPEID_HEMISPHERICLIGHT */ ._.LIGHTTYPEID_HEMISPHERICLIGHT;}prepareLightSpecificDefines(defines, lightIndex) {defines["HEMILIGHT" + lightIndex] = !0;}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)()], HemisphericLight.prototype, "groundColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)()], HemisphericLight.prototype, "direction", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Lights/light.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "_": () => (/* binding */ Light)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/uniformBuffer.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
/* harmony import */ var _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/lightConstants.js");
class Light extends _node_js__WEBPACK_IMPORTED_MODULE_4__/* .Node */ .N {get range() {return this._range;}set range(value) {this._range = value, this._inverseSquaredRange = 1 / (this.range * this.range);}get intensityMode() {return this._intensityMode;}set intensityMode(value) {this._intensityMode = value, this._computePhotometricScale();}get radius() {return this._radius;}set radius(value) {this._radius = value, this._computePhotometricScale();}get shadowEnabled() {return this._shadowEnabled;}set shadowEnabled(value) {this._shadowEnabled === value || (this._shadowEnabled = value, this._markMeshesAsLightDirty());}get includedOnlyMeshes() {return this._includedOnlyMeshes;}set includedOnlyMeshes(value) {this._includedOnlyMeshes = value, this._hookArrayForIncludedOnly(value);}get excludedMeshes() {return this._excludedMeshes;}set excludedMeshes(value) {this._excludedMeshes = value, this._hookArrayForExcluded(value);}get excludeWithLayerMask() {return this._excludeWithLayerMask;}set excludeWithLayerMask(value) {this._excludeWithLayerMask = value, this._resyncMeshes();}get includeOnlyWithLayerMask() {return this._includeOnlyWithLayerMask;}set includeOnlyWithLayerMask(value) {this._includeOnlyWithLayerMask = value, this._resyncMeshes();}get lightmapMode() {return this._lightmapMode;}set lightmapMode(value) {this._lightmapMode === value || (this._lightmapMode = value, this._markMeshesAsLightDirty());}constructor(name, scene) {super(name, scene), this.diffuse = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .Wo(1, 1, 1), this.specular = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .Wo(1, 1, 1), this.falloffType = Light.FALLOFF_DEFAULT, this.intensity = 1, this._range = Number.MAX_VALUE, this._inverseSquaredRange = 0, this._photometricScale = 1, this._intensityMode = Light.INTENSITYMODE_AUTOMATIC, this._radius = 1e-5, this.renderPriority = 0, this._shadowEnabled = !0, this._excludeWithLayerMask = 0, this._includeOnlyWithLayerMask = 0, this._lightmapMode = 0, this._shadowGenerators = null, this._excludedMeshesIds = [], this._includedOnlyMeshesIds = [], this._isLight = !0, this.getScene().addLight(this), this._uniformBuffer = new _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_5__/* .UniformBuffer */ .M(this.getScene().getEngine(), void 0, void 0, name), this._buildUniformLayout(), this.includedOnlyMeshes = [], this.excludedMeshes = [], this._resyncMeshes();}transferTexturesToEffect() {return this;}_bindLight(lightIndex, scene, effect, useSpecular, receiveShadows = !0) {var _a;const iAsString = lightIndex.toString();let needUpdate = !1;if (this._uniformBuffer.bindToEffect(effect, "Light" + iAsString), this._renderId !== scene.getRenderId() || this._lastUseSpecular !== useSpecular || !this._uniformBuffer.useUbo) {this._renderId = scene.getRenderId(), this._lastUseSpecular = useSpecular;const scaledIntensity = this.getScaledIntensity();this.transferToEffect(effect, iAsString), this.diffuse.scaleToRef(scaledIntensity, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpColors.Color3[0] */ .zZ.Color3[0]), this._uniformBuffer.updateColor4("vLightDiffuse", _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpColors.Color3[0] */ .zZ.Color3[0], this.range, iAsString), useSpecular && (this.specular.scaleToRef(scaledIntensity, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpColors.Color3[1] */ .zZ.Color3[1]), this._uniformBuffer.updateColor4("vLightSpecular", _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpColors.Color3[1] */ .zZ.Color3[1], this.radius, iAsString)), needUpdate = !0;}if (this.transferTexturesToEffect(effect, iAsString), scene.shadowsEnabled && this.shadowEnabled && receiveShadows) {const shadowGenerator = null !== (_a = this.getShadowGenerator(scene.activeCamera)) && void 0 !== _a ? _a : this.getShadowGenerator();shadowGenerator && (shadowGenerator.bindShadowLight(iAsString, effect), needUpdate = !0);}needUpdate ? this._uniformBuffer.update() : this._uniformBuffer.bindUniformBuffer();}getClassName() {return "Light";}toString(fullDetails) {let ret = "Name: " + this.name;if (ret += ", type: " + ["Point", "Directional", "Spot", "Hemispheric"][this.getTypeID()], this.animations) for (let i = 0; i < this.animations.length; i++) ret += ", animation[0]: " + this.animations[i].toString(fullDetails);return ret;}_syncParentEnabledState() {super._syncParentEnabledState(), this.isDisposed() || this._resyncMeshes();}setEnabled(value) {super.setEnabled(value), this._resyncMeshes();}getShadowGenerator(camera = null) {var _a;return null === this._shadowGenerators ? null : null !== (_a = this._shadowGenerators.get(camera)) && void 0 !== _a ? _a : null;}getShadowGenerators() {return this._shadowGenerators;}getAbsolutePosition() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero();}canAffectMesh(mesh) {return !mesh || !(this.includedOnlyMeshes && 0 < this.includedOnlyMeshes.length && -1 === this.includedOnlyMeshes.indexOf(mesh)) && !(this.excludedMeshes && 0 < this.excludedMeshes.length && -1 !== this.excludedMeshes.indexOf(mesh)) && (0 === this.includeOnlyWithLayerMask || 0 != (this.includeOnlyWithLayerMask & mesh.layerMask)) && !(0 !== this.excludeWithLayerMask && this.excludeWithLayerMask & mesh.layerMask);}dispose(doNotRecurse, disposeMaterialAndTextures = !1) {if (this._shadowGenerators) {const iterator = this._shadowGenerators.values();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const shadowGenerator = key.value;shadowGenerator.dispose();}this._shadowGenerators = null;}if (this.getScene().stopAnimation(this), this._parentContainer) {const index = this._parentContainer.lights.indexOf(this);-1 < index && this._parentContainer.lights.splice(index, 1), this._parentContainer = null;}for (const mesh of this.getScene().meshes) mesh._removeLightSource(this, !0);this._uniformBuffer.dispose(), this.getScene().removeLight(this), super.dispose(doNotRecurse, disposeMaterialAndTextures);}getTypeID() {return 0;}getScaledIntensity() {return this._photometricScale * this.intensity;}clone(name, newParent = null) {const constructor = Light.GetConstructorFromName(this.getTypeID(), name, this.getScene());if (!constructor) return null;const clonedLight = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Clone */ .p4.Clone(constructor, this);return name && (clonedLight.name = name), newParent && (clonedLight.parent = newParent), clonedLight.setEnabled(this.isEnabled()), this.onClonedObservable.notifyObservers(clonedLight), clonedLight;}serialize() {const serializationObject = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Serialize */ .p4.Serialize(this);return serializationObject.uniqueId = this.uniqueId, serializationObject.type = this.getTypeID(), this.parent && this.parent._serializeAsParent(serializationObject), 0 < this.excludedMeshes.length && (serializationObject.excludedMeshesIds = [], this.excludedMeshes.forEach((mesh) => {serializationObject.excludedMeshesIds.push(mesh.id);})), 0 < this.includedOnlyMeshes.length && (serializationObject.includedOnlyMeshesIds = [], this.includedOnlyMeshes.forEach((mesh) => {serializationObject.includedOnlyMeshesIds.push(mesh.id);})), _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.AppendSerializedAnimations */ .p4.AppendSerializedAnimations(this, serializationObject), serializationObject.ranges = this.serializeAnimationRanges(), serializationObject.isEnabled = this.isEnabled(), serializationObject;}static GetConstructorFromName(type, name, scene) {const constructorFunc = _node_js__WEBPACK_IMPORTED_MODULE_4__/* .Node.Construct */ .N.Construct("Light_Type_" + type, name, scene);return constructorFunc ? constructorFunc : null;}static Parse(parsedLight, scene) {const constructor = Light.GetConstructorFromName(parsedLight.type, parsedLight.name, scene);if (!constructor) return null;const light = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(constructor, parsedLight, scene);if (parsedLight.excludedMeshesIds && (light._excludedMeshesIds = parsedLight.excludedMeshesIds), parsedLight.includedOnlyMeshesIds && (light._includedOnlyMeshesIds = parsedLight.includedOnlyMeshesIds), void 0 !== parsedLight.parentId && (light._waitingParentId = parsedLight.parentId), void 0 !== parsedLight.parentInstanceIndex && (light._waitingParentInstanceIndex = parsedLight.parentInstanceIndex), void 0 !== parsedLight.falloffType && (light.falloffType = parsedLight.falloffType), void 0 !== parsedLight.lightmapMode && (light.lightmapMode = parsedLight.lightmapMode), parsedLight.animations) {for (let animationIndex = 0; animationIndex < parsedLight.animations.length; animationIndex++) {const parsedAnimation = parsedLight.animations[animationIndex],internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .GetClass */ .q)("BABYLON.Animation");internalClass && light.animations.push(internalClass.Parse(parsedAnimation));}_node_js__WEBPACK_IMPORTED_MODULE_4__/* .Node.ParseAnimationRanges */ .N.ParseAnimationRanges(light, parsedLight, scene);}return parsedLight.autoAnimate && scene.beginAnimation(light, parsedLight.autoAnimateFrom, parsedLight.autoAnimateTo, parsedLight.autoAnimateLoop, parsedLight.autoAnimateSpeed || 1), void 0 !== parsedLight.isEnabled && light.setEnabled(parsedLight.isEnabled), light;}_hookArrayForExcluded(array) {const oldPush = array.push;array.push = (...items) => {const result = oldPush.apply(array, items);for (const item of items) item._resyncLightSource(this);return result;};const oldSplice = array.splice;array.splice = (index, deleteCount) => {const deleted = oldSplice.apply(array, [index, deleteCount]);for (const item of deleted) item._resyncLightSource(this);return deleted;};for (const item of array) item._resyncLightSource(this);}_hookArrayForIncludedOnly(array) {const oldPush = array.push;array.push = (...items) => {const result = oldPush.apply(array, items);return this._resyncMeshes(), result;};const oldSplice = array.splice;array.splice = (index, deleteCount) => {const deleted = oldSplice.apply(array, [index, deleteCount]);return this._resyncMeshes(), deleted;}, this._resyncMeshes();}_resyncMeshes() {for (const mesh of this.getScene().meshes) mesh._resyncLightSource(this);}_markMeshesAsLightDirty() {for (const mesh of this.getScene().meshes) -1 !== mesh.lightSources.indexOf(this) && mesh._markSubMeshesAsLightDirty();}_computePhotometricScale() {this._photometricScale = this._getPhotometricScale(), this.getScene().resetCachedMaterial();}_getPhotometricScale() {let photometricScale = 0;const lightTypeID = this.getTypeID();let photometricMode = this.intensityMode;switch (photometricMode === Light.INTENSITYMODE_AUTOMATIC && (lightTypeID === Light.LIGHTTYPEID_DIRECTIONALLIGHT ? photometricMode = Light.INTENSITYMODE_ILLUMINANCE : photometricMode = Light.INTENSITYMODE_LUMINOUSINTENSITY), lightTypeID) {case Light.LIGHTTYPEID_POINTLIGHT:case Light.LIGHTTYPEID_SPOTLIGHT:photometricMode === Light.INTENSITYMODE_LUMINOUSPOWER ? photometricScale = 1 / (4 * Math.PI) : photometricMode === Light.INTENSITYMODE_LUMINOUSINTENSITY ? photometricScale = 1 : photometricMode === Light.INTENSITYMODE_LUMINANCE ? photometricScale = this.radius * this.radius : void 0;break;case Light.LIGHTTYPEID_DIRECTIONALLIGHT:switch (photometricMode) {case Light.INTENSITYMODE_ILLUMINANCE:photometricScale = 1;break;case Light.INTENSITYMODE_LUMINANCE:{let apexAngleRadians = this.radius;apexAngleRadians = Math.max(apexAngleRadians, .001);const solidAngle = 2 * Math.PI * (1 - Math.cos(apexAngleRadians));photometricScale = solidAngle;break;}}break;case Light.LIGHTTYPEID_HEMISPHERICLIGHT:photometricScale = 1;}return photometricScale;}_reorderLightsInScene() {const scene = this.getScene();0 != this._renderPriority && (scene.requireLightSorting = !0), this.getScene().sortLightsByPriority();}}Light.FALLOFF_DEFAULT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.FALLOFF_DEFAULT */ .m.FALLOFF_DEFAULT, Light.FALLOFF_PHYSICAL = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.FALLOFF_PHYSICAL */ .m.FALLOFF_PHYSICAL, Light.FALLOFF_GLTF = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.FALLOFF_GLTF */ .m.FALLOFF_GLTF, Light.FALLOFF_STANDARD = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.FALLOFF_STANDARD */ .m.FALLOFF_STANDARD, Light.LIGHTMAP_DEFAULT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.LIGHTMAP_DEFAULT */ .m.LIGHTMAP_DEFAULT, Light.LIGHTMAP_SPECULAR = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.LIGHTMAP_SPECULAR */ .m.LIGHTMAP_SPECULAR, Light.LIGHTMAP_SHADOWSONLY = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.LIGHTMAP_SHADOWSONLY */ .m.LIGHTMAP_SHADOWSONLY, Light.INTENSITYMODE_AUTOMATIC = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.INTENSITYMODE_AUTOMATIC */ .m.INTENSITYMODE_AUTOMATIC, Light.INTENSITYMODE_LUMINOUSPOWER = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.INTENSITYMODE_LUMINOUSPOWER */ .m.INTENSITYMODE_LUMINOUSPOWER, Light.INTENSITYMODE_LUMINOUSINTENSITY = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.INTENSITYMODE_LUMINOUSINTENSITY */ .m.INTENSITYMODE_LUMINOUSINTENSITY, Light.INTENSITYMODE_ILLUMINANCE = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.INTENSITYMODE_ILLUMINANCE */ .m.INTENSITYMODE_ILLUMINANCE, Light.INTENSITYMODE_LUMINANCE = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.INTENSITYMODE_LUMINANCE */ .m.INTENSITYMODE_LUMINANCE, Light.LIGHTTYPEID_POINTLIGHT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.LIGHTTYPEID_POINTLIGHT */ .m.LIGHTTYPEID_POINTLIGHT, Light.LIGHTTYPEID_DIRECTIONALLIGHT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.LIGHTTYPEID_DIRECTIONALLIGHT */ .m.LIGHTTYPEID_DIRECTIONALLIGHT, Light.LIGHTTYPEID_SPOTLIGHT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.LIGHTTYPEID_SPOTLIGHT */ .m.LIGHTTYPEID_SPOTLIGHT, Light.LIGHTTYPEID_HEMISPHERICLIGHT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants.LIGHTTYPEID_HEMISPHERICLIGHT */ .m.LIGHTTYPEID_HEMISPHERICLIGHT, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)()], Light.prototype, "diffuse", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)()], Light.prototype, "specular", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Light.prototype, "falloffType", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Light.prototype, "intensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Light.prototype, "range", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Light.prototype, "intensityMode", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Light.prototype, "radius", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Light.prototype, "_renderPriority", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_reorderLightsInScene")], Light.prototype, "renderPriority", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("shadowEnabled")], Light.prototype, "_shadowEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("excludeWithLayerMask")], Light.prototype, "_excludeWithLayerMask", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("includeOnlyWithLayerMask")], Light.prototype, "_includeOnlyWithLayerMask", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("lightmapMode")], Light.prototype, "_lightmapMode", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Lights/lightConstants.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "m": () => (/* binding */ LightConstants)
/* harmony export */ });
class LightConstants {static CompareLightsPriority(a, b) {return a.shadowEnabled === b.shadowEnabled ? b.renderPriority - a.renderPriority : (b.shadowEnabled ? 1 : 0) - (a.shadowEnabled ? 1 : 0);}}LightConstants.FALLOFF_DEFAULT = 0, LightConstants.FALLOFF_PHYSICAL = 1, LightConstants.FALLOFF_GLTF = 2, LightConstants.FALLOFF_STANDARD = 3, LightConstants.LIGHTMAP_DEFAULT = 0, LightConstants.LIGHTMAP_SPECULAR = 1, LightConstants.LIGHTMAP_SHADOWSONLY = 2, LightConstants.INTENSITYMODE_AUTOMATIC = 0, LightConstants.INTENSITYMODE_LUMINOUSPOWER = 1, LightConstants.INTENSITYMODE_LUMINOUSINTENSITY = 2, LightConstants.INTENSITYMODE_ILLUMINANCE = 3, LightConstants.INTENSITYMODE_LUMINANCE = 4, LightConstants.LIGHTTYPEID_POINTLIGHT = 0, LightConstants.LIGHTTYPEID_DIRECTIONALLIGHT = 1, LightConstants.LIGHTTYPEID_SPOTLIGHT = 2, LightConstants.LIGHTTYPEID_HEMISPHERICLIGHT = 3;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Lights/pointLight.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "c": () => (/* binding */ PointLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/light.js");
/* harmony import */ var _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/shadowLight.js");
_node_js__WEBPACK_IMPORTED_MODULE_3__/* .Node.AddNodeConstructor */ .N.AddNodeConstructor("Light_Type_0", (name, scene) => () => new PointLight(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), scene));class PointLight extends _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__/* .ShadowLight */ .O {get shadowAngle() {return this._shadowAngle;}set shadowAngle(value) {this._shadowAngle = value, this.forceProjectionMatrixCompute();}get direction() {return this._direction;}set direction(value) {const previousNeedCube = this.needCube();if (this._direction = value, this.needCube() !== previousNeedCube && this._shadowGenerators) {const iterator = this._shadowGenerators.values();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const shadowGenerator = key.value;shadowGenerator.recreateShadowMap();}}}constructor(name, position, scene) {super(name, scene), this._shadowAngle = Math.PI / 2, this.position = position;}getClassName() {return "PointLight";}getTypeID() {return _light_js__WEBPACK_IMPORTED_MODULE_4__/* .Light.LIGHTTYPEID_POINTLIGHT */ ._.LIGHTTYPEID_POINTLIGHT;}needCube() {return !this.direction;}getShadowDirection(faceIndex) {if (this.direction) return super.getShadowDirection(faceIndex);return 0 === faceIndex ? new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(1, 0, 0) : 1 === faceIndex ? new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(-1, 0, 0) : 2 === faceIndex ? new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(0, -1, 0) : 3 === faceIndex ? new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(0, 1, 0) : 4 === faceIndex ? new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(0, 0, 1) : 5 === faceIndex ? new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(0, 0, -1) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero();}_setDefaultShadowProjectionMatrix(matrix) {const activeCamera = this.getScene().activeCamera;if (!activeCamera) return;const minZ = this.shadowMinZ === void 0 ? activeCamera.minZ : this.shadowMinZ,maxZ = this.shadowMaxZ === void 0 ? activeCamera.maxZ : this.shadowMaxZ,useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.PerspectiveFovLHToRef */ .y3.PerspectiveFovLHToRef(this.shadowAngle, 1, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, !0, this._scene.getEngine().isNDCHalfZRange, void 0, useReverseDepthBuffer);}_buildUniformLayout() {this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 4), this._uniformBuffer.addUniform("vLightFalloff", 4), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create();}transferToEffect(effect, lightIndex) {return this.computeTransformedInformation() ? this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0, lightIndex) : this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, 0, lightIndex), this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, 0, 0, lightIndex), this;}transferToNodeMaterialEffect(effect, lightDataUniformName) {return this.computeTransformedInformation() ? effect.setFloat3(lightDataUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z) : effect.setFloat3(lightDataUniformName, this.position.x, this.position.y, this.position.z), this;}prepareLightSpecificDefines(defines, lightIndex) {defines["POINTLIGHT" + lightIndex] = !0;}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PointLight.prototype, "shadowAngle", null);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Lights/shadowLight.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "O": () => (/* binding */ ShadowLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/light.js");
/* harmony import */ var _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.axis.js");
class ShadowLight extends _light_js__WEBPACK_IMPORTED_MODULE_3__/* .Light */ ._ {constructor() {super(...arguments), this._needProjectionMatrixCompute = !0;}_setPosition(value) {this._position = value;}get position() {return this._position;}set position(value) {this._setPosition(value);}_setDirection(value) {this._direction = value;}get direction() {return this._direction;}set direction(value) {this._setDirection(value);}get shadowMinZ() {return this._shadowMinZ;}set shadowMinZ(value) {this._shadowMinZ = value, this.forceProjectionMatrixCompute();}get shadowMaxZ() {return this._shadowMaxZ;}set shadowMaxZ(value) {this._shadowMaxZ = value, this.forceProjectionMatrixCompute();}computeTransformedInformation() {return !!(this.parent && this.parent.getWorldMatrix) && (this.transformedPosition || (this.transformedPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero()), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition), this.direction && (!this.transformedDirection && (this.transformedDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero()), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection)), !0);}getDepthScale() {return 50;}getShadowDirection() {return this.transformedDirection ? this.transformedDirection : this.direction;}getAbsolutePosition() {return this.transformedPosition ? this.transformedPosition : this.position;}setDirectionToTarget(target) {return this.direction = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Normalize */ .P.Normalize(target.subtract(this.position)), this.direction;}getRotation() {this.direction.normalize();const xaxis = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Cross */ .P.Cross(this.direction, _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_4__/* .Axis.Y */ .RD.Y),yaxis = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Cross */ .P.Cross(xaxis, this.direction);return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.RotationFromAxis */ .P.RotationFromAxis(xaxis, yaxis, this.direction);}needCube() {return !1;}needProjectionMatrixCompute() {return this._needProjectionMatrixCompute;}forceProjectionMatrixCompute() {this._needProjectionMatrixCompute = !0;}_initCache() {super._initCache(), this._cache.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero();}_isSynchronized() {return !!this._cache.position.equals(this.position);}computeWorldMatrix(force) {return !force && this.isSynchronized() ? (this._currentRenderId = this.getScene().getRenderId(), this._worldMatrix) : (this._updateCache(), this._cache.position.copyFrom(this.position), this._worldMatrix || (this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.Identity */ .y3.Identity()), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.TranslationToRef */ .y3.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix), this.parent && this.parent.getWorldMatrix && (this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix), this._markSyncedWithParent()), this._worldMatrixDeterminantIsDirty = !0, this._worldMatrix);}getDepthMinZ(activeCamera) {return this.shadowMinZ === void 0 ? activeCamera.minZ : this.shadowMinZ;}getDepthMaxZ(activeCamera) {return this.shadowMaxZ === void 0 ? activeCamera.maxZ : this.shadowMaxZ;}setShadowProjectionMatrix(matrix, viewMatrix, renderList) {return this.customProjectionMatrixBuilder ? this.customProjectionMatrixBuilder(viewMatrix, renderList, matrix) : this._setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList), this;}_syncParentEnabledState() {super._syncParentEnabledState(), this.parent && this.parent.getWorldMatrix || (this.transformedPosition = null, this.transformedDirection = null);}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)()], ShadowLight.prototype, "position", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)()], ShadowLight.prototype, "direction", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ShadowLight.prototype, "shadowMinZ", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ShadowLight.prototype, "shadowMaxZ", null);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Lights/spotLight.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "P": () => (/* binding */ SpotLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/light.js");
/* harmony import */ var _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/shadowLight.js");
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
_node_js__WEBPACK_IMPORTED_MODULE_3__/* .Node.AddNodeConstructor */ .N.AddNodeConstructor("Light_Type_2", (name, scene) => () => new SpotLight(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), 0, 0, scene));class SpotLight extends _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__/* .ShadowLight */ .O {get angle() {return this._angle;}set angle(value) {this._angle = value, this._cosHalfAngle = Math.cos(.5 * value), this._projectionTextureProjectionLightDirty = !0, this.forceProjectionMatrixCompute(), this._computeAngleValues();}get innerAngle() {return this._innerAngle;}set innerAngle(value) {this._innerAngle = value, this._computeAngleValues();}get shadowAngleScale() {return this._shadowAngleScale;}set shadowAngleScale(value) {this._shadowAngleScale = value, this.forceProjectionMatrixCompute();}get projectionTextureMatrix() {return this._projectionTextureMatrix;}get projectionTextureLightNear() {return this._projectionTextureLightNear;}set projectionTextureLightNear(value) {this._projectionTextureLightNear = value, this._projectionTextureProjectionLightDirty = !0;}get projectionTextureLightFar() {return this._projectionTextureLightFar;}set projectionTextureLightFar(value) {this._projectionTextureLightFar = value, this._projectionTextureProjectionLightDirty = !0;}get projectionTextureUpDirection() {return this._projectionTextureUpDirection;}set projectionTextureUpDirection(value) {this._projectionTextureUpDirection = value, this._projectionTextureProjectionLightDirty = !0;}get projectionTexture() {return this._projectionTexture;}set projectionTexture(value) {this._projectionTexture === value || (this._projectionTexture = value, this._projectionTextureDirty = !0, this._projectionTexture && !this._projectionTexture.isReady() && (SpotLight._IsProceduralTexture(this._projectionTexture) ? this._projectionTexture.getEffect().executeWhenCompiled(() => {this._markMeshesAsLightDirty();}) : SpotLight._IsTexture(this._projectionTexture) && this._projectionTexture.onLoadObservable.addOnce(() => {this._markMeshesAsLightDirty();})));}static _IsProceduralTexture(texture) {return texture.onGeneratedObservable !== void 0;}static _IsTexture(texture) {return texture.onLoadObservable !== void 0;}get projectionTextureProjectionLightMatrix() {return this._projectionTextureProjectionLightMatrix;}set projectionTextureProjectionLightMatrix(projection) {this._projectionTextureProjectionLightMatrix = projection, this._projectionTextureProjectionLightDirty = !1, this._projectionTextureDirty = !0;}constructor(name, position, direction, angle, exponent, scene) {super(name, scene), this._innerAngle = 0, this._projectionTextureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.Zero */ .y3.Zero(), this._projectionTextureLightNear = 1e-6, this._projectionTextureLightFar = 1e3, this._projectionTextureUpDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Up */ .P.Up(), this._projectionTextureViewLightDirty = !0, this._projectionTextureProjectionLightDirty = !0, this._projectionTextureDirty = !0, this._projectionTextureViewTargetVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), this._projectionTextureViewLightMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.Zero */ .y3.Zero(), this._projectionTextureProjectionLightMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.Zero */ .y3.Zero(), this._projectionTextureScalingMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.FromValues */ .y3.FromValues(.5, 0, 0, 0, 0, .5, 0, 0, 0, 0, .5, 0, .5, .5, .5, 1), this.position = position, this.direction = direction, this.angle = angle, this.exponent = exponent;}getClassName() {return "SpotLight";}getTypeID() {return _light_js__WEBPACK_IMPORTED_MODULE_4__/* .Light.LIGHTTYPEID_SPOTLIGHT */ ._.LIGHTTYPEID_SPOTLIGHT;}_setDirection(value) {super._setDirection(value), this._projectionTextureViewLightDirty = !0;}_setPosition(value) {super._setPosition(value), this._projectionTextureViewLightDirty = !0;}_setDefaultShadowProjectionMatrix(matrix) {const activeCamera = this.getScene().activeCamera;if (!activeCamera) return;this._shadowAngleScale = this._shadowAngleScale || 1;const angle = this._shadowAngleScale * this._angle,minZ = this.shadowMinZ === void 0 ? activeCamera.minZ : this.shadowMinZ,maxZ = this.shadowMaxZ === void 0 ? activeCamera.maxZ : this.shadowMaxZ,useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.PerspectiveFovLHToRef */ .y3.PerspectiveFovLHToRef(angle, 1, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, !0, this._scene.getEngine().isNDCHalfZRange, void 0, useReverseDepthBuffer);}_computeProjectionTextureViewLightMatrix() {this._projectionTextureViewLightDirty = !1, this._projectionTextureDirty = !0, this.position.addToRef(this.direction, this._projectionTextureViewTargetVector), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.LookAtLHToRef */ .y3.LookAtLHToRef(this.position, this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix);}_computeProjectionTextureProjectionLightMatrix() {this._projectionTextureProjectionLightDirty = !1, this._projectionTextureDirty = !0;const lightFar = this.projectionTextureLightFar,lightNear = this.projectionTextureLightNear,P = lightFar / (lightFar - lightNear),S = 1 / Math.tan(this._angle / 2);_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.FromValuesToRef */ .y3.FromValuesToRef(S / 1, 0, 0, 0, 0, S, 0, 0, 0, 0, P, 1, 0, 0, -P * lightNear, 0, this._projectionTextureProjectionLightMatrix);}_computeProjectionTextureMatrix() {if (this._projectionTextureDirty = !1, this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix), this._projectionTexture instanceof _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_6__/* .Texture */ .x) {const u = this._projectionTexture.uScale / 2,v = this._projectionTexture.vScale / 2;_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.FromValuesToRef */ .y3.FromValuesToRef(u, 0, 0, 0, 0, v, 0, 0, 0, 0, .5, 0, .5, .5, .5, 1, this._projectionTextureScalingMatrix);}this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix);}_buildUniformLayout() {this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 4), this._uniformBuffer.addUniform("vLightDirection", 3), this._uniformBuffer.addUniform("vLightFalloff", 4), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create();}_computeAngleValues() {this._lightAngleScale = 1 / Math.max(.001, Math.cos(.5 * this._innerAngle) - this._cosHalfAngle), this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale;}transferTexturesToEffect(effect, lightIndex) {return this.projectionTexture && this.projectionTexture.isReady() && (this._projectionTextureViewLightDirty && this._computeProjectionTextureViewLightMatrix(), this._projectionTextureProjectionLightDirty && this._computeProjectionTextureProjectionLightMatrix(), this._projectionTextureDirty && this._computeProjectionTextureMatrix(), effect.setMatrix("textureProjectionMatrix" + lightIndex, this._projectionTextureMatrix), effect.setTexture("projectionLightSampler" + lightIndex, this.projectionTexture)), this;}transferToEffect(effect, lightIndex) {let normalizeDirection;return this.computeTransformedInformation() ? (this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, lightIndex), normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Normalize */ .P.Normalize(this.transformedDirection)) : (this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, this.exponent, lightIndex), normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Normalize */ .P.Normalize(this.direction)), this._uniformBuffer.updateFloat4("vLightDirection", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, this._cosHalfAngle, lightIndex), this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, lightIndex), this;}transferToNodeMaterialEffect(effect, lightDataUniformName) {let normalizeDirection;return normalizeDirection = this.computeTransformedInformation() ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Normalize */ .P.Normalize(this.transformedDirection) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Normalize */ .P.Normalize(this.direction), this.getScene().useRightHandedSystem ? effect.setFloat3(lightDataUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z) : effect.setFloat3(lightDataUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z), this;}dispose() {super.dispose(), this._projectionTexture && this._projectionTexture.dispose();}getDepthMinZ(activeCamera) {const engine = this._scene.getEngine(),minZ = this.shadowMinZ === void 0 ? activeCamera.minZ : this.shadowMinZ;return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? minZ : this._scene.getEngine().isNDCHalfZRange ? 0 : minZ;}getDepthMaxZ(activeCamera) {const engine = this._scene.getEngine(),maxZ = this.shadowMaxZ === void 0 ? activeCamera.maxZ : this.shadowMaxZ;return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : maxZ;}prepareLightSpecificDefines(defines, lightIndex) {defines["SPOTLIGHT" + lightIndex] = !0, defines["PROJECTEDLIGHTTEXTURE" + lightIndex] = !!(this.projectionTexture && this.projectionTexture.isReady());}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], SpotLight.prototype, "angle", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], SpotLight.prototype, "innerAngle", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], SpotLight.prototype, "shadowAngleScale", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], SpotLight.prototype, "exponent", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], SpotLight.prototype, "projectionTextureLightNear", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], SpotLight.prototype, "projectionTextureLightFar", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], SpotLight.prototype, "projectionTextureUpDirection", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)("projectedLightTexture")], SpotLight.prototype, "_projectionTexture", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Loading/sceneLoader.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "O": () => (/* binding */ SceneLoaderAnimationGroupLoadingMode),
/* harmony export */   "n": () => (/* binding */ SceneLoader)
/* harmony export */ });
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/scene.js");
/* harmony import */ var _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engine.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Loading/sceneLoaderFlags.js");
/* harmony import */ var _Misc_fileTools_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/fileTools.js");
/* harmony import */ var _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/error.js");
var SceneLoaderAnimationGroupLoadingMode;(function (SceneLoaderAnimationGroupLoadingMode) {SceneLoaderAnimationGroupLoadingMode[SceneLoaderAnimationGroupLoadingMode.Clean = 0] = "Clean", SceneLoaderAnimationGroupLoadingMode[SceneLoaderAnimationGroupLoadingMode.Stop = 1] = "Stop", SceneLoaderAnimationGroupLoadingMode[SceneLoaderAnimationGroupLoadingMode.Sync = 2] = "Sync", SceneLoaderAnimationGroupLoadingMode[SceneLoaderAnimationGroupLoadingMode.NoSync = 3] = "NoSync";})(SceneLoaderAnimationGroupLoadingMode || (SceneLoaderAnimationGroupLoadingMode = {}));class SceneLoader {static get ForceFullSceneLoadingForIncremental() {return _sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_6__/* .SceneLoaderFlags.ForceFullSceneLoadingForIncremental */ .Z.ForceFullSceneLoadingForIncremental;}static set ForceFullSceneLoadingForIncremental(value) {_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_6__/* .SceneLoaderFlags.ForceFullSceneLoadingForIncremental */ .Z.ForceFullSceneLoadingForIncremental = value;}static get ShowLoadingScreen() {return _sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_6__/* .SceneLoaderFlags.ShowLoadingScreen */ .Z.ShowLoadingScreen;}static set ShowLoadingScreen(value) {_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_6__/* .SceneLoaderFlags.ShowLoadingScreen */ .Z.ShowLoadingScreen = value;}static get loggingLevel() {return _sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_6__/* .SceneLoaderFlags.loggingLevel */ .Z.loggingLevel;}static set loggingLevel(value) {_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_6__/* .SceneLoaderFlags.loggingLevel */ .Z.loggingLevel = value;}static get CleanBoneMatrixWeights() {return _sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_6__/* .SceneLoaderFlags.CleanBoneMatrixWeights */ .Z.CleanBoneMatrixWeights;}static set CleanBoneMatrixWeights(value) {_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_6__/* .SceneLoaderFlags.CleanBoneMatrixWeights */ .Z.CleanBoneMatrixWeights = value;}static GetDefaultPlugin() {return SceneLoader._RegisteredPlugins[".babylon"];}static _GetPluginForExtension(extension) {const registeredPlugin = SceneLoader._RegisteredPlugins[extension];return registeredPlugin ? registeredPlugin : (_Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Warn */ .Y.Warn("Unable to find a plugin to load " + extension + " files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes"), SceneLoader.GetDefaultPlugin());}static _GetPluginForDirectLoad(data) {for (const extension in SceneLoader._RegisteredPlugins) {const plugin = SceneLoader._RegisteredPlugins[extension].plugin;if (plugin.canDirectLoad && plugin.canDirectLoad(data)) return SceneLoader._RegisteredPlugins[extension];}return SceneLoader.GetDefaultPlugin();}static _GetPluginForFilename(sceneFilename) {const queryStringPosition = sceneFilename.indexOf("?");-1 !== queryStringPosition && (sceneFilename = sceneFilename.substring(0, queryStringPosition));const dotPosition = sceneFilename.lastIndexOf("."),extension = sceneFilename.substring(dotPosition, sceneFilename.length).toLowerCase();return SceneLoader._GetPluginForExtension(extension);}static _GetDirectLoad(sceneFilename) {return "data:" === sceneFilename.substr(0, 5) ? sceneFilename.substr(5) : null;}static _FormatErrorMessage(fileInfo, message, exception) {let errorMessage = "Unable to load from " + fileInfo.url;return message ? errorMessage += `: ${message}` : exception && (errorMessage += `: ${exception}`), errorMessage;}static _LoadData(fileInfo, scene, onSuccess, onProgress, onError, onDispose, pluginExtension) {const directLoad = SceneLoader._GetDirectLoad(fileInfo.url),registeredPlugin = pluginExtension ? SceneLoader._GetPluginForExtension(pluginExtension) : directLoad ? SceneLoader._GetPluginForDirectLoad(fileInfo.url) : SceneLoader._GetPluginForFilename(fileInfo.url);let plugin;if (plugin = void 0 === registeredPlugin.plugin.createPlugin ? registeredPlugin.plugin : registeredPlugin.plugin.createPlugin(), !plugin) throw "The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.";if (SceneLoader.OnPluginActivatedObservable.notifyObservers(plugin), directLoad && (plugin.canDirectLoad && plugin.canDirectLoad(fileInfo.url) || !(0,_Misc_fileTools_js__WEBPACK_IMPORTED_MODULE_7__/* .IsBase64DataUrl */ .VL)(fileInfo.url))) {if (plugin.directLoad) {const result = plugin.directLoad(scene, directLoad);result.then ? result.then((data) => {onSuccess(plugin, data);}).catch((error) => {onError("Error in directLoad of _loadData: " + error, error);}) : onSuccess(plugin, result);} else onSuccess(plugin, directLoad);return plugin;}const useArrayBuffer = registeredPlugin.isBinary,dataCallback = (data, responseURL) => scene.isDisposed ? void onError("Scene has been disposed") : void onSuccess(plugin, data, responseURL);let request = null,pluginDisposed = !1;const onDisposeObservable = plugin.onDisposeObservable;onDisposeObservable && onDisposeObservable.add(() => {pluginDisposed = !0, request && (request.abort(), request = null), onDispose();});const manifestChecked = () => {if (pluginDisposed) return;const errorCallback = (request, exception) => {onError(null === request || void 0 === request ? void 0 : request.statusText, exception);},fileOrUrl = fileInfo.file || fileInfo.url;request = plugin.loadFile ? plugin.loadFile(scene, fileOrUrl, dataCallback, onProgress, useArrayBuffer, errorCallback) : scene._loadFile(fileOrUrl, dataCallback, onProgress, !0, useArrayBuffer, errorCallback);},engine = scene.getEngine();let canUseOfflineSupport = engine.enableOfflineSupport;if (canUseOfflineSupport) {let exceptionFound = !1;for (const regex of scene.disableOfflineSupportExceptionRules) if (regex.test(fileInfo.url)) {exceptionFound = !0;break;}canUseOfflineSupport = !exceptionFound;}return canUseOfflineSupport && _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.OfflineProviderFactory */ .D.OfflineProviderFactory ? scene.offlineProvider = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.OfflineProviderFactory */ .D.OfflineProviderFactory(fileInfo.url, manifestChecked, engine.disableManifestCheck) : manifestChecked(), plugin;}static _GetFileInfo(rootUrl, sceneFilename) {let url,name,file = null;if (!sceneFilename) url = rootUrl, name = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.GetFilename */ .w1.GetFilename(rootUrl), rootUrl = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.GetFolderPath */ .w1.GetFolderPath(rootUrl);else if (sceneFilename.name) {const sceneFile = sceneFilename;url = `file:${sceneFile.name}`, name = sceneFile.name, file = sceneFile;} else if ("string" == typeof sceneFilename && sceneFilename.startsWith("data:")) url = sceneFilename, name = "";else {const filename = sceneFilename;if ("/" === filename.substr(0, 1)) return _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.Error */ .w1.Error("Wrong sceneFilename parameter"), null;url = rootUrl + filename, name = filename;}return { url: url, rootUrl: rootUrl, name: name, file: file };}static GetPluginForExtension(extension) {return SceneLoader._GetPluginForExtension(extension).plugin;}static IsPluginForExtensionAvailable(extension) {return !!SceneLoader._RegisteredPlugins[extension];}static RegisterPlugin(plugin) {if ("string" == typeof plugin.extensions) {const extension = plugin.extensions;SceneLoader._RegisteredPlugins[extension.toLowerCase()] = { plugin: plugin, isBinary: !1 };} else {const extensions = plugin.extensions;Object.keys(extensions).forEach((extension) => {SceneLoader._RegisteredPlugins[extension.toLowerCase()] = { plugin: plugin, isBinary: extensions[extension].isBinary };});}}static ImportMesh(meshNames, rootUrl, sceneFilename = "", scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null) {if (!scene) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Error */ .Y.Error("No scene available to import mesh to"), null;const fileInfo = SceneLoader._GetFileInfo(rootUrl, sceneFilename);if (!fileInfo) return null;const loadingToken = {};scene.addPendingData(loadingToken);const disposeHandler = () => {scene.removePendingData(loadingToken);},errorHandler = (message, exception) => {const errorMessage = SceneLoader._FormatErrorMessage(fileInfo, message, exception);onError ? onError(scene, errorMessage, new _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .RuntimeError */ .LH(errorMessage, _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .ErrorCodes.SceneLoaderError */ .SM.SceneLoaderError, exception)) : _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Error */ .Y.Error(errorMessage), disposeHandler();},progressHandler = onProgress ? (event) => {try {onProgress(event);} catch (e) {errorHandler("Error in onProgress callback: " + e, e);}} : void 0,successHandler = (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights) => {if (scene.importedMeshesFiles.push(fileInfo.url), onSuccess) try {onSuccess(meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights);} catch (e) {errorHandler("Error in onSuccess callback: " + e, e);}scene.removePendingData(loadingToken);};return SceneLoader._LoadData(fileInfo, scene, (plugin, data, responseURL) => {if (plugin.rewriteRootURL && (fileInfo.rootUrl = plugin.rewriteRootURL(fileInfo.rootUrl, responseURL)), plugin.importMesh) {const meshes = [],particleSystems = [],skeletons = [];if (!plugin.importMesh(meshNames, scene, data, fileInfo.rootUrl, meshes, particleSystems, skeletons, errorHandler)) return;scene.loadingPluginName = plugin.name, successHandler(meshes, particleSystems, skeletons, [], [], [], []);} else {plugin.importMeshAsync(meshNames, scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name).then((result) => {scene.loadingPluginName = plugin.name, successHandler(result.meshes, result.particleSystems, result.skeletons, result.animationGroups, result.transformNodes, result.geometries, result.lights);}).catch((error) => {errorHandler(error.message, error);});}}, progressHandler, errorHandler, disposeHandler, pluginExtension);}static ImportMeshAsync(meshNames, rootUrl, sceneFilename = "", scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, onProgress = null, pluginExtension = null) {return new Promise((resolve, reject) => {SceneLoader.ImportMesh(meshNames, rootUrl, sceneFilename, scene, (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights) => {resolve({ meshes: meshes, particleSystems: particleSystems, skeletons: skeletons, animationGroups: animationGroups, transformNodes: transformNodes, geometries: geometries, lights: lights });}, onProgress, (scene, message, exception) => {reject(exception || new Error(message));}, pluginExtension);});}static Load(rootUrl, sceneFilename = "", engine = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedEngine */ .l.LastCreatedEngine, onSuccess = null, onProgress = null, onError = null, pluginExtension = null) {return engine ? SceneLoader.Append(rootUrl, sceneFilename, new _scene_js__WEBPACK_IMPORTED_MODULE_2__/* .Scene */ .x(engine), onSuccess, onProgress, onError, pluginExtension) : (_Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.Error */ .w1.Error("No engine available"), null);}static LoadAsync(rootUrl, sceneFilename = "", engine = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedEngine */ .l.LastCreatedEngine, onProgress = null, pluginExtension = null) {return new Promise((resolve, reject) => {SceneLoader.Load(rootUrl, sceneFilename, engine, (scene) => {resolve(scene);}, onProgress, (scene, message, exception) => {reject(exception || new Error(message));}, pluginExtension);});}static Append(rootUrl, sceneFilename = "", scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null) {if (!scene) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Error */ .Y.Error("No scene available to append to"), null;const fileInfo = SceneLoader._GetFileInfo(rootUrl, sceneFilename);if (!fileInfo) return null;const loadingToken = {};scene.addPendingData(loadingToken);const disposeHandler = () => {scene.removePendingData(loadingToken);};SceneLoader.ShowLoadingScreen && !this._ShowingLoadingScreen && (this._ShowingLoadingScreen = !0, scene.getEngine().displayLoadingUI(), scene.executeWhenReady(() => {scene.getEngine().hideLoadingUI(), this._ShowingLoadingScreen = !1;}));const errorHandler = (message, exception) => {const errorMessage = SceneLoader._FormatErrorMessage(fileInfo, message, exception);onError ? onError(scene, errorMessage, new _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .RuntimeError */ .LH(errorMessage, _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .ErrorCodes.SceneLoaderError */ .SM.SceneLoaderError, exception)) : _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Error */ .Y.Error(errorMessage), disposeHandler();},progressHandler = onProgress ? (event) => {try {onProgress(event);} catch (e) {errorHandler("Error in onProgress callback", e);}} : void 0,successHandler = () => {if (onSuccess) try {onSuccess(scene);} catch (e) {errorHandler("Error in onSuccess callback", e);}scene.removePendingData(loadingToken);};return SceneLoader._LoadData(fileInfo, scene, (plugin, data) => {if (plugin.load) {if (!plugin.load(scene, data, fileInfo.rootUrl, errorHandler)) return;scene.loadingPluginName = plugin.name, successHandler();} else {plugin.loadAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name).then(() => {scene.loadingPluginName = plugin.name, successHandler();}).catch((error) => {errorHandler(error.message, error);});}}, progressHandler, errorHandler, disposeHandler, pluginExtension);}static AppendAsync(rootUrl, sceneFilename = "", scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, onProgress = null, pluginExtension = null) {return new Promise((resolve, reject) => {SceneLoader.Append(rootUrl, sceneFilename, scene, (scene) => {resolve(scene);}, onProgress, (scene, message, exception) => {reject(exception || new Error(message));}, pluginExtension);});}static LoadAssetContainer(rootUrl, sceneFilename = "", scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null) {if (!scene) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Error */ .Y.Error("No scene available to load asset container to"), null;const fileInfo = SceneLoader._GetFileInfo(rootUrl, sceneFilename);if (!fileInfo) return null;const loadingToken = {};scene.addPendingData(loadingToken);const disposeHandler = () => {scene.removePendingData(loadingToken);},errorHandler = (message, exception) => {const errorMessage = SceneLoader._FormatErrorMessage(fileInfo, message, exception);onError ? onError(scene, errorMessage, new _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .RuntimeError */ .LH(errorMessage, _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .ErrorCodes.SceneLoaderError */ .SM.SceneLoaderError, exception)) : _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Error */ .Y.Error(errorMessage), disposeHandler();},progressHandler = onProgress ? (event) => {try {onProgress(event);} catch (e) {errorHandler("Error in onProgress callback", e);}} : void 0,successHandler = (assets) => {if (onSuccess) try {onSuccess(assets);} catch (e) {errorHandler("Error in onSuccess callback", e);}scene.removePendingData(loadingToken);};return SceneLoader._LoadData(fileInfo, scene, (plugin, data) => {if (plugin.loadAssetContainer) {const assetContainer = plugin.loadAssetContainer(scene, data, fileInfo.rootUrl, errorHandler);if (!assetContainer) return;scene.loadingPluginName = plugin.name, successHandler(assetContainer);} else if (plugin.loadAssetContainerAsync) {plugin.loadAssetContainerAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name).then((assetContainer) => {scene.loadingPluginName = plugin.name, successHandler(assetContainer);}).catch((error) => {errorHandler(error.message, error);});} else errorHandler("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.");}, progressHandler, errorHandler, disposeHandler, pluginExtension);}static LoadAssetContainerAsync(rootUrl, sceneFilename = "", scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, onProgress = null, pluginExtension = null) {return new Promise((resolve, reject) => {SceneLoader.LoadAssetContainer(rootUrl, sceneFilename, scene, (assetContainer) => {resolve(assetContainer);}, onProgress, (scene, message, exception) => {reject(exception || new Error(message));}, pluginExtension);});}static ImportAnimations(rootUrl, sceneFilename = "", scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, overwriteAnimations = !0, animationGroupLoadingMode = SceneLoaderAnimationGroupLoadingMode.Clean, targetConverter = null, onSuccess = null, onProgress = null, onError = null, pluginExtension = null) {if (!scene) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Error */ .Y.Error("No scene available to load animations to");if (overwriteAnimations) {for (const animatable of scene.animatables) animatable.reset();scene.stopAllAnimations(), scene.animationGroups.slice().forEach((animationGroup) => {animationGroup.dispose();});const nodes = scene.getNodes();nodes.forEach((node) => {node.animations && (node.animations = []);});} else switch (animationGroupLoadingMode) {case SceneLoaderAnimationGroupLoadingMode.Clean:scene.animationGroups.slice().forEach((animationGroup) => {animationGroup.dispose();});break;case SceneLoaderAnimationGroupLoadingMode.Stop:scene.animationGroups.forEach((animationGroup) => {animationGroup.stop();});break;case SceneLoaderAnimationGroupLoadingMode.Sync:scene.animationGroups.forEach((animationGroup) => {animationGroup.reset(), animationGroup.restart();});break;case SceneLoaderAnimationGroupLoadingMode.NoSync:break;default:return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Error */ .Y.Error("Unknown animation group loading mode value '" + animationGroupLoadingMode + "'");}const startingIndexForNewAnimatables = scene.animatables.length;this.LoadAssetContainer(rootUrl, sceneFilename, scene, (container) => {container.mergeAnimationsTo(scene, scene.animatables.slice(startingIndexForNewAnimatables), targetConverter), container.dispose(), scene.onAnimationFileImportedObservable.notifyObservers(scene), onSuccess && onSuccess(scene);}, onProgress, onError, pluginExtension);}static ImportAnimationsAsync(rootUrl, sceneFilename = "", scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, overwriteAnimations = !0, animationGroupLoadingMode = SceneLoaderAnimationGroupLoadingMode.Clean, targetConverter = null, onSuccess = null, onProgress = null, onError = null, pluginExtension = null) {return new Promise((resolve, reject) => {SceneLoader.ImportAnimations(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, (_scene) => {resolve(_scene);}, onProgress, (_scene, message, exception) => {reject(exception || new Error(message));}, pluginExtension);});}}SceneLoader.NO_LOGGING = 0, SceneLoader.MINIMAL_LOGGING = 1, SceneLoader.SUMMARY_LOGGING = 2, SceneLoader.DETAILED_LOGGING = 3, SceneLoader.OnPluginActivatedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), SceneLoader._RegisteredPlugins = {}, SceneLoader._ShowingLoadingScreen = !1;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Loading/sceneLoaderFlags.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ SceneLoaderFlags)
/* harmony export */ });
class SceneLoaderFlags {static get ForceFullSceneLoadingForIncremental() {return SceneLoaderFlags._ForceFullSceneLoadingForIncremental;}static set ForceFullSceneLoadingForIncremental(value) {SceneLoaderFlags._ForceFullSceneLoadingForIncremental = value;}static get ShowLoadingScreen() {return SceneLoaderFlags._ShowLoadingScreen;}static set ShowLoadingScreen(value) {SceneLoaderFlags._ShowLoadingScreen = value;}static get loggingLevel() {return SceneLoaderFlags._LoggingLevel;}static set loggingLevel(value) {SceneLoaderFlags._LoggingLevel = value;}static get CleanBoneMatrixWeights() {return SceneLoaderFlags._CleanBoneMatrixWeights;}static set CleanBoneMatrixWeights(value) {SceneLoaderFlags._CleanBoneMatrixWeights = value;}}SceneLoaderFlags._ForceFullSceneLoadingForIncremental = !1, SceneLoaderFlags._ShowLoadingScreen = !0, SceneLoaderFlags._CleanBoneMatrixWeights = !1, SceneLoaderFlags._LoggingLevel = 0;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/PBR/pbrAnisotropicConfiguration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "i": () => (/* binding */ MaterialAnisotropicDefines),
/* harmony export */   "u": () => (/* binding */ PBRAnisotropicConfiguration)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialFlags.js");
/* harmony import */ var _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginBase.js");
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
class MaterialAnisotropicDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_7__/* .MaterialDefines */ .H {constructor() {super(...arguments), this.ANISOTROPIC = !1, this.ANISOTROPIC_TEXTURE = !1, this.ANISOTROPIC_TEXTUREDIRECTUV = 0, this.MAINUV1 = !1;}}class PBRAnisotropicConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_6__/* .MaterialPluginBase */ .n {_markAllSubMeshesAsTexturesDirty() {this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();}constructor(material, addToPluginList = !0) {super(material, "PBRAnisotropic", 110, new MaterialAnisotropicDefines(), addToPluginList), this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.direction = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2 */ .FM(1, 0), this._texture = null, this.texture = null, this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];}isReadyForSubMesh(defines, scene) {return !this._isEnabled || !(defines._areTexturesDirty && scene.texturesEnabled && this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialFlags.AnisotropicTextureEnabled */ .k.AnisotropicTextureEnabled && !this._texture.isReadyOrNotBlocking());}prepareDefinesBeforeAttributes(defines, scene, mesh) {this._isEnabled ? (defines.ANISOTROPIC = this._isEnabled, this._isEnabled && !mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind) && (defines._needUVs = !0, defines.MAINUV1 = !0), defines._areTexturesDirty && scene.texturesEnabled && (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialFlags.AnisotropicTextureEnabled */ .k.AnisotropicTextureEnabled ? _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._texture, defines, "ANISOTROPIC_TEXTURE") : defines.ANISOTROPIC_TEXTURE = !1)) : (defines.ANISOTROPIC = !1, defines.ANISOTROPIC_TEXTURE = !1, defines.ANISOTROPIC_TEXTUREDIRECTUV = 0, defines.MAINUV1 = !1);}bindForSubMesh(uniformBuffer, scene) {if (this._isEnabled) {const isFrozen = this._material.isFrozen;uniformBuffer.useUbo && isFrozen && uniformBuffer.isSync || (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialFlags.AnisotropicTextureEnabled */ .k.AnisotropicTextureEnabled && (uniformBuffer.updateFloat2("vAnisotropyInfos", this._texture.coordinatesIndex, this._texture.level), _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._texture, uniformBuffer, "anisotropy")), uniformBuffer.updateFloat3("vAnisotropy", this.direction.x, this.direction.y, this.intensity)), scene.texturesEnabled && this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialFlags.AnisotropicTextureEnabled */ .k.AnisotropicTextureEnabled && uniformBuffer.setTexture("anisotropySampler", this._texture);}}hasTexture(texture) {return !(this._texture !== texture);}getActiveTextures(activeTextures) {this._texture && activeTextures.push(this._texture);}getAnimatables(animatables) {this._texture && this._texture.animations && 0 < this._texture.animations.length && animatables.push(this._texture);}dispose(forceDisposeTextures) {forceDisposeTextures && this._texture && this._texture.dispose();}getClassName() {return "PBRAnisotropicConfiguration";}addFallbacks(defines, fallbacks, currentRank) {return defines.ANISOTROPIC && fallbacks.addFallback(currentRank++, "ANISOTROPIC"), currentRank;}getSamplers(samplers) {samplers.push("anisotropySampler");}getUniforms() {return { ubo: [{ name: "vAnisotropy", size: 3, type: "vec3" }, { name: "vAnisotropyInfos", size: 2, type: "vec2" }, { name: "anisotropyMatrix", size: 16, type: "mat4" }] };}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRAnisotropicConfiguration.prototype, "isEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRAnisotropicConfiguration.prototype, "intensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector2 */ .QC)()], PBRAnisotropicConfiguration.prototype, "direction", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRAnisotropicConfiguration.prototype, "texture", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/PBR/pbrBRDFConfiguration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "d": () => (/* binding */ PBRBRDFConfiguration)
/* harmony export */ });
/* unused harmony export MaterialBRDFDefines */
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginBase.js");
class MaterialBRDFDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialDefines */ .H {constructor() {super(...arguments), this.BRDF_V_HEIGHT_CORRELATED = !1, this.MS_BRDF_ENERGY_CONSERVATION = !1, this.SPHERICAL_HARMONICS = !1, this.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = !1;}}class PBRBRDFConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialPluginBase */ .n {_markAllSubMeshesAsMiscDirty() {this._internalMarkAllSubMeshesAsMiscDirty();}constructor(material, addToPluginList = !0) {super(material, "PBRBRDF", 90, new MaterialBRDFDefines(), addToPluginList), this._useEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION, this.useEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION, this._useSmithVisibilityHeightCorrelated = PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED, this.useSmithVisibilityHeightCorrelated = PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED, this._useSphericalHarmonics = PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS, this.useSphericalHarmonics = PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS, this._useSpecularGlossinessInputEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION, this.useSpecularGlossinessInputEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION, this._internalMarkAllSubMeshesAsMiscDirty = material._dirtyCallbacks[16], this._enable(!0);}prepareDefines(defines) {defines.BRDF_V_HEIGHT_CORRELATED = this._useSmithVisibilityHeightCorrelated, defines.MS_BRDF_ENERGY_CONSERVATION = this._useEnergyConservation && this._useSmithVisibilityHeightCorrelated, defines.SPHERICAL_HARMONICS = this._useSphericalHarmonics, defines.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = this._useSpecularGlossinessInputEnergyConservation;}getClassName() {return "PBRBRDFConfiguration";}}PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION = !0, PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED = !0, PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS = !0, PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION = !0, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsMiscDirty")], PBRBRDFConfiguration.prototype, "useEnergyConservation", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsMiscDirty")], PBRBRDFConfiguration.prototype, "useSmithVisibilityHeightCorrelated", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsMiscDirty")], PBRBRDFConfiguration.prototype, "useSphericalHarmonics", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsMiscDirty")], PBRBRDFConfiguration.prototype, "useSpecularGlossinessInputEnergyConservation", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/PBR/pbrBaseMaterial.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "m": () => (/* binding */ PBRBaseMaterial),
  "r": () => (/* binding */ PBRMaterialDefines)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/tslib.es6.js
var tslib_es6 = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/decorators.js
var decorators = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/smartArray.js
var smartArray = __webpack_require__("./node_modules/@babylonjs/core/Misc/smartArray.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/brdfTextureTools.js
var brdfTextureTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/brdfTextureTools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/scene.js + 1 modules
var core_scene = __webpack_require__("./node_modules/@babylonjs/core/scene.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/buffer.js
var buffer = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrBRDFConfiguration.js
var pbrBRDFConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrBRDFConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/prePassConfiguration.js
var prePassConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/prePassConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.color.js
var math_color = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.scalar.js
var math_scalar = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js
var imageProcessingConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/material.js + 1 modules
var material = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialPluginEvent.js
var materialPluginEvent = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginEvent.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialDefines.js
var materialDefines = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/pushMaterial.js
var pushMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/pushMaterial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialHelper.js
var materialHelper = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/texture.js
var texture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialFlags.js
var materialFlags = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialFlags.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.js
var baseTexture_polynomial = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassDeclaration.js
var prePassDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitDeclaration.js
var oitDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitDeclaration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentDeclaration.js
const pbrFragmentDeclaration_name = "pbrFragmentDeclaration",shader = `uniform vec4 vEyePosition;
uniform vec3 vReflectionColor;
uniform vec4 vAlbedoColor;
uniform vec4 vLightingIntensity;
uniform vec4 vReflectivityColor;
uniform vec4 vMetallicReflectanceFactors;
uniform vec3 vEmissiveColor;
uniform float visibility;
uniform vec3 vAmbientColor;
#ifdef ALBEDO
uniform vec2 vAlbedoInfos;
#endif
#ifdef AMBIENT
uniform vec4 vAmbientInfos;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;
uniform vec2 vTangentSpaceParams;
#endif
#ifdef OPACITY
uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;
#endif
#ifdef REFLECTIVITY
uniform vec3 vReflectivityInfos;
#endif
#ifdef MICROSURFACEMAP
uniform vec2 vMicroSurfaceSamplerInfos;
#endif
#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION) || defined(PREPASS)
uniform mat4 view;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;
#ifdef REALTIME_FILTERING
uniform vec2 vReflectionFilteringInfo;
#endif
uniform mat4 reflectionMatrix;
uniform vec3 vReflectionMicrosurfaceInfos;
#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)
uniform vec3 vReflectionPosition;
uniform vec3 vReflectionSize; 
#endif
#endif
#if defined(SS_REFRACTION) && defined(SS_USE_LOCAL_REFRACTIONMAP_CUBIC)
uniform vec3 vRefractionPosition;
uniform vec3 vRefractionSize; 
#endif
#ifdef CLEARCOAT
uniform vec2 vClearCoatParams;
uniform vec4 vClearCoatRefractionParams;
#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)
uniform vec4 vClearCoatInfos;
#endif
#ifdef CLEARCOAT_TEXTURE
uniform mat4 clearCoatMatrix;
#endif
#ifdef CLEARCOAT_TEXTURE_ROUGHNESS
uniform mat4 clearCoatRoughnessMatrix;
#endif
#ifdef CLEARCOAT_BUMP
uniform vec2 vClearCoatBumpInfos;
uniform vec2 vClearCoatTangentSpaceParams;
uniform mat4 clearCoatBumpMatrix;
#endif
#ifdef CLEARCOAT_TINT
uniform vec4 vClearCoatTintParams;
uniform float clearCoatColorAtDistance;
#ifdef CLEARCOAT_TINT_TEXTURE
uniform vec2 vClearCoatTintInfos;
uniform mat4 clearCoatTintMatrix;
#endif
#endif
#endif
#ifdef IRIDESCENCE
uniform vec4 vIridescenceParams;
#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE)
uniform vec4 vIridescenceInfos;
#endif
#ifdef IRIDESCENCE_TEXTURE
uniform mat4 iridescenceMatrix;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
uniform mat4 iridescenceThicknessMatrix;
#endif
#endif
#ifdef ANISOTROPIC
uniform vec3 vAnisotropy;
#ifdef ANISOTROPIC_TEXTURE
uniform vec2 vAnisotropyInfos;
uniform mat4 anisotropyMatrix;
#endif
#endif
#ifdef SHEEN
uniform vec4 vSheenColor;
#ifdef SHEEN_ROUGHNESS
uniform float vSheenRoughness;
#endif
#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)
uniform vec4 vSheenInfos;
#endif
#ifdef SHEEN_TEXTURE
uniform mat4 sheenMatrix;
#endif
#ifdef SHEEN_TEXTURE_ROUGHNESS
uniform mat4 sheenRoughnessMatrix;
#endif
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
uniform vec4 vRefractionMicrosurfaceInfos;
uniform vec4 vRefractionInfos;
uniform mat4 refractionMatrix;
#ifdef REALTIME_FILTERING
uniform vec2 vRefractionFilteringInfo;
#endif
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
uniform vec2 vThicknessInfos;
uniform mat4 thicknessMatrix;
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
uniform vec2 vRefractionIntensityInfos;
uniform mat4 refractionIntensityMatrix;
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
uniform vec2 vTranslucencyIntensityInfos;
uniform mat4 translucencyIntensityMatrix;
#endif
uniform vec2 vThicknessParam;
uniform vec3 vDiffusionDistance;
uniform vec4 vTintColor;
uniform vec3 vSubSurfaceIntensity;
#endif
#ifdef PREPASS
#ifdef SS_SCATTERING
uniform float scatteringDiffusionProfile;
#endif
#endif
#if DEBUGMODE>0
uniform vec2 vDebugMode;
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;
#endif
#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
uniform vec3 vSphericalL00;
uniform vec3 vSphericalL1_1;
uniform vec3 vSphericalL10;
uniform vec3 vSphericalL11;
uniform vec3 vSphericalL2_2;
uniform vec3 vSphericalL2_1;
uniform vec3 vSphericalL20;
uniform vec3 vSphericalL21;
uniform vec3 vSphericalL22;
#else
uniform vec3 vSphericalX;
uniform vec3 vSphericalY;
uniform vec3 vSphericalZ;
uniform vec3 vSphericalXX_ZZ;
uniform vec3 vSphericalYY_ZZ;
uniform vec3 vSphericalZZ;
uniform vec3 vSphericalXY;
uniform vec3 vSphericalYZ;
uniform vec3 vSphericalZX;
#endif
#endif
#define ADDITIONAL_FRAGMENT_DECLARATION
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrFragmentDeclaration */.v.IncludesShadersStore.pbrFragmentDeclaration = shader;const pbrFragmentDeclaration = { name: "pbrFragmentDeclaration", shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js
var sceneUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js
var meshUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrUboDeclaration.js
const pbrUboDeclaration_name = "pbrUboDeclaration",pbrUboDeclaration_shader = `layout(std140,column_major) uniform;
uniform Material {
vec2 vAlbedoInfos;
vec4 vAmbientInfos;
vec2 vOpacityInfos;
vec2 vEmissiveInfos;
vec2 vLightmapInfos;
vec3 vReflectivityInfos;
vec2 vMicroSurfaceSamplerInfos;
vec2 vReflectionInfos;
vec2 vReflectionFilteringInfo;
vec3 vReflectionPosition;
vec3 vReflectionSize;
vec3 vBumpInfos;
mat4 albedoMatrix;
mat4 ambientMatrix;
mat4 opacityMatrix;
mat4 emissiveMatrix;
mat4 lightmapMatrix;
mat4 reflectivityMatrix;
mat4 microSurfaceSamplerMatrix;
mat4 bumpMatrix;
vec2 vTangentSpaceParams;
mat4 reflectionMatrix;
vec3 vReflectionColor;
vec4 vAlbedoColor;
vec4 vLightingIntensity;
vec3 vReflectionMicrosurfaceInfos;
float pointSize;
vec4 vReflectivityColor;
vec3 vEmissiveColor;
vec3 vAmbientColor;
vec2 vDebugMode;
vec4 vMetallicReflectanceFactors;
vec2 vMetallicReflectanceInfos;
mat4 metallicReflectanceMatrix;
vec2 vReflectanceInfos;
mat4 reflectanceMatrix;
vec3 vSphericalL00;
vec3 vSphericalL1_1;
vec3 vSphericalL10;
vec3 vSphericalL11;
vec3 vSphericalL2_2;
vec3 vSphericalL2_1;
vec3 vSphericalL20;
vec3 vSphericalL21;
vec3 vSphericalL22;
vec3 vSphericalX;
vec3 vSphericalY;
vec3 vSphericalZ;
vec3 vSphericalXX_ZZ;
vec3 vSphericalYY_ZZ;
vec3 vSphericalZZ;
vec3 vSphericalXY;
vec3 vSphericalYZ;
vec3 vSphericalZX;
#define ADDITIONAL_UBO_DECLARATION
};
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrUboDeclaration */.v.IncludesShadersStore.pbrUboDeclaration = pbrUboDeclaration_shader;const pbrUboDeclaration = { name: "pbrUboDeclaration", shader: pbrUboDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js
var mainUVVaryingDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.js
const pbrFragmentExtraDeclaration_name = "pbrFragmentExtraDeclaration",pbrFragmentExtraDeclaration_shader = `varying vec3 vPositionW;
#if DEBUGMODE>0
varying vec4 vClipSpacePosition;
#endif
#include<mainUVVaryingDeclaration>[1..7]
#ifdef NORMAL
varying vec3 vNormalW;
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
varying vec3 vEnvironmentIrradiance;
#endif
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrFragmentExtraDeclaration */.v.IncludesShadersStore.pbrFragmentExtraDeclaration = pbrFragmentExtraDeclaration_shader;const pbrFragmentExtraDeclaration = { name: "pbrFragmentExtraDeclaration", shader: pbrFragmentExtraDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js
var lightFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js
var lightUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.js
var samplerFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentAlternateDeclaration.js
const samplerFragmentAlternateDeclaration_name = "samplerFragmentAlternateDeclaration",samplerFragmentAlternateDeclaration_shader = `#ifdef _DEFINENAME_
#if _DEFINENAME_DIRECTUV==1
#define v_VARYINGNAME_UV vMainUV1
#elif _DEFINENAME_DIRECTUV==2
#define v_VARYINGNAME_UV vMainUV2
#elif _DEFINENAME_DIRECTUV==3
#define v_VARYINGNAME_UV vMainUV3
#elif _DEFINENAME_DIRECTUV==4
#define v_VARYINGNAME_UV vMainUV4
#elif _DEFINENAME_DIRECTUV==5
#define v_VARYINGNAME_UV vMainUV5
#elif _DEFINENAME_DIRECTUV==6
#define v_VARYINGNAME_UV vMainUV6
#else
varying vec2 v_VARYINGNAME_UV;
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.samplerFragmentAlternateDeclaration */.v.IncludesShadersStore.samplerFragmentAlternateDeclaration = samplerFragmentAlternateDeclaration_shader;const samplerFragmentAlternateDeclaration = { name: "samplerFragmentAlternateDeclaration", shader: samplerFragmentAlternateDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js
const pbrFragmentSamplersDeclaration_name = "pbrFragmentSamplersDeclaration",pbrFragmentSamplersDeclaration_shader = `#include<samplerFragmentDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo)
#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface)
#include<samplerFragmentDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance)
#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance)
#ifdef CLEARCOAT
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat)
#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL)
uniform sampler2D clearCoatRoughnessSampler;
#endif
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump)
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint)
#endif
#ifdef IRIDESCENCE
#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence)
#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness)
#endif
#ifdef SHEEN
#include<samplerFragmentDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen)
#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL)
uniform sampler2D sheenRoughnessSampler;
#endif
#endif
#ifdef ANISOTROPIC
#include<samplerFragmentDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy)
#endif
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
#define sampleReflection(s,c) textureCube(s,c)
uniform samplerCube reflectionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
#else
uniform samplerCube reflectionSamplerLow;
uniform samplerCube reflectionSamplerHigh;
#endif
#ifdef USEIRRADIANCEMAP
uniform samplerCube irradianceSampler;
#endif
#else
#define sampleReflection(s,c) texture2D(s,c)
uniform sampler2D reflectionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
#else
uniform sampler2D reflectionSamplerLow;
uniform sampler2D reflectionSamplerHigh;
#endif
#ifdef USEIRRADIANCEMAP
uniform sampler2D irradianceSampler;
#endif
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#endif
#endif
#ifdef ENVIRONMENTBRDF
uniform sampler2D environmentBrdfSampler;
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
#ifdef SS_REFRACTIONMAP_3D
#define sampleRefraction(s,c) textureCube(s,c)
uniform samplerCube refractionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)
#else
uniform samplerCube refractionSamplerLow;
uniform samplerCube refractionSamplerHigh;
#endif
#else
#define sampleRefraction(s,c) texture2D(s,c)
uniform sampler2D refractionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)
#else
uniform sampler2D refractionSamplerLow;
uniform sampler2D refractionSamplerHigh;
#endif
#endif
#endif
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity)
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrFragmentSamplersDeclaration */.v.IncludesShadersStore.pbrFragmentSamplersDeclaration = pbrFragmentSamplersDeclaration_shader;const pbrFragmentSamplersDeclaration = { name: "pbrFragmentSamplersDeclaration", shader: pbrFragmentSamplersDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js
var imageProcessingDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/subSurfaceScatteringFunctions.js
var subSurfaceScatteringFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/subSurfaceScatteringFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/importanceSampling.js
var importanceSampling = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/importanceSampling.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrHelperFunctions.js
const pbrHelperFunctions_name = "pbrHelperFunctions",pbrHelperFunctions_shader = `#define RECIPROCAL_PI2 0.15915494
#define RECIPROCAL_PI 0.31830988618
#define MINIMUMVARIANCE 0.0005
float convertRoughnessToAverageSlope(float roughness)
{
return square(roughness)+MINIMUMVARIANCE;
}
float fresnelGrazingReflectance(float reflectance0) {
float reflectance90=saturate(reflectance0*25.0);
return reflectance90;
}
vec2 getAARoughnessFactors(vec3 normalVector) {
#ifdef SPECULARAA
vec3 nDfdx=dFdx(normalVector.xyz);
vec3 nDfdy=dFdy(normalVector.xyz);
float slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));
float geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);
float geometricAlphaGFactor=sqrt(slopeSquare);
geometricAlphaGFactor*=0.75;
return vec2(geometricRoughnessFactor,geometricAlphaGFactor);
#else
return vec2(0.);
#endif
}
#ifdef ANISOTROPIC
vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {
float alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);
float alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);
return vec2(alphaT,alphaB);
}
vec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy) {
vec3 anisotropicFrameDirection=anisotropy>=0.0 ? B : T;
vec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);
vec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);
vec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));
return anisotropicNormal;
}
#endif
#if defined(CLEARCOAT) || defined(SS_REFRACTION)
vec3 cocaLambert(vec3 alpha,float distance) {
return exp(-alpha*distance);
}
vec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {
return cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));
}
vec3 computeColorAtDistanceInMedia(vec3 color,float distance) {
return -log(color)/distance;
}
vec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {
vec3 clearCoatAbsorption=mix(vec3(1.0),
cocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),
clearCoatIntensity);
return clearCoatAbsorption;
}
#endif
#ifdef MICROSURFACEAUTOMATIC
float computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)
{
const float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;
float reflectivityLuminance=getLuminance(reflectivityColor);
float reflectivityLuma=sqrt(reflectivityLuminance);
microSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;
return microSurface;
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrHelperFunctions */.v.IncludesShadersStore.pbrHelperFunctions = pbrHelperFunctions_shader;const pbrHelperFunctions = { name: "pbrHelperFunctions", shader: pbrHelperFunctions_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js
var imageProcessingFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js
var shadowsFragmentFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/harmonicsFunctions.js
const harmonicsFunctions_name = "harmonicsFunctions",harmonicsFunctions_shader = `#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
vec3 computeEnvironmentIrradiance(vec3 normal) {
return vSphericalL00
+ vSphericalL1_1*(normal.y)
+ vSphericalL10*(normal.z)
+ vSphericalL11*(normal.x)
+ vSphericalL2_2*(normal.y*normal.x)
+ vSphericalL2_1*(normal.y*normal.z)
+ vSphericalL20*((3.0*normal.z*normal.z)-1.0)
+ vSphericalL21*(normal.z*normal.x)
+ vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));
}
#else
vec3 computeEnvironmentIrradiance(vec3 normal) {
float Nx=normal.x;
float Ny=normal.y;
float Nz=normal.z;
vec3 C1=vSphericalZZ.rgb;
vec3 Cx=vSphericalX.rgb;
vec3 Cy=vSphericalY.rgb;
vec3 Cz=vSphericalZ.rgb;
vec3 Cxx_zz=vSphericalXX_ZZ.rgb;
vec3 Cyy_zz=vSphericalYY_ZZ.rgb;
vec3 Cxy=vSphericalXY.rgb;
vec3 Cyz=vSphericalYZ.rgb;
vec3 Czx=vSphericalZX.rgb;
vec3 a1=Cyy_zz*Ny+Cy;
vec3 a2=Cyz*Nz+a1;
vec3 b1=Czx*Nz+Cx;
vec3 b2=Cxy*Ny+b1;
vec3 b3=Cxx_zz*Nx+b2;
vec3 t1=Cz *Nz+C1;
vec3 t2=a2 *Ny+t1;
vec3 t3=b3 *Nx+t2;
return t3;
}
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.harmonicsFunctions */.v.IncludesShadersStore.harmonicsFunctions = harmonicsFunctions_shader;const harmonicsFunctions = { name: "harmonicsFunctions", shader: harmonicsFunctions_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.js
const pbrDirectLightingSetupFunctions_name = "pbrDirectLightingSetupFunctions",pbrDirectLightingSetupFunctions_shader = `struct preLightingInfo
{
vec3 lightOffset;
float lightDistanceSquared;
float lightDistance;
float attenuation;
vec3 L;
vec3 H;
float NdotV;
float NdotLUnclamped;
float NdotL;
float VdotH;
float roughness;
#ifdef IRIDESCENCE
float iridescenceIntensity;
#endif
};
preLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {
preLightingInfo result;
result.lightOffset=lightData.xyz-vPositionW;
result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);
result.lightDistance=sqrt(result.lightDistanceSquared);
result.L=normalize(result.lightOffset);
result.H=normalize(V+result.L);
result.VdotH=saturate(dot(V,result.H));
result.NdotLUnclamped=dot(N,result.L);
result.NdotL=saturateEps(result.NdotLUnclamped);
return result;
}
preLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {
preLightingInfo result;
result.lightDistance=length(-lightData.xyz);
result.L=normalize(-lightData.xyz);
result.H=normalize(V+result.L);
result.VdotH=saturate(dot(V,result.H));
result.NdotLUnclamped=dot(N,result.L);
result.NdotL=saturateEps(result.NdotLUnclamped);
return result;
}
preLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {
preLightingInfo result;
result.NdotL=dot(N,lightData.xyz)*0.5+0.5;
result.NdotL=saturateEps(result.NdotL);
result.NdotLUnclamped=result.NdotL;
#ifdef SPECULARTERM
result.L=normalize(lightData.xyz);
result.H=normalize(V+result.L);
result.VdotH=saturate(dot(V,result.H));
#endif
return result;
}`;shaderStore/* ShaderStore.IncludesShadersStore.pbrDirectLightingSetupFunctions */.v.IncludesShadersStore.pbrDirectLightingSetupFunctions = pbrDirectLightingSetupFunctions_shader;const pbrDirectLightingSetupFunctions = { name: "pbrDirectLightingSetupFunctions", shader: pbrDirectLightingSetupFunctions_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions.js
const pbrDirectLightingFalloffFunctions_name = "pbrDirectLightingFalloffFunctions",pbrDirectLightingFalloffFunctions_shader = `float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)
{
return max(0.,1.0-length(lightOffset)/range);
}
float computeDistanceLightFalloff_Physical(float lightDistanceSquared)
{
return 1.0/maxEps(lightDistanceSquared);
}
float computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)
{
float lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);
float factor=lightDistanceSquared*inverseSquaredRange;
float attenuation=saturate(1.0-factor*factor);
attenuation*=attenuation;
lightDistanceFalloff*=attenuation;
return lightDistanceFalloff;
}
float computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)
{
#ifdef USEPHYSICALLIGHTFALLOFF
return computeDistanceLightFalloff_Physical(lightDistanceSquared);
#elif defined(USEGLTFLIGHTFALLOFF)
return computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);
#else
return computeDistanceLightFalloff_Standard(lightOffset,range);
#endif
}
float computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)
{
float falloff=0.0;
float cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));
if (cosAngle>=cosHalfAngle)
{
falloff=max(0.,pow(cosAngle,exponent));
}
return falloff;
}
float computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)
{
const float kMinusLog2ConeAngleIntensityRatio=6.64385618977; 
float concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);
vec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);
float falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));
return falloff;
}
float computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)
{
float cd=dot(-lightDirection,directionToLightCenterW);
float falloff=saturate(cd*lightAngleScale+lightAngleOffset);
falloff*=falloff;
return falloff;
}
float computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)
{
#ifdef USEPHYSICALLIGHTFALLOFF
return computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);
#elif defined(USEGLTFLIGHTFALLOFF)
return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);
#else
return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);
#endif
}`;shaderStore/* ShaderStore.IncludesShadersStore.pbrDirectLightingFalloffFunctions */.v.IncludesShadersStore.pbrDirectLightingFalloffFunctions = pbrDirectLightingFalloffFunctions_shader;const pbrDirectLightingFalloffFunctions = { name: "pbrDirectLightingFalloffFunctions", shader: pbrDirectLightingFalloffFunctions_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBRDFFunctions.js
var pbrBRDFFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBRDFFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/hdrFilteringFunctions.js
var hdrFilteringFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/hdrFilteringFunctions.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingFunctions.js
const pbrDirectLightingFunctions_name = "pbrDirectLightingFunctions",pbrDirectLightingFunctions_shader = `#define CLEARCOATREFLECTANCE90 1.0
struct lightingInfo
{
vec3 diffuse;
#ifdef SPECULARTERM
vec3 specular;
#endif
#ifdef CLEARCOAT
vec4 clearCoat;
#endif
#ifdef SHEEN
vec3 sheen;
#endif
};
float adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) {
#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)
float lightRoughness=lightRadius/lightDistance;
float totalRoughness=saturate(lightRoughness+roughness);
return totalRoughness;
#else
return roughness;
#endif
}
vec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {
return mix(groundColor,lightColor,info.NdotL);
}
vec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {
float diffuseTerm=diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness);
return diffuseTerm*info.attenuation*info.NdotL*lightColor;
}
#define inline
vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){
vec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);
strq/=strq.w;
vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;
return toLinearSpace(textureColor);
}
#ifdef SS_TRANSLUCENCY
vec3 computeDiffuseAndTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {
float NdotL=absEps(info.NdotLUnclamped);
float wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);
float trAdapt=step(0.,info.NdotLUnclamped);
vec3 transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt);
float diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);
return diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;
}
#endif
#ifdef SPECULARTERM
vec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {
float NdotH=saturateEps(dot(N,info.H));
float roughness=max(info.roughness,geometricRoughnessFactor);
float alphaG=convertRoughnessToAverageSlope(roughness);
vec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);
#ifdef IRIDESCENCE
fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
#endif
float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);
#ifdef BRDF_V_HEIGHT_CORRELATED
float smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);
#else
float smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);
#endif
vec3 specTerm=fresnel*distribution*smithVisibility;
return specTerm*info.attenuation*info.NdotL*lightColor;
}
#endif
#ifdef ANISOTROPIC
vec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {
float NdotH=saturateEps(dot(N,info.H));
float TdotH=dot(T,info.H);
float BdotH=dot(B,info.H);
float TdotV=dot(T,V);
float BdotV=dot(B,V);
float TdotL=dot(T,info.L);
float BdotL=dot(B,info.L);
float alphaG=convertRoughnessToAverageSlope(info.roughness);
vec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);
alphaTB=max(alphaTB,square(geometricRoughnessFactor));
vec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);
#ifdef IRIDESCENCE
fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
#endif
float distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);
float smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);
vec3 specTerm=fresnel*distribution*smithVisibility;
return specTerm*info.attenuation*info.NdotL*lightColor;
}
#endif
#ifdef CLEARCOAT
vec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {
float NccdotL=saturateEps(dot(Ncc,info.L));
float NccdotH=saturateEps(dot(Ncc,info.H));
float clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);
float alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);
float fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);
fresnel*=clearCoatIntensity;
float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);
float kelemenVisibility=visibility_Kelemen(info.VdotH);
float clearCoatTerm=fresnel*distribution*kelemenVisibility;
return vec4(
clearCoatTerm*info.attenuation*NccdotL*lightColor,
1.0-fresnel
);
}
vec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {
vec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);
float NdotLRefract=saturateEps(dot(Ncc,LRefract));
vec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);
return absorption;
}
#endif
#ifdef SHEEN
vec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {
float NdotH=saturateEps(dot(N,info.H));
float roughness=max(info.roughness,geometricRoughnessFactor);
float alphaG=convertRoughnessToAverageSlope(roughness);
float fresnel=1.;
float distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);
/*#ifdef SHEEN_SOFTER
float visibility=visibility_CharlieSheen(info.NdotL,info.NdotV,alphaG);
#else */
float visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);
/* #endif */
float sheenTerm=fresnel*distribution*visibility;
return sheenTerm*info.attenuation*info.NdotL*lightColor;
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrDirectLightingFunctions */.v.IncludesShadersStore.pbrDirectLightingFunctions = pbrDirectLightingFunctions_shader;const pbrDirectLightingFunctions = { name: "pbrDirectLightingFunctions", shader: pbrDirectLightingFunctions_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrIBLFunctions.js
const pbrIBLFunctions_name = "pbrIBLFunctions",pbrIBLFunctions_shader = `#if defined(REFLECTION) || defined(SS_REFRACTION)
float getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {
float microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;
float lod=log2(microsurfaceAverageSlopeTexels);
return lod;
}
float getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {
float lod=log2(cubeMapDimensionPixels)*roughness;
return lod;
}
#endif
#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)
float environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {
float temp=NdotVUnclamped+ambientOcclusion;
return saturate(square(temp)-1.0+ambientOcclusion);
}
#endif
#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)
float environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {
vec3 reflection=reflect(view,normal);
float temp=saturate(1.0+1.1*dot(reflection,geometricNormal));
return square(temp);
}
#endif
#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)
#define UNPACK_LOD(x) (1.0-x)*255.0
float getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {
float microsurfaceAverageSlope=alphaG;
microsurfaceAverageSlope*=sqrt(abs(NdotV));
return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrIBLFunctions */.v.IncludesShadersStore.pbrIBLFunctions = pbrIBLFunctions_shader;const pbrIBLFunctions = { name: "pbrIBLFunctions", shader: pbrIBLFunctions_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js
var bumpFragmentMainFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js
var bumpFragmentFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js
var reflectionFunction = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js
const pbrBlockAlbedoOpacity_name = "pbrBlockAlbedoOpacity",pbrBlockAlbedoOpacity_shader = `struct albedoOpacityOutParams
{
vec3 surfaceAlbedo;
float alpha;
};
#define pbr_inline
void albedoOpacityBlock(
in vec4 vAlbedoColor,
#ifdef ALBEDO
in vec4 albedoTexture,
in vec2 albedoInfos,
#endif
#ifdef OPACITY
in vec4 opacityMap,
in vec2 vOpacityInfos,
#endif
#ifdef DETAIL
in vec4 detailColor,
in vec4 vDetailInfos,
#endif
out albedoOpacityOutParams outParams
)
{
vec3 surfaceAlbedo=vAlbedoColor.rgb;
float alpha=vAlbedoColor.a;
#ifdef ALBEDO
#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)
alpha*=albedoTexture.a;
#endif
#ifdef GAMMAALBEDO
surfaceAlbedo*=toLinearSpace(albedoTexture.rgb);
#else
surfaceAlbedo*=albedoTexture.rgb;
#endif
surfaceAlbedo*=albedoInfos.y;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
surfaceAlbedo*=vColor.rgb;
#endif
#ifdef DETAIL
float detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);
surfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo; 
#endif
#define CUSTOM_FRAGMENT_UPDATE_ALBEDO
#ifdef OPACITY
#ifdef OPACITYRGB
alpha=getLuminance(opacityMap.rgb);
#else
alpha*=opacityMap.a;
#endif
alpha*=vOpacityInfos.y;
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)
#ifdef ALPHATEST
if (alpha<ALPHATESTVALUE)
discard;
#ifndef ALPHABLEND
alpha=1.0;
#endif
#endif
#endif
outParams.surfaceAlbedo=surfaceAlbedo;
outParams.alpha=alpha;
}
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockAlbedoOpacity */.v.IncludesShadersStore.pbrBlockAlbedoOpacity = pbrBlockAlbedoOpacity_shader;const pbrBlockAlbedoOpacity = { name: "pbrBlockAlbedoOpacity", shader: pbrBlockAlbedoOpacity_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectivity.js
const pbrBlockReflectivity_name = "pbrBlockReflectivity",pbrBlockReflectivity_shader = `struct reflectivityOutParams
{
float microSurface;
float roughness;
vec3 surfaceReflectivityColor;
#ifdef METALLICWORKFLOW
vec3 surfaceAlbedo;
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
vec3 ambientOcclusionColor;
#endif
#if DEBUGMODE>0
vec4 surfaceMetallicColorMap;
vec4 surfaceReflectivityColorMap;
vec2 metallicRoughness;
vec3 metallicF0;
#endif
};
#define pbr_inline
void reflectivityBlock(
in vec4 vReflectivityColor,
#ifdef METALLICWORKFLOW
in vec3 surfaceAlbedo,
in vec4 metallicReflectanceFactors,
#endif
#ifdef REFLECTIVITY
in vec3 reflectivityInfos,
in vec4 surfaceMetallicOrReflectivityColorMap,
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
in vec3 ambientOcclusionColorIn,
#endif
#ifdef MICROSURFACEMAP
in vec4 microSurfaceTexel,
#endif
#ifdef DETAIL
in vec4 detailColor,
in vec4 vDetailInfos,
#endif
out reflectivityOutParams outParams
)
{
float microSurface=vReflectivityColor.a;
vec3 surfaceReflectivityColor=vReflectivityColor.rgb;
#ifdef METALLICWORKFLOW
vec2 metallicRoughness=surfaceReflectivityColor.rg;
#ifdef REFLECTIVITY
#if DEBUGMODE>0
outParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;
#endif
#ifdef AOSTOREINMETALMAPRED
vec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);
outParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);
#endif
#ifdef METALLNESSSTOREINMETALMAPBLUE
metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;
#else
metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;
#endif
#ifdef ROUGHNESSSTOREINMETALMAPALPHA
metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;
#else
#ifdef ROUGHNESSSTOREINMETALMAPGREEN
metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;
#endif
#endif
#endif
#ifdef DETAIL
float detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);
float loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);
float hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);
metallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));
#endif
#ifdef MICROSURFACEMAP
metallicRoughness.g*=microSurfaceTexel.r;
#endif
#if DEBUGMODE>0
outParams.metallicRoughness=metallicRoughness;
#endif
#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS
microSurface=1.0-metallicRoughness.g;
vec3 baseColor=surfaceAlbedo;
#ifdef FROSTBITE_REFLECTANCE
outParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);
surfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);
#else
vec3 metallicF0=metallicReflectanceFactors.rgb;
#if DEBUGMODE>0
outParams.metallicF0=metallicF0;
#endif
outParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0),vec3(0.,0.,0.),metallicRoughness.r);
surfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);
#endif
#else
#ifdef REFLECTIVITY
surfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;
#if DEBUGMODE>0
outParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;
#endif
#ifdef MICROSURFACEFROMREFLECTIVITYMAP
microSurface*=surfaceMetallicOrReflectivityColorMap.a;
microSurface*=reflectivityInfos.z;
#else
#ifdef MICROSURFACEAUTOMATIC
microSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);
#endif
#ifdef MICROSURFACEMAP
microSurface*=microSurfaceTexel.r;
#endif
#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE
#endif
#endif
#endif
microSurface=saturate(microSurface);
float roughness=1.-microSurface;
outParams.microSurface=microSurface;
outParams.roughness=roughness;
outParams.surfaceReflectivityColor=surfaceReflectivityColor;
}
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockReflectivity */.v.IncludesShadersStore.pbrBlockReflectivity = pbrBlockReflectivity_shader;const pbrBlockReflectivity = { name: "pbrBlockReflectivity", shader: pbrBlockReflectivity_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAmbientOcclusion.js
const pbrBlockAmbientOcclusion_name = "pbrBlockAmbientOcclusion",pbrBlockAmbientOcclusion_shader = `struct ambientOcclusionOutParams
{
vec3 ambientOcclusionColor;
#if DEBUGMODE>0
vec3 ambientOcclusionColorMap;
#endif
};
#define pbr_inline
void ambientOcclusionBlock(
#ifdef AMBIENT
in vec3 ambientOcclusionColorMap_,
in vec4 vAmbientInfos,
#endif
out ambientOcclusionOutParams outParams
)
{
vec3 ambientOcclusionColor=vec3(1.,1.,1.);
#ifdef AMBIENT
vec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*vAmbientInfos.y;
#ifdef AMBIENTINGRAYSCALE
ambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);
#endif
ambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);
#if DEBUGMODE>0
outParams.ambientOcclusionColorMap=ambientOcclusionColorMap;
#endif
#endif
outParams.ambientOcclusionColor=ambientOcclusionColor;
}
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockAmbientOcclusion */.v.IncludesShadersStore.pbrBlockAmbientOcclusion = pbrBlockAmbientOcclusion_shader;const pbrBlockAmbientOcclusion = { name: "pbrBlockAmbientOcclusion", shader: pbrBlockAmbientOcclusion_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAlphaFresnel.js
const pbrBlockAlphaFresnel_name = "pbrBlockAlphaFresnel",pbrBlockAlphaFresnel_shader = `#ifdef ALPHAFRESNEL
#if defined(ALPHATEST) || defined(ALPHABLEND)
struct alphaFresnelOutParams
{
float alpha;
};
#define pbr_inline
void alphaFresnelBlock(
in vec3 normalW,
in vec3 viewDirectionW,
in float alpha,
in float microSurface,
out alphaFresnelOutParams outParams
)
{
float opacityPerceptual=alpha;
#ifdef LINEARALPHAFRESNEL
float opacity0=opacityPerceptual;
#else
float opacity0=opacityPerceptual*opacityPerceptual;
#endif
float opacity90=fresnelGrazingReflectance(opacity0);
vec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);
outParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;
#ifdef ALPHATEST
if (outParams.alpha<ALPHATESTVALUE)
discard;
#ifndef ALPHABLEND
outParams.alpha=1.0;
#endif
#endif
}
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockAlphaFresnel */.v.IncludesShadersStore.pbrBlockAlphaFresnel = pbrBlockAlphaFresnel_shader;const pbrBlockAlphaFresnel = { name: "pbrBlockAlphaFresnel", shader: pbrBlockAlphaFresnel_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAnisotropic.js
const pbrBlockAnisotropic_name = "pbrBlockAnisotropic",pbrBlockAnisotropic_shader = `#ifdef ANISOTROPIC
struct anisotropicOutParams
{
float anisotropy;
vec3 anisotropicTangent;
vec3 anisotropicBitangent;
vec3 anisotropicNormal;
#if DEBUGMODE>0
vec3 anisotropyMapData;
#endif
};
#define pbr_inline
void anisotropicBlock(
in vec3 vAnisotropy,
#ifdef ANISOTROPIC_TEXTURE
in vec3 anisotropyMapData,
#endif
in mat3 TBN,
in vec3 normalW,
in vec3 viewDirectionW,
out anisotropicOutParams outParams
)
{
float anisotropy=vAnisotropy.b;
vec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);
#ifdef ANISOTROPIC_TEXTURE
anisotropy*=anisotropyMapData.b;
anisotropyDirection.rg*=anisotropyMapData.rg*2.0-1.0;
#if DEBUGMODE>0
outParams.anisotropyMapData=anisotropyMapData;
#endif
#endif
mat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));
vec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);
vec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));
outParams.anisotropy=anisotropy;
outParams.anisotropicTangent=anisotropicTangent;
outParams.anisotropicBitangent=anisotropicBitangent;
outParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy);
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockAnisotropic */.v.IncludesShadersStore.pbrBlockAnisotropic = pbrBlockAnisotropic_shader;const pbrBlockAnisotropic = { name: "pbrBlockAnisotropic", shader: pbrBlockAnisotropic_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflection.js
const pbrBlockReflection_name = "pbrBlockReflection",pbrBlockReflection_shader = `#ifdef REFLECTION
struct reflectionOutParams
{
vec4 environmentRadiance;
vec3 environmentIrradiance;
#ifdef REFLECTIONMAP_3D
vec3 reflectionCoords;
#else
vec2 reflectionCoords;
#endif
#ifdef SS_TRANSLUCENCY
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
vec3 irradianceVector;
#endif
#endif
#endif
};
#define pbr_inline
void createReflectionCoords(
in vec3 vPositionW,
in vec3 normalW,
#ifdef ANISOTROPIC
in anisotropicOutParams anisotropicOut,
#endif
#ifdef REFLECTIONMAP_3D
out vec3 reflectionCoords
#else
out vec2 reflectionCoords
#endif
)
{
#ifdef ANISOTROPIC
vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal);
#else
vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
reflectionCoords=reflectionVector;
#else
reflectionCoords=reflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
reflectionCoords/=reflectionVector.z;
#endif
reflectionCoords.y=1.0-reflectionCoords.y;
#endif
}
#define pbr_inline
#define inline
void sampleReflectionTexture(
in float alphaG,
in vec3 vReflectionMicrosurfaceInfos,
in vec2 vReflectionInfos,
in vec3 vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
in float NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
in float roughness,
#endif
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSampler,
const vec3 reflectionCoords,
#else
in sampler2D reflectionSampler,
const vec2 reflectionCoords,
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSamplerLow,
in samplerCube reflectionSamplerHigh,
#else
in sampler2D reflectionSamplerLow,
in sampler2D reflectionSamplerHigh,
#endif
#endif
#ifdef REALTIME_FILTERING
in vec2 vReflectionFilteringInfo,
#endif
out vec4 environmentRadiance
)
{
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);
#elif defined(LINEARSPECULARREFLECTION)
float reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);
#else
float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);
#endif
#ifdef LODBASEDMICROSFURACE
reflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;
#ifdef LODINREFLECTIONALPHA
float automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);
float requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);
#else
float requestedReflectionLOD=reflectionLOD;
#endif
#ifdef REALTIME_FILTERING
environmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);
#else
environmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);
#endif
#else
float lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));
float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;
vec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);
if (lodReflectionNormalizedDoubled<1.0){
environmentRadiance=mix(
sampleReflection(reflectionSamplerHigh,reflectionCoords),
environmentMid,
lodReflectionNormalizedDoubled
);
} else {
environmentRadiance=mix(
environmentMid,
sampleReflection(reflectionSamplerLow,reflectionCoords),
lodReflectionNormalizedDoubled-1.0
);
}
#endif
#ifdef RGBDREFLECTION
environmentRadiance.rgb=fromRGBD(environmentRadiance);
#endif
#ifdef GAMMAREFLECTION
environmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);
#endif
environmentRadiance.rgb*=vReflectionInfos.x;
environmentRadiance.rgb*=vReflectionColor.rgb;
}
#define pbr_inline
#define inline
void reflectionBlock(
in vec3 vPositionW,
in vec3 normalW,
in float alphaG,
in vec3 vReflectionMicrosurfaceInfos,
in vec2 vReflectionInfos,
in vec3 vReflectionColor,
#ifdef ANISOTROPIC
in anisotropicOutParams anisotropicOut,
#endif
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
in float NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
in float roughness,
#endif
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSampler,
#else
in sampler2D reflectionSampler,
#endif
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
in vec3 vEnvironmentIrradiance,
#endif
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
in mat4 reflectionMatrix,
#endif
#endif
#ifdef USEIRRADIANCEMAP
#ifdef REFLECTIONMAP_3D
in samplerCube irradianceSampler,
#else
in sampler2D irradianceSampler,
#endif
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSamplerLow,
in samplerCube reflectionSamplerHigh,
#else
in sampler2D reflectionSamplerLow,
in sampler2D reflectionSamplerHigh,
#endif
#endif
#ifdef REALTIME_FILTERING
in vec2 vReflectionFilteringInfo,
#endif
out reflectionOutParams outParams
)
{
vec4 environmentRadiance=vec4(0.,0.,0.,0.);
#ifdef REFLECTIONMAP_3D
vec3 reflectionCoords=vec3(0.);
#else
vec2 reflectionCoords=vec2(0.);
#endif
createReflectionCoords(
vPositionW,
normalW,
#ifdef ANISOTROPIC
anisotropicOut,
#endif
reflectionCoords
);
sampleReflectionTexture(
alphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
roughness,
#endif
#ifdef REFLECTIONMAP_3D
reflectionSampler,
reflectionCoords,
#else
reflectionSampler,
reflectionCoords,
#endif
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
environmentRadiance
);
vec3 environmentIrradiance=vec3(0.,0.,0.);
#ifdef USESPHERICALFROMREFLECTIONMAP
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
environmentIrradiance=vEnvironmentIrradiance;
#else
#ifdef ANISOTROPIC
vec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz;
#else
vec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
irradianceVector.z*=-1.0;
#endif
#ifdef INVERTCUBICMAP
irradianceVector.y*=-1.0;
#endif
#if defined(REALTIME_FILTERING)
environmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo);
#else
environmentIrradiance=computeEnvironmentIrradiance(irradianceVector);
#endif
#ifdef SS_TRANSLUCENCY
outParams.irradianceVector=irradianceVector;
#endif
#endif
#elif defined(USEIRRADIANCEMAP)
vec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords);
environmentIrradiance=environmentIrradiance4.rgb;
#ifdef RGBDREFLECTION
environmentIrradiance.rgb=fromRGBD(environmentIrradiance4);
#endif
#ifdef GAMMAREFLECTION
environmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);
#endif
#endif
environmentIrradiance*=vReflectionColor.rgb;
outParams.environmentRadiance=environmentRadiance;
outParams.environmentIrradiance=environmentIrradiance;
outParams.reflectionCoords=reflectionCoords;
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockReflection */.v.IncludesShadersStore.pbrBlockReflection = pbrBlockReflection_shader;const pbrBlockReflection = { name: "pbrBlockReflection", shader: pbrBlockReflection_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockSheen.js
const pbrBlockSheen_name = "pbrBlockSheen",pbrBlockSheen_shader = `#ifdef SHEEN
struct sheenOutParams
{
float sheenIntensity;
vec3 sheenColor;
float sheenRoughness;
#ifdef SHEEN_LINKWITHALBEDO
vec3 surfaceAlbedo;
#endif
#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
float sheenAlbedoScaling;
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
vec3 finalSheenRadianceScaled;
#endif
#if DEBUGMODE>0
vec4 sheenMapData;
vec3 sheenEnvironmentReflectance;
#endif
};
#define pbr_inline
#define inline
void sheenBlock(
in vec4 vSheenColor,
#ifdef SHEEN_ROUGHNESS
in float vSheenRoughness,
#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
in vec4 sheenMapRoughnessData,
#endif
#endif
in float roughness,
#ifdef SHEEN_TEXTURE
in vec4 sheenMapData,
in float sheenMapLevel,
#endif
in float reflectance,
#ifdef SHEEN_LINKWITHALBEDO
in vec3 baseColor,
in vec3 surfaceAlbedo,
#endif
#ifdef ENVIRONMENTBRDF
in float NdotV,
in vec3 environmentBrdf,
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
in vec2 AARoughnessFactors,
in vec3 vReflectionMicrosurfaceInfos,
in vec2 vReflectionInfos,
in vec3 vReflectionColor,
in vec4 vLightingIntensity,
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSampler,
in vec3 reflectionCoords,
#else
in sampler2D reflectionSampler,
in vec2 reflectionCoords,
#endif
in float NdotVUnclamped,
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSamplerLow,
in samplerCube reflectionSamplerHigh,
#else
in sampler2D reflectionSamplerLow,
in sampler2D reflectionSamplerHigh,
#endif
#endif
#ifdef REALTIME_FILTERING
in vec2 vReflectionFilteringInfo,
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
in float seo,
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
in float eho,
#endif
#endif
out sheenOutParams outParams
)
{
float sheenIntensity=vSheenColor.a;
#ifdef SHEEN_TEXTURE
#if DEBUGMODE>0
outParams.sheenMapData=sheenMapData;
#endif
#endif
#ifdef SHEEN_LINKWITHALBEDO
float sheenFactor=pow5(1.0-sheenIntensity);
vec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);
float sheenRoughness=sheenIntensity;
outParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;
#ifdef SHEEN_TEXTURE
sheenIntensity*=sheenMapData.a;
#endif
#else
vec3 sheenColor=vSheenColor.rgb;
#ifdef SHEEN_TEXTURE
#ifdef SHEEN_GAMMATEXTURE
sheenColor.rgb*=toLinearSpace(sheenMapData.rgb);
#else
sheenColor.rgb*=sheenMapData.rgb;
#endif
sheenColor.rgb*=sheenMapLevel;
#endif
#ifdef SHEEN_ROUGHNESS
float sheenRoughness=vSheenRoughness;
#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE
#if defined(SHEEN_TEXTURE)
sheenRoughness*=sheenMapData.a;
#endif
#elif defined(SHEEN_TEXTURE_ROUGHNESS)
#ifdef SHEEN_TEXTURE_ROUGHNESS_IDENTICAL
sheenRoughness*=sheenMapData.a;
#else
sheenRoughness*=sheenMapRoughnessData.a;
#endif
#endif
#else
float sheenRoughness=roughness;
#ifdef SHEEN_TEXTURE
sheenIntensity*=sheenMapData.a;
#endif
#endif
#if !defined(SHEEN_ALBEDOSCALING)
sheenIntensity*=(1.-reflectance);
#endif
sheenColor*=sheenIntensity;
#endif
#ifdef ENVIRONMENTBRDF
/*#ifdef SHEEN_SOFTER
vec3 environmentSheenBrdf=vec3(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness));
#else*/
#ifdef SHEEN_ROUGHNESS
vec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);
#else
vec3 environmentSheenBrdf=environmentBrdf;
#endif
/*#endif*/
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
float sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);
#ifdef SPECULARAA
sheenAlphaG+=AARoughnessFactors.y;
#endif
vec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);
sampleReflectionTexture(
sheenAlphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
sheenRoughness,
#endif
reflectionSampler,
reflectionCoords,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
environmentSheenRadiance
);
vec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
sheenEnvironmentReflectance*=seo;
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
sheenEnvironmentReflectance*=eho;
#endif
#if DEBUGMODE>0
outParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;
#endif
outParams.finalSheenRadianceScaled=
environmentSheenRadiance.rgb *
sheenEnvironmentReflectance *
vLightingIntensity.z;
#endif
#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
outParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;
#endif
outParams.sheenIntensity=sheenIntensity;
outParams.sheenColor=sheenColor;
outParams.sheenRoughness=sheenRoughness;
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockSheen */.v.IncludesShadersStore.pbrBlockSheen = pbrBlockSheen_shader;const pbrBlockSheen = { name: "pbrBlockSheen", shader: pbrBlockSheen_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockClearcoat.js
const pbrBlockClearcoat_name = "pbrBlockClearcoat",pbrBlockClearcoat_shader = `struct clearcoatOutParams
{
vec3 specularEnvironmentR0;
float conservationFactor;
vec3 clearCoatNormalW;
vec2 clearCoatAARoughnessFactors;
float clearCoatIntensity;
float clearCoatRoughness;
#ifdef REFLECTION
vec3 finalClearCoatRadianceScaled;
#endif
#ifdef CLEARCOAT_TINT
vec3 absorption;
float clearCoatNdotVRefract;
vec3 clearCoatColor;
float clearCoatThickness;
#endif
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
vec3 energyConservationFactorClearCoat;
#endif
#if DEBUGMODE>0
mat3 TBNClearCoat;
vec2 clearCoatMapData;
vec4 clearCoatTintMapData;
vec4 environmentClearCoatRadiance;
float clearCoatNdotV;
vec3 clearCoatEnvironmentReflectance;
#endif
};
#ifdef CLEARCOAT
#define pbr_inline
#define inline
void clearcoatBlock(
in vec3 vPositionW,
in vec3 geometricNormalW,
in vec3 viewDirectionW,
in vec2 vClearCoatParams,
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
in vec4 clearCoatMapRoughnessData,
#endif
in vec3 specularEnvironmentR0,
#ifdef CLEARCOAT_TEXTURE
in vec2 clearCoatMapData,
#endif
#ifdef CLEARCOAT_TINT
in vec4 vClearCoatTintParams,
in float clearCoatColorAtDistance,
in vec4 vClearCoatRefractionParams,
#ifdef CLEARCOAT_TINT_TEXTURE
in vec4 clearCoatTintMapData,
#endif
#endif
#ifdef CLEARCOAT_BUMP
in vec2 vClearCoatBumpInfos,
in vec4 clearCoatBumpMapData,
in vec2 vClearCoatBumpUV,
#if defined(TANGENT) && defined(NORMAL)
in mat3 vTBN,
#else
in vec2 vClearCoatTangentSpaceParams,
#endif
#ifdef OBJECTSPACE_NORMALMAP
in mat4 normalMatrix,
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
in vec3 faceNormal,
#endif
#ifdef REFLECTION
in vec3 vReflectionMicrosurfaceInfos,
in vec2 vReflectionInfos,
in vec3 vReflectionColor,
in vec4 vLightingIntensity,
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSampler,
#else
in sampler2D reflectionSampler,
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSamplerLow,
in samplerCube reflectionSamplerHigh,
#else
in sampler2D reflectionSamplerLow,
in sampler2D reflectionSamplerHigh,
#endif
#endif
#ifdef REALTIME_FILTERING
in vec2 vReflectionFilteringInfo,
#endif
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
#ifdef RADIANCEOCCLUSION
in float ambientMonochrome,
#endif
#endif
#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
in float frontFacingMultiplier,
#endif
out clearcoatOutParams outParams
)
{
float clearCoatIntensity=vClearCoatParams.x;
float clearCoatRoughness=vClearCoatParams.y;
#ifdef CLEARCOAT_TEXTURE
clearCoatIntensity*=clearCoatMapData.x;
#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE
clearCoatRoughness*=clearCoatMapData.y;
#endif
#if DEBUGMODE>0
outParams.clearCoatMapData=clearCoatMapData;
#endif
#endif
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
#ifdef CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL
clearCoatRoughness*=clearCoatMapData.y;
#else
clearCoatRoughness*=clearCoatMapRoughnessData.y;
#endif
#endif
outParams.clearCoatIntensity=clearCoatIntensity;
outParams.clearCoatRoughness=clearCoatRoughness;
#ifdef CLEARCOAT_TINT
vec3 clearCoatColor=vClearCoatTintParams.rgb;
float clearCoatThickness=vClearCoatTintParams.a;
#ifdef CLEARCOAT_TINT_TEXTURE
#ifdef CLEARCOAT_TINT_GAMMATEXTURE
clearCoatColor*=toLinearSpace(clearCoatTintMapData.rgb);
#else
clearCoatColor*=clearCoatTintMapData.rgb;
#endif
clearCoatThickness*=clearCoatTintMapData.a;
#if DEBUGMODE>0
outParams.clearCoatTintMapData=clearCoatTintMapData;
#endif
#endif
outParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);
outParams.clearCoatThickness=clearCoatThickness;
#endif
#ifdef CLEARCOAT_REMAP_F0
vec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);
#else
vec3 specularEnvironmentR0Updated=specularEnvironmentR0;
#endif
outParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);
vec3 clearCoatNormalW=geometricNormalW;
#ifdef CLEARCOAT_BUMP
#ifdef NORMALXYSCALE
float clearCoatNormalScale=1.0;
#else
float clearCoatNormalScale=vClearCoatBumpInfos.y;
#endif
#if defined(TANGENT) && defined(NORMAL)
mat3 TBNClearCoat=vTBN;
#else
vec2 TBNClearCoatUV=vClearCoatBumpUV*frontFacingMultiplier;
mat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams);
#endif
#if DEBUGMODE>0
outParams.TBNClearCoat=TBNClearCoat;
#endif
#ifdef OBJECTSPACE_NORMALMAP
clearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);
clearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);
#else
clearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
clearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));
#endif
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
clearCoatNormalW=clearCoatNormalW*frontFacingMultiplier;
#endif
outParams.clearCoatNormalW=clearCoatNormalW;
outParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);
float clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);
float clearCoatNdotV=absEps(clearCoatNdotVUnclamped);
#if DEBUGMODE>0
outParams.clearCoatNdotV=clearCoatNdotV;
#endif
#ifdef CLEARCOAT_TINT
vec3 clearCoatVRefract=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);
outParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));
#endif
#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION))
vec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);
#endif
#if defined(REFLECTION)
float clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);
#ifdef SPECULARAA
clearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;
#endif
vec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);
vec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);
#ifdef REFLECTIONMAP_OPPOSITEZ
clearCoatReflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
vec3 clearCoatReflectionCoords=clearCoatReflectionVector;
#else
vec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
clearCoatReflectionCoords/=clearCoatReflectionVector.z;
#endif
clearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;
#endif
sampleReflectionTexture(
clearCoatAlphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
clearCoatNdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
clearCoatRoughness,
#endif
reflectionSampler,
clearCoatReflectionCoords,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
environmentClearCoatRadiance
);
#if DEBUGMODE>0
outParams.environmentClearCoatRadiance=environmentClearCoatRadiance;
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
vec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);
#ifdef RADIANCEOCCLUSION
float clearCoatSeo=environmentRadianceOcclusion(ambientMonochrome,clearCoatNdotVUnclamped);
clearCoatEnvironmentReflectance*=clearCoatSeo;
#endif
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
float clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);
clearCoatEnvironmentReflectance*=clearCoatEho;
#endif
#endif
#endif
#else
vec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));
#endif
clearCoatEnvironmentReflectance*=clearCoatIntensity;
#if DEBUGMODE>0
outParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;
#endif
outParams.finalClearCoatRadianceScaled=
environmentClearCoatRadiance.rgb *
clearCoatEnvironmentReflectance *
vLightingIntensity.z;
#endif
#if defined(CLEARCOAT_TINT)
outParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);
#endif
float fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);
fresnelIBLClearCoat*=clearCoatIntensity;
outParams.conservationFactor=(1.-fresnelIBLClearCoat);
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
outParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);
#endif
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockClearcoat */.v.IncludesShadersStore.pbrBlockClearcoat = pbrBlockClearcoat_shader;const pbrBlockClearcoat = { name: "pbrBlockClearcoat", shader: pbrBlockClearcoat_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockIridescence.js
const pbrBlockIridescence_name = "pbrBlockIridescence",pbrBlockIridescence_shader = `struct iridescenceOutParams
{
float iridescenceIntensity;
float iridescenceIOR;
float iridescenceThickness;
vec3 specularEnvironmentR0;
};
#ifdef IRIDESCENCE
#define pbr_inline
#define inline
void iridescenceBlock(
in vec4 vIridescenceParams,
in float viewAngle,
in vec3 specularEnvironmentR0,
#ifdef IRIDESCENCE_TEXTURE
in vec2 iridescenceMapData,
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
in vec2 iridescenceThicknessMapData,
#endif
#ifdef CLEARCOAT
in float NdotVUnclamped,
#ifdef CLEARCOAT_TEXTURE
in vec2 clearCoatMapData,
#endif
#endif
out iridescenceOutParams outParams
)
{
float iridescenceIntensity=vIridescenceParams.x;
float iridescenceIOR=vIridescenceParams.y;
float iridescenceThicknessMin=vIridescenceParams.z;
float iridescenceThicknessMax=vIridescenceParams.w;
float iridescenceThicknessWeight=1.;
#ifdef IRIDESCENCE_TEXTURE
iridescenceIntensity*=iridescenceMapData.x;
#ifdef IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE
iridescenceThicknessWeight=iridescenceMapData.g;
#endif
#endif
#if defined(IRIDESCENCE_THICKNESS_TEXTURE)
iridescenceThicknessWeight=iridescenceThicknessMapData.g;
#endif
float iridescenceThickness=mix(iridescenceThicknessMin,iridescenceThicknessMax,iridescenceThicknessWeight);
float topIor=1.; 
#ifdef CLEARCOAT
float clearCoatIntensity=vClearCoatParams.x;
#ifdef CLEARCOAT_TEXTURE
clearCoatIntensity*=clearCoatMapData.x;
#endif
topIor=mix(1.0,vClearCoatRefractionParams.w-1.,clearCoatIntensity);
viewAngle=sqrt(1.0+square(1.0/topIor)*(square(NdotVUnclamped)-1.0));
#endif
vec3 iridescenceFresnel=evalIridescence(topIor,iridescenceIOR,viewAngle,iridescenceThickness,specularEnvironmentR0);
outParams.specularEnvironmentR0=mix(specularEnvironmentR0,iridescenceFresnel,iridescenceIntensity);
outParams.iridescenceIntensity=iridescenceIntensity;
outParams.iridescenceThickness=iridescenceThickness;
outParams.iridescenceIOR=iridescenceIOR;
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockIridescence */.v.IncludesShadersStore.pbrBlockIridescence = pbrBlockIridescence_shader;const pbrBlockIridescence = { name: "pbrBlockIridescence", shader: pbrBlockIridescence_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockSubSurface.js
const pbrBlockSubSurface_name = "pbrBlockSubSurface",pbrBlockSubSurface_shader = `struct subSurfaceOutParams
{
vec3 specularEnvironmentReflectance;
#ifdef SS_REFRACTION
vec3 finalRefraction;
vec3 surfaceAlbedo;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
float alpha;
#endif
#ifdef REFLECTION
float refractionFactorForIrradiance;
#endif
#endif
#ifdef SS_TRANSLUCENCY
vec3 transmittance;
float translucencyIntensity;
#ifdef REFLECTION
vec3 refractionIrradiance;
#endif
#endif
#if DEBUGMODE>0
vec4 thicknessMap;
vec4 environmentRefraction;
vec3 refractionTransmittance;
#endif
};
#ifdef SUBSURFACE
#define pbr_inline
#define inline
void subSurfaceBlock(
in vec3 vSubSurfaceIntensity,
in vec2 vThicknessParam,
in vec4 vTintColor,
in vec3 normalW,
in vec3 specularEnvironmentReflectance,
#ifdef SS_THICKNESSANDMASK_TEXTURE
in vec4 thicknessMap,
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
in vec4 refractionIntensityMap,
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
in vec4 translucencyIntensityMap,
#endif
#ifdef REFLECTION
#ifdef SS_TRANSLUCENCY
in mat4 reflectionMatrix,
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
in vec3 irradianceVector_,
#endif
#if defined(REALTIME_FILTERING)
in samplerCube reflectionSampler,
in vec2 vReflectionFilteringInfo,
#endif
#endif
#ifdef USEIRRADIANCEMAP
#ifdef REFLECTIONMAP_3D
in samplerCube irradianceSampler,
#else
in sampler2D irradianceSampler,
#endif
#endif
#endif
#endif
#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
in vec3 surfaceAlbedo,
#endif
#ifdef SS_REFRACTION
in vec3 vPositionW,
in vec3 viewDirectionW,
in mat4 view,
in vec4 vRefractionInfos,
in mat4 refractionMatrix,
in vec4 vRefractionMicrosurfaceInfos,
in vec4 vLightingIntensity,
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
in float alpha,
#endif
#ifdef SS_LODINREFRACTIONALPHA
in float NdotVUnclamped,
#endif
#ifdef SS_LINEARSPECULARREFRACTION
in float roughness,
#endif
in float alphaG,
#ifdef SS_REFRACTIONMAP_3D
in samplerCube refractionSampler,
#ifndef LODBASEDMICROSFURACE
in samplerCube refractionSamplerLow,
in samplerCube refractionSamplerHigh,
#endif
#else
in sampler2D refractionSampler,
#ifndef LODBASEDMICROSFURACE
in sampler2D refractionSamplerLow,
in sampler2D refractionSamplerHigh,
#endif
#endif
#ifdef ANISOTROPIC
in anisotropicOutParams anisotropicOut,
#endif
#ifdef REALTIME_FILTERING
in vec2 vRefractionFilteringInfo,
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
in vec3 refractionPosition,
in vec3 refractionSize,
#endif
#endif
#ifdef SS_TRANSLUCENCY
in vec3 vDiffusionDistance,
#endif
out subSurfaceOutParams outParams
)
{
outParams.specularEnvironmentReflectance=specularEnvironmentReflectance;
#ifdef SS_REFRACTION
float refractionIntensity=vSubSurfaceIntensity.x;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
refractionIntensity*=(1.0-alpha);
outParams.alpha=1.0;
#endif
#endif
#ifdef SS_TRANSLUCENCY
float translucencyIntensity=vSubSurfaceIntensity.y;
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
#if defined(SS_USE_GLTF_TEXTURES)
float thickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;
#else
float thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;
#endif
#if DEBUGMODE>0
outParams.thicknessMap=thicknessMap;
#endif
#ifdef SS_MASK_FROM_THICKNESS_TEXTURE
#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE)
#if defined(SS_USE_GLTF_TEXTURES)
refractionIntensity*=thicknessMap.r;
#else
refractionIntensity*=thicknessMap.g;
#endif
#endif
#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE)
translucencyIntensity*=thicknessMap.b;
#endif
#endif
#else
float thickness=vThicknessParam.y;
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
#ifdef SS_USE_GLTF_TEXTURES
refractionIntensity*=refractionIntensityMap.r;
#else
refractionIntensity*=refractionIntensityMap.g;
#endif
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
translucencyIntensity*=translucencyIntensityMap.b;
#endif
#ifdef SS_TRANSLUCENCY
thickness=maxEps(thickness);
vec3 transmittance=transmittanceBRDF_Burley(vTintColor.rgb,vDiffusionDistance,thickness);
transmittance*=translucencyIntensity;
outParams.transmittance=transmittance;
outParams.translucencyIntensity=translucencyIntensity;
#endif
#ifdef SS_REFRACTION
vec4 environmentRefraction=vec4(0.,0.,0.,0.);
#ifdef ANISOTROPIC
vec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,vRefractionInfos.y);
#else
vec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);
#endif
#ifdef SS_REFRACTIONMAP_OPPOSITEZ
refractionVector.z*=-1.0;
#endif
#ifdef SS_REFRACTIONMAP_3D
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition);
#endif
refractionVector.y=refractionVector.y*vRefractionInfos.w;
vec3 refractionCoords=refractionVector;
refractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));
#else
#ifdef SS_USE_THICKNESS_AS_DEPTH
vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*thickness,1.0)));
#else
vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));
#endif
vec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;
refractionCoords.y=1.0-refractionCoords.y;
#endif
#ifdef SS_HAS_THICKNESS
float ior=vRefractionInfos.y;
#else
float ior=vRefractionMicrosurfaceInfos.w;
#endif
#ifdef SS_LODINREFRACTIONALPHA
float refractionAlphaG=alphaG;
refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));
float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped);
#elif defined(SS_LINEARSPECULARREFRACTION)
float refractionRoughness=alphaG;
refractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));
float refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness);
#else
float refractionAlphaG=alphaG;
refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));
float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG);
#endif
#ifdef LODBASEDMICROSFURACE
refractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;
#ifdef SS_LODINREFRACTIONALPHA
float automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);
float requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);
#else
float requestedRefractionLOD=refractionLOD;
#endif
#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D)
environmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);
#else
environmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);
#endif
#else
float lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));
float lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;
vec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);
if (lodRefractionNormalizedDoubled<1.0){
environmentRefraction=mix(
sampleRefraction(refractionSamplerHigh,refractionCoords),
environmentRefractionMid,
lodRefractionNormalizedDoubled
);
} else {
environmentRefraction=mix(
environmentRefractionMid,
sampleRefraction(refractionSamplerLow,refractionCoords),
lodRefractionNormalizedDoubled-1.0
);
}
#endif
#ifdef SS_RGBDREFRACTION
environmentRefraction.rgb=fromRGBD(environmentRefraction);
#endif
#ifdef SS_GAMMAREFRACTION
environmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);
#endif
environmentRefraction.rgb*=vRefractionInfos.x;
#endif
#ifdef SS_REFRACTION
vec3 refractionTransmittance=vec3(refractionIntensity);
#ifdef SS_THICKNESSANDMASK_TEXTURE
vec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);
refractionTransmittance*=cocaLambert(volumeAlbedo,thickness);
#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)
float maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);
vec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);
environmentRefraction.rgb*=volumeAlbedo;
#else
vec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);
refractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);
#endif
#ifdef SS_ALBEDOFORREFRACTIONTINT
environmentRefraction.rgb*=surfaceAlbedo.rgb;
#endif
outParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);
#ifdef REFLECTION
outParams.refractionFactorForIrradiance=(1.-refractionIntensity);
#endif
#ifdef UNUSED_MULTIPLEBOUNCES
vec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);
outParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);
#endif
refractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;
#if DEBUGMODE>0
outParams.refractionTransmittance=refractionTransmittance;
#endif
outParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;
#if DEBUGMODE>0
outParams.environmentRefraction=environmentRefraction;
#endif
#endif
#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)
#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)
vec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;
#ifdef REFLECTIONMAP_OPPOSITEZ
irradianceVector.z*=-1.0;
#endif
#ifdef INVERTCUBICMAP
irradianceVector.y*=-1.0;
#endif
#else
vec3 irradianceVector=irradianceVector_;
#endif
#if defined(USESPHERICALFROMREFLECTIONMAP)
#if defined(REALTIME_FILTERING)
vec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo);
#else
vec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);
#endif
#elif defined(USEIRRADIANCEMAP)
#ifdef REFLECTIONMAP_3D
vec3 irradianceCoords=irradianceVector;
#else
vec2 irradianceCoords=irradianceVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
irradianceCoords/=irradianceVector.z;
#endif
irradianceCoords.y=1.0-irradianceCoords.y;
#endif
vec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);
#ifdef RGBDREFLECTION
refractionIrradiance.rgb=fromRGBD(refractionIrradiance);
#endif
#ifdef GAMMAREFLECTION
refractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);
#endif
#else
vec4 refractionIrradiance=vec4(0.);
#endif
refractionIrradiance.rgb*=transmittance;
#ifdef SS_ALBEDOFORTRANSLUCENCYTINT
refractionIrradiance.rgb*=surfaceAlbedo.rgb;
#endif
outParams.refractionIrradiance=refractionIrradiance.rgb;
#endif
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockSubSurface */.v.IncludesShadersStore.pbrBlockSubSurface = pbrBlockSubSurface_shader;const pbrBlockSubSurface = { name: "pbrBlockSubSurface", shader: pbrBlockSubSurface_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockNormalGeometric.js
const pbrBlockNormalGeometric_name = "pbrBlockNormalGeometric",pbrBlockNormalGeometric_shader = `vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;
#endif
vec3 geometricNormalW=normalW;
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
geometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockNormalGeometric */.v.IncludesShadersStore.pbrBlockNormalGeometric = pbrBlockNormalGeometric_shader;const pbrBlockNormalGeometric = { name: "pbrBlockNormalGeometric", shader: pbrBlockNormalGeometric_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js
var bumpFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockNormalFinal.js
const pbrBlockNormalFinal_name = "pbrBlockNormalFinal",pbrBlockNormalFinal_shader = `#if defined(FORCENORMALFORWARD) && defined(NORMAL)
vec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;
#if defined(TWOSIDEDLIGHTING)
faceNormal=gl_FrontFacing ? faceNormal : -faceNormal;
#endif
normalW*=sign(dot(normalW,faceNormal));
#endif
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
normalW=gl_FrontFacing ? normalW : -normalW;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockNormalFinal */.v.IncludesShadersStore.pbrBlockNormalFinal = pbrBlockNormalFinal_shader;const pbrBlockNormalFinal = { name: "pbrBlockNormalFinal", shader: pbrBlockNormalFinal_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js
var depthPrePass = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockLightmapInit.js
const pbrBlockLightmapInit_name = "pbrBlockLightmapInit",pbrBlockLightmapInit_shader = `#ifdef LIGHTMAP
vec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);
#ifdef RGBDLIGHTMAP
lightmapColor.rgb=fromRGBD(lightmapColor);
#endif
#ifdef GAMMALIGHTMAP
lightmapColor.rgb=toLinearSpace(lightmapColor.rgb);
#endif
lightmapColor.rgb*=vLightmapInfos.y;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockLightmapInit */.v.IncludesShadersStore.pbrBlockLightmapInit = pbrBlockLightmapInit_shader;const pbrBlockLightmapInit = { name: "pbrBlockLightmapInit", shader: pbrBlockLightmapInit_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockGeometryInfo.js
const pbrBlockGeometryInfo_name = "pbrBlockGeometryInfo",pbrBlockGeometryInfo_shader = `float NdotVUnclamped=dot(normalW,viewDirectionW);
float NdotV=absEps(NdotVUnclamped);
float alphaG=convertRoughnessToAverageSlope(roughness);
vec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz);
#ifdef SPECULARAA
alphaG+=AARoughnessFactors.y;
#endif
#if defined(ENVIRONMENTBRDF)
vec3 environmentBrdf=getBRDFLookup(NdotV,roughness);
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
#ifdef RADIANCEOCCLUSION
#ifdef AMBIENTINGRAYSCALE
float ambientMonochrome=aoOut.ambientOcclusionColor.r;
#else
float ambientMonochrome=getLuminance(aoOut.ambientOcclusionColor);
#endif
float seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);
#endif
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
float eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);
#endif
#endif
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockGeometryInfo */.v.IncludesShadersStore.pbrBlockGeometryInfo = pbrBlockGeometryInfo_shader;const pbrBlockGeometryInfo = { name: "pbrBlockGeometryInfo", shader: pbrBlockGeometryInfo_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectance0.js
const pbrBlockReflectance0_name = "pbrBlockReflectance0",pbrBlockReflectance0_shader = `float reflectance=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);
vec3 specularEnvironmentR0=reflectivityOut.surfaceReflectivityColor.rgb;
#ifdef METALLICWORKFLOW
vec3 specularEnvironmentR90=vec3(metallicReflectanceFactors.a);
#else 
vec3 specularEnvironmentR90=vec3(1.0,1.0,1.0);
#endif
#ifdef ALPHAFRESNEL
float reflectance90=fresnelGrazingReflectance(reflectance);
specularEnvironmentR90=specularEnvironmentR90*reflectance90;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockReflectance0 */.v.IncludesShadersStore.pbrBlockReflectance0 = pbrBlockReflectance0_shader;const pbrBlockReflectance0 = { name: "pbrBlockReflectance0", shader: pbrBlockReflectance0_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectance.js
const pbrBlockReflectance_name = "pbrBlockReflectance",pbrBlockReflectance_shader = `#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
vec3 specularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,environmentBrdf);
#ifdef RADIANCEOCCLUSION
specularEnvironmentReflectance*=seo;
#endif
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
specularEnvironmentReflectance*=eho;
#endif
#endif
#endif
#else
vec3 specularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));
#endif
#ifdef CLEARCOAT
specularEnvironmentReflectance*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
specularEnvironmentReflectance*=clearcoatOut.absorption;
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockReflectance */.v.IncludesShadersStore.pbrBlockReflectance = pbrBlockReflectance_shader;const pbrBlockReflectance = { name: "pbrBlockReflectance", shader: pbrBlockReflectance_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockDirectLighting.js
const pbrBlockDirectLighting_name = "pbrBlockDirectLighting",pbrBlockDirectLighting_shader = `vec3 diffuseBase=vec3(0.,0.,0.);
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
#ifdef CLEARCOAT
vec3 clearCoatBase=vec3(0.,0.,0.);
#endif
#ifdef SHEEN
vec3 sheenBase=vec3(0.,0.,0.);
#endif
preLightingInfo preInfo;
lightingInfo info;
float shadow=1.; 
#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
vec3 absorption=vec3(0.);
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockDirectLighting */.v.IncludesShadersStore.pbrBlockDirectLighting = pbrBlockDirectLighting_shader;const pbrBlockDirectLighting = { name: "pbrBlockDirectLighting", shader: pbrBlockDirectLighting_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js
var lightFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js
const pbrBlockFinalLitComponents_name = "pbrBlockFinalLitComponents",pbrBlockFinalLitComponents_shader = `#if defined(ENVIRONMENTBRDF)
#ifdef MS_BRDF_ENERGY_CONSERVATION
vec3 energyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);
#endif
#endif
#ifndef METALLICWORKFLOW
#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION
surfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;
#endif
#endif
#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)
surfaceAlbedo.rgb=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;
#endif
#ifdef REFLECTION
vec3 finalIrradiance=reflectionOut.environmentIrradiance;
#if defined(CLEARCOAT)
finalIrradiance*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
finalIrradiance*=clearcoatOut.absorption;
#endif
#endif
#if defined(SS_REFRACTION)
finalIrradiance*=subSurfaceOut.refractionFactorForIrradiance;
#endif
#if defined(SS_TRANSLUCENCY)
finalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);
finalIrradiance+=subSurfaceOut.refractionIrradiance;
#endif
finalIrradiance*=surfaceAlbedo.rgb;
finalIrradiance*=vLightingIntensity.z;
finalIrradiance*=aoOut.ambientOcclusionColor;
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase;
finalSpecular=max(finalSpecular,0.0);
vec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalSpecularScaled*=energyConservationFactor;
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
finalSpecularScaled*=sheenOut.sheenAlbedoScaling;
#endif
#endif
#ifdef REFLECTION
vec3 finalRadiance=reflectionOut.environmentRadiance.rgb;
finalRadiance*=subSurfaceOut.specularEnvironmentReflectance;
vec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalRadianceScaled*=energyConservationFactor;
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
finalRadianceScaled*=sheenOut.sheenAlbedoScaling;
#endif
#endif
#ifdef SHEEN
vec3 finalSheen=sheenBase*sheenOut.sheenColor;
finalSheen=max(finalSheen,0.0);
vec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w;
#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)
sheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
sheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;
#endif
#endif
#endif
#ifdef CLEARCOAT
vec3 finalClearCoat=clearCoatBase;
finalClearCoat=max(finalClearCoat,0.0);
vec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;
#endif
#ifdef SS_REFRACTION
subSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;
#ifdef CLEARCOAT_TINT
subSurfaceOut.finalRefraction*=clearcoatOut.absorption;
#endif
#endif
#endif
#ifdef ALPHABLEND
float luminanceOverAlpha=0.0;
#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)
luminanceOverAlpha+=getLuminance(finalRadianceScaled);
#if defined(CLEARCOAT)
luminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);
#endif
#endif
#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)
luminanceOverAlpha+=getLuminance(finalSpecularScaled);
#endif
#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)
luminanceOverAlpha+=getLuminance(finalClearCoatScaled);
#endif
#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA)
alpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockFinalLitComponents */.v.IncludesShadersStore.pbrBlockFinalLitComponents = pbrBlockFinalLitComponents_shader;const pbrBlockFinalLitComponents = { name: "pbrBlockFinalLitComponents", shader: pbrBlockFinalLitComponents_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js
const pbrBlockFinalUnlitComponents_name = "pbrBlockFinalUnlitComponents",pbrBlockFinalUnlitComponents_shader = `vec3 finalDiffuse=diffuseBase;
finalDiffuse*=surfaceAlbedo.rgb;
finalDiffuse=max(finalDiffuse,0.0);
finalDiffuse*=vLightingIntensity.x;
vec3 finalAmbient=vAmbientColor;
finalAmbient*=surfaceAlbedo.rgb;
vec3 finalEmissive=vEmissiveColor;
#ifdef EMISSIVE
vec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;
#ifdef GAMMAEMISSIVE
finalEmissive*=toLinearSpace(emissiveColorTex.rgb);
#else
finalEmissive*=emissiveColorTex.rgb;
#endif
finalEmissive*= vEmissiveInfos.y;
#endif
finalEmissive*=vLightingIntensity.y;
#ifdef AMBIENT
vec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),aoOut.ambientOcclusionColor,vAmbientInfos.w);
#else
vec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor;
#endif
finalAmbient*=aoOut.ambientOcclusionColor;
finalDiffuse*=ambientOcclusionForDirectDiffuse;
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockFinalUnlitComponents */.v.IncludesShadersStore.pbrBlockFinalUnlitComponents = pbrBlockFinalUnlitComponents_shader;const pbrBlockFinalUnlitComponents = { name: "pbrBlockFinalUnlitComponents", shader: pbrBlockFinalUnlitComponents_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalColorComposition.js
const pbrBlockFinalColorComposition_name = "pbrBlockFinalColorComposition",pbrBlockFinalColorComposition_shader = `vec4 finalColor=vec4(
#ifndef UNLIT
#ifdef REFLECTION
finalIrradiance +
#endif
#ifdef SPECULARTERM
finalSpecularScaled +
#endif
#ifdef SHEEN
finalSheenScaled +
#endif
#ifdef CLEARCOAT
finalClearCoatScaled +
#endif
#ifdef REFLECTION
finalRadianceScaled +
#if defined(SHEEN) && defined(ENVIRONMENTBRDF)
sheenOut.finalSheenRadianceScaled +
#endif
#ifdef CLEARCOAT
clearcoatOut.finalClearCoatRadianceScaled +
#endif
#endif
#ifdef SS_REFRACTION
subSurfaceOut.finalRefraction +
#endif
#endif
finalAmbient +
finalDiffuse,
alpha);
#ifdef LIGHTMAP
#ifndef LIGHTMAPEXCLUDED
#ifdef USELIGHTMAPASSHADOWMAP
finalColor.rgb*=lightmapColor.rgb;
#else
finalColor.rgb+=lightmapColor.rgb;
#endif
#endif
#endif
finalColor.rgb+=finalEmissive;
#define CUSTOM_FRAGMENT_BEFORE_FOG
finalColor=max(finalColor,0.0);
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockFinalColorComposition */.v.IncludesShadersStore.pbrBlockFinalColorComposition = pbrBlockFinalColorComposition_shader;const pbrBlockFinalColorComposition = { name: "pbrBlockFinalColorComposition", shader: pbrBlockFinalColorComposition_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockImageProcessing.js
const pbrBlockImageProcessing_name = "pbrBlockImageProcessing",pbrBlockImageProcessing_shader = `#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)
#if !defined(SKIPFINALCOLORCLAMP)
finalColor.rgb=clamp(finalColor.rgb,0.,30.0);
#endif
#else
finalColor=applyImageProcessing(finalColor);
#endif
finalColor.a*=visibility;
#ifdef PREMULTIPLYALPHA
finalColor.rgb*=finalColor.a;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrBlockImageProcessing */.v.IncludesShadersStore.pbrBlockImageProcessing = pbrBlockImageProcessing_shader;const pbrBlockImageProcessing = { name: "pbrBlockImageProcessing", shader: pbrBlockImageProcessing_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitFragment.js
var oitFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDebug.js
const pbrDebug_name = "pbrDebug",pbrDebug_shader = `#if DEBUGMODE>0
if (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) {
#if DEBUGMODE==1
gl_FragColor.rgb=vPositionW.rgb;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==2 && defined(NORMAL)
gl_FragColor.rgb=vNormalW.rgb;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==3 && defined(BUMP) || DEBUGMODE==3 && defined(PARALLAX) || DEBUGMODE==3 && defined(ANISOTROPIC)
gl_FragColor.rgb=TBN[0];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==4 && defined(BUMP) || DEBUGMODE==4 && defined(PARALLAX) || DEBUGMODE==4 && defined(ANISOTROPIC)
gl_FragColor.rgb=TBN[1];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==5
gl_FragColor.rgb=normalW;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==6 && defined(MAINUV1)
gl_FragColor.rgb=vec3(vMainUV1,0.0);
#elif DEBUGMODE==7 && defined(MAINUV2)
gl_FragColor.rgb=vec3(vMainUV2,0.0);
#elif DEBUGMODE==8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
gl_FragColor.rgb=clearcoatOut.TBNClearCoat[0];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
gl_FragColor.rgb=clearcoatOut.TBNClearCoat[1];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==10 && defined(CLEARCOAT)
gl_FragColor.rgb=clearcoatOut.clearCoatNormalW;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==11 && defined(ANISOTROPIC)
gl_FragColor.rgb=anisotropicOut.anisotropicNormal;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==12 && defined(ANISOTROPIC)
gl_FragColor.rgb=anisotropicOut.anisotropicTangent;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==13 && defined(ANISOTROPIC)
gl_FragColor.rgb=anisotropicOut.anisotropicBitangent;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==20 && defined(ALBEDO)
gl_FragColor.rgb=albedoTexture.rgb;
#elif DEBUGMODE==21 && defined(AMBIENT)
gl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb;
#elif DEBUGMODE==22 && defined(OPACITY)
gl_FragColor.rgb=opacityMap.rgb;
#elif DEBUGMODE==23 && defined(EMISSIVE)
gl_FragColor.rgb=emissiveColorTex.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==24 && defined(LIGHTMAP)
gl_FragColor.rgb=lightmapColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)
gl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb;
#elif DEBUGMODE==26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)
gl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)
gl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0);
#elif DEBUGMODE==28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
gl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb;
#elif DEBUGMODE==29 && defined(SHEEN) && defined(SHEEN_TEXTURE)
gl_FragColor.rgb=sheenOut.sheenMapData.rgb;
#elif DEBUGMODE==30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)
gl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb;
#elif DEBUGMODE==31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)
gl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb;
#elif DEBUGMODE==40 && defined(SS_REFRACTION)
gl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==41 && defined(REFLECTION)
gl_FragColor.rgb=reflectionOut.environmentRadiance.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==42 && defined(CLEARCOAT) && defined(REFLECTION)
gl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==50
gl_FragColor.rgb=diffuseBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==51 && defined(SPECULARTERM)
gl_FragColor.rgb=specularBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==52 && defined(CLEARCOAT)
gl_FragColor.rgb=clearCoatBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==53 && defined(SHEEN)
gl_FragColor.rgb=sheenBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==54 && defined(REFLECTION)
gl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==60
gl_FragColor.rgb=surfaceAlbedo.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==61
gl_FragColor.rgb=clearcoatOut.specularEnvironmentR0;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==62 && defined(METALLICWORKFLOW)
gl_FragColor.rgb=vec3(reflectivityOut.metallicRoughness.r);
#elif DEBUGMODE==71 && defined(METALLICWORKFLOW)
gl_FragColor.rgb=reflectivityOut.metallicF0;
#elif DEBUGMODE==63
gl_FragColor.rgb=vec3(roughness);
#elif DEBUGMODE==64
gl_FragColor.rgb=vec3(alphaG);
#elif DEBUGMODE==65
gl_FragColor.rgb=vec3(NdotV);
#elif DEBUGMODE==66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
gl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==67 && defined(CLEARCOAT)
gl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness);
#elif DEBUGMODE==68 && defined(CLEARCOAT)
gl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV);
#elif DEBUGMODE==69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)
gl_FragColor.rgb=subSurfaceOut.transmittance;
#elif DEBUGMODE==70 && defined(SUBSURFACE) && defined(SS_REFRACTION)
gl_FragColor.rgb=subSurfaceOut.refractionTransmittance;
#elif DEBUGMODE==80 && defined(RADIANCEOCCLUSION)
gl_FragColor.rgb=vec3(seo);
#elif DEBUGMODE==81 && defined(HORIZONOCCLUSION)
gl_FragColor.rgb=vec3(eho);
#elif DEBUGMODE==82 && defined(MS_BRDF_ENERGY_CONSERVATION)
gl_FragColor.rgb=vec3(energyConservationFactor);
#elif DEBUGMODE==83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
gl_FragColor.rgb=specularEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
gl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==85 && defined(SHEEN) && defined(REFLECTION)
gl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==86 && defined(ALPHABLEND)
gl_FragColor.rgb=vec3(luminanceOverAlpha);
#elif DEBUGMODE==87
gl_FragColor.rgb=vec3(alpha);
#endif
gl_FragColor.rgb*=vDebugMode.y;
#ifdef DEBUGMODE_NORMALIZE
gl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5;
#endif
#ifdef DEBUGMODE_GAMMA
gl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb);
#endif
gl_FragColor.a=1.0;
#ifdef PREPASS
gl_FragData[0]=toLinearSpace(gl_FragColor); 
gl_FragData[1]=vec4(0.,0.,0.,0.); 
#endif
return;
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrDebug */.v.IncludesShadersStore.pbrDebug = pbrDebug_shader;const pbrDebug = { name: "pbrDebug", shader: pbrDebug_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/pbr.fragment.js
const pbr_fragment_name = "pbrPixelShader",pbr_fragment_shader = `#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#extension GL_OES_standard_derivatives : enable
#endif
#ifdef LODBASEDMICROSFURACE
#extension GL_EXT_shader_texture_lod : enable
#endif
#define CUSTOM_FRAGMENT_BEGIN
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<prePassDeclaration>[SCENE_MRT_COUNT]
precision highp float;
#include<oitDeclaration>
#ifndef FROMLINEARSPACE
#define FROMLINEARSPACE
#endif
#include<__decl__pbrFragment>
#include<pbrFragmentExtraDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<pbrFragmentSamplersDeclaration>
#include<imageProcessingDeclaration>
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#include<helperFunctions>
#include<subSurfaceScatteringFunctions>
#include<importanceSampling>
#include<pbrHelperFunctions>
#include<imageProcessingFunctions>
#include<shadowsFragmentFunctions>
#include<harmonicsFunctions>
#include<pbrDirectLightingSetupFunctions>
#include<pbrDirectLightingFalloffFunctions>
#include<pbrBRDFFunctions>
#include<hdrFilteringFunctions>
#include<pbrDirectLightingFunctions>
#include<pbrIBLFunctions>
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#ifdef REFLECTION
#include<reflectionFunction>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
#include<pbrBlockAlbedoOpacity>
#include<pbrBlockReflectivity>
#include<pbrBlockAmbientOcclusion>
#include<pbrBlockAlphaFresnel>
#include<pbrBlockAnisotropic>
#include<pbrBlockReflection>
#include<pbrBlockSheen>
#include<pbrBlockClearcoat>
#include<pbrBlockIridescence>
#include<pbrBlockSubSurface>
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#include<pbrBlockNormalGeometric>
#include<bumpFragment>
#include<pbrBlockNormalFinal>
albedoOpacityOutParams albedoOpacityOut;
#ifdef ALBEDO
vec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);
#endif
#ifdef OPACITY
vec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);
#endif
albedoOpacityBlock(
vAlbedoColor,
#ifdef ALBEDO
albedoTexture,
vAlbedoInfos,
#endif
#ifdef OPACITY
opacityMap,
vOpacityInfos,
#endif
#ifdef DETAIL
detailColor,
vDetailInfos,
#endif
albedoOpacityOut
);
vec3 surfaceAlbedo=albedoOpacityOut.surfaceAlbedo;
float alpha=albedoOpacityOut.alpha;
#define CUSTOM_FRAGMENT_UPDATE_ALPHA
#include<depthPrePass>
#define CUSTOM_FRAGMENT_BEFORE_LIGHTS
ambientOcclusionOutParams aoOut;
#ifdef AMBIENT
vec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb;
#endif
ambientOcclusionBlock(
#ifdef AMBIENT
ambientOcclusionColorMap,
vAmbientInfos,
#endif
aoOut
);
#include<pbrBlockLightmapInit>
#ifdef UNLIT
vec3 diffuseBase=vec3(1.,1.,1.);
#else
vec3 baseColor=surfaceAlbedo;
reflectivityOutParams reflectivityOut;
#if defined(REFLECTIVITY)
vec4 surfaceMetallicOrReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);
vec4 baseReflectivity=surfaceMetallicOrReflectivityColorMap;
#ifndef METALLICWORKFLOW
#ifdef REFLECTIVITY_GAMMA
surfaceMetallicOrReflectivityColorMap=toLinearSpace(surfaceMetallicOrReflectivityColorMap);
#endif
surfaceMetallicOrReflectivityColorMap.rgb*=vReflectivityInfos.y;
#endif
#endif
#if defined(MICROSURFACEMAP)
vec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;
#endif
#ifdef METALLICWORKFLOW
vec4 metallicReflectanceFactors=vMetallicReflectanceFactors;
#ifdef REFLECTANCE
vec4 reflectanceFactorsMap=texture2D(reflectanceSampler,vReflectanceUV+uvOffset);
#ifdef REFLECTANCE_GAMMA
reflectanceFactorsMap=toLinearSpace(reflectanceFactorsMap);
#endif
metallicReflectanceFactors.rgb*=reflectanceFactorsMap.rgb;
#endif
#ifdef METALLIC_REFLECTANCE
vec4 metallicReflectanceFactorsMap=texture2D(metallicReflectanceSampler,vMetallicReflectanceUV+uvOffset);
#ifdef METALLIC_REFLECTANCE_GAMMA
metallicReflectanceFactorsMap=toLinearSpace(metallicReflectanceFactorsMap);
#endif
#ifndef METALLIC_REFLECTANCE_USE_ALPHA_ONLY
metallicReflectanceFactors.rgb*=metallicReflectanceFactorsMap.rgb;
#endif
metallicReflectanceFactors*=metallicReflectanceFactorsMap.a;
#endif
#endif
reflectivityBlock(
vReflectivityColor,
#ifdef METALLICWORKFLOW
surfaceAlbedo,
metallicReflectanceFactors,
#endif
#ifdef REFLECTIVITY
vReflectivityInfos,
surfaceMetallicOrReflectivityColorMap,
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
aoOut.ambientOcclusionColor,
#endif
#ifdef MICROSURFACEMAP
microSurfaceTexel,
#endif
#ifdef DETAIL
detailColor,
vDetailInfos,
#endif
reflectivityOut
);
float microSurface=reflectivityOut.microSurface;
float roughness=reflectivityOut.roughness;
#ifdef METALLICWORKFLOW
surfaceAlbedo=reflectivityOut.surfaceAlbedo;
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
aoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;
#endif
#ifdef ALPHAFRESNEL
#if defined(ALPHATEST) || defined(ALPHABLEND)
alphaFresnelOutParams alphaFresnelOut;
alphaFresnelBlock(
normalW,
viewDirectionW,
alpha,
microSurface,
alphaFresnelOut
);
alpha=alphaFresnelOut.alpha;
#endif
#endif
#include<pbrBlockGeometryInfo>
#ifdef ANISOTROPIC
anisotropicOutParams anisotropicOut;
#ifdef ANISOTROPIC_TEXTURE
vec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y;
#endif
anisotropicBlock(
vAnisotropy,
#ifdef ANISOTROPIC_TEXTURE
anisotropyMapData,
#endif
TBN,
normalW,
viewDirectionW,
anisotropicOut
);
#endif
#ifdef REFLECTION
reflectionOutParams reflectionOut;
#ifndef USE_CUSTOM_REFLECTION
reflectionBlock(
vPositionW,
normalW,
alphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#ifdef ANISOTROPIC
anisotropicOut,
#endif
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
roughness,
#endif
reflectionSampler,
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
vEnvironmentIrradiance,
#endif
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
reflectionMatrix,
#endif
#endif
#ifdef USEIRRADIANCEMAP
irradianceSampler,
#endif
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
reflectionOut
);
#else
#define CUSTOM_REFLECTION
#endif
#endif
#include<pbrBlockReflectance0>
#ifdef SHEEN
sheenOutParams sheenOut;
#ifdef SHEEN_TEXTURE
vec4 sheenMapData=texture2D(sheenSampler,vSheenUV+uvOffset);
#endif
#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
vec4 sheenMapRoughnessData=texture2D(sheenRoughnessSampler,vSheenRoughnessUV+uvOffset)*vSheenInfos.w;
#endif
sheenBlock(
vSheenColor,
#ifdef SHEEN_ROUGHNESS
vSheenRoughness,
#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
sheenMapRoughnessData,
#endif
#endif
roughness,
#ifdef SHEEN_TEXTURE
sheenMapData,
vSheenInfos.y,
#endif
reflectance,
#ifdef SHEEN_LINKWITHALBEDO
baseColor,
surfaceAlbedo,
#endif
#ifdef ENVIRONMENTBRDF
NdotV,
environmentBrdf,
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
AARoughnessFactors,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
vLightingIntensity,
reflectionSampler,
reflectionOut.reflectionCoords,
NdotVUnclamped,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
seo,
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
eho,
#endif
#endif
sheenOut
);
#ifdef SHEEN_LINKWITHALBEDO
surfaceAlbedo=sheenOut.surfaceAlbedo;
#endif
#endif
#ifdef CLEARCOAT
#ifdef CLEARCOAT_TEXTURE
vec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y;
#endif
#endif
#ifdef IRIDESCENCE
iridescenceOutParams iridescenceOut;
#ifdef IRIDESCENCE_TEXTURE
vec2 iridescenceMapData=texture2D(iridescenceSampler,vIridescenceUV+uvOffset).rg*vIridescenceInfos.y;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
vec2 iridescenceThicknessMapData=texture2D(iridescenceThicknessSampler,vIridescenceThicknessUV+uvOffset).rg*vIridescenceInfos.w;
#endif
iridescenceBlock(
vIridescenceParams,
NdotV,
specularEnvironmentR0,
#ifdef IRIDESCENCE_TEXTURE
iridescenceMapData,
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
iridescenceThicknessMapData,
#endif
#ifdef CLEARCOAT
NdotVUnclamped,
#ifdef CLEARCOAT_TEXTURE
clearCoatMapData,
#endif
#endif
iridescenceOut
);
float iridescenceIntensity=iridescenceOut.iridescenceIntensity;
specularEnvironmentR0=iridescenceOut.specularEnvironmentR0;
#endif
clearcoatOutParams clearcoatOut;
#ifdef CLEARCOAT
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
vec4 clearCoatMapRoughnessData=texture2D(clearCoatRoughnessSampler,vClearCoatRoughnessUV+uvOffset)*vClearCoatInfos.w;
#endif
#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
vec4 clearCoatTintMapData=texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset);
#endif
#ifdef CLEARCOAT_BUMP
vec4 clearCoatBumpMapData=texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset);
#endif
clearcoatBlock(
vPositionW,
geometricNormalW,
viewDirectionW,
vClearCoatParams,
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
clearCoatMapRoughnessData,
#endif
specularEnvironmentR0,
#ifdef CLEARCOAT_TEXTURE
clearCoatMapData,
#endif
#ifdef CLEARCOAT_TINT
vClearCoatTintParams,
clearCoatColorAtDistance,
vClearCoatRefractionParams,
#ifdef CLEARCOAT_TINT_TEXTURE
clearCoatTintMapData,
#endif
#endif
#ifdef CLEARCOAT_BUMP
vClearCoatBumpInfos,
clearCoatBumpMapData,
vClearCoatBumpUV,
#if defined(TANGENT) && defined(NORMAL)
vTBN,
#else
vClearCoatTangentSpaceParams,
#endif
#ifdef OBJECTSPACE_NORMALMAP
normalMatrix,
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
faceNormal,
#endif
#ifdef REFLECTION
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
vLightingIntensity,
reflectionSampler,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
#ifdef RADIANCEOCCLUSION
ambientMonochrome,
#endif
#endif
#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
(gl_FrontFacing ? 1. : -1.),
#endif
clearcoatOut
);
#else
clearcoatOut.specularEnvironmentR0=specularEnvironmentR0;
#endif
#include<pbrBlockReflectance>
subSurfaceOutParams subSurfaceOut;
#ifdef SUBSURFACE
#ifdef SS_THICKNESSANDMASK_TEXTURE
vec4 thicknessMap=texture2D(thicknessSampler,vThicknessUV+uvOffset);
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
vec4 refractionIntensityMap=texture2D(refractionIntensitySampler,vRefractionIntensityUV+uvOffset);
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
vec4 translucencyIntensityMap=texture2D(translucencyIntensitySampler,vTranslucencyIntensityUV+uvOffset);
#endif
subSurfaceBlock(
vSubSurfaceIntensity,
vThicknessParam,
vTintColor,
normalW,
specularEnvironmentReflectance,
#ifdef SS_THICKNESSANDMASK_TEXTURE
thicknessMap,
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
refractionIntensityMap,
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
translucencyIntensityMap,
#endif
#ifdef REFLECTION
#ifdef SS_TRANSLUCENCY
reflectionMatrix,
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
reflectionOut.irradianceVector,
#endif
#if defined(REALTIME_FILTERING)
reflectionSampler,
vReflectionFilteringInfo,
#endif
#endif
#ifdef USEIRRADIANCEMAP
irradianceSampler,
#endif
#endif
#endif
#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
surfaceAlbedo,
#endif
#ifdef SS_REFRACTION
vPositionW,
viewDirectionW,
view,
vRefractionInfos,
refractionMatrix,
vRefractionMicrosurfaceInfos,
vLightingIntensity,
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
alpha,
#endif
#ifdef SS_LODINREFRACTIONALPHA
NdotVUnclamped,
#endif
#ifdef SS_LINEARSPECULARREFRACTION
roughness,
#endif
alphaG,
refractionSampler,
#ifndef LODBASEDMICROSFURACE
refractionSamplerLow,
refractionSamplerHigh,
#endif
#ifdef ANISOTROPIC
anisotropicOut,
#endif
#ifdef REALTIME_FILTERING
vRefractionFilteringInfo,
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
vRefractionPosition,
vRefractionSize,
#endif
#endif
#ifdef SS_TRANSLUCENCY
vDiffusionDistance,
#endif
subSurfaceOut
);
#ifdef SS_REFRACTION
surfaceAlbedo=subSurfaceOut.surfaceAlbedo;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
alpha=subSurfaceOut.alpha;
#endif
#endif
#else
subSurfaceOut.specularEnvironmentReflectance=specularEnvironmentReflectance;
#endif
#include<pbrBlockDirectLighting>
#include<lightFragment>[0..maxSimultaneousLights]
#include<pbrBlockFinalLitComponents>
#endif 
#include<pbrBlockFinalUnlitComponents>
#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION
#include<pbrBlockFinalColorComposition>
#include<logDepthFragment>
#include<fogFragment>(color,finalColor)
#include<pbrBlockImageProcessing>
#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
#ifdef PREPASS
float writeGeometryInfo=finalColor.a>0.4 ? 1.0 : 0.0;
#ifdef PREPASS_POSITION
gl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);
#endif
#ifdef PREPASS_VELOCITY
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;
vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;
vec2 velocity=abs(a-b);
velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;
gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO_SQRT
vec3 sqAlbedo=sqrt(surfaceAlbedo); 
#endif
#ifdef PREPASS_IRRADIANCE
vec3 irradiance=finalDiffuse;
#ifndef UNLIT
#ifdef REFLECTION
irradiance+=finalIrradiance;
#endif
#endif
#ifdef SS_SCATTERING
gl_FragData[0]=vec4(finalColor.rgb-irradiance,finalColor.a); 
irradiance/=sqAlbedo;
#else
gl_FragData[0]=finalColor; 
float scatteringDiffusionProfile=255.;
#endif
gl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(clamp(irradiance,vec3(0.),vec3(1.)),writeGeometryInfo*scatteringDiffusionProfile/255.); 
#else
gl_FragData[0]=vec4(finalColor.rgb,finalColor.a);
#endif
#ifdef PREPASS_DEPTH
gl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_NORMAL
gl_FragData[PREPASS_NORMAL_INDEX]=vec4((view*vec4(normalW,0.0)).rgb,writeGeometryInfo); 
#endif
#ifdef PREPASS_ALBEDO_SQRT
gl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(sqAlbedo,writeGeometryInfo); 
#endif
#ifdef PREPASS_REFLECTIVITY
#ifndef UNLIT
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toGammaSpace(specularEnvironmentR0),microSurface)*writeGeometryInfo;
#else
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4( 0.0,0.0,0.0,1.0 )*writeGeometryInfo;
#endif
#endif
#endif
#if !defined(PREPASS) || defined(WEBGL2)
gl_FragColor=finalColor;
#endif
#include<oitFragment>
#if ORDER_INDEPENDENT_TRANSPARENCY
if (fragDepth==nearestDepth) {
frontColor.rgb+=finalColor.rgb*finalColor.a*alphaMultiplier;
frontColor.a=1.0-alphaMultiplier*(1.0-finalColor.a);
} else {
backColor+=finalColor;
}
#endif
#include<pbrDebug>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;shaderStore/* ShaderStore.ShadersStore.pbrPixelShader */.v.ShadersStore.pbrPixelShader = pbr_fragment_shader;const pbrPixelShader = { name: "pbrPixelShader", shader: pbr_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrVertexDeclaration.js
const pbrVertexDeclaration_name = "pbrVertexDeclaration",pbrVertexDeclaration_shader = `uniform mat4 view;
uniform mat4 viewProjection;
#ifdef ALBEDO
uniform mat4 albedoMatrix;
uniform vec2 vAlbedoInfos;
#endif
#ifdef AMBIENT
uniform mat4 ambientMatrix;
uniform vec4 vAmbientInfos;
#endif
#ifdef OPACITY
uniform mat4 opacityMatrix;
uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;
uniform mat4 emissiveMatrix;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;
uniform mat4 lightmapMatrix;
#endif
#ifdef REFLECTIVITY 
uniform vec3 vReflectivityInfos;
uniform mat4 reflectivityMatrix;
#endif
#ifdef METALLIC_REFLECTANCE
uniform vec2 vMetallicReflectanceInfos;
uniform mat4 metallicReflectanceMatrix;
#endif
#ifdef REFLECTANCE
uniform vec2 vReflectanceInfos;
uniform mat4 reflectanceMatrix;
#endif
#ifdef MICROSURFACEMAP
uniform vec2 vMicroSurfaceSamplerInfos;
uniform mat4 microSurfaceSamplerMatrix;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;
uniform mat4 bumpMatrix;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;
uniform mat4 reflectionMatrix;
#endif
#ifdef CLEARCOAT
#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)
uniform vec4 vClearCoatInfos;
#endif
#ifdef CLEARCOAT_TEXTURE
uniform mat4 clearCoatMatrix;
#endif
#ifdef CLEARCOAT_TEXTURE_ROUGHNESS
uniform mat4 clearCoatRoughnessMatrix;
#endif
#ifdef CLEARCOAT_BUMP
uniform vec2 vClearCoatBumpInfos;
uniform mat4 clearCoatBumpMatrix;
#endif
#ifdef CLEARCOAT_TINT_TEXTURE
uniform vec2 vClearCoatTintInfos;
uniform mat4 clearCoatTintMatrix;
#endif
#endif
#ifdef IRIDESCENCE
#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE)
uniform vec4 vIridescenceInfos;
#endif
#ifdef IRIDESCENCE_TEXTURE
uniform mat4 iridescenceMatrix;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
uniform mat4 iridescenceThicknessMatrix;
#endif
#endif
#ifdef ANISOTROPIC
#ifdef ANISOTROPIC_TEXTURE
uniform vec2 vAnisotropyInfos;
uniform mat4 anisotropyMatrix;
#endif
#endif
#ifdef SHEEN
#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)
uniform vec4 vSheenInfos;
#endif
#ifdef SHEEN_TEXTURE
uniform mat4 sheenMatrix;
#endif
#ifdef SHEEN_TEXTURE_ROUGHNESS
uniform mat4 sheenRoughnessMatrix;
#endif
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
uniform vec4 vRefractionInfos;
uniform mat4 refractionMatrix;
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
uniform vec2 vThicknessInfos;
uniform mat4 thicknessMatrix;
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
uniform vec2 vRefractionIntensityInfos;
uniform mat4 refractionIntensityMatrix;
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
uniform vec2 vTranslucencyIntensityInfos;
uniform mat4 translucencyIntensityMatrix;
#endif
#endif
#ifdef NORMAL
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
uniform vec3 vSphericalL00;
uniform vec3 vSphericalL1_1;
uniform vec3 vSphericalL10;
uniform vec3 vSphericalL11;
uniform vec3 vSphericalL2_2;
uniform vec3 vSphericalL2_1;
uniform vec3 vSphericalL20;
uniform vec3 vSphericalL21;
uniform vec3 vSphericalL22;
#else
uniform vec3 vSphericalX;
uniform vec3 vSphericalY;
uniform vec3 vSphericalZ;
uniform vec3 vSphericalXX_ZZ;
uniform vec3 vSphericalYY_ZZ;
uniform vec3 vSphericalZZ;
uniform vec3 vSphericalXY;
uniform vec3 vSphericalYZ;
uniform vec3 vSphericalZX;
#endif
#endif
#endif
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;
uniform mat4 detailMatrix;
#endif
#define ADDITIONAL_VERTEX_DECLARATION
`;shaderStore/* ShaderStore.IncludesShadersStore.pbrVertexDeclaration */.v.IncludesShadersStore.pbrVertexDeclaration = pbrVertexDeclaration_shader;const pbrVertexDeclaration = { name: "pbrVertexDeclaration", shader: pbrVertexDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.js
var uvAttributeDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.js
var prePassVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.js
var samplerVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.js
var bumpVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js
var lightVxFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js
var lightVxUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.js
var prePassVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.js
var uvVariableDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.js
var samplerVertexImplementation = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js
var bumpVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js
var shadowsVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js
var vertexColorMixing = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/pbr.vertex.js
const pbr_vertex_name = "pbrVertexShader",pbr_vertex_shader = `precision highp float;
#include<__decl__pbrVertex>
#define CUSTOM_VERTEX_BEGIN
attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef TANGENT
attribute vec4 tangent;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#include<uvAttributeDeclaration>[2..7]
#include<mainUVVaryingDeclaration>[1..7]
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<helperFunctions>
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
#include<prePassVertexDeclaration>
#include<samplerVertexDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo)
#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity)
#include<samplerVertexDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler)
#include<samplerVertexDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance)
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance)
#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
#ifdef CLEARCOAT
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint)
#endif
#ifdef IRIDESCENCE
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence)
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness)
#endif
#ifdef SHEEN
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen)
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
#endif
#ifdef ANISOTROPIC
#include<samplerVertexDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy)
#endif
#ifdef SUBSURFACE
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity)
#endif
varying vec3 vPositionW;
#if DEBUGMODE>0
varying vec4 vClipSpacePosition;
#endif
#ifdef NORMAL
varying vec3 vNormalW;
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
varying vec3 vEnvironmentIrradiance;
#include<harmonicsFunctions>
#endif
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<bumpVertexDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 positionUpdated=position;
#ifdef NORMAL
vec3 normalUpdated=normal;
#endif
#ifdef TANGENT
vec4 tangentUpdated=tangent;
#endif
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
vPositionUVW=positionUpdated;
#endif
#define CUSTOM_VERTEX_UPDATE_POSITION
#define CUSTOM_VERTEX_UPDATE_NORMAL
#include<instancesVertex>
#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
vPositionW=vec3(worldPos);
#include<prePassVertex>
#ifdef NORMAL
mat3 normalWorld=mat3(finalWorld);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));
vNormalW=normalize(normalWorld*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vNormalW=normalize(normalWorld*normalUpdated);
#endif
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
vec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz;
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);
#endif
#endif
#define CUSTOM_VERTEX_UPDATE_WORLDPOS
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {
gl_Position=viewProjection*worldPos;
} else {
gl_Position=viewProjectionR*worldPos;
}
#else
gl_Position=viewProjection*worldPos;
#endif
#if DEBUGMODE>0
vClipSpacePosition=gl_Position;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));
#endif
#ifndef UV1
vec2 uvUpdated=vec2(0.,0.);
#endif
#ifdef MAINUV1
vMainUV1=uvUpdated;
#endif
#include<uvVariableDeclaration>[2..7]
#include<samplerVertexImplementation>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_MATRIXNAME_,albedo,_INFONAME_,AlbedoInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_MATRIXNAME_,reflectivity,_INFONAME_,ReflectivityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_MATRIXNAME_,microSurfaceSampler,_INFONAME_,MicroSurfaceSamplerInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_MATRIXNAME_,metallicReflectance,_INFONAME_,MetallicReflectanceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_MATRIXNAME_,reflectance,_INFONAME_,ReflectanceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
#ifdef CLEARCOAT
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_MATRIXNAME_,clearCoat,_INFONAME_,ClearCoatInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness,_MATRIXNAME_,clearCoatRoughness,_INFONAME_,ClearCoatInfos.z)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_MATRIXNAME_,clearCoatBump,_INFONAME_,ClearCoatBumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_MATRIXNAME_,clearCoatTint,_INFONAME_,ClearCoatTintInfos.x)
#endif
#ifdef IRIDESCENCE
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_MATRIXNAME_,iridescence,_INFONAME_,IridescenceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_MATRIXNAME_,iridescenceThickness,_INFONAME_,IridescenceInfos.z)
#endif
#ifdef SHEEN
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.z)
#endif
#ifdef ANISOTROPIC
#include<samplerVertexImplementation>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_MATRIXNAME_,anisotropy,_INFONAME_,AnisotropyInfos.x)
#endif
#ifdef SUBSURFACE
#include<samplerVertexImplementation>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_MATRIXNAME_,thickness,_INFONAME_,ThicknessInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_MATRIXNAME_,refractionIntensity,_INFONAME_,RefractionIntensityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_MATRIXNAME_,translucencyIntensity,_INFONAME_,TranslucencyIntensityInfos.x)
#endif
#include<bumpVertex>
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.pbrVertexShader */.v.ShadersStore.pbrVertexShader = pbr_vertex_shader;const pbrVertexShader = { name: "pbrVertexShader", shader: pbr_vertex_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effectFallbacks.js
var effectFallbacks = __webpack_require__("./node_modules/@babylonjs/core/Materials/effectFallbacks.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrClearCoatConfiguration.js
var pbrClearCoatConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrClearCoatConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrIridescenceConfiguration.js
var pbrIridescenceConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrIridescenceConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrAnisotropicConfiguration.js
var pbrAnisotropicConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrAnisotropicConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrSheenConfiguration.js
var pbrSheenConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrSheenConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrSubSurfaceConfiguration.js
var pbrSubSurfaceConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrSubSurfaceConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.js
var material_detailMapConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js
var clipPlaneMaterialHelper = __webpack_require__("./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrBaseMaterial.js
const onCreatedEffectParameters = { effect: null, subMesh: null };class PBRMaterialDefines extends materialDefines/* MaterialDefines */.H {constructor(externalProperties) {super(externalProperties), this.PBR = !0, this.NUM_SAMPLES = "0", this.REALTIME_FILTERING = !1, this.MAINUV1 = !1, this.MAINUV2 = !1, this.MAINUV3 = !1, this.MAINUV4 = !1, this.MAINUV5 = !1, this.MAINUV6 = !1, this.UV1 = !1, this.UV2 = !1, this.UV3 = !1, this.UV4 = !1, this.UV5 = !1, this.UV6 = !1, this.ALBEDO = !1, this.GAMMAALBEDO = !1, this.ALBEDODIRECTUV = 0, this.VERTEXCOLOR = !1, this.BAKED_VERTEX_ANIMATION_TEXTURE = !1, this.AMBIENT = !1, this.AMBIENTDIRECTUV = 0, this.AMBIENTINGRAYSCALE = !1, this.OPACITY = !1, this.VERTEXALPHA = !1, this.OPACITYDIRECTUV = 0, this.OPACITYRGB = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.ALPHABLEND = !1, this.ALPHAFROMALBEDO = !1, this.ALPHATESTVALUE = "0.5", this.SPECULAROVERALPHA = !1, this.RADIANCEOVERALPHA = !1, this.ALPHAFRESNEL = !1, this.LINEARALPHAFRESNEL = !1, this.PREMULTIPLYALPHA = !1, this.EMISSIVE = !1, this.EMISSIVEDIRECTUV = 0, this.GAMMAEMISSIVE = !1, this.REFLECTIVITY = !1, this.REFLECTIVITY_GAMMA = !1, this.REFLECTIVITYDIRECTUV = 0, this.SPECULARTERM = !1, this.MICROSURFACEFROMREFLECTIVITYMAP = !1, this.MICROSURFACEAUTOMATIC = !1, this.LODBASEDMICROSFURACE = !1, this.MICROSURFACEMAP = !1, this.MICROSURFACEMAPDIRECTUV = 0, this.METALLICWORKFLOW = !1, this.ROUGHNESSSTOREINMETALMAPALPHA = !1, this.ROUGHNESSSTOREINMETALMAPGREEN = !1, this.METALLNESSSTOREINMETALMAPBLUE = !1, this.AOSTOREINMETALMAPRED = !1, this.METALLIC_REFLECTANCE = !1, this.METALLIC_REFLECTANCE_GAMMA = !1, this.METALLIC_REFLECTANCEDIRECTUV = 0, this.METALLIC_REFLECTANCE_USE_ALPHA_ONLY = !1, this.REFLECTANCE = !1, this.REFLECTANCE_GAMMA = !1, this.REFLECTANCEDIRECTUV = 0, this.ENVIRONMENTBRDF = !1, this.ENVIRONMENTBRDF_RGBD = !1, this.NORMAL = !1, this.TANGENT = !1, this.BUMP = !1, this.BUMPDIRECTUV = 0, this.OBJECTSPACE_NORMALMAP = !1, this.PARALLAX = !1, this.PARALLAXOCCLUSION = !1, this.NORMALXYSCALE = !0, this.LIGHTMAP = !1, this.LIGHTMAPDIRECTUV = 0, this.USELIGHTMAPASSHADOWMAP = !1, this.GAMMALIGHTMAP = !1, this.RGBDLIGHTMAP = !1, this.REFLECTION = !1, this.REFLECTIONMAP_3D = !1, this.REFLECTIONMAP_SPHERICAL = !1, this.REFLECTIONMAP_PLANAR = !1, this.REFLECTIONMAP_CUBIC = !1, this.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, this.REFLECTIONMAP_PROJECTION = !1, this.REFLECTIONMAP_SKYBOX = !1, this.REFLECTIONMAP_EXPLICIT = !1, this.REFLECTIONMAP_EQUIRECTANGULAR = !1, this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, this.INVERTCUBICMAP = !1, this.USESPHERICALFROMREFLECTIONMAP = !1, this.USEIRRADIANCEMAP = !1, this.USESPHERICALINVERTEX = !1, this.REFLECTIONMAP_OPPOSITEZ = !1, this.LODINREFLECTIONALPHA = !1, this.GAMMAREFLECTION = !1, this.RGBDREFLECTION = !1, this.LINEARSPECULARREFLECTION = !1, this.RADIANCEOCCLUSION = !1, this.HORIZONOCCLUSION = !1, this.INSTANCES = !1, this.THIN_INSTANCES = !1, this.INSTANCESCOLOR = !1, this.PREPASS = !1, this.PREPASS_IRRADIANCE = !1, this.PREPASS_IRRADIANCE_INDEX = -1, this.PREPASS_ALBEDO_SQRT = !1, this.PREPASS_ALBEDO_SQRT_INDEX = -1, this.PREPASS_DEPTH = !1, this.PREPASS_DEPTH_INDEX = -1, this.PREPASS_NORMAL = !1, this.PREPASS_NORMAL_INDEX = -1, this.PREPASS_POSITION = !1, this.PREPASS_POSITION_INDEX = -1, this.PREPASS_VELOCITY = !1, this.PREPASS_VELOCITY_INDEX = -1, this.PREPASS_REFLECTIVITY = !1, this.PREPASS_REFLECTIVITY_INDEX = -1, this.SCENE_MRT_COUNT = 0, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.BONETEXTURE = !1, this.BONES_VELOCITY_ENABLED = !1, this.NONUNIFORMSCALING = !1, this.MORPHTARGETS = !1, this.MORPHTARGETS_NORMAL = !1, this.MORPHTARGETS_TANGENT = !1, this.MORPHTARGETS_UV = !1, this.NUM_MORPH_INFLUENCERS = 0, this.MORPHTARGETS_TEXTURE = !1, this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.EXPOSURE = !1, this.MULTIVIEW = !1, this.ORDER_INDEPENDENT_TRANSPARENCY = !1, this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = !1, this.USEPHYSICALLIGHTFALLOFF = !1, this.USEGLTFLIGHTFALLOFF = !1, this.TWOSIDEDLIGHTING = !1, this.SHADOWFLOAT = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.POINTSIZE = !1, this.FOG = !1, this.LOGARITHMICDEPTH = !1, this.CAMERA_ORTHOGRAPHIC = !1, this.CAMERA_PERSPECTIVE = !1, this.FORCENORMALFORWARD = !1, this.SPECULARAA = !1, this.UNLIT = !1, this.DEBUGMODE = 0, this.rebuild();}reset() {super.reset(), this.ALPHATESTVALUE = "0.5", this.PBR = !0, this.NORMALXYSCALE = !0;}}class PBRBaseMaterial extends pushMaterial/* PushMaterial */.a {get realTimeFiltering() {return this._realTimeFiltering;}set realTimeFiltering(b) {this._realTimeFiltering = b, this.markAsDirty(1);}get realTimeFilteringQuality() {return this._realTimeFilteringQuality;}set realTimeFilteringQuality(n) {this._realTimeFilteringQuality = n, this.markAsDirty(1);}get canRenderToMRT() {return !0;}_attachImageProcessingConfiguration(configuration) {configuration === this._imageProcessingConfiguration || (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = configuration ? configuration : this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {this._markAllSubMeshesAsImageProcessingDirty();})));}constructor(name, scene) {super(name, scene), this._directIntensity = 1, this._emissiveIntensity = 1, this._environmentIntensity = 1, this._specularIntensity = 1, this._lightingInfos = new math_vector/* Vector4 */.Lt(this._directIntensity, this._emissiveIntensity, this._environmentIntensity, this._specularIntensity), this._disableBumpMap = !1, this._albedoTexture = null, this._ambientTexture = null, this._ambientTextureStrength = 1, this._ambientTextureImpactOnAnalyticalLights = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, this._opacityTexture = null, this._reflectionTexture = null, this._emissiveTexture = null, this._reflectivityTexture = null, this._metallicTexture = null, this._metallic = null, this._roughness = null, this._metallicF0Factor = 1, this._metallicReflectanceColor = math_color/* Color3.White */.Wo.White(), this._useOnlyMetallicFromMetallicReflectanceTexture = !1, this._metallicReflectanceTexture = null, this._reflectanceTexture = null, this._microSurfaceTexture = null, this._bumpTexture = null, this._lightmapTexture = null, this._ambientColor = new math_color/* Color3 */.Wo(0, 0, 0), this._albedoColor = new math_color/* Color3 */.Wo(1, 1, 1), this._reflectivityColor = new math_color/* Color3 */.Wo(1, 1, 1), this._reflectionColor = new math_color/* Color3 */.Wo(1, 1, 1), this._emissiveColor = new math_color/* Color3 */.Wo(0, 0, 0), this._microSurface = .9, this._useLightmapAsShadowmap = !1, this._useHorizonOcclusion = !0, this._useRadianceOcclusion = !0, this._useAlphaFromAlbedoTexture = !1, this._useSpecularOverAlpha = !0, this._useMicroSurfaceFromReflectivityMapAlpha = !1, this._useRoughnessFromMetallicTextureAlpha = !0, this._useRoughnessFromMetallicTextureGreen = !1, this._useMetallnessFromMetallicTextureBlue = !1, this._useAmbientOcclusionFromMetallicTextureRed = !1, this._useAmbientInGrayScale = !1, this._useAutoMicroSurfaceFromReflectivityMap = !1, this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL, this._useRadianceOverAlpha = !0, this._useObjectSpaceNormalMap = !1, this._useParallax = !1, this._useParallaxOcclusion = !1, this._parallaxScaleBias = .05, this._disableLighting = !1, this._maxSimultaneousLights = 4, this._invertNormalMapX = !1, this._invertNormalMapY = !1, this._twoSidedLighting = !1, this._alphaCutOff = .4, this._forceAlphaTest = !1, this._useAlphaFresnel = !1, this._useLinearAlphaFresnel = !1, this._environmentBRDFTexture = null, this._forceIrradianceInFragment = !1, this._realTimeFiltering = !1, this._realTimeFilteringQuality = 8, this._forceNormalForward = !1, this._enableSpecularAntiAliasing = !1, this._imageProcessingObserver = null, this._renderTargets = new smartArray/* SmartArray */.t(16), this._globalAmbientColor = new math_color/* Color3 */.Wo(0, 0, 0), this._useLogarithmicDepth = !1, this._unlit = !1, this._debugMode = 0, this.debugMode = 0, this._debugLimit = -1, this._debugFactor = 1, this._cacheHasRenderTargetTextures = !1, this.brdf = new pbrBRDFConfiguration/* PBRBRDFConfiguration */.d(this), this.clearCoat = new pbrClearCoatConfiguration/* PBRClearCoatConfiguration */.Y(this), this.iridescence = new pbrIridescenceConfiguration/* PBRIridescenceConfiguration */.B(this), this.anisotropy = new pbrAnisotropicConfiguration/* PBRAnisotropicConfiguration */.u(this), this.sheen = new pbrSheenConfiguration/* PBRSheenConfiguration */.B(this), this.subSurface = new pbrSubSurfaceConfiguration/* PBRSubSurfaceConfiguration */.u(this), this.detailMap = new material_detailMapConfiguration/* DetailMapConfiguration */.p(this), this._attachImageProcessingConfiguration(null), this.getRenderTargetTextures = () => (this._renderTargets.reset(), materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._renderTargets.push(this._reflectionTexture), this._eventInfo.renderTargets = this._renderTargets, this._callbackPluginEventFillRenderTargetTextures(this._eventInfo), this._renderTargets), this._environmentBRDFTexture = (0,brdfTextureTools/* GetEnvironmentBRDFTexture */.$)(this.getScene()), this.prePassConfiguration = new prePassConfiguration/* PrePassConfiguration */.o();}get hasRenderTargetTextures() {return !!(materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) || this._cacheHasRenderTargetTextures;}get isPrePassCapable() {return !this.disableDepthWrite;}getClassName() {return "PBRBaseMaterial";}get useLogarithmicDepth() {return this._useLogarithmicDepth;}set useLogarithmicDepth(value) {this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported;}get _disableAlphaBlending() {var _a;return this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_OPAQUE || this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_ALPHATEST || (null === (_a = this.subSurface) || void 0 === _a ? void 0 : _a.disableAlphaBlending);}needAlphaBlending() {return !this._disableAlphaBlending && (1 > this.alpha || null != this._opacityTexture || this._shouldUseAlphaFromAlbedoTexture());}needAlphaTesting() {var _a;return !!this._forceAlphaTest || (!(null !== (_a = this.subSurface) && void 0 !== _a) || !_a.disableAlphaBlending) && this._hasAlphaChannel() && (null == this._transparencyMode || this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_ALPHATEST);}_shouldUseAlphaFromAlbedoTexture() {return null != this._albedoTexture && this._albedoTexture.hasAlpha && this._useAlphaFromAlbedoTexture && this._transparencyMode !== PBRBaseMaterial.PBRMATERIAL_OPAQUE;}_hasAlphaChannel() {return null != this._albedoTexture && this._albedoTexture.hasAlpha || null != this._opacityTexture;}getAlphaTestTexture() {return this._albedoTexture;}isReadyForSubMesh(mesh, subMesh, useInstances) {if (this._uniformBufferLayoutBuilt || this.buildUniformLayout(), subMesh.effect && this.isFrozen && subMesh.effect._wasPreviouslyReady && subMesh.effect._wasPreviouslyUsingInstances === useInstances) return !0;subMesh.materialDefines || (this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.GetDefineNames */.S.GetDefineNames, this._eventInfo), subMesh.materialDefines = new PBRMaterialDefines(this._eventInfo.defineNames));const defines = subMesh.materialDefines;if (this._isReadyForSubMesh(subMesh)) return !0;const scene = this.getScene(),engine = scene.getEngine();if (defines._areTexturesDirty && (this._eventInfo.hasRenderTargetTextures = !1, this._callbackPluginEventHasRenderTargetTextures(this._eventInfo), this._cacheHasRenderTargetTextures = this._eventInfo.hasRenderTargetTextures, scene.texturesEnabled)) {if (this._albedoTexture && materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled && !this._albedoTexture.isReadyOrNotBlocking()) return !1;if (this._ambientTexture && materialFlags/* MaterialFlags.AmbientTextureEnabled */.k.AmbientTextureEnabled && !this._ambientTexture.isReadyOrNotBlocking()) return !1;if (this._opacityTexture && materialFlags/* MaterialFlags.OpacityTextureEnabled */.k.OpacityTextureEnabled && !this._opacityTexture.isReadyOrNotBlocking()) return !1;const reflectionTexture = this._getReflectionTexture();if (reflectionTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled) {if (!reflectionTexture.isReadyOrNotBlocking()) return !1;if (reflectionTexture.irradianceTexture && !reflectionTexture.irradianceTexture.isReadyOrNotBlocking()) return !1;}if (this._lightmapTexture && materialFlags/* MaterialFlags.LightmapTextureEnabled */.k.LightmapTextureEnabled && !this._lightmapTexture.isReadyOrNotBlocking()) return !1;if (this._emissiveTexture && materialFlags/* MaterialFlags.EmissiveTextureEnabled */.k.EmissiveTextureEnabled && !this._emissiveTexture.isReadyOrNotBlocking()) return !1;if (materialFlags/* MaterialFlags.SpecularTextureEnabled */.k.SpecularTextureEnabled) {if (this._metallicTexture) {if (!this._metallicTexture.isReadyOrNotBlocking()) return !1;} else if (this._reflectivityTexture && !this._reflectivityTexture.isReadyOrNotBlocking()) return !1;if (this._metallicReflectanceTexture && !this._metallicReflectanceTexture.isReadyOrNotBlocking()) return !1;if (this._reflectanceTexture && !this._reflectanceTexture.isReadyOrNotBlocking()) return !1;if (this._microSurfaceTexture && !this._microSurfaceTexture.isReadyOrNotBlocking()) return !1;}if (engine.getCaps().standardDerivatives && this._bumpTexture && materialFlags/* MaterialFlags.BumpTextureEnabled */.k.BumpTextureEnabled && !this._disableBumpMap && !this._bumpTexture.isReady()) return !1;if (this._environmentBRDFTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled && !this._environmentBRDFTexture.isReady()) return !1;}if (this._eventInfo.isReadyForSubMesh = !0, this._eventInfo.defines = defines, this._callbackPluginEventIsReadyForSubMesh(this._eventInfo), !this._eventInfo.isReadyForSubMesh) return !1;if (defines._areImageProcessingDirty && this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady()) return !1;engine.getCaps().standardDerivatives || mesh.isVerticesDataPresent(buffer/* VertexBuffer.NormalKind */.o.NormalKind) || (mesh.createNormals(!0), logger/* Logger.Warn */.Y.Warn("PBRMaterial: Normals have been created for the mesh: " + mesh.name));const previousEffect = subMesh.effect,lightDisposed = defines._areLightsDisposed;let effect = this._prepareEffect(mesh, defines, this.onCompiled, this.onError, useInstances, null, subMesh.getRenderingMesh().hasThinInstances),forceWasNotReadyPreviously = !1;if (effect) if (this._onEffectCreatedObservable && (onCreatedEffectParameters.effect = effect, onCreatedEffectParameters.subMesh = subMesh, this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters)), !(this.allowShaderHotSwapping && previousEffect && !effect.isReady())) scene.resetCachedMaterial(), subMesh.setEffect(effect, defines, this._materialContext);else if (effect = previousEffect, defines.markAsUnprocessed(), forceWasNotReadyPreviously = this.isFrozen, lightDisposed) return defines._areLightsDisposed = !0, !1;return !!(subMesh.effect && subMesh.effect.isReady()) && (defines._renderId = scene.getRenderId(), subMesh.effect._wasPreviouslyReady = !forceWasNotReadyPreviously, subMesh.effect._wasPreviouslyUsingInstances = !!useInstances, scene.performancePriority !== core_scene/* ScenePerformancePriority.BackwardCompatible */.a.BackwardCompatible && (this.checkReadyOnlyOnce = !0), !0);}isMetallicWorkflow() {return !!(null != this._metallic || null != this._roughness || this._metallicTexture);}_prepareEffect(mesh, defines, onCompiled = null, onError = null, useInstances = null, useClipPlane = null, useThinInstances) {if (this._prepareDefines(mesh, defines, useInstances, useClipPlane, useThinInstances), !defines.isDirty) return null;defines.markAsProcessed();const scene = this.getScene(),engine = scene.getEngine(),fallbacks = new effectFallbacks/* EffectFallbacks */.L();let fallbackRank = 0;defines.USESPHERICALINVERTEX && fallbacks.addFallback(fallbackRank++, "USESPHERICALINVERTEX"), defines.FOG && fallbacks.addFallback(fallbackRank, "FOG"), defines.SPECULARAA && fallbacks.addFallback(fallbackRank, "SPECULARAA"), defines.POINTSIZE && fallbacks.addFallback(fallbackRank, "POINTSIZE"), defines.LOGARITHMICDEPTH && fallbacks.addFallback(fallbackRank, "LOGARITHMICDEPTH"), defines.PARALLAX && fallbacks.addFallback(fallbackRank, "PARALLAX"), defines.PARALLAXOCCLUSION && fallbacks.addFallback(fallbackRank++, "PARALLAXOCCLUSION"), defines.ENVIRONMENTBRDF && fallbacks.addFallback(fallbackRank++, "ENVIRONMENTBRDF"), defines.TANGENT && fallbacks.addFallback(fallbackRank++, "TANGENT"), defines.BUMP && fallbacks.addFallback(fallbackRank++, "BUMP"), fallbackRank = materialHelper/* MaterialHelper.HandleFallbacksForShadows */.G.HandleFallbacksForShadows(defines, fallbacks, this._maxSimultaneousLights, fallbackRank++), defines.SPECULARTERM && fallbacks.addFallback(fallbackRank++, "SPECULARTERM"), defines.USESPHERICALFROMREFLECTIONMAP && fallbacks.addFallback(fallbackRank++, "USESPHERICALFROMREFLECTIONMAP"), defines.USEIRRADIANCEMAP && fallbacks.addFallback(fallbackRank++, "USEIRRADIANCEMAP"), defines.LIGHTMAP && fallbacks.addFallback(fallbackRank++, "LIGHTMAP"), defines.NORMAL && fallbacks.addFallback(fallbackRank++, "NORMAL"), defines.AMBIENT && fallbacks.addFallback(fallbackRank++, "AMBIENT"), defines.EMISSIVE && fallbacks.addFallback(fallbackRank++, "EMISSIVE"), defines.VERTEXCOLOR && fallbacks.addFallback(fallbackRank++, "VERTEXCOLOR"), defines.MORPHTARGETS && fallbacks.addFallback(fallbackRank++, "MORPHTARGETS"), defines.MULTIVIEW && fallbacks.addFallback(0, "MULTIVIEW");const attribs = [buffer/* VertexBuffer.PositionKind */.o.PositionKind];defines.NORMAL && attribs.push(buffer/* VertexBuffer.NormalKind */.o.NormalKind), defines.TANGENT && attribs.push(buffer/* VertexBuffer.TangentKind */.o.TangentKind);for (let i = 1; 6 >= i; ++i) defines["UV" + i] && attribs.push(`uv${1 === i ? "" : i}`);defines.VERTEXCOLOR && attribs.push(buffer/* VertexBuffer.ColorKind */.o.ColorKind), defines.INSTANCESCOLOR && attribs.push(buffer/* VertexBuffer.ColorInstanceKind */.o.ColorInstanceKind), materialHelper/* MaterialHelper.PrepareAttributesForBones */.G.PrepareAttributesForBones(attribs, mesh, defines, fallbacks), materialHelper/* MaterialHelper.PrepareAttributesForInstances */.G.PrepareAttributesForInstances(attribs, defines), materialHelper/* MaterialHelper.PrepareAttributesForMorphTargets */.G.PrepareAttributesForMorphTargets(attribs, mesh, defines), materialHelper/* MaterialHelper.PrepareAttributesForBakedVertexAnimation */.G.PrepareAttributesForBakedVertexAnimation(attribs, mesh, defines);let shaderName = "pbr";const uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vAlbedoColor", "vReflectivityColor", "vMetallicReflectanceFactors", "vEmissiveColor", "visibility", "vReflectionColor", "vFogInfos", "vFogColor", "pointSize", "vAlbedoInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vReflectionPosition", "vReflectionSize", "vEmissiveInfos", "vReflectivityInfos", "vReflectionFilteringInfo", "vMetallicReflectanceInfos", "vReflectanceInfos", "vMicroSurfaceSamplerInfos", "vBumpInfos", "vLightmapInfos", "mBones", "albedoMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "reflectivityMatrix", "normalMatrix", "microSurfaceSamplerMatrix", "bumpMatrix", "lightmapMatrix", "metallicReflectanceMatrix", "reflectanceMatrix", "vLightingIntensity", "logarithmicDepthConstant", "vSphericalX", "vSphericalY", "vSphericalZ", "vSphericalXX_ZZ", "vSphericalYY_ZZ", "vSphericalZZ", "vSphericalXY", "vSphericalYZ", "vSphericalZX", "vSphericalL00", "vSphericalL1_1", "vSphericalL10", "vSphericalL11", "vSphericalL2_2", "vSphericalL2_1", "vSphericalL20", "vSphericalL21", "vSphericalL22", "vReflectionMicrosurfaceInfos", "vTangentSpaceParams", "boneTextureWidth", "vDebugMode", "morphTargetTextureInfo", "morphTargetTextureIndices"],samplers = ["albedoSampler", "reflectivitySampler", "ambientSampler", "emissiveSampler", "bumpSampler", "lightmapSampler", "opacitySampler", "reflectionSampler", "reflectionSamplerLow", "reflectionSamplerHigh", "irradianceSampler", "microSurfaceSampler", "environmentBrdfSampler", "boneSampler", "metallicReflectanceSampler", "reflectanceSampler", "morphTargets", "oitDepthSampler", "oitFrontColorSampler"],uniformBuffers = ["Material", "Scene", "Mesh"];this._eventInfo.fallbacks = fallbacks, this._eventInfo.fallbackRank = fallbackRank, this._eventInfo.defines = defines, this._eventInfo.uniforms = uniforms, this._eventInfo.attributes = attribs, this._eventInfo.samplers = samplers, this._eventInfo.uniformBuffersNames = uniformBuffers, this._eventInfo.customCode = void 0, this._eventInfo.mesh = mesh, this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.PrepareEffect */.S.PrepareEffect, this._eventInfo), prePassConfiguration/* PrePassConfiguration.AddUniforms */.o.AddUniforms(uniforms), prePassConfiguration/* PrePassConfiguration.AddSamplers */.o.AddSamplers(samplers), (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(uniforms), imageProcessingConfiguration/* ImageProcessingConfiguration */.$ && (imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareUniforms */.$.PrepareUniforms(uniforms, defines), imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareSamplers */.$.PrepareSamplers(samplers, defines)), materialHelper/* MaterialHelper.PrepareUniformsAndSamplersList */.G.PrepareUniformsAndSamplersList({ uniformsNames: uniforms, uniformBuffersNames: uniformBuffers, samplers: samplers, defines: defines, maxSimultaneousLights: this._maxSimultaneousLights });const csnrOptions = {};this.customShaderNameResolve && (shaderName = this.customShaderNameResolve(shaderName, uniforms, uniformBuffers, samplers, defines, attribs, csnrOptions));const join = defines.toString(),effect = engine.createEffect(shaderName, { attributes: attribs, uniformsNames: uniforms, uniformBuffersNames: uniformBuffers, samplers: samplers, defines: join, fallbacks: fallbacks, onCompiled: onCompiled, onError: onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS }, processFinalCode: csnrOptions.processFinalCode, processCodeAfterIncludes: this._eventInfo.customCode, multiTarget: defines.PREPASS }, engine);return this._eventInfo.customCode = void 0, effect;}_prepareDefines(mesh, defines, useInstances = null, useClipPlane = null, useThinInstances = !1) {var _a;const scene = this.getScene(),engine = scene.getEngine();materialHelper/* MaterialHelper.PrepareDefinesForLights */.G.PrepareDefinesForLights(scene, mesh, defines, !0, this._maxSimultaneousLights, this._disableLighting), defines._needNormals = !0, materialHelper/* MaterialHelper.PrepareDefinesForMultiview */.G.PrepareDefinesForMultiview(scene, defines);const oit = this.needAlphaBlendingForMesh(mesh) && this.getScene().useOrderIndependentTransparency;if (materialHelper/* MaterialHelper.PrepareDefinesForPrePass */.G.PrepareDefinesForPrePass(scene, defines, this.canRenderToMRT && !oit), materialHelper/* MaterialHelper.PrepareDefinesForOIT */.G.PrepareDefinesForOIT(scene, defines, oit), defines.METALLICWORKFLOW = this.isMetallicWorkflow(), defines._areTexturesDirty) {if (defines._needUVs = !1, scene.texturesEnabled) {defines.ALBEDODIRECTUV = 0, defines.AMBIENTDIRECTUV = 0, defines.OPACITYDIRECTUV = 0, defines.EMISSIVEDIRECTUV = 0, defines.REFLECTIVITYDIRECTUV = 0, defines.MICROSURFACEMAPDIRECTUV = 0, defines.METALLIC_REFLECTANCEDIRECTUV = 0, defines.REFLECTANCEDIRECTUV = 0, defines.BUMPDIRECTUV = 0, defines.LIGHTMAPDIRECTUV = 0, engine.getCaps().textureLOD && (defines.LODBASEDMICROSFURACE = !0), this._albedoTexture && materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._albedoTexture, defines, "ALBEDO"), defines.GAMMAALBEDO = this._albedoTexture.gammaSpace) : defines.ALBEDO = !1, this._ambientTexture && materialFlags/* MaterialFlags.AmbientTextureEnabled */.k.AmbientTextureEnabled ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._ambientTexture, defines, "AMBIENT"), defines.AMBIENTINGRAYSCALE = this._useAmbientInGrayScale) : defines.AMBIENT = !1, this._opacityTexture && materialFlags/* MaterialFlags.OpacityTextureEnabled */.k.OpacityTextureEnabled ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._opacityTexture, defines, "OPACITY"), defines.OPACITYRGB = this._opacityTexture.getAlphaFromRGB) : defines.OPACITY = !1;const reflectionTexture = this._getReflectionTexture();if (reflectionTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled) {switch (defines.REFLECTION = !0, defines.GAMMAREFLECTION = reflectionTexture.gammaSpace, defines.RGBDREFLECTION = reflectionTexture.isRGBD, defines.LODINREFLECTIONALPHA = reflectionTexture.lodLevelInAlpha, defines.LINEARSPECULARREFLECTION = reflectionTexture.linearSpecularLOD, this.realTimeFiltering && 0 < this.realTimeFilteringQuality ? (defines.NUM_SAMPLES = "" + this.realTimeFilteringQuality, engine._features.needTypeSuffixInShaderConstants && (defines.NUM_SAMPLES += "u"), defines.REALTIME_FILTERING = !0) : defines.REALTIME_FILTERING = !1, defines.INVERTCUBICMAP = reflectionTexture.coordinatesMode === texture/* Texture.INVCUBIC_MODE */.x.INVCUBIC_MODE, defines.REFLECTIONMAP_3D = reflectionTexture.isCube, defines.REFLECTIONMAP_OPPOSITEZ = defines.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !reflectionTexture.invertZ : reflectionTexture.invertZ, defines.REFLECTIONMAP_CUBIC = !1, defines.REFLECTIONMAP_EXPLICIT = !1, defines.REFLECTIONMAP_PLANAR = !1, defines.REFLECTIONMAP_PROJECTION = !1, defines.REFLECTIONMAP_SKYBOX = !1, defines.REFLECTIONMAP_SPHERICAL = !1, defines.REFLECTIONMAP_EQUIRECTANGULAR = !1, defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, reflectionTexture.coordinatesMode) {case texture/* Texture.EXPLICIT_MODE */.x.EXPLICIT_MODE:defines.REFLECTIONMAP_EXPLICIT = !0;break;case texture/* Texture.PLANAR_MODE */.x.PLANAR_MODE:defines.REFLECTIONMAP_PLANAR = !0;break;case texture/* Texture.PROJECTION_MODE */.x.PROJECTION_MODE:defines.REFLECTIONMAP_PROJECTION = !0;break;case texture/* Texture.SKYBOX_MODE */.x.SKYBOX_MODE:defines.REFLECTIONMAP_SKYBOX = !0;break;case texture/* Texture.SPHERICAL_MODE */.x.SPHERICAL_MODE:defines.REFLECTIONMAP_SPHERICAL = !0;break;case texture/* Texture.EQUIRECTANGULAR_MODE */.x.EQUIRECTANGULAR_MODE:defines.REFLECTIONMAP_EQUIRECTANGULAR = !0;break;case texture/* Texture.FIXED_EQUIRECTANGULAR_MODE */.x.FIXED_EQUIRECTANGULAR_MODE:defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;break;case texture/* Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE */.x.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;break;case texture/* Texture.CUBIC_MODE */.x.CUBIC_MODE:case texture/* Texture.INVCUBIC_MODE */.x.INVCUBIC_MODE:default:defines.REFLECTIONMAP_CUBIC = !0, defines.USE_LOCAL_REFLECTIONMAP_CUBIC = !!reflectionTexture.boundingBoxSize;}reflectionTexture.coordinatesMode !== texture/* Texture.SKYBOX_MODE */.x.SKYBOX_MODE && (reflectionTexture.irradianceTexture ? (defines.USEIRRADIANCEMAP = !0, defines.USESPHERICALFROMREFLECTIONMAP = !1) : reflectionTexture.isCube && (defines.USESPHERICALFROMREFLECTIONMAP = !0, defines.USEIRRADIANCEMAP = !1, defines.USESPHERICALINVERTEX = !(this._forceIrradianceInFragment || this.realTimeFiltering || 8 >= engine.getCaps().maxVaryingVectors)));} else defines.REFLECTION = !1, defines.REFLECTIONMAP_3D = !1, defines.REFLECTIONMAP_SPHERICAL = !1, defines.REFLECTIONMAP_PLANAR = !1, defines.REFLECTIONMAP_CUBIC = !1, defines.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, defines.REFLECTIONMAP_PROJECTION = !1, defines.REFLECTIONMAP_SKYBOX = !1, defines.REFLECTIONMAP_EXPLICIT = !1, defines.REFLECTIONMAP_EQUIRECTANGULAR = !1, defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, defines.INVERTCUBICMAP = !1, defines.USESPHERICALFROMREFLECTIONMAP = !1, defines.USEIRRADIANCEMAP = !1, defines.USESPHERICALINVERTEX = !1, defines.REFLECTIONMAP_OPPOSITEZ = !1, defines.LODINREFLECTIONALPHA = !1, defines.GAMMAREFLECTION = !1, defines.RGBDREFLECTION = !1, defines.LINEARSPECULARREFLECTION = !1;if (this._lightmapTexture && materialFlags/* MaterialFlags.LightmapTextureEnabled */.k.LightmapTextureEnabled ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._lightmapTexture, defines, "LIGHTMAP"), defines.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap, defines.GAMMALIGHTMAP = this._lightmapTexture.gammaSpace, defines.RGBDLIGHTMAP = this._lightmapTexture.isRGBD) : defines.LIGHTMAP = !1, this._emissiveTexture && materialFlags/* MaterialFlags.EmissiveTextureEnabled */.k.EmissiveTextureEnabled ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._emissiveTexture, defines, "EMISSIVE"), defines.GAMMAEMISSIVE = this._emissiveTexture.gammaSpace) : defines.EMISSIVE = !1, materialFlags/* MaterialFlags.SpecularTextureEnabled */.k.SpecularTextureEnabled) {if (this._metallicTexture ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._metallicTexture, defines, "REFLECTIVITY"), defines.ROUGHNESSSTOREINMETALMAPALPHA = this._useRoughnessFromMetallicTextureAlpha, defines.ROUGHNESSSTOREINMETALMAPGREEN = !this._useRoughnessFromMetallicTextureAlpha && this._useRoughnessFromMetallicTextureGreen, defines.METALLNESSSTOREINMETALMAPBLUE = this._useMetallnessFromMetallicTextureBlue, defines.AOSTOREINMETALMAPRED = this._useAmbientOcclusionFromMetallicTextureRed, defines.REFLECTIVITY_GAMMA = !1) : this._reflectivityTexture ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._reflectivityTexture, defines, "REFLECTIVITY"), defines.MICROSURFACEFROMREFLECTIVITYMAP = this._useMicroSurfaceFromReflectivityMapAlpha, defines.MICROSURFACEAUTOMATIC = this._useAutoMicroSurfaceFromReflectivityMap, defines.REFLECTIVITY_GAMMA = this._reflectivityTexture.gammaSpace) : defines.REFLECTIVITY = !1, this._metallicReflectanceTexture || this._reflectanceTexture) {const identicalTextures = null !== this._metallicReflectanceTexture && this._metallicReflectanceTexture._texture === (null === (_a = this._reflectanceTexture) || void 0 === _a ? void 0 : _a._texture) && this._metallicReflectanceTexture.checkTransformsAreIdentical(this._reflectanceTexture);defines.METALLIC_REFLECTANCE_USE_ALPHA_ONLY = this._useOnlyMetallicFromMetallicReflectanceTexture && !identicalTextures, this._metallicReflectanceTexture ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._metallicReflectanceTexture, defines, "METALLIC_REFLECTANCE"), defines.METALLIC_REFLECTANCE_GAMMA = this._metallicReflectanceTexture.gammaSpace) : defines.METALLIC_REFLECTANCE = !1, this._reflectanceTexture && !identicalTextures && (!this._metallicReflectanceTexture || this._metallicReflectanceTexture && this._useOnlyMetallicFromMetallicReflectanceTexture) ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._reflectanceTexture, defines, "REFLECTANCE"), defines.REFLECTANCE_GAMMA = this._reflectanceTexture.gammaSpace) : defines.REFLECTANCE = !1;} else defines.METALLIC_REFLECTANCE = !1, defines.REFLECTANCE = !1;this._microSurfaceTexture ? materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._microSurfaceTexture, defines, "MICROSURFACEMAP") : defines.MICROSURFACEMAP = !1;} else defines.REFLECTIVITY = !1, defines.MICROSURFACEMAP = !1;engine.getCaps().standardDerivatives && this._bumpTexture && materialFlags/* MaterialFlags.BumpTextureEnabled */.k.BumpTextureEnabled && !this._disableBumpMap ? (materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._bumpTexture, defines, "BUMP"), this._useParallax && this._albedoTexture && materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled ? (defines.PARALLAX = !0, defines.PARALLAXOCCLUSION = !!this._useParallaxOcclusion) : defines.PARALLAX = !1, defines.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap) : (defines.BUMP = !1, defines.PARALLAX = !1, defines.PARALLAXOCCLUSION = !1, defines.OBJECTSPACE_NORMALMAP = !1), this._environmentBRDFTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled ? (defines.ENVIRONMENTBRDF = !0, defines.ENVIRONMENTBRDF_RGBD = this._environmentBRDFTexture.isRGBD) : (defines.ENVIRONMENTBRDF = !1, defines.ENVIRONMENTBRDF_RGBD = !1), defines.ALPHAFROMALBEDO = !!this._shouldUseAlphaFromAlbedoTexture();}defines.SPECULAROVERALPHA = this._useSpecularOverAlpha, this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_STANDARD ? (defines.USEPHYSICALLIGHTFALLOFF = !1, defines.USEGLTFLIGHTFALLOFF = !1) : this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_GLTF ? (defines.USEPHYSICALLIGHTFALLOFF = !1, defines.USEGLTFLIGHTFALLOFF = !0) : (defines.USEPHYSICALLIGHTFALLOFF = !0, defines.USEGLTFLIGHTFALLOFF = !1), defines.RADIANCEOVERALPHA = this._useRadianceOverAlpha, defines.TWOSIDEDLIGHTING = !this.backFaceCulling && this._twoSidedLighting, defines.SPECULARAA = engine.getCaps().standardDerivatives && this._enableSpecularAntiAliasing;}(defines._areTexturesDirty || defines._areMiscDirty) && (defines.ALPHATESTVALUE = `${this._alphaCutOff}${0 == this._alphaCutOff % 1 ? "." : ""}`, defines.PREMULTIPLYALPHA = 7 === this.alphaMode || 8 === this.alphaMode, defines.ALPHABLEND = this.needAlphaBlendingForMesh(mesh), defines.ALPHAFRESNEL = this._useAlphaFresnel || this._useLinearAlphaFresnel, defines.LINEARALPHAFRESNEL = this._useLinearAlphaFresnel), defines._areImageProcessingDirty && this._imageProcessingConfiguration && this._imageProcessingConfiguration.prepareDefines(defines), defines.FORCENORMALFORWARD = this._forceNormalForward, defines.RADIANCEOCCLUSION = this._useRadianceOcclusion, defines.HORIZONOCCLUSION = this._useHorizonOcclusion, defines._areMiscDirty && (materialHelper/* MaterialHelper.PrepareDefinesForMisc */.G.PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh) || this._forceAlphaTest, defines), defines.UNLIT = this._unlit || (this.pointsCloud || this.wireframe) && !mesh.isVerticesDataPresent(buffer/* VertexBuffer.NormalKind */.o.NormalKind), defines.DEBUGMODE = this._debugMode), materialHelper/* MaterialHelper.PrepareDefinesForFrameBoundValues */.G.PrepareDefinesForFrameBoundValues(scene, engine, this, defines, !!useInstances, useClipPlane, useThinInstances), this._eventInfo.defines = defines, this._eventInfo.mesh = mesh, this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo), materialHelper/* MaterialHelper.PrepareDefinesForAttributes */.G.PrepareDefinesForAttributes(mesh, defines, !0, !0, !0, this._transparencyMode !== PBRBaseMaterial.PBRMATERIAL_OPAQUE), this._callbackPluginEventPrepareDefines(this._eventInfo);}forceCompilation(mesh, onCompiled, options) {const localOptions = { clipPlane: !1, useInstances: !1, ...options };this._uniformBufferLayoutBuilt || this.buildUniformLayout(), this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.GetDefineNames */.S.GetDefineNames, this._eventInfo);const defines = new PBRMaterialDefines(this._eventInfo.defineNames),effect = this._prepareEffect(mesh, defines, void 0, void 0, localOptions.useInstances, localOptions.clipPlane, mesh.hasThinInstances);this._onEffectCreatedObservable && (onCreatedEffectParameters.effect = effect, onCreatedEffectParameters.subMesh = null, this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters)), effect.isReady() ? onCompiled && onCompiled(this) : effect.onCompileObservable.add(() => {onCompiled && onCompiled(this);});}buildUniformLayout() {const ubo = this._uniformBuffer;ubo.addUniform("vAlbedoInfos", 2), ubo.addUniform("vAmbientInfos", 4), ubo.addUniform("vOpacityInfos", 2), ubo.addUniform("vEmissiveInfos", 2), ubo.addUniform("vLightmapInfos", 2), ubo.addUniform("vReflectivityInfos", 3), ubo.addUniform("vMicroSurfaceSamplerInfos", 2), ubo.addUniform("vReflectionInfos", 2), ubo.addUniform("vReflectionFilteringInfo", 2), ubo.addUniform("vReflectionPosition", 3), ubo.addUniform("vReflectionSize", 3), ubo.addUniform("vBumpInfos", 3), ubo.addUniform("albedoMatrix", 16), ubo.addUniform("ambientMatrix", 16), ubo.addUniform("opacityMatrix", 16), ubo.addUniform("emissiveMatrix", 16), ubo.addUniform("lightmapMatrix", 16), ubo.addUniform("reflectivityMatrix", 16), ubo.addUniform("microSurfaceSamplerMatrix", 16), ubo.addUniform("bumpMatrix", 16), ubo.addUniform("vTangentSpaceParams", 2), ubo.addUniform("reflectionMatrix", 16), ubo.addUniform("vReflectionColor", 3), ubo.addUniform("vAlbedoColor", 4), ubo.addUniform("vLightingIntensity", 4), ubo.addUniform("vReflectionMicrosurfaceInfos", 3), ubo.addUniform("pointSize", 1), ubo.addUniform("vReflectivityColor", 4), ubo.addUniform("vEmissiveColor", 3), ubo.addUniform("vAmbientColor", 3), ubo.addUniform("vDebugMode", 2), ubo.addUniform("vMetallicReflectanceFactors", 4), ubo.addUniform("vMetallicReflectanceInfos", 2), ubo.addUniform("metallicReflectanceMatrix", 16), ubo.addUniform("vReflectanceInfos", 2), ubo.addUniform("reflectanceMatrix", 16), ubo.addUniform("vSphericalL00", 3), ubo.addUniform("vSphericalL1_1", 3), ubo.addUniform("vSphericalL10", 3), ubo.addUniform("vSphericalL11", 3), ubo.addUniform("vSphericalL2_2", 3), ubo.addUniform("vSphericalL2_1", 3), ubo.addUniform("vSphericalL20", 3), ubo.addUniform("vSphericalL21", 3), ubo.addUniform("vSphericalL22", 3), ubo.addUniform("vSphericalX", 3), ubo.addUniform("vSphericalY", 3), ubo.addUniform("vSphericalZ", 3), ubo.addUniform("vSphericalXX_ZZ", 3), ubo.addUniform("vSphericalYY_ZZ", 3), ubo.addUniform("vSphericalZZ", 3), ubo.addUniform("vSphericalXY", 3), ubo.addUniform("vSphericalYZ", 3), ubo.addUniform("vSphericalZX", 3), super.buildUniformLayout();}bindForSubMesh(world, mesh, subMesh) {var _a, _b, _c, _d;const scene = this.getScene(),defines = subMesh.materialDefines;if (!defines) return;const effect = subMesh.effect;if (!effect) return;this._activeEffect = effect, mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh"), mesh.transferToEffect(world);const engine = scene.getEngine();this._uniformBuffer.bindToEffect(effect, "Material"), this.prePassConfiguration.bindForSubMesh(this._activeEffect, scene, mesh, world, this.isFrozen), this._eventInfo.subMesh = subMesh, this._callbackPluginEventHardBindForSubMesh(this._eventInfo), defines.OBJECTSPACE_NORMALMAP && (world.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));const mustRebind = effect._forceRebindOnNextCall || this._mustRebind(scene, effect, mesh.visibility);materialHelper/* MaterialHelper.BindBonesParameters */.G.BindBonesParameters(mesh, this._activeEffect, this.prePassConfiguration);let reflectionTexture = null;const ubo = this._uniformBuffer;if (mustRebind) {if (this.bindViewProjection(effect), reflectionTexture = this._getReflectionTexture(), !ubo.useUbo || !this.isFrozen || !ubo.isSync || effect._forceRebindOnNextCall) {if (scene.texturesEnabled) {if (this._albedoTexture && materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled && (ubo.updateFloat2("vAlbedoInfos", this._albedoTexture.coordinatesIndex, this._albedoTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._albedoTexture, ubo, "albedo")), this._ambientTexture && materialFlags/* MaterialFlags.AmbientTextureEnabled */.k.AmbientTextureEnabled && (ubo.updateFloat4("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level, this._ambientTextureStrength, this._ambientTextureImpactOnAnalyticalLights), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._ambientTexture, ubo, "ambient")), this._opacityTexture && materialFlags/* MaterialFlags.OpacityTextureEnabled */.k.OpacityTextureEnabled && (ubo.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._opacityTexture, ubo, "opacity")), reflectionTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled) {if (ubo.updateMatrix("reflectionMatrix", reflectionTexture.getReflectionTextureMatrix()), ubo.updateFloat2("vReflectionInfos", reflectionTexture.level, 0), reflectionTexture.boundingBoxSize) {const cubeTexture = reflectionTexture;ubo.updateVector3("vReflectionPosition", cubeTexture.boundingBoxPosition), ubo.updateVector3("vReflectionSize", cubeTexture.boundingBoxSize);}if (this.realTimeFiltering) {const width = reflectionTexture.getSize().width;ubo.updateFloat2("vReflectionFilteringInfo", width, math_scalar/* Scalar.Log2 */.R.Log2(width));}if (!defines.USEIRRADIANCEMAP) {const polynomials = reflectionTexture.sphericalPolynomial;if (defines.USESPHERICALFROMREFLECTIONMAP && polynomials) if (defines.SPHERICAL_HARMONICS) {const preScaledHarmonics = polynomials.preScaledHarmonics;ubo.updateVector3("vSphericalL00", preScaledHarmonics.l00), ubo.updateVector3("vSphericalL1_1", preScaledHarmonics.l1_1), ubo.updateVector3("vSphericalL10", preScaledHarmonics.l10), ubo.updateVector3("vSphericalL11", preScaledHarmonics.l11), ubo.updateVector3("vSphericalL2_2", preScaledHarmonics.l2_2), ubo.updateVector3("vSphericalL2_1", preScaledHarmonics.l2_1), ubo.updateVector3("vSphericalL20", preScaledHarmonics.l20), ubo.updateVector3("vSphericalL21", preScaledHarmonics.l21), ubo.updateVector3("vSphericalL22", preScaledHarmonics.l22);} else ubo.updateFloat3("vSphericalX", polynomials.x.x, polynomials.x.y, polynomials.x.z), ubo.updateFloat3("vSphericalY", polynomials.y.x, polynomials.y.y, polynomials.y.z), ubo.updateFloat3("vSphericalZ", polynomials.z.x, polynomials.z.y, polynomials.z.z), ubo.updateFloat3("vSphericalXX_ZZ", polynomials.xx.x - polynomials.zz.x, polynomials.xx.y - polynomials.zz.y, polynomials.xx.z - polynomials.zz.z), ubo.updateFloat3("vSphericalYY_ZZ", polynomials.yy.x - polynomials.zz.x, polynomials.yy.y - polynomials.zz.y, polynomials.yy.z - polynomials.zz.z), ubo.updateFloat3("vSphericalZZ", polynomials.zz.x, polynomials.zz.y, polynomials.zz.z), ubo.updateFloat3("vSphericalXY", polynomials.xy.x, polynomials.xy.y, polynomials.xy.z), ubo.updateFloat3("vSphericalYZ", polynomials.yz.x, polynomials.yz.y, polynomials.yz.z), ubo.updateFloat3("vSphericalZX", polynomials.zx.x, polynomials.zx.y, polynomials.zx.z);}ubo.updateFloat3("vReflectionMicrosurfaceInfos", reflectionTexture.getSize().width, reflectionTexture.lodGenerationScale, reflectionTexture.lodGenerationOffset);}this._emissiveTexture && materialFlags/* MaterialFlags.EmissiveTextureEnabled */.k.EmissiveTextureEnabled && (ubo.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._emissiveTexture, ubo, "emissive")), this._lightmapTexture && materialFlags/* MaterialFlags.LightmapTextureEnabled */.k.LightmapTextureEnabled && (ubo.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._lightmapTexture, ubo, "lightmap")), materialFlags/* MaterialFlags.SpecularTextureEnabled */.k.SpecularTextureEnabled && (this._metallicTexture ? (ubo.updateFloat3("vReflectivityInfos", this._metallicTexture.coordinatesIndex, this._metallicTexture.level, this._ambientTextureStrength), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._metallicTexture, ubo, "reflectivity")) : this._reflectivityTexture && (ubo.updateFloat3("vReflectivityInfos", this._reflectivityTexture.coordinatesIndex, this._reflectivityTexture.level, 1), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._reflectivityTexture, ubo, "reflectivity")), this._metallicReflectanceTexture && (ubo.updateFloat2("vMetallicReflectanceInfos", this._metallicReflectanceTexture.coordinatesIndex, this._metallicReflectanceTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._metallicReflectanceTexture, ubo, "metallicReflectance")), this._reflectanceTexture && defines.REFLECTANCE && (ubo.updateFloat2("vReflectanceInfos", this._reflectanceTexture.coordinatesIndex, this._reflectanceTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._reflectanceTexture, ubo, "reflectance")), this._microSurfaceTexture && (ubo.updateFloat2("vMicroSurfaceSamplerInfos", this._microSurfaceTexture.coordinatesIndex, this._microSurfaceTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._microSurfaceTexture, ubo, "microSurfaceSampler"))), this._bumpTexture && engine.getCaps().standardDerivatives && materialFlags/* MaterialFlags.BumpTextureEnabled */.k.BumpTextureEnabled && !this._disableBumpMap && (ubo.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, this._bumpTexture.level, this._parallaxScaleBias), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._bumpTexture, ubo, "bump"), scene._mirroredCameraPosition ? ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1));}if (this.pointsCloud && ubo.updateFloat("pointSize", this.pointSize), defines.METALLICWORKFLOW) {math_color/* TmpColors.Color3.0.r */.zZ.Color3[0].r = void 0 === this._metallic || null === this._metallic ? 1 : this._metallic, math_color/* TmpColors.Color3.0.g */.zZ.Color3[0].g = void 0 === this._roughness || null === this._roughness ? 1 : this._roughness, ubo.updateColor4("vReflectivityColor", math_color/* TmpColors.Color3.0 */.zZ.Color3[0], 1);const ior = null !== (_b = null === (_a = this.subSurface) || void 0 === _a ? void 0 : _a._indexOfRefraction) && void 0 !== _b ? _b : 1.5,outsideIOR = 1,f0 = Math.pow((ior - outsideIOR) / (ior + outsideIOR), 2);this._metallicReflectanceColor.scaleToRef(f0 * this._metallicF0Factor, math_color/* TmpColors.Color3.0 */.zZ.Color3[0]);const metallicF90 = this._metallicF0Factor;ubo.updateColor4("vMetallicReflectanceFactors", math_color/* TmpColors.Color3.0 */.zZ.Color3[0], metallicF90);} else ubo.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface);ubo.updateColor3("vEmissiveColor", materialFlags/* MaterialFlags.EmissiveTextureEnabled */.k.EmissiveTextureEnabled ? this._emissiveColor : math_color/* Color3.BlackReadOnly */.Wo.BlackReadOnly), ubo.updateColor3("vReflectionColor", this._reflectionColor), !defines.SS_REFRACTION && (null === (_c = this.subSurface) || void 0 === _c ? void 0 : _c._linkRefractionWithTransparency) ? ubo.updateColor4("vAlbedoColor", this._albedoColor, 1) : ubo.updateColor4("vAlbedoColor", this._albedoColor, this.alpha), this._lightingInfos.x = this._directIntensity, this._lightingInfos.y = this._emissiveIntensity, this._lightingInfos.z = this._environmentIntensity * scene.environmentIntensity, this._lightingInfos.w = this._specularIntensity, ubo.updateVector4("vLightingIntensity", this._lightingInfos), scene.ambientColor.multiplyToRef(this._ambientColor, this._globalAmbientColor), ubo.updateColor3("vAmbientColor", this._globalAmbientColor), ubo.updateFloat2("vDebugMode", this._debugLimit, this._debugFactor);}scene.texturesEnabled && (this._albedoTexture && materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled && ubo.setTexture("albedoSampler", this._albedoTexture), this._ambientTexture && materialFlags/* MaterialFlags.AmbientTextureEnabled */.k.AmbientTextureEnabled && ubo.setTexture("ambientSampler", this._ambientTexture), this._opacityTexture && materialFlags/* MaterialFlags.OpacityTextureEnabled */.k.OpacityTextureEnabled && ubo.setTexture("opacitySampler", this._opacityTexture), reflectionTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled && (defines.LODBASEDMICROSFURACE ? ubo.setTexture("reflectionSampler", reflectionTexture) : (ubo.setTexture("reflectionSampler", reflectionTexture._lodTextureMid || reflectionTexture), ubo.setTexture("reflectionSamplerLow", reflectionTexture._lodTextureLow || reflectionTexture), ubo.setTexture("reflectionSamplerHigh", reflectionTexture._lodTextureHigh || reflectionTexture)), defines.USEIRRADIANCEMAP && ubo.setTexture("irradianceSampler", reflectionTexture.irradianceTexture)), defines.ENVIRONMENTBRDF && ubo.setTexture("environmentBrdfSampler", this._environmentBRDFTexture), this._emissiveTexture && materialFlags/* MaterialFlags.EmissiveTextureEnabled */.k.EmissiveTextureEnabled && ubo.setTexture("emissiveSampler", this._emissiveTexture), this._lightmapTexture && materialFlags/* MaterialFlags.LightmapTextureEnabled */.k.LightmapTextureEnabled && ubo.setTexture("lightmapSampler", this._lightmapTexture), materialFlags/* MaterialFlags.SpecularTextureEnabled */.k.SpecularTextureEnabled && (this._metallicTexture ? ubo.setTexture("reflectivitySampler", this._metallicTexture) : this._reflectivityTexture && ubo.setTexture("reflectivitySampler", this._reflectivityTexture), this._metallicReflectanceTexture && ubo.setTexture("metallicReflectanceSampler", this._metallicReflectanceTexture), this._reflectanceTexture && defines.REFLECTANCE && ubo.setTexture("reflectanceSampler", this._reflectanceTexture), this._microSurfaceTexture && ubo.setTexture("microSurfaceSampler", this._microSurfaceTexture)), this._bumpTexture && engine.getCaps().standardDerivatives && materialFlags/* MaterialFlags.BumpTextureEnabled */.k.BumpTextureEnabled && !this._disableBumpMap && ubo.setTexture("bumpSampler", this._bumpTexture)), this.getScene().useOrderIndependentTransparency && this.needAlphaBlendingForMesh(mesh) && this.getScene().depthPeelingRenderer.bind(effect), this._eventInfo.subMesh = subMesh, this._callbackPluginEventBindForSubMesh(this._eventInfo), (0,clipPlaneMaterialHelper/* bindClipPlane */.an)(this._activeEffect, this, scene), this.bindEyePosition(effect);} else scene.getEngine()._features.needToAlwaysBindUniformBuffers && (this._needToBindSceneUbo = !0);(mustRebind || !this.isFrozen) && (scene.lightsEnabled && !this._disableLighting && materialHelper/* MaterialHelper.BindLights */.G.BindLights(scene, mesh, this._activeEffect, defines, this._maxSimultaneousLights), (scene.fogEnabled && mesh.applyFog && scene.fogMode !== core_scene/* Scene.FOGMODE_NONE */.x.FOGMODE_NONE || reflectionTexture || mesh.receiveShadows || defines.PREPASS) && this.bindView(effect), materialHelper/* MaterialHelper.BindFogParameters */.G.BindFogParameters(scene, mesh, this._activeEffect, !0), defines.NUM_MORPH_INFLUENCERS && materialHelper/* MaterialHelper.BindMorphTargetParameters */.G.BindMorphTargetParameters(mesh, this._activeEffect), defines.BAKED_VERTEX_ANIMATION_TEXTURE && (null === (_d = mesh.bakedVertexAnimationManager) || void 0 === _d ? void 0 : _d.bind(effect, defines.INSTANCES)), this._imageProcessingConfiguration.bind(this._activeEffect), materialHelper/* MaterialHelper.BindLogDepth */.G.BindLogDepth(defines, this._activeEffect, scene)), this._afterBind(mesh, this._activeEffect), ubo.update();}getAnimatables() {const results = super.getAnimatables();return this._albedoTexture && this._albedoTexture.animations && 0 < this._albedoTexture.animations.length && results.push(this._albedoTexture), this._ambientTexture && this._ambientTexture.animations && 0 < this._ambientTexture.animations.length && results.push(this._ambientTexture), this._opacityTexture && this._opacityTexture.animations && 0 < this._opacityTexture.animations.length && results.push(this._opacityTexture), this._reflectionTexture && this._reflectionTexture.animations && 0 < this._reflectionTexture.animations.length && results.push(this._reflectionTexture), this._emissiveTexture && this._emissiveTexture.animations && 0 < this._emissiveTexture.animations.length && results.push(this._emissiveTexture), this._metallicTexture && this._metallicTexture.animations && 0 < this._metallicTexture.animations.length ? results.push(this._metallicTexture) : this._reflectivityTexture && this._reflectivityTexture.animations && 0 < this._reflectivityTexture.animations.length && results.push(this._reflectivityTexture), this._bumpTexture && this._bumpTexture.animations && 0 < this._bumpTexture.animations.length && results.push(this._bumpTexture), this._lightmapTexture && this._lightmapTexture.animations && 0 < this._lightmapTexture.animations.length && results.push(this._lightmapTexture), this._metallicReflectanceTexture && this._metallicReflectanceTexture.animations && 0 < this._metallicReflectanceTexture.animations.length && results.push(this._metallicReflectanceTexture), this._reflectanceTexture && this._reflectanceTexture.animations && 0 < this._reflectanceTexture.animations.length && results.push(this._reflectanceTexture), this._microSurfaceTexture && this._microSurfaceTexture.animations && 0 < this._microSurfaceTexture.animations.length && results.push(this._microSurfaceTexture), results;}_getReflectionTexture() {return this._reflectionTexture ? this._reflectionTexture : this.getScene().environmentTexture;}getActiveTextures() {const activeTextures = super.getActiveTextures();return this._albedoTexture && activeTextures.push(this._albedoTexture), this._ambientTexture && activeTextures.push(this._ambientTexture), this._opacityTexture && activeTextures.push(this._opacityTexture), this._reflectionTexture && activeTextures.push(this._reflectionTexture), this._emissiveTexture && activeTextures.push(this._emissiveTexture), this._reflectivityTexture && activeTextures.push(this._reflectivityTexture), this._metallicTexture && activeTextures.push(this._metallicTexture), this._metallicReflectanceTexture && activeTextures.push(this._metallicReflectanceTexture), this._reflectanceTexture && activeTextures.push(this._reflectanceTexture), this._microSurfaceTexture && activeTextures.push(this._microSurfaceTexture), this._bumpTexture && activeTextures.push(this._bumpTexture), this._lightmapTexture && activeTextures.push(this._lightmapTexture), activeTextures;}hasTexture(texture) {return !!super.hasTexture(texture) || !(this._albedoTexture !== texture) || !(this._ambientTexture !== texture) || !(this._opacityTexture !== texture) || !(this._reflectionTexture !== texture) || !(this._emissiveTexture !== texture) || !(this._reflectivityTexture !== texture) || !(this._metallicTexture !== texture) || !(this._metallicReflectanceTexture !== texture) || !(this._reflectanceTexture !== texture) || !(this._microSurfaceTexture !== texture) || !(this._bumpTexture !== texture) || !(this._lightmapTexture !== texture);}setPrePassRenderer() {var _a;if (null === (_a = this.subSurface) || void 0 === _a || !_a.isScatteringEnabled) return !1;const subSurfaceConfiguration = this.getScene().enableSubSurfaceForPrePass();return subSurfaceConfiguration && (subSurfaceConfiguration.enabled = !0), !0;}dispose(forceDisposeEffect, forceDisposeTextures) {var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;forceDisposeTextures && (this._environmentBRDFTexture && this.getScene().environmentBRDFTexture !== this._environmentBRDFTexture && this._environmentBRDFTexture.dispose(), null === (_a = this._albedoTexture) || void 0 === _a ? void 0 : _a.dispose(), null === (_b = this._ambientTexture) || void 0 === _b ? void 0 : _b.dispose(), null === (_c = this._opacityTexture) || void 0 === _c ? void 0 : _c.dispose(), null === (_d = this._reflectionTexture) || void 0 === _d ? void 0 : _d.dispose(), null === (_e = this._emissiveTexture) || void 0 === _e ? void 0 : _e.dispose(), null === (_f = this._metallicTexture) || void 0 === _f ? void 0 : _f.dispose(), null === (_g = this._reflectivityTexture) || void 0 === _g ? void 0 : _g.dispose(), null === (_h = this._bumpTexture) || void 0 === _h ? void 0 : _h.dispose(), null === (_j = this._lightmapTexture) || void 0 === _j ? void 0 : _j.dispose(), null === (_k = this._metallicReflectanceTexture) || void 0 === _k ? void 0 : _k.dispose(), null === (_l = this._reflectanceTexture) || void 0 === _l ? void 0 : _l.dispose(), null === (_m = this._microSurfaceTexture) || void 0 === _m ? void 0 : _m.dispose()), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), super.dispose(forceDisposeEffect, forceDisposeTextures);}}PBRBaseMaterial.PBRMATERIAL_OPAQUE = material/* Material.MATERIAL_OPAQUE */.F.MATERIAL_OPAQUE, PBRBaseMaterial.PBRMATERIAL_ALPHATEST = material/* Material.MATERIAL_ALPHATEST */.F.MATERIAL_ALPHATEST, PBRBaseMaterial.PBRMATERIAL_ALPHABLEND = material/* Material.MATERIAL_ALPHABLEND */.F.MATERIAL_ALPHABLEND, PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND = material/* Material.MATERIAL_ALPHATESTANDBLEND */.F.MATERIAL_ALPHATESTANDBLEND, PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 0, PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL = 0, PBRBaseMaterial.LIGHTFALLOFF_GLTF = 1, PBRBaseMaterial.LIGHTFALLOFF_STANDARD = 2, (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsImageProcessingConfiguration */.rX)()], PBRBaseMaterial.prototype, "_imageProcessingConfiguration", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsMiscDirty")], PBRBaseMaterial.prototype, "debugMode", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], PBRBaseMaterial.prototype, "useLogarithmicDepth", null);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/PBR/pbrClearCoatConfiguration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Y": () => (/* binding */ PBRClearCoatConfiguration),
/* harmony export */   "d": () => (/* binding */ MaterialClearCoatDefines)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialFlags.js");
/* harmony import */ var _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginBase.js");
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
class MaterialClearCoatDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_6__/* .MaterialDefines */ .H {constructor() {super(...arguments), this.CLEARCOAT = !1, this.CLEARCOAT_DEFAULTIOR = !1, this.CLEARCOAT_TEXTURE = !1, this.CLEARCOAT_TEXTURE_ROUGHNESS = !1, this.CLEARCOAT_TEXTUREDIRECTUV = 0, this.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV = 0, this.CLEARCOAT_BUMP = !1, this.CLEARCOAT_BUMPDIRECTUV = 0, this.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, this.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = !1, this.CLEARCOAT_REMAP_F0 = !1, this.CLEARCOAT_TINT = !1, this.CLEARCOAT_TINT_TEXTURE = !1, this.CLEARCOAT_TINT_TEXTUREDIRECTUV = 0, this.CLEARCOAT_TINT_GAMMATEXTURE = !1;}}class PBRClearCoatConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialPluginBase */ .n {_markAllSubMeshesAsTexturesDirty() {this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();}constructor(material, addToPluginList = !0) {super(material, "PBRClearCoat", 100, new MaterialClearCoatDefines(), addToPluginList), this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.roughness = 0, this._indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction, this.indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction, this._texture = null, this.texture = null, this._useRoughnessFromMainTexture = !0, this.useRoughnessFromMainTexture = !0, this._textureRoughness = null, this.textureRoughness = null, this._remapF0OnInterfaceChange = !0, this.remapF0OnInterfaceChange = !0, this._bumpTexture = null, this.bumpTexture = null, this._isTintEnabled = !1, this.isTintEnabled = !1, this.tintColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color3.White */ .Wo.White(), this.tintColorAtDistance = 1, this.tintThickness = 1, this._tintTexture = null, this.tintTexture = null, this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];}isReadyForSubMesh(defines, scene, engine) {if (!this._isEnabled) return !0;const disableBumpMap = this._material._disableBumpMap;if (defines._areTexturesDirty && scene.texturesEnabled) {if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTextureEnabled */ .k.ClearCoatTextureEnabled && !this._texture.isReadyOrNotBlocking()) return !1;if (this._textureRoughness && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTextureEnabled */ .k.ClearCoatTextureEnabled && !this._textureRoughness.isReadyOrNotBlocking()) return !1;if (engine.getCaps().standardDerivatives && this._bumpTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatBumpTextureEnabled */ .k.ClearCoatBumpTextureEnabled && !disableBumpMap && !this._bumpTexture.isReady()) return !1;if (this._isTintEnabled && this._tintTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTintTextureEnabled */ .k.ClearCoatTintTextureEnabled && !this._tintTexture.isReadyOrNotBlocking()) return !1;}return !0;}prepareDefinesBeforeAttributes(defines, scene) {var _a;this._isEnabled ? (defines.CLEARCOAT = !0, defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture, defines.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = null !== this._texture && this._texture._texture === (null === (_a = this._textureRoughness) || void 0 === _a ? void 0 : _a._texture) && this._texture.checkTransformsAreIdentical(this._textureRoughness), defines.CLEARCOAT_REMAP_F0 = this._remapF0OnInterfaceChange, defines._areTexturesDirty && scene.texturesEnabled && (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTextureEnabled */ .k.ClearCoatTextureEnabled ? _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._texture, defines, "CLEARCOAT_TEXTURE") : defines.CLEARCOAT_TEXTURE = !1, this._textureRoughness && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTextureEnabled */ .k.ClearCoatTextureEnabled ? _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._textureRoughness, defines, "CLEARCOAT_TEXTURE_ROUGHNESS") : defines.CLEARCOAT_TEXTURE_ROUGHNESS = !1, this._bumpTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatBumpTextureEnabled */ .k.ClearCoatBumpTextureEnabled ? _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._bumpTexture, defines, "CLEARCOAT_BUMP") : defines.CLEARCOAT_BUMP = !1, defines.CLEARCOAT_DEFAULTIOR = this._indexOfRefraction === PBRClearCoatConfiguration._DefaultIndexOfRefraction, this._isTintEnabled ? (defines.CLEARCOAT_TINT = !0, this._tintTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTintTextureEnabled */ .k.ClearCoatTintTextureEnabled ? (_Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._tintTexture, defines, "CLEARCOAT_TINT_TEXTURE"), defines.CLEARCOAT_TINT_GAMMATEXTURE = this._tintTexture.gammaSpace) : defines.CLEARCOAT_TINT_TEXTURE = !1) : (defines.CLEARCOAT_TINT = !1, defines.CLEARCOAT_TINT_TEXTURE = !1))) : (defines.CLEARCOAT = !1, defines.CLEARCOAT_TEXTURE = !1, defines.CLEARCOAT_TEXTURE_ROUGHNESS = !1, defines.CLEARCOAT_BUMP = !1, defines.CLEARCOAT_TINT = !1, defines.CLEARCOAT_TINT_TEXTURE = !1, defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, defines.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = !1, defines.CLEARCOAT_DEFAULTIOR = !1, defines.CLEARCOAT_TEXTUREDIRECTUV = 0, defines.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV = 0, defines.CLEARCOAT_BUMPDIRECTUV = 0, defines.CLEARCOAT_REMAP_F0 = !1, defines.CLEARCOAT_TINT_TEXTUREDIRECTUV = 0, defines.CLEARCOAT_TINT_GAMMATEXTURE = !1);}bindForSubMesh(uniformBuffer, scene, engine, subMesh) {var _a, _b, _c, _d, _e, _f, _g, _h;if (!this._isEnabled) return;const defines = subMesh.materialDefines,isFrozen = this._material.isFrozen,disableBumpMap = this._material._disableBumpMap,invertNormalMapX = this._material._invertNormalMapX,invertNormalMapY = this._material._invertNormalMapY,identicalTextures = defines.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL;if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {identicalTextures && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTextureEnabled */ .k.ClearCoatTextureEnabled ? (uniformBuffer.updateFloat4("vClearCoatInfos", this._texture.coordinatesIndex, this._texture.level, -1, -1), _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._texture, uniformBuffer, "clearCoat")) : (this._texture || this._textureRoughness) && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTextureEnabled */ .k.ClearCoatTextureEnabled && (uniformBuffer.updateFloat4("vClearCoatInfos", null !== (_b = null === (_a = this._texture) || void 0 === _a ? void 0 : _a.coordinatesIndex) && void 0 !== _b ? _b : 0, null !== (_d = null === (_c = this._texture) || void 0 === _c ? void 0 : _c.level) && void 0 !== _d ? _d : 0, null !== (_f = null === (_e = this._textureRoughness) || void 0 === _e ? void 0 : _e.coordinatesIndex) && void 0 !== _f ? _f : 0, null !== (_h = null === (_g = this._textureRoughness) || void 0 === _g ? void 0 : _g.level) && void 0 !== _h ? _h : 0), this._texture && _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._texture, uniformBuffer, "clearCoat"), this._textureRoughness && !identicalTextures && !defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE && _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._textureRoughness, uniformBuffer, "clearCoatRoughness")), this._bumpTexture && engine.getCaps().standardDerivatives && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTextureEnabled */ .k.ClearCoatTextureEnabled && !disableBumpMap && (uniformBuffer.updateFloat2("vClearCoatBumpInfos", this._bumpTexture.coordinatesIndex, this._bumpTexture.level), _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._bumpTexture, uniformBuffer, "clearCoatBump"), scene._mirroredCameraPosition ? uniformBuffer.updateFloat2("vClearCoatTangentSpaceParams", invertNormalMapX ? 1 : -1, invertNormalMapY ? 1 : -1) : uniformBuffer.updateFloat2("vClearCoatTangentSpaceParams", invertNormalMapX ? -1 : 1, invertNormalMapY ? -1 : 1)), this._tintTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTintTextureEnabled */ .k.ClearCoatTintTextureEnabled && (uniformBuffer.updateFloat2("vClearCoatTintInfos", this._tintTexture.coordinatesIndex, this._tintTexture.level), _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._tintTexture, uniformBuffer, "clearCoatTint")), uniformBuffer.updateFloat2("vClearCoatParams", this.intensity, this.roughness);const a = 1 - this._indexOfRefraction,b = 1 + this._indexOfRefraction,f0 = Math.pow(-a / b, 2),eta = 1 / this._indexOfRefraction;uniformBuffer.updateFloat4("vClearCoatRefractionParams", f0, eta, a, b), this._isTintEnabled && (uniformBuffer.updateFloat4("vClearCoatTintParams", this.tintColor.r, this.tintColor.g, this.tintColor.b, Math.max(1e-5, this.tintThickness)), uniformBuffer.updateFloat("clearCoatColorAtDistance", Math.max(1e-5, this.tintColorAtDistance)));}scene.texturesEnabled && (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTextureEnabled */ .k.ClearCoatTextureEnabled && uniformBuffer.setTexture("clearCoatSampler", this._texture), this._textureRoughness && !identicalTextures && !defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTextureEnabled */ .k.ClearCoatTextureEnabled && uniformBuffer.setTexture("clearCoatRoughnessSampler", this._textureRoughness), this._bumpTexture && engine.getCaps().standardDerivatives && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatBumpTextureEnabled */ .k.ClearCoatBumpTextureEnabled && !disableBumpMap && uniformBuffer.setTexture("clearCoatBumpSampler", this._bumpTexture), this._isTintEnabled && this._tintTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ClearCoatTintTextureEnabled */ .k.ClearCoatTintTextureEnabled && uniformBuffer.setTexture("clearCoatTintSampler", this._tintTexture));}hasTexture(texture) {return !(this._texture !== texture) || !(this._textureRoughness !== texture) || !(this._bumpTexture !== texture) || !(this._tintTexture !== texture);}getActiveTextures(activeTextures) {this._texture && activeTextures.push(this._texture), this._textureRoughness && activeTextures.push(this._textureRoughness), this._bumpTexture && activeTextures.push(this._bumpTexture), this._tintTexture && activeTextures.push(this._tintTexture);}getAnimatables(animatables) {this._texture && this._texture.animations && 0 < this._texture.animations.length && animatables.push(this._texture), this._textureRoughness && this._textureRoughness.animations && 0 < this._textureRoughness.animations.length && animatables.push(this._textureRoughness), this._bumpTexture && this._bumpTexture.animations && 0 < this._bumpTexture.animations.length && animatables.push(this._bumpTexture), this._tintTexture && this._tintTexture.animations && 0 < this._tintTexture.animations.length && animatables.push(this._tintTexture);}dispose(forceDisposeTextures) {var _a, _b, _c, _d;forceDisposeTextures && (null === (_a = this._texture) || void 0 === _a ? void 0 : _a.dispose(), null === (_b = this._textureRoughness) || void 0 === _b ? void 0 : _b.dispose(), null === (_c = this._bumpTexture) || void 0 === _c ? void 0 : _c.dispose(), null === (_d = this._tintTexture) || void 0 === _d ? void 0 : _d.dispose());}getClassName() {return "PBRClearCoatConfiguration";}addFallbacks(defines, fallbacks, currentRank) {return defines.CLEARCOAT_BUMP && fallbacks.addFallback(currentRank++, "CLEARCOAT_BUMP"), defines.CLEARCOAT_TINT && fallbacks.addFallback(currentRank++, "CLEARCOAT_TINT"), defines.CLEARCOAT && fallbacks.addFallback(currentRank++, "CLEARCOAT"), currentRank;}getSamplers(samplers) {samplers.push("clearCoatSampler", "clearCoatRoughnessSampler", "clearCoatBumpSampler", "clearCoatTintSampler");}getUniforms() {return { ubo: [{ name: "vClearCoatParams", size: 2, type: "vec2" }, { name: "vClearCoatRefractionParams", size: 4, type: "vec4" }, { name: "vClearCoatInfos", size: 4, type: "vec4" }, { name: "clearCoatMatrix", size: 16, type: "mat4" }, { name: "clearCoatRoughnessMatrix", size: 16, type: "mat4" }, { name: "vClearCoatBumpInfos", size: 2, type: "vec2" }, { name: "vClearCoatTangentSpaceParams", size: 2, type: "vec2" }, { name: "clearCoatBumpMatrix", size: 16, type: "mat4" }, { name: "vClearCoatTintParams", size: 4, type: "vec4" }, { name: "clearCoatColorAtDistance", size: 1, type: "float" }, { name: "vClearCoatTintInfos", size: 2, type: "vec2" }, { name: "clearCoatTintMatrix", size: 16, type: "mat4" }] };}}PBRClearCoatConfiguration._DefaultIndexOfRefraction = 1.5, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRClearCoatConfiguration.prototype, "isEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRClearCoatConfiguration.prototype, "intensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRClearCoatConfiguration.prototype, "roughness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRClearCoatConfiguration.prototype, "indexOfRefraction", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRClearCoatConfiguration.prototype, "texture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRClearCoatConfiguration.prototype, "useRoughnessFromMainTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRClearCoatConfiguration.prototype, "textureRoughness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRClearCoatConfiguration.prototype, "remapF0OnInterfaceChange", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRClearCoatConfiguration.prototype, "bumpTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRClearCoatConfiguration.prototype, "isTintEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)()], PBRClearCoatConfiguration.prototype, "tintColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRClearCoatConfiguration.prototype, "tintColorAtDistance", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRClearCoatConfiguration.prototype, "tintThickness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRClearCoatConfiguration.prototype, "tintTexture", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/PBR/pbrIridescenceConfiguration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "B": () => (/* binding */ PBRIridescenceConfiguration),
/* harmony export */   "f": () => (/* binding */ MaterialIridescenceDefines)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialFlags.js");
/* harmony import */ var _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginBase.js");
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
class MaterialIridescenceDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialDefines */ .H {constructor() {super(...arguments), this.IRIDESCENCE = !1, this.IRIDESCENCE_TEXTURE = !1, this.IRIDESCENCE_TEXTUREDIRECTUV = 0, this.IRIDESCENCE_THICKNESS_TEXTURE = !1, this.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV = 0, this.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE = !1;}}class PBRIridescenceConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialPluginBase */ .n {_markAllSubMeshesAsTexturesDirty() {this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();}constructor(material, addToPluginList = !0) {super(material, "PBRIridescence", 110, new MaterialIridescenceDefines(), addToPluginList), this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.minimumThickness = PBRIridescenceConfiguration._DefaultMinimumThickness, this.maximumThickness = PBRIridescenceConfiguration._DefaultMaximumThickness, this.indexOfRefraction = PBRIridescenceConfiguration._DefaultIndexOfRefraction, this._texture = null, this.texture = null, this._thicknessTexture = null, this.thicknessTexture = null, this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];}isReadyForSubMesh(defines, scene) {if (!this._isEnabled) return !0;if (defines._areTexturesDirty && scene.texturesEnabled) {if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags.IridescenceTextureEnabled */ .k.IridescenceTextureEnabled && !this._texture.isReadyOrNotBlocking()) return !1;if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags.IridescenceTextureEnabled */ .k.IridescenceTextureEnabled && !this._thicknessTexture.isReadyOrNotBlocking()) return !1;}return !0;}prepareDefinesBeforeAttributes(defines, scene) {var _a;this._isEnabled ? (defines.IRIDESCENCE = !0, defines.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE = null !== this._texture && this._texture._texture === (null === (_a = this._thicknessTexture) || void 0 === _a ? void 0 : _a._texture) && this._texture.checkTransformsAreIdentical(this._thicknessTexture), defines._areTexturesDirty && scene.texturesEnabled && (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags.IridescenceTextureEnabled */ .k.IridescenceTextureEnabled ? _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._texture, defines, "IRIDESCENCE_TEXTURE") : defines.IRIDESCENCE_TEXTURE = !1, !defines.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE && this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags.IridescenceTextureEnabled */ .k.IridescenceTextureEnabled ? _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._thicknessTexture, defines, "IRIDESCENCE_THICKNESS_TEXTURE") : defines.IRIDESCENCE_THICKNESS_TEXTURE = !1)) : (defines.IRIDESCENCE = !1, defines.IRIDESCENCE_TEXTURE = !1, defines.IRIDESCENCE_THICKNESS_TEXTURE = !1, defines.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE = !1, defines.IRIDESCENCE_TEXTUREDIRECTUV = 0, defines.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV = 0);}bindForSubMesh(uniformBuffer, scene, engine, subMesh) {var _a, _b, _c, _d, _e, _f, _g, _h;if (!this._isEnabled) return;const defines = subMesh.materialDefines,isFrozen = this._material.isFrozen,identicalTextures = defines.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE;uniformBuffer.useUbo && isFrozen && uniformBuffer.isSync || (identicalTextures && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags.IridescenceTextureEnabled */ .k.IridescenceTextureEnabled ? (uniformBuffer.updateFloat4("vIridescenceInfos", this._texture.coordinatesIndex, this._texture.level, -1, -1), _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._texture, uniformBuffer, "iridescence")) : (this._texture || this._thicknessTexture) && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags.IridescenceTextureEnabled */ .k.IridescenceTextureEnabled && (uniformBuffer.updateFloat4("vIridescenceInfos", null !== (_b = null === (_a = this._texture) || void 0 === _a ? void 0 : _a.coordinatesIndex) && void 0 !== _b ? _b : 0, null !== (_d = null === (_c = this._texture) || void 0 === _c ? void 0 : _c.level) && void 0 !== _d ? _d : 0, null !== (_f = null === (_e = this._thicknessTexture) || void 0 === _e ? void 0 : _e.coordinatesIndex) && void 0 !== _f ? _f : 0, null !== (_h = null === (_g = this._thicknessTexture) || void 0 === _g ? void 0 : _g.level) && void 0 !== _h ? _h : 0), this._texture && _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._texture, uniformBuffer, "iridescence"), this._thicknessTexture && !identicalTextures && !defines.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE && _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._thicknessTexture, uniformBuffer, "iridescenceThickness")), uniformBuffer.updateFloat4("vIridescenceParams", this.intensity, this.indexOfRefraction, this.minimumThickness, this.maximumThickness)), scene.texturesEnabled && (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags.IridescenceTextureEnabled */ .k.IridescenceTextureEnabled && uniformBuffer.setTexture("iridescenceSampler", this._texture), this._thicknessTexture && !identicalTextures && !defines.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags.IridescenceTextureEnabled */ .k.IridescenceTextureEnabled && uniformBuffer.setTexture("iridescenceThicknessSampler", this._thicknessTexture));}hasTexture(texture) {return !(this._texture !== texture) || !(this._thicknessTexture !== texture);}getActiveTextures(activeTextures) {this._texture && activeTextures.push(this._texture), this._thicknessTexture && activeTextures.push(this._thicknessTexture);}getAnimatables(animatables) {this._texture && this._texture.animations && 0 < this._texture.animations.length && animatables.push(this._texture), this._thicknessTexture && this._thicknessTexture.animations && 0 < this._thicknessTexture.animations.length && animatables.push(this._thicknessTexture);}dispose(forceDisposeTextures) {var _a, _b;forceDisposeTextures && (null === (_a = this._texture) || void 0 === _a ? void 0 : _a.dispose(), null === (_b = this._thicknessTexture) || void 0 === _b ? void 0 : _b.dispose());}getClassName() {return "PBRIridescenceConfiguration";}addFallbacks(defines, fallbacks, currentRank) {return defines.IRIDESCENCE && fallbacks.addFallback(currentRank++, "IRIDESCENCE"), currentRank;}getSamplers(samplers) {samplers.push("iridescenceSampler", "iridescenceThicknessSampler");}getUniforms() {return { ubo: [{ name: "vIridescenceParams", size: 4, type: "vec4" }, { name: "vIridescenceInfos", size: 4, type: "vec4" }, { name: "iridescenceMatrix", size: 16, type: "mat4" }, { name: "iridescenceThicknessMatrix", size: 16, type: "mat4" }] };}}PBRIridescenceConfiguration._DefaultMinimumThickness = 100, PBRIridescenceConfiguration._DefaultMaximumThickness = 400, PBRIridescenceConfiguration._DefaultIndexOfRefraction = 1.3, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRIridescenceConfiguration.prototype, "isEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRIridescenceConfiguration.prototype, "intensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRIridescenceConfiguration.prototype, "minimumThickness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRIridescenceConfiguration.prototype, "maximumThickness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRIridescenceConfiguration.prototype, "indexOfRefraction", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRIridescenceConfiguration.prototype, "texture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRIridescenceConfiguration.prototype, "thicknessTexture", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Y": () => (/* binding */ PBRMaterial)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_brdfTextureTools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/brdfTextureTools.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrBaseMaterial.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
class PBRMaterial extends _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .m {get refractionTexture() {return this.subSurface.refractionTexture;}set refractionTexture(value) {this.subSurface.refractionTexture = value, value ? this.subSurface.isRefractionEnabled = !0 : !this.subSurface.linkRefractionWithTransparency && (this.subSurface.isRefractionEnabled = !1);}get indexOfRefraction() {return this.subSurface.indexOfRefraction;}set indexOfRefraction(value) {this.subSurface.indexOfRefraction = value;}get invertRefractionY() {return this.subSurface.invertRefractionY;}set invertRefractionY(value) {this.subSurface.invertRefractionY = value;}get linkRefractionWithTransparency() {return this.subSurface.linkRefractionWithTransparency;}set linkRefractionWithTransparency(value) {this.subSurface.linkRefractionWithTransparency = value, value && (this.subSurface.isRefractionEnabled = !0);}get usePhysicalLightFalloff() {return this._lightFalloff === _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL */ .m.LIGHTFALLOFF_PHYSICAL;}set usePhysicalLightFalloff(value) {value !== this.usePhysicalLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), this._lightFalloff = value ? _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL */ .m.LIGHTFALLOFF_PHYSICAL : _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.LIGHTFALLOFF_STANDARD */ .m.LIGHTFALLOFF_STANDARD);}get useGLTFLightFalloff() {return this._lightFalloff === _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.LIGHTFALLOFF_GLTF */ .m.LIGHTFALLOFF_GLTF;}set useGLTFLightFalloff(value) {value !== this.useGLTFLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), this._lightFalloff = value ? _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.LIGHTFALLOFF_GLTF */ .m.LIGHTFALLOFF_GLTF : _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.LIGHTFALLOFF_STANDARD */ .m.LIGHTFALLOFF_STANDARD);}get imageProcessingConfiguration() {return this._imageProcessingConfiguration;}set imageProcessingConfiguration(value) {this._attachImageProcessingConfiguration(value), this._markAllSubMeshesAsTexturesDirty();}get cameraColorCurvesEnabled() {return this.imageProcessingConfiguration.colorCurvesEnabled;}set cameraColorCurvesEnabled(value) {this.imageProcessingConfiguration.colorCurvesEnabled = value;}get cameraColorGradingEnabled() {return this.imageProcessingConfiguration.colorGradingEnabled;}set cameraColorGradingEnabled(value) {this.imageProcessingConfiguration.colorGradingEnabled = value;}get cameraToneMappingEnabled() {return this._imageProcessingConfiguration.toneMappingEnabled;}set cameraToneMappingEnabled(value) {this._imageProcessingConfiguration.toneMappingEnabled = value;}get cameraExposure() {return this._imageProcessingConfiguration.exposure;}set cameraExposure(value) {this._imageProcessingConfiguration.exposure = value;}get cameraContrast() {return this._imageProcessingConfiguration.contrast;}set cameraContrast(value) {this._imageProcessingConfiguration.contrast = value;}get cameraColorGradingTexture() {return this._imageProcessingConfiguration.colorGradingTexture;}set cameraColorGradingTexture(value) {this._imageProcessingConfiguration.colorGradingTexture = value;}get cameraColorCurves() {return this._imageProcessingConfiguration.colorCurves;}set cameraColorCurves(value) {this._imageProcessingConfiguration.colorCurves = value;}constructor(name, scene) {super(name, scene), this.directIntensity = 1, this.emissiveIntensity = 1, this.environmentIntensity = 1, this.specularIntensity = 1, this.disableBumpMap = !1, this.ambientTextureStrength = 1, this.ambientTextureImpactOnAnalyticalLights = PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, this.metallicF0Factor = 1, this.metallicReflectanceColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3.White */ .Wo.White(), this.useOnlyMetallicFromMetallicReflectanceTexture = !1, this.ambientColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .Wo(0, 0, 0), this.albedoColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .Wo(1, 1, 1), this.reflectivityColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .Wo(1, 1, 1), this.reflectionColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .Wo(1, 1, 1), this.emissiveColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .Wo(0, 0, 0), this.microSurface = 1, this.useLightmapAsShadowmap = !1, this.useAlphaFromAlbedoTexture = !1, this.forceAlphaTest = !1, this.alphaCutOff = .4, this.useSpecularOverAlpha = !0, this.useMicroSurfaceFromReflectivityMapAlpha = !1, this.useRoughnessFromMetallicTextureAlpha = !0, this.useRoughnessFromMetallicTextureGreen = !1, this.useMetallnessFromMetallicTextureBlue = !1, this.useAmbientOcclusionFromMetallicTextureRed = !1, this.useAmbientInGrayScale = !1, this.useAutoMicroSurfaceFromReflectivityMap = !1, this.useRadianceOverAlpha = !0, this.useObjectSpaceNormalMap = !1, this.useParallax = !1, this.useParallaxOcclusion = !1, this.parallaxScaleBias = .05, this.disableLighting = !1, this.forceIrradianceInFragment = !1, this.maxSimultaneousLights = 4, this.invertNormalMapX = !1, this.invertNormalMapY = !1, this.twoSidedLighting = !1, this.useAlphaFresnel = !1, this.useLinearAlphaFresnel = !1, this.environmentBRDFTexture = null, this.forceNormalForward = !1, this.enableSpecularAntiAliasing = !1, this.useHorizonOcclusion = !0, this.useRadianceOcclusion = !0, this.unlit = !1, this._environmentBRDFTexture = (0,_Misc_brdfTextureTools_js__WEBPACK_IMPORTED_MODULE_2__/* .GetEnvironmentBRDFTexture */ .$)(this.getScene());}getClassName() {return "PBRMaterial";}clone(name) {const clone = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Clone */ .p4.Clone(() => new PBRMaterial(name, this.getScene()), this);return clone.id = name, clone.name = name, this.stencil.copyTo(clone.stencil), this.clearCoat.copyTo(clone.clearCoat), this.anisotropy.copyTo(clone.anisotropy), this.brdf.copyTo(clone.brdf), this.sheen.copyTo(clone.sheen), this.subSurface.copyTo(clone.subSurface), clone;}serialize() {const serializationObject = super.serialize();return serializationObject.customType = "BABYLON.PBRMaterial", serializationObject.clearCoat = this.clearCoat.serialize(), serializationObject.anisotropy = this.anisotropy.serialize(), serializationObject.brdf = this.brdf.serialize(), serializationObject.sheen = this.sheen.serialize(), serializationObject.subSurface = this.subSurface.serialize(), serializationObject.iridescence = this.iridescence.serialize(), serializationObject;}static Parse(source, scene, rootUrl) {const material = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(() => new PBRMaterial(source.name, scene), source, scene, rootUrl);return source.stencil && material.stencil.parse(source.stencil, scene, rootUrl), source.clearCoat && material.clearCoat.parse(source.clearCoat, scene, rootUrl), source.anisotropy && material.anisotropy.parse(source.anisotropy, scene, rootUrl), source.brdf && material.brdf.parse(source.brdf, scene, rootUrl), source.sheen && material.sheen.parse(source.sheen, scene, rootUrl), source.subSurface && material.subSurface.parse(source.subSurface, scene, rootUrl), source.iridescence && material.iridescence.parse(source.iridescence, scene, rootUrl), material;}}PBRMaterial.PBRMATERIAL_OPAQUE = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.PBRMATERIAL_OPAQUE */ .m.PBRMATERIAL_OPAQUE, PBRMaterial.PBRMATERIAL_ALPHATEST = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.PBRMATERIAL_ALPHATEST */ .m.PBRMATERIAL_ALPHATEST, PBRMaterial.PBRMATERIAL_ALPHABLEND = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.PBRMATERIAL_ALPHABLEND */ .m.PBRMATERIAL_ALPHABLEND, PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND */ .m.PBRMATERIAL_ALPHATESTANDBLEND, PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS */ .m.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "directIntensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "emissiveIntensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "environmentIntensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "specularIntensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "disableBumpMap", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "albedoTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "ambientTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "ambientTextureStrength", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "ambientTextureImpactOnAnalyticalLights", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesAndMiscDirty")], PBRMaterial.prototype, "opacityTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "reflectionTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "emissiveTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "reflectivityTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "metallicTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "metallic", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "roughness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "metallicF0Factor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "metallicReflectanceColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useOnlyMetallicFromMetallicReflectanceTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "metallicReflectanceTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "reflectanceTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "microSurfaceTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "bumpTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty", null)], PBRMaterial.prototype, "lightmapTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)("ambient"), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "ambientColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)("albedo"), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "albedoColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)("reflectivity"), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "reflectivityColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)("reflection"), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "reflectionColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)("emissive"), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "emissiveColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "microSurface", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useLightmapAsShadowmap", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesAndMiscDirty")], PBRMaterial.prototype, "useAlphaFromAlbedoTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesAndMiscDirty")], PBRMaterial.prototype, "forceAlphaTest", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesAndMiscDirty")], PBRMaterial.prototype, "alphaCutOff", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useSpecularOverAlpha", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useMicroSurfaceFromReflectivityMapAlpha", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useRoughnessFromMetallicTextureAlpha", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useRoughnessFromMetallicTextureGreen", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useMetallnessFromMetallicTextureBlue", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useAmbientOcclusionFromMetallicTextureRed", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useAmbientInGrayScale", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useAutoMicroSurfaceFromReflectivityMap", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRMaterial.prototype, "usePhysicalLightFalloff", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRMaterial.prototype, "useGLTFLightFalloff", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useRadianceOverAlpha", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useObjectSpaceNormalMap", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useParallax", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useParallaxOcclusion", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "parallaxScaleBias", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsLightsDirty")], PBRMaterial.prototype, "disableLighting", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "forceIrradianceInFragment", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsLightsDirty")], PBRMaterial.prototype, "maxSimultaneousLights", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "invertNormalMapX", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "invertNormalMapY", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "twoSidedLighting", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useAlphaFresnel", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useLinearAlphaFresnel", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "environmentBRDFTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "forceNormalForward", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "enableSpecularAntiAliasing", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useHorizonOcclusion", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRMaterial.prototype, "useRadianceOcclusion", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsMiscDirty")], PBRMaterial.prototype, "unlit", void 0), (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__/* .RegisterClass */ .H)("BABYLON.PBRMaterial", PBRMaterial);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/PBR/pbrSheenConfiguration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "A": () => (/* binding */ MaterialSheenDefines),
/* harmony export */   "B": () => (/* binding */ PBRSheenConfiguration)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialFlags.js");
/* harmony import */ var _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginBase.js");
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
class MaterialSheenDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_6__/* .MaterialDefines */ .H {constructor() {super(...arguments), this.SHEEN = !1, this.SHEEN_TEXTURE = !1, this.SHEEN_GAMMATEXTURE = !1, this.SHEEN_TEXTURE_ROUGHNESS = !1, this.SHEEN_TEXTUREDIRECTUV = 0, this.SHEEN_TEXTURE_ROUGHNESSDIRECTUV = 0, this.SHEEN_LINKWITHALBEDO = !1, this.SHEEN_ROUGHNESS = !1, this.SHEEN_ALBEDOSCALING = !1, this.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, this.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = !1;}}class PBRSheenConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialPluginBase */ .n {_markAllSubMeshesAsTexturesDirty() {this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();}constructor(material, addToPluginList = !0) {super(material, "Sheen", 120, new MaterialSheenDefines(), addToPluginList), this._isEnabled = !1, this.isEnabled = !1, this._linkSheenWithAlbedo = !1, this.linkSheenWithAlbedo = !1, this.intensity = 1, this.color = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color3.White */ .Wo.White(), this._texture = null, this.texture = null, this._useRoughnessFromMainTexture = !0, this.useRoughnessFromMainTexture = !0, this._roughness = null, this.roughness = null, this._textureRoughness = null, this.textureRoughness = null, this._albedoScaling = !1, this.albedoScaling = !1, this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];}isReadyForSubMesh(defines, scene) {if (!this._isEnabled) return !0;if (defines._areTexturesDirty && scene.texturesEnabled) {if (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.SheenTextureEnabled */ .k.SheenTextureEnabled && !this._texture.isReadyOrNotBlocking()) return !1;if (this._textureRoughness && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.SheenTextureEnabled */ .k.SheenTextureEnabled && !this._textureRoughness.isReadyOrNotBlocking()) return !1;}return !0;}prepareDefinesBeforeAttributes(defines, scene) {var _a;this._isEnabled ? (defines.SHEEN = !0, defines.SHEEN_LINKWITHALBEDO = this._linkSheenWithAlbedo, defines.SHEEN_ROUGHNESS = null !== this._roughness, defines.SHEEN_ALBEDOSCALING = this._albedoScaling, defines.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture, defines.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = null !== this._texture && this._texture._texture === (null === (_a = this._textureRoughness) || void 0 === _a ? void 0 : _a._texture) && this._texture.checkTransformsAreIdentical(this._textureRoughness), defines._areTexturesDirty && scene.texturesEnabled && (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.SheenTextureEnabled */ .k.SheenTextureEnabled ? (_Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._texture, defines, "SHEEN_TEXTURE"), defines.SHEEN_GAMMATEXTURE = this._texture.gammaSpace) : defines.SHEEN_TEXTURE = !1, this._textureRoughness && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.SheenTextureEnabled */ .k.SheenTextureEnabled ? _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._textureRoughness, defines, "SHEEN_TEXTURE_ROUGHNESS") : defines.SHEEN_TEXTURE_ROUGHNESS = !1)) : (defines.SHEEN = !1, defines.SHEEN_TEXTURE = !1, defines.SHEEN_TEXTURE_ROUGHNESS = !1, defines.SHEEN_LINKWITHALBEDO = !1, defines.SHEEN_ROUGHNESS = !1, defines.SHEEN_ALBEDOSCALING = !1, defines.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, defines.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = !1, defines.SHEEN_GAMMATEXTURE = !1, defines.SHEEN_TEXTUREDIRECTUV = 0, defines.SHEEN_TEXTURE_ROUGHNESSDIRECTUV = 0);}bindForSubMesh(uniformBuffer, scene, engine, subMesh) {var _a, _b, _c, _d, _e, _f, _g, _h;if (!this._isEnabled) return;const defines = subMesh.materialDefines,isFrozen = this._material.isFrozen,identicalTextures = defines.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL;uniformBuffer.useUbo && isFrozen && uniformBuffer.isSync || (identicalTextures && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.SheenTextureEnabled */ .k.SheenTextureEnabled ? (uniformBuffer.updateFloat4("vSheenInfos", this._texture.coordinatesIndex, this._texture.level, -1, -1), _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._texture, uniformBuffer, "sheen")) : (this._texture || this._textureRoughness) && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.SheenTextureEnabled */ .k.SheenTextureEnabled && (uniformBuffer.updateFloat4("vSheenInfos", null !== (_b = null === (_a = this._texture) || void 0 === _a ? void 0 : _a.coordinatesIndex) && void 0 !== _b ? _b : 0, null !== (_d = null === (_c = this._texture) || void 0 === _c ? void 0 : _c.level) && void 0 !== _d ? _d : 0, null !== (_f = null === (_e = this._textureRoughness) || void 0 === _e ? void 0 : _e.coordinatesIndex) && void 0 !== _f ? _f : 0, null !== (_h = null === (_g = this._textureRoughness) || void 0 === _g ? void 0 : _g.level) && void 0 !== _h ? _h : 0), this._texture && _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._texture, uniformBuffer, "sheen"), this._textureRoughness && !identicalTextures && !defines.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE && _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._textureRoughness, uniformBuffer, "sheenRoughness")), uniformBuffer.updateFloat4("vSheenColor", this.color.r, this.color.g, this.color.b, this.intensity), null !== this._roughness && uniformBuffer.updateFloat("vSheenRoughness", this._roughness)), scene.texturesEnabled && (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.SheenTextureEnabled */ .k.SheenTextureEnabled && uniformBuffer.setTexture("sheenSampler", this._texture), this._textureRoughness && !identicalTextures && !defines.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.SheenTextureEnabled */ .k.SheenTextureEnabled && uniformBuffer.setTexture("sheenRoughnessSampler", this._textureRoughness));}hasTexture(texture) {return !(this._texture !== texture) || !(this._textureRoughness !== texture);}getActiveTextures(activeTextures) {this._texture && activeTextures.push(this._texture), this._textureRoughness && activeTextures.push(this._textureRoughness);}getAnimatables(animatables) {this._texture && this._texture.animations && 0 < this._texture.animations.length && animatables.push(this._texture), this._textureRoughness && this._textureRoughness.animations && 0 < this._textureRoughness.animations.length && animatables.push(this._textureRoughness);}dispose(forceDisposeTextures) {var _a, _b;forceDisposeTextures && (null === (_a = this._texture) || void 0 === _a ? void 0 : _a.dispose(), null === (_b = this._textureRoughness) || void 0 === _b ? void 0 : _b.dispose());}getClassName() {return "PBRSheenConfiguration";}addFallbacks(defines, fallbacks, currentRank) {return defines.SHEEN && fallbacks.addFallback(currentRank++, "SHEEN"), currentRank;}getSamplers(samplers) {samplers.push("sheenSampler", "sheenRoughnessSampler");}getUniforms() {return { ubo: [{ name: "vSheenColor", size: 4, type: "vec4" }, { name: "vSheenRoughness", size: 1, type: "float" }, { name: "vSheenInfos", size: 4, type: "vec4" }, { name: "sheenMatrix", size: 16, type: "mat4" }, { name: "sheenRoughnessMatrix", size: 16, type: "mat4" }] };}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSheenConfiguration.prototype, "isEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSheenConfiguration.prototype, "linkSheenWithAlbedo", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSheenConfiguration.prototype, "intensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)()], PBRSheenConfiguration.prototype, "color", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSheenConfiguration.prototype, "texture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSheenConfiguration.prototype, "useRoughnessFromMainTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSheenConfiguration.prototype, "roughness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSheenConfiguration.prototype, "textureRoughness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSheenConfiguration.prototype, "albedoScaling", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/PBR/pbrSubSurfaceConfiguration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "H": () => (/* binding */ MaterialSubSurfaceDefines),
/* harmony export */   "u": () => (/* binding */ PBRSubSurfaceConfiguration)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialFlags.js");
/* harmony import */ var _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
/* harmony import */ var _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginBase.js");
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
class MaterialSubSurfaceDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_8__/* .MaterialDefines */ .H {constructor() {super(...arguments), this.SUBSURFACE = !1, this.SS_REFRACTION = !1, this.SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE = !1, this.SS_TRANSLUCENCY = !1, this.SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE = !1, this.SS_SCATTERING = !1, this.SS_THICKNESSANDMASK_TEXTURE = !1, this.SS_THICKNESSANDMASK_TEXTUREDIRECTUV = 0, this.SS_HAS_THICKNESS = !1, this.SS_REFRACTIONINTENSITY_TEXTURE = !1, this.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV = 0, this.SS_TRANSLUCENCYINTENSITY_TEXTURE = !1, this.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV = 0, this.SS_REFRACTIONMAP_3D = !1, this.SS_REFRACTIONMAP_OPPOSITEZ = !1, this.SS_LODINREFRACTIONALPHA = !1, this.SS_GAMMAREFRACTION = !1, this.SS_RGBDREFRACTION = !1, this.SS_LINEARSPECULARREFRACTION = !1, this.SS_LINKREFRACTIONTOTRANSPARENCY = !1, this.SS_ALBEDOFORREFRACTIONTINT = !1, this.SS_ALBEDOFORTRANSLUCENCYTINT = !1, this.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = !1, this.SS_USE_THICKNESS_AS_DEPTH = !1, this.SS_MASK_FROM_THICKNESS_TEXTURE = !1, this.SS_USE_GLTF_TEXTURES = !1;}}class PBRSubSurfaceConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_7__/* .MaterialPluginBase */ .n {get scatteringDiffusionProfile() {return this._scene.subSurfaceConfiguration ? this._scene.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex] : null;}set scatteringDiffusionProfile(c) {!this._scene.enableSubSurfaceForPrePass() || c && (this._scatteringDiffusionProfileIndex = this._scene.subSurfaceConfiguration.addDiffusionProfile(c));}get volumeIndexOfRefraction() {return 1 <= this._volumeIndexOfRefraction ? this._volumeIndexOfRefraction : this._indexOfRefraction;}set volumeIndexOfRefraction(value) {this._volumeIndexOfRefraction = 1 <= value ? value : -1;}_markAllSubMeshesAsTexturesDirty() {this._enable(this._isRefractionEnabled || this._isTranslucencyEnabled || this._isScatteringEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();}_markScenePrePassDirty() {this._internalMarkAllSubMeshesAsTexturesDirty(), this._internalMarkScenePrePassDirty();}constructor(material, addToPluginList = !0) {super(material, "PBRSubSurface", 130, new MaterialSubSurfaceDefines(), addToPluginList), this._isRefractionEnabled = !1, this.isRefractionEnabled = !1, this._isTranslucencyEnabled = !1, this.isTranslucencyEnabled = !1, this._isScatteringEnabled = !1, this.isScatteringEnabled = !1, this._scatteringDiffusionProfileIndex = 0, this.refractionIntensity = 1, this.translucencyIntensity = 1, this.useAlbedoToTintRefraction = !1, this.useAlbedoToTintTranslucency = !1, this._thicknessTexture = null, this.thicknessTexture = null, this._refractionTexture = null, this.refractionTexture = null, this._indexOfRefraction = 1.5, this.indexOfRefraction = 1.5, this._volumeIndexOfRefraction = -1, this._invertRefractionY = !1, this.invertRefractionY = !1, this._linkRefractionWithTransparency = !1, this.linkRefractionWithTransparency = !1, this.minimumThickness = 0, this.maximumThickness = 1, this.useThicknessAsDepth = !1, this.tintColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color3.White */ .Wo.White(), this.tintColorAtDistance = 1, this.diffusionDistance = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color3.White */ .Wo.White(), this._useMaskFromThicknessTexture = !1, this.useMaskFromThicknessTexture = !1, this._refractionIntensityTexture = null, this.refractionIntensityTexture = null, this._translucencyIntensityTexture = null, this.translucencyIntensityTexture = null, this._useGltfStyleTextures = !1, this.useGltfStyleTextures = !1, this._scene = material.getScene(), this.registerForExtraEvents = !0, this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1], this._internalMarkScenePrePassDirty = material._dirtyCallbacks[32];}isReadyForSubMesh(defines, scene) {if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled) return !0;if (defines._areTexturesDirty && scene.texturesEnabled) {if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ThicknessTextureEnabled */ .k.ThicknessTextureEnabled && !this._thicknessTexture.isReadyOrNotBlocking()) return !1;const refractionTexture = this._getRefractionTexture(scene);if (refractionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.RefractionTextureEnabled */ .k.RefractionTextureEnabled && !refractionTexture.isReadyOrNotBlocking()) return !1;}return !0;}prepareDefinesBeforeAttributes(defines, scene) {if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled) return defines.SUBSURFACE = !1, defines.SS_TRANSLUCENCY = !1, defines.SS_SCATTERING = !1, defines.SS_REFRACTION = !1, defines.SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE = !1, defines.SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE = !1, defines.SS_THICKNESSANDMASK_TEXTURE = !1, defines.SS_THICKNESSANDMASK_TEXTUREDIRECTUV = 0, defines.SS_HAS_THICKNESS = !1, defines.SS_REFRACTIONINTENSITY_TEXTURE = !1, defines.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV = 0, defines.SS_TRANSLUCENCYINTENSITY_TEXTURE = !1, defines.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV = 0, defines.SS_REFRACTIONMAP_3D = !1, defines.SS_REFRACTIONMAP_OPPOSITEZ = !1, defines.SS_LODINREFRACTIONALPHA = !1, defines.SS_GAMMAREFRACTION = !1, defines.SS_RGBDREFRACTION = !1, defines.SS_LINEARSPECULARREFRACTION = !1, defines.SS_LINKREFRACTIONTOTRANSPARENCY = !1, defines.SS_ALBEDOFORREFRACTIONTINT = !1, defines.SS_ALBEDOFORTRANSLUCENCYTINT = !1, defines.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = !1, defines.SS_USE_THICKNESS_AS_DEPTH = !1, defines.SS_MASK_FROM_THICKNESS_TEXTURE = !1, void (defines.SS_USE_GLTF_TEXTURES = !1);if (defines._areTexturesDirty) {defines.SUBSURFACE = !0, defines.SS_TRANSLUCENCY = this._isTranslucencyEnabled, defines.SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE = !1, defines.SS_SCATTERING = this._isScatteringEnabled, defines.SS_THICKNESSANDMASK_TEXTURE = !1, defines.SS_REFRACTIONINTENSITY_TEXTURE = !1, defines.SS_TRANSLUCENCYINTENSITY_TEXTURE = !1, defines.SS_HAS_THICKNESS = !1, defines.SS_MASK_FROM_THICKNESS_TEXTURE = !1, defines.SS_USE_GLTF_TEXTURES = !1, defines.SS_REFRACTION = !1, defines.SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE = !1, defines.SS_REFRACTIONMAP_3D = !1, defines.SS_GAMMAREFRACTION = !1, defines.SS_RGBDREFRACTION = !1, defines.SS_LINEARSPECULARREFRACTION = !1, defines.SS_REFRACTIONMAP_OPPOSITEZ = !1, defines.SS_LODINREFRACTIONALPHA = !1, defines.SS_LINKREFRACTIONTOTRANSPARENCY = !1, defines.SS_ALBEDOFORREFRACTIONTINT = !1, defines.SS_ALBEDOFORTRANSLUCENCYTINT = !1, defines.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = !1, defines.SS_USE_THICKNESS_AS_DEPTH = !1;const refractionIntensityTextureIsThicknessTexture = !!this._thicknessTexture && !!this._refractionIntensityTexture && this._refractionIntensityTexture.checkTransformsAreIdentical(this._thicknessTexture) && this._refractionIntensityTexture._texture === this._thicknessTexture._texture,translucencyIntensityTextureIsThicknessTexture = !!this._thicknessTexture && !!this._translucencyIntensityTexture && this._translucencyIntensityTexture.checkTransformsAreIdentical(this._thicknessTexture) && this._translucencyIntensityTexture._texture === this._thicknessTexture._texture,useOnlyThicknessTexture = (refractionIntensityTextureIsThicknessTexture || !this._refractionIntensityTexture) && (translucencyIntensityTextureIsThicknessTexture || !this._translucencyIntensityTexture);if (defines._areTexturesDirty && scene.texturesEnabled && (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ThicknessTextureEnabled */ .k.ThicknessTextureEnabled && _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._thicknessTexture, defines, "SS_THICKNESSANDMASK_TEXTURE"), this._refractionIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.RefractionIntensityTextureEnabled */ .k.RefractionIntensityTextureEnabled && !useOnlyThicknessTexture && _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._refractionIntensityTexture, defines, "SS_REFRACTIONINTENSITY_TEXTURE"), this._translucencyIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.TranslucencyIntensityTextureEnabled */ .k.TranslucencyIntensityTextureEnabled && !useOnlyThicknessTexture && _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._translucencyIntensityTexture, defines, "SS_TRANSLUCENCYINTENSITY_TEXTURE")), defines.SS_HAS_THICKNESS = 0 != this.maximumThickness - this.minimumThickness, defines.SS_MASK_FROM_THICKNESS_TEXTURE = (this._useMaskFromThicknessTexture || !!this._refractionIntensityTexture || !!this._translucencyIntensityTexture) && useOnlyThicknessTexture, defines.SS_USE_GLTF_TEXTURES = this._useGltfStyleTextures, defines.SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE = (this._useMaskFromThicknessTexture || !!this._refractionIntensityTexture) && useOnlyThicknessTexture, defines.SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE = (this._useMaskFromThicknessTexture || !!this._translucencyIntensityTexture) && useOnlyThicknessTexture, this._isRefractionEnabled && scene.texturesEnabled) {const refractionTexture = this._getRefractionTexture(scene);refractionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.RefractionTextureEnabled */ .k.RefractionTextureEnabled && (defines.SS_REFRACTION = !0, defines.SS_REFRACTIONMAP_3D = refractionTexture.isCube, defines.SS_GAMMAREFRACTION = refractionTexture.gammaSpace, defines.SS_RGBDREFRACTION = refractionTexture.isRGBD, defines.SS_LINEARSPECULARREFRACTION = refractionTexture.linearSpecularLOD, defines.SS_REFRACTIONMAP_OPPOSITEZ = refractionTexture.invertZ, defines.SS_LODINREFRACTIONALPHA = refractionTexture.lodLevelInAlpha, defines.SS_LINKREFRACTIONTOTRANSPARENCY = this._linkRefractionWithTransparency, defines.SS_ALBEDOFORREFRACTIONTINT = this.useAlbedoToTintRefraction, defines.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = refractionTexture.isCube && refractionTexture.boundingBoxSize, defines.SS_USE_THICKNESS_AS_DEPTH = this.useThicknessAsDepth);}this._isTranslucencyEnabled && (defines.SS_ALBEDOFORTRANSLUCENCYTINT = this.useAlbedoToTintTranslucency);}}hardBindForSubMesh(uniformBuffer, scene, engine, subMesh) {if (this._isRefractionEnabled || this._isTranslucencyEnabled || this._isScatteringEnabled) {subMesh.getRenderingMesh().getWorldMatrix().decompose(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0]);const thicknessScale = Math.max(Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .TmpVectors.Vector3[0].x */ .jp.Vector3[0].x), Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .TmpVectors.Vector3[0].y */ .jp.Vector3[0].y), Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .TmpVectors.Vector3[0].z */ .jp.Vector3[0].z));uniformBuffer.updateFloat2("vThicknessParam", this.minimumThickness * thicknessScale, (this.maximumThickness - this.minimumThickness) * thicknessScale);}}bindForSubMesh(uniformBuffer, scene, engine, subMesh) {if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled) return;const defines = subMesh.materialDefines,isFrozen = this._material.isFrozen,realTimeFiltering = this._material.realTimeFiltering,lodBasedMicrosurface = defines.LODBASEDMICROSFURACE,refractionTexture = this._getRefractionTexture(scene);if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ThicknessTextureEnabled */ .k.ThicknessTextureEnabled && (uniformBuffer.updateFloat2("vThicknessInfos", this._thicknessTexture.coordinatesIndex, this._thicknessTexture.level), _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._thicknessTexture, uniformBuffer, "thickness")), this._refractionIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.RefractionIntensityTextureEnabled */ .k.RefractionIntensityTextureEnabled && defines.SS_REFRACTIONINTENSITY_TEXTURE && (uniformBuffer.updateFloat2("vRefractionIntensityInfos", this._refractionIntensityTexture.coordinatesIndex, this._refractionIntensityTexture.level), _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._refractionIntensityTexture, uniformBuffer, "refractionIntensity")), this._translucencyIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.TranslucencyIntensityTextureEnabled */ .k.TranslucencyIntensityTextureEnabled && defines.SS_TRANSLUCENCYINTENSITY_TEXTURE && (uniformBuffer.updateFloat2("vTranslucencyIntensityInfos", this._translucencyIntensityTexture.coordinatesIndex, this._translucencyIntensityTexture.level), _Materials_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._translucencyIntensityTexture, uniformBuffer, "translucencyIntensity")), refractionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.RefractionTextureEnabled */ .k.RefractionTextureEnabled) {uniformBuffer.updateMatrix("refractionMatrix", refractionTexture.getReflectionTextureMatrix());let depth = 1;!refractionTexture.isCube && refractionTexture.depth && (depth = refractionTexture.depth);const width = refractionTexture.getSize().width,refractionIor = this.volumeIndexOfRefraction;if (uniformBuffer.updateFloat4("vRefractionInfos", refractionTexture.level, 1 / refractionIor, depth, this._invertRefractionY ? -1 : 1), uniformBuffer.updateFloat4("vRefractionMicrosurfaceInfos", width, refractionTexture.lodGenerationScale, refractionTexture.lodGenerationOffset, 1 / this.indexOfRefraction), realTimeFiltering && uniformBuffer.updateFloat2("vRefractionFilteringInfo", width, _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_5__/* .Scalar.Log2 */ .R.Log2(width)), refractionTexture.boundingBoxSize) {const cubeTexture = refractionTexture;uniformBuffer.updateVector3("vRefractionPosition", cubeTexture.boundingBoxPosition), uniformBuffer.updateVector3("vRefractionSize", cubeTexture.boundingBoxSize);}}this._isScatteringEnabled && uniformBuffer.updateFloat("scatteringDiffusionProfile", this._scatteringDiffusionProfileIndex), uniformBuffer.updateColor3("vDiffusionDistance", this.diffusionDistance), uniformBuffer.updateFloat4("vTintColor", this.tintColor.r, this.tintColor.g, this.tintColor.b, Math.max(1e-5, this.tintColorAtDistance)), uniformBuffer.updateFloat3("vSubSurfaceIntensity", this.refractionIntensity, this.translucencyIntensity, 0);}scene.texturesEnabled && (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.ThicknessTextureEnabled */ .k.ThicknessTextureEnabled && uniformBuffer.setTexture("thicknessSampler", this._thicknessTexture), this._refractionIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.RefractionIntensityTextureEnabled */ .k.RefractionIntensityTextureEnabled && defines.SS_REFRACTIONINTENSITY_TEXTURE && uniformBuffer.setTexture("refractionIntensitySampler", this._refractionIntensityTexture), this._translucencyIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.TranslucencyIntensityTextureEnabled */ .k.TranslucencyIntensityTextureEnabled && defines.SS_TRANSLUCENCYINTENSITY_TEXTURE && uniformBuffer.setTexture("translucencyIntensitySampler", this._translucencyIntensityTexture), refractionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.RefractionTextureEnabled */ .k.RefractionTextureEnabled && (lodBasedMicrosurface ? uniformBuffer.setTexture("refractionSampler", refractionTexture) : (uniformBuffer.setTexture("refractionSampler", refractionTexture._lodTextureMid || refractionTexture), uniformBuffer.setTexture("refractionSamplerLow", refractionTexture._lodTextureLow || refractionTexture), uniformBuffer.setTexture("refractionSamplerHigh", refractionTexture._lodTextureHigh || refractionTexture))));}_getRefractionTexture(scene) {return this._refractionTexture ? this._refractionTexture : this._isRefractionEnabled ? scene.environmentTexture : null;}get disableAlphaBlending() {return this._isRefractionEnabled && this._linkRefractionWithTransparency;}fillRenderTargetTextures(renderTargets) {_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.RefractionTextureEnabled */ .k.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget && renderTargets.push(this._refractionTexture);}hasTexture(texture) {return !(this._thicknessTexture !== texture) || !(this._refractionTexture !== texture);}hasRenderTargetTextures() {return !!(_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.RefractionTextureEnabled */ .k.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget);}getActiveTextures(activeTextures) {this._thicknessTexture && activeTextures.push(this._thicknessTexture), this._refractionTexture && activeTextures.push(this._refractionTexture);}getAnimatables(animatables) {this._thicknessTexture && this._thicknessTexture.animations && 0 < this._thicknessTexture.animations.length && animatables.push(this._thicknessTexture), this._refractionTexture && this._refractionTexture.animations && 0 < this._refractionTexture.animations.length && animatables.push(this._refractionTexture);}dispose(forceDisposeTextures) {forceDisposeTextures && (this._thicknessTexture && this._thicknessTexture.dispose(), this._refractionTexture && this._refractionTexture.dispose());}getClassName() {return "PBRSubSurfaceConfiguration";}addFallbacks(defines, fallbacks, currentRank) {return defines.SS_SCATTERING && fallbacks.addFallback(currentRank++, "SS_SCATTERING"), defines.SS_TRANSLUCENCY && fallbacks.addFallback(currentRank++, "SS_TRANSLUCENCY"), currentRank;}getSamplers(samplers) {samplers.push("thicknessSampler", "refractionIntensitySampler", "translucencyIntensitySampler", "refractionSampler", "refractionSamplerLow", "refractionSamplerHigh");}getUniforms() {return { ubo: [{ name: "vRefractionMicrosurfaceInfos", size: 4, type: "vec4" }, { name: "vRefractionFilteringInfo", size: 2, type: "vec2" }, { name: "vTranslucencyIntensityInfos", size: 2, type: "vec2" }, { name: "vRefractionInfos", size: 4, type: "vec4" }, { name: "refractionMatrix", size: 16, type: "mat4" }, { name: "vThicknessInfos", size: 2, type: "vec2" }, { name: "vRefractionIntensityInfos", size: 2, type: "vec2" }, { name: "thicknessMatrix", size: 16, type: "mat4" }, { name: "refractionIntensityMatrix", size: 16, type: "mat4" }, { name: "translucencyIntensityMatrix", size: 16, type: "mat4" }, { name: "vThicknessParam", size: 2, type: "vec2" }, { name: "vDiffusionDistance", size: 3, type: "vec3" }, { name: "vTintColor", size: 4, type: "vec4" }, { name: "vSubSurfaceIntensity", size: 3, type: "vec3" }, { name: "vRefractionPosition", size: 3, type: "vec3" }, { name: "vRefractionSize", size: 3, type: "vec3" }, { name: "scatteringDiffusionProfile", size: 1, type: "float" }] };}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "isRefractionEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "isTranslucencyEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markScenePrePassDirty")], PBRSubSurfaceConfiguration.prototype, "isScatteringEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "_scatteringDiffusionProfileIndex", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "refractionIntensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "translucencyIntensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "useAlbedoToTintRefraction", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "useAlbedoToTintTranslucency", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "thicknessTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "refractionTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "indexOfRefraction", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "_volumeIndexOfRefraction", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "volumeIndexOfRefraction", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "invertRefractionY", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "linkRefractionWithTransparency", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "minimumThickness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "maximumThickness", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "useThicknessAsDepth", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)()], PBRSubSurfaceConfiguration.prototype, "tintColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], PBRSubSurfaceConfiguration.prototype, "tintColorAtDistance", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .n9)()], PBRSubSurfaceConfiguration.prototype, "diffusionDistance", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "useMaskFromThicknessTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "refractionIntensityTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "translucencyIntensityTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], PBRSubSurfaceConfiguration.prototype, "useGltfStyleTextures", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "V": () => (/* binding */ BaseTexture)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Misc_guid_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/guid.js");
/* harmony import */ var _Misc_fileTools_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/fileTools.js");
/* harmony import */ var _thinTexture_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/thinTexture.js");
class BaseTexture extends _thinTexture_js__WEBPACK_IMPORTED_MODULE_7__/* .ThinTexture */ .g {set hasAlpha(value) {this._hasAlpha === value || (this._hasAlpha = value, this._scene && this._scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this)));}get hasAlpha() {return this._hasAlpha;}set getAlphaFromRGB(value) {this._getAlphaFromRGB === value || (this._getAlphaFromRGB = value, this._scene && this._scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this)));}get getAlphaFromRGB() {return this._getAlphaFromRGB;}set coordinatesIndex(value) {this._coordinatesIndex === value || (this._coordinatesIndex = value, this._scene && this._scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this)));}get coordinatesIndex() {return this._coordinatesIndex;}set coordinatesMode(value) {this._coordinatesMode === value || (this._coordinatesMode = value, this._scene && this._scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this)));}get coordinatesMode() {return this._coordinatesMode;}get wrapU() {return this._wrapU;}set wrapU(value) {this._wrapU = value;}get wrapV() {return this._wrapV;}set wrapV(value) {this._wrapV = value;}get isCube() {return this._texture ? this._texture.isCube : this._isCube;}set isCube(value) {this._texture ? this._texture.isCube = value : this._isCube = value;}get is3D() {return !!this._texture && this._texture.is3D;}set is3D(value) {this._texture && (this._texture.is3D = value);}get is2DArray() {return !!this._texture && this._texture.is2DArray;}set is2DArray(value) {this._texture && (this._texture.is2DArray = value);}get gammaSpace() {return this._texture ? (null === this._texture._gammaSpace && (this._texture._gammaSpace = this._gammaSpace), this._texture._gammaSpace && !this._texture._useSRGBBuffer) : this._gammaSpace;}set gammaSpace(gamma) {if (!this._texture) {if (this._gammaSpace === gamma) return;this._gammaSpace = gamma;} else {if (this._texture._gammaSpace === gamma) return;this._texture._gammaSpace = gamma;}this._markAllSubMeshesAsTexturesDirty();}get isRGBD() {return null != this._texture && this._texture._isRGBD;}set isRGBD(value) {this._texture && (this._texture._isRGBD = value);}get noMipmap() {return !1;}get lodGenerationOffset() {return this._texture ? this._texture._lodGenerationOffset : 0;}set lodGenerationOffset(value) {this._texture && (this._texture._lodGenerationOffset = value);}get lodGenerationScale() {return this._texture ? this._texture._lodGenerationScale : 0;}set lodGenerationScale(value) {this._texture && (this._texture._lodGenerationScale = value);}get linearSpecularLOD() {return !!this._texture && this._texture._linearSpecularLOD;}set linearSpecularLOD(value) {this._texture && (this._texture._linearSpecularLOD = value);}get irradianceTexture() {return this._texture ? this._texture._irradianceTexture : null;}set irradianceTexture(value) {this._texture && (this._texture._irradianceTexture = value);}get uid() {return this._uid || (this._uid = (0,_Misc_guid_js__WEBPACK_IMPORTED_MODULE_5__/* .RandomGUID */ .f)()), this._uid;}toString() {return this.name;}getClassName() {return "BaseTexture";}set onDispose(callback) {this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(callback);}get isBlocking() {return !0;}get loadingError() {return this._loadingError;}get errorObject() {return this._errorObject;}constructor(sceneOrEngine, internalTexture = null) {super(null), this.metadata = null, this.reservedDataStore = null, this._hasAlpha = !1, this._getAlphaFromRGB = !1, this.level = 1, this._coordinatesIndex = 0, this.optimizeUVAllocation = !0, this._coordinatesMode = 0, this.wrapR = 1, this.anisotropicFilteringLevel = BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL, this._isCube = !1, this._gammaSpace = !0, this.invertZ = !1, this.lodLevelInAlpha = !1, this.isRenderTarget = !1, this._prefiltered = !1, this._forceSerialize = !1, this.animations = [], this.onDisposeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), this._onDisposeObserver = null, this._scene = null, this._uid = null, this._parentContainer = null, this._loadingError = !1, sceneOrEngine ? BaseTexture._IsScene(sceneOrEngine) ? this._scene = sceneOrEngine : this._engine = sceneOrEngine : this._scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, this._scene && (this.uniqueId = this._scene.getUniqueId(), this._scene.addTexture(this), this._engine = this._scene.getEngine()), this._texture = internalTexture, this._uid = null;}getScene() {return this._scene;}_getEngine() {return this._engine;}checkTransformsAreIdentical(texture) {return null !== texture;}getTextureMatrix() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.IdentityReadOnly */ .y3.IdentityReadOnly;}getReflectionTextureMatrix() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.IdentityReadOnly */ .y3.IdentityReadOnly;}isReadyOrNotBlocking() {return !this.isBlocking || this.isReady() || this.loadingError;}scale() {}get canRescale() {return !1;}_getFromCache(url, noMipmap, sampling, invertY, useSRGBBuffer, isCube) {const engine = this._getEngine();if (!engine) return null;const correctedUseSRGBBuffer = engine._getUseSRGBBuffer(!!useSRGBBuffer, noMipmap),texturesCache = engine.getLoadedTexturesCache();for (let index = 0; index < texturesCache.length; index++) {const texturesCacheEntry = texturesCache[index];if ((useSRGBBuffer === void 0 || correctedUseSRGBBuffer === texturesCacheEntry._useSRGBBuffer) && (void 0 === invertY || invertY === texturesCacheEntry.invertY) && texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap && (!sampling || sampling === texturesCacheEntry.samplingMode) && (void 0 === isCube || isCube === texturesCacheEntry.isCube)) return texturesCacheEntry.incrementReferences(), texturesCacheEntry;}return null;}_rebuild() {}clone() {return null;}get textureType() {return this._texture ? this._texture.type === void 0 ? 0 : this._texture.type : 0;}get textureFormat() {return this._texture ? this._texture.format === void 0 ? 5 : this._texture.format : 5;}_markAllSubMeshesAsTexturesDirty() {const scene = this.getScene();scene && scene.markAllMaterialsAsDirty(1);}readPixels(faceIndex = 0, level = 0, buffer = null, flushRenderer = !0, noDataConversion = !1, x = 0, y = 0, width = Number.MAX_VALUE, height = Number.MAX_VALUE) {if (!this._texture) return null;const engine = this._getEngine();if (!engine) return null;const size = this.getSize();let maxWidth = size.width,maxHeight = size.height;0 !== level && (maxWidth /= Math.pow(2, level), maxHeight /= Math.pow(2, level), maxWidth = Math.round(maxWidth), maxHeight = Math.round(maxHeight)), width = Math.min(maxWidth, width), height = Math.min(maxHeight, height);try {return this._texture.isCube ? engine._readTexturePixels(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion, x, y) : engine._readTexturePixels(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion, x, y);} catch (e) {return null;}}_readPixelsSync(faceIndex = 0, level = 0, buffer = null, flushRenderer = !0, noDataConversion = !1) {if (!this._texture) return null;const size = this.getSize();let width = size.width,height = size.height;const engine = this._getEngine();if (!engine) return null;0 != level && (width /= Math.pow(2, level), height /= Math.pow(2, level), width = Math.round(width), height = Math.round(height));try {return this._texture.isCube ? engine._readTexturePixelsSync(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion) : engine._readTexturePixelsSync(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion);} catch (e) {return null;}}get _lodTextureHigh() {return this._texture ? this._texture._lodTextureHigh : null;}get _lodTextureMid() {return this._texture ? this._texture._lodTextureMid : null;}get _lodTextureLow() {return this._texture ? this._texture._lodTextureLow : null;}dispose() {if (this._scene) {this._scene.stopAnimation && this._scene.stopAnimation(this), this._scene.removePendingData(this);const index = this._scene.textures.indexOf(this);if (0 <= index && this._scene.textures.splice(index, 1), this._scene.onTextureRemovedObservable.notifyObservers(this), this._scene = null, this._parentContainer) {const index = this._parentContainer.textures.indexOf(this);-1 < index && this._parentContainer.textures.splice(index, 1), this._parentContainer = null;}}this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.metadata = null, super.dispose();}serialize(allowEmptyName = !1) {if (!this.name && !allowEmptyName) return null;const serializationObject = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Serialize */ .p4.Serialize(this);return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.AppendSerializedAnimations */ .p4.AppendSerializedAnimations(this, serializationObject), serializationObject;}static WhenAllReady(textures, callback) {let numRemaining = textures.length;if (0 === numRemaining) return void callback();for (let i = 0; i < textures.length; i++) {const texture = textures[i];if (texture.isReady()) 0 == --numRemaining && callback();else {const onLoadObservable = texture.onLoadObservable;onLoadObservable ? onLoadObservable.addOnce(() => {0 == --numRemaining && callback();}) : 0 == --numRemaining && callback();}}}static _IsScene(sceneOrEngine) {return "Scene" === sceneOrEngine.getClassName();}}BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "uniqueId", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "name", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "metadata", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("hasAlpha")], BaseTexture.prototype, "_hasAlpha", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("getAlphaFromRGB")], BaseTexture.prototype, "_getAlphaFromRGB", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "level", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("coordinatesIndex")], BaseTexture.prototype, "_coordinatesIndex", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "optimizeUVAllocation", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("coordinatesMode")], BaseTexture.prototype, "_coordinatesMode", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "wrapU", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "wrapV", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "wrapR", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "anisotropicFilteringLevel", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "isCube", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "is3D", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "is2DArray", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "gammaSpace", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "invertZ", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "lodLevelInAlpha", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "lodGenerationOffset", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "lodGenerationScale", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "linearSpecularLOD", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)()], BaseTexture.prototype, "irradianceTexture", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], BaseTexture.prototype, "isRenderTarget", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Misc_HighDynamicRange_cubemapToSphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js");
/* harmony import */ var _baseTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js");
_baseTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .BaseTexture.prototype.forceSphericalPolynomialsRecompute */ .V.prototype.forceSphericalPolynomialsRecompute = function () {this._texture && (this._texture._sphericalPolynomial = null, this._texture._sphericalPolynomialPromise = null, this._texture._sphericalPolynomialComputed = !1);}, Object.defineProperty(_baseTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .BaseTexture.prototype */ .V.prototype, "sphericalPolynomial", { get: function () {if (this._texture) {if (this._texture._sphericalPolynomial || this._texture._sphericalPolynomialComputed) return this._texture._sphericalPolynomial;if (this._texture.isReady) return this._texture._sphericalPolynomialPromise || (this._texture._sphericalPolynomialPromise = _Misc_HighDynamicRange_cubemapToSphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_0__/* .CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial */ .$.ConvertCubeMapTextureToSphericalPolynomial(this), null === this._texture._sphericalPolynomialPromise ? this._texture._sphericalPolynomialComputed = !0 : this._texture._sphericalPolynomialPromise.then((sphericalPolynomial) => {this._texture._sphericalPolynomial = sphericalPolynomial, this._texture._sphericalPolynomialComputed = !0;})), null;}return null;}, set: function (value) {this._texture && (this._texture._sphericalPolynomial = value);}, enumerable: !0, configurable: !0 });

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/cubeTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "B": () => (/* binding */ CubeTexture)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js");
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
/* harmony import */ var _Engines_Extensions_engine_cubeTexture_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.cubeTexture.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
class CubeTexture extends _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__/* .BaseTexture */ .V {set boundingBoxSize(value) {if (!(this._boundingBoxSize && this._boundingBoxSize.equals(value))) {this._boundingBoxSize = value;const scene = this.getScene();scene && scene.markAllMaterialsAsDirty(1);}}get boundingBoxSize() {return this._boundingBoxSize;}set rotationY(value) {this._rotationY = value, this.setReflectionTextureMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.RotationY */ .y3.RotationY(this._rotationY));}get rotationY() {return this._rotationY;}get noMipmap() {return this._noMipmap;}get forcedExtension() {return this._forcedExtension;}static CreateFromImages(files, scene, noMipmap) {let rootUrlKey = "";return files.forEach((url) => rootUrlKey += url), new CubeTexture(rootUrlKey, scene, null, noMipmap, files);}static CreateFromPrefilteredData(url, scene, forcedExtension = null, createPolynomials = !0) {const oldValue = scene.useDelayedTextureLoading;scene.useDelayedTextureLoading = !1;const result = new CubeTexture(url, scene, null, !1, null, null, null, void 0, !0, forcedExtension, createPolynomials);return scene.useDelayedTextureLoading = oldValue, result;}constructor(rootUrl, sceneOrEngine, extensions = null, noMipmap = !1, files = null, onLoad = null, onError = null, format = 5, prefiltered = !1, forcedExtension = null, createPolynomials = !1, lodScale = .8, lodOffset = 0, loaderOptions, useSRGBBuffer) {var _a;super(sceneOrEngine), this._lodScale = .8, this._lodOffset = 0, this.onLoadObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_8__/* .Observable */ .y$(), this.boundingBoxPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._rotationY = 0, this._files = null, this._forcedExtension = null, this._extensions = null, this.name = rootUrl, this.url = rootUrl, this._noMipmap = noMipmap, this.hasAlpha = !1, this._format = format, this.isCube = !0, this._textureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Identity */ .y3.Identity(), this._createPolynomials = createPolynomials, this.coordinatesMode = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_5__/* .Texture.CUBIC_MODE */ .x.CUBIC_MODE, this._extensions = extensions, this._files = files, this._forcedExtension = forcedExtension, this._loaderOptions = loaderOptions, this._useSRGBBuffer = useSRGBBuffer, this._lodScale = lodScale, this._lodOffset = lodOffset;(rootUrl || files) && this.updateURL(rootUrl, forcedExtension, onLoad, prefiltered, onError, extensions, null === (_a = this.getScene()) || void 0 === _a ? void 0 : _a.useDelayedTextureLoading, files);}getClassName() {return "CubeTexture";}updateURL(url, forcedExtension, onLoad = null, prefiltered = !1, onError = null, extensions = null, delayLoad = !1, files = null) {(!this.name || this.name.startsWith("data:")) && (this.name = url), this.url = url, forcedExtension && (this._forcedExtension = forcedExtension);const lastDot = url.lastIndexOf("."),extension = forcedExtension ? forcedExtension : -1 < lastDot ? url.substring(lastDot).toLowerCase() : "",isDDS = 0 === extension.indexOf(".dds"),isEnv = 0 === extension.indexOf(".env"),isBasis = 0 === extension.indexOf(".basis");if (isEnv ? (this.gammaSpace = !1, this._prefiltered = !1, this.anisotropicFilteringLevel = 1) : (this._prefiltered = prefiltered, prefiltered && (this.gammaSpace = !1, this.anisotropicFilteringLevel = 1)), files) this._files = files;else if (isBasis || isEnv || isDDS || extensions || (extensions = ["_px.jpg", "_py.jpg", "_pz.jpg", "_nx.jpg", "_ny.jpg", "_nz.jpg"]), this._files = this._files || [], this._files.length = 0, extensions) {for (let index = 0; index < extensions.length; index++) this._files.push(url + extensions[index]);this._extensions = extensions;}delayLoad ? (this.delayLoadState = 4, this._delayedOnLoad = onLoad, this._delayedOnError = onError) : this._loadTexture(onLoad, onError);}delayLoad(forcedExtension) {4 !== this.delayLoadState || (forcedExtension && (this._forcedExtension = forcedExtension), this.delayLoadState = 1, this._loadTexture(this._delayedOnLoad, this._delayedOnError));}getReflectionTextureMatrix() {return this._textureMatrix;}setReflectionTextureMatrix(value) {var _a;value.updateFlag === this._textureMatrix.updateFlag || (value.isIdentity() !== this._textureMatrix.isIdentity() && (null === (_a = this.getScene()) || void 0 === _a ? void 0 : _a.markAllMaterialsAsDirty(1, (mat) => -1 !== mat.getActiveTextures().indexOf(this))), this._textureMatrix = value);}_loadTexture(onLoad = null, onError = null) {var _a;const scene = this.getScene(),oldTexture = this._texture;this._texture = this._getFromCache(this.url, this._noMipmap, void 0, void 0, this._useSRGBBuffer, this.isCube);const onLoadProcessing = () => {var _a;this.onLoadObservable.notifyObservers(this), oldTexture && (oldTexture.dispose(), null === (_a = this.getScene()) || void 0 === _a ? void 0 : _a.markAllMaterialsAsDirty(1)), onLoad && onLoad();},errorHandler = (message, exception) => {this._loadingError = !0, this._errorObject = { message, exception }, onError && onError(message, exception), _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_5__/* .Texture.OnTextureLoadErrorObservable.notifyObservers */ .x.OnTextureLoadErrorObservable.notifyObservers(this);};this._texture ? this._texture.isReady ? _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.SetImmediate */ .w1.SetImmediate(() => onLoadProcessing()) : this._texture.onLoadedObservable.add(() => onLoadProcessing()) : (this._texture = this._prefiltered ? this._getEngine().createPrefilteredCubeTexture(this.url, scene, this._lodScale, this._lodOffset, onLoad, errorHandler, this._format, this._forcedExtension, this._createPolynomials) : this._getEngine().createCubeTexture(this.url, scene, this._files, this._noMipmap, onLoad, errorHandler, this._format, this._forcedExtension, !1, this._lodScale, this._lodOffset, null, this._loaderOptions, !!this._useSRGBBuffer), null === (_a = this._texture) || void 0 === _a ? void 0 : _a.onLoadedObservable.add(() => this.onLoadObservable.notifyObservers(this)));}static Parse(parsedTexture, scene, rootUrl) {const texture = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(() => {let prefiltered = !1;return parsedTexture.prefiltered && (prefiltered = parsedTexture.prefiltered), new CubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.extensions, !1, parsedTexture.files || null, null, null, void 0, prefiltered, parsedTexture.forcedExtension);}, parsedTexture, scene);if (parsedTexture.boundingBoxPosition && (texture.boundingBoxPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.FromArray */ .P.FromArray(parsedTexture.boundingBoxPosition)), parsedTexture.boundingBoxSize && (texture.boundingBoxSize = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.FromArray */ .P.FromArray(parsedTexture.boundingBoxSize)), parsedTexture.animations) for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {const parsedAnimation = parsedTexture.animations[animationIndex],internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .GetClass */ .q)("BABYLON.Animation");internalClass && texture.animations.push(internalClass.Parse(parsedAnimation));}return texture;}clone() {let uniqueId = 0;const newCubeTexture = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Clone */ .p4.Clone(() => {const cubeTexture = new CubeTexture(this.url, this.getScene() || this._getEngine(), this._extensions, this._noMipmap, this._files);return uniqueId = cubeTexture.uniqueId, cubeTexture;}, this);return newCubeTexture.uniqueId = uniqueId, newCubeTexture;}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], CubeTexture.prototype, "url", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("rotationY")], CubeTexture.prototype, "rotationY", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("files")], CubeTexture.prototype, "_files", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("forcedExtension")], CubeTexture.prototype, "_forcedExtension", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("extensions")], CubeTexture.prototype, "_extensions", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsMatrix */ .oQ)("textureMatrix")], CubeTexture.prototype, "_textureMatrix", void 0), _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_5__/* .Texture._CubeTextureParser */ .x._CubeTextureParser = CubeTexture.Parse, (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .RegisterClass */ .H)("BABYLON.CubeTexture", CubeTexture);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/htmlElementTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "s": () => (/* binding */ HtmlElementTexture)
/* harmony export */ });
/* harmony import */ var _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Engines_Extensions_engine_dynamicTexture_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicTexture.js");
/* harmony import */ var _Engines_Extensions_engine_videoTexture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.videoTexture.js");
class HtmlElementTexture extends _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .BaseTexture */ .V {constructor(name, element, options) {var _a, _b;super(options.scene || options.engine), this.onLoadObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$();element && (options.engine || options.scene) && (options = { ...HtmlElementTexture._DefaultOptions, ...options }, this._generateMipMaps = options.generateMipMaps, this._samplingMode = options.samplingMode, this._textureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.Identity */ .y3.Identity(), this._format = options.format, this.name = name, this.element = element, this._isVideo = !!element.getVideoPlaybackQuality, this._externalTexture = this._isVideo ? null !== (_b = null === (_a = this._engine) || void 0 === _a ? void 0 : _a.createExternalTexture(element)) && void 0 !== _b ? _b : null : null, this.anisotropicFilteringLevel = 1, this._createInternalTexture());}_createInternalTexture() {let width = 0,height = 0;this._isVideo ? (width = this.element.videoWidth, height = this.element.videoHeight) : (width = this.element.width, height = this.element.height);const engine = this._getEngine();engine && (this._texture = engine.createDynamicTexture(width, height, this._generateMipMaps, this._samplingMode), this._texture.format = this._format), this.update();}getTextureMatrix() {return this._textureMatrix;}update(invertY = null) {const engine = this._getEngine();if (null != this._texture && null != engine) {const wasReady = this.isReady();if (this._isVideo) {const videoElement = this.element;if (videoElement.readyState < videoElement.HAVE_CURRENT_DATA) return;engine.updateVideoTexture(this._texture, this._externalTexture ? this._externalTexture : videoElement, null === invertY || invertY);} else {const canvasElement = this.element;engine.updateDynamicTexture(this._texture, canvasElement, null === invertY || invertY, !1, this._format);}!wasReady && this.isReady() && this.onLoadObservable.notifyObservers(this);}}dispose() {this.onLoadObservable.clear(), super.dispose();}}HtmlElementTexture._DefaultOptions = { generateMipMaps: !1, samplingMode: 2, format: 5, engine: null, scene: null };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "S": () => (/* binding */ InternalTextureSource),
/* harmony export */   "l": () => (/* binding */ InternalTexture)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _textureSampler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/textureSampler.js");
var InternalTextureSource;(function (InternalTextureSource) {InternalTextureSource[InternalTextureSource.Unknown = 0] = "Unknown", InternalTextureSource[InternalTextureSource.Url = 1] = "Url", InternalTextureSource[InternalTextureSource.Temp = 2] = "Temp", InternalTextureSource[InternalTextureSource.Raw = 3] = "Raw", InternalTextureSource[InternalTextureSource.Dynamic = 4] = "Dynamic", InternalTextureSource[InternalTextureSource.RenderTarget = 5] = "RenderTarget", InternalTextureSource[InternalTextureSource.MultiRenderTarget = 6] = "MultiRenderTarget", InternalTextureSource[InternalTextureSource.Cube = 7] = "Cube", InternalTextureSource[InternalTextureSource.CubeRaw = 8] = "CubeRaw", InternalTextureSource[InternalTextureSource.CubePrefiltered = 9] = "CubePrefiltered", InternalTextureSource[InternalTextureSource.Raw3D = 10] = "Raw3D", InternalTextureSource[InternalTextureSource.Raw2DArray = 11] = "Raw2DArray", InternalTextureSource[InternalTextureSource.DepthStencil = 12] = "DepthStencil", InternalTextureSource[InternalTextureSource.CubeRawRGBD = 13] = "CubeRawRGBD", InternalTextureSource[InternalTextureSource.Depth = 14] = "Depth";})(InternalTextureSource || (InternalTextureSource = {}));class InternalTexture extends _textureSampler_js__WEBPACK_IMPORTED_MODULE_1__/* .TextureSampler */ .a {get useMipMaps() {return this.generateMipMaps;}set useMipMaps(value) {this.generateMipMaps = value;}get uniqueId() {return this._uniqueId;}_setUniqueId(id) {this._uniqueId = id;}getEngine() {return this._engine;}get source() {return this._source;}constructor(engine, source, delayAllocation = !1) {super(), this.isReady = !1, this.isCube = !1, this.is3D = !1, this.is2DArray = !1, this.isMultiview = !1, this.url = "", this.generateMipMaps = !1, this.samples = 0, this.type = -1, this.format = -1, this.onLoadedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onErrorObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onRebuildCallback = null, this.width = 0, this.height = 0, this.depth = 0, this.baseWidth = 0, this.baseHeight = 0, this.baseDepth = 0, this.invertY = !1, this._invertVScale = !1, this._associatedChannel = -1, this._source = InternalTextureSource.Unknown, this._buffer = null, this._bufferView = null, this._bufferViewArray = null, this._bufferViewArrayArray = null, this._size = 0, this._extension = "", this._files = null, this._workingCanvas = null, this._workingContext = null, this._cachedCoordinatesMode = null, this._isDisabled = !1, this._compression = null, this._sphericalPolynomial = null, this._sphericalPolynomialPromise = null, this._sphericalPolynomialComputed = !1, this._lodGenerationScale = 0, this._lodGenerationOffset = 0, this._useSRGBBuffer = !1, this._lodTextureHigh = null, this._lodTextureMid = null, this._lodTextureLow = null, this._isRGBD = !1, this._linearSpecularLOD = !1, this._irradianceTexture = null, this._hardwareTexture = null, this._maxLodLevel = null, this._references = 1, this._gammaSpace = null, this._engine = engine, this._source = source, this._uniqueId = InternalTexture._Counter++, delayAllocation || (this._hardwareTexture = engine._createHardwareTexture());}incrementReferences() {this._references++;}updateSize(width, height, depth = 1) {this._engine.updateTextureDimensions(this, width, height, depth), this.width = width, this.height = height, this.depth = depth, this.baseWidth = width, this.baseHeight = height, this.baseDepth = depth, this._size = width * height * depth;}_rebuild() {var _a;if (this.isReady = !1, this._cachedCoordinatesMode = null, this._cachedWrapU = null, this._cachedWrapV = null, this._cachedWrapR = null, this._cachedAnisotropicFilteringLevel = null, this.onRebuildCallback) {const data = this.onRebuildCallback(this),swapAndSetIsReady = (proxyInternalTexture) => {proxyInternalTexture._swapAndDie(this, !1), this.isReady = data.isReady;};return void (data.isAsync ? data.proxy.then(swapAndSetIsReady) : swapAndSetIsReady(data.proxy));}let proxy;switch (this.source) {case InternalTextureSource.Temp:break;case InternalTextureSource.Url:return void (proxy = this._engine.createTexture(null !== (_a = this._originalUrl) && void 0 !== _a ? _a : this.url, !this.generateMipMaps, this.invertY, null, this.samplingMode, (temp) => {temp._swapAndDie(this, !1), this.isReady = !0;}, null, this._buffer, void 0, this.format, this._extension, void 0, void 0, void 0, this._useSRGBBuffer));case InternalTextureSource.Raw:proxy = this._engine.createRawTexture(this._bufferView, this.baseWidth, this.baseHeight, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type, void 0, this._useSRGBBuffer), proxy._swapAndDie(this, !1), this.isReady = !0;break;case InternalTextureSource.Raw3D:proxy = this._engine.createRawTexture3D(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type), proxy._swapAndDie(this, !1), this.isReady = !0;break;case InternalTextureSource.Raw2DArray:proxy = this._engine.createRawTexture2DArray(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type), proxy._swapAndDie(this, !1), this.isReady = !0;break;case InternalTextureSource.Dynamic:proxy = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode), proxy._swapAndDie(this, !1), this._engine.updateDynamicTexture(this, this._engine.getRenderingCanvas(), this.invertY, void 0, void 0, !0);break;case InternalTextureSource.Cube:return void (proxy = this._engine.createCubeTexture(this.url, null, this._files, !this.generateMipMaps, () => {proxy._swapAndDie(this, !1), this.isReady = !0;}, null, this.format, this._extension, !1, 0, 0, null, void 0, this._useSRGBBuffer));case InternalTextureSource.CubeRaw:proxy = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression), proxy._swapAndDie(this, !1), this.isReady = !0;break;case InternalTextureSource.CubeRawRGBD:return;case InternalTextureSource.CubePrefiltered:return proxy = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, (proxy) => {proxy && proxy._swapAndDie(this, !1), this.isReady = !0;}, null, this.format, this._extension), void (proxy._sphericalPolynomial = this._sphericalPolynomial);}}_swapAndDie(target, swapAll = !0) {var _a;null === (_a = this._hardwareTexture) || void 0 === _a ? void 0 : _a.setUsage(target._source, this.generateMipMaps, this.isCube, this.width, this.height), target._hardwareTexture = this._hardwareTexture, swapAll && (target._isRGBD = this._isRGBD), this._lodTextureHigh && (target._lodTextureHigh && target._lodTextureHigh.dispose(), target._lodTextureHigh = this._lodTextureHigh), this._lodTextureMid && (target._lodTextureMid && target._lodTextureMid.dispose(), target._lodTextureMid = this._lodTextureMid), this._lodTextureLow && (target._lodTextureLow && target._lodTextureLow.dispose(), target._lodTextureLow = this._lodTextureLow), this._irradianceTexture && (target._irradianceTexture && target._irradianceTexture.dispose(), target._irradianceTexture = this._irradianceTexture);const cache = this._engine.getLoadedTexturesCache();let index = cache.indexOf(this);-1 !== index && cache.splice(index, 1), index = cache.indexOf(target), -1 === index && cache.push(target);}dispose() {this._references--, this.onLoadedObservable.clear(), this.onErrorObservable.clear(), 0 === this._references && (this._engine._releaseTexture(this), this._hardwareTexture = null);}}InternalTexture._Counter = 0;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/rawCubeTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "N": () => (/* binding */ RawCubeTexture)
/* harmony export */ });
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_environmentTextureTools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/environmentTextureTools.js");
/* harmony import */ var _internalTexture_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
/* harmony import */ var _cubeTexture_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/cubeTexture.js");
/* harmony import */ var _Engines_Extensions_engine_rawTexture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.rawTexture.js");
class RawCubeTexture extends _cubeTexture_js__WEBPACK_IMPORTED_MODULE_3__/* .CubeTexture */ .B {constructor(scene, data, size, format = 5, type = 0, generateMipMaps = !1, invertY = !1, samplingMode = 3, compression = null) {super("", scene), this._texture = scene.getEngine().createRawCubeTexture(data, size, format, type, generateMipMaps, invertY, samplingMode, compression);}update(data, format, type, invertY, compression = null) {this._texture.getEngine().updateRawCubeTexture(this._texture, data, format, type, invertY, compression);}updateRGBDAsync(data, sphericalPolynomial = null, lodScale = .8, lodOffset = 0) {return (0,_Misc_environmentTextureTools_js__WEBPACK_IMPORTED_MODULE_1__/* ._UpdateRGBDAsync */ .Lf)(this._texture, data, sphericalPolynomial, lodScale, lodOffset).then(() => {});}clone() {return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper.Clone */ .p4.Clone(() => {const scene = this.getScene(),internalTexture = this._texture,texture = new RawCubeTexture(scene, internalTexture._bufferViewArray, internalTexture.width, internalTexture.format, internalTexture.type, internalTexture.generateMipMaps, internalTexture.invertY, internalTexture.samplingMode, internalTexture._compression);return internalTexture.source === _internalTexture_js__WEBPACK_IMPORTED_MODULE_2__/* .InternalTextureSource.CubeRawRGBD */ .S.CubeRawRGBD && texture.updateRGBDAsync(internalTexture._bufferViewArrayArray, internalTexture._sphericalPolynomial, internalTexture._lodGenerationScale, internalTexture._lodGenerationOffset), texture;}, this);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/rawTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "l": () => (/* binding */ RawTexture)
/* harmony export */ });
/* harmony import */ var _texture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
/* harmony import */ var _Engines_Extensions_engine_rawTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.rawTexture.js");
class RawTexture extends _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .x {constructor(data, width, height, format, sceneOrEngine, generateMipMaps = !0, invertY = !1, samplingMode = 3, type = 0, creationFlags, useSRGBBuffer) {super(null, sceneOrEngine, !generateMipMaps, invertY, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, creationFlags), this.format = format;this._engine && (!this._engine._caps.textureFloatLinearFiltering && 1 === type && (samplingMode = 1), !this._engine._caps.textureHalfFloatLinearFiltering && 2 === type && (samplingMode = 1), this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, null !== creationFlags && void 0 !== creationFlags ? creationFlags : 0, !(null === useSRGBBuffer || void 0 === useSRGBBuffer) && useSRGBBuffer), this.wrapU = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.CLAMP_ADDRESSMODE */ .x.CLAMP_ADDRESSMODE, this.wrapV = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.CLAMP_ADDRESSMODE */ .x.CLAMP_ADDRESSMODE);}update(data) {this._getEngine().updateRawTexture(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type, this._texture._useSRGBBuffer);}static CreateLuminanceTexture(data, width, height, sceneOrEngine, generateMipMaps = !0, invertY = !1, samplingMode = 3) {return new RawTexture(data, width, height, 1, sceneOrEngine, generateMipMaps, invertY, samplingMode);}static CreateLuminanceAlphaTexture(data, width, height, sceneOrEngine, generateMipMaps = !0, invertY = !1, samplingMode = 3) {return new RawTexture(data, width, height, 2, sceneOrEngine, generateMipMaps, invertY, samplingMode);}static CreateAlphaTexture(data, width, height, sceneOrEngine, generateMipMaps = !0, invertY = !1, samplingMode = 3) {return new RawTexture(data, width, height, 0, sceneOrEngine, generateMipMaps, invertY, samplingMode);}static CreateRGBTexture(data, width, height, sceneOrEngine, generateMipMaps = !0, invertY = !1, samplingMode = 3, type = 0, creationFlags = 0, useSRGBBuffer = !1) {return new RawTexture(data, width, height, 4, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);}static CreateRGBATexture(data, width, height, sceneOrEngine, generateMipMaps = !0, invertY = !1, samplingMode = 3, type = 0, creationFlags = 0, useSRGBBuffer = !1) {return new RawTexture(data, width, height, 5, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);}static CreateRGBAStorageTexture(data, width, height, sceneOrEngine, generateMipMaps = !0, invertY = !1, samplingMode = 3, type = 0, useSRGBBuffer = !1) {return new RawTexture(data, width, height, 5, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, 1, useSRGBBuffer);}static CreateRTexture(data, width, height, sceneOrEngine, generateMipMaps = !0, invertY = !1, samplingMode = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.TRILINEAR_SAMPLINGMODE */ .x.TRILINEAR_SAMPLINGMODE, type = 1) {return new RawTexture(data, width, height, 6, sceneOrEngine, generateMipMaps, invertY, samplingMode, type);}static CreateRStorageTexture(data, width, height, sceneOrEngine, generateMipMaps = !0, invertY = !1, samplingMode = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.TRILINEAR_SAMPLINGMODE */ .x.TRILINEAR_SAMPLINGMODE, type = 1) {return new RawTexture(data, width, height, 6, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, 1);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/rawTexture2DArray.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "e": () => (/* binding */ RawTexture2DArray)
/* harmony export */ });
/* harmony import */ var _texture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
/* harmony import */ var _Engines_Extensions_engine_rawTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.rawTexture.js");
class RawTexture2DArray extends _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .x {get depth() {return this._depth;}constructor(data, width, height, depth, format, scene, generateMipMaps = !0, invertY = !1, samplingMode = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.TRILINEAR_SAMPLINGMODE */ .x.TRILINEAR_SAMPLINGMODE, textureType = 0) {super(null, scene, !generateMipMaps, invertY), this.format = format, this._texture = scene.getEngine().createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType), this._depth = depth, this.is2DArray = !0;}update(data) {this._texture && this._getEngine().updateRawTexture2DArray(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);}static CreateRGBATexture(data, width, height, depth, scene, generateMipMaps = !0, invertY = !1, samplingMode = 3, type = 0) {return new RawTexture2DArray(data, width, height, depth, 5, scene, generateMipMaps, invertY, samplingMode, type);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "_": () => (/* binding */ RenderTargetTexture)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
/* harmony import */ var _PostProcesses_postProcessManager_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/postProcessManager.js");
/* harmony import */ var _Rendering_renderingManager_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Rendering/renderingManager.js");
/* harmony import */ var _Engines_Extensions_engine_renderTarget_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js");
/* harmony import */ var _Engines_Extensions_engine_renderTargetCube_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetCube.js");
/* harmony import */ var _Engines_engine_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engine.js");
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/arrayTools.js");
/* harmony import */ var _Misc_dumpTools_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/dumpTools.js");
class RenderTargetTexture extends _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .x {get renderList() {return this._renderList;}set renderList(value) {this._unObserveRenderList && (this._unObserveRenderList(), this._unObserveRenderList = null), value && (this._unObserveRenderList = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_8__/* ._ObserveArray */ .M)(value, this._renderListHasChanged)), this._renderList = value;}get postProcesses() {return this._postProcesses;}get _prePassEnabled() {return !!this._prePassRenderTarget && this._prePassRenderTarget.enabled;}set onAfterUnbind(callback) {this._onAfterUnbindObserver && this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver), this._onAfterUnbindObserver = this.onAfterUnbindObservable.add(callback);}set onBeforeRender(callback) {this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);}set onAfterRender(callback) {this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);}set onClear(callback) {this._onClearObserver && this.onClearObservable.remove(this._onClearObserver), this._onClearObserver = this.onClearObservable.add(callback);}get renderPassIds() {return this._renderPassIds;}get currentRefreshId() {return this._currentRefreshId;}setMaterialForRendering(mesh, material) {let meshes = Array.isArray(mesh) ? mesh : [mesh];for (let j = 0; j < meshes.length; ++j) for (let i = 0; i < this._renderPassIds.length; ++i) meshes[j].setMaterialForRenderPass(this._renderPassIds[i], material === void 0 ? void 0 : Array.isArray(material) ? material[i] : material);}get renderTargetOptions() {return this._renderTargetOptions;}get renderTarget() {return this._renderTarget;}_onRatioRescale() {this._sizeRatio && this.resize(this._initialSizeParameter);}set boundingBoxSize(value) {if (!(this._boundingBoxSize && this._boundingBoxSize.equals(value))) {this._boundingBoxSize = value;const scene = this.getScene();scene && scene.markAllMaterialsAsDirty(1);}}get boundingBoxSize() {return this._boundingBoxSize;}get depthStencilTexture() {var _a, _b;return null !== (_b = null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a._depthStencilTexture) && void 0 !== _b ? _b : null;}constructor(name, size, scene, generateMipMaps = !1, doNotChangeAspectRatio = !0, type = 0, isCube = !1, samplingMode = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture.TRILINEAR_SAMPLINGMODE */ .x.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = !0, generateStencilBuffer = !1, isMulti = !1, format = 5, delayAllocation = !1, samples, creationFlags, noColorAttachment = !1, useSRGBBuffer = !1) {var _a, _b, _c, _d, _e, _f;let colorAttachment;if ("object" == typeof generateMipMaps) {const options = generateMipMaps;generateMipMaps = !!options.generateMipMaps, doNotChangeAspectRatio = null === (_a = options.doNotChangeAspectRatio) || void 0 === _a || _a, type = null !== (_b = options.type) && void 0 !== _b ? _b : 0, isCube = !!options.isCube, samplingMode = null !== (_c = options.samplingMode) && void 0 !== _c ? _c : _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture.TRILINEAR_SAMPLINGMODE */ .x.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = null === (_d = options.generateDepthBuffer) || void 0 === _d || _d, generateStencilBuffer = !!options.generateStencilBuffer, isMulti = !!options.isMulti, format = null !== (_e = options.format) && void 0 !== _e ? _e : 5, delayAllocation = !!options.delayAllocation, samples = options.samples, creationFlags = options.creationFlags, noColorAttachment = !!options.noColorAttachment, useSRGBBuffer = !!options.useSRGBBuffer, colorAttachment = options.colorAttachment;}if (super(null, scene, !generateMipMaps, void 0, samplingMode, void 0, void 0, void 0, void 0, format), this._unObserveRenderList = null, this._renderListHasChanged = (_functionName, previousLength) => {var _a;const newLength = this._renderList ? this._renderList.length : 0;(0 === previousLength && 0 < newLength || 0 === newLength) && (null === (_a = this.getScene()) || void 0 === _a ? void 0 : _a.meshes.forEach((mesh) => {mesh._markSubMeshesAsLightDirty();}));}, this.renderParticles = !0, this.renderSprites = !1, this.forceLayerMaskCheck = !1, this.ignoreCameraViewport = !1, this.onBeforeBindObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onAfterUnbindObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onBeforeRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onAfterRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onClearObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onResizeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this._cleared = !1, this.skipInitialClear = !1, this._currentRefreshId = -1, this._refreshRate = 1, this._samples = 1, this._canRescale = !0, this._renderTarget = null, this.boundingBoxPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), scene = this.getScene(), !!scene) {const engine = this.getScene().getEngine();this._coordinatesMode = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture.PROJECTION_MODE */ .x.PROJECTION_MODE, this.renderList = [], this.name = name, this.isRenderTarget = !0, this._initialSizeParameter = size, this._renderPassIds = [], this._isCubeData = isCube, this._processSizeParameter(size), this.renderPassId = this._renderPassIds[0], this._resizeObserver = engine.onResizeObservable.add(() => {}), this._generateMipMaps = !!generateMipMaps, this._doNotChangeAspectRatio = doNotChangeAspectRatio, this._renderingManager = new _Rendering_renderingManager_js__WEBPACK_IMPORTED_MODULE_4__/* .RenderingManager */ .$(scene), this._renderingManager._useSceneAutoClearSetup = !0, isMulti || (this._renderTargetOptions = { generateMipMaps: generateMipMaps, type: type, format: null !== (_f = this._format) && void 0 !== _f ? _f : void 0, samplingMode: this.samplingMode, generateDepthBuffer: generateDepthBuffer, generateStencilBuffer: generateStencilBuffer, samples, creationFlags, noColorAttachment: noColorAttachment, useSRGBBuffer, colorAttachment: colorAttachment }, this.samplingMode === _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture.NEAREST_SAMPLINGMODE */ .x.NEAREST_SAMPLINGMODE && (this.wrapU = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture.CLAMP_ADDRESSMODE */ .x.CLAMP_ADDRESSMODE, this.wrapV = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture.CLAMP_ADDRESSMODE */ .x.CLAMP_ADDRESSMODE), !delayAllocation && (isCube ? (this._renderTarget = scene.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions), this.coordinatesMode = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture.INVCUBIC_MODE */ .x.INVCUBIC_MODE, this._textureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.Identity */ .y3.Identity()) : this._renderTarget = scene.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions), this._texture = this._renderTarget.texture, void 0 !== samples && (this.samples = samples)));}}createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = !0, generateStencil = !1, samples = 1, format = 14) {var _a;null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a.createDepthStencilTexture(comparisonFunction, bilinearFiltering, generateStencil, samples, format);}_releaseRenderPassId() {if (this._scene) {const engine = this._scene.getEngine();for (let i = 0; i < this._renderPassIds.length; ++i) engine.releaseRenderPassId(this._renderPassIds[i]);}this._renderPassIds = [];}_createRenderPassId() {this._releaseRenderPassId();const engine = this._scene.getEngine(),numPasses = this._isCubeData ? 6 : this.getRenderLayers() || 1;for (let i = 0; i < numPasses; ++i) this._renderPassIds[i] = engine.createRenderPassId(`RenderTargetTexture - ${this.name}#${i}`);}_processSizeParameter(size) {if (size.ratio) {this._sizeRatio = size.ratio;const engine = this._getEngine();this._size = { width: this._bestReflectionRenderTargetDimension(engine.getRenderWidth(), this._sizeRatio), height: this._bestReflectionRenderTargetDimension(engine.getRenderHeight(), this._sizeRatio) };} else this._size = size;this._createRenderPassId();}get samples() {var _a, _b;return null !== (_b = null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a.samples) && void 0 !== _b ? _b : this._samples;}set samples(value) {this._renderTarget && (this._samples = this._renderTarget.setSamples(value));}resetRefreshCounter() {this._currentRefreshId = -1;}get refreshRate() {return this._refreshRate;}set refreshRate(value) {this._refreshRate = value, this.resetRefreshCounter();}addPostProcess(postProcess) {if (!this._postProcessManager) {const scene = this.getScene();if (!scene) return;this._postProcessManager = new _PostProcesses_postProcessManager_js__WEBPACK_IMPORTED_MODULE_3__/* .PostProcessManager */ .O(scene), this._postProcesses = [];}this._postProcesses.push(postProcess), this._postProcesses[0].autoClear = !1;}clearPostProcesses(dispose = !1) {if (this._postProcesses) {if (dispose) for (const postProcess of this._postProcesses) postProcess.dispose();this._postProcesses = [];}}removePostProcess(postProcess) {if (this._postProcesses) {const index = this._postProcesses.indexOf(postProcess);-1 === index || (this._postProcesses.splice(index, 1), 0 < this._postProcesses.length && (this._postProcesses[0].autoClear = !1));}}_shouldRender() {return -1 === this._currentRefreshId ? (this._currentRefreshId = 1, !0) : this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, !0) : (this._currentRefreshId++, !1);}getRenderSize() {return this.getRenderWidth();}getRenderWidth() {return this._size.width ? this._size.width : this._size;}getRenderHeight() {return this._size.width ? this._size.height : this._size;}getRenderLayers() {const layers = this._size.layers;return layers ? layers : 0;}disableRescaling() {this._canRescale = !1;}get canRescale() {return this._canRescale;}scale(ratio) {const newSize = Math.max(1, this.getRenderSize() * ratio);this.resize(newSize);}getReflectionTextureMatrix() {return this.isCube ? this._textureMatrix : super.getReflectionTextureMatrix();}resize(size) {var _a;const wasCube = this.isCube;null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a.dispose(), this._renderTarget = null;const scene = this.getScene();scene && (this._processSizeParameter(size), this._renderTarget = wasCube ? scene.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions) : scene.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions), this._texture = this._renderTarget.texture, this._renderTargetOptions.samples !== void 0 && (this.samples = this._renderTargetOptions.samples), this.onResizeObservable.hasObservers() && this.onResizeObservable.notifyObservers(this));}render(useCameraPostProcess = !1, dumpForDebug = !1) {this._render(useCameraPostProcess, dumpForDebug);}isReadyForRendering() {return this._render(!1, !1, !0);}_render(useCameraPostProcess = !1, dumpForDebug = !1, checkReadiness = !1) {var _a;const scene = this.getScene();if (!scene) return checkReadiness;const engine = scene.getEngine();if (void 0 !== this.useCameraPostProcesses && (useCameraPostProcess = this.useCameraPostProcesses), this._waitingRenderList) {this.renderList = [];for (let index = 0; index < this._waitingRenderList.length; index++) {const id = this._waitingRenderList[index],mesh = scene.getMeshById(id);mesh && this.renderList.push(mesh);}this._waitingRenderList = void 0;}if (this.renderListPredicate) {this.renderList ? this.renderList.length = 0 : this.renderList = [];const scene = this.getScene();if (!scene) return checkReadiness;const sceneMeshes = scene.meshes;for (let index = 0; index < sceneMeshes.length; index++) {const mesh = sceneMeshes[index];this.renderListPredicate(mesh) && this.renderList.push(mesh);}}const currentRenderPassId = engine.currentRenderPassId;this.onBeforeBindObservable.notifyObservers(this);const camera = null !== (_a = this.activeCamera) && void 0 !== _a ? _a : scene.activeCamera,sceneCamera = scene.activeCamera;camera && (camera !== scene.activeCamera && (scene.setTransformMatrix(camera.getViewMatrix(), camera.getProjectionMatrix(!0)), scene.activeCamera = camera), engine.setViewport(camera.viewport, this.getRenderWidth(), this.getRenderHeight())), this._defaultRenderListPrepared = !1;let returnValue = checkReadiness;if (!!checkReadiness) {scene.getViewMatrix() || scene.updateTransformMatrix();const numLayers = this.is2DArray ? this.getRenderLayers() : this.isCube ? 6 : 1;for (let currentRenderList, layer = 0; layer < numLayers && returnValue; layer++) {currentRenderList = null;const defaultRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data,defaultRenderListLength = this.renderList ? this.renderList.length : scene.getActiveMeshes().length;engine.currentRenderPassId = this._renderPassIds[layer], this.onBeforeRenderObservable.notifyObservers(layer), this.getCustomRenderList && (currentRenderList = this.getCustomRenderList(layer, defaultRenderList, defaultRenderListLength)), currentRenderList || (currentRenderList = defaultRenderList), this._doNotChangeAspectRatio || scene.updateTransformMatrix(!0);for (let i = 0; i < currentRenderList.length && returnValue; ++i) {const mesh = currentRenderList[i];if (mesh.isEnabled() && !mesh.isBlocked && mesh.isVisible && mesh.subMeshes) if (this.customIsReadyFunction) {if (!this.customIsReadyFunction(mesh, this.refreshRate, checkReadiness)) {returnValue = !1;continue;}} else if (!mesh.isReady(!0)) {returnValue = !1;continue;}}this.onAfterRenderObservable.notifyObservers(layer), (this.is2DArray || this.isCube) && (scene.incrementRenderId(), scene.resetCachedMaterial());}} else if (this.is2DArray) for (let layer = 0; layer < this.getRenderLayers(); layer++) this._renderToTarget(0, useCameraPostProcess, dumpForDebug, layer, camera), scene.incrementRenderId(), scene.resetCachedMaterial();else if (this.isCube) for (let face = 0; 6 > face; face++) this._renderToTarget(face, useCameraPostProcess, dumpForDebug, void 0, camera), scene.incrementRenderId(), scene.resetCachedMaterial();else this._renderToTarget(0, useCameraPostProcess, dumpForDebug, void 0, camera);return this.onAfterUnbindObservable.notifyObservers(this), engine.currentRenderPassId = currentRenderPassId, sceneCamera && (scene.activeCamera = sceneCamera, (1 < scene.getEngine().scenes.length || this.activeCamera && this.activeCamera !== scene.activeCamera) && scene.setTransformMatrix(scene.activeCamera.getViewMatrix(), scene.activeCamera.getProjectionMatrix(!0)), engine.setViewport(scene.activeCamera.viewport)), scene.resetCachedMaterial(), returnValue;}_bestReflectionRenderTargetDimension(renderDimension, scale) {const x = renderDimension * scale,curved = _Engines_engine_js__WEBPACK_IMPORTED_MODULE_7__/* .Engine.NearestPOT */ .D.NearestPOT(x + 16384 / (128 + x));return Math.min(_Engines_engine_js__WEBPACK_IMPORTED_MODULE_7__/* .Engine.FloorPOT */ .D.FloorPOT(renderDimension), curved);}_prepareRenderingManager(currentRenderList, currentRenderListLength, camera, checkLayerMask) {const scene = this.getScene();if (scene) {this._renderingManager.reset();const sceneRenderId = scene.getRenderId();for (let meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) {const mesh = currentRenderList[meshIndex];if (mesh && !mesh.isBlocked) {if (this.customIsReadyFunction) {if (!this.customIsReadyFunction(mesh, this.refreshRate, !1)) {this.resetRefreshCounter();continue;}} else if (!mesh.isReady(0 === this.refreshRate)) {this.resetRefreshCounter();continue;}if (!mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate && scene.activeCamera && (mesh._internalAbstractMeshDataInfo._currentLOD = scene.customLODSelector ? scene.customLODSelector(mesh, this.activeCamera || scene.activeCamera) : mesh.getLOD(this.activeCamera || scene.activeCamera), mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate = !0), !mesh._internalAbstractMeshDataInfo._currentLOD) continue;let meshToRender = mesh._internalAbstractMeshDataInfo._currentLOD;meshToRender._preActivateForIntermediateRendering(sceneRenderId);let isMasked;if (isMasked = !!(checkLayerMask && camera) && 0 == (mesh.layerMask & camera.layerMask), mesh.isEnabled() && mesh.isVisible && mesh.subMeshes && !isMasked && (meshToRender !== mesh && meshToRender._activate(sceneRenderId, !0), mesh._activate(sceneRenderId, !0) && mesh.subMeshes.length)) {mesh.isAnInstance ? mesh._internalAbstractMeshDataInfo._actAsRegularMesh && (meshToRender = mesh) : meshToRender._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = !1, meshToRender._internalAbstractMeshDataInfo._isActiveIntermediate = !0;for (let subIndex = 0; subIndex < meshToRender.subMeshes.length; subIndex++) {const subMesh = meshToRender.subMeshes[subIndex];this._renderingManager.dispatch(subMesh, meshToRender);}}}}for (let particleIndex = 0; particleIndex < scene.particleSystems.length; particleIndex++) {const particleSystem = scene.particleSystems[particleIndex],emitter = particleSystem.emitter;particleSystem.isStarted() && emitter && emitter.position && emitter.isEnabled() && 0 <= currentRenderList.indexOf(emitter) && this._renderingManager.dispatchParticles(particleSystem);}}}_bindFrameBuffer(faceIndex = 0, layer = 0) {const scene = this.getScene();if (scene) {const engine = scene.getEngine();this._renderTarget && engine.bindFramebuffer(this._renderTarget, this.isCube ? faceIndex : void 0, void 0, void 0, this.ignoreCameraViewport, 0, layer);}}_unbindFrameBuffer(engine, faceIndex) {this._renderTarget && engine.unBindFramebuffer(this._renderTarget, this.isCube, () => {this.onAfterRenderObservable.notifyObservers(faceIndex);});}_prepareFrame(scene, faceIndex, layer, useCameraPostProcess) {this._postProcessManager ? !this._prePassEnabled && this._postProcessManager._prepareFrame(this._texture, this._postProcesses) : (!useCameraPostProcess || !scene.postProcessManager._prepareFrame(this._texture)) && this._bindFrameBuffer(faceIndex, layer);}_renderToTarget(faceIndex, useCameraPostProcess, dumpForDebug, layer = 0, camera = null) {var _a, _b, _c, _d, _e, _f;const scene = this.getScene();if (scene) {const engine = scene.getEngine();null === (_a = engine._debugPushGroup) || void 0 === _a ? void 0 : _a.call(engine, `render to face #${faceIndex} layer #${layer}`, 1), this._prepareFrame(scene, faceIndex, layer, useCameraPostProcess), this.is2DArray ? (engine.currentRenderPassId = this._renderPassIds[layer], this.onBeforeRenderObservable.notifyObservers(layer)) : (engine.currentRenderPassId = this._renderPassIds[faceIndex], this.onBeforeRenderObservable.notifyObservers(faceIndex));const fastPath = engine.snapshotRendering && 1 === engine.snapshotRenderingMode;if (!fastPath) {let currentRenderList = null;const defaultRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data,defaultRenderListLength = this.renderList ? this.renderList.length : scene.getActiveMeshes().length;this.getCustomRenderList && (currentRenderList = this.getCustomRenderList(this.is2DArray ? layer : faceIndex, defaultRenderList, defaultRenderListLength)), currentRenderList ? this._prepareRenderingManager(currentRenderList, currentRenderList.length, camera, this.forceLayerMaskCheck) : (!this._defaultRenderListPrepared && (this._prepareRenderingManager(defaultRenderList, defaultRenderListLength, camera, !this.renderList || this.forceLayerMaskCheck), this._defaultRenderListPrepared = !0), currentRenderList = defaultRenderList);for (const step of scene._beforeRenderTargetClearStage) step.action(this, faceIndex, layer);this.onClearObservable.hasObservers() ? this.onClearObservable.notifyObservers(engine) : !this.skipInitialClear && engine.clear(this.clearColor || scene.clearColor, !0, !0, !0), this._doNotChangeAspectRatio || scene.updateTransformMatrix(!0);for (const step of scene._beforeRenderTargetDrawStage) step.action(this, faceIndex, layer);this._renderingManager.render(this.customRenderFunction, currentRenderList, this.renderParticles, this.renderSprites);for (const step of scene._afterRenderTargetDrawStage) step.action(this, faceIndex, layer);const saveGenerateMipMaps = null !== (_c = null === (_b = this._texture) || void 0 === _b ? void 0 : _b.generateMipMaps) && void 0 !== _c && _c;this._texture && (this._texture.generateMipMaps = !1), this._postProcessManager ? this._postProcessManager._finalizeFrame(!1, null !== (_d = this._renderTarget) && void 0 !== _d ? _d : void 0, faceIndex, this._postProcesses, this.ignoreCameraViewport) : useCameraPostProcess && scene.postProcessManager._finalizeFrame(!1, null !== (_e = this._renderTarget) && void 0 !== _e ? _e : void 0, faceIndex);for (const step of scene._afterRenderTargetPostProcessStage) step.action(this, faceIndex, layer);this._texture && (this._texture.generateMipMaps = saveGenerateMipMaps), this._doNotChangeAspectRatio || scene.updateTransformMatrix(!0), dumpForDebug && _Misc_dumpTools_js__WEBPACK_IMPORTED_MODULE_9__/* .DumpTools.DumpFramebuffer */ .B.DumpFramebuffer(this.getRenderWidth(), this.getRenderHeight(), engine);} else this.onClearObservable.hasObservers() ? this.onClearObservable.notifyObservers(engine) : !this.skipInitialClear && engine.clear(this.clearColor || scene.clearColor, !0, !0, !0);this._unbindFrameBuffer(engine, faceIndex), this._texture && this.isCube && 5 === faceIndex && engine.generateMipMapsForCubemap(this._texture), null === (_f = engine._debugPopGroup) || void 0 === _f ? void 0 : _f.call(engine, 1);}}setRenderingOrder(renderingGroupId, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {this._renderingManager.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn);}setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil) {this._renderingManager.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil), this._renderingManager._useSceneAutoClearSetup = !1;}clone() {const textureSize = this.getSize(),newTexture = new RenderTargetTexture(this.name, textureSize, this.getScene(), this._renderTargetOptions.generateMipMaps, this._doNotChangeAspectRatio, this._renderTargetOptions.type, this.isCube, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer, this._renderTargetOptions.generateStencilBuffer, void 0, this._renderTargetOptions.format, void 0, this._renderTargetOptions.samples);return newTexture.hasAlpha = this.hasAlpha, newTexture.level = this.level, newTexture.coordinatesMode = this.coordinatesMode, this.renderList && (newTexture.renderList = this.renderList.slice(0)), newTexture;}serialize() {if (!this.name) return null;const serializationObject = super.serialize();if (serializationObject.renderTargetSize = this.getRenderSize(), serializationObject.renderList = [], this.renderList) for (let index = 0; index < this.renderList.length; index++) serializationObject.renderList.push(this.renderList[index].id);return serializationObject;}disposeFramebufferObjects() {var _a;null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a.dispose(!0);}releaseInternalTexture() {var _a;null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a.releaseTextures(), this._texture = null;}dispose() {var _a;this.onResizeObservable.clear(), this.onClearObservable.clear(), this.onAfterRenderObservable.clear(), this.onAfterUnbindObservable.clear(), this.onBeforeBindObservable.clear(), this.onBeforeRenderObservable.clear(), this._postProcessManager && (this._postProcessManager.dispose(), this._postProcessManager = null), this._prePassRenderTarget && this._prePassRenderTarget.dispose(), this._releaseRenderPassId(), this.clearPostProcesses(!0), this._resizeObserver && (this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this.renderList = null;const scene = this.getScene();if (!scene) return;let index = scene.customRenderTargets.indexOf(this);0 <= index && scene.customRenderTargets.splice(index, 1);for (const camera of scene.cameras) index = camera.customRenderTargets.indexOf(this), 0 <= index && camera.customRenderTargets.splice(index, 1);null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a.dispose(), this._renderTarget = null, this._texture = null, super.dispose();}_rebuild() {this.refreshRate === RenderTargetTexture.REFRESHRATE_RENDER_ONCE && (this.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE), this._postProcessManager && this._postProcessManager._rebuild();}freeRenderingGroups() {this._renderingManager && this._renderingManager.freeRenderingGroups();}getViewCount() {return 1;}}RenderTargetTexture.REFRESHRATE_RENDER_ONCE = 0, RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME = 1, RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = 2, _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture._CreateRenderTargetTexture */ .x._CreateRenderTargetTexture = (name, renderTargetSize, scene, generateMipMaps) => new RenderTargetTexture(name, renderTargetSize, scene, generateMipMaps);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/texture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "x": () => (/* binding */ Texture)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
/* harmony import */ var _Misc_timingTools_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/timingTools.js");
/* harmony import */ var _Misc_instantiationTools_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/instantiationTools.js");
/* harmony import */ var _Maths_math_plane_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.plane.js");
/* harmony import */ var _Misc_stringTools_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/stringTools.js");
/* harmony import */ var _Misc_copyTools_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/copyTools.js");
/* harmony import */ var _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("./node_modules/@babylonjs/core/Compat/compatibilityOptions.js");
class Texture extends _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__/* .BaseTexture */ .V {get noMipmap() {return this._noMipmap;}get mimeType() {return this._mimeType;}set isBlocking(value) {this._isBlocking = value;}get isBlocking() {return this._isBlocking;}get invertY() {return this._invertY;}constructor(url, sceneOrEngine, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, buffer = null, deleteBuffer = !1, format, mimeType, loaderOptions, creationFlags, forcedExtension) {var _a, _b, _c, _d, _e, _f, _g, _h, _j;super(sceneOrEngine), this.url = null, this.uOffset = 0, this.vOffset = 0, this.uScale = 1, this.vScale = 1, this.uAng = 0, this.vAng = 0, this.wAng = 0, this.uRotationCenter = .5, this.vRotationCenter = .5, this.wRotationCenter = .5, this.homogeneousRotationInUVTransform = !1, this.inspectableCustomProperties = null, this._noMipmap = !1, this._invertY = !1, this._rowGenerationMatrix = null, this._cachedTextureMatrix = null, this._projectionModeMatrix = null, this._t0 = null, this._t1 = null, this._t2 = null, this._cachedUOffset = -1, this._cachedVOffset = -1, this._cachedUScale = 0, this._cachedVScale = 0, this._cachedUAng = -1, this._cachedVAng = -1, this._cachedWAng = -1, this._cachedReflectionProjectionMatrixId = -1, this._cachedURotationCenter = -1, this._cachedVRotationCenter = -1, this._cachedWRotationCenter = -1, this._cachedHomogeneousRotationInUVTransform = !1, this._cachedReflectionTextureMatrix = null, this._cachedReflectionUOffset = -1, this._cachedReflectionVOffset = -1, this._cachedReflectionUScale = 0, this._cachedReflectionVScale = 0, this._cachedReflectionCoordinatesMode = -1, this._buffer = null, this._deleteBuffer = !1, this._format = null, this._delayedOnLoad = null, this._delayedOnError = null, this.onLoadObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), this._isBlocking = !0, this.name = url || "", this.url = url;let noMipmap,useSRGBBuffer = !1,internalTexture = null;"object" == typeof noMipmapOrOptions && null !== noMipmapOrOptions ? (noMipmap = null !== (_a = noMipmapOrOptions.noMipmap) && void 0 !== _a && _a, invertY = null !== (_b = noMipmapOrOptions.invertY) && void 0 !== _b ? _b : !_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_12__/* .CompatibilityOptions.UseOpenGLOrientationForUV */ .e.UseOpenGLOrientationForUV, samplingMode = null !== (_c = noMipmapOrOptions.samplingMode) && void 0 !== _c ? _c : Texture.TRILINEAR_SAMPLINGMODE, onLoad = null !== (_d = noMipmapOrOptions.onLoad) && void 0 !== _d ? _d : null, onError = null !== (_e = noMipmapOrOptions.onError) && void 0 !== _e ? _e : null, buffer = null !== (_f = noMipmapOrOptions.buffer) && void 0 !== _f ? _f : null, deleteBuffer = null !== (_g = noMipmapOrOptions.deleteBuffer) && void 0 !== _g && _g, format = noMipmapOrOptions.format, mimeType = noMipmapOrOptions.mimeType, loaderOptions = noMipmapOrOptions.loaderOptions, creationFlags = noMipmapOrOptions.creationFlags, useSRGBBuffer = null !== (_h = noMipmapOrOptions.useSRGBBuffer) && void 0 !== _h && _h, internalTexture = null !== (_j = noMipmapOrOptions.internalTexture) && void 0 !== _j ? _j : null) : noMipmap = !!noMipmapOrOptions, this._noMipmap = noMipmap, this._invertY = void 0 === invertY ? !_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_12__/* .CompatibilityOptions.UseOpenGLOrientationForUV */ .e.UseOpenGLOrientationForUV : invertY, this._initialSamplingMode = samplingMode, this._buffer = buffer, this._deleteBuffer = deleteBuffer, this._mimeType = mimeType, this._loaderOptions = loaderOptions, this._creationFlags = creationFlags, this._useSRGBBuffer = useSRGBBuffer, this._forcedExtension = forcedExtension, format && (this._format = format);const scene = this.getScene(),engine = this._getEngine();if (!engine) return;engine.onBeforeTextureInitObservable.notifyObservers(this);const load = () => {this._texture && (this._texture._invertVScale && (this.vScale *= -1, this.vOffset += 1), null !== this._texture._cachedWrapU && (this.wrapU = this._texture._cachedWrapU, this._texture._cachedWrapU = null), null !== this._texture._cachedWrapV && (this.wrapV = this._texture._cachedWrapV, this._texture._cachedWrapV = null), null !== this._texture._cachedWrapR && (this.wrapR = this._texture._cachedWrapR, this._texture._cachedWrapR = null)), this.onLoadObservable.hasObservers() && this.onLoadObservable.notifyObservers(this), onLoad && onLoad(), !this.isBlocking && scene && scene.resetCachedMaterial();},errorHandler = (message, exception) => {this._loadingError = !0, this._errorObject = { message, exception }, onError && onError(message, exception), Texture.OnTextureLoadErrorObservable.notifyObservers(this);};if (!this.url && !internalTexture) return this._delayedOnLoad = load, void (this._delayedOnError = errorHandler);if (this._texture = null !== internalTexture && void 0 !== internalTexture ? internalTexture : this._getFromCache(this.url, noMipmap, samplingMode, this._invertY, useSRGBBuffer), !this._texture) {if (!scene || !scene.useDelayedTextureLoading) {try {this._texture = engine.createTexture(this.url, noMipmap, this._invertY, scene, samplingMode, load, errorHandler, this._buffer, void 0, this._format, this._forcedExtension, mimeType, loaderOptions, creationFlags, useSRGBBuffer);} catch (e) {throw errorHandler("error loading", e), e;}deleteBuffer && (this._buffer = null);} else this.delayLoadState = 4, this._delayedOnLoad = load, this._delayedOnError = errorHandler;} else if (this._texture.isReady) _Misc_timingTools_js__WEBPACK_IMPORTED_MODULE_7__/* .TimingTools.SetImmediate */ .Q.SetImmediate(() => load());else {const loadObserver = this._texture.onLoadedObservable.add(load);this._texture.onErrorObservable.add((e) => {var _a;errorHandler(e.message, e.exception), null === (_a = this._texture) || void 0 === _a ? void 0 : _a.onLoadedObservable.remove(loadObserver);});}}updateURL(url, buffer = null, onLoad, forcedExtension) {this.url && (this.releaseInternalTexture(), this.getScene().markAllMaterialsAsDirty(1)), (!this.name || this.name.startsWith("data:")) && (this.name = url), this.url = url, this._buffer = buffer, this._forcedExtension = forcedExtension, this.delayLoadState = 4, onLoad && (this._delayedOnLoad = onLoad), this.delayLoad();}delayLoad() {if (4 === this.delayLoadState) {const scene = this.getScene();scene && (this.delayLoadState = 1, this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode, this._invertY, this._useSRGBBuffer), this._texture ? this._delayedOnLoad && (this._texture.isReady ? _Misc_timingTools_js__WEBPACK_IMPORTED_MODULE_7__/* .TimingTools.SetImmediate */ .Q.SetImmediate(this._delayedOnLoad) : this._texture.onLoadedObservable.add(this._delayedOnLoad)) : (this._texture = scene.getEngine().createTexture(this.url, this._noMipmap, this._invertY, scene, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, this._forcedExtension, this._mimeType, this._loaderOptions, this._creationFlags, this._useSRGBBuffer), this._deleteBuffer && (this._buffer = null)), this._delayedOnLoad = null, this._delayedOnError = null);}}_prepareRowForTextureGeneration(x, y, z, t) {x *= this._cachedUScale, y *= this._cachedVScale, x -= this.uRotationCenter * this._cachedUScale, y -= this.vRotationCenter * this._cachedVScale, z -= this.wRotationCenter, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinatesFromFloatsToRef */ .P.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t), t.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset, t.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset, t.z += this.wRotationCenter;}checkTransformsAreIdentical(texture) {return null !== texture && this.uOffset === texture.uOffset && this.vOffset === texture.vOffset && this.uScale === texture.uScale && this.vScale === texture.vScale && this.uAng === texture.uAng && this.vAng === texture.vAng && this.wAng === texture.wAng;}getTextureMatrix(uBase = 1) {if (this.uOffset === this._cachedUOffset && this.vOffset === this._cachedVOffset && this.uScale * uBase === this._cachedUScale && this.vScale === this._cachedVScale && this.uAng === this._cachedUAng && this.vAng === this._cachedVAng && this.wAng === this._cachedWAng && this.uRotationCenter === this._cachedURotationCenter && this.vRotationCenter === this._cachedVRotationCenter && this.wRotationCenter === this._cachedWRotationCenter && this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform) return this._cachedTextureMatrix;this._cachedUOffset = this.uOffset, this._cachedVOffset = this.vOffset, this._cachedUScale = this.uScale * uBase, this._cachedVScale = this.vScale, this._cachedUAng = this.uAng, this._cachedVAng = this.vAng, this._cachedWAng = this.wAng, this._cachedURotationCenter = this.uRotationCenter, this._cachedVRotationCenter = this.vRotationCenter, this._cachedWRotationCenter = this.wRotationCenter, this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform, this._cachedTextureMatrix && this._rowGenerationMatrix || (this._cachedTextureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Zero */ .y3.Zero(), this._rowGenerationMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .y3(), this._t0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._t1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._t2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero()), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.RotationYawPitchRollToRef */ .y3.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix), this.homogeneousRotationInUVTransform ? (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.TranslationToRef */ .y3.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.TranslationToRef */ .y3.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.ScalingToRef */ .y3.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[2] */ .jp.Matrix[2]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.TranslationToRef */ .y3.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[3] */ .jp.Matrix[3]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0].multiplyToRef */ .jp.Matrix[0].multiplyToRef(this._rowGenerationMatrix, this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1], this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[2] */ .jp.Matrix[2], this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[3] */ .jp.Matrix[3], this._cachedTextureMatrix), this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1)) : (this._prepareRowForTextureGeneration(0, 0, 0, this._t0), this._prepareRowForTextureGeneration(1, 0, 0, this._t1), this._prepareRowForTextureGeneration(0, 1, 0, this._t2), this._t1.subtractInPlace(this._t0), this._t2.subtractInPlace(this._t0), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.FromValuesToRef */ .y3.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0, this._t2.x, this._t2.y, this._t2.z, 0, this._t0.x, this._t0.y, this._t0.z, 0, 0, 0, 0, 1, this._cachedTextureMatrix));const scene = this.getScene();return scene ? (this.optimizeUVAllocation && scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this)), this._cachedTextureMatrix) : this._cachedTextureMatrix;}getReflectionTextureMatrix() {const scene = this.getScene();if (!scene) return this._cachedReflectionTextureMatrix;if (this.uOffset === this._cachedReflectionUOffset && this.vOffset === this._cachedReflectionVOffset && this.uScale === this._cachedReflectionUScale && this.vScale === this._cachedReflectionVScale && this.coordinatesMode === this._cachedReflectionCoordinatesMode) {if (this.coordinatesMode !== Texture.PROJECTION_MODE) return this._cachedReflectionTextureMatrix;if (this._cachedReflectionProjectionMatrixId === scene.getProjectionMatrix().updateFlag) return this._cachedReflectionTextureMatrix;}this._cachedReflectionTextureMatrix || (this._cachedReflectionTextureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Zero */ .y3.Zero()), this._projectionModeMatrix || (this._projectionModeMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Zero */ .y3.Zero());const flagMaterialsAsTextureDirty = this._cachedReflectionCoordinatesMode !== this.coordinatesMode;switch (this._cachedReflectionUOffset = this.uOffset, this._cachedReflectionVOffset = this.vOffset, this._cachedReflectionUScale = this.uScale, this._cachedReflectionVScale = this.vScale, this._cachedReflectionCoordinatesMode = this.coordinatesMode, this.coordinatesMode) {case Texture.PLANAR_MODE:{_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.IdentityToRef */ .y3.IdentityToRef(this._cachedReflectionTextureMatrix), this._cachedReflectionTextureMatrix[0] = this.uScale, this._cachedReflectionTextureMatrix[5] = this.vScale, this._cachedReflectionTextureMatrix[12] = this.uOffset, this._cachedReflectionTextureMatrix[13] = this.vOffset;break;}case Texture.PROJECTION_MODE:{_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.FromValuesToRef */ .y3.FromValuesToRef(.5, 0, 0, 0, 0, -.5, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, this._projectionModeMatrix);const projectionMatrix = scene.getProjectionMatrix();this._cachedReflectionProjectionMatrixId = projectionMatrix.updateFlag, projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedReflectionTextureMatrix);break;}default:_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.IdentityToRef */ .y3.IdentityToRef(this._cachedReflectionTextureMatrix);}return flagMaterialsAsTextureDirty && scene.markAllMaterialsAsDirty(1, (mat) => -1 !== mat.getActiveTextures().indexOf(this)), this._cachedReflectionTextureMatrix;}clone() {const options = { noMipmap: this._noMipmap, invertY: this._invertY, samplingMode: this.samplingMode, onLoad: void 0, onError: void 0, buffer: this._texture ? this._texture._buffer : void 0, deleteBuffer: this._deleteBuffer, format: this.textureFormat, mimeType: this.mimeType, loaderOptions: this._loaderOptions, creationFlags: this._creationFlags, useSRGBBuffer: this._useSRGBBuffer };return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Clone */ .p4.Clone(() => new Texture(this._texture ? this._texture.url : null, this.getScene(), options), this);}serialize() {var _a, _b;const savedName = this.name;!Texture.SerializeBuffers && this.name.startsWith("data:") && (this.name = ""), this.name.startsWith("data:") && this.url === this.name && (this.url = "");const serializationObject = super.serialize(Texture._SerializeInternalTextureUniqueId);return serializationObject ? ((Texture.SerializeBuffers || Texture.ForceSerializeBuffers) && ("string" == typeof this._buffer && "data:" === this._buffer.substr(0, 5) ? (serializationObject.base64String = this._buffer, serializationObject.name = serializationObject.name.replace("data:", "")) : this.url && this.url.startsWith("data:") && this._buffer instanceof Uint8Array ? serializationObject.base64String = "data:image/png;base64," + (0,_Misc_stringTools_js__WEBPACK_IMPORTED_MODULE_10__/* .EncodeArrayBufferToBase64 */ .Gh)(this._buffer) : (Texture.ForceSerializeBuffers || this.url && this.url.startsWith("blob:") || this._forceSerialize) && (serializationObject.base64String = !this._engine || this._engine._features.supportSyncTextureRead ? (0,_Misc_copyTools_js__WEBPACK_IMPORTED_MODULE_11__/* .GenerateBase64StringFromTexture */ ._u)(this) : (0,_Misc_copyTools_js__WEBPACK_IMPORTED_MODULE_11__/* .GenerateBase64StringFromTextureAsync */ .Jj)(this))), serializationObject.invertY = this._invertY, serializationObject.samplingMode = this.samplingMode, serializationObject._creationFlags = this._creationFlags, serializationObject._useSRGBBuffer = this._useSRGBBuffer, Texture._SerializeInternalTextureUniqueId && (serializationObject.internalTextureUniqueId = null !== (_b = null === (_a = this._texture) || void 0 === _a ? void 0 : _a.uniqueId) && void 0 !== _b ? _b : void 0), this.name = savedName, serializationObject) : null;}getClassName() {return "Texture";}dispose() {super.dispose(), this.onLoadObservable.clear(), this._delayedOnLoad = null, this._delayedOnError = null, this._buffer = null;}static Parse(parsedTexture, scene, rootUrl) {if (parsedTexture.customType) {const customTexture = _Misc_instantiationTools_js__WEBPACK_IMPORTED_MODULE_8__/* .InstantiationTools.Instantiate */ .K.Instantiate(parsedTexture.customType),parsedCustomTexture = customTexture.Parse(parsedTexture, scene, rootUrl);return parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode && parsedCustomTexture._samplingMode && parsedCustomTexture._samplingMode !== parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode(parsedTexture.samplingMode), parsedCustomTexture;}if (parsedTexture.isCube && !parsedTexture.isRenderTarget) return Texture._CubeTextureParser(parsedTexture, scene, rootUrl);const hasInternalTextureUniqueId = parsedTexture.internalTextureUniqueId !== void 0;if (!parsedTexture.name && !parsedTexture.isRenderTarget && !hasInternalTextureUniqueId) return null;let internalTexture;if (hasInternalTextureUniqueId) {const cache = scene.getEngine().getLoadedTexturesCache();for (const texture of cache) if (texture.uniqueId === parsedTexture.internalTextureUniqueId) {internalTexture = texture;break;}}const onLoaded = (texture) => {var _a;if (texture && texture._texture && (texture._texture._cachedWrapU = null, texture._texture._cachedWrapV = null, texture._texture._cachedWrapR = null), parsedTexture.samplingMode) {const sampling = parsedTexture.samplingMode;texture && texture.samplingMode !== sampling && texture.updateSamplingMode(sampling);}if (texture && parsedTexture.animations) for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {const parsedAnimation = parsedTexture.animations[animationIndex],internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__/* .GetClass */ .q)("BABYLON.Animation");internalClass && texture.animations.push(internalClass.Parse(parsedAnimation));}hasInternalTextureUniqueId && !internalTexture && (null === (_a = null === texture || void 0 === texture ? void 0 : texture._texture) || void 0 === _a ? void 0 : _a._setUniqueId(parsedTexture.internalTextureUniqueId));},texture = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(() => {var _a, _b, _c;let generateMipMaps = !0;if (parsedTexture.noMipmap && (generateMipMaps = !1), parsedTexture.mirrorPlane) {const mirrorTexture = Texture._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);return mirrorTexture._waitingRenderList = parsedTexture.renderList, mirrorTexture.mirrorPlane = _Maths_math_plane_js__WEBPACK_IMPORTED_MODULE_9__/* .Plane.FromArray */ .J.FromArray(parsedTexture.mirrorPlane), onLoaded(mirrorTexture), mirrorTexture;}if (parsedTexture.isRenderTarget) {let renderTargetTexture = null;if (!parsedTexture.isCube) renderTargetTexture = Texture._CreateRenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps, null !== (_a = parsedTexture._creationFlags) && void 0 !== _a ? _a : 0), renderTargetTexture._waitingRenderList = parsedTexture.renderList;else if (scene.reflectionProbes) for (let index = 0; index < scene.reflectionProbes.length; index++) {const probe = scene.reflectionProbes[index];if (probe.name === parsedTexture.name) return probe.cubeTexture;}return onLoaded(renderTargetTexture), renderTargetTexture;} else {let texture;if (parsedTexture.base64String && !internalTexture) texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.base64String, scene, !generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, () => {onLoaded(texture);}, null !== (_b = parsedTexture._creationFlags) && void 0 !== _b ? _b : 0, null !== (_c = parsedTexture._useSRGBBuffer) && void 0 !== _c && _c), texture.name = parsedTexture.name;else {let url;url = parsedTexture.name && 0 < parsedTexture.name.indexOf("://") ? parsedTexture.name : rootUrl + parsedTexture.name, parsedTexture.url && (parsedTexture.url.startsWith("data:") || Texture.UseSerializedUrlIfAny) && (url = parsedTexture.url);const options = { noMipmap: !generateMipMaps, invertY: parsedTexture.invertY, samplingMode: parsedTexture.samplingMode, onLoad: () => {onLoaded(texture);}, internalTexture };texture = new Texture(url, scene, options);}return texture;}}, parsedTexture, scene);return texture;}static CreateFromBase64String(data, name, scene, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags) {return new Texture("data:" + name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, !1, format, void 0, void 0, creationFlags);}static LoadFromDataString(name, buffer, scene, deleteBuffer = !1, noMipmapOrOptions, invertY = !0, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags) {return "data:" !== name.substr(0, 5) && (name = "data:" + name), new Texture(name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format, void 0, void 0, creationFlags);}}Texture.SerializeBuffers = !0, Texture.ForceSerializeBuffers = !1, Texture.OnTextureLoadErrorObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), Texture._SerializeInternalTextureUniqueId = !1, Texture._CubeTextureParser = () => {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_6__/* ._WarnImport */ .S)("CubeTexture");}, Texture._CreateMirror = () => {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_6__/* ._WarnImport */ .S)("MirrorTexture");}, Texture._CreateRenderTargetTexture = () => {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_6__/* ._WarnImport */ .S)("RenderTargetTexture");}, Texture.NEAREST_SAMPLINGMODE = 1, Texture.NEAREST_NEAREST_MIPLINEAR = 8, Texture.BILINEAR_SAMPLINGMODE = 2, Texture.LINEAR_LINEAR_MIPNEAREST = 11, Texture.TRILINEAR_SAMPLINGMODE = 3, Texture.LINEAR_LINEAR_MIPLINEAR = 3, Texture.NEAREST_NEAREST_MIPNEAREST = 4, Texture.NEAREST_LINEAR_MIPNEAREST = 5, Texture.NEAREST_LINEAR_MIPLINEAR = 6, Texture.NEAREST_LINEAR = 7, Texture.NEAREST_NEAREST = 1, Texture.LINEAR_NEAREST_MIPNEAREST = 9, Texture.LINEAR_NEAREST_MIPLINEAR = 10, Texture.LINEAR_LINEAR = 2, Texture.LINEAR_NEAREST = 12, Texture.EXPLICIT_MODE = 0, Texture.SPHERICAL_MODE = 1, Texture.PLANAR_MODE = 2, Texture.CUBIC_MODE = 3, Texture.PROJECTION_MODE = 4, Texture.SKYBOX_MODE = 5, Texture.INVCUBIC_MODE = 6, Texture.EQUIRECTANGULAR_MODE = 7, Texture.FIXED_EQUIRECTANGULAR_MODE = 8, Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9, Texture.CLAMP_ADDRESSMODE = 0, Texture.WRAP_ADDRESSMODE = 1, Texture.MIRROR_ADDRESSMODE = 2, Texture.UseSerializedUrlIfAny = !1, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "url", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "uOffset", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "vOffset", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "uScale", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "vScale", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "uAng", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "vAng", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "wAng", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "uRotationCenter", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "vRotationCenter", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "wRotationCenter", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "homogeneousRotationInUVTransform", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], Texture.prototype, "isBlocking", null), (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__/* .RegisterClass */ .H)("BABYLON.Texture", Texture), _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper._TextureParser */ .p4._TextureParser = Texture.Parse;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/textureSampler.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "a": () => (/* binding */ TextureSampler)
/* harmony export */ });
class TextureSampler {get wrapU() {return this._cachedWrapU;}set wrapU(value) {this._cachedWrapU = value;}get wrapV() {return this._cachedWrapV;}set wrapV(value) {this._cachedWrapV = value;}get wrapR() {return this._cachedWrapR;}set wrapR(value) {this._cachedWrapR = value;}get anisotropicFilteringLevel() {return this._cachedAnisotropicFilteringLevel;}set anisotropicFilteringLevel(value) {this._cachedAnisotropicFilteringLevel = value;}get comparisonFunction() {return this._comparisonFunction;}set comparisonFunction(value) {this._comparisonFunction = value;}get useMipMaps() {return this._useMipMaps;}set useMipMaps(value) {this._useMipMaps = value;}constructor() {this.samplingMode = -1, this._useMipMaps = !0, this._cachedWrapU = null, this._cachedWrapV = null, this._cachedWrapR = null, this._cachedAnisotropicFilteringLevel = null, this._comparisonFunction = 0;}setParameters(wrapU = 1, wrapV = 1, wrapR = 1, anisotropicFilteringLevel = 1, samplingMode = 2, comparisonFunction = 0) {return this._cachedWrapU = wrapU, this._cachedWrapV = wrapV, this._cachedWrapR = wrapR, this._cachedAnisotropicFilteringLevel = anisotropicFilteringLevel, this.samplingMode = samplingMode, this._comparisonFunction = comparisonFunction, this;}compareSampler(other) {return this._cachedWrapU === other._cachedWrapU && this._cachedWrapV === other._cachedWrapV && this._cachedWrapR === other._cachedWrapR && this._cachedAnisotropicFilteringLevel === other._cachedAnisotropicFilteringLevel && this.samplingMode === other.samplingMode && this._comparisonFunction === other._comparisonFunction && this._useMipMaps === other._useMipMaps;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "R": () => (/* binding */ ThinRenderTargetTexture)
/* harmony export */ });
/* harmony import */ var _thinTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/thinTexture.js");
class ThinRenderTargetTexture extends _thinTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinTexture */ .g {get renderTarget() {return this._renderTarget;}constructor(engine, size, options) {super(null), this._renderTarget = null, this._engine = engine, this._renderTargetOptions = options, this.resize(size);}resize(size) {var _a;null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a.dispose(), this._renderTarget = null, this._texture = null, this._size = size, this._engine && (this._renderTarget = this._engine.createRenderTargetTexture(this._size, this._renderTargetOptions)), this._texture = this.renderTarget.texture;}getInternalTexture() {return this._texture;}getClassName() {return "ThinRenderTargetTexture";}dispose(disposeOnlyFramebuffers = !1) {var _a;null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a.dispose(!0), this._renderTarget = null, disposeOnlyFramebuffers || super.dispose();}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/Textures/thinTexture.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "g": () => (/* binding */ ThinTexture)
/* harmony export */ });
/* harmony import */ var _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.size.js");
class ThinTexture {get wrapU() {return this._wrapU;}set wrapU(value) {this._wrapU = value;}get wrapV() {return this._wrapV;}set wrapV(value) {this._wrapV = value;}get coordinatesMode() {return 0;}get isCube() {return !!this._texture && this._texture.isCube;}set isCube(value) {this._texture && (this._texture.isCube = value);}get is3D() {return !!this._texture && this._texture.is3D;}set is3D(value) {this._texture && (this._texture.is3D = value);}get is2DArray() {return !!this._texture && this._texture.is2DArray;}set is2DArray(value) {this._texture && (this._texture.is2DArray = value);}getClassName() {return "ThinTexture";}constructor(internalTexture) {this._wrapU = 1, this._wrapV = 1, this.wrapR = 1, this.anisotropicFilteringLevel = 4, this.delayLoadState = 0, this._texture = null, this._engine = null, this._cachedSize = _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_0__/* .Size.Zero */ .$.Zero(), this._cachedBaseSize = _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_0__/* .Size.Zero */ .$.Zero(), this._initialSamplingMode = 2, this._texture = internalTexture, this._texture && (this._engine = this._texture.getEngine());}isReady() {return 4 === this.delayLoadState ? (this.delayLoad(), !1) : !!this._texture && this._texture.isReady;}delayLoad() {}getInternalTexture() {return this._texture;}getSize() {if (this._texture) {if (this._texture.width) return this._cachedSize.width = this._texture.width, this._cachedSize.height = this._texture.height, this._cachedSize;if (this._texture._size) return this._cachedSize.width = this._texture._size, this._cachedSize.height = this._texture._size, this._cachedSize;}return this._cachedSize;}getBaseSize() {return this.isReady() && this._texture ? this._texture._size ? (this._cachedBaseSize.width = this._texture._size, this._cachedBaseSize.height = this._texture._size, this._cachedBaseSize) : (this._cachedBaseSize.width = this._texture.baseWidth, this._cachedBaseSize.height = this._texture.baseHeight, this._cachedBaseSize) : (this._cachedBaseSize.width = 0, this._cachedBaseSize.height = 0, this._cachedBaseSize);}get samplingMode() {return this._texture ? this._texture.samplingMode : this._initialSamplingMode;}updateSamplingMode(samplingMode) {this._texture && this._engine && this._engine.updateTextureSamplingMode(samplingMode, this._texture);}releaseInternalTexture() {this._texture && (this._texture.dispose(), this._texture = null);}dispose() {this._texture && (this.releaseInternalTexture(), this._engine = null);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AN": () => (/* binding */ prepareDefinesForClipPlanes),
/* harmony export */   "an": () => (/* binding */ bindClipPlane),
/* harmony export */   "qx": () => (/* binding */ addClipPlaneUniforms)
/* harmony export */ });
function addClipPlaneUniforms(uniforms) {-1 === uniforms.indexOf("vClipPlane") && uniforms.push("vClipPlane"), -1 === uniforms.indexOf("vClipPlane2") && uniforms.push("vClipPlane2"), -1 === uniforms.indexOf("vClipPlane3") && uniforms.push("vClipPlane3"), -1 === uniforms.indexOf("vClipPlane4") && uniforms.push("vClipPlane4"), -1 === uniforms.indexOf("vClipPlane5") && uniforms.push("vClipPlane5"), -1 === uniforms.indexOf("vClipPlane6") && uniforms.push("vClipPlane6");}function prepareDefinesForClipPlanes(primaryHolder, secondaryHolder, defines) {var _a, _b, _c, _d, _e, _f;let changed = !1,clipPlane = null !== (_a = primaryHolder.clipPlane) && void 0 !== _a ? _a : secondaryHolder.clipPlane;return changed = addDefine(clipPlane, defines, "CLIPPLANE", "#define CLIPPLANE") || changed, clipPlane = null !== (_b = primaryHolder.clipPlane2) && void 0 !== _b ? _b : secondaryHolder.clipPlane2, changed = addDefine(clipPlane, defines, "CLIPPLANE2", "#define CLIPPLANE2") || changed, clipPlane = null !== (_c = primaryHolder.clipPlane3) && void 0 !== _c ? _c : secondaryHolder.clipPlane3, changed = addDefine(clipPlane, defines, "CLIPPLANE3", "#define CLIPPLANE3") || changed, clipPlane = null !== (_d = primaryHolder.clipPlane4) && void 0 !== _d ? _d : secondaryHolder.clipPlane4, changed = addDefine(clipPlane, defines, "CLIPPLANE4", "#define CLIPPLANE4") || changed, clipPlane = null !== (_e = primaryHolder.clipPlane5) && void 0 !== _e ? _e : secondaryHolder.clipPlane5, changed = addDefine(clipPlane, defines, "CLIPPLANE5", "#define CLIPPLANE5") || changed, clipPlane = null !== (_f = primaryHolder.clipPlane6) && void 0 !== _f ? _f : secondaryHolder.clipPlane6, changed = addDefine(clipPlane, defines, "CLIPPLANE6", "#define CLIPPLANE6") || changed, changed;}function bindClipPlane(effect, primaryHolder, secondaryHolder) {var _a, _b, _c, _d, _e, _f;let clipPlane = null !== (_a = primaryHolder.clipPlane) && void 0 !== _a ? _a : secondaryHolder.clipPlane;setClipPlane(effect, "vClipPlane", clipPlane), clipPlane = null !== (_b = primaryHolder.clipPlane2) && void 0 !== _b ? _b : secondaryHolder.clipPlane2, setClipPlane(effect, "vClipPlane2", clipPlane), clipPlane = null !== (_c = primaryHolder.clipPlane3) && void 0 !== _c ? _c : secondaryHolder.clipPlane3, setClipPlane(effect, "vClipPlane3", clipPlane), clipPlane = null !== (_d = primaryHolder.clipPlane4) && void 0 !== _d ? _d : secondaryHolder.clipPlane4, setClipPlane(effect, "vClipPlane4", clipPlane), clipPlane = null !== (_e = primaryHolder.clipPlane5) && void 0 !== _e ? _e : secondaryHolder.clipPlane5, setClipPlane(effect, "vClipPlane5", clipPlane), clipPlane = null !== (_f = primaryHolder.clipPlane6) && void 0 !== _f ? _f : secondaryHolder.clipPlane6, setClipPlane(effect, "vClipPlane6", clipPlane);}function setClipPlane(effect, uniformName, clipPlane) {clipPlane && effect.setFloat4(uniformName, clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);}function addDefine(clipPlane, defines, defineName, defineString) {const defineClipPlane = !!clipPlane;let alreadySet;if (Array.isArray(defines)) {const defineIndex = defines.indexOf(defineString);alreadySet = -1 !== defineIndex, !alreadySet && clipPlane ? defines.push(defineString) : alreadySet && !clipPlane && defines.splice(defineIndex, 1);} else alreadySet = defines[defineName], defines[defineName] = defineClipPlane;const changed = alreadySet !== defineClipPlane;return changed;}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/colorCurves.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "U": () => (/* binding */ ColorCurves)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
class ColorCurves {constructor() {this._dirty = !0, this._tempColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .HE(0, 0, 0, 0), this._globalCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .HE(0, 0, 0, 0), this._highlightsCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .HE(0, 0, 0, 0), this._midtonesCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .HE(0, 0, 0, 0), this._shadowsCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .HE(0, 0, 0, 0), this._positiveCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .HE(0, 0, 0, 0), this._negativeCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .HE(0, 0, 0, 0), this._globalHue = 30, this._globalDensity = 0, this._globalSaturation = 0, this._globalExposure = 0, this._highlightsHue = 30, this._highlightsDensity = 0, this._highlightsSaturation = 0, this._highlightsExposure = 0, this._midtonesHue = 30, this._midtonesDensity = 0, this._midtonesSaturation = 0, this._midtonesExposure = 0, this._shadowsHue = 30, this._shadowsDensity = 0, this._shadowsSaturation = 0, this._shadowsExposure = 0;}get globalHue() {return this._globalHue;}set globalHue(value) {this._globalHue = value, this._dirty = !0;}get globalDensity() {return this._globalDensity;}set globalDensity(value) {this._globalDensity = value, this._dirty = !0;}get globalSaturation() {return this._globalSaturation;}set globalSaturation(value) {this._globalSaturation = value, this._dirty = !0;}get globalExposure() {return this._globalExposure;}set globalExposure(value) {this._globalExposure = value, this._dirty = !0;}get highlightsHue() {return this._highlightsHue;}set highlightsHue(value) {this._highlightsHue = value, this._dirty = !0;}get highlightsDensity() {return this._highlightsDensity;}set highlightsDensity(value) {this._highlightsDensity = value, this._dirty = !0;}get highlightsSaturation() {return this._highlightsSaturation;}set highlightsSaturation(value) {this._highlightsSaturation = value, this._dirty = !0;}get highlightsExposure() {return this._highlightsExposure;}set highlightsExposure(value) {this._highlightsExposure = value, this._dirty = !0;}get midtonesHue() {return this._midtonesHue;}set midtonesHue(value) {this._midtonesHue = value, this._dirty = !0;}get midtonesDensity() {return this._midtonesDensity;}set midtonesDensity(value) {this._midtonesDensity = value, this._dirty = !0;}get midtonesSaturation() {return this._midtonesSaturation;}set midtonesSaturation(value) {this._midtonesSaturation = value, this._dirty = !0;}get midtonesExposure() {return this._midtonesExposure;}set midtonesExposure(value) {this._midtonesExposure = value, this._dirty = !0;}get shadowsHue() {return this._shadowsHue;}set shadowsHue(value) {this._shadowsHue = value, this._dirty = !0;}get shadowsDensity() {return this._shadowsDensity;}set shadowsDensity(value) {this._shadowsDensity = value, this._dirty = !0;}get shadowsSaturation() {return this._shadowsSaturation;}set shadowsSaturation(value) {this._shadowsSaturation = value, this._dirty = !0;}get shadowsExposure() {return this._shadowsExposure;}set shadowsExposure(value) {this._shadowsExposure = value, this._dirty = !0;}getClassName() {return "ColorCurves";}static Bind(colorCurves, effect, positiveUniform = "vCameraColorCurvePositive", neutralUniform = "vCameraColorCurveNeutral", negativeUniform = "vCameraColorCurveNegative") {colorCurves._dirty && (colorCurves._dirty = !1, colorCurves._getColorGradingDataToRef(colorCurves._globalHue, colorCurves._globalDensity, colorCurves._globalSaturation, colorCurves._globalExposure, colorCurves._globalCurve), colorCurves._getColorGradingDataToRef(colorCurves._highlightsHue, colorCurves._highlightsDensity, colorCurves._highlightsSaturation, colorCurves._highlightsExposure, colorCurves._tempColor), colorCurves._tempColor.multiplyToRef(colorCurves._globalCurve, colorCurves._highlightsCurve), colorCurves._getColorGradingDataToRef(colorCurves._midtonesHue, colorCurves._midtonesDensity, colorCurves._midtonesSaturation, colorCurves._midtonesExposure, colorCurves._tempColor), colorCurves._tempColor.multiplyToRef(colorCurves._globalCurve, colorCurves._midtonesCurve), colorCurves._getColorGradingDataToRef(colorCurves._shadowsHue, colorCurves._shadowsDensity, colorCurves._shadowsSaturation, colorCurves._shadowsExposure, colorCurves._tempColor), colorCurves._tempColor.multiplyToRef(colorCurves._globalCurve, colorCurves._shadowsCurve), colorCurves._highlightsCurve.subtractToRef(colorCurves._midtonesCurve, colorCurves._positiveCurve), colorCurves._midtonesCurve.subtractToRef(colorCurves._shadowsCurve, colorCurves._negativeCurve)), effect && (effect.setFloat4(positiveUniform, colorCurves._positiveCurve.r, colorCurves._positiveCurve.g, colorCurves._positiveCurve.b, colorCurves._positiveCurve.a), effect.setFloat4(neutralUniform, colorCurves._midtonesCurve.r, colorCurves._midtonesCurve.g, colorCurves._midtonesCurve.b, colorCurves._midtonesCurve.a), effect.setFloat4(negativeUniform, colorCurves._negativeCurve.r, colorCurves._negativeCurve.g, colorCurves._negativeCurve.b, colorCurves._negativeCurve.a));}static PrepareUniforms(uniformsList) {uniformsList.push("vCameraColorCurveNeutral", "vCameraColorCurvePositive", "vCameraColorCurveNegative");}_getColorGradingDataToRef(hue, density, saturation, exposure, result) {null == hue || (hue = ColorCurves._Clamp(hue, 0, 360), density = ColorCurves._Clamp(density, -100, 100), saturation = ColorCurves._Clamp(saturation, -100, 100), exposure = ColorCurves._Clamp(exposure, -100, 100), density = ColorCurves._ApplyColorGradingSliderNonlinear(density), density *= .5, exposure = ColorCurves._ApplyColorGradingSliderNonlinear(exposure), 0 > density && (density *= -1, hue = (hue + 180) % 360), ColorCurves._FromHSBToRef(hue, density, 50 + .25 * exposure, result), result.scaleToRef(2, result), result.a = 1 + .01 * saturation);}static _ApplyColorGradingSliderNonlinear(value) {value /= 100;let x = Math.abs(value);return x = Math.pow(x, 2), 0 > value && (x *= -1), x *= 100, x;}static _FromHSBToRef(hue, saturation, brightness, result) {let h = ColorCurves._Clamp(hue, 0, 360);const s = ColorCurves._Clamp(saturation / 100, 0, 1),v = ColorCurves._Clamp(brightness / 100, 0, 1);if (0 === s) result.r = v, result.g = v, result.b = v;else {h /= 60;const i = Math.floor(h),f = h - i,p = v * (1 - s),q = v * (1 - s * f),t = v * (1 - s * (1 - f));switch (i) {case 0:result.r = v, result.g = t, result.b = p;break;case 1:result.r = q, result.g = v, result.b = p;break;case 2:result.r = p, result.g = v, result.b = t;break;case 3:result.r = p, result.g = q, result.b = v;break;case 4:result.r = t, result.g = p, result.b = v;break;default:result.r = v, result.g = p, result.b = q;}}result.a = 1;}static _Clamp(value, min, max) {return Math.min(Math.max(value, min), max);}clone() {return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Clone */ .p4.Clone(() => new ColorCurves(), this);}serialize() {return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Serialize */ .p4.Serialize(this);}static Parse(source) {return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(() => new ColorCurves(), source, null, null);}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_globalHue", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_globalDensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_globalSaturation", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_globalExposure", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_highlightsHue", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_highlightsDensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_highlightsSaturation", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_highlightsExposure", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_midtonesHue", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_midtonesDensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_midtonesSaturation", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ColorCurves.prototype, "_midtonesExposure", void 0), _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper._ColorCurvesParser */ .p4._ColorCurvesParser = ColorCurves.Parse;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/drawWrapper.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "q": () => (/* binding */ DrawWrapper)
/* harmony export */ });
class DrawWrapper {static IsWrapper(effect) {return effect.getPipelineContext === void 0;}static GetEffect(effect) {return effect.getPipelineContext === void 0 ? effect.effect : effect;}constructor(engine, createMaterialContext = !0) {this.effect = null, this.defines = null, this.drawContext = engine.createDrawContext(), createMaterialContext && (this.materialContext = engine.createMaterialContext());}setEffect(effect, defines, resetContext = !0) {var _a;this.effect = effect, defines !== void 0 && (this.defines = defines), resetContext && (null === (_a = this.drawContext) || void 0 === _a ? void 0 : _a.reset());}dispose() {var _a;null === (_a = this.drawContext) || void 0 === _a ? void 0 : _a.dispose();}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/effect.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Q": () => (/* binding */ Effect)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js");
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
/* harmony import */ var _shaderLanguage_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/shaderLanguage.js");
class Effect {static get ShadersRepository() {return _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.ShadersRepository */ .v.ShadersRepository;}static set ShadersRepository(repo) {_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.ShadersRepository */ .v.ShadersRepository = repo;}get onBindObservable() {return this._onBindObservable || (this._onBindObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$()), this._onBindObservable;}constructor(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers = null, engine, defines = null, fallbacks = null, onCompiled = null, onError = null, indexParameters, key = "", shaderLanguage = _shaderLanguage_js__WEBPACK_IMPORTED_MODULE_5__/* .ShaderLanguage.GLSL */ .x.GLSL) {var _a, _b, _c;this.name = null, this.defines = "", this.onCompiled = null, this.onError = null, this.onBind = null, this.uniqueId = 0, this.onCompileObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onErrorObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this._onBindObservable = null, this._wasPreviouslyReady = !1, this._forceRebindOnNextCall = !1, this._wasPreviouslyUsingInstances = null, this._isDisposed = !1, this._bonesComputationForcedToCPU = !1, this._uniformBuffersNames = {}, this._multiTarget = !1, this._samplers = {}, this._isReady = !1, this._compilationError = "", this._allFallbacksProcessed = !1, this._uniforms = {}, this._key = "", this._fallbacks = null, this._vertexSourceCodeOverride = "", this._fragmentSourceCodeOverride = "", this._transformFeedbackVaryings = null, this._pipelineContext = null, this._vertexSourceCode = "", this._fragmentSourceCode = "", this._vertexSourceCodeBeforeMigration = "", this._fragmentSourceCodeBeforeMigration = "", this._rawVertexSourceCode = "", this._rawFragmentSourceCode = "", this.name = baseName, this._key = key;let processCodeAfterIncludes,processFinalCode = null;if (attributesNamesOrOptions.attributes) {const options = attributesNamesOrOptions;if (this._engine = uniformsNamesOrEngine, this._attributesNames = options.attributes, this._uniformsNames = options.uniformsNames.concat(options.samplers), this._samplerList = options.samplers.slice(), this.defines = options.defines, this.onError = options.onError, this.onCompiled = options.onCompiled, this._fallbacks = options.fallbacks, this._indexParameters = options.indexParameters, this._transformFeedbackVaryings = options.transformFeedbackVaryings || null, this._multiTarget = !!options.multiTarget, this._shaderLanguage = null !== (_a = options.shaderLanguage) && void 0 !== _a ? _a : _shaderLanguage_js__WEBPACK_IMPORTED_MODULE_5__/* .ShaderLanguage.GLSL */ .x.GLSL, options.uniformBuffersNames) {this._uniformBuffersNamesList = options.uniformBuffersNames.slice();for (let i = 0; i < options.uniformBuffersNames.length; i++) this._uniformBuffersNames[options.uniformBuffersNames[i]] = i;}processFinalCode = null !== (_b = options.processFinalCode) && void 0 !== _b ? _b : null, processCodeAfterIncludes = null !== (_c = options.processCodeAfterIncludes) && void 0 !== _c ? _c : void 0;} else this._engine = engine, this.defines = null == defines ? "" : defines, this._uniformsNames = uniformsNamesOrEngine.concat(samplers), this._samplerList = samplers ? samplers.slice() : [], this._attributesNames = attributesNamesOrOptions, this._uniformBuffersNamesList = [], this._shaderLanguage = shaderLanguage, this.onError = onError, this.onCompiled = onCompiled, this._indexParameters = indexParameters, this._fallbacks = fallbacks;this._attributeLocationByName = {}, this.uniqueId = Effect._UniqueIdSeed++;let vertexSource, fragmentSource;const hostDocument = (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .CG)() ? this._engine.getHostDocument() : null;baseName.vertexSource ? vertexSource = "source:" + baseName.vertexSource : baseName.vertexElement ? (vertexSource = hostDocument ? hostDocument.getElementById(baseName.vertexElement) : null, !vertexSource && (vertexSource = baseName.vertexElement)) : vertexSource = baseName.vertex || baseName, baseName.fragmentSource ? fragmentSource = "source:" + baseName.fragmentSource : baseName.fragmentElement ? (fragmentSource = hostDocument ? hostDocument.getElementById(baseName.fragmentElement) : null, !fragmentSource && (fragmentSource = baseName.fragmentElement)) : fragmentSource = baseName.fragment || baseName, this._processingContext = this._engine._getShaderProcessingContext(this._shaderLanguage);let processorOptions = { defines: this.defines.split("\n"), indexParameters: this._indexParameters, isFragment: !1, shouldUseHighPrecisionShader: this._engine._shouldUseHighPrecisionShader, processor: this._engine._getShaderProcessor(this._shaderLanguage), supportsUniformBuffers: this._engine.supportsUniformBuffers, shadersRepository: _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.GetShadersRepository */ .v.GetShadersRepository(this._shaderLanguage), includesShadersStore: _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.GetIncludesShadersStore */ .v.GetIncludesShadersStore(this._shaderLanguage), version: (100 * this._engine.version).toString(), platformName: this._engine.shaderPlatformName, processingContext: this._processingContext, isNDCHalfZRange: this._engine.isNDCHalfZRange, useReverseDepthBuffer: this._engine.useReverseDepthBuffer, processCodeAfterIncludes };const shaderCodes = [void 0, void 0],shadersLoaded = () => {if (shaderCodes[0] && shaderCodes[1]) {processorOptions.isFragment = !0;const [migratedVertexCode, fragmentCode] = shaderCodes;_Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_3__/* .ShaderProcessor.Process */ .L.Process(fragmentCode, processorOptions, (migratedFragmentCode, codeBeforeMigration) => {this._fragmentSourceCodeBeforeMigration = codeBeforeMigration, processFinalCode && (migratedFragmentCode = processFinalCode("fragment", migratedFragmentCode));const finalShaders = _Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_3__/* .ShaderProcessor.Finalize */ .L.Finalize(migratedVertexCode, migratedFragmentCode, processorOptions);processorOptions = null, this._useFinalCode(finalShaders.vertexCode, finalShaders.fragmentCode, baseName);}, this._engine);}};this._loadShader(vertexSource, "Vertex", "", (vertexCode) => {_Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_3__/* .ShaderProcessor.Initialize */ .L.Initialize(processorOptions), _Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_3__/* .ShaderProcessor.Process */ .L.Process(vertexCode, processorOptions, (migratedVertexCode, codeBeforeMigration) => {this._rawVertexSourceCode = vertexCode, this._vertexSourceCodeBeforeMigration = codeBeforeMigration, processFinalCode && (migratedVertexCode = processFinalCode("vertex", migratedVertexCode)), shaderCodes[0] = migratedVertexCode, shadersLoaded();}, this._engine);}), this._loadShader(fragmentSource, "Fragment", "Pixel", (fragmentCode) => {this._rawFragmentSourceCode = fragmentCode, shaderCodes[1] = fragmentCode, shadersLoaded();});const proxyFunction = function (functionName) {return function () {if (this._pipelineContext) {const func = this._pipelineContext[functionName];func.apply(this._pipelineContext, arguments);}return this;};};["Int?", "UInt?", "IntArray?", "UIntArray?", "Array?", "Color?", "Vector?", "Float?", "Matrices", "Matrix", "Matrix3x3", "Matrix2x2", "Quaternion", "DirectColor4"].forEach((functionName) => {const name = `set${functionName}`;name.endsWith("?") ? ["", 2, 3, 4].forEach((n) => {this[name.slice(0, -1) + n] = this[name.slice(0, -1) + n] || proxyFunction(name.slice(0, -1) + n).bind(this);}) : this[name] = this[name] || proxyFunction(name).bind(this);});}_useFinalCode(migratedVertexCode, migratedFragmentCode, baseName) {if (baseName) {const vertex = baseName.vertexElement || baseName.vertex || baseName.spectorName || baseName,fragment = baseName.fragmentElement || baseName.fragment || baseName.spectorName || baseName;this._vertexSourceCode = (this._shaderLanguage === _shaderLanguage_js__WEBPACK_IMPORTED_MODULE_5__/* .ShaderLanguage.WGSL */ .x.WGSL ? "//" : "") + "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode, this._fragmentSourceCode = (this._shaderLanguage === _shaderLanguage_js__WEBPACK_IMPORTED_MODULE_5__/* .ShaderLanguage.WGSL */ .x.WGSL ? "//" : "") + "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode;} else this._vertexSourceCode = migratedVertexCode, this._fragmentSourceCode = migratedFragmentCode;this._prepareEffect();}get key() {return this._key;}isReady() {try {return this._isReadyInternal();} catch (_a) {return !1;}}_isReadyInternal() {return !!this._isReady || !!this._pipelineContext && this._pipelineContext.isReady;}getEngine() {return this._engine;}getPipelineContext() {return this._pipelineContext;}getAttributesNames() {return this._attributesNames;}getAttributeLocation(index) {return this._attributes[index];}getAttributeLocationByName(name) {return this._attributeLocationByName[name];}getAttributesCount() {return this._attributes.length;}getUniformIndex(uniformName) {return this._uniformsNames.indexOf(uniformName);}getUniform(uniformName) {return this._uniforms[uniformName];}getSamplers() {return this._samplerList;}getUniformNames() {return this._uniformsNames;}getUniformBuffersNames() {return this._uniformBuffersNamesList;}getIndexParameters() {return this._indexParameters;}getCompilationError() {return this._compilationError;}allFallbacksProcessed() {return this._allFallbacksProcessed;}executeWhenCompiled(func) {return this.isReady() ? void func(this) : void (this.onCompileObservable.add((effect) => {func(effect);}), (!this._pipelineContext || this._pipelineContext.isAsync) && setTimeout(() => {this._checkIsReady(null);}, 16));}_checkIsReady(previousPipelineContext) {try {if (this._isReadyInternal()) return;} catch (e) {return void this._processCompilationErrors(e, previousPipelineContext);}this._isDisposed || setTimeout(() => {this._checkIsReady(previousPipelineContext);}, 16);}_loadShader(shader, key, optionalKey, callback) {if ("undefined" != typeof HTMLElement && shader instanceof HTMLElement) {const shaderCode = (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .GetDOMTextContent */ .v)(shader);return void callback(shaderCode);}if ("source:" === shader.substr(0, 7)) return void callback(shader.substr(7));if ("base64:" === shader.substr(0, 7)) {const shaderBinary = window.atob(shader.substr(7));return void callback(shaderBinary);}const shaderStore = _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.GetShadersStore */ .v.GetShadersStore(this._shaderLanguage);if (shaderStore[shader + key + "Shader"]) return void callback(shaderStore[shader + key + "Shader"]);if (optionalKey && shaderStore[shader + optionalKey + "Shader"]) return void callback(shaderStore[shader + optionalKey + "Shader"]);let shaderUrl;shaderUrl = "." === shader[0] || "/" === shader[0] || -1 < shader.indexOf("http") ? shader : _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.GetShadersRepository */ .v.GetShadersRepository(this._shaderLanguage) + shader, this._engine._loadFile(shaderUrl + "." + key.toLowerCase() + ".fx", callback);}get vertexSourceCode() {var _a, _b;return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? this._vertexSourceCodeOverride : null !== (_b = null === (_a = this._pipelineContext) || void 0 === _a ? void 0 : _a._getVertexShaderCode()) && void 0 !== _b ? _b : this._vertexSourceCode;}get fragmentSourceCode() {var _a, _b;return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? this._fragmentSourceCodeOverride : null !== (_b = null === (_a = this._pipelineContext) || void 0 === _a ? void 0 : _a._getFragmentShaderCode()) && void 0 !== _b ? _b : this._fragmentSourceCode;}get vertexSourceCodeBeforeMigration() {return this._vertexSourceCodeBeforeMigration;}get fragmentSourceCodeBeforeMigration() {return this._fragmentSourceCodeBeforeMigration;}get rawVertexSourceCode() {return this._rawVertexSourceCode;}get rawFragmentSourceCode() {return this._rawFragmentSourceCode;}_rebuildProgram(vertexSourceCode, fragmentSourceCode, onCompiled, onError) {this._isReady = !1, this._vertexSourceCodeOverride = vertexSourceCode, this._fragmentSourceCodeOverride = fragmentSourceCode, this.onError = (effect, error) => {onError && onError(error);}, this.onCompiled = () => {const scenes = this.getEngine().scenes;if (scenes) for (let i = 0; i < scenes.length; i++) scenes[i].markAllMaterialsAsDirty(63);this._pipelineContext._handlesSpectorRebuildCallback(onCompiled);}, this._fallbacks = null, this._prepareEffect();}_prepareEffect() {const attributesNames = this._attributesNames,defines = this.defines,previousPipelineContext = this._pipelineContext;this._isReady = !1;try {const engine = this._engine;this._pipelineContext = engine.createPipelineContext(this._processingContext), this._pipelineContext._name = this._key;const rebuildRebind = this._rebuildProgram.bind(this);this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? engine._preparePipelineContext(this._pipelineContext, this._vertexSourceCodeOverride, this._fragmentSourceCodeOverride, !0, this._rawVertexSourceCode, this._rawFragmentSourceCode, rebuildRebind, null, this._transformFeedbackVaryings, this._key) : engine._preparePipelineContext(this._pipelineContext, this._vertexSourceCode, this._fragmentSourceCode, !1, this._rawVertexSourceCode, this._rawFragmentSourceCode, rebuildRebind, defines, this._transformFeedbackVaryings, this._key), engine._executeWhenRenderingStateIsCompiled(this._pipelineContext, () => {if (this._attributes = [], this._pipelineContext._fillEffectInformation(this, this._uniformBuffersNames, this._uniformsNames, this._uniforms, this._samplerList, this._samplers, attributesNames, this._attributes), attributesNames) for (let i = 0; i < attributesNames.length; i++) {const name = attributesNames[i];this._attributeLocationByName[name] = this._attributes[i];}engine.bindSamplers(this), this._compilationError = "", this._isReady = !0, this.onCompiled && this.onCompiled(this), this.onCompileObservable.notifyObservers(this), this.onCompileObservable.clear(), this._fallbacks && this._fallbacks.unBindMesh(), previousPipelineContext && this.getEngine()._deletePipelineContext(previousPipelineContext);}), this._pipelineContext.isAsync && this._checkIsReady(previousPipelineContext);} catch (e) {this._processCompilationErrors(e, previousPipelineContext);}}_getShaderCodeAndErrorLine(code, error, isFragment) {const regexp = isFragment ? /FRAGMENT SHADER ERROR: 0:(\d+?):/ : /VERTEX SHADER ERROR: 0:(\d+?):/;let errorLine = null;if (error && code) {const res = error.match(regexp);if (res && 2 === res.length) {const lineNumber = parseInt(res[1]),lines = code.split("\n", -1);lines.length >= lineNumber && (errorLine = `Offending line [${lineNumber}] in ${isFragment ? "fragment" : "vertex"} code: ${lines[lineNumber - 1]}`);}}return [code, errorLine];}_processCompilationErrors(e, previousPipelineContext = null) {var _a, _b, _c;this._compilationError = e.message;const attributesNames = this._attributesNames,fallbacks = this._fallbacks;if (_Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error("Unable to compile effect:"), _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error("Uniforms: " + this._uniformsNames.map(function (uniform) {return " " + uniform;})), _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error("Attributes: " + attributesNames.map(function (attribute) {return " " + attribute;})), _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error("Defines:\r\n" + this.defines), Effect.LogShaderCodeOnCompilationError) {let lineErrorVertex = null,lineErrorFragment = null,code = null;(null === (_a = this._pipelineContext) || void 0 === _a ? void 0 : _a._getVertexShaderCode()) && ([code, lineErrorVertex] = this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(), this._compilationError, !1), code && (_Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error("Vertex code:"), _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error(code))), (null === (_b = this._pipelineContext) || void 0 === _b ? void 0 : _b._getFragmentShaderCode()) && ([code, lineErrorFragment] = this._getShaderCodeAndErrorLine(null === (_c = this._pipelineContext) || void 0 === _c ? void 0 : _c._getFragmentShaderCode(), this._compilationError, !0), code && (_Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error("Fragment code:"), _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error(code))), lineErrorVertex && _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error(lineErrorVertex), lineErrorFragment && _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error(lineErrorFragment);}_Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error("Error: " + this._compilationError);const notifyErrors = () => {this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this);};previousPipelineContext && (this._pipelineContext = previousPipelineContext, this._isReady = !0, notifyErrors()), fallbacks ? (this._pipelineContext = null, fallbacks.hasMoreFallbacks ? (this._allFallbacksProcessed = !1, _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error("Trying next fallback."), this.defines = fallbacks.reduce(this.defines, this), this._prepareEffect()) : (this._allFallbacksProcessed = !0, notifyErrors(), this.onErrorObservable.clear(), this._fallbacks && this._fallbacks.unBindMesh())) : (this._allFallbacksProcessed = !0, !previousPipelineContext && notifyErrors());}get isSupported() {return "" === this._compilationError;}_bindTexture(channel, texture) {this._engine._bindTexture(this._samplers[channel], texture, channel);}setTexture(channel, texture) {this._engine.setTexture(this._samplers[channel], this._uniforms[channel], texture, channel);}setDepthStencilTexture(channel, texture) {this._engine.setDepthStencilTexture(this._samplers[channel], this._uniforms[channel], texture, channel);}setTextureArray(channel, textures) {const exName = channel + "Ex";if (-1 === this._samplerList.indexOf(exName + "0")) {const initialPos = this._samplerList.indexOf(channel);for (let index = 1; index < textures.length; index++) {const currentExName = exName + (index - 1).toString();this._samplerList.splice(initialPos + index, 0, currentExName);}let channelIndex = 0;for (const key of this._samplerList) this._samplers[key] = channelIndex, channelIndex += 1;}this._engine.setTextureArray(this._samplers[channel], this._uniforms[channel], textures, channel);}setTextureFromPostProcess(channel, postProcess) {this._engine.setTextureFromPostProcess(this._samplers[channel], postProcess, channel);}setTextureFromPostProcessOutput(channel, postProcess) {this._engine.setTextureFromPostProcessOutput(this._samplers[channel], postProcess, channel);}bindUniformBuffer(buffer, name) {const bufferName = this._uniformBuffersNames[name];void 0 === bufferName || Effect._BaseCache[bufferName] === buffer && this._engine._features.useUBOBindingCache || (Effect._BaseCache[bufferName] = buffer, this._engine.bindUniformBufferBase(buffer, bufferName, name));}bindUniformBlock(blockName, index) {this._engine.bindUniformBlock(this._pipelineContext, blockName, index);}setFloatArray(uniformName, array) {return this._pipelineContext.setArray(uniformName, array), this;}setFloatArray2(uniformName, array) {return this._pipelineContext.setArray2(uniformName, array), this;}setFloatArray3(uniformName, array) {return this._pipelineContext.setArray3(uniformName, array), this;}setFloatArray4(uniformName, array) {return this._pipelineContext.setArray4(uniformName, array), this;}setBool(uniformName, bool) {return this._pipelineContext.setInt(uniformName, bool ? 1 : 0), this;}dispose() {var _a;null === (_a = this._pipelineContext) || void 0 === _a ? void 0 : _a.dispose(), this._engine._releaseEffect(this), this._isDisposed = !0;}static RegisterShader(name, pixelShader, vertexShader, shaderLanguage = _shaderLanguage_js__WEBPACK_IMPORTED_MODULE_5__/* .ShaderLanguage.GLSL */ .x.GLSL) {pixelShader && (_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.GetShadersStore */ .v.GetShadersStore(shaderLanguage)[`${name}PixelShader`] = pixelShader), vertexShader && (_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.GetShadersStore */ .v.GetShadersStore(shaderLanguage)[`${name}VertexShader`] = vertexShader);}static ResetCache() {Effect._BaseCache = {};}}Effect.LogShaderCodeOnCompilationError = !0, Effect._UniqueIdSeed = 0, Effect._BaseCache = {}, Effect.ShadersStore = _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.ShadersStore */ .v.ShadersStore, Effect.IncludesShadersStore = _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_4__/* .ShaderStore.IncludesShadersStore */ .v.IncludesShadersStore;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/effectFallbacks.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "L": () => (/* binding */ EffectFallbacks)
/* harmony export */ });
class EffectFallbacks {constructor() {this._defines = {}, this._currentRank = 32, this._maxRank = -1, this._mesh = null;}unBindMesh() {this._mesh = null;}addFallback(rank, define) {this._defines[rank] || (rank < this._currentRank && (this._currentRank = rank), rank > this._maxRank && (this._maxRank = rank), this._defines[rank] = []), this._defines[rank].push(define);}addCPUSkinningFallback(rank, mesh) {this._mesh = mesh, rank < this._currentRank && (this._currentRank = rank), rank > this._maxRank && (this._maxRank = rank);}get hasMoreFallbacks() {return this._currentRank <= this._maxRank;}reduce(currentDefines, effect) {if (this._mesh && this._mesh.computeBonesUsingShaders && 0 < this._mesh.numBoneInfluencers) {this._mesh.computeBonesUsingShaders = !1, currentDefines = currentDefines.replace("#define NUM_BONE_INFLUENCERS " + this._mesh.numBoneInfluencers, "#define NUM_BONE_INFLUENCERS 0"), effect._bonesComputationForcedToCPU = !0;const scene = this._mesh.getScene();for (let index = 0; index < scene.meshes.length; index++) {const otherMesh = scene.meshes[index];if (!otherMesh.material) {!this._mesh.material && otherMesh.computeBonesUsingShaders && 0 < otherMesh.numBoneInfluencers && (otherMesh.computeBonesUsingShaders = !1);continue;}if (otherMesh.computeBonesUsingShaders && 0 !== otherMesh.numBoneInfluencers) if (otherMesh.material.getEffect() === effect) otherMesh.computeBonesUsingShaders = !1;else if (otherMesh.subMeshes) for (const subMesh of otherMesh.subMeshes) {const subMeshEffect = subMesh.effect;if (subMeshEffect === effect) {otherMesh.computeBonesUsingShaders = !1;break;}}}} else {const currentFallbacks = this._defines[this._currentRank];if (currentFallbacks) for (let index = 0; index < currentFallbacks.length; index++) currentDefines = currentDefines.replace("#define " + currentFallbacks[index], "");this._currentRank++;}return currentDefines;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/effectRenderer.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "H": () => (/* binding */ EffectWrapper),
/* harmony export */   "I": () => (/* binding */ EffectRenderer)
/* harmony export */ });
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Maths_math_viewport_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.viewport.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _effect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/effect.js");
/* harmony import */ var _drawWrapper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/drawWrapper.js");
/* harmony import */ var _Shaders_postprocess_vertex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Shaders/postprocess.vertex.js");
const defaultOptions = { positions: [1, 1, -1, 1, -1, -1, 1, -1], indices: [0, 1, 2, 0, 2, 3] };class EffectRenderer {constructor(engine, options = defaultOptions) {var _a, _b;this._fullscreenViewport = new _Maths_math_viewport_js__WEBPACK_IMPORTED_MODULE_1__/* .Viewport */ .l(0, 0, 1, 1);const positions = null !== (_a = options.positions) && void 0 !== _a ? _a : defaultOptions.positions,indices = null !== (_b = options.indices) && void 0 !== _b ? _b : defaultOptions.indices;this.engine = engine, this._vertexBuffers = { [_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind]: new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .o(engine, positions, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind, !1, !1, 2) }, this._indexBuffer = engine.createIndexBuffer(indices), this._onContextRestoredObserver = engine.onContextRestoredObservable.add(() => {for (const key in this._indexBuffer = engine.createIndexBuffer(indices), this._vertexBuffers) {const vertexBuffer = this._vertexBuffers[key];vertexBuffer._rebuild();}});}setViewport(viewport = this._fullscreenViewport) {this.engine.setViewport(viewport);}bindBuffers(effect) {this.engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect);}applyEffectWrapper(effectWrapper) {this.engine.setState(!0), this.engine.depthCullingState.depthTest = !1, this.engine.stencilState.stencilTest = !1, this.engine.enableEffect(effectWrapper._drawWrapper), this.bindBuffers(effectWrapper.effect), effectWrapper.onApplyObservable.notifyObservers({});}restoreStates() {this.engine.depthCullingState.depthTest = !0, this.engine.stencilState.stencilTest = !0;}draw() {this.engine.drawElementsType(0, 0, 6);}_isRenderTargetTexture(texture) {return texture.renderTarget !== void 0;}render(effectWrapper, outputTexture = null) {if (effectWrapper.effect.isReady()) {this.setViewport();const out = null === outputTexture ? null : this._isRenderTargetTexture(outputTexture) ? outputTexture.renderTarget : outputTexture;out && this.engine.bindFramebuffer(out), this.applyEffectWrapper(effectWrapper), this.draw(), out && this.engine.unBindFramebuffer(out), this.restoreStates();}}dispose() {const vertexBuffer = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind];vertexBuffer && (vertexBuffer.dispose(), delete this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind]), this._indexBuffer && this.engine._releaseBuffer(this._indexBuffer), this._onContextRestoredObserver && (this.engine.onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null);}}class EffectWrapper {get effect() {return this._drawWrapper.effect;}set effect(effect) {this._drawWrapper.effect = effect;}constructor(creationOptions) {this.onApplyObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$();let effectCreationOptions;const uniformNames = creationOptions.uniformNames || [];creationOptions.vertexShader ? effectCreationOptions = { fragmentSource: creationOptions.fragmentShader, vertexSource: creationOptions.vertexShader, spectorName: creationOptions.name || "effectWrapper" } : (uniformNames.push("scale"), effectCreationOptions = { fragmentSource: creationOptions.fragmentShader, vertex: "postprocess", spectorName: creationOptions.name || "effectWrapper" }, this.onApplyObservable.add(() => {this.effect.setFloat2("scale", 1, 1);}));const defines = creationOptions.defines ? creationOptions.defines.join("\n") : "";this._drawWrapper = new _drawWrapper_js__WEBPACK_IMPORTED_MODULE_4__/* .DrawWrapper */ .q(creationOptions.engine), creationOptions.useShaderStore ? (effectCreationOptions.fragment = effectCreationOptions.fragmentSource, !effectCreationOptions.vertex && (effectCreationOptions.vertex = effectCreationOptions.vertexSource), delete effectCreationOptions.fragmentSource, delete effectCreationOptions.vertexSource, this.effect = creationOptions.engine.createEffect(effectCreationOptions, creationOptions.attributeNames || ["position"], uniformNames, creationOptions.samplerNames, defines, void 0, creationOptions.onCompiled, void 0, void 0, creationOptions.shaderLanguage)) : (this.effect = new _effect_js__WEBPACK_IMPORTED_MODULE_3__/* .Effect */ .Q(effectCreationOptions, creationOptions.attributeNames || ["position"], uniformNames, creationOptions.samplerNames, creationOptions.engine, defines, void 0, creationOptions.onCompiled, void 0, void 0, void 0, creationOptions.shaderLanguage), this._onContextRestoredObserver = creationOptions.engine.onContextRestoredObservable.add(() => {this.effect._pipelineContext = null, this.effect._wasPreviouslyReady = !1, this.effect._prepareEffect();}));}dispose() {this._onContextRestoredObserver && (this.effect.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null), this.effect.dispose();}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$": () => (/* binding */ ImageProcessingConfiguration),
/* harmony export */   "b": () => (/* binding */ ImageProcessingConfigurationDefines)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _Materials_materialDefines_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
/* harmony import */ var _Materials_colorCurves_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/colorCurves.js");
class ImageProcessingConfigurationDefines extends _Materials_materialDefines_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialDefines */ .H {constructor() {super(), this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.EXPOSURE = !1, this.SKIPFINALCOLORCLAMP = !1, this.rebuild();}}class ImageProcessingConfiguration {constructor() {this.colorCurves = new _Materials_colorCurves_js__WEBPACK_IMPORTED_MODULE_6__/* .ColorCurves */ .U(), this._colorCurvesEnabled = !1, this._colorGradingEnabled = !1, this._colorGradingWithGreenDepth = !0, this._colorGradingBGR = !0, this._exposure = 1, this._toneMappingEnabled = !1, this._toneMappingType = ImageProcessingConfiguration.TONEMAPPING_STANDARD, this._contrast = 1, this.vignetteStretch = 0, this.vignetteCenterX = 0, this.vignetteCenterY = 0, this.vignetteWeight = 1.5, this.vignetteColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__/* .Color4 */ .HE(0, 0, 0, 0), this.vignetteCameraFov = .5, this._vignetteBlendMode = ImageProcessingConfiguration.VIGNETTEMODE_MULTIPLY, this._vignetteEnabled = !1, this._ditheringEnabled = !1, this._ditheringIntensity = 1 / 255, this._skipFinalColorClamp = !1, this._applyByPostProcess = !1, this._isEnabled = !0, this.onUpdateParameters = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$();}get colorCurvesEnabled() {return this._colorCurvesEnabled;}set colorCurvesEnabled(value) {this._colorCurvesEnabled === value || (this._colorCurvesEnabled = value, this._updateParameters());}get colorGradingTexture() {return this._colorGradingTexture;}set colorGradingTexture(value) {this._colorGradingTexture === value || (this._colorGradingTexture = value, this._updateParameters());}get colorGradingEnabled() {return this._colorGradingEnabled;}set colorGradingEnabled(value) {this._colorGradingEnabled === value || (this._colorGradingEnabled = value, this._updateParameters());}get colorGradingWithGreenDepth() {return this._colorGradingWithGreenDepth;}set colorGradingWithGreenDepth(value) {this._colorGradingWithGreenDepth === value || (this._colorGradingWithGreenDepth = value, this._updateParameters());}get colorGradingBGR() {return this._colorGradingBGR;}set colorGradingBGR(value) {this._colorGradingBGR === value || (this._colorGradingBGR = value, this._updateParameters());}get exposure() {return this._exposure;}set exposure(value) {this._exposure === value || (this._exposure = value, this._updateParameters());}get toneMappingEnabled() {return this._toneMappingEnabled;}set toneMappingEnabled(value) {this._toneMappingEnabled === value || (this._toneMappingEnabled = value, this._updateParameters());}get toneMappingType() {return this._toneMappingType;}set toneMappingType(value) {this._toneMappingType === value || (this._toneMappingType = value, this._updateParameters());}get contrast() {return this._contrast;}set contrast(value) {this._contrast === value || (this._contrast = value, this._updateParameters());}get vignetteCentreY() {return this.vignetteCenterY;}set vignetteCentreY(value) {this.vignetteCenterY = value;}get vignetteCentreX() {return this.vignetteCenterX;}set vignetteCentreX(value) {this.vignetteCenterX = value;}get vignetteBlendMode() {return this._vignetteBlendMode;}set vignetteBlendMode(value) {this._vignetteBlendMode === value || (this._vignetteBlendMode = value, this._updateParameters());}get vignetteEnabled() {return this._vignetteEnabled;}set vignetteEnabled(value) {this._vignetteEnabled === value || (this._vignetteEnabled = value, this._updateParameters());}get ditheringEnabled() {return this._ditheringEnabled;}set ditheringEnabled(value) {this._ditheringEnabled === value || (this._ditheringEnabled = value, this._updateParameters());}get ditheringIntensity() {return this._ditheringIntensity;}set ditheringIntensity(value) {this._ditheringIntensity === value || (this._ditheringIntensity = value, this._updateParameters());}get skipFinalColorClamp() {return this._skipFinalColorClamp;}set skipFinalColorClamp(value) {this._skipFinalColorClamp === value || (this._skipFinalColorClamp = value, this._updateParameters());}get applyByPostProcess() {return this._applyByPostProcess;}set applyByPostProcess(value) {this._applyByPostProcess === value || (this._applyByPostProcess = value, this._updateParameters());}get isEnabled() {return this._isEnabled;}set isEnabled(value) {this._isEnabled === value || (this._isEnabled = value, this._updateParameters());}_updateParameters() {this.onUpdateParameters.notifyObservers(this);}getClassName() {return "ImageProcessingConfiguration";}static PrepareUniforms(uniforms, defines) {defines.EXPOSURE && uniforms.push("exposureLinear"), defines.CONTRAST && uniforms.push("contrast"), defines.COLORGRADING && uniforms.push("colorTransformSettings"), (defines.VIGNETTE || defines.DITHER) && uniforms.push("vInverseScreenSize"), defines.VIGNETTE && (uniforms.push("vignetteSettings1"), uniforms.push("vignetteSettings2")), defines.COLORCURVES && _Materials_colorCurves_js__WEBPACK_IMPORTED_MODULE_6__/* .ColorCurves.PrepareUniforms */ .U.PrepareUniforms(uniforms), defines.DITHER && uniforms.push("ditherIntensity");}static PrepareSamplers(samplersList, defines) {defines.COLORGRADING && samplersList.push("txColorTransform");}prepareDefines(defines, forPostProcess = !1) {if (forPostProcess !== this.applyByPostProcess || !this._isEnabled) return defines.VIGNETTE = !1, defines.TONEMAPPING = !1, defines.TONEMAPPING_ACES = !1, defines.CONTRAST = !1, defines.EXPOSURE = !1, defines.COLORCURVES = !1, defines.COLORGRADING = !1, defines.COLORGRADING3D = !1, defines.DITHER = !1, defines.IMAGEPROCESSING = !1, defines.SKIPFINALCOLORCLAMP = this.skipFinalColorClamp, void (defines.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess && this._isEnabled);switch (defines.VIGNETTE = this.vignetteEnabled, defines.VIGNETTEBLENDMODEMULTIPLY = this.vignetteBlendMode === ImageProcessingConfiguration._VIGNETTEMODE_MULTIPLY, defines.VIGNETTEBLENDMODEOPAQUE = !defines.VIGNETTEBLENDMODEMULTIPLY, defines.TONEMAPPING = this.toneMappingEnabled, this._toneMappingType) {case ImageProcessingConfiguration.TONEMAPPING_ACES:defines.TONEMAPPING_ACES = !0;break;default:defines.TONEMAPPING_ACES = !1;}defines.CONTRAST = 1 !== this.contrast, defines.EXPOSURE = 1 !== this.exposure, defines.COLORCURVES = this.colorCurvesEnabled && !!this.colorCurves, defines.COLORGRADING = this.colorGradingEnabled && !!this.colorGradingTexture, defines.COLORGRADING3D = !!defines.COLORGRADING && this.colorGradingTexture.is3D, defines.SAMPLER3DGREENDEPTH = this.colorGradingWithGreenDepth, defines.SAMPLER3DBGRMAP = this.colorGradingBGR, defines.DITHER = this._ditheringEnabled, defines.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess, defines.SKIPFINALCOLORCLAMP = this.skipFinalColorClamp, defines.IMAGEPROCESSING = defines.VIGNETTE || defines.TONEMAPPING || defines.CONTRAST || defines.EXPOSURE || defines.COLORCURVES || defines.COLORGRADING || defines.DITHER;}isReady() {return !this.colorGradingEnabled || !this.colorGradingTexture || this.colorGradingTexture.isReady();}bind(effect, overrideAspectRatio) {if (this._colorCurvesEnabled && this.colorCurves && _Materials_colorCurves_js__WEBPACK_IMPORTED_MODULE_6__/* .ColorCurves.Bind */ .U.Bind(this.colorCurves, effect), this._vignetteEnabled || this._ditheringEnabled) {const inverseWidth = 1 / effect.getEngine().getRenderWidth(),inverseHeight = 1 / effect.getEngine().getRenderHeight();if (effect.setFloat2("vInverseScreenSize", inverseWidth, inverseHeight), this._ditheringEnabled && effect.setFloat("ditherIntensity", .5 * this._ditheringIntensity), this._vignetteEnabled) {const aspectRatio = null == overrideAspectRatio ? inverseHeight / inverseWidth : overrideAspectRatio;let vignetteScaleY = Math.tan(.5 * this.vignetteCameraFov),vignetteScaleX = vignetteScaleY * aspectRatio;const vignetteScaleGeometricMean = Math.sqrt(vignetteScaleX * vignetteScaleY);vignetteScaleX = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools.Mix */ .w1.Mix(vignetteScaleX, vignetteScaleGeometricMean, this.vignetteStretch), vignetteScaleY = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools.Mix */ .w1.Mix(vignetteScaleY, vignetteScaleGeometricMean, this.vignetteStretch), effect.setFloat4("vignetteSettings1", vignetteScaleX, vignetteScaleY, -vignetteScaleX * this.vignetteCenterX, -vignetteScaleY * this.vignetteCenterY);const vignettePower = -2 * this.vignetteWeight;effect.setFloat4("vignetteSettings2", this.vignetteColor.r, this.vignetteColor.g, this.vignetteColor.b, vignettePower);}}if (effect.setFloat("exposureLinear", this.exposure), effect.setFloat("contrast", this.contrast), this.colorGradingTexture) {effect.setTexture("txColorTransform", this.colorGradingTexture);const textureSize = this.colorGradingTexture.getSize().height;effect.setFloat4("colorTransformSettings", (textureSize - 1) / textureSize, .5 / textureSize, textureSize, this.colorGradingTexture.level);}}clone() {return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Clone */ .p4.Clone(() => new ImageProcessingConfiguration(), this);}serialize() {return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Serialize */ .p4.Serialize(this);}static Parse(source) {const parsed = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(() => new ImageProcessingConfiguration(), source, null, null);return void 0 !== source.vignetteCentreX && (parsed.vignetteCenterX = source.vignetteCentreX), void 0 !== source.vignetteCentreY && (parsed.vignetteCenterY = source.vignetteCentreY), parsed;}static get VIGNETTEMODE_MULTIPLY() {return this._VIGNETTEMODE_MULTIPLY;}static get VIGNETTEMODE_OPAQUE() {return this._VIGNETTEMODE_OPAQUE;}}ImageProcessingConfiguration.TONEMAPPING_STANDARD = 0, ImageProcessingConfiguration.TONEMAPPING_ACES = 1, ImageProcessingConfiguration._VIGNETTEMODE_MULTIPLY = 0, ImageProcessingConfiguration._VIGNETTEMODE_OPAQUE = 1, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColorCurves */ .N$)()], ImageProcessingConfiguration.prototype, "colorCurves", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_colorCurvesEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .oU)("colorGradingTexture")], ImageProcessingConfiguration.prototype, "_colorGradingTexture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_colorGradingEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_colorGradingWithGreenDepth", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_colorGradingBGR", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_exposure", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_toneMappingEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_toneMappingType", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_contrast", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "vignetteStretch", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "vignetteCenterX", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "vignetteCenterY", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "vignetteWeight", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor4 */ .XX)()], ImageProcessingConfiguration.prototype, "vignetteColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "vignetteCameraFov", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_vignetteBlendMode", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_vignetteEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_ditheringEnabled", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_ditheringIntensity", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_skipFinalColorClamp", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_applyByPostProcess", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], ImageProcessingConfiguration.prototype, "_isEnabled", void 0), _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper._ImageProcessingConfigurationParser */ .p4._ImageProcessingConfigurationParser = ImageProcessingConfiguration.Parse;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "G": () => (/* binding */ MaterialDetailMapDefines),
/* harmony export */   "p": () => (/* binding */ DetailMapConfiguration)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _material_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialFlags.js");
/* harmony import */ var _materialHelper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginBase.js");
class MaterialDetailMapDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialDefines */ .H {constructor() {super(...arguments), this.DETAIL = !1, this.DETAILDIRECTUV = 0, this.DETAIL_NORMALBLENDMETHOD = 0;}}class DetailMapConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_6__/* .MaterialPluginBase */ .n {_markAllSubMeshesAsTexturesDirty() {this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();}constructor(material, addToPluginList = !0) {super(material, "DetailMap", 140, new MaterialDetailMapDefines(), addToPluginList), this._texture = null, this.diffuseBlendLevel = 1, this.roughnessBlendLevel = 1, this.bumpLevel = 1, this._normalBlendMethod = _material_js__WEBPACK_IMPORTED_MODULE_1__/* .Material.MATERIAL_NORMALBLENDMETHOD_WHITEOUT */ .F.MATERIAL_NORMALBLENDMETHOD_WHITEOUT, this._isEnabled = !1, this.isEnabled = !1, this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];}isReadyForSubMesh(defines, scene, engine) {return !this._isEnabled || !(defines._areTexturesDirty && scene.texturesEnabled && engine.getCaps().standardDerivatives && this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.DetailTextureEnabled */ .k.DetailTextureEnabled && !this._texture.isReady());}prepareDefines(defines, scene) {if (this._isEnabled) {defines.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod;const engine = scene.getEngine();defines._areTexturesDirty && (engine.getCaps().standardDerivatives && this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.DetailTextureEnabled */ .k.DetailTextureEnabled && this._isEnabled ? (_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareDefinesForMergedUV */ .G.PrepareDefinesForMergedUV(this._texture, defines, "DETAIL"), defines.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod) : defines.DETAIL = !1);} else defines.DETAIL = !1;}bindForSubMesh(uniformBuffer, scene) {if (this._isEnabled) {const isFrozen = this._material.isFrozen;uniformBuffer.useUbo && isFrozen && uniformBuffer.isSync || !this._texture || !_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.DetailTextureEnabled */ .k.DetailTextureEnabled || (uniformBuffer.updateFloat4("vDetailInfos", this._texture.coordinatesIndex, this.diffuseBlendLevel, this.bumpLevel, this.roughnessBlendLevel), _materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindTextureMatrix */ .G.BindTextureMatrix(this._texture, uniformBuffer, "detail")), scene.texturesEnabled && this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags.DetailTextureEnabled */ .k.DetailTextureEnabled && uniformBuffer.setTexture("detailSampler", this._texture);}}hasTexture(texture) {return !(this._texture !== texture);}getActiveTextures(activeTextures) {this._texture && activeTextures.push(this._texture);}getAnimatables(animatables) {this._texture && this._texture.animations && 0 < this._texture.animations.length && animatables.push(this._texture);}dispose(forceDisposeTextures) {var _a;forceDisposeTextures && (null === (_a = this._texture) || void 0 === _a ? void 0 : _a.dispose());}getClassName() {return "DetailMapConfiguration";}getSamplers(samplers) {samplers.push("detailSampler");}getUniforms() {return { ubo: [{ name: "vDetailInfos", size: 4, type: "vec4" }, { name: "detailMatrix", size: 16, type: "mat4" }] };}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serializeAsTexture */ .oU)("detailTexture"), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], DetailMapConfiguration.prototype, "texture", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], DetailMapConfiguration.prototype, "diffuseBlendLevel", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], DetailMapConfiguration.prototype, "roughnessBlendLevel", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], DetailMapConfiguration.prototype, "bumpLevel", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], DetailMapConfiguration.prototype, "normalBlendMethod", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)(), (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .expandToProperty */ .wz)("_markAllSubMeshesAsTexturesDirty")], DetailMapConfiguration.prototype, "isEnabled", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/material.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "F": () => (/* binding */ Material)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/tslib.es6.js
var tslib_es6 = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/decorators.js
var decorators = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engineStore.js
var engineStore = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/subMesh.js
var subMesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/subMesh.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/uniformBuffer.js
var uniformBuffer = __webpack_require__("./node_modules/@babylonjs/core/Materials/uniformBuffer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.plane.js
var math_plane = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.plane.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialHelper.js
var materialHelper = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/drawWrapper.js
var drawWrapper = __webpack_require__("./node_modules/@babylonjs/core/Materials/drawWrapper.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/materialStencilState.js
class MaterialStencilState {constructor() {this.reset();}reset() {this.enabled = !1, this.mask = 255, this.func = 519, this.funcRef = 1, this.funcMask = 255, this.opStencilFail = 7680, this.opDepthFail = 7680, this.opStencilDepthPass = 7681;}get func() {return this._func;}set func(value) {this._func = value;}get funcRef() {return this._funcRef;}set funcRef(value) {this._funcRef = value;}get funcMask() {return this._funcMask;}set funcMask(value) {this._funcMask = value;}get opStencilFail() {return this._opStencilFail;}set opStencilFail(value) {this._opStencilFail = value;}get opDepthFail() {return this._opDepthFail;}set opDepthFail(value) {this._opDepthFail = value;}get opStencilDepthPass() {return this._opStencilDepthPass;}set opStencilDepthPass(value) {this._opStencilDepthPass = value;}get mask() {return this._mask;}set mask(value) {this._mask = value;}get enabled() {return this._enabled;}set enabled(value) {this._enabled = value;}getClassName() {return "MaterialStencilState";}copyTo(stencilState) {decorators/* SerializationHelper.Clone */.p4.Clone(() => stencilState, this);}serialize() {return decorators/* SerializationHelper.Serialize */.p4.Serialize(this);}parse(source, scene, rootUrl) {decorators/* SerializationHelper.Parse */.p4.Parse(() => this, source, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MaterialStencilState.prototype, "func", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MaterialStencilState.prototype, "funcRef", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MaterialStencilState.prototype, "funcMask", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MaterialStencilState.prototype, "opStencilFail", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MaterialStencilState.prototype, "opDepthFail", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MaterialStencilState.prototype, "opStencilDepthPass", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MaterialStencilState.prototype, "mask", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MaterialStencilState.prototype, "enabled", null);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialPluginEvent.js
var materialPluginEvent = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginEvent.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/material.js
class Material {get canRenderToMRT() {return !1;}set alpha(value) {if (this._alpha !== value) {const oldValue = this._alpha;this._alpha = value, (1 === oldValue || 1 === value) && this.markAsDirty(Material.MiscDirtyFlag);}}get alpha() {return this._alpha;}set backFaceCulling(value) {this._backFaceCulling === value || (this._backFaceCulling = value, this.markAsDirty(Material.TextureDirtyFlag));}get backFaceCulling() {return this._backFaceCulling;}set cullBackFaces(value) {this._cullBackFaces === value || (this._cullBackFaces = value, this.markAsDirty(Material.TextureDirtyFlag));}get cullBackFaces() {return this._cullBackFaces;}get blockDirtyMechanism() {return this._blockDirtyMechanism;}set blockDirtyMechanism(value) {this._blockDirtyMechanism === value || (this._blockDirtyMechanism = value, !value && this.markDirty());}atomicMaterialsUpdate(callback) {this.blockDirtyMechanism = !0;try {callback(this);} finally {this.blockDirtyMechanism = !1;}}get hasRenderTargetTextures() {return this._eventInfo.hasRenderTargetTextures = !1, this._callbackPluginEventHasRenderTargetTextures(this._eventInfo), this._eventInfo.hasRenderTargetTextures;}set onDispose(callback) {this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(callback);}get onBindObservable() {return this._onBindObservable || (this._onBindObservable = new observable/* Observable */.y$()), this._onBindObservable;}set onBind(callback) {this._onBindObserver && this.onBindObservable.remove(this._onBindObserver), this._onBindObserver = this.onBindObservable.add(callback);}get onUnBindObservable() {return this._onUnBindObservable || (this._onUnBindObservable = new observable/* Observable */.y$()), this._onUnBindObservable;}get onEffectCreatedObservable() {return this._onEffectCreatedObservable || (this._onEffectCreatedObservable = new observable/* Observable */.y$()), this._onEffectCreatedObservable;}set alphaMode(value) {this._alphaMode === value || (this._alphaMode = value, this.markAsDirty(Material.TextureDirtyFlag));}get alphaMode() {return this._alphaMode;}set needDepthPrePass(value) {this._needDepthPrePass === value || (this._needDepthPrePass = value, this._needDepthPrePass && (this.checkReadyOnEveryCall = !0));}get needDepthPrePass() {return this._needDepthPrePass;}get isPrePassCapable() {return !1;}set fogEnabled(value) {this._fogEnabled === value || (this._fogEnabled = value, this.markAsDirty(Material.MiscDirtyFlag));}get fogEnabled() {return this._fogEnabled;}get wireframe() {switch (this._fillMode) {case Material.WireFrameFillMode:case Material.LineListDrawMode:case Material.LineLoopDrawMode:case Material.LineStripDrawMode:return !0;}return this._scene.forceWireframe;}set wireframe(value) {this.fillMode = value ? Material.WireFrameFillMode : Material.TriangleFillMode;}get pointsCloud() {switch (this._fillMode) {case Material.PointFillMode:case Material.PointListDrawMode:return !0;}return this._scene.forcePointsCloud;}set pointsCloud(value) {this.fillMode = value ? Material.PointFillMode : Material.TriangleFillMode;}get fillMode() {return this._fillMode;}set fillMode(value) {this._fillMode === value || (this._fillMode = value, this.markAsDirty(Material.MiscDirtyFlag));}_getDrawWrapper() {return this._drawWrapper;}_setDrawWrapper(drawWrapper) {this._drawWrapper = drawWrapper;}constructor(name, scene, doNotAdd) {this.shadowDepthWrapper = null, this.allowShaderHotSwapping = !0, this.metadata = null, this.reservedDataStore = null, this.checkReadyOnEveryCall = !1, this.checkReadyOnlyOnce = !1, this.state = "", this._alpha = 1, this._backFaceCulling = !0, this._cullBackFaces = !0, this._blockDirtyMechanism = !1, this.onCompiled = null, this.onError = null, this.getRenderTargetTextures = null, this.doNotSerialize = !1, this._storeEffectOnSubMeshes = !1, this.animations = null, this.onDisposeObservable = new observable/* Observable */.y$(), this._onDisposeObserver = null, this._onUnBindObservable = null, this._onBindObserver = null, this._alphaMode = 2, this._needDepthPrePass = !1, this.disableDepthWrite = !1, this.disableColorWrite = !1, this.forceDepthWrite = !1, this.depthFunction = 0, this.separateCullingPass = !1, this._fogEnabled = !0, this.pointSize = 1, this.zOffset = 0, this.zOffsetUnits = 0, this.stencil = new MaterialStencilState(), this._useUBO = !1, this._fillMode = Material.TriangleFillMode, this._cachedDepthWriteState = !1, this._cachedColorWriteState = !1, this._cachedDepthFunctionState = 0, this._indexInSceneMaterialArray = -1, this.meshMap = null, this._parentContainer = null, this._uniformBufferLayoutBuilt = !1, this._eventInfo = {}, this._callbackPluginEventGeneric = () => void 0, this._callbackPluginEventIsReadyForSubMesh = () => void 0, this._callbackPluginEventPrepareDefines = () => void 0, this._callbackPluginEventPrepareDefinesBeforeAttributes = () => void 0, this._callbackPluginEventHardBindForSubMesh = () => void 0, this._callbackPluginEventBindForSubMesh = () => void 0, this._callbackPluginEventHasRenderTargetTextures = () => void 0, this._callbackPluginEventFillRenderTargetTextures = () => void 0, this._forceAlphaTest = !1, this._transparencyMode = null, this.name = name;const setScene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;setScene && (this._scene = setScene, this._dirtyCallbacks = {}, this._dirtyCallbacks[1] = this._markAllSubMeshesAsTexturesDirty.bind(this), this._dirtyCallbacks[2] = this._markAllSubMeshesAsLightsDirty.bind(this), this._dirtyCallbacks[4] = this._markAllSubMeshesAsFresnelDirty.bind(this), this._dirtyCallbacks[8] = this._markAllSubMeshesAsAttributesDirty.bind(this), this._dirtyCallbacks[16] = this._markAllSubMeshesAsMiscDirty.bind(this), this._dirtyCallbacks[32] = this._markAllSubMeshesAsPrePassDirty.bind(this), this._dirtyCallbacks[63] = this._markAllSubMeshesAsAllDirty.bind(this), this.id = name || tools/* Tools.RandomId */.w1.RandomId(), this.uniqueId = this._scene.getUniqueId(), this._materialContext = this._scene.getEngine().createMaterialContext(), this._drawWrapper = new drawWrapper/* DrawWrapper */.q(this._scene.getEngine(), !1), this._drawWrapper.materialContext = this._materialContext, this.sideOrientation = this._scene.useRightHandedSystem ? Material.ClockWiseSideOrientation : Material.CounterClockWiseSideOrientation, this._uniformBuffer = new uniformBuffer/* UniformBuffer */.M(this._scene.getEngine(), void 0, void 0, name), this._useUBO = this.getScene().getEngine().supportsUniformBuffers, !doNotAdd && this._scene.addMaterial(this), this._scene.useMaterialMeshMap && (this.meshMap = {}), Material.OnEventObservable.notifyObservers(this, materialPluginEvent/* MaterialPluginEvent.Created */.S.Created));}toString() {const ret = "Name: " + this.name;return ret;}getClassName() {return "Material";}get _isMaterial() {return !0;}get isFrozen() {return this.checkReadyOnlyOnce;}freeze() {this.markDirty(), this.checkReadyOnlyOnce = !0;}unfreeze() {this.markDirty(), this.checkReadyOnlyOnce = !1;}isReady() {return !0;}isReadyForSubMesh(mesh, subMesh) {const defines = subMesh.materialDefines;return !!defines && (this._eventInfo.isReadyForSubMesh = !0, this._eventInfo.defines = defines, this._callbackPluginEventIsReadyForSubMesh(this._eventInfo), this._eventInfo.isReadyForSubMesh);}getEffect() {return this._drawWrapper.effect;}getScene() {return this._scene;}get transparencyMode() {return this._transparencyMode;}set transparencyMode(value) {this._transparencyMode === value || (this._transparencyMode = value, this._forceAlphaTest = value === Material.MATERIAL_ALPHATESTANDBLEND, this._markAllSubMeshesAsTexturesAndMiscDirty());}get _disableAlphaBlending() {return this._transparencyMode === Material.MATERIAL_OPAQUE || this._transparencyMode === Material.MATERIAL_ALPHATEST;}needAlphaBlending() {return !this._disableAlphaBlending && 1 > this.alpha;}needAlphaBlendingForMesh(mesh) {return !!(1 > mesh.visibility) || !this._disableAlphaBlending && (mesh.hasVertexAlpha || this.needAlphaBlending());}needAlphaTesting() {return !!this._forceAlphaTest;}_shouldTurnAlphaTestOn(mesh) {return !this.needAlphaBlendingForMesh(mesh) && this.needAlphaTesting();}getAlphaTestTexture() {return null;}markDirty(forceMaterialDirty = !1) {const meshes = this.getScene().meshes;for (const mesh of meshes) if (mesh.subMeshes) for (const subMesh of mesh.subMeshes) subMesh.getMaterial() === this && subMesh.effect && (subMesh.effect._wasPreviouslyReady = !1, subMesh.effect._wasPreviouslyUsingInstances = null, subMesh.effect._forceRebindOnNextCall = forceMaterialDirty);forceMaterialDirty && this.markAsDirty(Material.AllDirtyFlag);}_preBind(effect, overrideOrientation = null) {const engine = this._scene.getEngine(),orientation = null == overrideOrientation ? this.sideOrientation : overrideOrientation,reverse = orientation === Material.ClockWiseSideOrientation;return engine.enableEffect(effect ? effect : this._getDrawWrapper()), engine.setState(this.backFaceCulling, this.zOffset, !1, reverse, this._scene._mirroredCameraPosition ? !this.cullBackFaces : this.cullBackFaces, this.stencil, this.zOffsetUnits), reverse;}bind() {}buildUniformLayout() {const ubo = this._uniformBuffer;this._eventInfo.ubo = ubo, this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.PrepareUniformBuffer */.S.PrepareUniformBuffer, this._eventInfo), ubo.create(), this._uniformBufferLayoutBuilt = !0;}bindForSubMesh(world, mesh, subMesh) {const effect = subMesh.effect;effect && (this._eventInfo.subMesh = subMesh, this._callbackPluginEventBindForSubMesh(this._eventInfo), effect._forceRebindOnNextCall = !1);}bindOnlyWorldMatrix() {}bindView(effect) {this._useUBO ? this._needToBindSceneUbo = !0 : effect.setMatrix("view", this.getScene().getViewMatrix());}bindViewProjection(effect) {this._useUBO ? this._needToBindSceneUbo = !0 : (effect.setMatrix("viewProjection", this.getScene().getTransformMatrix()), effect.setMatrix("projection", this.getScene().getProjectionMatrix()));}bindEyePosition(effect, variableName) {this._useUBO ? this._needToBindSceneUbo = !0 : this._scene.bindEyePosition(effect, variableName);}_afterBind(mesh, effect = null) {if (this._scene._cachedMaterial = this, this._needToBindSceneUbo && effect && (this._needToBindSceneUbo = !1, materialHelper/* MaterialHelper.BindSceneUniformBuffer */.G.BindSceneUniformBuffer(effect, this.getScene().getSceneUniformBuffer()), this._scene.finalizeSceneUbo()), this._scene._cachedVisibility = mesh ? mesh.visibility : 1, this._onBindObservable && mesh && this._onBindObservable.notifyObservers(mesh), this.disableDepthWrite) {const engine = this._scene.getEngine();this._cachedDepthWriteState = engine.getDepthWrite(), engine.setDepthWrite(!1);}if (this.disableColorWrite) {const engine = this._scene.getEngine();this._cachedColorWriteState = engine.getColorWrite(), engine.setColorWrite(!1);}if (0 !== this.depthFunction) {const engine = this._scene.getEngine();this._cachedDepthFunctionState = engine.getDepthFunction() || 0, engine.setDepthFunction(this.depthFunction);}}unbind() {if (this._onUnBindObservable && this._onUnBindObservable.notifyObservers(this), 0 !== this.depthFunction) {const engine = this._scene.getEngine();engine.setDepthFunction(this._cachedDepthFunctionState);}if (this.disableDepthWrite) {const engine = this._scene.getEngine();engine.setDepthWrite(this._cachedDepthWriteState);}if (this.disableColorWrite) {const engine = this._scene.getEngine();engine.setColorWrite(this._cachedColorWriteState);}}getAnimatables() {return this._eventInfo.animatables = [], this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.GetAnimatables */.S.GetAnimatables, this._eventInfo), this._eventInfo.animatables;}getActiveTextures() {return this._eventInfo.activeTextures = [], this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.GetActiveTextures */.S.GetActiveTextures, this._eventInfo), this._eventInfo.activeTextures;}hasTexture(texture) {return this._eventInfo.hasTexture = !1, this._eventInfo.texture = texture, this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.HasTexture */.S.HasTexture, this._eventInfo), this._eventInfo.hasTexture;}clone() {return null;}getBindedMeshes() {if (this.meshMap) {const result = [];for (const meshId in this.meshMap) {const mesh = this.meshMap[meshId];mesh && result.push(mesh);}return result;} else {const meshes = this._scene.meshes;return meshes.filter((mesh) => mesh.material === this);}}forceCompilation(mesh, onCompiled, options, onError) {const localOptions = { clipPlane: !1, useInstances: !1, ...options },scene = this.getScene(),currentHotSwapingState = this.allowShaderHotSwapping;this.allowShaderHotSwapping = !1;const checkReady = () => {if (this._scene && this._scene.getEngine()) {const clipPlaneState = scene.clipPlane;if (localOptions.clipPlane && (scene.clipPlane = new math_plane/* Plane */.J(0, 0, 0, 1)), this._storeEffectOnSubMeshes) {let allDone = !0,lastError = null;if (mesh.subMeshes) {const tempSubMesh = new subMesh/* SubMesh */.P(0, 0, 0, 0, 0, mesh, void 0, !1, !1);tempSubMesh.materialDefines && (tempSubMesh.materialDefines._renderId = -1), this.isReadyForSubMesh(mesh, tempSubMesh, localOptions.useInstances) || (tempSubMesh.effect && tempSubMesh.effect.getCompilationError() && tempSubMesh.effect.allFallbacksProcessed() ? lastError = tempSubMesh.effect.getCompilationError() : (allDone = !1, setTimeout(checkReady, 16)));}allDone && (this.allowShaderHotSwapping = currentHotSwapingState, lastError && onError && onError(lastError), onCompiled && onCompiled(this));} else this.isReady() ? (this.allowShaderHotSwapping = currentHotSwapingState, onCompiled && onCompiled(this)) : setTimeout(checkReady, 16);localOptions.clipPlane && (scene.clipPlane = clipPlaneState);}};checkReady();}forceCompilationAsync(mesh, options) {return new Promise((resolve, reject) => {this.forceCompilation(mesh, () => {resolve();}, options, (reason) => {reject(reason);});});}markAsDirty(flag) {this.getScene().blockMaterialDirtyMechanism || this._blockDirtyMechanism || (Material._DirtyCallbackArray.length = 0, flag & Material.TextureDirtyFlag && Material._DirtyCallbackArray.push(Material._TextureDirtyCallBack), flag & Material.LightDirtyFlag && Material._DirtyCallbackArray.push(Material._LightsDirtyCallBack), flag & Material.FresnelDirtyFlag && Material._DirtyCallbackArray.push(Material._FresnelDirtyCallBack), flag & Material.AttributesDirtyFlag && Material._DirtyCallbackArray.push(Material._AttributeDirtyCallBack), flag & Material.MiscDirtyFlag && Material._DirtyCallbackArray.push(Material._MiscDirtyCallBack), flag & Material.PrePassDirtyFlag && Material._DirtyCallbackArray.push(Material._PrePassDirtyCallBack), Material._DirtyCallbackArray.length && this._markAllSubMeshesAsDirty(Material._RunDirtyCallBacks), this.getScene().resetCachedMaterial());}resetDrawCache() {const meshes = this.getScene().meshes;for (const mesh of meshes) if (mesh.subMeshes) for (const subMesh of mesh.subMeshes) subMesh.getMaterial() === this && subMesh.resetDrawCache();}_markAllSubMeshesAsDirty(func) {if (!(this.getScene().blockMaterialDirtyMechanism || this._blockDirtyMechanism)) {const meshes = this.getScene().meshes;for (const mesh of meshes) if (mesh.subMeshes) for (const subMesh of mesh.subMeshes) if (subMesh.getMaterial(!1) === this) for (const drawWrapper of subMesh._drawWrappers) drawWrapper && drawWrapper.defines && drawWrapper.defines.markAllAsDirty && this._materialContext === drawWrapper.materialContext && func(drawWrapper.defines);}}_markScenePrePassDirty() {if (!(this.getScene().blockMaterialDirtyMechanism || this._blockDirtyMechanism)) {const prePassRenderer = this.getScene().enablePrePassRenderer();prePassRenderer && prePassRenderer.markAsDirty();}}_markAllSubMeshesAsAllDirty() {this._markAllSubMeshesAsDirty(Material._AllDirtyCallBack);}_markAllSubMeshesAsImageProcessingDirty() {this._markAllSubMeshesAsDirty(Material._ImageProcessingDirtyCallBack);}_markAllSubMeshesAsTexturesDirty() {this._markAllSubMeshesAsDirty(Material._TextureDirtyCallBack);}_markAllSubMeshesAsFresnelDirty() {this._markAllSubMeshesAsDirty(Material._FresnelDirtyCallBack);}_markAllSubMeshesAsFresnelAndMiscDirty() {this._markAllSubMeshesAsDirty(Material._FresnelAndMiscDirtyCallBack);}_markAllSubMeshesAsLightsDirty() {this._markAllSubMeshesAsDirty(Material._LightsDirtyCallBack);}_markAllSubMeshesAsAttributesDirty() {this._markAllSubMeshesAsDirty(Material._AttributeDirtyCallBack);}_markAllSubMeshesAsMiscDirty() {this._markAllSubMeshesAsDirty(Material._MiscDirtyCallBack);}_markAllSubMeshesAsPrePassDirty() {this._markAllSubMeshesAsDirty(Material._MiscDirtyCallBack);}_markAllSubMeshesAsTexturesAndMiscDirty() {this._markAllSubMeshesAsDirty(Material._TextureAndMiscDirtyCallBack);}setPrePassRenderer() {return !1;}dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh) {const scene = this.getScene();if (scene.stopAnimation(this), scene.freeProcessedMaterials(), scene.removeMaterial(this), this._eventInfo.forceDisposeTextures = forceDisposeTextures, this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.Disposed */.S.Disposed, this._eventInfo), this._parentContainer) {const index = this._parentContainer.materials.indexOf(this);-1 < index && this._parentContainer.materials.splice(index, 1), this._parentContainer = null;}if (!0 !== notBoundToMesh) if (this.meshMap) for (const meshId in this.meshMap) {const mesh = this.meshMap[meshId];mesh && (mesh.material = null, this.releaseVertexArrayObject(mesh, forceDisposeEffect));} else {const meshes = scene.meshes;for (const mesh of meshes) mesh.material !== this || mesh.sourceMesh || (mesh.material = null, this.releaseVertexArrayObject(mesh, forceDisposeEffect));}this._uniformBuffer.dispose(), forceDisposeEffect && this._drawWrapper.effect && (!this._storeEffectOnSubMeshes && this._drawWrapper.effect.dispose(), this._drawWrapper.effect = null), this.metadata = null, this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._onBindObservable && this._onBindObservable.clear(), this._onUnBindObservable && this._onUnBindObservable.clear(), this._onEffectCreatedObservable && this._onEffectCreatedObservable.clear(), this._eventInfo && (this._eventInfo = {});}releaseVertexArrayObject(mesh, forceDisposeEffect) {if (mesh.geometry) {const geometry = mesh.geometry;if (this._storeEffectOnSubMeshes) for (const subMesh of mesh.subMeshes) geometry._releaseVertexArrayObject(subMesh.effect), forceDisposeEffect && subMesh.effect && subMesh.effect.dispose();else geometry._releaseVertexArrayObject(this._drawWrapper.effect);}}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this);return serializationObject.stencil = this.stencil.serialize(), serializationObject.uniqueId = this.uniqueId, serializationObject;}static Parse(parsedMaterial, scene, rootUrl) {if (!parsedMaterial.customType) parsedMaterial.customType = "BABYLON.StandardMaterial";else if ("BABYLON.PBRMaterial" === parsedMaterial.customType && parsedMaterial.overloadedAlbedo && (parsedMaterial.customType = "BABYLON.LegacyPBRMaterial", !BABYLON.LegacyPBRMaterial)) return logger/* Logger.Error */.Y.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."), null;const materialType = tools/* Tools.Instantiate */.w1.Instantiate(parsedMaterial.customType),material = materialType.Parse(parsedMaterial, scene, rootUrl);return material._loadedUniqueId = parsedMaterial.uniqueId, material;}}Material.TriangleFillMode = 0, Material.WireFrameFillMode = 1, Material.PointFillMode = 2, Material.PointListDrawMode = 3, Material.LineListDrawMode = 4, Material.LineLoopDrawMode = 5, Material.LineStripDrawMode = 6, Material.TriangleStripDrawMode = 7, Material.TriangleFanDrawMode = 8, Material.ClockWiseSideOrientation = 0, Material.CounterClockWiseSideOrientation = 1, Material.TextureDirtyFlag = 1, Material.LightDirtyFlag = 2, Material.FresnelDirtyFlag = 4, Material.AttributesDirtyFlag = 8, Material.MiscDirtyFlag = 16, Material.PrePassDirtyFlag = 32, Material.AllDirtyFlag = 63, Material.MATERIAL_OPAQUE = 0, Material.MATERIAL_ALPHATEST = 1, Material.MATERIAL_ALPHABLEND = 2, Material.MATERIAL_ALPHATESTANDBLEND = 3, Material.MATERIAL_NORMALBLENDMETHOD_WHITEOUT = 0, Material.MATERIAL_NORMALBLENDMETHOD_RNM = 1, Material.OnEventObservable = new observable/* Observable */.y$(), Material._AllDirtyCallBack = (defines) => defines.markAllAsDirty(), Material._ImageProcessingDirtyCallBack = (defines) => defines.markAsImageProcessingDirty(), Material._TextureDirtyCallBack = (defines) => defines.markAsTexturesDirty(), Material._FresnelDirtyCallBack = (defines) => defines.markAsFresnelDirty(), Material._MiscDirtyCallBack = (defines) => defines.markAsMiscDirty(), Material._PrePassDirtyCallBack = (defines) => defines.markAsPrePassDirty(), Material._LightsDirtyCallBack = (defines) => defines.markAsLightDirty(), Material._AttributeDirtyCallBack = (defines) => defines.markAsAttributesDirty(), Material._FresnelAndMiscDirtyCallBack = (defines) => {Material._FresnelDirtyCallBack(defines), Material._MiscDirtyCallBack(defines);}, Material._TextureAndMiscDirtyCallBack = (defines) => {Material._TextureDirtyCallBack(defines), Material._MiscDirtyCallBack(defines);}, Material._DirtyCallbackArray = [], Material._RunDirtyCallBacks = (defines) => {for (const cb of Material._DirtyCallbackArray) cb(defines);}, (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "id", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "uniqueId", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "name", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "metadata", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "checkReadyOnEveryCall", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "checkReadyOnlyOnce", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "state", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("alpha")], Material.prototype, "_alpha", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("backFaceCulling")], Material.prototype, "_backFaceCulling", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("cullBackFaces")], Material.prototype, "_cullBackFaces", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "sideOrientation", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("alphaMode")], Material.prototype, "_alphaMode", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "_needDepthPrePass", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "disableDepthWrite", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "disableColorWrite", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "forceDepthWrite", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "depthFunction", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "separateCullingPass", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("fogEnabled")], Material.prototype, "_fogEnabled", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "pointSize", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "zOffset", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "zOffsetUnits", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "pointsCloud", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "fillMode", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], Material.prototype, "transparencyMode", null);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/materialDefines.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "H": () => (/* binding */ MaterialDefines)
/* harmony export */ });
class MaterialDefines {constructor(externalProperties) {if (this._keys = [], this._isDirty = !0, this._areLightsDirty = !0, this._areLightsDisposed = !1, this._areAttributesDirty = !0, this._areTexturesDirty = !0, this._areFresnelDirty = !0, this._areMiscDirty = !0, this._arePrePassDirty = !0, this._areImageProcessingDirty = !0, this._normals = !1, this._uvs = !1, this._needNormals = !1, this._needUVs = !1, this._externalProperties = externalProperties, externalProperties) for (const prop in externalProperties) Object.prototype.hasOwnProperty.call(externalProperties, prop) && this._setDefaultValue(prop);}get isDirty() {return this._isDirty;}markAsProcessed() {this._isDirty = !1, this._areAttributesDirty = !1, this._areTexturesDirty = !1, this._areFresnelDirty = !1, this._areLightsDirty = !1, this._areLightsDisposed = !1, this._areMiscDirty = !1, this._arePrePassDirty = !1, this._areImageProcessingDirty = !1;}markAsUnprocessed() {this._isDirty = !0;}markAllAsDirty() {this._areTexturesDirty = !0, this._areAttributesDirty = !0, this._areLightsDirty = !0, this._areFresnelDirty = !0, this._areMiscDirty = !0, this._areImageProcessingDirty = !0, this._isDirty = !0;}markAsImageProcessingDirty() {this._areImageProcessingDirty = !0, this._isDirty = !0;}markAsLightDirty(disposed = !1) {this._areLightsDirty = !0, this._areLightsDisposed = this._areLightsDisposed || disposed, this._isDirty = !0;}markAsAttributesDirty() {this._areAttributesDirty = !0, this._isDirty = !0;}markAsTexturesDirty() {this._areTexturesDirty = !0, this._isDirty = !0;}markAsFresnelDirty() {this._areFresnelDirty = !0, this._isDirty = !0;}markAsMiscDirty() {this._areMiscDirty = !0, this._isDirty = !0;}markAsPrePassDirty() {this._arePrePassDirty = !0, this._isDirty = !0;}rebuild() {this._keys.length = 0;for (const key of Object.keys(this)) "_" !== key[0] && this._keys.push(key);if (this._externalProperties) for (const name in this._externalProperties) -1 === this._keys.indexOf(name) && this._keys.push(name);}isEqual(other) {if (this._keys.length !== other._keys.length) return !1;for (let index = 0; index < this._keys.length; index++) {const prop = this._keys[index];if (this[prop] !== other[prop]) return !1;}return !0;}cloneTo(other) {this._keys.length !== other._keys.length && (other._keys = this._keys.slice(0));for (let index = 0; index < this._keys.length; index++) {const prop = this._keys[index];other[prop] = this[prop];}}reset() {this._keys.forEach((prop) => this._setDefaultValue(prop));}_setDefaultValue(prop) {var _a, _b, _c, _d, _e;const type = null !== (_c = null === (_b = null === (_a = this._externalProperties) || void 0 === _a ? void 0 : _a[prop]) || void 0 === _b ? void 0 : _b.type) && void 0 !== _c ? _c : typeof this[prop],defValue = null === (_e = null === (_d = this._externalProperties) || void 0 === _d ? void 0 : _d[prop]) || void 0 === _e ? void 0 : _e.default;switch (type) {case "number":this[prop] = null !== defValue && void 0 !== defValue ? defValue : 0;break;case "string":this[prop] = null !== defValue && void 0 !== defValue ? defValue : "";break;default:this[prop] = !(null === defValue || void 0 === defValue) && defValue;}}toString() {let result = "";for (let index = 0; index < this._keys.length; index++) {const prop = this._keys[index],value = this[prop];switch (typeof value) {case "number":case "string":result += "#define " + prop + " " + value + "\n";break;default:value && (result += "#define " + prop + "\n");}}return result;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/materialFlags.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "k": () => (/* binding */ MaterialFlags)
/* harmony export */ });
/* harmony import */ var _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engine.js");
class MaterialFlags {static get DiffuseTextureEnabled() {return this._DiffuseTextureEnabled;}static set DiffuseTextureEnabled(value) {this._DiffuseTextureEnabled === value || (this._DiffuseTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get DetailTextureEnabled() {return this._DetailTextureEnabled;}static set DetailTextureEnabled(value) {this._DetailTextureEnabled === value || (this._DetailTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get AmbientTextureEnabled() {return this._AmbientTextureEnabled;}static set AmbientTextureEnabled(value) {this._AmbientTextureEnabled === value || (this._AmbientTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get OpacityTextureEnabled() {return this._OpacityTextureEnabled;}static set OpacityTextureEnabled(value) {this._OpacityTextureEnabled === value || (this._OpacityTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get ReflectionTextureEnabled() {return this._ReflectionTextureEnabled;}static set ReflectionTextureEnabled(value) {this._ReflectionTextureEnabled === value || (this._ReflectionTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get EmissiveTextureEnabled() {return this._EmissiveTextureEnabled;}static set EmissiveTextureEnabled(value) {this._EmissiveTextureEnabled === value || (this._EmissiveTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get SpecularTextureEnabled() {return this._SpecularTextureEnabled;}static set SpecularTextureEnabled(value) {this._SpecularTextureEnabled === value || (this._SpecularTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get BumpTextureEnabled() {return this._BumpTextureEnabled;}static set BumpTextureEnabled(value) {this._BumpTextureEnabled === value || (this._BumpTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get LightmapTextureEnabled() {return this._LightmapTextureEnabled;}static set LightmapTextureEnabled(value) {this._LightmapTextureEnabled === value || (this._LightmapTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get RefractionTextureEnabled() {return this._RefractionTextureEnabled;}static set RefractionTextureEnabled(value) {this._RefractionTextureEnabled === value || (this._RefractionTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get ColorGradingTextureEnabled() {return this._ColorGradingTextureEnabled;}static set ColorGradingTextureEnabled(value) {this._ColorGradingTextureEnabled === value || (this._ColorGradingTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get FresnelEnabled() {return this._FresnelEnabled;}static set FresnelEnabled(value) {this._FresnelEnabled === value || (this._FresnelEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(4));}static get ClearCoatTextureEnabled() {return this._ClearCoatTextureEnabled;}static set ClearCoatTextureEnabled(value) {this._ClearCoatTextureEnabled === value || (this._ClearCoatTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get ClearCoatBumpTextureEnabled() {return this._ClearCoatBumpTextureEnabled;}static set ClearCoatBumpTextureEnabled(value) {this._ClearCoatBumpTextureEnabled === value || (this._ClearCoatBumpTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get ClearCoatTintTextureEnabled() {return this._ClearCoatTintTextureEnabled;}static set ClearCoatTintTextureEnabled(value) {this._ClearCoatTintTextureEnabled === value || (this._ClearCoatTintTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get SheenTextureEnabled() {return this._SheenTextureEnabled;}static set SheenTextureEnabled(value) {this._SheenTextureEnabled === value || (this._SheenTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get AnisotropicTextureEnabled() {return this._AnisotropicTextureEnabled;}static set AnisotropicTextureEnabled(value) {this._AnisotropicTextureEnabled === value || (this._AnisotropicTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get ThicknessTextureEnabled() {return this._ThicknessTextureEnabled;}static set ThicknessTextureEnabled(value) {this._ThicknessTextureEnabled === value || (this._ThicknessTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get RefractionIntensityTextureEnabled() {return this._ThicknessTextureEnabled;}static set RefractionIntensityTextureEnabled(value) {this._RefractionIntensityTextureEnabled === value || (this._RefractionIntensityTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get TranslucencyIntensityTextureEnabled() {return this._ThicknessTextureEnabled;}static set TranslucencyIntensityTextureEnabled(value) {this._TranslucencyIntensityTextureEnabled === value || (this._TranslucencyIntensityTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}static get IridescenceTextureEnabled() {return this._IridescenceTextureEnabled;}static set IridescenceTextureEnabled(value) {this._IridescenceTextureEnabled === value || (this._IridescenceTextureEnabled = value, _Engines_engine_js__WEBPACK_IMPORTED_MODULE_0__/* .Engine.MarkAllMaterialsAsDirty */ .D.MarkAllMaterialsAsDirty(1));}}MaterialFlags._DiffuseTextureEnabled = !0, MaterialFlags._DetailTextureEnabled = !0, MaterialFlags._AmbientTextureEnabled = !0, MaterialFlags._OpacityTextureEnabled = !0, MaterialFlags._ReflectionTextureEnabled = !0, MaterialFlags._EmissiveTextureEnabled = !0, MaterialFlags._SpecularTextureEnabled = !0, MaterialFlags._BumpTextureEnabled = !0, MaterialFlags._LightmapTextureEnabled = !0, MaterialFlags._RefractionTextureEnabled = !0, MaterialFlags._ColorGradingTextureEnabled = !0, MaterialFlags._FresnelEnabled = !0, MaterialFlags._ClearCoatTextureEnabled = !0, MaterialFlags._ClearCoatBumpTextureEnabled = !0, MaterialFlags._ClearCoatTintTextureEnabled = !0, MaterialFlags._SheenTextureEnabled = !0, MaterialFlags._AnisotropicTextureEnabled = !0, MaterialFlags._ThicknessTextureEnabled = !0, MaterialFlags._RefractionIntensityTextureEnabled = !0, MaterialFlags._TranslucencyIntensityTextureEnabled = !0, MaterialFlags._IridescenceTextureEnabled = !0;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/materialHelper.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "G": () => (/* binding */ MaterialHelper)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/camera.js");
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/scene.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/lightConstants.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js");
class MaterialHelper {static BindSceneUniformBuffer(effect, sceneUbo) {sceneUbo.bindToEffect(effect, "Scene");}static PrepareDefinesForMergedUV(texture, defines, key) {defines._needUVs = !0, defines[key] = !0, texture.optimizeUVAllocation && texture.getTextureMatrix().isIdentityAs3x2() ? (defines[key + "DIRECTUV"] = texture.coordinatesIndex + 1, defines["MAINUV" + (texture.coordinatesIndex + 1)] = !0) : defines[key + "DIRECTUV"] = 0;}static BindTextureMatrix(texture, uniformBuffer, key) {const matrix = texture.getTextureMatrix();uniformBuffer.updateMatrix(key + "Matrix", matrix);}static GetFogState(mesh, scene) {return scene.fogEnabled && mesh.applyFog && scene.fogMode !== _scene_js__WEBPACK_IMPORTED_MODULE_2__/* .Scene.FOGMODE_NONE */ .x.FOGMODE_NONE;}static PrepareDefinesForMisc(mesh, scene, useLogarithmicDepth, pointsCloud, fogEnabled, alphaTest, defines) {defines._areMiscDirty && (defines.LOGARITHMICDEPTH = useLogarithmicDepth, defines.POINTSIZE = pointsCloud, defines.FOG = fogEnabled && this.GetFogState(mesh, scene), defines.NONUNIFORMSCALING = mesh.nonUniformScaling, defines.ALPHATEST = alphaTest);}static PrepareDefinesForCamera(scene, defines) {let changed = !1;if (scene.activeCamera) {const wasOrtho = defines.CAMERA_ORTHOGRAPHIC ? 1 : 0,wasPersp = defines.CAMERA_PERSPECTIVE ? 1 : 0,isOrtho = scene.activeCamera.mode === _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_1__/* .Camera.ORTHOGRAPHIC_CAMERA */ .V.ORTHOGRAPHIC_CAMERA ? 1 : 0,isPersp = scene.activeCamera.mode === _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_1__/* .Camera.PERSPECTIVE_CAMERA */ .V.PERSPECTIVE_CAMERA ? 1 : 0;(wasOrtho ^ isOrtho || wasPersp ^ isPersp) && (defines.CAMERA_ORTHOGRAPHIC = 1 === isOrtho, defines.CAMERA_PERSPECTIVE = 1 === isPersp, changed = !0);}return changed;}static PrepareDefinesForFrameBoundValues(scene, engine, material, defines, useInstances, useClipPlane = null, useThinInstances = !1) {let changed = MaterialHelper.PrepareDefinesForCamera(scene, defines);!1 !== useClipPlane && (changed = (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_7__/* .prepareDefinesForClipPlanes */ .AN)(material, scene, defines)), defines.DEPTHPREPASS !== !engine.getColorWrite() && (defines.DEPTHPREPASS = !defines.DEPTHPREPASS, changed = !0), defines.INSTANCES !== useInstances && (defines.INSTANCES = useInstances, changed = !0), defines.THIN_INSTANCES !== useThinInstances && (defines.THIN_INSTANCES = useThinInstances, changed = !0), changed && defines.markAsUnprocessed();}static PrepareDefinesForBones(mesh, defines) {if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {defines.NUM_BONE_INFLUENCERS = mesh.numBoneInfluencers;const materialSupportsBoneTexture = defines.BONETEXTURE !== void 0;if (mesh.skeleton.isUsingTextureForMatrices && materialSupportsBoneTexture) defines.BONETEXTURE = !0;else {defines.BonesPerMesh = mesh.skeleton.bones.length + 1, defines.BONETEXTURE = !materialSupportsBoneTexture && void 0;const prePassRenderer = mesh.getScene().prePassRenderer;if (prePassRenderer && prePassRenderer.enabled) {const nonExcluded = -1 === prePassRenderer.excludedSkinnedMesh.indexOf(mesh);defines.BONES_VELOCITY_ENABLED = nonExcluded;}}} else defines.NUM_BONE_INFLUENCERS = 0, defines.BonesPerMesh = 0, void 0 !== defines.BONETEXTURE && (defines.BONETEXTURE = !1);}static PrepareDefinesForMorphTargets(mesh, defines) {const manager = mesh.morphTargetManager;manager ? (defines.MORPHTARGETS_UV = manager.supportsUVs && defines.UV1, defines.MORPHTARGETS_TANGENT = manager.supportsTangents && defines.TANGENT, defines.MORPHTARGETS_NORMAL = manager.supportsNormals && defines.NORMAL, defines.MORPHTARGETS = 0 < manager.numInfluencers, defines.NUM_MORPH_INFLUENCERS = manager.numInfluencers, defines.MORPHTARGETS_TEXTURE = manager.isUsingTextureForTargets) : (defines.MORPHTARGETS_UV = !1, defines.MORPHTARGETS_TANGENT = !1, defines.MORPHTARGETS_NORMAL = !1, defines.MORPHTARGETS = !1, defines.NUM_MORPH_INFLUENCERS = 0);}static PrepareDefinesForBakedVertexAnimation(mesh, defines) {const manager = mesh.bakedVertexAnimationManager;defines.BAKED_VERTEX_ANIMATION_TEXTURE = !!(manager && manager.isEnabled);}static PrepareDefinesForAttributes(mesh, defines, useVertexColor, useBones, useMorphTargets = !1, useVertexAlpha = !0, useBakedVertexAnimation = !0) {if (!defines._areAttributesDirty && defines._needNormals === defines._normals && defines._needUVs === defines._uvs) return !1;defines._normals = defines._needNormals, defines._uvs = defines._needUVs, defines.NORMAL = defines._needNormals && mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.NormalKind */ .o.NormalKind), defines._needNormals && mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.TangentKind */ .o.TangentKind) && (defines.TANGENT = !0);for (let i = 1; 6 >= i; ++i) defines["UV" + i] = !!defines._needUVs && mesh.isVerticesDataPresent(`uv${1 === i ? "" : i}`);if (useVertexColor) {const hasVertexColors = mesh.useVertexColors && mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.ColorKind */ .o.ColorKind);defines.VERTEXCOLOR = hasVertexColors, defines.VERTEXALPHA = mesh.hasVertexAlpha && hasVertexColors && useVertexAlpha;}return mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind) && (mesh.hasInstances || mesh.hasThinInstances) && (defines.INSTANCESCOLOR = !0), useBones && this.PrepareDefinesForBones(mesh, defines), useMorphTargets && this.PrepareDefinesForMorphTargets(mesh, defines), useBakedVertexAnimation && this.PrepareDefinesForBakedVertexAnimation(mesh, defines), !0;}static PrepareDefinesForMultiview(scene, defines) {if (scene.activeCamera) {const previousMultiview = defines.MULTIVIEW;defines.MULTIVIEW = null !== scene.activeCamera.outputRenderTarget && 1 < scene.activeCamera.outputRenderTarget.getViewCount(), defines.MULTIVIEW != previousMultiview && defines.markAsUnprocessed();}}static PrepareDefinesForOIT(scene, defines, needAlphaBlending) {const previousDefine = defines.ORDER_INDEPENDENT_TRANSPARENCY,previousDefine16Bits = defines.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;defines.ORDER_INDEPENDENT_TRANSPARENCY = scene.useOrderIndependentTransparency && needAlphaBlending, defines.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = !scene.getEngine().getCaps().textureFloatLinearFiltering, (previousDefine !== defines.ORDER_INDEPENDENT_TRANSPARENCY || previousDefine16Bits !== defines.ORDER_INDEPENDENT_TRANSPARENCY_16BITS) && defines.markAsUnprocessed();}static PrepareDefinesForPrePass(scene, defines, canRenderToMRT) {const previousPrePass = defines.PREPASS;if (defines._arePrePassDirty) {const texturesList = [{ type: 1, define: "PREPASS_POSITION", index: "PREPASS_POSITION_INDEX" }, { type: 2, define: "PREPASS_VELOCITY", index: "PREPASS_VELOCITY_INDEX" }, { type: 3, define: "PREPASS_REFLECTIVITY", index: "PREPASS_REFLECTIVITY_INDEX" }, { type: 0, define: "PREPASS_IRRADIANCE", index: "PREPASS_IRRADIANCE_INDEX" }, { type: 7, define: "PREPASS_ALBEDO_SQRT", index: "PREPASS_ALBEDO_SQRT_INDEX" }, { type: 5, define: "PREPASS_DEPTH", index: "PREPASS_DEPTH_INDEX" }, { type: 6, define: "PREPASS_NORMAL", index: "PREPASS_NORMAL_INDEX" }];if (scene.prePassRenderer && scene.prePassRenderer.enabled && canRenderToMRT) {defines.PREPASS = !0, defines.SCENE_MRT_COUNT = scene.prePassRenderer.mrtCount;for (let i = 0; i < texturesList.length; i++) {const index = scene.prePassRenderer.getIndex(texturesList[i].type);-1 === index ? defines[texturesList[i].define] = !1 : (defines[texturesList[i].define] = !0, defines[texturesList[i].index] = index);}} else {defines.PREPASS = !1;for (let i = 0; i < texturesList.length; i++) defines[texturesList[i].define] = !1;}defines.PREPASS != previousPrePass && (defines.markAsUnprocessed(), defines.markAsImageProcessingDirty());}}static PrepareDefinesForLight(scene, mesh, light, lightIndex, defines, specularSupported, state) {var _a;switch (state.needNormals = !0, void 0 === defines["LIGHT" + lightIndex] && (state.needRebuild = !0), defines["LIGHT" + lightIndex] = !0, defines["SPOTLIGHT" + lightIndex] = !1, defines["HEMILIGHT" + lightIndex] = !1, defines["POINTLIGHT" + lightIndex] = !1, defines["DIRLIGHT" + lightIndex] = !1, light.prepareLightSpecificDefines(defines, lightIndex), defines["LIGHT_FALLOFF_PHYSICAL" + lightIndex] = !1, defines["LIGHT_FALLOFF_GLTF" + lightIndex] = !1, defines["LIGHT_FALLOFF_STANDARD" + lightIndex] = !1, light.falloffType) {case _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_5__/* .LightConstants.FALLOFF_GLTF */ .m.FALLOFF_GLTF:defines["LIGHT_FALLOFF_GLTF" + lightIndex] = !0;break;case _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_5__/* .LightConstants.FALLOFF_PHYSICAL */ .m.FALLOFF_PHYSICAL:defines["LIGHT_FALLOFF_PHYSICAL" + lightIndex] = !0;break;case _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_5__/* .LightConstants.FALLOFF_STANDARD */ .m.FALLOFF_STANDARD:defines["LIGHT_FALLOFF_STANDARD" + lightIndex] = !0;}if (specularSupported && !light.specular.equalsFloats(0, 0, 0) && (state.specularEnabled = !0), defines["SHADOW" + lightIndex] = !1, defines["SHADOWCSM" + lightIndex] = !1, defines["SHADOWCSMDEBUG" + lightIndex] = !1, defines["SHADOWCSMNUM_CASCADES" + lightIndex] = !1, defines["SHADOWCSMUSESHADOWMAXZ" + lightIndex] = !1, defines["SHADOWCSMNOBLEND" + lightIndex] = !1, defines["SHADOWCSM_RIGHTHANDED" + lightIndex] = !1, defines["SHADOWPCF" + lightIndex] = !1, defines["SHADOWPCSS" + lightIndex] = !1, defines["SHADOWPOISSON" + lightIndex] = !1, defines["SHADOWESM" + lightIndex] = !1, defines["SHADOWCLOSEESM" + lightIndex] = !1, defines["SHADOWCUBE" + lightIndex] = !1, defines["SHADOWLOWQUALITY" + lightIndex] = !1, defines["SHADOWMEDIUMQUALITY" + lightIndex] = !1, mesh && mesh.receiveShadows && scene.shadowsEnabled && light.shadowEnabled) {const shadowGenerator = null !== (_a = light.getShadowGenerator(scene.activeCamera)) && void 0 !== _a ? _a : light.getShadowGenerator();if (shadowGenerator) {const shadowMap = shadowGenerator.getShadowMap();shadowMap && shadowMap.renderList && 0 < shadowMap.renderList.length && (state.shadowEnabled = !0, shadowGenerator.prepareDefines(defines, lightIndex));}}light.lightmapMode == _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_5__/* .LightConstants.LIGHTMAP_DEFAULT */ .m.LIGHTMAP_DEFAULT ? (defines["LIGHTMAPEXCLUDED" + lightIndex] = !1, defines["LIGHTMAPNOSPECULAR" + lightIndex] = !1) : (state.lightmapMode = !0, defines["LIGHTMAPEXCLUDED" + lightIndex] = !0, defines["LIGHTMAPNOSPECULAR" + lightIndex] = light.lightmapMode == _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_5__/* .LightConstants.LIGHTMAP_SHADOWSONLY */ .m.LIGHTMAP_SHADOWSONLY);}static PrepareDefinesForLights(scene, mesh, defines, specularSupported, maxSimultaneousLights = 4, disableLighting = !1) {if (!defines._areLightsDirty) return defines._needNormals;let lightIndex = 0;const state = { needNormals: defines._needNormals, needRebuild: !1, lightmapMode: !1, shadowEnabled: !1, specularEnabled: !1 };if (scene.lightsEnabled && !disableLighting) for (const light of mesh.lightSources) if (this.PrepareDefinesForLight(scene, mesh, light, lightIndex, defines, specularSupported, state), lightIndex++, lightIndex === maxSimultaneousLights) break;defines.SPECULARTERM = state.specularEnabled, defines.SHADOWS = state.shadowEnabled;for (let index = lightIndex; index < maxSimultaneousLights; index++) void 0 !== defines["LIGHT" + index] && (defines["LIGHT" + index] = !1, defines["HEMILIGHT" + index] = !1, defines["POINTLIGHT" + index] = !1, defines["DIRLIGHT" + index] = !1, defines["SPOTLIGHT" + index] = !1, defines["SHADOW" + index] = !1, defines["SHADOWCSM" + index] = !1, defines["SHADOWCSMDEBUG" + index] = !1, defines["SHADOWCSMNUM_CASCADES" + index] = !1, defines["SHADOWCSMUSESHADOWMAXZ" + index] = !1, defines["SHADOWCSMNOBLEND" + index] = !1, defines["SHADOWCSM_RIGHTHANDED" + index] = !1, defines["SHADOWPCF" + index] = !1, defines["SHADOWPCSS" + index] = !1, defines["SHADOWPOISSON" + index] = !1, defines["SHADOWESM" + index] = !1, defines["SHADOWCLOSEESM" + index] = !1, defines["SHADOWCUBE" + index] = !1, defines["SHADOWLOWQUALITY" + index] = !1, defines["SHADOWMEDIUMQUALITY" + index] = !1);const caps = scene.getEngine().getCaps();return void 0 === defines.SHADOWFLOAT && (state.needRebuild = !0), defines.SHADOWFLOAT = state.shadowEnabled && (caps.textureFloatRender && caps.textureFloatLinearFiltering || caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering), defines.LIGHTMAPEXCLUDED = state.lightmapMode, state.needRebuild && defines.rebuild(), state.needNormals;}static PrepareUniformsAndSamplersForLight(lightIndex, uniformsList, samplersList, projectedLightTexture, uniformBuffersList = null, updateOnlyBuffersList = !1) {uniformBuffersList && uniformBuffersList.push("Light" + lightIndex);updateOnlyBuffersList || (uniformsList.push("vLightData" + lightIndex, "vLightDiffuse" + lightIndex, "vLightSpecular" + lightIndex, "vLightDirection" + lightIndex, "vLightFalloff" + lightIndex, "vLightGround" + lightIndex, "lightMatrix" + lightIndex, "shadowsInfo" + lightIndex, "depthValues" + lightIndex), samplersList.push("shadowSampler" + lightIndex), samplersList.push("depthSampler" + lightIndex), uniformsList.push("viewFrustumZ" + lightIndex, "cascadeBlendFactor" + lightIndex, "lightSizeUVCorrection" + lightIndex, "depthCorrection" + lightIndex, "penumbraDarkness" + lightIndex, "frustumLengths" + lightIndex), projectedLightTexture && (samplersList.push("projectionLightSampler" + lightIndex), uniformsList.push("textureProjectionMatrix" + lightIndex)));}static PrepareUniformsAndSamplersList(uniformsListOrOptions, samplersList, defines, maxSimultaneousLights = 4) {let uniformsList,uniformBuffersList = null;if (uniformsListOrOptions.uniformsNames) {const options = uniformsListOrOptions;uniformsList = options.uniformsNames, uniformBuffersList = options.uniformBuffersNames, samplersList = options.samplers, defines = options.defines, maxSimultaneousLights = options.maxSimultaneousLights || 0;} else uniformsList = uniformsListOrOptions, samplersList || (samplersList = []);for (let lightIndex = 0; lightIndex < maxSimultaneousLights && !!defines["LIGHT" + lightIndex]; lightIndex++) this.PrepareUniformsAndSamplersForLight(lightIndex, uniformsList, samplersList, defines["PROJECTEDLIGHTTEXTURE" + lightIndex], uniformBuffersList);defines.NUM_MORPH_INFLUENCERS && uniformsList.push("morphTargetInfluences"), defines.BAKED_VERTEX_ANIMATION_TEXTURE && (uniformsList.push("bakedVertexAnimationSettings"), uniformsList.push("bakedVertexAnimationTextureSizeInverted"), uniformsList.push("bakedVertexAnimationTime"), samplersList.push("bakedVertexAnimationTexture"));}static HandleFallbacksForShadows(defines, fallbacks, maxSimultaneousLights = 4, rank = 0) {let lightFallbackRank = 0;for (let lightIndex = 0; lightIndex < maxSimultaneousLights && !!defines["LIGHT" + lightIndex]; lightIndex++) 0 < lightIndex && (lightFallbackRank = rank + lightIndex, fallbacks.addFallback(lightFallbackRank, "LIGHT" + lightIndex)), defines.SHADOWS || (defines["SHADOW" + lightIndex] && fallbacks.addFallback(rank, "SHADOW" + lightIndex), defines["SHADOWPCF" + lightIndex] && fallbacks.addFallback(rank, "SHADOWPCF" + lightIndex), defines["SHADOWPCSS" + lightIndex] && fallbacks.addFallback(rank, "SHADOWPCSS" + lightIndex), defines["SHADOWPOISSON" + lightIndex] && fallbacks.addFallback(rank, "SHADOWPOISSON" + lightIndex), defines["SHADOWESM" + lightIndex] && fallbacks.addFallback(rank, "SHADOWESM" + lightIndex), defines["SHADOWCLOSEESM" + lightIndex] && fallbacks.addFallback(rank, "SHADOWCLOSEESM" + lightIndex));return lightFallbackRank++;}static PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, influencers) {this._TmpMorphInfluencers.NUM_MORPH_INFLUENCERS = influencers, this.PrepareAttributesForMorphTargets(attribs, mesh, this._TmpMorphInfluencers);}static PrepareAttributesForMorphTargets(attribs, mesh, defines) {const influencers = defines.NUM_MORPH_INFLUENCERS;if (0 < influencers && _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore.LastCreatedEngine */ .l.LastCreatedEngine) {const maxAttributesCount = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore.LastCreatedEngine.getCaps */ .l.LastCreatedEngine.getCaps().maxVertexAttribs,manager = mesh.morphTargetManager;if (null === manager || void 0 === manager ? void 0 : manager.isUsingTextureForTargets) return;const normal = manager && manager.supportsNormals && defines.NORMAL,tangent = manager && manager.supportsTangents && defines.TANGENT,uv = manager && manager.supportsUVs && defines.UV1;for (let index = 0; index < influencers; index++) attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.PositionKind */ .o.PositionKind + index), normal && attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.NormalKind */ .o.NormalKind + index), tangent && attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.TangentKind */ .o.TangentKind + index), uv && attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.UVKind */ .o.UVKind + "_" + index), attribs.length > maxAttributesCount && _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger.Error */ .Y.Error("Cannot add more vertex attributes for mesh " + mesh.name);}}static PrepareAttributesForBakedVertexAnimation(attribs, mesh, defines) {const enabled = defines.BAKED_VERTEX_ANIMATION_TEXTURE && defines.INSTANCES;enabled && attribs.push("bakedVertexAnimationSettingsInstanced");}static PrepareAttributesForBones(attribs, mesh, defines, fallbacks) {0 < defines.NUM_BONE_INFLUENCERS && (fallbacks.addCPUSkinningFallback(0, mesh), attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind), attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind), 4 < defines.NUM_BONE_INFLUENCERS && (attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind), attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind)));}static PrepareAttributesForInstances(attribs, defines) {(defines.INSTANCES || defines.THIN_INSTANCES) && this.PushAttributesForInstances(attribs, !!defines.PREPASS_VELOCITY), defines.INSTANCESCOLOR && attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind);}static PushAttributesForInstances(attribs, needsPreviousMatrices = !1) {attribs.push("world0"), attribs.push("world1"), attribs.push("world2"), attribs.push("world3"), needsPreviousMatrices && (attribs.push("previousWorld0"), attribs.push("previousWorld1"), attribs.push("previousWorld2"), attribs.push("previousWorld3"));}static BindLightProperties(light, effect, lightIndex) {light.transferToEffect(effect, lightIndex + "");}static BindLight(light, lightIndex, scene, effect, useSpecular, receiveShadows = !0) {light._bindLight(lightIndex, scene, effect, useSpecular, receiveShadows);}static BindLights(scene, mesh, effect, defines, maxSimultaneousLights = 4) {const len = Math.min(mesh.lightSources.length, maxSimultaneousLights);for (let i = 0; i < len; i++) {const light = mesh.lightSources[i];this.BindLight(light, i, scene, effect, "boolean" == typeof defines ? defines : defines.SPECULARTERM, mesh.receiveShadows);}}static BindFogParameters(scene, mesh, effect, linearSpace = !1) {scene.fogEnabled && mesh.applyFog && scene.fogMode !== _scene_js__WEBPACK_IMPORTED_MODULE_2__/* .Scene.FOGMODE_NONE */ .x.FOGMODE_NONE && (effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity), linearSpace ? (scene.fogColor.toLinearSpaceToRef(this._TempFogColor), effect.setColor3("vFogColor", this._TempFogColor)) : effect.setColor3("vFogColor", scene.fogColor));}static BindBonesParameters(mesh, effect, prePassConfiguration) {if (effect && mesh && (mesh.computeBonesUsingShaders && effect._bonesComputationForcedToCPU && (mesh.computeBonesUsingShaders = !1), mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton)) {const skeleton = mesh.skeleton;if (skeleton.isUsingTextureForMatrices && -1 < effect.getUniformIndex("boneTextureWidth")) {const boneTexture = skeleton.getTransformMatrixTexture(mesh);effect.setTexture("boneSampler", boneTexture), effect.setFloat("boneTextureWidth", 4 * (skeleton.bones.length + 1));} else {const matrices = skeleton.getTransformMatrices(mesh);matrices && (effect.setMatrices("mBones", matrices), prePassConfiguration && mesh.getScene().prePassRenderer && mesh.getScene().prePassRenderer.getIndex(2) && (!prePassConfiguration.previousBones[mesh.uniqueId] && (prePassConfiguration.previousBones[mesh.uniqueId] = matrices.slice()), effect.setMatrices("mPreviousBones", prePassConfiguration.previousBones[mesh.uniqueId]), MaterialHelper._CopyBonesTransformationMatrices(matrices, prePassConfiguration.previousBones[mesh.uniqueId])));}}}static _CopyBonesTransformationMatrices(source, target) {return target.set(source), target;}static BindMorphTargetParameters(abstractMesh, effect) {const manager = abstractMesh.morphTargetManager;abstractMesh && manager && effect.setFloatArray("morphTargetInfluences", manager.influences);}static BindLogDepth(defines, effect, scene) {if (!defines || defines.LOGARITHMICDEPTH || defines.indexOf && 0 <= defines.indexOf("LOGARITHMICDEPTH")) {const camera = scene.activeCamera;camera.mode === _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_1__/* .Camera.ORTHOGRAPHIC_CAMERA */ .V.ORTHOGRAPHIC_CAMERA && _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger.Error */ .Y.Error("Logarithmic depth is not compatible with orthographic cameras!", 20), effect.setFloat("logarithmicDepthConstant", 2 / (Math.log(camera.maxZ + 1) / Math.LN2));}}}MaterialHelper._TmpMorphInfluencers = { NUM_MORPH_INFLUENCERS: 0 }, MaterialHelper._TempFogColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__/* .Color3.Black */ .Wo.Black();

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/materialPluginBase.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "n": () => (/* binding */ MaterialPluginBase)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _materialPluginManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginManager.js");
class MaterialPluginBase {_enable(enable) {enable && this._pluginManager._activatePlugin(this);}constructor(material, name, priority, defines, addToPluginList = !0, enable = !1) {this.priority = 500, this.registerForExtraEvents = !1, this._material = material, this.name = name, this.priority = priority, material.pluginManager || (material.pluginManager = new _materialPluginManager_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialPluginManager */ .BK(material)), this._pluginDefineNames = defines, this._pluginManager = material.pluginManager, addToPluginList && this._pluginManager._addPlugin(this), enable && this._enable(!0), this.markAllDefinesAsDirty = material._dirtyCallbacks[63];}getClassName() {return "MaterialPluginBase";}isReadyForSubMesh() {return !0;}hardBindForSubMesh() {}bindForSubMesh() {}dispose() {}getCustomCode() {return null;}collectDefines(defines) {if (this._pluginDefineNames) for (const key of Object.keys(this._pluginDefineNames)) {if ("_" === key[0]) continue;const type = typeof this._pluginDefineNames[key];defines[key] = { type: "number" == type ? "number" : "string" === type ? "string" : "boolean" === type ? "boolean" : "object", default: this._pluginDefineNames[key] };}}prepareDefinesBeforeAttributes() {}prepareDefines() {}hasTexture() {return !1;}hasRenderTargetTextures() {return !1;}fillRenderTargetTextures() {}getActiveTextures() {}getAnimatables() {}addFallbacks(defines, fallbacks, currentRank) {return currentRank;}getSamplers() {}getAttributes() {}getUniformBuffersNames() {}getUniforms() {return {};}copyTo(plugin) {_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Clone */ .p4.Clone(() => plugin, this);}serialize() {return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Serialize */ .p4.Serialize(this);}parse(source, scene, rootUrl) {_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(() => this, source, scene, rootUrl);}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], MaterialPluginBase.prototype, "name", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], MaterialPluginBase.prototype, "priority", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], MaterialPluginBase.prototype, "registerForExtraEvents", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/materialPluginEvent.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "S": () => (/* binding */ MaterialPluginEvent)
/* harmony export */ });
var MaterialPluginEvent;(function (MaterialPluginEvent) {MaterialPluginEvent[MaterialPluginEvent.Created = 1] = "Created", MaterialPluginEvent[MaterialPluginEvent.Disposed = 2] = "Disposed", MaterialPluginEvent[MaterialPluginEvent.GetDefineNames = 4] = "GetDefineNames", MaterialPluginEvent[MaterialPluginEvent.PrepareUniformBuffer = 8] = "PrepareUniformBuffer", MaterialPluginEvent[MaterialPluginEvent.IsReadyForSubMesh = 16] = "IsReadyForSubMesh", MaterialPluginEvent[MaterialPluginEvent.PrepareDefines = 32] = "PrepareDefines", MaterialPluginEvent[MaterialPluginEvent.BindForSubMesh = 64] = "BindForSubMesh", MaterialPluginEvent[MaterialPluginEvent.PrepareEffect = 128] = "PrepareEffect", MaterialPluginEvent[MaterialPluginEvent.GetAnimatables = 256] = "GetAnimatables", MaterialPluginEvent[MaterialPluginEvent.GetActiveTextures = 512] = "GetActiveTextures", MaterialPluginEvent[MaterialPluginEvent.HasTexture = 1024] = "HasTexture", MaterialPluginEvent[MaterialPluginEvent.FillRenderTargetTextures = 2048] = "FillRenderTargetTextures", MaterialPluginEvent[MaterialPluginEvent.HasRenderTargetTextures = 4096] = "HasRenderTargetTextures", MaterialPluginEvent[MaterialPluginEvent.HardBindForSubMesh = 8192] = "HardBindForSubMesh";})(MaterialPluginEvent || (MaterialPluginEvent = {}));

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/materialPluginManager.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "BK": () => (/* binding */ MaterialPluginManager),
/* harmony export */   "Dh": () => (/* binding */ UnregisterAllMaterialPlugins),
/* harmony export */   "jD": () => (/* binding */ UnregisterMaterialPlugin),
/* harmony export */   "rs": () => (/* binding */ RegisterMaterialPlugin)
/* harmony export */ });
/* harmony import */ var _material_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.js");
/* harmony import */ var _materialPluginEvent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginEvent.js");
const rxOption = /^([gimus]+)!/;class MaterialPluginManager {constructor(material) {this._plugins = [], this._activePlugins = [], this._activePluginsForExtraEvents = [], this._material = material, this._scene = material.getScene(), this._engine = this._scene.getEngine();}_addPlugin(plugin) {for (let i = 0; i < this._plugins.length; ++i) if (this._plugins[i].name === plugin.name) throw `Plugin "${plugin.name}" already added to the material "${this._material.name}"!`;if (this._material._uniformBufferLayoutBuilt) throw `The plugin "${plugin.name}" can't be added to the material "${this._material.name}" because this material has already been used for rendering! Please add plugins to materials before any rendering with this material occurs.`;const pluginClassName = plugin.getClassName();MaterialPluginManager._MaterialPluginClassToMainDefine[pluginClassName] || (MaterialPluginManager._MaterialPluginClassToMainDefine[pluginClassName] = "MATERIALPLUGIN_" + ++MaterialPluginManager._MaterialPluginCounter), this._material._callbackPluginEventGeneric = this._handlePluginEvent.bind(this), this._plugins.push(plugin), this._plugins.sort((a, b) => a.priority - b.priority), this._codeInjectionPoints = {};const defineNamesFromPlugins = {};defineNamesFromPlugins[MaterialPluginManager._MaterialPluginClassToMainDefine[pluginClassName]] = { type: "boolean", default: !0 };for (const plugin of this._plugins) plugin.collectDefines(defineNamesFromPlugins), this._collectPointNames("vertex", plugin.getCustomCode("vertex")), this._collectPointNames("fragment", plugin.getCustomCode("fragment"));this._defineNamesFromPlugins = defineNamesFromPlugins;}_activatePlugin(plugin) {-1 === this._activePlugins.indexOf(plugin) && (this._activePlugins.push(plugin), this._activePlugins.sort((a, b) => a.priority - b.priority), this._material._callbackPluginEventIsReadyForSubMesh = this._handlePluginEventIsReadyForSubMesh.bind(this), this._material._callbackPluginEventPrepareDefinesBeforeAttributes = this._handlePluginEventPrepareDefinesBeforeAttributes.bind(this), this._material._callbackPluginEventPrepareDefines = this._handlePluginEventPrepareDefines.bind(this), this._material._callbackPluginEventBindForSubMesh = this._handlePluginEventBindForSubMesh.bind(this), plugin.registerForExtraEvents && (this._activePluginsForExtraEvents.push(plugin), this._activePluginsForExtraEvents.sort((a, b) => a.priority - b.priority), this._material._callbackPluginEventHasRenderTargetTextures = this._handlePluginEventHasRenderTargetTextures.bind(this), this._material._callbackPluginEventFillRenderTargetTextures = this._handlePluginEventFillRenderTargetTextures.bind(this), this._material._callbackPluginEventHardBindForSubMesh = this._handlePluginEventHardBindForSubMesh.bind(this)));}getPlugin(name) {for (let i = 0; i < this._plugins.length; ++i) if (this._plugins[i].name === name) return this._plugins[i];return null;}_handlePluginEventIsReadyForSubMesh(eventData) {let isReady = !0;for (const plugin of this._activePlugins) isReady = isReady && plugin.isReadyForSubMesh(eventData.defines, this._scene, this._engine, eventData.subMesh);eventData.isReadyForSubMesh = isReady;}_handlePluginEventPrepareDefinesBeforeAttributes(eventData) {for (const plugin of this._activePlugins) plugin.prepareDefinesBeforeAttributes(eventData.defines, this._scene, eventData.mesh);}_handlePluginEventPrepareDefines(eventData) {for (const plugin of this._activePlugins) plugin.prepareDefines(eventData.defines, this._scene, eventData.mesh);}_handlePluginEventHardBindForSubMesh(eventData) {for (const plugin of this._activePluginsForExtraEvents) plugin.hardBindForSubMesh(this._material._uniformBuffer, this._scene, this._engine, eventData.subMesh);}_handlePluginEventBindForSubMesh(eventData) {for (const plugin of this._activePlugins) plugin.bindForSubMesh(this._material._uniformBuffer, this._scene, this._engine, eventData.subMesh);}_handlePluginEventHasRenderTargetTextures(eventData) {let hasRenderTargetTextures = !1;for (const plugin of this._activePluginsForExtraEvents) if (hasRenderTargetTextures = plugin.hasRenderTargetTextures(), hasRenderTargetTextures) break;eventData.hasRenderTargetTextures = hasRenderTargetTextures;}_handlePluginEventFillRenderTargetTextures(eventData) {for (const plugin of this._activePluginsForExtraEvents) plugin.fillRenderTargetTextures(eventData.renderTargets);}_handlePluginEvent(id, info) {switch (id) {case _materialPluginEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .MaterialPluginEvent.GetActiveTextures */ .S.GetActiveTextures:{for (const plugin of this._activePlugins) plugin.getActiveTextures(info.activeTextures);break;}case _materialPluginEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .MaterialPluginEvent.GetAnimatables */ .S.GetAnimatables:{for (const plugin of this._activePlugins) plugin.getAnimatables(info.animatables);break;}case _materialPluginEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .MaterialPluginEvent.HasTexture */ .S.HasTexture:{const eventData = info;let hasTexture = !1;for (const plugin of this._activePlugins) if (hasTexture = plugin.hasTexture(eventData.texture), hasTexture) break;eventData.hasTexture = hasTexture;break;}case _materialPluginEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .MaterialPluginEvent.Disposed */ .S.Disposed:{for (const plugin of this._plugins) plugin.dispose(info.forceDisposeTextures);break;}case _materialPluginEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .MaterialPluginEvent.GetDefineNames */ .S.GetDefineNames:{info.defineNames = this._defineNamesFromPlugins;break;}case _materialPluginEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .MaterialPluginEvent.PrepareEffect */ .S.PrepareEffect:{const eventData = info;for (const plugin of this._activePlugins) eventData.fallbackRank = plugin.addFallbacks(eventData.defines, eventData.fallbacks, eventData.fallbackRank), plugin.getAttributes(eventData.attributes, this._scene, eventData.mesh);0 < this._uniformList.length && eventData.uniforms.push(...this._uniformList), 0 < this._samplerList.length && eventData.samplers.push(...this._samplerList), 0 < this._uboList.length && eventData.uniformBuffersNames.push(...this._uboList), eventData.customCode = this._injectCustomCode(eventData.customCode);break;}case _materialPluginEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .MaterialPluginEvent.PrepareUniformBuffer */ .S.PrepareUniformBuffer:{this._uboDeclaration = "", this._vertexDeclaration = "", this._fragmentDeclaration = "", this._uniformList = [], this._samplerList = [], this._uboList = [];for (const plugin of this._plugins) {const uniforms = plugin.getUniforms();if (uniforms) {if (uniforms.ubo) for (const uniform of uniforms.ubo) info.ubo.addUniform(uniform.name, uniform.size), this._uboDeclaration += `${uniform.type} ${uniform.name};\r\n`, this._uniformList.push(uniform.name);uniforms.vertex && (this._vertexDeclaration += uniforms.vertex + "\r\n"), uniforms.fragment && (this._fragmentDeclaration += uniforms.fragment + "\r\n");}plugin.getSamplers(this._samplerList), plugin.getUniformBuffersNames(this._uboList);}break;}}}_collectPointNames(shaderType, customCode) {if (customCode) for (const pointName in customCode) this._codeInjectionPoints[shaderType] || (this._codeInjectionPoints[shaderType] = {}), this._codeInjectionPoints[shaderType][pointName] = !0;}_injectCustomCode(existingCallback) {return (shaderType, code) => {var _a;existingCallback && (code = existingCallback(shaderType, code)), this._uboDeclaration && (code = code.replace("#define ADDITIONAL_UBO_DECLARATION", this._uboDeclaration)), this._vertexDeclaration && (code = code.replace("#define ADDITIONAL_VERTEX_DECLARATION", this._vertexDeclaration)), this._fragmentDeclaration && (code = code.replace("#define ADDITIONAL_FRAGMENT_DECLARATION", this._fragmentDeclaration));const points = null === (_a = this._codeInjectionPoints) || void 0 === _a ? void 0 : _a[shaderType];if (!points) return code;for (let pointName in points) {let injectedCode = "";for (const plugin of this._activePlugins) {const customCode = plugin.getCustomCode(shaderType);(null === customCode || void 0 === customCode ? void 0 : customCode[pointName]) && (injectedCode += customCode[pointName] + "\r\n");}if (0 < injectedCode.length) if ("!" === pointName.charAt(0)) {pointName = pointName.substring(1);let regexFlags = "g";if ("!" === pointName.charAt(0)) regexFlags = "", pointName = pointName.substring(1);else {const matchOption = rxOption.exec(pointName);matchOption && 2 <= matchOption.length && (regexFlags = matchOption[1], pointName = pointName.substring(regexFlags.length + 1));}0 > regexFlags.indexOf("g") && (regexFlags += "g");const sourceCode = code,rx = new RegExp(pointName, regexFlags);for (let newCode, match = rx.exec(sourceCode); null !== match;) {newCode = injectedCode;for (let i = 0; i < match.length; ++i) newCode = newCode.replace("$" + i, match[i]);code = code.replace(match[0], newCode), match = rx.exec(sourceCode);}} else {const fullPointName = "#define " + pointName;code = code.replace(fullPointName, "\r\n" + injectedCode + "\r\n" + fullPointName);}}return code;};}}MaterialPluginManager._MaterialPluginClassToMainDefine = {}, MaterialPluginManager._MaterialPluginCounter = 0;const plugins = [];let inited = !1;function RegisterMaterialPlugin(pluginName, factory) {inited || (_material_js__WEBPACK_IMPORTED_MODULE_0__/* .Material.OnEventObservable.add */ .F.OnEventObservable.add((material) => {for (const [, factory] of plugins) factory(material);}, _materialPluginEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .MaterialPluginEvent.Created */ .S.Created), inited = !0);const existing = plugins.filter(([name, _factory]) => name === pluginName);0 < existing.length ? existing[0][1] = factory : plugins.push([pluginName, factory]);}function UnregisterMaterialPlugin(pluginName) {for (let i = 0; i < plugins.length; ++i) if (plugins[i][0] === pluginName) return plugins.splice(i, 1), !0;return !1;}function UnregisterAllMaterialPlugins() {plugins.length = 0;}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/multiMaterial.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "G": () => (/* binding */ MultiMaterial)
/* harmony export */ });
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.js");
/* harmony import */ var _Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tags.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
class MultiMaterial extends _Materials_material_js__WEBPACK_IMPORTED_MODULE_0__/* .Material */ .F {get subMaterials() {return this._subMaterials;}set subMaterials(value) {this._subMaterials = value, this._hookArray(value);}getChildren() {return this.subMaterials;}constructor(name, scene) {super(name, scene, !0), this._waitingSubMaterialsUniqueIds = [], this.getScene().multiMaterials.push(this), this.subMaterials = [], this._storeEffectOnSubMeshes = !0;}_hookArray(array) {const oldPush = array.push;array.push = (...items) => {const result = oldPush.apply(array, items);return this._markAllSubMeshesAsTexturesDirty(), result;};const oldSplice = array.splice;array.splice = (index, deleteCount) => {const deleted = oldSplice.apply(array, [index, deleteCount]);return this._markAllSubMeshesAsTexturesDirty(), deleted;};}getSubMaterial(index) {return 0 > index || index >= this.subMaterials.length ? this.getScene().defaultMaterial : this.subMaterials[index];}getActiveTextures() {return super.getActiveTextures().concat(...this.subMaterials.map((subMaterial) => subMaterial ? subMaterial.getActiveTextures() : []));}hasTexture(texture) {var _a;if (super.hasTexture(texture)) return !0;for (let i = 0; i < this.subMaterials.length; i++) if (null === (_a = this.subMaterials[i]) || void 0 === _a ? void 0 : _a.hasTexture(texture)) return !0;return !1;}getClassName() {return "MultiMaterial";}isReadyForSubMesh(mesh, subMesh, useInstances) {for (let index = 0; index < this.subMaterials.length; index++) {const subMaterial = this.subMaterials[index];if (subMaterial) {if (subMaterial._storeEffectOnSubMeshes) {if (!subMaterial.isReadyForSubMesh(mesh, subMesh, useInstances)) return !1;continue;}if (!subMaterial.isReady(mesh)) return !1;}}return !0;}clone(name, cloneChildren) {const newMultiMaterial = new MultiMaterial(name, this.getScene());for (let subMaterial, index = 0; index < this.subMaterials.length; index++) {subMaterial = null;const current = this.subMaterials[index];subMaterial = cloneChildren && current ? current.clone(name + "-" + current.name) : this.subMaterials[index], newMultiMaterial.subMaterials.push(subMaterial);}return newMultiMaterial;}serialize() {const serializationObject = {};serializationObject.name = this.name, serializationObject.id = this.id, serializationObject.uniqueId = this.uniqueId, _Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .$ && (serializationObject.tags = _Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags.GetTags */ .$.GetTags(this)), serializationObject.materialsUniqueIds = [], serializationObject.materials = [];for (let matIndex = 0; matIndex < this.subMaterials.length; matIndex++) {const subMat = this.subMaterials[matIndex];subMat ? (serializationObject.materialsUniqueIds.push(subMat.uniqueId), serializationObject.materials.push(subMat.id)) : (serializationObject.materialsUniqueIds.push(null), serializationObject.materials.push(null));}return serializationObject;}dispose(forceDisposeEffect, forceDisposeTextures, forceDisposeChildren) {const scene = this.getScene();if (scene) {if (forceDisposeChildren) for (let index = 0; index < this.subMaterials.length; index++) {const subMaterial = this.subMaterials[index];subMaterial && subMaterial.dispose(forceDisposeEffect, forceDisposeTextures);}const index = scene.multiMaterials.indexOf(this);0 <= index && scene.multiMaterials.splice(index, 1), super.dispose(forceDisposeEffect, forceDisposeTextures);}}static ParseMultiMaterial(parsedMultiMaterial, scene) {const multiMaterial = new MultiMaterial(parsedMultiMaterial.name, scene);return multiMaterial.id = parsedMultiMaterial.id, multiMaterial._loadedUniqueId = parsedMultiMaterial.uniqueId, _Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags.AddTagsTo */ .$.AddTagsTo(multiMaterial, parsedMultiMaterial.tags), parsedMultiMaterial.materialsUniqueIds ? multiMaterial._waitingSubMaterialsUniqueIds = parsedMultiMaterial.materialsUniqueIds : parsedMultiMaterial.materials.forEach((subMatId) => multiMaterial.subMaterials.push(scene.getLastMaterialById(subMatId))), multiMaterial;}}(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .H)("BABYLON.MultiMaterial", MultiMaterial);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/prePassConfiguration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "o": () => (/* binding */ PrePassConfiguration)
/* harmony export */ });
class PrePassConfiguration {constructor() {this.previousWorldMatrices = {}, this.previousBones = {};}static AddUniforms(uniforms) {uniforms.push("previousWorld", "previousViewProjection", "mPreviousBones");}static AddSamplers() {}bindForSubMesh(effect, scene, mesh, world) {if (scene.prePassRenderer && scene.prePassRenderer.enabled && scene.prePassRenderer.currentRTisSceneRT && -1 !== scene.prePassRenderer.getIndex(2)) {this.previousWorldMatrices[mesh.uniqueId] || (this.previousWorldMatrices[mesh.uniqueId] = world.clone()), this.previousViewProjection || (this.previousViewProjection = scene.getTransformMatrix().clone(), this.currentViewProjection = scene.getTransformMatrix().clone());const engine = scene.getEngine();this.currentViewProjection.updateFlag === scene.getTransformMatrix().updateFlag ? this._lastUpdateFrameId !== engine.frameId && (this._lastUpdateFrameId = engine.frameId, this.previousViewProjection.copyFrom(this.currentViewProjection)) : (this._lastUpdateFrameId = engine.frameId, this.previousViewProjection.copyFrom(this.currentViewProjection), this.currentViewProjection.copyFrom(scene.getTransformMatrix())), effect.setMatrix("previousWorld", this.previousWorldMatrices[mesh.uniqueId]), effect.setMatrix("previousViewProjection", this.previousViewProjection), this.previousWorldMatrices[mesh.uniqueId] = world.clone();}}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/pushMaterial.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "a": () => (/* binding */ PushMaterial)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.js");
class PushMaterial extends _Materials_material_js__WEBPACK_IMPORTED_MODULE_1__/* .Material */ .F {constructor(name, scene, storeEffectOnSubMeshes = !0) {super(name, scene), this._normalMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .y3(), this._storeEffectOnSubMeshes = storeEffectOnSubMeshes;}getEffect() {return this._storeEffectOnSubMeshes ? this._activeEffect : super.getEffect();}isReady(mesh, useInstances) {return !!mesh && (!this._storeEffectOnSubMeshes || !(mesh.subMeshes && 0 !== mesh.subMeshes.length) || this.isReadyForSubMesh(mesh, mesh.subMeshes[0], useInstances));}_isReadyForSubMesh(subMesh) {const defines = subMesh.materialDefines;return !!(!this.checkReadyOnEveryCall && subMesh.effect && defines && defines._renderId === this.getScene().getRenderId());}bindOnlyWorldMatrix(world) {this._activeEffect.setMatrix("world", world);}bindOnlyNormalMatrix(normalMatrix) {this._activeEffect.setMatrix("normalMatrix", normalMatrix);}bind(world, mesh) {mesh && this.bindForSubMesh(world, mesh, mesh.subMeshes[0]);}_afterBind(mesh, effect = null) {super._afterBind(mesh, effect), this.getScene()._cachedEffect = effect, effect && (effect._forceRebindOnNextCall = !1);}_mustRebind(scene, effect, visibility = 1) {return scene.isCachedMaterialInvalid(this, effect, visibility);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/shaderLanguage.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "x": () => (/* binding */ ShaderLanguage)
/* harmony export */ });
var ShaderLanguage;(function (ShaderLanguage) {ShaderLanguage[ShaderLanguage.GLSL = 0] = "GLSL", ShaderLanguage[ShaderLanguage.WGSL = 1] = "WGSL";})(ShaderLanguage || (ShaderLanguage = {}));

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/shaderMaterial.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "j": () => (/* binding */ ShaderMaterial)
/* harmony export */ });
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
/* harmony import */ var _materialHelper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _effectFallbacks_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/effectFallbacks.js");
/* harmony import */ var _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/webRequest.js");
/* harmony import */ var _pushMaterial_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/pushMaterial.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js");
const onCreatedEffectParameters = { effect: null, subMesh: null };class ShaderMaterial extends _pushMaterial_js__WEBPACK_IMPORTED_MODULE_9__/* .PushMaterial */ .a {constructor(name, scene, shaderPath, options = {}, storeEffectOnSubMeshes = !0) {super(name, scene, storeEffectOnSubMeshes), this._textures = {}, this._textureArrays = {}, this._externalTextures = {}, this._floats = {}, this._ints = {}, this._uints = {}, this._floatsArrays = {}, this._colors3 = {}, this._colors3Arrays = {}, this._colors4 = {}, this._colors4Arrays = {}, this._vectors2 = {}, this._vectors3 = {}, this._vectors4 = {}, this._quaternions = {}, this._quaternionsArrays = {}, this._matrices = {}, this._matrixArrays = {}, this._matrices3x3 = {}, this._matrices2x2 = {}, this._vectors2Arrays = {}, this._vectors3Arrays = {}, this._vectors4Arrays = {}, this._uniformBuffers = {}, this._textureSamplers = {}, this._storageBuffers = {}, this._cachedWorldViewMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .y3(), this._cachedWorldViewProjectionMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .y3(), this._multiview = !1, this._shaderPath = shaderPath, this._options = { needAlphaBlending: !1, needAlphaTesting: !1, attributes: ["position", "normal", "uv"], uniforms: ["worldViewProjection"], uniformBuffers: [], samplers: [], externalTextures: [], samplerObjects: [], storageBuffers: [], defines: [], useClipPlane: !1, ...options };}get shaderPath() {return this._shaderPath;}set shaderPath(shaderPath) {this._shaderPath = shaderPath;}get options() {return this._options;}getClassName() {return "ShaderMaterial";}needAlphaBlending() {return 1 > this.alpha || this._options.needAlphaBlending;}needAlphaTesting() {return this._options.needAlphaTesting;}_checkUniform(uniformName) {-1 === this._options.uniforms.indexOf(uniformName) && this._options.uniforms.push(uniformName);}setTexture(name, texture) {return -1 === this._options.samplers.indexOf(name) && this._options.samplers.push(name), this._textures[name] = texture, this;}setTextureArray(name, textures) {return -1 === this._options.samplers.indexOf(name) && this._options.samplers.push(name), this._checkUniform(name), this._textureArrays[name] = textures, this;}setExternalTexture(name, texture) {return -1 === this._options.externalTextures.indexOf(name) && this._options.externalTextures.push(name), this._externalTextures[name] = texture, this;}setFloat(name, value) {return this._checkUniform(name), this._floats[name] = value, this;}setInt(name, value) {return this._checkUniform(name), this._ints[name] = value, this;}setUInt(name, value) {return this._checkUniform(name), this._uints[name] = value, this;}setFloats(name, value) {return this._checkUniform(name), this._floatsArrays[name] = value, this;}setColor3(name, value) {return this._checkUniform(name), this._colors3[name] = value, this;}setColor3Array(name, value) {return this._checkUniform(name), this._colors3Arrays[name] = value.reduce((arr, color) => (color.toArray(arr, arr.length), arr), []), this;}setColor4(name, value) {return this._checkUniform(name), this._colors4[name] = value, this;}setColor4Array(name, value) {return this._checkUniform(name), this._colors4Arrays[name] = value.reduce((arr, color) => (color.toArray(arr, arr.length), arr), []), this;}setVector2(name, value) {return this._checkUniform(name), this._vectors2[name] = value, this;}setVector3(name, value) {return this._checkUniform(name), this._vectors3[name] = value, this;}setVector4(name, value) {return this._checkUniform(name), this._vectors4[name] = value, this;}setQuaternion(name, value) {return this._checkUniform(name), this._quaternions[name] = value, this;}setQuaternionArray(name, value) {return this._checkUniform(name), this._quaternionsArrays[name] = value.reduce((arr, quaternion) => (quaternion.toArray(arr, arr.length), arr), []), this;}setMatrix(name, value) {return this._checkUniform(name), this._matrices[name] = value, this;}setMatrices(name, value) {this._checkUniform(name);const float32Array = new Float32Array(16 * value.length);for (let index = 0; index < value.length; index++) {const matrix = value[index];matrix.copyToArray(float32Array, 16 * index);}return this._matrixArrays[name] = float32Array, this;}setMatrix3x3(name, value) {return this._checkUniform(name), this._matrices3x3[name] = value, this;}setMatrix2x2(name, value) {return this._checkUniform(name), this._matrices2x2[name] = value, this;}setArray2(name, value) {return this._checkUniform(name), this._vectors2Arrays[name] = value, this;}setArray3(name, value) {return this._checkUniform(name), this._vectors3Arrays[name] = value, this;}setArray4(name, value) {return this._checkUniform(name), this._vectors4Arrays[name] = value, this;}setUniformBuffer(name, buffer) {return -1 === this._options.uniformBuffers.indexOf(name) && this._options.uniformBuffers.push(name), this._uniformBuffers[name] = buffer, this;}setTextureSampler(name, sampler) {return -1 === this._options.samplerObjects.indexOf(name) && this._options.samplerObjects.push(name), this._textureSamplers[name] = sampler, this;}setStorageBuffer(name, buffer) {return -1 === this._options.storageBuffers.indexOf(name) && this._options.storageBuffers.push(name), this._storageBuffers[name] = buffer, this;}isReadyForSubMesh(mesh, subMesh, useInstances) {return this.isReady(mesh, useInstances, subMesh);}isReady(mesh, useInstances, subMesh) {var _a, _b, _c, _d;const storeEffectOnSubMeshes = subMesh && this._storeEffectOnSubMeshes;if (this.isFrozen) if (!storeEffectOnSubMeshes) {const effect = this._drawWrapper.effect;if (effect && effect._wasPreviouslyReady && effect._wasPreviouslyUsingInstances === useInstances) return !0;} else if (subMesh.effect && subMesh.effect._wasPreviouslyReady) return !0;const scene = this.getScene(),engine = scene.getEngine(),defines = [],attribs = [],fallbacks = new _effectFallbacks_js__WEBPACK_IMPORTED_MODULE_7__/* .EffectFallbacks */ .L();let shaderName = this._shaderPath,uniforms = this._options.uniforms,uniformBuffers = this._options.uniformBuffers,samplers = this._options.samplers;engine.getCaps().multiview && scene.activeCamera && scene.activeCamera.outputRenderTarget && 1 < scene.activeCamera.outputRenderTarget.getViewCount() && (this._multiview = !0, defines.push("#define MULTIVIEW"), -1 !== this._options.uniforms.indexOf("viewProjection") && -1 === this._options.uniforms.indexOf("viewProjectionR") && this._options.uniforms.push("viewProjectionR"));for (let index = 0; index < this._options.defines.length; index++) {const defineToAdd = 0 === this._options.defines[index].indexOf("#define") ? this._options.defines[index] : `#define ${this._options.defines[index]}`;defines.push(defineToAdd);}for (let index = 0; index < this._options.attributes.length; index++) attribs.push(this._options.attributes[index]);if (mesh && mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind) && (attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind), defines.push("#define VERTEXCOLOR")), useInstances && (defines.push("#define INSTANCES"), _materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PushAttributesForInstances */ .G.PushAttributesForInstances(attribs), (null === mesh || void 0 === mesh ? void 0 : mesh.hasThinInstances) && (defines.push("#define THIN_INSTANCES"), mesh && mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind) && (attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind), defines.push("#define INSTANCESCOLOR")))), mesh && mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind), attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind), 4 < mesh.numBoneInfluencers && (attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind), attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind));const skeleton = mesh.skeleton;defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers), fallbacks.addCPUSkinningFallback(0, mesh), skeleton.isUsingTextureForMatrices ? (defines.push("#define BONETEXTURE"), -1 === this._options.uniforms.indexOf("boneTextureWidth") && this._options.uniforms.push("boneTextureWidth"), -1 === this._options.samplers.indexOf("boneSampler") && this._options.samplers.push("boneSampler")) : (defines.push("#define BonesPerMesh " + (skeleton.bones.length + 1)), -1 === this._options.uniforms.indexOf("mBones") && this._options.uniforms.push("mBones"));} else defines.push("#define NUM_BONE_INFLUENCERS 0");let numInfluencers = 0;const manager = mesh ? mesh.morphTargetManager : null;if (manager) {const uv = manager.supportsUVs && -1 !== defines.indexOf("#define UV1"),tangent = manager.supportsTangents && -1 !== defines.indexOf("#define TANGENT"),normal = manager.supportsNormals && -1 !== defines.indexOf("#define NORMAL");numInfluencers = manager.numInfluencers, uv && defines.push("#define MORPHTARGETS_UV"), tangent && defines.push("#define MORPHTARGETS_TANGENT"), normal && defines.push("#define MORPHTARGETS_NORMAL"), 0 < numInfluencers && defines.push("#define MORPHTARGETS"), manager.isUsingTextureForTargets && (defines.push("#define MORPHTARGETS_TEXTURE"), -1 === this._options.uniforms.indexOf("morphTargetTextureIndices") && this._options.uniforms.push("morphTargetTextureIndices"), -1 === this._options.samplers.indexOf("morphTargets") && this._options.samplers.push("morphTargets")), defines.push("#define NUM_MORPH_INFLUENCERS " + numInfluencers);for (let index = 0; index < numInfluencers; index++) attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind + index), normal && attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind + index), tangent && attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind + index), uv && attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UVKind */ .o.UVKind + "_" + index);0 < numInfluencers && (uniforms = uniforms.slice(), uniforms.push("morphTargetInfluences"), uniforms.push("morphTargetTextureInfo"), uniforms.push("morphTargetTextureIndices"));} else defines.push("#define NUM_MORPH_INFLUENCERS 0");if (mesh) {const bvaManager = mesh.bakedVertexAnimationManager;bvaManager && bvaManager.isEnabled && (defines.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"), -1 === this._options.uniforms.indexOf("bakedVertexAnimationSettings") && this._options.uniforms.push("bakedVertexAnimationSettings"), -1 === this._options.uniforms.indexOf("bakedVertexAnimationTextureSizeInverted") && this._options.uniforms.push("bakedVertexAnimationTextureSizeInverted"), -1 === this._options.uniforms.indexOf("bakedVertexAnimationTime") && this._options.uniforms.push("bakedVertexAnimationTime"), -1 === this._options.samplers.indexOf("bakedVertexAnimationTexture") && this._options.samplers.push("bakedVertexAnimationTexture")), _materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.PrepareAttributesForBakedVertexAnimation */ .G.PrepareAttributesForBakedVertexAnimation(attribs, mesh, defines);}for (const name in this._textures) if (!this._textures[name].isReady()) return !1;mesh && this._shouldTurnAlphaTestOn(mesh) && defines.push("#define ALPHATEST"), !1 !== this._options.useClipPlane && ((0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_11__/* .addClipPlaneUniforms */ .qx)(uniforms), (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_11__/* .prepareDefinesForClipPlanes */ .AN)(this, scene, defines)), this.customShaderNameResolve && (uniforms = uniforms.slice(), uniformBuffers = uniformBuffers.slice(), samplers = samplers.slice(), shaderName = this.customShaderNameResolve(shaderName, uniforms, uniformBuffers, samplers, defines, attribs));const drawWrapper = storeEffectOnSubMeshes ? subMesh._getDrawWrapper() : this._drawWrapper,previousEffect = null !== (_a = null === drawWrapper || void 0 === drawWrapper ? void 0 : drawWrapper.effect) && void 0 !== _a ? _a : null,previousDefines = null !== (_b = null === drawWrapper || void 0 === drawWrapper ? void 0 : drawWrapper.defines) && void 0 !== _b ? _b : null,join = defines.join("\n");let effect = previousEffect;return (previousDefines !== join && (effect = engine.createEffect(shaderName, { attributes: attribs, uniformsNames: uniforms, uniformBuffersNames: uniformBuffers, samplers: samplers, defines: join, fallbacks: fallbacks, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousMorphTargets: numInfluencers }, shaderLanguage: this._options.shaderLanguage }, engine), storeEffectOnSubMeshes ? subMesh.setEffect(effect, join, this._materialContext) : drawWrapper && drawWrapper.setEffect(effect, join), this._onEffectCreatedObservable && (onCreatedEffectParameters.effect = effect, onCreatedEffectParameters.subMesh = null !== (_c = null !== subMesh && void 0 !== subMesh ? subMesh : null === mesh || void 0 === mesh ? void 0 : mesh.subMeshes[0]) && void 0 !== _c ? _c : null, this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters))), effect._wasPreviouslyUsingInstances = !!useInstances, !(null === (_d = null === effect || void 0 === effect || !effect.isReady()) || void 0 === _d || _d)) && (previousEffect !== effect && scene.resetCachedMaterial(), effect._wasPreviouslyReady = !0, !0);}bindOnlyWorldMatrix(world, effectOverride) {const scene = this.getScene(),effect = null !== effectOverride && void 0 !== effectOverride ? effectOverride : this.getEffect();effect && (-1 !== this._options.uniforms.indexOf("world") && effect.setMatrix("world", world), -1 !== this._options.uniforms.indexOf("worldView") && (world.multiplyToRef(scene.getViewMatrix(), this._cachedWorldViewMatrix), effect.setMatrix("worldView", this._cachedWorldViewMatrix)), -1 !== this._options.uniforms.indexOf("worldViewProjection") && (world.multiplyToRef(scene.getTransformMatrix(), this._cachedWorldViewProjectionMatrix), effect.setMatrix("worldViewProjection", this._cachedWorldViewProjectionMatrix)));}bindForSubMesh(world, mesh, subMesh) {var _a;this.bind(world, mesh, null === (_a = subMesh._drawWrapperOverride) || void 0 === _a ? void 0 : _a.effect, subMesh);}bind(world, mesh, effectOverride, subMesh) {var _a;const storeEffectOnSubMeshes = subMesh && this._storeEffectOnSubMeshes,effect = null !== effectOverride && void 0 !== effectOverride ? effectOverride : storeEffectOnSubMeshes ? subMesh.effect : this.getEffect();if (!effect) return;this._activeEffect = effect, this.bindOnlyWorldMatrix(world, effectOverride);const uniformBuffers = this._options.uniformBuffers;let useSceneUBO = !1;if (effect && uniformBuffers && 0 < uniformBuffers.length && this.getScene().getEngine().supportsUniformBuffers) for (let i = 0; i < uniformBuffers.length; ++i) {const bufferName = uniformBuffers[i];"Mesh" === bufferName ? mesh && (mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh"), mesh.transferToEffect(world)) : "Scene" === bufferName ? (_materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindSceneUniformBuffer */ .G.BindSceneUniformBuffer(effect, this.getScene().getSceneUniformBuffer()), this.getScene().finalizeSceneUbo(), useSceneUBO = !0) : void 0;}const mustRebind = mesh && storeEffectOnSubMeshes ? this._mustRebind(this.getScene(), effect, mesh.visibility) : this.getScene().getCachedMaterial() !== this;if (effect && mustRebind) {useSceneUBO || -1 === this._options.uniforms.indexOf("view") || effect.setMatrix("view", this.getScene().getViewMatrix()), useSceneUBO || -1 === this._options.uniforms.indexOf("projection") || effect.setMatrix("projection", this.getScene().getProjectionMatrix()), useSceneUBO || -1 === this._options.uniforms.indexOf("viewProjection") || (effect.setMatrix("viewProjection", this.getScene().getTransformMatrix()), this._multiview && effect.setMatrix("viewProjectionR", this.getScene()._transformMatrixR)), this.getScene().activeCamera && -1 !== this._options.uniforms.indexOf("cameraPosition") && effect.setVector3("cameraPosition", this.getScene().activeCamera.globalPosition), _materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindBonesParameters */ .G.BindBonesParameters(mesh, effect), (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_11__/* .bindClipPlane */ .an)(effect, this, this.getScene());for (var name in this._textures) effect.setTexture(name, this._textures[name]);for (name in this._textureArrays) effect.setTextureArray(name, this._textureArrays[name]);for (name in this._externalTextures) effect.setExternalTexture(name, this._externalTextures[name]);for (name in this._ints) effect.setInt(name, this._ints[name]);for (name in this._uints) effect.setUInt(name, this._uints[name]);for (name in this._floats) effect.setFloat(name, this._floats[name]);for (name in this._floatsArrays) effect.setArray(name, this._floatsArrays[name]);for (name in this._colors3) effect.setColor3(name, this._colors3[name]);for (name in this._colors3Arrays) effect.setArray3(name, this._colors3Arrays[name]);for (name in this._colors4) {const color = this._colors4[name];effect.setFloat4(name, color.r, color.g, color.b, color.a);}for (name in this._colors4Arrays) effect.setArray4(name, this._colors4Arrays[name]);for (name in this._vectors2) effect.setVector2(name, this._vectors2[name]);for (name in this._vectors3) effect.setVector3(name, this._vectors3[name]);for (name in this._vectors4) effect.setVector4(name, this._vectors4[name]);for (name in this._quaternions) effect.setQuaternion(name, this._quaternions[name]);for (name in this._matrices) effect.setMatrix(name, this._matrices[name]);for (name in this._matrixArrays) effect.setMatrices(name, this._matrixArrays[name]);for (name in this._matrices3x3) effect.setMatrix3x3(name, this._matrices3x3[name]);for (name in this._matrices2x2) effect.setMatrix2x2(name, this._matrices2x2[name]);for (name in this._vectors2Arrays) effect.setArray2(name, this._vectors2Arrays[name]);for (name in this._vectors3Arrays) effect.setArray3(name, this._vectors3Arrays[name]);for (name in this._vectors4Arrays) effect.setArray4(name, this._vectors4Arrays[name]);for (name in this._quaternionsArrays) effect.setArray4(name, this._quaternionsArrays[name]);for (name in this._uniformBuffers) {const buffer = this._uniformBuffers[name].getBuffer();buffer && effect.bindUniformBuffer(buffer, name);}for (name in this._textureSamplers) effect.setTextureSampler(name, this._textureSamplers[name]);for (name in this._storageBuffers) effect.setStorageBuffer(name, this._storageBuffers[name]);}if (effect && mesh && (mustRebind || !this.isFrozen)) {const manager = mesh.morphTargetManager;manager && 0 < manager.numInfluencers && _materialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialHelper.BindMorphTargetParameters */ .G.BindMorphTargetParameters(mesh, effect);const bvaManager = mesh.bakedVertexAnimationManager;bvaManager && bvaManager.isEnabled && (null === (_a = mesh.bakedVertexAnimationManager) || void 0 === _a ? void 0 : _a.bind(effect, !!effect._wasPreviouslyUsingInstances));}this._afterBind(mesh, effect);}getActiveTextures() {const activeTextures = super.getActiveTextures();for (const name in this._textures) activeTextures.push(this._textures[name]);for (const name in this._textureArrays) {const array = this._textureArrays[name];for (let index = 0; index < array.length; index++) activeTextures.push(array[index]);}return activeTextures;}hasTexture(texture) {if (super.hasTexture(texture)) return !0;for (const name in this._textures) if (this._textures[name] === texture) return !0;for (const name in this._textureArrays) {const array = this._textureArrays[name];for (let index = 0; index < array.length; index++) if (array[index] === texture) return !0;}return !1;}clone(name) {const result = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper.Clone */ .p4.Clone(() => new ShaderMaterial(name, this.getScene(), this._shaderPath, this._options, this._storeEffectOnSubMeshes), this);for (const key in result.name = name, result.id = name, "object" == typeof result._shaderPath && (result._shaderPath = { ...result._shaderPath }), this._options = { ...this._options }, Object.keys(this._options).forEach((propName) => {const propValue = this._options[propName];Array.isArray(propValue) && (this._options[propName] = propValue.slice(0));}), this.stencil.copyTo(result.stencil), this._textures) result.setTexture(key, this._textures[key]);for (const key in this._textureArrays) result.setTextureArray(key, this._textureArrays[key]);for (const key in this._externalTextures) result.setExternalTexture(key, this._externalTextures[key]);for (const key in this._ints) result.setInt(key, this._ints[key]);for (const key in this._uints) result.setUInt(key, this._uints[key]);for (const key in this._floats) result.setFloat(key, this._floats[key]);for (const key in this._floatsArrays) result.setFloats(key, this._floatsArrays[key]);for (const key in this._colors3) result.setColor3(key, this._colors3[key]);for (const key in this._colors3Arrays) result._colors3Arrays[key] = this._colors3Arrays[key];for (const key in this._colors4) result.setColor4(key, this._colors4[key]);for (const key in this._colors4Arrays) result._colors4Arrays[key] = this._colors4Arrays[key];for (const key in this._vectors2) result.setVector2(key, this._vectors2[key]);for (const key in this._vectors3) result.setVector3(key, this._vectors3[key]);for (const key in this._vectors4) result.setVector4(key, this._vectors4[key]);for (const key in this._quaternions) result.setQuaternion(key, this._quaternions[key]);for (const key in this._quaternionsArrays) result._quaternionsArrays[key] = this._quaternionsArrays[key];for (const key in this._matrices) result.setMatrix(key, this._matrices[key]);for (const key in this._matrixArrays) result._matrixArrays[key] = this._matrixArrays[key].slice();for (const key in this._matrices3x3) result.setMatrix3x3(key, this._matrices3x3[key]);for (const key in this._matrices2x2) result.setMatrix2x2(key, this._matrices2x2[key]);for (const key in this._vectors2Arrays) result.setArray2(key, this._vectors2Arrays[key]);for (const key in this._vectors3Arrays) result.setArray3(key, this._vectors3Arrays[key]);for (const key in this._vectors4Arrays) result.setArray4(key, this._vectors4Arrays[key]);for (const key in this._uniformBuffers) result.setUniformBuffer(key, this._uniformBuffers[key]);for (const key in this._textureSamplers) result.setTextureSampler(key, this._textureSamplers[key]);for (const key in this._storageBuffers) result.setStorageBuffer(key, this._storageBuffers[key]);return result;}dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh) {if (forceDisposeTextures) {for (var name in this._textures) this._textures[name].dispose();for (name in this._textureArrays) {const array = this._textureArrays[name];for (let index = 0; index < array.length; index++) array[index].dispose();}}this._textures = {}, super.dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh);}serialize() {const serializationObject = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper.Serialize */ .p4.Serialize(this);serializationObject.customType = "BABYLON.ShaderMaterial", serializationObject.uniqueId = this.uniqueId, serializationObject.options = this._options, serializationObject.shaderPath = this._shaderPath, serializationObject.storeEffectOnSubMeshes = this._storeEffectOnSubMeshes;for (var name in serializationObject.stencil = this.stencil.serialize(), serializationObject.textures = {}, this._textures) serializationObject.textures[name] = this._textures[name].serialize();for (name in serializationObject.textureArrays = {}, this._textureArrays) {serializationObject.textureArrays[name] = [];const array = this._textureArrays[name];for (let index = 0; index < array.length; index++) serializationObject.textureArrays[name].push(array[index].serialize());}for (name in serializationObject.ints = {}, this._ints) serializationObject.ints[name] = this._ints[name];for (name in serializationObject.uints = {}, this._uints) serializationObject.uints[name] = this._uints[name];for (name in serializationObject.floats = {}, this._floats) serializationObject.floats[name] = this._floats[name];for (name in serializationObject.FloatArrays = {}, this._floatsArrays) serializationObject.FloatArrays[name] = this._floatsArrays[name];for (name in serializationObject.colors3 = {}, this._colors3) serializationObject.colors3[name] = this._colors3[name].asArray();for (name in serializationObject.colors3Arrays = {}, this._colors3Arrays) serializationObject.colors3Arrays[name] = this._colors3Arrays[name];for (name in serializationObject.colors4 = {}, this._colors4) serializationObject.colors4[name] = this._colors4[name].asArray();for (name in serializationObject.colors4Arrays = {}, this._colors4Arrays) serializationObject.colors4Arrays[name] = this._colors4Arrays[name];for (name in serializationObject.vectors2 = {}, this._vectors2) serializationObject.vectors2[name] = this._vectors2[name].asArray();for (name in serializationObject.vectors3 = {}, this._vectors3) serializationObject.vectors3[name] = this._vectors3[name].asArray();for (name in serializationObject.vectors4 = {}, this._vectors4) serializationObject.vectors4[name] = this._vectors4[name].asArray();for (name in serializationObject.quaternions = {}, this._quaternions) serializationObject.quaternions[name] = this._quaternions[name].asArray();for (name in serializationObject.matrices = {}, this._matrices) serializationObject.matrices[name] = this._matrices[name].asArray();for (name in serializationObject.matrixArray = {}, this._matrixArrays) serializationObject.matrixArray[name] = this._matrixArrays[name];for (name in serializationObject.matrices3x3 = {}, this._matrices3x3) serializationObject.matrices3x3[name] = this._matrices3x3[name];for (name in serializationObject.matrices2x2 = {}, this._matrices2x2) serializationObject.matrices2x2[name] = this._matrices2x2[name];for (name in serializationObject.vectors2Arrays = {}, this._vectors2Arrays) serializationObject.vectors2Arrays[name] = this._vectors2Arrays[name];for (name in serializationObject.vectors3Arrays = {}, this._vectors3Arrays) serializationObject.vectors3Arrays[name] = this._vectors3Arrays[name];for (name in serializationObject.vectors4Arrays = {}, this._vectors4Arrays) serializationObject.vectors4Arrays[name] = this._vectors4Arrays[name];for (name in serializationObject.quaternionsArrays = {}, this._quaternionsArrays) serializationObject.quaternionsArrays[name] = this._quaternionsArrays[name];return serializationObject;}static Parse(source, scene, rootUrl) {const material = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper.Parse */ .p4.Parse(() => new ShaderMaterial(source.name, scene, source.shaderPath, source.options, source.storeEffectOnSubMeshes), source, scene, rootUrl);for (var name in source.stencil && material.stencil.parse(source.stencil, scene, rootUrl), source.textures) material.setTexture(name, _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_3__/* .Texture.Parse */ .x.Parse(source.textures[name], scene, rootUrl));for (name in source.textureArrays) {const array = source.textureArrays[name],textureArray = [];for (let index = 0; index < array.length; index++) textureArray.push(_Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_3__/* .Texture.Parse */ .x.Parse(array[index], scene, rootUrl));material.setTextureArray(name, textureArray);}for (name in source.ints) material.setInt(name, source.ints[name]);for (name in source.uints) material.setUInt(name, source.uints[name]);for (name in source.floats) material.setFloat(name, source.floats[name]);for (name in source.floatsArrays) material.setFloats(name, source.floatsArrays[name]);for (name in source.colors3) material.setColor3(name, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__/* .Color3.FromArray */ .Wo.FromArray(source.colors3[name]));for (name in source.colors3Arrays) {const colors = source.colors3Arrays[name].reduce((arr, num, i) => (0 == i % 3 ? arr.push([num]) : arr[arr.length - 1].push(num), arr), []).map((color) => _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__/* .Color3.FromArray */ .Wo.FromArray(color));material.setColor3Array(name, colors);}for (name in source.colors4) material.setColor4(name, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__/* .Color4.FromArray */ .HE.FromArray(source.colors4[name]));for (name in source.colors4Arrays) {const colors = source.colors4Arrays[name].reduce((arr, num, i) => (0 == i % 4 ? arr.push([num]) : arr[arr.length - 1].push(num), arr), []).map((color) => _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__/* .Color4.FromArray */ .HE.FromArray(color));material.setColor4Array(name, colors);}for (name in source.vectors2) material.setVector2(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2.FromArray */ .FM.FromArray(source.vectors2[name]));for (name in source.vectors3) material.setVector3(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.FromArray */ .P.FromArray(source.vectors3[name]));for (name in source.vectors4) material.setVector4(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4.FromArray */ .Lt.FromArray(source.vectors4[name]));for (name in source.quaternions) material.setQuaternion(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion.FromArray */ ._f.FromArray(source.quaternions[name]));for (name in source.matrices) material.setMatrix(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.FromArray */ .y3.FromArray(source.matrices[name]));for (name in source.matrixArray) material._matrixArrays[name] = new Float32Array(source.matrixArray[name]);for (name in source.matrices3x3) material.setMatrix3x3(name, source.matrices3x3[name]);for (name in source.matrices2x2) material.setMatrix2x2(name, source.matrices2x2[name]);for (name in source.vectors2Arrays) material.setArray2(name, source.vectors2Arrays[name]);for (name in source.vectors3Arrays) material.setArray3(name, source.vectors3Arrays[name]);for (name in source.vectors4Arrays) material.setArray4(name, source.vectors4Arrays[name]);for (name in source.quaternionsArrays) material.setArray4(name, source.quaternionsArrays[name]);return material;}static ParseFromFileAsync(name, url, scene, rootUrl = "") {return new Promise((resolve, reject) => {const request = new _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_8__/* .WebRequest */ .g();request.addEventListener("readystatechange", () => {if (4 == request.readyState) if (200 == request.status) {const serializationObject = JSON.parse(request.responseText),output = this.Parse(serializationObject, scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, rootUrl);name && (output.name = name), resolve(output);} else reject("Unable to load the ShaderMaterial");}), request.open("GET", url), request.send();});}static ParseFromSnippetAsync(snippetId, scene, rootUrl = "") {return new Promise((resolve, reject) => {const request = new _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_8__/* .WebRequest */ .g();request.addEventListener("readystatechange", () => {if (4 == request.readyState) if (200 == request.status) {const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload),serializationObject = JSON.parse(snippet.shaderMaterial),output = this.Parse(serializationObject, scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, rootUrl);output.snippetId = snippetId, resolve(output);} else reject("Unable to load the snippet " + snippetId);}), request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/")), request.send();});}}ShaderMaterial.SnippetUrl = `https://snippet.babylonjs.com`, ShaderMaterial.CreateFromSnippetAsync = ShaderMaterial.ParseFromSnippetAsync, (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__/* .RegisterClass */ .H)("BABYLON.ShaderMaterial", ShaderMaterial);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/standardMaterial.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "K": () => (/* binding */ StandardMaterial),
  "R": () => (/* binding */ StandardMaterialDefines)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/tslib.es6.js
var tslib_es6 = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/decorators.js
var decorators = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/smartArray.js
var smartArray = __webpack_require__("./node_modules/@babylonjs/core/Misc/smartArray.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/scene.js + 1 modules
var core_scene = __webpack_require__("./node_modules/@babylonjs/core/scene.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.color.js
var math_color = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/buffer.js
var buffer = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/prePassConfiguration.js
var prePassConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/prePassConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js
var imageProcessingConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/material.js + 1 modules
var material = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialPluginEvent.js
var materialPluginEvent = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginEvent.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialDefines.js
var materialDefines = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/pushMaterial.js
var pushMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/pushMaterial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialHelper.js
var materialHelper = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/texture.js
var texture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/typeStore.js
var typeStore = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialFlags.js
var materialFlags = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialFlags.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultFragmentDeclaration.js
const defaultFragmentDeclaration_name = "defaultFragmentDeclaration",shader = `uniform vec4 vEyePosition;
uniform vec4 vDiffuseColor;
#ifdef SPECULARTERM
uniform vec4 vSpecularColor;
#endif
uniform vec3 vEmissiveColor;
uniform vec3 vAmbientColor;
uniform float visibility;
#ifdef DIFFUSE
uniform vec2 vDiffuseInfos;
#endif
#ifdef AMBIENT
uniform vec2 vAmbientInfos;
#endif
#ifdef OPACITY 
uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;
uniform vec2 vTangentSpaceParams;
#endif
#ifdef ALPHATEST
uniform float alphaCutOff;
#endif
#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION) || defined(PREPASS)
uniform mat4 view;
#endif
#ifdef REFRACTION
uniform vec4 vRefractionInfos;
#ifndef REFRACTIONMAP_3D
uniform mat4 refractionMatrix;
#endif
#ifdef REFRACTIONFRESNEL
uniform vec4 refractionLeftColor;
uniform vec4 refractionRightColor;
#endif
#if defined(USE_LOCAL_REFRACTIONMAP_CUBIC) && defined(REFRACTIONMAP_3D)
uniform vec3 vRefractionPosition;
uniform vec3 vRefractionSize; 
#endif
#endif
#if defined(SPECULAR) && defined(SPECULARTERM)
uniform vec2 vSpecularInfos;
#endif
#ifdef DIFFUSEFRESNEL
uniform vec4 diffuseLeftColor;
uniform vec4 diffuseRightColor;
#endif
#ifdef OPACITYFRESNEL
uniform vec4 opacityParts;
#endif
#ifdef EMISSIVEFRESNEL
uniform vec4 emissiveLeftColor;
uniform vec4 emissiveRightColor;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;
#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)
uniform mat4 reflectionMatrix;
#endif
#ifndef REFLECTIONMAP_SKYBOX
#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)
uniform vec3 vReflectionPosition;
uniform vec3 vReflectionSize; 
#endif
#endif
#ifdef REFLECTIONFRESNEL
uniform vec4 reflectionLeftColor;
uniform vec4 reflectionRightColor;
#endif
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;
#endif
#define ADDITIONAL_FRAGMENT_DECLARATION
`;shaderStore/* ShaderStore.IncludesShadersStore.defaultFragmentDeclaration */.v.IncludesShadersStore.defaultFragmentDeclaration = shader;const defaultFragmentDeclaration = { name: "defaultFragmentDeclaration", shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js
var sceneUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js
var meshUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultUboDeclaration.js
const defaultUboDeclaration_name = "defaultUboDeclaration",defaultUboDeclaration_shader = `layout(std140,column_major) uniform;
uniform Material
{
vec4 diffuseLeftColor;
vec4 diffuseRightColor;
vec4 opacityParts;
vec4 reflectionLeftColor;
vec4 reflectionRightColor;
vec4 refractionLeftColor;
vec4 refractionRightColor;
vec4 emissiveLeftColor;
vec4 emissiveRightColor;
vec2 vDiffuseInfos;
vec2 vAmbientInfos;
vec2 vOpacityInfos;
vec2 vReflectionInfos;
vec3 vReflectionPosition;
vec3 vReflectionSize;
vec2 vEmissiveInfos;
vec2 vLightmapInfos;
vec2 vSpecularInfos;
vec3 vBumpInfos;
mat4 diffuseMatrix;
mat4 ambientMatrix;
mat4 opacityMatrix;
mat4 reflectionMatrix;
mat4 emissiveMatrix;
mat4 lightmapMatrix;
mat4 specularMatrix;
mat4 bumpMatrix;
vec2 vTangentSpaceParams;
float pointSize;
float alphaCutOff;
mat4 refractionMatrix;
vec4 vRefractionInfos;
vec3 vRefractionPosition;
vec3 vRefractionSize;
vec4 vSpecularColor;
vec3 vEmissiveColor;
vec4 vDiffuseColor;
vec3 vAmbientColor;
#define ADDITIONAL_UBO_DECLARATION
};
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;shaderStore/* ShaderStore.IncludesShadersStore.defaultUboDeclaration */.v.IncludesShadersStore.defaultUboDeclaration = defaultUboDeclaration_shader;const defaultUboDeclaration = { name: "defaultUboDeclaration", shader: defaultUboDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassDeclaration.js
var prePassDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitDeclaration.js
var oitDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js
var mainUVVaryingDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js
var lightFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js
var lightUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js
var lightsFragmentFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js
var shadowsFragmentFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.js
var samplerFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fresnelFunction.js
var fresnelFunction = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fresnelFunction.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js
var reflectionFunction = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js
var imageProcessingDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js
var imageProcessingFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js
var bumpFragmentMainFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js
var bumpFragmentFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js
var bumpFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js
var depthPrePass = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js
var lightFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitFragment.js
var oitFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/default.fragment.js
const default_fragment_name = "defaultPixelShader",default_fragment_shader = `#include<__decl__defaultFragment>
#if defined(BUMP) || !defined(NORMAL)
#extension GL_OES_standard_derivatives : enable
#endif
#include<prePassDeclaration>[SCENE_MRT_COUNT]
#include<oitDeclaration>
#define CUSTOM_FRAGMENT_BEGIN
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#define RECIPROCAL_PI2 0.15915494
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<mainUVVaryingDeclaration>[1..7]
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)
#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
#ifdef REFRACTION
#ifdef REFRACTIONMAP_3D
uniform samplerCube refractionCubeSampler;
#else
uniform sampler2D refraction2DSampler;
#endif
#endif
#if defined(SPECULARTERM)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)
#endif
#include<fresnelFunction>
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
uniform samplerCube reflectionCubeSampler;
#else
uniform sampler2D reflection2DSampler;
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#endif
#include<reflectionFunction>
#endif
#include<imageProcessingDeclaration>
#include<imageProcessingFunctions>
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
vec4 baseColor=vec4(1.,1.,1.,1.);
vec3 diffuseColor=vDiffuseColor.rgb;
float alpha=vDiffuseColor.a;
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));
#endif
#include<bumpFragment>
#ifdef TWOSIDEDLIGHTING
normalW=gl_FrontFacing ? normalW : -normalW;
#endif
#ifdef DIFFUSE
baseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);
#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)
if (baseColor.a<alphaCutOff)
discard;
#endif
#ifdef ALPHAFROMDIFFUSE
alpha*=baseColor.a;
#endif
#define CUSTOM_FRAGMENT_UPDATE_ALPHA
baseColor.rgb*=vDiffuseInfos.y;
#endif
#include<depthPrePass>
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
baseColor.rgb*=vColor.rgb;
#endif
#ifdef DETAIL
baseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);
#endif
#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE
vec3 baseAmbientColor=vec3(1.,1.,1.);
#ifdef AMBIENT
baseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;
#endif
#define CUSTOM_FRAGMENT_BEFORE_LIGHTS
#ifdef SPECULARTERM
float glossiness=vSpecularColor.a;
vec3 specularColor=vSpecularColor.rgb;
#ifdef SPECULAR
vec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);
specularColor=specularMapColor.rgb;
#ifdef GLOSSINESS
glossiness=glossiness*specularMapColor.a;
#endif
#endif
#else
float glossiness=0.;
#endif
vec3 diffuseBase=vec3(0.,0.,0.);
lightingInfo info;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
float shadow=1.;
#ifdef LIGHTMAP
vec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);
#ifdef RGBDLIGHTMAP
lightmapColor.rgb=fromRGBD(lightmapColor);
#endif
lightmapColor.rgb*=vLightmapInfos.y;
#endif
#include<lightFragment>[0..maxSimultaneousLights]
vec4 refractionColor=vec4(0.,0.,0.,1.);
#ifdef REFRACTION
vec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));
#ifdef REFRACTIONMAP_3D
#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC
refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,vRefractionSize,vRefractionPosition);
#endif
refractionVector.y=refractionVector.y*vRefractionInfos.w;
if (dot(refractionVector,viewDirectionW)<1.0) {
refractionColor=textureCube(refractionCubeSampler,refractionVector);
}
#else
vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));
vec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;
refractionCoords.y=1.0-refractionCoords.y;
refractionColor=texture2D(refraction2DSampler,refractionCoords);
#endif
#ifdef RGBDREFRACTION
refractionColor.rgb=fromRGBD(refractionColor);
#endif
#ifdef IS_REFRACTION_LINEAR
refractionColor.rgb=toGammaSpace(refractionColor.rgb);
#endif
refractionColor.rgb*=vRefractionInfos.x;
#endif
vec4 reflectionColor=vec4(0.,0.,0.,1.);
#ifdef REFLECTION
vec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);
#ifdef REFLECTIONMAP_OPPOSITEZ
vReflectionUVW.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
#ifdef ROUGHNESS
float bias=vReflectionInfos.y;
#ifdef SPECULARTERM
#ifdef SPECULAR
#ifdef GLOSSINESS
bias*=(1.0-specularMapColor.a);
#endif
#endif
#endif
reflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);
#else
reflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);
#endif
#else
vec2 coords=vReflectionUVW.xy;
#ifdef REFLECTIONMAP_PROJECTION
coords/=vReflectionUVW.z;
#endif
coords.y=1.0-coords.y;
reflectionColor=texture2D(reflection2DSampler,coords);
#endif
#ifdef RGBDREFLECTION
reflectionColor.rgb=fromRGBD(reflectionColor);
#endif
#ifdef IS_REFLECTION_LINEAR
reflectionColor.rgb=toGammaSpace(reflectionColor.rgb);
#endif
reflectionColor.rgb*=vReflectionInfos.x;
#ifdef REFLECTIONFRESNEL
float reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);
#ifdef REFLECTIONFRESNELFROMSPECULAR
#ifdef SPECULARTERM
reflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;
#else
reflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;
#endif
#else
reflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;
#endif
#endif
#endif
#ifdef REFRACTIONFRESNEL
float refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);
refractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;
#endif
#ifdef OPACITY
vec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);
#ifdef OPACITYRGB
opacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);
alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;
#else
alpha*=opacityMap.a*vOpacityInfos.y;
#endif
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#ifdef OPACITYFRESNEL
float opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);
alpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;
#endif
#ifdef ALPHATEST
#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS
if (alpha<alphaCutOff)
discard;
#endif
#ifndef ALPHABLEND
alpha=1.0;
#endif
#endif
vec3 emissiveColor=vEmissiveColor;
#ifdef EMISSIVE
emissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;
#endif
#ifdef EMISSIVEFRESNEL
float emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);
emissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;
#endif
#ifdef DIFFUSEFRESNEL
float diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);
diffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;
#endif
#ifdef EMISSIVEASILLUMINATION
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
#else
#ifdef LINKEMISSIVEWITHDIFFUSE
vec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
#else
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
#endif
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase*specularColor;
#ifdef SPECULAROVERALPHA
alpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);
#endif
#else
vec3 finalSpecular=vec3(0.0);
#endif
#ifdef REFLECTIONOVERALPHA
alpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);
#endif
#ifdef EMISSIVEASILLUMINATION
vec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);
#else
vec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);
#endif
#ifdef LIGHTMAP
#ifndef LIGHTMAPEXCLUDED
#ifdef USELIGHTMAPASSHADOWMAP
color.rgb*=lightmapColor.rgb;
#else
color.rgb+=lightmapColor.rgb;
#endif
#endif
#endif
#define CUSTOM_FRAGMENT_BEFORE_FOG
color.rgb=max(color.rgb,0.);
#include<logDepthFragment>
#include<fogFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
color.rgb=toLinearSpace(color.rgb);
#else
#ifdef IMAGEPROCESSING
color.rgb=toLinearSpace(color.rgb);
color=applyImageProcessing(color);
#endif
#endif
color.a*=visibility;
#ifdef PREMULTIPLYALPHA
color.rgb*=color.a;
#endif
#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
#ifdef PREPASS
float writeGeometryInfo=color.a>0.4 ? 1.0 : 0.0;
gl_FragData[0]=color; 
#ifdef PREPASS_POSITION
gl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);
#endif
#ifdef PREPASS_VELOCITY
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;
vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;
vec2 velocity=abs(a-b);
velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;
gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_IRRADIANCE
gl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_DEPTH
gl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_NORMAL
gl_FragData[PREPASS_NORMAL_INDEX]=vec4((view*vec4(normalW,0.0)).rgb,writeGeometryInfo); 
#endif
#ifdef PREPASS_ALBEDO_SQRT
gl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_REFLECTIVITY
#if defined(SPECULARTERM)
#if defined(SPECULAR)
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(specularMapColor)*writeGeometryInfo; 
#else
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(specularColor,1.0)*writeGeometryInfo;
#endif
#else
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0)*writeGeometryInfo;
#endif
#endif
#endif
#if !defined(PREPASS) || defined(WEBGL2)
gl_FragColor=color;
#endif
#include<oitFragment>
#if ORDER_INDEPENDENT_TRANSPARENCY
if (fragDepth==nearestDepth) {
frontColor.rgb+=color.rgb*color.a*alphaMultiplier;
frontColor.a=1.0-alphaMultiplier*(1.0-color.a);
} else {
backColor+=color;
}
#endif
#define CUSTOM_FRAGMENT_MAIN_END
}
`;shaderStore/* ShaderStore.ShadersStore.defaultPixelShader */.v.ShadersStore.defaultPixelShader = default_fragment_shader;const defaultPixelShader = { name: "defaultPixelShader", shader: default_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultVertexDeclaration.js
const defaultVertexDeclaration_name = "defaultVertexDeclaration",defaultVertexDeclaration_shader = `uniform mat4 viewProjection;
uniform mat4 view;
#ifdef DIFFUSE
uniform mat4 diffuseMatrix;
uniform vec2 vDiffuseInfos;
#endif
#ifdef AMBIENT
uniform mat4 ambientMatrix;
uniform vec2 vAmbientInfos;
#endif
#ifdef OPACITY
uniform mat4 opacityMatrix;
uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;
uniform mat4 emissiveMatrix;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;
uniform mat4 lightmapMatrix;
#endif
#if defined(SPECULAR) && defined(SPECULARTERM)
uniform vec2 vSpecularInfos;
uniform mat4 specularMatrix;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;
uniform mat4 bumpMatrix;
#endif
#ifdef REFLECTION
uniform mat4 reflectionMatrix;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;
uniform mat4 detailMatrix;
#endif
#define ADDITIONAL_VERTEX_DECLARATION
`;shaderStore/* ShaderStore.IncludesShadersStore.defaultVertexDeclaration */.v.IncludesShadersStore.defaultVertexDeclaration = defaultVertexDeclaration_shader;const defaultVertexDeclaration = { name: "defaultVertexDeclaration", shader: defaultVertexDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.js
var uvAttributeDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.js
var prePassVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.js
var samplerVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.js
var bumpVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js
var lightVxFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js
var lightVxUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.js
var prePassVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.js
var uvVariableDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.js
var samplerVertexImplementation = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js
var bumpVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js
var shadowsVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js
var vertexColorMixing = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pointCloudVertex.js
const pointCloudVertex_name = "pointCloudVertex",pointCloudVertex_shader = `#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.pointCloudVertex */.v.IncludesShadersStore.pointCloudVertex = pointCloudVertex_shader;const pointCloudVertex = { name: "pointCloudVertex", shader: pointCloudVertex_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/default.vertex.js
const default_vertex_name = "defaultVertexShader",default_vertex_shader = `#include<__decl__defaultVertex>
#define CUSTOM_VERTEX_BEGIN
attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef TANGENT
attribute vec4 tangent;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#include<uvAttributeDeclaration>[2..7]
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<helperFunctions>
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
#include<prePassVertexDeclaration>
#include<mainUVVaryingDeclaration>[1..7]
#include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)
#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
#if defined(SPECULARTERM)
#include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)
#endif
#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<bumpVertexDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 positionUpdated=position;
#ifdef NORMAL
vec3 normalUpdated=normal;
#endif
#ifdef TANGENT
vec4 tangentUpdated=tangent;
#endif
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
vPositionUVW=positionUpdated;
#endif
#define CUSTOM_VERTEX_UPDATE_POSITION
#define CUSTOM_VERTEX_UPDATE_NORMAL
#include<instancesVertex>
#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#ifdef NORMAL
mat3 normalWorld=mat3(finalWorld);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));
vNormalW=normalize(normalWorld*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vNormalW=normalize(normalWorld*normalUpdated);
#endif
#endif
#define CUSTOM_VERTEX_UPDATE_WORLDPOS
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {
gl_Position=viewProjection*worldPos;
} else {
gl_Position=viewProjectionR*worldPos;
}
#else
gl_Position=viewProjection*worldPos;
#endif
vPositionW=vec3(worldPos);
#include<prePassVertex>
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));
#endif
#ifndef UV1
vec2 uvUpdated=vec2(0.,0.);
#endif
#ifdef MAINUV1
vMainUV1=uvUpdated;
#endif
#include<uvVariableDeclaration>[2..7]
#include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
#if defined(SPECULARTERM)
#include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)
#endif
#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
#include<bumpVertex>
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#include<pointCloudVertex>
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;shaderStore/* ShaderStore.ShadersStore.defaultVertexShader */.v.ShadersStore.defaultVertexShader = default_vertex_shader;const defaultVertexShader = { name: "defaultVertexShader", shader: default_vertex_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effectFallbacks.js
var effectFallbacks = __webpack_require__("./node_modules/@babylonjs/core/Materials/effectFallbacks.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.js
var material_detailMapConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js
var clipPlaneMaterialHelper = __webpack_require__("./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/standardMaterial.js
const onCreatedEffectParameters = { effect: null, subMesh: null };class StandardMaterialDefines extends materialDefines/* MaterialDefines */.H {constructor(externalProperties) {super(externalProperties), this.MAINUV1 = !1, this.MAINUV2 = !1, this.MAINUV3 = !1, this.MAINUV4 = !1, this.MAINUV5 = !1, this.MAINUV6 = !1, this.DIFFUSE = !1, this.DIFFUSEDIRECTUV = 0, this.BAKED_VERTEX_ANIMATION_TEXTURE = !1, this.AMBIENT = !1, this.AMBIENTDIRECTUV = 0, this.OPACITY = !1, this.OPACITYDIRECTUV = 0, this.OPACITYRGB = !1, this.REFLECTION = !1, this.EMISSIVE = !1, this.EMISSIVEDIRECTUV = 0, this.SPECULAR = !1, this.SPECULARDIRECTUV = 0, this.BUMP = !1, this.BUMPDIRECTUV = 0, this.PARALLAX = !1, this.PARALLAXOCCLUSION = !1, this.SPECULAROVERALPHA = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.ALPHAFROMDIFFUSE = !1, this.POINTSIZE = !1, this.FOG = !1, this.SPECULARTERM = !1, this.DIFFUSEFRESNEL = !1, this.OPACITYFRESNEL = !1, this.REFLECTIONFRESNEL = !1, this.REFRACTIONFRESNEL = !1, this.EMISSIVEFRESNEL = !1, this.FRESNEL = !1, this.NORMAL = !1, this.TANGENT = !1, this.UV1 = !1, this.UV2 = !1, this.UV3 = !1, this.UV4 = !1, this.UV5 = !1, this.UV6 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.BONETEXTURE = !1, this.BONES_VELOCITY_ENABLED = !1, this.INSTANCES = !1, this.THIN_INSTANCES = !1, this.INSTANCESCOLOR = !1, this.GLOSSINESS = !1, this.ROUGHNESS = !1, this.EMISSIVEASILLUMINATION = !1, this.LINKEMISSIVEWITHDIFFUSE = !1, this.REFLECTIONFRESNELFROMSPECULAR = !1, this.LIGHTMAP = !1, this.LIGHTMAPDIRECTUV = 0, this.OBJECTSPACE_NORMALMAP = !1, this.USELIGHTMAPASSHADOWMAP = !1, this.REFLECTIONMAP_3D = !1, this.REFLECTIONMAP_SPHERICAL = !1, this.REFLECTIONMAP_PLANAR = !1, this.REFLECTIONMAP_CUBIC = !1, this.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, this.USE_LOCAL_REFRACTIONMAP_CUBIC = !1, this.REFLECTIONMAP_PROJECTION = !1, this.REFLECTIONMAP_SKYBOX = !1, this.REFLECTIONMAP_EXPLICIT = !1, this.REFLECTIONMAP_EQUIRECTANGULAR = !1, this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, this.REFLECTIONMAP_OPPOSITEZ = !1, this.INVERTCUBICMAP = !1, this.LOGARITHMICDEPTH = !1, this.REFRACTION = !1, this.REFRACTIONMAP_3D = !1, this.REFLECTIONOVERALPHA = !1, this.TWOSIDEDLIGHTING = !1, this.SHADOWFLOAT = !1, this.MORPHTARGETS = !1, this.MORPHTARGETS_NORMAL = !1, this.MORPHTARGETS_TANGENT = !1, this.MORPHTARGETS_UV = !1, this.NUM_MORPH_INFLUENCERS = 0, this.MORPHTARGETS_TEXTURE = !1, this.NONUNIFORMSCALING = !1, this.PREMULTIPLYALPHA = !1, this.ALPHATEST_AFTERALLALPHACOMPUTATIONS = !1, this.ALPHABLEND = !0, this.PREPASS = !1, this.PREPASS_IRRADIANCE = !1, this.PREPASS_IRRADIANCE_INDEX = -1, this.PREPASS_ALBEDO_SQRT = !1, this.PREPASS_ALBEDO_SQRT_INDEX = -1, this.PREPASS_DEPTH = !1, this.PREPASS_DEPTH_INDEX = -1, this.PREPASS_NORMAL = !1, this.PREPASS_NORMAL_INDEX = -1, this.PREPASS_POSITION = !1, this.PREPASS_POSITION_INDEX = -1, this.PREPASS_VELOCITY = !1, this.PREPASS_VELOCITY_INDEX = -1, this.PREPASS_REFLECTIVITY = !1, this.PREPASS_REFLECTIVITY_INDEX = -1, this.SCENE_MRT_COUNT = 0, this.RGBDLIGHTMAP = !1, this.RGBDREFLECTION = !1, this.RGBDREFRACTION = !1, this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.MULTIVIEW = !1, this.ORDER_INDEPENDENT_TRANSPARENCY = !1, this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = !1, this.CAMERA_ORTHOGRAPHIC = !1, this.CAMERA_PERSPECTIVE = !1, this.IS_REFLECTION_LINEAR = !1, this.IS_REFRACTION_LINEAR = !1, this.EXPOSURE = !1, this.rebuild();}setReflectionMode(modeToEnable) {const modes = ["REFLECTIONMAP_CUBIC", "REFLECTIONMAP_EXPLICIT", "REFLECTIONMAP_PLANAR", "REFLECTIONMAP_PROJECTION", "REFLECTIONMAP_PROJECTION", "REFLECTIONMAP_SKYBOX", "REFLECTIONMAP_SPHERICAL", "REFLECTIONMAP_EQUIRECTANGULAR", "REFLECTIONMAP_EQUIRECTANGULAR_FIXED", "REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"];for (const mode of modes) this[mode] = mode === modeToEnable;}}class StandardMaterial extends pushMaterial/* PushMaterial */.a {get imageProcessingConfiguration() {return this._imageProcessingConfiguration;}set imageProcessingConfiguration(value) {this._attachImageProcessingConfiguration(value), this._markAllSubMeshesAsTexturesDirty();}_attachImageProcessingConfiguration(configuration) {configuration === this._imageProcessingConfiguration || (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = configuration ? configuration : this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {this._markAllSubMeshesAsImageProcessingDirty();})));}get isPrePassCapable() {return !this.disableDepthWrite;}get cameraColorCurvesEnabled() {return this.imageProcessingConfiguration.colorCurvesEnabled;}set cameraColorCurvesEnabled(value) {this.imageProcessingConfiguration.colorCurvesEnabled = value;}get cameraColorGradingEnabled() {return this.imageProcessingConfiguration.colorGradingEnabled;}set cameraColorGradingEnabled(value) {this.imageProcessingConfiguration.colorGradingEnabled = value;}get cameraToneMappingEnabled() {return this._imageProcessingConfiguration.toneMappingEnabled;}set cameraToneMappingEnabled(value) {this._imageProcessingConfiguration.toneMappingEnabled = value;}get cameraExposure() {return this._imageProcessingConfiguration.exposure;}set cameraExposure(value) {this._imageProcessingConfiguration.exposure = value;}get cameraContrast() {return this._imageProcessingConfiguration.contrast;}set cameraContrast(value) {this._imageProcessingConfiguration.contrast = value;}get cameraColorGradingTexture() {return this._imageProcessingConfiguration.colorGradingTexture;}set cameraColorGradingTexture(value) {this._imageProcessingConfiguration.colorGradingTexture = value;}get cameraColorCurves() {return this._imageProcessingConfiguration.colorCurves;}set cameraColorCurves(value) {this._imageProcessingConfiguration.colorCurves = value;}get canRenderToMRT() {return !0;}constructor(name, scene) {super(name, scene), this._diffuseTexture = null, this._ambientTexture = null, this._opacityTexture = null, this._reflectionTexture = null, this._emissiveTexture = null, this._specularTexture = null, this._bumpTexture = null, this._lightmapTexture = null, this._refractionTexture = null, this.ambientColor = new math_color/* Color3 */.Wo(0, 0, 0), this.diffuseColor = new math_color/* Color3 */.Wo(1, 1, 1), this.specularColor = new math_color/* Color3 */.Wo(1, 1, 1), this.emissiveColor = new math_color/* Color3 */.Wo(0, 0, 0), this.specularPower = 64, this._useAlphaFromDiffuseTexture = !1, this._useEmissiveAsIllumination = !1, this._linkEmissiveWithDiffuse = !1, this._useSpecularOverAlpha = !1, this._useReflectionOverAlpha = !1, this._disableLighting = !1, this._useObjectSpaceNormalMap = !1, this._useParallax = !1, this._useParallaxOcclusion = !1, this.parallaxScaleBias = .05, this._roughness = 0, this.indexOfRefraction = .98, this.invertRefractionY = !0, this.alphaCutOff = .4, this._useLightmapAsShadowmap = !1, this._useReflectionFresnelFromSpecular = !1, this._useGlossinessFromSpecularMapAlpha = !1, this._maxSimultaneousLights = 4, this._invertNormalMapX = !1, this._invertNormalMapY = !1, this._twoSidedLighting = !1, this._renderTargets = new smartArray/* SmartArray */.t(16), this._worldViewProjectionMatrix = math_vector/* Matrix.Zero */.y3.Zero(), this._globalAmbientColor = new math_color/* Color3 */.Wo(0, 0, 0), this._cacheHasRenderTargetTextures = !1, this.detailMap = new material_detailMapConfiguration/* DetailMapConfiguration */.p(this), this._attachImageProcessingConfiguration(null), this.prePassConfiguration = new prePassConfiguration/* PrePassConfiguration */.o(), this.getRenderTargetTextures = () => (this._renderTargets.reset(), StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._renderTargets.push(this._reflectionTexture), StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget && this._renderTargets.push(this._refractionTexture), this._eventInfo.renderTargets = this._renderTargets, this._callbackPluginEventFillRenderTargetTextures(this._eventInfo), this._renderTargets);}get hasRenderTargetTextures() {return !!(StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) || !!(StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) || this._cacheHasRenderTargetTextures;}getClassName() {return "StandardMaterial";}get useLogarithmicDepth() {return this._useLogarithmicDepth;}set useLogarithmicDepth(value) {this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported, this._markAllSubMeshesAsMiscDirty();}needAlphaBlending() {return !this._disableAlphaBlending && (1 > this.alpha || null != this._opacityTexture || this._shouldUseAlphaFromDiffuseTexture() || this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled);}needAlphaTesting() {return !!this._forceAlphaTest || this._hasAlphaChannel() && (null == this._transparencyMode || this._transparencyMode === material/* Material.MATERIAL_ALPHATEST */.F.MATERIAL_ALPHATEST);}_shouldUseAlphaFromDiffuseTexture() {return null != this._diffuseTexture && this._diffuseTexture.hasAlpha && this._useAlphaFromDiffuseTexture && this._transparencyMode !== material/* Material.MATERIAL_OPAQUE */.F.MATERIAL_OPAQUE;}_hasAlphaChannel() {return null != this._diffuseTexture && this._diffuseTexture.hasAlpha || null != this._opacityTexture;}getAlphaTestTexture() {return this._diffuseTexture;}isReadyForSubMesh(mesh, subMesh, useInstances = !1) {if (this._uniformBufferLayoutBuilt || this.buildUniformLayout(), subMesh.effect && this.isFrozen && subMesh.effect._wasPreviouslyReady && subMesh.effect._wasPreviouslyUsingInstances === useInstances) return !0;subMesh.materialDefines || (this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.GetDefineNames */.S.GetDefineNames, this._eventInfo), subMesh.materialDefines = new StandardMaterialDefines(this._eventInfo.defineNames));const scene = this.getScene(),defines = subMesh.materialDefines;if (this._isReadyForSubMesh(subMesh)) return !0;const engine = scene.getEngine();defines._needNormals = materialHelper/* MaterialHelper.PrepareDefinesForLights */.G.PrepareDefinesForLights(scene, mesh, defines, !0, this._maxSimultaneousLights, this._disableLighting), materialHelper/* MaterialHelper.PrepareDefinesForMultiview */.G.PrepareDefinesForMultiview(scene, defines);const oit = this.needAlphaBlendingForMesh(mesh) && this.getScene().useOrderIndependentTransparency;if (materialHelper/* MaterialHelper.PrepareDefinesForPrePass */.G.PrepareDefinesForPrePass(scene, defines, this.canRenderToMRT && !oit), materialHelper/* MaterialHelper.PrepareDefinesForOIT */.G.PrepareDefinesForOIT(scene, defines, oit), defines._areTexturesDirty) {this._eventInfo.hasRenderTargetTextures = !1, this._callbackPluginEventHasRenderTargetTextures(this._eventInfo), this._cacheHasRenderTargetTextures = this._eventInfo.hasRenderTargetTextures, defines._needUVs = !1;for (let i = 1; 6 >= i; ++i) defines["MAINUV" + i] = !1;if (scene.texturesEnabled) {if (defines.DIFFUSEDIRECTUV = 0, defines.BUMPDIRECTUV = 0, defines.AMBIENTDIRECTUV = 0, defines.OPACITYDIRECTUV = 0, defines.EMISSIVEDIRECTUV = 0, defines.SPECULARDIRECTUV = 0, defines.LIGHTMAPDIRECTUV = 0, this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {if (!this._diffuseTexture.isReadyOrNotBlocking()) return !1;materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._diffuseTexture, defines, "DIFFUSE");} else defines.DIFFUSE = !1;if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) {if (!this._ambientTexture.isReadyOrNotBlocking()) return !1;materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._ambientTexture, defines, "AMBIENT");} else defines.AMBIENT = !1;if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) {if (!this._opacityTexture.isReadyOrNotBlocking()) return !1;materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._opacityTexture, defines, "OPACITY"), defines.OPACITYRGB = this._opacityTexture.getAlphaFromRGB;} else defines.OPACITY = !1;if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {if (!this._reflectionTexture.isReadyOrNotBlocking()) return !1;switch (defines._needNormals = !0, defines.REFLECTION = !0, defines.ROUGHNESS = 0 < this._roughness, defines.REFLECTIONOVERALPHA = this._useReflectionOverAlpha, defines.INVERTCUBICMAP = this._reflectionTexture.coordinatesMode === texture/* Texture.INVCUBIC_MODE */.x.INVCUBIC_MODE, defines.REFLECTIONMAP_3D = this._reflectionTexture.isCube, defines.REFLECTIONMAP_OPPOSITEZ = defines.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !this._reflectionTexture.invertZ : this._reflectionTexture.invertZ, defines.RGBDREFLECTION = this._reflectionTexture.isRGBD, this._reflectionTexture.coordinatesMode) {case texture/* Texture.EXPLICIT_MODE */.x.EXPLICIT_MODE:defines.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case texture/* Texture.PLANAR_MODE */.x.PLANAR_MODE:defines.setReflectionMode("REFLECTIONMAP_PLANAR");break;case texture/* Texture.PROJECTION_MODE */.x.PROJECTION_MODE:defines.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case texture/* Texture.SKYBOX_MODE */.x.SKYBOX_MODE:defines.setReflectionMode("REFLECTIONMAP_SKYBOX");break;case texture/* Texture.SPHERICAL_MODE */.x.SPHERICAL_MODE:defines.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case texture/* Texture.EQUIRECTANGULAR_MODE */.x.EQUIRECTANGULAR_MODE:defines.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case texture/* Texture.FIXED_EQUIRECTANGULAR_MODE */.x.FIXED_EQUIRECTANGULAR_MODE:defines.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case texture/* Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE */.x.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:defines.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case texture/* Texture.CUBIC_MODE */.x.CUBIC_MODE:case texture/* Texture.INVCUBIC_MODE */.x.INVCUBIC_MODE:default:defines.setReflectionMode("REFLECTIONMAP_CUBIC");}defines.USE_LOCAL_REFLECTIONMAP_CUBIC = !!this._reflectionTexture.boundingBoxSize;} else defines.REFLECTION = !1, defines.REFLECTIONMAP_OPPOSITEZ = !1;if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) {if (!this._emissiveTexture.isReadyOrNotBlocking()) return !1;materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._emissiveTexture, defines, "EMISSIVE");} else defines.EMISSIVE = !1;if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) {if (!this._lightmapTexture.isReadyOrNotBlocking()) return !1;materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._lightmapTexture, defines, "LIGHTMAP"), defines.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap, defines.RGBDLIGHTMAP = this._lightmapTexture.isRGBD;} else defines.LIGHTMAP = !1;if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) {if (!this._specularTexture.isReadyOrNotBlocking()) return !1;materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._specularTexture, defines, "SPECULAR"), defines.GLOSSINESS = this._useGlossinessFromSpecularMapAlpha;} else defines.SPECULAR = !1;if (scene.getEngine().getCaps().standardDerivatives && this._bumpTexture && StandardMaterial.BumpTextureEnabled) {if (!this._bumpTexture.isReady()) return !1;materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._bumpTexture, defines, "BUMP"), defines.PARALLAX = this._useParallax, defines.PARALLAXOCCLUSION = this._useParallaxOcclusion, defines.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap;} else defines.BUMP = !1, defines.PARALLAX = !1, defines.PARALLAXOCCLUSION = !1;if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {if (!this._refractionTexture.isReadyOrNotBlocking()) return !1;defines._needUVs = !0, defines.REFRACTION = !0, defines.REFRACTIONMAP_3D = this._refractionTexture.isCube, defines.RGBDREFRACTION = this._refractionTexture.isRGBD, defines.USE_LOCAL_REFRACTIONMAP_CUBIC = !!this._refractionTexture.boundingBoxSize;} else defines.REFRACTION = !1;defines.TWOSIDEDLIGHTING = !this._backFaceCulling && this._twoSidedLighting;} else defines.DIFFUSE = !1, defines.AMBIENT = !1, defines.OPACITY = !1, defines.REFLECTION = !1, defines.EMISSIVE = !1, defines.LIGHTMAP = !1, defines.BUMP = !1, defines.REFRACTION = !1;defines.ALPHAFROMDIFFUSE = this._shouldUseAlphaFromDiffuseTexture(), defines.EMISSIVEASILLUMINATION = this._useEmissiveAsIllumination, defines.LINKEMISSIVEWITHDIFFUSE = this._linkEmissiveWithDiffuse, defines.SPECULAROVERALPHA = this._useSpecularOverAlpha, defines.PREMULTIPLYALPHA = 7 === this.alphaMode || 8 === this.alphaMode, defines.ALPHATEST_AFTERALLALPHACOMPUTATIONS = null !== this.transparencyMode, defines.ALPHABLEND = null === this.transparencyMode || this.needAlphaBlendingForMesh(mesh);}if (this._eventInfo.isReadyForSubMesh = !0, this._eventInfo.defines = defines, this._callbackPluginEventIsReadyForSubMesh(this._eventInfo), !this._eventInfo.isReadyForSubMesh) return !1;if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {if (!this._imageProcessingConfiguration.isReady()) return !1;this._imageProcessingConfiguration.prepareDefines(defines), defines.IS_REFLECTION_LINEAR = null != this.reflectionTexture && !this.reflectionTexture.gammaSpace, defines.IS_REFRACTION_LINEAR = null != this.refractionTexture && !this.refractionTexture.gammaSpace;}defines._areFresnelDirty && (StandardMaterial.FresnelEnabled ? (this._diffuseFresnelParameters || this._opacityFresnelParameters || this._emissiveFresnelParameters || this._refractionFresnelParameters || this._reflectionFresnelParameters) && (defines.DIFFUSEFRESNEL = this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled, defines.OPACITYFRESNEL = this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled, defines.REFLECTIONFRESNEL = this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled, defines.REFLECTIONFRESNELFROMSPECULAR = this._useReflectionFresnelFromSpecular, defines.REFRACTIONFRESNEL = this._refractionFresnelParameters && this._refractionFresnelParameters.isEnabled, defines.EMISSIVEFRESNEL = this._emissiveFresnelParameters && this._emissiveFresnelParameters.isEnabled, defines._needNormals = !0, defines.FRESNEL = !0) : defines.FRESNEL = !1), materialHelper/* MaterialHelper.PrepareDefinesForMisc */.G.PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh) || this._forceAlphaTest, defines), materialHelper/* MaterialHelper.PrepareDefinesForFrameBoundValues */.G.PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances, null, subMesh.getRenderingMesh().hasThinInstances), this._eventInfo.defines = defines, this._eventInfo.mesh = mesh, this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo), materialHelper/* MaterialHelper.PrepareDefinesForAttributes */.G.PrepareDefinesForAttributes(mesh, defines, !0, !0, !0), this._callbackPluginEventPrepareDefines(this._eventInfo);let forceWasNotReadyPreviously = !1;if (defines.isDirty) {const lightDisposed = defines._areLightsDisposed;defines.markAsProcessed();const fallbacks = new effectFallbacks/* EffectFallbacks */.L();defines.REFLECTION && fallbacks.addFallback(0, "REFLECTION"), defines.SPECULAR && fallbacks.addFallback(0, "SPECULAR"), defines.BUMP && fallbacks.addFallback(0, "BUMP"), defines.PARALLAX && fallbacks.addFallback(1, "PARALLAX"), defines.PARALLAXOCCLUSION && fallbacks.addFallback(0, "PARALLAXOCCLUSION"), defines.SPECULAROVERALPHA && fallbacks.addFallback(0, "SPECULAROVERALPHA"), defines.FOG && fallbacks.addFallback(1, "FOG"), defines.POINTSIZE && fallbacks.addFallback(0, "POINTSIZE"), defines.LOGARITHMICDEPTH && fallbacks.addFallback(0, "LOGARITHMICDEPTH"), materialHelper/* MaterialHelper.HandleFallbacksForShadows */.G.HandleFallbacksForShadows(defines, fallbacks, this._maxSimultaneousLights), defines.SPECULARTERM && fallbacks.addFallback(0, "SPECULARTERM"), defines.DIFFUSEFRESNEL && fallbacks.addFallback(1, "DIFFUSEFRESNEL"), defines.OPACITYFRESNEL && fallbacks.addFallback(2, "OPACITYFRESNEL"), defines.REFLECTIONFRESNEL && fallbacks.addFallback(3, "REFLECTIONFRESNEL"), defines.EMISSIVEFRESNEL && fallbacks.addFallback(4, "EMISSIVEFRESNEL"), defines.FRESNEL && fallbacks.addFallback(4, "FRESNEL"), defines.MULTIVIEW && fallbacks.addFallback(0, "MULTIVIEW");const attribs = [buffer/* VertexBuffer.PositionKind */.o.PositionKind];defines.NORMAL && attribs.push(buffer/* VertexBuffer.NormalKind */.o.NormalKind), defines.TANGENT && attribs.push(buffer/* VertexBuffer.TangentKind */.o.TangentKind);for (let i = 1; 6 >= i; ++i) defines["UV" + i] && attribs.push(`uv${1 === i ? "" : i}`);defines.VERTEXCOLOR && attribs.push(buffer/* VertexBuffer.ColorKind */.o.ColorKind), materialHelper/* MaterialHelper.PrepareAttributesForBones */.G.PrepareAttributesForBones(attribs, mesh, defines, fallbacks), materialHelper/* MaterialHelper.PrepareAttributesForInstances */.G.PrepareAttributesForInstances(attribs, defines), materialHelper/* MaterialHelper.PrepareAttributesForMorphTargets */.G.PrepareAttributesForMorphTargets(attribs, mesh, defines), materialHelper/* MaterialHelper.PrepareAttributesForBakedVertexAnimation */.G.PrepareAttributesForBakedVertexAnimation(attribs, mesh, defines);let shaderName = "default";const uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vDiffuseColor", "vSpecularColor", "vEmissiveColor", "visibility", "vFogInfos", "vFogColor", "pointSize", "vDiffuseInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vEmissiveInfos", "vSpecularInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos", "mBones", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix", "normalMatrix", "lightmapMatrix", "refractionMatrix", "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor", "refractionLeftColor", "refractionRightColor", "vReflectionPosition", "vReflectionSize", "vRefractionPosition", "vRefractionSize", "logarithmicDepthConstant", "vTangentSpaceParams", "alphaCutOff", "boneTextureWidth", "morphTargetTextureInfo", "morphTargetTextureIndices"],samplers = ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler", "refractionCubeSampler", "refraction2DSampler", "boneSampler", "morphTargets", "oitDepthSampler", "oitFrontColorSampler"],uniformBuffers = ["Material", "Scene", "Mesh"];this._eventInfo.fallbacks = fallbacks, this._eventInfo.fallbackRank = 0, this._eventInfo.defines = defines, this._eventInfo.uniforms = uniforms, this._eventInfo.attributes = attribs, this._eventInfo.samplers = samplers, this._eventInfo.uniformBuffersNames = uniformBuffers, this._eventInfo.customCode = void 0, this._eventInfo.mesh = mesh, this._callbackPluginEventGeneric(materialPluginEvent/* MaterialPluginEvent.PrepareEffect */.S.PrepareEffect, this._eventInfo), prePassConfiguration/* PrePassConfiguration.AddUniforms */.o.AddUniforms(uniforms), prePassConfiguration/* PrePassConfiguration.AddSamplers */.o.AddSamplers(samplers), imageProcessingConfiguration/* ImageProcessingConfiguration */.$ && (imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareUniforms */.$.PrepareUniforms(uniforms, defines), imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareSamplers */.$.PrepareSamplers(samplers, defines)), materialHelper/* MaterialHelper.PrepareUniformsAndSamplersList */.G.PrepareUniformsAndSamplersList({ uniformsNames: uniforms, uniformBuffersNames: uniformBuffers, samplers: samplers, defines: defines, maxSimultaneousLights: this._maxSimultaneousLights }), (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(uniforms);const csnrOptions = {};this.customShaderNameResolve && (shaderName = this.customShaderNameResolve(shaderName, uniforms, uniformBuffers, samplers, defines, attribs, csnrOptions));const join = defines.toString(),previousEffect = subMesh.effect;let effect = scene.getEngine().createEffect(shaderName, { attributes: attribs, uniformsNames: uniforms, uniformBuffersNames: uniformBuffers, samplers: samplers, defines: join, fallbacks: fallbacks, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS }, processFinalCode: csnrOptions.processFinalCode, processCodeAfterIncludes: this._eventInfo.customCode, multiTarget: defines.PREPASS }, engine);if (this._eventInfo.customCode = void 0, effect) if (this._onEffectCreatedObservable && (onCreatedEffectParameters.effect = effect, onCreatedEffectParameters.subMesh = subMesh, this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters)), !(this.allowShaderHotSwapping && previousEffect && !effect.isReady())) scene.resetCachedMaterial(), subMesh.setEffect(effect, defines, this._materialContext);else if (effect = previousEffect, defines.markAsUnprocessed(), forceWasNotReadyPreviously = this.isFrozen, lightDisposed) return defines._areLightsDisposed = !0, !1;}return !!(subMesh.effect && subMesh.effect.isReady()) && (defines._renderId = scene.getRenderId(), subMesh.effect._wasPreviouslyReady = !forceWasNotReadyPreviously, subMesh.effect._wasPreviouslyUsingInstances = useInstances, scene.performancePriority !== core_scene/* ScenePerformancePriority.BackwardCompatible */.a.BackwardCompatible && (this.checkReadyOnlyOnce = !0), !0);}buildUniformLayout() {const ubo = this._uniformBuffer;ubo.addUniform("diffuseLeftColor", 4), ubo.addUniform("diffuseRightColor", 4), ubo.addUniform("opacityParts", 4), ubo.addUniform("reflectionLeftColor", 4), ubo.addUniform("reflectionRightColor", 4), ubo.addUniform("refractionLeftColor", 4), ubo.addUniform("refractionRightColor", 4), ubo.addUniform("emissiveLeftColor", 4), ubo.addUniform("emissiveRightColor", 4), ubo.addUniform("vDiffuseInfos", 2), ubo.addUniform("vAmbientInfos", 2), ubo.addUniform("vOpacityInfos", 2), ubo.addUniform("vReflectionInfos", 2), ubo.addUniform("vReflectionPosition", 3), ubo.addUniform("vReflectionSize", 3), ubo.addUniform("vEmissiveInfos", 2), ubo.addUniform("vLightmapInfos", 2), ubo.addUniform("vSpecularInfos", 2), ubo.addUniform("vBumpInfos", 3), ubo.addUniform("diffuseMatrix", 16), ubo.addUniform("ambientMatrix", 16), ubo.addUniform("opacityMatrix", 16), ubo.addUniform("reflectionMatrix", 16), ubo.addUniform("emissiveMatrix", 16), ubo.addUniform("lightmapMatrix", 16), ubo.addUniform("specularMatrix", 16), ubo.addUniform("bumpMatrix", 16), ubo.addUniform("vTangentSpaceParams", 2), ubo.addUniform("pointSize", 1), ubo.addUniform("alphaCutOff", 1), ubo.addUniform("refractionMatrix", 16), ubo.addUniform("vRefractionInfos", 4), ubo.addUniform("vRefractionPosition", 3), ubo.addUniform("vRefractionSize", 3), ubo.addUniform("vSpecularColor", 4), ubo.addUniform("vEmissiveColor", 3), ubo.addUniform("vDiffuseColor", 4), ubo.addUniform("vAmbientColor", 3), super.buildUniformLayout();}bindForSubMesh(world, mesh, subMesh) {var _a;const scene = this.getScene(),defines = subMesh.materialDefines;if (defines) {const effect = subMesh.effect;if (effect) {this._activeEffect = effect, mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh"), mesh.transferToEffect(world), this._uniformBuffer.bindToEffect(effect, "Material"), this.prePassConfiguration.bindForSubMesh(this._activeEffect, scene, mesh, world, this.isFrozen), this._eventInfo.subMesh = subMesh, this._callbackPluginEventHardBindForSubMesh(this._eventInfo), defines.OBJECTSPACE_NORMALMAP && (world.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));const mustRebind = effect._forceRebindOnNextCall || this._mustRebind(scene, effect, mesh.visibility);materialHelper/* MaterialHelper.BindBonesParameters */.G.BindBonesParameters(mesh, effect);const ubo = this._uniformBuffer;if (mustRebind) {if (this.bindViewProjection(effect), !ubo.useUbo || !this.isFrozen || !ubo.isSync || effect._forceRebindOnNextCall) {if (StandardMaterial.FresnelEnabled && defines.FRESNEL && (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled && (ubo.updateColor4("diffuseLeftColor", this.diffuseFresnelParameters.leftColor, this.diffuseFresnelParameters.power), ubo.updateColor4("diffuseRightColor", this.diffuseFresnelParameters.rightColor, this.diffuseFresnelParameters.bias)), this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled && ubo.updateColor4("opacityParts", new math_color/* Color3 */.Wo(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power), this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled && (ubo.updateColor4("reflectionLeftColor", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power), ubo.updateColor4("reflectionRightColor", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias)), this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled && (ubo.updateColor4("refractionLeftColor", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power), ubo.updateColor4("refractionRightColor", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias)), this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled && (ubo.updateColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power), ubo.updateColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias))), scene.texturesEnabled) {if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled && (ubo.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._diffuseTexture, ubo, "diffuse")), this._ambientTexture && StandardMaterial.AmbientTextureEnabled && (ubo.updateFloat2("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._ambientTexture, ubo, "ambient")), this._opacityTexture && StandardMaterial.OpacityTextureEnabled && (ubo.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._opacityTexture, ubo, "opacity")), this._hasAlphaChannel() && ubo.updateFloat("alphaCutOff", this.alphaCutOff), this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled && (ubo.updateFloat2("vReflectionInfos", this._reflectionTexture.level, this.roughness), ubo.updateMatrix("reflectionMatrix", this._reflectionTexture.getReflectionTextureMatrix()), this._reflectionTexture.boundingBoxSize)) {const cubeTexture = this._reflectionTexture;ubo.updateVector3("vReflectionPosition", cubeTexture.boundingBoxPosition), ubo.updateVector3("vReflectionSize", cubeTexture.boundingBoxSize);}if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled && (ubo.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._emissiveTexture, ubo, "emissive")), this._lightmapTexture && StandardMaterial.LightmapTextureEnabled && (ubo.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._lightmapTexture, ubo, "lightmap")), this._specularTexture && StandardMaterial.SpecularTextureEnabled && (ubo.updateFloat2("vSpecularInfos", this._specularTexture.coordinatesIndex, this._specularTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._specularTexture, ubo, "specular")), this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled && (ubo.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, 1 / this._bumpTexture.level, this.parallaxScaleBias), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._bumpTexture, ubo, "bump"), scene._mirroredCameraPosition ? ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1)), this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {let depth = 1;if (this._refractionTexture.isCube || (ubo.updateMatrix("refractionMatrix", this._refractionTexture.getReflectionTextureMatrix()), this._refractionTexture.depth && (depth = this._refractionTexture.depth)), ubo.updateFloat4("vRefractionInfos", this._refractionTexture.level, this.indexOfRefraction, depth, this.invertRefractionY ? -1 : 1), this._refractionTexture.boundingBoxSize) {const cubeTexture = this._refractionTexture;ubo.updateVector3("vRefractionPosition", cubeTexture.boundingBoxPosition), ubo.updateVector3("vRefractionSize", cubeTexture.boundingBoxSize);}}}this.pointsCloud && ubo.updateFloat("pointSize", this.pointSize), defines.SPECULARTERM && ubo.updateColor4("vSpecularColor", this.specularColor, this.specularPower), ubo.updateColor3("vEmissiveColor", StandardMaterial.EmissiveTextureEnabled ? this.emissiveColor : math_color/* Color3.BlackReadOnly */.Wo.BlackReadOnly), ubo.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha), scene.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor), ubo.updateColor3("vAmbientColor", this._globalAmbientColor);}scene.texturesEnabled && (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled && effect.setTexture("diffuseSampler", this._diffuseTexture), this._ambientTexture && StandardMaterial.AmbientTextureEnabled && effect.setTexture("ambientSampler", this._ambientTexture), this._opacityTexture && StandardMaterial.OpacityTextureEnabled && effect.setTexture("opacitySampler", this._opacityTexture), this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled && (this._reflectionTexture.isCube ? effect.setTexture("reflectionCubeSampler", this._reflectionTexture) : effect.setTexture("reflection2DSampler", this._reflectionTexture)), this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled && effect.setTexture("emissiveSampler", this._emissiveTexture), this._lightmapTexture && StandardMaterial.LightmapTextureEnabled && effect.setTexture("lightmapSampler", this._lightmapTexture), this._specularTexture && StandardMaterial.SpecularTextureEnabled && effect.setTexture("specularSampler", this._specularTexture), this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled && effect.setTexture("bumpSampler", this._bumpTexture), this._refractionTexture && StandardMaterial.RefractionTextureEnabled && (this._refractionTexture.isCube ? effect.setTexture("refractionCubeSampler", this._refractionTexture) : effect.setTexture("refraction2DSampler", this._refractionTexture))), this.getScene().useOrderIndependentTransparency && this.needAlphaBlendingForMesh(mesh) && this.getScene().depthPeelingRenderer.bind(effect), this._eventInfo.subMesh = subMesh, this._callbackPluginEventBindForSubMesh(this._eventInfo), (0,clipPlaneMaterialHelper/* bindClipPlane */.an)(effect, this, scene), this.bindEyePosition(effect);} else scene.getEngine()._features.needToAlwaysBindUniformBuffers && (this._needToBindSceneUbo = !0);(mustRebind || !this.isFrozen) && (scene.lightsEnabled && !this._disableLighting && materialHelper/* MaterialHelper.BindLights */.G.BindLights(scene, mesh, effect, defines, this._maxSimultaneousLights), (scene.fogEnabled && mesh.applyFog && scene.fogMode !== core_scene/* Scene.FOGMODE_NONE */.x.FOGMODE_NONE || this._reflectionTexture || this._refractionTexture || mesh.receiveShadows || defines.PREPASS) && this.bindView(effect), materialHelper/* MaterialHelper.BindFogParameters */.G.BindFogParameters(scene, mesh, effect), defines.NUM_MORPH_INFLUENCERS && materialHelper/* MaterialHelper.BindMorphTargetParameters */.G.BindMorphTargetParameters(mesh, effect), defines.BAKED_VERTEX_ANIMATION_TEXTURE && (null === (_a = mesh.bakedVertexAnimationManager) || void 0 === _a ? void 0 : _a.bind(effect, defines.INSTANCES)), this.useLogarithmicDepth && materialHelper/* MaterialHelper.BindLogDepth */.G.BindLogDepth(defines, effect, scene), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(this._activeEffect)), this._afterBind(mesh, this._activeEffect), ubo.update();}}}getAnimatables() {const results = super.getAnimatables();return this._diffuseTexture && this._diffuseTexture.animations && 0 < this._diffuseTexture.animations.length && results.push(this._diffuseTexture), this._ambientTexture && this._ambientTexture.animations && 0 < this._ambientTexture.animations.length && results.push(this._ambientTexture), this._opacityTexture && this._opacityTexture.animations && 0 < this._opacityTexture.animations.length && results.push(this._opacityTexture), this._reflectionTexture && this._reflectionTexture.animations && 0 < this._reflectionTexture.animations.length && results.push(this._reflectionTexture), this._emissiveTexture && this._emissiveTexture.animations && 0 < this._emissiveTexture.animations.length && results.push(this._emissiveTexture), this._specularTexture && this._specularTexture.animations && 0 < this._specularTexture.animations.length && results.push(this._specularTexture), this._bumpTexture && this._bumpTexture.animations && 0 < this._bumpTexture.animations.length && results.push(this._bumpTexture), this._lightmapTexture && this._lightmapTexture.animations && 0 < this._lightmapTexture.animations.length && results.push(this._lightmapTexture), this._refractionTexture && this._refractionTexture.animations && 0 < this._refractionTexture.animations.length && results.push(this._refractionTexture), results;}getActiveTextures() {const activeTextures = super.getActiveTextures();return this._diffuseTexture && activeTextures.push(this._diffuseTexture), this._ambientTexture && activeTextures.push(this._ambientTexture), this._opacityTexture && activeTextures.push(this._opacityTexture), this._reflectionTexture && activeTextures.push(this._reflectionTexture), this._emissiveTexture && activeTextures.push(this._emissiveTexture), this._specularTexture && activeTextures.push(this._specularTexture), this._bumpTexture && activeTextures.push(this._bumpTexture), this._lightmapTexture && activeTextures.push(this._lightmapTexture), this._refractionTexture && activeTextures.push(this._refractionTexture), activeTextures;}hasTexture(texture) {return !!super.hasTexture(texture) || !(this._diffuseTexture !== texture) || !(this._ambientTexture !== texture) || !(this._opacityTexture !== texture) || !(this._reflectionTexture !== texture) || !(this._emissiveTexture !== texture) || !(this._specularTexture !== texture) || !(this._bumpTexture !== texture) || !(this._lightmapTexture !== texture) || !(this._refractionTexture !== texture);}dispose(forceDisposeEffect, forceDisposeTextures) {var _a, _b, _c, _d, _e, _f, _g, _h, _j;forceDisposeTextures && (null === (_a = this._diffuseTexture) || void 0 === _a ? void 0 : _a.dispose(), null === (_b = this._ambientTexture) || void 0 === _b ? void 0 : _b.dispose(), null === (_c = this._opacityTexture) || void 0 === _c ? void 0 : _c.dispose(), null === (_d = this._reflectionTexture) || void 0 === _d ? void 0 : _d.dispose(), null === (_e = this._emissiveTexture) || void 0 === _e ? void 0 : _e.dispose(), null === (_f = this._specularTexture) || void 0 === _f ? void 0 : _f.dispose(), null === (_g = this._bumpTexture) || void 0 === _g ? void 0 : _g.dispose(), null === (_h = this._lightmapTexture) || void 0 === _h ? void 0 : _h.dispose(), null === (_j = this._refractionTexture) || void 0 === _j ? void 0 : _j.dispose()), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), super.dispose(forceDisposeEffect, forceDisposeTextures);}clone(name) {const result = decorators/* SerializationHelper.Clone */.p4.Clone(() => new StandardMaterial(name, this.getScene()), this);return result.name = name, result.id = name, this.stencil.copyTo(result.stencil), result;}static Parse(source, scene, rootUrl) {const material = decorators/* SerializationHelper.Parse */.p4.Parse(() => new StandardMaterial(source.name, scene), source, scene, rootUrl);return source.stencil && material.stencil.parse(source.stencil, scene, rootUrl), material;}static get DiffuseTextureEnabled() {return materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled;}static set DiffuseTextureEnabled(value) {materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled = value;}static get DetailTextureEnabled() {return materialFlags/* MaterialFlags.DetailTextureEnabled */.k.DetailTextureEnabled;}static set DetailTextureEnabled(value) {materialFlags/* MaterialFlags.DetailTextureEnabled */.k.DetailTextureEnabled = value;}static get AmbientTextureEnabled() {return materialFlags/* MaterialFlags.AmbientTextureEnabled */.k.AmbientTextureEnabled;}static set AmbientTextureEnabled(value) {materialFlags/* MaterialFlags.AmbientTextureEnabled */.k.AmbientTextureEnabled = value;}static get OpacityTextureEnabled() {return materialFlags/* MaterialFlags.OpacityTextureEnabled */.k.OpacityTextureEnabled;}static set OpacityTextureEnabled(value) {materialFlags/* MaterialFlags.OpacityTextureEnabled */.k.OpacityTextureEnabled = value;}static get ReflectionTextureEnabled() {return materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled;}static set ReflectionTextureEnabled(value) {materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled = value;}static get EmissiveTextureEnabled() {return materialFlags/* MaterialFlags.EmissiveTextureEnabled */.k.EmissiveTextureEnabled;}static set EmissiveTextureEnabled(value) {materialFlags/* MaterialFlags.EmissiveTextureEnabled */.k.EmissiveTextureEnabled = value;}static get SpecularTextureEnabled() {return materialFlags/* MaterialFlags.SpecularTextureEnabled */.k.SpecularTextureEnabled;}static set SpecularTextureEnabled(value) {materialFlags/* MaterialFlags.SpecularTextureEnabled */.k.SpecularTextureEnabled = value;}static get BumpTextureEnabled() {return materialFlags/* MaterialFlags.BumpTextureEnabled */.k.BumpTextureEnabled;}static set BumpTextureEnabled(value) {materialFlags/* MaterialFlags.BumpTextureEnabled */.k.BumpTextureEnabled = value;}static get LightmapTextureEnabled() {return materialFlags/* MaterialFlags.LightmapTextureEnabled */.k.LightmapTextureEnabled;}static set LightmapTextureEnabled(value) {materialFlags/* MaterialFlags.LightmapTextureEnabled */.k.LightmapTextureEnabled = value;}static get RefractionTextureEnabled() {return materialFlags/* MaterialFlags.RefractionTextureEnabled */.k.RefractionTextureEnabled;}static set RefractionTextureEnabled(value) {materialFlags/* MaterialFlags.RefractionTextureEnabled */.k.RefractionTextureEnabled = value;}static get ColorGradingTextureEnabled() {return materialFlags/* MaterialFlags.ColorGradingTextureEnabled */.k.ColorGradingTextureEnabled;}static set ColorGradingTextureEnabled(value) {materialFlags/* MaterialFlags.ColorGradingTextureEnabled */.k.ColorGradingTextureEnabled = value;}static get FresnelEnabled() {return materialFlags/* MaterialFlags.FresnelEnabled */.k.FresnelEnabled;}static set FresnelEnabled(value) {materialFlags/* MaterialFlags.FresnelEnabled */.k.FresnelEnabled = value;}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("diffuseTexture")], StandardMaterial.prototype, "_diffuseTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesAndMiscDirty")], StandardMaterial.prototype, "diffuseTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("ambientTexture")], StandardMaterial.prototype, "_ambientTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "ambientTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("opacityTexture")], StandardMaterial.prototype, "_opacityTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesAndMiscDirty")], StandardMaterial.prototype, "opacityTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("reflectionTexture")], StandardMaterial.prototype, "_reflectionTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "reflectionTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("emissiveTexture")], StandardMaterial.prototype, "_emissiveTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "emissiveTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("specularTexture")], StandardMaterial.prototype, "_specularTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "specularTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("bumpTexture")], StandardMaterial.prototype, "_bumpTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "bumpTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("lightmapTexture")], StandardMaterial.prototype, "_lightmapTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "lightmapTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("refractionTexture")], StandardMaterial.prototype, "_refractionTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "refractionTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)("ambient")], StandardMaterial.prototype, "ambientColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)("diffuse")], StandardMaterial.prototype, "diffuseColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)("specular")], StandardMaterial.prototype, "specularColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)("emissive")], StandardMaterial.prototype, "emissiveColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardMaterial.prototype, "specularPower", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useAlphaFromDiffuseTexture")], StandardMaterial.prototype, "_useAlphaFromDiffuseTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesAndMiscDirty")], StandardMaterial.prototype, "useAlphaFromDiffuseTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useEmissiveAsIllumination")], StandardMaterial.prototype, "_useEmissiveAsIllumination", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "useEmissiveAsIllumination", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("linkEmissiveWithDiffuse")], StandardMaterial.prototype, "_linkEmissiveWithDiffuse", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "linkEmissiveWithDiffuse", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useSpecularOverAlpha")], StandardMaterial.prototype, "_useSpecularOverAlpha", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "useSpecularOverAlpha", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useReflectionOverAlpha")], StandardMaterial.prototype, "_useReflectionOverAlpha", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "useReflectionOverAlpha", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("disableLighting")], StandardMaterial.prototype, "_disableLighting", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsLightsDirty")], StandardMaterial.prototype, "disableLighting", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useObjectSpaceNormalMap")], StandardMaterial.prototype, "_useObjectSpaceNormalMap", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "useObjectSpaceNormalMap", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useParallax")], StandardMaterial.prototype, "_useParallax", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "useParallax", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useParallaxOcclusion")], StandardMaterial.prototype, "_useParallaxOcclusion", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "useParallaxOcclusion", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardMaterial.prototype, "parallaxScaleBias", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("roughness")], StandardMaterial.prototype, "_roughness", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "roughness", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardMaterial.prototype, "indexOfRefraction", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardMaterial.prototype, "invertRefractionY", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardMaterial.prototype, "alphaCutOff", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useLightmapAsShadowmap")], StandardMaterial.prototype, "_useLightmapAsShadowmap", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "useLightmapAsShadowmap", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsFresnelParameters */.qQ)("diffuseFresnelParameters")], StandardMaterial.prototype, "_diffuseFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsFresnelDirty")], StandardMaterial.prototype, "diffuseFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsFresnelParameters */.qQ)("opacityFresnelParameters")], StandardMaterial.prototype, "_opacityFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsFresnelAndMiscDirty")], StandardMaterial.prototype, "opacityFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsFresnelParameters */.qQ)("reflectionFresnelParameters")], StandardMaterial.prototype, "_reflectionFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsFresnelDirty")], StandardMaterial.prototype, "reflectionFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsFresnelParameters */.qQ)("refractionFresnelParameters")], StandardMaterial.prototype, "_refractionFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsFresnelDirty")], StandardMaterial.prototype, "refractionFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsFresnelParameters */.qQ)("emissiveFresnelParameters")], StandardMaterial.prototype, "_emissiveFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsFresnelDirty")], StandardMaterial.prototype, "emissiveFresnelParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useReflectionFresnelFromSpecular")], StandardMaterial.prototype, "_useReflectionFresnelFromSpecular", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsFresnelDirty")], StandardMaterial.prototype, "useReflectionFresnelFromSpecular", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("useGlossinessFromSpecularMapAlpha")], StandardMaterial.prototype, "_useGlossinessFromSpecularMapAlpha", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "useGlossinessFromSpecularMapAlpha", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("maxSimultaneousLights")], StandardMaterial.prototype, "_maxSimultaneousLights", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsLightsDirty")], StandardMaterial.prototype, "maxSimultaneousLights", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("invertNormalMapX")], StandardMaterial.prototype, "_invertNormalMapX", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "invertNormalMapX", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("invertNormalMapY")], StandardMaterial.prototype, "_invertNormalMapY", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "invertNormalMapY", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("twoSidedLighting")], StandardMaterial.prototype, "_twoSidedLighting", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], StandardMaterial.prototype, "twoSidedLighting", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardMaterial.prototype, "useLogarithmicDepth", null), (0,typeStore/* RegisterClass */.H)("BABYLON.StandardMaterial", StandardMaterial), core_scene/* Scene.DefaultMaterialFactory */.x.DefaultMaterialFactory = (scene) => new StandardMaterial("default material", scene);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Materials/uniformBuffer.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "M": () => (/* binding */ UniformBuffer)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Engines_Extensions_engine_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.uniformBuffer.js");
class UniformBuffer {constructor(engine, data, dynamic, name, forceNoUniformBuffer = !1) {this._valueCache = {}, this._engine = engine, this._noUBO = !engine.supportsUniformBuffers || forceNoUniformBuffer, this._dynamic = dynamic, this._name = null !== name && void 0 !== name ? name : "no-name", this._data = data || [], this._uniformLocations = {}, this._uniformSizes = {}, this._uniformArraySizes = {}, this._uniformLocationPointer = 0, this._needSync = !1, this._engine._features.trackUbosInFrame && (this._buffers = [], this._bufferIndex = -1, this._createBufferOnWrite = !1, this._currentFrameId = 0), this._noUBO ? (this.updateMatrix3x3 = this._updateMatrix3x3ForEffect, this.updateMatrix2x2 = this._updateMatrix2x2ForEffect, this.updateFloat = this._updateFloatForEffect, this.updateFloat2 = this._updateFloat2ForEffect, this.updateFloat3 = this._updateFloat3ForEffect, this.updateFloat4 = this._updateFloat4ForEffect, this.updateFloatArray = this._updateFloatArrayForEffect, this.updateArray = this._updateArrayForEffect, this.updateIntArray = this._updateIntArrayForEffect, this.updateUIntArray = this._updateUIntArrayForEffect, this.updateMatrix = this._updateMatrixForEffect, this.updateMatrices = this._updateMatricesForEffect, this.updateVector3 = this._updateVector3ForEffect, this.updateVector4 = this._updateVector4ForEffect, this.updateColor3 = this._updateColor3ForEffect, this.updateColor4 = this._updateColor4ForEffect, this.updateDirectColor4 = this._updateDirectColor4ForEffect, this.updateInt = this._updateIntForEffect, this.updateInt2 = this._updateInt2ForEffect, this.updateInt3 = this._updateInt3ForEffect, this.updateInt4 = this._updateInt4ForEffect, this.updateUInt = this._updateUIntForEffect, this.updateUInt2 = this._updateUInt2ForEffect, this.updateUInt3 = this._updateUInt3ForEffect, this.updateUInt4 = this._updateUInt4ForEffect) : (this._engine._uniformBuffers.push(this), this.updateMatrix3x3 = this._updateMatrix3x3ForUniform, this.updateMatrix2x2 = this._updateMatrix2x2ForUniform, this.updateFloat = this._updateFloatForUniform, this.updateFloat2 = this._updateFloat2ForUniform, this.updateFloat3 = this._updateFloat3ForUniform, this.updateFloat4 = this._updateFloat4ForUniform, this.updateFloatArray = this._updateFloatArrayForUniform, this.updateArray = this._updateArrayForUniform, this.updateIntArray = this._updateIntArrayForUniform, this.updateUIntArray = this._updateUIntArrayForUniform, this.updateMatrix = this._updateMatrixForUniform, this.updateMatrices = this._updateMatricesForUniform, this.updateVector3 = this._updateVector3ForUniform, this.updateVector4 = this._updateVector4ForUniform, this.updateColor3 = this._updateColor3ForUniform, this.updateColor4 = this._updateColor4ForUniform, this.updateDirectColor4 = this._updateDirectColor4ForUniform, this.updateInt = this._updateIntForUniform, this.updateInt2 = this._updateInt2ForUniform, this.updateInt3 = this._updateInt3ForUniform, this.updateInt4 = this._updateInt4ForUniform, this.updateUInt = this._updateUIntForUniform, this.updateUInt2 = this._updateUInt2ForUniform, this.updateUInt3 = this._updateUInt3ForUniform, this.updateUInt4 = this._updateUInt4ForUniform);}get useUbo() {return !this._noUBO;}get isSync() {return !this._needSync;}isDynamic() {return this._dynamic !== void 0;}getData() {return this._bufferData;}getBuffer() {return this._buffer;}_fillAlignment(size) {let alignment;if (alignment = 2 >= size ? size : 4, 0 != this._uniformLocationPointer % alignment) {const oldPointer = this._uniformLocationPointer;this._uniformLocationPointer += alignment - this._uniformLocationPointer % alignment;const diff = this._uniformLocationPointer - oldPointer;for (let i = 0; i < diff; i++) this._data.push(0);}}addUniform(name, size, arraySize = 0) {if (this._noUBO) return;if (void 0 !== this._uniformLocations[name]) return;let data;if (0 < arraySize) {if (size instanceof Array) throw "addUniform should not be use with Array in UBO: " + name;if (this._fillAlignment(4), this._uniformArraySizes[name] = { strideSize: size, arraySize }, 16 == size) size *= arraySize;else {const perElementPadding = 4 - size;size = size * arraySize + perElementPadding * arraySize;}data = [];for (let i = 0; i < size; i++) data.push(0);} else {if (size instanceof Array) data = size, size = data.length;else {size = size, data = [];for (let i = 0; i < size; i++) data.push(0);}this._fillAlignment(size);}this._uniformSizes[name] = size, this._uniformLocations[name] = this._uniformLocationPointer, this._uniformLocationPointer += size;for (let i = 0; i < size; i++) this._data.push(data[i]);this._needSync = !0;}addMatrix(name, mat) {this.addUniform(name, Array.prototype.slice.call(mat.toArray()));}addFloat2(name, x, y) {this.addUniform(name, [x, y]);}addFloat3(name, x, y, z) {this.addUniform(name, [x, y, z]);}addColor3(name, color) {const temp = [color.r, color.g, color.b];this.addUniform(name, temp);}addColor4(name, color, alpha) {const temp = [color.r, color.g, color.b, alpha];this.addUniform(name, temp);}addVector3(name, vector) {const temp = [vector.x, vector.y, vector.z];this.addUniform(name, temp);}addMatrix3x3(name) {this.addUniform(name, 12);}addMatrix2x2(name) {this.addUniform(name, 8);}create() {this._noUBO || this._buffer || (this._fillAlignment(4), this._bufferData = new Float32Array(this._data), this._rebuild(), this._needSync = !0);}_rebuild() {this._noUBO || !this._bufferData || (this._buffer = this._dynamic ? this._engine.createDynamicUniformBuffer(this._bufferData) : this._engine.createUniformBuffer(this._bufferData), this._engine._features.trackUbosInFrame && (this._buffers.push([this._buffer, this._engine._features.checkUbosContentBeforeUpload ? this._bufferData.slice() : void 0]), this._bufferIndex = this._buffers.length - 1, this._createBufferOnWrite = !1));}get _numBuffers() {return this._buffers.length;}get _indexBuffer() {return this._bufferIndex;}get name() {return this._name;}_buffersEqual(buf1, buf2) {for (let i = 0; i < buf1.length; ++i) if (buf1[i] !== buf2[i]) return !1;return !0;}_copyBuffer(src, dst) {for (let i = 0; i < src.length; ++i) dst[i] = src[i];}update() {if (!this._noUBO) {if (this.bindUniformBuffer(), !this._buffer) return void this.create();if (!this._dynamic && !this._needSync) return void (this._createBufferOnWrite = this._engine._features.trackUbosInFrame);if (this._buffers && 1 < this._buffers.length && this._buffers[this._bufferIndex][1]) {if (this._buffersEqual(this._bufferData, this._buffers[this._bufferIndex][1])) return this._needSync = !1, void (this._createBufferOnWrite = this._engine._features.trackUbosInFrame);this._copyBuffer(this._bufferData, this._buffers[this._bufferIndex][1]);}this._engine.updateUniformBuffer(this._buffer, this._bufferData), this._engine._features._collectUbosUpdatedInFrame && (!UniformBuffer._UpdatedUbosInFrame[this._name] && (UniformBuffer._UpdatedUbosInFrame[this._name] = 0), UniformBuffer._UpdatedUbosInFrame[this._name]++), this._needSync = !1, this._createBufferOnWrite = this._engine._features.trackUbosInFrame;}}_createNewBuffer() {this._bufferIndex + 1 < this._buffers.length ? (this._bufferIndex++, this._buffer = this._buffers[this._bufferIndex][0], this._createBufferOnWrite = !1, this._needSync = !0) : this._rebuild();}_checkNewFrame() {this._engine._features.trackUbosInFrame && this._currentFrameId !== this._engine.frameId && (this._currentFrameId = this._engine.frameId, this._createBufferOnWrite = !1, this._buffers && 0 < this._buffers.length ? (this._needSync = 0 !== this._bufferIndex, this._bufferIndex = 0, this._buffer = this._buffers[this._bufferIndex][0]) : this._bufferIndex = -1);}updateUniform(uniformName, data, size) {this._checkNewFrame();let location = this._uniformLocations[uniformName];if (void 0 === location) {if (this._buffer) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger.Error */ .Y.Error("Cannot add an uniform after UBO has been created.");this.addUniform(uniformName, size), location = this._uniformLocations[uniformName];}if (this._buffer || this.create(), !this._dynamic) {let changed = !1;for (let i = 0; i < size; i++) (16 !== size || this._engine._features.uniformBufferHardCheckMatrix) && this._bufferData[location + i] === _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools.FloatRound */ .w1.FloatRound(data[i]) || (changed = !0, this._createBufferOnWrite && this._createNewBuffer(), this._bufferData[location + i] = data[i]);this._needSync = this._needSync || changed;} else for (let i = 0; i < size; i++) this._bufferData[location + i] = data[i];}updateUniformArray(uniformName, data, size) {this._checkNewFrame();const location = this._uniformLocations[uniformName];if (void 0 === location) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger.Error */ .Y.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");this._buffer || this.create();const arraySizes = this._uniformArraySizes[uniformName];if (!this._dynamic) {let changed = !1,countToFour = 0,baseStride = 0;for (let i = 0; i < size; i++) if (this._bufferData[location + 4 * baseStride + countToFour] !== _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools.FloatRound */ .w1.FloatRound(data[i]) && (changed = !0, this._createBufferOnWrite && this._createNewBuffer(), this._bufferData[location + 4 * baseStride + countToFour] = data[i]), countToFour++, countToFour === arraySizes.strideSize) {for (; 4 > countToFour; countToFour++) this._bufferData[location + 4 * baseStride + countToFour] = 0;countToFour = 0, baseStride++;}this._needSync = this._needSync || changed;} else for (let i = 0; i < size; i++) this._bufferData[location + i] = data[i];}_cacheMatrix(name, matrix) {this._checkNewFrame();const cache = this._valueCache[name],flag = matrix.updateFlag;return (void 0 === cache || cache !== flag) && (this._valueCache[name] = flag, !0);}_updateMatrix3x3ForUniform(name, matrix) {for (let i = 0; 3 > i; i++) UniformBuffer._TempBuffer[4 * i] = matrix[3 * i], UniformBuffer._TempBuffer[4 * i + 1] = matrix[3 * i + 1], UniformBuffer._TempBuffer[4 * i + 2] = matrix[3 * i + 2], UniformBuffer._TempBuffer[4 * i + 3] = 0;this.updateUniform(name, UniformBuffer._TempBuffer, 12);}_updateMatrix3x3ForEffect(name, matrix) {this._currentEffect.setMatrix3x3(name, matrix);}_updateMatrix2x2ForEffect(name, matrix) {this._currentEffect.setMatrix2x2(name, matrix);}_updateMatrix2x2ForUniform(name, matrix) {for (let i = 0; 2 > i; i++) UniformBuffer._TempBuffer[4 * i] = matrix[2 * i], UniformBuffer._TempBuffer[4 * i + 1] = matrix[2 * i + 1], UniformBuffer._TempBuffer[4 * i + 2] = 0, UniformBuffer._TempBuffer[4 * i + 3] = 0;this.updateUniform(name, UniformBuffer._TempBuffer, 8);}_updateFloatForEffect(name, x) {this._currentEffect.setFloat(name, x);}_updateFloatForUniform(name, x) {UniformBuffer._TempBuffer[0] = x, this.updateUniform(name, UniformBuffer._TempBuffer, 1);}_updateFloat2ForEffect(name, x, y, suffix = "") {this._currentEffect.setFloat2(name + suffix, x, y);}_updateFloat2ForUniform(name, x, y) {UniformBuffer._TempBuffer[0] = x, UniformBuffer._TempBuffer[1] = y, this.updateUniform(name, UniformBuffer._TempBuffer, 2);}_updateFloat3ForEffect(name, x, y, z, suffix = "") {this._currentEffect.setFloat3(name + suffix, x, y, z);}_updateFloat3ForUniform(name, x, y, z) {UniformBuffer._TempBuffer[0] = x, UniformBuffer._TempBuffer[1] = y, UniformBuffer._TempBuffer[2] = z, this.updateUniform(name, UniformBuffer._TempBuffer, 3);}_updateFloat4ForEffect(name, x, y, z, w, suffix = "") {this._currentEffect.setFloat4(name + suffix, x, y, z, w);}_updateFloat4ForUniform(name, x, y, z, w) {UniformBuffer._TempBuffer[0] = x, UniformBuffer._TempBuffer[1] = y, UniformBuffer._TempBuffer[2] = z, UniformBuffer._TempBuffer[3] = w, this.updateUniform(name, UniformBuffer._TempBuffer, 4);}_updateFloatArrayForEffect(name, array) {this._currentEffect.setFloatArray(name, array);}_updateFloatArrayForUniform(name, array) {this.updateUniformArray(name, array, array.length);}_updateArrayForEffect(name, array) {this._currentEffect.setArray(name, array);}_updateArrayForUniform(name, array) {this.updateUniformArray(name, array, array.length);}_updateIntArrayForEffect(name, array) {this._currentEffect.setIntArray(name, array);}_updateIntArrayForUniform(name, array) {UniformBuffer._TempBufferInt32View.set(array), this.updateUniformArray(name, UniformBuffer._TempBuffer, array.length);}_updateUIntArrayForEffect(name, array) {this._currentEffect.setUIntArray(name, array);}_updateUIntArrayForUniform(name, array) {UniformBuffer._TempBufferUInt32View.set(array), this.updateUniformArray(name, UniformBuffer._TempBuffer, array.length);}_updateMatrixForEffect(name, mat) {this._currentEffect.setMatrix(name, mat);}_updateMatrixForUniform(name, mat) {this._cacheMatrix(name, mat) && this.updateUniform(name, mat.toArray(), 16);}_updateMatricesForEffect(name, mat) {this._currentEffect.setMatrices(name, mat);}_updateMatricesForUniform(name, mat) {this.updateUniform(name, mat, mat.length);}_updateVector3ForEffect(name, vector) {this._currentEffect.setVector3(name, vector);}_updateVector3ForUniform(name, vector) {UniformBuffer._TempBuffer[0] = vector.x, UniformBuffer._TempBuffer[1] = vector.y, UniformBuffer._TempBuffer[2] = vector.z, this.updateUniform(name, UniformBuffer._TempBuffer, 3);}_updateVector4ForEffect(name, vector) {this._currentEffect.setVector4(name, vector);}_updateVector4ForUniform(name, vector) {UniformBuffer._TempBuffer[0] = vector.x, UniformBuffer._TempBuffer[1] = vector.y, UniformBuffer._TempBuffer[2] = vector.z, UniformBuffer._TempBuffer[3] = vector.w, this.updateUniform(name, UniformBuffer._TempBuffer, 4);}_updateColor3ForEffect(name, color, suffix = "") {this._currentEffect.setColor3(name + suffix, color);}_updateColor3ForUniform(name, color) {UniformBuffer._TempBuffer[0] = color.r, UniformBuffer._TempBuffer[1] = color.g, UniformBuffer._TempBuffer[2] = color.b, this.updateUniform(name, UniformBuffer._TempBuffer, 3);}_updateColor4ForEffect(name, color, alpha, suffix = "") {this._currentEffect.setColor4(name + suffix, color, alpha);}_updateDirectColor4ForEffect(name, color, suffix = "") {this._currentEffect.setDirectColor4(name + suffix, color);}_updateColor4ForUniform(name, color, alpha) {UniformBuffer._TempBuffer[0] = color.r, UniformBuffer._TempBuffer[1] = color.g, UniformBuffer._TempBuffer[2] = color.b, UniformBuffer._TempBuffer[3] = alpha, this.updateUniform(name, UniformBuffer._TempBuffer, 4);}_updateDirectColor4ForUniform(name, color) {UniformBuffer._TempBuffer[0] = color.r, UniformBuffer._TempBuffer[1] = color.g, UniformBuffer._TempBuffer[2] = color.b, UniformBuffer._TempBuffer[3] = color.a, this.updateUniform(name, UniformBuffer._TempBuffer, 4);}_updateIntForEffect(name, x, suffix = "") {this._currentEffect.setInt(name + suffix, x);}_updateIntForUniform(name, x) {UniformBuffer._TempBufferInt32View[0] = x, this.updateUniform(name, UniformBuffer._TempBuffer, 1);}_updateInt2ForEffect(name, x, y, suffix = "") {this._currentEffect.setInt2(name + suffix, x, y);}_updateInt2ForUniform(name, x, y) {UniformBuffer._TempBufferInt32View[0] = x, UniformBuffer._TempBufferInt32View[1] = y, this.updateUniform(name, UniformBuffer._TempBuffer, 2);}_updateInt3ForEffect(name, x, y, z, suffix = "") {this._currentEffect.setInt3(name + suffix, x, y, z);}_updateInt3ForUniform(name, x, y, z) {UniformBuffer._TempBufferInt32View[0] = x, UniformBuffer._TempBufferInt32View[1] = y, UniformBuffer._TempBufferInt32View[2] = z, this.updateUniform(name, UniformBuffer._TempBuffer, 3);}_updateInt4ForEffect(name, x, y, z, w, suffix = "") {this._currentEffect.setInt4(name + suffix, x, y, z, w);}_updateInt4ForUniform(name, x, y, z, w) {UniformBuffer._TempBufferInt32View[0] = x, UniformBuffer._TempBufferInt32View[1] = y, UniformBuffer._TempBufferInt32View[2] = z, UniformBuffer._TempBufferInt32View[3] = w, this.updateUniform(name, UniformBuffer._TempBuffer, 4);}_updateUIntForEffect(name, x, suffix = "") {this._currentEffect.setUInt(name + suffix, x);}_updateUIntForUniform(name, x) {UniformBuffer._TempBufferUInt32View[0] = x, this.updateUniform(name, UniformBuffer._TempBuffer, 1);}_updateUInt2ForEffect(name, x, y, suffix = "") {this._currentEffect.setUInt2(name + suffix, x, y);}_updateUInt2ForUniform(name, x, y) {UniformBuffer._TempBufferUInt32View[0] = x, UniformBuffer._TempBufferUInt32View[1] = y, this.updateUniform(name, UniformBuffer._TempBuffer, 2);}_updateUInt3ForEffect(name, x, y, z, suffix = "") {this._currentEffect.setUInt3(name + suffix, x, y, z);}_updateUInt3ForUniform(name, x, y, z) {UniformBuffer._TempBufferUInt32View[0] = x, UniformBuffer._TempBufferUInt32View[1] = y, UniformBuffer._TempBufferUInt32View[2] = z, this.updateUniform(name, UniformBuffer._TempBuffer, 3);}_updateUInt4ForEffect(name, x, y, z, w, suffix = "") {this._currentEffect.setUInt4(name + suffix, x, y, z, w);}_updateUInt4ForUniform(name, x, y, z, w) {UniformBuffer._TempBufferUInt32View[0] = x, UniformBuffer._TempBufferUInt32View[1] = y, UniformBuffer._TempBufferUInt32View[2] = z, UniformBuffer._TempBufferUInt32View[3] = w, this.updateUniform(name, UniformBuffer._TempBuffer, 4);}setTexture(name, texture) {this._currentEffect.setTexture(name, texture);}updateUniformDirectly(uniformName, data) {this.updateUniform(uniformName, data, data.length), this.update();}bindToEffect(effect, name) {this._currentEffect = effect, this._currentEffectName = name;}bindUniformBuffer() {!this._noUBO && this._buffer && this._currentEffect && this._currentEffect.bindUniformBuffer(this._buffer, this._currentEffectName);}unbindEffect() {this._currentEffect = void 0, this._currentEffectName = void 0;}setDataBuffer(dataBuffer) {if (!this._buffers) return this._buffer === dataBuffer;for (let b = 0; b < this._buffers.length; ++b) {const buffer = this._buffers[b];if (buffer[0] === dataBuffer) return this._bufferIndex = b, this._buffer = dataBuffer, this._createBufferOnWrite = !1, this._currentEffect = void 0, !0;}return !1;}dispose() {if (this._noUBO) return;const uniformBuffers = this._engine._uniformBuffers,index = uniformBuffers.indexOf(this);if (-1 !== index && (uniformBuffers[index] = uniformBuffers[uniformBuffers.length - 1], uniformBuffers.pop()), this._engine._features.trackUbosInFrame && this._buffers) for (let i = 0; i < this._buffers.length; ++i) {const buffer = this._buffers[i][0];this._engine._releaseBuffer(buffer);} else this._buffer && this._engine._releaseBuffer(this._buffer) && (this._buffer = null);}}UniformBuffer._UpdatedUbosInFrame = {}, UniformBuffer._MAX_UNIFORM_SIZE = 256, UniformBuffer._TempBuffer = new Float32Array(UniformBuffer._MAX_UNIFORM_SIZE), UniformBuffer._TempBufferInt32View = new Int32Array(UniformBuffer._TempBuffer.buffer), UniformBuffer._TempBufferUInt32View = new Uint32Array(UniformBuffer._TempBuffer.buffer);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.axis.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "RD": () => (/* binding */ Axis),
/* harmony export */   "T": () => (/* binding */ Space),
/* harmony export */   "c7": () => (/* binding */ Coordinate)
/* harmony export */ });
/* harmony import */ var _math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
var Space;(function (Space) {Space[Space.LOCAL = 0] = "LOCAL", Space[Space.WORLD = 1] = "WORLD", Space[Space.BONE = 2] = "BONE";})(Space || (Space = {}));class Axis {}Axis.X = new _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(1, 0, 0), Axis.Y = new _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 1, 0), Axis.Z = new _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 0, 1);var Coordinate;(function (Coordinate) {Coordinate[Coordinate.X = 0] = "X", Coordinate[Coordinate.Y = 1] = "Y", Coordinate[Coordinate.Z = 2] = "Z";})(Coordinate || (Coordinate = {}));

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.color.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HE": () => (/* binding */ Color4),
/* harmony export */   "Wo": () => (/* binding */ Color3),
/* harmony export */   "zZ": () => (/* binding */ TmpColors)
/* harmony export */ });
/* harmony import */ var _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
/* harmony import */ var _math_constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.constants.js");
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/arrayTools.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
class Color3 {constructor(r = 0, g = 0, b = 0) {this.r = r, this.g = g, this.b = b;}toString() {return "{R: " + this.r + " G:" + this.g + " B:" + this.b + "}";}getClassName() {return "Color3";}getHashCode() {let hash = 0 | 255 * this.r;return hash = 397 * hash ^ (0 | 255 * this.g), hash = 397 * hash ^ (0 | 255 * this.b), hash;}toArray(array, index = 0) {return array[index] = this.r, array[index + 1] = this.g, array[index + 2] = this.b, this;}fromArray(array, offset = 0) {return Color3.FromArrayToRef(array, offset, this), this;}toColor4(alpha = 1) {return new Color4(this.r, this.g, this.b, alpha);}asArray() {return [this.r, this.g, this.b];}toLuminance() {return .3 * this.r + .59 * this.g + .11 * this.b;}multiply(otherColor) {return new Color3(this.r * otherColor.r, this.g * otherColor.g, this.b * otherColor.b);}multiplyToRef(otherColor, result) {return result.r = this.r * otherColor.r, result.g = this.g * otherColor.g, result.b = this.b * otherColor.b, this;}equals(otherColor) {return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b;}equalsFloats(r, g, b) {return this.r === r && this.g === g && this.b === b;}scale(scale) {return new Color3(this.r * scale, this.g * scale, this.b * scale);}scaleInPlace(scale) {return this.r *= scale, this.g *= scale, this.b *= scale, this;}scaleToRef(scale, result) {return result.r = this.r * scale, result.g = this.g * scale, result.b = this.b * scale, this;}scaleAndAddToRef(scale, result) {return result.r += this.r * scale, result.g += this.g * scale, result.b += this.b * scale, this;}clampToRef(min = 0, max = 1, result) {return result.r = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(this.r, min, max), result.g = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(this.g, min, max), result.b = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(this.b, min, max), this;}add(otherColor) {return new Color3(this.r + otherColor.r, this.g + otherColor.g, this.b + otherColor.b);}addToRef(otherColor, result) {return result.r = this.r + otherColor.r, result.g = this.g + otherColor.g, result.b = this.b + otherColor.b, this;}subtract(otherColor) {return new Color3(this.r - otherColor.r, this.g - otherColor.g, this.b - otherColor.b);}subtractToRef(otherColor, result) {return result.r = this.r - otherColor.r, result.g = this.g - otherColor.g, result.b = this.b - otherColor.b, this;}clone() {return new Color3(this.r, this.g, this.b);}copyFrom(source) {return this.r = source.r, this.g = source.g, this.b = source.b, this;}copyFromFloats(r, g, b) {return this.r = r, this.g = g, this.b = b, this;}set(r, g, b) {return this.copyFromFloats(r, g, b);}toHexString() {const intR = Math.round(255 * this.r),intG = Math.round(255 * this.g),intB = Math.round(255 * this.b);return "#" + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intR) + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intG) + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intB);}toLinearSpace() {const convertedColor = new Color3();return this.toLinearSpaceToRef(convertedColor), convertedColor;}toHSV() {const result = new Color3();return this.toHSVToRef(result), result;}toHSVToRef(result) {const r = this.r,g = this.g,b = this.b,max = Math.max(r, g, b),min = Math.min(r, g, b);let h = 0,s = 0;const dm = max - min;0 !== max && (s = dm / max), max != min && (max == r ? (h = (g - b) / dm, g < b && (h += 6)) : max == g ? h = (b - r) / dm + 2 : max == b && (h = (r - g) / dm + 4), h *= 60), result.r = h, result.g = s, result.b = max;}toLinearSpaceToRef(convertedColor) {return convertedColor.r = Math.pow(this.r, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToLinearSpace */ .Nn), convertedColor.g = Math.pow(this.g, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToLinearSpace */ .Nn), convertedColor.b = Math.pow(this.b, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToLinearSpace */ .Nn), this;}toGammaSpace() {const convertedColor = new Color3();return this.toGammaSpaceToRef(convertedColor), convertedColor;}toGammaSpaceToRef(convertedColor) {return convertedColor.r = Math.pow(this.r, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToGammaSpace */ .zp), convertedColor.g = Math.pow(this.g, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToGammaSpace */ .zp), convertedColor.b = Math.pow(this.b, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToGammaSpace */ .zp), this;}static HSVtoRGBToRef(hue, saturation, value, result) {const chroma = value * saturation,h = hue / 60,x = chroma * (1 - Math.abs(h % 2 - 1));let r = 0,g = 0,b = 0;0 <= h && 1 >= h ? (r = chroma, g = x) : 1 <= h && 2 >= h ? (r = x, g = chroma) : 2 <= h && 3 >= h ? (g = chroma, b = x) : 3 <= h && 4 >= h ? (g = x, b = chroma) : 4 <= h && 5 >= h ? (r = x, b = chroma) : 5 <= h && 6 >= h && (r = chroma, b = x);const m = value - chroma;result.set(r + m, g + m, b + m);}static FromHSV(hue, saturation, value) {const result = new Color3(0, 0, 0);return Color3.HSVtoRGBToRef(hue, saturation, value, result), result;}static FromHexString(hex) {if ("#" !== hex.substring(0, 1) || 7 !== hex.length) return new Color3(0, 0, 0);const r = parseInt(hex.substring(1, 3), 16),g = parseInt(hex.substring(3, 5), 16),b = parseInt(hex.substring(5, 7), 16);return Color3.FromInts(r, g, b);}static FromArray(array, offset = 0) {return new Color3(array[offset], array[offset + 1], array[offset + 2]);}static FromArrayToRef(array, offset = 0, result) {result.r = array[offset], result.g = array[offset + 1], result.b = array[offset + 2];}static FromInts(r, g, b) {return new Color3(r / 255, g / 255, b / 255);}static Lerp(start, end, amount) {const result = new Color3(0, 0, 0);return Color3.LerpToRef(start, end, amount, result), result;}static LerpToRef(left, right, amount, result) {result.r = left.r + (right.r - left.r) * amount, result.g = left.g + (right.g - left.g) * amount, result.b = left.b + (right.b - left.b) * amount;}static Hermite(value1, tangent1, value2, tangent2, amount) {const squared = amount * amount,cubed = amount * squared,part1 = 2 * cubed - 3 * squared + 1,part2 = -2 * cubed + 3 * squared,part3 = cubed - 2 * squared + amount,part4 = cubed - squared,r = value1.r * part1 + value2.r * part2 + tangent1.r * part3 + tangent2.r * part4,g = value1.g * part1 + value2.g * part2 + tangent1.g * part3 + tangent2.g * part4,b = value1.b * part1 + value2.b * part2 + tangent1.b * part3 + tangent2.b * part4;return new Color3(r, g, b);}static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {const result = Color3.Black();return this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result), result;}static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {const t2 = time * time;result.r = 6 * (t2 - time) * value1.r + (3 * t2 - 4 * time + 1) * tangent1.r + 6 * (-t2 + time) * value2.r + (3 * t2 - 2 * time) * tangent2.r, result.g = 6 * (t2 - time) * value1.g + (3 * t2 - 4 * time + 1) * tangent1.g + 6 * (-t2 + time) * value2.g + (3 * t2 - 2 * time) * tangent2.g, result.b = 6 * (t2 - time) * value1.b + (3 * t2 - 4 * time + 1) * tangent1.b + 6 * (-t2 + time) * value2.b + (3 * t2 - 2 * time) * tangent2.b;}static Red() {return new Color3(1, 0, 0);}static Green() {return new Color3(0, 1, 0);}static Blue() {return new Color3(0, 0, 1);}static Black() {return new Color3(0, 0, 0);}static get BlackReadOnly() {return Color3._BlackReadOnly;}static White() {return new Color3(1, 1, 1);}static Purple() {return new Color3(.5, 0, .5);}static Magenta() {return new Color3(1, 0, 1);}static Yellow() {return new Color3(1, 1, 0);}static Gray() {return new Color3(.5, .5, .5);}static Teal() {return new Color3(0, 1, 1);}static Random() {return new Color3(Math.random(), Math.random(), Math.random());}}Color3._BlackReadOnly = Color3.Black();class Color4 {constructor(r = 0, g = 0, b = 0, a = 1) {this.r = r, this.g = g, this.b = b, this.a = a;}addInPlace(right) {return this.r += right.r, this.g += right.g, this.b += right.b, this.a += right.a, this;}asArray() {return [this.r, this.g, this.b, this.a];}toArray(array, index = 0) {return array[index] = this.r, array[index + 1] = this.g, array[index + 2] = this.b, array[index + 3] = this.a, this;}fromArray(array, offset = 0) {return Color4.FromArrayToRef(array, offset, this), this;}equals(otherColor) {return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b && this.a === otherColor.a;}add(right) {return new Color4(this.r + right.r, this.g + right.g, this.b + right.b, this.a + right.a);}subtract(right) {return new Color4(this.r - right.r, this.g - right.g, this.b - right.b, this.a - right.a);}subtractToRef(right, result) {return result.r = this.r - right.r, result.g = this.g - right.g, result.b = this.b - right.b, result.a = this.a - right.a, this;}scale(scale) {return new Color4(this.r * scale, this.g * scale, this.b * scale, this.a * scale);}scaleInPlace(scale) {return this.r *= scale, this.g *= scale, this.b *= scale, this.a *= scale, this;}scaleToRef(scale, result) {return result.r = this.r * scale, result.g = this.g * scale, result.b = this.b * scale, result.a = this.a * scale, this;}scaleAndAddToRef(scale, result) {return result.r += this.r * scale, result.g += this.g * scale, result.b += this.b * scale, result.a += this.a * scale, this;}clampToRef(min = 0, max = 1, result) {return result.r = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(this.r, min, max), result.g = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(this.g, min, max), result.b = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(this.b, min, max), result.a = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(this.a, min, max), this;}multiply(color) {return new Color4(this.r * color.r, this.g * color.g, this.b * color.b, this.a * color.a);}multiplyToRef(color, result) {return result.r = this.r * color.r, result.g = this.g * color.g, result.b = this.b * color.b, result.a = this.a * color.a, result;}toString() {return "{R: " + this.r + " G:" + this.g + " B:" + this.b + " A:" + this.a + "}";}getClassName() {return "Color4";}getHashCode() {let hash = 0 | 255 * this.r;return hash = 397 * hash ^ (0 | 255 * this.g), hash = 397 * hash ^ (0 | 255 * this.b), hash = 397 * hash ^ (0 | 255 * this.a), hash;}clone() {return new Color4(this.r, this.g, this.b, this.a);}copyFrom(source) {return this.r = source.r, this.g = source.g, this.b = source.b, this.a = source.a, this;}copyFromFloats(r, g, b, a) {return this.r = r, this.g = g, this.b = b, this.a = a, this;}set(r, g, b, a) {return this.copyFromFloats(r, g, b, a);}toHexString(returnAsColor3 = !1) {const intR = Math.round(255 * this.r),intG = Math.round(255 * this.g),intB = Math.round(255 * this.b);if (returnAsColor3) return "#" + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intR) + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intG) + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intB);const intA = Math.round(255 * this.a);return "#" + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intR) + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intG) + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intB) + _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.ToHex */ .R.ToHex(intA);}toLinearSpace() {const convertedColor = new Color4();return this.toLinearSpaceToRef(convertedColor), convertedColor;}toLinearSpaceToRef(convertedColor) {return convertedColor.r = Math.pow(this.r, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToLinearSpace */ .Nn), convertedColor.g = Math.pow(this.g, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToLinearSpace */ .Nn), convertedColor.b = Math.pow(this.b, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToLinearSpace */ .Nn), convertedColor.a = this.a, this;}toGammaSpace() {const convertedColor = new Color4();return this.toGammaSpaceToRef(convertedColor), convertedColor;}toGammaSpaceToRef(convertedColor) {return convertedColor.r = Math.pow(this.r, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToGammaSpace */ .zp), convertedColor.g = Math.pow(this.g, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToGammaSpace */ .zp), convertedColor.b = Math.pow(this.b, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .ToGammaSpace */ .zp), convertedColor.a = this.a, this;}static FromHexString(hex) {if ("#" !== hex.substring(0, 1) || 9 !== hex.length && 7 !== hex.length) return new Color4(0, 0, 0, 0);const r = parseInt(hex.substring(1, 3), 16),g = parseInt(hex.substring(3, 5), 16),b = parseInt(hex.substring(5, 7), 16),a = 9 === hex.length ? parseInt(hex.substring(7, 9), 16) : 255;return Color4.FromInts(r, g, b, a);}static Lerp(left, right, amount) {const result = new Color4(0, 0, 0, 0);return Color4.LerpToRef(left, right, amount, result), result;}static LerpToRef(left, right, amount, result) {result.r = left.r + (right.r - left.r) * amount, result.g = left.g + (right.g - left.g) * amount, result.b = left.b + (right.b - left.b) * amount, result.a = left.a + (right.a - left.a) * amount;}static Hermite(value1, tangent1, value2, tangent2, amount) {const squared = amount * amount,cubed = amount * squared,part1 = 2 * cubed - 3 * squared + 1,part2 = -2 * cubed + 3 * squared,part3 = cubed - 2 * squared + amount,part4 = cubed - squared,r = value1.r * part1 + value2.r * part2 + tangent1.r * part3 + tangent2.r * part4,g = value1.g * part1 + value2.g * part2 + tangent1.g * part3 + tangent2.g * part4,b = value1.b * part1 + value2.b * part2 + tangent1.b * part3 + tangent2.b * part4,a = value1.a * part1 + value2.a * part2 + tangent1.a * part3 + tangent2.a * part4;return new Color4(r, g, b, a);}static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {const result = new Color4();return this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result), result;}static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {const t2 = time * time;result.r = 6 * (t2 - time) * value1.r + (3 * t2 - 4 * time + 1) * tangent1.r + 6 * (-t2 + time) * value2.r + (3 * t2 - 2 * time) * tangent2.r, result.g = 6 * (t2 - time) * value1.g + (3 * t2 - 4 * time + 1) * tangent1.g + 6 * (-t2 + time) * value2.g + (3 * t2 - 2 * time) * tangent2.g, result.b = 6 * (t2 - time) * value1.b + (3 * t2 - 4 * time + 1) * tangent1.b + 6 * (-t2 + time) * value2.b + (3 * t2 - 2 * time) * tangent2.b, result.a = 6 * (t2 - time) * value1.a + (3 * t2 - 4 * time + 1) * tangent1.a + 6 * (-t2 + time) * value2.a + (3 * t2 - 2 * time) * tangent2.a;}static FromColor3(color3, alpha = 1) {return new Color4(color3.r, color3.g, color3.b, alpha);}static FromArray(array, offset = 0) {return new Color4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);}static FromArrayToRef(array, offset = 0, result) {result.r = array[offset], result.g = array[offset + 1], result.b = array[offset + 2], result.a = array[offset + 3];}static FromInts(r, g, b, a) {return new Color4(r / 255, g / 255, b / 255, a / 255);}static CheckColors4(colors, count) {if (colors.length === 3 * count) {const colors4 = [];for (let index = 0; index < colors.length; index += 3) {const newIndex = 4 * (index / 3);colors4[newIndex] = colors[index], colors4[newIndex + 1] = colors[index + 1], colors4[newIndex + 2] = colors[index + 2], colors4[newIndex + 3] = 1;}return colors4;}return colors;}}class TmpColors {}TmpColors.Color3 = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildArray */ .B.BuildArray(3, Color3.Black), TmpColors.Color4 = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildArray */ .B.BuildArray(3, () => new Color4(0, 0, 0, 0)), (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .H)("BABYLON.Color3", Color3), (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .H)("BABYLON.Color4", Color4);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.constants.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Nn": () => (/* binding */ ToLinearSpace),
/* harmony export */   "Q_": () => (/* binding */ PHI),
/* harmony export */   "kn": () => (/* binding */ Epsilon),
/* harmony export */   "zp": () => (/* binding */ ToGammaSpace)
/* harmony export */ });
const ToGammaSpace = 1 / 2.2;const ToLinearSpace = 2.2;const PHI = (1 + Math.sqrt(5)) / 2;const Epsilon = .001;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.frustum.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "i": () => (/* binding */ Frustum)
/* harmony export */ });
/* harmony import */ var _math_plane_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.plane.js");
class Frustum {static GetPlanes(transform) {const frustumPlanes = [];for (let index = 0; 6 > index; index++) frustumPlanes.push(new _math_plane_js__WEBPACK_IMPORTED_MODULE_0__/* .Plane */ .J(0, 0, 0, 0));return Frustum.GetPlanesToRef(transform, frustumPlanes), frustumPlanes;}static GetNearPlaneToRef(transform, frustumPlane) {const m = transform.m;frustumPlane.normal.x = m[3] + m[2], frustumPlane.normal.y = m[7] + m[6], frustumPlane.normal.z = m[11] + m[10], frustumPlane.d = m[15] + m[14], frustumPlane.normalize();}static GetFarPlaneToRef(transform, frustumPlane) {const m = transform.m;frustumPlane.normal.x = m[3] - m[2], frustumPlane.normal.y = m[7] - m[6], frustumPlane.normal.z = m[11] - m[10], frustumPlane.d = m[15] - m[14], frustumPlane.normalize();}static GetLeftPlaneToRef(transform, frustumPlane) {const m = transform.m;frustumPlane.normal.x = m[3] + m[0], frustumPlane.normal.y = m[7] + m[4], frustumPlane.normal.z = m[11] + m[8], frustumPlane.d = m[15] + m[12], frustumPlane.normalize();}static GetRightPlaneToRef(transform, frustumPlane) {const m = transform.m;frustumPlane.normal.x = m[3] - m[0], frustumPlane.normal.y = m[7] - m[4], frustumPlane.normal.z = m[11] - m[8], frustumPlane.d = m[15] - m[12], frustumPlane.normalize();}static GetTopPlaneToRef(transform, frustumPlane) {const m = transform.m;frustumPlane.normal.x = m[3] - m[1], frustumPlane.normal.y = m[7] - m[5], frustumPlane.normal.z = m[11] - m[9], frustumPlane.d = m[15] - m[13], frustumPlane.normalize();}static GetBottomPlaneToRef(transform, frustumPlane) {const m = transform.m;frustumPlane.normal.x = m[3] + m[1], frustumPlane.normal.y = m[7] + m[5], frustumPlane.normal.z = m[11] + m[9], frustumPlane.d = m[15] + m[13], frustumPlane.normalize();}static GetPlanesToRef(transform, frustumPlanes) {Frustum.GetNearPlaneToRef(transform, frustumPlanes[0]), Frustum.GetFarPlaneToRef(transform, frustumPlanes[1]), Frustum.GetLeftPlaneToRef(transform, frustumPlanes[2]), Frustum.GetRightPlaneToRef(transform, frustumPlanes[3]), Frustum.GetTopPlaneToRef(transform, frustumPlanes[4]), Frustum.GetBottomPlaneToRef(transform, frustumPlanes[5]);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.functions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "k": () => (/* binding */ extractMinAndMax),
/* harmony export */   "y": () => (/* binding */ extractMinAndMaxIndexed)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
class MathHelpers {static extractMinAndMaxIndexed(positions, indices, indexStart, indexCount, minimum, maximum) {for (let index = indexStart; index < indexStart + indexCount; index++) {const offset = 3 * indices[index],x = positions[offset],y = positions[offset + 1],z = positions[offset + 2];minimum.minimizeInPlaceFromFloats(x, y, z), maximum.maximizeInPlaceFromFloats(x, y, z);}}static extractMinAndMax(positions, start, count, stride, minimum, maximum) {for (let index = start, offset = start * stride; index < start + count; index++, offset += stride) {const x = positions[offset],y = positions[offset + 1],z = positions[offset + 2];minimum.minimizeInPlaceFromFloats(x, y, z), maximum.maximizeInPlaceFromFloats(x, y, z);}}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .nativeOverride.filter */ .G6.filter((...[positions, indices]) => !Array.isArray(positions) && !Array.isArray(indices))], MathHelpers, "extractMinAndMaxIndexed", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .nativeOverride.filter */ .G6.filter((...[positions]) => !Array.isArray(positions))], MathHelpers, "extractMinAndMax", null);function extractMinAndMaxIndexed(positions, indices, indexStart, indexCount, bias = null) {const minimum = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE),maximum = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);return MathHelpers.extractMinAndMaxIndexed(positions, indices, indexStart, indexCount, minimum, maximum), bias && (minimum.x -= minimum.x * bias.x + bias.y, minimum.y -= minimum.y * bias.x + bias.y, minimum.z -= minimum.z * bias.x + bias.y, maximum.x += maximum.x * bias.x + bias.y, maximum.y += maximum.y * bias.x + bias.y, maximum.z += maximum.z * bias.x + bias.y), { minimum: minimum, maximum: maximum };}function extractMinAndMax(positions, start, count, bias = null, stride) {const minimum = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE),maximum = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);return stride || (stride = 3), MathHelpers.extractMinAndMax(positions, start, count, stride, minimum, maximum), bias && (minimum.x -= minimum.x * bias.x + bias.y, minimum.y -= minimum.y * bias.x + bias.y, minimum.z -= minimum.z * bias.x + bias.y, maximum.x += maximum.x * bias.x + bias.y, maximum.y += maximum.y * bias.x + bias.y, maximum.z += maximum.z * bias.x + bias.y), { minimum: minimum, maximum: maximum };}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "RZ": () => (/* reexport */ math_path/* Angle */.RZ),
  "Q": () => (/* reexport */ math_path/* Arc2 */.Q),
  "RD": () => (/* reexport */ math_axis/* Axis */.RD),
  "hr": () => (/* reexport */ math_path/* BezierCurve */.hr),
  "Wo": () => (/* reexport */ math_color/* Color3 */.Wo),
  "HE": () => (/* reexport */ math_color/* Color4 */.HE),
  "c7": () => (/* reexport */ math_axis/* Coordinate */.c7),
  "j_": () => (/* reexport */ math_path/* Curve3 */.j_),
  "kn": () => (/* reexport */ math_constants/* Epsilon */.kn),
  "iW": () => (/* reexport */ math_frustum/* Frustum */.i),
  "y3": () => (/* reexport */ math_vector/* Matrix */.y3),
  "i5": () => (/* reexport */ math_path/* Orientation */.i5),
  "Q_": () => (/* reexport */ math_constants/* PHI */.Q_),
  "ZZ": () => (/* reexport */ math_path/* Path2 */.ZZ),
  "$B": () => (/* reexport */ math_path/* Path3D */.$B),
  "JO": () => (/* reexport */ math_plane/* Plane */.J),
  "eN": () => (/* reexport */ PositionNormalTextureVertex),
  "$S": () => (/* reexport */ PositionNormalVertex),
  "_f": () => (/* reexport */ math_vector/* Quaternion */._f),
  "$u": () => (/* reexport */ math_size/* Size */.$),
  "T": () => (/* reexport */ math_axis/* Space */.T),
  "zZ": () => (/* reexport */ math_color/* TmpColors */.zZ),
  "jp": () => (/* reexport */ math_vector/* TmpVectors */.jp),
  "zp": () => (/* reexport */ math_constants/* ToGammaSpace */.zp),
  "Nn": () => (/* reexport */ math_constants/* ToLinearSpace */.Nn),
  "FM": () => (/* reexport */ math_vector/* Vector2 */.FM),
  "P": () => (/* reexport */ math_vector/* Vector3 */.P),
  "Lt": () => (/* reexport */ math_vector/* Vector4 */.Lt),
  "l_": () => (/* reexport */ math_viewport/* Viewport */.l)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.axis.js
var math_axis = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.axis.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.color.js
var math_color = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.constants.js
var math_constants = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.constants.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.frustum.js
var math_frustum = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.frustum.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.path.js
var math_path = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.path.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.plane.js
var math_plane = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.plane.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.size.js
var math_size = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.size.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Maths/math.vertexFormat.js
class PositionNormalVertex {constructor(position = math_vector/* Vector3.Zero */.P.Zero(), normal = math_vector/* Vector3.Up */.P.Up()) {this.position = position, this.normal = normal;}clone() {return new PositionNormalVertex(this.position.clone(), this.normal.clone());}}class PositionNormalTextureVertex {constructor(position = math_vector/* Vector3.Zero */.P.Zero(), normal = math_vector/* Vector3.Up */.P.Up(), uv = math_vector/* Vector2.Zero */.FM.Zero()) {this.position = position, this.normal = normal, this.uv = uv;}clone() {return new PositionNormalTextureVertex(this.position.clone(), this.normal.clone(), this.uv.clone());}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.viewport.js
var math_viewport = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.viewport.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Maths/math.js


/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.path.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$B": () => (/* binding */ Path3D),
/* harmony export */   "Q": () => (/* binding */ Arc2),
/* harmony export */   "RZ": () => (/* binding */ Angle),
/* harmony export */   "ZZ": () => (/* binding */ Path2),
/* harmony export */   "hr": () => (/* binding */ BezierCurve),
/* harmony export */   "i5": () => (/* binding */ Orientation),
/* harmony export */   "j_": () => (/* binding */ Curve3)
/* harmony export */ });
/* harmony import */ var _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
/* harmony import */ var _math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _math_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.constants.js");
var Orientation;(function (Orientation) {Orientation[Orientation.CW = 0] = "CW", Orientation[Orientation.CCW = 1] = "CCW";})(Orientation || (Orientation = {}));class BezierCurve {static Interpolate(t, x1, y1, x2, y2) {const f0 = 1 - 3 * x2 + 3 * x1,f1 = 3 * x2 - 6 * x1,f2 = 3 * x1;let refinedT = t;for (let i = 0; 5 > i; i++) {const refinedT2 = refinedT * refinedT,refinedT3 = refinedT2 * refinedT,x = f0 * refinedT3 + f1 * refinedT2 + f2 * refinedT,slope = 1 / (3 * f0 * refinedT2 + 2 * f1 * refinedT + f2);refinedT -= (x - t) * slope, refinedT = Math.min(1, Math.max(0, refinedT));}return 3 * Math.pow(1 - refinedT, 2) * refinedT * y1 + 3 * (1 - refinedT) * Math.pow(refinedT, 2) * y2 + Math.pow(refinedT, 3);}}class Angle {constructor(radians) {this._radians = radians, 0 > this._radians && (this._radians += 2 * Math.PI);}degrees() {return 180 * this._radians / Math.PI;}radians() {return this._radians;}static BetweenTwoPoints(a, b) {const delta = b.subtract(a),theta = Math.atan2(delta.y, delta.x);return new Angle(theta);}static FromRadians(radians) {return new Angle(radians);}static FromDegrees(degrees) {return new Angle(degrees * Math.PI / 180);}}class Arc2 {constructor(startPoint, midPoint, endPoint) {this.startPoint = startPoint, this.midPoint = midPoint, this.endPoint = endPoint;const temp = Math.pow(midPoint.x, 2) + Math.pow(midPoint.y, 2),startToMid = (Math.pow(startPoint.x, 2) + Math.pow(startPoint.y, 2) - temp) / 2,midToEnd = (temp - Math.pow(endPoint.x, 2) - Math.pow(endPoint.y, 2)) / 2,det = (startPoint.x - midPoint.x) * (midPoint.y - endPoint.y) - (midPoint.x - endPoint.x) * (startPoint.y - midPoint.y);this.centerPoint = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .FM((startToMid * (midPoint.y - endPoint.y) - midToEnd * (startPoint.y - midPoint.y)) / det, ((startPoint.x - midPoint.x) * midToEnd - (midPoint.x - endPoint.x) * startToMid) / det), this.radius = this.centerPoint.subtract(this.startPoint).length(), this.startAngle = Angle.BetweenTwoPoints(this.centerPoint, this.startPoint);const a1 = this.startAngle.degrees();let a2 = Angle.BetweenTwoPoints(this.centerPoint, this.midPoint).degrees(),a3 = Angle.BetweenTwoPoints(this.centerPoint, this.endPoint).degrees();180 < a2 - a1 && (a2 -= 360), -180 > a2 - a1 && (a2 += 360), 180 < a3 - a2 && (a3 -= 360), -180 > a3 - a2 && (a3 += 360), this.orientation = 0 > a2 - a1 ? Orientation.CW : Orientation.CCW, this.angle = Angle.FromDegrees(this.orientation === Orientation.CW ? a1 - a3 : a3 - a1);}}class Path2 {constructor(x, y) {this._points = [], this._length = 0, this.closed = !1, this._points.push(new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .FM(x, y));}addLineTo(x, y) {if (this.closed) return this;const newPoint = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .FM(x, y),previousPoint = this._points[this._points.length - 1];return this._points.push(newPoint), this._length += newPoint.subtract(previousPoint).length(), this;}addArcTo(midX, midY, endX, endY, numberOfSegments = 36) {if (this.closed) return this;const startPoint = this._points[this._points.length - 1],midPoint = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .FM(midX, midY),endPoint = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .FM(endX, endY),arc = new Arc2(startPoint, midPoint, endPoint);let increment = arc.angle.radians() / numberOfSegments;arc.orientation === Orientation.CW && (increment *= -1);let currentAngle = arc.startAngle.radians() + increment;for (let i = 0; i < numberOfSegments; i++) {const x = Math.cos(currentAngle) * arc.radius + arc.centerPoint.x,y = Math.sin(currentAngle) * arc.radius + arc.centerPoint.y;this.addLineTo(x, y), currentAngle += increment;}return this;}close() {return this.closed = !0, this;}length() {let result = this._length;if (this.closed) {const lastPoint = this._points[this._points.length - 1],firstPoint = this._points[0];result += firstPoint.subtract(lastPoint).length();}return result;}getPoints() {return this._points;}getPointAtLengthPosition(normalizedLengthPosition) {if (0 > normalizedLengthPosition || 1 < normalizedLengthPosition) return _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2.Zero */ .FM.Zero();const lengthPosition = normalizedLengthPosition * this.length();let previousOffset = 0;for (let i = 0; i < this._points.length; i++) {const j = (i + 1) % this._points.length,a = this._points[i],b = this._points[j],bToA = b.subtract(a),nextOffset = bToA.length() + previousOffset;if (lengthPosition >= previousOffset && lengthPosition <= nextOffset) {const dir = bToA.normalize(),localOffset = lengthPosition - previousOffset;return new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .FM(a.x + dir.x * localOffset, a.y + dir.y * localOffset);}previousOffset = nextOffset;}return _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2.Zero */ .FM.Zero();}static StartingAt(x, y) {return new Path2(x, y);}}class Path3D {constructor(path, firstNormal = null, raw, alignTangentsWithPath = !1) {this.path = path, this._curve = [], this._distances = [], this._tangents = [], this._normals = [], this._binormals = [], this._pointAtData = { id: 0, point: _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero(), previousPointArrayIndex: 0, position: 0, subPosition: 0, interpolateReady: !1, interpolationMatrix: _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.Identity */ .y3.Identity() };for (let p = 0; p < path.length; p++) this._curve[p] = path[p].clone();this._raw = raw || !1, this._alignTangentsWithPath = alignTangentsWithPath, this._compute(firstNormal, alignTangentsWithPath);}getCurve() {return this._curve;}getPoints() {return this._curve;}length() {return this._distances[this._distances.length - 1];}getTangents() {return this._tangents;}getNormals() {return this._normals;}getBinormals() {return this._binormals;}getDistances() {return this._distances;}getPointAt(position) {return this._updatePointAtData(position).point;}getTangentAt(position, interpolated = !1) {return this._updatePointAtData(position, interpolated), interpolated ? _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.TransformCoordinates */ .P.TransformCoordinates(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Forward */ .P.Forward(), this._pointAtData.interpolationMatrix) : this._tangents[this._pointAtData.previousPointArrayIndex];}getNormalAt(position, interpolated = !1) {return this._updatePointAtData(position, interpolated), interpolated ? _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.TransformCoordinates */ .P.TransformCoordinates(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Right */ .P.Right(), this._pointAtData.interpolationMatrix) : this._normals[this._pointAtData.previousPointArrayIndex];}getBinormalAt(position, interpolated = !1) {return this._updatePointAtData(position, interpolated), interpolated ? _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.TransformCoordinates */ .P.TransformCoordinates(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.UpReadOnly */ .P.UpReadOnly, this._pointAtData.interpolationMatrix) : this._binormals[this._pointAtData.previousPointArrayIndex];}getDistanceAt(position) {return this.length() * position;}getPreviousPointIndexAt(position) {return this._updatePointAtData(position), this._pointAtData.previousPointArrayIndex;}getSubPositionAt(position) {return this._updatePointAtData(position), this._pointAtData.subPosition;}getClosestPositionTo(target) {let smallestDistance = Number.MAX_VALUE,closestPosition = 0;for (let i = 0; i < this._curve.length - 1; i++) {const point = this._curve[i + 0],tangent = this._curve[i + 1].subtract(point).normalize(),subLength = this._distances[i + 1] - this._distances[i + 0],subPosition = Math.min(Math.max(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Dot */ .P.Dot(tangent, target.subtract(point).normalize()), 0) * _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Distance */ .P.Distance(point, target) / subLength, 1),distance = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Distance */ .P.Distance(point.add(tangent.scale(subPosition * subLength)), target);distance < smallestDistance && (smallestDistance = distance, closestPosition = (this._distances[i + 0] + subLength * subPosition) / this.length());}return closestPosition;}slice(start = 0, end = 1) {if (0 > start && (start = 1 - -1 * start % 1), 0 > end && (end = 1 - -1 * end % 1), start > end) {const _start = start;start = end, end = _start;}const curvePoints = this.getCurve(),startPoint = this.getPointAt(start);let startIndex = this.getPreviousPointIndexAt(start);const endPoint = this.getPointAt(end),endIndex = this.getPreviousPointIndexAt(end) + 1,slicePoints = [];return 0 !== start && (startIndex++, slicePoints.push(startPoint)), slicePoints.push(...curvePoints.slice(startIndex, endIndex)), (1 !== end || 1 === start) && slicePoints.push(endPoint), new Path3D(slicePoints, this.getNormalAt(start), this._raw, this._alignTangentsWithPath);}update(path, firstNormal = null, alignTangentsWithPath = !1) {for (let p = 0; p < path.length; p++) this._curve[p].x = path[p].x, this._curve[p].y = path[p].y, this._curve[p].z = path[p].z;return this._compute(firstNormal, alignTangentsWithPath), this;}_compute(firstNormal, alignTangentsWithPath = !1) {const l = this._curve.length;if (2 > l) return;this._tangents[0] = this._getFirstNonNullVector(0), this._raw || this._tangents[0].normalize(), this._tangents[l - 1] = this._curve[l - 1].subtract(this._curve[l - 2]), this._raw || this._tangents[l - 1].normalize();const tg0 = this._tangents[0],pp0 = this._normalVector(tg0, firstNormal);this._normals[0] = pp0, this._raw || this._normals[0].normalize(), this._binormals[0] = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(tg0, this._normals[0]), this._raw || this._binormals[0].normalize(), this._distances[0] = 0;let prev, cur, curTang, prevNor, prevBinor;for (let i = 1; i < l; i++) prev = this._getLastNonNullVector(i), i < l - 1 && (cur = this._getFirstNonNullVector(i), this._tangents[i] = alignTangentsWithPath ? cur : prev.add(cur), this._tangents[i].normalize()), this._distances[i] = this._distances[i - 1] + this._curve[i].subtract(this._curve[i - 1]).length(), curTang = this._tangents[i], prevBinor = this._binormals[i - 1], this._normals[i] = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(prevBinor, curTang), this._raw || (0 === this._normals[i].length() ? (prevNor = this._normals[i - 1], this._normals[i] = prevNor.clone()) : this._normals[i].normalize()), this._binormals[i] = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(curTang, this._normals[i]), this._raw || this._binormals[i].normalize();this._pointAtData.id = NaN;}_getFirstNonNullVector(index) {let i = 1,nNVector = this._curve[index + i].subtract(this._curve[index]);for (; 0 === nNVector.length() && index + i + 1 < this._curve.length;) i++, nNVector = this._curve[index + i].subtract(this._curve[index]);return nNVector;}_getLastNonNullVector(index) {let i = 1,nLVector = this._curve[index].subtract(this._curve[index - i]);for (; 0 === nLVector.length() && index > i + 1;) i++, nLVector = this._curve[index].subtract(this._curve[index - i]);return nLVector;}_normalVector(vt, va) {let normal0,tgl = vt.length();if (0 === tgl && (tgl = 1), void 0 === va || null === va) {let point;point = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(Math.abs(vt.y) / tgl, 1, _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .kn) ? _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(Math.abs(vt.x) / tgl, 1, _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .kn) ? _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(Math.abs(vt.z) / tgl, 1, _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .kn) ? _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero() : new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(0, 0, 1) : new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(1, 0, 0) : new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(0, -1, 0), normal0 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(vt, point);} else normal0 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(vt, va), _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.CrossToRef */ .P.CrossToRef(normal0, vt, normal0);return normal0.normalize(), normal0;}_updatePointAtData(position, interpolateTNB = !1) {if (this._pointAtData.id === position) return this._pointAtData.interpolateReady || this._updateInterpolationMatrix(), this._pointAtData;this._pointAtData.id = position;const curvePoints = this.getPoints();if (0 >= position) return this._setPointAtData(0, 0, curvePoints[0], 0, interpolateTNB);if (1 <= position) return this._setPointAtData(1, 1, curvePoints[curvePoints.length - 1], curvePoints.length - 1, interpolateTNB);let currentPoint,previousPoint = curvePoints[0],currentLength = 0;const targetLength = position * this.length();for (let i = 1; i < curvePoints.length; i++) {currentPoint = curvePoints[i];const distance = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Distance */ .P.Distance(previousPoint, currentPoint);if (currentLength += distance, currentLength === targetLength) return this._setPointAtData(position, 1, currentPoint, i, interpolateTNB);if (currentLength > targetLength) {const toLength = currentLength - targetLength,diff = toLength / distance,dir = previousPoint.subtract(currentPoint),point = currentPoint.add(dir.scaleInPlace(diff));return this._setPointAtData(position, 1 - diff, point, i - 1, interpolateTNB);}previousPoint = currentPoint;}return this._pointAtData;}_setPointAtData(position, subPosition, point, parentIndex, interpolateTNB) {return this._pointAtData.point = point, this._pointAtData.position = position, this._pointAtData.subPosition = subPosition, this._pointAtData.previousPointArrayIndex = parentIndex, this._pointAtData.interpolateReady = interpolateTNB, interpolateTNB && this._updateInterpolationMatrix(), this._pointAtData;}_updateInterpolationMatrix() {this._pointAtData.interpolationMatrix = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.Identity */ .y3.Identity();const parentIndex = this._pointAtData.previousPointArrayIndex;if (parentIndex !== this._tangents.length - 1) {const index = parentIndex + 1,tangentFrom = this._tangents[parentIndex].clone(),normalFrom = this._normals[parentIndex].clone(),binormalFrom = this._binormals[parentIndex].clone(),tangentTo = this._tangents[index].clone(),normalTo = this._normals[index].clone(),binormalTo = this._binormals[index].clone(),quatFrom = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion.RotationQuaternionFromAxis */ ._f.RotationQuaternionFromAxis(normalFrom, binormalFrom, tangentFrom),quatTo = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion.RotationQuaternionFromAxis */ ._f.RotationQuaternionFromAxis(normalTo, binormalTo, tangentTo),quatAt = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion.Slerp */ ._f.Slerp(quatFrom, quatTo, this._pointAtData.subPosition);quatAt.toRotationMatrix(this._pointAtData.interpolationMatrix);}}}class Curve3 {static CreateQuadraticBezier(v0, v1, v2, nbPoints) {nbPoints = 2 < nbPoints ? nbPoints : 3;const bez = [],equation = (t, val0, val1, val2) => {return (1 - t) * (1 - t) * val0 + 2 * t * (1 - t) * val1 + t * t * val2;};for (let i = 0; i <= nbPoints; i++) bez.push(new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(equation(i / nbPoints, v0.x, v1.x, v2.x), equation(i / nbPoints, v0.y, v1.y, v2.y), equation(i / nbPoints, v0.z, v1.z, v2.z)));return new Curve3(bez);}static CreateCubicBezier(v0, v1, v2, v3, nbPoints) {nbPoints = 3 < nbPoints ? nbPoints : 4;const bez = [],equation = (t, val0, val1, val2, val3) => {return (1 - t) * (1 - t) * (1 - t) * val0 + 3 * t * (1 - t) * (1 - t) * val1 + 3 * t * t * (1 - t) * val2 + t * t * t * val3;};for (let i = 0; i <= nbPoints; i++) bez.push(new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(equation(i / nbPoints, v0.x, v1.x, v2.x, v3.x), equation(i / nbPoints, v0.y, v1.y, v2.y, v3.y), equation(i / nbPoints, v0.z, v1.z, v2.z, v3.z)));return new Curve3(bez);}static CreateHermiteSpline(p1, t1, p2, t2, nSeg) {const hermite = [];for (let i = 0; i <= nSeg; i++) hermite.push(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Hermite */ .P.Hermite(p1, t1, p2, t2, i * (1 / nSeg)));return new Curve3(hermite);}static CreateCatmullRomSpline(points, nbPoints, closed) {const catmullRom = [],step = 1 / nbPoints;let amount = 0;if (closed) {const pointsCount = points.length;for (let i = 0; i < pointsCount; i++) {amount = 0;for (let c = 0; c < nbPoints; c++) catmullRom.push(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.CatmullRom */ .P.CatmullRom(points[i % pointsCount], points[(i + 1) % pointsCount], points[(i + 2) % pointsCount], points[(i + 3) % pointsCount], amount)), amount += step;}catmullRom.push(catmullRom[0]);} else {const totalPoints = [];totalPoints.push(points[0].clone()), Array.prototype.push.apply(totalPoints, points), totalPoints.push(points[points.length - 1].clone());let i = 0;for (; i < totalPoints.length - 3; i++) {amount = 0;for (let c = 0; c < nbPoints; c++) catmullRom.push(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.CatmullRom */ .P.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount)), amount += step;}i--, catmullRom.push(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.CatmullRom */ .P.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount));}return new Curve3(catmullRom);}static ArcThru3Points(first, second, third, steps = 32, closed = !1, fullCircle = !1) {const arc = [],vec1 = second.subtract(first),vec2 = third.subtract(second),vec3 = first.subtract(third),zAxis = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(vec1, vec2),len4 = zAxis.length();if (len4 < Math.pow(10, -8)) return new Curve3(arc);const len1_sq = vec1.lengthSquared(),len2_sq = vec2.lengthSquared(),len3_sq = vec3.lengthSquared(),len4_sq = zAxis.lengthSquared(),len1 = vec1.length(),len2 = vec2.length(),len3 = vec3.length(),radius = .5 * len1 * len2 * len3 / len4,dot1 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Dot */ .P.Dot(vec1, vec3),dot2 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Dot */ .P.Dot(vec1, vec2),dot3 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Dot */ .P.Dot(vec2, vec3),center = first.scale(-.5 * len2_sq * dot1 / len4_sq).add(second.scale(-.5 * len3_sq * dot2 / len4_sq)).add(third.scale(-.5 * len1_sq * dot3 / len4_sq)),radiusVec = first.subtract(center),xAxis = radiusVec.normalize(),yAxis = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Cross */ .P.Cross(zAxis, xAxis).normalize();if (fullCircle) {const dStep = 2 * Math.PI / steps;for (let theta = 0; theta <= 2 * Math.PI; theta += dStep) arc.push(center.add(xAxis.scale(radius * Math.cos(theta)).add(yAxis.scale(radius * Math.sin(theta)))));arc.push(first);} else {const dStep = 1 / steps;let theta = 0,point = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero();do point = center.add(xAxis.scale(radius * Math.cos(theta)).add(yAxis.scale(radius * Math.sin(theta)))), arc.push(point), theta += dStep; while (!point.equalsWithEpsilon(third, 1.1 * (radius * dStep)));arc.push(third), closed && arc.push(first);}return new Curve3(arc);}constructor(points) {this._length = 0, this._points = points, this._length = this._computeLength(points);}getPoints() {return this._points;}length() {return this._length;}continue(curve) {const lastPoint = this._points[this._points.length - 1],continuedPoints = this._points.slice(),curvePoints = curve.getPoints();for (let i = 1; i < curvePoints.length; i++) continuedPoints.push(curvePoints[i].subtract(curvePoints[0]).add(lastPoint));const continuedCurve = new Curve3(continuedPoints);return continuedCurve;}_computeLength(path) {let l = 0;for (let i = 1; i < path.length; i++) l += path[i].subtract(path[i - 1]).length();return l;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.plane.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "J": () => (/* binding */ Plane)
/* harmony export */ });
/* harmony import */ var _math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
class Plane {constructor(a, b, c, d) {this.normal = new _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(a, b, c), this.d = d;}asArray() {return [this.normal.x, this.normal.y, this.normal.z, this.d];}clone() {return new Plane(this.normal.x, this.normal.y, this.normal.z, this.d);}getClassName() {return "Plane";}getHashCode() {let hash = this.normal.getHashCode();return hash = 397 * hash ^ (0 | this.d), hash;}normalize() {const norm = Math.sqrt(this.normal.x * this.normal.x + this.normal.y * this.normal.y + this.normal.z * this.normal.z);let magnitude = 0;return 0 !== norm && (magnitude = 1 / norm), this.normal.x *= magnitude, this.normal.y *= magnitude, this.normal.z *= magnitude, this.d *= magnitude, this;}transform(transformation) {const invertedMatrix = Plane._TmpMatrix;transformation.invertToRef(invertedMatrix);const m = invertedMatrix.m,x = this.normal.x,y = this.normal.y,z = this.normal.z,d = this.d,normalX = x * m[0] + y * m[1] + z * m[2] + d * m[3],normalY = x * m[4] + y * m[5] + z * m[6] + d * m[7],normalZ = x * m[8] + y * m[9] + z * m[10] + d * m[11],finalD = x * m[12] + y * m[13] + z * m[14] + d * m[15];return new Plane(normalX, normalY, normalZ, finalD);}dotCoordinate(point) {return this.normal.x * point.x + this.normal.y * point.y + this.normal.z * point.z + this.d;}copyFromPoints(point1, point2, point3) {const x1 = point2.x - point1.x,y1 = point2.y - point1.y,z1 = point2.z - point1.z,x2 = point3.x - point1.x,y2 = point3.y - point1.y,z2 = point3.z - point1.z,yz = y1 * z2 - z1 * y2,xz = z1 * x2 - x1 * z2,xy = x1 * y2 - y1 * x2,pyth = Math.sqrt(yz * yz + xz * xz + xy * xy);let invPyth;return invPyth = 0 === pyth ? 0 : 1 / pyth, this.normal.x = yz * invPyth, this.normal.y = xz * invPyth, this.normal.z = xy * invPyth, this.d = -(this.normal.x * point1.x + this.normal.y * point1.y + this.normal.z * point1.z), this;}isFrontFacingTo(direction, epsilon) {const dot = _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Dot */ .P.Dot(this.normal, direction);return dot <= epsilon;}signedDistanceTo(point) {return _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Dot */ .P.Dot(point, this.normal) + this.d;}static FromArray(array) {return new Plane(array[0], array[1], array[2], array[3]);}static FromPoints(point1, point2, point3) {const result = new Plane(0, 0, 0, 0);return result.copyFromPoints(point1, point2, point3), result;}static FromPositionAndNormal(origin, normal) {const result = new Plane(0, 0, 0, 0);return normal.normalize(), result.normal = normal, result.d = -(normal.x * origin.x + normal.y * origin.y + normal.z * origin.z), result;}static SignedDistanceToPlaneFromPositionAndNormal(origin, normal, point) {const d = -(normal.x * origin.x + normal.y * origin.y + normal.z * origin.z);return _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Dot */ .P.Dot(point, normal) + d;}}Plane._TmpMatrix = _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix.Identity */ .y3.Identity();

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.scalar.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "R": () => (/* binding */ Scalar)
/* harmony export */ });
class Scalar {static WithinEpsilon(a, b, epsilon = 1401298e-51) {return Math.abs(a - b) <= epsilon;}static ToHex(i) {const str = i.toString(16);return 15 >= i ? ("0" + str).toUpperCase() : str.toUpperCase();}static Sign(value) {return value = +value, 0 === value || isNaN(value) ? value : 0 < value ? 1 : -1;}static Clamp(value, min = 0, max = 1) {return Math.min(max, Math.max(min, value));}static Log2(value) {return Math.log(value) * Math.LOG2E;}static ILog2(value) {if (Math.log2) return Math.floor(Math.log2(value));if (0 > value) return NaN;if (0 === value) return -Infinity;let n = 0;if (1 > value) {for (; 1 > value;) n++, value *= 2;n = -n;} else if (1 < value) for (; 1 < value;) n++, value = Math.floor(value / 2);return n;}static Repeat(value, length) {return value - Math.floor(value / length) * length;}static Normalize(value, min, max) {return (value - min) / (max - min);}static Denormalize(normalized, min, max) {return normalized * (max - min) + min;}static DeltaAngle(current, target) {let num = Scalar.Repeat(target - current, 360);return 180 < num && (num -= 360), num;}static PingPong(tx, length) {const t = Scalar.Repeat(tx, 2 * length);return length - Math.abs(t - length);}static SmoothStep(from, to, tx) {let t = Scalar.Clamp(tx);return t = -2 * t * t * t + 3 * t * t, to * t + from * (1 - t);}static MoveTowards(current, target, maxDelta) {let result = 0;return result = Math.abs(target - current) <= maxDelta ? target : current + Scalar.Sign(target - current) * maxDelta, result;}static MoveTowardsAngle(current, target, maxDelta) {const num = Scalar.DeltaAngle(current, target);let result = 0;return -maxDelta < num && num < maxDelta ? result = target : (target = current + num, result = Scalar.MoveTowards(current, target, maxDelta)), result;}static Lerp(start, end, amount) {return start + (end - start) * amount;}static LerpAngle(start, end, amount) {let num = Scalar.Repeat(end - start, 360);return 180 < num && (num -= 360), start + num * Scalar.Clamp(amount);}static InverseLerp(a, b, value) {let result = 0;return result = a == b ? 0 : Scalar.Clamp((value - a) / (b - a)), result;}static Hermite(value1, tangent1, value2, tangent2, amount) {const squared = amount * amount,cubed = amount * squared;return value1 * (2 * cubed - 3 * squared + 1) + value2 * (-2 * cubed + 3 * squared) + tangent1 * (cubed - 2 * squared + amount) + tangent2 * (cubed - squared);}static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {const t2 = time * time;return 6 * (t2 - time) * value1 + (3 * t2 - 4 * time + 1) * tangent1 + 6 * (-t2 + time) * value2 + (3 * t2 - 2 * time) * tangent2;}static RandomRange(min, max) {return min === max ? min : Math.random() * (max - min) + min;}static RangeToPercent(number, min, max) {return (number - min) / (max - min);}static PercentToRange(percent, min, max) {return (max - min) * percent + min;}static NormalizeRadians(angle) {return angle -= Scalar.TwoPi * Math.floor((angle + Math.PI) / Scalar.TwoPi), angle;}static HCF(a, b) {const r = a % b;return 0 == r ? b : Scalar.HCF(b, r);}}Scalar.TwoPi = 2 * Math.PI;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.size.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$": () => (/* binding */ Size)
/* harmony export */ });
class Size {constructor(width, height) {this.width = width, this.height = height;}toString() {return `{W: ${this.width}, H: ${this.height}}`;}getClassName() {return "Size";}getHashCode() {let hash = 0 | this.width;return hash = 397 * hash ^ (0 | this.height), hash;}copyFrom(src) {this.width = src.width, this.height = src.height;}copyFromFloats(width, height) {return this.width = width, this.height = height, this;}set(width, height) {return this.copyFromFloats(width, height);}multiplyByFloats(w, h) {return new Size(this.width * w, this.height * h);}clone() {return new Size(this.width, this.height);}equals(other) {return !!other && this.width === other.width && this.height === other.height;}get surface() {return this.width * this.height;}static Zero() {return new Size(0, 0);}add(otherSize) {const r = new Size(this.width + otherSize.width, this.height + otherSize.height);return r;}subtract(otherSize) {const r = new Size(this.width - otherSize.width, this.height - otherSize.height);return r;}static Lerp(start, end, amount) {const w = start.width + (end.width - start.width) * amount,h = start.height + (end.height - start.height) * amount;return new Size(w, h);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.vector.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FM": () => (/* binding */ Vector2),
/* harmony export */   "Lt": () => (/* binding */ Vector4),
/* harmony export */   "P": () => (/* binding */ Vector3),
/* harmony export */   "_f": () => (/* binding */ Quaternion),
/* harmony export */   "jp": () => (/* binding */ TmpVectors),
/* harmony export */   "y3": () => (/* binding */ Matrix)
/* harmony export */ });
/* harmony import */ var _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
/* harmony import */ var _math_constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.constants.js");
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/arrayTools.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
/* harmony import */ var _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/performanceConfigurator.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
const _ExtractAsInt = (value) => parseInt(value.toString().replace(/\W/g, ""));class Vector2 {constructor(x = 0, y = 0) {this.x = x, this.y = y;}toString() {return `{X: ${this.x} Y: ${this.y}}`;}getClassName() {return "Vector2";}getHashCode() {const x = _ExtractAsInt(this.x),y = _ExtractAsInt(this.y);let hash = x;return hash = 397 * hash ^ y, hash;}toArray(array, index = 0) {return array[index] = this.x, array[index + 1] = this.y, this;}fromArray(array, index = 0) {return Vector2.FromArrayToRef(array, index, this), this;}asArray() {const result = [];return this.toArray(result, 0), result;}copyFrom(source) {return this.x = source.x, this.y = source.y, this;}copyFromFloats(x, y) {return this.x = x, this.y = y, this;}set(x, y) {return this.copyFromFloats(x, y);}add(otherVector) {return new this.constructor(this.x + otherVector.x, this.y + otherVector.y);}addToRef(otherVector, result) {return result.x = this.x + otherVector.x, result.y = this.y + otherVector.y, result;}addInPlace(otherVector) {return this.x += otherVector.x, this.y += otherVector.y, this;}addVector3(otherVector) {return new this.constructor(this.x + otherVector.x, this.y + otherVector.y);}subtract(otherVector) {return new this.constructor(this.x - otherVector.x, this.y - otherVector.y);}subtractToRef(otherVector, result) {return result.x = this.x - otherVector.x, result.y = this.y - otherVector.y, result;}subtractInPlace(otherVector) {return this.x -= otherVector.x, this.y -= otherVector.y, this;}multiplyInPlace(otherVector) {return this.x *= otherVector.x, this.y *= otherVector.y, this;}multiply(otherVector) {return new this.constructor(this.x * otherVector.x, this.y * otherVector.y);}multiplyToRef(otherVector, result) {return result.x = this.x * otherVector.x, result.y = this.y * otherVector.y, result;}multiplyByFloats(x, y) {return new this.constructor(this.x * x, this.y * y);}divide(otherVector) {return new this.constructor(this.x / otherVector.x, this.y / otherVector.y);}divideToRef(otherVector, result) {return result.x = this.x / otherVector.x, result.y = this.y / otherVector.y, result;}divideInPlace(otherVector) {return this.divideToRef(otherVector, this);}negate() {return new this.constructor(-this.x, -this.y);}negateInPlace() {return this.x *= -1, this.y *= -1, this;}negateToRef(result) {return result.copyFromFloats(-1 * this.x, -1 * this.y);}scaleInPlace(scale) {return this.x *= scale, this.y *= scale, this;}scale(scale) {const result = new this.constructor(0, 0);return this.scaleToRef(scale, result), result;}scaleToRef(scale, result) {return result.x = this.x * scale, result.y = this.y * scale, result;}scaleAndAddToRef(scale, result) {return result.x += this.x * scale, result.y += this.y * scale, result;}equals(otherVector) {return otherVector && this.x === otherVector.x && this.y === otherVector.y;}equalsWithEpsilon(otherVector, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) {return otherVector && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this.x, otherVector.x, epsilon) && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this.y, otherVector.y, epsilon);}floor() {return new this.constructor(Math.floor(this.x), Math.floor(this.y));}fract() {return new this.constructor(this.x - Math.floor(this.x), this.y - Math.floor(this.y));}rotateToRef(angle, result) {const cos = Math.cos(angle),sin = Math.sin(angle);return result.x = cos * this.x - sin * this.y, result.y = sin * this.x + cos * this.y, result;}length() {return Math.sqrt(this.x * this.x + this.y * this.y);}lengthSquared() {return this.x * this.x + this.y * this.y;}normalize() {return Vector2.NormalizeToRef(this, this), this;}clone() {return new this.constructor(this.x, this.y);}static Zero() {return new Vector2(0, 0);}static One() {return new Vector2(1, 1);}static Random(min = 0, max = 1) {return new Vector2(_math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.RandomRange */ .R.RandomRange(min, max), _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.RandomRange */ .R.RandomRange(min, max));}static get ZeroReadOnly() {return Vector2._ZeroReadOnly;}static FromArray(array, offset = 0) {return new Vector2(array[offset], array[offset + 1]);}static FromArrayToRef(array, offset, result) {return result.x = array[offset], result.y = array[offset + 1], result;}static CatmullRom(value1, value2, value3, value4, amount) {const squared = amount * amount,cubed = amount * squared,x = .5 * (2 * value2.x + (-value1.x + value3.x) * amount + (2 * value1.x - 5 * value2.x + 4 * value3.x - value4.x) * squared + (-value1.x + 3 * value2.x - 3 * value3.x + value4.x) * cubed),y = .5 * (2 * value2.y + (-value1.y + value3.y) * amount + (2 * value1.y - 5 * value2.y + 4 * value3.y - value4.y) * squared + (-value1.y + 3 * value2.y - 3 * value3.y + value4.y) * cubed);return new value1.constructor(x, y);}static Clamp(value, min, max) {let x = value.x;x = x > max.x ? max.x : x, x = x < min.x ? min.x : x;let y = value.y;return y = y > max.y ? max.y : y, y = y < min.y ? min.y : y, new value.constructor(x, y);}static Hermite(value1, tangent1, value2, tangent2, amount) {const squared = amount * amount,cubed = amount * squared,part1 = 2 * cubed - 3 * squared + 1,part2 = -2 * cubed + 3 * squared,part3 = cubed - 2 * squared + amount,part4 = cubed - squared,x = value1.x * part1 + value2.x * part2 + tangent1.x * part3 + tangent2.x * part4,y = value1.y * part1 + value2.y * part2 + tangent1.y * part3 + tangent2.y * part4;return new value1.constructor(x, y);}static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {const result = new value1.constructor();return this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result), result;}static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {const t2 = time * time;return result.x = 6 * (t2 - time) * value1.x + (3 * t2 - 4 * time + 1) * tangent1.x + 6 * (-t2 + time) * value2.x + (3 * t2 - 2 * time) * tangent2.x, result.y = 6 * (t2 - time) * value1.y + (3 * t2 - 4 * time + 1) * tangent1.y + 6 * (-t2 + time) * value2.y + (3 * t2 - 2 * time) * tangent2.y, result;}static Lerp(start, end, amount) {const x = start.x + (end.x - start.x) * amount,y = start.y + (end.y - start.y) * amount;return new start.constructor(x, y);}static Dot(left, right) {return left.x * right.x + left.y * right.y;}static Normalize(vector) {const newVector = new vector.constructor();return this.NormalizeToRef(vector, newVector), newVector;}static NormalizeToRef(vector, result) {const len = vector.length();return 0 === len ? result : (result.x = vector.x / len, result.y = vector.y / len, result);}static Minimize(left, right) {const x = left.x < right.x ? left.x : right.x,y = left.y < right.y ? left.y : right.y;return new left.constructor(x, y);}static Maximize(left, right) {const x = left.x > right.x ? left.x : right.x,y = left.y > right.y ? left.y : right.y;return new left.constructor(x, y);}static Transform(vector, transformation) {const result = new vector.constructor();return Vector2.TransformToRef(vector, transformation, result), result;}static TransformToRef(vector, transformation, result) {const m = transformation.m,x = vector.x * m[0] + vector.y * m[4] + m[12],y = vector.x * m[1] + vector.y * m[5] + m[13];return result.x = x, result.y = y, result;}static PointInTriangle(p, p0, p1, p2) {const a = 1 / 2 * (-p1.y * p2.x + p0.y * (-p1.x + p2.x) + p0.x * (p1.y - p2.y) + p1.x * p2.y),sign = 0 > a ? -1 : 1,s = (p0.y * p2.x - p0.x * p2.y + (p2.y - p0.y) * p.x + (p0.x - p2.x) * p.y) * sign,t = (p0.x * p1.y - p0.y * p1.x + (p0.y - p1.y) * p.x + (p1.x - p0.x) * p.y) * sign;return 0 < s && 0 < t && s + t < 2 * a * sign;}static Distance(value1, value2) {return Math.sqrt(Vector2.DistanceSquared(value1, value2));}static DistanceSquared(value1, value2) {const x = value1.x - value2.x,y = value1.y - value2.y;return x * x + y * y;}static Center(value1, value2) {const result = new value1.constructor();return Vector2.CenterToRef(value1, value2, result);}static CenterToRef(value1, value2, ref) {return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2);}static DistanceOfPointFromSegment(p, segA, segB) {const l2 = Vector2.DistanceSquared(segA, segB);if (0 === l2) return Vector2.Distance(p, segA);const v = segB.subtract(segA),t = Math.max(0, Math.min(1, Vector2.Dot(p.subtract(segA), v) / l2)),proj = segA.add(v.multiplyByFloats(t, t));return Vector2.Distance(p, proj);}}Vector2._ZeroReadOnly = Vector2.Zero();class Vector3 {get x() {return this._x;}set x(value) {this._x = value, this._isDirty = !0;}get y() {return this._y;}set y(value) {this._y = value, this._isDirty = !0;}get z() {return this._z;}set z(value) {this._z = value, this._isDirty = !0;}constructor(x = 0, y = 0, z = 0) {this._isDirty = !0, this._x = x, this._y = y, this._z = z;}toString() {return `{X: ${this._x} Y: ${this._y} Z: ${this._z}}`;}getClassName() {return "Vector3";}getHashCode() {const x = _ExtractAsInt(this._x),y = _ExtractAsInt(this._y),z = _ExtractAsInt(this._z);let hash = x;return hash = 397 * hash ^ y, hash = 397 * hash ^ z, hash;}asArray() {const result = [];return this.toArray(result, 0), result;}toArray(array, index = 0) {return array[index] = this._x, array[index + 1] = this._y, array[index + 2] = this._z, this;}fromArray(array, index = 0) {return Vector3.FromArrayToRef(array, index, this), this;}toQuaternion() {return Quaternion.RotationYawPitchRoll(this._y, this._x, this._z);}addInPlace(otherVector) {return this.addInPlaceFromFloats(otherVector._x, otherVector._y, otherVector._z);}addInPlaceFromFloats(x, y, z) {return this._x += x, this._y += y, this._z += z, this._isDirty = !0, this;}add(otherVector) {return new this.constructor(this._x + otherVector._x, this._y + otherVector._y, this._z + otherVector._z);}addToRef(otherVector, result) {return result.copyFromFloats(this._x + otherVector._x, this._y + otherVector._y, this._z + otherVector._z);}subtractInPlace(otherVector) {return this._x -= otherVector._x, this._y -= otherVector._y, this._z -= otherVector._z, this._isDirty = !0, this;}subtract(otherVector) {return new this.constructor(this._x - otherVector._x, this._y - otherVector._y, this._z - otherVector._z);}subtractToRef(otherVector, result) {return this.subtractFromFloatsToRef(otherVector._x, otherVector._y, otherVector._z, result);}subtractFromFloats(x, y, z) {return new this.constructor(this._x - x, this._y - y, this._z - z);}subtractFromFloatsToRef(x, y, z, result) {return result.copyFromFloats(this._x - x, this._y - y, this._z - z);}negate() {return new this.constructor(-this._x, -this._y, -this._z);}negateInPlace() {return this._x *= -1, this._y *= -1, this._z *= -1, this._isDirty = !0, this;}negateToRef(result) {return result.copyFromFloats(-1 * this._x, -1 * this._y, -1 * this._z);}scaleInPlace(scale) {return this._x *= scale, this._y *= scale, this._z *= scale, this._isDirty = !0, this;}scale(scale) {return new this.constructor(this._x * scale, this._y * scale, this._z * scale);}scaleToRef(scale, result) {return result.copyFromFloats(this._x * scale, this._y * scale, this._z * scale);}getNormalToRef(result) {const radius = this.length();let theta = Math.acos(this.y / radius);const phi = Math.atan2(this.z, this.x);theta > Math.PI / 2 ? theta -= Math.PI / 2 : theta += Math.PI / 2;const x = radius * Math.sin(theta) * Math.cos(phi),y = radius * Math.cos(theta),z = radius * Math.sin(theta) * Math.sin(phi);return result.set(x, y, z), result;}applyRotationQuaternionToRef(q, result) {const ix = q._w * this._x + q._y * this._z - q._z * this._y,iy = q._w * this._y + q._z * this._x - q._x * this._z,iz = q._w * this._z + q._x * this._y - q._y * this._x,iw = -q._x * this._x - q._y * this._y - q._z * this._z;return result._x = ix * q._w + iw * -q._x + iy * -q._z - iz * -q._y, result._y = iy * q._w + iw * -q._y + iz * -q._x - ix * -q._z, result._z = iz * q._w + iw * -q._z + ix * -q._y - iy * -q._x, result._isDirty = !0, result;}applyRotationQuaternionInPlace(q) {return this.applyRotationQuaternionToRef(q, this);}applyRotationQuaternion(q) {return this.applyRotationQuaternionToRef(q, new this.constructor());}scaleAndAddToRef(scale, result) {return result.addInPlaceFromFloats(this._x * scale, this._y * scale, this._z * scale);}projectOnPlane(plane, origin) {const result = new this.constructor();return this.projectOnPlaneToRef(plane, origin, result), result;}projectOnPlaneToRef(plane, origin, result) {const n = plane.normal,d = plane.d,V = MathTmp.Vector3[0];this.subtractToRef(origin, V), V.normalize();const denom = Vector3.Dot(V, n);if (Math.abs(denom) < Math.pow(10, -10)) result.setAll(1 / 0);else {const t = -(Vector3.Dot(origin, n) + d) / denom,scaledV = V.scaleInPlace(t);origin.addToRef(scaledV, result);}return result;}equals(otherVector) {return otherVector && this._x === otherVector._x && this._y === otherVector._y && this._z === otherVector._z;}equalsWithEpsilon(otherVector, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) {return otherVector && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this._x, otherVector._x, epsilon) && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this._y, otherVector._y, epsilon) && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this._z, otherVector._z, epsilon);}equalsToFloats(x, y, z) {return this._x === x && this._y === y && this._z === z;}multiplyInPlace(otherVector) {return this._x *= otherVector._x, this._y *= otherVector._y, this._z *= otherVector._z, this._isDirty = !0, this;}multiply(otherVector) {return this.multiplyByFloats(otherVector._x, otherVector._y, otherVector._z);}multiplyToRef(otherVector, result) {return result.copyFromFloats(this._x * otherVector._x, this._y * otherVector._y, this._z * otherVector._z);}multiplyByFloats(x, y, z) {return new this.constructor(this._x * x, this._y * y, this._z * z);}divide(otherVector) {return new this.constructor(this._x / otherVector._x, this._y / otherVector._y, this._z / otherVector._z);}divideToRef(otherVector, result) {return result.copyFromFloats(this._x / otherVector._x, this._y / otherVector._y, this._z / otherVector._z);}divideInPlace(otherVector) {return this.divideToRef(otherVector, this);}minimizeInPlace(other) {return this.minimizeInPlaceFromFloats(other._x, other._y, other._z);}maximizeInPlace(other) {return this.maximizeInPlaceFromFloats(other._x, other._y, other._z);}minimizeInPlaceFromFloats(x, y, z) {return x < this._x && (this.x = x), y < this._y && (this.y = y), z < this._z && (this.z = z), this;}maximizeInPlaceFromFloats(x, y, z) {return x > this._x && (this.x = x), y > this._y && (this.y = y), z > this._z && (this.z = z), this;}isNonUniformWithinEpsilon(epsilon) {const absX = Math.abs(this._x),absY = Math.abs(this._y);if (!_math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(absX, absY, epsilon)) return !0;const absZ = Math.abs(this._z);return !_math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(absX, absZ, epsilon) || !_math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(absY, absZ, epsilon);}get isNonUniform() {const absX = Math.abs(this._x),absY = Math.abs(this._y);if (absX !== absY) return !0;const absZ = Math.abs(this._z);return absX !== absZ;}floor() {return new this.constructor(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));}fract() {return new this.constructor(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z));}length() {return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z);}lengthSquared() {return this._x * this._x + this._y * this._y + this._z * this._z;}get hasAZeroComponent() {return 0 == this._x * this._y * this._z;}normalize() {return this.normalizeFromLength(this.length());}reorderInPlace(order) {return (order = order.toLowerCase(), "xyz" === order) ? this : (MathTmp.Vector3[0].copyFrom(this), ["x", "y", "z"].forEach((val, i) => {this[val] = MathTmp.Vector3[0][order[i]];}), this);}rotateByQuaternionToRef(quaternion, result) {return quaternion.toRotationMatrix(MathTmp.Matrix[0]), Vector3.TransformCoordinatesToRef(this, MathTmp.Matrix[0], result), result;}rotateByQuaternionAroundPointToRef(quaternion, point, result) {return this.subtractToRef(point, MathTmp.Vector3[0]), MathTmp.Vector3[0].rotateByQuaternionToRef(quaternion, MathTmp.Vector3[0]), point.addToRef(MathTmp.Vector3[0], result), result;}cross(other) {const result = new this.constructor();return Vector3.CrossToRef(this, other, result);}normalizeFromLength(len) {return 0 === len || 1 === len ? this : this.scaleInPlace(1 / len);}normalizeToNew() {const normalized = new this.constructor(0, 0, 0);return this.normalizeToRef(normalized), normalized;}normalizeToRef(reference) {const len = this.length();return 0 === len || 1 === len ? reference.copyFromFloats(this._x, this._y, this._z) : this.scaleToRef(1 / len, reference);}clone() {return new this.constructor(this._x, this._y, this._z);}copyFrom(source) {return this.copyFromFloats(source._x, source._y, source._z);}copyFromFloats(x, y, z) {return this._x = x, this._y = y, this._z = z, this._isDirty = !0, this;}set(x, y, z) {return this.copyFromFloats(x, y, z);}setAll(v) {return this._x = this._y = this._z = v, this._isDirty = !0, this;}static GetClipFactor(vector0, vector1, axis, size) {const d0 = Vector3.Dot(vector0, axis) - size,d1 = Vector3.Dot(vector1, axis) - size;return d0 / (d0 - d1);}static GetAngleBetweenVectors(vector0, vector1, normal) {const v0 = vector0.normalizeToRef(MathTmp.Vector3[1]),v1 = vector1.normalizeToRef(MathTmp.Vector3[2]);let dot = Vector3.Dot(v0, v1);dot = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(dot, -1, 1);const angle = Math.acos(dot),n = MathTmp.Vector3[3];return Vector3.CrossToRef(v0, v1, n), 0 < Vector3.Dot(n, normal) ? isNaN(angle) ? 0 : angle : isNaN(angle) ? -Math.PI : -Math.acos(dot);}static GetAngleBetweenVectorsOnPlane(vector0, vector1, normal) {MathTmp.Vector3[0].copyFrom(vector0);const v0 = MathTmp.Vector3[0];MathTmp.Vector3[1].copyFrom(vector1);const v1 = MathTmp.Vector3[1];MathTmp.Vector3[2].copyFrom(normal);const vNormal = MathTmp.Vector3[2],right = MathTmp.Vector3[3],forward = MathTmp.Vector3[4];v0.normalize(), v1.normalize(), vNormal.normalize(), Vector3.CrossToRef(vNormal, v0, right), Vector3.CrossToRef(right, vNormal, forward);const angle = Math.atan2(Vector3.Dot(v1, right), Vector3.Dot(v1, forward));return _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.NormalizeRadians */ .R.NormalizeRadians(angle);}static PitchYawRollToMoveBetweenPointsToRef(start, target, ref) {const diff = TmpVectors.Vector3[0];return target.subtractToRef(start, diff), ref._y = Math.atan2(diff.x, diff.z) || 0, ref._x = Math.atan2(Math.sqrt(diff.x ** 2 + diff.z ** 2), diff.y) || 0, ref._z = 0, ref._isDirty = !0, ref;}static PitchYawRollToMoveBetweenPoints(start, target) {const ref = Vector3.Zero();return Vector3.PitchYawRollToMoveBetweenPointsToRef(start, target, ref);}static SlerpToRef(vector0, vector1, slerp, result) {slerp = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(slerp, 0, 1);const vector0Dir = MathTmp.Vector3[0],vector1Dir = MathTmp.Vector3[1];vector0Dir.copyFrom(vector0);const vector0Length = vector0Dir.length();vector0Dir.normalizeFromLength(vector0Length), vector1Dir.copyFrom(vector1);const vector1Length = vector1Dir.length();vector1Dir.normalizeFromLength(vector1Length);const dot = Vector3.Dot(vector0Dir, vector1Dir);let scale0, scale1;if (dot < 1 - _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) {const omega = Math.acos(dot),invSin = 1 / Math.sin(omega);scale0 = Math.sin((1 - slerp) * omega) * invSin, scale1 = Math.sin(slerp * omega) * invSin;} else scale0 = 1 - slerp, scale1 = slerp;return vector0Dir.scaleInPlace(scale0), vector1Dir.scaleInPlace(scale1), result.copyFrom(vector0Dir).addInPlace(vector1Dir), result.scaleInPlace(_math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Lerp */ .R.Lerp(vector0Length, vector1Length, slerp)), result;}static SmoothToRef(source, goal, deltaTime, lerpTime, result) {return Vector3.SlerpToRef(source, goal, 0 === lerpTime ? 1 : deltaTime / lerpTime, result), result;}static FromArray(array, offset = 0) {return new Vector3(array[offset], array[offset + 1], array[offset + 2]);}static FromFloatArray(array, offset) {return Vector3.FromArray(array, offset);}static FromArrayToRef(array, offset, result) {return result._x = array[offset], result._y = array[offset + 1], result._z = array[offset + 2], result._isDirty = !0, result;}static FromFloatArrayToRef(array, offset, result) {return Vector3.FromArrayToRef(array, offset, result);}static FromFloatsToRef(x, y, z, result) {return result.copyFromFloats(x, y, z), result;}static Zero() {return new Vector3(0, 0, 0);}static One() {return new Vector3(1, 1, 1);}static Up() {return new Vector3(0, 1, 0);}static get UpReadOnly() {return Vector3._UpReadOnly;}static get DownReadOnly() {return Vector3._DownReadOnly;}static get RightReadOnly() {return Vector3._RightReadOnly;}static get LeftReadOnly() {return Vector3._LeftReadOnly;}static get LeftHandedForwardReadOnly() {return Vector3._LeftHandedForwardReadOnly;}static get RightHandedForwardReadOnly() {return Vector3._RightHandedForwardReadOnly;}static get ZeroReadOnly() {return Vector3._ZeroReadOnly;}static Down() {return new Vector3(0, -1, 0);}static Forward(rightHandedSystem = !1) {return new Vector3(0, 0, rightHandedSystem ? -1 : 1);}static Backward(rightHandedSystem = !1) {return new Vector3(0, 0, rightHandedSystem ? 1 : -1);}static Right() {return new Vector3(1, 0, 0);}static Left() {return new Vector3(-1, 0, 0);}static Random(min = 0, max = 1) {return new Vector3(_math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.RandomRange */ .R.RandomRange(min, max), _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.RandomRange */ .R.RandomRange(min, max), _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.RandomRange */ .R.RandomRange(min, max));}static TransformCoordinates(vector, transformation) {const result = Vector3.Zero();return Vector3.TransformCoordinatesToRef(vector, transformation, result), result;}static TransformCoordinatesToRef(vector, transformation, result) {return Vector3.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result), result;}static TransformCoordinatesFromFloatsToRef(x, y, z, transformation, result) {const m = transformation.m,rx = x * m[0] + y * m[4] + z * m[8] + m[12],ry = x * m[1] + y * m[5] + z * m[9] + m[13],rz = x * m[2] + y * m[6] + z * m[10] + m[14],rw = 1 / (x * m[3] + y * m[7] + z * m[11] + m[15]);return result._x = rx * rw, result._y = ry * rw, result._z = rz * rw, result._isDirty = !0, result;}static TransformNormal(vector, transformation) {const result = Vector3.Zero();return Vector3.TransformNormalToRef(vector, transformation, result), result;}static TransformNormalToRef(vector, transformation, result) {return this.TransformNormalFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result), result;}static TransformNormalFromFloatsToRef(x, y, z, transformation, result) {const m = transformation.m;return result._x = x * m[0] + y * m[4] + z * m[8], result._y = x * m[1] + y * m[5] + z * m[9], result._z = x * m[2] + y * m[6] + z * m[10], result._isDirty = !0, result;}static CatmullRom(value1, value2, value3, value4, amount) {const squared = amount * amount,cubed = amount * squared,x = .5 * (2 * value2._x + (-value1._x + value3._x) * amount + (2 * value1._x - 5 * value2._x + 4 * value3._x - value4._x) * squared + (-value1._x + 3 * value2._x - 3 * value3._x + value4._x) * cubed),y = .5 * (2 * value2._y + (-value1._y + value3._y) * amount + (2 * value1._y - 5 * value2._y + 4 * value3._y - value4._y) * squared + (-value1._y + 3 * value2._y - 3 * value3._y + value4._y) * cubed),z = .5 * (2 * value2._z + (-value1._z + value3._z) * amount + (2 * value1._z - 5 * value2._z + 4 * value3._z - value4._z) * squared + (-value1._z + 3 * value2._z - 3 * value3._z + value4._z) * cubed);return new value1.constructor(x, y, z);}static Clamp(value, min, max) {const result = new value.constructor();return Vector3.ClampToRef(value, min, max, result), result;}static ClampToRef(value, min, max, result) {let x = value._x;x = x > max._x ? max._x : x, x = x < min._x ? min._x : x;let y = value._y;y = y > max._y ? max._y : y, y = y < min._y ? min._y : y;let z = value._z;return z = z > max._z ? max._z : z, z = z < min._z ? min._z : z, result.copyFromFloats(x, y, z), result;}static CheckExtends(v, min, max) {min.minimizeInPlace(v), max.maximizeInPlace(v);}static Hermite(value1, tangent1, value2, tangent2, amount) {const squared = amount * amount,cubed = amount * squared,part1 = 2 * cubed - 3 * squared + 1,part2 = -2 * cubed + 3 * squared,part3 = cubed - 2 * squared + amount,part4 = cubed - squared,x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4,y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4,z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4;return new value1.constructor(x, y, z);}static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {const result = new value1.constructor();return this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result), result;}static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {const t2 = time * time;return result._x = 6 * (t2 - time) * value1._x + (3 * t2 - 4 * time + 1) * tangent1._x + 6 * (-t2 + time) * value2._x + (3 * t2 - 2 * time) * tangent2._x, result._y = 6 * (t2 - time) * value1._y + (3 * t2 - 4 * time + 1) * tangent1._y + 6 * (-t2 + time) * value2._y + (3 * t2 - 2 * time) * tangent2._y, result._z = 6 * (t2 - time) * value1._z + (3 * t2 - 4 * time + 1) * tangent1._z + 6 * (-t2 + time) * value2._z + (3 * t2 - 2 * time) * tangent2._z, result._isDirty = !0, result;}static Lerp(start, end, amount) {const result = new start.constructor(0, 0, 0);return Vector3.LerpToRef(start, end, amount, result), result;}static LerpToRef(start, end, amount, result) {return result._x = start._x + (end._x - start._x) * amount, result._y = start._y + (end._y - start._y) * amount, result._z = start._z + (end._z - start._z) * amount, result._isDirty = !0, result;}static Dot(left, right) {return left._x * right._x + left._y * right._y + left._z * right._z;}static Cross(left, right) {const result = new left.constructor();return Vector3.CrossToRef(left, right, result), result;}static CrossToRef(left, right, result) {const x = left._y * right._z - left._z * right._y,y = left._z * right._x - left._x * right._z,z = left._x * right._y - left._y * right._x;return result.copyFromFloats(x, y, z), result;}static Normalize(vector) {const result = Vector3.Zero();return Vector3.NormalizeToRef(vector, result), result;}static NormalizeToRef(vector, result) {return vector.normalizeToRef(result), result;}static Project(vector, world, transform, viewport) {const result = new vector.constructor();return Vector3.ProjectToRef(vector, world, transform, viewport, result), result;}static ProjectToRef(vector, world, transform, viewport, result) {const cw = viewport.width,ch = viewport.height,cx = viewport.x,cy = viewport.y,viewportMatrix = MathTmp.Matrix[1];Matrix.FromValuesToRef(cw / 2, 0, 0, 0, 0, -ch / 2, 0, 0, 0, 0, .5, 0, cx + cw / 2, ch / 2 + cy, .5, 1, viewportMatrix);const matrix = MathTmp.Matrix[0];return world.multiplyToRef(transform, matrix), matrix.multiplyToRef(viewportMatrix, matrix), Vector3.TransformCoordinatesToRef(vector, matrix, result), result;}static Reflect(inDirection, normal) {return this.ReflectToRef(inDirection, normal, new Vector3());}static ReflectToRef(inDirection, normal, ref) {const tmp = TmpVectors.Vector3[0];return tmp.copyFrom(normal).scaleInPlace(2 * Vector3.Dot(inDirection, normal)), ref.copyFrom(inDirection).subtractInPlace(tmp);}static _UnprojectFromInvertedMatrixToRef(source, matrix, result) {Vector3.TransformCoordinatesToRef(source, matrix, result);const m = matrix.m,num = source._x * m[3] + source._y * m[7] + source._z * m[11] + m[15];return _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(num, 1) && result.scaleInPlace(1 / num), result;}static UnprojectFromTransform(source, viewportWidth, viewportHeight, world, transform) {return this.Unproject(source, viewportWidth, viewportHeight, world, transform, Matrix.IdentityReadOnly);}static Unproject(source, viewportWidth, viewportHeight, world, view, projection) {const result = new source.constructor();return Vector3.UnprojectToRef(source, viewportWidth, viewportHeight, world, view, projection, result), result;}static UnprojectToRef(source, viewportWidth, viewportHeight, world, view, projection, result) {return Vector3.UnprojectFloatsToRef(source._x, source._y, source._z, viewportWidth, viewportHeight, world, view, projection, result), result;}static UnprojectFloatsToRef(sourceX, sourceY, sourceZ, viewportWidth, viewportHeight, world, view, projection, result) {var _a;const matrix = MathTmp.Matrix[0];world.multiplyToRef(view, matrix), matrix.multiplyToRef(projection, matrix), matrix.invert();const screenSource = MathTmp.Vector3[0];return screenSource.x = 2 * (sourceX / viewportWidth) - 1, screenSource.y = -(2 * (sourceY / viewportHeight) - 1), screenSource.z = (null === (_a = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_5__/* .EngineStore.LastCreatedEngine */ .l.LastCreatedEngine) || void 0 === _a ? void 0 : _a.isNDCHalfZRange) ? sourceZ : 2 * sourceZ - 1, Vector3._UnprojectFromInvertedMatrixToRef(screenSource, matrix, result), result;}static Minimize(left, right) {const min = new left.constructor();return min.copyFrom(left), min.minimizeInPlace(right), min;}static Maximize(left, right) {const max = new left.constructor();return max.copyFrom(left), max.maximizeInPlace(right), max;}static Distance(value1, value2) {return Math.sqrt(Vector3.DistanceSquared(value1, value2));}static DistanceSquared(value1, value2) {const x = value1._x - value2._x,y = value1._y - value2._y,z = value1._z - value2._z;return x * x + y * y + z * z;}static ProjectOnTriangleToRef(vector, p0, p1, p2, ref) {const p1p0 = MathTmp.Vector3[0],p2p0 = MathTmp.Vector3[1],p2p1 = MathTmp.Vector3[2],normal = MathTmp.Vector3[3],vectorp0 = MathTmp.Vector3[4];p1.subtractToRef(p0, p1p0), p2.subtractToRef(p0, p2p0), p2.subtractToRef(p1, p2p1);const p1p0L = p1p0.length(),p2p0L = p2p0.length(),p2p1L = p2p1.length();if (p1p0L < _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn || p2p0L < _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn || p2p1L < _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) return ref.copyFrom(p0), Vector3.Distance(vector, p0);vector.subtractToRef(p0, vectorp0), Vector3.CrossToRef(p1p0, p2p0, normal);const nl = normal.length();if (nl < _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) return ref.copyFrom(p0), Vector3.Distance(vector, p0);normal.normalizeFromLength(nl);let l = vectorp0.length();if (l < _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) return ref.copyFrom(p0), 0;vectorp0.normalizeFromLength(l);const cosA = Vector3.Dot(normal, vectorp0),projVector = MathTmp.Vector3[5],proj = MathTmp.Vector3[6];projVector.copyFrom(normal).scaleInPlace(-l * cosA), proj.copyFrom(vector).addInPlace(projVector);const v0 = MathTmp.Vector3[4],v1 = MathTmp.Vector3[5],v2 = MathTmp.Vector3[7],tmp = MathTmp.Vector3[8];v0.copyFrom(p1p0).scaleInPlace(1 / p1p0L), tmp.copyFrom(p2p0).scaleInPlace(1 / p2p0L), v0.addInPlace(tmp).scaleInPlace(-1), v1.copyFrom(p1p0).scaleInPlace(-1 / p1p0L), tmp.copyFrom(p2p1).scaleInPlace(1 / p2p1L), v1.addInPlace(tmp).scaleInPlace(-1), v2.copyFrom(p2p1).scaleInPlace(-1 / p2p1L), tmp.copyFrom(p2p0).scaleInPlace(-1 / p2p0L), v2.addInPlace(tmp).scaleInPlace(-1);const projP = MathTmp.Vector3[9];let dot;projP.copyFrom(proj).subtractInPlace(p0), Vector3.CrossToRef(v0, projP, tmp), dot = Vector3.Dot(tmp, normal);const s0 = dot;projP.copyFrom(proj).subtractInPlace(p1), Vector3.CrossToRef(v1, projP, tmp), dot = Vector3.Dot(tmp, normal);const s1 = dot;projP.copyFrom(proj).subtractInPlace(p2), Vector3.CrossToRef(v2, projP, tmp), dot = Vector3.Dot(tmp, normal);const s2 = dot,edge = MathTmp.Vector3[10];let e0, e1;0 < s0 && 0 > s1 ? (edge.copyFrom(p1p0), e0 = p0, e1 = p1) : 0 < s1 && 0 > s2 ? (edge.copyFrom(p2p1), e0 = p1, e1 = p2) : (edge.copyFrom(p2p0).scaleInPlace(-1), e0 = p2, e1 = p0);const tmp2 = MathTmp.Vector3[9],tmp3 = MathTmp.Vector3[4];e0.subtractToRef(proj, tmp), e1.subtractToRef(proj, tmp2), Vector3.CrossToRef(tmp, tmp2, tmp3);const isOutside = 0 > Vector3.Dot(tmp3, normal);if (!isOutside) return ref.copyFrom(proj), Math.abs(l * cosA);const r = MathTmp.Vector3[5];Vector3.CrossToRef(edge, tmp3, r), r.normalize();const e0proj = MathTmp.Vector3[9];e0proj.copyFrom(e0).subtractInPlace(proj);const e0projL = e0proj.length();if (e0projL < _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) return ref.copyFrom(e0), Vector3.Distance(vector, e0);e0proj.normalizeFromLength(e0projL);const cosG = Vector3.Dot(r, e0proj),triProj = MathTmp.Vector3[7];triProj.copyFrom(proj).addInPlace(r.scaleInPlace(e0projL * cosG)), tmp.copyFrom(triProj).subtractInPlace(e0), l = edge.length(), edge.normalizeFromLength(l);let t = Vector3.Dot(tmp, edge) / Math.max(l, _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn);return t = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(t, 0, 1), triProj.copyFrom(e0).addInPlace(edge.scaleInPlace(t * l)), ref.copyFrom(triProj), Vector3.Distance(vector, triProj);}static Center(value1, value2) {return Vector3.CenterToRef(value1, value2, Vector3.Zero());}static CenterToRef(value1, value2, ref) {return ref.copyFromFloats((value1._x + value2._x) / 2, (value1._y + value2._y) / 2, (value1._z + value2._z) / 2);}static RotationFromAxis(axis1, axis2, axis3) {const rotation = new axis1.constructor();return Vector3.RotationFromAxisToRef(axis1, axis2, axis3, rotation), rotation;}static RotationFromAxisToRef(axis1, axis2, axis3, ref) {const quat = MathTmp.Quaternion[0];return Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat), quat.toEulerAnglesToRef(ref), ref;}}Vector3._UpReadOnly = Vector3.Up(), Vector3._DownReadOnly = Vector3.Down(), Vector3._LeftHandedForwardReadOnly = Vector3.Forward(!1), Vector3._RightHandedForwardReadOnly = Vector3.Forward(!0), Vector3._RightReadOnly = Vector3.Right(), Vector3._LeftReadOnly = Vector3.Left(), Vector3._ZeroReadOnly = Vector3.Zero();class Vector4 {constructor(x = 0, y = 0, z = 0, w = 0) {this.x = x, this.y = y, this.z = z, this.w = w;}toString() {return `{X: ${this.x} Y: ${this.y} Z: ${this.z} W: ${this.w}}`;}getClassName() {return "Vector4";}getHashCode() {const x = _ExtractAsInt(this.x),y = _ExtractAsInt(this.y),z = _ExtractAsInt(this.z),w = _ExtractAsInt(this.w);let hash = x;return hash = 397 * hash ^ y, hash = 397 * hash ^ z, hash = 397 * hash ^ w, hash;}asArray() {const result = [];return this.toArray(result, 0), result;}toArray(array, index) {return void 0 === index && (index = 0), array[index] = this.x, array[index + 1] = this.y, array[index + 2] = this.z, array[index + 3] = this.w, this;}fromArray(array, index = 0) {return Vector4.FromArrayToRef(array, index, this), this;}addInPlace(otherVector) {return this.x += otherVector.x, this.y += otherVector.y, this.z += otherVector.z, this.w += otherVector.w, this;}add(otherVector) {return new this.constructor(this.x + otherVector.x, this.y + otherVector.y, this.z + otherVector.z, this.w + otherVector.w);}addToRef(otherVector, result) {return result.x = this.x + otherVector.x, result.y = this.y + otherVector.y, result.z = this.z + otherVector.z, result.w = this.w + otherVector.w, result;}subtractInPlace(otherVector) {return this.x -= otherVector.x, this.y -= otherVector.y, this.z -= otherVector.z, this.w -= otherVector.w, this;}subtract(otherVector) {return new this.constructor(this.x - otherVector.x, this.y - otherVector.y, this.z - otherVector.z, this.w - otherVector.w);}subtractToRef(otherVector, result) {return result.x = this.x - otherVector.x, result.y = this.y - otherVector.y, result.z = this.z - otherVector.z, result.w = this.w - otherVector.w, result;}subtractFromFloats(x, y, z, w) {return new this.constructor(this.x - x, this.y - y, this.z - z, this.w - w);}subtractFromFloatsToRef(x, y, z, w, result) {return result.x = this.x - x, result.y = this.y - y, result.z = this.z - z, result.w = this.w - w, result;}negate() {return new this.constructor(-this.x, -this.y, -this.z, -this.w);}negateInPlace() {return this.x *= -1, this.y *= -1, this.z *= -1, this.w *= -1, this;}negateToRef(result) {return result.copyFromFloats(-1 * this.x, -1 * this.y, -1 * this.z, -1 * this.w);}scaleInPlace(scale) {return this.x *= scale, this.y *= scale, this.z *= scale, this.w *= scale, this;}scale(scale) {return new this.constructor(this.x * scale, this.y * scale, this.z * scale, this.w * scale);}scaleToRef(scale, result) {return result.x = this.x * scale, result.y = this.y * scale, result.z = this.z * scale, result.w = this.w * scale, result;}scaleAndAddToRef(scale, result) {return result.x += this.x * scale, result.y += this.y * scale, result.z += this.z * scale, result.w += this.w * scale, result;}equals(otherVector) {return otherVector && this.x === otherVector.x && this.y === otherVector.y && this.z === otherVector.z && this.w === otherVector.w;}equalsWithEpsilon(otherVector, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) {return otherVector && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this.x, otherVector.x, epsilon) && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this.y, otherVector.y, epsilon) && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this.z, otherVector.z, epsilon) && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this.w, otherVector.w, epsilon);}equalsToFloats(x, y, z, w) {return this.x === x && this.y === y && this.z === z && this.w === w;}multiplyInPlace(otherVector) {return this.x *= otherVector.x, this.y *= otherVector.y, this.z *= otherVector.z, this.w *= otherVector.w, this;}multiply(otherVector) {return new this.constructor(this.x * otherVector.x, this.y * otherVector.y, this.z * otherVector.z, this.w * otherVector.w);}multiplyToRef(otherVector, result) {return result.x = this.x * otherVector.x, result.y = this.y * otherVector.y, result.z = this.z * otherVector.z, result.w = this.w * otherVector.w, result;}multiplyByFloats(x, y, z, w) {return new this.constructor(this.x * x, this.y * y, this.z * z, this.w * w);}divide(otherVector) {return new this.constructor(this.x / otherVector.x, this.y / otherVector.y, this.z / otherVector.z, this.w / otherVector.w);}divideToRef(otherVector, result) {return result.x = this.x / otherVector.x, result.y = this.y / otherVector.y, result.z = this.z / otherVector.z, result.w = this.w / otherVector.w, result;}divideInPlace(otherVector) {return this.divideToRef(otherVector, this);}minimizeInPlace(other) {return other.x < this.x && (this.x = other.x), other.y < this.y && (this.y = other.y), other.z < this.z && (this.z = other.z), other.w < this.w && (this.w = other.w), this;}maximizeInPlace(other) {return other.x > this.x && (this.x = other.x), other.y > this.y && (this.y = other.y), other.z > this.z && (this.z = other.z), other.w > this.w && (this.w = other.w), this;}floor() {return new this.constructor(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));}fract() {return new this.constructor(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w));}length() {return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);}lengthSquared() {return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;}normalize() {const len = this.length();return 0 === len ? this : this.scaleInPlace(1 / len);}toVector3() {return new Vector3(this.x, this.y, this.z);}clone() {return new this.constructor(this.x, this.y, this.z, this.w);}copyFrom(source) {return this.x = source.x, this.y = source.y, this.z = source.z, this.w = source.w, this;}copyFromFloats(x, y, z, w) {return this.x = x, this.y = y, this.z = z, this.w = w, this;}set(x, y, z, w) {return this.copyFromFloats(x, y, z, w);}setAll(v) {return this.x = this.y = this.z = this.w = v, this;}static FromArray(array, offset) {return offset || (offset = 0), new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);}static FromArrayToRef(array, offset, result) {return result.x = array[offset], result.y = array[offset + 1], result.z = array[offset + 2], result.w = array[offset + 3], result;}static FromFloatArrayToRef(array, offset, result) {return Vector4.FromArrayToRef(array, offset, result), result;}static FromFloatsToRef(x, y, z, w, result) {return result.x = x, result.y = y, result.z = z, result.w = w, result;}static Zero() {return new Vector4(0, 0, 0, 0);}static One() {return new Vector4(1, 1, 1, 1);}static Random(min = 0, max = 1) {return new Vector4(_math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.RandomRange */ .R.RandomRange(min, max), _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.RandomRange */ .R.RandomRange(min, max), _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.RandomRange */ .R.RandomRange(min, max), _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.RandomRange */ .R.RandomRange(min, max));}static get ZeroReadOnly() {return Vector4._ZeroReadOnly;}static Normalize(vector) {const result = Vector4.Zero();return Vector4.NormalizeToRef(vector, result), result;}static NormalizeToRef(vector, result) {return result.copyFrom(vector), result.normalize(), result;}static Minimize(left, right) {const min = new left.constructor();return min.copyFrom(left), min.minimizeInPlace(right), min;}static Maximize(left, right) {const max = new left.constructor();return max.copyFrom(left), max.maximizeInPlace(right), max;}static Distance(value1, value2) {return Math.sqrt(Vector4.DistanceSquared(value1, value2));}static DistanceSquared(value1, value2) {const x = value1.x - value2.x,y = value1.y - value2.y,z = value1.z - value2.z,w = value1.w - value2.w;return x * x + y * y + z * z + w * w;}static Center(value1, value2) {return Vector4.CenterToRef(value1, value2, Vector4.Zero());}static CenterToRef(value1, value2, ref) {return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2, (value1.z + value2.z) / 2, (value1.w + value2.w) / 2);}static TransformCoordinates(vector, transformation) {const result = Vector4.Zero();return Vector4.TransformCoordinatesToRef(vector, transformation, result), result;}static TransformCoordinatesToRef(vector, transformation, result) {return Vector4.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result), result;}static TransformCoordinatesFromFloatsToRef(x, y, z, transformation, result) {const m = transformation.m,rx = x * m[0] + y * m[4] + z * m[8] + m[12],ry = x * m[1] + y * m[5] + z * m[9] + m[13],rz = x * m[2] + y * m[6] + z * m[10] + m[14],rw = x * m[3] + y * m[7] + z * m[11] + m[15];return result.x = rx, result.y = ry, result.z = rz, result.w = rw, result;}static TransformNormal(vector, transformation) {const result = new vector.constructor();return Vector4.TransformNormalToRef(vector, transformation, result), result;}static TransformNormalToRef(vector, transformation, result) {const m = transformation.m,x = vector.x * m[0] + vector.y * m[4] + vector.z * m[8],y = vector.x * m[1] + vector.y * m[5] + vector.z * m[9],z = vector.x * m[2] + vector.y * m[6] + vector.z * m[10];return result.x = x, result.y = y, result.z = z, result.w = vector.w, result;}static TransformNormalFromFloatsToRef(x, y, z, w, transformation, result) {const m = transformation.m;return result.x = x * m[0] + y * m[4] + z * m[8], result.y = x * m[1] + y * m[5] + z * m[9], result.z = x * m[2] + y * m[6] + z * m[10], result.w = w, result;}static FromVector3(source, w = 0) {return new Vector4(source._x, source._y, source._z, w);}}Vector4._ZeroReadOnly = Vector4.Zero();class Quaternion {get x() {return this._x;}set x(value) {this._x = value, this._isDirty = !0;}get y() {return this._y;}set y(value) {this._y = value, this._isDirty = !0;}get z() {return this._z;}set z(value) {this._z = value, this._isDirty = !0;}get w() {return this._w;}set w(value) {this._w = value, this._isDirty = !0;}constructor(x = 0, y = 0, z = 0, w = 1) {this._isDirty = !0, this._x = x, this._y = y, this._z = z, this._w = w;}toString() {return `{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`;}getClassName() {return "Quaternion";}getHashCode() {const x = _ExtractAsInt(this._x),y = _ExtractAsInt(this._y),z = _ExtractAsInt(this._z),w = _ExtractAsInt(this._w);let hash = x;return hash = 397 * hash ^ y, hash = 397 * hash ^ z, hash = 397 * hash ^ w, hash;}asArray() {return [this._x, this._y, this._z, this._w];}toArray(array, index = 0) {return array[index] = this._x, array[index + 1] = this._y, array[index + 2] = this._z, array[index + 3] = this._w, this;}equals(otherQuaternion) {return otherQuaternion && this._x === otherQuaternion._x && this._y === otherQuaternion._y && this._z === otherQuaternion._z && this._w === otherQuaternion._w;}equalsWithEpsilon(otherQuaternion, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) {return otherQuaternion && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this._x, otherQuaternion._x, epsilon) && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this._y, otherQuaternion._y, epsilon) && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this._z, otherQuaternion._z, epsilon) && _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.WithinEpsilon */ .R.WithinEpsilon(this._w, otherQuaternion._w, epsilon);}clone() {return new this.constructor(this._x, this._y, this._z, this._w);}copyFrom(other) {return this._x = other._x, this._y = other._y, this._z = other._z, this._w = other._w, this._isDirty = !0, this;}copyFromFloats(x, y, z, w) {return this._x = x, this._y = y, this._z = z, this._w = w, this._isDirty = !0, this;}set(x, y, z, w) {return this.copyFromFloats(x, y, z, w);}add(other) {return new this.constructor(this._x + other._x, this._y + other._y, this._z + other._z, this._w + other._w);}addInPlace(other) {return this._x += other._x, this._y += other._y, this._z += other._z, this._w += other._w, this._isDirty = !0, this;}subtract(other) {return new this.constructor(this._x - other._x, this._y - other._y, this._z - other._z, this._w - other._w);}subtractInPlace(other) {return this._x -= other._x, this._y -= other._y, this._z -= other._z, this._w -= other._w, this._isDirty = !0, this;}scale(value) {return new this.constructor(this._x * value, this._y * value, this._z * value, this._w * value);}scaleToRef(scale, result) {return result._x = this._x * scale, result._y = this._y * scale, result._z = this._z * scale, result._w = this._w * scale, result._isDirty = !0, result;}scaleInPlace(value) {return this._x *= value, this._y *= value, this._z *= value, this._w *= value, this._isDirty = !0, this;}scaleAndAddToRef(scale, result) {return result._x += this._x * scale, result._y += this._y * scale, result._z += this._z * scale, result._w += this._w * scale, result._isDirty = !0, result;}multiply(q1) {const result = new this.constructor(0, 0, 0, 1);return this.multiplyToRef(q1, result), result;}multiplyToRef(q1, result) {const x = this._x * q1._w + this._y * q1._z - this._z * q1._y + this._w * q1._x,y = -this._x * q1._z + this._y * q1._w + this._z * q1._x + this._w * q1._y,z = this._x * q1._y - this._y * q1._x + this._z * q1._w + this._w * q1._z,w = -this._x * q1._x - this._y * q1._y - this._z * q1._z + this._w * q1._w;return result.copyFromFloats(x, y, z, w), result;}multiplyInPlace(q1) {return this.multiplyToRef(q1, this), this;}conjugateToRef(ref) {return ref.copyFromFloats(-this._x, -this._y, -this._z, this._w), ref;}conjugateInPlace() {return this._x *= -1, this._y *= -1, this._z *= -1, this._isDirty = !0, this;}conjugate() {return new this.constructor(-this._x, -this._y, -this._z, this._w);}invert() {const conjugate = this.conjugate(),lengthSquared = this.lengthSquared();return 0 == lengthSquared || 1 == lengthSquared ? conjugate : (conjugate.scaleInPlace(1 / lengthSquared), conjugate);}invertInPlace() {this.conjugateInPlace();const lengthSquared = this.lengthSquared();return 0 == lengthSquared || 1 == lengthSquared ? this : (this.scaleInPlace(1 / lengthSquared), this);}lengthSquared() {return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;}length() {return Math.sqrt(this.lengthSquared());}normalize() {const len = this.length();if (0 === len) return this;return this.scaleInPlace(1 / len), this;}normalizeToNew() {const len = this.length();if (0 === len) return this.clone();return this.scale(1 / len);}toEulerAngles() {const result = Vector3.Zero();return this.toEulerAnglesToRef(result), result;}toEulerAnglesToRef(result) {const qz = this._z,qx = this._x,qy = this._y,qw = this._w,zAxisY = qy * qz - qx * qw,limit = .4999999;if (zAxisY < -limit) result._y = 2 * Math.atan2(qy, qw), result._x = Math.PI / 2, result._z = 0, result._isDirty = !0;else if (zAxisY > limit) result._y = 2 * Math.atan2(qy, qw), result._x = -Math.PI / 2, result._z = 0, result._isDirty = !0;else {const sqw = qw * qw,sqz = qz * qz,sqx = qx * qx,sqy = qy * qy;result._z = Math.atan2(2 * (qx * qy + qz * qw), -sqz - sqx + sqy + sqw), result._x = Math.asin(-2 * zAxisY), result._y = Math.atan2(2 * (qz * qx + qy * qw), sqz - sqx - sqy + sqw), result._isDirty = !0;}return result;}toRotationMatrix(result) {return Matrix.FromQuaternionToRef(this, result), result;}fromRotationMatrix(matrix) {return Quaternion.FromRotationMatrixToRef(matrix, this), this;}static FromRotationMatrix(matrix) {const result = new Quaternion();return Quaternion.FromRotationMatrixToRef(matrix, result), result;}static FromRotationMatrixToRef(matrix, result) {const data = matrix.m,m11 = data[0],m12 = data[4],m13 = data[8],m21 = data[1],m22 = data[5],m23 = data[9],m31 = data[2],m32 = data[6],m33 = data[10],trace = m11 + m22 + m33;let s;return 0 < trace ? (s = .5 / Math.sqrt(trace + 1), result._w = .25 / s, result._x = (m32 - m23) * s, result._y = (m13 - m31) * s, result._z = (m21 - m12) * s, result._isDirty = !0) : m11 > m22 && m11 > m33 ? (s = 2 * Math.sqrt(1 + m11 - m22 - m33), result._w = (m32 - m23) / s, result._x = .25 * s, result._y = (m12 + m21) / s, result._z = (m13 + m31) / s, result._isDirty = !0) : m22 > m33 ? (s = 2 * Math.sqrt(1 + m22 - m11 - m33), result._w = (m13 - m31) / s, result._x = (m12 + m21) / s, result._y = .25 * s, result._z = (m23 + m32) / s, result._isDirty = !0) : (s = 2 * Math.sqrt(1 + m33 - m11 - m22), result._w = (m21 - m12) / s, result._x = (m13 + m31) / s, result._y = (m23 + m32) / s, result._z = .25 * s, result._isDirty = !0), result;}static Dot(left, right) {return left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w;}static AreClose(quat0, quat1, epsilon = .1) {const dot = Quaternion.Dot(quat0, quat1);return 1 - dot * dot <= epsilon;}static SmoothToRef(source, goal, deltaTime, lerpTime, result) {let slerp = 0 === lerpTime ? 1 : deltaTime / lerpTime;return slerp = _math_scalar_js__WEBPACK_IMPORTED_MODULE_0__/* .Scalar.Clamp */ .R.Clamp(slerp, 0, 1), Quaternion.SlerpToRef(source, goal, slerp, result), result;}static Zero() {return new Quaternion(0, 0, 0, 0);}static Inverse(q) {return new q.constructor(-q._x, -q._y, -q._z, q._w);}static InverseToRef(q, result) {return result.set(-q._x, -q._y, -q._z, q._w), result;}static Identity() {return new Quaternion(0, 0, 0, 1);}static IsIdentity(quaternion) {return quaternion && 0 === quaternion._x && 0 === quaternion._y && 0 === quaternion._z && 1 === quaternion._w;}static RotationAxis(axis, angle) {return Quaternion.RotationAxisToRef(axis, angle, new Quaternion());}static RotationAxisToRef(axis, angle, result) {const sin = Math.sin(angle / 2);return axis.normalize(), result._w = Math.cos(angle / 2), result._x = axis._x * sin, result._y = axis._y * sin, result._z = axis._z * sin, result._isDirty = !0, result;}static FromArray(array, offset) {return offset || (offset = 0), new Quaternion(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);}static FromArrayToRef(array, offset, result) {return result._x = array[offset], result._y = array[offset + 1], result._z = array[offset + 2], result._w = array[offset + 3], result._isDirty = !0, result;}static FromEulerAngles(x, y, z) {const q = new Quaternion();return Quaternion.RotationYawPitchRollToRef(y, x, z, q), q;}static FromEulerAnglesToRef(x, y, z, result) {return Quaternion.RotationYawPitchRollToRef(y, x, z, result), result;}static FromEulerVector(vec) {const q = new Quaternion();return Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, q), q;}static FromEulerVectorToRef(vec, result) {return Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, result), result;}static FromUnitVectorsToRef(vecFrom, vecTo, result) {const r = Vector3.Dot(vecFrom, vecTo) + 1;return r < _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn ? Math.abs(vecFrom.x) > Math.abs(vecFrom.z) ? result.set(-vecFrom.y, vecFrom.x, 0, 0) : result.set(0, -vecFrom.z, vecFrom.y, 0) : (Vector3.CrossToRef(vecFrom, vecTo, TmpVectors.Vector3[0]), result.set(TmpVectors.Vector3[0].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[0].z, r)), result.normalize();}static RotationYawPitchRoll(yaw, pitch, roll) {const q = new Quaternion();return Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, q), q;}static RotationYawPitchRollToRef(yaw, pitch, roll, result) {const halfRoll = .5 * roll,halfPitch = .5 * pitch,halfYaw = .5 * yaw,sinRoll = Math.sin(halfRoll),cosRoll = Math.cos(halfRoll),sinPitch = Math.sin(halfPitch),cosPitch = Math.cos(halfPitch),sinYaw = Math.sin(halfYaw),cosYaw = Math.cos(halfYaw);return result._x = cosYaw * sinPitch * cosRoll + sinYaw * cosPitch * sinRoll, result._y = sinYaw * cosPitch * cosRoll - cosYaw * sinPitch * sinRoll, result._z = cosYaw * cosPitch * sinRoll - sinYaw * sinPitch * cosRoll, result._w = cosYaw * cosPitch * cosRoll + sinYaw * sinPitch * sinRoll, result._isDirty = !0, result;}static RotationAlphaBetaGamma(alpha, beta, gamma) {const result = new Quaternion();return Quaternion.RotationAlphaBetaGammaToRef(alpha, beta, gamma, result), result;}static RotationAlphaBetaGammaToRef(alpha, beta, gamma, result) {const halfGammaPlusAlpha = .5 * (gamma + alpha),halfGammaMinusAlpha = .5 * (gamma - alpha),halfBeta = .5 * beta;return result._x = Math.cos(halfGammaMinusAlpha) * Math.sin(halfBeta), result._y = Math.sin(halfGammaMinusAlpha) * Math.sin(halfBeta), result._z = Math.sin(halfGammaPlusAlpha) * Math.cos(halfBeta), result._w = Math.cos(halfGammaPlusAlpha) * Math.cos(halfBeta), result._isDirty = !0, result;}static RotationQuaternionFromAxis(axis1, axis2, axis3) {const quat = new Quaternion(0, 0, 0, 0);return Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat), quat;}static RotationQuaternionFromAxisToRef(axis1, axis2, axis3, ref) {const rotMat = MathTmp.Matrix[0];return Matrix.FromXYZAxesToRef(axis1.normalize(), axis2.normalize(), axis3.normalize(), rotMat), Quaternion.FromRotationMatrixToRef(rotMat, ref), ref;}static FromLookDirectionLH(forward, up) {const quat = new Quaternion();return Quaternion.FromLookDirectionLHToRef(forward, up, quat), quat;}static FromLookDirectionLHToRef(forward, up, ref) {const rotMat = MathTmp.Matrix[0];return Matrix.LookDirectionLHToRef(forward, up, rotMat), Quaternion.FromRotationMatrixToRef(rotMat, ref), ref;}static FromLookDirectionRH(forward, up) {const quat = new Quaternion();return Quaternion.FromLookDirectionRHToRef(forward, up, quat), quat;}static FromLookDirectionRHToRef(forward, up, ref) {const rotMat = MathTmp.Matrix[0];return Matrix.LookDirectionRHToRef(forward, up, rotMat), Quaternion.FromRotationMatrixToRef(rotMat, ref);}static Slerp(left, right, amount) {const result = Quaternion.Identity();return Quaternion.SlerpToRef(left, right, amount, result), result;}static SlerpToRef(left, right, amount, result) {let num2,num3,num4 = left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w,flag = !1;if (0 > num4 && (flag = !0, num4 = -num4), .999999 < num4) num3 = 1 - amount, num2 = flag ? -amount : amount;else {const num5 = Math.acos(num4),num6 = 1 / Math.sin(num5);num3 = Math.sin((1 - amount) * num5) * num6, num2 = flag ? -Math.sin(amount * num5) * num6 : Math.sin(amount * num5) * num6;}return result._x = num3 * left._x + num2 * right._x, result._y = num3 * left._y + num2 * right._y, result._z = num3 * left._z + num2 * right._z, result._w = num3 * left._w + num2 * right._w, result._isDirty = !0, result;}static Hermite(value1, tangent1, value2, tangent2, amount) {const squared = amount * amount,cubed = amount * squared,part1 = 2 * cubed - 3 * squared + 1,part2 = -2 * cubed + 3 * squared,part3 = cubed - 2 * squared + amount,part4 = cubed - squared,x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4,y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4,z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4,w = value1._w * part1 + value2._w * part2 + tangent1._w * part3 + tangent2._w * part4;return new value1.constructor(x, y, z, w);}static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {const result = new value1.constructor();return this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result), result;}static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {const t2 = time * time;return result._x = 6 * (t2 - time) * value1._x + (3 * t2 - 4 * time + 1) * tangent1._x + 6 * (-t2 + time) * value2._x + (3 * t2 - 2 * time) * tangent2._x, result._y = 6 * (t2 - time) * value1._y + (3 * t2 - 4 * time + 1) * tangent1._y + 6 * (-t2 + time) * value2._y + (3 * t2 - 2 * time) * tangent2._y, result._z = 6 * (t2 - time) * value1._z + (3 * t2 - 4 * time + 1) * tangent1._z + 6 * (-t2 + time) * value2._z + (3 * t2 - 2 * time) * tangent2._z, result._w = 6 * (t2 - time) * value1._w + (3 * t2 - 4 * time + 1) * tangent1._w + 6 * (-t2 + time) * value2._w + (3 * t2 - 2 * time) * tangent2._w, result._isDirty = !0, result;}}class Matrix {static get Use64Bits() {return _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_4__/* .PerformanceConfigurator.MatrixUse64Bits */ .Z.MatrixUse64Bits;}get m() {return this._m;}markAsUpdated() {this.updateFlag = Matrix._UpdateFlagSeed++, this._isIdentity = !1, this._isIdentity3x2 = !1, this._isIdentityDirty = !0, this._isIdentity3x2Dirty = !0;}_updateIdentityStatus(isIdentity, isIdentityDirty = !1, isIdentity3x2 = !1, isIdentity3x2Dirty = !0) {this._isIdentity = isIdentity, this._isIdentity3x2 = isIdentity || isIdentity3x2, this._isIdentityDirty = !this._isIdentity && isIdentityDirty, this._isIdentity3x2Dirty = !this._isIdentity3x2 && isIdentity3x2Dirty;}constructor() {this._isIdentity = !1, this._isIdentityDirty = !0, this._isIdentity3x2 = !0, this._isIdentity3x2Dirty = !0, this.updateFlag = -1, _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_4__/* .PerformanceConfigurator.MatrixTrackPrecisionChange */ .Z.MatrixTrackPrecisionChange && _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_4__/* .PerformanceConfigurator.MatrixTrackedMatrices.push */ .Z.MatrixTrackedMatrices.push(this), this._m = new _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_4__/* .PerformanceConfigurator.MatrixCurrentType */ .Z.MatrixCurrentType(16), this.markAsUpdated();}isIdentity() {if (this._isIdentityDirty) {this._isIdentityDirty = !1;const m = this._m;this._isIdentity = 1 === m[0] && 0 === m[1] && 0 === m[2] && 0 === m[3] && 0 === m[4] && 1 === m[5] && 0 === m[6] && 0 === m[7] && 0 === m[8] && 0 === m[9] && 1 === m[10] && 0 === m[11] && 0 === m[12] && 0 === m[13] && 0 === m[14] && 1 === m[15];}return this._isIdentity;}isIdentityAs3x2() {return this._isIdentity3x2Dirty && (this._isIdentity3x2Dirty = !1, this._isIdentity3x2 = 1 === this._m[0] && 1 === this._m[5] && 1 === this._m[15] && 0 === this._m[1] && 0 === this._m[2] && 0 === this._m[3] && 0 === this._m[4] && 0 === this._m[6] && 0 === this._m[7] && 0 === this._m[8] && 0 === this._m[9] && 0 === this._m[10] && 0 === this._m[11] && 0 === this._m[12] && 0 === this._m[13] && 0 === this._m[14]), this._isIdentity3x2;}determinant() {if (!0 === this._isIdentity) return 1;const m = this._m,m00 = m[0],m01 = m[1],m02 = m[2],m03 = m[3],m10 = m[4],m11 = m[5],m12 = m[6],m13 = m[7],m20 = m[8],m21 = m[9],m22 = m[10],m23 = m[11],m30 = m[12],m31 = m[13],m32 = m[14],m33 = m[15],det_22_33 = m22 * m33 - m32 * m23,det_21_33 = m21 * m33 - m31 * m23,det_21_32 = m21 * m32 - m31 * m22,det_20_33 = m20 * m33 - m30 * m23,det_20_32 = m20 * m32 - m22 * m30,det_20_31 = m20 * m31 - m30 * m21;return m00 * +(m11 * det_22_33 - m12 * det_21_33 + m13 * det_21_32) + m01 * -(m10 * det_22_33 - m12 * det_20_33 + m13 * det_20_32) + m02 * +(m10 * det_21_33 - m11 * det_20_33 + m13 * det_20_31) + m03 * -(m10 * det_21_32 - m11 * det_20_32 + m12 * det_20_31);}toArray() {return this._m;}asArray() {return this._m;}invert() {return this.invertToRef(this), this;}reset() {return Matrix.FromValuesToRef(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, this), this._updateIdentityStatus(!1), this;}add(other) {const result = new this.constructor();return this.addToRef(other, result), result;}addToRef(other, result) {const m = this._m,resultM = result._m,otherM = other.m;for (let index = 0; 16 > index; index++) resultM[index] = m[index] + otherM[index];return result.markAsUpdated(), result;}addToSelf(other) {const m = this._m,otherM = other.m;for (let index = 0; 16 > index; index++) m[index] += otherM[index];return this.markAsUpdated(), this;}invertToRef(other) {if (!0 === this._isIdentity) return Matrix.IdentityToRef(other), other;const m = this._m,m00 = m[0],m01 = m[1],m02 = m[2],m03 = m[3],m10 = m[4],m11 = m[5],m12 = m[6],m13 = m[7],m20 = m[8],m21 = m[9],m22 = m[10],m23 = m[11],m30 = m[12],m31 = m[13],m32 = m[14],m33 = m[15],det_22_33 = m22 * m33 - m32 * m23,det_21_33 = m21 * m33 - m31 * m23,det_21_32 = m21 * m32 - m31 * m22,det_20_33 = m20 * m33 - m30 * m23,det_20_32 = m20 * m32 - m22 * m30,det_20_31 = m20 * m31 - m30 * m21,cofact_00 = +(m11 * det_22_33 - m12 * det_21_33 + m13 * det_21_32),cofact_01 = -(m10 * det_22_33 - m12 * det_20_33 + m13 * det_20_32),cofact_02 = +(m10 * det_21_33 - m11 * det_20_33 + m13 * det_20_31),cofact_03 = -(m10 * det_21_32 - m11 * det_20_32 + m12 * det_20_31),det = m00 * cofact_00 + m01 * cofact_01 + m02 * cofact_02 + m03 * cofact_03;if (0 === det) return other.copyFrom(this), other;const detInv = 1 / det,det_12_33 = m12 * m33 - m32 * m13,det_11_33 = m11 * m33 - m31 * m13,det_11_32 = m11 * m32 - m31 * m12,det_10_33 = m10 * m33 - m30 * m13,det_10_32 = m10 * m32 - m30 * m12,det_10_31 = m10 * m31 - m30 * m11,det_12_23 = m12 * m23 - m22 * m13,det_11_23 = m11 * m23 - m21 * m13,det_11_22 = m11 * m22 - m21 * m12,det_10_23 = m10 * m23 - m20 * m13,det_10_22 = m10 * m22 - m20 * m12,det_10_21 = m10 * m21 - m20 * m11;return Matrix.FromValuesToRef(cofact_00 * detInv, -(m01 * det_22_33 - m02 * det_21_33 + m03 * det_21_32) * detInv, +(m01 * det_12_33 - m02 * det_11_33 + m03 * det_11_32) * detInv, -(m01 * det_12_23 - m02 * det_11_23 + m03 * det_11_22) * detInv, cofact_01 * detInv, +(m00 * det_22_33 - m02 * det_20_33 + m03 * det_20_32) * detInv, -(m00 * det_12_33 - m02 * det_10_33 + m03 * det_10_32) * detInv, +(m00 * det_12_23 - m02 * det_10_23 + m03 * det_10_22) * detInv, cofact_02 * detInv, -(m00 * det_21_33 - m01 * det_20_33 + m03 * det_20_31) * detInv, +(m00 * det_11_33 - m01 * det_10_33 + m03 * det_10_31) * detInv, -(m00 * det_11_23 - m01 * det_10_23 + m03 * det_10_21) * detInv, cofact_03 * detInv, +(m00 * det_21_32 - m01 * det_20_32 + m02 * det_20_31) * detInv, -(m00 * det_11_32 - m01 * det_10_32 + m02 * det_10_31) * detInv, +(m00 * det_11_22 - m01 * det_10_22 + m02 * det_10_21) * detInv, other), other;}addAtIndex(index, value) {return this._m[index] += value, this.markAsUpdated(), this;}multiplyAtIndex(index, value) {return this._m[index] *= value, this.markAsUpdated(), this;}setTranslationFromFloats(x, y, z) {return this._m[12] = x, this._m[13] = y, this._m[14] = z, this.markAsUpdated(), this;}addTranslationFromFloats(x, y, z) {return this._m[12] += x, this._m[13] += y, this._m[14] += z, this.markAsUpdated(), this;}setTranslation(vector3) {return this.setTranslationFromFloats(vector3._x, vector3._y, vector3._z);}getTranslation() {return new Vector3(this._m[12], this._m[13], this._m[14]);}getTranslationToRef(result) {return result.x = this._m[12], result.y = this._m[13], result.z = this._m[14], result;}removeRotationAndScaling() {const m = this.m;return Matrix.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, m[12], m[13], m[14], m[15], this), this._updateIdentityStatus(0 === m[12] && 0 === m[13] && 0 === m[14] && 1 === m[15]), this;}multiply(other) {const result = new this.constructor();return this.multiplyToRef(other, result), result;}copyFrom(other) {other.copyToArray(this._m);const o = other;return this.updateFlag = o.updateFlag, this._updateIdentityStatus(o._isIdentity, o._isIdentityDirty, o._isIdentity3x2, o._isIdentity3x2Dirty), this;}copyToArray(array, offset = 0) {const source = this._m;return array[offset] = source[0], array[offset + 1] = source[1], array[offset + 2] = source[2], array[offset + 3] = source[3], array[offset + 4] = source[4], array[offset + 5] = source[5], array[offset + 6] = source[6], array[offset + 7] = source[7], array[offset + 8] = source[8], array[offset + 9] = source[9], array[offset + 10] = source[10], array[offset + 11] = source[11], array[offset + 12] = source[12], array[offset + 13] = source[13], array[offset + 14] = source[14], array[offset + 15] = source[15], this;}multiplyToRef(other, result) {return this._isIdentity ? (result.copyFrom(other), result) : other._isIdentity ? (result.copyFrom(this), result) : (this.multiplyToArray(other, result._m, 0), result.markAsUpdated(), result);}multiplyToArray(other, result, offset) {const m = this._m,otherM = other.m,tm0 = m[0],tm1 = m[1],tm2 = m[2],tm3 = m[3],tm4 = m[4],tm5 = m[5],tm6 = m[6],tm7 = m[7],tm8 = m[8],tm9 = m[9],tm10 = m[10],tm11 = m[11],tm12 = m[12],tm13 = m[13],tm14 = m[14],tm15 = m[15],om0 = otherM[0],om1 = otherM[1],om2 = otherM[2],om3 = otherM[3],om4 = otherM[4],om5 = otherM[5],om6 = otherM[6],om7 = otherM[7],om8 = otherM[8],om9 = otherM[9],om10 = otherM[10],om11 = otherM[11],om12 = otherM[12],om13 = otherM[13],om14 = otherM[14],om15 = otherM[15];return result[offset] = tm0 * om0 + tm1 * om4 + tm2 * om8 + tm3 * om12, result[offset + 1] = tm0 * om1 + tm1 * om5 + tm2 * om9 + tm3 * om13, result[offset + 2] = tm0 * om2 + tm1 * om6 + tm2 * om10 + tm3 * om14, result[offset + 3] = tm0 * om3 + tm1 * om7 + tm2 * om11 + tm3 * om15, result[offset + 4] = tm4 * om0 + tm5 * om4 + tm6 * om8 + tm7 * om12, result[offset + 5] = tm4 * om1 + tm5 * om5 + tm6 * om9 + tm7 * om13, result[offset + 6] = tm4 * om2 + tm5 * om6 + tm6 * om10 + tm7 * om14, result[offset + 7] = tm4 * om3 + tm5 * om7 + tm6 * om11 + tm7 * om15, result[offset + 8] = tm8 * om0 + tm9 * om4 + tm10 * om8 + tm11 * om12, result[offset + 9] = tm8 * om1 + tm9 * om5 + tm10 * om9 + tm11 * om13, result[offset + 10] = tm8 * om2 + tm9 * om6 + tm10 * om10 + tm11 * om14, result[offset + 11] = tm8 * om3 + tm9 * om7 + tm10 * om11 + tm11 * om15, result[offset + 12] = tm12 * om0 + tm13 * om4 + tm14 * om8 + tm15 * om12, result[offset + 13] = tm12 * om1 + tm13 * om5 + tm14 * om9 + tm15 * om13, result[offset + 14] = tm12 * om2 + tm13 * om6 + tm14 * om10 + tm15 * om14, result[offset + 15] = tm12 * om3 + tm13 * om7 + tm14 * om11 + tm15 * om15, this;}equals(value) {const other = value;if (!other) return !1;if ((this._isIdentity || other._isIdentity) && !this._isIdentityDirty && !other._isIdentityDirty) return this._isIdentity && other._isIdentity;const m = this.m,om = other.m;return m[0] === om[0] && m[1] === om[1] && m[2] === om[2] && m[3] === om[3] && m[4] === om[4] && m[5] === om[5] && m[6] === om[6] && m[7] === om[7] && m[8] === om[8] && m[9] === om[9] && m[10] === om[10] && m[11] === om[11] && m[12] === om[12] && m[13] === om[13] && m[14] === om[14] && m[15] === om[15];}clone() {const matrix = new this.constructor();return matrix.copyFrom(this), matrix;}getClassName() {return "Matrix";}getHashCode() {let hash = _ExtractAsInt(this._m[0]);for (let i = 1; 16 > i; i++) hash = 397 * hash ^ _ExtractAsInt(this._m[i]);return hash;}decomposeToTransformNode(node) {return node.rotationQuaternion = node.rotationQuaternion || new Quaternion(), this.decompose(node.scaling, node.rotationQuaternion, node.position);}decompose(scale, rotation, translation, preserveScalingNode) {if (this._isIdentity) return translation && translation.setAll(0), scale && scale.setAll(1), rotation && rotation.copyFromFloats(0, 0, 0, 1), !0;const m = this._m;if (translation && translation.copyFromFloats(m[12], m[13], m[14]), scale = scale || MathTmp.Vector3[0], scale.x = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]), scale.y = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]), scale.z = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]), preserveScalingNode) {const signX = 0 > preserveScalingNode.scaling.x ? -1 : 1,signY = 0 > preserveScalingNode.scaling.y ? -1 : 1,signZ = 0 > preserveScalingNode.scaling.z ? -1 : 1;scale.x *= signX, scale.y *= signY, scale.z *= signZ;} else 0 >= this.determinant() && (scale.y *= -1);if (0 === scale._x || 0 === scale._y || 0 === scale._z) return rotation && rotation.copyFromFloats(0, 0, 0, 1), !1;if (rotation) {const sx = 1 / scale._x,sy = 1 / scale._y,sz = 1 / scale._z;Matrix.FromValuesToRef(m[0] * sx, m[1] * sx, m[2] * sx, 0, m[4] * sy, m[5] * sy, m[6] * sy, 0, m[8] * sz, m[9] * sz, m[10] * sz, 0, 0, 0, 0, 1, MathTmp.Matrix[0]), Quaternion.FromRotationMatrixToRef(MathTmp.Matrix[0], rotation);}return !0;}getRow(index) {if (0 > index || 3 < index) return null;const i = 4 * index;return new Vector4(this._m[i + 0], this._m[i + 1], this._m[i + 2], this._m[i + 3]);}getRowToRef(index, rowVector) {if (0 <= index && 3 > index) {const i = 4 * index;rowVector.x = this._m[i + 0], rowVector.y = this._m[i + 1], rowVector.z = this._m[i + 2], rowVector.w = this._m[i + 3];}return rowVector;}setRow(index, row) {return this.setRowFromFloats(index, row.x, row.y, row.z, row.w);}transpose() {const result = new this.constructor();return Matrix.TransposeToRef(this, result), result;}transposeToRef(result) {return Matrix.TransposeToRef(this, result), result;}setRowFromFloats(index, x, y, z, w) {if (0 > index || 3 < index) return this;const i = 4 * index;return this._m[i + 0] = x, this._m[i + 1] = y, this._m[i + 2] = z, this._m[i + 3] = w, this.markAsUpdated(), this;}scale(scale) {const result = new this.constructor();return this.scaleToRef(scale, result), result;}scaleToRef(scale, result) {for (let index = 0; 16 > index; index++) result._m[index] = this._m[index] * scale;return result.markAsUpdated(), result;}scaleAndAddToRef(scale, result) {for (let index = 0; 16 > index; index++) result._m[index] += this._m[index] * scale;return result.markAsUpdated(), result;}toNormalMatrix(ref) {const tmp = MathTmp.Matrix[0];this.invertToRef(tmp), tmp.transposeToRef(ref);const m = ref._m;return Matrix.FromValuesToRef(m[0], m[1], m[2], 0, m[4], m[5], m[6], 0, m[8], m[9], m[10], 0, 0, 0, 0, 1, ref), ref;}getRotationMatrix() {const result = new this.constructor();return this.getRotationMatrixToRef(result), result;}getRotationMatrixToRef(result) {const scale = MathTmp.Vector3[0];if (!this.decompose(scale)) return Matrix.IdentityToRef(result), result;const m = this._m,sx = 1 / scale._x,sy = 1 / scale._y,sz = 1 / scale._z;return Matrix.FromValuesToRef(m[0] * sx, m[1] * sx, m[2] * sx, 0, m[4] * sy, m[5] * sy, m[6] * sy, 0, m[8] * sz, m[9] * sz, m[10] * sz, 0, 0, 0, 0, 1, result), result;}toggleModelMatrixHandInPlace() {const m = this._m;return m[2] *= -1, m[6] *= -1, m[8] *= -1, m[9] *= -1, m[14] *= -1, this.markAsUpdated(), this;}toggleProjectionMatrixHandInPlace() {const m = this._m;return m[8] *= -1, m[9] *= -1, m[10] *= -1, m[11] *= -1, this.markAsUpdated(), this;}static FromArray(array, offset = 0) {const result = new Matrix();return Matrix.FromArrayToRef(array, offset, result), result;}static FromArrayToRef(array, offset, result) {for (let index = 0; 16 > index; index++) result._m[index] = array[index + offset];return result.markAsUpdated(), result;}static FromFloat32ArrayToRefScaled(array, offset, scale, result) {for (let index = 0; 16 > index; index++) result._m[index] = array[index + offset] * scale;return result.markAsUpdated(), result;}static get IdentityReadOnly() {return Matrix._IdentityReadOnly;}static FromValuesToRef(initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44, result) {const m = result._m;m[0] = initialM11, m[1] = initialM12, m[2] = initialM13, m[3] = initialM14, m[4] = initialM21, m[5] = initialM22, m[6] = initialM23, m[7] = initialM24, m[8] = initialM31, m[9] = initialM32, m[10] = initialM33, m[11] = initialM34, m[12] = initialM41, m[13] = initialM42, m[14] = initialM43, m[15] = initialM44, result.markAsUpdated();}static FromValues(initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44) {const result = new Matrix(),m = result._m;return m[0] = initialM11, m[1] = initialM12, m[2] = initialM13, m[3] = initialM14, m[4] = initialM21, m[5] = initialM22, m[6] = initialM23, m[7] = initialM24, m[8] = initialM31, m[9] = initialM32, m[10] = initialM33, m[11] = initialM34, m[12] = initialM41, m[13] = initialM42, m[14] = initialM43, m[15] = initialM44, result.markAsUpdated(), result;}static Compose(scale, rotation, translation) {const result = new Matrix();return Matrix.ComposeToRef(scale, rotation, translation, result), result;}static ComposeToRef(scale, rotation, translation, result) {const m = result._m,x = rotation._x,y = rotation._y,z = rotation._z,w = rotation._w,x2 = x + x,y2 = y + y,z2 = z + z,xx = x * x2,xy = x * y2,xz = x * z2,yy = y * y2,yz = y * z2,zz = z * z2,wx = w * x2,wy = w * y2,wz = w * z2,sx = scale._x,sy = scale._y,sz = scale._z;return m[0] = (1 - (yy + zz)) * sx, m[1] = (xy + wz) * sx, m[2] = (xz - wy) * sx, m[3] = 0, m[4] = (xy - wz) * sy, m[5] = (1 - (xx + zz)) * sy, m[6] = (yz + wx) * sy, m[7] = 0, m[8] = (xz + wy) * sz, m[9] = (yz - wx) * sz, m[10] = (1 - (xx + yy)) * sz, m[11] = 0, m[12] = translation._x, m[13] = translation._y, m[14] = translation._z, m[15] = 1, result.markAsUpdated(), result;}static Identity() {const identity = Matrix.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);return identity._updateIdentityStatus(!0), identity;}static IdentityToRef(result) {return Matrix.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, result), result._updateIdentityStatus(!0), result;}static Zero() {const zero = Matrix.FromValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);return zero._updateIdentityStatus(!1), zero;}static RotationX(angle) {const result = new Matrix();return Matrix.RotationXToRef(angle, result), result;}static Invert(source) {const result = new source.constructor();return source.invertToRef(result), result;}static RotationXToRef(angle, result) {const s = Math.sin(angle),c = Math.cos(angle);return Matrix.FromValuesToRef(1, 0, 0, 0, 0, c, s, 0, 0, -s, c, 0, 0, 0, 0, 1, result), result._updateIdentityStatus(1 === c && 0 === s), result;}static RotationY(angle) {const result = new Matrix();return Matrix.RotationYToRef(angle, result), result;}static RotationYToRef(angle, result) {const s = Math.sin(angle),c = Math.cos(angle);return Matrix.FromValuesToRef(c, 0, -s, 0, 0, 1, 0, 0, s, 0, c, 0, 0, 0, 0, 1, result), result._updateIdentityStatus(1 === c && 0 === s), result;}static RotationZ(angle) {const result = new Matrix();return Matrix.RotationZToRef(angle, result), result;}static RotationZToRef(angle, result) {const s = Math.sin(angle),c = Math.cos(angle);return Matrix.FromValuesToRef(c, s, 0, 0, -s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, result), result._updateIdentityStatus(1 === c && 0 === s), result;}static RotationAxis(axis, angle) {const result = new Matrix();return Matrix.RotationAxisToRef(axis, angle, result), result;}static RotationAxisToRef(axis, angle, result) {const s = Math.sin(-angle),c = Math.cos(-angle),c1 = 1 - c;axis.normalize();const m = result._m;return m[0] = axis._x * axis._x * c1 + c, m[1] = axis._x * axis._y * c1 - axis._z * s, m[2] = axis._x * axis._z * c1 + axis._y * s, m[3] = 0, m[4] = axis._y * axis._x * c1 + axis._z * s, m[5] = axis._y * axis._y * c1 + c, m[6] = axis._y * axis._z * c1 - axis._x * s, m[7] = 0, m[8] = axis._z * axis._x * c1 - axis._y * s, m[9] = axis._z * axis._y * c1 + axis._x * s, m[10] = axis._z * axis._z * c1 + c, m[11] = 0, m[12] = 0, m[13] = 0, m[14] = 0, m[15] = 1, result.markAsUpdated(), result;}static RotationAlignToRef(from, to, result) {const c = Vector3.Dot(to, from),m = result._m;if (c < -1 + _math_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .Epsilon */ .kn) m[0] = -1, m[1] = 0, m[2] = 0, m[3] = 0, m[4] = 0, m[5] = -1, m[6] = 0, m[7] = 0, m[8] = 0, m[9] = 0, m[10] = 1, m[11] = 0;else {const v = Vector3.Cross(to, from),k = 1 / (1 + c);m[0] = v._x * v._x * k + c, m[1] = v._y * v._x * k - v._z, m[2] = v._z * v._x * k + v._y, m[3] = 0, m[4] = v._x * v._y * k + v._z, m[5] = v._y * v._y * k + c, m[6] = v._z * v._y * k - v._x, m[7] = 0, m[8] = v._x * v._z * k - v._y, m[9] = v._y * v._z * k + v._x, m[10] = v._z * v._z * k + c, m[11] = 0;}return m[12] = 0, m[13] = 0, m[14] = 0, m[15] = 1, result.markAsUpdated(), result;}static RotationYawPitchRoll(yaw, pitch, roll) {const result = new Matrix();return Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, result), result;}static RotationYawPitchRollToRef(yaw, pitch, roll, result) {return Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, MathTmp.Quaternion[0]), MathTmp.Quaternion[0].toRotationMatrix(result), result;}static Scaling(x, y, z) {const result = new Matrix();return Matrix.ScalingToRef(x, y, z, result), result;}static ScalingToRef(x, y, z, result) {return Matrix.FromValuesToRef(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1, result), result._updateIdentityStatus(1 === x && 1 === y && 1 === z), result;}static Translation(x, y, z) {const result = new Matrix();return Matrix.TranslationToRef(x, y, z, result), result;}static TranslationToRef(x, y, z, result) {return Matrix.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 1, result), result._updateIdentityStatus(0 === x && 0 === y && 0 === z), result;}static Lerp(startValue, endValue, gradient) {const result = new startValue.constructor();return Matrix.LerpToRef(startValue, endValue, gradient, result), result;}static LerpToRef(startValue, endValue, gradient, result) {const resultM = result._m,startM = startValue.m,endM = endValue.m;for (let index = 0; 16 > index; index++) resultM[index] = startM[index] * (1 - gradient) + endM[index] * gradient;return result.markAsUpdated(), result;}static DecomposeLerp(startValue, endValue, gradient) {const result = new startValue.constructor();return Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result), result;}static DecomposeLerpToRef(startValue, endValue, gradient, result) {const startScale = MathTmp.Vector3[0],startRotation = MathTmp.Quaternion[0],startTranslation = MathTmp.Vector3[1];startValue.decompose(startScale, startRotation, startTranslation);const endScale = MathTmp.Vector3[2],endRotation = MathTmp.Quaternion[1],endTranslation = MathTmp.Vector3[3];endValue.decompose(endScale, endRotation, endTranslation);const resultScale = MathTmp.Vector3[4];Vector3.LerpToRef(startScale, endScale, gradient, resultScale);const resultRotation = MathTmp.Quaternion[2];Quaternion.SlerpToRef(startRotation, endRotation, gradient, resultRotation);const resultTranslation = MathTmp.Vector3[5];return Vector3.LerpToRef(startTranslation, endTranslation, gradient, resultTranslation), Matrix.ComposeToRef(resultScale, resultRotation, resultTranslation, result), result;}static LookAtLH(eye, target, up) {const result = new Matrix();return Matrix.LookAtLHToRef(eye, target, up, result), result;}static LookAtLHToRef(eye, target, up, result) {const xAxis = MathTmp.Vector3[0],yAxis = MathTmp.Vector3[1],zAxis = MathTmp.Vector3[2];target.subtractToRef(eye, zAxis), zAxis.normalize(), Vector3.CrossToRef(up, zAxis, xAxis);const xSquareLength = xAxis.lengthSquared();0 === xSquareLength ? xAxis.x = 1 : xAxis.normalizeFromLength(Math.sqrt(xSquareLength)), Vector3.CrossToRef(zAxis, xAxis, yAxis), yAxis.normalize();const ex = -Vector3.Dot(xAxis, eye),ey = -Vector3.Dot(yAxis, eye),ez = -Vector3.Dot(zAxis, eye);Matrix.FromValuesToRef(xAxis._x, yAxis._x, zAxis._x, 0, xAxis._y, yAxis._y, zAxis._y, 0, xAxis._z, yAxis._z, zAxis._z, 0, ex, ey, ez, 1, result);}static LookAtRH(eye, target, up) {const result = new Matrix();return Matrix.LookAtRHToRef(eye, target, up, result), result;}static LookAtRHToRef(eye, target, up, result) {const xAxis = MathTmp.Vector3[0],yAxis = MathTmp.Vector3[1],zAxis = MathTmp.Vector3[2];eye.subtractToRef(target, zAxis), zAxis.normalize(), Vector3.CrossToRef(up, zAxis, xAxis);const xSquareLength = xAxis.lengthSquared();0 === xSquareLength ? xAxis.x = 1 : xAxis.normalizeFromLength(Math.sqrt(xSquareLength)), Vector3.CrossToRef(zAxis, xAxis, yAxis), yAxis.normalize();const ex = -Vector3.Dot(xAxis, eye),ey = -Vector3.Dot(yAxis, eye),ez = -Vector3.Dot(zAxis, eye);return Matrix.FromValuesToRef(xAxis._x, yAxis._x, zAxis._x, 0, xAxis._y, yAxis._y, zAxis._y, 0, xAxis._z, yAxis._z, zAxis._z, 0, ex, ey, ez, 1, result), result;}static LookDirectionLH(forward, up) {const result = new Matrix();return Matrix.LookDirectionLHToRef(forward, up, result), result;}static LookDirectionLHToRef(forward, up, result) {const back = MathTmp.Vector3[0];back.copyFrom(forward), back.scaleInPlace(-1);const left = MathTmp.Vector3[1];return Vector3.CrossToRef(up, back, left), Matrix.FromValuesToRef(left._x, left._y, left._z, 0, up._x, up._y, up._z, 0, back._x, back._y, back._z, 0, 0, 0, 0, 1, result), result;}static LookDirectionRH(forward, up) {const result = new Matrix();return Matrix.LookDirectionRHToRef(forward, up, result), result;}static LookDirectionRHToRef(forward, up, result) {const right = MathTmp.Vector3[2];return Vector3.CrossToRef(up, forward, right), Matrix.FromValuesToRef(right._x, right._y, right._z, 0, up._x, up._y, up._z, 0, forward._x, forward._y, forward._z, 0, 0, 0, 0, 1, result), result;}static OrthoLH(width, height, znear, zfar, halfZRange) {const matrix = new Matrix();return Matrix.OrthoLHToRef(width, height, znear, zfar, matrix, halfZRange), matrix;}static OrthoLHToRef(width, height, znear, zfar, result, halfZRange) {const n = znear,f = zfar,a = 2 / width,b = 2 / height,c = 2 / (f - n),d = -(f + n) / (f - n);return Matrix.FromValuesToRef(a, 0, 0, 0, 0, b, 0, 0, 0, 0, c, 0, 0, 0, d, 1, result), halfZRange && result.multiplyToRef(mtxConvertNDCToHalfZRange, result), result._updateIdentityStatus(1 === a && 1 === b && 1 === c && 0 === d), result;}static OrthoOffCenterLH(left, right, bottom, top, znear, zfar, halfZRange) {const matrix = new Matrix();return Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange), matrix;}static OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange) {const n = znear,f = zfar;return Matrix.FromValuesToRef(2 / (right - left), 0, 0, 0, 0, 2 / (top - bottom), 0, 0, 0, 0, 2 / (f - n), 0, (left + right) / (left - right), (top + bottom) / (bottom - top), -(f + n) / (f - n), 1, result), halfZRange && result.multiplyToRef(mtxConvertNDCToHalfZRange, result), result.markAsUpdated(), result;}static OrthoOffCenterRH(left, right, bottom, top, znear, zfar, halfZRange) {const matrix = new Matrix();return Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange), matrix;}static OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, result, halfZRange) {return Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange), result._m[10] *= -1, result;}static PerspectiveLH(width, height, znear, zfar, halfZRange, projectionPlaneTilt = 0) {const matrix = new Matrix(),n = znear,f = zfar,rot = Math.tan(projectionPlaneTilt);return Matrix.FromValuesToRef(2 * n / width, 0, 0, 0, 0, 2 * n / height, 0, rot, 0, 0, (f + n) / (f - n), 1, 0, 0, -2 * f * n / (f - n), 0, matrix), halfZRange && matrix.multiplyToRef(mtxConvertNDCToHalfZRange, matrix), matrix._updateIdentityStatus(!1), matrix;}static PerspectiveFovLH(fov, aspect, znear, zfar, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = !1) {const matrix = new Matrix();return Matrix.PerspectiveFovLHToRef(fov, aspect, znear, zfar, matrix, !0, halfZRange, projectionPlaneTilt, reverseDepthBufferMode), matrix;}static PerspectiveFovLHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = !0, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = !1) {const n = znear,f = zfar,t = 1 / Math.tan(.5 * fov),a = isVerticalFovFixed ? t / aspect : t,b = isVerticalFovFixed ? t : t * aspect,c = reverseDepthBufferMode && 0 === n ? -1 : 0 === f ? 1 : (f + n) / (f - n),d = reverseDepthBufferMode && 0 === n ? 2 * f : 0 === f ? -2 * n : -2 * f * n / (f - n),rot = Math.tan(projectionPlaneTilt);return Matrix.FromValuesToRef(a, 0, 0, 0, 0, b, 0, rot, 0, 0, c, 1, 0, 0, d, 0, result), halfZRange && result.multiplyToRef(mtxConvertNDCToHalfZRange, result), result._updateIdentityStatus(!1), result;}static PerspectiveFovReverseLHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = !0, halfZRange, projectionPlaneTilt = 0) {const t = 1 / Math.tan(.5 * fov),a = isVerticalFovFixed ? t / aspect : t,b = isVerticalFovFixed ? t : t * aspect,rot = Math.tan(projectionPlaneTilt);return Matrix.FromValuesToRef(a, 0, 0, 0, 0, b, 0, rot, 0, 0, -znear, 1, 0, 0, 1, 0, result), halfZRange && result.multiplyToRef(mtxConvertNDCToHalfZRange, result), result._updateIdentityStatus(!1), result;}static PerspectiveFovRH(fov, aspect, znear, zfar, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = !1) {const matrix = new Matrix();return Matrix.PerspectiveFovRHToRef(fov, aspect, znear, zfar, matrix, !0, halfZRange, projectionPlaneTilt, reverseDepthBufferMode), matrix;}static PerspectiveFovRHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = !0, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = !1) {const n = znear,f = zfar,t = 1 / Math.tan(.5 * fov),a = isVerticalFovFixed ? t / aspect : t,b = isVerticalFovFixed ? t : t * aspect,c = reverseDepthBufferMode && 0 === n ? 1 : 0 === f ? -1 : -(f + n) / (f - n),d = reverseDepthBufferMode && 0 === n ? 2 * f : 0 === f ? -2 * n : -2 * f * n / (f - n),rot = Math.tan(projectionPlaneTilt);return Matrix.FromValuesToRef(a, 0, 0, 0, 0, b, 0, rot, 0, 0, c, -1, 0, 0, d, 0, result), halfZRange && result.multiplyToRef(mtxConvertNDCToHalfZRange, result), result._updateIdentityStatus(!1), result;}static PerspectiveFovReverseRHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = !0, halfZRange, projectionPlaneTilt = 0) {const t = 1 / Math.tan(.5 * fov),a = isVerticalFovFixed ? t / aspect : t,b = isVerticalFovFixed ? t : t * aspect,rot = Math.tan(projectionPlaneTilt);return Matrix.FromValuesToRef(a, 0, 0, 0, 0, b, 0, rot, 0, 0, -znear, -1, 0, 0, -1, 0, result), halfZRange && result.multiplyToRef(mtxConvertNDCToHalfZRange, result), result._updateIdentityStatus(!1), result;}static PerspectiveFovWebVRToRef(fov, znear, zfar, result, rightHanded = !1, halfZRange, projectionPlaneTilt = 0) {const rightHandedFactor = rightHanded ? -1 : 1,upTan = Math.tan(fov.upDegrees * Math.PI / 180),downTan = Math.tan(fov.downDegrees * Math.PI / 180),leftTan = Math.tan(fov.leftDegrees * Math.PI / 180),rightTan = Math.tan(fov.rightDegrees * Math.PI / 180),xScale = 2 / (leftTan + rightTan),yScale = 2 / (upTan + downTan),rot = Math.tan(projectionPlaneTilt),m = result._m;return m[0] = xScale, m[1] = m[2] = m[3] = m[4] = 0, m[5] = yScale, m[6] = 0, m[7] = rot, m[8] = .5 * ((leftTan - rightTan) * xScale), m[9] = -(.5 * ((upTan - downTan) * yScale)), m[10] = -zfar / (znear - zfar), m[11] = 1 * rightHandedFactor, m[12] = m[13] = m[15] = 0, m[14] = -(2 * zfar * znear) / (zfar - znear), halfZRange && result.multiplyToRef(mtxConvertNDCToHalfZRange, result), result.markAsUpdated(), result;}static GetFinalMatrix(viewport, world, view, projection, zmin, zmax) {const cw = viewport.width,ch = viewport.height,cx = viewport.x,cy = viewport.y,viewportMatrix = Matrix.FromValues(cw / 2, 0, 0, 0, 0, -ch / 2, 0, 0, 0, 0, zmax - zmin, 0, cx + cw / 2, ch / 2 + cy, zmin, 1),matrix = new world.constructor();return world.multiplyToRef(view, matrix), matrix.multiplyToRef(projection, matrix), matrix.multiplyToRef(viewportMatrix, matrix);}static GetAsMatrix2x2(matrix) {const m = matrix.m,arr = [m[0], m[1], m[4], m[5]];return _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_4__/* .PerformanceConfigurator.MatrixUse64Bits */ .Z.MatrixUse64Bits ? arr : new Float32Array(arr);}static GetAsMatrix3x3(matrix) {const m = matrix.m,arr = [m[0], m[1], m[2], m[4], m[5], m[6], m[8], m[9], m[10]];return _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_4__/* .PerformanceConfigurator.MatrixUse64Bits */ .Z.MatrixUse64Bits ? arr : new Float32Array(arr);}static Transpose(matrix) {const result = new matrix.constructor();return Matrix.TransposeToRef(matrix, result), result;}static TransposeToRef(matrix, result) {const rm = result._m,mm = matrix.m;return rm[0] = mm[0], rm[1] = mm[4], rm[2] = mm[8], rm[3] = mm[12], rm[4] = mm[1], rm[5] = mm[5], rm[6] = mm[9], rm[7] = mm[13], rm[8] = mm[2], rm[9] = mm[6], rm[10] = mm[10], rm[11] = mm[14], rm[12] = mm[3], rm[13] = mm[7], rm[14] = mm[11], rm[15] = mm[15], result.markAsUpdated(), result._updateIdentityStatus(matrix._isIdentity, matrix._isIdentityDirty), result;}static Reflection(plane) {const matrix = new Matrix();return Matrix.ReflectionToRef(plane, matrix), matrix;}static ReflectionToRef(plane, result) {plane.normalize();const x = plane.normal.x,y = plane.normal.y,z = plane.normal.z,temp = -2 * x,temp2 = -2 * y,temp3 = -2 * z;return Matrix.FromValuesToRef(temp * x + 1, temp2 * x, temp3 * x, 0, temp * y, temp2 * y + 1, temp3 * y, 0, temp * z, temp2 * z, temp3 * z + 1, 0, temp * plane.d, temp2 * plane.d, temp3 * plane.d, 1, result), result;}static FromXYZAxesToRef(xaxis, yaxis, zaxis, result) {return Matrix.FromValuesToRef(xaxis._x, xaxis._y, xaxis._z, 0, yaxis._x, yaxis._y, yaxis._z, 0, zaxis._x, zaxis._y, zaxis._z, 0, 0, 0, 0, 1, result), result;}static FromQuaternionToRef(quat, result) {const xx = quat._x * quat._x,yy = quat._y * quat._y,zz = quat._z * quat._z,xy = quat._x * quat._y,zw = quat._z * quat._w,zx = quat._z * quat._x,yw = quat._y * quat._w,yz = quat._y * quat._z,xw = quat._x * quat._w;return result._m[0] = 1 - 2 * (yy + zz), result._m[1] = 2 * (xy + zw), result._m[2] = 2 * (zx - yw), result._m[3] = 0, result._m[4] = 2 * (xy - zw), result._m[5] = 1 - 2 * (zz + xx), result._m[6] = 2 * (yz + xw), result._m[7] = 0, result._m[8] = 2 * (zx + yw), result._m[9] = 2 * (yz - xw), result._m[10] = 1 - 2 * (yy + xx), result._m[11] = 0, result._m[12] = 0, result._m[13] = 0, result._m[14] = 0, result._m[15] = 1, result.markAsUpdated(), result;}}Matrix._UpdateFlagSeed = 0, Matrix._IdentityReadOnly = Matrix.Identity();class MathTmp {}MathTmp.Vector3 = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildTuple */ .B.BuildTuple(11, Vector3.Zero), MathTmp.Matrix = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildTuple */ .B.BuildTuple(2, Matrix.Identity), MathTmp.Quaternion = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildTuple */ .B.BuildTuple(3, Quaternion.Zero);class TmpVectors {}TmpVectors.Vector2 = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildTuple */ .B.BuildTuple(3, Vector2.Zero), TmpVectors.Vector3 = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildTuple */ .B.BuildTuple(13, Vector3.Zero), TmpVectors.Vector4 = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildTuple */ .B.BuildTuple(3, Vector4.Zero), TmpVectors.Quaternion = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildTuple */ .B.BuildTuple(2, Quaternion.Zero), TmpVectors.Matrix = _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayTools.BuildTuple */ .B.BuildTuple(8, Matrix.Identity), (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .H)("BABYLON.Vector2", Vector2), (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .H)("BABYLON.Vector3", Vector3), (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .H)("BABYLON.Vector4", Vector4), (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .H)("BABYLON.Matrix", Matrix);const mtxConvertNDCToHalfZRange = Matrix.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, .5, 0, 0, 0, .5, 1);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/math.viewport.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "l": () => (/* binding */ Viewport)
/* harmony export */ });
class Viewport {constructor(x, y, width, height) {this.x = x, this.y = y, this.width = width, this.height = height;}toGlobal(renderWidth, renderHeight) {return new Viewport(this.x * renderWidth, this.y * renderHeight, this.width * renderWidth, this.height * renderHeight);}toGlobalToRef(renderWidth, renderHeight, ref) {return ref.x = this.x * renderWidth, ref.y = this.y * renderHeight, ref.width = this.width * renderWidth, ref.height = this.height * renderHeight, this;}clone() {return new Viewport(this.x, this.y, this.width, this.height);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Maths/sphericalPolynomial.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "_": () => (/* binding */ SphericalHarmonics),
/* harmony export */   "i": () => (/* binding */ SphericalPolynomial)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.js");
const SH3ylmBasisConstants = [Math.sqrt(1 / (4 * Math.PI)), -Math.sqrt(3 / (4 * Math.PI)), Math.sqrt(3 / (4 * Math.PI)), -Math.sqrt(3 / (4 * Math.PI)), Math.sqrt(15 / (4 * Math.PI)), -Math.sqrt(15 / (4 * Math.PI)), Math.sqrt(5 / (16 * Math.PI)), -Math.sqrt(15 / (4 * Math.PI)), Math.sqrt(15 / (16 * Math.PI))],SH3ylmBasisTrigonometricTerms = [() => 1, (direction) => direction.y, (direction) => direction.z, (direction) => direction.x, (direction) => direction.x * direction.y, (direction) => direction.y * direction.z, (direction) => 3 * direction.z * direction.z - 1, (direction) => direction.x * direction.z, (direction) => direction.x * direction.x - direction.y * direction.y],applySH3 = (lm, direction) => SH3ylmBasisConstants[lm] * SH3ylmBasisTrigonometricTerms[lm](direction),SHCosKernelConvolution = [Math.PI, 2 * Math.PI / 3, 2 * Math.PI / 3, 2 * Math.PI / 3, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4];class SphericalHarmonics {constructor() {this.preScaled = !1, this.l00 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.l1_1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.l10 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.l11 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.l2_2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.l2_1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.l20 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.l21 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.l22 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero();}addLight(direction, color, deltaSolidAngle) {_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0].set */ .jp.Vector3[0].set(color.r, color.g, color.b);const colorVector = _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0],c = _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1];colorVector.scaleToRef(deltaSolidAngle, c), c.scaleToRef(applySH3(0, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), this.l00.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), c.scaleToRef(applySH3(1, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), this.l1_1.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), c.scaleToRef(applySH3(2, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), this.l10.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), c.scaleToRef(applySH3(3, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), this.l11.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), c.scaleToRef(applySH3(4, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), this.l2_2.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), c.scaleToRef(applySH3(5, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), this.l2_1.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), c.scaleToRef(applySH3(6, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), this.l20.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), c.scaleToRef(applySH3(7, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), this.l21.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), c.scaleToRef(applySH3(8, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), this.l22.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]);}scaleInPlace(scale) {this.l00.scaleInPlace(scale), this.l1_1.scaleInPlace(scale), this.l10.scaleInPlace(scale), this.l11.scaleInPlace(scale), this.l2_2.scaleInPlace(scale), this.l2_1.scaleInPlace(scale), this.l20.scaleInPlace(scale), this.l21.scaleInPlace(scale), this.l22.scaleInPlace(scale);}convertIncidentRadianceToIrradiance() {this.l00.scaleInPlace(SHCosKernelConvolution[0]), this.l1_1.scaleInPlace(SHCosKernelConvolution[1]), this.l10.scaleInPlace(SHCosKernelConvolution[2]), this.l11.scaleInPlace(SHCosKernelConvolution[3]), this.l2_2.scaleInPlace(SHCosKernelConvolution[4]), this.l2_1.scaleInPlace(SHCosKernelConvolution[5]), this.l20.scaleInPlace(SHCosKernelConvolution[6]), this.l21.scaleInPlace(SHCosKernelConvolution[7]), this.l22.scaleInPlace(SHCosKernelConvolution[8]);}convertIrradianceToLambertianRadiance() {this.scaleInPlace(1 / Math.PI);}preScaleForRendering() {this.preScaled = !0, this.l00.scaleInPlace(SH3ylmBasisConstants[0]), this.l1_1.scaleInPlace(SH3ylmBasisConstants[1]), this.l10.scaleInPlace(SH3ylmBasisConstants[2]), this.l11.scaleInPlace(SH3ylmBasisConstants[3]), this.l2_2.scaleInPlace(SH3ylmBasisConstants[4]), this.l2_1.scaleInPlace(SH3ylmBasisConstants[5]), this.l20.scaleInPlace(SH3ylmBasisConstants[6]), this.l21.scaleInPlace(SH3ylmBasisConstants[7]), this.l22.scaleInPlace(SH3ylmBasisConstants[8]);}updateFromArray(data) {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[0], 0, this.l00), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[1], 0, this.l1_1), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[2], 0, this.l10), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[3], 0, this.l11), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[4], 0, this.l2_2), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[5], 0, this.l2_1), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[6], 0, this.l20), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[7], 0, this.l21), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[8], 0, this.l22), this;}updateFromFloatsArray(data) {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromFloatsToRef */ .P.FromFloatsToRef(data[0], data[1], data[2], this.l00), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromFloatsToRef */ .P.FromFloatsToRef(data[3], data[4], data[5], this.l1_1), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromFloatsToRef */ .P.FromFloatsToRef(data[6], data[7], data[8], this.l10), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromFloatsToRef */ .P.FromFloatsToRef(data[9], data[10], data[11], this.l11), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromFloatsToRef */ .P.FromFloatsToRef(data[12], data[13], data[14], this.l2_2), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromFloatsToRef */ .P.FromFloatsToRef(data[15], data[16], data[17], this.l2_1), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromFloatsToRef */ .P.FromFloatsToRef(data[18], data[19], data[20], this.l20), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromFloatsToRef */ .P.FromFloatsToRef(data[21], data[22], data[23], this.l21), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromFloatsToRef */ .P.FromFloatsToRef(data[24], data[25], data[26], this.l22), this;}static FromArray(data) {const sh = new SphericalHarmonics();return sh.updateFromArray(data);}static FromPolynomial(polynomial) {const result = new SphericalHarmonics();return result.l00 = polynomial.xx.scale(.376127).add(polynomial.yy.scale(.376127)).add(polynomial.zz.scale(.376126)), result.l1_1 = polynomial.y.scale(.977204), result.l10 = polynomial.z.scale(.977204), result.l11 = polynomial.x.scale(.977204), result.l2_2 = polynomial.xy.scale(1.16538), result.l2_1 = polynomial.yz.scale(1.16538), result.l20 = polynomial.zz.scale(1.34567).subtract(polynomial.xx.scale(.672834)).subtract(polynomial.yy.scale(.672834)), result.l21 = polynomial.zx.scale(1.16538), result.l22 = polynomial.xx.scale(1.16538).subtract(polynomial.yy.scale(1.16538)), result.l1_1.scaleInPlace(-1), result.l11.scaleInPlace(-1), result.l2_1.scaleInPlace(-1), result.l21.scaleInPlace(-1), result.scaleInPlace(Math.PI), result;}}class SphericalPolynomial {constructor() {this.x = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.y = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.z = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.xx = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.yy = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.zz = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.xy = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.yz = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero(), this.zx = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.Zero */ .P.Zero();}get preScaledHarmonics() {return this._harmonics || (this._harmonics = SphericalHarmonics.FromPolynomial(this)), this._harmonics.preScaled || this._harmonics.preScaleForRendering(), this._harmonics;}addAmbient(color) {_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0].copyFromFloats */ .jp.Vector3[0].copyFromFloats(color.r, color.g, color.b);const colorVector = _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0];this.xx.addInPlace(colorVector), this.yy.addInPlace(colorVector), this.zz.addInPlace(colorVector);}scaleInPlace(scale) {this.x.scaleInPlace(scale), this.y.scaleInPlace(scale), this.z.scaleInPlace(scale), this.xx.scaleInPlace(scale), this.yy.scaleInPlace(scale), this.zz.scaleInPlace(scale), this.yz.scaleInPlace(scale), this.zx.scaleInPlace(scale), this.xy.scaleInPlace(scale);}updateFromHarmonics(harmonics) {return this._harmonics = harmonics, this.x.copyFrom(harmonics.l11), this.x.scaleInPlace(1.02333).scaleInPlace(-1), this.y.copyFrom(harmonics.l1_1), this.y.scaleInPlace(1.02333).scaleInPlace(-1), this.z.copyFrom(harmonics.l10), this.z.scaleInPlace(1.02333), this.xx.copyFrom(harmonics.l00), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0].copyFrom */ .jp.Vector3[0].copyFrom(harmonics.l20).scaleInPlace(.247708), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[1].copyFrom */ .jp.Vector3[1].copyFrom(harmonics.l22).scaleInPlace(.429043), this.xx.scaleInPlace(.886277).subtractInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0]).addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1]), this.yy.copyFrom(harmonics.l00), this.yy.scaleInPlace(.886277).subtractInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0]).subtractInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1]), this.zz.copyFrom(harmonics.l00), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0].copyFrom */ .jp.Vector3[0].copyFrom(harmonics.l20).scaleInPlace(.495417), this.zz.scaleInPlace(.886277).addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0]), this.yz.copyFrom(harmonics.l2_1), this.yz.scaleInPlace(.858086).scaleInPlace(-1), this.zx.copyFrom(harmonics.l21), this.zx.scaleInPlace(.858086).scaleInPlace(-1), this.xy.copyFrom(harmonics.l2_2), this.xy.scaleInPlace(.858086), this.scaleInPlace(1 / Math.PI), this;}static FromHarmonics(harmonics) {const result = new SphericalPolynomial();return result.updateFromHarmonics(harmonics);}static FromArray(data) {const sp = new SphericalPolynomial();return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[0], 0, sp.x), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[1], 0, sp.y), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[2], 0, sp.z), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[3], 0, sp.xx), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[4], 0, sp.yy), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[5], 0, sp.zz), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[6], 0, sp.yz), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[7], 0, sp.zx), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(data[8], 0, sp.xy), sp;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "J": () => (/* binding */ DracoCompression)
/* harmony export */ });
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Misc_workerPool_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/workerPool.js");
/* harmony import */ var _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js");
function createDecoderAsync(wasmBinary) {return new Promise((resolve) => {DracoDecoderModule({ wasmBinary: wasmBinary }).then((module) => {resolve({ module: module });});});}function decodeMesh(decoderModule, dataView, attributes, onIndicesData, onAttributeData, dividers) {const buffer = new decoderModule.DecoderBuffer();buffer.Init(dataView, dataView.byteLength);const decoder = new decoderModule.Decoder();let geometry, status;try {const type = decoder.GetEncodedGeometryType(buffer);switch (type) {case decoderModule.TRIANGULAR_MESH:geometry = new decoderModule.Mesh(), status = decoder.DecodeBufferToMesh(buffer, geometry);break;case decoderModule.POINT_CLOUD:geometry = new decoderModule.PointCloud(), status = decoder.DecodeBufferToPointCloud(buffer, geometry);break;default:throw new Error(`Invalid geometry type ${type}`);}if (!status.ok() || !geometry.ptr) throw new Error(status.error_msg());if (type === decoderModule.TRIANGULAR_MESH) {const numFaces = geometry.num_faces(),numIndices = 3 * numFaces,byteLength = 4 * numIndices,ptr = decoderModule._malloc(byteLength);try {decoder.GetTrianglesUInt32Array(geometry, byteLength, ptr);const indices = new Uint32Array(numIndices);indices.set(new Uint32Array(decoderModule.HEAPF32.buffer, ptr, numIndices)), onIndicesData(indices);} finally {decoderModule._free(ptr);}}const processAttribute = (kind, attribute, divider = 1) => {const numComponents = attribute.num_components(),numPoints = geometry.num_points(),numValues = numPoints * numComponents,byteLength = numValues * Float32Array.BYTES_PER_ELEMENT,ptr = decoderModule._malloc(byteLength);try {decoder.GetAttributeDataArrayForAllPoints(geometry, attribute, decoderModule.DT_FLOAT32, byteLength, ptr);const values = new Float32Array(decoderModule.HEAPF32.buffer, ptr, numValues);if ("color" === kind && 3 === numComponents) {const babylonData = new Float32Array(4 * numPoints);for (let i = 0, j = 0; i < babylonData.length; i += 4, j += numComponents) babylonData[i + 0] = values[j + 0], babylonData[i + 1] = values[j + 1], babylonData[i + 2] = values[j + 2], babylonData[i + 3] = 1;onAttributeData(kind, babylonData);} else {const babylonData = new Float32Array(numValues);if (babylonData.set(new Float32Array(decoderModule.HEAPF32.buffer, ptr, numValues)), 1 !== divider) for (let i = 0; i < babylonData.length; i++) babylonData[i] /= divider;onAttributeData(kind, babylonData);}} finally {decoderModule._free(ptr);}};if (attributes) for (const kind in attributes) {const id = attributes[kind],attribute = decoder.GetAttributeByUniqueId(geometry, id),divider = dividers && dividers[kind] || 1;processAttribute(kind, attribute, divider);} else {const nativeAttributeTypes = { position: "POSITION", normal: "NORMAL", color: "COLOR", uv: "TEX_COORD" };for (const kind in nativeAttributeTypes) {const id = decoder.GetAttributeId(geometry, decoderModule[nativeAttributeTypes[kind]]);if (-1 !== id) {const attribute = decoder.GetAttribute(geometry, id);processAttribute(kind, attribute);}}}} finally {geometry && decoderModule.destroy(geometry), decoderModule.destroy(decoder), decoderModule.destroy(buffer);}}function worker() {let decoderPromise;onmessage = (event) => {const data = event.data;switch (data.id) {case "init":{const decoder = data.decoder;decoder.url && (importScripts(decoder.url), decoderPromise = DracoDecoderModule({ wasmBinary: decoder.wasmBinary })), postMessage("done");break;}case "decodeMesh":{if (!decoderPromise) throw new Error("Draco decoder module is not available");decoderPromise.then((decoder) => {decodeMesh(decoder, data.dataView, data.attributes, (indices) => {postMessage({ id: "indices", value: indices }, [indices.buffer]);}, (kind, data) => {postMessage({ id: kind, value: data }, [data.buffer]);}), postMessage("done");});break;}}};}class DracoCompression {static get DecoderAvailable() {const decoder = DracoCompression.Configuration.decoder;return !!(decoder.wasmUrl && decoder.wasmBinaryUrl && "object" == typeof WebAssembly || decoder.fallbackUrl);}static GetDefaultNumWorkers() {return "object" == typeof navigator && navigator.hardwareConcurrency ? Math.min(Math.floor(.5 * navigator.hardwareConcurrency), 4) : 1;}static get Default() {return DracoCompression._Default || (DracoCompression._Default = new DracoCompression()), DracoCompression._Default;}constructor(numWorkers = DracoCompression.DefaultNumWorkers) {const decoder = DracoCompression.Configuration.decoder,decoderInfo = decoder.wasmUrl && decoder.wasmBinaryUrl && "object" == typeof WebAssembly ? { url: _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.GetAbsoluteUrl */ .w1.GetAbsoluteUrl(decoder.wasmUrl), wasmBinaryPromise: _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.LoadFileAsync */ .w1.LoadFileAsync(_Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.GetAbsoluteUrl */ .w1.GetAbsoluteUrl(decoder.wasmBinaryUrl)) } : { url: _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.GetAbsoluteUrl */ .w1.GetAbsoluteUrl(decoder.fallbackUrl), wasmBinaryPromise: Promise.resolve(void 0) };numWorkers && "function" == typeof Worker && "function" == typeof URL ? this._workerPoolPromise = decoderInfo.wasmBinaryPromise.then((decoderWasmBinary) => {const workerBlobUrl = URL.createObjectURL(new Blob([`${decodeMesh}(${worker})()`], { type: "application/javascript" }));return new _Misc_workerPool_js__WEBPACK_IMPORTED_MODULE_1__/* .AutoReleaseWorkerPool */ .v(numWorkers, () => new Promise((resolve, reject) => {const worker = new Worker(workerBlobUrl),onError = (error) => {worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), reject(error);},onMessage = (message) => {"done" === message.data && (worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), resolve(worker));};worker.addEventListener("error", onError), worker.addEventListener("message", onMessage), worker.postMessage({ id: "init", decoder: { url: decoderInfo.url, wasmBinary: decoderWasmBinary } });}));}) : this._decoderModulePromise = decoderInfo.wasmBinaryPromise.then((decoderWasmBinary) => {if (!decoderInfo.url) throw new Error("Draco decoder module is not available");return _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.LoadScriptAsync */ .w1.LoadScriptAsync(decoderInfo.url).then(() => createDecoderAsync(decoderWasmBinary));});}dispose() {this._workerPoolPromise && this._workerPoolPromise.then((workerPool) => {workerPool.dispose();}), delete this._workerPoolPromise, delete this._decoderModulePromise;}whenReadyAsync() {return this._workerPoolPromise ? this._workerPoolPromise.then(() => {}) : this._decoderModulePromise ? this._decoderModulePromise.then(() => {}) : Promise.resolve();}decodeMeshAsync(data, attributes, dividers) {const dataView = data instanceof ArrayBuffer ? new Uint8Array(data) : data;if (this._workerPoolPromise) return this._workerPoolPromise.then((workerPool) => new Promise((resolve, reject) => {workerPool.push((worker, onComplete) => {const vertexData = new _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexData */ .x(),onError = (error) => {worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), reject(error), onComplete();},onMessage = (message) => {if ("done" === message.data) worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), resolve(vertexData), onComplete();else if ("indices" === message.data.id) vertexData.indices = message.data.value;else {const divider = dividers && dividers[message.data.id] ? dividers[message.data.id] : 1;if (1 !== divider) for (let i = 0; i < message.data.value.length; i++) message.data.value[i] /= divider;vertexData.set(message.data.value, message.data.id);}};worker.addEventListener("error", onError), worker.addEventListener("message", onMessage);const dataViewCopy = new Uint8Array(dataView.byteLength);dataViewCopy.set(new Uint8Array(dataView.buffer, dataView.byteOffset, dataView.byteLength)), worker.postMessage({ id: "decodeMesh", dataView: dataViewCopy, attributes: attributes }, [dataViewCopy.buffer]);});}));if (this._decoderModulePromise) return this._decoderModulePromise.then((decoder) => {const vertexData = new _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexData */ .x();return decodeMesh(decoder.module, dataView, attributes, (indices) => {vertexData.indices = indices;}, (kind, data) => {vertexData.set(data, kind);}, dividers), vertexData;});throw new Error("Draco decoder module is not available");}}DracoCompression.Configuration = { decoder: { wasmUrl: "https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js", wasmBinaryUrl: "https://preview.babylonjs.com/draco_decoder_gltf.wasm", fallbackUrl: "https://preview.babylonjs.com/draco_decoder_gltf.js" } }, DracoCompression.DefaultNumWorkers = DracoCompression.GetDefaultNumWorkers(), DracoCompression._Default = null;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/Compression/meshoptCompression.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "K": () => (/* binding */ MeshoptCompression)
/* harmony export */ });
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
class MeshoptCompression {static get Default() {return MeshoptCompression._Default || (MeshoptCompression._Default = new MeshoptCompression()), MeshoptCompression._Default;}constructor() {const decoder = MeshoptCompression.Configuration.decoder;this._decoderModulePromise = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.LoadScriptAsync */ .w1.LoadScriptAsync(_Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools.GetAbsoluteUrl */ .w1.GetAbsoluteUrl(decoder.url)).then(() => MeshoptDecoder.ready);}dispose() {delete this._decoderModulePromise;}decodeGltfBufferAsync(source, count, stride, mode, filter) {return this._decoderModulePromise.then(() => {const result = new Uint8Array(count * stride);return MeshoptDecoder.decodeGltfBuffer(result, count, stride, source, mode, filter), result;});}}MeshoptCompression.Configuration = { decoder: { url: "https://preview.babylonjs.com/meshopt_decoder.js" } }, MeshoptCompression._Default = null;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "M": () => (/* binding */ WebGLDataBuffer)
/* harmony export */ });
/* harmony import */ var _Buffers_dataBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/dataBuffer.js");
class WebGLDataBuffer extends _Buffers_dataBuffer_js__WEBPACK_IMPORTED_MODULE_0__/* .DataBuffer */ .h {constructor(resource) {super(), this._buffer = resource;}get underlyingResource() {return this._buffer;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/abstractMesh.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "x": () => (/* binding */ AbstractMesh)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/scene.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engine.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js");
/* harmony import */ var _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/transformNode.js");
/* harmony import */ var _Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Collisions/pickingInfo.js");
/* harmony import */ var _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Culling/boundingInfo.js");
/* harmony import */ var _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/uniformBuffer.js");
/* harmony import */ var _Collisions_meshCollisionData_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Collisions/meshCollisionData.js");
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
/* harmony import */ var _Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.functions.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.constants.js");
/* harmony import */ var _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.axis.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
class _FacetDataStorage {constructor() {this.facetNb = 0, this.partitioningSubdivisions = 10, this.partitioningBBoxRatio = 1.01, this.facetDataEnabled = !1, this.facetParameters = {}, this.bbSize = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), this.subDiv = { max: 1, X: 1, Y: 1, Z: 1 }, this.facetDepthSort = !1, this.facetDepthSortEnabled = !1;}}class _InternalAbstractMeshDataInfo {constructor() {this._hasVertexAlpha = !1, this._useVertexColors = !0, this._numBoneInfluencers = 4, this._applyFog = !0, this._receiveShadows = !1, this._facetData = new _FacetDataStorage(), this._visibility = 1, this._skeleton = null, this._layerMask = 268435455, this._computeBonesUsingShaders = !0, this._isActive = !1, this._onlyForInstances = !1, this._isActiveIntermediate = !1, this._onlyForInstancesIntermediate = !1, this._actAsRegularMesh = !1, this._currentLOD = null, this._currentLODIsUpToDate = !1, this._collisionRetryCount = 3, this._morphTargetManager = null, this._renderingGroupId = 0, this._bakedVertexAnimationManager = null, this._material = null, this._positions = null, this._pointerOverDisableMeshTesting = !1, this._meshCollisionData = new _Collisions_meshCollisionData_js__WEBPACK_IMPORTED_MODULE_10__/* ._MeshCollisionData */ .a(), this._enableDistantPicking = !1;}}class AbstractMesh extends _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__/* .TransformNode */ .Y {static get BILLBOARDMODE_NONE() {return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__/* .TransformNode.BILLBOARDMODE_NONE */ .Y.BILLBOARDMODE_NONE;}static get BILLBOARDMODE_X() {return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__/* .TransformNode.BILLBOARDMODE_X */ .Y.BILLBOARDMODE_X;}static get BILLBOARDMODE_Y() {return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__/* .TransformNode.BILLBOARDMODE_Y */ .Y.BILLBOARDMODE_Y;}static get BILLBOARDMODE_Z() {return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__/* .TransformNode.BILLBOARDMODE_Z */ .Y.BILLBOARDMODE_Z;}static get BILLBOARDMODE_ALL() {return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__/* .TransformNode.BILLBOARDMODE_ALL */ .Y.BILLBOARDMODE_ALL;}static get BILLBOARDMODE_USE_POSITION() {return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__/* .TransformNode.BILLBOARDMODE_USE_POSITION */ .Y.BILLBOARDMODE_USE_POSITION;}get facetNb() {return this._internalAbstractMeshDataInfo._facetData.facetNb;}get partitioningSubdivisions() {return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions;}set partitioningSubdivisions(nb) {this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions = nb;}get partitioningBBoxRatio() {return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio;}set partitioningBBoxRatio(ratio) {this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio = ratio;}get mustDepthSortFacets() {return this._internalAbstractMeshDataInfo._facetData.facetDepthSort;}set mustDepthSortFacets(sort) {this._internalAbstractMeshDataInfo._facetData.facetDepthSort = sort;}get facetDepthSortFrom() {return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom;}set facetDepthSortFrom(location) {this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom = location;}get collisionRetryCount() {return this._internalAbstractMeshDataInfo._collisionRetryCount;}set collisionRetryCount(retryCount) {this._internalAbstractMeshDataInfo._collisionRetryCount = retryCount;}get isFacetDataEnabled() {return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled;}get morphTargetManager() {return this._internalAbstractMeshDataInfo._morphTargetManager;}set morphTargetManager(value) {this._internalAbstractMeshDataInfo._morphTargetManager === value || (this._internalAbstractMeshDataInfo._morphTargetManager = value, this._syncGeometryWithMorphTargetManager());}get bakedVertexAnimationManager() {return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager;}set bakedVertexAnimationManager(value) {this._internalAbstractMeshDataInfo._bakedVertexAnimationManager === value || (this._internalAbstractMeshDataInfo._bakedVertexAnimationManager = value, this._markSubMeshesAsAttributesDirty());}_syncGeometryWithMorphTargetManager() {}_updateNonUniformScalingState(value) {return !!super._updateNonUniformScalingState(value) && (this._markSubMeshesAsMiscDirty(), !0);}set onCollide(callback) {this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver && this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver), this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver = this.onCollideObservable.add(callback);}set onCollisionPositionChange(callback) {this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver && this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver), this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(callback);}get visibility() {return this._internalAbstractMeshDataInfo._visibility;}set visibility(value) {if (this._internalAbstractMeshDataInfo._visibility !== value) {const oldValue = this._internalAbstractMeshDataInfo._visibility;this._internalAbstractMeshDataInfo._visibility = value, (1 === oldValue && 1 !== value || 1 !== oldValue && 1 === value) && this._markSubMeshesAsMiscDirty();}}get pointerOverDisableMeshTesting() {return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting;}set pointerOverDisableMeshTesting(disable) {this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting = disable;}get renderingGroupId() {return this._internalAbstractMeshDataInfo._renderingGroupId;}set renderingGroupId(value) {this._internalAbstractMeshDataInfo._renderingGroupId = value;}get material() {return this._internalAbstractMeshDataInfo._material;}set material(value) {this._internalAbstractMeshDataInfo._material !== value && (this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap && (this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = void 0), this._internalAbstractMeshDataInfo._material = value, value && value.meshMap && (value.meshMap[this.uniqueId] = this), this.onMaterialChangedObservable.hasObservers() && this.onMaterialChangedObservable.notifyObservers(this), this.subMeshes && (this.resetDrawCache(), this._unBindEffect()));}getMaterialForRenderPass(renderPassId) {var _a;return null === (_a = this._internalAbstractMeshDataInfo._materialForRenderPass) || void 0 === _a ? void 0 : _a[renderPassId];}setMaterialForRenderPass(renderPassId, material) {this.resetDrawCache(renderPassId), this._internalAbstractMeshDataInfo._materialForRenderPass || (this._internalAbstractMeshDataInfo._materialForRenderPass = []), this._internalAbstractMeshDataInfo._materialForRenderPass[renderPassId] = material;}get receiveShadows() {return this._internalAbstractMeshDataInfo._receiveShadows;}set receiveShadows(value) {this._internalAbstractMeshDataInfo._receiveShadows === value || (this._internalAbstractMeshDataInfo._receiveShadows = value, this._markSubMeshesAsLightDirty());}get hasVertexAlpha() {return this._internalAbstractMeshDataInfo._hasVertexAlpha;}set hasVertexAlpha(value) {this._internalAbstractMeshDataInfo._hasVertexAlpha === value || (this._internalAbstractMeshDataInfo._hasVertexAlpha = value, this._markSubMeshesAsAttributesDirty(), this._markSubMeshesAsMiscDirty());}get useVertexColors() {return this._internalAbstractMeshDataInfo._useVertexColors;}set useVertexColors(value) {this._internalAbstractMeshDataInfo._useVertexColors === value || (this._internalAbstractMeshDataInfo._useVertexColors = value, this._markSubMeshesAsAttributesDirty());}get computeBonesUsingShaders() {return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;}set computeBonesUsingShaders(value) {this._internalAbstractMeshDataInfo._computeBonesUsingShaders === value || (this._internalAbstractMeshDataInfo._computeBonesUsingShaders = value, this._markSubMeshesAsAttributesDirty());}get numBoneInfluencers() {return this._internalAbstractMeshDataInfo._numBoneInfluencers;}set numBoneInfluencers(value) {this._internalAbstractMeshDataInfo._numBoneInfluencers === value || (this._internalAbstractMeshDataInfo._numBoneInfluencers = value, this._markSubMeshesAsAttributesDirty());}get applyFog() {return this._internalAbstractMeshDataInfo._applyFog;}set applyFog(value) {this._internalAbstractMeshDataInfo._applyFog === value || (this._internalAbstractMeshDataInfo._applyFog = value, this._markSubMeshesAsMiscDirty());}get enableDistantPicking() {return this._internalAbstractMeshDataInfo._enableDistantPicking;}set enableDistantPicking(value) {this._internalAbstractMeshDataInfo._enableDistantPicking = value;}get layerMask() {return this._internalAbstractMeshDataInfo._layerMask;}set layerMask(value) {value === this._internalAbstractMeshDataInfo._layerMask || (this._internalAbstractMeshDataInfo._layerMask = value, this._resyncLightSources());}get collisionMask() {return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask;}set collisionMask(mask) {this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask = isNaN(mask) ? -1 : mask;}get collisionResponse() {return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse;}set collisionResponse(response) {this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse = response;}get collisionGroup() {return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup;}set collisionGroup(mask) {this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup = isNaN(mask) ? -1 : mask;}get surroundingMeshes() {return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes;}set surroundingMeshes(meshes) {this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes = meshes;}get lightSources() {return this._lightSources;}get _positions() {return null;}set skeleton(value) {const skeleton = this._internalAbstractMeshDataInfo._skeleton;skeleton && skeleton.needInitialSkinMatrix && skeleton._unregisterMeshWithPoseMatrix(this), value && value.needInitialSkinMatrix && value._registerMeshWithPoseMatrix(this), this._internalAbstractMeshDataInfo._skeleton = value, this._internalAbstractMeshDataInfo._skeleton || (this._bonesTransformMatrices = null), this._markSubMeshesAsAttributesDirty();}get skeleton() {return this._internalAbstractMeshDataInfo._skeleton;}constructor(name, scene = null) {switch (super(name, scene, !1), this._internalAbstractMeshDataInfo = new _InternalAbstractMeshDataInfo(), this._waitingMaterialId = null, this.cullingStrategy = AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, this.onCollideObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onCollisionPositionChangeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.onMaterialChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this.definedFacingForward = !0, this._occlusionQuery = null, this._renderingGroup = null, this.alphaIndex = Number.MAX_VALUE, this.isVisible = !0, this.isPickable = !0, this.isNearPickable = !1, this.isNearGrabbable = !1, this.showSubMeshesBoundingBox = !1, this.isBlocker = !1, this.enablePointerMoveEvents = !1, this.outlineColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_13__/* .Color3.Red */ .Wo.Red(), this.outlineWidth = .02, this.overlayColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_13__/* .Color3.Red */ .Wo.Red(), this.overlayAlpha = .5, this.useOctreeForRenderingSelection = !0, this.useOctreeForPicking = !0, this.useOctreeForCollisions = !0, this.alwaysSelectAsActiveMesh = !1, this.doNotSyncBoundingInfo = !1, this.actionManager = null, this.ellipsoid = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(.5, 1, .5), this.ellipsoidOffset = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(0, 0, 0), this.edgesWidth = 1, this.edgesColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_13__/* .Color4 */ .HE(1, 0, 0, 1), this._edgesRenderer = null, this._masterMesh = null, this._boundingInfo = null, this._boundingInfoIsDirty = !0, this._renderId = 0, this._intersectionsInProgress = [], this._unIndexed = !1, this._lightSources = [], this._waitingData = { lods: null, actions: null, freezeWorldMatrix: null }, this._bonesTransformMatrices = null, this._transformMatrixTexture = null, this.onRebuildObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {newPosition.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions), this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length() > _Engines_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .Engine.CollisionsEpsilon */ .D.CollisionsEpsilon && this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions), collidedMesh && this.onCollideObservable.notifyObservers(collidedMesh), this.onCollisionPositionChangeObservable.notifyObservers(this.position);}, scene = this.getScene(), scene.addMesh(this), this._resyncLightSources(), this._uniformBuffer = new _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_9__/* .UniformBuffer */ .M(this.getScene().getEngine(), void 0, void 0, name, !this.getScene().getEngine().isWebGPU), this._buildUniformLayout(), scene.performancePriority) {case _scene_js__WEBPACK_IMPORTED_MODULE_1__/* .ScenePerformancePriority.Aggressive */ .a.Aggressive:this.doNotSyncBoundingInfo = !0;case _scene_js__WEBPACK_IMPORTED_MODULE_1__/* .ScenePerformancePriority.Intermediate */ .a.Intermediate:this.alwaysSelectAsActiveMesh = !0, this.isPickable = !1;}}_buildUniformLayout() {this._uniformBuffer.addUniform("world", 16), this._uniformBuffer.addUniform("visibility", 1), this._uniformBuffer.create();}transferToEffect(world) {const ubo = this._uniformBuffer;ubo.updateMatrix("world", world), ubo.updateFloat("visibility", this._internalAbstractMeshDataInfo._visibility), ubo.update();}getMeshUniformBuffer() {return this._uniformBuffer;}getClassName() {return "AbstractMesh";}toString(fullDetails) {let ret = "Name: " + this.name + ", isInstance: " + ("InstancedMesh" === this.getClassName() ? "NO" : "YES");ret += ", # of submeshes: " + (this.subMeshes ? this.subMeshes.length : 0);const skeleton = this._internalAbstractMeshDataInfo._skeleton;return skeleton && (ret += ", skeleton: " + skeleton.name), fullDetails && (ret += ", billboard mode: " + ["NONE", "X", "Y", null, "Z", null, null, "ALL"][this.billboardMode], ret += ", freeze wrld mat: " + (this._isWorldMatrixFrozen || this._waitingData.freezeWorldMatrix ? "YES" : "NO")), ret;}_getEffectiveParent() {return this._masterMesh && this.billboardMode !== _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__/* .TransformNode.BILLBOARDMODE_NONE */ .Y.BILLBOARDMODE_NONE ? this._masterMesh : super._getEffectiveParent();}_getActionManagerForTrigger(trigger, initialCall = !0) {if (this.actionManager && (initialCall || this.actionManager.isRecursive)) {if (!trigger) return this.actionManager;if (this.actionManager.hasSpecificTrigger(trigger)) return this.actionManager;}return this.parent ? this.parent._getActionManagerForTrigger(trigger, !1) : null;}_rebuild(dispose = !1) {if (this.onRebuildObservable.notifyObservers(this), null !== this._occlusionQuery && (this._occlusionQuery = null), !!this.subMeshes) for (const subMesh of this.subMeshes) subMesh._rebuild();}_resyncLightSources() {this._lightSources.length = 0;for (const light of this.getScene().lights) light.isEnabled() && light.canAffectMesh(this) && this._lightSources.push(light);this._markSubMeshesAsLightDirty();}_resyncLightSource(light) {const isIn = light.isEnabled() && light.canAffectMesh(this),index = this._lightSources.indexOf(light);let removed = !1;if (-1 === index) {if (!isIn) return;this._lightSources.push(light);} else {if (isIn) return;removed = !0, this._lightSources.splice(index, 1);}this._markSubMeshesAsLightDirty(removed);}_unBindEffect() {for (const subMesh of this.subMeshes) subMesh.setEffect(null);}_removeLightSource(light, dispose) {const index = this._lightSources.indexOf(light);-1 === index || (this._lightSources.splice(index, 1), this._markSubMeshesAsLightDirty(dispose));}_markSubMeshesAsDirty(func) {if (this.subMeshes) for (const subMesh of this.subMeshes) for (let i = 0; i < subMesh._drawWrappers.length; ++i) {const drawWrapper = subMesh._drawWrappers[i];drawWrapper && drawWrapper.defines && drawWrapper.defines.markAllAsDirty && func(drawWrapper.defines);}}_markSubMeshesAsLightDirty(dispose = !1) {this._markSubMeshesAsDirty((defines) => defines.markAsLightDirty(dispose));}_markSubMeshesAsAttributesDirty() {this._markSubMeshesAsDirty((defines) => defines.markAsAttributesDirty());}_markSubMeshesAsMiscDirty() {this._markSubMeshesAsDirty((defines) => defines.markAsMiscDirty());}markAsDirty() {return this._currentRenderId = Number.MAX_VALUE, this._isDirty = !0, this;}resetDrawCache(passId) {if (this.subMeshes) for (const subMesh of this.subMeshes) subMesh.resetDrawCache(passId);}get isBlocked() {return !1;}getLOD() {return this;}getTotalVertices() {return 0;}getTotalIndices() {return 0;}getIndices() {return null;}getVerticesData() {return null;}setVerticesData() {return this;}updateVerticesData() {return this;}setIndices() {return this;}isVerticesDataPresent() {return !1;}getBoundingInfo() {return this._masterMesh ? this._masterMesh.getBoundingInfo() : (this._boundingInfoIsDirty && (this._boundingInfoIsDirty = !1, this._updateBoundingInfo()), this._boundingInfo);}setBoundingInfo(boundingInfo) {return this._boundingInfo = boundingInfo, this;}get hasBoundingInfo() {return null !== this._boundingInfo;}buildBoundingInfo(minimum, maximum, worldMatrix) {return this._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_8__/* .BoundingInfo */ .j(minimum, maximum, worldMatrix), this._boundingInfo;}normalizeToUnitCube(includeDescendants = !0, ignoreRotation = !1, predicate) {return super.normalizeToUnitCube(includeDescendants, ignoreRotation, predicate);}get useBones() {return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind) && this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind);}_preActivate() {}_preActivateForIntermediateRendering() {}_activate(renderId) {return this._renderId = renderId, !0;}_postActivate() {}_freeze() {}_unFreeze() {}getWorldMatrix() {return this._masterMesh && this.billboardMode === _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_6__/* .TransformNode.BILLBOARDMODE_NONE */ .Y.BILLBOARDMODE_NONE ? this._masterMesh.getWorldMatrix() : super.getWorldMatrix();}_getWorldMatrixDeterminant() {return this._masterMesh ? this._masterMesh._getWorldMatrixDeterminant() : super._getWorldMatrixDeterminant();}get isAnInstance() {return !1;}get hasInstances() {return !1;}get hasThinInstances() {return !1;}movePOV(amountRight, amountUp, amountForward) {return this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward)), this;}calcMovePOV(amountRight, amountUp, amountForward) {const rotMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .y3(),rotQuaternion = this.rotationQuaternion ? this.rotationQuaternion : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion.RotationYawPitchRoll */ ._f.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);rotQuaternion.toRotationMatrix(rotMatrix);const translationDelta = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(),defForwardMult = this.definedFacingForward ? -1 : 1;return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesFromFloatsToRef */ .P.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta), translationDelta;}rotatePOV(flipBack, twirlClockwise, tiltRight) {return this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight)), this;}calcRotatePOV(flipBack, twirlClockwise, tiltRight) {const defForwardMult = this.definedFacingForward ? 1 : -1;return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);}refreshBoundingInfo(applySkeleton = !1, applyMorph = !1) {return this._boundingInfo && this._boundingInfo.isLocked ? this : (this._refreshBoundingInfo(this._getPositionData(applySkeleton, applyMorph), null), this);}_refreshBoundingInfo(data, bias) {if (data) {const extend = (0,_Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .extractMinAndMax */ .k)(data, 0, this.getTotalVertices(), bias);this._boundingInfo ? this._boundingInfo.reConstruct(extend.minimum, extend.maximum) : this._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_8__/* .BoundingInfo */ .j(extend.minimum, extend.maximum);}if (this.subMeshes) for (let index = 0; index < this.subMeshes.length; index++) this.subMeshes[index].refreshBoundingInfo(data);this._updateBoundingInfo();}_getData(applySkeleton = !1, applyMorph = !1, data, kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.PositionKind */ .o.PositionKind) {if (data = null !== data && void 0 !== data ? data : this.getVerticesData(kind).slice(), data && applyMorph && this.morphTargetManager) {let faceIndexCount = 0,positionIndex = 0;for (let vertexCount = 0; vertexCount < data.length; vertexCount++) {for (let targetCount = 0; targetCount < this.morphTargetManager.numTargets; targetCount++) {const targetMorph = this.morphTargetManager.getTarget(targetCount),influence = targetMorph.influence;if (0 < influence) {const morphTargetPositions = targetMorph.getPositions();morphTargetPositions && (data[vertexCount] += (morphTargetPositions[vertexCount] - data[vertexCount]) * influence);}}if (faceIndexCount++, kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.PositionKind */ .o.PositionKind && this._positions && 3 === faceIndexCount) {faceIndexCount = 0;const index = 3 * positionIndex;this._positions[positionIndex++].copyFromFloats(data[index], data[index + 1], data[index + 2]);}}}if (data && applySkeleton && this.skeleton) {const matricesIndicesData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind),matricesWeightsData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind);if (matricesWeightsData && matricesIndicesData) {const needExtras = 4 < this.numBoneInfluencers,matricesIndicesExtraData = needExtras ? this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind) : null,matricesWeightsExtraData = needExtras ? this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind) : null,skeletonMatrices = this.skeleton.getTransformMatrices(this),tempVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0],finalMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0],tempMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1];let matWeightIdx = 0;for (let index = 0; index < data.length; index += 3, matWeightIdx += 4) {finalMatrix.reset();let inf, weight;for (inf = 0; 4 > inf; inf++) weight = matricesWeightsData[matWeightIdx + inf], 0 < weight && (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.FromFloat32ArrayToRefScaled */ .y3.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(16 * matricesIndicesData[matWeightIdx + inf]), weight, tempMatrix), finalMatrix.addToSelf(tempMatrix));if (needExtras) for (inf = 0; 4 > inf; inf++) weight = matricesWeightsExtraData[matWeightIdx + inf], 0 < weight && (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.FromFloat32ArrayToRefScaled */ .y3.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(16 * matricesIndicesExtraData[matWeightIdx + inf]), weight, tempMatrix), finalMatrix.addToSelf(tempMatrix));kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.NormalKind */ .o.NormalKind ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformNormalFromFloatsToRef */ .P.TransformNormalFromFloatsToRef(data[index], data[index + 1], data[index + 2], finalMatrix, tempVector) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesFromFloatsToRef */ .P.TransformCoordinatesFromFloatsToRef(data[index], data[index + 1], data[index + 2], finalMatrix, tempVector), tempVector.toArray(data, index), kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.PositionKind */ .o.PositionKind && this._positions && this._positions[index / 3].copyFrom(tempVector);}}}return data;}getNormalsData(applySkeleton = !1, applyMorph = !1) {return this._getData(applySkeleton, applyMorph, null, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.NormalKind */ .o.NormalKind);}getPositionData(applySkeleton = !1, applyMorph = !1, data) {return this._getData(applySkeleton, applyMorph, data, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.PositionKind */ .o.PositionKind);}_getPositionData(applySkeleton, applyMorph) {var _a;let data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.PositionKind */ .o.PositionKind);if (this._internalAbstractMeshDataInfo._positions && (this._internalAbstractMeshDataInfo._positions = null), data && (applySkeleton && this.skeleton || applyMorph && this.morphTargetManager)) {if (data = data.slice(), this._generatePointsArray(), this._positions) {const pos = this._positions;this._internalAbstractMeshDataInfo._positions = Array(pos.length);for (let i = 0; i < pos.length; i++) this._internalAbstractMeshDataInfo._positions[i] = (null === (_a = pos[i]) || void 0 === _a ? void 0 : _a.clone()) || new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .P();}return this.getPositionData(applySkeleton, applyMorph, data);}return data;}_updateBoundingInfo() {return this._boundingInfo ? this._boundingInfo.update(this.worldMatrixFromCache) : this._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_8__/* .BoundingInfo */ .j(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), this.worldMatrixFromCache), this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache), this;}_updateSubMeshesBoundingInfo(matrix) {if (!this.subMeshes) return this;const count = this.subMeshes.length;for (let subIndex = 0; subIndex < count; subIndex++) {const subMesh = this.subMeshes[subIndex];(1 < count || !subMesh.IsGlobal) && subMesh.updateBoundingInfo(matrix);}return this;}_afterComputeWorldMatrix() {this.doNotSyncBoundingInfo || (this._boundingInfoIsDirty = !0);}isInFrustum(frustumPlanes) {return this.getBoundingInfo().isInFrustum(frustumPlanes, this.cullingStrategy);}isCompletelyInFrustum(frustumPlanes) {return this.getBoundingInfo().isCompletelyInFrustum(frustumPlanes);}intersectsMesh(mesh, precise = !1, includeDescendants) {const boundingInfo = this.getBoundingInfo(),otherBoundingInfo = mesh.getBoundingInfo();if (boundingInfo.intersects(otherBoundingInfo, precise)) return !0;if (includeDescendants) for (const child of this.getChildMeshes()) if (child.intersectsMesh(mesh, precise, !0)) return !0;return !1;}intersectsPoint(point) {return this.getBoundingInfo().intersectsPoint(point);}get checkCollisions() {return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions;}set checkCollisions(collisionEnabled) {this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions = collisionEnabled;}get collider() {return this._internalAbstractMeshDataInfo._meshCollisionData._collider;}moveWithCollisions(displacement) {const globalPosition = this.getAbsolutePosition();globalPosition.addToRef(this.ellipsoidOffset, this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);const coordinator = this.getScene().collisionCoordinator;return this._internalAbstractMeshDataInfo._meshCollisionData._collider || (this._internalAbstractMeshDataInfo._meshCollisionData._collider = coordinator.createCollider()), this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius = this.ellipsoid, coordinator.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, displacement, this._internalAbstractMeshDataInfo._meshCollisionData._collider, this.collisionRetryCount, this, this._onCollisionPositionChange, this.uniqueId), this;}_collideForSubMesh(subMesh, transformMatrix, collider) {var _a;if (this._generatePointsArray(), !this._positions) return this;if (!subMesh._lastColliderWorldVertices || !subMesh._lastColliderTransformMatrix.equals(transformMatrix)) {subMesh._lastColliderTransformMatrix = transformMatrix.clone(), subMesh._lastColliderWorldVertices = [], subMesh._trianglePlanes = [];const start = subMesh.verticesStart,end = subMesh.verticesStart + subMesh.verticesCount;for (let i = start; i < end; i++) subMesh._lastColliderWorldVertices.push(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinates */ .P.TransformCoordinates(this._positions[i], transformMatrix));}return collider._collide(subMesh._trianglePlanes, subMesh._lastColliderWorldVertices, this.getIndices(), subMesh.indexStart, subMesh.indexStart + subMesh.indexCount, subMesh.verticesStart, !!subMesh.getMaterial(), this, this._shouldConvertRHS(), 7 === (null === (_a = subMesh.getMaterial()) || void 0 === _a ? void 0 : _a.fillMode)), this;}_processCollisionsForSubMeshes(collider, transformMatrix) {const subMeshes = this._scene.getCollidingSubMeshCandidates(this, collider),len = subMeshes.length;for (let index = 0; index < len; index++) {const subMesh = subMeshes.data[index];(!(1 < len) || subMesh._checkCollision(collider)) && this._collideForSubMesh(subMesh, transformMatrix, collider);}return this;}_shouldConvertRHS() {return !1;}_checkCollision(collider) {if (!this.getBoundingInfo()._checkCollision(collider)) return this;const collisionsScalingMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0],collisionsTransformMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1];return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.ScalingToRef */ .y3.ScalingToRef(1 / collider._radius.x, 1 / collider._radius.y, 1 / collider._radius.z, collisionsScalingMatrix), this.worldMatrixFromCache.multiplyToRef(collisionsScalingMatrix, collisionsTransformMatrix), this._processCollisionsForSubMeshes(collider, collisionsTransformMatrix), this;}_generatePointsArray() {return !1;}intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo = !1, worldToUse, skipBoundingInfo = !1) {const pickingInfo = new _Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_7__/* .PickingInfo */ .p(),intersectionThreshold = "InstancedLinesMesh" === this.getClassName() || "LinesMesh" === this.getClassName() ? this.intersectionThreshold : 0,boundingInfo = this.getBoundingInfo();if (!this.subMeshes) return pickingInfo;if (!skipBoundingInfo && (!ray.intersectsSphere(boundingInfo.boundingSphere, intersectionThreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionThreshold))) return pickingInfo;if (onlyBoundingInfo) return pickingInfo.hit = !skipBoundingInfo, pickingInfo.pickedMesh = skipBoundingInfo ? null : this, pickingInfo.distance = skipBoundingInfo ? 0 : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Distance */ .P.Distance(ray.origin, boundingInfo.boundingSphere.center), pickingInfo.subMeshId = 0, pickingInfo;if (!this._generatePointsArray()) return pickingInfo;let intersectInfo = null;const subMeshes = this._scene.getIntersectingSubMeshCandidates(this, ray),len = subMeshes.length;let anySubmeshSupportIntersect = !1;for (let index = 0; index < len; index++) {const subMesh = subMeshes.data[index],material = subMesh.getMaterial();if (material && (7 == material.fillMode || 0 == material.fillMode || 1 == material.fillMode || 2 == material.fillMode || 4 == material.fillMode)) {anySubmeshSupportIntersect = !0;break;}}if (!anySubmeshSupportIntersect) return pickingInfo.hit = !0, pickingInfo.pickedMesh = this, pickingInfo.distance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Distance */ .P.Distance(ray.origin, boundingInfo.boundingSphere.center), pickingInfo.subMeshId = -1, pickingInfo;for (let index = 0; index < len; index++) {const subMesh = subMeshes.data[index];if (1 < len && !subMesh.canIntersects(ray)) continue;const currentIntersectInfo = subMesh.intersects(ray, this._positions, this.getIndices(), fastCheck, trianglePredicate);if (currentIntersectInfo && (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) && (intersectInfo = currentIntersectInfo, intersectInfo.subMeshId = index, fastCheck)) break;}if (intersectInfo) {const world = null !== worldToUse && void 0 !== worldToUse ? worldToUse : this.getWorldMatrix(),worldOrigin = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0],direction = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(ray.origin, world, worldOrigin), ray.direction.scaleToRef(intersectInfo.distance, direction);const worldDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformNormal */ .P.TransformNormal(direction, world),pickedPoint = worldDirection.addInPlace(worldOrigin);return pickingInfo.hit = !0, pickingInfo.distance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Distance */ .P.Distance(worldOrigin, pickedPoint), pickingInfo.pickedPoint = pickedPoint, pickingInfo.pickedMesh = this, pickingInfo.bu = intersectInfo.bu || 0, pickingInfo.bv = intersectInfo.bv || 0, pickingInfo.subMeshFaceId = intersectInfo.faceId, pickingInfo.faceId = intersectInfo.faceId + subMeshes.data[intersectInfo.subMeshId].indexStart / (-1 === this.getClassName().indexOf("LinesMesh") ? 3 : 2), pickingInfo.subMeshId = intersectInfo.subMeshId, pickingInfo;}return pickingInfo;}clone() {return null;}releaseSubMeshes() {if (this.subMeshes) for (; this.subMeshes.length;) this.subMeshes[0].dispose();else this.subMeshes = [];return this;}dispose(doNotRecurse, disposeMaterialAndTextures = !1) {let index;for (this._scene.useMaterialMeshMap && this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap && (this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = void 0), this.getScene().freeActiveMeshes(), this.getScene().freeRenderingGroups(), void 0 !== this.actionManager && null !== this.actionManager && (this.actionManager.dispose(), this.actionManager = null), this._internalAbstractMeshDataInfo._skeleton = null, this._transformMatrixTexture && (this._transformMatrixTexture.dispose(), this._transformMatrixTexture = null), index = 0; index < this._intersectionsInProgress.length; index++) {const other = this._intersectionsInProgress[index],pos = other._intersectionsInProgress.indexOf(this);other._intersectionsInProgress.splice(pos, 1);}this._intersectionsInProgress.length = 0;const lights = this.getScene().lights;lights.forEach((light) => {let meshIndex = light.includedOnlyMeshes.indexOf(this);-1 !== meshIndex && light.includedOnlyMeshes.splice(meshIndex, 1), meshIndex = light.excludedMeshes.indexOf(this), -1 !== meshIndex && light.excludedMeshes.splice(meshIndex, 1);const generators = light.getShadowGenerators();if (generators) {const iterator = generators.values();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const generator = key.value,shadowMap = generator.getShadowMap();shadowMap && shadowMap.renderList && (meshIndex = shadowMap.renderList.indexOf(this), -1 !== meshIndex && shadowMap.renderList.splice(meshIndex, 1));}}}), ("InstancedMesh" !== this.getClassName() || "InstancedLinesMesh" !== this.getClassName()) && this.releaseSubMeshes();const engine = this.getScene().getEngine();if (null !== this._occlusionQuery && (this.isOcclusionQueryInProgress = !1, engine.deleteQuery(this._occlusionQuery), this._occlusionQuery = null), engine.wipeCaches(), this.getScene().removeMesh(this), this._parentContainer) {const index = this._parentContainer.meshes.indexOf(this);-1 < index && this._parentContainer.meshes.splice(index, 1), this._parentContainer = null;}if (disposeMaterialAndTextures && this.material && ("MultiMaterial" === this.material.getClassName() ? this.material.dispose(!1, !0, !0) : this.material.dispose(!1, !0)), !doNotRecurse) for (index = 0; index < this.getScene().particleSystems.length; index++) this.getScene().particleSystems[index].emitter === this && (this.getScene().particleSystems[index].dispose(), index--);this._internalAbstractMeshDataInfo._facetData.facetDataEnabled && this.disableFacetData(), this._uniformBuffer.dispose(), this.onAfterWorldMatrixUpdateObservable.clear(), this.onCollideObservable.clear(), this.onCollisionPositionChangeObservable.clear(), this.onRebuildObservable.clear(), super.dispose(doNotRecurse, disposeMaterialAndTextures);}addChild(mesh, preserveScalingSign = !1) {return mesh.setParent(this, preserveScalingSign), this;}removeChild(mesh, preserveScalingSign = !1) {return mesh.setParent(null, preserveScalingSign), this;}_initFacetData() {const data = this._internalAbstractMeshDataInfo._facetData;data.facetNormals || (data.facetNormals = []), data.facetPositions || (data.facetPositions = []), data.facetPartitioning || (data.facetPartitioning = []), data.facetNb = 0 | this.getIndices().length / 3, data.partitioningSubdivisions = data.partitioningSubdivisions ? data.partitioningSubdivisions : 10, data.partitioningBBoxRatio = data.partitioningBBoxRatio ? data.partitioningBBoxRatio : 1.01;for (let f = 0; f < data.facetNb; f++) data.facetNormals[f] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero(), data.facetPositions[f] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero();return data.facetDataEnabled = !0, this;}updateFacetData() {const data = this._internalAbstractMeshDataInfo._facetData;data.facetDataEnabled || this._initFacetData();const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.PositionKind */ .o.PositionKind),indices = this.getIndices(),normals = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.NormalKind */ .o.NormalKind),bInfo = this.getBoundingInfo();if (data.facetDepthSort && !data.facetDepthSortEnabled) {if (data.facetDepthSortEnabled = !0, indices instanceof Uint16Array) data.depthSortedIndices = new Uint16Array(indices);else if (indices instanceof Uint32Array) data.depthSortedIndices = new Uint32Array(indices);else {let needs32bits = !1;for (let i = 0; i < indices.length; i++) if (65535 < indices[i]) {needs32bits = !0;break;}data.depthSortedIndices = needs32bits ? new Uint32Array(indices) : new Uint16Array(indices);}if (data.facetDepthSortFunction = function (f1, f2) {return f2.sqDistance - f1.sqDistance;}, !data.facetDepthSortFrom) {const camera = this.getScene().activeCamera;data.facetDepthSortFrom = camera ? camera.position : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero();}data.depthSortedFacets = [];for (let f = 0; f < data.facetNb; f++) {const depthSortedFacet = { ind: 3 * f, sqDistance: 0 };data.depthSortedFacets.push(depthSortedFacet);}data.invertedMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.Identity */ .y3.Identity(), data.facetDepthSortOrigin = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero();}data.bbSize.x = bInfo.maximum.x - bInfo.minimum.x > _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_14__/* .Epsilon */ .kn ? bInfo.maximum.x - bInfo.minimum.x : _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_14__/* .Epsilon */ .kn, data.bbSize.y = bInfo.maximum.y - bInfo.minimum.y > _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_14__/* .Epsilon */ .kn ? bInfo.maximum.y - bInfo.minimum.y : _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_14__/* .Epsilon */ .kn, data.bbSize.z = bInfo.maximum.z - bInfo.minimum.z > _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_14__/* .Epsilon */ .kn ? bInfo.maximum.z - bInfo.minimum.z : _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_14__/* .Epsilon */ .kn;let bbSizeMax = data.bbSize.x > data.bbSize.y ? data.bbSize.x : data.bbSize.y;if (bbSizeMax = bbSizeMax > data.bbSize.z ? bbSizeMax : data.bbSize.z, data.subDiv.max = data.partitioningSubdivisions, data.subDiv.X = Math.floor(data.subDiv.max * data.bbSize.x / bbSizeMax), data.subDiv.Y = Math.floor(data.subDiv.max * data.bbSize.y / bbSizeMax), data.subDiv.Z = Math.floor(data.subDiv.max * data.bbSize.z / bbSizeMax), data.subDiv.X = 1 > data.subDiv.X ? 1 : data.subDiv.X, data.subDiv.Y = 1 > data.subDiv.Y ? 1 : data.subDiv.Y, data.subDiv.Z = 1 > data.subDiv.Z ? 1 : data.subDiv.Z, data.facetParameters.facetNormals = this.getFacetLocalNormals(), data.facetParameters.facetPositions = this.getFacetLocalPositions(), data.facetParameters.facetPartitioning = this.getFacetLocalPartitioning(), data.facetParameters.bInfo = bInfo, data.facetParameters.bbSize = data.bbSize, data.facetParameters.subDiv = data.subDiv, data.facetParameters.ratio = this.partitioningBBoxRatio, data.facetParameters.depthSort = data.facetDepthSort, data.facetDepthSort && data.facetDepthSortEnabled && (this.computeWorldMatrix(!0), this._worldMatrix.invertToRef(data.invertedMatrix), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(data.facetDepthSortFrom, data.invertedMatrix, data.facetDepthSortOrigin), data.facetParameters.distanceTo = data.facetDepthSortOrigin), data.facetParameters.depthSortedFacets = data.depthSortedFacets, normals && _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_5__/* .VertexData.ComputeNormals */ .x.ComputeNormals(positions, indices, normals, data.facetParameters), data.facetDepthSort && data.facetDepthSortEnabled) {data.depthSortedFacets.sort(data.facetDepthSortFunction);const l = 0 | data.depthSortedIndices.length / 3;for (let f = 0; f < l; f++) {const sind = data.depthSortedFacets[f].ind;data.depthSortedIndices[3 * f] = indices[sind], data.depthSortedIndices[3 * f + 1] = indices[sind + 1], data.depthSortedIndices[3 * f + 2] = indices[sind + 2];}this.updateIndices(data.depthSortedIndices, void 0, !0);}return this;}getFacetLocalNormals() {const facetData = this._internalAbstractMeshDataInfo._facetData;return facetData.facetNormals || this.updateFacetData(), facetData.facetNormals;}getFacetLocalPositions() {const facetData = this._internalAbstractMeshDataInfo._facetData;return facetData.facetPositions || this.updateFacetData(), facetData.facetPositions;}getFacetLocalPartitioning() {const facetData = this._internalAbstractMeshDataInfo._facetData;return facetData.facetPartitioning || this.updateFacetData(), facetData.facetPartitioning;}getFacetPosition(i) {const pos = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero();return this.getFacetPositionToRef(i, pos), pos;}getFacetPositionToRef(i, ref) {const localPos = this.getFacetLocalPositions()[i],world = this.getWorldMatrix();return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(localPos, world, ref), this;}getFacetNormal(i) {const norm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.Zero */ .P.Zero();return this.getFacetNormalToRef(i, norm), norm;}getFacetNormalToRef(i, ref) {const localNorm = this.getFacetLocalNormals()[i];return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(localNorm, this.getWorldMatrix(), ref), this;}getFacetsAtLocalCoordinates(x, y, z) {const bInfo = this.getBoundingInfo(),data = this._internalAbstractMeshDataInfo._facetData,ox = Math.floor((x - bInfo.minimum.x * data.partitioningBBoxRatio) * data.subDiv.X * data.partitioningBBoxRatio / data.bbSize.x),oy = Math.floor((y - bInfo.minimum.y * data.partitioningBBoxRatio) * data.subDiv.Y * data.partitioningBBoxRatio / data.bbSize.y),oz = Math.floor((z - bInfo.minimum.z * data.partitioningBBoxRatio) * data.subDiv.Z * data.partitioningBBoxRatio / data.bbSize.z);return 0 > ox || ox > data.subDiv.max || 0 > oy || oy > data.subDiv.max || 0 > oz || oz > data.subDiv.max ? null : data.facetPartitioning[ox + data.subDiv.max * oy + data.subDiv.max * data.subDiv.max * oz];}getClosestFacetAtCoordinates(x, y, z, projected, checkFace = !1, facing = !0) {const world = this.getWorldMatrix(),invMat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Matrix[5] */ .jp.Matrix[5];world.invertToRef(invMat);const invVect = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[8] */ .jp.Vector3[8];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesFromFloatsToRef */ .P.TransformCoordinatesFromFloatsToRef(x, y, z, invMat, invVect);const closest = this.getClosestFacetAtLocalCoordinates(invVect.x, invVect.y, invVect.z, projected, checkFace, facing);return projected && _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesFromFloatsToRef */ .P.TransformCoordinatesFromFloatsToRef(projected.x, projected.y, projected.z, world, projected), closest;}getClosestFacetAtLocalCoordinates(x, y, z, projected, checkFace = !1, facing = !0) {let closest = null,tmpx = 0,tmpy = 0,tmpz = 0,d = 0,t0 = 0,projx = 0,projy = 0,projz = 0;const facetPositions = this.getFacetLocalPositions(),facetNormals = this.getFacetLocalNormals(),facetsInBlock = this.getFacetsAtLocalCoordinates(x, y, z);if (!facetsInBlock) return null;let fib,norm,p0,shortest = Number.MAX_VALUE,tmpDistance = shortest;for (let idx = 0; idx < facetsInBlock.length; idx++) fib = facetsInBlock[idx], norm = facetNormals[fib], p0 = facetPositions[fib], d = (x - p0.x) * norm.x + (y - p0.y) * norm.y + (z - p0.z) * norm.z, (!checkFace || checkFace && facing && 0 <= d || checkFace && !facing && 0 >= d) && (d = norm.x * p0.x + norm.y * p0.y + norm.z * p0.z, t0 = -(norm.x * x + norm.y * y + norm.z * z - d) / (norm.x * norm.x + norm.y * norm.y + norm.z * norm.z), projx = x + norm.x * t0, projy = y + norm.y * t0, projz = z + norm.z * t0, tmpx = projx - x, tmpy = projy - y, tmpz = projz - z, tmpDistance = tmpx * tmpx + tmpy * tmpy + tmpz * tmpz, tmpDistance < shortest && (shortest = tmpDistance, closest = fib, projected && (projected.x = projx, projected.y = projy, projected.z = projz)));return closest;}getFacetDataParameters() {return this._internalAbstractMeshDataInfo._facetData.facetParameters;}disableFacetData() {const facetData = this._internalAbstractMeshDataInfo._facetData;return facetData.facetDataEnabled && (facetData.facetDataEnabled = !1, facetData.facetPositions = [], facetData.facetNormals = [], facetData.facetPartitioning = [], facetData.facetParameters = null, facetData.depthSortedIndices = new Uint32Array(0)), this;}updateIndices(gpuMemoryOnly = !1) {return this;}createNormals(updatable) {const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.PositionKind */ .o.PositionKind),indices = this.getIndices();let normals;return normals = this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.NormalKind */ .o.NormalKind) ? this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.NormalKind */ .o.NormalKind) : [], _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_5__/* .VertexData.ComputeNormals */ .x.ComputeNormals(positions, indices, normals, { useRightHandedSystem: this.getScene().useRightHandedSystem }), this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer.NormalKind */ .o.NormalKind, normals, updatable), this;}alignWithNormal(normal, upDirection) {upDirection || (upDirection = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_15__/* .Axis.Y */ .RD.Y);const axisX = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0],axisZ = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1];return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.CrossToRef */ .P.CrossToRef(upDirection, normal, axisZ), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.CrossToRef */ .P.CrossToRef(normal, axisZ, axisX), this.rotationQuaternion ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion.RotationQuaternionFromAxisToRef */ ._f.RotationQuaternionFromAxisToRef(axisX, normal, axisZ, this.rotationQuaternion) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.RotationFromAxisToRef */ .P.RotationFromAxisToRef(axisX, normal, axisZ, this.rotation), this;}_checkOcclusionQuery() {return !1;}disableEdgesRendering() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_11__/* ._WarnImport */ .S)("EdgesRenderer");}enableEdgesRendering() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_11__/* ._WarnImport */ .S)("EdgesRenderer");}getConnectedParticleSystems() {return this._scene.particleSystems.filter((particleSystem) => particleSystem.emitter === this);}}AbstractMesh.OCCLUSION_TYPE_NONE = 0, AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC = 1, AbstractMesh.OCCLUSION_TYPE_STRICT = 2, AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0, AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1, AbstractMesh.CULLINGSTRATEGY_STANDARD = 0, AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1, AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2, AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3, (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_16__/* .RegisterClass */ .H)("BABYLON.AbstractMesh", AbstractMesh);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/geometry.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ Geometry)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Meshes_subMesh_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/subMesh.js");
/* harmony import */ var _Loading_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Loading/sceneLoaderFlags.js");
/* harmony import */ var _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Culling/boundingInfo.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tags.js");
/* harmony import */ var _Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.functions.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./node_modules/@babylonjs/core/Compat/compatibilityOptions.js");
class Geometry {get boundingBias() {return this._boundingBias;}set boundingBias(value) {this._boundingBias ? this._boundingBias.copyFrom(value) : this._boundingBias = value.clone(), this._updateBoundingInfo(!0, null);}static CreateGeometryForMesh(mesh) {const geometry = new Geometry(Geometry.RandomId(), mesh.getScene());return geometry.applyToMesh(mesh), geometry;}get meshes() {return this._meshes;}constructor(id, scene, vertexData, updatable = !1, mesh = null) {this.delayLoadState = 0, this._totalVertices = 0, this._isDisposed = !1, this._indexBufferIsUpdatable = !1, this._positionsCache = [], this._parentContainer = null, this.useBoundingInfoFromGeometry = !1, this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene;this._scene && (this.id = id, this.uniqueId = this._scene.getUniqueId(), this._engine = this._scene.getEngine(), this._meshes = [], this._vertexBuffers = {}, this._indices = [], this._updatable = updatable, vertexData ? this.setAllVerticesData(vertexData, updatable) : this._totalVertices = 0, this._engine.getCaps().vertexArrayObject && (this._vertexArrayObjects = {}), mesh && (this.applyToMesh(mesh), mesh.computeWorldMatrix(!0)));}get extend() {return this._extend;}getScene() {return this._scene;}getEngine() {return this._engine;}isReady() {return 1 === this.delayLoadState || 0 === this.delayLoadState;}get doNotSerialize() {for (let index = 0; index < this._meshes.length; index++) if (!this._meshes[index].doNotSerialize) return !1;return !0;}_rebuild() {for (const key in this._vertexArrayObjects && (this._vertexArrayObjects = {}), 0 !== this._meshes.length && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices, this._updatable)), this._vertexBuffers) {const vertexBuffer = this._vertexBuffers[key];vertexBuffer._rebuild();}}setAllVerticesData(vertexData, updatable) {vertexData.applyToGeometry(this, updatable), this._notifyUpdate();}setVerticesData(kind, data, updatable = !1, stride) {updatable && Array.isArray(data) && (data = new Float32Array(data));const buffer = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .o(this._engine, data, kind, updatable, 0 === this._meshes.length, stride);this.setVerticesBuffer(buffer);}removeVerticesData(kind) {this._vertexBuffers[kind] && (this._vertexBuffers[kind].dispose(), delete this._vertexBuffers[kind]), this._vertexArrayObjects && this._disposeVertexArrayObjects();}setVerticesBuffer(buffer, totalVertices = null, disposeExistingBuffer = !0) {const kind = buffer.getKind();this._vertexBuffers[kind] && disposeExistingBuffer && this._vertexBuffers[kind].dispose(), buffer._buffer && buffer._buffer._increaseReferences(), this._vertexBuffers[kind] = buffer;const meshes = this._meshes,numOfMeshes = meshes.length;if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind) {const data = buffer.getData();null == totalVertices ? null != data && (this._totalVertices = data.length / (buffer.type === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.BYTE */ .o.BYTE ? buffer.byteStride : buffer.byteStride / 4)) : this._totalVertices = totalVertices, this._updateExtend(data), this._resetPointsArrayCache();for (let index = 0; index < numOfMeshes; index++) {const mesh = meshes[index];mesh.buildBoundingInfo(this._extend.minimum, this._extend.maximum), mesh._createGlobalSubMesh(mesh.isUnIndexed), mesh.computeWorldMatrix(!0), mesh.synchronizeInstances();}}this._notifyUpdate(kind);}updateVerticesDataDirectly(kind, data, offset, useBytes = !1) {const vertexBuffer = this.getVertexBuffer(kind);vertexBuffer && (vertexBuffer.updateDirectly(data, offset, useBytes), this._notifyUpdate(kind));}updateVerticesData(kind, data, updateExtends = !1) {const vertexBuffer = this.getVertexBuffer(kind);vertexBuffer && (vertexBuffer.update(data), kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind && this._updateBoundingInfo(updateExtends, data), this._notifyUpdate(kind));}_updateBoundingInfo(updateExtends, data) {if (updateExtends && this._updateExtend(data), this._resetPointsArrayCache(), updateExtends) {const meshes = this._meshes;for (const mesh of meshes) {mesh.hasBoundingInfo ? mesh.getBoundingInfo().reConstruct(this._extend.minimum, this._extend.maximum) : mesh.buildBoundingInfo(this._extend.minimum, this._extend.maximum);const subMeshes = mesh.subMeshes;for (const subMesh of subMeshes) subMesh.refreshBoundingInfo();}}}_bind(effect, indexToBind, overrideVertexBuffers, overrideVertexArrayObjects) {if (effect) {void 0 === indexToBind && (indexToBind = this._indexBuffer);const vbs = this.getVertexBuffers();if (vbs) {if (indexToBind != this._indexBuffer || !this._vertexArrayObjects && !overrideVertexArrayObjects) return void this._engine.bindBuffers(vbs, indexToBind, effect, overrideVertexBuffers);const vaos = overrideVertexArrayObjects ? overrideVertexArrayObjects : this._vertexArrayObjects;vaos[effect.key] || (vaos[effect.key] = this._engine.recordVertexArrayObject(vbs, indexToBind, effect, overrideVertexBuffers)), this._engine.bindVertexArrayObject(vaos[effect.key], indexToBind);}}}getTotalVertices() {return this.isReady() ? this._totalVertices : 0;}getVerticesData(kind, copyWhenShared, forceCopy) {const vertexBuffer = this.getVertexBuffer(kind);return vertexBuffer ? vertexBuffer.getFloatData(this._totalVertices, forceCopy || copyWhenShared && 1 !== this._meshes.length) : null;}isVertexBufferUpdatable(kind) {const vb = this._vertexBuffers[kind];return !!vb && vb.isUpdatable();}getVertexBuffer(kind) {return this.isReady() ? this._vertexBuffers[kind] : null;}getVertexBuffers() {return this.isReady() ? this._vertexBuffers : null;}isVerticesDataPresent(kind) {return this._vertexBuffers ? this._vertexBuffers[kind] !== void 0 : !!this._delayInfo && -1 !== this._delayInfo.indexOf(kind);}getVerticesDataKinds() {const result = [];if (!this._vertexBuffers && this._delayInfo) for (var kind in this._delayInfo) result.push(kind);else for (kind in this._vertexBuffers) result.push(kind);return result;}updateIndices(indices, offset, gpuMemoryOnly = !1) {if (this._indexBuffer) if (!this._indexBufferIsUpdatable) this.setIndices(indices, null, !0);else {const needToUpdateSubMeshes = indices.length !== this._indices.length;if (gpuMemoryOnly || (this._indices = indices.slice()), this._engine.updateDynamicIndexBuffer(this._indexBuffer, indices, offset), needToUpdateSubMeshes) for (const mesh of this._meshes) mesh._createGlobalSubMesh(!0);}}setIndices(indices, totalVertices = null, updatable = !1) {this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._indices = indices, this._indexBufferIsUpdatable = updatable, 0 !== this._meshes.length && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices, updatable)), totalVertices != null && (this._totalVertices = totalVertices);for (const mesh of this._meshes) mesh._createGlobalSubMesh(!0), mesh.synchronizeInstances();this._notifyUpdate();}getTotalIndices() {return this.isReady() ? this._indices.length : 0;}getIndices(copyWhenShared, forceCopy) {if (!this.isReady()) return null;const orig = this._indices;return forceCopy || copyWhenShared && 1 !== this._meshes.length ? orig.slice() : orig;}getIndexBuffer() {return this.isReady() ? this._indexBuffer : null;}_releaseVertexArrayObject(effect = null) {effect && this._vertexArrayObjects && (!this._vertexArrayObjects[effect.key] || (this._engine.releaseVertexArrayObject(this._vertexArrayObjects[effect.key]), delete this._vertexArrayObjects[effect.key]));}releaseForMesh(mesh, shouldDispose) {const meshes = this._meshes,index = meshes.indexOf(mesh);-1 === index || (meshes.splice(index, 1), this._vertexArrayObjects && mesh._invalidateInstanceVertexArrayObject(), mesh._geometry = null, 0 === meshes.length && shouldDispose && this.dispose());}applyToMesh(mesh) {if (mesh._geometry !== this) {const previousGeometry = mesh._geometry;previousGeometry && previousGeometry.releaseForMesh(mesh), this._vertexArrayObjects && mesh._invalidateInstanceVertexArrayObject();const meshes = this._meshes;mesh._geometry = this, mesh._internalAbstractMeshDataInfo._positions = null, this._scene.pushGeometry(this), meshes.push(mesh), this.isReady() ? this._applyToMesh(mesh) : this._boundingInfo && mesh.setBoundingInfo(this._boundingInfo);}}_updateExtend(data = null) {if (this.useBoundingInfoFromGeometry && this._boundingInfo) this._extend = { minimum: this._boundingInfo.minimum.clone(), maximum: this._boundingInfo.maximum.clone() };else {if (!data && (data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind), !data)) return;this._extend = (0,_Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_9__/* .extractMinAndMax */ .k)(data, 0, this._totalVertices, this.boundingBias, 3);}}_applyToMesh(mesh) {const numOfMeshes = this._meshes.length;for (const kind in this._vertexBuffers) 1 === numOfMeshes && this._vertexBuffers[kind].create(), kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind && (!this._extend && this._updateExtend(), mesh.buildBoundingInfo(this._extend.minimum, this._extend.maximum), mesh._createGlobalSubMesh(mesh.isUnIndexed), mesh._updateBoundingInfo());1 === numOfMeshes && this._indices && 0 < this._indices.length && (this._indexBuffer = this._engine.createIndexBuffer(this._indices, this._updatable)), mesh._syncGeometryWithMorphTargetManager(), mesh.synchronizeInstances();}_notifyUpdate(kind) {this.onGeometryUpdated && this.onGeometryUpdated(this, kind), this._vertexArrayObjects && this._disposeVertexArrayObjects();for (const mesh of this._meshes) mesh._markSubMeshesAsAttributesDirty();}load(scene, onLoaded) {return 2 === this.delayLoadState ? void 0 : this.isReady() ? void (onLoaded && onLoaded()) : void (this.delayLoadState = 2, this._queueLoad(scene, onLoaded));}_queueLoad(scene, onLoaded) {this.delayLoadingFile && (scene.addPendingData(this), scene._loadFile(this.delayLoadingFile, (data) => {if (!this._delayLoadingFunction) return;this._delayLoadingFunction(JSON.parse(data), this), this.delayLoadState = 1, this._delayInfo = [], scene.removePendingData(this);const meshes = this._meshes,numOfMeshes = meshes.length;for (let index = 0; index < numOfMeshes; index++) this._applyToMesh(meshes[index]);onLoaded && onLoaded();}, void 0, !0));}toLeftHanded() {const tIndices = this.getIndices(!1);if (null != tIndices && 0 < tIndices.length) {for (let i = 0; i < tIndices.length; i += 3) {const tTemp = tIndices[i + 0];tIndices[i + 0] = tIndices[i + 2], tIndices[i + 2] = tTemp;}this.setIndices(tIndices);}const tPositions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind, !1);if (null != tPositions && 0 < tPositions.length) {for (let i = 0; i < tPositions.length; i += 3) tPositions[i + 2] = -tPositions[i + 2];this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind, tPositions, !1);}const tNormals = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.NormalKind */ .o.NormalKind, !1);if (null != tNormals && 0 < tNormals.length) {for (let i = 0; i < tNormals.length; i += 3) tNormals[i + 2] = -tNormals[i + 2];this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.NormalKind */ .o.NormalKind, tNormals, !1);}}_resetPointsArrayCache() {this._positions = null;}_generatePointsArray() {if (this._positions) return !0;const data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind);if (!data || 0 === data.length) return !1;for (let index = 3 * this._positionsCache.length, arrayIdx = this._positionsCache.length; index < data.length; index += 3, ++arrayIdx) this._positionsCache[arrayIdx] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(data, index);for (let index = 0, arrayIdx = 0; index < data.length; index += 3, ++arrayIdx) this._positionsCache[arrayIdx].set(data[0 + index], data[1 + index], data[2 + index]);return this._positionsCache.length = data.length / 3, this._positions = this._positionsCache, !0;}isDisposed() {return this._isDisposed;}_disposeVertexArrayObjects() {if (this._vertexArrayObjects) {for (const kind in this._vertexArrayObjects) this._engine.releaseVertexArrayObject(this._vertexArrayObjects[kind]);this._vertexArrayObjects = {};const meshes = this._meshes,numOfMeshes = meshes.length;for (let index = 0; index < numOfMeshes; index++) meshes[index]._invalidateInstanceVertexArrayObject();}}dispose() {const meshes = this._meshes,numOfMeshes = meshes.length;let index;for (index = 0; index < numOfMeshes; index++) this.releaseForMesh(meshes[index]);for (const kind in this._meshes.length = 0, this._disposeVertexArrayObjects(), this._vertexBuffers) this._vertexBuffers[kind].dispose();if (this._vertexBuffers = {}, this._totalVertices = 0, this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null, this._indices = [], this.delayLoadState = 0, this.delayLoadingFile = null, this._delayLoadingFunction = null, this._delayInfo = [], this._boundingInfo = null, this._scene.removeGeometry(this), this._parentContainer) {const index = this._parentContainer.geometries.indexOf(this);-1 < index && this._parentContainer.geometries.splice(index, 1), this._parentContainer = null;}this._isDisposed = !0;}copy(id) {const vertexData = new _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexData */ .x();vertexData.indices = [];const indices = this.getIndices();if (indices) for (let index = 0; index < indices.length; index++) vertexData.indices.push(indices[index]);let kind,updatable = !1,stopChecking = !1;for (kind in this._vertexBuffers) {const data = this.getVerticesData(kind);if (data && (data instanceof Float32Array ? vertexData.set(new Float32Array(data), kind) : vertexData.set(data.slice(0), kind), !stopChecking)) {const vb = this.getVertexBuffer(kind);vb && (updatable = vb.isUpdatable(), stopChecking = !updatable);}}const geometry = new Geometry(id, this._scene, vertexData, updatable);for (kind in geometry.delayLoadState = this.delayLoadState, geometry.delayLoadingFile = this.delayLoadingFile, geometry._delayLoadingFunction = this._delayLoadingFunction, this._delayInfo) geometry._delayInfo = geometry._delayInfo || [], geometry._delayInfo.push(kind);return geometry._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_6__/* .BoundingInfo */ .j(this._extend.minimum, this._extend.maximum), geometry;}serialize() {const serializationObject = {};return serializationObject.id = this.id, serializationObject.uniqueId = this.uniqueId, serializationObject.updatable = this._updatable, _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags.HasTags */ .$.HasTags(this) && (serializationObject.tags = _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags.GetTags */ .$.GetTags(this)), serializationObject;}_toNumberArray(origin) {return Array.isArray(origin) ? origin : Array.prototype.slice.call(origin);}clearCachedData() {for (const vbName in this._indices = [], this._resetPointsArrayCache(), this._vertexBuffers) Object.prototype.hasOwnProperty.call(this._vertexBuffers, vbName) && (this._vertexBuffers[vbName]._buffer._data = null);}serializeVerticeData() {const serializationObject = this.serialize();return this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind) && (serializationObject.positions = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind) && (serializationObject.positions._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.NormalKind */ .o.NormalKind) && (serializationObject.normals = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.NormalKind */ .o.NormalKind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.NormalKind */ .o.NormalKind) && (serializationObject.normals._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.TangentKind */ .o.TangentKind) && (serializationObject.tangents = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.TangentKind */ .o.TangentKind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.TangentKind */ .o.TangentKind) && (serializationObject.tangents._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UVKind */ .o.UVKind) && (serializationObject.uvs = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UVKind */ .o.UVKind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UVKind */ .o.UVKind) && (serializationObject.uvs._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV2Kind */ .o.UV2Kind) && (serializationObject.uv2s = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV2Kind */ .o.UV2Kind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV2Kind */ .o.UV2Kind) && (serializationObject.uv2s._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV3Kind */ .o.UV3Kind) && (serializationObject.uv3s = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV3Kind */ .o.UV3Kind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV3Kind */ .o.UV3Kind) && (serializationObject.uv3s._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV4Kind */ .o.UV4Kind) && (serializationObject.uv4s = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV4Kind */ .o.UV4Kind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV4Kind */ .o.UV4Kind) && (serializationObject.uv4s._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV5Kind */ .o.UV5Kind) && (serializationObject.uv5s = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV5Kind */ .o.UV5Kind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV5Kind */ .o.UV5Kind) && (serializationObject.uv5s._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV6Kind */ .o.UV6Kind) && (serializationObject.uv6s = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV6Kind */ .o.UV6Kind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV6Kind */ .o.UV6Kind) && (serializationObject.uv6s._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.ColorKind */ .o.ColorKind) && (serializationObject.colors = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.ColorKind */ .o.ColorKind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.ColorKind */ .o.ColorKind) && (serializationObject.colors._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind) && (serializationObject.matricesIndices = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind)), serializationObject.matricesIndices._isExpanded = !0, this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind) && (serializationObject.matricesIndices._updatable = !0)), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind) && (serializationObject.matricesWeights = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind)), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind) && (serializationObject.matricesWeights._updatable = !0)), serializationObject.indices = this._toNumberArray(this.getIndices()), serializationObject;}static ExtractFromMesh(mesh, id) {const geometry = mesh._geometry;return geometry ? geometry.copy(id) : null;}static RandomId() {return _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__/* .Tools.RandomId */ .w1.RandomId();}static _GetGeometryByLoadedUniqueId(uniqueId, scene) {for (let index = 0; index < scene.geometries.length; index++) if (scene.geometries[index]._loadedUniqueId === uniqueId) return scene.geometries[index];return null;}static _ImportGeometry(parsedGeometry, mesh) {const scene = mesh.getScene(),geometryUniqueId = parsedGeometry.geometryUniqueId,geometryId = parsedGeometry.geometryId;if (geometryUniqueId || geometryId) {const geometry = geometryUniqueId ? this._GetGeometryByLoadedUniqueId(geometryUniqueId, scene) : scene.getGeometryById(geometryId);geometry && geometry.applyToMesh(mesh);} else if (parsedGeometry instanceof ArrayBuffer) {const binaryInfo = mesh._binaryInfo;if (binaryInfo.positionsAttrDesc && 0 < binaryInfo.positionsAttrDesc.count) {const positionsData = new Float32Array(parsedGeometry, binaryInfo.positionsAttrDesc.offset, binaryInfo.positionsAttrDesc.count);mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind, positionsData, !1);}if (binaryInfo.normalsAttrDesc && 0 < binaryInfo.normalsAttrDesc.count) {const normalsData = new Float32Array(parsedGeometry, binaryInfo.normalsAttrDesc.offset, binaryInfo.normalsAttrDesc.count);mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.NormalKind */ .o.NormalKind, normalsData, !1);}if (binaryInfo.tangetsAttrDesc && 0 < binaryInfo.tangetsAttrDesc.count) {const tangentsData = new Float32Array(parsedGeometry, binaryInfo.tangetsAttrDesc.offset, binaryInfo.tangetsAttrDesc.count);mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.TangentKind */ .o.TangentKind, tangentsData, !1);}if (binaryInfo.uvsAttrDesc && 0 < binaryInfo.uvsAttrDesc.count) {const uvsData = new Float32Array(parsedGeometry, binaryInfo.uvsAttrDesc.offset, binaryInfo.uvsAttrDesc.count);if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .CompatibilityOptions.UseOpenGLOrientationForUV */ .e.UseOpenGLOrientationForUV) for (let index = 1; index < uvsData.length; index += 2) uvsData[index] = 1 - uvsData[index];mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UVKind */ .o.UVKind, uvsData, !1);}if (binaryInfo.uvs2AttrDesc && 0 < binaryInfo.uvs2AttrDesc.count) {const uvs2Data = new Float32Array(parsedGeometry, binaryInfo.uvs2AttrDesc.offset, binaryInfo.uvs2AttrDesc.count);if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .CompatibilityOptions.UseOpenGLOrientationForUV */ .e.UseOpenGLOrientationForUV) for (let index = 1; index < uvs2Data.length; index += 2) uvs2Data[index] = 1 - uvs2Data[index];mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV2Kind */ .o.UV2Kind, uvs2Data, !1);}if (binaryInfo.uvs3AttrDesc && 0 < binaryInfo.uvs3AttrDesc.count) {const uvs3Data = new Float32Array(parsedGeometry, binaryInfo.uvs3AttrDesc.offset, binaryInfo.uvs3AttrDesc.count);if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .CompatibilityOptions.UseOpenGLOrientationForUV */ .e.UseOpenGLOrientationForUV) for (let index = 1; index < uvs3Data.length; index += 2) uvs3Data[index] = 1 - uvs3Data[index];mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV3Kind */ .o.UV3Kind, uvs3Data, !1);}if (binaryInfo.uvs4AttrDesc && 0 < binaryInfo.uvs4AttrDesc.count) {const uvs4Data = new Float32Array(parsedGeometry, binaryInfo.uvs4AttrDesc.offset, binaryInfo.uvs4AttrDesc.count);if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .CompatibilityOptions.UseOpenGLOrientationForUV */ .e.UseOpenGLOrientationForUV) for (let index = 1; index < uvs4Data.length; index += 2) uvs4Data[index] = 1 - uvs4Data[index];mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV4Kind */ .o.UV4Kind, uvs4Data, !1);}if (binaryInfo.uvs5AttrDesc && 0 < binaryInfo.uvs5AttrDesc.count) {const uvs5Data = new Float32Array(parsedGeometry, binaryInfo.uvs5AttrDesc.offset, binaryInfo.uvs5AttrDesc.count);if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .CompatibilityOptions.UseOpenGLOrientationForUV */ .e.UseOpenGLOrientationForUV) for (let index = 1; index < uvs5Data.length; index += 2) uvs5Data[index] = 1 - uvs5Data[index];mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV5Kind */ .o.UV5Kind, uvs5Data, !1);}if (binaryInfo.uvs6AttrDesc && 0 < binaryInfo.uvs6AttrDesc.count) {const uvs6Data = new Float32Array(parsedGeometry, binaryInfo.uvs6AttrDesc.offset, binaryInfo.uvs6AttrDesc.count);if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .CompatibilityOptions.UseOpenGLOrientationForUV */ .e.UseOpenGLOrientationForUV) for (let index = 1; index < uvs6Data.length; index += 2) uvs6Data[index] = 1 - uvs6Data[index];mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV6Kind */ .o.UV6Kind, uvs6Data, !1);}if (binaryInfo.colorsAttrDesc && 0 < binaryInfo.colorsAttrDesc.count) {const colorsData = new Float32Array(parsedGeometry, binaryInfo.colorsAttrDesc.offset, binaryInfo.colorsAttrDesc.count);mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.ColorKind */ .o.ColorKind, colorsData, !1, binaryInfo.colorsAttrDesc.stride);}if (binaryInfo.matricesIndicesAttrDesc && 0 < binaryInfo.matricesIndicesAttrDesc.count) {const matricesIndicesData = new Int32Array(parsedGeometry, binaryInfo.matricesIndicesAttrDesc.offset, binaryInfo.matricesIndicesAttrDesc.count),floatIndices = [];for (let i = 0; i < matricesIndicesData.length; i++) {const index = matricesIndicesData[i];floatIndices.push(255 & index), floatIndices.push((65280 & index) >> 8), floatIndices.push((16711680 & index) >> 16), floatIndices.push(255 & index >> 24);}mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind, floatIndices, !1);}if (binaryInfo.matricesIndicesExtraAttrDesc && 0 < binaryInfo.matricesIndicesExtraAttrDesc.count) {const matricesIndicesData = new Int32Array(parsedGeometry, binaryInfo.matricesIndicesExtraAttrDesc.offset, binaryInfo.matricesIndicesExtraAttrDesc.count),floatIndices = [];for (let i = 0; i < matricesIndicesData.length; i++) {const index = matricesIndicesData[i];floatIndices.push(255 & index), floatIndices.push((65280 & index) >> 8), floatIndices.push((16711680 & index) >> 16), floatIndices.push(255 & index >> 24);}mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind, floatIndices, !1);}if (binaryInfo.matricesWeightsAttrDesc && 0 < binaryInfo.matricesWeightsAttrDesc.count) {const matricesWeightsData = new Float32Array(parsedGeometry, binaryInfo.matricesWeightsAttrDesc.offset, binaryInfo.matricesWeightsAttrDesc.count);mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, matricesWeightsData, !1);}if (binaryInfo.indicesAttrDesc && 0 < binaryInfo.indicesAttrDesc.count) {const indicesData = new Int32Array(parsedGeometry, binaryInfo.indicesAttrDesc.offset, binaryInfo.indicesAttrDesc.count);mesh.setIndices(indicesData, null);}if (binaryInfo.subMeshesAttrDesc && 0 < binaryInfo.subMeshesAttrDesc.count) {const subMeshesData = new Int32Array(parsedGeometry, binaryInfo.subMeshesAttrDesc.offset, 5 * binaryInfo.subMeshesAttrDesc.count);mesh.subMeshes = [];for (let i = 0; i < binaryInfo.subMeshesAttrDesc.count; i++) {const materialIndex = subMeshesData[5 * i + 0],verticesStart = subMeshesData[5 * i + 1],verticesCount = subMeshesData[5 * i + 2],indexStart = subMeshesData[5 * i + 3],indexCount = subMeshesData[5 * i + 4];_Meshes_subMesh_js__WEBPACK_IMPORTED_MODULE_4__/* .SubMesh.AddToMesh */ .P.AddToMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh);}}} else if (parsedGeometry.positions && parsedGeometry.normals && parsedGeometry.indices) {if (mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind, parsedGeometry.positions, parsedGeometry.positions._updatable), mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.NormalKind */ .o.NormalKind, parsedGeometry.normals, parsedGeometry.normals._updatable), parsedGeometry.tangents && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.TangentKind */ .o.TangentKind, parsedGeometry.tangents, parsedGeometry.tangents._updatable), parsedGeometry.uvs && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UVKind */ .o.UVKind, parsedGeometry.uvs, parsedGeometry.uvs._updatable), parsedGeometry.uvs2 && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV2Kind */ .o.UV2Kind, parsedGeometry.uvs2, parsedGeometry.uvs2._updatable), parsedGeometry.uvs3 && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV3Kind */ .o.UV3Kind, parsedGeometry.uvs3, parsedGeometry.uvs3._updatable), parsedGeometry.uvs4 && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV4Kind */ .o.UV4Kind, parsedGeometry.uvs4, parsedGeometry.uvs4._updatable), parsedGeometry.uvs5 && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV5Kind */ .o.UV5Kind, parsedGeometry.uvs5, parsedGeometry.uvs5._updatable), parsedGeometry.uvs6 && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV6Kind */ .o.UV6Kind, parsedGeometry.uvs6, parsedGeometry.uvs6._updatable), parsedGeometry.colors && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.ColorKind */ .o.ColorKind, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4.CheckColors4 */ .HE.CheckColors4(parsedGeometry.colors, parsedGeometry.positions.length / 3), parsedGeometry.colors._updatable), parsedGeometry.matricesIndices) if (!parsedGeometry.matricesIndices._isExpanded) {const floatIndices = [];for (let i = 0; i < parsedGeometry.matricesIndices.length; i++) {const matricesIndex = parsedGeometry.matricesIndices[i];floatIndices.push(255 & matricesIndex), floatIndices.push((65280 & matricesIndex) >> 8), floatIndices.push((16711680 & matricesIndex) >> 16), floatIndices.push(255 & matricesIndex >> 24);}mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind, floatIndices, parsedGeometry.matricesIndices._updatable);} else delete parsedGeometry.matricesIndices._isExpanded, mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind, parsedGeometry.matricesIndices, parsedGeometry.matricesIndices._updatable);if (parsedGeometry.matricesIndicesExtra) if (!parsedGeometry.matricesIndicesExtra._isExpanded) {const floatIndices = [];for (let i = 0; i < parsedGeometry.matricesIndicesExtra.length; i++) {const matricesIndex = parsedGeometry.matricesIndicesExtra[i];floatIndices.push(255 & matricesIndex), floatIndices.push((65280 & matricesIndex) >> 8), floatIndices.push((16711680 & matricesIndex) >> 16), floatIndices.push(255 & matricesIndex >> 24);}mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind, floatIndices, parsedGeometry.matricesIndicesExtra._updatable);} else delete parsedGeometry.matricesIndices._isExpanded, mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind, parsedGeometry.matricesIndicesExtra, parsedGeometry.matricesIndicesExtra._updatable);parsedGeometry.matricesWeights && (Geometry._CleanMatricesWeights(parsedGeometry, mesh), mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, parsedGeometry.matricesWeights, parsedGeometry.matricesWeights._updatable)), parsedGeometry.matricesWeightsExtra && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind, parsedGeometry.matricesWeightsExtra, parsedGeometry.matricesWeights._updatable), mesh.setIndices(parsedGeometry.indices, null);}if (parsedGeometry.subMeshes) {mesh.subMeshes = [];for (let subIndex = 0; subIndex < parsedGeometry.subMeshes.length; subIndex++) {const parsedSubMesh = parsedGeometry.subMeshes[subIndex];_Meshes_subMesh_js__WEBPACK_IMPORTED_MODULE_4__/* .SubMesh.AddToMesh */ .P.AddToMesh(parsedSubMesh.materialIndex, parsedSubMesh.verticesStart, parsedSubMesh.verticesCount, parsedSubMesh.indexStart, parsedSubMesh.indexCount, mesh);}}mesh._shouldGenerateFlatShading && (mesh.convertToFlatShadedMesh(), mesh._shouldGenerateFlatShading = !1), mesh.computeWorldMatrix(!0), scene.onMeshImportedObservable.notifyObservers(mesh);}static _CleanMatricesWeights(parsedGeometry, mesh) {const epsilon = 1e-3;if (!_Loading_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_5__/* .SceneLoaderFlags.CleanBoneMatrixWeights */ .Z.CleanBoneMatrixWeights) return;let noInfluenceBoneIndex = 0;if (-1 < parsedGeometry.skeletonId) {const skeleton = mesh.getScene().getLastSkeletonById(parsedGeometry.skeletonId);if (!skeleton) return;noInfluenceBoneIndex = skeleton.bones.length;} else return;const matricesIndices = mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind),matricesIndicesExtra = mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind),matricesWeights = parsedGeometry.matricesWeights,matricesWeightsExtra = parsedGeometry.matricesWeightsExtra,influencers = parsedGeometry.numBoneInfluencer,size = matricesWeights.length;for (let i = 0; i < size; i += 4) {let weight = 0,firstZeroWeight = -1;for (let j = 0; 4 > j; j++) {const w = matricesWeights[i + j];weight += w, w < epsilon && 0 > firstZeroWeight && (firstZeroWeight = j);}if (matricesWeightsExtra) for (let j = 0; 4 > j; j++) {const w = matricesWeightsExtra[i + j];weight += w, w < epsilon && 0 > firstZeroWeight && (firstZeroWeight = j + 4);}if ((0 > firstZeroWeight || firstZeroWeight > influencers - 1) && (firstZeroWeight = influencers - 1), weight > epsilon) {const mweight = 1 / weight;for (let j = 0; 4 > j; j++) matricesWeights[i + j] *= mweight;if (matricesWeightsExtra) for (let j = 0; 4 > j; j++) matricesWeightsExtra[i + j] *= mweight;} else 4 <= firstZeroWeight ? (matricesWeightsExtra[i + firstZeroWeight - 4] = 1 - weight, matricesIndicesExtra[i + firstZeroWeight - 4] = noInfluenceBoneIndex) : (matricesWeights[i + firstZeroWeight] = 1 - weight, matricesIndices[i + firstZeroWeight] = noInfluenceBoneIndex);}mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind, matricesIndices), parsedGeometry.matricesWeightsExtra && mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind, matricesIndicesExtra);}static Parse(parsedVertexData, scene, rootUrl) {const geometry = new Geometry(parsedVertexData.id, scene, void 0, parsedVertexData.updatable);return geometry._loadedUniqueId = parsedVertexData.uniqueId, _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags.AddTagsTo */ .$.AddTagsTo(geometry, parsedVertexData.tags), parsedVertexData.delayLoadingFile ? (geometry.delayLoadState = 4, geometry.delayLoadingFile = rootUrl + parsedVertexData.delayLoadingFile, geometry._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_6__/* .BoundingInfo */ .j(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(parsedVertexData.boundingBoxMinimum), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3.FromArray */ .P.FromArray(parsedVertexData.boundingBoxMaximum)), geometry._delayInfo = [], parsedVertexData.hasUVs && geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UVKind */ .o.UVKind), parsedVertexData.hasUVs2 && geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV2Kind */ .o.UV2Kind), parsedVertexData.hasUVs3 && geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV3Kind */ .o.UV3Kind), parsedVertexData.hasUVs4 && geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV4Kind */ .o.UV4Kind), parsedVertexData.hasUVs5 && geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV5Kind */ .o.UV5Kind), parsedVertexData.hasUVs6 && geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UV6Kind */ .o.UV6Kind), parsedVertexData.hasColors && geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.ColorKind */ .o.ColorKind), parsedVertexData.hasMatricesIndices && geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind), parsedVertexData.hasMatricesWeights && geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind), geometry._delayLoadingFunction = _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexData.ImportVertexData */ .x.ImportVertexData) : _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexData.ImportVertexData */ .x.ImportVertexData(parsedVertexData, geometry), scene.pushGeometry(geometry, !0), geometry;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/instancedMesh.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "S": () => (/* binding */ InstancedMesh)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/abstractMesh.js");
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.js");
/* harmony import */ var _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/deepCopier.js");
/* harmony import */ var _transformNode_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/transformNode.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh._instancedMeshFactory */ .Kj._instancedMeshFactory = (name, mesh) => {const instance = new InstancedMesh(name, mesh);if (mesh.instancedBuffers) for (const key in instance.instancedBuffers = {}, mesh.instancedBuffers) instance.instancedBuffers[key] = mesh.instancedBuffers[key];return instance;};class InstancedMesh extends _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_2__/* .AbstractMesh */ .x {constructor(name, source) {super(name, source.getScene()), this._indexInSourceMeshInstanceArray = -1, this._distanceToCamera = 0, source.addInstance(this), this._sourceMesh = source, this._unIndexed = source._unIndexed, this.position.copyFrom(source.position), this.rotation.copyFrom(source.rotation), this.scaling.copyFrom(source.scaling), source.rotationQuaternion && (this.rotationQuaternion = source.rotationQuaternion.clone()), this.animations = source.animations.slice();for (const range of source.getAnimationRanges()) null != range && this.createAnimationRange(range.name, range.from, range.to);this.infiniteDistance = source.infiniteDistance, this.setPivotMatrix(source.getPivotMatrix()), this.refreshBoundingInfo(!0, !0), this._syncSubMeshes();}getClassName() {return "InstancedMesh";}get lightSources() {return this._sourceMesh._lightSources;}_resyncLightSources() {}_resyncLightSource() {}_removeLightSource() {}get receiveShadows() {return this._sourceMesh.receiveShadows;}get material() {return this._sourceMesh.material;}get visibility() {return this._sourceMesh.visibility;}get skeleton() {return this._sourceMesh.skeleton;}get renderingGroupId() {return this._sourceMesh.renderingGroupId;}set renderingGroupId(value) {this._sourceMesh && value !== this._sourceMesh.renderingGroupId && _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger.Warn */ .Y.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene");}getTotalVertices() {return this._sourceMesh ? this._sourceMesh.getTotalVertices() : 0;}getTotalIndices() {return this._sourceMesh.getTotalIndices();}get sourceMesh() {return this._sourceMesh;}createInstance(name) {return this._sourceMesh.createInstance(name);}isReady(completeCheck = !1) {return this._sourceMesh.isReady(completeCheck, !0);}getVerticesData(kind, copyWhenShared) {return this._sourceMesh.getVerticesData(kind, copyWhenShared);}setVerticesData(kind, data, updatable, stride) {return this.sourceMesh && this.sourceMesh.setVerticesData(kind, data, updatable, stride), this.sourceMesh;}updateVerticesData(kind, data, updateExtends, makeItUnique) {return this.sourceMesh && this.sourceMesh.updateVerticesData(kind, data, updateExtends, makeItUnique), this.sourceMesh;}setIndices(indices, totalVertices = null) {return this.sourceMesh && this.sourceMesh.setIndices(indices, totalVertices), this.sourceMesh;}isVerticesDataPresent(kind) {return this._sourceMesh.isVerticesDataPresent(kind);}getIndices() {return this._sourceMesh.getIndices();}get _positions() {return this._sourceMesh._positions;}refreshBoundingInfo(applySkeleton = !1, applyMorph = !1) {if (this.hasBoundingInfo && this.getBoundingInfo().isLocked) return this;const bias = this._sourceMesh.geometry ? this._sourceMesh.geometry.boundingBias : null;return this._refreshBoundingInfo(this._sourceMesh._getPositionData(applySkeleton, applyMorph), bias), this;}_preActivate() {return this._currentLOD && this._currentLOD._preActivate(), this;}_activate(renderId, intermediateRendering) {if (super._activate(renderId, intermediateRendering), this._sourceMesh.subMeshes || _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger.Warn */ .Y.Warn("Instances should only be created for meshes with geometry."), this._currentLOD) {const differentSign = 0 <= this._currentLOD._getWorldMatrixDeterminant() != 0 <= this._getWorldMatrixDeterminant();if (differentSign) return this._internalAbstractMeshDataInfo._actAsRegularMesh = !0, !0;if (this._internalAbstractMeshDataInfo._actAsRegularMesh = !1, this._currentLOD._registerInstanceForRenderId(this, renderId), intermediateRendering) {if (!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate) return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = !0, !0;} else if (!this._currentLOD._internalAbstractMeshDataInfo._isActive) return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances = !0, !0;}return !1;}_postActivate() {this._sourceMesh.edgesShareWithInstances && this._sourceMesh._edgesRenderer && this._sourceMesh._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup ? (this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer), this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())) : this._edgesRenderer && this._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup && this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer);}getWorldMatrix() {if (this._currentLOD && this._currentLOD.billboardMode !== _transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode.BILLBOARDMODE_NONE */ .Y.BILLBOARDMODE_NONE && this._currentLOD._masterMesh !== this) {this._billboardWorldMatrix || (this._billboardWorldMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .y3());const tempMaster = this._currentLOD._masterMesh;return this._currentLOD._masterMesh = this, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Vector3[7].copyFrom */ .jp.Vector3[7].copyFrom(this._currentLOD.position), this._currentLOD.position.set(0, 0, 0), this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)), this._currentLOD.position.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors.Vector3[7] */ .jp.Vector3[7]), this._currentLOD._masterMesh = tempMaster, this._billboardWorldMatrix;}return super.getWorldMatrix();}get isAnInstance() {return !0;}getLOD(camera) {if (!camera) return this;const sourceMeshLODLevels = this.sourceMesh.getLODLevels();if (!sourceMeshLODLevels || 0 === sourceMeshLODLevels.length) this._currentLOD = this.sourceMesh;else {const boundingInfo = this.getBoundingInfo();this._currentLOD = this.sourceMesh.getLOD(camera, boundingInfo.boundingSphere);}return this._currentLOD;}_preActivateForIntermediateRendering(renderId) {return this.sourceMesh._preActivateForIntermediateRendering(renderId);}_syncSubMeshes() {if (this.releaseSubMeshes(), this._sourceMesh.subMeshes) for (let index = 0; index < this._sourceMesh.subMeshes.length; index++) this._sourceMesh.subMeshes[index].clone(this, this._sourceMesh);return this;}_generatePointsArray() {return this._sourceMesh._generatePointsArray();}_updateBoundingInfo() {return this.hasBoundingInfo ? this.getBoundingInfo().update(this.worldMatrixFromCache) : this.buildBoundingInfo(this.absolutePosition, this.absolutePosition, this.worldMatrixFromCache), this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache), this;}clone(name, newParent = null, doNotCloneChildren, newSourceMesh) {const result = (newSourceMesh || this._sourceMesh).createInstance(name);if (_Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_4__/* .DeepCopier.DeepCopy */ .j.DeepCopy(this, result, ["name", "subMeshes", "uniqueId", "parent", "lightSources", "receiveShadows", "material", "visibility", "skeleton", "sourceMesh", "isAnInstance", "facetNb", "isFacetDataEnabled", "isBlocked", "useBones", "hasInstances", "collider", "edgesRenderer", "forward", "up", "right", "absolutePosition", "absoluteScaling", "absoluteRotationQuaternion", "isWorldMatrixFrozen", "nonUniformScaling", "behaviors", "worldMatrixFromCache", "hasThinInstances", "hasBoundingInfo"], []), this.refreshBoundingInfo(), newParent && (result.parent = newParent), !doNotCloneChildren) for (let index = 0; index < this.getScene().meshes.length; index++) {const mesh = this.getScene().meshes[index];mesh.parent === this && mesh.clone(mesh.name, result);}return result.computeWorldMatrix(!0), this.onClonedObservable.notifyObservers(result), result;}dispose(doNotRecurse, disposeMaterialAndTextures = !1) {this._sourceMesh.removeInstance(this), super.dispose(doNotRecurse, disposeMaterialAndTextures);}_serializeAsParent(serializationObject) {super._serializeAsParent(serializationObject), serializationObject.parentId = this._sourceMesh.uniqueId, serializationObject.parentInstanceIndex = this._indexInSourceMeshInstanceArray;}instantiateHierarchy(newParent = null, options, onNewNodeCreated) {const clone = this.clone("Clone of " + (this.name || this.id), newParent || this.parent, !0, options && options.newSourcedMesh);clone && onNewNodeCreated && onNewNodeCreated(this, clone);for (const child of this.getChildTransformNodes(!0)) child.instantiateHierarchy(clone, options, onNewNodeCreated);return clone;}}_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh.prototype.registerInstancedBuffer */ .Kj.prototype.registerInstancedBuffer = function (kind, stride) {var _a, _b;if (null === (_b = null === (_a = this._userInstancedBuffersStorage) || void 0 === _a ? void 0 : _a.vertexBuffers[kind]) || void 0 === _b ? void 0 : _b.dispose(), !this.instancedBuffers) {this.instancedBuffers = {};for (const instance of this.instances) instance.instancedBuffers = {};this._userInstancedBuffersStorage || (this._userInstancedBuffersStorage = { data: {}, vertexBuffers: {}, strides: {}, sizes: {}, vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : void 0 });}this.instancedBuffers[kind] = null, this._userInstancedBuffersStorage.strides[kind] = stride, this._userInstancedBuffersStorage.sizes[kind] = 32 * stride, this._userInstancedBuffersStorage.data[kind] = new Float32Array(this._userInstancedBuffersStorage.sizes[kind]), this._userInstancedBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__/* .VertexBuffer */ .o(this.getEngine(), this._userInstancedBuffersStorage.data[kind], kind, !0, !1, stride, !0);for (const instance of this.instances) instance.instancedBuffers[kind] = null;this._invalidateInstanceVertexArrayObject(), this._markSubMeshesAsAttributesDirty();}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh.prototype._processInstancedBuffers */ .Kj.prototype._processInstancedBuffers = function (visibleInstances, renderSelf) {const instanceCount = visibleInstances ? visibleInstances.length : 0;for (const kind in this.instancedBuffers) {let size = this._userInstancedBuffersStorage.sizes[kind];const stride = this._userInstancedBuffersStorage.strides[kind];for (; size < (instanceCount + 1) * stride;) size *= 2;this._userInstancedBuffersStorage.data[kind].length != size && (this._userInstancedBuffersStorage.data[kind] = new Float32Array(size), this._userInstancedBuffersStorage.sizes[kind] = size, this._userInstancedBuffersStorage.vertexBuffers[kind] && (this._userInstancedBuffersStorage.vertexBuffers[kind].dispose(), this._userInstancedBuffersStorage.vertexBuffers[kind] = null));const data = this._userInstancedBuffersStorage.data[kind];let offset = 0;if (renderSelf) {const value = this.instancedBuffers[kind];value.toArray ? value.toArray(data, offset) : value.copyToArray ? value.copyToArray(data, offset) : data[offset] = value, offset += stride;}for (let instanceIndex = 0; instanceIndex < instanceCount; instanceIndex++) {const instance = visibleInstances[instanceIndex],value = instance.instancedBuffers[kind];value.toArray ? value.toArray(data, offset) : value.copyToArray ? value.copyToArray(data, offset) : data[offset] = value, offset += stride;}this._userInstancedBuffersStorage.vertexBuffers[kind] ? this._userInstancedBuffersStorage.vertexBuffers[kind].updateDirectly(data, 0) : (this._userInstancedBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__/* .VertexBuffer */ .o(this.getEngine(), this._userInstancedBuffersStorage.data[kind], kind, !0, !1, stride, !0), this._invalidateInstanceVertexArrayObject());}}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh.prototype._invalidateInstanceVertexArrayObject */ .Kj.prototype._invalidateInstanceVertexArrayObject = function () {if (this._userInstancedBuffersStorage && void 0 !== this._userInstancedBuffersStorage.vertexArrayObjects) {for (const kind in this._userInstancedBuffersStorage.vertexArrayObjects) this.getEngine().releaseVertexArrayObject(this._userInstancedBuffersStorage.vertexArrayObjects[kind]);this._userInstancedBuffersStorage.vertexArrayObjects = {};}}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh.prototype._disposeInstanceSpecificData */ .Kj.prototype._disposeInstanceSpecificData = function () {for (this._instanceDataStorage.instancesBuffer && (this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null); this.instances.length;) this.instances[0].dispose();for (const kind in this.instancedBuffers) this._userInstancedBuffersStorage.vertexBuffers[kind] && this._userInstancedBuffersStorage.vertexBuffers[kind].dispose();this._invalidateInstanceVertexArrayObject(), this.instancedBuffers = {};};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/mesh.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Kj": () => (/* binding */ Mesh),
/* harmony export */   "Wv": () => (/* binding */ _InstancesBatch),
/* harmony export */   "gW": () => (/* binding */ _CreationDataStorage)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/deepCopier.js");
/* harmony import */ var _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tags.js");
/* harmony import */ var _Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/coroutine.js");
/* harmony import */ var _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/camera.js");
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/scene.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js");
/* harmony import */ var _geometry_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/geometry.js");
/* harmony import */ var _abstractMesh_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/abstractMesh.js");
/* harmony import */ var _subMesh_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/subMesh.js");
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.js");
/* harmony import */ var _Materials_multiMaterial_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/multiMaterial.js");
/* harmony import */ var _Loading_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("./node_modules/@babylonjs/core/Loading/sceneLoaderFlags.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
/* harmony import */ var _sceneComponent_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__("./node_modules/@babylonjs/core/sceneComponent.js");
/* harmony import */ var _meshLODLevel_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/meshLODLevel.js");
class _CreationDataStorage {}class _InstanceDataStorage {constructor() {this.visibleInstances = {}, this.batchCache = new _InstancesBatch(), this.batchCacheReplacementModeInFrozenMode = new _InstancesBatch(), this.instancesBufferSize = 2048;}}class _InstancesBatch {constructor() {this.mustReturn = !1, this.visibleInstances = [], this.renderSelf = [], this.hardwareInstancedRendering = [];}}class _ThinInstanceDataStorage {constructor() {this.instancesCount = 0, this.matrixBuffer = null, this.previousMatrixBuffer = null, this.matrixBufferSize = 512, this.matrixData = null, this.boundingVectors = [], this.worldMatrices = null;}}class _InternalMeshDataInfo {constructor() {this._areNormalsFrozen = !1, this._source = null, this.meshMap = null, this._preActivateId = -1, this._LODLevels = [], this._useLODScreenCoverage = !1, this._effectiveMaterial = null, this._forcedInstanceCount = 0;}}class Mesh extends _abstractMesh_js__WEBPACK_IMPORTED_MODULE_13__/* .AbstractMesh */ .x {static _GetDefaultSideOrientation(orientation) {return orientation || Mesh.FRONTSIDE;}get useLODScreenCoverage() {return this._internalMeshDataInfo._useLODScreenCoverage;}set useLODScreenCoverage(value) {this._internalMeshDataInfo._useLODScreenCoverage = value, this._sortLODLevels();}get computeBonesUsingShaders() {return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;}set computeBonesUsingShaders(value) {this._internalAbstractMeshDataInfo._computeBonesUsingShaders === value || (value && this._internalMeshDataInfo._sourcePositions && (this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind, this._internalMeshDataInfo._sourcePositions, !0), this._internalMeshDataInfo._sourceNormals && this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind, this._internalMeshDataInfo._sourceNormals, !0), this._internalMeshDataInfo._sourcePositions = null, this._internalMeshDataInfo._sourceNormals = null), this._internalAbstractMeshDataInfo._computeBonesUsingShaders = value, this._markSubMeshesAsAttributesDirty());}get onBeforeRenderObservable() {return this._internalMeshDataInfo._onBeforeRenderObservable || (this._internalMeshDataInfo._onBeforeRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$()), this._internalMeshDataInfo._onBeforeRenderObservable;}get onBeforeBindObservable() {return this._internalMeshDataInfo._onBeforeBindObservable || (this._internalMeshDataInfo._onBeforeBindObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$()), this._internalMeshDataInfo._onBeforeBindObservable;}get onAfterRenderObservable() {return this._internalMeshDataInfo._onAfterRenderObservable || (this._internalMeshDataInfo._onAfterRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$()), this._internalMeshDataInfo._onAfterRenderObservable;}get onBetweenPassObservable() {return this._internalMeshDataInfo._onBetweenPassObservable || (this._internalMeshDataInfo._onBetweenPassObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$()), this._internalMeshDataInfo._onBetweenPassObservable;}get onBeforeDrawObservable() {return this._internalMeshDataInfo._onBeforeDrawObservable || (this._internalMeshDataInfo._onBeforeDrawObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$()), this._internalMeshDataInfo._onBeforeDrawObservable;}set onBeforeDraw(callback) {this._onBeforeDrawObserver && this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver), this._onBeforeDrawObserver = this.onBeforeDrawObservable.add(callback);}get hasInstances() {return 0 < this.instances.length;}get hasThinInstances() {var _a;return 0 < (null !== (_a = this._thinInstanceDataStorage.instancesCount) && void 0 !== _a ? _a : 0);}get forcedInstanceCount() {return this._internalMeshDataInfo._forcedInstanceCount;}set forcedInstanceCount(count) {this._internalMeshDataInfo._forcedInstanceCount = count;}get source() {return this._internalMeshDataInfo._source;}get cloneMeshMap() {return this._internalMeshDataInfo.meshMap;}get isUnIndexed() {return this._unIndexed;}set isUnIndexed(value) {this._unIndexed !== value && (this._unIndexed = value, this._markSubMeshesAsAttributesDirty());}get worldMatrixInstancedBuffer() {return this._instanceDataStorage.instancesData;}get previousWorldMatrixInstancedBuffer() {return this._instanceDataStorage.instancesPreviousData;}get manualUpdateOfWorldMatrixInstancedBuffer() {return this._instanceDataStorage.manualUpdate;}set manualUpdateOfWorldMatrixInstancedBuffer(value) {this._instanceDataStorage.manualUpdate = value;}get manualUpdateOfPreviousWorldMatrixInstancedBuffer() {return this._instanceDataStorage.previousManualUpdate;}set manualUpdateOfPreviousWorldMatrixInstancedBuffer(value) {this._instanceDataStorage.previousManualUpdate = value;}get forceWorldMatrixInstancedBufferUpdate() {return this._instanceDataStorage.forceMatrixUpdates;}set forceWorldMatrixInstancedBufferUpdate(value) {this._instanceDataStorage.forceMatrixUpdates = value;}constructor(name, scene = null, parent = null, source = null, doNotCloneChildren, clonePhysicsImpostor = !0) {if (super(name, scene), this._internalMeshDataInfo = new _InternalMeshDataInfo(), this.delayLoadState = 0, this.instances = [], this._creationDataStorage = null, this._geometry = null, this._instanceDataStorage = new _InstanceDataStorage(), this._thinInstanceDataStorage = new _ThinInstanceDataStorage(), this._shouldGenerateFlatShading = !1, this._originalBuilderSideOrientation = Mesh.DEFAULTSIDE, this.overrideMaterialSideOrientation = null, this.ignoreCameraMaxZ = !1, scene = this.getScene(), this._onBeforeDraw = (isInstance, world, effectiveMaterial) => {isInstance && effectiveMaterial && (this._uniformBuffer ? this.transferToEffect(world) : effectiveMaterial.bindOnlyWorldMatrix(world));}, source) {if (source._geometry && source._geometry.applyToMesh(this), _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_2__/* .DeepCopier.DeepCopy */ .j.DeepCopy(source, this, ["name", "material", "skeleton", "instances", "parent", "uniqueId", "source", "metadata", "morphTargetManager", "hasInstances", "worldMatrixInstancedBuffer", "previousWorldMatrixInstancedBuffer", "hasLODLevels", "geometry", "isBlocked", "areNormalsFrozen", "facetNb", "isFacetDataEnabled", "lightSources", "useBones", "isAnInstance", "collider", "edgesRenderer", "forward", "up", "right", "absolutePosition", "absoluteScaling", "absoluteRotationQuaternion", "isWorldMatrixFrozen", "nonUniformScaling", "behaviors", "worldMatrixFromCache", "hasThinInstances", "cloneMeshMap", "hasBoundingInfo"], ["_poseMatrix"]), this._internalMeshDataInfo._source = source, scene.useClonedMeshMap && (!source._internalMeshDataInfo.meshMap && (source._internalMeshDataInfo.meshMap = {}), source._internalMeshDataInfo.meshMap[this.uniqueId] = this), this._originalBuilderSideOrientation = source._originalBuilderSideOrientation, this._creationDataStorage = source._creationDataStorage, source._ranges) {const ranges = source._ranges;for (const name in ranges) Object.prototype.hasOwnProperty.call(ranges, name) && ranges[name] && this.createAnimationRange(name, ranges[name].from, ranges[name].to);}if (this.metadata = source.metadata && source.metadata.clone ? source.metadata.clone() : source.metadata, this._internalMetadata = source._internalMetadata, _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.HasTags */ .$.HasTags(source) && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.AddTagsTo */ .$.AddTagsTo(this, _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.GetTags */ .$.GetTags(source, !0)), this.setEnabled(source.isEnabled(!1)), this.parent = source.parent, this.setPivotMatrix(source.getPivotMatrix()), this.id = name + "." + source.id, this.material = source.material, !doNotCloneChildren) {const directDescendants = source.getDescendants(!0);for (let index = 0; index < directDescendants.length; index++) {const child = directDescendants[index];child.clone && child.clone(name + "." + child.name, this);}}if (source.morphTargetManager && (this.morphTargetManager = source.morphTargetManager), scene.getPhysicsEngine) {const physicsEngine = scene.getPhysicsEngine();if (clonePhysicsImpostor && physicsEngine && 1 === physicsEngine.getPluginVersion()) {const impostor = physicsEngine.getImpostorForPhysicsObject(source);impostor && (this.physicsImpostor = impostor.clone(this));}}for (let index = 0; index < scene.particleSystems.length; index++) {const system = scene.particleSystems[index];system.emitter === source && system.clone(system.name, this);}this.skeleton = source.skeleton, this.refreshBoundingInfo(!0, !0), this.computeWorldMatrix(!0);}null !== parent && (this.parent = parent), this._instanceDataStorage.hardwareInstancedRendering = this.getEngine().getCaps().instancedArrays, this._internalMeshDataInfo._onMeshReadyObserverAdded = (observer) => {observer.unregisterOnNextCall = !0, this.isReady(!0) ? this.onMeshReadyObservable.notifyObservers(this) : !this._internalMeshDataInfo._checkReadinessObserver && (this._internalMeshDataInfo._checkReadinessObserver = this._scene.onBeforeRenderObservable.add(() => {this.isReady(!0) && (this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver), this._internalMeshDataInfo._checkReadinessObserver = null, this.onMeshReadyObservable.notifyObservers(this));}));}, this.onMeshReadyObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(this._internalMeshDataInfo._onMeshReadyObserverAdded), source && source.onClonedObservable.notifyObservers(this);}instantiateHierarchy(newParent = null, options, onNewNodeCreated) {const instance = 0 === this.getTotalVertices() || options && options.doNotInstantiate && (!0 === options.doNotInstantiate || options.doNotInstantiate(this)) ? this.clone("Clone of " + (this.name || this.id), newParent || this.parent, !0) : this.createInstance("instance of " + (this.name || this.id));instance.parent = newParent || this.parent, instance.position = this.position.clone(), instance.scaling = this.scaling.clone(), this.rotationQuaternion ? instance.rotationQuaternion = this.rotationQuaternion.clone() : instance.rotation = this.rotation.clone(), onNewNodeCreated && onNewNodeCreated(this, instance);for (const child of this.getChildTransformNodes(!0)) "InstancedMesh" === child.getClassName() && "Mesh" === instance.getClassName() && child.sourceMesh === this ? child.instantiateHierarchy(instance, { doNotInstantiate: options && options.doNotInstantiate || !1, newSourcedMesh: instance }, onNewNodeCreated) : child.instantiateHierarchy(instance, options, onNewNodeCreated);return instance;}getClassName() {return "Mesh";}get _isMesh() {return !0;}toString(fullDetails) {let ret = super.toString(fullDetails);if (ret += ", n vertices: " + this.getTotalVertices(), ret += ", parent: " + (this._waitingParentId ? this._waitingParentId : this.parent ? this.parent.name : "NONE"), this.animations) for (let i = 0; i < this.animations.length; i++) ret += ", animation[0]: " + this.animations[i].toString(fullDetails);if (fullDetails) if (this._geometry) {const ib = this.getIndices(),vb = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind);vb && ib && (ret += ", flat shading: " + (vb.length / 3 === ib.length ? "YES" : "NO"));} else ret += ", flat shading: UNKNOWN";return ret;}_unBindEffect() {super._unBindEffect();for (const instance of this.instances) instance._unBindEffect();}get hasLODLevels() {return 0 < this._internalMeshDataInfo._LODLevels.length;}getLODLevels() {return this._internalMeshDataInfo._LODLevels;}_sortLODLevels() {const sortingOrderFactor = this._internalMeshDataInfo._useLODScreenCoverage ? -1 : 1;this._internalMeshDataInfo._LODLevels.sort((a, b) => a.distanceOrScreenCoverage < b.distanceOrScreenCoverage ? sortingOrderFactor : a.distanceOrScreenCoverage > b.distanceOrScreenCoverage ? -sortingOrderFactor : 0);}addLODLevel(distanceOrScreenCoverage, mesh) {if (mesh && mesh._masterMesh) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__/* .Logger.Warn */ .Y.Warn("You cannot use a mesh as LOD level twice"), this;const level = new _meshLODLevel_js__WEBPACK_IMPORTED_MODULE_23__/* .MeshLODLevel */ .g(distanceOrScreenCoverage, mesh);return this._internalMeshDataInfo._LODLevels.push(level), mesh && (mesh._masterMesh = this), this._sortLODLevels(), this;}getLODLevelAtDistance(distance) {const internalDataInfo = this._internalMeshDataInfo;for (let index = 0; index < internalDataInfo._LODLevels.length; index++) {const level = internalDataInfo._LODLevels[index];if (level.distanceOrScreenCoverage === distance) return level.mesh;}return null;}removeLODLevel(mesh) {const internalDataInfo = this._internalMeshDataInfo;for (let index = 0; index < internalDataInfo._LODLevels.length; index++) internalDataInfo._LODLevels[index].mesh === mesh && (internalDataInfo._LODLevels.splice(index, 1), mesh && (mesh._masterMesh = null));return this._sortLODLevels(), this;}getLOD(camera, boundingSphere) {const internalDataInfo = this._internalMeshDataInfo;if (!internalDataInfo._LODLevels || 0 === internalDataInfo._LODLevels.length) return this;const bSphere = boundingSphere || this.getBoundingInfo().boundingSphere,distanceToCamera = camera.mode === _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_5__/* .Camera.ORTHOGRAPHIC_CAMERA */ .V.ORTHOGRAPHIC_CAMERA ? camera.minZ : bSphere.centerWorld.subtract(camera.globalPosition).length();let compareValue = distanceToCamera,compareSign = 1;if (internalDataInfo._useLODScreenCoverage) {const screenArea = camera.screenArea;let meshArea = bSphere.radiusWorld * camera.minZ / distanceToCamera;meshArea = meshArea * meshArea * Math.PI, compareValue = meshArea / screenArea, compareSign = -1;}if (compareSign * internalDataInfo._LODLevels[internalDataInfo._LODLevels.length - 1].distanceOrScreenCoverage > compareSign * compareValue) return this.onLODLevelSelection && this.onLODLevelSelection(compareValue, this, this), this;for (let index = 0; index < internalDataInfo._LODLevels.length; index++) {const level = internalDataInfo._LODLevels[index];if (compareSign * level.distanceOrScreenCoverage < compareSign * compareValue) {if (level.mesh) {if (4 === level.mesh.delayLoadState) return level.mesh._checkDelayState(), this;if (2 === level.mesh.delayLoadState) return this;level.mesh._preActivate(), level.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);}return this.onLODLevelSelection && this.onLODLevelSelection(compareValue, this, level.mesh), level.mesh;}}return this.onLODLevelSelection && this.onLODLevelSelection(compareValue, this, this), this;}get geometry() {return this._geometry;}getTotalVertices() {return null === this._geometry || void 0 === this._geometry ? 0 : this._geometry.getTotalVertices();}getVerticesData(kind, copyWhenShared, forceCopy) {var _a, _b;if (!this._geometry) return null;let data = null === (_b = null === (_a = this._userInstancedBuffersStorage) || void 0 === _a ? void 0 : _a.vertexBuffers[kind]) || void 0 === _b ? void 0 : _b.getFloatData(this._geometry.getTotalVertices(), forceCopy || copyWhenShared && 1 !== this._geometry.meshes.length);return data || (data = this._geometry.getVerticesData(kind, copyWhenShared, forceCopy)), data;}getVertexBuffer(kind) {var _a, _b;return this._geometry ? null !== (_b = null === (_a = this._userInstancedBuffersStorage) || void 0 === _a ? void 0 : _a.vertexBuffers[kind]) && void 0 !== _b ? _b : this._geometry.getVertexBuffer(kind) : null;}isVerticesDataPresent(kind) {var _a;return this._geometry ? (null === (_a = this._userInstancedBuffersStorage) || void 0 === _a ? void 0 : _a.vertexBuffers[kind]) !== void 0 || this._geometry.isVerticesDataPresent(kind) : !!this._delayInfo && -1 !== this._delayInfo.indexOf(kind);}isVertexBufferUpdatable(kind) {var _a, _b;return this._geometry ? (null === (_b = null === (_a = this._userInstancedBuffersStorage) || void 0 === _a ? void 0 : _a.vertexBuffers[kind]) || void 0 === _b ? void 0 : _b.isUpdatable()) || this._geometry.isVertexBufferUpdatable(kind) : !!this._delayInfo && -1 !== this._delayInfo.indexOf(kind);}getVerticesDataKinds() {if (!this._geometry) {const result = [];return this._delayInfo && this._delayInfo.forEach(function (kind) {result.push(kind);}), result;}const kinds = this._geometry.getVerticesDataKinds();if (this._userInstancedBuffersStorage) for (const kind in this._userInstancedBuffersStorage.vertexBuffers) kinds.push(kind);return kinds;}getTotalIndices() {return this._geometry ? this._geometry.getTotalIndices() : 0;}getIndices(copyWhenShared, forceCopy) {return this._geometry ? this._geometry.getIndices(copyWhenShared, forceCopy) : [];}get isBlocked() {return null !== this._masterMesh && this._masterMesh !== void 0;}isReady(completeCheck = !1, forceInstanceSupport = !1) {var _a, _b, _c, _d, _e, _f;if (2 === this.delayLoadState) return !1;if (!super.isReady(completeCheck)) return !1;if (!this.subMeshes || 0 === this.subMeshes.length) return !0;if (!completeCheck) return !0;const engine = this.getEngine(),scene = this.getScene(),hardwareInstancedRendering = forceInstanceSupport || engine.getCaps().instancedArrays && (0 < this.instances.length || this.hasThinInstances);this.computeWorldMatrix();const mat = this.material || scene.defaultMaterial;if (mat) if (mat._storeEffectOnSubMeshes) for (const subMesh of this.subMeshes) {const effectiveMaterial = subMesh.getMaterial();if (effectiveMaterial) if (effectiveMaterial._storeEffectOnSubMeshes) {if (!effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) return !1;} else if (!effectiveMaterial.isReady(this, hardwareInstancedRendering)) return !1;} else if (!mat.isReady(this, hardwareInstancedRendering)) return !1;const currentRenderPassId = engine.currentRenderPassId;for (const light of this.lightSources) {const generators = light.getShadowGenerators();if (!generators) continue;const iterator = generators.values();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const generator = key.value;if (generator && (!(null !== (_a = generator.getShadowMap()) && void 0 !== _a) || !_a.renderList || (null === (_b = generator.getShadowMap()) || void 0 === _b ? void 0 : _b.renderList) && -1 !== (null === (_d = null === (_c = generator.getShadowMap()) || void 0 === _c ? void 0 : _c.renderList) || void 0 === _d ? void 0 : _d.indexOf(this)))) {generator.getShadowMap() && (engine.currentRenderPassId = generator.getShadowMap().renderPassId);for (const subMesh of this.subMeshes) if (!generator.isReady(subMesh, hardwareInstancedRendering, null !== (_f = null === (_e = subMesh.getMaterial()) || void 0 === _e ? void 0 : _e.needAlphaBlendingForMesh(this)) && void 0 !== _f && _f)) return engine.currentRenderPassId = currentRenderPassId, !1;engine.currentRenderPassId = currentRenderPassId;}}}for (const lod of this._internalMeshDataInfo._LODLevels) if (lod.mesh && !lod.mesh.isReady(hardwareInstancedRendering)) return !1;return !0;}get areNormalsFrozen() {return this._internalMeshDataInfo._areNormalsFrozen;}freezeNormals() {return this._internalMeshDataInfo._areNormalsFrozen = !0, this;}unfreezeNormals() {return this._internalMeshDataInfo._areNormalsFrozen = !1, this;}set overridenInstanceCount(count) {this._instanceDataStorage.overridenInstanceCount = count;}_preActivate() {const internalDataInfo = this._internalMeshDataInfo,sceneRenderId = this.getScene().getRenderId();return internalDataInfo._preActivateId === sceneRenderId ? this : (internalDataInfo._preActivateId = sceneRenderId, this._instanceDataStorage.visibleInstances = null, this);}_preActivateForIntermediateRendering(renderId) {return this._instanceDataStorage.visibleInstances && (this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId = renderId), this;}_registerInstanceForRenderId(instance, renderId) {return this._instanceDataStorage.visibleInstances || (this._instanceDataStorage.visibleInstances = { defaultRenderId: renderId, selfDefaultRenderId: this._renderId }), this._instanceDataStorage.visibleInstances[renderId] || (void 0 !== this._instanceDataStorage.previousRenderId && this._instanceDataStorage.isFrozen && (this._instanceDataStorage.visibleInstances[this._instanceDataStorage.previousRenderId] = null), this._instanceDataStorage.previousRenderId = renderId, this._instanceDataStorage.visibleInstances[renderId] = []), this._instanceDataStorage.visibleInstances[renderId].push(instance), this;}_afterComputeWorldMatrix() {super._afterComputeWorldMatrix();this.hasThinInstances && (this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1));}_postActivate() {this.edgesShareWithInstances && this.edgesRenderer && this.edgesRenderer.isEnabled && this._renderingGroup && (this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer), this.edgesRenderer.customInstances.push(this.getWorldMatrix()));}refreshBoundingInfo(applySkeleton = !1, applyMorph = !1) {if (this.hasBoundingInfo && this.getBoundingInfo().isLocked) return this;const bias = this.geometry ? this.geometry.boundingBias : null;return this._refreshBoundingInfo(this._getPositionData(applySkeleton, applyMorph), bias), this;}_createGlobalSubMesh(force) {const totalVertices = this.getTotalVertices();if (!totalVertices || !this.getIndices()) return null;if (this.subMeshes && 0 < this.subMeshes.length) {const ib = this.getIndices();if (!ib) return null;const totalIndices = ib.length;let needToRecreate = !1;if (force) needToRecreate = !0;else for (const submesh of this.subMeshes) {if (submesh.indexStart + submesh.indexCount > totalIndices) {needToRecreate = !0;break;}if (submesh.verticesStart + submesh.verticesCount > totalVertices) {needToRecreate = !0;break;}}if (!needToRecreate) return this.subMeshes[0];}return this.releaseSubMeshes(), new _subMesh_js__WEBPACK_IMPORTED_MODULE_14__/* .SubMesh */ .P(0, 0, totalVertices, 0, this.getTotalIndices(), this);}subdivide(count) {if (1 > count) return;const totalIndices = this.getTotalIndices();let subdivisionSize = 0 | totalIndices / count,offset = 0;for (; 0 != subdivisionSize % 3;) subdivisionSize++;this.releaseSubMeshes();for (let index = 0; index < count && !(offset >= totalIndices); index++) _subMesh_js__WEBPACK_IMPORTED_MODULE_14__/* .SubMesh.CreateFromIndices */ .P.CreateFromIndices(0, offset, index == count - 1 ? totalIndices - offset : subdivisionSize, this), offset += subdivisionSize;this.synchronizeInstances();}setVerticesData(kind, data, updatable = !1, stride) {if (!this._geometry) {const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData */ .x();vertexData.set(data, kind);const scene = this.getScene();new _geometry_js__WEBPACK_IMPORTED_MODULE_12__/* .Geometry */ .Z(_geometry_js__WEBPACK_IMPORTED_MODULE_12__/* .Geometry.RandomId */ .Z.RandomId(), scene, vertexData, updatable, this);} else this._geometry.setVerticesData(kind, data, updatable, stride);return this;}removeVerticesData(kind) {this._geometry && this._geometry.removeVerticesData(kind);}markVerticesDataAsUpdatable(kind, updatable = !0) {const vb = this.getVertexBuffer(kind);vb && vb.isUpdatable() !== updatable && this.setVerticesData(kind, this.getVerticesData(kind), updatable);}setVerticesBuffer(buffer, disposeExistingBuffer = !0) {return this._geometry || (this._geometry = _geometry_js__WEBPACK_IMPORTED_MODULE_12__/* .Geometry.CreateGeometryForMesh */ .Z.CreateGeometryForMesh(this)), this._geometry.setVerticesBuffer(buffer, null, disposeExistingBuffer), this;}updateVerticesData(kind, data, updateExtends, makeItUnique) {return this._geometry ? (makeItUnique ? (this.makeGeometryUnique(), this.updateVerticesData(kind, data, updateExtends, !1)) : this._geometry.updateVerticesData(kind, data, updateExtends), this) : this;}updateMeshPositions(positionFunction, computeNormals = !0) {const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind);if (!positions) return this;if (positionFunction(positions), this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind, positions, !1, !1), computeNormals) {const indices = this.getIndices(),normals = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind);if (!normals) return this;_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.ComputeNormals */ .x.ComputeNormals(positions, indices, normals), this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind, normals, !1, !1);}return this;}makeGeometryUnique() {if (!this._geometry) return this;if (1 === this._geometry.meshes.length) return this;const oldGeometry = this._geometry,geometry = this._geometry.copy(_geometry_js__WEBPACK_IMPORTED_MODULE_12__/* .Geometry.RandomId */ .Z.RandomId());return oldGeometry.releaseForMesh(this, !0), geometry.applyToMesh(this), this;}setIndices(indices, totalVertices = null, updatable = !1) {if (!this._geometry) {const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData */ .x();vertexData.indices = indices;const scene = this.getScene();new _geometry_js__WEBPACK_IMPORTED_MODULE_12__/* .Geometry */ .Z(_geometry_js__WEBPACK_IMPORTED_MODULE_12__/* .Geometry.RandomId */ .Z.RandomId(), scene, vertexData, updatable, this);} else this._geometry.setIndices(indices, totalVertices, updatable);return this;}updateIndices(indices, offset, gpuMemoryOnly = !1) {return this._geometry ? (this._geometry.updateIndices(indices, offset, gpuMemoryOnly), this) : this;}toLeftHanded() {return this._geometry ? (this._geometry.toLeftHanded(), this) : this;}_bind(subMesh, effect, fillMode) {if (!this._geometry) return this;const engine = this.getScene().getEngine();this.morphTargetManager && this.morphTargetManager.isUsingTextureForTargets && this.morphTargetManager._bind(effect);let indexToBind;if (this._unIndexed) indexToBind = null;else switch (fillMode) {case _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.PointFillMode */ .F.PointFillMode:indexToBind = null;break;case _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.WireFrameFillMode */ .F.WireFrameFillMode:indexToBind = subMesh._getLinesIndexBuffer(this.getIndices(), engine);break;default:case _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.TriangleFillMode */ .F.TriangleFillMode:indexToBind = this._geometry.getIndexBuffer();}return !this._userInstancedBuffersStorage || this.hasThinInstances ? this._geometry._bind(effect, indexToBind) : this._geometry._bind(effect, indexToBind, this._userInstancedBuffersStorage.vertexBuffers, this._userInstancedBuffersStorage.vertexArrayObjects), this;}_draw(subMesh, fillMode, instancesCount) {if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer()) return this;this._internalMeshDataInfo._onBeforeDrawObservable && this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);const scene = this.getScene(),engine = scene.getEngine();return this._unIndexed || fillMode == _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.PointFillMode */ .F.PointFillMode ? engine.drawArraysType(fillMode, subMesh.verticesStart, subMesh.verticesCount, this.forcedInstanceCount || instancesCount) : fillMode == _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.WireFrameFillMode */ .F.WireFrameFillMode ? engine.drawElementsType(fillMode, 0, subMesh._linesIndexCount, this.forcedInstanceCount || instancesCount) : engine.drawElementsType(fillMode, subMesh.indexStart, subMesh.indexCount, this.forcedInstanceCount || instancesCount), this;}registerBeforeRender(func) {return this.onBeforeRenderObservable.add(func), this;}unregisterBeforeRender(func) {return this.onBeforeRenderObservable.removeCallback(func), this;}registerAfterRender(func) {return this.onAfterRenderObservable.add(func), this;}unregisterAfterRender(func) {return this.onAfterRenderObservable.removeCallback(func), this;}_getInstancesRenderList(subMeshId, isReplacementMode = !1) {if (this._instanceDataStorage.isFrozen) {if (isReplacementMode) return this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[subMeshId] = !1, this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.renderSelf[subMeshId] = !0, this._instanceDataStorage.batchCacheReplacementModeInFrozenMode;if (this._instanceDataStorage.previousBatch) return this._instanceDataStorage.previousBatch;}const scene = this.getScene(),isInIntermediateRendering = scene._isInIntermediateRendering(),onlyForInstances = isInIntermediateRendering ? this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate : this._internalAbstractMeshDataInfo._onlyForInstances,batchCache = this._instanceDataStorage.batchCache;if (batchCache.mustReturn = !1, batchCache.renderSelf[subMeshId] = isReplacementMode || !onlyForInstances && this.isEnabled() && this.isVisible, batchCache.visibleInstances[subMeshId] = null, this._instanceDataStorage.visibleInstances && !isReplacementMode) {const visibleInstances = this._instanceDataStorage.visibleInstances,currentRenderId = scene.getRenderId(),defaultRenderId = isInIntermediateRendering ? visibleInstances.intermediateDefaultRenderId : visibleInstances.defaultRenderId;batchCache.visibleInstances[subMeshId] = visibleInstances[currentRenderId], !batchCache.visibleInstances[subMeshId] && defaultRenderId && (batchCache.visibleInstances[subMeshId] = visibleInstances[defaultRenderId]);}return batchCache.hardwareInstancedRendering[subMeshId] = !isReplacementMode && this._instanceDataStorage.hardwareInstancedRendering && null !== batchCache.visibleInstances[subMeshId] && void 0 !== batchCache.visibleInstances[subMeshId], this._instanceDataStorage.previousBatch = batchCache, batchCache;}_renderWithInstances(subMesh, fillMode, batch, effect, engine) {var _a;const visibleInstances = batch.visibleInstances[subMesh._id],visibleInstanceCount = visibleInstances ? visibleInstances.length : 0,instanceStorage = this._instanceDataStorage,currentInstancesBufferSize = instanceStorage.instancesBufferSize;let instancesBuffer = instanceStorage.instancesBuffer,instancesPreviousBuffer = instanceStorage.instancesPreviousBuffer;for (; instanceStorage.instancesBufferSize < 4 * (16 * (visibleInstanceCount + 1));) instanceStorage.instancesBufferSize *= 2;instanceStorage.instancesData && currentInstancesBufferSize == instanceStorage.instancesBufferSize || (instanceStorage.instancesData = new Float32Array(instanceStorage.instancesBufferSize / 4)), (this._scene.needsPreviousWorldMatrices && !instanceStorage.instancesPreviousData || currentInstancesBufferSize != instanceStorage.instancesBufferSize) && (instanceStorage.instancesPreviousData = new Float32Array(instanceStorage.instancesBufferSize / 4));let offset = 0,instancesCount = 0;const renderSelf = batch.renderSelf[subMesh._id],needUpdateBuffer = !instancesBuffer || currentInstancesBufferSize !== instanceStorage.instancesBufferSize || this._scene.needsPreviousWorldMatrices && !instanceStorage.instancesPreviousBuffer;if (!this._instanceDataStorage.manualUpdate && (!instanceStorage.isFrozen || needUpdateBuffer)) {const world = this.getWorldMatrix();if (renderSelf && (this._scene.needsPreviousWorldMatrices && (instanceStorage.masterMeshPreviousWorldMatrix ? (instanceStorage.masterMeshPreviousWorldMatrix.copyToArray(instanceStorage.instancesPreviousData, offset), instanceStorage.masterMeshPreviousWorldMatrix.copyFrom(world)) : (instanceStorage.masterMeshPreviousWorldMatrix = world.clone(), instanceStorage.masterMeshPreviousWorldMatrix.copyToArray(instanceStorage.instancesPreviousData, offset))), world.copyToArray(instanceStorage.instancesData, offset), offset += 16, instancesCount++), visibleInstances) {if (Mesh.INSTANCEDMESH_SORT_TRANSPARENT && this._scene.activeCamera && (null === (_a = subMesh.getMaterial()) || void 0 === _a ? void 0 : _a.needAlphaBlendingForMesh(subMesh.getRenderingMesh()))) {const cameraPosition = this._scene.activeCamera.globalPosition;for (let instanceIndex = 0; instanceIndex < visibleInstances.length; instanceIndex++) {const instanceMesh = visibleInstances[instanceIndex];instanceMesh._distanceToCamera = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Distance */ .P.Distance(instanceMesh.getBoundingInfo().boundingSphere.centerWorld, cameraPosition);}visibleInstances.sort((m1, m2) => m1._distanceToCamera > m2._distanceToCamera ? -1 : m1._distanceToCamera < m2._distanceToCamera ? 1 : 0);}for (let instanceIndex = 0; instanceIndex < visibleInstances.length; instanceIndex++) {const instance = visibleInstances[instanceIndex],matrix = instance.getWorldMatrix();matrix.copyToArray(instanceStorage.instancesData, offset), this._scene.needsPreviousWorldMatrices && (instance._previousWorldMatrix ? (instance._previousWorldMatrix.copyToArray(instanceStorage.instancesPreviousData, offset), instance._previousWorldMatrix.copyFrom(matrix)) : (instance._previousWorldMatrix = matrix.clone(), instance._previousWorldMatrix.copyToArray(instanceStorage.instancesPreviousData, offset))), offset += 16, instancesCount++;}}} else instancesCount = (renderSelf ? 1 : 0) + visibleInstanceCount;return needUpdateBuffer ? (instancesBuffer && instancesBuffer.dispose(), instancesPreviousBuffer && instancesPreviousBuffer.dispose(), instancesBuffer = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .Buffer */ .l(engine, instanceStorage.instancesData, !0, 16, !1, !0), instanceStorage.instancesBuffer = instancesBuffer, !this._userInstancedBuffersStorage && (this._userInstancedBuffersStorage = { data: {}, vertexBuffers: {}, strides: {}, sizes: {}, vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : void 0 }), this._userInstancedBuffersStorage.vertexBuffers.world0 = instancesBuffer.createVertexBuffer("world0", 0, 4), this._userInstancedBuffersStorage.vertexBuffers.world1 = instancesBuffer.createVertexBuffer("world1", 4, 4), this._userInstancedBuffersStorage.vertexBuffers.world2 = instancesBuffer.createVertexBuffer("world2", 8, 4), this._userInstancedBuffersStorage.vertexBuffers.world3 = instancesBuffer.createVertexBuffer("world3", 12, 4), this._scene.needsPreviousWorldMatrices && (instancesPreviousBuffer = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .Buffer */ .l(engine, instanceStorage.instancesPreviousData, !0, 16, !1, !0), instanceStorage.instancesPreviousBuffer = instancesPreviousBuffer, this._userInstancedBuffersStorage.vertexBuffers.previousWorld0 = instancesPreviousBuffer.createVertexBuffer("previousWorld0", 0, 4), this._userInstancedBuffersStorage.vertexBuffers.previousWorld1 = instancesPreviousBuffer.createVertexBuffer("previousWorld1", 4, 4), this._userInstancedBuffersStorage.vertexBuffers.previousWorld2 = instancesPreviousBuffer.createVertexBuffer("previousWorld2", 8, 4), this._userInstancedBuffersStorage.vertexBuffers.previousWorld3 = instancesPreviousBuffer.createVertexBuffer("previousWorld3", 12, 4)), this._invalidateInstanceVertexArrayObject()) : (!this._instanceDataStorage.isFrozen || this._instanceDataStorage.forceMatrixUpdates) && (instancesBuffer.updateDirectly(instanceStorage.instancesData, 0, instancesCount), this._scene.needsPreviousWorldMatrices && (!this._instanceDataStorage.manualUpdate || this._instanceDataStorage.previousManualUpdate) && instancesPreviousBuffer.updateDirectly(instanceStorage.instancesPreviousData, 0, instancesCount)), this._processInstancedBuffers(visibleInstances, renderSelf), this.getScene()._activeIndices.addCount(subMesh.indexCount * instancesCount, !1), engine._currentDrawContext && (engine._currentDrawContext.useInstancing = !0), this._bind(subMesh, effect, fillMode), this._draw(subMesh, fillMode, instancesCount), this._scene.needsPreviousWorldMatrices && !needUpdateBuffer && this._instanceDataStorage.manualUpdate && (!this._instanceDataStorage.isFrozen || this._instanceDataStorage.forceMatrixUpdates) && !this._instanceDataStorage.previousManualUpdate && instancesPreviousBuffer.updateDirectly(instanceStorage.instancesData, 0, instancesCount), engine.unbindInstanceAttributes(), this;}_renderWithThinInstances(subMesh, fillMode, effect, engine) {var _a, _b;const instancesCount = null !== (_b = null === (_a = this._thinInstanceDataStorage) || void 0 === _a ? void 0 : _a.instancesCount) && void 0 !== _b ? _b : 0;this.getScene()._activeIndices.addCount(subMesh.indexCount * instancesCount, !1), engine._currentDrawContext && (engine._currentDrawContext.useInstancing = !0), this._bind(subMesh, effect, fillMode), this._draw(subMesh, fillMode, instancesCount), this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData && this._thinInstanceDataStorage.matrixData && (this._thinInstanceDataStorage.previousMatrixBuffer ? this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, instancesCount) : this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", this._thinInstanceDataStorage.matrixData, !1)), engine.unbindInstanceAttributes();}_processInstancedBuffers() {}_processRendering(renderingMesh, subMesh, effect, fillMode, batch, hardwareInstancedRendering, onBeforeDraw, effectiveMaterial) {const scene = this.getScene(),engine = scene.getEngine();if (hardwareInstancedRendering && subMesh.getRenderingMesh().hasThinInstances) return this._renderWithThinInstances(subMesh, fillMode, effect, engine), this;if (hardwareInstancedRendering) this._renderWithInstances(subMesh, fillMode, batch, effect, engine);else {engine._currentDrawContext && (engine._currentDrawContext.useInstancing = !1);let instanceCount = 0;batch.renderSelf[subMesh._id] && (onBeforeDraw && onBeforeDraw(!1, renderingMesh.getWorldMatrix(), effectiveMaterial), instanceCount++, this._draw(subMesh, fillMode, this._instanceDataStorage.overridenInstanceCount));const visibleInstancesForSubMesh = batch.visibleInstances[subMesh._id];if (visibleInstancesForSubMesh) {const visibleInstanceCount = visibleInstancesForSubMesh.length;instanceCount += visibleInstanceCount;for (let instanceIndex = 0; instanceIndex < visibleInstanceCount; instanceIndex++) {const instance = visibleInstancesForSubMesh[instanceIndex],world = instance.getWorldMatrix();onBeforeDraw && onBeforeDraw(!0, world, effectiveMaterial), this._draw(subMesh, fillMode);}}scene._activeIndices.addCount(subMesh.indexCount * instanceCount, !1);}return this;}_rebuild(dispose = !1) {if (this._instanceDataStorage.instancesBuffer && (dispose && this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null), this._userInstancedBuffersStorage) {for (const kind in this._userInstancedBuffersStorage.vertexBuffers) {const buffer = this._userInstancedBuffersStorage.vertexBuffers[kind];buffer && (dispose && buffer.dispose(), this._userInstancedBuffersStorage.vertexBuffers[kind] = null);}this._userInstancedBuffersStorage.vertexArrayObjects && (this._userInstancedBuffersStorage.vertexArrayObjects = {});}this._internalMeshDataInfo._effectiveMaterial = null, super._rebuild(dispose);}_freeze() {if (this.subMeshes) {for (let index = 0; index < this.subMeshes.length; index++) this._getInstancesRenderList(index);this._internalMeshDataInfo._effectiveMaterial = null, this._instanceDataStorage.isFrozen = !0;}}_unFreeze() {this._instanceDataStorage.isFrozen = !1, this._instanceDataStorage.previousBatch = null;}render(subMesh, enableAlphaMode, effectiveMeshReplacement) {var _a, _b, _c;const scene = this.getScene();if (this._internalAbstractMeshDataInfo._isActiveIntermediate ? this._internalAbstractMeshDataInfo._isActiveIntermediate = !1 : this._internalAbstractMeshDataInfo._isActive = !1, this._checkOcclusionQuery() && !this._occlusionDataStorage.forceRenderingWhenOccluded) return this;const batch = this._getInstancesRenderList(subMesh._id, !!effectiveMeshReplacement);if (batch.mustReturn) return this;if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer()) return this;const engine = scene.getEngine();let oldCameraMaxZ = 0,oldCamera = null;this.ignoreCameraMaxZ && scene.activeCamera && !scene._isInIntermediateRendering() && (oldCameraMaxZ = scene.activeCamera.maxZ, oldCamera = scene.activeCamera, scene.activeCamera.maxZ = 0, scene.updateTransformMatrix(!0)), this._internalMeshDataInfo._onBeforeRenderObservable && this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);const renderingMesh = subMesh.getRenderingMesh(),hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || renderingMesh.hasThinInstances || !!this._userInstancedBuffersStorage && !subMesh.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh,instanceDataStorage = this._instanceDataStorage,material = subMesh.getMaterial();if (!material) return oldCamera && (oldCamera.maxZ = oldCameraMaxZ, scene.updateTransformMatrix(!0)), this;if (!instanceDataStorage.isFrozen || !this._internalMeshDataInfo._effectiveMaterial || this._internalMeshDataInfo._effectiveMaterial !== material) {if (material._storeEffectOnSubMeshes) {if (!material.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) return oldCamera && (oldCamera.maxZ = oldCameraMaxZ, scene.updateTransformMatrix(!0)), this;} else if (!material.isReady(this, hardwareInstancedRendering)) return oldCamera && (oldCamera.maxZ = oldCameraMaxZ, scene.updateTransformMatrix(!0)), this;this._internalMeshDataInfo._effectiveMaterial = material;} else if (material._storeEffectOnSubMeshes && (null === (_a = subMesh.effect) || void 0 === _a || !_a._wasPreviouslyReady) || !material._storeEffectOnSubMeshes && (null === (_b = material.getEffect()) || void 0 === _b || !_b._wasPreviouslyReady)) return oldCamera && (oldCamera.maxZ = oldCameraMaxZ, scene.updateTransformMatrix(!0)), this;enableAlphaMode && engine.setAlphaMode(this._internalMeshDataInfo._effectiveMaterial.alphaMode);let drawWrapper = this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes ? subMesh._drawWrapper : this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();const effect = null !== (_c = null === drawWrapper || void 0 === drawWrapper ? void 0 : drawWrapper.effect) && void 0 !== _c ? _c : null;for (const step of scene._beforeRenderingMeshStage) step.action(this, subMesh, batch, effect);if (!drawWrapper || !effect) return oldCamera && (oldCamera.maxZ = oldCameraMaxZ, scene.updateTransformMatrix(!0)), this;const effectiveMesh = effectiveMeshReplacement || this;let sideOrientation;if (!instanceDataStorage.isFrozen && (this._internalMeshDataInfo._effectiveMaterial.backFaceCulling || null !== this.overrideMaterialSideOrientation)) {const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();sideOrientation = this.overrideMaterialSideOrientation, null == sideOrientation && (sideOrientation = this._internalMeshDataInfo._effectiveMaterial.sideOrientation), 0 > mainDeterminant && (sideOrientation = sideOrientation === _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.ClockWiseSideOrientation */ .F.ClockWiseSideOrientation ? _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.CounterClockWiseSideOrientation */ .F.CounterClockWiseSideOrientation : _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.ClockWiseSideOrientation */ .F.ClockWiseSideOrientation), instanceDataStorage.sideOrientation = sideOrientation;} else sideOrientation = instanceDataStorage.sideOrientation;const reverse = this._internalMeshDataInfo._effectiveMaterial._preBind(drawWrapper, sideOrientation);this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite && engine.setDepthWrite(!0);const fillMode = scene.forcePointsCloud ? _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.PointFillMode */ .F.PointFillMode : scene.forceWireframe ? _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.WireFrameFillMode */ .F.WireFrameFillMode : this._internalMeshDataInfo._effectiveMaterial.fillMode;this._internalMeshDataInfo._onBeforeBindObservable && this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this), hardwareInstancedRendering || this._bind(subMesh, effect, fillMode);const effectiveMaterial = this._internalMeshDataInfo._effectiveMaterial,world = effectiveMesh.getWorldMatrix();effectiveMaterial._storeEffectOnSubMeshes ? effectiveMaterial.bindForSubMesh(world, this, subMesh) : effectiveMaterial.bind(world, this), !effectiveMaterial.backFaceCulling && effectiveMaterial.separateCullingPass && (engine.setState(!0, effectiveMaterial.zOffset, !1, !reverse, effectiveMaterial.cullBackFaces, effectiveMaterial.stencil, effectiveMaterial.zOffsetUnits), this._processRendering(this, subMesh, effect, fillMode, batch, hardwareInstancedRendering, this._onBeforeDraw, this._internalMeshDataInfo._effectiveMaterial), engine.setState(!0, effectiveMaterial.zOffset, !1, reverse, effectiveMaterial.cullBackFaces, effectiveMaterial.stencil, effectiveMaterial.zOffsetUnits), this._internalMeshDataInfo._onBetweenPassObservable && this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(subMesh)), this._processRendering(this, subMesh, effect, fillMode, batch, hardwareInstancedRendering, this._onBeforeDraw, this._internalMeshDataInfo._effectiveMaterial), this._internalMeshDataInfo._effectiveMaterial.unbind();for (const step of scene._afterRenderingMeshStage) step.action(this, subMesh, batch, effect);return this._internalMeshDataInfo._onAfterRenderObservable && this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this), oldCamera && (oldCamera.maxZ = oldCameraMaxZ, scene.updateTransformMatrix(!0)), scene.performancePriority !== _scene_js__WEBPACK_IMPORTED_MODULE_6__/* .ScenePerformancePriority.Aggressive */ .a.Aggressive || instanceDataStorage.isFrozen || this._freeze(), this;}cleanMatrixWeights() {this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind) && (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind) ? this._normalizeSkinWeightsAndExtra() : this._normalizeSkinFourWeights());}_normalizeSkinFourWeights() {const matricesWeights = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind),numWeights = matricesWeights.length;for (let a = 0; a < numWeights; a += 4) {const t = matricesWeights[a] + matricesWeights[a + 1] + matricesWeights[a + 2] + matricesWeights[a + 3];if (0 === t) matricesWeights[a] = 1;else {const recip = 1 / t;matricesWeights[a] *= recip, matricesWeights[a + 1] *= recip, matricesWeights[a + 2] *= recip, matricesWeights[a + 3] *= recip;}}this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, matricesWeights);}_normalizeSkinWeightsAndExtra() {const matricesWeightsExtra = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind),matricesWeights = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind),numWeights = matricesWeights.length;for (let t, a = 0; a < numWeights; a += 4) if (t = matricesWeights[a] + matricesWeights[a + 1] + matricesWeights[a + 2] + matricesWeights[a + 3], t += matricesWeightsExtra[a] + matricesWeightsExtra[a + 1] + matricesWeightsExtra[a + 2] + matricesWeightsExtra[a + 3], 0 === t) matricesWeights[a] = 1;else {const recip = 1 / t;matricesWeights[a] *= recip, matricesWeights[a + 1] *= recip, matricesWeights[a + 2] *= recip, matricesWeights[a + 3] *= recip, matricesWeightsExtra[a] *= recip, matricesWeightsExtra[a + 1] *= recip, matricesWeightsExtra[a + 2] *= recip, matricesWeightsExtra[a + 3] *= recip;}this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, matricesWeights), this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, matricesWeightsExtra);}validateSkinning() {const matricesWeightsExtra = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind),matricesWeights = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind);if (null === matricesWeights || null == this.skeleton) return { skinned: !1, valid: !0, report: "not skinned" };const numWeights = matricesWeights.length;let numberNotSorted = 0,missingWeights = 0,maxUsedWeights = 0,numberNotNormalized = 0;const numInfluences = null === matricesWeightsExtra ? 4 : 8,usedWeightCounts = [];for (let a = 0; a <= numInfluences; a++) usedWeightCounts[a] = 0;for (let a = 0; a < numWeights; a += 4) {let lastWeight = matricesWeights[a],t = lastWeight,usedWeights = 0 === t ? 0 : 1;for (let b = 1; b < numInfluences; b++) {const d = 4 > b ? matricesWeights[a + b] : matricesWeightsExtra[a + b - 4];d > lastWeight && numberNotSorted++, 0 !== d && usedWeights++, t += d, lastWeight = d;}if (usedWeightCounts[usedWeights]++, usedWeights > maxUsedWeights && (maxUsedWeights = usedWeights), 0 === t) missingWeights++;else {const recip = 1 / t;let tolerance = 0;for (let b = 0; b < numInfluences; b++) tolerance += 4 > b ? Math.abs(matricesWeights[a + b] - matricesWeights[a + b] * recip) : Math.abs(matricesWeightsExtra[a + b - 4] - matricesWeightsExtra[a + b - 4] * recip);tolerance > .001 && numberNotNormalized++;}}const numBones = this.skeleton.bones.length,matricesIndices = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind),matricesIndicesExtra = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind);let numBadBoneIndices = 0;for (let a = 0; a < numWeights; a += 4) for (let b = 0; b < numInfluences; b++) {const index = 4 > b ? matricesIndices[a + b] : matricesIndicesExtra[a + b - 4];(index >= numBones || 0 > index) && numBadBoneIndices++;}const output = "Number of Weights = " + numWeights / 4 + "\nMaximum influences = " + maxUsedWeights + "\nMissing Weights = " + missingWeights + "\nNot Sorted = " + numberNotSorted + "\nNot Normalized = " + numberNotNormalized + "\nWeightCounts = [" + usedWeightCounts + "]\nNumber of bones = " + numBones + "\nBad Bone Indices = " + numBadBoneIndices;return { skinned: !0, valid: 0 === missingWeights && 0 === numberNotNormalized && 0 === numBadBoneIndices, report: output };}_checkDelayState() {const scene = this.getScene();return this._geometry ? this._geometry.load(scene) : 4 === this.delayLoadState && (this.delayLoadState = 2, this._queueLoad(scene)), this;}_queueLoad(scene) {scene.addPendingData(this);const getBinaryData = -1 !== this.delayLoadingFile.indexOf(".babylonbinarymeshdata");return _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools.LoadFile */ .w1.LoadFile(this.delayLoadingFile, (data) => {data instanceof ArrayBuffer ? this._delayLoadingFunction(data, this) : this._delayLoadingFunction(JSON.parse(data), this), this.instances.forEach((instance) => {instance.refreshBoundingInfo(), instance._syncSubMeshes();}), this.delayLoadState = 1, scene.removePendingData(this);}, () => {}, scene.offlineProvider, getBinaryData), this;}isInFrustum(frustumPlanes) {return 2 !== this.delayLoadState && !!super.isInFrustum(frustumPlanes) && (this._checkDelayState(), !0);}setMaterialById(id) {const materials = this.getScene().materials;let index;for (index = materials.length - 1; -1 < index; index--) if (materials[index].id === id) return this.material = materials[index], this;const multiMaterials = this.getScene().multiMaterials;for (index = multiMaterials.length - 1; -1 < index; index--) if (multiMaterials[index].id === id) return this.material = multiMaterials[index], this;return this;}getAnimatables() {const results = [];return this.material && results.push(this.material), this.skeleton && results.push(this.skeleton), results;}bakeTransformIntoVertices(transform) {if (!this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind)) return this;const submeshes = this.subMeshes.splice(0);this._resetPointsArrayCache();let data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind);const temp = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Zero */ .P.Zero();let index;for (index = 0; index < data.length; index += 3) _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.TransformCoordinatesFromFloatsToRef */ .P.TransformCoordinatesFromFloatsToRef(data[index], data[index + 1], data[index + 2], transform, temp).toArray(data, index);if (this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind, data, this.getVertexBuffer(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind).isUpdatable()), this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind)) {for (data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind), index = 0; index < data.length; index += 3) _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.TransformNormalFromFloatsToRef */ .P.TransformNormalFromFloatsToRef(data[index], data[index + 1], data[index + 2], transform, temp).normalize().toArray(data, index);this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind, data, this.getVertexBuffer(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind).isUpdatable());}return 0 > transform.determinant() && this.flipFaces(), this.releaseSubMeshes(), this.subMeshes = submeshes, this;}bakeCurrentTransformIntoVertices(bakeIndependentlyOfChildren = !0) {return this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)), this.resetLocalMatrix(bakeIndependentlyOfChildren), this;}get _positions() {return this._internalAbstractMeshDataInfo._positions ? this._internalAbstractMeshDataInfo._positions : this._geometry ? this._geometry._positions : null;}_resetPointsArrayCache() {return this._geometry && this._geometry._resetPointsArrayCache(), this;}_generatePointsArray() {return !!this._geometry && this._geometry._generatePointsArray();}clone(name = "", newParent = null, doNotCloneChildren, clonePhysicsImpostor = !0) {return new Mesh(name, this.getScene(), newParent, this, doNotCloneChildren, clonePhysicsImpostor);}dispose(doNotRecurse, disposeMaterialAndTextures = !1) {this.morphTargetManager = null, this._geometry && this._geometry.releaseForMesh(this, !0);const internalDataInfo = this._internalMeshDataInfo;if (internalDataInfo._onBeforeDrawObservable && internalDataInfo._onBeforeDrawObservable.clear(), internalDataInfo._onBeforeBindObservable && internalDataInfo._onBeforeBindObservable.clear(), internalDataInfo._onBeforeRenderObservable && internalDataInfo._onBeforeRenderObservable.clear(), internalDataInfo._onAfterRenderObservable && internalDataInfo._onAfterRenderObservable.clear(), internalDataInfo._onBetweenPassObservable && internalDataInfo._onBetweenPassObservable.clear(), this._scene.useClonedMeshMap) {if (internalDataInfo.meshMap) for (const uniqueId in internalDataInfo.meshMap) {const mesh = internalDataInfo.meshMap[uniqueId];mesh && (mesh._internalMeshDataInfo._source = null, internalDataInfo.meshMap[uniqueId] = void 0);}internalDataInfo._source && internalDataInfo._source._internalMeshDataInfo.meshMap && (internalDataInfo._source._internalMeshDataInfo.meshMap[this.uniqueId] = void 0);} else {const meshes = this.getScene().meshes;for (const abstractMesh of meshes) {const mesh = abstractMesh;mesh._internalMeshDataInfo && mesh._internalMeshDataInfo._source && mesh._internalMeshDataInfo._source === this && (mesh._internalMeshDataInfo._source = null);}}internalDataInfo._source = null, this._disposeInstanceSpecificData(), this._disposeThinInstanceSpecificData(), this._internalMeshDataInfo._checkReadinessObserver && this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver), super.dispose(doNotRecurse, disposeMaterialAndTextures);}_disposeInstanceSpecificData() {}_disposeThinInstanceSpecificData() {}_invalidateInstanceVertexArrayObject() {}applyDisplacementMap(url, minHeight, maxHeight, onSuccess, uvOffset, uvScale, forceUpdate = !1) {const scene = this.getScene(),onload = (img) => {const heightMapWidth = img.width,heightMapHeight = img.height,canvas = this.getEngine().createCanvas(heightMapWidth, heightMapHeight),context = canvas.getContext("2d");context.drawImage(img, 0, 0);const buffer = context.getImageData(0, 0, heightMapWidth, heightMapHeight).data;this.applyDisplacementMapFromBuffer(buffer, heightMapWidth, heightMapHeight, minHeight, maxHeight, uvOffset, uvScale, forceUpdate), onSuccess && onSuccess(this);};return _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools.LoadImage */ .w1.LoadImage(url, onload, () => {}, scene.offlineProvider), this;}applyDisplacementMapFromBuffer(buffer, heightMapWidth, heightMapHeight, minHeight, maxHeight, uvOffset, uvScale, forceUpdate = !1) {if (!this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind) || !this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind) || !this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UVKind */ .o.UVKind)) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__/* .Logger.Warn */ .Y.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"), this;const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind, !0, !0),normals = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind),uvs = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UVKind */ .o.UVKind);let position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Zero */ .P.Zero();const normal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Zero */ .P.Zero(),uv = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector2.Zero */ .FM.Zero();uvOffset = uvOffset || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector2.Zero */ .FM.Zero(), uvScale = uvScale || new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector2 */ .FM(1, 1);for (let index = 0; index < positions.length; index += 3) {_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(positions, index, position), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(normals, index, normal), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector2.FromArrayToRef */ .FM.FromArrayToRef(uvs, 2 * (index / 3), uv);const u = 0 | Math.abs(uv.x * uvScale.x + uvOffset.x % 1) * (heightMapWidth - 1) % heightMapWidth,v = 0 | Math.abs(uv.y * uvScale.y + uvOffset.y % 1) * (heightMapHeight - 1) % heightMapHeight,pos = 4 * (u + v * heightMapWidth),r = buffer[pos] / 255,g = buffer[pos + 1] / 255,b = buffer[pos + 2] / 255;normal.normalize(), normal.scaleInPlace(minHeight + (maxHeight - minHeight) * (.3 * r + .59 * g + .11 * b)), position = position.add(normal), position.toArray(positions, index);}return _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.ComputeNormals */ .x.ComputeNormals(positions, this.getIndices(), normals), forceUpdate ? (this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind, positions), this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind, normals), this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UVKind */ .o.UVKind, uvs)) : (this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind, positions), this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind, normals)), this;}convertToFlatShadedMesh() {const kinds = this.getVerticesDataKinds(),vbs = {},data = {},newdata = {};let kindIndex,kind,updatableNormals = !1;for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) {kind = kinds[kindIndex];const vertexBuffer = this.getVertexBuffer(kind),vertexData = vertexBuffer.getData();if (!((vertexData instanceof Array || vertexData instanceof Float32Array) && 0 === vertexData.length)) {if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind) {updatableNormals = vertexBuffer.isUpdatable(), kinds.splice(kindIndex, 1), kindIndex--;continue;}vbs[kind] = vertexBuffer, data[kind] = this.getVerticesData(kind), newdata[kind] = [];}}const previousSubmeshes = this.subMeshes.slice(0),indices = this.getIndices(),totalIndices = this.getTotalIndices();let index;for (index = 0; index < totalIndices; index++) {const vertexIndex = indices[index];for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) {if (kind = kinds[kindIndex], !vbs[kind]) continue;const stride = vbs[kind].getStrideSize();for (let offset = 0; offset < stride; offset++) newdata[kind].push(data[kind][vertexIndex * stride + offset]);}}const normals = [],positions = newdata[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind],useRightHandedSystem = this.getScene().useRightHandedSystem;let flipNormalGeneration;for (flipNormalGeneration = useRightHandedSystem ? 1 === this.overrideMaterialSideOrientation : 0 === this.overrideMaterialSideOrientation, index = 0; index < totalIndices; index += 3) {indices[index] = index, indices[index + 1] = index + 1, indices[index + 2] = index + 2;const p1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(positions, 3 * index),p2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(positions, 3 * (index + 1)),p3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(positions, 3 * (index + 2)),p1p2 = p1.subtract(p2),p3p2 = p3.subtract(p2),normal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Normalize */ .P.Normalize(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Cross */ .P.Cross(p1p2, p3p2));flipNormalGeneration && normal.scaleInPlace(-1);for (let localIndex = 0; 3 > localIndex; localIndex++) normals.push(normal.x), normals.push(normal.y), normals.push(normal.z);}for (this.setIndices(indices), this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind, normals, updatableNormals), kindIndex = 0; kindIndex < kinds.length; kindIndex++) (kind = kinds[kindIndex], !!newdata[kind]) && this.setVerticesData(kind, newdata[kind], vbs[kind].isUpdatable());this.releaseSubMeshes();for (let submeshIndex = 0; submeshIndex < previousSubmeshes.length; submeshIndex++) {const previousOne = previousSubmeshes[submeshIndex];_subMesh_js__WEBPACK_IMPORTED_MODULE_14__/* .SubMesh.AddToMesh */ .P.AddToMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this);}return this.synchronizeInstances(), this;}convertToUnIndexedMesh() {const kinds = this.getVerticesDataKinds(),vbs = {},data = {},newdata = {};let kindIndex, kind;for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) {kind = kinds[kindIndex];const vertexBuffer = this.getVertexBuffer(kind);vbs[kind] = vertexBuffer, data[kind] = vbs[kind].getData(), newdata[kind] = [];}const previousSubmeshes = this.subMeshes.slice(0),indices = this.getIndices(),totalIndices = this.getTotalIndices();let index;for (index = 0; index < totalIndices; index++) {const vertexIndex = indices[index];for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) {kind = kinds[kindIndex];const stride = vbs[kind].getStrideSize();for (let offset = 0; offset < stride; offset++) newdata[kind].push(data[kind][vertexIndex * stride + offset]);}}for (index = 0; index < totalIndices; index += 3) indices[index] = index, indices[index + 1] = index + 1, indices[index + 2] = index + 2;for (this.setIndices(indices), kindIndex = 0; kindIndex < kinds.length; kindIndex++) kind = kinds[kindIndex], this.setVerticesData(kind, newdata[kind], vbs[kind].isUpdatable(), vbs[kind].getStrideSize());this.releaseSubMeshes();for (let submeshIndex = 0; submeshIndex < previousSubmeshes.length; submeshIndex++) {const previousOne = previousSubmeshes[submeshIndex];_subMesh_js__WEBPACK_IMPORTED_MODULE_14__/* .SubMesh.AddToMesh */ .P.AddToMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this);}return this._unIndexed = !0, this.synchronizeInstances(), this;}flipFaces(flipNormals = !1) {const vertex_data = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.ExtractFromMesh */ .x.ExtractFromMesh(this);let i;if (flipNormals && this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind) && vertex_data.normals) for (i = 0; i < vertex_data.normals.length; i++) vertex_data.normals[i] *= -1;if (vertex_data.indices) {let temp;for (i = 0; i < vertex_data.indices.length; i += 3) temp = vertex_data.indices[i + 1], vertex_data.indices[i + 1] = vertex_data.indices[i + 2], vertex_data.indices[i + 2] = temp;}return vertex_data.applyToMesh(this, this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind)), this;}increaseVertices(numberPerEdge = 1) {const vertex_data = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.ExtractFromMesh */ .x.ExtractFromMesh(this),currentIndices = vertex_data.indices && !Array.isArray(vertex_data.indices) && Array.from ? Array.from(vertex_data.indices) : vertex_data.indices,positions = vertex_data.positions && !Array.isArray(vertex_data.positions) && Array.from ? Array.from(vertex_data.positions) : vertex_data.positions,uvs = vertex_data.uvs && !Array.isArray(vertex_data.uvs) && Array.from ? Array.from(vertex_data.uvs) : vertex_data.uvs,normals = vertex_data.normals && !Array.isArray(vertex_data.normals) && Array.from ? Array.from(vertex_data.normals) : vertex_data.normals;if (!currentIndices || !positions) _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__/* .Logger.Warn */ .Y.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions");else {vertex_data.indices = currentIndices, vertex_data.positions = positions, uvs && (vertex_data.uvs = uvs), normals && (vertex_data.normals = normals);const segments = numberPerEdge + 1,tempIndices = [];for (let i = 0; i < segments + 1; i++) tempIndices[i] = [];let a, b;const deltaPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3 */ .P(0, 0, 0),deltaNormal = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3 */ .P(0, 0, 0),deltaUV = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector2 */ .FM(0, 0),indices = [],vertexIndex = [],side = [];let len,uvPtr,positionPtr = positions.length;uvs && (uvPtr = uvs.length);let normalsPtr;normals && (normalsPtr = normals.length);for (let i = 0; i < currentIndices.length; i += 3) {vertexIndex[0] = currentIndices[i], vertexIndex[1] = currentIndices[i + 1], vertexIndex[2] = currentIndices[i + 2];for (let j = 0; 3 > j; j++) if (a = vertexIndex[j], b = vertexIndex[(j + 1) % 3], void 0 === side[a] && void 0 === side[b] ? (side[a] = [], side[b] = []) : (void 0 === side[a] && (side[a] = []), void 0 === side[b] && (side[b] = [])), void 0 === side[a][b] && void 0 === side[b][a]) {side[a][b] = [], deltaPosition.x = (positions[3 * b] - positions[3 * a]) / segments, deltaPosition.y = (positions[3 * b + 1] - positions[3 * a + 1]) / segments, deltaPosition.z = (positions[3 * b + 2] - positions[3 * a + 2]) / segments, normals && (deltaNormal.x = (normals[3 * b] - normals[3 * a]) / segments, deltaNormal.y = (normals[3 * b + 1] - normals[3 * a + 1]) / segments, deltaNormal.z = (normals[3 * b + 2] - normals[3 * a + 2]) / segments), uvs && (deltaUV.x = (uvs[2 * b] - uvs[2 * a]) / segments, deltaUV.y = (uvs[2 * b + 1] - uvs[2 * a + 1]) / segments), side[a][b].push(a);for (let k = 1; k < segments; k++) side[a][b].push(positions.length / 3), positions[positionPtr++] = positions[3 * a] + k * deltaPosition.x, positions[positionPtr++] = positions[3 * a + 1] + k * deltaPosition.y, positions[positionPtr++] = positions[3 * a + 2] + k * deltaPosition.z, normals && (normals[normalsPtr++] = normals[3 * a] + k * deltaNormal.x, normals[normalsPtr++] = normals[3 * a + 1] + k * deltaNormal.y, normals[normalsPtr++] = normals[3 * a + 2] + k * deltaNormal.z), uvs && (uvs[uvPtr++] = uvs[2 * a] + k * deltaUV.x, uvs[uvPtr++] = uvs[2 * a + 1] + k * deltaUV.y);side[a][b].push(b), side[b][a] = [], len = side[a][b].length;for (let idx = 0; idx < len; idx++) side[b][a][idx] = side[a][b][len - 1 - idx];}tempIndices[0][0] = currentIndices[i], tempIndices[1][0] = side[currentIndices[i]][currentIndices[i + 1]][1], tempIndices[1][1] = side[currentIndices[i]][currentIndices[i + 2]][1];for (let k = 2; k < segments; k++) {tempIndices[k][0] = side[currentIndices[i]][currentIndices[i + 1]][k], tempIndices[k][k] = side[currentIndices[i]][currentIndices[i + 2]][k], deltaPosition.x = (positions[3 * tempIndices[k][k]] - positions[3 * tempIndices[k][0]]) / k, deltaPosition.y = (positions[3 * tempIndices[k][k] + 1] - positions[3 * tempIndices[k][0] + 1]) / k, deltaPosition.z = (positions[3 * tempIndices[k][k] + 2] - positions[3 * tempIndices[k][0] + 2]) / k, normals && (deltaNormal.x = (normals[3 * tempIndices[k][k]] - normals[3 * tempIndices[k][0]]) / k, deltaNormal.y = (normals[3 * tempIndices[k][k] + 1] - normals[3 * tempIndices[k][0] + 1]) / k, deltaNormal.z = (normals[3 * tempIndices[k][k] + 2] - normals[3 * tempIndices[k][0] + 2]) / k), uvs && (deltaUV.x = (uvs[2 * tempIndices[k][k]] - uvs[2 * tempIndices[k][0]]) / k, deltaUV.y = (uvs[2 * tempIndices[k][k] + 1] - uvs[2 * tempIndices[k][0] + 1]) / k);for (let j = 1; j < k; j++) tempIndices[k][j] = positions.length / 3, positions[positionPtr++] = positions[3 * tempIndices[k][0]] + j * deltaPosition.x, positions[positionPtr++] = positions[3 * tempIndices[k][0] + 1] + j * deltaPosition.y, positions[positionPtr++] = positions[3 * tempIndices[k][0] + 2] + j * deltaPosition.z, normals && (normals[normalsPtr++] = normals[3 * tempIndices[k][0]] + j * deltaNormal.x, normals[normalsPtr++] = normals[3 * tempIndices[k][0] + 1] + j * deltaNormal.y, normals[normalsPtr++] = normals[3 * tempIndices[k][0] + 2] + j * deltaNormal.z), uvs && (uvs[uvPtr++] = uvs[2 * tempIndices[k][0]] + j * deltaUV.x, uvs[uvPtr++] = uvs[2 * tempIndices[k][0] + 1] + j * deltaUV.y);}tempIndices[segments] = side[currentIndices[i + 1]][currentIndices[i + 2]], indices.push(tempIndices[0][0], tempIndices[1][0], tempIndices[1][1]);for (let k = 1; k < segments; k++) {let j;for (j = 0; j < k; j++) indices.push(tempIndices[k][j], tempIndices[k + 1][j], tempIndices[k + 1][j + 1]), indices.push(tempIndices[k][j], tempIndices[k + 1][j + 1], tempIndices[k][j + 1]);indices.push(tempIndices[k][j], tempIndices[k + 1][j], tempIndices[k + 1][j + 1]);}}vertex_data.indices = indices, vertex_data.applyToMesh(this, this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind));}}forceSharedVertices() {const vertex_data = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.ExtractFromMesh */ .x.ExtractFromMesh(this),currentUVs = vertex_data.uvs,currentIndices = vertex_data.indices,currentPositions = vertex_data.positions,currentColors = vertex_data.colors,currentMatrixIndices = vertex_data.matricesIndices,currentMatrixWeights = vertex_data.matricesWeights,currentMatrixIndicesExtra = vertex_data.matricesIndicesExtra,currentMatrixWeightsExtra = vertex_data.matricesWeightsExtra;if (void 0 === currentIndices || void 0 === currentPositions || null === currentIndices || null === currentPositions) _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__/* .Logger.Warn */ .Y.Warn("VertexData contains empty entries");else {const positions = [],indices = [],uvs = [],colors = [],matrixIndices = [],matrixWeights = [],matrixIndicesExtra = [],matrixWeightsExtra = [];let pstring = [],indexPtr = 0;const uniquePositions = {};let ptr, facet;for (let i = 0; i < currentIndices.length; i += 3) {facet = [currentIndices[i], currentIndices[i + 1], currentIndices[i + 2]], pstring = [];for (let j = 0; 3 > j; j++) {pstring[j] = "";for (let k = 0; 3 > k; k++) 1e-8 > Math.abs(currentPositions[3 * facet[j] + k]) && (currentPositions[3 * facet[j] + k] = 0), pstring[j] += currentPositions[3 * facet[j] + k] + "|";}if (pstring[0] != pstring[1] && pstring[0] != pstring[2] && pstring[1] != pstring[2]) for (let j = 0; 3 > j; j++) {if (ptr = uniquePositions[pstring[j]], void 0 === ptr) {uniquePositions[pstring[j]] = indexPtr, ptr = indexPtr++;for (let k = 0; 3 > k; k++) positions.push(currentPositions[3 * facet[j] + k]);if (null !== currentColors && void 0 !== currentColors) for (let k = 0; 4 > k; k++) colors.push(currentColors[4 * facet[j] + k]);if (null !== currentUVs && void 0 !== currentUVs) for (let k = 0; 2 > k; k++) uvs.push(currentUVs[2 * facet[j] + k]);if (null !== currentMatrixIndices && void 0 !== currentMatrixIndices) for (let k = 0; 4 > k; k++) matrixIndices.push(currentMatrixIndices[4 * facet[j] + k]);if (null !== currentMatrixWeights && void 0 !== currentMatrixWeights) for (let k = 0; 4 > k; k++) matrixWeights.push(currentMatrixWeights[4 * facet[j] + k]);if (null !== currentMatrixIndicesExtra && void 0 !== currentMatrixIndicesExtra) for (let k = 0; 4 > k; k++) matrixIndicesExtra.push(currentMatrixIndicesExtra[4 * facet[j] + k]);if (null !== currentMatrixWeightsExtra && void 0 !== currentMatrixWeightsExtra) for (let k = 0; 4 > k; k++) matrixWeightsExtra.push(currentMatrixWeightsExtra[4 * facet[j] + k]);}indices.push(ptr);}}const normals = [];_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.ComputeNormals */ .x.ComputeNormals(positions, indices, normals), vertex_data.positions = positions, vertex_data.indices = indices, vertex_data.normals = normals, null !== currentUVs && void 0 !== currentUVs && (vertex_data.uvs = uvs), null !== currentColors && void 0 !== currentColors && (vertex_data.colors = colors), null !== currentMatrixIndices && void 0 !== currentMatrixIndices && (vertex_data.matricesIndices = matrixIndices), null !== currentMatrixWeights && void 0 !== currentMatrixWeights && (vertex_data.matricesWeights = matrixWeights), null !== currentMatrixIndicesExtra && void 0 !== currentMatrixIndicesExtra && (vertex_data.matricesIndicesExtra = matrixIndicesExtra), null !== currentMatrixWeights && void 0 !== currentMatrixWeights && (vertex_data.matricesWeightsExtra = matrixWeightsExtra), vertex_data.applyToMesh(this, this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind));}}static _instancedMeshFactory() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_21__/* ._WarnImport */ .S)("InstancedMesh");}static _PhysicsImpostorParser() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_21__/* ._WarnImport */ .S)("PhysicsImpostor");}createInstance(name) {return Mesh._instancedMeshFactory(name, this);}synchronizeInstances() {for (let instanceIndex = 0; instanceIndex < this.instances.length; instanceIndex++) {const instance = this.instances[instanceIndex];instance._syncSubMeshes();}return this;}optimizeIndices(successCallback) {const indices = this.getIndices(),positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind);if (!positions || !indices) return this;const vectorPositions = [];for (let pos = 0; pos < positions.length; pos += 3) vectorPositions.push(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(positions, pos));const dupes = [];return _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .AsyncLoop.SyncAsyncForLoop */ .$g.SyncAsyncForLoop(vectorPositions.length, 40, (iteration) => {const realPos = vectorPositions.length - 1 - iteration,testedPosition = vectorPositions[realPos];for (let j = 0; j < realPos; ++j) {const againstPosition = vectorPositions[j];if (testedPosition.equals(againstPosition)) {dupes[realPos] = j;break;}}}, () => {for (let i = 0; i < indices.length; ++i) indices[i] = dupes[indices[i]] || indices[i];const originalSubMeshes = this.subMeshes.slice(0);this.setIndices(indices), this.subMeshes = originalSubMeshes, successCallback && successCallback(this);}), this;}serialize(serializationObject = {}) {serializationObject.name = this.name, serializationObject.id = this.id, serializationObject.uniqueId = this.uniqueId, serializationObject.type = this.getClassName(), _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.HasTags */ .$.HasTags(this) && (serializationObject.tags = _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.GetTags */ .$.GetTags(this)), serializationObject.position = this.position.asArray(), this.rotationQuaternion ? serializationObject.rotationQuaternion = this.rotationQuaternion.asArray() : this.rotation && (serializationObject.rotation = this.rotation.asArray()), serializationObject.scaling = this.scaling.asArray(), this._postMultiplyPivotMatrix ? serializationObject.pivotMatrix = this.getPivotMatrix().asArray() : serializationObject.localMatrix = this.getPivotMatrix().asArray(), serializationObject.isEnabled = this.isEnabled(!1), serializationObject.isVisible = this.isVisible, serializationObject.infiniteDistance = this.infiniteDistance, serializationObject.pickable = this.isPickable, serializationObject.receiveShadows = this.receiveShadows, serializationObject.billboardMode = this.billboardMode, serializationObject.visibility = this.visibility, serializationObject.checkCollisions = this.checkCollisions, serializationObject.isBlocker = this.isBlocker, serializationObject.overrideMaterialSideOrientation = this.overrideMaterialSideOrientation, this.parent && this.parent._serializeAsParent(serializationObject), serializationObject.isUnIndexed = this.isUnIndexed;const geometry = this._geometry;if (geometry && this.subMeshes) {serializationObject.geometryUniqueId = geometry.uniqueId, serializationObject.geometryId = geometry.id, serializationObject.subMeshes = [];for (let subIndex = 0; subIndex < this.subMeshes.length; subIndex++) {const subMesh = this.subMeshes[subIndex];serializationObject.subMeshes.push({ materialIndex: subMesh.materialIndex, verticesStart: subMesh.verticesStart, verticesCount: subMesh.verticesCount, indexStart: subMesh.indexStart, indexCount: subMesh.indexCount });}}if (this.material ? !this.material.doNotSerialize && (serializationObject.materialUniqueId = this.material.uniqueId, serializationObject.materialId = this.material.id) : (this.material = null, serializationObject.materialUniqueId = this._scene.defaultMaterial.uniqueId, serializationObject.materialId = this._scene.defaultMaterial.id), this.morphTargetManager && (serializationObject.morphTargetManagerId = this.morphTargetManager.uniqueId), this.skeleton && (serializationObject.skeletonId = this.skeleton.id, serializationObject.numBoneInfluencers = this.numBoneInfluencers), this.getScene()._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_22__/* .SceneComponentConstants.NAME_PHYSICSENGINE */ .l.NAME_PHYSICSENGINE)) {const impostor = this.getPhysicsImpostor();impostor && (serializationObject.physicsMass = impostor.getParam("mass"), serializationObject.physicsFriction = impostor.getParam("friction"), serializationObject.physicsRestitution = impostor.getParam("mass"), serializationObject.physicsImpostor = impostor.type);}this.metadata && (serializationObject.metadata = this.metadata), serializationObject.instances = [];for (let index = 0; index < this.instances.length; index++) {const instance = this.instances[index];if (instance.doNotSerialize) continue;const serializationInstance = { name: instance.name, id: instance.id, isEnabled: instance.isEnabled(!1), isVisible: instance.isVisible, isPickable: instance.isPickable, checkCollisions: instance.checkCollisions, position: instance.position.asArray(), scaling: instance.scaling.asArray() };if (instance.parent && instance.parent._serializeAsParent(serializationInstance), instance.rotationQuaternion ? serializationInstance.rotationQuaternion = instance.rotationQuaternion.asArray() : instance.rotation && (serializationInstance.rotation = instance.rotation.asArray()), this.getScene()._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_22__/* .SceneComponentConstants.NAME_PHYSICSENGINE */ .l.NAME_PHYSICSENGINE)) {const impostor = instance.getPhysicsImpostor();impostor && (serializationInstance.physicsMass = impostor.getParam("mass"), serializationInstance.physicsFriction = impostor.getParam("friction"), serializationInstance.physicsRestitution = impostor.getParam("mass"), serializationInstance.physicsImpostor = impostor.type);}instance.metadata && (serializationInstance.metadata = instance.metadata), instance.actionManager && (serializationInstance.actions = instance.actionManager.serialize(instance.name)), serializationObject.instances.push(serializationInstance), _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_18__/* .SerializationHelper.AppendSerializedAnimations */ .p4.AppendSerializedAnimations(instance, serializationInstance), serializationInstance.ranges = instance.serializeAnimationRanges();}if (this._thinInstanceDataStorage.instancesCount && this._thinInstanceDataStorage.matrixData && (serializationObject.thinInstances = { instancesCount: this._thinInstanceDataStorage.instancesCount, matrixData: Array.from(this._thinInstanceDataStorage.matrixData), matrixBufferSize: this._thinInstanceDataStorage.matrixBufferSize, enablePicking: this.thinInstanceEnablePicking }, this._userThinInstanceBuffersStorage)) {const userThinInstance = { data: {}, sizes: {}, strides: {} };for (const kind in this._userThinInstanceBuffersStorage.data) userThinInstance.data[kind] = Array.from(this._userThinInstanceBuffersStorage.data[kind]), userThinInstance.sizes[kind] = this._userThinInstanceBuffersStorage.sizes[kind], userThinInstance.strides[kind] = this._userThinInstanceBuffersStorage.strides[kind];serializationObject.thinInstances.userThinInstance = userThinInstance;}return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_18__/* .SerializationHelper.AppendSerializedAnimations */ .p4.AppendSerializedAnimations(this, serializationObject), serializationObject.ranges = this.serializeAnimationRanges(), serializationObject.layerMask = this.layerMask, serializationObject.alphaIndex = this.alphaIndex, serializationObject.hasVertexAlpha = this.hasVertexAlpha, serializationObject.overlayAlpha = this.overlayAlpha, serializationObject.overlayColor = this.overlayColor.asArray(), serializationObject.renderOverlay = this.renderOverlay, serializationObject.applyFog = this.applyFog, this.actionManager && (serializationObject.actions = this.actionManager.serialize(this.name)), serializationObject;}_syncGeometryWithMorphTargetManager() {if (this.geometry) {this._markSubMeshesAsAttributesDirty();const morphTargetManager = this._internalAbstractMeshDataInfo._morphTargetManager;if (morphTargetManager && morphTargetManager.vertexCount) {if (morphTargetManager.vertexCount !== this.getTotalVertices()) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__/* .Logger.Error */ .Y.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."), void (this.morphTargetManager = null);if (morphTargetManager.isUsingTextureForTargets) return;for (let index = 0; index < morphTargetManager.numInfluencers; index++) {const morphTarget = morphTargetManager.getActiveTarget(index),positions = morphTarget.getPositions();if (!positions) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__/* .Logger.Error */ .Y.Error("Invalid morph target. Target must have positions.");this.geometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind + index, positions, !1, 3);const normals = morphTarget.getNormals();normals && this.geometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind + index, normals, !1, 3);const tangents = morphTarget.getTangents();tangents && this.geometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.TangentKind */ .o.TangentKind + index, tangents, !1, 3);const uvs = morphTarget.getUVs();uvs && this.geometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UVKind */ .o.UVKind + "_" + index, uvs, !1, 2);}} else for (let index = 0; this.geometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind + index);) this.geometry.removeVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind + index), this.geometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind + index) && this.geometry.removeVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind + index), this.geometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.TangentKind */ .o.TangentKind + index) && this.geometry.removeVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.TangentKind */ .o.TangentKind + index), this.geometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UVKind */ .o.UVKind + index) && this.geometry.removeVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UVKind */ .o.UVKind + "_" + index), index++;}}static Parse(parsedMesh, scene, rootUrl) {let mesh;if (mesh = parsedMesh.type && "LinesMesh" === parsedMesh.type ? Mesh._LinesMeshParser(parsedMesh, scene) : parsedMesh.type && "GroundMesh" === parsedMesh.type ? Mesh._GroundMeshParser(parsedMesh, scene) : parsedMesh.type && "GoldbergMesh" === parsedMesh.type ? Mesh._GoldbergMeshParser(parsedMesh, scene) : new Mesh(parsedMesh.name, scene), mesh.id = parsedMesh.id, mesh._waitingParsedUniqueId = parsedMesh.uniqueId, _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.AddTagsTo */ .$.AddTagsTo(mesh, parsedMesh.tags), mesh.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(parsedMesh.position), void 0 !== parsedMesh.metadata && (mesh.metadata = parsedMesh.metadata), parsedMesh.rotationQuaternion ? mesh.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Quaternion.FromArray */ ._f.FromArray(parsedMesh.rotationQuaternion) : parsedMesh.rotation && (mesh.rotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(parsedMesh.rotation)), mesh.scaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(parsedMesh.scaling), parsedMesh.localMatrix ? mesh.setPreTransformMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Matrix.FromArray */ .y3.FromArray(parsedMesh.localMatrix)) : parsedMesh.pivotMatrix && mesh.setPivotMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Matrix.FromArray */ .y3.FromArray(parsedMesh.pivotMatrix)), mesh.setEnabled(parsedMesh.isEnabled), mesh.isVisible = parsedMesh.isVisible, mesh.infiniteDistance = parsedMesh.infiniteDistance, mesh.showBoundingBox = parsedMesh.showBoundingBox, mesh.showSubMeshesBoundingBox = parsedMesh.showSubMeshesBoundingBox, void 0 !== parsedMesh.applyFog && (mesh.applyFog = parsedMesh.applyFog), void 0 !== parsedMesh.pickable && (mesh.isPickable = parsedMesh.pickable), void 0 !== parsedMesh.alphaIndex && (mesh.alphaIndex = parsedMesh.alphaIndex), mesh.receiveShadows = parsedMesh.receiveShadows, void 0 !== parsedMesh.billboardMode && (mesh.billboardMode = parsedMesh.billboardMode), void 0 !== parsedMesh.visibility && (mesh.visibility = parsedMesh.visibility), mesh.checkCollisions = parsedMesh.checkCollisions, mesh.overrideMaterialSideOrientation = parsedMesh.overrideMaterialSideOrientation, void 0 !== parsedMesh.isBlocker && (mesh.isBlocker = parsedMesh.isBlocker), mesh._shouldGenerateFlatShading = parsedMesh.useFlatShading, parsedMesh.freezeWorldMatrix && (mesh._waitingData.freezeWorldMatrix = parsedMesh.freezeWorldMatrix), void 0 !== parsedMesh.parentId && (mesh._waitingParentId = parsedMesh.parentId), void 0 !== parsedMesh.parentInstanceIndex && (mesh._waitingParentInstanceIndex = parsedMesh.parentInstanceIndex), void 0 !== parsedMesh.actions && (mesh._waitingData.actions = parsedMesh.actions), void 0 !== parsedMesh.overlayAlpha && (mesh.overlayAlpha = parsedMesh.overlayAlpha), void 0 !== parsedMesh.overlayColor && (mesh.overlayColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_8__/* .Color3.FromArray */ .Wo.FromArray(parsedMesh.overlayColor)), void 0 !== parsedMesh.renderOverlay && (mesh.renderOverlay = parsedMesh.renderOverlay), mesh.isUnIndexed = !!parsedMesh.isUnIndexed, mesh.hasVertexAlpha = parsedMesh.hasVertexAlpha, parsedMesh.delayLoadingFile ? (mesh.delayLoadState = 4, mesh.delayLoadingFile = rootUrl + parsedMesh.delayLoadingFile, mesh.buildBoundingInfo(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(parsedMesh.boundingBoxMinimum), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(parsedMesh.boundingBoxMaximum)), parsedMesh._binaryInfo && (mesh._binaryInfo = parsedMesh._binaryInfo), mesh._delayInfo = [], parsedMesh.hasUVs && mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UVKind */ .o.UVKind), parsedMesh.hasUVs2 && mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UV2Kind */ .o.UV2Kind), parsedMesh.hasUVs3 && mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UV3Kind */ .o.UV3Kind), parsedMesh.hasUVs4 && mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UV4Kind */ .o.UV4Kind), parsedMesh.hasUVs5 && mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UV5Kind */ .o.UV5Kind), parsedMesh.hasUVs6 && mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.UV6Kind */ .o.UV6Kind), parsedMesh.hasColors && mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.ColorKind */ .o.ColorKind), parsedMesh.hasMatricesIndices && mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind), parsedMesh.hasMatricesWeights && mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind), mesh._delayLoadingFunction = _geometry_js__WEBPACK_IMPORTED_MODULE_12__/* .Geometry._ImportGeometry */ .Z._ImportGeometry, _Loading_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_17__/* .SceneLoaderFlags.ForceFullSceneLoadingForIncremental */ .Z.ForceFullSceneLoadingForIncremental && mesh._checkDelayState()) : _geometry_js__WEBPACK_IMPORTED_MODULE_12__/* .Geometry._ImportGeometry */ .Z._ImportGeometry(parsedMesh, mesh), parsedMesh.materialUniqueId ? mesh._waitingMaterialId = parsedMesh.materialUniqueId : parsedMesh.materialId && (mesh._waitingMaterialId = parsedMesh.materialId), -1 < parsedMesh.morphTargetManagerId && (mesh.morphTargetManager = scene.getMorphTargetManagerById(parsedMesh.morphTargetManagerId)), void 0 !== parsedMesh.skeletonId && null !== parsedMesh.skeletonId && (mesh.skeleton = scene.getLastSkeletonById(parsedMesh.skeletonId), parsedMesh.numBoneInfluencers && (mesh.numBoneInfluencers = parsedMesh.numBoneInfluencers)), parsedMesh.animations) {for (let animationIndex = 0; animationIndex < parsedMesh.animations.length; animationIndex++) {const parsedAnimation = parsedMesh.animations[animationIndex],internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_20__/* .GetClass */ .q)("BABYLON.Animation");internalClass && mesh.animations.push(internalClass.Parse(parsedAnimation));}_node_js__WEBPACK_IMPORTED_MODULE_9__/* .Node.ParseAnimationRanges */ .N.ParseAnimationRanges(mesh, parsedMesh, scene);}if (parsedMesh.autoAnimate && scene.beginAnimation(mesh, parsedMesh.autoAnimateFrom, parsedMesh.autoAnimateTo, parsedMesh.autoAnimateLoop, parsedMesh.autoAnimateSpeed || 1), mesh.layerMask = parsedMesh.layerMask && !isNaN(parsedMesh.layerMask) ? Math.abs(parseInt(parsedMesh.layerMask)) : 268435455, parsedMesh.physicsImpostor && Mesh._PhysicsImpostorParser(scene, mesh, parsedMesh), parsedMesh.lodMeshIds && (mesh._waitingData.lods = { ids: parsedMesh.lodMeshIds, distances: parsedMesh.lodDistances ? parsedMesh.lodDistances : null, coverages: parsedMesh.lodCoverages ? parsedMesh.lodCoverages : null }), parsedMesh.instances) for (let index = 0; index < parsedMesh.instances.length; index++) {const parsedInstance = parsedMesh.instances[index],instance = mesh.createInstance(parsedInstance.name);if (parsedInstance.id && (instance.id = parsedInstance.id), _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .$ && (parsedInstance.tags ? _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.AddTagsTo */ .$.AddTagsTo(instance, parsedInstance.tags) : _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags.AddTagsTo */ .$.AddTagsTo(instance, parsedMesh.tags)), instance.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(parsedInstance.position), void 0 !== parsedInstance.metadata && (instance.metadata = parsedInstance.metadata), void 0 !== parsedInstance.parentId && (instance._waitingParentId = parsedInstance.parentId), void 0 !== parsedInstance.parentInstanceIndex && (instance._waitingParentInstanceIndex = parsedInstance.parentInstanceIndex), void 0 !== parsedInstance.isEnabled && null !== parsedInstance.isEnabled && instance.setEnabled(parsedInstance.isEnabled), void 0 !== parsedInstance.isVisible && null !== parsedInstance.isVisible && (instance.isVisible = parsedInstance.isVisible), void 0 !== parsedInstance.isPickable && null !== parsedInstance.isPickable && (instance.isPickable = parsedInstance.isPickable), parsedInstance.rotationQuaternion ? instance.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Quaternion.FromArray */ ._f.FromArray(parsedInstance.rotationQuaternion) : parsedInstance.rotation && (instance.rotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(parsedInstance.rotation)), instance.scaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.FromArray */ .P.FromArray(parsedInstance.scaling), null != parsedInstance.checkCollisions && null != parsedInstance.checkCollisions && (instance.checkCollisions = parsedInstance.checkCollisions), null != parsedInstance.pickable && null != parsedInstance.pickable && (instance.isPickable = parsedInstance.pickable), null != parsedInstance.showBoundingBox && null != parsedInstance.showBoundingBox && (instance.showBoundingBox = parsedInstance.showBoundingBox), null != parsedInstance.showSubMeshesBoundingBox && null != parsedInstance.showSubMeshesBoundingBox && (instance.showSubMeshesBoundingBox = parsedInstance.showSubMeshesBoundingBox), null != parsedInstance.alphaIndex && null != parsedInstance.showSubMeshesBoundingBox && (instance.alphaIndex = parsedInstance.alphaIndex), parsedInstance.physicsImpostor && Mesh._PhysicsImpostorParser(scene, instance, parsedInstance), void 0 !== parsedInstance.actions && (instance._waitingData.actions = parsedInstance.actions), parsedInstance.animations) {for (let animationIndex = 0; animationIndex < parsedInstance.animations.length; animationIndex++) {const parsedAnimation = parsedInstance.animations[animationIndex],internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_20__/* .GetClass */ .q)("BABYLON.Animation");internalClass && instance.animations.push(internalClass.Parse(parsedAnimation));}_node_js__WEBPACK_IMPORTED_MODULE_9__/* .Node.ParseAnimationRanges */ .N.ParseAnimationRanges(instance, parsedInstance, scene), parsedInstance.autoAnimate && scene.beginAnimation(instance, parsedInstance.autoAnimateFrom, parsedInstance.autoAnimateTo, parsedInstance.autoAnimateLoop, parsedInstance.autoAnimateSpeed || 1);}}if (parsedMesh.thinInstances) {const thinInstances = parsedMesh.thinInstances;if (mesh.thinInstanceEnablePicking = !!thinInstances.enablePicking, thinInstances.matrixData ? (mesh.thinInstanceSetBuffer("matrix", new Float32Array(thinInstances.matrixData), 16, !1), mesh._thinInstanceDataStorage.matrixBufferSize = thinInstances.matrixBufferSize, mesh._thinInstanceDataStorage.instancesCount = thinInstances.instancesCount) : mesh._thinInstanceDataStorage.matrixBufferSize = thinInstances.matrixBufferSize, parsedMesh.thinInstances.userThinInstance) {const userThinInstance = parsedMesh.thinInstances.userThinInstance;for (const kind in userThinInstance.data) mesh.thinInstanceSetBuffer(kind, new Float32Array(userThinInstance.data[kind]), userThinInstance.strides[kind], !1), mesh._userThinInstanceBuffersStorage.sizes[kind] = userThinInstance.sizes[kind];}}return mesh;}setPositionsForCPUSkinning() {const internalDataInfo = this._internalMeshDataInfo;if (!internalDataInfo._sourcePositions) {const source = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind);if (!source) return internalDataInfo._sourcePositions;internalDataInfo._sourcePositions = new Float32Array(source), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind) || this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind, source, !0);}return internalDataInfo._sourcePositions;}setNormalsForCPUSkinning() {const internalDataInfo = this._internalMeshDataInfo;if (!internalDataInfo._sourceNormals) {const source = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind);if (!source) return internalDataInfo._sourceNormals;internalDataInfo._sourceNormals = new Float32Array(source), this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind) || this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind, source, !0);}return internalDataInfo._sourceNormals;}applySkeleton(skeleton) {if (!this.geometry) return this;if (this.geometry._softwareSkinningFrameId == this.getScene().getFrameId()) return this;if (this.geometry._softwareSkinningFrameId = this.getScene().getFrameId(), !this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind)) return this;if (!this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind)) return this;if (!this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind)) return this;const hasNormals = this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind),internalDataInfo = this._internalMeshDataInfo;if (!internalDataInfo._sourcePositions) {const submeshes = this.subMeshes.slice();this.setPositionsForCPUSkinning(), this.subMeshes = submeshes;}hasNormals && !internalDataInfo._sourceNormals && this.setNormalsForCPUSkinning();let positionsData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind);if (!positionsData) return this;positionsData instanceof Float32Array || (positionsData = new Float32Array(positionsData));let normalsData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind);if (hasNormals) {if (!normalsData) return this;normalsData instanceof Float32Array || (normalsData = new Float32Array(normalsData));}const matricesIndicesData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind),matricesWeightsData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind);if (!matricesWeightsData || !matricesIndicesData) return this;const needExtras = 4 < this.numBoneInfluencers,matricesIndicesExtraData = needExtras ? this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind) : null,matricesWeightsExtraData = needExtras ? this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind) : null,skeletonMatrices = skeleton.getTransformMatrices(this),tempVector3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Zero */ .P.Zero(),finalMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Matrix */ .y3(),tempMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Matrix */ .y3();let inf,matWeightIdx = 0;for (let index = 0; index < positionsData.length; index += 3, matWeightIdx += 4) {let weight;for (inf = 0; 4 > inf; inf++) weight = matricesWeightsData[matWeightIdx + inf], 0 < weight && (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Matrix.FromFloat32ArrayToRefScaled */ .y3.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(16 * matricesIndicesData[matWeightIdx + inf]), weight, tempMatrix), finalMatrix.addToSelf(tempMatrix));if (needExtras) for (inf = 0; 4 > inf; inf++) weight = matricesWeightsExtraData[matWeightIdx + inf], 0 < weight && (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Matrix.FromFloat32ArrayToRefScaled */ .y3.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(16 * matricesIndicesExtraData[matWeightIdx + inf]), weight, tempMatrix), finalMatrix.addToSelf(tempMatrix));_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.TransformCoordinatesFromFloatsToRef */ .P.TransformCoordinatesFromFloatsToRef(internalDataInfo._sourcePositions[index], internalDataInfo._sourcePositions[index + 1], internalDataInfo._sourcePositions[index + 2], finalMatrix, tempVector3), tempVector3.toArray(positionsData, index), hasNormals && (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.TransformNormalFromFloatsToRef */ .P.TransformNormalFromFloatsToRef(internalDataInfo._sourceNormals[index], internalDataInfo._sourceNormals[index + 1], internalDataInfo._sourceNormals[index + 2], finalMatrix, tempVector3), tempVector3.toArray(normalsData, index)), finalMatrix.reset();}return this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.PositionKind */ .o.PositionKind, positionsData), hasNormals && this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexBuffer.NormalKind */ .o.NormalKind, normalsData), this;}static MinMax(meshes) {let minVector = null,maxVector = null;return meshes.forEach(function (mesh) {const boundingInfo = mesh.getBoundingInfo(),boundingBox = boundingInfo.boundingBox;minVector && maxVector ? (minVector.minimizeInPlace(boundingBox.minimumWorld), maxVector.maximizeInPlace(boundingBox.maximumWorld)) : (minVector = boundingBox.minimumWorld, maxVector = boundingBox.maximumWorld);}), minVector && maxVector ? { min: minVector, max: maxVector } : { min: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Zero */ .P.Zero(), max: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Zero */ .P.Zero() };}static Center(meshesOrMinMaxVector) {const minMaxVector = meshesOrMinMaxVector instanceof Array ? Mesh.MinMax(meshesOrMinMaxVector) : meshesOrMinMaxVector;return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_7__/* .Vector3.Center */ .P.Center(minMaxVector.min, minMaxVector.max);}static MergeMeshes(meshes, disposeSource = !0, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials) {return (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_4__/* .runCoroutineSync */ .s3)(Mesh._MergeMeshesCoroutine(meshes, disposeSource, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials, !1));}static MergeMeshesAsync(meshes, disposeSource = !0, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials) {return (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_4__/* .runCoroutineAsync */ .sM)(Mesh._MergeMeshesCoroutine(meshes, disposeSource, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials, !0), (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_4__/* .createYieldingScheduler */ .KO)());}static *_MergeMeshesCoroutine(meshes, disposeSource = !0, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials, isAsync) {if (meshes = meshes.filter(Boolean), 0 === meshes.length) return null;let index;if (!allow32BitsIndices) {let totalVertices = 0;for (index = 0; index < meshes.length; index++) if (totalVertices += meshes[index].getTotalVertices(), 65536 <= totalVertices) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__/* .Logger.Warn */ .Y.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"), null;}multiMultiMaterials && (subdivideWithSubMeshes = !1);const materialArray = [],materialIndexArray = [],indiceArray = [],currentOverrideMaterialSideOrientation = meshes[0].overrideMaterialSideOrientation;for (index = 0; index < meshes.length; index++) {const mesh = meshes[index];if (mesh.isAnInstance) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__/* .Logger.Warn */ .Y.Warn("Cannot merge instance meshes."), null;if (currentOverrideMaterialSideOrientation !== mesh.overrideMaterialSideOrientation) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_19__/* .Logger.Warn */ .Y.Warn("Cannot merge meshes with different overrideMaterialSideOrientation values."), null;if (subdivideWithSubMeshes && indiceArray.push(mesh.getTotalIndices()), multiMultiMaterials) if (mesh.material) {const material = mesh.material;if (material instanceof _Materials_multiMaterial_js__WEBPACK_IMPORTED_MODULE_16__/* .MultiMaterial */ .G) {for (let matIndex = 0; matIndex < material.subMaterials.length; matIndex++) 0 > materialArray.indexOf(material.subMaterials[matIndex]) && materialArray.push(material.subMaterials[matIndex]);for (let subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) materialIndexArray.push(materialArray.indexOf(material.subMaterials[mesh.subMeshes[subIndex].materialIndex])), indiceArray.push(mesh.subMeshes[subIndex].indexCount);} else {0 > materialArray.indexOf(material) && materialArray.push(material);for (let subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) materialIndexArray.push(materialArray.indexOf(material)), indiceArray.push(mesh.subMeshes[subIndex].indexCount);}} else for (let subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) materialIndexArray.push(0), indiceArray.push(mesh.subMeshes[subIndex].indexCount);}const source = meshes[0],getVertexDataFromMesh = (mesh) => {const wm = mesh.computeWorldMatrix(!0),vertexData = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.ExtractFromMesh */ .x.ExtractFromMesh(mesh, !1, !1);return [vertexData, wm];},[sourceVertexData, sourceTransform] = getVertexDataFromMesh(source);isAsync && (yield);const meshVertexDatas = Array(meshes.length - 1);for (let i = 1; i < meshes.length; i++) meshVertexDatas[i - 1] = getVertexDataFromMesh(meshes[i]), isAsync && (yield);const mergeCoroutine = sourceVertexData._mergeCoroutine(sourceTransform, meshVertexDatas, allow32BitsIndices, isAsync, !disposeSource);let mergeCoroutineStep = mergeCoroutine.next();for (; !mergeCoroutineStep.done;) isAsync && (yield), mergeCoroutineStep = mergeCoroutine.next();const vertexData = mergeCoroutineStep.value;meshSubclass || (meshSubclass = new Mesh(source.name + "_merged", source.getScene()));const applyToCoroutine = vertexData._applyToCoroutine(meshSubclass, void 0, isAsync);for (let applyToCoroutineStep = applyToCoroutine.next(); !applyToCoroutineStep.done;) isAsync && (yield), applyToCoroutineStep = applyToCoroutine.next();if (meshSubclass.checkCollisions = source.checkCollisions, meshSubclass.overrideMaterialSideOrientation = source.overrideMaterialSideOrientation, disposeSource) for (index = 0; index < meshes.length; index++) meshes[index].dispose();if (subdivideWithSubMeshes || multiMultiMaterials) {meshSubclass.releaseSubMeshes(), index = 0;for (let offset = 0; index < indiceArray.length;) _subMesh_js__WEBPACK_IMPORTED_MODULE_14__/* .SubMesh.CreateFromIndices */ .P.CreateFromIndices(0, offset, indiceArray[index], meshSubclass, void 0, !1), offset += indiceArray[index], index++;for (const subMesh of meshSubclass.subMeshes) subMesh.refreshBoundingInfo();meshSubclass.computeWorldMatrix(!0);}if (multiMultiMaterials) {const newMultiMaterial = new _Materials_multiMaterial_js__WEBPACK_IMPORTED_MODULE_16__/* .MultiMaterial */ .G(source.name + "_merged", source.getScene());newMultiMaterial.subMaterials = materialArray;for (let subIndex = 0; subIndex < meshSubclass.subMeshes.length; subIndex++) meshSubclass.subMeshes[subIndex].materialIndex = materialIndexArray[subIndex];meshSubclass.material = newMultiMaterial;} else meshSubclass.material = source.material;return meshSubclass;}addInstance(instance) {instance._indexInSourceMeshInstanceArray = this.instances.length, this.instances.push(instance);}removeInstance(instance) {const index = instance._indexInSourceMeshInstanceArray;if (-1 != index) {if (index !== this.instances.length - 1) {const last = this.instances[this.instances.length - 1];this.instances[index] = last, last._indexInSourceMeshInstanceArray = index;}instance._indexInSourceMeshInstanceArray = -1, this.instances.pop();}}_shouldConvertRHS() {return this.overrideMaterialSideOrientation === _Materials_material_js__WEBPACK_IMPORTED_MODULE_15__/* .Material.CounterClockWiseSideOrientation */ .F.CounterClockWiseSideOrientation;}}Mesh.FRONTSIDE = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.FRONTSIDE */ .x.FRONTSIDE, Mesh.BACKSIDE = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.BACKSIDE */ .x.BACKSIDE, Mesh.DOUBLESIDE = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.DOUBLESIDE */ .x.DOUBLESIDE, Mesh.DEFAULTSIDE = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_11__/* .VertexData.DEFAULTSIDE */ .x.DEFAULTSIDE, Mesh.NO_CAP = 0, Mesh.CAP_START = 1, Mesh.CAP_END = 2, Mesh.CAP_ALL = 3, Mesh.NO_FLIP = 0, Mesh.FLIP_TILE = 1, Mesh.ROTATE_TILE = 2, Mesh.FLIP_ROW = 3, Mesh.ROTATE_ROW = 4, Mesh.FLIP_N_ROTATE_TILE = 5, Mesh.FLIP_N_ROTATE_ROW = 6, Mesh.CENTER = 0, Mesh.LEFT = 1, Mesh.RIGHT = 2, Mesh.TOP = 3, Mesh.BOTTOM = 4, Mesh.INSTANCEDMESH_SORT_TRANSPARENT = !1, Mesh._GroundMeshParser = () => {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_21__/* ._WarnImport */ .S)("GroundMesh");}, Mesh._GoldbergMeshParser = () => {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_21__/* ._WarnImport */ .S)("GoldbergMesh");}, Mesh._LinesMeshParser = () => {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_21__/* ._WarnImport */ .S)("LinesMesh");}, (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_20__/* .RegisterClass */ .H)("BABYLON.Mesh", Mesh), Mesh.prototype.setMaterialByID = function (id) {return this.setMaterialById(id);}, Mesh.CreateDisc = Mesh.CreateDisc || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateBox = Mesh.CreateBox || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateSphere = Mesh.CreateSphere || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateCylinder = Mesh.CreateCylinder || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateTorusKnot = Mesh.CreateTorusKnot || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateTorus = Mesh.CreateTorus || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreatePlane = Mesh.CreatePlane || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateGround = Mesh.CreateGround || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateTiledGround = Mesh.CreateTiledGround || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateGroundFromHeightMap = Mesh.CreateGroundFromHeightMap || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateTube = Mesh.CreateTube || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreatePolyhedron = Mesh.CreatePolyhedron || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateIcoSphere = Mesh.CreateIcoSphere || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateDecal = Mesh.CreateDecal || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.CreateCapsule = Mesh.CreateCapsule || (() => {throw new Error("Import MeshBuilder to populate this function");}), Mesh.ExtendToGoldberg = Mesh.ExtendToGoldberg || (() => {throw new Error("Import MeshBuilder to populate this function");});

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "x": () => (/* binding */ VertexData)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/coroutine.js");
/* harmony import */ var _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/error.js");
class VertexData {constructor() {this._applyTo = (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_7__/* .makeSyncFunction */ .vp)(this._applyToCoroutine.bind(this));}set(data, kind) {data.length || _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger.Warn */ .Y.Warn(`Setting vertex data kind '${kind}' with an empty array`);kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind ? this.positions = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind ? this.normals = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind ? this.tangents = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UVKind */ .o.UVKind ? this.uvs = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV2Kind */ .o.UV2Kind ? this.uvs2 = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV3Kind */ .o.UV3Kind ? this.uvs3 = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV4Kind */ .o.UV4Kind ? this.uvs4 = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV5Kind */ .o.UV5Kind ? this.uvs5 = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV6Kind */ .o.UV6Kind ? this.uvs6 = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind ? this.colors = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind ? this.matricesIndices = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind ? this.matricesWeights = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind ? this.matricesIndicesExtra = data : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind ? this.matricesWeightsExtra = data : void 0;}applyToMesh(mesh, updatable) {return this._applyTo(mesh, updatable, !1), this;}applyToGeometry(geometry, updatable) {return this._applyTo(geometry, updatable, !1), this;}updateMesh(mesh) {return this._update(mesh), this;}updateGeometry(geometry) {return this._update(geometry), this;}*_applyToCoroutine(meshOrGeometry, updatable = !1, isAsync) {return this.positions && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind, this.positions, updatable), isAsync && (yield)), this.normals && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind, this.normals, updatable), isAsync && (yield)), this.tangents && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind, this.tangents, updatable), isAsync && (yield)), this.uvs && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UVKind */ .o.UVKind, this.uvs, updatable), isAsync && (yield)), this.uvs2 && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV2Kind */ .o.UV2Kind, this.uvs2, updatable), isAsync && (yield)), this.uvs3 && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV3Kind */ .o.UV3Kind, this.uvs3, updatable), isAsync && (yield)), this.uvs4 && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV4Kind */ .o.UV4Kind, this.uvs4, updatable), isAsync && (yield)), this.uvs5 && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV5Kind */ .o.UV5Kind, this.uvs5, updatable), isAsync && (yield)), this.uvs6 && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV6Kind */ .o.UV6Kind, this.uvs6, updatable), isAsync && (yield)), this.colors && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind, this.colors, updatable), isAsync && (yield)), this.matricesIndices && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind, this.matricesIndices, updatable), isAsync && (yield)), this.matricesWeights && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, this.matricesWeights, updatable), isAsync && (yield)), this.matricesIndicesExtra && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind, this.matricesIndicesExtra, updatable), isAsync && (yield)), this.matricesWeightsExtra && (meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind, this.matricesWeightsExtra, updatable), isAsync && (yield)), this.indices ? (meshOrGeometry.setIndices(this.indices, null, updatable), isAsync && (yield)) : meshOrGeometry.setIndices([], null), this;}_update(meshOrGeometry, updateExtends, makeItUnique) {return this.positions && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind, this.positions, updateExtends, makeItUnique), this.normals && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind, this.normals, updateExtends, makeItUnique), this.tangents && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind, this.tangents, updateExtends, makeItUnique), this.uvs && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UVKind */ .o.UVKind, this.uvs, updateExtends, makeItUnique), this.uvs2 && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV2Kind */ .o.UV2Kind, this.uvs2, updateExtends, makeItUnique), this.uvs3 && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV3Kind */ .o.UV3Kind, this.uvs3, updateExtends, makeItUnique), this.uvs4 && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV4Kind */ .o.UV4Kind, this.uvs4, updateExtends, makeItUnique), this.uvs5 && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV5Kind */ .o.UV5Kind, this.uvs5, updateExtends, makeItUnique), this.uvs6 && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV6Kind */ .o.UV6Kind, this.uvs6, updateExtends, makeItUnique), this.colors && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind, this.colors, updateExtends, makeItUnique), this.matricesIndices && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind, this.matricesIndices, updateExtends, makeItUnique), this.matricesWeights && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, this.matricesWeights, updateExtends, makeItUnique), this.matricesIndicesExtra && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind, this.matricesIndicesExtra, updateExtends, makeItUnique), this.matricesWeightsExtra && meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind, this.matricesWeightsExtra, updateExtends, makeItUnique), this.indices && meshOrGeometry.setIndices(this.indices, null), this;}static _TransformVector3Coordinates(coordinates, transformation, offset = 0, length = coordinates.length) {const coordinate = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0],transformedCoordinate = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1];for (let index = offset; index < offset + length; index += 3) _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(coordinates, index, coordinate), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(coordinate, transformation, transformedCoordinate), coordinates[index] = transformedCoordinate.x, coordinates[index + 1] = transformedCoordinate.y, coordinates[index + 2] = transformedCoordinate.z;}static _TransformVector3Normals(normals, transformation, offset = 0, length = normals.length) {const normal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0],transformedNormal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1];for (let index = offset; index < offset + length; index += 3) _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.FromArrayToRef */ .P.FromArrayToRef(normals, index, normal), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(normal, transformation, transformedNormal), normals[index] = transformedNormal.x, normals[index + 1] = transformedNormal.y, normals[index + 2] = transformedNormal.z;}static _TransformVector4Normals(normals, transformation, offset = 0, length = normals.length) {const normal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector4[0] */ .jp.Vector4[0],transformedNormal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors.Vector4[1] */ .jp.Vector4[1];for (let index = offset; index < offset + length; index += 4) _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4.FromArrayToRef */ .Lt.FromArrayToRef(normals, index, normal), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4.TransformNormalToRef */ .Lt.TransformNormalToRef(normal, transformation, transformedNormal), normals[index] = transformedNormal.x, normals[index + 1] = transformedNormal.y, normals[index + 2] = transformedNormal.z, normals[index + 3] = transformedNormal.w;}static _FlipFaces(indices, offset = 0, length = indices.length) {for (let index = offset; index < offset + length; index += 3) {const tmp = indices[index + 1];indices[index + 1] = indices[index + 2], indices[index + 2] = tmp;}}transform(matrix) {const flip = 0 > matrix.determinant();return this.positions && VertexData._TransformVector3Coordinates(this.positions, matrix), this.normals && VertexData._TransformVector3Normals(this.normals, matrix), this.tangents && VertexData._TransformVector4Normals(this.tangents, matrix), flip && this.indices && VertexData._FlipFaces(this.indices), this;}merge(others, use32BitsIndices = !1, forceCloneIndices = !1) {const vertexDatas = Array.isArray(others) ? others.map((other) => [other, void 0]) : [[others, void 0]];return (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_7__/* .runCoroutineSync */ .s3)(this._mergeCoroutine(void 0, vertexDatas, use32BitsIndices, !1, forceCloneIndices));}*_mergeCoroutine(transform, vertexDatas, use32BitsIndices = !1, isAsync, forceCloneIndices) {var _a, _b, _c, _d;this._validate();const others = vertexDatas.map((vertexData) => vertexData[0]);for (const other of others) if (other._validate(), !this.normals != !other.normals || !this.tangents != !other.tangents || !this.uvs != !other.uvs || !this.uvs2 != !other.uvs2 || !this.uvs3 != !other.uvs3 || !this.uvs4 != !other.uvs4 || !this.uvs5 != !other.uvs5 || !this.uvs6 != !other.uvs6 || !this.colors != !other.colors || !this.matricesIndices != !other.matricesIndices || !this.matricesWeights != !other.matricesWeights || !this.matricesIndicesExtra != !other.matricesIndicesExtra || !this.matricesWeightsExtra != !other.matricesWeightsExtra) throw new Error("Cannot merge vertex data that do not have the same set of attributes");const totalIndices = others.reduce((indexSum, vertexData) => {var _a, _b;return indexSum + (null !== (_b = null === (_a = vertexData.indices) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0);}, null !== (_b = null === (_a = this.indices) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0),sliceIndices = forceCloneIndices || others.some((vertexData) => vertexData.indices === this.indices);let indices = sliceIndices ? null === (_c = this.indices) || void 0 === _c ? void 0 : _c.slice() : this.indices;if (0 < totalIndices) {let indicesOffset = null !== (_d = null === indices || void 0 === indices ? void 0 : indices.length) && void 0 !== _d ? _d : 0;if (indices || (indices = Array(totalIndices)), indices.length !== totalIndices) {if (Array.isArray(indices)) indices.length = totalIndices;else {const temp = use32BitsIndices || indices instanceof Uint32Array ? new Uint32Array(totalIndices) : new Uint16Array(totalIndices);temp.set(indices), indices = temp;}transform && 0 > transform.determinant() && VertexData._FlipFaces(indices, 0, indicesOffset);}let positionsOffset = this.positions ? this.positions.length / 3 : 0;for (const [other, transform] of vertexDatas) if (other.indices) {for (let index = 0; index < other.indices.length; index++) indices[indicesOffset + index] = other.indices[index] + positionsOffset;transform && 0 > transform.determinant() && VertexData._FlipFaces(indices, indicesOffset, other.indices.length), positionsOffset += other.positions.length / 3, indicesOffset += other.indices.length, isAsync && (yield);}}return this.indices = indices, this.positions = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind, this.positions, transform, vertexDatas.map((other) => [other[0].positions, other[1]])), isAsync && (yield), this.normals = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind, this.normals, transform, vertexDatas.map((other) => [other[0].normals, other[1]])), isAsync && (yield), this.tangents = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind, this.tangents, transform, vertexDatas.map((other) => [other[0].tangents, other[1]])), isAsync && (yield), this.uvs = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UVKind */ .o.UVKind, this.uvs, transform, vertexDatas.map((other) => [other[0].uvs, other[1]])), isAsync && (yield), this.uvs2 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV2Kind */ .o.UV2Kind, this.uvs2, transform, vertexDatas.map((other) => [other[0].uvs2, other[1]])), isAsync && (yield), this.uvs3 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV3Kind */ .o.UV3Kind, this.uvs3, transform, vertexDatas.map((other) => [other[0].uvs3, other[1]])), isAsync && (yield), this.uvs4 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV4Kind */ .o.UV4Kind, this.uvs4, transform, vertexDatas.map((other) => [other[0].uvs4, other[1]])), isAsync && (yield), this.uvs5 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV5Kind */ .o.UV5Kind, this.uvs5, transform, vertexDatas.map((other) => [other[0].uvs5, other[1]])), isAsync && (yield), this.uvs6 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV6Kind */ .o.UV6Kind, this.uvs6, transform, vertexDatas.map((other) => [other[0].uvs6, other[1]])), isAsync && (yield), this.colors = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind, this.colors, transform, vertexDatas.map((other) => [other[0].colors, other[1]])), isAsync && (yield), this.matricesIndices = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind, this.matricesIndices, transform, vertexDatas.map((other) => [other[0].matricesIndices, other[1]])), isAsync && (yield), this.matricesWeights = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, this.matricesWeights, transform, vertexDatas.map((other) => [other[0].matricesWeights, other[1]])), isAsync && (yield), this.matricesIndicesExtra = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind, this.matricesIndicesExtra, transform, vertexDatas.map((other) => [other[0].matricesIndicesExtra, other[1]])), isAsync && (yield), this.matricesWeightsExtra = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind, this.matricesWeightsExtra, transform, vertexDatas.map((other) => [other[0].matricesWeightsExtra, other[1]])), this;}static _MergeElement(kind, source, transform, others) {const nonNullOthers = others.filter((other) => null !== other[0] && other[0] !== void 0);if (!source && 0 == nonNullOthers.length) return source;if (!source) return this._MergeElement(kind, nonNullOthers[0][0], nonNullOthers[0][1], nonNullOthers.slice(1));const len = nonNullOthers.reduce((sumLen, elements) => sumLen + elements[0].length, source.length),transformRange = kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind ? VertexData._TransformVector3Coordinates : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind ? VertexData._TransformVector3Normals : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind ? VertexData._TransformVector4Normals : () => {};if (source instanceof Float32Array) {const ret32 = new Float32Array(len);ret32.set(source), transform && transformRange(ret32, transform, 0, source.length);let offset = source.length;for (const [vertexData, transform] of nonNullOthers) ret32.set(vertexData, offset), transform && transformRange(ret32, transform, offset, vertexData.length), offset += vertexData.length;return ret32;} else {const ret = Array(len);for (let i = 0; i < source.length; i++) ret[i] = source[i];transform && transformRange(ret, transform, 0, source.length);let offset = source.length;for (const [vertexData, transform] of nonNullOthers) {for (let i = 0; i < vertexData.length; i++) ret[offset + i] = vertexData[i];transform && transformRange(ret, transform, offset, vertexData.length), offset += vertexData.length;}return ret;}}_validate() {if (!this.positions) throw new _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .RuntimeError */ .LH("Positions are required", _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .ErrorCodes.MeshInvalidPositionsError */ .SM.MeshInvalidPositionsError);const getElementCount = (kind, values) => {const stride = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.DeduceStride */ .o.DeduceStride(kind);if (0 != values.length % stride) throw new Error("The " + kind + "s array count must be a multiple of " + stride);return values.length / stride;},positionsElementCount = getElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind, this.positions),validateElementCount = (kind, values) => {const elementCount = getElementCount(kind, values);if (elementCount !== positionsElementCount) throw new Error("The " + kind + "s element count (" + elementCount + ") does not match the positions count (" + positionsElementCount + ")");};this.normals && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind, this.normals), this.tangents && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind, this.tangents), this.uvs && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UVKind */ .o.UVKind, this.uvs), this.uvs2 && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV2Kind */ .o.UV2Kind, this.uvs2), this.uvs3 && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV3Kind */ .o.UV3Kind, this.uvs3), this.uvs4 && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV4Kind */ .o.UV4Kind, this.uvs4), this.uvs5 && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV5Kind */ .o.UV5Kind, this.uvs5), this.uvs6 && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV6Kind */ .o.UV6Kind, this.uvs6), this.colors && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind, this.colors), this.matricesIndices && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind, this.matricesIndices), this.matricesWeights && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, this.matricesWeights), this.matricesIndicesExtra && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind, this.matricesIndicesExtra), this.matricesWeightsExtra && validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind, this.matricesWeightsExtra);}serialize() {const serializationObject = {};return this.positions && (serializationObject.positions = this.positions), this.normals && (serializationObject.normals = this.normals), this.tangents && (serializationObject.tangents = this.tangents), this.uvs && (serializationObject.uvs = this.uvs), this.uvs2 && (serializationObject.uvs2 = this.uvs2), this.uvs3 && (serializationObject.uvs3 = this.uvs3), this.uvs4 && (serializationObject.uvs4 = this.uvs4), this.uvs5 && (serializationObject.uvs5 = this.uvs5), this.uvs6 && (serializationObject.uvs6 = this.uvs6), this.colors && (serializationObject.colors = this.colors), this.matricesIndices && (serializationObject.matricesIndices = this.matricesIndices, serializationObject.matricesIndices._isExpanded = !0), this.matricesWeights && (serializationObject.matricesWeights = this.matricesWeights), this.matricesIndicesExtra && (serializationObject.matricesIndicesExtra = this.matricesIndicesExtra, serializationObject.matricesIndicesExtra._isExpanded = !0), this.matricesWeightsExtra && (serializationObject.matricesWeightsExtra = this.matricesWeightsExtra), serializationObject.indices = this.indices, serializationObject;}static ExtractFromMesh(mesh, copyWhenShared, forceCopy) {return VertexData._ExtractFrom(mesh, copyWhenShared, forceCopy);}static ExtractFromGeometry(geometry, copyWhenShared, forceCopy) {return VertexData._ExtractFrom(geometry, copyWhenShared, forceCopy);}static _ExtractFrom(meshOrGeometry, copyWhenShared, forceCopy) {const result = new VertexData();return meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind) && (result.positions = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind) && (result.normals = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind) && (result.tangents = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UVKind */ .o.UVKind) && (result.uvs = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UVKind */ .o.UVKind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV2Kind */ .o.UV2Kind) && (result.uvs2 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV2Kind */ .o.UV2Kind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV3Kind */ .o.UV3Kind) && (result.uvs3 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV3Kind */ .o.UV3Kind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV4Kind */ .o.UV4Kind) && (result.uvs4 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV4Kind */ .o.UV4Kind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV5Kind */ .o.UV5Kind) && (result.uvs5 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV5Kind */ .o.UV5Kind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV6Kind */ .o.UV6Kind) && (result.uvs6 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV6Kind */ .o.UV6Kind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind) && (result.colors = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind) && (result.matricesIndices = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind) && (result.matricesWeights = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind) && (result.matricesIndicesExtra = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesExtraKind */ .o.MatricesIndicesExtraKind, copyWhenShared, forceCopy)), meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind) && (result.matricesWeightsExtra = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsExtraKind */ .o.MatricesWeightsExtraKind, copyWhenShared, forceCopy)), result.indices = meshOrGeometry.getIndices(copyWhenShared, forceCopy), result;}static CreateRibbon() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("ribbonBuilder");}static CreateBox() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("boxBuilder");}static CreateTiledBox() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("tiledBoxBuilder");}static CreateTiledPlane() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("tiledPlaneBuilder");}static CreateSphere() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("sphereBuilder");}static CreateCylinder() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("cylinderBuilder");}static CreateTorus() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("torusBuilder");}static CreateLineSystem() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("linesBuilder");}static CreateDashedLines() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("linesBuilder");}static CreateGround() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("groundBuilder");}static CreateTiledGround() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("groundBuilder");}static CreateGroundFromHeightMap() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("groundBuilder");}static CreatePlane() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("planeBuilder");}static CreateDisc() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("discBuilder");}static CreatePolygon() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("polygonBuilder");}static CreateIcoSphere() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("icoSphereBuilder");}static CreatePolyhedron() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("polyhedronBuilder");}static CreateCapsule(options = { orientation: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Up */ .P.Up(), subdivisions: 2, tessellation: 16, height: 1, radius: .25, capSubdivisions: 6 }) {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("capsuleBuilder");}static CreateTorusKnot() {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .S)("torusKnotBuilder");}static ComputeNormals(positions, indices, normals, options) {let index = 0,p1p2x = 0,p1p2y = 0,p1p2z = 0,p3p2x = 0,p3p2y = 0,p3p2z = 0,faceNormalx = 0,faceNormaly = 0,faceNormalz = 0,length = 0,v1x = 0,v1y = 0,v1z = 0,v2x = 0,v2y = 0,v2z = 0,v3x = 0,v3y = 0,v3z = 0,computeFacetNormals = !1,computeFacetPositions = !1,computeFacetPartitioning = !1,computeDepthSort = !1,faceNormalSign = 1,ratio = 0,distanceTo = null;options && (computeFacetNormals = !!options.facetNormals, computeFacetPositions = !!options.facetPositions, computeFacetPartitioning = !!options.facetPartitioning, faceNormalSign = !0 === options.useRightHandedSystem ? -1 : 1, ratio = options.ratio || 0, computeDepthSort = !!options.depthSort, distanceTo = options.distanceTo, computeDepthSort && distanceTo === void 0 && (distanceTo = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero()));let xSubRatio = 0,ySubRatio = 0,zSubRatio = 0,subSq = 0;for (computeFacetPartitioning && options && options.bbSize && (xSubRatio = options.subDiv.X * ratio / options.bbSize.x, ySubRatio = options.subDiv.Y * ratio / options.bbSize.y, zSubRatio = options.subDiv.Z * ratio / options.bbSize.z, subSq = options.subDiv.max * options.subDiv.max, options.facetPartitioning.length = 0), index = 0; index < positions.length; index++) normals[index] = 0;const nbFaces = 0 | indices.length / 3;for (index = 0; index < nbFaces; index++) {if (v1x = 3 * indices[3 * index], v1y = v1x + 1, v1z = v1x + 2, v2x = 3 * indices[3 * index + 1], v2y = v2x + 1, v2z = v2x + 2, v3x = 3 * indices[3 * index + 2], v3y = v3x + 1, v3z = v3x + 2, p1p2x = positions[v1x] - positions[v2x], p1p2y = positions[v1y] - positions[v2y], p1p2z = positions[v1z] - positions[v2z], p3p2x = positions[v3x] - positions[v2x], p3p2y = positions[v3y] - positions[v2y], p3p2z = positions[v3z] - positions[v2z], faceNormalx = faceNormalSign * (p1p2y * p3p2z - p1p2z * p3p2y), faceNormaly = faceNormalSign * (p1p2z * p3p2x - p1p2x * p3p2z), faceNormalz = faceNormalSign * (p1p2x * p3p2y - p1p2y * p3p2x), length = Math.sqrt(faceNormalx * faceNormalx + faceNormaly * faceNormaly + faceNormalz * faceNormalz), length = 0 === length ? 1 : length, faceNormalx /= length, faceNormaly /= length, faceNormalz /= length, computeFacetNormals && options && (options.facetNormals[index].x = faceNormalx, options.facetNormals[index].y = faceNormaly, options.facetNormals[index].z = faceNormalz), computeFacetPositions && options && (options.facetPositions[index].x = (positions[v1x] + positions[v2x] + positions[v3x]) / 3, options.facetPositions[index].y = (positions[v1y] + positions[v2y] + positions[v3y]) / 3, options.facetPositions[index].z = (positions[v1z] + positions[v2z] + positions[v3z]) / 3), computeFacetPartitioning && options) {const ox = Math.floor((options.facetPositions[index].x - options.bInfo.minimum.x * ratio) * xSubRatio),oy = Math.floor((options.facetPositions[index].y - options.bInfo.minimum.y * ratio) * ySubRatio),oz = Math.floor((options.facetPositions[index].z - options.bInfo.minimum.z * ratio) * zSubRatio),b1x = Math.floor((positions[v1x] - options.bInfo.minimum.x * ratio) * xSubRatio),b1y = Math.floor((positions[v1y] - options.bInfo.minimum.y * ratio) * ySubRatio),b1z = Math.floor((positions[v1z] - options.bInfo.minimum.z * ratio) * zSubRatio),b2x = Math.floor((positions[v2x] - options.bInfo.minimum.x * ratio) * xSubRatio),b2y = Math.floor((positions[v2y] - options.bInfo.minimum.y * ratio) * ySubRatio),b2z = Math.floor((positions[v2z] - options.bInfo.minimum.z * ratio) * zSubRatio),b3x = Math.floor((positions[v3x] - options.bInfo.minimum.x * ratio) * xSubRatio),b3y = Math.floor((positions[v3y] - options.bInfo.minimum.y * ratio) * ySubRatio),b3z = Math.floor((positions[v3z] - options.bInfo.minimum.z * ratio) * zSubRatio),block_idx_v1 = b1x + options.subDiv.max * b1y + subSq * b1z,block_idx_v2 = b2x + options.subDiv.max * b2y + subSq * b2z,block_idx_v3 = b3x + options.subDiv.max * b3y + subSq * b3z,block_idx_o = ox + options.subDiv.max * oy + subSq * oz;options.facetPartitioning[block_idx_o] = options.facetPartitioning[block_idx_o] ? options.facetPartitioning[block_idx_o] : [], options.facetPartitioning[block_idx_v1] = options.facetPartitioning[block_idx_v1] ? options.facetPartitioning[block_idx_v1] : [], options.facetPartitioning[block_idx_v2] = options.facetPartitioning[block_idx_v2] ? options.facetPartitioning[block_idx_v2] : [], options.facetPartitioning[block_idx_v3] = options.facetPartitioning[block_idx_v3] ? options.facetPartitioning[block_idx_v3] : [], options.facetPartitioning[block_idx_v1].push(index), block_idx_v2 != block_idx_v1 && options.facetPartitioning[block_idx_v2].push(index), block_idx_v3 == block_idx_v2 || block_idx_v3 == block_idx_v1 || options.facetPartitioning[block_idx_v3].push(index), block_idx_o == block_idx_v1 || block_idx_o == block_idx_v2 || block_idx_o == block_idx_v3 || options.facetPartitioning[block_idx_o].push(index);}if (computeDepthSort && options && options.facetPositions) {const dsf = options.depthSortedFacets[index];dsf.ind = 3 * index, dsf.sqDistance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.DistanceSquared */ .P.DistanceSquared(options.facetPositions[index], distanceTo);}normals[v1x] += faceNormalx, normals[v1y] += faceNormaly, normals[v1z] += faceNormalz, normals[v2x] += faceNormalx, normals[v2y] += faceNormaly, normals[v2z] += faceNormalz, normals[v3x] += faceNormalx, normals[v3y] += faceNormaly, normals[v3z] += faceNormalz;}for (index = 0; index < normals.length / 3; index++) faceNormalx = normals[3 * index], faceNormaly = normals[3 * index + 1], faceNormalz = normals[3 * index + 2], length = Math.sqrt(faceNormalx * faceNormalx + faceNormaly * faceNormaly + faceNormalz * faceNormalz), length = 0 === length ? 1 : length, faceNormalx /= length, faceNormaly /= length, faceNormalz /= length, normals[3 * index] = faceNormalx, normals[3 * index + 1] = faceNormaly, normals[3 * index + 2] = faceNormalz;}static _ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs) {const li = indices.length,ln = normals.length;let i, n;switch (sideOrientation = sideOrientation || VertexData.DEFAULTSIDE, sideOrientation) {case VertexData.FRONTSIDE:break;case VertexData.BACKSIDE:for (i = 0; i < li; i += 3) {const tmp = indices[i];indices[i] = indices[i + 2], indices[i + 2] = tmp;}for (n = 0; n < ln; n++) normals[n] = -normals[n];break;case VertexData.DOUBLESIDE:{const lp = positions.length,l = lp / 3;for (let p = 0; p < lp; p++) positions[lp + p] = positions[p];for (i = 0; i < li; i += 3) indices[i + li] = indices[i + 2] + l, indices[i + 1 + li] = indices[i + 1] + l, indices[i + 2 + li] = indices[i] + l;for (n = 0; n < ln; n++) normals[ln + n] = -normals[n];const lu = uvs.length;let u = 0;for (u = 0; u < lu; u++) uvs[u + lu] = uvs[u];for (frontUVs = frontUVs ? frontUVs : new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .Lt(0, 0, 1, 1), backUVs = backUVs ? backUVs : new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .Lt(0, 0, 1, 1), u = 0, i = 0; i < lu / 2; i++) uvs[u] = frontUVs.x + (frontUVs.z - frontUVs.x) * uvs[u], uvs[u + 1] = frontUVs.y + (frontUVs.w - frontUVs.y) * uvs[u + 1], uvs[u + lu] = backUVs.x + (backUVs.z - backUVs.x) * uvs[u + lu], uvs[u + lu + 1] = backUVs.y + (backUVs.w - backUVs.y) * uvs[u + lu + 1], u += 2;break;}}}static ImportVertexData(parsedVertexData, geometry) {const vertexData = new VertexData(),positions = parsedVertexData.positions;positions && vertexData.set(positions, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.PositionKind */ .o.PositionKind);const normals = parsedVertexData.normals;normals && vertexData.set(normals, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.NormalKind */ .o.NormalKind);const tangents = parsedVertexData.tangents;tangents && vertexData.set(tangents, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.TangentKind */ .o.TangentKind);const uvs = parsedVertexData.uvs;uvs && vertexData.set(uvs, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UVKind */ .o.UVKind);const uv2s = parsedVertexData.uv2s;uv2s && vertexData.set(uv2s, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV2Kind */ .o.UV2Kind);const uv3s = parsedVertexData.uv3s;uv3s && vertexData.set(uv3s, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV3Kind */ .o.UV3Kind);const uv4s = parsedVertexData.uv4s;uv4s && vertexData.set(uv4s, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV4Kind */ .o.UV4Kind);const uv5s = parsedVertexData.uv5s;uv5s && vertexData.set(uv5s, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV5Kind */ .o.UV5Kind);const uv6s = parsedVertexData.uv6s;uv6s && vertexData.set(uv6s, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.UV6Kind */ .o.UV6Kind);const colors = parsedVertexData.colors;colors && vertexData.set(_Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__/* .Color4.CheckColors4 */ .HE.CheckColors4(colors, positions.length / 3), _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.ColorKind */ .o.ColorKind);const matricesIndices = parsedVertexData.matricesIndices;matricesIndices && vertexData.set(matricesIndices, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesIndicesKind */ .o.MatricesIndicesKind);const matricesWeights = parsedVertexData.matricesWeights;matricesWeights && vertexData.set(matricesWeights, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer.MatricesWeightsKind */ .o.MatricesWeightsKind);const indices = parsedVertexData.indices;indices && (vertexData.indices = indices), geometry.setAllVerticesData(vertexData, parsedVertexData.updatable);}}VertexData.FRONTSIDE = 0, VertexData.BACKSIDE = 1, VertexData.DOUBLESIDE = 2, VertexData.DEFAULTSIDE = 0, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__/* .nativeOverride.filter */ .G6.filter((...[coordinates]) => !Array.isArray(coordinates))], VertexData, "_TransformVector3Coordinates", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__/* .nativeOverride.filter */ .G6.filter((...[normals]) => !Array.isArray(normals))], VertexData, "_TransformVector3Normals", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__/* .nativeOverride.filter */ .G6.filter((...[normals]) => !Array.isArray(normals))], VertexData, "_TransformVector4Normals", null), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__/* .nativeOverride.filter */ .G6.filter((...[indices]) => !Array.isArray(indices))], VertexData, "_FlipFaces", null);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/meshLODLevel.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "g": () => (/* binding */ MeshLODLevel)
/* harmony export */ });
class MeshLODLevel {constructor(distanceOrScreenCoverage, mesh) {this.distanceOrScreenCoverage = distanceOrScreenCoverage, this.mesh = mesh;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/subMesh.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "P": () => (/* binding */ SubMesh)
/* harmony export */ });
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Collisions_intersectionInfo_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Collisions/intersectionInfo.js");
/* harmony import */ var _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Culling/boundingInfo.js");
/* harmony import */ var _Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.functions.js");
/* harmony import */ var _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/drawWrapper.js");
class SubMesh {get materialDefines() {var _a;return this._mainDrawWrapperOverride ? this._mainDrawWrapperOverride.defines : null === (_a = this._getDrawWrapper()) || void 0 === _a ? void 0 : _a.defines;}set materialDefines(defines) {var _a;const drawWrapper = null !== (_a = this._mainDrawWrapperOverride) && void 0 !== _a ? _a : this._getDrawWrapper(void 0, !0);drawWrapper.defines = defines;}_getDrawWrapper(passId, createIfNotExisting = !1) {passId = null !== passId && void 0 !== passId ? passId : this._engine.currentRenderPassId;let drawWrapper = this._drawWrappers[passId];return !drawWrapper && createIfNotExisting && (this._drawWrappers[passId] = drawWrapper = new _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_4__/* .DrawWrapper */ .q(this._mesh.getScene().getEngine())), drawWrapper;}_removeDrawWrapper(passId, disposeWrapper = !0) {var _a;disposeWrapper && (null === (_a = this._drawWrappers[passId]) || void 0 === _a ? void 0 : _a.dispose()), this._drawWrappers[passId] = void 0;}get effect() {var _a, _b;return this._mainDrawWrapperOverride ? this._mainDrawWrapperOverride.effect : null !== (_b = null === (_a = this._getDrawWrapper()) || void 0 === _a ? void 0 : _a.effect) && void 0 !== _b ? _b : null;}get _drawWrapper() {var _a;return null !== (_a = this._mainDrawWrapperOverride) && void 0 !== _a ? _a : this._getDrawWrapper(void 0, !0);}get _drawWrapperOverride() {return this._mainDrawWrapperOverride;}_setMainDrawWrapperOverride(wrapper) {this._mainDrawWrapperOverride = wrapper;}setEffect(effect, defines = null, materialContext, resetContext = !0) {const drawWrapper = this._drawWrapper;drawWrapper.setEffect(effect, defines, resetContext), materialContext !== void 0 && (drawWrapper.materialContext = materialContext), effect || (drawWrapper.defines = null, drawWrapper.materialContext = void 0);}resetDrawCache(passId) {if (this._drawWrappers) {if (void 0 !== passId) return void this._removeDrawWrapper(passId);for (const drawWrapper of this._drawWrappers) null === drawWrapper || void 0 === drawWrapper ? void 0 : drawWrapper.dispose();}this._drawWrappers = [];}static AddToMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox = !0) {return new SubMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox);}constructor(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox = !0, addToMesh = !0) {this.materialIndex = materialIndex, this.verticesStart = verticesStart, this.verticesCount = verticesCount, this.indexStart = indexStart, this.indexCount = indexCount, this._mainDrawWrapperOverride = null, this._linesIndexCount = 0, this._linesIndexBuffer = null, this._lastColliderWorldVertices = null, this._lastColliderTransformMatrix = null, this._wasDispatched = !1, this._renderId = 0, this._alphaIndex = 0, this._distanceToCamera = 0, this._currentMaterial = null, this._mesh = mesh, this._renderingMesh = renderingMesh || mesh, addToMesh && mesh.subMeshes.push(this), this._engine = this._mesh.getScene().getEngine(), this.resetDrawCache(), this._trianglePlanes = [], this._id = mesh.subMeshes.length - 1, createBoundingBox && (this.refreshBoundingInfo(), mesh.computeWorldMatrix(!0));}get IsGlobal() {return 0 === this.verticesStart && this.verticesCount === this._mesh.getTotalVertices() && 0 === this.indexStart && this.indexCount === this._mesh.getTotalIndices();}getBoundingInfo() {return this.IsGlobal ? this._mesh.getBoundingInfo() : this._boundingInfo;}setBoundingInfo(boundingInfo) {return this._boundingInfo = boundingInfo, this;}getMesh() {return this._mesh;}getRenderingMesh() {return this._renderingMesh;}getReplacementMesh() {return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;}getEffectiveMesh() {const replacementMesh = this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;return replacementMesh ? replacementMesh : this._renderingMesh;}getMaterial(getDefaultMaterial = !0) {var _a;const rootMaterial = null !== (_a = this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId)) && void 0 !== _a ? _a : this._renderingMesh.material;if (!rootMaterial) return getDefaultMaterial ? this._mesh.getScene().defaultMaterial : null;if (this._isMultiMaterial(rootMaterial)) {const effectiveMaterial = rootMaterial.getSubMaterial(this.materialIndex);return this._currentMaterial !== effectiveMaterial && (this._currentMaterial = effectiveMaterial, this.resetDrawCache()), effectiveMaterial;}return rootMaterial;}_isMultiMaterial(material) {return material.getSubMaterial !== void 0;}refreshBoundingInfo(data = null) {if (this._lastColliderWorldVertices = null, this.IsGlobal || !this._renderingMesh || !this._renderingMesh.geometry) return this;if (data || (data = this._renderingMesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind)), !data) return this._boundingInfo = this._mesh.getBoundingInfo(), this;const indices = this._renderingMesh.getIndices();let extend;if (0 === this.indexStart && this.indexCount === indices.length) {const boundingInfo = this._renderingMesh.getBoundingInfo();extend = { minimum: boundingInfo.minimum.clone(), maximum: boundingInfo.maximum.clone() };} else extend = (0,_Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .extractMinAndMaxIndexed */ .y)(data, indices, this.indexStart, this.indexCount, this._renderingMesh.geometry.boundingBias);return this._boundingInfo ? this._boundingInfo.reConstruct(extend.minimum, extend.maximum) : this._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_2__/* .BoundingInfo */ .j(extend.minimum, extend.maximum), this;}_checkCollision(collider) {const boundingInfo = this.getBoundingInfo();return boundingInfo._checkCollision(collider);}updateBoundingInfo(world) {let boundingInfo = this.getBoundingInfo();return boundingInfo || (this.refreshBoundingInfo(), boundingInfo = this.getBoundingInfo()), boundingInfo && boundingInfo.update(world), this;}isInFrustum(frustumPlanes) {const boundingInfo = this.getBoundingInfo();return !!boundingInfo && boundingInfo.isInFrustum(frustumPlanes, this._mesh.cullingStrategy);}isCompletelyInFrustum(frustumPlanes) {const boundingInfo = this.getBoundingInfo();return !!boundingInfo && boundingInfo.isCompletelyInFrustum(frustumPlanes);}render(enableAlphaMode) {return this._renderingMesh.render(this, enableAlphaMode, this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : void 0), this;}_getLinesIndexBuffer(indices, engine) {if (!this._linesIndexBuffer) {const linesIndices = [];for (let index = this.indexStart; index < this.indexStart + this.indexCount; index += 3) linesIndices.push(indices[index], indices[index + 1], indices[index + 1], indices[index + 2], indices[index + 2], indices[index]);this._linesIndexBuffer = engine.createIndexBuffer(linesIndices), this._linesIndexCount = linesIndices.length;}return this._linesIndexBuffer;}canIntersects(ray) {const boundingInfo = this.getBoundingInfo();return !!boundingInfo && ray.intersectsBox(boundingInfo.boundingBox);}intersects(ray, positions, indices, fastCheck, trianglePredicate) {const material = this.getMaterial();if (!material) return null;let step = 3,checkStopper = !1;switch (material.fillMode) {case 3:case 5:case 6:case 8:return null;case 7:step = 1, checkStopper = !0;break;default:}return 4 === material.fillMode ? indices.length ? this._intersectLines(ray, positions, indices, this._mesh.intersectionThreshold, fastCheck) : this._intersectUnIndexedLines(ray, positions, indices, this._mesh.intersectionThreshold, fastCheck) : !indices.length && this._mesh._unIndexed ? this._intersectUnIndexedTriangles(ray, positions, indices, fastCheck, trianglePredicate) : this._intersectTriangles(ray, positions, indices, step, checkStopper, fastCheck, trianglePredicate);}_intersectLines(ray, positions, indices, intersectionThreshold, fastCheck) {let intersectInfo = null;for (let index = this.indexStart; index < this.indexStart + this.indexCount; index += 2) {const p0 = positions[indices[index]],p1 = positions[indices[index + 1]],length = ray.intersectionSegment(p0, p1, intersectionThreshold);if (!(0 > length) && (fastCheck || !intersectInfo || length < intersectInfo.distance) && (intersectInfo = new _Collisions_intersectionInfo_js__WEBPACK_IMPORTED_MODULE_1__/* .IntersectionInfo */ .c(null, null, length), intersectInfo.faceId = index / 2, fastCheck)) break;}return intersectInfo;}_intersectUnIndexedLines(ray, positions, indices, intersectionThreshold, fastCheck) {let intersectInfo = null;for (let index = this.verticesStart; index < this.verticesStart + this.verticesCount; index += 2) {const p0 = positions[index],p1 = positions[index + 1],length = ray.intersectionSegment(p0, p1, intersectionThreshold);if (!(0 > length) && (fastCheck || !intersectInfo || length < intersectInfo.distance) && (intersectInfo = new _Collisions_intersectionInfo_js__WEBPACK_IMPORTED_MODULE_1__/* .IntersectionInfo */ .c(null, null, length), intersectInfo.faceId = index / 2, fastCheck)) break;}return intersectInfo;}_intersectTriangles(ray, positions, indices, step, checkStopper, fastCheck, trianglePredicate) {let intersectInfo = null,faceId = -1;for (let index = this.indexStart; index < this.indexStart + this.indexCount - (3 - step); index += step) {faceId++;const indexA = indices[index],indexB = indices[index + 1],indexC = indices[index + 2];if (checkStopper && 4294967295 === indexC) {index += 2;continue;}const p0 = positions[indexA],p1 = positions[indexB],p2 = positions[indexC];if (!p0 || !p1 || !p2) continue;if (trianglePredicate && !trianglePredicate(p0, p1, p2, ray, indexA, indexB, indexC)) continue;const currentIntersectInfo = ray.intersectsTriangle(p0, p1, p2);if (currentIntersectInfo) {if (0 > currentIntersectInfo.distance) continue;if ((fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) && (intersectInfo = currentIntersectInfo, intersectInfo.faceId = faceId, fastCheck)) break;}}return intersectInfo;}_intersectUnIndexedTriangles(ray, positions, indices, fastCheck, trianglePredicate) {let intersectInfo = null;for (let index = this.verticesStart; index < this.verticesStart + this.verticesCount; index += 3) {const p0 = positions[index],p1 = positions[index + 1],p2 = positions[index + 2];if (trianglePredicate && !trianglePredicate(p0, p1, p2, ray, -1, -1, -1)) continue;const currentIntersectInfo = ray.intersectsTriangle(p0, p1, p2);if (currentIntersectInfo) {if (0 > currentIntersectInfo.distance) continue;if ((fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) && (intersectInfo = currentIntersectInfo, intersectInfo.faceId = index / 3, fastCheck)) break;}}return intersectInfo;}_rebuild() {this._linesIndexBuffer && (this._linesIndexBuffer = null);}clone(newMesh, newRenderingMesh) {const result = new SubMesh(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, newMesh, newRenderingMesh, !1);if (!this.IsGlobal) {const boundingInfo = this.getBoundingInfo();if (!boundingInfo) return result;result._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_2__/* .BoundingInfo */ .j(boundingInfo.minimum, boundingInfo.maximum);}return result;}dispose() {this._linesIndexBuffer && (this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer), this._linesIndexBuffer = null);const index = this._mesh.subMeshes.indexOf(this);this._mesh.subMeshes.splice(index, 1), this.resetDrawCache();}getClassName() {return "SubMesh";}static CreateFromIndices(materialIndex, startIndex, indexCount, mesh, renderingMesh, createBoundingBox = !0) {let minVertexIndex = Number.MAX_VALUE,maxVertexIndex = -Number.MAX_VALUE;const indices = (renderingMesh || mesh).getIndices();for (let index = startIndex; index < startIndex + indexCount; index++) {const vertexIndex = indices[index];vertexIndex < minVertexIndex && (minVertexIndex = vertexIndex), vertexIndex > maxVertexIndex && (maxVertexIndex = vertexIndex);}return new SubMesh(materialIndex, minVertexIndex, maxVertexIndex - minVertexIndex + 1, startIndex, indexCount, mesh, renderingMesh, createBoundingBox);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/thinInstanceMesh.js":
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstanceAdd */ .Kj.prototype.thinInstanceAdd = function (matrix, refresh = !0) {if (!this.getScene().getEngine().getCaps().instancedArrays) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger.Error */ .Y.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"), -1;this._thinInstanceUpdateBufferSize("matrix", Array.isArray(matrix) ? matrix.length : 1);const index = this._thinInstanceDataStorage.instancesCount;if (Array.isArray(matrix)) for (let i = 0; i < matrix.length; ++i) this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix[i], i == matrix.length - 1 && refresh);else this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix, refresh);return index;}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstanceAddSelf */ .Kj.prototype.thinInstanceAddSelf = function (refresh = !0) {return this.thinInstanceAdd(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.IdentityReadOnly */ .y3.IdentityReadOnly, refresh);}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstanceRegisterAttribute */ .Kj.prototype.thinInstanceRegisterAttribute = function (kind, stride) {kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorKind */ .o.ColorKind && (kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind), this.removeVerticesData(kind), this._thinInstanceInitializeUserStorage(), this._userThinInstanceBuffersStorage.strides[kind] = stride, this._userThinInstanceBuffersStorage.sizes[kind] = stride * Math.max(32, this._thinInstanceDataStorage.instancesCount), this._userThinInstanceBuffersStorage.data[kind] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[kind]), this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .o(this.getEngine(), this._userThinInstanceBuffersStorage.data[kind], kind, !0, !1, stride, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]);}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstanceSetMatrixAt */ .Kj.prototype.thinInstanceSetMatrixAt = function (index, matrix, refresh = !0) {if (!this._thinInstanceDataStorage.matrixData || index >= this._thinInstanceDataStorage.instancesCount) return !1;const matrixData = this._thinInstanceDataStorage.matrixData;return matrix.copyToArray(matrixData, 16 * index), this._thinInstanceDataStorage.worldMatrices && (this._thinInstanceDataStorage.worldMatrices[index] = matrix), refresh && (this.thinInstanceBufferUpdated("matrix"), !this.doNotSyncBoundingInfo && this.thinInstanceRefreshBoundingInfo(!1)), !0;}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstanceSetAttributeAt */ .Kj.prototype.thinInstanceSetAttributeAt = function (kind, index, value, refresh = !0) {return (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorKind */ .o.ColorKind && (kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind), this._userThinInstanceBuffersStorage && this._userThinInstanceBuffersStorage.data[kind] && !(index >= this._thinInstanceDataStorage.instancesCount)) && (this._thinInstanceUpdateBufferSize(kind, 0), this._userThinInstanceBuffersStorage.data[kind].set(value, index * this._userThinInstanceBuffersStorage.strides[kind]), refresh && this.thinInstanceBufferUpdated(kind), !0);}, Object.defineProperty(_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype */ .Kj.prototype, "thinInstanceCount", { get: function () {return this._thinInstanceDataStorage.instancesCount;}, set: function (value) {var _a, _b;const matrixData = null !== (_a = this._thinInstanceDataStorage.matrixData) && void 0 !== _a ? _a : null === (_b = this.source) || void 0 === _b ? void 0 : _b._thinInstanceDataStorage.matrixData,numMaxInstances = matrixData ? matrixData.length / 16 : 0;value <= numMaxInstances && (this._thinInstanceDataStorage.instancesCount = value);}, enumerable: !0, configurable: !0 }), _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype._thinInstanceCreateMatrixBuffer */ .Kj.prototype._thinInstanceCreateMatrixBuffer = function (kind, buffer, staticBuffer = !1) {kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorKind */ .o.ColorKind && (kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind);const matrixBuffer = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .Buffer */ .l(this.getEngine(), buffer, !staticBuffer, 16, !1, !0);for (let i = 0; 4 > i; i++) this.setVerticesBuffer(matrixBuffer.createVertexBuffer(kind + i, 4 * i, 4));return matrixBuffer;}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstanceSetBuffer */ .Kj.prototype.thinInstanceSetBuffer = function (kind, buffer, stride = 0, staticBuffer = !1) {var _a, _b, _c;stride = stride || 16, "matrix" === kind ? (null === (_a = this._thinInstanceDataStorage.matrixBuffer) || void 0 === _a ? void 0 : _a.dispose(), this._thinInstanceDataStorage.matrixBuffer = null, this._thinInstanceDataStorage.matrixBufferSize = buffer ? buffer.length : 32 * stride, this._thinInstanceDataStorage.matrixData = buffer, this._thinInstanceDataStorage.worldMatrices = null, null === buffer ? (this._thinInstanceDataStorage.instancesCount = 0, !this.doNotSyncBoundingInfo && this.refreshBoundingInfo()) : (this._thinInstanceDataStorage.instancesCount = buffer.length / stride, this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", buffer, staticBuffer), !this.doNotSyncBoundingInfo && this.thinInstanceRefreshBoundingInfo(!1))) : "previousMatrix" === kind ? (null === (_b = this._thinInstanceDataStorage.previousMatrixBuffer) || void 0 === _b ? void 0 : _b.dispose(), this._thinInstanceDataStorage.previousMatrixBuffer = null, this._thinInstanceDataStorage.previousMatrixData = buffer, null !== buffer && (this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", buffer, staticBuffer))) : (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorKind */ .o.ColorKind && (kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind), null === buffer ? (null === (_c = this._userThinInstanceBuffersStorage) || void 0 === _c ? void 0 : _c.data[kind]) && (this.removeVerticesData(kind), delete this._userThinInstanceBuffersStorage.data[kind], delete this._userThinInstanceBuffersStorage.strides[kind], delete this._userThinInstanceBuffersStorage.sizes[kind], delete this._userThinInstanceBuffersStorage.vertexBuffers[kind]) : (this._thinInstanceInitializeUserStorage(), this._userThinInstanceBuffersStorage.data[kind] = buffer, this._userThinInstanceBuffersStorage.strides[kind] = stride, this._userThinInstanceBuffersStorage.sizes[kind] = buffer.length, this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .o(this.getEngine(), buffer, kind, !staticBuffer, !1, stride, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind])));}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstanceBufferUpdated */ .Kj.prototype.thinInstanceBufferUpdated = function (kind) {var _a, _b, _c;"matrix" === kind ? null === (_a = this._thinInstanceDataStorage.matrixBuffer) || void 0 === _a ? void 0 : _a.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, this._thinInstanceDataStorage.instancesCount) : "previousMatrix" === kind ? null === (_b = this._thinInstanceDataStorage.previousMatrixBuffer) || void 0 === _b ? void 0 : _b.updateDirectly(this._thinInstanceDataStorage.previousMatrixData, 0, this._thinInstanceDataStorage.instancesCount) : (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorKind */ .o.ColorKind && (kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind), (null === (_c = this._userThinInstanceBuffersStorage) || void 0 === _c ? void 0 : _c.vertexBuffers[kind]) && this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(this._userThinInstanceBuffersStorage.data[kind], 0));}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstancePartialBufferUpdate */ .Kj.prototype.thinInstancePartialBufferUpdate = function (kind, data, offset) {var _a;"matrix" === kind ? this._thinInstanceDataStorage.matrixBuffer && this._thinInstanceDataStorage.matrixBuffer.updateDirectly(data, offset) : (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorKind */ .o.ColorKind && (kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind), (null === (_a = this._userThinInstanceBuffersStorage) || void 0 === _a ? void 0 : _a.vertexBuffers[kind]) && this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(data, offset));}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstanceGetWorldMatrices */ .Kj.prototype.thinInstanceGetWorldMatrices = function () {if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) return [];const matrixData = this._thinInstanceDataStorage.matrixData;if (!this._thinInstanceDataStorage.worldMatrices) {this._thinInstanceDataStorage.worldMatrices = [];for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) this._thinInstanceDataStorage.worldMatrices[i] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.FromArray */ .y3.FromArray(matrixData, 16 * i);}return this._thinInstanceDataStorage.worldMatrices;}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype.thinInstanceRefreshBoundingInfo */ .Kj.prototype.thinInstanceRefreshBoundingInfo = function (forceRefreshParentInfo = !1, applySkeleton = !1, applyMorph = !1) {if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) return;const vectors = this._thinInstanceDataStorage.boundingVectors;forceRefreshParentInfo && (vectors.length = 0, this.refreshBoundingInfo(applySkeleton, applyMorph));const boundingInfo = this.getBoundingInfo(),matrixData = this._thinInstanceDataStorage.matrixData;if (0 === vectors.length) for (let v = 0; v < boundingInfo.boundingBox.vectors.length; ++v) vectors.push(boundingInfo.boundingBox.vectors[v].clone());_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[0].setAll */ .jp.Vector3[0].setAll(Number.POSITIVE_INFINITY), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[1].setAll */ .jp.Vector3[1].setAll(Number.NEGATIVE_INFINITY);for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) {_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix.FromArrayToRef */ .y3.FromArrayToRef(matrixData, 16 * i, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0]);for (let v = 0; v < vectors.length; ++v) _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(vectors[v], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[0].minimizeInPlace */ .jp.Vector3[0].minimizeInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[1].maximizeInPlace */ .jp.Vector3[1].maximizeInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2]);}boundingInfo.reConstruct(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1]), this._updateBoundingInfo();}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype._thinInstanceUpdateBufferSize */ .Kj.prototype._thinInstanceUpdateBufferSize = function (kind, numInstances = 1) {var _a, _b, _c;kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorKind */ .o.ColorKind && (kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer.ColorInstanceKind */ .o.ColorInstanceKind);const kindIsMatrix = "matrix" === kind;if (!kindIsMatrix && (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.strides[kind])) return;const stride = kindIsMatrix ? 16 : this._userThinInstanceBuffersStorage.strides[kind],currentSize = kindIsMatrix ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[kind];let data = kindIsMatrix ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[kind];const bufferSize = (this._thinInstanceDataStorage.instancesCount + numInstances) * stride;let newSize = currentSize;for (; newSize < bufferSize;) newSize *= 2;if (!data || currentSize != newSize) {if (!data) data = new Float32Array(newSize);else {const newData = new Float32Array(newSize);newData.set(data, 0), data = newData;}kindIsMatrix ? (null === (_a = this._thinInstanceDataStorage.matrixBuffer) || void 0 === _a ? void 0 : _a.dispose(), this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", data, !1), this._thinInstanceDataStorage.matrixData = data, this._thinInstanceDataStorage.matrixBufferSize = newSize, this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData && (null === (_b = this._thinInstanceDataStorage.previousMatrixBuffer) || void 0 === _b ? void 0 : _b.dispose(), this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", data, !1))) : (null === (_c = this._userThinInstanceBuffersStorage.vertexBuffers[kind]) || void 0 === _c ? void 0 : _c.dispose(), this._userThinInstanceBuffersStorage.data[kind] = data, this._userThinInstanceBuffersStorage.sizes[kind] = newSize, this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .o(this.getEngine(), data, kind, !0, !1, stride, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]));}}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype._thinInstanceInitializeUserStorage */ .Kj.prototype._thinInstanceInitializeUserStorage = function () {this._userThinInstanceBuffersStorage || (this._userThinInstanceBuffersStorage = { data: {}, sizes: {}, vertexBuffers: {}, strides: {} });}, _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh.prototype._disposeThinInstanceSpecificData */ .Kj.prototype._disposeThinInstanceSpecificData = function () {var _a;(null === (_a = this._thinInstanceDataStorage) || void 0 === _a ? void 0 : _a.matrixBuffer) && (this._thinInstanceDataStorage.matrixBuffer.dispose(), this._thinInstanceDataStorage.matrixBuffer = null);};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Meshes/transformNode.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Y": () => (/* binding */ TransformNode)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/node.js");
/* harmony import */ var _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.axis.js");
class TransformNode extends _node_js__WEBPACK_IMPORTED_MODULE_4__/* .Node */ .N {get billboardMode() {return this._billboardMode;}set billboardMode(value) {this._billboardMode === value || (this._billboardMode = value, this._cache.useBillboardPosition = 0 != (this._billboardMode & TransformNode.BILLBOARDMODE_USE_POSITION), this._computeUseBillboardPath());}get preserveParentRotationForBillboard() {return this._preserveParentRotationForBillboard;}set preserveParentRotationForBillboard(value) {value === this._preserveParentRotationForBillboard || (this._preserveParentRotationForBillboard = value, this._computeUseBillboardPath());}_computeUseBillboardPath() {this._cache.useBillboardPath = this._billboardMode !== TransformNode.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard;}get infiniteDistance() {return this._infiniteDistance;}set infiniteDistance(value) {this._infiniteDistance === value || (this._infiniteDistance = value);}constructor(name, scene = null, isPure = !0) {super(name, scene), this._forward = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(0, 0, 1), this._up = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(0, 1, 0), this._right = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(1, 0, 0), this._position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._rotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._rotationQuaternion = null, this._scaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.One */ .P.One(), this._transformToBoneReferal = null, this._isAbsoluteSynced = !1, this._billboardMode = TransformNode.BILLBOARDMODE_NONE, this._preserveParentRotationForBillboard = !1, this.scalingDeterminant = 1, this._infiniteDistance = !1, this.ignoreNonUniformScaling = !1, this.reIntegrateRotationIntoRotationQuaternion = !1, this._poseMatrix = null, this._localMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Zero */ .y3.Zero(), this._usePivotMatrix = !1, this._absolutePosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._absoluteScaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), this._absoluteRotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.Identity */ ._f.Identity(), this._pivotMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Identity */ .y3.Identity(), this._postMultiplyPivotMatrix = !1, this._isWorldMatrixFrozen = !1, this._indexInSceneTransformNodesArray = -1, this.onAfterWorldMatrixUpdateObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), this._nonUniformScaling = !1, isPure && this.getScene().addTransformNode(this);}getClassName() {return "TransformNode";}get position() {return this._position;}set position(newPosition) {this._position = newPosition, this._isDirty = !0;}isUsingPivotMatrix() {return this._usePivotMatrix;}get rotation() {return this._rotation;}set rotation(newRotation) {this._rotation = newRotation, this._rotationQuaternion = null, this._isDirty = !0;}get scaling() {return this._scaling;}set scaling(newScaling) {this._scaling = newScaling, this._isDirty = !0;}get rotationQuaternion() {return this._rotationQuaternion;}set rotationQuaternion(quaternion) {this._rotationQuaternion = quaternion, quaternion && this._rotation.setAll(0), this._isDirty = !0;}get forward() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormalFromFloatsToRef */ .P.TransformNormalFromFloatsToRef(0, 0, this.getScene().useRightHandedSystem ? -1 : 1, this.getWorldMatrix(), this._forward), this._forward.normalize();}get up() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormalFromFloatsToRef */ .P.TransformNormalFromFloatsToRef(0, 1, 0, this.getWorldMatrix(), this._up), this._up.normalize();}get right() {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormalFromFloatsToRef */ .P.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem ? -1 : 1, 0, 0, this.getWorldMatrix(), this._right), this._right.normalize();}updatePoseMatrix(matrix) {return this._poseMatrix ? (this._poseMatrix.copyFrom(matrix), this) : (this._poseMatrix = matrix.clone(), this);}getPoseMatrix() {return this._poseMatrix || (this._poseMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Identity */ .y3.Identity()), this._poseMatrix;}_isSynchronized() {const cache = this._cache;return this._billboardMode === cache.billboardMode && this._billboardMode === TransformNode.BILLBOARDMODE_NONE && !cache.pivotMatrixUpdated && !this._infiniteDistance && !this._position._isDirty && !this._scaling._isDirty && !(this._rotationQuaternion && this._rotationQuaternion._isDirty || this._rotation._isDirty);}_initCache() {super._initCache();const cache = this._cache;cache.localMatrixUpdated = !1, cache.billboardMode = -1, cache.infiniteDistance = !1, cache.useBillboardPosition = !1, cache.useBillboardPath = !1;}get absolutePosition() {return this.getAbsolutePosition();}get absoluteScaling() {return this._syncAbsoluteScalingAndRotation(), this._absoluteScaling;}get absoluteRotationQuaternion() {return this._syncAbsoluteScalingAndRotation(), this._absoluteRotationQuaternion;}setPreTransformMatrix(matrix) {return this.setPivotMatrix(matrix, !1);}setPivotMatrix(matrix, postMultiplyPivotMatrix = !0) {return this._pivotMatrix.copyFrom(matrix), this._usePivotMatrix = !this._pivotMatrix.isIdentity(), this._cache.pivotMatrixUpdated = !0, this._postMultiplyPivotMatrix = postMultiplyPivotMatrix, this._postMultiplyPivotMatrix && (this._pivotMatrixInverse ? this._pivotMatrix.invertToRef(this._pivotMatrixInverse) : this._pivotMatrixInverse = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Invert */ .y3.Invert(this._pivotMatrix)), this;}getPivotMatrix() {return this._pivotMatrix;}instantiateHierarchy(newParent = null, options, onNewNodeCreated) {const clone = this.clone("Clone of " + (this.name || this.id), newParent || this.parent, !0);clone && onNewNodeCreated && onNewNodeCreated(this, clone);for (const child of this.getChildTransformNodes(!0)) child.instantiateHierarchy(clone, options, onNewNodeCreated);return clone;}freezeWorldMatrix(newWorldMatrix = null, decompose = !1) {return newWorldMatrix ? decompose ? (this._rotation.setAll(0), this._rotationQuaternion = this._rotationQuaternion || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.Identity */ ._f.Identity(), newWorldMatrix.decompose(this._scaling, this._rotationQuaternion, this._position), this.computeWorldMatrix(!0)) : (this._worldMatrix = newWorldMatrix, this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]), this._afterComputeWorldMatrix()) : (this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0)), this._isDirty = !1, this._isWorldMatrixFrozen = !0, this;}unfreezeWorldMatrix() {return this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0), this;}get isWorldMatrixFrozen() {return this._isWorldMatrixFrozen;}getAbsolutePosition() {return this.computeWorldMatrix(), this._absolutePosition;}setAbsolutePosition(absolutePosition) {if (!absolutePosition) return this;let absolutePositionX, absolutePositionY, absolutePositionZ;if (void 0 === absolutePosition.x) {if (3 > arguments.length) return this;absolutePositionX = arguments[0], absolutePositionY = arguments[1], absolutePositionZ = arguments[2];} else absolutePositionX = absolutePosition.x, absolutePositionY = absolutePosition.y, absolutePositionZ = absolutePosition.z;if (this.parent) {const invertParentWorldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0];this.parent.getWorldMatrix().invertToRef(invertParentWorldMatrix), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinatesFromFloatsToRef */ .P.TransformCoordinatesFromFloatsToRef(absolutePositionX, absolutePositionY, absolutePositionZ, invertParentWorldMatrix, this.position);} else this.position.x = absolutePositionX, this.position.y = absolutePositionY, this.position.z = absolutePositionZ;return this._absolutePosition.copyFrom(absolutePosition), this;}setPositionWithLocalVector(vector3) {return this.computeWorldMatrix(), this.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormal */ .P.TransformNormal(vector3, this._localMatrix), this;}getPositionExpressedInLocalSpace() {this.computeWorldMatrix();const invLocalWorldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0];return this._localMatrix.invertToRef(invLocalWorldMatrix), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormal */ .P.TransformNormal(this.position, invLocalWorldMatrix);}locallyTranslate(vector3) {return this.computeWorldMatrix(!0), this.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinates */ .P.TransformCoordinates(vector3, this._localMatrix), this;}lookAt(targetPoint, yawCor = 0, pitchCor = 0, rollCor = 0, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Space.LOCAL */ .T.LOCAL) {const dv = TransformNode._LookAtVectorCache,pos = space === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Space.LOCAL */ .T.LOCAL ? this.position : this.getAbsolutePosition();if (targetPoint.subtractToRef(pos, dv), this.setDirection(dv, yawCor, pitchCor, rollCor), space === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Space.WORLD */ .T.WORLD && this.parent) if (this.rotationQuaternion) {const rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0];this.rotationQuaternion.toRotationMatrix(rotationMatrix);const parentRotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(parentRotationMatrix), parentRotationMatrix.invert(), rotationMatrix.multiplyToRef(parentRotationMatrix, rotationMatrix), this.rotationQuaternion.fromRotationMatrix(rotationMatrix);} else {const quaternionRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.FromEulerVectorToRef */ ._f.FromEulerVectorToRef(this.rotation, quaternionRotation);const rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0];quaternionRotation.toRotationMatrix(rotationMatrix);const parentRotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(parentRotationMatrix), parentRotationMatrix.invert(), rotationMatrix.multiplyToRef(parentRotationMatrix, rotationMatrix), quaternionRotation.fromRotationMatrix(rotationMatrix), quaternionRotation.toEulerAnglesToRef(this.rotation);}return this;}getDirection(localAxis) {const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero();return this.getDirectionToRef(localAxis, result), result;}getDirectionToRef(localAxis, result) {return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormalToRef */ .P.TransformNormalToRef(localAxis, this.getWorldMatrix(), result), this;}setDirection(localAxis, yawCor = 0, pitchCor = 0, rollCor = 0) {const yaw = -Math.atan2(localAxis.z, localAxis.x) + Math.PI / 2,len = Math.sqrt(localAxis.x * localAxis.x + localAxis.z * localAxis.z),pitch = -Math.atan2(localAxis.y, len);return this.rotationQuaternion ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRollToRef */ ._f.RotationYawPitchRollToRef(yaw + yawCor, pitch + pitchCor, rollCor, this.rotationQuaternion) : (this.rotation.x = pitch + pitchCor, this.rotation.y = yaw + yawCor, this.rotation.z = rollCor), this;}setPivotPoint(point, space = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Space.LOCAL */ .T.LOCAL) {0 == this.getScene().getRenderId() && this.computeWorldMatrix(!0);const wm = this.getWorldMatrix();if (space == _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Space.WORLD */ .T.WORLD) {const tmat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0];wm.invertToRef(tmat), point = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinates */ .P.TransformCoordinates(point, tmat);}return this.setPivotMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Translation */ .y3.Translation(-point.x, -point.y, -point.z), !0);}getPivotPoint() {const point = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero();return this.getPivotPointToRef(point), point;}getPivotPointToRef(result) {return result.x = -this._pivotMatrix.m[12], result.y = -this._pivotMatrix.m[13], result.z = -this._pivotMatrix.m[14], this;}getAbsolutePivotPoint() {const point = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero();return this.getAbsolutePivotPointToRef(point), point;}getAbsolutePivotPointToRef(result) {return this.getPivotPointToRef(result), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(result, this.getWorldMatrix(), result), this;}markAsDirty(property) {if (this._isDirty) return this;if (this._children) for (const child of this._children) child.markAsDirty(property);return super.markAsDirty(property);}setParent(node, preserveScalingSign = !1, updatePivot = !1) {if (!node && !this.parent) return this;const quatRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0],position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0],scale = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1],invParentMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.IdentityToRef */ .y3.IdentityToRef(invParentMatrix);const composedMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0];this.computeWorldMatrix(!0);let currentRotation = this.rotationQuaternion;return currentRotation || (currentRotation = TransformNode._TmpRotation, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRollToRef */ ._f.RotationYawPitchRollToRef(this._rotation.y, this._rotation.x, this._rotation.z, currentRotation)), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.ComposeToRef */ .y3.ComposeToRef(this.scaling, currentRotation, this.position, composedMatrix), this.parent && composedMatrix.multiplyToRef(this.parent.computeWorldMatrix(!0), composedMatrix), node && (node.computeWorldMatrix(!0).invertToRef(invParentMatrix), composedMatrix.multiplyToRef(invParentMatrix, composedMatrix)), composedMatrix.decompose(scale, quatRotation, position, preserveScalingSign ? this : void 0), this.rotationQuaternion ? this.rotationQuaternion.copyFrom(quatRotation) : quatRotation.toEulerAnglesToRef(this.rotation), this.scaling.copyFrom(scale), this.position.copyFrom(position), this.parent = node, updatePivot && this.setPivotMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Identity */ .y3.Identity()), this;}get nonUniformScaling() {return this._nonUniformScaling;}_updateNonUniformScalingState(value) {return this._nonUniformScaling !== value && (this._nonUniformScaling = value, !0);}attachToBone(bone, affectedTransformNode) {return this._currentParentWhenAttachingToBone = this.parent, this._transformToBoneReferal = affectedTransformNode, this.parent = bone, bone.getSkeleton().prepare(), 0 > bone.getWorldMatrix().determinant() && (this.scalingDeterminant *= -1), this;}detachFromBone(resetToPreviousParent = !1) {return this.parent ? (0 > this.parent.getWorldMatrix().determinant() && (this.scalingDeterminant *= -1), this._transformToBoneReferal = null, this.parent = resetToPreviousParent ? this._currentParentWhenAttachingToBone : null, this) : (resetToPreviousParent && (this.parent = this._currentParentWhenAttachingToBone), this);}rotate(axis, amount, space) {axis.normalize(), this.rotationQuaternion || (this.rotationQuaternion = this.rotation.toQuaternion(), this.rotation.setAll(0));let rotationQuaternion;if (!space || space === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Space.LOCAL */ .T.LOCAL) rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationAxisToRef */ ._f.RotationAxisToRef(axis, amount, TransformNode._RotationAxisCache), this.rotationQuaternion.multiplyToRef(rotationQuaternion, this.rotationQuaternion);else {if (this.parent) {const invertParentWorldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0];this.parent.getWorldMatrix().invertToRef(invertParentWorldMatrix), axis = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformNormal */ .P.TransformNormal(axis, invertParentWorldMatrix);}rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationAxisToRef */ ._f.RotationAxisToRef(axis, amount, TransformNode._RotationAxisCache), rotationQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);}return this;}rotateAround(point, axis, amount) {axis.normalize(), this.rotationQuaternion || (this.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRoll */ ._f.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z), this.rotation.setAll(0));const tmpVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0],finalScale = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1],finalTranslation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[2] */ .jp.Vector3[2],finalRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0],translationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0],translationMatrixInv = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1],rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[2] */ .jp.Matrix[2],finalMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[3] */ .jp.Matrix[3];return point.subtractToRef(this.position, tmpVector), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.TranslationToRef */ .y3.TranslationToRef(tmpVector.x, tmpVector.y, tmpVector.z, translationMatrix), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.TranslationToRef */ .y3.TranslationToRef(-tmpVector.x, -tmpVector.y, -tmpVector.z, translationMatrixInv), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.RotationAxisToRef */ .y3.RotationAxisToRef(axis, amount, rotationMatrix), translationMatrixInv.multiplyToRef(rotationMatrix, finalMatrix), finalMatrix.multiplyToRef(translationMatrix, finalMatrix), finalMatrix.decompose(finalScale, finalRotation, finalTranslation), this.position.addInPlace(finalTranslation), finalRotation.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion), this;}translate(axis, distance, space) {const displacementVector = axis.scale(distance);if (!space || space === _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Space.LOCAL */ .T.LOCAL) {const tempV3 = this.getPositionExpressedInLocalSpace().add(displacementVector);this.setPositionWithLocalVector(tempV3);} else this.setAbsolutePosition(this.getAbsolutePosition().add(displacementVector));return this;}addRotation(x, y, z) {let rotationQuaternion;this.rotationQuaternion ? rotationQuaternion = this.rotationQuaternion : (rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[1] */ .jp.Quaternion[1], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRollToRef */ ._f.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, rotationQuaternion));const accumulation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0];return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRollToRef */ ._f.RotationYawPitchRollToRef(y, x, z, accumulation), rotationQuaternion.multiplyInPlace(accumulation), this.rotationQuaternion || rotationQuaternion.toEulerAnglesToRef(this.rotation), this;}_getEffectiveParent() {return this.parent;}isWorldMatrixCameraDependent() {return this._infiniteDistance && !this.parent || this._billboardMode !== TransformNode.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard;}computeWorldMatrix(force = !1, camera = null) {if (this._isWorldMatrixFrozen && !this._isDirty) return this._worldMatrix;const currentRenderId = this.getScene().getRenderId();if (!this._isDirty && !force && (this._currentRenderId === currentRenderId || this.isSynchronized())) return this._currentRenderId = currentRenderId, this._worldMatrix;camera = camera || this.getScene().activeCamera, this._updateCache();const cache = this._cache;cache.pivotMatrixUpdated = !1, cache.billboardMode = this.billboardMode, cache.infiniteDistance = this.infiniteDistance, cache.parent = this._parentNode, this._currentRenderId = currentRenderId, this._childUpdateId += 1, this._isDirty = !1, this._position._isDirty = !1, this._rotation._isDirty = !1, this._scaling._isDirty = !1;const parent = this._getEffectiveParent(),scaling = TransformNode._TmpScaling;let translation = this._position;if (this._infiniteDistance && !this.parent && camera) {const cameraWorldMatrix = camera.getWorldMatrix(),cameraGlobalPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(cameraWorldMatrix.m[12], cameraWorldMatrix.m[13], cameraWorldMatrix.m[14]);translation = TransformNode._TmpTranslation, translation.copyFromFloats(this._position.x + cameraGlobalPosition.x, this._position.y + cameraGlobalPosition.y, this._position.z + cameraGlobalPosition.z);}scaling.copyFromFloats(this._scaling.x * this.scalingDeterminant, this._scaling.y * this.scalingDeterminant, this._scaling.z * this.scalingDeterminant);let rotation;if (!this._rotationQuaternion) rotation = TransformNode._TmpRotation, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRollToRef */ ._f.RotationYawPitchRollToRef(this._rotation.y, this._rotation.x, this._rotation.z, rotation);else if (this._rotationQuaternion._isDirty = !1, rotation = this._rotationQuaternion, this.reIntegrateRotationIntoRotationQuaternion) {const len = this.rotation.lengthSquared();len && (this._rotationQuaternion.multiplyInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRoll */ ._f.RotationYawPitchRoll(this._rotation.y, this._rotation.x, this._rotation.z)), this._rotation.copyFromFloats(0, 0, 0));}if (this._usePivotMatrix) {const scaleMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.ScalingToRef */ .y3.ScalingToRef(scaling.x, scaling.y, scaling.z, scaleMatrix);const rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0];rotation.toRotationMatrix(rotationMatrix), this._pivotMatrix.multiplyToRef(scaleMatrix, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[4] */ .jp.Matrix[4]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[4].multiplyToRef */ .jp.Matrix[4].multiplyToRef(rotationMatrix, this._localMatrix), this._postMultiplyPivotMatrix && this._localMatrix.multiplyToRef(this._pivotMatrixInverse, this._localMatrix), this._localMatrix.addTranslationFromFloats(translation.x, translation.y, translation.z);} else _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.ComposeToRef */ .y3.ComposeToRef(scaling, rotation, translation, this._localMatrix);if (parent && parent.getWorldMatrix) {if (force && parent.computeWorldMatrix(force), cache.useBillboardPath) {this._transformToBoneReferal ? parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[7] */ .jp.Matrix[7]) : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[7].copyFrom */ .jp.Matrix[7].copyFrom(parent.getWorldMatrix());const translation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[5] */ .jp.Vector3[5],scale = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[6] */ .jp.Vector3[6],orientation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[7].decompose */ .jp.Matrix[7].decompose(scale, orientation, translation), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.ScalingToRef */ .y3.ScalingToRef(scale.x, scale.y, scale.z, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[7] */ .jp.Matrix[7]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[7].setTranslation */ .jp.Matrix[7].setTranslation(translation), TransformNode.BillboardUseParentOrientation && (this._position.applyRotationQuaternionToRef(orientation, translation), this._localMatrix.setTranslation(translation)), this._localMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[7] */ .jp.Matrix[7], this._worldMatrix);} else this._transformToBoneReferal ? (this._localMatrix.multiplyToRef(parent.getWorldMatrix(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[6] */ .jp.Matrix[6]), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[6].multiplyToRef */ .jp.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), this._worldMatrix)) : this._localMatrix.multiplyToRef(parent.getWorldMatrix(), this._worldMatrix);this._markSyncedWithParent();} else this._worldMatrix.copyFrom(this._localMatrix);if (cache.useBillboardPath && camera && this.billboardMode && !cache.useBillboardPosition) {const storedTranslation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0];if (this._worldMatrix.getTranslationToRef(storedTranslation), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1].copyFrom */ .jp.Matrix[1].copyFrom(camera.getViewMatrix()), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1].setTranslationFromFloats */ .jp.Matrix[1].setTranslationFromFloats(0, 0, 0), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1].invertToRef */ .jp.Matrix[1].invertToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0]), (this.billboardMode & TransformNode.BILLBOARDMODE_ALL) !== TransformNode.BILLBOARDMODE_ALL) {_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0].decompose */ .jp.Matrix[0].decompose(void 0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0], void 0);const eulerAngles = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0].toEulerAnglesToRef */ .jp.Quaternion[0].toEulerAnglesToRef(eulerAngles), (this.billboardMode & TransformNode.BILLBOARDMODE_X) !== TransformNode.BILLBOARDMODE_X && (eulerAngles.x = 0), (this.billboardMode & TransformNode.BILLBOARDMODE_Y) !== TransformNode.BILLBOARDMODE_Y && (eulerAngles.y = 0), (this.billboardMode & TransformNode.BILLBOARDMODE_Z) !== TransformNode.BILLBOARDMODE_Z && (eulerAngles.z = 0), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.RotationYawPitchRollToRef */ .y3.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0]);}this._worldMatrix.setTranslationFromFloats(0, 0, 0), this._worldMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0], this._worldMatrix), this._worldMatrix.setTranslation(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0]);} else if (cache.useBillboardPath && camera && cache.useBillboardPosition) {const storedTranslation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0];this._worldMatrix.getTranslationToRef(storedTranslation);const cameraPosition = camera.globalPosition;this._worldMatrix.invertToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1]);const camInObjSpace = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinatesToRef */ .P.TransformCoordinatesToRef(cameraPosition, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[1] */ .jp.Matrix[1], camInObjSpace), camInObjSpace.normalize();const yaw = -Math.atan2(camInObjSpace.z, camInObjSpace.x) + Math.PI / 2,len = Math.sqrt(camInObjSpace.x * camInObjSpace.x + camInObjSpace.z * camInObjSpace.z),pitch = -Math.atan2(camInObjSpace.y, len);if (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.RotationYawPitchRollToRef */ ._f.RotationYawPitchRollToRef(yaw, pitch, 0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0]), (this.billboardMode & TransformNode.BILLBOARDMODE_ALL) !== TransformNode.BILLBOARDMODE_ALL) {const eulerAngles = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[1] */ .jp.Vector3[1];_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0].toEulerAnglesToRef */ .jp.Quaternion[0].toEulerAnglesToRef(eulerAngles), (this.billboardMode & TransformNode.BILLBOARDMODE_X) !== TransformNode.BILLBOARDMODE_X && (eulerAngles.x = 0), (this.billboardMode & TransformNode.BILLBOARDMODE_Y) !== TransformNode.BILLBOARDMODE_Y && (eulerAngles.y = 0), (this.billboardMode & TransformNode.BILLBOARDMODE_Z) !== TransformNode.BILLBOARDMODE_Z && (eulerAngles.z = 0), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.RotationYawPitchRollToRef */ .y3.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0]);} else _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.FromQuaternionToRef */ .y3.FromQuaternionToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0, 0, 0), this._worldMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0], this._worldMatrix), this._worldMatrix.setTranslation(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Vector3[0] */ .jp.Vector3[0]);}return this.ignoreNonUniformScaling ? this._updateNonUniformScalingState(!1) : this._scaling.isNonUniformWithinEpsilon(1e-6) ? this._updateNonUniformScalingState(!0) : parent && parent._nonUniformScaling ? this._updateNonUniformScalingState(parent._nonUniformScaling) : this._updateNonUniformScalingState(!1), this._afterComputeWorldMatrix(), this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]), this._isAbsoluteSynced = !1, this.onAfterWorldMatrixUpdateObservable.notifyObservers(this), this._poseMatrix || (this._poseMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Invert */ .y3.Invert(this._worldMatrix)), this._worldMatrixDeterminantIsDirty = !0, this._worldMatrix;}resetLocalMatrix(independentOfChildren = !0) {if (this.computeWorldMatrix(), independentOfChildren) {const children = this.getChildren();for (let i = 0; i < children.length; ++i) {const child = children[i];if (child) {child.computeWorldMatrix();const bakedMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Matrix[0] */ .jp.Matrix[0];child._localMatrix.multiplyToRef(this._localMatrix, bakedMatrix);const tmpRotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors.Quaternion[0] */ .jp.Quaternion[0];bakedMatrix.decompose(child.scaling, tmpRotationQuaternion, child.position), child.rotationQuaternion ? child.rotationQuaternion.copyFrom(tmpRotationQuaternion) : tmpRotationQuaternion.toEulerAnglesToRef(child.rotation);}}}this.scaling.copyFromFloats(1, 1, 1), this.position.copyFromFloats(0, 0, 0), this.rotation.copyFromFloats(0, 0, 0), this.rotationQuaternion && (this.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.Identity */ ._f.Identity()), this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.Identity */ .y3.Identity();}_afterComputeWorldMatrix() {}registerAfterWorldMatrixUpdate(func) {return this.onAfterWorldMatrixUpdateObservable.add(func), this;}unregisterAfterWorldMatrixUpdate(func) {return this.onAfterWorldMatrixUpdateObservable.removeCallback(func), this;}getPositionInCameraSpace(camera = null) {return camera || (camera = this.getScene().activeCamera), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.TransformCoordinates */ .P.TransformCoordinates(this.getAbsolutePosition(), camera.getViewMatrix());}getDistanceToCamera(camera = null) {return camera || (camera = this.getScene().activeCamera), this.getAbsolutePosition().subtract(camera.globalPosition).length();}clone(name, newParent, doNotCloneChildren) {const result = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Clone */ .p4.Clone(() => new TransformNode(name, this.getScene()), this);if (result.name = name, result.id = name, newParent && (result.parent = newParent), !doNotCloneChildren) {const directDescendants = this.getDescendants(!0);for (let index = 0; index < directDescendants.length; index++) {const child = directDescendants[index];child.clone && child.clone(name + "." + child.name, result);}}return result;}serialize(currentSerializationObject) {const serializationObject = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Serialize */ .p4.Serialize(this, currentSerializationObject);return serializationObject.type = this.getClassName(), serializationObject.uniqueId = this.uniqueId, this.parent && this.parent._serializeAsParent(serializationObject), serializationObject.localMatrix = this.getPivotMatrix().asArray(), serializationObject.isEnabled = this.isEnabled(), serializationObject;}static Parse(parsedTransformNode, scene, rootUrl) {const transformNode = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper.Parse */ .p4.Parse(() => new TransformNode(parsedTransformNode.name, scene), parsedTransformNode, scene, rootUrl);return parsedTransformNode.localMatrix ? transformNode.setPreTransformMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.FromArray */ .y3.FromArray(parsedTransformNode.localMatrix)) : parsedTransformNode.pivotMatrix && transformNode.setPivotMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix.FromArray */ .y3.FromArray(parsedTransformNode.pivotMatrix)), transformNode.setEnabled(parsedTransformNode.isEnabled), transformNode._waitingParsedUniqueId = parsedTransformNode.uniqueId, void 0 !== parsedTransformNode.parentId && (transformNode._waitingParentId = parsedTransformNode.parentId), void 0 !== parsedTransformNode.parentInstanceIndex && (transformNode._waitingParentInstanceIndex = parsedTransformNode.parentInstanceIndex), transformNode;}getChildTransformNodes(directDescendantsOnly, predicate) {const results = [];return this._getDescendants(results, directDescendantsOnly, (node) => (!predicate || predicate(node)) && node instanceof TransformNode), results;}dispose(doNotRecurse, disposeMaterialAndTextures = !1) {if (this.getScene().stopAnimation(this), this.getScene().removeTransformNode(this), this._parentContainer) {const index = this._parentContainer.transformNodes.indexOf(this);-1 < index && this._parentContainer.transformNodes.splice(index, 1), this._parentContainer = null;}if (this.onAfterWorldMatrixUpdateObservable.clear(), doNotRecurse) {const transformNodes = this.getChildTransformNodes(!0);for (const transformNode of transformNodes) transformNode.parent = null, transformNode.computeWorldMatrix(!0);}super.dispose(doNotRecurse, disposeMaterialAndTextures);}normalizeToUnitCube(includeDescendants = !0, ignoreRotation = !1, predicate) {let storedRotation = null,storedRotationQuaternion = null;ignoreRotation && (this.rotationQuaternion ? (storedRotationQuaternion = this.rotationQuaternion.clone(), this.rotationQuaternion.copyFromFloats(0, 0, 0, 1)) : this.rotation && (storedRotation = this.rotation.clone(), this.rotation.copyFromFloats(0, 0, 0)));const boundingVectors = this.getHierarchyBoundingVectors(includeDescendants, predicate),sizeVec = boundingVectors.max.subtract(boundingVectors.min),maxDimension = Math.max(sizeVec.x, sizeVec.y, sizeVec.z);if (0 === maxDimension) return this;return this.scaling.scaleInPlace(1 / maxDimension), ignoreRotation && (this.rotationQuaternion && storedRotationQuaternion ? this.rotationQuaternion.copyFrom(storedRotationQuaternion) : this.rotation && storedRotation && this.rotation.copyFrom(storedRotation)), this;}_syncAbsoluteScalingAndRotation() {this._isAbsoluteSynced || (this._worldMatrix.decompose(this._absoluteScaling, this._absoluteRotationQuaternion), this._isAbsoluteSynced = !0);}}TransformNode.BILLBOARDMODE_NONE = 0, TransformNode.BILLBOARDMODE_X = 1, TransformNode.BILLBOARDMODE_Y = 2, TransformNode.BILLBOARDMODE_Z = 4, TransformNode.BILLBOARDMODE_ALL = 7, TransformNode.BILLBOARDMODE_USE_POSITION = 128, TransformNode.BillboardUseParentOrientation = !1, TransformNode._TmpRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion.Zero */ ._f.Zero(), TransformNode._TmpScaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), TransformNode._TmpTranslation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3.Zero */ .P.Zero(), TransformNode._LookAtVectorCache = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .P(0, 0, 0), TransformNode._RotationAxisCache = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ ._f(), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)("position")], TransformNode.prototype, "_position", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)("rotation")], TransformNode.prototype, "_rotation", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsQuaternion */ .mv)("rotationQuaternion")], TransformNode.prototype, "_rotationQuaternion", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .hd)("scaling")], TransformNode.prototype, "_scaling", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("billboardMode")], TransformNode.prototype, "_billboardMode", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], TransformNode.prototype, "scalingDeterminant", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)("infiniteDistance")], TransformNode.prototype, "_infiniteDistance", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], TransformNode.prototype, "ignoreNonUniformScaling", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .qC)()], TransformNode.prototype, "reIntegrateRotationIntoRotationQuaternion", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$": () => (/* binding */ CubeMapToSphericalPolynomialTools)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
/* harmony import */ var _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/sphericalPolynomial.js");
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.constants.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
class FileFaceOrientation {constructor(name, worldAxisForNormal, worldAxisForFileX, worldAxisForFileY) {this.name = name, this.worldAxisForNormal = worldAxisForNormal, this.worldAxisForFileX = worldAxisForFileX, this.worldAxisForFileY = worldAxisForFileY;}}class CubeMapToSphericalPolynomialTools {static ConvertCubeMapTextureToSphericalPolynomial(texture) {var _a;if (!texture.isCube) return null;null === (_a = texture.getScene()) || void 0 === _a ? void 0 : _a.getEngine().flushFramebuffer();const size = texture.getSize().width,rightPromise = texture.readPixels(0, void 0, void 0, !1),leftPromise = texture.readPixels(1, void 0, void 0, !1);let upPromise, downPromise;texture.isRenderTarget ? (upPromise = texture.readPixels(3, void 0, void 0, !1), downPromise = texture.readPixels(2, void 0, void 0, !1)) : (upPromise = texture.readPixels(2, void 0, void 0, !1), downPromise = texture.readPixels(3, void 0, void 0, !1));const frontPromise = texture.readPixels(4, void 0, void 0, !1),backPromise = texture.readPixels(5, void 0, void 0, !1),gammaSpace = texture.gammaSpace;let type = 0;return (1 == texture.textureType || 2 == texture.textureType) && (type = 1), new Promise((resolve) => {Promise.all([leftPromise, rightPromise, upPromise, downPromise, frontPromise, backPromise]).then(([left, right, up, down, front, back]) => {const cubeInfo = { size, right, left, up, down, front, back, format: 5, type, gammaSpace };resolve(this.ConvertCubeMapToSphericalPolynomial(cubeInfo));});});}static _AreaElement(x, y) {return Math.atan2(x * y, Math.sqrt(x * x + y * y + 1));}static ConvertCubeMapToSphericalPolynomial(cubeInfo) {const sphericalHarmonics = new _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_2__/* .SphericalHarmonics */ ._();let totalSolidAngle = 0;const du = 2 / cubeInfo.size,halfTexel = .5 * du,minUV = halfTexel - 1;for (let faceIndex = 0; 6 > faceIndex; faceIndex++) {const fileFace = this._FileFaces[faceIndex],dataArray = cubeInfo[fileFace.name];let v = minUV;const stride = 5 === cubeInfo.format ? 4 : 3;for (let u, y = 0; y < cubeInfo.size; y++) {u = minUV;for (let x = 0; x < cubeInfo.size; x++) {const worldDirection = fileFace.worldAxisForFileX.scale(u).add(fileFace.worldAxisForFileY.scale(v)).add(fileFace.worldAxisForNormal);worldDirection.normalize();const deltaSolidAngle = this._AreaElement(u - halfTexel, v - halfTexel) - this._AreaElement(u - halfTexel, v + halfTexel) - this._AreaElement(u + halfTexel, v - halfTexel) + this._AreaElement(u + halfTexel, v + halfTexel);let r = dataArray[y * cubeInfo.size * stride + x * stride + 0],g = dataArray[y * cubeInfo.size * stride + x * stride + 1],b = dataArray[y * cubeInfo.size * stride + x * stride + 2];isNaN(r) && (r = 0), isNaN(g) && (g = 0), isNaN(b) && (b = 0), 0 === cubeInfo.type && (r /= 255, g /= 255, b /= 255), cubeInfo.gammaSpace && (r = Math.pow(_Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_1__/* .Scalar.Clamp */ .R.Clamp(r), _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_3__/* .ToLinearSpace */ .Nn), g = Math.pow(_Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_1__/* .Scalar.Clamp */ .R.Clamp(g), _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_3__/* .ToLinearSpace */ .Nn), b = Math.pow(_Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_1__/* .Scalar.Clamp */ .R.Clamp(b), _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_3__/* .ToLinearSpace */ .Nn));r = _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_1__/* .Scalar.Clamp */ .R.Clamp(r, 0, 4096), g = _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_1__/* .Scalar.Clamp */ .R.Clamp(g, 0, 4096), b = _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_1__/* .Scalar.Clamp */ .R.Clamp(b, 0, 4096);const color = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__/* .Color3 */ .Wo(r, g, b);sphericalHarmonics.addLight(worldDirection, color, deltaSolidAngle), totalSolidAngle += deltaSolidAngle, u += du;}v += du;}}const sphereSolidAngle = 4 * Math.PI,correctionFactor = sphereSolidAngle * 6 / 6 / totalSolidAngle;return sphericalHarmonics.scaleInPlace(correctionFactor), sphericalHarmonics.convertIncidentRadianceToIrradiance(), sphericalHarmonics.convertIrradianceToLambertianRadiance(), _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_2__/* .SphericalPolynomial.FromHarmonics */ .i.FromHarmonics(sphericalHarmonics);}}CubeMapToSphericalPolynomialTools._FileFaces = [new FileFaceOrientation("right", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 0, -1), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, -1, 0)), new FileFaceOrientation("left", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(-1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 0, 1), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, -1, 0)), new FileFaceOrientation("up", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 1, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 0, 1)), new FileFaceOrientation("down", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, -1, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 0, -1)), new FileFaceOrientation("front", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 0, 1), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, -1, 0)), new FileFaceOrientation("back", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, 0, -1), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(-1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .P(0, -1, 0))];

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/andOrNotEvaluator.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "q": () => (/* binding */ AndOrNotEvaluator)
/* harmony export */ });
class AndOrNotEvaluator {static Eval(query, evaluateCallback) {return query = query.match(/\([^()]*\)/g) ? query.replace(/\([^()]*\)/g, (r) => (r = r.slice(1, r.length - 1), AndOrNotEvaluator._HandleParenthesisContent(r, evaluateCallback))) : AndOrNotEvaluator._HandleParenthesisContent(query, evaluateCallback), "true" === query || "false" !== query && AndOrNotEvaluator.Eval(query, evaluateCallback);}static _HandleParenthesisContent(parenthesisContent, evaluateCallback) {evaluateCallback = evaluateCallback || ((r) => "true" === r);let result;const or = parenthesisContent.split("||");for (const i in or) if (Object.prototype.hasOwnProperty.call(or, i)) {let ori = AndOrNotEvaluator._SimplifyNegation(or[i].trim());const and = ori.split("&&");if (1 < and.length) for (let j = 0; j < and.length; ++j) {const andj = AndOrNotEvaluator._SimplifyNegation(and[j].trim());if (result = "true" !== andj && "false" !== andj ? "!" === andj[0] ? !evaluateCallback(andj.substring(1)) : evaluateCallback(andj) : "true" === andj, !result) {ori = "false";break;}}if (result || "true" === ori) {result = !0;break;}result = "true" !== ori && "false" !== ori ? "!" === ori[0] ? !evaluateCallback(ori.substring(1)) : evaluateCallback(ori) : "true" === ori;}return result ? "true" : "false";}static _SimplifyNegation(booleanString) {return booleanString = booleanString.replace(/^[\s!]+/, (r) => (r = r.replace(/[\s]/g, () => ""), r.length % 2 ? "!" : "")), booleanString = booleanString.trim(), "!true" === booleanString ? booleanString = "false" : "!false" === booleanString && (booleanString = "true"), booleanString;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/arrayTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "B": () => (/* binding */ ArrayTools),
/* harmony export */   "M": () => (/* binding */ _ObserveArray)
/* harmony export */ });
class ArrayTools {static BuildArray(size, itemBuilder) {const a = [];for (let i = 0; i < size; ++i) a.push(itemBuilder());return a;}static BuildTuple(size, itemBuilder) {return ArrayTools.BuildArray(size, itemBuilder);}}function _observeArrayfunction(object, functionName, callback) {const oldFunction = object[functionName];if ("function" != typeof oldFunction) return null;const newFunction = function () {const previousLength = object.length,returnValue = newFunction.previous.apply(object, arguments);return callback(functionName, previousLength), returnValue;};return oldFunction.next = newFunction, newFunction.previous = oldFunction, object[functionName] = newFunction, () => {const previous = newFunction.previous;if (previous) {const next = newFunction.next;next ? (previous.next = next, next.previous = previous) : (previous.next = void 0, object[functionName] = previous), newFunction.next = void 0, newFunction.previous = void 0;}};}const observedArrayFunctions = ["push", "splice", "pop", "shift", "unshift"];function _ObserveArray(array, callback) {const unObserveFunctions = observedArrayFunctions.map((name) => _observeArrayfunction(array, name, callback));return () => {unObserveFunctions.forEach((unObserveFunction) => {null === unObserveFunction || void 0 === unObserveFunction ? void 0 : unObserveFunction();});};}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/brdfTextureTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$": () => (/* binding */ GetEnvironmentBRDFTexture),
/* harmony export */   "D": () => (/* binding */ BRDFTextureTools)
/* harmony export */ });
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
/* harmony import */ var _rgbdTextureTools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/rgbdTextureTools.js");
/* harmony import */ var _tools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
const _environmentBRDFBase64Texture = "data:image/png;base64, ";let _instanceNumber = 0;const GetEnvironmentBRDFTexture = (scene) => {if (!scene.environmentBRDFTexture) {const useDelayedTextureLoading = scene.useDelayedTextureLoading;scene.useDelayedTextureLoading = !1;const previousState = scene._blockEntityCollection;scene._blockEntityCollection = !1;const texture = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.CreateFromBase64String */ .x.CreateFromBase64String(_environmentBRDFBase64Texture, "EnvironmentBRDFTexture" + _instanceNumber++, scene, !0, !1, _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.BILINEAR_SAMPLINGMODE */ .x.BILINEAR_SAMPLINGMODE);scene._blockEntityCollection = previousState;const texturesCache = scene.getEngine().getLoadedTexturesCache(),index = texturesCache.indexOf(texture.getInternalTexture());-1 !== index && texturesCache.splice(index, 1), texture.isRGBD = !0, texture.wrapU = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.CLAMP_ADDRESSMODE */ .x.CLAMP_ADDRESSMODE, texture.wrapV = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.CLAMP_ADDRESSMODE */ .x.CLAMP_ADDRESSMODE, scene.environmentBRDFTexture = texture, scene.useDelayedTextureLoading = useDelayedTextureLoading, _rgbdTextureTools_js__WEBPACK_IMPORTED_MODULE_1__/* .RGBDTextureTools.ExpandRGBDTexture */ .r.ExpandRGBDTexture(texture);const observer = scene.getEngine().onContextRestoredObservable.add(() => {texture.isRGBD = !0;const checkReady = () => {texture.isReady() ? _rgbdTextureTools_js__WEBPACK_IMPORTED_MODULE_1__/* .RGBDTextureTools.ExpandRGBDTexture */ .r.ExpandRGBDTexture(texture) : _tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.SetImmediate */ .w1.SetImmediate(checkReady);};checkReady();});scene.onDisposeObservable.add(() => {scene.getEngine().onContextRestoredObservable.remove(observer);});}return scene.environmentBRDFTexture;};const BRDFTextureTools = { GetEnvironmentBRDFTexture };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/copyTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Jj": () => (/* binding */ GenerateBase64StringFromTextureAsync),
/* harmony export */   "_u": () => (/* binding */ GenerateBase64StringFromTexture),
/* harmony export */   "r1": () => (/* binding */ CopyTools),
/* harmony export */   "xj": () => (/* binding */ GenerateBase64StringFromPixelData)
/* harmony export */ });
function GenerateBase64StringFromPixelData(pixels, size, invertY = !1) {const width = size.width,height = size.height;if (pixels instanceof Float32Array) {let len = pixels.byteLength / pixels.BYTES_PER_ELEMENT;const npixels = new Uint8Array(len);for (; 0 <= --len;) {let val = pixels[len];0 > val ? val = 0 : 1 < val && (val = 1), npixels[len] = 255 * val;}pixels = npixels;}const canvas = document.createElement("canvas");canvas.width = width, canvas.height = height;const ctx = canvas.getContext("2d");if (!ctx) return null;const imageData = ctx.createImageData(width, height),castData = imageData.data;if (castData.set(pixels), ctx.putImageData(imageData, 0, 0), invertY) {const canvas2 = document.createElement("canvas");canvas2.width = width, canvas2.height = height;const ctx2 = canvas2.getContext("2d");return ctx2 ? (ctx2.translate(0, height), ctx2.scale(1, -1), ctx2.drawImage(canvas, 0, 0), canvas2.toDataURL("image/png")) : null;}return canvas.toDataURL("image/png");}function GenerateBase64StringFromTexture(texture, faceIndex = 0, level = 0) {const internalTexture = texture.getInternalTexture();if (!internalTexture) return null;const pixels = texture._readPixelsSync(faceIndex, level);return pixels ? GenerateBase64StringFromPixelData(pixels, texture.getSize(), internalTexture.invertY) : null;}async function GenerateBase64StringFromTextureAsync(texture, faceIndex = 0, level = 0) {const internalTexture = texture.getInternalTexture();if (!internalTexture) return null;const pixels = await texture.readPixels(faceIndex, level);return pixels ? GenerateBase64StringFromPixelData(pixels, texture.getSize(), internalTexture.invertY) : null;}const CopyTools = { GenerateBase64StringFromPixelData, GenerateBase64StringFromTexture, GenerateBase64StringFromTextureAsync };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/coroutine.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "KO": () => (/* binding */ createYieldingScheduler),
/* harmony export */   "U3": () => (/* binding */ makeAsyncFunction),
/* harmony export */   "WP": () => (/* binding */ inlineScheduler),
/* harmony export */   "d_": () => (/* binding */ runCoroutine),
/* harmony export */   "s3": () => (/* binding */ runCoroutineSync),
/* harmony export */   "sM": () => (/* binding */ runCoroutineAsync),
/* harmony export */   "vp": () => (/* binding */ makeSyncFunction)
/* harmony export */ });
function inlineScheduler(coroutine, onStep, onError) {try {const step = coroutine.next();step.done ? onStep(step) : step.value ? step.value.then(() => {step.value = void 0, onStep(step);}, onError) : onStep(step);} catch (error) {onError(error);}}function createYieldingScheduler(yieldAfterMS = 25) {let startTime;return (coroutine, onStep, onError) => {const currentTime = performance.now();startTime === void 0 || currentTime - startTime > yieldAfterMS ? (startTime = currentTime, setTimeout(() => {inlineScheduler(coroutine, onStep, onError);}, 0)) : inlineScheduler(coroutine, onStep, onError);};}function runCoroutine(coroutine, scheduler, onSuccess, onError, abortSignal) {const resume = () => {let reschedule;const onStep = (stepResult) => {stepResult.done ? onSuccess(stepResult.value) : reschedule === void 0 ? reschedule = !0 : resume();};do reschedule = void 0, abortSignal && abortSignal.aborted ? onError(new Error("Aborted")) : scheduler(coroutine, onStep, onError), void 0 === reschedule && (reschedule = !1); while (reschedule);};resume();}function runCoroutineSync(coroutine, abortSignal) {let result;return runCoroutine(coroutine, inlineScheduler, (r) => result = r, (e) => {throw e;}, abortSignal), result;}function runCoroutineAsync(coroutine, scheduler, abortSignal) {return new Promise((resolve, reject) => {runCoroutine(coroutine, scheduler, resolve, reject, abortSignal);});}function makeSyncFunction(coroutineFactory, abortSignal) {return (...params) => runCoroutineSync(coroutineFactory(...params), abortSignal);}function makeAsyncFunction(coroutineFactory, scheduler, abortSignal) {return (...params) => runCoroutineAsync(coroutineFactory(...params), scheduler, abortSignal);}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/dataReader.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "d": () => (/* binding */ DataReader)
/* harmony export */ });
/* harmony import */ var _stringTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/stringTools.js");
class DataReader {constructor(buffer) {this.byteOffset = 0, this.buffer = buffer;}loadAsync(byteLength) {return this.buffer.readAsync(this.byteOffset, byteLength).then((data) => {this._dataView = new DataView(data.buffer, data.byteOffset, data.byteLength), this._dataByteOffset = 0;});}readUint32() {const value = this._dataView.getUint32(this._dataByteOffset, !0);return this._dataByteOffset += 4, this.byteOffset += 4, value;}readUint8Array(byteLength) {const value = new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + this._dataByteOffset, byteLength);return this._dataByteOffset += byteLength, this.byteOffset += byteLength, value;}readString(byteLength) {return (0,_stringTools_js__WEBPACK_IMPORTED_MODULE_0__/* .Decode */ .fJ)(this.readUint8Array(byteLength));}skipBytes(byteLength) {this._dataByteOffset += byteLength, this.byteOffset += byteLength;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/decorators.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "G6": () => (/* binding */ nativeOverride),
/* harmony export */   "N$": () => (/* binding */ serializeAsColorCurves),
/* harmony export */   "QC": () => (/* binding */ serializeAsVector2),
/* harmony export */   "RR": () => (/* binding */ serializeAsMeshReference),
/* harmony export */   "VE": () => (/* binding */ serializeAsCameraReference),
/* harmony export */   "XX": () => (/* binding */ serializeAsColor4),
/* harmony export */   "hd": () => (/* binding */ serializeAsVector3),
/* harmony export */   "mv": () => (/* binding */ serializeAsQuaternion),
/* harmony export */   "n9": () => (/* binding */ serializeAsColor3),
/* harmony export */   "oQ": () => (/* binding */ serializeAsMatrix),
/* harmony export */   "oU": () => (/* binding */ serializeAsTexture),
/* harmony export */   "p4": () => (/* binding */ SerializationHelper),
/* harmony export */   "qC": () => (/* binding */ serialize),
/* harmony export */   "qQ": () => (/* binding */ serializeAsFresnelParameters),
/* harmony export */   "rX": () => (/* binding */ serializeAsImageProcessingConfiguration),
/* harmony export */   "wz": () => (/* binding */ expandToProperty)
/* harmony export */ });
/* harmony import */ var _Misc_tags_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tags.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _devTools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
const __decoratorInitialStore = {},__mergedStore = {},_copySource = function (creationFunction, source, instanciate) {const destination = creationFunction();_Misc_tags_js__WEBPACK_IMPORTED_MODULE_0__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_0__/* .Tags.AddTagsTo */ .$.AddTagsTo(destination, source.tags);const classStore = getMergedStore(destination);for (const property in classStore) {const propertyDescriptor = classStore[property],sourceProperty = source[property],propertyType = propertyDescriptor.type;void 0 !== sourceProperty && null !== sourceProperty && ("uniqueId" !== property || SerializationHelper.AllowLoadingUniqueId) && (0 === propertyType || 6 === propertyType || 11 === propertyType ? destination[property] = sourceProperty : 1 === propertyType ? destination[property] = instanciate || sourceProperty.isRenderTarget ? sourceProperty : sourceProperty.clone() : 2 === propertyType || 3 === propertyType || 4 === propertyType || 5 === propertyType || 7 === propertyType || 10 === propertyType || 12 === propertyType ? destination[property] = instanciate ? sourceProperty : sourceProperty.clone() : void 0);}return destination;};function getDirectStore(target) {const classKey = target.getClassName();return __decoratorInitialStore[classKey] || (__decoratorInitialStore[classKey] = {}), __decoratorInitialStore[classKey];}function getMergedStore(target) {const classKey = target.getClassName();if (__mergedStore[classKey]) return __mergedStore[classKey];__mergedStore[classKey] = {};const store = __mergedStore[classKey];let currentTarget = target,currentKey = classKey;for (; currentKey;) {const initialStore = __decoratorInitialStore[currentKey];for (const property in initialStore) store[property] = initialStore[property];let parent,done = !1;do {if (parent = Object.getPrototypeOf(currentTarget), !parent.getClassName) {done = !0;break;}if (parent.getClassName() !== currentKey) break;currentTarget = parent;} while (parent);if (done) break;currentKey = parent.getClassName(), currentTarget = parent;}return store;}function generateSerializableMember(type, sourceName) {return (target, propertyKey) => {const classStore = getDirectStore(target);classStore[propertyKey] || (classStore[propertyKey] = { type: type, sourceName: sourceName });};}function generateExpandMember(setCallback, targetKey = null) {return (target, propertyKey) => {const key = targetKey || "_" + propertyKey;Object.defineProperty(target, propertyKey, { get: function () {return this[key];}, set: function (value) {"function" == typeof this.equals && this.equals(value) || this[key] === value || (this[key] = value, target[setCallback].apply(this));}, enumerable: !0, configurable: !0 });};}function expandToProperty(callback, targetKey = null) {return generateExpandMember(callback, targetKey);}function serialize(sourceName) {return generateSerializableMember(0, sourceName);}function serializeAsTexture(sourceName) {return generateSerializableMember(1, sourceName);}function serializeAsColor3(sourceName) {return generateSerializableMember(2, sourceName);}function serializeAsFresnelParameters(sourceName) {return generateSerializableMember(3, sourceName);}function serializeAsVector2(sourceName) {return generateSerializableMember(4, sourceName);}function serializeAsVector3(sourceName) {return generateSerializableMember(5, sourceName);}function serializeAsMeshReference(sourceName) {return generateSerializableMember(6, sourceName);}function serializeAsColorCurves(sourceName) {return generateSerializableMember(7, sourceName);}function serializeAsColor4(sourceName) {return generateSerializableMember(8, sourceName);}function serializeAsImageProcessingConfiguration(sourceName) {return generateSerializableMember(9, sourceName);}function serializeAsQuaternion(sourceName) {return generateSerializableMember(10, sourceName);}function serializeAsMatrix(sourceName) {return generateSerializableMember(12, sourceName);}function serializeAsCameraReference(sourceName) {return generateSerializableMember(11, sourceName);}class SerializationHelper {static AppendSerializedAnimations(source, destination) {if (source.animations) {destination.animations = [];for (let animationIndex = 0; animationIndex < source.animations.length; animationIndex++) {const animation = source.animations[animationIndex];destination.animations.push(animation.serialize());}}}static Serialize(entity, serializationObject) {serializationObject || (serializationObject = {}), _Misc_tags_js__WEBPACK_IMPORTED_MODULE_0__/* .Tags */ .$ && (serializationObject.tags = _Misc_tags_js__WEBPACK_IMPORTED_MODULE_0__/* .Tags.GetTags */ .$.GetTags(entity));const serializedProperties = getMergedStore(entity);for (const property in serializedProperties) {const propertyDescriptor = serializedProperties[property],targetPropertyName = propertyDescriptor.sourceName || property,propertyType = propertyDescriptor.type,sourceProperty = entity[property];void 0 !== sourceProperty && null !== sourceProperty && ("uniqueId" !== property || SerializationHelper.AllowLoadingUniqueId) && (0 === propertyType ? serializationObject[targetPropertyName] = sourceProperty : 1 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.serialize() : 2 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.asArray() : 3 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.serialize() : 4 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.asArray() : 5 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.asArray() : 6 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.id : 7 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.serialize() : 8 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.asArray() : 9 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.serialize() : 10 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.asArray() : 11 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.id : 12 === propertyType ? serializationObject[targetPropertyName] = sourceProperty.asArray() : void 0);}return serializationObject;}static Parse(creationFunction, source, scene, rootUrl = null) {const destination = creationFunction();rootUrl || (rootUrl = ""), _Misc_tags_js__WEBPACK_IMPORTED_MODULE_0__/* .Tags */ .$ && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_0__/* .Tags.AddTagsTo */ .$.AddTagsTo(destination, source.tags);const classStore = getMergedStore(destination);for (const property in classStore) {const propertyDescriptor = classStore[property],sourceProperty = source[propertyDescriptor.sourceName || property],propertyType = propertyDescriptor.type;if (sourceProperty !== void 0 && null !== sourceProperty && ("uniqueId" !== property || SerializationHelper.AllowLoadingUniqueId)) {const dest = destination;0 === propertyType ? dest[property] = sourceProperty : 1 === propertyType ? scene && (dest[property] = SerializationHelper._TextureParser(sourceProperty, scene, rootUrl)) : 2 === propertyType ? dest[property] = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3.FromArray */ .Wo.FromArray(sourceProperty) : 3 === propertyType ? dest[property] = SerializationHelper._FresnelParametersParser(sourceProperty) : 4 === propertyType ? dest[property] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2.FromArray */ .FM.FromArray(sourceProperty) : 5 === propertyType ? dest[property] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.FromArray */ .P.FromArray(sourceProperty) : 6 === propertyType ? scene && (dest[property] = scene.getLastMeshById(sourceProperty)) : 7 === propertyType ? dest[property] = SerializationHelper._ColorCurvesParser(sourceProperty) : 8 === propertyType ? dest[property] = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color4.FromArray */ .HE.FromArray(sourceProperty) : 9 === propertyType ? dest[property] = SerializationHelper._ImageProcessingConfigurationParser(sourceProperty) : 10 === propertyType ? dest[property] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion.FromArray */ ._f.FromArray(sourceProperty) : 11 === propertyType ? scene && (dest[property] = scene.getCameraById(sourceProperty)) : 12 === propertyType ? dest[property] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.FromArray */ .y3.FromArray(sourceProperty) : void 0;}}return destination;}static Clone(creationFunction, source) {return _copySource(creationFunction, source, !1);}static Instanciate(creationFunction, source) {return _copySource(creationFunction, source, !0);}}SerializationHelper.AllowLoadingUniqueId = !1, SerializationHelper._ImageProcessingConfigurationParser = () => {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_2__/* ._WarnImport */ .S)("ImageProcessingConfiguration");}, SerializationHelper._FresnelParametersParser = () => {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_2__/* ._WarnImport */ .S)("FresnelParameters");}, SerializationHelper._ColorCurvesParser = () => {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_2__/* ._WarnImport */ .S)("ColorCurves");}, SerializationHelper._TextureParser = () => {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_2__/* ._WarnImport */ .S)("Texture");};function nativeOverride(target, propertyKey, descriptor, predicate) {const jsFunc = descriptor.value;descriptor.value = (...params) => {let func = jsFunc;if ("undefined" != typeof _native && _native[propertyKey]) {const nativeFunc = _native[propertyKey];func = predicate ? (...params) => predicate(...params) ? nativeFunc(...params) : jsFunc(...params) : nativeFunc;}return target[propertyKey] = func, func(...params);};}nativeOverride.filter = function (predicate) {return (target, propertyKey, descriptor) => nativeOverride(target, propertyKey, descriptor, predicate);};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/deepCopier.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "j": () => (/* binding */ DeepCopier)
/* harmony export */ });
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
const CloneValue = (source, destinationObject) => {if (!source) return null;return source.getClassName && "Mesh" === source.getClassName() ? null : source.getClassName && "SubMesh" === source.getClassName() ? source.clone(destinationObject) : source.clone ? source.clone() : null;};function GetAllPropertyNames(obj) {const props = [];do Object.getOwnPropertyNames(obj).forEach(function (prop) {-1 === props.indexOf(prop) && props.push(prop);}); while (obj = Object.getPrototypeOf(obj));return props;}class DeepCopier {static DeepCopy(source, destination, doNotCopyList, mustCopyList) {const properties = GetAllPropertyNames(source);for (const prop of properties) {if ("_" === prop[0] && (!mustCopyList || -1 === mustCopyList.indexOf(prop))) continue;if (prop.endsWith("Observable")) continue;if (doNotCopyList && -1 !== doNotCopyList.indexOf(prop)) continue;const sourceValue = source[prop],typeOfSourceValue = typeof sourceValue;if ("function" !== typeOfSourceValue) try {if ("object" !== typeOfSourceValue) destination[prop] = sourceValue;else if (!(sourceValue instanceof Array)) destination[prop] = CloneValue(sourceValue, destination);else if (destination[prop] = [], 0 < sourceValue.length) if ("object" == typeof sourceValue[0]) for (let index = 0; index < sourceValue.length; index++) {const clonedValue = CloneValue(sourceValue[index], destination);-1 === destination[prop].indexOf(clonedValue) && destination[prop].push(clonedValue);} else destination[prop] = sourceValue.slice(0);} catch (e) {_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger.Warn */ .Y.Warn(e.message);}}}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/deferred.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "B": () => (/* binding */ Deferred)
/* harmony export */ });
class Deferred {get resolve() {return this._resolve;}get reject() {return this._reject;}constructor() {this.promise = new Promise((resolve, reject) => {this._resolve = resolve, this._reject = reject;});}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/devTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "S": () => (/* binding */ _WarnImport)
/* harmony export */ });
function _WarnImport(name) {return `${name} needs to be imported before as it contains a side-effect required by your code.`;}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/domManagement.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "CG": () => (/* binding */ IsWindowObjectExist),
/* harmony export */   "MZ": () => (/* binding */ DomManagement),
/* harmony export */   "n5": () => (/* binding */ IsDocumentAvailable),
/* harmony export */   "up": () => (/* binding */ IsNavigatorAvailable),
/* harmony export */   "v": () => (/* binding */ GetDOMTextContent)
/* harmony export */ });
function IsWindowObjectExist() {return "undefined" != typeof window;}function IsNavigatorAvailable() {return "undefined" != typeof navigator;}function IsDocumentAvailable() {return "undefined" != typeof document;}function GetDOMTextContent(element) {let result = "",child = element.firstChild;for (; child;) 3 === child.nodeType && (result += child.textContent), child = child.nextSibling;return result;}const DomManagement = { IsWindowObjectExist, IsNavigatorAvailable, IsDocumentAvailable, GetDOMTextContent };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/dumpTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "B": () => (/* binding */ DumpTools)
/* harmony export */ });
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
/* harmony import */ var _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/effectRenderer.js");
/* harmony import */ var _tools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
/* harmony import */ var _Shaders_pass_fragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Shaders/pass.fragment.js");
class DumpTools {static _CreateDumpRenderer() {if (!DumpTools._DumpToolsEngine) {const canvas = document.createElement("canvas"),engine = new _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .ThinEngine */ .B(canvas, !1, { preserveDrawingBuffer: !0, depth: !1, stencil: !1, alpha: !0, premultipliedAlpha: !1, antialias: !1, failIfMajorPerformanceCaveat: !1 });engine.getCaps().parallelShaderCompile = void 0;const renderer = new _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_1__/* .EffectRenderer */ .I(engine),wrapper = new _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_1__/* .EffectWrapper */ .H({ engine, name: _Shaders_pass_fragment_js__WEBPACK_IMPORTED_MODULE_3__/* .passPixelShader.name */ .T.name, fragmentShader: _Shaders_pass_fragment_js__WEBPACK_IMPORTED_MODULE_3__/* .passPixelShader.shader */ .T.shader, samplerNames: ["textureSampler"] });DumpTools._DumpToolsEngine = { canvas, engine, renderer, wrapper };}return DumpTools._DumpToolsEngine;}static async DumpFramebuffer(width, height, engine, successCallback, mimeType = "image/png", fileName) {const bufferView = await engine.readPixels(0, 0, width, height),data = new Uint8Array(bufferView.buffer);DumpTools.DumpData(width, height, data, successCallback, mimeType, fileName, !0);}static DumpDataAsync(width, height, data, mimeType = "image/png", fileName, invertY = !1, toArrayBuffer = !1, quality) {return new Promise((resolve) => {DumpTools.DumpData(width, height, data, (result) => resolve(result), mimeType, fileName, invertY, toArrayBuffer, quality);});}static DumpData(width, height, data, successCallback, mimeType = "image/png", fileName, invertY = !1, toArrayBuffer = !1, quality) {const renderer = DumpTools._CreateDumpRenderer();if (renderer.engine.setSize(width, height, !0), data instanceof Float32Array) {const data2 = new Uint8Array(data.length);for (let n = data.length; n--;) {const v = data[n];data2[n] = 0 > v ? 0 : 1 < v ? 1 : Math.round(255 * v);}data = data2;}const texture = renderer.engine.createRawTexture(data, width, height, 5, !1, !invertY, 1);renderer.renderer.setViewport(), renderer.renderer.applyEffectWrapper(renderer.wrapper), renderer.wrapper.effect._bindTexture("textureSampler", texture), renderer.renderer.draw(), toArrayBuffer ? _tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.ToBlob */ .w1.ToBlob(renderer.canvas, (blob) => {const fileReader = new FileReader();fileReader.onload = (event) => {const arrayBuffer = event.target.result;successCallback && successCallback(arrayBuffer);}, fileReader.readAsArrayBuffer(blob);}, mimeType, quality) : _tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.EncodeScreenshotCanvasData */ .w1.EncodeScreenshotCanvasData(renderer.canvas, successCallback, mimeType, fileName, quality), texture.dispose();}static Dispose() {DumpTools._DumpToolsEngine && (DumpTools._DumpToolsEngine.wrapper.dispose(), DumpTools._DumpToolsEngine.renderer.dispose(), DumpTools._DumpToolsEngine.engine.dispose()), DumpTools._DumpToolsEngine = null;}}const initSideEffects = () => {_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.DumpData */ .w1.DumpData = DumpTools.DumpData, _tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.DumpDataAsync */ .w1.DumpDataAsync = DumpTools.DumpDataAsync, _tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools.DumpFramebuffer */ .w1.DumpFramebuffer = DumpTools.DumpFramebuffer;};initSideEffects();

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/environmentTextureTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "p6": () => (/* binding */ CreateEnvTextureAsync),
  "Do": () => (/* binding */ CreateImageDataArrayBufferViews),
  "qh": () => (/* binding */ EnvironmentTextureTools),
  "qJ": () => (/* binding */ GetEnvInfo),
  "Ro": () => (/* binding */ UploadEnvLevelsAsync),
  "qC": () => (/* binding */ UploadEnvSpherical),
  "qZ": () => (/* binding */ UploadLevelsAsync),
  "Lf": () => (/* binding */ _UpdateRGBDAsync),
  "QH": () => (/* binding */ normalizeEnvInfo)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.scalar.js
var math_scalar = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/sphericalPolynomial.js
var sphericalPolynomial = __webpack_require__("./node_modules/@babylonjs/core/Maths/sphericalPolynomial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js
var Textures_internalTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js
var baseTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/scene.js + 1 modules
var scene = __webpack_require__("./node_modules/@babylonjs/core/scene.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/postProcess.js
var postProcess = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/postProcess.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/rgbdTextureTools.js
var rgbdTextureTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/rgbdTextureTools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetCube.js
var engine_renderTargetCube = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetCube.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.readTexture.js
var engine_readTexture = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.readTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.js
var baseTexture_polynomial = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/rgbdEncode.fragment.js
const rgbdEncode_fragment_name = "rgbdEncodePixelShader",shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
gl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);
}`;shaderStore/* ShaderStore.ShadersStore.rgbdEncodePixelShader */.v.ShadersStore.rgbdEncodePixelShader = shader;const rgbdEncodePixelShader = { name: "rgbdEncodePixelShader", shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/rgbdDecode.fragment.js
var rgbdDecode_fragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/rgbdDecode.fragment.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/dumpTools.js
var dumpTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/dumpTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/environmentTextureTools.js
const DefaultEnvironmentTextureImageType = "image/png",CurrentVersion = 2,MagicBytes = [134, 22, 135, 150, 246, 214, 150, 54];function GetEnvInfo(data) {const dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);let pos = 0;for (let i = 0; i < MagicBytes.length; i++) if (dataView.getUint8(pos++) !== MagicBytes[i]) return logger/* Logger.Error */.Y.Error("Not a babylon environment map"), null;let manifestString = "",charCode = 0;for (; charCode = dataView.getUint8(pos++);) manifestString += String.fromCharCode(charCode);let manifest = JSON.parse(manifestString);return manifest = normalizeEnvInfo(manifest), manifest.specular && (manifest.specular.specularDataPosition = pos, manifest.specular.lodGenerationScale = manifest.specular.lodGenerationScale || .8), manifest;}function normalizeEnvInfo(info) {if (info.version > CurrentVersion) throw new Error(`Unsupported babylon environment map version "${info.version}". Latest supported version is "${CurrentVersion}".`);return 2 === info.version ? info : (info = { ...info, version: 2, imageType: DefaultEnvironmentTextureImageType }, info);}async function CreateEnvTextureAsync(texture, options = {}) {var _a;const internalTexture = texture.getInternalTexture();if (!internalTexture) return Promise.reject("The cube texture is invalid.");const imageType = null !== (_a = options.imageType) && void 0 !== _a ? _a : DefaultEnvironmentTextureImageType,engine = internalTexture.getEngine();if (2 !== texture.textureType && 1 !== texture.textureType && 0 !== texture.textureType && 0 !== texture.textureType && 7 !== texture.textureType && -1 !== texture.textureType) return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");let textureType = 1;if (!engine.getCaps().textureFloatRender && (textureType = 2, !engine.getCaps().textureHalfFloatRender)) return Promise.reject("Env texture can only be created when the browser supports half float or full float rendering.");const cubeWidth = internalTexture.width,hostingScene = new scene/* Scene */.x(engine),specularTextures = {};engine.flushFramebuffer();const mipmapsCount = math_scalar/* Scalar.ILog2 */.R.ILog2(internalTexture.width);for (let i = 0; i <= mipmapsCount; i++) {const faceWidth = Math.pow(2, mipmapsCount - i);for (let faceData, face = 0; 6 > face; face++) {if (faceData = await texture.readPixels(face, i, void 0, !1), faceData && faceData.byteLength === faceData.length) {const faceDataFloat = new Float32Array(4 * faceData.byteLength);for (let i = 0; i < faceData.byteLength; i++) faceDataFloat[i] = faceData[i] / 255, faceDataFloat[i] = Math.pow(faceDataFloat[i], 2.2);faceData = faceDataFloat;}const tempTexture = engine.createRawTexture(faceData, faceWidth, faceWidth, 5, !1, !0, 1, null, textureType);await rgbdTextureTools/* RGBDTextureTools.EncodeTextureToRGBD */.r.EncodeTextureToRGBD(tempTexture, hostingScene, textureType);const rgbdEncodedData = await engine._readTexturePixels(tempTexture, faceWidth, faceWidth),imageEncodedData = await dumpTools/* DumpTools.DumpDataAsync */.B.DumpDataAsync(faceWidth, faceWidth, rgbdEncodedData, imageType, void 0, !1, !0, options.imageQuality);specularTextures[6 * i + face] = imageEncodedData, tempTexture.dispose();}}hostingScene.dispose();const info = { version: CurrentVersion, width: cubeWidth, imageType, irradiance: _CreateEnvTextureIrradiance(texture), specular: { mipmaps: [], lodGenerationScale: texture.lodGenerationScale } };let position = 0;for (let i = 0; i <= mipmapsCount; i++) for (let face = 0; 6 > face; face++) {const byteLength = specularTextures[6 * i + face].byteLength;info.specular.mipmaps.push({ length: byteLength, position: position }), position += byteLength;}const infoString = JSON.stringify(info),infoBuffer = new ArrayBuffer(infoString.length + 1),infoView = new Uint8Array(infoBuffer);for (let i = 0, strLen = infoString.length; i < strLen; i++) infoView[i] = infoString.charCodeAt(i);infoView[infoString.length] = 0;const totalSize = MagicBytes.length + position + infoBuffer.byteLength,finalBuffer = new ArrayBuffer(totalSize),finalBufferView = new Uint8Array(finalBuffer),dataView = new DataView(finalBuffer);let pos = 0;for (let i = 0; i < MagicBytes.length; i++) dataView.setUint8(pos++, MagicBytes[i]);finalBufferView.set(new Uint8Array(infoBuffer), pos), pos += infoBuffer.byteLength;for (let i = 0; i <= mipmapsCount; i++) for (let face = 0; 6 > face; face++) {const dataBuffer = specularTextures[6 * i + face];finalBufferView.set(new Uint8Array(dataBuffer), pos), pos += dataBuffer.byteLength;}return finalBuffer;}function _CreateEnvTextureIrradiance(texture) {const polynmials = texture.sphericalPolynomial;return null == polynmials ? null : { x: [polynmials.x.x, polynmials.x.y, polynmials.x.z], y: [polynmials.y.x, polynmials.y.y, polynmials.y.z], z: [polynmials.z.x, polynmials.z.y, polynmials.z.z], xx: [polynmials.xx.x, polynmials.xx.y, polynmials.xx.z], yy: [polynmials.yy.x, polynmials.yy.y, polynmials.yy.z], zz: [polynmials.zz.x, polynmials.zz.y, polynmials.zz.z], yz: [polynmials.yz.x, polynmials.yz.y, polynmials.yz.z], zx: [polynmials.zx.x, polynmials.zx.y, polynmials.zx.z], xy: [polynmials.xy.x, polynmials.xy.y, polynmials.xy.z] };}function CreateImageDataArrayBufferViews(data, info) {info = normalizeEnvInfo(info);const specularInfo = info.specular;let mipmapsCount = math_scalar/* Scalar.Log2 */.R.Log2(info.width);if (mipmapsCount = Math.round(mipmapsCount) + 1, specularInfo.mipmaps.length !== 6 * mipmapsCount) throw new Error(`Unsupported specular mipmaps number "${specularInfo.mipmaps.length}"`);const imageData = Array(mipmapsCount);for (let i = 0; i < mipmapsCount; i++) {imageData[i] = [,,,,,,];for (let face = 0; 6 > face; face++) {const imageInfo = specularInfo.mipmaps[6 * i + face];imageData[i][face] = new Uint8Array(data.buffer, data.byteOffset + specularInfo.specularDataPosition + imageInfo.position, imageInfo.length);}}return imageData;}function UploadEnvLevelsAsync(texture, data, info) {info = normalizeEnvInfo(info);const specularInfo = info.specular;if (!specularInfo) return Promise.resolve();texture._lodGenerationScale = specularInfo.lodGenerationScale;const imageData = CreateImageDataArrayBufferViews(data, info);return UploadLevelsAsync(texture, imageData, info.imageType);}function _OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture) {return new Promise((resolve, reject) => {if (expandTexture) {const tempTexture = engine.createTexture(null, !0, !0, null, 1, null, (message) => {reject(message);}, image);rgbdPostProcess.getEffect().executeWhenCompiled(() => {rgbdPostProcess.externalTextureSamplerBinding = !0, rgbdPostProcess.onApply = (effect) => {effect._bindTexture("textureSampler", tempTexture), effect.setFloat2("scale", 1, engine._features.needsInvertingBitmap && image instanceof ImageBitmap ? -1 : 1);}, engine.scenes.length && (engine.scenes[0].postProcessManager.directRender([rgbdPostProcess], cubeRtt, !0, face, i), engine.restoreDefaultFramebuffer(), tempTexture.dispose(), URL.revokeObjectURL(url), resolve());});} else {if (engine._uploadImageToTexture(texture, image, face, i), generateNonLODTextures) {const lodTexture = lodTextures[i];lodTexture && engine._uploadImageToTexture(lodTexture._texture, image, face, 0);}resolve();}});}function UploadLevelsAsync(texture, imageData, imageType = DefaultEnvironmentTextureImageType) {if (!tools/* Tools.IsExponentOfTwo */.w1.IsExponentOfTwo(texture.width)) throw new Error("Texture size must be a power of two");const mipmapsCount = math_scalar/* Scalar.ILog2 */.R.ILog2(texture.width) + 1,engine = texture.getEngine();let expandTexture = !1,generateNonLODTextures = !1,rgbdPostProcess = null,cubeRtt = null,lodTextures = null;const caps = engine.getCaps();if (texture.format = 5, texture.type = 0, texture.generateMipMaps = !0, texture._cachedAnisotropicFilteringLevel = null, engine.updateTextureSamplingMode(3, texture), caps.textureLOD ? engine._features.supportRenderAndCopyToLodForFloatTextures ? caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering ? (expandTexture = !0, texture.type = 2) : caps.textureFloatRender && caps.textureFloatLinearFiltering && (expandTexture = !0, texture.type = 1) : expandTexture = !1 : (expandTexture = !1, generateNonLODTextures = !0, lodTextures = {}), expandTexture) rgbdPostProcess = new postProcess/* PostProcess */.D("rgbdDecode", "rgbdDecode", null, null, 1, null, 3, engine, !1, void 0, texture.type, void 0, null, !1), texture._isRGBD = !1, texture.invertY = !1, cubeRtt = engine.createRenderTargetCubeTexture(texture.width, { generateDepthBuffer: !1, generateMipMaps: !0, generateStencilBuffer: !1, samplingMode: 3, type: texture.type, format: 5 });else if (texture._isRGBD = !0, texture.invertY = !0, generateNonLODTextures) {const scale = texture._lodGenerationScale,offset = texture._lodGenerationOffset;for (let i = 0; i < 3; i++) {const smoothness = i / 2,minLODIndex = offset,maxLODIndex = (mipmapsCount - 1) * scale + offset,mipmapIndex = Math.round(Math.min(Math.max(minLODIndex + (maxLODIndex - minLODIndex) * (1 - smoothness), 0), maxLODIndex)),glTextureFromLod = new Textures_internalTexture/* InternalTexture */.l(engine, Textures_internalTexture/* InternalTextureSource.Temp */.S.Temp);glTextureFromLod.isCube = !0, glTextureFromLod.invertY = !0, glTextureFromLod.generateMipMaps = !1, engine.updateTextureSamplingMode(2, glTextureFromLod);const lodTexture = new baseTexture/* BaseTexture */.V(null);lodTexture._isCube = !0, lodTexture._texture = glTextureFromLod, lodTextures[mipmapIndex] = lodTexture, 0 == i ? texture._lodTextureLow = lodTexture : 1 === i ? texture._lodTextureMid = lodTexture : 2 === i ? texture._lodTextureHigh = lodTexture : void 0;}}const promises = [];for (let i = 0; i < imageData.length; i++) for (let face = 0; 6 > face; face++) {const bytes = imageData[i][face],blob = new Blob([bytes], { type: imageType }),url = URL.createObjectURL(blob);let promise;if ("undefined" == typeof Image || engine._features.forceBitmapOverHTMLImageElement) promise = engine.createImageBitmap(blob, { premultiplyAlpha: "none" }).then((img) => _OnImageReadyAsync(img, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture));else {const image = new Image();image.src = url, promise = new Promise((resolve, reject) => {image.onload = () => {_OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture).then(() => resolve()).catch((reason) => {reject(reason);});}, image.onerror = (error) => {reject(error);};});}promises.push(promise);}if (imageData.length < mipmapsCount) {let data;const size = Math.pow(2, mipmapsCount - 1 - imageData.length),dataLength = 4 * (size * size);switch (texture.type) {case 0:{data = new Uint8Array(dataLength);break;}case 2:{data = new Uint16Array(dataLength);break;}case 1:{data = new Float32Array(dataLength);break;}}for (let i = imageData.length; i < mipmapsCount; i++) for (let face = 0; 6 > face; face++) engine._uploadArrayBufferViewToTexture(texture, data, face, i);}return Promise.all(promises).then(() => {cubeRtt && (engine._releaseTexture(texture), cubeRtt._swapAndDie(texture)), rgbdPostProcess && rgbdPostProcess.dispose(), generateNonLODTextures && (texture._lodTextureHigh && texture._lodTextureHigh._texture && (texture._lodTextureHigh._texture.isReady = !0), texture._lodTextureMid && texture._lodTextureMid._texture && (texture._lodTextureMid._texture.isReady = !0), texture._lodTextureLow && texture._lodTextureLow._texture && (texture._lodTextureLow._texture.isReady = !0));});}function UploadEnvSpherical(texture, info) {info = normalizeEnvInfo(info);const irradianceInfo = info.irradiance;if (irradianceInfo) {const sp = new sphericalPolynomial/* SphericalPolynomial */.i();math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(irradianceInfo.x, 0, sp.x), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(irradianceInfo.y, 0, sp.y), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(irradianceInfo.z, 0, sp.z), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(irradianceInfo.xx, 0, sp.xx), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(irradianceInfo.yy, 0, sp.yy), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(irradianceInfo.zz, 0, sp.zz), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(irradianceInfo.yz, 0, sp.yz), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(irradianceInfo.zx, 0, sp.zx), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(irradianceInfo.xy, 0, sp.xy), texture._sphericalPolynomial = sp;}}function _UpdateRGBDAsync(internalTexture, data, sphericalPolynomial, lodScale, lodOffset) {const proxy = internalTexture.getEngine().createRawCubeTexture(null, internalTexture.width, internalTexture.format, internalTexture.type, internalTexture.generateMipMaps, internalTexture.invertY, internalTexture.samplingMode, internalTexture._compression),proxyPromise = UploadLevelsAsync(proxy, data).then(() => internalTexture);return internalTexture.onRebuildCallback = () => ({ proxy: proxyPromise, isReady: !0, isAsync: !0 }), internalTexture._source = Textures_internalTexture/* InternalTextureSource.CubeRawRGBD */.S.CubeRawRGBD, internalTexture._bufferViewArrayArray = data, internalTexture._lodGenerationScale = lodScale, internalTexture._lodGenerationOffset = lodOffset, internalTexture._sphericalPolynomial = sphericalPolynomial, UploadLevelsAsync(internalTexture, data).then(() => (internalTexture.isReady = !0, internalTexture));}const EnvironmentTextureTools = { GetEnvInfo, CreateEnvTextureAsync, CreateImageDataArrayBufferViews, UploadEnvLevelsAsync, UploadLevelsAsync, UploadEnvSpherical };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/error.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "GU": () => (/* binding */ BaseError),
/* harmony export */   "LH": () => (/* binding */ RuntimeError),
/* harmony export */   "SM": () => (/* binding */ ErrorCodes)
/* harmony export */ });
class BaseError extends Error {}BaseError._setPrototypeOf = Object.setPrototypeOf || ((o, proto) => (o.__proto__ = proto, o));const ErrorCodes = { MeshInvalidPositionsError: 0, UnsupportedTextureError: 1e3, GLTFLoaderUnexpectedMagicError: 2e3, SceneLoaderError: 3e3, LoadFileError: 4e3, RequestFileError: 4001, ReadFileError: 4002 };class RuntimeError extends BaseError {constructor(message, errorCode, innerError) {super(message), this.errorCode = errorCode, this.innerError = innerError, this.name = "RuntimeError", BaseError._setPrototypeOf(this, RuntimeError.prototype);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/fileTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$K": () => (/* binding */ DecodeBase64UrlToBinary),
/* harmony export */   "$M": () => (/* binding */ SetCorsBehavior),
/* harmony export */   "A2": () => (/* binding */ DecodeBase64UrlToString),
/* harmony export */   "FV": () => (/* binding */ RequestFile),
/* harmony export */   "Ip": () => (/* binding */ ReadFile),
/* harmony export */   "RC": () => (/* binding */ ReadFileError),
/* harmony export */   "Uh": () => (/* binding */ IsFileURL),
/* harmony export */   "VL": () => (/* binding */ IsBase64DataUrl),
/* harmony export */   "W5": () => (/* binding */ _injectLTSFileTools),
/* harmony export */   "e0": () => (/* binding */ FileTools),
/* harmony export */   "eh": () => (/* binding */ LoadFileError),
/* harmony export */   "kK": () => (/* binding */ RequestFileError),
/* harmony export */   "qC": () => (/* binding */ TestBase64DataUrl),
/* harmony export */   "r6": () => (/* binding */ LoadImage),
/* harmony export */   "rN": () => (/* binding */ FileToolsOptions),
/* harmony export */   "vP": () => (/* binding */ LoadFile)
/* harmony export */ });
/* harmony import */ var _webRequest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/webRequest.js");
/* harmony import */ var _domManagement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
/* harmony import */ var _observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/filesInputStore.js");
/* harmony import */ var _retryStrategy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/retryStrategy.js");
/* harmony import */ var _error_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/error.js");
/* harmony import */ var _stringTools_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/stringTools.js");
/* harmony import */ var _Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js");
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _timingTools_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/timingTools.js");
const Base64DataUrlRegEx = new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i);class LoadFileError extends _error_js__WEBPACK_IMPORTED_MODULE_5__/* .RuntimeError */ .LH {constructor(message, object) {super(message, _error_js__WEBPACK_IMPORTED_MODULE_5__/* .ErrorCodes.LoadFileError */ .SM.LoadFileError), this.name = "LoadFileError", _error_js__WEBPACK_IMPORTED_MODULE_5__/* .BaseError._setPrototypeOf */ .GU._setPrototypeOf(this, LoadFileError.prototype), object instanceof _webRequest_js__WEBPACK_IMPORTED_MODULE_0__/* .WebRequest */ .g ? this.request = object : this.file = object;}}class RequestFileError extends _error_js__WEBPACK_IMPORTED_MODULE_5__/* .RuntimeError */ .LH {constructor(message, request) {super(message, _error_js__WEBPACK_IMPORTED_MODULE_5__/* .ErrorCodes.RequestFileError */ .SM.RequestFileError), this.request = request, this.name = "RequestFileError", _error_js__WEBPACK_IMPORTED_MODULE_5__/* .BaseError._setPrototypeOf */ .GU._setPrototypeOf(this, RequestFileError.prototype);}}class ReadFileError extends _error_js__WEBPACK_IMPORTED_MODULE_5__/* .RuntimeError */ .LH {constructor(message, file) {super(message, _error_js__WEBPACK_IMPORTED_MODULE_5__/* .ErrorCodes.ReadFileError */ .SM.ReadFileError), this.file = file, this.name = "ReadFileError", _error_js__WEBPACK_IMPORTED_MODULE_5__/* .BaseError._setPrototypeOf */ .GU._setPrototypeOf(this, ReadFileError.prototype);}}const FileToolsOptions = { DefaultRetryStrategy: _retryStrategy_js__WEBPACK_IMPORTED_MODULE_4__/* .RetryStrategy.ExponentialBackoff */ .b.ExponentialBackoff(), BaseUrl: "", CorsBehavior: "anonymous", PreprocessUrl: (url) => url };const _CleanUrl = (url) => (url = url.replace(/#/gm, "%23"), url);const SetCorsBehavior = (url, element) => {if (!(url && 0 === url.indexOf("data:")) && FileToolsOptions.CorsBehavior) if ("string" == typeof FileToolsOptions.CorsBehavior || FileToolsOptions.CorsBehavior instanceof String) element.crossOrigin = FileToolsOptions.CorsBehavior;else {const result = FileToolsOptions.CorsBehavior(url);result && (element.crossOrigin = result);}};const LoadImage = (input, onLoad, onError, offlineProvider, mimeType = "", imageBitmapOptions) => {var _a;let url,usingObjectURL = !1;input instanceof ArrayBuffer || ArrayBuffer.isView(input) ? "undefined" != typeof Blob && "undefined" != typeof URL ? (url = URL.createObjectURL(new Blob([input], { type: mimeType })), usingObjectURL = !0) : url = `data:${mimeType};base64,` + (0,_stringTools_js__WEBPACK_IMPORTED_MODULE_6__/* .EncodeArrayBufferToBase64 */ .Gh)(input) : input instanceof Blob ? (url = URL.createObjectURL(input), usingObjectURL = !0) : (url = _CleanUrl(input), url = FileToolsOptions.PreprocessUrl(input));const engine = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_9__/* .EngineStore.LastCreatedEngine */ .l.LastCreatedEngine,onErrorHandler = (exception) => {if (onError) {const inputText = url || input.toString();onError(`Error while trying to load image: ${0 === inputText.indexOf("http") || 128 >= inputText.length ? inputText : inputText.slice(0, 128) + "..."}`, exception);}};if ("undefined" == typeof Image || null !== (_a = null === engine || void 0 === engine ? void 0 : engine._features.forceBitmapOverHTMLImageElement) && void 0 !== _a && _a) return LoadFile(url, (data) => {engine.createImageBitmap(new Blob([data], { type: mimeType }), { premultiplyAlpha: "none", ...imageBitmapOptions }).then((imgBmp) => {onLoad(imgBmp), usingObjectURL && URL.revokeObjectURL(url);}).catch((reason) => {onError && onError("Error while trying to load image: " + input, reason);});}, void 0, offlineProvider || void 0, !0, (request, exception) => {onErrorHandler(exception);}), null;const img = new Image();SetCorsBehavior(url, img);const handlersList = [],unloadHandlersList = () => {handlersList.forEach((handler) => {handler.target.removeEventListener(handler.name, handler.handler);}), handlersList.length = 0;};handlersList.push({ target: img, name: "load", handler: () => {unloadHandlersList(), onLoad(img), usingObjectURL && img.src && URL.revokeObjectURL(img.src);} }), handlersList.push({ target: img, name: "error", handler: (err) => {unloadHandlersList(), onErrorHandler(err), usingObjectURL && img.src && URL.revokeObjectURL(img.src);} }), handlersList.push({ target: document, name: "securitypolicyviolation", handler: (err) => {unloadHandlersList();const cspException = new Error(`CSP violation of policy ${err.effectiveDirective} ${err.blockedURI}. Current policy is ${err.originalPolicy}`);_Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_9__/* .EngineStore.UseFallbackTexture */ .l.UseFallbackTexture = !1, onErrorHandler(cspException), usingObjectURL && img.src && URL.revokeObjectURL(img.src), img.src = "";} }), (() => {handlersList.forEach((handler) => {handler.target.addEventListener(handler.name, handler.handler);});})();const fromBlob = "blob:" === url.substring(0, 5),fromData = "data:" === url.substring(0, 5),noOfflineSupport = () => {fromBlob || fromData ? img.src = url : LoadFile(url, (data, _, contentType) => {const type = !mimeType && contentType ? contentType : mimeType,blob = new Blob([data], { type }),url = URL.createObjectURL(blob);usingObjectURL = !0, img.src = url;}, void 0, offlineProvider || void 0, !0, (request, exception) => {onErrorHandler(exception);});};if (!fromBlob && !fromData && offlineProvider && offlineProvider.enableTexturesOffline) offlineProvider.open(() => {offlineProvider && offlineProvider.loadImage(url, img);}, noOfflineSupport);else {if (-1 !== url.indexOf("file:")) {const textureName = decodeURIComponent(url.substring(5).toLowerCase());if (_filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__/* .FilesInputStore.FilesToLoad */ .X.FilesToLoad[textureName] && "undefined" != typeof URL) {try {let blobURL;try {blobURL = URL.createObjectURL(_filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__/* .FilesInputStore.FilesToLoad */ .X.FilesToLoad[textureName]);} catch (ex) {blobURL = URL.createObjectURL(_filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__/* .FilesInputStore.FilesToLoad */ .X.FilesToLoad[textureName]);}img.src = blobURL, usingObjectURL = !0;} catch (e) {img.src = "";}return img;}}noOfflineSupport();}return img;};const ReadFile = (file, onSuccess, onProgress, useArrayBuffer, onError) => {const reader = new FileReader(),fileRequest = { onCompleteObservable: new _observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), abort: () => reader.abort() };return reader.onloadend = () => fileRequest.onCompleteObservable.notifyObservers(fileRequest), onError && (reader.onerror = () => {onError(new ReadFileError(`Unable to read ${file.name}`, file));}), reader.onload = (e) => {onSuccess(e.target.result);}, onProgress && (reader.onprogress = onProgress), useArrayBuffer ? reader.readAsArrayBuffer(file) : reader.readAsText(file), fileRequest;};const LoadFile = (fileOrUrl, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, onOpened) => {if (fileOrUrl.name) return ReadFile(fileOrUrl, onSuccess, onProgress, useArrayBuffer, onError ? (error) => {onError(void 0, error);} : void 0);const url = fileOrUrl;if (-1 !== url.indexOf("file:")) {let fileName = decodeURIComponent(url.substring(5).toLowerCase());0 === fileName.indexOf("./") && (fileName = fileName.substring(2));const file = _filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__/* .FilesInputStore.FilesToLoad */ .X.FilesToLoad[fileName];if (file) return ReadFile(file, onSuccess, onProgress, useArrayBuffer, onError ? (error) => onError(void 0, new LoadFileError(error.message, error.file)) : void 0);}const { match, type } = TestBase64DataUrl(url);if (match) {const fileRequest = { onCompleteObservable: new _observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), abort: () => () => {} };try {const data = useArrayBuffer ? DecodeBase64UrlToBinary(url) : DecodeBase64UrlToString(url);onSuccess(data, void 0, type);} catch (error) {onError ? onError(void 0, error) : _logger_js__WEBPACK_IMPORTED_MODULE_10__/* .Logger.Error */ .Y.Error(error.message || "Failed to parse the Data URL");}return _timingTools_js__WEBPACK_IMPORTED_MODULE_11__/* .TimingTools.SetImmediate */ .Q.SetImmediate(() => {fileRequest.onCompleteObservable.notifyObservers(fileRequest);}), fileRequest;}return RequestFile(url, (data, request) => {onSuccess(data, null === request || void 0 === request ? void 0 : request.responseURL, null === request || void 0 === request ? void 0 : request.getResponseHeader("content-type"));}, onProgress, offlineProvider, useArrayBuffer, onError ? (error) => {onError(error.request, new LoadFileError(error.message, error.request));} : void 0, onOpened);};const RequestFile = (url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, onOpened) => {url = _CleanUrl(url), url = FileToolsOptions.PreprocessUrl(url);const loadUrl = FileToolsOptions.BaseUrl + url;let aborted = !1;const fileRequest = { onCompleteObservable: new _observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), abort: () => aborted = !0 },requestFile = () => {let onReadyStateChange,request = new _webRequest_js__WEBPACK_IMPORTED_MODULE_0__/* .WebRequest */ .g(),retryHandle = null;const unbindEvents = () => {request && (onProgress && request.removeEventListener("progress", onProgress), onReadyStateChange && request.removeEventListener("readystatechange", onReadyStateChange), request.removeEventListener("loadend", onLoadEnd));};let onLoadEnd = () => {unbindEvents(), fileRequest.onCompleteObservable.notifyObservers(fileRequest), fileRequest.onCompleteObservable.clear(), onProgress = void 0, onReadyStateChange = null, onLoadEnd = null, onError = void 0, onOpened = void 0, onSuccess = void 0;};fileRequest.abort = () => {aborted = !0, onLoadEnd && onLoadEnd(), request && request.readyState !== (XMLHttpRequest.DONE || 4) && request.abort(), null !== retryHandle && (clearTimeout(retryHandle), retryHandle = null), request = null;};const handleError = (error) => {const message = error.message || "Unknown error";onError && request ? onError(new RequestFileError(message, request)) : _logger_js__WEBPACK_IMPORTED_MODULE_10__/* .Logger.Error */ .Y.Error(message);},retryLoop = (retryIndex) => {if (request) {if (request.open("GET", loadUrl), onOpened) try {onOpened(request);} catch (e) {return void handleError(e);}useArrayBuffer && (request.responseType = "arraybuffer"), onProgress && request.addEventListener("progress", onProgress), onLoadEnd && request.addEventListener("loadend", onLoadEnd), onReadyStateChange = () => {if (!aborted && request && request.readyState === (XMLHttpRequest.DONE || 4)) {if (onReadyStateChange && request.removeEventListener("readystatechange", onReadyStateChange), 200 <= request.status && 300 > request.status || 0 === request.status && (!(0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .CG)() || IsFileURL())) {try {onSuccess && onSuccess(useArrayBuffer ? request.response : request.responseText, request);} catch (e) {handleError(e);}return;}const retryStrategy = FileToolsOptions.DefaultRetryStrategy;if (retryStrategy) {const waitTime = retryStrategy(loadUrl, request, retryIndex);if (-1 !== waitTime) return unbindEvents(), request = new _webRequest_js__WEBPACK_IMPORTED_MODULE_0__/* .WebRequest */ .g(), void (retryHandle = setTimeout(() => retryLoop(retryIndex + 1), waitTime));}const error = new RequestFileError("Error status: " + request.status + " " + request.statusText + " - Unable to load " + loadUrl, request);onError && onError(error);}}, request.addEventListener("readystatechange", onReadyStateChange), request.send();}};retryLoop(0);};if (offlineProvider && offlineProvider.enableSceneOffline) {const noOfflineSupport = (request) => {request && 400 < request.status ? onError && onError(request) : requestFile();},loadFromOfflineSupport = () => {offlineProvider && offlineProvider.loadFile(FileToolsOptions.BaseUrl + url, (data) => {!aborted && onSuccess && onSuccess(data), fileRequest.onCompleteObservable.notifyObservers(fileRequest);}, onProgress ? (event) => {!aborted && onProgress && onProgress(event);} : void 0, noOfflineSupport, useArrayBuffer);};offlineProvider.open(loadFromOfflineSupport, noOfflineSupport);} else requestFile();return fileRequest;};const IsFileURL = () => "undefined" != typeof location && "file:" === location.protocol;const IsBase64DataUrl = (uri) => Base64DataUrlRegEx.test(uri);const TestBase64DataUrl = (uri) => {const results = Base64DataUrlRegEx.exec(uri);if (null === results || 0 === results.length) return { match: !1, type: "" };else {const type = results[0].replace("data:", "").replace("base64,", "");return { match: !0, type };}};function DecodeBase64UrlToBinary(uri) {return (0,_stringTools_js__WEBPACK_IMPORTED_MODULE_6__/* .DecodeBase64ToBinary */ .HQ)(uri.split(",")[1]);}const DecodeBase64UrlToString = (uri) => (0,_stringTools_js__WEBPACK_IMPORTED_MODULE_6__/* .DecodeBase64ToString */ .rP)(uri.split(",")[1]);const initSideEffects = () => {_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .ThinEngine._FileToolsLoadImage */ .B._FileToolsLoadImage = LoadImage, _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .ThinEngine._FileToolsLoadFile */ .B._FileToolsLoadFile = LoadFile, _Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_7__/* .ShaderProcessor._FileToolsLoadFile */ .L._FileToolsLoadFile = LoadFile;};initSideEffects();let FileTools;const _injectLTSFileTools = (DecodeBase64UrlToBinary, DecodeBase64UrlToString, FileToolsOptions, IsBase64DataUrl, IsFileURL, LoadFile, LoadImage, ReadFile, RequestFile, SetCorsBehavior) => {FileTools = { DecodeBase64UrlToBinary, DecodeBase64UrlToString, DefaultRetryStrategy: FileToolsOptions.DefaultRetryStrategy, BaseUrl: FileToolsOptions.BaseUrl, CorsBehavior: FileToolsOptions.CorsBehavior, PreprocessUrl: FileToolsOptions.PreprocessUrl, IsBase64DataUrl, IsFileURL, LoadFile, LoadImage, ReadFile, RequestFile, SetCorsBehavior }, Object.defineProperty(FileTools, "DefaultRetryStrategy", { get: function () {return FileToolsOptions.DefaultRetryStrategy;}, set: function (value) {FileToolsOptions.DefaultRetryStrategy = value;} }), Object.defineProperty(FileTools, "BaseUrl", { get: function () {return FileToolsOptions.BaseUrl;}, set: function (value) {FileToolsOptions.BaseUrl = value;} }), Object.defineProperty(FileTools, "PreprocessUrl", { get: function () {return FileToolsOptions.PreprocessUrl;}, set: function (value) {FileToolsOptions.PreprocessUrl = value;} }), Object.defineProperty(FileTools, "CorsBehavior", { get: function () {return FileToolsOptions.CorsBehavior;}, set: function (value) {FileToolsOptions.CorsBehavior = value;} });};_injectLTSFileTools(DecodeBase64UrlToBinary, DecodeBase64UrlToString, FileToolsOptions, IsBase64DataUrl, IsFileURL, LoadFile, LoadImage, ReadFile, RequestFile, SetCorsBehavior);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/filesInputStore.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "X": () => (/* binding */ FilesInputStore)
/* harmony export */ });
class FilesInputStore {}FilesInputStore.FilesToLoad = {};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/guid.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "f": () => (/* binding */ RandomGUID),
/* harmony export */   "x": () => (/* binding */ GUID)
/* harmony export */ });
function RandomGUID() {return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {const r = 0 | 16 * Math.random(),v = "x" === c ? r : 8 | 3 & r;return v.toString(16);});}const GUID = { RandomId: RandomGUID };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/instantiationTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "K": () => (/* binding */ InstantiationTools)
/* harmony export */ });
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _typeStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
class InstantiationTools {static Instantiate(className) {if (this.RegisteredExternalClasses && this.RegisteredExternalClasses[className]) return this.RegisteredExternalClasses[className];const internalClass = (0,_typeStore_js__WEBPACK_IMPORTED_MODULE_1__/* .GetClass */ .q)(className);if (internalClass) return internalClass;_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger.Warn */ .Y.Warn(className + " not found, you may have missed an import.");const arr = className.split(".");let fn = window || this;for (let i = 0, len = arr.length; i < len; i++) fn = fn[arr[i]];return "function" == typeof fn ? fn : null;}}InstantiationTools.RegisteredExternalClasses = {};

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/logger.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Y": () => (/* binding */ Logger)
/* harmony export */ });
class Logger {static _CheckLimit(message, limit) {let entry = Logger._LogLimitOutputs[message];return entry ? entry.current++ : (entry = { limit, current: 1 }, Logger._LogLimitOutputs[message] = entry), entry.current <= entry.limit;}static _GenerateLimitMessage(message, level = 1) {var _a;const entry = Logger._LogLimitOutputs[message];if (entry && Logger.MessageLimitReached) {const type = this._Levels[level];entry.current === entry.limit && Logger[type.name](Logger.MessageLimitReached.replace(/%LIMIT%/g, "" + entry.limit).replace(/%TYPE%/g, null !== (_a = type.name) && void 0 !== _a ? _a : ""));}}static _AddLogEntry(entry) {Logger._LogCache = entry + Logger._LogCache, Logger.OnNewCacheEntry && Logger.OnNewCacheEntry(entry);}static _FormatMessage(message) {const padStr = (i) => 10 > i ? "0" + i : "" + i,date = new Date();return "[" + padStr(date.getHours()) + ":" + padStr(date.getMinutes()) + ":" + padStr(date.getSeconds()) + "]: " + message;}static _LogDisabled() {}static _LogEnabled(level = 1, message, limit) {if (void 0 !== limit && !Logger._CheckLimit(message, limit)) return;const formattedMessage = Logger._FormatMessage(message),type = this._Levels[level];type.logFunc && type.logFunc("BJS - " + formattedMessage);const entry = `<div style='color:${type.color}'>${formattedMessage}</div><br>`;Logger._AddLogEntry(entry), Logger._GenerateLimitMessage(message, level);}static get LogCache() {return Logger._LogCache;}static ClearLogCache() {Logger._LogCache = "", Logger._LogLimitOutputs = {}, Logger.errorsCount = 0;}static set LogLevels(level) {Logger.Log = Logger._LogDisabled, Logger.Warn = Logger._LogDisabled, Logger.Error = Logger._LogDisabled, [Logger.MessageLogLevel, Logger.WarningLogLevel, Logger.ErrorLogLevel].forEach((l) => {if ((level & l) === l) {const type = this._Levels[l];Logger[type.name] = Logger._LogEnabled.bind(Logger, l);}});}}Logger.NoneLogLevel = 0, Logger.MessageLogLevel = 1, Logger.WarningLogLevel = 2, Logger.ErrorLogLevel = 4, Logger.AllLogLevel = 7, Logger.MessageLimitReached = "Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.", Logger._LogCache = "", Logger._LogLimitOutputs = {}, Logger._Levels = [{}, { color: "white", logFunc: console.log, name: "Log" }, { color: "orange", logFunc: console.warn, name: "Warn" }, {}, { color: "red", logFunc: console.error, name: "Error" }], Logger.errorsCount = 0, Logger.Log = Logger._LogEnabled.bind(Logger, Logger.MessageLogLevel), Logger.Warn = Logger._LogEnabled.bind(Logger, Logger.WarningLogLevel), Logger.Error = Logger._LogEnabled.bind(Logger, Logger.ErrorLogLevel);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/observable.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Qj": () => (/* binding */ Observer),
/* harmony export */   "he": () => (/* binding */ EventState),
/* harmony export */   "y$": () => (/* binding */ Observable)
/* harmony export */ });
class EventState {constructor(mask, skipNextObservers = !1, target, currentTarget) {this.initialize(mask, skipNextObservers, target, currentTarget);}initialize(mask, skipNextObservers = !1, target, currentTarget) {return this.mask = mask, this.skipNextObservers = skipNextObservers, this.target = target, this.currentTarget = currentTarget, this;}}class Observer {constructor(callback, mask, scope = null) {this.callback = callback, this.mask = mask, this.scope = scope, this._willBeUnregistered = !1, this.unregisterOnNextCall = !1;}}class Observable {static FromPromise(promise, onErrorObservable) {const observable = new Observable();return promise.then((ret) => {observable.notifyObservers(ret);}).catch((err) => {if (onErrorObservable) onErrorObservable.notifyObservers(err);else throw err;}), observable;}get observers() {return this._observers;}constructor(onObserverAdded) {this._observers = [], this._numObserversMarkedAsDeleted = 0, this._eventState = new EventState(0), onObserverAdded && (this._onObserverAdded = onObserverAdded);}add(callback, mask = -1, insertFirst = !1, scope = null, unregisterOnFirstCall = !1) {if (!callback) return null;const observer = new Observer(callback, mask, scope);return observer.unregisterOnNextCall = unregisterOnFirstCall, insertFirst ? this._observers.unshift(observer) : this._observers.push(observer), this._onObserverAdded && this._onObserverAdded(observer), observer;}addOnce(callback) {return this.add(callback, void 0, void 0, void 0, !0);}remove(observer) {if (!observer) return !1;const index = this._observers.indexOf(observer);return -1 !== index && (this._deferUnregister(observer), !0);}removeCallback(callback, scope) {for (let index = 0; index < this._observers.length; index++) {const observer = this._observers[index];if (!observer._willBeUnregistered && observer.callback === callback && (!scope || scope === observer.scope)) return this._deferUnregister(observer), !0;}return !1;}_deferUnregister(observer) {this._numObserversMarkedAsDeleted++, observer.unregisterOnNextCall = !1, observer._willBeUnregistered = !0, setTimeout(() => {this._remove(observer);}, 0);}_remove(observer, updateCounter = !0) {if (!observer) return !1;const index = this._observers.indexOf(observer);return -1 !== index && (updateCounter && this._numObserversMarkedAsDeleted--, this._observers.splice(index, 1), !0);}makeObserverTopPriority(observer) {this._remove(observer, !1), this._observers.unshift(observer);}makeObserverBottomPriority(observer) {this._remove(observer, !1), this._observers.push(observer);}notifyObservers(eventData, mask = -1, target, currentTarget, userInfo) {if (!this._observers.length) return !0;const state = this._eventState;state.mask = mask, state.target = target, state.currentTarget = currentTarget, state.skipNextObservers = !1, state.lastReturnValue = eventData, state.userInfo = userInfo;for (const obs of this._observers) if (!obs._willBeUnregistered && (obs.mask & mask && (obs.unregisterOnNextCall && this._deferUnregister(obs), state.lastReturnValue = obs.scope ? obs.callback.apply(obs.scope, [eventData, state]) : obs.callback(eventData, state)), state.skipNextObservers)) return !1;return !0;}notifyObserver(observer, eventData, mask = -1) {if (!observer._willBeUnregistered) {const state = this._eventState;state.mask = mask, state.skipNextObservers = !1, observer.unregisterOnNextCall && this._deferUnregister(observer), observer.callback(eventData, state);}}hasObservers() {return 0 < this._observers.length - this._numObserversMarkedAsDeleted;}clear() {this._observers = [], this._onObserverAdded = null, this._numObserversMarkedAsDeleted = 0;}clone() {const result = new Observable();return result._observers = this._observers.slice(0), result;}hasSpecificMask(mask = -1) {for (const obs of this._observers) if (obs.mask & mask || obs.mask === mask) return !0;return !1;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/perfCounter.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "z": () => (/* binding */ PerfCounter)
/* harmony export */ });
/* harmony import */ var _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/precisionDate.js");
class PerfCounter {get min() {return this._min;}get max() {return this._max;}get average() {return this._average;}get lastSecAverage() {return this._lastSecAverage;}get current() {return this._current;}get total() {return this._totalAccumulated;}get count() {return this._totalValueCount;}constructor() {this._startMonitoringTime = 0, this._min = 0, this._max = 0, this._average = 0, this._lastSecAverage = 0, this._current = 0, this._totalValueCount = 0, this._totalAccumulated = 0, this._lastSecAccumulated = 0, this._lastSecTime = 0, this._lastSecValueCount = 0;}fetchNewFrame() {this._totalValueCount++, this._current = 0, this._lastSecValueCount++;}addCount(newCount, fetchResult) {PerfCounter.Enabled && (this._current += newCount, fetchResult && this._fetchResult());}beginMonitoring() {PerfCounter.Enabled && (this._startMonitoringTime = _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__/* .PrecisionDate.Now */ .F.Now);}endMonitoring(newFrame = !0) {if (PerfCounter.Enabled) {newFrame && this.fetchNewFrame();const currentTime = _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__/* .PrecisionDate.Now */ .F.Now;this._current = currentTime - this._startMonitoringTime, newFrame && this._fetchResult();}}_fetchResult() {this._totalAccumulated += this._current, this._lastSecAccumulated += this._current, this._min = Math.min(this._min, this._current), this._max = Math.max(this._max, this._current), this._average = this._totalAccumulated / this._totalValueCount;const now = _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__/* .PrecisionDate.Now */ .F.Now;1e3 < now - this._lastSecTime && (this._lastSecAverage = this._lastSecAccumulated / this._lastSecValueCount, this._lastSecTime = now, this._lastSecAccumulated = 0, this._lastSecValueCount = 0);}}PerfCounter.Enabled = !0;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/performanceMonitor.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "A": () => (/* binding */ PerformanceMonitor),
/* harmony export */   "Z": () => (/* binding */ RollingAverage)
/* harmony export */ });
/* harmony import */ var _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/precisionDate.js");
class PerformanceMonitor {constructor(frameSampleSize = 30) {this._enabled = !0, this._rollingFrameTime = new RollingAverage(frameSampleSize);}sampleFrame(timeMs = _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__/* .PrecisionDate.Now */ .F.Now) {if (this._enabled) {if (null != this._lastFrameTimeMs) {const dt = timeMs - this._lastFrameTimeMs;this._rollingFrameTime.add(dt);}this._lastFrameTimeMs = timeMs;}}get averageFrameTime() {return this._rollingFrameTime.average;}get averageFrameTimeVariance() {return this._rollingFrameTime.variance;}get instantaneousFrameTime() {return this._rollingFrameTime.history(0);}get averageFPS() {return 1e3 / this._rollingFrameTime.average;}get instantaneousFPS() {const history = this._rollingFrameTime.history(0);return 0 === history ? 0 : 1e3 / history;}get isSaturated() {return this._rollingFrameTime.isSaturated();}enable() {this._enabled = !0;}disable() {this._enabled = !1, this._lastFrameTimeMs = null;}get isEnabled() {return this._enabled;}reset() {this._lastFrameTimeMs = null, this._rollingFrameTime.reset();}}class RollingAverage {constructor(length) {this._samples = Array(length), this.reset();}add(v) {let delta;if (this.isSaturated()) {const bottomValue = this._samples[this._pos];delta = bottomValue - this.average, this.average -= delta / (this._sampleCount - 1), this._m2 -= delta * (bottomValue - this.average);} else this._sampleCount++;delta = v - this.average, this.average += delta / this._sampleCount, this._m2 += delta * (v - this.average), this.variance = this._m2 / (this._sampleCount - 1), this._samples[this._pos] = v, this._pos++, this._pos %= this._samples.length;}history(i) {if (i >= this._sampleCount || i >= this._samples.length) return 0;const i0 = this._wrapPosition(this._pos - 1);return this._samples[this._wrapPosition(i0 - i)];}isSaturated() {return this._sampleCount >= this._samples.length;}reset() {this.average = 0, this.variance = 0, this._sampleCount = 0, this._pos = 0, this._m2 = 0;}_wrapPosition(i) {const max = this._samples.length;return (i % max + max) % max;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/precisionDate.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "F": () => (/* binding */ PrecisionDate)
/* harmony export */ });
/* harmony import */ var _domManagement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
class PrecisionDate {static get Now() {return _domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .DomManagement.IsWindowObjectExist */ .MZ.IsWindowObjectExist() && window.performance && window.performance.now ? window.performance.now() : Date.now();}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/retryStrategy.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "b": () => (/* binding */ RetryStrategy)
/* harmony export */ });
class RetryStrategy {static ExponentialBackoff(maxRetries = 3, baseInterval = 500) {return (url, request, retryIndex) => 0 !== request.status || retryIndex >= maxRetries || -1 !== url.indexOf("file:") ? -1 : Math.pow(2, retryIndex) * baseInterval;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/rgbdTextureTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "r": () => (/* binding */ RGBDTextureTools)
/* harmony export */ });
/* harmony import */ var _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/postProcess.js");
/* harmony import */ var _Shaders_rgbdDecode_fragment_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Shaders/rgbdDecode.fragment.js");
/* harmony import */ var _Engines_Extensions_engine_renderTarget_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js");
/* harmony import */ var _textureTools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/textureTools.js");
class RGBDTextureTools {static ExpandRGBDTexture(texture) {const internalTexture = texture._texture;if (!internalTexture || !texture.isRGBD) return;const engine = internalTexture.getEngine(),caps = engine.getCaps(),isReady = internalTexture.isReady;let expandTexture = !1;caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering ? (expandTexture = !0, internalTexture.type = 2) : caps.textureFloatRender && caps.textureFloatLinearFiltering && (expandTexture = !0, internalTexture.type = 1), expandTexture && (internalTexture.isReady = !1, internalTexture._isRGBD = !1, internalTexture.invertY = !1);const expandRGBDTexture = () => {if (expandTexture) {const rgbdPostProcess = new _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_0__/* .PostProcess */ .D("rgbdDecode", "rgbdDecode", null, null, 1, null, 3, engine, !1, void 0, internalTexture.type, void 0, null, !1);rgbdPostProcess.externalTextureSamplerBinding = !0;const expandedTexture = engine.createRenderTargetTexture(internalTexture.width, { generateDepthBuffer: !1, generateMipMaps: !1, generateStencilBuffer: !1, samplingMode: internalTexture.samplingMode, type: internalTexture.type, format: 5 });rgbdPostProcess.getEffect().executeWhenCompiled(() => {rgbdPostProcess.onApply = (effect) => {effect._bindTexture("textureSampler", internalTexture), effect.setFloat2("scale", 1, 1);}, texture.getScene().postProcessManager.directRender([rgbdPostProcess], expandedTexture, !0), engine.restoreDefaultFramebuffer(), engine._releaseTexture(internalTexture), rgbdPostProcess && rgbdPostProcess.dispose(), expandedTexture._swapAndDie(internalTexture), internalTexture.isReady = !0;});}};isReady ? expandRGBDTexture() : texture.onLoadObservable.addOnce(expandRGBDTexture);}static EncodeTextureToRGBD(internalTexture, scene, outputTextureType = 0) {return (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .ApplyPostProcess */ .$0)("rgbdEncode", internalTexture, scene, outputTextureType, 1, 5);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/smartArray.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "f": () => (/* binding */ SmartArrayNoDuplicate),
/* harmony export */   "t": () => (/* binding */ SmartArray)
/* harmony export */ });
class SmartArray {constructor(capacity) {this.length = 0, this.data = Array(capacity), this._id = SmartArray._GlobalId++;}push(value) {this.data[this.length++] = value, this.length > this.data.length && (this.data.length *= 2);}forEach(func) {for (let index = 0; index < this.length; index++) func(this.data[index]);}sort(compareFn) {this.data.sort(compareFn);}reset() {this.length = 0;}dispose() {this.reset(), this.data && (this.data.length = 0);}concat(array) {if (0 !== array.length) {this.length + array.length > this.data.length && (this.data.length = 2 * (this.length + array.length));for (let index = 0; index < array.length; index++) this.data[this.length++] = (array.data || array)[index];}}indexOf(value) {const position = this.data.indexOf(value);return position >= this.length ? -1 : position;}contains(value) {return -1 !== this.indexOf(value);}}SmartArray._GlobalId = 0;class SmartArrayNoDuplicate extends SmartArray {constructor() {super(...arguments), this._duplicateId = 0;}push(value) {super.push(value), value.__smartArrayFlags || (value.__smartArrayFlags = {}), value.__smartArrayFlags[this._id] = this._duplicateId;}pushNoDuplicate(value) {return !(value.__smartArrayFlags && value.__smartArrayFlags[this._id] === this._duplicateId) && (this.push(value), !0);}reset() {super.reset(), this._duplicateId++;}concatWithNoDuplicate(array) {if (0 !== array.length) {this.length + array.length > this.data.length && (this.data.length = 2 * (this.length + array.length));for (let index = 0; index < array.length; index++) {const item = (array.data || array)[index];this.pushNoDuplicate(item);}}}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/stringDictionary.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "x": () => (/* binding */ StringDictionary)
/* harmony export */ });
class StringDictionary {constructor() {this._count = 0, this._data = {};}copyFrom(source) {this.clear(), source.forEach((t, v) => this.add(t, v));}get(key) {const val = this._data[key];return void 0 === val ? void 0 : val;}getOrAddWithFactory(key, factory) {let val = this.get(key);return void 0 === val ? (val = factory(key), val && this.add(key, val), val) : val;}getOrAdd(key, val) {const curVal = this.get(key);return void 0 === curVal ? (this.add(key, val), val) : curVal;}contains(key) {return this._data[key] !== void 0;}add(key, value) {return !(void 0 !== this._data[key]) && (this._data[key] = value, ++this._count, !0);}set(key, value) {return void 0 !== this._data[key] && (this._data[key] = value, !0);}getAndRemove(key) {const val = this.get(key);return void 0 === val ? null : (delete this._data[key], --this._count, val);}remove(key) {return !!this.contains(key) && (delete this._data[key], --this._count, !0);}clear() {this._data = {}, this._count = 0;}get count() {return this._count;}forEach(callback) {for (const cur in this._data) {const val = this._data[cur];callback(cur, val);}}first(callback) {for (const cur in this._data) {const val = this._data[cur],res = callback(cur, val);if (res) return res;}return null;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/stringTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Gh": () => (/* binding */ EncodeArrayBufferToBase64),
/* harmony export */   "HQ": () => (/* binding */ DecodeBase64ToBinary),
/* harmony export */   "Ml": () => (/* binding */ StringTools),
/* harmony export */   "Ri": () => (/* binding */ StartsWith),
/* harmony export */   "fJ": () => (/* binding */ Decode),
/* harmony export */   "gi": () => (/* binding */ EndsWith),
/* harmony export */   "rP": () => (/* binding */ DecodeBase64ToString),
/* harmony export */   "zA": () => (/* binding */ PadNumber)
/* harmony export */ });
const EndsWith = (str, suffix) => str.endsWith(suffix);const StartsWith = (str, suffix) => !!str && str.startsWith(suffix);const Decode = (buffer) => {if ("undefined" != typeof TextDecoder) return new TextDecoder().decode(buffer);let result = "";for (let i = 0; i < buffer.byteLength; i++) result += String.fromCharCode(buffer[i]);return result;};const EncodeArrayBufferToBase64 = (buffer) => {const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let chr1,chr2,chr3,enc1,enc2,enc3,enc4,output = "",i = 0;for (const bytes = ArrayBuffer.isView(buffer) ? new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength) : new Uint8Array(buffer); i < bytes.length;) chr1 = bytes[i++], chr2 = i < bytes.length ? bytes[i++] : Number.NaN, chr3 = i < bytes.length ? bytes[i++] : Number.NaN, enc1 = chr1 >> 2, enc2 = (3 & chr1) << 4 | chr2 >> 4, enc3 = (15 & chr2) << 2 | chr3 >> 6, enc4 = 63 & chr3, isNaN(chr2) ? enc3 = enc4 = 64 : isNaN(chr3) && (enc4 = 64), output += keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);return output;};const DecodeBase64ToString = (base64Data) => atob(base64Data);const DecodeBase64ToBinary = (base64Data) => {const decodedString = DecodeBase64ToString(base64Data),bufferLength = decodedString.length,bufferView = new Uint8Array(new ArrayBuffer(bufferLength));for (let i = 0; i < bufferLength; i++) bufferView[i] = decodedString.charCodeAt(i);return bufferView.buffer;};const PadNumber = (num, length) => {let str = num + "";for (; str.length < length;) str = "0" + str;return str;};const StringTools = { EndsWith, StartsWith, Decode, EncodeArrayBufferToBase64, DecodeBase64ToString, DecodeBase64ToBinary, PadNumber };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/tags.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$": () => (/* binding */ Tags)
/* harmony export */ });
/* harmony import */ var _andOrNotEvaluator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/andOrNotEvaluator.js");
class Tags {static EnableFor(obj) {obj._tags = obj._tags || {}, obj.hasTags = () => Tags.HasTags(obj), obj.addTags = (tagsString) => Tags.AddTagsTo(obj, tagsString), obj.removeTags = (tagsString) => Tags.RemoveTagsFrom(obj, tagsString), obj.matchesTagsQuery = (tagsQuery) => Tags.MatchesQuery(obj, tagsQuery);}static DisableFor(obj) {delete obj._tags, delete obj.hasTags, delete obj.addTags, delete obj.removeTags, delete obj.matchesTagsQuery;}static HasTags(obj) {if (!obj._tags) return !1;const tags = obj._tags;for (const i in tags) if (Object.prototype.hasOwnProperty.call(tags, i)) return !0;return !1;}static GetTags(obj, asString = !0) {if (!obj._tags) return null;if (asString) {const tagsArray = [];for (const tag in obj._tags) Object.prototype.hasOwnProperty.call(obj._tags, tag) && !0 === obj._tags[tag] && tagsArray.push(tag);return tagsArray.join(" ");}return obj._tags;}static AddTagsTo(obj, tagsString) {if (tagsString && "string" == typeof tagsString) {const tags = tagsString.split(" ");tags.forEach(function (tag) {Tags._AddTagTo(obj, tag);});}}static _AddTagTo(obj, tag) {tag = tag.trim();"" === tag || "true" === tag || "false" === tag || tag.match(/[\s]/) || tag.match(/^([!]|([|]|[&]){2})/) || (Tags.EnableFor(obj), obj._tags[tag] = !0);}static RemoveTagsFrom(obj, tagsString) {if (Tags.HasTags(obj)) {const tags = tagsString.split(" ");for (const t in tags) Tags._RemoveTagFrom(obj, tags[t]);}}static _RemoveTagFrom(obj, tag) {delete obj._tags[tag];}static MatchesQuery(obj, tagsQuery) {return !(void 0 !== tagsQuery) || ("" === tagsQuery ? Tags.HasTags(obj) : _andOrNotEvaluator_js__WEBPACK_IMPORTED_MODULE_0__/* .AndOrNotEvaluator.Eval */ .q.Eval(tagsQuery, (r) => Tags.HasTags(obj) && obj._tags[r]));}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/textureTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$0": () => (/* binding */ ApplyPostProcess),
/* harmony export */   "Oi": () => (/* binding */ TextureTools),
/* harmony export */   "ay": () => (/* binding */ ToHalfFloat),
/* harmony export */   "cW": () => (/* binding */ CreateResizedCopy),
/* harmony export */   "qZ": () => (/* binding */ FromHalfFloat)
/* harmony export */ });
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
/* harmony import */ var _Materials_Textures_renderTargetTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.js");
/* harmony import */ var _PostProcesses_passPostProcess_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/passPostProcess.js");
/* harmony import */ var _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/postProcess.js");
function CreateResizedCopy(texture, width, height, useBilinearMode = !0) {const scene = texture.getScene(),engine = scene.getEngine(),rtt = new _Materials_Textures_renderTargetTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .RenderTargetTexture */ ._("resized" + texture.name, { width: width, height: height }, scene, !texture.noMipmap, !0, texture._texture.type, !1, texture.samplingMode, !1);rtt.wrapU = texture.wrapU, rtt.wrapV = texture.wrapV, rtt.uOffset = texture.uOffset, rtt.vOffset = texture.vOffset, rtt.uScale = texture.uScale, rtt.vScale = texture.vScale, rtt.uAng = texture.uAng, rtt.vAng = texture.vAng, rtt.wAng = texture.wAng, rtt.coordinatesIndex = texture.coordinatesIndex, rtt.level = texture.level, rtt.anisotropicFilteringLevel = texture.anisotropicFilteringLevel, rtt._texture.isReady = !1, texture.wrapU = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.CLAMP_ADDRESSMODE */ .x.CLAMP_ADDRESSMODE, texture.wrapV = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.CLAMP_ADDRESSMODE */ .x.CLAMP_ADDRESSMODE;const passPostProcess = new _PostProcesses_passPostProcess_js__WEBPACK_IMPORTED_MODULE_2__/* .PassPostProcess */ .Q("pass", 1, null, useBilinearMode ? _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.BILINEAR_SAMPLINGMODE */ .x.BILINEAR_SAMPLINGMODE : _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture.NEAREST_SAMPLINGMODE */ .x.NEAREST_SAMPLINGMODE, engine, !1, 0);return passPostProcess.externalTextureSamplerBinding = !0, passPostProcess.getEffect().executeWhenCompiled(() => {passPostProcess.onApply = function (effect) {effect.setTexture("textureSampler", texture);};const internalTexture = rtt.renderTarget;internalTexture && (scene.postProcessManager.directRender([passPostProcess], internalTexture), engine.unBindFramebuffer(internalTexture), rtt.disposeFramebufferObjects(), passPostProcess.dispose(), rtt.getInternalTexture().isReady = !0);}), rtt;}function ApplyPostProcess(postProcessName, internalTexture, scene, type, samplingMode, format) {const engine = internalTexture.getEngine();return internalTexture.isReady = !1, samplingMode = null !== samplingMode && void 0 !== samplingMode ? samplingMode : internalTexture.samplingMode, type = null !== type && void 0 !== type ? type : internalTexture.type, format = null !== format && void 0 !== format ? format : internalTexture.format, -1 === type && (type = 0), new Promise((resolve) => {const postProcess = new _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_3__/* .PostProcess */ .D("postprocess", postProcessName, null, null, 1, null, samplingMode, engine, !1, void 0, type, void 0, null, !1, format);postProcess.externalTextureSamplerBinding = !0;const encodedTexture = engine.createRenderTargetTexture({ width: internalTexture.width, height: internalTexture.height }, { generateDepthBuffer: !1, generateMipMaps: !1, generateStencilBuffer: !1, samplingMode, type, format });postProcess.getEffect().executeWhenCompiled(() => {postProcess.onApply = (effect) => {effect._bindTexture("textureSampler", internalTexture), effect.setFloat2("scale", 1, 1);}, scene.postProcessManager.directRender([postProcess], encodedTexture, !0), engine.restoreDefaultFramebuffer(), engine._releaseTexture(internalTexture), postProcess && postProcess.dispose(), encodedTexture._swapAndDie(internalTexture), internalTexture.type = type, internalTexture.format = 5, internalTexture.isReady = !0, resolve(internalTexture);});});}let floatView, int32View;function ToHalfFloat(value) {floatView || (floatView = new Float32Array(1), int32View = new Int32Array(floatView.buffer)), floatView[0] = value;const x = int32View[0];let bits = 32768 & x >> 16,m = 2047 & x >> 12;const e = 255 & x >> 23;return 103 > e ? bits : 142 < e ? (bits |= 31744, bits |= (255 == e ? 0 : 1) && 8388607 & x, bits) : 113 > e ? (m |= 2048, bits |= (m >> 114 - e) + (1 & m >> 113 - e), bits) : (bits |= e - 112 << 10 | m >> 1, bits += 1 & m, bits);}function FromHalfFloat(value) {const s = (32768 & value) >> 15,e = (31744 & value) >> 10,f = 1023 & value;if (0 === e) return (s ? -1 : 1) * Math.pow(2, -14) * (f / Math.pow(2, 10));return 31 == e ? f ? NaN : (s ? -1 : 1) * (1 / 0) : (s ? -1 : 1) * Math.pow(2, e - 15) * (1 + f / Math.pow(2, 10));}const TextureTools = { CreateResizedCopy, ApplyPostProcess, ToHalfFloat, FromHalfFloat };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/timingTools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Q": () => (/* binding */ TimingTools)
/* harmony export */ });
/* harmony import */ var _domManagement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
class TimingTools {static SetImmediate(action) {(0,_domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .IsWindowObjectExist */ .CG)() && window.setImmediate ? window.setImmediate(action) : setTimeout(action, 1);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/tools.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$g": () => (/* binding */ AsyncLoop),
/* harmony export */   "ok": () => (/* binding */ className),
/* harmony export */   "w1": () => (/* binding */ Tools)
/* harmony export */ });
/* harmony import */ var _observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _domManagement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _deepCopier_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/deepCopier.js");
/* harmony import */ var _precisionDate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/precisionDate.js");
/* harmony import */ var _devTools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
/* harmony import */ var _webRequest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/webRequest.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _fileTools_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/fileTools.js");
/* harmony import */ var _timingTools_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/timingTools.js");
/* harmony import */ var _instantiationTools_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/instantiationTools.js");
/* harmony import */ var _guid_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/guid.js");
class Tools {static get BaseUrl() {return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions.BaseUrl */ .rN.BaseUrl;}static set BaseUrl(value) {_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions.BaseUrl */ .rN.BaseUrl = value;}static get DefaultRetryStrategy() {return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions.DefaultRetryStrategy */ .rN.DefaultRetryStrategy;}static set DefaultRetryStrategy(strategy) {_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions.DefaultRetryStrategy */ .rN.DefaultRetryStrategy = strategy;}static get CorsBehavior() {return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions.CorsBehavior */ .rN.CorsBehavior;}static set CorsBehavior(value) {_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions.CorsBehavior */ .rN.CorsBehavior = value;}static get UseFallbackTexture() {return _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore.UseFallbackTexture */ .l.UseFallbackTexture;}static set UseFallbackTexture(value) {_Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore.UseFallbackTexture */ .l.UseFallbackTexture = value;}static get RegisteredExternalClasses() {return _instantiationTools_js__WEBPACK_IMPORTED_MODULE_10__/* .InstantiationTools.RegisteredExternalClasses */ .K.RegisteredExternalClasses;}static set RegisteredExternalClasses(classes) {_instantiationTools_js__WEBPACK_IMPORTED_MODULE_10__/* .InstantiationTools.RegisteredExternalClasses */ .K.RegisteredExternalClasses = classes;}static get fallbackTexture() {return _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore.FallbackTexture */ .l.FallbackTexture;}static set fallbackTexture(value) {_Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore.FallbackTexture */ .l.FallbackTexture = value;}static FetchToRef(u, v, width, height, pixels, color) {const wrappedU = 0 | Math.abs(u) * width % width,wrappedV = 0 | Math.abs(v) * height % height,position = 4 * (wrappedU + wrappedV * width);color.r = pixels[position] / 255, color.g = pixels[position + 1] / 255, color.b = pixels[position + 2] / 255, color.a = pixels[position + 3] / 255;}static Mix(a, b, alpha) {return a * (1 - alpha) + b * alpha;}static Instantiate(className) {return _instantiationTools_js__WEBPACK_IMPORTED_MODULE_10__/* .InstantiationTools.Instantiate */ .K.Instantiate(className);}static SetImmediate(action) {_timingTools_js__WEBPACK_IMPORTED_MODULE_9__/* .TimingTools.SetImmediate */ .Q.SetImmediate(action);}static IsExponentOfTwo(value) {let count = 1;do count *= 2; while (count < value);return count === value;}static FloatRound(value) {return Math.fround ? Math.fround(value) : (Tools._TmpFloatArray[0] = value, Tools._TmpFloatArray[0]);}static GetFilename(path) {const index = path.lastIndexOf("/");return 0 > index ? path : path.substring(index + 1);}static GetFolderPath(uri, returnUnchangedIfNoSlash = !1) {const index = uri.lastIndexOf("/");return 0 > index ? returnUnchangedIfNoSlash ? uri : "" : uri.substring(0, index + 1);}static ToDegrees(angle) {return 180 * angle / Math.PI;}static ToRadians(angle) {return angle * Math.PI / 180;}static SmoothAngleChange(previousAngle, newAngle, smoothFactor = .9) {const previousAngleRad = this.ToRadians(previousAngle),newAngleRad = this.ToRadians(newAngle);return this.ToDegrees(Math.atan2((1 - smoothFactor) * Math.sin(newAngleRad) + smoothFactor * Math.sin(previousAngleRad), (1 - smoothFactor) * Math.cos(newAngleRad) + smoothFactor * Math.cos(previousAngleRad)));}static MakeArray(obj, allowsNullUndefined) {return !0 !== allowsNullUndefined && (void 0 === obj || null == obj) ? null : Array.isArray(obj) ? obj : [obj];}static GetPointerPrefix(engine) {let eventPrefix = "pointer";return (0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .CG)() && !window.PointerEvent && (eventPrefix = "mouse"), !engine._badDesktopOS || engine._badOS || document && "ontouchend" in document || (eventPrefix = "mouse"), eventPrefix;}static SetCorsBehavior(url, element) {(0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .SetCorsBehavior */ .$M)(url, element);}static SetReferrerPolicyBehavior(referrerPolicy, element) {element.referrerPolicy = referrerPolicy;}static CleanUrl(url) {return url = url.replace(/#/gm, "%23"), url;}static get PreprocessUrl() {return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions.PreprocessUrl */ .rN.PreprocessUrl;}static set PreprocessUrl(processor) {_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions.PreprocessUrl */ .rN.PreprocessUrl = processor;}static LoadImage(input, onLoad, onError, offlineProvider, mimeType, imageBitmapOptions) {return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .LoadImage */ .r6)(input, onLoad, onError, offlineProvider, mimeType, imageBitmapOptions);}static LoadFile(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError) {return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .LoadFile */ .vP)(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError);}static LoadFileAsync(url, useArrayBuffer = !0) {return new Promise((resolve, reject) => {(0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .LoadFile */ .vP)(url, (data) => {resolve(data);}, void 0, void 0, useArrayBuffer, (request, exception) => {reject(exception);});});}static LoadScript(scriptUrl, onSuccess, onError, scriptId) {if ("function" == typeof importScripts) {try {importScripts(scriptUrl), onSuccess();} catch (e) {null === onError || void 0 === onError ? void 0 : onError(`Unable to load script '${scriptUrl}' in worker`, e);}return;}if (!(0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .CG)()) return void (null === onError || void 0 === onError ? void 0 : onError(`Cannot load script '${scriptUrl}' outside of a window or a worker`));const head = document.getElementsByTagName("head")[0],script = document.createElement("script");script.setAttribute("type", "text/javascript"), script.setAttribute("src", scriptUrl), scriptId && (script.id = scriptId), script.onload = () => {onSuccess && onSuccess();}, script.onerror = (e) => {onError && onError(`Unable to load script '${scriptUrl}'`, e);}, head.appendChild(script);}static LoadScriptAsync(scriptUrl) {return new Promise((resolve, reject) => {this.LoadScript(scriptUrl, () => {resolve();}, (message, exception) => {reject(exception || new Error(message));});});}static ReadFileAsDataURL(fileToLoad, callback, progressCallback) {const reader = new FileReader(),request = { onCompleteObservable: new _observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .y$(), abort: () => reader.abort() };return reader.onloadend = () => {request.onCompleteObservable.notifyObservers(request);}, reader.onload = (e) => {callback(e.target.result);}, reader.onprogress = progressCallback, reader.readAsDataURL(fileToLoad), request;}static ReadFile(file, onSuccess, onProgress, useArrayBuffer, onError) {return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .ReadFile */ .Ip)(file, onSuccess, onProgress, useArrayBuffer, onError);}static FileAsURL(content) {const fileBlob = new Blob([content]),url = window.URL,link = url.createObjectURL(fileBlob);return link;}static Format(value, decimals = 2) {return value.toFixed(decimals);}static DeepCopy(source, destination, doNotCopyList, mustCopyList) {_deepCopier_js__WEBPACK_IMPORTED_MODULE_3__/* .DeepCopier.DeepCopy */ .j.DeepCopy(source, destination, doNotCopyList, mustCopyList);}static IsEmpty(obj) {for (const i in obj) if (Object.prototype.hasOwnProperty.call(obj, i)) return !1;return !0;}static RegisterTopRootEvents(windowElement, events) {for (let index = 0; index < events.length; index++) {const event = events[index];windowElement.addEventListener(event.name, event.handler, !1);try {window.parent && window.parent.addEventListener(event.name, event.handler, !1);} catch (e) {}}}static UnregisterTopRootEvents(windowElement, events) {for (let index = 0; index < events.length; index++) {const event = events[index];windowElement.removeEventListener(event.name, event.handler);try {windowElement.parent && windowElement.parent.removeEventListener(event.name, event.handler);} catch (e) {}}}static async DumpFramebuffer(mimeType = "image/png") {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .S)("DumpTools");}static DumpData(mimeType = "image/png", invertY = !1, toArrayBuffer = !1) {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .S)("DumpTools");}static DumpDataAsync(mimeType = "image/png", invertY = !1, toArrayBuffer = !1) {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .S)("DumpTools");}static ToBlob(canvas, successCallback, mimeType = "image/png", quality) {canvas.toBlob || (canvas.toBlob = function (callback, type, quality) {setTimeout(() => {const binStr = atob(this.toDataURL(type, quality).split(",")[1]),len = binStr.length,arr = new Uint8Array(len);for (let i = 0; i < len; i++) arr[i] = binStr.charCodeAt(i);callback(new Blob([arr]));});}), canvas.toBlob(function (blob) {successCallback(blob);}, mimeType, quality);}static DownloadBlob(blob, fileName) {if ("download" in document.createElement("a")) {if (!fileName) {const date = new Date(),stringDate = (date.getFullYear() + "-" + (date.getMonth() + 1)).slice(2) + "-" + date.getDate() + "_" + date.getHours() + "-" + ("0" + date.getMinutes()).slice(-2);fileName = "screenshot_" + stringDate + ".png";}Tools.Download(blob, fileName);} else if (blob && "undefined" != typeof URL) {const url = URL.createObjectURL(blob),newWindow = window.open("");if (!newWindow) return;const img = newWindow.document.createElement("img");img.onload = function () {URL.revokeObjectURL(url);}, img.src = url, newWindow.document.body.appendChild(img);}}static EncodeScreenshotCanvasData(canvas, successCallback, mimeType = "image/png", fileName, quality) {if (successCallback) {const base64Image = canvas.toDataURL(mimeType, quality);successCallback(base64Image);} else this.ToBlob(canvas, function (blob) {blob && Tools.DownloadBlob(blob, fileName);}, mimeType, quality);}static Download(blob, fileName) {if ("undefined" == typeof URL) return;const url = window.URL.createObjectURL(blob),a = document.createElement("a");document.body.appendChild(a), a.style.display = "none", a.href = url, a.download = fileName, a.addEventListener("click", () => {a.parentElement && a.parentElement.removeChild(a);}), a.click(), window.URL.revokeObjectURL(url);}static BackCompatCameraNoPreventDefault(args) {if ("boolean" == typeof args[0]) return args[0];return !("boolean" != typeof args[1]) && args[1];}static CreateScreenshot(mimeType = "image/png") {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .S)("ScreenshotTools");}static CreateScreenshotAsync(mimeType = "image/png") {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .S)("ScreenshotTools");}static CreateScreenshotUsingRenderTarget(mimeType = "image/png", samples = 1, antialiasing = !1) {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .S)("ScreenshotTools");}static CreateScreenshotUsingRenderTargetAsync(mimeType = "image/png", samples = 1, antialiasing = !1) {throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .S)("ScreenshotTools");}static RandomId() {return (0,_guid_js__WEBPACK_IMPORTED_MODULE_11__/* .RandomGUID */ .f)();}static IsBase64(uri) {return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .IsBase64DataUrl */ .VL)(uri);}static DecodeBase64(uri) {return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .DecodeBase64UrlToBinary */ .$K)(uri);}static get errorsCount() {return _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.errorsCount */ .Y.errorsCount;}static Log(message) {_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Log */ .Y.Log(message);}static Warn(message) {_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Warn */ .Y.Warn(message);}static Error(message) {_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.Error */ .Y.Error(message);}static get LogCache() {return _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.LogCache */ .Y.LogCache;}static ClearLogCache() {_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.ClearLogCache */ .Y.ClearLogCache();}static set LogLevels(level) {_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.LogLevels */ .Y.LogLevels = level;}static set PerformanceLogLevel(level) {return (level & Tools.PerformanceUserMarkLogLevel) === Tools.PerformanceUserMarkLogLevel ? (Tools.StartPerformanceCounter = Tools._StartUserMark, void (Tools.EndPerformanceCounter = Tools._EndUserMark)) : (level & Tools.PerformanceConsoleLogLevel) === Tools.PerformanceConsoleLogLevel ? (Tools.StartPerformanceCounter = Tools._StartPerformanceConsole, void (Tools.EndPerformanceCounter = Tools._EndPerformanceConsole)) : void (Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled, Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled);}static _StartPerformanceCounterDisabled() {}static _EndPerformanceCounterDisabled() {}static _StartUserMark(counterName, condition = !0) {if (!Tools._Performance) {if (!(0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .CG)()) return;Tools._Performance = window.performance;}condition && Tools._Performance.mark && Tools._Performance.mark(counterName + "-Begin");}static _EndUserMark(counterName, condition = !0) {condition && Tools._Performance.mark && (Tools._Performance.mark(counterName + "-End"), Tools._Performance.measure(counterName, counterName + "-Begin", counterName + "-End"));}static _StartPerformanceConsole(counterName, condition = !0) {condition && (Tools._StartUserMark(counterName, condition), console.time && console.time(counterName));}static _EndPerformanceConsole(counterName, condition = !0) {condition && (Tools._EndUserMark(counterName, condition), console.timeEnd(counterName));}static get Now() {return _precisionDate_js__WEBPACK_IMPORTED_MODULE_4__/* .PrecisionDate.Now */ .F.Now;}static GetClassName(object, isType = !1) {let name = null;if (!isType && object.getClassName) name = object.getClassName();else {if (object instanceof Object) {const classObj = isType ? object : Object.getPrototypeOf(object);name = classObj.constructor.__bjsclassName__;}name || (name = typeof object);}return name;}static First(array, predicate) {for (const el of array) if (predicate(el)) return el;return null;}static getFullClassName(object, isType = !1) {let className = null,moduleName = null;if (!isType && object.getClassName) className = object.getClassName();else {if (object instanceof Object) {const classObj = isType ? object : Object.getPrototypeOf(object);className = classObj.constructor.__bjsclassName__, moduleName = classObj.constructor.__bjsmoduleName__;}className || (className = typeof object);}return className ? (null == moduleName ? "" : moduleName + ".") + className : null;}static DelayAsync(delay) {return new Promise((resolve) => {setTimeout(() => {resolve();}, delay);});}static IsSafari() {return !!(0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsNavigatorAvailable */ .up)() && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);}}Tools.UseCustomRequestHeaders = !1, Tools.CustomRequestHeaders = _webRequest_js__WEBPACK_IMPORTED_MODULE_6__/* .WebRequest.CustomRequestHeaders */ .g.CustomRequestHeaders, Tools._TmpFloatArray = new Float32Array(1), Tools.GetDOMTextContent = _domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .GetDOMTextContent */ .v, Tools.GetAbsoluteUrl = "object" == typeof document ? (url) => {const a = document.createElement("a");return a.href = url, a.href;} : "function" == typeof URL && "object" == typeof location ? (url) => new URL(url, location.origin).href : () => {throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.");}, Tools.NoneLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.NoneLogLevel */ .Y.NoneLogLevel, Tools.MessageLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.MessageLogLevel */ .Y.MessageLogLevel, Tools.WarningLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.WarningLogLevel */ .Y.WarningLogLevel, Tools.ErrorLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.ErrorLogLevel */ .Y.ErrorLogLevel, Tools.AllLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger.AllLogLevel */ .Y.AllLogLevel, Tools.IsWindowObjectExist = _domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .CG, Tools.PerformanceNoneLogLevel = 0, Tools.PerformanceUserMarkLogLevel = 1, Tools.PerformanceConsoleLogLevel = 2, Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled, Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled;function className(name, module) {return (target) => {target.__bjsclassName__ = name, target.__bjsmoduleName__ = null == module ? null : module;};}class AsyncLoop {constructor(iterations, func, successCallback, offset = 0) {this.iterations = iterations, this.index = offset - 1, this._done = !1, this._fn = func, this._successCallback = successCallback;}executeNext() {this._done || (this.index + 1 < this.iterations ? (++this.index, this._fn(this)) : this.breakLoop());}breakLoop() {this._done = !0, this._successCallback();}static Run(iterations, fn, successCallback, offset = 0) {const loop = new AsyncLoop(iterations, fn, successCallback, offset);return loop.executeNext(), loop;}static SyncAsyncForLoop(iterations, syncedIterations, fn, callback, breakFunction, timeout = 0) {return AsyncLoop.Run(Math.ceil(iterations / syncedIterations), (loop) => {breakFunction && breakFunction() ? loop.breakLoop() : setTimeout(() => {for (let i = 0; i < syncedIterations; ++i) {const iteration = loop.index * syncedIterations + i;if (iteration >= iterations) break;if (fn(iteration), breakFunction && breakFunction()) {loop.breakLoop();break;}}loop.executeNext();}, timeout);}, callback);}}_Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore.FallbackTexture */ .l.FallbackTexture = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z";

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/typeStore.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "H": () => (/* binding */ RegisterClass),
/* harmony export */   "q": () => (/* binding */ GetClass)
/* harmony export */ });
const _RegisteredTypes = {};function RegisterClass(className, type) {_RegisteredTypes[className] = type;}function GetClass(fqdn) {return _RegisteredTypes[fqdn];}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/uniqueIdGenerator.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "K": () => (/* binding */ UniqueIdGenerator)
/* harmony export */ });
class UniqueIdGenerator {static get UniqueId() {const result = this._UniqueIdCounter;return this._UniqueIdCounter++, result;}}UniqueIdGenerator._UniqueIdCounter = 1;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/webRequest.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "g": () => (/* binding */ WebRequest)
/* harmony export */ });
function createXMLHttpRequest() {return "undefined" != typeof _native && _native.XMLHttpRequest ? new _native.XMLHttpRequest() : new XMLHttpRequest();}class WebRequest {constructor() {this._xhr = createXMLHttpRequest(), this._requestURL = "";}_injectCustomRequestHeaders() {if (!this._shouldSkipRequestModifications(this._requestURL)) for (const key in WebRequest.CustomRequestHeaders) {const val = WebRequest.CustomRequestHeaders[key];val && this._xhr.setRequestHeader(key, val);}}_shouldSkipRequestModifications(url) {return WebRequest.SkipRequestModificationForBabylonCDN && (url.includes("preview.babylonjs.com") || url.includes("cdn.babylonjs.com"));}get onprogress() {return this._xhr.onprogress;}set onprogress(value) {this._xhr.onprogress = value;}get readyState() {return this._xhr.readyState;}get status() {return this._xhr.status;}get statusText() {return this._xhr.statusText;}get response() {return this._xhr.response;}get responseURL() {return this._xhr.responseURL;}get responseText() {return this._xhr.responseText;}get responseType() {return this._xhr.responseType;}set responseType(value) {this._xhr.responseType = value;}get timeout() {return this._xhr.timeout;}set timeout(value) {this._xhr.timeout = value;}addEventListener(type, listener, options) {this._xhr.addEventListener(type, listener, options);}removeEventListener(type, listener, options) {this._xhr.removeEventListener(type, listener, options);}abort() {this._xhr.abort();}send(body) {WebRequest.CustomRequestHeaders && this._injectCustomRequestHeaders(), this._xhr.send(body);}open(method, url) {for (const update of WebRequest.CustomRequestModifiers) {if (this._shouldSkipRequestModifications(url)) return;update(this._xhr, url);}return url = url.replace("file:http:", "http:"), url = url.replace("file:https:", "https:"), this._requestURL = url, this._xhr.open(method, url, !0);}setRequestHeader(name, value) {this._xhr.setRequestHeader(name, value);}getResponseHeader(name) {return this._xhr.getResponseHeader(name);}}WebRequest.CustomRequestHeaders = {}, WebRequest.CustomRequestModifiers = [], WebRequest.SkipRequestModificationForBabylonCDN = !0;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Misc/workerPool.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "h": () => (/* binding */ WorkerPool),
/* harmony export */   "v": () => (/* binding */ AutoReleaseWorkerPool)
/* harmony export */ });
class WorkerPool {constructor(workers) {this._pendingActions = [], this._workerInfos = workers.map((worker) => ({ workerPromise: Promise.resolve(worker), idle: !0 }));}dispose() {for (const workerInfo of this._workerInfos) workerInfo.workerPromise.then((worker) => {worker.terminate();});this._workerInfos.length = 0, this._pendingActions.length = 0;}push(action) {this._executeOnIdleWorker(action) || this._pendingActions.push(action);}_executeOnIdleWorker(action) {for (const workerInfo of this._workerInfos) if (workerInfo.idle) return this._execute(workerInfo, action), !0;return !1;}_execute(workerInfo, action) {workerInfo.idle = !1, workerInfo.workerPromise.then((worker) => {action(worker, () => {const nextAction = this._pendingActions.shift();nextAction ? this._execute(workerInfo, nextAction) : workerInfo.idle = !0;});});}}class AutoReleaseWorkerPool extends WorkerPool {constructor(maxWorkers, createWorkerAsync, options = AutoReleaseWorkerPool.DefaultOptions) {super([]), this._maxWorkers = maxWorkers, this._createWorkerAsync = createWorkerAsync, this._options = options;}push(action) {if (!this._executeOnIdleWorker(action)) if (this._workerInfos.length < this._maxWorkers) {const workerInfo = { workerPromise: this._createWorkerAsync(), idle: !1 };this._workerInfos.push(workerInfo), this._execute(workerInfo, action);} else this._pendingActions.push(action);}_execute(workerInfo, action) {workerInfo.timeoutId && (clearTimeout(workerInfo.timeoutId), delete workerInfo.timeoutId), super._execute(workerInfo, (worker, onComplete) => {action(worker, () => {onComplete(), workerInfo.idle && (workerInfo.timeoutId = setTimeout(() => {workerInfo.workerPromise.then((worker) => {worker.terminate();});const indexOf = this._workerInfos.indexOf(workerInfo);-1 !== indexOf && this._workerInfos.splice(indexOf, 1);}, this._options.idleTimeElapsedBeforeRelease));});});}}AutoReleaseWorkerPool.DefaultOptions = { idleTimeElapsedBeforeRelease: 1e3 };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Morph/morphTarget.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Y": () => (/* binding */ MorphTarget)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
class MorphTarget {get influence() {return this._influence;}set influence(influence) {if (this._influence !== influence) {const previous = this._influence;this._influence = influence, this.onInfluenceChanged.hasObservers() && this.onInfluenceChanged.notifyObservers(0 === previous || 0 === influence);}}get animationPropertiesOverride() {return !this._animationPropertiesOverride && this._scene ? this._scene.animationPropertiesOverride : this._animationPropertiesOverride;}set animationPropertiesOverride(value) {this._animationPropertiesOverride = value;}constructor(name, influence = 0, scene = null) {this.name = name, this.animations = [], this._positions = null, this._normals = null, this._tangents = null, this._uvs = null, this._uniqueId = 0, this.onInfluenceChanged = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this._onDataLayoutChanged = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .y$(), this._animationPropertiesOverride = null, this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, this.influence = influence, this._scene && (this._uniqueId = this._scene.getUniqueId());}get uniqueId() {return this._uniqueId;}get hasPositions() {return !!this._positions;}get hasNormals() {return !!this._normals;}get hasTangents() {return !!this._tangents;}get hasUVs() {return !!this._uvs;}setPositions(data) {const hadPositions = this.hasPositions;this._positions = data, hadPositions !== this.hasPositions && this._onDataLayoutChanged.notifyObservers(void 0);}getPositions() {return this._positions;}setNormals(data) {const hadNormals = this.hasNormals;this._normals = data, hadNormals !== this.hasNormals && this._onDataLayoutChanged.notifyObservers(void 0);}getNormals() {return this._normals;}setTangents(data) {const hadTangents = this.hasTangents;this._tangents = data, hadTangents !== this.hasTangents && this._onDataLayoutChanged.notifyObservers(void 0);}getTangents() {return this._tangents;}setUVs(data) {const hadUVs = this.hasUVs;this._uvs = data, hadUVs !== this.hasUVs && this._onDataLayoutChanged.notifyObservers(void 0);}getUVs() {return this._uvs;}clone() {const newOne = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_4__/* .SerializationHelper.Clone */ .p4.Clone(() => new MorphTarget(this.name, this.influence, this._scene), this);return newOne._positions = this._positions, newOne._normals = this._normals, newOne._tangents = this._tangents, newOne._uvs = this._uvs, newOne;}serialize() {const serializationObject = {};return serializationObject.name = this.name, serializationObject.influence = this.influence, serializationObject.positions = Array.prototype.slice.call(this.getPositions()), null != this.id && (serializationObject.id = this.id), this.hasNormals && (serializationObject.normals = Array.prototype.slice.call(this.getNormals())), this.hasTangents && (serializationObject.tangents = Array.prototype.slice.call(this.getTangents())), this.hasUVs && (serializationObject.uvs = Array.prototype.slice.call(this.getUVs())), _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_4__/* .SerializationHelper.AppendSerializedAnimations */ .p4.AppendSerializedAnimations(this, serializationObject), serializationObject;}getClassName() {return "MorphTarget";}static Parse(serializationObject, scene) {const result = new MorphTarget(serializationObject.name, serializationObject.influence);if (result.setPositions(serializationObject.positions), null != serializationObject.id && (result.id = serializationObject.id), serializationObject.normals && result.setNormals(serializationObject.normals), serializationObject.tangents && result.setTangents(serializationObject.tangents), serializationObject.uvs && result.setUVs(serializationObject.uvs), serializationObject.animations) {for (let animationIndex = 0; animationIndex < serializationObject.animations.length; animationIndex++) {const parsedAnimation = serializationObject.animations[animationIndex],internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__/* .GetClass */ .q)("BABYLON.Animation");internalClass && result.animations.push(internalClass.Parse(parsedAnimation));}serializationObject.autoAnimate && scene && scene.beginAnimation(result, serializationObject.autoAnimateFrom, serializationObject.autoAnimateTo, serializationObject.autoAnimateLoop, serializationObject.autoAnimateSpeed || 1);}return result;}static FromMesh(mesh, name, influence) {name || (name = mesh.name);const result = new MorphTarget(name, influence, mesh.getScene());return result.setPositions(mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.PositionKind */ .o.PositionKind)), mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.NormalKind */ .o.NormalKind) && result.setNormals(mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.NormalKind */ .o.NormalKind)), mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.TangentKind */ .o.TangentKind) && result.setTangents(mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.TangentKind */ .o.TangentKind)), mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UVKind */ .o.UVKind) && result.setUVs(mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer.UVKind */ .o.UVKind)), result;}}(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_4__/* .serialize */ .qC)()], MorphTarget.prototype, "id", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/Morph/morphTargetManager.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "O": () => (/* binding */ MorphTargetManager)
/* harmony export */ });
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/smartArray.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _morphTarget_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Morph/morphTarget.js");
/* harmony import */ var _Materials_Textures_rawTexture2DArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/rawTexture2DArray.js");
class MorphTargetManager {set areUpdatesFrozen(block) {block ? this._blockCounter++ : (this._blockCounter--, 0 >= this._blockCounter && (this._blockCounter = 0, this._syncActiveTargets(!0)));}get areUpdatesFrozen() {return 0 < this._blockCounter;}constructor(scene = null) {if (this._targets = [], this._targetInfluenceChangedObservers = [], this._targetDataLayoutChangedObservers = [], this._activeTargets = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .t(16), this._supportsNormals = !1, this._supportsTangents = !1, this._supportsUVs = !1, this._vertexCount = 0, this._textureVertexStride = 0, this._textureWidth = 0, this._textureHeight = 1, this._uniqueId = 0, this._tempInfluences = [], this._canUseTextureForTargets = !1, this._blockCounter = 0, this._parentContainer = null, this.optimizeInfluencers = !0, this.enableNormalMorphing = !0, this.enableTangentMorphing = !0, this.enableUVMorphing = !0, this._useTextureToStoreTargets = !0, scene || (scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene), this._scene = scene, this._scene) {this._scene.morphTargetManagers.push(this), this._uniqueId = this._scene.getUniqueId();const engineCaps = this._scene.getEngine().getCaps();this._canUseTextureForTargets = engineCaps.canUseGLVertexID && engineCaps.textureFloat && 0 < engineCaps.maxVertexTextureImageUnits && 1 < engineCaps.texture2DArrayMaxLayerCount;}}get uniqueId() {return this._uniqueId;}get vertexCount() {return this._vertexCount;}get supportsNormals() {return this._supportsNormals && this.enableNormalMorphing;}get supportsTangents() {return this._supportsTangents && this.enableTangentMorphing;}get supportsUVs() {return this._supportsUVs && this.enableUVMorphing;}get numTargets() {return this._targets.length;}get numInfluencers() {return this._activeTargets.length;}get influences() {return this._influences;}get useTextureToStoreTargets() {return this._useTextureToStoreTargets;}set useTextureToStoreTargets(value) {this._useTextureToStoreTargets = value;}get isUsingTextureForTargets() {return MorphTargetManager.EnableTextureStorage && this.useTextureToStoreTargets && this._canUseTextureForTargets;}getActiveTarget(index) {return this._activeTargets.data[index];}getTarget(index) {return this._targets[index];}addTarget(target) {this._targets.push(target), this._targetInfluenceChangedObservers.push(target.onInfluenceChanged.add((needUpdate) => {this._syncActiveTargets(needUpdate);})), this._targetDataLayoutChangedObservers.push(target._onDataLayoutChanged.add(() => {this._syncActiveTargets(!0);})), this._syncActiveTargets(!0);}removeTarget(target) {const index = this._targets.indexOf(target);0 <= index && (this._targets.splice(index, 1), target.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(index, 1)[0]), target._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(index, 1)[0]), this._syncActiveTargets(!0));}_bind(effect) {effect.setFloat3("morphTargetTextureInfo", this._textureVertexStride, this._textureWidth, this._textureHeight), effect.setFloatArray("morphTargetTextureIndices", this._morphTargetTextureIndices), effect.setTexture("morphTargets", this._targetStoreTexture);}clone() {const copy = new MorphTargetManager(this._scene);for (const target of this._targets) copy.addTarget(target.clone());return copy.enableNormalMorphing = this.enableNormalMorphing, copy.enableTangentMorphing = this.enableTangentMorphing, copy.enableUVMorphing = this.enableUVMorphing, copy;}serialize() {const serializationObject = { id: this.uniqueId, targets: [] };for (const target of this._targets) serializationObject.targets.push(target.serialize());return serializationObject;}_syncActiveTargets(needUpdate) {if (this.areUpdatesFrozen) return;let influenceCount = 0;this._activeTargets.reset(), this._supportsNormals = !0, this._supportsTangents = !0, this._supportsUVs = !0, this._vertexCount = 0, this._scene && this._targets.length > this._scene.getEngine().getCaps().texture2DArrayMaxLayerCount && (this.useTextureToStoreTargets = !1), this._morphTargetTextureIndices && this._morphTargetTextureIndices.length === this._targets.length || (this._morphTargetTextureIndices = new Float32Array(this._targets.length));let targetIndex = -1;for (const target of this._targets) {if (targetIndex++, 0 === target.influence && this.optimizeInfluencers) continue;if (this._activeTargets.length >= MorphTargetManager.MaxActiveMorphTargetsInVertexAttributeMode && !this.isUsingTextureForTargets) break;this._activeTargets.push(target), this._morphTargetTextureIndices[influenceCount] = targetIndex, this._tempInfluences[influenceCount++] = target.influence, this._supportsNormals = this._supportsNormals && target.hasNormals, this._supportsTangents = this._supportsTangents && target.hasTangents, this._supportsUVs = this._supportsUVs && target.hasUVs;const positions = target.getPositions();if (positions) {const vertexCount = positions.length / 3;if (0 === this._vertexCount) this._vertexCount = vertexCount;else if (this._vertexCount !== vertexCount) return void _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger.Error */ .Y.Error("Incompatible target. Targets must all have the same vertices count.");}}this._influences && this._influences.length === influenceCount || (this._influences = new Float32Array(influenceCount));for (let index = 0; index < influenceCount; index++) this._influences[index] = this._tempInfluences[index];needUpdate && this.synchronize();}synchronize() {if (this._scene && !this.areUpdatesFrozen) {if (this.isUsingTextureForTargets && this._vertexCount) {this._textureVertexStride = 1, this._supportsNormals && this._textureVertexStride++, this._supportsTangents && this._textureVertexStride++, this._supportsUVs && this._textureVertexStride++, this._textureWidth = this._vertexCount * this._textureVertexStride, this._textureHeight = 1;const maxTextureSize = this._scene.getEngine().getCaps().maxTextureSize;this._textureWidth > maxTextureSize && (this._textureHeight = Math.ceil(this._textureWidth / maxTextureSize), this._textureWidth = maxTextureSize);let mustUpdateTexture = !0;if (this._targetStoreTexture) {const textureSize = this._targetStoreTexture.getSize();textureSize.width === this._textureWidth && textureSize.height === this._textureHeight && this._targetStoreTexture.depth === this._targets.length && (mustUpdateTexture = !1);}if (mustUpdateTexture) {this._targetStoreTexture && this._targetStoreTexture.dispose();const targetCount = this._targets.length,data = new Float32Array(4 * (targetCount * this._textureWidth * this._textureHeight));let offset = 0;for (let index = 0; index < targetCount; index++) {const target = this._targets[index],positions = target.getPositions(),normals = target.getNormals(),uvs = target.getUVs(),tangents = target.getTangents();if (!positions) return void (0 === index && _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger.Error */ .Y.Error("Invalid morph target. Target must have positions."));offset = 4 * (index * this._textureWidth * this._textureHeight);for (let vertex = 0; vertex < this._vertexCount; vertex++) data[offset] = positions[3 * vertex], data[offset + 1] = positions[3 * vertex + 1], data[offset + 2] = positions[3 * vertex + 2], offset += 4, normals && (data[offset] = normals[3 * vertex], data[offset + 1] = normals[3 * vertex + 1], data[offset + 2] = normals[3 * vertex + 2], offset += 4), uvs && (data[offset] = uvs[2 * vertex], data[offset + 1] = uvs[2 * vertex + 1], offset += 4), tangents && (data[offset] = tangents[3 * vertex], data[offset + 1] = tangents[3 * vertex + 1], data[offset + 2] = tangents[3 * vertex + 2], offset += 4);}this._targetStoreTexture = _Materials_Textures_rawTexture2DArray_js__WEBPACK_IMPORTED_MODULE_4__/* .RawTexture2DArray.CreateRGBATexture */ .e.CreateRGBATexture(data, this._textureWidth, this._textureHeight, targetCount, this._scene, !1, !1, 1, 1);}}for (const mesh of this._scene.meshes) mesh.morphTargetManager === this && mesh._syncGeometryWithMorphTargetManager();}}dispose() {if (this._targetStoreTexture && this._targetStoreTexture.dispose(), this._targetStoreTexture = null, this._scene && (this._scene.removeMorphTargetManager(this), this._parentContainer)) {const index = this._parentContainer.morphTargetManagers.indexOf(this);-1 < index && this._parentContainer.morphTargetManagers.splice(index, 1), this._parentContainer = null;}}static Parse(serializationObject, scene) {const result = new MorphTargetManager(scene);result._uniqueId = serializationObject.id;for (const targetData of serializationObject.targets) result.addTarget(_morphTarget_js__WEBPACK_IMPORTED_MODULE_3__/* .MorphTarget.Parse */ .Y.Parse(targetData, scene));return result;}}MorphTargetManager.EnableTextureStorage = !0, MorphTargetManager.MaxActiveMorphTargetsInVertexAttributeMode = 8;

/***/ }),

/***/ "./node_modules/@babylonjs/core/PostProcesses/passPostProcess.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ PassCubePostProcess),
  "Q": () => (/* binding */ PassPostProcess)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/postProcess.js
var postProcess = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/postProcess.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engine.js
var engine = __webpack_require__("./node_modules/@babylonjs/core/Engines/engine.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/pass.fragment.js
var pass_fragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/pass.fragment.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/passCube.fragment.js
const passCube_fragment_name = "passCubePixelShader",shader = `varying vec2 vUV;
uniform samplerCube textureSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
vec2 uv=vUV*2.0-1.0;
#ifdef POSITIVEX
gl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));
#endif
#ifdef NEGATIVEX
gl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));
#endif
#ifdef POSITIVEY
gl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));
#endif
#ifdef NEGATIVEY
gl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));
#endif
#ifdef POSITIVEZ
gl_FragColor=textureCube(textureSampler,vec3(uv,1.001));
#endif
#ifdef NEGATIVEZ
gl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));
#endif
}`;shaderStore/* ShaderStore.ShadersStore.passCubePixelShader */.v.ShadersStore.passCubePixelShader = shader;const passCubePixelShader = { name: "passCubePixelShader", shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/typeStore.js
var typeStore = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/decorators.js
var decorators = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/passPostProcess.js
class PassPostProcess extends postProcess/* PostProcess */.D {getClassName() {return "PassPostProcess";}constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "pass", null, null, options, camera, samplingMode, engine, reusable, void 0, textureType, void 0, null, blockCompilation);}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new PassPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,typeStore/* RegisterClass */.H)("BABYLON.PassPostProcess", PassPostProcess);class PassCubePostProcess extends postProcess/* PostProcess */.D {get face() {return this._face;}set face(value) {if (!(0 > value || 5 < value)) switch (this._face = value, this._face) {case 0:this.updateEffect("#define POSITIVEX");break;case 1:this.updateEffect("#define NEGATIVEX");break;case 2:this.updateEffect("#define POSITIVEY");break;case 3:this.updateEffect("#define NEGATIVEY");break;case 4:this.updateEffect("#define POSITIVEZ");break;case 5:this.updateEffect("#define NEGATIVEZ");}}getClassName() {return "PassCubePostProcess";}constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "passCube", null, null, options, camera, samplingMode, engine, reusable, "#define POSITIVEX", textureType, void 0, null, blockCompilation), this._face = 0;}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new PassCubePostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}engine/* Engine._RescalePostProcessFactory */.D._RescalePostProcessFactory = (engine) => new PassPostProcess("rescale", 1, null, 2, engine, !1, 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/PostProcesses/postProcess.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "D": () => (/* binding */ PostProcess)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/smartArray.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Shaders_postprocess_vertex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Shaders/postprocess.vertex.js");
/* harmony import */ var _Engines_engine_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engine.js");
/* harmony import */ var _Engines_Extensions_engine_renderTarget_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
/* harmony import */ var _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/drawWrapper.js");
/* harmony import */ var _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./node_modules/@babylonjs/core/Materials/shaderLanguage.js");
class PostProcess {static RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing) {return customShaderCodeProcessing ? void (PostProcess._CustomShaderCodeProcessing[null !== postProcessName && void 0 !== postProcessName ? postProcessName : ""] = customShaderCodeProcessing) : void delete PostProcess._CustomShaderCodeProcessing[null !== postProcessName && void 0 !== postProcessName ? postProcessName : ""];}static _GetShaderCodeProcessing(postProcessName) {var _a;return null !== (_a = PostProcess._CustomShaderCodeProcessing[postProcessName]) && void 0 !== _a ? _a : PostProcess._CustomShaderCodeProcessing[""];}get samples() {return this._samples;}set samples(n) {this._samples = Math.min(n, this._engine.getCaps().maxMSAASamples), this._textures.forEach((texture) => {texture.setSamples(this._samples);});}getEffectName() {return this._fragmentUrl;}set onActivate(callback) {this._onActivateObserver && this.onActivateObservable.remove(this._onActivateObserver), callback && (this._onActivateObserver = this.onActivateObservable.add(callback));}set onSizeChanged(callback) {this._onSizeChangedObserver && this.onSizeChangedObservable.remove(this._onSizeChangedObserver), this._onSizeChangedObserver = this.onSizeChangedObservable.add(callback);}set onApply(callback) {this._onApplyObserver && this.onApplyObservable.remove(this._onApplyObserver), this._onApplyObserver = this.onApplyObservable.add(callback);}set onBeforeRender(callback) {this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);}set onAfterRender(callback) {this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);}get inputTexture() {return this._textures.data[this._currentRenderTextureInd];}set inputTexture(value) {this._forcedOutputTexture = value;}restoreDefaultInputTexture() {this._forcedOutputTexture && (this._forcedOutputTexture = null, this.markTextureDirty());}getCamera() {return this._camera;}get texelSize() {return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.texelSize : (this._forcedOutputTexture && this._texelSize.copyFromFloats(1 / this._forcedOutputTexture.width, 1 / this._forcedOutputTexture.height), this._texelSize);}constructor(name, fragmentUrl, parameters, samplers, options, camera, samplingMode = 1, engine, reusable, defines = null, textureType = 0, vertexUrl = "postprocess", indexParameters, blockCompilation = !1, textureFormat = 5, shaderLanguage = _Materials_shaderLanguage_js__WEBPACK_IMPORTED_MODULE_10__/* .ShaderLanguage.GLSL */ .x.GLSL) {this._parentContainer = null, this.width = -1, this.height = -1, this.nodeMaterialSource = null, this._outputTexture = null, this.autoClear = !0, this.alphaMode = 0, this.animations = [], this.enablePixelPerfectMode = !1, this.forceFullscreenViewport = !0, this.scaleMode = 1, this.alwaysForcePOT = !1, this._samples = 1, this.adaptScaleToCurrentViewport = !1, this._reusable = !1, this._renderId = 0, this.externalTextureSamplerBinding = !1, this._textures = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_1__/* .SmartArray */ .t(2), this._textureCache = [], this._currentRenderTextureInd = 0, this._scaleRatio = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2 */ .FM(1, 1), this._texelSize = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2.Zero */ .FM.Zero(), this.onActivateObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), this.onSizeChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), this.onApplyObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), this.onBeforeRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), this.onAfterRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .y$(), this.name = name, null == camera ? engine && (this._engine = engine, this._engine.postProcesses.push(this)) : (this._camera = camera, this._scene = camera.getScene(), camera.attachPostProcess(this), this._engine = this._scene.getEngine(), this._scene.postProcesses.push(this), this.uniqueId = this._scene.getUniqueId()), this._options = options, this.renderTargetSamplingMode = samplingMode ? samplingMode : 1, this._reusable = reusable || !1, this._textureType = textureType, this._textureFormat = textureFormat, this._shaderLanguage = shaderLanguage, this._samplers = samplers || [], this._samplers.push("textureSampler"), this._fragmentUrl = fragmentUrl, this._vertexUrl = vertexUrl, this._parameters = parameters || [], this._parameters.push("scale"), this._indexParameters = indexParameters, this._drawWrapper = new _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_9__/* .DrawWrapper */ .q(this._engine), blockCompilation || this.updateEffect(defines);}getClassName() {return "PostProcess";}getEngine() {return this._engine;}getEffect() {return this._drawWrapper.effect;}shareOutputWith(postProcess) {return this._disposeTextures(), this._shareOutputWithPostProcess = postProcess, this;}useOwnOutput() {0 == this._textures.length && (this._textures = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_1__/* .SmartArray */ .t(2)), this._shareOutputWithPostProcess = null;}updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl) {var _a, _b;const customShaderCodeProcessing = PostProcess._GetShaderCodeProcessing(this.name);if (null === customShaderCodeProcessing || void 0 === customShaderCodeProcessing ? void 0 : customShaderCodeProcessing.defineCustomBindings) {const newUniforms = null !== (_a = null === uniforms || void 0 === uniforms ? void 0 : uniforms.slice()) && void 0 !== _a ? _a : [];newUniforms.push(...this._parameters);const newSamplers = null !== (_b = null === samplers || void 0 === samplers ? void 0 : samplers.slice()) && void 0 !== _b ? _b : [];newSamplers.push(...this._samplers), defines = customShaderCodeProcessing.defineCustomBindings(this.name, defines, newUniforms, newSamplers), uniforms = newUniforms, samplers = newSamplers;}this._postProcessDefines = defines, this._drawWrapper.effect = this._engine.createEffect({ vertex: null !== vertexUrl && void 0 !== vertexUrl ? vertexUrl : this._vertexUrl, fragment: null !== fragmentUrl && void 0 !== fragmentUrl ? fragmentUrl : this._fragmentUrl }, { attributes: ["position"], uniformsNames: uniforms || this._parameters, uniformBuffersNames: [], samplers: samplers || this._samplers, defines: null === defines ? "" : defines, fallbacks: null, onCompiled: null !== onCompiled && void 0 !== onCompiled ? onCompiled : null, onError: null !== onError && void 0 !== onError ? onError : null, indexParameters: indexParameters || this._indexParameters, processCodeAfterIncludes: (null === customShaderCodeProcessing || void 0 === customShaderCodeProcessing ? void 0 : customShaderCodeProcessing.processCodeAfterIncludes) ? (shaderType, code) => customShaderCodeProcessing.processCodeAfterIncludes(this.name, shaderType, code) : null, processFinalCode: (null === customShaderCodeProcessing || void 0 === customShaderCodeProcessing ? void 0 : customShaderCodeProcessing.processFinalCode) ? (shaderType, code) => customShaderCodeProcessing.processFinalCode(this.name, shaderType, code) : null, shaderLanguage: this._shaderLanguage }, this._engine);}isReusable() {return this._reusable;}markTextureDirty() {this.width = -1;}_createRenderTargetTexture(textureSize, textureOptions, channel = 0) {for (let i = 0; i < this._textureCache.length; i++) if (this._textureCache[i].texture.width === textureSize.width && this._textureCache[i].texture.height === textureSize.height && this._textureCache[i].postProcessChannel === channel && this._textureCache[i].texture._generateDepthBuffer === textureOptions.generateDepthBuffer && this._textureCache[i].texture.samples === textureOptions.samples) return this._textureCache[i].texture;const tex = this._engine.createRenderTargetTexture(textureSize, textureOptions);return this._textureCache.push({ texture: tex, postProcessChannel: channel, lastUsedRenderId: -1 }), tex;}_flushTextureCache() {const currentRenderId = this._renderId;for (let i = this._textureCache.length - 1; 0 <= i; i--) if (100 < currentRenderId - this._textureCache[i].lastUsedRenderId) {let currentlyUsed = !1;for (let j = 0; j < this._textures.length; j++) if (this._textures.data[j] === this._textureCache[i].texture) {currentlyUsed = !0;break;}currentlyUsed || (this._textureCache[i].texture.dispose(), this._textureCache.splice(i, 1));}}_resize(width, height, camera, needMipMaps, forceDepthStencil) {0 < this._textures.length && this._textures.reset(), this.width = width, this.height = height;let firstPP = null;for (let i = 0; i < camera._postProcesses.length; i++) if (null !== camera._postProcesses[i]) {firstPP = camera._postProcesses[i];break;}const textureSize = { width: this.width, height: this.height },textureOptions = { generateMipMaps: needMipMaps, generateDepthBuffer: forceDepthStencil || firstPP === this, generateStencilBuffer: (forceDepthStencil || firstPP === this) && this._engine.isStencilEnable, samplingMode: this.renderTargetSamplingMode, type: this._textureType, format: this._textureFormat, samples: this._samples };this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 0)), this._reusable && this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 1)), this._texelSize.copyFromFloats(1 / this.width, 1 / this.height), this.onSizeChangedObservable.notifyObservers(this);}activate(camera, sourceTexture = null, forceDepthStencil) {var _a, _b;camera = camera || this._camera;const scene = camera.getScene(),engine = scene.getEngine(),maxSize = engine.getCaps().maxTextureSize;let requiredWidth = 0 | (sourceTexture ? sourceTexture.width : this._engine.getRenderWidth(!0)) * this._options;const requiredHeight = 0 | (sourceTexture ? sourceTexture.height : this._engine.getRenderHeight(!0)) * this._options,webVRCamera = camera.parent;webVRCamera && (webVRCamera.leftCamera == camera || webVRCamera.rightCamera == camera) && (requiredWidth /= 2);let desiredWidth = this._options.width || requiredWidth,desiredHeight = this._options.height || requiredHeight;const needMipMaps = 7 !== this.renderTargetSamplingMode && 1 !== this.renderTargetSamplingMode && 2 !== this.renderTargetSamplingMode;if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {if (this.adaptScaleToCurrentViewport) {const currentViewport = engine.currentViewport;currentViewport && (desiredWidth *= currentViewport.width, desiredHeight *= currentViewport.height);}(needMipMaps || this.alwaysForcePOT) && (!this._options.width && (desiredWidth = engine.needPOTTextures ? _Engines_engine_js__WEBPACK_IMPORTED_MODULE_5__/* .Engine.GetExponentOfTwo */ .D.GetExponentOfTwo(desiredWidth, maxSize, this.scaleMode) : desiredWidth), !this._options.height && (desiredHeight = engine.needPOTTextures ? _Engines_engine_js__WEBPACK_IMPORTED_MODULE_5__/* .Engine.GetExponentOfTwo */ .D.GetExponentOfTwo(desiredHeight, maxSize, this.scaleMode) : desiredHeight)), (this.width !== desiredWidth || this.height !== desiredHeight) && this._resize(desiredWidth, desiredHeight, camera, needMipMaps, forceDepthStencil), this._textures.forEach((texture) => {texture.samples !== this.samples && this._engine.updateRenderTargetTextureSampleCount(texture, this.samples);}), this._flushTextureCache(), this._renderId++;}let target;if (this._shareOutputWithPostProcess) target = this._shareOutputWithPostProcess.inputTexture;else if (this._forcedOutputTexture) target = this._forcedOutputTexture, this.width = this._forcedOutputTexture.width, this.height = this._forcedOutputTexture.height;else {target = this.inputTexture;let cache;for (let i = 0; i < this._textureCache.length; i++) if (this._textureCache[i].texture === target) {cache = this._textureCache[i];break;}cache && (cache.lastUsedRenderId = this._renderId);}return this.enablePixelPerfectMode ? (this._scaleRatio.copyFromFloats(requiredWidth / desiredWidth, requiredHeight / desiredHeight), this._engine.bindFramebuffer(target, 0, requiredWidth, requiredHeight, this.forceFullscreenViewport)) : (this._scaleRatio.copyFromFloats(1, 1), this._engine.bindFramebuffer(target, 0, void 0, void 0, this.forceFullscreenViewport)), null === (_b = (_a = this._engine)._debugInsertMarker) || void 0 === _b ? void 0 : _b.call(_a, `post process ${this.name} input`), this.onActivateObservable.notifyObservers(camera), this.autoClear && 0 === this.alphaMode && this._engine.clear(this.clearColor ? this.clearColor : scene.clearColor, scene._allowPostProcessClearColor, !0, !0), this._reusable && (this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2), target;}get isSupported() {return this._drawWrapper.effect.isSupported;}get aspectRatio() {return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.aspectRatio : this._forcedOutputTexture ? this._forcedOutputTexture.width / this._forcedOutputTexture.height : this.width / this.height;}isReady() {var _a, _b;return !(null === (_b = null === (_a = this._drawWrapper.effect) || void 0 === _a ? void 0 : _a.isReady()) || void 0 === _b) && _b;}apply() {var _a, _b, _c;if (null === (_a = this._drawWrapper.effect) || void 0 === _a || !_a.isReady()) return null;this._engine.enableEffect(this._drawWrapper), this._engine.setState(!1), this._engine.setDepthBuffer(!1), this._engine.setDepthWrite(!1), this._engine.setAlphaMode(this.alphaMode), this.alphaConstants && this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);let source;return source = this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.inputTexture : this._forcedOutputTexture ? this._forcedOutputTexture : this.inputTexture, this.externalTextureSamplerBinding || this._drawWrapper.effect._bindTexture("textureSampler", null === source || void 0 === source ? void 0 : source.texture), this._drawWrapper.effect.setVector2("scale", this._scaleRatio), this.onApplyObservable.notifyObservers(this._drawWrapper.effect), null === (_c = null === (_b = PostProcess._GetShaderCodeProcessing(this.name)) || void 0 === _b ? void 0 : _b.bindCustomBindings) || void 0 === _c ? void 0 : _c.call(_b, this.name, this._drawWrapper.effect), this._drawWrapper.effect;}_disposeTextures() {return this._shareOutputWithPostProcess || this._forcedOutputTexture ? void this._disposeTextureCache() : void (this._disposeTextureCache(), this._textures.dispose());}_disposeTextureCache() {for (let i = this._textureCache.length - 1; 0 <= i; i--) this._textureCache[i].texture.dispose();this._textureCache.length = 0;}setPrePassRenderer(prePassRenderer) {return !!this._prePassEffectConfiguration && (this._prePassEffectConfiguration = prePassRenderer.addEffectConfiguration(this._prePassEffectConfiguration), this._prePassEffectConfiguration.enabled = !0, !0);}dispose(camera) {camera = camera || this._camera, this._disposeTextures();let index;if (this._scene && (index = this._scene.postProcesses.indexOf(this), -1 !== index && this._scene.postProcesses.splice(index, 1)), this._parentContainer) {const index = this._parentContainer.postProcesses.indexOf(this);-1 < index && this._parentContainer.postProcesses.splice(index, 1), this._parentContainer = null;}if (index = this._engine.postProcesses.indexOf(this), -1 !== index && this._engine.postProcesses.splice(index, 1), !!camera) {if (camera.detachPostProcess(this), index = camera._postProcesses.indexOf(this), 0 === index && 0 < camera._postProcesses.length) {const firstPostProcess = this._camera._getFirstPostProcess();firstPostProcess && firstPostProcess.markTextureDirty();}this.onActivateObservable.clear(), this.onAfterRenderObservable.clear(), this.onApplyObservable.clear(), this.onBeforeRenderObservable.clear(), this.onSizeChangedObservable.clear();}}serialize() {const serializationObject = _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .SerializationHelper.Serialize */ .p4.Serialize(this),camera = this.getCamera() || this._scene && this._scene.activeCamera;return serializationObject.customType = "BABYLON." + this.getClassName(), serializationObject.cameraId = camera ? camera.id : null, serializationObject.reusable = this._reusable, serializationObject.textureType = this._textureType, serializationObject.fragmentUrl = this._fragmentUrl, serializationObject.parameters = this._parameters, serializationObject.samplers = this._samplers, serializationObject.options = this._options, serializationObject.defines = this._postProcessDefines, serializationObject.textureFormat = this._textureFormat, serializationObject.vertexUrl = this._vertexUrl, serializationObject.indexParameters = this._indexParameters, serializationObject;}clone() {const serializationObject = this.serialize();serializationObject._engine = this._engine, serializationObject.cameraId = null;const result = PostProcess.Parse(serializationObject, this._scene, "");return result ? (result.onActivateObservable = this.onActivateObservable.clone(), result.onSizeChangedObservable = this.onSizeChangedObservable.clone(), result.onApplyObservable = this.onApplyObservable.clone(), result.onBeforeRenderObservable = this.onBeforeRenderObservable.clone(), result.onAfterRenderObservable = this.onAfterRenderObservable.clone(), result._prePassEffectConfiguration = this._prePassEffectConfiguration, result) : null;}static Parse(parsedPostProcess, scene, rootUrl) {const postProcessType = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__/* .GetClass */ .q)(parsedPostProcess.customType);if (!postProcessType || !postProcessType._Parse) return null;const camera = scene ? scene.getCameraById(parsedPostProcess.cameraId) : null;return postProcessType._Parse(parsedPostProcess, camera, scene, rootUrl);}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .SerializationHelper.Parse */ .p4.Parse(() => new PostProcess(parsedPostProcess.name, parsedPostProcess.fragmentUrl, parsedPostProcess.parameters, parsedPostProcess.samplers, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable, parsedPostProcess.defines, parsedPostProcess.textureType, parsedPostProcess.vertexUrl, parsedPostProcess.indexParameters, !1, parsedPostProcess.textureFormat), parsedPostProcess, scene, rootUrl);}}PostProcess._CustomShaderCodeProcessing = {}, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "uniqueId", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "name", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "width", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "height", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "renderTargetSamplingMode", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serializeAsColor4 */ .XX)()], PostProcess.prototype, "clearColor", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "autoClear", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "alphaMode", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "alphaConstants", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "enablePixelPerfectMode", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "forceFullscreenViewport", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "scaleMode", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "alwaysForcePOT", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)("samples")], PostProcess.prototype, "_samples", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_7__/* .serialize */ .qC)()], PostProcess.prototype, "adaptScaleToCurrentViewport", void 0), (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__/* .RegisterClass */ .H)("BABYLON.PostProcess", PostProcess);

/***/ }),

/***/ "./node_modules/@babylonjs/core/PostProcesses/postProcessManager.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "O": () => (/* binding */ PostProcessManager)
/* harmony export */ });
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
class PostProcessManager {constructor(scene) {this._vertexBuffers = {}, this._scene = scene;}_prepareBuffers() {if (!this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind]) {const vertices = [];vertices.push(1, 1), vertices.push(-1, 1), vertices.push(-1, -1), vertices.push(1, -1), this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .o(this._scene.getEngine(), vertices, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind, !1, !1, 2), this._buildIndexBuffer();}}_buildIndexBuffer() {const indices = [];indices.push(0), indices.push(1), indices.push(2), indices.push(0), indices.push(2), indices.push(3), this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);}_rebuild() {const vb = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind];vb && (vb._rebuild(), this._buildIndexBuffer());}_prepareFrame(sourceTexture = null, postProcesses = null) {const camera = this._scene.activeCamera;return !!camera && (postProcesses = postProcesses || camera._postProcesses.filter((pp) => null != pp), postProcesses && 0 !== postProcesses.length && this._scene.postProcessesEnabled) && (postProcesses[0].activate(camera, sourceTexture, null !== postProcesses && void 0 !== postProcesses), !0);}directRender(postProcesses, targetTexture = null, forceFullscreenViewport = !1, faceIndex = 0, lodLevel = 0, doNotBindFrambuffer = !1) {var _a;const engine = this._scene.getEngine();for (let index = 0; index < postProcesses.length; index++) {index < postProcesses.length - 1 ? postProcesses[index + 1].activate(this._scene.activeCamera, null === targetTexture || void 0 === targetTexture ? void 0 : targetTexture.texture) : (targetTexture ? engine.bindFramebuffer(targetTexture, faceIndex, void 0, void 0, forceFullscreenViewport, lodLevel) : !doNotBindFrambuffer && engine.restoreDefaultFramebuffer(), null === (_a = engine._debugInsertMarker) || void 0 === _a ? void 0 : _a.call(engine, `post process ${postProcesses[index].name} output`));const pp = postProcesses[index],effect = pp.apply();effect && (pp.onBeforeRenderObservable.notifyObservers(effect), this._prepareBuffers(), engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect), engine.drawElementsType(0, 0, 6), pp.onAfterRenderObservable.notifyObservers(effect));}engine.setDepthBuffer(!0), engine.setDepthWrite(!0);}_finalizeFrame(doNotPresent, targetTexture, faceIndex, postProcesses, forceFullscreenViewport = !1) {var _a;const camera = this._scene.activeCamera;if (camera && (postProcesses = postProcesses || camera._postProcesses.filter((pp) => null != pp), 0 !== postProcesses.length && this._scene.postProcessesEnabled)) {const engine = this._scene.getEngine();for (let index = 0, len = postProcesses.length; index < len; index++) {const pp = postProcesses[index];if (index < len - 1 ? pp._outputTexture = postProcesses[index + 1].activate(camera, null === targetTexture || void 0 === targetTexture ? void 0 : targetTexture.texture) : (targetTexture ? (engine.bindFramebuffer(targetTexture, faceIndex, void 0, void 0, forceFullscreenViewport), pp._outputTexture = targetTexture) : (engine.restoreDefaultFramebuffer(), pp._outputTexture = null), null === (_a = engine._debugInsertMarker) || void 0 === _a ? void 0 : _a.call(engine, `post process ${postProcesses[index].name} output`)), doNotPresent) break;const effect = pp.apply();effect && (pp.onBeforeRenderObservable.notifyObservers(effect), this._prepareBuffers(), engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect), engine.drawElementsType(0, 0, 6), pp.onAfterRenderObservable.notifyObservers(effect));}engine.setDepthBuffer(!0), engine.setDepthWrite(!0), engine.setAlphaMode(0);}}dispose() {const buffer = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind];buffer && (buffer.dispose(), this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer.PositionKind */ .o.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null);}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/Rendering/renderingGroup.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "S": () => (/* binding */ RenderingGroup)
/* harmony export */ });
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/smartArray.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
class RenderingGroup {set opaqueSortCompareFn(value) {this._opaqueSortCompareFn = value ? value : RenderingGroup.PainterSortCompare, this._renderOpaque = this._renderOpaqueSorted;}set alphaTestSortCompareFn(value) {this._alphaTestSortCompareFn = value ? value : RenderingGroup.PainterSortCompare, this._renderAlphaTest = this._renderAlphaTestSorted;}set transparentSortCompareFn(value) {this._transparentSortCompareFn = value ? value : RenderingGroup.defaultTransparentSortCompare, this._renderTransparent = this._renderTransparentSorted;}constructor(index, scene, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {this.index = index, this._opaqueSubMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .t(256), this._transparentSubMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .t(256), this._alphaTestSubMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .t(256), this._depthOnlySubMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .t(256), this._particleSystems = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .t(256), this._spriteManagers = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .t(256), this._empty = !0, this._edgesRenderers = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArrayNoDuplicate */ .f(16), this._scene = scene, this.opaqueSortCompareFn = opaqueSortCompareFn, this.alphaTestSortCompareFn = alphaTestSortCompareFn, this.transparentSortCompareFn = transparentSortCompareFn;}render(customRenderFunction, renderSprites, renderParticles, activeMeshes) {if (customRenderFunction) return void customRenderFunction(this._opaqueSubMeshes, this._alphaTestSubMeshes, this._transparentSubMeshes, this._depthOnlySubMeshes);const engine = this._scene.getEngine();0 !== this._depthOnlySubMeshes.length && (engine.setColorWrite(!1), this._renderAlphaTest(this._depthOnlySubMeshes), engine.setColorWrite(!0)), 0 !== this._opaqueSubMeshes.length && this._renderOpaque(this._opaqueSubMeshes), 0 !== this._alphaTestSubMeshes.length && this._renderAlphaTest(this._alphaTestSubMeshes);const stencilState = engine.getStencilBuffer();if (engine.setStencilBuffer(!1), renderSprites && this._renderSprites(), renderParticles && this._renderParticles(activeMeshes), this.onBeforeTransparentRendering && this.onBeforeTransparentRendering(), 0 !== this._transparentSubMeshes.length || this._scene.useOrderIndependentTransparency) {if (engine.setStencilBuffer(stencilState), this._scene.useOrderIndependentTransparency) {const excludedMeshes = this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);excludedMeshes.length && this._renderTransparent(excludedMeshes);} else this._renderTransparent(this._transparentSubMeshes);engine.setAlphaMode(0);}if (engine.setStencilBuffer(!1), this._edgesRenderers.length) {for (let edgesRendererIndex = 0; edgesRendererIndex < this._edgesRenderers.length; edgesRendererIndex++) this._edgesRenderers.data[edgesRendererIndex].render();engine.setAlphaMode(0);}engine.setStencilBuffer(stencilState);}_renderOpaqueSorted(subMeshes) {return RenderingGroup._RenderSorted(subMeshes, this._opaqueSortCompareFn, this._scene.activeCamera, !1);}_renderAlphaTestSorted(subMeshes) {return RenderingGroup._RenderSorted(subMeshes, this._alphaTestSortCompareFn, this._scene.activeCamera, !1);}_renderTransparentSorted(subMeshes) {return RenderingGroup._RenderSorted(subMeshes, this._transparentSortCompareFn, this._scene.activeCamera, !0);}static _RenderSorted(subMeshes, sortCompareFn, camera, transparent) {let subMesh,subIndex = 0;const cameraPosition = camera ? camera.globalPosition : RenderingGroup._ZeroVector;if (transparent) for (; subIndex < subMeshes.length; subIndex++) subMesh = subMeshes.data[subIndex], subMesh._alphaIndex = subMesh.getMesh().alphaIndex, subMesh._distanceToCamera = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Distance */ .P.Distance(subMesh.getBoundingInfo().boundingSphere.centerWorld, cameraPosition);const sortedArray = subMeshes.length === subMeshes.data.length ? subMeshes.data : subMeshes.data.slice(0, subMeshes.length);sortCompareFn && sortedArray.sort(sortCompareFn);const scene = sortedArray[0].getMesh().getScene();for (subIndex = 0; subIndex < sortedArray.length; subIndex++) if (subMesh = sortedArray[subIndex], !scene._activeMeshesFrozenButKeepClipping || subMesh.isInFrustum(scene._frustumPlanes)) {if (transparent) {const material = subMesh.getMaterial();if (material && material.needDepthPrePass) {const engine = material.getScene().getEngine();engine.setColorWrite(!1), engine.setAlphaMode(0), subMesh.render(!1), engine.setColorWrite(!0);}}subMesh.render(transparent);}}static defaultTransparentSortCompare(a, b) {return a._alphaIndex > b._alphaIndex ? 1 : a._alphaIndex < b._alphaIndex ? -1 : RenderingGroup.backToFrontSortCompare(a, b);}static backToFrontSortCompare(a, b) {return a._distanceToCamera < b._distanceToCamera ? 1 : a._distanceToCamera > b._distanceToCamera ? -1 : 0;}static frontToBackSortCompare(a, b) {return a._distanceToCamera < b._distanceToCamera ? -1 : a._distanceToCamera > b._distanceToCamera ? 1 : 0;}static PainterSortCompare(a, b) {const meshA = a.getMesh(),meshB = b.getMesh();return meshA.material && meshB.material ? meshA.material.uniqueId - meshB.material.uniqueId : meshA.uniqueId - meshB.uniqueId;}prepare() {this._opaqueSubMeshes.reset(), this._transparentSubMeshes.reset(), this._alphaTestSubMeshes.reset(), this._depthOnlySubMeshes.reset(), this._particleSystems.reset(), this.prepareSprites(), this._edgesRenderers.reset(), this._empty = !0;}prepareSprites() {this._spriteManagers.reset();}dispose() {this._opaqueSubMeshes.dispose(), this._transparentSubMeshes.dispose(), this._alphaTestSubMeshes.dispose(), this._depthOnlySubMeshes.dispose(), this._particleSystems.dispose(), this._spriteManagers.dispose(), this._edgesRenderers.dispose();}dispatch(subMesh, mesh, material) {mesh === void 0 && (mesh = subMesh.getMesh()), material === void 0 && (material = subMesh.getMaterial());null === material || void 0 === material || (material.needAlphaBlendingForMesh(mesh) ? this._transparentSubMeshes.push(subMesh) : material.needAlphaTesting() ? (material.needDepthPrePass && this._depthOnlySubMeshes.push(subMesh), this._alphaTestSubMeshes.push(subMesh)) : (material.needDepthPrePass && this._depthOnlySubMeshes.push(subMesh), this._opaqueSubMeshes.push(subMesh)), mesh._renderingGroup = this, mesh._edgesRenderer && mesh._edgesRenderer.isEnabled && this._edgesRenderers.pushNoDuplicate(mesh._edgesRenderer), this._empty = !1);}dispatchSprites(spriteManager) {this._spriteManagers.push(spriteManager), this._empty = !1;}dispatchParticles(particleSystem) {this._particleSystems.push(particleSystem), this._empty = !1;}_renderParticles(activeMeshes) {if (0 !== this._particleSystems.length) {const activeCamera = this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for (let particleIndex = 0; particleIndex < this._particleSystems.length; particleIndex++) {const particleSystem = this._particleSystems.data[particleIndex];if (0 === (activeCamera && activeCamera.layerMask & particleSystem.layerMask)) continue;const emitter = particleSystem.emitter;emitter.position && activeMeshes && -1 === activeMeshes.indexOf(emitter) || this._scene._activeParticles.addCount(particleSystem.render(), !1);}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene);}}_renderSprites() {if (this._scene.spritesEnabled && 0 !== this._spriteManagers.length) {const activeCamera = this._scene.activeCamera;this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);for (let id = 0; id < this._spriteManagers.length; id++) {const spriteManager = this._spriteManagers.data[id];0 !== (activeCamera && activeCamera.layerMask & spriteManager.layerMask) && spriteManager.render();}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene);}}}RenderingGroup._ZeroVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.Zero */ .P.Zero();

/***/ }),

/***/ "./node_modules/@babylonjs/core/Rendering/renderingManager.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$": () => (/* binding */ RenderingManager),
/* harmony export */   "t": () => (/* binding */ RenderingGroupInfo)
/* harmony export */ });
/* harmony import */ var _renderingGroup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Rendering/renderingGroup.js");
class RenderingGroupInfo {}class RenderingManager {get maintainStateBetweenFrames() {return this._maintainStateBetweenFrames;}set maintainStateBetweenFrames(value) {if (value !== this._maintainStateBetweenFrames && (this._maintainStateBetweenFrames = value, !this._maintainStateBetweenFrames)) {for (const mesh of this._scene.meshes) if (mesh.subMeshes) for (const subMesh of mesh.subMeshes) subMesh._wasDispatched = !1;for (const spriteManager of this._scene.spriteManagers) spriteManager._wasDispatched = !1;for (const particleSystem of this._scene.particleSystems) particleSystem._wasDispatched = !1;}}constructor(scene) {this._useSceneAutoClearSetup = !1, this._renderingGroups = [], this._autoClearDepthStencil = {}, this._customOpaqueSortCompareFn = {}, this._customAlphaTestSortCompareFn = {}, this._customTransparentSortCompareFn = {}, this._renderingGroupInfo = new RenderingGroupInfo(), this._maintainStateBetweenFrames = !1, this._scene = scene;for (let i = RenderingManager.MIN_RENDERINGGROUPS; i < RenderingManager.MAX_RENDERINGGROUPS; i++) this._autoClearDepthStencil[i] = { autoClear: !0, depth: !0, stencil: !0 };}getRenderingGroup(id) {const renderingGroupId = id || 0;return this._prepareRenderingGroup(renderingGroupId), this._renderingGroups[renderingGroupId];}_clearDepthStencilBuffer(depth = !0, stencil = !0) {this._depthStencilBufferAlreadyCleaned || (this._scene.getEngine().clear(null, !1, depth, stencil), this._depthStencilBufferAlreadyCleaned = !0);}render(customRenderFunction, activeMeshes, renderParticles, renderSprites) {const info = this._renderingGroupInfo;if (info.scene = this._scene, info.camera = this._scene.activeCamera, this._scene.spriteManagers && renderSprites) for (let index = 0; index < this._scene.spriteManagers.length; index++) {const manager = this._scene.spriteManagers[index];this.dispatchSprites(manager);}for (let index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {this._depthStencilBufferAlreadyCleaned = index === RenderingManager.MIN_RENDERINGGROUPS;const renderingGroup = this._renderingGroups[index];if (!renderingGroup || renderingGroup._empty) continue;const renderingGroupMask = Math.pow(2, index);if (info.renderingGroupId = index, this._scene.onBeforeRenderingGroupObservable.notifyObservers(info, renderingGroupMask), RenderingManager.AUTOCLEAR) {const autoClear = this._useSceneAutoClearSetup ? this._scene.getAutoClearDepthStencilSetup(index) : this._autoClearDepthStencil[index];autoClear && autoClear.autoClear && this._clearDepthStencilBuffer(autoClear.depth, autoClear.stencil);}for (const step of this._scene._beforeRenderingGroupDrawStage) step.action(index);renderingGroup.render(customRenderFunction, renderSprites, renderParticles, activeMeshes);for (const step of this._scene._afterRenderingGroupDrawStage) step.action(index);this._scene.onAfterRenderingGroupObservable.notifyObservers(info, renderingGroupMask);}}reset() {if (!this.maintainStateBetweenFrames) for (let index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {const renderingGroup = this._renderingGroups[index];renderingGroup && renderingGroup.prepare();}}resetSprites() {if (!this.maintainStateBetweenFrames) for (let index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {const renderingGroup = this._renderingGroups[index];renderingGroup && renderingGroup.prepareSprites();}}dispose() {this.freeRenderingGroups(), this._renderingGroups.length = 0, this._renderingGroupInfo = null;}freeRenderingGroups() {for (let index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {const renderingGroup = this._renderingGroups[index];renderingGroup && renderingGroup.dispose();}}_prepareRenderingGroup(renderingGroupId) {this._renderingGroups[renderingGroupId] === void 0 && (this._renderingGroups[renderingGroupId] = new _renderingGroup_js__WEBPACK_IMPORTED_MODULE_0__/* .RenderingGroup */ .S(renderingGroupId, this._scene, this._customOpaqueSortCompareFn[renderingGroupId], this._customAlphaTestSortCompareFn[renderingGroupId], this._customTransparentSortCompareFn[renderingGroupId]));}dispatchSprites(spriteManager) {this.maintainStateBetweenFrames && spriteManager._wasDispatched || (spriteManager._wasDispatched = !0, this.getRenderingGroup(spriteManager.renderingGroupId).dispatchSprites(spriteManager));}dispatchParticles(particleSystem) {this.maintainStateBetweenFrames && particleSystem._wasDispatched || (particleSystem._wasDispatched = !0, this.getRenderingGroup(particleSystem.renderingGroupId).dispatchParticles(particleSystem));}dispatch(subMesh, mesh, material) {mesh === void 0 && (mesh = subMesh.getMesh());this.maintainStateBetweenFrames && subMesh._wasDispatched || (subMesh._wasDispatched = !0, this.getRenderingGroup(mesh.renderingGroupId).dispatch(subMesh, mesh, material));}setRenderingOrder(renderingGroupId, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {if (this._customOpaqueSortCompareFn[renderingGroupId] = opaqueSortCompareFn, this._customAlphaTestSortCompareFn[renderingGroupId] = alphaTestSortCompareFn, this._customTransparentSortCompareFn[renderingGroupId] = transparentSortCompareFn, this._renderingGroups[renderingGroupId]) {const group = this._renderingGroups[renderingGroupId];group.opaqueSortCompareFn = this._customOpaqueSortCompareFn[renderingGroupId], group.alphaTestSortCompareFn = this._customAlphaTestSortCompareFn[renderingGroupId], group.transparentSortCompareFn = this._customTransparentSortCompareFn[renderingGroupId];}}setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil, depth = !0, stencil = !0) {this._autoClearDepthStencil[renderingGroupId] = { autoClear: autoClearDepthStencil, depth: depth, stencil: stencil };}getAutoClearDepthStencilSetup(index) {return this._autoClearDepthStencil[index];}}RenderingManager.MAX_RENDERINGGROUPS = 4, RenderingManager.MIN_RENDERINGGROUPS = 0, RenderingManager.AUTOCLEAR = !0;

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export bakedVertexAnimation */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "bakedVertexAnimation",shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
{
#ifdef INSTANCES
#define BVASNAME bakedVertexAnimationSettingsInstanced
#else
#define BVASNAME bakedVertexAnimationSettings
#endif
float VATStartFrame=BVASNAME.x;
float VATEndFrame=BVASNAME.y;
float VATOffsetFrame=BVASNAME.z;
float VATSpeed=BVASNAME.w;
float totalFrames=VATEndFrame-VATStartFrame+1.0;
float time=bakedVertexAnimationTime*VATSpeed/totalFrames;
float frameCorrection=time<1.0 ? 0.0 : 1.0;
float numOfFrames=totalFrames-frameCorrection;
float VATFrameNum=fract(time)*numOfFrames;
VATFrameNum=mod(VATFrameNum+VATOffsetFrame,numOfFrames);
VATFrameNum=floor(VATFrameNum);
VATFrameNum+=VATStartFrame+frameCorrection;
mat4 VATInfluence;
VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];
#endif
finalWorld=finalWorld*VATInfluence;
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.bakedVertexAnimation */ .v.IncludesShadersStore.bakedVertexAnimation = shader;const bakedVertexAnimation = { name: "bakedVertexAnimation", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export bakedVertexAnimationDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "bakedVertexAnimationDeclaration",shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
uniform float bakedVertexAnimationTime;
uniform vec2 bakedVertexAnimationTextureSizeInverted;
uniform vec4 bakedVertexAnimationSettings;
uniform sampler2D bakedVertexAnimationTexture;
#ifdef INSTANCES
attribute vec4 bakedVertexAnimationSettingsInstanced;
#endif
#define inline
mat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame)
{
float offset=index*4.0;
float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;
float dx=bakedVertexAnimationTextureSizeInverted.x;
vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));
vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));
vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));
vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));
return mat4(m0,m1,m2,m3);
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.bakedVertexAnimationDeclaration */ .v.IncludesShadersStore.bakedVertexAnimationDeclaration = shader;const bakedVertexAnimationDeclaration = { name: "bakedVertexAnimationDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export bonesDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "bonesDeclaration",shader = `#if NUM_BONE_INFLUENCERS>0
attribute vec4 matricesIndices;
attribute vec4 matricesWeights;
#if NUM_BONE_INFLUENCERS>4
attribute vec4 matricesIndicesExtra;
attribute vec4 matricesWeightsExtra;
#endif
#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#ifdef BONETEXTURE
uniform sampler2D boneSampler;
uniform float boneTextureWidth;
#else
uniform mat4 mBones[BonesPerMesh];
#ifdef BONES_VELOCITY_ENABLED
uniform mat4 mPreviousBones[BonesPerMesh];
#endif
#endif
#ifdef BONETEXTURE
#define inline
mat4 readMatrixFromRawSampler(sampler2D smp,float index)
{
float offset=index *4.0;
float dx=1.0/boneTextureWidth;
vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));
vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));
vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));
vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));
return mat4(m0,m1,m2,m3);
}
#endif
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.bonesDeclaration */ .v.IncludesShadersStore.bonesDeclaration = shader;const bonesDeclaration = { name: "bonesDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export bonesVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "bonesVertex",shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#if NUM_BONE_INFLUENCERS>0
mat4 influence;
#ifdef BONETEXTURE
influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];
#endif
#else
influence=mBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence+=mBones[int(matricesIndices[1])]*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
influence+=mBones[int(matricesIndices[2])]*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
influence+=mBones[int(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
influence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
influence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
influence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
influence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
#endif
finalWorld=finalWorld*influence;
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.bonesVertex */ .v.IncludesShadersStore.bonesVertex = shader;const bonesVertex = { name: "bonesVertex", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export bumpFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "bumpFragment",shader = `vec2 uvOffset=vec2(0.0,0.0);
#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)
#ifdef NORMALXYSCALE
float normalScale=1.0;
#elif defined(BUMP)
float normalScale=vBumpInfos.y;
#else
float normalScale=1.0;
#endif
#if defined(TANGENT) && defined(NORMAL)
mat3 TBN=vTBN;
#elif defined(BUMP)
vec2 TBNUV=gl_FrontFacing ? vBumpUV : -vBumpUV;
mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams);
#else
vec2 TBNUV=gl_FrontFacing ? vDetailUV : -vDetailUV;
mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vec2(1.,1.));
#endif
#elif defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL)
mat3 TBN=vTBN;
#else
vec2 TBNUV=gl_FrontFacing ? vMainUV1 : -vMainUV1;
mat3 TBN=cotangent_frame(normalW,vPositionW,TBNUV,vec2(1.,1.));
#endif
#endif
#ifdef PARALLAX
mat3 invTBN=transposeMat3(TBN);
#ifdef PARALLAXOCCLUSION
uvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);
#else
uvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);
#endif
#endif
#ifdef DETAIL
vec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);
vec2 detailNormalRG=detailColor.wy*2.0-1.0;
float detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));
vec3 detailNormal=vec3(detailNormalRG,detailNormalB);
#endif
#ifdef BUMP
#ifdef OBJECTSPACE_NORMALMAP
#define CUSTOM_FRAGMENT_BUMP_FRAGMENT
normalW=normalize(texture2D(bumpSampler,vBumpUV).xyz *2.0-1.0);
normalW=normalize(mat3(normalMatrix)*normalW);
#elif !defined(DETAIL)
normalW=perturbNormal(TBN,texture2D(bumpSampler,vBumpUV+uvOffset).xyz,vBumpInfos.y);
#else
vec3 bumpNormal=texture2D(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;
#if DETAIL_NORMALBLENDMETHOD==0 
detailNormal.xy*=vDetailInfos.z;
vec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));
#elif DETAIL_NORMALBLENDMETHOD==1 
detailNormal.xy*=vDetailInfos.z;
bumpNormal+=vec3(0.0,0.0,1.0);
detailNormal*=vec3(-1.0,-1.0,1.0);
vec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;
#endif
normalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);
#endif
#elif defined(DETAIL)
detailNormal.xy*=vDetailInfos.z;
normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.bumpFragment */ .v.IncludesShadersStore.bumpFragment = shader;const bumpFragment = { name: "bumpFragment", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export bumpFragmentFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
/* harmony import */ var _samplerFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.js");
const name = "bumpFragmentFunctions",shader = `#if defined(BUMP)
#include<samplerFragmentDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)
#endif
#if defined(DETAIL)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail)
#endif
#if defined(BUMP) && defined(PARALLAX)
const float minSamples=4.;
const float maxSamples=15.;
const int iMaxSamples=15;
vec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {
float parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;
parallaxLimit*=parallaxScale;
vec2 vOffsetDir=normalize(vViewDirCoT.xy);
vec2 vMaxOffset=vOffsetDir*parallaxLimit;
float numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));
float stepSize=1.0/numSamples;
float currRayHeight=1.0;
vec2 vCurrOffset=vec2(0,0);
vec2 vLastOffset=vec2(0,0);
float lastSampledHeight=1.0;
float currSampledHeight=1.0;
bool keepWorking=true;
for (int i=0; i<iMaxSamples; i++)
{
currSampledHeight=texture2D(bumpSampler,texCoord+vCurrOffset).w;
if (!keepWorking)
{
}
else if (currSampledHeight>currRayHeight)
{
float delta1=currSampledHeight-currRayHeight;
float delta2=(currRayHeight+stepSize)-lastSampledHeight;
float ratio=delta1/(delta1+delta2);
vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;
keepWorking=false;
}
else
{
currRayHeight-=stepSize;
vLastOffset=vCurrOffset;
vCurrOffset+=stepSize*vMaxOffset;
lastSampledHeight=currSampledHeight;
}
}
return vCurrOffset;
}
vec2 parallaxOffset(vec3 viewDir,float heightScale)
{
float height=texture2D(bumpSampler,vBumpUV).w;
vec2 texCoordOffset=heightScale*viewDir.xy*height;
return -texCoordOffset;
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.bumpFragmentFunctions */ .v.IncludesShadersStore.bumpFragmentFunctions = shader;const bumpFragmentFunctions = { name: "bumpFragmentFunctions", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export bumpFragmentMainFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "bumpFragmentMainFunctions",shader = `#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)
#if defined(TANGENT) && defined(NORMAL) 
varying mat3 vTBN;
#endif
#ifdef OBJECTSPACE_NORMALMAP
uniform mat4 normalMatrix;
#if defined(WEBGL2) || defined(WEBGPU)
mat4 toNormalMatrix(mat4 wMatrix)
{
mat4 ret=inverse(wMatrix);
ret=transpose(ret);
ret[0][3]=0.;
ret[1][3]=0.;
ret[2][3]=0.;
ret[3]=vec4(0.,0.,0.,1.);
return ret;
}
#else
mat4 toNormalMatrix(mat4 m)
{
float
a00=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3],
a10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3],
a20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3],
a30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3],
b00=a00*a11-a01*a10,
b01=a00*a12-a02*a10,
b02=a00*a13-a03*a10,
b03=a01*a12-a02*a11,
b04=a01*a13-a03*a11,
b05=a02*a13-a03*a12,
b06=a20*a31-a21*a30,
b07=a20*a32-a22*a30,
b08=a20*a33-a23*a30,
b09=a21*a32-a22*a31,
b10=a21*a33-a23*a31,
b11=a22*a33-a23*a32,
det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;
mat4 mi=mat4(
a11*b11-a12*b10+a13*b09,
a02*b10-a01*b11-a03*b09,
a31*b05-a32*b04+a33*b03,
a22*b04-a21*b05-a23*b03,
a12*b08-a10*b11-a13*b07,
a00*b11-a02*b08+a03*b07,
a32*b02-a30*b05-a33*b01,
a20*b05-a22*b02+a23*b01,
a10*b10-a11*b08+a13*b06,
a01*b08-a00*b10-a03*b06,
a30*b04-a31*b02+a33*b00,
a21*b02-a20*b04-a23*b00,
a11*b07-a10*b09-a12*b06,
a00*b09-a01*b07+a02*b06,
a31*b01-a30*b03-a32*b00,
a20*b03-a21*b01+a22*b00)/det;
return mat4(mi[0][0],mi[1][0],mi[2][0],mi[3][0],
mi[0][1],mi[1][1],mi[2][1],mi[3][1],
mi[0][2],mi[1][2],mi[2][2],mi[3][2],
mi[0][3],mi[1][3],mi[2][3],mi[3][3]);
}
#endif
#endif
vec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale)
{
#ifdef NORMALXYSCALE
normal=normalize(normal*vec3(scale,scale,1.0));
#endif
return normalize(cotangentFrame*normal);
}
vec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale)
{
return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);
}
mat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams)
{
vec3 dp1=dFdx(p);
vec3 dp2=dFdy(p);
vec2 duv1=dFdx(uv);
vec2 duv2=dFdy(uv);
vec3 dp2perp=cross(dp2,normal);
vec3 dp1perp=cross(normal,dp1);
vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;
vec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;
tangent*=tangentSpaceParams.x;
bitangent*=tangentSpaceParams.y;
float det=max(dot(tangent,tangent),dot(bitangent,bitangent));
float invmax=det==0.0 ? 0.0 : inversesqrt(det);
return mat3(tangent*invmax,bitangent*invmax,normal);
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.bumpFragmentMainFunctions */ .v.IncludesShadersStore.bumpFragmentMainFunctions = shader;const bumpFragmentMainFunctions = { name: "bumpFragmentMainFunctions", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export bumpVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "bumpVertex",shader = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL)
vec3 tbnNormal=normalize(normalUpdated);
vec3 tbnTangent=normalize(tangentUpdated.xyz);
vec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;
vTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.bumpVertex */ .v.IncludesShadersStore.bumpVertex = shader;const bumpVertex = { name: "bumpVertex", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export bumpVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "bumpVertexDeclaration",shader = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL) 
varying mat3 vTBN;
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.bumpVertexDeclaration */ .v.IncludesShadersStore.bumpVertexDeclaration = shader;const bumpVertexDeclaration = { name: "bumpVertexDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export clipPlaneFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "clipPlaneFragment",shader = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
if (false) {}
#endif
#ifdef CLIPPLANE
else if (fClipDistance>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE2
else if (fClipDistance2>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE3
else if (fClipDistance3>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE4
else if (fClipDistance4>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE5
else if (fClipDistance5>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE6
else if (fClipDistance6>0.0)
{
discard;
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.clipPlaneFragment */ .v.IncludesShadersStore.clipPlaneFragment = shader;const clipPlaneFragment = { name: "clipPlaneFragment", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export clipPlaneFragmentDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "clipPlaneFragmentDeclaration",shader = `#ifdef CLIPPLANE
varying float fClipDistance;
#endif
#ifdef CLIPPLANE2
varying float fClipDistance2;
#endif
#ifdef CLIPPLANE3
varying float fClipDistance3;
#endif
#ifdef CLIPPLANE4
varying float fClipDistance4;
#endif
#ifdef CLIPPLANE5
varying float fClipDistance5;
#endif
#ifdef CLIPPLANE6
varying float fClipDistance6;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.clipPlaneFragmentDeclaration */ .v.IncludesShadersStore.clipPlaneFragmentDeclaration = shader;const clipPlaneFragmentDeclaration = { name: "clipPlaneFragmentDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export clipPlaneVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "clipPlaneVertex",shader = `#ifdef CLIPPLANE
fClipDistance=dot(worldPos,vClipPlane);
#endif
#ifdef CLIPPLANE2
fClipDistance2=dot(worldPos,vClipPlane2);
#endif
#ifdef CLIPPLANE3
fClipDistance3=dot(worldPos,vClipPlane3);
#endif
#ifdef CLIPPLANE4
fClipDistance4=dot(worldPos,vClipPlane4);
#endif
#ifdef CLIPPLANE5
fClipDistance5=dot(worldPos,vClipPlane5);
#endif
#ifdef CLIPPLANE6
fClipDistance6=dot(worldPos,vClipPlane6);
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.clipPlaneVertex */ .v.IncludesShadersStore.clipPlaneVertex = shader;const clipPlaneVertex = { name: "clipPlaneVertex", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export clipPlaneVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "clipPlaneVertexDeclaration",shader = `#ifdef CLIPPLANE
uniform vec4 vClipPlane;
varying float fClipDistance;
#endif
#ifdef CLIPPLANE2
uniform vec4 vClipPlane2;
varying float fClipDistance2;
#endif
#ifdef CLIPPLANE3
uniform vec4 vClipPlane3;
varying float fClipDistance3;
#endif
#ifdef CLIPPLANE4
uniform vec4 vClipPlane4;
varying float fClipDistance4;
#endif
#ifdef CLIPPLANE5
uniform vec4 vClipPlane5;
varying float fClipDistance5;
#endif
#ifdef CLIPPLANE6
uniform vec4 vClipPlane6;
varying float fClipDistance6;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.clipPlaneVertexDeclaration */ .v.IncludesShadersStore.clipPlaneVertexDeclaration = shader;const clipPlaneVertexDeclaration = { name: "clipPlaneVertexDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export depthPrePass */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "depthPrePass",shader = `#ifdef DEPTHPREPASS
gl_FragColor=vec4(0.,0.,0.,1.0);
return;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.depthPrePass */ .v.IncludesShadersStore.depthPrePass = shader;const depthPrePass = { name: "depthPrePass", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export fogFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "fogFragment",shader = `#ifdef FOG
float fog=CalcFogFactor();
#ifdef PBR
fog=toLinearSpace(fog);
#endif
color.rgb=mix(vFogColor,color.rgb,fog);
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.fogFragment */ .v.IncludesShadersStore.fogFragment = shader;const fogFragment = { name: "fogFragment", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export fogFragmentDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "fogFragmentDeclaration",shader = `#ifdef FOG
#define FOGMODE_NONE 0.
#define FOGMODE_EXP 1.
#define FOGMODE_EXP2 2.
#define FOGMODE_LINEAR 3.
#define E 2.71828
uniform vec4 vFogInfos;
uniform vec3 vFogColor;
varying vec3 vFogDistance;
float CalcFogFactor()
{
float fogCoeff=1.0;
float fogStart=vFogInfos.y;
float fogEnd=vFogInfos.z;
float fogDensity=vFogInfos.w;
float fogDistance=length(vFogDistance);
if (FOGMODE_LINEAR==vFogInfos.x)
{
fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);
}
else if (FOGMODE_EXP==vFogInfos.x)
{
fogCoeff=1.0/pow(E,fogDistance*fogDensity);
}
else if (FOGMODE_EXP2==vFogInfos.x)
{
fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);
}
return clamp(fogCoeff,0.0,1.0);
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.fogFragmentDeclaration */ .v.IncludesShadersStore.fogFragmentDeclaration = shader;const fogFragmentDeclaration = { name: "fogFragmentDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export fogVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "fogVertex",shader = `#ifdef FOG
vFogDistance=(view*worldPos).xyz;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.fogVertex */ .v.IncludesShadersStore.fogVertex = shader;const fogVertex = { name: "fogVertex", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export fogVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "fogVertexDeclaration",shader = `#ifdef FOG
varying vec3 vFogDistance;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.fogVertexDeclaration */ .v.IncludesShadersStore.fogVertexDeclaration = shader;const fogVertexDeclaration = { name: "fogVertexDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/fresnelFunction.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export fresnelFunction */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "fresnelFunction",shader = `#ifdef FRESNEL
float computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)
{
float fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);
return clamp(fresnelTerm,0.,1.);
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.fresnelFunction */ .v.IncludesShadersStore.fresnelFunction = shader;const fresnelFunction = { name: "fresnelFunction", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/hdrFilteringFunctions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export hdrFilteringFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "hdrFilteringFunctions",shader = `#ifdef NUM_SAMPLES
#if NUM_SAMPLES>0
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
float radicalInverse_VdC(uint bits) 
{
bits=(bits<<16u) | (bits>>16u);
bits=((bits & 0x55555555u)<<1u) | ((bits & 0xAAAAAAAAu)>>1u);
bits=((bits & 0x33333333u)<<2u) | ((bits & 0xCCCCCCCCu)>>2u);
bits=((bits & 0x0F0F0F0Fu)<<4u) | ((bits & 0xF0F0F0F0u)>>4u);
bits=((bits & 0x00FF00FFu)<<8u) | ((bits & 0xFF00FF00u)>>8u);
return float(bits)*2.3283064365386963e-10; 
}
vec2 hammersley(uint i,uint N)
{
return vec2(float(i)/float(N),radicalInverse_VdC(i));
}
#else
float vanDerCorpus(int n,int base)
{
float invBase=1.0/float(base);
float denom =1.0;
float result =0.0;
for(int i=0; i<32; ++i)
{
if(n>0)
{
denom =mod(float(n),2.0);
result+=denom*invBase;
invBase=invBase/2.0;
n =int(float(n)/2.0);
}
}
return result;
}
vec2 hammersley(int i,int N)
{
return vec2(float(i)/float(N),vanDerCorpus(i,2));
}
#endif
float log4(float x) {
return log2(x)/2.;
}
const float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);
const float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;
const float K=4.;
#define inline
vec3 irradiance(samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)
{
vec3 n=normalize(inputN);
vec3 result=vec3(0.0);
vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);
tangent=normalize(cross(tangent,n));
vec3 bitangent=cross(n,tangent);
mat3 tbn=mat3(tangent,bitangent,n);
float maxLevel=filteringInfo.y;
float dim0=filteringInfo.x;
float omegaP=(4.*PI)/(6.*dim0*dim0);
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
for(uint i=0u; i<NUM_SAMPLES; ++i)
#else
for(int i=0; i<NUM_SAMPLES; ++i)
#endif
{
vec2 Xi=hammersley(i,NUM_SAMPLES);
vec3 Ls=hemisphereCosSample(Xi);
Ls=normalize(Ls);
vec3 Ns=vec3(0.,0.,1.);
float NoL=dot(Ns,Ls);
if (NoL>0.) {
float pdf_inversed=PI/NoL;
float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;
float l=log4(omegaS)-log4(omegaP)+log4(K);
float mipLevel=clamp(l,0.0,maxLevel);
vec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb;
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
result+=c;
}
}
result=result*NUM_SAMPLES_FLOAT_INVERSED;
return result;
}
#define inline
vec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)
{
vec3 n=normalize(inputN);
if (alphaG==0.) {
vec3 c=textureCube(inputTexture,n).rgb;
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
return c;
} else {
vec3 result=vec3(0.);
vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);
tangent=normalize(cross(tangent,n));
vec3 bitangent=cross(n,tangent);
mat3 tbn=mat3(tangent,bitangent,n);
float maxLevel=filteringInfo.y;
float dim0=filteringInfo.x;
float omegaP=(4.*PI)/(6.*dim0*dim0);
float weight=0.;
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
for(uint i=0u; i<NUM_SAMPLES; ++i)
#else
for(int i=0; i<NUM_SAMPLES; ++i)
#endif
{
vec2 Xi=hammersley(i,NUM_SAMPLES);
vec3 H=hemisphereImportanceSampleDggx(Xi,alphaG);
float NoV=1.;
float NoH=H.z;
float NoH2=H.z*H.z;
float NoL=2.*NoH2-1.;
vec3 L=vec3(2.*NoH*H.x,2.*NoH*H.y,NoL);
L=normalize(L);
if (NoL>0.) {
float pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);
float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;
float l=log4(omegaS)-log4(omegaP)+log4(K);
float mipLevel=clamp(float(l),0.0,maxLevel);
weight+=NoL;
vec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb;
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
result+=c*NoL;
}
}
result=result/weight;
return result;
}
}
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.hdrFilteringFunctions */ .v.IncludesShadersStore.hdrFilteringFunctions = shader;const hdrFilteringFunctions = { name: "hdrFilteringFunctions", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export helperFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "helperFunctions",shader = `const float PI=3.1415926535897932384626433832795;
const float HALF_MIN=5.96046448e-08; 
const float LinearEncodePowerApprox=2.2;
const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;
const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);
const float Epsilon=0.0000001;
#define saturate(x) clamp(x,0.0,1.0)
#define absEps(x) abs(x)+Epsilon
#define maxEps(x) max(x,Epsilon)
#define saturateEps(x) clamp(x,Epsilon,1.0)
mat3 transposeMat3(mat3 inMatrix) {
vec3 i0=inMatrix[0];
vec3 i1=inMatrix[1];
vec3 i2=inMatrix[2];
mat3 outMatrix=mat3(
vec3(i0.x,i1.x,i2.x),
vec3(i0.y,i1.y,i2.y),
vec3(i0.z,i1.z,i2.z)
);
return outMatrix;
}
mat3 inverseMat3(mat3 inMatrix) {
float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];
float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];
float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];
float b01=a22*a11-a12*a21;
float b11=-a22*a10+a12*a20;
float b21=a21*a10-a11*a20;
float det=a00*b01+a01*b11+a02*b21;
return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),
b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),
b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;
}
#if USE_EXACT_SRGB_CONVERSIONS
vec3 toLinearSpaceExact(vec3 color)
{
vec3 nearZeroSection=0.0773993808*color;
vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));
#else
return
vec3(
color.r<=0.04045 ? nearZeroSection.r : remainingSection.r,
color.g<=0.04045 ? nearZeroSection.g : remainingSection.g,
color.b<=0.04045 ? nearZeroSection.b : remainingSection.b);
#endif
}
vec3 toGammaSpaceExact(vec3 color)
{
vec3 nearZeroSection=12.92*color;
vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));
#else
return
vec3(
color.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,
color.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,
color.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);
#endif
}
#endif
float toLinearSpace(float color)
{
#if USE_EXACT_SRGB_CONVERSIONS
float nearZeroSection=0.0773993808*color;
float remainingSection=pow(0.947867299*(color+0.055),2.4);
return color<=0.04045 ? nearZeroSection : remainingSection;
#else
return pow(color,LinearEncodePowerApprox);
#endif
}
vec3 toLinearSpace(vec3 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return toLinearSpaceExact(color);
#else
return pow(color,vec3(LinearEncodePowerApprox));
#endif
}
vec4 toLinearSpace(vec4 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return vec4(toLinearSpaceExact(color.rgb),color.a);
#else
return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);
#endif
}
float toGammaSpace(float color)
{
#if USE_EXACT_SRGB_CONVERSIONS
float nearZeroSection=12.92*color;
float remainingSection=1.055*pow(color,0.41666)-0.055;
return color<=0.0031308 ? nearZeroSection : remainingSection;
#else
return pow(color,GammaEncodePowerApprox);
#endif
}
vec3 toGammaSpace(vec3 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return toGammaSpaceExact(color);
#else
return pow(color,vec3(GammaEncodePowerApprox));
#endif
}
vec4 toGammaSpace(vec4 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return vec4(toGammaSpaceExact(color.rgb),color.a);
#else
return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);
#endif
}
float square(float value)
{
return value*value;
}
vec3 square(vec3 value)
{
return value*value;
}
float pow5(float value) {
float sq=value*value;
return sq*sq*value;
}
float getLuminance(vec3 color)
{
return clamp(dot(color,LuminanceEncodeApprox),0.,1.);
}
float getRand(vec2 seed) {
return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);
}
float dither(vec2 seed,float varianceAmount) {
float rand=getRand(seed);
float normVariance=varianceAmount/255.0;
float dither=mix(-normVariance,normVariance,rand);
return dither;
}
const float rgbdMaxRange=255.0;
vec4 toRGBD(vec3 color) {
float maxRGB=maxEps(max(color.r,max(color.g,color.b)));
float D =max(rgbdMaxRange/maxRGB,1.);
D =clamp(floor(D)/255.0,0.,1.);
vec3 rgb=color.rgb*D;
rgb=toGammaSpace(rgb);
return vec4(clamp(rgb,0.,1.),D); 
}
vec3 fromRGBD(vec4 rgbd) {
rgbd.rgb=toLinearSpace(rgbd.rgb);
return rgbd.rgb/rgbd.a;
}
vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {
vec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;
vec3 halfSize=cubeSize*0.5;
vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;
vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;
vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);
float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);
vec3 intersectPositionWS=vertexPos+origVec*distance;
return intersectPositionWS-cubePos;
}
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.helperFunctions */ .v.IncludesShadersStore.helperFunctions = shader;const helperFunctions = { name: "helperFunctions", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export imageProcessingDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "imageProcessingDeclaration",shader = `#ifdef EXPOSURE
uniform float exposureLinear;
#endif
#ifdef CONTRAST
uniform float contrast;
#endif
#if defined(VIGNETTE) || defined(DITHER)
uniform vec2 vInverseScreenSize;
#endif
#ifdef VIGNETTE
uniform vec4 vignetteSettings1;
uniform vec4 vignetteSettings2;
#endif
#ifdef COLORCURVES
uniform vec4 vCameraColorCurveNegative;
uniform vec4 vCameraColorCurveNeutral;
uniform vec4 vCameraColorCurvePositive;
#endif
#ifdef COLORGRADING
#ifdef COLORGRADING3D
uniform highp sampler3D txColorTransform;
#else
uniform sampler2D txColorTransform;
#endif
uniform vec4 colorTransformSettings;
#endif
#ifdef DITHER
uniform float ditherIntensity;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.imageProcessingDeclaration */ .v.IncludesShadersStore.imageProcessingDeclaration = shader;const imageProcessingDeclaration = { name: "imageProcessingDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export imageProcessingFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "imageProcessingFunctions",shader = `#if defined(COLORGRADING) && !defined(COLORGRADING3D)
/** 
* Polyfill for SAMPLE_TEXTURE_3D,which is unsupported in WebGL.
* sampler3dSetting.x=textureOffset (0.5/textureSize).
* sampler3dSetting.y=textureSize.
*/
#define inline
vec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)
{
float sliceSize=2.0*sampler3dSetting.x; 
#ifdef SAMPLER3DGREENDEPTH
float sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;
#else
float sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;
#endif
float sliceInteger=floor(sliceContinuous);
float sliceFraction=sliceContinuous-sliceInteger;
#ifdef SAMPLER3DGREENDEPTH
vec2 sliceUV=color.rb;
#else
vec2 sliceUV=color.rg;
#endif
sliceUV.x*=sliceSize;
sliceUV.x+=sliceInteger*sliceSize;
sliceUV=saturate(sliceUV);
vec4 slice0Color=texture2D(colorTransform,sliceUV);
sliceUV.x+=sliceSize;
sliceUV=saturate(sliceUV);
vec4 slice1Color=texture2D(colorTransform,sliceUV);
vec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);
#ifdef SAMPLER3DBGRMAP
color.rgb=result.rgb;
#else
color.rgb=result.bgr;
#endif
return color;
}
#endif
#ifdef TONEMAPPING_ACES
const mat3 ACESInputMat=mat3(
vec3(0.59719,0.07600,0.02840),
vec3(0.35458,0.90834,0.13383),
vec3(0.04823,0.01566,0.83777)
);
const mat3 ACESOutputMat=mat3(
vec3( 1.60475,-0.10208,-0.00327),
vec3(-0.53108, 1.10813,-0.07276),
vec3(-0.07367,-0.00605, 1.07602)
);
vec3 RRTAndODTFit(vec3 v)
{
vec3 a=v*(v+0.0245786)-0.000090537;
vec3 b=v*(0.983729*v+0.4329510)+0.238081;
return a/b;
}
vec3 ACESFitted(vec3 color)
{
color=ACESInputMat*color;
color=RRTAndODTFit(color);
color=ACESOutputMat*color;
color=saturate(color);
return color;
}
#endif
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS
vec4 applyImageProcessing(vec4 result) {
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART
#ifdef EXPOSURE
result.rgb*=exposureLinear;
#endif
#ifdef VIGNETTE
vec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;
viewportXY=viewportXY*2.0-1.0;
vec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);
float vignetteTerm=dot(vignetteXY1,vignetteXY1);
float vignette=pow(vignetteTerm,vignetteSettings2.w);
vec3 vignetteColor=vignetteSettings2.rgb;
#ifdef VIGNETTEBLENDMODEMULTIPLY
vec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);
result.rgb*=vignetteColorMultiplier;
#endif
#ifdef VIGNETTEBLENDMODEOPAQUE
result.rgb=mix(vignetteColor,result.rgb,vignette);
#endif
#endif
#ifdef TONEMAPPING
#ifdef TONEMAPPING_ACES
result.rgb=ACESFitted(result.rgb);
#else
const float tonemappingCalibration=1.590579;
result.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);
#endif
#endif
result.rgb=toGammaSpace(result.rgb);
result.rgb=saturate(result.rgb);
#ifdef CONTRAST
vec3 resultHighContrast=result.rgb*result.rgb*(3.0-2.0*result.rgb);
if (contrast<1.0) {
result.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);
} else {
result.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);
}
#endif
#ifdef COLORGRADING
vec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;
#ifdef COLORGRADING3D
vec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;
#else
vec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;
#endif
result.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);
#endif
#ifdef COLORCURVES
float luma=getLuminance(result.rgb);
vec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));
vec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;
result.rgb*=colorCurve.rgb;
result.rgb=mix(vec3(luma),result.rgb,colorCurve.a);
#endif
#ifdef DITHER
float rand=getRand(gl_FragCoord.xy*vInverseScreenSize);
float dither=mix(-ditherIntensity,ditherIntensity,rand);
result.rgb=saturate(result.rgb+vec3(dither));
#endif
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND
return result;
}`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.imageProcessingFunctions */ .v.IncludesShadersStore.imageProcessingFunctions = shader;const imageProcessingFunctions = { name: "imageProcessingFunctions", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/importanceSampling.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export importanceSampling */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "importanceSampling",shader = `vec3 hemisphereCosSample(vec2 u) {
float phi=2.*PI*u.x;
float cosTheta2=1.-u.y;
float cosTheta=sqrt(cosTheta2);
float sinTheta=sqrt(1.-cosTheta2);
return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);
}
vec3 hemisphereImportanceSampleDggx(vec2 u,float a) {
float phi=2.*PI*u.x;
float cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));
float cosTheta=sqrt(cosTheta2);
float sinTheta=sqrt(1.-cosTheta2);
return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);
}
vec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) { 
float phi=2.*PI*u.x;
float sinTheta=pow(u.y,a/(2.*a+1.));
float cosTheta=sqrt(1.-sinTheta*sinTheta);
return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);
}`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.importanceSampling */ .v.IncludesShadersStore.importanceSampling = shader;const importanceSampling = { name: "importanceSampling", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export instancesDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "instancesDeclaration",shader = `#ifdef INSTANCES
attribute vec4 world0;
attribute vec4 world1;
attribute vec4 world2;
attribute vec4 world3;
#ifdef INSTANCESCOLOR
attribute vec4 instanceColor;
#endif
#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)
uniform mat4 world;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY)
attribute vec4 previousWorld0;
attribute vec4 previousWorld1;
attribute vec4 previousWorld2;
attribute vec4 previousWorld3;
#ifdef THIN_INSTANCES
uniform mat4 previousWorld;
#endif
#endif
#else
#if !defined(WORLD_UBO)
uniform mat4 world;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY)
uniform mat4 previousWorld;
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.instancesDeclaration */ .v.IncludesShadersStore.instancesDeclaration = shader;const instancesDeclaration = { name: "instancesDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export instancesVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "instancesVertex",shader = `#ifdef INSTANCES
mat4 finalWorld=mat4(world0,world1,world2,world3);
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
mat4 finalPreviousWorld=mat4(previousWorld0,previousWorld1,previousWorld2,previousWorld3);
#endif
#ifdef THIN_INSTANCES
finalWorld=world*finalWorld;
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
finalPreviousWorld=previousWorld*finalPreviousWorld;
#endif
#endif
#else
mat4 finalWorld=world;
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
mat4 finalPreviousWorld=previousWorld;
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.instancesVertex */ .v.IncludesShadersStore.instancesVertex = shader;const instancesVertex = { name: "instancesVertex", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export lightFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "lightFragment",shader = `#ifdef LIGHT{X}
#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})
#else
#ifdef PBR
#ifdef SPOTLIGHT{X}
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#elif defined(POINTLIGHT{X})
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#elif defined(HEMILIGHT{X})
preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#elif defined(DIRLIGHT{X})
preInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#endif
preInfo.NdotV=NdotV;
#ifdef SPOTLIGHT{X}
#ifdef LIGHT_FALLOFF_GLTF{X}
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);
preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);
preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);
#elif defined(LIGHT_FALLOFF_STANDARD{X})
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);
preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);
#else
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);
preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
#endif
#elif defined(POINTLIGHT{X})
#ifdef LIGHT_FALLOFF_GLTF{X}
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);
#elif defined(LIGHT_FALLOFF_STANDARD{X})
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);
#else
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);
#endif
#else
preInfo.attenuation=1.0;
#endif
#ifdef HEMILIGHT{X}
preInfo.roughness=roughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
#ifdef IRIDESCENCE
preInfo.iridescenceIntensity=iridescenceIntensity;
#endif
#ifdef HEMILIGHT{X}
info.diffuse=computeHemisphericDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb,light{X}.vLightGround);
#elif defined(SS_TRANSLUCENCY)
info.diffuse=computeDiffuseAndTransmittedLighting(preInfo,light{X}.vLightDiffuse.rgb,subSurfaceOut.transmittance);
#else
info.diffuse=computeDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb);
#endif
#ifdef SPECULARTERM
#ifdef ANISOTROPIC
info.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);
#else
info.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);
#endif
#endif
#ifdef SHEEN
#ifdef SHEEN_LINKWITHALBEDO
preInfo.roughness=sheenOut.sheenIntensity;
#else
#ifdef HEMILIGHT{X}
preInfo.roughness=sheenOut.sheenRoughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
#endif
info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);
#endif
#ifdef CLEARCOAT
#ifdef HEMILIGHT{X}
preInfo.roughness=clearcoatOut.clearCoatRoughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light{X}.vLightDiffuse.rgb);
#ifdef CLEARCOAT_TINT
absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);
info.diffuse*=absorption;
#ifdef SPECULARTERM
info.specular*=absorption;
#endif
#endif
info.diffuse*=info.clearCoat.w;
#ifdef SPECULARTERM
info.specular*=info.clearCoat.w;
#endif
#ifdef SHEEN
info.sheen*=info.clearCoat.w;
#endif
#endif
#else
#ifdef SPOTLIGHT{X}
info=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);
#elif defined(HEMILIGHT{X})
info=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);
#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})
info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);
#endif
#endif
#ifdef PROJECTEDLIGHTTEXTURE{X}
info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightSampler{X},textureProjectionMatrix{X});
#endif
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) 
{
#ifdef SHADOWCSM_RIGHTHANDED{X}
diff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;
#else
diff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;
#endif
if (diff{X}>=0.) {
index{X}=i;
break;
}
}
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
if (index{X}>=0)
#endif
{
#if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#else
shadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#endif
#else
shadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];
#endif
#ifndef SHADOWCSMNOBLEND{X}
float frustumLength=frustumLengths{X}[index{X}];
float diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};
if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)
{
index{X}+=1;
float nextShadow=0.;
#if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
nextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
nextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
nextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
nextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#elif defined(SHADOWMEDIUMQUALITY{X})
nextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#else
nextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#endif
#else
nextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
shadow=mix(nextShadow,shadow,diffRatio);
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);
#endif
}
#endif
}
#elif defined(SHADOWCLOSEESM{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithCloseESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
#else
shadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWESM{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
#else
shadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPOISSON{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithPoissonSamplingCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);
#else
shadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#else
#if defined(SHADOWCUBE{X})
shadow=computeShadowCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.depthValues);
#else
shadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#endif
#ifdef SHADOWONLY
#ifndef SHADOWINUSE
#define SHADOWINUSE
#endif
globalShadow+=shadow;
shadowLightCount+=1.0;
#endif
#else
shadow=1.;
#endif
#ifndef SHADOWONLY
#ifdef CUSTOMUSERLIGHTING
diffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);
#ifdef SPECULARTERM
specularBase+=computeCustomSpecularLighting(info,specularBase,shadow);
#endif
#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})
diffuseBase+=lightmapColor.rgb*shadow;
#ifdef SPECULARTERM
#ifndef LIGHTMAPNOSPECULAR{X}
specularBase+=info.specular*shadow*lightmapColor.rgb;
#endif
#endif
#ifdef CLEARCOAT
#ifndef LIGHTMAPNOSPECULAR{X}
clearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;
#endif
#endif
#ifdef SHEEN
#ifndef LIGHTMAPNOSPECULAR{X}
sheenBase+=info.sheen.rgb*shadow;
#endif
#endif
#else
#ifdef SHADOWCSMDEBUG{X}
diffuseBase+=info.diffuse*shadowDebug{X};
#else 
diffuseBase+=info.diffuse*shadow;
#endif
#ifdef SPECULARTERM
specularBase+=info.specular*shadow;
#endif
#ifdef CLEARCOAT
clearCoatBase+=info.clearCoat.rgb*shadow;
#endif
#ifdef SHEEN
sheenBase+=info.sheen.rgb*shadow;
#endif
#endif
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.lightFragment */ .v.IncludesShadersStore.lightFragment = shader;const lightFragment = { name: "lightFragment", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export lightFragmentDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "lightFragmentDeclaration",shader = `#ifdef LIGHT{X}
uniform vec4 vLightData{X};
uniform vec4 vLightDiffuse{X};
#ifdef SPECULARTERM
uniform vec4 vLightSpecular{X};
#else
vec4 vLightSpecular{X}=vec4(0.);
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float cascadeBlendFactor{X};
varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];
varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];
varying vec4 vPositionFromCamera{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DArrayShadow shadowSampler{X};
uniform highp sampler2DArray depthSampler{X};
uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float penumbraDarkness{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DArrayShadow shadowSampler{X};
#else
uniform highp sampler2DArray shadowSampler{X};
#endif
#ifdef SHADOWCSMDEBUG{X}
const vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]
(
vec3 ( 1.5,0.0,0.0 ),
vec3 ( 0.0,1.5,0.0 ),
vec3 ( 0.0,0.0,5.5 ),
vec3 ( 1.5,0.0,5.5 ),
vec3 ( 1.5,1.5,0.0 ),
vec3 ( 1.0,1.0,1.0 ),
vec3 ( 0.0,1.0,5.5 ),
vec3 ( 0.5,3.5,0.75 )
);
vec3 shadowDebug{X};
#endif
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
int index{X}=-1;
#else
int index{X}=SHADOWCSMNUM_CASCADES{X}-1;
#endif
float diff{X}=0.;
#elif defined(SHADOWCUBE{X})
uniform samplerCube shadowSampler{X};
#else
varying vec4 vPositionFromLight{X};
varying float vDepthMetric{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DShadow shadowSampler{X};
uniform highp sampler2D depthSampler{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DShadow shadowSampler{X};
#else
uniform sampler2D shadowSampler{X};
#endif
uniform mat4 lightMatrix{X};
#endif
uniform vec4 shadowsInfo{X};
uniform vec2 depthValues{X};
#endif
#ifdef SPOTLIGHT{X}
uniform vec4 vLightDirection{X};
uniform vec4 vLightFalloff{X};
#elif defined(POINTLIGHT{X})
uniform vec4 vLightFalloff{X};
#elif defined(HEMILIGHT{X})
uniform vec3 vLightGround{X};
#endif
#ifdef PROJECTEDLIGHTTEXTURE{X}
uniform mat4 textureProjectionMatrix{X};
uniform sampler2D projectionLightSampler{X};
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.lightFragmentDeclaration */ .v.IncludesShadersStore.lightFragmentDeclaration = shader;const lightFragmentDeclaration = { name: "lightFragmentDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export lightUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "lightUboDeclaration",shader = `#ifdef LIGHT{X}
uniform Light{X}
{
vec4 vLightData;
vec4 vLightDiffuse;
vec4 vLightSpecular;
#ifdef SPOTLIGHT{X}
vec4 vLightDirection;
vec4 vLightFalloff;
#elif defined(POINTLIGHT{X})
vec4 vLightFalloff;
#elif defined(HEMILIGHT{X})
vec3 vLightGround;
#endif
vec4 shadowsInfo;
vec2 depthValues;
} light{X};
#ifdef PROJECTEDLIGHTTEXTURE{X}
uniform mat4 textureProjectionMatrix{X};
uniform sampler2D projectionLightSampler{X};
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float cascadeBlendFactor{X};
varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];
varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];
varying vec4 vPositionFromCamera{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DArrayShadow shadowSampler{X};
uniform highp sampler2DArray depthSampler{X};
uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float penumbraDarkness{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DArrayShadow shadowSampler{X};
#else
uniform highp sampler2DArray shadowSampler{X};
#endif
#ifdef SHADOWCSMDEBUG{X}
const vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]
(
vec3 ( 1.5,0.0,0.0 ),
vec3 ( 0.0,1.5,0.0 ),
vec3 ( 0.0,0.0,5.5 ),
vec3 ( 1.5,0.0,5.5 ),
vec3 ( 1.5,1.5,0.0 ),
vec3 ( 1.0,1.0,1.0 ),
vec3 ( 0.0,1.0,5.5 ),
vec3 ( 0.5,3.5,0.75 )
);
vec3 shadowDebug{X};
#endif
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
int index{X}=-1;
#else
int index{X}=SHADOWCSMNUM_CASCADES{X}-1;
#endif
float diff{X}=0.;
#elif defined(SHADOWCUBE{X})
uniform samplerCube shadowSampler{X}; 
#else
varying vec4 vPositionFromLight{X};
varying float vDepthMetric{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DShadow shadowSampler{X};
uniform highp sampler2D depthSampler{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DShadow shadowSampler{X};
#else
uniform sampler2D shadowSampler{X};
#endif
uniform mat4 lightMatrix{X};
#endif
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.lightUboDeclaration */ .v.IncludesShadersStore.lightUboDeclaration = shader;const lightUboDeclaration = { name: "lightUboDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export lightVxFragmentDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "lightVxFragmentDeclaration",shader = `#ifdef LIGHT{X}
uniform vec4 vLightData{X};
uniform vec4 vLightDiffuse{X};
#ifdef SPECULARTERM
uniform vec4 vLightSpecular{X};
#else
vec4 vLightSpecular{X}=vec4(0.);
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];
varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];
varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];
varying vec4 vPositionFromCamera{X};
#elif defined(SHADOWCUBE{X})
#else
varying vec4 vPositionFromLight{X};
varying float vDepthMetric{X};
uniform mat4 lightMatrix{X};
#endif
uniform vec4 shadowsInfo{X};
uniform vec2 depthValues{X};
#endif
#ifdef SPOTLIGHT{X}
uniform vec4 vLightDirection{X};
uniform vec4 vLightFalloff{X};
#elif defined(POINTLIGHT{X})
uniform vec4 vLightFalloff{X};
#elif defined(HEMILIGHT{X})
uniform vec3 vLightGround{X};
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.lightVxFragmentDeclaration */ .v.IncludesShadersStore.lightVxFragmentDeclaration = shader;const lightVxFragmentDeclaration = { name: "lightVxFragmentDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export lightVxUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "lightVxUboDeclaration",shader = `#ifdef LIGHT{X}
uniform Light{X}
{
vec4 vLightData;
vec4 vLightDiffuse;
vec4 vLightSpecular;
#ifdef SPOTLIGHT{X}
vec4 vLightDirection;
vec4 vLightFalloff;
#elif defined(POINTLIGHT{X})
vec4 vLightFalloff;
#elif defined(HEMILIGHT{X})
vec3 vLightGround;
#endif
vec4 shadowsInfo;
vec2 depthValues;
} light{X};
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];
varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];
varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];
varying vec4 vPositionFromCamera{X};
#elif defined(SHADOWCUBE{X})
#else
varying vec4 vPositionFromLight{X};
varying float vDepthMetric{X};
uniform mat4 lightMatrix{X};
#endif
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.lightVxUboDeclaration */ .v.IncludesShadersStore.lightVxUboDeclaration = shader;const lightVxUboDeclaration = { name: "lightVxUboDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export lightsFragmentFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "lightsFragmentFunctions",shader = `struct lightingInfo
{
vec3 diffuse;
#ifdef SPECULARTERM
vec3 specular;
#endif
#ifdef NDOTL
float ndl;
#endif
};
lightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {
lightingInfo result;
vec3 lightVectorW;
float attenuation=1.0;
if (lightData.w==0.)
{
vec3 direction=lightData.xyz-vPositionW;
attenuation=max(0.,1.0-length(direction)/range);
lightVectorW=normalize(direction);
}
else
{
lightVectorW=normalize(-lightData.xyz);
}
float ndl=max(0.,dot(vNormal,lightVectorW));
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=ndl*diffuseColor*attenuation;
#ifdef SPECULARTERM
vec3 angleW=normalize(viewDirectionW+lightVectorW);
float specComp=max(0.,dot(vNormal,angleW));
specComp=pow(specComp,max(1.,glossiness));
result.specular=specComp*specularColor*attenuation;
#endif
return result;
}
lightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {
lightingInfo result;
vec3 direction=lightData.xyz-vPositionW;
vec3 lightVectorW=normalize(direction);
float attenuation=max(0.,1.0-length(direction)/range);
float cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));
if (cosAngle>=lightDirection.w)
{
cosAngle=max(0.,pow(cosAngle,lightData.w));
attenuation*=cosAngle;
float ndl=max(0.,dot(vNormal,lightVectorW));
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=ndl*diffuseColor*attenuation;
#ifdef SPECULARTERM
vec3 angleW=normalize(viewDirectionW+lightVectorW);
float specComp=max(0.,dot(vNormal,angleW));
specComp=pow(specComp,max(1.,glossiness));
result.specular=specComp*specularColor*attenuation;
#endif
return result;
}
result.diffuse=vec3(0.);
#ifdef SPECULARTERM
result.specular=vec3(0.);
#endif
#ifdef NDOTL
result.ndl=0.;
#endif
return result;
}
lightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {
lightingInfo result;
float ndl=dot(vNormal,lightData.xyz)*0.5+0.5;
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=mix(groundColor,diffuseColor,ndl);
#ifdef SPECULARTERM
vec3 angleW=normalize(viewDirectionW+lightData.xyz);
float specComp=max(0.,dot(vNormal,angleW));
specComp=pow(specComp,max(1.,glossiness));
result.specular=specComp*specularColor;
#endif
return result;
}
#define inline
vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){
vec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);
strq/=strq.w;
vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;
return textureColor;
}`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.lightsFragmentFunctions */ .v.IncludesShadersStore.lightsFragmentFunctions = shader;const lightsFragmentFunctions = { name: "lightsFragmentFunctions", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export logDepthDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "logDepthDeclaration",shader = `#ifdef LOGARITHMICDEPTH
uniform float logarithmicDepthConstant;
varying float vFragmentDepth;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.logDepthDeclaration */ .v.IncludesShadersStore.logDepthDeclaration = shader;const logDepthDeclaration = { name: "logDepthDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export logDepthFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "logDepthFragment",shader = `#ifdef LOGARITHMICDEPTH
gl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.logDepthFragment */ .v.IncludesShadersStore.logDepthFragment = shader;const logDepthFragment = { name: "logDepthFragment", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export logDepthVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "logDepthVertex",shader = `#ifdef LOGARITHMICDEPTH
vFragmentDepth=1.0+gl_Position.w;
gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.logDepthVertex */ .v.IncludesShadersStore.logDepthVertex = shader;const logDepthVertex = { name: "logDepthVertex", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export mainUVVaryingDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "mainUVVaryingDeclaration",shader = `#ifdef MAINUV{X}
varying vec2 vMainUV{X};
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.mainUVVaryingDeclaration */ .v.IncludesShadersStore.mainUVVaryingDeclaration = shader;const mainUVVaryingDeclaration = { name: "mainUVVaryingDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export meshUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "meshUboDeclaration",shader = `#ifdef WEBGL2
uniform mat4 world;
uniform float visibility;
#else
layout(std140,column_major) uniform;
uniform Mesh
{
mat4 world;
float visibility;
};
#endif
#define WORLD_UBO
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.meshUboDeclaration */ .v.IncludesShadersStore.meshUboDeclaration = shader;const meshUboDeclaration = { name: "meshUboDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export morphTargetsVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "morphTargetsVertex",shader = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE 
vertexID=float(gl_VertexID)*morphTargetTextureInfo.x;
positionUpdated+=(readVector3FromRawSampler({X},vertexID)-position)*morphTargetInfluences[{X}];
vertexID+=1.0;
#ifdef MORPHTARGETS_NORMAL
normalUpdated+=(readVector3FromRawSampler({X},vertexID) -normal)*morphTargetInfluences[{X}];
vertexID+=1.0;
#endif
#ifdef MORPHTARGETS_UV
uvUpdated+=(readVector3FromRawSampler({X},vertexID).xy-uv)*morphTargetInfluences[{X}];
vertexID+=1.0;
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz+=(readVector3FromRawSampler({X},vertexID) -tangent.xyz)*morphTargetInfluences[{X}];
#endif
#else
positionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];
#ifdef MORPHTARGETS_NORMAL
normalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_UV
uvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];
#endif
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.morphTargetsVertex */ .v.IncludesShadersStore.morphTargetsVertex = shader;const morphTargetsVertex = { name: "morphTargetsVertex", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export morphTargetsVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "morphTargetsVertexDeclaration",shader = `#ifdef MORPHTARGETS
#ifndef MORPHTARGETS_TEXTURE
attribute vec3 position{X};
#ifdef MORPHTARGETS_NORMAL
attribute vec3 normal{X};
#endif
#ifdef MORPHTARGETS_TANGENT
attribute vec3 tangent{X};
#endif
#ifdef MORPHTARGETS_UV
attribute vec2 uv_{X};
#endif
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.morphTargetsVertexDeclaration */ .v.IncludesShadersStore.morphTargetsVertexDeclaration = shader;const morphTargetsVertexDeclaration = { name: "morphTargetsVertexDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export morphTargetsVertexGlobal */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "morphTargetsVertexGlobal",shader = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE
float vertexID;
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.morphTargetsVertexGlobal */ .v.IncludesShadersStore.morphTargetsVertexGlobal = shader;const morphTargetsVertexGlobal = { name: "morphTargetsVertexGlobal", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export morphTargetsVertexGlobalDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "morphTargetsVertexGlobalDeclaration",shader = `#ifdef MORPHTARGETS
uniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];
#ifdef MORPHTARGETS_TEXTURE 
precision mediump sampler2DArray; 
uniform float morphTargetTextureIndices[NUM_MORPH_INFLUENCERS];
uniform vec3 morphTargetTextureInfo;
uniform sampler2DArray morphTargets;
vec3 readVector3FromRawSampler(int targetIndex,float vertexIndex)
{ 
float y=floor(vertexIndex/morphTargetTextureInfo.y);
float x=vertexIndex-y*morphTargetTextureInfo.y;
vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);
return texture(morphTargets,textureUV).xyz;
}
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.morphTargetsVertexGlobalDeclaration */ .v.IncludesShadersStore.morphTargetsVertexGlobalDeclaration = shader;const morphTargetsVertexGlobalDeclaration = { name: "morphTargetsVertexGlobalDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export oitDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "oitDeclaration",shader = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY
#extension GL_EXT_draw_buffers : require
layout(location=0) out vec2 depth; 
layout(location=1) out vec4 frontColor;
layout(location=2) out vec4 backColor;
#define MAX_DEPTH 99999.0
highp vec4 gl_FragColor;
uniform sampler2D oitDepthSampler;
uniform sampler2D oitFrontColorSampler;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.oitDeclaration */ .v.IncludesShadersStore.oitDeclaration = shader;const oitDeclaration = { name: "oitDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitFragment.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export oitFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "oitFragment",shader = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY
float fragDepth=gl_FragCoord.z; 
#ifdef ORDER_INDEPENDENT_TRANSPARENCY_16BITS
uint halfFloat=packHalf2x16(vec2(fragDepth));
vec2 full=unpackHalf2x16(halfFloat);
fragDepth=full.x;
#endif
ivec2 fragCoord=ivec2(gl_FragCoord.xy);
vec2 lastDepth=texelFetch(oitDepthSampler,fragCoord,0).rg;
vec4 lastFrontColor=texelFetch(oitFrontColorSampler,fragCoord,0);
depth.rg=vec2(-MAX_DEPTH);
frontColor=lastFrontColor;
backColor=vec4(0.0);
#ifdef USE_REVERSE_DEPTHBUFFER
float furthestDepth=-lastDepth.x;
float nearestDepth=lastDepth.y;
#else
float nearestDepth=-lastDepth.x;
float furthestDepth=lastDepth.y;
#endif
float alphaMultiplier=1.0-lastFrontColor.a;
#ifdef USE_REVERSE_DEPTHBUFFER
if (fragDepth>nearestDepth || fragDepth<furthestDepth) {
#else
if (fragDepth<nearestDepth || fragDepth>furthestDepth) {
#endif
return;
}
#ifdef USE_REVERSE_DEPTHBUFFER
if (fragDepth<nearestDepth && fragDepth>furthestDepth) {
#else
if (fragDepth>nearestDepth && fragDepth<furthestDepth) {
#endif
depth.rg=vec2(-fragDepth,fragDepth);
return;
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.oitFragment */ .v.IncludesShadersStore.oitFragment = shader;const oitFragment = { name: "oitFragment", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBRDFFunctions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export pbrBRDFFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "pbrBRDFFunctions",shader = `#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
#ifdef MS_BRDF_ENERGY_CONSERVATION
vec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {
return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);
}
#endif
#ifdef ENVIRONMENTBRDF
vec3 getBRDFLookup(float NdotV,float perceptualRoughness) {
vec2 UV=vec2(NdotV,perceptualRoughness);
vec4 brdfLookup=texture2D(environmentBrdfSampler,UV);
#ifdef ENVIRONMENTBRDF_RGBD
brdfLookup.rgb=fromRGBD(brdfLookup.rgba);
#endif
return brdfLookup.rgb;
}
vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {
#ifdef BRDF_V_HEIGHT_CORRELATED
vec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;
#else
vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;
#endif
return reflectance;
}
vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {
#ifdef BRDF_V_HEIGHT_CORRELATED
vec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);
#else
vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;
#endif
return reflectance;
}
#endif
/* NOT USED
#if defined(SHEEN) && defined(SHEEN_SOFTER)
float getBRDFLookupCharlieSheen(float NdotV,float perceptualRoughness)
{
float c=1.0-NdotV;
float c3=c*c*c;
return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));
}
#endif
*/
#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)
vec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)
{
float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);
return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));
}
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF)
/**
* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.
* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table
*/
vec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {
vec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;
return sheenEnvironmentReflectance;
}
#endif
vec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)
{
return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);
}
float fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)
{
return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);
}
#ifdef CLEARCOAT
vec3 getR0RemappedForClearCoat(vec3 f0) {
#ifdef CLEARCOAT_DEFAULTIOR
#ifdef MOBILE
return saturate(f0*(f0*0.526868+0.529324)-0.0482256);
#else
return saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);
#endif
#else
vec3 s=sqrt(f0);
vec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);
return square(t);
#endif
}
#endif
#ifdef IRIDESCENCE
const mat3 XYZ_TO_REC709=mat3(
3.2404542,-0.9692660, 0.0556434,
-1.5371385, 1.8760108,-0.2040259,
-0.4985314, 0.0415560, 1.0572252
);
vec3 getIORTfromAirToSurfaceR0(vec3 f0) {
vec3 sqrtF0=sqrt(f0);
return (1.+sqrtF0)/(1.-sqrtF0);
}
vec3 getR0fromIORs(vec3 iorT,float iorI) {
return square((iorT-vec3(iorI))/(iorT+vec3(iorI)));
}
float getR0fromIORs(float iorT,float iorI) {
return square((iorT-iorI)/(iorT+iorI));
}
vec3 evalSensitivity(float opd,vec3 shift) {
float phase=2.0*PI*opd*1.0e-9;
const vec3 val=vec3(5.4856e-13,4.4201e-13,5.2481e-13);
const vec3 pos=vec3(1.6810e+06,1.7953e+06,2.2084e+06);
const vec3 var=vec3(4.3278e+09,9.3046e+09,6.6121e+09);
vec3 xyz=val*sqrt(2.0*PI*var)*cos(pos*phase+shift)*exp(-square(phase)*var);
xyz.x+=9.7470e-14*sqrt(2.0*PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*square(phase));
xyz/=1.0685e-7;
vec3 srgb=XYZ_TO_REC709*xyz;
return srgb;
}
vec3 evalIridescence(float outsideIOR,float eta2,float cosTheta1,float thinFilmThickness,vec3 baseF0) {
vec3 I=vec3(1.0);
float iridescenceIOR=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));
float sinTheta2Sq=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));
float cosTheta2Sq=1.0-sinTheta2Sq;
if (cosTheta2Sq<0.0) {
return I;
}
float cosTheta2=sqrt(cosTheta2Sq);
float R0=getR0fromIORs(iridescenceIOR,outsideIOR);
float R12=fresnelSchlickGGX(cosTheta1,R0,1.);
float R21=R12;
float T121=1.0-R12;
float phi12=0.0;
if (iridescenceIOR<outsideIOR) phi12=PI;
float phi21=PI-phi12;
vec3 baseIOR=getIORTfromAirToSurfaceR0(clamp(baseF0,0.0,0.9999)); 
vec3 R1=getR0fromIORs(baseIOR,iridescenceIOR);
vec3 R23=fresnelSchlickGGX(cosTheta2,R1,vec3(1.));
vec3 phi23=vec3(0.0);
if (baseIOR[0]<iridescenceIOR) phi23[0]=PI;
if (baseIOR[1]<iridescenceIOR) phi23[1]=PI;
if (baseIOR[2]<iridescenceIOR) phi23[2]=PI;
float opd=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;
vec3 phi=vec3(phi21)+phi23;
vec3 R123=clamp(R12*R23,1e-5,0.9999);
vec3 r123=sqrt(R123);
vec3 Rs=square(T121)*R23/(vec3(1.0)-R123);
vec3 C0=R12+Rs;
I=C0;
vec3 Cm=Rs-T121;
for (int m=1; m<=2; ++m)
{
Cm*=r123;
vec3 Sm=2.0*evalSensitivity(float(m)*opd,float(m)*phi);
I+=Cm*Sm;
}
return max(I,vec3(0.0));
}
#endif
float normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)
{
float a2=square(alphaG);
float d=NdotH*NdotH*(a2-1.0)+1.0;
return a2/(PI*d*d);
}
#ifdef SHEEN
float normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)
{
float invR=1./alphaG;
float cos2h=NdotH*NdotH;
float sin2h=1.-cos2h;
return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);
}
#endif
#ifdef ANISOTROPIC
float normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {
float a2=alphaTB.x*alphaTB.y;
vec3 v=vec3(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);
float v2=dot(v,v);
float w2=a2/v2;
return a2*w2*w2*RECIPROCAL_PI;
}
#endif
#ifdef BRDF_V_HEIGHT_CORRELATED
float smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {
#ifdef MOBILE
float GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);
float GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);
return 0.5/(GGXV+GGXL);
#else
float a2=alphaG*alphaG;
float GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);
float GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);
return 0.5/(GGXV+GGXL);
#endif
}
#else
float smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)
{
#ifdef MOBILE
return 1.0/(dot+alphaG+(1.0-alphaG)*dot ));
#else
float alphaSquared=alphaG*alphaG;
return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));
#endif
}
float smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)
{
float visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);
return visibility;
}
#endif
#ifdef ANISOTROPIC
float smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {
float lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));
float lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));
float v=0.5/(lambdaV+lambdaL);
return v;
}
#endif
#ifdef CLEARCOAT
float visibility_Kelemen(float VdotH) {
return 0.25/(VdotH*VdotH); 
}
#endif
#ifdef SHEEN
float visibility_Ashikhmin(float NdotL,float NdotV)
{
return 1./(4.*(NdotL+NdotV-NdotL*NdotV));
}
/* NOT USED
#ifdef SHEEN_SOFTER
float l(float x,float alphaG)
{
float oneMinusAlphaSq=(1.0-alphaG)*(1.0-alphaG);
float a=mix(21.5473,25.3245,oneMinusAlphaSq);
float b=mix(3.82987,3.32435,oneMinusAlphaSq);
float c=mix(0.19823,0.16801,oneMinusAlphaSq);
float d=mix(-1.97760,-1.27393,oneMinusAlphaSq);
float e=mix(-4.32054,-4.85967,oneMinusAlphaSq);
return a/(1.0+b*pow(x,c))+d*x+e;
}
float lambdaSheen(float cosTheta,float alphaG)
{
return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));
}
float visibility_CharlieSheen(float NdotL,float NdotV,float alphaG)
{
float G=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));
return G/(4.0*NdotV*NdotL);
}
#endif
*/
#endif
float diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {
float diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));
float diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));
float diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;
float fresnel =
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);
return fresnel/PI;
}
#ifdef SS_TRANSLUCENCY
vec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {
vec3 S=1./maxEps(diffusionDistance);
vec3 temp=exp((-0.333333333*thickness)*S);
return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);
}
float computeWrappedDiffuseNdotL(float NdotL,float w) {
float t=1.0+w;
float invt2=1.0/square(t);
return saturate((NdotL+w)*invt2);
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.pbrBRDFFunctions */ .v.IncludesShadersStore.pbrBRDFFunctions = shader;const pbrBRDFFunctions = { name: "pbrBRDFFunctions", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export prePassDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "prePassDeclaration",shader = `#ifdef PREPASS
#extension GL_EXT_draw_buffers : require
layout(location=0) out highp vec4 glFragData[{X}];highp vec4 gl_FragColor;
#ifdef PREPASS_DEPTH
varying highp vec3 vViewPos;
#endif
#ifdef PREPASS_VELOCITY
varying highp vec4 vCurrentPosition;varying highp vec4 vPreviousPosition;
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.prePassDeclaration */ .v.IncludesShadersStore.prePassDeclaration = shader;const prePassDeclaration = { name: "prePassDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export prePassVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "prePassVertex",shader = `#ifdef PREPASS_DEPTH
vViewPos=(view*worldPos).rgb;
#endif
#if defined(PREPASS_VELOCITY) && defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*worldPos;
#if NUM_BONE_INFLUENCERS>0
mat4 previousInfluence;
previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);
#else
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.prePassVertex */ .v.IncludesShadersStore.prePassVertex = shader;const prePassVertex = { name: "prePassVertex", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export prePassVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "prePassVertexDeclaration",shader = `#ifdef PREPASS
#ifdef PREPASS_DEPTH
varying vec3 vViewPos;
#endif
#ifdef PREPASS_VELOCITY
uniform mat4 previousViewProjection;
varying vec4 vCurrentPosition;
varying vec4 vPreviousPosition;
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.prePassVertexDeclaration */ .v.IncludesShadersStore.prePassVertexDeclaration = shader;const prePassVertexDeclaration = { name: "prePassVertexDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export reflectionFunction */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "reflectionFunction",shader = `vec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)
{
float lon=atan(direction.z,direction.x);
float lat=acos(direction.y);
vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;
float s=sphereCoords.x*0.5+0.5;
float t=sphereCoords.y;
return vec3(s,t,0); 
}
vec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)
{
float lon=atan(direction.z,direction.x);
float lat=acos(direction.y);
vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;
float s=sphereCoords.x*0.5+0.5;
float t=sphereCoords.y;
return vec3(1.0-s,t,0); 
}
vec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
{
vec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);
vec3 r=normalize(reflect(cameraToVertex,worldNormal));
r=vec3(reflectionMatrix*vec4(r,0));
float lon=atan(r.z,r.x);
float lat=acos(r.y);
vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;
float s=sphereCoords.x*0.5+0.5;
float t=sphereCoords.y;
return vec3(s,t,0);
}
vec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix)
{
vec3 viewDir=normalize(vec3(view*worldPos));
vec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));
vec3 r=reflect(viewDir,viewNormal);
r=vec3(reflectionMatrix*vec4(r,0));
r.z=r.z-1.0;
float m=2.0*length(r);
return vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);
}
vec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
{
vec3 viewDir=worldPos.xyz-eyePosition;
vec3 coords=normalize(reflect(viewDir,worldNormal));
return vec3(reflectionMatrix*vec4(coords,1));
}
vec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
{
vec3 viewDir=normalize(worldPos.xyz-eyePosition);
vec3 coords=reflect(viewDir,worldNormal);
coords=vec3(reflectionMatrix*vec4(coords,0));
#ifdef INVERTCUBICMAP
coords.y*=-1.0;
#endif
return coords;
}
vec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition)
{
vec3 viewDir=normalize(worldPos.xyz-eyePosition);
vec3 coords=reflect(viewDir,worldNormal);
coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);
coords=vec3(reflectionMatrix*vec4(coords,0));
#ifdef INVERTCUBICMAP
coords.y*=-1.0;
#endif
return coords;
}
vec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix)
{
return vec3(reflectionMatrix*(view*worldPos));
}
vec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix)
{
return vec3(reflectionMatrix*vec4(positionW,1.));
}
#ifdef REFLECTION
vec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)
{
#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED
vec3 direction=normalize(vDirectionW);
return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);
#endif
#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED
vec3 direction=normalize(vDirectionW);
return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);
#endif
#ifdef REFLECTIONMAP_EQUIRECTANGULAR
return computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_SPHERICAL
return computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_PLANAR
return computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_CUBIC
#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC
return computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);
#else
return computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
#endif
#endif
#ifdef REFLECTIONMAP_PROJECTION
return computeProjectionCoords(worldPos,view,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_SKYBOX
return computeSkyBoxCoords(vPositionUVW,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_EXPLICIT
return vec3(0,0,0);
#endif
}
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.reflectionFunction */ .v.IncludesShadersStore.reflectionFunction = shader;const reflectionFunction = { name: "reflectionFunction", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export samplerFragmentDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "samplerFragmentDeclaration",shader = `#ifdef _DEFINENAME_
#if _DEFINENAME_DIRECTUV==1
#define v_VARYINGNAME_UV vMainUV1
#elif _DEFINENAME_DIRECTUV==2
#define v_VARYINGNAME_UV vMainUV2
#elif _DEFINENAME_DIRECTUV==3
#define v_VARYINGNAME_UV vMainUV3
#elif _DEFINENAME_DIRECTUV==4
#define v_VARYINGNAME_UV vMainUV4
#elif _DEFINENAME_DIRECTUV==5
#define v_VARYINGNAME_UV vMainUV5
#elif _DEFINENAME_DIRECTUV==6
#define v_VARYINGNAME_UV vMainUV6
#else
varying vec2 v_VARYINGNAME_UV;
#endif
uniform sampler2D _SAMPLERNAME_Sampler;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.samplerFragmentDeclaration */ .v.IncludesShadersStore.samplerFragmentDeclaration = shader;const samplerFragmentDeclaration = { name: "samplerFragmentDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export samplerVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "samplerVertexDeclaration",shader = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
varying vec2 v_VARYINGNAME_UV;
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.samplerVertexDeclaration */ .v.IncludesShadersStore.samplerVertexDeclaration = shader;const samplerVertexDeclaration = { name: "samplerVertexDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export samplerVertexImplementation */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "samplerVertexImplementation",shader = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
if (v_INFONAME_==0.)
{
v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uvUpdated,1.0,0.0));
}
#ifdef UV2
else if (v_INFONAME_==1.)
{
v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv2,1.0,0.0));
}
#endif
#ifdef UV3
else if (v_INFONAME_==2.)
{
v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv3,1.0,0.0));
}
#endif
#ifdef UV4
else if (v_INFONAME_==3.)
{
v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv4,1.0,0.0));
}
#endif
#ifdef UV5
else if (v_INFONAME_==4.)
{
v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv5,1.0,0.0));
}
#endif
#ifdef UV6
else if (v_INFONAME_==5.)
{
v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv6,1.0,0.0));
}
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.samplerVertexImplementation */ .v.IncludesShadersStore.samplerVertexImplementation = shader;const samplerVertexImplementation = { name: "samplerVertexImplementation", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export sceneUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "sceneUboDeclaration",shader = `layout(std140,column_major) uniform;
uniform Scene {
mat4 viewProjection;
#ifdef MULTIVIEW
mat4 viewProjectionR;
#endif 
mat4 view;
mat4 projection;
vec4 vEyePosition;
};
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.sceneUboDeclaration */ .v.IncludesShadersStore.sceneUboDeclaration = shader;const sceneUboDeclaration = { name: "sceneUboDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export shadowsFragmentFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "shadowsFragmentFunctions",shader = `#ifdef SHADOWS
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)
#else
#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)
#endif
#ifndef SHADOWFLOAT
float unpack(vec4 color)
{
const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);
return dot(color,bit_shift);
}
#endif
float computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)
{
float mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));
return mix(value,1.0,mask);
}
#define inline
float computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)
{
vec3 directionToLight=vPositionW-lightPosition;
float depth=length(directionToLight);
depth=(depth+depthValues.x)/(depthValues.y);
depth=clamp(depth,0.,1.0);
directionToLight=normalize(directionToLight);
directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
float shadow=unpack(textureCube(shadowSampler,directionToLight));
#else
float shadow=textureCube(shadowSampler,directionToLight).x;
#endif
return depth>shadow ? darkness : 1.0;
}
#define inline
float computeShadowWithPoissonSamplingCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)
{
vec3 directionToLight=vPositionW-lightPosition;
float depth=length(directionToLight);
depth=(depth+depthValues.x)/(depthValues.y);
depth=clamp(depth,0.,1.0);
directionToLight=normalize(directionToLight);
directionToLight.y=-directionToLight.y;
float visibility=1.;
vec3 poissonDisk[4];
poissonDisk[0]=vec3(-1.0,1.0,-1.0);
poissonDisk[1]=vec3(1.0,-1.0,-1.0);
poissonDisk[2]=vec3(-1.0,-1.0,-1.0);
poissonDisk[3]=vec3(1.0,-1.0,1.0);
#ifndef SHADOWFLOAT
if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;
if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;
if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;
if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;
#else
if (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;
if (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;
if (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;
if (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;
#endif
return min(1.0,visibility+darkness);
}
#define inline
float computeShadowWithESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)
{
vec3 directionToLight=vPositionW-lightPosition;
float depth=length(directionToLight);
depth=(depth+depthValues.x)/(depthValues.y);
float shadowPixelDepth=clamp(depth,0.,1.0);
directionToLight=normalize(directionToLight);
directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));
#else
float shadowMapSample=textureCube(shadowSampler,directionToLight).x;
#endif
float esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness); 
return esm;
}
#define inline
float computeShadowWithCloseESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)
{
vec3 directionToLight=vPositionW-lightPosition;
float depth=length(directionToLight);
depth=(depth+depthValues.x)/(depthValues.y);
float shadowPixelDepth=clamp(depth,0.,1.0);
directionToLight=normalize(directionToLight);
directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));
#else
float shadowMapSample=textureCube(shadowSampler,directionToLight).x;
#endif
float esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);
return esm;
}
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define inline
float computeShadowCSM(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray shadowSampler,float darkness,float frustumEdgeFalloff)
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec2 uv=0.5*clipSpace.xy+vec2(0.5);
vec3 uvLayer=vec3(uv.x,uv.y,layer);
float shadowPixelDepth=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
float shadow=unpack(texture2D(shadowSampler,uvLayer));
#else
float shadow=texture2D(shadowSampler,uvLayer).x;
#endif
return shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;
}
#endif
#define inline
float computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec2 uv=0.5*clipSpace.xy+vec2(0.5);
if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{
return 1.0;
}
else
{
float shadowPixelDepth=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
float shadow=unpack(TEXTUREFUNC(shadowSampler,uv,0.));
#else
float shadow=TEXTUREFUNC(shadowSampler,uv,0.).x;
#endif
return shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;
}
}
#define inline
float computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec2 uv=0.5*clipSpace.xy+vec2(0.5);
if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{
return 1.0;
}
else
{
float shadowPixelDepth=clamp(depthMetric,0.,1.0);
float visibility=1.;
vec2 poissonDisk[4];
poissonDisk[0]=vec2(-0.94201624,-0.39906216);
poissonDisk[1]=vec2(0.94558609,-0.76890725);
poissonDisk[2]=vec2(-0.094184101,-0.92938870);
poissonDisk[3]=vec2(0.34495938,0.29387760);
#ifndef SHADOWFLOAT
if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;
if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[1]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;
if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[2]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;
if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[3]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;
#else
if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;
if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[1]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;
if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[2]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;
if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[3]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;
#endif
return computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);
}
}
#define inline
float computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec2 uv=0.5*clipSpace.xy+vec2(0.5);
if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{
return 1.0;
}
else
{
float shadowPixelDepth=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));
#else
float shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;
#endif
float esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);
return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);
}
}
#define inline
float computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec2 uv=0.5*clipSpace.xy+vec2(0.5);
if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{
return 1.0;
}
else
{
float shadowPixelDepth=clamp(depthMetric,0.,1.0); 
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));
#else
float shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;
#endif
float esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);
return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);
}
}
#ifdef IS_NDC_HALF_ZRANGE
#define ZINCLIP clipSpace.z
#else
#define ZINCLIP uvDepth.z
#endif
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define GREATEST_LESS_THAN_ONE 0.99999994
#define inline
float computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));
uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);
vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);
float shadow=texture2D(shadowSampler,uvDepthLayer);
shadow=mix(darkness,1.,shadow);
return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);
}
#define inline
float computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));
uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);
vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=3.-2.*st;
vec2 uvw1=1.+2.*st;
vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;
vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;
float shadow=0.;
shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));
shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));
shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));
shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));
shadow=shadow/16.;
shadow=mix(darkness,1.,shadow);
return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);
}
#define inline
float computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));
uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);
vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=4.-3.*st;
vec2 uvw1=vec2(7.);
vec2 uvw2=1.+3.*st;
vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;
vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;
float shadow=0.;
shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));
shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));
shadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));
shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));
shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));
shadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));
shadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));
shadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));
shadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));
shadow=shadow/144.;
shadow=mix(darkness,1.,shadow);
return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);
}
#define inline
float computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)
{
if (depthMetric>1.0 || depthMetric<0.0) {
return 1.0;
}
else
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));
uvDepth.z=ZINCLIP;
float shadow=TEXTUREFUNC(shadowSampler,uvDepth,0.);
shadow=mix(darkness,1.,shadow);
return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);
}
}
#define inline
float computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{
if (depthMetric>1.0 || depthMetric<0.0) {
return 1.0;
}
else
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));
uvDepth.z=ZINCLIP;
vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=3.-2.*st;
vec2 uvw1=1.+2.*st;
vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;
vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;
float shadow=0.;
shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);
shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);
shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);
shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);
shadow=shadow/16.;
shadow=mix(darkness,1.,shadow);
return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);
}
}
#define inline
float computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{
if (depthMetric>1.0 || depthMetric<0.0) {
return 1.0;
}
else
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));
uvDepth.z=ZINCLIP;
vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=4.-3.*st;
vec2 uvw1=vec2(7.);
vec2 uvw2=1.+3.*st;
vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;
vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;
float shadow=0.;
shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);
shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);
shadow+=uvw2.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z),0.);
shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);
shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);
shadow+=uvw2.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z),0.);
shadow+=uvw0.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z),0.);
shadow+=uvw1.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z),0.);
shadow+=uvw2.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z),0.);
shadow=shadow/144.;
shadow=mix(darkness,1.,shadow);
return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);
}
}
const vec3 PoissonSamplers32[64]=vec3[64](
vec3(0.06407013,0.05409927,0.),
vec3(0.7366577,0.5789394,0.),
vec3(-0.6270542,-0.5320278,0.),
vec3(-0.4096107,0.8411095,0.),
vec3(0.6849564,-0.4990818,0.),
vec3(-0.874181,-0.04579735,0.),
vec3(0.9989998,0.0009880066,0.),
vec3(-0.004920578,-0.9151649,0.),
vec3(0.1805763,0.9747483,0.),
vec3(-0.2138451,0.2635818,0.),
vec3(0.109845,0.3884785,0.),
vec3(0.06876755,-0.3581074,0.),
vec3(0.374073,-0.7661266,0.),
vec3(0.3079132,-0.1216763,0.),
vec3(-0.3794335,-0.8271583,0.),
vec3(-0.203878,-0.07715034,0.),
vec3(0.5912697,0.1469799,0.),
vec3(-0.88069,0.3031784,0.),
vec3(0.5040108,0.8283722,0.),
vec3(-0.5844124,0.5494877,0.),
vec3(0.6017799,-0.1726654,0.),
vec3(-0.5554981,0.1559997,0.),
vec3(-0.3016369,-0.3900928,0.),
vec3(-0.5550632,-0.1723762,0.),
vec3(0.925029,0.2995041,0.),
vec3(-0.2473137,0.5538505,0.),
vec3(0.9183037,-0.2862392,0.),
vec3(0.2469421,0.6718712,0.),
vec3(0.3916397,-0.4328209,0.),
vec3(-0.03576927,-0.6220032,0.),
vec3(-0.04661255,0.7995201,0.),
vec3(0.4402924,0.3640312,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.),
vec3(0.,0.,0.)
);
const vec3 PoissonSamplers64[64]=vec3[64](
vec3(-0.613392,0.617481,0.),
vec3(0.170019,-0.040254,0.),
vec3(-0.299417,0.791925,0.),
vec3(0.645680,0.493210,0.),
vec3(-0.651784,0.717887,0.),
vec3(0.421003,0.027070,0.),
vec3(-0.817194,-0.271096,0.),
vec3(-0.705374,-0.668203,0.),
vec3(0.977050,-0.108615,0.),
vec3(0.063326,0.142369,0.),
vec3(0.203528,0.214331,0.),
vec3(-0.667531,0.326090,0.),
vec3(-0.098422,-0.295755,0.),
vec3(-0.885922,0.215369,0.),
vec3(0.566637,0.605213,0.),
vec3(0.039766,-0.396100,0.),
vec3(0.751946,0.453352,0.),
vec3(0.078707,-0.715323,0.),
vec3(-0.075838,-0.529344,0.),
vec3(0.724479,-0.580798,0.),
vec3(0.222999,-0.215125,0.),
vec3(-0.467574,-0.405438,0.),
vec3(-0.248268,-0.814753,0.),
vec3(0.354411,-0.887570,0.),
vec3(0.175817,0.382366,0.),
vec3(0.487472,-0.063082,0.),
vec3(-0.084078,0.898312,0.),
vec3(0.488876,-0.783441,0.),
vec3(0.470016,0.217933,0.),
vec3(-0.696890,-0.549791,0.),
vec3(-0.149693,0.605762,0.),
vec3(0.034211,0.979980,0.),
vec3(0.503098,-0.308878,0.),
vec3(-0.016205,-0.872921,0.),
vec3(0.385784,-0.393902,0.),
vec3(-0.146886,-0.859249,0.),
vec3(0.643361,0.164098,0.),
vec3(0.634388,-0.049471,0.),
vec3(-0.688894,0.007843,0.),
vec3(0.464034,-0.188818,0.),
vec3(-0.440840,0.137486,0.),
vec3(0.364483,0.511704,0.),
vec3(0.034028,0.325968,0.),
vec3(0.099094,-0.308023,0.),
vec3(0.693960,-0.366253,0.),
vec3(0.678884,-0.204688,0.),
vec3(0.001801,0.780328,0.),
vec3(0.145177,-0.898984,0.),
vec3(0.062655,-0.611866,0.),
vec3(0.315226,-0.604297,0.),
vec3(-0.780145,0.486251,0.),
vec3(-0.371868,0.882138,0.),
vec3(0.200476,0.494430,0.),
vec3(-0.494552,-0.711051,0.),
vec3(0.612476,0.705252,0.),
vec3(-0.578845,-0.768792,0.),
vec3(-0.772454,-0.090976,0.),
vec3(0.504440,0.372295,0.),
vec3(0.155736,0.065157,0.),
vec3(0.391522,0.849605,0.),
vec3(-0.620106,-0.328104,0.),
vec3(0.789239,-0.419965,0.),
vec3(-0.545396,0.538133,0.),
vec3(-0.178564,-0.596057,0.)
);
#define inline
float computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));
uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);
vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);
float blockerDepth=0.0;
float sumBlockerDepth=0.0;
float numBlocker=0.0;
for (int i=0; i<searchTapCount; i ++) {
blockerDepth=texture2D(depthSampler,vec3(uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer)).r;
if (blockerDepth<depthMetric) {
sumBlockerDepth+=blockerDepth;
numBlocker++;
}
}
float avgBlockerDepth=sumBlockerDepth/numBlocker;
float AAOffset=shadowMapSizeInverse*10.;
float penumbraRatio=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);
vec4 filterRadius=vec4(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);
float random=getRand(vPositionFromLight.xy);
float rotationAngle=random*3.1415926;
vec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));
float shadow=0.;
for (int i=0; i<pcfTapCount; i++) {
vec4 offset=vec4(poissonSamplers[i],0.);
offset=vec4(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);
shadow+=texture2D(shadowSampler,uvDepthLayer+offset*filterRadius);
}
shadow/=float(pcfTapCount);
shadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));
shadow=mix(darkness,1.,shadow);
if (numBlocker<1.0) {
return 1.0;
}
else
{
return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);
}
}
#define inline
float computeShadowWithPCSS(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers)
{
if (depthMetric>1.0 || depthMetric<0.0) {
return 1.0;
}
else
{
vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;
vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));
uvDepth.z=ZINCLIP;
float blockerDepth=0.0;
float sumBlockerDepth=0.0;
float numBlocker=0.0;
for (int i=0; i<searchTapCount; i ++) {
blockerDepth=TEXTUREFUNC(depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy),0.).r;
if (blockerDepth<depthMetric) {
sumBlockerDepth+=blockerDepth;
numBlocker++;
}
}
if (numBlocker<1.0) {
return 1.0;
}
else
{
float avgBlockerDepth=sumBlockerDepth/numBlocker;
float AAOffset=shadowMapSizeInverse*10.;
float penumbraRatio=((depthMetric-avgBlockerDepth)+AAOffset);
float filterRadius=penumbraRatio*lightSizeUV*shadowMapSizeInverse;
float random=getRand(vPositionFromLight.xy);
float rotationAngle=random*3.1415926;
vec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));
float shadow=0.;
for (int i=0; i<pcfTapCount; i++) {
vec3 offset=poissonSamplers[i];
offset=vec3(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);
shadow+=TEXTUREFUNC(shadowSampler,uvDepth+offset*filterRadius,0.);
}
shadow/=float(pcfTapCount);
shadow=mix(shadow,1.,depthMetric-avgBlockerDepth);
shadow=mix(darkness,1.,shadow);
return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);
}
}
}
#define inline
float computeShadowWithPCSS16(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)
{
return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);
}
#define inline
float computeShadowWithPCSS32(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)
{
return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);
}
#define inline
float computeShadowWithPCSS64(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)
{
return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);
}
#define inline
float computeShadowWithCSMPCSS16(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{
return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);
}
#define inline
float computeShadowWithCSMPCSS32(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{
return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);
}
#define inline
float computeShadowWithCSMPCSS64(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{
return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);
}
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.shadowsFragmentFunctions */ .v.IncludesShadersStore.shadowsFragmentFunctions = shader;const shadowsFragmentFunctions = { name: "shadowsFragmentFunctions", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export shadowsVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "shadowsVertex",shader = `#ifdef SHADOWS
#if defined(SHADOWCSM{X})
vPositionFromCamera{X}=view*worldPos;
for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {
vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
}
#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
vPositionFromLight{X}=lightMatrix{X}*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.shadowsVertex */ .v.IncludesShadersStore.shadowsVertex = shader;const shadowsVertex = { name: "shadowsVertex", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/subSurfaceScatteringFunctions.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export subSurfaceScatteringFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "subSurfaceScatteringFunctions",shader = `bool testLightingForSSS(float diffusionProfile)
{
return diffusionProfile<1.;
}`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.subSurfaceScatteringFunctions */ .v.IncludesShadersStore.subSurfaceScatteringFunctions = shader;const subSurfaceScatteringFunctions = { name: "subSurfaceScatteringFunctions", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export uvAttributeDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "uvAttributeDeclaration",shader = `#ifdef UV{X}
attribute vec2 uv{X};
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.uvAttributeDeclaration */ .v.IncludesShadersStore.uvAttributeDeclaration = shader;const uvAttributeDeclaration = { name: "uvAttributeDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export uvVariableDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "uvVariableDeclaration",shader = `#if !defined(UV{X}) && defined(MAINUV{X})
vec2 uv{X}=vec2(0.,0.);
#endif
#ifdef MAINUV{X}
vMainUV{X}=uv{X};
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.uvVariableDeclaration */ .v.IncludesShadersStore.uvVariableDeclaration = shader;const uvVariableDeclaration = { name: "uvVariableDeclaration", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export vertexColorMixing */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "vertexColorMixing",shader = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
vColor=vec4(1.0);
#ifdef VERTEXCOLOR
#ifdef VERTEXALPHA
vColor*=color;
#else
vColor.rgb*=color.rgb;
#endif
#endif
#ifdef INSTANCESCOLOR
vColor*=instanceColor;
#endif
#endif
`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.IncludesShadersStore.vertexColorMixing */ .v.IncludesShadersStore.vertexColorMixing = shader;const vertexColorMixing = { name: "vertexColorMixing", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/pass.fragment.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "T": () => (/* binding */ passPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "passPixelShader",shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
gl_FragColor=texture2D(textureSampler,vUV);
}`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.ShadersStore.passPixelShader */ .v.ShadersStore.passPixelShader = shader;const passPixelShader = { name: "passPixelShader", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/postprocess.vertex.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export postprocessVertexShader */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
const name = "postprocessVertexShader",shader = `attribute vec2 position;
uniform vec2 scale;
varying vec2 vUV;
const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=(position*madd+madd)*scale;
gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.ShadersStore.postprocessVertexShader */ .v.ShadersStore.postprocessVertexShader = shader;const postprocessVertexShader = { name: "postprocessVertexShader", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/Shaders/rgbdDecode.fragment.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* unused harmony export rgbdDecodePixelShader */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js");
const name = "rgbdDecodePixelShader",shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
gl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);
}`;_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore.ShadersStore.rgbdDecodePixelShader */ .v.ShadersStore.rgbdDecodePixelShader = shader;const rgbdDecodePixelShader = { name: "rgbdDecodePixelShader", shader };

/***/ }),

/***/ "./node_modules/@babylonjs/core/States/alphaCullingState.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Q": () => (/* binding */ AlphaState)
/* harmony export */ });
class AlphaState {constructor() {this._blendFunctionParameters = [,,,,], this._blendEquationParameters = [,,], this._blendConstants = [,,,,], this._isBlendConstantsDirty = !1, this._alphaBlend = !1, this._isAlphaBlendDirty = !1, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this.reset();}get isDirty() {return this._isAlphaBlendDirty || this._isBlendFunctionParametersDirty || this._isBlendEquationParametersDirty;}get alphaBlend() {return this._alphaBlend;}set alphaBlend(value) {this._alphaBlend === value || (this._alphaBlend = value, this._isAlphaBlendDirty = !0);}setAlphaBlendConstants(r, g, b, a) {this._blendConstants[0] === r && this._blendConstants[1] === g && this._blendConstants[2] === b && this._blendConstants[3] === a || (this._blendConstants[0] = r, this._blendConstants[1] = g, this._blendConstants[2] = b, this._blendConstants[3] = a, this._isBlendConstantsDirty = !0);}setAlphaBlendFunctionParameters(value0, value1, value2, value3) {this._blendFunctionParameters[0] === value0 && this._blendFunctionParameters[1] === value1 && this._blendFunctionParameters[2] === value2 && this._blendFunctionParameters[3] === value3 || (this._blendFunctionParameters[0] = value0, this._blendFunctionParameters[1] = value1, this._blendFunctionParameters[2] = value2, this._blendFunctionParameters[3] = value3, this._isBlendFunctionParametersDirty = !0);}setAlphaEquationParameters(rgb, alpha) {this._blendEquationParameters[0] === rgb && this._blendEquationParameters[1] === alpha || (this._blendEquationParameters[0] = rgb, this._blendEquationParameters[1] = alpha, this._isBlendEquationParametersDirty = !0);}reset() {this._alphaBlend = !1, this._blendFunctionParameters[0] = null, this._blendFunctionParameters[1] = null, this._blendFunctionParameters[2] = null, this._blendFunctionParameters[3] = null, this._blendEquationParameters[0] = null, this._blendEquationParameters[1] = null, this._blendConstants[0] = null, this._blendConstants[1] = null, this._blendConstants[2] = null, this._blendConstants[3] = null, this._isAlphaBlendDirty = !0, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this._isBlendConstantsDirty = !1;}apply(gl) {this.isDirty && (this._isAlphaBlendDirty && (this._alphaBlend ? gl.enable(gl.BLEND) : gl.disable(gl.BLEND), this._isAlphaBlendDirty = !1), this._isBlendFunctionParametersDirty && (gl.blendFuncSeparate(this._blendFunctionParameters[0], this._blendFunctionParameters[1], this._blendFunctionParameters[2], this._blendFunctionParameters[3]), this._isBlendFunctionParametersDirty = !1), this._isBlendEquationParametersDirty && (gl.blendEquationSeparate(this._blendEquationParameters[0], this._blendEquationParameters[1]), this._isBlendEquationParametersDirty = !1), this._isBlendConstantsDirty && (gl.blendColor(this._blendConstants[0], this._blendConstants[1], this._blendConstants[2], this._blendConstants[3]), this._isBlendConstantsDirty = !1));}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/States/depthCullingState.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "k": () => (/* binding */ DepthCullingState)
/* harmony export */ });
class DepthCullingState {constructor(reset = !0) {this._isDepthTestDirty = !1, this._isDepthMaskDirty = !1, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !1, this._isFrontFaceDirty = !1, reset && this.reset();}get isDirty() {return this._isDepthFuncDirty || this._isDepthTestDirty || this._isDepthMaskDirty || this._isCullFaceDirty || this._isCullDirty || this._isZOffsetDirty || this._isFrontFaceDirty;}get zOffset() {return this._zOffset;}set zOffset(value) {this._zOffset === value || (this._zOffset = value, this._isZOffsetDirty = !0);}get zOffsetUnits() {return this._zOffsetUnits;}set zOffsetUnits(value) {this._zOffsetUnits === value || (this._zOffsetUnits = value, this._isZOffsetDirty = !0);}get cullFace() {return this._cullFace;}set cullFace(value) {this._cullFace === value || (this._cullFace = value, this._isCullFaceDirty = !0);}get cull() {return this._cull;}set cull(value) {this._cull === value || (this._cull = value, this._isCullDirty = !0);}get depthFunc() {return this._depthFunc;}set depthFunc(value) {this._depthFunc === value || (this._depthFunc = value, this._isDepthFuncDirty = !0);}get depthMask() {return this._depthMask;}set depthMask(value) {this._depthMask === value || (this._depthMask = value, this._isDepthMaskDirty = !0);}get depthTest() {return this._depthTest;}set depthTest(value) {this._depthTest === value || (this._depthTest = value, this._isDepthTestDirty = !0);}get frontFace() {return this._frontFace;}set frontFace(value) {this._frontFace === value || (this._frontFace = value, this._isFrontFaceDirty = !0);}reset() {this._depthMask = !0, this._depthTest = !0, this._depthFunc = null, this._cullFace = null, this._cull = null, this._zOffset = 0, this._zOffsetUnits = 0, this._frontFace = null, this._isDepthTestDirty = !0, this._isDepthMaskDirty = !0, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !0, this._isFrontFaceDirty = !1;}apply(gl) {this.isDirty && (this._isCullDirty && (this.cull ? gl.enable(gl.CULL_FACE) : gl.disable(gl.CULL_FACE), this._isCullDirty = !1), this._isCullFaceDirty && (gl.cullFace(this.cullFace), this._isCullFaceDirty = !1), this._isDepthMaskDirty && (gl.depthMask(this.depthMask), this._isDepthMaskDirty = !1), this._isDepthTestDirty && (this.depthTest ? gl.enable(gl.DEPTH_TEST) : gl.disable(gl.DEPTH_TEST), this._isDepthTestDirty = !1), this._isDepthFuncDirty && (gl.depthFunc(this.depthFunc), this._isDepthFuncDirty = !1), this._isZOffsetDirty && (this.zOffset || this.zOffsetUnits ? (gl.enable(gl.POLYGON_OFFSET_FILL), gl.polygonOffset(this.zOffset, this.zOffsetUnits)) : gl.disable(gl.POLYGON_OFFSET_FILL), this._isZOffsetDirty = !1), this._isFrontFaceDirty && (gl.frontFace(this.frontFace), this._isFrontFaceDirty = !1));}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/States/stencilState.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "s": () => (/* binding */ StencilState)
/* harmony export */ });
class StencilState {constructor() {this.reset();}reset() {this.enabled = !1, this.mask = 255, this.func = StencilState.ALWAYS, this.funcRef = 1, this.funcMask = 255, this.opStencilFail = StencilState.KEEP, this.opDepthFail = StencilState.KEEP, this.opStencilDepthPass = StencilState.REPLACE;}get stencilFunc() {return this.func;}set stencilFunc(value) {this.func = value;}get stencilFuncRef() {return this.funcRef;}set stencilFuncRef(value) {this.funcRef = value;}get stencilFuncMask() {return this.funcMask;}set stencilFuncMask(value) {this.funcMask = value;}get stencilOpStencilFail() {return this.opStencilFail;}set stencilOpStencilFail(value) {this.opStencilFail = value;}get stencilOpDepthFail() {return this.opDepthFail;}set stencilOpDepthFail(value) {this.opDepthFail = value;}get stencilOpStencilDepthPass() {return this.opStencilDepthPass;}set stencilOpStencilDepthPass(value) {this.opStencilDepthPass = value;}get stencilMask() {return this.mask;}set stencilMask(value) {this.mask = value;}get stencilTest() {return this.enabled;}set stencilTest(value) {this.enabled = value;}}StencilState.ALWAYS = 519, StencilState.KEEP = 7680, StencilState.REPLACE = 7681;

/***/ }),

/***/ "./node_modules/@babylonjs/core/States/stencilStateComposer.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "C": () => (/* binding */ StencilStateComposer)
/* harmony export */ });
class StencilStateComposer {get isDirty() {return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty;}get func() {return this._func;}set func(value) {this._func === value || (this._func = value, this._isStencilFuncDirty = !0);}get funcRef() {return this._funcRef;}set funcRef(value) {this._funcRef === value || (this._funcRef = value, this._isStencilFuncDirty = !0);}get funcMask() {return this._funcMask;}set funcMask(value) {this._funcMask === value || (this._funcMask = value, this._isStencilFuncDirty = !0);}get opStencilFail() {return this._opStencilFail;}set opStencilFail(value) {this._opStencilFail === value || (this._opStencilFail = value, this._isStencilOpDirty = !0);}get opDepthFail() {return this._opDepthFail;}set opDepthFail(value) {this._opDepthFail === value || (this._opDepthFail = value, this._isStencilOpDirty = !0);}get opStencilDepthPass() {return this._opStencilDepthPass;}set opStencilDepthPass(value) {this._opStencilDepthPass === value || (this._opStencilDepthPass = value, this._isStencilOpDirty = !0);}get mask() {return this._mask;}set mask(value) {this._mask === value || (this._mask = value, this._isStencilMaskDirty = !0);}get enabled() {return this._enabled;}set enabled(value) {this._enabled === value || (this._enabled = value, this._isStencilTestDirty = !0);}constructor(reset = !0) {this._isStencilTestDirty = !1, this._isStencilMaskDirty = !1, this._isStencilFuncDirty = !1, this._isStencilOpDirty = !1, this.useStencilGlobalOnly = !1, reset && this.reset();}reset() {var _a;this.stencilMaterial = void 0, null === (_a = this.stencilGlobal) || void 0 === _a ? void 0 : _a.reset(), this._isStencilTestDirty = !0, this._isStencilMaskDirty = !0, this._isStencilFuncDirty = !0, this._isStencilOpDirty = !0;}apply(gl) {var _a;if (gl) {const stencilMaterialEnabled = !this.useStencilGlobalOnly && null !== (_a = this.stencilMaterial) && void 0 !== _a && _a.enabled;this.enabled = stencilMaterialEnabled ? this.stencilMaterial.enabled : this.stencilGlobal.enabled, this.func = stencilMaterialEnabled ? this.stencilMaterial.func : this.stencilGlobal.func, this.funcRef = stencilMaterialEnabled ? this.stencilMaterial.funcRef : this.stencilGlobal.funcRef, this.funcMask = stencilMaterialEnabled ? this.stencilMaterial.funcMask : this.stencilGlobal.funcMask, this.opStencilFail = stencilMaterialEnabled ? this.stencilMaterial.opStencilFail : this.stencilGlobal.opStencilFail, this.opDepthFail = stencilMaterialEnabled ? this.stencilMaterial.opDepthFail : this.stencilGlobal.opDepthFail, this.opStencilDepthPass = stencilMaterialEnabled ? this.stencilMaterial.opStencilDepthPass : this.stencilGlobal.opStencilDepthPass, this.mask = stencilMaterialEnabled ? this.stencilMaterial.mask : this.stencilGlobal.mask, this.isDirty && (this._isStencilTestDirty && (this.enabled ? gl.enable(gl.STENCIL_TEST) : gl.disable(gl.STENCIL_TEST), this._isStencilTestDirty = !1), this._isStencilMaskDirty && (gl.stencilMask(this.mask), this._isStencilMaskDirty = !1), this._isStencilFuncDirty && (gl.stencilFunc(this.func, this.funcRef, this.funcMask), this._isStencilFuncDirty = !1), this._isStencilOpDirty && (gl.stencilOp(this.opStencilFail, this.opDepthFail, this.opStencilDepthPass), this._isStencilOpDirty = !1));}}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/abstractScene.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "p": () => (/* binding */ AbstractScene)
/* harmony export */ });
class AbstractScene {constructor() {this.rootNodes = [], this.cameras = [], this.lights = [], this.meshes = [], this.skeletons = [], this.particleSystems = [], this.animations = [], this.animationGroups = [], this.multiMaterials = [], this.materials = [], this.morphTargetManagers = [], this.geometries = [], this.transformNodes = [], this.actionManagers = [], this.textures = [], this._environmentTexture = null, this.postProcesses = [];}static AddParser(name, parser) {this._BabylonFileParsers[name] = parser;}static GetParser(name) {return this._BabylonFileParsers[name] ? this._BabylonFileParsers[name] : null;}static AddIndividualParser(name, parser) {this._IndividualBabylonFileParsers[name] = parser;}static GetIndividualParser(name) {return this._IndividualBabylonFileParsers[name] ? this._IndividualBabylonFileParsers[name] : null;}static Parse(jsonData, scene, container, rootUrl) {for (const parserName in this._BabylonFileParsers) Object.prototype.hasOwnProperty.call(this._BabylonFileParsers, parserName) && this._BabylonFileParsers[parserName](jsonData, scene, container, rootUrl);}get environmentTexture() {return this._environmentTexture;}set environmentTexture(value) {this._environmentTexture = value;}getNodes() {let nodes = [];return nodes = nodes.concat(this.meshes), nodes = nodes.concat(this.lights), nodes = nodes.concat(this.cameras), nodes = nodes.concat(this.transformNodes), this.skeletons.forEach((skeleton) => nodes = nodes.concat(skeleton.bones)), nodes;}}AbstractScene._BabylonFileParsers = {}, AbstractScene._IndividualBabylonFileParsers = {};

/***/ }),

/***/ "./node_modules/@babylonjs/core/assetContainer.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "TJ": () => (/* binding */ AssetContainer),
/* harmony export */   "fD": () => (/* binding */ KeepAssets),
/* harmony export */   "ve": () => (/* binding */ InstantiatedEntries)
/* harmony export */ });
/* harmony import */ var _abstractScene_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/abstractScene.js");
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.js");
/* harmony import */ var _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/transformNode.js");
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Meshes_instancedMesh_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Meshes/instancedMesh.js");
/* harmony import */ var _Lights_light_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./node_modules/@babylonjs/core/Lights/light.js");
/* harmony import */ var _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./node_modules/@babylonjs/core/Cameras/camera.js");
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
class KeepAssets extends _abstractScene_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractScene */ .p {}class InstantiatedEntries {constructor() {this.rootNodes = [], this.skeletons = [], this.animationGroups = [];}dispose() {this.rootNodes.slice(0).forEach((o) => {o.dispose();}), this.rootNodes.length = 0, this.skeletons.slice(0).forEach((o) => {o.dispose();}), this.skeletons.length = 0, this.animationGroups.slice(0).forEach((o) => {o.dispose();}), this.animationGroups.length = 0;}}class AssetContainer extends _abstractScene_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractScene */ .p {constructor(scene) {super(), this._wasAddedToScene = !1, scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene;scene && (this.scene = scene, this.sounds = [], this.effectLayers = [], this.layers = [], this.lensFlareSystems = [], this.proceduralTextures = [], this.reflectionProbes = [], scene.onDisposeObservable.add(() => {this._wasAddedToScene || this.dispose();}), this._onContextRestoredObserver = scene.getEngine().onContextRestoredObservable.add(() => {for (const geometry of this.geometries) geometry._rebuild();for (const mesh of this.meshes) mesh._rebuild();for (const system of this.particleSystems) system.rebuild();for (const texture of this.textures) texture._rebuild();}));}_topologicalSort(nodes) {const nodesUidMap = new Map();for (const node of nodes) nodesUidMap.set(node.uniqueId, node);const dependencyGraph = { dependsOn: new Map(), dependedBy: new Map() };for (const node of nodes) {const nodeId = node.uniqueId;dependencyGraph.dependsOn.set(nodeId, new Set()), dependencyGraph.dependedBy.set(nodeId, new Set());}for (const node of nodes) {const nodeId = node.uniqueId,dependsOn = dependencyGraph.dependsOn.get(nodeId);if (node instanceof _Meshes_instancedMesh_js__WEBPACK_IMPORTED_MODULE_5__/* .InstancedMesh */ .S) {const masterMesh = node.sourceMesh;nodesUidMap.has(masterMesh.uniqueId) && (dependsOn.add(masterMesh.uniqueId), dependencyGraph.dependedBy.get(masterMesh.uniqueId).add(nodeId));}const dependedBy = dependencyGraph.dependedBy.get(nodeId);for (const child of node.getDescendants()) {const childId = child.uniqueId;if (nodesUidMap.has(childId)) {dependedBy.add(childId);const childDependsOn = dependencyGraph.dependsOn.get(childId);childDependsOn.add(nodeId);}}}const sortedNodes = [],leaves = [];for (const node of nodes) {const nodeId = node.uniqueId;0 === dependencyGraph.dependsOn.get(nodeId).size && (leaves.push(node), nodesUidMap.delete(nodeId));}for (const visitList = leaves; 0 < visitList.length;) {const nodeToVisit = visitList.shift();sortedNodes.push(nodeToVisit);const dependedByVisitedNode = dependencyGraph.dependedBy.get(nodeToVisit.uniqueId);for (const dependedByVisitedNodeId of Array.from(dependedByVisitedNode.values())) {const dependsOnDependedByVisitedNode = dependencyGraph.dependsOn.get(dependedByVisitedNodeId);dependsOnDependedByVisitedNode.delete(nodeToVisit.uniqueId), 0 === dependsOnDependedByVisitedNode.size && nodesUidMap.get(dependedByVisitedNodeId) && (visitList.push(nodesUidMap.get(dependedByVisitedNodeId)), nodesUidMap.delete(dependedByVisitedNodeId));}}return 0 < nodesUidMap.size && (console.error("SceneSerializer._topologicalSort: There were unvisited nodes:"), nodesUidMap.forEach((node) => console.error(node.name))), sortedNodes;}_addNodeAndDescendantsToList(list, addedIds, rootNode, predicate) {if (!(predicate && !predicate(rootNode) || addedIds.has(rootNode.uniqueId))) {list.push(rootNode), addedIds.add(rootNode.uniqueId);for (const child of rootNode.getDescendants(!0)) this._addNodeAndDescendantsToList(list, addedIds, child, predicate);}}_isNodeInContainer(node) {return !!(node instanceof _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_1__/* .Mesh */ .Kj && -1 !== this.meshes.indexOf(node)) || !!(node instanceof _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_2__/* .TransformNode */ .Y && -1 !== this.transformNodes.indexOf(node)) || !!(node instanceof _Lights_light_js__WEBPACK_IMPORTED_MODULE_6__/* .Light */ ._ && -1 !== this.lights.indexOf(node)) || !!(node instanceof _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_7__/* .Camera */ .V && -1 !== this.cameras.indexOf(node));}_isValidHierarchy() {for (const node of this.meshes) if (node.parent && !this._isNodeInContainer(node.parent)) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger.Warn */ .Y.Warn(`Node ${node.name} has a parent that is not in the container.`), !1;for (const node of this.transformNodes) if (node.parent && !this._isNodeInContainer(node.parent)) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger.Warn */ .Y.Warn(`Node ${node.name} has a parent that is not in the container.`), !1;for (const node of this.lights) if (node.parent && !this._isNodeInContainer(node.parent)) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger.Warn */ .Y.Warn(`Node ${node.name} has a parent that is not in the container.`), !1;for (const node of this.cameras) if (node.parent && !this._isNodeInContainer(node.parent)) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger.Warn */ .Y.Warn(`Node ${node.name} has a parent that is not in the container.`), !1;return !0;}instantiateModelsToScene(nameFunction, cloneMaterials = !1, options) {this._isValidHierarchy() || _Misc_tools_js__WEBPACK_IMPORTED_MODULE_8__/* .Tools.Warn */ .w1.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");const conversionMap = {},storeMap = {},result = new InstantiatedEntries(),alreadySwappedSkeletons = [],alreadySwappedMaterials = [],localOptions = { doNotInstantiate: !0, ...options };localOptions.doNotInstantiate || (localOptions.doNotInstantiate = (node) => !!node.skeleton);const onClone = (source, clone) => {if (conversionMap[source.uniqueId] = clone.uniqueId, storeMap[clone.uniqueId] = clone, nameFunction && (clone.name = nameFunction(source.name)), clone instanceof _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_1__/* .Mesh */ .Kj) {const clonedMesh = clone;if (clonedMesh.morphTargetManager) {const oldMorphTargetManager = source.morphTargetManager;clonedMesh.morphTargetManager = oldMorphTargetManager.clone();for (let index = 0; index < oldMorphTargetManager.numTargets; index++) {const oldTarget = oldMorphTargetManager.getTarget(index),newTarget = clonedMesh.morphTargetManager.getTarget(index);conversionMap[oldTarget.uniqueId] = newTarget.uniqueId, storeMap[newTarget.uniqueId] = newTarget;}}}},nodesToSort = [],idsOnSortList = new Set();for (const transformNode of this.transformNodes) null === transformNode.parent && this._addNodeAndDescendantsToList(nodesToSort, idsOnSortList, transformNode, localOptions.predicate);for (const mesh of this.meshes) null === mesh.parent && this._addNodeAndDescendantsToList(nodesToSort, idsOnSortList, mesh, localOptions.predicate);const sortedNodes = this._topologicalSort(nodesToSort),onNewCreated = (source, clone) => {if (onClone(source, clone), source.parent) {const replicatedParentId = conversionMap[source.parent.uniqueId],replicatedParent = storeMap[replicatedParentId];clone.parent = replicatedParent ? replicatedParent : source.parent;}if (clone.position.copyFrom(source.position), clone.rotation.copyFrom(source.rotation), clone.scaling.copyFrom(source.scaling), clone.material) {const mesh = clone;if (mesh.material) if (cloneMaterials) {const sourceMaterial = source.material;if (-1 === alreadySwappedMaterials.indexOf(sourceMaterial)) {let swap = sourceMaterial.clone(nameFunction ? nameFunction(sourceMaterial.name) : "Clone of " + sourceMaterial.name);if (alreadySwappedMaterials.push(sourceMaterial), conversionMap[sourceMaterial.uniqueId] = swap.uniqueId, storeMap[swap.uniqueId] = swap, "MultiMaterial" === sourceMaterial.getClassName()) {const multi = sourceMaterial;for (const material of multi.subMaterials) material && (swap = material.clone(nameFunction ? nameFunction(material.name) : "Clone of " + material.name), alreadySwappedMaterials.push(material), conversionMap[material.uniqueId] = swap.uniqueId, storeMap[swap.uniqueId] = swap);multi.subMaterials = multi.subMaterials.map((m) => m && storeMap[conversionMap[m.uniqueId]]);}}"InstancedMesh" !== mesh.getClassName() && (mesh.material = storeMap[conversionMap[sourceMaterial.uniqueId]]);} else "MultiMaterial" === mesh.material.getClassName() ? -1 === this.scene.multiMaterials.indexOf(mesh.material) && this.scene.addMultiMaterial(mesh.material) : -1 === this.scene.materials.indexOf(mesh.material) && this.scene.addMaterial(mesh.material);}null === clone.parent && result.rootNodes.push(clone);};return sortedNodes.forEach((node) => {if ("InstancedMesh" === node.getClassName()) {const instancedNode = node,sourceMesh = instancedNode.sourceMesh,replicatedSourceId = conversionMap[sourceMesh.uniqueId],replicatedSource = "number" == typeof replicatedSourceId ? storeMap[replicatedSourceId] : sourceMesh,replicatedInstancedNode = replicatedSource.createInstance(instancedNode.name);onNewCreated(instancedNode, replicatedInstancedNode);} else {const canInstance = (null === localOptions || void 0 === localOptions || !localOptions.doNotInstantiate) && 0 < node.getTotalVertices(),replicatedNode = canInstance ? node.createInstance(`instance of ${node.name}`) : node.clone(`Clone of ${node.name}`, null, !0);if (!replicatedNode) throw new Error(`Could not clone or instantiate node on Asset Container ${node.name}`);onNewCreated(node, replicatedNode);}}), this.skeletons.forEach((s) => {if (!localOptions.predicate || localOptions.predicate(s)) {const clone = s.clone(nameFunction ? nameFunction(s.name) : "Clone of " + s.name);for (const m of this.meshes) if (m.skeleton === s && !m.isAnInstance) {const copy = storeMap[conversionMap[m.uniqueId]];if (copy.isAnInstance) continue;if (copy.skeleton = clone, -1 !== alreadySwappedSkeletons.indexOf(clone)) continue;alreadySwappedSkeletons.push(clone);for (const bone of clone.bones) bone._linkedTransformNode && (bone._linkedTransformNode = storeMap[conversionMap[bone._linkedTransformNode.uniqueId]]);}result.skeletons.push(clone);}}), this.animationGroups.forEach((o) => {if (!localOptions.predicate || localOptions.predicate(o)) {const clone = o.clone(nameFunction ? nameFunction(o.name) : "Clone of " + o.name, (oldTarget) => {const newTarget = storeMap[conversionMap[oldTarget.uniqueId]];return newTarget || oldTarget;});result.animationGroups.push(clone);}}), result;}addAllToScene() {if (!this._wasAddedToScene) {this._isValidHierarchy() || _Misc_tools_js__WEBPACK_IMPORTED_MODULE_8__/* .Tools.Warn */ .w1.Warn("SceneSerializer.addAllToScene: The Asset Container hierarchy is not valid."), this._wasAddedToScene = !0, this.addToScene(null), this.environmentTexture && (this.scene.environmentTexture = this.environmentTexture);for (const component of this.scene._serializableComponents) component.addFromContainer(this);this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null;}}addToScene(predicate = null) {this.cameras.forEach((o) => {predicate && !predicate(o) || this.scene.addCamera(o);}), this.lights.forEach((o) => {predicate && !predicate(o) || this.scene.addLight(o);}), this.meshes.forEach((o) => {predicate && !predicate(o) || this.scene.addMesh(o);}), this.skeletons.forEach((o) => {predicate && !predicate(o) || this.scene.addSkeleton(o);}), this.animations.forEach((o) => {predicate && !predicate(o) || this.scene.addAnimation(o);}), this.animationGroups.forEach((o) => {predicate && !predicate(o) || this.scene.addAnimationGroup(o);}), this.multiMaterials.forEach((o) => {predicate && !predicate(o) || this.scene.addMultiMaterial(o);}), this.materials.forEach((o) => {predicate && !predicate(o) || this.scene.addMaterial(o);}), this.morphTargetManagers.forEach((o) => {predicate && !predicate(o) || this.scene.addMorphTargetManager(o);}), this.geometries.forEach((o) => {predicate && !predicate(o) || this.scene.addGeometry(o);}), this.transformNodes.forEach((o) => {predicate && !predicate(o) || this.scene.addTransformNode(o);}), this.actionManagers.forEach((o) => {predicate && !predicate(o) || this.scene.addActionManager(o);}), this.textures.forEach((o) => {predicate && !predicate(o) || this.scene.addTexture(o);}), this.reflectionProbes.forEach((o) => {predicate && !predicate(o) || this.scene.addReflectionProbe(o);});}removeAllFromScene() {this._isValidHierarchy() || _Misc_tools_js__WEBPACK_IMPORTED_MODULE_8__/* .Tools.Warn */ .w1.Warn("SceneSerializer.removeAllFromScene: The Asset Container hierarchy is not valid."), this._wasAddedToScene = !1, this.removeFromScene(null), this.environmentTexture === this.scene.environmentTexture && (this.scene.environmentTexture = null);for (const component of this.scene._serializableComponents) component.removeFromContainer(this);}removeFromScene(predicate = null) {this.cameras.forEach((o) => {predicate && !predicate(o) || this.scene.removeCamera(o);}), this.lights.forEach((o) => {predicate && !predicate(o) || this.scene.removeLight(o);}), this.meshes.forEach((o) => {predicate && !predicate(o) || this.scene.removeMesh(o);}), this.skeletons.forEach((o) => {predicate && !predicate(o) || this.scene.removeSkeleton(o);}), this.animations.forEach((o) => {predicate && !predicate(o) || this.scene.removeAnimation(o);}), this.animationGroups.forEach((o) => {predicate && !predicate(o) || this.scene.removeAnimationGroup(o);}), this.multiMaterials.forEach((o) => {predicate && !predicate(o) || this.scene.removeMultiMaterial(o);}), this.materials.forEach((o) => {predicate && !predicate(o) || this.scene.removeMaterial(o);}), this.morphTargetManagers.forEach((o) => {predicate && !predicate(o) || this.scene.removeMorphTargetManager(o);}), this.geometries.forEach((o) => {predicate && !predicate(o) || this.scene.removeGeometry(o);}), this.transformNodes.forEach((o) => {predicate && !predicate(o) || this.scene.removeTransformNode(o);}), this.actionManagers.forEach((o) => {predicate && !predicate(o) || this.scene.removeActionManager(o);}), this.textures.forEach((o) => {predicate && !predicate(o) || this.scene.removeTexture(o);}), this.reflectionProbes.forEach((o) => {predicate && !predicate(o) || this.scene.removeReflectionProbe(o);});}dispose() {this.cameras.slice(0).forEach((o) => {o.dispose();}), this.cameras.length = 0, this.lights.slice(0).forEach((o) => {o.dispose();}), this.lights.length = 0, this.meshes.slice(0).forEach((o) => {o.dispose();}), this.meshes.length = 0, this.skeletons.slice(0).forEach((o) => {o.dispose();}), this.skeletons.length = 0, this.animationGroups.slice(0).forEach((o) => {o.dispose();}), this.animationGroups.length = 0, this.multiMaterials.slice(0).forEach((o) => {o.dispose();}), this.multiMaterials.length = 0, this.materials.slice(0).forEach((o) => {o.dispose();}), this.materials.length = 0, this.geometries.slice(0).forEach((o) => {o.dispose();}), this.geometries.length = 0, this.transformNodes.slice(0).forEach((o) => {o.dispose();}), this.transformNodes.length = 0, this.actionManagers.slice(0).forEach((o) => {o.dispose();}), this.actionManagers.length = 0, this.textures.slice(0).forEach((o) => {o.dispose();}), this.textures.length = 0, this.reflectionProbes.slice(0).forEach((o) => {o.dispose();}), this.reflectionProbes.length = 0, this.environmentTexture && (this.environmentTexture.dispose(), this.environmentTexture = null);for (const component of this.scene._serializableComponents) component.removeFromContainer(this, !0);this._onContextRestoredObserver && (this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null);}_moveAssets(sourceAssets, targetAssets, keepAssets) {if (sourceAssets && targetAssets) for (const asset of sourceAssets) {let move = !0;if (keepAssets) for (const keepAsset of keepAssets) if (asset === keepAsset) {move = !1;break;}move && (targetAssets.push(asset), asset._parentContainer = this);}}moveAllFromScene(keepAssets) {for (const key in this._wasAddedToScene = !1, void 0 === keepAssets && (keepAssets = new KeepAssets()), this) Object.prototype.hasOwnProperty.call(this, key) && (this[key] = this[key] || ("_environmentTexture" === key ? null : []), this._moveAssets(this.scene[key], this[key], keepAssets[key]));this.environmentTexture = this.scene.environmentTexture, this.removeAllFromScene();}createRootMesh() {const rootMesh = new _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_1__/* .Mesh */ .Kj("assetContainerRootMesh", this.scene);return this.meshes.forEach((m) => {m.parent || rootMesh.addChild(m);}), this.meshes.unshift(rootMesh), rootMesh;}mergeAnimationsTo(scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, animatables, targetConverter = null) {if (!scene) return _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger.Error */ .Y.Error("No scene available to merge animations to"), [];const _targetConverter = targetConverter ? targetConverter : (target) => {let node = null;const targetProperty = target.animations.length ? target.animations[0].targetProperty : "",name = target.name.split(".").join("").split("_primitive")[0];return node = "position" === targetProperty || "rotationQuaternion" === targetProperty ? scene.getTransformNodeByName(target.name) || scene.getTransformNodeByName(name) : "influence" === targetProperty ? scene.getMorphTargetByName(target.name) || scene.getMorphTargetByName(name) : scene.getNodeByName(target.name) || scene.getNodeByName(name), node;},nodesInAC = this.getNodes();nodesInAC.forEach((nodeInAC) => {const nodeInScene = _targetConverter(nodeInAC);if (null !== nodeInScene) {for (const animationInAC of nodeInAC.animations) {const animationsWithSameProperty = nodeInScene.animations.filter((animationInScene) => animationInScene.targetProperty === animationInAC.targetProperty);for (const animationWithSameProperty of animationsWithSameProperty) {const index = nodeInScene.animations.indexOf(animationWithSameProperty, 0);-1 < index && nodeInScene.animations.splice(index, 1);}}nodeInScene.animations = nodeInScene.animations.concat(nodeInAC.animations);}});const newAnimationGroups = [];return this.animationGroups.slice().forEach((animationGroupInAC) => {newAnimationGroups.push(animationGroupInAC.clone(animationGroupInAC.name, _targetConverter)), animationGroupInAC.animatables.forEach((animatable) => {animatable.stop();});}), animatables.forEach((animatable) => {const target = _targetConverter(animatable.target);target && (scene.beginAnimation(target, animatable.fromFrame, animatable.toFrame, animatable.loopAnimation, animatable.speedRatio, animatable.onAnimationEnd ? animatable.onAnimationEnd : void 0, void 0, !0, void 0, animatable.onAnimationLoop ? animatable.onAnimationLoop : void 0), scene.stopAnimation(animatable.target));}), newAnimationGroups;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/index.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "AbstractActionManager": () => (/* reexport */ abstractActionManager/* AbstractActionManager */.O),
  "AbstractAssetTask": () => (/* reexport */ AbstractAssetTask),
  "AbstractMesh": () => (/* reexport */ abstractMesh/* AbstractMesh */.x),
  "AbstractScene": () => (/* reexport */ abstractScene/* AbstractScene */.p),
  "AcquireNativeObjectAsync": () => (/* reexport */ AcquireNativeObjectAsync),
  "Action": () => (/* reexport */ Action),
  "ActionEvent": () => (/* reexport */ actionEvent/* ActionEvent */.V),
  "ActionManager": () => (/* reexport */ ActionManager),
  "AddBlock": () => (/* reexport */ AddBlock),
  "AddressMode": () => (/* reexport */ AddressMode),
  "AdvancedTimer": () => (/* reexport */ AdvancedTimer),
  "AlphaState": () => (/* reexport */ alphaCullingState/* AlphaState */.Q),
  "AmmoJSPlugin": () => (/* reexport */ AmmoJSPlugin),
  "AnaglyphArcRotateCamera": () => (/* reexport */ AnaglyphArcRotateCamera),
  "AnaglyphFreeCamera": () => (/* reexport */ AnaglyphFreeCamera),
  "AnaglyphGamepadCamera": () => (/* reexport */ AnaglyphGamepadCamera),
  "AnaglyphPostProcess": () => (/* reexport */ AnaglyphPostProcess),
  "AnaglyphUniversalCamera": () => (/* reexport */ AnaglyphUniversalCamera),
  "Analyser": () => (/* reexport */ Analyser),
  "AndOrNotEvaluator": () => (/* reexport */ andOrNotEvaluator/* AndOrNotEvaluator */.q),
  "Angle": () => (/* reexport */ math/* Angle */.RZ),
  "Animatable": () => (/* reexport */ Animatable),
  "AnimatedInputBlockTypes": () => (/* reexport */ AnimatedInputBlockTypes),
  "Animation": () => (/* reexport */ Animations_animation/* Animation */.f),
  "AnimationEvent": () => (/* reexport */ animationEvent/* AnimationEvent */.O),
  "AnimationGroup": () => (/* reexport */ Animations_animationGroup/* AnimationGroup */.O),
  "AnimationKeyInterpolation": () => (/* reexport */ animationKey/* AnimationKeyInterpolation */.N),
  "AnimationPropertiesOverride": () => (/* reexport */ AnimationPropertiesOverride),
  "AnimationRange": () => (/* reexport */ animationRange/* AnimationRange */.X),
  "AnisotropyBlock": () => (/* reexport */ AnisotropyBlock),
  "ApplyPostProcess": () => (/* reexport */ textureTools/* ApplyPostProcess */.$0),
  "Arc2": () => (/* reexport */ math/* Arc2 */.Q),
  "ArcFollowCamera": () => (/* reexport */ ArcFollowCamera),
  "ArcRotateCamera": () => (/* reexport */ ArcRotateCamera),
  "ArcRotateCameraGamepadInput": () => (/* reexport */ ArcRotateCameraGamepadInput),
  "ArcRotateCameraInputsManager": () => (/* reexport */ ArcRotateCameraInputsManager),
  "ArcRotateCameraKeyboardMoveInput": () => (/* reexport */ ArcRotateCameraKeyboardMoveInput),
  "ArcRotateCameraMouseWheelInput": () => (/* reexport */ ArcRotateCameraMouseWheelInput),
  "ArcRotateCameraPointersInput": () => (/* reexport */ ArcRotateCameraPointersInput),
  "ArcRotateCameraVRDeviceOrientationInput": () => (/* reexport */ ArcRotateCameraVRDeviceOrientationInput),
  "ArcTan2Block": () => (/* reexport */ ArcTan2Block),
  "AssetContainer": () => (/* reexport */ assetContainer/* AssetContainer */.TJ),
  "AssetTaskState": () => (/* reexport */ AssetTaskState),
  "AssetsManager": () => (/* reexport */ AssetsManager),
  "AssetsProgressEvent": () => (/* reexport */ AssetsProgressEvent),
  "AsyncLoop": () => (/* reexport */ tools/* AsyncLoop */.$g),
  "AttachToBoxBehavior": () => (/* reexport */ AttachToBoxBehavior),
  "AudioEngine": () => (/* reexport */ AudioEngine),
  "AudioSceneComponent": () => (/* reexport */ AudioSceneComponent),
  "AutoLayoutMode": () => (/* reexport */ AutoLayoutMode),
  "AutoReleaseWorkerPool": () => (/* reexport */ workerPool/* AutoReleaseWorkerPool */.v),
  "AutoRotationBehavior": () => (/* reexport */ AutoRotationBehavior),
  "AxesViewer": () => (/* reexport */ AxesViewer),
  "Axis": () => (/* reexport */ math/* Axis */.RD),
  "AxisDragGizmo": () => (/* reexport */ AxisDragGizmo),
  "AxisScaleGizmo": () => (/* reexport */ AxisScaleGizmo),
  "BRDFTextureTools": () => (/* reexport */ brdfTextureTools/* BRDFTextureTools */.D),
  "BabylonFileLoaderConfiguration": () => (/* reexport */ BabylonFileLoaderConfiguration),
  "BackEase": () => (/* reexport */ BackEase),
  "BackgroundMaterial": () => (/* reexport */ BackgroundMaterial),
  "BakedVertexAnimationManager": () => (/* reexport */ BakedVertexAnimationManager),
  "BallAndSocketConstraint": () => (/* reexport */ BallAndSocketConstraint),
  "BaseCameraMouseWheelInput": () => (/* reexport */ BaseCameraMouseWheelInput/* BaseCameraMouseWheelInput */.Y),
  "BaseCameraPointersInput": () => (/* reexport */ BaseCameraPointersInput),
  "BaseError": () => (/* reexport */ error/* BaseError */.GU),
  "BaseParticleSystem": () => (/* reexport */ BaseParticleSystem),
  "BaseSixDofDragBehavior": () => (/* reexport */ BaseSixDofDragBehavior),
  "BaseTexture": () => (/* reexport */ baseTexture/* BaseTexture */.V),
  "BasisTools": () => (/* reexport */ BasisTools),
  "BasisToolsOptions": () => (/* reexport */ BasisToolsOptions),
  "BasisTranscodeConfiguration": () => (/* reexport */ BasisTranscodeConfiguration),
  "BezierCurve": () => (/* reexport */ math/* BezierCurve */.hr),
  "BezierCurveEase": () => (/* reexport */ BezierCurveEase),
  "BiPlanarBlock": () => (/* reexport */ BiPlanarBlock),
  "BinaryFileAssetTask": () => (/* reexport */ BinaryFileAssetTask),
  "BlackAndWhitePostProcess": () => (/* reexport */ BlackAndWhitePostProcess),
  "BlendFactor": () => (/* reexport */ BlendFactor),
  "BlendOperation": () => (/* reexport */ BlendOperation),
  "BloomEffect": () => (/* reexport */ BloomEffect),
  "BloomMergePostProcess": () => (/* reexport */ BloomMergePostProcess),
  "BlurPostProcess": () => (/* reexport */ BlurPostProcess),
  "Bone": () => (/* reexport */ bone/* Bone */.N),
  "BoneAxesViewer": () => (/* reexport */ BoneAxesViewer),
  "BoneIKController": () => (/* reexport */ BoneIKController),
  "BoneLookController": () => (/* reexport */ BoneLookController),
  "BonesBlock": () => (/* reexport */ BonesBlock),
  "BounceEase": () => (/* reexport */ BounceEase),
  "BouncingBehavior": () => (/* reexport */ BouncingBehavior),
  "BoundingBox": () => (/* reexport */ boundingBox/* BoundingBox */.k),
  "BoundingBoxGizmo": () => (/* reexport */ BoundingBoxGizmo),
  "BoundingBoxRenderer": () => (/* reexport */ BoundingBoxRenderer),
  "BoundingInfo": () => (/* reexport */ boundingInfo/* BoundingInfo */.j),
  "BoundingSphere": () => (/* reexport */ boundingSphere/* BoundingSphere */.K),
  "BoxBuilder": () => (/* reexport */ BoxBuilder),
  "BoxParticleEmitter": () => (/* reexport */ BoxParticleEmitter),
  "Buffer": () => (/* reexport */ Buffers_buffer/* Buffer */.l),
  "BufferBindingType": () => (/* reexport */ BufferBindingType),
  "BufferUsage": () => (/* reexport */ BufferUsage),
  "CSG": () => (/* reexport */ CSG),
  "Camera": () => (/* reexport */ Cameras_camera/* Camera */.V),
  "CameraGizmo": () => (/* reexport */ CameraGizmo),
  "CameraInputTypes": () => (/* reexport */ cameraInputsManager/* CameraInputTypes */.u),
  "CameraInputsManager": () => (/* reexport */ cameraInputsManager/* CameraInputsManager */.p),
  "CannonJSPlugin": () => (/* reexport */ CannonJSPlugin),
  "CanvasAlphaMode": () => (/* reexport */ CanvasAlphaMode),
  "CapsuleBuilder": () => (/* reexport */ CapsuleBuilder),
  "CascadedShadowGenerator": () => (/* reexport */ CascadedShadowGenerator),
  "ChromaticAberrationPostProcess": () => (/* reexport */ ChromaticAberrationPostProcess),
  "CircleEase": () => (/* reexport */ CircleEase),
  "CircleOfConfusionPostProcess": () => (/* reexport */ CircleOfConfusionPostProcess),
  "ClampBlock": () => (/* reexport */ ClampBlock),
  "ClearCoatBlock": () => (/* reexport */ ClearCoatBlock),
  "ClipPlanesBlock": () => (/* reexport */ ClipPlanesBlock),
  "ClipboardEventTypes": () => (/* reexport */ ClipboardEventTypes),
  "ClipboardInfo": () => (/* reexport */ ClipboardInfo),
  "CloudBlock": () => (/* reexport */ CloudBlock),
  "CloudPoint": () => (/* reexport */ CloudPoint),
  "Collider": () => (/* reexport */ Collider),
  "Color3": () => (/* reexport */ math/* Color3 */.Wo),
  "Color3Gradient": () => (/* reexport */ Color3Gradient),
  "Color4": () => (/* reexport */ math/* Color4 */.HE),
  "ColorCorrectionPostProcess": () => (/* reexport */ ColorCorrectionPostProcess),
  "ColorCurves": () => (/* reexport */ colorCurves/* ColorCurves */.U),
  "ColorGradient": () => (/* reexport */ ColorGradient),
  "ColorGradingTexture": () => (/* reexport */ ColorGradingTexture),
  "ColorMergerBlock": () => (/* reexport */ ColorMergerBlock),
  "ColorSplitterBlock": () => (/* reexport */ ColorSplitterBlock),
  "ColorWriteFlags": () => (/* reexport */ ColorWriteFlags),
  "CombineAction": () => (/* reexport */ CombineAction),
  "CompareFunction": () => (/* reexport */ CompareFunction),
  "CompatibilityOptions": () => (/* reexport */ compatibilityOptions/* CompatibilityOptions */.e),
  "CompilationMessageType": () => (/* reexport */ CompilationMessageType),
  "ComputeBindingType": () => (/* reexport */ ComputeBindingType),
  "ComputeEffect": () => (/* reexport */ ComputeEffect),
  "ComputePassTimestampLocation": () => (/* reexport */ ComputePassTimestampLocation),
  "ComputeShader": () => (/* reexport */ ComputeShader),
  "ComputeShaderParticleSystem": () => (/* reexport */ ComputeShaderParticleSystem),
  "Condition": () => (/* reexport */ Condition),
  "ConditionalBlock": () => (/* reexport */ ConditionalBlock),
  "ConditionalBlockConditions": () => (/* reexport */ ConditionalBlockConditions),
  "ConeParticleEmitter": () => (/* reexport */ ConeParticleEmitter),
  "Constants": () => (/* reexport */ constants/* Constants */.g),
  "ConstraintAxis": () => (/* reexport */ ConstraintAxis),
  "ConstraintAxisLimitMode": () => (/* reexport */ ConstraintAxisLimitMode),
  "ConstraintMotorType": () => (/* reexport */ ConstraintMotorType),
  "ConstraintType": () => (/* reexport */ ConstraintType),
  "ContainerAssetTask": () => (/* reexport */ ContainerAssetTask),
  "ConversionMode": () => (/* reexport */ ConversionMode),
  "ConvolutionPostProcess": () => (/* reexport */ ConvolutionPostProcess),
  "Coordinate": () => (/* reexport */ math/* Coordinate */.c7),
  "CopyTextureToTexture": () => (/* reexport */ CopyTextureToTexture),
  "CopyTools": () => (/* reexport */ copyTools/* CopyTools */.r1),
  "CreateBox": () => (/* reexport */ CreateBox),
  "CreateBoxVertexData": () => (/* reexport */ CreateBoxVertexData),
  "CreateCapsule": () => (/* reexport */ CreateCapsule),
  "CreateCapsuleVertexData": () => (/* reexport */ CreateCapsuleVertexData),
  "CreateCylinder": () => (/* reexport */ CreateCylinder),
  "CreateCylinderVertexData": () => (/* reexport */ CreateCylinderVertexData),
  "CreateDashedLines": () => (/* reexport */ CreateDashedLines),
  "CreateDashedLinesVertexData": () => (/* reexport */ CreateDashedLinesVertexData),
  "CreateDecal": () => (/* reexport */ CreateDecal),
  "CreateDisc": () => (/* reexport */ CreateDisc),
  "CreateDiscVertexData": () => (/* reexport */ CreateDiscVertexData),
  "CreateEnvTextureAsync": () => (/* reexport */ environmentTextureTools/* CreateEnvTextureAsync */.p6),
  "CreateGeodesic": () => (/* reexport */ CreateGeodesic),
  "CreateGoldberg": () => (/* reexport */ CreateGoldberg),
  "CreateGoldbergVertexData": () => (/* reexport */ CreateGoldbergVertexData),
  "CreateGround": () => (/* reexport */ CreateGround),
  "CreateGroundFromHeightMap": () => (/* reexport */ CreateGroundFromHeightMap),
  "CreateGroundFromHeightMapVertexData": () => (/* reexport */ CreateGroundFromHeightMapVertexData),
  "CreateGroundVertexData": () => (/* reexport */ CreateGroundVertexData),
  "CreateHemisphere": () => (/* reexport */ CreateHemisphere),
  "CreateIcoSphere": () => (/* reexport */ CreateIcoSphere),
  "CreateIcoSphereVertexData": () => (/* reexport */ CreateIcoSphereVertexData),
  "CreateImageDataArrayBufferViews": () => (/* reexport */ environmentTextureTools/* CreateImageDataArrayBufferViews */.Do),
  "CreateLathe": () => (/* reexport */ CreateLathe),
  "CreateLineSystem": () => (/* reexport */ CreateLineSystem),
  "CreateLineSystemVertexData": () => (/* reexport */ CreateLineSystemVertexData),
  "CreateLines": () => (/* reexport */ CreateLines),
  "CreatePlane": () => (/* reexport */ CreatePlane),
  "CreatePlaneVertexData": () => (/* reexport */ CreatePlaneVertexData),
  "CreatePolygon": () => (/* reexport */ CreatePolygon),
  "CreatePolygonVertexData": () => (/* reexport */ CreatePolygonVertexData),
  "CreatePolyhedron": () => (/* reexport */ CreatePolyhedron),
  "CreatePolyhedronVertexData": () => (/* reexport */ CreatePolyhedronVertexData),
  "CreateResizedCopy": () => (/* reexport */ textureTools/* CreateResizedCopy */.cW),
  "CreateRibbon": () => (/* reexport */ CreateRibbon),
  "CreateRibbonVertexData": () => (/* reexport */ CreateRibbonVertexData),
  "CreateScreenshot": () => (/* reexport */ CreateScreenshot),
  "CreateScreenshotAsync": () => (/* reexport */ CreateScreenshotAsync),
  "CreateScreenshotUsingRenderTarget": () => (/* reexport */ CreateScreenshotUsingRenderTarget),
  "CreateScreenshotUsingRenderTargetAsync": () => (/* reexport */ CreateScreenshotUsingRenderTargetAsync),
  "CreateScreenshotWithResizeAsync": () => (/* reexport */ CreateScreenshotWithResizeAsync),
  "CreateSphere": () => (/* reexport */ CreateSphere),
  "CreateSphereVertexData": () => (/* reexport */ CreateSphereVertexData),
  "CreateTiledBox": () => (/* reexport */ CreateTiledBox),
  "CreateTiledBoxVertexData": () => (/* reexport */ CreateTiledBoxVertexData),
  "CreateTiledGround": () => (/* reexport */ CreateTiledGround),
  "CreateTiledGroundVertexData": () => (/* reexport */ CreateTiledGroundVertexData),
  "CreateTiledPlane": () => (/* reexport */ CreateTiledPlane),
  "CreateTiledPlaneVertexData": () => (/* reexport */ CreateTiledPlaneVertexData),
  "CreateTorus": () => (/* reexport */ CreateTorus),
  "CreateTorusKnot": () => (/* reexport */ CreateTorusKnot),
  "CreateTorusKnotVertexData": () => (/* reexport */ CreateTorusKnotVertexData),
  "CreateTorusVertexData": () => (/* reexport */ CreateTorusVertexData),
  "CreateTube": () => (/* reexport */ CreateTube),
  "CrossBlock": () => (/* reexport */ CrossBlock),
  "CubeMapToSphericalPolynomialTools": () => (/* reexport */ cubemapToSphericalPolynomial/* CubeMapToSphericalPolynomialTools */.$),
  "CubeTexture": () => (/* reexport */ Textures_cubeTexture/* CubeTexture */.B),
  "CubeTextureAssetTask": () => (/* reexport */ CubeTextureAssetTask),
  "CubicEase": () => (/* reexport */ CubicEase),
  "CullMode": () => (/* reexport */ CullMode),
  "CurrentScreenBlock": () => (/* reexport */ CurrentScreenBlock),
  "Curve3": () => (/* reexport */ math/* Curve3 */.j_),
  "CustomBlock": () => (/* reexport */ CustomBlock),
  "CustomOptimization": () => (/* reexport */ CustomOptimization),
  "CustomParticleEmitter": () => (/* reexport */ CustomParticleEmitter),
  "CustomProceduralTexture": () => (/* reexport */ CustomProceduralTexture),
  "CylinderBuilder": () => (/* reexport */ CylinderBuilder),
  "CylinderDirectedParticleEmitter": () => (/* reexport */ CylinderDirectedParticleEmitter),
  "CylinderParticleEmitter": () => (/* reexport */ CylinderParticleEmitter),
  "DDSTools": () => (/* reexport */ DDSTools),
  "DataBuffer": () => (/* reexport */ dataBuffer/* DataBuffer */.h),
  "DataReader": () => (/* reexport */ dataReader/* DataReader */.d),
  "DataStorage": () => (/* reexport */ DataStorage),
  "Database": () => (/* reexport */ Database),
  "DaydreamController": () => (/* reexport */ DaydreamController),
  "DebugLayer": () => (/* reexport */ DebugLayer),
  "DebugLayerTab": () => (/* reexport */ DebugLayerTab),
  "DecalBuilder": () => (/* reexport */ DecalBuilder),
  "Decode": () => (/* reexport */ stringTools/* Decode */.fJ),
  "DecodeBase64ToBinary": () => (/* reexport */ stringTools/* DecodeBase64ToBinary */.HQ),
  "DecodeBase64ToString": () => (/* reexport */ stringTools/* DecodeBase64ToString */.rP),
  "DecodeBase64UrlToBinary": () => (/* reexport */ fileTools/* DecodeBase64UrlToBinary */.$K),
  "DecodeBase64UrlToString": () => (/* reexport */ fileTools/* DecodeBase64UrlToString */.A2),
  "DeepCopier": () => (/* reexport */ deepCopier/* DeepCopier */.j),
  "DefaultCollisionCoordinator": () => (/* reexport */ DefaultCollisionCoordinator),
  "DefaultKTX2DecoderOptions": () => (/* reexport */ DefaultKTX2DecoderOptions),
  "DefaultLoadingScreen": () => (/* reexport */ DefaultLoadingScreen),
  "DefaultRenderingPipeline": () => (/* reexport */ DefaultRenderingPipeline),
  "Deferred": () => (/* reexport */ deferred/* Deferred */.B),
  "DepthCullingState": () => (/* reexport */ depthCullingState/* DepthCullingState */.k),
  "DepthOfFieldBlurPostProcess": () => (/* reexport */ DepthOfFieldBlurPostProcess),
  "DepthOfFieldEffect": () => (/* reexport */ DepthOfFieldEffect),
  "DepthOfFieldEffectBlurLevel": () => (/* reexport */ DepthOfFieldEffectBlurLevel),
  "DepthOfFieldMergePostProcess": () => (/* reexport */ DepthOfFieldMergePostProcess),
  "DepthOfFieldMergePostProcessOptions": () => (/* reexport */ DepthOfFieldMergePostProcessOptions),
  "DepthPeelingRenderer": () => (/* reexport */ DepthPeelingRenderer),
  "DepthPeelingSceneComponent": () => (/* reexport */ DepthPeelingSceneComponent),
  "DepthReducer": () => (/* reexport */ DepthReducer),
  "DepthRenderer": () => (/* reexport */ DepthRenderer),
  "DepthRendererSceneComponent": () => (/* reexport */ DepthRendererSceneComponent),
  "DepthSortedParticle": () => (/* reexport */ DepthSortedParticle),
  "DerivativeBlock": () => (/* reexport */ DerivativeBlock),
  "DesaturateBlock": () => (/* reexport */ DesaturateBlock),
  "DetailMapConfiguration": () => (/* reexport */ material_detailMapConfiguration/* DetailMapConfiguration */.p),
  "DeviceInputEventType": () => (/* reexport */ deviceInputEvents/* DeviceInputEventType */.g),
  "DeviceLostReason": () => (/* reexport */ DeviceLostReason),
  "DeviceOrientationCamera": () => (/* reexport */ DeviceOrientationCamera),
  "DeviceSource": () => (/* reexport */ deviceSource/* DeviceSource */.p),
  "DeviceSourceManager": () => (/* reexport */ deviceSourceManager/* DeviceSourceManager */.U),
  "DeviceType": () => (/* reexport */ deviceEnums/* DeviceType */.Yi),
  "DirectionalLight": () => (/* reexport */ directionalLight/* DirectionalLight */.O),
  "DirectionalLightFrustumViewer": () => (/* reexport */ DirectionalLightFrustumViewer),
  "DiscBuilder": () => (/* reexport */ DiscBuilder),
  "DiscardBlock": () => (/* reexport */ DiscardBlock),
  "DisplayPassPostProcess": () => (/* reexport */ DisplayPassPostProcess),
  "DistanceBlock": () => (/* reexport */ DistanceBlock),
  "DistanceConstraint": () => (/* reexport */ DistanceConstraint),
  "DistanceJoint": () => (/* reexport */ DistanceJoint),
  "DivideBlock": () => (/* reexport */ DivideBlock),
  "DoNothingAction": () => (/* reexport */ DoNothingAction),
  "DomManagement": () => (/* reexport */ domManagement/* DomManagement */.MZ),
  "DotBlock": () => (/* reexport */ DotBlock),
  "DracoCompression": () => (/* reexport */ dracoCompression/* DracoCompression */.J),
  "DrawWrapper": () => (/* reexport */ Materials_drawWrapper/* DrawWrapper */.q),
  "DualSenseInput": () => (/* reexport */ deviceEnums/* DualSenseInput */.s2),
  "DualShockButton": () => (/* reexport */ DualShockButton),
  "DualShockDpad": () => (/* reexport */ DualShockDpad),
  "DualShockInput": () => (/* reexport */ deviceEnums/* DualShockInput */.V7),
  "DualShockPad": () => (/* reexport */ DualShockPad),
  "DumpTools": () => (/* reexport */ dumpTools/* DumpTools */.B),
  "DynamicFloat32Array": () => (/* reexport */ DynamicFloat32Array),
  "DynamicTexture": () => (/* reexport */ DynamicTexture),
  "EasingFunction": () => (/* reexport */ EasingFunction),
  "EdgesRenderer": () => (/* reexport */ EdgesRenderer),
  "Effect": () => (/* reexport */ Materials_effect/* Effect */.Q),
  "EffectFallbacks": () => (/* reexport */ effectFallbacks/* EffectFallbacks */.L),
  "EffectLayer": () => (/* reexport */ EffectLayer),
  "EffectLayerSceneComponent": () => (/* reexport */ EffectLayerSceneComponent),
  "EffectRenderer": () => (/* reexport */ effectRenderer/* EffectRenderer */.I),
  "EffectWrapper": () => (/* reexport */ effectRenderer/* EffectWrapper */.H),
  "ElasticEase": () => (/* reexport */ ElasticEase),
  "ElbowBlock": () => (/* reexport */ ElbowBlock),
  "EncodeArrayBufferToBase64": () => (/* reexport */ stringTools/* EncodeArrayBufferToBase64 */.Gh),
  "EndsWith": () => (/* reexport */ stringTools/* EndsWith */.gi),
  "Engine": () => (/* reexport */ engine/* Engine */.D),
  "EngineFactory": () => (/* reexport */ EngineFactory),
  "EngineFormat": () => (/* reexport */ EngineFormat),
  "EngineInstrumentation": () => (/* reexport */ EngineInstrumentation),
  "EngineStore": () => (/* reexport */ engineStore/* EngineStore */.l),
  "EngineView": () => (/* reexport */ EngineView),
  "EnvironmentHelper": () => (/* reexport */ EnvironmentHelper),
  "EnvironmentTextureTools": () => (/* reexport */ environmentTextureTools/* EnvironmentTextureTools */.qh),
  "Epsilon": () => (/* reexport */ math/* Epsilon */.kn),
  "EquiRectangularCubeTexture": () => (/* reexport */ EquiRectangularCubeTexture),
  "EquiRectangularCubeTextureAssetTask": () => (/* reexport */ EquiRectangularCubeTextureAssetTask),
  "ErrorCodes": () => (/* reexport */ error/* ErrorCodes */.SM),
  "ErrorFilter": () => (/* reexport */ ErrorFilter),
  "EventConstants": () => (/* reexport */ deviceInputEvents/* EventConstants */.G),
  "EventState": () => (/* reexport */ observable/* EventState */.he),
  "ExecuteCodeAction": () => (/* reexport */ ExecuteCodeAction),
  "ExponentialEase": () => (/* reexport */ ExponentialEase),
  "ExternalTexture": () => (/* reexport */ ExternalTexture),
  "ExtractHighlightsPostProcess": () => (/* reexport */ ExtractHighlightsPostProcess),
  "ExtrudePolygon": () => (/* reexport */ ExtrudePolygon),
  "ExtrudeShape": () => (/* reexport */ ExtrudeShape),
  "ExtrudeShapeCustom": () => (/* reexport */ ExtrudeShapeCustom),
  "FactorGradient": () => (/* reexport */ FactorGradient),
  "FadeInOutBehavior": () => (/* reexport */ FadeInOutBehavior),
  "FeatureName": () => (/* reexport */ FeatureName),
  "FileTools": () => (/* reexport */ fileTools/* FileTools */.e0),
  "FileToolsOptions": () => (/* reexport */ fileTools/* FileToolsOptions */.rN),
  "FilesInput": () => (/* reexport */ FilesInput),
  "FilesInputStore": () => (/* reexport */ filesInputStore/* FilesInputStore */.X),
  "FilterMode": () => (/* reexport */ FilterMode),
  "FilterPostProcess": () => (/* reexport */ FilterPostProcess),
  "FluidRenderer": () => (/* reexport */ FluidRenderer),
  "FluidRendererSceneComponent": () => (/* reexport */ FluidRendererSceneComponent),
  "FluidRenderingDebug": () => (/* reexport */ FluidRenderingDebug),
  "FluidRenderingObject": () => (/* reexport */ FluidRenderingObject),
  "FluidRenderingObjectCustomParticles": () => (/* reexport */ FluidRenderingObjectCustomParticles),
  "FluidRenderingObjectParticleSystem": () => (/* reexport */ FluidRenderingObjectParticleSystem),
  "FluidRenderingTargetRenderer": () => (/* reexport */ FluidRenderingTargetRenderer),
  "FlyCamera": () => (/* reexport */ FlyCamera),
  "FlyCameraInputsManager": () => (/* reexport */ FlyCameraInputsManager),
  "FlyCameraKeyboardInput": () => (/* reexport */ FlyCameraKeyboardInput),
  "FlyCameraMouseInput": () => (/* reexport */ FlyCameraMouseInput),
  "FogBlock": () => (/* reexport */ FogBlock),
  "FollowBehavior": () => (/* reexport */ FollowBehavior),
  "FollowCamera": () => (/* reexport */ FollowCamera),
  "FollowCameraInputsManager": () => (/* reexport */ FollowCameraInputsManager),
  "FollowCameraKeyboardMoveInput": () => (/* reexport */ FollowCameraKeyboardMoveInput),
  "FollowCameraMouseWheelInput": () => (/* reexport */ FollowCameraMouseWheelInput),
  "FollowCameraPointersInput": () => (/* reexport */ FollowCameraPointersInput),
  "FragCoordBlock": () => (/* reexport */ FragCoordBlock),
  "FragDepthBlock": () => (/* reexport */ FragDepthBlock),
  "FragmentOutputBlock": () => (/* reexport */ FragmentOutputBlock),
  "FramingBehavior": () => (/* reexport */ FramingBehavior),
  "FreeCamera": () => (/* reexport */ Cameras_freeCamera/* FreeCamera */.c),
  "FreeCameraDeviceOrientationInput": () => (/* reexport */ FreeCameraDeviceOrientationInput),
  "FreeCameraGamepadInput": () => (/* reexport */ FreeCameraGamepadInput),
  "FreeCameraInputsManager": () => (/* reexport */ freeCameraInputsManager/* FreeCameraInputsManager */.a),
  "FreeCameraKeyboardMoveInput": () => (/* reexport */ freeCameraKeyboardMoveInput/* FreeCameraKeyboardMoveInput */.Y),
  "FreeCameraMouseInput": () => (/* reexport */ freeCameraMouseInput/* FreeCameraMouseInput */.A),
  "FreeCameraMouseWheelInput": () => (/* reexport */ freeCameraMouseWheelInput/* FreeCameraMouseWheelInput */.A),
  "FreeCameraTouchInput": () => (/* reexport */ freeCameraTouchInput/* FreeCameraTouchInput */.y),
  "FreeCameraVirtualJoystickInput": () => (/* reexport */ FreeCameraVirtualJoystickInput),
  "FresnelBlock": () => (/* reexport */ FresnelBlock),
  "FresnelParameters": () => (/* reexport */ FresnelParameters),
  "FromHalfFloat": () => (/* reexport */ textureTools/* FromHalfFloat */.qZ),
  "FrontFace": () => (/* reexport */ FrontFace),
  "FrontFacingBlock": () => (/* reexport */ FrontFacingBlock),
  "Frustum": () => (/* reexport */ math/* Frustum */.iW),
  "FxaaPostProcess": () => (/* reexport */ FxaaPostProcess),
  "GPUParticleSystem": () => (/* reexport */ GPUParticleSystem),
  "GUID": () => (/* reexport */ guid/* GUID */.x),
  "Gamepad": () => (/* reexport */ Gamepad),
  "GamepadCamera": () => (/* reexport */ GamepadCamera),
  "GamepadManager": () => (/* reexport */ GamepadManager),
  "GamepadSystemSceneComponent": () => (/* reexport */ GamepadSystemSceneComponent),
  "GearVRController": () => (/* reexport */ GearVRController),
  "GenerateBase64StringFromPixelData": () => (/* reexport */ copyTools/* GenerateBase64StringFromPixelData */.xj),
  "GenerateBase64StringFromTexture": () => (/* reexport */ copyTools/* GenerateBase64StringFromTexture */._u),
  "GenerateBase64StringFromTextureAsync": () => (/* reexport */ copyTools/* GenerateBase64StringFromTextureAsync */.Jj),
  "GenericController": () => (/* reexport */ GenericController),
  "GenericPad": () => (/* reexport */ GenericPad),
  "GeodesicData": () => (/* reexport */ GeodesicData),
  "Geometry": () => (/* reexport */ geometry/* Geometry */.Z),
  "GeometryBufferRenderer": () => (/* reexport */ GeometryBufferRenderer),
  "GeometryBufferRendererSceneComponent": () => (/* reexport */ GeometryBufferRendererSceneComponent),
  "GetClass": () => (/* reexport */ typeStore/* GetClass */.q),
  "GetDOMTextContent": () => (/* reexport */ domManagement/* GetDOMTextContent */.v),
  "GetEnvInfo": () => (/* reexport */ environmentTextureTools/* GetEnvInfo */.qJ),
  "GetEnvironmentBRDFTexture": () => (/* reexport */ brdfTextureTools/* GetEnvironmentBRDFTexture */.$),
  "GetInternalFormatFromBasisFormat": () => (/* reexport */ GetInternalFormatFromBasisFormat),
  "GetTGAHeader": () => (/* reexport */ GetTGAHeader),
  "Gizmo": () => (/* reexport */ Gizmo),
  "GizmoManager": () => (/* reexport */ GizmoManager),
  "GlowLayer": () => (/* reexport */ GlowLayer),
  "GoldbergMesh": () => (/* reexport */ GoldbergMesh),
  "GradientBlock": () => (/* reexport */ GradientBlock),
  "GradientBlockColorStep": () => (/* reexport */ GradientBlockColorStep),
  "GradientHelper": () => (/* reexport */ GradientHelper),
  "GrainPostProcess": () => (/* reexport */ GrainPostProcess),
  "GroundBuilder": () => (/* reexport */ GroundBuilder),
  "GroundMesh": () => (/* reexport */ GroundMesh),
  "HDRCubeTexture": () => (/* reexport */ HDRCubeTexture),
  "HDRCubeTextureAssetTask": () => (/* reexport */ HDRCubeTextureAssetTask),
  "HDRFiltering": () => (/* reexport */ HDRFiltering),
  "HDRTools": () => (/* reexport */ HDRTools),
  "HandConstraintBehavior": () => (/* reexport */ HandConstraintBehavior),
  "HandConstraintOrientation": () => (/* reexport */ HandConstraintOrientation),
  "HandConstraintVisibility": () => (/* reexport */ HandConstraintVisibility),
  "HandConstraintZone": () => (/* reexport */ HandConstraintZone),
  "HandPart": () => (/* reexport */ HandPart),
  "HardwareScalingOptimization": () => (/* reexport */ HardwareScalingOptimization),
  "HeightToNormalBlock": () => (/* reexport */ HeightToNormalBlock),
  "HemisphereBuilder": () => (/* reexport */ HemisphereBuilder),
  "HemisphericLight": () => (/* reexport */ hemisphericLight/* HemisphericLight */.e),
  "HemisphericParticleEmitter": () => (/* reexport */ HemisphericParticleEmitter),
  "HighlightLayer": () => (/* reexport */ HighlightLayer),
  "HighlightsPostProcess": () => (/* reexport */ HighlightsPostProcess),
  "Hinge2Joint": () => (/* reexport */ Hinge2Joint),
  "HingeConstraint": () => (/* reexport */ HingeConstraint),
  "HingeJoint": () => (/* reexport */ HingeJoint),
  "HtmlElementTexture": () => (/* reexport */ htmlElementTexture/* HtmlElementTexture */.s),
  "IWebXRControllerPhysicsOptions": () => (/* reexport */ IWebXRControllerPhysicsOptions),
  "IcoSphereBuilder": () => (/* reexport */ IcoSphereBuilder),
  "ImageAssetTask": () => (/* reexport */ ImageAssetTask),
  "ImageProcessingBlock": () => (/* reexport */ ImageProcessingBlock),
  "ImageProcessingConfiguration": () => (/* reexport */ Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.$),
  "ImageProcessingConfigurationDefines": () => (/* reexport */ Materials_imageProcessingConfiguration/* ImageProcessingConfigurationDefines */.b),
  "ImageProcessingPostProcess": () => (/* reexport */ ImageProcessingPostProcess),
  "ImageSourceBlock": () => (/* reexport */ ImageSourceBlock),
  "IncrementValueAction": () => (/* reexport */ IncrementValueAction),
  "IndexFormat": () => (/* reexport */ IndexFormat),
  "InputBlock": () => (/* reexport */ InputBlock),
  "InputStepMode": () => (/* reexport */ InputStepMode),
  "InspectableType": () => (/* reexport */ InspectableType),
  "InstancedLinesMesh": () => (/* reexport */ InstancedLinesMesh),
  "InstancedMesh": () => (/* reexport */ instancedMesh/* InstancedMesh */.S),
  "InstancesBlock": () => (/* reexport */ InstancesBlock),
  "InstantiatedEntries": () => (/* reexport */ assetContainer/* InstantiatedEntries */.ve),
  "InternalTexture": () => (/* reexport */ Textures_internalTexture/* InternalTexture */.l),
  "InternalTextureSource": () => (/* reexport */ Textures_internalTexture/* InternalTextureSource */.S),
  "InterpolateValueAction": () => (/* reexport */ InterpolateValueAction),
  "IntersectionInfo": () => (/* reexport */ intersectionInfo/* IntersectionInfo */.c),
  "IsBase64DataUrl": () => (/* reexport */ fileTools/* IsBase64DataUrl */.VL),
  "IsDocumentAvailable": () => (/* reexport */ domManagement/* IsDocumentAvailable */.n5),
  "IsFileURL": () => (/* reexport */ fileTools/* IsFileURL */.Uh),
  "IsNavigatorAvailable": () => (/* reexport */ domManagement/* IsNavigatorAvailable */.up),
  "IsWindowObjectExist": () => (/* reexport */ domManagement/* IsWindowObjectExist */.CG),
  "JoystickAxis": () => (/* reexport */ JoystickAxis),
  "KeepAssets": () => (/* reexport */ assetContainer/* KeepAssets */.fD),
  "KeyboardEventTypes": () => (/* reexport */ keyboardEvents/* KeyboardEventTypes */.OG),
  "KeyboardInfo": () => (/* reexport */ keyboardEvents/* KeyboardInfo */.NG),
  "KeyboardInfoPre": () => (/* reexport */ keyboardEvents/* KeyboardInfoPre */.WZ),
  "KhronosTextureContainer": () => (/* reexport */ KhronosTextureContainer),
  "KhronosTextureContainer2": () => (/* reexport */ KhronosTextureContainer2),
  "LatheBuilder": () => (/* reexport */ LatheBuilder),
  "Layer": () => (/* reexport */ Layer),
  "LayerSceneComponent": () => (/* reexport */ LayerSceneComponent),
  "LengthBlock": () => (/* reexport */ LengthBlock),
  "LensFlare": () => (/* reexport */ LensFlare),
  "LensFlareSystem": () => (/* reexport */ LensFlareSystem),
  "LensFlareSystemSceneComponent": () => (/* reexport */ LensFlareSystemSceneComponent),
  "LensFlaresOptimization": () => (/* reexport */ LensFlaresOptimization),
  "LensRenderingPipeline": () => (/* reexport */ LensRenderingPipeline),
  "LerpBlock": () => (/* reexport */ LerpBlock),
  "Light": () => (/* reexport */ Lights_light/* Light */._),
  "LightBlock": () => (/* reexport */ LightBlock),
  "LightGizmo": () => (/* reexport */ LightGizmo),
  "LightInformationBlock": () => (/* reexport */ LightInformationBlock),
  "LineEdgesRenderer": () => (/* reexport */ LineEdgesRenderer),
  "LinesBuilder": () => (/* reexport */ LinesBuilder),
  "LinesMesh": () => (/* reexport */ LinesMesh),
  "LoadFile": () => (/* reexport */ fileTools/* LoadFile */.vP),
  "LoadFileError": () => (/* reexport */ fileTools/* LoadFileError */.eh),
  "LoadImage": () => (/* reexport */ fileTools/* LoadImage */.r6),
  "LoadOp": () => (/* reexport */ LoadOp),
  "LoadTextureFromTranscodeResult": () => (/* reexport */ LoadTextureFromTranscodeResult),
  "LockConstraint": () => (/* reexport */ LockConstraint),
  "Logger": () => (/* reexport */ logger/* Logger */.Y),
  "MapMode": () => (/* reexport */ MapMode),
  "Material": () => (/* reexport */ Materials_material/* Material */.F),
  "MaterialAnisotropicDefines": () => (/* reexport */ pbrAnisotropicConfiguration/* MaterialAnisotropicDefines */.i),
  "MaterialClearCoatDefines": () => (/* reexport */ pbrClearCoatConfiguration/* MaterialClearCoatDefines */.d),
  "MaterialDefines": () => (/* reexport */ materialDefines/* MaterialDefines */.H),
  "MaterialDetailMapDefines": () => (/* reexport */ material_detailMapConfiguration/* MaterialDetailMapDefines */.G),
  "MaterialFlags": () => (/* reexport */ materialFlags/* MaterialFlags */.k),
  "MaterialHelper": () => (/* reexport */ materialHelper/* MaterialHelper */.G),
  "MaterialIridescenceDefines": () => (/* reexport */ pbrIridescenceConfiguration/* MaterialIridescenceDefines */.f),
  "MaterialPluginBase": () => (/* reexport */ materialPluginBase/* MaterialPluginBase */.n),
  "MaterialPluginEvent": () => (/* reexport */ materialPluginEvent/* MaterialPluginEvent */.S),
  "MaterialPluginManager": () => (/* reexport */ materialPluginManager/* MaterialPluginManager */.BK),
  "MaterialSheenDefines": () => (/* reexport */ pbrSheenConfiguration/* MaterialSheenDefines */.A),
  "MaterialSubSurfaceDefines": () => (/* reexport */ pbrSubSurfaceConfiguration/* MaterialSubSurfaceDefines */.H),
  "Matrix": () => (/* reexport */ math/* Matrix */.y3),
  "MatrixBuilderBlock": () => (/* reexport */ MatrixBuilderBlock),
  "MatrixDeterminantBlock": () => (/* reexport */ MatrixDeterminantBlock),
  "MatrixTransposeBlock": () => (/* reexport */ MatrixTransposeBlock),
  "MaxBlock": () => (/* reexport */ MaxBlock),
  "MergeMeshesOptimization": () => (/* reexport */ MergeMeshesOptimization),
  "Mesh": () => (/* reexport */ Meshes_mesh/* Mesh */.Kj),
  "MeshAssetTask": () => (/* reexport */ MeshAssetTask),
  "MeshBuilder": () => (/* reexport */ MeshBuilder),
  "MeshExploder": () => (/* reexport */ MeshExploder),
  "MeshLODLevel": () => (/* reexport */ meshLODLevel/* MeshLODLevel */.g),
  "MeshParticleEmitter": () => (/* reexport */ MeshParticleEmitter),
  "MeshoptCompression": () => (/* reexport */ meshoptCompression/* MeshoptCompression */.K),
  "MinBlock": () => (/* reexport */ MinBlock),
  "MinMaxReducer": () => (/* reexport */ MinMaxReducer),
  "MirrorTexture": () => (/* reexport */ MirrorTexture),
  "ModBlock": () => (/* reexport */ ModBlock),
  "ModelShape": () => (/* reexport */ ModelShape),
  "MorphTarget": () => (/* reexport */ morphTarget/* MorphTarget */.Y),
  "MorphTargetManager": () => (/* reexport */ morphTargetManager/* MorphTargetManager */.O),
  "MorphTargetsBlock": () => (/* reexport */ MorphTargetsBlock),
  "MotionBlurPostProcess": () => (/* reexport */ MotionBlurPostProcess),
  "MotorEnabledJoint": () => (/* reexport */ MotorEnabledJoint),
  "MultiMaterial": () => (/* reexport */ multiMaterial/* MultiMaterial */.G),
  "MultiObserver": () => (/* reexport */ MultiObserver),
  "MultiPointerScaleBehavior": () => (/* reexport */ MultiPointerScaleBehavior),
  "MultiRenderTarget": () => (/* reexport */ MultiRenderTarget),
  "MultiplyBlock": () => (/* reexport */ MultiplyBlock),
  "NLerpBlock": () => (/* reexport */ NLerpBlock),
  "NativeDataStream": () => (/* reexport */ NativeDataStream),
  "NativeEngine": () => (/* reexport */ NativeEngine),
  "NativePointerInput": () => (/* reexport */ deviceEnums/* NativePointerInput */.FP),
  "NativeXRFrame": () => (/* reexport */ NativeXRFrame),
  "NativeXRLayerRenderTargetTextureProvider": () => (/* reexport */ NativeXRLayerRenderTargetTextureProvider),
  "NativeXRLayerWrapper": () => (/* reexport */ NativeXRLayerWrapper),
  "NativeXRRenderTarget": () => (/* reexport */ NativeXRRenderTarget),
  "NegateBlock": () => (/* reexport */ NegateBlock),
  "Node": () => (/* reexport */ node/* Node */.N),
  "NodeMaterial": () => (/* reexport */ NodeMaterial),
  "NodeMaterialBlock": () => (/* reexport */ NodeMaterialBlock),
  "NodeMaterialBlockConnectionPointMode": () => (/* reexport */ NodeMaterialBlockConnectionPointMode),
  "NodeMaterialBlockConnectionPointTypes": () => (/* reexport */ NodeMaterialBlockConnectionPointTypes),
  "NodeMaterialBlockTargets": () => (/* reexport */ NodeMaterialBlockTargets),
  "NodeMaterialConnectionPoint": () => (/* reexport */ NodeMaterialConnectionPoint),
  "NodeMaterialConnectionPointCompatibilityStates": () => (/* reexport */ NodeMaterialConnectionPointCompatibilityStates),
  "NodeMaterialConnectionPointCustomObject": () => (/* reexport */ NodeMaterialConnectionPointCustomObject),
  "NodeMaterialConnectionPointDirection": () => (/* reexport */ NodeMaterialConnectionPointDirection),
  "NodeMaterialDefines": () => (/* reexport */ NodeMaterialDefines),
  "NodeMaterialModes": () => (/* reexport */ NodeMaterialModes),
  "NodeMaterialOptimizer": () => (/* reexport */ NodeMaterialOptimizer),
  "NodeMaterialSystemValues": () => (/* reexport */ NodeMaterialSystemValues),
  "NoiseProceduralTexture": () => (/* reexport */ NoiseProceduralTexture),
  "NormalBlendBlock": () => (/* reexport */ NormalBlendBlock),
  "NormalizeBlock": () => (/* reexport */ NormalizeBlock),
  "NullEngine": () => (/* reexport */ NullEngine),
  "NullEngineOptions": () => (/* reexport */ NullEngineOptions),
  "Observable": () => (/* reexport */ observable/* Observable */.y$),
  "Observer": () => (/* reexport */ observable/* Observer */.Qj),
  "OcclusionMaterial": () => (/* reexport */ OcclusionMaterial),
  "Octree": () => (/* reexport */ Octree),
  "OctreeBlock": () => (/* reexport */ OctreeBlock),
  "OctreeSceneComponent": () => (/* reexport */ OctreeSceneComponent),
  "OculusTouchController": () => (/* reexport */ OculusTouchController),
  "OimoJSPlugin": () => (/* reexport */ OimoJSPlugin),
  "OnAfterEnteringVRObservableEvent": () => (/* reexport */ OnAfterEnteringVRObservableEvent),
  "OneMinusBlock": () => (/* reexport */ OneMinusBlock),
  "Orientation": () => (/* reexport */ math/* Orientation */.i5),
  "OutlineRenderer": () => (/* reexport */ OutlineRenderer),
  "PBRAnisotropicConfiguration": () => (/* reexport */ pbrAnisotropicConfiguration/* PBRAnisotropicConfiguration */.u),
  "PBRBaseMaterial": () => (/* reexport */ pbrBaseMaterial/* PBRBaseMaterial */.m),
  "PBRBaseSimpleMaterial": () => (/* reexport */ PBRBaseSimpleMaterial),
  "PBRClearCoatConfiguration": () => (/* reexport */ pbrClearCoatConfiguration/* PBRClearCoatConfiguration */.Y),
  "PBRIridescenceConfiguration": () => (/* reexport */ pbrIridescenceConfiguration/* PBRIridescenceConfiguration */.B),
  "PBRMaterial": () => (/* reexport */ pbrMaterial/* PBRMaterial */.Y),
  "PBRMaterialDefines": () => (/* reexport */ pbrBaseMaterial/* PBRMaterialDefines */.r),
  "PBRMetallicRoughnessBlock": () => (/* reexport */ PBRMetallicRoughnessBlock),
  "PBRMetallicRoughnessMaterial": () => (/* reexport */ PBRMetallicRoughnessMaterial),
  "PBRSheenConfiguration": () => (/* reexport */ pbrSheenConfiguration/* PBRSheenConfiguration */.B),
  "PBRSpecularGlossinessMaterial": () => (/* reexport */ PBRSpecularGlossinessMaterial),
  "PBRSubSurfaceConfiguration": () => (/* reexport */ pbrSubSurfaceConfiguration/* PBRSubSurfaceConfiguration */.u),
  "PHI": () => (/* reexport */ math/* PHI */.Q_),
  "PadNumber": () => (/* reexport */ stringTools/* PadNumber */.zA),
  "PanoramaToCubeMapTools": () => (/* reexport */ PanoramaToCubeMapTools),
  "Particle": () => (/* reexport */ Particle),
  "ParticleBlendMultiplyBlock": () => (/* reexport */ ParticleBlendMultiplyBlock),
  "ParticleHelper": () => (/* reexport */ ParticleHelper),
  "ParticleRampGradientBlock": () => (/* reexport */ ParticleRampGradientBlock),
  "ParticleSystem": () => (/* reexport */ ParticleSystem),
  "ParticleSystemSet": () => (/* reexport */ ParticleSystemSet),
  "ParticleTextureBlock": () => (/* reexport */ ParticleTextureBlock),
  "ParticlesOptimization": () => (/* reexport */ ParticlesOptimization),
  "PassCubePostProcess": () => (/* reexport */ passPostProcess/* PassCubePostProcess */.Z),
  "PassPostProcess": () => (/* reexport */ passPostProcess/* PassPostProcess */.Q),
  "Path2": () => (/* reexport */ math/* Path2 */.ZZ),
  "Path3D": () => (/* reexport */ math/* Path3D */.$B),
  "PathCursor": () => (/* reexport */ PathCursor),
  "PerfCollectionStrategy": () => (/* reexport */ PerfCollectionStrategy),
  "PerfCounter": () => (/* reexport */ perfCounter/* PerfCounter */.z),
  "PerformanceConfigurator": () => (/* reexport */ performanceConfigurator/* PerformanceConfigurator */.Z),
  "PerformanceMonitor": () => (/* reexport */ performanceMonitor/* PerformanceMonitor */.A),
  "PerformanceViewerCollector": () => (/* reexport */ PerformanceViewerCollector),
  "PerturbNormalBlock": () => (/* reexport */ PerturbNormalBlock),
  "PhotoDome": () => (/* reexport */ PhotoDome),
  "PhysicsAggregate": () => (/* reexport */ PhysicsAggregate),
  "PhysicsBody": () => (/* reexport */ PhysicsBody),
  "PhysicsConstraint": () => (/* reexport */ PhysicsConstraint),
  "PhysicsEngine": () => (/* reexport */ PhysicsEngine),
  "PhysicsEngineV2": () => (/* reexport */ physicsEngine_PhysicsEngine),
  "PhysicsHelper": () => (/* reexport */ PhysicsHelper),
  "PhysicsImpostor": () => (/* reexport */ PhysicsImpostor),
  "PhysicsJoint": () => (/* reexport */ PhysicsJoint),
  "PhysicsMaterial": () => (/* reexport */ PhysicsMaterial),
  "PhysicsRadialExplosionEventOptions": () => (/* reexport */ PhysicsRadialExplosionEventOptions),
  "PhysicsRadialImpulseFalloff": () => (/* reexport */ PhysicsRadialImpulseFalloff),
  "PhysicsRaycastResult": () => (/* reexport */ PhysicsRaycastResult),
  "PhysicsShape": () => (/* reexport */ PhysicsShape),
  "PhysicsShapeBox": () => (/* reexport */ PhysicsShapeBox),
  "PhysicsShapeCapsule": () => (/* reexport */ PhysicsShapeCapsule),
  "PhysicsShapeContainer": () => (/* reexport */ PhysicsShapeContainer),
  "PhysicsShapeConvexHull": () => (/* reexport */ PhysicsShapeConvexHull),
  "PhysicsShapeCylinder": () => (/* reexport */ PhysicsShapeCylinder),
  "PhysicsShapeMesh": () => (/* reexport */ PhysicsShapeMesh),
  "PhysicsShapeSphere": () => (/* reexport */ PhysicsShapeSphere),
  "PhysicsUpdraftEventOptions": () => (/* reexport */ PhysicsUpdraftEventOptions),
  "PhysicsUpdraftMode": () => (/* reexport */ PhysicsUpdraftMode),
  "PhysicsViewer": () => (/* reexport */ PhysicsViewer),
  "PhysicsVortexEventOptions": () => (/* reexport */ PhysicsVortexEventOptions),
  "PickingInfo": () => (/* reexport */ Collisions_pickingInfo/* PickingInfo */.p),
  "PivotTools": () => (/* reexport */ PivotTools),
  "Plane": () => (/* reexport */ math/* Plane */.JO),
  "PlaneBuilder": () => (/* reexport */ PlaneBuilder),
  "PlaneDragGizmo": () => (/* reexport */ PlaneDragGizmo),
  "PlaneRotationGizmo": () => (/* reexport */ PlaneRotationGizmo),
  "PlayAnimationAction": () => (/* reexport */ PlayAnimationAction),
  "PlaySoundAction": () => (/* reexport */ PlaySoundAction),
  "PointColor": () => (/* reexport */ PointColor),
  "PointLight": () => (/* reexport */ pointLight/* PointLight */.c),
  "PointParticleEmitter": () => (/* reexport */ PointParticleEmitter),
  "PointerDragBehavior": () => (/* reexport */ PointerDragBehavior),
  "PointerEventTypes": () => (/* reexport */ pointerEvents/* PointerEventTypes */.kD),
  "PointerInfo": () => (/* reexport */ pointerEvents/* PointerInfo */.R5),
  "PointerInfoBase": () => (/* reexport */ pointerEvents/* PointerInfoBase */.CU),
  "PointerInfoPre": () => (/* reexport */ pointerEvents/* PointerInfoPre */.FV),
  "PointerInput": () => (/* reexport */ deviceEnums/* PointerInput */.Fz),
  "PointsCloudSystem": () => (/* reexport */ PointsCloudSystem),
  "PointsGroup": () => (/* reexport */ PointsGroup),
  "Polar": () => (/* reexport */ Polar),
  "Polygon": () => (/* reexport */ polygonMesh_Polygon),
  "PolygonBuilder": () => (/* reexport */ PolygonBuilder),
  "PolygonMeshBuilder": () => (/* reexport */ PolygonMeshBuilder),
  "PolyhedronBuilder": () => (/* reexport */ PolyhedronBuilder),
  "PolyhedronData": () => (/* reexport */ PolyhedronData),
  "PoseEnabledController": () => (/* reexport */ PoseEnabledController),
  "PoseEnabledControllerHelper": () => (/* reexport */ PoseEnabledControllerHelper),
  "PoseEnabledControllerType": () => (/* reexport */ PoseEnabledControllerType),
  "PositionGizmo": () => (/* reexport */ PositionGizmo),
  "PositionNormalTextureVertex": () => (/* reexport */ math/* PositionNormalTextureVertex */.eN),
  "PositionNormalVertex": () => (/* reexport */ math/* PositionNormalVertex */.$S),
  "PostProcess": () => (/* reexport */ PostProcesses_postProcess/* PostProcess */.D),
  "PostProcessManager": () => (/* reexport */ postProcessManager/* PostProcessManager */.O),
  "PostProcessRenderEffect": () => (/* reexport */ PostProcessRenderEffect),
  "PostProcessRenderPipeline": () => (/* reexport */ PostProcessRenderPipeline),
  "PostProcessRenderPipelineManager": () => (/* reexport */ PostProcessRenderPipelineManager),
  "PostProcessRenderPipelineManagerSceneComponent": () => (/* reexport */ PostProcessRenderPipelineManagerSceneComponent),
  "PostProcessesOptimization": () => (/* reexport */ PostProcessesOptimization),
  "PosterizeBlock": () => (/* reexport */ PosterizeBlock),
  "PowBlock": () => (/* reexport */ PowBlock),
  "PowerEase": () => (/* reexport */ PowerEase),
  "PowerPreference": () => (/* reexport */ PowerPreference),
  "PrePassRenderer": () => (/* reexport */ PrePassRenderer),
  "PrePassRendererSceneComponent": () => (/* reexport */ PrePassRendererSceneComponent),
  "PrecisionDate": () => (/* reexport */ precisionDate/* PrecisionDate */.F),
  "PredefinedColorSpace": () => (/* reexport */ PredefinedColorSpace),
  "PredicateCondition": () => (/* reexport */ PredicateCondition),
  "PressureObserverWrapper": () => (/* reexport */ PressureObserverWrapper),
  "PrimitiveTopology": () => (/* reexport */ PrimitiveTopology),
  "PrismaticConstraint": () => (/* reexport */ PrismaticConstraint),
  "ProceduralTexture": () => (/* reexport */ ProceduralTexture),
  "ProceduralTextureSceneComponent": () => (/* reexport */ ProceduralTextureSceneComponent),
  "PropertyTypeForEdition": () => (/* reexport */ PropertyTypeForEdition),
  "PushMaterial": () => (/* reexport */ pushMaterial/* PushMaterial */.a),
  "QuadraticEase": () => (/* reexport */ QuadraticEase),
  "QuadraticErrorSimplification": () => (/* reexport */ QuadraticErrorSimplification),
  "QuarticEase": () => (/* reexport */ QuarticEase),
  "Quaternion": () => (/* reexport */ math/* Quaternion */._f),
  "QueryType": () => (/* reexport */ QueryType),
  "QuinticEase": () => (/* reexport */ QuinticEase),
  "RGBDTextureTools": () => (/* reexport */ rgbdTextureTools/* RGBDTextureTools */.r),
  "RandomGUID": () => (/* reexport */ guid/* RandomGUID */.f),
  "RandomNumberBlock": () => (/* reexport */ RandomNumberBlock),
  "RawCubeTexture": () => (/* reexport */ rawCubeTexture/* RawCubeTexture */.N),
  "RawTexture": () => (/* reexport */ rawTexture/* RawTexture */.l),
  "RawTexture2DArray": () => (/* reexport */ rawTexture2DArray/* RawTexture2DArray */.e),
  "RawTexture3D": () => (/* reexport */ RawTexture3D),
  "Ray": () => (/* reexport */ Ray),
  "RayHelper": () => (/* reexport */ RayHelper),
  "ReadFile": () => (/* reexport */ fileTools/* ReadFile */.Ip),
  "ReadFileError": () => (/* reexport */ fileTools/* ReadFileError */.RC),
  "RecastJSCrowd": () => (/* reexport */ RecastJSCrowd),
  "RecastJSPlugin": () => (/* reexport */ RecastJSPlugin),
  "ReciprocalBlock": () => (/* reexport */ ReciprocalBlock),
  "ReflectBlock": () => (/* reexport */ ReflectBlock),
  "ReflectionBlock": () => (/* reexport */ ReflectionBlock),
  "ReflectionProbe": () => (/* reexport */ ReflectionProbe),
  "ReflectionTextureBlock": () => (/* reexport */ ReflectionTextureBlock),
  "Reflector": () => (/* reexport */ Reflector),
  "RefractBlock": () => (/* reexport */ RefractBlock),
  "RefractionBlock": () => (/* reexport */ RefractionBlock),
  "RefractionPostProcess": () => (/* reexport */ RefractionPostProcess),
  "RefractionTexture": () => (/* reexport */ RefractionTexture),
  "RegisterClass": () => (/* reexport */ typeStore/* RegisterClass */.H),
  "RegisterMaterialPlugin": () => (/* reexport */ materialPluginManager/* RegisterMaterialPlugin */.rs),
  "RegisterNativeTypeAsync": () => (/* reexport */ RegisterNativeTypeAsync),
  "RemapBlock": () => (/* reexport */ RemapBlock),
  "RenderPassTimestampLocation": () => (/* reexport */ RenderPassTimestampLocation),
  "RenderTargetTexture": () => (/* reexport */ Textures_renderTargetTexture/* RenderTargetTexture */._),
  "RenderTargetWrapper": () => (/* reexport */ renderTargetWrapper/* RenderTargetWrapper */.r),
  "RenderTargetsOptimization": () => (/* reexport */ RenderTargetsOptimization),
  "RenderingGroup": () => (/* reexport */ renderingGroup/* RenderingGroup */.S),
  "RenderingGroupInfo": () => (/* reexport */ renderingManager/* RenderingGroupInfo */.t),
  "RenderingManager": () => (/* reexport */ renderingManager/* RenderingManager */.$),
  "ReplaceColorBlock": () => (/* reexport */ ReplaceColorBlock),
  "RequestFile": () => (/* reexport */ fileTools/* RequestFile */.FV),
  "RequestFileError": () => (/* reexport */ fileTools/* RequestFileError */.kK),
  "RetryStrategy": () => (/* reexport */ retryStrategy/* RetryStrategy */.b),
  "RibbonBuilder": () => (/* reexport */ RibbonBuilder),
  "RollingAverage": () => (/* reexport */ performanceMonitor/* RollingAverage */.Z),
  "Rotate2dBlock": () => (/* reexport */ Rotate2dBlock),
  "RotationGizmo": () => (/* reexport */ RotationGizmo),
  "RuntimeAnimation": () => (/* reexport */ RuntimeAnimation),
  "RuntimeError": () => (/* reexport */ error/* RuntimeError */.LH),
  "SSAO2RenderingPipeline": () => (/* reexport */ SSAO2RenderingPipeline),
  "SSAORenderingPipeline": () => (/* reexport */ SSAORenderingPipeline),
  "SamplerBindingType": () => (/* reexport */ SamplerBindingType),
  "Scalar": () => (/* reexport */ math_scalar/* Scalar */.R),
  "ScaleBlock": () => (/* reexport */ ScaleBlock),
  "ScaleGizmo": () => (/* reexport */ ScaleGizmo),
  "Scene": () => (/* reexport */ core_scene/* Scene */.x),
  "SceneComponentConstants": () => (/* reexport */ sceneComponent/* SceneComponentConstants */.l),
  "SceneDepthBlock": () => (/* reexport */ SceneDepthBlock),
  "SceneInstrumentation": () => (/* reexport */ SceneInstrumentation),
  "SceneLoader": () => (/* reexport */ sceneLoader/* SceneLoader */.n),
  "SceneLoaderAnimationGroupLoadingMode": () => (/* reexport */ sceneLoader/* SceneLoaderAnimationGroupLoadingMode */.O),
  "SceneLoaderFlags": () => (/* reexport */ sceneLoaderFlags/* SceneLoaderFlags */.Z),
  "SceneOptimization": () => (/* reexport */ SceneOptimization),
  "SceneOptimizer": () => (/* reexport */ SceneOptimizer),
  "SceneOptimizerOptions": () => (/* reexport */ SceneOptimizerOptions),
  "ScenePerformancePriority": () => (/* reexport */ core_scene/* ScenePerformancePriority */.a),
  "SceneRecorder": () => (/* reexport */ SceneRecorder),
  "SceneSerializer": () => (/* reexport */ SceneSerializer),
  "ScreenSizeBlock": () => (/* reexport */ ScreenSizeBlock),
  "ScreenSpaceBlock": () => (/* reexport */ ScreenSpaceBlock),
  "ScreenSpaceCurvaturePostProcess": () => (/* reexport */ ScreenSpaceCurvaturePostProcess),
  "ScreenSpaceReflectionPostProcess": () => (/* reexport */ ScreenSpaceReflectionPostProcess),
  "ScreenshotTools": () => (/* reexport */ ScreenshotTools),
  "SerializationHelper": () => (/* reexport */ decorators/* SerializationHelper */.p4),
  "SetCorsBehavior": () => (/* reexport */ fileTools/* SetCorsBehavior */.$M),
  "SetParentAction": () => (/* reexport */ SetParentAction),
  "SetStateAction": () => (/* reexport */ SetStateAction),
  "SetValueAction": () => (/* reexport */ SetValueAction),
  "ShaderCodeInliner": () => (/* reexport */ ShaderCodeInliner),
  "ShaderLanguage": () => (/* reexport */ Materials_shaderLanguage/* ShaderLanguage */.x),
  "ShaderMaterial": () => (/* reexport */ shaderMaterial/* ShaderMaterial */.j),
  "ShaderStage": () => (/* reexport */ ShaderStage),
  "ShaderStore": () => (/* reexport */ shaderStore/* ShaderStore */.v),
  "ShadowDepthWrapper": () => (/* reexport */ ShadowDepthWrapper),
  "ShadowGenerator": () => (/* reexport */ ShadowGenerator),
  "ShadowGeneratorSceneComponent": () => (/* reexport */ ShadowGeneratorSceneComponent),
  "ShadowLight": () => (/* reexport */ shadowLight/* ShadowLight */.O),
  "ShadowMapBlock": () => (/* reexport */ ShadowMapBlock),
  "ShadowsOptimization": () => (/* reexport */ ShadowsOptimization),
  "ShapeBuilder": () => (/* reexport */ ShapeBuilder),
  "ShapeType": () => (/* reexport */ ShapeType),
  "SharpenPostProcess": () => (/* reexport */ SharpenPostProcess),
  "SheenBlock": () => (/* reexport */ SheenBlock),
  "SimplexPerlin3DBlock": () => (/* reexport */ SimplexPerlin3DBlock),
  "SimplicationQueueSceneComponent": () => (/* reexport */ SimplicationQueueSceneComponent),
  "SimplificationQueue": () => (/* reexport */ SimplificationQueue),
  "SimplificationSettings": () => (/* reexport */ SimplificationSettings),
  "SimplificationType": () => (/* reexport */ SimplificationType),
  "SineEase": () => (/* reexport */ SineEase),
  "SixDofDragBehavior": () => (/* reexport */ SixDofDragBehavior),
  "Size": () => (/* reexport */ math/* Size */.$u),
  "Skeleton": () => (/* reexport */ Bones_skeleton/* Skeleton */.O),
  "SkeletonViewer": () => (/* reexport */ SkeletonViewer),
  "SliderConstraint": () => (/* reexport */ SliderConstraint),
  "SmartArray": () => (/* reexport */ smartArray/* SmartArray */.t),
  "SmartArrayNoDuplicate": () => (/* reexport */ smartArray/* SmartArrayNoDuplicate */.f),
  "SmoothStepBlock": () => (/* reexport */ SmoothStepBlock),
  "SolidParticle": () => (/* reexport */ SolidParticle),
  "SolidParticleSystem": () => (/* reexport */ SolidParticleSystem),
  "SolidParticleVertex": () => (/* reexport */ SolidParticleVertex),
  "Sound": () => (/* reexport */ sound/* Sound */.$),
  "SoundTrack": () => (/* reexport */ SoundTrack),
  "SourceTextureFormat": () => (/* reexport */ SourceTextureFormat),
  "Space": () => (/* reexport */ math/* Space */.T),
  "SphereBuilder": () => (/* reexport */ SphereBuilder),
  "SphereDirectedParticleEmitter": () => (/* reexport */ SphereDirectedParticleEmitter),
  "SphereParticleEmitter": () => (/* reexport */ SphereParticleEmitter),
  "Spherical": () => (/* reexport */ Spherical),
  "SphericalHarmonics": () => (/* reexport */ sphericalPolynomial/* SphericalHarmonics */._),
  "SphericalPolynomial": () => (/* reexport */ sphericalPolynomial/* SphericalPolynomial */.i),
  "SpotLight": () => (/* reexport */ spotLight/* SpotLight */.P),
  "Sprite": () => (/* reexport */ Sprite),
  "SpriteManager": () => (/* reexport */ SpriteManager),
  "SpriteMap": () => (/* reexport */ SpriteMap),
  "SpritePackedManager": () => (/* reexport */ SpritePackedManager),
  "SpriteSceneComponent": () => (/* reexport */ SpriteSceneComponent),
  "Stage": () => (/* reexport */ sceneComponent/* Stage */.H),
  "StandardMaterial": () => (/* reexport */ standardMaterial/* StandardMaterial */.K),
  "StandardMaterialDefines": () => (/* reexport */ standardMaterial/* StandardMaterialDefines */.R),
  "StandardRenderingPipeline": () => (/* reexport */ StandardRenderingPipeline),
  "StartsWith": () => (/* reexport */ stringTools/* StartsWith */.Ri),
  "StateCondition": () => (/* reexport */ StateCondition),
  "StencilOperation": () => (/* reexport */ StencilOperation),
  "StencilState": () => (/* reexport */ stencilState/* StencilState */.s),
  "StencilStateComposer": () => (/* reexport */ stencilStateComposer/* StencilStateComposer */.C),
  "StepBlock": () => (/* reexport */ StepBlock),
  "StereoscopicArcRotateCamera": () => (/* reexport */ StereoscopicArcRotateCamera),
  "StereoscopicFreeCamera": () => (/* reexport */ StereoscopicFreeCamera),
  "StereoscopicGamepadCamera": () => (/* reexport */ StereoscopicGamepadCamera),
  "StereoscopicInterlacePostProcess": () => (/* reexport */ StereoscopicInterlacePostProcess),
  "StereoscopicInterlacePostProcessI": () => (/* reexport */ StereoscopicInterlacePostProcessI),
  "StereoscopicScreenUniversalCamera": () => (/* reexport */ StereoscopicScreenUniversalCamera),
  "StereoscopicUniversalCamera": () => (/* reexport */ StereoscopicUniversalCamera),
  "StickValues": () => (/* reexport */ StickValues),
  "StopAnimationAction": () => (/* reexport */ StopAnimationAction),
  "StopSoundAction": () => (/* reexport */ StopSoundAction),
  "StorageBuffer": () => (/* reexport */ StorageBuffer),
  "StorageTextureAccess": () => (/* reexport */ StorageTextureAccess),
  "StoreOp": () => (/* reexport */ StoreOp),
  "StringDictionary": () => (/* reexport */ stringDictionary/* StringDictionary */.x),
  "StringTools": () => (/* reexport */ stringTools/* StringTools */.Ml),
  "SubEmitter": () => (/* reexport */ SubEmitter),
  "SubEmitterType": () => (/* reexport */ SubEmitterType),
  "SubMesh": () => (/* reexport */ subMesh/* SubMesh */.P),
  "SubSurfaceBlock": () => (/* reexport */ SubSurfaceBlock),
  "SubSurfaceSceneComponent": () => (/* reexport */ SubSurfaceSceneComponent),
  "SubtractBlock": () => (/* reexport */ SubtractBlock),
  "SurfaceMagnetismBehavior": () => (/* reexport */ SurfaceMagnetismBehavior),
  "SwitchBooleanAction": () => (/* reexport */ SwitchBooleanAction),
  "SwitchInput": () => (/* reexport */ deviceEnums/* SwitchInput */.D_),
  "TBNBlock": () => (/* reexport */ TBNBlock),
  "TGATools": () => (/* reexport */ TGATools),
  "Tags": () => (/* reexport */ tags/* Tags */.$),
  "TargetCamera": () => (/* reexport */ targetCamera/* TargetCamera */.C),
  "TargetedAnimation": () => (/* reexport */ Animations_animationGroup/* TargetedAnimation */.U),
  "TestBase64DataUrl": () => (/* reexport */ fileTools/* TestBase64DataUrl */.qC),
  "TextFileAssetTask": () => (/* reexport */ TextFileAssetTask),
  "Texture": () => (/* reexport */ Textures_texture/* Texture */.x),
  "TextureAspect": () => (/* reexport */ TextureAspect),
  "TextureAssetTask": () => (/* reexport */ TextureAssetTask),
  "TextureBlock": () => (/* reexport */ TextureBlock),
  "TextureDimension": () => (/* reexport */ TextureDimension),
  "TextureFormat": () => (/* reexport */ TextureFormat),
  "TextureOptimization": () => (/* reexport */ TextureOptimization),
  "TexturePacker": () => (/* reexport */ TexturePacker),
  "TexturePackerFrame": () => (/* reexport */ TexturePackerFrame),
  "TextureSampleType": () => (/* reexport */ TextureSampleType),
  "TextureSampler": () => (/* reexport */ textureSampler/* TextureSampler */.a),
  "TextureTools": () => (/* reexport */ textureTools/* TextureTools */.Oi),
  "TextureUsage": () => (/* reexport */ TextureUsage),
  "TextureViewDimension": () => (/* reexport */ TextureViewDimension),
  "ThinEngine": () => (/* reexport */ thinEngine/* ThinEngine */.B),
  "ThinRenderTargetTexture": () => (/* reexport */ thinRenderTargetTexture/* ThinRenderTargetTexture */.R),
  "ThinTexture": () => (/* reexport */ thinTexture/* ThinTexture */.g),
  "TiledBoxBuilder": () => (/* reexport */ TiledBoxBuilder),
  "TiledPlaneBuilder": () => (/* reexport */ TiledPlaneBuilder),
  "TimerState": () => (/* reexport */ TimerState),
  "TmpColors": () => (/* reexport */ math/* TmpColors */.zZ),
  "TmpVectors": () => (/* reexport */ math/* TmpVectors */.jp),
  "ToGammaSpace": () => (/* reexport */ math/* ToGammaSpace */.zp),
  "ToHalfFloat": () => (/* reexport */ textureTools/* ToHalfFloat */.ay),
  "ToLinearSpace": () => (/* reexport */ math/* ToLinearSpace */.Nn),
  "TonemapPostProcess": () => (/* reexport */ TonemapPostProcess),
  "TonemappingOperator": () => (/* reexport */ TonemappingOperator),
  "Tools": () => (/* reexport */ tools/* Tools */.w1),
  "TorusBuilder": () => (/* reexport */ TorusBuilder),
  "TorusKnotBuilder": () => (/* reexport */ TorusKnotBuilder),
  "TouchCamera": () => (/* reexport */ TouchCamera),
  "TrailMesh": () => (/* reexport */ TrailMesh),
  "Trajectory": () => (/* reexport */ Trajectory),
  "TrajectoryClassifier": () => (/* reexport */ TrajectoryClassifier),
  "TranscodeAsync": () => (/* reexport */ TranscodeAsync),
  "TranscodeTarget": () => (/* reexport */ TranscodeTarget),
  "TransformBlock": () => (/* reexport */ TransformBlock),
  "TransformNode": () => (/* reexport */ transformNode/* TransformNode */.Y),
  "TriPlanarBlock": () => (/* reexport */ TriPlanarBlock),
  "TrigonometryBlock": () => (/* reexport */ TrigonometryBlock),
  "TrigonometryBlockOperations": () => (/* reexport */ TrigonometryBlockOperations),
  "TubeBuilder": () => (/* reexport */ TubeBuilder),
  "TwirlBlock": () => (/* reexport */ TwirlBlock),
  "UniformBuffer": () => (/* reexport */ uniformBuffer/* UniformBuffer */.M),
  "UniversalCamera": () => (/* reexport */ UniversalCamera),
  "UnregisterAllMaterialPlugins": () => (/* reexport */ materialPluginManager/* UnregisterAllMaterialPlugins */.Dh),
  "UnregisterMaterialPlugin": () => (/* reexport */ materialPluginManager/* UnregisterMaterialPlugin */.jD),
  "UploadContent": () => (/* reexport */ UploadContent),
  "UploadEnvLevelsAsync": () => (/* reexport */ environmentTextureTools/* UploadEnvLevelsAsync */.Ro),
  "UploadEnvSpherical": () => (/* reexport */ environmentTextureTools/* UploadEnvSpherical */.qC),
  "UploadLevelsAsync": () => (/* reexport */ environmentTextureTools/* UploadLevelsAsync */.qZ),
  "UtilityLayerRenderer": () => (/* reexport */ UtilityLayerRenderer),
  "VRCameraMetrics": () => (/* reexport */ VRCameraMetrics),
  "VRDeviceOrientationArcRotateCamera": () => (/* reexport */ VRDeviceOrientationArcRotateCamera),
  "VRDeviceOrientationFreeCamera": () => (/* reexport */ VRDeviceOrientationFreeCamera),
  "VRDeviceOrientationGamepadCamera": () => (/* reexport */ VRDeviceOrientationGamepadCamera),
  "VRDistortionCorrectionPostProcess": () => (/* reexport */ VRDistortionCorrectionPostProcess),
  "VRExperienceHelper": () => (/* reexport */ VRExperienceHelper),
  "VRMultiviewToSingleviewPostProcess": () => (/* reexport */ VRMultiviewToSingleviewPostProcess),
  "ValidatedNativeDataStream": () => (/* reexport */ ValidatedNativeDataStream),
  "ValueCondition": () => (/* reexport */ ValueCondition),
  "Vector2": () => (/* reexport */ math/* Vector2 */.FM),
  "Vector3": () => (/* reexport */ math/* Vector3 */.P),
  "Vector4": () => (/* reexport */ math/* Vector4 */.Lt),
  "VectorMergerBlock": () => (/* reexport */ VectorMergerBlock),
  "VectorSplitterBlock": () => (/* reexport */ VectorSplitterBlock),
  "VertexAnimationBaker": () => (/* reexport */ VertexAnimationBaker),
  "VertexBuffer": () => (/* reexport */ Buffers_buffer/* VertexBuffer */.o),
  "VertexData": () => (/* reexport */ mesh_vertexData/* VertexData */.x),
  "VertexFormat": () => (/* reexport */ VertexFormat),
  "VertexOutputBlock": () => (/* reexport */ VertexOutputBlock),
  "VideoDome": () => (/* reexport */ VideoDome),
  "VideoRecorder": () => (/* reexport */ VideoRecorder),
  "VideoTexture": () => (/* reexport */ VideoTexture),
  "ViewDirectionBlock": () => (/* reexport */ ViewDirectionBlock),
  "Viewport": () => (/* reexport */ math/* Viewport */.l_),
  "VirtualJoystick": () => (/* reexport */ VirtualJoystick),
  "VirtualJoysticksCamera": () => (/* reexport */ VirtualJoysticksCamera),
  "ViveController": () => (/* reexport */ ViveController),
  "VolumetricLightScatteringPostProcess": () => (/* reexport */ VolumetricLightScatteringPostProcess),
  "VoronoiNoiseBlock": () => (/* reexport */ VoronoiNoiseBlock),
  "WaveBlock": () => (/* reexport */ WaveBlock),
  "WaveBlockKind": () => (/* reexport */ WaveBlockKind),
  "WebGL2ParticleSystem": () => (/* reexport */ WebGL2ParticleSystem),
  "WebGL2ShaderProcessor": () => (/* reexport */ webGL2ShaderProcessors/* WebGL2ShaderProcessor */.C),
  "WebGLDataBuffer": () => (/* reexport */ webGLDataBuffer/* WebGLDataBuffer */.M),
  "WebGLHardwareTexture": () => (/* reexport */ webGLHardwareTexture/* WebGLHardwareTexture */.B),
  "WebGLPipelineContext": () => (/* reexport */ webGLPipelineContext/* WebGLPipelineContext */.y),
  "WebGPUCacheBindGroups": () => (/* reexport */ WebGPUCacheBindGroups),
  "WebGPUCacheRenderPipeline": () => (/* reexport */ WebGPUCacheRenderPipeline),
  "WebGPUCacheRenderPipelineTree": () => (/* reexport */ WebGPUCacheRenderPipelineTree),
  "WebGPUCacheSampler": () => (/* reexport */ WebGPUCacheSampler),
  "WebGPUDataBuffer": () => (/* reexport */ WebGPUDataBuffer),
  "WebGPUDrawContext": () => (/* reexport */ WebGPUDrawContext),
  "WebGPUEngine": () => (/* reexport */ WebGPUEngine),
  "WebGPUTintWASM": () => (/* reexport */ WebGPUTintWASM),
  "WebRequest": () => (/* reexport */ webRequest/* WebRequest */.g),
  "WebVRController": () => (/* reexport */ WebVRController),
  "WebVRFreeCamera": () => (/* reexport */ WebVRFreeCamera),
  "WebXRAbstractFeature": () => (/* reexport */ WebXRAbstractFeature),
  "WebXRAbstractMotionController": () => (/* reexport */ WebXRAbstractMotionController),
  "WebXRAnchorSystem": () => (/* reexport */ WebXRAnchorSystem),
  "WebXRBackgroundRemover": () => (/* reexport */ WebXRBackgroundRemover),
  "WebXRCamera": () => (/* reexport */ WebXRCamera),
  "WebXRCompositionLayerWrapper": () => (/* reexport */ WebXRCompositionLayerWrapper),
  "WebXRControllerComponent": () => (/* reexport */ WebXRControllerComponent),
  "WebXRControllerMovement": () => (/* reexport */ WebXRControllerMovement),
  "WebXRControllerPhysics": () => (/* reexport */ WebXRControllerPhysics),
  "WebXRControllerPointerSelection": () => (/* reexport */ WebXRControllerPointerSelection),
  "WebXRDefaultExperience": () => (/* reexport */ WebXRDefaultExperience),
  "WebXRDefaultExperienceOptions": () => (/* reexport */ WebXRDefaultExperienceOptions),
  "WebXRDomOverlay": () => (/* reexport */ WebXRDomOverlay),
  "WebXREnterExitUI": () => (/* reexport */ WebXREnterExitUI),
  "WebXREnterExitUIButton": () => (/* reexport */ WebXREnterExitUIButton),
  "WebXREnterExitUIOptions": () => (/* reexport */ WebXREnterExitUIOptions),
  "WebXRExperienceHelper": () => (/* reexport */ WebXRExperienceHelper),
  "WebXREyeTracking": () => (/* reexport */ WebXREyeTracking),
  "WebXRFeatureName": () => (/* reexport */ WebXRFeatureName),
  "WebXRFeaturePointSystem": () => (/* reexport */ WebXRFeaturePointSystem),
  "WebXRFeaturesManager": () => (/* reexport */ WebXRFeaturesManager),
  "WebXRGenericHandController": () => (/* reexport */ WebXRGenericHandController),
  "WebXRGenericTriggerMotionController": () => (/* reexport */ WebXRGenericTriggerMotionController),
  "WebXRHTCViveMotionController": () => (/* reexport */ WebXRHTCViveMotionController),
  "WebXRHand": () => (/* reexport */ WebXRHand),
  "WebXRHandJoint": () => (/* reexport */ WebXRHandJoint),
  "WebXRHandTracking": () => (/* reexport */ WebXRHandTracking),
  "WebXRHitTest": () => (/* reexport */ WebXRHitTest),
  "WebXRHitTestLegacy": () => (/* reexport */ WebXRHitTestLegacy),
  "WebXRImageTracking": () => (/* reexport */ WebXRImageTracking),
  "WebXRInput": () => (/* reexport */ WebXRInput),
  "WebXRInputSource": () => (/* reexport */ WebXRInputSource),
  "WebXRLayers": () => (/* reexport */ WebXRLayers),
  "WebXRLightEstimation": () => (/* reexport */ WebXRLightEstimation),
  "WebXRManagedOutputCanvas": () => (/* reexport */ WebXRManagedOutputCanvas),
  "WebXRManagedOutputCanvasOptions": () => (/* reexport */ WebXRManagedOutputCanvasOptions),
  "WebXRMeshDetector": () => (/* reexport */ WebXRMeshDetector),
  "WebXRMicrosoftMixedRealityController": () => (/* reexport */ WebXRMicrosoftMixedRealityController),
  "WebXRMotionControllerManager": () => (/* reexport */ WebXRMotionControllerManager),
  "WebXRMotionControllerTeleportation": () => (/* reexport */ WebXRMotionControllerTeleportation),
  "WebXRNearControllerMode": () => (/* reexport */ WebXRNearControllerMode),
  "WebXRNearInteraction": () => (/* reexport */ WebXRNearInteraction),
  "WebXROculusTouchMotionController": () => (/* reexport */ WebXROculusTouchMotionController),
  "WebXRPlaneDetector": () => (/* reexport */ WebXRPlaneDetector),
  "WebXRProfiledMotionController": () => (/* reexport */ WebXRProfiledMotionController),
  "WebXRProjectionLayerWrapper": () => (/* reexport */ WebXRProjectionLayerWrapper),
  "WebXRSessionManager": () => (/* reexport */ WebXRSessionManager),
  "WebXRState": () => (/* reexport */ WebXRState),
  "WebXRTrackingState": () => (/* reexport */ WebXRTrackingState),
  "WebXRWalkingLocomotion": () => (/* reexport */ WebXRWalkingLocomotion),
  "WeightedSound": () => (/* reexport */ weightedsound/* WeightedSound */.s),
  "WindowsMotionController": () => (/* reexport */ WindowsMotionController),
  "WorkerPool": () => (/* reexport */ workerPool/* WorkerPool */.h),
  "WorleyNoise3DBlock": () => (/* reexport */ WorleyNoise3DBlock),
  "XRWindowsMotionController": () => (/* reexport */ XRWindowsMotionController),
  "Xbox360Button": () => (/* reexport */ Xbox360Button),
  "Xbox360Dpad": () => (/* reexport */ Xbox360Dpad),
  "Xbox360Pad": () => (/* reexport */ Xbox360Pad),
  "XboxInput": () => (/* reexport */ deviceEnums/* XboxInput */.$i),
  "_BabylonLoaderRegistered": () => (/* reexport */ _BabylonLoaderRegistered),
  "_BasisTextureLoader": () => (/* reexport */ _BasisTextureLoader),
  "_CreationDataStorage": () => (/* reexport */ Meshes_mesh/* _CreationDataStorage */.gW),
  "_DDSTextureLoader": () => (/* reexport */ _DDSTextureLoader),
  "_ENVTextureLoader": () => (/* reexport */ _ENVTextureLoader),
  "_HDRTextureLoader": () => (/* reexport */ _HDRTextureLoader),
  "_IAnimationState": () => (/* reexport */ Animations_animation/* _IAnimationState */.u),
  "_InstancesBatch": () => (/* reexport */ Meshes_mesh/* _InstancesBatch */.Wv),
  "_KTXTextureLoader": () => (/* reexport */ _KTXTextureLoader),
  "_MeshCollisionData": () => (/* reexport */ meshCollisionData/* _MeshCollisionData */.a),
  "_OcclusionDataStorage": () => (/* reexport */ _OcclusionDataStorage),
  "_PrimaryIsoTriangle": () => (/* reexport */ _PrimaryIsoTriangle),
  "_TGATextureLoader": () => (/* reexport */ _TGATextureLoader),
  "_TimeToken": () => (/* reexport */ _TimeToken),
  "_UpdateRGBDAsync": () => (/* reexport */ environmentTextureTools/* _UpdateRGBDAsync */.Lf),
  "_forceSceneHelpersToBundle": () => (/* reexport */ _forceSceneHelpersToBundle),
  "_forceTransformFeedbackToBundle": () => (/* reexport */ _forceTransformFeedbackToBundle),
  "_injectLTSFileTools": () => (/* reexport */ fileTools/* _injectLTSFileTools */.W5),
  "addClipPlaneUniforms": () => (/* reexport */ clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx),
  "allocateAndCopyTypedBuffer": () => (/* reexport */ engine_readTexture/* allocateAndCopyTypedBuffer */.A),
  "bindClipPlane": () => (/* reexport */ clipPlaneMaterialHelper/* bindClipPlane */.an),
  "className": () => (/* reexport */ tools/* className */.ok),
  "createDetailMapPlugin": () => (/* reexport */ createDetailMapPlugin),
  "createPBRAnisotropicPlugin": () => (/* reexport */ createPBRAnisotropicPlugin),
  "createPBRBRDFPlugin": () => (/* reexport */ createPBRBRDFPlugin),
  "createPBRClearCoatPlugin": () => (/* reexport */ createPBRClearCoatPlugin),
  "createPBRIridescencePlugin": () => (/* reexport */ createPBRIridescencePlugin),
  "createPBRSheenPlugin": () => (/* reexport */ createPBRSheenPlugin),
  "createPBRSubSurfacePlugin": () => (/* reexport */ createPBRSubSurfacePlugin),
  "createYieldingScheduler": () => (/* reexport */ Misc_coroutine/* createYieldingScheduler */.KO),
  "editableInPropertyPage": () => (/* reexport */ editableInPropertyPage),
  "expandToProperty": () => (/* reexport */ decorators/* expandToProperty */.wz),
  "extractMinAndMax": () => (/* reexport */ math_functions/* extractMinAndMax */.k),
  "extractMinAndMaxIndexed": () => (/* reexport */ math_functions/* extractMinAndMaxIndexed */.y),
  "inlineScheduler": () => (/* reexport */ Misc_coroutine/* inlineScheduler */.WP),
  "makeAsyncFunction": () => (/* reexport */ Misc_coroutine/* makeAsyncFunction */.U3),
  "makeSyncFunction": () => (/* reexport */ Misc_coroutine/* makeSyncFunction */.vp),
  "nativeOverride": () => (/* reexport */ decorators/* nativeOverride */.G6),
  "normalizeEnvInfo": () => (/* reexport */ environmentTextureTools/* normalizeEnvInfo */.QH),
  "prepareDefinesForClipPlanes": () => (/* reexport */ clipPlaneMaterialHelper/* prepareDefinesForClipPlanes */.AN),
  "runCoroutine": () => (/* reexport */ Misc_coroutine/* runCoroutine */.d_),
  "runCoroutineAsync": () => (/* reexport */ Misc_coroutine/* runCoroutineAsync */.sM),
  "runCoroutineSync": () => (/* reexport */ Misc_coroutine/* runCoroutineSync */.s3),
  "serialize": () => (/* reexport */ decorators/* serialize */.qC),
  "serializeAsCameraReference": () => (/* reexport */ decorators/* serializeAsCameraReference */.VE),
  "serializeAsColor3": () => (/* reexport */ decorators/* serializeAsColor3 */.n9),
  "serializeAsColor4": () => (/* reexport */ decorators/* serializeAsColor4 */.XX),
  "serializeAsColorCurves": () => (/* reexport */ decorators/* serializeAsColorCurves */.N$),
  "serializeAsFresnelParameters": () => (/* reexport */ decorators/* serializeAsFresnelParameters */.qQ),
  "serializeAsImageProcessingConfiguration": () => (/* reexport */ decorators/* serializeAsImageProcessingConfiguration */.rX),
  "serializeAsMatrix": () => (/* reexport */ decorators/* serializeAsMatrix */.oQ),
  "serializeAsMeshReference": () => (/* reexport */ decorators/* serializeAsMeshReference */.RR),
  "serializeAsQuaternion": () => (/* reexport */ decorators/* serializeAsQuaternion */.mv),
  "serializeAsTexture": () => (/* reexport */ decorators/* serializeAsTexture */.oU),
  "serializeAsVector2": () => (/* reexport */ decorators/* serializeAsVector2 */.QC),
  "serializeAsVector3": () => (/* reexport */ decorators/* serializeAsVector3 */.hd),
  "setAndStartTimer": () => (/* reexport */ setAndStartTimer),
  "setStereoscopicAnaglyphRigMode": () => (/* reexport */ setStereoscopicAnaglyphRigMode),
  "setStereoscopicRigMode": () => (/* reexport */ setStereoscopicRigMode),
  "setVRRigMode": () => (/* reexport */ setVRRigMode),
  "setWebVRRigMode": () => (/* reexport */ setWebVRRigMode)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/abstractScene.js
var abstractScene = __webpack_require__("./node_modules/@babylonjs/core/abstractScene.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Actions/abstractActionManager.js
var abstractActionManager = __webpack_require__("./node_modules/@babylonjs/core/Actions/abstractActionManager.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.color.js
var math_color = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/typeStore.js
var typeStore = __webpack_require__("./node_modules/@babylonjs/core/Misc/typeStore.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Actions/action.js
class Action {constructor(triggerOptions, condition) {this.triggerOptions = triggerOptions, this.onBeforeExecuteObservable = new observable/* Observable */.y$(), triggerOptions.parameter ? (this.trigger = triggerOptions.trigger, this._triggerParameter = triggerOptions.parameter) : triggerOptions.trigger ? this.trigger = triggerOptions.trigger : this.trigger = triggerOptions, this._nextActiveAction = this, this._condition = condition;}_prepare() {}getTriggerParameter() {return this._triggerParameter;}setTriggerParameter(value) {this._triggerParameter = value;}_evaluateConditionForCurrentFrame() {const condition = this._condition;if (!condition) return !0;const currentRenderId = this._actionManager.getScene().getRenderId();return condition._evaluationId !== currentRenderId && (condition._evaluationId = currentRenderId, condition._currentResult = condition.isValid()), condition._currentResult;}_executeCurrent(evt) {const isConditionValid = this._evaluateConditionForCurrentFrame();isConditionValid && (this.onBeforeExecuteObservable.notifyObservers(this), this._nextActiveAction.execute(evt), this.skipToNextActiveAction());}execute() {}skipToNextActiveAction() {this._nextActiveAction._child ? (!this._nextActiveAction._child._actionManager && (this._nextActiveAction._child._actionManager = this._actionManager), this._nextActiveAction = this._nextActiveAction._child) : this._nextActiveAction = this;}then(action) {return this._child = action, action._actionManager = this._actionManager, action._prepare(), action;}_getProperty(propertyPath) {return this._actionManager._getProperty(propertyPath);}_getEffectiveTarget(target, propertyPath) {return this._actionManager._getEffectiveTarget(target, propertyPath);}serialize() {}_serialize(serializedAction, parent) {const serializationObject = { type: 1, children: [], name: serializedAction.name, properties: serializedAction.properties || [] };if (this._child && this._child.serialize(serializationObject), this._condition) {const serializedCondition = this._condition.serialize();return serializedCondition.children.push(serializationObject), parent && parent.children.push(serializedCondition), serializedCondition;}return parent && parent.children.push(serializationObject), serializationObject;}}Action._SerializeValueAsString = (value) => "number" == typeof value ? value.toString() : "boolean" == typeof value ? value ? "true" : "false" : value instanceof math_vector/* Vector2 */.FM ? value.x + ", " + value.y : value instanceof math_vector/* Vector3 */.P ? value.x + ", " + value.y + ", " + value.z : value instanceof math_color/* Color3 */.Wo ? value.r + ", " + value.g + ", " + value.b : value instanceof math_color/* Color4 */.HE ? value.r + ", " + value.g + ", " + value.b + ", " + value.a : value, Action._GetTargetProperty = (target) => ({ name: "target", targetType: target._isMesh ? "MeshProperties" : target._isLight ? "LightProperties" : target._isCamera ? "CameraProperties" : target._isMaterial ? "MaterialProperties" : "SceneProperties", value: target._isScene ? "Scene" : target.name }), (0,typeStore/* RegisterClass */.H)("BABYLON.Action", Action);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Actions/actionEvent.js
var actionEvent = __webpack_require__("./node_modules/@babylonjs/core/Actions/actionEvent.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Actions/condition.js
class Condition {constructor(actionManager) {this._actionManager = actionManager;}isValid() {return !0;}_getProperty(propertyPath) {return this._actionManager._getProperty(propertyPath);}_getEffectiveTarget(target, propertyPath) {return this._actionManager._getEffectiveTarget(target, propertyPath);}serialize() {}_serialize(serializedCondition) {return { type: 2, children: [], name: serializedCondition.name, properties: serializedCondition.properties };}}class ValueCondition extends Condition {static get IsEqual() {return ValueCondition._IsEqual;}static get IsDifferent() {return ValueCondition._IsDifferent;}static get IsGreater() {return ValueCondition._IsGreater;}static get IsLesser() {return ValueCondition._IsLesser;}constructor(actionManager, target, propertyPath, value, operator = ValueCondition.IsEqual) {super(actionManager), this.propertyPath = propertyPath, this.value = value, this.operator = operator, this._target = target, this._effectiveTarget = this._getEffectiveTarget(target, this.propertyPath), this._property = this._getProperty(this.propertyPath);}isValid() {switch (this.operator) {case ValueCondition.IsGreater:return this._effectiveTarget[this._property] > this.value;case ValueCondition.IsLesser:return this._effectiveTarget[this._property] < this.value;case ValueCondition.IsEqual:case ValueCondition.IsDifferent:{let check;return check = this.value.equals ? this.value.equals(this._effectiveTarget[this._property]) : this.value === this._effectiveTarget[this._property], this.operator === ValueCondition.IsEqual ? check : !check;}}return !1;}serialize() {return this._serialize({ name: "ValueCondition", properties: [Action._GetTargetProperty(this._target), { name: "propertyPath", value: this.propertyPath }, { name: "value", value: Action._SerializeValueAsString(this.value) }, { name: "operator", value: ValueCondition.GetOperatorName(this.operator) }] });}static GetOperatorName(operator) {return operator === ValueCondition._IsEqual ? "IsEqual" : operator === ValueCondition._IsDifferent ? "IsDifferent" : operator === ValueCondition._IsGreater ? "IsGreater" : operator === ValueCondition._IsLesser ? "IsLesser" : "";}}ValueCondition._IsEqual = 0, ValueCondition._IsDifferent = 1, ValueCondition._IsGreater = 2, ValueCondition._IsLesser = 3;class PredicateCondition extends Condition {constructor(actionManager, predicate) {super(actionManager), this.predicate = predicate;}isValid() {return this.predicate();}}class StateCondition extends Condition {constructor(actionManager, target, value) {super(actionManager), this.value = value, this._target = target;}isValid() {return this._target.state === this.value;}serialize() {return this._serialize({ name: "StateCondition", properties: [Action._GetTargetProperty(this._target), { name: "value", value: this.value }] });}}(0,typeStore/* RegisterClass */.H)("BABYLON.ValueCondition", ValueCondition), (0,typeStore/* RegisterClass */.H)("BABYLON.PredicateCondition", PredicateCondition), (0,typeStore/* RegisterClass */.H)("BABYLON.StateCondition", StateCondition);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Actions/directActions.js
class SwitchBooleanAction extends Action {constructor(triggerOptions, target, propertyPath, condition) {super(triggerOptions, condition), this.propertyPath = propertyPath, this._target = this._effectiveTarget = target;}_prepare() {this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);}execute() {this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];}serialize(parent) {return super._serialize({ name: "SwitchBooleanAction", properties: [Action._GetTargetProperty(this._target), { name: "propertyPath", value: this.propertyPath }] }, parent);}}class SetStateAction extends Action {constructor(triggerOptions, target, value, condition) {super(triggerOptions, condition), this.value = value, this._target = target;}execute() {this._target.state = this.value;}serialize(parent) {return super._serialize({ name: "SetStateAction", properties: [Action._GetTargetProperty(this._target), { name: "value", value: this.value }] }, parent);}}class SetValueAction extends Action {constructor(triggerOptions, target, propertyPath, value, condition) {super(triggerOptions, condition), this.propertyPath = propertyPath, this.value = value, this._target = this._effectiveTarget = target;}_prepare() {this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);}execute() {this._effectiveTarget[this._property] = this.value, this._target.markAsDirty && this._target.markAsDirty(this._property);}serialize(parent) {return super._serialize({ name: "SetValueAction", properties: [Action._GetTargetProperty(this._target), { name: "propertyPath", value: this.propertyPath }, { name: "value", value: Action._SerializeValueAsString(this.value) }] }, parent);}}class IncrementValueAction extends Action {constructor(triggerOptions, target, propertyPath, value, condition) {super(triggerOptions, condition), this.propertyPath = propertyPath, this.value = value, this._target = this._effectiveTarget = target;}_prepare() {this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath), "number" != typeof this._effectiveTarget[this._property] && logger/* Logger.Warn */.Y.Warn("Warning: IncrementValueAction can only be used with number values");}execute() {this._effectiveTarget[this._property] += this.value, this._target.markAsDirty && this._target.markAsDirty(this._property);}serialize(parent) {return super._serialize({ name: "IncrementValueAction", properties: [Action._GetTargetProperty(this._target), { name: "propertyPath", value: this.propertyPath }, { name: "value", value: Action._SerializeValueAsString(this.value) }] }, parent);}}class PlayAnimationAction extends Action {constructor(triggerOptions, target, from, to, loop, condition) {super(triggerOptions, condition), this.from = from, this.to = to, this.loop = loop, this._target = target;}_prepare() {}execute() {const scene = this._actionManager.getScene();scene.beginAnimation(this._target, this.from, this.to, this.loop);}serialize(parent) {return super._serialize({ name: "PlayAnimationAction", properties: [Action._GetTargetProperty(this._target), { name: "from", value: this.from + "" }, { name: "to", value: this.to + "" }, { name: "loop", value: Action._SerializeValueAsString(this.loop) || !1 }] }, parent);}}class StopAnimationAction extends Action {constructor(triggerOptions, target, condition) {super(triggerOptions, condition), this._target = target;}_prepare() {}execute() {const scene = this._actionManager.getScene();scene.stopAnimation(this._target);}serialize(parent) {return super._serialize({ name: "StopAnimationAction", properties: [Action._GetTargetProperty(this._target)] }, parent);}}class DoNothingAction extends Action {constructor(triggerOptions = 0, condition) {super(triggerOptions, condition);}execute() {}serialize(parent) {return super._serialize({ name: "DoNothingAction", properties: [] }, parent);}}class CombineAction extends Action {constructor(triggerOptions, children, condition, enableChildrenConditions = !0) {super(triggerOptions, condition), this.children = children, this.enableChildrenConditions = enableChildrenConditions;}_prepare() {for (let index = 0; index < this.children.length; index++) this.children[index]._actionManager = this._actionManager, this.children[index]._prepare();}execute(evt) {for (const action of this.children) (!this.enableChildrenConditions || action._evaluateConditionForCurrentFrame()) && action.execute(evt);}serialize(parent) {const serializationObject = super._serialize({ name: "CombineAction", properties: [], combine: [] }, parent);for (let i = 0; i < this.children.length; i++) serializationObject.combine.push(this.children[i].serialize(null));return serializationObject;}}class ExecuteCodeAction extends Action {constructor(triggerOptions, func, condition) {super(triggerOptions, condition), this.func = func;}execute(evt) {this.func(evt);}}class SetParentAction extends Action {constructor(triggerOptions, target, parent, condition) {super(triggerOptions, condition), this._target = target, this._parent = parent;}_prepare() {}execute() {if (this._target.parent !== this._parent) {const invertParentWorldMatrix = this._parent.getWorldMatrix().clone();invertParentWorldMatrix.invert(), this._target.position = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(this._target.position, invertParentWorldMatrix), this._target.parent = this._parent;}}serialize(parent) {return super._serialize({ name: "SetParentAction", properties: [Action._GetTargetProperty(this._target), Action._GetTargetProperty(this._parent)] }, parent);}}(0,typeStore/* RegisterClass */.H)("BABYLON.SetParentAction", SetParentAction), (0,typeStore/* RegisterClass */.H)("BABYLON.ExecuteCodeAction", ExecuteCodeAction), (0,typeStore/* RegisterClass */.H)("BABYLON.DoNothingAction", DoNothingAction), (0,typeStore/* RegisterClass */.H)("BABYLON.StopAnimationAction", StopAnimationAction), (0,typeStore/* RegisterClass */.H)("BABYLON.PlayAnimationAction", PlayAnimationAction), (0,typeStore/* RegisterClass */.H)("BABYLON.IncrementValueAction", IncrementValueAction), (0,typeStore/* RegisterClass */.H)("BABYLON.SetValueAction", SetValueAction), (0,typeStore/* RegisterClass */.H)("BABYLON.SetStateAction", SetStateAction), (0,typeStore/* RegisterClass */.H)("BABYLON.SetParentAction", SetParentAction), (0,typeStore/* RegisterClass */.H)("BABYLON.SwitchBooleanAction", SwitchBooleanAction), (0,typeStore/* RegisterClass */.H)("BABYLON.CombineAction", CombineAction);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engineStore.js
var engineStore = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/deepCopier.js
var deepCopier = __webpack_require__("./node_modules/@babylonjs/core/Misc/deepCopier.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Actions/actionManager.js
class ActionManager extends abstractActionManager/* AbstractActionManager */.O {constructor(scene) {super(), scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;scene && (this._scene = scene, scene.actionManagers.push(this));}dispose() {const index = this._scene.actionManagers.indexOf(this);for (let i = 0; i < this.actions.length; i++) {const action = this.actions[i];ActionManager.Triggers[action.trigger]--, 0 === ActionManager.Triggers[action.trigger] && delete ActionManager.Triggers[action.trigger];}-1 < index && this._scene.actionManagers.splice(index, 1);}getScene() {return this._scene;}hasSpecificTriggers(triggers) {for (let index = 0; index < this.actions.length; index++) {const action = this.actions[index];if (-1 < triggers.indexOf(action.trigger)) return !0;}return !1;}hasSpecificTriggers2(triggerA, triggerB) {for (let index = 0; index < this.actions.length; index++) {const action = this.actions[index];if (triggerA == action.trigger || triggerB == action.trigger) return !0;}return !1;}hasSpecificTrigger(trigger, parameterPredicate) {for (let index = 0; index < this.actions.length; index++) {const action = this.actions[index];if (action.trigger === trigger) {if (!parameterPredicate) return !0;if (parameterPredicate(action.getTriggerParameter())) return !0;}}return !1;}get hasPointerTriggers() {for (let index = 0; index < this.actions.length; index++) {const action = this.actions[index];if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPointerOutTrigger) return !0;}return !1;}get hasPickTriggers() {for (let index = 0; index < this.actions.length; index++) {const action = this.actions[index];if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPickUpTrigger) return !0;}return !1;}registerAction(action) {return action.trigger === ActionManager.OnEveryFrameTrigger && this.getScene().actionManager !== this ? (logger/* Logger.Warn */.Y.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"), null) : (this.actions.push(action), this.getScene()._registeredActions++, ActionManager.Triggers[action.trigger] ? ActionManager.Triggers[action.trigger]++ : ActionManager.Triggers[action.trigger] = 1, action._actionManager = this, action._prepare(), action);}unregisterAction(action) {const index = this.actions.indexOf(action);return -1 !== index && (this.actions.splice(index, 1), ActionManager.Triggers[action.trigger] -= 1, 0 === ActionManager.Triggers[action.trigger] && delete ActionManager.Triggers[action.trigger], action._actionManager = null, this.getScene()._registeredActions--, !0);}processTrigger(trigger, evt) {for (let index = 0; index < this.actions.length; index++) {const action = this.actions[index];if (action.trigger === trigger) {if (evt && (trigger === ActionManager.OnKeyUpTrigger || trigger === ActionManager.OnKeyDownTrigger)) {const parameter = action.getTriggerParameter();if ("function" == typeof parameter) {if (!parameter(evt)) continue;} else if (parameter && parameter !== evt.sourceEvent.keyCode) {if (!parameter.toLowerCase) continue;const lowerCase = parameter.toLowerCase();if (lowerCase !== evt.sourceEvent.key) {const unicode = evt.sourceEvent.charCode ? evt.sourceEvent.charCode : evt.sourceEvent.keyCode,actualkey = String.fromCharCode(unicode).toLowerCase();if (actualkey !== lowerCase) continue;}}}action._executeCurrent(evt);}}}_getEffectiveTarget(target, propertyPath) {const properties = propertyPath.split(".");for (let index = 0; index < properties.length - 1; index++) target = target[properties[index]];return target;}_getProperty(propertyPath) {const properties = propertyPath.split(".");return properties[properties.length - 1];}serialize(name) {const root = { children: [], name: name, type: 3, properties: [] };for (let i = 0; i < this.actions.length; i++) {const triggerObject = { type: 0, children: [], name: ActionManager.GetTriggerName(this.actions[i].trigger), properties: [] },triggerOptions = this.actions[i].triggerOptions;if (triggerOptions && "number" != typeof triggerOptions) if (triggerOptions.parameter instanceof Node) triggerObject.properties.push(Action._GetTargetProperty(triggerOptions.parameter));else if ("object" == typeof triggerOptions.parameter) {const parameter = {};deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(triggerOptions.parameter, parameter, ["mesh"]), triggerOptions.parameter && triggerOptions.parameter.mesh && (parameter._meshId = triggerOptions.parameter.mesh.id), triggerObject.properties.push({ name: "parameter", targetType: null, value: parameter });} else triggerObject.properties.push({ name: "parameter", targetType: null, value: triggerOptions.parameter });this.actions[i].serialize(triggerObject), root.children.push(triggerObject);}return root;}static Parse(parsedActions, object, scene) {const actionManager = new ActionManager(scene);null === object ? scene.actionManager = actionManager : object.actionManager = actionManager;const instantiate = (name, params) => {const internalClassType = (0,typeStore/* GetClass */.q)("BABYLON." + name);return internalClassType && new internalClassType(...params);},parseParameter = (name, value, target, propertyPath) => {if (null === propertyPath) {const floatValue = parseFloat(value);return "true" === value || "false" === value ? "true" === value : isNaN(floatValue) ? value : floatValue;}const effectiveTarget = propertyPath.split("."),values = value.split(",");for (let i = 0; i < effectiveTarget.length; i++) target = target[effectiveTarget[i]];if ("boolean" == typeof target) return "true" === values[0];if ("string" == typeof target) return values[0];const split = [];for (let i = 0; i < values.length; i++) split.push(parseFloat(values[i]));return target instanceof math_vector/* Vector3 */.P ? math_vector/* Vector3.FromArray */.P.FromArray(split) : target instanceof math_vector/* Vector4 */.Lt ? math_vector/* Vector4.FromArray */.Lt.FromArray(split) : target instanceof math_color/* Color3 */.Wo ? math_color/* Color3.FromArray */.Wo.FromArray(split) : target instanceof math_color/* Color4 */.HE ? math_color/* Color4.FromArray */.HE.FromArray(split) : parseFloat(values[0]);},traverse = (parsedAction, trigger, condition, action, combineArray = null) => {if (parsedAction.detached) return;const parameters = [];let target = null,propertyPath = null;const combine = parsedAction.combine && 0 < parsedAction.combine.length;if (2 === parsedAction.type ? parameters.push(actionManager) : parameters.push(trigger), combine) {const actions = [];for (let j = 0; j < parsedAction.combine.length; j++) traverse(parsedAction.combine[j], ActionManager.NothingTrigger, condition, action, actions);parameters.push(actions);} else for (let value, i = 0; i < parsedAction.properties.length; i++) {value = parsedAction.properties[i].value;const name = parsedAction.properties[i].name,targetType = parsedAction.properties[i].targetType;"target" === name ? "SceneProperties" === targetType ? value = target = scene : "MaterialProperties" === targetType ? value = target = scene.getMaterialByName(value) : value = target = scene.getNodeByName(value) : "parent" === name ? value = scene.getNodeByName(value) : "sound" === name ? scene.getSoundByName && (value = scene.getSoundByName(value)) : "propertyPath" === name ? propertyPath = value : 2 === parsedAction.type && "operator" === name ? value = ValueCondition[value] : value = parseParameter(name, value, target, "value" === name ? propertyPath : null), parameters.push(value);}if (null === combineArray ? parameters.push(condition) : parameters.push(null), "InterpolateValueAction" === parsedAction.name) {const param = parameters[parameters.length - 2];parameters[parameters.length - 1] = param, parameters[parameters.length - 2] = condition;}let newAction = instantiate(parsedAction.name, parameters);if (newAction instanceof Condition && null !== condition) {const nothing = new DoNothingAction(trigger, condition);action ? action.then(nothing) : actionManager.registerAction(nothing), action = nothing;}null === combineArray ? newAction instanceof Condition ? (condition = newAction, newAction = action) : (condition = null, action ? action.then(newAction) : actionManager.registerAction(newAction)) : combineArray.push(newAction);for (let i = 0; i < parsedAction.children.length; i++) traverse(parsedAction.children[i], trigger, condition, newAction, null);};for (let i = 0; i < parsedActions.children.length; i++) {let triggerParams;const trigger = parsedActions.children[i];if (0 < trigger.properties.length) {const param = trigger.properties[0].value,value = null === trigger.properties[0].targetType ? param : scene.getMeshByName(param);value._meshId && (value.mesh = scene.getMeshById(value._meshId)), triggerParams = { trigger: ActionManager[trigger.name], parameter: value };} else triggerParams = ActionManager[trigger.name];for (let j = 0; j < trigger.children.length; j++) trigger.detached || traverse(trigger.children[j], triggerParams, null, null);}}static GetTriggerName(trigger) {return 0 === trigger ? "NothingTrigger" : 1 === trigger ? "OnPickTrigger" : 2 === trigger ? "OnLeftPickTrigger" : 3 === trigger ? "OnRightPickTrigger" : 4 === trigger ? "OnCenterPickTrigger" : 5 === trigger ? "OnPickDownTrigger" : 6 === trigger ? "OnDoublePickTrigger" : 7 === trigger ? "OnPickUpTrigger" : 8 === trigger ? "OnLongPressTrigger" : 9 === trigger ? "OnPointerOverTrigger" : 10 === trigger ? "OnPointerOutTrigger" : 11 === trigger ? "OnEveryFrameTrigger" : 12 === trigger ? "OnIntersectionEnterTrigger" : 13 === trigger ? "OnIntersectionExitTrigger" : 14 === trigger ? "OnKeyDownTrigger" : 15 === trigger ? "OnKeyUpTrigger" : 16 === trigger ? "OnPickOutTrigger" : "";}}ActionManager.NothingTrigger = 0, ActionManager.OnPickTrigger = 1, ActionManager.OnLeftPickTrigger = 2, ActionManager.OnRightPickTrigger = 3, ActionManager.OnCenterPickTrigger = 4, ActionManager.OnPickDownTrigger = 5, ActionManager.OnDoublePickTrigger = 6, ActionManager.OnPickUpTrigger = 7, ActionManager.OnPickOutTrigger = 16, ActionManager.OnLongPressTrigger = 8, ActionManager.OnPointerOverTrigger = 9, ActionManager.OnPointerOutTrigger = 10, ActionManager.OnEveryFrameTrigger = 11, ActionManager.OnIntersectionEnterTrigger = 12, ActionManager.OnIntersectionExitTrigger = 13, ActionManager.OnKeyDownTrigger = 14, ActionManager.OnKeyUpTrigger = 15;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Actions/directAudioActions.js
class PlaySoundAction extends Action {constructor(triggerOptions, sound, condition) {super(triggerOptions, condition), this._sound = sound;}_prepare() {}execute() {this._sound !== void 0 && this._sound.play();}serialize(parent) {return super._serialize({ name: "PlaySoundAction", properties: [{ name: "sound", value: this._sound.name }] }, parent);}}class StopSoundAction extends Action {constructor(triggerOptions, sound, condition) {super(triggerOptions, condition), this._sound = sound;}_prepare() {}execute() {this._sound !== void 0 && this._sound.stop();}serialize(parent) {return super._serialize({ name: "StopSoundAction", properties: [{ name: "sound", value: this._sound.name }] }, parent);}}(0,typeStore/* RegisterClass */.H)("BABYLON.PlaySoundAction", PlaySoundAction), (0,typeStore/* RegisterClass */.H)("BABYLON.StopSoundAction", StopSoundAction);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animation.js
var Animations_animation = __webpack_require__("./node_modules/@babylonjs/core/Animations/animation.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Actions/interpolateValueAction.js
class InterpolateValueAction extends Action {constructor(triggerOptions, target, propertyPath, value, duration = 1e3, condition, stopOtherAnimations, onInterpolationDone) {super(triggerOptions, condition), this.duration = 1e3, this.onInterpolationDoneObservable = new observable/* Observable */.y$(), this.propertyPath = propertyPath, this.value = value, this.duration = duration, this.stopOtherAnimations = stopOtherAnimations, this.onInterpolationDone = onInterpolationDone, this._target = this._effectiveTarget = target;}_prepare() {this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);}execute() {const scene = this._actionManager.getScene(),keys = [{ frame: 0, value: this._effectiveTarget[this._property] }, { frame: 100, value: this.value }];let dataType;if ("number" == typeof this.value) dataType = Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT;else if (this.value instanceof math_color/* Color3 */.Wo) dataType = Animations_animation/* Animation.ANIMATIONTYPE_COLOR3 */.f.ANIMATIONTYPE_COLOR3;else if (this.value instanceof math_vector/* Vector3 */.P) dataType = Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3;else if (this.value instanceof math_vector/* Matrix */.y3) dataType = Animations_animation/* Animation.ANIMATIONTYPE_MATRIX */.f.ANIMATIONTYPE_MATRIX;else if (this.value instanceof math_vector/* Quaternion */._f) dataType = Animations_animation/* Animation.ANIMATIONTYPE_QUATERNION */.f.ANIMATIONTYPE_QUATERNION;else return void logger/* Logger.Warn */.Y.Warn("InterpolateValueAction: Unsupported type (" + typeof this.value + ")");const animation = new Animations_animation/* Animation */.f("InterpolateValueAction", this._property, 100 * (1e3 / this.duration), dataType, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT);animation.setKeys(keys), this.stopOtherAnimations && scene.stopAnimation(this._effectiveTarget);const wrapper = () => {this.onInterpolationDoneObservable.notifyObservers(this), this.onInterpolationDone && this.onInterpolationDone();};scene.beginDirectAnimation(this._effectiveTarget, [animation], 0, 100, !1, 1, wrapper);}serialize(parent) {return super._serialize({ name: "InterpolateValueAction", properties: [Action._GetTargetProperty(this._target), { name: "propertyPath", value: this.propertyPath }, { name: "value", value: Action._SerializeValueAsString(this.value) }, { name: "duration", value: Action._SerializeValueAsString(this.duration) }, { name: "stopOtherAnimations", value: Action._SerializeValueAsString(this.stopOtherAnimations) || !1 }] }, parent);}}(0,typeStore/* RegisterClass */.H)("BABYLON.InterpolateValueAction", InterpolateValueAction);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Actions/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.size.js
var math_size = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.size.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Animations/runtimeAnimation.js
const _staticOffsetValueQuaternion = Object.freeze(new math_vector/* Quaternion */._f(0, 0, 0, 0)),_staticOffsetValueVector3 = Object.freeze(math_vector/* Vector3.Zero */.P.Zero()),_staticOffsetValueVector2 = Object.freeze(math_vector/* Vector2.Zero */.FM.Zero()),_staticOffsetValueSize = Object.freeze(math_size/* Size.Zero */.$.Zero()),_staticOffsetValueColor3 = Object.freeze(math_color/* Color3.Black */.Wo.Black());class RuntimeAnimation {get currentFrame() {return this._currentFrame;}get weight() {return this._weight;}get currentValue() {return this._currentValue;}get targetPath() {return this._targetPath;}get target() {return this._currentActiveTarget;}get isAdditive() {return this._host && this._host.isAdditive;}constructor(target, animation, scene, host) {if (this._events = [], this._currentFrame = 0, this._originalValue = [], this._originalBlendValue = null, this._offsetsCache = {}, this._highLimitsCache = {}, this._stopped = !1, this._blendingFactor = 0, this._currentValue = null, this._currentActiveTarget = null, this._directTarget = null, this._targetPath = "", this._weight = 1, this._ratioOffset = 0, this._previousDelay = 0, this._previousRatio = 0, this._targetIsArray = !1, this._animation = animation, this._target = target, this._scene = scene, this._host = host, this._activeTargets = [], animation._runtimeAnimations.push(this), this._animationState = { key: 0, repeatCount: 0, loopMode: this._getCorrectLoopMode() }, this._animation.dataType === Animations_animation/* Animation.ANIMATIONTYPE_MATRIX */.f.ANIMATIONTYPE_MATRIX && (this._animationState.workValue = math_vector/* Matrix.Zero */.y3.Zero()), this._keys = this._animation.getKeys(), this._minFrame = this._keys[0].frame, this._maxFrame = this._keys[this._keys.length - 1].frame, this._minValue = this._keys[0].value, this._maxValue = this._keys[this._keys.length - 1].value, 0 !== this._minFrame) {const newKey = { frame: 0, value: this._minValue };this._keys.splice(0, 0, newKey);}if (this._target instanceof Array) {let index = 0;for (const target of this._target) this._preparePath(target, index), this._getOriginalValues(index), index++;this._targetIsArray = !0;} else this._preparePath(this._target), this._getOriginalValues(), this._targetIsArray = !1, this._directTarget = this._activeTargets[0];const events = animation.getEvents();events && 0 < events.length && events.forEach((e) => {this._events.push(e._clone());}), this._enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;}_preparePath(target, targetIndex = 0) {const targetPropertyPath = this._animation.targetPropertyPath;if (1 < targetPropertyPath.length) {let property = target[targetPropertyPath[0]];for (let index = 1; index < targetPropertyPath.length - 1; index++) property = property[targetPropertyPath[index]];this._targetPath = targetPropertyPath[targetPropertyPath.length - 1], this._activeTargets[targetIndex] = property;} else this._targetPath = targetPropertyPath[0], this._activeTargets[targetIndex] = target;}get animation() {return this._animation;}reset(restoreOriginal = !1) {if (restoreOriginal) if (this._target instanceof Array) {let index = 0;for (const target of this._target) void 0 !== this._originalValue[index] && this._setValue(target, this._activeTargets[index], this._originalValue[index], -1, index), index++;} else void 0 !== this._originalValue[0] && this._setValue(this._target, this._directTarget, this._originalValue[0], -1, 0);this._offsetsCache = {}, this._highLimitsCache = {}, this._currentFrame = 0, this._blendingFactor = 0;for (let index = 0; index < this._events.length; index++) this._events[index].isDone = !1;}isStopped() {return this._stopped;}dispose() {const index = this._animation.runtimeAnimations.indexOf(this);-1 < index && this._animation.runtimeAnimations.splice(index, 1);}setValue(currentValue, weight) {if (this._targetIsArray) {for (let index = 0; index < this._target.length; index++) {const target = this._target[index];this._setValue(target, this._activeTargets[index], currentValue, weight, index);}return;}this._setValue(this._target, this._directTarget, currentValue, weight, 0);}_getOriginalValues(targetIndex = 0) {let originalValue;const target = this._activeTargets[targetIndex];originalValue = target.getRestPose && "_matrix" === this._targetPath ? target.getRestPose() : target[this._targetPath], this._originalValue[targetIndex] = originalValue && originalValue.clone ? originalValue.clone() : originalValue;}_setValue(target, destination, currentValue, weight, targetIndex) {if (this._currentActiveTarget = destination, this._weight = weight, this._enableBlending && 1 >= this._blendingFactor) {if (!this._originalBlendValue) {const originalValue = destination[this._targetPath];this._originalBlendValue = originalValue.clone ? originalValue.clone() : originalValue;}this._originalBlendValue.m ? Animations_animation/* Animation.AllowMatrixDecomposeForInterpolation */.f.AllowMatrixDecomposeForInterpolation ? this._currentValue ? math_vector/* Matrix.DecomposeLerpToRef */.y3.DecomposeLerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue) : this._currentValue = math_vector/* Matrix.DecomposeLerp */.y3.DecomposeLerp(this._originalBlendValue, currentValue, this._blendingFactor) : this._currentValue ? math_vector/* Matrix.LerpToRef */.y3.LerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue) : this._currentValue = math_vector/* Matrix.Lerp */.y3.Lerp(this._originalBlendValue, currentValue, this._blendingFactor) : this._currentValue = Animations_animation/* Animation._UniversalLerp */.f._UniversalLerp(this._originalBlendValue, currentValue, this._blendingFactor);const blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;this._blendingFactor += blendingSpeed;} else this._currentValue ? this._currentValue.copyFrom ? this._currentValue.copyFrom(currentValue) : this._currentValue = currentValue : (null === currentValue || void 0 === currentValue ? void 0 : currentValue.clone) ? this._currentValue = currentValue.clone() : this._currentValue = currentValue;-1 === weight ? destination[this._targetPath] = this._currentValue : this._scene._registerTargetForLateAnimationBinding(this, this._originalValue[targetIndex]), target.markAsDirty && target.markAsDirty(this._animation.targetProperty);}_getCorrectLoopMode() {return this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.loopMode : this._animation.loopMode;}goToFrame(frame) {const keys = this._animation.getKeys();frame < keys[0].frame ? frame = keys[0].frame : frame > keys[keys.length - 1].frame && (frame = keys[keys.length - 1].frame);const events = this._events;if (events.length) for (let index = 0; index < events.length; index++) events[index].onlyOnce || (events[index].isDone = events[index].frame < frame);this._currentFrame = frame;const currentValue = this._animation._interpolate(frame, this._animationState);this.setValue(currentValue, -1);}_prepareForSpeedRatioChange(newSpeedRatio) {const newRatio = this._previousDelay * (this._animation.framePerSecond * newSpeedRatio) / 1e3;this._ratioOffset = this._previousRatio - newRatio;}animate(delay, from, to, loop, speedRatio, weight = -1) {const animation = this._animation,targetPropertyPath = animation.targetPropertyPath;if (!targetPropertyPath || 1 > targetPropertyPath.length) return this._stopped = !0, !1;let returnValue = !0;(from < this._minFrame || from > this._maxFrame) && (from = this._minFrame), (to < this._minFrame || to > this._maxFrame) && (to = this._maxFrame);const range = to - from;let offsetValue;const ratio = delay * (animation.framePerSecond * speedRatio) / 1e3 + this._ratioOffset;let highLimitValue = 0;if (this._previousDelay = delay, this._previousRatio = ratio, !loop && to >= from && ratio >= range) returnValue = !1, highLimitValue = animation._getKeyValue(this._maxValue);else if (!loop && from >= to && ratio <= range) returnValue = !1, highLimitValue = animation._getKeyValue(this._minValue);else if (this._animationState.loopMode !== Animations_animation/* Animation.ANIMATIONLOOPMODE_CYCLE */.f.ANIMATIONLOOPMODE_CYCLE) {const keyOffset = to.toString() + from.toString();if (!this._offsetsCache[keyOffset]) {this._animationState.repeatCount = 0, this._animationState.loopMode = Animations_animation/* Animation.ANIMATIONLOOPMODE_CYCLE */.f.ANIMATIONLOOPMODE_CYCLE;const fromValue = animation._interpolate(from, this._animationState),toValue = animation._interpolate(to, this._animationState);switch (this._animationState.loopMode = this._getCorrectLoopMode(), animation.dataType) {case Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT:this._offsetsCache[keyOffset] = toValue - fromValue;break;case Animations_animation/* Animation.ANIMATIONTYPE_QUATERNION */.f.ANIMATIONTYPE_QUATERNION:this._offsetsCache[keyOffset] = toValue.subtract(fromValue);break;case Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3:this._offsetsCache[keyOffset] = toValue.subtract(fromValue);break;case Animations_animation/* Animation.ANIMATIONTYPE_VECTOR2 */.f.ANIMATIONTYPE_VECTOR2:this._offsetsCache[keyOffset] = toValue.subtract(fromValue);break;case Animations_animation/* Animation.ANIMATIONTYPE_SIZE */.f.ANIMATIONTYPE_SIZE:this._offsetsCache[keyOffset] = toValue.subtract(fromValue);break;case Animations_animation/* Animation.ANIMATIONTYPE_COLOR3 */.f.ANIMATIONTYPE_COLOR3:this._offsetsCache[keyOffset] = toValue.subtract(fromValue);break;default:}this._highLimitsCache[keyOffset] = toValue;}highLimitValue = this._highLimitsCache[keyOffset], offsetValue = this._offsetsCache[keyOffset];}if (void 0 === offsetValue) switch (animation.dataType) {case Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT:offsetValue = 0;break;case Animations_animation/* Animation.ANIMATIONTYPE_QUATERNION */.f.ANIMATIONTYPE_QUATERNION:offsetValue = _staticOffsetValueQuaternion;break;case Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3:offsetValue = _staticOffsetValueVector3;break;case Animations_animation/* Animation.ANIMATIONTYPE_VECTOR2 */.f.ANIMATIONTYPE_VECTOR2:offsetValue = _staticOffsetValueVector2;break;case Animations_animation/* Animation.ANIMATIONTYPE_SIZE */.f.ANIMATIONTYPE_SIZE:offsetValue = _staticOffsetValueSize;break;case Animations_animation/* Animation.ANIMATIONTYPE_COLOR3 */.f.ANIMATIONTYPE_COLOR3:offsetValue = _staticOffsetValueColor3;}let currentFrame;if (this._host && this._host.syncRoot) {const syncRoot = this._host.syncRoot,hostNormalizedFrame = (syncRoot.masterFrame - syncRoot.fromFrame) / (syncRoot.toFrame - syncRoot.fromFrame);currentFrame = from + (to - from) * hostNormalizedFrame;} else currentFrame = 0 < ratio && from > to || 0 > ratio && from < to ? returnValue && 0 !== range ? to + ratio % range : from : returnValue && 0 !== range ? from + ratio % range : to;const events = this._events;if (0 < speedRatio && this.currentFrame > currentFrame || 0 > speedRatio && this.currentFrame < currentFrame) {this._onLoop();for (let index = 0; index < events.length; index++) events[index].onlyOnce || (events[index].isDone = !1);this._animationState.key = 0 < speedRatio ? 0 : animation.getKeys().length - 1;}this._currentFrame = currentFrame, this._animationState.repeatCount = 0 == range ? 0 : ratio / range >> 0, this._animationState.highLimitValue = highLimitValue, this._animationState.offsetValue = offsetValue;const currentValue = animation._interpolate(currentFrame, this._animationState);if (this.setValue(currentValue, weight), events.length) for (let index = 0; index < events.length; index++) if (0 < range && currentFrame >= events[index].frame && events[index].frame >= from || 0 > range && currentFrame <= events[index].frame && events[index].frame <= from) {const event = events[index];event.isDone || (event.onlyOnce && (events.splice(index, 1), index--), event.isDone = !0, event.action(currentFrame));}return returnValue || (this._stopped = !0), returnValue;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/scene.js + 1 modules
var core_scene = __webpack_require__("./node_modules/@babylonjs/core/scene.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/precisionDate.js
var precisionDate = __webpack_require__("./node_modules/@babylonjs/core/Misc/precisionDate.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Bones/bone.js
var bone = __webpack_require__("./node_modules/@babylonjs/core/Bones/bone.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Animations/animatable.js
class Animatable {get syncRoot() {return this._syncRoot;}get masterFrame() {return 0 === this._runtimeAnimations.length ? 0 : this._runtimeAnimations[0].currentFrame;}get weight() {return this._weight;}set weight(value) {return -1 === value ? void (this._weight = -1) : void (this._weight = Math.min(Math.max(value, 0), 1));}get speedRatio() {return this._speedRatio;}set speedRatio(value) {for (let index = 0; index < this._runtimeAnimations.length; index++) {const animation = this._runtimeAnimations[index];animation._prepareForSpeedRatioChange(value);}this._speedRatio = value, null !== this._goToFrame && this.goToFrame(this._goToFrame);}constructor(scene, target, fromFrame = 0, toFrame = 100, loopAnimation = !1, speedRatio = 1, onAnimationEnd, animations, onAnimationLoop, isAdditive = !1) {this.target = target, this.fromFrame = fromFrame, this.toFrame = toFrame, this.loopAnimation = loopAnimation, this.onAnimationEnd = onAnimationEnd, this.onAnimationLoop = onAnimationLoop, this.isAdditive = isAdditive, this._localDelayOffset = null, this._pausedDelay = null, this._manualJumpDelay = null, this._runtimeAnimations = [], this._paused = !1, this._speedRatio = 1, this._weight = -1, this._syncRoot = null, this._frameToSyncFromJump = null, this._goToFrame = null, this.disposeOnEnd = !0, this.animationStarted = !1, this.onAnimationEndObservable = new observable/* Observable */.y$(), this.onAnimationLoopObservable = new observable/* Observable */.y$(), this._scene = scene, animations && this.appendAnimations(target, animations), this._speedRatio = speedRatio, scene._activeAnimatables.push(this);}syncWith(root) {if (this._syncRoot = root, root) {const index = this._scene._activeAnimatables.indexOf(this);-1 < index && (this._scene._activeAnimatables.splice(index, 1), this._scene._activeAnimatables.push(this));}return this;}getAnimations() {return this._runtimeAnimations;}appendAnimations(target, animations) {for (let index = 0; index < animations.length; index++) {const animation = animations[index],newRuntimeAnimation = new RuntimeAnimation(target, animation, this._scene, this);newRuntimeAnimation._onLoop = () => {this.onAnimationLoopObservable.notifyObservers(this), this.onAnimationLoop && this.onAnimationLoop();}, this._runtimeAnimations.push(newRuntimeAnimation);}}getAnimationByTargetProperty(property) {const runtimeAnimations = this._runtimeAnimations;for (let index = 0; index < runtimeAnimations.length; index++) if (runtimeAnimations[index].animation.targetProperty === property) return runtimeAnimations[index].animation;return null;}getRuntimeAnimationByTargetProperty(property) {const runtimeAnimations = this._runtimeAnimations;for (let index = 0; index < runtimeAnimations.length; index++) if (runtimeAnimations[index].animation.targetProperty === property) return runtimeAnimations[index];return null;}reset() {const runtimeAnimations = this._runtimeAnimations;for (let index = 0; index < runtimeAnimations.length; index++) runtimeAnimations[index].reset(!0);this._localDelayOffset = null, this._pausedDelay = null;}enableBlending(blendingSpeed) {const runtimeAnimations = this._runtimeAnimations;for (let index = 0; index < runtimeAnimations.length; index++) runtimeAnimations[index].animation.enableBlending = !0, runtimeAnimations[index].animation.blendingSpeed = blendingSpeed;}disableBlending() {const runtimeAnimations = this._runtimeAnimations;for (let index = 0; index < runtimeAnimations.length; index++) runtimeAnimations[index].animation.enableBlending = !1;}goToFrame(frame) {var _a;const runtimeAnimations = this._runtimeAnimations;if (runtimeAnimations[0]) {const fps = runtimeAnimations[0].animation.framePerSecond;this._frameToSyncFromJump = null !== (_a = this._frameToSyncFromJump) && void 0 !== _a ? _a : runtimeAnimations[0].currentFrame;const delay = 0 === this.speedRatio ? 0 : 1e3 * ((frame - this._frameToSyncFromJump) / fps) / this.speedRatio;this._manualJumpDelay = -delay;}for (let index = 0; index < runtimeAnimations.length; index++) runtimeAnimations[index].goToFrame(frame);this._goToFrame = frame;}pause() {this._paused || (this._paused = !0);}restart() {this._paused = !1;}_raiseOnAnimationEnd() {this.onAnimationEnd && this.onAnimationEnd(), this.onAnimationEndObservable.notifyObservers(this);}stop(animationName, targetMask) {if (animationName || targetMask) {const idx = this._scene._activeAnimatables.indexOf(this);if (-1 < idx) {const runtimeAnimations = this._runtimeAnimations;for (let index = runtimeAnimations.length - 1; 0 <= index; index--) {const runtimeAnimation = runtimeAnimations[index];animationName && runtimeAnimation.animation.name != animationName || (!targetMask || targetMask(runtimeAnimation.target)) && (runtimeAnimation.dispose(), runtimeAnimations.splice(index, 1));}0 == runtimeAnimations.length && (this._scene._activeAnimatables.splice(idx, 1), this._raiseOnAnimationEnd());}} else {const index = this._scene._activeAnimatables.indexOf(this);if (-1 < index) {this._scene._activeAnimatables.splice(index, 1);const runtimeAnimations = this._runtimeAnimations;for (let index = 0; index < runtimeAnimations.length; index++) runtimeAnimations[index].dispose();this._raiseOnAnimationEnd();}}}waitAsync() {return new Promise((resolve) => {this.onAnimationEndObservable.add(() => {resolve(this);}, void 0, void 0, this, !0);});}_animate(delay) {if (this._paused) return this.animationStarted = !1, null === this._pausedDelay && (this._pausedDelay = delay), !0;if (null === this._localDelayOffset ? (this._localDelayOffset = delay, this._pausedDelay = null) : null !== this._pausedDelay && (this._localDelayOffset += delay - this._pausedDelay, this._pausedDelay = null), null !== this._manualJumpDelay && (this._localDelayOffset += this._manualJumpDelay, this._manualJumpDelay = null, this._frameToSyncFromJump = null), this._goToFrame = null, 0 === this._weight) return !0;let running = !1;const runtimeAnimations = this._runtimeAnimations;let index;for (index = 0; index < runtimeAnimations.length; index++) {const animation = runtimeAnimations[index],isRunning = animation.animate(delay - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio, this._weight);running = running || isRunning;}if (this.animationStarted = running, !running) {if (this.disposeOnEnd) for (index = this._scene._activeAnimatables.indexOf(this), this._scene._activeAnimatables.splice(index, 1), index = 0; index < runtimeAnimations.length; index++) runtimeAnimations[index].dispose();this._raiseOnAnimationEnd(), this.disposeOnEnd && (this.onAnimationEnd = null, this.onAnimationLoop = null, this.onAnimationLoopObservable.clear(), this.onAnimationEndObservable.clear());}return running;}}core_scene/* Scene.prototype._animate */.x.prototype._animate = function () {if (this.animationsEnabled) {const now = precisionDate/* PrecisionDate.Now */.F.Now;if (!this._animationTimeLast) {if (0 < this._pendingData.length) return;this._animationTimeLast = now;}this.deltaTime = this.useConstantAnimationDeltaTime ? 16 : (now - this._animationTimeLast) * this.animationTimeScale, this._animationTimeLast = now;const animatables = this._activeAnimatables;if (0 !== animatables.length) {this._animationTime += this.deltaTime;const animationTime = this._animationTime;for (let index = 0; index < animatables.length; index++) {const animatable = animatables[index];!animatable._animate(animationTime) && animatable.disposeOnEnd && index--;}this._processLateAnimationBindings();}}}, core_scene/* Scene.prototype.beginWeightedAnimation */.x.prototype.beginWeightedAnimation = function (target, from, to, weight = 1, loop, speedRatio = 1, onAnimationEnd, animatable, targetMask, onAnimationLoop, isAdditive = !1) {const returnedAnimatable = this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, !1, targetMask, onAnimationLoop, isAdditive);return returnedAnimatable.weight = weight, returnedAnimatable;}, core_scene/* Scene.prototype.beginAnimation */.x.prototype.beginAnimation = function (target, from, to, loop, speedRatio = 1, onAnimationEnd, animatable, stopCurrent = !0, targetMask, onAnimationLoop, isAdditive = !1) {from > to && 0 < speedRatio && (speedRatio *= -1), stopCurrent && this.stopAnimation(target, void 0, targetMask), animatable || (animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, void 0, onAnimationLoop, isAdditive));const shouldRunTargetAnimations = !targetMask || targetMask(target);if (target.animations && shouldRunTargetAnimations && animatable.appendAnimations(target, target.animations), target.getAnimatables) {const animatables = target.getAnimatables();for (let index = 0; index < animatables.length; index++) this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, onAnimationLoop);}return animatable.reset(), animatable;}, core_scene/* Scene.prototype.beginHierarchyAnimation */.x.prototype.beginHierarchyAnimation = function (target, directDescendantsOnly, from, to, loop, speedRatio = 1, onAnimationEnd, animatable, stopCurrent = !0, targetMask, onAnimationLoop, isAdditive = !1) {const children = target.getDescendants(directDescendantsOnly),result = [];result.push(this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, void 0, isAdditive));for (const child of children) result.push(this.beginAnimation(child, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, void 0, isAdditive));return result;}, core_scene/* Scene.prototype.beginDirectAnimation */.x.prototype.beginDirectAnimation = function (target, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive = !1) {if (void 0 === speedRatio && (speedRatio = 1), from > to && 0 < speedRatio) speedRatio *= -1;else if (to > from && 0 > speedRatio) {const temp = to;to = from, from = temp;}const animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, animations, onAnimationLoop, isAdditive);return animatable;}, core_scene/* Scene.prototype.beginDirectHierarchyAnimation */.x.prototype.beginDirectHierarchyAnimation = function (target, directDescendantsOnly, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive = !1) {const children = target.getDescendants(directDescendantsOnly),result = [];result.push(this.beginDirectAnimation(target, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive));for (const child of children) result.push(this.beginDirectAnimation(child, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive));return result;}, core_scene/* Scene.prototype.getAnimatableByTarget */.x.prototype.getAnimatableByTarget = function (target) {for (let index = 0; index < this._activeAnimatables.length; index++) if (this._activeAnimatables[index].target === target) return this._activeAnimatables[index];return null;}, core_scene/* Scene.prototype.getAllAnimatablesByTarget */.x.prototype.getAllAnimatablesByTarget = function (target) {const result = [];for (let index = 0; index < this._activeAnimatables.length; index++) this._activeAnimatables[index].target === target && result.push(this._activeAnimatables[index]);return result;}, core_scene/* Scene.prototype.stopAnimation */.x.prototype.stopAnimation = function (target, animationName, targetMask) {const animatables = this.getAllAnimatablesByTarget(target);for (const animatable of animatables) animatable.stop(animationName, targetMask);}, core_scene/* Scene.prototype.stopAllAnimations */.x.prototype.stopAllAnimations = function () {if (this._activeAnimatables) {for (let i = 0; i < this._activeAnimatables.length; i++) this._activeAnimatables[i].stop();this._activeAnimatables.length = 0;}for (const group of this.animationGroups) group.stop();}, core_scene/* Scene.prototype._registerTargetForLateAnimationBinding */.x.prototype._registerTargetForLateAnimationBinding = function (runtimeAnimation, originalValue) {const target = runtimeAnimation.target;this._registeredForLateAnimationBindings.pushNoDuplicate(target), target._lateAnimationHolders || (target._lateAnimationHolders = {}), target._lateAnimationHolders[runtimeAnimation.targetPath] || (target._lateAnimationHolders[runtimeAnimation.targetPath] = { totalWeight: 0, totalAdditiveWeight: 0, animations: [], additiveAnimations: [], originalValue: originalValue }), runtimeAnimation.isAdditive ? (target._lateAnimationHolders[runtimeAnimation.targetPath].additiveAnimations.push(runtimeAnimation), target._lateAnimationHolders[runtimeAnimation.targetPath].totalAdditiveWeight += runtimeAnimation.weight) : (target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation), target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight);}, core_scene/* Scene.prototype._processLateAnimationBindingsForMatrices */.x.prototype._processLateAnimationBindingsForMatrices = function (holder) {if (0 === holder.totalWeight && 0 === holder.totalAdditiveWeight) return holder.originalValue;let normalizer = 1;const finalPosition = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],finalScaling = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1],finalQuaternion = math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0];let startIndex = 0;const originalAnimation = holder.animations[0],originalValue = holder.originalValue;let scale = 1,skipOverride = !1;if (1 > holder.totalWeight) scale = 1 - holder.totalWeight, originalValue.decompose(finalScaling, finalQuaternion, finalPosition);else {if (startIndex = 1, normalizer = holder.totalWeight, scale = originalAnimation.weight / normalizer, 1 == scale) if (holder.totalAdditiveWeight) skipOverride = !0;else return originalAnimation.currentValue;originalAnimation.currentValue.decompose(finalScaling, finalQuaternion, finalPosition);}if (!skipOverride) {finalScaling.scaleInPlace(scale), finalPosition.scaleInPlace(scale), finalQuaternion.scaleInPlace(scale);for (let animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {const runtimeAnimation = holder.animations[animIndex];if (0 === runtimeAnimation.weight) continue;scale = runtimeAnimation.weight / normalizer;const currentPosition = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],currentScaling = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3],currentQuaternion = math_vector/* TmpVectors.Quaternion.1 */.jp.Quaternion[1];runtimeAnimation.currentValue.decompose(currentScaling, currentQuaternion, currentPosition), currentScaling.scaleAndAddToRef(scale, finalScaling), currentQuaternion.scaleAndAddToRef(0 < math_vector/* Quaternion.Dot */._f.Dot(finalQuaternion, currentQuaternion) ? scale : -scale, finalQuaternion), currentPosition.scaleAndAddToRef(scale, finalPosition);}finalQuaternion.normalize();}for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {const runtimeAnimation = holder.additiveAnimations[animIndex];if (0 === runtimeAnimation.weight) continue;const currentPosition = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],currentScaling = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3],currentQuaternion = math_vector/* TmpVectors.Quaternion.1 */.jp.Quaternion[1];runtimeAnimation.currentValue.decompose(currentScaling, currentQuaternion, currentPosition), currentScaling.multiplyToRef(finalScaling, currentScaling), math_vector/* Vector3.LerpToRef */.P.LerpToRef(finalScaling, currentScaling, runtimeAnimation.weight, finalScaling), finalQuaternion.multiplyToRef(currentQuaternion, currentQuaternion), math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(finalQuaternion, currentQuaternion, runtimeAnimation.weight, finalQuaternion), currentPosition.scaleAndAddToRef(runtimeAnimation.weight, finalPosition);}const workValue = originalAnimation ? originalAnimation._animationState.workValue : math_vector/* TmpVectors.Matrix.0.clone */.jp.Matrix[0].clone();return math_vector/* Matrix.ComposeToRef */.y3.ComposeToRef(finalScaling, finalQuaternion, finalPosition, workValue), workValue;}, core_scene/* Scene.prototype._processLateAnimationBindingsForQuaternions */.x.prototype._processLateAnimationBindingsForQuaternions = function (holder, refQuaternion) {if (0 === holder.totalWeight && 0 === holder.totalAdditiveWeight) return refQuaternion;const originalAnimation = holder.animations[0],originalValue = holder.originalValue;let cumulativeQuaternion = refQuaternion;if (0 === holder.totalWeight && 0 < holder.totalAdditiveWeight) cumulativeQuaternion.copyFrom(originalValue);else if (1 === holder.animations.length) {if (math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(originalValue, originalAnimation.currentValue, Math.min(1, holder.totalWeight), cumulativeQuaternion), 0 === holder.totalAdditiveWeight) return cumulativeQuaternion;} else if (1 < holder.animations.length) {let quaternions,weights,normalizer = 1;if (1 > holder.totalWeight) {const scale = 1 - holder.totalWeight;quaternions = [], weights = [], quaternions.push(originalValue), weights.push(scale);} else {if (2 === holder.animations.length && (math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(holder.animations[0].currentValue, holder.animations[1].currentValue, holder.animations[1].weight / holder.totalWeight, refQuaternion), 0 === holder.totalAdditiveWeight)) return refQuaternion;quaternions = [], weights = [], normalizer = holder.totalWeight;}for (let animIndex = 0; animIndex < holder.animations.length; animIndex++) {const runtimeAnimation = holder.animations[animIndex];quaternions.push(runtimeAnimation.currentValue), weights.push(runtimeAnimation.weight / normalizer);}let cumulativeAmount = 0;for (let index = 0; index < quaternions.length;) {if (!index) {math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(quaternions[index], quaternions[index + 1], weights[index + 1] / (weights[index] + weights[index + 1]), refQuaternion), cumulativeQuaternion = refQuaternion, cumulativeAmount = weights[index] + weights[index + 1], index += 2;continue;}cumulativeAmount += weights[index], math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(cumulativeQuaternion, quaternions[index], weights[index] / cumulativeAmount, cumulativeQuaternion), index++;}}for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {const runtimeAnimation = holder.additiveAnimations[animIndex];0 !== runtimeAnimation.weight && (cumulativeQuaternion.multiplyToRef(runtimeAnimation.currentValue, math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0]), math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(cumulativeQuaternion, math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], runtimeAnimation.weight, cumulativeQuaternion));}return cumulativeQuaternion;}, core_scene/* Scene.prototype._processLateAnimationBindings */.x.prototype._processLateAnimationBindings = function () {if (this._registeredForLateAnimationBindings.length) {for (let index = 0; index < this._registeredForLateAnimationBindings.length; index++) {const target = this._registeredForLateAnimationBindings.data[index];for (const path in target._lateAnimationHolders) {const holder = target._lateAnimationHolders[path],originalAnimation = holder.animations[0],originalValue = holder.originalValue;if (void 0 === originalValue || null === originalValue) continue;const matrixDecomposeMode = Animations_animation/* Animation.AllowMatrixDecomposeForInterpolation */.f.AllowMatrixDecomposeForInterpolation && originalValue.m;let finalValue = target[path];if (matrixDecomposeMode) finalValue = this._processLateAnimationBindingsForMatrices(holder);else {const quaternionMode = void 0 !== originalValue.w;if (quaternionMode) finalValue = this._processLateAnimationBindingsForQuaternions(holder, finalValue || math_vector/* Quaternion.Identity */._f.Identity());else {let startIndex = 0,normalizer = 1;if (1 > holder.totalWeight) finalValue = originalAnimation && originalValue.scale ? originalValue.scale(1 - holder.totalWeight) : originalAnimation ? originalValue * (1 - holder.totalWeight) : originalValue.clone ? originalValue.clone() : originalValue;else if (originalAnimation) {normalizer = holder.totalWeight;const scale = originalAnimation.weight / normalizer;finalValue = 1 == scale ? originalAnimation.currentValue : originalAnimation.currentValue.scale ? originalAnimation.currentValue.scale(scale) : originalAnimation.currentValue * scale, startIndex = 1;}for (let animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {const runtimeAnimation = holder.animations[animIndex],scale = runtimeAnimation.weight / normalizer;if (!scale) continue;else runtimeAnimation.currentValue.scaleAndAddToRef ? runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue) : finalValue += runtimeAnimation.currentValue * scale;}for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {const runtimeAnimation = holder.additiveAnimations[animIndex],scale = runtimeAnimation.weight;if (!scale) continue;else runtimeAnimation.currentValue.scaleAndAddToRef ? runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue) : finalValue += runtimeAnimation.currentValue * scale;}}}target[path] = finalValue;}target._lateAnimationHolders = {};}this._registeredForLateAnimationBindings.reset();}}, bone/* Bone.prototype.copyAnimationRange */.N.prototype.copyAnimationRange = function (source, rangeName, frameOffset, rescaleAsRequired = !1, skelDimensionsRatio = null) {0 === this.animations.length && (this.animations.push(new Animations_animation/* Animation */.f(this.name, "_matrix", source.animations[0].framePerSecond, Animations_animation/* Animation.ANIMATIONTYPE_MATRIX */.f.ANIMATIONTYPE_MATRIX, 0)), this.animations[0].setKeys([]));const sourceRange = source.animations[0].getRange(rangeName);if (!sourceRange) return !1;const from = sourceRange.from,to = sourceRange.to,sourceKeys = source.animations[0].getKeys(),sourceBoneLength = source.length,sourceParent = source.getParent(),parent = this.getParent(),parentScalingReqd = rescaleAsRequired && sourceParent && sourceBoneLength && this.length && sourceBoneLength !== this.length,parentRatio = parentScalingReqd && parent && sourceParent ? parent.length / sourceParent.length : 1,dimensionsScalingReqd = rescaleAsRequired && !parent && skelDimensionsRatio && (1 !== skelDimensionsRatio.x || 1 !== skelDimensionsRatio.y || 1 !== skelDimensionsRatio.z),destKeys = this.animations[0].getKeys();let orig, origTranslation, mat;for (let key = 0, nKeys = sourceKeys.length; key < nKeys; key++) orig = sourceKeys[key], orig.frame >= from && orig.frame <= to && (rescaleAsRequired ? (mat = orig.value.clone(), parentScalingReqd ? (origTranslation = mat.getTranslation(), mat.setTranslation(origTranslation.scaleInPlace(parentRatio))) : dimensionsScalingReqd && skelDimensionsRatio ? (origTranslation = mat.getTranslation(), mat.setTranslation(origTranslation.multiplyInPlace(skelDimensionsRatio))) : mat = orig.value) : mat = orig.value, destKeys.push({ frame: orig.frame + frameOffset, value: mat }));return this.animations[0].createRange(rangeName, from + frameOffset, to + frameOffset), !0;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Animations/animationPropertiesOverride.js
class AnimationPropertiesOverride {constructor() {this.enableBlending = !1, this.blendingSpeed = .01, this.loopMode = Animations_animation/* Animation.ANIMATIONLOOPMODE_CYCLE */.f.ANIMATIONLOOPMODE_CYCLE;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.path.js
var math_path = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.path.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Animations/easing.js
class EasingFunction {constructor() {this._easingMode = EasingFunction.EASINGMODE_EASEIN;}setEasingMode(easingMode) {const n = Math.min(Math.max(easingMode, 0), 2);this._easingMode = n;}getEasingMode() {return this._easingMode;}easeInCore() {throw new Error("You must implement this method");}ease(gradient) {switch (this._easingMode) {case EasingFunction.EASINGMODE_EASEIN:return this.easeInCore(gradient);case EasingFunction.EASINGMODE_EASEOUT:return 1 - this.easeInCore(1 - gradient);}return .5 <= gradient ? .5 * (1 - this.easeInCore(2 * (1 - gradient))) + .5 : .5 * this.easeInCore(2 * gradient);}}EasingFunction.EASINGMODE_EASEIN = 0, EasingFunction.EASINGMODE_EASEOUT = 1, EasingFunction.EASINGMODE_EASEINOUT = 2;class CircleEase extends EasingFunction {easeInCore(gradient) {return gradient = Math.max(0, Math.min(1, gradient)), 1 - Math.sqrt(1 - gradient * gradient);}}class BackEase extends EasingFunction {constructor(amplitude = 1) {super(), this.amplitude = amplitude;}easeInCore(gradient) {const num = Math.max(0, this.amplitude);return Math.pow(gradient, 3) - gradient * num * Math.sin(3.141592653589793 * gradient);}}class BounceEase extends EasingFunction {constructor(bounces = 3, bounciness = 2) {super(), this.bounces = bounces, this.bounciness = bounciness;}easeInCore(gradient) {const y = Math.max(0, this.bounces);let bounciness = this.bounciness;1 >= bounciness && (bounciness = 1.001);const num9 = Math.pow(bounciness, y),num5 = 1 - bounciness,num4 = (1 - num9) / num5 + .5 * num9,num65 = Math.log(-(gradient * num4) * (1 - bounciness) + 1) / Math.log(bounciness),num3 = Math.floor(num65),num8 = (1 - Math.pow(bounciness, num3)) / (num5 * num4),num12 = (1 - Math.pow(bounciness, num3 + 1)) / (num5 * num4),num7 = .5 * (num8 + num12),num6 = gradient - num7,num2 = num7 - num8;return -Math.pow(1 / bounciness, y - num3) / (num2 * num2) * (num6 - num2) * (num6 + num2);}}class CubicEase extends EasingFunction {easeInCore(gradient) {return gradient * gradient * gradient;}}class ElasticEase extends EasingFunction {constructor(oscillations = 3, springiness = 3) {super(), this.oscillations = oscillations, this.springiness = springiness;}easeInCore(gradient) {let num2;const num3 = Math.max(0, this.oscillations),num = Math.max(0, this.springiness);return num2 = 0 == num ? gradient : (Math.exp(num * gradient) - 1) / (Math.exp(num) - 1), num2 * Math.sin((6.283185307179586 * num3 + 1.5707963267948966) * gradient);}}class ExponentialEase extends EasingFunction {constructor(exponent = 2) {super(), this.exponent = exponent;}easeInCore(gradient) {return 0 >= this.exponent ? gradient : (Math.exp(this.exponent * gradient) - 1) / (Math.exp(this.exponent) - 1);}}class PowerEase extends EasingFunction {constructor(power = 2) {super(), this.power = power;}easeInCore(gradient) {const y = Math.max(0, this.power);return Math.pow(gradient, y);}}class QuadraticEase extends EasingFunction {easeInCore(gradient) {return gradient * gradient;}}class QuarticEase extends EasingFunction {easeInCore(gradient) {return gradient * gradient * gradient * gradient;}}class QuinticEase extends EasingFunction {easeInCore(gradient) {return gradient * gradient * gradient * gradient * gradient;}}class SineEase extends EasingFunction {easeInCore(gradient) {return 1 - Math.sin(1.5707963267948966 * (1 - gradient));}}class BezierCurveEase extends EasingFunction {constructor(x1 = 0, y1 = 0, x2 = 1, y2 = 1) {super(), this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2;}easeInCore(gradient) {return math_path/* BezierCurve.Interpolate */.hr.Interpolate(gradient, this.x1, this.y1, this.x2, this.y2);}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationEvent.js
var animationEvent = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationEvent.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationGroup.js
var Animations_animationGroup = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationGroup.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationKey.js
var animationKey = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationKey.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationRange.js
var animationRange = __webpack_require__("./node_modules/@babylonjs/core/Animations/animationRange.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Animations/animatable.interface.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Animations/pathCursor.js
class PathCursor {constructor(_path) {this._path = _path, this._onchange = [], this.value = 0, this.animations = [];}getPoint() {const point = this._path.getPointAtLengthPosition(this.value);return new math_vector/* Vector3 */.P(point.x, 0, point.y);}moveAhead(step = .002) {return this.move(step), this;}moveBack(step = .002) {return this.move(-step), this;}move(step) {if (1 < Math.abs(step)) throw "step size should be less than 1.";return this.value += step, this._ensureLimits(), this._raiseOnChange(), this;}_ensureLimits() {for (; 1 < this.value;) this.value -= 1;for (; 0 > this.value;) this.value += 1;return this;}_raiseOnChange() {return this._onchange.forEach((f) => f(this)), this;}onchange(f) {return this._onchange.push(f), this;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Animations/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/assetContainer.js
var assetContainer = __webpack_require__("./node_modules/@babylonjs/core/assetContainer.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Audio/Interfaces/IAudioEngine.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Audio/Interfaces/ISoundOptions.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engine.js
var engine = __webpack_require__("./node_modules/@babylonjs/core/Engines/engine.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Audio/analyser.js
class Analyser {constructor(scene) {if (this.SMOOTHING = .75, this.FFT_SIZE = 512, this.BARGRAPHAMPLITUDE = 256, this.DEBUGCANVASPOS = { x: 20, y: 20 }, this.DEBUGCANVASSIZE = { width: 320, height: 200 }, scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, !!scene) return this._scene = scene, engine/* Engine.audioEngine */.D.audioEngine ? void (this._audioEngine = engine/* Engine.audioEngine */.D.audioEngine, this._audioEngine.canUseWebAudio && this._audioEngine.audioContext && (this._webAudioAnalyser = this._audioEngine.audioContext.createAnalyser(), this._webAudioAnalyser.minDecibels = -140, this._webAudioAnalyser.maxDecibels = 0, this._byteFreqs = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._byteTime = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._floatFreqs = new Float32Array(this._webAudioAnalyser.frequencyBinCount))) : void tools/* Tools.Warn */.w1.Warn("No audio engine initialized, failed to create an audio analyser");}getFrequencyBinCount() {return this._audioEngine.canUseWebAudio ? this._webAudioAnalyser.frequencyBinCount : 0;}getByteFrequencyData() {return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs)), this._byteFreqs;}getByteTimeDomainData() {return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteTimeDomainData(this._byteTime)), this._byteTime;}getFloatFrequencyData() {return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs)), this._floatFreqs;}drawDebugCanvas() {if (this._audioEngine.canUseWebAudio && (this._debugCanvas || (this._debugCanvas = document.createElement("canvas"), this._debugCanvas.width = this.DEBUGCANVASSIZE.width, this._debugCanvas.height = this.DEBUGCANVASSIZE.height, this._debugCanvas.style.position = "absolute", this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px", this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px", this._debugCanvasContext = this._debugCanvas.getContext("2d"), document.body.appendChild(this._debugCanvas), this._registerFunc = () => {this.drawDebugCanvas();}, this._scene.registerBeforeRender(this._registerFunc)), this._registerFunc && this._debugCanvasContext)) {const workingArray = this.getByteFrequencyData();this._debugCanvasContext.fillStyle = "rgb(0, 0, 0)", this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);for (let i = 0; i < this.getFrequencyBinCount(); i++) {const value = workingArray[i],percent = value / this.BARGRAPHAMPLITUDE,height = this.DEBUGCANVASSIZE.height * percent,offset = this.DEBUGCANVASSIZE.height - height - 1,barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount(),hue = 360 * (i / this.getFrequencyBinCount());this._debugCanvasContext.fillStyle = "hsl(" + hue + ", 100%, 50%)", this._debugCanvasContext.fillRect(i * barWidth, offset, barWidth, height);}}}stopDebugCanvas() {this._debugCanvas && (this._registerFunc && (this._scene.unregisterBeforeRender(this._registerFunc), this._registerFunc = null), document.body.removeChild(this._debugCanvas), this._debugCanvas = null, this._debugCanvasContext = null);}connectAudioNodes(inputAudioNode, outputAudioNode) {this._audioEngine.canUseWebAudio && (inputAudioNode.connect(this._webAudioAnalyser), this._webAudioAnalyser.connect(outputAudioNode));}dispose() {this._audioEngine.canUseWebAudio && this._webAudioAnalyser.disconnect();}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/domManagement.js
var domManagement = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Audio/audioEngine.js
engine/* Engine.AudioEngineFactory */.D.AudioEngineFactory = (hostElement, audioContext, audioDestination) => new AudioEngine(hostElement, audioContext, audioDestination);class AudioEngine {get audioContext() {return this._audioContextInitialized ? !this.unlocked && !this._muteButton && this._displayMuteButton() : this._initializeAudioContext(), this._audioContext;}constructor(hostElement = null, audioContext = null, audioDestination = null) {if (this._audioContext = null, this._audioContextInitialized = !1, this._muteButton = null, this._audioDestination = null, this.canUseWebAudio = !1, this.WarnedWebAudioUnsupported = !1, this.isMP3supported = !1, this.isOGGsupported = !1, this.unlocked = !0, this.useCustomUnlockedButton = !1, this.onAudioUnlockedObservable = new observable/* Observable */.y$(), this.onAudioLockedObservable = new observable/* Observable */.y$(), this._tryToRun = !1, this._onResize = () => {this._moveButtonToTopLeft();}, !!(0,domManagement/* IsWindowObjectExist */.CG)()) {"undefined" != typeof window.AudioContext && (this.canUseWebAudio = !0);const audioElem = document.createElement("audio");this._hostElement = hostElement, this._audioContext = audioContext, this._audioDestination = audioDestination;try {audioElem && !!audioElem.canPlayType && (audioElem.canPlayType("audio/mpeg; codecs=\"mp3\"").replace(/^no$/, "") || audioElem.canPlayType("audio/mp3").replace(/^no$/, "")) && (this.isMP3supported = !0);} catch (e) {}try {audioElem && !!audioElem.canPlayType && audioElem.canPlayType("audio/ogg; codecs=\"vorbis\"").replace(/^no$/, "") && (this.isOGGsupported = !0);} catch (e) {}}}lock() {this._triggerSuspendedState();}unlock() {this._triggerRunningState();}_resumeAudioContext() {let result;return void 0 !== this._audioContext.resume && (result = this._audioContext.resume()), result || Promise.resolve();}_initializeAudioContext() {try {this.canUseWebAudio && (!this._audioContext && (this._audioContext = new AudioContext()), this.masterGain = this._audioContext.createGain(), this.masterGain.gain.value = 1, !this._audioDestination && (this._audioDestination = this._audioContext.destination), this.masterGain.connect(this._audioDestination), this._audioContextInitialized = !0, "running" === this._audioContext.state && this._triggerRunningState());} catch (e) {this.canUseWebAudio = !1, logger/* Logger.Error */.Y.Error("Web Audio: " + e.message);}}_triggerRunningState() {this._tryToRun || (this._tryToRun = !0, this._resumeAudioContext().then(() => {this._tryToRun = !1, this._muteButton && this._hideMuteButton(), this.unlocked = !0, this.onAudioUnlockedObservable.notifyObservers(this);}).catch(() => {this._tryToRun = !1, this.unlocked = !1;}));}_triggerSuspendedState() {this.unlocked = !1, this.onAudioLockedObservable.notifyObservers(this), this._displayMuteButton();}_displayMuteButton() {if (this.useCustomUnlockedButton || this._muteButton) return;this._muteButton = document.createElement("BUTTON"), this._muteButton.className = "babylonUnmuteIcon", this._muteButton.id = "babylonUnmuteIconBtn", this._muteButton.title = "Unmute";const imageUrl = window.SVGSVGElement ? "data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E" : "https://cdn.babylonjs.com/Assets/audio.png",style = document.createElement("style");style.appendChild(document.createTextNode(".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url(" + imageUrl + ");  background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }")), document.getElementsByTagName("head")[0].appendChild(style), document.body.appendChild(this._muteButton), this._moveButtonToTopLeft(), this._muteButton.addEventListener("touchend", () => {this._triggerRunningState();}, !0), this._muteButton.addEventListener("click", () => {this._triggerRunningState();}, !0), window.addEventListener("resize", this._onResize);}_moveButtonToTopLeft() {this._hostElement && this._muteButton && (this._muteButton.style.top = this._hostElement.offsetTop + 20 + "px", this._muteButton.style.left = this._hostElement.offsetLeft + 20 + "px");}_hideMuteButton() {this._muteButton && (document.body.removeChild(this._muteButton), this._muteButton = null);}dispose() {this.canUseWebAudio && this._audioContextInitialized && (this._connectedAnalyser && this._audioContext && (this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser.dispose(), this.masterGain.disconnect(), this.masterGain.connect(this._audioContext.destination), this._connectedAnalyser = null), this.masterGain.gain.value = 1), this.WarnedWebAudioUnsupported = !1, this._hideMuteButton(), window.removeEventListener("resize", this._onResize), this.onAudioUnlockedObservable.clear(), this.onAudioLockedObservable.clear();}getGlobalVolume() {return this.canUseWebAudio && this._audioContextInitialized ? this.masterGain.gain.value : -1;}setGlobalVolume(newVolume) {this.canUseWebAudio && this._audioContextInitialized && (this.masterGain.gain.value = newVolume);}connectToAnalyser(analyser) {this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this.canUseWebAudio && this._audioContextInitialized && this._audioContext && (this._connectedAnalyser = analyser, this.masterGain.disconnect(), this._connectedAnalyser.connectAudioNodes(this.masterGain, this._audioContext.destination));}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Audio/sound.js
var sound = __webpack_require__("./node_modules/@babylonjs/core/Audio/sound.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Audio/soundTrack.js
class SoundTrack {constructor(scene, options = {}) {this.id = -1, this._isInitialized = !1, scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;scene && (this._scene = scene, this.soundCollection = [], this._options = options, !this._options.mainTrack && this._scene.soundTracks && (this._scene.soundTracks.push(this), this.id = this._scene.soundTracks.length - 1));}_initializeSoundTrackAudioGraph() {var _a;(null === (_a = engine/* Engine.audioEngine */.D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && engine/* Engine.audioEngine.audioContext */.D.audioEngine.audioContext && (this._outputAudioNode = engine/* Engine.audioEngine.audioContext.createGain */.D.audioEngine.audioContext.createGain(), this._outputAudioNode.connect(engine/* Engine.audioEngine.masterGain */.D.audioEngine.masterGain), this._options && this._options.volume && (this._outputAudioNode.gain.value = this._options.volume), this._isInitialized = !0);}dispose() {if (engine/* Engine.audioEngine */.D.audioEngine && engine/* Engine.audioEngine.canUseWebAudio */.D.audioEngine.canUseWebAudio) {for (this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(); this.soundCollection.length;) this.soundCollection[0].dispose();this._outputAudioNode && this._outputAudioNode.disconnect(), this._outputAudioNode = null;}}addSound(sound) {var _a;this._isInitialized || this._initializeSoundTrackAudioGraph(), (null === (_a = engine/* Engine.audioEngine */.D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._outputAudioNode && sound.connectToSoundTrackAudioNode(this._outputAudioNode), sound.soundTrackId && (-1 === sound.soundTrackId ? this._scene.mainSoundTrack.removeSound(sound) : this._scene.soundTracks && this._scene.soundTracks[sound.soundTrackId].removeSound(sound)), this.soundCollection.push(sound), sound.soundTrackId = this.id;}removeSound(sound) {const index = this.soundCollection.indexOf(sound);-1 !== index && this.soundCollection.splice(index, 1);}setVolume(newVolume) {var _a;(null === (_a = engine/* Engine.audioEngine */.D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._outputAudioNode && (this._outputAudioNode.gain.value = newVolume);}switchPanningModelToHRTF() {var _a;if (null === (_a = engine/* Engine.audioEngine */.D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) for (let i = 0; i < this.soundCollection.length; i++) this.soundCollection[i].switchPanningModelToHRTF();}switchPanningModelToEqualPower() {var _a;if (null === (_a = engine/* Engine.audioEngine */.D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) for (let i = 0; i < this.soundCollection.length; i++) this.soundCollection[i].switchPanningModelToEqualPower();}connectToAnalyser(analyser) {var _a;this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser = analyser, (null === (_a = engine/* Engine.audioEngine */.D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) && this._outputAudioNode && (this._outputAudioNode.disconnect(), this._connectedAnalyser.connectAudioNodes(this._outputAudioNode, engine/* Engine.audioEngine.masterGain */.D.audioEngine.masterGain));}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/sceneComponent.js
var sceneComponent = __webpack_require__("./node_modules/@babylonjs/core/sceneComponent.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Audio/audioSceneComponent.js
abstractScene/* AbstractScene.AddParser */.p.AddParser(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO, (parsedData, scene, container, rootUrl) => {var _a;let loadedSound,loadedSounds = [];if (container.sounds = container.sounds || [], void 0 !== parsedData.sounds && null !== parsedData.sounds) for (let index = 0, cache = parsedData.sounds.length; index < cache; index++) {const parsedSound = parsedData.sounds[index];(null === (_a = engine/* Engine.audioEngine */.D.audioEngine) || void 0 === _a ? void 0 : _a.canUseWebAudio) ? (!parsedSound.url && (parsedSound.url = parsedSound.name), loadedSounds[parsedSound.url] ? container.sounds.push(sound/* Sound.Parse */.$.Parse(parsedSound, scene, rootUrl, loadedSounds[parsedSound.url])) : (loadedSound = sound/* Sound.Parse */.$.Parse(parsedSound, scene, rootUrl), loadedSounds[parsedSound.url] = loadedSound, container.sounds.push(loadedSound))) : container.sounds.push(new sound/* Sound */.$(parsedSound.name, null, scene));}loadedSounds = [];}), Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "mainSoundTrack", { get: function () {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);return compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), this._mainSoundTrack || (this._mainSoundTrack = new SoundTrack(this, { mainTrack: !0 })), this._mainSoundTrack;}, enumerable: !0, configurable: !0 }), core_scene/* Scene.prototype.getSoundByName */.x.prototype.getSoundByName = function (name) {let index;for (index = 0; index < this.mainSoundTrack.soundCollection.length; index++) if (this.mainSoundTrack.soundCollection[index].name === name) return this.mainSoundTrack.soundCollection[index];if (this.soundTracks) for (let sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) if (this.soundTracks[sdIndex].soundCollection[index].name === name) return this.soundTracks[sdIndex].soundCollection[index];return null;}, Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "audioEnabled", { get: function () {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);return compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), compo.audioEnabled;}, set: function (value) {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), value ? compo.enableAudio() : compo.disableAudio();}, enumerable: !0, configurable: !0 }), Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "headphone", { get: function () {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);return compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), compo.headphone;}, set: function (value) {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), value ? compo.switchAudioModeForHeadphones() : compo.switchAudioModeForNormalSpeakers();}, enumerable: !0, configurable: !0 }), Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "audioListenerPositionProvider", { get: function () {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);return compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), compo.audioListenerPositionProvider;}, set: function (value) {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);if (compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), "function" != typeof value) throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3");else compo.audioListenerPositionProvider = value;}, enumerable: !0, configurable: !0 }), Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "audioListenerRotationProvider", { get: function () {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);return compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), compo.audioListenerRotationProvider;}, set: function (value) {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);if (compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), "function" != typeof value) throw new Error("The value passed to [Scene.audioListenerRotationProvider] must be a function that returns a Vector3");else compo.audioListenerRotationProvider = value;}, enumerable: !0, configurable: !0 }), Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "audioPositioningRefreshRate", { get: function () {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);return compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), compo.audioPositioningRefreshRate;}, set: function (value) {let compo = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);compo || (compo = new AudioSceneComponent(this), this._addComponent(compo)), compo.audioPositioningRefreshRate = value;}, enumerable: !0, configurable: !0 });class AudioSceneComponent {get audioEnabled() {return this._audioEnabled;}get headphone() {return this._headphone;}constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO, this._audioEnabled = !0, this._headphone = !1, this.audioPositioningRefreshRate = 500, this.audioListenerPositionProvider = null, this.audioListenerRotationProvider = null, this._cachedCameraDirection = new math_vector/* Vector3 */.P(), this._cachedCameraPosition = new math_vector/* Vector3 */.P(), this._lastCheck = 0, this._invertMatrixTemp = new math_vector/* Matrix */.y3(), this._cameraDirectionTemp = new math_vector/* Vector3 */.P(), scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;scene && (this.scene = scene, scene.soundTracks = [], scene.sounds = []);}register() {this.scene._afterRenderStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERRENDER_AUDIO */.l.STEP_AFTERRENDER_AUDIO, this, this._afterRender);}rebuild() {}serialize(serializationObject) {if (serializationObject.sounds = [], this.scene.soundTracks) for (let index = 0; index < this.scene.soundTracks.length; index++) {const soundtrack = this.scene.soundTracks[index];for (let soundId = 0; soundId < soundtrack.soundCollection.length; soundId++) serializationObject.sounds.push(soundtrack.soundCollection[soundId].serialize());}}addFromContainer(container) {container.sounds && container.sounds.forEach((sound) => {sound.play(), sound.autoplay = !0, this.scene.mainSoundTrack.addSound(sound);});}removeFromContainer(container, dispose = !1) {container.sounds && container.sounds.forEach((sound) => {sound.stop(), sound.autoplay = !1, this.scene.mainSoundTrack.removeSound(sound), dispose && sound.dispose();});}dispose() {const scene = this.scene;if (scene._mainSoundTrack && scene.mainSoundTrack.dispose(), scene.soundTracks) for (let scIndex = 0; scIndex < scene.soundTracks.length; scIndex++) scene.soundTracks[scIndex].dispose();}disableAudio() {const scene = this.scene;this._audioEnabled = !1, engine/* Engine.audioEngine */.D.audioEngine && engine/* Engine.audioEngine.audioContext */.D.audioEngine.audioContext && engine/* Engine.audioEngine.audioContext.suspend */.D.audioEngine.audioContext.suspend();let i;for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) scene.mainSoundTrack.soundCollection[i].pause();if (scene.soundTracks) for (i = 0; i < scene.soundTracks.length; i++) for (let j = 0; j < scene.soundTracks[i].soundCollection.length; j++) scene.soundTracks[i].soundCollection[j].pause();}enableAudio() {const scene = this.scene;this._audioEnabled = !0, engine/* Engine.audioEngine */.D.audioEngine && engine/* Engine.audioEngine.audioContext */.D.audioEngine.audioContext && engine/* Engine.audioEngine.audioContext.resume */.D.audioEngine.audioContext.resume();let i;for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) scene.mainSoundTrack.soundCollection[i].isPaused && scene.mainSoundTrack.soundCollection[i].play();if (scene.soundTracks) for (i = 0; i < scene.soundTracks.length; i++) for (let j = 0; j < scene.soundTracks[i].soundCollection.length; j++) scene.soundTracks[i].soundCollection[j].isPaused && scene.soundTracks[i].soundCollection[j].play();}switchAudioModeForHeadphones() {const scene = this.scene;if (this._headphone = !0, scene.mainSoundTrack.switchPanningModelToHRTF(), scene.soundTracks) for (let i = 0; i < scene.soundTracks.length; i++) scene.soundTracks[i].switchPanningModelToHRTF();}switchAudioModeForNormalSpeakers() {const scene = this.scene;if (this._headphone = !1, scene.mainSoundTrack.switchPanningModelToEqualPower(), scene.soundTracks) for (let i = 0; i < scene.soundTracks.length; i++) scene.soundTracks[i].switchPanningModelToEqualPower();}_afterRender() {const now = precisionDate/* PrecisionDate.Now */.F.Now;if (!(this._lastCheck && now - this._lastCheck < this.audioPositioningRefreshRate)) {this._lastCheck = now;const scene = this.scene;if (this._audioEnabled && scene._mainSoundTrack && scene.soundTracks && (0 !== scene._mainSoundTrack.soundCollection.length || 1 !== scene.soundTracks.length)) {const audioEngine = engine/* Engine.audioEngine */.D.audioEngine;if (audioEngine && audioEngine.audioContext) {let listeningCamera = scene.activeCamera;if (scene.activeCameras && 0 < scene.activeCameras.length && (listeningCamera = scene.activeCameras[0]), this.audioListenerPositionProvider) {const position = this.audioListenerPositionProvider();audioEngine.audioContext.listener.setPosition(position.x || 0, position.y || 0, position.z || 0);} else listeningCamera ? this._cachedCameraPosition.equals(listeningCamera.globalPosition) || (this._cachedCameraPosition.copyFrom(listeningCamera.globalPosition), audioEngine.audioContext.listener.setPosition(listeningCamera.globalPosition.x, listeningCamera.globalPosition.y, listeningCamera.globalPosition.z)) : audioEngine.audioContext.listener.setPosition(0, 0, 0);if (this.audioListenerRotationProvider) {const rotation = this.audioListenerRotationProvider();audioEngine.audioContext.listener.setOrientation(rotation.x || 0, rotation.y || 0, rotation.z || 0, 0, 1, 0);} else listeningCamera ? (listeningCamera.rigCameras && 0 < listeningCamera.rigCameras.length && (listeningCamera = listeningCamera.rigCameras[0]), listeningCamera.getViewMatrix().invertToRef(this._invertMatrixTemp), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(AudioSceneComponent._CameraDirection, this._invertMatrixTemp, this._cameraDirectionTemp), this._cameraDirectionTemp.normalize(), isNaN(this._cameraDirectionTemp.x) || isNaN(this._cameraDirectionTemp.y) || isNaN(this._cameraDirectionTemp.z) || this._cachedCameraDirection.equals(this._cameraDirectionTemp) || (this._cachedCameraDirection.copyFrom(this._cameraDirectionTemp), audioEngine.audioContext.listener.setOrientation(this._cameraDirectionTemp.x, this._cameraDirectionTemp.y, this._cameraDirectionTemp.z, 0, 1, 0))) : audioEngine.audioContext.listener.setOrientation(0, 0, 0, 0, 1, 0);let i;for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) {const sound = scene.mainSoundTrack.soundCollection[i];sound.useCustomAttenuation && sound.updateDistanceFromListener();}if (scene.soundTracks) for (i = 0; i < scene.soundTracks.length; i++) for (let j = 0; j < scene.soundTracks[i].soundCollection.length; j++) {const sound = scene.soundTracks[i].soundCollection[j];sound.useCustomAttenuation && sound.updateDistanceFromListener();}}}}}}AudioSceneComponent._CameraDirection = new math_vector/* Vector3 */.P(0, 0, -1), sound/* Sound._SceneComponentInitialization */.$._SceneComponentInitialization = (scene) => {let compo = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_AUDIO */.l.NAME_AUDIO);compo || (compo = new AudioSceneComponent(scene), scene._addComponent(compo));};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Audio/weightedsound.js
var weightedsound = __webpack_require__("./node_modules/@babylonjs/core/Audio/weightedsound.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Audio/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/tslib.es6.js
var tslib_es6 = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/decorators.js
var decorators = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/BakedVertexAnimation/bakedVertexAnimationManager.js
class BakedVertexAnimationManager {constructor(scene) {this._texture = null, this._isEnabled = !0, this.isEnabled = !0, this.time = 0, scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;scene && (this._scene = scene, this.animationParameters = new math_vector/* Vector4 */.Lt(0, 0, 0, 30));}_markSubMeshesAsAttributesDirty() {for (const mesh of this._scene.meshes) mesh.bakedVertexAnimationManager === this && mesh._markSubMeshesAsAttributesDirty();}bind(effect, useInstances = !1) {if (this._texture && this._isEnabled) {const size = this._texture.getSize();effect.setFloat2("bakedVertexAnimationTextureSizeInverted", 1 / size.width, 1 / size.height), effect.setFloat("bakedVertexAnimationTime", this.time), useInstances || effect.setVector4("bakedVertexAnimationSettings", this.animationParameters), effect.setTexture("bakedVertexAnimationTexture", this._texture);}}clone() {const copy = new BakedVertexAnimationManager(this._scene);return this.copyTo(copy), copy;}setAnimationParameters(startFrame, endFrame, offset = 0, speedFramesPerSecond = 30) {this.animationParameters = new math_vector/* Vector4 */.Lt(startFrame, endFrame, offset, speedFramesPerSecond);}dispose(forceDisposeTextures) {var _a;forceDisposeTextures && (null === (_a = this._texture) || void 0 === _a ? void 0 : _a.dispose());}getClassName() {return "BakedVertexAnimationManager";}copyTo(vatMap) {decorators/* SerializationHelper.Clone */.p4.Clone(() => vatMap, this);}serialize() {return decorators/* SerializationHelper.Serialize */.p4.Serialize(this);}parse(source, scene, rootUrl) {decorators/* SerializationHelper.Parse */.p4.Parse(() => this, source, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markSubMeshesAsAttributesDirty")], BakedVertexAnimationManager.prototype, "texture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markSubMeshesAsAttributesDirty")], BakedVertexAnimationManager.prototype, "isEnabled", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BakedVertexAnimationManager.prototype, "animationParameters", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BakedVertexAnimationManager.prototype, "time", void 0);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/rawTexture.js
var rawTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/rawTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/texture.js
var Textures_texture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/texture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/stringTools.js
var stringTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/stringTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/BakedVertexAnimation/vertexAnimationBaker.js
class VertexAnimationBaker {constructor(scene, mesh) {this._scene = scene, this._mesh = mesh;}async bakeVertexData(ranges) {if (!this._mesh.skeleton) throw new Error("No skeleton in this mesh.");const boneCount = this._mesh.skeleton.bones.length,frameCount = ranges.reduce((previous, current) => previous + current.to - current.from + 1, 0);if (isNaN(frameCount)) throw new Error("Invalid animation ranges.");let textureIndex = 0;const vertexData = new Float32Array(4 * (4 * (boneCount + 1)) * frameCount);this._scene.stopAnimation(this._mesh), this._mesh.skeleton.returnToRest();for (const range of ranges) for (let frameIndex = range.from; frameIndex <= range.to; frameIndex++) await this._executeAnimationFrame(vertexData, frameIndex, textureIndex++);return vertexData;}async _executeAnimationFrame(vertexData, frameIndex, textureIndex) {return new Promise((resolve) => {this._scene.beginAnimation(this._mesh.skeleton, frameIndex, frameIndex, !1, 1, () => {const skeletonMatrices = this._mesh.skeleton.getTransformMatrices(this._mesh);vertexData.set(skeletonMatrices, textureIndex * skeletonMatrices.length), resolve();});});}textureFromBakedVertexData(vertexData) {if (!this._mesh.skeleton) throw new Error("No skeleton in this mesh.");const boneCount = this._mesh.skeleton.bones.length,texture = rawTexture/* RawTexture.CreateRGBATexture */.l.CreateRGBATexture(vertexData, 4 * (boneCount + 1), vertexData.length / (4 * (4 * (boneCount + 1))), this._scene, !1, !1, Textures_texture/* Texture.NEAREST_NEAREST */.x.NEAREST_NEAREST, 1);return texture.name = "VAT" + this._mesh.skeleton.name, texture;}serializeBakedVertexDataToObject(vertexData) {if (!this._mesh.skeleton) throw new Error("No skeleton in this mesh.");const boneCount = this._mesh.skeleton.bones.length,height = vertexData.length / (4 * (4 * (boneCount + 1))),data = { vertexData: (0,stringTools/* EncodeArrayBufferToBase64 */.Gh)(vertexData), width: 4 * (boneCount + 1), height };return data;}loadBakedVertexDataFromObject(data) {return new Float32Array((0,stringTools/* DecodeBase64ToBinary */.HQ)(data.vertexData));}serializeBakedVertexDataToJSON(vertexData) {return JSON.stringify(this.serializeBakedVertexDataToObject(vertexData));}loadBakedVertexDataFromJSON(json) {return this.loadBakedVertexDataFromObject(JSON.parse(json));}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/BakedVertexAnimation/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/behavior.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/pointerEvents.js
var pointerEvents = __webpack_require__("./node_modules/@babylonjs/core/Events/pointerEvents.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.constants.js
var math_constants = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.constants.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Cameras/autoRotationBehavior.js
class AutoRotationBehavior {constructor() {this._zoomStopsAnimation = !1, this._idleRotationSpeed = .05, this._idleRotationWaitTime = 2e3, this._idleRotationSpinupTime = 2e3, this.targetAlpha = null, this._isPointerDown = !1, this._lastFrameTime = null, this._lastInteractionTime = -Infinity, this._cameraRotationSpeed = 0, this._lastFrameRadius = 0;}get name() {return "AutoRotation";}set zoomStopsAnimation(flag) {this._zoomStopsAnimation = flag;}get zoomStopsAnimation() {return this._zoomStopsAnimation;}set idleRotationSpeed(speed) {this._idleRotationSpeed = speed;}get idleRotationSpeed() {return this._idleRotationSpeed;}set idleRotationWaitTime(time) {this._idleRotationWaitTime = time;}get idleRotationWaitTime() {return this._idleRotationWaitTime;}set idleRotationSpinupTime(time) {this._idleRotationSpinupTime = time;}get idleRotationSpinupTime() {return this._idleRotationSpinupTime;}get rotationInProgress() {return 0 < Math.abs(this._cameraRotationSpeed);}init() {}attach(camera) {this._attachedCamera = camera;const scene = this._attachedCamera.getScene();this._onPrePointerObservableObserver = scene.onPrePointerObservable.add((pointerInfoPre) => pointerInfoPre.type === pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN ? void (this._isPointerDown = !0) : void (pointerInfoPre.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP && (this._isPointerDown = !1))), this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(() => {if (this._reachTargetAlpha()) return;const now = precisionDate/* PrecisionDate.Now */.F.Now;let dt = 0;null != this._lastFrameTime && (dt = now - this._lastFrameTime), this._lastFrameTime = now, this._applyUserInteraction();const timeToRotation = now - this._lastInteractionTime - this._idleRotationWaitTime,scale = Math.max(Math.min(timeToRotation / this._idleRotationSpinupTime, 1), 0);this._cameraRotationSpeed = this._idleRotationSpeed * scale, this._attachedCamera && (this._attachedCamera.alpha -= this._cameraRotationSpeed * (dt / 1e3));});}detach() {if (this._attachedCamera) {const scene = this._attachedCamera.getScene();this._onPrePointerObservableObserver && scene.onPrePointerObservable.remove(this._onPrePointerObservableObserver), this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._attachedCamera = null;}}resetLastInteractionTime(customTime) {this._lastInteractionTime = null !== customTime && void 0 !== customTime ? customTime : precisionDate/* PrecisionDate.Now */.F.Now;}_reachTargetAlpha() {return !!(this._attachedCamera && this.targetAlpha) && Math.abs(this._attachedCamera.alpha - this.targetAlpha) < math_constants/* Epsilon */.kn;}_userIsZooming() {return !!this._attachedCamera && 0 !== this._attachedCamera.inertialRadiusOffset;}_shouldAnimationStopForInteraction() {if (!this._attachedCamera) return !1;let zoomHasHitLimit = !1;return this._lastFrameRadius === this._attachedCamera.radius && 0 !== this._attachedCamera.inertialRadiusOffset && (zoomHasHitLimit = !0), this._lastFrameRadius = this._attachedCamera.radius, this._zoomStopsAnimation ? zoomHasHitLimit : this._userIsZooming();}_applyUserInteraction() {this._userIsMoving() && !this._shouldAnimationStopForInteraction() && (this._lastInteractionTime = precisionDate/* PrecisionDate.Now */.F.Now);}_userIsMoving() {return !!this._attachedCamera && (0 !== this._attachedCamera.inertialAlphaOffset || 0 !== this._attachedCamera.inertialBetaOffset || 0 !== this._attachedCamera.inertialRadiusOffset || 0 !== this._attachedCamera.inertialPanningX || 0 !== this._attachedCamera.inertialPanningY || this._isPointerDown);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Cameras/bouncingBehavior.js
class BouncingBehavior {constructor() {this.transitionDuration = 450, this.lowerRadiusTransitionRange = 2, this.upperRadiusTransitionRange = -2, this._autoTransitionRange = !1, this._radiusIsAnimating = !1, this._radiusBounceTransition = null, this._animatables = [];}get name() {return "Bouncing";}get autoTransitionRange() {return this._autoTransitionRange;}set autoTransitionRange(value) {if (this._autoTransitionRange !== value) {this._autoTransitionRange = value;const camera = this._attachedCamera;camera && (value ? this._onMeshTargetChangedObserver = camera.onMeshTargetChangedObservable.add((mesh) => {if (mesh) {mesh.computeWorldMatrix(!0);const diagonal = mesh.getBoundingInfo().diagonalLength;this.lowerRadiusTransitionRange = .05 * diagonal, this.upperRadiusTransitionRange = .05 * diagonal;}}) : this._onMeshTargetChangedObserver && camera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver));}}init() {}attach(camera) {this._attachedCamera = camera, this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(() => {this._attachedCamera && (this._isRadiusAtLimit(this._attachedCamera.lowerRadiusLimit) && this._applyBoundRadiusAnimation(this.lowerRadiusTransitionRange), this._isRadiusAtLimit(this._attachedCamera.upperRadiusLimit) && this._applyBoundRadiusAnimation(this.upperRadiusTransitionRange));});}detach() {this._attachedCamera && (this._onAfterCheckInputsObserver && this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._onMeshTargetChangedObserver && this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver), this._attachedCamera = null);}_isRadiusAtLimit(radiusLimit) {return !!this._attachedCamera && !(this._attachedCamera.radius !== radiusLimit || this._radiusIsAnimating);}_applyBoundRadiusAnimation(radiusDelta) {if (this._attachedCamera) {this._radiusBounceTransition || (BouncingBehavior.EasingFunction.setEasingMode(BouncingBehavior.EasingMode), this._radiusBounceTransition = Animations_animation/* Animation.CreateAnimation */.f.CreateAnimation("radius", Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, 60, BouncingBehavior.EasingFunction)), this._cachedWheelPrecision = this._attachedCamera.wheelPrecision, this._attachedCamera.wheelPrecision = 1 / 0, this._attachedCamera.inertialRadiusOffset = 0, this.stopAllAnimations(), this._radiusIsAnimating = !0;const animatable = Animations_animation/* Animation.TransitionTo */.f.TransitionTo("radius", this._attachedCamera.radius + radiusDelta, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusBounceTransition, this.transitionDuration, () => this._clearAnimationLocks());animatable && this._animatables.push(animatable);}}_clearAnimationLocks() {this._radiusIsAnimating = !1, this._attachedCamera && (this._attachedCamera.wheelPrecision = this._cachedWheelPrecision);}stopAllAnimations() {for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length;) this._animatables[0].onAnimationEnd = null, this._animatables[0].stop(), this._animatables.shift();}}BouncingBehavior.EasingFunction = new BackEase(.3), BouncingBehavior.EasingMode = EasingFunction.EASINGMODE_EASEOUT;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Cameras/framingBehavior.js
class FramingBehavior {constructor() {this.onTargetFramingAnimationEndObservable = new observable/* Observable */.y$(), this._mode = FramingBehavior.FitFrustumSidesMode, this._radiusScale = 1, this._positionScale = .5, this._defaultElevation = .3, this._elevationReturnTime = 1500, this._elevationReturnWaitTime = 1e3, this._zoomStopsAnimation = !1, this._framingTime = 1500, this.autoCorrectCameraLimitsAndSensibility = !0, this._isPointerDown = !1, this._lastInteractionTime = -Infinity, this._animatables = [], this._betaIsAnimating = !1;}get name() {return "Framing";}set mode(mode) {this._mode = mode;}get mode() {return this._mode;}set radiusScale(radius) {this._radiusScale = radius;}get radiusScale() {return this._radiusScale;}set positionScale(scale) {this._positionScale = scale;}get positionScale() {return this._positionScale;}set defaultElevation(elevation) {this._defaultElevation = elevation;}get defaultElevation() {return this._defaultElevation;}set elevationReturnTime(speed) {this._elevationReturnTime = speed;}get elevationReturnTime() {return this._elevationReturnTime;}set elevationReturnWaitTime(time) {this._elevationReturnWaitTime = time;}get elevationReturnWaitTime() {return this._elevationReturnWaitTime;}set zoomStopsAnimation(flag) {this._zoomStopsAnimation = flag;}get zoomStopsAnimation() {return this._zoomStopsAnimation;}set framingTime(time) {this._framingTime = time;}get framingTime() {return this._framingTime;}init() {}attach(camera) {this._attachedCamera = camera;const scene = this._attachedCamera.getScene();FramingBehavior.EasingFunction.setEasingMode(FramingBehavior.EasingMode), this._onPrePointerObservableObserver = scene.onPrePointerObservable.add((pointerInfoPre) => pointerInfoPre.type === pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN ? void (this._isPointerDown = !0) : void (pointerInfoPre.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP && (this._isPointerDown = !1))), this._onMeshTargetChangedObserver = camera.onMeshTargetChangedObservable.add((mesh) => {mesh && this.zoomOnMesh(mesh, void 0, () => {this.onTargetFramingAnimationEndObservable.notifyObservers();});}), this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(() => {this._applyUserInteraction(), this._maintainCameraAboveGround();});}detach() {if (this._attachedCamera) {const scene = this._attachedCamera.getScene();this._onPrePointerObservableObserver && scene.onPrePointerObservable.remove(this._onPrePointerObservableObserver), this._onAfterCheckInputsObserver && this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._onMeshTargetChangedObserver && this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver), this._attachedCamera = null;}}zoomOnMesh(mesh, focusOnOriginXZ = !1, onAnimationEnd = null) {mesh.computeWorldMatrix(!0);const boundingBox = mesh.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(boundingBox.minimumWorld, boundingBox.maximumWorld, focusOnOriginXZ, onAnimationEnd);}zoomOnMeshHierarchy(mesh, focusOnOriginXZ = !1, onAnimationEnd = null) {mesh.computeWorldMatrix(!0);const boundingBox = mesh.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(boundingBox.min, boundingBox.max, focusOnOriginXZ, onAnimationEnd);}zoomOnMeshesHierarchy(meshes, focusOnOriginXZ = !1, onAnimationEnd = null) {const min = new math_vector/* Vector3 */.P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE),max = new math_vector/* Vector3 */.P(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);for (let i = 0; i < meshes.length; i++) {const boundingInfo = meshes[i].getHierarchyBoundingVectors(!0);math_vector/* Vector3.CheckExtends */.P.CheckExtends(boundingInfo.min, min, max), math_vector/* Vector3.CheckExtends */.P.CheckExtends(boundingInfo.max, min, max);}this.zoomOnBoundingInfo(min, max, focusOnOriginXZ, onAnimationEnd);}zoomOnBoundingInfo(minimumWorld, maximumWorld, focusOnOriginXZ = !1, onAnimationEnd = null) {let zoomTarget;if (!this._attachedCamera) return;const bottom = minimumWorld.y,top = maximumWorld.y,zoomTargetY = bottom + (top - bottom) * this._positionScale,radiusWorld = maximumWorld.subtract(minimumWorld).scale(.5);if (focusOnOriginXZ) zoomTarget = new math_vector/* Vector3 */.P(0, zoomTargetY, 0);else {const centerWorld = minimumWorld.add(radiusWorld);zoomTarget = new math_vector/* Vector3 */.P(centerWorld.x, zoomTargetY, centerWorld.z);}this._vectorTransition || (this._vectorTransition = Animations_animation/* Animation.CreateAnimation */.f.CreateAnimation("target", Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3, 60, FramingBehavior.EasingFunction)), this._betaIsAnimating = !0;let animatable = Animations_animation/* Animation.TransitionTo */.f.TransitionTo("target", zoomTarget, this._attachedCamera, this._attachedCamera.getScene(), 60, this._vectorTransition, this._framingTime);animatable && this._animatables.push(animatable);let radius = 0;if (this._mode === FramingBehavior.FitFrustumSidesMode) {const position = this._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld);this.autoCorrectCameraLimitsAndSensibility && (this._attachedCamera.lowerRadiusLimit = radiusWorld.length() + this._attachedCamera.minZ), radius = position;} else this._mode === FramingBehavior.IgnoreBoundsSizeMode && (radius = this._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld), this.autoCorrectCameraLimitsAndSensibility && null === this._attachedCamera.lowerRadiusLimit && (this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ));if (this.autoCorrectCameraLimitsAndSensibility) {const extend = maximumWorld.subtract(minimumWorld).length();this._attachedCamera.panningSensibility = 5e3 / extend, this._attachedCamera.wheelPrecision = 100 / radius;}this._radiusTransition || (this._radiusTransition = Animations_animation/* Animation.CreateAnimation */.f.CreateAnimation("radius", Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction)), animatable = Animations_animation/* Animation.TransitionTo */.f.TransitionTo("radius", radius, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusTransition, this._framingTime, () => {this.stopAllAnimations(), onAnimationEnd && onAnimationEnd(), this._attachedCamera && this._attachedCamera.useInputToRestoreState && this._attachedCamera.storeState();}), animatable && this._animatables.push(animatable);}_calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld) {const size = maximumWorld.subtract(minimumWorld),boxVectorGlobalDiagonal = size.length(),frustumSlope = this._getFrustumSlope(),radius = .5 * boxVectorGlobalDiagonal * this._radiusScale,distanceForHorizontalFrustum = radius * Math.sqrt(1 + 1 / (frustumSlope.x * frustumSlope.x)),distanceForVerticalFrustum = radius * Math.sqrt(1 + 1 / (frustumSlope.y * frustumSlope.y));let distance = Math.max(distanceForHorizontalFrustum, distanceForVerticalFrustum);const camera = this._attachedCamera;return camera ? (camera.lowerRadiusLimit && this._mode === FramingBehavior.IgnoreBoundsSizeMode && (distance = distance < camera.lowerRadiusLimit ? camera.lowerRadiusLimit : distance), camera.upperRadiusLimit && (distance = distance > camera.upperRadiusLimit ? camera.upperRadiusLimit : distance), distance) : 0;}_maintainCameraAboveGround() {if (0 > this._elevationReturnTime) return;const timeSinceInteraction = precisionDate/* PrecisionDate.Now */.F.Now - this._lastInteractionTime,defaultBeta = .5 * Math.PI - this._defaultElevation,limitBeta = .5 * Math.PI;if (this._attachedCamera && !this._betaIsAnimating && this._attachedCamera.beta > limitBeta && timeSinceInteraction >= this._elevationReturnWaitTime) {this._betaIsAnimating = !0, this.stopAllAnimations(), this._betaTransition || (this._betaTransition = Animations_animation/* Animation.CreateAnimation */.f.CreateAnimation("beta", Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction));const animatabe = Animations_animation/* Animation.TransitionTo */.f.TransitionTo("beta", defaultBeta, this._attachedCamera, this._attachedCamera.getScene(), 60, this._betaTransition, this._elevationReturnTime, () => {this._clearAnimationLocks(), this.stopAllAnimations();});animatabe && this._animatables.push(animatabe);}}_getFrustumSlope() {const camera = this._attachedCamera;if (!camera) return math_vector/* Vector2.Zero */.FM.Zero();const engine = camera.getScene().getEngine(),aspectRatio = engine.getAspectRatio(camera),frustumSlopeY = Math.tan(camera.fov / 2);return new math_vector/* Vector2 */.FM(frustumSlopeY * aspectRatio, frustumSlopeY);}_clearAnimationLocks() {this._betaIsAnimating = !1;}_applyUserInteraction() {this.isUserIsMoving && (this._lastInteractionTime = precisionDate/* PrecisionDate.Now */.F.Now, this.stopAllAnimations(), this._clearAnimationLocks());}stopAllAnimations() {for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length;) this._animatables[0] && (this._animatables[0].onAnimationEnd = null, this._animatables[0].stop()), this._animatables.shift();}get isUserIsMoving() {return !!this._attachedCamera && (0 !== this._attachedCamera.inertialAlphaOffset || 0 !== this._attachedCamera.inertialBetaOffset || 0 !== this._attachedCamera.inertialRadiusOffset || 0 !== this._attachedCamera.inertialPanningX || 0 !== this._attachedCamera.inertialPanningY || this._isPointerDown);}}FramingBehavior.EasingFunction = new ExponentialEase(), FramingBehavior.EasingMode = EasingFunction.EASINGMODE_EASEINOUT, FramingBehavior.IgnoreBoundsSizeMode = 0, FramingBehavior.FitFrustumSidesMode = 1;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Cameras/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/attachToBoxBehavior.js
class FaceDirectionInfo {constructor(direction, rotatedDirection = new math_vector/* Vector3 */.P(), diff = 0, ignore = !1) {this.direction = direction, this.rotatedDirection = rotatedDirection, this.diff = diff, this.ignore = ignore;}}class AttachToBoxBehavior {constructor(_ui) {this._ui = _ui, this.name = "AttachToBoxBehavior", this.distanceAwayFromFace = .15, this.distanceAwayFromBottomOfFace = .15, this._faceVectors = [new FaceDirectionInfo(math_vector/* Vector3.Up */.P.Up()), new FaceDirectionInfo(math_vector/* Vector3.Down */.P.Down()), new FaceDirectionInfo(math_vector/* Vector3.Left */.P.Left()), new FaceDirectionInfo(math_vector/* Vector3.Right */.P.Right()), new FaceDirectionInfo(math_vector/* Vector3.Forward */.P.Forward()), new FaceDirectionInfo(math_vector/* Vector3.Forward */.P.Forward().scaleInPlace(-1))], this._tmpMatrix = new math_vector/* Matrix */.y3(), this._tmpVector = new math_vector/* Vector3 */.P(), this._zeroVector = math_vector/* Vector3.Zero */.P.Zero(), this._lookAtTmpMatrix = new math_vector/* Matrix */.y3();}init() {}_closestFace(targetDirection) {return this._faceVectors.forEach((v) => {this._target.rotationQuaternion || (this._target.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this._target.rotation.y, this._target.rotation.x, this._target.rotation.z)), this._target.rotationQuaternion.toRotationMatrix(this._tmpMatrix), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(v.direction, this._tmpMatrix, v.rotatedDirection), v.diff = math_vector/* Vector3.GetAngleBetweenVectors */.P.GetAngleBetweenVectors(v.rotatedDirection, targetDirection, math_vector/* Vector3.Cross */.P.Cross(v.rotatedDirection, targetDirection));}), this._faceVectors.reduce((min, p) => min.ignore ? p : p.ignore ? min : min.diff < p.diff ? min : p, this._faceVectors[0]);}_lookAtToRef(pos, up = new math_vector/* Vector3 */.P(0, 1, 0), ref) {math_vector/* Matrix.LookAtLHToRef */.y3.LookAtLHToRef(this._zeroVector, pos, up, this._lookAtTmpMatrix), this._lookAtTmpMatrix.invert(), math_vector/* Quaternion.FromRotationMatrixToRef */._f.FromRotationMatrixToRef(this._lookAtTmpMatrix, ref);}attach(target) {this._target = target, this._scene = this._target.getScene(), this._onRenderObserver = this._scene.onBeforeRenderObservable.add(() => {if (!this._scene.activeCamera) return;let cameraPos = this._scene.activeCamera.position;this._scene.activeCamera.devicePosition && (cameraPos = this._scene.activeCamera.devicePosition);const facing = this._closestFace(cameraPos.subtract(target.position));this._scene.activeCamera.leftCamera ? this._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix) : this._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(math_vector/* Vector3.Up */.P.Up(), this._tmpMatrix, this._tmpVector), this._faceVectors.forEach((v) => {facing.direction.x && v.direction.x && (v.ignore = !0), facing.direction.y && v.direction.y && (v.ignore = !0), facing.direction.z && v.direction.z && (v.ignore = !0);});const facingUp = this._closestFace(this._tmpVector);this._faceVectors.forEach((v) => {v.ignore = !1;}), this._ui.position.copyFrom(target.position), facing.direction.x && (facing.rotatedDirection.scaleToRef(target.scaling.x / 2 + this.distanceAwayFromFace, this._tmpVector), this._ui.position.addInPlace(this._tmpVector)), facing.direction.y && (facing.rotatedDirection.scaleToRef(target.scaling.y / 2 + this.distanceAwayFromFace, this._tmpVector), this._ui.position.addInPlace(this._tmpVector)), facing.direction.z && (facing.rotatedDirection.scaleToRef(target.scaling.z / 2 + this.distanceAwayFromFace, this._tmpVector), this._ui.position.addInPlace(this._tmpVector)), this._ui.rotationQuaternion || (this._ui.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this._ui.rotation.y, this._ui.rotation.x, this._ui.rotation.z)), facing.rotatedDirection.scaleToRef(-1, this._tmpVector), this._lookAtToRef(this._tmpVector, facingUp.rotatedDirection, this._ui.rotationQuaternion), facingUp.direction.x && this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - target.scaling.x / 2, this._tmpVector), facingUp.direction.y && this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - target.scaling.y / 2, this._tmpVector), facingUp.direction.z && this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - target.scaling.z / 2, this._tmpVector), this._ui.position.addInPlace(this._tmpVector);});}detach() {this._scene.onBeforeRenderObservable.remove(this._onRenderObserver);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/fadeInOutBehavior.js
class FadeInOutBehavior {get delay() {return this.fadeInDelay;}set delay(value) {this.fadeInDelay = value, this.fadeOutDelay = value;}constructor() {this.fadeInDelay = 0, this.fadeOutDelay = 0, this.fadeInTime = 300, this.fadeOutTime = 300, this._millisecondsPerFrame = 1e3 / 60, this._hovered = !1, this._hoverValue = 0, this._ownerNode = null, this._delay = 0, this._time = 300, this._update = () => {if (this._ownerNode) {if (this._hoverValue += this._hovered ? this._millisecondsPerFrame : -this._millisecondsPerFrame, this._setAllVisibility(this._ownerNode, (this._hoverValue - this._delay) / this._time), 1 < this._ownerNode.visibility) {if (this._setAllVisibility(this._ownerNode, 1), this._hoverValue > this._time) return this._hoverValue = this._time, void this._detachObserver();} else if (0 > this._ownerNode.visibility && (this._setAllVisibility(this._ownerNode, 0), 0 > this._hoverValue)) return this._hoverValue = 0, void this._detachObserver();this._attachObserver();}};}get name() {return "FadeInOut";}init() {}attach(ownerNode) {this._ownerNode = ownerNode, this._setAllVisibility(this._ownerNode, 0);}detach() {this._ownerNode = null;}fadeIn(fadeIn = !0) {this._delay = fadeIn ? this.fadeInDelay : this.fadeOutDelay, this._time = fadeIn ? this.fadeInTime : this.fadeOutTime, this._detachObserver();this._ownerNode && (fadeIn && 1 <= this._ownerNode.visibility || !fadeIn && 0 >= this._ownerNode.visibility) || (this._hovered = fadeIn, !this._hovered && (this._delay *= -1), 1 <= this._ownerNode.visibility ? this._hoverValue = this._time : 0 >= this._ownerNode.visibility && (this._hoverValue = 0), this._update());}fadeOut() {this.fadeIn(!1);}_setAllVisibility(mesh, value) {mesh.visibility = value, mesh.getChildMeshes().forEach((c) => {this._setAllVisibility(c, value);});}_attachObserver() {var _a;this._onBeforeRenderObserver || (this._onBeforeRenderObserver = null === (_a = this._ownerNode) || void 0 === _a ? void 0 : _a.getScene().onBeforeRenderObservable.add(this._update));}_detachObserver() {var _a;this._onBeforeRenderObserver && (null === (_a = this._ownerNode) || void 0 === _a ? void 0 : _a.getScene().onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = null);}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/mesh.js
var Meshes_mesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/arrayTools.js
var arrayTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/arrayTools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Collisions/pickingInfo.js
var Collisions_pickingInfo = __webpack_require__("./node_modules/@babylonjs/core/Collisions/pickingInfo.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Collisions/intersectionInfo.js
var intersectionInfo = __webpack_require__("./node_modules/@babylonjs/core/Collisions/intersectionInfo.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/camera.js
var Cameras_camera = __webpack_require__("./node_modules/@babylonjs/core/Cameras/camera.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Culling/ray.js
class Ray {constructor(origin, direction, length = Number.MAX_VALUE) {this.origin = origin, this.direction = direction, this.length = length;}clone() {return new Ray(this.origin.clone(), this.direction.clone(), this.length);}intersectsBoxMinMax(minimum, maximum, intersectionTreshold = 0) {const newMinimum = Ray._TmpVector3[0].copyFromFloats(minimum.x - intersectionTreshold, minimum.y - intersectionTreshold, minimum.z - intersectionTreshold),newMaximum = Ray._TmpVector3[1].copyFromFloats(maximum.x + intersectionTreshold, maximum.y + intersectionTreshold, maximum.z + intersectionTreshold);let inv,min,max,temp,d = 0,maxValue = Number.MAX_VALUE;if (1e-7 > Math.abs(this.direction.x)) {if (this.origin.x < newMinimum.x || this.origin.x > newMaximum.x) return !1;} else if (inv = 1 / this.direction.x, min = (newMinimum.x - this.origin.x) * inv, max = (newMaximum.x - this.origin.x) * inv, max === -Infinity && (max = 1 / 0), min > max && (temp = min, min = max, max = temp), d = Math.max(min, d), maxValue = Math.min(max, maxValue), d > maxValue) return !1;if (1e-7 > Math.abs(this.direction.y)) {if (this.origin.y < newMinimum.y || this.origin.y > newMaximum.y) return !1;} else if (inv = 1 / this.direction.y, min = (newMinimum.y - this.origin.y) * inv, max = (newMaximum.y - this.origin.y) * inv, max === -Infinity && (max = 1 / 0), min > max && (temp = min, min = max, max = temp), d = Math.max(min, d), maxValue = Math.min(max, maxValue), d > maxValue) return !1;if (1e-7 > Math.abs(this.direction.z)) {if (this.origin.z < newMinimum.z || this.origin.z > newMaximum.z) return !1;} else if (inv = 1 / this.direction.z, min = (newMinimum.z - this.origin.z) * inv, max = (newMaximum.z - this.origin.z) * inv, max === -Infinity && (max = 1 / 0), min > max && (temp = min, min = max, max = temp), d = Math.max(min, d), maxValue = Math.min(max, maxValue), d > maxValue) return !1;return !0;}intersectsBox(box, intersectionTreshold = 0) {return this.intersectsBoxMinMax(box.minimum, box.maximum, intersectionTreshold);}intersectsSphere(sphere, intersectionTreshold = 0) {const x = sphere.center.x - this.origin.x,y = sphere.center.y - this.origin.y,z = sphere.center.z - this.origin.z,pyth = x * x + y * y + z * z,radius = sphere.radius + intersectionTreshold,rr = radius * radius;if (pyth <= rr) return !0;const dot = x * this.direction.x + y * this.direction.y + z * this.direction.z;if (0 > dot) return !1;return pyth - dot * dot <= rr;}intersectsTriangle(vertex0, vertex1, vertex2) {const edge1 = Ray._TmpVector3[0],edge2 = Ray._TmpVector3[1],pvec = Ray._TmpVector3[2],tvec = Ray._TmpVector3[3],qvec = Ray._TmpVector3[4];vertex1.subtractToRef(vertex0, edge1), vertex2.subtractToRef(vertex0, edge2), math_vector/* Vector3.CrossToRef */.P.CrossToRef(this.direction, edge2, pvec);const det = math_vector/* Vector3.Dot */.P.Dot(edge1, pvec);if (0 === det) return null;const invdet = 1 / det;this.origin.subtractToRef(vertex0, tvec);const bv = math_vector/* Vector3.Dot */.P.Dot(tvec, pvec) * invdet;if (0 > bv || 1 < bv) return null;math_vector/* Vector3.CrossToRef */.P.CrossToRef(tvec, edge1, qvec);const bw = math_vector/* Vector3.Dot */.P.Dot(this.direction, qvec) * invdet;if (0 > bw || 1 < bv + bw) return null;const distance = math_vector/* Vector3.Dot */.P.Dot(edge2, qvec) * invdet;return distance > this.length ? null : new intersectionInfo/* IntersectionInfo */.c(1 - bv - bw, bv, distance);}intersectsPlane(plane) {let distance;const result1 = math_vector/* Vector3.Dot */.P.Dot(plane.normal, this.direction);if (9.99999997475243e-7 > Math.abs(result1)) return null;else {const result2 = math_vector/* Vector3.Dot */.P.Dot(plane.normal, this.origin);return distance = (-plane.d - result2) / result1, 0 > distance ? -9.99999997475243e-7 > distance ? null : 0 : distance;}}intersectsAxis(axis, offset = 0) {switch (axis) {case "y":{const t = (this.origin.y - offset) / this.direction.y;return 0 < t ? null : new math_vector/* Vector3 */.P(this.origin.x + this.direction.x * -t, offset, this.origin.z + this.direction.z * -t);}case "x":{const t = (this.origin.x - offset) / this.direction.x;return 0 < t ? null : new math_vector/* Vector3 */.P(offset, this.origin.y + this.direction.y * -t, this.origin.z + this.direction.z * -t);}case "z":{const t = (this.origin.z - offset) / this.direction.z;return 0 < t ? null : new math_vector/* Vector3 */.P(this.origin.x + this.direction.x * -t, this.origin.y + this.direction.y * -t, offset);}default:return null;}}intersectsMesh(mesh, fastCheck) {const tm = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];return mesh.getWorldMatrix().invertToRef(tm), this._tmpRay ? Ray.TransformToRef(this, tm, this._tmpRay) : this._tmpRay = Ray.Transform(this, tm), mesh.intersects(this._tmpRay, fastCheck);}intersectsMeshes(meshes, fastCheck, results) {results ? results.length = 0 : results = [];for (let i = 0; i < meshes.length; i++) {const pickInfo = this.intersectsMesh(meshes[i], fastCheck);pickInfo.hit && results.push(pickInfo);}return results.sort(this._comparePickingInfo), results;}_comparePickingInfo(pickingInfoA, pickingInfoB) {return pickingInfoA.distance < pickingInfoB.distance ? -1 : pickingInfoA.distance > pickingInfoB.distance ? 1 : 0;}intersectionSegment(sega, segb, threshold) {const o = this.origin,u = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],rsegb = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1],v = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],w = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3];segb.subtractToRef(sega, u), this.direction.scaleToRef(Ray._Rayl, v), o.addToRef(v, rsegb), sega.subtractToRef(o, w);const a = math_vector/* Vector3.Dot */.P.Dot(u, u),b = math_vector/* Vector3.Dot */.P.Dot(u, v),c = math_vector/* Vector3.Dot */.P.Dot(v, v),d = math_vector/* Vector3.Dot */.P.Dot(u, w),e = math_vector/* Vector3.Dot */.P.Dot(v, w),D = a * c - b * b;let sN,tN,sD = D,tD = D;D < Ray._Smallnum ? (sN = 0, sD = 1, tN = e, tD = c) : (sN = b * e - c * d, tN = a * e - b * d, 0 > sN ? (sN = 0, tN = e, tD = c) : sN > sD && (sN = sD, tN = e + b, tD = c)), 0 > tN ? (tN = 0, 0 > -d ? sN = 0 : -d > a ? sN = sD : (sN = -d, sD = a)) : tN > tD && (tN = tD, 0 > -d + b ? sN = 0 : -d + b > a ? sN = sD : (sN = -d + b, sD = a));const sc = Math.abs(sN) < Ray._Smallnum ? 0 : sN / sD,tc = Math.abs(tN) < Ray._Smallnum ? 0 : tN / tD,qtc = math_vector/* TmpVectors.Vector3.4 */.jp.Vector3[4];v.scaleToRef(tc, qtc);const qsc = math_vector/* TmpVectors.Vector3.5 */.jp.Vector3[5];u.scaleToRef(sc, qsc), qsc.addInPlace(w);const dP = math_vector/* TmpVectors.Vector3.6 */.jp.Vector3[6];qsc.subtractToRef(qtc, dP);const isIntersected = 0 < tc && tc <= this.length && dP.lengthSquared() < threshold * threshold;return isIntersected ? qsc.length() : -1;}update(x, y, viewportWidth, viewportHeight, world, view, projection, enableDistantPicking = !1) {if (enableDistantPicking) {Ray._RayDistant || (Ray._RayDistant = Ray.Zero()), Ray._RayDistant.unprojectRayToRef(x, y, viewportWidth, viewportHeight, math_vector/* Matrix.IdentityReadOnly */.y3.IdentityReadOnly, view, projection);const tm = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];world.invertToRef(tm), Ray.TransformToRef(Ray._RayDistant, tm, this);} else this.unprojectRayToRef(x, y, viewportWidth, viewportHeight, world, view, projection);return this;}static Zero() {return new Ray(math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero());}static CreateNew(x, y, viewportWidth, viewportHeight, world, view, projection) {const result = Ray.Zero();return result.update(x, y, viewportWidth, viewportHeight, world, view, projection);}static CreateNewFromTo(origin, end, world = math_vector/* Matrix.IdentityReadOnly */.y3.IdentityReadOnly) {const direction = end.subtract(origin),length = Math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z);return direction.normalize(), Ray.Transform(new Ray(origin, direction, length), world);}static Transform(ray, matrix) {const result = new Ray(new math_vector/* Vector3 */.P(0, 0, 0), new math_vector/* Vector3 */.P(0, 0, 0));return Ray.TransformToRef(ray, matrix, result), result;}static TransformToRef(ray, matrix, result) {math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(ray.origin, matrix, result.origin), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(ray.direction, matrix, result.direction), result.length = ray.length;const dir = result.direction,len = dir.length();if (0 !== len && 1 !== len) {const num = 1 / len;dir.x *= num, dir.y *= num, dir.z *= num, result.length *= len;}}unprojectRayToRef(sourceX, sourceY, viewportWidth, viewportHeight, world, view, projection) {var _a;const matrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];world.multiplyToRef(view, matrix), matrix.multiplyToRef(projection, matrix), matrix.invert();const nearScreenSource = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];nearScreenSource.x = 2 * (sourceX / viewportWidth) - 1, nearScreenSource.y = -(2 * (sourceY / viewportHeight) - 1), nearScreenSource.z = (null === (_a = engineStore/* EngineStore.LastCreatedEngine */.l.LastCreatedEngine) || void 0 === _a ? void 0 : _a.isNDCHalfZRange) ? 0 : -1;const farScreenSource = math_vector/* TmpVectors.Vector3.1.copyFromFloats */.jp.Vector3[1].copyFromFloats(nearScreenSource.x, nearScreenSource.y, 1 - 1e-8),nearVec3 = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],farVec3 = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3];math_vector/* Vector3._UnprojectFromInvertedMatrixToRef */.P._UnprojectFromInvertedMatrixToRef(nearScreenSource, matrix, nearVec3), math_vector/* Vector3._UnprojectFromInvertedMatrixToRef */.P._UnprojectFromInvertedMatrixToRef(farScreenSource, matrix, farVec3), this.origin.copyFrom(nearVec3), farVec3.subtractToRef(nearVec3, this.direction), this.direction.normalize();}}Ray._TmpVector3 = arrayTools/* ArrayTools.BuildArray */.B.BuildArray(6, math_vector/* Vector3.Zero */.P.Zero), Ray._RayDistant = Ray.Zero(), Ray._Smallnum = 1e-8, Ray._Rayl = 1e9, core_scene/* Scene.prototype.createPickingRay */.x.prototype.createPickingRay = function (x, y, world, camera, cameraViewSpace = !1) {const result = Ray.Zero();return this.createPickingRayToRef(x, y, world, result, camera, cameraViewSpace), result;}, core_scene/* Scene.prototype.createPickingRayToRef */.x.prototype.createPickingRayToRef = function (x, y, world, result, camera, cameraViewSpace = !1, enableDistantPicking = !1) {const engine = this.getEngine();if (!camera) {if (!this.activeCamera) return this;camera = this.activeCamera;}const cameraViewport = camera.viewport,viewport = cameraViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight());return x = x / engine.getHardwareScalingLevel() - viewport.x, y = y / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - viewport.y - viewport.height), result.update(x, y, viewport.width, viewport.height, world ? world : math_vector/* Matrix.IdentityReadOnly */.y3.IdentityReadOnly, cameraViewSpace ? math_vector/* Matrix.IdentityReadOnly */.y3.IdentityReadOnly : camera.getViewMatrix(), camera.getProjectionMatrix(), enableDistantPicking), this;}, core_scene/* Scene.prototype.createPickingRayInCameraSpace */.x.prototype.createPickingRayInCameraSpace = function (x, y, camera) {const result = Ray.Zero();return this.createPickingRayInCameraSpaceToRef(x, y, result, camera), result;}, core_scene/* Scene.prototype.createPickingRayInCameraSpaceToRef */.x.prototype.createPickingRayInCameraSpaceToRef = function (x, y, result, camera) {if (!Collisions_pickingInfo/* PickingInfo */.p) return this;const engine = this.getEngine();if (!camera) {if (!this.activeCamera) throw new Error("Active camera not set");camera = this.activeCamera;}const cameraViewport = camera.viewport,viewport = cameraViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight()),identity = math_vector/* Matrix.Identity */.y3.Identity();return x = x / engine.getHardwareScalingLevel() - viewport.x, y = y / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - viewport.y - viewport.height), result.update(x, y, viewport.width, viewport.height, identity, identity, camera.getProjectionMatrix()), this;}, core_scene/* Scene.prototype._internalPickForMesh */.x.prototype._internalPickForMesh = function (pickingInfo, rayFunction, mesh, world, fastCheck, onlyBoundingInfo, trianglePredicate, skipBoundingInfo) {const ray = rayFunction(world, mesh.enableDistantPicking),result = mesh.intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo, world, skipBoundingInfo);return result && result.hit ? !fastCheck && null != pickingInfo && result.distance >= pickingInfo.distance ? null : result : null;}, core_scene/* Scene.prototype._internalPick */.x.prototype._internalPick = function (rayFunction, predicate, fastCheck, onlyBoundingInfo, trianglePredicate) {let pickingInfo = null;const computeWorldMatrixForCamera = !!(this.activeCameras && 1 < this.activeCameras.length && this.cameraToUseForPointers !== this.activeCamera),currentCamera = this.cameraToUseForPointers || this.activeCamera;for (let meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) {const mesh = this.meshes[meshIndex];if (predicate) {if (!predicate(mesh)) continue;} else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) continue;const forceCompute = computeWorldMatrixForCamera && mesh.isWorldMatrixCameraDependent(),world = mesh.computeWorldMatrix(forceCompute, currentCamera);if (mesh.hasThinInstances && mesh.thinInstanceEnablePicking) {const result = this._internalPickForMesh(pickingInfo, rayFunction, mesh, world, !0, !0, trianglePredicate);if (result) {if (onlyBoundingInfo) return result;const tmpMatrix = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1],thinMatrices = mesh.thinInstanceGetWorldMatrices();for (let index = 0; index < thinMatrices.length; index++) {const thinMatrix = thinMatrices[index];thinMatrix.multiplyToRef(world, tmpMatrix);const result = this._internalPickForMesh(pickingInfo, rayFunction, mesh, tmpMatrix, fastCheck, onlyBoundingInfo, trianglePredicate, !0);if (result && (pickingInfo = result, pickingInfo.thinInstanceIndex = index, fastCheck)) return pickingInfo;}}} else {const result = this._internalPickForMesh(pickingInfo, rayFunction, mesh, world, fastCheck, onlyBoundingInfo, trianglePredicate);if (result && (pickingInfo = result, fastCheck)) return pickingInfo;}}return pickingInfo || new Collisions_pickingInfo/* PickingInfo */.p();}, core_scene/* Scene.prototype._internalMultiPick */.x.prototype._internalMultiPick = function (rayFunction, predicate, trianglePredicate) {if (!Collisions_pickingInfo/* PickingInfo */.p) return null;const pickingInfos = [],computeWorldMatrixForCamera = !!(this.activeCameras && 1 < this.activeCameras.length && this.cameraToUseForPointers !== this.activeCamera),currentCamera = this.cameraToUseForPointers || this.activeCamera;for (let meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) {const mesh = this.meshes[meshIndex];if (predicate) {if (!predicate(mesh)) continue;} else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) continue;const forceCompute = computeWorldMatrixForCamera && mesh.isWorldMatrixCameraDependent(),world = mesh.computeWorldMatrix(forceCompute, currentCamera);if (mesh.hasThinInstances && mesh.thinInstanceEnablePicking) {const result = this._internalPickForMesh(null, rayFunction, mesh, world, !0, !0, trianglePredicate);if (result) {const tmpMatrix = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1],thinMatrices = mesh.thinInstanceGetWorldMatrices();for (let index = 0; index < thinMatrices.length; index++) {const thinMatrix = thinMatrices[index];thinMatrix.multiplyToRef(world, tmpMatrix);const result = this._internalPickForMesh(null, rayFunction, mesh, tmpMatrix, !1, !1, trianglePredicate, !0);result && (result.thinInstanceIndex = index, pickingInfos.push(result));}}} else {const result = this._internalPickForMesh(null, rayFunction, mesh, world, !1, !1, trianglePredicate);result && pickingInfos.push(result);}}return pickingInfos;}, core_scene/* Scene.prototype.pickWithBoundingInfo */.x.prototype.pickWithBoundingInfo = function (x, y, predicate, fastCheck, camera) {if (!Collisions_pickingInfo/* PickingInfo */.p) return null;const result = this._internalPick((world) => (this._tempPickingRay || (this._tempPickingRay = Ray.Zero()), this.createPickingRayToRef(x, y, world, this._tempPickingRay, camera || null), this._tempPickingRay), predicate, fastCheck, !0);return result && (result.ray = this.createPickingRay(x, y, math_vector/* Matrix.Identity */.y3.Identity(), camera || null)), result;}, Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "_pickingAvailable", { get: () => !0, enumerable: !1, configurable: !1 }), core_scene/* Scene.prototype.pick */.x.prototype.pick = function (x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking = !1) {const result = this._internalPick((world, enableDistantPicking) => (this._tempPickingRay || (this._tempPickingRay = Ray.Zero()), this.createPickingRayToRef(x, y, world, this._tempPickingRay, camera || null, !1, enableDistantPicking), this._tempPickingRay), predicate, fastCheck, !1, trianglePredicate);return result && (result.ray = this.createPickingRay(x, y, math_vector/* Matrix.Identity */.y3.Identity(), camera || null)), result;}, core_scene/* Scene.prototype.pickWithRay */.x.prototype.pickWithRay = function (ray, predicate, fastCheck, trianglePredicate) {const result = this._internalPick((world) => (this._pickWithRayInverseMatrix || (this._pickWithRayInverseMatrix = math_vector/* Matrix.Identity */.y3.Identity()), world.invertToRef(this._pickWithRayInverseMatrix), this._cachedRayForTransform || (this._cachedRayForTransform = Ray.Zero()), Ray.TransformToRef(ray, this._pickWithRayInverseMatrix, this._cachedRayForTransform), this._cachedRayForTransform), predicate, fastCheck, !1, trianglePredicate);return result && (result.ray = ray), result;}, core_scene/* Scene.prototype.multiPick */.x.prototype.multiPick = function (x, y, predicate, camera, trianglePredicate) {return this._internalMultiPick((world) => this.createPickingRay(x, y, world, camera || null), predicate, trianglePredicate);}, core_scene/* Scene.prototype.multiPickWithRay */.x.prototype.multiPickWithRay = function (ray, predicate, trianglePredicate) {return this._internalMultiPick((world) => (this._pickWithRayInverseMatrix || (this._pickWithRayInverseMatrix = math_vector/* Matrix.Identity */.y3.Identity()), world.invertToRef(this._pickWithRayInverseMatrix), this._cachedRayForTransform || (this._cachedRayForTransform = Ray.Zero()), Ray.TransformToRef(ray, this._pickWithRayInverseMatrix, this._cachedRayForTransform), this._cachedRayForTransform), predicate, trianglePredicate);}, Cameras_camera/* Camera.prototype.getForwardRay */.V.prototype.getForwardRay = function (length = 100, transform, origin) {return this.getForwardRayToRef(new Ray(math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero(), length), length, transform, origin);}, Cameras_camera/* Camera.prototype.getForwardRayToRef */.V.prototype.getForwardRayToRef = function (refRay, length = 100, transform, origin) {return transform || (transform = this.getWorldMatrix()), refRay.length = length, origin ? refRay.origin.copyFrom(origin) : refRay.origin.copyFrom(this.position), math_vector/* TmpVectors.Vector3.2.set */.jp.Vector3[2].set(0, 0, this._scene.useRightHandedSystem ? -1 : 1), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2], transform, math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3]), math_vector/* Vector3.NormalizeToRef */.P.NormalizeToRef(math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3], refRay.direction), refRay;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/pivotTools.js
class PivotTools {static _RemoveAndStorePivotPoint(mesh) {mesh && 0 === PivotTools._PivotCached && (mesh.getPivotPointToRef(PivotTools._OldPivotPoint), PivotTools._PivotPostMultiplyPivotMatrix = mesh._postMultiplyPivotMatrix, !PivotTools._OldPivotPoint.equalsToFloats(0, 0, 0) && (mesh.setPivotMatrix(math_vector/* Matrix.IdentityReadOnly */.y3.IdentityReadOnly), PivotTools._OldPivotPoint.subtractToRef(mesh.getPivotPoint(), PivotTools._PivotTranslation), PivotTools._PivotTmpVector.copyFromFloats(1, 1, 1), PivotTools._PivotTmpVector.subtractInPlace(mesh.scaling), PivotTools._PivotTmpVector.multiplyInPlace(PivotTools._PivotTranslation), mesh.position.addInPlace(PivotTools._PivotTmpVector))), PivotTools._PivotCached++;}static _RestorePivotPoint(mesh) {mesh && !PivotTools._OldPivotPoint.equalsToFloats(0, 0, 0) && 1 === PivotTools._PivotCached && (mesh.setPivotPoint(PivotTools._OldPivotPoint), mesh._postMultiplyPivotMatrix = PivotTools._PivotPostMultiplyPivotMatrix, PivotTools._PivotTmpVector.copyFromFloats(1, 1, 1), PivotTools._PivotTmpVector.subtractInPlace(mesh.scaling), PivotTools._PivotTmpVector.multiplyInPlace(PivotTools._PivotTranslation), mesh.position.subtractInPlace(PivotTools._PivotTmpVector)), this._PivotCached--;}}PivotTools._PivotCached = 0, PivotTools._OldPivotPoint = new math_vector/* Vector3 */.P(), PivotTools._PivotTranslation = new math_vector/* Vector3 */.P(), PivotTools._PivotTmpVector = new math_vector/* Vector3 */.P(), PivotTools._PivotPostMultiplyPivotMatrix = !1;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js
var mesh_vertexData = __webpack_require__("./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Compat/compatibilityOptions.js
var compatibilityOptions = __webpack_require__("./node_modules/@babylonjs/core/Compat/compatibilityOptions.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/planeBuilder.js
function CreatePlaneVertexData(options) {const indices = [],positions = [],normals = [],uvs = [],width = options.width || options.size || 1,height = options.height || options.size || 1,sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,halfWidth = width / 2,halfHeight = height / 2;positions.push(-halfWidth, -halfHeight, 0), normals.push(0, 0, -1), uvs.push(0, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 : 0), positions.push(halfWidth, -halfHeight, 0), normals.push(0, 0, -1), uvs.push(1, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 : 0), positions.push(halfWidth, halfHeight, 0), normals.push(0, 0, -1), uvs.push(1, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 0 : 1), positions.push(-halfWidth, halfHeight, 0), normals.push(0, 0, -1), uvs.push(0, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 0 : 1), indices.push(0), indices.push(1), indices.push(2), indices.push(0), indices.push(2), indices.push(3), mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreatePlane(name, options = {}, scene = null) {const plane = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), plane._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreatePlaneVertexData(options);return vertexData.applyToMesh(plane, options.updatable), options.sourcePlane && (plane.translate(options.sourcePlane.normal, -options.sourcePlane.d), plane.setDirection(options.sourcePlane.normal.scale(-1))), plane;}const PlaneBuilder = { CreatePlane };mesh_vertexData/* VertexData.CreatePlane */.x.CreatePlane = CreatePlaneVertexData, Meshes_mesh/* Mesh.CreatePlane */.Kj.CreatePlane = (name, size, scene, updatable, sideOrientation) => {return CreatePlane(name, { size, width: size, height: size, sideOrientation, updatable }, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/pointerDragBehavior.js
class PointerDragBehavior {get currentDraggingPointerID() {return this.currentDraggingPointerId;}set currentDraggingPointerID(currentDraggingPointerID) {this.currentDraggingPointerId = currentDraggingPointerID;}set enabled(value) {value != this._enabled && this.onEnabledObservable.notifyObservers(value), this._enabled = value;}get enabled() {return this._enabled;}get options() {return this._options;}set options(options) {this._options = options;}constructor(options) {this._useAlternatePickedPointAboveMaxDragAngleDragSpeed = -1.1, this._activeDragButton = -1, this.maxDragAngle = 0, this.dragButtons = [0, 1, 2], this._useAlternatePickedPointAboveMaxDragAngle = !1, this.currentDraggingPointerId = -1, this.dragging = !1, this.dragDeltaRatio = .2, this.updateDragPlane = !0, this._debugMode = !1, this._moving = !1, this.onDragObservable = new observable/* Observable */.y$(), this.onDragStartObservable = new observable/* Observable */.y$(), this.onDragEndObservable = new observable/* Observable */.y$(), this.onEnabledObservable = new observable/* Observable */.y$(), this.moveAttached = !0, this._enabled = !0, this.startAndReleaseDragOnPointerEvents = !0, this.detachCameraControls = !0, this.useObjectOrientationForDragging = !0, this.validateDrag = () => !0, this._tmpVector = new math_vector/* Vector3 */.P(0, 0, 0), this._alternatePickedPoint = new math_vector/* Vector3 */.P(0, 0, 0), this._worldDragAxis = new math_vector/* Vector3 */.P(0, 0, 0), this._targetPosition = new math_vector/* Vector3 */.P(0, 0, 0), this._attachedToElement = !1, this._startDragRay = new Ray(new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P()), this._lastPointerRay = {}, this._dragDelta = new math_vector/* Vector3 */.P(), this._pointA = new math_vector/* Vector3 */.P(0, 0, 0), this._pointC = new math_vector/* Vector3 */.P(0, 0, 0), this._localAxis = new math_vector/* Vector3 */.P(0, 0, 0), this._lookAt = new math_vector/* Vector3 */.P(0, 0, 0), this._options = options ? options : {};let optionCount = 0;if (this._options.dragAxis && optionCount++, this._options.dragPlaneNormal && optionCount++, 1 < optionCount) throw "Multiple drag modes specified in dragBehavior options. Only one expected";}get name() {return "PointerDrag";}init() {}attach(ownerNode, predicate) {this._scene = ownerNode.getScene(), ownerNode.isNearGrabbable = !0, this.attachedNode = ownerNode, PointerDragBehavior._PlaneScene || (this._debugMode ? PointerDragBehavior._PlaneScene = this._scene : (PointerDragBehavior._PlaneScene = new core_scene/* Scene */.x(this._scene.getEngine(), { virtual: !0 }), PointerDragBehavior._PlaneScene.detachControl(), this._scene.onDisposeObservable.addOnce(() => {PointerDragBehavior._PlaneScene.dispose(), PointerDragBehavior._PlaneScene = null;}))), this._dragPlane = CreatePlane("pointerDragPlane", { size: this._debugMode ? 1 : 1e4, updatable: !1, sideOrientation: Meshes_mesh/* Mesh.DOUBLESIDE */.Kj.DOUBLESIDE }, PointerDragBehavior._PlaneScene), this.lastDragPosition = new math_vector/* Vector3 */.P(0, 0, 0);const pickPredicate = predicate ? predicate : (m) => this.attachedNode == m || m.isDescendantOf(this.attachedNode);this._pointerObserver = this._scene.onPointerObservable.add((pointerInfo) => {if (!this.enabled) return void (this._attachedToElement && this.releaseDrag());if (pointerInfo.type == pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN) this.startAndReleaseDragOnPointerEvents && !this.dragging && pointerInfo.pickInfo && pointerInfo.pickInfo.hit && pointerInfo.pickInfo.pickedMesh && pointerInfo.pickInfo.pickedPoint && pointerInfo.pickInfo.ray && pickPredicate(pointerInfo.pickInfo.pickedMesh) && -1 === this._activeDragButton && -1 !== this.dragButtons.indexOf(pointerInfo.event.button) && (this._activeDragButton = pointerInfo.event.button, this._activePointerInfo = pointerInfo, this._startDrag(pointerInfo.event.pointerId, pointerInfo.pickInfo.ray, pointerInfo.pickInfo.pickedPoint));else if (pointerInfo.type == pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP) this.startAndReleaseDragOnPointerEvents && this.currentDraggingPointerId == pointerInfo.event.pointerId && this._activeDragButton === pointerInfo.event.button && this.releaseDrag();else if (pointerInfo.type == pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE) {const pointerId = pointerInfo.event.pointerId;if (this.currentDraggingPointerId === PointerDragBehavior._AnyMouseId && pointerId !== PointerDragBehavior._AnyMouseId) {const evt = pointerInfo.event,isMouseEvent = "mouse" === evt.pointerType || !this._scene.getEngine().hostInformation.isMobile && evt instanceof MouseEvent;isMouseEvent && (this._lastPointerRay[this.currentDraggingPointerId] && (this._lastPointerRay[pointerId] = this._lastPointerRay[this.currentDraggingPointerId], delete this._lastPointerRay[this.currentDraggingPointerId]), this.currentDraggingPointerId = pointerId);}this._lastPointerRay[pointerId] || (this._lastPointerRay[pointerId] = new Ray(new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P())), pointerInfo.pickInfo && pointerInfo.pickInfo.ray && (this._lastPointerRay[pointerId].origin.copyFrom(pointerInfo.pickInfo.ray.origin), this._lastPointerRay[pointerId].direction.copyFrom(pointerInfo.pickInfo.ray.direction), this.currentDraggingPointerId == pointerId && this.dragging && this._moveDrag(pointerInfo.pickInfo.ray));}}), this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(() => {if (this._moving && this.moveAttached) {let needMatrixUpdate = !1;PivotTools._RemoveAndStorePivotPoint(this.attachedNode), this._targetPosition.subtractToRef(this.attachedNode.absolutePosition, this._tmpVector), this._tmpVector.scaleInPlace(this.dragDeltaRatio), this.attachedNode.getAbsolutePosition().addToRef(this._tmpVector, this._tmpVector), this.validateDrag(this._tmpVector) && (this.attachedNode.setAbsolutePosition(this._tmpVector), needMatrixUpdate = !0), PivotTools._RestorePivotPoint(this.attachedNode), needMatrixUpdate && this.attachedNode.computeWorldMatrix();}});}releaseDrag() {if (this.dragging && (this.dragging = !1, this.onDragEndObservable.notifyObservers({ dragPlanePoint: this.lastDragPosition, pointerId: this.currentDraggingPointerId, pointerInfo: this._activePointerInfo })), this.currentDraggingPointerId = -1, this._activeDragButton = -1, this._activePointerInfo = null, this._moving = !1, this.detachCameraControls && this._attachedToElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera) {if ("ArcRotateCamera" === this._scene.activeCamera.getClassName()) {const arcRotateCamera = this._scene.activeCamera;arcRotateCamera.attachControl(!arcRotateCamera.inputs || arcRotateCamera.inputs.noPreventDefault, arcRotateCamera._useCtrlForPanning, arcRotateCamera._panningMouseButton);} else this._scene.activeCamera.attachControl(!this._scene.activeCamera.inputs || this._scene.activeCamera.inputs.noPreventDefault);this._attachedToElement = !1;}}startDrag(pointerId = PointerDragBehavior._AnyMouseId, fromRay, startPickedPoint) {this._startDrag(pointerId, fromRay, startPickedPoint);let lastRay = this._lastPointerRay[pointerId];pointerId === PointerDragBehavior._AnyMouseId && (lastRay = this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]), lastRay && this._moveDrag(lastRay);}_startDrag(pointerId, fromRay, startPickedPoint) {if (this._scene.activeCamera && !this.dragging && this.attachedNode) {PivotTools._RemoveAndStorePivotPoint(this.attachedNode), fromRay ? (this._startDragRay.direction.copyFrom(fromRay.direction), this._startDragRay.origin.copyFrom(fromRay.origin)) : (this._startDragRay.origin.copyFrom(this._scene.activeCamera.position), this.attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector), this._tmpVector.subtractToRef(this._scene.activeCamera.position, this._startDragRay.direction)), this._updateDragPlanePosition(this._startDragRay, startPickedPoint ? startPickedPoint : this._tmpVector);const pickedPoint = this._pickWithRayOnDragPlane(this._startDragRay);pickedPoint ? (this.dragging = !0, this.currentDraggingPointerId = pointerId, this.lastDragPosition.copyFrom(pickedPoint), this.onDragStartObservable.notifyObservers({ dragPlanePoint: pickedPoint, pointerId: this.currentDraggingPointerId, pointerInfo: this._activePointerInfo }), this._targetPosition.copyFrom(this.attachedNode.getAbsolutePosition()), this.detachCameraControls && this._scene.activeCamera && this._scene.activeCamera.inputs && !this._scene.activeCamera.leftCamera && (this._scene.activeCamera.inputs.attachedToElement ? (this._scene.activeCamera.detachControl(), this._attachedToElement = !0) : this._attachedToElement = !1)) : this.releaseDrag(), PivotTools._RestorePivotPoint(this.attachedNode);}}_moveDrag(ray) {this._moving = !0;const pickedPoint = this._pickWithRayOnDragPlane(ray);if (pickedPoint) {PivotTools._RemoveAndStorePivotPoint(this.attachedNode), this.updateDragPlane && this._updateDragPlanePosition(ray, pickedPoint);let dragLength = 0;this._options.dragAxis ? (this.useObjectOrientationForDragging ? math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._worldDragAxis) : this._worldDragAxis.copyFrom(this._options.dragAxis), pickedPoint.subtractToRef(this.lastDragPosition, this._tmpVector), dragLength = math_vector/* Vector3.Dot */.P.Dot(this._tmpVector, this._worldDragAxis), this._worldDragAxis.scaleToRef(dragLength, this._dragDelta)) : (dragLength = this._dragDelta.length(), pickedPoint.subtractToRef(this.lastDragPosition, this._dragDelta)), this._targetPosition.addInPlace(this._dragDelta), this.onDragObservable.notifyObservers({ dragDistance: dragLength, delta: this._dragDelta, dragPlanePoint: pickedPoint, dragPlaneNormal: this._dragPlane.forward, pointerId: this.currentDraggingPointerId, pointerInfo: this._activePointerInfo }), this.lastDragPosition.copyFrom(pickedPoint), PivotTools._RestorePivotPoint(this.attachedNode);}}_pickWithRayOnDragPlane(ray) {if (!ray) return null;let angle = Math.acos(math_vector/* Vector3.Dot */.P.Dot(this._dragPlane.forward, ray.direction));if (angle > Math.PI / 2 && (angle = Math.PI - angle), 0 < this.maxDragAngle && angle > this.maxDragAngle) {if (this._useAlternatePickedPointAboveMaxDragAngle) {this._tmpVector.copyFrom(ray.direction), this.attachedNode.absolutePosition.subtractToRef(ray.origin, this._alternatePickedPoint), this._alternatePickedPoint.normalize(), this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed * math_vector/* Vector3.Dot */.P.Dot(this._alternatePickedPoint, this._tmpVector)), this._tmpVector.addInPlace(this._alternatePickedPoint);const dot = math_vector/* Vector3.Dot */.P.Dot(this._dragPlane.forward, this._tmpVector);return this._dragPlane.forward.scaleToRef(-dot, this._alternatePickedPoint), this._alternatePickedPoint.addInPlace(this._tmpVector), this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition), this._alternatePickedPoint;}return null;}const pickResult = PointerDragBehavior._PlaneScene.pickWithRay(ray, (m) => m == this._dragPlane);return pickResult && pickResult.hit && pickResult.pickedMesh && pickResult.pickedPoint ? pickResult.pickedPoint : null;}_updateDragPlanePosition(ray, dragPlanePosition) {this._pointA.copyFrom(dragPlanePosition), this._options.dragAxis ? (this.useObjectOrientationForDragging ? math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragAxis), ray.origin.subtractToRef(this._pointA, this._pointC), this._pointC.normalize(), .999 < Math.abs(math_vector/* Vector3.Dot */.P.Dot(this._localAxis, this._pointC)) ? .999 < Math.abs(math_vector/* Vector3.Dot */.P.Dot(math_vector/* Vector3.UpReadOnly */.P.UpReadOnly, this._pointC)) ? this._lookAt.copyFrom(math_vector/* Vector3.Right */.P.Right()) : this._lookAt.copyFrom(math_vector/* Vector3.UpReadOnly */.P.UpReadOnly) : (math_vector/* Vector3.CrossToRef */.P.CrossToRef(this._localAxis, this._pointC, this._lookAt), math_vector/* Vector3.CrossToRef */.P.CrossToRef(this._localAxis, this._lookAt, this._lookAt), this._lookAt.normalize()), this._dragPlane.position.copyFrom(this._pointA), this._pointA.addToRef(this._lookAt, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : this._options.dragPlaneNormal ? (this.useObjectOrientationForDragging ? math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._options.dragPlaneNormal, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragPlaneNormal), this._dragPlane.position.copyFrom(this._pointA), this._pointA.addToRef(this._localAxis, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : (this._dragPlane.position.copyFrom(this._pointA), this._dragPlane.lookAt(ray.origin)), this._dragPlane.position.copyFrom(this.attachedNode.getAbsolutePosition()), this._dragPlane.computeWorldMatrix(!0);}detach() {this._lastPointerRay = {}, this.attachedNode && (this.attachedNode.isNearGrabbable = !1), this._pointerObserver && this._scene.onPointerObservable.remove(this._pointerObserver), this._beforeRenderObserver && this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver), this._dragPlane && this._dragPlane.dispose(), this.releaseDrag();}}PointerDragBehavior._AnyMouseId = -2;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/multiPointerScaleBehavior.js
class MultiPointerScaleBehavior {constructor() {this._startDistance = 0, this._initialScale = new math_vector/* Vector3 */.P(0, 0, 0), this._targetScale = new math_vector/* Vector3 */.P(0, 0, 0), this._sceneRenderObserver = null, this._dragBehaviorA = new PointerDragBehavior({}), this._dragBehaviorA.moveAttached = !1, this._dragBehaviorB = new PointerDragBehavior({}), this._dragBehaviorB.moveAttached = !1;}get name() {return "MultiPointerScale";}init() {}_getCurrentDistance() {return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length();}attach(ownerNode) {this._ownerNode = ownerNode, this._dragBehaviorA.onDragStartObservable.add(() => {this._dragBehaviorA.dragging && this._dragBehaviorB.dragging && (this._dragBehaviorA.currentDraggingPointerId == this._dragBehaviorB.currentDraggingPointerId ? this._dragBehaviorA.releaseDrag() : (this._initialScale.copyFrom(ownerNode.scaling), this._startDistance = this._getCurrentDistance()));}), this._dragBehaviorB.onDragStartObservable.add(() => {this._dragBehaviorA.dragging && this._dragBehaviorB.dragging && (this._dragBehaviorA.currentDraggingPointerId == this._dragBehaviorB.currentDraggingPointerId ? this._dragBehaviorB.releaseDrag() : (this._initialScale.copyFrom(ownerNode.scaling), this._startDistance = this._getCurrentDistance()));}), [this._dragBehaviorA, this._dragBehaviorB].forEach((behavior) => {behavior.onDragObservable.add(() => {if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) {const ratio = this._getCurrentDistance() / this._startDistance;this._initialScale.scaleToRef(ratio, this._targetScale);}});}), ownerNode.addBehavior(this._dragBehaviorA), ownerNode.addBehavior(this._dragBehaviorB), this._sceneRenderObserver = ownerNode.getScene().onBeforeRenderObservable.add(() => {if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) {const change = this._targetScale.subtract(ownerNode.scaling).scaleInPlace(.1);.01 < change.length() && ownerNode.scaling.addInPlace(change);}});}detach() {this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver), [this._dragBehaviorA, this._dragBehaviorB].forEach((behavior) => {behavior.onDragStartObservable.clear(), behavior.onDragObservable.clear(), this._ownerNode.removeBehavior(behavior);});}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/abstractMesh.js
var abstractMesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/abstractMesh.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/baseSixDofDragBehavior.js
class BaseSixDofDragBehavior {constructor() {this._attachedToElement = !1, this._virtualMeshesInfo = {}, this._tmpVector = new math_vector/* Vector3 */.P(), this._tmpQuaternion = new math_vector/* Quaternion */._f(), this._dragType = { NONE: 0, DRAG: 1, DRAG_WITH_CONTROLLER: 2, NEAR_DRAG: 3 }, this._moving = !1, this._dragging = this._dragType.NONE, this.draggableMeshes = null, this.zDragFactor = 3, this.currentDraggingPointerIds = [], this.detachCameraControls = !0, this.onDragStartObservable = new observable/* Observable */.y$(), this.onDragObservable = new observable/* Observable */.y$(), this.onDragEndObservable = new observable/* Observable */.y$(), this.allowMultiPointer = !0;}get currentDraggingPointerId() {return void 0 === this.currentDraggingPointerIds[0] ? -1 : this.currentDraggingPointerIds[0];}set currentDraggingPointerId(value) {this.currentDraggingPointerIds[0] = value;}get currentDraggingPointerID() {return this.currentDraggingPointerId;}set currentDraggingPointerID(currentDraggingPointerID) {this.currentDraggingPointerId = currentDraggingPointerID;}get name() {return "BaseSixDofDrag";}get isMoving() {return this._moving;}init() {}get _pointerCamera() {return this._scene.cameraToUseForPointers ? this._scene.cameraToUseForPointers : this._scene.activeCamera;}_createVirtualMeshInfo() {const dragMesh = new abstractMesh/* AbstractMesh */.x("", BaseSixDofDragBehavior._virtualScene);dragMesh.rotationQuaternion = new math_vector/* Quaternion */._f();const originMesh = new abstractMesh/* AbstractMesh */.x("", BaseSixDofDragBehavior._virtualScene);originMesh.rotationQuaternion = new math_vector/* Quaternion */._f();const pivotMesh = new abstractMesh/* AbstractMesh */.x("", BaseSixDofDragBehavior._virtualScene);return pivotMesh.rotationQuaternion = new math_vector/* Quaternion */._f(), { dragging: !1, moving: !1, dragMesh, originMesh, pivotMesh, startingPivotPosition: new math_vector/* Vector3 */.P(), startingPivotOrientation: new math_vector/* Quaternion */._f(), startingPosition: new math_vector/* Vector3 */.P(), startingOrientation: new math_vector/* Quaternion */._f(), lastOriginPosition: new math_vector/* Vector3 */.P(), lastDragPosition: new math_vector/* Vector3 */.P() };}_resetVirtualMeshesPosition() {for (let i = 0; i < this.currentDraggingPointerIds.length; i++) this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].pivotMesh.position.copyFrom(this._ownerNode.getAbsolutePivotPoint()), this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].pivotMesh.rotationQuaternion.copyFrom(this._ownerNode.rotationQuaternion), this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].startingPivotPosition.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].pivotMesh.position), this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].startingPivotOrientation.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].pivotMesh.rotationQuaternion), this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].startingPosition.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].dragMesh.position), this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].startingOrientation.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].dragMesh.rotationQuaternion);}_pointerUpdate2D(ray, pointerId, zDragFactor) {!this._pointerCamera || this._pointerCamera.cameraRigMode != Cameras_camera/* Camera.RIG_MODE_NONE */.V.RIG_MODE_NONE || this._pointerCamera._isLeftCamera || this._pointerCamera._isRightCamera || (ray.origin.copyFrom(this._pointerCamera.globalPosition), zDragFactor = 0);const virtualMeshesInfo = this._virtualMeshesInfo[pointerId],originDragDifference = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];ray.origin.subtractToRef(virtualMeshesInfo.lastOriginPosition, originDragDifference), virtualMeshesInfo.lastOriginPosition.copyFrom(ray.origin);const localOriginDragDifference = -math_vector/* Vector3.Dot */.P.Dot(originDragDifference, ray.direction);virtualMeshesInfo.originMesh.addChild(virtualMeshesInfo.dragMesh), virtualMeshesInfo.originMesh.addChild(virtualMeshesInfo.pivotMesh), this._applyZOffset(virtualMeshesInfo.dragMesh, localOriginDragDifference, zDragFactor), this._applyZOffset(virtualMeshesInfo.pivotMesh, localOriginDragDifference, zDragFactor), virtualMeshesInfo.originMesh.position.copyFrom(ray.origin);const lookAt = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];ray.origin.addToRef(ray.direction, lookAt), virtualMeshesInfo.originMesh.lookAt(lookAt), virtualMeshesInfo.originMesh.removeChild(virtualMeshesInfo.dragMesh), virtualMeshesInfo.originMesh.removeChild(virtualMeshesInfo.pivotMesh);}_pointerUpdateXR(controllerAimTransform, controllerGripTransform, pointerId, zDragFactor) {const virtualMeshesInfo = this._virtualMeshesInfo[pointerId];if (virtualMeshesInfo.originMesh.position.copyFrom(controllerAimTransform.position), this._dragging === this._dragType.NEAR_DRAG && controllerGripTransform ? virtualMeshesInfo.originMesh.rotationQuaternion.copyFrom(controllerGripTransform.rotationQuaternion) : virtualMeshesInfo.originMesh.rotationQuaternion.copyFrom(controllerAimTransform.rotationQuaternion), virtualMeshesInfo.pivotMesh.computeWorldMatrix(!0), virtualMeshesInfo.dragMesh.computeWorldMatrix(!0), 0 !== zDragFactor) {const cameraForwardVec = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],originDragDirection = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];cameraForwardVec.copyFrom(this._pointerCamera.getForwardRay().direction), virtualMeshesInfo.originMesh.position.subtractToRef(virtualMeshesInfo.lastOriginPosition, originDragDirection), virtualMeshesInfo.lastOriginPosition.copyFrom(virtualMeshesInfo.originMesh.position);const controllerDragDistance = originDragDirection.length();originDragDirection.normalize();const cameraToDrag = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],controllerToDrag = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3];virtualMeshesInfo.dragMesh.absolutePosition.subtractToRef(this._pointerCamera.globalPosition, cameraToDrag), virtualMeshesInfo.dragMesh.absolutePosition.subtractToRef(virtualMeshesInfo.originMesh.position, controllerToDrag);const controllerToDragDistance = controllerToDrag.length();cameraToDrag.normalize(), controllerToDrag.normalize();const controllerDragScaling = Math.abs(math_vector/* Vector3.Dot */.P.Dot(originDragDirection, controllerToDrag)) * math_vector/* Vector3.Dot */.P.Dot(originDragDirection, cameraForwardVec);let zOffsetScaling = controllerDragScaling * zDragFactor * controllerDragDistance * controllerToDragDistance;const minDistanceFromControllerToDragMesh = .01;0 > zOffsetScaling && minDistanceFromControllerToDragMesh - controllerToDragDistance > zOffsetScaling && (zOffsetScaling = Math.min(minDistanceFromControllerToDragMesh - controllerToDragDistance, 0)), controllerToDrag.scaleInPlace(zOffsetScaling), controllerToDrag.addToRef(virtualMeshesInfo.pivotMesh.absolutePosition, this._tmpVector), virtualMeshesInfo.pivotMesh.setAbsolutePosition(this._tmpVector), controllerToDrag.addToRef(virtualMeshesInfo.dragMesh.absolutePosition, this._tmpVector), virtualMeshesInfo.dragMesh.setAbsolutePosition(this._tmpVector);}}attach(ownerNode) {this._ownerNode = ownerNode, this._scene = this._ownerNode.getScene(), BaseSixDofDragBehavior._virtualScene || (BaseSixDofDragBehavior._virtualScene = new core_scene/* Scene */.x(this._scene.getEngine(), { virtual: !0 }), BaseSixDofDragBehavior._virtualScene.detachControl());const pickPredicate = (m) => this._ownerNode === m || m.isDescendantOf(this._ownerNode) && (!this.draggableMeshes || -1 !== this.draggableMeshes.indexOf(m));this._pointerObserver = this._scene.onPointerObservable.add((pointerInfo) => {const pointerId = pointerInfo.event.pointerId;this._virtualMeshesInfo[pointerId] || (this._virtualMeshesInfo[pointerId] = this._createVirtualMeshInfo());const virtualMeshesInfo = this._virtualMeshesInfo[pointerId],isXRNearPointer = "xr-near" === pointerInfo.event.pointerType;if (pointerInfo.type == pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN) {if (!virtualMeshesInfo.dragging && pointerInfo.pickInfo && pointerInfo.pickInfo.hit && pointerInfo.pickInfo.pickedMesh && pointerInfo.pickInfo.pickedPoint && pointerInfo.pickInfo.ray && (!isXRNearPointer || pointerInfo.pickInfo.aimTransform) && pickPredicate(pointerInfo.pickInfo.pickedMesh)) {if (!this.allowMultiPointer && 0 < this.currentDraggingPointerIds.length) return;!this._pointerCamera || this._pointerCamera.cameraRigMode !== Cameras_camera/* Camera.RIG_MODE_NONE */.V.RIG_MODE_NONE || this._pointerCamera._isLeftCamera || this._pointerCamera._isRightCamera || pointerInfo.pickInfo.ray.origin.copyFrom(this._pointerCamera.globalPosition), this._ownerNode.computeWorldMatrix(!0);const virtualMeshesInfo = this._virtualMeshesInfo[pointerId];isXRNearPointer ? (this._dragging = pointerInfo.pickInfo.originMesh ? this._dragType.NEAR_DRAG : this._dragType.DRAG_WITH_CONTROLLER, virtualMeshesInfo.originMesh.position.copyFrom(pointerInfo.pickInfo.aimTransform.position), this._dragging === this._dragType.NEAR_DRAG && pointerInfo.pickInfo.gripTransform ? virtualMeshesInfo.originMesh.rotationQuaternion.copyFrom(pointerInfo.pickInfo.gripTransform.rotationQuaternion) : virtualMeshesInfo.originMesh.rotationQuaternion.copyFrom(pointerInfo.pickInfo.aimTransform.rotationQuaternion)) : (this._dragging = this._dragType.DRAG, virtualMeshesInfo.originMesh.position.copyFrom(pointerInfo.pickInfo.ray.origin)), virtualMeshesInfo.lastOriginPosition.copyFrom(virtualMeshesInfo.originMesh.position), virtualMeshesInfo.dragMesh.position.copyFrom(pointerInfo.pickInfo.pickedPoint), virtualMeshesInfo.lastDragPosition.copyFrom(pointerInfo.pickInfo.pickedPoint), virtualMeshesInfo.pivotMesh.position.copyFrom(this._ownerNode.getAbsolutePivotPoint()), virtualMeshesInfo.pivotMesh.rotationQuaternion.copyFrom(this._ownerNode.absoluteRotationQuaternion), virtualMeshesInfo.startingPosition.copyFrom(virtualMeshesInfo.dragMesh.position), virtualMeshesInfo.startingPivotPosition.copyFrom(virtualMeshesInfo.pivotMesh.position), virtualMeshesInfo.startingOrientation.copyFrom(virtualMeshesInfo.dragMesh.rotationQuaternion), virtualMeshesInfo.startingPivotOrientation.copyFrom(virtualMeshesInfo.pivotMesh.rotationQuaternion), isXRNearPointer ? (virtualMeshesInfo.originMesh.addChild(virtualMeshesInfo.dragMesh), virtualMeshesInfo.originMesh.addChild(virtualMeshesInfo.pivotMesh)) : virtualMeshesInfo.originMesh.lookAt(virtualMeshesInfo.dragMesh.position), virtualMeshesInfo.dragging = !0, -1 === this.currentDraggingPointerIds.indexOf(pointerId) && this.currentDraggingPointerIds.push(pointerId), this.detachCameraControls && this._pointerCamera && !this._pointerCamera.leftCamera && (this._pointerCamera.inputs && this._pointerCamera.inputs.attachedToElement ? (this._pointerCamera.detachControl(), this._attachedToElement = !0) : this._attachedToElement = !1), this._targetDragStart(virtualMeshesInfo.pivotMesh.position, virtualMeshesInfo.pivotMesh.rotationQuaternion, pointerId), this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.pivotMesh.position });}} else if (pointerInfo.type == pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP || pointerInfo.type == pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP) {const registeredPointerIndex = this.currentDraggingPointerIds.indexOf(pointerId);virtualMeshesInfo.dragging = !1, -1 !== registeredPointerIndex && (this.currentDraggingPointerIds.splice(registeredPointerIndex, 1), 0 === this.currentDraggingPointerIds.length && (this._moving = !1, this._dragging = this._dragType.NONE, this.detachCameraControls && this._attachedToElement && this._pointerCamera && !this._pointerCamera.leftCamera && (this._reattachCameraControls(), this._attachedToElement = !1)), virtualMeshesInfo.originMesh.removeChild(virtualMeshesInfo.dragMesh), virtualMeshesInfo.originMesh.removeChild(virtualMeshesInfo.pivotMesh), this._targetDragEnd(pointerId), this.onDragEndObservable.notifyObservers({}));} else if (pointerInfo.type == pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE) {const registeredPointerIndex = this.currentDraggingPointerIds.indexOf(pointerId);if (-1 !== registeredPointerIndex && virtualMeshesInfo.dragging && pointerInfo.pickInfo && (pointerInfo.pickInfo.ray || pointerInfo.pickInfo.aimTransform)) {let zDragFactor = this.zDragFactor;(1 < this.currentDraggingPointerIds.length || pointerInfo.pickInfo.originMesh) && (zDragFactor = 0), this._ownerNode.computeWorldMatrix(!0), isXRNearPointer ? this._pointerUpdateXR(pointerInfo.pickInfo.aimTransform, pointerInfo.pickInfo.gripTransform, pointerId, zDragFactor) : this._pointerUpdate2D(pointerInfo.pickInfo.ray, pointerId, zDragFactor), this._tmpQuaternion.copyFrom(virtualMeshesInfo.startingPivotOrientation), this._tmpQuaternion.x = -this._tmpQuaternion.x, this._tmpQuaternion.y = -this._tmpQuaternion.y, this._tmpQuaternion.z = -this._tmpQuaternion.z, virtualMeshesInfo.pivotMesh.absoluteRotationQuaternion.multiplyToRef(this._tmpQuaternion, this._tmpQuaternion), virtualMeshesInfo.pivotMesh.absolutePosition.subtractToRef(virtualMeshesInfo.startingPivotPosition, this._tmpVector), this.onDragObservable.notifyObservers({ delta: this._tmpVector, position: virtualMeshesInfo.pivotMesh.position, pickInfo: pointerInfo.pickInfo }), this._targetDrag(this._tmpVector, this._tmpQuaternion, pointerId), virtualMeshesInfo.lastDragPosition.copyFrom(virtualMeshesInfo.dragMesh.absolutePosition), this._moving = !0;}}});}_applyZOffset(node, localOriginDragDifference, zDragFactor) {node.position.z -= 1 > node.position.z ? localOriginDragDifference * zDragFactor : localOriginDragDifference * zDragFactor * node.position.z, 0 > node.position.z && (node.position.z = 0);}_targetDragStart() {}_targetDrag() {}_targetDragEnd() {}_reattachCameraControls() {if (this._pointerCamera) if ("ArcRotateCamera" === this._pointerCamera.getClassName()) {const arcRotateCamera = this._pointerCamera;arcRotateCamera.attachControl(!arcRotateCamera.inputs || arcRotateCamera.inputs.noPreventDefault, arcRotateCamera._useCtrlForPanning, arcRotateCamera._panningMouseButton);} else this._pointerCamera.attachControl(!this._pointerCamera.inputs || this._pointerCamera.inputs.noPreventDefault);}detach() {for (const pointerId in this._scene && (this.detachCameraControls && this._attachedToElement && this._pointerCamera && !this._pointerCamera.leftCamera && (this._reattachCameraControls(), this._attachedToElement = !1), this._scene.onPointerObservable.remove(this._pointerObserver)), this._virtualMeshesInfo) this._virtualMeshesInfo[pointerId].originMesh.dispose(), this._virtualMeshesInfo[pointerId].dragMesh.dispose();this.onDragEndObservable.clear(), this.onDragObservable.clear(), this.onDragStartObservable.clear();}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/transformNode.js
var transformNode = __webpack_require__("./node_modules/@babylonjs/core/Meshes/transformNode.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.axis.js
var math_axis = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.axis.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/sixDofDragBehavior.js
class SixDofDragBehavior extends BaseSixDofDragBehavior {constructor() {super(...arguments), this._sceneRenderObserver = null, this._targetPosition = new math_vector/* Vector3 */.P(0, 0, 0), this._targetOrientation = new math_vector/* Quaternion */._f(), this._targetScaling = new math_vector/* Vector3 */.P(1, 1, 1), this._startingPosition = new math_vector/* Vector3 */.P(0, 0, 0), this._startingOrientation = new math_vector/* Quaternion */._f(), this._startingScaling = new math_vector/* Vector3 */.P(1, 1, 1), this.onPositionChangedObservable = new observable/* Observable */.y$(), this.dragDeltaRatio = .2, this.rotateDraggedObject = !0, this.rotateAroundYOnly = !1, this.rotateWithMotionController = !0, this.disableMovement = !1, this.faceCameraOnDragStart = !1;}get name() {return "SixDofDrag";}attach(ownerNode) {super.attach(ownerNode), ownerNode.isNearGrabbable = !0, this._virtualTransformNode = new transformNode/* TransformNode */.Y("virtual_sixDof", BaseSixDofDragBehavior._virtualScene), this._virtualTransformNode.rotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this._sceneRenderObserver = ownerNode.getScene().onBeforeRenderObservable.add(() => {if (1 === this.currentDraggingPointerIds.length && this._moving && !this.disableMovement) {const oldParent = ownerNode.parent;ownerNode.setParent(null), ownerNode.position.addInPlace(this._targetPosition.subtract(ownerNode.position).scale(this.dragDeltaRatio)), this.onPositionChangedObservable.notifyObservers({ position: ownerNode.absolutePosition }), oldParent && (!oldParent.scaling || oldParent.scaling.isNonUniformWithinEpsilon(.001)) || math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(ownerNode.rotationQuaternion, this._targetOrientation, this.dragDeltaRatio, ownerNode.rotationQuaternion), ownerNode.setParent(oldParent);}});}_getPositionOffsetAround(transformationLocalOrigin, scaling, rotation) {const translationMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],translationMatrixInv = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1],rotationMatrix = math_vector/* TmpVectors.Matrix.2 */.jp.Matrix[2],scaleMatrix = math_vector/* TmpVectors.Matrix.3 */.jp.Matrix[3],finalMatrix = math_vector/* TmpVectors.Matrix.4 */.jp.Matrix[4];return math_vector/* Matrix.TranslationToRef */.y3.TranslationToRef(transformationLocalOrigin.x, transformationLocalOrigin.y, transformationLocalOrigin.z, translationMatrix), math_vector/* Matrix.TranslationToRef */.y3.TranslationToRef(-transformationLocalOrigin.x, -transformationLocalOrigin.y, -transformationLocalOrigin.z, translationMatrixInv), math_vector/* Matrix.FromQuaternionToRef */.y3.FromQuaternionToRef(rotation, rotationMatrix), math_vector/* Matrix.ScalingToRef */.y3.ScalingToRef(scaling, scaling, scaling, scaleMatrix), translationMatrixInv.multiplyToRef(rotationMatrix, finalMatrix), finalMatrix.multiplyToRef(scaleMatrix, finalMatrix), finalMatrix.multiplyToRef(translationMatrix, finalMatrix), finalMatrix.getTranslation();}_onePointerPositionUpdated(worldDeltaPosition, worldDeltaRotation) {const pointerDelta = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];pointerDelta.setAll(0), this._dragging === this._dragType.DRAG ? this.rotateDraggedObject && (this.rotateAroundYOnly ? math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(worldDeltaRotation.toEulerAngles().y, 0, 0, math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0]) : math_vector/* TmpVectors.Quaternion.0.copyFrom */.jp.Quaternion[0].copyFrom(worldDeltaRotation), math_vector/* TmpVectors.Quaternion.0.multiplyToRef */.jp.Quaternion[0].multiplyToRef(this._startingOrientation, this._targetOrientation)) : (this._dragging === this._dragType.NEAR_DRAG || this._dragging === this._dragType.DRAG_WITH_CONTROLLER && this.rotateWithMotionController) && worldDeltaRotation.multiplyToRef(this._startingOrientation, this._targetOrientation), this._targetPosition.copyFrom(this._startingPosition).addInPlace(worldDeltaPosition);}_twoPointersPositionUpdated() {const startingPosition0 = this._virtualMeshesInfo[this.currentDraggingPointerIds[0]].startingPosition,startingPosition1 = this._virtualMeshesInfo[this.currentDraggingPointerIds[1]].startingPosition,startingCenter = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];startingPosition0.addToRef(startingPosition1, startingCenter), startingCenter.scaleInPlace(.5);const startingVector = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];startingPosition1.subtractToRef(startingPosition0, startingVector);const currentPosition0 = this._virtualMeshesInfo[this.currentDraggingPointerIds[0]].dragMesh.absolutePosition,currentPosition1 = this._virtualMeshesInfo[this.currentDraggingPointerIds[1]].dragMesh.absolutePosition,currentCenter = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2];currentPosition0.addToRef(currentPosition1, currentCenter), currentCenter.scaleInPlace(.5);const currentVector = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3];currentPosition1.subtractToRef(currentPosition0, currentVector);const scaling = currentVector.length() / startingVector.length(),translation = currentCenter.subtract(startingCenter),rotationQuaternion = math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(0, math_vector/* Vector3.GetAngleBetweenVectorsOnPlane */.P.GetAngleBetweenVectorsOnPlane(startingVector.normalize(), currentVector.normalize(), math_vector/* Vector3.UpReadOnly */.P.UpReadOnly), 0),oldParent = this._ownerNode.parent;this._ownerNode.setParent(null);const positionOffset = this._getPositionOffsetAround(startingCenter.subtract(this._virtualTransformNode.getAbsolutePivotPoint()), scaling, rotationQuaternion);this._virtualTransformNode.rotationQuaternion.multiplyToRef(rotationQuaternion, this._ownerNode.rotationQuaternion), this._virtualTransformNode.scaling.scaleToRef(scaling, this._ownerNode.scaling), this._virtualTransformNode.position.addToRef(translation.addInPlace(positionOffset), this._ownerNode.position), this.onPositionChangedObservable.notifyObservers({ position: this._ownerNode.position }), this._ownerNode.setParent(oldParent);}_targetDragStart() {const pointerCount = this.currentDraggingPointerIds.length,oldParent = this._ownerNode.parent;this._ownerNode.rotationQuaternion || (this._ownerNode.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this._ownerNode.rotation.y, this._ownerNode.rotation.x, this._ownerNode.rotation.z));const worldPivot = this._ownerNode.getAbsolutePivotPoint();if (this._ownerNode.setParent(null), 1 === pointerCount) {if (this._targetPosition.copyFrom(this._ownerNode.position), this._targetOrientation.copyFrom(this._ownerNode.rotationQuaternion), this._targetScaling.copyFrom(this._ownerNode.scaling), this.faceCameraOnDragStart && this._scene.activeCamera) {const toCamera = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];this._scene.activeCamera.position.subtractToRef(worldPivot, toCamera), toCamera.normalize();const quat = math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0];this._scene.useRightHandedSystem ? math_vector/* Quaternion.FromLookDirectionRHToRef */._f.FromLookDirectionRHToRef(toCamera, new math_vector/* Vector3 */.P(0, 1, 0), quat) : math_vector/* Quaternion.FromLookDirectionLHToRef */._f.FromLookDirectionLHToRef(toCamera, new math_vector/* Vector3 */.P(0, 1, 0), quat), quat.normalize(), math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(quat.toEulerAngles().y, 0, 0, math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0]), this._targetOrientation.copyFrom(math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0]);}this._startingPosition.copyFrom(this._targetPosition), this._startingOrientation.copyFrom(this._targetOrientation), this._startingScaling.copyFrom(this._targetScaling);} else 2 === pointerCount && (this._virtualTransformNode.setPivotPoint(new math_vector/* Vector3 */.P(0, 0, 0), math_axis/* Space.LOCAL */.T.LOCAL), this._virtualTransformNode.position.copyFrom(this._ownerNode.position), this._virtualTransformNode.scaling.copyFrom(this._ownerNode.scaling), this._virtualTransformNode.rotationQuaternion.copyFrom(this._ownerNode.rotationQuaternion), this._virtualTransformNode.setPivotPoint(worldPivot, math_axis/* Space.WORLD */.T.WORLD), this._resetVirtualMeshesPosition());this._ownerNode.setParent(oldParent);}_targetDrag(worldDeltaPosition, worldDeltaRotation) {1 === this.currentDraggingPointerIds.length ? this._onePointerPositionUpdated(worldDeltaPosition, worldDeltaRotation) : 2 === this.currentDraggingPointerIds.length && this._twoPointersPositionUpdated();}_targetDragEnd() {if (1 === this.currentDraggingPointerIds.length) {this._resetVirtualMeshesPosition();const previousFaceCameraFlag = this.faceCameraOnDragStart;this.faceCameraOnDragStart = !1, this._targetDragStart(), this.faceCameraOnDragStart = previousFaceCameraFlag;}}detach() {super.detach(), this._ownerNode && (this._ownerNode.isNearGrabbable = !1, this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver)), this._virtualTransformNode && this._virtualTransformNode.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/surfaceMagnetismBehavior.js
class SurfaceMagnetismBehavior {constructor() {this._attachPointLocalOffset = new math_vector/* Vector3 */.P(), this._workingPosition = new math_vector/* Vector3 */.P(), this._workingQuaternion = new math_vector/* Quaternion */._f(), this._lastTick = -1, this._hit = !1, this.hitNormalOffset = .05, this.meshes = [], this.interpolatePose = !0, this.lerpTime = 250, this.keepOrientationVertical = !0, this.enabled = !0, this.maxStickingDistance = .8;}get name() {return "SurfaceMagnetism";}init() {}attach(target, scene) {this._attachedMesh = target, this._scene = scene || target.getScene(), this._attachedMesh.rotationQuaternion || (this._attachedMesh.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this._attachedMesh.rotation.y, this._attachedMesh.rotation.x, this._attachedMesh.rotation.z)), this.updateAttachPoint(), this._workingPosition.copyFrom(this._attachedMesh.position), this._workingQuaternion.copyFrom(this._attachedMesh.rotationQuaternion), this._addObservables();}detach() {this._attachedMesh = null, this._removeObservables();}_getTargetPose(pickingInfo) {if (!this._attachedMesh) return null;if (pickingInfo && pickingInfo.hit) {const pickedNormal = pickingInfo.getNormal(!0, !0),pickedPoint = pickingInfo.pickedPoint;if (!pickedNormal || !pickedPoint) return null;pickedNormal.normalize();const worldTarget = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];return worldTarget.copyFrom(pickedNormal), worldTarget.scaleInPlace(this.hitNormalOffset), worldTarget.addInPlace(pickedPoint), this._attachedMesh.parent && (math_vector/* TmpVectors.Matrix.0.copyFrom */.jp.Matrix[0].copyFrom(this._attachedMesh.parent.getWorldMatrix()).invert(), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(worldTarget, math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0], worldTarget)), { position: worldTarget, quaternion: math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(-Math.atan2(pickedNormal.x, -pickedNormal.z), this.keepOrientationVertical ? 0 : Math.atan2(pickedNormal.y, Math.sqrt(pickedNormal.z * pickedNormal.z + pickedNormal.x * pickedNormal.x)), 0) };}return null;}updateAttachPoint() {this._getAttachPointOffsetToRef(this._attachPointLocalOffset);}findAndUpdateTarget(pickInfo) {if (this._hit = !1, !pickInfo.ray) return !1;const subPicking = pickInfo.ray.intersectsMeshes(this.meshes)[0];if (this._attachedMesh && subPicking && subPicking.hit && subPicking.pickedMesh) {const pose = this._getTargetPose(subPicking);pose && math_vector/* Vector3.Distance */.P.Distance(this._attachedMesh.position, pose.position) < this.maxStickingDistance && (this._workingPosition.copyFrom(pose.position), this._workingQuaternion.copyFrom(pose.quaternion), this._hit = !0);}return this._hit;}_getAttachPointOffsetToRef(ref) {if (!this._attachedMesh) return void ref.setAll(0);const storedQuat = math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0];storedQuat.copyFrom(this._attachedMesh.rotationQuaternion), this._attachedMesh.rotationQuaternion.copyFromFloats(0, 0, 0, 1), this._attachedMesh.computeWorldMatrix();const boundingMinMax = this._attachedMesh.getHierarchyBoundingVectors(),center = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];boundingMinMax.max.addToRef(boundingMinMax.min, center), center.scaleInPlace(.5), center.z = boundingMinMax.max.z;const invWorld = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];this._attachedMesh.getWorldMatrix().invertToRef(invWorld), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(center, invWorld, ref), this._attachedMesh.rotationQuaternion.copyFrom(storedQuat);}_updateTransformToGoal(elapsed) {if (this._attachedMesh && this._hit) {const oldParent = this._attachedMesh.parent;this._attachedMesh.setParent(null);const worldOffset = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];if (math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(this._attachPointLocalOffset, this._attachedMesh.getWorldMatrix(), worldOffset), !this.interpolatePose) return this._attachedMesh.position.copyFrom(this._workingPosition).subtractInPlace(worldOffset), void this._attachedMesh.rotationQuaternion.copyFrom(this._workingQuaternion);const interpolatedPosition = new math_vector/* Vector3 */.P();math_vector/* Vector3.SmoothToRef */.P.SmoothToRef(this._attachedMesh.position, this._workingPosition, elapsed, this.lerpTime, interpolatedPosition), this._attachedMesh.position.copyFrom(interpolatedPosition);const currentRotation = new math_vector/* Quaternion */._f();currentRotation.copyFrom(this._attachedMesh.rotationQuaternion), math_vector/* Quaternion.SmoothToRef */._f.SmoothToRef(currentRotation, this._workingQuaternion, elapsed, this.lerpTime, this._attachedMesh.rotationQuaternion), this._attachedMesh.setParent(oldParent);}}_addObservables() {this._pointerObserver = this._scene.onPointerObservable.add((pointerInfo) => {this.enabled && pointerInfo.type == pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE && pointerInfo.pickInfo && this.findAndUpdateTarget(pointerInfo.pickInfo);}), this._lastTick = Date.now(), this._onBeforeRender = this._scene.onBeforeRenderObservable.add(() => {const tick = Date.now();this._updateTransformToGoal(tick - this._lastTick), this._lastTick = tick;});}_removeObservables() {this._scene.onPointerObservable.remove(this._pointerObserver), this._scene.onBeforeRenderObservable.remove(this._onBeforeRender), this._pointerObserver = null, this._onBeforeRender = null;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.scalar.js
var math_scalar = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.scalar.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/followBehavior.js
class FollowBehavior {constructor() {this._tmpQuaternion = new math_vector/* Quaternion */._f(), this._tmpVectors = [new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P()], this._tmpMatrix = new math_vector/* Matrix */.y3(), this._tmpInvertView = new math_vector/* Matrix */.y3(), this._tmpForward = new math_vector/* Vector3 */.P(), this._tmpNodeForward = new math_vector/* Vector3 */.P(), this._tmpPosition = new math_vector/* Vector3 */.P(), this._workingPosition = new math_vector/* Vector3 */.P(), this._workingQuaternion = new math_vector/* Quaternion */._f(), this._lastTick = -1, this._recenterNextUpdate = !0, this.interpolatePose = !0, this.lerpTime = 500, this.ignoreCameraPitchAndRoll = !1, this.pitchOffset = 15, this.maxViewVerticalDegrees = 30, this.maxViewHorizontalDegrees = 30, this.orientToCameraDeadzoneDegrees = 60, this.ignoreDistanceClamp = !1, this.ignoreAngleClamp = !1, this.verticalMaxDistance = 0, this.defaultDistance = .8, this.maximumDistance = 2, this.minimumDistance = .3, this.useFixedVerticalOffset = !1, this.fixedVerticalOffset = 0, this._enabled = !0;}get followedCamera() {return this._followedCamera || this._scene.activeCamera;}set followedCamera(camera) {this._followedCamera = camera;}get name() {return "Follow";}init() {}attach(ownerNode, followedCamera) {this._scene = ownerNode.getScene(), this.attachedNode = ownerNode, followedCamera && (this.followedCamera = followedCamera), this._addObservables();}detach() {this.attachedNode = null, this._removeObservables();}recenter() {this._recenterNextUpdate = !0;}_angleBetweenVectorAndPlane(vector, normal) {return this._tmpVectors[0].copyFrom(vector), vector = this._tmpVectors[0], this._tmpVectors[1].copyFrom(normal), normal = this._tmpVectors[1], vector.normalize(), normal.normalize(), Math.PI / 2 - Math.acos(math_vector/* Vector3.Dot */.P.Dot(vector, normal));}_length2D(vector) {return Math.sqrt(vector.x * vector.x + vector.z * vector.z);}_distanceClamp(currentToTarget, moveToDefault = !1) {let minDistance = this.minimumDistance,maxDistance = this.maximumDistance;const defaultDistance = this.defaultDistance,direction = this._tmpVectors[0];direction.copyFrom(currentToTarget);let currentDistance = direction.length();if (direction.normalizeFromLength(currentDistance), this.ignoreCameraPitchAndRoll) {minDistance = this._length2D(direction) * minDistance, maxDistance = this._length2D(direction) * maxDistance;const currentDistance2D = this._length2D(currentToTarget);direction.scaleInPlace(currentDistance / currentDistance2D), currentDistance = currentDistance2D;}let clampedDistance = currentDistance;return clampedDistance = moveToDefault ? defaultDistance : math_scalar/* Scalar.Clamp */.R.Clamp(currentDistance, minDistance, maxDistance), currentToTarget.copyFrom(direction).scaleInPlace(clampedDistance), currentDistance !== clampedDistance;}_applyVerticalClamp(currentToTarget) {0 !== this.verticalMaxDistance && (currentToTarget.y = math_scalar/* Scalar.Clamp */.R.Clamp(currentToTarget.y, -this.verticalMaxDistance, this.verticalMaxDistance));}_toOrientationQuatToRef(vector, quaternion) {math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(Math.atan2(vector.x, vector.z), Math.atan2(vector.y, Math.sqrt(vector.z * vector.z + vector.x * vector.x)), 0, quaternion);}_applyPitchOffset(invertView) {const forward = this._tmpVectors[0],right = this._tmpVectors[1];forward.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1), right.copyFromFloats(1, 0, 0), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(forward, invertView, forward), forward.y = 0, forward.normalize(), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(right, invertView, right), math_vector/* Quaternion.RotationAxisToRef */._f.RotationAxisToRef(right, this.pitchOffset * Math.PI / 180, this._tmpQuaternion), forward.rotateByQuaternionToRef(this._tmpQuaternion, forward), this._toOrientationQuatToRef(forward, this._tmpQuaternion), this._tmpQuaternion.toRotationMatrix(this._tmpMatrix), invertView.copyFrom(this._tmpMatrix);}_angularClamp(invertView, currentToTarget) {const forward = this._tmpVectors[5];forward.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1);const right = this._tmpVectors[6];right.copyFromFloats(1, 0, 0), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(forward, invertView, forward), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(right, invertView, right);const up = math_vector/* Vector3.UpReadOnly */.P.UpReadOnly,dist = currentToTarget.length();if (dist < math_constants/* Epsilon */.kn) return !1;let angularClamped = !1;const rotationQuat = this._tmpQuaternion;if (this.ignoreCameraPitchAndRoll) {const angle = math_vector/* Vector3.GetAngleBetweenVectorsOnPlane */.P.GetAngleBetweenVectorsOnPlane(currentToTarget, forward, right);math_vector/* Quaternion.RotationAxisToRef */._f.RotationAxisToRef(right, angle, rotationQuat), currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget);} else {const angle = -math_vector/* Vector3.GetAngleBetweenVectorsOnPlane */.P.GetAngleBetweenVectorsOnPlane(currentToTarget, forward, right),minMaxAngle = .5 * (this.maxViewVerticalDegrees * Math.PI / 180);angle < -minMaxAngle ? (math_vector/* Quaternion.RotationAxisToRef */._f.RotationAxisToRef(right, -angle - minMaxAngle, rotationQuat), currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget), angularClamped = !0) : angle > minMaxAngle && (math_vector/* Quaternion.RotationAxisToRef */._f.RotationAxisToRef(right, -angle + minMaxAngle, rotationQuat), currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget), angularClamped = !0);}const angle = this._angleBetweenVectorAndPlane(currentToTarget, right) * (this._scene.useRightHandedSystem ? -1 : 1),minMaxAngle = .5 * (this.maxViewHorizontalDegrees * Math.PI / 180);return angle < -minMaxAngle ? (math_vector/* Quaternion.RotationAxisToRef */._f.RotationAxisToRef(up, -angle - minMaxAngle, rotationQuat), currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget), angularClamped = !0) : angle > minMaxAngle && (math_vector/* Quaternion.RotationAxisToRef */._f.RotationAxisToRef(up, -angle + minMaxAngle, rotationQuat), currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget), angularClamped = !0), angularClamped;}_orientationClamp(currentToTarget, rotationQuaternion) {var _a;const toFollowed = this._tmpVectors[0];toFollowed.copyFrom(currentToTarget).scaleInPlace(-1).normalize();const up = this._tmpVectors[1],right = this._tmpVectors[2];up.copyFromFloats(0, 1, 0), math_vector/* Vector3.CrossToRef */.P.CrossToRef(toFollowed, up, right);const length = right.length();length < math_constants/* Epsilon */.kn || (right.normalizeFromLength(length), math_vector/* Vector3.CrossToRef */.P.CrossToRef(right, toFollowed, up), (null === (_a = this.attachedNode) || void 0 === _a ? void 0 : _a.getScene().useRightHandedSystem) ? math_vector/* Quaternion.FromLookDirectionRHToRef */._f.FromLookDirectionRHToRef(toFollowed, up, rotationQuaternion) : math_vector/* Quaternion.FromLookDirectionLHToRef */._f.FromLookDirectionLHToRef(toFollowed, up, rotationQuaternion));}_passedOrientationDeadzone(currentToTarget, forward) {const leashToFollow = this._tmpVectors[5];leashToFollow.copyFrom(currentToTarget), leashToFollow.normalize();const angle = Math.abs(math_vector/* Vector3.GetAngleBetweenVectorsOnPlane */.P.GetAngleBetweenVectorsOnPlane(forward, leashToFollow, math_vector/* Vector3.UpReadOnly */.P.UpReadOnly));return 180 * angle / Math.PI > this.orientToCameraDeadzoneDegrees;}_updateLeashing(camera) {if (this.attachedNode && this._enabled) {const oldParent = this.attachedNode.parent;this.attachedNode.setParent(null);const worldMatrix = this.attachedNode.getWorldMatrix(),currentToTarget = this._workingPosition,rotationQuaternion = this._workingQuaternion,pivot = this.attachedNode.getPivotPoint(),invertView = this._tmpInvertView;invertView.copyFrom(camera.getViewMatrix()), invertView.invert(), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(pivot, worldMatrix, currentToTarget);const position = this._tmpPosition;position.copyFromFloats(0, 0, 0), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(position, worldMatrix, position), position.scaleInPlace(-1).subtractInPlace(pivot), currentToTarget.subtractInPlace(camera.globalPosition), this.ignoreCameraPitchAndRoll && this._applyPitchOffset(invertView);let angularClamped = !1;const forward = this._tmpForward;forward.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(forward, invertView, forward);const nodeForward = this._tmpNodeForward;if (nodeForward.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(nodeForward, worldMatrix, nodeForward), this._recenterNextUpdate) currentToTarget.copyFrom(forward).scaleInPlace(this.defaultDistance);else if (this.ignoreAngleClamp) {const currentDistance = currentToTarget.length();currentToTarget.copyFrom(forward).scaleInPlace(currentDistance);} else angularClamped = this._angularClamp(invertView, currentToTarget);let distanceClamped = !1;this.ignoreDistanceClamp || (distanceClamped = this._distanceClamp(currentToTarget, angularClamped), this._applyVerticalClamp(currentToTarget)), this.useFixedVerticalOffset && (currentToTarget.y = position.y - camera.globalPosition.y + this.fixedVerticalOffset), (angularClamped || distanceClamped || this._passedOrientationDeadzone(currentToTarget, nodeForward) || this._recenterNextUpdate) && this._orientationClamp(currentToTarget, rotationQuaternion), this._workingPosition.subtractInPlace(pivot), this._recenterNextUpdate = !1, this.attachedNode.setParent(oldParent);}}_updateTransformToGoal(elapsed) {if (this.attachedNode && this.followedCamera && this._enabled) {this.attachedNode.rotationQuaternion || (this.attachedNode.rotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity());const oldParent = this.attachedNode.parent;if (this.attachedNode.setParent(null), !this.interpolatePose) return this.attachedNode.position.copyFrom(this.followedCamera.globalPosition).addInPlace(this._workingPosition), void this.attachedNode.rotationQuaternion.copyFrom(this._workingQuaternion);const currentDirection = new math_vector/* Vector3 */.P();currentDirection.copyFrom(this.attachedNode.position).subtractInPlace(this.followedCamera.globalPosition), math_vector/* Vector3.SmoothToRef */.P.SmoothToRef(currentDirection, this._workingPosition, elapsed, this.lerpTime, currentDirection), currentDirection.addInPlace(this.followedCamera.globalPosition), this.attachedNode.position.copyFrom(currentDirection);const currentRotation = new math_vector/* Quaternion */._f();currentRotation.copyFrom(this.attachedNode.rotationQuaternion), math_vector/* Quaternion.SmoothToRef */._f.SmoothToRef(currentRotation, this._workingQuaternion, elapsed, this.lerpTime, this.attachedNode.rotationQuaternion), this.attachedNode.setParent(oldParent);}}_addObservables() {this._lastTick = Date.now(), this._onBeforeRender = this._scene.onBeforeRenderObservable.add(() => {if (this.followedCamera) {const tick = Date.now();this._updateLeashing(this.followedCamera), this._updateTransformToGoal(tick - this._lastTick), this._lastTick = tick;}});}_removeObservables() {this._onBeforeRender && this._scene.onBeforeRenderObservable.remove(this._onBeforeRender);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRFeaturesManager.js
class WebXRFeatureName {}WebXRFeatureName.ANCHOR_SYSTEM = "xr-anchor-system", WebXRFeatureName.BACKGROUND_REMOVER = "xr-background-remover", WebXRFeatureName.HIT_TEST = "xr-hit-test", WebXRFeatureName.MESH_DETECTION = "xr-mesh-detection", WebXRFeatureName.PHYSICS_CONTROLLERS = "xr-physics-controller", WebXRFeatureName.PLANE_DETECTION = "xr-plane-detection", WebXRFeatureName.POINTER_SELECTION = "xr-controller-pointer-selection", WebXRFeatureName.TELEPORTATION = "xr-controller-teleportation", WebXRFeatureName.FEATURE_POINTS = "xr-feature-points", WebXRFeatureName.HAND_TRACKING = "xr-hand-tracking", WebXRFeatureName.IMAGE_TRACKING = "xr-image-tracking", WebXRFeatureName.NEAR_INTERACTION = "xr-near-interaction", WebXRFeatureName.DOM_OVERLAY = "xr-dom-overlay", WebXRFeatureName.MOVEMENT = "xr-controller-movement", WebXRFeatureName.LIGHT_ESTIMATION = "xr-light-estimation", WebXRFeatureName.EYE_TRACKING = "xr-eye-tracking", WebXRFeatureName.WALKING_LOCOMOTION = "xr-walking-locomotion", WebXRFeatureName.LAYERS = "xr-layers";class WebXRFeaturesManager {constructor(_xrSessionManager) {this._xrSessionManager = _xrSessionManager, this._features = {}, this._xrSessionManager.onXRSessionInit.add(() => {this.getEnabledFeatures().forEach((featureName) => {const feature = this._features[featureName];!feature.enabled || feature.featureImplementation.attached || feature.featureImplementation.disableAutoAttach || this.attachFeature(featureName);});}), this._xrSessionManager.onXRSessionEnded.add(() => {this.getEnabledFeatures().forEach((featureName) => {const feature = this._features[featureName];feature.enabled && feature.featureImplementation.attached && this.detachFeature(featureName);});});}static AddWebXRFeature(featureName, constructorFunction, version = 1, stable = !1) {this._AvailableFeatures[featureName] = this._AvailableFeatures[featureName] || { latest: version }, version > this._AvailableFeatures[featureName].latest && (this._AvailableFeatures[featureName].latest = version), stable && (this._AvailableFeatures[featureName].stable = version), this._AvailableFeatures[featureName][version] = constructorFunction;}static ConstructFeature(featureName, version = 1, xrSessionManager, options) {const constructorFunction = this._AvailableFeatures[featureName][version];if (!constructorFunction) throw new Error("feature not found");return constructorFunction(xrSessionManager, options);}static GetAvailableFeatures() {return Object.keys(this._AvailableFeatures);}static GetAvailableVersions(featureName) {return Object.keys(this._AvailableFeatures[featureName]);}static GetLatestVersionOfFeature(featureName) {return this._AvailableFeatures[featureName] && this._AvailableFeatures[featureName].latest || -1;}static GetStableVersionOfFeature(featureName) {return this._AvailableFeatures[featureName] && this._AvailableFeatures[featureName].stable || -1;}attachFeature(featureName) {const feature = this._features[featureName];feature && feature.enabled && !feature.featureImplementation.attached && feature.featureImplementation.attach();}detachFeature(featureName) {const feature = this._features[featureName];feature && feature.featureImplementation.attached && feature.featureImplementation.detach();}disableFeature(featureName) {const name = "string" == typeof featureName ? featureName : featureName.Name,feature = this._features[name];return !!(feature && feature.enabled) && (feature.enabled = !1, this.detachFeature(name), feature.featureImplementation.dispose(), delete this._features[name], !0);}dispose() {this.getEnabledFeatures().forEach((feature) => {this.disableFeature(feature);});}enableFeature(featureName, version = "latest", moduleOptions = {}, attachIfPossible = !0, required = !0) {const name = "string" == typeof featureName ? featureName : featureName.Name;let versionToLoad = 0;if ("string" == typeof version) {if (!version) throw new Error(`Error in provided version - ${name} (${version})`);if (versionToLoad = "stable" === version ? WebXRFeaturesManager.GetStableVersionOfFeature(name) : "latest" === version ? WebXRFeaturesManager.GetLatestVersionOfFeature(name) : +version, -1 === versionToLoad || isNaN(versionToLoad)) throw new Error(`feature not found - ${name} (${version})`);} else versionToLoad = version;const conflictingFeature = WebXRFeaturesManager._ConflictingFeatures[name];if (conflictingFeature !== void 0 && -1 !== this.getEnabledFeatures().indexOf(conflictingFeature)) throw new Error(`Feature ${name} cannot be enabled while ${conflictingFeature} is enabled.`);const feature = this._features[name],constructFunction = WebXRFeaturesManager.ConstructFeature(name, versionToLoad, this._xrSessionManager, moduleOptions);if (!constructFunction) throw new Error(`feature not found - ${name}`);feature && this.disableFeature(name);const constructed = constructFunction();if (constructed.dependsOn) {const dependentsFound = constructed.dependsOn.every((featureName) => !!this._features[featureName]);if (!dependentsFound) throw new Error(`Dependant features missing. Make sure the following features are enabled - ${constructed.dependsOn.join(", ")}`);}if (constructed.isCompatible()) return this._features[name] = { featureImplementation: constructed, enabled: !0, version: versionToLoad, required }, attachIfPossible ? this._xrSessionManager.session && !this._features[name].featureImplementation.attached && this.attachFeature(name) : this._features[name].featureImplementation.disableAutoAttach = !0, this._features[name].featureImplementation;if (required) throw new Error("required feature not compatible");else return tools/* Tools.Warn */.w1.Warn(`Feature ${name} not compatible with the current environment/browser and was not enabled.`), constructed;}getEnabledFeature(featureName) {return this._features[featureName] && this._features[featureName].featureImplementation;}getEnabledFeatures() {return Object.keys(this._features);}async _extendXRSessionInitObject(xrSessionInit) {const enabledFeatures = this.getEnabledFeatures();for (const featureName of enabledFeatures) {const feature = this._features[featureName],nativeName = feature.featureImplementation.xrNativeFeatureName;if (nativeName && (feature.required ? (xrSessionInit.requiredFeatures = xrSessionInit.requiredFeatures || [], -1 === xrSessionInit.requiredFeatures.indexOf(nativeName) && xrSessionInit.requiredFeatures.push(nativeName)) : (xrSessionInit.optionalFeatures = xrSessionInit.optionalFeatures || [], -1 === xrSessionInit.optionalFeatures.indexOf(nativeName) && xrSessionInit.optionalFeatures.push(nativeName))), feature.featureImplementation.getXRSessionInitExtension) {const extended = await feature.featureImplementation.getXRSessionInitExtension();xrSessionInit = { ...xrSessionInit, ...extended };}}return xrSessionInit;}}WebXRFeaturesManager._AvailableFeatures = {}, WebXRFeaturesManager._ConflictingFeatures = { [WebXRFeatureName.TELEPORTATION]: WebXRFeatureName.MOVEMENT, [WebXRFeatureName.MOVEMENT]: WebXRFeatureName.TELEPORTATION };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRAbstractFeature.js
class WebXRAbstractFeature {constructor(_xrSessionManager) {this._xrSessionManager = _xrSessionManager, this._attached = !1, this._removeOnDetach = [], this.isDisposed = !1, this.disableAutoAttach = !1, this.xrNativeFeatureName = "";}get attached() {return this._attached;}attach(force) {if (this.isDisposed) return !1;if (!!force) this.attached && this.detach();else if (this.attached) return !1;return this._attached = !0, this._addNewAttachObserver(this._xrSessionManager.onXRFrameObservable, (frame) => this._onXRFrame(frame)), !0;}detach() {return this._attached ? (this._attached = !1, this._removeOnDetach.forEach((toRemove) => {toRemove.observable.remove(toRemove.observer);}), !0) : (this.disableAutoAttach = !0, !1);}dispose() {this.detach(), this.isDisposed = !0;}isCompatible() {return !0;}_addNewAttachObserver(observable, callback) {this._removeOnDetach.push({ observable, observer: observable.add(callback) });}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/physicsJoint.js
class PhysicsJoint {constructor(type, jointData) {this.type = type, this.jointData = jointData, jointData.nativeParams = jointData.nativeParams || {};}get physicsJoint() {return this._physicsJoint;}set physicsJoint(newJoint) {this._physicsJoint, this._physicsJoint = newJoint;}set physicsPlugin(physicsPlugin) {this._physicsPlugin = physicsPlugin;}executeNativeFunction(func) {func(this._physicsPlugin.world, this._physicsJoint);}}PhysicsJoint.DistanceJoint = 0, PhysicsJoint.HingeJoint = 1, PhysicsJoint.BallAndSocketJoint = 2, PhysicsJoint.WheelJoint = 3, PhysicsJoint.SliderJoint = 4, PhysicsJoint.PrismaticJoint = 5, PhysicsJoint.UniversalJoint = 6, PhysicsJoint.Hinge2Joint = PhysicsJoint.WheelJoint, PhysicsJoint.PointToPointJoint = 8, PhysicsJoint.SpringJoint = 9, PhysicsJoint.LockJoint = 10;class DistanceJoint extends PhysicsJoint {constructor(jointData) {super(PhysicsJoint.DistanceJoint, jointData);}updateDistance(maxDistance, minDistance) {this._physicsPlugin.updateDistanceJoint(this, maxDistance, minDistance);}}class MotorEnabledJoint extends PhysicsJoint {constructor(type, jointData) {super(type, jointData);}setMotor(force, maxForce) {this._physicsPlugin.setMotor(this, force || 0, maxForce);}setLimit(upperLimit, lowerLimit) {this._physicsPlugin.setLimit(this, upperLimit, lowerLimit);}}class HingeJoint extends MotorEnabledJoint {constructor(jointData) {super(PhysicsJoint.HingeJoint, jointData);}setMotor(force, maxForce) {this._physicsPlugin.setMotor(this, force || 0, maxForce);}setLimit(upperLimit, lowerLimit) {this._physicsPlugin.setLimit(this, upperLimit, lowerLimit);}}class Hinge2Joint extends MotorEnabledJoint {constructor(jointData) {super(PhysicsJoint.Hinge2Joint, jointData);}setMotor(targetSpeed, maxForce, motorIndex = 0) {this._physicsPlugin.setMotor(this, targetSpeed || 0, maxForce, motorIndex);}setLimit(upperLimit, lowerLimit, motorIndex = 0) {this._physicsPlugin.setLimit(this, upperLimit, lowerLimit, motorIndex);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/physicsImpostor.js
Meshes_mesh/* Mesh._PhysicsImpostorParser */.Kj._PhysicsImpostorParser = function (scene, physicObject, jsonObject) {return new PhysicsImpostor(physicObject, jsonObject.physicsImpostor, { mass: jsonObject.physicsMass, friction: jsonObject.physicsFriction, restitution: jsonObject.physicsRestitution }, scene);};class PhysicsImpostor {get isDisposed() {return this._isDisposed;}get mass() {return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0;}set mass(value) {this.setMass(value);}get friction() {return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0;}set friction(value) {this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, value);}get restitution() {return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0;}set restitution(value) {this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, value);}get pressure() {if (!this._physicsEngine) return 0;const plugin = this._physicsEngine.getPhysicsPlugin();return plugin.setBodyPressure ? plugin.getBodyPressure(this) : 0;}set pressure(value) {if (this._physicsEngine) {const plugin = this._physicsEngine.getPhysicsPlugin();plugin.setBodyPressure && plugin.setBodyPressure(this, value);}}get stiffness() {if (!this._physicsEngine) return 0;const plugin = this._physicsEngine.getPhysicsPlugin();return plugin.getBodyStiffness ? plugin.getBodyStiffness(this) : 0;}set stiffness(value) {if (this._physicsEngine) {const plugin = this._physicsEngine.getPhysicsPlugin();plugin.setBodyStiffness && plugin.setBodyStiffness(this, value);}}get velocityIterations() {if (!this._physicsEngine) return 0;const plugin = this._physicsEngine.getPhysicsPlugin();return plugin.getBodyVelocityIterations ? plugin.getBodyVelocityIterations(this) : 0;}set velocityIterations(value) {if (this._physicsEngine) {const plugin = this._physicsEngine.getPhysicsPlugin();plugin.setBodyVelocityIterations && plugin.setBodyVelocityIterations(this, value);}}get positionIterations() {if (!this._physicsEngine) return 0;const plugin = this._physicsEngine.getPhysicsPlugin();return plugin.getBodyPositionIterations ? plugin.getBodyPositionIterations(this) : 0;}set positionIterations(value) {if (this._physicsEngine) {const plugin = this._physicsEngine.getPhysicsPlugin();plugin.setBodyPositionIterations && plugin.setBodyPositionIterations(this, value);}}constructor(object, type, _options = { mass: 0 }, _scene) {return (this.object = object, this.type = type, this._options = _options, this._scene = _scene, this._pluginData = {}, this._bodyUpdateRequired = !1, this._onBeforePhysicsStepCallbacks = [], this._onAfterPhysicsStepCallbacks = [], this._onPhysicsCollideCallbacks = [], this._deltaPosition = math_vector/* Vector3.Zero */.P.Zero(), this._isDisposed = !1, this.soft = !1, this.segments = 0, this._tmpQuat = new math_vector/* Quaternion */._f(), this._tmpQuat2 = new math_vector/* Quaternion */._f(), this.beforeStep = () => {this._physicsEngine && (this.object.translate(this._deltaPosition, -1), this._deltaRotationConjugated && this.object.rotationQuaternion && this.object.rotationQuaternion.multiplyToRef(this._deltaRotationConjugated, this.object.rotationQuaternion), this.object.computeWorldMatrix(!1), this.object.parent && this.object.rotationQuaternion ? (this.getParentsRotation(), this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this._tmpQuat)) : this._tmpQuat.copyFrom(this.object.rotationQuaternion || new math_vector/* Quaternion */._f()), !this._options.disableBidirectionalTransformation && this.object.rotationQuaternion && this._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(this, this.object.getAbsolutePosition(), this._tmpQuat), this._onBeforePhysicsStepCallbacks.forEach((func) => {func(this);}));}, this.afterStep = () => {this._physicsEngine && (this._onAfterPhysicsStepCallbacks.forEach((func) => {func(this);}), this._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(this), this.object.parent && this.object.rotationQuaternion && (this.getParentsRotation(), this._tmpQuat.conjugateInPlace(), this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this.object.rotationQuaternion)), this.object.setAbsolutePosition(this.object.position), this._deltaRotation ? (this.object.rotationQuaternion && this.object.rotationQuaternion.multiplyToRef(this._deltaRotation, this.object.rotationQuaternion), this._deltaPosition.applyRotationQuaternionToRef(this._deltaRotation, PhysicsImpostor._TmpVecs[0]), this.object.translate(PhysicsImpostor._TmpVecs[0], 1)) : this.object.translate(this._deltaPosition, 1), this.object.computeWorldMatrix(!0));}, this.onCollideEvent = null, this.onCollide = (e) => {if (!this._onPhysicsCollideCallbacks.length && !this.onCollideEvent) return;if (!this._physicsEngine) return;const otherImpostor = this._physicsEngine.getImpostorWithPhysicsBody(e.body);otherImpostor && (this.onCollideEvent && this.onCollideEvent(this, otherImpostor), this._onPhysicsCollideCallbacks.filter((obj) => -1 !== obj.otherImpostors.indexOf(otherImpostor)).forEach((obj) => {obj.callback(this, otherImpostor, e.point, e.distance, e.impulse, e.normal);}));}, !this.object) ? void logger/* Logger.Error */.Y.Error("No object was provided. A physics object is obligatory") : void (this.object.parent && 0 !== _options.mass && logger/* Logger.Warn */.Y.Warn("A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur."), !this._scene && object.getScene && (this._scene = object.getScene()), this._scene && (100 < this.type && (this.soft = !0), this._physicsEngine = this._scene.getPhysicsEngine(), this._physicsEngine ? (!this.object.rotationQuaternion && (this.object.rotation ? this.object.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z) : this.object.rotationQuaternion = new math_vector/* Quaternion */._f()), this._options.mass = void 0 === _options.mass ? 0 : _options.mass, this._options.friction = void 0 === _options.friction ? .2 : _options.friction, this._options.restitution = void 0 === _options.restitution ? .2 : _options.restitution, this.soft && (this._options.mass = 0 < this._options.mass ? this._options.mass : 1, this._options.pressure = void 0 === _options.pressure ? 200 : _options.pressure, this._options.stiffness = void 0 === _options.stiffness ? 1 : _options.stiffness, this._options.velocityIterations = void 0 === _options.velocityIterations ? 20 : _options.velocityIterations, this._options.positionIterations = void 0 === _options.positionIterations ? 20 : _options.positionIterations, this._options.fixedPoints = void 0 === _options.fixedPoints ? 0 : _options.fixedPoints, this._options.margin = void 0 === _options.margin ? 0 : _options.margin, this._options.damping = void 0 === _options.damping ? 0 : _options.damping, this._options.path = void 0 === _options.path ? null : _options.path, this._options.shape = void 0 === _options.shape ? null : _options.shape), this._joints = [], !this.object.parent || this._options.ignoreParent ? this._init() : this.object.parent.physicsImpostor && logger/* Logger.Warn */.Y.Warn("You must affect impostors to children before affecting impostor to parent.")) : logger/* Logger.Error */.Y.Error("Physics not enabled. Please use scene.enablePhysics(...) before creating impostors.")));}_init() {this._physicsEngine && (this._physicsEngine.removeImpostor(this), this.physicsBody = null, this._parent = this._parent || this._getPhysicsParent(), !this._isDisposed && (!this.parent || this._options.ignoreParent) && this._physicsEngine.addImpostor(this));}_getPhysicsParent() {if (this.object.parent instanceof abstractMesh/* AbstractMesh */.x) {const parentMesh = this.object.parent;return parentMesh.physicsImpostor;}return null;}isBodyInitRequired() {return this._bodyUpdateRequired || !this._physicsBody && (!this._parent || !!this._options.ignoreParent);}setScalingUpdated() {this.forceUpdate();}forceUpdate() {this._init(), this.parent && !this._options.ignoreParent && this.parent.forceUpdate();}get physicsBody() {return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody;}get parent() {return !this._options.ignoreParent && this._parent ? this._parent : null;}set parent(value) {this._parent = value;}set physicsBody(physicsBody) {this._physicsBody && this._physicsEngine && this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this), this._physicsBody = physicsBody, this.resetUpdateFlags();}resetUpdateFlags() {this._bodyUpdateRequired = !1;}getObjectExtents() {if (this.object.getBoundingInfo) {const q = this.object.rotationQuaternion,scaling = this.object.scaling.clone();this.object.rotationQuaternion = PhysicsImpostor.IDENTITY_QUATERNION;const worldMatrix = this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0);worldMatrix && worldMatrix.decompose(scaling, void 0, void 0);const boundingInfo = this.object.getBoundingInfo(),size = boundingInfo.boundingBox.extendSize.scale(2).multiplyInPlace(scaling);return size.x = Math.abs(size.x), size.y = Math.abs(size.y), size.z = Math.abs(size.z), this.object.rotationQuaternion = q, this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0), size;}return PhysicsImpostor.DEFAULT_OBJECT_SIZE;}getObjectCenter() {if (this.object.getBoundingInfo) {const boundingInfo = this.object.getBoundingInfo();return boundingInfo.boundingBox.centerWorld;}return this.object.position;}getParam(paramName) {return this._options[paramName];}setParam(paramName, value) {this._options[paramName] = value, this._bodyUpdateRequired = !0;}setMass(mass) {this.getParam("mass") !== mass && this.setParam("mass", mass), this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyMass(this, mass);}getLinearVelocity() {return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : math_vector/* Vector3.Zero */.P.Zero();}setLinearVelocity(velocity) {this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, velocity);}getAngularVelocity() {return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : math_vector/* Vector3.Zero */.P.Zero();}setAngularVelocity(velocity) {this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, velocity);}executeNativeFunction(func) {this._physicsEngine && func(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody);}registerBeforePhysicsStep(func) {this._onBeforePhysicsStepCallbacks.push(func);}unregisterBeforePhysicsStep(func) {const index = this._onBeforePhysicsStepCallbacks.indexOf(func);-1 < index ? this._onBeforePhysicsStepCallbacks.splice(index, 1) : logger/* Logger.Warn */.Y.Warn("Function to remove was not found");}registerAfterPhysicsStep(func) {this._onAfterPhysicsStepCallbacks.push(func);}unregisterAfterPhysicsStep(func) {const index = this._onAfterPhysicsStepCallbacks.indexOf(func);-1 < index ? this._onAfterPhysicsStepCallbacks.splice(index, 1) : logger/* Logger.Warn */.Y.Warn("Function to remove was not found");}registerOnPhysicsCollide(collideAgainst, func) {const collidedAgainstList = collideAgainst instanceof Array ? collideAgainst : [collideAgainst];this._onPhysicsCollideCallbacks.push({ callback: func, otherImpostors: collidedAgainstList });}unregisterOnPhysicsCollide(collideAgainst, func) {const collidedAgainstList = collideAgainst instanceof Array ? collideAgainst : [collideAgainst];let index = -1;const found = this._onPhysicsCollideCallbacks.some((cbDef, idx) => {if (cbDef.callback === func && cbDef.otherImpostors.length === collidedAgainstList.length) {const sameList = cbDef.otherImpostors.every((impostor) => -1 < collidedAgainstList.indexOf(impostor));return sameList && (index = idx), sameList;}return !1;});found ? this._onPhysicsCollideCallbacks.splice(index, 1) : logger/* Logger.Warn */.Y.Warn("Function to remove was not found");}getParentsRotation() {let parent = this.object.parent;for (this._tmpQuat.copyFromFloats(0, 0, 0, 1); parent;) parent.rotationQuaternion ? this._tmpQuat2.copyFrom(parent.rotationQuaternion) : math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(parent.rotation.y, parent.rotation.x, parent.rotation.z, this._tmpQuat2), this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat), parent = parent.parent;return this._tmpQuat;}applyForce(force, contactPoint) {return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyForce(this, force, contactPoint), this;}applyImpulse(force, contactPoint) {return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyImpulse(this, force, contactPoint), this;}createJoint(otherImpostor, jointType, jointData) {const joint = new PhysicsJoint(jointType, jointData);return this.addJoint(otherImpostor, joint), this;}addJoint(otherImpostor, joint) {return this._joints.push({ otherImpostor: otherImpostor, joint: joint }), this._physicsEngine && this._physicsEngine.addJoint(this, otherImpostor, joint), this;}addAnchor(otherImpostor, width, height, influence, noCollisionBetweenLinkedBodies) {if (!this._physicsEngine) return this;const plugin = this._physicsEngine.getPhysicsPlugin();return plugin.appendAnchor ? (this._physicsEngine && plugin.appendAnchor(this, otherImpostor, width, height, influence, noCollisionBetweenLinkedBodies), this) : this;}addHook(otherImpostor, length, influence, noCollisionBetweenLinkedBodies) {if (!this._physicsEngine) return this;const plugin = this._physicsEngine.getPhysicsPlugin();return plugin.appendAnchor ? (this._physicsEngine && plugin.appendHook(this, otherImpostor, length, influence, noCollisionBetweenLinkedBodies), this) : this;}sleep() {return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().sleepBody(this), this;}wakeUp() {return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().wakeUpBody(this), this;}clone(newObject) {return newObject ? new PhysicsImpostor(newObject, this.type, this._options, this._scene) : null;}dispose() {this._physicsEngine && (this._joints.forEach((j) => {this._physicsEngine && this._physicsEngine.removeJoint(this, j.otherImpostor, j.joint);}), this._physicsEngine.removeImpostor(this), this.parent && this.parent.forceUpdate(), this._isDisposed = !0);}setDeltaPosition(position) {this._deltaPosition.copyFrom(position);}setDeltaRotation(rotation) {this._deltaRotation || (this._deltaRotation = new math_vector/* Quaternion */._f()), this._deltaRotation.copyFrom(rotation), this._deltaRotationConjugated = this._deltaRotation.conjugate();}getBoxSizeToRef(result) {return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, result), this;}getRadius() {return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0;}syncBoneWithImpostor(bone, boneMesh, jointPivot, distToJoint, adjustRotation) {const tempVec = PhysicsImpostor._TmpVecs[0],mesh = this.object;if (mesh.rotationQuaternion) if (adjustRotation) {const tempQuat = PhysicsImpostor._TmpQuat;mesh.rotationQuaternion.multiplyToRef(adjustRotation, tempQuat), bone.setRotationQuaternion(tempQuat, math_axis/* Space.WORLD */.T.WORLD, boneMesh);} else bone.setRotationQuaternion(mesh.rotationQuaternion, math_axis/* Space.WORLD */.T.WORLD, boneMesh);tempVec.x = 0, tempVec.y = 0, tempVec.z = 0, jointPivot && (tempVec.x = jointPivot.x, tempVec.y = jointPivot.y, tempVec.z = jointPivot.z, bone.getDirectionToRef(tempVec, boneMesh, tempVec), (distToJoint === void 0 || null === distToJoint) && (distToJoint = jointPivot.length()), tempVec.x *= distToJoint, tempVec.y *= distToJoint, tempVec.z *= distToJoint), bone.getParent() ? (tempVec.addInPlace(mesh.getAbsolutePosition()), bone.setAbsolutePosition(tempVec, boneMesh)) : (boneMesh.setAbsolutePosition(mesh.getAbsolutePosition()), boneMesh.position.x -= tempVec.x, boneMesh.position.y -= tempVec.y, boneMesh.position.z -= tempVec.z);}syncImpostorWithBone(bone, boneMesh, jointPivot, distToJoint, adjustRotation, boneAxis) {const mesh = this.object;if (mesh.rotationQuaternion) if (adjustRotation) {const tempQuat = PhysicsImpostor._TmpQuat;bone.getRotationQuaternionToRef(math_axis/* Space.WORLD */.T.WORLD, boneMesh, tempQuat), tempQuat.multiplyToRef(adjustRotation, mesh.rotationQuaternion);} else bone.getRotationQuaternionToRef(math_axis/* Space.WORLD */.T.WORLD, boneMesh, mesh.rotationQuaternion);const pos = PhysicsImpostor._TmpVecs[0],boneDir = PhysicsImpostor._TmpVecs[1];boneAxis || (boneAxis = PhysicsImpostor._TmpVecs[2], boneAxis.x = 0, boneAxis.y = 1, boneAxis.z = 0), bone.getDirectionToRef(boneAxis, boneMesh, boneDir), bone.getAbsolutePositionToRef(boneMesh, pos), (distToJoint === void 0 || null === distToJoint) && jointPivot && (distToJoint = jointPivot.length()), distToJoint !== void 0 && null !== distToJoint && (pos.x += boneDir.x * distToJoint, pos.y += boneDir.y * distToJoint, pos.z += boneDir.z * distToJoint), mesh.setAbsolutePosition(pos);}}PhysicsImpostor.DEFAULT_OBJECT_SIZE = new math_vector/* Vector3 */.P(1, 1, 1), PhysicsImpostor.IDENTITY_QUATERNION = math_vector/* Quaternion.Identity */._f.Identity(), PhysicsImpostor._TmpVecs = arrayTools/* ArrayTools.BuildArray */.B.BuildArray(3, math_vector/* Vector3.Zero */.P.Zero), PhysicsImpostor._TmpQuat = math_vector/* Quaternion.Identity */._f.Identity(), PhysicsImpostor.NoImpostor = 0, PhysicsImpostor.SphereImpostor = 1, PhysicsImpostor.BoxImpostor = 2, PhysicsImpostor.PlaneImpostor = 3, PhysicsImpostor.MeshImpostor = 4, PhysicsImpostor.CapsuleImpostor = 6, PhysicsImpostor.CylinderImpostor = 7, PhysicsImpostor.ParticleImpostor = 8, PhysicsImpostor.HeightmapImpostor = 9, PhysicsImpostor.ConvexHullImpostor = 10, PhysicsImpostor.CustomImpostor = 100, PhysicsImpostor.RopeImpostor = 101, PhysicsImpostor.ClothImpostor = 102, PhysicsImpostor.SoftbodyImpostor = 103;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Loading/sceneLoader.js
var sceneLoader = __webpack_require__("./node_modules/@babylonjs/core/Loading/sceneLoader.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/pushMaterial.js
var pushMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/pushMaterial.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.js
var NodeMaterialBlockConnectionPointTypes;(function (NodeMaterialBlockConnectionPointTypes) {NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.Float = 1] = "Float", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.Int = 2] = "Int", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.Vector2 = 4] = "Vector2", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.Vector3 = 8] = "Vector3", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.Vector4 = 16] = "Vector4", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.Color3 = 32] = "Color3", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.Color4 = 64] = "Color4", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.Matrix = 128] = "Matrix", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.Object = 256] = "Object", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.AutoDetect = 1024] = "AutoDetect", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.BasedOnInput = 2048] = "BasedOnInput", NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes.All = 4095] = "All";})(NodeMaterialBlockConnectionPointTypes || (NodeMaterialBlockConnectionPointTypes = {}));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockTargets.js
var NodeMaterialBlockTargets;(function (NodeMaterialBlockTargets) {NodeMaterialBlockTargets[NodeMaterialBlockTargets.Vertex = 1] = "Vertex", NodeMaterialBlockTargets[NodeMaterialBlockTargets.Fragment = 2] = "Fragment", NodeMaterialBlockTargets[NodeMaterialBlockTargets.Neutral = 4] = "Neutral", NodeMaterialBlockTargets[NodeMaterialBlockTargets.VertexAndFragment = 3] = "VertexAndFragment";})(NodeMaterialBlockTargets || (NodeMaterialBlockTargets = {}));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effect.js
var Materials_effect = __webpack_require__("./node_modules/@babylonjs/core/Materials/effect.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialBuildState.js
class NodeMaterialBuildState {constructor() {this.supportUniformBuffers = !1, this.attributes = [], this.uniforms = [], this.constants = [], this.samplers = [], this.functions = {}, this.extensions = {}, this.counters = {}, this._attributeDeclaration = "", this._uniformDeclaration = "", this._constantDeclaration = "", this._samplerDeclaration = "", this._varyingTransfer = "", this._injectAtEnd = "", this._repeatableContentAnchorIndex = 0, this._builtCompilationString = "", this.compilationString = "";}finalize(state) {const emitComments = state.sharedData.emitComments,isFragmentMode = this.target === NodeMaterialBlockTargets.Fragment;this.compilationString = `\r\n${emitComments ? "//Entry point\r\n" : ""}void main(void) {\r\n${this.compilationString}`, this._constantDeclaration && (this.compilationString = `\r\n${emitComments ? "//Constants\r\n" : ""}${this._constantDeclaration}\r\n${this.compilationString}`);let functionCode = "";for (const functionName in this.functions) functionCode += this.functions[functionName] + `\r\n`;for (const extensionName in this.compilationString = `\r\n${functionCode}\r\n${this.compilationString}`, !isFragmentMode && this._varyingTransfer && (this.compilationString = `${this.compilationString}\r\n${this._varyingTransfer}`), this._injectAtEnd && (this.compilationString = `${this.compilationString}\r\n${this._injectAtEnd}`), this.compilationString = `${this.compilationString}\r\n}`, this.sharedData.varyingDeclaration && (this.compilationString = `\r\n${emitComments ? "//Varyings\r\n" : ""}${this.sharedData.varyingDeclaration}\r\n${this.compilationString}`), this._samplerDeclaration && (this.compilationString = `\r\n${emitComments ? "//Samplers\r\n" : ""}${this._samplerDeclaration}\r\n${this.compilationString}`), this._uniformDeclaration && (this.compilationString = `\r\n${emitComments ? "//Uniforms\r\n" : ""}${this._uniformDeclaration}\r\n${this.compilationString}`), this._attributeDeclaration && !isFragmentMode && (this.compilationString = `\r\n${emitComments ? "//Attributes\r\n" : ""}${this._attributeDeclaration}\r\n${this.compilationString}`), this.compilationString = "precision highp float;\r\n" + this.compilationString, this.extensions) {const extension = this.extensions[extensionName];this.compilationString = `\r\n${extension}\r\n${this.compilationString}`;}this._builtCompilationString = this.compilationString;}get _repeatableContentAnchor() {return `###___ANCHOR${this._repeatableContentAnchorIndex++}___###`;}_getFreeVariableName(prefix) {return (prefix = prefix.replace(/[^a-zA-Z_]+/g, ""), void 0 === this.sharedData.variableNames[prefix]) ? (this.sharedData.variableNames[prefix] = 0, "output" === prefix || "texture" === prefix ? prefix + this.sharedData.variableNames[prefix] : prefix) : (this.sharedData.variableNames[prefix]++, prefix + this.sharedData.variableNames[prefix]);}_getFreeDefineName(prefix) {return void 0 === this.sharedData.defineNames[prefix] ? this.sharedData.defineNames[prefix] = 0 : this.sharedData.defineNames[prefix]++, prefix + this.sharedData.defineNames[prefix];}_excludeVariableName(name) {this.sharedData.variableNames[name] = 0;}_emit2DSampler(name) {0 > this.samplers.indexOf(name) && (this._samplerDeclaration += `uniform sampler2D ${name};\r\n`, this.samplers.push(name));}_getGLType(type) {return type === NodeMaterialBlockConnectionPointTypes.Float ? "float" : type === NodeMaterialBlockConnectionPointTypes.Int ? "int" : type === NodeMaterialBlockConnectionPointTypes.Vector2 ? "vec2" : type === NodeMaterialBlockConnectionPointTypes.Color3 || type === NodeMaterialBlockConnectionPointTypes.Vector3 ? "vec3" : type === NodeMaterialBlockConnectionPointTypes.Color4 || type === NodeMaterialBlockConnectionPointTypes.Vector4 ? "vec4" : type === NodeMaterialBlockConnectionPointTypes.Matrix ? "mat4" : "";}_emitExtension(name, extension, define = "") {this.extensions[name] || (define && (extension = `#if ${define}\r\n${extension}\r\n#endif`), this.extensions[name] = extension);}_emitFunction(name, code, comments) {this.functions[name] || (this.sharedData.emitComments && (code = comments + `\r\n` + code), this.functions[name] = code);}_emitCodeFromInclude(includeName, comments, options) {if (options && options.repeatKey) return `#include<${includeName}>${options.substitutionVars ? "(" + options.substitutionVars + ")" : ""}[0..${options.repeatKey}]\r\n`;let code = Materials_effect/* Effect.IncludesShadersStore */.Q.IncludesShadersStore[includeName] + "\r\n";if (this.sharedData.emitComments && (code = comments + `\r\n` + code), !options) return code;if (options.replaceStrings) for (let index = 0; index < options.replaceStrings.length; index++) {const replaceString = options.replaceStrings[index];code = code.replace(replaceString.search, replaceString.replace);}return code;}_emitFunctionFromInclude(includeName, comments, options, storeKey = "") {const key = includeName + storeKey;if (!this.functions[key]) {if (!options || !options.removeAttributes && !options.removeUniforms && !options.removeVaryings && !options.removeIfDef && !options.replaceStrings) return this.functions[key] = options && options.repeatKey ? `#include<${includeName}>${options.substitutionVars ? "(" + options.substitutionVars + ")" : ""}[0..${options.repeatKey}]\r\n` : `#include<${includeName}>${(null === options || void 0 === options ? void 0 : options.substitutionVars) ? "(" + (null === options || void 0 === options ? void 0 : options.substitutionVars) + ")" : ""}\r\n`, void (this.sharedData.emitComments && (this.functions[key] = comments + `\r\n` + this.functions[key]));if (this.functions[key] = Materials_effect/* Effect.IncludesShadersStore */.Q.IncludesShadersStore[includeName], this.sharedData.emitComments && (this.functions[key] = comments + `\r\n` + this.functions[key]), options.removeIfDef && (this.functions[key] = this.functions[key].replace(/^\s*?#ifdef.+$/gm, ""), this.functions[key] = this.functions[key].replace(/^\s*?#endif.*$/gm, ""), this.functions[key] = this.functions[key].replace(/^\s*?#else.*$/gm, ""), this.functions[key] = this.functions[key].replace(/^\s*?#elif.*$/gm, "")), options.removeAttributes && (this.functions[key] = this.functions[key].replace(/^\s*?attribute.+$/gm, "")), options.removeUniforms && (this.functions[key] = this.functions[key].replace(/^\s*?uniform.+$/gm, "")), options.removeVaryings && (this.functions[key] = this.functions[key].replace(/^\s*?varying.+$/gm, "")), options.replaceStrings) for (let index = 0; index < options.replaceStrings.length; index++) {const replaceString = options.replaceStrings[index];this.functions[key] = this.functions[key].replace(replaceString.search, replaceString.replace);}}}_registerTempVariable(name) {return !(-1 !== this.sharedData.temps.indexOf(name)) && (this.sharedData.temps.push(name), !0);}_emitVaryingFromString(name, type, define = "", notDefine = !1) {return !(-1 !== this.sharedData.varyings.indexOf(name)) && (this.sharedData.varyings.push(name), define && (define.startsWith("defined(") ? this.sharedData.varyingDeclaration += `#if ${define}\r\n` : this.sharedData.varyingDeclaration += `${notDefine ? "#ifndef" : "#ifdef"} ${define}\r\n`), this.sharedData.varyingDeclaration += `varying ${type} ${name};\r\n`, define && (this.sharedData.varyingDeclaration += `#endif\r\n`), !0);}_emitUniformFromString(name, type, define = "", notDefine = !1) {-1 !== this.uniforms.indexOf(name) || (this.uniforms.push(name), define && (define.startsWith("defined(") ? this._uniformDeclaration += `#if ${define}\r\n` : this._uniformDeclaration += `${notDefine ? "#ifndef" : "#ifdef"} ${define}\r\n`), this._uniformDeclaration += `uniform ${type} ${name};\r\n`, define && (this._uniformDeclaration += `#endif\r\n`));}_emitFloat(value) {return value.toString() === value.toFixed(0) ? `${value}.0` : value.toString();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialBuildStateSharedData.js
class NodeMaterialBuildStateSharedData {constructor() {this.temps = [], this.varyings = [], this.varyingDeclaration = "", this.inputBlocks = [], this.textureBlocks = [], this.bindableBlocks = [], this.forcedBindableBlocks = [], this.blocksWithFallbacks = [], this.blocksWithDefines = [], this.repeatableContentBlocks = [], this.dynamicUniformBlocks = [], this.blockingBlocks = [], this.animatedInputs = [], this.variableNames = {}, this.defineNames = {}, this.hints = { needWorldViewMatrix: !1, needWorldViewProjectionMatrix: !1, needAlphaBlending: !1, needAlphaTesting: !1 }, this.checks = { emitVertex: !1, emitFragment: !1, notConnectedNonOptionalInputs: [] }, this.allowEmptyVertexProgram = !1, this.variableNames.position = 0, this.variableNames.normal = 0, this.variableNames.tangent = 0, this.variableNames.uv = 0, this.variableNames.uv2 = 0, this.variableNames.uv3 = 0, this.variableNames.uv4 = 0, this.variableNames.uv5 = 0, this.variableNames.uv6 = 0, this.variableNames.color = 0, this.variableNames.matricesIndices = 0, this.variableNames.matricesWeights = 0, this.variableNames.matricesIndicesExtra = 0, this.variableNames.matricesWeightsExtra = 0, this.variableNames.diffuseBase = 0, this.variableNames.specularBase = 0, this.variableNames.worldPos = 0, this.variableNames.shadow = 0, this.variableNames.view = 0, this.variableNames.vTBN = 0, this.defineNames.MAINUV0 = 0, this.defineNames.MAINUV1 = 0, this.defineNames.MAINUV2 = 0, this.defineNames.MAINUV3 = 0, this.defineNames.MAINUV4 = 0, this.defineNames.MAINUV5 = 0, this.defineNames.MAINUV6 = 0, this.defineNames.MAINUV7 = 0;}emitErrors() {let errorMessage = "";this.checks.emitVertex || this.allowEmptyVertexProgram || (errorMessage += "NodeMaterial does not have a vertex output. You need to at least add a block that generates a glPosition value.\r\n"), this.checks.emitFragment || (errorMessage += "NodeMaterial does not have a fragment output. You need to at least add a block that generates a glFragColor value.\r\n");for (const notConnectedInput of this.checks.notConnectedNonOptionalInputs) errorMessage += `input ${notConnectedInput.name} from block ${notConnectedInput.ownerBlock.name}[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\r\n`;if (errorMessage) throw "Build of NodeMaterial failed:\r\n" + errorMessage;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialDefines.js
var materialDefines = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialDefines.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/buffer.js
var Buffers_buffer = __webpack_require__("./node_modules/@babylonjs/core/Buffers/buffer.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialBlockConnectionPoint.js
var NodeMaterialConnectionPointCompatibilityStates;(function (NodeMaterialConnectionPointCompatibilityStates) {NodeMaterialConnectionPointCompatibilityStates[NodeMaterialConnectionPointCompatibilityStates.Compatible = 0] = "Compatible", NodeMaterialConnectionPointCompatibilityStates[NodeMaterialConnectionPointCompatibilityStates.TypeIncompatible = 1] = "TypeIncompatible", NodeMaterialConnectionPointCompatibilityStates[NodeMaterialConnectionPointCompatibilityStates.TargetIncompatible = 2] = "TargetIncompatible", NodeMaterialConnectionPointCompatibilityStates[NodeMaterialConnectionPointCompatibilityStates.HierarchyIssue = 3] = "HierarchyIssue";})(NodeMaterialConnectionPointCompatibilityStates || (NodeMaterialConnectionPointCompatibilityStates = {}));var NodeMaterialConnectionPointDirection;(function (NodeMaterialConnectionPointDirection) {NodeMaterialConnectionPointDirection[NodeMaterialConnectionPointDirection.Input = 0] = "Input", NodeMaterialConnectionPointDirection[NodeMaterialConnectionPointDirection.Output = 1] = "Output";})(NodeMaterialConnectionPointDirection || (NodeMaterialConnectionPointDirection = {}));class NodeMaterialConnectionPoint {static AreEquivalentTypes(type1, type2) {switch (type1) {case NodeMaterialBlockConnectionPointTypes.Vector3:{if (type2 === NodeMaterialBlockConnectionPointTypes.Color3) return !0;break;}case NodeMaterialBlockConnectionPointTypes.Vector4:{if (type2 === NodeMaterialBlockConnectionPointTypes.Color4) return !0;break;}case NodeMaterialBlockConnectionPointTypes.Color3:{if (type2 === NodeMaterialBlockConnectionPointTypes.Vector3) return !0;break;}case NodeMaterialBlockConnectionPointTypes.Color4:{if (type2 === NodeMaterialBlockConnectionPointTypes.Vector4) return !0;break;}}return !1;}get direction() {return this._direction;}get associatedVariableName() {return this._ownerBlock.isInput ? this._ownerBlock.associatedVariableName : this._enforceAssociatedVariableName && this._associatedVariableName || !this._connectedPoint ? this._associatedVariableName : this._connectedPoint.associatedVariableName;}set associatedVariableName(value) {this._associatedVariableName = value;}get innerType() {return this._linkedConnectionSource && this._linkedConnectionSource.isConnected ? this.type : this._type;}get type() {if (this._type === NodeMaterialBlockConnectionPointTypes.AutoDetect) {if (this._ownerBlock.isInput) return this._ownerBlock.type;if (this._connectedPoint) return this._connectedPoint.type;if (this._linkedConnectionSource && this._linkedConnectionSource.isConnected) return this._linkedConnectionSource.type;}if (this._type === NodeMaterialBlockConnectionPointTypes.BasedOnInput) {if (this._typeConnectionSource) return !this._typeConnectionSource.isConnected && this._defaultConnectionPointType ? this._defaultConnectionPointType : this._typeConnectionSource.type;if (this._defaultConnectionPointType) return this._defaultConnectionPointType;}return this._type;}set type(value) {this._type = value;}get target() {return this._prioritizeVertex && this._ownerBlock ? this._target === NodeMaterialBlockTargets.VertexAndFragment ? this._ownerBlock.target === NodeMaterialBlockTargets.Fragment ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex : this._target : this._target;}set target(value) {this._target = value;}get isConnected() {return null !== this.connectedPoint || this.hasEndpoints;}get isConnectedToInputBlock() {return null !== this.connectedPoint && this.connectedPoint.ownerBlock.isInput;}get connectInputBlock() {return this.isConnectedToInputBlock ? this.connectedPoint.ownerBlock : null;}get connectedPoint() {return this._connectedPoint;}get ownerBlock() {return this._ownerBlock;}get sourceBlock() {return this._connectedPoint ? this._connectedPoint.ownerBlock : null;}get connectedBlocks() {return 0 === this._endpoints.length ? [] : this._endpoints.map((e) => e.ownerBlock);}get endpoints() {return this._endpoints;}get hasEndpoints() {return this._endpoints && 0 < this._endpoints.length;}get isDirectlyConnectedToVertexOutput() {if (!this.hasEndpoints) return !1;for (const endpoint of this._endpoints) {if (endpoint.ownerBlock.target === NodeMaterialBlockTargets.Vertex) return !0;if ((endpoint.ownerBlock.target === NodeMaterialBlockTargets.Neutral || endpoint.ownerBlock.target === NodeMaterialBlockTargets.VertexAndFragment) && endpoint.ownerBlock.outputs.some((o) => o.isDirectlyConnectedToVertexOutput)) return !0;}return !1;}get isConnectedInVertexShader() {if (this.target === NodeMaterialBlockTargets.Vertex) return !0;if (!this.hasEndpoints) return !1;for (const endpoint of this._endpoints) {if (endpoint.ownerBlock.target === NodeMaterialBlockTargets.Vertex) return !0;if (endpoint.target === NodeMaterialBlockTargets.Vertex) return !0;if ((endpoint.ownerBlock.target === NodeMaterialBlockTargets.Neutral || endpoint.ownerBlock.target === NodeMaterialBlockTargets.VertexAndFragment) && endpoint.ownerBlock.outputs.some((o) => o.isConnectedInVertexShader)) return !0;}return !1;}get isConnectedInFragmentShader() {if (this.target === NodeMaterialBlockTargets.Fragment) return !0;if (!this.hasEndpoints) return !1;for (const endpoint of this._endpoints) {if (endpoint.ownerBlock.target === NodeMaterialBlockTargets.Fragment) return !0;if ((endpoint.ownerBlock.target === NodeMaterialBlockTargets.Neutral || endpoint.ownerBlock.target === NodeMaterialBlockTargets.VertexAndFragment) && endpoint.ownerBlock.outputs.some((o) => o.isConnectedInFragmentShader)) return !0;}return !1;}createCustomInputBlock() {return null;}constructor(name, ownerBlock, direction) {this._connectedPoint = null, this._endpoints = [], this._typeConnectionSource = null, this._defaultConnectionPointType = null, this._linkedConnectionSource = null, this._acceptedConnectionPointType = null, this._type = NodeMaterialBlockConnectionPointTypes.Float, this._enforceAssociatedVariableName = !1, this.needDualDirectionValidation = !1, this.acceptedConnectionPointTypes = [], this.excludedConnectionPointTypes = [], this.onConnectionObservable = new observable/* Observable */.y$(), this.isExposedOnFrame = !1, this.exposedPortPosition = -1, this._prioritizeVertex = !1, this._target = NodeMaterialBlockTargets.VertexAndFragment, this._ownerBlock = ownerBlock, this.name = name, this._direction = direction;}getClassName() {return "NodeMaterialConnectionPoint";}canConnectTo(connectionPoint) {return this.checkCompatibilityState(connectionPoint) === NodeMaterialConnectionPointCompatibilityStates.Compatible;}checkCompatibilityState(connectionPoint) {const ownerBlock = this._ownerBlock,otherBlock = connectionPoint.ownerBlock;if (ownerBlock.target === NodeMaterialBlockTargets.Fragment) {if (otherBlock.target === NodeMaterialBlockTargets.Vertex) return NodeMaterialConnectionPointCompatibilityStates.TargetIncompatible;for (const output of otherBlock.outputs) if (output.ownerBlock.target != NodeMaterialBlockTargets.Neutral && output.isConnectedInVertexShader) return NodeMaterialConnectionPointCompatibilityStates.TargetIncompatible;}if (this.type !== connectionPoint.type && connectionPoint.innerType !== NodeMaterialBlockConnectionPointTypes.AutoDetect) return NodeMaterialConnectionPoint.AreEquivalentTypes(this.type, connectionPoint.type) ? NodeMaterialConnectionPointCompatibilityStates.Compatible : connectionPoint.acceptedConnectionPointTypes && -1 !== connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) || connectionPoint._acceptedConnectionPointType && NodeMaterialConnectionPoint.AreEquivalentTypes(connectionPoint._acceptedConnectionPointType.type, this.type) ? NodeMaterialConnectionPointCompatibilityStates.Compatible : NodeMaterialConnectionPointCompatibilityStates.TypeIncompatible;if (connectionPoint.excludedConnectionPointTypes && -1 !== connectionPoint.excludedConnectionPointTypes.indexOf(this.type)) return NodeMaterialConnectionPointCompatibilityStates.TypeIncompatible;let targetBlock = otherBlock,sourceBlock = ownerBlock;return this.direction === NodeMaterialConnectionPointDirection.Input && (targetBlock = ownerBlock, sourceBlock = otherBlock), targetBlock.isAnAncestorOf(sourceBlock) ? NodeMaterialConnectionPointCompatibilityStates.HierarchyIssue : NodeMaterialConnectionPointCompatibilityStates.Compatible;}connectTo(connectionPoint, ignoreConstraints = !1) {if (!ignoreConstraints && !this.canConnectTo(connectionPoint)) throw "Cannot connect these two connectors.";return this._endpoints.push(connectionPoint), connectionPoint._connectedPoint = this, this._enforceAssociatedVariableName = !1, this.onConnectionObservable.notifyObservers(connectionPoint), connectionPoint.onConnectionObservable.notifyObservers(this), this;}disconnectFrom(endpoint) {const index = this._endpoints.indexOf(endpoint);return -1 === index ? this : (this._endpoints.splice(index, 1), endpoint._connectedPoint = null, this._enforceAssociatedVariableName = !1, endpoint._enforceAssociatedVariableName = !1, this);}addExcludedConnectionPointFromAllowedTypes(mask) {for (let bitmask = 1; bitmask < NodeMaterialBlockConnectionPointTypes.All;) mask & bitmask || this.excludedConnectionPointTypes.push(bitmask), bitmask <<= 1;}serialize(isInput = !0) {const serializationObject = {};return serializationObject.name = this.name, serializationObject.displayName = this.displayName, isInput && this.connectedPoint && (serializationObject.inputName = this.name, serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId, serializationObject.targetConnectionName = this.connectedPoint.name, serializationObject.isExposedOnFrame = !0, serializationObject.exposedPortPosition = this.exposedPortPosition), (this.isExposedOnFrame || 0 <= this.exposedPortPosition) && (serializationObject.isExposedOnFrame = !0, serializationObject.exposedPortPosition = this.exposedPortPosition), serializationObject;}dispose() {this.onConnectionObservable.clear();}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/uniqueIdGenerator.js
var uniqueIdGenerator = __webpack_require__("./node_modules/@babylonjs/core/Misc/uniqueIdGenerator.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialBlock.js
class NodeMaterialBlock {get name() {return this._name;}set name(newName) {this.validateBlockName(newName) && (this._name = newName);}get isUnique() {return this._isUnique;}get isFinalMerger() {return this._isFinalMerger;}get isInput() {return this._isInput;}get buildId() {return this._buildId;}set buildId(value) {this._buildId = value;}get target() {return this._target;}set target(value) {0 != (this._target & value) || (this._target = value);}get inputs() {return this._inputs;}get outputs() {return this._outputs;}getInputByName(name) {const filter = this._inputs.filter((e) => e.name === name);return filter.length ? filter[0] : null;}getOutputByName(name) {const filter = this._outputs.filter((e) => e.name === name);return filter.length ? filter[0] : null;}constructor(name, target = NodeMaterialBlockTargets.Vertex, isFinalMerger = !1, isInput = !1) {this._isFinalMerger = !1, this._isInput = !1, this._name = "", this._isUnique = !1, this.inputsAreExclusive = !1, this._codeVariableName = "", this._inputs = [], this._outputs = [], this.comments = "", this.visibleInInspector = !1, this.visibleOnFrame = !1, this._target = target, this._originalTargetIsNeutral = target === NodeMaterialBlockTargets.Neutral, this._isFinalMerger = isFinalMerger, this._isInput = isInput, this._name = name, this.uniqueId = uniqueIdGenerator/* UniqueIdGenerator.UniqueId */.K.UniqueId;}_setInitialTarget(target) {this._target = target, this._originalTargetIsNeutral = target === NodeMaterialBlockTargets.Neutral;}initialize() {}bind() {}_declareOutput(output, state) {return `${state._getGLType(output.type)} ${output.associatedVariableName}`;}_writeVariable(currentPoint) {const connectionPoint = currentPoint.connectedPoint;return connectionPoint ? `${currentPoint.associatedVariableName}` : `0.`;}_writeFloat(value) {let stringVersion = value.toString();return -1 === stringVersion.indexOf(".") && (stringVersion += ".0"), `${stringVersion}`;}getClassName() {return "NodeMaterialBlock";}registerInput(name, type, isOptional = !1, target, point) {return point = null !== point && void 0 !== point ? point : new NodeMaterialConnectionPoint(name, this, NodeMaterialConnectionPointDirection.Input), point.type = type, point.isOptional = isOptional, target && (point.target = target), this._inputs.push(point), this;}registerOutput(name, type, target, point) {return point = null !== point && void 0 !== point ? point : new NodeMaterialConnectionPoint(name, this, NodeMaterialConnectionPointDirection.Output), point.type = type, target && (point.target = target), this._outputs.push(point), this;}getFirstAvailableInput(forOutput = null) {for (const input of this._inputs) if (!input.connectedPoint && (!forOutput || forOutput.type === input.type || input.type === NodeMaterialBlockConnectionPointTypes.AutoDetect)) return input;return null;}getFirstAvailableOutput(forBlock = null) {for (const output of this._outputs) if (!forBlock || !forBlock.target || forBlock.target === NodeMaterialBlockTargets.Neutral || 0 != (forBlock.target & output.target)) return output;return null;}getSiblingOutput(current) {const index = this._outputs.indexOf(current);return -1 === index || index >= this._outputs.length ? null : this._outputs[index + 1];}isAnAncestorOf(block) {for (const output of this._outputs) if (output.hasEndpoints) for (const endpoint of output.endpoints) {if (endpoint.ownerBlock === block) return !0;if (endpoint.ownerBlock.isAnAncestorOf(block)) return !0;}return !1;}connectTo(other, options) {if (0 === this._outputs.length) return;let output = options && options.output ? this.getOutputByName(options.output) : this.getFirstAvailableOutput(other),notFound = !0;for (; notFound;) {const input = options && options.input ? other.getInputByName(options.input) : other.getFirstAvailableInput(output);if (output && input && output.canConnectTo(input)) output.connectTo(input), notFound = !1;else if (!output) throw "Unable to find a compatible match";else output = this.getSiblingOutput(output);}return this;}_buildBlock() {}updateUniformsAndSamples() {}provideFallbacks() {}initializeDefines(useInstances = !1) {}prepareDefines(useInstances = !1) {}autoConfigure() {}replaceRepeatableContent() {}get willBeGeneratedIntoVertexShaderFromFragmentShader() {return !(this.isInput || this.isFinalMerger) && !this._outputs.some((o) => o.isDirectlyConnectedToVertexOutput) && this.target !== NodeMaterialBlockTargets.Vertex && !!((this.target === NodeMaterialBlockTargets.VertexAndFragment || this.target === NodeMaterialBlockTargets.Neutral) && this._outputs.some((o) => o.isConnectedInVertexShader));}isReady(useInstances = !1) {return !0;}_linkConnectionTypes(inputIndex0, inputIndex1, looseCoupling = !1) {looseCoupling ? this._inputs[inputIndex1]._acceptedConnectionPointType = this._inputs[inputIndex0] : this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1], this._inputs[inputIndex1]._linkedConnectionSource = this._inputs[inputIndex0];}_processBuild(block, state, input, activeBlocks) {block.build(state, activeBlocks);const localBlockIsFragment = null != state._vertexState,otherBlockWasGeneratedInVertexShader = block._buildTarget === NodeMaterialBlockTargets.Vertex && block.target !== NodeMaterialBlockTargets.VertexAndFragment;if (localBlockIsFragment && (0 == (block.target & block._buildTarget) || 0 == (block.target & input.target) || this.target !== NodeMaterialBlockTargets.VertexAndFragment && otherBlockWasGeneratedInVertexShader) && (!block.isInput && state.target !== block._buildTarget || block.isInput && block.isAttribute && !block._noContextSwitch)) {const connectedPoint = input.connectedPoint;state._vertexState._emitVaryingFromString("v_" + connectedPoint.associatedVariableName, state._getGLType(connectedPoint.type)) && (state._vertexState.compilationString += `${"v_" + connectedPoint.associatedVariableName} = ${connectedPoint.associatedVariableName};\r\n`), input.associatedVariableName = "v_" + connectedPoint.associatedVariableName, input._enforceAssociatedVariableName = !0;}}validateBlockName(newName) {const reservedNames = ["position", "normal", "tangent", "particle_positionw", "uv", "uv2", "uv3", "uv4", "uv5", "uv6", "position2d", "particle_uv", "matricesIndices", "matricesWeights", "world0", "world1", "world2", "world3", "particle_color", "particle_texturemask"];for (const reservedName of reservedNames) if (newName === reservedName) return !1;return !0;}build(state, activeBlocks) {if (this._buildId === state.sharedData.buildId) return !0;if (!this.isInput) for (const output of this._outputs) output.associatedVariableName || (output.associatedVariableName = state._getFreeVariableName(output.name));for (const input of this._inputs) {if (!input.connectedPoint) {input.isOptional || state.sharedData.checks.notConnectedNonOptionalInputs.push(input);continue;}if (this.target !== NodeMaterialBlockTargets.Neutral) {if (0 == (input.target & this.target)) continue;if (0 == (input.target & state.target)) continue;}const block = input.connectedPoint.ownerBlock;block && block !== this && this._processBuild(block, state, input, activeBlocks);}if (this._buildId === state.sharedData.buildId) return !0;if (state.sharedData.verbose && console.log(`${state.target === NodeMaterialBlockTargets.Vertex ? "Vertex shader" : "Fragment shader"}: Building ${this.name} [${this.getClassName()}]`), this.isFinalMerger) switch (state.target) {case NodeMaterialBlockTargets.Vertex:state.sharedData.checks.emitVertex = !0;break;case NodeMaterialBlockTargets.Fragment:state.sharedData.checks.emitFragment = !0;}!this.isInput && state.sharedData.emitComments && (state.compilationString += `\r\n//${this.name}\r\n`), this._buildBlock(state), this._buildId = state.sharedData.buildId, this._buildTarget = state.target;for (const output of this._outputs) if (0 != (output.target & state.target)) for (const endpoint of output.endpoints) {const block = endpoint.ownerBlock;block && 0 != (block.target & state.target) && -1 !== activeBlocks.indexOf(block) && this._processBuild(block, state, endpoint, activeBlocks);}return !1;}_inputRename(name) {return name;}_outputRename(name) {return name;}_dumpPropertiesCode() {const variableName = this._codeVariableName;return `${variableName}.visibleInInspector = ${this.visibleInInspector};\r\n${variableName}.visibleOnFrame = ${this.visibleOnFrame};\r\n${variableName}.target = ${this.target};\r\n`;}_dumpCode(uniqueNames, alreadyDumped) {alreadyDumped.push(this);let codeString;const nameAsVariableName = this.name.replace(/[^A-Za-z_]+/g, "");if (this._codeVariableName = nameAsVariableName || `${this.getClassName()}_${this.uniqueId}`, -1 !== uniqueNames.indexOf(this._codeVariableName)) {let index = 0;do index++, this._codeVariableName = nameAsVariableName + index; while (-1 !== uniqueNames.indexOf(this._codeVariableName));}uniqueNames.push(this._codeVariableName), codeString = `\r\n// ${this.getClassName()}\r\n`, this.comments && (codeString += `// ${this.comments}\r\n`), codeString += `var ${this._codeVariableName} = new BABYLON.${this.getClassName()}("${this.name}");\r\n`, codeString += this._dumpPropertiesCode();for (const input of this.inputs) {if (!input.isConnected) continue;const connectedOutput = input.connectedPoint,connectedBlock = connectedOutput.ownerBlock;-1 === alreadyDumped.indexOf(connectedBlock) && (codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped));}for (const output of this.outputs) if (output.hasEndpoints) for (const endpoint of output.endpoints) {const connectedBlock = endpoint.ownerBlock;connectedBlock && -1 === alreadyDumped.indexOf(connectedBlock) && (codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped));}return codeString;}_dumpCodeForOutputConnections(alreadyDumped) {let codeString = "";if (-1 !== alreadyDumped.indexOf(this)) return codeString;alreadyDumped.push(this);for (const input of this.inputs) {if (!input.isConnected) continue;const connectedOutput = input.connectedPoint,connectedBlock = connectedOutput.ownerBlock;codeString += connectedBlock._dumpCodeForOutputConnections(alreadyDumped), codeString += `${connectedBlock._codeVariableName}.${connectedBlock._outputRename(connectedOutput.name)}.connectTo(${this._codeVariableName}.${this._inputRename(input.name)});\r\n`;}return codeString;}clone(scene, rootUrl = "") {const serializationObject = this.serialize(),blockType = (0,typeStore/* GetClass */.q)(serializationObject.customType);if (blockType) {const block = new blockType();return block._deserialize(serializationObject, scene, rootUrl), block;}return null;}serialize() {const serializationObject = { customType: "BABYLON." + this.getClassName(), id: this.uniqueId, name: this.name, comments: this.comments, visibleInInspector: this.visibleInInspector, visibleOnFrame: this.visibleOnFrame, target: this.target, inputs: [], outputs: [] };for (const input of this.inputs) serializationObject.inputs.push(input.serialize());for (const output of this.outputs) serializationObject.outputs.push(output.serialize(!1));return serializationObject;}_deserialize(serializationObject) {var _a;this.name = serializationObject.name, this.comments = serializationObject.comments, this.visibleInInspector = !!serializationObject.visibleInInspector, this.visibleOnFrame = !!serializationObject.visibleOnFrame, this._target = null !== (_a = serializationObject.target) && void 0 !== _a ? _a : this.target, this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);}_deserializePortDisplayNamesAndExposedOnFrame(serializationObject) {const serializedInputs = serializationObject.inputs,serializedOutputs = serializationObject.outputs;serializedInputs && serializedInputs.forEach((port, i) => {port.displayName && (this.inputs[i].displayName = port.displayName), port.isExposedOnFrame && (this.inputs[i].isExposedOnFrame = port.isExposedOnFrame, this.inputs[i].exposedPortPosition = port.exposedPortPosition);}), serializedOutputs && serializedOutputs.forEach((port, i) => {port.displayName && (this.outputs[i].displayName = port.displayName), port.isExposedOnFrame && (this.outputs[i].isExposedOnFrame = port.isExposedOnFrame, this.outputs[i].exposedPortPosition = port.exposedPortPosition);});}dispose() {for (const input of this.inputs) input.dispose();for (const output of this.outputs) output.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/transformBlock.js
class TransformBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.complementW = 1, this.complementZ = 0, this.target = NodeMaterialBlockTargets.Vertex, this.registerInput("vector", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("transform", NodeMaterialBlockConnectionPointTypes.Matrix), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3), this._inputs[0].onConnectionObservable.add((other) => {if (other.ownerBlock.isInput) {const otherAsInput = other.ownerBlock;("normal" === otherAsInput.name || "tangent" === otherAsInput.name) && (this.complementW = 0);}});}getClassName() {return "TransformBlock";}get vector() {return this._inputs[0];}get output() {return this._outputs[0];}get xyz() {return this._outputs[1];}get transform() {return this._inputs[1];}_buildBlock(state) {super._buildBlock(state);const vector = this.vector,transform = this.transform;if (vector.connectedPoint) {if (0 === this.complementW) {const comments = `//${this.name}`;state._emitFunctionFromInclude("helperFunctions", comments), state.sharedData.blocksWithDefines.push(this);const transformName = state._getFreeVariableName(`${transform.associatedVariableName}_NUS`);switch (state.compilationString += `mat3 ${transformName} = mat3(${transform.associatedVariableName});\r\n`, state.compilationString += `#ifdef NONUNIFORMSCALING\r\n`, state.compilationString += `${transformName} = transposeMat3(inverseMat3(${transformName}));\r\n`, state.compilationString += `#endif\r\n`, vector.connectedPoint.type) {case NodeMaterialBlockConnectionPointTypes.Vector2:state.compilationString += this._declareOutput(this.output, state) + ` = vec4(${transformName} * vec3(${vector.associatedVariableName}, ${this._writeFloat(this.complementZ)}), ${this._writeFloat(this.complementW)});\r\n`;break;case NodeMaterialBlockConnectionPointTypes.Vector3:case NodeMaterialBlockConnectionPointTypes.Color3:state.compilationString += this._declareOutput(this.output, state) + ` = vec4(${transformName} * ${vector.associatedVariableName}, ${this._writeFloat(this.complementW)});\r\n`;break;default:state.compilationString += this._declareOutput(this.output, state) + ` = vec4(${transformName} * ${vector.associatedVariableName}.xyz, ${this._writeFloat(this.complementW)});\r\n`;}} else {const transformName = transform.associatedVariableName;switch (vector.connectedPoint.type) {case NodeMaterialBlockConnectionPointTypes.Vector2:state.compilationString += this._declareOutput(this.output, state) + ` = ${transformName} * vec4(${vector.associatedVariableName}, ${this._writeFloat(this.complementZ)}, ${this._writeFloat(this.complementW)});\r\n`;break;case NodeMaterialBlockConnectionPointTypes.Vector3:case NodeMaterialBlockConnectionPointTypes.Color3:state.compilationString += this._declareOutput(this.output, state) + ` = ${transformName} * vec4(${vector.associatedVariableName}, ${this._writeFloat(this.complementW)});\r\n`;break;default:state.compilationString += this._declareOutput(this.output, state) + ` = ${transformName} * ${vector.associatedVariableName};\r\n`;}}this.xyz.hasEndpoints && (state.compilationString += this._declareOutput(this.xyz, state) + ` = ${this.output.associatedVariableName}.xyz;\r\n`);}return this;}prepareDefines(mesh, nodeMaterial, defines) {mesh.nonUniformScaling && defines.setValue("NONUNIFORMSCALING", !0);}serialize() {const serializationObject = super.serialize();return serializationObject.complementZ = this.complementZ, serializationObject.complementW = this.complementW, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.complementZ = serializationObject.complementZ === void 0 ? 0 : serializationObject.complementZ, this.complementW = serializationObject.complementW === void 0 ? 1 : serializationObject.complementW;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.complementZ = ${this.complementZ};\r\n`;return codeString += `${this._codeVariableName}.complementW = ${this.complementW};\r\n`, codeString;}}(0,typeStore/* RegisterClass */.H)("BABYLON.TransformBlock", TransformBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/vertexOutputBlock.js
class VertexOutputBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Vertex, !0), this.registerInput("vector", NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "VertexOutputBlock";}get vector() {return this._inputs[0];}_isLogarithmicDepthEnabled(nodeList) {for (const node of nodeList) if (node.useLogarithmicDepth) return !0;return !1;}_buildBlock(state) {super._buildBlock(state);const input = this.vector;return state.compilationString += `gl_Position = ${input.associatedVariableName};\r\n`, this._isLogarithmicDepthEnabled(state.sharedData.fragmentOutputNodes) && (state._emitUniformFromString("logarithmicDepthConstant", "float"), state._emitVaryingFromString("vFragmentDepth", "float"), state.compilationString += `vFragmentDepth = 1.0 + gl_Position.w;\r\n`, state.compilationString += `gl_Position.z = log2(max(0.000001, vFragmentDepth)) * logarithmicDepthConstant;\r\n`), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.VertexOutputBlock", VertexOutputBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialDecorator.js
var PropertyTypeForEdition;(function (PropertyTypeForEdition) {PropertyTypeForEdition[PropertyTypeForEdition.Boolean = 0] = "Boolean", PropertyTypeForEdition[PropertyTypeForEdition.Float = 1] = "Float", PropertyTypeForEdition[PropertyTypeForEdition.Int = 2] = "Int", PropertyTypeForEdition[PropertyTypeForEdition.Vector2 = 3] = "Vector2", PropertyTypeForEdition[PropertyTypeForEdition.List = 4] = "List";})(PropertyTypeForEdition || (PropertyTypeForEdition = {}));function editableInPropertyPage(displayName, propertyType = PropertyTypeForEdition.Boolean, groupName = "PROPERTIES", options) {return (target, propertyKey) => {let propStore = target._propStore;propStore || (propStore = [], target._propStore = propStore), propStore.push({ propertyName: propertyKey, displayName: displayName, type: propertyType, groupName: groupName, options: null !== options && void 0 !== options ? options : {} });};}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialHelper.js
var materialHelper = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialHelper.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js
class FragmentOutputBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment, !0), this.convertToGammaSpace = !1, this.convertToLinearSpace = !1, this.useLogarithmicDepth = !1, this.registerInput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, !0), this.registerInput("rgb", NodeMaterialBlockConnectionPointTypes.AutoDetect, !0), this.registerInput("a", NodeMaterialBlockConnectionPointTypes.Float, !0), this.rgb.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "FragmentOutputBlock";}initialize(state) {state._excludeVariableName("logarithmicDepthConstant"), state._excludeVariableName("vFragmentDepth");}get rgba() {return this._inputs[0];}get rgb() {return this._inputs[1];}get a() {return this._inputs[2];}prepareDefines(mesh, nodeMaterial, defines) {defines.setValue(this._linearDefineName, this.convertToLinearSpace, !0), defines.setValue(this._gammaDefineName, this.convertToGammaSpace, !0);}bind(effect, nodeMaterial, mesh) {this.useLogarithmicDepth && mesh && materialHelper/* MaterialHelper.BindLogDepth */.G.BindLogDepth(void 0, effect, mesh.getScene());}_buildBlock(state) {super._buildBlock(state);const rgba = this.rgba,rgb = this.rgb,a = this.a;state.sharedData.hints.needAlphaBlending = rgba.isConnected || a.isConnected, state.sharedData.blocksWithDefines.push(this), this.useLogarithmicDepth && (state._emitUniformFromString("logarithmicDepthConstant", "float"), state._emitVaryingFromString("vFragmentDepth", "float"), state.sharedData.bindableBlocks.push(this)), this._linearDefineName = state._getFreeDefineName("CONVERTTOLINEAR"), this._gammaDefineName = state._getFreeDefineName("CONVERTTOGAMMA");const comments = `//${this.name}`;if (state._emitFunctionFromInclude("helperFunctions", comments), rgba.connectedPoint) state.compilationString += a.isConnected ? `gl_FragColor = vec4(${rgba.associatedVariableName}.rgb, ${a.associatedVariableName});\r\n` : `gl_FragColor = ${rgba.associatedVariableName};\r\n`;else if (rgb.connectedPoint) {let aValue = "1.0";a.connectedPoint && (aValue = a.associatedVariableName), state.compilationString += rgb.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Float ? `gl_FragColor = vec4(${rgb.associatedVariableName}, ${rgb.associatedVariableName}, ${rgb.associatedVariableName}, ${aValue});\r\n` : `gl_FragColor = vec4(${rgb.associatedVariableName}, ${aValue});\r\n`;} else state.sharedData.checks.notConnectedNonOptionalInputs.push(rgba);return state.compilationString += `#ifdef ${this._linearDefineName}\r\n`, state.compilationString += `gl_FragColor = toLinearSpace(gl_FragColor);\r\n`, state.compilationString += `#endif\r\n`, state.compilationString += `#ifdef ${this._gammaDefineName}\r\n`, state.compilationString += `gl_FragColor = toGammaSpace(gl_FragColor);\r\n`, state.compilationString += `#endif\r\n`, this.useLogarithmicDepth && (state.compilationString += `gl_FragDepthEXT = log2(vFragmentDepth) * logarithmicDepthConstant * 0.5;\r\n`), this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return codeString += `${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};\r\n`, codeString += `${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};\r\n`, codeString += `${this._codeVariableName}.useLogarithmicDepth = ${this.useLogarithmicDepth};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.convertToGammaSpace = this.convertToGammaSpace, serializationObject.convertToLinearSpace = this.convertToLinearSpace, serializationObject.useLogarithmicDepth = this.useLogarithmicDepth, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {var _a;super._deserialize(serializationObject, scene, rootUrl), this.convertToGammaSpace = serializationObject.convertToGammaSpace, this.convertToLinearSpace = serializationObject.convertToLinearSpace, this.useLogarithmicDepth = !(null === (_a = serializationObject.useLogarithmicDepth) || void 0 === _a) && _a;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Convert to gamma space", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !0 } })], FragmentOutputBlock.prototype, "convertToGammaSpace", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Convert to linear space", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !0 } })], FragmentOutputBlock.prototype, "convertToLinearSpace", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Use logarithmic depth", PropertyTypeForEdition.Boolean, "PROPERTIES")], FragmentOutputBlock.prototype, "useLogarithmicDepth", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.FragmentOutputBlock", FragmentOutputBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.js
var NodeMaterialBlockConnectionPointMode;(function (NodeMaterialBlockConnectionPointMode) {NodeMaterialBlockConnectionPointMode[NodeMaterialBlockConnectionPointMode.Uniform = 0] = "Uniform", NodeMaterialBlockConnectionPointMode[NodeMaterialBlockConnectionPointMode.Attribute = 1] = "Attribute", NodeMaterialBlockConnectionPointMode[NodeMaterialBlockConnectionPointMode.Varying = 2] = "Varying", NodeMaterialBlockConnectionPointMode[NodeMaterialBlockConnectionPointMode.Undefined = 3] = "Undefined";})(NodeMaterialBlockConnectionPointMode || (NodeMaterialBlockConnectionPointMode = {}));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialSystemValues.js
var NodeMaterialSystemValues;(function (NodeMaterialSystemValues) {NodeMaterialSystemValues[NodeMaterialSystemValues.World = 1] = "World", NodeMaterialSystemValues[NodeMaterialSystemValues.View = 2] = "View", NodeMaterialSystemValues[NodeMaterialSystemValues.Projection = 3] = "Projection", NodeMaterialSystemValues[NodeMaterialSystemValues.ViewProjection = 4] = "ViewProjection", NodeMaterialSystemValues[NodeMaterialSystemValues.WorldView = 5] = "WorldView", NodeMaterialSystemValues[NodeMaterialSystemValues.WorldViewProjection = 6] = "WorldViewProjection", NodeMaterialSystemValues[NodeMaterialSystemValues.CameraPosition = 7] = "CameraPosition", NodeMaterialSystemValues[NodeMaterialSystemValues.FogColor = 8] = "FogColor", NodeMaterialSystemValues[NodeMaterialSystemValues.DeltaTime = 9] = "DeltaTime", NodeMaterialSystemValues[NodeMaterialSystemValues.CameraParameters = 10] = "CameraParameters", NodeMaterialSystemValues[NodeMaterialSystemValues.MaterialAlpha = 11] = "MaterialAlpha";})(NodeMaterialSystemValues || (NodeMaterialSystemValues = {}));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.js + 1 modules
var math = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Input/animatedInputBlockTypes.js
var AnimatedInputBlockTypes;(function (AnimatedInputBlockTypes) {AnimatedInputBlockTypes[AnimatedInputBlockTypes.None = 0] = "None", AnimatedInputBlockTypes[AnimatedInputBlockTypes.Time = 1] = "Time", AnimatedInputBlockTypes[AnimatedInputBlockTypes.RealTime = 2] = "RealTime";})(AnimatedInputBlockTypes || (AnimatedInputBlockTypes = {}));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Input/inputBlock.js
const remapAttributeName = { position2d: "position", particle_uv: "vUV", particle_color: "vColor", particle_texturemask: "textureMask", particle_positionw: "vPositionW" },attributeInFragmentOnly = { particle_uv: !0, particle_color: !0, particle_texturemask: !0, particle_positionw: !0 },attributeAsUniform = { particle_texturemask: !0 };class InputBlock extends NodeMaterialBlock {get type() {if (this._type === NodeMaterialBlockConnectionPointTypes.AutoDetect) {if (this.isUniform && null != this.value) {if (!isNaN(this.value)) return this._type = NodeMaterialBlockConnectionPointTypes.Float, this._type;switch (this.value.getClassName()) {case "Vector2":return this._type = NodeMaterialBlockConnectionPointTypes.Vector2, this._type;case "Vector3":return this._type = NodeMaterialBlockConnectionPointTypes.Vector3, this._type;case "Vector4":return this._type = NodeMaterialBlockConnectionPointTypes.Vector4, this._type;case "Color3":return this._type = NodeMaterialBlockConnectionPointTypes.Color3, this._type;case "Color4":return this._type = NodeMaterialBlockConnectionPointTypes.Color4, this._type;case "Matrix":return this._type = NodeMaterialBlockConnectionPointTypes.Matrix, this._type;}}if (this.isAttribute) switch (this.name) {case "position":case "normal":case "particle_positionw":return this._type = NodeMaterialBlockConnectionPointTypes.Vector3, this._type;case "uv":case "uv2":case "uv3":case "uv4":case "uv5":case "uv6":case "position2d":case "particle_uv":return this._type = NodeMaterialBlockConnectionPointTypes.Vector2, this._type;case "matricesIndices":case "matricesWeights":case "world0":case "world1":case "world2":case "world3":case "tangent":return this._type = NodeMaterialBlockConnectionPointTypes.Vector4, this._type;case "color":case "instanceColor":case "particle_color":case "particle_texturemask":return this._type = NodeMaterialBlockConnectionPointTypes.Color4, this._type;}if (this.isSystemValue) switch (this._systemValue) {case NodeMaterialSystemValues.World:case NodeMaterialSystemValues.WorldView:case NodeMaterialSystemValues.WorldViewProjection:case NodeMaterialSystemValues.View:case NodeMaterialSystemValues.ViewProjection:case NodeMaterialSystemValues.Projection:return this._type = NodeMaterialBlockConnectionPointTypes.Matrix, this._type;case NodeMaterialSystemValues.CameraPosition:return this._type = NodeMaterialBlockConnectionPointTypes.Vector3, this._type;case NodeMaterialSystemValues.FogColor:return this._type = NodeMaterialBlockConnectionPointTypes.Color3, this._type;case NodeMaterialSystemValues.DeltaTime:case NodeMaterialSystemValues.MaterialAlpha:return this._type = NodeMaterialBlockConnectionPointTypes.Float, this._type;case NodeMaterialSystemValues.CameraParameters:return this._type = NodeMaterialBlockConnectionPointTypes.Vector4, this._type;}}return this._type;}constructor(name, target = NodeMaterialBlockTargets.Vertex, type = NodeMaterialBlockConnectionPointTypes.AutoDetect) {super(name, target, !1, !0), this._mode = NodeMaterialBlockConnectionPointMode.Undefined, this._animationType = AnimatedInputBlockTypes.None, this.min = 0, this.max = 0, this.isBoolean = !1, this.matrixMode = 0, this._systemValue = null, this.isConstant = !1, this.groupInInspector = "", this.onValueChangedObservable = new observable/* Observable */.y$(), this.convertToGammaSpace = !1, this.convertToLinearSpace = !1, this._type = type, this.setDefaultValue(), this.registerOutput("output", type);}validateBlockName(newName) {return !!this.isAttribute || super.validateBlockName(newName);}get output() {return this._outputs[0];}setAsAttribute(attributeName) {return this._mode = NodeMaterialBlockConnectionPointMode.Attribute, attributeName && (this.name = attributeName), this;}setAsSystemValue(value) {return this.systemValue = value, this;}get value() {return this._storedValue;}set value(value) {this.type === NodeMaterialBlockConnectionPointTypes.Float && (this.isBoolean ? value = value ? 1 : 0 : this.min !== this.max && (value = Math.max(this.min, value), value = Math.min(this.max, value))), this._storedValue = value, this._mode = NodeMaterialBlockConnectionPointMode.Uniform, this.onValueChangedObservable.notifyObservers(this);}get valueCallback() {return this._valueCallback;}set valueCallback(value) {this._valueCallback = value, this._mode = NodeMaterialBlockConnectionPointMode.Uniform;}get associatedVariableName() {return this._associatedVariableName;}set associatedVariableName(value) {this._associatedVariableName = value;}get animationType() {return this._animationType;}set animationType(value) {this._animationType = value;}get isUndefined() {return this._mode === NodeMaterialBlockConnectionPointMode.Undefined;}get isUniform() {return this._mode === NodeMaterialBlockConnectionPointMode.Uniform;}set isUniform(value) {this._mode = value ? NodeMaterialBlockConnectionPointMode.Uniform : NodeMaterialBlockConnectionPointMode.Undefined, this.associatedVariableName = "";}get isAttribute() {return this._mode === NodeMaterialBlockConnectionPointMode.Attribute;}set isAttribute(value) {this._mode = value ? NodeMaterialBlockConnectionPointMode.Attribute : NodeMaterialBlockConnectionPointMode.Undefined, this.associatedVariableName = "";}get isVarying() {return this._mode === NodeMaterialBlockConnectionPointMode.Varying;}set isVarying(value) {this._mode = value ? NodeMaterialBlockConnectionPointMode.Varying : NodeMaterialBlockConnectionPointMode.Undefined, this.associatedVariableName = "";}get isSystemValue() {return null != this._systemValue;}get systemValue() {return this._systemValue;}set systemValue(value) {this._mode = NodeMaterialBlockConnectionPointMode.Uniform, this.associatedVariableName = "", this._systemValue = value;}getClassName() {return "InputBlock";}animate(scene) {switch (this._animationType) {case AnimatedInputBlockTypes.Time:{this.type === NodeMaterialBlockConnectionPointTypes.Float && (this.value += .01 * scene.getAnimationRatio());break;}case AnimatedInputBlockTypes.RealTime:{this.type === NodeMaterialBlockConnectionPointTypes.Float && (this.value = (precisionDate/* PrecisionDate.Now */.F.Now - scene.getEngine().startTime) / 1e3);break;}}}_emitDefine(define) {return "!" === define[0] ? `#ifndef ${define.substring(1)}\r\n` : `#ifdef ${define}\r\n`;}initialize() {this.associatedVariableName = "";}setDefaultValue() {switch (this.type) {case NodeMaterialBlockConnectionPointTypes.Float:this.value = 0;break;case NodeMaterialBlockConnectionPointTypes.Vector2:this.value = math_vector/* Vector2.Zero */.FM.Zero();break;case NodeMaterialBlockConnectionPointTypes.Vector3:this.value = math_vector/* Vector3.Zero */.P.Zero();break;case NodeMaterialBlockConnectionPointTypes.Vector4:this.value = math_vector/* Vector4.Zero */.Lt.Zero();break;case NodeMaterialBlockConnectionPointTypes.Color3:this.value = math/* Color3.White */.Wo.White();break;case NodeMaterialBlockConnectionPointTypes.Color4:this.value = new math/* Color4 */.HE(1, 1, 1, 1);break;case NodeMaterialBlockConnectionPointTypes.Matrix:this.value = math_vector/* Matrix.Identity */.y3.Identity();}}_emitConstant(state) {switch (this.type) {case NodeMaterialBlockConnectionPointTypes.Float:return `${state._emitFloat(this.value)}`;case NodeMaterialBlockConnectionPointTypes.Vector2:return `vec2(${this.value.x}, ${this.value.y})`;case NodeMaterialBlockConnectionPointTypes.Vector3:return `vec3(${this.value.x}, ${this.value.y}, ${this.value.z})`;case NodeMaterialBlockConnectionPointTypes.Vector4:return `vec4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;case NodeMaterialBlockConnectionPointTypes.Color3:return math/* TmpColors.Color3.0.set */.zZ.Color3[0].set(this.value.r, this.value.g, this.value.b), this.convertToGammaSpace && math/* TmpColors.Color3.0.toGammaSpaceToRef */.zZ.Color3[0].toGammaSpaceToRef(math/* TmpColors.Color3.0 */.zZ.Color3[0]), this.convertToLinearSpace && math/* TmpColors.Color3.0.toLinearSpaceToRef */.zZ.Color3[0].toLinearSpaceToRef(math/* TmpColors.Color3.0 */.zZ.Color3[0]), `vec3(${math/* TmpColors.Color3.0.r */.zZ.Color3[0].r}, ${math/* TmpColors.Color3.0.g */.zZ.Color3[0].g}, ${math/* TmpColors.Color3.0.b */.zZ.Color3[0].b})`;case NodeMaterialBlockConnectionPointTypes.Color4:return math/* TmpColors.Color4.0.set */.zZ.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a), this.convertToGammaSpace && math/* TmpColors.Color4.0.toGammaSpaceToRef */.zZ.Color4[0].toGammaSpaceToRef(math/* TmpColors.Color4.0 */.zZ.Color4[0]), this.convertToLinearSpace && math/* TmpColors.Color4.0.toLinearSpaceToRef */.zZ.Color4[0].toLinearSpaceToRef(math/* TmpColors.Color4.0 */.zZ.Color4[0]), `vec4(${math/* TmpColors.Color4.0.r */.zZ.Color4[0].r}, ${math/* TmpColors.Color4.0.g */.zZ.Color4[0].g}, ${math/* TmpColors.Color4.0.b */.zZ.Color4[0].b}, ${math/* TmpColors.Color4.0.a */.zZ.Color4[0].a})`;}return "";}get _noContextSwitch() {return attributeInFragmentOnly[this.name];}_emit(state, define) {var _a;if (this.isUniform) {if (this.associatedVariableName || (this.associatedVariableName = state._getFreeVariableName("u_" + this.name)), this.isConstant) return -1 === state.constants.indexOf(this.associatedVariableName) ? (state.constants.push(this.associatedVariableName), void (state._constantDeclaration += this._declareOutput(this.output, state) + ` = ${this._emitConstant(state)};\r\n`)) : void 0;if (-1 !== state.uniforms.indexOf(this.associatedVariableName)) return;state.uniforms.push(this.associatedVariableName), define && (state._uniformDeclaration += this._emitDefine(define)), state._uniformDeclaration += `uniform ${state._getGLType(this.type)} ${this.associatedVariableName};\r\n`, define && (state._uniformDeclaration += `#endif\r\n`);const hints = state.sharedData.hints;if (null !== this._systemValue && void 0 !== this._systemValue) switch (this._systemValue) {case NodeMaterialSystemValues.WorldView:hints.needWorldViewMatrix = !0;break;case NodeMaterialSystemValues.WorldViewProjection:hints.needWorldViewProjectionMatrix = !0;} else this._animationType !== AnimatedInputBlockTypes.None && state.sharedData.animatedInputs.push(this);return;}if (this.isAttribute) {if (this.associatedVariableName = null !== (_a = remapAttributeName[this.name]) && void 0 !== _a ? _a : this.name, this.target === NodeMaterialBlockTargets.Vertex && state._vertexState) return void (attributeInFragmentOnly[this.name] ? attributeAsUniform[this.name] ? state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define) : state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define) : this._emit(state._vertexState, define));if (-1 !== state.attributes.indexOf(this.associatedVariableName)) return;state.attributes.push(this.associatedVariableName), attributeInFragmentOnly[this.name] ? attributeAsUniform[this.name] ? state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define) : state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define) : (define && (state._attributeDeclaration += this._emitDefine(define)), state._attributeDeclaration += `attribute ${state._getGLType(this.type)} ${this.associatedVariableName};\r\n`, define && (state._attributeDeclaration += `#endif\r\n`));}}_transmitWorld(effect, world, worldView, worldViewProjection) {if (this._systemValue) {const variableName = this.associatedVariableName;switch (this._systemValue) {case NodeMaterialSystemValues.World:effect.setMatrix(variableName, world);break;case NodeMaterialSystemValues.WorldView:effect.setMatrix(variableName, worldView);break;case NodeMaterialSystemValues.WorldViewProjection:effect.setMatrix(variableName, worldViewProjection);}}}_transmit(effect, scene, material) {if (!this.isAttribute) {const variableName = this.associatedVariableName;if (this._systemValue) {switch (this._systemValue) {case NodeMaterialSystemValues.World:case NodeMaterialSystemValues.WorldView:case NodeMaterialSystemValues.WorldViewProjection:return;case NodeMaterialSystemValues.View:effect.setMatrix(variableName, scene.getViewMatrix());break;case NodeMaterialSystemValues.Projection:effect.setMatrix(variableName, scene.getProjectionMatrix());break;case NodeMaterialSystemValues.ViewProjection:effect.setMatrix(variableName, scene.getTransformMatrix());break;case NodeMaterialSystemValues.CameraPosition:scene.bindEyePosition(effect, variableName, !0);break;case NodeMaterialSystemValues.FogColor:effect.setColor3(variableName, scene.fogColor);break;case NodeMaterialSystemValues.DeltaTime:effect.setFloat(variableName, scene.deltaTime / 1e3);break;case NodeMaterialSystemValues.CameraParameters:scene.activeCamera && effect.setFloat4(variableName, scene.getEngine().hasOriginBottomLeft ? -1 : 1, scene.activeCamera.minZ, scene.activeCamera.maxZ, 1 / scene.activeCamera.maxZ);break;case NodeMaterialSystemValues.MaterialAlpha:effect.setFloat(variableName, material.alpha);}return;}const value = this._valueCallback ? this._valueCallback() : this._storedValue;if (null !== value) switch (this.type) {case NodeMaterialBlockConnectionPointTypes.Float:effect.setFloat(variableName, value);break;case NodeMaterialBlockConnectionPointTypes.Int:effect.setInt(variableName, value);break;case NodeMaterialBlockConnectionPointTypes.Color3:math/* TmpColors.Color3.0.set */.zZ.Color3[0].set(this.value.r, this.value.g, this.value.b), this.convertToGammaSpace && math/* TmpColors.Color3.0.toGammaSpaceToRef */.zZ.Color3[0].toGammaSpaceToRef(math/* TmpColors.Color3.0 */.zZ.Color3[0]), this.convertToLinearSpace && math/* TmpColors.Color3.0.toLinearSpaceToRef */.zZ.Color3[0].toLinearSpaceToRef(math/* TmpColors.Color3.0 */.zZ.Color3[0]), effect.setColor3(variableName, math/* TmpColors.Color3.0 */.zZ.Color3[0]);break;case NodeMaterialBlockConnectionPointTypes.Color4:math/* TmpColors.Color4.0.set */.zZ.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a), this.convertToGammaSpace && math/* TmpColors.Color4.0.toGammaSpaceToRef */.zZ.Color4[0].toGammaSpaceToRef(math/* TmpColors.Color4.0 */.zZ.Color4[0]), this.convertToLinearSpace && math/* TmpColors.Color4.0.toLinearSpaceToRef */.zZ.Color4[0].toLinearSpaceToRef(math/* TmpColors.Color4.0 */.zZ.Color4[0]), effect.setDirectColor4(variableName, math/* TmpColors.Color4.0 */.zZ.Color4[0]);break;case NodeMaterialBlockConnectionPointTypes.Vector2:effect.setVector2(variableName, value);break;case NodeMaterialBlockConnectionPointTypes.Vector3:effect.setVector3(variableName, value);break;case NodeMaterialBlockConnectionPointTypes.Vector4:effect.setVector4(variableName, value);break;case NodeMaterialBlockConnectionPointTypes.Matrix:effect.setMatrix(variableName, value);}}}_buildBlock(state) {super._buildBlock(state), (this.isUniform || this.isSystemValue) && state.sharedData.inputBlocks.push(this), this._emit(state);}_dumpPropertiesCode() {const variableName = this._codeVariableName;if (this.isAttribute) return super._dumpPropertiesCode() + `${variableName}.setAsAttribute("${this.name}");\r\n`;if (this.isSystemValue) return super._dumpPropertiesCode() + `${variableName}.setAsSystemValue(BABYLON.NodeMaterialSystemValues.${NodeMaterialSystemValues[this._systemValue]});\r\n`;if (this.isUniform) {const codes = [];let valueString = "";switch (this.type) {case NodeMaterialBlockConnectionPointTypes.Float:valueString = `${this.value}`;break;case NodeMaterialBlockConnectionPointTypes.Vector2:valueString = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;break;case NodeMaterialBlockConnectionPointTypes.Vector3:valueString = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;break;case NodeMaterialBlockConnectionPointTypes.Vector4:valueString = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;break;case NodeMaterialBlockConnectionPointTypes.Color3:valueString = `new BABYLON.Color3(${this.value.r}, ${this.value.g}, ${this.value.b})`, this.convertToGammaSpace && (valueString += ".toGammaSpace()"), this.convertToLinearSpace && (valueString += ".toLinearSpace()");break;case NodeMaterialBlockConnectionPointTypes.Color4:valueString = `new BABYLON.Color4(${this.value.r}, ${this.value.g}, ${this.value.b}, ${this.value.a})`, this.convertToGammaSpace && (valueString += ".toGammaSpace()"), this.convertToLinearSpace && (valueString += ".toLinearSpace()");break;case NodeMaterialBlockConnectionPointTypes.Matrix:valueString = `BABYLON.Matrix.FromArray([${this.value.m}])`;}return codes.push(`${variableName}.value = ${valueString}`), this.type === NodeMaterialBlockConnectionPointTypes.Float && codes.push(`${variableName}.min = ${this.min}`, `${variableName}.max = ${this.max}`, `${variableName}.isBoolean = ${this.isBoolean}`, `${variableName}.matrixMode = ${this.matrixMode}`, `${variableName}.animationType = BABYLON.AnimatedInputBlockTypes.${AnimatedInputBlockTypes[this.animationType]}`), codes.push(`${variableName}.isConstant = ${this.isConstant}`), codes.push(""), super._dumpPropertiesCode() + codes.join(";\r\n");}return super._dumpPropertiesCode();}dispose() {this.onValueChangedObservable.clear(), super.dispose();}serialize() {const serializationObject = super.serialize();return serializationObject.type = this.type, serializationObject.mode = this._mode, serializationObject.systemValue = this._systemValue, serializationObject.animationType = this._animationType, serializationObject.min = this.min, serializationObject.max = this.max, serializationObject.isBoolean = this.isBoolean, serializationObject.matrixMode = this.matrixMode, serializationObject.isConstant = this.isConstant, serializationObject.groupInInspector = this.groupInInspector, serializationObject.convertToGammaSpace = this.convertToGammaSpace, serializationObject.convertToLinearSpace = this.convertToLinearSpace, null != this._storedValue && this._mode === NodeMaterialBlockConnectionPointMode.Uniform && (this._storedValue.asArray ? (serializationObject.valueType = "BABYLON." + this._storedValue.getClassName(), serializationObject.value = this._storedValue.asArray()) : (serializationObject.valueType = "number", serializationObject.value = this._storedValue)), serializationObject;}_deserialize(serializationObject, scene, rootUrl) {if (this._mode = serializationObject.mode, super._deserialize(serializationObject, scene, rootUrl), this._type = serializationObject.type, this._systemValue = serializationObject.systemValue || serializationObject.wellKnownValue, this._animationType = serializationObject.animationType, this.min = serializationObject.min || 0, this.max = serializationObject.max || 0, this.isBoolean = !!serializationObject.isBoolean, this.matrixMode = serializationObject.matrixMode || 0, this.isConstant = !!serializationObject.isConstant, this.groupInInspector = serializationObject.groupInInspector || "", this.convertToGammaSpace = !!serializationObject.convertToGammaSpace, this.convertToLinearSpace = !!serializationObject.convertToLinearSpace, "tangent" === serializationObject.name && serializationObject.mode === NodeMaterialBlockConnectionPointMode.Attribute && serializationObject.type === NodeMaterialBlockConnectionPointTypes.Vector3 && (this._type = NodeMaterialBlockConnectionPointTypes.Vector4), !!serializationObject.valueType) if ("number" === serializationObject.valueType) this._storedValue = serializationObject.value;else {const valueType = (0,typeStore/* GetClass */.q)(serializationObject.valueType);valueType && (this._storedValue = valueType.FromArray(serializationObject.value));}}}(0,typeStore/* RegisterClass */.H)("BABYLON.InputBlock", InputBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/currentScreenBlock.js
class CurrentScreenBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.VertexAndFragment), this._samplerName = "textureSampler", this.convertToGammaSpace = !1, this.convertToLinearSpace = !1, this._isUnique = !1, this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1, NodeMaterialBlockTargets.VertexAndFragment), this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Neutral), this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Neutral), this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4), this._inputs[0]._prioritizeVertex = !1;}getClassName() {return "CurrentScreenBlock";}get uv() {return this._inputs[0];}get rgba() {return this._outputs[0];}get rgb() {return this._outputs[1];}get r() {return this._outputs[2];}get g() {return this._outputs[3];}get b() {return this._outputs[4];}get a() {return this._outputs[5];}initialize(state) {state._excludeVariableName("textureSampler");}get target() {return this.uv.isConnected ? this.uv.sourceBlock.isInput ? NodeMaterialBlockTargets.VertexAndFragment : NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment;}prepareDefines(mesh, nodeMaterial, defines) {defines.setValue(this._linearDefineName, this.convertToGammaSpace, !0), defines.setValue(this._gammaDefineName, this.convertToLinearSpace, !0);}isReady() {return !this.texture || this.texture.isReadyOrNotBlocking();}_injectVertexCode(state) {const uvInput = this.uv;if (uvInput.connectedPoint.ownerBlock.isInput) {const uvInputOwnerBlock = uvInput.connectedPoint.ownerBlock;uvInputOwnerBlock.isAttribute || state._emitUniformFromString(uvInput.associatedVariableName, "vec2");}if (this._mainUVName = "vMain" + uvInput.associatedVariableName, state._emitVaryingFromString(this._mainUVName, "vec2"), state.compilationString += `${this._mainUVName} = ${uvInput.associatedVariableName}.xy;\r\n`, !!this._outputs.some((o) => o.isConnectedInVertexShader)) {this._writeTextureRead(state, !0);for (const output of this._outputs) output.hasEndpoints && this._writeOutput(state, output, output.name, !0);}}_writeTextureRead(state, vertexMode = !1) {const uvInput = this.uv;return vertexMode ? state.target === NodeMaterialBlockTargets.Fragment ? void 0 : void (state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${uvInput.associatedVariableName});\r\n`) : this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment ? void (state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${uvInput.associatedVariableName});\r\n`) : void (state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${this._mainUVName});\r\n`);}_writeOutput(state, output, swizzle, vertexMode = !1) {return vertexMode ? state.target === NodeMaterialBlockTargets.Fragment ? void 0 : void (state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle};\r\n`) : this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment ? void (state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle};\r\n`) : void (state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle};\r\n`, state.compilationString += `#ifdef ${this._linearDefineName}\r\n`, state.compilationString += `${output.associatedVariableName} = toGammaSpace(${output.associatedVariableName});\r\n`, state.compilationString += `#endif\r\n`, state.compilationString += `#ifdef ${this._gammaDefineName}\r\n`, state.compilationString += `${output.associatedVariableName} = toLinearSpace(${output.associatedVariableName});\r\n`, state.compilationString += `#endif\r\n`);}_buildBlock(state) {if (super._buildBlock(state), this._tempTextureRead = state._getFreeVariableName("tempTextureRead"), 0 > state.sharedData.blockingBlocks.indexOf(this) && state.sharedData.blockingBlocks.push(this), 0 > state.sharedData.textureBlocks.indexOf(this) && state.sharedData.textureBlocks.push(this), 0 > state.sharedData.blocksWithDefines.indexOf(this) && state.sharedData.blocksWithDefines.push(this), state.target !== NodeMaterialBlockTargets.Fragment) return state._emit2DSampler(this._samplerName), void this._injectVertexCode(state);if (this._outputs.some((o) => o.isConnectedInFragmentShader)) {state._emit2DSampler(this._samplerName), this._linearDefineName = state._getFreeDefineName("ISLINEAR"), this._gammaDefineName = state._getFreeDefineName("ISGAMMA");const comments = `//${this.name}`;state._emitFunctionFromInclude("helperFunctions", comments), this._writeTextureRead(state);for (const output of this._outputs) output.hasEndpoints && this._writeOutput(state, output, output.name);return this;}}serialize() {const serializationObject = super.serialize();return serializationObject.convertToGammaSpace = this.convertToGammaSpace, serializationObject.convertToLinearSpace = this.convertToLinearSpace, this.texture && !this.texture.isRenderTarget && (serializationObject.texture = this.texture.serialize()), serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.convertToGammaSpace = serializationObject.convertToGammaSpace, this.convertToLinearSpace = !!serializationObject.convertToLinearSpace, serializationObject.texture && (rootUrl = 0 === serializationObject.texture.url.indexOf("data:") ? "" : rootUrl, this.texture = Textures_texture/* Texture.Parse */.x.Parse(serializationObject.texture, scene, rootUrl));}}(0,typeStore/* RegisterClass */.H)("BABYLON.CurrentScreenBlock", CurrentScreenBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/particleTextureBlock.js
class ParticleTextureBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this._samplerName = "diffuseSampler", this.convertToGammaSpace = !1, this.convertToLinearSpace = !1, this._isUnique = !1, this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1, NodeMaterialBlockTargets.VertexAndFragment), this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Neutral), this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Neutral), this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "ParticleTextureBlock";}get uv() {return this._inputs[0];}get rgba() {return this._outputs[0];}get rgb() {return this._outputs[1];}get r() {return this._outputs[2];}get g() {return this._outputs[3];}get b() {return this._outputs[4];}get a() {return this._outputs[5];}initialize(state) {state._excludeVariableName("diffuseSampler");}autoConfigure(material) {if (!this.uv.isConnected) {let uvInput = material.getInputBlockByPredicate((b) => b.isAttribute && "particle_uv" === b.name);uvInput || (uvInput = new InputBlock("uv"), uvInput.setAsAttribute("particle_uv")), uvInput.output.connectTo(this.uv);}}prepareDefines(mesh, nodeMaterial, defines) {defines.setValue(this._linearDefineName, this.convertToGammaSpace, !0), defines.setValue(this._gammaDefineName, this.convertToLinearSpace, !0);}isReady() {return !this.texture || this.texture.isReadyOrNotBlocking();}_writeOutput(state, output, swizzle) {state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle};\r\n`, state.compilationString += `#ifdef ${this._linearDefineName}\r\n`, state.compilationString += `${output.associatedVariableName} = toGammaSpace(${output.associatedVariableName});\r\n`, state.compilationString += `#endif\r\n`, state.compilationString += `#ifdef ${this._gammaDefineName}\r\n`, state.compilationString += `${output.associatedVariableName} = toLinearSpace(${output.associatedVariableName});\r\n`, state.compilationString += `#endif\r\n`;}_buildBlock(state) {if (super._buildBlock(state), state.target !== NodeMaterialBlockTargets.Vertex) {this._tempTextureRead = state._getFreeVariableName("tempTextureRead"), state._emit2DSampler(this._samplerName), state.sharedData.blockingBlocks.push(this), state.sharedData.textureBlocks.push(this), state.sharedData.blocksWithDefines.push(this), this._linearDefineName = state._getFreeDefineName("ISLINEAR"), this._gammaDefineName = state._getFreeDefineName("ISGAMMA");const comments = `//${this.name}`;state._emitFunctionFromInclude("helperFunctions", comments), state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${this.uv.associatedVariableName});\r\n`;for (const output of this._outputs) output.hasEndpoints && this._writeOutput(state, output, output.name);return this;}}serialize() {const serializationObject = super.serialize();return serializationObject.convertToGammaSpace = this.convertToGammaSpace, serializationObject.convertToLinearSpace = this.convertToLinearSpace, this.texture && !this.texture.isRenderTarget && (serializationObject.texture = this.texture.serialize()), serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.convertToGammaSpace = serializationObject.convertToGammaSpace, this.convertToLinearSpace = !!serializationObject.convertToLinearSpace, serializationObject.texture && (rootUrl = 0 === serializationObject.texture.url.indexOf("data:") ? "" : rootUrl, this.texture = Textures_texture/* Texture.Parse */.x.Parse(serializationObject.texture, scene, rootUrl));}}(0,typeStore/* RegisterClass */.H)("BABYLON.ParticleTextureBlock", ParticleTextureBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/particleRampGradientBlock.js
class ParticleRampGradientBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this._isUnique = !0, this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color4, !1, NodeMaterialBlockTargets.Fragment), this.registerOutput("rampColor", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment);}getClassName() {return "ParticleRampGradientBlock";}get color() {return this._inputs[0];}get rampColor() {return this._outputs[0];}initialize(state) {state._excludeVariableName("remapRanges"), state._excludeVariableName("rampSampler"), state._excludeVariableName("baseColor"), state._excludeVariableName("alpha"), state._excludeVariableName("remappedColorIndex"), state._excludeVariableName("rampColor"), state._excludeVariableName("finalAlpha");}_buildBlock(state) {if (super._buildBlock(state), state.target !== NodeMaterialBlockTargets.Vertex) return state._emit2DSampler("rampSampler"), state._emitVaryingFromString("remapRanges", "vec4", "RAMPGRADIENT"), state.compilationString += `
            #ifdef RAMPGRADIENT
                vec4 baseColor = ${this.color.associatedVariableName};
                float alpha = ${this.color.associatedVariableName}.a;

                float remappedColorIndex = clamp((alpha - remapRanges.x) / remapRanges.y, 0.0, 1.0);

                vec4 rampColor = texture2D(rampSampler, vec2(1.0 - remappedColorIndex, 0.));
                baseColor.rgb *= rampColor.rgb;

                // Remapped alpha
                float finalAlpha = baseColor.a;
                baseColor.a = clamp((alpha * rampColor.a - remapRanges.z) / remapRanges.w, 0.0, 1.0);

                ${this._declareOutput(this.rampColor, state)} = baseColor;
            #else
                ${this._declareOutput(this.rampColor, state)} = ${this.color.associatedVariableName};
            #endif
        `, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ParticleRampGradientBlock", ParticleRampGradientBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js
class ParticleBlendMultiplyBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this._isUnique = !0, this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color4, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("alphaTexture", NodeMaterialBlockConnectionPointTypes.Float, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("alphaColor", NodeMaterialBlockConnectionPointTypes.Float, !1, NodeMaterialBlockTargets.Fragment), this.registerOutput("blendColor", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment);}getClassName() {return "ParticleBlendMultiplyBlock";}get color() {return this._inputs[0];}get alphaTexture() {return this._inputs[1];}get alphaColor() {return this._inputs[2];}get blendColor() {return this._outputs[0];}initialize(state) {state._excludeVariableName("sourceAlpha");}_buildBlock(state) {if (super._buildBlock(state), state.target !== NodeMaterialBlockTargets.Vertex) return state.compilationString += `
            #ifdef BLENDMULTIPLYMODE
                ${this._declareOutput(this.blendColor, state)};
                float sourceAlpha = ${this.alphaColor.associatedVariableName} * ${this.alphaTexture.associatedVariableName};
                ${this.blendColor.associatedVariableName}.rgb = ${this.color.associatedVariableName}.rgb * sourceAlpha + vec3(1.0) * (1.0 - sourceAlpha);
                ${this.blendColor.associatedVariableName}.a = ${this.color.associatedVariableName}.a;
            #else
                ${this._declareOutput(this.blendColor, state)} = ${this.color.associatedVariableName};
            #endif
        `, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ParticleBlendMultiplyBlock", ParticleBlendMultiplyBlock);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effectFallbacks.js
var effectFallbacks = __webpack_require__("./node_modules/@babylonjs/core/Materials/effectFallbacks.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/webRequest.js
var webRequest = __webpack_require__("./node_modules/@babylonjs/core/Misc/webRequest.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/postProcess.js
var PostProcesses_postProcess = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/postProcess.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/vectorMergerBlock.js
class VectorMergerBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.xSwizzle = "x", this.ySwizzle = "y", this.zSwizzle = "z", this.wSwizzle = "w", this.registerInput("xyzw ", NodeMaterialBlockConnectionPointTypes.Vector4, !0), this.registerInput("xyz ", NodeMaterialBlockConnectionPointTypes.Vector3, !0), this.registerInput("xy ", NodeMaterialBlockConnectionPointTypes.Vector2, !0), this.registerInput("zw ", NodeMaterialBlockConnectionPointTypes.Vector2, !0), this.registerInput("x", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("y", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("z", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("w", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerOutput("xyzw", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerOutput("zw", NodeMaterialBlockConnectionPointTypes.Vector2);}getClassName() {return "VectorMergerBlock";}get xyzwIn() {return this._inputs[0];}get xyzIn() {return this._inputs[1];}get xyIn() {return this._inputs[2];}get zwIn() {return this._inputs[3];}get x() {return this._inputs[4];}get y() {return this._inputs[5];}get z() {return this._inputs[6];}get w() {return this._inputs[7];}get xyzw() {return this._outputs[0];}get xyzOut() {return this._outputs[1];}get xyOut() {return this._outputs[2];}get zwOut() {return this._outputs[3];}get xy() {return this.xyOut;}get xyz() {return this.xyzOut;}_inputRename(name) {return "xyzw " === name ? "xyzwIn" : "xyz " === name ? "xyzIn" : "xy " === name ? "xyIn" : "zw " === name ? "zwIn" : name;}_buildSwizzle(len) {const swizzle = this.xSwizzle + this.ySwizzle + this.zSwizzle + this.wSwizzle;return "." + swizzle.substr(0, len);}_buildBlock(state) {super._buildBlock(state);const xInput = this.x,yInput = this.y,zInput = this.z,wInput = this.w,xyInput = this.xyIn,zwInput = this.zwIn,xyzInput = this.xyzIn,xyzwInput = this.xyzwIn,v4Output = this._outputs[0],v3Output = this._outputs[1],v2Output = this._outputs[2],v2CompOutput = this._outputs[3];return xyzwInput.isConnected ? (v4Output.hasEndpoints && (state.compilationString += this._declareOutput(v4Output, state) + ` = ${xyzwInput.associatedVariableName}${this._buildSwizzle(4)};\r\n`), v3Output.hasEndpoints && (state.compilationString += this._declareOutput(v3Output, state) + ` = ${xyzwInput.associatedVariableName}${this._buildSwizzle(3)};\r\n`), v2Output.hasEndpoints && (state.compilationString += this._declareOutput(v2Output, state) + ` = ${xyzwInput.associatedVariableName}${this._buildSwizzle(2)};\r\n`)) : xyzInput.isConnected ? (v4Output.hasEndpoints && (state.compilationString += this._declareOutput(v4Output, state) + ` = vec4(${xyzInput.associatedVariableName}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(4)};\r\n`), v3Output.hasEndpoints && (state.compilationString += this._declareOutput(v3Output, state) + ` = ${xyzInput.associatedVariableName}${this._buildSwizzle(3)};\r\n`), v2Output.hasEndpoints && (state.compilationString += this._declareOutput(v2Output, state) + ` = ${xyzInput.associatedVariableName}${this._buildSwizzle(2)};\r\n`)) : xyInput.isConnected ? (v4Output.hasEndpoints && (zwInput.isConnected ? state.compilationString += this._declareOutput(v4Output, state) + ` = vec4(${xyInput.associatedVariableName}, ${zwInput.associatedVariableName})${this._buildSwizzle(4)};\r\n` : state.compilationString += this._declareOutput(v4Output, state) + ` = vec4(${xyInput.associatedVariableName}, ${zInput.isConnected ? this._writeVariable(zInput) : "0.0"}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(4)};\r\n`), v3Output.hasEndpoints && (state.compilationString += this._declareOutput(v3Output, state) + ` = vec3(${xyInput.associatedVariableName}, ${zInput.isConnected ? this._writeVariable(zInput) : "0.0"})${this._buildSwizzle(3)};\r\n`), v2Output.hasEndpoints && (state.compilationString += this._declareOutput(v2Output, state) + ` = ${xyInput.associatedVariableName}${this._buildSwizzle(2)};\r\n`), v2CompOutput.hasEndpoints && (zwInput.isConnected ? state.compilationString += this._declareOutput(v2CompOutput, state) + ` = ${zwInput.associatedVariableName}${this._buildSwizzle(2)};\r\n` : state.compilationString += this._declareOutput(v2CompOutput, state) + ` = vec2(${zInput.isConnected ? this._writeVariable(zInput) : "0.0"}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(2)};\r\n`)) : (v4Output.hasEndpoints && (zwInput.isConnected ? state.compilationString += this._declareOutput(v4Output, state) + ` = vec4(${xInput.isConnected ? this._writeVariable(xInput) : "0.0"}, ${yInput.isConnected ? this._writeVariable(yInput) : "0.0"}, ${zwInput.associatedVariableName})${this._buildSwizzle(4)};\r\n` : state.compilationString += this._declareOutput(v4Output, state) + ` = vec4(${xInput.isConnected ? this._writeVariable(xInput) : "0.0"}, ${yInput.isConnected ? this._writeVariable(yInput) : "0.0"}, ${zInput.isConnected ? this._writeVariable(zInput) : "0.0"}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(4)};\r\n`), v3Output.hasEndpoints && (state.compilationString += this._declareOutput(v3Output, state) + ` = vec3(${xInput.isConnected ? this._writeVariable(xInput) : "0.0"}, ${yInput.isConnected ? this._writeVariable(yInput) : "0.0"}, ${zInput.isConnected ? this._writeVariable(zInput) : "0.0"})${this._buildSwizzle(3)};\r\n`), v2Output.hasEndpoints && (state.compilationString += this._declareOutput(v2Output, state) + ` = vec2(${xInput.isConnected ? this._writeVariable(xInput) : "0.0"}, ${yInput.isConnected ? this._writeVariable(yInput) : "0.0"})${this._buildSwizzle(2)};\r\n`), v2CompOutput.hasEndpoints && (zwInput.isConnected ? state.compilationString += this._declareOutput(v2CompOutput, state) + ` = ${zwInput.associatedVariableName}${this._buildSwizzle(2)};\r\n` : state.compilationString += this._declareOutput(v2CompOutput, state) + ` = vec2(${zInput.isConnected ? this._writeVariable(zInput) : "0.0"}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(2)};\r\n`)), this;}serialize() {const serializationObject = super.serialize();return serializationObject.xSwizzle = this.xSwizzle, serializationObject.ySwizzle = this.ySwizzle, serializationObject.zSwizzle = this.zSwizzle, serializationObject.wSwizzle = this.wSwizzle, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {var _a, _b, _c, _d;super._deserialize(serializationObject, scene, rootUrl), this.xSwizzle = null !== (_a = serializationObject.xSwizzle) && void 0 !== _a ? _a : "x", this.ySwizzle = null !== (_b = serializationObject.ySwizzle) && void 0 !== _b ? _b : "y", this.zSwizzle = null !== (_c = serializationObject.zSwizzle) && void 0 !== _c ? _c : "z", this.wSwizzle = null !== (_d = serializationObject.wSwizzle) && void 0 !== _d ? _d : "w";}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return codeString += `${this._codeVariableName}.xSwizzle = "${this.xSwizzle}";\r\n`, codeString += `${this._codeVariableName}.ySwizzle = "${this.ySwizzle}";\r\n`, codeString += `${this._codeVariableName}.zSwizzle = "${this.zSwizzle}";\r\n`, codeString += `${this._codeVariableName}.wSwizzle = "${this.wSwizzle}";\r\n`, codeString;}}(0,typeStore/* RegisterClass */.H)("BABYLON.VectorMergerBlock", VectorMergerBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/remapBlock.js
class RemapBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.sourceRange = new math_vector/* Vector2 */.FM(-1, 1), this.targetRange = new math_vector/* Vector2 */.FM(0, 1), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("sourceMin", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("sourceMax", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("targetMin", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("targetMax", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];}getClassName() {return "RemapBlock";}get input() {return this._inputs[0];}get sourceMin() {return this._inputs[1];}get sourceMax() {return this._inputs[2];}get targetMin() {return this._inputs[3];}get targetMax() {return this._inputs[4];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0],sourceMin = this.sourceMin.isConnected ? this.sourceMin.associatedVariableName : this._writeFloat(this.sourceRange.x),sourceMax = this.sourceMax.isConnected ? this.sourceMax.associatedVariableName : this._writeFloat(this.sourceRange.y),targetMin = this.targetMin.isConnected ? this.targetMin.associatedVariableName : this._writeFloat(this.targetRange.x),targetMax = this.targetMax.isConnected ? this.targetMax.associatedVariableName : this._writeFloat(this.targetRange.y);return state.compilationString += this._declareOutput(output, state) + ` = ${targetMin} + (${this._inputs[0].associatedVariableName} - ${sourceMin}) * (${targetMax} - ${targetMin}) / (${sourceMax} - ${sourceMin});\r\n`, this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.sourceRange = new BABYLON.Vector2(${this.sourceRange.x}, ${this.sourceRange.y});\r\n`;return codeString += `${this._codeVariableName}.targetRange = new BABYLON.Vector2(${this.targetRange.x}, ${this.targetRange.y});\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.sourceRange = this.sourceRange.asArray(), serializationObject.targetRange = this.targetRange.asArray(), serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.sourceRange = math_vector/* Vector2.FromArray */.FM.FromArray(serializationObject.sourceRange), this.targetRange = math_vector/* Vector2.FromArray */.FM.FromArray(serializationObject.targetRange);}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("From", PropertyTypeForEdition.Vector2)], RemapBlock.prototype, "sourceRange", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("To", PropertyTypeForEdition.Vector2)], RemapBlock.prototype, "targetRange", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.RemapBlock", RemapBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/multiplyBlock.js
class MultiplyBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);}getClassName() {return "MultiplyBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.MultiplyBlock", MultiplyBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialModes.js
var NodeMaterialModes;(function (NodeMaterialModes) {NodeMaterialModes[NodeMaterialModes.Material = 0] = "Material", NodeMaterialModes[NodeMaterialModes.PostProcess = 1] = "PostProcess", NodeMaterialModes[NodeMaterialModes.Particle = 2] = "Particle", NodeMaterialModes[NodeMaterialModes.ProceduralTexture = 3] = "ProceduralTexture";})(NodeMaterialModes || (NodeMaterialModes = {}));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js
var Materials_imageProcessingConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/boxParticleEmitter.js
class BoxParticleEmitter {constructor() {this.direction1 = new math_vector/* Vector3 */.P(0, 1, 0), this.direction2 = new math_vector/* Vector3 */.P(0, 1, 0), this.minEmitBox = new math_vector/* Vector3 */.P(-.5, -.5, -.5), this.maxEmitBox = new math_vector/* Vector3 */.P(.5, .5, .5);}startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {const randX = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.x, this.direction2.x),randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.y, this.direction2.y),randZ = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.z, this.direction2.z);return isLocal ? (directionToUpdate.x = randX, directionToUpdate.y = randY, void (directionToUpdate.z = randZ)) : void math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);}startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {const randX = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minEmitBox.x, this.maxEmitBox.x),randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minEmitBox.y, this.maxEmitBox.y),randZ = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minEmitBox.z, this.maxEmitBox.z);return isLocal ? (positionToUpdate.x = randX, positionToUpdate.y = randY, void (positionToUpdate.z = randZ)) : void math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);}clone() {const newOne = new BoxParticleEmitter();return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader(uboOrEffect) {uboOrEffect.setVector3("direction1", this.direction1), uboOrEffect.setVector3("direction2", this.direction2), uboOrEffect.setVector3("minEmitBox", this.minEmitBox), uboOrEffect.setVector3("maxEmitBox", this.maxEmitBox);}buildUniformLayout(ubo) {ubo.addUniform("direction1", 3), ubo.addUniform("direction2", 3), ubo.addUniform("minEmitBox", 3), ubo.addUniform("maxEmitBox", 3);}getEffectDefines() {return "#define BOXEMITTER";}getClassName() {return "BoxParticleEmitter";}serialize() {const serializationObject = { type: this.getClassName(), direction1: this.direction1.asArray(), direction2: this.direction2.asArray(), minEmitBox: this.minEmitBox.asArray(), maxEmitBox: this.maxEmitBox.asArray() };return serializationObject;}parse(serializationObject) {math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(serializationObject.direction1, 0, this.direction1), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(serializationObject.direction2, 0, this.direction2), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(serializationObject.minEmitBox, 0, this.minEmitBox), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(serializationObject.maxEmitBox, 0, this.maxEmitBox);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/coneParticleEmitter.js
class ConeParticleEmitter {get radius() {return this._radius;}set radius(value) {this._radius = value, this._buildHeight();}get angle() {return this._angle;}set angle(value) {this._angle = value, this._buildHeight();}_buildHeight() {this._height = 0 === this._angle ? 1 : this._radius / Math.tan(this._angle / 2);}constructor(radius = 1, angle = Math.PI, directionRandomizer = 0) {this.directionRandomizer = directionRandomizer, this.radiusRange = 1, this.heightRange = 1, this.emitFromSpawnPointOnly = !1, this.angle = angle, this.radius = radius;}startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {isLocal ? math_vector/* TmpVectors.Vector3.0.copyFrom */.jp.Vector3[0].copyFrom(particle._localPosition).normalize() : particle.position.subtractToRef(worldMatrix.getTranslation(), math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]).normalize();const randX = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.directionRandomizer),randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.directionRandomizer),randZ = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.directionRandomizer);directionToUpdate.x = math_vector/* TmpVectors.Vector3.0.x */.jp.Vector3[0].x + randX, directionToUpdate.y = math_vector/* TmpVectors.Vector3.0.y */.jp.Vector3[0].y + randY, directionToUpdate.z = math_vector/* TmpVectors.Vector3.0.z */.jp.Vector3[0].z + randZ, directionToUpdate.normalize();}startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {const s = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 2 * Math.PI);let h;this.emitFromSpawnPointOnly ? h = 1e-4 : (h = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.heightRange), h = 1 - h * h);let radius = this._radius - math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this._radius * this.radiusRange);radius *= h;const randX = radius * Math.sin(s),randZ = radius * Math.cos(s),randY = h * this._height;return isLocal ? (positionToUpdate.x = randX, positionToUpdate.y = randY, void (positionToUpdate.z = randZ)) : void math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);}clone() {const newOne = new ConeParticleEmitter(this._radius, this._angle, this.directionRandomizer);return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader(uboOrEffect) {uboOrEffect.setFloat2("radius", this._radius, this.radiusRange), uboOrEffect.setFloat("coneAngle", this._angle), uboOrEffect.setFloat2("height", this._height, this.heightRange), uboOrEffect.setFloat("directionRandomizer", this.directionRandomizer);}buildUniformLayout(ubo) {ubo.addUniform("radius", 2), ubo.addUniform("coneAngle", 1), ubo.addUniform("height", 2), ubo.addUniform("directionRandomizer", 1);}getEffectDefines() {let defines = "#define CONEEMITTER";return this.emitFromSpawnPointOnly && (defines += "\n#define CONEEMITTERSPAWNPOINT"), defines;}getClassName() {return "ConeParticleEmitter";}serialize() {const serializationObject = { type: this.getClassName(), radius: this._radius, angle: this._angle, directionRandomizer: this.directionRandomizer, radiusRange: this.radiusRange, heightRange: this.heightRange, emitFromSpawnPointOnly: this.emitFromSpawnPointOnly };return serializationObject;}parse(serializationObject) {this.radius = serializationObject.radius, this.angle = serializationObject.angle, this.directionRandomizer = serializationObject.directionRandomizer, this.radiusRange = serializationObject.radiusRange === void 0 ? 1 : serializationObject.radiusRange, this.heightRange = serializationObject.radiusRange === void 0 ? 1 : serializationObject.heightRange, this.emitFromSpawnPointOnly = serializationObject.emitFromSpawnPointOnly !== void 0 && serializationObject.emitFromSpawnPointOnly;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/cylinderParticleEmitter.js
class CylinderParticleEmitter {constructor(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0) {this.radius = radius, this.height = height, this.radiusRange = radiusRange, this.directionRandomizer = directionRandomizer, this._tempVector = math_vector/* Vector3.Zero */.P.Zero();}startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal, inverseWorldMatrix) {particle.position.subtractToRef(worldMatrix.getTranslation(), this._tempVector), this._tempVector.normalize(), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(this._tempVector, inverseWorldMatrix, this._tempVector);const randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(-this.directionRandomizer / 2, this.directionRandomizer / 2);let angle = Math.atan2(this._tempVector.x, this._tempVector.z);return angle += math_scalar/* Scalar.RandomRange */.R.RandomRange(-Math.PI / 2, Math.PI / 2) * this.directionRandomizer, this._tempVector.y = randY, this._tempVector.x = Math.sin(angle), this._tempVector.z = Math.cos(angle), this._tempVector.normalize(), isLocal ? void directionToUpdate.copyFrom(this._tempVector) : void math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(this._tempVector.x, this._tempVector.y, this._tempVector.z, worldMatrix, directionToUpdate);}startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {const yPos = math_scalar/* Scalar.RandomRange */.R.RandomRange(-this.height / 2, this.height / 2),angle = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 2 * Math.PI),radiusDistribution = math_scalar/* Scalar.RandomRange */.R.RandomRange((1 - this.radiusRange) * (1 - this.radiusRange), 1),positionRadius = Math.sqrt(radiusDistribution) * this.radius,xPos = positionRadius * Math.cos(angle),zPos = positionRadius * Math.sin(angle);return isLocal ? void positionToUpdate.copyFromFloats(xPos, yPos, zPos) : void math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(xPos, yPos, zPos, worldMatrix, positionToUpdate);}clone() {const newOne = new CylinderParticleEmitter(this.radius, this.directionRandomizer);return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader(uboOrEffect) {uboOrEffect.setFloat("radius", this.radius), uboOrEffect.setFloat("height", this.height), uboOrEffect.setFloat("radiusRange", this.radiusRange), uboOrEffect.setFloat("directionRandomizer", this.directionRandomizer);}buildUniformLayout(ubo) {ubo.addUniform("radius", 1), ubo.addUniform("height", 1), ubo.addUniform("radiusRange", 1), ubo.addUniform("directionRandomizer", 1);}getEffectDefines() {return "#define CYLINDEREMITTER";}getClassName() {return "CylinderParticleEmitter";}serialize() {const serializationObject = { type: this.getClassName(), radius: this.radius, height: this.height, radiusRange: this.radiusRange, directionRandomizer: this.directionRandomizer };return serializationObject;}parse(serializationObject) {this.radius = serializationObject.radius, this.height = serializationObject.height, this.radiusRange = serializationObject.radiusRange, this.directionRandomizer = serializationObject.directionRandomizer;}}class CylinderDirectedParticleEmitter extends CylinderParticleEmitter {constructor(radius = 1, height = 1, radiusRange = 1, direction1 = new math_vector/* Vector3 */.P(0, 1, 0), direction2 = new math_vector/* Vector3 */.P(0, 1, 0)) {super(radius, height, radiusRange), this.direction1 = direction1, this.direction2 = direction2;}startDirectionFunction(worldMatrix, directionToUpdate) {const randX = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.x, this.direction2.x),randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.y, this.direction2.y),randZ = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.z, this.direction2.z);math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);}clone() {const newOne = new CylinderDirectedParticleEmitter(this.radius, this.height, this.radiusRange, this.direction1, this.direction2);return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader(uboOrEffect) {uboOrEffect.setFloat("radius", this.radius), uboOrEffect.setFloat("height", this.height), uboOrEffect.setFloat("radiusRange", this.radiusRange), uboOrEffect.setVector3("direction1", this.direction1), uboOrEffect.setVector3("direction2", this.direction2);}buildUniformLayout(ubo) {ubo.addUniform("radius", 1), ubo.addUniform("height", 1), ubo.addUniform("radiusRange", 1), ubo.addUniform("direction1", 3), ubo.addUniform("direction2", 3);}getEffectDefines() {return "#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER";}getClassName() {return "CylinderDirectedParticleEmitter";}serialize() {const serializationObject = super.serialize();return serializationObject.direction1 = this.direction1.asArray(), serializationObject.direction2 = this.direction2.asArray(), serializationObject;}parse(serializationObject) {super.parse(serializationObject), this.direction1.copyFrom(serializationObject.direction1), this.direction2.copyFrom(serializationObject.direction2);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/hemisphericParticleEmitter.js
class HemisphericParticleEmitter {constructor(radius = 1, radiusRange = 1, directionRandomizer = 0) {this.radius = radius, this.radiusRange = radiusRange, this.directionRandomizer = directionRandomizer;}startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {const direction = particle.position.subtract(worldMatrix.getTranslation()).normalize(),randX = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.directionRandomizer),randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.directionRandomizer),randZ = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.directionRandomizer);return direction.x += randX, direction.y += randY, direction.z += randZ, direction.normalize(), isLocal ? void directionToUpdate.copyFrom(direction) : void math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate);}startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {const randRadius = this.radius - math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.radius * this.radiusRange),v = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 1),phi = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 2 * Math.PI),theta = Math.acos(2 * v - 1),randX = randRadius * Math.cos(phi) * Math.sin(theta),randY = randRadius * Math.cos(theta),randZ = randRadius * Math.sin(phi) * Math.sin(theta);return isLocal ? void positionToUpdate.copyFromFloats(randX, Math.abs(randY), randZ) : void math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(randX, Math.abs(randY), randZ, worldMatrix, positionToUpdate);}clone() {const newOne = new HemisphericParticleEmitter(this.radius, this.directionRandomizer);return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader(uboOrEffect) {uboOrEffect.setFloat("radius", this.radius), uboOrEffect.setFloat("radiusRange", this.radiusRange), uboOrEffect.setFloat("directionRandomizer", this.directionRandomizer);}buildUniformLayout(ubo) {ubo.addUniform("radius", 1), ubo.addUniform("radiusRange", 1), ubo.addUniform("directionRandomizer", 1);}getEffectDefines() {return "#define HEMISPHERICEMITTER";}getClassName() {return "HemisphericParticleEmitter";}serialize() {const serializationObject = { type: this.getClassName(), radius: this.radius, radiusRange: this.radiusRange, directionRandomizer: this.directionRandomizer };return serializationObject;}parse(serializationObject) {this.radius = serializationObject.radius, this.radiusRange = serializationObject.radiusRange, this.directionRandomizer = serializationObject.directionRandomizer;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/IParticleEmitterType.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/pointParticleEmitter.js
class PointParticleEmitter {constructor() {this.direction1 = new math_vector/* Vector3 */.P(0, 1, 0), this.direction2 = new math_vector/* Vector3 */.P(0, 1, 0);}startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {const randX = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.x, this.direction2.x),randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.y, this.direction2.y),randZ = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.z, this.direction2.z);return isLocal ? void directionToUpdate.copyFromFloats(randX, randY, randZ) : void math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);}startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {return isLocal ? void positionToUpdate.copyFromFloats(0, 0, 0) : void math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(0, 0, 0, worldMatrix, positionToUpdate);}clone() {const newOne = new PointParticleEmitter();return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader(uboOrEffect) {uboOrEffect.setVector3("direction1", this.direction1), uboOrEffect.setVector3("direction2", this.direction2);}buildUniformLayout(ubo) {ubo.addUniform("direction1", 3), ubo.addUniform("direction2", 3);}getEffectDefines() {return "#define POINTEMITTER";}getClassName() {return "PointParticleEmitter";}serialize() {const serializationObject = { type: this.getClassName(), direction1: this.direction1.asArray(), direction2: this.direction2.asArray() };return serializationObject;}parse(serializationObject) {math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(serializationObject.direction1, 0, this.direction1), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(serializationObject.direction2, 0, this.direction2);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/sphereParticleEmitter.js
class SphereParticleEmitter {constructor(radius = 1, radiusRange = 1, directionRandomizer = 0) {this.radius = radius, this.radiusRange = radiusRange, this.directionRandomizer = directionRandomizer;}startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {const direction = particle.position.subtract(worldMatrix.getTranslation()).normalize(),randX = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.directionRandomizer),randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.directionRandomizer),randZ = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.directionRandomizer);return direction.x += randX, direction.y += randY, direction.z += randZ, direction.normalize(), isLocal ? void directionToUpdate.copyFrom(direction) : void math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate);}startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {const randRadius = this.radius - math_scalar/* Scalar.RandomRange */.R.RandomRange(0, this.radius * this.radiusRange),v = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 1),phi = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 2 * Math.PI),theta = Math.acos(2 * v - 1),randX = randRadius * Math.cos(phi) * Math.sin(theta),randY = randRadius * Math.cos(theta),randZ = randRadius * Math.sin(phi) * Math.sin(theta);return isLocal ? void positionToUpdate.copyFromFloats(randX, randY, randZ) : void math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);}clone() {const newOne = new SphereParticleEmitter(this.radius, this.directionRandomizer);return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader(uboOrEffect) {uboOrEffect.setFloat("radius", this.radius), uboOrEffect.setFloat("radiusRange", this.radiusRange), uboOrEffect.setFloat("directionRandomizer", this.directionRandomizer);}buildUniformLayout(ubo) {ubo.addUniform("radius", 1), ubo.addUniform("radiusRange", 1), ubo.addUniform("directionRandomizer", 1);}getEffectDefines() {return "#define SPHEREEMITTER";}getClassName() {return "SphereParticleEmitter";}serialize() {const serializationObject = { type: this.getClassName(), radius: this.radius, radiusRange: this.radiusRange, directionRandomizer: this.directionRandomizer };return serializationObject;}parse(serializationObject) {this.radius = serializationObject.radius, this.radiusRange = serializationObject.radiusRange, this.directionRandomizer = serializationObject.directionRandomizer;}}class SphereDirectedParticleEmitter extends SphereParticleEmitter {constructor(radius = 1, direction1 = new math_vector/* Vector3 */.P(0, 1, 0), direction2 = new math_vector/* Vector3 */.P(0, 1, 0)) {super(radius), this.direction1 = direction1, this.direction2 = direction2;}startDirectionFunction(worldMatrix, directionToUpdate) {const randX = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.x, this.direction2.x),randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.y, this.direction2.y),randZ = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.z, this.direction2.z);math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);}clone() {const newOne = new SphereDirectedParticleEmitter(this.radius, this.direction1, this.direction2);return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader(uboOrEffect) {uboOrEffect.setFloat("radius", this.radius), uboOrEffect.setFloat("radiusRange", this.radiusRange), uboOrEffect.setVector3("direction1", this.direction1), uboOrEffect.setVector3("direction2", this.direction2);}buildUniformLayout(ubo) {ubo.addUniform("radius", 1), ubo.addUniform("radiusRange", 1), ubo.addUniform("direction1", 3), ubo.addUniform("direction2", 3);}getEffectDefines() {return "#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER";}getClassName() {return "SphereDirectedParticleEmitter";}serialize() {const serializationObject = super.serialize();return serializationObject.direction1 = this.direction1.asArray(), serializationObject.direction2 = this.direction2.asArray(), serializationObject;}parse(serializationObject) {super.parse(serializationObject), this.direction1.copyFrom(serializationObject.direction1), this.direction2.copyFrom(serializationObject.direction2);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/customParticleEmitter.js
class CustomParticleEmitter {constructor() {this.particlePositionGenerator = () => {}, this.particleDestinationGenerator = () => {};}startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {const tmpVector = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];if (this.particleDestinationGenerator) {this.particleDestinationGenerator(-1, particle, tmpVector);const diffVector = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];tmpVector.subtractToRef(particle.position, diffVector), diffVector.scaleToRef(1 / particle.lifeTime, tmpVector);} else tmpVector.set(0, 0, 0);return isLocal ? void directionToUpdate.copyFrom(tmpVector) : void math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(tmpVector, worldMatrix, directionToUpdate);}startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {const tmpVector = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];return this.particlePositionGenerator ? this.particlePositionGenerator(-1, particle, tmpVector) : tmpVector.set(0, 0, 0), isLocal ? void positionToUpdate.copyFrom(tmpVector) : void math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(tmpVector, worldMatrix, positionToUpdate);}clone() {const newOne = new CustomParticleEmitter();return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader() {}buildUniformLayout() {}getEffectDefines() {return "#define CUSTOMEMITTER";}getClassName() {return "CustomParticleEmitter";}serialize() {const serializationObject = { type: this.getClassName() };return serializationObject;}parse() {}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/meshParticleEmitter.js
class MeshParticleEmitter {get mesh() {return this._mesh;}set mesh(value) {this._mesh === value || (this._mesh = value, value ? (this._indices = value.getIndices(), this._positions = value.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind), this._normals = value.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind)) : (this._indices = null, this._positions = null, this._normals = null));}constructor(mesh = null) {this._indices = null, this._positions = null, this._normals = null, this._storedNormal = math_vector/* Vector3.Zero */.P.Zero(), this._mesh = null, this.direction1 = new math_vector/* Vector3 */.P(0, 1, 0), this.direction2 = new math_vector/* Vector3 */.P(0, 1, 0), this.useMeshNormalsForDirection = !0, this.mesh = mesh;}startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {if (this.useMeshNormalsForDirection && this._normals) return void math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(this._storedNormal, worldMatrix, directionToUpdate);const randX = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.x, this.direction2.x),randY = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.y, this.direction2.y),randZ = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.direction1.z, this.direction2.z);return isLocal ? void directionToUpdate.copyFromFloats(randX, randY, randZ) : void math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);}startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {if (!this._indices || !this._positions) return;const randomFaceIndex = 0 | 3 * Math.random() * (this._indices.length / 3),bu = Math.random(),bv = Math.random() * (1 - bu),bw = 1 - bu - bv,faceIndexA = this._indices[randomFaceIndex],faceIndexB = this._indices[randomFaceIndex + 1],faceIndexC = this._indices[randomFaceIndex + 2],vertexA = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],vertexB = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1],vertexC = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],randomVertex = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3];math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(this._positions, 3 * faceIndexA, vertexA), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(this._positions, 3 * faceIndexB, vertexB), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(this._positions, 3 * faceIndexC, vertexC), randomVertex.x = bu * vertexA.x + bv * vertexB.x + bw * vertexC.x, randomVertex.y = bu * vertexA.y + bv * vertexB.y + bw * vertexC.y, randomVertex.z = bu * vertexA.z + bv * vertexB.z + bw * vertexC.z, isLocal ? positionToUpdate.copyFromFloats(randomVertex.x, randomVertex.y, randomVertex.z) : math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(randomVertex.x, randomVertex.y, randomVertex.z, worldMatrix, positionToUpdate), this.useMeshNormalsForDirection && this._normals && (math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(this._normals, 3 * faceIndexA, vertexA), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(this._normals, 3 * faceIndexB, vertexB), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(this._normals, 3 * faceIndexC, vertexC), this._storedNormal.x = bu * vertexA.x + bv * vertexB.x + bw * vertexC.x, this._storedNormal.y = bu * vertexA.y + bv * vertexB.y + bw * vertexC.y, this._storedNormal.z = bu * vertexA.z + bv * vertexB.z + bw * vertexC.z);}clone() {const newOne = new MeshParticleEmitter(this.mesh);return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newOne), newOne;}applyToShader(uboOrEffect) {uboOrEffect.setVector3("direction1", this.direction1), uboOrEffect.setVector3("direction2", this.direction2);}buildUniformLayout(ubo) {ubo.addUniform("direction1", 3), ubo.addUniform("direction2", 3);}getEffectDefines() {return "";}getClassName() {return "MeshParticleEmitter";}serialize() {var _a;const serializationObject = { type: this.getClassName(), direction1: this.direction1.asArray(), direction2: this.direction2.asArray(), meshId: null === (_a = this.mesh) || void 0 === _a ? void 0 : _a.id, useMeshNormalsForDirection: this.useMeshNormalsForDirection };return serializationObject;}parse(serializationObject, scene) {math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(serializationObject.direction1, 0, this.direction1), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(serializationObject.direction2, 0, this.direction2), serializationObject.meshId && scene && (this.mesh = scene.getLastMeshById(serializationObject.meshId)), this.useMeshNormalsForDirection = serializationObject.useMeshNormalsForDirection;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/EmitterTypes/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicBuffer.js
var engine_dynamicBuffer = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicBuffer.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/baseParticleSystem.js
class BaseParticleSystem {get noiseTexture() {return this._noiseTexture;}set noiseTexture(value) {this._noiseTexture === value || (this._noiseTexture = value, this._reset());}get isAnimationSheetEnabled() {return this._isAnimationSheetEnabled;}set isAnimationSheetEnabled(value) {this._isAnimationSheetEnabled == value || (this._isAnimationSheetEnabled = value, this._reset());}get useLogarithmicDepth() {return this._useLogarithmicDepth;}set useLogarithmicDepth(value) {this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported;}getScene() {return this._scene;}_hasTargetStopDurationDependantGradient() {return this._startSizeGradients && 0 < this._startSizeGradients.length || this._emitRateGradients && 0 < this._emitRateGradients.length || this._lifeTimeGradients && 0 < this._lifeTimeGradients.length;}getDragGradients() {return this._dragGradients;}getLimitVelocityGradients() {return this._limitVelocityGradients;}getColorGradients() {return this._colorGradients;}getSizeGradients() {return this._sizeGradients;}getColorRemapGradients() {return this._colorRemapGradients;}getAlphaRemapGradients() {return this._alphaRemapGradients;}getLifeTimeGradients() {return this._lifeTimeGradients;}getAngularSpeedGradients() {return this._angularSpeedGradients;}getVelocityGradients() {return this._velocityGradients;}getStartSizeGradients() {return this._startSizeGradients;}getEmitRateGradients() {return this._emitRateGradients;}get direction1() {return this.particleEmitterType.direction1 ? this.particleEmitterType.direction1 : math_vector/* Vector3.Zero */.P.Zero();}set direction1(value) {this.particleEmitterType.direction1 && (this.particleEmitterType.direction1 = value);}get direction2() {return this.particleEmitterType.direction2 ? this.particleEmitterType.direction2 : math_vector/* Vector3.Zero */.P.Zero();}set direction2(value) {this.particleEmitterType.direction2 && (this.particleEmitterType.direction2 = value);}get minEmitBox() {return this.particleEmitterType.minEmitBox ? this.particleEmitterType.minEmitBox : math_vector/* Vector3.Zero */.P.Zero();}set minEmitBox(value) {this.particleEmitterType.minEmitBox && (this.particleEmitterType.minEmitBox = value);}get maxEmitBox() {return this.particleEmitterType.maxEmitBox ? this.particleEmitterType.maxEmitBox : math_vector/* Vector3.Zero */.P.Zero();}set maxEmitBox(value) {this.particleEmitterType.maxEmitBox && (this.particleEmitterType.maxEmitBox = value);}get billboardMode() {return this._billboardMode;}set billboardMode(value) {this._billboardMode === value || (this._billboardMode = value, this._reset());}get isBillboardBased() {return this._isBillboardBased;}set isBillboardBased(value) {this._isBillboardBased === value || (this._isBillboardBased = value, this._reset());}get imageProcessingConfiguration() {return this._imageProcessingConfiguration;}set imageProcessingConfiguration(value) {this._attachImageProcessingConfiguration(value);}_attachImageProcessingConfiguration(configuration) {configuration === this._imageProcessingConfiguration || (!configuration && this._scene ? this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration : this._imageProcessingConfiguration = configuration);}_reset() {}_removeGradientAndTexture(gradient, gradients, texture) {if (!gradients) return this;let index = 0;for (const valueGradient of gradients) {if (valueGradient.gradient === gradient) {gradients.splice(index, 1);break;}index++;}return texture && texture.dispose(), this;}constructor(name) {this.animations = [], this.renderingGroupId = 0, this.emitter = math_vector/* Vector3.Zero */.P.Zero(), this.emitRate = 10, this.manualEmitCount = -1, this.updateSpeed = .01, this.targetStopDuration = 0, this.disposeOnStop = !1, this.minEmitPower = 1, this.maxEmitPower = 1, this.minLifeTime = 1, this.maxLifeTime = 1, this.minSize = 1, this.maxSize = 1, this.minScaleX = 1, this.maxScaleX = 1, this.minScaleY = 1, this.maxScaleY = 1, this.minInitialRotation = 0, this.maxInitialRotation = 0, this.minAngularSpeed = 0, this.maxAngularSpeed = 0, this.layerMask = 268435455, this.customShader = null, this.preventAutoStart = !1, this._wasDispatched = !1, this._rootUrl = "", this.noiseStrength = new math_vector/* Vector3 */.P(10, 10, 10), this.onAnimationEnd = null, this.blendMode = BaseParticleSystem.BLENDMODE_ONEONE, this.forceDepthWrite = !1, this.preWarmCycles = 0, this.preWarmStepOffset = 1, this.spriteCellChangeSpeed = 1, this.startSpriteCellID = 0, this.endSpriteCellID = 0, this.spriteCellWidth = 0, this.spriteCellHeight = 0, this.spriteCellLoop = !0, this.spriteRandomStartCell = !1, this.translationPivot = new math_vector/* Vector2 */.FM(0, 0), this.beginAnimationOnStart = !1, this.beginAnimationFrom = 0, this.beginAnimationTo = 60, this.beginAnimationLoop = !1, this.worldOffset = new math_vector/* Vector3 */.P(0, 0, 0), this._useLogarithmicDepth = !1, this.gravity = math_vector/* Vector3.Zero */.P.Zero(), this._colorGradients = null, this._sizeGradients = null, this._lifeTimeGradients = null, this._angularSpeedGradients = null, this._velocityGradients = null, this._limitVelocityGradients = null, this._dragGradients = null, this._emitRateGradients = null, this._startSizeGradients = null, this._rampGradients = null, this._colorRemapGradients = null, this._alphaRemapGradients = null, this.startDelay = 0, this.limitVelocityDamping = .4, this.color1 = new math_color/* Color4 */.HE(1, 1, 1, 1), this.color2 = new math_color/* Color4 */.HE(1, 1, 1, 1), this.colorDead = new math_color/* Color4 */.HE(0, 0, 0, 1), this.textureMask = new math_color/* Color4 */.HE(1, 1, 1, 1), this._isSubEmitter = !1, this._billboardMode = 7, this._isBillboardBased = !0, this._imageProcessingConfigurationDefines = new Materials_imageProcessingConfiguration/* ImageProcessingConfigurationDefines */.b(), this.id = name, this.name = name;}createPointEmitter(direction1, direction2) {const particleEmitter = new PointParticleEmitter();return particleEmitter.direction1 = direction1, particleEmitter.direction2 = direction2, this.particleEmitterType = particleEmitter, particleEmitter;}createHemisphericEmitter(radius = 1, radiusRange = 1) {const particleEmitter = new HemisphericParticleEmitter(radius, radiusRange);return this.particleEmitterType = particleEmitter, particleEmitter;}createSphereEmitter(radius = 1, radiusRange = 1) {const particleEmitter = new SphereParticleEmitter(radius, radiusRange);return this.particleEmitterType = particleEmitter, particleEmitter;}createDirectedSphereEmitter(radius = 1, direction1 = new math_vector/* Vector3 */.P(0, 1, 0), direction2 = new math_vector/* Vector3 */.P(0, 1, 0)) {const particleEmitter = new SphereDirectedParticleEmitter(radius, direction1, direction2);return this.particleEmitterType = particleEmitter, particleEmitter;}createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0) {const particleEmitter = new CylinderParticleEmitter(radius, height, radiusRange, directionRandomizer);return this.particleEmitterType = particleEmitter, particleEmitter;}createDirectedCylinderEmitter(radius = 1, height = 1, radiusRange = 1, direction1 = new math_vector/* Vector3 */.P(0, 1, 0), direction2 = new math_vector/* Vector3 */.P(0, 1, 0)) {const particleEmitter = new CylinderDirectedParticleEmitter(radius, height, radiusRange, direction1, direction2);return this.particleEmitterType = particleEmitter, particleEmitter;}createConeEmitter(radius = 1, angle = Math.PI / 4) {const particleEmitter = new ConeParticleEmitter(radius, angle);return this.particleEmitterType = particleEmitter, particleEmitter;}createBoxEmitter(direction1, direction2, minEmitBox, maxEmitBox) {const particleEmitter = new BoxParticleEmitter();return this.particleEmitterType = particleEmitter, this.direction1 = direction1, this.direction2 = direction2, this.minEmitBox = minEmitBox, this.maxEmitBox = maxEmitBox, particleEmitter;}}BaseParticleSystem.BLENDMODE_ONEONE = 0, BaseParticleSystem.BLENDMODE_STANDARD = 1, BaseParticleSystem.BLENDMODE_ADD = 2, BaseParticleSystem.BLENDMODE_MULTIPLY = 3, BaseParticleSystem.BLENDMODE_MULTIPLYADD = 4;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/colorSplitterBlock.js
class ColorSplitterBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, !0), this.registerInput("rgb ", NodeMaterialBlockConnectionPointTypes.Color3, !0), this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3), this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float), this.inputsAreExclusive = !0;}getClassName() {return "ColorSplitterBlock";}get rgba() {return this._inputs[0];}get rgbIn() {return this._inputs[1];}get rgbOut() {return this._outputs[0];}get r() {return this._outputs[1];}get g() {return this._outputs[2];}get b() {return this._outputs[3];}get a() {return this._outputs[4];}_inputRename(name) {return "rgb " === name ? "rgbIn" : name;}_outputRename(name) {return "rgb" === name ? "rgbOut" : name;}_buildBlock(state) {super._buildBlock(state);const input = this.rgba.isConnected ? this.rgba : this.rgbIn;if (!input.isConnected) return;const rgbOutput = this._outputs[0],rOutput = this._outputs[1],gOutput = this._outputs[2],bOutput = this._outputs[3],aOutput = this._outputs[4];return rgbOutput.hasEndpoints && (state.compilationString += this._declareOutput(rgbOutput, state) + ` = ${input.associatedVariableName}.rgb;\r\n`), rOutput.hasEndpoints && (state.compilationString += this._declareOutput(rOutput, state) + ` = ${input.associatedVariableName}.r;\r\n`), gOutput.hasEndpoints && (state.compilationString += this._declareOutput(gOutput, state) + ` = ${input.associatedVariableName}.g;\r\n`), bOutput.hasEndpoints && (state.compilationString += this._declareOutput(bOutput, state) + ` = ${input.associatedVariableName}.b;\r\n`), aOutput.hasEndpoints && (state.compilationString += this._declareOutput(aOutput, state) + ` = ${input.associatedVariableName}.a;\r\n`), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ColorSplitterBlock", ColorSplitterBlock);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/timingTools.js
var timingTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/timingTools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/material.js + 1 modules
var Materials_material = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.js
var Textures_renderTargetTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js
class ProceduralTextureSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_PROCEDURALTEXTURE */.l.NAME_PROCEDURALTEXTURE, this.scene = scene, this.scene.proceduralTextures = [];}register() {this.scene._beforeClearStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE */.l.STEP_BEFORECLEAR_PROCEDURALTEXTURE, this, this._beforeClear);}rebuild() {}dispose() {}_beforeClear() {if (this.scene.proceduralTexturesEnabled) {tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Procedural textures", 0 < this.scene.proceduralTextures.length);for (let proceduralIndex = 0; proceduralIndex < this.scene.proceduralTextures.length; proceduralIndex++) {const proceduralTexture = this.scene.proceduralTextures[proceduralIndex];proceduralTexture._shouldRender() && proceduralTexture.render();}tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Procedural textures", 0 < this.scene.proceduralTextures.length);}}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js + 1 modules
var engine_renderTarget = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetCube.js
var engine_renderTargetCube = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetCube.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__("./node_modules/@babylonjs/core/Engines/shaderStore.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/procedural.vertex.js
const procedural_vertex_name = "proceduralVertexShader",shader = `attribute vec2 position;
varying vec2 vPosition;
varying vec2 vUV;
const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vPosition=position;
vUV=position*madd+madd;
gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.proceduralVertexShader */.v.ShadersStore.proceduralVertexShader = shader;const proceduralVertexShader = { name: "proceduralVertexShader", shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/drawWrapper.js
var Materials_drawWrapper = __webpack_require__("./node_modules/@babylonjs/core/Materials/drawWrapper.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js
class ProceduralTexture extends Textures_texture/* Texture */.x {constructor(name, size, fragment, scene, fallbackTexture = null, generateMipMaps = !0, isCube = !1, textureType = 0) {super(null, scene, !generateMipMaps), this.isEnabled = !0, this.autoClear = !0, this.onGeneratedObservable = new observable/* Observable */.y$(), this.onBeforeGenerationObservable = new observable/* Observable */.y$(), this.nodeMaterialSource = null, this._textures = {}, this._currentRefreshId = -1, this._frameId = -1, this._refreshRate = 1, this._vertexBuffers = {}, this._uniforms = [], this._samplers = [], this._floats = {}, this._ints = {}, this._floatsArrays = {}, this._colors3 = {}, this._colors4 = {}, this._vectors2 = {}, this._vectors3 = {}, this._matrices = {}, this._fallbackTextureUsed = !1, this._cachedDefines = null, this._contentUpdateId = -1, this._rtWrapper = null, scene = this.getScene() || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_PROCEDURALTEXTURE */.l.NAME_PROCEDURALTEXTURE);component || (component = new ProceduralTextureSceneComponent(scene), scene._addComponent(component)), scene.proceduralTextures.push(this), this._fullEngine = scene.getEngine(), this.name = name, this.isRenderTarget = !0, this._size = size, this._textureType = textureType, this._generateMipMaps = generateMipMaps, this._drawWrapper = new Materials_drawWrapper/* DrawWrapper */.q(this._fullEngine), this.setFragment(fragment), this._fallbackTexture = fallbackTexture;const rtWrapper = this._createRtWrapper(isCube, size, generateMipMaps, textureType);this._texture = rtWrapper.texture;const vertices = [];vertices.push(1, 1), vertices.push(-1, 1), vertices.push(-1, -1), vertices.push(1, -1), this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = new Buffers_buffer/* VertexBuffer */.o(this._fullEngine, vertices, Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, !1, !1, 2), this._createIndexBuffer();}_createRtWrapper(isCube, size, generateMipMaps, textureType) {return isCube ? (this._rtWrapper = this._fullEngine.createRenderTargetCubeTexture(size, { generateMipMaps: generateMipMaps, generateDepthBuffer: !1, generateStencilBuffer: !1, type: textureType }), this.setFloat("face", 0)) : this._rtWrapper = this._fullEngine.createRenderTargetTexture(size, { generateMipMaps: generateMipMaps, generateDepthBuffer: !1, generateStencilBuffer: !1, type: textureType }), this._rtWrapper;}getEffect() {return this._drawWrapper.effect;}_setEffect(effect) {this._drawWrapper.effect = effect;}getContent() {return this._contentData && this._frameId === this._contentUpdateId ? this._contentData : (this._contentData ? this._contentData.then((buffer) => {this._contentData = this.readPixels(0, 0, buffer), this._contentUpdateId = this._frameId;}) : (this._contentData = this.readPixels(0, 0), this._contentUpdateId = this._frameId), this._contentData);}_createIndexBuffer() {const engine = this._fullEngine,indices = [];indices.push(0), indices.push(1), indices.push(2), indices.push(0), indices.push(2), indices.push(3), this._indexBuffer = engine.createIndexBuffer(indices);}_rebuild() {const vb = this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];vb && vb._rebuild(), this._createIndexBuffer(), this.refreshRate === Textures_renderTargetTexture/* RenderTargetTexture.REFRESHRATE_RENDER_ONCE */._.REFRESHRATE_RENDER_ONCE && (this.refreshRate = Textures_renderTargetTexture/* RenderTargetTexture.REFRESHRATE_RENDER_ONCE */._.REFRESHRATE_RENDER_ONCE);}reset() {var _a;null === (_a = this._drawWrapper.effect) || void 0 === _a ? void 0 : _a.dispose();}_getDefines() {return "";}isReady() {const engine = this._fullEngine;let shaders;if (this.nodeMaterialSource) return this._drawWrapper.effect.isReady();if (!this._fragment) return !1;if (this._fallbackTextureUsed) return !0;if (!this._texture) return !1;const defines = this._getDefines();return !!(this._drawWrapper.effect && defines === this._cachedDefines && this._drawWrapper.effect.isReady()) || (shaders = void 0 === this._fragment.fragmentElement ? { vertex: "procedural", fragment: this._fragment } : { vertex: "procedural", fragmentElement: this._fragment.fragmentElement }, this._cachedDefines !== defines && (this._cachedDefines = defines, this._drawWrapper.effect = engine.createEffect(shaders, [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], this._uniforms, this._samplers, defines, void 0, void 0, () => {var _a;null === (_a = this._rtWrapper) || void 0 === _a ? void 0 : _a.dispose(), this._rtWrapper = this._texture = null, this._fallbackTexture && (this._texture = this._fallbackTexture._texture, this._texture && this._texture.incrementReferences()), this._fallbackTextureUsed = !0;})), this._drawWrapper.effect.isReady());}resetRefreshCounter() {this._currentRefreshId = -1;}setFragment(fragment) {this._fragment = fragment;}get refreshRate() {return this._refreshRate;}set refreshRate(value) {this._refreshRate = value, this.resetRefreshCounter();}_shouldRender() {return this.isEnabled && this.isReady() && this._texture ? !this._fallbackTextureUsed && (-1 === this._currentRefreshId ? (this._currentRefreshId = 1, this._frameId++, !0) : this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, this._frameId++, !0) : (this._currentRefreshId++, !1)) : (this._texture && (this._texture.isReady = !1), !1);}getRenderSize() {return this._size;}resize(size, generateMipMaps) {if (!this._fallbackTextureUsed && this._rtWrapper && this._texture) {const isCube = this._texture.isCube;this._rtWrapper.dispose();const rtWrapper = this._createRtWrapper(isCube, size, generateMipMaps, this._textureType);this._texture = rtWrapper.texture, this._size = size, this._generateMipMaps = generateMipMaps;}}_checkUniform(uniformName) {-1 === this._uniforms.indexOf(uniformName) && this._uniforms.push(uniformName);}setTexture(name, texture) {return -1 === this._samplers.indexOf(name) && this._samplers.push(name), this._textures[name] = texture, this;}setFloat(name, value) {return this._checkUniform(name), this._floats[name] = value, this;}setInt(name, value) {return this._checkUniform(name), this._ints[name] = value, this;}setFloats(name, value) {return this._checkUniform(name), this._floatsArrays[name] = value, this;}setColor3(name, value) {return this._checkUniform(name), this._colors3[name] = value, this;}setColor4(name, value) {return this._checkUniform(name), this._colors4[name] = value, this;}setVector2(name, value) {return this._checkUniform(name), this._vectors2[name] = value, this;}setVector3(name, value) {return this._checkUniform(name), this._vectors3[name] = value, this;}setMatrix(name, value) {return this._checkUniform(name), this._matrices[name] = value, this;}render() {var _a, _b;const scene = this.getScene();if (scene) {const engine = this._fullEngine;if (engine.enableEffect(this._drawWrapper), this.onBeforeGenerationObservable.notifyObservers(this), engine.setState(!1), !this.nodeMaterialSource) {for (const name in this._textures) this._drawWrapper.effect.setTexture(name, this._textures[name]);for (const name in this._ints) this._drawWrapper.effect.setInt(name, this._ints[name]);for (const name in this._floats) this._drawWrapper.effect.setFloat(name, this._floats[name]);for (const name in this._floatsArrays) this._drawWrapper.effect.setArray(name, this._floatsArrays[name]);for (const name in this._colors3) this._drawWrapper.effect.setColor3(name, this._colors3[name]);for (const name in this._colors4) {const color = this._colors4[name];this._drawWrapper.effect.setFloat4(name, color.r, color.g, color.b, color.a);}for (const name in this._vectors2) this._drawWrapper.effect.setVector2(name, this._vectors2[name]);for (const name in this._vectors3) this._drawWrapper.effect.setVector3(name, this._vectors3[name]);for (const name in this._matrices) this._drawWrapper.effect.setMatrix(name, this._matrices[name]);}if (this._texture && this._rtWrapper) {null === (_a = engine._debugPushGroup) || void 0 === _a ? void 0 : _a.call(engine, `procedural texture generation for ${this.name}`, 1);const viewPort = engine.currentViewport;if (this.isCube) for (let face = 0; 6 > face; face++) engine.bindFramebuffer(this._rtWrapper, face, void 0, void 0, !0), engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._drawWrapper.effect), this._drawWrapper.effect.setFloat("face", face), this.autoClear && engine.clear(scene.clearColor, !0, !1, !1), engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, 6);else engine.bindFramebuffer(this._rtWrapper, 0, void 0, void 0, !0), engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._drawWrapper.effect), this.autoClear && engine.clear(scene.clearColor, !0, !1, !1), engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, 6);engine.unBindFramebuffer(this._rtWrapper, this.isCube), viewPort && engine.setViewport(viewPort), this.isCube && engine.generateMipMapsForCubemap(this._texture), null === (_b = engine._debugPopGroup) || void 0 === _b ? void 0 : _b.call(engine, 1), this.onGenerated && this.onGenerated(), this.onGeneratedObservable.notifyObservers(this);}}}clone() {const textureSize = this.getSize(),newTexture = new ProceduralTexture(this.name, textureSize.width, this._fragment, this.getScene(), this._fallbackTexture, this._generateMipMaps);return newTexture.hasAlpha = this.hasAlpha, newTexture.level = this.level, newTexture.coordinatesMode = this.coordinatesMode, newTexture;}dispose() {const scene = this.getScene();if (scene) {const index = scene.proceduralTextures.indexOf(this);0 <= index && scene.proceduralTextures.splice(index, 1);const vertexBuffer = this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];vertexBuffer && (vertexBuffer.dispose(), this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = null), this._indexBuffer && this._fullEngine._releaseBuffer(this._indexBuffer) && (this._indexBuffer = null), this.onGeneratedObservable.clear(), this.onBeforeGenerationObservable.clear(), super.dispose();}}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ProceduralTexture.prototype, "isEnabled", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ProceduralTexture.prototype, "autoClear", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ProceduralTexture.prototype, "_generateMipMaps", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ProceduralTexture.prototype, "_size", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ProceduralTexture.prototype, "refreshRate", null), (0,typeStore/* RegisterClass */.H)("BABYLON.ProceduralTexture", ProceduralTexture);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/trigonometryBlock.js
var TrigonometryBlockOperations;(function (TrigonometryBlockOperations) {TrigonometryBlockOperations[TrigonometryBlockOperations.Cos = 0] = "Cos", TrigonometryBlockOperations[TrigonometryBlockOperations.Sin = 1] = "Sin", TrigonometryBlockOperations[TrigonometryBlockOperations.Abs = 2] = "Abs", TrigonometryBlockOperations[TrigonometryBlockOperations.Exp = 3] = "Exp", TrigonometryBlockOperations[TrigonometryBlockOperations.Exp2 = 4] = "Exp2", TrigonometryBlockOperations[TrigonometryBlockOperations.Round = 5] = "Round", TrigonometryBlockOperations[TrigonometryBlockOperations.Floor = 6] = "Floor", TrigonometryBlockOperations[TrigonometryBlockOperations.Ceiling = 7] = "Ceiling", TrigonometryBlockOperations[TrigonometryBlockOperations.Sqrt = 8] = "Sqrt", TrigonometryBlockOperations[TrigonometryBlockOperations.Log = 9] = "Log", TrigonometryBlockOperations[TrigonometryBlockOperations.Tan = 10] = "Tan", TrigonometryBlockOperations[TrigonometryBlockOperations.ArcTan = 11] = "ArcTan", TrigonometryBlockOperations[TrigonometryBlockOperations.ArcCos = 12] = "ArcCos", TrigonometryBlockOperations[TrigonometryBlockOperations.ArcSin = 13] = "ArcSin", TrigonometryBlockOperations[TrigonometryBlockOperations.Fract = 14] = "Fract", TrigonometryBlockOperations[TrigonometryBlockOperations.Sign = 15] = "Sign", TrigonometryBlockOperations[TrigonometryBlockOperations.Radians = 16] = "Radians", TrigonometryBlockOperations[TrigonometryBlockOperations.Degrees = 17] = "Degrees";})(TrigonometryBlockOperations || (TrigonometryBlockOperations = {}));class TrigonometryBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.operation = TrigonometryBlockOperations.Cos, this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];}getClassName() {return "TrigonometryBlock";}get input() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];let operation = "";switch (this.operation) {case TrigonometryBlockOperations.Cos:{operation = "cos";break;}case TrigonometryBlockOperations.Sin:{operation = "sin";break;}case TrigonometryBlockOperations.Abs:{operation = "abs";break;}case TrigonometryBlockOperations.Exp:{operation = "exp";break;}case TrigonometryBlockOperations.Exp2:{operation = "exp2";break;}case TrigonometryBlockOperations.Round:{operation = "round";break;}case TrigonometryBlockOperations.Floor:{operation = "floor";break;}case TrigonometryBlockOperations.Ceiling:{operation = "ceil";break;}case TrigonometryBlockOperations.Sqrt:{operation = "sqrt";break;}case TrigonometryBlockOperations.Log:{operation = "log";break;}case TrigonometryBlockOperations.Tan:{operation = "tan";break;}case TrigonometryBlockOperations.ArcTan:{operation = "atan";break;}case TrigonometryBlockOperations.ArcCos:{operation = "acos";break;}case TrigonometryBlockOperations.ArcSin:{operation = "asin";break;}case TrigonometryBlockOperations.Fract:{operation = "fract";break;}case TrigonometryBlockOperations.Sign:{operation = "sign";break;}case TrigonometryBlockOperations.Radians:{operation = "radians";break;}case TrigonometryBlockOperations.Degrees:{operation = "degrees";break;}}return state.compilationString += this._declareOutput(output, state) + ` = ${operation}(${this.input.associatedVariableName});\r\n`, this;}serialize() {const serializationObject = super.serialize();return serializationObject.operation = this.operation, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.operation = serializationObject.operation;}_dumpPropertiesCode() {const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.operation = BABYLON.TrigonometryBlockOperations.${TrigonometryBlockOperations[this.operation]};\r\n`;return codeString;}}(0,typeStore/* RegisterClass */.H)("BABYLON.TrigonometryBlock", TrigonometryBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/nodeMaterial.js
const onCreatedEffectParameters = { effect: null, subMesh: null };class NodeMaterialDefines extends materialDefines/* MaterialDefines */.H {constructor() {super(), this.NORMAL = !1, this.TANGENT = !1, this.UV1 = !1, this.UV2 = !1, this.UV3 = !1, this.UV4 = !1, this.UV5 = !1, this.UV6 = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.BONETEXTURE = !1, this.MORPHTARGETS = !1, this.MORPHTARGETS_NORMAL = !1, this.MORPHTARGETS_TANGENT = !1, this.MORPHTARGETS_UV = !1, this.NUM_MORPH_INFLUENCERS = 0, this.MORPHTARGETS_TEXTURE = !1, this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.EXPOSURE = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.BUMPDIRECTUV = 0, this.CAMERA_ORTHOGRAPHIC = !1, this.CAMERA_PERSPECTIVE = !1, this.rebuild();}setValue(name, value, markAsUnprocessedIfDirty = !1) {this[name] === void 0 && this._keys.push(name), markAsUnprocessedIfDirty && this[name] !== value && this.markAsUnprocessed(), this[name] = value;}}class NodeMaterial extends pushMaterial/* PushMaterial */.a {static _BlockIsTextureBlock(block) {return "TextureBlock" === block.getClassName() || "ReflectionTextureBaseBlock" === block.getClassName() || "RefractionBlock" === block.getClassName() || "CurrentScreenBlock" === block.getClassName() || "ParticleTextureBlock" === block.getClassName() || "ImageSourceBlock" === block.getClassName() || "TriPlanarBlock" === block.getClassName() || "BiPlanarBlock" === block.getClassName();}_getGlobalNodeMaterialEditor() {return "undefined" == typeof NODEEDITOR ? "undefined" != typeof BABYLON && "undefined" != typeof BABYLON.NodeEditor ? BABYLON : void 0 : NODEEDITOR;}get options() {return this._options;}set options(options) {this._options = options;}get imageProcessingConfiguration() {return this._imageProcessingConfiguration;}set imageProcessingConfiguration(value) {this._attachImageProcessingConfiguration(value), this._markAllSubMeshesAsTexturesDirty();}get mode() {return this._mode;}set mode(value) {this._mode = value;}get buildId() {return this._buildId;}set buildId(value) {this._buildId = value;}constructor(name, scene, options = {}) {super(name, scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene), this._buildId = NodeMaterial._BuildIdGenerator++, this._buildWasSuccessful = !1, this._cachedWorldViewMatrix = new math_vector/* Matrix */.y3(), this._cachedWorldViewProjectionMatrix = new math_vector/* Matrix */.y3(), this._optimizers = [], this._animationFrame = -1, this.BJSNODEMATERIALEDITOR = this._getGlobalNodeMaterialEditor(), this.editorData = null, this.ignoreAlpha = !1, this.maxSimultaneousLights = 4, this.onBuildObservable = new observable/* Observable */.y$(), this._vertexOutputNodes = [], this._fragmentOutputNodes = [], this.attachedBlocks = [], this._mode = NodeMaterialModes.Material, this.forceAlphaBlending = !1, this._options = { emitComments: !1, ...options }, this._attachImageProcessingConfiguration(null);}getClassName() {return "NodeMaterial";}_attachImageProcessingConfiguration(configuration) {configuration === this._imageProcessingConfiguration || (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = configuration ? configuration : this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {this._markAllSubMeshesAsImageProcessingDirty();})));}getBlockByName(name) {let result = null;for (const block of this.attachedBlocks) if (block.name === name) if (!result) result = block;else return tools/* Tools.Warn */.w1.Warn("More than one block was found with the name `" + name + "`"), result;return result;}getBlockByPredicate(predicate) {for (const block of this.attachedBlocks) if (predicate(block)) return block;return null;}getInputBlockByPredicate(predicate) {for (const block of this.attachedBlocks) if (block.isInput && predicate(block)) return block;return null;}getInputBlocks() {const blocks = [];for (const block of this.attachedBlocks) block.isInput && blocks.push(block);return blocks;}registerOptimizer(optimizer) {const index = this._optimizers.indexOf(optimizer);if (!(-1 < index)) return this._optimizers.push(optimizer), this;}unregisterOptimizer(optimizer) {const index = this._optimizers.indexOf(optimizer);if (-1 !== index) return this._optimizers.splice(index, 1), this;}addOutputNode(node) {if (null === node.target) throw "This node is not meant to be an output node. You may want to explicitly set its target value.";return 0 != (node.target & NodeMaterialBlockTargets.Vertex) && this._addVertexOutputNode(node), 0 != (node.target & NodeMaterialBlockTargets.Fragment) && this._addFragmentOutputNode(node), this;}removeOutputNode(node) {return null === node.target ? this : (0 != (node.target & NodeMaterialBlockTargets.Vertex) && this._removeVertexOutputNode(node), 0 != (node.target & NodeMaterialBlockTargets.Fragment) && this._removeFragmentOutputNode(node), this);}_addVertexOutputNode(node) {if (-1 === this._vertexOutputNodes.indexOf(node)) return node.target = NodeMaterialBlockTargets.Vertex, this._vertexOutputNodes.push(node), this;}_removeVertexOutputNode(node) {const index = this._vertexOutputNodes.indexOf(node);if (-1 !== index) return this._vertexOutputNodes.splice(index, 1), this;}_addFragmentOutputNode(node) {if (-1 === this._fragmentOutputNodes.indexOf(node)) return node.target = NodeMaterialBlockTargets.Fragment, this._fragmentOutputNodes.push(node), this;}_removeFragmentOutputNode(node) {const index = this._fragmentOutputNodes.indexOf(node);if (-1 !== index) return this._fragmentOutputNodes.splice(index, 1), this;}needAlphaBlending() {return !this.ignoreAlpha && (this.forceAlphaBlending || 1 > this.alpha || this._sharedData && this._sharedData.hints.needAlphaBlending);}needAlphaTesting() {return this._sharedData && this._sharedData.hints.needAlphaTesting;}_initializeBlock(node, state, nodesToProcessForOtherBuildState, autoConfigure = !0) {if (node.initialize(state), autoConfigure && node.autoConfigure(this), node._preparationId = this._buildId, -1 === this.attachedBlocks.indexOf(node)) {if (node.isUnique) {const className = node.getClassName();for (const other of this.attachedBlocks) if (other.getClassName() === className) throw `Cannot have multiple blocks of type ${className} in the same NodeMaterial`;}this.attachedBlocks.push(node);}for (const input of node.inputs) {input.associatedVariableName = "";const connectedPoint = input.connectedPoint;if (connectedPoint) {const block = connectedPoint.ownerBlock;block !== node && (block.target === NodeMaterialBlockTargets.VertexAndFragment ? nodesToProcessForOtherBuildState.push(block) : state.target === NodeMaterialBlockTargets.Fragment && block.target === NodeMaterialBlockTargets.Vertex && block._preparationId !== this._buildId && nodesToProcessForOtherBuildState.push(block), this._initializeBlock(block, state, nodesToProcessForOtherBuildState, autoConfigure));}}for (const output of node.outputs) output.associatedVariableName = "";}_resetDualBlocks(node, id) {node.target === NodeMaterialBlockTargets.VertexAndFragment && (node.buildId = id);for (const inputs of node.inputs) {const connectedPoint = inputs.connectedPoint;if (connectedPoint) {const block = connectedPoint.ownerBlock;block !== node && this._resetDualBlocks(block, id);}}}removeBlock(block) {const attachedBlockIndex = this.attachedBlocks.indexOf(block);-1 < attachedBlockIndex && this.attachedBlocks.splice(attachedBlockIndex, 1), block.isFinalMerger && this.removeOutputNode(block);}build(verbose = !1, updateBuildId = !0, autoConfigure = !0) {this._buildWasSuccessful = !1;const engine = this.getScene().getEngine(),allowEmptyVertexProgram = this._mode === NodeMaterialModes.Particle;if (0 === this._vertexOutputNodes.length && !allowEmptyVertexProgram) throw "You must define at least one vertexOutputNode";if (0 === this._fragmentOutputNodes.length) throw "You must define at least one fragmentOutputNode";this._vertexCompilationState = new NodeMaterialBuildState(), this._vertexCompilationState.supportUniformBuffers = engine.supportsUniformBuffers, this._vertexCompilationState.target = NodeMaterialBlockTargets.Vertex, this._fragmentCompilationState = new NodeMaterialBuildState(), this._fragmentCompilationState.supportUniformBuffers = engine.supportsUniformBuffers, this._fragmentCompilationState.target = NodeMaterialBlockTargets.Fragment, this._sharedData = new NodeMaterialBuildStateSharedData(), this._sharedData.fragmentOutputNodes = this._fragmentOutputNodes, this._vertexCompilationState.sharedData = this._sharedData, this._fragmentCompilationState.sharedData = this._sharedData, this._sharedData.buildId = this._buildId, this._sharedData.emitComments = this._options.emitComments, this._sharedData.verbose = verbose, this._sharedData.scene = this.getScene(), this._sharedData.allowEmptyVertexProgram = allowEmptyVertexProgram;const vertexNodes = [],fragmentNodes = [];for (const vertexOutputNode of this._vertexOutputNodes) vertexNodes.push(vertexOutputNode), this._initializeBlock(vertexOutputNode, this._vertexCompilationState, fragmentNodes, autoConfigure);for (const fragmentOutputNode of this._fragmentOutputNodes) fragmentNodes.push(fragmentOutputNode), this._initializeBlock(fragmentOutputNode, this._fragmentCompilationState, vertexNodes, autoConfigure);this.optimize();for (const vertexOutputNode of vertexNodes) vertexOutputNode.build(this._vertexCompilationState, vertexNodes);this._fragmentCompilationState.uniforms = this._vertexCompilationState.uniforms.slice(0), this._fragmentCompilationState._uniformDeclaration = this._vertexCompilationState._uniformDeclaration, this._fragmentCompilationState._constantDeclaration = this._vertexCompilationState._constantDeclaration, this._fragmentCompilationState._vertexState = this._vertexCompilationState;for (const fragmentOutputNode of fragmentNodes) this._resetDualBlocks(fragmentOutputNode, this._buildId - 1);for (const fragmentOutputNode of fragmentNodes) fragmentOutputNode.build(this._fragmentCompilationState, fragmentNodes);this._vertexCompilationState.finalize(this._vertexCompilationState), this._fragmentCompilationState.finalize(this._fragmentCompilationState), updateBuildId && (this._buildId = NodeMaterial._BuildIdGenerator++), this._sharedData.emitErrors(), verbose && (console.log("Vertex shader:"), console.log(this._vertexCompilationState.compilationString), console.log("Fragment shader:"), console.log(this._fragmentCompilationState.compilationString)), this._buildWasSuccessful = !0, this.onBuildObservable.notifyObservers(this);const meshes = this.getScene().meshes;for (const mesh of meshes) if (mesh.subMeshes) for (const subMesh of mesh.subMeshes) {if (subMesh.getMaterial() !== this) continue;if (!subMesh.materialDefines) continue;const defines = subMesh.materialDefines;defines.markAllAsDirty(), defines.reset();}}optimize() {for (const optimizer of this._optimizers) optimizer.optimize(this._vertexOutputNodes, this._fragmentOutputNodes);}_prepareDefinesForAttributes(mesh, defines) {const oldNormal = defines.NORMAL,oldTangent = defines.TANGENT;defines.NORMAL = mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind), defines.TANGENT = mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.TangentKind */.o.TangentKind);let uvChanged = !1;for (let i = 1; 6 >= i; ++i) {const oldUV = defines["UV" + i];defines["UV" + i] = mesh.isVerticesDataPresent(`uv${1 == i ? "" : i}`), uvChanged = uvChanged || defines["UV" + i] !== oldUV;}(oldNormal !== defines.NORMAL || oldTangent !== defines.TANGENT || uvChanged) && defines.markAsAttributesDirty();}createPostProcess(camera, options = 1, samplingMode = 1, engine, reusable, textureType = 0, textureFormat = 5) {return this.mode === NodeMaterialModes.PostProcess ? this._createEffectForPostProcess(null, camera, options, samplingMode, engine, reusable, textureType, textureFormat) : (console.log("Incompatible material mode"), null);}createEffectForPostProcess(postProcess) {this._createEffectForPostProcess(postProcess);}_createEffectForPostProcess(postProcess, camera, options = 1, samplingMode = 1, engine, reusable, textureType = 0, textureFormat = 5) {let tempName = this.name + this._buildId;const defines = new NodeMaterialDefines(),dummyMesh = new abstractMesh/* AbstractMesh */.x(tempName + "PostProcess", this.getScene());let buildId = this._buildId;return this._processDefines(dummyMesh, defines), Materials_effect/* Effect.RegisterShader */.Q.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString), postProcess ? postProcess.updateEffect(defines.toString(), this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, { maxSimultaneousLights: this.maxSimultaneousLights }, void 0, void 0, tempName, tempName) : postProcess = new PostProcesses_postProcess/* PostProcess */.D(this.name + "PostProcess", tempName, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, options, camera, samplingMode, engine, reusable, defines.toString(), textureType, tempName, { maxSimultaneousLights: this.maxSimultaneousLights }, !1, textureFormat), postProcess.nodeMaterialSource = this, postProcess.onApplyObservable.add((effect) => {buildId !== this._buildId && (delete Materials_effect/* Effect.ShadersStore */.Q.ShadersStore[tempName + "VertexShader"], delete Materials_effect/* Effect.ShadersStore */.Q.ShadersStore[tempName + "PixelShader"], tempName = this.name + this._buildId, defines.markAllAsDirty(), buildId = this._buildId);const result = this._processDefines(dummyMesh, defines);result && (Materials_effect/* Effect.RegisterShader */.Q.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString), timingTools/* TimingTools.SetImmediate */.Q.SetImmediate(() => postProcess.updateEffect(defines.toString(), this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, { maxSimultaneousLights: this.maxSimultaneousLights }, void 0, void 0, tempName, tempName))), this._checkInternals(effect);}), postProcess;}createProceduralTexture(size, scene) {if (this.mode !== NodeMaterialModes.ProceduralTexture) return console.log("Incompatible material mode"), null;let tempName = this.name + this._buildId;const proceduralTexture = new ProceduralTexture(tempName, size, null, scene),dummyMesh = new abstractMesh/* AbstractMesh */.x(tempName + "Procedural", this.getScene());dummyMesh.reservedDataStore = { hidden: !0 };const defines = new NodeMaterialDefines(),result = this._processDefines(dummyMesh, defines);Materials_effect/* Effect.RegisterShader */.Q.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString);let effect = this.getScene().getEngine().createEffect({ vertexElement: tempName, fragmentElement: tempName }, [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, defines.toString(), null === result || void 0 === result ? void 0 : result.fallbacks, void 0);proceduralTexture.nodeMaterialSource = this, proceduralTexture._setEffect(effect);let buildId = this._buildId;return proceduralTexture.onBeforeGenerationObservable.add(() => {buildId !== this._buildId && (delete Materials_effect/* Effect.ShadersStore */.Q.ShadersStore[tempName + "VertexShader"], delete Materials_effect/* Effect.ShadersStore */.Q.ShadersStore[tempName + "PixelShader"], tempName = this.name + this._buildId, defines.markAllAsDirty(), buildId = this._buildId);const result = this._processDefines(dummyMesh, defines);result && (Materials_effect/* Effect.RegisterShader */.Q.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString), timingTools/* TimingTools.SetImmediate */.Q.SetImmediate(() => {effect = this.getScene().getEngine().createEffect({ vertexElement: tempName, fragmentElement: tempName }, [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, defines.toString(), null === result || void 0 === result ? void 0 : result.fallbacks, void 0), proceduralTexture._setEffect(effect);})), this._checkInternals(effect);}), proceduralTexture;}_createEffectForParticles(particleSystem, blendMode, onCompiled, onError, effect, defines, dummyMesh, particleSystemDefinesJoined = "") {let tempName = this.name + this._buildId + "_" + blendMode;defines || (defines = new NodeMaterialDefines()), dummyMesh || (dummyMesh = this.getScene().getMeshByName(this.name + "Particle"), !dummyMesh && (dummyMesh = new abstractMesh/* AbstractMesh */.x(this.name + "Particle", this.getScene()), dummyMesh.reservedDataStore = { hidden: !0 }));let buildId = this._buildId;const particleSystemDefines = [];let join = particleSystemDefinesJoined;if (!effect) {const result = this._processDefines(dummyMesh, defines);Materials_effect/* Effect.RegisterShader */.Q.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString), particleSystem.fillDefines(particleSystemDefines, blendMode), join = particleSystemDefines.join("\n"), effect = this.getScene().getEngine().createEffectForParticles(tempName, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, defines.toString() + "\n" + join, null === result || void 0 === result ? void 0 : result.fallbacks, onCompiled, onError, particleSystem), particleSystem.setCustomEffect(effect, blendMode);}effect.onBindObservable.add((effect) => {buildId !== this._buildId && (delete Materials_effect/* Effect.ShadersStore */.Q.ShadersStore[tempName + "PixelShader"], tempName = this.name + this._buildId + "_" + blendMode, defines.markAllAsDirty(), buildId = this._buildId), particleSystemDefines.length = 0, particleSystem.fillDefines(particleSystemDefines, blendMode);const particleSystemDefinesJoinedCurrent = particleSystemDefines.join("\n");particleSystemDefinesJoinedCurrent !== join && (defines.markAllAsDirty(), join = particleSystemDefinesJoinedCurrent);const result = this._processDefines(dummyMesh, defines);return result ? (Materials_effect/* Effect.RegisterShader */.Q.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString), effect = this.getScene().getEngine().createEffectForParticles(tempName, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, defines.toString() + "\n" + join, null === result || void 0 === result ? void 0 : result.fallbacks, onCompiled, onError, particleSystem), particleSystem.setCustomEffect(effect, blendMode), void this._createEffectForParticles(particleSystem, blendMode, onCompiled, onError, effect, defines, dummyMesh, particleSystemDefinesJoined)) : void this._checkInternals(effect);});}_checkInternals(effect) {if (this._sharedData.animatedInputs) {const scene = this.getScene(),frameId = scene.getFrameId();if (this._animationFrame !== frameId) {for (const input of this._sharedData.animatedInputs) input.animate(scene);this._animationFrame = frameId;}}for (const block of this._sharedData.bindableBlocks) block.bind(effect, this);for (const inputBlock of this._sharedData.inputBlocks) inputBlock._transmit(effect, this.getScene(), this);}createEffectForParticles(particleSystem, onCompiled, onError) {return this.mode === NodeMaterialModes.Particle ? void (this._createEffectForParticles(particleSystem, BaseParticleSystem.BLENDMODE_ONEONE, onCompiled, onError), this._createEffectForParticles(particleSystem, BaseParticleSystem.BLENDMODE_MULTIPLY, onCompiled, onError)) : void console.log("Incompatible material mode");}createAsShadowDepthWrapper(targetMaterial) {return this.mode === NodeMaterialModes.Material ? void (targetMaterial.shadowDepthWrapper = new BABYLON.ShadowDepthWrapper(this, this.getScene())) : void console.log("Incompatible material mode");}_processDefines(mesh, defines, useInstances = !1, subMesh) {let result = null;const scene = this.getScene();if (materialHelper/* MaterialHelper.PrepareDefinesForCamera */.G.PrepareDefinesForCamera(scene, defines) && defines.markAsMiscDirty(), this._sharedData.blocksWithDefines.forEach((b) => {b.initializeDefines(mesh, this, defines, useInstances);}), this._sharedData.blocksWithDefines.forEach((b) => {b.prepareDefines(mesh, this, defines, useInstances, subMesh);}), defines.isDirty) {const lightDisposed = defines._areLightsDisposed;defines.markAsProcessed(), this._vertexCompilationState.compilationString = this._vertexCompilationState._builtCompilationString, this._fragmentCompilationState.compilationString = this._fragmentCompilationState._builtCompilationString, this._sharedData.repeatableContentBlocks.forEach((b) => {b.replaceRepeatableContent(this._vertexCompilationState, this._fragmentCompilationState, mesh, defines);});const uniformBuffers = [];this._sharedData.dynamicUniformBlocks.forEach((b) => {b.updateUniformsAndSamples(this._vertexCompilationState, this, defines, uniformBuffers);});const mergedUniforms = this._vertexCompilationState.uniforms;this._fragmentCompilationState.uniforms.forEach((u) => {const index = mergedUniforms.indexOf(u);-1 === index && mergedUniforms.push(u);});const mergedSamplers = this._vertexCompilationState.samplers;this._fragmentCompilationState.samplers.forEach((s) => {const index = mergedSamplers.indexOf(s);-1 === index && mergedSamplers.push(s);});const fallbacks = new effectFallbacks/* EffectFallbacks */.L();this._sharedData.blocksWithFallbacks.forEach((b) => {b.provideFallbacks(mesh, fallbacks);}), result = { lightDisposed, uniformBuffers, mergedUniforms, mergedSamplers, fallbacks };}return result;}isReadyForSubMesh(mesh, subMesh, useInstances = !1) {if (!this._buildWasSuccessful) return !1;const scene = this.getScene();if (this._sharedData.animatedInputs) {const frameId = scene.getFrameId();if (this._animationFrame !== frameId) {for (const input of this._sharedData.animatedInputs) input.animate(scene);this._animationFrame = frameId;}}if (subMesh.effect && this.isFrozen && subMesh.effect._wasPreviouslyReady && subMesh.effect._wasPreviouslyUsingInstances === useInstances) return !0;subMesh.materialDefines || (subMesh.materialDefines = new NodeMaterialDefines());const defines = subMesh.materialDefines;if (this._isReadyForSubMesh(subMesh)) return !0;const engine = scene.getEngine();if (this._prepareDefinesForAttributes(mesh, defines), this._sharedData.blockingBlocks.some((b) => !b.isReady(mesh, this, defines, useInstances))) return !1;const result = this._processDefines(mesh, defines, useInstances, subMesh);if (result) {const previousEffect = subMesh.effect,join = defines.toString();let effect = engine.createEffect({ vertex: "nodeMaterial" + this._buildId, fragment: "nodeMaterial" + this._buildId, vertexSource: this._vertexCompilationState.compilationString, fragmentSource: this._fragmentCompilationState.compilationString }, { attributes: this._vertexCompilationState.attributes, uniformsNames: result.mergedUniforms, uniformBuffersNames: result.uniformBuffers, samplers: result.mergedSamplers, defines: join, fallbacks: result.fallbacks, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS } }, engine);if (effect) if (this._onEffectCreatedObservable && (onCreatedEffectParameters.effect = effect, onCreatedEffectParameters.subMesh = subMesh, this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters)), !(this.allowShaderHotSwapping && previousEffect && !effect.isReady())) scene.resetCachedMaterial(), subMesh.setEffect(effect, defines, this._materialContext);else if (effect = previousEffect, defines.markAsUnprocessed(), result.lightDisposed) return defines._areLightsDisposed = !0, !1;}return !!(subMesh.effect && subMesh.effect.isReady()) && (defines._renderId = scene.getRenderId(), subMesh.effect._wasPreviouslyReady = !0, subMesh.effect._wasPreviouslyUsingInstances = useInstances, scene.performancePriority !== core_scene/* ScenePerformancePriority.BackwardCompatible */.a.BackwardCompatible && (this.checkReadyOnlyOnce = !0), !0);}get compiledShaders() {return `// Vertex shader\r\n${this._vertexCompilationState.compilationString}\r\n\r\n// Fragment shader\r\n${this._fragmentCompilationState.compilationString}`;}bindOnlyWorldMatrix(world) {const scene = this.getScene();if (this._activeEffect) {const hints = this._sharedData.hints;hints.needWorldViewMatrix && world.multiplyToRef(scene.getViewMatrix(), this._cachedWorldViewMatrix), hints.needWorldViewProjectionMatrix && world.multiplyToRef(scene.getTransformMatrix(), this._cachedWorldViewProjectionMatrix);for (const inputBlock of this._sharedData.inputBlocks) inputBlock._transmitWorld(this._activeEffect, world, this._cachedWorldViewMatrix, this._cachedWorldViewProjectionMatrix);}}bindForSubMesh(world, mesh, subMesh) {const scene = this.getScene(),effect = subMesh.effect;if (!effect) return;this._activeEffect = effect, this.bindOnlyWorldMatrix(world);const mustRebind = this._mustRebind(scene, effect, mesh.visibility),sharedData = this._sharedData;if (mustRebind) {for (const block of sharedData.bindableBlocks) block.bind(effect, this, mesh, subMesh);for (const block of sharedData.forcedBindableBlocks) block.bind(effect, this, mesh, subMesh);for (const inputBlock of sharedData.inputBlocks) inputBlock._transmit(effect, scene, this);} else if (!this.isFrozen) for (const block of sharedData.forcedBindableBlocks) block.bind(effect, this, mesh, subMesh);this._afterBind(mesh, this._activeEffect);}getActiveTextures() {const activeTextures = super.getActiveTextures();return this._sharedData && activeTextures.push(...this._sharedData.textureBlocks.filter((tb) => tb.texture).map((tb) => tb.texture)), activeTextures;}getTextureBlocks() {return this._sharedData ? this._sharedData.textureBlocks : [];}getAllTextureBlocks() {const textureBlocks = [];for (const block of this.attachedBlocks) NodeMaterial._BlockIsTextureBlock(block) && textureBlocks.push(block);return textureBlocks;}hasTexture(texture) {if (super.hasTexture(texture)) return !0;if (!this._sharedData) return !1;for (const t of this._sharedData.textureBlocks) if (t.texture === texture) return !0;return !1;}dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh) {if (forceDisposeTextures) for (const texture of this.getTextureBlocks().filter((tb) => tb.texture).map((tb) => tb.texture)) texture.dispose();for (const block of this.attachedBlocks) block.dispose();this.attachedBlocks.length = 0, this._sharedData = null, this._vertexCompilationState = null, this._fragmentCompilationState = null, this.onBuildObservable.clear(), this._imageProcessingObserver && (this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingObserver = null), super.dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh);}_createNodeEditor() {this.BJSNODEMATERIALEDITOR.NodeEditor.Show({ nodeMaterial: this });}edit(config) {return new Promise((resolve) => {if (this.BJSNODEMATERIALEDITOR = this.BJSNODEMATERIALEDITOR || this._getGlobalNodeMaterialEditor(), "undefined" == typeof this.BJSNODEMATERIALEDITOR) {const editorUrl = config && config.editorURL ? config.editorURL : NodeMaterial.EditorURL;tools/* Tools.LoadScript */.w1.LoadScript(editorUrl, () => {this.BJSNODEMATERIALEDITOR = this.BJSNODEMATERIALEDITOR || this._getGlobalNodeMaterialEditor(), this._createNodeEditor(), resolve();});} else this._createNodeEditor(), resolve();});}clear() {this._vertexOutputNodes.length = 0, this._fragmentOutputNodes.length = 0, this.attachedBlocks.length = 0;}setToDefault() {this.clear(), this.editorData = null;const positionInput = new InputBlock("Position");positionInput.setAsAttribute("position");const worldInput = new InputBlock("World");worldInput.setAsSystemValue(NodeMaterialSystemValues.World);const worldPos = new TransformBlock("WorldPos");positionInput.connectTo(worldPos), worldInput.connectTo(worldPos);const viewProjectionInput = new InputBlock("ViewProjection");viewProjectionInput.setAsSystemValue(NodeMaterialSystemValues.ViewProjection);const worldPosdMultipliedByViewProjection = new TransformBlock("WorldPos * ViewProjectionTransform");worldPos.connectTo(worldPosdMultipliedByViewProjection), viewProjectionInput.connectTo(worldPosdMultipliedByViewProjection);const vertexOutput = new VertexOutputBlock("VertexOutput");worldPosdMultipliedByViewProjection.connectTo(vertexOutput);const pixelColor = new InputBlock("color");pixelColor.value = new math_color/* Color4 */.HE(.8, .8, .8, 1);const fragmentOutput = new FragmentOutputBlock("FragmentOutput");pixelColor.connectTo(fragmentOutput), this.addOutputNode(vertexOutput), this.addOutputNode(fragmentOutput), this._mode = NodeMaterialModes.Material;}setToDefaultPostProcess() {this.clear(), this.editorData = null;const position = new InputBlock("Position");position.setAsAttribute("position2d");const const1 = new InputBlock("Constant1");const1.isConstant = !0, const1.value = 1;const vmerger = new VectorMergerBlock("Position3D");position.connectTo(vmerger), const1.connectTo(vmerger, { input: "w" });const vertexOutput = new VertexOutputBlock("VertexOutput");vmerger.connectTo(vertexOutput);const scale = new InputBlock("Scale");scale.visibleInInspector = !0, scale.value = new math_vector/* Vector2 */.FM(1, 1);const uv0 = new RemapBlock("uv0");position.connectTo(uv0);const uv = new MultiplyBlock("UV scale");uv0.connectTo(uv), scale.connectTo(uv);const currentScreen = new CurrentScreenBlock("CurrentScreen");uv.connectTo(currentScreen), currentScreen.texture = new Textures_texture/* Texture */.x("https://assets.babylonjs.com/nme/currentScreenPostProcess.png", this.getScene());const fragmentOutput = new FragmentOutputBlock("FragmentOutput");currentScreen.connectTo(fragmentOutput, { output: "rgba" }), this.addOutputNode(vertexOutput), this.addOutputNode(fragmentOutput), this._mode = NodeMaterialModes.PostProcess;}setToDefaultProceduralTexture() {this.clear(), this.editorData = null;const position = new InputBlock("Position");position.setAsAttribute("position2d");const const1 = new InputBlock("Constant1");const1.isConstant = !0, const1.value = 1;const vmerger = new VectorMergerBlock("Position3D");position.connectTo(vmerger), const1.connectTo(vmerger, { input: "w" });const vertexOutput = new VertexOutputBlock("VertexOutput");vmerger.connectTo(vertexOutput);const time = new InputBlock("Time");time.value = 0, time.min = 0, time.max = 0, time.isBoolean = !1, time.matrixMode = 0, time.animationType = AnimatedInputBlockTypes.Time, time.isConstant = !1;const color = new InputBlock("Color3");color.value = new math_color/* Color3 */.Wo(1, 1, 1), color.isConstant = !1;const fragmentOutput = new FragmentOutputBlock("FragmentOutput"),vectorMerger = new VectorMergerBlock("VectorMerger");vectorMerger.visibleInInspector = !1;const cos = new TrigonometryBlock("Cos");cos.operation = TrigonometryBlockOperations.Cos, position.connectTo(vectorMerger), time.output.connectTo(cos.input), cos.output.connectTo(vectorMerger.z), vectorMerger.xyzOut.connectTo(fragmentOutput.rgb), this.addOutputNode(vertexOutput), this.addOutputNode(fragmentOutput), this._mode = NodeMaterialModes.ProceduralTexture;}setToDefaultParticle() {this.clear(), this.editorData = null;const uv = new InputBlock("uv");uv.setAsAttribute("particle_uv");const texture = new ParticleTextureBlock("ParticleTexture");uv.connectTo(texture);const color = new InputBlock("Color");color.setAsAttribute("particle_color");const multiply = new MultiplyBlock("Texture * Color");texture.connectTo(multiply), color.connectTo(multiply);const rampGradient = new ParticleRampGradientBlock("ParticleRampGradient");multiply.connectTo(rampGradient);const cSplitter = new ColorSplitterBlock("ColorSplitter");color.connectTo(cSplitter);const blendMultiply = new ParticleBlendMultiplyBlock("ParticleBlendMultiply");rampGradient.connectTo(blendMultiply), texture.connectTo(blendMultiply, { output: "a" }), cSplitter.connectTo(blendMultiply, { output: "a" });const fragmentOutput = new FragmentOutputBlock("FragmentOutput");blendMultiply.connectTo(fragmentOutput), this.addOutputNode(fragmentOutput), this._mode = NodeMaterialModes.Particle;}async loadAsync(url, rootUrl = "") {return NodeMaterial.ParseFromFileAsync("", url, this.getScene(), rootUrl, !0, this);}_gatherBlocks(rootNode, list) {if (-1 === list.indexOf(rootNode)) {list.push(rootNode);for (const input of rootNode.inputs) {const connectedPoint = input.connectedPoint;if (connectedPoint) {const block = connectedPoint.ownerBlock;block !== rootNode && this._gatherBlocks(block, list);}}}}generateCode() {let alreadyDumped = [];const vertexBlocks = [],uniqueNames = ["const", "var", "let"];for (const outputNode of this._vertexOutputNodes) this._gatherBlocks(outputNode, vertexBlocks);const fragmentBlocks = [];for (const outputNode of this._fragmentOutputNodes) this._gatherBlocks(outputNode, fragmentBlocks);let codeString = `var nodeMaterial = new BABYLON.NodeMaterial("${this.name || "node material"}");\r\n`;for (const node of vertexBlocks) node.isInput && -1 === alreadyDumped.indexOf(node) && (codeString += node._dumpCode(uniqueNames, alreadyDumped));for (const node of fragmentBlocks) node.isInput && -1 === alreadyDumped.indexOf(node) && (codeString += node._dumpCode(uniqueNames, alreadyDumped));alreadyDumped = [], codeString += "\r\n// Connections\r\n";for (const node of this._vertexOutputNodes) codeString += node._dumpCodeForOutputConnections(alreadyDumped);for (const node of this._fragmentOutputNodes) codeString += node._dumpCodeForOutputConnections(alreadyDumped);codeString += "\r\n// Output nodes\r\n";for (const node of this._vertexOutputNodes) codeString += `nodeMaterial.addOutputNode(${node._codeVariableName});\r\n`;for (const node of this._fragmentOutputNodes) codeString += `nodeMaterial.addOutputNode(${node._codeVariableName});\r\n`;return codeString += `nodeMaterial.build();\r\n`, codeString;}serialize(selectedBlocks) {const serializationObject = selectedBlocks ? {} : decorators/* SerializationHelper.Serialize */.p4.Serialize(this);serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData));let blocks = [];if (selectedBlocks) blocks = selectedBlocks;else {serializationObject.customType = "BABYLON.NodeMaterial", serializationObject.outputNodes = [];for (const outputNode of this._vertexOutputNodes) this._gatherBlocks(outputNode, blocks), serializationObject.outputNodes.push(outputNode.uniqueId);for (const outputNode of this._fragmentOutputNodes) this._gatherBlocks(outputNode, blocks), -1 === serializationObject.outputNodes.indexOf(outputNode.uniqueId) && serializationObject.outputNodes.push(outputNode.uniqueId);}serializationObject.blocks = [];for (const block of blocks) serializationObject.blocks.push(block.serialize());if (!selectedBlocks) for (const block of this.attachedBlocks) -1 === blocks.indexOf(block) && serializationObject.blocks.push(block.serialize());return serializationObject;}_restoreConnections(block, source, map) {for (const outputPoint of block.outputs) for (const candidate of source.blocks) {const target = map[candidate.id];if (target) for (const input of candidate.inputs) if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {const inputPoint = target.getInputByName(input.inputName);if (!inputPoint || inputPoint.isConnected) continue;outputPoint.connectTo(inputPoint, !0), this._restoreConnections(target, source, map);continue;}}}parseSerializedObject(source, rootUrl = "", merge = !1) {var _a;merge || this.clear();const map = {};for (const parsedBlock of source.blocks) {const blockType = (0,typeStore/* GetClass */.q)(parsedBlock.customType);if (blockType) {const block = new blockType();block._deserialize(parsedBlock, this.getScene(), rootUrl), map[parsedBlock.id] = block, this.attachedBlocks.push(block);}}for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {const parsedBlock = source.blocks[blockIndex],block = map[parsedBlock.id];block && (!block.inputs.length || merge) && this._restoreConnections(block, source, map);}if (source.outputNodes) for (const outputNodeId of source.outputNodes) this.addOutputNode(map[outputNodeId]);if (source.locations || source.editorData && source.editorData.locations) {const locations = source.locations || source.editorData.locations;for (const location of locations) map[location.blockId] && (location.blockId = map[location.blockId].uniqueId);merge && this.editorData && this.editorData.locations && locations.concat(this.editorData.locations), source.locations ? this.editorData = { locations: locations } : (this.editorData = source.editorData, this.editorData.locations = locations);const blockMap = [];for (const key in map) blockMap[key] = map[key].uniqueId;this.editorData.map = blockMap;}this.comment = source.comment, source.forceAlphaBlending !== void 0 && (this.forceAlphaBlending = source.forceAlphaBlending), merge || (this._mode = null !== (_a = source.mode) && void 0 !== _a ? _a : NodeMaterialModes.Material);}loadFromSerialization(source, rootUrl = "", merge = !1) {this.parseSerializedObject(source, rootUrl, merge);}clone(name, shareEffect = !1) {const serializationObject = this.serialize(),clone = decorators/* SerializationHelper.Clone */.p4.Clone(() => new NodeMaterial(name, this.getScene(), this.options), this);return clone.id = name, clone.name = name, clone.parseSerializedObject(serializationObject), clone._buildId = this._buildId, clone.build(!1, !shareEffect), clone;}static Parse(source, scene, rootUrl = "") {const nodeMaterial = decorators/* SerializationHelper.Parse */.p4.Parse(() => new NodeMaterial(source.name, scene), source, scene, rootUrl);return nodeMaterial.parseSerializedObject(source, rootUrl), nodeMaterial.build(), nodeMaterial;}static async ParseFromFileAsync(name, url, scene, rootUrl = "", skipBuild = !1, targetMaterial) {const material = null !== targetMaterial && void 0 !== targetMaterial ? targetMaterial : new NodeMaterial(name, scene),data = await scene._loadFileAsync(url),serializationObject = JSON.parse(data);return material.parseSerializedObject(serializationObject, rootUrl), skipBuild || material.build(), material;}static ParseFromSnippetAsync(snippetId, scene = engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, rootUrl = "", nodeMaterial, skipBuild = !1) {return "_BLANK" === snippetId ? Promise.resolve(NodeMaterial.CreateDefault("blank", scene)) : new Promise((resolve, reject) => {const request = new webRequest/* WebRequest */.g();request.addEventListener("readystatechange", () => {if (4 == request.readyState) if (200 == request.status) {const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload),serializationObject = JSON.parse(snippet.nodeMaterial);nodeMaterial || (nodeMaterial = decorators/* SerializationHelper.Parse */.p4.Parse(() => new NodeMaterial(snippetId, scene), serializationObject, scene, rootUrl), nodeMaterial.uniqueId = scene.getUniqueId()), nodeMaterial.parseSerializedObject(serializationObject), nodeMaterial.snippetId = snippetId;try {skipBuild || nodeMaterial.build(), resolve(nodeMaterial);} catch (err) {reject(err);}} else reject("Unable to load the snippet " + snippetId);}), request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/")), request.send();});}static CreateDefault(name, scene) {const newMaterial = new NodeMaterial(name, scene);return newMaterial.setToDefault(), newMaterial.build(), newMaterial;}}NodeMaterial._BuildIdGenerator = 0, NodeMaterial.EditorURL = `https://unpkg.com/babylonjs-node-editor@${engine/* Engine.Version */.D.Version}/babylon.nodeEditor.js`, NodeMaterial.SnippetUrl = `https://snippet.babylonjs.com`, NodeMaterial.IgnoreTexturesAtLoadTime = !1, (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], NodeMaterial.prototype, "ignoreAlpha", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], NodeMaterial.prototype, "maxSimultaneousLights", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("mode")], NodeMaterial.prototype, "_mode", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("comment")], NodeMaterial.prototype, "comment", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], NodeMaterial.prototype, "forceAlphaBlending", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.NodeMaterial", NodeMaterial);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/icoSphereBuilder.js
function CreateIcoSphereVertexData(options) {const sideOrientation = options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,radius = options.radius || 1,flat = void 0 === options.flat || options.flat,subdivisions = options.subdivisions || 4,radiusX = options.radiusX || radius,radiusY = options.radiusY || radius,radiusZ = options.radiusZ || radius,t = (1 + Math.sqrt(5)) / 2,icoVertices = [-1, t, -0, 1, t, 0, -1, -t, 0, 1, -t, 0, 0, -1, -t, 0, 1, -t, 0, -1, t, 0, 1, t, t, 0, 1, t, 0, -1, -t, 0, 1, -t, 0, -1],ico_indices = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, 4, 21, 5, 13, 17, 23, 6, 13, 22, 19, 6, 18, 9, 8, 1],vertices_unalias_id = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 2, 3, 3, 3, 4, 7, 8, 9, 9, 10, 11],ico_vertexuv = [5, 1, 3, 1, 6, 4, 0, 0, 5, 3, 4, 2, 2, 2, 4, 0, 2, 0, 1, 1, 6, 0, 6, 2, 0, 4, 3, 3, 4, 4, 3, 1, 4, 2, 4, 4, 0, 2, 1, 1, 2, 2, 3, 3, 1, 3, 2, 4],island = [0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0],indices = [],positions = [],normals = [],uvs = [];let current_indice = 0;const face_vertex_pos = [,,,],face_vertex_uv = [,,,];let v012;for (v012 = 0; 3 > v012; v012++) face_vertex_pos[v012] = math_vector/* Vector3.Zero */.P.Zero(), face_vertex_uv[v012] = math_vector/* Vector2.Zero */.FM.Zero();for (let face = 0; 20 > face; face++) {for (v012 = 0; 3 > v012; v012++) {const v_id = ico_indices[3 * face + v012];face_vertex_pos[v012].copyFromFloats(icoVertices[3 * vertices_unalias_id[v_id]], icoVertices[3 * vertices_unalias_id[v_id] + 1], icoVertices[3 * vertices_unalias_id[v_id] + 2]), face_vertex_pos[v012].normalize(), face_vertex_uv[v012].copyFromFloats(ico_vertexuv[2 * v_id] * (138 / 1024) + 60 / 1024 + island[face] * (-40 / 1024), ico_vertexuv[2 * v_id + 1] * (239 / 1024) + 26 / 1024 + island[face] * (20 / 1024));}const interp_vertex = (i1, i2, c1, c2) => {const pos_x0 = math_vector/* Vector3.Lerp */.P.Lerp(face_vertex_pos[0], face_vertex_pos[2], i2 / subdivisions),pos_x1 = math_vector/* Vector3.Lerp */.P.Lerp(face_vertex_pos[1], face_vertex_pos[2], i2 / subdivisions),pos_interp = subdivisions === i2 ? face_vertex_pos[2] : math_vector/* Vector3.Lerp */.P.Lerp(pos_x0, pos_x1, i1 / (subdivisions - i2));pos_interp.normalize();let vertex_normal;if (flat) {const centroid_x0 = math_vector/* Vector3.Lerp */.P.Lerp(face_vertex_pos[0], face_vertex_pos[2], c2 / subdivisions),centroid_x1 = math_vector/* Vector3.Lerp */.P.Lerp(face_vertex_pos[1], face_vertex_pos[2], c2 / subdivisions);vertex_normal = math_vector/* Vector3.Lerp */.P.Lerp(centroid_x0, centroid_x1, c1 / (subdivisions - c2));} else vertex_normal = new math_vector/* Vector3 */.P(pos_interp.x, pos_interp.y, pos_interp.z);vertex_normal.x /= radiusX, vertex_normal.y /= radiusY, vertex_normal.z /= radiusZ, vertex_normal.normalize();const uv_x0 = math_vector/* Vector2.Lerp */.FM.Lerp(face_vertex_uv[0], face_vertex_uv[2], i2 / subdivisions),uv_x1 = math_vector/* Vector2.Lerp */.FM.Lerp(face_vertex_uv[1], face_vertex_uv[2], i2 / subdivisions),uv_interp = subdivisions === i2 ? face_vertex_uv[2] : math_vector/* Vector2.Lerp */.FM.Lerp(uv_x0, uv_x1, i1 / (subdivisions - i2));positions.push(pos_interp.x * radiusX, pos_interp.y * radiusY, pos_interp.z * radiusZ), normals.push(vertex_normal.x, vertex_normal.y, vertex_normal.z), uvs.push(uv_interp.x, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - uv_interp.y : uv_interp.y), indices.push(current_indice), current_indice++;};for (let i2 = 0; i2 < subdivisions; i2++) for (let i1 = 0; i1 + i2 < subdivisions; i1++) interp_vertex(i1, i2, i1 + 1 / 3, i2 + 1 / 3), interp_vertex(i1 + 1, i2, i1 + 1 / 3, i2 + 1 / 3), interp_vertex(i1, i2 + 1, i1 + 1 / 3, i2 + 1 / 3), i1 + i2 + 1 < subdivisions && (interp_vertex(i1 + 1, i2, i1 + 2 / 3, i2 + 2 / 3), interp_vertex(i1 + 1, i2 + 1, i1 + 2 / 3, i2 + 2 / 3), interp_vertex(i1, i2 + 1, i1 + 2 / 3, i2 + 2 / 3));}mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreateIcoSphere(name, options = {}, scene = null) {const sphere = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), sphere._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateIcoSphereVertexData(options);return vertexData.applyToMesh(sphere, options.updatable), sphere;}const IcoSphereBuilder = { CreateIcoSphere };mesh_vertexData/* VertexData.CreateIcoSphere */.x.CreateIcoSphere = CreateIcoSphereVertexData, Meshes_mesh/* Mesh.CreateIcoSphere */.Kj.CreateIcoSphere = (name, options, scene) => CreateIcoSphere(name, options, scene);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRHandTracking.js
var HandPart;(function (HandPart) {HandPart.WRIST = "wrist", HandPart.THUMB = "thumb", HandPart.INDEX = "index", HandPart.MIDDLE = "middle", HandPart.RING = "ring", HandPart.LITTLE = "little";})(HandPart || (HandPart = {}));var WebXRHandJoint;(function (WebXRHandJoint) {WebXRHandJoint.WRIST = "wrist", WebXRHandJoint.THUMB_METACARPAL = "thumb-metacarpal", WebXRHandJoint.THUMB_PHALANX_PROXIMAL = "thumb-phalanx-proximal", WebXRHandJoint.THUMB_PHALANX_DISTAL = "thumb-phalanx-distal", WebXRHandJoint.THUMB_TIP = "thumb-tip", WebXRHandJoint.INDEX_FINGER_METACARPAL = "index-finger-metacarpal", WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL = "index-finger-phalanx-proximal", WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE = "index-finger-phalanx-intermediate", WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL = "index-finger-phalanx-distal", WebXRHandJoint.INDEX_FINGER_TIP = "index-finger-tip", WebXRHandJoint.MIDDLE_FINGER_METACARPAL = "middle-finger-metacarpal", WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL = "middle-finger-phalanx-proximal", WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE = "middle-finger-phalanx-intermediate", WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL = "middle-finger-phalanx-distal", WebXRHandJoint.MIDDLE_FINGER_TIP = "middle-finger-tip", WebXRHandJoint.RING_FINGER_METACARPAL = "ring-finger-metacarpal", WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL = "ring-finger-phalanx-proximal", WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE = "ring-finger-phalanx-intermediate", WebXRHandJoint.RING_FINGER_PHALANX_DISTAL = "ring-finger-phalanx-distal", WebXRHandJoint.RING_FINGER_TIP = "ring-finger-tip", WebXRHandJoint.PINKY_FINGER_METACARPAL = "pinky-finger-metacarpal", WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL = "pinky-finger-phalanx-proximal", WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE = "pinky-finger-phalanx-intermediate", WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL = "pinky-finger-phalanx-distal", WebXRHandJoint.PINKY_FINGER_TIP = "pinky-finger-tip";})(WebXRHandJoint || (WebXRHandJoint = {}));const handJointReferenceArray = [WebXRHandJoint.WRIST, WebXRHandJoint.THUMB_METACARPAL, WebXRHandJoint.THUMB_PHALANX_PROXIMAL, WebXRHandJoint.THUMB_PHALANX_DISTAL, WebXRHandJoint.THUMB_TIP, WebXRHandJoint.INDEX_FINGER_METACARPAL, WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL, WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE, WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL, WebXRHandJoint.INDEX_FINGER_TIP, WebXRHandJoint.MIDDLE_FINGER_METACARPAL, WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL, WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE, WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL, WebXRHandJoint.MIDDLE_FINGER_TIP, WebXRHandJoint.RING_FINGER_METACARPAL, WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL, WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE, WebXRHandJoint.RING_FINGER_PHALANX_DISTAL, WebXRHandJoint.RING_FINGER_TIP, WebXRHandJoint.PINKY_FINGER_METACARPAL, WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL, WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE, WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL, WebXRHandJoint.PINKY_FINGER_TIP],handPartsDefinition = { [HandPart.WRIST]: [WebXRHandJoint.WRIST], [HandPart.THUMB]: [WebXRHandJoint.THUMB_METACARPAL, WebXRHandJoint.THUMB_PHALANX_PROXIMAL, WebXRHandJoint.THUMB_PHALANX_DISTAL, WebXRHandJoint.THUMB_TIP], [HandPart.INDEX]: [WebXRHandJoint.INDEX_FINGER_METACARPAL, WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL, WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE, WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL, WebXRHandJoint.INDEX_FINGER_TIP], [HandPart.MIDDLE]: [WebXRHandJoint.MIDDLE_FINGER_METACARPAL, WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL, WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE, WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL, WebXRHandJoint.MIDDLE_FINGER_TIP], [HandPart.RING]: [WebXRHandJoint.RING_FINGER_METACARPAL, WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL, WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE, WebXRHandJoint.RING_FINGER_PHALANX_DISTAL, WebXRHandJoint.RING_FINGER_TIP], [HandPart.LITTLE]: [WebXRHandJoint.PINKY_FINGER_METACARPAL, WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL, WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE, WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL, WebXRHandJoint.PINKY_FINGER_TIP] };class WebXRHand {get handMesh() {return this._handMesh;}getHandPartMeshes(part) {return handPartsDefinition[part].map((name) => this._jointMeshes[handJointReferenceArray.indexOf(name)]);}getJointMesh(jointName) {return this._jointMeshes[handJointReferenceArray.indexOf(jointName)];}constructor(xrController, _jointMeshes, _handMesh, rigMapping, _leftHandedMeshes = !1, _jointsInvisible = !1, _jointScaleFactor = 1) {this.xrController = xrController, this._jointMeshes = _jointMeshes, this._handMesh = _handMesh, this.rigMapping = rigMapping, this._leftHandedMeshes = _leftHandedMeshes, this._jointsInvisible = _jointsInvisible, this._jointScaleFactor = _jointScaleFactor, this._jointTransforms = Array(handJointReferenceArray.length), this._jointTransformMatrices = new Float32Array(16 * handJointReferenceArray.length), this._tempJointMatrix = new math_vector/* Matrix */.y3(), this._jointRadii = new Float32Array(handJointReferenceArray.length), this._scene = _jointMeshes[0].getScene();for (let jointIdx = 0; jointIdx < this._jointTransforms.length; jointIdx++) {const jointTransform = this._jointTransforms[jointIdx] = new transformNode/* TransformNode */.Y(handJointReferenceArray[jointIdx], this._scene);jointTransform.rotationQuaternion = new math_vector/* Quaternion */._f(), _jointMeshes[jointIdx].rotationQuaternion = new math_vector/* Quaternion */._f();}_handMesh && this.setHandMesh(_handMesh, rigMapping), this.xrController.motionController && (this.xrController.motionController.rootMesh ? this.xrController.motionController.rootMesh.setEnabled(!1) : this.xrController.motionController.onModelLoadedObservable.add((controller) => {controller.rootMesh && controller.rootMesh.setEnabled(!1);})), this.xrController.onMotionControllerInitObservable.add((motionController) => {motionController.onModelLoadedObservable.add((controller) => {controller.rootMesh && controller.rootMesh.setEnabled(!1);}), motionController.rootMesh && motionController.rootMesh.setEnabled(!1);});}setHandMesh(handMesh, rigMapping) {if (this._handMesh = handMesh, handMesh.alwaysSelectAsActiveMesh = !0, handMesh.getChildMeshes().forEach((mesh) => mesh.alwaysSelectAsActiveMesh = !0), this._handMesh.skeleton) {const handMeshSkeleton = this._handMesh.skeleton;handJointReferenceArray.forEach((jointName, jointIdx) => {const jointBoneIdx = handMeshSkeleton.getBoneIndexByName(rigMapping ? rigMapping[jointName] : jointName);-1 !== jointBoneIdx && handMeshSkeleton.bones[jointBoneIdx].linkTransformNode(this._jointTransforms[jointIdx]);});}}updateFromXRFrame(xrFrame, referenceSpace) {const hand = this.xrController.inputSource.hand;if (!hand) return;const jointSpaces = handJointReferenceArray.map((jointName) => hand[jointName] || hand.get(jointName));let trackingSuccessful = !1;if (xrFrame.fillPoses && xrFrame.fillJointRadii) trackingSuccessful = xrFrame.fillPoses(jointSpaces, referenceSpace, this._jointTransformMatrices) && xrFrame.fillJointRadii(jointSpaces, this._jointRadii);else if (xrFrame.getJointPose) {trackingSuccessful = !0;for (let jointIdx = 0; jointIdx < jointSpaces.length; jointIdx++) {const jointPose = xrFrame.getJointPose(jointSpaces[jointIdx], referenceSpace);if (jointPose) this._jointTransformMatrices.set(jointPose.transform.matrix, 16 * jointIdx), this._jointRadii[jointIdx] = jointPose.radius || .008;else {trackingSuccessful = !1;break;}}}trackingSuccessful && (handJointReferenceArray.forEach((_jointName, jointIdx) => {const jointTransform = this._jointTransforms[jointIdx];math_vector/* Matrix.FromArrayToRef */.y3.FromArrayToRef(this._jointTransformMatrices, 16 * jointIdx, this._tempJointMatrix), this._tempJointMatrix.decompose(void 0, jointTransform.rotationQuaternion, jointTransform.position);const scaledJointRadius = this._jointRadii[jointIdx] * this._jointScaleFactor,jointMesh = this._jointMeshes[jointIdx];jointMesh.isVisible = !this._handMesh && !this._jointsInvisible, jointMesh.position.copyFrom(jointTransform.position), jointMesh.rotationQuaternion.copyFrom(jointTransform.rotationQuaternion), jointMesh.scaling.setAll(scaledJointRadius), this._scene.useRightHandedSystem || (jointMesh.position.z *= -1, jointMesh.rotationQuaternion.z *= -1, jointMesh.rotationQuaternion.w *= -1, this._leftHandedMeshes && this._handMesh && (jointTransform.position.z *= -1, jointTransform.rotationQuaternion.z *= -1, jointTransform.rotationQuaternion.w *= -1));}), this._handMesh && (this._handMesh.isVisible = !0));}dispose() {this._handMesh && (this._handMesh.isVisible = !1);}}class WebXRHandTracking extends WebXRAbstractFeature {static _GenerateTrackedJointMeshes(featureOptions) {const meshes = {};return ["left", "right"].map((handedness) => {var _a, _b, _c, _d, _e;const trackedMeshes = [],originalMesh = (null === (_a = featureOptions.jointMeshes) || void 0 === _a ? void 0 : _a.sourceMesh) || CreateIcoSphere("jointParent", WebXRHandTracking._ICOSPHERE_PARAMS);originalMesh.isVisible = null !== (_b = featureOptions.jointMeshes) && void 0 !== _b && _b.keepOriginalVisible;for (let newInstance, i = 0; i < handJointReferenceArray.length; ++i) {if (newInstance = originalMesh.createInstance(`${handedness}-handJoint-${i}`), null === (_c = featureOptions.jointMeshes) || void 0 === _c ? void 0 : _c.onHandJointMeshGenerated) {const returnedMesh = featureOptions.jointMeshes.onHandJointMeshGenerated(newInstance, i, handedness);returnedMesh && returnedMesh !== newInstance && (newInstance.dispose(), newInstance = returnedMesh);}if (newInstance.isPickable = !1, null === (_d = featureOptions.jointMeshes) || void 0 === _d ? void 0 : _d.enablePhysics) {const props = (null === (_e = featureOptions.jointMeshes) || void 0 === _e ? void 0 : _e.physicsProps) || {};newInstance.scaling.setAll(.02);const type = void 0 === props.impostorType ? PhysicsImpostor.SphereImpostor : props.impostorType;newInstance.physicsImpostor = new PhysicsImpostor(newInstance, type, { mass: 0, ...props });}newInstance.rotationQuaternion = new math_vector/* Quaternion */._f(), newInstance.isVisible = !1, trackedMeshes.push(newInstance);}meshes[handedness] = trackedMeshes;}), { left: meshes.left, right: meshes.right };}static _GenerateDefaultHandMeshesAsync(scene, options) {return new Promise(async (resolve) => {var _a, _b, _c, _d, _e;const riggedMeshes = {};(null === (_b = null === (_a = WebXRHandTracking._RightHandGLB) || void 0 === _a ? void 0 : _a.meshes[1]) || void 0 === _b ? void 0 : _b.isDisposed()) && (WebXRHandTracking._RightHandGLB = null), (null === (_d = null === (_c = WebXRHandTracking._LeftHandGLB) || void 0 === _c ? void 0 : _c.meshes[1]) || void 0 === _d ? void 0 : _d.isDisposed()) && (WebXRHandTracking._LeftHandGLB = null);const handsDefined = !!(WebXRHandTracking._RightHandGLB && WebXRHandTracking._LeftHandGLB),handGLBs = await Promise.all([WebXRHandTracking._RightHandGLB || sceneLoader/* SceneLoader.ImportMeshAsync */.n.ImportMeshAsync("", WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL, WebXRHandTracking.DEFAULT_HAND_MODEL_RIGHT_FILENAME, scene), WebXRHandTracking._LeftHandGLB || sceneLoader/* SceneLoader.ImportMeshAsync */.n.ImportMeshAsync("", WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL, WebXRHandTracking.DEFAULT_HAND_MODEL_LEFT_FILENAME, scene)]);WebXRHandTracking._RightHandGLB = handGLBs[0], WebXRHandTracking._LeftHandGLB = handGLBs[1];const handShader = new NodeMaterial("handShader", scene, { emitComments: !1 });await handShader.loadAsync(WebXRHandTracking.DEFAULT_HAND_MODEL_SHADER_URL), handShader.needDepthPrePass = !0, handShader.transparencyMode = Materials_material/* Material.MATERIAL_ALPHABLEND */.F.MATERIAL_ALPHABLEND, handShader.alphaMode = 2, handShader.build(!1);const handColors = { base: math_color/* Color3.FromInts */.Wo.FromInts(116, 63, 203), fresnel: math_color/* Color3.FromInts */.Wo.FromInts(149, 102, 229), fingerColor: math_color/* Color3.FromInts */.Wo.FromInts(177, 130, 255), tipFresnel: math_color/* Color3.FromInts */.Wo.FromInts(220, 200, 255), ...(null === (_e = null === options || void 0 === options ? void 0 : options.handMeshes) || void 0 === _e ? void 0 : _e.customColors) },handNodes = { base: handShader.getBlockByName("baseColor"), fresnel: handShader.getBlockByName("fresnelColor"), fingerColor: handShader.getBlockByName("fingerColor"), tipFresnel: handShader.getBlockByName("tipFresnelColor") };handNodes.base.value = handColors.base, handNodes.fresnel.value = handColors.fresnel, handNodes.fingerColor.value = handColors.fingerColor, handNodes.tipFresnel.value = handColors.tipFresnel, ["left", "right"].forEach((handedness) => {const handGLB = "left" == handedness ? WebXRHandTracking._LeftHandGLB : WebXRHandTracking._RightHandGLB;if (!handGLB) throw new Error("Could not load hand model");const handMesh = handGLB.meshes[1];handMesh._internalAbstractMeshDataInfo._computeBonesUsingShaders = !0, handMesh.material = handShader.clone(`${handedness}HandShaderClone`, !0), handMesh.isVisible = !1, riggedMeshes[handedness] = handMesh, handsDefined || scene.useRightHandedSystem || handGLB.meshes[1].rotate(math_axis/* Axis.Y */.RD.Y, Math.PI);}), handShader.dispose(), resolve({ left: riggedMeshes.left, right: riggedMeshes.right });});}static _GenerateDefaultHandMeshRigMapping(handedness) {const H = "right" == handedness ? "R" : "L";return { [WebXRHandJoint.WRIST]: `wrist_${H}`, [WebXRHandJoint.THUMB_METACARPAL]: `thumb_metacarpal_${H}`, [WebXRHandJoint.THUMB_PHALANX_PROXIMAL]: `thumb_proxPhalanx_${H}`, [WebXRHandJoint.THUMB_PHALANX_DISTAL]: `thumb_distPhalanx_${H}`, [WebXRHandJoint.THUMB_TIP]: `thumb_tip_${H}`, [WebXRHandJoint.INDEX_FINGER_METACARPAL]: `index_metacarpal_${H}`, [WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL]: `index_proxPhalanx_${H}`, [WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE]: `index_intPhalanx_${H}`, [WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL]: `index_distPhalanx_${H}`, [WebXRHandJoint.INDEX_FINGER_TIP]: `index_tip_${H}`, [WebXRHandJoint.MIDDLE_FINGER_METACARPAL]: `middle_metacarpal_${H}`, [WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL]: `middle_proxPhalanx_${H}`, [WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE]: `middle_intPhalanx_${H}`, [WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL]: `middle_distPhalanx_${H}`, [WebXRHandJoint.MIDDLE_FINGER_TIP]: `middle_tip_${H}`, [WebXRHandJoint.RING_FINGER_METACARPAL]: `ring_metacarpal_${H}`, [WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL]: `ring_proxPhalanx_${H}`, [WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE]: `ring_intPhalanx_${H}`, [WebXRHandJoint.RING_FINGER_PHALANX_DISTAL]: `ring_distPhalanx_${H}`, [WebXRHandJoint.RING_FINGER_TIP]: `ring_tip_${H}`, [WebXRHandJoint.PINKY_FINGER_METACARPAL]: `little_metacarpal_${H}`, [WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL]: `little_proxPhalanx_${H}`, [WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE]: `little_intPhalanx_${H}`, [WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL]: `little_distPhalanx_${H}`, [WebXRHandJoint.PINKY_FINGER_TIP]: `little_tip_${H}` };}isCompatible() {return "undefined" != typeof XRHand;}getHandByControllerId(controllerId) {return this._attachedHands[controllerId];}getHandByHandedness(handedness) {return "none" == handedness ? null : this._trackingHands[handedness];}constructor(_xrSessionManager, options) {super(_xrSessionManager), this.options = options, this._attachedHands = {}, this._trackingHands = { left: null, right: null }, this._handResources = { jointMeshes: null, handMeshes: null, rigMappings: null }, this.onHandAddedObservable = new observable/* Observable */.y$(), this.onHandRemovedObservable = new observable/* Observable */.y$(), this._attachHand = (xrController) => {var _a, _b, _c;if (!xrController.inputSource.hand || "none" == xrController.inputSource.handedness || !this._handResources.jointMeshes) return;const handedness = xrController.inputSource.handedness,webxrHand = new WebXRHand(xrController, this._handResources.jointMeshes[handedness], this._handResources.handMeshes && this._handResources.handMeshes[handedness], this._handResources.rigMappings && this._handResources.rigMappings[handedness], null === (_a = this.options.handMeshes) || void 0 === _a ? void 0 : _a.meshesUseLeftHandedCoordinates, null === (_b = this.options.jointMeshes) || void 0 === _b ? void 0 : _b.invisible, null === (_c = this.options.jointMeshes) || void 0 === _c ? void 0 : _c.scaleFactor);this._attachedHands[xrController.uniqueId] = webxrHand, this._trackingHands[handedness] = webxrHand, this.onHandAddedObservable.notifyObservers(webxrHand);}, this._detachHand = (xrController) => {this._detachHandById(xrController.uniqueId);}, this.xrNativeFeatureName = "hand-tracking";const anyJointMeshOptions = options.jointMeshes;if (anyJointMeshOptions && ("undefined" != typeof anyJointMeshOptions.disableDefaultHandMesh && (options.handMeshes = options.handMeshes || {}, options.handMeshes.disableDefaultMeshes = anyJointMeshOptions.disableDefaultHandMesh), "undefined" != typeof anyJointMeshOptions.handMeshes && (options.handMeshes = options.handMeshes || {}, options.handMeshes.customMeshes = anyJointMeshOptions.handMeshes), "undefined" != typeof anyJointMeshOptions.leftHandedSystemMeshes && (options.handMeshes = options.handMeshes || {}, options.handMeshes.meshesUseLeftHandedCoordinates = anyJointMeshOptions.leftHandedSystemMeshes), "undefined" != typeof anyJointMeshOptions.rigMapping)) {options.handMeshes = options.handMeshes || {};const leftRigMapping = {},rightRigMapping = {};[[anyJointMeshOptions.rigMapping.left, leftRigMapping], [anyJointMeshOptions.rigMapping.right, rightRigMapping]].forEach((rigMappingTuple) => {const legacyRigMapping = rigMappingTuple[0],rigMapping = rigMappingTuple[1];legacyRigMapping.forEach((modelJointName, index) => {rigMapping[handJointReferenceArray[index]] = modelJointName;});}), options.handMeshes.customRigMappings = { left: leftRigMapping, right: rightRigMapping };}}attach() {var _a, _b, _c, _d;return !!super.attach() && (this._handResources = { jointMeshes: WebXRHandTracking._GenerateTrackedJointMeshes(this.options), handMeshes: (null === (_a = this.options.handMeshes) || void 0 === _a ? void 0 : _a.customMeshes) || null, rigMappings: (null === (_b = this.options.handMeshes) || void 0 === _b ? void 0 : _b.customRigMappings) || null }, (null === (_c = this.options.handMeshes) || void 0 === _c ? void 0 : _c.customMeshes) || (null === (_d = this.options.handMeshes) || void 0 === _d ? void 0 : _d.disableDefaultMeshes) || WebXRHandTracking._GenerateDefaultHandMeshesAsync(engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, this.options).then((defaultHandMeshes) => {var _a, _b;this._handResources.handMeshes = defaultHandMeshes, this._handResources.rigMappings = { left: WebXRHandTracking._GenerateDefaultHandMeshRigMapping("left"), right: WebXRHandTracking._GenerateDefaultHandMeshRigMapping("right") }, null === (_a = this._trackingHands.left) || void 0 === _a ? void 0 : _a.setHandMesh(this._handResources.handMeshes.left, this._handResources.rigMappings.left), null === (_b = this._trackingHands.right) || void 0 === _b ? void 0 : _b.setHandMesh(this._handResources.handMeshes.right, this._handResources.rigMappings.right);}), this.options.xrInput.controllers.forEach(this._attachHand), this._addNewAttachObserver(this.options.xrInput.onControllerAddedObservable, this._attachHand), this._addNewAttachObserver(this.options.xrInput.onControllerRemovedObservable, this._detachHand), !0);}_onXRFrame(_xrFrame) {var _a, _b;null === (_a = this._trackingHands.left) || void 0 === _a ? void 0 : _a.updateFromXRFrame(_xrFrame, this._xrSessionManager.referenceSpace), null === (_b = this._trackingHands.right) || void 0 === _b ? void 0 : _b.updateFromXRFrame(_xrFrame, this._xrSessionManager.referenceSpace);}_detachHandById(controllerId) {var _a;const hand = this.getHandByControllerId(controllerId);if (hand) {const handedness = "left" == hand.xrController.inputSource.handedness ? "left" : "right";(null === (_a = this._trackingHands[handedness]) || void 0 === _a ? void 0 : _a.xrController.uniqueId) === controllerId && (this._trackingHands[handedness] = null), this.onHandRemovedObservable.notifyObservers(hand), hand.dispose(), delete this._attachedHands[controllerId];}}detach() {return !!super.detach() && (Object.keys(this._attachedHands).forEach((uniqueId) => this._detachHandById(uniqueId)), !0);}dispose() {var _a;super.dispose(), this.onHandAddedObservable.clear(), this.onHandRemovedObservable.clear(), this._handResources.handMeshes && (!(null !== (_a = this.options.handMeshes) && void 0 !== _a) || !_a.customMeshes) && (this._handResources.handMeshes.left.dispose(), this._handResources.handMeshes.right.dispose(), WebXRHandTracking._RightHandGLB = null, WebXRHandTracking._LeftHandGLB = null), this._handResources.jointMeshes && (this._handResources.jointMeshes.left.forEach((trackedMesh) => trackedMesh.dispose()), this._handResources.jointMeshes.right.forEach((trackedMesh) => trackedMesh.dispose()));}}WebXRHandTracking.Name = WebXRFeatureName.HAND_TRACKING, WebXRHandTracking.Version = 1, WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/HandMeshes/", WebXRHandTracking.DEFAULT_HAND_MODEL_RIGHT_FILENAME = "r_hand_rhs.glb", WebXRHandTracking.DEFAULT_HAND_MODEL_LEFT_FILENAME = "l_hand_rhs.glb", WebXRHandTracking.DEFAULT_HAND_MODEL_SHADER_URL = "https://assets.babylonjs.com/meshes/HandMeshes/handsShader.json", WebXRHandTracking._ICOSPHERE_PARAMS = { radius: .5, flat: !1, subdivisions: 2 }, WebXRHandTracking._RightHandGLB = null, WebXRHandTracking._LeftHandGLB = null, WebXRFeaturesManager.AddWebXRFeature(WebXRHandTracking.Name, (xrSessionManager, options) => () => new WebXRHandTracking(xrSessionManager, options), WebXRHandTracking.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/handConstraintBehavior.js
var HandConstraintZone;(function (HandConstraintZone) {HandConstraintZone[HandConstraintZone.ABOVE_FINGER_TIPS = 0] = "ABOVE_FINGER_TIPS", HandConstraintZone[HandConstraintZone.RADIAL_SIDE = 1] = "RADIAL_SIDE", HandConstraintZone[HandConstraintZone.ULNAR_SIDE = 2] = "ULNAR_SIDE", HandConstraintZone[HandConstraintZone.BELOW_WRIST = 3] = "BELOW_WRIST";})(HandConstraintZone || (HandConstraintZone = {}));var HandConstraintOrientation;(function (HandConstraintOrientation) {HandConstraintOrientation[HandConstraintOrientation.LOOK_AT_CAMERA = 0] = "LOOK_AT_CAMERA", HandConstraintOrientation[HandConstraintOrientation.HAND_ROTATION = 1] = "HAND_ROTATION";})(HandConstraintOrientation || (HandConstraintOrientation = {}));var HandConstraintVisibility;(function (HandConstraintVisibility) {HandConstraintVisibility[HandConstraintVisibility.ALWAYS_VISIBLE = 0] = "ALWAYS_VISIBLE", HandConstraintVisibility[HandConstraintVisibility.PALM_UP = 1] = "PALM_UP", HandConstraintVisibility[HandConstraintVisibility.GAZE_FOCUS = 2] = "GAZE_FOCUS", HandConstraintVisibility[HandConstraintVisibility.PALM_AND_GAZE = 3] = "PALM_AND_GAZE";})(HandConstraintVisibility || (HandConstraintVisibility = {}));class HandConstraintBehavior {constructor() {this._sceneRenderObserver = null, this._zoneAxis = {}, this.handConstraintVisibility = HandConstraintVisibility.PALM_AND_GAZE, this.palmUpStrictness = .95, this.gazeProximityRadius = .15, this.targetOffset = .1, this.targetZone = HandConstraintZone.ULNAR_SIDE, this.zoneOrientationMode = HandConstraintOrientation.HAND_ROTATION, this.nodeOrientationMode = HandConstraintOrientation.HAND_ROTATION, this.handedness = "none", this.lerpTime = 100, this._zoneAxis[HandConstraintZone.ABOVE_FINGER_TIPS] = new math_vector/* Vector3 */.P(0, 1, 0), this._zoneAxis[HandConstraintZone.RADIAL_SIDE] = new math_vector/* Vector3 */.P(-1, 0, 0), this._zoneAxis[HandConstraintZone.ULNAR_SIDE] = new math_vector/* Vector3 */.P(1, 0, 0), this._zoneAxis[HandConstraintZone.BELOW_WRIST] = new math_vector/* Vector3 */.P(0, -1, 0);}get name() {return "HandConstraint";}enable() {this._node.setEnabled(!0);}disable() {this._node.setEnabled(!1);}_getHandPose() {if (!this._handTracking) return null;let hand;if (hand = "none" === this.handedness ? this._handTracking.getHandByHandedness("left") || this._handTracking.getHandByHandedness("right") : this._handTracking.getHandByHandedness(this.handedness), hand) {const pinkyMetacarpal = hand.getJointMesh(WebXRHandJoint.PINKY_FINGER_METACARPAL),middleMetacarpal = hand.getJointMesh(WebXRHandJoint.MIDDLE_FINGER_METACARPAL),wrist = hand.getJointMesh(WebXRHandJoint.WRIST);if (wrist && middleMetacarpal && pinkyMetacarpal) {const handPose = { position: middleMetacarpal.absolutePosition, quaternion: new math_vector/* Quaternion */._f(), id: hand.xrController.uniqueId },up = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],forward = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1],left = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2];return up.copyFrom(middleMetacarpal.absolutePosition).subtractInPlace(wrist.absolutePosition).normalize(), forward.copyFrom(pinkyMetacarpal.absolutePosition).subtractInPlace(middleMetacarpal.absolutePosition).normalize(), math_vector/* Vector3.CrossToRef */.P.CrossToRef(up, forward, forward), math_vector/* Vector3.CrossToRef */.P.CrossToRef(forward, up, left), math_vector/* Quaternion.FromLookDirectionLHToRef */._f.FromLookDirectionLHToRef(forward, up, handPose.quaternion), handPose;}}return null;}init() {}attach(node) {this._node = node, this._scene = node.getScene(), this._node.rotationQuaternion || (this._node.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this._node.rotation.y, this._node.rotation.x, this._node.rotation.z));let lastTick = Date.now();this._sceneRenderObserver = this._scene.onBeforeRenderObservable.add(() => {const pose = this._getHandPose();if (this._node.reservedDataStore = this._node.reservedDataStore || {}, this._node.reservedDataStore.nearInteraction = this._node.reservedDataStore.nearInteraction || {}, this._node.reservedDataStore.nearInteraction.excludedControllerId = null, pose) {const zoneOffset = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],camera = this._scene.activeCamera;zoneOffset.copyFrom(this._zoneAxis[this.targetZone]);const cameraLookAtQuaternion = math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0];if (camera && (this.zoneOrientationMode === HandConstraintOrientation.LOOK_AT_CAMERA || this.nodeOrientationMode === HandConstraintOrientation.LOOK_AT_CAMERA)) {const toCamera = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];toCamera.copyFrom(camera.position).subtractInPlace(pose.position).normalize(), this._scene.useRightHandedSystem ? math_vector/* Quaternion.FromLookDirectionRHToRef */._f.FromLookDirectionRHToRef(toCamera, math_vector/* Vector3.UpReadOnly */.P.UpReadOnly, cameraLookAtQuaternion) : math_vector/* Quaternion.FromLookDirectionLHToRef */._f.FromLookDirectionLHToRef(toCamera, math_vector/* Vector3.UpReadOnly */.P.UpReadOnly, cameraLookAtQuaternion);}this.zoneOrientationMode === HandConstraintOrientation.HAND_ROTATION ? pose.quaternion.toRotationMatrix(math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]) : cameraLookAtQuaternion.toRotationMatrix(math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(zoneOffset, math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0], zoneOffset), zoneOffset.scaleInPlace(this.targetOffset);const targetPosition = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],targetRotation = math_vector/* TmpVectors.Quaternion.1 */.jp.Quaternion[1];targetPosition.copyFrom(pose.position).addInPlace(zoneOffset), this.nodeOrientationMode === HandConstraintOrientation.HAND_ROTATION ? targetRotation.copyFrom(pose.quaternion) : targetRotation.copyFrom(cameraLookAtQuaternion);const elapsed = Date.now() - lastTick;math_vector/* Vector3.SmoothToRef */.P.SmoothToRef(this._node.position, targetPosition, elapsed, this.lerpTime, this._node.position), math_vector/* Quaternion.SmoothToRef */._f.SmoothToRef(this._node.rotationQuaternion, targetRotation, elapsed, this.lerpTime, this._node.rotationQuaternion), this._node.reservedDataStore.nearInteraction.excludedControllerId = pose.id;}this._setVisibility(pose), lastTick = Date.now();});}_setVisibility(pose) {let palmVisible = !0,gazeVisible = !0;const camera = this._scene.activeCamera;if (camera) {const cameraForward = camera.getForwardRay();if (this.handConstraintVisibility === HandConstraintVisibility.GAZE_FOCUS || this.handConstraintVisibility === HandConstraintVisibility.PALM_AND_GAZE) {gazeVisible = !1;let gaze;this._eyeTracking && (gaze = this._eyeTracking.getEyeGaze()), gaze = gaze || cameraForward;const gazeToBehavior = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];pose ? pose.position.subtractToRef(gaze.origin, gazeToBehavior) : this._node.getAbsolutePosition().subtractToRef(gaze.origin, gazeToBehavior);const projectedDistance = math_vector/* Vector3.Dot */.P.Dot(gazeToBehavior, gaze.direction);if (0 < projectedDistance) {const radiusSquared = gazeToBehavior.lengthSquared() - projectedDistance * projectedDistance;radiusSquared < this.gazeProximityRadius * this.gazeProximityRadius && (gazeVisible = !0);}}if ((this.handConstraintVisibility === HandConstraintVisibility.PALM_UP || this.handConstraintVisibility === HandConstraintVisibility.PALM_AND_GAZE) && (palmVisible = !1, pose)) {const palmDirection = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];math_vector/* Vector3.LeftHandedForwardReadOnly.rotateByQuaternionToRef */.P.LeftHandedForwardReadOnly.rotateByQuaternionToRef(pose.quaternion, palmDirection), math_vector/* Vector3.Dot */.P.Dot(palmDirection, cameraForward.direction) > 2 * this.palmUpStrictness - 1 && (palmVisible = !0);}}this._node.setEnabled(palmVisible && gazeVisible);}detach() {this._scene.onBeforeRenderObservable.remove(this._sceneRenderObserver);}linkToXRExperience(xr) {const featuresManager = xr.featuresManager ? xr.featuresManager : xr;if (!featuresManager) tools/* Tools.Error */.w1.Error("XR features manager must be available or provided directly for the Hand Menu to work");else {try {this._eyeTracking = featuresManager.getEnabledFeature(WebXRFeatureName.EYE_TRACKING);} catch (_a) {}try {this._handTracking = featuresManager.getEnabledFeature(WebXRFeatureName.HAND_TRACKING);} catch (_b) {tools/* Tools.Error */.w1.Error("Hand tracking must be enabled for the Hand Menu to work");}}}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Behaviors/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Bones/boneIKController.js
class BoneIKController {get maxAngle() {return this._maxAngle;}set maxAngle(value) {this._setMaxAngle(value);}constructor(mesh, bone, options) {this.targetPosition = math_vector/* Vector3.Zero */.P.Zero(), this.poleTargetPosition = math_vector/* Vector3.Zero */.P.Zero(), this.poleTargetLocalOffset = math_vector/* Vector3.Zero */.P.Zero(), this.poleAngle = 0, this.slerpAmount = 1, this._bone1Quat = math_vector/* Quaternion.Identity */._f.Identity(), this._bone1Mat = math_vector/* Matrix.Identity */.y3.Identity(), this._bone2Ang = Math.PI, this._maxAngle = Math.PI, this._rightHandedSystem = !1, this._bendAxis = math_vector/* Vector3.Right */.P.Right(), this._slerping = !1, this._adjustRoll = 0, this._notEnoughInformation = !1, this._bone2 = bone;const bone1 = bone.getParent();if (!bone1) return this._notEnoughInformation = !0, void logger/* Logger.Error */.Y.Error("BoneIKController: bone must have a parent for IK to work.");if (this._bone1 = bone1, 0 === this._bone2.children.length && !this._bone2.length) return this._notEnoughInformation = !0, void logger/* Logger.Error */.Y.Error("BoneIKController: bone must not be a leaf or it should have a length for IK to work.");this.mesh = mesh;const bonePos = bone.getPosition();if (0 < bone.getAbsoluteTransform().determinant() && (this._rightHandedSystem = !0, this._bendAxis.x = 0, this._bendAxis.y = 0, this._bendAxis.z = -1, bonePos.x > bonePos.y && bonePos.x > bonePos.z && (this._adjustRoll = .5 * Math.PI, this._bendAxis.z = 1)), this._bone1.length && this._bone2.length) {const boneScale1 = this._bone1.getScale(),boneScale2 = this._bone2.getScale();this._bone1Length = this._bone1.length * boneScale1.y * this.mesh.scaling.y, this._bone2Length = this._bone2.length * boneScale2.y * this.mesh.scaling.y;} else if (this._bone2.children[0]) {mesh.computeWorldMatrix(!0);const pos1 = this._bone2.children[0].getAbsolutePosition(mesh),pos2 = this._bone2.getAbsolutePosition(mesh),pos3 = this._bone1.getAbsolutePosition(mesh);this._bone2Length = math_vector/* Vector3.Distance */.P.Distance(pos1, pos2), this._bone1Length = math_vector/* Vector3.Distance */.P.Distance(pos2, pos3);} else {mesh.computeWorldMatrix(!0);const boneScale2 = this._bone2.getScale();this._bone2Length = this._bone2.length * boneScale2.y * this.mesh.scaling.y;const pos2 = this._bone2.getAbsolutePosition(mesh),pos3 = this._bone1.getAbsolutePosition(mesh);this._bone1Length = math_vector/* Vector3.Distance */.P.Distance(pos2, pos3);}this._bone1.getRotationMatrixToRef(math_axis/* Space.WORLD */.T.WORLD, mesh, this._bone1Mat), this.maxAngle = Math.PI, options && (options.targetMesh && (this.targetMesh = options.targetMesh, this.targetMesh.computeWorldMatrix(!0)), options.poleTargetMesh ? (this.poleTargetMesh = options.poleTargetMesh, this.poleTargetMesh.computeWorldMatrix(!0)) : options.poleTargetBone ? this.poleTargetBone = options.poleTargetBone : this._bone1.getParent() && (this.poleTargetBone = this._bone1.getParent()), options.poleTargetLocalOffset && this.poleTargetLocalOffset.copyFrom(options.poleTargetLocalOffset), options.poleAngle && (this.poleAngle = options.poleAngle), options.bendAxis && this._bendAxis.copyFrom(options.bendAxis), options.maxAngle && (this.maxAngle = options.maxAngle), options.slerpAmount && (this.slerpAmount = options.slerpAmount));}_setMaxAngle(ang) {0 > ang && (ang = 0), (ang > Math.PI || ang == null) && (ang = Math.PI), this._maxAngle = ang;const a = this._bone1Length,b = this._bone2Length;this._maxReach = Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(ang));}update() {if (this._notEnoughInformation) return;const target = this.targetPosition,poleTarget = this.poleTargetPosition,mat1 = BoneIKController._TmpMats[0],mat2 = BoneIKController._TmpMats[1];this.targetMesh && target.copyFrom(this.targetMesh.getAbsolutePosition()), this.poleTargetBone ? this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset, this.mesh, poleTarget) : this.poleTargetMesh && math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this.poleTargetLocalOffset, this.poleTargetMesh.getWorldMatrix(), poleTarget);const bonePos = BoneIKController._TmpVecs[0],zaxis = BoneIKController._TmpVecs[1],xaxis = BoneIKController._TmpVecs[2],yaxis = BoneIKController._TmpVecs[3],upAxis = BoneIKController._TmpVecs[4],tmpQuat = BoneIKController._TmpQuat;this._bone1.getAbsolutePositionToRef(this.mesh, bonePos), poleTarget.subtractToRef(bonePos, upAxis), 0 == upAxis.x && 0 == upAxis.y && 0 == upAxis.z ? upAxis.y = 1 : upAxis.normalize(), target.subtractToRef(bonePos, yaxis), yaxis.normalize(), math_vector/* Vector3.CrossToRef */.P.CrossToRef(yaxis, upAxis, zaxis), zaxis.normalize(), math_vector/* Vector3.CrossToRef */.P.CrossToRef(yaxis, zaxis, xaxis), xaxis.normalize(), math_vector/* Matrix.FromXYZAxesToRef */.y3.FromXYZAxesToRef(xaxis, yaxis, zaxis, mat1);const a = this._bone1Length,b = this._bone2Length;let c = math_vector/* Vector3.Distance */.P.Distance(bonePos, target);0 < this._maxReach && (c = Math.min(this._maxReach, c));let acosa = (b * b + c * c - a * a) / (2 * b * c),acosb = (c * c + a * a - b * b) / (2 * c * a);1 < acosa && (acosa = 1), 1 < acosb && (acosb = 1), -1 > acosa && (acosa = -1), -1 > acosb && (acosb = -1);const angA = Math.acos(acosa),angB = Math.acos(acosb);let angC = -angA - angB;if (this._rightHandedSystem) math_vector/* Matrix.RotationYawPitchRollToRef */.y3.RotationYawPitchRollToRef(0, 0, this._adjustRoll, mat2), mat2.multiplyToRef(mat1, mat1), math_vector/* Matrix.RotationAxisToRef */.y3.RotationAxisToRef(this._bendAxis, angB, mat2), mat2.multiplyToRef(mat1, mat1);else {const _tmpVec = BoneIKController._TmpVecs[5];_tmpVec.copyFrom(this._bendAxis), _tmpVec.x *= -1, math_vector/* Matrix.RotationAxisToRef */.y3.RotationAxisToRef(_tmpVec, -angB, mat2), mat2.multiplyToRef(mat1, mat1);}this.poleAngle && (math_vector/* Matrix.RotationAxisToRef */.y3.RotationAxisToRef(yaxis, this.poleAngle, mat2), mat1.multiplyToRef(mat2, mat1)), this._bone1 && (1 > this.slerpAmount ? (!this._slerping && math_vector/* Quaternion.FromRotationMatrixToRef */._f.FromRotationMatrixToRef(this._bone1Mat, this._bone1Quat), math_vector/* Quaternion.FromRotationMatrixToRef */._f.FromRotationMatrixToRef(mat1, tmpQuat), math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(this._bone1Quat, tmpQuat, this.slerpAmount, this._bone1Quat), angC = this._bone2Ang * (1 - this.slerpAmount) + angC * this.slerpAmount, this._bone1.setRotationQuaternion(this._bone1Quat, math_axis/* Space.WORLD */.T.WORLD, this.mesh), this._slerping = !0) : (this._bone1.setRotationMatrix(mat1, math_axis/* Space.WORLD */.T.WORLD, this.mesh), this._bone1Mat.copyFrom(mat1), this._slerping = !1), this._updateLinkedTransformRotation(this._bone1)), this._bone2.setAxisAngle(this._bendAxis, angC, math_axis/* Space.LOCAL */.T.LOCAL), this._updateLinkedTransformRotation(this._bone2), this._bone2Ang = angC;}_updateLinkedTransformRotation(bone) {bone._linkedTransformNode && (!bone._linkedTransformNode.rotationQuaternion && (bone._linkedTransformNode.rotationQuaternion = new math_vector/* Quaternion */._f()), bone.getRotationQuaternionToRef(math_axis/* Space.LOCAL */.T.LOCAL, null, bone._linkedTransformNode.rotationQuaternion));}}BoneIKController._TmpVecs = [math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero()], BoneIKController._TmpQuat = math_vector/* Quaternion.Identity */._f.Identity(), BoneIKController._TmpMats = [math_vector/* Matrix.Identity */.y3.Identity(), math_vector/* Matrix.Identity */.y3.Identity()];
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Bones/boneLookController.js
class BoneLookController {get minYaw() {return this._minYaw;}set minYaw(value) {this._minYaw = value, this._minYawSin = Math.sin(value), this._minYawCos = Math.cos(value), null != this._maxYaw && (this._midYawConstraint = .5 * this._getAngleDiff(this._minYaw, this._maxYaw) + this._minYaw, this._yawRange = this._maxYaw - this._minYaw);}get maxYaw() {return this._maxYaw;}set maxYaw(value) {this._maxYaw = value, this._maxYawSin = Math.sin(value), this._maxYawCos = Math.cos(value), null != this._minYaw && (this._midYawConstraint = .5 * this._getAngleDiff(this._minYaw, this._maxYaw) + this._minYaw, this._yawRange = this._maxYaw - this._minYaw);}get minPitch() {return this._minPitch;}set minPitch(value) {this._minPitch = value, this._minPitchTan = Math.tan(value);}get maxPitch() {return this._maxPitch;}set maxPitch(value) {this._maxPitch = value, this._maxPitchTan = Math.tan(value);}constructor(mesh, bone, target, options) {if (this.upAxis = math_vector/* Vector3.Up */.P.Up(), this.upAxisSpace = math_axis/* Space.LOCAL */.T.LOCAL, this.adjustYaw = 0, this.adjustPitch = 0, this.adjustRoll = 0, this.slerpAmount = 1, this._boneQuat = math_vector/* Quaternion.Identity */._f.Identity(), this._slerping = !1, this._firstFrameSkipped = !1, this._fowardAxis = math_vector/* Vector3.Forward */.P.Forward(), this.mesh = mesh, this.bone = bone, this.target = target, options && (options.adjustYaw && (this.adjustYaw = options.adjustYaw), options.adjustPitch && (this.adjustPitch = options.adjustPitch), options.adjustRoll && (this.adjustRoll = options.adjustRoll), this.maxYaw = null == options.maxYaw ? Math.PI : options.maxYaw, this.minYaw = null == options.minYaw ? -Math.PI : options.minYaw, this.maxPitch = null == options.maxPitch ? Math.PI : options.maxPitch, this.minPitch = null == options.minPitch ? -Math.PI : options.minPitch, null != options.slerpAmount && (this.slerpAmount = options.slerpAmount), null != options.upAxis && (this.upAxis = options.upAxis), null != options.upAxisSpace && (this.upAxisSpace = options.upAxisSpace), null != options.yawAxis || null != options.pitchAxis)) {let newYawAxis = math_axis/* Axis.Y */.RD.Y,newPitchAxis = math_axis/* Axis.X */.RD.X;null != options.yawAxis && (newYawAxis = options.yawAxis.clone(), newYawAxis.normalize()), null != options.pitchAxis && (newPitchAxis = options.pitchAxis.clone(), newPitchAxis.normalize());const newRollAxis = math_vector/* Vector3.Cross */.P.Cross(newPitchAxis, newYawAxis);this._transformYawPitch = math_vector/* Matrix.Identity */.y3.Identity(), math_vector/* Matrix.FromXYZAxesToRef */.y3.FromXYZAxesToRef(newPitchAxis, newYawAxis, newRollAxis, this._transformYawPitch), this._transformYawPitchInv = this._transformYawPitch.clone(), this._transformYawPitch.invert();}bone.getParent() || this.upAxisSpace != math_axis/* Space.BONE */.T.BONE || (this.upAxisSpace = math_axis/* Space.LOCAL */.T.LOCAL);}update() {if (1 > this.slerpAmount && !this._firstFrameSkipped) return void (this._firstFrameSkipped = !0);const bone = this.bone,bonePos = BoneLookController._TmpVecs[0];bone.getAbsolutePositionToRef(this.mesh, bonePos);let target = this.target;const _tmpMat1 = BoneLookController._TmpMats[0],_tmpMat2 = BoneLookController._TmpMats[1],mesh = this.mesh,parentBone = bone.getParent(),upAxis = BoneLookController._TmpVecs[1];upAxis.copyFrom(this.upAxis), this.upAxisSpace == math_axis/* Space.BONE */.T.BONE && parentBone ? (this._transformYawPitch && math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(upAxis, this._transformYawPitchInv, upAxis), parentBone.getDirectionToRef(upAxis, this.mesh, upAxis)) : this.upAxisSpace == math_axis/* Space.LOCAL */.T.LOCAL && (mesh.getDirectionToRef(upAxis, upAxis), (1 != mesh.scaling.x || 1 != mesh.scaling.y || 1 != mesh.scaling.z) && upAxis.normalize());let checkYaw = !1,checkPitch = !1;if ((this._maxYaw != Math.PI || this._minYaw != -Math.PI) && (checkYaw = !0), (this._maxPitch != Math.PI || this._minPitch != -Math.PI) && (checkPitch = !0), checkYaw || checkPitch) {const spaceMat = BoneLookController._TmpMats[2],spaceMatInv = BoneLookController._TmpMats[3];if (this.upAxisSpace == math_axis/* Space.BONE */.T.BONE && 1 == upAxis.y && parentBone) parentBone.getRotationMatrixToRef(math_axis/* Space.WORLD */.T.WORLD, this.mesh, spaceMat);else if (this.upAxisSpace == math_axis/* Space.LOCAL */.T.LOCAL && 1 == upAxis.y && !parentBone) spaceMat.copyFrom(mesh.getWorldMatrix());else {let forwardAxis = BoneLookController._TmpVecs[2];forwardAxis.copyFrom(this._fowardAxis), this._transformYawPitch && math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(forwardAxis, this._transformYawPitchInv, forwardAxis), parentBone ? parentBone.getDirectionToRef(forwardAxis, this.mesh, forwardAxis) : mesh.getDirectionToRef(forwardAxis, forwardAxis);const rightAxis = math_vector/* Vector3.Cross */.P.Cross(upAxis, forwardAxis);rightAxis.normalize(), forwardAxis = math_vector/* Vector3.Cross */.P.Cross(rightAxis, upAxis), math_vector/* Matrix.FromXYZAxesToRef */.y3.FromXYZAxesToRef(rightAxis, upAxis, forwardAxis, spaceMat);}spaceMat.invertToRef(spaceMatInv);let xzlen = null;if (checkPitch) {const localTarget = BoneLookController._TmpVecs[3];target.subtractToRef(bonePos, localTarget), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(localTarget, spaceMatInv, localTarget), xzlen = Math.sqrt(localTarget.x * localTarget.x + localTarget.z * localTarget.z);const pitch = Math.atan2(localTarget.y, xzlen);let newPitch = pitch;pitch > this._maxPitch ? (localTarget.y = this._maxPitchTan * xzlen, newPitch = this._maxPitch) : pitch < this._minPitch && (localTarget.y = this._minPitchTan * xzlen, newPitch = this._minPitch), pitch != newPitch && (math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(localTarget, spaceMat, localTarget), localTarget.addInPlace(bonePos), target = localTarget);}if (checkYaw) {const localTarget = BoneLookController._TmpVecs[4];target.subtractToRef(bonePos, localTarget), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(localTarget, spaceMatInv, localTarget);const yaw = Math.atan2(localTarget.x, localTarget.z);let newYaw = yaw;if ((yaw > this._maxYaw || yaw < this._minYaw) && (null == xzlen && (xzlen = Math.sqrt(localTarget.x * localTarget.x + localTarget.z * localTarget.z)), this._yawRange > Math.PI ? this._isAngleBetween(yaw, this._maxYaw, this._midYawConstraint) ? (localTarget.z = this._maxYawCos * xzlen, localTarget.x = this._maxYawSin * xzlen, newYaw = this._maxYaw) : this._isAngleBetween(yaw, this._midYawConstraint, this._minYaw) && (localTarget.z = this._minYawCos * xzlen, localTarget.x = this._minYawSin * xzlen, newYaw = this._minYaw) : yaw > this._maxYaw ? (localTarget.z = this._maxYawCos * xzlen, localTarget.x = this._maxYawSin * xzlen, newYaw = this._maxYaw) : yaw < this._minYaw && (localTarget.z = this._minYawCos * xzlen, localTarget.x = this._minYawSin * xzlen, newYaw = this._minYaw)), this._slerping && this._yawRange > Math.PI) {const boneFwd = BoneLookController._TmpVecs[8];boneFwd.copyFrom(math_axis/* Axis.Z */.RD.Z), this._transformYawPitch && math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(boneFwd, this._transformYawPitchInv, boneFwd);const boneRotMat = BoneLookController._TmpMats[4];this._boneQuat.toRotationMatrix(boneRotMat), this.mesh.getWorldMatrix().multiplyToRef(boneRotMat, boneRotMat), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(boneFwd, boneRotMat, boneFwd), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(boneFwd, spaceMatInv, boneFwd);const boneYaw = Math.atan2(boneFwd.x, boneFwd.z),angBtwTar = this._getAngleBetween(boneYaw, yaw),angBtwMidYaw = this._getAngleBetween(boneYaw, this._midYawConstraint);if (angBtwTar > angBtwMidYaw) {null == xzlen && (xzlen = Math.sqrt(localTarget.x * localTarget.x + localTarget.z * localTarget.z));const angBtwMax = this._getAngleBetween(boneYaw, this._maxYaw),angBtwMin = this._getAngleBetween(boneYaw, this._minYaw);angBtwMin < angBtwMax ? (newYaw = boneYaw + .75 * Math.PI, localTarget.z = Math.cos(newYaw) * xzlen, localTarget.x = Math.sin(newYaw) * xzlen) : (newYaw = boneYaw - .75 * Math.PI, localTarget.z = Math.cos(newYaw) * xzlen, localTarget.x = Math.sin(newYaw) * xzlen);}}yaw != newYaw && (math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(localTarget, spaceMat, localTarget), localTarget.addInPlace(bonePos), target = localTarget);}}const zaxis = BoneLookController._TmpVecs[5],xaxis = BoneLookController._TmpVecs[6],yaxis = BoneLookController._TmpVecs[7],tmpQuat = BoneLookController._TmpQuat;target.subtractToRef(bonePos, zaxis), zaxis.normalize(), math_vector/* Vector3.CrossToRef */.P.CrossToRef(upAxis, zaxis, xaxis), xaxis.normalize(), math_vector/* Vector3.CrossToRef */.P.CrossToRef(zaxis, xaxis, yaxis), yaxis.normalize(), math_vector/* Matrix.FromXYZAxesToRef */.y3.FromXYZAxesToRef(xaxis, yaxis, zaxis, _tmpMat1), 0 === xaxis.x && 0 === xaxis.y && 0 === xaxis.z || 0 === yaxis.x && 0 === yaxis.y && 0 === yaxis.z || 0 === zaxis.x && 0 === zaxis.y && 0 === zaxis.z || ((this.adjustYaw || this.adjustPitch || this.adjustRoll) && (math_vector/* Matrix.RotationYawPitchRollToRef */.y3.RotationYawPitchRollToRef(this.adjustYaw, this.adjustPitch, this.adjustRoll, _tmpMat2), _tmpMat2.multiplyToRef(_tmpMat1, _tmpMat1)), 1 > this.slerpAmount ? (!this._slerping && this.bone.getRotationQuaternionToRef(math_axis/* Space.WORLD */.T.WORLD, this.mesh, this._boneQuat), this._transformYawPitch && this._transformYawPitch.multiplyToRef(_tmpMat1, _tmpMat1), math_vector/* Quaternion.FromRotationMatrixToRef */._f.FromRotationMatrixToRef(_tmpMat1, tmpQuat), math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(this._boneQuat, tmpQuat, this.slerpAmount, this._boneQuat), this.bone.setRotationQuaternion(this._boneQuat, math_axis/* Space.WORLD */.T.WORLD, this.mesh), this._slerping = !0) : (this._transformYawPitch && this._transformYawPitch.multiplyToRef(_tmpMat1, _tmpMat1), this.bone.setRotationMatrix(_tmpMat1, math_axis/* Space.WORLD */.T.WORLD, this.mesh), this._slerping = !1), this._updateLinkedTransformRotation());}_getAngleDiff(ang1, ang2) {let angDiff = ang2 - ang1;return angDiff %= 2 * Math.PI, angDiff > Math.PI ? angDiff -= 2 * Math.PI : angDiff < -Math.PI && (angDiff += 2 * Math.PI), angDiff;}_getAngleBetween(ang1, ang2) {ang1 %= 2 * Math.PI, ang1 = 0 > ang1 ? ang1 + 2 * Math.PI : ang1, ang2 %= 2 * Math.PI, ang2 = 0 > ang2 ? ang2 + 2 * Math.PI : ang2;let ab = 0;return ab = ang1 < ang2 ? ang2 - ang1 : ang1 - ang2, ab > Math.PI && (ab = 2 * Math.PI - ab), ab;}_isAngleBetween(ang, ang1, ang2) {if (ang %= 2 * Math.PI, ang = 0 > ang ? ang + 2 * Math.PI : ang, ang1 %= 2 * Math.PI, ang1 = 0 > ang1 ? ang1 + 2 * Math.PI : ang1, ang2 %= 2 * Math.PI, ang2 = 0 > ang2 ? ang2 + 2 * Math.PI : ang2, ang1 < ang2) {if (ang > ang1 && ang < ang2) return !0;} else if (ang > ang2 && ang < ang1) return !0;return !1;}_updateLinkedTransformRotation() {const bone = this.bone;bone._linkedTransformNode && (!bone._linkedTransformNode.rotationQuaternion && (bone._linkedTransformNode.rotationQuaternion = new math_vector/* Quaternion */._f()), bone.getRotationQuaternionToRef(math_axis/* Space.LOCAL */.T.LOCAL, null, bone._linkedTransformNode.rotationQuaternion));}}BoneLookController._TmpVecs = arrayTools/* ArrayTools.BuildArray */.B.BuildArray(10, math_vector/* Vector3.Zero */.P.Zero), BoneLookController._TmpQuat = math_vector/* Quaternion.Identity */._f.Identity(), BoneLookController._TmpMats = arrayTools/* ArrayTools.BuildArray */.B.BuildArray(5, math_vector/* Matrix.Identity */.y3.Identity);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Bones/skeleton.js
var Bones_skeleton = __webpack_require__("./node_modules/@babylonjs/core/Bones/skeleton.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Bones/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/dataBuffer.js
var dataBuffer = __webpack_require__("./node_modules/@babylonjs/core/Buffers/dataBuffer.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Buffers/storageBuffer.js
class StorageBuffer {constructor(engine, size, creationFlags = 3) {this._engine = engine, this._engine._storageBuffers.push(this), this._create(size, creationFlags);}_create(size, creationFlags) {this._bufferSize = size, this._creationFlags = creationFlags, this._buffer = this._engine.createStorageBuffer(size, creationFlags);}_rebuild() {this._create(this._bufferSize, this._creationFlags);}getBuffer() {return this._buffer;}update(data, byteOffset, byteLength) {this._buffer && this._engine.updateStorageBuffer(this._buffer, data, byteOffset, byteLength);}read(offset, size, buffer) {return this._engine.readFromStorageBuffer(this._buffer, offset, size, buffer);}dispose() {const storageBuffers = this._engine._storageBuffers,index = storageBuffers.indexOf(this);-1 !== index && (storageBuffers[index] = storageBuffers[storageBuffers.length - 1], storageBuffers.pop()), this._engine._releaseBuffer(this._buffer), this._buffer = null;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Buffers/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraMouseWheelInput.js
var BaseCameraMouseWheelInput = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraMouseWheelInput.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraPointersInput.js
class BaseCameraPointersInput {constructor() {this._currentActiveButton = -1, this.buttons = [0, 1, 2];}attachControl(noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments);const engine = this.camera.getEngine(),element = engine.getInputElement();let previousPinchSquaredDistance = 0,previousMultiTouchPanPosition = null;this._pointA = null, this._pointB = null, this._altKey = !1, this._ctrlKey = !1, this._metaKey = !1, this._shiftKey = !1, this._buttonsPressed = 0, this._pointerInput = (p) => {var _a, _b;const evt = p.event,isTouch = "touch" === evt.pointerType;if (!engine.isInVRExclusivePointerMode && (p.type === pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE || -1 !== this.buttons.indexOf(evt.button))) {const srcElement = evt.target;if (this._altKey = evt.altKey, this._ctrlKey = evt.ctrlKey, this._metaKey = evt.metaKey, this._shiftKey = evt.shiftKey, this._buttonsPressed = evt.buttons, engine.isPointerLock) {const offsetX = evt.movementX,offsetY = evt.movementY;this.onTouch(null, offsetX, offsetY), this._pointA = null, this._pointB = null;} else {if (p.type !== pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN && isTouch && (null === (_a = this._pointA) || void 0 === _a ? void 0 : _a.pointerId) !== evt.pointerId && (null === (_b = this._pointB) || void 0 === _b ? void 0 : _b.pointerId) !== evt.pointerId) return;if (p.type === pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN && (-1 === this._currentActiveButton || isTouch)) {try {null === srcElement || void 0 === srcElement ? void 0 : srcElement.setPointerCapture(evt.pointerId);} catch (e) {}if (null === this._pointA) this._pointA = { x: evt.clientX, y: evt.clientY, pointerId: evt.pointerId, type: evt.pointerType };else if (null === this._pointB) this._pointB = { x: evt.clientX, y: evt.clientY, pointerId: evt.pointerId, type: evt.pointerType };else return;-1 !== this._currentActiveButton || isTouch || (this._currentActiveButton = evt.button), this.onButtonDown(evt), noPreventDefault || (evt.preventDefault(), element && element.focus());} else if (p.type === pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP) this.onDoubleTap(evt.pointerType);else if (p.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP && (this._currentActiveButton === evt.button || isTouch)) {try {null === srcElement || void 0 === srcElement ? void 0 : srcElement.releasePointerCapture(evt.pointerId);} catch (e) {}isTouch || (this._pointB = null), engine._badOS ? this._pointA = this._pointB = null : this._pointB && this._pointA && this._pointA.pointerId == evt.pointerId ? (this._pointA = this._pointB, this._pointB = null) : this._pointA && this._pointB && this._pointB.pointerId == evt.pointerId ? this._pointB = null : this._pointA = this._pointB = null, (0 !== previousPinchSquaredDistance || previousMultiTouchPanPosition) && (this.onMultiTouch(this._pointA, this._pointB, previousPinchSquaredDistance, 0, previousMultiTouchPanPosition, null), previousPinchSquaredDistance = 0, previousMultiTouchPanPosition = null), this._currentActiveButton = -1, this.onButtonUp(evt), noPreventDefault || evt.preventDefault();} else if (p.type === pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE) if (noPreventDefault || evt.preventDefault(), this._pointA && null === this._pointB) {const offsetX = evt.clientX - this._pointA.x,offsetY = evt.clientY - this._pointA.y;this.onTouch(this._pointA, offsetX, offsetY), this._pointA.x = evt.clientX, this._pointA.y = evt.clientY;} else if (this._pointA && this._pointB) {const ed = this._pointA.pointerId === evt.pointerId ? this._pointA : this._pointB;ed.x = evt.clientX, ed.y = evt.clientY;const distX = this._pointA.x - this._pointB.x,distY = this._pointA.y - this._pointB.y,pinchSquaredDistance = distX * distX + distY * distY,multiTouchPanPosition = { x: (this._pointA.x + this._pointB.x) / 2, y: (this._pointA.y + this._pointB.y) / 2, pointerId: evt.pointerId, type: p.type };this.onMultiTouch(this._pointA, this._pointB, previousPinchSquaredDistance, pinchSquaredDistance, previousMultiTouchPanPosition, multiTouchPanPosition), previousMultiTouchPanPosition = multiTouchPanPosition, previousPinchSquaredDistance = pinchSquaredDistance;}}}}, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput, pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN | pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP | pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE | pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP), this._onLostFocus = () => {this._pointA = this._pointB = null, previousPinchSquaredDistance = 0, previousMultiTouchPanPosition = null, this.onLostFocus();}, this._contextMenuBind = this.onContextMenu.bind(this), element && element.addEventListener("contextmenu", this._contextMenuBind, !1);const hostWindow = this.camera.getScene().getEngine().getHostWindow();hostWindow && tools/* Tools.RegisterTopRootEvents */.w1.RegisterTopRootEvents(hostWindow, [{ name: "blur", handler: this._onLostFocus }]);}detachControl() {if (this._onLostFocus) {const hostWindow = this.camera.getScene().getEngine().getHostWindow();hostWindow && tools/* Tools.UnregisterTopRootEvents */.w1.UnregisterTopRootEvents(hostWindow, [{ name: "blur", handler: this._onLostFocus }]);}if (this._observer) {if (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null, this._contextMenuBind) {const inputElement = this.camera.getScene().getEngine().getInputElement();inputElement && inputElement.removeEventListener("contextmenu", this._contextMenuBind);}this._onLostFocus = null;}this._altKey = !1, this._ctrlKey = !1, this._metaKey = !1, this._shiftKey = !1, this._buttonsPressed = 0, this._currentActiveButton = -1;}getClassName() {return "BaseCameraPointersInput";}getSimpleName() {return "pointers";}onDoubleTap() {}onTouch() {}onMultiTouch() {}onContextMenu(evt) {evt.preventDefault();}onButtonDown() {}onButtonUp() {}onLostFocus() {}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BaseCameraPointersInput.prototype, "buttons", void 0);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/cameraInputsManager.js
var cameraInputsManager = __webpack_require__("./node_modules/@babylonjs/core/Cameras/cameraInputsManager.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/gamepad.js
class StickValues {constructor(x, y) {this.x = x, this.y = y;}}class Gamepad {get isConnected() {return this._isConnected;}constructor(id, index, browserGamepad, leftStickX = 0, leftStickY = 1, rightStickX = 2, rightStickY = 3) {this.id = id, this.index = index, this.browserGamepad = browserGamepad, this._leftStick = { x: 0, y: 0 }, this._rightStick = { x: 0, y: 0 }, this._isConnected = !0, this._invertLeftStickY = !1, this.type = Gamepad.GAMEPAD, this._leftStickAxisX = leftStickX, this._leftStickAxisY = leftStickY, this._rightStickAxisX = rightStickX, this._rightStickAxisY = rightStickY, 2 <= this.browserGamepad.axes.length && (this._leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }), 4 <= this.browserGamepad.axes.length && (this._rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] });}onleftstickchanged(callback) {this._onleftstickchanged = callback;}onrightstickchanged(callback) {this._onrightstickchanged = callback;}get leftStick() {return this._leftStick;}set leftStick(newValues) {this._onleftstickchanged && (this._leftStick.x !== newValues.x || this._leftStick.y !== newValues.y) && this._onleftstickchanged(newValues), this._leftStick = newValues;}get rightStick() {return this._rightStick;}set rightStick(newValues) {this._onrightstickchanged && (this._rightStick.x !== newValues.x || this._rightStick.y !== newValues.y) && this._onrightstickchanged(newValues), this._rightStick = newValues;}update() {this._leftStick && (this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }, this._invertLeftStickY && (this.leftStick.y *= -1)), this._rightStick && (this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] });}dispose() {}}Gamepad.GAMEPAD = 0, Gamepad.GENERIC = 1, Gamepad.XBOX = 2, Gamepad.POSE_ENABLED = 3, Gamepad.DUALSHOCK = 4;class GenericPad extends Gamepad {onbuttondown(callback) {this._onbuttondown = callback;}onbuttonup(callback) {this._onbuttonup = callback;}constructor(id, index, browserGamepad) {super(id, index, browserGamepad), this.onButtonDownObservable = new observable/* Observable */.y$(), this.onButtonUpObservable = new observable/* Observable */.y$(), this.type = Gamepad.GENERIC, this._buttons = Array(browserGamepad.buttons.length);}_setButtonValue(newValue, currentValue, buttonIndex) {return newValue !== currentValue && (1 === newValue && (this._onbuttondown && this._onbuttondown(buttonIndex), this.onButtonDownObservable.notifyObservers(buttonIndex)), 0 === newValue && (this._onbuttonup && this._onbuttonup(buttonIndex), this.onButtonUpObservable.notifyObservers(buttonIndex))), newValue;}update() {super.update();for (let index = 0; index < this._buttons.length; index++) this._buttons[index] = this._setButtonValue(this.browserGamepad.buttons[index].value, this._buttons[index], index);}dispose() {super.dispose(), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraGamepadInput.js
class ArcRotateCameraGamepadInput {constructor() {this.gamepadRotationSensibility = 80, this.gamepadMoveSensibility = 40, this._yAxisScale = 1;}get invertYAxis() {return 1 !== this._yAxisScale;}set invertYAxis(value) {this._yAxisScale = value ? -1 : 1;}attachControl() {const manager = this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver = manager.onGamepadConnectedObservable.add((gamepad) => {gamepad.type === Gamepad.POSE_ENABLED || this.gamepad && gamepad.type !== Gamepad.XBOX || (this.gamepad = gamepad);}), this._onGamepadDisconnectedObserver = manager.onGamepadDisconnectedObservable.add((gamepad) => {this.gamepad === gamepad && (this.gamepad = null);}), this.gamepad = manager.getGamepadByType(Gamepad.XBOX);}detachControl() {this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null;}checkInputs() {if (this.gamepad) {const camera = this.camera,rsValues = this.gamepad.rightStick;if (rsValues) {if (0 != rsValues.x) {const normalizedRX = rsValues.x / this.gamepadRotationSensibility;0 != normalizedRX && .005 < Math.abs(normalizedRX) && (camera.inertialAlphaOffset += normalizedRX);}if (0 != rsValues.y) {const normalizedRY = rsValues.y / this.gamepadRotationSensibility * this._yAxisScale;0 != normalizedRY && .005 < Math.abs(normalizedRY) && (camera.inertialBetaOffset += normalizedRY);}}const lsValues = this.gamepad.leftStick;if (lsValues && 0 != lsValues.y) {const normalizedLY = lsValues.y / this.gamepadMoveSensibility;0 != normalizedLY && .005 < Math.abs(normalizedLY) && (this.camera.inertialRadiusOffset -= normalizedLY);}}}getClassName() {return "ArcRotateCameraGamepadInput";}getSimpleName() {return "gamepad";}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraGamepadInput.prototype, "gamepadRotationSensibility", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraGamepadInput.prototype, "gamepadMoveSensibility", void 0), cameraInputsManager/* CameraInputTypes.ArcRotateCameraGamepadInput */.u.ArcRotateCameraGamepadInput = ArcRotateCameraGamepadInput;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/keyboardEvents.js
var keyboardEvents = __webpack_require__("./node_modules/@babylonjs/core/Events/keyboardEvents.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js
class ArcRotateCameraKeyboardMoveInput {constructor() {this.keysUp = [38], this.keysDown = [40], this.keysLeft = [37], this.keysRight = [39], this.keysReset = [220], this.panningSensibility = 50, this.zoomingSensibility = 25, this.useAltToZoom = !0, this.angularSpeed = .01, this._keys = [];}attachControl(noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments);this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {this._keys.length = 0;}), this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {const evt = info.event;if (!evt.metaKey) if (info.type === keyboardEvents/* KeyboardEventTypes.KEYDOWN */.OG.KEYDOWN) {if (this._ctrlPressed = evt.ctrlKey, this._altPressed = evt.altKey, -1 !== this.keysUp.indexOf(evt.keyCode) || -1 !== this.keysDown.indexOf(evt.keyCode) || -1 !== this.keysLeft.indexOf(evt.keyCode) || -1 !== this.keysRight.indexOf(evt.keyCode) || -1 !== this.keysReset.indexOf(evt.keyCode)) {const index = this._keys.indexOf(evt.keyCode);-1 === index && this._keys.push(evt.keyCode), evt.preventDefault && !noPreventDefault && evt.preventDefault();}} else if (-1 !== this.keysUp.indexOf(evt.keyCode) || -1 !== this.keysDown.indexOf(evt.keyCode) || -1 !== this.keysLeft.indexOf(evt.keyCode) || -1 !== this.keysRight.indexOf(evt.keyCode) || -1 !== this.keysReset.indexOf(evt.keyCode)) {const index = this._keys.indexOf(evt.keyCode);0 <= index && this._keys.splice(index, 1), evt.preventDefault && !noPreventDefault && evt.preventDefault();}}));}detachControl() {this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys.length = 0;}checkInputs() {if (this._onKeyboardObserver) {const camera = this.camera;for (let index = 0; index < this._keys.length; index++) {const keyCode = this._keys[index];-1 === this.keysLeft.indexOf(keyCode) ? -1 === this.keysUp.indexOf(keyCode) ? -1 === this.keysRight.indexOf(keyCode) ? -1 === this.keysDown.indexOf(keyCode) ? -1 !== this.keysReset.indexOf(keyCode) && camera.useInputToRestoreState && camera.restoreState() : this._ctrlPressed && this.camera._useCtrlForPanning ? camera.inertialPanningY -= 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? camera.inertialRadiusOffset -= 1 / this.zoomingSensibility : camera.inertialBetaOffset += this.angularSpeed : this._ctrlPressed && this.camera._useCtrlForPanning ? camera.inertialPanningX += 1 / this.panningSensibility : camera.inertialAlphaOffset += this.angularSpeed : this._ctrlPressed && this.camera._useCtrlForPanning ? camera.inertialPanningY += 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? camera.inertialRadiusOffset += 1 / this.zoomingSensibility : camera.inertialBetaOffset -= this.angularSpeed : this._ctrlPressed && this.camera._useCtrlForPanning ? camera.inertialPanningX -= 1 / this.panningSensibility : camera.inertialAlphaOffset -= this.angularSpeed;}}}getClassName() {return "ArcRotateCameraKeyboardMoveInput";}getSimpleName() {return "keyboard";}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraKeyboardMoveInput.prototype, "keysUp", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraKeyboardMoveInput.prototype, "keysDown", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraKeyboardMoveInput.prototype, "keysLeft", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraKeyboardMoveInput.prototype, "keysRight", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraKeyboardMoveInput.prototype, "keysReset", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraKeyboardMoveInput.prototype, "panningSensibility", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraKeyboardMoveInput.prototype, "zoomingSensibility", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraKeyboardMoveInput.prototype, "useAltToZoom", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraKeyboardMoveInput.prototype, "angularSpeed", void 0), cameraInputsManager/* CameraInputTypes.ArcRotateCameraKeyboardMoveInput */.u.ArcRotateCameraKeyboardMoveInput = ArcRotateCameraKeyboardMoveInput;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.plane.js
var math_plane = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.plane.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/deviceInputEvents.js
var deviceInputEvents = __webpack_require__("./node_modules/@babylonjs/core/Events/deviceInputEvents.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraMouseWheelInput.js
const ffMultiplier = 40;class ArcRotateCameraMouseWheelInput {constructor() {this.wheelPrecision = 3, this.zoomToMouseLocation = !1, this.wheelDeltaPercentage = 0, this.customComputeDeltaFromMouseWheel = null, this._inertialPanning = math_vector/* Vector3.Zero */.P.Zero();}_computeDeltaFromMouseWheelLegacyEvent(mouseWheelDelta, radius) {let delta = 0;const wheelDelta = .01 * mouseWheelDelta * this.wheelDeltaPercentage * radius;return delta = 0 < mouseWheelDelta ? wheelDelta / (1 + this.wheelDeltaPercentage) : wheelDelta * (1 + this.wheelDeltaPercentage), delta;}attachControl(noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments), this._wheel = (p) => {if (p.type !== pointerEvents/* PointerEventTypes.POINTERWHEEL */.kD.POINTERWHEEL) return;const event = p.event;let delta = 0;const platformScale = event.deltaMode === deviceInputEvents/* EventConstants.DOM_DELTA_LINE */.G.DOM_DELTA_LINE ? ffMultiplier : 1,wheelDelta = -(event.deltaY * platformScale);if (this.customComputeDeltaFromMouseWheel) delta = this.customComputeDeltaFromMouseWheel(wheelDelta, this, event);else if (!this.wheelDeltaPercentage) delta = wheelDelta / (40 * this.wheelPrecision);else if (delta = this._computeDeltaFromMouseWheelLegacyEvent(wheelDelta, this.camera.radius), 0 < delta) {let estimatedTargetRadius = this.camera.radius,targetInertia = this.camera.inertialRadiusOffset + delta;for (let i = 0; 20 > i && .001 < Math.abs(targetInertia); i++) estimatedTargetRadius -= targetInertia, targetInertia *= this.camera.inertia;estimatedTargetRadius = math_scalar/* Scalar.Clamp */.R.Clamp(estimatedTargetRadius, 0, Number.MAX_VALUE), delta = this._computeDeltaFromMouseWheelLegacyEvent(wheelDelta, estimatedTargetRadius);}delta && (this.zoomToMouseLocation && this._hitPlane ? this._zoomToMouse(delta) : this.camera.inertialRadiusOffset += delta), event.preventDefault && !noPreventDefault && event.preventDefault();}, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel, pointerEvents/* PointerEventTypes.POINTERWHEEL */.kD.POINTERWHEEL), this.zoomToMouseLocation && this._inertialPanning.setAll(0);}detachControl() {this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null, this._wheel = null);}checkInputs() {if (!this.zoomToMouseLocation) return;const camera = this.camera,motion = 0 + camera.inertialAlphaOffset + camera.inertialBetaOffset + camera.inertialRadiusOffset;motion && (this._updateHitPlane(), camera.target.addInPlace(this._inertialPanning), this._inertialPanning.scaleInPlace(camera.inertia), this._zeroIfClose(this._inertialPanning));}getClassName() {return "ArcRotateCameraMouseWheelInput";}getSimpleName() {return "mousewheel";}_updateHitPlane() {const camera = this.camera,direction = camera.target.subtract(camera.position);this._hitPlane = math_plane/* Plane.FromPositionAndNormal */.J.FromPositionAndNormal(camera.target, direction);}_getPosition() {var _a;const camera = this.camera,scene = camera.getScene(),ray = scene.createPickingRay(scene.pointerX, scene.pointerY, math_vector/* Matrix.Identity */.y3.Identity(), camera, !1);let distance = 0;return this._hitPlane && (distance = null !== (_a = ray.intersectsPlane(this._hitPlane)) && void 0 !== _a ? _a : 0), ray.origin.addInPlace(ray.direction.scaleInPlace(distance));}_zoomToMouse(delta) {var _a, _b;const camera = this.camera,inertiaComp = 1 - camera.inertia;if (camera.lowerRadiusLimit) {const lowerLimit = null !== (_a = camera.lowerRadiusLimit) && void 0 !== _a ? _a : 0;camera.radius - (camera.inertialRadiusOffset + delta) / inertiaComp < lowerLimit && (delta = (camera.radius - lowerLimit) * inertiaComp - camera.inertialRadiusOffset);}if (camera.upperRadiusLimit) {const upperLimit = null !== (_b = camera.upperRadiusLimit) && void 0 !== _b ? _b : 0;camera.radius - (camera.inertialRadiusOffset + delta) / inertiaComp > upperLimit && (delta = (camera.radius - upperLimit) * inertiaComp - camera.inertialRadiusOffset);}const zoomDistance = delta / inertiaComp,ratio = zoomDistance / camera.radius,vec = this._getPosition(),directionToZoomLocation = math_vector/* TmpVectors.Vector3.6 */.jp.Vector3[6];vec.subtractToRef(camera.target, directionToZoomLocation), directionToZoomLocation.scaleInPlace(ratio), directionToZoomLocation.scaleInPlace(inertiaComp), this._inertialPanning.addInPlace(directionToZoomLocation), camera.inertialRadiusOffset += delta;}_zeroIfClose(vec) {Math.abs(vec.x) < math_constants/* Epsilon */.kn && (vec.x = 0), Math.abs(vec.y) < math_constants/* Epsilon */.kn && (vec.y = 0), Math.abs(vec.z) < math_constants/* Epsilon */.kn && (vec.z = 0);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraMouseWheelInput.prototype, "wheelPrecision", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraMouseWheelInput.prototype, "zoomToMouseLocation", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraMouseWheelInput.prototype, "wheelDeltaPercentage", void 0), cameraInputsManager/* CameraInputTypes.ArcRotateCameraMouseWheelInput */.u.ArcRotateCameraMouseWheelInput = ArcRotateCameraMouseWheelInput;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraPointersInput.js
class ArcRotateCameraPointersInput extends BaseCameraPointersInput {constructor() {super(...arguments), this.buttons = [0, 1, 2], this.angularSensibilityX = 1e3, this.angularSensibilityY = 1e3, this.pinchPrecision = 12, this.pinchDeltaPercentage = 0, this.useNaturalPinchZoom = !1, this.pinchZoom = !0, this.panningSensibility = 1e3, this.multiTouchPanning = !0, this.multiTouchPanAndZoom = !0, this.pinchInwards = !0, this._isPanClick = !1, this._twoFingerActivityCount = 0, this._isPinching = !1;}getClassName() {return "ArcRotateCameraPointersInput";}_computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition) {if (0 !== this.panningSensibility && previousMultiTouchPanPosition && multiTouchPanPosition) {const moveDeltaX = multiTouchPanPosition.x - previousMultiTouchPanPosition.x,moveDeltaY = multiTouchPanPosition.y - previousMultiTouchPanPosition.y;this.camera.inertialPanningX += -moveDeltaX / this.panningSensibility, this.camera.inertialPanningY += moveDeltaY / this.panningSensibility;}}_computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance) {const radius = this.camera.radius || ArcRotateCameraPointersInput.MinimumRadiusForPinch;this.useNaturalPinchZoom ? this.camera.radius = radius * Math.sqrt(previousPinchSquaredDistance) / Math.sqrt(pinchSquaredDistance) : this.pinchDeltaPercentage ? this.camera.inertialRadiusOffset += .001 * (pinchSquaredDistance - previousPinchSquaredDistance) * radius * this.pinchDeltaPercentage : this.camera.inertialRadiusOffset += (pinchSquaredDistance - previousPinchSquaredDistance) / (this.pinchPrecision * (this.pinchInwards ? 1 : -1) * (this.angularSensibilityX + this.angularSensibilityY) / 2);}onTouch(point, offsetX, offsetY) {0 !== this.panningSensibility && (this._ctrlKey && this.camera._useCtrlForPanning || this._isPanClick) ? (this.camera.inertialPanningX += -offsetX / this.panningSensibility, this.camera.inertialPanningY += offsetY / this.panningSensibility) : (this.camera.inertialAlphaOffset -= offsetX / this.angularSensibilityX, this.camera.inertialBetaOffset -= offsetY / this.angularSensibilityY);}onDoubleTap() {this.camera.useInputToRestoreState && this.camera.restoreState();}onMultiTouch(pointA, pointB, previousPinchSquaredDistance, pinchSquaredDistance, previousMultiTouchPanPosition, multiTouchPanPosition) {0 === previousPinchSquaredDistance && null === previousMultiTouchPanPosition || 0 === pinchSquaredDistance && null === multiTouchPanPosition || (this.multiTouchPanAndZoom ? (this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance), this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition)) : this.multiTouchPanning && this.pinchZoom ? (this._twoFingerActivityCount++, this._isPinching || 20 > this._twoFingerActivityCount && Math.abs(Math.sqrt(pinchSquaredDistance) - Math.sqrt(previousPinchSquaredDistance)) > this.camera.pinchToPanMaxDistance ? (this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance), this._isPinching = !0) : this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition)) : this.multiTouchPanning ? this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition) : this.pinchZoom && this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance));}onButtonDown(evt) {this._isPanClick = evt.button === this.camera._panningMouseButton;}onButtonUp() {this._twoFingerActivityCount = 0, this._isPinching = !1;}onLostFocus() {this._isPanClick = !1, this._twoFingerActivityCount = 0, this._isPinching = !1;}}ArcRotateCameraPointersInput.MinimumRadiusForPinch = .001, (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "buttons", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "angularSensibilityX", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "angularSensibilityY", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "pinchPrecision", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "pinchDeltaPercentage", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "useNaturalPinchZoom", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "pinchZoom", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "panningSensibility", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "multiTouchPanning", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCameraPointersInput.prototype, "multiTouchPanAndZoom", void 0), cameraInputsManager/* CameraInputTypes.ArcRotateCameraPointersInput */.u.ArcRotateCameraPointersInput = ArcRotateCameraPointersInput;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/arcRotateCameraInputsManager.js
class ArcRotateCameraInputsManager extends cameraInputsManager/* CameraInputsManager */.p {constructor(camera) {super(camera);}addMouseWheel() {return this.add(new ArcRotateCameraMouseWheelInput()), this;}addPointers() {return this.add(new ArcRotateCameraPointersInput()), this;}addKeyboard() {return this.add(new ArcRotateCameraKeyboardMoveInput()), this;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js
ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation = function () {return this.add(new ArcRotateCameraVRDeviceOrientationInput()), this;};class ArcRotateCameraVRDeviceOrientationInput {constructor() {this.alphaCorrection = 1, this.gammaCorrection = 1, this._alpha = 0, this._gamma = 0, this._dirty = !1, this._deviceOrientationHandler = this._onOrientationEvent.bind(this);}attachControl(noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments), this.camera.attachControl(noPreventDefault);const hostWindow = this.camera.getScene().getEngine().getHostWindow();hostWindow && ("undefined" != typeof DeviceOrientationEvent && "function" == typeof DeviceOrientationEvent.requestPermission ? DeviceOrientationEvent.requestPermission().then((response) => {"granted" === response ? hostWindow.addEventListener("deviceorientation", this._deviceOrientationHandler) : tools/* Tools.Warn */.w1.Warn("Permission not granted.");}).catch((error) => {tools/* Tools.Error */.w1.Error(error);}) : hostWindow.addEventListener("deviceorientation", this._deviceOrientationHandler));}_onOrientationEvent(evt) {null !== evt.alpha && (this._alpha = (0 | +evt.alpha) * this.alphaCorrection), null !== evt.gamma && (this._gamma = (0 | +evt.gamma) * this.gammaCorrection), this._dirty = !0;}checkInputs() {this._dirty && (this._dirty = !1, 0 > this._gamma && (this._gamma = 180 + this._gamma), this.camera.alpha = 2 * (-this._alpha / 180 * Math.PI % Math.PI), this.camera.beta = this._gamma / 180 * Math.PI);}detachControl() {window.removeEventListener("deviceorientation", this._deviceOrientationHandler);}getClassName() {return "ArcRotateCameraVRDeviceOrientationInput";}getSimpleName() {return "VRDeviceOrientation";}}cameraInputsManager/* CameraInputTypes.ArcRotateCameraVRDeviceOrientationInput */.u.ArcRotateCameraVRDeviceOrientationInput = ArcRotateCameraVRDeviceOrientationInput;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/flyCameraKeyboardInput.js
class FlyCameraKeyboardInput {constructor() {this.keysForward = [87], this.keysBackward = [83], this.keysUp = [69], this.keysDown = [81], this.keysRight = [68], this.keysLeft = [65], this._keys = [];}attachControl(noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments);this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {this._keys.length = 0;}), this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {const evt = info.event;if (info.type === keyboardEvents/* KeyboardEventTypes.KEYDOWN */.OG.KEYDOWN) {if (-1 !== this.keysForward.indexOf(evt.keyCode) || -1 !== this.keysBackward.indexOf(evt.keyCode) || -1 !== this.keysUp.indexOf(evt.keyCode) || -1 !== this.keysDown.indexOf(evt.keyCode) || -1 !== this.keysLeft.indexOf(evt.keyCode) || -1 !== this.keysRight.indexOf(evt.keyCode)) {const index = this._keys.indexOf(evt.keyCode);-1 === index && this._keys.push(evt.keyCode), noPreventDefault || evt.preventDefault();}} else if (-1 !== this.keysForward.indexOf(evt.keyCode) || -1 !== this.keysBackward.indexOf(evt.keyCode) || -1 !== this.keysUp.indexOf(evt.keyCode) || -1 !== this.keysDown.indexOf(evt.keyCode) || -1 !== this.keysLeft.indexOf(evt.keyCode) || -1 !== this.keysRight.indexOf(evt.keyCode)) {const index = this._keys.indexOf(evt.keyCode);0 <= index && this._keys.splice(index, 1), noPreventDefault || evt.preventDefault();}}));}detachControl() {this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys.length = 0;}getClassName() {return "FlyCameraKeyboardInput";}_onLostFocus() {this._keys.length = 0;}getSimpleName() {return "keyboard";}checkInputs() {if (this._onKeyboardObserver) {const camera = this.camera;for (let index = 0; index < this._keys.length; index++) {const keyCode = this._keys[index],speed = camera._computeLocalCameraSpeed();-1 === this.keysForward.indexOf(keyCode) ? -1 === this.keysBackward.indexOf(keyCode) ? -1 === this.keysUp.indexOf(keyCode) ? -1 === this.keysDown.indexOf(keyCode) ? -1 === this.keysRight.indexOf(keyCode) ? -1 !== this.keysLeft.indexOf(keyCode) && camera._localDirection.copyFromFloats(-speed, 0, 0) : camera._localDirection.copyFromFloats(speed, 0, 0) : camera._localDirection.copyFromFloats(0, -speed, 0) : camera._localDirection.copyFromFloats(0, speed, 0) : camera._localDirection.copyFromFloats(0, 0, -speed) : camera._localDirection.copyFromFloats(0, 0, speed), camera.getScene().useRightHandedSystem && (camera._localDirection.z *= -1), camera.getViewMatrix().invertToRef(camera._cameraTransformMatrix), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(camera._localDirection, camera._cameraTransformMatrix, camera._transformedDirection), camera.cameraDirection.addInPlace(camera._transformedDirection);}}}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCameraKeyboardInput.prototype, "keysForward", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCameraKeyboardInput.prototype, "keysBackward", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCameraKeyboardInput.prototype, "keysUp", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCameraKeyboardInput.prototype, "keysDown", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCameraKeyboardInput.prototype, "keysRight", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCameraKeyboardInput.prototype, "keysLeft", void 0), cameraInputsManager/* CameraInputTypes.FlyCameraKeyboardInput */.u.FlyCameraKeyboardInput = FlyCameraKeyboardInput;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/flyCameraMouseInput.js
class FlyCameraMouseInput {constructor() {this.buttons = [0, 1, 2], this.buttonsYaw = [-1, 0, 1], this.buttonsPitch = [-1, 0, 1], this.buttonsRoll = [2], this.activeButton = -1, this.angularSensibility = 1e3, this._previousPosition = null;}attachControl(noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments), this._noPreventDefault = noPreventDefault, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver((p) => {this._pointerInput(p);}, pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN | pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP | pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE), this._rollObserver = this.camera.getScene().onBeforeRenderObservable.add(() => {this.camera.rollCorrect && this.camera.restoreRoll(this.camera.rollCorrect);});}detachControl() {this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver), this._observer = null, this._rollObserver = null, this._previousPosition = null, this._noPreventDefault = void 0);}getClassName() {return "FlyCameraMouseInput";}getSimpleName() {return "mouse";}_pointerInput(p) {const e = p.event,camera = this.camera,engine = camera.getEngine();if (!engine.isInVRExclusivePointerMode && (this.touchEnabled || "touch" !== e.pointerType) && (p.type === pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE || -1 !== this.buttons.indexOf(e.button))) {const srcElement = e.target;if (p.type === pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN) {try {null === srcElement || void 0 === srcElement ? void 0 : srcElement.setPointerCapture(e.pointerId);} catch (e) {}this._previousPosition = { x: e.clientX, y: e.clientY }, this.activeButton = e.button, this._noPreventDefault || (e.preventDefault(), this._element.focus()), engine.isPointerLock && this._onMouseMove(p.event);} else if (p.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP) {try {null === srcElement || void 0 === srcElement ? void 0 : srcElement.releasePointerCapture(e.pointerId);} catch (e) {}this.activeButton = -1, this._previousPosition = null, this._noPreventDefault || e.preventDefault();} else if (p.type === pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE) {if (!this._previousPosition) return void (engine.isPointerLock && this._onMouseMove(p.event));const offsetX = e.clientX - this._previousPosition.x,offsetY = e.clientY - this._previousPosition.y;this._rotateCamera(offsetX, offsetY), this._previousPosition = { x: e.clientX, y: e.clientY }, this._noPreventDefault || e.preventDefault();}}}_onMouseMove(e) {const camera = this.camera,engine = camera.getEngine();if (!engine.isPointerLock || engine.isInVRExclusivePointerMode) return;const offsetX = e.movementX,offsetY = e.movementY;this._rotateCamera(offsetX, offsetY), this._previousPosition = null, this._noPreventDefault || e.preventDefault();}_rotateCamera(offsetX, offsetY) {const camera = this.camera,scene = this.camera.getScene();scene.useRightHandedSystem && (offsetX *= -1), camera.parent && 0 > camera.parent._getWorldMatrixDeterminant() && (offsetX *= -1);const x = offsetX / this.angularSensibility,y = offsetY / this.angularSensibility,currentRotation = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(camera.rotation.y, camera.rotation.x, camera.rotation.z);let rotationChange;if (this.buttonsPitch.some((v) => v === this.activeButton) && (rotationChange = math_vector/* Quaternion.RotationAxis */._f.RotationAxis(math_axis/* Axis.X */.RD.X, y), currentRotation.multiplyInPlace(rotationChange)), this.buttonsYaw.some((v) => v === this.activeButton)) {rotationChange = math_vector/* Quaternion.RotationAxis */._f.RotationAxis(math_axis/* Axis.Y */.RD.Y, x), currentRotation.multiplyInPlace(rotationChange);const limit = camera.bankedTurnLimit + camera._trackRoll;if (camera.bankedTurn && -limit < camera.rotation.z && camera.rotation.z < limit) {const bankingDelta = camera.bankedTurnMultiplier * -x;rotationChange = math_vector/* Quaternion.RotationAxis */._f.RotationAxis(math_axis/* Axis.Z */.RD.Z, bankingDelta), currentRotation.multiplyInPlace(rotationChange);}}this.buttonsRoll.some((v) => v === this.activeButton) && (rotationChange = math_vector/* Quaternion.RotationAxis */._f.RotationAxis(math_axis/* Axis.Z */.RD.Z, -x), camera._trackRoll -= x, currentRotation.multiplyInPlace(rotationChange)), currentRotation.toEulerAnglesToRef(camera.rotation);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCameraMouseInput.prototype, "buttons", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCameraMouseInput.prototype, "angularSensibility", void 0), cameraInputsManager/* CameraInputTypes.FlyCameraMouseInput */.u.FlyCameraMouseInput = FlyCameraMouseInput;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/followCameraKeyboardMoveInput.js
class FollowCameraKeyboardMoveInput {constructor() {this.keysHeightOffsetIncr = [38], this.keysHeightOffsetDecr = [40], this.keysHeightOffsetModifierAlt = !1, this.keysHeightOffsetModifierCtrl = !1, this.keysHeightOffsetModifierShift = !1, this.keysRotationOffsetIncr = [37], this.keysRotationOffsetDecr = [39], this.keysRotationOffsetModifierAlt = !1, this.keysRotationOffsetModifierCtrl = !1, this.keysRotationOffsetModifierShift = !1, this.keysRadiusIncr = [40], this.keysRadiusDecr = [38], this.keysRadiusModifierAlt = !0, this.keysRadiusModifierCtrl = !1, this.keysRadiusModifierShift = !1, this.heightSensibility = 1, this.rotationSensibility = 1, this.radiusSensibility = 1, this._keys = [];}attachControl(noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments);this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {this._keys.length = 0;}), this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {const evt = info.event;if (!evt.metaKey) if (info.type === keyboardEvents/* KeyboardEventTypes.KEYDOWN */.OG.KEYDOWN) {if (this._ctrlPressed = evt.ctrlKey, this._altPressed = evt.altKey, this._shiftPressed = evt.shiftKey, -1 !== this.keysHeightOffsetIncr.indexOf(evt.keyCode) || -1 !== this.keysHeightOffsetDecr.indexOf(evt.keyCode) || -1 !== this.keysRotationOffsetIncr.indexOf(evt.keyCode) || -1 !== this.keysRotationOffsetDecr.indexOf(evt.keyCode) || -1 !== this.keysRadiusIncr.indexOf(evt.keyCode) || -1 !== this.keysRadiusDecr.indexOf(evt.keyCode)) {const index = this._keys.indexOf(evt.keyCode);-1 === index && this._keys.push(evt.keyCode), evt.preventDefault && !noPreventDefault && evt.preventDefault();}} else if (-1 !== this.keysHeightOffsetIncr.indexOf(evt.keyCode) || -1 !== this.keysHeightOffsetDecr.indexOf(evt.keyCode) || -1 !== this.keysRotationOffsetIncr.indexOf(evt.keyCode) || -1 !== this.keysRotationOffsetDecr.indexOf(evt.keyCode) || -1 !== this.keysRadiusIncr.indexOf(evt.keyCode) || -1 !== this.keysRadiusDecr.indexOf(evt.keyCode)) {const index = this._keys.indexOf(evt.keyCode);0 <= index && this._keys.splice(index, 1), evt.preventDefault && !noPreventDefault && evt.preventDefault();}}));}detachControl() {this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys.length = 0;}checkInputs() {this._onKeyboardObserver && this._keys.forEach((keyCode) => {-1 !== this.keysHeightOffsetIncr.indexOf(keyCode) && this._modifierHeightOffset() ? this.camera.heightOffset += this.heightSensibility : -1 !== this.keysHeightOffsetDecr.indexOf(keyCode) && this._modifierHeightOffset() ? this.camera.heightOffset -= this.heightSensibility : -1 !== this.keysRotationOffsetIncr.indexOf(keyCode) && this._modifierRotationOffset() ? (this.camera.rotationOffset += this.rotationSensibility, this.camera.rotationOffset %= 360) : -1 !== this.keysRotationOffsetDecr.indexOf(keyCode) && this._modifierRotationOffset() ? (this.camera.rotationOffset -= this.rotationSensibility, this.camera.rotationOffset %= 360) : -1 !== this.keysRadiusIncr.indexOf(keyCode) && this._modifierRadius() ? this.camera.radius += this.radiusSensibility : -1 !== this.keysRadiusDecr.indexOf(keyCode) && this._modifierRadius() && (this.camera.radius -= this.radiusSensibility);});}getClassName() {return "FollowCameraKeyboardMoveInput";}getSimpleName() {return "keyboard";}_modifierHeightOffset() {return this.keysHeightOffsetModifierAlt === this._altPressed && this.keysHeightOffsetModifierCtrl === this._ctrlPressed && this.keysHeightOffsetModifierShift === this._shiftPressed;}_modifierRotationOffset() {return this.keysRotationOffsetModifierAlt === this._altPressed && this.keysRotationOffsetModifierCtrl === this._ctrlPressed && this.keysRotationOffsetModifierShift === this._shiftPressed;}_modifierRadius() {return this.keysRadiusModifierAlt === this._altPressed && this.keysRadiusModifierCtrl === this._ctrlPressed && this.keysRadiusModifierShift === this._shiftPressed;}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetIncr", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetDecr", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierAlt", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierCtrl", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierShift", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetIncr", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetDecr", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierAlt", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierCtrl", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierShift", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRadiusIncr", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRadiusDecr", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierAlt", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierCtrl", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierShift", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "heightSensibility", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "rotationSensibility", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraKeyboardMoveInput.prototype, "radiusSensibility", void 0), cameraInputsManager/* CameraInputTypes.FollowCameraKeyboardMoveInput */.u.FollowCameraKeyboardMoveInput = FollowCameraKeyboardMoveInput;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/followCameraMouseWheelInput.js
class FollowCameraMouseWheelInput {constructor() {this.axisControlRadius = !0, this.axisControlHeight = !1, this.axisControlRotation = !1, this.wheelPrecision = 3, this.wheelDeltaPercentage = 0;}attachControl(noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments), this._wheel = (p) => {if (p.type !== pointerEvents/* PointerEventTypes.POINTERWHEEL */.kD.POINTERWHEEL) return;const event = p.event;let delta = 0;const wheelDelta = Math.max(-1, Math.min(1, event.deltaY));this.wheelDeltaPercentage ? (console.assert(1 >= this.axisControlRadius + this.axisControlHeight + this.axisControlRotation, "wheelDeltaPercentage only usable when mouse wheel controls ONE axis. Currently enabled: axisControlRadius: " + this.axisControlRadius + ", axisControlHeightOffset: " + this.axisControlHeight + ", axisControlRotationOffset: " + this.axisControlRotation), this.axisControlRadius ? delta = .01 * wheelDelta * this.wheelDeltaPercentage * this.camera.radius : this.axisControlHeight ? delta = .01 * wheelDelta * this.wheelDeltaPercentage * this.camera.heightOffset : this.axisControlRotation && (delta = .01 * wheelDelta * this.wheelDeltaPercentage * this.camera.rotationOffset)) : delta = wheelDelta * this.wheelPrecision, delta && (this.axisControlRadius ? this.camera.radius += delta : this.axisControlHeight ? this.camera.heightOffset -= delta : this.axisControlRotation && (this.camera.rotationOffset -= delta)), event.preventDefault && !noPreventDefault && event.preventDefault();}, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel, pointerEvents/* PointerEventTypes.POINTERWHEEL */.kD.POINTERWHEEL);}detachControl() {this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null, this._wheel = null);}getClassName() {return "ArcRotateCameraMouseWheelInput";}getSimpleName() {return "mousewheel";}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraMouseWheelInput.prototype, "axisControlRadius", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraMouseWheelInput.prototype, "axisControlHeight", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraMouseWheelInput.prototype, "axisControlRotation", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraMouseWheelInput.prototype, "wheelPrecision", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraMouseWheelInput.prototype, "wheelDeltaPercentage", void 0), cameraInputsManager/* CameraInputTypes.FollowCameraMouseWheelInput */.u.FollowCameraMouseWheelInput = FollowCameraMouseWheelInput;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/followCameraPointersInput.js
class FollowCameraPointersInput extends BaseCameraPointersInput {constructor() {super(...arguments), this.angularSensibilityX = 1, this.angularSensibilityY = 1, this.pinchPrecision = 1e4, this.pinchDeltaPercentage = 0, this.axisXControlRadius = !1, this.axisXControlHeight = !1, this.axisXControlRotation = !0, this.axisYControlRadius = !1, this.axisYControlHeight = !0, this.axisYControlRotation = !1, this.axisPinchControlRadius = !0, this.axisPinchControlHeight = !1, this.axisPinchControlRotation = !1, this.warningEnable = !0, this._warningCounter = 0;}getClassName() {return "FollowCameraPointersInput";}onTouch(pointA, offsetX, offsetY) {this._warning(), this.axisXControlRotation ? this.camera.rotationOffset += offsetX / this.angularSensibilityX : this.axisYControlRotation && (this.camera.rotationOffset += offsetY / this.angularSensibilityX), this.axisXControlHeight ? this.camera.heightOffset += offsetX / this.angularSensibilityY : this.axisYControlHeight && (this.camera.heightOffset += offsetY / this.angularSensibilityY), this.axisXControlRadius ? this.camera.radius -= offsetX / this.angularSensibilityY : this.axisYControlRadius && (this.camera.radius -= offsetY / this.angularSensibilityY);}onMultiTouch(pointA, pointB, previousPinchSquaredDistance, pinchSquaredDistance, previousMultiTouchPanPosition, multiTouchPanPosition) {if (0 === previousPinchSquaredDistance && null === previousMultiTouchPanPosition) return;if (0 === pinchSquaredDistance && null === multiTouchPanPosition) return;let pinchDelta = (pinchSquaredDistance - previousPinchSquaredDistance) / (this.pinchPrecision * (this.angularSensibilityX + this.angularSensibilityY) / 2);this.pinchDeltaPercentage ? (pinchDelta *= .01 * this.pinchDeltaPercentage, this.axisPinchControlRotation && (this.camera.rotationOffset += pinchDelta * this.camera.rotationOffset), this.axisPinchControlHeight && (this.camera.heightOffset += pinchDelta * this.camera.heightOffset), this.axisPinchControlRadius && (this.camera.radius -= pinchDelta * this.camera.radius)) : (this.axisPinchControlRotation && (this.camera.rotationOffset += pinchDelta), this.axisPinchControlHeight && (this.camera.heightOffset += pinchDelta), this.axisPinchControlRadius && (this.camera.radius -= pinchDelta));}_warning() {if (this.warningEnable && 0 == this._warningCounter++ % 100) {console.assert(1 >= this.axisXControlRotation + this.axisXControlHeight + this.axisXControlRadius, "It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: axisXControlRotation: " + this.axisXControlRotation + ", axisXControlHeight: " + this.axisXControlHeight + ", axisXControlRadius: " + this.axisXControlRadius), console.assert(1 >= this.axisYControlRotation + this.axisYControlHeight + this.axisYControlRadius, "It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: axisYControlRotation: " + this.axisYControlRotation + ", axisYControlHeight: " + this.axisYControlHeight + ", axisYControlRadius: " + this.axisYControlRadius), console.assert(1 >= this.axisPinchControlRotation + this.axisPinchControlHeight + this.axisPinchControlRadius, "It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: axisPinchControlRotation: " + this.axisPinchControlRotation + ", axisPinchControlHeight: " + this.axisPinchControlHeight + ", axisPinchControlRadius: " + this.axisPinchControlRadius);}}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "angularSensibilityX", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "angularSensibilityY", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "pinchPrecision", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "pinchDeltaPercentage", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "axisXControlRadius", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "axisXControlHeight", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "axisXControlRotation", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "axisYControlRadius", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "axisYControlHeight", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "axisYControlRotation", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "axisPinchControlRadius", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "axisPinchControlHeight", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCameraPointersInput.prototype, "axisPinchControlRotation", void 0), cameraInputsManager/* CameraInputTypes.FollowCameraPointersInput */.u.FollowCameraPointersInput = FollowCameraPointersInput;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/freeCameraInputsManager.js
var freeCameraInputsManager = __webpack_require__("./node_modules/@babylonjs/core/Cameras/freeCameraInputsManager.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraDeviceOrientationInput.js
freeCameraInputsManager/* FreeCameraInputsManager.prototype.addDeviceOrientation */.a.prototype.addDeviceOrientation = function (smoothFactor) {return this._deviceOrientationInput || (this._deviceOrientationInput = new FreeCameraDeviceOrientationInput(), smoothFactor && (this._deviceOrientationInput.smoothFactor = smoothFactor), this.add(this._deviceOrientationInput)), this;};class FreeCameraDeviceOrientationInput {static WaitForOrientationChangeAsync(timeout) {return new Promise((res, rej) => {let gotValue = !1;const eventHandler = () => {window.removeEventListener("deviceorientation", eventHandler), gotValue = !0, res();};timeout && setTimeout(() => {gotValue || (window.removeEventListener("deviceorientation", eventHandler), rej("WaitForOrientationChangeAsync timed out"));}, timeout), "undefined" != typeof DeviceOrientationEvent && "function" == typeof DeviceOrientationEvent.requestPermission ? DeviceOrientationEvent.requestPermission().then((response) => {"granted" == response ? window.addEventListener("deviceorientation", eventHandler) : tools/* Tools.Warn */.w1.Warn("Permission not granted.");}).catch((error) => {tools/* Tools.Error */.w1.Error(error);}) : window.addEventListener("deviceorientation", eventHandler);});}constructor() {this._screenOrientationAngle = 0, this._screenQuaternion = new math_vector/* Quaternion */._f(), this._alpha = 0, this._beta = 0, this._gamma = 0, this.smoothFactor = 0, this._onDeviceOrientationChangedObservable = new observable/* Observable */.y$(), this._orientationChanged = () => {this._screenOrientationAngle = window.orientation === void 0 ? window.screen.orientation && window.screen.orientation.angle ? window.screen.orientation.angle : 0 : +window.orientation, this._screenOrientationAngle = -tools/* Tools.ToRadians */.w1.ToRadians(this._screenOrientationAngle / 2), this._screenQuaternion.copyFromFloats(0, Math.sin(this._screenOrientationAngle), 0, Math.cos(this._screenOrientationAngle));}, this._deviceOrientation = (evt) => {this.smoothFactor ? (this._alpha = null === evt.alpha ? 0 : tools/* Tools.SmoothAngleChange */.w1.SmoothAngleChange(this._alpha, evt.alpha, this.smoothFactor), this._beta = null === evt.beta ? 0 : tools/* Tools.SmoothAngleChange */.w1.SmoothAngleChange(this._beta, evt.beta, this.smoothFactor), this._gamma = null === evt.gamma ? 0 : tools/* Tools.SmoothAngleChange */.w1.SmoothAngleChange(this._gamma, evt.gamma, this.smoothFactor)) : (this._alpha = null === evt.alpha ? 0 : evt.alpha, this._beta = null === evt.beta ? 0 : evt.beta, this._gamma = null === evt.gamma ? 0 : evt.gamma), null !== evt.alpha && this._onDeviceOrientationChangedObservable.notifyObservers();}, this._constantTranform = new math_vector/* Quaternion */._f(-Math.sqrt(.5), 0, 0, Math.sqrt(.5)), this._orientationChanged();}get camera() {return this._camera;}set camera(camera) {this._camera = camera, null == this._camera || this._camera.rotationQuaternion || (this._camera.rotationQuaternion = new math_vector/* Quaternion */._f()), this._camera && this._camera.onDisposeObservable.add(() => {this._onDeviceOrientationChangedObservable.clear();});}attachControl() {const hostWindow = this.camera.getScene().getEngine().getHostWindow();if (hostWindow) {const eventHandler = () => {hostWindow.addEventListener("orientationchange", this._orientationChanged), hostWindow.addEventListener("deviceorientation", this._deviceOrientation), this._orientationChanged();};"undefined" != typeof DeviceOrientationEvent && "function" == typeof DeviceOrientationEvent.requestPermission ? DeviceOrientationEvent.requestPermission().then((response) => {"granted" === response ? eventHandler() : tools/* Tools.Warn */.w1.Warn("Permission not granted.");}).catch((error) => {tools/* Tools.Error */.w1.Error(error);}) : eventHandler();}}detachControl() {window.removeEventListener("orientationchange", this._orientationChanged), window.removeEventListener("deviceorientation", this._deviceOrientation), this._alpha = 0;}checkInputs() {this._alpha && (math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(tools/* Tools.ToRadians */.w1.ToRadians(this._alpha), tools/* Tools.ToRadians */.w1.ToRadians(this._beta), -tools/* Tools.ToRadians */.w1.ToRadians(this._gamma), this.camera.rotationQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._constantTranform), this._camera.rotationQuaternion.z *= -1, this._camera.rotationQuaternion.w *= -1);}getClassName() {return "FreeCameraDeviceOrientationInput";}getSimpleName() {return "deviceOrientation";}}cameraInputsManager/* CameraInputTypes.FreeCameraDeviceOrientationInput */.u.FreeCameraDeviceOrientationInput = FreeCameraDeviceOrientationInput;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraGamepadInput.js
class FreeCameraGamepadInput {constructor() {this.gamepadAngularSensibility = 200, this.gamepadMoveSensibility = 40, this.deadzoneDelta = .1, this._yAxisScale = 1, this._cameraTransform = math_vector/* Matrix.Identity */.y3.Identity(), this._deltaTransform = math_vector/* Vector3.Zero */.P.Zero(), this._vector3 = math_vector/* Vector3.Zero */.P.Zero(), this._vector2 = math_vector/* Vector2.Zero */.FM.Zero();}get invertYAxis() {return 1 !== this._yAxisScale;}set invertYAxis(value) {this._yAxisScale = value ? -1 : 1;}attachControl() {const manager = this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver = manager.onGamepadConnectedObservable.add((gamepad) => {gamepad.type === Gamepad.POSE_ENABLED || this.gamepad && gamepad.type !== Gamepad.XBOX || (this.gamepad = gamepad);}), this._onGamepadDisconnectedObserver = manager.onGamepadDisconnectedObservable.add((gamepad) => {this.gamepad === gamepad && (this.gamepad = null);}), this.gamepad = manager.getGamepadByType(Gamepad.XBOX), !this.gamepad && manager.gamepads.length && (this.gamepad = manager.gamepads[0]);}detachControl() {this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null;}checkInputs() {if (this.gamepad && this.gamepad.leftStick) {const camera = this.camera,lsValues = this.gamepad.leftStick;0 !== this.gamepadMoveSensibility && (lsValues.x = Math.abs(lsValues.x) > this.deadzoneDelta ? lsValues.x / this.gamepadMoveSensibility : 0, lsValues.y = Math.abs(lsValues.y) > this.deadzoneDelta ? lsValues.y / this.gamepadMoveSensibility : 0);let rsValues = this.gamepad.rightStick;rsValues && 0 !== this.gamepadAngularSensibility ? (rsValues.x = Math.abs(rsValues.x) > this.deadzoneDelta ? rsValues.x / this.gamepadAngularSensibility : 0, rsValues.y = (Math.abs(rsValues.y) > this.deadzoneDelta ? rsValues.y / this.gamepadAngularSensibility : 0) * this._yAxisScale) : rsValues = { x: 0, y: 0 }, camera.rotationQuaternion ? camera.rotationQuaternion.toRotationMatrix(this._cameraTransform) : math_vector/* Matrix.RotationYawPitchRollToRef */.y3.RotationYawPitchRollToRef(camera.rotation.y, camera.rotation.x, 0, this._cameraTransform);const speed = 50 * camera._computeLocalCameraSpeed();this._vector3.copyFromFloats(lsValues.x * speed, 0, -lsValues.y * speed), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._vector3, this._cameraTransform, this._deltaTransform), camera.cameraDirection.addInPlace(this._deltaTransform), this._vector2.copyFromFloats(rsValues.y, rsValues.x), camera.cameraRotation.addInPlace(this._vector2);}}getClassName() {return "FreeCameraGamepadInput";}getSimpleName() {return "gamepad";}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FreeCameraGamepadInput.prototype, "gamepadAngularSensibility", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FreeCameraGamepadInput.prototype, "gamepadMoveSensibility", void 0), cameraInputsManager/* CameraInputTypes.FreeCameraGamepadInput */.u.FreeCameraGamepadInput = FreeCameraGamepadInput;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraKeyboardMoveInput.js
var freeCameraKeyboardMoveInput = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraKeyboardMoveInput.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseInput.js
var freeCameraMouseInput = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseInput.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseWheelInput.js
var freeCameraMouseWheelInput = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseWheelInput.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraTouchInput.js
var freeCameraTouchInput = __webpack_require__("./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraTouchInput.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/stringDictionary.js
var stringDictionary = __webpack_require__("./node_modules/@babylonjs/core/Misc/stringDictionary.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/virtualJoystick.js
var JoystickAxis;(function (JoystickAxis) {JoystickAxis[JoystickAxis.X = 0] = "X", JoystickAxis[JoystickAxis.Y = 1] = "Y", JoystickAxis[JoystickAxis.Z = 2] = "Z";})(JoystickAxis || (JoystickAxis = {}));class VirtualJoystick {static _GetDefaultOptions() {return { puckSize: 40, containerSize: 60, color: "cyan", puckImage: void 0, containerImage: void 0, position: void 0, alwaysVisible: !1, limitToContainer: !1 };}constructor(leftJoystick, customizations) {this._released = !1;const options = { ...VirtualJoystick._GetDefaultOptions(), ...customizations };if (this._leftJoystick = !!leftJoystick, VirtualJoystick._GlobalJoystickIndex++, this._axisTargetedByLeftAndRight = JoystickAxis.X, this._axisTargetedByUpAndDown = JoystickAxis.Y, this.reverseLeftRight = !1, this.reverseUpDown = !1, this._touches = new stringDictionary/* StringDictionary */.x(), this.deltaPosition = math_vector/* Vector3.Zero */.P.Zero(), this._joystickSensibility = 25, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3), this._onResize = () => {VirtualJoystick._VJCanvasWidth = window.innerWidth, VirtualJoystick._VJCanvasHeight = window.innerHeight, VirtualJoystick.Canvas && (VirtualJoystick.Canvas.width = VirtualJoystick._VJCanvasWidth, VirtualJoystick.Canvas.height = VirtualJoystick._VJCanvasHeight), VirtualJoystick._HalfWidth = VirtualJoystick._VJCanvasWidth / 2;}, !VirtualJoystick.Canvas) {window.addEventListener("resize", this._onResize, !1), VirtualJoystick.Canvas = document.createElement("canvas"), VirtualJoystick._VJCanvasWidth = window.innerWidth, VirtualJoystick._VJCanvasHeight = window.innerHeight, VirtualJoystick.Canvas.width = window.innerWidth, VirtualJoystick.Canvas.height = window.innerHeight, VirtualJoystick.Canvas.style.width = "100%", VirtualJoystick.Canvas.style.height = "100%", VirtualJoystick.Canvas.style.position = "absolute", VirtualJoystick.Canvas.style.backgroundColor = "transparent", VirtualJoystick.Canvas.style.top = "0px", VirtualJoystick.Canvas.style.left = "0px", VirtualJoystick.Canvas.style.zIndex = "5", VirtualJoystick.Canvas.style.touchAction = "none", VirtualJoystick.Canvas.setAttribute("touch-action", "none");const context = VirtualJoystick.Canvas.getContext("2d");if (!context) throw new Error("Unable to create canvas for virtual joystick");VirtualJoystick._VJCanvasContext = context, VirtualJoystick._VJCanvasContext.strokeStyle = "#ffffff", VirtualJoystick._VJCanvasContext.lineWidth = 2, document.body.appendChild(VirtualJoystick.Canvas);}VirtualJoystick._HalfWidth = VirtualJoystick.Canvas.width / 2, this.pressed = !1, this.limitToContainer = options.limitToContainer, this._joystickColor = options.color, this.containerSize = options.containerSize, this.puckSize = options.puckSize, options.position && this.setPosition(options.position.x, options.position.y), options.puckImage && this.setPuckImage(options.puckImage), options.containerImage && this.setContainerImage(options.containerImage), options.alwaysVisible && VirtualJoystick._AlwaysVisibleSticks++, this.alwaysVisible = options.alwaysVisible, this._joystickPointerId = -1, this._joystickPointerPos = new math_vector/* Vector2 */.FM(0, 0), this._joystickPreviousPointerPos = new math_vector/* Vector2 */.FM(0, 0), this._joystickPointerStartPos = new math_vector/* Vector2 */.FM(0, 0), this._deltaJoystickVector = new math_vector/* Vector2 */.FM(0, 0), this._onPointerDownHandlerRef = (evt) => {this._onPointerDown(evt);}, this._onPointerMoveHandlerRef = (evt) => {this._onPointerMove(evt);}, this._onPointerUpHandlerRef = (evt) => {this._onPointerUp(evt);}, VirtualJoystick.Canvas.addEventListener("pointerdown", this._onPointerDownHandlerRef, !1), VirtualJoystick.Canvas.addEventListener("pointermove", this._onPointerMoveHandlerRef, !1), VirtualJoystick.Canvas.addEventListener("pointerup", this._onPointerUpHandlerRef, !1), VirtualJoystick.Canvas.addEventListener("pointerout", this._onPointerUpHandlerRef, !1), VirtualJoystick.Canvas.addEventListener("contextmenu", (evt) => {evt.preventDefault();}, !1), requestAnimationFrame(() => {this._drawVirtualJoystick();});}setJoystickSensibility(newJoystickSensibility) {this._joystickSensibility = newJoystickSensibility, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3);}_onPointerDown(e) {let positionOnScreenCondition;e.preventDefault(), positionOnScreenCondition = !0 === this._leftJoystick ? e.clientX < VirtualJoystick._HalfWidth : e.clientX > VirtualJoystick._HalfWidth, positionOnScreenCondition && 0 > this._joystickPointerId ? (this._joystickPointerId = e.pointerId, this._joystickPosition ? (this._joystickPointerStartPos = this._joystickPosition.clone(), this._joystickPointerPos = this._joystickPosition.clone(), this._joystickPreviousPointerPos = this._joystickPosition.clone(), this._onPointerMove(e)) : (this._joystickPointerStartPos.x = e.clientX, this._joystickPointerStartPos.y = e.clientY, this._joystickPointerPos = this._joystickPointerStartPos.clone(), this._joystickPreviousPointerPos = this._joystickPointerStartPos.clone()), this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this.pressed = !0, this._touches.add(e.pointerId.toString(), e)) : 2 > VirtualJoystick._GlobalJoystickIndex && this._action && (this._action(), this._touches.add(e.pointerId.toString(), { x: e.clientX, y: e.clientY, prevX: e.clientX, prevY: e.clientY }));}_onPointerMove(e) {if (this._joystickPointerId == e.pointerId) {if (this.limitToContainer) {const vector = new math_vector/* Vector2 */.FM(e.clientX - this._joystickPointerStartPos.x, e.clientY - this._joystickPointerStartPos.y),distance = vector.length();distance > this.containerSize && vector.scaleInPlace(this.containerSize / distance), this._joystickPointerPos.x = this._joystickPointerStartPos.x + vector.x, this._joystickPointerPos.y = this._joystickPointerStartPos.y + vector.y;} else this._joystickPointerPos.x = e.clientX, this._joystickPointerPos.y = e.clientY;this._deltaJoystickVector = this._joystickPointerPos.clone(), this._deltaJoystickVector = this._deltaJoystickVector.subtract(this._joystickPointerStartPos), 0 < VirtualJoystick._AlwaysVisibleSticks && (this._leftJoystick ? this._joystickPointerPos.x = Math.min(VirtualJoystick._HalfWidth, this._joystickPointerPos.x) : this._joystickPointerPos.x = Math.max(VirtualJoystick._HalfWidth, this._joystickPointerPos.x));const directionLeftRight = this.reverseLeftRight ? -1 : 1,deltaJoystickX = directionLeftRight * this._deltaJoystickVector.x / this._inversedSensibility;switch (this._axisTargetedByLeftAndRight) {case JoystickAxis.X:this.deltaPosition.x = Math.min(1, Math.max(-1, deltaJoystickX));break;case JoystickAxis.Y:this.deltaPosition.y = Math.min(1, Math.max(-1, deltaJoystickX));break;case JoystickAxis.Z:this.deltaPosition.z = Math.min(1, Math.max(-1, deltaJoystickX));}const directionUpDown = this.reverseUpDown ? 1 : -1,deltaJoystickY = directionUpDown * this._deltaJoystickVector.y / this._inversedSensibility;switch (this._axisTargetedByUpAndDown) {case JoystickAxis.X:this.deltaPosition.x = Math.min(1, Math.max(-1, deltaJoystickY));break;case JoystickAxis.Y:this.deltaPosition.y = Math.min(1, Math.max(-1, deltaJoystickY));break;case JoystickAxis.Z:this.deltaPosition.z = Math.min(1, Math.max(-1, deltaJoystickY));}} else {const data = this._touches.get(e.pointerId.toString());data && (data.x = e.clientX, data.y = e.clientY);}}_onPointerUp(e) {if (this._joystickPointerId == e.pointerId) this._clearPreviousDraw(), this._joystickPointerId = -1, this.pressed = !1;else {const touch = this._touches.get(e.pointerId.toString());touch && VirtualJoystick._VJCanvasContext.clearRect(touch.prevX - 44, touch.prevY - 44, 88, 88);}this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this._touches.remove(e.pointerId.toString());}setJoystickColor(newColor) {this._joystickColor = newColor;}set containerSize(newSize) {this._joystickContainerSize = newSize, this._clearContainerSize = ~~(2.1 * this._joystickContainerSize), this._clearContainerSizeOffset = ~~(this._clearContainerSize / 2);}get containerSize() {return this._joystickContainerSize;}set puckSize(newSize) {this._joystickPuckSize = newSize, this._clearPuckSize = ~~(2.1 * this._joystickPuckSize), this._clearPuckSizeOffset = ~~(this._clearPuckSize / 2);}get puckSize() {return this._joystickPuckSize;}clearPosition() {this.alwaysVisible = !1, this._joystickPosition = null;}set alwaysVisible(value) {this._alwaysVisible === value || (value && this._joystickPosition ? (VirtualJoystick._AlwaysVisibleSticks++, this._alwaysVisible = !0) : (VirtualJoystick._AlwaysVisibleSticks--, this._alwaysVisible = !1));}get alwaysVisible() {return this._alwaysVisible;}setPosition(x, y) {this._joystickPointerStartPos && this._clearPreviousDraw(), this._joystickPosition = new math_vector/* Vector2 */.FM(x, y);}setActionOnTouch(action) {this._action = action;}setAxisForLeftRight(axis) {switch (axis) {case JoystickAxis.X:case JoystickAxis.Y:case JoystickAxis.Z:this._axisTargetedByLeftAndRight = axis;break;default:this._axisTargetedByLeftAndRight = JoystickAxis.X;}}setAxisForUpDown(axis) {switch (axis) {case JoystickAxis.X:case JoystickAxis.Y:case JoystickAxis.Z:this._axisTargetedByUpAndDown = axis;break;default:this._axisTargetedByUpAndDown = JoystickAxis.Y;}}_clearPreviousDraw() {const jp = this._joystickPosition || this._joystickPointerStartPos;VirtualJoystick._VJCanvasContext.clearRect(jp.x - this._clearContainerSizeOffset, jp.y - this._clearContainerSizeOffset, this._clearContainerSize, this._clearContainerSize), VirtualJoystick._VJCanvasContext.clearRect(this._joystickPreviousPointerPos.x - this._clearPuckSizeOffset, this._joystickPreviousPointerPos.y - this._clearPuckSizeOffset, this._clearPuckSize, this._clearPuckSize);}setContainerImage(urlPath) {const image = new Image();image.src = urlPath, image.onload = () => this._containerImage = image;}setPuckImage(urlPath) {const image = new Image();image.src = urlPath, image.onload = () => this._puckImage = image;}_drawContainer() {const jp = this._joystickPosition || this._joystickPointerStartPos;this._clearPreviousDraw(), this._containerImage ? VirtualJoystick._VJCanvasContext.drawImage(this._containerImage, jp.x - this.containerSize, jp.y - this.containerSize, 2 * this.containerSize, 2 * this.containerSize) : (VirtualJoystick._VJCanvasContext.beginPath(), VirtualJoystick._VJCanvasContext.strokeStyle = this._joystickColor, VirtualJoystick._VJCanvasContext.lineWidth = 2, VirtualJoystick._VJCanvasContext.arc(jp.x, jp.y, this.containerSize, 0, 2 * Math.PI, !0), VirtualJoystick._VJCanvasContext.stroke(), VirtualJoystick._VJCanvasContext.closePath(), VirtualJoystick._VJCanvasContext.beginPath(), VirtualJoystick._VJCanvasContext.lineWidth = 6, VirtualJoystick._VJCanvasContext.strokeStyle = this._joystickColor, VirtualJoystick._VJCanvasContext.arc(jp.x, jp.y, this.puckSize, 0, 2 * Math.PI, !0), VirtualJoystick._VJCanvasContext.stroke(), VirtualJoystick._VJCanvasContext.closePath());}_drawPuck() {this._puckImage ? VirtualJoystick._VJCanvasContext.drawImage(this._puckImage, this._joystickPointerPos.x - this.puckSize, this._joystickPointerPos.y - this.puckSize, 2 * this.puckSize, 2 * this.puckSize) : (VirtualJoystick._VJCanvasContext.beginPath(), VirtualJoystick._VJCanvasContext.strokeStyle = this._joystickColor, VirtualJoystick._VJCanvasContext.lineWidth = 2, VirtualJoystick._VJCanvasContext.arc(this._joystickPointerPos.x, this._joystickPointerPos.y, this.puckSize, 0, 2 * Math.PI, !0), VirtualJoystick._VJCanvasContext.stroke(), VirtualJoystick._VJCanvasContext.closePath());}_drawVirtualJoystick() {this._released || (this.alwaysVisible && this._drawContainer(), this.pressed && this._touches.forEach((key, touch) => {touch.pointerId === this._joystickPointerId ? (!this.alwaysVisible && this._drawContainer(), this._drawPuck(), this._joystickPreviousPointerPos = this._joystickPointerPos.clone()) : (VirtualJoystick._VJCanvasContext.clearRect(touch.prevX - 44, touch.prevY - 44, 88, 88), VirtualJoystick._VJCanvasContext.beginPath(), VirtualJoystick._VJCanvasContext.fillStyle = "white", VirtualJoystick._VJCanvasContext.beginPath(), VirtualJoystick._VJCanvasContext.strokeStyle = "red", VirtualJoystick._VJCanvasContext.lineWidth = 6, VirtualJoystick._VJCanvasContext.arc(touch.x, touch.y, 40, 0, 2 * Math.PI, !0), VirtualJoystick._VJCanvasContext.stroke(), VirtualJoystick._VJCanvasContext.closePath(), touch.prevX = touch.x, touch.prevY = touch.y);}), requestAnimationFrame(() => {this._drawVirtualJoystick();}));}releaseCanvas() {VirtualJoystick.Canvas && (VirtualJoystick.Canvas.removeEventListener("pointerdown", this._onPointerDownHandlerRef), VirtualJoystick.Canvas.removeEventListener("pointermove", this._onPointerMoveHandlerRef), VirtualJoystick.Canvas.removeEventListener("pointerup", this._onPointerUpHandlerRef), VirtualJoystick.Canvas.removeEventListener("pointerout", this._onPointerUpHandlerRef), window.removeEventListener("resize", this._onResize), document.body.removeChild(VirtualJoystick.Canvas), VirtualJoystick.Canvas = null), this._released = !0;}}VirtualJoystick._GlobalJoystickIndex = 0, VirtualJoystick._AlwaysVisibleSticks = 0;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraVirtualJoystickInput.js
freeCameraInputsManager/* FreeCameraInputsManager.prototype.addVirtualJoystick */.a.prototype.addVirtualJoystick = function () {return this.add(new FreeCameraVirtualJoystickInput()), this;};class FreeCameraVirtualJoystickInput {getLeftJoystick() {return this._leftjoystick;}getRightJoystick() {return this._rightjoystick;}checkInputs() {if (this._leftjoystick) {const camera = this.camera,speed = 50 * camera._computeLocalCameraSpeed(),cameraTransform = math_vector/* Matrix.RotationYawPitchRoll */.y3.RotationYawPitchRoll(camera.rotation.y, camera.rotation.x, 0),deltaTransform = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(new math_vector/* Vector3 */.P(this._leftjoystick.deltaPosition.x * speed, this._leftjoystick.deltaPosition.y * speed, this._leftjoystick.deltaPosition.z * speed), cameraTransform);camera.cameraDirection = camera.cameraDirection.add(deltaTransform), camera.cameraRotation = camera.cameraRotation.addVector3(this._rightjoystick.deltaPosition), this._leftjoystick.pressed || (this._leftjoystick.deltaPosition = this._leftjoystick.deltaPosition.scale(.9)), this._rightjoystick.pressed || (this._rightjoystick.deltaPosition = this._rightjoystick.deltaPosition.scale(.9));}}attachControl() {this._leftjoystick = new VirtualJoystick(!0), this._leftjoystick.setAxisForUpDown(JoystickAxis.Z), this._leftjoystick.setAxisForLeftRight(JoystickAxis.X), this._leftjoystick.setJoystickSensibility(.15), this._rightjoystick = new VirtualJoystick(!1), this._rightjoystick.setAxisForUpDown(JoystickAxis.X), this._rightjoystick.setAxisForLeftRight(JoystickAxis.Y), this._rightjoystick.reverseUpDown = !0, this._rightjoystick.setJoystickSensibility(.05), this._rightjoystick.setJoystickColor("yellow");}detachControl() {this._leftjoystick.releaseCanvas(), this._rightjoystick.releaseCanvas();}getClassName() {return "FreeCameraVirtualJoystickInput";}getSimpleName() {return "virtualJoystick";}}cameraInputsManager/* CameraInputTypes.FreeCameraVirtualJoystickInput */.u.FreeCameraVirtualJoystickInput = FreeCameraVirtualJoystickInput;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/targetCamera.js
var targetCamera = __webpack_require__("./node_modules/@babylonjs/core/Cameras/targetCamera.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/freeCamera.js
var Cameras_freeCamera = __webpack_require__("./node_modules/@babylonjs/core/Cameras/freeCamera.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/node.js
var node = __webpack_require__("./node_modules/@babylonjs/core/node.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/touchCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("TouchCamera", (name, scene) => () => new TouchCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene));class TouchCamera extends Cameras_freeCamera/* FreeCamera */.c {get touchAngularSensibility() {const touch = this.inputs.attached.touch;return touch ? touch.touchAngularSensibility : 0;}set touchAngularSensibility(value) {const touch = this.inputs.attached.touch;touch && (touch.touchAngularSensibility = value);}get touchMoveSensibility() {const touch = this.inputs.attached.touch;return touch ? touch.touchMoveSensibility : 0;}set touchMoveSensibility(value) {const touch = this.inputs.attached.touch;touch && (touch.touchMoveSensibility = value);}constructor(name, position, scene) {super(name, position, scene), this.inputs.addTouch(), this._setupInputs();}getClassName() {return "TouchCamera";}_setupInputs() {const touch = this.inputs.attached.touch,mouse = this.inputs.attached.mouse;mouse ? mouse.touchEnabled = !1 : touch.allowMouse = !0;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/arcRotateCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("ArcRotateCamera", (name, scene) => () => new ArcRotateCamera(name, 0, 0, 1, math_vector/* Vector3.Zero */.P.Zero(), scene));class ArcRotateCamera extends targetCamera/* TargetCamera */.C {get target() {return this._target;}set target(value) {this.setTarget(value);}get targetHost() {return this._targetHost;}set targetHost(value) {value && this.setTarget(value);}getTarget() {return this.target;}get position() {return this._position;}set position(newPosition) {this.setPosition(newPosition);}set upVector(vec) {this._upToYMatrix || (this._yToUpMatrix = new math_vector/* Matrix */.y3(), this._upToYMatrix = new math_vector/* Matrix */.y3(), this._upVector = math_vector/* Vector3.Zero */.P.Zero()), vec.normalize(), this._upVector.copyFrom(vec), this.setMatUp();}get upVector() {return this._upVector;}setMatUp() {math_vector/* Matrix.RotationAlignToRef */.y3.RotationAlignToRef(math_vector/* Vector3.UpReadOnly */.P.UpReadOnly, this._upVector, this._yToUpMatrix), math_vector/* Matrix.RotationAlignToRef */.y3.RotationAlignToRef(this._upVector, math_vector/* Vector3.UpReadOnly */.P.UpReadOnly, this._upToYMatrix);}get angularSensibilityX() {const pointers = this.inputs.attached.pointers;return pointers ? pointers.angularSensibilityX : 0;}set angularSensibilityX(value) {const pointers = this.inputs.attached.pointers;pointers && (pointers.angularSensibilityX = value);}get angularSensibilityY() {const pointers = this.inputs.attached.pointers;return pointers ? pointers.angularSensibilityY : 0;}set angularSensibilityY(value) {const pointers = this.inputs.attached.pointers;pointers && (pointers.angularSensibilityY = value);}get pinchPrecision() {const pointers = this.inputs.attached.pointers;return pointers ? pointers.pinchPrecision : 0;}set pinchPrecision(value) {const pointers = this.inputs.attached.pointers;pointers && (pointers.pinchPrecision = value);}get pinchDeltaPercentage() {const pointers = this.inputs.attached.pointers;return pointers ? pointers.pinchDeltaPercentage : 0;}set pinchDeltaPercentage(value) {const pointers = this.inputs.attached.pointers;pointers && (pointers.pinchDeltaPercentage = value);}get useNaturalPinchZoom() {const pointers = this.inputs.attached.pointers;return !!pointers && pointers.useNaturalPinchZoom;}set useNaturalPinchZoom(value) {const pointers = this.inputs.attached.pointers;pointers && (pointers.useNaturalPinchZoom = value);}get panningSensibility() {const pointers = this.inputs.attached.pointers;return pointers ? pointers.panningSensibility : 0;}set panningSensibility(value) {const pointers = this.inputs.attached.pointers;pointers && (pointers.panningSensibility = value);}get keysUp() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysUp : [];}set keysUp(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysUp = value);}get keysDown() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysDown : [];}set keysDown(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysDown = value);}get keysLeft() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysLeft : [];}set keysLeft(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysLeft = value);}get keysRight() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysRight : [];}set keysRight(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysRight = value);}get wheelPrecision() {const mousewheel = this.inputs.attached.mousewheel;return mousewheel ? mousewheel.wheelPrecision : 0;}set wheelPrecision(value) {const mousewheel = this.inputs.attached.mousewheel;mousewheel && (mousewheel.wheelPrecision = value);}get zoomToMouseLocation() {const mousewheel = this.inputs.attached.mousewheel;return !!mousewheel && mousewheel.zoomToMouseLocation;}set zoomToMouseLocation(value) {const mousewheel = this.inputs.attached.mousewheel;mousewheel && (mousewheel.zoomToMouseLocation = value);}get wheelDeltaPercentage() {const mousewheel = this.inputs.attached.mousewheel;return mousewheel ? mousewheel.wheelDeltaPercentage : 0;}set wheelDeltaPercentage(value) {const mousewheel = this.inputs.attached.mousewheel;mousewheel && (mousewheel.wheelDeltaPercentage = value);}get bouncingBehavior() {return this._bouncingBehavior;}get useBouncingBehavior() {return null != this._bouncingBehavior;}set useBouncingBehavior(value) {value === this.useBouncingBehavior || (value ? (this._bouncingBehavior = new BouncingBehavior(), this.addBehavior(this._bouncingBehavior)) : this._bouncingBehavior && (this.removeBehavior(this._bouncingBehavior), this._bouncingBehavior = null));}get framingBehavior() {return this._framingBehavior;}get useFramingBehavior() {return null != this._framingBehavior;}set useFramingBehavior(value) {value === this.useFramingBehavior || (value ? (this._framingBehavior = new FramingBehavior(), this.addBehavior(this._framingBehavior)) : this._framingBehavior && (this.removeBehavior(this._framingBehavior), this._framingBehavior = null));}get autoRotationBehavior() {return this._autoRotationBehavior;}get useAutoRotationBehavior() {return null != this._autoRotationBehavior;}set useAutoRotationBehavior(value) {value === this.useAutoRotationBehavior || (value ? (this._autoRotationBehavior = new AutoRotationBehavior(), this.addBehavior(this._autoRotationBehavior)) : this._autoRotationBehavior && (this.removeBehavior(this._autoRotationBehavior), this._autoRotationBehavior = null));}constructor(name, alpha, beta, radius, target, scene, setActiveOnSceneIfNoneActive = !0) {super(name, math_vector/* Vector3.Zero */.P.Zero(), scene, setActiveOnSceneIfNoneActive), this.inertialAlphaOffset = 0, this.inertialBetaOffset = 0, this.inertialRadiusOffset = 0, this.lowerAlphaLimit = null, this.upperAlphaLimit = null, this.lowerBetaLimit = .01, this.upperBetaLimit = Math.PI - .01, this.lowerRadiusLimit = null, this.upperRadiusLimit = null, this.inertialPanningX = 0, this.inertialPanningY = 0, this.pinchToPanMaxDistance = 20, this.panningDistanceLimit = null, this.panningOriginTarget = math_vector/* Vector3.Zero */.P.Zero(), this.panningInertia = .9, this.zoomOnFactor = 1, this.targetScreenOffset = math_vector/* Vector2.Zero */.FM.Zero(), this.allowUpsideDown = !0, this.useInputToRestoreState = !0, this._viewMatrix = new math_vector/* Matrix */.y3(), this.panningAxis = new math_vector/* Vector3 */.P(1, 1, 0), this._transformedDirection = new math_vector/* Vector3 */.P(), this.mapPanning = !1, this.onMeshTargetChangedObservable = new observable/* Observable */.y$(), this.checkCollisions = !1, this.collisionRadius = new math_vector/* Vector3 */.P(.5, .5, .5), this._previousPosition = math_vector/* Vector3.Zero */.P.Zero(), this._collisionVelocity = math_vector/* Vector3.Zero */.P.Zero(), this._newPosition = math_vector/* Vector3.Zero */.P.Zero(), this._computationVector = math_vector/* Vector3.Zero */.P.Zero(), this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {collidedMesh ? (this.setPosition(newPosition), this.onCollide && this.onCollide(collidedMesh)) : this._previousPosition.copyFrom(this._position);const cosa = Math.cos(this.alpha),sina = Math.sin(this.alpha),cosb = Math.cos(this.beta);let sinb = Math.sin(this.beta);0 === sinb && (sinb = 1e-4);const target = this._getTargetPosition();this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), target.addToRef(this._computationVector, this._newPosition), this._position.copyFrom(this._newPosition);let up = this.upVector;this.allowUpsideDown && 0 > this.beta && (up = up.clone(), up = up.negate()), this._computeViewMatrix(this._position, target, up), this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x), this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y), this._collisionTriggered = !1;}, this._target = math_vector/* Vector3.Zero */.P.Zero(), target && this.setTarget(target), this.alpha = alpha, this.beta = beta, this.radius = radius, this.getViewMatrix(), this.inputs = new ArcRotateCameraInputsManager(this), this.inputs.addKeyboard().addMouseWheel().addPointers();}_initCache() {super._initCache(), this._cache._target = new math_vector/* Vector3 */.P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.alpha = void 0, this._cache.beta = void 0, this._cache.radius = void 0, this._cache.targetScreenOffset = math_vector/* Vector2.Zero */.FM.Zero();}_updateCache(ignoreParentClass) {ignoreParentClass || super._updateCache(), this._cache._target.copyFrom(this._getTargetPosition()), this._cache.alpha = this.alpha, this._cache.beta = this.beta, this._cache.radius = this.radius, this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset);}_getTargetPosition() {if (this._targetHost && this._targetHost.getAbsolutePosition) {const pos = this._targetHost.getAbsolutePosition();this._targetBoundingCenter ? pos.addToRef(this._targetBoundingCenter, this._target) : this._target.copyFrom(pos);}const lockedTargetPosition = this._getLockedTargetPosition();return lockedTargetPosition ? lockedTargetPosition : this._target;}storeState() {return this._storedAlpha = this.alpha, this._storedBeta = this.beta, this._storedRadius = this.radius, this._storedTarget = this._getTargetPosition().clone(), this._storedTargetScreenOffset = this.targetScreenOffset.clone(), super.storeState();}_restoreStateValues() {return !!super._restoreStateValues() && (this.setTarget(this._storedTarget.clone()), this.alpha = this._storedAlpha, this.beta = this._storedBeta, this.radius = this._storedRadius, this.targetScreenOffset = this._storedTargetScreenOffset.clone(), this.inertialAlphaOffset = 0, this.inertialBetaOffset = 0, this.inertialRadiusOffset = 0, this.inertialPanningX = 0, this.inertialPanningY = 0, !0);}_isSynchronizedViewMatrix() {return !!super._isSynchronizedViewMatrix() && this._cache._target.equals(this._getTargetPosition()) && this._cache.alpha === this.alpha && this._cache.beta === this.beta && this._cache.radius === this.radius && this._cache.targetScreenOffset.equals(this.targetScreenOffset);}attachControl(ignored, noPreventDefault, useCtrlForPanning = !0, panningMouseButton = 2) {const args = arguments;noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(args), this._useCtrlForPanning = useCtrlForPanning, this._panningMouseButton = panningMouseButton, "boolean" == typeof args[0] && (1 < args.length && (this._useCtrlForPanning = args[1]), 2 < args.length && (this._panningMouseButton = args[2])), this.inputs.attachElement(noPreventDefault), this._reset = () => {this.inertialAlphaOffset = 0, this.inertialBetaOffset = 0, this.inertialRadiusOffset = 0, this.inertialPanningX = 0, this.inertialPanningY = 0;};}detachControl() {this.inputs.detachElement(), this._reset && this._reset();}_checkInputs() {if (!this._collisionTriggered) {if (this.inputs.checkInputs(), 0 !== this.inertialAlphaOffset || 0 !== this.inertialBetaOffset || 0 !== this.inertialRadiusOffset) {const directionModifier = this.invertRotation ? -1 : 1;let inertialAlphaOffset = this.inertialAlphaOffset;0 >= this.beta && (inertialAlphaOffset *= -1), this.getScene().useRightHandedSystem && (inertialAlphaOffset *= -1), this.parent && 0 > this.parent._getWorldMatrixDeterminant() && (inertialAlphaOffset *= -1), this.alpha += inertialAlphaOffset * directionModifier, this.beta += this.inertialBetaOffset * directionModifier, this.radius -= this.inertialRadiusOffset, this.inertialAlphaOffset *= this.inertia, this.inertialBetaOffset *= this.inertia, this.inertialRadiusOffset *= this.inertia, Math.abs(this.inertialAlphaOffset) < math_constants/* Epsilon */.kn && (this.inertialAlphaOffset = 0), Math.abs(this.inertialBetaOffset) < math_constants/* Epsilon */.kn && (this.inertialBetaOffset = 0), Math.abs(this.inertialRadiusOffset) < this.speed * math_constants/* Epsilon */.kn && (this.inertialRadiusOffset = 0);}if (0 !== this.inertialPanningX || 0 !== this.inertialPanningY) {const localDirection = new math_vector/* Vector3 */.P(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY);if (this._viewMatrix.invertToRef(this._cameraTransformMatrix), localDirection.multiplyInPlace(this.panningAxis), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(localDirection, this._cameraTransformMatrix, this._transformedDirection), (this.mapPanning || !this.panningAxis.y) && (this._transformedDirection.y = 0), !this._targetHost) if (this.panningDistanceLimit) {this._transformedDirection.addInPlace(this._target);const distanceSquared = math_vector/* Vector3.DistanceSquared */.P.DistanceSquared(this._transformedDirection, this.panningOriginTarget);distanceSquared <= this.panningDistanceLimit * this.panningDistanceLimit && this._target.copyFrom(this._transformedDirection);} else this._target.addInPlace(this._transformedDirection);this.inertialPanningX *= this.panningInertia, this.inertialPanningY *= this.panningInertia, Math.abs(this.inertialPanningX) < this.speed * math_constants/* Epsilon */.kn && (this.inertialPanningX = 0), Math.abs(this.inertialPanningY) < this.speed * math_constants/* Epsilon */.kn && (this.inertialPanningY = 0);}this._checkLimits(), super._checkInputs();}}_checkLimits() {null === this.lowerBetaLimit || this.lowerBetaLimit === void 0 ? this.allowUpsideDown && this.beta > Math.PI && (this.beta -= 2 * Math.PI) : this.beta < this.lowerBetaLimit && (this.beta = this.lowerBetaLimit), null === this.upperBetaLimit || this.upperBetaLimit === void 0 ? this.allowUpsideDown && this.beta < -Math.PI && (this.beta += 2 * Math.PI) : this.beta > this.upperBetaLimit && (this.beta = this.upperBetaLimit), null !== this.lowerAlphaLimit && this.alpha < this.lowerAlphaLimit && (this.alpha = this.lowerAlphaLimit), null !== this.upperAlphaLimit && this.alpha > this.upperAlphaLimit && (this.alpha = this.upperAlphaLimit), null !== this.lowerRadiusLimit && this.radius < this.lowerRadiusLimit && (this.radius = this.lowerRadiusLimit, this.inertialRadiusOffset = 0), null !== this.upperRadiusLimit && this.radius > this.upperRadiusLimit && (this.radius = this.upperRadiusLimit, this.inertialRadiusOffset = 0);}rebuildAnglesAndRadius() {this._position.subtractToRef(this._getTargetPosition(), this._computationVector), (0 !== this._upVector.x || 1 !== this._upVector.y || 0 !== this._upVector.z) && math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._computationVector, this._upToYMatrix, this._computationVector), this.radius = this._computationVector.length(), 0 === this.radius && (this.radius = 1e-4);const previousAlpha = this.alpha;this.alpha = 0 === this._computationVector.x && 0 === this._computationVector.z ? Math.PI / 2 : Math.acos(this._computationVector.x / Math.sqrt(Math.pow(this._computationVector.x, 2) + Math.pow(this._computationVector.z, 2))), 0 > this._computationVector.z && (this.alpha = 2 * Math.PI - this.alpha);const alphaCorrectionTurns = Math.round((previousAlpha - this.alpha) / (2 * Math.PI));this.alpha += 2 * alphaCorrectionTurns * Math.PI, this.beta = Math.acos(this._computationVector.y / this.radius), this._checkLimits();}setPosition(position) {this._position.equals(position) || (this._position.copyFrom(position), this.rebuildAnglesAndRadius());}setTarget(target, toBoundingCenter = !1, allowSamePosition = !1, cloneAlphaBetaRadius = !1) {var _a;if (cloneAlphaBetaRadius = null !== (_a = this.overrideCloneAlphaBetaRadius) && void 0 !== _a ? _a : cloneAlphaBetaRadius, target.getBoundingInfo) this._targetBoundingCenter = toBoundingCenter ? target.getBoundingInfo().boundingBox.centerWorld.clone() : null, target.computeWorldMatrix(), this._targetHost = target, this._target = this._getTargetPosition(), this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else {const newTarget = target,currentTarget = this._getTargetPosition();if (currentTarget && !allowSamePosition && currentTarget.equals(newTarget)) return;this._targetHost = null, this._target = newTarget, this._targetBoundingCenter = null, this.onMeshTargetChangedObservable.notifyObservers(null);}cloneAlphaBetaRadius || this.rebuildAnglesAndRadius();}_getViewMatrix() {const cosa = Math.cos(this.alpha),sina = Math.sin(this.alpha),cosb = Math.cos(this.beta);let sinb = Math.sin(this.beta);0 === sinb && (sinb = 1e-4), 0 === this.radius && (this.radius = 1e-4);const target = this._getTargetPosition();if (this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), (0 !== this._upVector.x || 1 !== this._upVector.y || 0 !== this._upVector.z) && math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._computationVector, this._yToUpMatrix, this._computationVector), target.addToRef(this._computationVector, this._newPosition), this.getScene().collisionsEnabled && this.checkCollisions) {const coordinator = this.getScene().collisionCoordinator;this._collider || (this._collider = coordinator.createCollider()), this._collider._radius = this.collisionRadius, this._newPosition.subtractToRef(this._position, this._collisionVelocity), this._collisionTriggered = !0, coordinator.getNewPosition(this._position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);} else {this._position.copyFrom(this._newPosition);let up = this.upVector;this.allowUpsideDown && 0 > sinb && (up = up.negate()), this._computeViewMatrix(this._position, target, up), this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x), this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);}return this._currentTarget = target, this._viewMatrix;}zoomOn(meshes, doNotUpdateMaxZ = !1) {meshes = meshes || this.getScene().meshes;const minMaxVector = Meshes_mesh/* Mesh.MinMax */.Kj.MinMax(meshes),distance = math_vector/* Vector3.Distance */.P.Distance(minMaxVector.min, minMaxVector.max);this.radius = distance * this.zoomOnFactor, this.focusOn({ min: minMaxVector.min, max: minMaxVector.max, distance: distance }, doNotUpdateMaxZ);}focusOn(meshesOrMinMaxVectorAndDistance, doNotUpdateMaxZ = !1) {let meshesOrMinMaxVector, distance;if (meshesOrMinMaxVectorAndDistance.min === void 0) {const meshes = meshesOrMinMaxVectorAndDistance || this.getScene().meshes;meshesOrMinMaxVector = Meshes_mesh/* Mesh.MinMax */.Kj.MinMax(meshes), distance = math_vector/* Vector3.Distance */.P.Distance(meshesOrMinMaxVector.min, meshesOrMinMaxVector.max);} else {const minMaxVectorAndDistance = meshesOrMinMaxVectorAndDistance;meshesOrMinMaxVector = minMaxVectorAndDistance, distance = minMaxVectorAndDistance.distance;}this._target = Meshes_mesh/* Mesh.Center */.Kj.Center(meshesOrMinMaxVector), doNotUpdateMaxZ || (this.maxZ = 2 * distance);}createRigCamera(name, cameraIndex) {let alphaShift = 0;switch (this.cameraRigMode) {case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH */.V.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER */.V.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_INTERLACED */.V.RIG_MODE_STEREOSCOPIC_INTERLACED:case Cameras_camera/* Camera.RIG_MODE_VR */.V.RIG_MODE_VR:alphaShift = this._cameraRigParams.stereoHalfAngle * (0 === cameraIndex ? 1 : -1);break;case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:alphaShift = this._cameraRigParams.stereoHalfAngle * (0 === cameraIndex ? -1 : 1);}const rigCam = new ArcRotateCamera(name, this.alpha + alphaShift, this.beta, this.radius, this._target, this.getScene());return rigCam._cameraRigParams = {}, rigCam.isRigCamera = !0, rigCam.rigParent = this, rigCam.upVector = this.upVector, rigCam.mode = this.mode, rigCam.orthoLeft = this.orthoLeft, rigCam.orthoRight = this.orthoRight, rigCam.orthoBottom = this.orthoBottom, rigCam.orthoTop = this.orthoTop, rigCam;}_updateRigCameras() {const camLeft = this._rigCameras[0],camRight = this._rigCameras[1];switch (camLeft.beta = camRight.beta = this.beta, this.cameraRigMode) {case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH */.V.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER */.V.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_INTERLACED */.V.RIG_MODE_STEREOSCOPIC_INTERLACED:case Cameras_camera/* Camera.RIG_MODE_VR */.V.RIG_MODE_VR:camLeft.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle, camRight.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;break;case Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:camLeft.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle, camRight.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;}super._updateRigCameras();}dispose() {this.inputs.clear(), super.dispose();}getClassName() {return "ArcRotateCamera";}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "alpha", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "beta", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "radius", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "overrideCloneAlphaBetaRadius", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsVector3 */.hd)("target")], ArcRotateCamera.prototype, "_target", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsMeshReference */.RR)("targetHost")], ArcRotateCamera.prototype, "_targetHost", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "inertialAlphaOffset", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "inertialBetaOffset", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "inertialRadiusOffset", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "lowerAlphaLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "upperAlphaLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "lowerBetaLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "upperBetaLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "lowerRadiusLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "upperRadiusLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "inertialPanningX", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "inertialPanningY", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "pinchToPanMaxDistance", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "panningDistanceLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsVector3 */.hd)()], ArcRotateCamera.prototype, "panningOriginTarget", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "panningInertia", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "zoomToMouseLocation", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "zoomOnFactor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsVector2 */.QC)()], ArcRotateCamera.prototype, "targetScreenOffset", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "allowUpsideDown", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ArcRotateCamera.prototype, "useInputToRestoreState", void 0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/deviceOrientationCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("DeviceOrientationCamera", (name, scene) => () => new DeviceOrientationCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene));class DeviceOrientationCamera extends Cameras_freeCamera/* FreeCamera */.c {constructor(name, position, scene) {super(name, position, scene), this._tmpDragQuaternion = new math_vector/* Quaternion */._f(), this._disablePointerInputWhenUsingDeviceOrientation = !0, this._dragFactor = 0, this._quaternionCache = new math_vector/* Quaternion */._f(), this.inputs.addDeviceOrientation(), this.inputs._deviceOrientationInput && this.inputs._deviceOrientationInput._onDeviceOrientationChangedObservable.addOnce(() => {this._disablePointerInputWhenUsingDeviceOrientation && this.inputs._mouseInput && (this.inputs._mouseInput._allowCameraRotation = !1, this.inputs._mouseInput.onPointerMovedObservable.add((e) => {0 != this._dragFactor && (!this._initialQuaternion && (this._initialQuaternion = new math_vector/* Quaternion */._f()), math_vector/* Quaternion.FromEulerAnglesToRef */._f.FromEulerAnglesToRef(0, e.offsetX * this._dragFactor, 0, this._tmpDragQuaternion), this._initialQuaternion.multiplyToRef(this._tmpDragQuaternion, this._initialQuaternion));}));});}get disablePointerInputWhenUsingDeviceOrientation() {return this._disablePointerInputWhenUsingDeviceOrientation;}set disablePointerInputWhenUsingDeviceOrientation(value) {this._disablePointerInputWhenUsingDeviceOrientation = value;}enableHorizontalDragging(dragFactor = 1 / 300) {this._dragFactor = dragFactor;}getClassName() {return "DeviceOrientationCamera";}_checkInputs() {super._checkInputs(), this._quaternionCache.copyFrom(this.rotationQuaternion), this._initialQuaternion && this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);}resetToCurrentRotation(axis = math_axis/* Axis.Y */.RD.Y) {this.rotationQuaternion && (!this._initialQuaternion && (this._initialQuaternion = new math_vector/* Quaternion */._f()), this._initialQuaternion.copyFrom(this._quaternionCache || this.rotationQuaternion), ["x", "y", "z"].forEach((axisName) => {axis[axisName] ? this._initialQuaternion[axisName] *= -1 : this._initialQuaternion[axisName] = 0;}), this._initialQuaternion.normalize(), this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion));}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/flyCameraInputsManager.js
class FlyCameraInputsManager extends cameraInputsManager/* CameraInputsManager */.p {constructor(camera) {super(camera);}addKeyboard() {return this.add(new FlyCameraKeyboardInput()), this;}addMouse() {return this.add(new FlyCameraMouseInput()), this;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/flyCamera.js
class FlyCamera extends targetCamera/* TargetCamera */.C {get angularSensibility() {const mouse = this.inputs.attached.mouse;return mouse ? mouse.angularSensibility : 0;}set angularSensibility(value) {const mouse = this.inputs.attached.mouse;mouse && (mouse.angularSensibility = value);}get keysForward() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysForward : [];}set keysForward(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysForward = value);}get keysBackward() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysBackward : [];}set keysBackward(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysBackward = value);}get keysUp() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysUp : [];}set keysUp(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysUp = value);}get keysDown() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysDown : [];}set keysDown(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysDown = value);}get keysLeft() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysLeft : [];}set keysLeft(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysLeft = value);}get keysRight() {const keyboard = this.inputs.attached.keyboard;return keyboard ? keyboard.keysRight : [];}set keysRight(value) {const keyboard = this.inputs.attached.keyboard;keyboard && (keyboard.keysRight = value);}constructor(name, position, scene, setActiveOnSceneIfNoneActive = !0) {super(name, position, scene, setActiveOnSceneIfNoneActive), this.ellipsoid = new math_vector/* Vector3 */.P(1, 1, 1), this.ellipsoidOffset = new math_vector/* Vector3 */.P(0, 0, 0), this.checkCollisions = !1, this.applyGravity = !1, this.cameraDirection = math_vector/* Vector3.Zero */.P.Zero(), this._trackRoll = 0, this.rollCorrect = 100, this.bankedTurn = !1, this.bankedTurnLimit = Math.PI / 2, this.bankedTurnMultiplier = 1, this._needMoveForGravity = !1, this._oldPosition = math_vector/* Vector3.Zero */.P.Zero(), this._diffPosition = math_vector/* Vector3.Zero */.P.Zero(), this._newPosition = math_vector/* Vector3.Zero */.P.Zero(), this._collisionMask = -1, this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {const updatePosition = (newPos) => {this._newPosition.copyFrom(newPos), this._newPosition.subtractToRef(this._oldPosition, this._diffPosition), this._diffPosition.length() > engine/* Engine.CollisionsEpsilon */.D.CollisionsEpsilon && (this.position.addInPlace(this._diffPosition), this.onCollide && collidedMesh && this.onCollide(collidedMesh));};updatePosition(newPosition);}, this.inputs = new FlyCameraInputsManager(this), this.inputs.addKeyboard().addMouse();}attachControl(ignored, noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(noPreventDefault);}detachControl() {this.inputs.detachElement(), this.cameraDirection = new math_vector/* Vector3 */.P(0, 0, 0);}get collisionMask() {return this._collisionMask;}set collisionMask(mask) {this._collisionMask = isNaN(mask) ? -1 : mask;}_collideWithWorld(displacement) {let globalPosition;globalPosition = this.parent ? math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(this.position, this.parent.getWorldMatrix()) : this.position, globalPosition.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition), this._oldPosition.addInPlace(this.ellipsoidOffset);const coordinator = this.getScene().collisionCoordinator;this._collider || (this._collider = coordinator.createCollider()), this._collider._radius = this.ellipsoid, this._collider.collisionMask = this._collisionMask;let actualDisplacement = displacement;this.applyGravity && (actualDisplacement = displacement.add(this.getScene().gravity)), coordinator.getNewPosition(this._oldPosition, actualDisplacement, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);}_checkInputs() {this._localDirection || (this._localDirection = math_vector/* Vector3.Zero */.P.Zero(), this._transformedDirection = math_vector/* Vector3.Zero */.P.Zero()), this.inputs.checkInputs(), super._checkInputs();}_decideIfNeedsToMove() {return this._needMoveForGravity || 0 < Math.abs(this.cameraDirection.x) || 0 < Math.abs(this.cameraDirection.y) || 0 < Math.abs(this.cameraDirection.z);}_updatePosition() {this.checkCollisions && this.getScene().collisionsEnabled ? this._collideWithWorld(this.cameraDirection) : super._updatePosition();}restoreRoll(rate) {const limit = this._trackRoll,z = this.rotation.z,delta = limit - z,minRad = .001;Math.abs(delta) >= minRad && (this.rotation.z += delta / rate, Math.abs(limit - this.rotation.z) <= minRad && (this.rotation.z = limit));}dispose() {this.inputs.clear(), super.dispose();}getClassName() {return "FlyCamera";}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsVector3 */.hd)()], FlyCamera.prototype, "ellipsoid", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsVector3 */.hd)()], FlyCamera.prototype, "ellipsoidOffset", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCamera.prototype, "checkCollisions", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FlyCamera.prototype, "applyGravity", void 0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/followCameraInputsManager.js
class FollowCameraInputsManager extends cameraInputsManager/* CameraInputsManager */.p {constructor(camera) {super(camera);}addKeyboard() {return this.add(new FollowCameraKeyboardMoveInput()), this;}addMouseWheel() {return this.add(new FollowCameraMouseWheelInput()), this;}addPointers() {return this.add(new FollowCameraPointersInput()), this;}addVRDeviceOrientation() {return console.warn("DeviceOrientation support not yet implemented for FollowCamera."), this;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/followCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("FollowCamera", (name, scene) => () => new FollowCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene)), node/* Node.AddNodeConstructor */.N.AddNodeConstructor("ArcFollowCamera", (name, scene) => () => new ArcFollowCamera(name, 0, 0, 1, null, scene));class FollowCamera extends targetCamera/* TargetCamera */.C {constructor(name, position, scene, lockedTarget = null) {super(name, position, scene), this.radius = 12, this.lowerRadiusLimit = null, this.upperRadiusLimit = null, this.rotationOffset = 0, this.lowerRotationOffsetLimit = null, this.upperRotationOffsetLimit = null, this.heightOffset = 4, this.lowerHeightOffsetLimit = null, this.upperHeightOffsetLimit = null, this.cameraAcceleration = .05, this.maxCameraSpeed = 20, this.lockedTarget = lockedTarget, this.inputs = new FollowCameraInputsManager(this), this.inputs.addKeyboard().addMouseWheel().addPointers();}_follow(cameraTarget) {if (!cameraTarget) return;const rotMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];cameraTarget.absoluteRotationQuaternion.toRotationMatrix(rotMatrix);const yRotation = Math.atan2(rotMatrix.m[8], rotMatrix.m[10]),radians = tools/* Tools.ToRadians */.w1.ToRadians(this.rotationOffset) + yRotation,targetPosition = cameraTarget.getAbsolutePosition(),targetX = targetPosition.x + Math.sin(radians) * this.radius,targetZ = targetPosition.z + Math.cos(radians) * this.radius,dx = targetX - this.position.x,dy = targetPosition.y + this.heightOffset - this.position.y,dz = targetZ - this.position.z;let vx = 2 * (dx * this.cameraAcceleration),vy = dy * this.cameraAcceleration,vz = 2 * (dz * this.cameraAcceleration);(vx > this.maxCameraSpeed || vx < -this.maxCameraSpeed) && (vx = 1 > vx ? -this.maxCameraSpeed : this.maxCameraSpeed), (vy > this.maxCameraSpeed || vy < -this.maxCameraSpeed) && (vy = 1 > vy ? -this.maxCameraSpeed : this.maxCameraSpeed), (vz > this.maxCameraSpeed || vz < -this.maxCameraSpeed) && (vz = 1 > vz ? -this.maxCameraSpeed : this.maxCameraSpeed), this.position = new math_vector/* Vector3 */.P(this.position.x + vx, this.position.y + vy, this.position.z + vz), this.setTarget(targetPosition);}attachControl(ignored, noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(noPreventDefault), this._reset = () => {};}detachControl() {this.inputs.detachElement(), this._reset && this._reset();}_checkInputs() {this.inputs.checkInputs(), this._checkLimits(), super._checkInputs(), this.lockedTarget && this._follow(this.lockedTarget);}_checkLimits() {null !== this.lowerRadiusLimit && this.radius < this.lowerRadiusLimit && (this.radius = this.lowerRadiusLimit), null !== this.upperRadiusLimit && this.radius > this.upperRadiusLimit && (this.radius = this.upperRadiusLimit), null !== this.lowerHeightOffsetLimit && this.heightOffset < this.lowerHeightOffsetLimit && (this.heightOffset = this.lowerHeightOffsetLimit), null !== this.upperHeightOffsetLimit && this.heightOffset > this.upperHeightOffsetLimit && (this.heightOffset = this.upperHeightOffsetLimit), null !== this.lowerRotationOffsetLimit && this.rotationOffset < this.lowerRotationOffsetLimit && (this.rotationOffset = this.lowerRotationOffsetLimit), null !== this.upperRotationOffsetLimit && this.rotationOffset > this.upperRotationOffsetLimit && (this.rotationOffset = this.upperRotationOffsetLimit);}getClassName() {return "FollowCamera";}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "radius", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "lowerRadiusLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "upperRadiusLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "rotationOffset", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "lowerRotationOffsetLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "upperRotationOffsetLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "heightOffset", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "lowerHeightOffsetLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "upperHeightOffsetLimit", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "cameraAcceleration", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], FollowCamera.prototype, "maxCameraSpeed", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsMeshReference */.RR)("lockedTargetId")], FollowCamera.prototype, "lockedTarget", void 0);class ArcFollowCamera extends targetCamera/* TargetCamera */.C {constructor(name, alpha, beta, radius, target, scene) {super(name, math_vector/* Vector3.Zero */.P.Zero(), scene), this.alpha = alpha, this.beta = beta, this.radius = radius, this._cartesianCoordinates = math_vector/* Vector3.Zero */.P.Zero(), this.setMeshTarget(target);}setMeshTarget(target) {this._meshTarget = target, this._follow();}_follow() {if (this._meshTarget) {this._cartesianCoordinates.x = this.radius * Math.cos(this.alpha) * Math.cos(this.beta), this._cartesianCoordinates.y = this.radius * Math.sin(this.beta), this._cartesianCoordinates.z = this.radius * Math.sin(this.alpha) * Math.cos(this.beta);const targetPosition = this._meshTarget.getAbsolutePosition();this.position = targetPosition.add(this._cartesianCoordinates), this.setTarget(targetPosition);}}_checkInputs() {super._checkInputs(), this._follow();}getClassName() {return "ArcFollowCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/Controllers/poseEnabledController.js
var PoseEnabledControllerType;(function (PoseEnabledControllerType) {PoseEnabledControllerType[PoseEnabledControllerType.VIVE = 0] = "VIVE", PoseEnabledControllerType[PoseEnabledControllerType.OCULUS = 1] = "OCULUS", PoseEnabledControllerType[PoseEnabledControllerType.WINDOWS = 2] = "WINDOWS", PoseEnabledControllerType[PoseEnabledControllerType.GEAR_VR = 3] = "GEAR_VR", PoseEnabledControllerType[PoseEnabledControllerType.DAYDREAM = 4] = "DAYDREAM", PoseEnabledControllerType[PoseEnabledControllerType.GENERIC = 5] = "GENERIC";})(PoseEnabledControllerType || (PoseEnabledControllerType = {}));class PoseEnabledControllerHelper {static InitiateController(vrGamepad) {for (const factory of this._ControllerFactories) if (factory.canCreate(vrGamepad)) return factory.create(vrGamepad);if (this._DefaultControllerFactory) return this._DefaultControllerFactory(vrGamepad);throw "The type of gamepad you are trying to load needs to be imported first or is not supported.";}}PoseEnabledControllerHelper._ControllerFactories = [], PoseEnabledControllerHelper._DefaultControllerFactory = null;class PoseEnabledController extends Gamepad {_disableTrackPosition(fixedPosition) {this._trackPosition && (this._calculatedPosition.copyFrom(fixedPosition), this._trackPosition = !1);}constructor(browserGamepad) {super(browserGamepad.id, browserGamepad.index, browserGamepad), this.isXR = !1, this._deviceRoomPosition = math_vector/* Vector3.Zero */.P.Zero(), this._deviceRoomRotationQuaternion = new math_vector/* Quaternion */._f(), this.devicePosition = math_vector/* Vector3.Zero */.P.Zero(), this.deviceRotationQuaternion = new math_vector/* Quaternion */._f(), this.deviceScaleFactor = 1, this._trackPosition = !0, this._maxRotationDistFromHeadset = Math.PI / 5, this._draggedRoomRotation = 0, this._leftHandSystemQuaternion = new math_vector/* Quaternion */._f(), this._deviceToWorld = math_vector/* Matrix.Identity */.y3.Identity(), this._pointingPoseNode = null, this._workingMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this._meshAttachedObservable = new observable/* Observable */.y$(), this.type = Gamepad.POSE_ENABLED, this.controllerType = PoseEnabledControllerType.GENERIC, this.position = math_vector/* Vector3.Zero */.P.Zero(), this.rotationQuaternion = new math_vector/* Quaternion */._f(), this._calculatedPosition = math_vector/* Vector3.Zero */.P.Zero(), this._calculatedRotation = new math_vector/* Quaternion */._f(), math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(Math.PI, 0, 0, this._leftHandSystemQuaternion);}update() {super.update(), this._updatePoseAndMesh();}_updatePoseAndMesh() {if (!this.isXR) {const pose = this.browserGamepad.pose;if (this.updateFromDevice(pose), !this._trackPosition && engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene && engineStore/* EngineStore.LastCreatedScene.activeCamera */.l.LastCreatedScene.activeCamera && engineStore/* EngineStore.LastCreatedScene.activeCamera.devicePosition */.l.LastCreatedScene.activeCamera.devicePosition) {const camera = engineStore/* EngineStore.LastCreatedScene.activeCamera */.l.LastCreatedScene.activeCamera;if (camera._computeDevicePosition(), this._deviceToWorld.setTranslation(camera.devicePosition), camera.deviceRotationQuaternion) {camera._deviceRoomRotationQuaternion.toEulerAnglesToRef(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]);const distanceAway = Math.atan2(Math.sin(math_vector/* TmpVectors.Vector3.0.y */.jp.Vector3[0].y - this._draggedRoomRotation), Math.cos(math_vector/* TmpVectors.Vector3.0.y */.jp.Vector3[0].y - this._draggedRoomRotation));if (Math.abs(distanceAway) > this._maxRotationDistFromHeadset) {const rotationAmount = distanceAway - (0 > distanceAway ? -this._maxRotationDistFromHeadset : this._maxRotationDistFromHeadset);this._draggedRoomRotation += rotationAmount;const sin = Math.sin(-rotationAmount),cos = Math.cos(-rotationAmount);this._calculatedPosition.x = this._calculatedPosition.x * cos - this._calculatedPosition.z * sin, this._calculatedPosition.z = this._calculatedPosition.x * sin + this._calculatedPosition.z * cos;}}}math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._calculatedPosition, this._deviceToWorld, this.devicePosition), this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix), math_vector/* Quaternion.FromRotationMatrixToRef */._f.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion), this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation), this._mesh && (this._mesh.position.copyFrom(this.devicePosition), this._mesh.rotationQuaternion && this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion));}}updateFromDevice(poseData) {if (!this.isXR && poseData) {this.rawPose = poseData, poseData.position && (this._deviceRoomPosition.copyFromFloats(poseData.position[0], poseData.position[1], -poseData.position[2]), this._mesh && this._mesh.getScene().useRightHandedSystem && (this._deviceRoomPosition.z *= -1), this._trackPosition && this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor, this._calculatedPosition), this._calculatedPosition.addInPlace(this.position));const pose = this.rawPose;poseData.orientation && pose.orientation && 4 === pose.orientation.length && (this._deviceRoomRotationQuaternion.copyFromFloats(pose.orientation[0], pose.orientation[1], -pose.orientation[2], -pose.orientation[3]), this._mesh && (this._mesh.getScene().useRightHandedSystem ? (this._deviceRoomRotationQuaternion.z *= -1, this._deviceRoomRotationQuaternion.w *= -1) : this._deviceRoomRotationQuaternion.multiplyToRef(this._leftHandSystemQuaternion, this._deviceRoomRotationQuaternion)), this._deviceRoomRotationQuaternion.multiplyToRef(this.rotationQuaternion, this._calculatedRotation));}}attachToMesh(mesh) {if (this._mesh && (this._mesh.parent = null), this._mesh = mesh, this._poseControlledCamera && (this._mesh.parent = this._poseControlledCamera), this._mesh.rotationQuaternion || (this._mesh.rotationQuaternion = new math_vector/* Quaternion */._f()), !this.isXR && (this._updatePoseAndMesh(), this._pointingPoseNode)) {const parents = [];for (let obj = this._pointingPoseNode; obj.parent;) parents.push(obj.parent), obj = obj.parent;parents.reverse().forEach((p) => {p.computeWorldMatrix(!0);});}this._meshAttachedObservable.notifyObservers(mesh);}attachToPoseControlledCamera(camera) {this._poseControlledCamera = camera, this._mesh && (this._mesh.parent = this._poseControlledCamera);}dispose() {this._mesh && this._mesh.dispose(), this._mesh = null, super.dispose();}get mesh() {return this._mesh;}getForwardRay(length = 100) {if (!this.mesh) return new Ray(math_vector/* Vector3.Zero */.P.Zero(), new math_vector/* Vector3 */.P(0, 0, 1), length);const m = this._pointingPoseNode ? this._pointingPoseNode.getWorldMatrix() : this.mesh.getWorldMatrix(),origin = m.getTranslation(),forward = new math_vector/* Vector3 */.P(0, 0, -1),forwardWorld = math_vector/* Vector3.TransformNormal */.P.TransformNormal(forward, m),direction = math_vector/* Vector3.Normalize */.P.Normalize(forwardWorld);return new Ray(origin, direction, length);}}PoseEnabledController.POINTING_POSE = "POINTING_POSE";
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/xboxGamepad.js
var Xbox360Button;(function (Xbox360Button) {Xbox360Button[Xbox360Button.A = 0] = "A", Xbox360Button[Xbox360Button.B = 1] = "B", Xbox360Button[Xbox360Button.X = 2] = "X", Xbox360Button[Xbox360Button.Y = 3] = "Y", Xbox360Button[Xbox360Button.LB = 4] = "LB", Xbox360Button[Xbox360Button.RB = 5] = "RB", Xbox360Button[Xbox360Button.Back = 8] = "Back", Xbox360Button[Xbox360Button.Start = 9] = "Start", Xbox360Button[Xbox360Button.LeftStick = 10] = "LeftStick", Xbox360Button[Xbox360Button.RightStick = 11] = "RightStick";})(Xbox360Button || (Xbox360Button = {}));var Xbox360Dpad;(function (Xbox360Dpad) {Xbox360Dpad[Xbox360Dpad.Up = 12] = "Up", Xbox360Dpad[Xbox360Dpad.Down = 13] = "Down", Xbox360Dpad[Xbox360Dpad.Left = 14] = "Left", Xbox360Dpad[Xbox360Dpad.Right = 15] = "Right";})(Xbox360Dpad || (Xbox360Dpad = {}));class Xbox360Pad extends Gamepad {constructor(id, index, gamepad, xboxOne = !1) {super(id, index, gamepad, 0, 1, 2, 3), this._leftTrigger = 0, this._rightTrigger = 0, this.onButtonDownObservable = new observable/* Observable */.y$(), this.onButtonUpObservable = new observable/* Observable */.y$(), this.onPadDownObservable = new observable/* Observable */.y$(), this.onPadUpObservable = new observable/* Observable */.y$(), this._buttonA = 0, this._buttonB = 0, this._buttonX = 0, this._buttonY = 0, this._buttonBack = 0, this._buttonStart = 0, this._buttonLB = 0, this._buttonRB = 0, this._buttonLeftStick = 0, this._buttonRightStick = 0, this._dPadUp = 0, this._dPadDown = 0, this._dPadLeft = 0, this._dPadRight = 0, this._isXboxOnePad = !1, this.type = Gamepad.XBOX, this._isXboxOnePad = xboxOne;}onlefttriggerchanged(callback) {this._onlefttriggerchanged = callback;}onrighttriggerchanged(callback) {this._onrighttriggerchanged = callback;}get leftTrigger() {return this._leftTrigger;}set leftTrigger(newValue) {this._onlefttriggerchanged && this._leftTrigger !== newValue && this._onlefttriggerchanged(newValue), this._leftTrigger = newValue;}get rightTrigger() {return this._rightTrigger;}set rightTrigger(newValue) {this._onrighttriggerchanged && this._rightTrigger !== newValue && this._onrighttriggerchanged(newValue), this._rightTrigger = newValue;}onbuttondown(callback) {this._onbuttondown = callback;}onbuttonup(callback) {this._onbuttonup = callback;}ondpaddown(callback) {this._ondpaddown = callback;}ondpadup(callback) {this._ondpadup = callback;}_setButtonValue(newValue, currentValue, buttonType) {return newValue !== currentValue && (1 === newValue && (this._onbuttondown && this._onbuttondown(buttonType), this.onButtonDownObservable.notifyObservers(buttonType)), 0 === newValue && (this._onbuttonup && this._onbuttonup(buttonType), this.onButtonUpObservable.notifyObservers(buttonType))), newValue;}_setDPadValue(newValue, currentValue, buttonType) {return newValue !== currentValue && (1 === newValue && (this._ondpaddown && this._ondpaddown(buttonType), this.onPadDownObservable.notifyObservers(buttonType)), 0 === newValue && (this._ondpadup && this._ondpadup(buttonType), this.onPadUpObservable.notifyObservers(buttonType))), newValue;}get buttonA() {return this._buttonA;}set buttonA(value) {this._buttonA = this._setButtonValue(value, this._buttonA, Xbox360Button.A);}get buttonB() {return this._buttonB;}set buttonB(value) {this._buttonB = this._setButtonValue(value, this._buttonB, Xbox360Button.B);}get buttonX() {return this._buttonX;}set buttonX(value) {this._buttonX = this._setButtonValue(value, this._buttonX, Xbox360Button.X);}get buttonY() {return this._buttonY;}set buttonY(value) {this._buttonY = this._setButtonValue(value, this._buttonY, Xbox360Button.Y);}get buttonStart() {return this._buttonStart;}set buttonStart(value) {this._buttonStart = this._setButtonValue(value, this._buttonStart, Xbox360Button.Start);}get buttonBack() {return this._buttonBack;}set buttonBack(value) {this._buttonBack = this._setButtonValue(value, this._buttonBack, Xbox360Button.Back);}get buttonLB() {return this._buttonLB;}set buttonLB(value) {this._buttonLB = this._setButtonValue(value, this._buttonLB, Xbox360Button.LB);}get buttonRB() {return this._buttonRB;}set buttonRB(value) {this._buttonRB = this._setButtonValue(value, this._buttonRB, Xbox360Button.RB);}get buttonLeftStick() {return this._buttonLeftStick;}set buttonLeftStick(value) {this._buttonLeftStick = this._setButtonValue(value, this._buttonLeftStick, Xbox360Button.LeftStick);}get buttonRightStick() {return this._buttonRightStick;}set buttonRightStick(value) {this._buttonRightStick = this._setButtonValue(value, this._buttonRightStick, Xbox360Button.RightStick);}get dPadUp() {return this._dPadUp;}set dPadUp(value) {this._dPadUp = this._setDPadValue(value, this._dPadUp, Xbox360Dpad.Up);}get dPadDown() {return this._dPadDown;}set dPadDown(value) {this._dPadDown = this._setDPadValue(value, this._dPadDown, Xbox360Dpad.Down);}get dPadLeft() {return this._dPadLeft;}set dPadLeft(value) {this._dPadLeft = this._setDPadValue(value, this._dPadLeft, Xbox360Dpad.Left);}get dPadRight() {return this._dPadRight;}set dPadRight(value) {this._dPadRight = this._setDPadValue(value, this._dPadRight, Xbox360Dpad.Right);}update() {super.update(), this._isXboxOnePad ? (this.buttonA = this.browserGamepad.buttons[0].value, this.buttonB = this.browserGamepad.buttons[1].value, this.buttonX = this.browserGamepad.buttons[2].value, this.buttonY = this.browserGamepad.buttons[3].value, this.buttonLB = this.browserGamepad.buttons[4].value, this.buttonRB = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonBack = this.browserGamepad.buttons[8].value, this.buttonStart = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value) : (this.buttonA = this.browserGamepad.buttons[0].value, this.buttonB = this.browserGamepad.buttons[1].value, this.buttonX = this.browserGamepad.buttons[2].value, this.buttonY = this.browserGamepad.buttons[3].value, this.buttonLB = this.browserGamepad.buttons[4].value, this.buttonRB = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonBack = this.browserGamepad.buttons[8].value, this.buttonStart = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value);}dispose() {super.dispose(), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear(), this.onPadDownObservable.clear(), this.onPadUpObservable.clear();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/dualShockGamepad.js
var DualShockButton;(function (DualShockButton) {DualShockButton[DualShockButton.Cross = 0] = "Cross", DualShockButton[DualShockButton.Circle = 1] = "Circle", DualShockButton[DualShockButton.Square = 2] = "Square", DualShockButton[DualShockButton.Triangle = 3] = "Triangle", DualShockButton[DualShockButton.L1 = 4] = "L1", DualShockButton[DualShockButton.R1 = 5] = "R1", DualShockButton[DualShockButton.Share = 8] = "Share", DualShockButton[DualShockButton.Options = 9] = "Options", DualShockButton[DualShockButton.LeftStick = 10] = "LeftStick", DualShockButton[DualShockButton.RightStick = 11] = "RightStick";})(DualShockButton || (DualShockButton = {}));var DualShockDpad;(function (DualShockDpad) {DualShockDpad[DualShockDpad.Up = 12] = "Up", DualShockDpad[DualShockDpad.Down = 13] = "Down", DualShockDpad[DualShockDpad.Left = 14] = "Left", DualShockDpad[DualShockDpad.Right = 15] = "Right";})(DualShockDpad || (DualShockDpad = {}));class DualShockPad extends Gamepad {constructor(id, index, gamepad) {super(id.replace("STANDARD GAMEPAD", "SONY PLAYSTATION DUALSHOCK"), index, gamepad, 0, 1, 2, 3), this._leftTrigger = 0, this._rightTrigger = 0, this.onButtonDownObservable = new observable/* Observable */.y$(), this.onButtonUpObservable = new observable/* Observable */.y$(), this.onPadDownObservable = new observable/* Observable */.y$(), this.onPadUpObservable = new observable/* Observable */.y$(), this._buttonCross = 0, this._buttonCircle = 0, this._buttonSquare = 0, this._buttonTriangle = 0, this._buttonShare = 0, this._buttonOptions = 0, this._buttonL1 = 0, this._buttonR1 = 0, this._buttonLeftStick = 0, this._buttonRightStick = 0, this._dPadUp = 0, this._dPadDown = 0, this._dPadLeft = 0, this._dPadRight = 0, this.type = Gamepad.DUALSHOCK;}onlefttriggerchanged(callback) {this._onlefttriggerchanged = callback;}onrighttriggerchanged(callback) {this._onrighttriggerchanged = callback;}get leftTrigger() {return this._leftTrigger;}set leftTrigger(newValue) {this._onlefttriggerchanged && this._leftTrigger !== newValue && this._onlefttriggerchanged(newValue), this._leftTrigger = newValue;}get rightTrigger() {return this._rightTrigger;}set rightTrigger(newValue) {this._onrighttriggerchanged && this._rightTrigger !== newValue && this._onrighttriggerchanged(newValue), this._rightTrigger = newValue;}onbuttondown(callback) {this._onbuttondown = callback;}onbuttonup(callback) {this._onbuttonup = callback;}ondpaddown(callback) {this._ondpaddown = callback;}ondpadup(callback) {this._ondpadup = callback;}_setButtonValue(newValue, currentValue, buttonType) {return newValue !== currentValue && (1 === newValue && (this._onbuttondown && this._onbuttondown(buttonType), this.onButtonDownObservable.notifyObservers(buttonType)), 0 === newValue && (this._onbuttonup && this._onbuttonup(buttonType), this.onButtonUpObservable.notifyObservers(buttonType))), newValue;}_setDPadValue(newValue, currentValue, buttonType) {return newValue !== currentValue && (1 === newValue && (this._ondpaddown && this._ondpaddown(buttonType), this.onPadDownObservable.notifyObservers(buttonType)), 0 === newValue && (this._ondpadup && this._ondpadup(buttonType), this.onPadUpObservable.notifyObservers(buttonType))), newValue;}get buttonCross() {return this._buttonCross;}set buttonCross(value) {this._buttonCross = this._setButtonValue(value, this._buttonCross, DualShockButton.Cross);}get buttonCircle() {return this._buttonCircle;}set buttonCircle(value) {this._buttonCircle = this._setButtonValue(value, this._buttonCircle, DualShockButton.Circle);}get buttonSquare() {return this._buttonSquare;}set buttonSquare(value) {this._buttonSquare = this._setButtonValue(value, this._buttonSquare, DualShockButton.Square);}get buttonTriangle() {return this._buttonTriangle;}set buttonTriangle(value) {this._buttonTriangle = this._setButtonValue(value, this._buttonTriangle, DualShockButton.Triangle);}get buttonOptions() {return this._buttonOptions;}set buttonOptions(value) {this._buttonOptions = this._setButtonValue(value, this._buttonOptions, DualShockButton.Options);}get buttonShare() {return this._buttonShare;}set buttonShare(value) {this._buttonShare = this._setButtonValue(value, this._buttonShare, DualShockButton.Share);}get buttonL1() {return this._buttonL1;}set buttonL1(value) {this._buttonL1 = this._setButtonValue(value, this._buttonL1, DualShockButton.L1);}get buttonR1() {return this._buttonR1;}set buttonR1(value) {this._buttonR1 = this._setButtonValue(value, this._buttonR1, DualShockButton.R1);}get buttonLeftStick() {return this._buttonLeftStick;}set buttonLeftStick(value) {this._buttonLeftStick = this._setButtonValue(value, this._buttonLeftStick, DualShockButton.LeftStick);}get buttonRightStick() {return this._buttonRightStick;}set buttonRightStick(value) {this._buttonRightStick = this._setButtonValue(value, this._buttonRightStick, DualShockButton.RightStick);}get dPadUp() {return this._dPadUp;}set dPadUp(value) {this._dPadUp = this._setDPadValue(value, this._dPadUp, DualShockDpad.Up);}get dPadDown() {return this._dPadDown;}set dPadDown(value) {this._dPadDown = this._setDPadValue(value, this._dPadDown, DualShockDpad.Down);}get dPadLeft() {return this._dPadLeft;}set dPadLeft(value) {this._dPadLeft = this._setDPadValue(value, this._dPadLeft, DualShockDpad.Left);}get dPadRight() {return this._dPadRight;}set dPadRight(value) {this._dPadRight = this._setDPadValue(value, this._dPadRight, DualShockDpad.Right);}update() {super.update(), this.buttonCross = this.browserGamepad.buttons[0].value, this.buttonCircle = this.browserGamepad.buttons[1].value, this.buttonSquare = this.browserGamepad.buttons[2].value, this.buttonTriangle = this.browserGamepad.buttons[3].value, this.buttonL1 = this.browserGamepad.buttons[4].value, this.buttonR1 = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonShare = this.browserGamepad.buttons[8].value, this.buttonOptions = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value;}dispose() {super.dispose(), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear(), this.onPadDownObservable.clear(), this.onPadUpObservable.clear();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/gamepadManager.js
class GamepadManager {constructor(_scene) {if (this._scene = _scene, this._babylonGamepads = [], this._oneGamepadConnected = !1, this._isMonitoring = !1, this.onGamepadDisconnectedObservable = new observable/* Observable */.y$(), (0,domManagement/* IsWindowObjectExist */.CG)() ? (this._gamepadEventSupported = "GamepadEvent" in window, this._gamepadSupport = navigator && navigator.getGamepads) : this._gamepadEventSupported = !1, this.onGamepadConnectedObservable = new observable/* Observable */.y$((observer) => {for (const i in this._babylonGamepads) {const gamepad = this._babylonGamepads[i];gamepad && gamepad._isConnected && this.onGamepadConnectedObservable.notifyObserver(observer, gamepad);}}), this._onGamepadConnectedEvent = (evt) => {const gamepad = evt.gamepad;if (gamepad.index in this._babylonGamepads && this._babylonGamepads[gamepad.index].isConnected) return;let newGamepad;this._babylonGamepads[gamepad.index] ? (newGamepad = this._babylonGamepads[gamepad.index], newGamepad.browserGamepad = gamepad, newGamepad._isConnected = !0) : newGamepad = this._addNewGamepad(gamepad), this.onGamepadConnectedObservable.notifyObservers(newGamepad), this._startMonitoringGamepads();}, this._onGamepadDisconnectedEvent = (evt) => {const gamepad = evt.gamepad;for (const i in this._babylonGamepads) if (this._babylonGamepads[i].index === gamepad.index) {const disconnectedGamepad = this._babylonGamepads[i];disconnectedGamepad._isConnected = !1, this.onGamepadDisconnectedObservable.notifyObservers(disconnectedGamepad), disconnectedGamepad.dispose && disconnectedGamepad.dispose();break;}}, this._gamepadSupport) if (this._updateGamepadObjects(), this._babylonGamepads.length && this._startMonitoringGamepads(), this._gamepadEventSupported) {const hostWindow = this._scene ? this._scene.getEngine().getHostWindow() : window;hostWindow && (hostWindow.addEventListener("gamepadconnected", this._onGamepadConnectedEvent, !1), hostWindow.addEventListener("gamepaddisconnected", this._onGamepadDisconnectedEvent, !1));} else this._startMonitoringGamepads();}get gamepads() {return this._babylonGamepads;}getGamepadByType(type = Gamepad.XBOX) {for (const gamepad of this._babylonGamepads) if (gamepad && gamepad.type === type) return gamepad;return null;}dispose() {this._gamepadEventSupported && (this._onGamepadConnectedEvent && window.removeEventListener("gamepadconnected", this._onGamepadConnectedEvent), this._onGamepadDisconnectedEvent && window.removeEventListener("gamepaddisconnected", this._onGamepadDisconnectedEvent), this._onGamepadConnectedEvent = null, this._onGamepadDisconnectedEvent = null), this._babylonGamepads.forEach((gamepad) => {gamepad.dispose();}), this.onGamepadConnectedObservable.clear(), this.onGamepadDisconnectedObservable.clear(), this._oneGamepadConnected = !1, this._stopMonitoringGamepads(), this._babylonGamepads = [];}_addNewGamepad(gamepad) {this._oneGamepadConnected || (this._oneGamepadConnected = !0);let newGamepad;const dualShock = -1 !== gamepad.id.search("054c") && -1 === gamepad.id.search("0ce6"),xboxOne = -1 !== gamepad.id.search("Xbox One");return newGamepad = xboxOne || -1 !== gamepad.id.search("Xbox 360") || -1 !== gamepad.id.search("xinput") || -1 !== gamepad.id.search("045e") && -1 === gamepad.id.search("Surface Dock") ? new Xbox360Pad(gamepad.id, gamepad.index, gamepad, xboxOne) : dualShock ? new DualShockPad(gamepad.id, gamepad.index, gamepad) : gamepad.pose ? PoseEnabledControllerHelper.InitiateController(gamepad) : new GenericPad(gamepad.id, gamepad.index, gamepad), this._babylonGamepads[newGamepad.index] = newGamepad, newGamepad;}_startMonitoringGamepads() {this._isMonitoring || (this._isMonitoring = !0, !this._scene && this._checkGamepadsStatus());}_stopMonitoringGamepads() {this._isMonitoring = !1;}_checkGamepadsStatus() {for (const i in this._updateGamepadObjects(), this._babylonGamepads) {const gamepad = this._babylonGamepads[i];if (gamepad && gamepad.isConnected) try {gamepad.update();} catch (_a) {-1 === this._loggedErrors.indexOf(gamepad.index) && (tools/* Tools.Warn */.w1.Warn(`Error updating gamepad ${gamepad.id}`), this._loggedErrors.push(gamepad.index));}}this._isMonitoring && !this._scene && engine/* Engine.QueueNewFrame */.D.QueueNewFrame(() => {this._checkGamepadsStatus();});}_updateGamepadObjects() {const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];for (let i = 0; i < gamepads.length; i++) {const gamepad = gamepads[i];if (gamepad) if (!this._babylonGamepads[gamepad.index]) {const newGamepad = this._addNewGamepad(gamepad);this.onGamepadConnectedObservable.notifyObservers(newGamepad);} else this._babylonGamepads[i].browserGamepad = gamepad, this._babylonGamepads[i].isConnected || (this._babylonGamepads[i]._isConnected = !0, this.onGamepadConnectedObservable.notifyObservers(this._babylonGamepads[i]));}}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/gamepadSceneComponent.js
Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "gamepadManager", { get: function () {if (!this._gamepadManager) {this._gamepadManager = new GamepadManager(this);let component = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_GAMEPAD */.l.NAME_GAMEPAD);component || (component = new GamepadSystemSceneComponent(this), this._addComponent(component));}return this._gamepadManager;}, enumerable: !0, configurable: !0 }), freeCameraInputsManager/* FreeCameraInputsManager.prototype.addGamepad */.a.prototype.addGamepad = function () {return this.add(new FreeCameraGamepadInput()), this;}, ArcRotateCameraInputsManager.prototype.addGamepad = function () {return this.add(new ArcRotateCameraGamepadInput()), this;};class GamepadSystemSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_GAMEPAD */.l.NAME_GAMEPAD, this.scene = scene;}register() {this.scene._beforeCameraUpdateStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORECAMERAUPDATE_GAMEPAD */.l.STEP_BEFORECAMERAUPDATE_GAMEPAD, this, this._beforeCameraUpdate);}rebuild() {}dispose() {const gamepadManager = this.scene._gamepadManager;gamepadManager && (gamepadManager.dispose(), this.scene._gamepadManager = null);}_beforeCameraUpdate() {const gamepadManager = this.scene._gamepadManager;gamepadManager && gamepadManager._isMonitoring && gamepadManager._checkGamepadsStatus();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/universalCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("FreeCamera", (name, scene) => () => new UniversalCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene));class UniversalCamera extends TouchCamera {get gamepadAngularSensibility() {const gamepad = this.inputs.attached.gamepad;return gamepad ? gamepad.gamepadAngularSensibility : 0;}set gamepadAngularSensibility(value) {const gamepad = this.inputs.attached.gamepad;gamepad && (gamepad.gamepadAngularSensibility = value);}get gamepadMoveSensibility() {const gamepad = this.inputs.attached.gamepad;return gamepad ? gamepad.gamepadMoveSensibility : 0;}set gamepadMoveSensibility(value) {const gamepad = this.inputs.attached.gamepad;gamepad && (gamepad.gamepadMoveSensibility = value);}constructor(name, position, scene) {super(name, position, scene), this.inputs.addGamepad();}getClassName() {return "UniversalCamera";}}Cameras_camera/* Camera._CreateDefaultParsedCamera */.V._CreateDefaultParsedCamera = (name, scene) => new UniversalCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/gamepadCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("GamepadCamera", (name, scene) => () => new GamepadCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene));class GamepadCamera extends UniversalCamera {constructor(name, position, scene) {super(name, position, scene);}getClassName() {return "GamepadCamera";}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/passPostProcess.js + 1 modules
var passPostProcess = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/passPostProcess.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/anaglyph.fragment.js
const anaglyph_fragment_name = "anaglyphPixelShader",anaglyph_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform sampler2D leftSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec4 leftFrag=texture2D(leftSampler,vUV);
leftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);
vec4 rightFrag=texture2D(textureSampler,vUV);
rightFrag=vec4(rightFrag.r,1.0,1.0,1.0);
gl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);
}`;shaderStore/* ShaderStore.ShadersStore.anaglyphPixelShader */.v.ShadersStore.anaglyphPixelShader = anaglyph_fragment_shader;const anaglyphPixelShader = { name: "anaglyphPixelShader", shader: anaglyph_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/anaglyphPostProcess.js
class AnaglyphPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "AnaglyphPostProcess";}constructor(name, options, rigCameras, samplingMode, engine, reusable) {super(name, "anaglyph", null, ["leftSampler"], options, rigCameras[1], samplingMode, engine, reusable), this._passedProcess = rigCameras[0]._rigPostProcess, this.onApplyObservable.add((effect) => {effect.setTextureFromPostProcess("leftSampler", this._passedProcess);});}}(0,typeStore/* RegisterClass */.H)("BABYLON.AnaglyphPostProcess", AnaglyphPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/RigModes/stereoscopicAnaglyphRigMode.js
function setStereoscopicAnaglyphRigMode(camera) {camera._rigCameras[0]._rigPostProcess = new passPostProcess/* PassPostProcess */.Q(camera.name + "_passthru", 1, camera._rigCameras[0]), camera._rigCameras[1]._rigPostProcess = new AnaglyphPostProcess(camera.name + "_anaglyph", 1, camera._rigCameras);}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphArcRotateCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("AnaglyphArcRotateCamera", (name, scene, options) => () => new AnaglyphArcRotateCamera(name, 0, 0, 1, math_vector/* Vector3.Zero */.P.Zero(), options.interaxial_distance, scene));class AnaglyphArcRotateCamera extends ArcRotateCamera {constructor(name, alpha, beta, radius, target, interaxialDistance, scene) {super(name, alpha, beta, radius, target, scene), this._setRigMode = setStereoscopicAnaglyphRigMode.bind(null, this), this.interaxialDistance = interaxialDistance, this.setCameraRigMode(Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH */.V.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance });}getClassName() {return "AnaglyphArcRotateCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphFreeCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("AnaglyphFreeCamera", (name, scene, options) => () => new AnaglyphFreeCamera(name, math_vector/* Vector3.Zero */.P.Zero(), options.interaxial_distance, scene));class AnaglyphFreeCamera extends Cameras_freeCamera/* FreeCamera */.c {constructor(name, position, interaxialDistance, scene) {super(name, position, scene), this._setRigMode = setStereoscopicAnaglyphRigMode.bind(null, this), this.interaxialDistance = interaxialDistance, this.setCameraRigMode(Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH */.V.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance });}getClassName() {return "AnaglyphFreeCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphGamepadCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("AnaglyphGamepadCamera", (name, scene, options) => () => new AnaglyphGamepadCamera(name, math_vector/* Vector3.Zero */.P.Zero(), options.interaxial_distance, scene));class AnaglyphGamepadCamera extends GamepadCamera {constructor(name, position, interaxialDistance, scene) {super(name, position, scene), this._setRigMode = setStereoscopicAnaglyphRigMode.bind(null, this), this.interaxialDistance = interaxialDistance, this.setCameraRigMode(Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH */.V.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance });}getClassName() {return "AnaglyphGamepadCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphUniversalCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("AnaglyphUniversalCamera", (name, scene, options) => () => new AnaglyphUniversalCamera(name, math_vector/* Vector3.Zero */.P.Zero(), options.interaxial_distance, scene));class AnaglyphUniversalCamera extends UniversalCamera {constructor(name, position, interaxialDistance, scene) {super(name, position, scene), this._setRigMode = setStereoscopicAnaglyphRigMode.bind(null, this), this.interaxialDistance = interaxialDistance, this.setCameraRigMode(Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH */.V.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance });}getClassName() {return "AnaglyphUniversalCamera";}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.viewport.js
var math_viewport = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.viewport.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/stereoscopicInterlace.fragment.js
const stereoscopicInterlace_fragment_name = "stereoscopicInterlacePixelShader",stereoscopicInterlace_fragment_shader = `const vec3 TWO=vec3(2.0,2.0,2.0);
varying vec2 vUV;
uniform sampler2D camASampler;
uniform sampler2D textureSampler;
uniform vec2 stepSize;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
bool useCamA;
bool useCamB;
vec2 texCoord1;
vec2 texCoord2;
vec3 frag1;
vec3 frag2;
#ifdef IS_STEREOSCOPIC_HORIZ
useCamB=vUV.x>0.5;
useCamA=!useCamB;
texCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);
texCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);
#else
#ifdef IS_STEREOSCOPIC_INTERLACED
float rowNum=floor(vUV.y/stepSize.y);
useCamA=mod(rowNum,2.0)==1.0;
useCamB=mod(rowNum,2.0)==0.0;
texCoord1=vec2(vUV.x,vUV.y);
texCoord2=vec2(vUV.x,vUV.y);
#else
useCamB=vUV.y>0.5;
useCamA=!useCamB;
texCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);
texCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);
#endif
#endif
if (useCamB){
frag1=texture2D(textureSampler,texCoord1).rgb;
frag2=texture2D(textureSampler,texCoord2).rgb;
}else if (useCamA){
frag1=texture2D(camASampler ,texCoord1).rgb;
frag2=texture2D(camASampler ,texCoord2).rgb;
}else {
discard;
}
gl_FragColor=vec4((frag1+frag2)/TWO,1.0);
}
`;shaderStore/* ShaderStore.ShadersStore.stereoscopicInterlacePixelShader */.v.ShadersStore.stereoscopicInterlacePixelShader = stereoscopicInterlace_fragment_shader;const stereoscopicInterlacePixelShader = { name: "stereoscopicInterlacePixelShader", shader: stereoscopicInterlace_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/stereoscopicInterlacePostProcess.js
class StereoscopicInterlacePostProcessI extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "StereoscopicInterlacePostProcessI";}constructor(name, rigCameras, isStereoscopicHoriz, isStereoscopicInterlaced, samplingMode, engine, reusable) {super(name, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, rigCameras[1], samplingMode, engine, reusable, isStereoscopicInterlaced ? "#define IS_STEREOSCOPIC_INTERLACED 1" : isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : void 0), this._passedProcess = rigCameras[0]._rigPostProcess, this._stepSize = new math_vector/* Vector2 */.FM(1 / this.width, 1 / this.height), this.onSizeChangedObservable.add(() => {this._stepSize = new math_vector/* Vector2 */.FM(1 / this.width, 1 / this.height);}), this.onApplyObservable.add((effect) => {effect.setTextureFromPostProcess("camASampler", this._passedProcess), effect.setFloat2("stepSize", this._stepSize.x, this._stepSize.y);});}}class StereoscopicInterlacePostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "StereoscopicInterlacePostProcess";}constructor(name, rigCameras, isStereoscopicHoriz, samplingMode, engine, reusable) {super(name, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, rigCameras[1], samplingMode, engine, reusable, isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : void 0), this._passedProcess = rigCameras[0]._rigPostProcess, this._stepSize = new math_vector/* Vector2 */.FM(1 / this.width, 1 / this.height), this.onSizeChangedObservable.add(() => {this._stepSize = new math_vector/* Vector2 */.FM(1 / this.width, 1 / this.height);}), this.onApplyObservable.add((effect) => {effect.setTextureFromPostProcess("camASampler", this._passedProcess), effect.setFloat2("stepSize", this._stepSize.x, this._stepSize.y);});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/RigModes/stereoscopicRigMode.js
function setStereoscopicRigMode(camera) {const isStereoscopicHoriz = camera.cameraRigMode === Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || camera.cameraRigMode === Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED,isCrossEye = camera.cameraRigMode === Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED,isInterlaced = camera.cameraRigMode === Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_INTERLACED */.V.RIG_MODE_STEREOSCOPIC_INTERLACED;isInterlaced ? (camera._rigCameras[0]._rigPostProcess = new passPostProcess/* PassPostProcess */.Q(camera.name + "_passthru", 1, camera._rigCameras[0]), camera._rigCameras[1]._rigPostProcess = new StereoscopicInterlacePostProcessI(camera.name + "_stereoInterlace", camera._rigCameras, !1, !0)) : (camera._rigCameras[isCrossEye ? 1 : 0].viewport = new math_viewport/* Viewport */.l(0, 0, isStereoscopicHoriz ? .5 : 1, isStereoscopicHoriz ? 1 : .5), camera._rigCameras[isCrossEye ? 0 : 1].viewport = new math_viewport/* Viewport */.l(isStereoscopicHoriz ? .5 : 0, isStereoscopicHoriz ? 0 : .5, isStereoscopicHoriz ? .5 : 1, isStereoscopicHoriz ? 1 : .5));}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("StereoscopicArcRotateCamera", (name, scene, options) => () => new StereoscopicArcRotateCamera(name, 0, 0, 1, math_vector/* Vector3.Zero */.P.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene));class StereoscopicArcRotateCamera extends ArcRotateCamera {constructor(name, alpha, beta, radius, target, interaxialDistance, isStereoscopicSideBySide, scene) {super(name, alpha, beta, radius, target, scene), this._setRigMode = setStereoscopicRigMode.bind(null, this), this.interaxialDistance = interaxialDistance, this.isStereoscopicSideBySide = isStereoscopicSideBySide, this.setCameraRigMode(isStereoscopicSideBySide ? Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER */.V.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: interaxialDistance });}getClassName() {return "StereoscopicArcRotateCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicFreeCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("StereoscopicFreeCamera", (name, scene, options) => () => new StereoscopicFreeCamera(name, math_vector/* Vector3.Zero */.P.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene));class StereoscopicFreeCamera extends Cameras_freeCamera/* FreeCamera */.c {constructor(name, position, interaxialDistance, isStereoscopicSideBySide, scene) {super(name, position, scene), this._setRigMode = setStereoscopicRigMode.bind(null, this), this.interaxialDistance = interaxialDistance, this.isStereoscopicSideBySide = isStereoscopicSideBySide, this.setCameraRigMode(isStereoscopicSideBySide ? Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER */.V.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: interaxialDistance });}getClassName() {return "StereoscopicFreeCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicGamepadCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("StereoscopicGamepadCamera", (name, scene, options) => () => new StereoscopicGamepadCamera(name, math_vector/* Vector3.Zero */.P.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene));class StereoscopicGamepadCamera extends GamepadCamera {constructor(name, position, interaxialDistance, isStereoscopicSideBySide, scene) {super(name, position, scene), this._setRigMode = setStereoscopicRigMode.bind(null, this), this.interaxialDistance = interaxialDistance, this.isStereoscopicSideBySide = isStereoscopicSideBySide, this.setCameraRigMode(isStereoscopicSideBySide ? Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER */.V.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: interaxialDistance });}getClassName() {return "StereoscopicGamepadCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicUniversalCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("StereoscopicFreeCamera", (name, scene, options) => () => new StereoscopicUniversalCamera(name, math_vector/* Vector3.Zero */.P.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene));class StereoscopicUniversalCamera extends UniversalCamera {constructor(name, position, interaxialDistance, isStereoscopicSideBySide, scene) {super(name, position, scene), this._setRigMode = setStereoscopicRigMode.bind(null, this), this.interaxialDistance = interaxialDistance, this.isStereoscopicSideBySide = isStereoscopicSideBySide, this.setCameraRigMode(isStereoscopicSideBySide ? Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER */.V.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: interaxialDistance });}getClassName() {return "StereoscopicUniversalCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js
class StereoscopicScreenUniversalCamera extends UniversalCamera {set distanceBetweenEyes(newValue) {this._distanceBetweenEyes = newValue;}get distanceBetweenEyes() {return this._distanceBetweenEyes;}set distanceToProjectionPlane(newValue) {this._distanceToProjectionPlane = newValue;}get distanceToProjectionPlane() {return this._distanceToProjectionPlane;}constructor(name, position, scene, distanceToProjectionPlane = 1, distanceBetweenEyes = .065) {super(name, position, scene), this._distanceBetweenEyes = distanceBetweenEyes, this._distanceToProjectionPlane = distanceToProjectionPlane, this.setCameraRigMode(Cameras_camera/* Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL */.V.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL, { stereoHalfAngle: 0 }), this._cameraRigParams.stereoHalfAngle = 0, this._cameraRigParams.interaxialDistance = distanceBetweenEyes;}getClassName() {return "StereoscopicUniversalCamera";}createRigCamera(name) {const camera = new targetCamera/* TargetCamera */.C(name, math_vector/* Vector3.Zero */.P.Zero(), this.getScene()),transform = new transformNode/* TransformNode */.Y("tm_" + name, this.getScene());return camera.parent = transform, transform.setPivotMatrix(math_vector/* Matrix.Identity */.y3.Identity(), !1), camera.isRigCamera = !0, camera.rigParent = this, camera;}_updateRigCameras() {for (let cameraIndex = 0; cameraIndex < this._rigCameras.length; cameraIndex++) {const cam = this._rigCameras[cameraIndex];cam.minZ = this.minZ, cam.maxZ = this.maxZ, cam.fov = this.fov, cam.upVector.copyFrom(this.upVector), cam.rotationQuaternion ? cam.rotationQuaternion.copyFrom(this.rotationQuaternion) : cam.rotation.copyFrom(this.rotation), this._updateCamera(this._rigCameras[cameraIndex], cameraIndex);}}_updateCamera(camera, cameraIndex) {const b = this.distanceBetweenEyes / 2,z = b / this.distanceToProjectionPlane;camera.position.copyFrom(this.position), camera.position.addInPlaceFromFloats(0 === cameraIndex ? -b : b, 0, -this._distanceToProjectionPlane);const transform = camera.parent,m = transform.getPivotMatrix();m.setTranslationFromFloats(0 === cameraIndex ? b : -b, 0, 0), m.setRowFromFloats(2, 0 === cameraIndex ? z : -z, 0, 1, 0), transform.setPivotMatrix(m, !1);}_setRigMode() {this._rigCameras[0].viewport = new math_viewport/* Viewport */.l(0, 0, .5, 1), this._rigCameras[1].viewport = new math_viewport/* Viewport */.l(.5, 0, .5, 1);for (let cameraIndex = 0; cameraIndex < this._rigCameras.length; cameraIndex++) this._updateCamera(this._rigCameras[cameraIndex], cameraIndex);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/Stereoscopic/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/virtualJoysticksCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("VirtualJoysticksCamera", (name, scene) => () => new VirtualJoysticksCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene));class VirtualJoysticksCamera extends Cameras_freeCamera/* FreeCamera */.c {constructor(name, position, scene) {super(name, position, scene), this.inputs.addVirtualJoystick();}getClassName() {return "VirtualJoysticksCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/VR/vrCameraMetrics.js
class VRCameraMetrics {constructor() {this.compensateDistortion = !0, this.multiviewEnabled = !1;}get aspectRatio() {return this.hResolution / (2 * this.vResolution);}get aspectRatioFov() {return 2 * Math.atan(this.postProcessScaleFactor * this.vScreenSize / (2 * this.eyeToScreenDistance));}get leftHMatrix() {const meters = this.hScreenSize / 4 - this.lensSeparationDistance / 2,h = 4 * meters / this.hScreenSize;return math_vector/* Matrix.Translation */.y3.Translation(h, 0, 0);}get rightHMatrix() {const meters = this.hScreenSize / 4 - this.lensSeparationDistance / 2,h = 4 * meters / this.hScreenSize;return math_vector/* Matrix.Translation */.y3.Translation(-h, 0, 0);}get leftPreViewMatrix() {return math_vector/* Matrix.Translation */.y3.Translation(.5 * this.interpupillaryDistance, 0, 0);}get rightPreViewMatrix() {return math_vector/* Matrix.Translation */.y3.Translation(-.5 * this.interpupillaryDistance, 0, 0);}static GetDefault() {const result = new VRCameraMetrics();return result.hResolution = 1280, result.vResolution = 800, result.hScreenSize = .149759993, result.vScreenSize = .0935999975, result.vScreenCenter = .0467999987, result.eyeToScreenDistance = .0410000011, result.lensSeparationDistance = .063500002, result.interpupillaryDistance = .064000003, result.distortionK = [1, .219999999, .239999995, 0], result.chromaAbCorrection = [.995999992, -.00400000019, 1.01400006, 0], result.postProcessScaleFactor = 1.714605507808412, result.lensCenterOffset = .151976421, result;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/vrDistortionCorrection.fragment.js
const vrDistortionCorrection_fragment_name = "vrDistortionCorrectionPixelShader",vrDistortionCorrection_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform vec2 LensCenter;
uniform vec2 Scale;
uniform vec2 ScaleIn;
uniform vec4 HmdWarpParam;
vec2 HmdWarp(vec2 in01) {
vec2 theta=(in01-LensCenter)*ScaleIn; 
float rSq=theta.x*theta.x+theta.y*theta.y;
vec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);
return LensCenter+Scale*rvector;
}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec2 tc=HmdWarp(vUV);
if (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)
gl_FragColor=vec4(0.0,0.0,0.0,0.0);
else{
gl_FragColor=texture2D(textureSampler,tc);
}
}`;shaderStore/* ShaderStore.ShadersStore.vrDistortionCorrectionPixelShader */.v.ShadersStore.vrDistortionCorrectionPixelShader = vrDistortionCorrection_fragment_shader;const vrDistortionCorrectionPixelShader = { name: "vrDistortionCorrectionPixelShader", shader: vrDistortionCorrection_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/vrDistortionCorrectionPostProcess.js
class VRDistortionCorrectionPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "VRDistortionCorrectionPostProcess";}constructor(name, camera, isRightEye, vrMetrics) {super(name, "vrDistortionCorrection", ["LensCenter", "Scale", "ScaleIn", "HmdWarpParam"], null, vrMetrics.postProcessScaleFactor, camera, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE), this._isRightEye = isRightEye, this._distortionFactors = vrMetrics.distortionK, this._postProcessScaleFactor = vrMetrics.postProcessScaleFactor, this._lensCenterOffset = vrMetrics.lensCenterOffset, this.adaptScaleToCurrentViewport = !0, this.onSizeChangedObservable.add(() => {this._scaleIn = new math_vector/* Vector2 */.FM(2, 2 / this.aspectRatio), this._scaleFactor = new math_vector/* Vector2 */.FM(.5 * (1 / this._postProcessScaleFactor), .5 * (1 / this._postProcessScaleFactor) * this.aspectRatio), this._lensCenter = new math_vector/* Vector2 */.FM(this._isRightEye ? .5 - .5 * this._lensCenterOffset : .5 + .5 * this._lensCenterOffset, .5);}), this.onApplyObservable.add((effect) => {effect.setFloat2("LensCenter", this._lensCenter.x, this._lensCenter.y), effect.setFloat2("Scale", this._scaleFactor.x, this._scaleFactor.y), effect.setFloat2("ScaleIn", this._scaleIn.x, this._scaleIn.y), effect.setFloat4("HmdWarpParam", this._distortionFactors[0], this._distortionFactors[1], this._distortionFactors[2], this._distortionFactors[3]);});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/vrMultiviewToSingleview.fragment.js
const vrMultiviewToSingleview_fragment_name = "vrMultiviewToSingleviewPixelShader",vrMultiviewToSingleview_fragment_shader = `precision mediump sampler2DArray;
varying vec2 vUV;
uniform sampler2DArray multiviewSampler;
uniform int imageIndex;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
gl_FragColor=texture2D(multiviewSampler,vec3(vUV,imageIndex));
}`;shaderStore/* ShaderStore.ShadersStore.vrMultiviewToSingleviewPixelShader */.v.ShadersStore.vrMultiviewToSingleviewPixelShader = vrMultiviewToSingleview_fragment_shader;const vrMultiviewToSingleviewPixelShader = { name: "vrMultiviewToSingleviewPixelShader", shader: vrMultiviewToSingleview_fragment_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js
var Textures_internalTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/uniformBuffer.js
var uniformBuffer = __webpack_require__("./node_modules/@babylonjs/core/Materials/uniformBuffer.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/MultiviewRenderTarget.js
class MultiviewRenderTarget extends Textures_renderTargetTexture/* RenderTargetTexture */._ {set samples(value) {this._samples = value;}get samples() {return this._samples;}constructor(scene, size = 512) {super("multiview rtt", size, scene, !1, !0, 0, !1, void 0, !1, !1, !0, void 0, !0), this._renderTarget = this.getScene().getEngine().createMultiviewRenderTargetTexture(this.getRenderWidth(), this.getRenderHeight()), this._texture = this._renderTarget.texture, this._texture.isMultiview = !0, this._texture.format = 5, this.samples = this._getEngine().getCaps().maxSamples || this.samples, this._texture.samples = this._samples;}_bindFrameBuffer() {this._renderTarget && this.getScene().getEngine().bindMultiviewFramebuffer(this._renderTarget);}getViewCount() {return 2;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.frustum.js
var math_frustum = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.frustum.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.multiview.js
engine/* Engine.prototype.createMultiviewRenderTargetTexture */.D.prototype.createMultiviewRenderTargetTexture = function (width, height) {const gl = this._gl;if (!this.getCaps().multiview) throw "Multiview is not supported";const rtWrapper = this._createHardwareRenderTargetWrapper(!1, !1, { width, height });rtWrapper._framebuffer = gl.createFramebuffer();const internalTexture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Unknown */.S.Unknown, !0);return internalTexture.width = width, internalTexture.height = height, internalTexture.isMultiview = !0, rtWrapper._colorTextureArray = gl.createTexture(), gl.bindTexture(gl.TEXTURE_2D_ARRAY, rtWrapper._colorTextureArray), gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.RGBA8, width, height, 2), rtWrapper._depthStencilTextureArray = gl.createTexture(), gl.bindTexture(gl.TEXTURE_2D_ARRAY, rtWrapper._depthStencilTextureArray), gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.DEPTH24_STENCIL8, width, height, 2), internalTexture.isReady = !0, rtWrapper.setTextures(internalTexture), rtWrapper._depthStencilTexture = internalTexture, rtWrapper;}, engine/* Engine.prototype.bindMultiviewFramebuffer */.D.prototype.bindMultiviewFramebuffer = function (_multiviewTexture) {const multiviewTexture = _multiviewTexture,gl = this._gl,ext = this.getCaps().oculusMultiview || this.getCaps().multiview;if (this.bindFramebuffer(multiviewTexture, void 0, void 0, void 0, !0), gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, multiviewTexture._framebuffer), multiviewTexture._colorTextureArray && multiviewTexture._depthStencilTextureArray) this.getCaps().oculusMultiview ? (ext.framebufferTextureMultisampleMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, multiviewTexture._colorTextureArray, 0, multiviewTexture.samples, 0, 2), ext.framebufferTextureMultisampleMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, multiviewTexture._depthStencilTextureArray, 0, multiviewTexture.samples, 0, 2)) : (ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, multiviewTexture._colorTextureArray, 0, 0, 2), ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, multiviewTexture._depthStencilTextureArray, 0, 0, 2));else throw "Invalid multiview frame buffer";}, Cameras_camera/* Camera.prototype._useMultiviewToSingleView */.V.prototype._useMultiviewToSingleView = !1, Cameras_camera/* Camera.prototype._multiviewTexture */.V.prototype._multiviewTexture = null, Cameras_camera/* Camera.prototype._resizeOrCreateMultiviewTexture */.V.prototype._resizeOrCreateMultiviewTexture = function (width, height) {this._multiviewTexture ? (this._multiviewTexture.getRenderWidth() != width || this._multiviewTexture.getRenderHeight() != height) && (this._multiviewTexture.dispose(), this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height })) : this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height });};function createMultiviewUbo(engine, name) {const ubo = new uniformBuffer/* UniformBuffer */.M(engine, void 0, !0, name);return ubo.addUniform("viewProjection", 16), ubo.addUniform("viewProjectionR", 16), ubo.addUniform("view", 16), ubo.addUniform("projection", 16), ubo.addUniform("vEyePosition", 4), ubo;}const currentCreateSceneUniformBuffer = core_scene/* Scene.prototype.createSceneUniformBuffer */.x.prototype.createSceneUniformBuffer;core_scene/* Scene.prototype._transformMatrixR */.x.prototype._transformMatrixR = math_vector/* Matrix.Zero */.y3.Zero(), core_scene/* Scene.prototype._multiviewSceneUbo */.x.prototype._multiviewSceneUbo = null, core_scene/* Scene.prototype._createMultiviewUbo */.x.prototype._createMultiviewUbo = function () {this._multiviewSceneUbo = createMultiviewUbo(this.getEngine(), "scene_multiview");}, core_scene/* Scene.prototype.createSceneUniformBuffer */.x.prototype.createSceneUniformBuffer = function (name) {return this._multiviewSceneUbo ? createMultiviewUbo(this.getEngine(), name) : currentCreateSceneUniformBuffer.bind(this)(name);}, core_scene/* Scene.prototype._updateMultiviewUbo */.x.prototype._updateMultiviewUbo = function (viewR, projectionR) {viewR && projectionR && viewR.multiplyToRef(projectionR, this._transformMatrixR), viewR && projectionR && (viewR.multiplyToRef(projectionR, math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), math_frustum/* Frustum.GetRightPlaneToRef */.i.GetRightPlaneToRef(math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0], this._frustumPlanes[3])), this._multiviewSceneUbo && (this._multiviewSceneUbo.updateMatrix("viewProjection", this.getTransformMatrix()), this._multiviewSceneUbo.updateMatrix("viewProjectionR", this._transformMatrixR), this._multiviewSceneUbo.updateMatrix("view", this._viewMatrix), this._multiviewSceneUbo.updateMatrix("projection", this._projectionMatrix));}, core_scene/* Scene.prototype._renderMultiviewToSingleView */.x.prototype._renderMultiviewToSingleView = function (camera) {camera._resizeOrCreateMultiviewTexture(camera._rigPostProcess && camera._rigPostProcess && 0 < camera._rigPostProcess.width ? camera._rigPostProcess.width : this.getEngine().getRenderWidth(!0), camera._rigPostProcess && camera._rigPostProcess && 0 < camera._rigPostProcess.height ? camera._rigPostProcess.height : this.getEngine().getRenderHeight(!0)), this._multiviewSceneUbo || this._createMultiviewUbo(), camera.outputRenderTarget = camera._multiviewTexture, this._renderForCamera(camera), camera.outputRenderTarget = null;for (let index = 0; index < camera._rigCameras.length; index++) {const engine = this.getEngine();this._activeCamera = camera._rigCameras[index], engine.setViewport(this._activeCamera.viewport), this.postProcessManager && (this.postProcessManager._prepareFrame(), this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate));}};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/vrMultiviewToSingleviewPostProcess.js
class VRMultiviewToSingleviewPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "VRMultiviewToSingleviewPostProcess";}constructor(name, camera, scaleFactor) {super(name, "vrMultiviewToSingleview", ["imageIndex"], ["multiviewSampler"], scaleFactor, camera, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE);const cam = null !== camera && void 0 !== camera ? camera : this.getCamera();this.onSizeChangedObservable.add(() => {}), this.onApplyObservable.add((effect) => {cam._scene.activeCamera && cam._scene.activeCamera.isLeftCamera ? effect.setInt("imageIndex", 0) : effect.setInt("imageIndex", 1), effect.setTexture("multiviewSampler", cam._multiviewTexture);});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/RigModes/vrRigMode.js
function setVRRigMode(camera, rigParams) {const metrics = rigParams.vrCameraMetrics || VRCameraMetrics.GetDefault();camera._rigCameras[0]._cameraRigParams.vrMetrics = metrics, camera._rigCameras[0].viewport = new math_viewport/* Viewport */.l(0, 0, .5, 1), camera._rigCameras[0]._cameraRigParams.vrWorkMatrix = new math_vector/* Matrix */.y3(), camera._rigCameras[0]._cameraRigParams.vrHMatrix = metrics.leftHMatrix, camera._rigCameras[0]._cameraRigParams.vrPreViewMatrix = metrics.leftPreViewMatrix, camera._rigCameras[0].getProjectionMatrix = camera._rigCameras[0]._getVRProjectionMatrix, camera._rigCameras[1]._cameraRigParams.vrMetrics = metrics, camera._rigCameras[1].viewport = new math_viewport/* Viewport */.l(.5, 0, .5, 1), camera._rigCameras[1]._cameraRigParams.vrWorkMatrix = new math_vector/* Matrix */.y3(), camera._rigCameras[1]._cameraRigParams.vrHMatrix = metrics.rightHMatrix, camera._rigCameras[1]._cameraRigParams.vrPreViewMatrix = metrics.rightPreViewMatrix, camera._rigCameras[1].getProjectionMatrix = camera._rigCameras[1]._getVRProjectionMatrix, metrics.multiviewEnabled && (camera.getScene().getEngine().getCaps().multiview ? (camera._useMultiviewToSingleView = !0, camera._rigPostProcess = new VRMultiviewToSingleviewPostProcess("VRMultiviewToSingleview", camera, metrics.postProcessScaleFactor)) : (logger/* Logger.Warn */.Y.Warn("Multiview is not supported, falling back to standard rendering"), metrics.multiviewEnabled = !1)), metrics.compensateDistortion && (camera._rigCameras[0]._rigPostProcess = new VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left", camera._rigCameras[0], !1, metrics), camera._rigCameras[1]._rigPostProcess = new VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right", camera._rigCameras[1], !0, metrics));}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationArcRotateCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("VRDeviceOrientationArcRotateCamera", (name, scene) => () => new VRDeviceOrientationArcRotateCamera(name, 0, 0, 1, math_vector/* Vector3.Zero */.P.Zero(), scene));class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {constructor(name, alpha, beta, radius, target, scene, compensateDistortion = !0, vrCameraMetrics = VRCameraMetrics.GetDefault()) {super(name, alpha, beta, radius, target, scene), this._setRigMode = setVRRigMode.bind(null, this), vrCameraMetrics.compensateDistortion = compensateDistortion, this.setCameraRigMode(Cameras_camera/* Camera.RIG_MODE_VR */.V.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics }), this.inputs.addVRDeviceOrientation();}getClassName() {return "VRDeviceOrientationArcRotateCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationFreeCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("VRDeviceOrientationFreeCamera", (name, scene) => () => new VRDeviceOrientationFreeCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene));class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera {constructor(name, position, scene, compensateDistortion = !0, vrCameraMetrics = VRCameraMetrics.GetDefault()) {super(name, position, scene), this._setRigMode = setVRRigMode.bind(null, this), vrCameraMetrics.compensateDistortion = compensateDistortion, this.setCameraRigMode(Cameras_camera/* Camera.RIG_MODE_VR */.V.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics });}getClassName() {return "VRDeviceOrientationFreeCamera";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationGamepadCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("VRDeviceOrientationGamepadCamera", (name, scene) => () => new VRDeviceOrientationGamepadCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene));class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCamera {constructor(name, position, scene, compensateDistortion = !0, vrCameraMetrics = VRCameraMetrics.GetDefault()) {super(name, position, scene, compensateDistortion, vrCameraMetrics), this._setRigMode = setVRRigMode.bind(null, this), this.inputs.addGamepad();}getClassName() {return "VRDeviceOrientationGamepadCamera";}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/hemisphericLight.js
var hemisphericLight = __webpack_require__("./node_modules/@babylonjs/core/Lights/hemisphericLight.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/RigModes/webVRRigMode.js
function setWebVRRigMode(camera, rigParams) {if (rigParams.vrDisplay) {const leftEye = rigParams.vrDisplay.getEyeParameters("left"),rightEye = rigParams.vrDisplay.getEyeParameters("right");camera._rigCameras[0].viewport = new math_viewport/* Viewport */.l(0, 0, .5, 1), camera._rigCameras[0].setCameraRigParameter("left", !0), camera._rigCameras[0].setCameraRigParameter("specs", rigParams.specs), camera._rigCameras[0].setCameraRigParameter("eyeParameters", leftEye), camera._rigCameras[0].setCameraRigParameter("frameData", rigParams.frameData), camera._rigCameras[0].setCameraRigParameter("parentCamera", rigParams.parentCamera), camera._rigCameras[0]._cameraRigParams.vrWorkMatrix = new math_vector/* Matrix */.y3(), camera._rigCameras[0].getProjectionMatrix = camera._getWebVRProjectionMatrix, camera._rigCameras[0].parent = camera, camera._rigCameras[0]._getViewMatrix = camera._getWebVRViewMatrix, camera._rigCameras[1].viewport = new math_viewport/* Viewport */.l(.5, 0, .5, 1), camera._rigCameras[1].setCameraRigParameter("eyeParameters", rightEye), camera._rigCameras[1].setCameraRigParameter("specs", rigParams.specs), camera._rigCameras[1].setCameraRigParameter("frameData", rigParams.frameData), camera._rigCameras[1].setCameraRigParameter("parentCamera", rigParams.parentCamera), camera._rigCameras[1]._cameraRigParams.vrWorkMatrix = new math_vector/* Matrix */.y3(), camera._rigCameras[1].getProjectionMatrix = camera._getWebVRProjectionMatrix, camera._rigCameras[1].parent = camera, camera._rigCameras[1]._getViewMatrix = camera._getWebVRViewMatrix;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.webVR.js
Object.defineProperty(engine/* Engine.prototype */.D.prototype, "isInVRExclusivePointerMode", { get: function () {return this._vrExclusivePointerMode;}, enumerable: !0, configurable: !0 }), engine/* Engine.prototype._prepareVRComponent */.D.prototype._prepareVRComponent = function () {this._vrSupported = !1, this._vrExclusivePointerMode = !1, this.onVRDisplayChangedObservable = new observable/* Observable */.y$(), this.onVRRequestPresentComplete = new observable/* Observable */.y$(), this.onVRRequestPresentStart = new observable/* Observable */.y$();}, engine/* Engine.prototype.isVRDevicePresent */.D.prototype.isVRDevicePresent = function () {return !!this._vrDisplay;}, engine/* Engine.prototype.getVRDevice */.D.prototype.getVRDevice = function () {return this._vrDisplay;}, engine/* Engine.prototype.initWebVR */.D.prototype.initWebVR = function () {return this.initWebVRAsync(), this.onVRDisplayChangedObservable;}, engine/* Engine.prototype.initWebVRAsync */.D.prototype.initWebVRAsync = function () {const notifyObservers = () => {const eventArgs = { vrDisplay: this._vrDisplay, vrSupported: this._vrSupported };this.onVRDisplayChangedObservable.notifyObservers(eventArgs), this._webVRInitPromise = new Promise((res) => {res(eventArgs);});};if (!this._onVrDisplayConnect) {this._onVrDisplayConnect = (event) => {this._vrDisplay = event.display, notifyObservers();}, this._onVrDisplayDisconnect = () => {this._vrDisplay.cancelAnimationFrame(this._frameHandler), this._vrDisplay = void 0, this._frameHandler = engine/* Engine.QueueNewFrame */.D.QueueNewFrame(this._boundRenderFunction), notifyObservers();}, this._onVrDisplayPresentChange = () => {this._vrExclusivePointerMode = this._vrDisplay && this._vrDisplay.isPresenting;};const hostWindow = this.getHostWindow();hostWindow && (hostWindow.addEventListener("vrdisplayconnect", this._onVrDisplayConnect), hostWindow.addEventListener("vrdisplaydisconnect", this._onVrDisplayDisconnect), hostWindow.addEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChange));}return this._webVRInitPromise = this._webVRInitPromise || this._getVRDisplaysAsync(), this._webVRInitPromise.then(notifyObservers), this._webVRInitPromise;}, engine/* Engine.prototype._getVRDisplaysAsync */.D.prototype._getVRDisplaysAsync = function () {return new Promise((res) => {navigator.getVRDisplays ? navigator.getVRDisplays().then((devices) => {this._vrSupported = !0, this._vrDisplay = devices[0], res({ vrDisplay: this._vrDisplay, vrSupported: this._vrSupported });}) : (this._vrDisplay = void 0, this._vrSupported = !1, res({ vrDisplay: this._vrDisplay, vrSupported: this._vrSupported }));});}, engine/* Engine.prototype.enableVR */.D.prototype.enableVR = function (options) {if (this._vrDisplay && !this._vrDisplay.isPresenting) {const onResolved = () => {this.onVRRequestPresentComplete.notifyObservers(!0), this._onVRFullScreenTriggered();},onRejected = () => {this.onVRRequestPresentComplete.notifyObservers(!1);};this.onVRRequestPresentStart.notifyObservers(this);const presentationAttributes = { highRefreshRate: !!this.vrPresentationAttributes && this.vrPresentationAttributes.highRefreshRate, foveationLevel: this.vrPresentationAttributes ? this.vrPresentationAttributes.foveationLevel : 1, multiview: (this.getCaps().multiview || this.getCaps().oculusMultiview) && options.useMultiview };this._vrDisplay.requestPresent([{ source: this.getRenderingCanvas(), attributes: presentationAttributes, ...presentationAttributes }]).then(onResolved).catch(onRejected);}}, engine/* Engine.prototype._onVRFullScreenTriggered */.D.prototype._onVRFullScreenTriggered = function () {if (this._vrDisplay && this._vrDisplay.isPresenting) {this._oldSize = new math_size/* Size */.$(this.getRenderWidth(), this.getRenderHeight()), this._oldHardwareScaleFactor = this.getHardwareScalingLevel();const leftEye = this._vrDisplay.getEyeParameters("left");this.setHardwareScalingLevel(1), this.setSize(2 * leftEye.renderWidth, leftEye.renderHeight);} else this.setHardwareScalingLevel(this._oldHardwareScaleFactor), this.setSize(this._oldSize.width, this._oldSize.height);}, engine/* Engine.prototype.disableVR */.D.prototype.disableVR = function () {this._vrDisplay && this._vrDisplay.isPresenting && this._vrDisplay.exitPresent().then(() => this._onVRFullScreenTriggered()).catch(() => this._onVRFullScreenTriggered()), (0,domManagement/* IsWindowObjectExist */.CG)() && (window.removeEventListener("vrdisplaypointerrestricted", this._onVRDisplayPointerRestricted), window.removeEventListener("vrdisplaypointerunrestricted", this._onVRDisplayPointerUnrestricted), this._onVrDisplayConnect && (window.removeEventListener("vrdisplayconnect", this._onVrDisplayConnect), this._onVrDisplayDisconnect && window.removeEventListener("vrdisplaydisconnect", this._onVrDisplayDisconnect), this._onVrDisplayPresentChange && window.removeEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChange), this._onVrDisplayConnect = null, this._onVrDisplayDisconnect = null));}, engine/* Engine.prototype._connectVREvents */.D.prototype._connectVREvents = function (canvas, document) {if (this._onVRDisplayPointerRestricted = () => {canvas && canvas.requestPointerLock();}, this._onVRDisplayPointerUnrestricted = () => {if (!document) {const hostWindow = this.getHostWindow();return void (hostWindow.document && hostWindow.document.exitPointerLock && hostWindow.document.exitPointerLock());}document.exitPointerLock && document.exitPointerLock();}, (0,domManagement/* IsWindowObjectExist */.CG)()) {const hostWindow = this.getHostWindow();hostWindow.addEventListener("vrdisplaypointerrestricted", this._onVRDisplayPointerRestricted, !1), hostWindow.addEventListener("vrdisplaypointerunrestricted", this._onVRDisplayPointerUnrestricted, !1);}}, engine/* Engine.prototype._submitVRFrame */.D.prototype._submitVRFrame = function () {if (this._vrDisplay && this._vrDisplay.isPresenting) try {this._vrDisplay.submitFrame();} catch (e) {tools/* Tools.Warn */.w1.Warn("webVR submitFrame has had an unexpected failure: " + e);}}, engine/* Engine.prototype.isVRPresenting */.D.prototype.isVRPresenting = function () {return this._vrDisplay && this._vrDisplay.isPresenting;}, engine/* Engine.prototype._requestVRFrame */.D.prototype._requestVRFrame = function () {this._frameHandler = engine/* Engine.QueueNewFrame */.D.QueueNewFrame(this._boundRenderFunction, this._vrDisplay);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/VR/webVRCamera.js
node/* Node.AddNodeConstructor */.N.AddNodeConstructor("WebVRFreeCamera", (name, scene) => () => new WebVRFreeCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene)), node/* Node.AddNodeConstructor */.N.AddNodeConstructor("WebVRGamepadCamera", (name, scene) => () => new WebVRFreeCamera(name, math_vector/* Vector3.Zero */.P.Zero(), scene));class WebVRFreeCamera extends Cameras_freeCamera/* FreeCamera */.c {constructor(name, position, scene, _webVROptions = {}) {super(name, position, scene), this._webVROptions = _webVROptions, this._vrDevice = null, this.rawPose = null, this._specsVersion = "1.1", this._attached = !1, this._descendants = [], this._deviceRoomPosition = math_vector/* Vector3.Zero */.P.Zero(), this._deviceRoomRotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this._standingMatrix = null, this.devicePosition = math_vector/* Vector3.Zero */.P.Zero(), this.deviceRotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this.deviceScaleFactor = 1, this._deviceToWorld = math_vector/* Matrix.Identity */.y3.Identity(), this._worldToDevice = math_vector/* Matrix.Identity */.y3.Identity(), this.controllers = [], this.onControllersAttachedObservable = new observable/* Observable */.y$(), this.onControllerMeshLoadedObservable = new observable/* Observable */.y$(), this.onPoseUpdatedFromDeviceObservable = new observable/* Observable */.y$(), this._poseSet = !1, this.rigParenting = !0, this._defaultHeight = void 0, this._setRigMode = setWebVRRigMode.bind(null, this), this._detachIfAttached = () => {const vrDisplay = this.getEngine().getVRDevice();vrDisplay && !vrDisplay.isPresenting && this.detachControl();}, this._workingVector = math_vector/* Vector3.Zero */.P.Zero(), this._oneVector = math_vector/* Vector3.One */.P.One(), this._workingMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this._tmpMatrix = new math_vector/* Matrix */.y3(), this._cache.position = math_vector/* Vector3.Zero */.P.Zero(), _webVROptions.defaultHeight && (this._defaultHeight = _webVROptions.defaultHeight, this.position.y = this._defaultHeight), this.minZ = .1, 5 === arguments.length && (this._webVROptions = arguments[4]), this._webVROptions.trackPosition == null && (this._webVROptions.trackPosition = !0), this._webVROptions.controllerMeshes == null && (this._webVROptions.controllerMeshes = !0), this._webVROptions.defaultLightingOnControllers == null && (this._webVROptions.defaultLightingOnControllers = !0), this.rotationQuaternion = new math_vector/* Quaternion */._f(), this._webVROptions && this._webVROptions.positionScale && (this.deviceScaleFactor = this._webVROptions.positionScale);const engine = this.getEngine();this._onVREnabled = (success) => {success && this.initControllers();}, engine.onVRRequestPresentComplete.add(this._onVREnabled), engine.initWebVR().add((event) => {event.vrDisplay && this._vrDevice !== event.vrDisplay && (this._vrDevice = event.vrDisplay, this.setCameraRigMode(Cameras_camera/* Camera.RIG_MODE_WEBVR */.V.RIG_MODE_WEBVR, { parentCamera: this, vrDisplay: this._vrDevice, frameData: this._frameData, specs: this._specsVersion }), this._attached && this.getEngine().enableVR(this._webVROptions));}), "undefined" != typeof VRFrameData && (this._frameData = new VRFrameData()), _webVROptions.useMultiview && (this.getScene().getEngine().getCaps().multiview ? (this._useMultiviewToSingleView = !0, this._rigPostProcess = new VRMultiviewToSingleviewPostProcess("VRMultiviewToSingleview", this, 1)) : (logger/* Logger.Warn */.Y.Warn("Multiview is not supported, falling back to standard rendering"), this._useMultiviewToSingleView = !1)), this.getScene().onBeforeCameraRenderObservable.add((camera) => {camera.parent === this && this.rigParenting && (this._descendants = this.getDescendants(!0, (n) => {const isController = this.controllers.some((controller) => controller._mesh === n),isRigCamera = -1 !== this._rigCameras.indexOf(n);return !isController && !isRigCamera;}), this._descendants.forEach((node) => {node.parent = camera;}));}), this.getScene().onAfterCameraRenderObservable.add((camera) => {camera.parent === this && this.rigParenting && this._descendants.forEach((node) => {node.parent = this;});});}deviceDistanceToRoomGround() {return this._standingMatrix ? (this._standingMatrix.getTranslationToRef(this._workingVector), this._deviceRoomPosition.y + this._workingVector.y) : this._defaultHeight || 0;}useStandingMatrix(callback = () => {}) {this.getEngine().initWebVRAsync().then((result) => {result.vrDisplay && result.vrDisplay.stageParameters && result.vrDisplay.stageParameters.sittingToStandingTransform && this._webVROptions.trackPosition ? (this._standingMatrix = new math_vector/* Matrix */.y3(), math_vector/* Matrix.FromFloat32ArrayToRefScaled */.y3.FromFloat32ArrayToRefScaled(result.vrDisplay.stageParameters.sittingToStandingTransform, 0, 1, this._standingMatrix), !this.getScene().useRightHandedSystem && this._standingMatrix && this._standingMatrix.toggleModelMatrixHandInPlace(), callback(!0)) : callback(!1);});}useStandingMatrixAsync() {return new Promise((res) => {this.useStandingMatrix((supported) => {res(supported);});});}dispose() {this._detachIfAttached(), this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled), this._updateCacheWhenTrackingDisabledObserver && this._scene.onBeforeRenderObservable.remove(this._updateCacheWhenTrackingDisabledObserver), super.dispose();}getControllerByName(name) {for (const gp of this.controllers) if (gp.hand === name) return gp;return null;}get leftController() {return this._leftController || (this._leftController = this.getControllerByName("left")), this._leftController;}get rightController() {return this._rightController || (this._rightController = this.getControllerByName("right")), this._rightController;}getForwardRay(length = 100) {return this.leftCamera ? super.getForwardRay(length, this.leftCamera.getWorldMatrix(), this.leftCamera.globalPosition) : super.getForwardRay(length);}_checkInputs() {this._vrDevice && this._vrDevice.isPresenting && (this._vrDevice.getFrameData(this._frameData), this.updateFromDevice(this._frameData.pose)), super._checkInputs();}updateFromDevice(poseData) {poseData && poseData.orientation && 4 === poseData.orientation.length && (this.rawPose = poseData, this._deviceRoomRotationQuaternion.copyFromFloats(poseData.orientation[0], poseData.orientation[1], -poseData.orientation[2], -poseData.orientation[3]), this.getScene().useRightHandedSystem && (this._deviceRoomRotationQuaternion.z *= -1, this._deviceRoomRotationQuaternion.w *= -1), this._webVROptions.trackPosition && this.rawPose.position && (this._deviceRoomPosition.copyFromFloats(this.rawPose.position[0], this.rawPose.position[1], -this.rawPose.position[2]), this.getScene().useRightHandedSystem && (this._deviceRoomPosition.z *= -1)), this._poseSet = !0);}attachControl(noPreventDefault) {noPreventDefault = tools/* Tools.BackCompatCameraNoPreventDefault */.w1.BackCompatCameraNoPreventDefault(arguments), super.attachControl(noPreventDefault), this._attached = !0, noPreventDefault = !Cameras_camera/* Camera.ForceAttachControlToAlwaysPreventDefault */.V.ForceAttachControlToAlwaysPreventDefault && noPreventDefault, this._vrDevice && this.getEngine().enableVR(this._webVROptions);const hostWindow = this._scene.getEngine().getHostWindow();hostWindow && hostWindow.addEventListener("vrdisplaypresentchange", this._detachIfAttached);}detachControl() {this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), super.detachControl(), this._attached = !1, this.getEngine().disableVR(), window.removeEventListener("vrdisplaypresentchange", this._detachIfAttached);}getClassName() {return "WebVRFreeCamera";}resetToCurrentRotation() {this._vrDevice.resetPose();}_updateRigCameras() {const camLeft = this._rigCameras[0],camRight = this._rigCameras[1];camLeft.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion), camRight.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion), camLeft.position.copyFrom(this._deviceRoomPosition), camRight.position.copyFrom(this._deviceRoomPosition);}_correctPositionIfNotTrackPosition(matrix, isViewMatrix = !1) {this.rawPose && this.rawPose.position && !this._webVROptions.trackPosition && (math_vector/* Matrix.TranslationToRef */.y3.TranslationToRef(this.rawPose.position[0], this.rawPose.position[1], -this.rawPose.position[2], this._tmpMatrix), !isViewMatrix && this._tmpMatrix.invert(), this._tmpMatrix.multiplyToRef(matrix, matrix));}_updateCache(ignoreParentClass) {this.rotationQuaternion.equals(this._cache.rotationQuaternion) && this.position.equals(this._cache.position) || (!this._updateCacheCalled && (this._updateCacheCalled = !0, this.update()), this.rotationQuaternion.toRotationMatrix(this._workingMatrix), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._deviceRoomPosition, this._workingMatrix, this._workingVector), this.devicePosition.subtractToRef(this._workingVector, this._workingVector), math_vector/* Matrix.ComposeToRef */.y3.ComposeToRef(this._oneVector, this.rotationQuaternion, this._workingVector, this._deviceToWorld), this._deviceToWorld.getTranslationToRef(this._workingVector), this._workingVector.addInPlace(this.position), this._workingVector.subtractInPlace(this._cache.position), this._deviceToWorld.setTranslation(this._workingVector), this._deviceToWorld.invertToRef(this._worldToDevice), this.controllers.forEach((controller) => {controller._deviceToWorld.copyFrom(this._deviceToWorld), this._correctPositionIfNotTrackPosition(controller._deviceToWorld), controller.update();})), ignoreParentClass || super._updateCache(), this._updateCacheCalled = !1;}_computeDevicePosition() {math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._deviceRoomPosition, this._deviceToWorld, this.devicePosition);}update() {this._computeDevicePosition(), math_vector/* Matrix.FromQuaternionToRef */.y3.FromQuaternionToRef(this._deviceRoomRotationQuaternion, this._workingMatrix), this._workingMatrix.multiplyToRef(this._deviceToWorld, this._workingMatrix), math_vector/* Quaternion.FromRotationMatrixToRef */._f.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion), this._poseSet && this.onPoseUpdatedFromDeviceObservable.notifyObservers(null), super.update();}_getViewMatrix() {return math_vector/* Matrix.Identity */.y3.Identity();}_getWebVRViewMatrix() {const parentCamera = this._cameraRigParams.parentCamera;parentCamera._updateCache();const viewArray = this._cameraRigParams.left ? this._cameraRigParams.frameData.leftViewMatrix : this._cameraRigParams.frameData.rightViewMatrix;return math_vector/* Matrix.FromArrayToRef */.y3.FromArrayToRef(viewArray, 0, this._webvrViewMatrix), this.getScene().useRightHandedSystem || this._webvrViewMatrix.toggleModelMatrixHandInPlace(), this._webvrViewMatrix.getRotationMatrixToRef(this._cameraRotationMatrix), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint), this.position.addToRef(this._transformedReferencePoint, this._currentTarget), 1 !== parentCamera.deviceScaleFactor && (this._webvrViewMatrix.invert(), parentCamera.deviceScaleFactor && (this._webvrViewMatrix.multiplyAtIndex(12, parentCamera.deviceScaleFactor), this._webvrViewMatrix.multiplyAtIndex(13, parentCamera.deviceScaleFactor), this._webvrViewMatrix.multiplyAtIndex(14, parentCamera.deviceScaleFactor)), this._webvrViewMatrix.invert()), parentCamera._correctPositionIfNotTrackPosition(this._webvrViewMatrix, !0), parentCamera._worldToDevice.multiplyToRef(this._webvrViewMatrix, this._webvrViewMatrix), this._workingMatrix = this._workingMatrix || math_vector/* Matrix.Identity */.y3.Identity(), this._webvrViewMatrix.invertToRef(this._workingMatrix), this._workingMatrix.multiplyToRef(parentCamera.getWorldMatrix(), this._workingMatrix), this._workingMatrix.getTranslationToRef(this._globalPosition), this._markSyncedWithParent(), this._webvrViewMatrix;}_getWebVRProjectionMatrix() {const parentCamera = this.parent;parentCamera._vrDevice.depthNear = parentCamera.minZ, parentCamera._vrDevice.depthFar = parentCamera.maxZ;const projectionArray = this._cameraRigParams.left ? this._cameraRigParams.frameData.leftProjectionMatrix : this._cameraRigParams.frameData.rightProjectionMatrix;return math_vector/* Matrix.FromArrayToRef */.y3.FromArrayToRef(projectionArray, 0, this._projectionMatrix), this.getScene().useRightHandedSystem || this._projectionMatrix.toggleProjectionMatrixHandInPlace(), this._projectionMatrix;}initControllers() {this.controllers.length = 0;const manager = this.getScene().gamepadManager;this._onGamepadDisconnectedObserver = manager.onGamepadDisconnectedObservable.add((gamepad) => {if (gamepad.type === Gamepad.POSE_ENABLED) {const webVrController = gamepad;webVrController.defaultModel && webVrController.defaultModel.setEnabled(!1), "right" === webVrController.hand && (this._rightController = null), "left" === webVrController.hand && (this._leftController = null);const controllerIndex = this.controllers.indexOf(webVrController);-1 !== controllerIndex && this.controllers.splice(controllerIndex, 1);}}), this._onGamepadConnectedObserver = manager.onGamepadConnectedObservable.add((gamepad) => {if (gamepad.type === Gamepad.POSE_ENABLED) {const webVrController = gamepad;if (this._webVROptions.trackPosition || (webVrController._disableTrackPosition(new math_vector/* Vector3 */.P("left" == webVrController.hand ? -.15 : .15, -.5, .25)), !this._updateCacheWhenTrackingDisabledObserver && (this._updateCacheWhenTrackingDisabledObserver = this._scene.onBeforeRenderObservable.add(() => {this._updateCache();}))), webVrController.deviceScaleFactor = this.deviceScaleFactor, webVrController._deviceToWorld.copyFrom(this._deviceToWorld), this._correctPositionIfNotTrackPosition(webVrController._deviceToWorld), this._webVROptions.controllerMeshes && (webVrController.defaultModel ? webVrController.defaultModel.setEnabled(!0) : webVrController.initControllerMesh(this.getScene(), (loadedMesh) => {if (loadedMesh.scaling.scaleInPlace(this.deviceScaleFactor), this.onControllerMeshLoadedObservable.notifyObservers(webVrController), this._webVROptions.defaultLightingOnControllers) {this._lightOnControllers || (this._lightOnControllers = new hemisphericLight/* HemisphericLight */.e("vrControllersLight", new math_vector/* Vector3 */.P(0, 1, 0), this.getScene()));const activateLightOnSubMeshes = function (mesh, light) {const children = mesh.getChildren();children && 0 !== children.length && children.forEach((mesh) => {light.includedOnlyMeshes.push(mesh), activateLightOnSubMeshes(mesh, light);});};this._lightOnControllers.includedOnlyMeshes.push(loadedMesh), activateLightOnSubMeshes(loadedMesh, this._lightOnControllers);}})), webVrController.attachToPoseControlledCamera(this), -1 === this.controllers.indexOf(webVrController)) {this.controllers.push(webVrController);let firstViveWandDetected = !1;for (let i = 0; i < this.controllers.length; i++) this.controllers[i].controllerType === PoseEnabledControllerType.VIVE && (firstViveWandDetected ? this.controllers[i].hand = "right" : (firstViveWandDetected = !0, this.controllers[i].hand = "left"));2 <= this.controllers.length && this.onControllersAttachedObservable.notifyObservers(this.controllers);}}});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/Controllers/webVRController.js
class WebVRController extends PoseEnabledController {onButtonStateChange(callback) {this._onButtonStateChange = callback;}get defaultModel() {return this._defaultModel;}constructor(vrGamepad) {super(vrGamepad), this.onTriggerStateChangedObservable = new observable/* Observable */.y$(), this.onMainButtonStateChangedObservable = new observable/* Observable */.y$(), this.onSecondaryButtonStateChangedObservable = new observable/* Observable */.y$(), this.onPadStateChangedObservable = new observable/* Observable */.y$(), this.onPadValuesChangedObservable = new observable/* Observable */.y$(), this.pad = { x: 0, y: 0 }, this._changes = { pressChanged: !1, touchChanged: !1, valueChanged: !1, changed: !1 }, this._buttons = Array(vrGamepad.buttons.length), this.hand = vrGamepad.hand;}update() {super.update();for (let index = 0; index < this._buttons.length; index++) this._setButtonValue(this.browserGamepad.buttons[index], this._buttons[index], index);(this.leftStick.x !== this.pad.x || this.leftStick.y !== this.pad.y) && (this.pad.x = this.leftStick.x, this.pad.y = this.leftStick.y, this.onPadValuesChangedObservable.notifyObservers(this.pad));}_setButtonValue(newState, currentState, buttonIndex) {return newState || (newState = { pressed: !1, touched: !1, value: 0 }), currentState ? void (this._checkChanges(newState, currentState), this._changes.changed && (this._onButtonStateChange && this._onButtonStateChange(this.index, buttonIndex, newState), this._handleButtonChange(buttonIndex, newState, this._changes)), this._buttons[buttonIndex].pressed = newState.pressed, this._buttons[buttonIndex].touched = newState.touched, this._buttons[buttonIndex].value = 1e-8 > newState.value ? 0 : newState.value) : void (this._buttons[buttonIndex] = { pressed: newState.pressed, touched: newState.touched, value: newState.value });}_checkChanges(newState, currentState) {return this._changes.pressChanged = newState.pressed !== currentState.pressed, this._changes.touchChanged = newState.touched !== currentState.touched, this._changes.valueChanged = newState.value !== currentState.value, this._changes.changed = this._changes.pressChanged || this._changes.touchChanged || this._changes.valueChanged, this._changes;}dispose() {super.dispose(), this._defaultModel = null, this.onTriggerStateChangedObservable.clear(), this.onMainButtonStateChangedObservable.clear(), this.onSecondaryButtonStateChangedObservable.clear(), this.onPadStateChangedObservable.clear(), this.onPadValuesChangedObservable.clear();}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/standardMaterial.js + 6 modules
var standardMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/standardMaterial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicTexture.js
var engine_dynamicTexture = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/dynamicTexture.js
class DynamicTexture extends Textures_texture/* Texture */.x {constructor(name, options, scene = null, generateMipMaps = !1, samplingMode = 3, format = 5, invertY) {super(null, scene, !generateMipMaps, invertY, samplingMode, void 0, void 0, void 0, void 0, format), this.name = name, this.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._generateMipMaps = generateMipMaps;const engine = this._getEngine();if (engine) {options.getContext ? (this._canvas = options, this._texture = engine.createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode)) : (this._canvas = engine.createCanvas(1, 1), this._texture = options.width || 0 === options.width ? engine.createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode) : engine.createDynamicTexture(options, options, generateMipMaps, samplingMode));const textureSize = this.getSize();this._canvas.width !== textureSize.width && (this._canvas.width = textureSize.width), this._canvas.height !== textureSize.height && (this._canvas.height = textureSize.height), this._context = this._canvas.getContext("2d");}}getClassName() {return "DynamicTexture";}get canRescale() {return !0;}_recreate(textureSize) {this._canvas.width = textureSize.width, this._canvas.height = textureSize.height, this.releaseInternalTexture(), this._texture = this._getEngine().createDynamicTexture(textureSize.width, textureSize.height, this._generateMipMaps, this.samplingMode);}scale(ratio) {const textureSize = this.getSize();textureSize.width *= ratio, textureSize.height *= ratio, this._recreate(textureSize);}scaleTo(width, height) {const textureSize = this.getSize();textureSize.width = width, textureSize.height = height, this._recreate(textureSize);}getContext() {return this._context;}clear() {const size = this.getSize();this._context.fillRect(0, 0, size.width, size.height);}update(invertY, premulAlpha = !1, allowGPUOptimization = !1) {this._getEngine().updateDynamicTexture(this._texture, this._canvas, !(invertY !== void 0) || invertY, premulAlpha, this._format || void 0, void 0, allowGPUOptimization);}drawText(text, x, y, font, color, clearColor, invertY, update = !0) {const size = this.getSize();if (clearColor && (this._context.fillStyle = clearColor, this._context.fillRect(0, 0, size.width, size.height)), this._context.font = font, null === x || void 0 === x) {const textSize = this._context.measureText(text);x = (size.width - textSize.width) / 2;}if (null === y || void 0 === y) {const fontSize = parseInt(font.replace(/\D/g, ""));y = size.height / 2 + fontSize / 3.65;}this._context.fillStyle = color || "", this._context.fillText(text, x, y), update && this.update(invertY);}clone() {const scene = this.getScene();if (!scene) return this;const textureSize = this.getSize(),newTexture = new DynamicTexture(this.name, textureSize, scene, this._generateMipMaps);return newTexture.hasAlpha = this.hasAlpha, newTexture.level = this.level, newTexture.wrapU = this.wrapU, newTexture.wrapV = this.wrapV, newTexture;}serialize() {const scene = this.getScene();scene && !scene.isReady() && logger/* Logger.Warn */.Y.Warn("The scene must be ready before serializing the dynamic texture");const serializationObject = super.serialize();return DynamicTexture._IsCanvasElement(this._canvas) && (serializationObject.base64String = this._canvas.toDataURL()), serializationObject.invertY = this._invertY, serializationObject.samplingMode = this.samplingMode, serializationObject;}static _IsCanvasElement(canvas) {return canvas.toDataURL !== void 0;}_rebuild() {this.update();}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js
var imageProcessingDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js
var imageProcessingFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/imageProcessing.fragment.js
const imageProcessing_fragment_name = "imageProcessingPixelShader",imageProcessing_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
#include<imageProcessingDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec4 result=texture2D(textureSampler,vUV);
#ifdef IMAGEPROCESSING
#ifndef FROMLINEARSPACE
result.rgb=toLinearSpace(result.rgb);
#endif
result=applyImageProcessing(result);
#else
#ifdef FROMLINEARSPACE
result=applyImageProcessing(result);
#endif
#endif
gl_FragColor=result;
}`;shaderStore/* ShaderStore.ShadersStore.imageProcessingPixelShader */.v.ShadersStore.imageProcessingPixelShader = imageProcessing_fragment_shader;const imageProcessingPixelShader = { name: "imageProcessingPixelShader", shader: imageProcessing_fragment_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/postprocess.vertex.js
var postprocess_vertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/postprocess.vertex.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/imageProcessingPostProcess.js
class ImageProcessingPostProcess extends PostProcesses_postProcess/* PostProcess */.D {get imageProcessingConfiguration() {return this._imageProcessingConfiguration;}set imageProcessingConfiguration(value) {value.applyByPostProcess = !0, this._attachImageProcessingConfiguration(value);}_attachImageProcessingConfiguration(configuration, doNotBuild = !1) {if (configuration !== this._imageProcessingConfiguration) {if (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), !configuration) {let scene = null;const engine = this.getEngine(),camera = this.getCamera();if (camera) scene = camera.getScene();else if (engine && engine.scenes) {const scenes = engine.scenes;scene = scenes[scenes.length - 1];} else scene = engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;this._imageProcessingConfiguration = scene ? scene.imageProcessingConfiguration : new Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.$();} else this._imageProcessingConfiguration = configuration;this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {this._updateParameters();})), doNotBuild || this._updateParameters();}}get isSupported() {const effect = this.getEffect();return !effect || effect.isSupported;}get colorCurves() {return this.imageProcessingConfiguration.colorCurves;}set colorCurves(value) {this.imageProcessingConfiguration.colorCurves = value;}get colorCurvesEnabled() {return this.imageProcessingConfiguration.colorCurvesEnabled;}set colorCurvesEnabled(value) {this.imageProcessingConfiguration.colorCurvesEnabled = value;}get colorGradingTexture() {return this.imageProcessingConfiguration.colorGradingTexture;}set colorGradingTexture(value) {this.imageProcessingConfiguration.colorGradingTexture = value;}get colorGradingEnabled() {return this.imageProcessingConfiguration.colorGradingEnabled;}set colorGradingEnabled(value) {this.imageProcessingConfiguration.colorGradingEnabled = value;}get exposure() {return this.imageProcessingConfiguration.exposure;}set exposure(value) {this.imageProcessingConfiguration.exposure = value;}get toneMappingEnabled() {return this._imageProcessingConfiguration.toneMappingEnabled;}set toneMappingEnabled(value) {this._imageProcessingConfiguration.toneMappingEnabled = value;}get toneMappingType() {return this._imageProcessingConfiguration.toneMappingType;}set toneMappingType(value) {this._imageProcessingConfiguration.toneMappingType = value;}get contrast() {return this.imageProcessingConfiguration.contrast;}set contrast(value) {this.imageProcessingConfiguration.contrast = value;}get vignetteStretch() {return this.imageProcessingConfiguration.vignetteStretch;}set vignetteStretch(value) {this.imageProcessingConfiguration.vignetteStretch = value;}get vignetteCentreX() {return this.imageProcessingConfiguration.vignetteCenterX;}set vignetteCentreX(value) {this.imageProcessingConfiguration.vignetteCenterX = value;}get vignetteCentreY() {return this.imageProcessingConfiguration.vignetteCenterY;}set vignetteCentreY(value) {this.imageProcessingConfiguration.vignetteCenterY = value;}get vignetteCenterY() {return this.imageProcessingConfiguration.vignetteCenterY;}set vignetteCenterY(value) {this.imageProcessingConfiguration.vignetteCenterY = value;}get vignetteCenterX() {return this.imageProcessingConfiguration.vignetteCenterX;}set vignetteCenterX(value) {this.imageProcessingConfiguration.vignetteCenterX = value;}get vignetteWeight() {return this.imageProcessingConfiguration.vignetteWeight;}set vignetteWeight(value) {this.imageProcessingConfiguration.vignetteWeight = value;}get vignetteColor() {return this.imageProcessingConfiguration.vignetteColor;}set vignetteColor(value) {this.imageProcessingConfiguration.vignetteColor = value;}get vignetteCameraFov() {return this.imageProcessingConfiguration.vignetteCameraFov;}set vignetteCameraFov(value) {this.imageProcessingConfiguration.vignetteCameraFov = value;}get vignetteBlendMode() {return this.imageProcessingConfiguration.vignetteBlendMode;}set vignetteBlendMode(value) {this.imageProcessingConfiguration.vignetteBlendMode = value;}get vignetteEnabled() {return this.imageProcessingConfiguration.vignetteEnabled;}set vignetteEnabled(value) {this.imageProcessingConfiguration.vignetteEnabled = value;}get ditheringIntensity() {return this.imageProcessingConfiguration.ditheringIntensity;}set ditheringIntensity(value) {this.imageProcessingConfiguration.ditheringIntensity = value;}get ditheringEnabled() {return this.imageProcessingConfiguration.ditheringEnabled;}set ditheringEnabled(value) {this.imageProcessingConfiguration.ditheringEnabled = value;}get fromLinearSpace() {return this._fromLinearSpace;}set fromLinearSpace(value) {this._fromLinearSpace === value || (this._fromLinearSpace = value, this._updateParameters());}constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, imageProcessingConfiguration) {super(name, "imageProcessing", [], [], options, camera, samplingMode, engine, reusable, null, textureType, "postprocess", null, !0), this._fromLinearSpace = !0, this._defines = { IMAGEPROCESSING: !1, VIGNETTE: !1, VIGNETTEBLENDMODEMULTIPLY: !1, VIGNETTEBLENDMODEOPAQUE: !1, TONEMAPPING: !1, TONEMAPPING_ACES: !1, CONTRAST: !1, COLORCURVES: !1, COLORGRADING: !1, COLORGRADING3D: !1, FROMLINEARSPACE: !1, SAMPLER3DGREENDEPTH: !1, SAMPLER3DBGRMAP: !1, DITHER: !1, IMAGEPROCESSINGPOSTPROCESS: !1, EXPOSURE: !1, SKIPFINALCOLORCLAMP: !1 }, imageProcessingConfiguration ? (imageProcessingConfiguration.applyByPostProcess = !0, this._attachImageProcessingConfiguration(imageProcessingConfiguration, !0), this._updateParameters()) : (this._attachImageProcessingConfiguration(null, !0), this.imageProcessingConfiguration.applyByPostProcess = !0), this.onApply = (effect) => {this.imageProcessingConfiguration.bind(effect, this.aspectRatio);};}getClassName() {return "ImageProcessingPostProcess";}_updateParameters() {this._defines.FROMLINEARSPACE = this._fromLinearSpace, this.imageProcessingConfiguration.prepareDefines(this._defines, !0);let defines = "";for (const define in this._defines) this._defines[define] && (defines += `#define ${define};\r\n`);const samplers = ["textureSampler"],uniforms = ["scale"];Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.$ && (Materials_imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareSamplers */.$.PrepareSamplers(samplers, this._defines), Materials_imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareUniforms */.$.PrepareUniforms(uniforms, this._defines)), this.updateEffect(defines, uniforms, samplers);}dispose(camera) {super.dispose(camera), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration && (this.imageProcessingConfiguration.applyByPostProcess = !1);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ImageProcessingPostProcess.prototype, "_fromLinearSpace", void 0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRLayerWrapper.js
class WebXRLayerWrapper {get isFixedFoveationSupported() {return "XRWebGLLayer" == this.layerType && "number" == typeof this.layer.fixedFoveation;}get fixedFoveation() {return this.isFixedFoveationSupported ? this.layer.fixedFoveation : null;}set fixedFoveation(value) {if (this.isFixedFoveationSupported) {const val = Math.max(0, Math.min(1, value || 0));this.layer.fixedFoveation = val;}}constructor(getWidth, getHeight, layer, layerType, createRenderTargetTextureProvider) {this.getWidth = getWidth, this.getHeight = getHeight, this.layer = layer, this.layerType = layerType, this.createRenderTargetTextureProvider = createRenderTargetTextureProvider;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.js
var webGLHardwareTexture = __webpack_require__("./node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRRenderTargetTextureProvider.js
class WebXRLayerRenderTargetTextureProvider {constructor(_scene, layerWrapper) {this._scene = _scene, this.layerWrapper = layerWrapper, this._renderTargetTextures = [], this._engine = _scene.getEngine();}_createInternalTexture(textureSize, texture) {const internalTexture = new Textures_internalTexture/* InternalTexture */.l(this._engine, Textures_internalTexture/* InternalTextureSource.Unknown */.S.Unknown, !0);return internalTexture.width = textureSize.width, internalTexture.height = textureSize.height, internalTexture._hardwareTexture = new webGLHardwareTexture/* WebGLHardwareTexture */.B(texture, this._engine._gl), internalTexture.isReady = !0, internalTexture;}_createRenderTargetTexture(width, height, framebuffer, colorTexture, depthStencilTexture, multiview) {if (!this._engine) throw new Error("Engine is disposed");const textureSize = { width, height },renderTargetTexture = multiview ? new MultiviewRenderTarget(this._scene, textureSize) : new Textures_renderTargetTexture/* RenderTargetTexture */._("XR renderTargetTexture", textureSize, this._scene),renderTargetWrapper = renderTargetTexture.renderTarget;if (renderTargetWrapper._samples = renderTargetTexture.samples, (framebuffer || !colorTexture) && (renderTargetWrapper._framebuffer = framebuffer), colorTexture) if (multiview) renderTargetWrapper._colorTextureArray = colorTexture;else {const internalTexture = this._createInternalTexture(textureSize, colorTexture);renderTargetWrapper.setTexture(internalTexture, 0), renderTargetTexture._texture = internalTexture;}return depthStencilTexture && (multiview ? renderTargetWrapper._depthStencilTextureArray = depthStencilTexture : renderTargetWrapper._depthStencilTexture = this._createInternalTexture(textureSize, depthStencilTexture)), renderTargetTexture.disableRescaling(), "undefined" != typeof XRWebGLBinding && (renderTargetTexture.skipInitialClear = !0), this._renderTargetTextures.push(renderTargetTexture), renderTargetTexture;}_destroyRenderTargetTexture(renderTargetTexture) {this._renderTargetTextures.splice(this._renderTargetTextures.indexOf(renderTargetTexture), 1), renderTargetTexture.dispose();}getFramebufferDimensions() {return this._framebufferDimensions;}dispose() {this._renderTargetTextures.forEach((rtt) => rtt.dispose()), this._renderTargetTextures.length = 0;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRWebGLLayer.js
class WebXRWebGLLayerWrapper extends WebXRLayerWrapper {constructor(layer) {super(() => layer.framebufferWidth, () => layer.framebufferHeight, layer, "XRWebGLLayer", (sessionManager) => new WebXRWebGLLayerRenderTargetTextureProvider(sessionManager.scene, this)), this.layer = layer;}}class WebXRWebGLLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetTextureProvider {constructor(scene, layerWrapper) {super(scene, layerWrapper), this.layerWrapper = layerWrapper, this._layer = layerWrapper.layer, this._framebufferDimensions = { framebufferWidth: this._layer.framebufferWidth, framebufferHeight: this._layer.framebufferHeight };}trySetViewportForView(viewport, view) {const xrViewport = this._layer.getViewport(view);if (!xrViewport) return !1;const framebufferWidth = this._framebufferDimensions.framebufferWidth,framebufferHeight = this._framebufferDimensions.framebufferHeight;return viewport.x = xrViewport.x / framebufferWidth, viewport.y = xrViewport.y / framebufferHeight, viewport.width = xrViewport.width / framebufferWidth, viewport.height = xrViewport.height / framebufferHeight, !0;}getRenderTargetTextureForEye() {const layerWidth = this._layer.framebufferWidth,layerHeight = this._layer.framebufferHeight,framebuffer = this._layer.framebuffer;return this._rtt && layerWidth === this._framebufferDimensions.framebufferWidth && layerHeight === this._framebufferDimensions.framebufferHeight && framebuffer === this._framebuffer || (this._rtt = this._createRenderTargetTexture(layerWidth, layerHeight, framebuffer), this._framebufferDimensions.framebufferWidth = layerWidth, this._framebufferDimensions.framebufferHeight = layerHeight, this._framebuffer = framebuffer), this._rtt;}getRenderTargetTextureForView(view) {return this.getRenderTargetTextureForEye(view.eye);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRManagedOutputCanvas.js
class WebXRManagedOutputCanvasOptions {static GetDefaults(engine) {const defaults = new WebXRManagedOutputCanvasOptions();return defaults.canvasOptions = { antialias: !0, depth: !0, stencil: !engine || engine.isStencilEnable, alpha: !0, framebufferScaleFactor: 1 }, defaults.newCanvasCssStyle = "position:absolute; bottom:0px;right:0px;z-index:10;width:90%;height:100%;background-color: #000000;", defaults;}}class WebXRManagedOutputCanvas {constructor(_xrSessionManager, _options = WebXRManagedOutputCanvasOptions.GetDefaults()) {if (this._options = _options, this._canvas = null, this._engine = null, this.xrLayer = null, this._xrLayerWrapper = null, this.onXRLayerInitObservable = new observable/* Observable */.y$(), this._engine = _xrSessionManager.scene.getEngine(), this._engine.onDisposeObservable.addOnce(() => {this._engine = null;}), !_options.canvasElement) {const canvas = document.createElement("canvas");canvas.style.cssText = this._options.newCanvasCssStyle || "position:absolute; bottom:0px;right:0px;", this._setManagedOutputCanvas(canvas);} else this._setManagedOutputCanvas(_options.canvasElement);_xrSessionManager.onXRSessionInit.add(() => {this._addCanvas();}), _xrSessionManager.onXRSessionEnded.add(() => {this._removeCanvas();});}dispose() {this._removeCanvas(), this._setManagedOutputCanvas(null);}async initializeXRLayerAsync(xrSession) {const createLayer = () => (this.xrLayer = new XRWebGLLayer(xrSession, this.canvasContext, this._options.canvasOptions), this._xrLayerWrapper = new WebXRWebGLLayerWrapper(this.xrLayer), this.onXRLayerInitObservable.notifyObservers(this.xrLayer), this.xrLayer);return this.canvasContext.makeXRCompatible ? this.canvasContext.makeXRCompatible().then(() => {}, () => {tools/* Tools.Warn */.w1.Warn("Error executing makeXRCompatible. This does not mean that the session will work incorrectly.");}).then(() => createLayer()) : Promise.resolve(createLayer());}_addCanvas() {this._canvas && this._engine && this._canvas !== this._engine.getRenderingCanvas() && document.body.appendChild(this._canvas), this.xrLayer ? this._setCanvasSize(!0) : this.onXRLayerInitObservable.addOnce(() => {this._setCanvasSize(!0);});}_removeCanvas() {this._canvas && this._engine && document.body.contains(this._canvas) && this._canvas !== this._engine.getRenderingCanvas() && document.body.removeChild(this._canvas), this._setCanvasSize(!1);}_setCanvasSize(init = !0, xrLayer = this._xrLayerWrapper) {this._canvas && this._engine && (init ? xrLayer && (this._canvas === this._engine.getRenderingCanvas() ? this._engine.setSize(xrLayer.getWidth(), xrLayer.getHeight()) : (this._canvas.style.width = xrLayer.getWidth() + "px", this._canvas.style.height = xrLayer.getHeight() + "px")) : this._originalCanvasSize && (this._canvas === this._engine.getRenderingCanvas() ? this._engine.setSize(this._originalCanvasSize.width, this._originalCanvasSize.height) : (this._canvas.style.width = this._originalCanvasSize.width + "px", this._canvas.style.height = this._originalCanvasSize.height + "px")));}_setManagedOutputCanvas(canvas) {this._removeCanvas(), canvas ? (this._originalCanvasSize = { width: canvas.offsetWidth, height: canvas.offsetHeight }, this._canvas = canvas, this.canvasContext = this._canvas.getContext("webgl2"), !this.canvasContext && (this.canvasContext = this._canvas.getContext("webgl"))) : (this._canvas = null, this.canvasContext = null);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/native/nativeXRRenderTarget.js
class NativeXRLayerWrapper extends WebXRLayerWrapper {constructor(layer) {super(() => layer.framebufferWidth, () => layer.framebufferHeight, layer, "XRWebGLLayer", (sessionManager) => new NativeXRLayerRenderTargetTextureProvider(sessionManager, this)), this.layer = layer;}}class NativeXRLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetTextureProvider {constructor(sessionManager, layerWrapper) {super(sessionManager.scene, layerWrapper), this.layerWrapper = layerWrapper, this._nativeRTTProvider = navigator.xr.getNativeRenderTargetProvider(sessionManager.session, this._createRenderTargetTexture.bind(this), this._destroyRenderTargetTexture.bind(this)), this._nativeLayer = layerWrapper.layer;}trySetViewportForView(viewport) {return viewport.x = 0, viewport.y = 0, viewport.width = 1, viewport.height = 1, !0;}getRenderTargetTextureForEye(eye) {return this._nativeRTTProvider.getRenderTargetForEye(eye);}getRenderTargetTextureForView(view) {return this._nativeRTTProvider.getRenderTargetForEye(view.eye);}getFramebufferDimensions() {return { framebufferWidth: this._nativeLayer.framebufferWidth, framebufferHeight: this._nativeLayer.framebufferHeight };}}class NativeXRRenderTarget {constructor(_xrSessionManager) {this._nativeRenderTarget = navigator.xr.getWebXRRenderTarget(_xrSessionManager.scene.getEngine());}async initializeXRLayerAsync(xrSession) {return await this._nativeRenderTarget.initializeXRLayerAsync(xrSession), this.xrLayer = this._nativeRenderTarget.xrLayer, this.xrLayer;}dispose() {}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRSessionManager.js
class WebXRSessionManager {constructor(scene) {this.scene = scene, this.currentTimestamp = -1, this.defaultHeightCompensation = 1.7, this.onXRFrameObservable = new observable/* Observable */.y$(), this.onXRReferenceSpaceChanged = new observable/* Observable */.y$(), this.onXRSessionEnded = new observable/* Observable */.y$(), this.onXRSessionInit = new observable/* Observable */.y$(), this.inXRFrameLoop = !1, this.inXRSession = !1, this._engine = scene.getEngine(), this._onEngineDisposedObserver = this._engine.onDisposeObservable.addOnce(() => {this._engine = null;}), scene.onDisposeObservable.addOnce(() => {this.dispose();});}get referenceSpace() {return this._referenceSpace;}set referenceSpace(newReferenceSpace) {this._referenceSpace = newReferenceSpace, this.onXRReferenceSpaceChanged.notifyObservers(this._referenceSpace);}get sessionMode() {return this._sessionMode;}dispose() {var _a;this.inXRSession && this.exitXRAsync(), this.onXRFrameObservable.clear(), this.onXRSessionEnded.clear(), this.onXRReferenceSpaceChanged.clear(), this.onXRSessionInit.clear(), null === (_a = this._engine) || void 0 === _a ? void 0 : _a.onDisposeObservable.remove(this._onEngineDisposedObserver), this._engine = null;}exitXRAsync() {return this.session && this.inXRSession ? (this.inXRSession = !1, this.session.end().catch(() => {logger/* Logger.Warn */.Y.Warn("Could not end XR session.");})) : Promise.resolve();}trySetViewportForView(viewport, view) {var _a;return (null === (_a = this._baseLayerRTTProvider) || void 0 === _a ? void 0 : _a.trySetViewportForView(viewport, view)) || !1;}getRenderTargetTextureForEye(eye) {var _a;return (null === (_a = this._baseLayerRTTProvider) || void 0 === _a ? void 0 : _a.getRenderTargetTextureForEye(eye)) || null;}getRenderTargetTextureForView(view) {var _a;return (null === (_a = this._baseLayerRTTProvider) || void 0 === _a ? void 0 : _a.getRenderTargetTextureForView(view)) || null;}getWebXRRenderTarget(options) {const engine = this.scene.getEngine();return this._xrNavigator.xr.native ? new NativeXRRenderTarget(this) : (options = options || WebXRManagedOutputCanvasOptions.GetDefaults(engine), options.canvasElement = options.canvasElement || engine.getRenderingCanvas() || void 0, new WebXRManagedOutputCanvas(this, options));}initializeAsync() {return this._xrNavigator = navigator, this._xrNavigator.xr ? Promise.resolve() : Promise.reject("WebXR not available");}initializeSessionAsync(xrSessionMode = "immersive-vr", xrSessionInit = {}) {return this._xrNavigator.xr.requestSession(xrSessionMode, xrSessionInit).then((session) => (this.session = session, this._sessionMode = xrSessionMode, this.onXRSessionInit.notifyObservers(session), this.inXRSession = !0, this.session.addEventListener("end", () => {var _a;this.inXRSession = !1, this.onXRSessionEnded.notifyObservers(null), this._engine && (this._engine.framebufferDimensionsObject = null, this._engine.restoreDefaultFramebuffer(), this._engine.customAnimationFrameRequester = null, this._engine._renderLoop()), this.isNative && (null === (_a = this._baseLayerRTTProvider) || void 0 === _a ? void 0 : _a.dispose()), this._baseLayerRTTProvider = null, this._baseLayerWrapper = null;}, { once: !0 }), this.session));}isSessionSupportedAsync(sessionMode) {return WebXRSessionManager.IsSessionSupportedAsync(sessionMode);}resetReferenceSpace() {this.referenceSpace = this.baseReferenceSpace;}runXRRenderLoop() {var _a;this.inXRSession && this._engine && (this._engine.customAnimationFrameRequester = { requestAnimationFrame: this.session.requestAnimationFrame.bind(this.session), renderFunction: (timestamp, xrFrame) => {var _a;this.inXRSession && this._engine && (this.currentFrame = xrFrame, this.currentTimestamp = timestamp, xrFrame && (this.inXRFrameLoop = !0, this._engine.framebufferDimensionsObject = (null === (_a = this._baseLayerRTTProvider) || void 0 === _a ? void 0 : _a.getFramebufferDimensions()) || null, this.onXRFrameObservable.notifyObservers(xrFrame), this._engine._renderLoop(), this._engine.framebufferDimensionsObject = null, this.inXRFrameLoop = !1));} }, this._engine.framebufferDimensionsObject = (null === (_a = this._baseLayerRTTProvider) || void 0 === _a ? void 0 : _a.getFramebufferDimensions()) || null, "undefined" != typeof window && window.cancelAnimationFrame && window.cancelAnimationFrame(this._engine._frameHandler), this._engine._renderLoop());}setReferenceSpaceTypeAsync(referenceSpaceType = "local-floor") {return this.session.requestReferenceSpace(referenceSpaceType).then((referenceSpace) => referenceSpace, (rejectionReason) => (logger/* Logger.Error */.Y.Error("XR.requestReferenceSpace failed for the following reason: "), logger/* Logger.Error */.Y.Error(rejectionReason), logger/* Logger.Log */.Y.Log("Defaulting to universally-supported \"viewer\" reference space type."), this.session.requestReferenceSpace("viewer").then((referenceSpace) => {const heightCompensation = new XRRigidTransform({ x: 0, y: -this.defaultHeightCompensation, z: 0 });return referenceSpace.getOffsetReferenceSpace(heightCompensation);}, (rejectionReason) => {throw logger/* Logger.Error */.Y.Error(rejectionReason), "XR initialization failed: required \"viewer\" reference space type not supported.";}))).then((referenceSpace) => this.session.requestReferenceSpace("viewer").then((viewerReferenceSpace) => (this.viewerReferenceSpace = viewerReferenceSpace, referenceSpace))).then((referenceSpace) => (this.referenceSpace = this.baseReferenceSpace = referenceSpace, this.referenceSpace));}updateRenderStateAsync(state) {return Promise.resolve(this.session.updateRenderState(state));}_setBaseLayerWrapper(baseLayerWrapper) {var _a, _b;this.isNative && (null === (_a = this._baseLayerRTTProvider) || void 0 === _a ? void 0 : _a.dispose()), this._baseLayerWrapper = baseLayerWrapper, this._baseLayerRTTProvider = (null === (_b = this._baseLayerWrapper) || void 0 === _b ? void 0 : _b.createRenderTargetTextureProvider(this)) || null;}updateRenderState(state) {state.baseLayer && this._setBaseLayerWrapper(this.isNative ? new NativeXRLayerWrapper(state.baseLayer) : new WebXRWebGLLayerWrapper(state.baseLayer)), this.session.updateRenderState(state);}static IsSessionSupportedAsync(sessionMode) {if (!navigator.xr) return Promise.resolve(!1);const functionToUse = navigator.xr.isSessionSupported || navigator.xr.supportsSession;return functionToUse ? functionToUse.call(navigator.xr, sessionMode).then((result) => {return Promise.resolve("undefined" == typeof result || result);}).catch((e) => (logger/* Logger.Warn */.Y.Warn(e), Promise.resolve(!1))) : Promise.resolve(!1);}get isNative() {var _a;return !(null === (_a = this._xrNavigator.xr.native) || void 0 === _a) && _a;}get currentFrameRate() {var _a;return null === (_a = this.session) || void 0 === _a ? void 0 : _a.frameRate;}get supportedFrameRates() {var _a;return null === (_a = this.session) || void 0 === _a ? void 0 : _a.supportedFrameRates;}updateTargetFrameRate(rate) {return this.session.updateTargetFrameRate(rate);}runInXRFrame(callback, ignoreIfNotInSession = !0) {this.inXRFrameLoop ? callback() : (this.inXRSession || !ignoreIfNotInSession) && this.onXRFrameObservable.addOnce(callback);}get isFixedFoveationSupported() {var _a;return (null === (_a = this._baseLayerWrapper) || void 0 === _a ? void 0 : _a.isFixedFoveationSupported) || !1;}get fixedFoveation() {var _a;return (null === (_a = this._baseLayerWrapper) || void 0 === _a ? void 0 : _a.fixedFoveation) || null;}set fixedFoveation(value) {const val = Math.max(0, Math.min(1, value || 0));this._baseLayerWrapper && (this._baseLayerWrapper.fixedFoveation = val);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRTypes.js
var WebXRState;(function (WebXRState) {WebXRState[WebXRState.ENTERING_XR = 0] = "ENTERING_XR", WebXRState[WebXRState.EXITING_XR = 1] = "EXITING_XR", WebXRState[WebXRState.IN_XR = 2] = "IN_XR", WebXRState[WebXRState.NOT_IN_XR = 3] = "NOT_IN_XR";})(WebXRState || (WebXRState = {}));var WebXRTrackingState;(function (WebXRTrackingState) {WebXRTrackingState[WebXRTrackingState.NOT_TRACKING = 0] = "NOT_TRACKING", WebXRTrackingState[WebXRTrackingState.TRACKING_LOST = 1] = "TRACKING_LOST", WebXRTrackingState[WebXRTrackingState.TRACKING = 2] = "TRACKING";})(WebXRTrackingState || (WebXRTrackingState = {}));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/cylinderBuilder.js
function CreateCylinderVertexData(options) {const height = options.height || 2;let diameterTop = 0 === options.diameterTop ? 0 : options.diameterTop || options.diameter || 1,diameterBottom = 0 === options.diameterBottom ? 0 : options.diameterBottom || options.diameter || 1;diameterTop = diameterTop || 1e-5, diameterBottom = diameterBottom || 1e-5;const tessellation = options.tessellation || 24,subdivisions = options.subdivisions || 1,hasRings = !!options.hasRings,enclose = !!options.enclose,cap = 0 === options.cap ? 0 : options.cap || Meshes_mesh/* Mesh.CAP_ALL */.Kj.CAP_ALL,arc = options.arc && (0 >= options.arc || 1 < options.arc) ? 1 : options.arc || 1,sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,faceUV = options.faceUV || [,,,],faceColors = options.faceColors,quadNb = 1 !== arc && enclose ? 2 : 0,ringNb = hasRings ? subdivisions : 1,surfaceNb = 2 + (1 + quadNb) * ringNb;let f;for (f = 0; f < surfaceNb; f++) faceColors && void 0 === faceColors[f] && (faceColors[f] = new math_color/* Color4 */.HE(1, 1, 1, 1));for (f = 0; f < surfaceNb; f++) faceUV && void 0 === faceUV[f] && (faceUV[f] = new math_vector/* Vector4 */.Lt(0, 0, 1, 1));const indices = [],positions = [],normals = [],uvs = [],colors = [],angleStep = 2 * Math.PI * arc / tessellation;let angle, h, radius;const tan = (diameterBottom - diameterTop) / 2 / height,ringVertex = math_vector/* Vector3.Zero */.P.Zero(),ringNormal = math_vector/* Vector3.Zero */.P.Zero(),ringFirstVertex = math_vector/* Vector3.Zero */.P.Zero(),ringFirstNormal = math_vector/* Vector3.Zero */.P.Zero(),quadNormal = math_vector/* Vector3.Zero */.P.Zero(),Y = math_axis/* Axis.Y */.RD.Y;let i,j,r,ringIdx = 1,s = 1,cs = 0,v = 0;for (i = 0; i <= subdivisions; i++) for (h = i / subdivisions, radius = (h * (diameterTop - diameterBottom) + diameterBottom) / 2, ringIdx = hasRings && 0 !== i && i !== subdivisions ? 2 : 1, r = 0; r < ringIdx; r++) {for (hasRings && (s += r), enclose && (s += 2 * r), j = 0; j <= tessellation; j++) angle = j * angleStep, ringVertex.x = Math.cos(-angle) * radius, ringVertex.y = -height / 2 + h * height, ringVertex.z = Math.sin(-angle) * radius, 0 === diameterTop && i === subdivisions ? (ringNormal.x = normals[normals.length - 3 * (tessellation + 1)], ringNormal.y = normals[normals.length - 3 * (tessellation + 1) + 1], ringNormal.z = normals[normals.length - 3 * (tessellation + 1) + 2]) : (ringNormal.x = ringVertex.x, ringNormal.z = ringVertex.z, ringNormal.y = Math.sqrt(ringNormal.x * ringNormal.x + ringNormal.z * ringNormal.z) * tan, ringNormal.normalize()), 0 === j && (ringFirstVertex.copyFrom(ringVertex), ringFirstNormal.copyFrom(ringNormal)), positions.push(ringVertex.x, ringVertex.y, ringVertex.z), normals.push(ringNormal.x, ringNormal.y, ringNormal.z), v = hasRings ? cs === s ? faceUV[s].w : faceUV[s].y : faceUV[s].y + (faceUV[s].w - faceUV[s].y) * h, uvs.push(faceUV[s].x + (faceUV[s].z - faceUV[s].x) * j / tessellation, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v), faceColors && colors.push(faceColors[s].r, faceColors[s].g, faceColors[s].b, faceColors[s].a);1 !== arc && enclose && (positions.push(ringVertex.x, ringVertex.y, ringVertex.z), positions.push(0, ringVertex.y, 0), positions.push(0, ringVertex.y, 0), positions.push(ringFirstVertex.x, ringFirstVertex.y, ringFirstVertex.z), math_vector/* Vector3.CrossToRef */.P.CrossToRef(Y, ringNormal, quadNormal), quadNormal.normalize(), normals.push(quadNormal.x, quadNormal.y, quadNormal.z, quadNormal.x, quadNormal.y, quadNormal.z), math_vector/* Vector3.CrossToRef */.P.CrossToRef(ringFirstNormal, Y, quadNormal), quadNormal.normalize(), normals.push(quadNormal.x, quadNormal.y, quadNormal.z, quadNormal.x, quadNormal.y, quadNormal.z), v = hasRings ? cs === s ? faceUV[s + 1].w : faceUV[s + 1].y : faceUV[s + 1].y + (faceUV[s + 1].w - faceUV[s + 1].y) * h, uvs.push(faceUV[s + 1].x, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v), uvs.push(faceUV[s + 1].z, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v), v = hasRings ? cs === s ? faceUV[s + 2].w : faceUV[s + 2].y : faceUV[s + 2].y + (faceUV[s + 2].w - faceUV[s + 2].y) * h, uvs.push(faceUV[s + 2].x, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v), uvs.push(faceUV[s + 2].z, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v), faceColors && (colors.push(faceColors[s + 1].r, faceColors[s + 1].g, faceColors[s + 1].b, faceColors[s + 1].a), colors.push(faceColors[s + 1].r, faceColors[s + 1].g, faceColors[s + 1].b, faceColors[s + 1].a), colors.push(faceColors[s + 2].r, faceColors[s + 2].g, faceColors[s + 2].b, faceColors[s + 2].a), colors.push(faceColors[s + 2].r, faceColors[s + 2].g, faceColors[s + 2].b, faceColors[s + 2].a))), cs !== s && (cs = s);}const e = 1 !== arc && enclose ? tessellation + 4 : tessellation;for (i = 0, s = 0; s < subdivisions; s++) {let i0 = 0,i1 = 0,i2 = 0,i3 = 0;for (j = 0; j < tessellation; j++) i0 = i * (e + 1) + j, i1 = (i + 1) * (e + 1) + j, i2 = i * (e + 1) + (j + 1), i3 = (i + 1) * (e + 1) + (j + 1), indices.push(i0, i1, i2), indices.push(i3, i2, i1);1 !== arc && enclose && (indices.push(i0 + 2, i1 + 2, i2 + 2), indices.push(i3 + 2, i2 + 2, i1 + 2), indices.push(i0 + 4, i1 + 4, i2 + 4), indices.push(i3 + 4, i2 + 4, i1 + 4)), i = hasRings ? i + 2 : i + 1;}const createCylinderCap = (isTop) => {const radius = isTop ? diameterTop / 2 : diameterBottom / 2;if (0 == radius) return;let angle, circleVector, i;const u = isTop ? faceUV[surfaceNb - 1] : faceUV[0];let c = null;faceColors && (c = isTop ? faceColors[surfaceNb - 1] : faceColors[0]);const vbase = positions.length / 3,offset = isTop ? height / 2 : -height / 2,center = new math_vector/* Vector3 */.P(0, offset, 0);positions.push(center.x, center.y, center.z), normals.push(0, isTop ? 1 : -1, 0);const v = u.y + .5 * (u.w - u.y);uvs.push(u.x + .5 * (u.z - u.x), compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v), c && colors.push(c.r, c.g, c.b, c.a);const textureScale = new math_vector/* Vector2 */.FM(.5, .5);for (i = 0; i <= tessellation; i++) {angle = 2 * Math.PI * i * arc / tessellation;const cos = Math.cos(-angle),sin = Math.sin(-angle);circleVector = new math_vector/* Vector3 */.P(cos * radius, offset, sin * radius);const textureCoordinate = new math_vector/* Vector2 */.FM(cos * textureScale.x + .5, sin * textureScale.y + .5);positions.push(circleVector.x, circleVector.y, circleVector.z), normals.push(0, isTop ? 1 : -1, 0);const v = u.y + (u.w - u.y) * textureCoordinate.y;uvs.push(u.x + (u.z - u.x) * textureCoordinate.x, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v), c && colors.push(c.r, c.g, c.b, c.a);}for (i = 0; i < tessellation; i++) isTop ? (indices.push(vbase), indices.push(vbase + (i + 2)), indices.push(vbase + (i + 1))) : (indices.push(vbase), indices.push(vbase + (i + 1)), indices.push(vbase + (i + 2)));};(cap === Meshes_mesh/* Mesh.CAP_START */.Kj.CAP_START || cap === Meshes_mesh/* Mesh.CAP_ALL */.Kj.CAP_ALL) && createCylinderCap(!1), (cap === Meshes_mesh/* Mesh.CAP_END */.Kj.CAP_END || cap === Meshes_mesh/* Mesh.CAP_ALL */.Kj.CAP_ALL) && createCylinderCap(!0), mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, faceColors && (vertexData.colors = colors), vertexData;}function CreateCylinder(name, options = {}, scene) {const cylinder = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), cylinder._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateCylinderVertexData(options);return vertexData.applyToMesh(cylinder, options.updatable), cylinder;}const CylinderBuilder = { CreateCylinder };mesh_vertexData/* VertexData.CreateCylinder */.x.CreateCylinder = CreateCylinderVertexData, Meshes_mesh/* Mesh.CreateCylinder */.Kj.CreateCylinder = (name, height, diameterTop, diameterBottom, tessellation, subdivisions, scene, updatable, sideOrientation) => {scene !== void 0 && scene instanceof core_scene/* Scene */.x || (scene !== void 0 && (sideOrientation = updatable || Meshes_mesh/* Mesh.DEFAULTSIDE */.Kj.DEFAULTSIDE, updatable = scene), scene = subdivisions, subdivisions = 1);const options = { height, diameterTop, diameterBottom, tessellation, subdivisions, sideOrientation, updatable };return CreateCylinder(name, options, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/torusBuilder.js
function CreateTorusVertexData(options) {const indices = [],positions = [],normals = [],uvs = [],diameter = options.diameter || 1,thickness = options.thickness || .5,tessellation = options.tessellation || 16,sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,stride = tessellation + 1;for (let i = 0; i <= tessellation; i++) {const u = i / tessellation,outerAngle = 2 * (i * Math.PI) / tessellation - Math.PI / 2,transform = math_vector/* Matrix.Translation */.y3.Translation(diameter / 2, 0, 0).multiply(math_vector/* Matrix.RotationY */.y3.RotationY(outerAngle));for (let j = 0; j <= tessellation; j++) {const v = 1 - j / tessellation,innerAngle = 2 * (j * Math.PI) / tessellation + Math.PI,dx = Math.cos(innerAngle),dy = Math.sin(innerAngle);let normal = new math_vector/* Vector3 */.P(dx, dy, 0),position = normal.scale(thickness / 2);const textureCoordinate = new math_vector/* Vector2 */.FM(u, v);position = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(position, transform), normal = math_vector/* Vector3.TransformNormal */.P.TransformNormal(normal, transform), positions.push(position.x, position.y, position.z), normals.push(normal.x, normal.y, normal.z), uvs.push(textureCoordinate.x, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - textureCoordinate.y : textureCoordinate.y);const nextI = (i + 1) % stride,nextJ = (j + 1) % stride;indices.push(i * stride + j), indices.push(i * stride + nextJ), indices.push(nextI * stride + j), indices.push(i * stride + nextJ), indices.push(nextI * stride + nextJ), indices.push(nextI * stride + j);}}mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreateTorus(name, options = {}, scene) {const torus = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), torus._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateTorusVertexData(options);return vertexData.applyToMesh(torus, options.updatable), torus;}const TorusBuilder = { CreateTorus };mesh_vertexData/* VertexData.CreateTorus */.x.CreateTorus = CreateTorusVertexData, Meshes_mesh/* Mesh.CreateTorus */.Kj.CreateTorus = (name, diameter, thickness, tessellation, scene, updatable, sideOrientation) => {return CreateTorus(name, { diameter, thickness, tessellation, sideOrientation, updatable }, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/groundMesh.js
Meshes_mesh/* Mesh._GroundMeshParser */.Kj._GroundMeshParser = (parsedMesh, scene) => GroundMesh.Parse(parsedMesh, scene);class GroundMesh extends Meshes_mesh/* Mesh */.Kj {constructor(name, scene) {super(name, scene), this.generateOctree = !1;}getClassName() {return "GroundMesh";}get subdivisions() {return Math.min(this._subdivisionsX, this._subdivisionsY);}get subdivisionsX() {return this._subdivisionsX;}get subdivisionsY() {return this._subdivisionsY;}optimize(chunksCount, octreeBlocksSize = 32) {this._subdivisionsX = chunksCount, this._subdivisionsY = chunksCount, this.subdivide(chunksCount);const thisAsAny = this;thisAsAny.createOrUpdateSubmeshesOctree && thisAsAny.createOrUpdateSubmeshesOctree(octreeBlocksSize);}getHeightAtCoordinates(x, z) {const world = this.getWorldMatrix(),invMat = math_vector/* TmpVectors.Matrix.5 */.jp.Matrix[5];world.invertToRef(invMat);const tmpVect = math_vector/* TmpVectors.Vector3.8 */.jp.Vector3[8];if (math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(x, 0, z, invMat, tmpVect), x = tmpVect.x, z = tmpVect.z, x < this._minX || x >= this._maxX || z <= this._minZ || z > this._maxZ) return this.position.y;this._heightQuads && 0 != this._heightQuads.length || (this._initHeightQuads(), this._computeHeightQuads());const facet = this._getFacetAt(x, z),y = -(facet.x * x + facet.z * z + facet.w) / facet.y;return math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(0, y, 0, world, tmpVect), tmpVect.y;}getNormalAtCoordinates(x, z) {const normal = new math_vector/* Vector3 */.P(0, 1, 0);return this.getNormalAtCoordinatesToRef(x, z, normal), normal;}getNormalAtCoordinatesToRef(x, z, ref) {const world = this.getWorldMatrix(),tmpMat = math_vector/* TmpVectors.Matrix.5 */.jp.Matrix[5];world.invertToRef(tmpMat);const tmpVect = math_vector/* TmpVectors.Vector3.8 */.jp.Vector3[8];if (math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(x, 0, z, tmpMat, tmpVect), x = tmpVect.x, z = tmpVect.z, x < this._minX || x > this._maxX || z < this._minZ || z > this._maxZ) return this;this._heightQuads && 0 != this._heightQuads.length || (this._initHeightQuads(), this._computeHeightQuads());const facet = this._getFacetAt(x, z);return math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(facet.x, facet.y, facet.z, world, ref), this;}updateCoordinateHeights() {return this._heightQuads && 0 != this._heightQuads.length || this._initHeightQuads(), this._computeHeightQuads(), this;}_getFacetAt(x, z) {const col = Math.floor((x + this._maxX) * this._subdivisionsX / this._width),row = Math.floor(-(z + this._maxZ) * this._subdivisionsY / this._height + this._subdivisionsY),quad = this._heightQuads[row * this._subdivisionsX + col];let facet;return facet = z < quad.slope.x * x + quad.slope.y ? quad.facet1 : quad.facet2, facet;}_initHeightQuads() {const subdivisionsX = this._subdivisionsX,subdivisionsY = this._subdivisionsY;this._heightQuads = [];for (let row = 0; row < subdivisionsY; row++) for (let col = 0; col < subdivisionsX; col++) {const quad = { slope: math_vector/* Vector2.Zero */.FM.Zero(), facet1: new math_vector/* Vector4 */.Lt(0, 0, 0, 0), facet2: new math_vector/* Vector4 */.Lt(0, 0, 0, 0) };this._heightQuads[row * subdivisionsX + col] = quad;}return this;}_computeHeightQuads() {const positions = this.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);if (!positions) return this;const v1 = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3],v2 = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],v3 = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1],v4 = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],v1v2 = math_vector/* TmpVectors.Vector3.4 */.jp.Vector3[4],v1v3 = math_vector/* TmpVectors.Vector3.5 */.jp.Vector3[5],v1v4 = math_vector/* TmpVectors.Vector3.6 */.jp.Vector3[6],norm1 = math_vector/* TmpVectors.Vector3.7 */.jp.Vector3[7],norm2 = math_vector/* TmpVectors.Vector3.8 */.jp.Vector3[8];let i = 0,j = 0,k = 0,cd = 0,h = 0,d1 = 0,d2 = 0;const subdivisionsX = this._subdivisionsX,subdivisionsY = this._subdivisionsY;for (let row = 0; row < subdivisionsY; row++) for (let col = 0; col < subdivisionsX; col++) {i = 3 * col, j = 3 * (row * (subdivisionsX + 1)), k = 3 * ((row + 1) * (subdivisionsX + 1)), v1.x = positions[j + i], v1.y = positions[j + i + 1], v1.z = positions[j + i + 2], v2.x = positions[j + i + 3], v2.y = positions[j + i + 4], v2.z = positions[j + i + 5], v3.x = positions[k + i], v3.y = positions[k + i + 1], v3.z = positions[k + i + 2], v4.x = positions[k + i + 3], v4.y = positions[k + i + 4], v4.z = positions[k + i + 5], cd = (v4.z - v1.z) / (v4.x - v1.x), h = v1.z - cd * v1.x, v2.subtractToRef(v1, v1v2), v3.subtractToRef(v1, v1v3), v4.subtractToRef(v1, v1v4), math_vector/* Vector3.CrossToRef */.P.CrossToRef(v1v4, v1v3, norm1), math_vector/* Vector3.CrossToRef */.P.CrossToRef(v1v2, v1v4, norm2), norm1.normalize(), norm2.normalize(), d1 = -(norm1.x * v1.x + norm1.y * v1.y + norm1.z * v1.z), d2 = -(norm2.x * v2.x + norm2.y * v2.y + norm2.z * v2.z);const quad = this._heightQuads[row * subdivisionsX + col];quad.slope.copyFromFloats(cd, h), quad.facet1.copyFromFloats(norm1.x, norm1.y, norm1.z, d1), quad.facet2.copyFromFloats(norm2.x, norm2.y, norm2.z, d2);}return this;}serialize(serializationObject) {super.serialize(serializationObject), serializationObject.subdivisionsX = this._subdivisionsX, serializationObject.subdivisionsY = this._subdivisionsY, serializationObject.minX = this._minX, serializationObject.maxX = this._maxX, serializationObject.minZ = this._minZ, serializationObject.maxZ = this._maxZ, serializationObject.width = this._width, serializationObject.height = this._height;}static Parse(parsedMesh, scene) {const result = new GroundMesh(parsedMesh.name, scene);return result._subdivisionsX = parsedMesh.subdivisionsX || 1, result._subdivisionsY = parsedMesh.subdivisionsY || 1, result._minX = parsedMesh.minX, result._maxX = parsedMesh.maxX, result._minZ = parsedMesh.minZ, result._maxZ = parsedMesh.maxZ, result._width = parsedMesh.width, result._height = parsedMesh.height, result;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/groundBuilder.js
function CreateGroundVertexData(options) {const indices = [],positions = [],normals = [],uvs = [];let row, col;const width = options.width || 1,height = options.height || 1,subdivisionsX = options.subdivisionsX || options.subdivisions || 1,subdivisionsY = options.subdivisionsY || options.subdivisions || 1;for (row = 0; row <= subdivisionsY; row++) for (col = 0; col <= subdivisionsX; col++) {const position = new math_vector/* Vector3 */.P(col * width / subdivisionsX - width / 2, 0, (subdivisionsY - row) * height / subdivisionsY - height / 2),normal = new math_vector/* Vector3 */.P(0, 1, 0);positions.push(position.x, position.y, position.z), normals.push(normal.x, normal.y, normal.z), uvs.push(col / subdivisionsX, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? row / subdivisionsY : 1 - row / subdivisionsY);}for (row = 0; row < subdivisionsY; row++) for (col = 0; col < subdivisionsX; col++) indices.push(col + 1 + (row + 1) * (subdivisionsX + 1)), indices.push(col + 1 + row * (subdivisionsX + 1)), indices.push(col + row * (subdivisionsX + 1)), indices.push(col + (row + 1) * (subdivisionsX + 1)), indices.push(col + 1 + (row + 1) * (subdivisionsX + 1)), indices.push(col + row * (subdivisionsX + 1));const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreateTiledGroundVertexData(options) {function applyTile(xTileMin, zTileMin, xTileMax, zTileMax) {const base = positions.length / 3,rowLength = precision.w + 1;for (row = 0; row < precision.h; row++) for (col = 0; col < precision.w; col++) {const square = [base + col + row * rowLength, base + (col + 1) + row * rowLength, base + (col + 1) + (row + 1) * rowLength, base + col + (row + 1) * rowLength];indices.push(square[1]), indices.push(square[2]), indices.push(square[3]), indices.push(square[0]), indices.push(square[1]), indices.push(square[3]);}const position = math_vector/* Vector3.Zero */.P.Zero(),normal = new math_vector/* Vector3 */.P(0, 1, 0);for (row = 0; row <= precision.h; row++) for (position.z = row * (zTileMax - zTileMin) / precision.h + zTileMin, col = 0; col <= precision.w; col++) position.x = col * (xTileMax - xTileMin) / precision.w + xTileMin, position.y = 0, positions.push(position.x, position.y, position.z), normals.push(normal.x, normal.y, normal.z), uvs.push(col / precision.w, row / precision.h);}const xmin = void 0 !== options.xmin && null !== options.xmin ? options.xmin : -1,zmin = void 0 !== options.zmin && null !== options.zmin ? options.zmin : -1,xmax = void 0 !== options.xmax && null !== options.xmax ? options.xmax : 1,zmax = void 0 !== options.zmax && null !== options.zmax ? options.zmax : 1,subdivisions = options.subdivisions || { w: 1, h: 1 },precision = options.precision || { w: 1, h: 1 },indices = [],positions = [],normals = [],uvs = [];let row, col, tileRow, tileCol;subdivisions.h = 1 > subdivisions.h ? 1 : subdivisions.h, subdivisions.w = 1 > subdivisions.w ? 1 : subdivisions.w, precision.w = 1 > precision.w ? 1 : precision.w, precision.h = 1 > precision.h ? 1 : precision.h;const tileSize = { w: (xmax - xmin) / subdivisions.w, h: (zmax - zmin) / subdivisions.h };for (tileRow = 0; tileRow < subdivisions.h; tileRow++) for (tileCol = 0; tileCol < subdivisions.w; tileCol++) applyTile(xmin + tileCol * tileSize.w, zmin + tileRow * tileSize.h, xmin + (tileCol + 1) * tileSize.w, zmin + (tileRow + 1) * tileSize.h);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreateGroundFromHeightMapVertexData(options) {const indices = [],positions = [],normals = [],uvs = [];let row, col;const filter = options.colorFilter || new math_color/* Color3 */.Wo(.3, .59, .11),alphaFilter = options.alphaFilter || 0;let invert = !1;if (options.minHeight > options.maxHeight) {invert = !0;const temp = options.maxHeight;options.maxHeight = options.minHeight, options.minHeight = temp;}for (row = 0; row <= options.subdivisions; row++) for (col = 0; col <= options.subdivisions; col++) {const position = new math_vector/* Vector3 */.P(col * options.width / options.subdivisions - options.width / 2, 0, (options.subdivisions - row) * options.height / options.subdivisions - options.height / 2),heightMapX = 0 | (position.x + options.width / 2) / options.width * (options.bufferWidth - 1),heightMapY = 0 | (1 - (position.z + options.height / 2) / options.height) * (options.bufferHeight - 1),pos = 4 * (heightMapX + heightMapY * options.bufferWidth);let r = options.buffer[pos] / 255,g = options.buffer[pos + 1] / 255,b = options.buffer[pos + 2] / 255;const a = options.buffer[pos + 3] / 255;invert && (r = 1 - r, g = 1 - g, b = 1 - b);const gradient = r * filter.r + g * filter.g + b * filter.b;position.y = a >= alphaFilter ? options.minHeight + (options.maxHeight - options.minHeight) * gradient : options.minHeight - math_constants/* Epsilon */.kn, positions.push(position.x, position.y, position.z), normals.push(0, 0, 0), uvs.push(col / options.subdivisions, 1 - row / options.subdivisions);}for (row = 0; row < options.subdivisions; row++) for (col = 0; col < options.subdivisions; col++) {const idx1 = col + 1 + (row + 1) * (options.subdivisions + 1),idx2 = col + 1 + row * (options.subdivisions + 1),idx3 = col + row * (options.subdivisions + 1),idx4 = col + (row + 1) * (options.subdivisions + 1),isVisibleIdx1 = positions[3 * idx1 + 1] >= options.minHeight,isVisibleIdx2 = positions[3 * idx2 + 1] >= options.minHeight,isVisibleIdx3 = positions[3 * idx3 + 1] >= options.minHeight;isVisibleIdx1 && isVisibleIdx2 && isVisibleIdx3 && (indices.push(idx1), indices.push(idx2), indices.push(idx3));const isVisibleIdx4 = positions[3 * idx4 + 1] >= options.minHeight;isVisibleIdx4 && isVisibleIdx1 && isVisibleIdx3 && (indices.push(idx4), indices.push(idx1), indices.push(idx3));}mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(positions, indices, normals);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreateGround(name, options = {}, scene) {const ground = new GroundMesh(name, scene);ground._setReady(!1), ground._subdivisionsX = options.subdivisionsX || options.subdivisions || 1, ground._subdivisionsY = options.subdivisionsY || options.subdivisions || 1, ground._width = options.width || 1, ground._height = options.height || 1, ground._maxX = ground._width / 2, ground._maxZ = ground._height / 2, ground._minX = -ground._maxX, ground._minZ = -ground._maxZ;const vertexData = CreateGroundVertexData(options);return vertexData.applyToMesh(ground, options.updatable), ground._setReady(!0), ground;}function CreateTiledGround(name, options, scene = null) {const tiledGround = new Meshes_mesh/* Mesh */.Kj(name, scene),vertexData = CreateTiledGroundVertexData(options);return vertexData.applyToMesh(tiledGround, options.updatable), tiledGround;}function CreateGroundFromHeightMap(name, url, options = {}, scene = null) {const width = options.width || 10,height = options.height || 10,subdivisions = options.subdivisions || 1,minHeight = options.minHeight || 0,maxHeight = options.maxHeight || 1,filter = options.colorFilter || new math_color/* Color3 */.Wo(.3, .59, .11),alphaFilter = options.alphaFilter || 0,updatable = options.updatable,onReady = options.onReady;scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;const ground = new GroundMesh(name, scene);ground._subdivisionsX = subdivisions, ground._subdivisionsY = subdivisions, ground._width = width, ground._height = height, ground._maxX = ground._width / 2, ground._maxZ = ground._height / 2, ground._minX = -ground._maxX, ground._minZ = -ground._maxZ, ground._setReady(!1);const onload = (img) => {const bufferWidth = img.width,bufferHeight = img.height;if (scene.isDisposed) return;const buffer = null === scene || void 0 === scene ? void 0 : scene.getEngine().resizeImageBitmap(img, bufferWidth, bufferHeight),vertexData = CreateGroundFromHeightMapVertexData({ width: width, height: height, subdivisions: subdivisions, minHeight: minHeight, maxHeight: maxHeight, colorFilter: filter, buffer: buffer, bufferWidth: bufferWidth, bufferHeight: bufferHeight, alphaFilter: alphaFilter });vertexData.applyToMesh(ground, updatable), onReady && onReady(ground), ground._setReady(!0);};return tools/* Tools.LoadImage */.w1.LoadImage(url, onload, () => {}, scene.offlineProvider), ground;}const GroundBuilder = { CreateGround, CreateGroundFromHeightMap, CreateTiledGround };mesh_vertexData/* VertexData.CreateGround */.x.CreateGround = CreateGroundVertexData, mesh_vertexData/* VertexData.CreateTiledGround */.x.CreateTiledGround = CreateTiledGroundVertexData, mesh_vertexData/* VertexData.CreateGroundFromHeightMap */.x.CreateGroundFromHeightMap = CreateGroundFromHeightMapVertexData, Meshes_mesh/* Mesh.CreateGround */.Kj.CreateGround = (name, width, height, subdivisions, scene, updatable) => {const options = { width, height, subdivisions, updatable };return CreateGround(name, options, scene);}, Meshes_mesh/* Mesh.CreateTiledGround */.Kj.CreateTiledGround = (name, xmin, zmin, xmax, zmax, subdivisions, precision, scene, updatable) => {const options = { xmin, zmin, xmax, zmax, subdivisions, precision, updatable };return CreateTiledGround(name, options, scene);}, Meshes_mesh/* Mesh.CreateGroundFromHeightMap */.Kj.CreateGroundFromHeightMap = (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady, alphaFilter) => {const options = { width, height, subdivisions, minHeight, maxHeight, updatable, onReady, alphaFilter };return CreateGroundFromHeightMap(name, url, options, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/VR/vrExperienceHelper.js
class VRExperienceHelperGazer {constructor(scene, gazeTrackerToClone = null) {if (this.scene = scene, this._pointerDownOnMeshAsked = !1, this._isActionableMesh = !1, this._teleportationRequestInitiated = !1, this._teleportationBackRequestInitiated = !1, this._rotationRightAsked = !1, this._rotationLeftAsked = !1, this._dpadPressed = !0, this._activePointer = !1, this._id = VRExperienceHelperGazer._IdCounter++, !gazeTrackerToClone) {this._gazeTracker = CreateTorus("gazeTracker", { diameter: .0035, thickness: .0025, tessellation: 20, updatable: !1 }, scene), this._gazeTracker.bakeCurrentTransformIntoVertices(), this._gazeTracker.isPickable = !1, this._gazeTracker.isVisible = !1;const targetMat = new standardMaterial/* StandardMaterial */.K("targetMat", scene);targetMat.specularColor = math_color/* Color3.Black */.Wo.Black(), targetMat.emissiveColor = new math_color/* Color3 */.Wo(.7, .7, .7), targetMat.backFaceCulling = !1, this._gazeTracker.material = targetMat;} else this._gazeTracker = gazeTrackerToClone.clone("gazeTracker");}_getForwardRay(length) {return new Ray(math_vector/* Vector3.Zero */.P.Zero(), new math_vector/* Vector3 */.P(0, 0, length));}_selectionPointerDown() {this._pointerDownOnMeshAsked = !0, this._currentHit && this.scene.simulatePointerDown(this._currentHit, { pointerId: this._id });}_selectionPointerUp() {this._currentHit && this.scene.simulatePointerUp(this._currentHit, { pointerId: this._id }), this._pointerDownOnMeshAsked = !1;}_activatePointer() {this._activePointer = !0;}_deactivatePointer() {this._activePointer = !1;}_updatePointerDistance(distance = 100) {}dispose() {this._interactionsEnabled = !1, this._teleportationEnabled = !1, this._gazeTracker && this._gazeTracker.dispose();}}VRExperienceHelperGazer._IdCounter = 0;class VRExperienceHelperControllerGazer extends VRExperienceHelperGazer {constructor(webVRController, scene, gazeTrackerToClone) {super(scene, gazeTrackerToClone), this.webVRController = webVRController, this._laserPointer = CreateCylinder("laserPointer", { updatable: !1, height: 1, diameterTop: .004, diameterBottom: 2e-4, tessellation: 20, subdivisions: 1 }, scene);const laserPointerMaterial = new standardMaterial/* StandardMaterial */.K("laserPointerMat", scene);if (laserPointerMaterial.emissiveColor = new math_color/* Color3 */.Wo(.7, .7, .7), laserPointerMaterial.alpha = .6, this._laserPointer.material = laserPointerMaterial, this._laserPointer.rotation.x = Math.PI / 2, this._laserPointer.position.z = -.5, this._laserPointer.isVisible = !1, this._laserPointer.isPickable = !1, !webVRController.mesh) {const preloadMesh = new Meshes_mesh/* Mesh */.Kj("preloadControllerMesh", scene),preloadPointerPose = new Meshes_mesh/* Mesh */.Kj(PoseEnabledController.POINTING_POSE, scene);preloadPointerPose.rotation.x = -.7, preloadMesh.addChild(preloadPointerPose), webVRController.attachToMesh(preloadMesh);}this._setLaserPointerParent(webVRController.mesh), this._meshAttachedObserver = webVRController._meshAttachedObservable.add((mesh) => {this._setLaserPointerParent(mesh);});}_getForwardRay(length) {return this.webVRController.getForwardRay(length);}_activatePointer() {super._activatePointer(), this._laserPointer.isVisible = !0;}_deactivatePointer() {super._deactivatePointer(), this._laserPointer.isVisible = !1;}_setLaserPointerColor(color) {this._laserPointer.material.emissiveColor = color;}_setLaserPointerLightingDisabled(disabled) {this._laserPointer.material.disableLighting = disabled;}_setLaserPointerParent(mesh) {const makeNotPick = (root) => {root.isPickable = !1, root.getChildMeshes().forEach((c) => {makeNotPick(c);});};makeNotPick(mesh);const meshChildren = mesh.getChildren(void 0, !1);let laserParent = mesh;this.webVRController._pointingPoseNode = null;for (let i = 0; i < meshChildren.length; i++) if (meshChildren[i].name && 0 <= meshChildren[i].name.indexOf(PoseEnabledController.POINTING_POSE)) {laserParent = meshChildren[i], this.webVRController._pointingPoseNode = laserParent;break;}this._laserPointer.parent = laserParent;}_updatePointerDistance(distance = 100) {this._laserPointer.scaling.y = distance, this._laserPointer.position.z = -distance / 2;}dispose() {super.dispose(), this._laserPointer.dispose(), this._meshAttachedObserver && this.webVRController._meshAttachedObservable.remove(this._meshAttachedObserver);}}class VRExperienceHelperCameraGazer extends VRExperienceHelperGazer {constructor(_getCamera, scene) {super(scene), this._getCamera = _getCamera;}_getForwardRay(length) {const camera = this._getCamera();return camera ? camera.getForwardRay(length) : new Ray(math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Forward */.P.Forward());}}class OnAfterEnteringVRObservableEvent {}class VRExperienceHelper {get onEnteringVR() {return this.onEnteringVRObservable;}get onExitingVR() {return this.onExitingVRObservable;}get onControllerMeshLoaded() {return this.onControllerMeshLoadedObservable;}get teleportationTarget() {return this._teleportationTarget;}set teleportationTarget(value) {value && (value.name = "teleportationTarget", this._isDefaultTeleportationTarget = !1, this._teleportationTarget = value);}get gazeTrackerMesh() {return this._cameraGazer._gazeTracker;}set gazeTrackerMesh(value) {value && (this._cameraGazer._gazeTracker && this._cameraGazer._gazeTracker.dispose(), this._leftController && this._leftController._gazeTracker && this._leftController._gazeTracker.dispose(), this._rightController && this._rightController._gazeTracker && this._rightController._gazeTracker.dispose(), this._cameraGazer._gazeTracker = value, this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(), this._cameraGazer._gazeTracker.isPickable = !1, this._cameraGazer._gazeTracker.isVisible = !1, this._cameraGazer._gazeTracker.name = "gazeTracker", this._leftController && (this._leftController._gazeTracker = this._cameraGazer._gazeTracker.clone("gazeTracker")), this._rightController && (this._rightController._gazeTracker = this._cameraGazer._gazeTracker.clone("gazeTracker")));}get leftControllerGazeTrackerMesh() {return this._leftController ? this._leftController._gazeTracker : null;}get rightControllerGazeTrackerMesh() {return this._rightController ? this._rightController._gazeTracker : null;}get displayGaze() {return this._displayGaze;}set displayGaze(value) {this._displayGaze = value, value || (this._cameraGazer._gazeTracker.isVisible = !1, this._leftController && (this._leftController._gazeTracker.isVisible = !1), this._rightController && (this._rightController._gazeTracker.isVisible = !1));}get displayLaserPointer() {return this._displayLaserPointer;}set displayLaserPointer(value) {this._displayLaserPointer = value, value ? (this._rightController && this._rightController._activatePointer(), this._leftController && this._leftController._activatePointer()) : (this._rightController && (this._rightController._deactivatePointer(), this._rightController._gazeTracker.isVisible = !1), this._leftController && (this._leftController._deactivatePointer(), this._leftController._gazeTracker.isVisible = !1));}get deviceOrientationCamera() {return this._deviceOrientationCamera;}get currentVRCamera() {return this._webVRready ? this._webVRCamera : this._scene.activeCamera;}get webVRCamera() {return this._webVRCamera;}get vrDeviceOrientationCamera() {return this._vrDeviceOrientationCamera;}get vrButton() {return this._btnVR;}get _teleportationRequestInitiated() {const result = this._cameraGazer._teleportationRequestInitiated || null !== this._leftController && this._leftController._teleportationRequestInitiated || null !== this._rightController && this._rightController._teleportationRequestInitiated;return result;}constructor(scene, webVROptions = {}) {this.webVROptions = webVROptions, this._webVRsupported = !1, this._webVRready = !1, this._webVRrequesting = !1, this._webVRpresenting = !1, this._fullscreenVRpresenting = !1, this.enableGazeEvenWhenNoPointerLock = !1, this.exitVROnDoubleTap = !0, this.onEnteringVRObservable = new observable/* Observable */.y$(), this.onAfterEnteringVRObservable = new observable/* Observable */.y$(), this.onExitingVRObservable = new observable/* Observable */.y$(), this.onControllerMeshLoadedObservable = new observable/* Observable */.y$(), this._useCustomVRButton = !1, this._teleportationRequested = !1, this._teleportActive = !1, this._floorMeshesCollection = [], this._teleportationMode = VRExperienceHelper.TELEPORTATIONMODE_CONSTANTTIME, this._teleportationTime = 122, this._teleportationSpeed = 20, this._rotationAllowed = !0, this._teleportBackwardsVector = new math_vector/* Vector3 */.P(0, -1, -1), this._isDefaultTeleportationTarget = !0, this._teleportationFillColor = "#444444", this._teleportationBorderColor = "#FFFFFF", this._rotationAngle = 0, this._haloCenter = new math_vector/* Vector3 */.P(0, 0, 0), this._padSensibilityUp = .65, this._padSensibilityDown = .35, this._leftController = null, this._rightController = null, this._gazeColor = new math_color/* Color3 */.Wo(.7, .7, .7), this._laserColor = new math_color/* Color3 */.Wo(.7, .7, .7), this._pickedLaserColor = new math_color/* Color3 */.Wo(.2, .2, 1), this._pickedGazeColor = new math_color/* Color3 */.Wo(0, 0, 1), this.onNewMeshSelected = new observable/* Observable */.y$(), this.onMeshSelectedWithController = new observable/* Observable */.y$(), this.onNewMeshPicked = new observable/* Observable */.y$(), this.onBeforeCameraTeleport = new observable/* Observable */.y$(), this.onAfterCameraTeleport = new observable/* Observable */.y$(), this.onSelectedMeshUnselected = new observable/* Observable */.y$(), this.teleportationEnabled = !0, this._teleportationInitialized = !1, this._interactionsEnabled = !1, this._interactionsRequested = !1, this._displayGaze = !0, this._displayLaserPointer = !0, this.updateGazeTrackerScale = !0, this.updateGazeTrackerColor = !0, this.updateControllerLaserColor = !0, this.requestPointerLockOnFullScreen = !0, this.xrTestDone = !1, this._onResize = () => {this._moveButtonToBottomRight(), this._fullscreenVRpresenting && this._webVRready && this.exitVR();}, this._onFullscreenChange = () => {this._fullscreenVRpresenting = !!document.fullscreenElement, !this._fullscreenVRpresenting && this._inputElement && (this.exitVR(), !this._useCustomVRButton && this._btnVR && (this._btnVR.style.top = this._inputElement.offsetTop + this._inputElement.offsetHeight - 70 + "px", this._btnVR.style.left = this._inputElement.offsetLeft + this._inputElement.offsetWidth - 100 + "px", this._updateButtonVisibility()));}, this._cachedAngularSensibility = { angularSensibilityX: null, angularSensibilityY: null, angularSensibility: null }, this._beforeRender = () => {this._leftController && this._leftController._activePointer && this._castRayAndSelectObject(this._leftController), this._rightController && this._rightController._activePointer && this._castRayAndSelectObject(this._rightController), this._noControllerIsActive && (this._scene.getEngine().isPointerLock || this.enableGazeEvenWhenNoPointerLock) ? this._castRayAndSelectObject(this._cameraGazer) : this._cameraGazer._gazeTracker.isVisible = !1;}, this._onNewGamepadConnected = (gamepad) => {if (gamepad.type !== Gamepad.POSE_ENABLED) gamepad.leftStick && gamepad.onleftstickchanged((stickValues) => {this._teleportationInitialized && this.teleportationEnabled && (!this._leftController && !this._rightController || this._leftController && !this._leftController._activePointer && this._rightController && !this._rightController._activePointer) && (this._checkTeleportWithRay(stickValues, this._cameraGazer), this._checkTeleportBackwards(stickValues, this._cameraGazer));}), gamepad.rightStick && gamepad.onrightstickchanged((stickValues) => {this._teleportationInitialized && this._checkRotate(stickValues, this._cameraGazer);}), gamepad.type === Gamepad.XBOX && (gamepad.onbuttondown((buttonPressed) => {this._interactionsEnabled && buttonPressed === Xbox360Button.A && this._cameraGazer._selectionPointerDown();}), gamepad.onbuttonup((buttonPressed) => {this._interactionsEnabled && buttonPressed === Xbox360Button.A && this._cameraGazer._selectionPointerUp();}));else {const webVRController = gamepad,controller = new VRExperienceHelperControllerGazer(webVRController, this._scene, this._cameraGazer._gazeTracker);"right" === webVRController.hand || this._leftController && this._leftController.webVRController != webVRController ? this._rightController = controller : this._leftController = controller, this._tryEnableInteractionOnController(controller);}}, this._tryEnableInteractionOnController = (controller) => {this._interactionsRequested && !controller._interactionsEnabled && this._enableInteractionOnController(controller), this._teleportationRequested && !controller._teleportationEnabled && this._enableTeleportationOnController(controller);}, this._onNewGamepadDisconnected = (gamepad) => {gamepad instanceof WebVRController && ("left" === gamepad.hand && null != this._leftController && (this._leftController.dispose(), this._leftController = null), "right" === gamepad.hand && null != this._rightController && (this._rightController.dispose(), this._rightController = null));}, this._workingVector = math_vector/* Vector3.Zero */.P.Zero(), this._workingQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this._workingMatrix = math_vector/* Matrix.Identity */.y3.Identity(), logger/* Logger.Warn */.Y.Warn("WebVR is deprecated. Please avoid using this experience helper and use the WebXR experience helper instead"), this._scene = scene, this._inputElement = scene.getEngine().getInputElement();const vrSupported = ("getVRDisplays" in navigator);if (vrSupported || void 0 !== webVROptions.useXR || (webVROptions.useXR = !0), void 0 === webVROptions.createFallbackVRDeviceOrientationFreeCamera && (webVROptions.createFallbackVRDeviceOrientationFreeCamera = !0), void 0 === webVROptions.createDeviceOrientationCamera && (webVROptions.createDeviceOrientationCamera = !0), void 0 === webVROptions.laserToggle && (webVROptions.laserToggle = !0), void 0 === webVROptions.defaultHeight && (webVROptions.defaultHeight = 1.7), webVROptions.useCustomVRButton && (this._useCustomVRButton = !0, webVROptions.customVRButton && (this._btnVR = webVROptions.customVRButton)), webVROptions.rayLength && (this._rayLength = webVROptions.rayLength), this._defaultHeight = webVROptions.defaultHeight, webVROptions.positionScale && (this._rayLength *= webVROptions.positionScale, this._defaultHeight *= webVROptions.positionScale), this._hasEnteredVR = !1, this._position = this._scene.activeCamera ? this._scene.activeCamera.position.clone() : new math_vector/* Vector3 */.P(0, this._defaultHeight, 0), webVROptions.createDeviceOrientationCamera || !this._scene.activeCamera) {if (this._deviceOrientationCamera = new DeviceOrientationCamera("deviceOrientationVRHelper", this._position.clone(), scene), this._scene.activeCamera && (this._deviceOrientationCamera.minZ = this._scene.activeCamera.minZ, this._deviceOrientationCamera.maxZ = this._scene.activeCamera.maxZ, this._scene.activeCamera instanceof targetCamera/* TargetCamera */.C && this._scene.activeCamera.rotation)) {const targetCamera = this._scene.activeCamera;targetCamera.rotationQuaternion ? this._deviceOrientationCamera.rotationQuaternion.copyFrom(targetCamera.rotationQuaternion) : this._deviceOrientationCamera.rotationQuaternion.copyFrom(math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(targetCamera.rotation.y, targetCamera.rotation.x, targetCamera.rotation.z)), this._deviceOrientationCamera.rotation = targetCamera.rotation.clone();}this._scene.activeCamera = this._deviceOrientationCamera, this._inputElement && this._scene.activeCamera.attachControl();} else this._existingCamera = this._scene.activeCamera;this.webVROptions.useXR && navigator.xr ? WebXRSessionManager.IsSessionSupportedAsync("immersive-vr").then((supported) => {supported ? (logger/* Logger.Log */.Y.Log("Using WebXR. It is recommended to use the WebXRDefaultExperience directly"), scene.createDefaultXRExperienceAsync({ floorMeshes: webVROptions.floorMeshes || [] }).then((xr) => {this.xr = xr, this.xrTestDone = !0, this._cameraGazer = new VRExperienceHelperCameraGazer(() => this.xr.baseExperience.camera, scene), this.xr.baseExperience.onStateChangedObservable.add((state) => {state === WebXRState.ENTERING_XR ? (this.onEnteringVRObservable.notifyObservers(this), this._interactionsEnabled || this.xr.pointerSelection.detach(), this.xr.pointerSelection.displayLaserPointer = this._displayLaserPointer) : state === WebXRState.EXITING_XR ? (this.onExitingVRObservable.notifyObservers(this), this._scene.getEngine().resize()) : state === WebXRState.IN_XR ? this._hasEnteredVR = !0 : state === WebXRState.NOT_IN_XR ? this._hasEnteredVR = !1 : void 0;});})) : this._completeVRInit(scene, webVROptions);}) : this._completeVRInit(scene, webVROptions);}_completeVRInit(scene, webVROptions) {if (this.xrTestDone = !0, webVROptions.createFallbackVRDeviceOrientationFreeCamera && (webVROptions.useMultiview && (!webVROptions.vrDeviceOrientationCameraMetrics && (webVROptions.vrDeviceOrientationCameraMetrics = VRCameraMetrics.GetDefault()), webVROptions.vrDeviceOrientationCameraMetrics.multiviewEnabled = !0), this._vrDeviceOrientationCamera = new VRDeviceOrientationFreeCamera("VRDeviceOrientationVRHelper", this._position, this._scene, !0, webVROptions.vrDeviceOrientationCameraMetrics), this._vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE), this._webVRCamera = new WebVRFreeCamera("WebVRHelper", this._position, this._scene, webVROptions), this._webVRCamera.useStandingMatrix(), this._cameraGazer = new VRExperienceHelperCameraGazer(() => this.currentVRCamera, scene), !this._useCustomVRButton) {this._btnVR = document.createElement("BUTTON"), this._btnVR.className = "babylonVRicon", this._btnVR.id = "babylonVRiconbtn", this._btnVR.title = "Click to switch to VR";const url = window.SVGSVGElement ? "data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A" : "https://cdn.babylonjs.com/Assets/vrButton.png";let css = ".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(" + url + "); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";css += ".babylonVRicon.vrdisplaypresenting { display: none; }";const style = document.createElement("style");style.appendChild(document.createTextNode(css)), document.getElementsByTagName("head")[0].appendChild(style), this._moveButtonToBottomRight();}this._btnVR && this._btnVR.addEventListener("click", () => {this.isInVRMode ? this._scene.getEngine().disableVR() : this.enterVR();});const hostWindow = this._scene.getEngine().getHostWindow();hostWindow && (hostWindow.addEventListener("resize", this._onResize), document.addEventListener("fullscreenchange", this._onFullscreenChange, !1), webVROptions.createFallbackVRDeviceOrientationFreeCamera ? this._displayVRButton() : this._scene.getEngine().onVRDisplayChangedObservable.add((e) => {e.vrDisplay && this._displayVRButton();}), this._onKeyDown = (event) => {27 === event.keyCode && this.isInVRMode && this.exitVR();}, document.addEventListener("keydown", this._onKeyDown), this._scene.onPrePointerObservable.add(() => {this._hasEnteredVR && this.exitVROnDoubleTap && (this.exitVR(), this._fullscreenVRpresenting && this._scene.getEngine().exitFullscreen());}, pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP, !1), this._onVRDisplayChangedBind = (eventArgs) => this._onVRDisplayChanged(eventArgs), this._onVrDisplayPresentChangeBind = () => this._onVrDisplayPresentChange(), this._onVRRequestPresentStart = () => {this._webVRrequesting = !0, this._updateButtonVisibility();}, this._onVRRequestPresentComplete = () => {this._webVRrequesting = !1, this._updateButtonVisibility();}, scene.getEngine().onVRDisplayChangedObservable.add(this._onVRDisplayChangedBind), scene.getEngine().onVRRequestPresentStart.add(this._onVRRequestPresentStart), scene.getEngine().onVRRequestPresentComplete.add(this._onVRRequestPresentComplete), hostWindow.addEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChangeBind), scene.onDisposeObservable.add(() => {this.dispose();}), this._webVRCamera.onControllerMeshLoadedObservable.add((webVRController) => this._onDefaultMeshLoaded(webVRController)), this._scene.gamepadManager.onGamepadConnectedObservable.add(this._onNewGamepadConnected), this._scene.gamepadManager.onGamepadDisconnectedObservable.add(this._onNewGamepadDisconnected), this._updateButtonVisibility(), this._circleEase = new CircleEase(), this._circleEase.setEasingMode(EasingFunction.EASINGMODE_EASEINOUT), this._teleportationEasing = this._circleEase, scene.onPointerObservable.add((e) => {this._interactionsEnabled && scene.activeCamera === this.vrDeviceOrientationCamera && "mouse" === e.event.pointerType && (e.type === pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN ? this._cameraGazer._selectionPointerDown() : e.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP && this._cameraGazer._selectionPointerUp());}), this.webVROptions.floorMeshes && this.enableTeleportation({ floorMeshes: this.webVROptions.floorMeshes }));}_onDefaultMeshLoaded(webVRController) {this._leftController && this._leftController.webVRController == webVRController && webVRController.mesh && this._leftController._setLaserPointerParent(webVRController.mesh), this._rightController && this._rightController.webVRController == webVRController && webVRController.mesh && this._rightController._setLaserPointerParent(webVRController.mesh);try {this.onControllerMeshLoadedObservable.notifyObservers(webVRController);} catch (err) {logger/* Logger.Warn */.Y.Warn("Error in your custom logic onControllerMeshLoaded: " + err);}}get isInVRMode() {return this.xr && this.webVROptions.useXR && this.xr.baseExperience.state === WebXRState.IN_XR || this._webVRpresenting || this._fullscreenVRpresenting;}_onVrDisplayPresentChange() {const vrDisplay = this._scene.getEngine().getVRDevice();if (vrDisplay) {const wasPresenting = this._webVRpresenting;this._webVRpresenting = vrDisplay.isPresenting, wasPresenting && !this._webVRpresenting && this.exitVR();} else logger/* Logger.Warn */.Y.Warn("Detected VRDisplayPresentChange on an unknown VRDisplay. Did you can enterVR on the vrExperienceHelper?");this._updateButtonVisibility();}_onVRDisplayChanged(eventArgs) {this._webVRsupported = eventArgs.vrSupported, this._webVRready = !!eventArgs.vrDisplay, this._webVRpresenting = eventArgs.vrDisplay && eventArgs.vrDisplay.isPresenting, this._updateButtonVisibility();}_moveButtonToBottomRight() {if (this._inputElement && !this._useCustomVRButton && this._btnVR) {const rect = this._inputElement.getBoundingClientRect();this._btnVR.style.top = rect.top + rect.height - 70 + "px", this._btnVR.style.left = rect.left + rect.width - 100 + "px";}}_displayVRButton() {this._useCustomVRButton || this._btnVRDisplayed || !this._btnVR || (document.body.appendChild(this._btnVR), this._btnVRDisplayed = !0);}_updateButtonVisibility() {!this._btnVR || this._useCustomVRButton || (this._btnVR.className = "babylonVRicon", this.isInVRMode ? this._btnVR.className += " vrdisplaypresenting" : (this._webVRready && (this._btnVR.className += " vrdisplayready"), this._webVRsupported && (this._btnVR.className += " vrdisplaysupported"), this._webVRrequesting && (this._btnVR.className += " vrdisplayrequesting")));}enterVR() {if (this.xr) return void this.xr.baseExperience.enterXRAsync("immersive-vr", "local-floor", this.xr.renderTarget);if (this.onEnteringVRObservable) try {this.onEnteringVRObservable.notifyObservers(this);} catch (err) {logger/* Logger.Warn */.Y.Warn("Error in your custom logic onEnteringVR: " + err);}if (this._scene.activeCamera) {if (this._position = this._scene.activeCamera.position.clone(), this.vrDeviceOrientationCamera && (this.vrDeviceOrientationCamera.rotation = math_vector/* Quaternion.FromRotationMatrix */._f.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(), this.vrDeviceOrientationCamera.angularSensibility = 2e3), this.webVRCamera) {const currentYRotation = this.webVRCamera.deviceRotationQuaternion.toEulerAngles().y,desiredYRotation = math_vector/* Quaternion.FromRotationMatrix */._f.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles().y,currentGlobalRotation = this.webVRCamera.rotationQuaternion.toEulerAngles().y;this.webVRCamera.rotationQuaternion = math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(0, currentGlobalRotation + (desiredYRotation - currentYRotation), 0);}this._existingCamera = this._scene.activeCamera, this._existingCamera.angularSensibilityX && (this._cachedAngularSensibility.angularSensibilityX = this._existingCamera.angularSensibilityX, this._existingCamera.angularSensibilityX = Number.MAX_VALUE), this._existingCamera.angularSensibilityY && (this._cachedAngularSensibility.angularSensibilityY = this._existingCamera.angularSensibilityY, this._existingCamera.angularSensibilityY = Number.MAX_VALUE), this._existingCamera.angularSensibility && (this._cachedAngularSensibility.angularSensibility = this._existingCamera.angularSensibility, this._existingCamera.angularSensibility = Number.MAX_VALUE);}this._webVRrequesting || (this._webVRready ? !this._webVRpresenting && (this._scene.getEngine().onVRRequestPresentComplete.addOnce((result) => {this.onAfterEnteringVRObservable.notifyObservers({ success: result });}), this._webVRCamera.position = this._position, this._scene.activeCamera = this._webVRCamera) : this._vrDeviceOrientationCamera && (this._vrDeviceOrientationCamera.position = this._position, this._scene.activeCamera && (this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ), this._scene.activeCamera = this._vrDeviceOrientationCamera, this._scene.getEngine().enterFullscreen(this.requestPointerLockOnFullScreen), this._updateButtonVisibility(), this._vrDeviceOrientationCamera.onViewMatrixChangedObservable.addOnce(() => {this.onAfterEnteringVRObservable.notifyObservers({ success: !0 });})), this._scene.activeCamera && this._inputElement && this._scene.activeCamera.attachControl(), this._interactionsEnabled && this._scene.registerBeforeRender(this._beforeRender), this._displayLaserPointer && [this._leftController, this._rightController].forEach((controller) => {controller && controller._activatePointer();}), this._hasEnteredVR = !0);}exitVR() {if (this.xr) return void this.xr.baseExperience.exitXRAsync();if (this._hasEnteredVR) {if (this.onExitingVRObservable) try {this.onExitingVRObservable.notifyObservers(this);} catch (err) {logger/* Logger.Warn */.Y.Warn("Error in your custom logic onExitingVR: " + err);}this._webVRpresenting && this._scene.getEngine().disableVR(), this._scene.activeCamera && (this._position = this._scene.activeCamera.position.clone()), this.vrDeviceOrientationCamera && (this.vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE), this._deviceOrientationCamera ? (this._deviceOrientationCamera.position = this._position, this._scene.activeCamera = this._deviceOrientationCamera, this._cachedAngularSensibility.angularSensibilityX && (this._deviceOrientationCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX, this._cachedAngularSensibility.angularSensibilityX = null), this._cachedAngularSensibility.angularSensibilityY && (this._deviceOrientationCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY, this._cachedAngularSensibility.angularSensibilityY = null), this._cachedAngularSensibility.angularSensibility && (this._deviceOrientationCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility, this._cachedAngularSensibility.angularSensibility = null)) : this._existingCamera && (this._existingCamera.position = this._position, this._scene.activeCamera = this._existingCamera, this._inputElement && this._scene.activeCamera.attachControl(), this._cachedAngularSensibility.angularSensibilityX && (this._existingCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX, this._cachedAngularSensibility.angularSensibilityX = null), this._cachedAngularSensibility.angularSensibilityY && (this._existingCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY, this._cachedAngularSensibility.angularSensibilityY = null), this._cachedAngularSensibility.angularSensibility && (this._existingCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility, this._cachedAngularSensibility.angularSensibility = null)), this._updateButtonVisibility(), this._interactionsEnabled && (this._scene.unregisterBeforeRender(this._beforeRender), this._cameraGazer._gazeTracker.isVisible = !1, this._leftController && (this._leftController._gazeTracker.isVisible = !1), this._rightController && (this._rightController._gazeTracker.isVisible = !1)), this._scene.getEngine().resize(), [this._leftController, this._rightController].forEach((controller) => {controller && controller._deactivatePointer();}), this._hasEnteredVR = !1;const engine = this._scene.getEngine();engine._onVrDisplayPresentChange && engine._onVrDisplayPresentChange();}}get position() {return this._position;}set position(value) {this._position = value, this._scene.activeCamera && (this._scene.activeCamera.position = value);}enableInteractions() {if (!this._interactionsEnabled) {if (this._interactionsRequested = !0, this.xr) return void (this.xr.baseExperience.state === WebXRState.IN_XR && this.xr.pointerSelection.attach());this._leftController && this._enableInteractionOnController(this._leftController), this._rightController && this._enableInteractionOnController(this._rightController), this.raySelectionPredicate = (mesh) => mesh.isVisible && (mesh.isPickable || mesh.name === this._floorMeshName), this.meshSelectionPredicate = () => !0, this._raySelectionPredicate = (mesh) => !!(this._isTeleportationFloor(mesh) || -1 === mesh.name.indexOf("gazeTracker") && -1 === mesh.name.indexOf("teleportationTarget") && -1 === mesh.name.indexOf("torusTeleportation")) && this.raySelectionPredicate(mesh), this._interactionsEnabled = !0;}}get _noControllerIsActive() {return !(this._leftController && this._leftController._activePointer) && !(this._rightController && this._rightController._activePointer);}_isTeleportationFloor(mesh) {for (let i = 0; i < this._floorMeshesCollection.length; i++) if (this._floorMeshesCollection[i].id === mesh.id) return !0;return !!(this._floorMeshName && mesh.name === this._floorMeshName);}addFloorMesh(floorMesh) {!this._floorMeshesCollection || -1 < this._floorMeshesCollection.indexOf(floorMesh) || this._floorMeshesCollection.push(floorMesh);}removeFloorMesh(floorMesh) {if (this._floorMeshesCollection) {const meshIndex = this._floorMeshesCollection.indexOf(floorMesh);-1 !== meshIndex && this._floorMeshesCollection.splice(meshIndex, 1);}}enableTeleportation(vrTeleportationOptions = {}) {if (!this._teleportationInitialized) {if (this._teleportationRequested = !0, this.enableInteractions(), this.webVROptions.useXR && (vrTeleportationOptions.floorMeshes || vrTeleportationOptions.floorMeshName)) {const floorMeshes = vrTeleportationOptions.floorMeshes || [];if (!floorMeshes.length) {const floorMesh = this._scene.getMeshByName(vrTeleportationOptions.floorMeshName);floorMesh && floorMeshes.push(floorMesh);}if (this.xr) return floorMeshes.forEach((mesh) => {this.xr.teleportation.addFloorMesh(mesh);}), void (this.xr.teleportation.attached || this.xr.teleportation.attach());if (!this.xrTestDone) {const waitForXr = () => {this.xrTestDone && (this._scene.unregisterBeforeRender(waitForXr), this.xr ? !this.xr.teleportation.attached && this.xr.teleportation.attach() : this.enableTeleportation(vrTeleportationOptions));};return void this._scene.registerBeforeRender(waitForXr);}}vrTeleportationOptions.floorMeshName && (this._floorMeshName = vrTeleportationOptions.floorMeshName), vrTeleportationOptions.floorMeshes && (this._floorMeshesCollection = vrTeleportationOptions.floorMeshes), vrTeleportationOptions.teleportationMode && (this._teleportationMode = vrTeleportationOptions.teleportationMode), vrTeleportationOptions.teleportationTime && 0 < vrTeleportationOptions.teleportationTime && (this._teleportationTime = vrTeleportationOptions.teleportationTime), vrTeleportationOptions.teleportationSpeed && 0 < vrTeleportationOptions.teleportationSpeed && (this._teleportationSpeed = vrTeleportationOptions.teleportationSpeed), void 0 !== vrTeleportationOptions.easingFunction && (this._teleportationEasing = vrTeleportationOptions.easingFunction), null != this._leftController && this._enableTeleportationOnController(this._leftController), null != this._rightController && this._enableTeleportationOnController(this._rightController);const imageProcessingConfiguration = new Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.$();imageProcessingConfiguration.vignetteColor = new math_color/* Color4 */.HE(0, 0, 0, 0), imageProcessingConfiguration.vignetteEnabled = !0, this._postProcessMove = new ImageProcessingPostProcess("postProcessMove", 1, this._webVRCamera, void 0, void 0, void 0, void 0, imageProcessingConfiguration), this._webVRCamera.detachPostProcess(this._postProcessMove), this._teleportationInitialized = !0, this._isDefaultTeleportationTarget && (this._createTeleportationCircles(), this._teleportationTarget.scaling.scaleInPlace(this._webVRCamera.deviceScaleFactor));}}_enableInteractionOnController(controller) {const controllerMesh = controller.webVRController.mesh;controllerMesh && (controller._interactionsEnabled = !0, this.isInVRMode && this._displayLaserPointer && controller._activatePointer(), this.webVROptions.laserToggle && controller.webVRController.onMainButtonStateChangedObservable.add((stateObject) => {this._displayLaserPointer && 1 === stateObject.value && (controller._activePointer ? controller._deactivatePointer() : controller._activatePointer(), this.displayGaze && (controller._gazeTracker.isVisible = controller._activePointer));}), controller.webVRController.onTriggerStateChangedObservable.add((stateObject) => {let gazer = controller;this._noControllerIsActive && (gazer = this._cameraGazer), gazer._pointerDownOnMeshAsked ? stateObject.value < this._padSensibilityDown && gazer._selectionPointerUp() : stateObject.value > this._padSensibilityUp && gazer._selectionPointerDown();}));}_checkTeleportWithRay(stateObject, gazer) {this._teleportationRequestInitiated && !gazer._teleportationRequestInitiated || (gazer._teleportationRequestInitiated ? Math.sqrt(stateObject.y * stateObject.y + stateObject.x * stateObject.x) < this._padSensibilityDown && (this._teleportActive && this.teleportCamera(this._haloCenter), gazer._teleportationRequestInitiated = !1) : stateObject.y < -this._padSensibilityUp && gazer._dpadPressed && (gazer._activatePointer(), gazer._teleportationRequestInitiated = !0));}_checkRotate(stateObject, gazer) {gazer._teleportationRequestInitiated || (gazer._rotationLeftAsked ? stateObject.x > -this._padSensibilityDown && (gazer._rotationLeftAsked = !1) : stateObject.x < -this._padSensibilityUp && gazer._dpadPressed && (gazer._rotationLeftAsked = !0, this._rotationAllowed && this._rotateCamera(!1)), gazer._rotationRightAsked ? stateObject.x < this._padSensibilityDown && (gazer._rotationRightAsked = !1) : stateObject.x > this._padSensibilityUp && gazer._dpadPressed && (gazer._rotationRightAsked = !0, this._rotationAllowed && this._rotateCamera(!0)));}_checkTeleportBackwards(stateObject, gazer) {if (!gazer._teleportationRequestInitiated) if (!(stateObject.y > this._padSensibilityUp && gazer._dpadPressed)) gazer._teleportationBackRequestInitiated = !1;else if (!gazer._teleportationBackRequestInitiated) {if (!this.currentVRCamera) return;let rotation = math_vector/* Quaternion.FromRotationMatrix */._f.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()),position = this.currentVRCamera.position;this.currentVRCamera.devicePosition && this.currentVRCamera.deviceRotationQuaternion && (rotation = this.currentVRCamera.deviceRotationQuaternion, position = this.currentVRCamera.devicePosition), rotation.toEulerAnglesToRef(this._workingVector), this._workingVector.z = 0, this._workingVector.x = 0, math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(this._workingVector.y, this._workingVector.x, this._workingVector.z, this._workingQuaternion), this._workingQuaternion.toRotationMatrix(this._workingMatrix), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._teleportBackwardsVector, this._workingMatrix, this._workingVector);const ray = new Ray(position, this._workingVector),hit = this._scene.pickWithRay(ray, this._raySelectionPredicate);hit && hit.pickedPoint && hit.pickedMesh && this._isTeleportationFloor(hit.pickedMesh) && 5 > hit.distance && this.teleportCamera(hit.pickedPoint), gazer._teleportationBackRequestInitiated = !0;}}_enableTeleportationOnController(controller) {const controllerMesh = controller.webVRController.mesh;controllerMesh && (!controller._interactionsEnabled && this._enableInteractionOnController(controller), controller._interactionsEnabled = !0, controller._teleportationEnabled = !0, controller.webVRController.controllerType === PoseEnabledControllerType.VIVE && (controller._dpadPressed = !1, controller.webVRController.onPadStateChangedObservable.add((stateObject) => {controller._dpadPressed = stateObject.pressed, controller._dpadPressed || (controller._rotationLeftAsked = !1, controller._rotationRightAsked = !1, controller._teleportationBackRequestInitiated = !1);})), controller.webVRController.onPadValuesChangedObservable.add((stateObject) => {this.teleportationEnabled && (this._checkTeleportBackwards(stateObject, controller), this._checkTeleportWithRay(stateObject, controller)), this._checkRotate(stateObject, controller);}));}_createTeleportationCircles() {this._teleportationTarget = CreateGround("teleportationTarget", { width: 2, height: 2, subdivisions: 2 }, this._scene), this._teleportationTarget.isPickable = !1;const dynamicTexture = new DynamicTexture("DynamicTexture", 512, this._scene, !0);dynamicTexture.hasAlpha = !0;const context = dynamicTexture.getContext();context.beginPath(), context.arc(256, 256, 200, 0, 2 * Math.PI, !1), context.fillStyle = this._teleportationFillColor, context.fill(), context.lineWidth = 10, context.strokeStyle = this._teleportationBorderColor, context.stroke(), context.closePath(), dynamicTexture.update();const teleportationCircleMaterial = new standardMaterial/* StandardMaterial */.K("TextPlaneMaterial", this._scene);teleportationCircleMaterial.diffuseTexture = dynamicTexture, this._teleportationTarget.material = teleportationCircleMaterial;const torus = CreateTorus("torusTeleportation", { diameter: .75, thickness: .1, tessellation: 25, updatable: !1 }, this._scene);torus.isPickable = !1, torus.parent = this._teleportationTarget;const animationInnerCircle = new Animations_animation/* Animation */.f("animationInnerCircle", "position.y", 30, Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation.ANIMATIONLOOPMODE_CYCLE */.f.ANIMATIONLOOPMODE_CYCLE),keys = [];keys.push({ frame: 0, value: 0 }), keys.push({ frame: 30, value: .4 }), keys.push({ frame: 60, value: 0 }), animationInnerCircle.setKeys(keys);const easingFunction = new SineEase();easingFunction.setEasingMode(EasingFunction.EASINGMODE_EASEINOUT), animationInnerCircle.setEasingFunction(easingFunction), torus.animations = [], torus.animations.push(animationInnerCircle), this._scene.beginAnimation(torus, 0, 60, !0), this._hideTeleportationTarget();}_displayTeleportationTarget() {this._teleportActive = !0, this._teleportationInitialized && (this._teleportationTarget.isVisible = !0, this._isDefaultTeleportationTarget && (this._teleportationTarget.getChildren()[0].isVisible = !0));}_hideTeleportationTarget() {this._teleportActive = !1, this._teleportationInitialized && (this._teleportationTarget.isVisible = !1, this._isDefaultTeleportationTarget && (this._teleportationTarget.getChildren()[0].isVisible = !1));}_rotateCamera(right) {if (!(this.currentVRCamera instanceof Cameras_freeCamera/* FreeCamera */.c)) return;right ? this._rotationAngle++ : this._rotationAngle--, this.currentVRCamera.animations = [];const target = math_vector/* Quaternion.FromRotationMatrix */._f.FromRotationMatrix(math_vector/* Matrix.RotationY */.y3.RotationY(Math.PI / 4 * this._rotationAngle)),animationRotation = new Animations_animation/* Animation */.f("animationRotation", "rotationQuaternion", 90, Animations_animation/* Animation.ANIMATIONTYPE_QUATERNION */.f.ANIMATIONTYPE_QUATERNION, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT),animationRotationKeys = [];animationRotationKeys.push({ frame: 0, value: this.currentVRCamera.rotationQuaternion }), animationRotationKeys.push({ frame: 6, value: target }), animationRotation.setKeys(animationRotationKeys), animationRotation.setEasingFunction(this._circleEase), this.currentVRCamera.animations.push(animationRotation), this._postProcessMove.animations = [];const animationPP = new Animations_animation/* Animation */.f("animationPP", "vignetteWeight", 90, Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT),vignetteWeightKeys = [];vignetteWeightKeys.push({ frame: 0, value: 0 }), vignetteWeightKeys.push({ frame: 3, value: 4 }), vignetteWeightKeys.push({ frame: 6, value: 0 }), animationPP.setKeys(vignetteWeightKeys), animationPP.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(animationPP);const animationPP2 = new Animations_animation/* Animation */.f("animationPP2", "vignetteStretch", 90, Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT),vignetteStretchKeys = [];vignetteStretchKeys.push({ frame: 0, value: 0 }), vignetteStretchKeys.push({ frame: 3, value: 10 }), vignetteStretchKeys.push({ frame: 6, value: 0 }), animationPP2.setKeys(vignetteStretchKeys), animationPP2.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(animationPP2), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._postProcessMove.samples = 4, this._webVRCamera.attachPostProcess(this._postProcessMove), this._scene.beginAnimation(this._postProcessMove, 0, 6, !1, 1, () => {this._webVRCamera.detachPostProcess(this._postProcessMove);}), this._scene.beginAnimation(this.currentVRCamera, 0, 6, !1, 1);}_moveTeleportationSelectorTo(hit, gazer, ray) {if (hit.pickedPoint) {gazer._teleportationRequestInitiated && (this._displayTeleportationTarget(), this._haloCenter.copyFrom(hit.pickedPoint), this._teleportationTarget.position.copyFrom(hit.pickedPoint));const pickNormal = this._convertNormalToDirectionOfRay(hit.getNormal(!0, !1), ray);if (pickNormal) {const axis1 = math_vector/* Vector3.Cross */.P.Cross(math_axis/* Axis.Y */.RD.Y, pickNormal),axis2 = math_vector/* Vector3.Cross */.P.Cross(pickNormal, axis1);math_vector/* Vector3.RotationFromAxisToRef */.P.RotationFromAxisToRef(axis2, pickNormal, axis1, this._teleportationTarget.rotation);}this._teleportationTarget.position.y += .1;}}teleportCamera(location) {if (!(this.currentVRCamera instanceof Cameras_freeCamera/* FreeCamera */.c)) return;this.webVRCamera.leftCamera ? (this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition), this._workingVector.subtractInPlace(this.webVRCamera.position), location.subtractToRef(this._workingVector, this._workingVector)) : this._workingVector.copyFrom(location), this._workingVector.y += this.isInVRMode ? this.webVRCamera.deviceDistanceToRoomGround() * this._webVRCamera.deviceScaleFactor : this._defaultHeight, this.onBeforeCameraTeleport.notifyObservers(this._workingVector);let speedRatio, lastFrame;if (this._teleportationMode == VRExperienceHelper.TELEPORTATIONMODE_CONSTANTSPEED) {lastFrame = 90;const dist = math_vector/* Vector3.Distance */.P.Distance(this.currentVRCamera.position, this._workingVector);speedRatio = this._teleportationSpeed / dist;} else lastFrame = Math.round(this._teleportationTime * 90 / 1e3), speedRatio = 1;this.currentVRCamera.animations = [];const animationCameraTeleportation = new Animations_animation/* Animation */.f("animationCameraTeleportation", "position", 90, Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT),animationCameraTeleportationKeys = [{ frame: 0, value: this.currentVRCamera.position }, { frame: lastFrame, value: this._workingVector }];animationCameraTeleportation.setKeys(animationCameraTeleportationKeys), animationCameraTeleportation.setEasingFunction(this._teleportationEasing), this.currentVRCamera.animations.push(animationCameraTeleportation), this._postProcessMove.animations = [];const midFrame = Math.round(lastFrame / 2),animationPP = new Animations_animation/* Animation */.f("animationPP", "vignetteWeight", 90, Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT),vignetteWeightKeys = [];vignetteWeightKeys.push({ frame: 0, value: 0 }), vignetteWeightKeys.push({ frame: midFrame, value: 8 }), vignetteWeightKeys.push({ frame: lastFrame, value: 0 }), animationPP.setKeys(vignetteWeightKeys), this._postProcessMove.animations.push(animationPP);const animationPP2 = new Animations_animation/* Animation */.f("animationPP2", "vignetteStretch", 90, Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT),vignetteStretchKeys = [];vignetteStretchKeys.push({ frame: 0, value: 0 }), vignetteStretchKeys.push({ frame: midFrame, value: 10 }), vignetteStretchKeys.push({ frame: lastFrame, value: 0 }), animationPP2.setKeys(vignetteStretchKeys), this._postProcessMove.animations.push(animationPP2), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._webVRCamera.attachPostProcess(this._postProcessMove), this._scene.beginAnimation(this._postProcessMove, 0, lastFrame, !1, speedRatio, () => {this._webVRCamera.detachPostProcess(this._postProcessMove);}), this._scene.beginAnimation(this.currentVRCamera, 0, lastFrame, !1, speedRatio, () => {this.onAfterCameraTeleport.notifyObservers(this._workingVector);}), this._hideTeleportationTarget();}_convertNormalToDirectionOfRay(normal, ray) {if (normal) {const angle = Math.acos(math_vector/* Vector3.Dot */.P.Dot(normal, ray.direction));angle < Math.PI / 2 && normal.scaleInPlace(-1);}return normal;}_castRayAndSelectObject(gazer) {if (!(this.currentVRCamera instanceof Cameras_freeCamera/* FreeCamera */.c)) return;const ray = gazer._getForwardRay(this._rayLength),hit = this._scene.pickWithRay(ray, this._raySelectionPredicate);if (hit && this._scene.simulatePointerMove(hit, { pointerId: gazer._id }), gazer._currentHit = hit, hit && hit.pickedPoint) {if (this._displayGaze) {let multiplier = 1;gazer._gazeTracker.isVisible = !0, gazer._isActionableMesh && (multiplier = 3), this.updateGazeTrackerScale && (gazer._gazeTracker.scaling.x = hit.distance * multiplier, gazer._gazeTracker.scaling.y = hit.distance * multiplier, gazer._gazeTracker.scaling.z = hit.distance * multiplier);const pickNormal = this._convertNormalToDirectionOfRay(hit.getNormal(), ray),deltaFighting = .002;if (pickNormal) {const axis1 = math_vector/* Vector3.Cross */.P.Cross(math_axis/* Axis.Y */.RD.Y, pickNormal),axis2 = math_vector/* Vector3.Cross */.P.Cross(pickNormal, axis1);math_vector/* Vector3.RotationFromAxisToRef */.P.RotationFromAxisToRef(axis2, pickNormal, axis1, gazer._gazeTracker.rotation);}gazer._gazeTracker.position.copyFrom(hit.pickedPoint), 0 > gazer._gazeTracker.position.x ? gazer._gazeTracker.position.x += deltaFighting : gazer._gazeTracker.position.x -= deltaFighting, 0 > gazer._gazeTracker.position.y ? gazer._gazeTracker.position.y += deltaFighting : gazer._gazeTracker.position.y -= deltaFighting, 0 > gazer._gazeTracker.position.z ? gazer._gazeTracker.position.z += deltaFighting : gazer._gazeTracker.position.z -= deltaFighting;}gazer._updatePointerDistance(hit.distance);} else gazer._updatePointerDistance(), gazer._gazeTracker.isVisible = !1;if (hit && hit.pickedMesh) {if (this._teleportationInitialized && this._isTeleportationFloor(hit.pickedMesh) && hit.pickedPoint) return gazer._currentMeshSelected && !this._isTeleportationFloor(gazer._currentMeshSelected) && this._notifySelectedMeshUnselected(gazer._currentMeshSelected), gazer._currentMeshSelected = null, void (gazer._teleportationRequestInitiated && this._moveTeleportationSelectorTo(hit, gazer, ray));if (hit.pickedMesh !== gazer._currentMeshSelected) if (this.meshSelectionPredicate(hit.pickedMesh)) {this.onNewMeshPicked.notifyObservers(hit), gazer._currentMeshSelected = hit.pickedMesh, hit.pickedMesh.isPickable && hit.pickedMesh.actionManager ? (this.changeGazeColor(this._pickedGazeColor), this.changeLaserColor(this._pickedLaserColor), gazer._isActionableMesh = !0) : (this.changeGazeColor(this._gazeColor), this.changeLaserColor(this._laserColor), gazer._isActionableMesh = !1);try {this.onNewMeshSelected.notifyObservers(hit.pickedMesh);const gazerAsControllerGazer = gazer;gazerAsControllerGazer.webVRController && this.onMeshSelectedWithController.notifyObservers({ mesh: hit.pickedMesh, controller: gazerAsControllerGazer.webVRController });} catch (err) {logger/* Logger.Warn */.Y.Warn("Error while raising onNewMeshSelected or onMeshSelectedWithController: " + err);}} else this._notifySelectedMeshUnselected(gazer._currentMeshSelected), gazer._currentMeshSelected = null, this.changeGazeColor(this._gazeColor), this.changeLaserColor(this._laserColor);} else this._notifySelectedMeshUnselected(gazer._currentMeshSelected), gazer._currentMeshSelected = null, this.changeGazeColor(this._gazeColor), this.changeLaserColor(this._laserColor);}_notifySelectedMeshUnselected(mesh) {mesh && this.onSelectedMeshUnselected.notifyObservers(mesh);}setLaserColor(color, pickedColor = this._pickedLaserColor) {this._laserColor = color, this._pickedLaserColor = pickedColor;}setLaserLightingState(enabled = !0) {this._leftController && this._leftController._setLaserPointerLightingDisabled(!enabled), this._rightController && this._rightController._setLaserPointerLightingDisabled(!enabled);}setGazeColor(color, pickedColor = this._pickedGazeColor) {this._gazeColor = color, this._pickedGazeColor = pickedColor;}changeLaserColor(color) {this.updateControllerLaserColor && (this._leftController && this._leftController._setLaserPointerColor(color), this._rightController && this._rightController._setLaserPointerColor(color));}changeGazeColor(color) {this.updateGazeTrackerColor && this._cameraGazer._gazeTracker.material && (this._cameraGazer._gazeTracker.material.emissiveColor = color, this._leftController && (this._leftController._gazeTracker.material.emissiveColor = color), this._rightController && (this._rightController._gazeTracker.material.emissiveColor = color));}dispose() {this.isInVRMode && this.exitVR(), this._postProcessMove && this._postProcessMove.dispose(), this._webVRCamera && this._webVRCamera.dispose(), this._vrDeviceOrientationCamera && this._vrDeviceOrientationCamera.dispose(), !this._useCustomVRButton && this._btnVR && this._btnVR.parentNode && document.body.removeChild(this._btnVR), this._deviceOrientationCamera && this._scene.activeCamera != this._deviceOrientationCamera && this._deviceOrientationCamera.dispose(), this._cameraGazer && this._cameraGazer.dispose(), this._leftController && this._leftController.dispose(), this._rightController && this._rightController.dispose(), this._teleportationTarget && this._teleportationTarget.dispose(), this.xr && this.xr.dispose(), this._floorMeshesCollection.length = 0, document.removeEventListener("keydown", this._onKeyDown), window.removeEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChangeBind), window.removeEventListener("resize", this._onResize), document.removeEventListener("fullscreenchange", this._onFullscreenChange), this._scene.getEngine().onVRDisplayChangedObservable.removeCallback(this._onVRDisplayChangedBind), this._scene.getEngine().onVRRequestPresentStart.removeCallback(this._onVRRequestPresentStart), this._scene.getEngine().onVRRequestPresentComplete.removeCallback(this._onVRRequestPresentComplete), this._scene.gamepadManager.onGamepadConnectedObservable.removeCallback(this._onNewGamepadConnected), this._scene.gamepadManager.onGamepadDisconnectedObservable.removeCallback(this._onNewGamepadDisconnected), this._scene.unregisterBeforeRender(this._beforeRender);}getClassName() {return "VRExperienceHelper";}}VRExperienceHelper.TELEPORTATIONMODE_CONSTANTTIME = 0, VRExperienceHelper.TELEPORTATIONMODE_CONSTANTSPEED = 1;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/VR/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/RigModes/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Cameras/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Collisions/collider.js
const intersectBoxAASphere = (boxMin, boxMax, sphereCenter, sphereRadius) => !(boxMin.x > sphereCenter.x + sphereRadius) && !(sphereCenter.x - sphereRadius > boxMax.x) && !(boxMin.y > sphereCenter.y + sphereRadius) && !(sphereCenter.y - sphereRadius > boxMax.y) && !(boxMin.z > sphereCenter.z + sphereRadius) && !(sphereCenter.z - sphereRadius > boxMax.z),getLowestRoot = function () {const result = { root: 0, found: !1 };return function (a, b, c, maxR) {result.root = 0, result.found = !1;const determinant = b * b - 4 * a * c;if (0 > determinant) return result;const sqrtD = Math.sqrt(determinant);let r1 = (-b - sqrtD) / (2 * a),r2 = (-b + sqrtD) / (2 * a);if (r1 > r2) {const temp = r2;r2 = r1, r1 = temp;}return 0 < r1 && r1 < maxR ? (result.root = r1, result.found = !0, result) : 0 < r2 && r2 < maxR ? (result.root = r2, result.found = !0, result) : result;};}();class Collider {constructor() {this._collisionPoint = math_vector/* Vector3.Zero */.P.Zero(), this._planeIntersectionPoint = math_vector/* Vector3.Zero */.P.Zero(), this._tempVector = math_vector/* Vector3.Zero */.P.Zero(), this._tempVector2 = math_vector/* Vector3.Zero */.P.Zero(), this._tempVector3 = math_vector/* Vector3.Zero */.P.Zero(), this._tempVector4 = math_vector/* Vector3.Zero */.P.Zero(), this._edge = math_vector/* Vector3.Zero */.P.Zero(), this._baseToVertex = math_vector/* Vector3.Zero */.P.Zero(), this._destinationPoint = math_vector/* Vector3.Zero */.P.Zero(), this._slidePlaneNormal = math_vector/* Vector3.Zero */.P.Zero(), this._displacementVector = math_vector/* Vector3.Zero */.P.Zero(), this._radius = math_vector/* Vector3.One */.P.One(), this._retry = 0, this._basePointWorld = math_vector/* Vector3.Zero */.P.Zero(), this._velocityWorld = math_vector/* Vector3.Zero */.P.Zero(), this._normalizedVelocity = math_vector/* Vector3.Zero */.P.Zero(), this._collisionMask = -1;}get collisionMask() {return this._collisionMask;}set collisionMask(mask) {this._collisionMask = isNaN(mask) ? -1 : mask;}get slidePlaneNormal() {return this._slidePlaneNormal;}_initialize(source, dir, e) {this._velocity = dir, this._velocitySquaredLength = this._velocity.lengthSquared();const len = Math.sqrt(this._velocitySquaredLength);0 === len || 1 === len ? this._normalizedVelocity.copyFromFloats(dir._x, dir._y, dir._z) : dir.scaleToRef(1 / len, this._normalizedVelocity), this._basePoint = source, source.multiplyToRef(this._radius, this._basePointWorld), dir.multiplyToRef(this._radius, this._velocityWorld), this._velocityWorldLength = this._velocityWorld.length(), this._epsilon = e, this.collisionFound = !1;}_checkPointInTriangle(point, pa, pb, pc, n) {pa.subtractToRef(point, this._tempVector), pb.subtractToRef(point, this._tempVector2), math_vector/* Vector3.CrossToRef */.P.CrossToRef(this._tempVector, this._tempVector2, this._tempVector4);let d = math_vector/* Vector3.Dot */.P.Dot(this._tempVector4, n);return !(0 > d) && (pc.subtractToRef(point, this._tempVector3), math_vector/* Vector3.CrossToRef */.P.CrossToRef(this._tempVector2, this._tempVector3, this._tempVector4), d = math_vector/* Vector3.Dot */.P.Dot(this._tempVector4, n), !(0 > d)) && (math_vector/* Vector3.CrossToRef */.P.CrossToRef(this._tempVector3, this._tempVector, this._tempVector4), d = math_vector/* Vector3.Dot */.P.Dot(this._tempVector4, n), 0 <= d);}_canDoCollision(sphereCenter, sphereRadius, vecMin, vecMax) {const distance = math_vector/* Vector3.Distance */.P.Distance(this._basePointWorld, sphereCenter),max = Math.max(this._radius.x, this._radius.y, this._radius.z);return !(distance > this._velocityWorldLength + max + sphereRadius) && !!intersectBoxAASphere(vecMin, vecMax, this._basePointWorld, this._velocityWorldLength + max);}_testTriangle(faceIndex, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh) {let t0,embeddedInPlane = !1;trianglePlaneArray || (trianglePlaneArray = []), trianglePlaneArray[faceIndex] || (trianglePlaneArray[faceIndex] = new math_plane/* Plane */.J(0, 0, 0, 0), trianglePlaneArray[faceIndex].copyFromPoints(p1, p2, p3));const trianglePlane = trianglePlaneArray[faceIndex];if (!hasMaterial && !trianglePlane.isFrontFacingTo(this._normalizedVelocity, 0)) return;const signedDistToTrianglePlane = trianglePlane.signedDistanceTo(this._basePoint),normalDotVelocity = math_vector/* Vector3.Dot */.P.Dot(trianglePlane.normal, this._velocity);if (Collider.DoubleSidedCheck && 1e-4 < normalDotVelocity) return;if (0 == normalDotVelocity) {if (1 <= Math.abs(signedDistToTrianglePlane)) return;embeddedInPlane = !0, t0 = 0;} else {t0 = (-1 - signedDistToTrianglePlane) / normalDotVelocity;let t1 = (1 - signedDistToTrianglePlane) / normalDotVelocity;if (t0 > t1) {const temp = t1;t1 = t0, t0 = temp;}if (1 < t0 || 0 > t1) return;0 > t0 && (t0 = 0), 1 < t0 && (t0 = 1);}this._collisionPoint.copyFromFloats(0, 0, 0);let found = !1,t = 1;if (embeddedInPlane || (this._basePoint.subtractToRef(trianglePlane.normal, this._planeIntersectionPoint), this._velocity.scaleToRef(t0, this._tempVector), this._planeIntersectionPoint.addInPlace(this._tempVector), this._checkPointInTriangle(this._planeIntersectionPoint, p1, p2, p3, trianglePlane.normal) && (found = !0, t = t0, this._collisionPoint.copyFrom(this._planeIntersectionPoint))), !found) {let a = this._velocitySquaredLength;this._basePoint.subtractToRef(p1, this._tempVector);let b = 2 * math_vector/* Vector3.Dot */.P.Dot(this._velocity, this._tempVector),c = this._tempVector.lengthSquared() - 1,lowestRoot = getLowestRoot(a, b, c, t);lowestRoot.found && (t = lowestRoot.root, found = !0, this._collisionPoint.copyFrom(p1)), this._basePoint.subtractToRef(p2, this._tempVector), b = 2 * math_vector/* Vector3.Dot */.P.Dot(this._velocity, this._tempVector), c = this._tempVector.lengthSquared() - 1, lowestRoot = getLowestRoot(a, b, c, t), lowestRoot.found && (t = lowestRoot.root, found = !0, this._collisionPoint.copyFrom(p2)), this._basePoint.subtractToRef(p3, this._tempVector), b = 2 * math_vector/* Vector3.Dot */.P.Dot(this._velocity, this._tempVector), c = this._tempVector.lengthSquared() - 1, lowestRoot = getLowestRoot(a, b, c, t), lowestRoot.found && (t = lowestRoot.root, found = !0, this._collisionPoint.copyFrom(p3)), p2.subtractToRef(p1, this._edge), p1.subtractToRef(this._basePoint, this._baseToVertex);let edgeSquaredLength = this._edge.lengthSquared(),edgeDotVelocity = math_vector/* Vector3.Dot */.P.Dot(this._edge, this._velocity),edgeDotBaseToVertex = math_vector/* Vector3.Dot */.P.Dot(this._edge, this._baseToVertex);if (a = edgeSquaredLength * -this._velocitySquaredLength + edgeDotVelocity * edgeDotVelocity, b = 2 * (edgeSquaredLength * math_vector/* Vector3.Dot */.P.Dot(this._velocity, this._baseToVertex) - edgeDotVelocity * edgeDotBaseToVertex), c = edgeSquaredLength * (1 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex, lowestRoot = getLowestRoot(a, b, c, t), lowestRoot.found) {const f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength;0 <= f && 1 >= f && (t = lowestRoot.root, found = !0, this._edge.scaleInPlace(f), p1.addToRef(this._edge, this._collisionPoint));}if (p3.subtractToRef(p2, this._edge), p2.subtractToRef(this._basePoint, this._baseToVertex), edgeSquaredLength = this._edge.lengthSquared(), edgeDotVelocity = math_vector/* Vector3.Dot */.P.Dot(this._edge, this._velocity), edgeDotBaseToVertex = math_vector/* Vector3.Dot */.P.Dot(this._edge, this._baseToVertex), a = edgeSquaredLength * -this._velocitySquaredLength + edgeDotVelocity * edgeDotVelocity, b = 2 * (edgeSquaredLength * math_vector/* Vector3.Dot */.P.Dot(this._velocity, this._baseToVertex) - edgeDotVelocity * edgeDotBaseToVertex), c = edgeSquaredLength * (1 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex, lowestRoot = getLowestRoot(a, b, c, t), lowestRoot.found) {const f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength;0 <= f && 1 >= f && (t = lowestRoot.root, found = !0, this._edge.scaleInPlace(f), p2.addToRef(this._edge, this._collisionPoint));}if (p1.subtractToRef(p3, this._edge), p3.subtractToRef(this._basePoint, this._baseToVertex), edgeSquaredLength = this._edge.lengthSquared(), edgeDotVelocity = math_vector/* Vector3.Dot */.P.Dot(this._edge, this._velocity), edgeDotBaseToVertex = math_vector/* Vector3.Dot */.P.Dot(this._edge, this._baseToVertex), a = edgeSquaredLength * -this._velocitySquaredLength + edgeDotVelocity * edgeDotVelocity, b = 2 * (edgeSquaredLength * math_vector/* Vector3.Dot */.P.Dot(this._velocity, this._baseToVertex) - edgeDotVelocity * edgeDotBaseToVertex), c = edgeSquaredLength * (1 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex, lowestRoot = getLowestRoot(a, b, c, t), lowestRoot.found) {const f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength;0 <= f && 1 >= f && (t = lowestRoot.root, found = !0, this._edge.scaleInPlace(f), p3.addToRef(this._edge, this._collisionPoint));}}if (found) {const distToCollisionSquared = t * t * this._velocitySquaredLength;(!this.collisionFound || distToCollisionSquared < this._nearestDistanceSquared) && (hostMesh.collisionResponse && (this.intersectionPoint ? this.intersectionPoint.copyFrom(this._collisionPoint) : this.intersectionPoint = this._collisionPoint.clone(), this._nearestDistanceSquared = distToCollisionSquared, this._nearestDistance = Math.sqrt(distToCollisionSquared), this.collisionFound = !0), this.collidedMesh = hostMesh);}}_collide(trianglePlaneArray, pts, indices, indexStart, indexEnd, decal, hasMaterial, hostMesh, invertTriangles, triangleStrip = !1) {if (triangleStrip) {if (!indices || 0 === indices.length) for (let i = 0; i < pts.length - 2; i += 1) {const p1 = pts[i],p2 = pts[i + 1],p3 = pts[i + 2];p1 && p2 && p3 && ((invertTriangles ? 1 : 0) ^ i % 2 ? this._testTriangle(i, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh) : this._testTriangle(i, trianglePlaneArray, p2, p1, p3, hasMaterial, hostMesh));} else for (let i = indexStart; i < indexEnd - 2; i += 1) {const indexA = indices[i],indexB = indices[i + 1],indexC = indices[i + 2];if (4294967295 === indexC) {i += 2;continue;}const p1 = pts[indexA],p2 = pts[indexB],p3 = pts[indexC];p1 && p2 && p3 && ((invertTriangles ? 1 : 0) ^ i % 2 ? this._testTriangle(i, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh) : this._testTriangle(i, trianglePlaneArray, p2, p1, p3, hasMaterial, hostMesh));}} else if (!indices || 0 === indices.length) for (let i = 0; i < pts.length; i += 3) {const p1 = pts[i],p2 = pts[i + 1],p3 = pts[i + 2];invertTriangles ? this._testTriangle(i, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh) : this._testTriangle(i, trianglePlaneArray, p3, p2, p1, hasMaterial, hostMesh);} else for (let i = indexStart; i < indexEnd; i += 3) {const p1 = pts[indices[i] - decal],p2 = pts[indices[i + 1] - decal],p3 = pts[indices[i + 2] - decal];invertTriangles ? this._testTriangle(i, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh) : this._testTriangle(i, trianglePlaneArray, p3, p2, p1, hasMaterial, hostMesh);}}_getResponse(pos, vel) {pos.addToRef(vel, this._destinationPoint), vel.scaleInPlace(this._nearestDistance / vel.length()), this._basePoint.addToRef(vel, pos), pos.subtractToRef(this.intersectionPoint, this._slidePlaneNormal), this._slidePlaneNormal.normalize(), this._slidePlaneNormal.scaleToRef(this._epsilon, this._displacementVector), pos.addInPlace(this._displacementVector), this.intersectionPoint.addInPlace(this._displacementVector), this._slidePlaneNormal.scaleInPlace(math_plane/* Plane.SignedDistanceToPlaneFromPositionAndNormal */.J.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint, this._slidePlaneNormal, this._destinationPoint)), this._destinationPoint.subtractInPlace(this._slidePlaneNormal), this._destinationPoint.subtractToRef(this.intersectionPoint, vel);}}Collider.DoubleSidedCheck = !1;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Collisions/collisionCoordinator.js
class DefaultCollisionCoordinator {constructor() {this._scaledPosition = math_vector/* Vector3.Zero */.P.Zero(), this._scaledVelocity = math_vector/* Vector3.Zero */.P.Zero(), this._finalPosition = math_vector/* Vector3.Zero */.P.Zero();}getNewPosition(position, displacement, collider, maximumRetry, excludedMesh, onNewPosition, collisionIndex) {position.divideToRef(collider._radius, this._scaledPosition), displacement.divideToRef(collider._radius, this._scaledVelocity), collider.collidedMesh = null, collider._retry = 0, collider._initialVelocity = this._scaledVelocity, collider._initialPosition = this._scaledPosition, this._collideWithWorld(this._scaledPosition, this._scaledVelocity, collider, maximumRetry, this._finalPosition, excludedMesh), this._finalPosition.multiplyInPlace(collider._radius), onNewPosition(collisionIndex, this._finalPosition, collider.collidedMesh);}createCollider() {return new Collider();}init(scene) {this._scene = scene;}_collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh = null) {const closeDistance = 10 * engine/* Engine.CollisionsEpsilon */.D.CollisionsEpsilon;if (collider._retry >= maximumRetry) return void finalPosition.copyFrom(position);const collisionMask = excludedMesh ? excludedMesh.collisionMask : collider.collisionMask;collider._initialize(position, velocity, closeDistance);const meshes = excludedMesh && excludedMesh.surroundingMeshes || this._scene.meshes;for (let index = 0; index < meshes.length; index++) {const mesh = meshes[index];mesh.isEnabled() && mesh.checkCollisions && mesh.subMeshes && mesh !== excludedMesh && 0 != (collisionMask & mesh.collisionGroup) && mesh._checkCollision(collider);}return collider.collisionFound ? ((0 !== velocity.x || 0 !== velocity.y || 0 !== velocity.z) && collider._getResponse(position, velocity), velocity.length() <= closeDistance ? void finalPosition.copyFrom(position) : void (collider._retry++, this._collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh))) : void position.addToRef(velocity, finalPosition);}}core_scene/* Scene.CollisionCoordinatorFactory */.x.CollisionCoordinatorFactory = () => new DefaultCollisionCoordinator();
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Collisions/meshCollisionData.js
var meshCollisionData = __webpack_require__("./node_modules/@babylonjs/core/Collisions/meshCollisionData.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Collisions/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js + 9 modules
var shaderProcessor = __webpack_require__("./node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/shaderLanguage.js
var Materials_shaderLanguage = __webpack_require__("./node_modules/@babylonjs/core/Materials/shaderLanguage.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Compute/computeEffect.js
class ComputeEffect {constructor(baseName, options, engine, key = "") {var _a, _b;this.name = null, this.defines = "", this.onCompiled = null, this.onError = null, this.uniqueId = 0, this.onCompileObservable = new observable/* Observable */.y$(), this.onErrorObservable = new observable/* Observable */.y$(), this.onBindObservable = new observable/* Observable */.y$(), this._wasPreviouslyReady = !1, this._isReady = !1, this._compilationError = "", this._key = "", this._computeSourceCodeOverride = "", this._pipelineContext = null, this._computeSourceCode = "", this._rawComputeSourceCode = "", this._shaderLanguage = Materials_shaderLanguage/* ShaderLanguage.WGSL */.x.WGSL, this.name = baseName, this._key = key, this._engine = engine, this.uniqueId = ComputeEffect._UniqueIdSeed++, this.defines = null !== (_a = options.defines) && void 0 !== _a ? _a : "", this.onError = options.onError, this.onCompiled = options.onCompiled, this._entryPoint = null !== (_b = options.entryPoint) && void 0 !== _b ? _b : "main", this._shaderStore = shaderStore/* ShaderStore.GetShadersStore */.v.GetShadersStore(this._shaderLanguage), this._shaderRepository = shaderStore/* ShaderStore.GetShadersRepository */.v.GetShadersRepository(this._shaderLanguage), this._includeShaderStore = shaderStore/* ShaderStore.GetIncludesShadersStore */.v.GetIncludesShadersStore(this._shaderLanguage);let computeSource;const hostDocument = (0,domManagement/* IsWindowObjectExist */.CG)() ? this._engine.getHostDocument() : null;baseName.computeSource ? computeSource = "source:" + baseName.computeSource : baseName.computeElement ? (computeSource = hostDocument ? hostDocument.getElementById(baseName.computeElement) : null, !computeSource && (computeSource = baseName.computeElement)) : computeSource = baseName.compute || baseName;const processorOptions = { defines: this.defines.split("\n"), indexParameters: void 0, isFragment: !1, shouldUseHighPrecisionShader: !1, processor: null, supportsUniformBuffers: this._engine.supportsUniformBuffers, shadersRepository: this._shaderRepository, includesShadersStore: this._includeShaderStore, version: (100 * this._engine.version).toString(), platformName: this._engine.shaderPlatformName, processingContext: null, isNDCHalfZRange: this._engine.isNDCHalfZRange, useReverseDepthBuffer: this._engine.useReverseDepthBuffer };this._loadShader(computeSource, "Compute", "", (computeCode) => {shaderProcessor/* ShaderProcessor.Initialize */.L.Initialize(processorOptions), shaderProcessor/* ShaderProcessor.PreProcess */.L.PreProcess(computeCode, processorOptions, (migratedCommputeCode) => {this._rawComputeSourceCode = computeCode, options.processFinalCode && (migratedCommputeCode = options.processFinalCode(migratedCommputeCode));const finalShaders = shaderProcessor/* ShaderProcessor.Finalize */.L.Finalize(migratedCommputeCode, "", processorOptions);this._useFinalCode(finalShaders.vertexCode, baseName);}, this._engine);});}_useFinalCode(migratedCommputeCode, baseName) {if (baseName) {const compute = baseName.computeElement || baseName.compute || baseName.spectorName || baseName;this._computeSourceCode = "//#define SHADER_NAME compute:" + compute + "\n" + migratedCommputeCode;} else this._computeSourceCode = migratedCommputeCode;this._prepareEffect();}get key() {return this._key;}isReady() {try {return this._isReadyInternal();} catch (_a) {return !1;}}_isReadyInternal() {return !!this._isReady || !!this._pipelineContext && this._pipelineContext.isReady;}getEngine() {return this._engine;}getPipelineContext() {return this._pipelineContext;}getCompilationError() {return this._compilationError;}executeWhenCompiled(func) {return this.isReady() ? void func(this) : void (this.onCompileObservable.add((effect) => {func(effect);}), (!this._pipelineContext || this._pipelineContext.isAsync) && setTimeout(() => {this._checkIsReady(null);}, 16));}_checkIsReady(previousPipelineContext) {try {if (this._isReadyInternal()) return;} catch (e) {return void this._processCompilationErrors(e, previousPipelineContext);}setTimeout(() => {this._checkIsReady(previousPipelineContext);}, 16);}_loadShader(shader, key, optionalKey, callback) {if ("undefined" != typeof HTMLElement && shader instanceof HTMLElement) {const shaderCode = (0,domManagement/* GetDOMTextContent */.v)(shader);return void callback(shaderCode);}if ("source:" === shader.substr(0, 7)) return void callback(shader.substr(7));if ("base64:" === shader.substr(0, 7)) {const shaderBinary = window.atob(shader.substr(7));return void callback(shaderBinary);}if (this._shaderStore[shader + key + "Shader"]) return void callback(this._shaderStore[shader + key + "Shader"]);if (optionalKey && this._shaderStore[shader + optionalKey + "Shader"]) return void callback(this._shaderStore[shader + optionalKey + "Shader"]);let shaderUrl;shaderUrl = "." === shader[0] || "/" === shader[0] || -1 < shader.indexOf("http") ? shader : this._shaderRepository + shader, this._engine._loadFile(shaderUrl + "." + key.toLowerCase() + ".fx", callback);}get computeSourceCode() {var _a, _b;return this._computeSourceCodeOverride ? this._computeSourceCodeOverride : null !== (_b = null === (_a = this._pipelineContext) || void 0 === _a ? void 0 : _a._getComputeShaderCode()) && void 0 !== _b ? _b : this._computeSourceCode;}get rawComputeSourceCode() {return this._rawComputeSourceCode;}_prepareEffect() {const defines = this.defines,previousPipelineContext = this._pipelineContext;this._isReady = !1;try {const engine = this._engine;this._pipelineContext = engine.createComputePipelineContext(), this._pipelineContext._name = this._key, engine._prepareComputePipelineContext(this._pipelineContext, this._computeSourceCodeOverride ? this._computeSourceCodeOverride : this._computeSourceCode, this._rawComputeSourceCode, this._computeSourceCodeOverride ? null : defines, this._entryPoint), engine._executeWhenComputeStateIsCompiled(this._pipelineContext, () => {this._compilationError = "", this._isReady = !0, this.onCompiled && this.onCompiled(this), this.onCompileObservable.notifyObservers(this), this.onCompileObservable.clear(), previousPipelineContext && this.getEngine()._deleteComputePipelineContext(previousPipelineContext);}), this._pipelineContext.isAsync && this._checkIsReady(previousPipelineContext);} catch (e) {this._processCompilationErrors(e, previousPipelineContext);}}_getShaderCodeAndErrorLine(code, error) {let errorLine = null;if (error && code) {const res = error.match(/COMPUTE SHADER ERROR: 0:(\d+?):/);if (res && 2 === res.length) {const lineNumber = parseInt(res[1]),lines = code.split("\n", -1);lines.length >= lineNumber && (errorLine = `Offending line [${lineNumber}] in compute code: ${lines[lineNumber - 1]}`);}}return [code, errorLine];}_processCompilationErrors(e, previousPipelineContext = null) {var _a;if (this._compilationError = e.message, logger/* Logger.Error */.Y.Error("Unable to compile compute effect:"), logger/* Logger.Error */.Y.Error("Defines:\r\n" + this.defines), ComputeEffect.LogShaderCodeOnCompilationError) {let lineErrorVertex = null,code = null;(null === (_a = this._pipelineContext) || void 0 === _a ? void 0 : _a._getComputeShaderCode()) && ([code, lineErrorVertex] = this._getShaderCodeAndErrorLine(this._pipelineContext._getComputeShaderCode(), this._compilationError), code && (logger/* Logger.Error */.Y.Error("Compute code:"), logger/* Logger.Error */.Y.Error(code))), lineErrorVertex && logger/* Logger.Error */.Y.Error(lineErrorVertex);}logger/* Logger.Error */.Y.Error("Error: " + this._compilationError), previousPipelineContext && (this._pipelineContext = previousPipelineContext, this._isReady = !0, this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this));}dispose() {this._pipelineContext && this._pipelineContext.dispose(), this._engine._releaseComputeEffect(this);}static RegisterShader(name, computeShader) {shaderStore/* ShaderStore.GetShadersStore */.v.GetShadersStore(Materials_shaderLanguage/* ShaderLanguage.WGSL */.x.WGSL)[`${name}ComputeShader`] = computeShader;}}ComputeEffect._UniqueIdSeed = 0, ComputeEffect.LogShaderCodeOnCompilationError = !0;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/thinEngine.js + 1 modules
var thinEngine = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.computeShader.js
var ComputeBindingType;(function (ComputeBindingType) {ComputeBindingType[ComputeBindingType.Texture = 0] = "Texture", ComputeBindingType[ComputeBindingType.StorageTexture = 1] = "StorageTexture", ComputeBindingType[ComputeBindingType.UniformBuffer = 2] = "UniformBuffer", ComputeBindingType[ComputeBindingType.StorageBuffer = 3] = "StorageBuffer", ComputeBindingType[ComputeBindingType.TextureWithoutSampler = 4] = "TextureWithoutSampler", ComputeBindingType[ComputeBindingType.Sampler = 5] = "Sampler";})(ComputeBindingType || (ComputeBindingType = {})), thinEngine/* ThinEngine.prototype.createComputeEffect */.B.prototype.createComputeEffect = function () {throw new Error("createComputeEffect: This engine does not support compute shaders!");}, thinEngine/* ThinEngine.prototype.createComputePipelineContext */.B.prototype.createComputePipelineContext = function () {throw new Error("createComputePipelineContext: This engine does not support compute shaders!");}, thinEngine/* ThinEngine.prototype.createComputeContext */.B.prototype.createComputeContext = function () {}, thinEngine/* ThinEngine.prototype.computeDispatch */.B.prototype.computeDispatch = function () {throw new Error("computeDispatch: This engine does not support compute shaders!");}, thinEngine/* ThinEngine.prototype.areAllComputeEffectsReady */.B.prototype.areAllComputeEffectsReady = function () {return !0;}, thinEngine/* ThinEngine.prototype.releaseComputeEffects */.B.prototype.releaseComputeEffects = function () {}, thinEngine/* ThinEngine.prototype._prepareComputePipelineContext */.B.prototype._prepareComputePipelineContext = function () {}, thinEngine/* ThinEngine.prototype._rebuildComputeEffects */.B.prototype._rebuildComputeEffects = function () {}, thinEngine/* ThinEngine.prototype._executeWhenComputeStateIsCompiled */.B.prototype._executeWhenComputeStateIsCompiled = function (pipelineContext, action) {action();}, thinEngine/* ThinEngine.prototype._releaseComputeEffect */.B.prototype._releaseComputeEffect = function () {}, thinEngine/* ThinEngine.prototype._deleteComputePipelineContext */.B.prototype._deleteComputePipelineContext = function () {};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/textureSampler.js
var textureSampler = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/textureSampler.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Compute/computeShader.js
class ComputeShader {get options() {return this._options;}get shaderPath() {return this._shaderPath;}constructor(name, engine, shaderPath, options = {}) {return this._bindings = {}, this._samplers = {}, this._contextIsDirty = !1, this.onCompiled = null, this.onError = null, this.name = name, this._engine = engine, this.uniqueId = uniqueIdGenerator/* UniqueIdGenerator.UniqueId */.K.UniqueId, this._engine.getCaps().supportComputeShaders ? options.bindingsMapping ? void (this._context = engine.createComputeContext(), this._shaderPath = shaderPath, this._options = { bindingsMapping: {}, defines: [], ...options }) : void logger/* Logger.Error */.Y.Error("You must provide the binding mappings as browsers don't support reflection for wgsl shaders yet!") : void logger/* Logger.Error */.Y.Error("This engine does not support compute shaders!");}getClassName() {return "ComputeShader";}setTexture(name, texture, bindSampler = !0) {const current = this._bindings[name];this._bindings[name] = { type: bindSampler ? ComputeBindingType.Texture : ComputeBindingType.TextureWithoutSampler, object: texture, indexInGroupEntries: null === current || void 0 === current ? void 0 : current.indexInGroupEntries }, this._contextIsDirty || (this._contextIsDirty = !current || current.object !== texture || current.type !== this._bindings[name].type);}setStorageTexture(name, texture) {const current = this._bindings[name];this._contextIsDirty || (this._contextIsDirty = !current || current.object !== texture), this._bindings[name] = { type: ComputeBindingType.StorageTexture, object: texture, indexInGroupEntries: null === current || void 0 === current ? void 0 : current.indexInGroupEntries };}setUniformBuffer(name, buffer) {const current = this._bindings[name];this._contextIsDirty || (this._contextIsDirty = !current || current.object !== buffer), this._bindings[name] = { type: ComputeBindingType.UniformBuffer, object: buffer, indexInGroupEntries: null === current || void 0 === current ? void 0 : current.indexInGroupEntries };}setStorageBuffer(name, buffer) {const current = this._bindings[name];this._contextIsDirty || (this._contextIsDirty = !current || current.object !== buffer), this._bindings[name] = { type: ComputeBindingType.StorageBuffer, object: buffer, indexInGroupEntries: null === current || void 0 === current ? void 0 : current.indexInGroupEntries };}setTextureSampler(name, sampler) {const current = this._bindings[name];this._contextIsDirty || (this._contextIsDirty = !current || !sampler.compareSampler(current.object)), this._bindings[name] = { type: ComputeBindingType.Sampler, object: sampler, indexInGroupEntries: null === current || void 0 === current ? void 0 : current.indexInGroupEntries };}isReady() {let effect = this._effect;for (const key in this._bindings) {const binding = this._bindings[key],type = binding.type,object = binding.object;switch (type) {case ComputeBindingType.Texture:case ComputeBindingType.TextureWithoutSampler:case ComputeBindingType.StorageTexture:{if (!object.isReady()) return !1;break;}}}const defines = [],shaderName = this._shaderPath;if (this._options.defines) for (let index = 0; index < this._options.defines.length; index++) defines.push(this._options.defines[index]);const join = defines.join("\n");return this._cachedDefines !== join && (this._cachedDefines = join, effect = this._engine.createComputeEffect(shaderName, { defines: join, entryPoint: this._options.entryPoint, onCompiled: this.onCompiled, onError: this.onError }), this._effect = effect), !!effect.isReady();}dispatch(x, y, z) {var _a;if (!this.isReady()) return !1;for (const key in this._bindings) {const binding = this._bindings[key];if (!this._options.bindingsMapping[key]) throw new Error("ComputeShader ('" + this.name + "'): No binding mapping has been provided for the property '" + key + "'");if (binding.type !== ComputeBindingType.Texture) continue;const sampler = this._samplers[key],texture = binding.object;sampler && texture._texture && sampler.compareSampler(texture._texture) || (this._samplers[key] = new textureSampler/* TextureSampler */.a().setParameters(texture.wrapU, texture.wrapV, texture.wrapR, texture.anisotropicFilteringLevel, texture._texture.samplingMode, null === (_a = texture._texture) || void 0 === _a ? void 0 : _a._comparisonFunction), this._contextIsDirty = !0);}return this._contextIsDirty && (this._contextIsDirty = !1, this._context.clear()), this._engine.computeDispatch(this._effect, this._context, this._bindings, x, y, z, this._options.bindingsMapping), !0;}dispatchWhenReady(x, y, z, delay = 10) {return new Promise((resolve) => {const check = () => {this.dispatch(x, y, z) ? resolve() : setTimeout(check, delay);};check();});}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this);for (const key in serializationObject.options = this._options, serializationObject.shaderPath = this._shaderPath, serializationObject.bindings = {}, serializationObject.textures = {}, this._bindings) {const binding = this._bindings[key],object = binding.object;switch (binding.type) {case ComputeBindingType.Texture:case ComputeBindingType.TextureWithoutSampler:case ComputeBindingType.StorageTexture:{const serializedData = object.serialize();serializedData && (serializationObject.textures[key] = serializedData, serializationObject.bindings[key] = { type: binding.type });break;}case ComputeBindingType.UniformBuffer:}}return serializationObject;}static Parse(source, scene, rootUrl) {const compute = decorators/* SerializationHelper.Parse */.p4.Parse(() => new ComputeShader(source.name, scene.getEngine(), source.shaderPath, source.options), source, scene, rootUrl);for (const key in source.textures) {const binding = source.bindings[key],texture = Textures_texture/* Texture.Parse */.x.Parse(source.textures[key], scene, rootUrl);binding.type === ComputeBindingType.Texture ? compute.setTexture(key, texture) : binding.type === ComputeBindingType.TextureWithoutSampler ? compute.setTexture(key, texture, !1) : compute.setStorageTexture(key, texture);}return compute;}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ComputeShader.prototype, "name", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ComputeShader", ComputeShader);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Compute/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/boundingBox.js
var boundingBox = __webpack_require__("./node_modules/@babylonjs/core/Culling/boundingBox.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/boundingInfo.js
var boundingInfo = __webpack_require__("./node_modules/@babylonjs/core/Culling/boundingInfo.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/boundingSphere.js
var boundingSphere = __webpack_require__("./node_modules/@babylonjs/core/Culling/boundingSphere.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/smartArray.js
var smartArray = __webpack_require__("./node_modules/@babylonjs/core/Misc/smartArray.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Culling/Octrees/octreeBlock.js
class OctreeBlock {constructor(minPoint, maxPoint, capacity, depth, maxDepth, creationFunc) {this.entries = [], this._boundingVectors = [], this._capacity = capacity, this._depth = depth, this._maxDepth = maxDepth, this._creationFunc = creationFunc, this._minPoint = minPoint, this._maxPoint = maxPoint, this._boundingVectors.push(minPoint.clone()), this._boundingVectors.push(maxPoint.clone()), this._boundingVectors.push(minPoint.clone()), this._boundingVectors[2].x = maxPoint.x, this._boundingVectors.push(minPoint.clone()), this._boundingVectors[3].y = maxPoint.y, this._boundingVectors.push(minPoint.clone()), this._boundingVectors[4].z = maxPoint.z, this._boundingVectors.push(maxPoint.clone()), this._boundingVectors[5].z = minPoint.z, this._boundingVectors.push(maxPoint.clone()), this._boundingVectors[6].x = minPoint.x, this._boundingVectors.push(maxPoint.clone()), this._boundingVectors[7].y = minPoint.y;}get capacity() {return this._capacity;}get minPoint() {return this._minPoint;}get maxPoint() {return this._maxPoint;}addEntry(entry) {if (this.blocks) {for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.addEntry(entry);}return;}this._creationFunc(entry, this), this.entries.length > this.capacity && this._depth < this._maxDepth && this.createInnerBlocks();}removeEntry(entry) {if (this.blocks) {for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.removeEntry(entry);}return;}const entryIndex = this.entries.indexOf(entry);-1 < entryIndex && this.entries.splice(entryIndex, 1);}addEntries(entries) {for (let index = 0; index < entries.length; index++) {const mesh = entries[index];this.addEntry(mesh);}}select(frustumPlanes, selection, allowDuplicate) {if (boundingBox/* BoundingBox.IsInFrustum */.k.IsInFrustum(this._boundingVectors, frustumPlanes)) {if (this.blocks) {for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.select(frustumPlanes, selection, allowDuplicate);}return;}allowDuplicate ? selection.concat(this.entries) : selection.concatWithNoDuplicate(this.entries);}}intersects(sphereCenter, sphereRadius, selection, allowDuplicate) {if (boundingBox/* BoundingBox.IntersectsSphere */.k.IntersectsSphere(this._minPoint, this._maxPoint, sphereCenter, sphereRadius)) {if (this.blocks) {for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.intersects(sphereCenter, sphereRadius, selection, allowDuplicate);}return;}allowDuplicate ? selection.concat(this.entries) : selection.concatWithNoDuplicate(this.entries);}}intersectsRay(ray, selection) {if (ray.intersectsBoxMinMax(this._minPoint, this._maxPoint)) {if (this.blocks) {for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.intersectsRay(ray, selection);}return;}selection.concatWithNoDuplicate(this.entries);}}createInnerBlocks() {OctreeBlock._CreateBlocks(this._minPoint, this._maxPoint, this.entries, this._capacity, this._depth, this._maxDepth, this, this._creationFunc), this.entries.splice(0);}static _CreateBlocks(worldMin, worldMax, entries, maxBlockCapacity, currentDepth, maxDepth, target, creationFunc) {target.blocks = [];const blockSize = new math_vector/* Vector3 */.P((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2);for (let x = 0; 2 > x; x++) for (let y = 0; 2 > y; y++) for (let z = 0; 2 > z; z++) {const localMin = worldMin.add(blockSize.multiplyByFloats(x, y, z)),localMax = worldMin.add(blockSize.multiplyByFloats(x + 1, y + 1, z + 1)),block = new OctreeBlock(localMin, localMax, maxBlockCapacity, currentDepth + 1, maxDepth, creationFunc);block.addEntries(entries), target.blocks.push(block);}}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Culling/Octrees/octree.js
class Octree {constructor(creationFunc, maxBlockCapacity, maxDepth = 2) {this.maxDepth = maxDepth, this.dynamicContent = [], this._maxBlockCapacity = maxBlockCapacity || 64, this._selectionContent = new smartArray/* SmartArrayNoDuplicate */.f(1024), this._creationFunc = creationFunc;}update(worldMin, worldMax, entries) {OctreeBlock._CreateBlocks(worldMin, worldMax, entries, this._maxBlockCapacity, 0, this.maxDepth, this, this._creationFunc);}addMesh(entry) {for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.addEntry(entry);}}removeMesh(entry) {for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.removeEntry(entry);}}select(frustumPlanes, allowDuplicate) {this._selectionContent.reset();for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.select(frustumPlanes, this._selectionContent, allowDuplicate);}return allowDuplicate ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;}intersects(sphereCenter, sphereRadius, allowDuplicate) {this._selectionContent.reset();for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.intersects(sphereCenter, sphereRadius, this._selectionContent, allowDuplicate);}return allowDuplicate ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;}intersectsRay(ray) {this._selectionContent.reset();for (let index = 0; index < this.blocks.length; index++) {const block = this.blocks[index];block.intersectsRay(ray, this._selectionContent);}return this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;}}Octree.CreationFuncForMeshes = (entry, block) => {const boundingInfo = entry.getBoundingInfo();!entry.isBlocked && boundingInfo.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint) && block.entries.push(entry);}, Octree.CreationFuncForSubMeshes = (entry, block) => {const boundingInfo = entry.getBoundingInfo();boundingInfo.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint) && block.entries.push(entry);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Culling/Octrees/octreeSceneComponent.js
core_scene/* Scene.prototype.createOrUpdateSelectionOctree */.x.prototype.createOrUpdateSelectionOctree = function (maxCapacity = 64, maxDepth = 2) {let component = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_OCTREE */.l.NAME_OCTREE);component || (component = new OctreeSceneComponent(this), this._addComponent(component)), this._selectionOctree || (this._selectionOctree = new Octree(Octree.CreationFuncForMeshes, maxCapacity, maxDepth));const worldExtends = this.getWorldExtends();return this._selectionOctree.update(worldExtends.min, worldExtends.max, this.meshes), this._selectionOctree;}, Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "selectionOctree", { get: function () {return this._selectionOctree;}, enumerable: !0, configurable: !0 }), abstractMesh/* AbstractMesh.prototype.createOrUpdateSubmeshesOctree */.x.prototype.createOrUpdateSubmeshesOctree = function (maxCapacity = 64, maxDepth = 2) {const scene = this.getScene();let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_OCTREE */.l.NAME_OCTREE);component || (component = new OctreeSceneComponent(scene), scene._addComponent(component)), this._submeshesOctree || (this._submeshesOctree = new Octree(Octree.CreationFuncForSubMeshes, maxCapacity, maxDepth)), this.computeWorldMatrix(!0);const boundingInfo = this.getBoundingInfo(),bbox = boundingInfo.boundingBox;return this._submeshesOctree.update(bbox.minimumWorld, bbox.maximumWorld, this.subMeshes), this._submeshesOctree;};class OctreeSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_OCTREE */.l.NAME_OCTREE, this.checksIsEnabled = !0, this._tempRay = new Ray(math_vector/* Vector3.Zero */.P.Zero(), new math_vector/* Vector3 */.P(1, 1, 1)), scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;scene && (this.scene = scene, this.scene.getActiveMeshCandidates = this.getActiveMeshCandidates.bind(this), this.scene.getActiveSubMeshCandidates = this.getActiveSubMeshCandidates.bind(this), this.scene.getCollidingSubMeshCandidates = this.getCollidingSubMeshCandidates.bind(this), this.scene.getIntersectingSubMeshCandidates = this.getIntersectingSubMeshCandidates.bind(this));}register() {this.scene.onMeshRemovedObservable.add((mesh) => {const sceneOctree = this.scene.selectionOctree;if (sceneOctree !== void 0 && null !== sceneOctree) {const index = sceneOctree.dynamicContent.indexOf(mesh);-1 !== index && sceneOctree.dynamicContent.splice(index, 1);}}), this.scene.onMeshImportedObservable.add((mesh) => {const sceneOctree = this.scene.selectionOctree;sceneOctree !== void 0 && null !== sceneOctree && sceneOctree.addMesh(mesh);});}getActiveMeshCandidates() {var _a;return (null === (_a = this.scene._selectionOctree) || void 0 === _a ? void 0 : _a.select(this.scene.frustumPlanes)) || this.scene._getDefaultMeshCandidates();}getActiveSubMeshCandidates(mesh) {if (mesh._submeshesOctree && mesh.useOctreeForRenderingSelection) {const intersections = mesh._submeshesOctree.select(this.scene.frustumPlanes);return intersections;}return this.scene._getDefaultSubMeshCandidates(mesh);}getIntersectingSubMeshCandidates(mesh, localRay) {if (mesh._submeshesOctree && mesh.useOctreeForPicking) {Ray.TransformToRef(localRay, mesh.getWorldMatrix(), this._tempRay);const intersections = mesh._submeshesOctree.intersectsRay(this._tempRay);return intersections;}return this.scene._getDefaultSubMeshCandidates(mesh);}getCollidingSubMeshCandidates(mesh, collider) {if (mesh._submeshesOctree && mesh.useOctreeForCollisions) {const radius = collider._velocityWorldLength + Math.max(collider._radius.x, collider._radius.y, collider._radius.z),intersections = mesh._submeshesOctree.intersects(collider._basePointWorld, radius);return intersections;}return this.scene._getDefaultSubMeshCandidates(mesh);}rebuild() {}dispose() {}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Culling/Octrees/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Culling/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/utilityLayerRenderer.js
class UtilityLayerRenderer {getRenderCamera(getRigParentIfPossible) {if (this._renderCamera) return this._renderCamera;else {let activeCam;return activeCam = this.originalScene.activeCameras && 1 < this.originalScene.activeCameras.length ? this.originalScene.activeCameras[this.originalScene.activeCameras.length - 1] : this.originalScene.activeCamera, getRigParentIfPossible && activeCam && activeCam.isRigCamera ? activeCam.rigParent : activeCam;}}setRenderCamera(cam) {this._renderCamera = cam;}_getSharedGizmoLight() {return this._sharedGizmoLight || (this._sharedGizmoLight = new hemisphericLight/* HemisphericLight */.e("shared gizmo light", new math_vector/* Vector3 */.P(0, 1, 0), this.utilityLayerScene), this._sharedGizmoLight.intensity = 2, this._sharedGizmoLight.groundColor = math_color/* Color3.Gray */.Wo.Gray()), this._sharedGizmoLight;}static get DefaultUtilityLayer() {return null == UtilityLayerRenderer._DefaultUtilityLayer ? UtilityLayerRenderer._CreateDefaultUtilityLayerFromScene(engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene) : UtilityLayerRenderer._DefaultUtilityLayer;}static _CreateDefaultUtilityLayerFromScene(scene) {return UtilityLayerRenderer._DefaultUtilityLayer = new UtilityLayerRenderer(scene), UtilityLayerRenderer._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(() => {UtilityLayerRenderer._DefaultUtilityLayer = null;}), UtilityLayerRenderer._DefaultUtilityLayer;}static get DefaultKeepDepthUtilityLayer() {return null == UtilityLayerRenderer._DefaultKeepDepthUtilityLayer && (UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = new UtilityLayerRenderer(engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene), UtilityLayerRenderer._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = !1, UtilityLayerRenderer._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(() => {UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = null;})), UtilityLayerRenderer._DefaultKeepDepthUtilityLayer;}constructor(originalScene, handleEvents = !0) {this.originalScene = originalScene, this._pointerCaptures = {}, this._lastPointerEvents = {}, this._sharedGizmoLight = null, this._renderCamera = null, this.pickUtilitySceneFirst = !0, this.shouldRender = !0, this.onlyCheckPointerDownEvents = !0, this.processAllEvents = !1, this.pickingEnabled = !0, this.onPointerOutObservable = new observable/* Observable */.y$(), this.utilityLayerScene = new core_scene/* Scene */.x(originalScene.getEngine(), { virtual: !0 }), this.utilityLayerScene.useRightHandedSystem = originalScene.useRightHandedSystem, this.utilityLayerScene._allowPostProcessClearColor = !1, this.utilityLayerScene.postProcessesEnabled = !1, this.utilityLayerScene.detachControl(), handleEvents && (this._originalPointerObserver = originalScene.onPrePointerObservable.add((prePointerInfo) => {if (!this.utilityLayerScene.activeCamera) return;if (!this.pickingEnabled) return;if (!this.processAllEvents && prePointerInfo.type !== pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE && prePointerInfo.type !== pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP && prePointerInfo.type !== pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN && prePointerInfo.type !== pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP) return;this.utilityLayerScene.pointerX = originalScene.pointerX, this.utilityLayerScene.pointerY = originalScene.pointerY;const pointerEvent = prePointerInfo.event;if (originalScene.isPointerCaptured(pointerEvent.pointerId)) return void (this._pointerCaptures[pointerEvent.pointerId] = !1);const getNearPickDataForScene = (scene) => {let scenePick = null;if (prePointerInfo.nearInteractionPickingInfo) scenePick = prePointerInfo.nearInteractionPickingInfo.pickedMesh.getScene() == scene ? prePointerInfo.nearInteractionPickingInfo : new Collisions_pickingInfo/* PickingInfo */.p();else if (scene !== this.utilityLayerScene && prePointerInfo.originalPickingInfo) scenePick = prePointerInfo.originalPickingInfo;else {let previousActiveCamera = null;this._renderCamera && (previousActiveCamera = scene._activeCamera, scene._activeCamera = this._renderCamera, prePointerInfo.ray = null), scenePick = prePointerInfo.ray ? scene.pickWithRay(prePointerInfo.ray) : scene.pick(originalScene.pointerX, originalScene.pointerY), previousActiveCamera && (scene._activeCamera = previousActiveCamera);}return scenePick;},utilityScenePick = getNearPickDataForScene(this.utilityLayerScene);if (!prePointerInfo.ray && utilityScenePick && (prePointerInfo.ray = utilityScenePick.ray), this.utilityLayerScene.onPrePointerObservable.notifyObservers(prePointerInfo), this.onlyCheckPointerDownEvents && prePointerInfo.type != pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN) return prePointerInfo.skipOnPointerObservable || this.utilityLayerScene.onPointerObservable.notifyObservers(new pointerEvents/* PointerInfo */.R5(prePointerInfo.type, prePointerInfo.event, utilityScenePick), prePointerInfo.type), void (prePointerInfo.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP && this._pointerCaptures[pointerEvent.pointerId] && (this._pointerCaptures[pointerEvent.pointerId] = !1));if (this.utilityLayerScene.autoClearDepthAndStencil || this.pickUtilitySceneFirst) utilityScenePick && utilityScenePick.hit && (!prePointerInfo.skipOnPointerObservable && this.utilityLayerScene.onPointerObservable.notifyObservers(new pointerEvents/* PointerInfo */.R5(prePointerInfo.type, prePointerInfo.event, utilityScenePick), prePointerInfo.type), prePointerInfo.skipOnPointerObservable = !0);else {const originalScenePick = getNearPickDataForScene(originalScene),pointerEvent = prePointerInfo.event;originalScenePick && utilityScenePick && (0 === utilityScenePick.distance && originalScenePick.pickedMesh ? this.mainSceneTrackerPredicate && this.mainSceneTrackerPredicate(originalScenePick.pickedMesh) ? (this._notifyObservers(prePointerInfo, originalScenePick, pointerEvent), prePointerInfo.skipOnPointerObservable = !0) : prePointerInfo.type === pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN ? this._pointerCaptures[pointerEvent.pointerId] = !0 : (prePointerInfo.type === pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE || prePointerInfo.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP) && (this._lastPointerEvents[pointerEvent.pointerId] && (this.onPointerOutObservable.notifyObservers(pointerEvent.pointerId), delete this._lastPointerEvents[pointerEvent.pointerId]), this._notifyObservers(prePointerInfo, originalScenePick, pointerEvent)) : !this._pointerCaptures[pointerEvent.pointerId] && (utilityScenePick.distance < originalScenePick.distance || 0 === originalScenePick.distance) ? (this._notifyObservers(prePointerInfo, utilityScenePick, pointerEvent), !prePointerInfo.skipOnPointerObservable && (prePointerInfo.skipOnPointerObservable = 0 < utilityScenePick.distance)) : !this._pointerCaptures[pointerEvent.pointerId] && utilityScenePick.distance >= originalScenePick.distance && (this.mainSceneTrackerPredicate && this.mainSceneTrackerPredicate(originalScenePick.pickedMesh) ? (this._notifyObservers(prePointerInfo, originalScenePick, pointerEvent), prePointerInfo.skipOnPointerObservable = !0) : ((prePointerInfo.type === pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE || prePointerInfo.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP) && this._lastPointerEvents[pointerEvent.pointerId] && (this.onPointerOutObservable.notifyObservers(pointerEvent.pointerId), delete this._lastPointerEvents[pointerEvent.pointerId]), this._notifyObservers(prePointerInfo, utilityScenePick, pointerEvent))), prePointerInfo.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP && this._pointerCaptures[pointerEvent.pointerId] && (this._pointerCaptures[pointerEvent.pointerId] = !1));}}), this._originalPointerObserver && originalScene.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver)), this.utilityLayerScene.autoClear = !1, this._afterRenderObserver = this.originalScene.onAfterRenderCameraObservable.add((camera) => {this.shouldRender && camera == this.getRenderCamera() && this.render();}), this._sceneDisposeObserver = this.originalScene.onDisposeObservable.add(() => {this.dispose();}), this._updateCamera();}_notifyObservers(prePointerInfo, pickInfo, pointerEvent) {prePointerInfo.skipOnPointerObservable || (this.utilityLayerScene.onPointerObservable.notifyObservers(new pointerEvents/* PointerInfo */.R5(prePointerInfo.type, prePointerInfo.event, pickInfo), prePointerInfo.type), this._lastPointerEvents[pointerEvent.pointerId] = !0);}render() {if (this._updateCamera(), this.utilityLayerScene.activeCamera) {const oldScene = this.utilityLayerScene.activeCamera.getScene(),camera = this.utilityLayerScene.activeCamera;camera._scene = this.utilityLayerScene, camera.leftCamera && (camera.leftCamera._scene = this.utilityLayerScene), camera.rightCamera && (camera.rightCamera._scene = this.utilityLayerScene), this.utilityLayerScene.render(!1), camera._scene = oldScene, camera.leftCamera && (camera.leftCamera._scene = oldScene), camera.rightCamera && (camera.rightCamera._scene = oldScene);}}dispose() {this.onPointerOutObservable.clear(), this._afterRenderObserver && this.originalScene.onAfterCameraRenderObservable.remove(this._afterRenderObserver), this._sceneDisposeObserver && this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver), this._originalPointerObserver && this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver), this.utilityLayerScene.dispose();}_updateCamera() {this.utilityLayerScene.cameraToUseForPointers = this.getRenderCamera(), this.utilityLayerScene.activeCamera = this.getRenderCamera();}}UtilityLayerRenderer._DefaultUtilityLayer = null, UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = null;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/light.js
var Lights_light = __webpack_require__("./node_modules/@babylonjs/core/Lights/light.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/gizmo.js
class Gizmo {set scaleRatio(value) {this._scaleRatio = value;}get scaleRatio() {return this._scaleRatio;}get isHovered() {return this._isHovered;}get attachedMesh() {return this._attachedMesh;}set attachedMesh(value) {this._attachedMesh = value, value && (this._attachedNode = value), this._rootMesh.setEnabled(!!value), this._attachedNodeChanged(value);}get attachedNode() {return this._attachedNode;}set attachedNode(value) {this._attachedNode = value, this._attachedMesh = null, this._rootMesh.setEnabled(!!value), this._attachedNodeChanged(value);}setCustomMesh(mesh) {if (mesh.getScene() != this.gizmoLayer.utilityLayerScene) throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";this._rootMesh.getChildMeshes().forEach((c) => {c.dispose();}), mesh.parent = this._rootMesh, this._customMeshSet = !0;}set updateGizmoRotationToMatchAttachedMesh(value) {this._updateGizmoRotationToMatchAttachedMesh = value;}get updateGizmoRotationToMatchAttachedMesh() {return this._updateGizmoRotationToMatchAttachedMesh;}set updateGizmoPositionToMatchAttachedMesh(value) {this._updateGizmoPositionToMatchAttachedMesh = value;}get updateGizmoPositionToMatchAttachedMesh() {return this._updateGizmoPositionToMatchAttachedMesh;}set updateScale(value) {this._updateScale = value;}get updateScale() {return this._updateScale;}_attachedNodeChanged() {}constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer) {this.gizmoLayer = gizmoLayer, this._attachedMesh = null, this._attachedNode = null, this._customRotationQuaternion = null, this._scaleRatio = 1, this._isHovered = !1, this._customMeshSet = !1, this._updateGizmoRotationToMatchAttachedMesh = !0, this._updateGizmoPositionToMatchAttachedMesh = !0, this._updateScale = !0, this._interactionsEnabled = !0, this._rightHandtoLeftHandMatrix = math_vector/* Matrix.RotationY */.y3.RotationY(Math.PI), this._rootMesh = new Meshes_mesh/* Mesh */.Kj("gizmoRootNode", gizmoLayer.utilityLayerScene), this._rootMesh.rotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this._beforeRenderObserver = this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(() => {this._update();});}get customRotationQuaternion() {return this._customRotationQuaternion;}set customRotationQuaternion(customRotationQuaternion) {this._customRotationQuaternion = customRotationQuaternion;}_update() {if (this.attachedNode) {let effectiveNode = this.attachedNode;if (this.attachedMesh && (effectiveNode = this.attachedMesh || this.attachedNode), this.updateGizmoPositionToMatchAttachedMesh) {const row = effectiveNode.getWorldMatrix().getRow(3),position = row ? row.toVector3() : new math_vector/* Vector3 */.P(0, 0, 0);this._rootMesh.position.copyFrom(position);}if (this.updateGizmoRotationToMatchAttachedMesh) {const supportedNode = effectiveNode._isMesh || "AbstractMesh" === effectiveNode.getClassName() || "TransformNode" === effectiveNode.getClassName() || "InstancedMesh" === effectiveNode.getClassName(),transformNode = supportedNode ? effectiveNode : void 0;effectiveNode.getWorldMatrix().decompose(void 0, this._rootMesh.rotationQuaternion, void 0, Gizmo.PreserveScaling ? transformNode : void 0);} else this._customRotationQuaternion ? this._rootMesh.rotationQuaternion.copyFrom(this._customRotationQuaternion) : this._rootMesh.rotationQuaternion.set(0, 0, 0, 1);if (this.updateScale) {const activeCamera = this.gizmoLayer.utilityLayerScene.activeCamera;let cameraPosition = activeCamera.globalPosition;activeCamera.devicePosition && (cameraPosition = activeCamera.devicePosition), this._rootMesh.position.subtractToRef(cameraPosition, math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]);let scale = this.scaleRatio;if (activeCamera.mode != Cameras_camera/* Camera.ORTHOGRAPHIC_CAMERA */.V.ORTHOGRAPHIC_CAMERA) {const camForward = activeCamera.getScene().useRightHandedSystem ? math_vector/* Vector3.RightHandedForwardReadOnly */.P.RightHandedForwardReadOnly : math_vector/* Vector3.LeftHandedForwardReadOnly */.P.LeftHandedForwardReadOnly,direction = activeCamera.getDirection(camForward);scale *= math_vector/* Vector3.Dot */.P.Dot(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0], direction);} else if (activeCamera.orthoTop && activeCamera.orthoBottom) {const orthoHeight = activeCamera.orthoTop - activeCamera.orthoBottom;scale *= orthoHeight;}this._rootMesh.scaling.setAll(scale), 0 > effectiveNode._getWorldMatrixDeterminant() && !Gizmo.PreserveScaling && (this._rootMesh.scaling.y *= -1);} else this._rootMesh.scaling.setAll(this.scaleRatio);}}_handlePivot() {const attachedNodeTransform = this._attachedNode;attachedNodeTransform.isUsingPivotMatrix && attachedNodeTransform.isUsingPivotMatrix() && attachedNodeTransform.position && attachedNodeTransform.getWorldMatrix().setTranslation(attachedNodeTransform.position);}_matrixChanged() {if (this._attachedNode) if (this._attachedNode._isCamera) {const camera = this._attachedNode;let worldMatrix, worldMatrixUC;if (camera.parent) {const parentInv = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1];camera.parent._worldMatrix.invertToRef(parentInv), this._attachedNode._worldMatrix.multiplyToRef(parentInv, math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), worldMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];} else worldMatrix = this._attachedNode._worldMatrix;camera.getScene().useRightHandedSystem ? (this._rightHandtoLeftHandMatrix.multiplyToRef(worldMatrix, math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1]), worldMatrixUC = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1]) : worldMatrixUC = worldMatrix, worldMatrixUC.decompose(math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1], math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]);const inheritsTargetCamera = "FreeCamera" === this._attachedNode.getClassName() || "FlyCamera" === this._attachedNode.getClassName() || "ArcFollowCamera" === this._attachedNode.getClassName() || "TargetCamera" === this._attachedNode.getClassName() || "TouchCamera" === this._attachedNode.getClassName() || "UniversalCamera" === this._attachedNode.getClassName();if (inheritsTargetCamera) {const targetCamera = this._attachedNode;targetCamera.rotation = math_vector/* TmpVectors.Quaternion.0.toEulerAngles */.jp.Quaternion[0].toEulerAngles(), targetCamera.rotationQuaternion && (targetCamera.rotationQuaternion.copyFrom(math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0]), targetCamera.rotationQuaternion.normalize());}camera.position.copyFrom(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]);} else if (this._attachedNode._isMesh || "AbstractMesh" === this._attachedNode.getClassName() || "TransformNode" === this._attachedNode.getClassName() || "InstancedMesh" === this._attachedNode.getClassName()) {const transform = this._attachedNode;if (transform.parent) {const parentInv = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],localMat = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1];transform.parent.getWorldMatrix().invertToRef(parentInv), this._attachedNode.getWorldMatrix().multiplyToRef(parentInv, localMat), localMat.decompose(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0], math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], transform.position, Gizmo.PreserveScaling ? transform : void 0);} else this._attachedNode._worldMatrix.decompose(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0], math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], transform.position, Gizmo.PreserveScaling ? transform : void 0);transform.scaling.copyFrom(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]), transform.billboardMode || (transform.rotationQuaternion ? (transform.rotationQuaternion.copyFrom(math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0]), transform.rotationQuaternion.normalize()) : transform.rotation = math_vector/* TmpVectors.Quaternion.0.toEulerAngles */.jp.Quaternion[0].toEulerAngles());} else if ("Bone" === this._attachedNode.getClassName()) {const bone = this._attachedNode,parent = bone.getParent();if (parent) {const invParent = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],boneLocalMatrix = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1];parent.getWorldMatrix().invertToRef(invParent), bone.getWorldMatrix().multiplyToRef(invParent, boneLocalMatrix);const lmat = bone.getLocalMatrix();lmat.copyFrom(boneLocalMatrix);} else {const lmat = bone.getLocalMatrix();lmat.copyFrom(bone.getWorldMatrix());}bone.markAsDirty();} else {const light = this._attachedNode;if (light.getTypeID) {const type = light.getTypeID();if (type === Lights_light/* Light.LIGHTTYPEID_DIRECTIONALLIGHT */._.LIGHTTYPEID_DIRECTIONALLIGHT || type === Lights_light/* Light.LIGHTTYPEID_SPOTLIGHT */._.LIGHTTYPEID_SPOTLIGHT || type === Lights_light/* Light.LIGHTTYPEID_POINTLIGHT */._.LIGHTTYPEID_POINTLIGHT) {const parent = light.parent;if (parent) {const invParent = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],nodeLocalMatrix = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1];parent.getWorldMatrix().invertToRef(invParent), light.getWorldMatrix().multiplyToRef(invParent, nodeLocalMatrix), nodeLocalMatrix.decompose(void 0, math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]);} else this._attachedNode._worldMatrix.decompose(void 0, math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]);light.position = new math_vector/* Vector3 */.P(math_vector/* TmpVectors.Vector3.0.x */.jp.Vector3[0].x, math_vector/* TmpVectors.Vector3.0.y */.jp.Vector3[0].y, math_vector/* TmpVectors.Vector3.0.z */.jp.Vector3[0].z), light.direction && (light.direction = new math_vector/* Vector3 */.P(light.direction.x, light.direction.y, light.direction.z));}}}}_setGizmoMeshMaterial(gizmoMeshes, material) {gizmoMeshes && gizmoMeshes.forEach((m) => {m.material = material, m.color && (m.color = material.diffuseColor);});}static GizmoAxisPointerObserver(gizmoLayer, gizmoAxisCache) {let dragging = !1;const pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {var _a, _b;if (pointerInfo.pickInfo) {if (pointerInfo.type === pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE) {if (dragging) return;gizmoAxisCache.forEach((cache) => {var _a, _b;if (cache.colliderMeshes && cache.gizmoMeshes) {const isHovered = -1 != (null === (_a = cache.colliderMeshes) || void 0 === _a ? void 0 : _a.indexOf(null === (_b = null === pointerInfo || void 0 === pointerInfo ? void 0 : pointerInfo.pickInfo) || void 0 === _b ? void 0 : _b.pickedMesh)),material = cache.dragBehavior.enabled ? isHovered || cache.active ? cache.hoverMaterial : cache.material : cache.disableMaterial;cache.gizmoMeshes.forEach((m) => {m.material = material, m.color && (m.color = material.diffuseColor);});}});}if (pointerInfo.type === pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN && gizmoAxisCache.has(null === (_a = pointerInfo.pickInfo.pickedMesh) || void 0 === _a ? void 0 : _a.parent)) {dragging = !0;const statusMap = gizmoAxisCache.get(null === (_b = pointerInfo.pickInfo.pickedMesh) || void 0 === _b ? void 0 : _b.parent);statusMap.active = !0, gizmoAxisCache.forEach((cache) => {var _a, _b;const isHovered = -1 != (null === (_a = cache.colliderMeshes) || void 0 === _a ? void 0 : _a.indexOf(null === (_b = null === pointerInfo || void 0 === pointerInfo ? void 0 : pointerInfo.pickInfo) || void 0 === _b ? void 0 : _b.pickedMesh)),material = (isHovered || cache.active) && cache.dragBehavior.enabled ? cache.hoverMaterial : cache.disableMaterial;cache.gizmoMeshes.forEach((m) => {m.material = material, m.color && (m.color = material.diffuseColor);});});}pointerInfo.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP && gizmoAxisCache.forEach((cache) => {cache.active = !1, dragging = !1, cache.gizmoMeshes.forEach((m) => {m.material = cache.dragBehavior.enabled ? cache.material : cache.disableMaterial, m.color && (m.color = cache.material.diffuseColor);});});}});return pointerObserver;}dispose() {this._rootMesh.dispose(), this._beforeRenderObserver && this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver);}}Gizmo.PreserveScaling = !1;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/axisDragGizmo.js
class AxisDragGizmo extends Gizmo {get coloredMaterial() {return this._coloredMaterial;}get hoverMaterial() {return this._hoverMaterial;}get disableMaterial() {return this._disableMaterial;}static _CreateArrow(scene, material, thickness = 1, isCollider = !1) {const arrow = new transformNode/* TransformNode */.Y("arrow", scene),cylinder = CreateCylinder("cylinder", { diameterTop: 0, height: .075, diameterBottom: .0375 * (1 + (thickness - 1) / 4), tessellation: 96 }, scene),line = CreateCylinder("cylinder", { diameterTop: .005 * thickness, height: .275, diameterBottom: .005 * thickness, tessellation: 96 }, scene);return cylinder.parent = arrow, cylinder.material = material, cylinder.rotation.x = Math.PI / 2, cylinder.position.z += .3, line.parent = arrow, line.material = material, line.position.z += .275 / 2, line.rotation.x = Math.PI / 2, isCollider && (line.visibility = 0, cylinder.visibility = 0), arrow;}static _CreateArrowInstance(scene, arrow) {const instance = new transformNode/* TransformNode */.Y("arrow", scene);for (const mesh of arrow.getChildMeshes()) {const childInstance = mesh.createInstance(mesh.name);childInstance.parent = instance;}return instance;}constructor(dragAxis, color = math_color/* Color3.Gray */.Wo.Gray(), gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, parent = null, thickness = 1) {var _a;super(gizmoLayer), this._pointerObserver = null, this.snapDistance = 0, this.onSnapObservable = new observable/* Observable */.y$(), this._isEnabled = !0, this._parent = null, this._dragging = !1, this._parent = parent, this._coloredMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._coloredMaterial.diffuseColor = color, this._coloredMaterial.specularColor = color.subtract(new math_color/* Color3 */.Wo(.1, .1, .1)), this._hoverMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._hoverMaterial.diffuseColor = math_color/* Color3.Yellow */.Wo.Yellow(), this._disableMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._disableMaterial.diffuseColor = math_color/* Color3.Gray */.Wo.Gray(), this._disableMaterial.alpha = .4;const arrow = AxisDragGizmo._CreateArrow(gizmoLayer.utilityLayerScene, this._coloredMaterial, thickness),collider = AxisDragGizmo._CreateArrow(gizmoLayer.utilityLayerScene, this._coloredMaterial, thickness + 4, !0);this._gizmoMesh = new Meshes_mesh/* Mesh */.Kj("", gizmoLayer.utilityLayerScene), this._gizmoMesh.addChild(arrow), this._gizmoMesh.addChild(collider), this._gizmoMesh.lookAt(this._rootMesh.position.add(dragAxis)), this._gizmoMesh.scaling.scaleInPlace(1 / 3), this._gizmoMesh.parent = this._rootMesh;let currentSnapDragDistance = 0;const tmpSnapEvent = { snapDistance: 0 };this.dragBehavior = new PointerDragBehavior({ dragAxis: dragAxis }), this.dragBehavior.moveAttached = !1, this.dragBehavior.updateDragPlane = !1, this._rootMesh.addBehavior(this.dragBehavior), this.dragBehavior.onDragObservable.add((event) => {if (this.attachedNode) {this._handlePivot();let matrixChanged = !1;if (0 == this.snapDistance) this.attachedNode.getWorldMatrix().getTranslationToRef(math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2]), math_vector/* TmpVectors.Vector3.2.addInPlace */.jp.Vector3[2].addInPlace(event.delta), this.dragBehavior.validateDrag(math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2]) && (this.attachedNode.position && this.attachedNode.position.addInPlaceFromFloats(event.delta.x, event.delta.y, event.delta.z), this.attachedNode.getWorldMatrix().addTranslationFromFloats(event.delta.x, event.delta.y, event.delta.z), this.attachedNode.updateCache(), matrixChanged = !0);else if (currentSnapDragDistance += event.dragDistance, Math.abs(currentSnapDragDistance) > this.snapDistance) {const dragSteps = Math.floor(Math.abs(currentSnapDragDistance) / this.snapDistance);currentSnapDragDistance %= this.snapDistance, event.delta.normalizeToRef(math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1]), math_vector/* TmpVectors.Vector3.1.scaleInPlace */.jp.Vector3[1].scaleInPlace(this.snapDistance * dragSteps), this.attachedNode.getWorldMatrix().getTranslationToRef(math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2]), math_vector/* TmpVectors.Vector3.2.addInPlace */.jp.Vector3[2].addInPlace(math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1]), this.dragBehavior.validateDrag(math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2]) && (this.attachedNode.getWorldMatrix().addTranslationFromFloats(math_vector/* TmpVectors.Vector3.1.x */.jp.Vector3[1].x, math_vector/* TmpVectors.Vector3.1.y */.jp.Vector3[1].y, math_vector/* TmpVectors.Vector3.1.z */.jp.Vector3[1].z), this.attachedNode.updateCache(), tmpSnapEvent.snapDistance = this.snapDistance * dragSteps, this.onSnapObservable.notifyObservers(tmpSnapEvent), matrixChanged = !0);}matrixChanged && this._matrixChanged();}}), this.dragBehavior.onDragStartObservable.add(() => {this._dragging = !0;}), this.dragBehavior.onDragEndObservable.add(() => {this._dragging = !1;});const light = gizmoLayer._getSharedGizmoLight();light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));const cache = { gizmoMeshes: arrow.getChildMeshes(), colliderMeshes: collider.getChildMeshes(), material: this._coloredMaterial, hoverMaterial: this._hoverMaterial, disableMaterial: this._disableMaterial, active: !1, dragBehavior: this.dragBehavior };null === (_a = this._parent) || void 0 === _a ? void 0 : _a.addToAxisCache(collider, cache), this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {var _a;if (!this._customMeshSet && (this._isHovered = -1 != cache.colliderMeshes.indexOf(null === (_a = null === pointerInfo || void 0 === pointerInfo ? void 0 : pointerInfo.pickInfo) || void 0 === _a ? void 0 : _a.pickedMesh), !this._parent)) {const material = this.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial;this._setGizmoMeshMaterial(cache.gizmoMeshes, material);}}), this.dragBehavior.onEnabledObservable.add((newState) => {this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? cache.material : cache.disableMaterial);});}_attachedNodeChanged(value) {this.dragBehavior && (this.dragBehavior.enabled = !!value);}set isEnabled(value) {this._isEnabled = value, value ? this._parent && (this.attachedMesh = this._parent.attachedMesh, this.attachedNode = this._parent.attachedNode) : (this.attachedMesh = null, this.attachedNode = null);}get isEnabled() {return this._isEnabled;}dispose() {this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {matl && matl.dispose();}), super.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Debug/axesViewer.js
class AxesViewer {get xAxis() {return this._xAxis;}get yAxis() {return this._yAxis;}get zAxis() {return this._zAxis;}constructor(scene, scaleLines = 1, renderingGroupId = 2, xAxis, yAxis, zAxis, lineThickness = 1) {if (this._scaleLinesFactor = 4, this._instanced = !1, this.scene = null, this.scaleLines = 1, scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, !!scene) {if (this.scaleLines = scaleLines, !xAxis) {const redColoredMaterial = new standardMaterial/* StandardMaterial */.K("", scene);redColoredMaterial.disableLighting = !0, redColoredMaterial.emissiveColor = math_color/* Color3.Red */.Wo.Red().scale(.5), xAxis = AxisDragGizmo._CreateArrow(scene, redColoredMaterial, lineThickness);}if (!yAxis) {const greenColoredMaterial = new standardMaterial/* StandardMaterial */.K("", scene);greenColoredMaterial.disableLighting = !0, greenColoredMaterial.emissiveColor = math_color/* Color3.Green */.Wo.Green().scale(.5), yAxis = AxisDragGizmo._CreateArrow(scene, greenColoredMaterial, lineThickness);}if (!zAxis) {const blueColoredMaterial = new standardMaterial/* StandardMaterial */.K("", scene);blueColoredMaterial.disableLighting = !0, blueColoredMaterial.emissiveColor = math_color/* Color3.Blue */.Wo.Blue().scale(.5), zAxis = AxisDragGizmo._CreateArrow(scene, blueColoredMaterial, lineThickness);}this._xAxis = xAxis, this._xAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._yAxis = yAxis, this._yAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._zAxis = zAxis, this._zAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), null != renderingGroupId && (AxesViewer._SetRenderingGroupId(this._xAxis, renderingGroupId), AxesViewer._SetRenderingGroupId(this._yAxis, renderingGroupId), AxesViewer._SetRenderingGroupId(this._zAxis, renderingGroupId)), this.scene = scene, this.update(new math_vector/* Vector3 */.P(), math_vector/* Vector3.Right */.P.Right(), math_vector/* Vector3.Up */.P.Up(), math_vector/* Vector3.Forward */.P.Forward());}}update(position, xaxis, yaxis, zaxis) {this._xAxis.position.copyFrom(position), this._xAxis.setDirection(xaxis), this._xAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._yAxis.position.copyFrom(position), this._yAxis.setDirection(yaxis), this._yAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._zAxis.position.copyFrom(position), this._zAxis.setDirection(zaxis), this._zAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor);}createInstance() {const xAxis = AxisDragGizmo._CreateArrowInstance(this.scene, this._xAxis),yAxis = AxisDragGizmo._CreateArrowInstance(this.scene, this._yAxis),zAxis = AxisDragGizmo._CreateArrowInstance(this.scene, this._zAxis),axesViewer = new AxesViewer(this.scene, this.scaleLines, null, xAxis, yAxis, zAxis);return axesViewer._instanced = !0, axesViewer;}dispose() {this._xAxis && this._xAxis.dispose(!1, !this._instanced), this._yAxis && this._yAxis.dispose(!1, !this._instanced), this._zAxis && this._zAxis.dispose(!1, !this._instanced), this.scene = null;}static _SetRenderingGroupId(node, id) {node.getChildMeshes().forEach((mesh) => {mesh.renderingGroupId = id;});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Debug/boneAxesViewer.js
class BoneAxesViewer extends AxesViewer {constructor(scene, bone, mesh, scaleLines = 1) {super(scene, scaleLines), this.pos = math_vector/* Vector3.Zero */.P.Zero(), this.xaxis = math_vector/* Vector3.Zero */.P.Zero(), this.yaxis = math_vector/* Vector3.Zero */.P.Zero(), this.zaxis = math_vector/* Vector3.Zero */.P.Zero(), this.mesh = mesh, this.bone = bone;}update() {if (this.mesh && this.bone) {const bone = this.bone;bone.getAbsolutePositionToRef(this.mesh, this.pos), bone.getDirectionToRef(math_axis/* Axis.X */.RD.X, this.mesh, this.xaxis), bone.getDirectionToRef(math_axis/* Axis.Y */.RD.Y, this.mesh, this.yaxis), bone.getDirectionToRef(math_axis/* Axis.Z */.RD.Z, this.mesh, this.zaxis), super.update(this.pos, this.xaxis, this.yaxis, this.zaxis);}}dispose() {this.mesh && (this.mesh = null, this.bone = null, super.dispose());}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Debug/debugLayer.js
Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "debugLayer", { get: function () {return this._debugLayer || (this._debugLayer = new DebugLayer(this)), this._debugLayer;}, enumerable: !0, configurable: !0 });var DebugLayerTab;(function (DebugLayerTab) {DebugLayerTab[DebugLayerTab.Properties = 0] = "Properties", DebugLayerTab[DebugLayerTab.Debug = 1] = "Debug", DebugLayerTab[DebugLayerTab.Statistics = 2] = "Statistics", DebugLayerTab[DebugLayerTab.Tools = 3] = "Tools", DebugLayerTab[DebugLayerTab.Settings = 4] = "Settings";})(DebugLayerTab || (DebugLayerTab = {}));class DebugLayer {get onPropertyChangedObservable() {return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector ? this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable : (this._onPropertyChangedObservable || (this._onPropertyChangedObservable = new observable/* Observable */.y$()), this._onPropertyChangedObservable);}get onSelectionChangedObservable() {return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector ? this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable : (this._onSelectionChangedObservable || (this._onSelectionChangedObservable = new observable/* Observable */.y$()), this._onSelectionChangedObservable);}constructor(scene) {this.BJSINSPECTOR = this._getGlobalInspector(), this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;this._scene && this._scene.onDisposeObservable.add(() => {this._scene._debugLayer && this._scene._debugLayer.hide();});}_createInspector(config) {if (!this.isVisible()) {if (this._onPropertyChangedObservable) {for (const observer of this._onPropertyChangedObservable.observers) this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(observer);this._onPropertyChangedObservable.clear(), this._onPropertyChangedObservable = void 0;}if (this._onSelectionChangedObservable) {for (const observer of this._onSelectionChangedObservable.observers) this.BJSINSPECTOR.Inspector.OnSelectionChangedObservable.add(observer);this._onSelectionChangedObservable.clear(), this._onSelectionChangedObservable = void 0;}const userOptions = { overlay: !1, showExplorer: !0, showInspector: !0, embedMode: !1, handleResize: !0, enablePopup: !0, ...config };this.BJSINSPECTOR = this.BJSINSPECTOR || this._getGlobalInspector(), this.BJSINSPECTOR.Inspector.Show(this._scene, userOptions);}}select(entity, lineContainerTitles) {this.BJSINSPECTOR && (lineContainerTitles && ("[object String]" == Object.prototype.toString.call(lineContainerTitles) ? this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(lineContainerTitles) : this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(lineContainerTitles)), this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(entity));}_getGlobalInspector() {return "undefined" == typeof INSPECTOR ? "undefined" != typeof BABYLON && "undefined" != typeof BABYLON.Inspector ? BABYLON : void 0 : INSPECTOR;}isVisible() {return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;}hide() {this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.Hide();}setAsActiveScene() {this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector._SetNewScene(this._scene);}show(config) {return new Promise((resolve) => {if ("undefined" == typeof this.BJSINSPECTOR) {const inspectorUrl = config && config.inspectorURL ? config.inspectorURL : DebugLayer.InspectorURL;tools/* Tools.LoadScript */.w1.LoadScript(inspectorUrl, () => {this._createInspector(config), resolve(this);});} else this._createInspector(config), resolve(this);});}}DebugLayer.InspectorURL = `https://unpkg.com/babylonjs-inspector@${engine/* Engine.Version */.D.Version}/babylon.inspector.bundle.js`;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/boxBuilder.js
function CreateBoxVertexData(options) {let indices = [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23];const normals = [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0],uvs = [];let positions = [];const width = options.width || options.size || 1,height = options.height || options.size || 1,depth = options.depth || options.size || 1,wrap = options.wrap || !1;let topBaseAt = void 0 === options.topBaseAt ? 1 : options.topBaseAt,bottomBaseAt = void 0 === options.bottomBaseAt ? 0 : options.bottomBaseAt;topBaseAt = (topBaseAt + 4) % 4, bottomBaseAt = (bottomBaseAt + 4) % 4;let topIndex = [2, 0, 3, 1][topBaseAt],bottomIndex = [2, 0, 1, 3][bottomBaseAt],basePositions = [1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1];if (wrap) {indices = [2, 3, 0, 2, 0, 1, 4, 5, 6, 4, 6, 7, 9, 10, 11, 9, 11, 8, 12, 14, 15, 12, 13, 14], basePositions = [-1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1];let topFaceBase = [[1, 1, 1], [-1, 1, 1], [-1, 1, -1], [1, 1, -1]],bottomFaceBase = [[-1, -1, 1], [1, -1, 1], [1, -1, -1], [-1, -1, -1]];const topFaceOrder = [17, 18, 19, 16],bottomFaceOrder = [22, 23, 20, 21];for (; 0 < topIndex;) topFaceBase.unshift(topFaceBase.pop()), topFaceOrder.unshift(topFaceOrder.pop()), topIndex--;for (; 0 < bottomIndex;) bottomFaceBase.unshift(bottomFaceBase.pop()), bottomFaceOrder.unshift(bottomFaceOrder.pop()), bottomIndex--;topFaceBase = topFaceBase.flat(), bottomFaceBase = bottomFaceBase.flat(), basePositions = basePositions.concat(topFaceBase).concat(bottomFaceBase), indices.push(topFaceOrder[0], topFaceOrder[2], topFaceOrder[3], topFaceOrder[0], topFaceOrder[1], topFaceOrder[2]), indices.push(bottomFaceOrder[0], bottomFaceOrder[2], bottomFaceOrder[3], bottomFaceOrder[0], bottomFaceOrder[1], bottomFaceOrder[2]);}const scaleArray = [width / 2, height / 2, depth / 2];positions = basePositions.reduce((accumulator, currentValue, currentIndex) => accumulator.concat(currentValue * scaleArray[currentIndex % 3]), []);const sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,faceUV = options.faceUV || [,,,,,,],faceColors = options.faceColors,colors = [];for (let f = 0; 6 > f; f++) void 0 === faceUV[f] && (faceUV[f] = new math_vector/* Vector4 */.Lt(0, 0, 1, 1)), faceColors && void 0 === faceColors[f] && (faceColors[f] = new math_color/* Color4 */.HE(1, 1, 1, 1));for (let index = 0; index < 6; index++) if (uvs.push(faceUV[index].z, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - faceUV[index].w : faceUV[index].w), uvs.push(faceUV[index].x, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - faceUV[index].w : faceUV[index].w), uvs.push(faceUV[index].x, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - faceUV[index].y : faceUV[index].y), uvs.push(faceUV[index].z, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - faceUV[index].y : faceUV[index].y), faceColors) for (let c = 0; 4 > c; c++) colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a);mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();if (vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, faceColors) {const totalColors = sideOrientation === mesh_vertexData/* VertexData.DOUBLESIDE */.x.DOUBLESIDE ? colors.concat(colors) : colors;vertexData.colors = totalColors;}return vertexData;}function CreateBox(name, options = {}, scene = null) {const box = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), box._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateBoxVertexData(options);return vertexData.applyToMesh(box, options.updatable), box;}const BoxBuilder = { CreateBox };mesh_vertexData/* VertexData.CreateBox */.x.CreateBox = CreateBoxVertexData, Meshes_mesh/* Mesh.CreateBox */.Kj.CreateBox = (name, size, scene = null, updatable, sideOrientation) => {return CreateBox(name, { size, sideOrientation, updatable }, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/sphereBuilder.js
function CreateSphereVertexData(options) {const segments = options.segments || 32,diameterX = options.diameterX || options.diameter || 1,diameterY = options.diameterY || options.diameter || 1,diameterZ = options.diameterZ || options.diameter || 1,arc = options.arc && (0 >= options.arc || 1 < options.arc) ? 1 : options.arc || 1,slice = options.slice && 0 >= options.slice ? 1 : options.slice || 1,sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,dedupTopBottomIndices = !!options.dedupTopBottomIndices,radius = new math_vector/* Vector3 */.P(diameterX / 2, diameterY / 2, diameterZ / 2),totalZRotationSteps = 2 + segments,totalYRotationSteps = 2 * totalZRotationSteps,indices = [],positions = [],normals = [],uvs = [];for (let zRotationStep = 0; zRotationStep <= totalZRotationSteps; zRotationStep++) {const normalizedZ = zRotationStep / totalZRotationSteps,angleZ = normalizedZ * Math.PI * slice;for (let yRotationStep = 0; yRotationStep <= totalYRotationSteps; yRotationStep++) {const normalizedY = yRotationStep / totalYRotationSteps,angleY = 2 * (normalizedY * Math.PI) * arc,rotationZ = math_vector/* Matrix.RotationZ */.y3.RotationZ(-angleZ),rotationY = math_vector/* Matrix.RotationY */.y3.RotationY(angleY),afterRotZ = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(math_vector/* Vector3.Up */.P.Up(), rotationZ),complete = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(afterRotZ, rotationY),vertex = complete.multiply(radius),normal = complete.divide(radius).normalize();positions.push(vertex.x, vertex.y, vertex.z), normals.push(normal.x, normal.y, normal.z), uvs.push(normalizedY, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - normalizedZ : normalizedZ);}if (0 < zRotationStep) {const verticesCount = positions.length / 3;for (let firstIndex = verticesCount - 2 * (totalYRotationSteps + 1); firstIndex + totalYRotationSteps + 2 < verticesCount; firstIndex++) dedupTopBottomIndices ? (1 < zRotationStep && (indices.push(firstIndex), indices.push(firstIndex + 1), indices.push(firstIndex + totalYRotationSteps + 1)), (zRotationStep < totalZRotationSteps || 1 > slice) && (indices.push(firstIndex + totalYRotationSteps + 1), indices.push(firstIndex + 1), indices.push(firstIndex + totalYRotationSteps + 2))) : (indices.push(firstIndex), indices.push(firstIndex + 1), indices.push(firstIndex + totalYRotationSteps + 1), indices.push(firstIndex + totalYRotationSteps + 1), indices.push(firstIndex + 1), indices.push(firstIndex + totalYRotationSteps + 2));}}mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreateSphere(name, options = {}, scene = null) {const sphere = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), sphere._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateSphereVertexData(options);return vertexData.applyToMesh(sphere, options.updatable), sphere;}const SphereBuilder = { CreateSphere };mesh_vertexData/* VertexData.CreateSphere */.x.CreateSphere = CreateSphereVertexData, Meshes_mesh/* Mesh.CreateSphere */.Kj.CreateSphere = (name, segments, diameter, scene, updatable, sideOrientation) => {return CreateSphere(name, { segments: segments, diameterX: diameter, diameterY: diameter, diameterZ: diameter, sideOrientation: sideOrientation, updatable: updatable }, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/capsuleBuilder.js
function CreateCapsuleVertexData(options = { subdivisions: 2, tessellation: 16, height: 1, radius: .25, capSubdivisions: 6 }) {const subdivisions = Math.max(options.subdivisions ? options.subdivisions : 2, 1),tessellation = Math.max(options.tessellation ? options.tessellation : 16, 3),height = Math.max(options.height ? options.height : 1, 0),radius = Math.max(options.radius ? options.radius : .25, 0),capDetail = Math.max(options.capSubdivisions ? options.capSubdivisions : 6, 1),radialSegments = tessellation,heightSegments = subdivisions,radiusTop = Math.max(options.radiusTop ? options.radiusTop : radius, 0),radiusBottom = Math.max(options.radiusBottom ? options.radiusBottom : radius, 0),thetaStart = 0,thetaLength = 2 * Math.PI,capsTopSegments = Math.max(options.topCapSubdivisions ? options.topCapSubdivisions : capDetail, 1),capsBottomSegments = Math.max(options.bottomCapSubdivisions ? options.bottomCapSubdivisions : capDetail, 1),alpha = Math.acos((radiusBottom - radiusTop) / height);let indices = [];const vertices = [],normals = [],uvs = [];let index = 0;const indexArray = [],halfHeight = .5 * (height - (radiusTop + radiusBottom)),pi2 = .5 * Math.PI;let x, y;const normal = math_vector/* Vector3.Zero */.P.Zero(),vertex = math_vector/* Vector3.Zero */.P.Zero(),cosAlpha = Math.cos(alpha),sinAlpha = Math.sin(alpha),coneLength = new math_vector/* Vector2 */.FM(radiusTop * sinAlpha, halfHeight + radiusTop * cosAlpha).subtract(new math_vector/* Vector2 */.FM(radiusBottom * sinAlpha, -halfHeight + radiusBottom * cosAlpha)).length(),vl = radiusTop * alpha + coneLength + radiusBottom * (pi2 - alpha);let v = 0;for (y = 0; y <= capsTopSegments; y++) {const indexRow = [],a = pi2 - alpha * (y / capsTopSegments);v += radiusTop * alpha / capsTopSegments;const cosA = Math.cos(a),sinA = Math.sin(a),_radius = cosA * radiusTop;for (x = 0; x <= radialSegments; x++) {const u = x / radialSegments,theta = u * thetaLength + thetaStart,sinTheta = Math.sin(theta),cosTheta = Math.cos(theta);vertex.x = _radius * sinTheta, vertex.y = halfHeight + sinA * radiusTop, vertex.z = _radius * cosTheta, vertices.push(vertex.x, vertex.y, vertex.z), normal.set(cosA * sinTheta, sinA, cosA * cosTheta), normals.push(normal.x, normal.y, normal.z), uvs.push(u, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? v / vl : 1 - v / vl), indexRow.push(index), index++;}indexArray.push(indexRow);}const coneHeight = height - radiusTop - radiusBottom + cosAlpha * radiusTop - cosAlpha * radiusBottom;for (y = 1; y <= heightSegments; y++) {const indexRow = [];v += coneLength / heightSegments;const _radius = sinAlpha * (y * (radiusBottom - radiusTop) / heightSegments + radiusTop);for (x = 0; x <= radialSegments; x++) {const u = x / radialSegments,theta = u * thetaLength + thetaStart,sinTheta = Math.sin(theta),cosTheta = Math.cos(theta);vertex.x = _radius * sinTheta, vertex.y = halfHeight + cosAlpha * radiusTop - y * coneHeight / heightSegments, vertex.z = _radius * cosTheta, vertices.push(vertex.x, vertex.y, vertex.z), normal.set(sinTheta, sinAlpha * (radiusBottom - radiusTop) / coneHeight, cosTheta).normalize(), normals.push(normal.x, normal.y, normal.z), uvs.push(u, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? v / vl : 1 - v / vl), indexRow.push(index), index++;}indexArray.push(indexRow);}for (y = 1; y <= capsBottomSegments; y++) {const indexRow = [],a = pi2 - alpha - (Math.PI - alpha) * (y / capsBottomSegments);v += radiusBottom * alpha / capsBottomSegments;const cosA = Math.cos(a),sinA = Math.sin(a),_radius = cosA * radiusBottom;for (x = 0; x <= radialSegments; x++) {const u = x / radialSegments,theta = u * thetaLength + thetaStart,sinTheta = Math.sin(theta),cosTheta = Math.cos(theta);vertex.x = _radius * sinTheta, vertex.y = -halfHeight + sinA * radiusBottom, vertex.z = _radius * cosTheta, vertices.push(vertex.x, vertex.y, vertex.z), normal.set(cosA * sinTheta, sinA, cosA * cosTheta), normals.push(normal.x, normal.y, normal.z), uvs.push(u, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? v / vl : 1 - v / vl), indexRow.push(index), index++;}indexArray.push(indexRow);}for (x = 0; x < radialSegments; x++) for (y = 0; y < capsTopSegments + heightSegments + capsBottomSegments; y++) {const i1 = indexArray[y][x],i2 = indexArray[y + 1][x],i3 = indexArray[y + 1][x + 1],i4 = indexArray[y][x + 1];indices.push(i1), indices.push(i2), indices.push(i4), indices.push(i2), indices.push(i3), indices.push(i4);}if (indices = indices.reverse(), options.orientation && !options.orientation.equals(math_vector/* Vector3.Up */.P.Up())) {const m = new math_vector/* Matrix */.y3();options.orientation.clone().scale(.5 * Math.PI).cross(math_vector/* Vector3.Up */.P.Up()).toQuaternion().toRotationMatrix(m);const v = math_vector/* Vector3.Zero */.P.Zero();for (let i = 0; i < vertices.length; i += 3) v.set(vertices[i], vertices[i + 1], vertices[i + 2]), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(v.clone(), m, v), vertices[i] = v.x, vertices[i + 1] = v.y, vertices[i + 2] = v.z;}const vDat = new mesh_vertexData/* VertexData */.x();return vDat.positions = vertices, vDat.normals = normals, vDat.uvs = uvs, vDat.indices = indices, vDat;}function CreateCapsule(name, options = { orientation: math_vector/* Vector3.Up */.P.Up(), subdivisions: 2, tessellation: 16, height: 1, radius: .25, capSubdivisions: 6, updatable: !1 }, scene = null) {const capsule = new Meshes_mesh/* Mesh */.Kj(name, scene),vertexData = CreateCapsuleVertexData(options);return vertexData.applyToMesh(capsule, options.updatable), capsule;}const CapsuleBuilder = { CreateCapsule };Meshes_mesh/* Mesh.CreateCapsule */.Kj.CreateCapsule = (name, options, scene) => CreateCapsule(name, options, scene), mesh_vertexData/* VertexData.CreateCapsule */.x.CreateCapsule = CreateCapsuleVertexData;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Debug/physicsViewer.js
class PhysicsViewer {constructor(scene) {if (this._impostors = [], this._meshes = [], this._bodies = [], this._bodyMeshes = [], this._numMeshes = 0, this._numBodies = 0, this._debugMeshMeshes = [], this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, !!this._scene) {const physicEngine = this._scene.getPhysicsEngine();physicEngine && (this._physicsEnginePlugin = physicEngine.getPhysicsPlugin()), this._utilityLayer = new UtilityLayerRenderer(this._scene, !1), this._utilityLayer.pickUtilitySceneFirst = !1, this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = !0;}}_updateDebugMeshes() {const plugin = this._physicsEnginePlugin;1 === (null === plugin || void 0 === plugin ? void 0 : plugin.getPluginVersion()) ? this._updateDebugMeshesV1() : this._updateDebugMeshesV2();}_updateDebugMeshesV1() {const plugin = this._physicsEnginePlugin;for (let i = 0; i < this._numMeshes; i++) {const impostor = this._impostors[i];if (impostor) if (impostor.isDisposed) this.hideImpostor(this._impostors[i--]);else {if (impostor.type === PhysicsImpostor.MeshImpostor) continue;const mesh = this._meshes[i];mesh && plugin && plugin.syncMeshWithImpostor(mesh, impostor);}}}_updateDebugMeshesV2() {const plugin = this._physicsEnginePlugin;for (let i = 0; i < this._numBodies; i++) {const body = this._bodies[i],transform = this._bodyMeshes[i];body && transform && plugin.syncTransform(body, transform);}}showImpostor(impostor, targetMesh) {if (!this._scene) return null;for (let i = 0; i < this._numMeshes; i++) if (this._impostors[i] == impostor) return null;const debugMesh = this._getDebugMesh(impostor, targetMesh);return debugMesh && (this._impostors[this._numMeshes] = impostor, this._meshes[this._numMeshes] = debugMesh, 0 === this._numMeshes && (this._renderFunction = this._updateDebugMeshes.bind(this), this._scene.registerBeforeRender(this._renderFunction)), this._numMeshes++), debugMesh;}showBody(body) {if (!this._scene) return null;for (let i = 0; i < this._numBodies; i++) if (this._bodies[i] == body) return null;const debugMesh = this._getDebugBodyMesh(body);return debugMesh && (this._bodies[this._numBodies] = body, this._bodyMeshes[this._numBodies] = debugMesh, 0 === this._numBodies && (this._renderFunction = this._updateDebugMeshes.bind(this), this._scene.registerBeforeRender(this._renderFunction)), this._numBodies++), debugMesh;}hideImpostor(impostor) {if (!impostor || !this._scene || !this._utilityLayer) return;let removed = !1;const utilityLayerScene = this._utilityLayer.utilityLayerScene;for (let i = 0; i < this._numMeshes; i++) if (this._impostors[i] == impostor) {const mesh = this._meshes[i];if (!mesh) continue;utilityLayerScene.removeMesh(mesh), mesh.dispose();const index = this._debugMeshMeshes.indexOf(mesh);-1 < index && this._debugMeshMeshes.splice(index, 1), this._numMeshes--, 0 < this._numMeshes ? (this._meshes[i] = this._meshes[this._numMeshes], this._impostors[i] = this._impostors[this._numMeshes], this._meshes[this._numMeshes] = null, this._impostors[this._numMeshes] = null) : (this._meshes[0] = null, this._impostors[0] = null), removed = !0;break;}removed && 0 === this._numMeshes && this._scene.unregisterBeforeRender(this._renderFunction);}hideBody(body) {if (!body || !this._scene || !this._utilityLayer) return;let removed = !1;const utilityLayerScene = this._utilityLayer.utilityLayerScene;for (let i = 0; i < this._numBodies; i++) if (this._bodies[i] === body) {const mesh = this._bodyMeshes[i];if (!mesh) continue;utilityLayerScene.removeMesh(mesh), mesh.dispose(), this._numBodies--, 0 < this._numBodies ? (this._bodyMeshes[i] = this._bodyMeshes[this._numBodies], this._bodies[i] = this._bodies[this._numBodies], this._bodyMeshes[this._numBodies] = null, this._bodies[this._numBodies] = null) : (this._bodyMeshes[0] = null, this._bodies[0] = null), removed = !0;break;}removed && 0 === this._numBodies && this._scene.unregisterBeforeRender(this._renderFunction);}_getDebugMaterial(scene) {return this._debugMaterial || (this._debugMaterial = new standardMaterial/* StandardMaterial */.K("", scene), this._debugMaterial.wireframe = !0, this._debugMaterial.emissiveColor = math_color/* Color3.White */.Wo.White(), this._debugMaterial.disableLighting = !0), this._debugMaterial;}_getDebugBoxMesh(scene) {return this._debugBoxMesh || (this._debugBoxMesh = CreateBox("physicsBodyBoxViewMesh", { size: 1 }, scene), this._debugBoxMesh.rotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this._debugBoxMesh.material = this._getDebugMaterial(scene), this._debugBoxMesh.setEnabled(!1)), this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance");}_getDebugSphereMesh(scene) {return this._debugSphereMesh || (this._debugSphereMesh = CreateSphere("physicsBodySphereViewMesh", { diameter: 1 }, scene), this._debugSphereMesh.rotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this._debugSphereMesh.material = this._getDebugMaterial(scene), this._debugSphereMesh.setEnabled(!1)), this._debugSphereMesh.createInstance("physicsBodySphereViewInstance");}_getDebugCapsuleMesh(scene) {return this._debugCapsuleMesh || (this._debugCapsuleMesh = CreateCapsule("physicsBodyCapsuleViewMesh", { height: 1 }, scene), this._debugCapsuleMesh.rotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this._debugCapsuleMesh.material = this._getDebugMaterial(scene), this._debugCapsuleMesh.setEnabled(!1)), this._debugCapsuleMesh.createInstance("physicsBodyCapsuleViewInstance");}_getDebugCylinderMesh(scene) {return this._debugCylinderMesh || (this._debugCylinderMesh = CreateCylinder("physicsBodyCylinderViewMesh", { diameterTop: 1, diameterBottom: 1, height: 1 }, scene), this._debugCylinderMesh.rotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this._debugCylinderMesh.material = this._getDebugMaterial(scene), this._debugCylinderMesh.setEnabled(!1)), this._debugCylinderMesh.createInstance("physicsBodyCylinderViewInstance");}_getDebugMeshMesh(mesh, scene) {const wireframeOver = new Meshes_mesh/* Mesh */.Kj(mesh.name, scene, null, mesh);return wireframeOver.setParent(mesh), wireframeOver.position = math_vector/* Vector3.Zero */.P.Zero(), wireframeOver.material = this._getDebugMaterial(scene), this._debugMeshMeshes.push(wireframeOver), wireframeOver;}_getDebugMesh(impostor, targetMesh) {if (!this._utilityLayer) return null;if (targetMesh && targetMesh.parent && targetMesh.parent.physicsImpostor) return null;let mesh = null;const utilityLayerScene = this._utilityLayer.utilityLayerScene;if (!impostor.physicsBody) return logger/* Logger.Warn */.Y.Warn("Unable to get physicsBody of impostor. It might be initialized later by its parent's impostor."), null;switch (impostor.type) {case PhysicsImpostor.BoxImpostor:mesh = this._getDebugBoxMesh(utilityLayerScene), impostor.getBoxSizeToRef(mesh.scaling);break;case PhysicsImpostor.SphereImpostor:{mesh = this._getDebugSphereMesh(utilityLayerScene);const radius = impostor.getRadius();mesh.scaling.x = 2 * radius, mesh.scaling.y = 2 * radius, mesh.scaling.z = 2 * radius;break;}case PhysicsImpostor.CapsuleImpostor:{mesh = this._getDebugCapsuleMesh(utilityLayerScene);const bi = impostor.object.getBoundingInfo();mesh.scaling.x = 2 * (bi.boundingBox.maximum.x - bi.boundingBox.minimum.x) * impostor.object.scaling.x, mesh.scaling.y = (bi.boundingBox.maximum.y - bi.boundingBox.minimum.y) * impostor.object.scaling.y, mesh.scaling.z = 2 * (bi.boundingBox.maximum.z - bi.boundingBox.minimum.z) * impostor.object.scaling.z;break;}case PhysicsImpostor.MeshImpostor:targetMesh && (mesh = this._getDebugMeshMesh(targetMesh, utilityLayerScene));break;case PhysicsImpostor.NoImpostor:if (targetMesh) {const childMeshes = targetMesh.getChildMeshes().filter((c) => c.physicsImpostor ? 1 : 0);childMeshes.forEach((m) => {if (m.physicsImpostor && "Mesh" === m.getClassName()) {const boundingInfo = m.getBoundingInfo(),min = boundingInfo.boundingBox.minimum,max = boundingInfo.boundingBox.maximum;switch (m.physicsImpostor.type) {case PhysicsImpostor.BoxImpostor:mesh = this._getDebugBoxMesh(utilityLayerScene), mesh.position.copyFrom(min), mesh.position.addInPlace(max), mesh.position.scaleInPlace(.5);break;case PhysicsImpostor.SphereImpostor:mesh = this._getDebugSphereMesh(utilityLayerScene);break;case PhysicsImpostor.CylinderImpostor:mesh = this._getDebugCylinderMesh(utilityLayerScene);break;default:mesh = null;}mesh && (mesh.scaling.x = max.x - min.x, mesh.scaling.y = max.y - min.y, mesh.scaling.z = max.z - min.z, mesh.parent = m);}});} else logger/* Logger.Warn */.Y.Warn("No target mesh parameter provided for NoImpostor. Skipping.");mesh = null;break;case PhysicsImpostor.CylinderImpostor:{mesh = this._getDebugCylinderMesh(utilityLayerScene);const bi = impostor.object.getBoundingInfo();mesh.scaling.x = (bi.boundingBox.maximum.x - bi.boundingBox.minimum.x) * impostor.object.scaling.x, mesh.scaling.y = (bi.boundingBox.maximum.y - bi.boundingBox.minimum.y) * impostor.object.scaling.y, mesh.scaling.z = (bi.boundingBox.maximum.z - bi.boundingBox.minimum.z) * impostor.object.scaling.z;break;}}return mesh;}_getDebugBodyMesh(body) {if (!this._utilityLayer) return null;const utilityLayerScene = this._utilityLayer.utilityLayerScene,mesh = new Meshes_mesh/* Mesh */.Kj("custom", utilityLayerScene),vertexData = new mesh_vertexData/* VertexData */.x(),geometry = body.getGeometry();return vertexData.positions = geometry.positions, vertexData.indices = geometry.indices, vertexData.applyToMesh(mesh), mesh.material = this._getDebugMaterial(utilityLayerScene), mesh;}dispose() {for (let index = this._numMeshes - 1; 0 <= index; index--) this.hideImpostor(this._impostors[0]);for (let index = this._numBodies - 1; 0 <= index; index--) this.hideBody(this._bodies[0]);this._debugBoxMesh && this._debugBoxMesh.dispose(), this._debugSphereMesh && this._debugSphereMesh.dispose(), this._debugCylinderMesh && this._debugCylinderMesh.dispose(), this._debugMaterial && this._debugMaterial.dispose(), this._impostors.length = 0, this._scene = null, this._physicsEnginePlugin = null, this._utilityLayer && (this._utilityLayer.dispose(), this._utilityLayer = null);}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/instancedMesh.js
var instancedMesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/instancedMesh.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/shaderMaterial.js
var shaderMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/shaderMaterial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/color.fragment.js
const color_fragment_name = "colorPixelShader",color_fragment_shader = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
#define VERTEXCOLOR
varying vec4 vColor;
#else
uniform vec4 color;
#endif
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
gl_FragColor=vColor;
#else
gl_FragColor=color;
#endif
#define CUSTOM_FRAGMENT_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.colorPixelShader */.v.ShadersStore.colorPixelShader = color_fragment_shader;const colorPixelShader = { name: "colorPixelShader", shader: color_fragment_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js
var vertexColorMixing = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/color.vertex.js
const color_vertex_name = "colorVertexShader",color_vertex_shader = `attribute vec3 position;
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {
gl_Position=viewProjection*worldPos;
} else {
gl_Position=viewProjectionR*worldPos;
}
#else
gl_Position=viewProjection*worldPos;
#endif
#include<clipPlaneVertex>
#include<vertexColorMixing>
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.colorVertexShader */.v.ShadersStore.colorVertexShader = color_vertex_shader;const colorVertexShader = { name: "colorVertexShader", shader: color_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/linesMesh.js
Meshes_mesh/* Mesh._LinesMeshParser */.Kj._LinesMeshParser = (parsedMesh, scene) => LinesMesh.Parse(parsedMesh, scene);class LinesMesh extends Meshes_mesh/* Mesh */.Kj {_isShaderMaterial(shader) {return "ShaderMaterial" === shader.getClassName();}constructor(name, scene = null, parent = null, source = null, doNotCloneChildren, useVertexColor, useVertexAlpha, material) {super(name, scene, parent, source, doNotCloneChildren), this.useVertexColor = useVertexColor, this.useVertexAlpha = useVertexAlpha, this.color = new math_color/* Color3 */.Wo(1, 1, 1), this.alpha = 1, source && (this.color = source.color.clone(), this.alpha = source.alpha, this.useVertexColor = source.useVertexColor, this.useVertexAlpha = source.useVertexAlpha), this.intersectionThreshold = .1;const options = { attributes: [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], uniforms: ["world", "viewProjection"], needAlphaBlending: !0, defines: [], useClipPlane: null };!1 === useVertexAlpha ? options.needAlphaBlending = !1 : options.defines.push("#define VERTEXALPHA"), useVertexColor ? (options.defines.push("#define VERTEXCOLOR"), options.attributes.push(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind)) : (options.uniforms.push("color"), this._color4 = new math_color/* Color4 */.HE()), material ? this.material = material : (this.material = new shaderMaterial/* ShaderMaterial */.j("colorShader", this.getScene(), "color", options, !1), this.material.doNotSerialize = !0);}isReady() {return !!this._lineMaterial.isReady(this, !!this._userInstancedBuffersStorage) && super.isReady();}getClassName() {return "LinesMesh";}get material() {return this._lineMaterial;}set material(value) {this._lineMaterial = value, this._lineMaterial.fillMode = Materials_material/* Material.LineListDrawMode */.F.LineListDrawMode;}get checkCollisions() {return !1;}set checkCollisions(value) {}_bind(_subMesh, colorEffect) {if (!this._geometry) return this;const indexToBind = this.isUnIndexed ? null : this._geometry.getIndexBuffer();if (this._userInstancedBuffersStorage ? this._geometry._bind(colorEffect, indexToBind, this._userInstancedBuffersStorage.vertexBuffers, this._userInstancedBuffersStorage.vertexArrayObjects) : this._geometry._bind(colorEffect, indexToBind), !this.useVertexColor && this._isShaderMaterial(this._lineMaterial)) {const { r, g, b } = this.color;this._color4.set(r, g, b, this.alpha), this._lineMaterial.setColor4("color", this._color4);}return this;}_draw(subMesh, fillMode, instancesCount) {if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer()) return this;const engine = this.getScene().getEngine();return this._unIndexed ? engine.drawArraysType(Materials_material/* Material.LineListDrawMode */.F.LineListDrawMode, subMesh.verticesStart, subMesh.verticesCount, instancesCount) : engine.drawElementsType(Materials_material/* Material.LineListDrawMode */.F.LineListDrawMode, subMesh.indexStart, subMesh.indexCount, instancesCount), this;}dispose(doNotRecurse, disposeMaterialAndTextures = !1, doNotDisposeMaterial) {doNotDisposeMaterial || this._lineMaterial.dispose(!1, !1, !0), super.dispose(doNotRecurse);}clone(name, newParent = null, doNotCloneChildren) {return new LinesMesh(name, this.getScene(), newParent, this, doNotCloneChildren);}createInstance(name) {const instance = new InstancedLinesMesh(name, this);if (this.instancedBuffers) for (const key in instance.instancedBuffers = {}, this.instancedBuffers) instance.instancedBuffers[key] = this.instancedBuffers[key];return instance;}serialize(serializationObject) {super.serialize(serializationObject), serializationObject.color = this.color.asArray(), serializationObject.alpha = this.alpha;}static Parse(parsedMesh, scene) {const result = new LinesMesh(parsedMesh.name, scene);return result.color = math_color/* Color3.FromArray */.Wo.FromArray(parsedMesh.color), result.alpha = parsedMesh.alpha, result;}}class InstancedLinesMesh extends instancedMesh/* InstancedMesh */.S {constructor(name, source) {super(name, source), this.intersectionThreshold = source.intersectionThreshold;}getClassName() {return "InstancedLinesMesh";}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/linesBuilder.js
function CreateLineSystemVertexData(options) {const indices = [],positions = [],lines = options.lines,colors = options.colors,vertexColors = [];let idx = 0;for (let l = 0; l < lines.length; l++) {const points = lines[l];for (let index = 0; index < points.length; index++) {if (positions.push(points[index].x, points[index].y, points[index].z), colors) {const color = colors[l];vertexColors.push(color[index].r, color[index].g, color[index].b, color[index].a);}0 < index && (indices.push(idx - 1), indices.push(idx)), idx++;}}const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, colors && (vertexData.colors = vertexColors), vertexData;}function CreateDashedLinesVertexData(options) {const dashSize = options.dashSize || 3,gapSize = options.gapSize || 1,dashNb = options.dashNb || 200,points = options.points,positions = [],indices = [],curvect = math_vector/* Vector3.Zero */.P.Zero();let lg = 0,nb = 0,shft = 0,dashshft = 0,curshft = 0,idx = 0,i = 0;for (i = 0; i < points.length - 1; i++) points[i + 1].subtractToRef(points[i], curvect), lg += curvect.length();for (shft = lg / dashNb, dashshft = dashSize * shft / (dashSize + gapSize), i = 0; i < points.length - 1; i++) {points[i + 1].subtractToRef(points[i], curvect), nb = Math.floor(curvect.length() / shft), curvect.normalize();for (let j = 0; j < nb; j++) curshft = shft * j, positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z), positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z), indices.push(idx, idx + 1), idx += 2;}const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.positions = positions, vertexData.indices = indices, vertexData;}function CreateLineSystem(name, options, scene) {const instance = options.instance,lines = options.lines,colors = options.colors;if (instance) {const positions = instance.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);let vertexColor, lineColors;colors && (vertexColor = instance.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind));let i = 0,c = 0;for (let l = 0; l < lines.length; l++) {const points = lines[l];for (let p = 0; p < points.length; p++) positions[i] = points[p].x, positions[i + 1] = points[p].y, positions[i + 2] = points[p].z, colors && vertexColor && (lineColors = colors[l], vertexColor[c] = lineColors[p].r, vertexColor[c + 1] = lineColors[p].g, vertexColor[c + 2] = lineColors[p].b, vertexColor[c + 3] = lineColors[p].a, c += 4), i += 3;}return instance.updateVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, positions, !1, !1), colors && vertexColor && instance.updateVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, vertexColor, !1, !1), instance;}const lineSystem = new LinesMesh(name, scene, null, void 0, void 0, !!colors, options.useVertexAlpha, options.material),vertexData = CreateLineSystemVertexData(options);return vertexData.applyToMesh(lineSystem, options.updatable), lineSystem;}function CreateLines(name, options, scene = null) {const colors = options.colors ? [options.colors] : null,lines = CreateLineSystem(name, { lines: [options.points], updatable: options.updatable, instance: options.instance, colors: colors, useVertexAlpha: options.useVertexAlpha, material: options.material }, scene);return lines;}function CreateDashedLines(name, options, scene = null) {const points = options.points,instance = options.instance,gapSize = options.gapSize || 1,dashSize = options.dashSize || 3;if (instance) {return (options.dashNb || options.dashSize || options.gapSize || options.useVertexAlpha || options.material) && logger/* Logger.Warn */.Y.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored."), instance.updateMeshPositions((positions) => {const curvect = math_vector/* Vector3.Zero */.P.Zero(),nbSeg = positions.length / 6;let lg = 0,nb = 0,shft = 0,dashshft = 0,curshft = 0,p = 0,i = 0,j = 0;for (i = 0; i < points.length - 1; i++) points[i + 1].subtractToRef(points[i], curvect), lg += curvect.length();shft = lg / nbSeg;const dashSize = instance._creationDataStorage.dashSize,gapSize = instance._creationDataStorage.gapSize;for (dashshft = dashSize * shft / (dashSize + gapSize), i = 0; i < points.length - 1; i++) for (points[i + 1].subtractToRef(points[i], curvect), nb = Math.floor(curvect.length() / shft), curvect.normalize(), j = 0; j < nb && p < positions.length;) curshft = shft * j, positions[p] = points[i].x + curshft * curvect.x, positions[p + 1] = points[i].y + curshft * curvect.y, positions[p + 2] = points[i].z + curshft * curvect.z, positions[p + 3] = points[i].x + (curshft + dashshft) * curvect.x, positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y, positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z, p += 6, j++;for (; p < positions.length;) positions[p] = points[i].x, positions[p + 1] = points[i].y, positions[p + 2] = points[i].z, p += 3;}, !1), instance;}const dashedLines = new LinesMesh(name, scene, null, void 0, void 0, void 0, options.useVertexAlpha, options.material),vertexData = CreateDashedLinesVertexData(options);return vertexData.applyToMesh(dashedLines, options.updatable), dashedLines._creationDataStorage = new Meshes_mesh/* _CreationDataStorage */.gW(), dashedLines._creationDataStorage.dashSize = dashSize, dashedLines._creationDataStorage.gapSize = gapSize, dashedLines;}const LinesBuilder = { CreateDashedLines, CreateLineSystem, CreateLines };mesh_vertexData/* VertexData.CreateLineSystem */.x.CreateLineSystem = CreateLineSystemVertexData, mesh_vertexData/* VertexData.CreateDashedLines */.x.CreateDashedLines = CreateDashedLinesVertexData, Meshes_mesh/* Mesh.CreateLines */.Kj.CreateLines = (name, points, scene = null, updatable = !1, instance = null) => {return CreateLines(name, { points, updatable, instance }, scene);}, Meshes_mesh/* Mesh.CreateDashedLines */.Kj.CreateDashedLines = (name, points, dashSize, gapSize, dashNb, scene = null, updatable, instance) => {return CreateDashedLines(name, { points, dashSize, gapSize, dashNb, updatable, instance }, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Debug/rayHelper.js
class RayHelper {static CreateAndShow(ray, scene, color) {const helper = new RayHelper(ray);return helper.show(scene, color), helper;}constructor(ray) {this.ray = ray;}show(scene, color) {if (!this._renderFunction && this.ray) {const ray = this.ray;this._renderFunction = this._render.bind(this), this._scene = scene, this._renderPoints = [ray.origin, ray.origin.add(ray.direction.scale(ray.length))], this._renderLine = CreateLines("ray", { points: this._renderPoints, updatable: !0 }, scene), this._renderLine.isPickable = !1, this._renderFunction && this._scene.registerBeforeRender(this._renderFunction);}color && this._renderLine && this._renderLine.color.copyFrom(color);}hide() {this._renderFunction && this._scene && (this._scene.unregisterBeforeRender(this._renderFunction), this._scene = null, this._renderFunction = null, this._renderLine && (this._renderLine.dispose(), this._renderLine = null), this._renderPoints = []);}_render() {var _a;const ray = this.ray;if (!ray) return;const point = this._renderPoints[1],len = Math.min(ray.length, 1e6);point.copyFrom(ray.direction), point.scaleInPlace(len), point.addInPlace(ray.origin), this._renderPoints[0].copyFrom(ray.origin), CreateLines("ray", { points: this._renderPoints, updatable: !0, instance: this._renderLine }, this._scene), null === (_a = this._renderLine) || void 0 === _a ? void 0 : _a.refreshBoundingInfo();}attachToMesh(mesh, meshSpaceDirection, meshSpaceOrigin, length) {this._attachedToMesh = mesh;const ray = this.ray;ray && (!ray.direction && (ray.direction = math_vector/* Vector3.Zero */.P.Zero()), !ray.origin && (ray.origin = math_vector/* Vector3.Zero */.P.Zero()), length && (ray.length = length), !meshSpaceOrigin && (meshSpaceOrigin = math_vector/* Vector3.Zero */.P.Zero()), !meshSpaceDirection && (meshSpaceDirection = new math_vector/* Vector3 */.P(0, 0, -1)), !this._scene && (this._scene = mesh.getScene()), this._meshSpaceDirection ? (this._meshSpaceDirection.copyFrom(meshSpaceDirection), this._meshSpaceOrigin.copyFrom(meshSpaceOrigin)) : (this._meshSpaceDirection = meshSpaceDirection.clone(), this._meshSpaceOrigin = meshSpaceOrigin.clone()), !this._onAfterRenderObserver && (this._onAfterRenderObserver = this._scene.onBeforeRenderObservable.add(() => this._updateToMesh()), this._onAfterStepObserver = this._scene.onAfterStepObservable.add(() => this._updateToMesh())), this._attachedToMesh.computeWorldMatrix(!0), this._updateToMesh());}detachFromMesh() {this._attachedToMesh && this._scene && (this._onAfterRenderObserver && (this._scene.onBeforeRenderObservable.remove(this._onAfterRenderObserver), this._scene.onAfterStepObservable.remove(this._onAfterStepObserver)), this._attachedToMesh = null, this._onAfterRenderObserver = null, this._onAfterStepObserver = null, this._scene = null);}_updateToMesh() {const ray = this.ray;return this._attachedToMesh && ray ? this._attachedToMesh.isDisposed() ? void this.detachFromMesh() : void (this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection, ray.direction), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._meshSpaceOrigin, this._attachedToMesh.getWorldMatrix(), ray.origin)) : void 0;}dispose() {this.hide(), this.detachFromMesh(), this.ray = null;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/ribbonBuilder.js
function CreateRibbonVertexData(options) {let pathArray = options.pathArray;const closeArray = options.closeArray || !1,closePath = options.closePath || !1,invertUV = options.invertUV || !1,defaultOffset = Math.floor(pathArray[0].length / 2);let offset = options.offset || defaultOffset;offset = offset > defaultOffset ? defaultOffset : Math.floor(offset);const sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,customUV = options.uvs,customColors = options.colors,positions = [],indices = [],normals = [],uvs = [],us = [],vs = [],uTotalDistance = [],vTotalDistance = [];let minlg;const lg = [],idx = [];let p, i, j;if (2 > pathArray.length) {const ar1 = [],ar2 = [];for (i = 0; i < pathArray[0].length - offset; i++) ar1.push(pathArray[0][i]), ar2.push(pathArray[0][i + offset]);pathArray = [ar1, ar2];}let idc = 0;const closePathCorr = closePath ? 1 : 0;let path, l;minlg = pathArray[0].length;let vectlg, dist;for (p = 0; p < pathArray.length; p++) {for (uTotalDistance[p] = 0, us[p] = [0], path = pathArray[p], l = path.length, minlg = minlg < l ? minlg : l, j = 0; j < l;) positions.push(path[j].x, path[j].y, path[j].z), 0 < j && (vectlg = path[j].subtract(path[j - 1]).length(), dist = vectlg + uTotalDistance[p], us[p].push(dist), uTotalDistance[p] = dist), j++;closePath && (j--, positions.push(path[0].x, path[0].y, path[0].z), vectlg = path[j].subtract(path[0]).length(), dist = vectlg + uTotalDistance[p], us[p].push(dist), uTotalDistance[p] = dist), lg[p] = l + closePathCorr, idx[p] = idc, idc += l + closePathCorr;}let path1,path2,vertex1 = null,vertex2 = null;for (i = 0; i < minlg + closePathCorr; i++) {for (vTotalDistance[i] = 0, vs[i] = [0], p = 0; p < pathArray.length - 1; p++) path1 = pathArray[p], path2 = pathArray[p + 1], i === minlg ? (vertex1 = path1[0], vertex2 = path2[0]) : (vertex1 = path1[i], vertex2 = path2[i]), vectlg = vertex2.subtract(vertex1).length(), dist = vectlg + vTotalDistance[i], vs[i].push(dist), vTotalDistance[i] = dist;closeArray && vertex2 && vertex1 && (path1 = pathArray[p], path2 = pathArray[0], i === minlg && (vertex2 = path2[0]), vectlg = vertex2.subtract(vertex1).length(), dist = vectlg + vTotalDistance[i], vTotalDistance[i] = dist);}let u, v;if (customUV) for (p = 0; p < customUV.length; p++) uvs.push(customUV[p].x, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - customUV[p].y : customUV[p].y);else for (p = 0; p < pathArray.length; p++) for (i = 0; i < minlg + closePathCorr; i++) u = 0 == uTotalDistance[p] ? 0 : us[p][i] / uTotalDistance[p], v = 0 == vTotalDistance[i] ? 0 : vs[i][p] / vTotalDistance[i], invertUV ? uvs.push(v, u) : uvs.push(u, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v);p = 0;let pi = 0,l1 = lg[p] - 1,l2 = lg[p + 1] - 1,min = l1 < l2 ? l1 : l2,shft = idx[1] - idx[0];for (const path1nb = closeArray ? lg.length : lg.length - 1; pi <= min && p < path1nb;) indices.push(pi, pi + shft, pi + 1), indices.push(pi + shft + 1, pi + 1, pi + shft), pi += 1, pi === min && (p++, p === lg.length - 1 ? (shft = idx[0] - idx[p], l1 = lg[p] - 1, l2 = lg[0] - 1) : (shft = idx[p + 1] - idx[p], l1 = lg[p] - 1, l2 = lg[p + 1] - 1), pi = idx[p], min = l1 < l2 ? l1 + pi : l2 + pi);if (mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(positions, indices, normals), closePath) {let indexFirst = 0,indexLast = 0;for (p = 0; p < pathArray.length; p++) indexFirst = 3 * idx[p], indexLast = p + 1 < pathArray.length ? 3 * (idx[p + 1] - 1) : normals.length - 3, normals[indexFirst] = .5 * (normals[indexFirst] + normals[indexLast]), normals[indexFirst + 1] = .5 * (normals[indexFirst + 1] + normals[indexLast + 1]), normals[indexFirst + 2] = .5 * (normals[indexFirst + 2] + normals[indexLast + 2]), normals[indexLast] = normals[indexFirst], normals[indexLast + 1] = normals[indexFirst + 1], normals[indexLast + 2] = normals[indexFirst + 2];}mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);let colors = null;if (customColors) {colors = new Float32Array(4 * customColors.length);for (let c = 0; c < customColors.length; c++) colors[4 * c] = customColors[c].r, colors[4 * c + 1] = customColors[c].g, colors[4 * c + 2] = customColors[c].b, colors[4 * c + 3] = customColors[c].a;}const vertexData = new mesh_vertexData/* VertexData */.x(),positions32 = new Float32Array(positions),normals32 = new Float32Array(normals),uvs32 = new Float32Array(uvs);return vertexData.indices = indices, vertexData.positions = positions32, vertexData.normals = normals32, vertexData.uvs = uvs32, colors && vertexData.set(colors, Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind), closePath && (vertexData._idx = idx), vertexData;}function CreateRibbon(name, options, scene = null) {const pathArray = options.pathArray,closeArray = options.closeArray,closePath = options.closePath,sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation),instance = options.instance,updatable = options.updatable;if (instance) {const minimum = math_vector/* TmpVectors.Vector3.0.setAll */.jp.Vector3[0].setAll(Number.MAX_VALUE),maximum = math_vector/* TmpVectors.Vector3.1.setAll */.jp.Vector3[1].setAll(-Number.MAX_VALUE),positions = instance.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);if (((positions) => {let minlg = pathArray[0].length;const mesh = instance;let i = 0;const ns = mesh._originalBuilderSideOrientation === Meshes_mesh/* Mesh.DOUBLESIDE */.Kj.DOUBLESIDE ? 2 : 1;for (let si = 1; si <= ns; ++si) for (let p = 0; p < pathArray.length; ++p) {const path = pathArray[p],l = path.length;minlg = minlg < l ? minlg : l;for (let j = 0; j < minlg; ++j) {const pathPoint = path[j];positions[i] = pathPoint.x, positions[i + 1] = pathPoint.y, positions[i + 2] = pathPoint.z, minimum.minimizeInPlaceFromFloats(pathPoint.x, pathPoint.y, pathPoint.z), maximum.maximizeInPlaceFromFloats(pathPoint.x, pathPoint.y, pathPoint.z), i += 3;}if (mesh._creationDataStorage && mesh._creationDataStorage.closePath) {const pathPoint = path[0];positions[i] = pathPoint.x, positions[i + 1] = pathPoint.y, positions[i + 2] = pathPoint.z, i += 3;}}})(positions), instance.hasBoundingInfo ? instance.getBoundingInfo().reConstruct(minimum, maximum, instance._worldMatrix) : instance.buildBoundingInfo(minimum, maximum, instance._worldMatrix), instance.updateVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, positions, !1, !1), options.colors) {const colors = instance.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind);for (let c = 0, colorIndex = 0; c < options.colors.length; c++, colorIndex += 4) {const color = options.colors[c];colors[colorIndex] = color.r, colors[colorIndex + 1] = color.g, colors[colorIndex + 2] = color.b, colors[colorIndex + 3] = color.a;}instance.updateVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, colors, !1, !1);}if (options.uvs) {const uvs = instance.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind);for (let i = 0; i < options.uvs.length; i++) uvs[2 * i] = options.uvs[i].x, uvs[2 * i + 1] = compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - options.uvs[i].y : options.uvs[i].y;instance.updateVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, uvs, !1, !1);}if (!instance.areNormalsFrozen || instance.isFacetDataEnabled) {const indices = instance.getIndices(),normals = instance.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind),params = instance.isFacetDataEnabled ? instance.getFacetDataParameters() : null;if (mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(positions, indices, normals, params), instance._creationDataStorage && instance._creationDataStorage.closePath) {let indexFirst = 0,indexLast = 0;for (let p = 0; p < pathArray.length; p++) indexFirst = 3 * instance._creationDataStorage.idx[p], indexLast = p + 1 < pathArray.length ? 3 * (instance._creationDataStorage.idx[p + 1] - 1) : normals.length - 3, normals[indexFirst] = .5 * (normals[indexFirst] + normals[indexLast]), normals[indexFirst + 1] = .5 * (normals[indexFirst + 1] + normals[indexLast + 1]), normals[indexFirst + 2] = .5 * (normals[indexFirst + 2] + normals[indexLast + 2]), normals[indexLast] = normals[indexFirst], normals[indexLast + 1] = normals[indexFirst + 1], normals[indexLast + 2] = normals[indexFirst + 2];}instance.areNormalsFrozen || instance.updateVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, normals, !1, !1);}return instance;} else {const ribbon = new Meshes_mesh/* Mesh */.Kj(name, scene);ribbon._originalBuilderSideOrientation = sideOrientation, ribbon._creationDataStorage = new Meshes_mesh/* _CreationDataStorage */.gW();const vertexData = CreateRibbonVertexData(options);return closePath && (ribbon._creationDataStorage.idx = vertexData._idx), ribbon._creationDataStorage.closePath = closePath, ribbon._creationDataStorage.closeArray = closeArray, vertexData.applyToMesh(ribbon, updatable), ribbon;}}const RibbonBuilder = { CreateRibbon };mesh_vertexData/* VertexData.CreateRibbon */.x.CreateRibbon = CreateRibbonVertexData, Meshes_mesh/* Mesh.CreateRibbon */.Kj.CreateRibbon = (name, pathArray, closeArray = !1, closePath, offset, scene, updatable = !1, sideOrientation, instance) => CreateRibbon(name, { pathArray: pathArray, closeArray: closeArray, closePath: closePath, offset: offset, updatable: updatable, sideOrientation: sideOrientation, instance: instance }, scene);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/shapeBuilder.js
function ExtrudeShape(name, options, scene = null) {const path = options.path,shape = options.shape,scale = options.scale || 1,rotation = options.rotation || 0,cap = 0 === options.cap ? 0 : options.cap || Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP,updatable = options.updatable,sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation),instance = options.instance || null,invertUV = options.invertUV || !1,closeShape = options.closeShape || !1,closePath = options.closePath || !1;return _ExtrudeShapeGeneric(name, shape, path, scale, rotation, null, null, closePath, closeShape, cap, !1, scene, !!updatable, sideOrientation, instance, invertUV, options.frontUVs || null, options.backUVs || null, options.firstNormal || null, !!options.adjustFrame);}function ExtrudeShapeCustom(name, options, scene = null) {const path = options.path,shape = options.shape,scaleFunction = options.scaleFunction || (() => 1),rotationFunction = options.rotationFunction || (() => 0),ribbonCloseArray = options.closePath || options.ribbonCloseArray || !1,ribbonClosePath = options.closeShape || options.ribbonClosePath || !1,cap = 0 === options.cap ? 0 : options.cap || Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP,updatable = options.updatable,firstNormal = options.firstNormal || null,adjustFrame = options.adjustFrame || !1,sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation),instance = options.instance,invertUV = options.invertUV || !1;return _ExtrudeShapeGeneric(name, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, !0, scene, !!updatable, sideOrientation, instance || null, invertUV, options.frontUVs || null, options.backUVs || null, firstNormal, adjustFrame);}function _ExtrudeShapeGeneric(name, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene, updtbl, side, instance, invertUV, frontUVs, backUVs, firstNormal, adjustFrame) {const extrusionPathArray = (shape, curve, path3D, shapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom, adjustFrame) => {const tangents = path3D.getTangents(),normals = path3D.getNormals(),binormals = path3D.getBinormals(),distances = path3D.getDistances();if (adjustFrame) for (let i = 0; i < tangents.length; i++) if (0 == tangents[i].x && 0 == tangents[i].y && 0 == tangents[i].z && tangents[i].copyFrom(tangents[i - 1]), 0 == normals[i].x && 0 == normals[i].y && 0 == normals[i].z && normals[i].copyFrom(normals[i - 1]), 0 == binormals[i].x && 0 == binormals[i].y && 0 == binormals[i].z && binormals[i].copyFrom(binormals[i - 1]), 0 < i) {let v = tangents[i - 1];0 > math_vector/* Vector3.Dot */.P.Dot(v, tangents[i]) && tangents[i].scaleInPlace(-1), v = normals[i - 1], 0 > math_vector/* Vector3.Dot */.P.Dot(v, normals[i]) && normals[i].scaleInPlace(-1), v = binormals[i - 1], 0 > math_vector/* Vector3.Dot */.P.Dot(v, binormals[i]) && binormals[i].scaleInPlace(-1);}let angle = 0;const rotate = custom && rotateFunction ? rotateFunction : () => null === rotation ? 0 : rotation,scl = custom && scaleFunction ? scaleFunction : () => null === scale ? 1 : scale;let index = cap === Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP || cap === Meshes_mesh/* Mesh.CAP_END */.Kj.CAP_END ? 0 : 2;const rotationMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];for (let i = 0; i < curve.length; i++) {const shapePath = [],angleStep = rotate(i, distances[i]),scaleRatio = scl(i, distances[i]);math_vector/* Matrix.RotationAxisToRef */.y3.RotationAxisToRef(tangents[i], angle, rotationMatrix);for (let p = 0; p < shape.length; p++) {const planed = tangents[i].scale(shape[p].z).add(normals[i].scale(shape[p].x)).add(binormals[i].scale(shape[p].y)),rotated = math_vector/* Vector3.Zero */.P.Zero();math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(planed, rotationMatrix, rotated), rotated.scaleInPlace(scaleRatio).addInPlace(curve[i]), shapePath[p] = rotated;}shapePaths[index] = shapePath, angle += angleStep, index++;}const capPath = (shapePath) => {const pointCap = [],barycenter = math_vector/* Vector3.Zero */.P.Zero();let i;for (i = 0; i < shapePath.length; i++) barycenter.addInPlace(shapePath[i]);for (barycenter.scaleInPlace(1 / shapePath.length), i = 0; i < shapePath.length; i++) pointCap.push(barycenter);return pointCap;};switch (cap) {case Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP:break;case Meshes_mesh/* Mesh.CAP_START */.Kj.CAP_START:shapePaths[0] = capPath(shapePaths[2]), shapePaths[1] = shapePaths[2];break;case Meshes_mesh/* Mesh.CAP_END */.Kj.CAP_END:shapePaths[index] = shapePaths[index - 1], shapePaths[index + 1] = capPath(shapePaths[index - 1]);break;case Meshes_mesh/* Mesh.CAP_ALL */.Kj.CAP_ALL:shapePaths[0] = capPath(shapePaths[2]), shapePaths[1] = shapePaths[2], shapePaths[index] = shapePaths[index - 1], shapePaths[index + 1] = capPath(shapePaths[index - 1]);break;default:}return shapePaths;};let path3D, pathArray;if (instance) {const storage = instance._creationDataStorage;return path3D = firstNormal ? storage.path3D.update(curve, firstNormal) : storage.path3D.update(curve), pathArray = extrusionPathArray(shape, curve, storage.path3D, storage.pathArray, scale, rotation, scaleFunction, rotateFunction, storage.cap, custom, adjustFrame), instance = CreateRibbon("", { pathArray, closeArray: !1, closePath: !1, offset: 0, updatable: !1, sideOrientation: 0, instance }, scene || void 0), instance;}path3D = firstNormal ? new math_path/* Path3D */.$B(curve, firstNormal) : new math_path/* Path3D */.$B(curve);cap = 0 > cap || 3 < cap ? 0 : cap, pathArray = extrusionPathArray(shape, curve, path3D, [], scale, rotation, scaleFunction, rotateFunction, cap, custom, adjustFrame);const extrudedGeneric = CreateRibbon(name, { pathArray: pathArray, closeArray: rbCA, closePath: rbCP, updatable: updtbl, sideOrientation: side, invertUV: invertUV, frontUVs: frontUVs || void 0, backUVs: backUVs || void 0 }, scene);return extrudedGeneric._creationDataStorage.pathArray = pathArray, extrudedGeneric._creationDataStorage.path3D = path3D, extrudedGeneric._creationDataStorage.cap = cap, extrudedGeneric;}const ShapeBuilder = { ExtrudeShape, ExtrudeShapeCustom };Meshes_mesh/* Mesh.ExtrudeShape */.Kj.ExtrudeShape = (name, shape, path, scale, rotation, cap, scene = null, updatable, sideOrientation, instance) => {const options = { shape: shape, path: path, scale: scale, rotation: rotation, cap: 0 === cap ? 0 : cap || Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP, sideOrientation: sideOrientation, instance: instance, updatable: updatable };return ExtrudeShape(name, options, scene);}, Meshes_mesh/* Mesh.ExtrudeShapeCustom */.Kj.ExtrudeShapeCustom = (name, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene, updatable, sideOrientation, instance) => {const options = { shape: shape, path: path, scaleFunction: scaleFunction, rotationFunction: rotationFunction, ribbonCloseArray: ribbonCloseArray, ribbonClosePath: ribbonClosePath, cap: 0 === cap ? 0 : cap || Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP, sideOrientation: sideOrientation, instance: instance, updatable: updatable };return ExtrudeShapeCustom(name, options, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Debug/skeletonViewer.js
class SkeletonViewer {static CreateBoneWeightShader(options, scene) {var _a, _c, _d, _e, _f, _g;const skeleton = options.skeleton,colorBase = null !== (_a = options.colorBase) && void 0 !== _a ? _a : math_color/* Color3.Black */.Wo.Black(),colorZero = null !== (_c = options.colorZero) && void 0 !== _c ? _c : math_color/* Color3.Blue */.Wo.Blue(),colorQuarter = null !== (_d = options.colorQuarter) && void 0 !== _d ? _d : math_color/* Color3.Green */.Wo.Green(),colorHalf = null !== (_e = options.colorHalf) && void 0 !== _e ? _e : math_color/* Color3.Yellow */.Wo.Yellow(),colorFull = null !== (_f = options.colorFull) && void 0 !== _f ? _f : math_color/* Color3.Red */.Wo.Red(),targetBoneIndex = null !== (_g = options.targetBoneIndex) && void 0 !== _g ? _g : 0;Materials_effect/* Effect.ShadersStore */.Q.ShadersStore["boneWeights:" + skeleton.name + "VertexShader"] = `precision highp float;

        attribute vec3 position;
        attribute vec2 uv;

        uniform mat4 view;
        uniform mat4 projection;
        uniform mat4 worldViewProjection;

        #include<bonesDeclaration>
        #if NUM_BONE_INFLUENCERS == 0
            attribute vec4 matricesIndices;
            attribute vec4 matricesWeights;
        #endif
        #include<bakedVertexAnimationDeclaration>

        #include<instancesDeclaration>

        varying vec3 vColor;

        uniform vec3 colorBase;
        uniform vec3 colorZero;
        uniform vec3 colorQuarter;
        uniform vec3 colorHalf;
        uniform vec3 colorFull;

        uniform float targetBoneIndex;

        void main() {
            vec3 positionUpdated = position;

            #include<instancesVertex>
            #include<bonesVertex>
            #include<bakedVertexAnimation>

            vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);

            vec3 color = colorBase;
            float totalWeight = 0.;
            if(matricesIndices[0] == targetBoneIndex && matricesWeights[0] > 0.){
                totalWeight += matricesWeights[0];
            }
            if(matricesIndices[1] == targetBoneIndex && matricesWeights[1] > 0.){
                totalWeight += matricesWeights[1];
            }
            if(matricesIndices[2] == targetBoneIndex && matricesWeights[2] > 0.){
                totalWeight += matricesWeights[2];
            }
            if(matricesIndices[3] == targetBoneIndex && matricesWeights[3] > 0.){
                totalWeight += matricesWeights[3];
            }

            color = mix(color, colorZero, smoothstep(0., 0.25, totalWeight));
            color = mix(color, colorQuarter, smoothstep(0.25, 0.5, totalWeight));
            color = mix(color, colorHalf, smoothstep(0.5, 0.75, totalWeight));
            color = mix(color, colorFull, smoothstep(0.75, 1.0, totalWeight));
            vColor = color;

        gl_Position = projection * view * worldPos;
        }`, Materials_effect/* Effect.ShadersStore */.Q.ShadersStore["boneWeights:" + skeleton.name + "FragmentShader"] = `
            precision highp float;
            varying vec3 vPosition;

            varying vec3 vColor;

            void main() {
                vec4 color = vec4(vColor, 1.0);
                gl_FragColor = color;
            }
        `;const shader = new shaderMaterial/* ShaderMaterial */.j("boneWeight:" + skeleton.name, scene, { vertex: "boneWeights:" + skeleton.name, fragment: "boneWeights:" + skeleton.name }, { attributes: ["position", "normal", "matricesIndices", "matricesWeights"], uniforms: ["world", "worldView", "worldViewProjection", "view", "projection", "viewProjection", "colorBase", "colorZero", "colorQuarter", "colorHalf", "colorFull", "targetBoneIndex"] });return shader.setColor3("colorBase", colorBase), shader.setColor3("colorZero", colorZero), shader.setColor3("colorQuarter", colorQuarter), shader.setColor3("colorHalf", colorHalf), shader.setColor3("colorFull", colorFull), shader.setFloat("targetBoneIndex", targetBoneIndex), shader.getClassName = () => "BoneWeightShader", shader.transparencyMode = Materials_material/* Material.MATERIAL_OPAQUE */.F.MATERIAL_OPAQUE, shader;}static CreateSkeletonMapShader(options, scene) {var _a;const skeleton = options.skeleton,colorMap = null !== (_a = options.colorMap) && void 0 !== _a ? _a : [{ color: new math_color/* Color3 */.Wo(1, .38, .18), location: 0 }, { color: new math_color/* Color3 */.Wo(.59, .18, 1), location: .2 }, { color: new math_color/* Color3 */.Wo(.59, 1, .18), location: .4 }, { color: new math_color/* Color3 */.Wo(1, .87, .17), location: .6 }, { color: new math_color/* Color3 */.Wo(1, .17, .42), location: .8 }, { color: new math_color/* Color3 */.Wo(.17, .68, 1), location: 1 }],bufferWidth = skeleton.bones.length + 1,colorMapBuffer = SkeletonViewer._CreateBoneMapColorBuffer(bufferWidth, colorMap, scene),shader = new shaderMaterial/* ShaderMaterial */.j("boneWeights:" + skeleton.name, scene, { vertexSource: `precision highp float;

            attribute vec3 position;
            attribute vec2 uv;

            uniform mat4 view;
            uniform mat4 projection;
            uniform mat4 worldViewProjection;
            uniform float colorMap[` + 4 * skeleton.bones.length + `];

            #include<bonesDeclaration>
            #if NUM_BONE_INFLUENCERS == 0
                attribute vec4 matricesIndices;
                attribute vec4 matricesWeights;
            #endif
            #include<bakedVertexAnimationDeclaration>
            #include<instancesDeclaration>

            varying vec3 vColor;

            void main() {
                vec3 positionUpdated = position;

                #include<instancesVertex>
                #include<bonesVertex>
                #include<bakedVertexAnimation>

                vec3 color = vec3(0.);
                bool first = true;

                for (int i = 0; i < 4; i++) {
                    int boneIdx = int(matricesIndices[i]);
                    float boneWgt = matricesWeights[i];

                    vec3 c = vec3(colorMap[boneIdx * 4 + 0], colorMap[boneIdx * 4 + 1], colorMap[boneIdx * 4 + 2]);

                    if (boneWgt > 0.) {
                        if (first) {
                            first = false;
                            color = c;
                        } else {
                            color = mix(color, c, boneWgt);
                        }
                    }
                }

                vColor = color;

                vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);

                gl_Position = projection * view * worldPos;
            }`, fragmentSource: `
            precision highp float;
            varying vec3 vColor;

            void main() {
                vec4 color = vec4( vColor, 1.0 );
                gl_FragColor = color;
            }
            ` }, { attributes: ["position", "normal", "matricesIndices", "matricesWeights"], uniforms: ["world", "worldView", "worldViewProjection", "view", "projection", "viewProjection", "colorMap"] });return shader.setFloats("colorMap", colorMapBuffer), shader.getClassName = () => "SkeletonMapShader", shader.transparencyMode = Materials_material/* Material.MATERIAL_OPAQUE */.F.MATERIAL_OPAQUE, shader;}static _CreateBoneMapColorBuffer(size, colorMap, scene) {const tempGrad = new DynamicTexture("temp", { width: size, height: 1 }, scene, !1),ctx = tempGrad.getContext(),grad = ctx.createLinearGradient(0, 0, size, 0);colorMap.forEach((stop) => {grad.addColorStop(stop.location, stop.color.toHexString());}), ctx.fillStyle = grad, ctx.fillRect(0, 0, size, 1), tempGrad.update();const buffer = [],data = ctx.getImageData(0, 0, size, 1).data;for (let i = 0; i < data.length; i++) buffer.push(data[i] * (1 / 255));return tempGrad.dispose(), buffer;}get scene() {return this._scene;}get utilityLayer() {return this._utilityLayer;}get isReady() {return this._ready;}set ready(value) {this._ready = value;}get debugMesh() {return this._debugMesh;}set debugMesh(value) {this._debugMesh = value;}get displayMode() {return this.options.displayMode || SkeletonViewer.DISPLAY_LINES;}set displayMode(value) {value > SkeletonViewer.DISPLAY_SPHERE_AND_SPURS && (value = SkeletonViewer.DISPLAY_LINES), this.options.displayMode = value;}constructor(skeleton, mesh, scene, autoUpdateBonesMatrices = !0, renderingGroupId = 3, options = {}) {var _a, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;this.skeleton = skeleton, this.mesh = mesh, this.autoUpdateBonesMatrices = autoUpdateBonesMatrices, this.renderingGroupId = renderingGroupId, this.options = options, this.color = math_color/* Color3.White */.Wo.White(), this._debugLines = [], this._localAxes = null, this._isEnabled = !0, this._obs = null, this._scene = scene, this._ready = !1, options.pauseAnimations = null === (_a = options.pauseAnimations) || void 0 === _a || _a, options.returnToRest = null !== (_c = options.returnToRest) && void 0 !== _c && _c, options.displayMode = null !== (_d = options.displayMode) && void 0 !== _d ? _d : SkeletonViewer.DISPLAY_LINES, options.displayOptions = null !== (_e = options.displayOptions) && void 0 !== _e ? _e : {}, options.displayOptions.midStep = null !== (_f = options.displayOptions.midStep) && void 0 !== _f ? _f : .235, options.displayOptions.midStepFactor = null !== (_g = options.displayOptions.midStepFactor) && void 0 !== _g ? _g : .155, options.displayOptions.sphereBaseSize = null !== (_h = options.displayOptions.sphereBaseSize) && void 0 !== _h ? _h : .15, options.displayOptions.sphereScaleUnit = null !== (_j = options.displayOptions.sphereScaleUnit) && void 0 !== _j ? _j : 2, options.displayOptions.sphereFactor = null !== (_k = options.displayOptions.sphereFactor) && void 0 !== _k ? _k : .865, options.displayOptions.spurFollowsChild = null !== (_l = options.displayOptions.spurFollowsChild) && void 0 !== _l && _l, options.displayOptions.showLocalAxes = null !== (_m = options.displayOptions.showLocalAxes) && void 0 !== _m && _m, options.displayOptions.localAxesSize = null !== (_o = options.displayOptions.localAxesSize) && void 0 !== _o ? _o : .075, options.computeBonesUsingShaders = null === (_p = options.computeBonesUsingShaders) || void 0 === _p || _p, options.useAllBones = null === (_q = options.useAllBones) || void 0 === _q || _q;const initialMeshBoneIndices = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind),initialMeshBoneWeights = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind);if (this._boneIndices = new Set(), !options.useAllBones && initialMeshBoneIndices && initialMeshBoneWeights) for (let i = 0; i < initialMeshBoneIndices.length; ++i) {const index = initialMeshBoneIndices[i],weight = initialMeshBoneWeights[i];0 !== weight && this._boneIndices.add(index);}this._utilityLayer = new UtilityLayerRenderer(this._scene, !1), this._utilityLayer.pickUtilitySceneFirst = !1, this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = !0;let displayMode = this.options.displayMode || 0;displayMode > SkeletonViewer.DISPLAY_SPHERE_AND_SPURS && (displayMode = SkeletonViewer.DISPLAY_LINES), this.displayMode = displayMode, this.update(), this._bindObs();}_bindObs() {switch (this.displayMode) {case SkeletonViewer.DISPLAY_LINES:{this._obs = this.scene.onBeforeRenderObservable.add(() => {this._displayLinesUpdate();});break;}}}update() {switch (this.displayMode) {case SkeletonViewer.DISPLAY_LINES:{this._displayLinesUpdate();break;}case SkeletonViewer.DISPLAY_SPHERES:{this._buildSpheresAndSpurs(!0);break;}case SkeletonViewer.DISPLAY_SPHERE_AND_SPURS:{this._buildSpheresAndSpurs(!1);break;}}this._buildLocalAxes();}set isEnabled(value) {this.isEnabled === value || (this._isEnabled = value, this.debugMesh && this.debugMesh.setEnabled(value), value && !this._obs ? this._bindObs() : !value && this._obs && (this.scene.onBeforeRenderObservable.remove(this._obs), this._obs = null));}get isEnabled() {return this._isEnabled;}_getBonePosition(position, bone, meshMat, x = 0, y = 0, z = 0) {const tmat = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],parentBone = bone.getParent();if (tmat.copyFrom(bone.getLocalMatrix()), 0 !== x || 0 !== y || 0 !== z) {const tmat2 = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1];math_vector/* Matrix.IdentityToRef */.y3.IdentityToRef(tmat2), tmat2.setTranslationFromFloats(x, y, z), tmat2.multiplyToRef(tmat, tmat);}parentBone && tmat.multiplyToRef(parentBone.getAbsoluteTransform(), tmat), tmat.multiplyToRef(meshMat, tmat), position.x = tmat.m[12], position.y = tmat.m[13], position.z = tmat.m[14];}_getLinesForBonesWithLength(bones, meshMat) {const len = bones.length,mesh = this.mesh,meshPos = mesh.position;let idx = 0;for (let i = 0; i < len; i++) {const bone = bones[i];let points = this._debugLines[idx];-1 !== bone._index && (this._boneIndices.has(bone.getIndex()) || this.options.useAllBones) && (points || (points = [math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero()], this._debugLines[idx] = points), this._getBonePosition(points[0], bone, meshMat), this._getBonePosition(points[1], bone, meshMat, 0, bone.length, 0), points[0].subtractInPlace(meshPos), points[1].subtractInPlace(meshPos), idx++);}}_getLinesForBonesNoLength(bones) {const len = bones.length;let boneNum = 0;const mesh = this.mesh,meshPos = mesh.position;for (let i = len - 1; 0 <= i; i--) {const childBone = bones[i],parentBone = childBone.getParent();if (!parentBone || !this._boneIndices.has(childBone.getIndex()) && !this.options.useAllBones) continue;let points = this._debugLines[boneNum];points || (points = [math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Zero */.P.Zero()], this._debugLines[boneNum] = points), childBone.getAbsolutePositionToRef(mesh, points[0]), parentBone.getAbsolutePositionToRef(mesh, points[1]), points[0].subtractInPlace(meshPos), points[1].subtractInPlace(meshPos), boneNum++;}}_revert(animationState) {this.options.pauseAnimations && (this.scene.animationsEnabled = animationState, this.utilityLayer.utilityLayerScene.animationsEnabled = animationState);}_getAbsoluteBindPoseToRef(bone, matrix) {return null === bone || -1 === bone._index ? void matrix.copyFrom(math_vector/* Matrix.Identity */.y3.Identity()) : (this._getAbsoluteBindPoseToRef(bone.getParent(), matrix), void bone.getBaseMatrix().multiplyToRef(matrix, matrix));}_buildSpheresAndSpurs(spheresOnly = !0) {var _a, _c;this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this._ready = !1;const utilityLayerScene = null === (_a = this.utilityLayer) || void 0 === _a ? void 0 : _a.utilityLayerScene,bones = this.skeleton.bones,spheres = [],spurs = [],animationState = this.scene.animationsEnabled;try {this.options.pauseAnimations && (this.scene.animationsEnabled = !1, utilityLayerScene.animationsEnabled = !1), this.options.returnToRest && this.skeleton.returnToRest(), this.autoUpdateBonesMatrices && this.skeleton.computeAbsoluteTransforms();let longestBoneLength = Number.NEGATIVE_INFINITY;const displayOptions = this.options.displayOptions || {};for (let i = 0; i < bones.length; i++) {const bone = bones[i];if (-1 === bone._index || !this._boneIndices.has(bone.getIndex()) && !this.options.useAllBones) continue;const boneAbsoluteBindPoseTransform = new math_vector/* Matrix */.y3();this._getAbsoluteBindPoseToRef(bone, boneAbsoluteBindPoseTransform);const anchorPoint = new math_vector/* Vector3 */.P();boneAbsoluteBindPoseTransform.decompose(void 0, void 0, anchorPoint), bone.children.forEach((bc) => {const childAbsoluteBindPoseTransform = new math_vector/* Matrix */.y3();bc.getBaseMatrix().multiplyToRef(boneAbsoluteBindPoseTransform, childAbsoluteBindPoseTransform);const childPoint = new math_vector/* Vector3 */.P();childAbsoluteBindPoseTransform.decompose(void 0, void 0, childPoint);const distanceFromParent = math_vector/* Vector3.Distance */.P.Distance(anchorPoint, childPoint);if (distanceFromParent > longestBoneLength && (longestBoneLength = distanceFromParent), spheresOnly) return;const dir = childPoint.clone().subtract(anchorPoint.clone()),h = dir.length(),up = dir.normalize().scale(h),midStep = displayOptions.midStep || .165,midStepFactor = displayOptions.midStepFactor || .215,up0 = up.scale(midStep),spur = ExtrudeShapeCustom("skeletonViewer", { shape: [new math_vector/* Vector3 */.P(1, -1, 0), new math_vector/* Vector3 */.P(1, 1, 0), new math_vector/* Vector3 */.P(-1, 1, 0), new math_vector/* Vector3 */.P(-1, -1, 0), new math_vector/* Vector3 */.P(1, -1, 0)], path: [math_vector/* Vector3.Zero */.P.Zero(), up0, up], scaleFunction: (i) => 0 === i || 2 === i ? 0 : 1 === i ? h * midStepFactor : 0, sideOrientation: Meshes_mesh/* Mesh.DEFAULTSIDE */.Kj.DEFAULTSIDE, updatable: !1 }, utilityLayerScene),numVertices = spur.getTotalVertices(),mwk = [],mik = [];for (let i = 0; i < numVertices; i++) mwk.push(1, 0, 0, 0), displayOptions.spurFollowsChild && 9 < i ? mik.push(bc.getIndex(), 0, 0, 0) : mik.push(bone.getIndex(), 0, 0, 0);spur.position = anchorPoint.clone(), spur.setVerticesData(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind, mwk, !1), spur.setVerticesData(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind, mik, !1), spur.convertToFlatShadedMesh(), spurs.push(spur);});const sphereBaseSize = displayOptions.sphereBaseSize || .2,sphere = CreateSphere("skeletonViewer", { segments: 6, diameter: sphereBaseSize, updatable: !0 }, utilityLayerScene),numVertices = sphere.getTotalVertices(),mwk = [],mik = [];for (let i = 0; i < numVertices; i++) mwk.push(1, 0, 0, 0), mik.push(bone.getIndex(), 0, 0, 0);sphere.setVerticesData(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind, mwk, !1), sphere.setVerticesData(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind, mik, !1), sphere.position = anchorPoint.clone(), spheres.push([sphere, bone]);}const sphereScaleUnit = displayOptions.sphereScaleUnit || 2,sphereFactor = displayOptions.sphereFactor || .85,meshes = [];for (let i = 0; i < spheres.length; i++) {const [sphere, bone] = spheres[i],scale = 1 / (sphereScaleUnit / longestBoneLength);let _stepsOut = 0,_b = bone;for (; _b.getParent() && -1 !== _b.getParent().getIndex();) _stepsOut++, _b = _b.getParent();sphere.scaling.scaleInPlace(scale * Math.pow(sphereFactor, _stepsOut)), meshes.push(sphere);}this.debugMesh = Meshes_mesh/* Mesh.MergeMeshes */.Kj.MergeMeshes(meshes.concat(spurs), !0, !0), this.debugMesh && (this.debugMesh.renderingGroupId = this.renderingGroupId, this.debugMesh.skeleton = this.skeleton, this.debugMesh.parent = this.mesh, this.debugMesh.computeBonesUsingShaders = null === (_c = this.options.computeBonesUsingShaders) || void 0 === _c || _c, this.debugMesh.alwaysSelectAsActiveMesh = !0);const light = this.utilityLayer._getSharedGizmoLight();light.intensity = .7, this._revert(animationState), this.ready = !0;} catch (err) {console.error(err), this._revert(animationState), this.dispose();}}_buildLocalAxes() {var _a;this._localAxes && this._localAxes.dispose(), this._localAxes = null;const displayOptions = this.options.displayOptions || {};if (!displayOptions.showLocalAxes) return;const targetScene = this._utilityLayer.utilityLayerScene,size = displayOptions.localAxesSize || .075,lines = [],colors = [],red = new math_color/* Color4 */.HE(1, 0, 0, 1),green = new math_color/* Color4 */.HE(0, 1, 0, 1),blue = new math_color/* Color4 */.HE(0, 0, 1, 1),mwk = [],mik = [];for (const i in this.skeleton.bones) {const bone = this.skeleton.bones[i];if (-1 === bone._index || !this._boneIndices.has(bone.getIndex()) && !this.options.useAllBones) continue;const boneAbsoluteBindPoseTransform = new math_vector/* Matrix */.y3(),boneOrigin = new math_vector/* Vector3 */.P();this._getAbsoluteBindPoseToRef(bone, boneAbsoluteBindPoseTransform), boneAbsoluteBindPoseTransform.decompose(void 0, math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], boneOrigin);const m = new math_vector/* Matrix */.y3();math_vector/* TmpVectors.Quaternion.0.toRotationMatrix */.jp.Quaternion[0].toRotationMatrix(m);const boneAxisX = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(new math_vector/* Vector3 */.P(0 + size, 0, 0), m),boneAxisY = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(new math_vector/* Vector3 */.P(0, 0 + size, 0), m),boneAxisZ = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(new math_vector/* Vector3 */.P(0, 0, 0 + size), m),axisX = [boneOrigin, boneOrigin.add(boneAxisX)],axisY = [boneOrigin, boneOrigin.add(boneAxisY)],axisZ = [boneOrigin, boneOrigin.add(boneAxisZ)];lines.push(...[axisX, axisY, axisZ]), colors.push(...[[red, red], [green, green], [blue, blue]]);for (let j = 0; j < 6; j++) mwk.push(1, 0, 0, 0), mik.push(bone.getIndex(), 0, 0, 0);}this._localAxes = CreateLineSystem("localAxes", { lines: lines, colors: colors, updatable: !0 }, targetScene), this._localAxes.setVerticesData(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind, mwk, !1), this._localAxes.setVerticesData(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind, mik, !1), this._localAxes.skeleton = this.skeleton, this._localAxes.renderingGroupId = this.renderingGroupId + 1, this._localAxes.parent = this.mesh, this._localAxes.computeBonesUsingShaders = null === (_a = this.options.computeBonesUsingShaders) || void 0 === _a || _a;}_displayLinesUpdate() {if (this._utilityLayer) {this.autoUpdateBonesMatrices && this.skeleton.computeAbsoluteTransforms(), void 0 === this.skeleton.bones[0].length ? this._getLinesForBonesNoLength(this.skeleton.bones) : this._getLinesForBonesWithLength(this.skeleton.bones, this.mesh.getWorldMatrix());const targetScene = this._utilityLayer.utilityLayerScene;targetScene && (this._debugMesh ? CreateLineSystem("", { lines: this._debugLines, updatable: !0, instance: this._debugMesh }, targetScene) : (this._debugMesh = CreateLineSystem("", { lines: this._debugLines, updatable: !0, instance: null }, targetScene), this._debugMesh.renderingGroupId = this.renderingGroupId), this._debugMesh.position.copyFrom(this.mesh.position), this._debugMesh.color = this.color);}}changeDisplayMode(mode) {const wasEnabled = !!this.isEnabled;this.displayMode !== mode && (this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this.displayMode = mode, this.update(), this._bindObs(), this.isEnabled = wasEnabled);}changeDisplayOptions(option, value) {const wasEnabled = !!this.isEnabled;this.options.displayOptions[option] = value, this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this.update(), this._bindObs(), this.isEnabled = wasEnabled;}dispose() {this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null), this._utilityLayer && (this._utilityLayer.dispose(), this._utilityLayer = null), this.ready = !1;}}SkeletonViewer.DISPLAY_LINES = 0, SkeletonViewer.DISPLAY_SPHERES = 1, SkeletonViewer.DISPLAY_SPHERE_AND_SPURS = 2;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Debug/ISkeletonViewer.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Debug/directionalLightFrustumViewer.js
class DirectionalLightFrustumViewer {get transparency() {return this._transparency;}set transparency(alpha) {this._transparency = alpha;for (let i = 6; 12 > i; ++i) this._lightHelperFrustumMeshes[i].material.alpha = alpha;}get showLines() {return this._showLines;}set showLines(show) {if (this._showLines !== show) {this._showLines = show;for (let i = 0; 6 > i; ++i) this._lightHelperFrustumMeshes[i].setEnabled(show);}}get showPlanes() {return this._showPlanes;}set showPlanes(show) {if (this._showPlanes !== show) {this._showPlanes = show;for (let i = 6; 12 > i; ++i) this._lightHelperFrustumMeshes[i].setEnabled(show);}}constructor(light, camera) {this._oldPosition = new math_vector/* Vector3 */.P(Number.NaN, Number.NaN, Number.NaN), this._oldDirection = new math_vector/* Vector3 */.P(Number.NaN, Number.NaN, Number.NaN), this._transparency = .3, this._showLines = !0, this._showPlanes = !0, this._scene = light.getScene(), this._light = light, this._camera = camera, this._inverseViewMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this._lightHelperFrustumMeshes = [], this._createGeometry(), this.show(), this.update();}show() {this._lightHelperFrustumMeshes.forEach((mesh, index) => {mesh.setEnabled(6 > index && this._showLines || 6 <= index && this._showPlanes);}), this._oldPosition.set(Number.NaN, Number.NaN, Number.NaN), this._visible = !0;}hide() {this._lightHelperFrustumMeshes.forEach((mesh) => {mesh.setEnabled(!1);}), this._visible = !1;}update() {var _a, _b, _c, _d, _e, _f;if (this._visible && !(this._oldPosition.equals(this._light.position) && this._oldDirection.equals(this._light.direction) && this._oldAutoCalc === this._light.autoCalcShadowZBounds && this._oldMinZ === this._light.shadowMinZ && this._oldMaxZ === this._light.shadowMaxZ)) {this._oldPosition.copyFrom(this._light.position), this._oldDirection.copyFrom(this._light.direction), this._oldAutoCalc = this._light.autoCalcShadowZBounds, this._oldMinZ = this._light.shadowMinZ, this._oldMaxZ = this._light.shadowMaxZ, math_vector/* TmpVectors.Vector3.0.set */.jp.Vector3[0].set(this._light.orthoLeft, this._light.orthoBottom, void 0 === this._light.shadowMinZ ? this._camera.minZ : this._light.shadowMinZ), math_vector/* TmpVectors.Vector3.1.set */.jp.Vector3[1].set(this._light.orthoRight, this._light.orthoTop, void 0 === this._light.shadowMaxZ ? this._camera.maxZ : this._light.shadowMaxZ);const invLightView = this._getInvertViewMatrix();math_vector/* TmpVectors.Vector3.2.copyFromFloats */.jp.Vector3[2].copyFromFloats(math_vector/* TmpVectors.Vector3.1.x */.jp.Vector3[1].x, math_vector/* TmpVectors.Vector3.1.y */.jp.Vector3[1].y, math_vector/* TmpVectors.Vector3.0.z */.jp.Vector3[0].z), math_vector/* TmpVectors.Vector3.3.copyFromFloats */.jp.Vector3[3].copyFromFloats(math_vector/* TmpVectors.Vector3.1.x */.jp.Vector3[1].x, math_vector/* TmpVectors.Vector3.0.y */.jp.Vector3[0].y, math_vector/* TmpVectors.Vector3.0.z */.jp.Vector3[0].z), math_vector/* TmpVectors.Vector3.4.copyFromFloats */.jp.Vector3[4].copyFromFloats(math_vector/* TmpVectors.Vector3.0.x */.jp.Vector3[0].x, math_vector/* TmpVectors.Vector3.0.y */.jp.Vector3[0].y, math_vector/* TmpVectors.Vector3.0.z */.jp.Vector3[0].z), math_vector/* TmpVectors.Vector3.5.copyFromFloats */.jp.Vector3[5].copyFromFloats(math_vector/* TmpVectors.Vector3.0.x */.jp.Vector3[0].x, math_vector/* TmpVectors.Vector3.1.y */.jp.Vector3[1].y, math_vector/* TmpVectors.Vector3.0.z */.jp.Vector3[0].z), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2], invLightView, math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2]), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3], invLightView, math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3]), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(math_vector/* TmpVectors.Vector3.4 */.jp.Vector3[4], invLightView, math_vector/* TmpVectors.Vector3.4 */.jp.Vector3[4]), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(math_vector/* TmpVectors.Vector3.5 */.jp.Vector3[5], invLightView, math_vector/* TmpVectors.Vector3.5 */.jp.Vector3[5]), math_vector/* TmpVectors.Vector3.6.copyFromFloats */.jp.Vector3[6].copyFromFloats(math_vector/* TmpVectors.Vector3.1.x */.jp.Vector3[1].x, math_vector/* TmpVectors.Vector3.1.y */.jp.Vector3[1].y, math_vector/* TmpVectors.Vector3.1.z */.jp.Vector3[1].z), math_vector/* TmpVectors.Vector3.7.copyFromFloats */.jp.Vector3[7].copyFromFloats(math_vector/* TmpVectors.Vector3.1.x */.jp.Vector3[1].x, math_vector/* TmpVectors.Vector3.0.y */.jp.Vector3[0].y, math_vector/* TmpVectors.Vector3.1.z */.jp.Vector3[1].z), math_vector/* TmpVectors.Vector3.8.copyFromFloats */.jp.Vector3[8].copyFromFloats(math_vector/* TmpVectors.Vector3.0.x */.jp.Vector3[0].x, math_vector/* TmpVectors.Vector3.0.y */.jp.Vector3[0].y, math_vector/* TmpVectors.Vector3.1.z */.jp.Vector3[1].z), math_vector/* TmpVectors.Vector3.9.copyFromFloats */.jp.Vector3[9].copyFromFloats(math_vector/* TmpVectors.Vector3.0.x */.jp.Vector3[0].x, math_vector/* TmpVectors.Vector3.1.y */.jp.Vector3[1].y, math_vector/* TmpVectors.Vector3.1.z */.jp.Vector3[1].z), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(math_vector/* TmpVectors.Vector3.6 */.jp.Vector3[6], invLightView, math_vector/* TmpVectors.Vector3.6 */.jp.Vector3[6]), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(math_vector/* TmpVectors.Vector3.7 */.jp.Vector3[7], invLightView, math_vector/* TmpVectors.Vector3.7 */.jp.Vector3[7]), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(math_vector/* TmpVectors.Vector3.8 */.jp.Vector3[8], invLightView, math_vector/* TmpVectors.Vector3.8 */.jp.Vector3[8]), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(math_vector/* TmpVectors.Vector3.9 */.jp.Vector3[9], invLightView, math_vector/* TmpVectors.Vector3.9 */.jp.Vector3[9]), CreateLines("nearlines", { updatable: !0, points: this._nearLinesPoints, instance: this._lightHelperFrustumMeshes[0] }, this._scene), CreateLines("farlines", { updatable: !0, points: this._farLinesPoints, instance: this._lightHelperFrustumMeshes[1] }, this._scene), CreateLines("trlines", { updatable: !0, points: this._trLinesPoints, instance: this._lightHelperFrustumMeshes[2] }, this._scene), CreateLines("brlines", { updatable: !0, points: this._brLinesPoints, instance: this._lightHelperFrustumMeshes[3] }, this._scene), CreateLines("tllines", { updatable: !0, points: this._tlLinesPoints, instance: this._lightHelperFrustumMeshes[4] }, this._scene), CreateLines("bllines", { updatable: !0, points: this._blLinesPoints, instance: this._lightHelperFrustumMeshes[5] }, this._scene), math_vector/* TmpVectors.Vector3.2.toArray */.jp.Vector3[2].toArray(this._nearPlaneVertices, 0), math_vector/* TmpVectors.Vector3.3.toArray */.jp.Vector3[3].toArray(this._nearPlaneVertices, 3), math_vector/* TmpVectors.Vector3.4.toArray */.jp.Vector3[4].toArray(this._nearPlaneVertices, 6), math_vector/* TmpVectors.Vector3.5.toArray */.jp.Vector3[5].toArray(this._nearPlaneVertices, 9), null === (_a = this._lightHelperFrustumMeshes[6].geometry) || void 0 === _a ? void 0 : _a.updateVerticesDataDirectly("position", this._nearPlaneVertices, 0), math_vector/* TmpVectors.Vector3.6.toArray */.jp.Vector3[6].toArray(this._farPlaneVertices, 0), math_vector/* TmpVectors.Vector3.7.toArray */.jp.Vector3[7].toArray(this._farPlaneVertices, 3), math_vector/* TmpVectors.Vector3.8.toArray */.jp.Vector3[8].toArray(this._farPlaneVertices, 6), math_vector/* TmpVectors.Vector3.9.toArray */.jp.Vector3[9].toArray(this._farPlaneVertices, 9), null === (_b = this._lightHelperFrustumMeshes[7].geometry) || void 0 === _b ? void 0 : _b.updateVerticesDataDirectly("position", this._farPlaneVertices, 0), math_vector/* TmpVectors.Vector3.2.toArray */.jp.Vector3[2].toArray(this._rightPlaneVertices, 0), math_vector/* TmpVectors.Vector3.6.toArray */.jp.Vector3[6].toArray(this._rightPlaneVertices, 3), math_vector/* TmpVectors.Vector3.7.toArray */.jp.Vector3[7].toArray(this._rightPlaneVertices, 6), math_vector/* TmpVectors.Vector3.3.toArray */.jp.Vector3[3].toArray(this._rightPlaneVertices, 9), null === (_c = this._lightHelperFrustumMeshes[8].geometry) || void 0 === _c ? void 0 : _c.updateVerticesDataDirectly("position", this._rightPlaneVertices, 0), math_vector/* TmpVectors.Vector3.5.toArray */.jp.Vector3[5].toArray(this._leftPlaneVertices, 0), math_vector/* TmpVectors.Vector3.9.toArray */.jp.Vector3[9].toArray(this._leftPlaneVertices, 3), math_vector/* TmpVectors.Vector3.8.toArray */.jp.Vector3[8].toArray(this._leftPlaneVertices, 6), math_vector/* TmpVectors.Vector3.4.toArray */.jp.Vector3[4].toArray(this._leftPlaneVertices, 9), null === (_d = this._lightHelperFrustumMeshes[9].geometry) || void 0 === _d ? void 0 : _d.updateVerticesDataDirectly("position", this._leftPlaneVertices, 0), math_vector/* TmpVectors.Vector3.2.toArray */.jp.Vector3[2].toArray(this._topPlaneVertices, 0), math_vector/* TmpVectors.Vector3.6.toArray */.jp.Vector3[6].toArray(this._topPlaneVertices, 3), math_vector/* TmpVectors.Vector3.9.toArray */.jp.Vector3[9].toArray(this._topPlaneVertices, 6), math_vector/* TmpVectors.Vector3.5.toArray */.jp.Vector3[5].toArray(this._topPlaneVertices, 9), null === (_e = this._lightHelperFrustumMeshes[10].geometry) || void 0 === _e ? void 0 : _e.updateVerticesDataDirectly("position", this._topPlaneVertices, 0), math_vector/* TmpVectors.Vector3.3.toArray */.jp.Vector3[3].toArray(this._bottomPlaneVertices, 0), math_vector/* TmpVectors.Vector3.7.toArray */.jp.Vector3[7].toArray(this._bottomPlaneVertices, 3), math_vector/* TmpVectors.Vector3.8.toArray */.jp.Vector3[8].toArray(this._bottomPlaneVertices, 6), math_vector/* TmpVectors.Vector3.4.toArray */.jp.Vector3[4].toArray(this._bottomPlaneVertices, 9), null === (_f = this._lightHelperFrustumMeshes[11].geometry) || void 0 === _f ? void 0 : _f.updateVerticesDataDirectly("position", this._bottomPlaneVertices, 0);}}dispose() {this._lightHelperFrustumMeshes.forEach((mesh) => {var _a;null === (_a = mesh.material) || void 0 === _a ? void 0 : _a.dispose(), mesh.dispose();}), this._rootNode.dispose();}_createGeometry() {this._rootNode = new transformNode/* TransformNode */.Y("directionalLightHelperRoot_" + this._light.name, this._scene), this._rootNode.parent = this._light.parent, this._nearLinesPoints = [math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly];const nearLines = CreateLines("nearlines", { updatable: !0, points: this._nearLinesPoints }, this._scene);nearLines.parent = this._rootNode, nearLines.alwaysSelectAsActiveMesh = !0, this._farLinesPoints = [math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly];const farLines = CreateLines("farlines", { updatable: !0, points: this._farLinesPoints }, this._scene);farLines.parent = this._rootNode, farLines.alwaysSelectAsActiveMesh = !0, this._trLinesPoints = [math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly];const trLines = CreateLines("trlines", { updatable: !0, points: this._trLinesPoints }, this._scene);trLines.parent = this._rootNode, trLines.alwaysSelectAsActiveMesh = !0, this._brLinesPoints = [math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly];const brLines = CreateLines("brlines", { updatable: !0, points: this._brLinesPoints }, this._scene);brLines.parent = this._rootNode, brLines.alwaysSelectAsActiveMesh = !0, this._tlLinesPoints = [math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly];const tlLines = CreateLines("tllines", { updatable: !0, points: this._tlLinesPoints }, this._scene);tlLines.parent = this._rootNode, tlLines.alwaysSelectAsActiveMesh = !0, this._blLinesPoints = [math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly, math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly];const blLines = CreateLines("bllines", { updatable: !0, points: this._blLinesPoints }, this._scene);blLines.parent = this._rootNode, blLines.alwaysSelectAsActiveMesh = !0, this._lightHelperFrustumMeshes.push(nearLines, farLines, trLines, brLines, tlLines, blLines);const makePlane = (name, color, positions) => {const plane = new Meshes_mesh/* Mesh */.Kj(name + "plane", this._scene),mat = new standardMaterial/* StandardMaterial */.K(name + "PlaneMat", this._scene);plane.material = mat, plane.parent = this._rootNode, plane.alwaysSelectAsActiveMesh = !0, mat.emissiveColor = color, mat.alpha = this.transparency, mat.backFaceCulling = !1, mat.disableLighting = !0;const vertexData = new mesh_vertexData/* VertexData */.x();vertexData.positions = positions, vertexData.indices = [0, 1, 2, 0, 2, 3], vertexData.applyToMesh(plane, !0), this._lightHelperFrustumMeshes.push(plane);};this._nearPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._farPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._rightPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._leftPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._topPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._bottomPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], makePlane("near", new math_color/* Color3 */.Wo(1, 0, 0), this._nearPlaneVertices), makePlane("far", new math_color/* Color3 */.Wo(.3, 0, 0), this._farPlaneVertices), makePlane("right", new math_color/* Color3 */.Wo(0, 1, 0), this._rightPlaneVertices), makePlane("left", new math_color/* Color3 */.Wo(0, .3, 0), this._leftPlaneVertices), makePlane("top", new math_color/* Color3 */.Wo(0, 0, 1), this._topPlaneVertices), makePlane("bottom", new math_color/* Color3 */.Wo(0, 0, .3), this._bottomPlaneVertices), this._nearLinesPoints[0] = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2], this._nearLinesPoints[1] = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3], this._nearLinesPoints[2] = math_vector/* TmpVectors.Vector3.4 */.jp.Vector3[4], this._nearLinesPoints[3] = math_vector/* TmpVectors.Vector3.5 */.jp.Vector3[5], this._nearLinesPoints[4] = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2], this._farLinesPoints[0] = math_vector/* TmpVectors.Vector3.6 */.jp.Vector3[6], this._farLinesPoints[1] = math_vector/* TmpVectors.Vector3.7 */.jp.Vector3[7], this._farLinesPoints[2] = math_vector/* TmpVectors.Vector3.8 */.jp.Vector3[8], this._farLinesPoints[3] = math_vector/* TmpVectors.Vector3.9 */.jp.Vector3[9], this._farLinesPoints[4] = math_vector/* TmpVectors.Vector3.6 */.jp.Vector3[6], this._trLinesPoints[0] = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2], this._trLinesPoints[1] = math_vector/* TmpVectors.Vector3.6 */.jp.Vector3[6], this._brLinesPoints[0] = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3], this._brLinesPoints[1] = math_vector/* TmpVectors.Vector3.7 */.jp.Vector3[7], this._tlLinesPoints[0] = math_vector/* TmpVectors.Vector3.4 */.jp.Vector3[4], this._tlLinesPoints[1] = math_vector/* TmpVectors.Vector3.8 */.jp.Vector3[8], this._blLinesPoints[0] = math_vector/* TmpVectors.Vector3.5 */.jp.Vector3[5], this._blLinesPoints[1] = math_vector/* TmpVectors.Vector3.9 */.jp.Vector3[9];}_getInvertViewMatrix() {return math_vector/* Matrix.LookAtLHToRef */.y3.LookAtLHToRef(this._light.position, this._light.position.add(this._light.direction), math_vector/* Vector3.UpReadOnly */.P.UpReadOnly, this._inverseViewMatrix), this._inverseViewMatrix.invertToRef(this._inverseViewMatrix), this._inverseViewMatrix;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Debug/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js
var deviceEnums = __webpack_require__("./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceTypes.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.js
var deviceSource = __webpack_require__("./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js + 4 modules
var deviceSourceManager = __webpack_require__("./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/DeviceInput/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/constants.js
var constants = __webpack_require__("./node_modules/@babylonjs/core/Engines/constants.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/engineCapabilities.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/instancingAttributeInfo.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/performanceConfigurator.js
var performanceConfigurator = __webpack_require__("./node_modules/@babylonjs/core/Engines/performanceConfigurator.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/renderTargetWrapper.js
var renderTargetWrapper = __webpack_require__("./node_modules/@babylonjs/core/Engines/renderTargetWrapper.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/nullEngine.js
class NullEngineOptions {constructor() {this.renderWidth = 512, this.renderHeight = 256, this.textureSize = 512, this.deterministicLockstep = !1, this.lockstepMaxSteps = 4;}}class NullEngine extends engine/* Engine */.D {isDeterministicLockStep() {return this._options.deterministicLockstep;}getLockstepMaxSteps() {return this._options.lockstepMaxSteps;}getHardwareScalingLevel() {return 1;}constructor(options = new NullEngineOptions()) {super(null), engine/* Engine.Instances.push */.D.Instances.push(this), options.deterministicLockstep === void 0 && (options.deterministicLockstep = !1), options.lockstepMaxSteps === void 0 && (options.lockstepMaxSteps = 4), this._options = options, performanceConfigurator/* PerformanceConfigurator.SetMatrixPrecision */.Z.SetMatrixPrecision(!!options.useHighPrecisionMatrix), this._caps = { maxTexturesImageUnits: 16, maxVertexTextureImageUnits: 16, maxCombinedTexturesImageUnits: 32, maxTextureSize: 512, maxCubemapTextureSize: 512, maxRenderTextureSize: 512, maxVertexAttribs: 16, maxVaryingVectors: 16, maxFragmentUniformVectors: 16, maxVertexUniformVectors: 16, standardDerivatives: !1, astc: null, pvrtc: null, etc1: null, etc2: null, bptc: null, maxAnisotropy: 0, uintIndices: !1, fragmentDepthSupported: !1, highPrecisionShaderSupported: !0, colorBufferFloat: !1, textureFloat: !1, textureFloatLinearFiltering: !1, textureFloatRender: !1, textureHalfFloat: !1, textureHalfFloatLinearFiltering: !1, textureHalfFloatRender: !1, textureLOD: !1, drawBuffersExtension: !1, depthTextureExtension: !1, vertexArrayObject: !1, instancedArrays: !1, supportOcclusionQuery: !1, canUseTimestampForTimerQuery: !1, maxMSAASamples: 1, blendMinMax: !1, canUseGLInstanceID: !1, canUseGLVertexID: !1, supportComputeShaders: !1, supportSRGBBuffers: !1, supportTransformFeedbacks: !1, textureMaxLevel: !1, texture2DArrayMaxLayerCount: 128 }, this._features = { forceBitmapOverHTMLImageElement: !1, supportRenderAndCopyToLodForFloatTextures: !1, supportDepthStencilTexture: !1, supportShadowSamplers: !1, uniformBufferHardCheckMatrix: !1, allowTexturePrefiltering: !1, trackUbosInFrame: !1, checkUbosContentBeforeUpload: !1, supportCSM: !1, basisNeedsPOT: !1, support3DTextures: !1, needTypeSuffixInShaderConstants: !1, supportMSAA: !1, supportSSAO2: !1, supportExtendedTextureFormats: !1, supportSwitchCaseInShader: !1, supportSyncTextureRead: !1, needsInvertingBitmap: !1, useUBOBindingCache: !1, needShaderCodeInlining: !1, needToAlwaysBindUniformBuffers: !1, supportRenderPasses: !0, supportSpriteInstancing: !1, _collectUbosUpdatedInFrame: !1 }, logger/* Logger.Log */.Y.Log(`Babylon.js v${engine/* Engine.Version */.D.Version} - Null engine`);const theCurrentGlobal = "undefined" == typeof self ? "undefined" == typeof global ? window : global : self;"undefined" == typeof URL && (theCurrentGlobal.URL = { createObjectURL: function () {}, revokeObjectURL: function () {} }), "undefined" == typeof Blob && (theCurrentGlobal.Blob = function () {});}createVertexBuffer() {const buffer = new dataBuffer/* DataBuffer */.h();return buffer.references = 1, buffer;}createIndexBuffer() {const buffer = new dataBuffer/* DataBuffer */.h();return buffer.references = 1, buffer;}clear(stencil = !1) {}getRenderWidth(useScreen = !1) {return !useScreen && this._currentRenderTarget ? this._currentRenderTarget.width : this._options.renderWidth;}getRenderHeight(useScreen = !1) {return !useScreen && this._currentRenderTarget ? this._currentRenderTarget.height : this._options.renderHeight;}setViewport(viewport) {this._cachedViewport = viewport;}createShaderProgram() {return { __SPECTOR_rebuildProgram: null };}getUniforms() {return [];}getAttributes() {return [];}bindSamplers() {this._currentEffect = null;}enableEffect(effect) {effect = null !== effect && Materials_drawWrapper/* DrawWrapper.IsWrapper */.q.IsWrapper(effect) ? effect.effect : effect, this._currentEffect = effect;effect && (effect.onBind && effect.onBind(effect), effect._onBindObservable && effect._onBindObservable.notifyObservers(effect));}setState(zOffset = 0, reverseSide = !1, zOffsetUnits = 0) {}setIntArray() {return !0;}setIntArray2() {return !0;}setIntArray3() {return !0;}setIntArray4() {return !0;}setFloatArray() {return !0;}setFloatArray2() {return !0;}setFloatArray3() {return !0;}setFloatArray4() {return !0;}setArray() {return !0;}setArray2() {return !0;}setArray3() {return !0;}setArray4() {return !0;}setMatrices() {return !0;}setMatrix3x3() {return !0;}setMatrix2x2() {return !0;}setFloat() {return !0;}setFloat2() {return !0;}setFloat3() {return !0;}setBool() {return !0;}setFloat4() {return !0;}setAlphaMode(mode, noDepthWriteChange = !1) {this._alphaMode === mode || (this.alphaState.alphaBlend = 0 !== mode, !noDepthWriteChange && this.setDepthWrite(0 === mode), this._alphaMode = mode);}bindBuffers() {}wipeCaches(bruteForce) {this.preventCacheWipeBetweenFrames || (this.resetTextureCache(), this._currentEffect = null, bruteForce && (this._currentProgram = null, this._stencilStateComposer.reset(), this.depthCullingState.reset(), this.alphaState.reset()), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);}draw() {}drawElementsType() {}drawArraysType() {}_createTexture() {return {};}_releaseTexture() {}createTexture(urlArg, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, buffer = null, fallback = null, format = null, forcedExtension = null) {const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Url */.S.Url);return texture.url = urlArg + "", texture.generateMipMaps = !noMipmap, texture.samplingMode = samplingMode, texture.invertY = invertY, texture.baseWidth = this._options.textureSize, texture.baseHeight = this._options.textureSize, texture.width = this._options.textureSize, texture.height = this._options.textureSize, format && (texture.format = format), texture.isReady = !0, onLoad && setTimeout(() => {onLoad(texture);}), this._internalTexturesCache.push(texture), texture;}_createHardwareRenderTargetWrapper(isMulti, isCube, size) {const rtWrapper = new renderTargetWrapper/* RenderTargetWrapper */.r(isMulti, isCube, size, this);return this._renderTargetWrapperCache.push(rtWrapper), rtWrapper;}createRenderTargetTexture(size, options) {const rtWrapper = this._createHardwareRenderTargetWrapper(!1, !1, size),fullOptions = {};void 0 !== options && "object" == typeof options ? (fullOptions.generateMipMaps = options.generateMipMaps, fullOptions.generateDepthBuffer = void 0 === options.generateDepthBuffer || options.generateDepthBuffer, fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer, fullOptions.type = void 0 === options.type ? 0 : options.type, fullOptions.samplingMode = void 0 === options.samplingMode ? 3 : options.samplingMode) : (fullOptions.generateMipMaps = options, fullOptions.generateDepthBuffer = !0, fullOptions.generateStencilBuffer = !1, fullOptions.type = 0, fullOptions.samplingMode = 3);const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.RenderTarget */.S.RenderTarget),width = size.width || size,height = size.height || size;return rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer, rtWrapper._generateStencilBuffer = !!fullOptions.generateStencilBuffer, texture.baseWidth = width, texture.baseHeight = height, texture.width = width, texture.height = height, texture.isReady = !0, texture.samples = 1, texture.generateMipMaps = !!fullOptions.generateMipMaps, texture.samplingMode = fullOptions.samplingMode, texture.type = fullOptions.type, this._internalTexturesCache.push(texture), rtWrapper;}createRenderTargetCubeTexture(size, options) {const rtWrapper = this._createHardwareRenderTargetWrapper(!1, !0, size),fullOptions = { generateMipMaps: !0, generateDepthBuffer: !0, generateStencilBuffer: !1, type: 0, samplingMode: 3, format: 5, ...options };fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer, 1 !== fullOptions.type || this._caps.textureFloatLinearFiltering ? 2 === fullOptions.type && !this._caps.textureHalfFloatLinearFiltering && (fullOptions.samplingMode = 1) : fullOptions.samplingMode = 1, rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer, rtWrapper._generateStencilBuffer = !!fullOptions.generateStencilBuffer;const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.RenderTarget */.S.RenderTarget);return texture.baseWidth = size, texture.baseHeight = size, texture.width = size, texture.height = size, texture.isReady = !0, texture.isCube = !0, texture.samples = 1, texture.generateMipMaps = !!fullOptions.generateMipMaps, texture.samplingMode = fullOptions.samplingMode, texture.type = fullOptions.type, this._internalTexturesCache.push(texture), rtWrapper;}updateTextureSamplingMode(samplingMode, texture) {texture.samplingMode = samplingMode;}createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = !1) {const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Raw */.S.Raw);return texture.baseWidth = width, texture.baseHeight = height, texture.width = width, texture.height = height, texture.format = format, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.invertY = invertY, texture._compression = compression, texture.type = type, texture._useSRGBBuffer = useSRGBBuffer, this._doNotHandleContextLost || (texture._bufferView = data), texture;}updateRawTexture(texture, data, format, invertY, compression = null, type = 0, useSRGBBuffer = !1) {texture && (texture._bufferView = data, texture.format = format, texture.invertY = invertY, texture._compression = compression, texture.type = type, texture._useSRGBBuffer = useSRGBBuffer);}bindFramebuffer(rtWrapper, faceIndex, requiredWidth, requiredHeight, forceFullscreenViewport) {this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = rtWrapper, this._currentFramebuffer = null, this._cachedViewport && !forceFullscreenViewport && this.setViewport(this._cachedViewport, requiredWidth, requiredHeight);}unBindFramebuffer(rtWrapper, disableGenerateMipMaps = !1, onBeforeUnbind) {this._currentRenderTarget = null, onBeforeUnbind && onBeforeUnbind(), this._currentFramebuffer = null;}createDynamicVertexBuffer() {const buffer = new dataBuffer/* DataBuffer */.h();return buffer.references = 1, buffer.capacity = 1, buffer;}updateDynamicTexture(premulAlpha = !1) {}areAllEffectsReady() {return !0;}getError() {return 0;}_getUnpackAlignement() {return 1;}_unpackFlipY() {}updateDynamicIndexBuffer(offset = 0) {}updateDynamicVertexBuffer() {}_bindTextureDirectly(target, texture) {return this._boundTexturesCache[this._activeChannel] !== texture && (this._boundTexturesCache[this._activeChannel] = texture, !0);}_bindTexture(channel, texture) {0 > channel || this._bindTextureDirectly(0, texture);}_deleteBuffer() {}releaseEffects() {}displayLoadingUI() {}hideLoadingUI() {}set loadingUIText(_) {}_uploadCompressedDataToTextureDirectly(faceIndex = 0, lod = 0) {}_uploadDataToTextureDirectly(faceIndex = 0, lod = 0) {}_uploadArrayBufferViewToTexture(faceIndex = 0, lod = 0) {}_uploadImageToTexture(faceIndex = 0, lod = 0) {}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.alpha.js
var engine_alpha = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.alpha.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.debugging.js
thinEngine/* ThinEngine.prototype._debugPushGroup */.B.prototype._debugPushGroup = function () {}, thinEngine/* ThinEngine.prototype._debugPopGroup */.B.prototype._debugPopGroup = function () {}, thinEngine/* ThinEngine.prototype._debugInsertMarker */.B.prototype._debugInsertMarker = function () {}, thinEngine/* ThinEngine.prototype._debugFlushPendingCommands */.B.prototype._debugFlushPendingCommands = function () {};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Instrumentation/timeToken.js
class _TimeToken {constructor() {this._timeElapsedQueryEnded = !1;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/perfCounter.js
var perfCounter = __webpack_require__("./node_modules/@babylonjs/core/Misc/perfCounter.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.query.js
class _OcclusionDataStorage {constructor() {this.occlusionInternalRetryCounter = 0, this.isOcclusionQueryInProgress = !1, this.isOccluded = !1, this.occlusionRetryCount = -1, this.occlusionType = abstractMesh/* AbstractMesh.OCCLUSION_TYPE_NONE */.x.OCCLUSION_TYPE_NONE, this.occlusionQueryAlgorithmType = abstractMesh/* AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE */.x.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE, this.forceRenderingWhenOccluded = !1;}}engine/* Engine.prototype.createQuery */.D.prototype.createQuery = function () {const query = this._gl.createQuery();if (!query) throw new Error("Unable to create Occlusion Query");return query;}, engine/* Engine.prototype.deleteQuery */.D.prototype.deleteQuery = function (query) {return this._gl.deleteQuery(query), this;}, engine/* Engine.prototype.isQueryResultAvailable */.D.prototype.isQueryResultAvailable = function (query) {return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT_AVAILABLE);}, engine/* Engine.prototype.getQueryResult */.D.prototype.getQueryResult = function (query) {return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT);}, engine/* Engine.prototype.beginOcclusionQuery */.D.prototype.beginOcclusionQuery = function (algorithmType, query) {const glAlgorithm = this._getGlAlgorithmType(algorithmType);return this._gl.beginQuery(glAlgorithm, query), !0;}, engine/* Engine.prototype.endOcclusionQuery */.D.prototype.endOcclusionQuery = function (algorithmType) {const glAlgorithm = this._getGlAlgorithmType(algorithmType);return this._gl.endQuery(glAlgorithm), this;}, engine/* Engine.prototype._createTimeQuery */.D.prototype._createTimeQuery = function () {const timerQuery = this.getCaps().timerQuery;return timerQuery.createQueryEXT ? timerQuery.createQueryEXT() : this.createQuery();}, engine/* Engine.prototype._deleteTimeQuery */.D.prototype._deleteTimeQuery = function (query) {const timerQuery = this.getCaps().timerQuery;return timerQuery.deleteQueryEXT ? void timerQuery.deleteQueryEXT(query) : void this.deleteQuery(query);}, engine/* Engine.prototype._getTimeQueryResult */.D.prototype._getTimeQueryResult = function (query) {const timerQuery = this.getCaps().timerQuery;return timerQuery.getQueryObjectEXT ? timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_EXT) : this.getQueryResult(query);}, engine/* Engine.prototype._getTimeQueryAvailability */.D.prototype._getTimeQueryAvailability = function (query) {const timerQuery = this.getCaps().timerQuery;return timerQuery.getQueryObjectEXT ? timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_AVAILABLE_EXT) : this.isQueryResultAvailable(query);}, engine/* Engine.prototype.startTimeQuery */.D.prototype.startTimeQuery = function () {const caps = this.getCaps(),timerQuery = caps.timerQuery;if (!timerQuery) return null;const token = new _TimeToken();if (this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT), caps.canUseTimestampForTimerQuery) token._startTimeQuery = this._createTimeQuery(), timerQuery.queryCounterEXT(token._startTimeQuery, timerQuery.TIMESTAMP_EXT);else {if (this._currentNonTimestampToken) return this._currentNonTimestampToken;token._timeElapsedQuery = this._createTimeQuery(), timerQuery.beginQueryEXT ? timerQuery.beginQueryEXT(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery) : this._gl.beginQuery(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery), this._currentNonTimestampToken = token;}return token;}, engine/* Engine.prototype.endTimeQuery */.D.prototype.endTimeQuery = function (token) {const caps = this.getCaps(),timerQuery = caps.timerQuery;if (!timerQuery || !token) return -1;if (caps.canUseTimestampForTimerQuery) {if (!token._startTimeQuery) return -1;token._endTimeQuery || (token._endTimeQuery = this._createTimeQuery(), timerQuery.queryCounterEXT(token._endTimeQuery, timerQuery.TIMESTAMP_EXT));} else if (!token._timeElapsedQueryEnded) {if (!token._timeElapsedQuery) return -1;timerQuery.endQueryEXT ? timerQuery.endQueryEXT(timerQuery.TIME_ELAPSED_EXT) : (this._gl.endQuery(timerQuery.TIME_ELAPSED_EXT), this._currentNonTimestampToken = null), token._timeElapsedQueryEnded = !0;}const disjoint = this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT);let available = !1;if (token._endTimeQuery ? available = this._getTimeQueryAvailability(token._endTimeQuery) : token._timeElapsedQuery && (available = this._getTimeQueryAvailability(token._timeElapsedQuery)), available && !disjoint) {let result = 0;if (caps.canUseTimestampForTimerQuery) {if (!token._startTimeQuery || !token._endTimeQuery) return -1;const timeStart = this._getTimeQueryResult(token._startTimeQuery),timeEnd = this._getTimeQueryResult(token._endTimeQuery);result = timeEnd - timeStart, this._deleteTimeQuery(token._startTimeQuery), this._deleteTimeQuery(token._endTimeQuery), token._startTimeQuery = null, token._endTimeQuery = null;} else {if (!token._timeElapsedQuery) return -1;result = this._getTimeQueryResult(token._timeElapsedQuery), this._deleteTimeQuery(token._timeElapsedQuery), token._timeElapsedQuery = null, token._timeElapsedQueryEnded = !1;}return result;}return -1;}, engine/* Engine.prototype._captureGPUFrameTime */.D.prototype._captureGPUFrameTime = !1, engine/* Engine.prototype._gpuFrameTime */.D.prototype._gpuFrameTime = new perfCounter/* PerfCounter */.z(), engine/* Engine.prototype.getGPUFrameTimeCounter */.D.prototype.getGPUFrameTimeCounter = function () {return this._gpuFrameTime;}, engine/* Engine.prototype.captureGPUFrameTime */.D.prototype.captureGPUFrameTime = function (value) {value === this._captureGPUFrameTime || (this._captureGPUFrameTime = value, value ? (this._onBeginFrameObserver = this.onBeginFrameObservable.add(() => {this._gpuFrameTimeToken || (this._gpuFrameTimeToken = this.startTimeQuery());}), this._onEndFrameObserver = this.onEndFrameObservable.add(() => {if (this._gpuFrameTimeToken) {const time = this.endTimeQuery(this._gpuFrameTimeToken);-1 < time && (this._gpuFrameTimeToken = null, this._gpuFrameTime.fetchNewFrame(), this._gpuFrameTime.addCount(time, !0));}})) : (this.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null));}, engine/* Engine.prototype._getGlAlgorithmType */.D.prototype._getGlAlgorithmType = function (algorithmType) {return algorithmType === abstractMesh/* AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE */.x.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;}, Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "isOcclusionQueryInProgress", { get: function () {return this._occlusionDataStorage.isOcclusionQueryInProgress;}, set: function (value) {this._occlusionDataStorage.isOcclusionQueryInProgress = value;}, enumerable: !1, configurable: !0 }), Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "_occlusionDataStorage", { get: function () {return this.__occlusionDataStorage || (this.__occlusionDataStorage = new _OcclusionDataStorage()), this.__occlusionDataStorage;}, enumerable: !1, configurable: !0 }), Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "isOccluded", { get: function () {return this._occlusionDataStorage.isOccluded;}, set: function (value) {this._occlusionDataStorage.isOccluded = value;}, enumerable: !0, configurable: !0 }), Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "occlusionQueryAlgorithmType", { get: function () {return this._occlusionDataStorage.occlusionQueryAlgorithmType;}, set: function (value) {this._occlusionDataStorage.occlusionQueryAlgorithmType = value;}, enumerable: !0, configurable: !0 }), Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "occlusionType", { get: function () {return this._occlusionDataStorage.occlusionType;}, set: function (value) {this._occlusionDataStorage.occlusionType = value;}, enumerable: !0, configurable: !0 }), Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "occlusionRetryCount", { get: function () {return this._occlusionDataStorage.occlusionRetryCount;}, set: function (value) {this._occlusionDataStorage.occlusionRetryCount = value;}, enumerable: !0, configurable: !0 }), Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "forceRenderingWhenOccluded", { get: function () {return this._occlusionDataStorage.forceRenderingWhenOccluded;}, set: function (value) {this._occlusionDataStorage.forceRenderingWhenOccluded = value;}, enumerable: !0, configurable: !0 }), abstractMesh/* AbstractMesh.prototype._checkOcclusionQuery */.x.prototype._checkOcclusionQuery = function () {const dataStorage = this._occlusionDataStorage;if (dataStorage.occlusionType === abstractMesh/* AbstractMesh.OCCLUSION_TYPE_NONE */.x.OCCLUSION_TYPE_NONE) return dataStorage.isOccluded = !1, !1;const engine = this.getEngine();if (!engine.getCaps().supportOcclusionQuery) return dataStorage.isOccluded = !1, !1;if (!engine.isQueryResultAvailable) return dataStorage.isOccluded = !1, !1;if (this.isOcclusionQueryInProgress && this._occlusionQuery) {const isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);if (isOcclusionQueryAvailable) {const occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);dataStorage.isOcclusionQueryInProgress = !1, dataStorage.occlusionInternalRetryCounter = 0, dataStorage.isOccluded = !(0 < occlusionQueryResult);} else if (dataStorage.occlusionInternalRetryCounter++, -1 !== dataStorage.occlusionRetryCount && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) dataStorage.isOcclusionQueryInProgress = !1, dataStorage.occlusionInternalRetryCounter = 0, dataStorage.isOccluded = dataStorage.occlusionType !== abstractMesh/* AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC */.x.OCCLUSION_TYPE_OPTIMISTIC && dataStorage.isOccluded;else return dataStorage.occlusionType !== abstractMesh/* AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC */.x.OCCLUSION_TYPE_OPTIMISTIC && dataStorage.isOccluded;}const scene = this.getScene();if (scene.getBoundingBoxRenderer) {const occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();null === this._occlusionQuery && (this._occlusionQuery = engine.createQuery()), engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery) && (occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this), engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType), this._occlusionDataStorage.isOcclusionQueryInProgress = !0);}return dataStorage.isOccluded;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.transformFeedback.js
var _forceTransformFeedbackToBundle = !0;engine/* Engine.prototype.createTransformFeedback */.D.prototype.createTransformFeedback = function () {const transformFeedback = this._gl.createTransformFeedback();if (!transformFeedback) throw new Error("Unable to create Transform Feedback");return transformFeedback;}, engine/* Engine.prototype.deleteTransformFeedback */.D.prototype.deleteTransformFeedback = function (value) {this._gl.deleteTransformFeedback(value);}, engine/* Engine.prototype.bindTransformFeedback */.D.prototype.bindTransformFeedback = function (value) {this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK, value);}, engine/* Engine.prototype.beginTransformFeedback */.D.prototype.beginTransformFeedback = function (usePoints = !0) {this._gl.beginTransformFeedback(usePoints ? this._gl.POINTS : this._gl.TRIANGLES);}, engine/* Engine.prototype.endTransformFeedback */.D.prototype.endTransformFeedback = function () {this._gl.endTransformFeedback();}, engine/* Engine.prototype.setTranformFeedbackVaryings */.D.prototype.setTranformFeedbackVaryings = function (program, value) {this._gl.transformFeedbackVaryings(program, value, this._gl.INTERLEAVED_ATTRIBS);}, engine/* Engine.prototype.bindTransformFeedbackBuffer */.D.prototype.bindTransformFeedbackBuffer = function (value) {this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, value ? value.underlyingResource : null);};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.rawTexture.js
var engine_rawTexture = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.rawTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.externalTexture.js
thinEngine/* ThinEngine.prototype.createExternalTexture */.B.prototype.createExternalTexture = function () {return null;}, thinEngine/* ThinEngine.prototype.setExternalTexture */.B.prototype.setExternalTexture = function () {throw new Error("setExternalTexture: This engine does not support external textures!");};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.videoTexture.js
var engine_videoTexture = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.videoTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.multiRender.js
thinEngine/* ThinEngine.prototype.restoreSingleAttachment */.B.prototype.restoreSingleAttachment = function () {const gl = this._gl;this.bindAttachments([gl.BACK]);}, thinEngine/* ThinEngine.prototype.restoreSingleAttachmentForRenderTarget */.B.prototype.restoreSingleAttachmentForRenderTarget = function () {const gl = this._gl;this.bindAttachments([gl.COLOR_ATTACHMENT0]);}, thinEngine/* ThinEngine.prototype.buildTextureLayout */.B.prototype.buildTextureLayout = function (textureStatus) {const gl = this._gl,result = [];for (let i = 0; i < textureStatus.length; i++) textureStatus[i] ? result.push(gl["COLOR_ATTACHMENT" + i]) : result.push(gl.NONE);return result;}, thinEngine/* ThinEngine.prototype.bindAttachments */.B.prototype.bindAttachments = function (attachments) {const gl = this._gl;gl.drawBuffers(attachments);}, thinEngine/* ThinEngine.prototype.unBindMultiColorAttachmentFramebuffer */.B.prototype.unBindMultiColorAttachmentFramebuffer = function (rtWrapper, disableGenerateMipMaps = !1, onBeforeUnbind) {this._currentRenderTarget = null;const gl = this._gl,attachments = rtWrapper._attachments,count = attachments.length;if (rtWrapper._MSAAFramebuffer) {gl.bindFramebuffer(gl.READ_FRAMEBUFFER, rtWrapper._MSAAFramebuffer), gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, rtWrapper._framebuffer);for (let i = 0; i < count; i++) {const texture = rtWrapper.textures[i];for (let j = 0; j < count; j++) attachments[j] = gl.NONE;attachments[i] = gl[1 < this.webGLVersion ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"], gl.readBuffer(attachments[i]), gl.drawBuffers(attachments), gl.blitFramebuffer(0, 0, texture.width, texture.height, 0, 0, texture.width, texture.height, gl.COLOR_BUFFER_BIT, gl.NEAREST);}for (let i = 0; i < count; i++) attachments[i] = gl[1 < this.webGLVersion ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];gl.drawBuffers(attachments);}for (let i = 0; i < count; i++) {const texture = rtWrapper.textures[i];!texture.generateMipMaps || disableGenerateMipMaps || texture.isCube || (this._bindTextureDirectly(gl.TEXTURE_2D, texture, !0), gl.generateMipmap(gl.TEXTURE_2D), this._bindTextureDirectly(gl.TEXTURE_2D, null));}onBeforeUnbind && (rtWrapper._MSAAFramebuffer && this._bindUnboundFramebuffer(rtWrapper._framebuffer), onBeforeUnbind()), this._bindUnboundFramebuffer(null);}, thinEngine/* ThinEngine.prototype.createMultipleRenderTarget */.B.prototype.createMultipleRenderTarget = function (size, options, initializeBuffers = !0) {let generateMipMaps = !1,generateDepthBuffer = !0,generateStencilBuffer = !1,generateDepthTexture = !1,depthTextureFormat = 15,textureCount = 1;let types = [],samplingModes = [],useSRGBBuffers = [];const rtWrapper = this._createHardwareRenderTargetWrapper(!0, !1, size);void 0 !== options && (generateMipMaps = void 0 !== options.generateMipMaps && options.generateMipMaps, generateDepthBuffer = void 0 === options.generateDepthBuffer || options.generateDepthBuffer, generateStencilBuffer = void 0 !== options.generateStencilBuffer && options.generateStencilBuffer, generateDepthTexture = void 0 !== options.generateDepthTexture && options.generateDepthTexture, textureCount = options.textureCount || 1, options.types && (types = options.types), options.samplingModes && (samplingModes = options.samplingModes), options.useSRGBBuffers && (useSRGBBuffers = options.useSRGBBuffers), 1 < this.webGLVersion && (13 === options.depthTextureFormat || 17 === options.depthTextureFormat || 16 === options.depthTextureFormat || 14 === options.depthTextureFormat || 18 === options.depthTextureFormat) && (depthTextureFormat = options.depthTextureFormat));const gl = this._gl,framebuffer = gl.createFramebuffer();this._bindUnboundFramebuffer(framebuffer);const width = size.width || size,height = size.height || size,textures = [],attachments = [],useStencilTexture = 1 < this.webGLVersion && generateDepthTexture && (13 === options.depthTextureFormat || 17 === options.depthTextureFormat || 18 === options.depthTextureFormat),depthStencilBuffer = this._setupFramebufferDepthAttachments(!useStencilTexture && generateStencilBuffer, !generateDepthTexture && generateDepthBuffer, width, height);rtWrapper._framebuffer = framebuffer, rtWrapper._depthStencilBuffer = depthStencilBuffer, rtWrapper._generateDepthBuffer = !generateDepthTexture && generateDepthBuffer, rtWrapper._generateStencilBuffer = !useStencilTexture && generateStencilBuffer, rtWrapper._attachments = attachments;for (let i = 0; i < textureCount; i++) {let samplingMode = samplingModes[i] || 3,type = types[i] || 0,useSRGBBuffer = useSRGBBuffers[i] || !1;1 !== type || this._caps.textureFloatLinearFiltering ? 2 === type && !this._caps.textureHalfFloatLinearFiltering && (samplingMode = 1) : samplingMode = 1;const filters = this._getSamplingParameters(samplingMode, generateMipMaps);1 !== type || this._caps.textureFloat || (type = 0, logger/* Logger.Warn */.Y.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")), useSRGBBuffer = useSRGBBuffer && this._caps.supportSRGBBuffers && (1 < this.webGLVersion || this.isWebGPU);const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.MultiRenderTarget */.S.MultiRenderTarget),attachment = gl[1 < this.webGLVersion ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];textures.push(texture), attachments.push(attachment), gl.activeTexture(gl["TEXTURE" + i]), gl.bindTexture(gl.TEXTURE_2D, texture._hardwareTexture.underlyingResource), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filters.mag), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filters.min), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);const internalSizedFormat = this._getRGBABufferInternalSizedFormat(type, 5, useSRGBBuffer);gl.texImage2D(gl.TEXTURE_2D, 0, internalSizedFormat, width, height, 0, gl.RGBA, this._getWebGLTextureType(type), null), gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, attachment, gl.TEXTURE_2D, texture._hardwareTexture.underlyingResource, 0), generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(gl.TEXTURE_2D, null), texture.baseWidth = width, texture.baseHeight = height, texture.width = width, texture.height = height, texture.isReady = !0, texture.samples = 1, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.type = type, texture._useSRGBBuffer = useSRGBBuffer, this._internalTexturesCache.push(texture);}if (generateDepthTexture && this._caps.depthTextureExtension) {const depthTexture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Depth */.S.Depth);let depthTextureType = 5,glDepthTextureInternalFormat = gl.DEPTH_COMPONENT16,glDepthTextureFormat = gl.DEPTH_COMPONENT,glDepthTextureType = gl.UNSIGNED_SHORT,glDepthTextureAttachment = gl.DEPTH_ATTACHMENT;2 > this.webGLVersion ? glDepthTextureInternalFormat = gl.DEPTH_COMPONENT : 14 === depthTextureFormat ? (depthTextureType = 1, glDepthTextureType = gl.FLOAT, glDepthTextureInternalFormat = gl.DEPTH_COMPONENT32F) : 18 === depthTextureFormat ? (depthTextureType = 0, glDepthTextureType = gl.FLOAT_32_UNSIGNED_INT_24_8_REV, glDepthTextureInternalFormat = gl.DEPTH32F_STENCIL8, glDepthTextureFormat = gl.DEPTH_STENCIL, glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT) : 16 === depthTextureFormat ? (depthTextureType = 0, glDepthTextureType = gl.UNSIGNED_INT, glDepthTextureInternalFormat = gl.DEPTH_COMPONENT24, glDepthTextureAttachment = gl.DEPTH_ATTACHMENT) : (13 === depthTextureFormat || 17 === depthTextureFormat) && (depthTextureType = 12, glDepthTextureType = gl.UNSIGNED_INT_24_8, glDepthTextureInternalFormat = gl.DEPTH24_STENCIL8, glDepthTextureFormat = gl.DEPTH_STENCIL, glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT), gl.activeTexture(gl.TEXTURE0), gl.bindTexture(gl.TEXTURE_2D, depthTexture._hardwareTexture.underlyingResource), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE), gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE), gl.texImage2D(gl.TEXTURE_2D, 0, glDepthTextureInternalFormat, width, height, 0, glDepthTextureFormat, glDepthTextureType, null), gl.framebufferTexture2D(gl.FRAMEBUFFER, glDepthTextureAttachment, gl.TEXTURE_2D, depthTexture._hardwareTexture.underlyingResource, 0), depthTexture.baseWidth = width, depthTexture.baseHeight = height, depthTexture.width = width, depthTexture.height = height, depthTexture.isReady = !0, depthTexture.samples = 1, depthTexture.generateMipMaps = generateMipMaps, depthTexture.samplingMode = 1, depthTexture.format = depthTextureFormat, depthTexture.type = depthTextureType, textures.push(depthTexture), this._internalTexturesCache.push(depthTexture);}return rtWrapper.setTextures(textures), initializeBuffers && gl.drawBuffers(attachments), this._bindUnboundFramebuffer(null), this.resetTextureCache(), rtWrapper;}, thinEngine/* ThinEngine.prototype.updateMultipleRenderTargetTextureSampleCount */.B.prototype.updateMultipleRenderTargetTextureSampleCount = function (rtWrapper, samples, initializeBuffers = !0) {if (2 > this.webGLVersion || !rtWrapper || !rtWrapper.texture) return 1;if (rtWrapper.samples === samples) return samples;const count = rtWrapper._attachments.length;if (0 === count) return 1;const gl = this._gl;samples = Math.min(samples, this.getCaps().maxMSAASamples);const useDepthStencil = !!rtWrapper._depthStencilBuffer;if (useDepthStencil && (gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer), rtWrapper._depthStencilBuffer = null), rtWrapper._MSAAFramebuffer && (gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer), rtWrapper._MSAAFramebuffer = null), 1 < samples && "function" == typeof gl.renderbufferStorageMultisample) {const framebuffer = gl.createFramebuffer();if (!framebuffer) throw new Error("Unable to create multi sampled framebuffer");rtWrapper._MSAAFramebuffer = framebuffer, this._bindUnboundFramebuffer(framebuffer);const attachments = [];for (let i = 0; i < count; i++) {const texture = rtWrapper.textures[i],hardwareTexture = texture._hardwareTexture,attachment = gl[1 < this.webGLVersion ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"],colorRenderbuffer = hardwareTexture._MSAARenderBuffer ? this._updateRenderBuffer(hardwareTexture._MSAARenderBuffer, texture.width, texture.height, samples, -1, this._getRGBAMultiSampleBufferFormat(texture.type), attachment) : this._createRenderBuffer(texture.width, texture.height, samples, -1, this._getRGBAMultiSampleBufferFormat(texture.type), attachment);if (!colorRenderbuffer) throw new Error("Unable to create multi sampled framebuffer");hardwareTexture._MSAARenderBuffer = colorRenderbuffer, texture.samples = samples, attachments.push(attachment);}initializeBuffers && gl.drawBuffers(attachments);} else this._bindUnboundFramebuffer(rtWrapper._framebuffer);return useDepthStencil && (rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.texture.width, rtWrapper.texture.height, samples)), this._bindUnboundFramebuffer(null), samples;};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.cubeTexture.js
var engine_cubeTexture = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.cubeTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.textureSampler.js
thinEngine/* ThinEngine.prototype.setTextureSampler */.B.prototype.setTextureSampler = function () {throw new Error("setTextureSampler: This engine does not support separate texture sampler objects!");};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.uniformBuffer.js
var engine_uniformBuffer = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.uniformBuffer.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.views.js
class EngineView {}const _onBeforeViewRenderObservable = new observable/* Observable */.y$(),_onAfterViewRenderObservable = new observable/* Observable */.y$();Object.defineProperty(engine/* Engine.prototype */.D.prototype, "onBeforeViewRenderObservable", { get: function () {return _onBeforeViewRenderObservable;} }), Object.defineProperty(engine/* Engine.prototype */.D.prototype, "onAfterViewRenderObservable", { get: function () {return _onAfterViewRenderObservable;} }), Object.defineProperty(engine/* Engine.prototype */.D.prototype, "inputElement", { get: function () {return this._inputElement;}, set: function (value) {var _a;this._inputElement !== value && (this._inputElement = value, null === (_a = this._onEngineViewChanged) || void 0 === _a ? void 0 : _a.call(this));} }), engine/* Engine.prototype.getInputElement */.D.prototype.getInputElement = function () {return this.inputElement || this.getRenderingCanvas();}, engine/* Engine.prototype.registerView */.D.prototype.registerView = function (canvas, camera, clearBeforeCopy) {this.views || (this.views = []);for (const view of this.views) if (view.target === canvas) return view;const masterCanvas = this.getRenderingCanvas();masterCanvas && (canvas.width = masterCanvas.width, canvas.height = masterCanvas.height);const newView = { target: canvas, camera, clearBeforeCopy, enabled: !0, id: (1e5 * Math.random()).toFixed() };return this.views.push(newView), camera && camera.onDisposeObservable.add(() => {this.unRegisterView(canvas);}), newView;}, engine/* Engine.prototype.unRegisterView */.D.prototype.unRegisterView = function (canvas) {if (!this.views || 0 === this.views.length) return this;for (const view of this.views) if (view.target === canvas) {const index = this.views.indexOf(view);-1 !== index && this.views.splice(index, 1);break;}return this;}, engine/* Engine.prototype._renderViewStep */.D.prototype._renderViewStep = function (view) {const canvas = view.target,context = canvas.getContext("2d");if (!context) return !0;const parent = this.getRenderingCanvas();_onBeforeViewRenderObservable.notifyObservers(view);const camera = view.camera;let previewCamera = null,scene = null;if (camera) {if (scene = camera.getScene(), !scene || scene.activeCameras && scene.activeCameras.length) return !0;this.activeView = view, previewCamera = scene.activeCamera, scene.activeCamera = camera;}if (view.customResize) view.customResize(canvas);else {const width = Math.floor(canvas.clientWidth / this._hardwareScalingLevel),height = Math.floor(canvas.clientHeight / this._hardwareScalingLevel),dimsChanged = width !== canvas.width || parent.width !== canvas.width || height !== canvas.height || parent.height !== canvas.height;canvas.clientWidth && canvas.clientHeight && dimsChanged && (canvas.width = width, canvas.height = height, this.setSize(width, height));}return !!(parent.width && parent.height) && (this._renderFrame(), this.flushFramebuffer(), view.clearBeforeCopy && context.clearRect(0, 0, parent.width, parent.height), context.drawImage(parent, 0, 0), previewCamera && scene && (scene.activeCamera = previewCamera), _onAfterViewRenderObservable.notifyObservers(view), !0);}, engine/* Engine.prototype._renderViews */.D.prototype._renderViews = function () {if (!this.views || 0 === this.views.length) return !1;const parent = this.getRenderingCanvas();if (!parent) return !1;let inputElementView;for (const view of this.views) {if (!view.enabled) continue;const canvas = view.target;if (canvas === this.inputElement) {inputElementView = view;continue;}if (!this._renderViewStep(view)) return !1;}return (!inputElementView || this._renderViewStep(inputElementView)) && (this.activeView = null, !0);};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.readTexture.js
var engine_readTexture = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.readTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.storageBuffer.js
thinEngine/* ThinEngine.prototype.createStorageBuffer */.B.prototype.createStorageBuffer = function () {throw new Error("createStorageBuffer: Unsupported method in this engine!");}, thinEngine/* ThinEngine.prototype.updateStorageBuffer */.B.prototype.updateStorageBuffer = function () {}, thinEngine/* ThinEngine.prototype.readFromStorageBuffer */.B.prototype.readFromStorageBuffer = function () {throw new Error("readFromStorageBuffer: Unsupported method in this engine!");}, thinEngine/* ThinEngine.prototype.setStorageBuffer */.B.prototype.setStorageBuffer = function () {throw new Error("setStorageBuffer: Unsupported method in this engine!");};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.textureSelector.js
function transformTextureUrl(url) {if (this._excludedCompressedTextures && this._excludedCompressedTextures.some((entry) => {return url && (url === entry || url.match(new RegExp("\\b" + entry + "\\b", "g")));})) return url;const lastDot = url.lastIndexOf("."),lastQuestionMark = url.lastIndexOf("?"),querystring = -1 < lastQuestionMark ? url.substring(lastQuestionMark, url.length) : "";return (-1 < lastDot ? url.substring(0, lastDot) : url) + this._textureFormatInUse + querystring;}Object.defineProperty(engine/* Engine.prototype */.D.prototype, "texturesSupported", { get: function () {const texturesSupported = [];return this._caps.astc && texturesSupported.push("-astc.ktx"), this._caps.s3tc && texturesSupported.push("-dxt.ktx"), this._caps.pvrtc && texturesSupported.push("-pvrtc.ktx"), this._caps.etc2 && texturesSupported.push("-etc2.ktx"), this._caps.etc1 && texturesSupported.push("-etc1.ktx"), texturesSupported;}, enumerable: !0, configurable: !0 }), Object.defineProperty(engine/* Engine.prototype */.D.prototype, "textureFormatInUse", { get: function () {return this._textureFormatInUse || null;}, enumerable: !0, configurable: !0 }), engine/* Engine.prototype.setCompressedTextureExclusions */.D.prototype.setCompressedTextureExclusions = function (skippedFiles) {this._excludedCompressedTextures = skippedFiles;}, engine/* Engine.prototype.setTextureFormatToUse */.D.prototype.setTextureFormatToUse = function (formatsAvailable) {const texturesSupported = this.texturesSupported;for (let i = 0, len1 = texturesSupported.length; i < len1; i++) for (let j = 0, len2 = formatsAvailable.length; j < len2; j++) if (texturesSupported[i] === formatsAvailable[j].toLowerCase()) return this._transformTextureUrl = transformTextureUrl.bind(this), this._textureFormatInUse = texturesSupported[i];return this._textureFormatInUse = "", this._transformTextureUrl = null, null;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Native/nativeDataStream.js
class NativeDataStream {constructor() {const buffer = new ArrayBuffer(NativeDataStream.DEFAULT_BUFFER_SIZE);this._uint32s = new Uint32Array(buffer), this._int32s = new Int32Array(buffer), this._float32s = new Float32Array(buffer), this._length = NativeDataStream.DEFAULT_BUFFER_SIZE / 4, this._position = 0, this._nativeDataStream = new _native.NativeDataStream(() => {this._flush();});}writeUint32(value) {this._flushIfNecessary(1), this._uint32s[this._position++] = value;}writeInt32(value) {this._flushIfNecessary(1), this._int32s[this._position++] = value;}writeFloat32(value) {this._flushIfNecessary(1), this._float32s[this._position++] = value;}writeUint32Array(values) {this._flushIfNecessary(1 + values.length), this._uint32s[this._position++] = values.length, this._uint32s.set(values, this._position), this._position += values.length;}writeInt32Array(values) {this._flushIfNecessary(1 + values.length), this._uint32s[this._position++] = values.length, this._int32s.set(values, this._position), this._position += values.length;}writeFloat32Array(values) {this._flushIfNecessary(1 + values.length), this._uint32s[this._position++] = values.length, this._float32s.set(values, this._position), this._position += values.length;}writeNativeData(handle) {this._flushIfNecessary(handle.length), this._uint32s.set(handle, this._position), this._position += handle.length;}writeBoolean(value) {this.writeUint32(value ? 1 : 0);}_flushIfNecessary(required) {this._position + required > this._length && this._flush();}_flush() {this._nativeDataStream.writeBuffer(this._uint32s.buffer, this._position), this._position = 0;}}NativeDataStream.DEFAULT_BUFFER_SIZE = 65536;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/environmentTextureTools.js + 1 modules
var environmentTextureTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/environmentTextureTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/codeStringParsingTools.js
function ExtractBetweenMarkers(markerOpen, markerClose, block, startIndex) {let currPos = startIndex,openMarkers = 0,waitForChar = "";for (; currPos < block.length;) {const currChar = block.charAt(currPos);if (!waitForChar) switch (currChar) {case markerOpen:openMarkers++;break;case markerClose:openMarkers--;break;case "\"":case "'":case "`":waitForChar = currChar;break;case "/":if (currPos + 1 < block.length) {const nextChar = block.charAt(currPos + 1);"/" === nextChar ? waitForChar = "\n" : "*" === nextChar && (waitForChar = "*/");}} else currChar === waitForChar ? "\"" === waitForChar || "'" === waitForChar ? "\\" !== block.charAt(currPos - 1) && (waitForChar = "") : waitForChar = "" : "*/" === waitForChar && "*" === currChar && currPos + 1 < block.length && ("/" === block.charAt(currPos + 1) && (waitForChar = ""), "" === waitForChar && currPos++);if (currPos++, 0 === openMarkers) break;}return 0 == openMarkers ? currPos - 1 : -1;}function SkipWhitespaces(s, index) {for (; index < s.length;) {const c = s[index];if (" " !== c && "\n" !== c && "\r" !== c && "\t" !== c && "\n" !== c && "\xA0" !== c) break;index++;}return index;}function IsIdentifierChar(c) {const v = c.charCodeAt(0);return 48 <= v && 57 >= v || 65 <= v && 90 >= v || 97 <= v && 122 >= v || 95 == v;}function RemoveComments(block) {let currPos = 0,waitForChar = "",inComments = !1;const s = [];for (; currPos < block.length;) {const currChar = block.charAt(currPos);if (!waitForChar) {switch (currChar) {case "\"":case "'":case "`":waitForChar = currChar;break;case "/":if (currPos + 1 < block.length) {const nextChar = block.charAt(currPos + 1);"/" === nextChar ? (waitForChar = "\n", inComments = !0) : "*" === nextChar && (waitForChar = "*/", inComments = !0);}}inComments || s.push(currChar);} else currChar === waitForChar ? "\"" === waitForChar || "'" === waitForChar ? ("\\" !== block.charAt(currPos - 1) && (waitForChar = ""), s.push(currChar)) : (waitForChar = "", inComments = !1) : "*/" === waitForChar && "*" === currChar && currPos + 1 < block.length ? ("/" === block.charAt(currPos + 1) && (waitForChar = ""), "" === waitForChar && (inComments = !1, currPos++)) : !inComments && s.push(currChar);currPos++;}return s.join("");}function FindBackward(s, index, c) {for (; 0 <= index && s.charAt(index) !== c;) index--;return index;}function EscapeRegExp(s) {return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeInliner.js
class ShaderCodeInliner {get code() {return this._sourceCode;}constructor(sourceCode, numMaxIterations = 20) {this.debug = !1, this._sourceCode = sourceCode, this._numMaxIterations = numMaxIterations, this._functionDescr = [], this.inlineToken = "#define inline";}processCode() {this.debug && console.log(`Start inlining process (code size=${this._sourceCode.length})...`), this._collectFunctions(), this._processInlining(this._numMaxIterations), this.debug && console.log("End of inlining process.");}_collectFunctions() {for (let startIndex = 0; startIndex < this._sourceCode.length;) {const inlineTokenIndex = this._sourceCode.indexOf(this.inlineToken, startIndex);if (0 > inlineTokenIndex) break;const funcParamsStartIndex = this._sourceCode.indexOf("(", inlineTokenIndex + this.inlineToken.length);if (0 > funcParamsStartIndex) {this.debug && console.warn(`Could not find the opening parenthesis after the token. startIndex=${startIndex}`), startIndex = inlineTokenIndex + this.inlineToken.length;continue;}const funcNameMatch = ShaderCodeInliner._RegexpFindFunctionNameAndType.exec(this._sourceCode.substring(inlineTokenIndex + this.inlineToken.length, funcParamsStartIndex));if (!funcNameMatch) {this.debug && console.warn(`Could not extract the name/type of the function from: ${this._sourceCode.substring(inlineTokenIndex + this.inlineToken.length, funcParamsStartIndex)}`), startIndex = inlineTokenIndex + this.inlineToken.length;continue;}const [funcType, funcName] = [funcNameMatch[3], funcNameMatch[4]],funcParamsEndIndex = ExtractBetweenMarkers("(", ")", this._sourceCode, funcParamsStartIndex);if (0 > funcParamsEndIndex) {this.debug && console.warn(`Could not extract the parameters the function '${funcName}' (type=${funcType}). funcParamsStartIndex=${funcParamsStartIndex}`), startIndex = inlineTokenIndex + this.inlineToken.length;continue;}const funcParams = this._sourceCode.substring(funcParamsStartIndex + 1, funcParamsEndIndex),funcBodyStartIndex = SkipWhitespaces(this._sourceCode, funcParamsEndIndex + 1);if (funcBodyStartIndex === this._sourceCode.length) {this.debug && console.warn(`Could not extract the body of the function '${funcName}' (type=${funcType}). funcParamsEndIndex=${funcParamsEndIndex}`), startIndex = inlineTokenIndex + this.inlineToken.length;continue;}const funcBodyEndIndex = ExtractBetweenMarkers("{", "}", this._sourceCode, funcBodyStartIndex);if (0 > funcBodyEndIndex) {this.debug && console.warn(`Could not extract the body of the function '${funcName}' (type=${funcType}). funcBodyStartIndex=${funcBodyStartIndex}`), startIndex = inlineTokenIndex + this.inlineToken.length;continue;}const funcBody = this._sourceCode.substring(funcBodyStartIndex, funcBodyEndIndex + 1),params = RemoveComments(funcParams).split(","),paramNames = [];for (let p = 0; p < params.length; ++p) {const param = params[p].trim(),idx = param.lastIndexOf(" ");0 <= idx && paramNames.push(param.substring(idx + 1));}"void" !== funcType && paramNames.push("return"), this._functionDescr.push({ name: funcName, type: funcType, parameters: paramNames, body: funcBody, callIndex: 0 }), startIndex = funcBodyEndIndex + 1;const partBefore = 0 < inlineTokenIndex ? this._sourceCode.substring(0, inlineTokenIndex) : "",partAfter = funcBodyEndIndex + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(funcBodyEndIndex + 1) : "";this._sourceCode = partBefore + partAfter, startIndex -= funcBodyEndIndex + 1 - inlineTokenIndex;}this.debug && console.log(`Collect functions: ${this._functionDescr.length} functions found. functionDescr=`, this._functionDescr);}_processInlining(numMaxIterations = 20) {for (; 0 <= numMaxIterations-- && !!this._replaceFunctionCallsByCode(););return this.debug && console.log(`numMaxIterations is ${numMaxIterations} after inlining process`), 0 <= numMaxIterations;}_replaceFunctionCallsByCode() {let doAgain = !1;for (const func of this._functionDescr) {const { name, type, parameters, body } = func;for (let startIndex = 0; startIndex < this._sourceCode.length;) {const functionCallIndex = this._sourceCode.indexOf(name, startIndex);if (0 > functionCallIndex) break;if (0 === functionCallIndex || IsIdentifierChar(this._sourceCode.charAt(functionCallIndex - 1))) {startIndex = functionCallIndex + name.length;continue;}const callParamsStartIndex = SkipWhitespaces(this._sourceCode, functionCallIndex + name.length);if (callParamsStartIndex === this._sourceCode.length || "(" !== this._sourceCode.charAt(callParamsStartIndex)) {startIndex = functionCallIndex + name.length;continue;}const callParamsEndIndex = ExtractBetweenMarkers("(", ")", this._sourceCode, callParamsStartIndex);if (0 > callParamsEndIndex) {this.debug && console.warn(`Could not extract the parameters of the function call. Function '${name}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}`), startIndex = functionCallIndex + name.length;continue;}const callParams = this._sourceCode.substring(callParamsStartIndex + 1, callParamsEndIndex),params = ((s) => {const parameters = [];let curIdx = 0,startParamIdx = 0;for (; curIdx < s.length;) {if ("(" === s.charAt(curIdx)) {const idx2 = ExtractBetweenMarkers("(", ")", s, curIdx);if (0 > idx2) return null;curIdx = idx2;} else "," === s.charAt(curIdx) && (parameters.push(s.substring(startParamIdx, curIdx)), startParamIdx = curIdx + 1);curIdx++;}return startParamIdx < curIdx && parameters.push(s.substring(startParamIdx, curIdx)), parameters;})(RemoveComments(callParams));if (null === params) {this.debug && console.warn(`Invalid function call: can't extract the parameters of the function call. Function '${name}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}, callParams=` + callParams), startIndex = functionCallIndex + name.length;continue;}const paramNames = [];for (let p = 0; p < params.length; ++p) {const param = params[p].trim();paramNames.push(param);}const retParamName = "void" === type ? null : name + "_" + func.callIndex++;if (retParamName && paramNames.push(retParamName + " ="), paramNames.length !== parameters.length) {this.debug && console.warn(`Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '${name}' (type=${type}). function parameters=${parameters}, call parameters=${paramNames}`), startIndex = functionCallIndex + name.length;continue;}startIndex = callParamsEndIndex + 1;const funcBody = this._replaceNames(body, parameters, paramNames);let partBefore = 0 < functionCallIndex ? this._sourceCode.substring(0, functionCallIndex) : "";const partAfter = callParamsEndIndex + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(callParamsEndIndex + 1) : "";if (retParamName) {const injectDeclarationIndex = FindBackward(this._sourceCode, functionCallIndex - 1, "\n");partBefore = this._sourceCode.substring(0, injectDeclarationIndex + 1);const partBetween = this._sourceCode.substring(injectDeclarationIndex + 1, functionCallIndex);this._sourceCode = partBefore + type + " " + retParamName + ";\n" + funcBody + "\n" + partBetween + retParamName + partAfter, this.debug && console.log(`Replace function call by code. Function '${name}' (type=${type}). injectDeclarationIndex=${injectDeclarationIndex}, call parameters=${paramNames}`);} else this._sourceCode = partBefore + funcBody + partAfter, startIndex += funcBody.length - (callParamsEndIndex + 1 - functionCallIndex), this.debug && console.log(`Replace function call by code. Function '${name}' (type=${type}). functionCallIndex=${functionCallIndex}, call parameters=${paramNames}`);doAgain = !0;}}return doAgain;}_replaceNames(code, sources, destinations) {for (let i = 0; i < sources.length; ++i) {const source = new RegExp(EscapeRegExp(sources[i]), "g"),sourceLen = sources[i].length,destination = destinations[i];code = code.replace(source, (match, ...args) => {const offset = args[0];return IsIdentifierChar(code.charAt(offset - 1)) || IsIdentifierChar(code.charAt(offset + sourceLen)) ? sources[i] : destination;});}return code;}}ShaderCodeInliner._RegexpFindFunctionNameAndType = /((\s+?)(\w+)\s+(\w+)\s*?)$/;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGL2ShaderProcessors.js
var webGL2ShaderProcessors = __webpack_require__("./node_modules/@babylonjs/core/Engines/WebGL/webGL2ShaderProcessors.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/error.js
var error = __webpack_require__("./node_modules/@babylonjs/core/Misc/error.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Native/nativePipelineContext.js
class NativePipelineContext {_getVertexShaderCode() {return null;}_getFragmentShaderCode() {return null;}_handlesSpectorRebuildCallback() {throw new Error("Not implemented");}constructor(engine) {this.isAsync = !1, this.isReady = !1, this._valueCache = {}, this._engine = engine;}_fillEffectInformation(effect, uniformBuffersNames, uniformsNames, uniforms, samplerList, samplers, attributesNames, attributes) {const engine = this._engine;if (engine.supportsUniformBuffers) for (const name in uniformBuffersNames) effect.bindUniformBlock(name, uniformBuffersNames[name]);const effectAvailableUniforms = this._engine.getUniforms(this, uniformsNames);effectAvailableUniforms.forEach((uniform, index) => {uniforms[uniformsNames[index]] = uniform;}), this._uniforms = uniforms;let index;for (index = 0; index < samplerList.length; index++) {const sampler = effect.getUniform(samplerList[index]);null == sampler && (samplerList.splice(index, 1), index--);}samplerList.forEach((name, index) => {samplers[name] = index;}), attributes.push(...engine.getAttributes(this, attributesNames));}dispose() {this._uniforms = {};}_cacheMatrix(uniformName, matrix) {const cache = this._valueCache[uniformName],flag = matrix.updateFlag;return (void 0 === cache || cache !== flag) && (this._valueCache[uniformName] = flag, !0);}_cacheFloat2(uniformName, x, y) {let cache = this._valueCache[uniformName];if (!cache) return cache = [x, y], this._valueCache[uniformName] = cache, !0;let changed = !1;return cache[0] !== x && (cache[0] = x, changed = !0), cache[1] !== y && (cache[1] = y, changed = !0), changed;}_cacheFloat3(uniformName, x, y, z) {let cache = this._valueCache[uniformName];if (!cache) return cache = [x, y, z], this._valueCache[uniformName] = cache, !0;let changed = !1;return cache[0] !== x && (cache[0] = x, changed = !0), cache[1] !== y && (cache[1] = y, changed = !0), cache[2] !== z && (cache[2] = z, changed = !0), changed;}_cacheFloat4(uniformName, x, y, z, w) {let cache = this._valueCache[uniformName];if (!cache) return cache = [x, y, z, w], this._valueCache[uniformName] = cache, !0;let changed = !1;return cache[0] !== x && (cache[0] = x, changed = !0), cache[1] !== y && (cache[1] = y, changed = !0), cache[2] !== z && (cache[2] = z, changed = !0), cache[3] !== w && (cache[3] = w, changed = !0), changed;}setInt(uniformName, value) {const cache = this._valueCache[uniformName];void 0 !== cache && cache === value || this._engine.setInt(this._uniforms[uniformName], value) && (this._valueCache[uniformName] = value);}setInt2(uniformName, x, y) {this._cacheFloat2(uniformName, x, y) && !this._engine.setInt2(this._uniforms[uniformName], x, y) && (this._valueCache[uniformName] = null);}setInt3(uniformName, x, y, z) {this._cacheFloat3(uniformName, x, y, z) && !this._engine.setInt3(this._uniforms[uniformName], x, y, z) && (this._valueCache[uniformName] = null);}setInt4(uniformName, x, y, z, w) {this._cacheFloat4(uniformName, x, y, z, w) && !this._engine.setInt4(this._uniforms[uniformName], x, y, z, w) && (this._valueCache[uniformName] = null);}setIntArray(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setIntArray(this._uniforms[uniformName], array);}setIntArray2(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setIntArray2(this._uniforms[uniformName], array);}setIntArray3(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setIntArray3(this._uniforms[uniformName], array);}setIntArray4(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setIntArray4(this._uniforms[uniformName], array);}setUInt(uniformName, value) {const cache = this._valueCache[uniformName];void 0 !== cache && cache === value || this._engine.setUInt(this._uniforms[uniformName], value) && (this._valueCache[uniformName] = value);}setUInt2(uniformName, x, y) {this._cacheFloat2(uniformName, x, y) && !this._engine.setUInt2(this._uniforms[uniformName], x, y) && (this._valueCache[uniformName] = null);}setUInt3(uniformName, x, y, z) {this._cacheFloat3(uniformName, x, y, z) && !this._engine.setUInt3(this._uniforms[uniformName], x, y, z) && (this._valueCache[uniformName] = null);}setUInt4(uniformName, x, y, z, w) {this._cacheFloat4(uniformName, x, y, z, w) && !this._engine.setUInt4(this._uniforms[uniformName], x, y, z, w) && (this._valueCache[uniformName] = null);}setUIntArray(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setUIntArray(this._uniforms[uniformName], array);}setUIntArray2(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setUIntArray2(this._uniforms[uniformName], array);}setUIntArray3(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setUIntArray3(this._uniforms[uniformName], array);}setUIntArray4(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setUIntArray4(this._uniforms[uniformName], array);}setFloatArray(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setFloatArray(this._uniforms[uniformName], array);}setFloatArray2(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setFloatArray2(this._uniforms[uniformName], array);}setFloatArray3(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setFloatArray3(this._uniforms[uniformName], array);}setFloatArray4(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setFloatArray4(this._uniforms[uniformName], array);}setArray(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setArray(this._uniforms[uniformName], array);}setArray2(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setArray2(this._uniforms[uniformName], array);}setArray3(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setArray3(this._uniforms[uniformName], array);}setArray4(uniformName, array) {this._valueCache[uniformName] = null, this._engine.setArray4(this._uniforms[uniformName], array);}setMatrices(uniformName, matrices) {matrices && (this._valueCache[uniformName] = null, this._engine.setMatrices(this._uniforms[uniformName], matrices));}setMatrix(uniformName, matrix) {this._cacheMatrix(uniformName, matrix) && !this._engine.setMatrices(this._uniforms[uniformName], matrix.toArray()) && (this._valueCache[uniformName] = null);}setMatrix3x3(uniformName, matrix) {this._valueCache[uniformName] = null, this._engine.setMatrix3x3(this._uniforms[uniformName], matrix);}setMatrix2x2(uniformName, matrix) {this._valueCache[uniformName] = null, this._engine.setMatrix2x2(this._uniforms[uniformName], matrix);}setFloat(uniformName, value) {const cache = this._valueCache[uniformName];void 0 !== cache && cache === value || this._engine.setFloat(this._uniforms[uniformName], value) && (this._valueCache[uniformName] = value);}setBool(uniformName, bool) {const cache = this._valueCache[uniformName];void 0 !== cache && cache === bool || this._engine.setInt(this._uniforms[uniformName], bool ? 1 : 0) && (this._valueCache[uniformName] = bool ? 1 : 0);}setVector2(uniformName, vector2) {this._cacheFloat2(uniformName, vector2.x, vector2.y) && !this._engine.setFloat2(this._uniforms[uniformName], vector2.x, vector2.y) && (this._valueCache[uniformName] = null);}setFloat2(uniformName, x, y) {this._cacheFloat2(uniformName, x, y) && !this._engine.setFloat2(this._uniforms[uniformName], x, y) && (this._valueCache[uniformName] = null);}setVector3(uniformName, vector3) {this._cacheFloat3(uniformName, vector3.x, vector3.y, vector3.z) && !this._engine.setFloat3(this._uniforms[uniformName], vector3.x, vector3.y, vector3.z) && (this._valueCache[uniformName] = null);}setFloat3(uniformName, x, y, z) {this._cacheFloat3(uniformName, x, y, z) && !this._engine.setFloat3(this._uniforms[uniformName], x, y, z) && (this._valueCache[uniformName] = null);}setVector4(uniformName, vector4) {this._cacheFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w) && !this._engine.setFloat4(this._uniforms[uniformName], vector4.x, vector4.y, vector4.z, vector4.w) && (this._valueCache[uniformName] = null);}setQuaternion(uniformName, quaternion) {this._cacheFloat4(uniformName, quaternion.x, quaternion.y, quaternion.z, quaternion.w) && !this._engine.setFloat4(this._uniforms[uniformName], quaternion.x, quaternion.y, quaternion.z, quaternion.w) && (this._valueCache[uniformName] = null);}setFloat4(uniformName, x, y, z, w) {this._cacheFloat4(uniformName, x, y, z, w) && !this._engine.setFloat4(this._uniforms[uniformName], x, y, z, w) && (this._valueCache[uniformName] = null);}setColor3(uniformName, color3) {this._cacheFloat3(uniformName, color3.r, color3.g, color3.b) && !this._engine.setFloat3(this._uniforms[uniformName], color3.r, color3.g, color3.b) && (this._valueCache[uniformName] = null);}setColor4(uniformName, color3, alpha) {this._cacheFloat4(uniformName, color3.r, color3.g, color3.b, alpha) && !this._engine.setFloat4(this._uniforms[uniformName], color3.r, color3.g, color3.b, alpha) && (this._valueCache[uniformName] = null);}setDirectColor4(uniformName, color4) {this._cacheFloat4(uniformName, color4.r, color4.g, color4.b, color4.a) && !this._engine.setFloat4(this._uniforms[uniformName], color4.r, color4.g, color4.b, color4.a) && (this._valueCache[uniformName] = null);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Native/nativeRenderTargetWrapper.js
class NativeRenderTargetWrapper extends renderTargetWrapper/* RenderTargetWrapper */.r {get _framebuffer() {return this.__framebuffer;}set _framebuffer(framebuffer) {this.__framebuffer && this._engine._releaseFramebufferObjects(this.__framebuffer), this.__framebuffer = framebuffer;}get _framebufferDepthStencil() {return this.__framebufferDepthStencil;}set _framebufferDepthStencil(framebufferDepthStencil) {this.__framebufferDepthStencil && this._engine._releaseFramebufferObjects(this.__framebufferDepthStencil), this.__framebufferDepthStencil = framebufferDepthStencil;}constructor(isMulti, isCube, size, engine) {super(isMulti, isCube, size, engine), this.__framebuffer = null, this.__framebufferDepthStencil = null, this._engine = engine;}dispose(disposeOnlyFramebuffers = !1) {this._framebuffer = null, this._framebufferDepthStencil = null, super.dispose(disposeOnlyFramebuffers);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Native/nativeHardwareTexture.js
class NativeHardwareTexture {get underlyingResource() {return this._nativeTexture;}constructor(existingTexture, engine) {this._engine = engine, this.set(existingTexture);}setUsage() {}set(hardwareTexture) {this._nativeTexture = hardwareTexture;}reset() {this._nativeTexture = null;}release() {this._nativeTexture && this._engine.deleteTexture(this._nativeTexture), this.reset();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/nativeEngine.js
const onNativeObjectInitialized = new observable/* Observable */.y$();if ("undefined" != typeof self && !Object.prototype.hasOwnProperty.call(self, "_native")) {let __native;Object.defineProperty(self, "_native", { get: () => __native, set: (value) => {__native = value, __native && onNativeObjectInitialized.notifyObservers(__native);} });}function AcquireNativeObjectAsync() {return new Promise((resolve) => {"undefined" == typeof _native ? onNativeObjectInitialized.addOnce((nativeObject) => resolve(nativeObject)) : resolve(_native);});}async function RegisterNativeTypeAsync(typeName, constructor) {(await AcquireNativeObjectAsync())[typeName] = constructor;}class NativeDataBuffer extends dataBuffer/* DataBuffer */.h {}class CommandBufferEncoder {constructor(_engine) {this._engine = _engine, this._pending = [], this._isCommandBufferScopeActive = !1, this._commandStream = NativeEngine._createNativeDataStream(), this._engine.setCommandDataStream(this._commandStream);}beginCommandScope() {if (this._isCommandBufferScopeActive) throw new Error("Command scope already active.");this._isCommandBufferScopeActive = !0;}endCommandScope() {if (!this._isCommandBufferScopeActive) throw new Error("Command scope is not active.");this._isCommandBufferScopeActive = !1, this._submit();}startEncodingCommand(command) {this._commandStream.writeNativeData(command);}encodeCommandArgAsUInt32(commandArg) {this._commandStream.writeUint32(commandArg);}encodeCommandArgAsUInt32s(commandArg) {this._commandStream.writeUint32Array(commandArg);}encodeCommandArgAsInt32(commandArg) {this._commandStream.writeInt32(commandArg);}encodeCommandArgAsInt32s(commandArg) {this._commandStream.writeInt32Array(commandArg);}encodeCommandArgAsFloat32(commandArg) {this._commandStream.writeFloat32(commandArg);}encodeCommandArgAsFloat32s(commandArg) {this._commandStream.writeFloat32Array(commandArg);}encodeCommandArgAsNativeData(commandArg) {this._commandStream.writeNativeData(commandArg), this._pending.push(commandArg);}finishEncodingCommand() {this._isCommandBufferScopeActive || this._submit();}_submit() {this._engine.submitCommands(), this._pending.length = 0;}}class NativeEngine extends engine/* Engine */.D {getHardwareScalingLevel() {return this._engine.getHardwareScalingLevel();}setHardwareScalingLevel(level) {this._engine.setHardwareScalingLevel(level);}constructor(options = {}) {if (super(null, !1, void 0, options.adaptToDeviceRatio), this._engine = new _native.Engine(), this._camera = _native.Camera ? new _native.Camera() : null, this._commandBufferEncoder = new CommandBufferEncoder(this._engine), this._boundBuffersVertexArray = null, this._currentDepthTest = _native.Engine.DEPTH_TEST_LEQUAL, this._stencilTest = !1, this._stencilMask = 255, this._stencilFunc = 519, this._stencilFuncRef = 0, this._stencilFuncMask = 255, this._stencilOpStencilFail = 7680, this._stencilOpDepthFail = 7680, this._stencilOpStencilDepthPass = 7681, this._zOffset = 0, this._zOffsetUnits = 0, this._depthWrite = !0, _native.Engine.PROTOCOL_VERSION !== NativeEngine.PROTOCOL_VERSION) throw new Error(`Protocol version mismatch: ${_native.Engine.PROTOCOL_VERSION} (Native) !== ${NativeEngine.PROTOCOL_VERSION} (JS)`);this._webGLVersion = 2, this.disableUniformBuffers = !0, this._shaderPlatformName = "NATIVE", this._caps = { maxTexturesImageUnits: 16, maxVertexTextureImageUnits: 16, maxCombinedTexturesImageUnits: 32, maxTextureSize: _native.Engine.CAPS_LIMITS_MAX_TEXTURE_SIZE, maxCubemapTextureSize: 512, maxRenderTextureSize: 512, maxVertexAttribs: 16, maxVaryingVectors: 16, maxFragmentUniformVectors: 16, maxVertexUniformVectors: 16, standardDerivatives: !0, astc: null, pvrtc: null, etc1: null, etc2: null, bptc: null, maxAnisotropy: 16, uintIndices: !0, fragmentDepthSupported: !1, highPrecisionShaderSupported: !0, colorBufferFloat: !1, textureFloat: !0, textureFloatLinearFiltering: !1, textureFloatRender: !1, textureHalfFloat: !1, textureHalfFloatLinearFiltering: !1, textureHalfFloatRender: !1, textureLOD: !0, drawBuffersExtension: !1, depthTextureExtension: !1, vertexArrayObject: !0, instancedArrays: !0, supportOcclusionQuery: !1, canUseTimestampForTimerQuery: !1, blendMinMax: !1, maxMSAASamples: 1, canUseGLInstanceID: !0, canUseGLVertexID: !0, supportComputeShaders: !1, supportSRGBBuffers: !0, supportTransformFeedbacks: !1, textureMaxLevel: !1, texture2DArrayMaxLayerCount: _native.Engine.CAPS_LIMITS_MAX_TEXTURE_LAYERS }, this._features = { forceBitmapOverHTMLImageElement: !1, supportRenderAndCopyToLodForFloatTextures: !1, supportDepthStencilTexture: !1, supportShadowSamplers: !1, uniformBufferHardCheckMatrix: !1, allowTexturePrefiltering: !1, trackUbosInFrame: !1, checkUbosContentBeforeUpload: !1, supportCSM: !1, basisNeedsPOT: !1, support3DTextures: !1, needTypeSuffixInShaderConstants: !1, supportMSAA: !1, supportSSAO2: !1, supportExtendedTextureFormats: !1, supportSwitchCaseInShader: !1, supportSyncTextureRead: !1, needsInvertingBitmap: !0, useUBOBindingCache: !0, needShaderCodeInlining: !0, needToAlwaysBindUniformBuffers: !1, supportRenderPasses: !0, supportSpriteInstancing: !1, _collectUbosUpdatedInFrame: !1 }, tools/* Tools.Log */.w1.Log("Babylon Native (v" + engine/* Engine.Version */.D.Version + ") launched"), tools/* Tools.LoadScript */.w1.LoadScript = function (scriptUrl, onSuccess, onError) {tools/* Tools.LoadFile */.w1.LoadFile(scriptUrl, (data) => {Function(data).apply(null), onSuccess && onSuccess();}, void 0, void 0, !1, (request, exception) => {onError && onError("LoadScript Error", exception);});}, "undefined" == typeof URL && (window.URL = { createObjectURL: function () {}, revokeObjectURL: function () {} }), "undefined" == typeof Blob && (window.Blob = function (v) {return v;}), Array.prototype.flat || Object.defineProperty(Array.prototype, "flat", { configurable: !0, value: function flat() {const depth = isNaN(arguments[0]) ? 1 : +arguments[0];return depth ? Array.prototype.reduce.call(this, function (acc, cur) {return Array.isArray(cur) ? acc.push.apply(acc, flat.call(cur, depth - 1)) : acc.push(cur), acc;}, []) : Array.prototype.slice.call(this);}, writable: !0 });const devicePixelRatio = window ? window.devicePixelRatio || 1 : 1;this._hardwareScalingLevel = options.adaptToDeviceRatio ? devicePixelRatio : 1, this.resize();const currentDepthFunction = this.getDepthFunction();currentDepthFunction && this.setDepthFunction(currentDepthFunction), this._shaderProcessor = new webGL2ShaderProcessors/* WebGL2ShaderProcessor */.C(), this.onNewSceneAddedObservable.add((scene) => {const originalRender = scene.render;scene.render = (...args) => {this._commandBufferEncoder.beginCommandScope(), originalRender.apply(scene, args), this._commandBufferEncoder.endCommandScope();};});}dispose() {super.dispose(), this._boundBuffersVertexArray && this._deleteVertexArray(this._boundBuffersVertexArray), this._engine.dispose();}static _createNativeDataStream() {return new NativeDataStream();}_queueNewFrame(bindedRenderFunction, requester) {return requester.requestAnimationFrame && requester !== window ? requester.requestAnimationFrame(bindedRenderFunction) : this._engine.requestAnimationFrame(bindedRenderFunction), 0;}_bindUnboundFramebuffer(framebuffer) {this._currentFramebuffer !== framebuffer && (this._currentFramebuffer && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_UNBINDFRAMEBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(this._currentFramebuffer), this._commandBufferEncoder.finishEncodingCommand()), framebuffer && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_BINDFRAMEBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(framebuffer), this._commandBufferEncoder.finishEncodingCommand()), this._currentFramebuffer = framebuffer);}getHostDocument() {return null;}clear(color, backBuffer, depth, stencil = !1) {if (this.useReverseDepthBuffer) throw new Error("reverse depth buffer is not currently implemented");this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_CLEAR), this._commandBufferEncoder.encodeCommandArgAsUInt32(backBuffer && color ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(color ? color.r : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(color ? color.g : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(color ? color.b : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(color ? color.a : 1), this._commandBufferEncoder.encodeCommandArgAsUInt32(depth ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(1), this._commandBufferEncoder.encodeCommandArgAsUInt32(stencil ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsUInt32(0), this._commandBufferEncoder.finishEncodingCommand();}createIndexBuffer(indices, updateable) {const data = this._normalizeIndexData(indices),buffer = new NativeDataBuffer();return buffer.references = 1, buffer.is32Bits = 4 === data.BYTES_PER_ELEMENT, data.byteLength && (buffer.nativeIndexBuffer = this._engine.createIndexBuffer(data.buffer, data.byteOffset, data.byteLength, buffer.is32Bits, null !== updateable && void 0 !== updateable && updateable)), buffer;}createVertexBuffer(vertices, updateable) {const data = ArrayBuffer.isView(vertices) ? vertices : new Float32Array(vertices),buffer = new NativeDataBuffer();return buffer.references = 1, data.byteLength && (buffer.nativeVertexBuffer = this._engine.createVertexBuffer(data.buffer, data.byteOffset, data.byteLength, null !== updateable && void 0 !== updateable && updateable)), buffer;}_recordVertexArrayObject(vertexArray, vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {indexBuffer && this._engine.recordIndexBuffer(vertexArray, indexBuffer.nativeIndexBuffer);const attributes = effect.getAttributesNames();for (let index = 0; index < attributes.length; index++) {const location = effect.getAttributeLocation(index);if (0 <= location) {const kind = attributes[index];let vertexBuffer = null;if (overrideVertexBuffers && (vertexBuffer = overrideVertexBuffers[kind]), vertexBuffer || (vertexBuffer = vertexBuffers[kind]), vertexBuffer) {const buffer = vertexBuffer.getBuffer();buffer && buffer.nativeVertexBuffer && this._engine.recordVertexBuffer(vertexArray, buffer.nativeVertexBuffer, location, vertexBuffer.byteOffset, vertexBuffer.byteStride, vertexBuffer.getSize(), this._getNativeAttribType(vertexBuffer.type), vertexBuffer.normalized, vertexBuffer.getInstanceDivisor());}}}}bindBuffers(vertexBuffers, indexBuffer, effect) {this._boundBuffersVertexArray && this._deleteVertexArray(this._boundBuffersVertexArray), this._boundBuffersVertexArray = this._engine.createVertexArray(), this._recordVertexArrayObject(this._boundBuffersVertexArray, vertexBuffers, indexBuffer, effect), this.bindVertexArrayObject(this._boundBuffersVertexArray);}recordVertexArrayObject(vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {const vertexArray = this._engine.createVertexArray();return this._recordVertexArrayObject(vertexArray, vertexBuffers, indexBuffer, effect, overrideVertexBuffers), vertexArray;}_deleteVertexArray(vertexArray) {this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEVERTEXARRAY), this._commandBufferEncoder.encodeCommandArgAsNativeData(vertexArray), this._commandBufferEncoder.finishEncodingCommand();}bindVertexArrayObject(vertexArray) {this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_BINDVERTEXARRAY), this._commandBufferEncoder.encodeCommandArgAsNativeData(vertexArray), this._commandBufferEncoder.finishEncodingCommand();}releaseVertexArrayObject(vertexArray) {this._deleteVertexArray(vertexArray);}getAttributes(pipelineContext, attributesNames) {return this._engine.getAttributes(pipelineContext.nativeProgram, attributesNames);}drawElementsType(fillMode, indexStart, indexCount) {this._drawCalls.addCount(1, !1), this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINDEXED), this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode), this._commandBufferEncoder.encodeCommandArgAsUInt32(indexStart), this._commandBufferEncoder.encodeCommandArgAsUInt32(indexCount), this._commandBufferEncoder.finishEncodingCommand();}drawArraysType(fillMode, verticesStart, verticesCount) {this._drawCalls.addCount(1, !1), this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAW), this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode), this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesStart), this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesCount), this._commandBufferEncoder.finishEncodingCommand();}createPipelineContext() {return new NativePipelineContext(this);}createMaterialContext() {}createDrawContext() {}_preparePipelineContext(pipelineContext, vertexSourceCode, fragmentSourceCode, createAsRaw, _rawVertexSourceCode, _rawFragmentSourceCode, _rebuildRebind, defines) {pipelineContext.nativeProgram = createAsRaw ? this.createRawShaderProgram() : this.createShaderProgram(pipelineContext, vertexSourceCode, fragmentSourceCode, defines);}_isRenderingStateCompiled() {return !0;}_executeWhenRenderingStateIsCompiled(pipelineContext, action) {action();}createRawShaderProgram() {throw new Error("Not Supported");}createShaderProgram(_pipelineContext, vertexCode, fragmentCode, defines) {this.onBeforeShaderCompilationObservable.notifyObservers(this);const vertexInliner = new ShaderCodeInliner(vertexCode);vertexInliner.processCode(), vertexCode = vertexInliner.code;const fragmentInliner = new ShaderCodeInliner(fragmentCode);fragmentInliner.processCode(), fragmentCode = fragmentInliner.code, vertexCode = thinEngine/* ThinEngine._ConcatenateShader */.B._ConcatenateShader(vertexCode, defines), fragmentCode = thinEngine/* ThinEngine._ConcatenateShader */.B._ConcatenateShader(fragmentCode, defines);const program = this._engine.createProgram(vertexCode, fragmentCode);return this.onAfterShaderCompilationObservable.notifyObservers(this), program;}inlineShaderCode(code) {const sci = new ShaderCodeInliner(code);return sci.debug = !1, sci.processCode(), sci.code;}_setProgram(program) {this._currentProgram !== program && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETPROGRAM), this._commandBufferEncoder.encodeCommandArgAsNativeData(program), this._commandBufferEncoder.finishEncodingCommand(), this._currentProgram = program);}_deletePipelineContext(pipelineContext) {const nativePipelineContext = pipelineContext;nativePipelineContext && nativePipelineContext.nativeProgram && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEPROGRAM), this._commandBufferEncoder.encodeCommandArgAsNativeData(nativePipelineContext.nativeProgram), this._commandBufferEncoder.finishEncodingCommand());}getUniforms(pipelineContext, uniformsNames) {return this._engine.getUniforms(pipelineContext.nativeProgram, uniformsNames);}bindUniformBlock() {throw new Error("Not Implemented");}bindSamplers(effect) {const nativePipelineContext = effect.getPipelineContext();this._setProgram(nativePipelineContext.nativeProgram);const samplers = effect.getSamplers();for (let index = 0; index < samplers.length; index++) {const uniform = effect.getUniform(samplers[index]);uniform && (this._boundUniforms[index] = uniform);}this._currentEffect = null;}getRenderWidth(useScreen = !1) {return !useScreen && this._currentRenderTarget ? this._currentRenderTarget.width : this._engine.getRenderWidth();}getRenderHeight(useScreen = !1) {return !useScreen && this._currentRenderTarget ? this._currentRenderTarget.height : this._engine.getRenderHeight();}setViewport(viewport) {this._cachedViewport = viewport, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETVIEWPORT), this._commandBufferEncoder.encodeCommandArgAsFloat32(viewport.x), this._commandBufferEncoder.encodeCommandArgAsFloat32(viewport.y), this._commandBufferEncoder.encodeCommandArgAsFloat32(viewport.width), this._commandBufferEncoder.encodeCommandArgAsFloat32(viewport.height), this._commandBufferEncoder.finishEncodingCommand();}setState(culling, zOffset = 0, force, reverseSide = !1, cullBackFaces, stencil, zOffsetUnits = 0) {var _a, _b;this._zOffset = zOffset, this._zOffsetUnits = zOffsetUnits, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSTATE), this._commandBufferEncoder.encodeCommandArgAsUInt32(culling ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(zOffset), this._commandBufferEncoder.encodeCommandArgAsFloat32(zOffsetUnits), this._commandBufferEncoder.encodeCommandArgAsUInt32(null === (_b = null !== (_a = this.cullBackFaces) && void 0 !== _a ? _a : cullBackFaces) || void 0 === _b || _b ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsUInt32(reverseSide ? 1 : 0), this._commandBufferEncoder.finishEncodingCommand();}getInputElementClientRect() {const rect = { bottom: this.getRenderHeight(), height: this.getRenderHeight(), left: 0, right: this.getRenderWidth(), top: 0, width: this.getRenderWidth(), x: 0, y: 0, toJSON: () => {} };return rect;}setZOffset(value) {value !== this._zOffset && (this._zOffset = value, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETZOFFSET), this._commandBufferEncoder.encodeCommandArgAsFloat32(this.useReverseDepthBuffer ? -value : value), this._commandBufferEncoder.finishEncodingCommand());}getZOffset() {return this._zOffset;}setZOffsetUnits(value) {value !== this._zOffsetUnits && (this._zOffsetUnits = value, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETZOFFSETUNITS), this._commandBufferEncoder.encodeCommandArgAsFloat32(this.useReverseDepthBuffer ? -value : value), this._commandBufferEncoder.finishEncodingCommand());}getZOffsetUnits() {return this._zOffsetUnits;}setDepthBuffer(enable) {this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHTEST), this._commandBufferEncoder.encodeCommandArgAsUInt32(enable ? this._currentDepthTest : _native.Engine.DEPTH_TEST_ALWAYS), this._commandBufferEncoder.finishEncodingCommand();}getDepthWrite() {return this._depthWrite;}getDepthFunction() {switch (this._currentDepthTest) {case _native.Engine.DEPTH_TEST_NEVER:return 512;case _native.Engine.DEPTH_TEST_ALWAYS:return 519;case _native.Engine.DEPTH_TEST_GREATER:return 516;case _native.Engine.DEPTH_TEST_GEQUAL:return 518;case _native.Engine.DEPTH_TEST_NOTEQUAL:return 517;case _native.Engine.DEPTH_TEST_EQUAL:return 514;case _native.Engine.DEPTH_TEST_LESS:return 513;case _native.Engine.DEPTH_TEST_LEQUAL:return 515;}return null;}setDepthFunction(depthFunc) {let nativeDepthFunc = 0;512 === depthFunc ? nativeDepthFunc = _native.Engine.DEPTH_TEST_NEVER : 519 === depthFunc ? nativeDepthFunc = _native.Engine.DEPTH_TEST_ALWAYS : 516 === depthFunc ? nativeDepthFunc = _native.Engine.DEPTH_TEST_GREATER : 518 === depthFunc ? nativeDepthFunc = _native.Engine.DEPTH_TEST_GEQUAL : 517 === depthFunc ? nativeDepthFunc = _native.Engine.DEPTH_TEST_NOTEQUAL : 514 === depthFunc ? nativeDepthFunc = _native.Engine.DEPTH_TEST_EQUAL : 513 === depthFunc ? nativeDepthFunc = _native.Engine.DEPTH_TEST_LESS : 515 === depthFunc ? nativeDepthFunc = _native.Engine.DEPTH_TEST_LEQUAL : void 0;this._currentDepthTest = nativeDepthFunc, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHTEST), this._commandBufferEncoder.encodeCommandArgAsUInt32(this._currentDepthTest), this._commandBufferEncoder.finishEncodingCommand();}setDepthWrite(enable) {this._depthWrite = enable, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHWRITE), this._commandBufferEncoder.encodeCommandArgAsUInt32(+enable), this._commandBufferEncoder.finishEncodingCommand();}setColorWrite(enable) {this._colorWrite = enable, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETCOLORWRITE), this._commandBufferEncoder.encodeCommandArgAsUInt32(+enable), this._commandBufferEncoder.finishEncodingCommand();}getColorWrite() {return this._colorWrite;}applyStencil() {this._setStencil(this._stencilMask, this._getStencilOpFail(this._stencilOpStencilFail), this._getStencilDepthFail(this._stencilOpDepthFail), this._getStencilDepthPass(this._stencilOpStencilDepthPass), this._getStencilFunc(this._stencilFunc), this._stencilFuncRef);}_setStencil(mask, stencilOpFail, depthOpFail, depthOpPass, func, ref) {this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSTENCIL), this._commandBufferEncoder.encodeCommandArgAsUInt32(mask), this._commandBufferEncoder.encodeCommandArgAsUInt32(stencilOpFail), this._commandBufferEncoder.encodeCommandArgAsUInt32(depthOpFail), this._commandBufferEncoder.encodeCommandArgAsUInt32(depthOpPass), this._commandBufferEncoder.encodeCommandArgAsUInt32(func), this._commandBufferEncoder.encodeCommandArgAsUInt32(ref), this._commandBufferEncoder.finishEncodingCommand();}setStencilBuffer(enable) {this._stencilTest = enable, enable ? this.applyStencil() : this._setStencil(255, _native.Engine.STENCIL_OP_FAIL_S_KEEP, _native.Engine.STENCIL_OP_FAIL_Z_KEEP, _native.Engine.STENCIL_OP_PASS_Z_KEEP, _native.Engine.STENCIL_TEST_ALWAYS, 0);}getStencilBuffer() {return this._stencilTest;}getStencilOperationPass() {return this._stencilOpStencilDepthPass;}setStencilOperationPass(operation) {this._stencilOpStencilDepthPass = operation, this.applyStencil();}setStencilMask(mask) {this._stencilMask = mask, this.applyStencil();}setStencilFunction(stencilFunc) {this._stencilFunc = stencilFunc, this.applyStencil();}setStencilFunctionReference(reference) {this._stencilFuncRef = reference, this.applyStencil();}setStencilFunctionMask(mask) {this._stencilFuncMask = mask;}setStencilOperationFail(operation) {this._stencilOpStencilFail = operation, this.applyStencil();}setStencilOperationDepthFail(operation) {this._stencilOpDepthFail = operation, this.applyStencil();}getStencilMask() {return this._stencilMask;}getStencilFunction() {return this._stencilFunc;}getStencilFunctionReference() {return this._stencilFuncRef;}getStencilFunctionMask() {return this._stencilFuncMask;}getStencilOperationFail() {return this._stencilOpStencilFail;}getStencilOperationDepthFail() {return this._stencilOpDepthFail;}setAlphaConstants() {throw new Error("Setting alpha blend constant color not yet implemented.");}setAlphaMode(mode, noDepthWriteChange = !1) {if (this._alphaMode !== mode) {const nativeMode = this._getNativeAlphaMode(mode);this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETBLENDMODE), this._commandBufferEncoder.encodeCommandArgAsUInt32(nativeMode), this._commandBufferEncoder.finishEncodingCommand(), noDepthWriteChange || this.setDepthWrite(0 === mode), this._alphaMode = mode;}}getAlphaMode() {return this._alphaMode;}setInt(uniform, int) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINT), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsInt32(int), this._commandBufferEncoder.finishEncodingCommand(), !0);}setIntArray(uniform, array) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsInt32s(array), this._commandBufferEncoder.finishEncodingCommand(), !0);}setIntArray2(uniform, array) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY2), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsInt32s(array), this._commandBufferEncoder.finishEncodingCommand(), !0);}setIntArray3(uniform, array) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY3), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsInt32s(array), this._commandBufferEncoder.finishEncodingCommand(), !0);}setIntArray4(uniform, array) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY4), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsInt32s(array), this._commandBufferEncoder.finishEncodingCommand(), !0);}setFloatArray(uniform, array) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32s(array), this._commandBufferEncoder.finishEncodingCommand(), !0);}setFloatArray2(uniform, array) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY2), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32s(array), this._commandBufferEncoder.finishEncodingCommand(), !0);}setFloatArray3(uniform, array) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY3), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32s(array), this._commandBufferEncoder.finishEncodingCommand(), !0);}setFloatArray4(uniform, array) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY4), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32s(array), this._commandBufferEncoder.finishEncodingCommand(), !0);}setArray(uniform, array) {return !!uniform && this.setFloatArray(uniform, new Float32Array(array));}setArray2(uniform, array) {return !!uniform && this.setFloatArray2(uniform, new Float32Array(array));}setArray3(uniform, array) {return !!uniform && this.setFloatArray3(uniform, new Float32Array(array));}setArray4(uniform, array) {return !!uniform && this.setFloatArray4(uniform, new Float32Array(array));}setMatrices(uniform, matrices) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRICES), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32s(matrices), this._commandBufferEncoder.finishEncodingCommand(), !0);}setMatrix3x3(uniform, matrix) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRIX3X3), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32s(matrix), this._commandBufferEncoder.finishEncodingCommand(), !0);}setMatrix2x2(uniform, matrix) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRIX2X2), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32s(matrix), this._commandBufferEncoder.finishEncodingCommand(), !0);}setFloat(uniform, value) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32(value), this._commandBufferEncoder.finishEncodingCommand(), !0);}setFloat2(uniform, x, y) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT2), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32(x), this._commandBufferEncoder.encodeCommandArgAsFloat32(y), this._commandBufferEncoder.finishEncodingCommand(), !0);}setFloat3(uniform, x, y, z) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT3), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32(x), this._commandBufferEncoder.encodeCommandArgAsFloat32(y), this._commandBufferEncoder.encodeCommandArgAsFloat32(z), this._commandBufferEncoder.finishEncodingCommand(), !0);}setFloat4(uniform, x, y, z, w) {return !!uniform && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT4), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsFloat32(x), this._commandBufferEncoder.encodeCommandArgAsFloat32(y), this._commandBufferEncoder.encodeCommandArgAsFloat32(z), this._commandBufferEncoder.encodeCommandArgAsFloat32(w), this._commandBufferEncoder.finishEncodingCommand(), !0);}setColor3(uniform, color3) {return !!uniform && (this.setFloat3(uniform, color3.r, color3.g, color3.b), !0);}setColor4(uniform, color3, alpha) {return !!uniform && (this.setFloat4(uniform, color3.r, color3.g, color3.b, alpha), !0);}wipeCaches(bruteForce) {this.preventCacheWipeBetweenFrames || (this.resetTextureCache(), this._currentEffect = null, bruteForce && (this._currentProgram = null, this._stencilStateComposer.reset(), this._depthCullingState.reset(), this._alphaState.reset()), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);}_createTexture() {return this._engine.createTexture();}_deleteTexture(texture) {texture && this._engine.deleteTexture(texture);}updateDynamicTexture(texture, canvas, invertY, premulAlpha = !1) {if (void 0 === premulAlpha && (premulAlpha = !1), !!texture && !!texture._hardwareTexture) {const source = canvas.getCanvasTexture(),destination = texture._hardwareTexture.underlyingResource;this._engine.copyTexture(destination, source), texture.isReady = !0;}}createDynamicTexture(width, height, generateMipMaps, samplingMode) {return width = Math.max(width, 1), height = Math.max(height, 1), this.createRawTexture(new Uint8Array(4 * (width * height)), width, height, 5, !1, !1, samplingMode);}createVideoElement(constraints) {return this._camera ? this._camera.createVideo(constraints) : null;}updateVideoTexture(texture, video, invertY) {if (texture && texture._hardwareTexture && this._camera) {const webGLTexture = texture._hardwareTexture.underlyingResource;this._camera.updateVideoTexture(webGLTexture, video, invertY);}}createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = !1) {const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Raw */.S.Raw);if (texture.format = format, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.invertY = invertY, texture.baseWidth = width, texture.baseHeight = height, texture.width = texture.baseWidth, texture.height = texture.baseHeight, texture._compression = compression, texture.type = type, texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps), this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer), texture._hardwareTexture) {const webGLTexture = texture._hardwareTexture.underlyingResource,filter = this._getNativeSamplingMode(samplingMode);this._setTextureSampling(webGLTexture, filter);}return this._internalTexturesCache.push(texture), texture;}createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0) {const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Raw2DArray */.S.Raw2DArray);if (texture.baseWidth = width, texture.baseHeight = height, texture.baseDepth = depth, texture.width = width, texture.height = height, texture.depth = depth, texture.format = format, texture.type = textureType, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.is2DArray = !0, texture._hardwareTexture) {const nativeTexture = texture._hardwareTexture.underlyingResource;this._engine.loadRawTexture2DArray(nativeTexture, data, width, height, depth, this._getNativeTextureFormat(format, textureType), generateMipMaps, invertY);const filter = this._getNativeSamplingMode(samplingMode);this._setTextureSampling(nativeTexture, filter);}return texture.isReady = !0, this._internalTexturesCache.push(texture), texture;}updateRawTexture(texture, bufferView, format, invertY, compression = null, type = 0, useSRGBBuffer = !1) {if (texture) {if (bufferView && texture._hardwareTexture) {const underlyingResource = texture._hardwareTexture.underlyingResource;this._engine.loadRawTexture(underlyingResource, bufferView, texture.width, texture.height, this._getNativeTextureFormat(format, type), texture.generateMipMaps, texture.invertY);}texture.isReady = !0;}}createTexture(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, creationFlags, useSRGBBuffer = !1) {url = url || "";const fromData = "data:" === url.substr(0, 5),isBase64 = fromData && -1 !== url.indexOf(";base64,"),texture = fallback ? fallback : new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Url */.S.Url),originalUrl = url;!this._transformTextureUrl || isBase64 || fallback || buffer || (url = this._transformTextureUrl(url));const lastDot = url.lastIndexOf("."),extension = forcedExtension ? forcedExtension : -1 < lastDot ? url.substring(lastDot).toLowerCase() : "";let loader = null;for (const availableLoader of engine/* Engine._TextureLoaders */.D._TextureLoaders) if (availableLoader.canLoad(extension)) {loader = availableLoader;break;}scene && scene.addPendingData(texture), texture.url = url, texture.generateMipMaps = !noMipmap, texture.samplingMode = samplingMode, texture.invertY = invertY, texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, noMipmap), this.doNotHandleContextLost || (texture._buffer = buffer);let onLoadObserver = null;onLoad && !fallback && (onLoadObserver = texture.onLoadedObservable.add(onLoad)), fallback || this._internalTexturesCache.push(texture);const onInternalError = (message, exception) => {scene && scene.removePendingData(texture), url === originalUrl ? (onLoadObserver && texture.onLoadedObservable.remove(onLoadObserver), engineStore/* EngineStore.UseFallbackTexture */.l.UseFallbackTexture && this.createTexture(engineStore/* EngineStore.FallbackTexture */.l.FallbackTexture, noMipmap, texture.invertY, scene, samplingMode, null, onError, buffer, texture), onError && onError((message || "Unknown error") + (engineStore/* EngineStore.UseFallbackTexture */.l.UseFallbackTexture ? " - Fallback texture was used" : ""), exception)) : (logger/* Logger.Warn */.Y.Warn(`Failed to load ${url}, falling back to ${originalUrl}`), this.createTexture(originalUrl, noMipmap, texture.invertY, scene, samplingMode, onLoad, onError, buffer, texture, format, forcedExtension, mimeType, loaderOptions));};if (loader) throw new Error("Loading textures from IInternalTextureLoader not yet implemented.");else {const onload = (data) => {if (!texture._hardwareTexture) return void (scene && scene.removePendingData(texture));const underlyingResource = texture._hardwareTexture.underlyingResource;this._engine.loadTexture(underlyingResource, data, !noMipmap, invertY, useSRGBBuffer, () => {texture.baseWidth = this._engine.getTextureWidth(underlyingResource), texture.baseHeight = this._engine.getTextureHeight(underlyingResource), texture.width = texture.baseWidth, texture.height = texture.baseHeight, texture.isReady = !0;const filter = this._getNativeSamplingMode(samplingMode);this._setTextureSampling(underlyingResource, filter), scene && scene.removePendingData(texture), texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear();}, () => {throw new Error("Could not load a native texture.");});};if (!(fromData && buffer)) isBase64 ? onload(new Uint8Array(tools/* Tools.DecodeBase64 */.w1.DecodeBase64(url))) : this._loadFile(url, (data) => onload(new Uint8Array(data)), void 0, void 0, !0, (request, exception) => {onInternalError("Unable to load " + (request ? request.responseURL : url, exception));});else if (buffer instanceof ArrayBuffer) onload(new Uint8Array(buffer));else if (ArrayBuffer.isView(buffer)) onload(buffer);else if ("string" == typeof buffer) onload(new Uint8Array(tools/* Tools.DecodeBase64 */.w1.DecodeBase64(buffer)));else throw new Error("Unsupported buffer type");}return texture;}wrapNativeTexture(texture) {const hardwareTexture = new NativeHardwareTexture(texture, this._engine),internalTexture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Unknown */.S.Unknown, !0);return internalTexture._hardwareTexture = hardwareTexture, internalTexture.isReady = !0, internalTexture;}wrapWebGLTexture() {throw new Error("wrapWebGLTexture is not supported, use wrapNativeTexture instead.");}_createDepthStencilTexture(size, options, rtWrapper) {const nativeRTWrapper = rtWrapper,texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.DepthStencil */.S.DepthStencil),width = size.width || size,height = size.height || size,framebuffer = this._engine.createFrameBuffer(texture._hardwareTexture.underlyingResource, width, height, !0, !0);return nativeRTWrapper._framebufferDepthStencil = framebuffer, texture;}_releaseFramebufferObjects(framebuffer) {framebuffer && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEFRAMEBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(framebuffer), this._commandBufferEncoder.finishEncodingCommand());}_createImageBitmapFromSource(imageSource, options) {const promise = new Promise((resolve, reject) => {const image = this.createCanvasImage();image.onload = () => {try {const imageBitmap = this._engine.createImageBitmap(image);resolve(imageBitmap);} catch (error) {reject(`Error loading image ${image.src} with exception: ${error}`);}}, image.onerror = (error) => {reject(`Error loading image ${image.src} with exception: ${error}`);}, image.src = imageSource;});return promise;}createImageBitmap(image, options) {return new Promise((resolve, reject) => {if (Array.isArray(image)) {const arr = image;if (arr.length) {const image = this._engine.createImageBitmap(arr[0]);if (image) return void resolve(image);}}reject(`Unsupported data for createImageBitmap.`);});}resizeImageBitmap(image, bufferWidth, bufferHeight) {return this._engine.resizeImageBitmap(image, bufferWidth, bufferHeight);}createCubeTexture(rootUrl, scene, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = !1, lodScale = 0, lodOffset = 0, fallback = null, loaderOptions, useSRGBBuffer = !1) {const texture = fallback ? fallback : new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Cube */.S.Cube);texture.isCube = !0, texture.url = rootUrl, texture.generateMipMaps = !noMipmap, texture._lodGenerationScale = lodScale, texture._lodGenerationOffset = lodOffset, this._doNotHandleContextLost || (texture._extension = forcedExtension, texture._files = files);const lastDot = rootUrl.lastIndexOf("."),extension = forcedExtension ? forcedExtension : -1 < lastDot ? rootUrl.substring(lastDot).toLowerCase() : "";if (".env" === extension) {const onloaddata = (data) => {const info = (0,environmentTextureTools/* GetEnvInfo */.qJ)(data);texture.width = info.width, texture.height = info.width, (0,environmentTextureTools/* UploadEnvSpherical */.qC)(texture, info);const specularInfo = info.specular;if (!specularInfo) throw new Error(`Nothing else parsed so far`);texture._lodGenerationScale = specularInfo.lodGenerationScale;const imageData = (0,environmentTextureTools/* CreateImageDataArrayBufferViews */.Do)(data, info);texture.format = 5, texture.type = 0, texture.generateMipMaps = !0, texture.getEngine().updateTextureSamplingMode(Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, texture), texture._isRGBD = !0, texture.invertY = !0, this._engine.loadCubeTextureWithMips(texture._hardwareTexture.underlyingResource, imageData, !1, useSRGBBuffer, () => {texture.isReady = !0, onLoad && onLoad();}, () => {throw new Error("Could not load a native cube texture.");});};if (files && 6 === files.length) throw new Error(`Multi-file loading not allowed on env files.`);else {const onInternalError = (request, exception) => {onError && request && onError(request.status + " " + request.statusText, exception);};this._loadFile(rootUrl, (data) => onloaddata(new Uint8Array(data)), void 0, void 0, !0, onInternalError);}} else {if (!files || 6 !== files.length) throw new Error("Cannot load cubemap because 6 files were not defined");const reorderedFiles = [files[0], files[3], files[1], files[4], files[2], files[5]];Promise.all(reorderedFiles.map((file) => tools/* Tools.LoadFileAsync */.w1.LoadFileAsync(file).then((data) => new Uint8Array(data)))).then((data) => new Promise((resolve, reject) => {this._engine.loadCubeTexture(texture._hardwareTexture.underlyingResource, data, !noMipmap, !0, useSRGBBuffer, resolve, reject);})).then(() => {texture.isReady = !0, onLoad && onLoad();}, (error) => {onError && onError(`Failed to load cubemap: ${error.message}`, error);});}return this._internalTexturesCache.push(texture), texture;}_createHardwareTexture() {return new NativeHardwareTexture(this._createTexture(), this._engine);}_createHardwareRenderTargetWrapper(isMulti, isCube, size) {const rtWrapper = new NativeRenderTargetWrapper(isMulti, isCube, size, this);return this._renderTargetWrapperCache.push(rtWrapper), rtWrapper;}_createInternalTexture(size, options, _delayGPUTextureCreation = !0, source = Textures_internalTexture/* InternalTextureSource.Unknown */.S.Unknown) {var _a;let generateMipMaps = !1,type = 0,samplingMode = 3,format = 5,useSRGBBuffer = !1,samples = 1;void 0 !== options && "object" == typeof options ? (generateMipMaps = !!options.generateMipMaps, type = void 0 === options.type ? 0 : options.type, samplingMode = void 0 === options.samplingMode ? 3 : options.samplingMode, format = void 0 === options.format ? 5 : options.format, useSRGBBuffer = void 0 !== options.useSRGBBuffer && options.useSRGBBuffer, samples = null !== (_a = options.samples) && void 0 !== _a ? _a : 1) : generateMipMaps = !!options, useSRGBBuffer && (useSRGBBuffer = this._caps.supportSRGBBuffers && (1 < this.webGLVersion || this.isWebGPU)), 1 !== type || this._caps.textureFloatLinearFiltering ? 2 === type && !this._caps.textureHalfFloatLinearFiltering && (samplingMode = 1) : samplingMode = 1, 1 !== type || this._caps.textureFloat || (type = 0, logger/* Logger.Warn */.Y.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const texture = new Textures_internalTexture/* InternalTexture */.l(this, source),width = size.width || size,height = size.height || size,layers = size.layers || 0;if (0 !== layers) throw new Error("Texture layers are not supported in Babylon Native");const nativeTexture = texture._hardwareTexture.underlyingResource,nativeTextureFormat = this._getNativeTextureFormat(format, type);return this._engine.initializeTexture(nativeTexture, width, height, generateMipMaps, nativeTextureFormat, !0, useSRGBBuffer), this._setTextureSampling(nativeTexture, this._getNativeSamplingMode(samplingMode)), texture._useSRGBBuffer = useSRGBBuffer, texture.baseWidth = width, texture.baseHeight = height, texture.width = width, texture.height = height, texture.depth = layers, texture.isReady = !0, texture.samples = samples, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.type = type, texture.format = format, this._internalTexturesCache.push(texture), texture;}createRenderTargetTexture(size, options) {var _a;const rtWrapper = this._createHardwareRenderTargetWrapper(!1, !1, size);let colorAttachment,generateDepthBuffer = !0,generateStencilBuffer = !1,noColorAttachment = !1;void 0 !== options && "object" == typeof options && (generateDepthBuffer = null === (_a = options.generateDepthBuffer) || void 0 === _a || _a, generateStencilBuffer = !!options.generateStencilBuffer, noColorAttachment = !!options.noColorAttachment, colorAttachment = options.colorAttachment);const texture = colorAttachment || (noColorAttachment ? null : this._createInternalTexture(size, options, !0, Textures_internalTexture/* InternalTextureSource.RenderTarget */.S.RenderTarget)),width = size.width || size,height = size.height || size,framebuffer = this._engine.createFrameBuffer(texture ? texture._hardwareTexture.underlyingResource : null, width, height, generateStencilBuffer, generateDepthBuffer);return rtWrapper._framebuffer = framebuffer, rtWrapper._generateDepthBuffer = generateDepthBuffer, rtWrapper._generateStencilBuffer = generateStencilBuffer, rtWrapper.setTextures(texture), rtWrapper;}updateTextureSamplingMode(samplingMode, texture) {if (texture._hardwareTexture) {const filter = this._getNativeSamplingMode(samplingMode);this._setTextureSampling(texture._hardwareTexture.underlyingResource, filter);}texture.samplingMode = samplingMode;}bindFramebuffer(texture, faceIndex, requiredWidth, requiredHeight, forceFullscreenViewport) {const nativeRTWrapper = texture;if (this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = texture, faceIndex) throw new Error("Cuboid frame buffers are not yet supported in NativeEngine.");if (requiredWidth || requiredHeight) throw new Error("Required width/height for frame buffers not yet supported in NativeEngine.");forceFullscreenViewport, nativeRTWrapper._framebufferDepthStencil ? this._bindUnboundFramebuffer(nativeRTWrapper._framebufferDepthStencil) : this._bindUnboundFramebuffer(nativeRTWrapper._framebuffer);}unBindFramebuffer(texture, disableGenerateMipMaps = !1, onBeforeUnbind) {this._currentRenderTarget = null, onBeforeUnbind && onBeforeUnbind(), this._bindUnboundFramebuffer(null);}createDynamicVertexBuffer(data) {return this.createVertexBuffer(data, !0);}updateDynamicIndexBuffer(indexBuffer, indices, offset = 0) {const buffer = indexBuffer,data = this._normalizeIndexData(indices);buffer.is32Bits = 4 === data.BYTES_PER_ELEMENT, this._engine.updateDynamicIndexBuffer(buffer.nativeIndexBuffer, data.buffer, data.byteOffset, data.byteLength, offset);}updateDynamicVertexBuffer(vertexBuffer, verticies, byteOffset, byteLength) {const buffer = vertexBuffer,data = ArrayBuffer.isView(verticies) ? verticies : new Float32Array(verticies);this._engine.updateDynamicVertexBuffer(buffer.nativeVertexBuffer, data.buffer, data.byteOffset + (null !== byteOffset && void 0 !== byteOffset ? byteOffset : 0), null !== byteLength && void 0 !== byteLength ? byteLength : data.byteLength);}_setTexture(channel, texture, isPartOfTextureArray = !1, depthStencilTexture = !1) {const uniform = this._boundUniforms[channel];if (!uniform) return !1;if (!texture) return null != this._boundTexturesCache[channel] && (this._activeChannel = channel, this._boundTexturesCache[channel] = null), !1;if (texture.video) this._activeChannel = channel, texture.update();else if (4 === texture.delayLoadState) return texture.delayLoad(), !1;let internalTexture;return (internalTexture = depthStencilTexture ? texture.depthStencilTexture : texture.isReady() ? texture.getInternalTexture() : texture.isCube ? this.emptyCubeTexture : texture.is3D ? this.emptyTexture3D : texture.is2DArray ? this.emptyTexture2DArray : this.emptyTexture, this._activeChannel = channel, internalTexture && internalTexture._hardwareTexture) && (this._setTextureWrapMode(internalTexture._hardwareTexture.underlyingResource, this._getAddressMode(texture.wrapU), this._getAddressMode(texture.wrapV), this._getAddressMode(texture.wrapR)), this._updateAnisotropicLevel(texture), this._setTextureCore(uniform, internalTexture._hardwareTexture.underlyingResource), !0);}_setTextureSampling(texture, filter) {this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTURESAMPLING), this._commandBufferEncoder.encodeCommandArgAsNativeData(texture), this._commandBufferEncoder.encodeCommandArgAsUInt32(filter), this._commandBufferEncoder.finishEncodingCommand();}_setTextureWrapMode(texture, addressModeU, addressModeV, addressModeW) {this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTUREWRAPMODE), this._commandBufferEncoder.encodeCommandArgAsNativeData(texture), this._commandBufferEncoder.encodeCommandArgAsUInt32(addressModeU), this._commandBufferEncoder.encodeCommandArgAsUInt32(addressModeV), this._commandBufferEncoder.encodeCommandArgAsUInt32(addressModeW), this._commandBufferEncoder.finishEncodingCommand();}_setTextureCore(uniform, texture) {this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTURE), this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform), this._commandBufferEncoder.encodeCommandArgAsNativeData(texture), this._commandBufferEncoder.finishEncodingCommand();}_updateAnisotropicLevel(texture) {const internalTexture = texture.getInternalTexture(),value = texture.anisotropicFilteringLevel;internalTexture && internalTexture._hardwareTexture && (internalTexture._cachedAnisotropicFilteringLevel === value || (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTUREANISOTROPICLEVEL), this._commandBufferEncoder.encodeCommandArgAsNativeData(internalTexture._hardwareTexture.underlyingResource), this._commandBufferEncoder.encodeCommandArgAsUInt32(value), this._commandBufferEncoder.finishEncodingCommand(), internalTexture._cachedAnisotropicFilteringLevel = value));}_getAddressMode(wrapMode) {switch (wrapMode) {case 1:return _native.Engine.ADDRESS_MODE_WRAP;case 0:return _native.Engine.ADDRESS_MODE_CLAMP;case 2:return _native.Engine.ADDRESS_MODE_MIRROR;default:throw new Error("Unexpected wrap mode: " + wrapMode + ".");}}_bindTexture(channel, texture) {const uniform = this._boundUniforms[channel];if (uniform && texture && texture._hardwareTexture) {const underlyingResource = texture._hardwareTexture.underlyingResource;this._setTextureCore(uniform, underlyingResource);}}_deleteBuffer(buffer) {buffer.nativeIndexBuffer && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEINDEXBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(buffer.nativeIndexBuffer), this._commandBufferEncoder.finishEncodingCommand(), delete buffer.nativeIndexBuffer), buffer.nativeVertexBuffer && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEVERTEXBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(buffer.nativeVertexBuffer), this._commandBufferEncoder.finishEncodingCommand(), delete buffer.nativeVertexBuffer);}createCanvas(width, height) {if (!_native.Canvas) throw new Error("Native Canvas plugin not available.");const canvas = new _native.Canvas();return canvas.width = width, canvas.height = height, canvas;}createCanvasImage() {if (!_native.Canvas) throw new Error("Native Canvas plugin not available.");const image = new _native.Image();return image;}updateTextureData(texture, imageData, xOffset, yOffset, width, height, faceIndex = 0, lod = 0, generateMipMaps = !1) {throw new Error("updateTextureData not implemented.");}_uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, data, faceIndex = 0, lod = 0) {throw new Error("_uploadCompressedDataToTextureDirectly not implemented.");}_uploadDataToTextureDirectly(texture, imageData, faceIndex = 0, lod = 0) {throw new Error("_uploadDataToTextureDirectly not implemented.");}_uploadArrayBufferViewToTexture(texture, imageData, faceIndex = 0, lod = 0) {throw new Error("_uploadArrayBufferViewToTexture not implemented.");}_uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) {throw new Error("_uploadArrayBufferViewToTexture not implemented.");}_getNativeSamplingMode(samplingMode) {switch (samplingMode) {case 1:return _native.Engine.TEXTURE_NEAREST_NEAREST;case 2:return _native.Engine.TEXTURE_LINEAR_LINEAR;case 3:return _native.Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR;case 4:return _native.Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST;case 5:return _native.Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST;case 6:return _native.Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR;case 7:return _native.Engine.TEXTURE_NEAREST_LINEAR;case 8:return _native.Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR;case 9:return _native.Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST;case 10:return _native.Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR;case 11:return _native.Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST;case 12:return _native.Engine.TEXTURE_LINEAR_NEAREST;default:throw new Error(`Unsupported sampling mode: ${samplingMode}.`);}}_getStencilFunc(func) {switch (func) {case 513:return _native.Engine.STENCIL_TEST_LESS;case 515:return _native.Engine.STENCIL_TEST_LEQUAL;case 514:return _native.Engine.STENCIL_TEST_EQUAL;case 518:return _native.Engine.STENCIL_TEST_GEQUAL;case 516:return _native.Engine.STENCIL_TEST_GREATER;case 517:return _native.Engine.STENCIL_TEST_NOTEQUAL;case 512:return _native.Engine.STENCIL_TEST_NEVER;case 519:return _native.Engine.STENCIL_TEST_ALWAYS;default:throw new Error(`Unsupported stencil func mode: ${func}.`);}}_getStencilOpFail(opFail) {switch (opFail) {case 7680:return _native.Engine.STENCIL_OP_FAIL_S_KEEP;case 0:return _native.Engine.STENCIL_OP_FAIL_S_ZERO;case 7681:return _native.Engine.STENCIL_OP_FAIL_S_REPLACE;case 7682:return _native.Engine.STENCIL_OP_FAIL_S_INCR;case 7683:return _native.Engine.STENCIL_OP_FAIL_S_DECR;case 5386:return _native.Engine.STENCIL_OP_FAIL_S_INVERT;case 34055:return _native.Engine.STENCIL_OP_FAIL_S_INCRSAT;case 34056:return _native.Engine.STENCIL_OP_FAIL_S_DECRSAT;default:throw new Error(`Unsupported stencil OpFail mode: ${opFail}.`);}}_getStencilDepthFail(depthFail) {switch (depthFail) {case 7680:return _native.Engine.STENCIL_OP_FAIL_Z_KEEP;case 0:return _native.Engine.STENCIL_OP_FAIL_Z_ZERO;case 7681:return _native.Engine.STENCIL_OP_FAIL_Z_REPLACE;case 7682:return _native.Engine.STENCIL_OP_FAIL_Z_INCR;case 7683:return _native.Engine.STENCIL_OP_FAIL_Z_DECR;case 5386:return _native.Engine.STENCIL_OP_FAIL_Z_INVERT;case 34055:return _native.Engine.STENCIL_OP_FAIL_Z_INCRSAT;case 34056:return _native.Engine.STENCIL_OP_FAIL_Z_DECRSAT;default:throw new Error(`Unsupported stencil depthFail mode: ${depthFail}.`);}}_getStencilDepthPass(opPass) {switch (opPass) {case 7680:return _native.Engine.STENCIL_OP_PASS_Z_KEEP;case 0:return _native.Engine.STENCIL_OP_PASS_Z_ZERO;case 7681:return _native.Engine.STENCIL_OP_PASS_Z_REPLACE;case 7682:return _native.Engine.STENCIL_OP_PASS_Z_INCR;case 7683:return _native.Engine.STENCIL_OP_PASS_Z_DECR;case 5386:return _native.Engine.STENCIL_OP_PASS_Z_INVERT;case 34055:return _native.Engine.STENCIL_OP_PASS_Z_INCRSAT;case 34056:return _native.Engine.STENCIL_OP_PASS_Z_DECRSAT;default:throw new Error(`Unsupported stencil opPass mode: ${opPass}.`);}}_getNativeTextureFormat(format, type) {if (4 == format && 0 == type) return _native.Engine.TEXTURE_FORMAT_RGB8;if (5 == format && 0 == type) return _native.Engine.TEXTURE_FORMAT_RGBA8;if (5 == format && 2 == type) return _native.Engine.TEXTURE_FORMAT_RGBA16F;if (5 == format && 1 == type) return _native.Engine.TEXTURE_FORMAT_RGBA32F;throw new error/* RuntimeError */.LH(`Unsupported texture format or type: format ${format}, type ${type}.`, error/* ErrorCodes.UnsupportedTextureError */.SM.UnsupportedTextureError);}_getNativeAlphaMode(mode) {switch (mode) {case 0:return _native.Engine.ALPHA_DISABLE;case 1:return _native.Engine.ALPHA_ADD;case 2:return _native.Engine.ALPHA_COMBINE;case 3:return _native.Engine.ALPHA_SUBTRACT;case 4:return _native.Engine.ALPHA_MULTIPLY;case 5:return _native.Engine.ALPHA_MAXIMIZED;case 6:return _native.Engine.ALPHA_ONEONE;case 7:return _native.Engine.ALPHA_PREMULTIPLIED;case 8:return _native.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF;case 9:return _native.Engine.ALPHA_INTERPOLATE;case 10:return _native.Engine.ALPHA_SCREENMODE;default:throw new Error(`Unsupported alpha mode: ${mode}.`);}}_getNativeAttribType(type) {switch (type) {case Buffers_buffer/* VertexBuffer.BYTE */.o.BYTE:return _native.Engine.ATTRIB_TYPE_INT8;case Buffers_buffer/* VertexBuffer.UNSIGNED_BYTE */.o.UNSIGNED_BYTE:return _native.Engine.ATTRIB_TYPE_UINT8;case Buffers_buffer/* VertexBuffer.SHORT */.o.SHORT:return _native.Engine.ATTRIB_TYPE_INT16;case Buffers_buffer/* VertexBuffer.UNSIGNED_SHORT */.o.UNSIGNED_SHORT:return _native.Engine.ATTRIB_TYPE_UINT16;case Buffers_buffer/* VertexBuffer.FLOAT */.o.FLOAT:return _native.Engine.ATTRIB_TYPE_FLOAT;default:throw new Error(`Unsupported attribute type: ${type}.`);}}getFontOffset(font) {const result = { ascent: 0, height: 0, descent: 0 };return result;}_readTexturePixels(texture, width, height, faceIndex, level, buffer, _flushRenderer, _noDataConversion, x, y) {var _a, _b, _c, _d;if (faceIndex !== void 0 && -1 !== faceIndex) throw new Error(`Reading cubemap faces is not supported, but faceIndex is ${faceIndex}.`);return this._engine.readTexture(null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource, null !== level && void 0 !== level ? level : 0, null !== x && void 0 !== x ? x : 0, null !== y && void 0 !== y ? y : 0, width, height, null !== (_b = null === buffer || void 0 === buffer ? void 0 : buffer.buffer) && void 0 !== _b ? _b : null, null !== (_c = null === buffer || void 0 === buffer ? void 0 : buffer.byteOffset) && void 0 !== _c ? _c : 0, null !== (_d = null === buffer || void 0 === buffer ? void 0 : buffer.byteLength) && void 0 !== _d ? _d : 0).then((rawBuffer) => (buffer || (buffer = new Uint8Array(rawBuffer)), buffer));}}NativeEngine.PROTOCOL_VERSION = 8;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Native/validatedNativeDataStream.js
NativeEngine._createNativeDataStream = function () {return _native.NativeDataStream.VALIDATION_ENABLED ? new ValidatedNativeDataStream() : new NativeDataStream();};class ValidatedNativeDataStream extends NativeDataStream {constructor() {super();}writeUint32(value) {super.writeUint32(_native.NativeDataStream.VALIDATION_UINT_32), super.writeUint32(value);}writeInt32(value) {super.writeUint32(_native.NativeDataStream.VALIDATION_INT_32), super.writeInt32(value);}writeFloat32(value) {super.writeUint32(_native.NativeDataStream.VALIDATION_FLOAT_32), super.writeFloat32(value);}writeUint32Array(values) {super.writeUint32(_native.NativeDataStream.VALIDATION_UINT_32_ARRAY), super.writeUint32Array(values);}writeInt32Array(values) {super.writeUint32(_native.NativeDataStream.VALIDATION_INT_32_ARRAY), super.writeInt32Array(values);}writeFloat32Array(values) {super.writeUint32(_native.NativeDataStream.VALIDATION_FLOAT_32_ARRAY), super.writeFloat32Array(values);}writeNativeData(handle) {super.writeUint32(_native.NativeDataStream.VALIDATION_NATIVE_DATA), super.writeNativeData(handle);}writeBoolean(value) {super.writeUint32(_native.NativeDataStream.VALIDATION_BOOLEAN), super.writeBoolean(value);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Native/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuConstants.js
var PredefinedColorSpace;(function (PredefinedColorSpace) {PredefinedColorSpace.SRGB = "srgb";})(PredefinedColorSpace || (PredefinedColorSpace = {}));var PowerPreference;(function (PowerPreference) {PowerPreference.LowPower = "low-power", PowerPreference.HighPerformance = "high-performance";})(PowerPreference || (PowerPreference = {}));var FeatureName;(function (FeatureName) {FeatureName.DepthClipControl = "depth-clip-control", FeatureName.Depth24UnormStencil8 = "depth24unorm-stencil8", FeatureName.Depth32FloatStencil8 = "depth32float-stencil8", FeatureName.TextureCompressionBC = "texture-compression-bc", FeatureName.TextureCompressionETC2 = "texture-compression-etc2", FeatureName.TextureCompressionASTC = "texture-compression-astc", FeatureName.TimestampQuery = "timestamp-query", FeatureName.IndirectFirstInstance = "indirect-first-instance", FeatureName.ShaderF16 = "shader-f16", FeatureName.BGRA8UnormStorage = "bgra8unorm-storage";})(FeatureName || (FeatureName = {}));var BufferUsage;(function (BufferUsage) {BufferUsage[BufferUsage.MapRead = 1] = "MapRead", BufferUsage[BufferUsage.MapWrite = 2] = "MapWrite", BufferUsage[BufferUsage.CopySrc = 4] = "CopySrc", BufferUsage[BufferUsage.CopyDst = 8] = "CopyDst", BufferUsage[BufferUsage.Index = 16] = "Index", BufferUsage[BufferUsage.Vertex = 32] = "Vertex", BufferUsage[BufferUsage.Uniform = 64] = "Uniform", BufferUsage[BufferUsage.Storage = 128] = "Storage", BufferUsage[BufferUsage.Indirect = 256] = "Indirect", BufferUsage[BufferUsage.QueryResolve = 512] = "QueryResolve";})(BufferUsage || (BufferUsage = {}));var MapMode;(function (MapMode) {MapMode[MapMode.Read = 1] = "Read", MapMode[MapMode.Write = 2] = "Write";})(MapMode || (MapMode = {}));var TextureDimension;(function (TextureDimension) {TextureDimension.E1d = "1d", TextureDimension.E2d = "2d", TextureDimension.E3d = "3d";})(TextureDimension || (TextureDimension = {}));var TextureUsage;(function (TextureUsage) {TextureUsage[TextureUsage.CopySrc = 1] = "CopySrc", TextureUsage[TextureUsage.CopyDst = 2] = "CopyDst", TextureUsage[TextureUsage.TextureBinding = 4] = "TextureBinding", TextureUsage[TextureUsage.StorageBinding = 8] = "StorageBinding", TextureUsage[TextureUsage.RenderAttachment = 16] = "RenderAttachment";})(TextureUsage || (TextureUsage = {}));var TextureViewDimension;(function (TextureViewDimension) {TextureViewDimension.E1d = "1d", TextureViewDimension.E2d = "2d", TextureViewDimension.E2dArray = "2d-array", TextureViewDimension.Cube = "cube", TextureViewDimension.CubeArray = "cube-array", TextureViewDimension.E3d = "3d";})(TextureViewDimension || (TextureViewDimension = {}));var TextureAspect;(function (TextureAspect) {TextureAspect.All = "all", TextureAspect.StencilOnly = "stencil-only", TextureAspect.DepthOnly = "depth-only";})(TextureAspect || (TextureAspect = {}));var TextureFormat;(function (TextureFormat) {TextureFormat.R8Unorm = "r8unorm", TextureFormat.R8Snorm = "r8snorm", TextureFormat.R8Uint = "r8uint", TextureFormat.R8Sint = "r8sint", TextureFormat.R16Uint = "r16uint", TextureFormat.R16Sint = "r16sint", TextureFormat.R16Float = "r16float", TextureFormat.RG8Unorm = "rg8unorm", TextureFormat.RG8Snorm = "rg8snorm", TextureFormat.RG8Uint = "rg8uint", TextureFormat.RG8Sint = "rg8sint", TextureFormat.R32Uint = "r32uint", TextureFormat.R32Sint = "r32sint", TextureFormat.R32Float = "r32float", TextureFormat.RG16Uint = "rg16uint", TextureFormat.RG16Sint = "rg16sint", TextureFormat.RG16Float = "rg16float", TextureFormat.RGBA8Unorm = "rgba8unorm", TextureFormat.RGBA8UnormSRGB = "rgba8unorm-srgb", TextureFormat.RGBA8Snorm = "rgba8snorm", TextureFormat.RGBA8Uint = "rgba8uint", TextureFormat.RGBA8Sint = "rgba8sint", TextureFormat.BGRA8Unorm = "bgra8unorm", TextureFormat.BGRA8UnormSRGB = "bgra8unorm-srgb", TextureFormat.RGB9E5UFloat = "rgb9e5ufloat", TextureFormat.RGB10A2Unorm = "rgb10a2unorm", TextureFormat.RG11B10UFloat = "rg11b10ufloat", TextureFormat.RG32Uint = "rg32uint", TextureFormat.RG32Sint = "rg32sint", TextureFormat.RG32Float = "rg32float", TextureFormat.RGBA16Uint = "rgba16uint", TextureFormat.RGBA16Sint = "rgba16sint", TextureFormat.RGBA16Float = "rgba16float", TextureFormat.RGBA32Uint = "rgba32uint", TextureFormat.RGBA32Sint = "rgba32sint", TextureFormat.RGBA32Float = "rgba32float", TextureFormat.Stencil8 = "stencil8", TextureFormat.Depth16Unorm = "depth16unorm", TextureFormat.Depth24Plus = "depth24plus", TextureFormat.Depth24PlusStencil8 = "depth24plus-stencil8", TextureFormat.Depth32Float = "depth32float", TextureFormat.BC1RGBAUnorm = "bc1-rgba-unorm", TextureFormat.BC1RGBAUnormSRGB = "bc1-rgba-unorm-srgb", TextureFormat.BC2RGBAUnorm = "bc2-rgba-unorm", TextureFormat.BC2RGBAUnormSRGB = "bc2-rgba-unorm-srgb", TextureFormat.BC3RGBAUnorm = "bc3-rgba-unorm", TextureFormat.BC3RGBAUnormSRGB = "bc3-rgba-unorm-srgb", TextureFormat.BC4RUnorm = "bc4-r-unorm", TextureFormat.BC4RSnorm = "bc4-r-snorm", TextureFormat.BC5RGUnorm = "bc5-rg-unorm", TextureFormat.BC5RGSnorm = "bc5-rg-snorm", TextureFormat.BC6HRGBUFloat = "bc6h-rgb-ufloat", TextureFormat.BC6HRGBFloat = "bc6h-rgb-float", TextureFormat.BC7RGBAUnorm = "bc7-rgba-unorm", TextureFormat.BC7RGBAUnormSRGB = "bc7-rgba-unorm-srgb", TextureFormat.ETC2RGB8Unorm = "etc2-rgb8unorm", TextureFormat.ETC2RGB8UnormSRGB = "etc2-rgb8unorm-srgb", TextureFormat.ETC2RGB8A1Unorm = "etc2-rgb8a1unorm", TextureFormat.ETC2RGB8A1UnormSRGB = "etc2-rgb8a1unorm-srgb", TextureFormat.ETC2RGBA8Unorm = "etc2-rgba8unorm", TextureFormat.ETC2RGBA8UnormSRGB = "etc2-rgba8unorm-srgb", TextureFormat.EACR11Unorm = "eac-r11unorm", TextureFormat.EACR11Snorm = "eac-r11snorm", TextureFormat.EACRG11Unorm = "eac-rg11unorm", TextureFormat.EACRG11Snorm = "eac-rg11snorm", TextureFormat.ASTC4x4Unorm = "astc-4x4-unorm", TextureFormat.ASTC4x4UnormSRGB = "astc-4x4-unorm-srgb", TextureFormat.ASTC5x4Unorm = "astc-5x4-unorm", TextureFormat.ASTC5x4UnormSRGB = "astc-5x4-unorm-srgb", TextureFormat.ASTC5x5Unorm = "astc-5x5-unorm", TextureFormat.ASTC5x5UnormSRGB = "astc-5x5-unorm-srgb", TextureFormat.ASTC6x5Unorm = "astc-6x5-unorm", TextureFormat.ASTC6x5UnormSRGB = "astc-6x5-unorm-srgb", TextureFormat.ASTC6x6Unorm = "astc-6x6-unorm", TextureFormat.ASTC6x6UnormSRGB = "astc-6x6-unorm-srgb", TextureFormat.ASTC8x5Unorm = "astc-8x5-unorm", TextureFormat.ASTC8x5UnormSRGB = "astc-8x5-unorm-srgb", TextureFormat.ASTC8x6Unorm = "astc-8x6-unorm", TextureFormat.ASTC8x6UnormSRGB = "astc-8x6-unorm-srgb", TextureFormat.ASTC8x8Unorm = "astc-8x8-unorm", TextureFormat.ASTC8x8UnormSRGB = "astc-8x8-unorm-srgb", TextureFormat.ASTC10x5Unorm = "astc-10x5-unorm", TextureFormat.ASTC10x5UnormSRGB = "astc-10x5-unorm-srgb", TextureFormat.ASTC10x6Unorm = "astc-10x6-unorm", TextureFormat.ASTC10x6UnormSRGB = "astc-10x6-unorm-srgb", TextureFormat.ASTC10x8Unorm = "astc-10x8-unorm", TextureFormat.ASTC10x8UnormSRGB = "astc-10x8-unorm-srgb", TextureFormat.ASTC10x10Unorm = "astc-10x10-unorm", TextureFormat.ASTC10x10UnormSRGB = "astc-10x10-unorm-srgb", TextureFormat.ASTC12x10Unorm = "astc-12x10-unorm", TextureFormat.ASTC12x10UnormSRGB = "astc-12x10-unorm-srgb", TextureFormat.ASTC12x12Unorm = "astc-12x12-unorm", TextureFormat.ASTC12x12UnormSRGB = "astc-12x12-unorm-srgb", TextureFormat.Depth24UnormStencil8 = "depth24unorm-stencil8", TextureFormat.Depth32FloatStencil8 = "depth32float-stencil8";})(TextureFormat || (TextureFormat = {}));var AddressMode;(function (AddressMode) {AddressMode.ClampToEdge = "clamp-to-edge", AddressMode.Repeat = "repeat", AddressMode.MirrorRepeat = "mirror-repeat";})(AddressMode || (AddressMode = {}));var FilterMode;(function (FilterMode) {FilterMode.Nearest = "nearest", FilterMode.Linear = "linear";})(FilterMode || (FilterMode = {}));var CompareFunction;(function (CompareFunction) {CompareFunction.Never = "never", CompareFunction.Less = "less", CompareFunction.Equal = "equal", CompareFunction.LessEqual = "less-equal", CompareFunction.Greater = "greater", CompareFunction.NotEqual = "not-equal", CompareFunction.GreaterEqual = "greater-equal", CompareFunction.Always = "always";})(CompareFunction || (CompareFunction = {}));var ShaderStage;(function (ShaderStage) {ShaderStage[ShaderStage.Vertex = 1] = "Vertex", ShaderStage[ShaderStage.Fragment = 2] = "Fragment", ShaderStage[ShaderStage.Compute = 4] = "Compute";})(ShaderStage || (ShaderStage = {}));var BufferBindingType;(function (BufferBindingType) {BufferBindingType.Uniform = "uniform", BufferBindingType.Storage = "storage", BufferBindingType.ReadOnlyStorage = "read-only-storage";})(BufferBindingType || (BufferBindingType = {}));var SamplerBindingType;(function (SamplerBindingType) {SamplerBindingType.Filtering = "filtering", SamplerBindingType.NonFiltering = "non-filtering", SamplerBindingType.Comparison = "comparison";})(SamplerBindingType || (SamplerBindingType = {}));var TextureSampleType;(function (TextureSampleType) {TextureSampleType.Float = "float", TextureSampleType.UnfilterableFloat = "unfilterable-float", TextureSampleType.Depth = "depth", TextureSampleType.Sint = "sint", TextureSampleType.Uint = "uint";})(TextureSampleType || (TextureSampleType = {}));var StorageTextureAccess;(function (StorageTextureAccess) {StorageTextureAccess.WriteOnly = "write-only";})(StorageTextureAccess || (StorageTextureAccess = {}));var CompilationMessageType;(function (CompilationMessageType) {CompilationMessageType.Error = "error", CompilationMessageType.Warning = "warning", CompilationMessageType.Info = "info";})(CompilationMessageType || (CompilationMessageType = {}));var AutoLayoutMode;(function (AutoLayoutMode) {AutoLayoutMode.Auto = "auto";})(AutoLayoutMode || (AutoLayoutMode = {}));var PrimitiveTopology;(function (PrimitiveTopology) {PrimitiveTopology.PointList = "point-list", PrimitiveTopology.LineList = "line-list", PrimitiveTopology.LineStrip = "line-strip", PrimitiveTopology.TriangleList = "triangle-list", PrimitiveTopology.TriangleStrip = "triangle-strip";})(PrimitiveTopology || (PrimitiveTopology = {}));var FrontFace;(function (FrontFace) {FrontFace.CCW = "ccw", FrontFace.CW = "cw";})(FrontFace || (FrontFace = {}));var CullMode;(function (CullMode) {CullMode.None = "none", CullMode.Front = "front", CullMode.Back = "back";})(CullMode || (CullMode = {}));var ColorWriteFlags;(function (ColorWriteFlags) {ColorWriteFlags[ColorWriteFlags.Red = 1] = "Red", ColorWriteFlags[ColorWriteFlags.Green = 2] = "Green", ColorWriteFlags[ColorWriteFlags.Blue = 4] = "Blue", ColorWriteFlags[ColorWriteFlags.Alpha = 8] = "Alpha", ColorWriteFlags[ColorWriteFlags.All = 15] = "All";})(ColorWriteFlags || (ColorWriteFlags = {}));var BlendFactor;(function (BlendFactor) {BlendFactor.Zero = "zero", BlendFactor.One = "one", BlendFactor.Src = "src", BlendFactor.OneMinusSrc = "one-minus-src", BlendFactor.SrcAlpha = "src-alpha", BlendFactor.OneMinusSrcAlpha = "one-minus-src-alpha", BlendFactor.Dst = "dst", BlendFactor.OneMinusDst = "one-minus-dst", BlendFactor.DstAlpha = "dst-alpha", BlendFactor.OneMinusDstAlpha = "one-minus-dst-alpha", BlendFactor.SrcAlphaSaturated = "src-alpha-saturated", BlendFactor.Constant = "constant", BlendFactor.OneMinusConstant = "one-minus-constant";})(BlendFactor || (BlendFactor = {}));var BlendOperation;(function (BlendOperation) {BlendOperation.Add = "add", BlendOperation.Subtract = "subtract", BlendOperation.ReverseSubtract = "reverse-subtract", BlendOperation.Min = "min", BlendOperation.Max = "max";})(BlendOperation || (BlendOperation = {}));var StencilOperation;(function (StencilOperation) {StencilOperation.Keep = "keep", StencilOperation.Zero = "zero", StencilOperation.Replace = "replace", StencilOperation.Invert = "invert", StencilOperation.IncrementClamp = "increment-clamp", StencilOperation.DecrementClamp = "decrement-clamp", StencilOperation.IncrementWrap = "increment-wrap", StencilOperation.DecrementWrap = "decrement-wrap";})(StencilOperation || (StencilOperation = {}));var IndexFormat;(function (IndexFormat) {IndexFormat.Uint16 = "uint16", IndexFormat.Uint32 = "uint32";})(IndexFormat || (IndexFormat = {}));var VertexFormat;(function (VertexFormat) {VertexFormat.Uint8x2 = "uint8x2", VertexFormat.Uint8x4 = "uint8x4", VertexFormat.Sint8x2 = "sint8x2", VertexFormat.Sint8x4 = "sint8x4", VertexFormat.Unorm8x2 = "unorm8x2", VertexFormat.Unorm8x4 = "unorm8x4", VertexFormat.Snorm8x2 = "snorm8x2", VertexFormat.Snorm8x4 = "snorm8x4", VertexFormat.Uint16x2 = "uint16x2", VertexFormat.Uint16x4 = "uint16x4", VertexFormat.Sint16x2 = "sint16x2", VertexFormat.Sint16x4 = "sint16x4", VertexFormat.Unorm16x2 = "unorm16x2", VertexFormat.Unorm16x4 = "unorm16x4", VertexFormat.Snorm16x2 = "snorm16x2", VertexFormat.Snorm16x4 = "snorm16x4", VertexFormat.Float16x2 = "float16x2", VertexFormat.Float16x4 = "float16x4", VertexFormat.Float32 = "float32", VertexFormat.Float32x2 = "float32x2", VertexFormat.Float32x3 = "float32x3", VertexFormat.Float32x4 = "float32x4", VertexFormat.Uint32 = "uint32", VertexFormat.Uint32x2 = "uint32x2", VertexFormat.Uint32x3 = "uint32x3", VertexFormat.Uint32x4 = "uint32x4", VertexFormat.Sint32 = "sint32", VertexFormat.Sint32x2 = "sint32x2", VertexFormat.Sint32x3 = "sint32x3", VertexFormat.Sint32x4 = "sint32x4";})(VertexFormat || (VertexFormat = {}));var InputStepMode;(function (InputStepMode) {InputStepMode.Vertex = "vertex", InputStepMode.Instance = "instance";})(InputStepMode || (InputStepMode = {}));var ComputePassTimestampLocation;(function (ComputePassTimestampLocation) {ComputePassTimestampLocation.Beginning = "beginning", ComputePassTimestampLocation.End = "end";})(ComputePassTimestampLocation || (ComputePassTimestampLocation = {}));var RenderPassTimestampLocation;(function (RenderPassTimestampLocation) {RenderPassTimestampLocation.Beginning = "beginning", RenderPassTimestampLocation.End = "end";})(RenderPassTimestampLocation || (RenderPassTimestampLocation = {}));var LoadOp;(function (LoadOp) {LoadOp.Load = "load", LoadOp.Clear = "clear";})(LoadOp || (LoadOp = {}));var StoreOp;(function (StoreOp) {StoreOp.Store = "store", StoreOp.Discard = "discard";})(StoreOp || (StoreOp = {}));var QueryType;(function (QueryType) {QueryType.Occlusion = "occlusion", QueryType.Timestamp = "timestamp";})(QueryType || (QueryType = {}));var CanvasAlphaMode;(function (CanvasAlphaMode) {CanvasAlphaMode.Opaque = "opaque", CanvasAlphaMode.Premultiplied = "premultiplied";})(CanvasAlphaMode || (CanvasAlphaMode = {}));var DeviceLostReason;(function (DeviceLostReason) {DeviceLostReason.Destroyed = "destroyed";})(DeviceLostReason || (DeviceLostReason = {}));var ErrorFilter;(function (ErrorFilter) {ErrorFilter.OutOfMemory = "out-of-memory", ErrorFilter.Validation = "validation";})(ErrorFilter || (ErrorFilter = {}));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessor.js
class WebGPUShaderProcessor {constructor() {this.shaderLanguage = Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL;}_addUniformToLeftOverUBO(name, uniformType, preProcessors) {let length = 0;[name, uniformType, length] = this._getArraySize(name, uniformType, preProcessors);for (let i = 0; i < this._webgpuProcessingContext.leftOverUniforms.length; i++) if (this._webgpuProcessingContext.leftOverUniforms[i].name === name) return;this._webgpuProcessingContext.leftOverUniforms.push({ name, type: uniformType, length });}_buildLeftOverUBO() {if (!this._webgpuProcessingContext.leftOverUniforms.length) return "";const name = WebGPUShaderProcessor.LeftOvertUBOName;let availableUBO = this._webgpuProcessingContext.availableBuffers[name];return availableUBO || (availableUBO = { binding: this._webgpuProcessingContext.getNextFreeUBOBinding() }, this._webgpuProcessingContext.availableBuffers[name] = availableUBO, this._addBufferBindingDescription(name, availableUBO, BufferBindingType.Uniform, !0), this._addBufferBindingDescription(name, availableUBO, BufferBindingType.Uniform, !1)), this._generateLeftOverUBOCode(name, availableUBO);}_collectBindingNames() {for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i];if (setDefinition === void 0) {this._webgpuProcessingContext.bindGroupLayoutEntries[i] = [];continue;}for (let j = 0; j < setDefinition.length; j++) {const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j],name = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name,nameInArrayOfTexture = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].nameInArrayOfTexture;entry && (entry.texture || entry.externalTexture || entry.storageTexture ? this._webgpuProcessingContext.textureNames.push(nameInArrayOfTexture) : entry.sampler ? this._webgpuProcessingContext.samplerNames.push(name) : entry.buffer && this._webgpuProcessingContext.bufferNames.push(name));}}}_preCreateBindGroupEntries() {const bindGroupEntries = this._webgpuProcessingContext.bindGroupEntries;for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i],entries = [];for (let j = 0; j < setDefinition.length; j++) {const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j];entry.sampler || entry.texture || entry.storageTexture || entry.externalTexture ? entries.push({ binding: entry.binding, resource: void 0 }) : entry.buffer && entries.push({ binding: entry.binding, resource: { buffer: void 0, offset: 0, size: 0 } });}bindGroupEntries[i] = entries;}}_addTextureBindingDescription(name, textureInfo, textureIndex, dimension, format, isVertex) {let { groupIndex, bindingIndex } = textureInfo.textures[textureIndex];if (this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] || (this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [], this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = []), !this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {let len = null === dimension ? this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({ binding: bindingIndex, visibility: 0, externalTexture: {} }) : format ? this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({ binding: bindingIndex, visibility: 0, storageTexture: { access: StorageTextureAccess.WriteOnly, format, viewDimension: dimension } }) : this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({ binding: bindingIndex, visibility: 0, texture: { sampleType: textureInfo.sampleType, viewDimension: dimension, multisampled: !1 } });const textureName = textureInfo.isTextureArray ? name + textureIndex : name;this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1, nameInArrayOfTexture: textureName };}bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index, this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= isVertex ? ShaderStage.Vertex : ShaderStage.Fragment;}_addSamplerBindingDescription(name, samplerInfo, isVertex) {let { groupIndex, bindingIndex } = samplerInfo.binding;if (this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] || (this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [], this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = []), !this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({ binding: bindingIndex, visibility: 0, sampler: { type: samplerInfo.type } });this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1 };}bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index, this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= isVertex ? ShaderStage.Vertex : ShaderStage.Fragment;}_addBufferBindingDescription(name, uniformBufferInfo, bufferType, isVertex) {let { groupIndex, bindingIndex } = uniformBufferInfo.binding;if (this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] || (this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [], this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = []), !this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({ binding: bindingIndex, visibility: 0, buffer: { type: bufferType } });this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1 };}bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index, this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= isVertex ? ShaderStage.Vertex : ShaderStage.Fragment;}_injectStartingAndEndingCode(code, mainFuncDecl, startingCode, endingCode) {let idx = code.indexOf(mainFuncDecl);if (0 > idx) return console.error(`No "main" function found in shader code! Processing aborted.`), code;if (startingCode) {for (; idx++ < code.length && "{" != code.charAt(idx););if (idx < code.length) {const part1 = code.substring(0, idx + 1),part2 = code.substring(idx + 1);code = part1 + startingCode + part2;}}if (endingCode) {const lastClosingCurly = code.lastIndexOf("}");code = code.substring(0, lastClosingCurly), code += endingCode + "\n}";}return code;}}WebGPUShaderProcessor.AutoSamplerSuffix = "Sampler", WebGPUShaderProcessor.LeftOvertUBOName = "LeftOver", WebGPUShaderProcessor.InternalsUBOName = "Internals", WebGPUShaderProcessor.UniformSizes = { bool: 1, int: 1, float: 1, vec2: 2, ivec2: 2, vec3: 3, ivec3: 3, vec4: 4, ivec4: 4, mat2: 4, mat3: 12, mat4: 16, i32: 1, u32: 1, f32: 1, mat2x2: 4, mat3x3: 12, mat4x4: 16 }, WebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType = { sampler2D: "sampler2D", sampler2DArray: "sampler2DArray", sampler2DShadow: "sampler2DShadow", sampler2DArrayShadow: "sampler2DArrayShadow", samplerCube: "samplerCube", sampler3D: "sampler3D" }, WebGPUShaderProcessor._TextureTypeByWebGLSamplerType = { sampler2D: "texture2D", sampler2DArray: "texture2DArray", sampler2DShadow: "texture2D", sampler2DArrayShadow: "texture2DArray", samplerCube: "textureCube", samplerCubeArray: "textureCubeArray", sampler3D: "texture3D" }, WebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType = { textureCube: TextureViewDimension.Cube, textureCubeArray: TextureViewDimension.CubeArray, texture2D: TextureViewDimension.E2d, texture2DArray: TextureViewDimension.E2dArray, texture3D: TextureViewDimension.E3d }, WebGPUShaderProcessor._SamplerTypeByWebGLSamplerType = { sampler2DShadow: "samplerShadow", sampler2DArrayShadow: "samplerShadow" }, WebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType = { samplerShadow: !0, samplerArrayShadow: !0, sampler: !1 };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuPipelineContext.js
class WebGPUPipelineContext {get isAsync() {return !1;}get isReady() {return !!this.stages;}constructor(shaderProcessingContext, engine) {this._name = "unnamed", this.shaderProcessingContext = shaderProcessingContext, this._leftOverUniformsByName = {}, this.engine = engine;}_handlesSpectorRebuildCallback() {}_fillEffectInformation(effect, uniformBuffersNames, uniformsNames, uniforms, samplerList, samplers, attributesNames, attributes) {const engine = this.engine;effect._fragmentSourceCode = "", effect._vertexSourceCode = "";const foundSamplers = this.shaderProcessingContext.availableTextures;let index;for (index = 0; index < samplerList.length; index++) {const name = samplerList[index],sampler = foundSamplers[samplerList[index]];null == sampler || sampler == null ? (samplerList.splice(index, 1), index--) : samplers[name] = index;}for (const attr of engine.getAttributes(this, attributesNames)) attributes.push(attr);this.buildUniformLayout();const attributeNamesFromEffect = [],attributeLocationsFromEffect = [];for (index = 0; index < attributesNames.length; index++) {const location = attributes[index];0 <= location && (attributeNamesFromEffect.push(attributesNames[index]), attributeLocationsFromEffect.push(location));}this.shaderProcessingContext.attributeNamesFromEffect = attributeNamesFromEffect, this.shaderProcessingContext.attributeLocationsFromEffect = attributeLocationsFromEffect;}buildUniformLayout() {if (this.shaderProcessingContext.leftOverUniforms.length) {this.uniformBuffer = new uniformBuffer/* UniformBuffer */.M(this.engine, void 0, void 0, "leftOver-" + this._name);for (const leftOverUniform of this.shaderProcessingContext.leftOverUniforms) {const type = leftOverUniform.type.replace(/^(.*?)(<.*>)?$/, "$1"),size = WebGPUShaderProcessor.UniformSizes[type];this.uniformBuffer.addUniform(leftOverUniform.name, size, leftOverUniform.length), this._leftOverUniformsByName[leftOverUniform.name] = leftOverUniform.type;}this.uniformBuffer.create();}}dispose() {this.uniformBuffer && this.uniformBuffer.dispose();}setInt(uniformName, value) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateInt(uniformName, value);}setInt2(uniformName, x, y) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateInt2(uniformName, x, y);}setInt3(uniformName, x, y, z) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateInt3(uniformName, x, y, z);}setInt4(uniformName, x, y, z, w) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateInt4(uniformName, x, y, z, w);}setIntArray(uniformName, array) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateIntArray(uniformName, array);}setIntArray2(uniformName, array) {this.setIntArray(uniformName, array);}setIntArray3(uniformName, array) {this.setIntArray(uniformName, array);}setIntArray4(uniformName, array) {this.setIntArray(uniformName, array);}setUInt(uniformName, value) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateUInt(uniformName, value);}setUInt2(uniformName, x, y) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateUInt2(uniformName, x, y);}setUInt3(uniformName, x, y, z) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateUInt3(uniformName, x, y, z);}setUInt4(uniformName, x, y, z, w) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateUInt4(uniformName, x, y, z, w);}setUIntArray(uniformName, array) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateUIntArray(uniformName, array);}setUIntArray2(uniformName, array) {this.setUIntArray(uniformName, array);}setUIntArray3(uniformName, array) {this.setUIntArray(uniformName, array);}setUIntArray4(uniformName, array) {this.setUIntArray(uniformName, array);}setArray(uniformName, array) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateArray(uniformName, array);}setArray2(uniformName, array) {this.setArray(uniformName, array);}setArray3(uniformName, array) {this.setArray(uniformName, array);}setArray4(uniformName, array) {this.setArray(uniformName, array);}setMatrices(uniformName, matrices) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateMatrices(uniformName, matrices);}setMatrix(uniformName, matrix) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateMatrix(uniformName, matrix);}setMatrix3x3(uniformName, matrix) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateMatrix3x3(uniformName, matrix);}setMatrix2x2(uniformName, matrix) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateMatrix2x2(uniformName, matrix);}setFloat(uniformName, value) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateFloat(uniformName, value);}setVector2(uniformName, vector2) {this.setFloat2(uniformName, vector2.x, vector2.y);}setFloat2(uniformName, x, y) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateFloat2(uniformName, x, y);}setVector3(uniformName, vector3) {this.setFloat3(uniformName, vector3.x, vector3.y, vector3.z);}setFloat3(uniformName, x, y, z) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateFloat3(uniformName, x, y, z);}setVector4(uniformName, vector4) {this.setFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w);}setQuaternion(uniformName, quaternion) {this.setFloat4(uniformName, quaternion.x, quaternion.y, quaternion.z, quaternion.w);}setFloat4(uniformName, x, y, z, w) {this.uniformBuffer && this._leftOverUniformsByName[uniformName] && this.uniformBuffer.updateFloat4(uniformName, x, y, z, w);}setColor3(uniformName, color3) {this.setFloat3(uniformName, color3.r, color3.g, color3.b);}setColor4(uniformName, color3, alpha) {this.setFloat4(uniformName, color3.r, color3.g, color3.b, alpha);}setDirectColor4(uniformName, color4) {this.setFloat4(uniformName, color4.r, color4.g, color4.b, color4.a);}_getVertexShaderCode() {var _a;return null === (_a = this.sources) || void 0 === _a ? void 0 : _a.vertex;}_getFragmentShaderCode() {var _a;return null === (_a = this.sources) || void 0 === _a ? void 0 : _a.fragment;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessingContext.js
const _maxGroups = 4,_maxBindingsPerGroup = 65536,_typeToLocationSize = { mat2: 2, mat3: 3, mat4: 4, mat2x2: 2, mat3x3: 3, mat4x4: 4 };class WebGPUShaderProcessingContext {static get KnownUBOs() {return WebGPUShaderProcessingContext._SimplifiedKnownBindings ? WebGPUShaderProcessingContext._SimplifiedKnownUBOs : WebGPUShaderProcessingContext._KnownUBOs;}constructor(shaderLanguage) {this.shaderLanguage = shaderLanguage, this._attributeNextLocation = 0, this._varyingNextLocation = 0, this.freeGroupIndex = 0, this.freeBindingIndex = 0, this.availableVaryings = {}, this.availableAttributes = {}, this.availableBuffers = {}, this.availableTextures = {}, this.availableSamplers = {}, this.orderedAttributes = [], this.bindGroupLayoutEntries = [], this.bindGroupLayoutEntryInfo = [], this.bindGroupEntries = [], this.bufferNames = [], this.textureNames = [], this.samplerNames = [], this.leftOverUniforms = [], this._findStartingGroupBinding();}_findStartingGroupBinding() {const knownUBOs = WebGPUShaderProcessingContext.KnownUBOs,groups = [];for (const name in knownUBOs) {const binding = knownUBOs[name].binding;-1 !== binding.groupIndex && (groups[binding.groupIndex] = void 0 === groups[binding.groupIndex] ? binding.bindingIndex : Math.max(groups[binding.groupIndex], binding.bindingIndex));}this.freeGroupIndex = groups.length - 1, 0 === this.freeGroupIndex ? (this.freeGroupIndex++, this.freeBindingIndex = 0) : this.freeBindingIndex = groups[groups.length - 1] + 1;}getAttributeNextLocation(dataType, arrayLength = 0) {var _a;const index = this._attributeNextLocation;return this._attributeNextLocation += (null !== (_a = _typeToLocationSize[dataType]) && void 0 !== _a ? _a : 1) * (arrayLength || 1), index;}getVaryingNextLocation(dataType, arrayLength = 0) {var _a;const index = this._varyingNextLocation;return this._varyingNextLocation += (null !== (_a = _typeToLocationSize[dataType]) && void 0 !== _a ? _a : 1) * (arrayLength || 1), index;}getNextFreeUBOBinding() {return this._getNextFreeBinding(1);}_getNextFreeBinding(bindingCount) {if (this.freeBindingIndex > _maxBindingsPerGroup - bindingCount && (this.freeGroupIndex++, this.freeBindingIndex = 0), this.freeGroupIndex === _maxGroups) throw "Too many textures or UBOs have been declared and it is not supported in WebGPU.";const returnValue = { groupIndex: this.freeGroupIndex, bindingIndex: this.freeBindingIndex };return this.freeBindingIndex += bindingCount, returnValue;}}WebGPUShaderProcessingContext._SimplifiedKnownBindings = !0, WebGPUShaderProcessingContext._SimplifiedKnownUBOs = { Scene: { binding: { groupIndex: 0, bindingIndex: 0 } }, Light0: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light1: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light2: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light3: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light4: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light5: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light6: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light7: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light8: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light9: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light10: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light11: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light12: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light13: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light14: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light15: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light16: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light17: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light18: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light19: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light20: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light21: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light22: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light23: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light24: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light25: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light26: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light27: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light28: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light29: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light30: { binding: { groupIndex: -1, bindingIndex: -1 } }, Light31: { binding: { groupIndex: -1, bindingIndex: -1 } }, Material: { binding: { groupIndex: -1, bindingIndex: -1 } }, Mesh: { binding: { groupIndex: -1, bindingIndex: -1 } }, Internals: { binding: { groupIndex: -1, bindingIndex: -1 } } }, WebGPUShaderProcessingContext._KnownUBOs = { Scene: { binding: { groupIndex: 0, bindingIndex: 0 } }, Light0: { binding: { groupIndex: 1, bindingIndex: 0 } }, Light1: { binding: { groupIndex: 1, bindingIndex: 1 } }, Light2: { binding: { groupIndex: 1, bindingIndex: 2 } }, Light3: { binding: { groupIndex: 1, bindingIndex: 3 } }, Light4: { binding: { groupIndex: 1, bindingIndex: 4 } }, Light5: { binding: { groupIndex: 1, bindingIndex: 5 } }, Light6: { binding: { groupIndex: 1, bindingIndex: 6 } }, Light7: { binding: { groupIndex: 1, bindingIndex: 7 } }, Light8: { binding: { groupIndex: 1, bindingIndex: 8 } }, Light9: { binding: { groupIndex: 1, bindingIndex: 9 } }, Light10: { binding: { groupIndex: 1, bindingIndex: 10 } }, Light11: { binding: { groupIndex: 1, bindingIndex: 11 } }, Light12: { binding: { groupIndex: 1, bindingIndex: 12 } }, Light13: { binding: { groupIndex: 1, bindingIndex: 13 } }, Light14: { binding: { groupIndex: 1, bindingIndex: 14 } }, Light15: { binding: { groupIndex: 1, bindingIndex: 15 } }, Light16: { binding: { groupIndex: 1, bindingIndex: 16 } }, Light17: { binding: { groupIndex: 1, bindingIndex: 17 } }, Light18: { binding: { groupIndex: 1, bindingIndex: 18 } }, Light19: { binding: { groupIndex: 1, bindingIndex: 19 } }, Light20: { binding: { groupIndex: 1, bindingIndex: 20 } }, Light21: { binding: { groupIndex: 1, bindingIndex: 21 } }, Light22: { binding: { groupIndex: 1, bindingIndex: 22 } }, Light23: { binding: { groupIndex: 1, bindingIndex: 23 } }, Light24: { binding: { groupIndex: 1, bindingIndex: 24 } }, Light25: { binding: { groupIndex: 1, bindingIndex: 25 } }, Light26: { binding: { groupIndex: 1, bindingIndex: 26 } }, Light27: { binding: { groupIndex: 1, bindingIndex: 27 } }, Light28: { binding: { groupIndex: 1, bindingIndex: 28 } }, Light29: { binding: { groupIndex: 1, bindingIndex: 29 } }, Light30: { binding: { groupIndex: 1, bindingIndex: 30 } }, Light31: { binding: { groupIndex: 1, bindingIndex: 31 } }, Material: { binding: { groupIndex: 2, bindingIndex: 0 } }, Mesh: { binding: { groupIndex: 2, bindingIndex: 1 } }, Internals: { binding: { groupIndex: 2, bindingIndex: 2 } } };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessorsGLSL.js
class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor {constructor() {super(...arguments), this._missingVaryings = [], this._textureArrayProcessing = [], this._vertexIsGLES3 = !1, this._fragmentIsGLES3 = !1, this.shaderLanguage = Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL, this.parseGLES3 = !0;}_getArraySize(name, type, preProcessors) {let length = 0;const startArray = name.indexOf("["),endArray = name.indexOf("]");if (0 < startArray && 0 < endArray) {const lengthInString = name.substring(startArray + 1, endArray);length = +lengthInString, isNaN(length) && (length = +preProcessors[lengthInString.trim()]), name = name.substr(0, startArray);}return [name, type, length];}initializeShaders(processingContext) {this._webgpuProcessingContext = processingContext, this._missingVaryings.length = 0, this._textureArrayProcessing.length = 0, this.attributeKeywordName = void 0, this.varyingVertexKeywordName = void 0, this.varyingFragmentKeywordName = void 0;}preProcessShaderCode(code, isFragment) {const ubDeclaration = `// Internals UBO\r\nuniform ${WebGPUShaderProcessor.InternalsUBOName} {\nfloat yFactor_;\nfloat textureOutputHeight_;\n};\n`,alreadyInjected = -1 !== code.indexOf("// Internals UBO");return isFragment ? (this._fragmentIsGLES3 = -1 !== code.indexOf("#version 3"), this._fragmentIsGLES3 && (this.varyingFragmentKeywordName = "in"), alreadyInjected ? code : ubDeclaration + "##INJECTCODE##\n" + code) : (this._vertexIsGLES3 = -1 !== code.indexOf("#version 3"), this._vertexIsGLES3 && (this.attributeKeywordName = "in", this.varyingVertexKeywordName = "out"), alreadyInjected ? code : ubDeclaration + code);}varyingProcessor(varying, isFragment, preProcessors) {this._preProcessors = preProcessors;const regex = isFragment && this._fragmentIsGLES3 ? /\s*in\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm : !isFragment && this._vertexIsGLES3 ? /\s*out\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm : /\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,match = regex.exec(varying);if (null !== match) {const varyingType = match[1],name = match[2];let location;isFragment ? (location = this._webgpuProcessingContext.availableVaryings[name], this._missingVaryings[location] = "", location === void 0 && logger/* Logger.Warn */.Y.Warn(`Invalid fragment shader: The varying named "${name}" is not declared in the vertex shader! This declaration will be ignored.`)) : (location = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name, varyingType, preProcessors)[2]), this._webgpuProcessingContext.availableVaryings[name] = location, this._missingVaryings[location] = `layout(location = ${location}) in ${varyingType} ${name};`), varying = varying.replace(match[0], location === void 0 ? "" : `layout(location = ${location}) ${isFragment ? "in" : "out"} ${varyingType} ${name};`);}return varying;}attributeProcessor(attribute, preProcessors) {this._preProcessors = preProcessors;const regex = this._vertexIsGLES3 ? /\s*in\s+(\S+)\s+(\S+)\s*;/gm : /\s*attribute\s+(\S+)\s+(\S+)\s*;/gm,match = regex.exec(attribute);if (null !== match) {const attributeType = match[1],name = match[2],location = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name, attributeType, preProcessors)[2]);this._webgpuProcessingContext.availableAttributes[name] = location, this._webgpuProcessingContext.orderedAttributes[location] = name, attribute = attribute.replace(match[0], `layout(location = ${location}) in ${attributeType} ${name};`);}return attribute;}uniformProcessor(uniform, isFragment, preProcessors) {var _a;this._preProcessors = preProcessors;const match = /\s*uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm.exec(uniform);if (null !== match) {let uniformType = match[1],name = match[2];if (0 === uniformType.indexOf("sampler") || 1 === uniformType.indexOf("sampler")) {let arraySize = 0;[name, uniformType, arraySize] = this._getArraySize(name, uniformType, preProcessors);let textureInfo = this._webgpuProcessingContext.availableTextures[name];if (!textureInfo) {textureInfo = { autoBindSampler: !0, isTextureArray: 0 < arraySize, isStorageTexture: !1, textures: [], sampleType: TextureSampleType.Float };for (let i = 0; i < (arraySize || 1); ++i) textureInfo.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding());}const samplerType = null !== (_a = WebGPUShaderProcessor._SamplerTypeByWebGLSamplerType[uniformType]) && void 0 !== _a ? _a : "sampler",isComparisonSampler = !!WebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType[samplerType],samplerBindingType = isComparisonSampler ? SamplerBindingType.Comparison : SamplerBindingType.Filtering,samplerName = name + WebGPUShaderProcessor.AutoSamplerSuffix;let samplerInfo = this._webgpuProcessingContext.availableSamplers[samplerName];samplerInfo || (samplerInfo = { binding: this._webgpuProcessingContext.getNextFreeUBOBinding(), type: samplerBindingType });const componentType = "u" === uniformType.charAt(0) ? "u" : "i" === uniformType.charAt(0) ? "i" : "";componentType && (uniformType = uniformType.substr(1));const sampleType = isComparisonSampler ? TextureSampleType.Depth : "u" === componentType ? TextureSampleType.Uint : "i" === componentType ? TextureSampleType.Sint : TextureSampleType.Float;textureInfo.sampleType = sampleType;const isTextureArray = 0 < arraySize,samplerGroupIndex = samplerInfo.binding.groupIndex,samplerBindingIndex = samplerInfo.binding.bindingIndex,samplerFunction = WebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType[uniformType],textureType = WebGPUShaderProcessor._TextureTypeByWebGLSamplerType[uniformType],textureDimension = WebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType[textureType];if (!isTextureArray) arraySize = 1, uniform = `layout(set = ${samplerGroupIndex}, binding = ${samplerBindingIndex}) uniform ${componentType}${samplerType} ${samplerName};
                        layout(set = ${textureInfo.textures[0].groupIndex}, binding = ${textureInfo.textures[0].bindingIndex}) uniform ${textureType} ${name}Texture;
                        #define ${name} ${componentType}${samplerFunction}(${name}Texture, ${samplerName})`;else {const layouts = [];layouts.push(`layout(set = ${samplerGroupIndex}, binding = ${samplerBindingIndex}) uniform ${componentType}${samplerType} ${samplerName};`), uniform = `\r\n`;for (let i = 0; i < arraySize; ++i) {const textureSetIndex = textureInfo.textures[i].groupIndex,textureBindingIndex = textureInfo.textures[i].bindingIndex;layouts.push(`layout(set = ${textureSetIndex}, binding = ${textureBindingIndex}) uniform ${textureType} ${name}Texture${i};`), uniform += `${0 < i ? "\r\n" : ""}#define ${name}${i} ${componentType}${samplerFunction}(${name}Texture${i}, ${samplerName})`;}uniform = layouts.join("\r\n") + uniform, this._textureArrayProcessing.push(name);}this._webgpuProcessingContext.availableTextures[name] = textureInfo, this._webgpuProcessingContext.availableSamplers[samplerName] = samplerInfo, this._addSamplerBindingDescription(samplerName, samplerInfo, !isFragment);for (let i = 0; i < arraySize; ++i) this._addTextureBindingDescription(name, textureInfo, i, textureDimension, null, !isFragment);} else this._addUniformToLeftOverUBO(name, uniformType, preProcessors), uniform = "";}return uniform;}uniformBufferProcessor(uniformBuffer, isFragment) {const match = /uniform\s+(\w+)/gm.exec(uniformBuffer);if (null !== match) {const name = match[1];let uniformBufferInfo = this._webgpuProcessingContext.availableBuffers[name];if (!uniformBufferInfo) {const knownUBO = WebGPUShaderProcessingContext.KnownUBOs[name];let binding;binding = knownUBO && -1 !== knownUBO.binding.groupIndex ? knownUBO.binding : this._webgpuProcessingContext.getNextFreeUBOBinding(), uniformBufferInfo = { binding }, this._webgpuProcessingContext.availableBuffers[name] = uniformBufferInfo;}this._addBufferBindingDescription(name, uniformBufferInfo, BufferBindingType.Uniform, !isFragment), uniformBuffer = uniformBuffer.replace("uniform", `layout(set = ${uniformBufferInfo.binding.groupIndex}, binding = ${uniformBufferInfo.binding.bindingIndex}) uniform`);}return uniformBuffer;}postProcessor(code, defines, isFragment, processingContext, engine) {const hasDrawBuffersExtension = -1 !== code.search(/#extension.+GL_EXT_draw_buffers.+require/);if (code = code.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g, ""), code = code.replace(/texture2D\s*\(/g, "texture("), isFragment) {const hasFragCoord = 0 <= code.indexOf("gl_FragCoord"),injectCode = hasFragCoord ? "vec4 glFragCoord_;\n" : "";if (code = code.replace(/texture2DLodEXT\s*\(/g, "textureLod("), code = code.replace(/textureCubeLodEXT\s*\(/g, "textureLod("), code = code.replace(/textureCube\s*\(/g, "texture("), code = code.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), code = code.replace(/gl_FragColor/g, "glFragColor"), code = code.replace(/gl_FragData/g, "glFragData"), code = code.replace(/gl_FragCoord/g, "glFragCoord_"), !this._fragmentIsGLES3) code = code.replace(/void\s+?main\s*\(/g, (hasDrawBuffersExtension ? "" : "layout(location = 0) out vec4 glFragColor;\n") + "void main(");else {const match = /^\s*out\s+\S+\s+\S+\s*;/gm.exec(code);null !== match && (code = code.substring(0, match.index) + "layout(location = 0) " + code.substring(match.index));}code = code.replace(/dFdy/g, "(-yFactor_)*dFdy"), code = code.replace("##INJECTCODE##", injectCode), hasFragCoord && (code = this._injectStartingAndEndingCode(code, "void main", `
                glFragCoord_ = gl_FragCoord;
                if (yFactor_ == 1.) {
                    glFragCoord_.y = textureOutputHeight_ - glFragCoord_.y;
                }
            `));} else {code = code.replace(/gl_InstanceID/g, "gl_InstanceIndex"), code = code.replace(/gl_VertexID/g, "gl_VertexIndex");const hasMultiviewExtension = -1 !== defines.indexOf("#define MULTIVIEW");if (hasMultiviewExtension) return "#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n" + code;}if (!isFragment) {const lastClosingCurly = code.lastIndexOf("}");code = code.substring(0, lastClosingCurly), code += "gl_Position.y *= yFactor_;\n", engine.isNDCHalfZRange || (code += "gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0;\n"), code += "}";}return code;}_applyTextureArrayProcessing(code, name) {const regex = new RegExp(name + "\\s*\\[(.+)?\\]", "gm");for (let match = regex.exec(code); null !== match;) {const index = match[1];let iindex = +index;this._preProcessors && isNaN(iindex) && (iindex = +this._preProcessors[index.trim()]), code = code.replace(match[0], name + iindex), match = regex.exec(code);}return code;}_generateLeftOverUBOCode(name, uniformBufferDescription) {let ubo = `layout(set = ${uniformBufferDescription.binding.groupIndex}, binding = ${uniformBufferDescription.binding.bindingIndex}) uniform ${name} {\n    `;for (const leftOverUniform of this._webgpuProcessingContext.leftOverUniforms) ubo += 0 < leftOverUniform.length ? `    ${leftOverUniform.type} ${leftOverUniform.name}[${leftOverUniform.length}];\n` : `    ${leftOverUniform.type} ${leftOverUniform.name};\n`;return ubo += "};\n\n", ubo;}finalizeShaders(vertexCode, fragmentCode) {for (let i = 0; i < this._textureArrayProcessing.length; ++i) {const name = this._textureArrayProcessing[i];vertexCode = this._applyTextureArrayProcessing(vertexCode, name), fragmentCode = this._applyTextureArrayProcessing(fragmentCode, name);}for (let i = 0; i < this._missingVaryings.length; ++i) {const decl = this._missingVaryings[i];decl && 0 < decl.length && (fragmentCode = decl + "\n" + fragmentCode);}const leftOverUBO = this._buildLeftOverUBO();return vertexCode = leftOverUBO + vertexCode, fragmentCode = leftOverUBO + fragmentCode, this._collectBindingNames(), this._preCreateBindGroupEntries(), this._preProcessors = null, { vertexCode, fragmentCode };}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js
const bonesDeclaration_name = "bonesDeclaration",bonesDeclaration_shader = `#if NUM_BONE_INFLUENCERS>0
attribute matricesIndices : vec4<f32>;
attribute matricesWeights : vec4<f32>;
#if NUM_BONE_INFLUENCERS>4
attribute matricesIndicesExtra : vec4<f32>;
attribute matricesWeightsExtra : vec4<f32>;
#endif
#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#ifdef BONETEXTURE
var boneSampler : texture_2d<f32>;
uniform boneTextureWidth : f32;
#else
uniform mBones : array<mat4x4,BonesPerMesh>;
#ifdef BONES_VELOCITY_ENABLED
uniform mPreviousBones : array<mat4x4,BonesPerMesh>;
#endif
#endif
#ifdef BONETEXTURE
fn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4<f32>
{
let offset=i32(index) *4; 
let m0=textureLoad(smp,vec2<i32>(offset+0,0),0);
let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);
let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);
let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);
return mat4x4<f32>(m0,m1,m2,m3);
}
#endif
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.bonesDeclaration */.v.IncludesShadersStoreWGSL.bonesDeclaration = bonesDeclaration_shader;const bonesDeclaration_bonesDeclaration = { name: "bonesDeclaration", shader: bonesDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js
const bonesVertex_name = "bonesVertex",bonesVertex_shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#if NUM_BONE_INFLUENCERS>0
var influence : mat4x4<f32>;
#ifdef BONETEXTURE
influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];
#endif 
#if NUM_BONE_INFLUENCERS>4
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];
#endif 
#else 
influence=uniforms.mBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence=influence+uniforms.mBones[int(matricesIndices[1])]*matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
influence=influence+uniforms.mBones[int(matricesIndices[2])]*matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
influence=influence+uniforms.mBones[int(matricesIndices[3])]*matricesWeights[3];
#endif 
#if NUM_BONE_INFLUENCERS>4
influence=influence+uniforms.mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
influence=influence+uniforms.mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
influence=influence+uniforms.mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
influence=influence+uniforms.mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif 
#endif
finalWorld=finalWorld*influence;
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.bonesVertex */.v.IncludesShadersStoreWGSL.bonesVertex = bonesVertex_shader;const bonesVertex_bonesVertex = { name: "bonesVertex", shader: bonesVertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js
const bakedVertexAnimationDeclaration_name = "bakedVertexAnimationDeclaration",bakedVertexAnimationDeclaration_shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
uniform bakedVertexAnimationTime: f32;
uniform bakedVertexAnimationTextureSizeInverted: vec2<f32>;
uniform bakedVertexAnimationSettings: vec4<f32>;
var bakedVertexAnimationTexture : texture_2d<f32>;
#ifdef INSTANCES
attribute bakedVertexAnimationSettingsInstanced : vec4<f32>;
#endif
fn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->mat4x4<f32>
{
let offset=i32(index)*4;
let frameUV=i32(frame);
let m0=textureLoad(smp,vec2<i32>(offset+0,frameUV),0);
let m1=textureLoad(smp,vec2<i32>(offset+1,frameUV),0);
let m2=textureLoad(smp,vec2<i32>(offset+2,frameUV),0);
let m3=textureLoad(smp,vec2<i32>(offset+3,frameUV),0);
return mat4x4<f32>(m0,m1,m2,m3);
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.bakedVertexAnimationDeclaration */.v.IncludesShadersStoreWGSL.bakedVertexAnimationDeclaration = bakedVertexAnimationDeclaration_shader;const bakedVertexAnimationDeclaration_bakedVertexAnimationDeclaration = { name: "bakedVertexAnimationDeclaration", shader: bakedVertexAnimationDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js
const bakedVertexAnimation_name = "bakedVertexAnimation",bakedVertexAnimation_shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
{
#ifdef INSTANCES
let VATStartFrame: f32=bakedVertexAnimationSettingsInstanced.x;
let VATEndFrame: f32=bakedVertexAnimationSettingsInstanced.y;
let VATOffsetFrame: f32=bakedVertexAnimationSettingsInstanced.z;
let VATSpeed: f32=bakedVertexAnimationSettingsInstanced.w;
#else
let VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;
let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;
let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;
let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;
#endif
let totalFrames: f32=VATEndFrame-VATStartFrame+1.0;
let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;
let frameCorrection: f32=select(1.0,0.0,time<1.0);
let numOfFrames: f32=totalFrames-frameCorrection;
var VATFrameNum: f32=fract(time)*numOfFrames;
VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;
VATFrameNum=floor(VATFrameNum);
VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;
var VATInfluence : mat4x4<f32>;
VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];
#endif
finalWorld=finalWorld*VATInfluence;
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.bakedVertexAnimation */.v.IncludesShadersStoreWGSL.bakedVertexAnimation = bakedVertexAnimation_shader;const bakedVertexAnimation_bakedVertexAnimation = { name: "bakedVertexAnimation", shader: bakedVertexAnimation_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js
const clipPlaneFragment_name = "clipPlaneFragment",clipPlaneFragment_shader = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
if (false) {}
#endif
#ifdef CLIPPLANE
else if (fClipDistance>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE2
else if (fClipDistance2>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE3
else if (fClipDistance3>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE4
else if (fClipDistance4>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE5
else if (fClipDistance5>0.0)
{
discard;
}
#endif
#ifdef CLIPPLANE6
else if (fClipDistance6>0.0)
{
discard;
}
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.clipPlaneFragment */.v.IncludesShadersStoreWGSL.clipPlaneFragment = clipPlaneFragment_shader;const clipPlaneFragment_clipPlaneFragment = { name: "clipPlaneFragment", shader: clipPlaneFragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js
const clipPlaneFragmentDeclaration_name = "clipPlaneFragmentDeclaration",clipPlaneFragmentDeclaration_shader = `#ifdef CLIPPLANE
varying fClipDistance: f32;
#endif
#ifdef CLIPPLANE2
varying fClipDistance2: f32;
#endif
#ifdef CLIPPLANE3
varying fClipDistance3: f32;
#endif
#ifdef CLIPPLANE4
varying fClipDistance4: f32;
#endif
#ifdef CLIPPLANE5
varying fClipDistance5: f32;
#endif
#ifdef CLIPPLANE6
varying fClipDistance6: f32;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.clipPlaneFragmentDeclaration */.v.IncludesShadersStoreWGSL.clipPlaneFragmentDeclaration = clipPlaneFragmentDeclaration_shader;const clipPlaneFragmentDeclaration_clipPlaneFragmentDeclaration = { name: "clipPlaneFragmentDeclaration", shader: clipPlaneFragmentDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js
const clipPlaneVertex_name = "clipPlaneVertex",clipPlaneVertex_shader = `#ifdef CLIPPLANE
fClipDistance=dot(worldPos,uniforms.vClipPlane);
#endif
#ifdef CLIPPLANE2
fClipDistance2=dot(worldPos,uniforms.vClipPlane2);
#endif
#ifdef CLIPPLANE3
fClipDistance3=dot(worldPos,uniforms.vClipPlane3);
#endif
#ifdef CLIPPLANE4
fClipDistance4=dot(worldPos,uniforms.vClipPlane4);
#endif
#ifdef CLIPPLANE5
fClipDistance5=dot(worldPos,uniforms.vClipPlane5);
#endif
#ifdef CLIPPLANE6
fClipDistance6=dot(worldPos,uniforms.vClipPlane6);
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.clipPlaneVertex */.v.IncludesShadersStoreWGSL.clipPlaneVertex = clipPlaneVertex_shader;const clipPlaneVertex_clipPlaneVertex = { name: "clipPlaneVertex", shader: clipPlaneVertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js
const clipPlaneVertexDeclaration_name = "clipPlaneVertexDeclaration",clipPlaneVertexDeclaration_shader = `#ifdef CLIPPLANE
uniform vClipPlane: vec4<f32>;
varying fClipDistance: f32;
#endif
#ifdef CLIPPLANE2
uniform vClipPlane2: vec4<f32>;
varying fClipDistance2: f32;
#endif
#ifdef CLIPPLANE3
uniform vClipPlane3: vec4<f32>;
varying fClipDistance3: f32;
#endif
#ifdef CLIPPLANE4
uniform vClipPlane4: vec4<f32>;
varying fClipDistance4: f32;
#endif
#ifdef CLIPPLANE5
uniform vClipPlane5: vec4<f32>;
varying fClipDistance5: f32;
#endif
#ifdef CLIPPLANE6
uniform vClipPlane6: vec4<f32>;
varying fClipDistance6: f32;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.clipPlaneVertexDeclaration */.v.IncludesShadersStoreWGSL.clipPlaneVertexDeclaration = clipPlaneVertexDeclaration_shader;const clipPlaneVertexDeclaration_clipPlaneVertexDeclaration = { name: "clipPlaneVertexDeclaration", shader: clipPlaneVertexDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js
const instancesDeclaration_name = "instancesDeclaration",instancesDeclaration_shader = `#ifdef INSTANCES
attribute world0 : vec4<f32>;
attribute world1 : vec4<f32>;
attribute world2 : vec4<f32>;
attribute world3 : vec4<f32>;
#ifdef INSTANCESCOLOR
attribute instanceColor : vec4<f32>;
#endif
#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)
uniform world : mat4x4<f32>;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY)
attribute previousWorld0 : vec4<f32>;
attribute previousWorld1 : vec4<f32>;
attribute previousWorld2 : vec4<f32>;
attribute previousWorld3 : vec4<f32>;
#ifdef THIN_INSTANCES
uniform previousWorld : mat4x4<f32>;
#endif
#endif
#else
#if !defined(WORLD_UBO)
uniform world : mat4x4<f32>;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY)
uniform previousWorld : mat4x4<f32>;
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.instancesDeclaration */.v.IncludesShadersStoreWGSL.instancesDeclaration = instancesDeclaration_shader;const instancesDeclaration_instancesDeclaration = { name: "instancesDeclaration", shader: instancesDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js
const instancesVertex_name = "instancesVertex",instancesVertex_shader = `#ifdef INSTANCES
var finalWorld=mat4x4<f32>(world0,world1,world2,world3);
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
var finalPreviousWorld=mat4x4<f32>(previousWorld0,previousWorld1,previousWorld2,previousWorld3);
#endif
#ifdef THIN_INSTANCES
#if !defined(WORLD_UBO)
finalWorld=uniforms.world*finalWorld;
#else
finalWorld=mesh.world*finalWorld;
#endif
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
finalPreviousWorld=previousWorld*finalPreviousWorld;
#endif
#endif
#else
#if !defined(WORLD_UBO)
var finalWorld=uniforms.world;
#else
var finalWorld=mesh.world;
#endif
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
var finalPreviousWorld=previousWorld;
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.instancesVertex */.v.IncludesShadersStoreWGSL.instancesVertex = instancesVertex_shader;const instancesVertex_instancesVertex = { name: "instancesVertex", shader: instancesVertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/meshUboDeclaration.js
const meshUboDeclaration_name = "meshUboDeclaration",meshUboDeclaration_shader = `struct Mesh {
world : mat4x4<f32>,
visibility : f32,
};
var<uniform> mesh : Mesh;
#define WORLD_UBO
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.meshUboDeclaration */.v.IncludesShadersStoreWGSL.meshUboDeclaration = meshUboDeclaration_shader;const meshUboDeclaration = { name: "meshUboDeclaration", shader: meshUboDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertex.js
const morphTargetsVertex_name = "morphTargetsVertex",morphTargetsVertex_shader = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE 
vertexID=f32(gl_VertexID)*uniforms.morphTargetTextureInfo.x;
positionUpdated=positionUpdated+(readVector3FromRawSampler({X},vertexID)-position)*uniforms.morphTargetInfluences[{X}];
vertexID=vertexID+1.0;
#ifdef MORPHTARGETS_NORMAL
normalUpdated=normalUpdated+(readVector3FromRawSampler({X},vertexID) -normal)*uniforms.morphTargetInfluences[{X}];
vertexID=vertexID+1.0;
#endif
#ifdef MORPHTARGETS_UV
uvUpdated=uvUpdated+(readVector3FromRawSampler({X},vertexID).xy-uv)*uniforms.morphTargetInfluences[{X}];
vertexID=vertexID+1.0;
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz=tangentUpdated.xyz+(readVector3FromRawSampler({X},vertexID) -tangent.xyz)*uniforms.morphTargetInfluences[{X}];
#endif
#else
positionUpdated=positionUpdated+(position{X}-position)*uniforms.morphTargetInfluences[{X}];
#ifdef MORPHTARGETS_NORMAL
normalUpdated+=(normal{X}-normal)*uniforms.morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz=tangentUpdated.xyz+(tangent{X}-tangent.xyz)*uniforms.morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_UV
uvUpdated=uvUpdated+(uv_{X}-uv)*uniforms.morphTargetInfluences[{X}];
#endif
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.morphTargetsVertex */.v.IncludesShadersStoreWGSL.morphTargetsVertex = morphTargetsVertex_shader;const morphTargetsVertex = { name: "morphTargetsVertex", shader: morphTargetsVertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js
const morphTargetsVertexDeclaration_name = "morphTargetsVertexDeclaration",morphTargetsVertexDeclaration_shader = `#ifdef MORPHTARGETS
#ifndef MORPHTARGETS_TEXTURE
attribute position{X} : vec3<f32>;
#ifdef MORPHTARGETS_NORMAL
attribute normal{X} : vec3<f32>;
#endif
#ifdef MORPHTARGETS_TANGENT
attribute tangent{X} : vec3<f32>;
#endif
#ifdef MORPHTARGETS_UV
attribute uv_{X} : vec2<f32>;
#endif
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.morphTargetsVertexDeclaration */.v.IncludesShadersStoreWGSL.morphTargetsVertexDeclaration = morphTargetsVertexDeclaration_shader;const morphTargetsVertexDeclaration = { name: "morphTargetsVertexDeclaration", shader: morphTargetsVertexDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobal.js
const morphTargetsVertexGlobal_name = "morphTargetsVertexGlobal",morphTargetsVertexGlobal_shader = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE
var vertexID : f32;
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.morphTargetsVertexGlobal */.v.IncludesShadersStoreWGSL.morphTargetsVertexGlobal = morphTargetsVertexGlobal_shader;const morphTargetsVertexGlobal = { name: "morphTargetsVertexGlobal", shader: morphTargetsVertexGlobal_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
const morphTargetsVertexGlobalDeclaration_name = "morphTargetsVertexGlobalDeclaration",morphTargetsVertexGlobalDeclaration_shader = `#ifdef MORPHTARGETS
uniform morphTargetInfluences : array<f32,NUM_MORPH_INFLUENCERS>;
#ifdef MORPHTARGETS_TEXTURE 
uniform morphTargetTextureIndices : array<f32,NUM_MORPH_INFLUENCERS>;
uniform morphTargetTextureInfo : vec3<f32>;
var morphTargets : texture_2d_array<f32>;
var morphTargetsSampler : sampler;
fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3<f32>
{ 
let y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);
let x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;
let textureUV=vec2<f32>((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);
return textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0).xyz;
}
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.morphTargetsVertexGlobalDeclaration */.v.IncludesShadersStoreWGSL.morphTargetsVertexGlobalDeclaration = morphTargetsVertexGlobalDeclaration_shader;const morphTargetsVertexGlobalDeclaration = { name: "morphTargetsVertexGlobalDeclaration", shader: morphTargetsVertexGlobalDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js
const sceneUboDeclaration_name = "sceneUboDeclaration",sceneUboDeclaration_shader = `struct Scene {
viewProjection : mat4x4<f32>,
#ifdef MULTIVIEW
viewProjectionR : mat4x4<f32>,
#endif 
view : mat4x4<f32>,
projection : mat4x4<f32>,
vEyePosition : vec4<f32>,
};
var<uniform> scene : Scene;
`;shaderStore/* ShaderStore.IncludesShadersStoreWGSL.sceneUboDeclaration */.v.IncludesShadersStoreWGSL.sceneUboDeclaration = sceneUboDeclaration_shader;const sceneUboDeclaration = { name: "sceneUboDeclaration", shader: sceneUboDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessorsWGSL.js
const builtInName_vertex_index = "gl_VertexID",builtInName_instance_index = "gl_InstanceID",builtInName_position = "gl_Position",builtInName_position_frag = "gl_FragCoord",builtInName_front_facing = "gl_FrontFacing",builtInName_frag_depth = "gl_FragDepth",builtInName_FragColor = "gl_FragColor",leftOverVarName = "uniforms",internalsVarName = "internals",gpuTextureViewDimensionByWebGPUTextureFunction = { texture_1d: TextureViewDimension.E1d, texture_2d: TextureViewDimension.E2d, texture_2d_array: TextureViewDimension.E2dArray, texture_3d: TextureViewDimension.E3d, texture_cube: TextureViewDimension.Cube, texture_cube_array: TextureViewDimension.CubeArray, texture_multisampled_2d: TextureViewDimension.E2d, texture_depth_2d: TextureViewDimension.E2d, texture_depth_2d_array: TextureViewDimension.E2dArray, texture_depth_cube: TextureViewDimension.Cube, texture_depth_cube_array: TextureViewDimension.CubeArray, texture_depth_multisampled_2d: TextureViewDimension.E2d, texture_storage_1d: TextureViewDimension.E1d, texture_storage_2d: TextureViewDimension.E2d, texture_storage_2d_array: TextureViewDimension.E2dArray, texture_storage_3d: TextureViewDimension.E3d, texture_external: null };class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor {constructor() {super(...arguments), this.shaderLanguage = Materials_shaderLanguage/* ShaderLanguage.WGSL */.x.WGSL, this.uniformRegexp = /uniform\s+(\w+)\s*:\s*(.+)\s*;/, this.textureRegexp = /var\s+(\w+)\s*:\s*((array<\s*)?(texture_\w+)\s*(<\s*(.+)\s*>)?\s*(,\s*\w+\s*>\s*)?);/, this.noPrecision = !0;}_getArraySize(name, uniformType, preProcessors) {let length = 0;const endArray = uniformType.lastIndexOf(">");if (0 <= uniformType.indexOf("array") && 0 < endArray) {let startArray = endArray;for (; 0 < startArray && " " !== uniformType.charAt(startArray) && "," !== uniformType.charAt(startArray);) startArray--;const lengthInString = uniformType.substring(startArray + 1, endArray);for (length = +lengthInString, isNaN(length) && (length = +preProcessors[lengthInString.trim()]); 0 < startArray && (" " === uniformType.charAt(startArray) || "," === uniformType.charAt(startArray));) startArray--;uniformType = uniformType.substring(uniformType.indexOf("<") + 1, startArray + 1);}return [name, uniformType, length];}initializeShaders(processingContext) {this._webgpuProcessingContext = processingContext, this._attributesWGSL = [], this._attributesDeclWGSL = [], this._attributeNamesWGSL = [], this._varyingsWGSL = [], this._varyingsDeclWGSL = [], this._varyingNamesWGSL = [], this._stridedUniformArrays = [];}preProcessShaderCode(code) {return `struct ${WebGPUShaderProcessor.InternalsUBOName} {\nyFactor_: f32,\ntextureOutputHeight_: f32,\n};\nvar<uniform> ${internalsVarName} : ${WebGPUShaderProcessor.InternalsUBOName};\n` + RemoveComments(code);}varyingProcessor(varying, isFragment, preProcessors) {const match = /\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s*:\s*(.+)\s*;/gm.exec(varying);if (null !== match) {const varyingType = match[2],name = match[1];let location;isFragment ? (location = this._webgpuProcessingContext.availableVaryings[name], location === void 0 && logger/* Logger.Warn */.Y.Warn(`Invalid fragment shader: The varying named "${name}" is not declared in the vertex shader! This declaration will be ignored.`)) : (location = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name, varyingType, preProcessors)[2]), this._webgpuProcessingContext.availableVaryings[name] = location, this._varyingsWGSL.push(`@location(${location}) ${name} : ${varyingType},`), this._varyingsDeclWGSL.push(`var<private> ${name} : ${varyingType};`), this._varyingNamesWGSL.push(name)), varying = "";}return varying;}attributeProcessor(attribute, preProcessors) {const match = /\s*attribute\s+(\S+)\s*:\s*(.+)\s*;/gm.exec(attribute);if (null !== match) {const attributeType = match[2],name = match[1],location = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name, attributeType, preProcessors)[2]);this._webgpuProcessingContext.availableAttributes[name] = location, this._webgpuProcessingContext.orderedAttributes[location] = name, this._attributesWGSL.push(`@location(${location}) ${name} : ${attributeType},`), this._attributesDeclWGSL.push(`var<private> ${name} : ${attributeType};`), this._attributeNamesWGSL.push(name), attribute = "";}return attribute;}uniformProcessor(uniform, isFragment, preProcessors) {const match = this.uniformRegexp.exec(uniform);if (null !== match) {const uniformType = match[2],name = match[1];this._addUniformToLeftOverUBO(name, uniformType, preProcessors), uniform = "";}return uniform;}textureProcessor(texture, isFragment, preProcessors) {const match = this.textureRegexp.exec(texture);if (null !== match) {const name = match[1],type = match[2],isArrayOfTexture = !!match[3],textureFunc = match[4],isStorageTexture = 0 < textureFunc.indexOf("storage"),componentType = match[6],storageTextureFormat = isStorageTexture ? componentType.substring(0, componentType.indexOf(",")).trim() : null;let arraySize = isArrayOfTexture ? this._getArraySize(name, type, preProcessors)[2] : 0,textureInfo = this._webgpuProcessingContext.availableTextures[name];if (!textureInfo) {textureInfo = { isTextureArray: 0 < arraySize, isStorageTexture, textures: [], sampleType: TextureSampleType.Float }, arraySize = arraySize || 1;for (let i = 0; i < arraySize; ++i) textureInfo.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding());} else arraySize = textureInfo.textures.length;this._webgpuProcessingContext.availableTextures[name] = textureInfo;const isDepthTexture = 0 < textureFunc.indexOf("depth"),textureDimension = gpuTextureViewDimensionByWebGPUTextureFunction[textureFunc],sampleType = isDepthTexture ? TextureSampleType.Depth : "u32" === componentType ? TextureSampleType.Uint : "i32" === componentType ? TextureSampleType.Sint : TextureSampleType.Float;if (textureInfo.sampleType = sampleType, void 0 === textureDimension) throw `Can't get the texture dimension corresponding to the texture function "${textureFunc}"!`;for (let i = 0; i < arraySize; ++i) {const { groupIndex, bindingIndex } = textureInfo.textures[i];0 == i && (texture = `@group(${groupIndex}) @binding(${bindingIndex}) ${texture}`), this._addTextureBindingDescription(name, textureInfo, i, textureDimension, storageTextureFormat, !isFragment);}}return texture;}postProcessor(code) {return code;}finalizeShaders(vertexCode, fragmentCode) {const fragCoordCode = 0 <= fragmentCode.indexOf("gl_FragCoord") ? `
            if (internals.yFactor_ == 1.) {
                gl_FragCoord.y = internals.textureOutputHeight_ - gl_FragCoord.y;
            }
        ` : "";vertexCode = this._processSamplers(vertexCode, !0), fragmentCode = this._processSamplers(fragmentCode, !1), vertexCode = this._processCustomBuffers(vertexCode, !0), fragmentCode = this._processCustomBuffers(fragmentCode, !1);const leftOverUBO = this._buildLeftOverUBO();vertexCode = leftOverUBO + vertexCode, fragmentCode = leftOverUBO + fragmentCode, vertexCode = vertexCode.replace(/#define /g, "//#define "), vertexCode = this._processStridedUniformArrays(vertexCode);const varyingsDecl = this._varyingsDeclWGSL.join("\n") + "\n",vertexAttributesDecl = this._attributesDeclWGSL.join("\n") + "\n";let vertexInputs = "struct VertexInputs {\n  @builtin(vertex_index) vertexIndex : u32,\n  @builtin(instance_index) instanceIndex : u32,\n";0 < this._attributesWGSL.length && (vertexInputs += this._attributesWGSL.join("\n")), vertexInputs += "\n};\n";let vertexFragmentInputs = "struct FragmentInputs {\n  @builtin(position) position : vec4<f32>,\n";0 < this._varyingsWGSL.length && (vertexFragmentInputs += this._varyingsWGSL.join("\n")), vertexFragmentInputs += "\n};\n", vertexCode = `var<private> ${builtInName_vertex_index} : u32;\nvar<private> ${builtInName_instance_index} : u32;\nvar<private> ${builtInName_position} : vec4<f32>;\n` + vertexInputs + vertexAttributesDecl + vertexFragmentInputs + varyingsDecl + vertexCode;let vertexStartingCode = `  var output : FragmentInputs;\n  ${builtInName_vertex_index} = input.vertexIndex;\n  ${builtInName_instance_index} = input.instanceIndex;\n`;for (let i = 0; i < this._attributeNamesWGSL.length; ++i) {const name = this._attributeNamesWGSL[i];vertexStartingCode += `  ${name} = input.${name};\n`;}let vertexEndingCode = `  output.position = ${builtInName_position};\n  output.position.y = output.position.y * internals.yFactor_;\n`;for (let i = 0; i < this._varyingNamesWGSL.length; ++i) {const name = this._varyingNamesWGSL[i];vertexEndingCode += `  output.${name} = ${name};\n`;}vertexEndingCode += "  return output;", vertexCode = this._injectStartingAndEndingCode(vertexCode, "fn main", vertexStartingCode, vertexEndingCode), fragmentCode = fragmentCode.replace(/#define /g, "//#define "), fragmentCode = this._processStridedUniformArrays(fragmentCode), fragmentCode = fragmentCode.replace(/dpdy/g, "(-internals.yFactor_)*dpdy");let fragmentFragmentInputs = "struct FragmentInputs {\n  @builtin(position) position : vec4<f32>,\n  @builtin(front_facing) frontFacing : bool,\n";0 < this._varyingsWGSL.length && (fragmentFragmentInputs += this._varyingsWGSL.join("\n")), fragmentFragmentInputs += "\n};\n";let fragmentOutputs = "struct FragmentOutputs {\n  @location(0) color : vec4<f32>,\n",hasFragDepth = !1,idx = 0;for (; !hasFragDepth && (idx = fragmentCode.indexOf(builtInName_frag_depth, idx), !(0 > idx));) {const saveIndex = idx;for (hasFragDepth = !0; 1 < idx && "\n" !== fragmentCode.charAt(idx);) {if ("/" === fragmentCode.charAt(idx) && "/" === fragmentCode.charAt(idx - 1)) {hasFragDepth = !1;break;}idx--;}idx = saveIndex + builtInName_frag_depth.length;}hasFragDepth && (fragmentOutputs += "  @builtin(frag_depth) fragDepth: f32,\n"), fragmentOutputs += "};\n", fragmentCode = `var<private> ${builtInName_position_frag} : vec4<f32>;\nvar<private> ${builtInName_front_facing} : bool;\nvar<private> ${builtInName_FragColor} : vec4<f32>;\nvar<private> ${builtInName_frag_depth} : f32;\n` + fragmentFragmentInputs + varyingsDecl + fragmentOutputs + fragmentCode;let fragmentStartingCode = `  var output : FragmentOutputs;\n  ${builtInName_position_frag} = input.position;\n  ${builtInName_front_facing} = input.frontFacing;\n` + fragCoordCode;for (let i = 0; i < this._varyingNamesWGSL.length; ++i) {const name = this._varyingNamesWGSL[i];fragmentStartingCode += `  ${name} = input.${name};\n`;}let fragmentEndingCode = `  output.color = ${builtInName_FragColor};\n`;return hasFragDepth && (fragmentEndingCode += `  output.fragDepth = ${builtInName_frag_depth};\n`), fragmentEndingCode += "  return output;", fragmentCode = this._injectStartingAndEndingCode(fragmentCode, "fn main", fragmentStartingCode, fragmentEndingCode), this._collectBindingNames(), this._preCreateBindGroupEntries(), { vertexCode, fragmentCode };}_generateLeftOverUBOCode(name, uniformBufferDescription) {let stridedArrays = "",ubo = `struct ${name} {\n`;for (const leftOverUniform of this._webgpuProcessingContext.leftOverUniforms) {const type = leftOverUniform.type.replace(/^(.*?)(<.*>)?$/, "$1"),size = WebGPUShaderProcessor.UniformSizes[type];if (!(0 < leftOverUniform.length)) ubo += `  ${leftOverUniform.name} : ${leftOverUniform.type},\n`;else if (2 >= size) {const stridedArrayType = `${name}_${this._stridedUniformArrays.length}_strided_arr`;stridedArrays += `struct ${stridedArrayType} {
                        @size(16)
                        el: ${type},
                    }`, this._stridedUniformArrays.push(leftOverUniform.name), ubo += ` @align(16) ${leftOverUniform.name} : array<${stridedArrayType}, ${leftOverUniform.length}>,\n`;} else ubo += ` ${leftOverUniform.name} : array<${leftOverUniform.type}, ${leftOverUniform.length}>,\n`;}return ubo += "};\n", ubo = `${stridedArrays}\n${ubo}`, ubo += `@group(${uniformBufferDescription.binding.groupIndex}) @binding(${uniformBufferDescription.binding.bindingIndex}) var<uniform> ${leftOverVarName} : ${name};\n`, ubo;}_processSamplers(code, isVertex) {for (const samplerRegexp = /var\s+(\w+Sampler)\s*:\s*(sampler|sampler_comparison)\s*;/gm;;) {const match = samplerRegexp.exec(code);if (null === match) break;const name = match[1],samplerType = match[2],textureName = name.indexOf(WebGPUShaderProcessor.AutoSamplerSuffix) === name.length - WebGPUShaderProcessor.AutoSamplerSuffix.length ? name.substring(0, name.indexOf(WebGPUShaderProcessor.AutoSamplerSuffix)) : null,samplerBindingType = "sampler_comparison" === samplerType ? SamplerBindingType.Comparison : SamplerBindingType.Filtering;if (textureName) {const textureInfo = this._webgpuProcessingContext.availableTextures[textureName];textureInfo && (textureInfo.autoBindSampler = !0);}let samplerInfo = this._webgpuProcessingContext.availableSamplers[name];samplerInfo || (samplerInfo = { binding: this._webgpuProcessingContext.getNextFreeUBOBinding(), type: samplerBindingType }, this._webgpuProcessingContext.availableSamplers[name] = samplerInfo), this._addSamplerBindingDescription(name, samplerInfo, isVertex);const part1 = code.substring(0, match.index),insertPart = `@group(${samplerInfo.binding.groupIndex}) @binding(${samplerInfo.binding.bindingIndex}) `,part2 = code.substring(match.index);code = part1 + insertPart + part2, samplerRegexp.lastIndex += insertPart.length;}return code;}_processCustomBuffers(code, isVertex) {for (const instantiateBufferRegexp = /var<\s*(uniform|storage)\s*(,\s*(read|read_write)\s*)?>\s+(\S+)\s*:\s*(\S+)\s*;/gm;;) {const match = instantiateBufferRegexp.exec(code);if (null === match) break;const type = match[1],decoration = match[3];let name = match[4];const structName = match[5];let bufferInfo = this._webgpuProcessingContext.availableBuffers[name];if (!bufferInfo) {const knownUBO = "uniform" === type ? WebGPUShaderProcessingContext.KnownUBOs[structName] : null;let binding;knownUBO ? (name = structName, binding = knownUBO.binding, -1 === binding.groupIndex && (binding = this._webgpuProcessingContext.getNextFreeUBOBinding())) : binding = this._webgpuProcessingContext.getNextFreeUBOBinding(), bufferInfo = { binding }, this._webgpuProcessingContext.availableBuffers[name] = bufferInfo;}this._addBufferBindingDescription(name, this._webgpuProcessingContext.availableBuffers[name], "read_write" === decoration ? BufferBindingType.Storage : "storage" === type ? BufferBindingType.ReadOnlyStorage : BufferBindingType.Uniform, isVertex);const groupIndex = bufferInfo.binding.groupIndex,bindingIndex = bufferInfo.binding.bindingIndex,part1 = code.substring(0, match.index),insertPart = `@group(${groupIndex}) @binding(${bindingIndex}) `,part2 = code.substring(match.index);code = part1 + insertPart + part2, instantiateBufferRegexp.lastIndex += insertPart.length;}return code;}_processStridedUniformArrays(code) {for (const uniformArrayName of this._stridedUniformArrays) code = code.replace(new RegExp(`${uniformArrayName}\\s*\\[(.*)\\]`, "g"), `${uniformArrayName}[$1].el`);return code;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuHardwareTexture.js
class WebGPUHardwareTexture {get underlyingResource() {return this._webgpuTexture;}get msaaTexture() {return this._webgpuMSAATexture;}set msaaTexture(texture) {this._webgpuMSAATexture = texture;}constructor(existingTexture = null) {this.format = TextureFormat.RGBA8Unorm, this.textureUsages = 0, this.textureAdditionalUsages = 0, this._webgpuTexture = existingTexture, this._webgpuMSAATexture = null, this.view = null, this.viewForWriting = null;}set(hardwareTexture) {this._webgpuTexture = hardwareTexture;}setUsage(textureSource, generateMipMaps, isCube, width, height) {generateMipMaps = textureSource !== Textures_internalTexture/* InternalTextureSource.RenderTarget */.S.RenderTarget && generateMipMaps, this.createView({ format: this.format, dimension: isCube ? TextureViewDimension.Cube : TextureViewDimension.E2d, mipLevelCount: generateMipMaps ? math_scalar/* Scalar.ILog2 */.R.ILog2(Math.max(width, height)) + 1 : 1, baseArrayLayer: 0, baseMipLevel: 0, arrayLayerCount: isCube ? 6 : 1, aspect: TextureAspect.All });}createView(descriptor, createViewForWriting = !1) {if (this.view = this._webgpuTexture.createView(descriptor), createViewForWriting && descriptor) {const saveNumMipMaps = descriptor.mipLevelCount;descriptor.mipLevelCount = 1, this.viewForWriting = this._webgpuTexture.createView(descriptor), descriptor.mipLevelCount = saveNumMipMaps;}}reset() {this._webgpuTexture = null, this._webgpuMSAATexture = null, this.view = null, this.viewForWriting = null;}release() {var _a, _b, _c;null === (_a = this._webgpuTexture) || void 0 === _a ? void 0 : _a.destroy(), null === (_b = this._webgpuMSAATexture) || void 0 === _b ? void 0 : _b.destroy(), null === (_c = this._copyInvertYTempTexture) || void 0 === _c ? void 0 : _c.destroy(), this.reset();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuTextureHelper.js
const mipmapVertexSource = (/* unused pure expression or super */ null && (`
    const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));
    const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f));

    layout(location = 0) out vec2 vTex;

    void main() {
        vTex = tex[gl_VertexIndex];
        gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);
    }
    `)),mipmapFragmentSource = `
    layout(set = 0, binding = 0) uniform sampler imgSampler;
    layout(set = 0, binding = 1) uniform texture2D img;

    layout(location = 0) in vec2 vTex;
    layout(location = 0) out vec4 outColor;

    void main() {
        outColor = texture(sampler2D(img, imgSampler), vTex);
    }
    `,invertYPreMultiplyAlphaVertexSource = `
    #extension GL_EXT_samplerless_texture_functions : enable

    const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));
    const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f));

    layout(set = 0, binding = 0) uniform texture2D img;

    #ifdef INVERTY
        layout(location = 0) out flat ivec2 vTextureSize;
    #endif

    void main() {
        #ifdef INVERTY
            vTextureSize = textureSize(img, 0);
        #endif
        gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);
    }
    `,invertYPreMultiplyAlphaFragmentSource = `
    #extension GL_EXT_samplerless_texture_functions : enable

    layout(set = 0, binding = 0) uniform texture2D img;

    #ifdef INVERTY
        layout(location = 0) in flat ivec2 vTextureSize;
    #endif
    layout(location = 0) out vec4 outColor;

    void main() {
    #ifdef INVERTY
        vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, vTextureSize.y - gl_FragCoord.y), 0);
    #else
        vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0);
    #endif
    #ifdef PREMULTIPLYALPHA
        color.rgb *= color.a;
    #endif
        outColor = color;
    }
    `,invertYPreMultiplyAlphaWithOfstVertexSource = invertYPreMultiplyAlphaVertexSource,invertYPreMultiplyAlphaWithOfstFragmentSource = `
    #extension GL_EXT_samplerless_texture_functions : enable

    layout(set = 0, binding = 0) uniform texture2D img;
    layout(set = 0, binding = 1) uniform Params {
        float ofstX;
        float ofstY;
        float width;
        float height;
    };

    #ifdef INVERTY
        layout(location = 0) in flat ivec2 vTextureSize;
    #endif
    layout(location = 0) out vec4 outColor;

    void main() {
        if (gl_FragCoord.x < ofstX || gl_FragCoord.x >= ofstX + width) {
            discard;
        }
        if (gl_FragCoord.y < ofstY || gl_FragCoord.y >= ofstY + height) {
            discard;
        }
    #ifdef INVERTY
        vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, ofstY + height - (gl_FragCoord.y - ofstY)), 0);
    #else
        vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0);
    #endif
    #ifdef PREMULTIPLYALPHA
        color.rgb *= color.a;
    #endif
        outColor = color;
    }
    `,clearVertexSource = `
    const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));

    void main() {
        gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);
    }
    `,clearFragmentSource = `
    layout(set = 0, binding = 0) uniform Uniforms {
        uniform vec4 color;
    };

    layout(location = 0) out vec4 outColor;

    void main() {
        outColor = color;
    }
    `,copyVideoToTextureVertexSource = `
    struct VertexOutput {
        @builtin(position) Position : vec4<f32>,
        @location(0) fragUV : vec2<f32>
    }
  
    @vertex
    fn main(
        @builtin(vertex_index) VertexIndex : u32
    ) -> VertexOutput {
        var pos = array<vec2<f32>, 4>(
            vec2(-1.0,  1.0),
            vec2( 1.0,  1.0),
            vec2(-1.0, -1.0),
            vec2( 1.0, -1.0)
        );
        var tex = array<vec2<f32>, 4>(
            vec2(0.0, 0.0),
            vec2(1.0, 0.0),
            vec2(0.0, 1.0),
            vec2(1.0, 1.0)
        );

        var output: VertexOutput;

        output.Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);
        output.fragUV = tex[VertexIndex];

        return output;
    }
    `,copyVideoToTextureFragmentSource = `
    @group(0) @binding(0) var videoSampler: sampler;
    @group(0) @binding(1) var videoTexture: texture_external;

    @fragment
    fn main(
        @location(0) fragUV: vec2<f32>
    ) -> @location(0) vec4<f32> {
        return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV);
    }
    `,copyVideoToTextureInvertYFragmentSource = `
    @group(0) @binding(0) var videoSampler: sampler;
    @group(0) @binding(1) var videoTexture: texture_external;

    @fragment
    fn main(
        @location(0) fragUV: vec2<f32>
    ) -> @location(0) vec4<f32> {
        return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2<f32>(fragUV.x, 1.0 - fragUV.y));
    }
    `;var PipelineType;(function (PipelineType) {PipelineType[PipelineType.MipMap = 0] = "MipMap", PipelineType[PipelineType.InvertYPremultiplyAlpha = 1] = "InvertYPremultiplyAlpha", PipelineType[PipelineType.Clear = 2] = "Clear", PipelineType[PipelineType.InvertYPremultiplyAlphaWithOfst = 3] = "InvertYPremultiplyAlphaWithOfst";})(PipelineType || (PipelineType = {}));var VideoPipelineType;(function (VideoPipelineType) {VideoPipelineType[VideoPipelineType.DontInvertY = 0] = "DontInvertY", VideoPipelineType[VideoPipelineType.InvertY = 1] = "InvertY";})(VideoPipelineType || (VideoPipelineType = {}));const shadersForPipelineType = [{ vertex: "\n    const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));\n    const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f));\n\n    layout(location = 0) out vec2 vTex;\n\n    void main() {\n        vTex = tex[gl_VertexIndex];\n        gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);\n    }\n    ", fragment: mipmapFragmentSource }, { vertex: invertYPreMultiplyAlphaVertexSource, fragment: invertYPreMultiplyAlphaFragmentSource }, { vertex: clearVertexSource, fragment: clearFragmentSource }, { vertex: invertYPreMultiplyAlphaWithOfstVertexSource, fragment: invertYPreMultiplyAlphaWithOfstFragmentSource }];const renderableTextureFormatToIndex = { "": 0, r8unorm: 1, r8uint: 2, r8sint: 3, r16uint: 4, r16sint: 5, r16float: 6, rg8unorm: 7, rg8uint: 8, rg8sint: 9, r32uint: 10, r32sint: 11, r32float: 12, rg16uint: 13, rg16sint: 14, rg16float: 15, rgba8unorm: 16, "rgba8unorm-srgb": 17, rgba8uint: 18, rgba8sint: 19, bgra8unorm: 20, "bgra8unorm-srgb": 21, rgb10a2unorm: 22, rg32uint: 23, rg32sint: 24, rg32float: 25, rgba16uint: 26, rgba16sint: 27, rgba16float: 28, rgba32uint: 29, rgba32sint: 30, rgba32float: 31, stencil8: 32, depth16unorm: 33, depth24plus: 34, "depth24plus-stencil8": 35, depth32float: 36, "depth24unorm-stencil8": 37, "depth32float-stencil8": 38 };class WebGPUTextureHelper {static ComputeNumMipmapLevels(width, height) {return math_scalar/* Scalar.ILog2 */.R.ILog2(Math.max(width, height)) + 1;}constructor(device, glslang, tintWASM, bufferManager) {this._pipelines = {}, this._compiledShaders = [], this._videoPipelines = {}, this._videoCompiledShaders = [], this._deferredReleaseTextures = [], this._device = device, this._glslang = glslang, this._tintWASM = tintWASM, this._bufferManager = bufferManager, this._mipmapSampler = device.createSampler({ minFilter: FilterMode.Linear }), this._videoSampler = device.createSampler({ minFilter: FilterMode.Linear }), this._ubCopyWithOfst = this._bufferManager.createBuffer(16, BufferUsage.Uniform | BufferUsage.CopyDst).underlyingResource, this._getPipeline(TextureFormat.RGBA8Unorm), this._getVideoPipeline(TextureFormat.RGBA8Unorm);}_getPipeline(format, type = PipelineType.MipMap, params) {const index = type === PipelineType.MipMap ? 1 : type === PipelineType.InvertYPremultiplyAlpha ? ((params.invertY ? 1 : 0) << 1) + ((params.premultiplyAlpha ? 1 : 0) << 2) : type === PipelineType.Clear ? 8 : type === PipelineType.InvertYPremultiplyAlphaWithOfst ? ((params.invertY ? 1 : 0) << 4) + ((params.premultiplyAlpha ? 1 : 0) << 5) : 0;this._pipelines[format] || (this._pipelines[format] = []);let pipelineAndBGL = this._pipelines[format][index];if (!pipelineAndBGL) {let defines = "#version 450\r\n";(type === PipelineType.InvertYPremultiplyAlpha || type === PipelineType.InvertYPremultiplyAlphaWithOfst) && (params.invertY && (defines += "#define INVERTY\r\n"), params.premultiplyAlpha && (defines += "#define PREMULTIPLYALPHA\r\n"));let modules = this._compiledShaders[index];if (!modules) {let vertexCode = this._glslang.compileGLSL(defines + shadersForPipelineType[type].vertex, "vertex"),fragmentCode = this._glslang.compileGLSL(defines + shadersForPipelineType[type].fragment, "fragment");this._tintWASM && (vertexCode = this._tintWASM.convertSpirV2WGSL(vertexCode), fragmentCode = this._tintWASM.convertSpirV2WGSL(fragmentCode));const vertexModule = this._device.createShaderModule({ code: vertexCode }),fragmentModule = this._device.createShaderModule({ code: fragmentCode });modules = this._compiledShaders[index] = [vertexModule, fragmentModule];}const pipeline = this._device.createRenderPipeline({ layout: AutoLayoutMode.Auto, vertex: { module: modules[0], entryPoint: "main" }, fragment: { module: modules[1], entryPoint: "main", targets: [{ format }] }, primitive: { topology: PrimitiveTopology.TriangleStrip, stripIndexFormat: IndexFormat.Uint16 } });pipelineAndBGL = this._pipelines[format][index] = [pipeline, pipeline.getBindGroupLayout(0)];}return pipelineAndBGL;}_getVideoPipeline(format, type = VideoPipelineType.DontInvertY) {const index = type === VideoPipelineType.InvertY ? 1 : 0;this._videoPipelines[format] || (this._videoPipelines[format] = []);let pipelineAndBGL = this._videoPipelines[format][index];if (!pipelineAndBGL) {let modules = this._videoCompiledShaders[index];if (!modules) {const vertexModule = this._device.createShaderModule({ code: copyVideoToTextureVertexSource }),fragmentModule = this._device.createShaderModule({ code: 0 === index ? copyVideoToTextureFragmentSource : copyVideoToTextureInvertYFragmentSource });modules = this._videoCompiledShaders[index] = [vertexModule, fragmentModule];}const pipeline = this._device.createRenderPipeline({ label: `CopyVideoToTexture_${format}_${0 === index ? "DontInvertY" : "InvertY"}`, layout: AutoLayoutMode.Auto, vertex: { module: modules[0], entryPoint: "main" }, fragment: { module: modules[1], entryPoint: "main", targets: [{ format }] }, primitive: { topology: PrimitiveTopology.TriangleStrip, stripIndexFormat: IndexFormat.Uint16 } });pipelineAndBGL = this._videoPipelines[format][index] = [pipeline, pipeline.getBindGroupLayout(0)];}return pipelineAndBGL;}static _GetTextureTypeFromFormat(format) {switch (format) {case TextureFormat.R8Unorm:case TextureFormat.R8Snorm:case TextureFormat.R8Uint:case TextureFormat.R8Sint:case TextureFormat.RG8Unorm:case TextureFormat.RG8Snorm:case TextureFormat.RG8Uint:case TextureFormat.RG8Sint:case TextureFormat.RGBA8Unorm:case TextureFormat.RGBA8UnormSRGB:case TextureFormat.RGBA8Snorm:case TextureFormat.RGBA8Uint:case TextureFormat.RGBA8Sint:case TextureFormat.BGRA8Unorm:case TextureFormat.BGRA8UnormSRGB:case TextureFormat.RGB10A2Unorm:case TextureFormat.RGB9E5UFloat:case TextureFormat.RG11B10UFloat:case TextureFormat.Depth24UnormStencil8:case TextureFormat.Depth32FloatStencil8:case TextureFormat.BC7RGBAUnorm:case TextureFormat.BC7RGBAUnormSRGB:case TextureFormat.BC6HRGBUFloat:case TextureFormat.BC6HRGBFloat:case TextureFormat.BC5RGUnorm:case TextureFormat.BC5RGSnorm:case TextureFormat.BC3RGBAUnorm:case TextureFormat.BC3RGBAUnormSRGB:case TextureFormat.BC2RGBAUnorm:case TextureFormat.BC2RGBAUnormSRGB:case TextureFormat.BC4RUnorm:case TextureFormat.BC4RSnorm:case TextureFormat.BC1RGBAUnorm:case TextureFormat.BC1RGBAUnormSRGB:case TextureFormat.ETC2RGB8Unorm:case TextureFormat.ETC2RGB8UnormSRGB:case TextureFormat.ETC2RGB8A1Unorm:case TextureFormat.ETC2RGB8A1UnormSRGB:case TextureFormat.ETC2RGBA8Unorm:case TextureFormat.ETC2RGBA8UnormSRGB:case TextureFormat.EACR11Unorm:case TextureFormat.EACR11Snorm:case TextureFormat.EACRG11Unorm:case TextureFormat.EACRG11Snorm:case TextureFormat.ASTC4x4Unorm:case TextureFormat.ASTC4x4UnormSRGB:case TextureFormat.ASTC5x4Unorm:case TextureFormat.ASTC5x4UnormSRGB:case TextureFormat.ASTC5x5Unorm:case TextureFormat.ASTC5x5UnormSRGB:case TextureFormat.ASTC6x5Unorm:case TextureFormat.ASTC6x5UnormSRGB:case TextureFormat.ASTC6x6Unorm:case TextureFormat.ASTC6x6UnormSRGB:case TextureFormat.ASTC8x5Unorm:case TextureFormat.ASTC8x5UnormSRGB:case TextureFormat.ASTC8x6Unorm:case TextureFormat.ASTC8x6UnormSRGB:case TextureFormat.ASTC8x8Unorm:case TextureFormat.ASTC8x8UnormSRGB:case TextureFormat.ASTC10x5Unorm:case TextureFormat.ASTC10x5UnormSRGB:case TextureFormat.ASTC10x6Unorm:case TextureFormat.ASTC10x6UnormSRGB:case TextureFormat.ASTC10x8Unorm:case TextureFormat.ASTC10x8UnormSRGB:case TextureFormat.ASTC10x10Unorm:case TextureFormat.ASTC10x10UnormSRGB:case TextureFormat.ASTC12x10Unorm:case TextureFormat.ASTC12x10UnormSRGB:case TextureFormat.ASTC12x12Unorm:case TextureFormat.ASTC12x12UnormSRGB:return 0;case TextureFormat.R16Uint:case TextureFormat.R16Sint:case TextureFormat.RG16Uint:case TextureFormat.RG16Sint:case TextureFormat.RGBA16Uint:case TextureFormat.RGBA16Sint:case TextureFormat.Depth16Unorm:return 5;case TextureFormat.R16Float:case TextureFormat.RG16Float:case TextureFormat.RGBA16Float:return 2;case TextureFormat.R32Uint:case TextureFormat.R32Sint:case TextureFormat.RG32Uint:case TextureFormat.RG32Sint:case TextureFormat.RGBA32Uint:case TextureFormat.RGBA32Sint:return 7;case TextureFormat.R32Float:case TextureFormat.RG32Float:case TextureFormat.RGBA32Float:case TextureFormat.Depth32Float:return 1;case TextureFormat.Stencil8:throw "No fixed size for Stencil8 format!";case TextureFormat.Depth24Plus:throw "No fixed size for Depth24Plus format!";case TextureFormat.Depth24PlusStencil8:throw "No fixed size for Depth24PlusStencil8 format!";}return 0;}static _GetBlockInformationFromFormat(format) {switch (format) {case TextureFormat.R8Unorm:case TextureFormat.R8Snorm:case TextureFormat.R8Uint:case TextureFormat.R8Sint:return { width: 1, height: 1, length: 1 };case TextureFormat.R16Uint:case TextureFormat.R16Sint:case TextureFormat.R16Float:case TextureFormat.RG8Unorm:case TextureFormat.RG8Snorm:case TextureFormat.RG8Uint:case TextureFormat.RG8Sint:return { width: 1, height: 1, length: 2 };case TextureFormat.R32Uint:case TextureFormat.R32Sint:case TextureFormat.R32Float:case TextureFormat.RG16Uint:case TextureFormat.RG16Sint:case TextureFormat.RG16Float:case TextureFormat.RGBA8Unorm:case TextureFormat.RGBA8UnormSRGB:case TextureFormat.RGBA8Snorm:case TextureFormat.RGBA8Uint:case TextureFormat.RGBA8Sint:case TextureFormat.BGRA8Unorm:case TextureFormat.BGRA8UnormSRGB:case TextureFormat.RGB9E5UFloat:case TextureFormat.RGB10A2Unorm:case TextureFormat.RG11B10UFloat:return { width: 1, height: 1, length: 4 };case TextureFormat.RG32Uint:case TextureFormat.RG32Sint:case TextureFormat.RG32Float:case TextureFormat.RGBA16Uint:case TextureFormat.RGBA16Sint:case TextureFormat.RGBA16Float:return { width: 1, height: 1, length: 8 };case TextureFormat.RGBA32Uint:case TextureFormat.RGBA32Sint:case TextureFormat.RGBA32Float:return { width: 1, height: 1, length: 16 };case TextureFormat.Stencil8:throw "No fixed size for Stencil8 format!";case TextureFormat.Depth16Unorm:return { width: 1, height: 1, length: 2 };case TextureFormat.Depth24Plus:throw "No fixed size for Depth24Plus format!";case TextureFormat.Depth24PlusStencil8:throw "No fixed size for Depth24PlusStencil8 format!";case TextureFormat.Depth32Float:return { width: 1, height: 1, length: 4 };case TextureFormat.Depth24UnormStencil8:return { width: 1, height: 1, length: 4 };case TextureFormat.Depth32FloatStencil8:return { width: 1, height: 1, length: 5 };case TextureFormat.BC7RGBAUnorm:case TextureFormat.BC7RGBAUnormSRGB:case TextureFormat.BC6HRGBUFloat:case TextureFormat.BC6HRGBFloat:case TextureFormat.BC5RGUnorm:case TextureFormat.BC5RGSnorm:case TextureFormat.BC3RGBAUnorm:case TextureFormat.BC3RGBAUnormSRGB:case TextureFormat.BC2RGBAUnorm:case TextureFormat.BC2RGBAUnormSRGB:return { width: 4, height: 4, length: 16 };case TextureFormat.BC4RUnorm:case TextureFormat.BC4RSnorm:case TextureFormat.BC1RGBAUnorm:case TextureFormat.BC1RGBAUnormSRGB:return { width: 4, height: 4, length: 8 };case TextureFormat.ETC2RGB8Unorm:case TextureFormat.ETC2RGB8UnormSRGB:case TextureFormat.ETC2RGB8A1Unorm:case TextureFormat.ETC2RGB8A1UnormSRGB:case TextureFormat.EACR11Unorm:case TextureFormat.EACR11Snorm:return { width: 4, height: 4, length: 8 };case TextureFormat.ETC2RGBA8Unorm:case TextureFormat.ETC2RGBA8UnormSRGB:case TextureFormat.EACRG11Unorm:case TextureFormat.EACRG11Snorm:return { width: 4, height: 4, length: 16 };case TextureFormat.ASTC4x4Unorm:case TextureFormat.ASTC4x4UnormSRGB:return { width: 4, height: 4, length: 16 };case TextureFormat.ASTC5x4Unorm:case TextureFormat.ASTC5x4UnormSRGB:return { width: 5, height: 4, length: 16 };case TextureFormat.ASTC5x5Unorm:case TextureFormat.ASTC5x5UnormSRGB:return { width: 5, height: 5, length: 16 };case TextureFormat.ASTC6x5Unorm:case TextureFormat.ASTC6x5UnormSRGB:return { width: 6, height: 5, length: 16 };case TextureFormat.ASTC6x6Unorm:case TextureFormat.ASTC6x6UnormSRGB:return { width: 6, height: 6, length: 16 };case TextureFormat.ASTC8x5Unorm:case TextureFormat.ASTC8x5UnormSRGB:return { width: 8, height: 5, length: 16 };case TextureFormat.ASTC8x6Unorm:case TextureFormat.ASTC8x6UnormSRGB:return { width: 8, height: 6, length: 16 };case TextureFormat.ASTC8x8Unorm:case TextureFormat.ASTC8x8UnormSRGB:return { width: 8, height: 8, length: 16 };case TextureFormat.ASTC10x5Unorm:case TextureFormat.ASTC10x5UnormSRGB:return { width: 10, height: 5, length: 16 };case TextureFormat.ASTC10x6Unorm:case TextureFormat.ASTC10x6UnormSRGB:return { width: 10, height: 6, length: 16 };case TextureFormat.ASTC10x8Unorm:case TextureFormat.ASTC10x8UnormSRGB:return { width: 10, height: 8, length: 16 };case TextureFormat.ASTC10x10Unorm:case TextureFormat.ASTC10x10UnormSRGB:return { width: 10, height: 10, length: 16 };case TextureFormat.ASTC12x10Unorm:case TextureFormat.ASTC12x10UnormSRGB:return { width: 12, height: 10, length: 16 };case TextureFormat.ASTC12x12Unorm:case TextureFormat.ASTC12x12UnormSRGB:return { width: 12, height: 12, length: 16 };}return { width: 1, height: 1, length: 4 };}static _IsHardwareTexture(texture) {return !!texture.release;}static _IsInternalTexture(texture) {return !!texture.dispose;}static IsImageBitmap(imageBitmap) {return imageBitmap.close !== void 0;}static IsImageBitmapArray(imageBitmap) {return Array.isArray(imageBitmap) && imageBitmap[0].close !== void 0;}setCommandEncoder(encoder) {this._commandEncoderForCreation = encoder;}static IsCompressedFormat(format) {return !(format !== TextureFormat.BC7RGBAUnormSRGB && format !== TextureFormat.BC7RGBAUnorm && format !== TextureFormat.BC6HRGBFloat && format !== TextureFormat.BC6HRGBUFloat && format !== TextureFormat.BC5RGSnorm && format !== TextureFormat.BC5RGUnorm && format !== TextureFormat.BC4RSnorm && format !== TextureFormat.BC4RUnorm && format !== TextureFormat.BC3RGBAUnormSRGB && format !== TextureFormat.BC3RGBAUnorm && format !== TextureFormat.BC2RGBAUnormSRGB && format !== TextureFormat.BC2RGBAUnorm && format !== TextureFormat.BC1RGBAUnormSRGB && format !== TextureFormat.BC1RGBAUnorm && format !== TextureFormat.ETC2RGB8Unorm && format !== TextureFormat.ETC2RGB8UnormSRGB && format !== TextureFormat.ETC2RGB8A1Unorm && format !== TextureFormat.ETC2RGB8A1UnormSRGB && format !== TextureFormat.ETC2RGBA8Unorm && format !== TextureFormat.ETC2RGBA8UnormSRGB && format !== TextureFormat.EACR11Unorm && format !== TextureFormat.EACR11Snorm && format !== TextureFormat.EACRG11Unorm && format !== TextureFormat.EACRG11Snorm && format !== TextureFormat.ASTC4x4Unorm && format !== TextureFormat.ASTC4x4UnormSRGB && format !== TextureFormat.ASTC5x4Unorm && format !== TextureFormat.ASTC5x4UnormSRGB && format !== TextureFormat.ASTC5x5Unorm && format !== TextureFormat.ASTC5x5UnormSRGB && format !== TextureFormat.ASTC6x5Unorm && format !== TextureFormat.ASTC6x5UnormSRGB && format !== TextureFormat.ASTC6x6Unorm && format !== TextureFormat.ASTC6x6UnormSRGB && format !== TextureFormat.ASTC8x5Unorm && format !== TextureFormat.ASTC8x5UnormSRGB && format !== TextureFormat.ASTC8x6Unorm && format !== TextureFormat.ASTC8x6UnormSRGB && format !== TextureFormat.ASTC8x8Unorm && format !== TextureFormat.ASTC8x8UnormSRGB && format !== TextureFormat.ASTC10x5Unorm && format !== TextureFormat.ASTC10x5UnormSRGB && format !== TextureFormat.ASTC10x6Unorm && format !== TextureFormat.ASTC10x6UnormSRGB && format !== TextureFormat.ASTC10x8Unorm && format !== TextureFormat.ASTC10x8UnormSRGB && format !== TextureFormat.ASTC10x10Unorm && format !== TextureFormat.ASTC10x10UnormSRGB && format !== TextureFormat.ASTC12x10Unorm && format !== TextureFormat.ASTC12x10UnormSRGB && format !== TextureFormat.ASTC12x12Unorm && format !== TextureFormat.ASTC12x12UnormSRGB);}static GetWebGPUTextureFormat(type, format, useSRGBBuffer = !1) {switch (format) {case 15:return TextureFormat.Depth16Unorm;case 16:return TextureFormat.Depth24Plus;case 13:return TextureFormat.Depth24PlusStencil8;case 14:return TextureFormat.Depth32Float;case 17:return TextureFormat.Depth24UnormStencil8;case 18:return TextureFormat.Depth32FloatStencil8;case 36492:return useSRGBBuffer ? TextureFormat.BC7RGBAUnormSRGB : TextureFormat.BC7RGBAUnorm;case 36495:return TextureFormat.BC6HRGBUFloat;case 36494:return TextureFormat.BC6HRGBFloat;case 33779:return useSRGBBuffer ? TextureFormat.BC3RGBAUnormSRGB : TextureFormat.BC3RGBAUnorm;case 33778:return useSRGBBuffer ? TextureFormat.BC2RGBAUnormSRGB : TextureFormat.BC2RGBAUnorm;case 33777:case 33776:return useSRGBBuffer ? TextureFormat.BC1RGBAUnormSRGB : TextureFormat.BC1RGBAUnorm;case 37808:return useSRGBBuffer ? TextureFormat.ASTC4x4UnormSRGB : TextureFormat.ASTC4x4Unorm;case 36196:case 37492:return useSRGBBuffer ? TextureFormat.ETC2RGB8UnormSRGB : TextureFormat.ETC2RGB8Unorm;case 37496:return useSRGBBuffer ? TextureFormat.ETC2RGBA8UnormSRGB : TextureFormat.ETC2RGBA8Unorm;}switch (type) {case 3:switch (format) {case 6:return TextureFormat.R8Snorm;case 7:return TextureFormat.RG8Snorm;case 4:throw "RGB format not supported in WebGPU";case 8:return TextureFormat.R8Sint;case 9:return TextureFormat.RG8Sint;case 10:throw "RGB_INTEGER format not supported in WebGPU";case 11:return TextureFormat.RGBA8Sint;default:return TextureFormat.RGBA8Snorm;}case 0:switch (format) {case 6:return TextureFormat.R8Unorm;case 7:return TextureFormat.RG8Unorm;case 4:throw "TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return useSRGBBuffer ? TextureFormat.RGBA8UnormSRGB : TextureFormat.RGBA8Unorm;case 12:return useSRGBBuffer ? TextureFormat.BGRA8UnormSRGB : TextureFormat.BGRA8Unorm;case 8:return TextureFormat.R8Uint;case 9:return TextureFormat.RG8Uint;case 10:throw "RGB_INTEGER format not supported in WebGPU";case 11:return TextureFormat.RGBA8Uint;case 0:throw "TEXTUREFORMAT_ALPHA format not supported in WebGPU";case 1:throw "TEXTUREFORMAT_LUMINANCE format not supported in WebGPU";case 2:throw "TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU";default:return TextureFormat.RGBA8Unorm;}case 4:switch (format) {case 8:return TextureFormat.R16Sint;case 9:return TextureFormat.RG16Sint;case 10:throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return TextureFormat.RGBA16Sint;default:return TextureFormat.RGBA16Sint;}case 5:switch (format) {case 8:return TextureFormat.R16Uint;case 9:return TextureFormat.RG16Uint;case 10:throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return TextureFormat.RGBA16Uint;default:return TextureFormat.RGBA16Uint;}case 6:switch (format) {case 8:return TextureFormat.R32Sint;case 9:return TextureFormat.RG32Sint;case 10:throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return TextureFormat.RGBA32Sint;default:return TextureFormat.RGBA32Sint;}case 7:switch (format) {case 8:return TextureFormat.R32Uint;case 9:return TextureFormat.RG32Uint;case 10:throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return TextureFormat.RGBA32Uint;default:return TextureFormat.RGBA32Uint;}case 1:switch (format) {case 6:return TextureFormat.R32Float;case 7:return TextureFormat.RG32Float;case 4:throw "TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return TextureFormat.RGBA32Float;default:return TextureFormat.RGBA32Float;}case 2:switch (format) {case 6:return TextureFormat.R16Float;case 7:return TextureFormat.RG16Float;case 4:throw "TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return TextureFormat.RGBA16Float;default:return TextureFormat.RGBA16Float;}case 10:throw "TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU";case 13:throw "TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV format not supported in WebGPU";case 14:throw "TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV format not supported in WebGPU";case 8:throw "TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU";case 9:throw "TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU";case 11:switch (format) {case 5:return TextureFormat.RGB10A2Unorm;case 11:throw "TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV";default:return TextureFormat.RGB10A2Unorm;}}return useSRGBBuffer ? TextureFormat.RGBA8UnormSRGB : TextureFormat.RGBA8Unorm;}static GetNumChannelsFromWebGPUTextureFormat(format) {switch (format) {case TextureFormat.R8Unorm:case TextureFormat.R8Snorm:case TextureFormat.R8Uint:case TextureFormat.R8Sint:case TextureFormat.BC4RUnorm:case TextureFormat.BC4RSnorm:case TextureFormat.R16Uint:case TextureFormat.R16Sint:case TextureFormat.Depth16Unorm:case TextureFormat.R16Float:case TextureFormat.R32Uint:case TextureFormat.R32Sint:case TextureFormat.R32Float:case TextureFormat.Depth32Float:case TextureFormat.Stencil8:case TextureFormat.Depth24Plus:case TextureFormat.EACR11Unorm:case TextureFormat.EACR11Snorm:return 1;case TextureFormat.RG8Unorm:case TextureFormat.RG8Snorm:case TextureFormat.RG8Uint:case TextureFormat.RG8Sint:case TextureFormat.Depth24UnormStencil8:case TextureFormat.Depth32FloatStencil8:case TextureFormat.BC5RGUnorm:case TextureFormat.BC5RGSnorm:case TextureFormat.RG16Uint:case TextureFormat.RG16Sint:case TextureFormat.RG16Float:case TextureFormat.RG32Uint:case TextureFormat.RG32Sint:case TextureFormat.RG32Float:case TextureFormat.Depth24PlusStencil8:case TextureFormat.EACRG11Unorm:case TextureFormat.EACRG11Snorm:return 2;case TextureFormat.RGB9E5UFloat:case TextureFormat.RG11B10UFloat:case TextureFormat.BC6HRGBUFloat:case TextureFormat.BC6HRGBFloat:case TextureFormat.ETC2RGB8Unorm:case TextureFormat.ETC2RGB8UnormSRGB:return 3;case TextureFormat.RGBA8Unorm:case TextureFormat.RGBA8UnormSRGB:case TextureFormat.RGBA8Snorm:case TextureFormat.RGBA8Uint:case TextureFormat.RGBA8Sint:case TextureFormat.BGRA8Unorm:case TextureFormat.BGRA8UnormSRGB:case TextureFormat.RGB10A2Unorm:case TextureFormat.BC7RGBAUnorm:case TextureFormat.BC7RGBAUnormSRGB:case TextureFormat.BC3RGBAUnorm:case TextureFormat.BC3RGBAUnormSRGB:case TextureFormat.BC2RGBAUnorm:case TextureFormat.BC2RGBAUnormSRGB:case TextureFormat.BC1RGBAUnorm:case TextureFormat.BC1RGBAUnormSRGB:case TextureFormat.RGBA16Uint:case TextureFormat.RGBA16Sint:case TextureFormat.RGBA16Float:case TextureFormat.RGBA32Uint:case TextureFormat.RGBA32Sint:case TextureFormat.RGBA32Float:case TextureFormat.ETC2RGB8A1Unorm:case TextureFormat.ETC2RGB8A1UnormSRGB:case TextureFormat.ETC2RGBA8Unorm:case TextureFormat.ETC2RGBA8UnormSRGB:case TextureFormat.ASTC4x4Unorm:case TextureFormat.ASTC4x4UnormSRGB:case TextureFormat.ASTC5x4Unorm:case TextureFormat.ASTC5x4UnormSRGB:case TextureFormat.ASTC5x5Unorm:case TextureFormat.ASTC5x5UnormSRGB:case TextureFormat.ASTC6x5Unorm:case TextureFormat.ASTC6x5UnormSRGB:case TextureFormat.ASTC6x6Unorm:case TextureFormat.ASTC6x6UnormSRGB:case TextureFormat.ASTC8x5Unorm:case TextureFormat.ASTC8x5UnormSRGB:case TextureFormat.ASTC8x6Unorm:case TextureFormat.ASTC8x6UnormSRGB:case TextureFormat.ASTC8x8Unorm:case TextureFormat.ASTC8x8UnormSRGB:case TextureFormat.ASTC10x5Unorm:case TextureFormat.ASTC10x5UnormSRGB:case TextureFormat.ASTC10x6Unorm:case TextureFormat.ASTC10x6UnormSRGB:case TextureFormat.ASTC10x8Unorm:case TextureFormat.ASTC10x8UnormSRGB:case TextureFormat.ASTC10x10Unorm:case TextureFormat.ASTC10x10UnormSRGB:case TextureFormat.ASTC12x10Unorm:case TextureFormat.ASTC12x10UnormSRGB:case TextureFormat.ASTC12x12Unorm:case TextureFormat.ASTC12x12UnormSRGB:return 4;}throw `Unknown format ${format}!`;}static HasStencilAspect(format) {return !(format !== TextureFormat.Stencil8 && format !== TextureFormat.Depth24UnormStencil8 && format !== TextureFormat.Depth32FloatStencil8 && format !== TextureFormat.Depth24PlusStencil8);}static HasDepthAndStencilAspects(format) {return !(format !== TextureFormat.Depth24UnormStencil8 && format !== TextureFormat.Depth32FloatStencil8 && format !== TextureFormat.Depth24PlusStencil8);}copyVideoToTexture(video, texture, format, invertY = !1, commandEncoder) {var _a, _b, _c, _d;const useOwnCommandEncoder = commandEncoder === void 0,[pipeline, bindGroupLayout] = this._getVideoPipeline(format, invertY ? VideoPipelineType.InvertY : VideoPipelineType.DontInvertY);useOwnCommandEncoder && (commandEncoder = this._device.createCommandEncoder({})), null === (_b = (_a = commandEncoder).pushDebugGroup) || void 0 === _b ? void 0 : _b.call(_a, `copy video to texture - invertY=${invertY}`);const webgpuHardwareTexture = texture._hardwareTexture,renderPassDescriptor = { colorAttachments: [{ view: webgpuHardwareTexture.underlyingResource.createView({ format, dimension: TextureViewDimension.E2d, mipLevelCount: 1, baseArrayLayer: 0, baseMipLevel: 0, arrayLayerCount: 1, aspect: TextureAspect.All }), loadOp: LoadOp.Load, storeOp: StoreOp.Store }] },passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor),descriptor = { layout: bindGroupLayout, entries: [{ binding: 0, resource: this._videoSampler }, { binding: 1, resource: this._device.importExternalTexture({ source: video.underlyingResource }) }] },bindGroup = this._device.createBindGroup(descriptor);passEncoder.setPipeline(pipeline), passEncoder.setBindGroup(0, bindGroup), passEncoder.draw(4, 1, 0, 0), passEncoder.end(), null === (_d = (_c = commandEncoder).popDebugGroup) || void 0 === _d ? void 0 : _d.call(_c), useOwnCommandEncoder && (this._device.queue.submit([commandEncoder.finish()]), commandEncoder = null);}invertYPreMultiplyAlpha(gpuOrHdwTexture, width, height, format, invertY = !1, premultiplyAlpha = !1, faceIndex = 0, mipLevel = 0, layers = 1, ofstX = 0, ofstY = 0, rectWidth = 0, rectHeight = 0, commandEncoder) {var _a, _b, _c, _d, _e, _f;const useRect = 0 !== rectWidth,useOwnCommandEncoder = void 0 === commandEncoder,[pipeline, bindGroupLayout] = this._getPipeline(format, useRect ? PipelineType.InvertYPremultiplyAlphaWithOfst : PipelineType.InvertYPremultiplyAlpha, { invertY, premultiplyAlpha });faceIndex = Math.max(faceIndex, 0), useOwnCommandEncoder && (commandEncoder = this._device.createCommandEncoder({})), null === (_b = (_a = commandEncoder).pushDebugGroup) || void 0 === _b ? void 0 : _b.call(_a, `internal process texture - invertY=${invertY} premultiplyAlpha=${premultiplyAlpha}`);let gpuTexture;if (WebGPUTextureHelper._IsHardwareTexture(gpuOrHdwTexture) ? (gpuTexture = gpuOrHdwTexture.underlyingResource, (!invertY || premultiplyAlpha || 1 !== layers || 0 !== faceIndex) && (gpuOrHdwTexture = void 0)) : (gpuTexture = gpuOrHdwTexture, gpuOrHdwTexture = void 0), !gpuTexture) return;useRect && this._bufferManager.setRawData(this._ubCopyWithOfst, 0, new Float32Array([ofstX, ofstY, rectWidth, rectHeight]), 0, 16);const webgpuHardwareTexture = gpuOrHdwTexture,outputTexture = null !== (_c = null === webgpuHardwareTexture || void 0 === webgpuHardwareTexture ? void 0 : webgpuHardwareTexture._copyInvertYTempTexture) && void 0 !== _c ? _c : this.createTexture({ width, height, layers: 1 }, !1, !1, !1, !1, !1, format, 1, commandEncoder, TextureUsage.CopySrc | TextureUsage.RenderAttachment | TextureUsage.TextureBinding),renderPassDescriptor = null !== (_d = null === webgpuHardwareTexture || void 0 === webgpuHardwareTexture ? void 0 : webgpuHardwareTexture._copyInvertYRenderPassDescr) && void 0 !== _d ? _d : { colorAttachments: [{ view: outputTexture.createView({ format, dimension: TextureViewDimension.E2d, baseMipLevel: 0, mipLevelCount: 1, arrayLayerCount: 1, baseArrayLayer: 0 }), loadOp: LoadOp.Load, storeOp: StoreOp.Store }] },passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);let bindGroup = useRect ? null === webgpuHardwareTexture || void 0 === webgpuHardwareTexture ? void 0 : webgpuHardwareTexture._copyInvertYBindGroupWithOfst : null === webgpuHardwareTexture || void 0 === webgpuHardwareTexture ? void 0 : webgpuHardwareTexture._copyInvertYBindGroup;if (!bindGroup) {const descriptor = { layout: bindGroupLayout, entries: [{ binding: 0, resource: gpuTexture.createView({ format, dimension: TextureViewDimension.E2d, baseMipLevel: mipLevel, mipLevelCount: 1, arrayLayerCount: layers, baseArrayLayer: faceIndex }) }] };useRect && descriptor.entries.push({ binding: 1, resource: { buffer: this._ubCopyWithOfst } }), bindGroup = this._device.createBindGroup(descriptor);}passEncoder.setPipeline(pipeline), passEncoder.setBindGroup(0, bindGroup), passEncoder.draw(4, 1, 0, 0), passEncoder.end(), commandEncoder.copyTextureToTexture({ texture: outputTexture }, { texture: gpuTexture, mipLevel, origin: { x: 0, y: 0, z: faceIndex } }, { width, height, depthOrArrayLayers: 1 }), webgpuHardwareTexture ? (webgpuHardwareTexture._copyInvertYTempTexture = outputTexture, webgpuHardwareTexture._copyInvertYRenderPassDescr = renderPassDescriptor, useRect ? webgpuHardwareTexture._copyInvertYBindGroupWithOfst = bindGroup : webgpuHardwareTexture._copyInvertYBindGroup = bindGroup) : this._deferredReleaseTextures.push([outputTexture, null]), null === (_f = (_e = commandEncoder).popDebugGroup) || void 0 === _f ? void 0 : _f.call(_e), useOwnCommandEncoder && (this._device.queue.submit([commandEncoder.finish()]), commandEncoder = null);}copyWithInvertY(srcTextureView, format, renderPassDescriptor, commandEncoder) {var _a, _b, _c, _d;const useOwnCommandEncoder = commandEncoder === void 0,[pipeline, bindGroupLayout] = this._getPipeline(format, PipelineType.InvertYPremultiplyAlpha, { invertY: !0, premultiplyAlpha: !1 });useOwnCommandEncoder && (commandEncoder = this._device.createCommandEncoder({})), null === (_b = (_a = commandEncoder).pushDebugGroup) || void 0 === _b ? void 0 : _b.call(_a, `internal copy texture with invertY`);const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor),bindGroup = this._device.createBindGroup({ layout: bindGroupLayout, entries: [{ binding: 0, resource: srcTextureView }] });passEncoder.setPipeline(pipeline), passEncoder.setBindGroup(0, bindGroup), passEncoder.draw(4, 1, 0, 0), passEncoder.end(), null === (_d = (_c = commandEncoder).popDebugGroup) || void 0 === _d ? void 0 : _d.call(_c), useOwnCommandEncoder && (this._device.queue.submit([commandEncoder.finish()]), commandEncoder = null);}createTexture(imageBitmap, hasMipmaps = !1, generateMipmaps = !1, invertY = !1, premultiplyAlpha = !1, is3D = !1, format = TextureFormat.RGBA8Unorm, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0) {1 < sampleCount && (sampleCount = 4);const layerCount = imageBitmap.layers || 1,textureSize = { width: imageBitmap.width, height: imageBitmap.height, depthOrArrayLayers: layerCount },isCompressedFormat = WebGPUTextureHelper.IsCompressedFormat(format),mipLevelCount = hasMipmaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(imageBitmap.width, imageBitmap.height) : 1,usages = 0 <= usage ? usage : TextureUsage.CopySrc | TextureUsage.CopyDst | TextureUsage.TextureBinding;additionalUsages |= hasMipmaps && !isCompressedFormat ? TextureUsage.CopySrc | TextureUsage.RenderAttachment : 0, isCompressedFormat || is3D || (additionalUsages |= TextureUsage.RenderAttachment | TextureUsage.CopyDst);const gpuTexture = this._device.createTexture({ label: `Texture_${textureSize.width}x${textureSize.height}x${textureSize.depthOrArrayLayers}_${hasMipmaps ? "wmips" : "womips"}_${format}_samples${sampleCount}`, size: textureSize, dimension: is3D ? TextureDimension.E3d : TextureDimension.E2d, format, usage: usages | additionalUsages, sampleCount, mipLevelCount });return WebGPUTextureHelper.IsImageBitmap(imageBitmap) && (this.updateTexture(imageBitmap, gpuTexture, imageBitmap.width, imageBitmap.height, layerCount, format, 0, 0, invertY, premultiplyAlpha, 0, 0), hasMipmaps && generateMipmaps && this.generateMipmaps(gpuTexture, format, mipLevelCount, 0, commandEncoder)), gpuTexture;}createCubeTexture(imageBitmaps, hasMipmaps = !1, generateMipmaps = !1, invertY = !1, premultiplyAlpha = !1, format = TextureFormat.RGBA8Unorm, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0) {1 < sampleCount && (sampleCount = 4);const width = WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps) ? imageBitmaps[0].width : imageBitmaps.width,height = WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps) ? imageBitmaps[0].height : imageBitmaps.height,isCompressedFormat = WebGPUTextureHelper.IsCompressedFormat(format),mipLevelCount = hasMipmaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(width, height) : 1,usages = 0 <= usage ? usage : TextureUsage.CopySrc | TextureUsage.CopyDst | TextureUsage.TextureBinding;additionalUsages |= hasMipmaps && !isCompressedFormat ? TextureUsage.CopySrc | TextureUsage.RenderAttachment : 0, isCompressedFormat || (additionalUsages |= TextureUsage.RenderAttachment | TextureUsage.CopyDst);const gpuTexture = this._device.createTexture({ label: `TextureCube_${width}x${height}x6_${hasMipmaps ? "wmips" : "womips"}_${format}_samples${sampleCount}`, size: { width, height, depthOrArrayLayers: 6 }, dimension: TextureDimension.E2d, format, usage: usages | additionalUsages, sampleCount, mipLevelCount });return WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps) && (this.updateCubeTextures(imageBitmaps, gpuTexture, width, height, format, invertY, premultiplyAlpha, 0, 0), hasMipmaps && generateMipmaps && this.generateCubeMipmaps(gpuTexture, format, mipLevelCount, commandEncoder)), gpuTexture;}generateCubeMipmaps(gpuTexture, format, mipLevelCount, commandEncoder) {var _a, _b, _c, _d;const useOwnCommandEncoder = commandEncoder === void 0;useOwnCommandEncoder && (commandEncoder = this._device.createCommandEncoder({})), null === (_b = (_a = commandEncoder).pushDebugGroup) || void 0 === _b ? void 0 : _b.call(_a, `create cube mipmaps - ${mipLevelCount} levels`);for (let f = 0; 6 > f; ++f) this.generateMipmaps(gpuTexture, format, mipLevelCount, f, commandEncoder);null === (_d = (_c = commandEncoder).popDebugGroup) || void 0 === _d ? void 0 : _d.call(_c), useOwnCommandEncoder && (this._device.queue.submit([commandEncoder.finish()]), commandEncoder = null);}generateMipmaps(gpuOrHdwTexture, format, mipLevelCount, faceIndex = 0, commandEncoder) {var _a, _b, _c, _d, _e, _f, _g, _h;const useOwnCommandEncoder = void 0 === commandEncoder,[pipeline, bindGroupLayout] = this._getPipeline(format);faceIndex = Math.max(faceIndex, 0), useOwnCommandEncoder && (commandEncoder = this._device.createCommandEncoder({})), null === (_b = (_a = commandEncoder).pushDebugGroup) || void 0 === _b ? void 0 : _b.call(_a, `create mipmaps for face #${faceIndex} - ${mipLevelCount} levels`);let gpuTexture;if (WebGPUTextureHelper._IsHardwareTexture(gpuOrHdwTexture) ? (gpuTexture = gpuOrHdwTexture.underlyingResource, gpuOrHdwTexture._mipmapGenRenderPassDescr = gpuOrHdwTexture._mipmapGenRenderPassDescr || [], gpuOrHdwTexture._mipmapGenBindGroup = gpuOrHdwTexture._mipmapGenBindGroup || []) : (gpuTexture = gpuOrHdwTexture, gpuOrHdwTexture = void 0), !!gpuTexture) {const webgpuHardwareTexture = gpuOrHdwTexture;for (let i = 1; i < mipLevelCount; ++i) {const renderPassDescriptor = null !== (_d = null === (_c = null === webgpuHardwareTexture || void 0 === webgpuHardwareTexture ? void 0 : webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex]) || void 0 === _c ? void 0 : _c[i - 1]) && void 0 !== _d ? _d : { colorAttachments: [{ view: gpuTexture.createView({ format, dimension: TextureViewDimension.E2d, baseMipLevel: i, mipLevelCount: 1, arrayLayerCount: 1, baseArrayLayer: faceIndex }), loadOp: LoadOp.Load, storeOp: StoreOp.Store }] };webgpuHardwareTexture && (webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex] = webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex] || [], webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex][i - 1] = renderPassDescriptor);const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor),bindGroup = null !== (_f = null === (_e = null === webgpuHardwareTexture || void 0 === webgpuHardwareTexture ? void 0 : webgpuHardwareTexture._mipmapGenBindGroup[faceIndex]) || void 0 === _e ? void 0 : _e[i - 1]) && void 0 !== _f ? _f : this._device.createBindGroup({ layout: bindGroupLayout, entries: [{ binding: 0, resource: this._mipmapSampler }, { binding: 1, resource: gpuTexture.createView({ format, dimension: TextureViewDimension.E2d, baseMipLevel: i - 1, mipLevelCount: 1, arrayLayerCount: 1, baseArrayLayer: faceIndex }) }] });webgpuHardwareTexture && (webgpuHardwareTexture._mipmapGenBindGroup[faceIndex] = webgpuHardwareTexture._mipmapGenBindGroup[faceIndex] || [], webgpuHardwareTexture._mipmapGenBindGroup[faceIndex][i - 1] = bindGroup), passEncoder.setPipeline(pipeline), passEncoder.setBindGroup(0, bindGroup), passEncoder.draw(4, 1, 0, 0), passEncoder.end();}null === (_h = (_g = commandEncoder).popDebugGroup) || void 0 === _h ? void 0 : _h.call(_g), useOwnCommandEncoder && (this._device.queue.submit([commandEncoder.finish()]), commandEncoder = null);}}createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags) {texture._hardwareTexture || (texture._hardwareTexture = new WebGPUHardwareTexture()), void 0 === width && (width = texture.width), void 0 === height && (height = texture.height), void 0 === depth && (depth = texture.depth);const gpuTextureWrapper = texture._hardwareTexture,isStorageTexture = 0 != (1 & (null !== creationFlags && void 0 !== creationFlags ? creationFlags : 0));gpuTextureWrapper.format = WebGPUTextureHelper.GetWebGPUTextureFormat(texture.type, texture.format, texture._useSRGBBuffer), gpuTextureWrapper.textureUsages = texture._source === Textures_internalTexture/* InternalTextureSource.RenderTarget */.S.RenderTarget || texture.source === Textures_internalTexture/* InternalTextureSource.MultiRenderTarget */.S.MultiRenderTarget ? TextureUsage.TextureBinding | TextureUsage.CopySrc | TextureUsage.RenderAttachment : texture._source === Textures_internalTexture/* InternalTextureSource.DepthStencil */.S.DepthStencil ? TextureUsage.TextureBinding | TextureUsage.RenderAttachment : -1, gpuTextureWrapper.textureAdditionalUsages = isStorageTexture ? TextureUsage.StorageBinding : 0;const hasMipMaps = texture.generateMipMaps,layerCount = depth || 1;let mipmapCount;if (mipmapCount = null === texture._maxLodLevel ? hasMipMaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(width, height) : 1 : texture._maxLodLevel, texture.isCube) {const gpuTexture = this.createCubeTexture({ width, height }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, !1, gpuTextureWrapper.format, 1, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages);gpuTextureWrapper.set(gpuTexture), gpuTextureWrapper.createView({ format: gpuTextureWrapper.format, dimension: TextureViewDimension.Cube, mipLevelCount: mipmapCount, baseArrayLayer: 0, baseMipLevel: 0, arrayLayerCount: 6, aspect: WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? TextureAspect.DepthOnly : TextureAspect.All }, isStorageTexture);} else {const gpuTexture = this.createTexture({ width, height, layers: layerCount }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, !1, texture.is3D, gpuTextureWrapper.format, 1, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages);gpuTextureWrapper.set(gpuTexture), gpuTextureWrapper.createView({ format: gpuTextureWrapper.format, dimension: texture.is2DArray ? TextureViewDimension.E2dArray : texture.is3D ? TextureDimension.E3d : TextureViewDimension.E2d, mipLevelCount: mipmapCount, baseArrayLayer: 0, baseMipLevel: 0, arrayLayerCount: texture.is3D ? 1 : layerCount, aspect: WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? TextureAspect.DepthOnly : TextureAspect.All }, isStorageTexture);}return texture.width = texture.baseWidth = width, texture.height = texture.baseHeight = height, texture.depth = texture.baseDepth = depth, this.createMSAATexture(texture, texture.samples), gpuTextureWrapper;}createMSAATexture(texture, samples) {const gpuTextureWrapper = texture._hardwareTexture;if ((null === gpuTextureWrapper || void 0 === gpuTextureWrapper ? void 0 : gpuTextureWrapper.msaaTexture) && (this.releaseTexture(gpuTextureWrapper.msaaTexture), gpuTextureWrapper.msaaTexture = null), !gpuTextureWrapper || 1 >= (null !== samples && void 0 !== samples ? samples : 1)) return;const width = texture.width,height = texture.height,layerCount = texture.depth || 1;if (texture.isCube) {const gpuMSAATexture = this.createCubeTexture({ width, height }, !1, !1, texture.invertY, !1, gpuTextureWrapper.format, samples, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages);gpuTextureWrapper.msaaTexture = gpuMSAATexture;} else {const gpuMSAATexture = this.createTexture({ width, height, layers: layerCount }, !1, !1, texture.invertY, !1, texture.is3D, gpuTextureWrapper.format, samples, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages);gpuTextureWrapper.msaaTexture = gpuMSAATexture;}}updateCubeTextures(imageBitmaps, gpuTexture, width, height, format, invertY = !1, premultiplyAlpha = !1, offsetX = 0, offsetY = 0) {const faces = [0, 3, 1, 4, 2, 5];for (let f = 0; f < faces.length; ++f) {const imageBitmap = imageBitmaps[faces[f]];this.updateTexture(imageBitmap, gpuTexture, width, height, 1, format, f, 0, invertY, premultiplyAlpha, offsetX, offsetY);}}updateTexture(imageBitmap, texture, width, height, layers, format, faceIndex = 0, mipLevel = 0, invertY = !1, premultiplyAlpha = !1, offsetX = 0, offsetY = 0, allowGPUOptimization) {const gpuTexture = WebGPUTextureHelper._IsInternalTexture(texture) ? texture._hardwareTexture.underlyingResource : texture,blockInformation = WebGPUTextureHelper._GetBlockInformationFromFormat(format),gpuOrHdwTexture = WebGPUTextureHelper._IsInternalTexture(texture) ? texture._hardwareTexture : texture,textureCopyView = { texture: gpuTexture, origin: { x: offsetX, y: offsetY, z: Math.max(faceIndex, 0) }, mipLevel: mipLevel, premultipliedAlpha: premultiplyAlpha },textureExtent = { width: Math.ceil(width / blockInformation.width) * blockInformation.width, height: Math.ceil(height / blockInformation.height) * blockInformation.height, depthOrArrayLayers: layers || 1 };if (void 0 !== imageBitmap.byteLength) {imageBitmap = imageBitmap;const bytesPerRow = Math.ceil(width / blockInformation.width) * blockInformation.length,aligned = 256 * Math.ceil(bytesPerRow / 256) === bytesPerRow;if (aligned) {const commandEncoder = this._device.createCommandEncoder({}),buffer = this._bufferManager.createRawBuffer(imageBitmap.byteLength, BufferUsage.MapWrite | BufferUsage.CopySrc, !0),arrayBuffer = buffer.getMappedRange();new Uint8Array(arrayBuffer).set(imageBitmap), buffer.unmap(), commandEncoder.copyBufferToTexture({ buffer: buffer, offset: 0, bytesPerRow, rowsPerImage: height }, textureCopyView, textureExtent), this._device.queue.submit([commandEncoder.finish()]), this._bufferManager.releaseBuffer(buffer);} else this._device.queue.writeTexture(textureCopyView, imageBitmap, { offset: 0, bytesPerRow, rowsPerImage: height }, textureExtent);if (invertY || premultiplyAlpha) if (WebGPUTextureHelper._IsInternalTexture(texture)) {const dontUseRect = 0 === offsetX && 0 === offsetY && width === texture.width && height === texture.height;this.invertYPreMultiplyAlpha(gpuOrHdwTexture, texture.width, texture.height, format, invertY, premultiplyAlpha, faceIndex, mipLevel, layers || 1, offsetX, offsetY, dontUseRect ? 0 : width, dontUseRect ? 0 : height, void 0, allowGPUOptimization);} else throw "updateTexture: Can't process the texture data because a GPUTexture was provided instead of an InternalTexture!";} else if (imageBitmap = imageBitmap, !invertY) this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, textureCopyView, textureExtent);else if (textureCopyView.premultipliedAlpha = !1, WebGPUTextureHelper._IsInternalTexture(texture) && 0 === offsetX && 0 === offsetY && width === texture.width && height === texture.height) this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, textureCopyView, textureExtent), this.invertYPreMultiplyAlpha(gpuOrHdwTexture, width, height, format, invertY, premultiplyAlpha, faceIndex, mipLevel, layers || 1, 0, 0, 0, 0, void 0, allowGPUOptimization);else {const commandEncoder = this._device.createCommandEncoder({}),srcTexture = this.createTexture({ width, height, layers: 1 }, !1, !1, !1, !1, !1, format, 1, commandEncoder, TextureUsage.CopySrc | TextureUsage.TextureBinding);this._deferredReleaseTextures.push([srcTexture, null]), textureExtent.depthOrArrayLayers = 1, this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, { texture: srcTexture }, textureExtent), textureExtent.depthOrArrayLayers = layers || 1, this.invertYPreMultiplyAlpha(srcTexture, width, height, format, invertY, premultiplyAlpha, faceIndex, mipLevel, layers || 1, 0, 0, 0, 0, commandEncoder, allowGPUOptimization), commandEncoder.copyTextureToTexture({ texture: srcTexture }, textureCopyView, textureExtent), this._device.queue.submit([commandEncoder.finish()]);}}readPixels(texture, x, y, width, height, format, faceIndex = 0, mipLevel = 0, buffer = null, noDataConversion = !1) {const blockInformation = WebGPUTextureHelper._GetBlockInformationFromFormat(format),bytesPerRow = Math.ceil(width / blockInformation.width) * blockInformation.length,bytesPerRowAligned = 256 * Math.ceil(bytesPerRow / 256),size = bytesPerRowAligned * height,gpuBuffer = this._bufferManager.createRawBuffer(size, BufferUsage.MapRead | BufferUsage.CopyDst),commandEncoder = this._device.createCommandEncoder({});return commandEncoder.copyTextureToBuffer({ texture, mipLevel, origin: { x, y, z: Math.max(faceIndex, 0) } }, { buffer: gpuBuffer, offset: 0, bytesPerRow: bytesPerRowAligned }, { width, height, depthOrArrayLayers: 1 }), this._device.queue.submit([commandEncoder.finish()]), this._bufferManager.readDataFromBuffer(gpuBuffer, size, width, height, bytesPerRow, bytesPerRowAligned, WebGPUTextureHelper._GetTextureTypeFromFormat(format), 0, buffer, !0, noDataConversion);}releaseTexture(texture) {if (WebGPUTextureHelper._IsInternalTexture(texture)) {const hardwareTexture = texture._hardwareTexture,irradianceTexture = texture._irradianceTexture;this._deferredReleaseTextures.push([hardwareTexture, irradianceTexture]);} else this._deferredReleaseTextures.push([texture, null]);}destroyDeferredTextures() {for (let i = 0; i < this._deferredReleaseTextures.length; ++i) {const [hardwareTexture, irradianceTexture] = this._deferredReleaseTextures[i];hardwareTexture && (WebGPUTextureHelper._IsHardwareTexture(hardwareTexture) ? hardwareTexture.release() : hardwareTexture.destroy()), null === irradianceTexture || void 0 === irradianceTexture ? void 0 : irradianceTexture.dispose();}this._deferredReleaseTextures.length = 0;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/WebGPU/webgpuDataBuffer.js
class WebGPUDataBuffer extends dataBuffer/* DataBuffer */.h {constructor(resource) {super(), this._buffer = resource;}get underlyingResource() {return this._buffer;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/textureTools.js
var textureTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/textureTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuBufferManager.js
class WebGPUBufferManager {static _IsGPUBuffer(buffer) {return buffer.underlyingResource === void 0;}constructor(device) {this._deferredReleaseBuffers = [], this._device = device;}createRawBuffer(viewOrSize, flags, mappedAtCreation = !1) {const alignedLength = viewOrSize.byteLength === void 0 ? -4 & viewOrSize + 3 : -4 & viewOrSize.byteLength + 3;return this._device.createBuffer({ mappedAtCreation, size: alignedLength, usage: flags });}createBuffer(viewOrSize, flags) {const isView = void 0 !== viewOrSize.byteLength,buffer = this.createRawBuffer(viewOrSize, flags),dataBuffer = new WebGPUDataBuffer(buffer);return dataBuffer.references = 1, dataBuffer.capacity = isView ? viewOrSize.byteLength : viewOrSize, isView && this.setSubData(dataBuffer, 0, viewOrSize), dataBuffer;}setRawData(buffer, dstByteOffset, src, srcByteOffset, byteLength) {this._device.queue.writeBuffer(buffer, dstByteOffset, src.buffer, srcByteOffset, byteLength);}setSubData(dataBuffer, dstByteOffset, src, srcByteOffset = 0, byteLength = 0) {const buffer = dataBuffer.underlyingResource;byteLength = byteLength || src.byteLength, byteLength = Math.min(byteLength, dataBuffer.capacity - dstByteOffset);let chunkStart = src.byteOffset + srcByteOffset,chunkEnd = chunkStart + byteLength;const alignedLength = -4 & byteLength + 3;if (alignedLength !== byteLength) {const tempView = new Uint8Array(src.buffer.slice(chunkStart, chunkEnd));src = new Uint8Array(alignedLength), src.set(tempView), srcByteOffset = 0, chunkStart = 0, chunkEnd = alignedLength, byteLength = alignedLength;}const maxChunk = 15728640;let offset = 0;for (; chunkEnd - (chunkStart + offset) > maxChunk;) this._device.queue.writeBuffer(buffer, dstByteOffset + offset, src.buffer, chunkStart + offset, maxChunk), offset += maxChunk;this._device.queue.writeBuffer(buffer, dstByteOffset + offset, src.buffer, chunkStart + offset, byteLength - offset);}_getHalfFloatAsFloatRGBAArrayBuffer(dataLength, arrayBuffer, destArray) {destArray || (destArray = new Float32Array(dataLength));for (const srcData = new Uint16Array(arrayBuffer); dataLength--;) destArray[dataLength] = (0,textureTools/* FromHalfFloat */.qZ)(srcData[dataLength]);return destArray;}readDataFromBuffer(gpuBuffer, size, width, height, bytesPerRow, bytesPerRowAligned, type = 0, offset = 0, buffer = null, destroyBuffer = !0, noDataConversion = !1) {const floatFormat = 1 === type ? 2 : 2 === type ? 1 : 0;return new Promise((resolve, reject) => {gpuBuffer.mapAsync(MapMode.Read, offset, size).then(() => {const copyArrayBuffer = gpuBuffer.getMappedRange(offset, size);let data = buffer;if (noDataConversion ? data = null === data ? (0,engine_readTexture/* allocateAndCopyTypedBuffer */.A)(type, size, !0, copyArrayBuffer) : (0,engine_readTexture/* allocateAndCopyTypedBuffer */.A)(type, data.buffer, void 0, copyArrayBuffer) : null === data ? 0 === floatFormat ? (data = new Uint8Array(size), data.set(new Uint8Array(copyArrayBuffer))) : 1 === floatFormat ? data = this._getHalfFloatAsFloatRGBAArrayBuffer(size / 2, copyArrayBuffer) : 2 === floatFormat ? (data = new Float32Array(size / 4), data.set(new Float32Array(copyArrayBuffer))) : void 0 : 0 === floatFormat ? (data = new Uint8Array(data.buffer), data.set(new Uint8Array(copyArrayBuffer))) : 1 === floatFormat ? data = this._getHalfFloatAsFloatRGBAArrayBuffer(size / 2, copyArrayBuffer, buffer) : 2 === floatFormat ? (data = new Float32Array(data.buffer), data.set(new Float32Array(copyArrayBuffer))) : void 0, bytesPerRow !== bytesPerRowAligned) {1 !== floatFormat || noDataConversion || (bytesPerRow *= 2, bytesPerRowAligned *= 2);const data2 = new Uint8Array(data.buffer);let offset = bytesPerRow,offset2 = 0;for (let y = 1; y < height; ++y) {offset2 = y * bytesPerRowAligned;for (let x = 0; x < bytesPerRow; ++x) data2[offset++] = data2[offset2++];}data = 0 === floatFormat || noDataConversion ? new Uint8Array(data2.buffer, 0, offset) : new Float32Array(data2.buffer, 0, offset / 4);}gpuBuffer.unmap(), destroyBuffer && this.releaseBuffer(gpuBuffer), resolve(data);}, (reason) => reject(reason));});}releaseBuffer(buffer) {return WebGPUBufferManager._IsGPUBuffer(buffer) ? (this._deferredReleaseBuffers.push(buffer), !0) : (buffer.references--, 0 === buffer.references && (this._deferredReleaseBuffers.push(buffer.underlyingResource), !0));}destroyDeferredBuffers() {for (let i = 0; i < this._deferredReleaseBuffers.length; ++i) this._deferredReleaseBuffers[i].destroy();this._deferredReleaseBuffers.length = 0;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuRenderPassWrapper.js
class WebGPURenderPassWrapper {constructor() {this.colorAttachmentGPUTextures = [], this.reset();}reset(fullReset = !1) {this.renderPass = null, fullReset && (this.renderPassDescriptor = null, this.colorAttachmentViewDescriptor = null, this.depthAttachmentViewDescriptor = null, this.colorAttachmentGPUTextures = [], this.depthTextureFormat = void 0);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheSampler.js
const filterToBits = [0, 0, 3, 7, 0, 2, 6, 2, 4, 1, 5, 3, 1],comparisonFunctionToBits = [0, 64, 32, 96, 16, 80, 48, 112, 8],filterNoMipToBits = [0, 128, 128, 0, 0, 0, 0, 128, 0, 0, 0, 0, 128];class WebGPUCacheSampler {constructor(device) {this._samplers = {}, this._device = device, this.disabled = !1;}static GetSamplerHashCode(sampler) {var _a, _b, _c;const anisotropy = sampler._cachedAnisotropicFilteringLevel && 1 < sampler._cachedAnisotropicFilteringLevel ? 4 : 1,code = filterToBits[sampler.samplingMode] + comparisonFunctionToBits[(sampler._comparisonFunction || 514) - 512 + 1] + filterNoMipToBits[sampler.samplingMode] + ((null !== (_a = sampler._cachedWrapU) && void 0 !== _a ? _a : 1) << 8) + ((null !== (_b = sampler._cachedWrapV) && void 0 !== _b ? _b : 1) << 10) + ((null !== (_c = sampler._cachedWrapR) && void 0 !== _c ? _c : 1) << 12) + ((sampler.useMipMaps ? 1 : 0) << 14) + (anisotropy << 15);return code;}static _GetSamplerFilterDescriptor(sampler, anisotropy) {let magFilter, minFilter, mipmapFilter, lodMinClamp, lodMaxClamp;const useMipMaps = sampler.useMipMaps;switch (sampler.samplingMode) {case 11:magFilter = FilterMode.Linear, minFilter = FilterMode.Linear, mipmapFilter = FilterMode.Nearest, useMipMaps || (lodMinClamp = lodMaxClamp = 0);break;case 3:case 3:magFilter = FilterMode.Linear, minFilter = FilterMode.Linear, useMipMaps ? mipmapFilter = FilterMode.Linear : (mipmapFilter = FilterMode.Nearest, lodMinClamp = lodMaxClamp = 0);break;case 8:magFilter = FilterMode.Nearest, minFilter = FilterMode.Nearest, useMipMaps ? mipmapFilter = FilterMode.Linear : (mipmapFilter = FilterMode.Nearest, lodMinClamp = lodMaxClamp = 0);break;case 4:magFilter = FilterMode.Nearest, minFilter = FilterMode.Nearest, mipmapFilter = FilterMode.Nearest, useMipMaps || (lodMinClamp = lodMaxClamp = 0);break;case 5:magFilter = FilterMode.Nearest, minFilter = FilterMode.Linear, mipmapFilter = FilterMode.Nearest, useMipMaps || (lodMinClamp = lodMaxClamp = 0);break;case 6:magFilter = FilterMode.Nearest, minFilter = FilterMode.Linear, useMipMaps ? mipmapFilter = FilterMode.Linear : (mipmapFilter = FilterMode.Nearest, lodMinClamp = lodMaxClamp = 0);break;case 7:magFilter = FilterMode.Nearest, minFilter = FilterMode.Linear, mipmapFilter = FilterMode.Nearest, lodMinClamp = lodMaxClamp = 0;break;case 1:case 1:magFilter = FilterMode.Nearest, minFilter = FilterMode.Nearest, mipmapFilter = FilterMode.Nearest, lodMinClamp = lodMaxClamp = 0;break;case 9:magFilter = FilterMode.Linear, minFilter = FilterMode.Nearest, mipmapFilter = FilterMode.Nearest, useMipMaps || (lodMinClamp = lodMaxClamp = 0);break;case 10:magFilter = FilterMode.Linear, minFilter = FilterMode.Nearest, useMipMaps ? mipmapFilter = FilterMode.Linear : (mipmapFilter = FilterMode.Nearest, lodMinClamp = lodMaxClamp = 0);break;case 2:case 2:magFilter = FilterMode.Linear, minFilter = FilterMode.Linear, mipmapFilter = FilterMode.Nearest, lodMinClamp = lodMaxClamp = 0;break;case 12:magFilter = FilterMode.Linear, minFilter = FilterMode.Nearest, mipmapFilter = FilterMode.Nearest, lodMinClamp = lodMaxClamp = 0;break;default:magFilter = FilterMode.Nearest, minFilter = FilterMode.Nearest, mipmapFilter = FilterMode.Nearest, lodMinClamp = lodMaxClamp = 0;}return 1 < anisotropy && (0 !== lodMinClamp || 0 !== lodMaxClamp) ? { magFilter: FilterMode.Linear, minFilter: FilterMode.Linear, mipmapFilter: FilterMode.Linear, anisotropyEnabled: !0 } : { magFilter, minFilter, mipmapFilter, lodMinClamp, lodMaxClamp };}static _GetWrappingMode(mode) {return 1 === mode ? AddressMode.Repeat : 0 === mode ? AddressMode.ClampToEdge : 2 === mode ? AddressMode.MirrorRepeat : AddressMode.Repeat;}static _GetSamplerWrappingDescriptor(sampler) {return { addressModeU: this._GetWrappingMode(sampler._cachedWrapU), addressModeV: this._GetWrappingMode(sampler._cachedWrapV), addressModeW: this._GetWrappingMode(sampler._cachedWrapR) };}static _GetSamplerDescriptor(sampler) {const anisotropy = sampler.useMipMaps && sampler._cachedAnisotropicFilteringLevel && 1 < sampler._cachedAnisotropicFilteringLevel ? 4 : 1,filterDescriptor = this._GetSamplerFilterDescriptor(sampler, anisotropy);return { ...filterDescriptor, ...this._GetSamplerWrappingDescriptor(sampler), compare: sampler._comparisonFunction ? WebGPUCacheSampler.GetCompareFunction(sampler._comparisonFunction) : void 0, maxAnisotropy: filterDescriptor.anisotropyEnabled ? anisotropy : 1 };}static GetCompareFunction(compareFunction) {return 519 === compareFunction ? CompareFunction.Always : 514 === compareFunction ? CompareFunction.Equal : 516 === compareFunction ? CompareFunction.Greater : 518 === compareFunction ? CompareFunction.GreaterEqual : 513 === compareFunction ? CompareFunction.Less : 515 === compareFunction ? CompareFunction.LessEqual : 512 === compareFunction ? CompareFunction.Never : 517 === compareFunction ? CompareFunction.NotEqual : CompareFunction.Less;}getSampler(sampler, bypassCache = !1, hash = 0) {if (this.disabled) return this._device.createSampler(WebGPUCacheSampler._GetSamplerDescriptor(sampler));bypassCache ? hash = 0 : 0 === hash && (hash = WebGPUCacheSampler.GetSamplerHashCode(sampler));let gpuSampler = bypassCache ? void 0 : this._samplers[hash];return gpuSampler || (gpuSampler = this._device.createSampler(WebGPUCacheSampler._GetSamplerDescriptor(sampler)), !bypassCache && (this._samplers[hash] = gpuSampler)), gpuSampler;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheRenderPipeline.js
var StatePosition;(function (StatePosition) {StatePosition[StatePosition.StencilReadMask = 0] = "StencilReadMask", StatePosition[StatePosition.StencilWriteMask = 1] = "StencilWriteMask", StatePosition[StatePosition.DepthBias = 2] = "DepthBias", StatePosition[StatePosition.DepthBiasSlopeScale = 3] = "DepthBiasSlopeScale", StatePosition[StatePosition.DepthStencilState = 4] = "DepthStencilState", StatePosition[StatePosition.MRTAttachments1 = 5] = "MRTAttachments1", StatePosition[StatePosition.MRTAttachments2 = 6] = "MRTAttachments2", StatePosition[StatePosition.RasterizationState = 7] = "RasterizationState", StatePosition[StatePosition.ColorStates = 8] = "ColorStates", StatePosition[StatePosition.ShaderStage = 9] = "ShaderStage", StatePosition[StatePosition.TextureStage = 10] = "TextureStage", StatePosition[StatePosition.VertexState = 11] = "VertexState", StatePosition[StatePosition.NumStates = 12] = "NumStates";})(StatePosition || (StatePosition = {}));const alphaBlendFactorToIndex = { 0: 1, 1: 2, 768: 3, 769: 4, 770: 5, 771: 6, 772: 7, 773: 8, 774: 9, 775: 10, 776: 11, 32769: 12, 32770: 13, 32771: 12, 32772: 13 },stencilOpToIndex = { 0: 0, 7680: 1, 7681: 2, 7682: 3, 7683: 4, 5386: 5, 34055: 6, 34056: 7 };class WebGPUCacheRenderPipeline {constructor(device, emptyVertexBuffer, useTextureStage) {this.mrtTextureCount = 0, this._device = device, this._useTextureStage = useTextureStage, this._states = Array(30), this._statesLength = 0, this._stateDirtyLowestIndex = 0, this._emptyVertexBuffer = emptyVertexBuffer, this._mrtFormats = [], this._parameter = { token: void 0, pipeline: null }, this.disabled = !1, this.vertexBuffers = [], this._kMaxVertexBufferStride = device.limits.maxVertexBufferArrayStride || 2048, this.reset();}reset() {this._isDirty = !0, this.vertexBuffers.length = 0, this.setAlphaToCoverage(!1), this.resetDepthCullingState(), this.setClampDepth(!1), this.setDepthBias(0), this._webgpuColorFormat = [TextureFormat.BGRA8Unorm], this.setColorFormat(TextureFormat.BGRA8Unorm), this.setMRT([]), this.setAlphaBlendEnabled(!1), this.setAlphaBlendFactors([null, null, null, null], [null, null]), this.setWriteMask(15), this.setDepthStencilFormat(TextureFormat.Depth24PlusStencil8), this.setStencilEnabled(!1), this.resetStencilState(), this.setBuffers(null, null, null), this._setTextureState(0);}get colorFormats() {return 0 < this._mrtAttachments1 ? this._mrtFormats : this._webgpuColorFormat;}getRenderPipeline(fillMode, effect, sampleCount, textureState = 0) {if (1 < sampleCount && (sampleCount = 4), this.disabled) {const topology = WebGPUCacheRenderPipeline._GetTopology(fillMode);return this._setVertexState(effect), this._parameter.pipeline = this._createRenderPipeline(effect, topology, sampleCount), WebGPUCacheRenderPipeline.NumCacheMiss++, WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame++, this._parameter.pipeline;}if (this._setShaderStage(effect.uniqueId), this._setRasterizationState(fillMode, sampleCount), this._setColorStates(), this._setDepthStencilState(), this._setVertexState(effect), this._setTextureState(textureState), this.lastStateDirtyLowestIndex = this._stateDirtyLowestIndex, !this._isDirty && this._parameter.pipeline) return this._stateDirtyLowestIndex = this._statesLength, WebGPUCacheRenderPipeline.NumCacheHitWithoutHash++, this._parameter.pipeline;if (this._getRenderPipeline(this._parameter), this._isDirty = !1, this._stateDirtyLowestIndex = this._statesLength, this._parameter.pipeline) return WebGPUCacheRenderPipeline.NumCacheHitWithHash++, this._parameter.pipeline;const topology = WebGPUCacheRenderPipeline._GetTopology(fillMode);return this._parameter.pipeline = this._createRenderPipeline(effect, topology, sampleCount), this._setRenderPipeline(this._parameter), WebGPUCacheRenderPipeline.NumCacheMiss++, WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame++, this._parameter.pipeline;}endFrame() {WebGPUCacheRenderPipeline.NumPipelineCreationLastFrame = WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame, WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame = 0;}setAlphaToCoverage(enabled) {this._alphaToCoverageEnabled = enabled;}setFrontFace(frontFace) {this._frontFace = frontFace;}setCullEnabled(enabled) {this._cullEnabled = enabled;}setCullFace(cullFace) {this._cullFace = cullFace;}setClampDepth(clampDepth) {this._clampDepth = clampDepth;}resetDepthCullingState() {this.setDepthCullingState(!1, 2, 1, 0, 0, !0, !0, 519);}setDepthCullingState(cullEnabled, frontFace, cullFace, zOffset, zOffsetUnits, depthTestEnabled, depthWriteEnabled, depthCompare) {this._depthWriteEnabled = depthWriteEnabled, this._depthTestEnabled = depthTestEnabled, this._depthCompare = (null !== depthCompare && void 0 !== depthCompare ? depthCompare : 519) - 512, this._cullFace = cullFace, this._cullEnabled = cullEnabled, this._frontFace = frontFace, this.setDepthBiasSlopeScale(zOffset), this.setDepthBias(zOffsetUnits);}setDepthBias(depthBias) {this._depthBias !== depthBias && (this._depthBias = depthBias, this._states[StatePosition.DepthBias] = depthBias, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.DepthBias));}setDepthBiasSlopeScale(depthBiasSlopeScale) {this._depthBiasSlopeScale !== depthBiasSlopeScale && (this._depthBiasSlopeScale = depthBiasSlopeScale, this._states[StatePosition.DepthBiasSlopeScale] = depthBiasSlopeScale, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.DepthBiasSlopeScale));}setColorFormat(format) {this._webgpuColorFormat[0] = format, this._colorFormat = renderableTextureFormatToIndex[null !== format && void 0 !== format ? format : ""];}setMRTAttachments(attachments) {this.mrtAttachments = attachments;let mask = 0;for (let i = 0; i < attachments.length; ++i) 0 !== attachments[i] && (mask += 1 << i);this._mrtEnabledMask !== mask && (this._mrtEnabledMask = mask, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.MRTAttachments1));}setMRT(textureArray, textureCount) {var _a, _b;if (textureCount = null !== textureCount && void 0 !== textureCount ? textureCount : textureArray.length, 10 < textureCount) throw "Can't handle more than 10 attachments for a MRT in cache render pipeline!";this.mrtTextureArray = textureArray, this.mrtTextureCount = textureCount, this._mrtEnabledMask = 65535;const bits = [0, 0];let indexBits = 0,mask = 0,numRT = 0;for (let i = 0; i < textureCount; ++i) {const texture = textureArray[i],gpuWrapper = null === texture || void 0 === texture ? void 0 : texture._hardwareTexture;this._mrtFormats[numRT] = null !== (_a = null === gpuWrapper || void 0 === gpuWrapper ? void 0 : gpuWrapper.format) && void 0 !== _a ? _a : this._webgpuColorFormat[0], bits[indexBits] += renderableTextureFormatToIndex[null !== (_b = this._mrtFormats[numRT]) && void 0 !== _b ? _b : ""] << mask, mask += 6, numRT++, 32 <= mask && (mask = 0, indexBits++);}this._mrtFormats.length = numRT, (this._mrtAttachments1 !== bits[0] || this._mrtAttachments2 !== bits[1]) && (this._mrtAttachments1 = bits[0], this._mrtAttachments2 = bits[1], this._states[StatePosition.MRTAttachments1] = bits[0], this._states[StatePosition.MRTAttachments2] = bits[1], this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.MRTAttachments1));}setAlphaBlendEnabled(enabled) {this._alphaBlendEnabled = enabled;}setAlphaBlendFactors(factors, operations) {this._alphaBlendFuncParams = factors, this._alphaBlendEqParams = operations;}setWriteMask(mask) {this._writeMask = mask;}setDepthStencilFormat(format) {this._webgpuDepthStencilFormat = format, this._depthStencilFormat = format === void 0 ? 0 : renderableTextureFormatToIndex[format];}setDepthTestEnabled(enabled) {this._depthTestEnabled = enabled;}setDepthWriteEnabled(enabled) {this._depthWriteEnabled = enabled;}setDepthCompare(func) {this._depthCompare = (null !== func && void 0 !== func ? func : 519) - 512;}setStencilEnabled(enabled) {this._stencilEnabled = enabled;}setStencilCompare(func) {this._stencilFrontCompare = (null !== func && void 0 !== func ? func : 519) - 512;}setStencilDepthFailOp(op) {this._stencilFrontDepthFailOp = null === op ? 1 : stencilOpToIndex[op];}setStencilPassOp(op) {this._stencilFrontPassOp = null === op ? 2 : stencilOpToIndex[op];}setStencilFailOp(op) {this._stencilFrontFailOp = null === op ? 1 : stencilOpToIndex[op];}setStencilReadMask(mask) {this._stencilReadMask !== mask && (this._stencilReadMask = mask, this._states[StatePosition.StencilReadMask] = mask, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.StencilReadMask));}setStencilWriteMask(mask) {this._stencilWriteMask !== mask && (this._stencilWriteMask = mask, this._states[StatePosition.StencilWriteMask] = mask, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.StencilWriteMask));}resetStencilState() {this.setStencilState(!1, 519, 7680, 7681, 7680, 255, 255);}setStencilState(stencilEnabled, compare, depthFailOp, passOp, failOp, readMask, writeMask) {this._stencilEnabled = stencilEnabled, this._stencilFrontCompare = (null !== compare && void 0 !== compare ? compare : 519) - 512, this._stencilFrontDepthFailOp = null === depthFailOp ? 1 : stencilOpToIndex[depthFailOp], this._stencilFrontPassOp = null === passOp ? 2 : stencilOpToIndex[passOp], this._stencilFrontFailOp = null === failOp ? 1 : stencilOpToIndex[failOp], this.setStencilReadMask(readMask), this.setStencilWriteMask(writeMask);}setBuffers(vertexBuffers, indexBuffer, overrideVertexBuffers) {this._vertexBuffers = vertexBuffers, this._overrideVertexBuffers = overrideVertexBuffers, this._indexBuffer = indexBuffer;}static _GetTopology(fillMode) {switch (fillMode) {case 0:return PrimitiveTopology.TriangleList;case 2:return PrimitiveTopology.PointList;case 1:return PrimitiveTopology.LineList;case 3:return PrimitiveTopology.PointList;case 4:return PrimitiveTopology.LineList;case 5:throw "LineLoop is an unsupported fillmode in WebGPU";case 6:return PrimitiveTopology.LineStrip;case 7:return PrimitiveTopology.TriangleStrip;case 8:throw "TriangleFan is an unsupported fillmode in WebGPU";default:return PrimitiveTopology.TriangleList;}}static _GetAphaBlendOperation(operation) {return 32774 === operation ? BlendOperation.Add : 32778 === operation ? BlendOperation.Subtract : 32779 === operation ? BlendOperation.ReverseSubtract : 32775 === operation ? BlendOperation.Min : 32776 === operation ? BlendOperation.Max : BlendOperation.Add;}static _GetAphaBlendFactor(factor) {return 0 === factor ? BlendFactor.Zero : 1 === factor ? BlendFactor.One : 768 === factor ? BlendFactor.Src : 769 === factor ? BlendFactor.OneMinusSrc : 770 === factor ? BlendFactor.SrcAlpha : 771 === factor ? BlendFactor.OneMinusSrcAlpha : 772 === factor ? BlendFactor.DstAlpha : 773 === factor ? BlendFactor.OneMinusDstAlpha : 774 === factor ? BlendFactor.Dst : 775 === factor ? BlendFactor.OneMinusDst : 776 === factor ? BlendFactor.SrcAlphaSaturated : 32769 === factor ? BlendFactor.Constant : 32770 === factor ? BlendFactor.OneMinusConstant : 32771 === factor ? BlendFactor.Constant : 32772 === factor ? BlendFactor.OneMinusConstant : BlendFactor.One;}static _GetCompareFunction(compareFunction) {return 0 === compareFunction ? CompareFunction.Never : 1 === compareFunction ? CompareFunction.Less : 2 === compareFunction ? CompareFunction.Equal : 3 === compareFunction ? CompareFunction.LessEqual : 4 === compareFunction ? CompareFunction.Greater : 5 === compareFunction ? CompareFunction.NotEqual : 6 === compareFunction ? CompareFunction.GreaterEqual : 7 === compareFunction ? CompareFunction.Always : CompareFunction.Never;}static _GetStencilOpFunction(operation) {return 0 === operation ? StencilOperation.Zero : 1 === operation ? StencilOperation.Keep : 2 === operation ? StencilOperation.Replace : 3 === operation ? StencilOperation.IncrementClamp : 4 === operation ? StencilOperation.DecrementClamp : 5 === operation ? StencilOperation.Invert : 6 === operation ? StencilOperation.IncrementWrap : 7 === operation ? StencilOperation.DecrementWrap : StencilOperation.Keep;}static _GetVertexInputDescriptorFormat(vertexBuffer) {const type = vertexBuffer.type,normalized = vertexBuffer.normalized,size = vertexBuffer.getSize();switch (type) {case Buffers_buffer/* VertexBuffer.BYTE */.o.BYTE:switch (size) {case 1:case 2:return normalized ? VertexFormat.Snorm8x2 : VertexFormat.Sint8x2;case 3:case 4:return normalized ? VertexFormat.Snorm8x4 : VertexFormat.Sint8x4;}break;case Buffers_buffer/* VertexBuffer.UNSIGNED_BYTE */.o.UNSIGNED_BYTE:switch (size) {case 1:case 2:return normalized ? VertexFormat.Unorm8x2 : VertexFormat.Uint8x2;case 3:case 4:return normalized ? VertexFormat.Unorm8x4 : VertexFormat.Uint8x4;}break;case Buffers_buffer/* VertexBuffer.SHORT */.o.SHORT:switch (size) {case 1:case 2:return normalized ? VertexFormat.Snorm16x2 : VertexFormat.Sint16x2;case 3:case 4:return normalized ? VertexFormat.Snorm16x4 : VertexFormat.Sint16x4;}break;case Buffers_buffer/* VertexBuffer.UNSIGNED_SHORT */.o.UNSIGNED_SHORT:switch (size) {case 1:case 2:return normalized ? VertexFormat.Unorm16x2 : VertexFormat.Uint16x2;case 3:case 4:return normalized ? VertexFormat.Unorm16x4 : VertexFormat.Uint16x4;}break;case Buffers_buffer/* VertexBuffer.INT */.o.INT:switch (size) {case 1:return VertexFormat.Sint32;case 2:return VertexFormat.Sint32x2;case 3:return VertexFormat.Sint32x3;case 4:return VertexFormat.Sint32x4;}break;case Buffers_buffer/* VertexBuffer.UNSIGNED_INT */.o.UNSIGNED_INT:switch (size) {case 1:return VertexFormat.Uint32;case 2:return VertexFormat.Uint32x2;case 3:return VertexFormat.Uint32x3;case 4:return VertexFormat.Uint32x4;}break;case Buffers_buffer/* VertexBuffer.FLOAT */.o.FLOAT:switch (size) {case 1:return VertexFormat.Float32;case 2:return VertexFormat.Float32x2;case 3:return VertexFormat.Float32x3;case 4:return VertexFormat.Float32x4;}}throw new Error(`Invalid Format '${vertexBuffer.getKind()}' - type=${type}, normalized=${normalized}, size=${size}`);}_getAphaBlendState() {return this._alphaBlendEnabled ? { srcFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[2]), dstFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[3]), operation: WebGPUCacheRenderPipeline._GetAphaBlendOperation(this._alphaBlendEqParams[1]) } : null;}_getColorBlendState() {return this._alphaBlendEnabled ? { srcFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[0]), dstFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[1]), operation: WebGPUCacheRenderPipeline._GetAphaBlendOperation(this._alphaBlendEqParams[0]) } : null;}_setShaderStage(id) {this._shaderId !== id && (this._shaderId = id, this._states[StatePosition.ShaderStage] = id, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.ShaderStage));}_setRasterizationState(topology, sampleCount) {const frontFace = this._frontFace,cullMode = this._cullEnabled ? this._cullFace : 0,clampDepth = this._clampDepth ? 1 : 0,alphaToCoverage = this._alphaToCoverageEnabled ? 1 : 0,rasterizationState = frontFace - 1 + (cullMode << 1) + (clampDepth << 3) + (alphaToCoverage << 4) + (topology << 5) + (sampleCount << 8);this._rasterizationState !== rasterizationState && (this._rasterizationState = rasterizationState, this._states[StatePosition.RasterizationState] = this._rasterizationState, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.RasterizationState));}_setColorStates() {let colorStates = ((this._writeMask ? 1 : 0) << 22) + (this._colorFormat << 23) + ((this._depthWriteEnabled ? 1 : 0) << 29);this._alphaBlendEnabled && (colorStates += ((null === this._alphaBlendFuncParams[0] ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[0]]) << 0) + ((null === this._alphaBlendFuncParams[1] ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[1]]) << 4) + ((null === this._alphaBlendFuncParams[2] ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[2]]) << 8) + ((null === this._alphaBlendFuncParams[3] ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[3]]) << 12) + ((null === this._alphaBlendEqParams[0] ? 1 : this._alphaBlendEqParams[0] - 32773) << 16) + ((null === this._alphaBlendEqParams[1] ? 1 : this._alphaBlendEqParams[1] - 32773) << 19)), colorStates !== this._colorStates && (this._colorStates = colorStates, this._states[StatePosition.ColorStates] = this._colorStates, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.ColorStates));}_setDepthStencilState() {const stencilState = this._stencilEnabled ? this._stencilFrontCompare + (this._stencilFrontDepthFailOp << 3) + (this._stencilFrontPassOp << 6) + (this._stencilFrontFailOp << 9) : 591,depthStencilState = this._depthStencilFormat + ((this._depthTestEnabled ? this._depthCompare : 7) << 6) + (stencilState << 10);this._depthStencilState !== depthStencilState && (this._depthStencilState = depthStencilState, this._states[StatePosition.DepthStencilState] = this._depthStencilState, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.DepthStencilState));}_setVertexState(effect) {var _a, _b;const currStateLen = this._statesLength;let newNumStates = StatePosition.VertexState;const webgpuPipelineContext = effect._pipelineContext,attributes = webgpuPipelineContext.shaderProcessingContext.attributeNamesFromEffect,locations = webgpuPipelineContext.shaderProcessingContext.attributeLocationsFromEffect;let currentGPUBuffer,numVertexBuffers = 0;for (let index = 0; index < attributes.length; index++) {const location = locations[index];let vertexBuffer = null !== (_a = this._overrideVertexBuffers && this._overrideVertexBuffers[attributes[index]]) && void 0 !== _a ? _a : this._vertexBuffers[attributes[index]];vertexBuffer || (vertexBuffer = this._emptyVertexBuffer);const buffer = null === (_b = vertexBuffer.getBuffer()) || void 0 === _b ? void 0 : _b.underlyingResource;if (vertexBuffer._validOffsetRange === void 0) {const offset = vertexBuffer.byteOffset,formatSize = vertexBuffer.getSize(!0),byteStride = vertexBuffer.byteStride;vertexBuffer._validOffsetRange = offset <= this._kMaxVertexBufferStride - formatSize && (0 === byteStride || offset + formatSize <= byteStride);}currentGPUBuffer && currentGPUBuffer === buffer && vertexBuffer._validOffsetRange || (this.vertexBuffers[numVertexBuffers++] = vertexBuffer, currentGPUBuffer = vertexBuffer._validOffsetRange ? buffer : null);const vid = vertexBuffer.hashCode + (location << 7);this._isDirty = this._isDirty || this._states[newNumStates] !== vid, this._states[newNumStates++] = vid;}this.vertexBuffers.length = numVertexBuffers, this._statesLength = newNumStates, this._isDirty = this._isDirty || newNumStates !== currStateLen, this._isDirty && (this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.VertexState));}_setTextureState(textureState) {this._textureState !== textureState && (this._textureState = textureState, this._states[StatePosition.TextureStage] = this._textureState, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.TextureStage));}_createPipelineLayout(webgpuPipelineContext) {if (this._useTextureStage) return this._createPipelineLayoutWithTextureStage(webgpuPipelineContext);const bindGroupLayouts = [],bindGroupLayoutEntries = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries;for (let i = 0; i < bindGroupLayoutEntries.length; i++) {const setDefinition = bindGroupLayoutEntries[i];bindGroupLayouts[i] = this._device.createBindGroupLayout({ entries: setDefinition });}return webgpuPipelineContext.bindGroupLayouts = bindGroupLayouts, this._device.createPipelineLayout({ bindGroupLayouts });}_createPipelineLayoutWithTextureStage(webgpuPipelineContext) {var _a;const shaderProcessingContext = webgpuPipelineContext.shaderProcessingContext,bindGroupLayoutEntries = shaderProcessingContext.bindGroupLayoutEntries;let bitVal = 1;for (let i = 0; i < bindGroupLayoutEntries.length; i++) {const setDefinition = bindGroupLayoutEntries[i];for (let j = 0; j < setDefinition.length; j++) {const entry = bindGroupLayoutEntries[i][j];if (entry.texture) {const name = shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name,textureInfo = shaderProcessingContext.availableTextures[name],samplerInfo = textureInfo.autoBindSampler ? shaderProcessingContext.availableSamplers[name + WebGPUShaderProcessor.AutoSamplerSuffix] : null;let sampleType = textureInfo.sampleType,samplerType = null !== (_a = null === samplerInfo || void 0 === samplerInfo ? void 0 : samplerInfo.type) && void 0 !== _a ? _a : SamplerBindingType.Filtering;if (this._textureState & bitVal && sampleType !== TextureSampleType.Depth && (textureInfo.autoBindSampler && (samplerType = SamplerBindingType.NonFiltering), sampleType = TextureSampleType.UnfilterableFloat), entry.texture.sampleType = sampleType, samplerInfo) {const binding = shaderProcessingContext.bindGroupLayoutEntryInfo[samplerInfo.binding.groupIndex][samplerInfo.binding.bindingIndex].index;bindGroupLayoutEntries[samplerInfo.binding.groupIndex][binding].sampler.type = samplerType;}bitVal <<= 1;}}}const bindGroupLayouts = [];for (let i = 0; i < bindGroupLayoutEntries.length; ++i) bindGroupLayouts[i] = this._device.createBindGroupLayout({ entries: bindGroupLayoutEntries[i] });return webgpuPipelineContext.bindGroupLayouts = bindGroupLayouts, this._device.createPipelineLayout({ bindGroupLayouts });}_getVertexInputDescriptor(effect) {var _a, _b;const descriptors = [],webgpuPipelineContext = effect._pipelineContext,attributes = webgpuPipelineContext.shaderProcessingContext.attributeNamesFromEffect,locations = webgpuPipelineContext.shaderProcessingContext.attributeLocationsFromEffect;let currentGPUBuffer, currentGPUAttributes;for (let index = 0; index < attributes.length; index++) {const location = locations[index];let vertexBuffer = null !== (_a = this._overrideVertexBuffers && this._overrideVertexBuffers[attributes[index]]) && void 0 !== _a ? _a : this._vertexBuffers[attributes[index]];vertexBuffer || (vertexBuffer = this._emptyVertexBuffer);let buffer = null === (_b = vertexBuffer.getBuffer()) || void 0 === _b ? void 0 : _b.underlyingResource,offset = vertexBuffer.byteOffset;const invalidOffsetRange = !vertexBuffer._validOffsetRange;if (!(currentGPUBuffer && currentGPUAttributes && currentGPUBuffer === buffer) || invalidOffsetRange) {const vertexBufferDescriptor = { arrayStride: vertexBuffer.byteStride, stepMode: vertexBuffer.getIsInstanced() ? InputStepMode.Instance : InputStepMode.Vertex, attributes: [] };descriptors.push(vertexBufferDescriptor), currentGPUAttributes = vertexBufferDescriptor.attributes, invalidOffsetRange && (offset = 0, buffer = null);}currentGPUAttributes.push({ shaderLocation: location, offset, format: WebGPUCacheRenderPipeline._GetVertexInputDescriptorFormat(vertexBuffer) }), currentGPUBuffer = buffer;}return descriptors;}_createRenderPipeline(effect, topology, sampleCount) {var _a, _b, _c;const webgpuPipelineContext = effect._pipelineContext,inputStateDescriptor = this._getVertexInputDescriptor(effect),pipelineLayout = this._createPipelineLayout(webgpuPipelineContext),colorStates = [],alphaBlend = this._getAphaBlendState(),colorBlend = this._getColorBlendState();if (0 < this._mrtAttachments1) for (let i = 0; i < this._mrtFormats.length; ++i) {const format = this._mrtFormats[i];if (format) {const descr = { format, writeMask: 0 == (this._mrtEnabledMask & 1 << i) ? 0 : this._writeMask };alphaBlend && colorBlend && (descr.blend = { alpha: alphaBlend, color: colorBlend }), colorStates.push(descr);} else colorStates.push(null);} else if (this._webgpuColorFormat[0]) {const descr = { format: this._webgpuColorFormat[0], writeMask: this._writeMask };alphaBlend && colorBlend && (descr.blend = { alpha: alphaBlend, color: colorBlend }), colorStates.push(descr);} else colorStates.push(null);const stencilFrontBack = { compare: WebGPUCacheRenderPipeline._GetCompareFunction(this._stencilEnabled ? this._stencilFrontCompare : 7), depthFailOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilEnabled ? this._stencilFrontDepthFailOp : 1), failOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilEnabled ? this._stencilFrontFailOp : 1), passOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilEnabled ? this._stencilFrontPassOp : 1) };let stripIndexFormat;(topology === PrimitiveTopology.LineStrip || topology === PrimitiveTopology.TriangleStrip) && (stripIndexFormat = !this._indexBuffer || this._indexBuffer.is32Bits ? IndexFormat.Uint32 : IndexFormat.Uint16);const depthStencilFormatHasStencil = !!this._webgpuDepthStencilFormat && WebGPUTextureHelper.HasStencilAspect(this._webgpuDepthStencilFormat);return this._device.createRenderPipeline({ label: `RenderPipeline_${null !== (_b = null === (_a = colorStates[0]) || void 0 === _a ? void 0 : _a.format) && void 0 !== _b ? _b : "nooutput"}_${null !== (_c = this._webgpuDepthStencilFormat) && void 0 !== _c ? _c : "nodepth"}_samples${sampleCount}`, layout: pipelineLayout, vertex: { module: webgpuPipelineContext.stages.vertexStage.module, entryPoint: webgpuPipelineContext.stages.vertexStage.entryPoint, buffers: inputStateDescriptor }, primitive: { topology, stripIndexFormat, frontFace: 1 === this._frontFace ? FrontFace.CCW : FrontFace.CW, cullMode: this._cullEnabled ? 2 === this._cullFace ? CullMode.Front : CullMode.Back : CullMode.None }, fragment: webgpuPipelineContext.stages.fragmentStage ? { module: webgpuPipelineContext.stages.fragmentStage.module, entryPoint: webgpuPipelineContext.stages.fragmentStage.entryPoint, targets: colorStates } : void 0, multisample: { count: sampleCount }, depthStencil: this._webgpuDepthStencilFormat === void 0 ? void 0 : { depthWriteEnabled: this._depthWriteEnabled, depthCompare: this._depthTestEnabled ? WebGPUCacheRenderPipeline._GetCompareFunction(this._depthCompare) : CompareFunction.Always, format: this._webgpuDepthStencilFormat, stencilFront: this._stencilEnabled && depthStencilFormatHasStencil ? stencilFrontBack : void 0, stencilBack: this._stencilEnabled && depthStencilFormatHasStencil ? stencilFrontBack : void 0, stencilReadMask: this._stencilEnabled && depthStencilFormatHasStencil ? this._stencilReadMask : void 0, stencilWriteMask: this._stencilEnabled && depthStencilFormatHasStencil ? this._stencilWriteMask : void 0, depthBias: this._depthBias, depthBiasClamp: this._depthBiasClamp, depthBiasSlopeScale: this._depthBiasSlopeScale } });}}WebGPUCacheRenderPipeline.NumCacheHitWithoutHash = 0, WebGPUCacheRenderPipeline.NumCacheHitWithHash = 0, WebGPUCacheRenderPipeline.NumCacheMiss = 0, WebGPUCacheRenderPipeline.NumPipelineCreationLastFrame = 0, WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame = 0;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheRenderPipelineTree.js
class NodeState {constructor() {this.values = {};}count() {let countNode = 0,countPipeline = this.pipeline ? 1 : 0;for (const value in this.values) {const node = this.values[value],[childCountNodes, childCoundPipeline] = node.count();countNode += childCountNodes, countPipeline += childCoundPipeline, countNode++;}return [countNode, countPipeline];}}class WebGPUCacheRenderPipelineTree extends WebGPUCacheRenderPipeline {static GetNodeCounts() {const counts = WebGPUCacheRenderPipelineTree._Cache.count();return { nodeCount: counts[0], pipelineCount: counts[1] };}static _GetPipelines(node, pipelines, curPath, curPathLen) {if (node.pipeline) {const path = curPath.slice();path.length = curPathLen, pipelines.push(path);}for (const value in node.values) {const nnode = node.values[value];curPath[curPathLen] = parseInt(value), WebGPUCacheRenderPipelineTree._GetPipelines(nnode, pipelines, curPath, curPathLen + 1);}}static GetPipelines() {const pipelines = [];return WebGPUCacheRenderPipelineTree._GetPipelines(WebGPUCacheRenderPipelineTree._Cache, pipelines, [], 0), pipelines;}constructor(device, emptyVertexBuffer, useTextureStage) {super(device, emptyVertexBuffer, useTextureStage), this._nodeStack = [], this._nodeStack[0] = WebGPUCacheRenderPipelineTree._Cache;}_getRenderPipeline(param) {let node = this._nodeStack[this._stateDirtyLowestIndex];for (let nn, i = this._stateDirtyLowestIndex; i < this._statesLength; ++i) nn = node.values[this._states[i]], nn || (nn = new NodeState(), node.values[this._states[i]] = nn), node = nn, this._nodeStack[i + 1] = node;param.token = node, param.pipeline = node.pipeline;}_setRenderPipeline(param) {param.token.pipeline = param.pipeline;}}WebGPUCacheRenderPipelineTree._Cache = new NodeState();
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/stencilStateComposer.js
var stencilStateComposer = __webpack_require__("./node_modules/@babylonjs/core/States/stencilStateComposer.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuStencilStateComposer.js
class WebGPUStencilStateComposer extends stencilStateComposer/* StencilStateComposer */.C {constructor(cache) {super(!1), this._cache = cache, this.reset();}get func() {return this._func;}set func(value) {this._func === value || (this._func = value, this._cache.setStencilCompare(value));}get funcMask() {return this._funcMask;}set funcMask(value) {this._funcMask === value || (this._funcMask = value, this._cache.setStencilReadMask(value));}get opStencilFail() {return this._opStencilFail;}set opStencilFail(value) {this._opStencilFail === value || (this._opStencilFail = value, this._cache.setStencilFailOp(value));}get opDepthFail() {return this._opDepthFail;}set opDepthFail(value) {this._opDepthFail === value || (this._opDepthFail = value, this._cache.setStencilDepthFailOp(value));}get opStencilDepthPass() {return this._opStencilDepthPass;}set opStencilDepthPass(value) {this._opStencilDepthPass === value || (this._opStencilDepthPass = value, this._cache.setStencilPassOp(value));}get mask() {return this._mask;}set mask(value) {this._mask === value || (this._mask = value, this._cache.setStencilWriteMask(value));}get enabled() {return this._enabled;}set enabled(value) {this._enabled === value || (this._enabled = value, this._cache.setStencilEnabled(value));}reset() {super.reset(), this._cache.resetStencilState();}apply() {var _a;const stencilMaterialEnabled = null === (_a = this.stencilMaterial) || void 0 === _a ? void 0 : _a.enabled;this.enabled = stencilMaterialEnabled ? this.stencilMaterial.enabled : this.stencilGlobal.enabled;this.enabled && (this.func = stencilMaterialEnabled ? this.stencilMaterial.func : this.stencilGlobal.func, this.funcRef = stencilMaterialEnabled ? this.stencilMaterial.funcRef : this.stencilGlobal.funcRef, this.funcMask = stencilMaterialEnabled ? this.stencilMaterial.funcMask : this.stencilGlobal.funcMask, this.opStencilFail = stencilMaterialEnabled ? this.stencilMaterial.opStencilFail : this.stencilGlobal.opStencilFail, this.opDepthFail = stencilMaterialEnabled ? this.stencilMaterial.opDepthFail : this.stencilGlobal.opDepthFail, this.opStencilDepthPass = stencilMaterialEnabled ? this.stencilMaterial.opStencilDepthPass : this.stencilGlobal.opStencilDepthPass, this.mask = stencilMaterialEnabled ? this.stencilMaterial.mask : this.stencilGlobal.mask);}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/depthCullingState.js
var depthCullingState = __webpack_require__("./node_modules/@babylonjs/core/States/depthCullingState.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuDepthCullingState.js
class WebGPUDepthCullingState extends depthCullingState/* DepthCullingState */.k {constructor(cache) {super(!1), this._cache = cache, this.reset();}get zOffset() {return this._zOffset;}set zOffset(value) {this._zOffset === value || (this._zOffset = value, this._isZOffsetDirty = !0, this._cache.setDepthBiasSlopeScale(value));}get zOffsetUnits() {return this._zOffsetUnits;}set zOffsetUnits(value) {this._zOffsetUnits === value || (this._zOffsetUnits = value, this._isZOffsetDirty = !0, this._cache.setDepthBias(value));}get cullFace() {return this._cullFace;}set cullFace(value) {this._cullFace === value || (this._cullFace = value, this._isCullFaceDirty = !0, this._cache.setCullFace(null !== value && void 0 !== value ? value : 1));}get cull() {return this._cull;}set cull(value) {this._cull === value || (this._cull = value, this._isCullDirty = !0, this._cache.setCullEnabled(!!value));}get depthFunc() {return this._depthFunc;}set depthFunc(value) {this._depthFunc === value || (this._depthFunc = value, this._isDepthFuncDirty = !0, this._cache.setDepthCompare(value));}get depthMask() {return this._depthMask;}set depthMask(value) {this._depthMask === value || (this._depthMask = value, this._isDepthMaskDirty = !0, this._cache.setDepthWriteEnabled(value));}get depthTest() {return this._depthTest;}set depthTest(value) {this._depthTest === value || (this._depthTest = value, this._isDepthTestDirty = !0, this._cache.setDepthTestEnabled(value));}get frontFace() {return this._frontFace;}set frontFace(value) {this._frontFace === value || (this._frontFace = value, this._isFrontFaceDirty = !0, this._cache.setFrontFace(null !== value && void 0 !== value ? value : 2));}reset() {super.reset(), this._cache.resetDepthCullingState();}apply() {}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/externalTexture.js
class ExternalTexture {static IsExternalTexture(texture) {return texture.underlyingResource !== void 0;}getClassName() {return "ExternalTexture";}get underlyingResource() {return this._video;}constructor(video) {this.useMipMaps = !1, this.type = 16, this._video = video, this.uniqueId = Textures_internalTexture/* InternalTexture._Counter */.l._Counter++;}isReady() {return this._video.readyState >= this._video.HAVE_CURRENT_DATA;}dispose() {}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuMaterialContext.js
class WebGPUMaterialContext {get forceBindGroupCreation() {return 0 < this._numExternalTextures;}get hasFloatTextures() {return 0 < this._numFloatTextures;}constructor() {this.uniqueId = WebGPUMaterialContext._Counter++, this.updateId = 0, this.reset();}reset() {this.samplers = {}, this.textures = {}, this.isDirty = !0, this._numFloatTextures = 0, this._numExternalTextures = 0;}setSampler(name, sampler) {let samplerCache = this.samplers[name],currentHashCode = -1;samplerCache ? currentHashCode = samplerCache.hashCode : this.samplers[name] = samplerCache = { sampler, hashCode: 0 }, samplerCache.sampler = sampler, samplerCache.hashCode = sampler ? WebGPUCacheSampler.GetSamplerHashCode(sampler) : 0;const isDirty = currentHashCode !== samplerCache.hashCode;isDirty && this.updateId++, this.isDirty || (this.isDirty = isDirty);}setTexture(name, texture) {var _a, _b, _c;let textureCache = this.textures[name],currentTextureId = -1;textureCache ? currentTextureId = null !== (_b = null === (_a = textureCache.texture) || void 0 === _a ? void 0 : _a.uniqueId) && void 0 !== _b ? _b : -1 : this.textures[name] = textureCache = { texture, isFloatTexture: !1, isExternalTexture: !1 }, textureCache.isExternalTexture && this._numExternalTextures--, textureCache.isFloatTexture && this._numFloatTextures--, texture ? (textureCache.isFloatTexture = 1 === texture.type, textureCache.isExternalTexture = ExternalTexture.IsExternalTexture(texture), textureCache.isFloatTexture && this._numFloatTextures++, textureCache.isExternalTexture && this._numExternalTextures++) : (textureCache.isFloatTexture = !1, textureCache.isExternalTexture = !1), textureCache.texture = texture;const isDirty = currentTextureId !== (null !== (_c = null === texture || void 0 === texture ? void 0 : texture.uniqueId) && void 0 !== _c ? _c : -1);isDirty && this.updateId++, this.isDirty || (this.isDirty = isDirty);}}WebGPUMaterialContext._Counter = 0;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuDrawContext.js
class WebGPUDrawContext {isDirty(materialContextUpdateId) {return this._isDirty || this._materialContextUpdateId !== materialContextUpdateId;}resetIsDirty(materialContextUpdateId) {this._isDirty = !1, this._materialContextUpdateId = materialContextUpdateId;}get useInstancing() {return this._useInstancing;}set useInstancing(use) {this._useInstancing === use || (use ? (this.indirectDrawBuffer = this._bufferManager.createRawBuffer(40, BufferUsage.CopyDst | BufferUsage.Indirect), this._indirectDrawData = new Uint32Array(5), this._indirectDrawData[3] = 0, this._indirectDrawData[4] = 0) : (this.indirectDrawBuffer && this._bufferManager.releaseBuffer(this.indirectDrawBuffer), this.indirectDrawBuffer = void 0, this._indirectDrawData = void 0), this._useInstancing = use, this._currentInstanceCount = -1);}constructor(bufferManager) {this._bufferManager = bufferManager, this.uniqueId = WebGPUDrawContext._Counter++, this._useInstancing = !1, this._currentInstanceCount = 0, this.reset();}reset() {this.buffers = {}, this._isDirty = !0, this._materialContextUpdateId = 0, this.fastBundle = void 0, this.bindGroups = void 0;}setBuffer(name, buffer) {var _a;this._isDirty || (this._isDirty = (null === buffer || void 0 === buffer ? void 0 : buffer.uniqueId) !== (null === (_a = this.buffers[name]) || void 0 === _a ? void 0 : _a.uniqueId)), this.buffers[name] = buffer;}setIndirectData(indexOrVertexCount, instanceCount, firstIndexOrVertex) {instanceCount !== this._currentInstanceCount && this.indirectDrawBuffer && this._indirectDrawData && (this._currentInstanceCount = instanceCount, this._indirectDrawData[0] = indexOrVertexCount, this._indirectDrawData[1] = instanceCount, this._indirectDrawData[2] = firstIndexOrVertex, this._bufferManager.setRawData(this.indirectDrawBuffer, 0, this._indirectDrawData, 0, 20));}dispose() {this.indirectDrawBuffer && (this._bufferManager.releaseBuffer(this.indirectDrawBuffer), this.indirectDrawBuffer = void 0, this._indirectDrawData = void 0), this.fastBundle = void 0, this.bindGroups = void 0, this.buffers = void 0;}}WebGPUDrawContext._Counter = 0;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheBindGroups.js
class WebGPUBindGroupCacheNode {constructor() {this.values = {};}}class WebGPUCacheBindGroups {static get Statistics() {return { totalCreated: WebGPUCacheBindGroups.NumBindGroupsCreatedTotal, lastFrameCreated: WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame, lookupLastFrame: WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame, noLookupLastFrame: WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame };}constructor(device, cacheSampler, engine) {this.disabled = !1, this._device = device, this._cacheSampler = cacheSampler, this._engine = engine;}endFrame() {WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame, WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame, WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame, WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0, WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0, WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0;}getBindGroups(webgpuPipelineContext, drawContext, materialContext) {var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;let bindGroups,node = WebGPUCacheBindGroups._Cache;const cacheIsDisabled = this.disabled || materialContext.forceBindGroupCreation;if (!cacheIsDisabled) {if (!drawContext.isDirty(materialContext.updateId) && !materialContext.isDirty) return WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame++, drawContext.bindGroups;for (const bufferName of webgpuPipelineContext.shaderProcessingContext.bufferNames) {const uboId = null !== (_b = null === (_a = drawContext.buffers[bufferName]) || void 0 === _a ? void 0 : _a.uniqueId) && void 0 !== _b ? _b : 0;let nextNode = node.values[uboId];nextNode || (nextNode = new WebGPUBindGroupCacheNode(), node.values[uboId] = nextNode), node = nextNode;}for (const samplerName of webgpuPipelineContext.shaderProcessingContext.samplerNames) {const samplerHashCode = null !== (_d = null === (_c = materialContext.samplers[samplerName]) || void 0 === _c ? void 0 : _c.hashCode) && void 0 !== _d ? _d : 0;let nextNode = node.values[samplerHashCode];nextNode || (nextNode = new WebGPUBindGroupCacheNode(), node.values[samplerHashCode] = nextNode), node = nextNode;}for (const textureName of webgpuPipelineContext.shaderProcessingContext.textureNames) {const textureId = null !== (_g = null === (_f = null === (_e = materialContext.textures[textureName]) || void 0 === _e ? void 0 : _e.texture) || void 0 === _f ? void 0 : _f.uniqueId) && void 0 !== _g ? _g : 0;let nextNode = node.values[textureId];nextNode || (nextNode = new WebGPUBindGroupCacheNode(), node.values[textureId] = nextNode), node = nextNode;}bindGroups = node.bindGroups;}if (drawContext.resetIsDirty(materialContext.updateId), materialContext.isDirty = !1, bindGroups) return drawContext.bindGroups = bindGroups, WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame++, bindGroups;bindGroups = [], drawContext.bindGroups = bindGroups, cacheIsDisabled || (node.bindGroups = bindGroups), WebGPUCacheBindGroups.NumBindGroupsCreatedTotal++, WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame++;const bindGroupLayouts = webgpuPipelineContext.bindGroupLayouts;for (let i = 0; i < webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries.length; i++) {const setDefinition = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries[i],entries = webgpuPipelineContext.shaderProcessingContext.bindGroupEntries[i];for (let j = 0; j < setDefinition.length; j++) {const entry = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries[i][j],entryInfo = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding],name = null !== (_h = entryInfo.nameInArrayOfTexture) && void 0 !== _h ? _h : entryInfo.name;if (entry.sampler) {const bindingInfo = materialContext.samplers[name];if (bindingInfo) {const sampler = bindingInfo.sampler;if (!sampler) {this._engine.dbgSanityChecks && logger/* Logger.Error */.Y.Error(`Trying to bind a null sampler! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => "texture" === key ? "<no dump>" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);continue;}entries[j].resource = this._cacheSampler.getSampler(sampler, !1, bindingInfo.hashCode);} else logger/* Logger.Error */.Y.Error(`Sampler "${name}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => "texture" === key || "sampler" === key ? "<no dump>" : value)}`, 50);} else if (entry.texture || entry.storageTexture) {const bindingInfo = materialContext.textures[name];if (bindingInfo) {if (this._engine.dbgSanityChecks && null === bindingInfo.texture) {logger/* Logger.Error */.Y.Error(`Trying to bind a null texture! entry=${JSON.stringify(entry)}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => "texture" === key ? "<no dump>" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);continue;}const hardwareTexture = bindingInfo.texture._hardwareTexture;if (this._engine.dbgSanityChecks && (!hardwareTexture || entry.texture && !hardwareTexture.view || entry.storageTexture && !hardwareTexture.viewForWriting)) {logger/* Logger.Error */.Y.Error(`Trying to bind a null gpu texture or view! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => "texture" === key ? "<no dump>" : value)}, isReady=${null === (_j = bindingInfo.texture) || void 0 === _j ? void 0 : _j.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);continue;}entries[j].resource = entry.storageTexture ? hardwareTexture.viewForWriting : hardwareTexture.view;} else logger/* Logger.Error */.Y.Error(`Texture "${name}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => "texture" === key || "sampler" === key ? "<no dump>" : value)}`, 50);} else if (entry.externalTexture) {const bindingInfo = materialContext.textures[name];if (bindingInfo) {if (this._engine.dbgSanityChecks && null === bindingInfo.texture) {logger/* Logger.Error */.Y.Error(`Trying to bind a null external texture! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => "texture" === key ? "<no dump>" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);continue;}const externalTexture = bindingInfo.texture.underlyingResource;if (this._engine.dbgSanityChecks && !externalTexture) {logger/* Logger.Error */.Y.Error(`Trying to bind a null gpu external texture! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => "texture" === key ? "<no dump>" : value)}, isReady=${null === (_k = bindingInfo.texture) || void 0 === _k ? void 0 : _k.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);continue;}entries[j].resource = this._device.importExternalTexture({ source: externalTexture });} else logger/* Logger.Error */.Y.Error(`Texture "${name}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => "texture" === key || "sampler" === key ? "<no dump>" : value)}`, 50);} else if (entry.buffer) {const dataBuffer = drawContext.buffers[name];if (dataBuffer) {const webgpuBuffer = dataBuffer.underlyingResource;entries[j].resource.buffer = webgpuBuffer, entries[j].resource.size = dataBuffer.capacity;} else logger/* Logger.Error */.Y.Error(`Can't find buffer "${name}". entry=${JSON.stringify(entry)}, buffers=${JSON.stringify(drawContext.buffers)}, drawContext.uniqueId=${drawContext.uniqueId}`, 50);}}const groupLayout = bindGroupLayouts[i];bindGroups[i] = this._device.createBindGroup({ layout: groupLayout, entries });}return bindGroups;}}WebGPUCacheBindGroups.NumBindGroupsCreatedTotal = 0, WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = 0, WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = 0, WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = 0, WebGPUCacheBindGroups._Cache = new WebGPUBindGroupCacheNode(), WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0, WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0, WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/clearQuad.vertex.js
const clearQuad_vertex_name = "clearQuadVertexShader",clearQuad_vertex_shader = `uniform float depthValue;
const vec2 pos[4]={
vec2(-1.0,1.0),
vec2(1.0,1.0),
vec2(-1.0,-1.0),
vec2(1.0,-1.0)
};
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
gl_Position=vec4(pos[gl_VertexID],depthValue,1.0);
#define CUSTOM_VERTEX_MAIN_END
}
`;shaderStore/* ShaderStore.ShadersStore.clearQuadVertexShader */.v.ShadersStore.clearQuadVertexShader = clearQuad_vertex_shader;const clearQuadVertexShader = { name: "clearQuadVertexShader", shader: clearQuad_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/clearQuad.fragment.js
const clearQuad_fragment_name = "clearQuadPixelShader",clearQuad_fragment_shader = `uniform vec4 color;
void main() {
gl_FragColor=color;
}
`;shaderStore/* ShaderStore.ShadersStore.clearQuadPixelShader */.v.ShadersStore.clearQuadPixelShader = clearQuad_fragment_shader;const clearQuadPixelShader = { name: "clearQuadPixelShader", shader: clearQuad_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuClearQuad.js
class WebGPUClearQuad {setDepthStencilFormat(format) {this._depthTextureFormat = format, this._cacheRenderPipeline.setDepthStencilFormat(format);}setColorFormat(format) {this._cacheRenderPipeline.setColorFormat(format);}setMRTAttachments(attachments, textureArray, textureCount) {this._cacheRenderPipeline.setMRT(textureArray, textureCount), this._cacheRenderPipeline.setMRTAttachments(attachments);}constructor(device, engine, emptyVertexBuffer) {this._bindGroups = {}, this._bundleCache = {}, this._keyTemp = [], this._device = device, this._engine = engine, this._cacheRenderPipeline = new WebGPUCacheRenderPipelineTree(this._device, emptyVertexBuffer, !engine._caps.textureFloatLinearFiltering), this._cacheRenderPipeline.setDepthTestEnabled(!1), this._cacheRenderPipeline.setStencilReadMask(255), this._effect = engine.createEffect("clearQuad", [], ["color", "depthValue"]);}clear(renderPass, clearColor, clearDepth, clearStencil, sampleCount = 1) {var _a, _b;let renderPass2,bundleKey,bundle = null;const isRTTPass = !!this._engine._currentRenderTarget;if (renderPass) renderPass2 = renderPass;else {let idx = 0;this._keyTemp.length = 0;for (let i = 0; i < this._cacheRenderPipeline.colorFormats.length; ++i) this._keyTemp[idx++] = renderableTextureFormatToIndex[null !== (_a = this._cacheRenderPipeline.colorFormats[i]) && void 0 !== _a ? _a : ""];const depthStencilFormatIndex = renderableTextureFormatToIndex[null !== (_b = this._depthTextureFormat) && void 0 !== _b ? _b : 0];if (this._keyTemp[idx] = (clearColor ? clearColor.r + 256 * clearColor.g + 256 * (256 * clearColor.b) + 256 * (256 * (256 * clearColor.a)) : 0) + (clearDepth ? 4294967296 : 0) + (clearStencil ? 8589934592 : 0) + (this._engine.useReverseDepthBuffer ? 17179869184 : 0) + (isRTTPass ? 34359738368 : 0) + (1 < sampleCount ? 68719476736 : 0) + 137438953472 * depthStencilFormatIndex, bundleKey = this._keyTemp.join("_"), bundle = this._bundleCache[bundleKey], bundle) return bundle;renderPass2 = this._device.createRenderBundleEncoder({ colorFormats: this._cacheRenderPipeline.colorFormats, depthStencilFormat: this._depthTextureFormat, sampleCount });}this._cacheRenderPipeline.setDepthWriteEnabled(!!clearDepth), this._cacheRenderPipeline.setStencilEnabled(!!clearStencil && !!this._depthTextureFormat && WebGPUTextureHelper.HasStencilAspect(this._depthTextureFormat)), this._cacheRenderPipeline.setStencilWriteMask(clearStencil ? 255 : 0), this._cacheRenderPipeline.setStencilCompare(clearStencil ? 519 : 512), this._cacheRenderPipeline.setStencilPassOp(clearStencil ? 7681 : 7680), this._cacheRenderPipeline.setWriteMask(clearColor ? 15 : 0);const pipeline = this._cacheRenderPipeline.getRenderPipeline(7, this._effect, sampleCount),webgpuPipelineContext = this._effect._pipelineContext;clearColor && this._effect.setDirectColor4("color", clearColor), this._effect.setFloat("depthValue", this._engine.useReverseDepthBuffer ? this._engine._clearReverseDepthValue : this._engine._clearDepthValue), webgpuPipelineContext.uniformBuffer.update();const bufferInternals = isRTTPass ? this._engine._ubInvertY : this._engine._ubDontInvertY,bufferLeftOver = webgpuPipelineContext.uniformBuffer.getBuffer(),key = bufferLeftOver.uniqueId + "-" + bufferInternals.uniqueId;let bindGroups = this._bindGroups[key];if (!bindGroups) {const bindGroupLayouts = webgpuPipelineContext.bindGroupLayouts;bindGroups = this._bindGroups[key] = [], bindGroups.push(this._device.createBindGroup({ layout: bindGroupLayouts[0], entries: [] })), WebGPUShaderProcessingContext._SimplifiedKnownBindings || bindGroups.push(this._device.createBindGroup({ layout: bindGroupLayouts[1], entries: [] })), bindGroups.push(this._device.createBindGroup({ layout: bindGroupLayouts[WebGPUShaderProcessingContext._SimplifiedKnownBindings ? 1 : 2], entries: [{ binding: 0, resource: { buffer: bufferInternals.underlyingResource, size: bufferInternals.capacity } }, { binding: 1, resource: { buffer: bufferLeftOver.underlyingResource, size: bufferLeftOver.capacity } }] }));}renderPass2.setPipeline(pipeline);for (let i = 0; i < bindGroups.length; ++i) renderPass2.setBindGroup(i, bindGroups[i]);return renderPass2.draw(4, 1, 0, 0), renderPass || (bundle = renderPass2.finish(), this._bundleCache[bundleKey] = bundle), bundle;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuBundleList.js
class WebGPURenderItemViewport {constructor(x, y, w, h) {this.x = Math.floor(x), this.y = Math.floor(y), this.w = Math.floor(w), this.h = Math.floor(h);}run(renderPass) {renderPass.setViewport(this.x, this.y, this.w, this.h, 0, 1);}clone() {return new WebGPURenderItemViewport(this.x, this.y, this.w, this.h);}}class WebGPURenderItemScissor {constructor(x, y, w, h) {this.x = x, this.y = y, this.w = w, this.h = h;}run(renderPass) {renderPass.setScissorRect(this.x, this.y, this.w, this.h);}clone() {return new WebGPURenderItemScissor(this.x, this.y, this.w, this.h);}}class WebGPURenderItemStencilRef {constructor(ref) {this.ref = ref;}run(renderPass) {renderPass.setStencilReference(this.ref);}clone() {return new WebGPURenderItemStencilRef(this.ref);}}class WebGPURenderItemBlendColor {constructor(color) {this.color = color;}run(renderPass) {renderPass.setBlendConstant(this.color);}clone() {return new WebGPURenderItemBlendColor(this.color);}}class WebGPURenderItemBeginOcclusionQuery {constructor(query) {this.query = query;}run(renderPass) {renderPass.beginOcclusionQuery(this.query);}clone() {return new WebGPURenderItemBeginOcclusionQuery(this.query);}}class WebGPURenderItemEndOcclusionQuery {constructor() {}run(renderPass) {renderPass.endOcclusionQuery();}clone() {return new WebGPURenderItemEndOcclusionQuery();}}class WebGPURenderItemBundles {constructor() {this.bundles = [];}run(renderPass) {renderPass.executeBundles(this.bundles);}clone() {const cloned = new WebGPURenderItemBundles();return cloned.bundles = this.bundles, cloned;}}class WebGPUBundleList {constructor(device) {this.numDrawCalls = 0, this._device = device, this._list = Array(10), this._listLength = 0;}addBundle(bundle) {if (!this._currentItemIsBundle) {const item = new WebGPURenderItemBundles();this._list[this._listLength++] = item, this._currentBundleList = item.bundles, this._currentItemIsBundle = !0;}bundle && this._currentBundleList.push(bundle);}_finishBundle() {this._currentItemIsBundle && this._bundleEncoder && (this._currentBundleList.push(this._bundleEncoder.finish()), this._bundleEncoder = void 0, this._currentItemIsBundle = !1);}addItem(item) {this._finishBundle(), this._list[this._listLength++] = item, this._currentItemIsBundle = !1;}getBundleEncoder(colorFormats, depthStencilFormat, sampleCount) {return this._currentItemIsBundle || (this.addBundle(), this._bundleEncoder = this._device.createRenderBundleEncoder({ colorFormats, depthStencilFormat, sampleCount })), this._bundleEncoder;}close() {this._finishBundle();}run(renderPass) {this.close();for (let i = 0; i < this._listLength; ++i) this._list[i].run(renderPass);}reset() {this._listLength = 0, this._currentItemIsBundle = !1, this.numDrawCalls = 0;}clone() {this.close();const cloned = new WebGPUBundleList(this._device);cloned._list = Array(this._listLength), cloned._listLength = this._listLength, cloned.numDrawCalls = this.numDrawCalls;for (let i = 0; i < this._listLength; ++i) cloned._list[i] = this._list[i].clone();return cloned;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuQuerySet.js
class WebGPUQuerySet {get querySet() {return this._querySet;}constructor(count, type, device, bufferManager, canUseMultipleBuffers = !0) {this._dstBuffers = [], this._device = device, this._bufferManager = bufferManager, this._count = count, this._canUseMultipleBuffers = canUseMultipleBuffers, this._querySet = device.createQuerySet({ type, count }), this._queryBuffer = bufferManager.createRawBuffer(8 * count, BufferUsage.QueryResolve | BufferUsage.CopySrc), canUseMultipleBuffers || this._dstBuffers.push(this._bufferManager.createRawBuffer(8 * this._count, BufferUsage.MapRead | BufferUsage.CopyDst));}_getBuffer(firstQuery, queryCount) {if (!this._canUseMultipleBuffers && 0 === this._dstBuffers.length) return null;const encoderResult = this._device.createCommandEncoder();let buffer;return 0 === this._dstBuffers.length ? buffer = this._bufferManager.createRawBuffer(8 * this._count, BufferUsage.MapRead | BufferUsage.CopyDst) : (buffer = this._dstBuffers[this._dstBuffers.length - 1], this._dstBuffers.length--), encoderResult.resolveQuerySet(this._querySet, firstQuery, queryCount, this._queryBuffer, 0), encoderResult.copyBufferToBuffer(this._queryBuffer, 0, buffer, 0, 8 * queryCount), this._device.queue.submit([encoderResult.finish()]), buffer;}async readValues(firstQuery = 0, queryCount = 1) {const buffer = this._getBuffer(firstQuery, queryCount);if (null === buffer) return null;await buffer.mapAsync(MapMode.Read);const arrayBuf = new BigUint64Array(buffer.getMappedRange()).slice();return buffer.unmap(), this._dstBuffers[this._dstBuffers.length] = buffer, arrayBuf;}async readValue(firstQuery = 0) {const buffer = this._getBuffer(firstQuery, 1);if (null === buffer) return null;await buffer.mapAsync(MapMode.Read);const arrayBuf = new BigUint64Array(buffer.getMappedRange()),value = +arrayBuf[0];return buffer.unmap(), this._dstBuffers[this._dstBuffers.length] = buffer, value;}async readTwoValuesAndSubtract(firstQuery = 0) {const buffer = this._getBuffer(firstQuery, 2);if (null === buffer) return null;await buffer.mapAsync(MapMode.Read);const arrayBuf = new BigUint64Array(buffer.getMappedRange()),value = +(arrayBuf[1] - arrayBuf[0]);return buffer.unmap(), this._dstBuffers[this._dstBuffers.length] = buffer, value;}dispose() {this._querySet.destroy(), this._bufferManager.releaseBuffer(this._queryBuffer);for (let i = 0; i < this._dstBuffers.length; ++i) this._bufferManager.releaseBuffer(this._dstBuffers[i]);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuTimestampQuery.js
class WebGPUTimestampQuery {get gpuFrameTimeCounter() {return this._gpuFrameTimeCounter;}constructor(device, bufferManager) {this._enabled = !1, this._gpuFrameTimeCounter = new perfCounter/* PerfCounter */.z(), this._measureDurationState = 0, this._device = device, this._bufferManager = bufferManager;}get enable() {return this._enabled;}set enable(value) {this._enabled === value || (this._enabled = value, this._measureDurationState = 0, value ? this._measureDuration = new WebGPUDurationMeasure(this._device, this._bufferManager) : this._measureDuration.dispose());}startFrame(commandEncoder) {this._enabled && 0 === this._measureDurationState && (this._measureDuration.start(commandEncoder), this._measureDurationState = 1);}endFrame(commandEncoder) {1 === this._measureDurationState && (this._measureDurationState = 2, this._measureDuration.stop(commandEncoder).then((duration) => {null !== duration && 0 <= duration && (this._gpuFrameTimeCounter.fetchNewFrame(), this._gpuFrameTimeCounter.addCount(duration, !0)), this._measureDurationState = 0;}));}}class WebGPUDurationMeasure {constructor(device, bufferManager) {this._querySet = new WebGPUQuerySet(2, QueryType.Timestamp, device, bufferManager);}start(encoder) {encoder.writeTimestamp(this._querySet.querySet, 0);}async stop(encoder) {return encoder.writeTimestamp(this._querySet.querySet, 1), this._querySet.readTwoValuesAndSubtract(0);}dispose() {this._querySet.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuOcclusionQuery.js
class WebGPUOcclusionQuery {get querySet() {return this._querySet.querySet;}get hasQueries() {return this._currentTotalIndices !== this._availableIndices.length;}get canBeginQuery() {const passIndex = this._engine._getCurrentRenderPassIndex();return 0 === passIndex ? void 0 !== this._engine._mainRenderPassWrapper.renderPassDescriptor.occlusionQuerySet : !(1 !== passIndex) && void 0 !== this._engine._rttRenderPassWrapper.renderPassDescriptor.occlusionQuerySet;}constructor(engine, device, bufferManager, startCount = 50, incrementCount = 100) {this._availableIndices = [], this._engine = engine, this._device = device, this._bufferManager = bufferManager, this._frameLastBuffer = -1, this._currentTotalIndices = 0, this._countIncrement = incrementCount, this._allocateNewIndices(startCount);}createQuery() {0 === this._availableIndices.length && this._allocateNewIndices();const index = this._availableIndices[this._availableIndices.length - 1];return this._availableIndices.length--, index;}deleteQuery(index) {this._availableIndices[this._availableIndices.length - 1] = index;}isQueryResultAvailable(index) {return this._retrieveQueryBuffer(), !!this._lastBuffer && index < this._lastBuffer.length;}getQueryResult(index) {var _a, _b;return +(null !== (_b = null === (_a = this._lastBuffer) || void 0 === _a ? void 0 : _a[index]) && void 0 !== _b ? _b : -1);}_retrieveQueryBuffer() {this._lastBuffer && this._frameLastBuffer === this._engine.frameId || this._frameLastBuffer !== this._engine.frameId && (this._frameLastBuffer = this._engine.frameId, this._querySet.readValues(0, this._currentTotalIndices).then((arrayBuffer) => {this._lastBuffer = arrayBuffer;}));}_allocateNewIndices(numIndices) {numIndices = null !== numIndices && void 0 !== numIndices ? numIndices : this._countIncrement, this._delayQuerySetDispose();for (let i = 0; i < numIndices; ++i) this._availableIndices.push(this._currentTotalIndices + i);this._currentTotalIndices += numIndices, this._querySet = new WebGPUQuerySet(this._currentTotalIndices, QueryType.Occlusion, this._device, this._bufferManager, !1);}_delayQuerySetDispose() {const querySet = this._querySet;querySet && setTimeout(() => querySet.dispose, 1e3);}dispose() {var _a;null === (_a = this._querySet) || void 0 === _a ? void 0 : _a.dispose(), this._availableIndices.length = 0;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuTintWASM.js
class WebGPUTintWASM {constructor() {this._twgsl = null;}async initTwgsl(twgslOptions) {return (twgslOptions = twgslOptions || {}, twgslOptions = { ...WebGPUTintWASM._TWgslDefaultOptions, ...twgslOptions }, twgslOptions.twgsl) ? (this._twgsl = twgslOptions.twgsl, Promise.resolve()) : (twgslOptions.jsPath && twgslOptions.wasmPath && ((0,domManagement/* IsWindowObjectExist */.CG)() ? await tools/* Tools.LoadScriptAsync */.w1.LoadScriptAsync(twgslOptions.jsPath) : importScripts(twgslOptions.jsPath)), self.twgsl ? (this._twgsl = await self.twgsl(twgslOptions.wasmPath), Promise.resolve()) : Promise.reject("twgsl is not available."));}convertSpirV2WGSL(code) {const ccode = this._twgsl.convertSpirV2WGSL(code);return WebGPUTintWASM.ShowWGSLShaderCode && (console.log(ccode), console.log("***********************************************")), ccode;}}WebGPUTintWASM._TWgslDefaultOptions = { jsPath: "https://preview.babylonjs.com/twgsl/twgsl.js", wasmPath: "https://preview.babylonjs.com/twgsl/twgsl.wasm" }, WebGPUTintWASM.ShowWGSLShaderCode = !1;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuSnapshotRendering.js
class WebGPUSnapshotRendering {constructor(engine, renderingMode, bundleList, bundleListRenderTarget) {this._record = !1, this._play = !1, this._mainPassBundleList = [], this._enabled = !1, this._engine = engine, this._mode = renderingMode, this._bundleList = bundleList, this._bundleListRenderTarget = bundleListRenderTarget;}get enabled() {return this._enabled;}get play() {return this._play;}get record() {return this._record;}set enabled(activate) {this._mainPassBundleList.length = 0, this._record = this._enabled = activate, this._play = !1, activate && (this._modeSaved = this._mode, this._mode = 0);}get mode() {return this._mode;}set mode(mode) {this._record ? this._modeSaved = mode : this._mode = mode;}endMainRenderPass() {this._record && this._mainPassBundleList.push(this._bundleList.clone());}endRenderTargetPass(currentRenderPass, gpuWrapper) {var _a, _b, _c, _d;if (this._play) null === (_b = null === (_a = gpuWrapper._bundleLists) || void 0 === _a ? void 0 : _a[gpuWrapper._currentLayer]) || void 0 === _b ? void 0 : _b.run(currentRenderPass), 1 === this._mode && this._engine._reportDrawCall(null === (_d = null === (_c = gpuWrapper._bundleLists) || void 0 === _c ? void 0 : _c[gpuWrapper._currentLayer]) || void 0 === _d ? void 0 : _d.numDrawCalls);else if (this._record) gpuWrapper._bundleLists || (gpuWrapper._bundleLists = []), gpuWrapper._bundleLists[gpuWrapper._currentLayer] = this._bundleListRenderTarget.clone(), gpuWrapper._bundleLists[gpuWrapper._currentLayer].run(currentRenderPass), this._bundleListRenderTarget.reset();else return !1;return !0;}endFrame(mainRenderPass) {if (this._record && (this._mainPassBundleList.push(this._bundleList.clone()), this._record = !1, this._play = !0, this._mode = this._modeSaved), null !== mainRenderPass && this._play) for (let i = 0; i < this._mainPassBundleList.length; ++i) this._mainPassBundleList[i].run(mainRenderPass), 1 === this._mode && this._engine._reportDrawCall(this._mainPassBundleList[i].numDrawCalls);}reset() {this.enabled = !1, this.enabled = !0;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/webgpuEngine.js
class WebGPUEngine extends engine/* Engine */.D {get snapshotRenderingMode() {return this._snapshotRendering.mode;}set snapshotRenderingMode(mode) {this._snapshotRendering.mode = mode;}snapshotRenderingReset() {this._snapshotRendering.reset();}get snapshotRendering() {return this._snapshotRendering.enabled;}set snapshotRendering(activate) {this._snapshotRendering.enabled = activate;}get disableCacheSamplers() {return !!this._cacheSampler && this._cacheSampler.disabled;}set disableCacheSamplers(disable) {this._cacheSampler && (this._cacheSampler.disabled = disable);}get disableCacheRenderPipelines() {return !!this._cacheRenderPipeline && this._cacheRenderPipeline.disabled;}set disableCacheRenderPipelines(disable) {this._cacheRenderPipeline && (this._cacheRenderPipeline.disabled = disable);}get disableCacheBindGroups() {return !!this._cacheBindGroups && this._cacheBindGroups.disabled;}set disableCacheBindGroups(disable) {this._cacheBindGroups && (this._cacheBindGroups.disabled = disable);}static get IsSupportedAsync() {return navigator.gpu ? navigator.gpu.requestAdapter().then((adapter) => !!adapter, () => !1).catch(() => !1) : Promise.resolve(!1);}static get IsSupported() {return logger/* Logger.Warn */.Y.Warn("You must call IsSupportedAsync for WebGPU!"), !1;}get supportsUniformBuffers() {return !0;}get supportedExtensions() {return this._adapterSupportedExtensions;}get enabledExtensions() {return this._deviceEnabledExtensions;}get description() {const description = this.name + this.version;return description;}get version() {return 1;}getInfo() {return { vendor: "unknown vendor", renderer: "unknown renderer", version: "unknown version" };}get compatibilityMode() {return this._compatibilityMode;}set compatibilityMode(mode) {this._compatibilityMode = mode;}get currentSampleCount() {return this._currentRenderTarget ? this._currentRenderTarget.samples : this._mainPassSampleCount;}static CreateAsync(canvas, options = {}) {const engine = new WebGPUEngine(canvas, options);return new Promise((resolve) => {engine.initAsync(options.glslangOptions, options.twgslOptions).then(() => resolve(engine));});}constructor(canvas, options = {}) {var _a, _b, _c, _d;if (super(null), this._uploadEncoderDescriptor = { label: "upload" }, this._renderEncoderDescriptor = { label: "render" }, this._renderTargetEncoderDescriptor = { label: "renderTarget" }, this._clearDepthValue = 1, this._clearReverseDepthValue = 0, this._clearStencilValue = 0, this._defaultSampleCount = 4, this._glslang = null, this._tintWASM = null, this._compiledComputeEffects = {}, this._counters = { numEnableEffects: 0, numEnableDrawWrapper: 0, numBundleCreationNonCompatMode: 0, numBundleReuseNonCompatMode: 0 }, this.countersLastFrame = { numEnableEffects: 0, numEnableDrawWrapper: 0, numBundleCreationNonCompatMode: 0, numBundleReuseNonCompatMode: 0 }, this.numMaxUncapturedErrors = 20, this._commandBuffers = [null, null, null], this._currentRenderPass = null, this._mainRenderPassWrapper = new WebGPURenderPassWrapper(), this._rttRenderPassWrapper = new WebGPURenderPassWrapper(), this._pendingDebugCommands = [], this._onAfterUnbindFrameBufferObservable = new observable/* Observable */.y$(), this._currentOverrideVertexBuffers = null, this._currentIndexBuffer = null, this._colorWriteLocal = !0, this._forceEnableEffect = !1, this.dbgShowShaderCode = !1, this.dbgSanityChecks = !0, this.dbgVerboseLogsForFirstFrames = !1, this.dbgVerboseLogsNumFrames = 10, this.dbgLogIfNotDrawWrapper = !0, this.dbgShowEmptyEnableEffectCalls = !0, this._viewportsCurrent = [{ x: 0, y: 0, w: 0, h: 0 }, { x: 0, y: 0, w: 0, h: 0 }], this._scissorsCurrent = [{ x: 0, y: 0, w: 0, h: 0 }, { x: 0, y: 0, w: 0, h: 0 }], this._scissorCached = { x: 0, y: 0, z: 0, w: 0 }, this._stencilRefsCurrent = [-1, -1], this._blendColorsCurrent = [[null, null, null, null], [null, null, null, null]], this._name = "WebGPU", this.isNDCHalfZRange = !0, this.hasOriginBottomLeft = !1, options.deviceDescriptor = options.deviceDescriptor || {}, options.antialiasing = void 0 === options.antialiasing || options.antialiasing, options.stencil = null === (_a = options.stencil) || void 0 === _a || _a, options.enableGPUDebugMarkers = null !== (_b = options.enableGPUDebugMarkers) && void 0 !== _b && _b, performanceConfigurator/* PerformanceConfigurator.SetMatrixPrecision */.Z.SetMatrixPrecision(!!options.useHighPrecisionMatrix), logger/* Logger.Log */.Y.Log(`Babylon.js v${engine/* Engine.Version */.D.Version} - ${this.description} engine`), !navigator.gpu) return void logger/* Logger.Error */.Y.Error("WebGPU is not supported by your browser.");options.swapChainFormat = options.swapChainFormat || navigator.gpu.getPreferredCanvasFormat(), this._isWebGPU = !0, this._shaderPlatformName = "WEBGPU", void 0 === options.deterministicLockstep && (options.deterministicLockstep = !1), void 0 === options.lockstepMaxSteps && (options.lockstepMaxSteps = 4), void 0 === options.audioEngine && (options.audioEngine = !0), this._deterministicLockstep = options.deterministicLockstep, this._lockstepMaxSteps = options.lockstepMaxSteps, this._timeStep = options.timeStep || 1 / 60, this._doNotHandleContextLost = !!options.doNotHandleContextLost, this._canvas = canvas, this._options = options, this.premultipliedAlpha = null === (_c = options.premultipliedAlpha) || void 0 === _c || _c;const devicePixelRatio = (0,domManagement/* IsWindowObjectExist */.CG)() ? window.devicePixelRatio || 1 : 1,limitDeviceRatio = options.limitDeviceRatio || devicePixelRatio,adaptToDeviceRatio = null !== (_d = options.adaptToDeviceRatio) && void 0 !== _d && _d;this._hardwareScalingLevel = adaptToDeviceRatio ? 1 / Math.min(limitDeviceRatio, devicePixelRatio) : 1, this._mainPassSampleCount = options.antialiasing ? this._defaultSampleCount : 1, this._isStencilEnable = options.stencil, this._sharedInit(canvas, !!options.doNotHandleTouchAction, options.audioEngine), this._shaderProcessor = new WebGPUShaderProcessorGLSL(), this._shaderProcessorWGSL = new WebGPUShaderProcessorWGSL();}initAsync(glslangOptions, twgslOptions) {var _a;return this._initGlslang(null !== glslangOptions && void 0 !== glslangOptions ? glslangOptions : null === (_a = this._options) || void 0 === _a ? void 0 : _a.glslangOptions).then((glslang) => {var _a;return this._glslang = glslang, this._tintWASM = WebGPUEngine.UseTWGSL ? new WebGPUTintWASM() : null, this._tintWASM ? this._tintWASM.initTwgsl(null !== twgslOptions && void 0 !== twgslOptions ? twgslOptions : null === (_a = this._options) || void 0 === _a ? void 0 : _a.twgslOptions).then(() => navigator.gpu.requestAdapter(this._options), (msg) => {throw logger/* Logger.Error */.Y.Error("Can not initialize twgsl!"), logger/* Logger.Error */.Y.Error(msg), Error("WebGPU initializations stopped.");}) : navigator.gpu.requestAdapter(this._options);}, (msg) => {throw logger/* Logger.Error */.Y.Error("Can not initialize glslang!"), logger/* Logger.Error */.Y.Error(msg), Error("WebGPU initializations stopped.");}).then((adapter) => {var _a;if (!adapter) throw "Could not retrieve a WebGPU adapter (adapter is null).";else {this._adapter = adapter, this._adapterSupportedExtensions = [], null === (_a = this._adapter.features) || void 0 === _a ? void 0 : _a.forEach((feature) => this._adapterSupportedExtensions.push(feature));const deviceDescriptor = this._options.deviceDescriptor;if (null === deviceDescriptor || void 0 === deviceDescriptor ? void 0 : deviceDescriptor.requiredFeatures) {const requestedExtensions = deviceDescriptor.requiredFeatures,validExtensions = [];for (const extension of requestedExtensions) -1 !== this._adapterSupportedExtensions.indexOf(extension) && validExtensions.push(extension);deviceDescriptor.requiredFeatures = validExtensions;}return this._adapter.requestDevice(this._options.deviceDescriptor);}}).then((device) => {var _a, _b;this._device = device, this._deviceEnabledExtensions = [], null === (_a = this._device.features) || void 0 === _a ? void 0 : _a.forEach((feature) => this._deviceEnabledExtensions.push(feature));let numUncapturedErrors = -1;this._device.addEventListener("uncapturederror", (event) => {++numUncapturedErrors < this.numMaxUncapturedErrors ? logger/* Logger.Warn */.Y.Warn(`WebGPU uncaptured error (${numUncapturedErrors + 1}): ${event.error} - ${event.error.message}`) : numUncapturedErrors++ === this.numMaxUncapturedErrors && logger/* Logger.Warn */.Y.Warn(`WebGPU uncaptured error: too many warnings (${this.numMaxUncapturedErrors}), no more warnings will be reported to the console for this engine.`);}), this._doNotHandleContextLost || (null === (_b = this._device.lost) || void 0 === _b ? void 0 : _b.then((info) => {this._contextWasLost = !0, logger/* Logger.Warn */.Y.Warn("WebGPU context lost. " + info), this.onContextLostObservable.notifyObservers(this), this._restoreEngineAfterContextLost(this.initAsync.bind(this));}));}, (e) => {logger/* Logger.Error */.Y.Error("Could not retrieve a WebGPU device."), logger/* Logger.Error */.Y.Error(e);}).then(() => {this._bufferManager = new WebGPUBufferManager(this._device), this._textureHelper = new WebGPUTextureHelper(this._device, this._glslang, this._tintWASM, this._bufferManager), this._cacheSampler = new WebGPUCacheSampler(this._device), this._cacheBindGroups = new WebGPUCacheBindGroups(this._device, this._cacheSampler, this), this._timestampQuery = new WebGPUTimestampQuery(this._device, this._bufferManager), this._occlusionQuery = this._device.createQuerySet ? new WebGPUOcclusionQuery(this, this._device, this._bufferManager) : void 0, this._bundleList = new WebGPUBundleList(this._device), this._bundleListRenderTarget = new WebGPUBundleList(this._device), this._snapshotRendering = new WebGPUSnapshotRendering(this, this._snapshotRenderingMode, this._bundleList, this._bundleListRenderTarget), this._ubInvertY = this._bufferManager.createBuffer(new Float32Array([-1, 0]), BufferUsage.Uniform | BufferUsage.CopyDst), this._ubDontInvertY = this._bufferManager.createBuffer(new Float32Array([1, 0]), BufferUsage.Uniform | BufferUsage.CopyDst), this.dbgVerboseLogsForFirstFrames && this._count === void 0 && (this._count = 0, console.log("%c frame #" + this._count + " - begin", "background: #ffff00")), this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor), this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor), this._renderTargetEncoder = this._device.createCommandEncoder(this._renderTargetEncoderDescriptor), this._emptyVertexBuffer = new Buffers_buffer/* VertexBuffer */.o(this, [0], "", !1, !1, 1, !1, 0, 1), this._initializeLimits(), this._cacheRenderPipeline = new WebGPUCacheRenderPipelineTree(this._device, this._emptyVertexBuffer, !this._caps.textureFloatLinearFiltering), this._depthCullingState = new WebGPUDepthCullingState(this._cacheRenderPipeline), this._stencilStateComposer = new WebGPUStencilStateComposer(this._cacheRenderPipeline), this._stencilStateComposer.stencilGlobal = this._stencilState, this._depthCullingState.depthTest = !0, this._depthCullingState.depthFunc = 515, this._depthCullingState.depthMask = !0, this._textureHelper.setCommandEncoder(this._uploadEncoder), this._clearQuad = new WebGPUClearQuad(this._device, this, this._emptyVertexBuffer), this._defaultDrawContext = this.createDrawContext(), this._currentDrawContext = this._defaultDrawContext, this._defaultMaterialContext = this.createMaterialContext(), this._currentMaterialContext = this._defaultMaterialContext, this._initializeContextAndSwapChain(), this._initializeMainAttachments(), this.resize();}).catch((e) => {logger/* Logger.Error */.Y.Error("Can not create WebGPU Device and/or context."), logger/* Logger.Error */.Y.Error(e), console.trace && console.trace();});}_initGlslang(glslangOptions) {return glslangOptions = glslangOptions || {}, glslangOptions = { ...WebGPUEngine._GLSLslangDefaultOptions, ...glslangOptions }, glslangOptions.glslang ? Promise.resolve(glslangOptions.glslang) : self.glslang ? self.glslang(glslangOptions.wasmPath) : glslangOptions.jsPath && glslangOptions.wasmPath ? (0,domManagement/* IsWindowObjectExist */.CG)() ? tools/* Tools.LoadScriptAsync */.w1.LoadScriptAsync(glslangOptions.jsPath).then(() => self.glslang(glslangOptions.wasmPath)) : (importScripts(glslangOptions.jsPath), self.glslang(glslangOptions.wasmPath)) : Promise.reject("gslang is not available.");}_initializeLimits() {this._caps = { maxTexturesImageUnits: 16, maxVertexTextureImageUnits: 16, maxCombinedTexturesImageUnits: 32, maxTextureSize: 8192, maxCubemapTextureSize: 2048, maxRenderTextureSize: 8192, maxVertexAttribs: 16, maxVaryingVectors: 15, maxFragmentUniformVectors: 1024, maxVertexUniformVectors: 1024, standardDerivatives: !0, astc: !!(0 <= this._deviceEnabledExtensions.indexOf(FeatureName.TextureCompressionASTC)) || void 0, s3tc: !!(0 <= this._deviceEnabledExtensions.indexOf(FeatureName.TextureCompressionBC)) || void 0, pvrtc: null, etc1: null, etc2: !!(0 <= this._deviceEnabledExtensions.indexOf(FeatureName.TextureCompressionETC2)) || void 0, bptc: !!(0 <= this._deviceEnabledExtensions.indexOf(FeatureName.TextureCompressionBC)) || void 0, maxAnisotropy: 4, uintIndices: !0, fragmentDepthSupported: !0, highPrecisionShaderSupported: !0, colorBufferFloat: !0, textureFloat: !0, textureFloatLinearFiltering: !1, textureFloatRender: !0, textureHalfFloat: !0, textureHalfFloatLinearFiltering: !0, textureHalfFloatRender: !0, textureLOD: !0, drawBuffersExtension: !0, depthTextureExtension: !0, vertexArrayObject: !1, instancedArrays: !0, timerQuery: !("undefined" == typeof BigUint64Array || -1 === this.enabledExtensions.indexOf(FeatureName.TimestampQuery)) || void 0, supportOcclusionQuery: "undefined" != typeof BigUint64Array, canUseTimestampForTimerQuery: !0, multiview: !1, oculusMultiview: !1, parallelShaderCompile: void 0, blendMinMax: !0, maxMSAASamples: 4, canUseGLInstanceID: !0, canUseGLVertexID: !0, supportComputeShaders: !0, supportSRGBBuffers: !0, supportTransformFeedbacks: !1, textureMaxLevel: !0, texture2DArrayMaxLayerCount: 2048 }, this._caps.parallelShaderCompile = null, this._features = { forceBitmapOverHTMLImageElement: !0, supportRenderAndCopyToLodForFloatTextures: !0, supportDepthStencilTexture: !0, supportShadowSamplers: !0, uniformBufferHardCheckMatrix: !1, allowTexturePrefiltering: !0, trackUbosInFrame: !0, checkUbosContentBeforeUpload: !0, supportCSM: !0, basisNeedsPOT: !1, support3DTextures: !0, needTypeSuffixInShaderConstants: !0, supportMSAA: !0, supportSSAO2: !0, supportExtendedTextureFormats: !0, supportSwitchCaseInShader: !0, supportSyncTextureRead: !1, needsInvertingBitmap: !1, useUBOBindingCache: !1, needShaderCodeInlining: !0, needToAlwaysBindUniformBuffers: !0, supportRenderPasses: !0, supportSpriteInstancing: !0, _collectUbosUpdatedInFrame: !1 };}_initializeContextAndSwapChain() {this._context = this._canvas.getContext("webgpu"), this._configureContext(), this._colorFormat = this._options.swapChainFormat, this._mainRenderPassWrapper.colorAttachmentGPUTextures = [new WebGPUHardwareTexture()], this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format = this._colorFormat;}_initializeMainAttachments() {if (!this._bufferManager) return;this.flushFramebuffer(!1), this._mainTextureExtends = { width: this.getRenderWidth(), height: this.getRenderHeight(), depthOrArrayLayers: 1 };const bufferDataUpdate = new Float32Array([this.getRenderHeight()]);this._bufferManager.setSubData(this._ubInvertY, 4, bufferDataUpdate), this._bufferManager.setSubData(this._ubDontInvertY, 4, bufferDataUpdate);let mainColorAttachments;if (this._options.antialiasing) {const mainTextureDescriptor = { label: "Texture_MainColor_antialiasing", size: this._mainTextureExtends, mipLevelCount: 1, sampleCount: this._mainPassSampleCount, dimension: TextureDimension.E2d, format: this._options.swapChainFormat, usage: TextureUsage.RenderAttachment };this._mainTexture && this._textureHelper.releaseTexture(this._mainTexture), this._mainTexture = this._device.createTexture(mainTextureDescriptor), mainColorAttachments = [{ view: this._mainTexture.createView(), clearValue: new math/* Color4 */.HE(0, 0, 0, 1), loadOp: LoadOp.Clear, storeOp: StoreOp.Store }];} else mainColorAttachments = [{ view: void 0, clearValue: new math/* Color4 */.HE(0, 0, 0, 1), loadOp: LoadOp.Clear, storeOp: StoreOp.Store }];this._mainRenderPassWrapper.depthTextureFormat = this.isStencilEnable ? TextureFormat.Depth24PlusStencil8 : TextureFormat.Depth32Float, this._setDepthTextureFormat(this._mainRenderPassWrapper);const depthTextureDescriptor = { label: "Texture_MainDepthStencil", size: this._mainTextureExtends, mipLevelCount: 1, sampleCount: this._mainPassSampleCount, dimension: TextureDimension.E2d, format: this._mainRenderPassWrapper.depthTextureFormat, usage: TextureUsage.RenderAttachment };this._depthTexture && this._textureHelper.releaseTexture(this._depthTexture), this._depthTexture = this._device.createTexture(depthTextureDescriptor);const mainDepthAttachment = { view: this._depthTexture.createView(), depthClearValue: this._clearDepthValue, depthLoadOp: LoadOp.Clear, depthStoreOp: StoreOp.Store, stencilClearValue: this._clearStencilValue, stencilLoadOp: this.isStencilEnable ? LoadOp.Clear : void 0, stencilStoreOp: this.isStencilEnable ? StoreOp.Store : void 0 };this._mainRenderPassWrapper.renderPassDescriptor = { colorAttachments: mainColorAttachments, depthStencilAttachment: mainDepthAttachment };}_configureContext() {this._context.configure({ device: this._device, format: this._options.swapChainFormat, usage: TextureUsage.RenderAttachment | TextureUsage.CopySrc, alphaMode: this.premultipliedAlpha ? CanvasAlphaMode.Premultiplied : CanvasAlphaMode.Opaque });}setSize(width, height, forceSetSize = !1) {return !!super.setSize(width, height, forceSetSize) && (this.dbgVerboseLogsForFirstFrames && (void 0 === this._count && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - setSize called -", width, height)), this._initializeMainAttachments(), this.snapshotRendering && this.snapshotRenderingReset(), !0);}_getShaderProcessor(shaderLanguage) {return shaderLanguage === Materials_shaderLanguage/* ShaderLanguage.WGSL */.x.WGSL ? this._shaderProcessorWGSL : this._shaderProcessor;}_getShaderProcessingContext(shaderLanguage) {return new WebGPUShaderProcessingContext(shaderLanguage);}applyStates() {this._stencilStateComposer.apply(), this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend);}wipeCaches(bruteForce) {this.preventCacheWipeBetweenFrames && !bruteForce || (this._forceEnableEffect = !0, this._currentIndexBuffer = null, this._currentOverrideVertexBuffers = null, this._cacheRenderPipeline.setBuffers(null, null, null), bruteForce && (this._stencilStateComposer.reset(), this._depthCullingState.reset(), this._depthCullingState.depthFunc = 515, this._alphaState.reset(), this._alphaMode = 1, this._alphaEquation = 0, this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters), this._cacheRenderPipeline.setAlphaBlendEnabled(!1), this.setColorWrite(!0)), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);}setColorWrite(enable) {this._colorWriteLocal = enable, this._cacheRenderPipeline.setWriteMask(enable ? 15 : 0);}getColorWrite() {return this._colorWriteLocal;}_resetCurrentViewport(index) {this._viewportsCurrent[index].x = 0, this._viewportsCurrent[index].y = 0, this._viewportsCurrent[index].w = 0, this._viewportsCurrent[index].h = 0, 1 === index && (this._viewportCached.x = 0, this._viewportCached.y = 0, this._viewportCached.z = 0, this._viewportCached.w = 0);}_mustUpdateViewport(renderPass) {const index = renderPass === this._mainRenderPassWrapper.renderPass ? 0 : 1,x = this._viewportCached.x,y = this._viewportCached.y,w = this._viewportCached.z,h = this._viewportCached.w,update = this._viewportsCurrent[index].x !== x || this._viewportsCurrent[index].y !== y || this._viewportsCurrent[index].w !== w || this._viewportsCurrent[index].h !== h;return update && (this._viewportsCurrent[index].x = this._viewportCached.x, this._viewportsCurrent[index].y = this._viewportCached.y, this._viewportsCurrent[index].w = this._viewportCached.z, this._viewportsCurrent[index].h = this._viewportCached.w), update;}_applyViewport(renderPass) {let y = Math.floor(this._viewportCached.y);const h = Math.floor(this._viewportCached.w);this._currentRenderTarget || (y = this.getRenderHeight() - y - h), renderPass.setViewport(Math.floor(this._viewportCached.x), y, Math.floor(this._viewportCached.z), h, 0, 1), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - viewport applied - (", this._viewportCached.x, this._viewportCached.y, this._viewportCached.z, this._viewportCached.w, ") current pass is main pass=" + (renderPass === this._mainRenderPassWrapper.renderPass)));}_viewport(x, y, width, height) {this._viewportCached.x = x, this._viewportCached.y = y, this._viewportCached.z = width, this._viewportCached.w = height;}_resetCurrentScissor(index) {this._scissorsCurrent[index].x = 0, this._scissorsCurrent[index].y = 0, this._scissorsCurrent[index].w = 0, this._scissorsCurrent[index].h = 0;}_mustUpdateScissor(renderPass) {const index = renderPass === this._mainRenderPassWrapper.renderPass ? 0 : 1,x = this._scissorCached.x,y = this._scissorCached.y,w = this._scissorCached.z,h = this._scissorCached.w,update = this._scissorsCurrent[index].x !== x || this._scissorsCurrent[index].y !== y || this._scissorsCurrent[index].w !== w || this._scissorsCurrent[index].h !== h;return update && (this._scissorsCurrent[index].x = this._scissorCached.x, this._scissorsCurrent[index].y = this._scissorCached.y, this._scissorsCurrent[index].w = this._scissorCached.z, this._scissorsCurrent[index].h = this._scissorCached.w), update;}_applyScissor(renderPass) {renderPass.setScissorRect(this._scissorCached.x, this._currentRenderTarget ? this._scissorCached.y : this.getRenderHeight() - this._scissorCached.w - this._scissorCached.y, this._scissorCached.z, this._scissorCached.w), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - scissor applied - (", this._scissorCached.x, this._scissorCached.y, this._scissorCached.z, this._scissorCached.w, ") current pass is main pass=" + (renderPass === this._mainRenderPassWrapper.renderPass)));}_scissorIsActive() {return 0 !== this._scissorCached.x || 0 !== this._scissorCached.y || 0 !== this._scissorCached.z || 0 !== this._scissorCached.w;}enableScissor(x, y, width, height) {this._scissorCached.x = x, this._scissorCached.y = y, this._scissorCached.z = width, this._scissorCached.w = height;}disableScissor() {this._scissorCached.x = 0, this._scissorCached.y = 0, this._scissorCached.z = 0, this._scissorCached.w = 0, this._resetCurrentScissor(0), this._resetCurrentScissor(1);}_resetCurrentStencilRef(index) {this._stencilRefsCurrent[index] = -1;}_mustUpdateStencilRef(renderPass) {const index = renderPass === this._mainRenderPassWrapper.renderPass ? 0 : 1,update = this._stencilStateComposer.funcRef !== this._stencilRefsCurrent[index];return update && (this._stencilRefsCurrent[index] = this._stencilStateComposer.funcRef), update;}_applyStencilRef(renderPass) {var _a;renderPass.setStencilReference(null !== (_a = this._stencilStateComposer.funcRef) && void 0 !== _a ? _a : 0);}_resetCurrentColorBlend(index) {this._blendColorsCurrent[index][0] = this._blendColorsCurrent[index][1] = this._blendColorsCurrent[index][2] = this._blendColorsCurrent[index][3] = null;}_mustUpdateBlendColor(renderPass) {const index = renderPass === this._mainRenderPassWrapper.renderPass ? 0 : 1,colorBlend = this._alphaState._blendConstants,update = colorBlend[0] !== this._blendColorsCurrent[index][0] || colorBlend[1] !== this._blendColorsCurrent[index][1] || colorBlend[2] !== this._blendColorsCurrent[index][2] || colorBlend[3] !== this._blendColorsCurrent[index][3];return update && (this._blendColorsCurrent[index][0] = colorBlend[0], this._blendColorsCurrent[index][1] = colorBlend[1], this._blendColorsCurrent[index][2] = colorBlend[2], this._blendColorsCurrent[index][3] = colorBlend[3]), update;}_applyBlendColor(renderPass) {renderPass.setBlendConstant(this._alphaState._blendConstants);}clear(color, backBuffer, depth, stencil = !1) {color && color.a === void 0 && (color.a = 1);const hasScissor = this._scissorIsActive();this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - clear called - backBuffer=", backBuffer, " depth=", depth, " stencil=", stencil, " scissor is active=", hasScissor)), this._currentRenderTarget ? hasScissor ? (!this._rttRenderPassWrapper.renderPass && this._startRenderTargetRenderPass(this._currentRenderTarget, !1, backBuffer ? color : null, depth, stencil), this.compatibilityMode ? this._applyScissor(this._currentRenderPass) : this._bundleListRenderTarget.addItem(new WebGPURenderItemScissor(this._scissorCached.x, this._scissorCached.y, this._scissorCached.z, this._scissorCached.w)), this._clearFullQuad(backBuffer ? color : null, depth, stencil)) : (this._currentRenderPass && this._endRenderTargetRenderPass(), this._startRenderTargetRenderPass(this._currentRenderTarget, !0, backBuffer ? color : null, depth, stencil)) : ((!this._mainRenderPassWrapper.renderPass || !hasScissor) && this._startMainRenderPass(!hasScissor, backBuffer ? color : null, depth, stencil), hasScissor && (this.compatibilityMode ? this._applyScissor(this._currentRenderPass) : this._bundleList.addItem(new WebGPURenderItemScissor(this._scissorCached.x, this._scissorCached.y, this._scissorCached.z, this._scissorCached.w)), this._clearFullQuad(backBuffer ? color : null, depth, stencil)));}_clearFullQuad(clearColor, clearDepth, clearStencil) {var _a, _b, _c;const renderPass = this.compatibilityMode ? this._getCurrentRenderPass() : null,renderPassIndex = this._getCurrentRenderPassIndex(),bundleList = 0 === renderPassIndex ? this._bundleList : this._bundleListRenderTarget;this._clearQuad.setColorFormat(this._colorFormat), this._clearQuad.setDepthStencilFormat(this._depthTextureFormat), this._clearQuad.setMRTAttachments(null !== (_a = this._cacheRenderPipeline.mrtAttachments) && void 0 !== _a ? _a : [], null !== (_b = this._cacheRenderPipeline.mrtTextureArray) && void 0 !== _b ? _b : [], this._cacheRenderPipeline.mrtTextureCount), this.compatibilityMode ? renderPass.setStencilReference(this._clearStencilValue) : bundleList.addItem(new WebGPURenderItemStencilRef(this._clearStencilValue));const bundle = this._clearQuad.clear(renderPass, clearColor, clearDepth, clearStencil, this.currentSampleCount);this.compatibilityMode ? this._applyStencilRef(renderPass) : (bundleList.addBundle(bundle), bundleList.addItem(new WebGPURenderItemStencilRef(null !== (_c = this._stencilStateComposer.funcRef) && void 0 !== _c ? _c : 0)), this._reportDrawCall());}createVertexBuffer(data) {let view = data instanceof Array ? new Float32Array(data) : data instanceof ArrayBuffer ? new Uint8Array(data) : data;const dataBuffer = this._bufferManager.createBuffer(view, BufferUsage.Vertex | BufferUsage.CopyDst);return dataBuffer;}createDynamicVertexBuffer(data) {return this.createVertexBuffer(data);}createIndexBuffer(indices) {let view,is32Bits = !0;indices instanceof Uint32Array || indices instanceof Int32Array ? view = indices : indices instanceof Uint16Array ? (view = indices, is32Bits = !1) : 65535 < indices.length ? view = new Uint32Array(indices) : (view = new Uint16Array(indices), is32Bits = !1);const dataBuffer = this._bufferManager.createBuffer(view, BufferUsage.Index | BufferUsage.CopyDst);return dataBuffer.is32Bits = is32Bits, dataBuffer;}_createBuffer(data, creationFlags) {let view = data instanceof Array ? new Float32Array(data) : data instanceof ArrayBuffer ? new Uint8Array(data) : data;let flags = 0;return 1 & creationFlags && (flags |= BufferUsage.CopySrc), 2 & creationFlags && (flags |= BufferUsage.CopyDst), 4 & creationFlags && (flags |= BufferUsage.Uniform), 8 & creationFlags && (flags |= BufferUsage.Vertex), 16 & creationFlags && (flags |= BufferUsage.Index), 32 & creationFlags && (flags |= BufferUsage.Storage), this._bufferManager.createBuffer(view, flags);}bindBuffersDirectly() {throw "Not implemented on WebGPU";}updateAndBindInstancesBuffer() {throw "Not implemented on WebGPU";}bindBuffers(vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {this._currentIndexBuffer = indexBuffer, this._currentOverrideVertexBuffers = null !== overrideVertexBuffers && void 0 !== overrideVertexBuffers ? overrideVertexBuffers : null, this._cacheRenderPipeline.setBuffers(vertexBuffers, indexBuffer, this._currentOverrideVertexBuffers);}_releaseBuffer(buffer) {return this._bufferManager.releaseBuffer(buffer);}createEffect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, defines, fallbacks, onCompiled, onError, indexParameters, shaderLanguage = Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL) {var _a;const vertex = baseName.vertexElement || baseName.vertex || baseName.vertexToken || baseName.vertexSource || baseName,fragment = baseName.fragmentElement || baseName.fragment || baseName.fragmentToken || baseName.fragmentSource || baseName,globalDefines = this._getGlobalDefines();let fullDefines = null !== (_a = null !== defines && void 0 !== defines ? defines : attributesNamesOrOptions.defines) && void 0 !== _a ? _a : "";globalDefines && (fullDefines += "\n" + globalDefines);const name = vertex + "+" + fragment + "@" + fullDefines;if (this._compiledEffects[name]) {const compiledEffect = this._compiledEffects[name];return onCompiled && compiledEffect.isReady() && onCompiled(compiledEffect), compiledEffect;}const effect = new Materials_effect/* Effect */.Q(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters, name, shaderLanguage);return this._compiledEffects[name] = effect, effect;}_compileRawShaderToSpirV(source, type) {return this._glslang.compileGLSL(source, type);}_compileShaderToSpirV(source, type, defines, shaderVersion) {return this._compileRawShaderToSpirV(shaderVersion + (defines ? defines + "\n" : "") + source, type);}_getWGSLShader(source, type, defines) {return defines = defines ? "//" + defines.split("\n").join("\n//") + "\n" : "", defines + source;}_createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage) {return this._tintWASM && shaderLanguage === Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL && (vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader), fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader)), { vertexStage: { module: this._device.createShaderModule({ code: vertexShader }), entryPoint: "main" }, fragmentStage: { module: this._device.createShaderModule({ code: fragmentShader }), entryPoint: "main" } };}_compileRawPipelineStageDescriptor(vertexCode, fragmentCode, shaderLanguage) {const vertexShader = shaderLanguage === Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL ? this._compileRawShaderToSpirV(vertexCode, "vertex") : vertexCode,fragmentShader = shaderLanguage === Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL ? this._compileRawShaderToSpirV(fragmentCode, "fragment") : fragmentCode;return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage);}_compilePipelineStageDescriptor(vertexCode, fragmentCode, defines, shaderLanguage) {this.onBeforeShaderCompilationObservable.notifyObservers(this);const vertexShader = shaderLanguage === Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL ? this._compileShaderToSpirV(vertexCode, "vertex", defines, "#version 450\n") : this._getWGSLShader(vertexCode, "vertex", defines),fragmentShader = shaderLanguage === Materials_shaderLanguage/* ShaderLanguage.GLSL */.x.GLSL ? this._compileShaderToSpirV(fragmentCode, "fragment", defines, "#version 450\n") : this._getWGSLShader(fragmentCode, "fragment", defines),program = this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage);return this.onAfterShaderCompilationObservable.notifyObservers(this), program;}createRawShaderProgram() {throw "Not available on WebGPU";}createShaderProgram() {throw "Not available on WebGPU";}inlineShaderCode(code) {const sci = new ShaderCodeInliner(code);return sci.debug = !1, sci.processCode(), sci.code;}createPipelineContext(shaderProcessingContext) {return new WebGPUPipelineContext(shaderProcessingContext, this);}createMaterialContext() {return new WebGPUMaterialContext();}createDrawContext() {return new WebGPUDrawContext(this._bufferManager);}_preparePipelineContext(pipelineContext, vertexSourceCode, fragmentSourceCode, createAsRaw, rawVertexSourceCode, rawFragmentSourceCode, rebuildRebind, defines) {const webGpuContext = pipelineContext,shaderLanguage = webGpuContext.shaderProcessingContext.shaderLanguage;this.dbgShowShaderCode && (console.log(defines), console.log(vertexSourceCode), console.log(fragmentSourceCode), console.log("***********************************************")), webGpuContext.sources = { fragment: fragmentSourceCode, vertex: vertexSourceCode, rawVertex: rawVertexSourceCode, rawFragment: rawFragmentSourceCode }, webGpuContext.stages = createAsRaw ? this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, shaderLanguage) : this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines, shaderLanguage);}getAttributes(pipelineContext, attributesNames) {const results = Array(attributesNames.length);for (let i = 0; i < attributesNames.length; i++) {const attributeName = attributesNames[i],attributeLocation = pipelineContext.shaderProcessingContext.availableAttributes[attributeName];void 0 !== attributeLocation && (results[i] = attributeLocation);}return results;}enableEffect(effect) {if (!effect) return;let isNewEffect = !0;if (!Materials_drawWrapper/* DrawWrapper.IsWrapper */.q.IsWrapper(effect)) isNewEffect = effect !== this._currentEffect, this._currentEffect = effect, this._currentMaterialContext = this._defaultMaterialContext, this._currentDrawContext = this._defaultDrawContext, this._counters.numEnableEffects++, this.dbgLogIfNotDrawWrapper && logger/* Logger.Warn */.Y.Warn(`enableEffect has been called with an Effect and not a Wrapper! effect.uniqueId=${effect.uniqueId}, effect.name=${effect.name}, effect.name.vertex=${effect.name.vertex}, effect.name.fragment=${effect.name.fragment}`, 10);else {if (!effect.effect || effect.effect === this._currentEffect && effect.materialContext === this._currentMaterialContext && effect.drawContext === this._currentDrawContext && !this._forceEnableEffect) {if (!effect.effect && this.dbgShowEmptyEnableEffectCalls) throw console.error("drawWrapper=", effect), "Invalid call to enableEffect: the effect property is empty!";return;}if (isNewEffect = effect.effect !== this._currentEffect, this._currentEffect = effect.effect, this._currentMaterialContext = effect.materialContext, this._currentDrawContext = effect.drawContext, this._counters.numEnableDrawWrapper++, !this._currentMaterialContext) throw console.error("drawWrapper=", effect), `Invalid call to enableEffect: the materialContext property is empty!`;}this._stencilStateComposer.stencilMaterial = void 0, this._forceEnableEffect = !(isNewEffect || this._forceEnableEffect) && this._forceEnableEffect, isNewEffect && (this._currentEffect.onBind && this._currentEffect.onBind(this._currentEffect), this._currentEffect._onBindObservable && this._currentEffect._onBindObservable.notifyObservers(this._currentEffect));}_releaseEffect(effect) {this._compiledEffects[effect._key] && (delete this._compiledEffects[effect._key], this._deletePipelineContext(effect.getPipelineContext()));}releaseEffects() {for (const name in this._compiledEffects) {const webGPUPipelineContext = this._compiledEffects[name].getPipelineContext();this._deletePipelineContext(webGPUPipelineContext);}this._compiledEffects = {};}_deletePipelineContext(pipelineContext) {pipelineContext && pipelineContext.dispose();}get needPOTTextures() {return !1;}_createHardwareTexture() {return new WebGPUHardwareTexture();}_releaseTexture(texture) {const index = this._internalTexturesCache.indexOf(texture);-1 !== index && this._internalTexturesCache.splice(index, 1), this._textureHelper.releaseTexture(texture);}_getRGBABufferInternalSizedFormat() {return 5;}updateTextureComparisonFunction(texture, comparisonFunction) {texture._comparisonFunction = comparisonFunction;}_createInternalTexture(size, options, delayGPUTextureCreation = !0, source = Textures_internalTexture/* InternalTextureSource.Unknown */.S.Unknown) {var _a, _b, _c;const fullOptions = {};void 0 !== options && "object" == typeof options ? (fullOptions.generateMipMaps = options.generateMipMaps, fullOptions.type = void 0 === options.type ? 0 : options.type, fullOptions.samplingMode = void 0 === options.samplingMode ? 3 : options.samplingMode, fullOptions.format = void 0 === options.format ? 5 : options.format, fullOptions.samples = null !== (_a = options.samples) && void 0 !== _a ? _a : 1, fullOptions.creationFlags = null !== (_b = options.creationFlags) && void 0 !== _b ? _b : 0, fullOptions.useSRGBBuffer = null !== (_c = options.useSRGBBuffer) && void 0 !== _c && _c) : (fullOptions.generateMipMaps = options, fullOptions.type = 0, fullOptions.samplingMode = 3, fullOptions.format = 5, fullOptions.samples = 1, fullOptions.creationFlags = 0, fullOptions.useSRGBBuffer = !1), 1 !== fullOptions.type || this._caps.textureFloatLinearFiltering ? 2 === fullOptions.type && !this._caps.textureHalfFloatLinearFiltering && (fullOptions.samplingMode = 1) : fullOptions.samplingMode = 1, 1 !== fullOptions.type || this._caps.textureFloat || (fullOptions.type = 0, logger/* Logger.Warn */.Y.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const texture = new Textures_internalTexture/* InternalTexture */.l(this, source),width = size.width || size,height = size.height || size,layers = size.layers || 0;return texture.baseWidth = width, texture.baseHeight = height, texture.width = width, texture.height = height, texture.depth = layers, texture.isReady = !0, texture.samples = fullOptions.samples, texture.generateMipMaps = !!fullOptions.generateMipMaps, texture.samplingMode = fullOptions.samplingMode, texture.type = fullOptions.type, texture.format = fullOptions.format, texture.is2DArray = 0 < layers, texture._cachedWrapU = 0, texture._cachedWrapV = 0, texture._useSRGBBuffer = fullOptions.useSRGBBuffer, this._internalTexturesCache.push(texture), delayGPUTextureCreation || this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, layers || 1, fullOptions.creationFlags), texture;}createTexture(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, creationFlags, useSRGBBuffer) {return this._createTextureBase(url, noMipmap, invertY, scene, samplingMode, onLoad, onError, (texture, extension, scene, img, invertY, noMipmap, isCompressed, processFunction) => {var _a;const imageBitmap = img;if (texture.baseWidth = imageBitmap.width, texture.baseHeight = imageBitmap.height, texture.width = imageBitmap.width, texture.height = imageBitmap.height, texture.format = null !== format && void 0 !== format ? format : -1, processFunction(texture.width, texture.height, imageBitmap, extension, texture, () => {}), null === (_a = texture._hardwareTexture) || void 0 === _a || !_a.underlyingResource) {const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, imageBitmap.width, imageBitmap.height, void 0, creationFlags);WebGPUTextureHelper.IsImageBitmap(imageBitmap) && (this._textureHelper.updateTexture(imageBitmap, texture, imageBitmap.width, imageBitmap.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, !1, 0, 0), !noMipmap && !isCompressed && this._generateMipmaps(texture, this._uploadEncoder));} else noMipmap || isCompressed || this._generateMipmaps(texture, this._uploadEncoder);scene && scene.removePendingData(texture), texture.isReady = !0, texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear();}, () => !1, buffer, fallback, format, forcedExtension, mimeType, loaderOptions, useSRGBBuffer);}wrapWebGPUTexture(texture) {const hardwareTexture = new WebGPUHardwareTexture(texture),internalTexture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Unknown */.S.Unknown, !0);return internalTexture._hardwareTexture = hardwareTexture, internalTexture.isReady = !0, internalTexture;}wrapWebGLTexture() {throw new Error("wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.");}generateMipMapsForCubemap(texture) {var _a;if (texture.generateMipMaps) {const gpuTexture = null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource;gpuTexture || this._textureHelper.createGPUTextureForInternalTexture(texture), this._generateMipmaps(texture, texture.source === Textures_internalTexture/* InternalTextureSource.RenderTarget */.S.RenderTarget || texture.source === Textures_internalTexture/* InternalTextureSource.MultiRenderTarget */.S.MultiRenderTarget ? this._renderTargetEncoder : void 0);}}updateTextureSamplingMode(samplingMode, texture, generateMipMaps = !1) {generateMipMaps && (texture.generateMipMaps = !0, this._generateMipmaps(texture)), texture.samplingMode = samplingMode;}updateTextureWrappingMode(texture, wrapU, wrapV = null, wrapR = null) {null !== wrapU && (texture._cachedWrapU = wrapU), null !== wrapV && (texture._cachedWrapV = wrapV), (texture.is2DArray || texture.is3D) && null !== wrapR && (texture._cachedWrapR = wrapR);}updateTextureDimensions(texture, width, height, depth = 1) {if (texture._hardwareTexture && (texture.width !== width || texture.height !== height || texture.depth !== depth)) {const additionalUsages = texture._hardwareTexture.textureAdditionalUsages;texture._hardwareTexture.release(), this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, additionalUsages);}}_setInternalTexture(name, texture, baseName) {if (baseName = null !== baseName && void 0 !== baseName ? baseName : name, this._currentEffect) {const webgpuPipelineContext = this._currentEffect._pipelineContext,availableTexture = webgpuPipelineContext.shaderProcessingContext.availableTextures[baseName];if (this._currentMaterialContext.setTexture(name, texture), availableTexture && availableTexture.autoBindSampler) {const samplerName = baseName + WebGPUShaderProcessor.AutoSamplerSuffix;this._currentMaterialContext.setSampler(samplerName, texture);}}}setTexture(channel, unused, texture, name) {this._setTexture(channel, texture, !1, !1, name, name);}setTextureArray(channel, unused, textures, name) {for (let index = 0; index < textures.length; index++) this._setTexture(-1, textures[index], !0, !1, name + index.toString(), name);}_setTexture(channel, texture, isPartOfTextureArray = !1, depthStencilTexture = !1, name = "", baseName) {if (baseName = null !== baseName && void 0 !== baseName ? baseName : name, this._currentEffect) {if (!texture) return this._currentMaterialContext.setTexture(name, null), !1;if (texture.video) texture.update();else if (4 === texture.delayLoadState) return texture.delayLoad(), !1;let internalTexture = null;if (internalTexture = depthStencilTexture ? texture.depthStencilTexture : texture.isReady() ? texture.getInternalTexture() : texture.isCube ? this.emptyCubeTexture : texture.is3D ? this.emptyTexture3D : texture.is2DArray ? this.emptyTexture2DArray : this.emptyTexture, internalTexture && !internalTexture.isMultiview) {if (internalTexture.isCube && internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) {internalTexture._cachedCoordinatesMode = texture.coordinatesMode;const textureWrapMode = 3 !== texture.coordinatesMode && 5 !== texture.coordinatesMode ? 1 : 0;texture.wrapU = textureWrapMode, texture.wrapV = textureWrapMode;}internalTexture._cachedWrapU = texture.wrapU, internalTexture._cachedWrapV = texture.wrapV, internalTexture.is3D && (internalTexture._cachedWrapR = texture.wrapR), this._setAnisotropicLevel(0, internalTexture, texture.anisotropicFilteringLevel);}this._setInternalTexture(name, internalTexture, baseName);} else this.dbgVerboseLogsForFirstFrames && (void 0 === this._count && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - _setTexture called with a null _currentEffect! texture=", texture));return !0;}_setAnisotropicLevel(target, internalTexture, anisotropicFilteringLevel) {internalTexture._cachedAnisotropicFilteringLevel !== anisotropicFilteringLevel && (internalTexture._cachedAnisotropicFilteringLevel = Math.min(anisotropicFilteringLevel, this._caps.maxAnisotropy));}_bindTexture(channel, texture, name) {void 0 === channel || this._setInternalTexture(name, texture);}generateMipmaps(texture) {this._generateMipmaps(texture, this._renderTargetEncoder);}_generateMipmaps(texture, commandEncoder) {const gpuHardwareTexture = texture._hardwareTexture;if (!gpuHardwareTexture) return;commandEncoder = null !== commandEncoder && void 0 !== commandEncoder ? commandEncoder : this._currentRenderTarget && !this._currentRenderPass ? this._renderTargetEncoder : this._currentRenderPass ? this._uploadEncoder : this._renderEncoder;const format = texture._hardwareTexture.format,mipmapCount = WebGPUTextureHelper.ComputeNumMipmapLevels(texture.width, texture.height);this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - generate mipmaps called - width=", texture.width, "height=", texture.height, "isCube=", texture.isCube)), texture.isCube ? this._textureHelper.generateCubeMipmaps(gpuHardwareTexture, format, mipmapCount, commandEncoder) : this._textureHelper.generateMipmaps(gpuHardwareTexture, format, mipmapCount, 0, commandEncoder);}updateTextureData(texture, imageData, xOffset, yOffset, width, height, faceIndex = 0, lod = 0, generateMipMaps = !1) {var _a;let gpuTextureWrapper = texture._hardwareTexture;(null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource) || (gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture));const data = new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength);this._textureHelper.updateTexture(data, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, !1, xOffset, yOffset), generateMipMaps && this._generateMipmaps(texture, this._renderTargetEncoder);}_uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, imageData, faceIndex = 0, lod = 0) {var _a;let gpuTextureWrapper = texture._hardwareTexture;(null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource) || (texture.format = internalFormat, gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height));const data = new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength);this._textureHelper.updateTexture(data, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, !1, !1, 0, 0);}_uploadDataToTextureDirectly(texture, imageData, faceIndex = 0, lod = 0, babylonInternalFormat, useTextureWidthAndHeight = !1) {var _a;const lodMaxWidth = Math.round(Math.log(texture.width) * Math.LOG2E),lodMaxHeight = Math.round(Math.log(texture.height) * Math.LOG2E),width = useTextureWidthAndHeight ? texture.width : Math.pow(2, Math.max(lodMaxWidth - lod, 0)),height = useTextureWidthAndHeight ? texture.height : Math.pow(2, Math.max(lodMaxHeight - lod, 0));let gpuTextureWrapper = texture._hardwareTexture;(null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource) || (gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height));const data = new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength);this._textureHelper.updateTexture(data, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, !1, 0, 0);}_uploadArrayBufferViewToTexture(texture, imageData, faceIndex = 0, lod = 0) {this._uploadDataToTextureDirectly(texture, imageData, faceIndex, lod);}_uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) {var _a;let gpuTextureWrapper = texture._hardwareTexture;if ((null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource) || (gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture)), image instanceof HTMLImageElement) throw "WebGPU engine: HTMLImageElement not supported in _uploadImageToTexture!";const width = Math.ceil(texture.width / (1 << lod)),height = Math.ceil(texture.height / (1 << lod));this._textureHelper.updateTexture(image, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, !1, 0, 0);}readPixels(x, y, width, height, hasAlpha = !0, flushRenderer = !0) {const renderPassWrapper = this._rttRenderPassWrapper.renderPass ? this._rttRenderPassWrapper : this._mainRenderPassWrapper,hardwareTexture = renderPassWrapper.colorAttachmentGPUTextures[0];if (!hardwareTexture) return Promise.resolve(new Uint8Array(0));const gpuTexture = hardwareTexture.underlyingResource,gpuTextureFormat = hardwareTexture.format;return gpuTexture ? (flushRenderer && this.flushFramebuffer(), this._textureHelper.readPixels(gpuTexture, x, y, width, height, gpuTextureFormat)) : Promise.resolve(new Uint8Array(0));}beginFrame() {super.beginFrame();}endFrame() {if (this._snapshotRendering.endFrame(this._mainRenderPassWrapper.renderPass), this._endMainRenderPass(), this._timestampQuery.endFrame(this._renderEncoder), this.flushFramebuffer(!1), this.dbgVerboseLogsForFirstFrames && (void 0 === this._count && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - counters")), this._textureHelper.destroyDeferredTextures(), this._bufferManager.destroyDeferredBuffers(), this._features._collectUbosUpdatedInFrame) {if (this.dbgVerboseLogsForFirstFrames && (void 0 === this._count && (this._count = 0), !this._count || this._count < this.dbgVerboseLogsNumFrames)) {const list = [];for (const name in uniformBuffer/* UniformBuffer._UpdatedUbosInFrame */.M._UpdatedUbosInFrame) list.push(name + ":" + uniformBuffer/* UniformBuffer._UpdatedUbosInFrame */.M._UpdatedUbosInFrame[name]);console.log("frame #" + this._count + " - updated ubos -", list.join(", "));}uniformBuffer/* UniformBuffer._UpdatedUbosInFrame */.M._UpdatedUbosInFrame = {};}this.countersLastFrame.numEnableEffects = this._counters.numEnableEffects, this.countersLastFrame.numEnableDrawWrapper = this._counters.numEnableDrawWrapper, this.countersLastFrame.numBundleCreationNonCompatMode = this._counters.numBundleCreationNonCompatMode, this.countersLastFrame.numBundleReuseNonCompatMode = this._counters.numBundleReuseNonCompatMode, this._counters.numEnableEffects = 0, this._counters.numEnableDrawWrapper = 0, this._counters.numBundleCreationNonCompatMode = 0, this._counters.numBundleReuseNonCompatMode = 0, this._cacheRenderPipeline.endFrame(), this._cacheBindGroups.endFrame(), this._pendingDebugCommands.length = 0, super.endFrame(), this.dbgVerboseLogsForFirstFrames && (void 0 === this._count && (this._count = 0), this._count < this.dbgVerboseLogsNumFrames && console.log("%c frame #" + this._count + " - end", "background: #ffff00"), this._count < this.dbgVerboseLogsNumFrames && (this._count++, this._count !== this.dbgVerboseLogsNumFrames && console.log("%c frame #" + this._count + " - begin", "background: #ffff00")));}flushFramebuffer(reopenPass = !0) {const currentRenderPassIsNULL = !this._currentRenderPass;let currentPasses = 0;this._currentRenderPass && this._currentRenderTarget && (currentPasses |= 1, this._endRenderTargetRenderPass()), this._mainRenderPassWrapper.renderPass && (currentPasses |= 2, this._endMainRenderPass()), this._commandBuffers[0] = this._uploadEncoder.finish(), this._commandBuffers[1] = this._renderTargetEncoder.finish(), this._commandBuffers[2] = this._renderEncoder.finish(), this._device.queue.submit(this._commandBuffers), this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor), this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor), this._renderTargetEncoder = this._device.createCommandEncoder(this._renderTargetEncoderDescriptor), this._timestampQuery.startFrame(this._uploadEncoder), this._textureHelper.setCommandEncoder(this._uploadEncoder), this._bundleList.reset(), this._bundleListRenderTarget.reset(), reopenPass && (2 & currentPasses && this._startMainRenderPass(!1), 1 & currentPasses && this._startRenderTargetRenderPass(this._currentRenderTarget, !1, null, !1, !1), currentRenderPassIsNULL && this._currentRenderTarget && (this._currentRenderPass = null));}_currentFrameBufferIsDefaultFrameBuffer() {return null === this._currentRenderTarget;}_startRenderTargetRenderPass(renderTargetWrapper, setClearStates, clearColor, clearDepth, clearStencil) {var _a, _b, _c;const rtWrapper = renderTargetWrapper,depthStencilTexture = rtWrapper._depthStencilTexture,gpuDepthStencilWrapper = null === depthStencilTexture || void 0 === depthStencilTexture ? void 0 : depthStencilTexture._hardwareTexture,gpuDepthStencilTexture = null === gpuDepthStencilWrapper || void 0 === gpuDepthStencilWrapper ? void 0 : gpuDepthStencilWrapper.underlyingResource,gpuDepthStencilMSAATexture = null === gpuDepthStencilWrapper || void 0 === gpuDepthStencilWrapper ? void 0 : gpuDepthStencilWrapper.msaaTexture,depthTextureView = null === gpuDepthStencilTexture || void 0 === gpuDepthStencilTexture ? void 0 : gpuDepthStencilTexture.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor),depthMSAATextureView = null === gpuDepthStencilMSAATexture || void 0 === gpuDepthStencilMSAATexture ? void 0 : gpuDepthStencilMSAATexture.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor),depthTextureHasStencil = !!gpuDepthStencilWrapper && WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format),colorAttachments = [];this.useReverseDepthBuffer && this.setDepthFunctionToGreaterOrEqual();const mustClearColor = setClearStates && clearColor,mustClearDepth = setClearStates && clearDepth,mustClearStencil = setClearStates && clearStencil;if (rtWrapper._attachments && rtWrapper.isMulti) {this._mrtAttachments && 0 !== this._mrtAttachments.length || (this._mrtAttachments = rtWrapper._defaultAttachments);for (let i = 0; i < this._mrtAttachments.length; ++i) {const index = this._mrtAttachments[i],mrtTexture = rtWrapper.textures[i],gpuMRTWrapper = null === mrtTexture || void 0 === mrtTexture ? void 0 : mrtTexture._hardwareTexture,gpuMRTTexture = null === gpuMRTWrapper || void 0 === gpuMRTWrapper ? void 0 : gpuMRTWrapper.underlyingResource;if (gpuMRTWrapper && gpuMRTTexture) {const viewDescriptor = { ...this._rttRenderPassWrapper.colorAttachmentViewDescriptor, format: gpuMRTWrapper.format },gpuMSAATexture = gpuMRTWrapper.msaaTexture,colorTextureView = gpuMRTTexture.createView(viewDescriptor),colorMSAATextureView = null === gpuMSAATexture || void 0 === gpuMSAATexture ? void 0 : gpuMSAATexture.createView(viewDescriptor);colorAttachments.push({ view: colorMSAATextureView ? colorMSAATextureView : colorTextureView, resolveTarget: gpuMSAATexture ? colorTextureView : void 0, clearValue: 0 !== index && mustClearColor ? clearColor : void 0, loadOp: 0 !== index && mustClearColor ? LoadOp.Clear : LoadOp.Load, storeOp: StoreOp.Store });}}this._cacheRenderPipeline.setMRT(rtWrapper.textures, this._mrtAttachments.length), this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);} else {const internalTexture = rtWrapper.texture;if (internalTexture) {const gpuWrapper = internalTexture._hardwareTexture,gpuTexture = gpuWrapper.underlyingResource,gpuMSAATexture = gpuWrapper.msaaTexture,colorTextureView = gpuTexture.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor),colorMSAATextureView = null === gpuMSAATexture || void 0 === gpuMSAATexture ? void 0 : gpuMSAATexture.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor);colorAttachments.push({ view: colorMSAATextureView ? colorMSAATextureView : colorTextureView, resolveTarget: gpuMSAATexture ? colorTextureView : void 0, clearValue: mustClearColor ? clearColor : void 0, loadOp: mustClearColor ? LoadOp.Clear : LoadOp.Load, storeOp: StoreOp.Store });} else colorAttachments.push(null);}if (null === (_a = this._debugPushGroup) || void 0 === _a ? void 0 : _a.call(this, "render target pass", 1), this._rttRenderPassWrapper.renderPassDescriptor = { colorAttachments, depthStencilAttachment: depthStencilTexture && gpuDepthStencilTexture ? { view: depthMSAATextureView ? depthMSAATextureView : depthTextureView, depthClearValue: mustClearDepth ? this.useReverseDepthBuffer ? this._clearReverseDepthValue : this._clearDepthValue : void 0, depthLoadOp: mustClearDepth ? LoadOp.Clear : LoadOp.Load, depthStoreOp: StoreOp.Store, stencilClearValue: rtWrapper._depthStencilTextureWithStencil && mustClearStencil ? this._clearStencilValue : void 0, stencilLoadOp: depthTextureHasStencil ? rtWrapper._depthStencilTextureWithStencil && mustClearStencil ? LoadOp.Clear : LoadOp.Load : void 0, stencilStoreOp: depthTextureHasStencil ? StoreOp.Store : void 0 } : void 0, occlusionQuerySet: (null === (_b = this._occlusionQuery) || void 0 === _b ? void 0 : _b.hasQueries) ? this._occlusionQuery.querySet : void 0 }, this._rttRenderPassWrapper.renderPass = this._renderTargetEncoder.beginRenderPass(this._rttRenderPassWrapper.renderPassDescriptor), this.dbgVerboseLogsForFirstFrames && (void 0 === this._count && (this._count = 0), !this._count || this._count < this.dbgVerboseLogsNumFrames)) {const internalTexture = rtWrapper.texture;console.log("frame #" + this._count + " - render target begin pass - internalTexture.uniqueId=", internalTexture.uniqueId, "width=", internalTexture.width, "height=", internalTexture.height, this._rttRenderPassWrapper.renderPassDescriptor);}this._currentRenderPass = this._rttRenderPassWrapper.renderPass, null === (_c = this._debugFlushPendingCommands) || void 0 === _c ? void 0 : _c.call(this), this._resetCurrentViewport(1), this._resetCurrentScissor(1), this._resetCurrentStencilRef(1), this._resetCurrentColorBlend(1), gpuDepthStencilWrapper && WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format) || (this._stencilStateComposer.enabled = !1);}_endRenderTargetRenderPass() {var _a, _b, _c, _d;if (this._currentRenderPass) {const gpuWrapper = null === (_a = this._currentRenderTarget.texture) || void 0 === _a ? void 0 : _a._hardwareTexture;!gpuWrapper || this._snapshotRendering.endRenderTargetPass(this._currentRenderPass, gpuWrapper) || this.compatibilityMode || (this._bundleListRenderTarget.run(this._currentRenderPass), this._bundleListRenderTarget.reset()), this._currentRenderPass.end(), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - render target end pass - internalTexture.uniqueId=", null === (_c = null === (_b = this._currentRenderTarget) || void 0 === _b ? void 0 : _b.texture) || void 0 === _c ? void 0 : _c.uniqueId)), null === (_d = this._debugPopGroup) || void 0 === _d ? void 0 : _d.call(this, 1), this._resetCurrentViewport(1), this._resetCurrentScissor(1), this._resetCurrentStencilRef(1), this._resetCurrentColorBlend(1), this._currentRenderPass = null, this._rttRenderPassWrapper.reset();}}_getCurrentRenderPass() {return this._currentRenderTarget && !this._currentRenderPass ? this._startRenderTargetRenderPass(this._currentRenderTarget, !1, null, !1, !1) : !this._currentRenderPass && this._startMainRenderPass(!1), this._currentRenderPass;}_getCurrentRenderPassIndex() {return null === this._currentRenderPass ? -1 : this._currentRenderPass === this._mainRenderPassWrapper.renderPass ? 0 : 1;}_startMainRenderPass(setClearStates, clearColor, clearDepth, clearStencil) {var _a, _b, _c;this._mainRenderPassWrapper.renderPass && this.flushFramebuffer(!1), this.useReverseDepthBuffer && this.setDepthFunctionToGreaterOrEqual();const mustClearColor = setClearStates && clearColor,mustClearDepth = setClearStates && clearDepth,mustClearStencil = setClearStates && clearStencil;this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].clearValue = mustClearColor ? clearColor : void 0, this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].loadOp = mustClearColor ? LoadOp.Clear : LoadOp.Load, this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthClearValue = mustClearDepth ? this.useReverseDepthBuffer ? this._clearReverseDepthValue : this._clearDepthValue : void 0, this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthLoadOp = mustClearDepth ? LoadOp.Clear : LoadOp.Load, this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilClearValue = mustClearStencil ? this._clearStencilValue : void 0, this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilLoadOp = this.isStencilEnable ? mustClearStencil ? LoadOp.Clear : LoadOp.Load : void 0, this._mainRenderPassWrapper.renderPassDescriptor.occlusionQuerySet = (null === (_a = this._occlusionQuery) || void 0 === _a ? void 0 : _a.hasQueries) ? this._occlusionQuery.querySet : void 0;const swapChainTexture = this._context.getCurrentTexture();this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].set(swapChainTexture), this._options.antialiasing ? this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].resolveTarget = swapChainTexture.createView() : this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].view = swapChainTexture.createView(), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - main begin pass - texture width=" + this._mainTextureExtends.width, " height=" + this._mainTextureExtends.height, this._mainRenderPassWrapper.renderPassDescriptor)), null === (_b = this._debugPushGroup) || void 0 === _b ? void 0 : _b.call(this, "main pass", 0), this._currentRenderPass = this._renderEncoder.beginRenderPass(this._mainRenderPassWrapper.renderPassDescriptor), this._mainRenderPassWrapper.renderPass = this._currentRenderPass, null === (_c = this._debugFlushPendingCommands) || void 0 === _c ? void 0 : _c.call(this), this._resetCurrentViewport(0), this._resetCurrentScissor(0), this._resetCurrentStencilRef(0), this._resetCurrentColorBlend(0), this._isStencilEnable || (this._stencilStateComposer.enabled = !1);}_endMainRenderPass() {var _a;null !== this._mainRenderPassWrapper.renderPass && (this._snapshotRendering.endMainRenderPass(), !this.compatibilityMode && !this._snapshotRendering.play && (this._bundleList.run(this._mainRenderPassWrapper.renderPass), this._bundleList.reset()), this._mainRenderPassWrapper.renderPass.end(), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - main end pass")), null === (_a = this._debugPopGroup) || void 0 === _a ? void 0 : _a.call(this, 0), this._resetCurrentViewport(0), this._resetCurrentScissor(0), this._resetCurrentStencilRef(0), this._resetCurrentColorBlend(0), this._mainRenderPassWrapper.renderPass === this._currentRenderPass && (this._currentRenderPass = null), this._mainRenderPassWrapper.reset(!1));}bindFramebuffer(texture, faceIndex = 0, requiredWidth, requiredHeight, forceFullscreenViewport, lodLevel = 0, layer = 0) {var _a, _b;const hardwareTexture = null === (_a = texture.texture) || void 0 === _a ? void 0 : _a._hardwareTexture;this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = texture, hardwareTexture && (hardwareTexture._currentLayer = texture.isCube ? 6 * layer + faceIndex : layer), this._rttRenderPassWrapper.colorAttachmentGPUTextures[0] = hardwareTexture, this._rttRenderPassWrapper.depthTextureFormat = this._currentRenderTarget._depthStencilTexture ? WebGPUTextureHelper.GetWebGPUTextureFormat(-1, this._currentRenderTarget._depthStencilTexture.format) : void 0, this._setDepthTextureFormat(this._rttRenderPassWrapper), this._setColorFormat(this._rttRenderPassWrapper), this._rttRenderPassWrapper.colorAttachmentViewDescriptor = { format: this._colorFormat, dimension: TextureViewDimension.E2d, mipLevelCount: 1, baseArrayLayer: texture.isCube ? 6 * layer + faceIndex : layer, baseMipLevel: lodLevel, arrayLayerCount: 1, aspect: TextureAspect.All }, this._rttRenderPassWrapper.depthAttachmentViewDescriptor = { format: this._depthTextureFormat, dimension: TextureViewDimension.E2d, mipLevelCount: 1, baseArrayLayer: texture.isCube ? 6 * layer + faceIndex : layer, baseMipLevel: 0, arrayLayerCount: 1, aspect: TextureAspect.All }, this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - bindFramebuffer called - internalTexture.uniqueId=", null === (_b = texture.texture) || void 0 === _b ? void 0 : _b.uniqueId, "face=", faceIndex, "lodLevel=", lodLevel, "layer=", layer, this._rttRenderPassWrapper.colorAttachmentViewDescriptor, this._rttRenderPassWrapper.depthAttachmentViewDescriptor)), this._currentRenderPass = null, this.snapshotRendering && 1 === this.snapshotRenderingMode && this._getCurrentRenderPass(), this._cachedViewport && !forceFullscreenViewport ? this.setViewport(this._cachedViewport, requiredWidth, requiredHeight) : (!requiredWidth && (requiredWidth = texture.width, lodLevel && (requiredWidth /= Math.pow(2, lodLevel))), !requiredHeight && (requiredHeight = texture.height, lodLevel && (requiredHeight /= Math.pow(2, lodLevel))), this._viewport(0, 0, requiredWidth, requiredHeight)), this.wipeCaches();}unBindFramebuffer(texture, disableGenerateMipMaps = !1, onBeforeUnbind) {var _a, _b;const saveCRT = this._currentRenderTarget;this._currentRenderTarget = null, onBeforeUnbind && onBeforeUnbind(), this._currentRenderTarget = saveCRT, this._currentRenderPass && this._currentRenderPass !== this._mainRenderPassWrapper.renderPass && this._endRenderTargetRenderPass(), !(null !== (_a = texture.texture) && void 0 !== _a) || !_a.generateMipMaps || disableGenerateMipMaps || texture.isCube || this._generateMipmaps(texture.texture), this._currentRenderTarget = null, this._onAfterUnbindFrameBufferObservable.notifyObservers(this), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - unBindFramebuffer called - internalTexture.uniqueId=", null === (_b = texture.texture) || void 0 === _b ? void 0 : _b.uniqueId)), this._mrtAttachments = [], this._cacheRenderPipeline.setMRT([]), this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments), this._currentRenderPass = this._mainRenderPassWrapper.renderPass, this._setDepthTextureFormat(this._mainRenderPassWrapper), this._setColorFormat(this._mainRenderPassWrapper);}restoreDefaultFramebuffer() {this._currentRenderTarget ? this.unBindFramebuffer(this._currentRenderTarget) : (this._currentRenderPass = this._mainRenderPassWrapper.renderPass, this._setDepthTextureFormat(this._mainRenderPassWrapper), this._setColorFormat(this._mainRenderPassWrapper)), this._currentRenderPass && this._cachedViewport && this.setViewport(this._cachedViewport), this.wipeCaches();}_setColorFormat(wrapper) {var _a, _b;const format = null !== (_b = null === (_a = wrapper.colorAttachmentGPUTextures[0]) || void 0 === _a ? void 0 : _a.format) && void 0 !== _b ? _b : null;this._cacheRenderPipeline.setColorFormat(format);this._colorFormat === format || (this._colorFormat = format);}_setDepthTextureFormat(wrapper) {this._cacheRenderPipeline.setDepthStencilFormat(wrapper.depthTextureFormat);this._depthTextureFormat === wrapper.depthTextureFormat || (this._depthTextureFormat = wrapper.depthTextureFormat);}setDitheringState() {}setRasterizerState() {}setState(culling, zOffset = 0, force, reverseSide = !1, cullBackFaces, stencil, zOffsetUnits = 0) {var _a, _b;(this._depthCullingState.cull !== culling || force) && (this._depthCullingState.cull = culling);const cullFace = null === (_b = null !== (_a = this.cullBackFaces) && void 0 !== _a ? _a : cullBackFaces) || void 0 === _b || _b ? 1 : 2;(this._depthCullingState.cullFace !== cullFace || force) && (this._depthCullingState.cullFace = cullFace), this.setZOffset(zOffset), this.setZOffsetUnits(zOffsetUnits);const frontFace = reverseSide ? this._currentRenderTarget ? 1 : 2 : this._currentRenderTarget ? 2 : 1;(this._depthCullingState.frontFace !== frontFace || force) && (this._depthCullingState.frontFace = frontFace), this._stencilStateComposer.stencilMaterial = stencil;}_applyRenderPassChanges(renderPass, bundleList) {var _a;const mustUpdateViewport = this._mustUpdateViewport(renderPass),mustUpdateScissor = this._mustUpdateScissor(renderPass),mustUpdateStencilRef = !!this._stencilStateComposer.enabled && this._mustUpdateStencilRef(renderPass),mustUpdateBlendColor = !!this._alphaState.alphaBlend && this._mustUpdateBlendColor(renderPass);bundleList ? (mustUpdateViewport && bundleList.addItem(new WebGPURenderItemViewport(this._viewportCached.x, this._viewportCached.y, this._viewportCached.z, this._viewportCached.w)), mustUpdateScissor && bundleList.addItem(new WebGPURenderItemScissor(this._scissorCached.x, this._scissorCached.y, this._scissorCached.z, this._scissorCached.w)), mustUpdateStencilRef && bundleList.addItem(new WebGPURenderItemStencilRef(null !== (_a = this._stencilStateComposer.funcRef) && void 0 !== _a ? _a : 0)), mustUpdateBlendColor && bundleList.addItem(new WebGPURenderItemBlendColor(this._alphaState._blendConstants.slice()))) : (mustUpdateViewport && this._applyViewport(renderPass), mustUpdateScissor && this._applyScissor(renderPass), mustUpdateStencilRef && this._applyStencilRef(renderPass), mustUpdateBlendColor && this._applyBlendColor(renderPass));}_draw(drawType, fillMode, start, count, instancesCount) {var _a;const renderPass = this._getCurrentRenderPass(),renderPassIndex = this._getCurrentRenderPassIndex(),bundleList = 0 === renderPassIndex ? this._bundleList : this._bundleListRenderTarget;this.applyStates();const webgpuPipelineContext = this._currentEffect._pipelineContext;if (this.bindUniformBufferBase(this._currentRenderTarget ? this._ubInvertY : this._ubDontInvertY, 0, WebGPUShaderProcessor.InternalsUBOName), webgpuPipelineContext.uniformBuffer && (webgpuPipelineContext.uniformBuffer.update(), this.bindUniformBufferBase(webgpuPipelineContext.uniformBuffer.getBuffer(), 0, WebGPUShaderProcessor.LeftOvertUBOName)), this._snapshotRendering.play) return void this._reportDrawCall();!this.compatibilityMode && (this._currentDrawContext.isDirty(this._currentMaterialContext.updateId) || this._currentMaterialContext.isDirty || this._currentMaterialContext.forceBindGroupCreation) && (this._currentDrawContext.fastBundle = void 0);const useFastPath = !this.compatibilityMode && this._currentDrawContext.fastBundle;let renderPass2 = renderPass;if (useFastPath || this._snapshotRendering.record) {if (this._applyRenderPassChanges(renderPass, bundleList), !this._snapshotRendering.record) return this._counters.numBundleReuseNonCompatMode++, this._currentDrawContext.indirectDrawBuffer && this._currentDrawContext.setIndirectData(count, instancesCount || 1, start), bundleList.addBundle(this._currentDrawContext.fastBundle), void this._reportDrawCall();renderPass2 = bundleList.getBundleEncoder(this._cacheRenderPipeline.colorFormats, this._depthTextureFormat, this.currentSampleCount), bundleList.numDrawCalls++;}let textureState = 0;if (!this._caps.textureFloatLinearFiltering && this._currentMaterialContext.hasFloatTextures) {let bitVal = 1;for (let i = 0; i < webgpuPipelineContext.shaderProcessingContext.textureNames.length; ++i) {const textureName = webgpuPipelineContext.shaderProcessingContext.textureNames[i],texture = null === (_a = this._currentMaterialContext.textures[textureName]) || void 0 === _a ? void 0 : _a.texture;1 === (null === texture || void 0 === texture ? void 0 : texture.type) && (textureState |= bitVal), bitVal <<= 1;}}const pipeline = this._cacheRenderPipeline.getRenderPipeline(fillMode, this._currentEffect, this.currentSampleCount, textureState),bindGroups = this._cacheBindGroups.getBindGroups(webgpuPipelineContext, this._currentDrawContext, this._currentMaterialContext);this._snapshotRendering.record || (this._applyRenderPassChanges(renderPass, this.compatibilityMode ? null : bundleList), !this.compatibilityMode && (this._counters.numBundleCreationNonCompatMode++, renderPass2 = this._device.createRenderBundleEncoder({ colorFormats: this._cacheRenderPipeline.colorFormats, depthStencilFormat: this._depthTextureFormat, sampleCount: this.currentSampleCount }))), renderPass2.setPipeline(pipeline), this._currentIndexBuffer && renderPass2.setIndexBuffer(this._currentIndexBuffer.underlyingResource, this._currentIndexBuffer.is32Bits ? IndexFormat.Uint32 : IndexFormat.Uint16, 0);const vertexBuffers = this._cacheRenderPipeline.vertexBuffers;for (let index = 0; index < vertexBuffers.length; index++) {const vertexBuffer = vertexBuffers[index],buffer = vertexBuffer.getBuffer();buffer && renderPass2.setVertexBuffer(index, buffer.underlyingResource, vertexBuffer._validOffsetRange ? 0 : vertexBuffer.byteOffset);}for (let i = 0; i < bindGroups.length; i++) renderPass2.setBindGroup(i, bindGroups[i]);const nonCompatMode = !this.compatibilityMode && !this._snapshotRendering.record;nonCompatMode && this._currentDrawContext.indirectDrawBuffer ? (this._currentDrawContext.setIndirectData(count, instancesCount || 1, start), 0 === drawType ? renderPass2.drawIndexedIndirect(this._currentDrawContext.indirectDrawBuffer, 0) : renderPass2.drawIndirect(this._currentDrawContext.indirectDrawBuffer, 0)) : 0 === drawType ? renderPass2.drawIndexed(count, instancesCount || 1, start, 0, 0) : renderPass2.draw(count, instancesCount || 1, start, 0), nonCompatMode && (this._currentDrawContext.fastBundle = renderPass2.finish(), bundleList.addBundle(this._currentDrawContext.fastBundle)), this._reportDrawCall();}drawElementsType(fillMode, indexStart, indexCount, instancesCount = 1) {this._draw(0, fillMode, indexStart, indexCount, instancesCount);}drawArraysType(fillMode, verticesStart, verticesCount, instancesCount = 1) {this._currentIndexBuffer = null, this._draw(1, fillMode, verticesStart, verticesCount, instancesCount);}dispose() {var _a, _b;null === (_a = this._mainTexture) || void 0 === _a ? void 0 : _a.destroy(), null === (_b = this._depthTexture) || void 0 === _b ? void 0 : _b.destroy(), super.dispose();}getRenderWidth(useScreen = !1) {return !useScreen && this._currentRenderTarget ? this._currentRenderTarget.width : this._canvas.width;}getRenderHeight(useScreen = !1) {return !useScreen && this._currentRenderTarget ? this._currentRenderTarget.height : this._canvas.height;}getRenderingCanvas() {return this._canvas;}getError() {return 0;}bindSamplers() {}_bindTextureDirectly() {return !1;}areAllEffectsReady() {return !0;}_executeWhenRenderingStateIsCompiled(pipelineContext, action) {action();}_isRenderingStateCompiled() {return !0;}_getUnpackAlignement() {return 1;}_unpackFlipY() {}_bindUnboundFramebuffer() {throw "_bindUnboundFramebuffer is not implementedin WebGPU! You probably want to use restoreDefaultFramebuffer or unBindFramebuffer instead";}_getSamplingParameters() {throw "_getSamplingParameters is not available in WebGPU";}getUniforms() {return [];}setIntArray() {return !1;}setIntArray2() {return !1;}setIntArray3() {return !1;}setIntArray4() {return !1;}setArray() {return !1;}setArray2() {return !1;}setArray3() {return !1;}setArray4() {return !1;}setMatrices() {return !1;}setMatrix3x3() {return !1;}setMatrix2x2() {return !1;}setFloat() {return !1;}setFloat2() {return !1;}setFloat3() {return !1;}setFloat4() {return !1;}}WebGPUEngine._GLSLslangDefaultOptions = { jsPath: "https://preview.babylonjs.com/glslang/glslang.js", wasmPath: "https://preview.babylonjs.com/glslang/glslang.wasm" }, WebGPUEngine.UseTWGSL = !0;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.alpha.js
WebGPUEngine.prototype.setAlphaMode = function (mode, noDepthWriteChange = !1) {(this._alphaMode !== mode || (0 !== mode || this._alphaState.alphaBlend) && (0 === mode || !this._alphaState.alphaBlend)) && (0 === mode ? this._alphaState.alphaBlend = !1 : 7 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 1), this._alphaState.alphaBlend = !0) : 8 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771), this._alphaState.alphaBlend = !0) : 2 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 1), this._alphaState.alphaBlend = !0) : 6 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(1, 1, 0, 1), this._alphaState.alphaBlend = !0) : 1 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(770, 1, 0, 1), this._alphaState.alphaBlend = !0) : 3 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(0, 769, 1, 1), this._alphaState.alphaBlend = !0) : 4 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(774, 0, 1, 1), this._alphaState.alphaBlend = !0) : 5 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(770, 769, 1, 1), this._alphaState.alphaBlend = !0) : 9 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(32769, 32770, 32771, 32772), this._alphaState.alphaBlend = !0) : 10 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(1, 769, 1, 771), this._alphaState.alphaBlend = !0) : 11 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 1), this._alphaState.alphaBlend = !0) : 12 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(772, 1, 0, 0), this._alphaState.alphaBlend = !0) : 13 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(775, 769, 773, 771), this._alphaState.alphaBlend = !0) : 14 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771), this._alphaState.alphaBlend = !0) : 15 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 0), this._alphaState.alphaBlend = !0) : 16 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(775, 769, 0, 1), this._alphaState.alphaBlend = !0) : 17 === mode ? (this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 771), this._alphaState.alphaBlend = !0) : void 0, noDepthWriteChange || (this.setDepthWrite(mode === engine/* Engine.ALPHA_DISABLE */.D.ALPHA_DISABLE), this._cacheRenderPipeline.setDepthWriteEnabled(mode === engine/* Engine.ALPHA_DISABLE */.D.ALPHA_DISABLE)), this._alphaMode = mode, this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend), this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters));}, WebGPUEngine.prototype.setAlphaEquation = function (equation) {engine/* Engine.prototype.setAlphaEquation.call */.D.prototype.setAlphaEquation.call(this, equation), this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuComputeContext.js
class WebGPUComputeContext {getBindGroups(bindings, computePipeline, bindingsMapping) {if (!bindingsMapping) throw new Error("WebGPUComputeContext.getBindGroups: bindingsMapping is required until browsers support reflection for wgsl shaders!");if (0 === this._bindGroups.length) {const bindGroupEntriesExist = 0 < this._bindGroupEntries.length;for (const key in bindings) {const binding = bindings[key],location = bindingsMapping[key],group = location.group,index = location.binding,type = binding.type,object = binding.object;let indexInGroupEntries = binding.indexInGroupEntries,entries = this._bindGroupEntries[group];switch (entries || (entries = this._bindGroupEntries[group] = []), type) {case ComputeBindingType.Sampler:{const sampler = object;void 0 !== indexInGroupEntries && bindGroupEntriesExist ? entries[indexInGroupEntries].resource = this._cacheSampler.getSampler(sampler) : (binding.indexInGroupEntries = entries.length, entries.push({ binding: index, resource: this._cacheSampler.getSampler(sampler) }));break;}case ComputeBindingType.Texture:case ComputeBindingType.TextureWithoutSampler:{const texture = object,hardwareTexture = texture._texture._hardwareTexture;void 0 !== indexInGroupEntries && bindGroupEntriesExist ? (type === ComputeBindingType.Texture && (entries[indexInGroupEntries++].resource = this._cacheSampler.getSampler(texture._texture)), entries[indexInGroupEntries].resource = hardwareTexture.view) : (binding.indexInGroupEntries = entries.length, type === ComputeBindingType.Texture && entries.push({ binding: index - 1, resource: this._cacheSampler.getSampler(texture._texture) }), entries.push({ binding: index, resource: hardwareTexture.view }));break;}case ComputeBindingType.StorageTexture:{const texture = object,hardwareTexture = texture._texture._hardwareTexture;0 == (hardwareTexture.textureAdditionalUsages & TextureUsage.StorageBinding) && logger/* Logger.Error */.Y.Error(`computeDispatch: The texture (name=${texture.name}, uniqueId=${texture.uniqueId}) is not a storage texture!`, 50), void 0 !== indexInGroupEntries && bindGroupEntriesExist ? entries[indexInGroupEntries].resource = hardwareTexture.viewForWriting : (binding.indexInGroupEntries = entries.length, entries.push({ binding: index, resource: hardwareTexture.viewForWriting }));break;}case ComputeBindingType.UniformBuffer:case ComputeBindingType.StorageBuffer:{const buffer = type === ComputeBindingType.UniformBuffer ? object : object,dataBuffer = buffer.getBuffer(),webgpuBuffer = dataBuffer.underlyingResource;void 0 !== indexInGroupEntries && bindGroupEntriesExist ? (entries[indexInGroupEntries].resource.buffer = webgpuBuffer, entries[indexInGroupEntries].resource.size = dataBuffer.capacity) : (binding.indexInGroupEntries = entries.length, entries.push({ binding: index, resource: { buffer: webgpuBuffer, offset: 0, size: dataBuffer.capacity } }));break;}}}for (let i = 0; i < this._bindGroupEntries.length; ++i) {const entries = this._bindGroupEntries[i];if (!entries) {this._bindGroups[i] = void 0;continue;}this._bindGroups[i] = this._device.createBindGroup({ layout: computePipeline.getBindGroupLayout(i), entries });}this._bindGroups.length = this._bindGroupEntries.length;}return this._bindGroups;}constructor(device, cacheSampler) {this._device = device, this._cacheSampler = cacheSampler, this.uniqueId = WebGPUComputeContext._Counter++, this._bindGroupEntries = [], this.clear();}clear() {this._bindGroups = [];}}WebGPUComputeContext._Counter = 0;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuComputePipelineContext.js
class WebGPUComputePipelineContext {get isAsync() {return !1;}get isReady() {return !!this.stage;}constructor(engine) {this._name = "unnamed", this.engine = engine;}_getComputeShaderCode() {var _a;return null === (_a = this.sources) || void 0 === _a ? void 0 : _a.compute;}dispose() {}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.computeShader.js
WebGPUEngine.prototype.createComputeContext = function () {return new WebGPUComputeContext(this._device, this._cacheSampler);}, WebGPUEngine.prototype.createComputeEffect = function (baseName, options) {const compute = baseName.computeElement || baseName.compute || baseName.computeToken || baseName.computeSource || baseName,name = compute + "@" + options.defines;if (this._compiledComputeEffects[name]) {const compiledEffect = this._compiledComputeEffects[name];return options.onCompiled && compiledEffect.isReady() && options.onCompiled(compiledEffect), compiledEffect;}const effect = new ComputeEffect(baseName, options, this, name);return this._compiledComputeEffects[name] = effect, effect;}, WebGPUEngine.prototype.createComputePipelineContext = function () {return new WebGPUComputePipelineContext(this);}, WebGPUEngine.prototype.areAllComputeEffectsReady = function () {for (const key in this._compiledComputeEffects) {const effect = this._compiledComputeEffects[key];if (!effect.isReady()) return !1;}return !0;}, WebGPUEngine.prototype.computeDispatch = function (effect, context, bindings, x, y, z, bindingsMapping) {if (this._currentRenderTarget) return void this._onAfterUnbindFrameBufferObservable.addOnce(() => {this.computeDispatch(effect, context, bindings, x, y, z, bindingsMapping);});const contextPipeline = effect._pipelineContext;contextPipeline.computePipeline || (contextPipeline.computePipeline = this._device.createComputePipeline({ layout: AutoLayoutMode.Auto, compute: contextPipeline.stage }));const commandEncoder = this._renderTargetEncoder,computePass = commandEncoder.beginComputePass();computePass.setPipeline(contextPipeline.computePipeline);const bindGroups = context.getBindGroups(bindings, contextPipeline.computePipeline, bindingsMapping);for (let i = 0; i < bindGroups.length; ++i) {const bindGroup = bindGroups[i];bindGroup && computePass.setBindGroup(i, bindGroup);}computePass.dispatchWorkgroups(x, y, z), computePass.end();}, WebGPUEngine.prototype.releaseComputeEffects = function () {for (const name in this._compiledComputeEffects) {const webGPUPipelineContextCompute = this._compiledComputeEffects[name].getPipelineContext();this._deleteComputePipelineContext(webGPUPipelineContextCompute);}this._compiledComputeEffects = {};}, WebGPUEngine.prototype._prepareComputePipelineContext = function (pipelineContext, computeSourceCode, rawComputeSourceCode, defines, entryPoint) {const webGpuContext = pipelineContext;this.dbgShowShaderCode && (console.log(defines), console.log(computeSourceCode)), webGpuContext.sources = { compute: computeSourceCode, rawCompute: rawComputeSourceCode }, webGpuContext.stage = this._createComputePipelineStageDescriptor(computeSourceCode, defines, entryPoint);}, WebGPUEngine.prototype._releaseComputeEffect = function (effect) {this._compiledComputeEffects[effect._key] && (delete this._compiledComputeEffects[effect._key], this._deleteComputePipelineContext(effect.getPipelineContext()));}, WebGPUEngine.prototype._rebuildComputeEffects = function () {for (const key in this._compiledComputeEffects) {const effect = this._compiledComputeEffects[key];effect._pipelineContext = null, effect._wasPreviouslyReady = !1, effect._prepareEffect();}}, WebGPUEngine.prototype._deleteComputePipelineContext = function (pipelineContext) {pipelineContext && pipelineContext.dispose();}, WebGPUEngine.prototype._createComputePipelineStageDescriptor = function (computeShader, defines, entryPoint) {return defines = defines ? "//" + defines.split("\n").join("\n//") + "\n" : "", { module: this._device.createShaderModule({ code: defines + computeShader }), entryPoint };};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.cubeTexture.js
WebGPUEngine.prototype._createDepthStencilCubeTexture = function (size, options) {const internalTexture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.DepthStencil */.S.DepthStencil);internalTexture.isCube = !0;const internalOptions = { bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1, samples: 1, ...options };return internalTexture.format = internalOptions.generateStencil ? 13 : 14, this._setupDepthStencilTexture(internalTexture, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples), this._textureHelper.createGPUTextureForInternalTexture(internalTexture), this._internalTexturesCache.push(internalTexture), internalTexture;}, WebGPUEngine.prototype.createCubeTexture = function (rootUrl, scene, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = !1, lodScale = 0, lodOffset = 0, fallback = null, useSRGBBuffer = !1) {return this.createCubeTextureBase(rootUrl, scene, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback, null, (texture, imgs) => {const imageBitmaps = imgs,width = imageBitmaps[0].width,height = width;this._setCubeMapTextureParams(texture, !noMipmap), texture.format = null !== format && void 0 !== format ? format : -1;const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource, width, height, gpuTextureWrapper.format, !1, !1, 0, 0), noMipmap || this._generateMipmaps(texture, this._uploadEncoder), texture.isReady = !0, texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear(), onLoad && onLoad();}, !!useSRGBBuffer);}, WebGPUEngine.prototype._setCubeMapTextureParams = function (texture, loadMipmap, maxLevel) {texture.samplingMode = loadMipmap ? 3 : 2, texture._cachedWrapU = 0, texture._cachedWrapV = 0, maxLevel && (texture._maxLodLevel = maxLevel);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.debugging.js
WebGPUEngine.prototype._debugPushGroup = function (groupName, targetObject) {if (this._options.enableGPUDebugMarkers) if (0 === targetObject || 1 === targetObject) {const encoder = 0 === targetObject ? this._renderEncoder : this._renderTargetEncoder;encoder.pushDebugGroup(groupName);} else this._currentRenderPass ? this._currentRenderPass.pushDebugGroup(groupName) : this._pendingDebugCommands.push(["push", groupName]);}, WebGPUEngine.prototype._debugPopGroup = function (targetObject) {if (this._options.enableGPUDebugMarkers) if (0 === targetObject || 1 === targetObject) {const encoder = 0 === targetObject ? this._renderEncoder : this._renderTargetEncoder;encoder.popDebugGroup();} else this._currentRenderPass ? this._currentRenderPass.popDebugGroup() : this._pendingDebugCommands.push(["pop", null]);}, WebGPUEngine.prototype._debugInsertMarker = function (text, targetObject) {if (this._options.enableGPUDebugMarkers) if (0 === targetObject || 1 === targetObject) {const encoder = 0 === targetObject ? this._renderEncoder : this._renderTargetEncoder;encoder.insertDebugMarker(text);} else this._currentRenderPass ? this._currentRenderPass.insertDebugMarker(text) : this._pendingDebugCommands.push(["insert", text]);}, WebGPUEngine.prototype._debugFlushPendingCommands = function () {for (let i = 0; i < this._pendingDebugCommands.length; ++i) {const [name, param] = this._pendingDebugCommands[i];"push" === name ? this._debugPushGroup(param) : "pop" === name ? this._debugPopGroup() : "insert" === name ? this._debugInsertMarker(param) : void 0;}this._pendingDebugCommands.length = 0;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.dynamicBuffer.js
WebGPUEngine.prototype.updateDynamicIndexBuffer = function (indexBuffer, indices, offset = 0) {let view;view = indexBuffer.is32Bits ? indices instanceof Uint32Array ? indices : new Uint32Array(indices) : indices instanceof Uint16Array ? indices : new Uint16Array(indices), this._bufferManager.setSubData(indexBuffer, offset, view);}, WebGPUEngine.prototype.updateDynamicVertexBuffer = function (vertexBuffer, data, byteOffset, byteLength) {byteOffset === void 0 && (byteOffset = 0);let view;byteLength === void 0 ? (view = data instanceof Array ? new Float32Array(data) : data instanceof ArrayBuffer ? new Uint8Array(data) : data, byteLength = view.byteLength) : data instanceof Array ? view = new Float32Array(data) : data instanceof ArrayBuffer ? view = new Uint8Array(data) : view = data, this._bufferManager.setSubData(vertexBuffer, byteOffset, view, 0, byteLength);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.dynamicTexture.js
WebGPUEngine.prototype.updateDynamicTexture = function (texture, canvas, invertY, premulAlpha = !1, format, forceBindTexture, allowGPUOptimization) {var _a;if (!texture) return;const width = canvas.width,height = canvas.height;let gpuTextureWrapper = texture._hardwareTexture;(null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource) || (gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height)), this._textureHelper.updateTexture(canvas, texture, width, height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, allowGPUOptimization), texture.generateMipMaps && this._generateMipmaps(texture, this._uploadEncoder), texture.isReady = !0;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuExternalTexture.js
class WebGPUExternalTexture extends ExternalTexture {constructor(video) {super(video);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.externalTexture.js
Materials_effect/* Effect.prototype.setExternalTexture */.Q.prototype.setExternalTexture = function (name, texture) {this._engine.setExternalTexture(name, texture);}, WebGPUEngine.prototype.createExternalTexture = function (video) {const texture = new WebGPUExternalTexture(video);return texture;}, WebGPUEngine.prototype.setExternalTexture = function (name, texture) {return texture ? void this._setInternalTexture(name, texture) : void this._currentMaterialContext.setTexture(name, null);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.multiRender.js
WebGPUEngine.prototype.unBindMultiColorAttachmentFramebuffer = function (rtWrapper, disableGenerateMipMaps = !1, onBeforeUnbind) {onBeforeUnbind && onBeforeUnbind();const attachments = rtWrapper._attachments,count = attachments.length;this._currentRenderPass && this._currentRenderPass !== this._mainRenderPassWrapper.renderPass && this._endRenderTargetRenderPass();for (let i = 0; i < count; i++) {const texture = rtWrapper.textures[i];!texture.generateMipMaps || disableGenerateMipMaps || texture.isCube || this._generateMipmaps(texture);}this._currentRenderTarget = null, this._mrtAttachments = [], this._cacheRenderPipeline.setMRT([]), this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments), this._currentRenderPass = this._mainRenderPassWrapper.renderPass, this._setDepthTextureFormat(this._mainRenderPassWrapper), this._setColorFormat(this._mainRenderPassWrapper);}, WebGPUEngine.prototype.createMultipleRenderTarget = function (size, options, initializeBuffers) {var _a;let generateMipMaps = !1,generateDepthBuffer = !0,generateStencilBuffer = !1,generateDepthTexture = !1,depthTextureFormat = 15,textureCount = 1;let types = [],samplingModes = [],useSRGBBuffers = [];const rtWrapper = this._createHardwareRenderTargetWrapper(!0, !1, size);void 0 !== options && (generateMipMaps = void 0 !== options.generateMipMaps && options.generateMipMaps, generateDepthBuffer = void 0 === options.generateDepthBuffer || options.generateDepthBuffer, generateStencilBuffer = void 0 !== options.generateStencilBuffer && options.generateStencilBuffer, generateDepthTexture = void 0 !== options.generateDepthTexture && options.generateDepthTexture, textureCount = options.textureCount || 1, depthTextureFormat = null !== (_a = options.depthTextureFormat) && void 0 !== _a ? _a : 15, options.types && (types = options.types), options.samplingModes && (samplingModes = options.samplingModes), options.useSRGBBuffers && (useSRGBBuffers = options.useSRGBBuffers));const width = size.width || size,height = size.height || size;let depthStencilTexture = null;(generateDepthBuffer || generateStencilBuffer || generateDepthTexture) && (depthStencilTexture = rtWrapper.createDepthStencilTexture(0, !1, generateStencilBuffer, 1, depthTextureFormat));const textures = [],attachments = [],defaultAttachments = [];rtWrapper._generateDepthBuffer = generateDepthBuffer, rtWrapper._generateStencilBuffer = generateStencilBuffer, rtWrapper._attachments = attachments, rtWrapper._defaultAttachments = defaultAttachments;for (let i = 0; i < textureCount; i++) {let samplingMode = samplingModes[i] || 3,type = types[i] || 0;const useSRGBBuffer = useSRGBBuffers[i] || !1;1 !== type || this._caps.textureFloatLinearFiltering ? 2 === type && !this._caps.textureHalfFloatLinearFiltering && (samplingMode = 1) : samplingMode = 1, 1 !== type || this._caps.textureFloat || (type = 0, logger/* Logger.Warn */.Y.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.MultiRenderTarget */.S.MultiRenderTarget);textures.push(texture), attachments.push(i + 1), defaultAttachments.push(initializeBuffers ? i + 1 : 0 === i ? 1 : 0), texture.baseWidth = width, texture.baseHeight = height, texture.width = width, texture.height = height, texture.isReady = !0, texture.samples = 1, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.type = type, texture._cachedWrapU = 0, texture._cachedWrapV = 0, texture._useSRGBBuffer = useSRGBBuffer, this._internalTexturesCache.push(texture), this._textureHelper.createGPUTextureForInternalTexture(texture);}return depthStencilTexture && (depthStencilTexture.incrementReferences(), textures.push(depthStencilTexture), this._internalTexturesCache.push(depthStencilTexture)), rtWrapper.setTextures(textures), rtWrapper;}, WebGPUEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function (rtWrapper, samples) {if (!rtWrapper || !rtWrapper.textures || rtWrapper.textures[0].samples === samples) return samples;const count = rtWrapper.textures.length;if (0 === count) return 1;samples = Math.min(samples, this.getCaps().maxMSAASamples);for (let i = 0; i < count; ++i) {const texture = rtWrapper.textures[i];this._textureHelper.createMSAATexture(texture, samples), texture.samples = samples;}return rtWrapper._depthStencilTexture && rtWrapper._depthStencilTexture !== rtWrapper.textures[rtWrapper.textures.length - 1] && (this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples), rtWrapper._depthStencilTexture.samples = samples), samples;}, WebGPUEngine.prototype.bindAttachments = function (attachments) {0 !== attachments.length && this._currentRenderTarget && (this._mrtAttachments = attachments, this._currentRenderPass && this._cacheRenderPipeline.setMRTAttachments(attachments));}, WebGPUEngine.prototype.buildTextureLayout = function (textureStatus) {const result = [];for (let i = 0; i < textureStatus.length; i++) textureStatus[i] ? result.push(i + 1) : result.push(0);return result;}, WebGPUEngine.prototype.restoreSingleAttachment = function () {}, WebGPUEngine.prototype.restoreSingleAttachmentForRenderTarget = function () {};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.query.js
WebGPUEngine.prototype.getGPUFrameTimeCounter = function () {return this._timestampQuery.gpuFrameTimeCounter;}, WebGPUEngine.prototype.captureGPUFrameTime = function (value) {this._timestampQuery.enable = value && !!this._caps.timerQuery;}, WebGPUEngine.prototype.createQuery = function () {return this._occlusionQuery.createQuery();}, WebGPUEngine.prototype.deleteQuery = function (query) {return this._occlusionQuery.deleteQuery(query), this;}, WebGPUEngine.prototype.isQueryResultAvailable = function (query) {return this._occlusionQuery.isQueryResultAvailable(query);}, WebGPUEngine.prototype.getQueryResult = function (query) {return this._occlusionQuery.getQueryResult(query);}, WebGPUEngine.prototype.beginOcclusionQuery = function (algorithmType, query) {var _a;if (!this.compatibilityMode) {const renderPassIndex = this._getCurrentRenderPassIndex(),bundleList = 0 === renderPassIndex ? this._bundleList : this._bundleListRenderTarget;return bundleList.addItem(new WebGPURenderItemBeginOcclusionQuery(query)), !0;}return !!this._occlusionQuery.canBeginQuery && (null === (_a = this._currentRenderPass) || void 0 === _a ? void 0 : _a.beginOcclusionQuery(query), !0);}, WebGPUEngine.prototype.endOcclusionQuery = function () {var _a;if (this.compatibilityMode) null === (_a = this._currentRenderPass) || void 0 === _a ? void 0 : _a.endOcclusionQuery();else {const renderPassIndex = this._getCurrentRenderPassIndex(),bundleList = 0 === renderPassIndex ? this._bundleList : this._bundleListRenderTarget;bundleList.addItem(new WebGPURenderItemEndOcclusionQuery());}return this;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture.js
WebGPUEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = !1) {const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Raw */.S.Raw);return texture.baseWidth = width, texture.baseHeight = height, texture.width = width, texture.height = height, texture.format = format, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.invertY = invertY, texture._compression = compression, texture.type = type, texture._useSRGBBuffer = useSRGBBuffer, this._doNotHandleContextLost || (texture._bufferView = data), this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, void 0, creationFlags), this.updateRawTexture(texture, data, format, invertY, compression, type, useSRGBBuffer), this._internalTexturesCache.push(texture), texture;}, WebGPUEngine.prototype.updateRawTexture = function (texture, bufferView, format, invertY, compression = null, type = 0, useSRGBBuffer = !1) {if (texture) {if (this._doNotHandleContextLost || (texture._bufferView = bufferView, texture.invertY = invertY, texture._compression = compression, texture._useSRGBBuffer = useSRGBBuffer), bufferView) {const gpuTextureWrapper = texture._hardwareTexture;4 === format && (bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, type));const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, !1, 0, 0), texture.generateMipMaps && this._generateMipmaps(texture, this._uploadEncoder);}texture.isReady = !0;}}, WebGPUEngine.prototype.createRawCubeTexture = function (data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) {const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.CubeRaw */.S.CubeRaw);return 1 !== type || this._caps.textureFloatLinearFiltering ? 2 !== type || this._caps.textureHalfFloatLinearFiltering ? 1 !== type || this._caps.textureFloatRender ? 2 === type && !this._caps.colorBufferFloat && (generateMipMaps = !1, logger/* Logger.Warn */.Y.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")) : (generateMipMaps = !1, logger/* Logger.Warn */.Y.Warn("Render to float textures is not supported. Mipmap generation forced to false.")) : (generateMipMaps = !1, samplingMode = 1, logger/* Logger.Warn */.Y.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")) : (generateMipMaps = !1, samplingMode = 1, logger/* Logger.Warn */.Y.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")), texture.isCube = !0, texture.format = 4 === format ? 5 : format, texture.type = type, texture.generateMipMaps = generateMipMaps, texture.width = size, texture.height = size, texture.samplingMode = samplingMode, this._doNotHandleContextLost || (texture._bufferViewArray = data), texture.invertY = invertY, texture._compression = compression, texture._cachedWrapU = 0, texture._cachedWrapV = 0, this._textureHelper.createGPUTextureForInternalTexture(texture), data && this.updateRawCubeTexture(texture, data, format, type, invertY, compression), texture.isReady = !0, texture;}, WebGPUEngine.prototype.updateRawCubeTexture = function (texture, bufferView, format, type, invertY, compression = null) {texture._bufferViewArray = bufferView, texture.invertY = invertY, texture._compression = compression;const gpuTextureWrapper = texture._hardwareTexture,data = [];for (let faceData, i = 0; i < bufferView.length; ++i) faceData = bufferView[i], 4 === format && (faceData = _convertRGBtoRGBATextureData(bufferView[i], texture.width, texture.height, type)), data.push(new Uint8Array(faceData.buffer, faceData.byteOffset, faceData.byteLength));this._textureHelper.updateCubeTextures(data, gpuTextureWrapper.underlyingResource, texture.width, texture.height, gpuTextureWrapper.format, invertY, !1, 0, 0), texture.generateMipMaps && this._generateMipmaps(texture, this._uploadEncoder), texture.isReady = !0;}, WebGPUEngine.prototype.createRawCubeTextureFromUrl = function (url, scene, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = 3, invertY = !1) {const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);null === scene || void 0 === scene ? void 0 : scene.addPendingData(texture), texture.url = url, this._internalTexturesCache.push(texture);const internalCallback = (data) => {const width = texture.width,faceDataArrays = callback(data);if (faceDataArrays) {const faces = [0, 2, 4, 1, 3, 5];if (mipmapGenerator) {const mipData = mipmapGenerator(faceDataArrays),gpuTextureWrapper = texture._hardwareTexture,faces = [0, 1, 2, 3, 4, 5];for (let level = 0; level < mipData.length; level++) {const mipSize = width >> level,allFaces = [];for (let mipFaceData, faceIndex = 0; 6 > faceIndex; faceIndex++) mipFaceData = mipData[level][faces[faceIndex]], 4 === format && (mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type)), allFaces.push(new Uint8Array(mipFaceData.buffer, mipFaceData.byteOffset, mipFaceData.byteLength));this._textureHelper.updateCubeTextures(allFaces, gpuTextureWrapper.underlyingResource, mipSize, mipSize, gpuTextureWrapper.format, invertY, !1, 0, 0);}} else {const allFaces = [];for (let faceIndex = 0; 6 > faceIndex; faceIndex++) allFaces.push(faceDataArrays[faces[faceIndex]]);this.updateRawCubeTexture(texture, allFaces, format, type, invertY);}texture.isReady = !0, null === scene || void 0 === scene ? void 0 : scene.removePendingData(texture), onLoad && onLoad();}};return this._loadFile(url, (data) => {internalCallback(data);}, void 0, null === scene || void 0 === scene ? void 0 : scene.offlineProvider, !0, (request, exception) => {null === scene || void 0 === scene ? void 0 : scene.removePendingData(texture), onError && request && onError(request.status + " " + request.statusText, exception);}), texture;}, WebGPUEngine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0, creationFlags = 0) {const source = Textures_internalTexture/* InternalTextureSource.Raw3D */.S.Raw3D,texture = new Textures_internalTexture/* InternalTexture */.l(this, source);return texture.baseWidth = width, texture.baseHeight = height, texture.baseDepth = depth, texture.width = width, texture.height = height, texture.depth = depth, texture.format = format, texture.type = textureType, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.is3D = !0, this._doNotHandleContextLost || (texture._bufferView = data), this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, void 0, creationFlags), this.updateRawTexture3D(texture, data, format, invertY, compression, textureType), this._internalTexturesCache.push(texture), texture;}, WebGPUEngine.prototype.updateRawTexture3D = function (texture, bufferView, format, invertY, compression = null, textureType = 0) {if (this._doNotHandleContextLost || (texture._bufferView = bufferView, texture.format = format, texture.invertY = invertY, texture._compression = compression), bufferView) {const gpuTextureWrapper = texture._hardwareTexture;4 === format && (bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType));const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, !1, 0, 0), texture.generateMipMaps && this._generateMipmaps(texture, this._uploadEncoder);}texture.isReady = !0;}, WebGPUEngine.prototype.createRawTexture2DArray = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0, creationFlags = 0) {const source = Textures_internalTexture/* InternalTextureSource.Raw2DArray */.S.Raw2DArray,texture = new Textures_internalTexture/* InternalTexture */.l(this, source);return texture.baseWidth = width, texture.baseHeight = height, texture.baseDepth = depth, texture.width = width, texture.height = height, texture.depth = depth, texture.format = format, texture.type = textureType, texture.generateMipMaps = generateMipMaps, texture.samplingMode = samplingMode, texture.is2DArray = !0, this._doNotHandleContextLost || (texture._bufferView = data), this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags), this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType), this._internalTexturesCache.push(texture), texture;}, WebGPUEngine.prototype.updateRawTexture2DArray = function (texture, bufferView, format, invertY, compression = null, textureType = 0) {if (this._doNotHandleContextLost || (texture._bufferView = bufferView, texture.format = format, texture.invertY = invertY, texture._compression = compression), bufferView) {const gpuTextureWrapper = texture._hardwareTexture;4 === format && (bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType));const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, !1, 0, 0), texture.generateMipMaps && this._generateMipmaps(texture, this._uploadEncoder);}texture.isReady = !0;};function _convertRGBtoRGBATextureData(rgbData, width, height, textureType) {let rgbaData,val1 = 1;1 === textureType ? rgbaData = new Float32Array(4 * (width * height)) : 2 === textureType ? (rgbaData = new Uint16Array(4 * (width * height)), val1 = 15360) : 7 === textureType ? rgbaData = new Uint32Array(4 * (width * height)) : rgbaData = new Uint8Array(4 * (width * height));for (let x = 0; x < width; x++) for (let y = 0; y < height; y++) {const index = 3 * (y * width + x),newIndex = 4 * (y * width + x);rgbaData[newIndex + 0] = rgbData[index + 0], rgbaData[newIndex + 1] = rgbData[index + 1], rgbaData[newIndex + 2] = rgbData[index + 2], rgbaData[newIndex + 3] = val1;}return rgbaData;}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.readTexture.js
WebGPUEngine.prototype._readTexturePixels = function (texture, width, height, faceIndex = -1, level = 0, buffer = null, flushRenderer = !0, noDataConversion = !1, x = 0, y = 0) {const gpuTextureWrapper = texture._hardwareTexture;return flushRenderer && this.flushFramebuffer(), this._textureHelper.readPixels(gpuTextureWrapper.underlyingResource, x, y, width, height, gpuTextureWrapper.format, faceIndex, level, buffer, noDataConversion);}, WebGPUEngine.prototype._readTexturePixelsSync = function () {throw "_readTexturePixelsSync is unsupported in WebGPU!";};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuRenderTargetWrapper.js
class WebGPURenderTargetWrapper extends renderTargetWrapper/* RenderTargetWrapper */.r {}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.renderTarget.js
WebGPUEngine.prototype._createHardwareRenderTargetWrapper = function (isMulti, isCube, size) {const rtWrapper = new WebGPURenderTargetWrapper(isMulti, isCube, size, this);return this._renderTargetWrapperCache.push(rtWrapper), rtWrapper;}, WebGPUEngine.prototype.createRenderTargetTexture = function (size, options) {var _a, _b;const rtWrapper = this._createHardwareRenderTargetWrapper(!1, !1, size),fullOptions = {};void 0 !== options && "object" == typeof options ? (fullOptions.generateMipMaps = options.generateMipMaps, fullOptions.generateDepthBuffer = void 0 === options.generateDepthBuffer || options.generateDepthBuffer, fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer, fullOptions.samplingMode = void 0 === options.samplingMode ? 3 : options.samplingMode, fullOptions.creationFlags = null !== (_a = options.creationFlags) && void 0 !== _a ? _a : 0, fullOptions.noColorAttachment = !!options.noColorAttachment, fullOptions.samples = options.samples) : (fullOptions.generateMipMaps = options, fullOptions.generateDepthBuffer = !0, fullOptions.generateStencilBuffer = !1, fullOptions.samplingMode = 3, fullOptions.creationFlags = 0, fullOptions.noColorAttachment = !1);const texture = fullOptions.noColorAttachment ? null : this._createInternalTexture(size, options, !0, Textures_internalTexture/* InternalTextureSource.RenderTarget */.S.RenderTarget);return rtWrapper._samples = null !== (_b = fullOptions.samples) && void 0 !== _b ? _b : 1, rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer, rtWrapper._generateStencilBuffer = !!fullOptions.generateStencilBuffer, rtWrapper.setTextures(texture), (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) && rtWrapper.createDepthStencilTexture(0, this._caps.textureFloatLinearFiltering && (void 0 === fullOptions.samplingMode || 2 === fullOptions.samplingMode || 2 === fullOptions.samplingMode || 3 === fullOptions.samplingMode || 3 === fullOptions.samplingMode || 5 === fullOptions.samplingMode || 6 === fullOptions.samplingMode || 7 === fullOptions.samplingMode || 11 === fullOptions.samplingMode), rtWrapper._generateStencilBuffer, rtWrapper.samples, fullOptions.generateStencilBuffer ? 13 : 14), texture && (void 0 !== options && "object" == typeof options && options.createMipMaps && !fullOptions.generateMipMaps && (texture.generateMipMaps = !0), this._textureHelper.createGPUTextureForInternalTexture(texture, void 0, void 0, void 0, fullOptions.creationFlags), void 0 !== options && "object" == typeof options && options.createMipMaps && !fullOptions.generateMipMaps && (texture.generateMipMaps = !1)), rtWrapper;}, WebGPUEngine.prototype._createDepthStencilTexture = function (size, options) {const internalTexture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.DepthStencil */.S.DepthStencil),internalOptions = { bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1, samples: 1, depthTextureFormat: options.generateStencil ? 13 : 14, ...options };return internalTexture.format = internalOptions.depthTextureFormat, this._setupDepthStencilTexture(internalTexture, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples), this._textureHelper.createGPUTextureForInternalTexture(internalTexture), this._internalTexturesCache.push(internalTexture), internalTexture;}, WebGPUEngine.prototype._setupDepthStencilTexture = function (internalTexture, size, generateStencil, bilinearFiltering, comparisonFunction, samples = 1) {const width = size.width || size,height = size.height || size,layers = size.layers || 0;internalTexture.baseWidth = width, internalTexture.baseHeight = height, internalTexture.width = width, internalTexture.height = height, internalTexture.is2DArray = 0 < layers, internalTexture.depth = layers, internalTexture.isReady = !0, internalTexture.samples = samples, internalTexture.generateMipMaps = !1, internalTexture.samplingMode = bilinearFiltering ? 2 : 1, internalTexture.type = 1, internalTexture._comparisonFunction = comparisonFunction, internalTexture._cachedWrapU = 0, internalTexture._cachedWrapV = 0;}, WebGPUEngine.prototype.updateRenderTargetTextureSampleCount = function (rtWrapper, samples) {return rtWrapper && rtWrapper.texture && rtWrapper.samples !== samples ? (samples = Math.min(samples, this.getCaps().maxMSAASamples), this._textureHelper.createMSAATexture(rtWrapper.texture, samples), rtWrapper._depthStencilTexture && (this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples), rtWrapper._depthStencilTexture.samples = samples), rtWrapper._samples = samples, rtWrapper.texture.samples = samples, samples) : samples;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.renderTargetCube.js
WebGPUEngine.prototype.createRenderTargetCubeTexture = function (size, options) {const rtWrapper = this._createHardwareRenderTargetWrapper(!1, !0, size),fullOptions = { generateMipMaps: !0, generateDepthBuffer: !0, generateStencilBuffer: !1, type: 0, samplingMode: 3, format: 5, samples: 1, ...options };fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer, rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer, rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer;const texture = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.RenderTarget */.S.RenderTarget);return texture.width = size, texture.height = size, texture.depth = 0, texture.isReady = !0, texture.isCube = !0, texture.samples = fullOptions.samples, texture.generateMipMaps = fullOptions.generateMipMaps, texture.samplingMode = fullOptions.samplingMode, texture.type = fullOptions.type, texture.format = fullOptions.format, this._internalTexturesCache.push(texture), rtWrapper.setTextures(texture), (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) && rtWrapper.createDepthStencilTexture(0, void 0 === fullOptions.samplingMode || 2 === fullOptions.samplingMode || 2 === fullOptions.samplingMode || 3 === fullOptions.samplingMode || 3 === fullOptions.samplingMode || 5 === fullOptions.samplingMode || 6 === fullOptions.samplingMode || 7 === fullOptions.samplingMode || 11 === fullOptions.samplingMode, rtWrapper._generateStencilBuffer, rtWrapper.samples), options && options.createMipMaps && !fullOptions.generateMipMaps && (texture.generateMipMaps = !0), this._textureHelper.createGPUTextureForInternalTexture(texture), options && options.createMipMaps && !fullOptions.generateMipMaps && (texture.generateMipMaps = !1), rtWrapper;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.textureSampler.js
Materials_effect/* Effect.prototype.setTextureSampler */.Q.prototype.setTextureSampler = function (name, sampler) {this._engine.setTextureSampler(name, sampler);}, WebGPUEngine.prototype.setTextureSampler = function (name, sampler) {var _a;null === (_a = this._currentMaterialContext) || void 0 === _a ? void 0 : _a.setSampler(name, sampler);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.storageBuffer.js
Materials_effect/* Effect.prototype.setStorageBuffer */.Q.prototype.setStorageBuffer = function (name, buffer) {this._engine.setStorageBuffer(name, buffer);}, WebGPUEngine.prototype.createStorageBuffer = function (data, creationFlags) {return this._createBuffer(data, 32 | creationFlags);}, WebGPUEngine.prototype.updateStorageBuffer = function (buffer, data, byteOffset, byteLength) {byteOffset === void 0 && (byteOffset = 0);let view;byteLength === void 0 ? (view = data instanceof Array ? new Float32Array(data) : data instanceof ArrayBuffer ? new Uint8Array(data) : data, byteLength = view.byteLength) : data instanceof Array ? view = new Float32Array(data) : data instanceof ArrayBuffer ? view = new Uint8Array(data) : view = data, this._bufferManager.setSubData(buffer, byteOffset, view, 0, byteLength);}, WebGPUEngine.prototype.readFromStorageBuffer = function (storageBuffer, offset, size, buffer) {size = size || storageBuffer.capacity;const gpuBuffer = this._bufferManager.createRawBuffer(size, BufferUsage.MapRead | BufferUsage.CopyDst);return this._renderTargetEncoder.copyBufferToBuffer(storageBuffer.underlyingResource, null !== offset && void 0 !== offset ? offset : 0, gpuBuffer, 0, size), new Promise((resolve, reject) => {this.onEndFrameObservable.addOnce(() => {gpuBuffer.mapAsync(MapMode.Read, 0, size).then(() => {const copyArrayBuffer = gpuBuffer.getMappedRange(0, size);let data = buffer;if (void 0 === data) data = new Uint8Array(size), data.set(new Uint8Array(copyArrayBuffer));else {const ctor = data.constructor;data = new ctor(data.buffer), data.set(new ctor(copyArrayBuffer));}gpuBuffer.unmap(), this._bufferManager.releaseBuffer(gpuBuffer), resolve(data);}, (reason) => reject(reason));});});}, WebGPUEngine.prototype.setStorageBuffer = function (name, buffer) {var _a, _b;null === (_a = this._currentDrawContext) || void 0 === _a ? void 0 : _a.setBuffer(name, null !== (_b = null === buffer || void 0 === buffer ? void 0 : buffer.getBuffer()) && void 0 !== _b ? _b : null);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.uniformBuffer.js
WebGPUEngine.prototype.createUniformBuffer = function (elements) {let view = elements instanceof Array ? new Float32Array(elements) : elements;const dataBuffer = this._bufferManager.createBuffer(view, BufferUsage.Uniform | BufferUsage.CopyDst);return dataBuffer;}, WebGPUEngine.prototype.createDynamicUniformBuffer = function (elements) {return this.createUniformBuffer(elements);}, WebGPUEngine.prototype.updateUniformBuffer = function (uniformBuffer, elements, offset, count) {offset === void 0 && (offset = 0);let view;count === void 0 ? (view = elements instanceof Float32Array ? elements : new Float32Array(elements), count = view.byteLength) : elements instanceof Float32Array ? view = elements : view = new Float32Array(elements), this._bufferManager.setSubData(uniformBuffer, offset, view, 0, count);}, WebGPUEngine.prototype.bindUniformBufferBase = function (buffer, location, name) {this._currentDrawContext.setBuffer(name, buffer);}, WebGPUEngine.prototype.bindUniformBlock = function () {};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.videoTexture.js
function IsExternalTexture(texture) {return !!(texture && texture.underlyingResource !== void 0);}WebGPUEngine.prototype.updateVideoTexture = function (texture, video, invertY) {var _a;if (!texture || texture._isDisabled) return;this._videoTextureSupported === void 0 && (this._videoTextureSupported = !0);let gpuTextureWrapper = texture._hardwareTexture;(null === (_a = texture._hardwareTexture) || void 0 === _a ? void 0 : _a.underlyingResource) || (gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture)), IsExternalTexture(video) ? (this._textureHelper.copyVideoToTexture(video, texture, gpuTextureWrapper.format, !invertY), texture.generateMipMaps && this._generateMipmaps(texture, this._uploadEncoder), texture.isReady = !0) : video && this.createImageBitmap(video).then((bitmap) => {this._textureHelper.updateTexture(bitmap, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, !invertY, !1, 0, 0), texture.generateMipMaps && this._generateMipmaps(texture, this._uploadEncoder), texture.isReady = !0;}).catch(() => {texture.isReady = !0;});};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/IPipelineContext.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/ICanvas.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGLPipelineContext.js
var webGLPipelineContext = __webpack_require__("./node_modules/@babylonjs/core/Engines/WebGL/webGLPipelineContext.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/engineFeatures.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/engineFactory.js
class EngineFactory {static CreateAsync(canvas, options) {return WebGPUEngine.IsSupportedAsync.then((supported) => {if (supported) return WebGPUEngine.CreateAsync(canvas, options);return engine/* Engine.IsSupported */.D.IsSupported ? new Promise((resolve) => {resolve(new engine/* Engine */.D(canvas, void 0, options));}) : new Promise((resolve) => {resolve(new NullEngine(options));});});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/IMaterialContext.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/IDrawContext.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/Processors/iShaderProcessor.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Engines/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Events/clipboardEvents.js
class ClipboardEventTypes {}ClipboardEventTypes.COPY = 1, ClipboardEventTypes.CUT = 2, ClipboardEventTypes.PASTE = 3;class ClipboardInfo {constructor(type, event) {this.type = type, this.event = event;}static GetTypeFromCharacter(keyCode) {const charCode = keyCode;return 67 === charCode ? ClipboardEventTypes.COPY : 86 === charCode ? ClipboardEventTypes.PASTE : 88 === charCode ? ClipboardEventTypes.CUT : -1;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Events/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/Controllers/daydreamController.js
class DaydreamController extends WebVRController {constructor(vrGamepad) {super(vrGamepad), this.controllerType = PoseEnabledControllerType.DAYDREAM;}initControllerMesh(scene, meshLoaded) {sceneLoader/* SceneLoader.ImportMesh */.n.ImportMesh("", DaydreamController.MODEL_BASE_URL, DaydreamController.MODEL_FILENAME, scene, (newMeshes) => {this._defaultModel = newMeshes[1], this.attachToMesh(this._defaultModel), meshLoaded && meshLoaded(this._defaultModel);});}_handleButtonChange(buttonIdx, state) {if (0 === buttonIdx) {const observable = this.onTriggerStateChangedObservable;observable && observable.notifyObservers(state);} else logger/* Logger.Warn */.Y.Warn(`Unrecognized Daydream button index: ${buttonIdx}`);}}DaydreamController.MODEL_BASE_URL = "https://controllers.babylonjs.com/generic/", DaydreamController.MODEL_FILENAME = "generic.babylon", DaydreamController.GAMEPAD_ID_PREFIX = "Daydream", PoseEnabledControllerHelper._ControllerFactories.push({ canCreate: (gamepadInfo) => 0 === gamepadInfo.id.indexOf(DaydreamController.GAMEPAD_ID_PREFIX), create: (gamepadInfo) => new DaydreamController(gamepadInfo) });
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/Controllers/gearVRController.js
class GearVRController extends WebVRController {constructor(vrGamepad) {super(vrGamepad), this._buttonIndexToObservableNameMap = ["onPadStateChangedObservable", "onTriggerStateChangedObservable"], this.controllerType = PoseEnabledControllerType.GEAR_VR, this._calculatedPosition = new math_vector/* Vector3 */.P("left" == this.hand ? -.15 : .15, -.5, .25), this._disableTrackPosition(this._calculatedPosition);}initControllerMesh(scene, meshLoaded) {sceneLoader/* SceneLoader.ImportMesh */.n.ImportMesh("", GearVRController.MODEL_BASE_URL, GearVRController.MODEL_FILENAME, scene, (newMeshes) => {const mesh = new Meshes_mesh/* Mesh */.Kj("", scene);newMeshes[1].parent = mesh, newMeshes[1].position.z = -.15, this._defaultModel = mesh, this.attachToMesh(this._defaultModel), meshLoaded && meshLoaded(this._defaultModel);});}_handleButtonChange(buttonIdx, state) {if (buttonIdx < this._buttonIndexToObservableNameMap.length) {const observableName = this._buttonIndexToObservableNameMap[buttonIdx],observable = this[observableName];observable && observable.notifyObservers(state);}}}GearVRController.MODEL_BASE_URL = "https://controllers.babylonjs.com/generic/", GearVRController.MODEL_FILENAME = "generic.babylon", GearVRController.GAMEPAD_ID_PREFIX = "Gear VR", PoseEnabledControllerHelper._ControllerFactories.push({ canCreate: (gamepadInfo) => 0 === gamepadInfo.id.indexOf(GearVRController.GAMEPAD_ID_PREFIX) || -1 !== gamepadInfo.id.indexOf("Oculus Go") || -1 !== gamepadInfo.id.indexOf("Vive Focus"), create: (gamepadInfo) => new GearVRController(gamepadInfo) });
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/Controllers/genericController.js
class GenericController extends WebVRController {constructor(vrGamepad) {super(vrGamepad);}initControllerMesh(scene, meshLoaded) {sceneLoader/* SceneLoader.ImportMesh */.n.ImportMesh("", GenericController.MODEL_BASE_URL, GenericController.MODEL_FILENAME, scene, (newMeshes) => {this._defaultModel = newMeshes[1], this.attachToMesh(this._defaultModel), meshLoaded && meshLoaded(this._defaultModel);});}_handleButtonChange(buttonIdx, state) {console.log("Button id: " + buttonIdx + "state: "), console.dir(state);}}GenericController.MODEL_BASE_URL = "https://controllers.babylonjs.com/generic/", GenericController.MODEL_FILENAME = "generic.babylon", PoseEnabledControllerHelper._DefaultControllerFactory = (gamepadInfo) => new GenericController(gamepadInfo);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/Controllers/oculusTouchController.js
class OculusTouchController extends WebVRController {constructor(vrGamepad) {super(vrGamepad), this.onSecondaryTriggerStateChangedObservable = new observable/* Observable */.y$(), this.onThumbRestChangedObservable = new observable/* Observable */.y$(), this.controllerType = PoseEnabledControllerType.OCULUS;}initControllerMesh(scene, meshLoaded) {let meshName;meshName = "left" === this.hand ? OculusTouchController.MODEL_LEFT_FILENAME : OculusTouchController.MODEL_RIGHT_FILENAME, sceneLoader/* SceneLoader.ImportMesh */.n.ImportMesh("", OculusTouchController._IsQuest ? OculusTouchController.QUEST_MODEL_BASE_URL : OculusTouchController.MODEL_BASE_URL, meshName, scene, (newMeshes) => {this._defaultModel = OculusTouchController._IsQuest ? newMeshes[0] : newMeshes[1], this.attachToMesh(this._defaultModel), meshLoaded && meshLoaded(this._defaultModel);});}get onAButtonStateChangedObservable() {if ("right" === this.hand) return this.onMainButtonStateChangedObservable;throw new Error("No A button on left hand");}get onBButtonStateChangedObservable() {if ("right" === this.hand) return this.onSecondaryButtonStateChangedObservable;throw new Error("No B button on left hand");}get onXButtonStateChangedObservable() {if ("left" === this.hand) return this.onMainButtonStateChangedObservable;throw new Error("No X button on right hand");}get onYButtonStateChangedObservable() {if ("left" === this.hand) return this.onSecondaryButtonStateChangedObservable;throw new Error("No Y button on right hand");}_handleButtonChange(buttonIdx, state) {const notifyObject = state,triggerDirection = "right" === this.hand ? -1 : 1;return 0 === buttonIdx ? void this.onPadStateChangedObservable.notifyObservers(notifyObject) : 1 === buttonIdx ? (!OculusTouchController._IsQuest && this._defaultModel && (this._defaultModel.getChildren()[3].rotation.x = .2 * -notifyObject.value, this._defaultModel.getChildren()[3].position.y = .005 * -notifyObject.value, this._defaultModel.getChildren()[3].position.z = .005 * -notifyObject.value), void this.onTriggerStateChangedObservable.notifyObservers(notifyObject)) : 2 === buttonIdx ? (!OculusTouchController._IsQuest && this._defaultModel && (this._defaultModel.getChildren()[4].position.x = .0035 * (triggerDirection * notifyObject.value)), void this.onSecondaryTriggerStateChangedObservable.notifyObservers(notifyObject)) : 3 === buttonIdx ? (!OculusTouchController._IsQuest && this._defaultModel && (notifyObject.pressed ? this._defaultModel.getChildren()[1].position.y = -.001 : this._defaultModel.getChildren()[1].position.y = 0), void this.onMainButtonStateChangedObservable.notifyObservers(notifyObject)) : 4 === buttonIdx ? (!OculusTouchController._IsQuest && this._defaultModel && (notifyObject.pressed ? this._defaultModel.getChildren()[2].position.y = -.001 : this._defaultModel.getChildren()[2].position.y = 0), void this.onSecondaryButtonStateChangedObservable.notifyObservers(notifyObject)) : 5 === buttonIdx ? void this.onThumbRestChangedObservable.notifyObservers(notifyObject) : void 0;}}OculusTouchController.MODEL_BASE_URL = "https://controllers.babylonjs.com/oculus/", OculusTouchController.MODEL_LEFT_FILENAME = "left.babylon", OculusTouchController.MODEL_RIGHT_FILENAME = "right.babylon", OculusTouchController.QUEST_MODEL_BASE_URL = "https://controllers.babylonjs.com/oculusQuest/", OculusTouchController._IsQuest = !1, PoseEnabledControllerHelper._ControllerFactories.push({ canCreate: (gamepadInfo) => (engineStore/* EngineStore.LastCreatedEngine */.l.LastCreatedEngine && engineStore/* EngineStore.LastCreatedEngine._vrDisplay */.l.LastCreatedEngine._vrDisplay && "Oculus Quest" === engineStore/* EngineStore.LastCreatedEngine._vrDisplay.displayName */.l.LastCreatedEngine._vrDisplay.displayName && (OculusTouchController._IsQuest = !0), -1 !== gamepadInfo.id.indexOf("Oculus Touch")), create: (gamepadInfo) => new OculusTouchController(gamepadInfo) });
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/Controllers/viveController.js
class ViveController extends WebVRController {constructor(vrGamepad) {super(vrGamepad), this.controllerType = PoseEnabledControllerType.VIVE, this._invertLeftStickY = !0;}initControllerMesh(scene, meshLoaded) {sceneLoader/* SceneLoader.ImportMesh */.n.ImportMesh("", ViveController.MODEL_BASE_URL, ViveController.MODEL_FILENAME, scene, (newMeshes) => {this._defaultModel = newMeshes[1], this.attachToMesh(this._defaultModel), meshLoaded && meshLoaded(this._defaultModel);});}get onLeftButtonStateChangedObservable() {return this.onMainButtonStateChangedObservable;}get onRightButtonStateChangedObservable() {return this.onMainButtonStateChangedObservable;}get onMenuButtonStateChangedObservable() {return this.onSecondaryButtonStateChangedObservable;}_handleButtonChange(buttonIdx, state) {const notifyObject = state;return 0 === buttonIdx ? void this.onPadStateChangedObservable.notifyObservers(notifyObject) : 1 === buttonIdx ? (this._defaultModel && (this._defaultModel.getChildren()[6].rotation.x = .15 * -notifyObject.value), void this.onTriggerStateChangedObservable.notifyObservers(notifyObject)) : 2 === buttonIdx ? void this.onMainButtonStateChangedObservable.notifyObservers(notifyObject) : 3 === buttonIdx ? (this._defaultModel && (notifyObject.pressed ? this._defaultModel.getChildren()[2].position.y = -.001 : this._defaultModel.getChildren()[2].position.y = 0), void this.onSecondaryButtonStateChangedObservable.notifyObservers(notifyObject)) : void 0;}}ViveController.MODEL_BASE_URL = "https://controllers.babylonjs.com/vive/", ViveController.MODEL_FILENAME = "wand.babylon", PoseEnabledControllerHelper._ControllerFactories.push({ canCreate: (gamepadInfo) => -1 !== gamepadInfo.id.toLowerCase().indexOf("openvr"), create: (gamepadInfo) => new ViveController(gamepadInfo) });
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/Controllers/windowsMotionController.js
class LoadedMeshInfo {constructor() {this.buttonMeshes = {}, this.axisMeshes = {};}}class WindowsMotionController extends WebVRController {constructor(vrGamepad) {super(vrGamepad), this._mapping = { buttons: ["thumbstick", "trigger", "grip", "menu", "trackpad"], buttonMeshNames: { trigger: "SELECT", menu: "MENU", grip: "GRASP", thumbstick: "THUMBSTICK_PRESS", trackpad: "TOUCHPAD_PRESS" }, buttonObservableNames: { trigger: "onTriggerStateChangedObservable", menu: "onSecondaryButtonStateChangedObservable", grip: "onMainButtonStateChangedObservable", thumbstick: "onPadStateChangedObservable", trackpad: "onTrackpadChangedObservable" }, axisMeshNames: ["THUMBSTICK_X", "THUMBSTICK_Y", "TOUCHPAD_TOUCH_X", "TOUCHPAD_TOUCH_Y"], pointingPoseMeshName: PoseEnabledController.POINTING_POSE }, this.onTrackpadChangedObservable = new observable/* Observable */.y$(), this.onTrackpadValuesChangedObservable = new observable/* Observable */.y$(), this.trackpad = { x: 0, y: 0 }, this.controllerType = PoseEnabledControllerType.WINDOWS, this._loadedMeshInfo = null;}get onTriggerButtonStateChangedObservable() {return this.onTriggerStateChangedObservable;}get onMenuButtonStateChangedObservable() {return this.onSecondaryButtonStateChangedObservable;}get onGripButtonStateChangedObservable() {return this.onMainButtonStateChangedObservable;}get onThumbstickButtonStateChangedObservable() {return this.onPadStateChangedObservable;}get onTouchpadButtonStateChangedObservable() {return this.onTrackpadChangedObservable;}get onTouchpadValuesChangedObservable() {return this.onTrackpadValuesChangedObservable;}_updateTrackpad() {this.browserGamepad.axes && (this.browserGamepad.axes[2] != this.trackpad.x || this.browserGamepad.axes[3] != this.trackpad.y) && (this.trackpad.x = this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf("TOUCHPAD_TOUCH_X")], this.trackpad.y = this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf("TOUCHPAD_TOUCH_Y")], this.onTrackpadValuesChangedObservable.notifyObservers(this.trackpad));}update() {if (super.update(), this.browserGamepad.axes && (this._updateTrackpad(), this._loadedMeshInfo)) for (let axis = 0; axis < this._mapping.axisMeshNames.length; axis++) this._lerpAxisTransform(axis, this.browserGamepad.axes[axis]);}_handleButtonChange(buttonIdx, state) {const buttonName = this._mapping.buttons[buttonIdx];if (buttonName) {this._updateTrackpad();const observable = this[this._mapping.buttonObservableNames[buttonName]];observable && observable.notifyObservers(state), this._lerpButtonTransform(buttonName, state.value);}}_lerpButtonTransform(buttonName, buttonValue) {if (this._loadedMeshInfo) {const meshInfo = this._loadedMeshInfo.buttonMeshes[buttonName];meshInfo && meshInfo.unpressed.rotationQuaternion && meshInfo.pressed.rotationQuaternion && meshInfo.value.rotationQuaternion && (math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(meshInfo.unpressed.rotationQuaternion, meshInfo.pressed.rotationQuaternion, buttonValue, meshInfo.value.rotationQuaternion), math_vector/* Vector3.LerpToRef */.P.LerpToRef(meshInfo.unpressed.position, meshInfo.pressed.position, buttonValue, meshInfo.value.position));}}_lerpAxisTransform(axis, axisValue) {if (this._loadedMeshInfo) {const meshInfo = this._loadedMeshInfo.axisMeshes[axis];if (meshInfo && meshInfo.min.rotationQuaternion && meshInfo.max.rotationQuaternion && meshInfo.value.rotationQuaternion) {const lerpValue = .5 * axisValue + .5;math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(meshInfo.min.rotationQuaternion, meshInfo.max.rotationQuaternion, lerpValue, meshInfo.value.rotationQuaternion), math_vector/* Vector3.LerpToRef */.P.LerpToRef(meshInfo.min.position, meshInfo.max.position, lerpValue, meshInfo.value.position);}}}initControllerMesh(scene, meshLoaded, forceDefault = !1) {let path, filename;if (sceneLoader/* SceneLoader.IsPluginForExtensionAvailable */.n.IsPluginForExtensionAvailable(".glb")) {let device = "default";if (this.id && !forceDefault) {const match = this.id.match(WindowsMotionController.GAMEPAD_ID_PATTERN);device = match && match[0] || device;}filename = "left" === this.hand ? WindowsMotionController.MODEL_LEFT_FILENAME : WindowsMotionController.MODEL_RIGHT_FILENAME, path = WindowsMotionController.MODEL_BASE_URL + device + "/";} else logger/* Logger.Warn */.Y.Warn("You need to reference GLTF loader to load Windows Motion Controllers model. Falling back to generic models"), path = GenericController.MODEL_BASE_URL, filename = GenericController.MODEL_FILENAME;sceneLoader/* SceneLoader.ImportMesh */.n.ImportMesh("", path, filename, scene, (meshes) => {this._loadedMeshInfo = this._processModel(scene, meshes);this._loadedMeshInfo && (this._defaultModel = this._loadedMeshInfo.rootNode, this.attachToMesh(this._defaultModel), meshLoaded && meshLoaded(this._defaultModel));}, null, (scene, message) => {logger/* Logger.Log */.Y.Log(message), logger/* Logger.Warn */.Y.Warn("Failed to retrieve controller model from the remote server: " + path + filename), forceDefault || this.initControllerMesh(scene, meshLoaded, !0);});}_processModel(scene, meshes) {let loadedMeshInfo = null;const parentMesh = new Meshes_mesh/* Mesh */.Kj(this.id + " " + this.hand, scene);let childMesh = null;for (let i = 0; i < meshes.length; i++) {const mesh = meshes[i];if (!mesh.parent) {mesh.isPickable = !1, childMesh = mesh;break;}}return childMesh ? (childMesh.setParent(parentMesh), loadedMeshInfo = this._createMeshInfo(parentMesh)) : logger/* Logger.Warn */.Y.Warn("Could not find root node in model file."), loadedMeshInfo;}_createMeshInfo(rootNode) {function getChildByName(node, name) {return node.getChildren((n) => n.name === name, !1)[0];}function getImmediateChildByName(node, name) {return node.getChildren((n) => n.name == name, !0)[0];}const loadedMeshInfo = new LoadedMeshInfo();let i;for (loadedMeshInfo.rootNode = rootNode, loadedMeshInfo.buttonMeshes = {}, loadedMeshInfo.axisMeshes = {}, i = 0; i < this._mapping.buttons.length; i++) {const buttonMeshName = this._mapping.buttonMeshNames[this._mapping.buttons[i]];if (!buttonMeshName) {logger/* Logger.Log */.Y.Log("Skipping unknown button at index: " + i + " with mapped name: " + this._mapping.buttons[i]);continue;}const buttonMesh = getChildByName(rootNode, buttonMeshName);if (!buttonMesh) {logger/* Logger.Warn */.Y.Warn("Missing button mesh with name: " + buttonMeshName);continue;}const buttonMeshInfo = { index: i, value: getImmediateChildByName(buttonMesh, "VALUE"), pressed: getImmediateChildByName(buttonMesh, "PRESSED"), unpressed: getImmediateChildByName(buttonMesh, "UNPRESSED") };buttonMeshInfo.value && buttonMeshInfo.pressed && buttonMeshInfo.unpressed ? loadedMeshInfo.buttonMeshes[this._mapping.buttons[i]] = buttonMeshInfo : logger/* Logger.Warn */.Y.Warn("Missing button submesh under mesh with name: " + buttonMeshName + "(VALUE: " + !!buttonMeshInfo.value + ", PRESSED: " + !!buttonMeshInfo.pressed + ", UNPRESSED:" + !!buttonMeshInfo.unpressed + ")");}for (i = 0; i < this._mapping.axisMeshNames.length; i++) {const axisMeshName = this._mapping.axisMeshNames[i];if (!axisMeshName) {logger/* Logger.Log */.Y.Log("Skipping unknown axis at index: " + i);continue;}const axisMesh = getChildByName(rootNode, axisMeshName);if (!axisMesh) {logger/* Logger.Warn */.Y.Warn("Missing axis mesh with name: " + axisMeshName);continue;}const axisMeshInfo = { index: i, value: getImmediateChildByName(axisMesh, "VALUE"), min: getImmediateChildByName(axisMesh, "MIN"), max: getImmediateChildByName(axisMesh, "MAX") };axisMeshInfo.value && axisMeshInfo.min && axisMeshInfo.max ? loadedMeshInfo.axisMeshes[i] = axisMeshInfo : logger/* Logger.Warn */.Y.Warn("Missing axis submesh under mesh with name: " + axisMeshName + "(VALUE: " + !!axisMeshInfo.value + ", MIN: " + !!axisMeshInfo.min + ", MAX:" + !!axisMeshInfo.max + ")");}return loadedMeshInfo.pointingPoseNode = getChildByName(rootNode, this._mapping.pointingPoseMeshName), loadedMeshInfo.pointingPoseNode ? this._pointingPoseNode = loadedMeshInfo.pointingPoseNode : logger/* Logger.Warn */.Y.Warn("Missing pointing pose mesh with name: " + this._mapping.pointingPoseMeshName), loadedMeshInfo;}getForwardRay(length = 100) {if (!(this._loadedMeshInfo && this._loadedMeshInfo.pointingPoseNode)) return super.getForwardRay(length);const m = this._loadedMeshInfo.pointingPoseNode.getWorldMatrix(),origin = m.getTranslation(),forward = new math_vector/* Vector3 */.P(0, 0, -1),forwardWorld = math_vector/* Vector3.TransformNormal */.P.TransformNormal(forward, m),direction = math_vector/* Vector3.Normalize */.P.Normalize(forwardWorld);return new Ray(origin, direction, length);}dispose() {super.dispose(), this.onTrackpadChangedObservable.clear(), this.onTrackpadValuesChangedObservable.clear();}}WindowsMotionController.MODEL_BASE_URL = "https://controllers.babylonjs.com/microsoft/", WindowsMotionController.MODEL_LEFT_FILENAME = "left.glb", WindowsMotionController.MODEL_RIGHT_FILENAME = "right.glb", WindowsMotionController.GAMEPAD_ID_PREFIX = "Spatial Controller (Spatial Interaction Source) ", WindowsMotionController.GAMEPAD_ID_PATTERN = /([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/;class XRWindowsMotionController extends WindowsMotionController {constructor(gamepadInfo) {super(gamepadInfo), this._mapping = { buttons: ["trigger", "grip", "trackpad", "thumbstick", "menu"], buttonMeshNames: { trigger: "SELECT", menu: "MENU", grip: "GRASP", thumbstick: "THUMBSTICK_PRESS", trackpad: "TOUCHPAD_PRESS" }, buttonObservableNames: { trigger: "onTriggerStateChangedObservable", menu: "onSecondaryButtonStateChangedObservable", grip: "onMainButtonStateChangedObservable", thumbstick: "onThumbstickStateChangedObservable", trackpad: "onTrackpadChangedObservable" }, axisMeshNames: ["TOUCHPAD_TOUCH_X", "TOUCHPAD_TOUCH_Y", "THUMBSTICK_X", "THUMBSTICK_Y"], pointingPoseMeshName: PoseEnabledController.POINTING_POSE }, this.thumbstickValues = { x: 0, y: 0 }, this.onThumbstickStateChangedObservable = new observable/* Observable */.y$(), this.onThumbstickValuesChangedObservable = new observable/* Observable */.y$(), this.onTrackpadChangedObservable = this.onPadStateChangedObservable, this.onTrackpadValuesChangedObservable = this.onPadValuesChangedObservable;}get onThumbstickButtonStateChangedObservable() {return this.onThumbstickStateChangedObservable;}_updateTrackpad() {this.browserGamepad.axes && (this.browserGamepad.axes[2] != this.thumbstickValues.x || this.browserGamepad.axes[3] != this.thumbstickValues.y) && (this.trackpad.x = this.browserGamepad.axes[2], this.trackpad.y = this.browserGamepad.axes[3], this.onThumbstickValuesChangedObservable.notifyObservers(this.trackpad));}dispose() {super.dispose(), this.onThumbstickStateChangedObservable.clear(), this.onThumbstickValuesChangedObservable.clear();}}PoseEnabledControllerHelper._ControllerFactories.push({ canCreate: (gamepadInfo) => 0 === gamepadInfo.id.indexOf(WindowsMotionController.GAMEPAD_ID_PREFIX), create: (gamepadInfo) => new WindowsMotionController(gamepadInfo) });
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/Controllers/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gamepads/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/axisScaleGizmo.js
class AxisScaleGizmo extends Gizmo {get coloredMaterial() {return this._coloredMaterial;}get hoverMaterial() {return this._hoverMaterial;}get disableMaterial() {return this._disableMaterial;}constructor(dragAxis, color = math_color/* Color3.Gray */.Wo.Gray(), gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, parent = null, thickness = 1) {var _a, _b, _c, _d, _e, _f, _g;super(gizmoLayer), this._pointerObserver = null, this.snapDistance = 0, this.onSnapObservable = new observable/* Observable */.y$(), this.uniformScaling = !1, this.sensitivity = 1, this.dragScale = 1, this._isEnabled = !0, this._parent = null, this._dragging = !1, this._tmpVector = new math_vector/* Vector3 */.P(0, 0, 0), this._parent = parent, this._coloredMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._coloredMaterial.diffuseColor = color, this._coloredMaterial.specularColor = color.subtract(new math_color/* Color3 */.Wo(.1, .1, .1)), this._hoverMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._hoverMaterial.diffuseColor = math_color/* Color3.Yellow */.Wo.Yellow(), this._disableMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._disableMaterial.diffuseColor = math_color/* Color3.Gray */.Wo.Gray(), this._disableMaterial.alpha = .4, this._gizmoMesh = new Meshes_mesh/* Mesh */.Kj("axis", gizmoLayer.utilityLayerScene);const { arrowMesh, arrowTail } = this._createGizmoMesh(this._gizmoMesh, thickness),collider = this._createGizmoMesh(this._gizmoMesh, thickness + 4, !0);this._gizmoMesh.lookAt(this._rootMesh.position.add(dragAxis)), this._rootMesh.addChild(this._gizmoMesh, Gizmo.PreserveScaling), this._gizmoMesh.scaling.scaleInPlace(1 / 3);const nodePosition = arrowMesh.position.clone(),linePosition = arrowTail.position.clone(),lineScale = arrowTail.scaling.clone(),increaseGizmoMesh = (dragDistance) => {const dragStrength = 6 * (dragDistance * (3 / this._rootMesh.scaling.length()));arrowMesh.position.z += dragStrength / 3.5, arrowTail.scaling.y += dragStrength, this.dragScale = arrowTail.scaling.y, arrowTail.position.z = arrowMesh.position.z / 2;},resetGizmoMesh = () => {arrowMesh.position.set(nodePosition.x, nodePosition.y, nodePosition.z), arrowTail.position.set(linePosition.x, linePosition.y, linePosition.z), arrowTail.scaling.set(lineScale.x, lineScale.y, lineScale.z), this.dragScale = arrowTail.scaling.y, this._dragging = !1;};this.dragBehavior = new PointerDragBehavior({ dragAxis: dragAxis }), this.dragBehavior.moveAttached = !1, this.dragBehavior.updateDragPlane = !1, this._rootMesh.addBehavior(this.dragBehavior);let currentSnapDragDistance = 0;const tmpSnapEvent = { snapDistance: 0 };this.dragBehavior.onDragObservable.add((event) => {if (this.attachedNode) {this._handlePivot();const dragStrength = this.sensitivity * event.dragDistance * (3 * this.scaleRatio / this._rootMesh.scaling.length()),tmpVector = this._tmpVector;let snapped = !1,dragSteps = 0;this.uniformScaling ? tmpVector.setAll(.57735) : tmpVector.copyFrom(dragAxis), 0 == this.snapDistance ? tmpVector.scaleToRef(dragStrength, tmpVector) : (currentSnapDragDistance += dragStrength, Math.abs(currentSnapDragDistance) > this.snapDistance ? (dragSteps = Math.floor(Math.abs(currentSnapDragDistance) / this.snapDistance), 0 > currentSnapDragDistance && (dragSteps *= -1), currentSnapDragDistance %= this.snapDistance, tmpVector.scaleToRef(this.snapDistance * dragSteps, tmpVector), snapped = !0) : tmpVector.scaleInPlace(0)), math_vector/* Matrix.ScalingToRef */.y3.ScalingToRef(1 + tmpVector.x, 1 + tmpVector.y, 1 + tmpVector.z, math_vector/* TmpVectors.Matrix.2 */.jp.Matrix[2]), math_vector/* TmpVectors.Matrix.2.multiplyToRef */.jp.Matrix[2].multiplyToRef(this.attachedNode.getWorldMatrix(), math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1]);const transformNode = this.attachedNode._isMesh ? this.attachedNode : void 0;math_vector/* TmpVectors.Matrix.1.decompose */.jp.Matrix[1].decompose(math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1], void 0, void 0, Gizmo.PreserveScaling ? transformNode : void 0);Math.abs(math_vector/* TmpVectors.Vector3.1.x */.jp.Vector3[1].x) < 100000 && Math.abs(math_vector/* TmpVectors.Vector3.1.y */.jp.Vector3[1].y) < 100000 && Math.abs(math_vector/* TmpVectors.Vector3.1.z */.jp.Vector3[1].z) < 100000 && this.attachedNode.getWorldMatrix().copyFrom(math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1]), snapped && (tmpSnapEvent.snapDistance = this.snapDistance * dragSteps, this.onSnapObservable.notifyObservers(tmpSnapEvent)), this._matrixChanged();}}), this.dragBehavior.onDragStartObservable.add(() => {this._dragging = !0;}), this.dragBehavior.onDragObservable.add((e) => increaseGizmoMesh(e.dragDistance)), this.dragBehavior.onDragEndObservable.add(resetGizmoMesh), null === (_c = null === (_b = null === (_a = null === parent || void 0 === parent ? void 0 : parent.uniformScaleGizmo) || void 0 === _a ? void 0 : _a.dragBehavior) || void 0 === _b ? void 0 : _b.onDragObservable) || void 0 === _c ? void 0 : _c.add((e) => increaseGizmoMesh(e.delta.y)), null === (_f = null === (_e = null === (_d = null === parent || void 0 === parent ? void 0 : parent.uniformScaleGizmo) || void 0 === _d ? void 0 : _d.dragBehavior) || void 0 === _e ? void 0 : _e.onDragEndObservable) || void 0 === _f ? void 0 : _f.add(resetGizmoMesh);const cache = { gizmoMeshes: [arrowMesh, arrowTail], colliderMeshes: [collider.arrowMesh, collider.arrowTail], material: this._coloredMaterial, hoverMaterial: this._hoverMaterial, disableMaterial: this._disableMaterial, active: !1, dragBehavior: this.dragBehavior };null === (_g = this._parent) || void 0 === _g ? void 0 : _g.addToAxisCache(this._gizmoMesh, cache), this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {var _a;if (!this._customMeshSet && (this._isHovered = -1 != cache.colliderMeshes.indexOf(null === (_a = null === pointerInfo || void 0 === pointerInfo ? void 0 : pointerInfo.pickInfo) || void 0 === _a ? void 0 : _a.pickedMesh), !this._parent)) {const material = this.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial;this._setGizmoMeshMaterial(cache.gizmoMeshes, material);}}), this.dragBehavior.onEnabledObservable.add((newState) => {this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? this._coloredMaterial : this._disableMaterial);});const light = gizmoLayer._getSharedGizmoLight();light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes());}_createGizmoMesh(parentMesh, thickness, isCollider = !1) {const arrowMesh = CreateBox("yPosMesh", { size: .4 * (1 + (thickness - 1) / 4) }, this.gizmoLayer.utilityLayerScene),arrowTail = CreateCylinder("cylinder", { diameterTop: .005 * thickness, height: .275, diameterBottom: .005 * thickness, tessellation: 96 }, this.gizmoLayer.utilityLayerScene);return arrowMesh.scaling.scaleInPlace(.1), arrowMesh.material = this._coloredMaterial, arrowMesh.rotation.x = Math.PI / 2, arrowMesh.position.z += .3, arrowTail.material = this._coloredMaterial, arrowTail.position.z += .275 / 2, arrowTail.rotation.x = Math.PI / 2, isCollider && (arrowMesh.visibility = 0, arrowTail.visibility = 0), parentMesh.addChild(arrowMesh), parentMesh.addChild(arrowTail), { arrowMesh, arrowTail };}_attachedNodeChanged(value) {this.dragBehavior && (this.dragBehavior.enabled = !!value);}set isEnabled(value) {this._isEnabled = value, value ? this._parent && (this.attachedMesh = this._parent.attachedMesh, this.attachedNode = this._parent.attachedNode) : (this.attachedMesh = null, this.attachedNode = null);}get isEnabled() {return this._isEnabled;}dispose() {this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {matl && matl.dispose();}), super.dispose();}setCustomMesh(mesh, useGizmoMaterial = !1) {super.setCustomMesh(mesh), useGizmoMaterial && (this._rootMesh.getChildMeshes().forEach((m) => {m.material = this._coloredMaterial, m.color && (m.color = this._coloredMaterial.diffuseColor);}), this._customMeshSet = !1);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/boundingBoxGizmo.js
class BoundingBoxGizmo extends Gizmo {set axisFactor(factor) {this._axisFactor = factor;const scaleBoxes = this._scaleBoxesParent.getChildMeshes();let index = 0;for (let i = 0; 3 > i; i++) for (let j = 0; 3 > j; j++) for (let k = 0; 3 > k; k++) {const zeroAxisCount = (1 === i ? 1 : 0) + (1 === j ? 1 : 0) + (1 == k ? 1 : 0);if (1 != zeroAxisCount && 3 !== zeroAxisCount) {if (scaleBoxes[index]) {const dragAxis = new math_vector/* Vector3 */.P(i - 1, j - 1, k - 1);dragAxis.multiplyInPlace(this._axisFactor), scaleBoxes[index].setEnabled(dragAxis.lengthSquared() > math_constants/* Epsilon */.kn);}index++;}}}get axisFactor() {return this._axisFactor;}set scaleDragSpeed(value) {this._scaleDragSpeed = value;}get scaleDragSpeed() {return this._scaleDragSpeed;}get coloredMaterial() {return this._coloredMaterial;}get hoverMaterial() {return this._hoverColoredMaterial;}get pointerDragBehavior() {return this._pointerDragBehavior;}setColor(color) {this._coloredMaterial.emissiveColor = color, this._hoverColoredMaterial.emissiveColor = color.clone().add(new math_color/* Color3 */.Wo(.3, .3, .3)), this._lineBoundingBox.getChildren().forEach((l) => {l.color && (l.color = color);});}constructor(color = math_color/* Color3.Gray */.Wo.Gray(), gizmoLayer = UtilityLayerRenderer.DefaultKeepDepthUtilityLayer) {super(gizmoLayer), this._boundingDimensions = new math_vector/* Vector3 */.P(1, 1, 1), this._renderObserver = null, this._pointerObserver = null, this._scaleDragSpeed = .2, this._tmpQuaternion = new math_vector/* Quaternion */._f(), this._tmpVector = new math_vector/* Vector3 */.P(0, 0, 0), this._tmpRotationMatrix = new math_vector/* Matrix */.y3(), this.ignoreChildren = !1, this.includeChildPredicate = null, this.rotationSphereSize = .1, this.scaleBoxSize = .1, this.fixedDragMeshScreenSize = !1, this.fixedDragMeshBoundsSize = !1, this.fixedDragMeshScreenSizeDistanceFactor = 10, this.onDragStartObservable = new observable/* Observable */.y$(), this.onScaleBoxDragObservable = new observable/* Observable */.y$(), this.onScaleBoxDragEndObservable = new observable/* Observable */.y$(), this.onRotationSphereDragObservable = new observable/* Observable */.y$(), this.onRotationSphereDragEndObservable = new observable/* Observable */.y$(), this.scalePivot = null, this._axisFactor = new math_vector/* Vector3 */.P(1, 1, 1), this._existingMeshScale = new math_vector/* Vector3 */.P(), this._dragMesh = null, this._pointerDragBehavior = new PointerDragBehavior(), this.updateScale = !1, this._anchorMesh = new abstractMesh/* AbstractMesh */.x("anchor", gizmoLayer.utilityLayerScene), this._coloredMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._coloredMaterial.disableLighting = !0, this._hoverColoredMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._hoverColoredMaterial.disableLighting = !0, this._lineBoundingBox = new abstractMesh/* AbstractMesh */.x("", gizmoLayer.utilityLayerScene), this._lineBoundingBox.rotationQuaternion = new math_vector/* Quaternion */._f();const lines = [];lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(0, 0, 0), new math_vector/* Vector3 */.P(this._boundingDimensions.x, 0, 0)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(0, 0, 0), new math_vector/* Vector3 */.P(0, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(0, 0, 0), new math_vector/* Vector3 */.P(0, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(this._boundingDimensions.x, 0, 0), new math_vector/* Vector3 */.P(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(this._boundingDimensions.x, 0, 0), new math_vector/* Vector3 */.P(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(0, this._boundingDimensions.y, 0), new math_vector/* Vector3 */.P(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(0, this._boundingDimensions.y, 0), new math_vector/* Vector3 */.P(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(0, 0, this._boundingDimensions.z), new math_vector/* Vector3 */.P(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(0, 0, this._boundingDimensions.z), new math_vector/* Vector3 */.P(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), new math_vector/* Vector3 */.P(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), new math_vector/* Vector3 */.P(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)), lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.P(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), new math_vector/* Vector3 */.P(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene)), lines.forEach((l) => {l.color = color, l.position.addInPlace(new math_vector/* Vector3 */.P(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), l.isPickable = !1, this._lineBoundingBox.addChild(l);}), this._rootMesh.addChild(this._lineBoundingBox), this.setColor(color), this._rotateSpheresParent = new abstractMesh/* AbstractMesh */.x("", gizmoLayer.utilityLayerScene), this._rotateSpheresParent.rotationQuaternion = new math_vector/* Quaternion */._f();for (let i = 0; 12 > i; i++) {const sphere = CreateSphere("", { diameter: 1 }, gizmoLayer.utilityLayerScene);sphere.rotationQuaternion = new math_vector/* Quaternion */._f(), sphere.material = this._coloredMaterial, sphere.isNearGrabbable = !0;const _dragBehavior = new PointerDragBehavior({});_dragBehavior.moveAttached = !1, _dragBehavior.updateDragPlane = !1, sphere.addBehavior(_dragBehavior);const startingTurnDirection = new math_vector/* Vector3 */.P(1, 0, 0);let totalTurnAmountOfDrag = 0;_dragBehavior.onDragStartObservable.add(() => {startingTurnDirection.copyFrom(sphere.forward), totalTurnAmountOfDrag = 0;}), _dragBehavior.onDragObservable.add((event) => {if (this.onRotationSphereDragObservable.notifyObservers({}), this.attachedMesh) {const originalParent = this.attachedMesh.parent;if (originalParent && originalParent.scaling && originalParent.scaling.isNonUniformWithinEpsilon(.001)) return void logger/* Logger.Warn */.Y.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");PivotTools._RemoveAndStorePivotPoint(this.attachedMesh);const worldDragDirection = startingTurnDirection,toSub = event.dragPlaneNormal.scale(math_vector/* Vector3.Dot */.P.Dot(event.dragPlaneNormal, worldDragDirection)),dragAxis = worldDragDirection.subtract(toSub).normalizeToNew();let projectDist = 0 > math_vector/* Vector3.Dot */.P.Dot(dragAxis, event.delta) ? Math.abs(event.delta.length()) : -Math.abs(event.delta.length());projectDist = projectDist / this._boundingDimensions.length() * this._anchorMesh.scaling.length(), this.attachedMesh.rotationQuaternion || (this.attachedMesh.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z)), this._anchorMesh.rotationQuaternion || (this._anchorMesh.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z)), totalTurnAmountOfDrag += projectDist, Math.abs(totalTurnAmountOfDrag) <= 2 * Math.PI && (8 <= i ? math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(0, 0, projectDist, this._tmpQuaternion) : 4 <= i ? math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(projectDist, 0, 0, this._tmpQuaternion) : math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(0, projectDist, 0, this._tmpQuaternion), this._anchorMesh.addChild(this.attachedMesh, Gizmo.PreserveScaling), this._anchorMesh.getScene().useRightHandedSystem && this._tmpQuaternion.conjugateInPlace(), this._anchorMesh.rotationQuaternion.multiplyToRef(this._tmpQuaternion, this._anchorMesh.rotationQuaternion), this._anchorMesh.removeChild(this.attachedMesh, Gizmo.PreserveScaling), this.attachedMesh.setParent(originalParent, Gizmo.PreserveScaling)), this.updateBoundingBox(), PivotTools._RestorePivotPoint(this.attachedMesh);}this._updateDummy();}), _dragBehavior.onDragStartObservable.add(() => {this.onDragStartObservable.notifyObservers({}), this._selectNode(sphere);}), _dragBehavior.onDragEndObservable.add((event) => {this.onRotationSphereDragEndObservable.notifyObservers({}), this._selectNode(null), this._updateDummy(), this._unhoverMeshOnTouchUp(event.pointerInfo, sphere);}), this._rotateSpheresParent.addChild(sphere);}this._rootMesh.addChild(this._rotateSpheresParent), this._scaleBoxesParent = new abstractMesh/* AbstractMesh */.x("", gizmoLayer.utilityLayerScene), this._scaleBoxesParent.rotationQuaternion = new math_vector/* Quaternion */._f();for (let i = 0; 3 > i; i++) for (let j = 0; 3 > j; j++) for (let k = 0; 3 > k; k++) {const zeroAxisCount = (1 === i ? 1 : 0) + (1 === j ? 1 : 0) + (1 == k ? 1 : 0);if (1 == zeroAxisCount || 3 === zeroAxisCount) continue;const box = CreateBox("", { size: 1 }, gizmoLayer.utilityLayerScene);box.material = this._coloredMaterial, box._internalMetadata = 2 == zeroAxisCount, box.isNearGrabbable = !0;const dragAxis = new math_vector/* Vector3 */.P(i - 1, j - 1, k - 1).normalize(),_dragBehavior = new PointerDragBehavior({ dragAxis: dragAxis });_dragBehavior.updateDragPlane = !1, _dragBehavior.moveAttached = !1, box.addBehavior(_dragBehavior), _dragBehavior.onDragObservable.add((event) => {if (this.onScaleBoxDragObservable.notifyObservers({}), this.attachedMesh) {const originalParent = this.attachedMesh.parent;if (originalParent && originalParent.scaling && originalParent.scaling.isNonUniformWithinEpsilon(.001)) return void logger/* Logger.Warn */.Y.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");PivotTools._RemoveAndStorePivotPoint(this.attachedMesh);const relativeDragDistance = event.dragDistance / this._boundingDimensions.length() * this._anchorMesh.scaling.length(),deltaScale = new math_vector/* Vector3 */.P(relativeDragDistance, relativeDragDistance, relativeDragDistance);2 === zeroAxisCount && (deltaScale.x *= Math.abs(dragAxis.x), deltaScale.y *= Math.abs(dragAxis.y), deltaScale.z *= Math.abs(dragAxis.z)), deltaScale.scaleInPlace(this._scaleDragSpeed), deltaScale.multiplyInPlace(this._axisFactor), this.updateBoundingBox(), this.scalePivot ? (this.attachedMesh.getWorldMatrix().getRotationMatrixToRef(this._tmpRotationMatrix), this._boundingDimensions.scaleToRef(.5, this._tmpVector), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._tmpVector, this._tmpRotationMatrix, this._tmpVector), this._anchorMesh.position.subtractInPlace(this._tmpVector), this._boundingDimensions.multiplyToRef(this.scalePivot, this._tmpVector), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._tmpVector, this._tmpRotationMatrix, this._tmpVector), this._anchorMesh.position.addInPlace(this._tmpVector)) : (box.absolutePosition.subtractToRef(this._anchorMesh.position, this._tmpVector), this._anchorMesh.position.subtractInPlace(this._tmpVector)), this._anchorMesh.addChild(this.attachedMesh, Gizmo.PreserveScaling), this._anchorMesh.scaling.addInPlace(deltaScale), (0 > this._anchorMesh.scaling.x || 0 > this._anchorMesh.scaling.y || 0 > this._anchorMesh.scaling.z) && this._anchorMesh.scaling.subtractInPlace(deltaScale), this._anchorMesh.removeChild(this.attachedMesh, Gizmo.PreserveScaling), this.attachedMesh.setParent(originalParent, Gizmo.PreserveScaling), PivotTools._RestorePivotPoint(this.attachedMesh);}this._updateDummy();}), _dragBehavior.onDragStartObservable.add(() => {this.onDragStartObservable.notifyObservers({}), this._selectNode(box);}), _dragBehavior.onDragEndObservable.add((event) => {this.onScaleBoxDragEndObservable.notifyObservers({}), this._selectNode(null), this._updateDummy(), this._unhoverMeshOnTouchUp(event.pointerInfo, box);}), this._scaleBoxesParent.addChild(box);}this._rootMesh.addChild(this._scaleBoxesParent);const pointerIds = [];this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {pointerIds[pointerInfo.event.pointerId] ? pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh != pointerIds[pointerInfo.event.pointerId] && (pointerIds[pointerInfo.event.pointerId].material = this._coloredMaterial, delete pointerIds[pointerInfo.event.pointerId]) : this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach((mesh) => {pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh == mesh && (pointerIds[pointerInfo.event.pointerId] = mesh, mesh.material = this._hoverColoredMaterial);});}), this._renderObserver = this.gizmoLayer.originalScene.onBeforeRenderObservable.add(() => {this.attachedMesh && !this._existingMeshScale.equals(this.attachedMesh.scaling) ? this.updateBoundingBox() : (this.fixedDragMeshScreenSize || this.fixedDragMeshBoundsSize) && (this._updateRotationSpheres(), this._updateScaleBoxes()), this._dragMesh && this.attachedMesh && this._pointerDragBehavior.dragging && (this._lineBoundingBox.position.rotateByQuaternionToRef(this._rootMesh.rotationQuaternion, this._tmpVector), this.attachedMesh.setAbsolutePosition(this._dragMesh.position.add(this._tmpVector.scale(-1))));}), this.updateBoundingBox();}_attachedNodeChanged(value) {if (value) {this._anchorMesh.scaling.setAll(1), PivotTools._RemoveAndStorePivotPoint(value);const originalParent = value.parent;this._anchorMesh.addChild(value, Gizmo.PreserveScaling), this._anchorMesh.removeChild(value, Gizmo.PreserveScaling), value.setParent(originalParent, Gizmo.PreserveScaling), PivotTools._RestorePivotPoint(value), this.updateBoundingBox(), value.getChildMeshes(!1).forEach((m) => {m.markAsDirty("scaling");}), this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce(() => {this._updateDummy();});}}_selectNode(selectedMesh) {this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach((m) => {m.isVisible = !selectedMesh || m == selectedMesh;});}_unhoverMeshOnTouchUp(pointerInfo, selectedMesh) {(null === pointerInfo || void 0 === pointerInfo ? void 0 : pointerInfo.event) instanceof PointerEvent && "touch" === (null === pointerInfo || void 0 === pointerInfo ? void 0 : pointerInfo.event.pointerType) && (selectedMesh.material = this._coloredMaterial);}getScaleBoxes() {return this._scaleBoxesParent.getChildMeshes();}updateBoundingBox() {if (this.attachedMesh) {PivotTools._RemoveAndStorePivotPoint(this.attachedMesh);const originalParent = this.attachedMesh.parent;this.attachedMesh.setParent(null, Gizmo.PreserveScaling), this._update(), this.attachedMesh.rotationQuaternion || (this.attachedMesh.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z)), this._anchorMesh.rotationQuaternion || (this._anchorMesh.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z)), this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpVector.copyFrom(this.attachedMesh.position), this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1), this.attachedMesh.position.set(0, 0, 0);const boundingMinMax = this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren, this.includeChildPredicate);boundingMinMax.max.subtractToRef(boundingMinMax.min, this._boundingDimensions), this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions), this._lineBoundingBox.position.set((boundingMinMax.max.x + boundingMinMax.min.x) / 2, (boundingMinMax.max.y + boundingMinMax.min.y) / 2, (boundingMinMax.max.z + boundingMinMax.min.z) / 2), this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position), this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position), this._lineBoundingBox.computeWorldMatrix(), this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition), this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion), this.attachedMesh.position.copyFrom(this._tmpVector), this.attachedMesh.setParent(originalParent, Gizmo.PreserveScaling);}this._updateRotationSpheres(), this._updateScaleBoxes(), this.attachedMesh && (this._existingMeshScale.copyFrom(this.attachedMesh.scaling), PivotTools._RestorePivotPoint(this.attachedMesh));}_updateRotationSpheres() {const rotateSpheres = this._rotateSpheresParent.getChildMeshes();for (let i = 0; 3 > i; i++) for (let j = 0; 2 > j; j++) for (let k = 0; 2 > k; k++) {const index = 4 * i + 2 * j + k;if (0 == i && (rotateSpheres[index].position.set(this._boundingDimensions.x / 2, this._boundingDimensions.y * j, this._boundingDimensions.z * k), rotateSpheres[index].position.addInPlace(new math_vector/* Vector3 */.P(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), rotateSpheres[index].lookAt(math_vector/* Vector3.Cross */.P.Cross(rotateSpheres[index].position.normalizeToNew(), math_vector/* Vector3.Right */.P.Right()).normalizeToNew().add(rotateSpheres[index].position))), 1 == i && (rotateSpheres[index].position.set(this._boundingDimensions.x * j, this._boundingDimensions.y / 2, this._boundingDimensions.z * k), rotateSpheres[index].position.addInPlace(new math_vector/* Vector3 */.P(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), rotateSpheres[index].lookAt(math_vector/* Vector3.Cross */.P.Cross(rotateSpheres[index].position.normalizeToNew(), math_vector/* Vector3.Up */.P.Up()).normalizeToNew().add(rotateSpheres[index].position))), 2 == i && (rotateSpheres[index].position.set(this._boundingDimensions.x * j, this._boundingDimensions.y * k, this._boundingDimensions.z / 2), rotateSpheres[index].position.addInPlace(new math_vector/* Vector3 */.P(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), rotateSpheres[index].lookAt(math_vector/* Vector3.Cross */.P.Cross(rotateSpheres[index].position.normalizeToNew(), math_vector/* Vector3.Forward */.P.Forward()).normalizeToNew().add(rotateSpheres[index].position))), this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {rotateSpheres[index].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);const distanceFromCamera = this.rotationSphereSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;rotateSpheres[index].scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);} else this.fixedDragMeshBoundsSize ? rotateSpheres[index].scaling.set(this.rotationSphereSize * this._boundingDimensions.x, this.rotationSphereSize * this._boundingDimensions.y, this.rotationSphereSize * this._boundingDimensions.z) : rotateSpheres[index].scaling.set(this.rotationSphereSize, this.rotationSphereSize, this.rotationSphereSize);}}_updateScaleBoxes() {const scaleBoxes = this._scaleBoxesParent.getChildMeshes();let index = 0;for (let i = 0; 3 > i; i++) for (let j = 0; 3 > j; j++) for (let k = 0; 3 > k; k++) {const zeroAxisCount = (1 === i ? 1 : 0) + (1 === j ? 1 : 0) + (1 == k ? 1 : 0);if (1 != zeroAxisCount && 3 !== zeroAxisCount) {if (scaleBoxes[index]) if (scaleBoxes[index].position.set(this._boundingDimensions.x * (i / 2), this._boundingDimensions.y * (j / 2), this._boundingDimensions.z * (k / 2)), scaleBoxes[index].position.addInPlace(new math_vector/* Vector3 */.P(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {scaleBoxes[index].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);const distanceFromCamera = this.scaleBoxSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;scaleBoxes[index].scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);} else this.fixedDragMeshBoundsSize ? scaleBoxes[index].scaling.set(this.scaleBoxSize * this._boundingDimensions.x, this.scaleBoxSize * this._boundingDimensions.y, this.scaleBoxSize * this._boundingDimensions.z) : scaleBoxes[index].scaling.set(this.scaleBoxSize, this.scaleBoxSize, this.scaleBoxSize);index++;}}}setEnabledRotationAxis(axis) {this._rotateSpheresParent.getChildMeshes().forEach((m, i) => {4 > i ? m.setEnabled(-1 != axis.indexOf("x")) : 8 > i ? m.setEnabled(-1 != axis.indexOf("y")) : m.setEnabled(-1 != axis.indexOf("z"));});}setEnabledScaling(enable, homogeneousScaling = !1) {this._scaleBoxesParent.getChildMeshes().forEach((m) => {let enableMesh = enable;homogeneousScaling && !0 === m._internalMetadata && (enableMesh = !1), m.setEnabled(enableMesh);});}_updateDummy() {this._dragMesh && (this._dragMesh.position.copyFrom(this._lineBoundingBox.getAbsolutePosition()), this._dragMesh.scaling.copyFrom(this._lineBoundingBox.scaling), this._dragMesh.rotationQuaternion.copyFrom(this._rootMesh.rotationQuaternion));}enableDragBehavior() {this._dragMesh = CreateBox("dummy", { size: 1 }, this.gizmoLayer.utilityLayerScene), this._dragMesh.visibility = 0, this._dragMesh.rotationQuaternion = new math_vector/* Quaternion */._f(), this._pointerDragBehavior.useObjectOrientationForDragging = !1, this._dragMesh.addBehavior(this._pointerDragBehavior);}dispose() {this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver), this._lineBoundingBox.dispose(), this._rotateSpheresParent.dispose(), this._scaleBoxesParent.dispose(), this._dragMesh && this._dragMesh.dispose(), super.dispose();}static MakeNotPickableAndWrapInBoundingBox(mesh) {const makeNotPickable = (root) => {root.isPickable = !1, root.getChildMeshes().forEach((c) => {makeNotPickable(c);});};makeNotPickable(mesh), mesh.rotationQuaternion || (mesh.rotationQuaternion = math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(mesh.rotation.y, mesh.rotation.x, mesh.rotation.z));const oldPos = mesh.position.clone(),oldRot = mesh.rotationQuaternion.clone();mesh.rotationQuaternion.set(0, 0, 0, 1), mesh.position.set(0, 0, 0);const box = CreateBox("box", { size: 1 }, mesh.getScene()),boundingMinMax = mesh.getHierarchyBoundingVectors();return boundingMinMax.max.subtractToRef(boundingMinMax.min, box.scaling), 0 === box.scaling.y && (box.scaling.y = math_constants/* Epsilon */.kn), 0 === box.scaling.x && (box.scaling.x = math_constants/* Epsilon */.kn), 0 === box.scaling.z && (box.scaling.z = math_constants/* Epsilon */.kn), box.position.set((boundingMinMax.max.x + boundingMinMax.min.x) / 2, (boundingMinMax.max.y + boundingMinMax.min.y) / 2, (boundingMinMax.max.z + boundingMinMax.min.z) / 2), mesh.addChild(box), mesh.rotationQuaternion.copyFrom(oldRot), mesh.position.copyFrom(oldPos), mesh.removeChild(box), box.addChild(mesh), box.visibility = 0, box;}setCustomMesh() {logger/* Logger.Error */.Y.Error("Custom meshes are not supported on this gizmo");}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/planeRotationGizmo.js
class PlaneRotationGizmo extends Gizmo {get coloredMaterial() {return this._coloredMaterial;}get hoverMaterial() {return this._hoverMaterial;}get disableMaterial() {return this._disableMaterial;}constructor(planeNormal, color = math_color/* Color3.Gray */.Wo.Gray(), gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, tessellation = 32, parent = null, useEulerRotation = !1, thickness = 1) {var _a;super(gizmoLayer), this._pointerObserver = null, this.snapDistance = 0, this.onSnapObservable = new observable/* Observable */.y$(), this.angle = 0, this._isEnabled = !0, this._parent = null, this._dragging = !1, this._angles = new math_vector/* Vector3 */.P(), this._parent = parent, this._coloredMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._coloredMaterial.diffuseColor = color, this._coloredMaterial.specularColor = color.subtract(new math_color/* Color3 */.Wo(.1, .1, .1)), this._hoverMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._hoverMaterial.diffuseColor = math_color/* Color3.Yellow */.Wo.Yellow(), this._disableMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._disableMaterial.diffuseColor = math_color/* Color3.Gray */.Wo.Gray(), this._disableMaterial.alpha = .4, this._gizmoMesh = new Meshes_mesh/* Mesh */.Kj("", gizmoLayer.utilityLayerScene);const { rotationMesh, collider } = this._createGizmoMesh(this._gizmoMesh, thickness, tessellation);this._rotationDisplayPlane = CreatePlane("rotationDisplay", { size: .6, updatable: !1 }, this.gizmoLayer.utilityLayerScene), this._rotationDisplayPlane.rotation.z = .5 * Math.PI, this._rotationDisplayPlane.parent = this._gizmoMesh, this._rotationDisplayPlane.setEnabled(!1), Materials_effect/* Effect.ShadersStore.rotationGizmoVertexShader */.Q.ShadersStore.rotationGizmoVertexShader = PlaneRotationGizmo._RotationGizmoVertexShader, Materials_effect/* Effect.ShadersStore.rotationGizmoFragmentShader */.Q.ShadersStore.rotationGizmoFragmentShader = PlaneRotationGizmo._RotationGizmoFragmentShader, this._rotationShaderMaterial = new shaderMaterial/* ShaderMaterial */.j("shader", this.gizmoLayer.utilityLayerScene, { vertex: "rotationGizmo", fragment: "rotationGizmo" }, { attributes: ["position", "uv"], uniforms: ["worldViewProjection", "angles"] }), this._rotationShaderMaterial.backFaceCulling = !1, this._rotationDisplayPlane.material = this._rotationShaderMaterial, this._rotationDisplayPlane.visibility = .999, this._gizmoMesh.lookAt(this._rootMesh.position.add(planeNormal)), this._rootMesh.addChild(this._gizmoMesh, Gizmo.PreserveScaling), this._gizmoMesh.scaling.scaleInPlace(1 / 3), this.dragBehavior = new PointerDragBehavior({ dragPlaneNormal: planeNormal }), this.dragBehavior.moveAttached = !1, this.dragBehavior.maxDragAngle = PlaneRotationGizmo.MaxDragAngle, this.dragBehavior._useAlternatePickedPointAboveMaxDragAngle = !0, this._rootMesh.addBehavior(this.dragBehavior);const lastDragPosition = new math_vector/* Vector3 */.P(),rotationMatrix = new math_vector/* Matrix */.y3(),planeNormalTowardsCamera = new math_vector/* Vector3 */.P();let localPlaneNormalTowardsCamera = new math_vector/* Vector3 */.P();this.dragBehavior.onDragStartObservable.add((e) => {this.attachedNode && (lastDragPosition.copyFrom(e.dragPlanePoint), this._rotationDisplayPlane.setEnabled(!0), this._rotationDisplayPlane.getWorldMatrix().invertToRef(rotationMatrix), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(e.dragPlanePoint, rotationMatrix, lastDragPosition), this._angles.x = Math.atan2(lastDragPosition.y, lastDragPosition.x) + Math.PI, this._angles.y = 0, this._angles.z = this.updateGizmoRotationToMatchAttachedMesh ? 1 : 0, this._dragging = !0, lastDragPosition.copyFrom(e.dragPlanePoint), this._rotationShaderMaterial.setVector3("angles", this._angles), this.angle = 0);}), this.dragBehavior.onDragEndObservable.add(() => {this._dragging = !1, this._rotationDisplayPlane.setEnabled(!1);});const tmpSnapEvent = { snapDistance: 0 };let currentSnapDragDistance = 0;const tmpMatrix = new math_vector/* Matrix */.y3(),amountToRotate = new math_vector/* Quaternion */._f();this.dragBehavior.onDragObservable.add((event) => {if (this.attachedNode) {const nodeScale = new math_vector/* Vector3 */.P(1, 1, 1),nodeQuaternion = new math_vector/* Quaternion */._f(0, 0, 0, 1),nodeTranslation = new math_vector/* Vector3 */.P(0, 0, 0);this._handlePivot(), this.attachedNode.getWorldMatrix().decompose(nodeScale, nodeQuaternion, nodeTranslation);const uniformScaling = Math.abs(Math.abs(nodeScale.x) - Math.abs(nodeScale.y)) <= math_constants/* Epsilon */.kn && Math.abs(Math.abs(nodeScale.x) - Math.abs(nodeScale.z)) <= math_constants/* Epsilon */.kn;if (!uniformScaling && this.updateGizmoRotationToMatchAttachedMesh) return void logger/* Logger.Warn */.Y.Warn("Unable to use a rotation gizmo matching mesh rotation with non uniform scaling. Use uniform scaling or set updateGizmoRotationToMatchAttachedMesh to false.");nodeQuaternion.normalize();const nodeTranslationForOperation = this.updateGizmoPositionToMatchAttachedMesh ? nodeTranslation : this._rootMesh.absolutePosition,newVector = event.dragPlanePoint.subtract(nodeTranslationForOperation).normalize(),originalVector = lastDragPosition.subtract(nodeTranslationForOperation).normalize(),cross = math_vector/* Vector3.Cross */.P.Cross(newVector, originalVector),dot = math_vector/* Vector3.Dot */.P.Dot(newVector, originalVector);let angle = Math.atan2(cross.length(), dot);planeNormalTowardsCamera.copyFrom(planeNormal), localPlaneNormalTowardsCamera.copyFrom(planeNormal), this.updateGizmoRotationToMatchAttachedMesh && (nodeQuaternion.toRotationMatrix(rotationMatrix), localPlaneNormalTowardsCamera = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(planeNormalTowardsCamera, rotationMatrix));let cameraFlipped = !1;if (gizmoLayer.utilityLayerScene.activeCamera) {const camVec = gizmoLayer.utilityLayerScene.activeCamera.position.subtract(nodeTranslationForOperation).normalize();0 < math_vector/* Vector3.Dot */.P.Dot(camVec, localPlaneNormalTowardsCamera) && (planeNormalTowardsCamera.scaleInPlace(-1), localPlaneNormalTowardsCamera.scaleInPlace(-1), cameraFlipped = !0);}const halfCircleSide = 0 < math_vector/* Vector3.Dot */.P.Dot(localPlaneNormalTowardsCamera, cross);halfCircleSide && (angle = -angle);let snapped = !1;if (0 != this.snapDistance) if (currentSnapDragDistance += angle, Math.abs(currentSnapDragDistance) > this.snapDistance) {let dragSteps = Math.floor(Math.abs(currentSnapDragDistance) / this.snapDistance);0 > currentSnapDragDistance && (dragSteps *= -1), currentSnapDragDistance %= this.snapDistance, angle = this.snapDistance * dragSteps, snapped = !0;} else angle = 0;const quaternionCoefficient = Math.sin(angle / 2);if (amountToRotate.set(planeNormalTowardsCamera.x * quaternionCoefficient, planeNormalTowardsCamera.y * quaternionCoefficient, planeNormalTowardsCamera.z * quaternionCoefficient, Math.cos(angle / 2)), 0 < tmpMatrix.determinant()) {const tmpVector = new math_vector/* Vector3 */.P();amountToRotate.toEulerAnglesToRef(tmpVector), math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(tmpVector.y, -tmpVector.x, -tmpVector.z, amountToRotate);}this.updateGizmoRotationToMatchAttachedMesh ? (nodeQuaternion.multiplyToRef(amountToRotate, nodeQuaternion), math_vector/* Matrix.ComposeToRef */.y3.ComposeToRef(nodeScale, nodeQuaternion, nodeTranslation, this.attachedNode.getWorldMatrix())) : (amountToRotate.toRotationMatrix(math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), math_vector/* TmpVectors.Matrix.0.multiplyToRef */.jp.Matrix[0].multiplyToRef(this.attachedNode.getWorldMatrix(), this.attachedNode.getWorldMatrix())), lastDragPosition.copyFrom(event.dragPlanePoint), snapped && (tmpSnapEvent.snapDistance = angle, this.onSnapObservable.notifyObservers(tmpSnapEvent)), this._angles.y += angle, this.angle += cameraFlipped ? -angle : angle, this._rotationShaderMaterial.setVector3("angles", this._angles), this._matrixChanged();}});const light = gizmoLayer._getSharedGizmoLight();light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));const cache = { colliderMeshes: [collider], gizmoMeshes: [rotationMesh], material: this._coloredMaterial, hoverMaterial: this._hoverMaterial, disableMaterial: this._disableMaterial, active: !1, dragBehavior: this.dragBehavior };null === (_a = this._parent) || void 0 === _a ? void 0 : _a.addToAxisCache(this._gizmoMesh, cache), this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {var _a;if (!this._customMeshSet && (this.dragBehavior.maxDragAngle = PlaneRotationGizmo.MaxDragAngle, this._isHovered = -1 != cache.colliderMeshes.indexOf(null === (_a = null === pointerInfo || void 0 === pointerInfo ? void 0 : pointerInfo.pickInfo) || void 0 === _a ? void 0 : _a.pickedMesh), !this._parent)) {const material = cache.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial;this._setGizmoMeshMaterial(cache.gizmoMeshes, material);}}), this.dragBehavior.onEnabledObservable.add((newState) => {this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? this._coloredMaterial : this._disableMaterial);});}_createGizmoMesh(parentMesh, thickness, tessellation) {const collider = CreateTorus("ignore", { diameter: .6, thickness: .03 * thickness, tessellation }, this.gizmoLayer.utilityLayerScene);collider.visibility = 0;const rotationMesh = CreateTorus("", { diameter: .6, thickness: .005 * thickness, tessellation }, this.gizmoLayer.utilityLayerScene);return rotationMesh.material = this._coloredMaterial, rotationMesh.rotation.x = Math.PI / 2, collider.rotation.x = Math.PI / 2, parentMesh.addChild(rotationMesh, Gizmo.PreserveScaling), parentMesh.addChild(collider, Gizmo.PreserveScaling), { rotationMesh, collider };}_attachedNodeChanged(value) {this.dragBehavior && (this.dragBehavior.enabled = !!value);}set isEnabled(value) {this._isEnabled = value, value ? this._parent && (this.attachedMesh = this._parent.attachedMesh) : this.attachedMesh = null;}get isEnabled() {return this._isEnabled;}dispose() {this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), this._rotationDisplayPlane && this._rotationDisplayPlane.dispose(), this._rotationShaderMaterial && this._rotationShaderMaterial.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {matl && matl.dispose();}), super.dispose();}}PlaneRotationGizmo.MaxDragAngle = 9 * Math.PI / 20, PlaneRotationGizmo._RotationGizmoVertexShader = `
        precision highp float;
        attribute vec3 position;
        attribute vec2 uv;
        uniform mat4 worldViewProjection;
        varying vec3 vPosition;
        varying vec2 vUV;
        void main(void) {
            gl_Position = worldViewProjection * vec4(position, 1.0);
            vUV = uv;
        }`, PlaneRotationGizmo._RotationGizmoFragmentShader = `
        precision highp float;
        varying vec2 vUV;
        varying vec3 vPosition;
        uniform vec3 angles;
        #define twopi 6.283185307
        void main(void) {
            vec2 uv = vUV - vec2(0.5);
            float angle = atan(uv.y, uv.x) + 3.141592;
            float delta = gl_FrontFacing ? angles.y : -angles.y;
            float begin = angles.x - delta * angles.z;
            float start = (begin < (begin + delta)) ? begin : (begin + delta);
            float end = (begin > (begin + delta)) ? begin : (begin + delta);
            float len = sqrt(dot(uv,uv));
            float opacity = 1. - step(0.5, len);

            float base = abs(floor(start / twopi)) * twopi;
            start += base;
            end += base;

            float intensity = 0.;
            for (int i = 0; i < 5; i++)
            {
                intensity += max(step(start, angle) - step(end, angle), 0.);
                angle += twopi;
            }
            gl_FragColor = vec4(1.,1.,0., min(intensity * 0.25, 0.8)) * opacity;
        }`;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/rotationGizmo.js
class RotationGizmo extends Gizmo {get attachedMesh() {return this._meshAttached;}set attachedMesh(mesh) {this._meshAttached = mesh, this._nodeAttached = mesh, this._checkBillboardTransform(), [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {gizmo.attachedMesh = gizmo.isEnabled ? mesh : null;});}get attachedNode() {return this._nodeAttached;}set attachedNode(node) {this._meshAttached = null, this._nodeAttached = node, this._checkBillboardTransform(), [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {gizmo.attachedNode = gizmo.isEnabled ? node : null;});}_checkBillboardTransform() {this._nodeAttached && this._nodeAttached.billboardMode && console.log("Rotation Gizmo will not work with transforms in billboard mode.");}get isHovered() {let hovered = !1;return [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {hovered = hovered || gizmo.isHovered;}), hovered;}constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, tessellation = 32, useEulerRotation = !1, thickness = 1, gizmoManager, options) {super(gizmoLayer), this.onDragStartObservable = new observable/* Observable */.y$(), this.onDragEndObservable = new observable/* Observable */.y$(), this._observables = [], this._gizmoAxisCache = new Map();const xColor = options && options.xOptions && options.xOptions.color ? options.xOptions.color : math_color/* Color3.Red */.Wo.Red().scale(.5),yColor = options && options.yOptions && options.yOptions.color ? options.yOptions.color : math_color/* Color3.Green */.Wo.Green().scale(.5),zColor = options && options.zOptions && options.zOptions.color ? options.zOptions.color : math_color/* Color3.Blue */.Wo.Blue().scale(.5);this.xGizmo = new PlaneRotationGizmo(new math_vector/* Vector3 */.P(1, 0, 0), xColor, gizmoLayer, tessellation, this, useEulerRotation, thickness), this.yGizmo = new PlaneRotationGizmo(new math_vector/* Vector3 */.P(0, 1, 0), yColor, gizmoLayer, tessellation, this, useEulerRotation, thickness), this.zGizmo = new PlaneRotationGizmo(new math_vector/* Vector3 */.P(0, 0, 1), zColor, gizmoLayer, tessellation, this, useEulerRotation, thickness), [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {options && options.updateScale != null && (gizmo.updateScale = options.updateScale), gizmo.dragBehavior.onDragStartObservable.add(() => {this.onDragStartObservable.notifyObservers({});}), gizmo.dragBehavior.onDragEndObservable.add(() => {this.onDragEndObservable.notifyObservers({});});}), this.attachedMesh = null, this.attachedNode = null, gizmoManager ? gizmoManager.addToAxisCache(this._gizmoAxisCache) : Gizmo.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache);}set updateGizmoRotationToMatchAttachedMesh(value) {this.xGizmo && (this.xGizmo.updateGizmoRotationToMatchAttachedMesh = value, this.yGizmo.updateGizmoRotationToMatchAttachedMesh = value, this.zGizmo.updateGizmoRotationToMatchAttachedMesh = value);}get updateGizmoRotationToMatchAttachedMesh() {return this.xGizmo.updateGizmoRotationToMatchAttachedMesh;}set updateGizmoPositionToMatchAttachedMesh(value) {this.xGizmo && (this.xGizmo.updateGizmoPositionToMatchAttachedMesh = value, this.yGizmo.updateGizmoPositionToMatchAttachedMesh = value, this.zGizmo.updateGizmoPositionToMatchAttachedMesh = value);}get updateGizmoPositionToMatchAttachedMesh() {return this.xGizmo.updateGizmoPositionToMatchAttachedMesh;}set updateScale(value) {this.xGizmo && (this.xGizmo.updateScale = value, this.yGizmo.updateScale = value, this.zGizmo.updateScale = value);}get updateScale() {return this.xGizmo.updateScale;}set snapDistance(value) {this.xGizmo && (this.xGizmo.snapDistance = value, this.yGizmo.snapDistance = value, this.zGizmo.snapDistance = value);}get snapDistance() {return this.xGizmo.snapDistance;}set scaleRatio(value) {this.xGizmo && (this.xGizmo.scaleRatio = value, this.yGizmo.scaleRatio = value, this.zGizmo.scaleRatio = value);}get scaleRatio() {return this.xGizmo.scaleRatio;}addToAxisCache(mesh, cache) {this._gizmoAxisCache.set(mesh, cache);}dispose() {this.xGizmo.dispose(), this.yGizmo.dispose(), this.zGizmo.dispose(), this.onDragStartObservable.clear(), this.onDragEndObservable.clear(), this._observables.forEach((obs) => {this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs);});}setCustomMesh() {logger/* Logger.Error */.Y.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/planeDragGizmo.js
class PlaneDragGizmo extends Gizmo {get coloredMaterial() {return this._coloredMaterial;}get hoverMaterial() {return this._hoverMaterial;}get disableMaterial() {return this._disableMaterial;}static _CreatePlane(scene, material) {const plane = new transformNode/* TransformNode */.Y("plane", scene),dragPlane = CreatePlane("dragPlane", { width: .1375, height: .1375, sideOrientation: 2 }, scene);return dragPlane.material = material, dragPlane.parent = plane, plane;}constructor(dragPlaneNormal, color = math_color/* Color3.Gray */.Wo.Gray(), gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, parent = null) {var _a;super(gizmoLayer), this._pointerObserver = null, this.snapDistance = 0, this.onSnapObservable = new observable/* Observable */.y$(), this._isEnabled = !1, this._parent = null, this._dragging = !1, this._parent = parent, this._coloredMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._coloredMaterial.diffuseColor = color, this._coloredMaterial.specularColor = color.subtract(new math_color/* Color3 */.Wo(.1, .1, .1)), this._hoverMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._hoverMaterial.diffuseColor = math_color/* Color3.Yellow */.Wo.Yellow(), this._disableMaterial = new standardMaterial/* StandardMaterial */.K("", gizmoLayer.utilityLayerScene), this._disableMaterial.diffuseColor = math_color/* Color3.Gray */.Wo.Gray(), this._disableMaterial.alpha = .4, this._gizmoMesh = PlaneDragGizmo._CreatePlane(gizmoLayer.utilityLayerScene, this._coloredMaterial), this._gizmoMesh.lookAt(this._rootMesh.position.add(dragPlaneNormal)), this._gizmoMesh.scaling.scaleInPlace(1 / 3), this._gizmoMesh.parent = this._rootMesh;let currentSnapDragDistance = 0;const tmpVector = new math_vector/* Vector3 */.P(),tmpSnapEvent = { snapDistance: 0 };this.dragBehavior = new PointerDragBehavior({ dragPlaneNormal: dragPlaneNormal }), this.dragBehavior.moveAttached = !1, this._rootMesh.addBehavior(this.dragBehavior), this.dragBehavior.onDragObservable.add((event) => {if (this.attachedNode) {if (this._handlePivot(), 0 == this.snapDistance) this.attachedNode.getWorldMatrix().addTranslationFromFloats(event.delta.x, event.delta.y, event.delta.z);else if (currentSnapDragDistance += event.dragDistance, Math.abs(currentSnapDragDistance) > this.snapDistance) {const dragSteps = Math.floor(Math.abs(currentSnapDragDistance) / this.snapDistance);currentSnapDragDistance %= this.snapDistance, event.delta.normalizeToRef(tmpVector), tmpVector.scaleInPlace(this.snapDistance * dragSteps), this.attachedNode.getWorldMatrix().addTranslationFromFloats(tmpVector.x, tmpVector.y, tmpVector.z), tmpSnapEvent.snapDistance = this.snapDistance * dragSteps, this.onSnapObservable.notifyObservers(tmpSnapEvent);}this._matrixChanged();}}), this.dragBehavior.onDragStartObservable.add(() => {this._dragging = !0;}), this.dragBehavior.onDragEndObservable.add(() => {this._dragging = !1;});const light = gizmoLayer._getSharedGizmoLight();light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));const cache = { gizmoMeshes: this._gizmoMesh.getChildMeshes(), colliderMeshes: this._gizmoMesh.getChildMeshes(), material: this._coloredMaterial, hoverMaterial: this._hoverMaterial, disableMaterial: this._disableMaterial, active: !1, dragBehavior: this.dragBehavior };null === (_a = this._parent) || void 0 === _a ? void 0 : _a.addToAxisCache(this._gizmoMesh, cache), this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {var _a;if (!this._customMeshSet && (this._isHovered = -1 != cache.colliderMeshes.indexOf(null === (_a = null === pointerInfo || void 0 === pointerInfo ? void 0 : pointerInfo.pickInfo) || void 0 === _a ? void 0 : _a.pickedMesh), !this._parent)) {const material = cache.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial;this._setGizmoMeshMaterial(cache.gizmoMeshes, material);}}), this.dragBehavior.onEnabledObservable.add((newState) => {this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? this._coloredMaterial : this._disableMaterial);});}_attachedNodeChanged(value) {this.dragBehavior && (this.dragBehavior.enabled = !!value);}set isEnabled(value) {this._isEnabled = value, value ? this._parent && (this.attachedNode = this._parent.attachedNode) : this.attachedNode = null;}get isEnabled() {return this._isEnabled;}dispose() {this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), super.dispose(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {matl && matl.dispose();});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/positionGizmo.js
class PositionGizmo extends Gizmo {get attachedMesh() {return this._meshAttached;}set attachedMesh(mesh) {this._meshAttached = mesh, this._nodeAttached = mesh, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {gizmo.attachedMesh = gizmo.isEnabled ? mesh : null;});}get attachedNode() {return this._nodeAttached;}set attachedNode(node) {this._meshAttached = null, this._nodeAttached = node, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {gizmo.attachedNode = gizmo.isEnabled ? node : null;});}get isHovered() {let hovered = !1;return [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {hovered = hovered || gizmo.isHovered;}), hovered;}constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, thickness = 1, gizmoManager) {super(gizmoLayer), this._meshAttached = null, this._nodeAttached = null, this._observables = [], this._gizmoAxisCache = new Map(), this.onDragStartObservable = new observable/* Observable */.y$(), this.onDragEndObservable = new observable/* Observable */.y$(), this._planarGizmoEnabled = !1, this.xGizmo = new AxisDragGizmo(new math_vector/* Vector3 */.P(1, 0, 0), math_color/* Color3.Red */.Wo.Red().scale(.5), gizmoLayer, this, thickness), this.yGizmo = new AxisDragGizmo(new math_vector/* Vector3 */.P(0, 1, 0), math_color/* Color3.Green */.Wo.Green().scale(.5), gizmoLayer, this, thickness), this.zGizmo = new AxisDragGizmo(new math_vector/* Vector3 */.P(0, 0, 1), math_color/* Color3.Blue */.Wo.Blue().scale(.5), gizmoLayer, this, thickness), this.xPlaneGizmo = new PlaneDragGizmo(new math_vector/* Vector3 */.P(1, 0, 0), math_color/* Color3.Red */.Wo.Red().scale(.5), this.gizmoLayer, this), this.yPlaneGizmo = new PlaneDragGizmo(new math_vector/* Vector3 */.P(0, 1, 0), math_color/* Color3.Green */.Wo.Green().scale(.5), this.gizmoLayer, this), this.zPlaneGizmo = new PlaneDragGizmo(new math_vector/* Vector3 */.P(0, 0, 1), math_color/* Color3.Blue */.Wo.Blue().scale(.5), this.gizmoLayer, this), [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {gizmo.dragBehavior.onDragStartObservable.add(() => {this.onDragStartObservable.notifyObservers({});}), gizmo.dragBehavior.onDragEndObservable.add(() => {this.onDragEndObservable.notifyObservers({});});}), this.attachedMesh = null, gizmoManager ? gizmoManager.addToAxisCache(this._gizmoAxisCache) : Gizmo.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache);}set planarGizmoEnabled(value) {this._planarGizmoEnabled = value, [this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {gizmo && (gizmo.isEnabled = value, value && (gizmo.attachedMesh ? gizmo.attachedMesh = this.attachedMesh : gizmo.attachedNode = this.attachedNode));}, this);}get planarGizmoEnabled() {return this._planarGizmoEnabled;}set updateGizmoRotationToMatchAttachedMesh(value) {this._updateGizmoRotationToMatchAttachedMesh = value, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {gizmo && (gizmo.updateGizmoRotationToMatchAttachedMesh = value);});}get updateGizmoRotationToMatchAttachedMesh() {return this._updateGizmoRotationToMatchAttachedMesh;}set updateGizmoPositionToMatchAttachedMesh(value) {this._updateGizmoPositionToMatchAttachedMesh = value, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {gizmo && (gizmo.updateGizmoPositionToMatchAttachedMesh = value);});}get updateGizmoPositionToMatchAttachedMesh() {return this._updateGizmoPositionToMatchAttachedMesh;}set updateScale(value) {this.xGizmo && (this.xGizmo.updateScale = value, this.yGizmo.updateScale = value, this.zGizmo.updateScale = value);}get updateScale() {return this.xGizmo.updateScale;}set snapDistance(value) {this._snapDistance = value, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {gizmo && (gizmo.snapDistance = value);});}get snapDistance() {return this._snapDistance;}set scaleRatio(value) {this._scaleRatio = value, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {gizmo && (gizmo.scaleRatio = value);});}get scaleRatio() {return this._scaleRatio;}addToAxisCache(mesh, cache) {this._gizmoAxisCache.set(mesh, cache);}dispose() {[this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {gizmo && gizmo.dispose();}), this._observables.forEach((obs) => {this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs);}), this.onDragStartObservable.clear(), this.onDragEndObservable.clear();}setCustomMesh() {logger/* Logger.Error */.Y.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)");}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/polyhedronBuilder.js
function CreatePolyhedronVertexData(options) {const polyhedra = [];polyhedra[0] = { vertex: [[0, 0, 1.732051], [1.632993, 0, -.5773503], [-.8164966, 1.414214, -.5773503], [-.8164966, -1.414214, -.5773503]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 1], [1, 3, 2]] }, polyhedra[1] = { vertex: [[0, 0, 1.414214], [1.414214, 0, 0], [0, 1.414214, 0], [-1.414214, 0, 0], [0, -1.414214, 0], [0, 0, -1.414214]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [3, 5, 4]] }, polyhedra[2] = { vertex: [[0, 0, 1.070466], [.7136442, 0, .7978784], [-.3568221, .618034, .7978784], [-.3568221, -.618034, .7978784], [.7978784, .618034, .3568221], [.7978784, -.618034, .3568221], [-.9341724, .381966, .3568221], [.1362939, 1, .3568221], [.1362939, -1, .3568221], [-.9341724, -.381966, .3568221], [.9341724, .381966, -.3568221], [.9341724, -.381966, -.3568221], [-.7978784, .618034, -.3568221], [-.1362939, 1, -.3568221], [-.1362939, -1, -.3568221], [-.7978784, -.618034, -.3568221], [.3568221, .618034, -.7978784], [.3568221, -.618034, -.7978784], [-.7136442, 0, -.7978784], [0, 0, -1.070466]], face: [[0, 1, 4, 7, 2], [0, 2, 6, 9, 3], [0, 3, 8, 5, 1], [1, 5, 11, 10, 4], [2, 7, 13, 12, 6], [3, 9, 15, 14, 8], [4, 10, 16, 13, 7], [5, 8, 14, 17, 11], [6, 12, 18, 15, 9], [10, 11, 17, 19, 16], [12, 13, 16, 19, 18], [14, 15, 18, 19, 17]] }, polyhedra[3] = { vertex: [[0, 0, 1.175571], [1.051462, 0, .5257311], [.3249197, 1, .5257311], [-.8506508, .618034, .5257311], [-.8506508, -.618034, .5257311], [.3249197, -1, .5257311], [.8506508, .618034, -.5257311], [.8506508, -.618034, -.5257311], [-.3249197, 1, -.5257311], [-1.051462, 0, -.5257311], [-.3249197, -1, -.5257311], [0, 0, -1.175571]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 5, 7], [1, 7, 6], [1, 6, 2], [2, 6, 8], [2, 8, 3], [3, 8, 9], [3, 9, 4], [4, 9, 10], [4, 10, 5], [5, 10, 7], [6, 7, 11], [6, 11, 8], [7, 10, 11], [8, 11, 9], [9, 11, 10]] }, polyhedra[4] = { vertex: [[0, 0, 1.070722], [.7148135, 0, .7971752], [-.104682, .7071068, .7971752], [-.6841528, .2071068, .7971752], [-.104682, -.7071068, .7971752], [.6101315, .7071068, .5236279], [1.04156, .2071068, .1367736], [.6101315, -.7071068, .5236279], [-.3574067, 1, .1367736], [-.7888348, -.5, .5236279], [-.9368776, .5, .1367736], [-.3574067, -1, .1367736], [.3574067, 1, -.1367736], [.9368776, -.5, -.1367736], [.7888348, .5, -.5236279], [.3574067, -1, -.1367736], [-.6101315, .7071068, -.5236279], [-1.04156, -.2071068, -.1367736], [-.6101315, -.7071068, -.5236279], [.104682, .7071068, -.7971752], [.6841528, -.2071068, -.7971752], [.104682, -.7071068, -.7971752], [-.7148135, 0, -.7971752], [0, 0, -1.070722]], face: [[0, 2, 3], [1, 6, 5], [4, 9, 11], [7, 15, 13], [8, 16, 10], [12, 14, 19], [17, 22, 18], [20, 21, 23], [0, 1, 5, 2], [0, 3, 9, 4], [0, 4, 7, 1], [1, 7, 13, 6], [2, 5, 12, 8], [2, 8, 10, 3], [3, 10, 17, 9], [4, 11, 15, 7], [5, 6, 14, 12], [6, 13, 20, 14], [8, 12, 19, 16], [9, 17, 18, 11], [10, 16, 22, 17], [11, 18, 21, 15], [13, 15, 21, 20], [14, 20, 23, 19], [16, 19, 23, 22], [18, 22, 23, 21]] }, polyhedra[5] = { vertex: [[0, 0, 1.322876], [1.309307, 0, .1889822], [-.9819805, .8660254, .1889822], [.1636634, -1.299038, .1889822], [.3273268, .8660254, -.9449112], [-.8183171, -.4330127, -.9449112]], face: [[0, 3, 1], [2, 4, 5], [0, 1, 4, 2], [0, 2, 5, 3], [1, 3, 5, 4]] }, polyhedra[6] = { vertex: [[0, 0, 1.159953], [1.013464, 0, .5642542], [-.3501431, .9510565, .5642542], [-.7715208, -.6571639, .5642542], [.6633206, .9510565, -.03144481], [.8682979, -.6571639, -.3996071], [-1.121664, .2938926, -.03144481], [-.2348831, -1.063314, -.3996071], [.5181548, .2938926, -.9953061], [-.5850262, -.112257, -.9953061]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 9, 7], [5, 7, 9, 8], [0, 3, 7, 5, 1], [2, 4, 8, 9, 6]] }, polyhedra[7] = { vertex: [[0, 0, 1.118034], [.8944272, 0, .6708204], [-.2236068, .8660254, .6708204], [-.7826238, -.4330127, .6708204], [.6708204, .8660254, .2236068], [1.006231, -.4330127, -.2236068], [-1.006231, .4330127, .2236068], [-.6708204, -.8660254, -.2236068], [.7826238, .4330127, -.6708204], [.2236068, -.8660254, -.6708204], [-.8944272, 0, -.6708204], [0, 0, -1.118034]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 10, 7], [5, 9, 11, 8], [7, 10, 11, 9], [0, 3, 7, 9, 5, 1], [2, 4, 8, 11, 10, 6]] }, polyhedra[8] = { vertex: [[-.729665, .670121, .319155], [-.655235, -.29213, -.754096], [-.093922, -.607123, .537818], [.702196, .595691, .485187], [.776626, -.36656, -.588064]], face: [[1, 4, 2], [0, 1, 2], [3, 0, 2], [4, 3, 2], [4, 1, 0, 3]] }, polyhedra[9] = { vertex: [[-.868849, -.100041, .61257], [-.329458, .976099, .28078], [-.26629, -.013796, -.477654], [-.13392, -1.034115, .229829], [.738834, .707117, -.307018], [.859683, -.535264, -.338508]], face: [[3, 0, 2], [5, 3, 2], [4, 5, 2], [1, 4, 2], [0, 1, 2], [0, 3, 5, 4, 1]] }, polyhedra[10] = { vertex: [[-.610389, .243975, .531213], [-.187812, -.48795, -.664016], [-.187812, .9759, -.664016], [.187812, -.9759, .664016], [.798201, .243975, .132803]], face: [[1, 3, 0], [3, 4, 0], [3, 1, 4], [0, 2, 1], [0, 4, 2], [2, 4, 1]] }, polyhedra[11] = { vertex: [[-1.028778, .392027, -.048786], [-.640503, -.646161, .621837], [-.125162, -.395663, -.540059], [.004683, .888447, -.651988], [.125161, .395663, .540059], [.632925, -.791376, .433102], [1.031672, .157063, -.354165]], face: [[3, 2, 0], [2, 1, 0], [2, 5, 1], [0, 4, 3], [0, 1, 4], [4, 1, 5], [2, 3, 6], [3, 4, 6], [5, 2, 6], [4, 5, 6]] }, polyhedra[12] = { vertex: [[-.669867, .334933, -.529576], [-.669867, .334933, .529577], [-.4043, 1.212901, 0], [-.334933, -.669867, -.529576], [-.334933, -.669867, .529577], [.334933, .669867, -.529576], [.334933, .669867, .529577], [.4043, -1.212901, 0], [.669867, -.334933, -.529576], [.669867, -.334933, .529577]], face: [[8, 9, 7], [6, 5, 2], [3, 8, 7], [5, 0, 2], [4, 3, 7], [0, 1, 2], [9, 4, 7], [1, 6, 2], [9, 8, 5, 6], [8, 3, 0, 5], [3, 4, 1, 0], [4, 9, 6, 1]] }, polyhedra[13] = { vertex: [[-.931836, .219976, -.264632], [-.636706, .318353, .692816], [-.613483, -.735083, -.264632], [-.326545, .979634, 0], [-.318353, -.636706, .692816], [-.159176, .477529, -.856368], [.159176, -.477529, -.856368], [.318353, .636706, .692816], [.326545, -.979634, 0], [.613482, .735082, -.264632], [.636706, -.318353, .692816], [.931835, -.219977, -.264632]], face: [[11, 10, 8], [7, 9, 3], [6, 11, 8], [9, 5, 3], [2, 6, 8], [5, 0, 3], [4, 2, 8], [0, 1, 3], [10, 4, 8], [1, 7, 3], [10, 11, 9, 7], [11, 6, 5, 9], [6, 2, 0, 5], [2, 4, 1, 0], [4, 10, 7, 1]] }, polyhedra[14] = { vertex: [[-.93465, .300459, -.271185], [-.838689, -.260219, -.516017], [-.711319, .717591, .128359], [-.710334, -.156922, .080946], [-.599799, .556003, -.725148], [-.503838, -.004675, -.969981], [-.487004, .26021, .48049], [-.460089, -.750282, -.512622], [-.376468, .973135, -.325605], [-.331735, -.646985, .084342], [-.254001, .831847, .530001], [-.125239, -.494738, -.966586], [.029622, .027949, .730817], [.056536, -.982543, -.262295], [.08085, 1.087391, .076037], [.125583, -.532729, .485984], [.262625, .599586, .780328], [.391387, -.726999, -.716259], [.513854, -.868287, .139347], [.597475, .85513, .326364], [.641224, .109523, .783723], [.737185, -.451155, .538891], [.848705, -.612742, -.314616], [.976075, .365067, .32976], [1.072036, -.19561, .084927]], face: [[15, 18, 21], [12, 20, 16], [6, 10, 2], [3, 0, 1], [9, 7, 13], [2, 8, 4, 0], [0, 4, 5, 1], [1, 5, 11, 7], [7, 11, 17, 13], [13, 17, 22, 18], [18, 22, 24, 21], [21, 24, 23, 20], [20, 23, 19, 16], [16, 19, 14, 10], [10, 14, 8, 2], [15, 9, 13, 18], [12, 15, 21, 20], [6, 12, 16, 10], [3, 6, 2, 0], [9, 3, 1, 7], [9, 15, 12, 6, 3], [22, 17, 11, 5, 4, 8, 14, 19, 23, 24]] };const type = options.type && (0 > options.type || options.type >= polyhedra.length) ? 0 : options.type || 0,size = options.size,sizeX = options.sizeX || size || 1,sizeY = options.sizeY || size || 1,sizeZ = options.sizeZ || size || 1,data = options.custom || polyhedra[type],nbfaces = data.face.length,faceUV = options.faceUV || Array(nbfaces),faceColors = options.faceColors,flat = void 0 === options.flat || options.flat,sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,positions = [],indices = [],normals = [],uvs = [],colors = [];let index = 0,faceIdx = 0;const indexes = [];let u,v,ang,x,y,tmp,i = 0,f = 0;if (flat) for (f = 0; f < nbfaces; f++) faceColors && void 0 === faceColors[f] && (faceColors[f] = new math_color/* Color4 */.HE(1, 1, 1, 1)), faceUV && void 0 === faceUV[f] && (faceUV[f] = new math_vector/* Vector4 */.Lt(0, 0, 1, 1));if (!flat) {for (i = 0; i < data.vertex.length; i++) positions.push(data.vertex[i][0] * sizeX, data.vertex[i][1] * sizeY, data.vertex[i][2] * sizeZ), uvs.push(0, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 : 0);for (f = 0; f < nbfaces; f++) for (i = 0; i < data.face[f].length - 2; i++) indices.push(data.face[f][0], data.face[f][i + 2], data.face[f][i + 1]);} else for (f = 0; f < nbfaces; f++) {const fl = data.face[f].length;for (ang = 2 * Math.PI / fl, x = .5 * Math.tan(ang / 2), y = .5, i = 0; i < fl; i++) positions.push(data.vertex[data.face[f][i]][0] * sizeX, data.vertex[data.face[f][i]][1] * sizeY, data.vertex[data.face[f][i]][2] * sizeZ), indexes.push(index), index++, u = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * (.5 + x), v = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * (y - .5), uvs.push(u, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v), tmp = x * Math.cos(ang) - y * Math.sin(ang), y = x * Math.sin(ang) + y * Math.cos(ang), x = tmp, faceColors && colors.push(faceColors[f].r, faceColors[f].g, faceColors[f].b, faceColors[f].a);for (i = 0; i < fl - 2; i++) indices.push(indexes[0 + faceIdx], indexes[i + 2 + faceIdx], indexes[i + 1 + faceIdx]);faceIdx += fl;}mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(positions, indices, normals), mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.positions = positions, vertexData.indices = indices, vertexData.normals = normals, vertexData.uvs = uvs, faceColors && flat && (vertexData.colors = colors), vertexData;}function CreatePolyhedron(name, options = {}, scene = null) {const polyhedron = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), polyhedron._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreatePolyhedronVertexData(options);return vertexData.applyToMesh(polyhedron, options.updatable), polyhedron;}const PolyhedronBuilder = { CreatePolyhedron };mesh_vertexData/* VertexData.CreatePolyhedron */.x.CreatePolyhedron = CreatePolyhedronVertexData, Meshes_mesh/* Mesh.CreatePolyhedron */.Kj.CreatePolyhedron = (name, options, scene) => CreatePolyhedron(name, options, scene);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/scaleGizmo.js
class ScaleGizmo extends Gizmo {get coloredMaterial() {return this._coloredMaterial;}get hoverMaterial() {return this._hoverMaterial;}get disableMaterial() {return this._disableMaterial;}get attachedMesh() {return this._meshAttached;}set attachedMesh(mesh) {this._meshAttached = mesh, this._nodeAttached = mesh, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {gizmo.attachedMesh = gizmo.isEnabled ? mesh : null;});}get attachedNode() {return this._nodeAttached;}set attachedNode(node) {this._meshAttached = null, this._nodeAttached = node, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {gizmo.attachedNode = gizmo.isEnabled ? node : null;});}set updateScale(value) {this.xGizmo && (this.xGizmo.updateScale = value, this.yGizmo.updateScale = value, this.zGizmo.updateScale = value);}get updateScale() {return this.xGizmo.updateScale;}get isHovered() {let hovered = !1;return [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {hovered = hovered || gizmo.isHovered;}), hovered;}constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, thickness = 1, gizmoManager) {super(gizmoLayer), this._meshAttached = null, this._nodeAttached = null, this._sensitivity = 1, this._observables = [], this._gizmoAxisCache = new Map(), this.onDragStartObservable = new observable/* Observable */.y$(), this.onDragEndObservable = new observable/* Observable */.y$(), this.uniformScaleGizmo = this._createUniformScaleMesh(), this.xGizmo = new AxisScaleGizmo(new math_vector/* Vector3 */.P(1, 0, 0), math_color/* Color3.Red */.Wo.Red().scale(.5), gizmoLayer, this, thickness), this.yGizmo = new AxisScaleGizmo(new math_vector/* Vector3 */.P(0, 1, 0), math_color/* Color3.Green */.Wo.Green().scale(.5), gizmoLayer, this, thickness), this.zGizmo = new AxisScaleGizmo(new math_vector/* Vector3 */.P(0, 0, 1), math_color/* Color3.Blue */.Wo.Blue().scale(.5), gizmoLayer, this, thickness), [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {gizmo.dragBehavior.onDragStartObservable.add(() => {this.onDragStartObservable.notifyObservers({});}), gizmo.dragBehavior.onDragEndObservable.add(() => {this.onDragEndObservable.notifyObservers({});});}), this.attachedMesh = null, this.attachedNode = null, gizmoManager ? gizmoManager.addToAxisCache(this._gizmoAxisCache) : Gizmo.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache);}_createUniformScaleMesh() {this._coloredMaterial = new standardMaterial/* StandardMaterial */.K("", this.gizmoLayer.utilityLayerScene), this._coloredMaterial.diffuseColor = math_color/* Color3.Gray */.Wo.Gray(), this._hoverMaterial = new standardMaterial/* StandardMaterial */.K("", this.gizmoLayer.utilityLayerScene), this._hoverMaterial.diffuseColor = math_color/* Color3.Yellow */.Wo.Yellow(), this._disableMaterial = new standardMaterial/* StandardMaterial */.K("", this.gizmoLayer.utilityLayerScene), this._disableMaterial.diffuseColor = math_color/* Color3.Gray */.Wo.Gray(), this._disableMaterial.alpha = .4;const uniformScaleGizmo = new AxisScaleGizmo(new math_vector/* Vector3 */.P(0, 1, 0), math_color/* Color3.Gray */.Wo.Gray().scale(.5), this.gizmoLayer, this);uniformScaleGizmo.updateGizmoRotationToMatchAttachedMesh = !1, uniformScaleGizmo.uniformScaling = !0, this._uniformScalingMesh = CreatePolyhedron("uniform", { type: 1 }, uniformScaleGizmo.gizmoLayer.utilityLayerScene), this._uniformScalingMesh.scaling.scaleInPlace(.01), this._uniformScalingMesh.visibility = 0, this._octahedron = CreatePolyhedron("", { type: 1 }, uniformScaleGizmo.gizmoLayer.utilityLayerScene), this._octahedron.scaling.scaleInPlace(.007), this._uniformScalingMesh.addChild(this._octahedron), uniformScaleGizmo.setCustomMesh(this._uniformScalingMesh, !0);const light = this.gizmoLayer._getSharedGizmoLight();light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._octahedron);const cache = { gizmoMeshes: [this._octahedron, this._uniformScalingMesh], colliderMeshes: [this._uniformScalingMesh], material: this._coloredMaterial, hoverMaterial: this._hoverMaterial, disableMaterial: this._disableMaterial, active: !1, dragBehavior: uniformScaleGizmo.dragBehavior };return this.addToAxisCache(uniformScaleGizmo._rootMesh, cache), uniformScaleGizmo;}set updateGizmoRotationToMatchAttachedMesh(value) {value ? (this._updateGizmoRotationToMatchAttachedMesh = value, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {gizmo && (gizmo.updateGizmoRotationToMatchAttachedMesh = value);})) : logger/* Logger.Warn */.Y.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported.");}get updateGizmoRotationToMatchAttachedMesh() {return this._updateGizmoRotationToMatchAttachedMesh;}set snapDistance(value) {this._snapDistance = value, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {gizmo && (gizmo.snapDistance = value);});}get snapDistance() {return this._snapDistance;}set scaleRatio(value) {this._scaleRatio = value, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {gizmo && (gizmo.scaleRatio = value);});}get scaleRatio() {return this._scaleRatio;}set sensitivity(value) {this._sensitivity = value, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {gizmo && (gizmo.sensitivity = value);});}get sensitivity() {return this._sensitivity;}addToAxisCache(mesh, cache) {this._gizmoAxisCache.set(mesh, cache);}dispose() {[this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {gizmo && gizmo.dispose();}), this._observables.forEach((obs) => {this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs);}), this.onDragStartObservable.clear(), this.onDragEndObservable.clear(), [this._uniformScalingMesh, this._octahedron].forEach((msh) => {msh && msh.dispose();}), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {matl && matl.dispose();});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/gizmoManager.js
class GizmoManager {get keepDepthUtilityLayer() {return this._defaultKeepDepthUtilityLayer;}get utilityLayer() {return this._defaultUtilityLayer;}get isHovered() {let hovered = !1;for (const key in this.gizmos) {const gizmo = this.gizmos[key];if (gizmo && gizmo.isHovered) {hovered = !0;break;}}return hovered;}set scaleRatio(value) {this._scaleRatio = value, [this.gizmos.positionGizmo, this.gizmos.rotationGizmo, this.gizmos.scaleGizmo].forEach((gizmo) => {gizmo && (gizmo.scaleRatio = value);});}get scaleRatio() {return this._scaleRatio;}constructor(_scene, thickness = 1, utilityLayer = UtilityLayerRenderer.DefaultUtilityLayer, keepDepthUtilityLayer = UtilityLayerRenderer.DefaultKeepDepthUtilityLayer) {this._scene = _scene, this.clearGizmoOnEmptyPointerEvent = !1, this.enableAutoPicking = !0, this.onAttachedToMeshObservable = new observable/* Observable */.y$(), this.onAttachedToNodeObservable = new observable/* Observable */.y$(), this._gizmosEnabled = { positionGizmo: !1, rotationGizmo: !1, scaleGizmo: !1, boundingBoxGizmo: !1 }, this._pointerObservers = [], this._attachedMesh = null, this._attachedNode = null, this._boundingBoxColor = math_color/* Color3.FromHexString */.Wo.FromHexString("#0984e3"), this._thickness = 1, this._scaleRatio = 1, this._gizmoAxisCache = new Map(), this.boundingBoxDragBehavior = new SixDofDragBehavior(), this.attachableMeshes = null, this.attachableNodes = null, this.usePointerToAttachGizmos = !0, this._defaultUtilityLayer = utilityLayer, this._defaultKeepDepthUtilityLayer = keepDepthUtilityLayer, this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = !1, this._thickness = thickness, this.gizmos = { positionGizmo: null, rotationGizmo: null, scaleGizmo: null, boundingBoxGizmo: null };const attachToMeshPointerObserver = this._attachToMeshPointerObserver(_scene),gizmoAxisPointerObserver = Gizmo.GizmoAxisPointerObserver(this._defaultUtilityLayer, this._gizmoAxisCache);this._pointerObservers = [attachToMeshPointerObserver, gizmoAxisPointerObserver];}_attachToMeshPointerObserver(scene) {const pointerObserver = scene.onPointerObservable.add((pointerInfo) => {if (this.usePointerToAttachGizmos && pointerInfo.type == pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN) if (!(pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh)) this.clearGizmoOnEmptyPointerEvent && this.attachToMesh(null);else if (this.enableAutoPicking) {let node = pointerInfo.pickInfo.pickedMesh;if (null == this.attachableMeshes) for (; node && null != node.parent;) node = node.parent;else {let found = !1;this.attachableMeshes.forEach((mesh) => {node && (node == mesh || node.isDescendantOf(mesh)) && (node = mesh, found = !0);}), found || (node = null);}node instanceof abstractMesh/* AbstractMesh */.x ? this._attachedMesh != node && this.attachToMesh(node) : this.clearGizmoOnEmptyPointerEvent && this.attachToMesh(null);}});return pointerObserver;}attachToMesh(mesh) {for (const key in this._attachedMesh && this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh = mesh, this._attachedNode = null, this.gizmos) {const gizmo = this.gizmos[key];gizmo && this._gizmosEnabled[key] && (gizmo.attachedMesh = mesh);}this.boundingBoxGizmoEnabled && this._attachedMesh && this._attachedMesh.addBehavior(this.boundingBoxDragBehavior), this.onAttachedToMeshObservable.notifyObservers(mesh);}attachToNode(node) {for (const key in this._attachedMesh && this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh = null, this._attachedNode = node, this.gizmos) {const gizmo = this.gizmos[key];gizmo && this._gizmosEnabled[key] && (gizmo.attachedNode = node);}this.boundingBoxGizmoEnabled && this._attachedNode && this._attachedNode.addBehavior(this.boundingBoxDragBehavior), this.onAttachedToNodeObservable.notifyObservers(node);}set positionGizmoEnabled(value) {value ? (!this.gizmos.positionGizmo && (this.gizmos.positionGizmo = new PositionGizmo(this._defaultUtilityLayer, this._thickness, this)), this._attachedNode ? this.gizmos.positionGizmo.attachedNode = this._attachedNode : this.gizmos.positionGizmo.attachedMesh = this._attachedMesh) : this.gizmos.positionGizmo && (this.gizmos.positionGizmo.attachedNode = null), this._gizmosEnabled.positionGizmo = value;}get positionGizmoEnabled() {return this._gizmosEnabled.positionGizmo;}set rotationGizmoEnabled(value) {value ? (!this.gizmos.rotationGizmo && (this.gizmos.rotationGizmo = new RotationGizmo(this._defaultUtilityLayer, 32, !1, this._thickness, this)), this._attachedNode ? this.gizmos.rotationGizmo.attachedNode = this._attachedNode : this.gizmos.rotationGizmo.attachedMesh = this._attachedMesh) : this.gizmos.rotationGizmo && (this.gizmos.rotationGizmo.attachedNode = null), this._gizmosEnabled.rotationGizmo = value;}get rotationGizmoEnabled() {return this._gizmosEnabled.rotationGizmo;}set scaleGizmoEnabled(value) {value ? (this.gizmos.scaleGizmo = this.gizmos.scaleGizmo || new ScaleGizmo(this._defaultUtilityLayer, this._thickness, this), this._attachedNode ? this.gizmos.scaleGizmo.attachedNode = this._attachedNode : this.gizmos.scaleGizmo.attachedMesh = this._attachedMesh) : this.gizmos.scaleGizmo && (this.gizmos.scaleGizmo.attachedNode = null), this._gizmosEnabled.scaleGizmo = value;}get scaleGizmoEnabled() {return this._gizmosEnabled.scaleGizmo;}set boundingBoxGizmoEnabled(value) {value ? (this.gizmos.boundingBoxGizmo = this.gizmos.boundingBoxGizmo || new BoundingBoxGizmo(this._boundingBoxColor, this._defaultKeepDepthUtilityLayer), this._attachedMesh ? this.gizmos.boundingBoxGizmo.attachedMesh = this._attachedMesh : this.gizmos.boundingBoxGizmo.attachedNode = this._attachedNode, this._attachedMesh ? (this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh.addBehavior(this.boundingBoxDragBehavior)) : this._attachedNode && (this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode.addBehavior(this.boundingBoxDragBehavior))) : this.gizmos.boundingBoxGizmo && (this._attachedMesh ? this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior) : this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this.gizmos.boundingBoxGizmo.attachedNode = null), this._gizmosEnabled.boundingBoxGizmo = value;}get boundingBoxGizmoEnabled() {return this._gizmosEnabled.boundingBoxGizmo;}addToAxisCache(gizmoAxisCache) {0 < gizmoAxisCache.size && gizmoAxisCache.forEach((v, k) => {this._gizmoAxisCache.set(k, v);});}dispose() {var _a, _b;for (const key in this._pointerObservers.forEach((observer) => {this._scene.onPointerObservable.remove(observer);}), this.gizmos) {const gizmo = this.gizmos[key];gizmo && gizmo.dispose();}this._defaultKeepDepthUtilityLayer !== UtilityLayerRenderer._DefaultKeepDepthUtilityLayer && (null === (_a = this._defaultKeepDepthUtilityLayer) || void 0 === _a ? void 0 : _a.dispose()), this._defaultUtilityLayer !== UtilityLayerRenderer._DefaultUtilityLayer && (null === (_b = this._defaultUtilityLayer) || void 0 === _b ? void 0 : _b.dispose()), this.boundingBoxDragBehavior.detach(), this.onAttachedToMeshObservable.clear();}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/directionalLight.js
var directionalLight = __webpack_require__("./node_modules/@babylonjs/core/Lights/directionalLight.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/discBuilder.js
function CreateDiscVertexData(options) {const positions = [],indices = [],normals = [],uvs = [],radius = options.radius || .5,tessellation = options.tessellation || 64,arc = options.arc && (0 >= options.arc || 1 < options.arc) ? 1 : options.arc || 1,sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE;positions.push(0, 0, 0), uvs.push(.5, .5);const theta = 2 * Math.PI * arc,step = 1 === arc ? theta / tessellation : theta / (tessellation - 1);let a = 0;for (let t = 0; t < tessellation; t++) {const x = Math.cos(a),y = Math.sin(a),v = (1 - y) / 2;positions.push(radius * x, radius * y, 0), uvs.push((x + 1) / 2, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v), a += step;}1 === arc && (positions.push(positions[3], positions[4], positions[5]), uvs.push(uvs[2], compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - uvs[3] : uvs[3]));const vertexNb = positions.length / 3;for (let i = 1; i < vertexNb - 1; i++) indices.push(i + 1, 0, i);mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(positions, indices, normals), mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreateDisc(name, options = {}, scene = null) {const disc = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), disc._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateDiscVertexData(options);return vertexData.applyToMesh(disc, options.updatable), disc;}const DiscBuilder = { CreateDisc };mesh_vertexData/* VertexData.CreateDisc */.x.CreateDisc = CreateDiscVertexData, Meshes_mesh/* Mesh.CreateDisc */.Kj.CreateDisc = (name, radius, tessellation, scene = null, updatable, sideOrientation) => {return CreateDisc(name, { radius, tessellation, sideOrientation, updatable }, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/hemisphereBuilder.js
function CreateHemisphere(name, options = {}, scene) {options.diameter || (options.diameter = 1), options.segments || (options.segments = 16);const halfSphere = CreateSphere("", { slice: .5, diameter: options.diameter, segments: options.segments }, scene),disc = CreateDisc("", { radius: options.diameter / 2, tessellation: 3 * options.segments + (4 - options.segments) }, scene);disc.rotation.x = -Math.PI / 2, disc.parent = halfSphere;const merged = Meshes_mesh/* Mesh.MergeMeshes */.Kj.MergeMeshes([disc, halfSphere], !0);return merged.name = name, merged;}const HemisphereBuilder = { CreateHemisphere };Meshes_mesh/* Mesh.CreateHemisphere */.Kj.CreateHemisphere = (name, segments, diameter, scene) => {return CreateHemisphere(name, { segments: segments, diameter: diameter }, scene);};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/spotLight.js
var spotLight = __webpack_require__("./node_modules/@babylonjs/core/Lights/spotLight.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/lightGizmo.js
class LightGizmo extends Gizmo {constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer) {super(gizmoLayer), this._cachedPosition = new math_vector/* Vector3 */.P(), this._cachedForward = new math_vector/* Vector3 */.P(0, 0, 1), this._pointerObserver = null, this.onClickedObservable = new observable/* Observable */.y$(), this._light = null, this.attachedMesh = new abstractMesh/* AbstractMesh */.x("", this.gizmoLayer.utilityLayerScene), this._attachedMeshParent = new transformNode/* TransformNode */.Y("parent", this.gizmoLayer.utilityLayerScene), this.attachedMesh.parent = this._attachedMeshParent, this._material = new standardMaterial/* StandardMaterial */.K("light", this.gizmoLayer.utilityLayerScene), this._material.diffuseColor = new math_color/* Color3 */.Wo(.5, .5, .5), this._material.specularColor = new math_color/* Color3 */.Wo(.1, .1, .1), this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {this._light && (this._isHovered = !!(pointerInfo.pickInfo && -1 != this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh)), this._isHovered && 0 === pointerInfo.event.button && this.onClickedObservable.notifyObservers(this._light));}, pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN);}get attachedNode() {return this.attachedMesh;}set attachedNode(value) {console.warn("Nodes cannot be attached to LightGizmo. Attach to a mesh instead.");}set light(light) {if (this._light = light, light) {this._lightMesh && this._lightMesh.dispose(), this._lightMesh = light instanceof hemisphericLight/* HemisphericLight */.e ? LightGizmo._CreateHemisphericLightMesh(this.gizmoLayer.utilityLayerScene) : light instanceof directionalLight/* DirectionalLight */.O ? LightGizmo._CreateDirectionalLightMesh(this.gizmoLayer.utilityLayerScene) : light instanceof spotLight/* SpotLight */.P ? LightGizmo._CreateSpotLightMesh(this.gizmoLayer.utilityLayerScene) : LightGizmo._CreatePointLightMesh(this.gizmoLayer.utilityLayerScene), this._lightMesh.getChildMeshes(!1).forEach((m) => {m.material = this._material;}), this._lightMesh.parent = this._rootMesh;const gizmoLight = this.gizmoLayer._getSharedGizmoLight();gizmoLight.includedOnlyMeshes = gizmoLight.includedOnlyMeshes.concat(this._lightMesh.getChildMeshes(!1)), this._lightMesh.rotationQuaternion = new math_vector/* Quaternion */._f(), this.attachedMesh.reservedDataStore || (this.attachedMesh.reservedDataStore = {}), this.attachedMesh.reservedDataStore.lightGizmo = this, light.parent && this._attachedMeshParent.freezeWorldMatrix(light.parent.getWorldMatrix()), light.position && (this.attachedMesh.position.copyFrom(light.position), this.attachedMesh.computeWorldMatrix(!0), this._cachedPosition.copyFrom(this.attachedMesh.position)), light.direction && (this.attachedMesh.setDirection(light.direction), this.attachedMesh.computeWorldMatrix(!0), this._cachedForward.copyFrom(this.attachedMesh.forward)), this._update();}}get light() {return this._light;}get material() {return this._material;}_update() {if (super._update(), !!this._light) {if (this._light.parent && this._attachedMeshParent.freezeWorldMatrix(this._light.parent.getWorldMatrix()), this._light.position) if (!this.attachedMesh.position.equals(this._cachedPosition)) {const position = this.attachedMesh.position;this._light.position = new math_vector/* Vector3 */.P(position.x, position.y, position.z), this._cachedPosition.copyFrom(this.attachedMesh.position);} else this.attachedMesh.position.copyFrom(this._light.position), this.attachedMesh.computeWorldMatrix(!0), this._cachedPosition.copyFrom(this.attachedMesh.position);if (this._light.direction) if (1e-4 < math_vector/* Vector3.DistanceSquared */.P.DistanceSquared(this.attachedMesh.forward, this._cachedForward)) {const direction = this.attachedMesh.forward;this._light.direction = new math_vector/* Vector3 */.P(direction.x, direction.y, direction.z), this._cachedForward.copyFrom(this.attachedMesh.forward);} else 1e-4 < math_vector/* Vector3.DistanceSquared */.P.DistanceSquared(this.attachedMesh.forward, this._light.direction) && (this.attachedMesh.setDirection(this._light.direction), this.attachedMesh.computeWorldMatrix(!0), this._cachedForward.copyFrom(this.attachedMesh.forward));}}dispose() {this.onClickedObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this._material.dispose(), super.dispose(), this._attachedMeshParent.dispose();}static _CreateHemisphericLightMesh(scene) {const root = new Meshes_mesh/* Mesh */.Kj("hemisphereLight", scene),hemisphere = CreateHemisphere(root.name, { segments: 10, diameter: 1 }, scene);hemisphere.position.z = -.15, hemisphere.rotation.x = Math.PI / 2, hemisphere.parent = root;const lines = this._CreateLightLines(3, scene);return lines.parent = root, root.scaling.scaleInPlace(LightGizmo._Scale), root.rotation.x = Math.PI / 2, root;}static _CreatePointLightMesh(scene) {const root = new Meshes_mesh/* Mesh */.Kj("pointLight", scene),sphere = CreateSphere(root.name, { segments: 10, diameter: 1 }, scene);sphere.rotation.x = Math.PI / 2, sphere.parent = root;const lines = this._CreateLightLines(5, scene);return lines.parent = root, root.scaling.scaleInPlace(LightGizmo._Scale), root.rotation.x = Math.PI / 2, root;}static _CreateSpotLightMesh(scene) {const root = new Meshes_mesh/* Mesh */.Kj("spotLight", scene),sphere = CreateSphere(root.name, { segments: 10, diameter: 1 }, scene);sphere.parent = root;const hemisphere = CreateHemisphere(root.name, { segments: 10, diameter: 2 }, scene);hemisphere.parent = root, hemisphere.rotation.x = -Math.PI / 2;const lines = this._CreateLightLines(2, scene);return lines.parent = root, root.scaling.scaleInPlace(LightGizmo._Scale), root.rotation.x = Math.PI / 2, root;}static _CreateDirectionalLightMesh(scene) {const root = new Meshes_mesh/* Mesh */.Kj("directionalLight", scene),mesh = new Meshes_mesh/* Mesh */.Kj(root.name, scene);mesh.parent = root;const sphere = CreateSphere(root.name, { diameter: 1.2, segments: 10 }, scene);sphere.parent = mesh;const line = CreateCylinder(root.name, { updatable: !1, height: 6, diameterTop: .3, diameterBottom: .3, tessellation: 6, subdivisions: 1 }, scene);line.parent = mesh;let left = line.clone(root.name);left.scaling.y = .5, left.position.x += 1.25;let right = line.clone(root.name);right.scaling.y = .5, right.position.x += -1.25;const arrowHead = CreateCylinder(root.name, { updatable: !1, height: 1, diameterTop: 0, diameterBottom: .6, tessellation: 6, subdivisions: 1 }, scene);return arrowHead.position.y += 3, arrowHead.parent = mesh, left = arrowHead.clone(root.name), left.position.y = 1.5, left.position.x += 1.25, right = arrowHead.clone(root.name), right.position.y = 1.5, right.position.x += -1.25, mesh.scaling.scaleInPlace(LightGizmo._Scale), mesh.rotation.z = Math.PI / 2, mesh.rotation.y = Math.PI / 2, root;}}LightGizmo._Scale = .007, LightGizmo._CreateLightLines = (levels, scene) => {const distFromSphere = 1.2,root = new Meshes_mesh/* Mesh */.Kj("root", scene);root.rotation.x = Math.PI / 2;const linePivot = new Meshes_mesh/* Mesh */.Kj("linePivot", scene);linePivot.parent = root;const line = CreateCylinder("line", { updatable: !1, height: 2, diameterTop: .2, diameterBottom: .3, tessellation: 6, subdivisions: 1 }, scene);if (line.position.y = line.scaling.y / 2 + distFromSphere, line.parent = linePivot, 2 > levels) return linePivot;for (let i = 0; 4 > i; i++) {const l = linePivot.clone("lineParentClone");l.rotation.z = Math.PI / 4, l.rotation.y = Math.PI / 2 + Math.PI / 2 * i, l.getChildMeshes()[0].scaling.y = .5, l.getChildMeshes()[0].scaling.x = l.getChildMeshes()[0].scaling.z = .8, l.getChildMeshes()[0].position.y = l.getChildMeshes()[0].scaling.y / 2 + distFromSphere;}if (3 > levels) return root;for (let i = 0; 4 > i; i++) {const l = linePivot.clone("linePivotClone");l.rotation.z = Math.PI / 2, l.rotation.y = Math.PI / 2 * i;}if (4 > levels) return root;for (let i = 0; 4 > i; i++) {const l = linePivot.clone("linePivotClone");l.rotation.z = Math.PI + Math.PI / 4, l.rotation.y = Math.PI / 2 + Math.PI / 2 * i, l.getChildMeshes()[0].scaling.y = .5, l.getChildMeshes()[0].scaling.x = l.getChildMeshes()[0].scaling.z = .8, l.getChildMeshes()[0].position.y = l.getChildMeshes()[0].scaling.y / 2 + distFromSphere;}if (5 > levels) return root;const l = linePivot.clone("linePivotClone");return l.rotation.z = Math.PI, root;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/cameraGizmo.js
class CameraGizmo extends Gizmo {constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer) {super(gizmoLayer), this._pointerObserver = null, this.onClickedObservable = new observable/* Observable */.y$(), this._camera = null, this._invProjection = new math/* Matrix */.y3(), this._material = new standardMaterial/* StandardMaterial */.K("cameraGizmoMaterial", this.gizmoLayer.utilityLayerScene), this._material.diffuseColor = new math_color/* Color3 */.Wo(.5, .5, .5), this._material.specularColor = new math_color/* Color3 */.Wo(.1, .1, .1), this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {this._camera && (this._isHovered = !!(pointerInfo.pickInfo && -1 != this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh)), this._isHovered && 0 === pointerInfo.event.button && this.onClickedObservable.notifyObservers(this._camera));}, pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN);}get displayFrustum() {return this._cameraLinesMesh.isEnabled();}set displayFrustum(value) {this._cameraLinesMesh.setEnabled(value);}set camera(camera) {if (this._camera = camera, this.attachedNode = camera, camera) {this._cameraMesh && this._cameraMesh.dispose(), this._cameraLinesMesh && this._cameraLinesMesh.dispose(), this._cameraMesh = CameraGizmo._CreateCameraMesh(this.gizmoLayer.utilityLayerScene), this._cameraLinesMesh = CameraGizmo._CreateCameraFrustum(this.gizmoLayer.utilityLayerScene), this._cameraMesh.getChildMeshes(!1).forEach((m) => {m.material = this._material;}), this._cameraMesh.parent = this._rootMesh, this._cameraLinesMesh.parent = this._rootMesh, this.gizmoLayer.utilityLayerScene.activeCamera && this.gizmoLayer.utilityLayerScene.activeCamera.maxZ < 1.5 * camera.maxZ && (this.gizmoLayer.utilityLayerScene.activeCamera.maxZ = 1.5 * camera.maxZ), this.attachedNode.reservedDataStore || (this.attachedNode.reservedDataStore = {}), this.attachedNode.reservedDataStore.cameraGizmo = this;const gizmoLight = this.gizmoLayer._getSharedGizmoLight();gizmoLight.includedOnlyMeshes = gizmoLight.includedOnlyMeshes.concat(this._cameraMesh.getChildMeshes(!1)), this._update();}}get camera() {return this._camera;}get material() {return this._material;}_update() {super._update();this._camera && (this._camera.getProjectionMatrix().invertToRef(this._invProjection), this._cameraLinesMesh.setPivotMatrix(this._invProjection, !1), this._cameraLinesMesh.scaling.x = 1 / this._rootMesh.scaling.x, this._cameraLinesMesh.scaling.y = 1 / this._rootMesh.scaling.y, this._cameraLinesMesh.scaling.z = 1 / this._rootMesh.scaling.z, this._cameraMesh.parent = null, this._cameraMesh.rotation.y = .5 * Math.PI * (this._camera.getScene().useRightHandedSystem ? 1 : -1), this._cameraMesh.parent = this._rootMesh);}dispose() {this.onClickedObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this._cameraMesh && this._cameraMesh.dispose(), this._cameraLinesMesh && this._cameraLinesMesh.dispose(), this._material.dispose(), super.dispose();}static _CreateCameraMesh(scene) {const root = new Meshes_mesh/* Mesh */.Kj("rootCameraGizmo", scene),mesh = new Meshes_mesh/* Mesh */.Kj(root.name, scene);mesh.parent = root;const box = CreateBox(root.name, { width: 1, height: .8, depth: .5 }, scene);box.parent = mesh;const cyl1 = CreateCylinder(root.name, { height: .5, diameterTop: .8, diameterBottom: .8 }, scene);cyl1.parent = mesh, cyl1.position.y = .3, cyl1.position.x = -.6, cyl1.rotation.x = .5 * Math.PI;const cyl2 = CreateCylinder(root.name, { height: .5, diameterTop: .6, diameterBottom: .6 }, scene);cyl2.parent = mesh, cyl2.position.y = .5, cyl2.position.x = .4, cyl2.rotation.x = .5 * Math.PI;const cyl3 = CreateCylinder(root.name, { height: .5, diameterTop: .5, diameterBottom: .5 }, scene);return cyl3.parent = mesh, cyl3.position.y = 0, cyl3.position.x = .6, cyl3.rotation.z = .5 * Math.PI, root.scaling.scaleInPlace(CameraGizmo._Scale), mesh.position.x = -.9, root;}static _CreateCameraFrustum(scene) {const root = new Meshes_mesh/* Mesh */.Kj("rootCameraGizmo", scene),mesh = new Meshes_mesh/* Mesh */.Kj(root.name, scene);mesh.parent = root;for (let y = 0; 4 > y; y += 2) for (let line, x = 0; 4 > x; x += 2) line = CreateLines("lines", { points: [new math_vector/* Vector3 */.P(-1 + x, -1 + y, -1), new math_vector/* Vector3 */.P(-1 + x, -1 + y, 1)] }, scene), line.parent = mesh, line.alwaysSelectAsActiveMesh = !0, line.isPickable = !1, line = CreateLines("lines", { points: [new math_vector/* Vector3 */.P(-1, -1 + x, -1 + y), new math_vector/* Vector3 */.P(1, -1 + x, -1 + y)] }, scene), line.parent = mesh, line.alwaysSelectAsActiveMesh = !0, line.isPickable = !1, line = CreateLines("lines", { points: [new math_vector/* Vector3 */.P(-1 + x, -1, -1 + y), new math_vector/* Vector3 */.P(-1 + x, 1, -1 + y)] }, scene), line.parent = mesh, line.alwaysSelectAsActiveMesh = !0, line.isPickable = !1;return root;}}CameraGizmo._Scale = .05;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Gizmos/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js
var baseTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurVaryingDeclaration.js
const kernelBlurVaryingDeclaration_name = "kernelBlurVaryingDeclaration",kernelBlurVaryingDeclaration_shader = `varying vec2 sampleCoord{X};`;shaderStore/* ShaderStore.IncludesShadersStore.kernelBlurVaryingDeclaration */.v.IncludesShadersStore.kernelBlurVaryingDeclaration = kernelBlurVaryingDeclaration_shader;const kernelBlurVaryingDeclaration = { name: "kernelBlurVaryingDeclaration", shader: kernelBlurVaryingDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/packingFunctions.js
const packingFunctions_name = "packingFunctions",packingFunctions_shader = `vec4 pack(float depth)
{
const vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);
const vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);
vec4 res=fract(depth*bit_shift);
res-=res.xxyz*bit_mask;
return res;
}
float unpack(vec4 color)
{
const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);
return dot(color,bit_shift);
}`;shaderStore/* ShaderStore.IncludesShadersStore.packingFunctions */.v.IncludesShadersStore.packingFunctions = packingFunctions_shader;const packingFunctions = { name: "packingFunctions", shader: packingFunctions_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurFragment.js
const kernelBlurFragment_name = "kernelBlurFragment",kernelBlurFragment_shader = `#ifdef DOF
factor=sampleCoC(sampleCoord{X}); 
computedWeight=KERNEL_WEIGHT{X}*factor;
sumOfWeights+=computedWeight;
#else
computedWeight=KERNEL_WEIGHT{X};
#endif
#ifdef PACKEDFLOAT
blend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;
#else
blend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.kernelBlurFragment */.v.IncludesShadersStore.kernelBlurFragment = kernelBlurFragment_shader;const kernelBlurFragment = { name: "kernelBlurFragment", shader: kernelBlurFragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurFragment2.js
const kernelBlurFragment2_name = "kernelBlurFragment2",kernelBlurFragment2_shader = `#ifdef DOF
factor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});
computedWeight=KERNEL_DEP_WEIGHT{X}*factor;
sumOfWeights+=computedWeight;
#else
computedWeight=KERNEL_DEP_WEIGHT{X};
#endif
#ifdef PACKEDFLOAT
blend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;
#else
blend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.kernelBlurFragment2 */.v.IncludesShadersStore.kernelBlurFragment2 = kernelBlurFragment2_shader;const kernelBlurFragment2 = { name: "kernelBlurFragment2", shader: kernelBlurFragment2_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/kernelBlur.fragment.js
const kernelBlur_fragment_name = "kernelBlurPixelShader",kernelBlur_fragment_shader = `uniform sampler2D textureSampler;
uniform vec2 delta;
varying vec2 sampleCenter;
#ifdef DOF
uniform sampler2D circleOfConfusionSampler;
float sampleCoC(in vec2 offset) {
float coc=texture2D(circleOfConfusionSampler,offset).r;
return coc; 
}
#endif
#include<kernelBlurVaryingDeclaration>[0..varyingCount]
#ifdef PACKEDFLOAT
#include<packingFunctions>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
float computedWeight=0.0;
#ifdef PACKEDFLOAT
float blend=0.;
#else
vec4 blend=vec4(0.);
#endif
#ifdef DOF
float sumOfWeights=CENTER_WEIGHT; 
float factor=0.0;
#ifdef PACKEDFLOAT
blend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;
#else
blend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;
#endif
#endif
#include<kernelBlurFragment>[0..varyingCount]
#include<kernelBlurFragment2>[0..depCount]
#ifdef PACKEDFLOAT
gl_FragColor=pack(blend);
#else
gl_FragColor=blend;
#endif
#ifdef DOF
gl_FragColor/=sumOfWeights;
#endif
}`;shaderStore/* ShaderStore.ShadersStore.kernelBlurPixelShader */.v.ShadersStore.kernelBlurPixelShader = kernelBlur_fragment_shader;const kernelBlurPixelShader = { name: "kernelBlurPixelShader", shader: kernelBlur_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurVertex.js
const kernelBlurVertex_name = "kernelBlurVertex",kernelBlurVertex_shader = `sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};`;shaderStore/* ShaderStore.IncludesShadersStore.kernelBlurVertex */.v.IncludesShadersStore.kernelBlurVertex = kernelBlurVertex_shader;const kernelBlurVertex = { name: "kernelBlurVertex", shader: kernelBlurVertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/kernelBlur.vertex.js
const kernelBlur_vertex_name = "kernelBlurVertexShader",kernelBlur_vertex_shader = `attribute vec2 position;
uniform vec2 delta;
varying vec2 sampleCenter;
#include<kernelBlurVaryingDeclaration>[0..varyingCount]
const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
sampleCenter=(position*madd+madd);
#include<kernelBlurVertex>[0..varyingCount]
gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.kernelBlurVertexShader */.v.ShadersStore.kernelBlurVertexShader = kernelBlur_vertex_shader;const kernelBlurVertexShader = { name: "kernelBlurVertexShader", shader: kernelBlur_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/blurPostProcess.js
class BlurPostProcess extends PostProcesses_postProcess/* PostProcess */.D {set kernel(v) {this._idealKernel === v || (v = Math.max(v, 1), this._idealKernel = v, this._kernel = this._nearestBestKernel(v), !this._blockCompilation && this._updateParameters());}get kernel() {return this._idealKernel;}set packedFloat(v) {this._packedFloat === v || (this._packedFloat = v, !this._blockCompilation && this._updateParameters());}get packedFloat() {return this._packedFloat;}getClassName() {return "BlurPostProcess";}constructor(name, direction, kernel, options, camera, samplingMode = Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, reusable, textureType = 0, defines = "", _blockCompilation = !1, textureFormat = 5) {super(name, "kernelBlur", ["delta", "direction"], ["circleOfConfusionSampler"], options, camera, samplingMode, engine, reusable, null, textureType, "kernelBlur", { varyingCount: 0, depCount: 0 }, !0, textureFormat), this._blockCompilation = _blockCompilation, this._packedFloat = !1, this._staticDefines = "", this._staticDefines = defines, this.direction = direction, this.onApplyObservable.add((effect) => {this._outputTexture ? effect.setFloat2("delta", 1 / this._outputTexture.width * this.direction.x, 1 / this._outputTexture.height * this.direction.y) : effect.setFloat2("delta", 1 / this.width * this.direction.x, 1 / this.height * this.direction.y);}), this.kernel = kernel;}updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError) {this._updateParameters(onCompiled, onError);}_updateParameters(onCompiled, onError) {const N = this._kernel,centerIndex = (N - 1) / 2;let offsets = [],weights = [],totalWeight = 0;for (let i = 0; i < N; i++) {const u = i / (N - 1),w = this._gaussianWeight(2 * u - 1);offsets[i] = i - centerIndex, weights[i] = w, totalWeight += w;}for (let i = 0; i < weights.length; i++) weights[i] /= totalWeight;const linearSamplingWeights = [],linearSamplingOffsets = [],linearSamplingMap = [];for (let i = 0; i <= centerIndex; i += 2) {const j = Math.min(i + 1, Math.floor(centerIndex)),singleCenterSample = i === j;if (singleCenterSample) linearSamplingMap.push({ o: offsets[i], w: weights[i] });else {const weightLinear = weights[i] + weights[j] * (j === centerIndex ? .5 : 1),offsetLinear = offsets[i] + 1 / (1 + weights[i] / weights[j]);0 === offsetLinear ? (linearSamplingMap.push({ o: offsets[i], w: weights[i] }), linearSamplingMap.push({ o: offsets[i + 1], w: weights[i + 1] })) : (linearSamplingMap.push({ o: offsetLinear, w: weightLinear }), linearSamplingMap.push({ o: -offsetLinear, w: weightLinear }));}}for (let i = 0; i < linearSamplingMap.length; i++) linearSamplingOffsets[i] = linearSamplingMap[i].o, linearSamplingWeights[i] = linearSamplingMap[i].w;offsets = linearSamplingOffsets, weights = linearSamplingWeights;const maxVaryingRows = this.getEngine().getCaps().maxVaryingVectors,freeVaryingVec2 = Math.max(maxVaryingRows, 0) - 1;let varyingCount = Math.min(offsets.length, freeVaryingVec2),defines = "";defines += this._staticDefines, -1 != this._staticDefines.indexOf("DOF") && (defines += `#define CENTER_WEIGHT ${this._glslFloat(weights[varyingCount - 1])}\r\n`, varyingCount--);for (let i = 0; i < varyingCount; i++) defines += `#define KERNEL_OFFSET${i} ${this._glslFloat(offsets[i])}\r\n`, defines += `#define KERNEL_WEIGHT${i} ${this._glslFloat(weights[i])}\r\n`;let depCount = 0;for (let i = freeVaryingVec2; i < offsets.length; i++) defines += `#define KERNEL_DEP_OFFSET${depCount} ${this._glslFloat(offsets[i])}\r\n`, defines += `#define KERNEL_DEP_WEIGHT${depCount} ${this._glslFloat(weights[i])}\r\n`, depCount++;this.packedFloat && (defines += `#define PACKEDFLOAT 1`), this._blockCompilation = !1, super.updateEffect(defines, null, null, { varyingCount: varyingCount, depCount: depCount }, onCompiled, onError);}_nearestBestKernel(idealKernel) {const v = Math.round(idealKernel);for (const k of [v, v - 1, v + 1, v - 2, v + 2]) if (0 != k % 2 && 0 == Math.floor(k / 2) % 2 && 0 < k) return Math.max(k, 3);return Math.max(v, 3);}_gaussianWeight(x) {const sigma = 1 / 3,denominator = Math.sqrt(2 * Math.PI) * sigma,weight = 1 / denominator * Math.exp(-(x * x / (2 * sigma * sigma)));return weight;}_glslFloat(x, decimalFigures = 8) {return x.toFixed(decimalFigures).replace(/0+$/, "");}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new BlurPostProcess(parsedPostProcess.name, parsedPostProcess.direction, parsedPostProcess.kernel, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType, void 0, !1), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("kernel")], BlurPostProcess.prototype, "_kernel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("packedFloat")], BlurPostProcess.prototype, "_packedFloat", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsVector2 */.QC)()], BlurPostProcess.prototype, "direction", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.BlurPostProcess", BlurPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/mirrorTexture.js
class MirrorTexture extends Textures_renderTargetTexture/* RenderTargetTexture */._ {set blurRatio(value) {this._blurRatio === value || (this._blurRatio = value, this._preparePostProcesses());}get blurRatio() {return this._blurRatio;}set adaptiveBlurKernel(value) {this._adaptiveBlurKernel = value, this._autoComputeBlurKernel();}set blurKernel(value) {this.blurKernelX = value, this.blurKernelY = value;}set blurKernelX(value) {this._blurKernelX === value || (this._blurKernelX = value, this._preparePostProcesses());}get blurKernelX() {return this._blurKernelX;}set blurKernelY(value) {this._blurKernelY === value || (this._blurKernelY = value, this._preparePostProcesses());}get blurKernelY() {return this._blurKernelY;}_autoComputeBlurKernel() {const engine = this.getScene().getEngine(),dw = this.getRenderWidth() / engine.getRenderWidth(),dh = this.getRenderHeight() / engine.getRenderHeight();this.blurKernelX = this._adaptiveBlurKernel * dw, this.blurKernelY = this._adaptiveBlurKernel * dh;}_onRatioRescale() {this._sizeRatio && (this.resize(this._initialSizeParameter), !this._adaptiveBlurKernel && this._preparePostProcesses()), this._adaptiveBlurKernel && this._autoComputeBlurKernel();}_updateGammaSpace() {const scene = this.getScene();scene && (this.gammaSpace = !scene.imageProcessingConfiguration.isEnabled || !scene.imageProcessingConfiguration.applyByPostProcess);}constructor(name, size, scene, generateMipMaps, type = 0, samplingMode = Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, generateDepthBuffer = !0) {if (super(name, size, scene, generateMipMaps, !0, type, !1, samplingMode, generateDepthBuffer), this.mirrorPlane = new math_plane/* Plane */.J(0, 1, 0, 1), this._transformMatrix = math_vector/* Matrix.Zero */.y3.Zero(), this._mirrorMatrix = math_vector/* Matrix.Zero */.y3.Zero(), this._adaptiveBlurKernel = 0, this._blurKernelX = 0, this._blurKernelY = 0, this._blurRatio = 1, scene = this.getScene(), !scene) return this;this.ignoreCameraViewport = !0, this._updateGammaSpace(), this._imageProcessingConfigChangeObserver = scene.imageProcessingConfiguration.onUpdateParameters.add(() => {this._updateGammaSpace();});const engine = scene.getEngine();engine.supportsUniformBuffers && (this._sceneUBO = scene.createSceneUniformBuffer(`Scene for Mirror Texture (name "${name}")`)), this.onBeforeBindObservable.add(() => {var _a;null === (_a = engine._debugPushGroup) || void 0 === _a ? void 0 : _a.call(engine, `mirror generation for ${name}`, 1);}), this.onAfterUnbindObservable.add(() => {var _a;null === (_a = engine._debugPopGroup) || void 0 === _a ? void 0 : _a.call(engine, 1);});let saveClipPlane;this.onBeforeRenderObservable.add(() => {this._sceneUBO && (this._currentSceneUBO = scene.getSceneUniformBuffer(), scene.setSceneUniformBuffer(this._sceneUBO), scene.getSceneUniformBuffer().unbindEffect()), math_vector/* Matrix.ReflectionToRef */.y3.ReflectionToRef(this.mirrorPlane, this._mirrorMatrix), this._mirrorMatrix.multiplyToRef(scene.getViewMatrix(), this._transformMatrix), scene.setTransformMatrix(this._transformMatrix, scene.getProjectionMatrix()), saveClipPlane = scene.clipPlane, scene.clipPlane = this.mirrorPlane, scene._mirroredCameraPosition = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(scene.activeCamera.globalPosition, this._mirrorMatrix);}), this.onAfterRenderObservable.add(() => {this._sceneUBO && scene.setSceneUniformBuffer(this._currentSceneUBO), scene.updateTransformMatrix(), scene._mirroredCameraPosition = null, scene.clipPlane = saveClipPlane;});}_preparePostProcesses() {if (this.clearPostProcesses(!0), this._blurKernelX && this._blurKernelY) {const engine = this.getScene().getEngine(),textureType = engine.getCaps().textureFloatRender && engine.getCaps().textureFloatLinearFiltering ? 1 : 2;this._blurX = new BlurPostProcess("horizontal blur", new math_vector/* Vector2 */.FM(1, 0), this._blurKernelX, this._blurRatio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, textureType), this._blurX.autoClear = !1, 1 === this._blurRatio && 2 > this.samples && this._texture ? this._blurX.inputTexture = this._renderTarget : this._blurX.alwaysForcePOT = !0, this._blurY = new BlurPostProcess("vertical blur", new math_vector/* Vector2 */.FM(0, 1), this._blurKernelY, this._blurRatio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, textureType), this._blurY.autoClear = !1, this._blurY.alwaysForcePOT = 1 !== this._blurRatio, this.addPostProcess(this._blurX), this.addPostProcess(this._blurY);} else this._blurY && (this.removePostProcess(this._blurY), this._blurY.dispose(), this._blurY = null), this._blurX && (this.removePostProcess(this._blurX), this._blurX.dispose(), this._blurX = null);}clone() {const scene = this.getScene();if (!scene) return this;const textureSize = this.getSize(),newTexture = new MirrorTexture(this.name, textureSize.width, scene, this._renderTargetOptions.generateMipMaps, this._renderTargetOptions.type, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer);return newTexture.hasAlpha = this.hasAlpha, newTexture.level = this.level, newTexture.mirrorPlane = this.mirrorPlane.clone(), this.renderList && (newTexture.renderList = this.renderList.slice(0)), newTexture;}serialize() {if (!this.name) return null;const serializationObject = super.serialize();return serializationObject.mirrorPlane = this.mirrorPlane.asArray(), serializationObject;}dispose() {var _a;super.dispose();const scene = this.getScene();scene && scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver), null === (_a = this._sceneUBO) || void 0 === _a ? void 0 : _a.dispose();}}Textures_texture/* Texture._CreateMirror */.x._CreateMirror = (name, renderTargetSize, scene, generateMipMaps) => new MirrorTexture(name, renderTargetSize, scene, generateMipMaps);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/cubeTexture.js
var Textures_cubeTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/cubeTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialFlags.js
var materialFlags = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialFlags.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundFragmentDeclaration.js
const backgroundFragmentDeclaration_name = "backgroundFragmentDeclaration",backgroundFragmentDeclaration_shader = `uniform vec4 vEyePosition;
uniform vec4 vPrimaryColor;
#ifdef USEHIGHLIGHTANDSHADOWCOLORS
uniform vec4 vPrimaryColorShadow;
#endif
uniform float shadowLevel;
uniform float alpha;
#ifdef DIFFUSE
uniform vec2 vDiffuseInfos;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;
uniform mat4 reflectionMatrix;
uniform vec3 vReflectionMicrosurfaceInfos;
#endif
#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)
uniform vec3 vBackgroundCenter;
#endif
#ifdef REFLECTIONFRESNEL
uniform vec4 vReflectionControl;
#endif
#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)
uniform mat4 view;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.backgroundFragmentDeclaration */.v.IncludesShadersStore.backgroundFragmentDeclaration = backgroundFragmentDeclaration_shader;const backgroundFragmentDeclaration = { name: "backgroundFragmentDeclaration", shader: backgroundFragmentDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js
var ShadersInclude_sceneUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundUboDeclaration.js
const backgroundUboDeclaration_name = "backgroundUboDeclaration",backgroundUboDeclaration_shader = `layout(std140,column_major) uniform;
uniform Material
{
uniform vec4 vPrimaryColor;
uniform vec4 vPrimaryColorShadow;
uniform vec2 vDiffuseInfos;
uniform vec2 vReflectionInfos;
uniform mat4 diffuseMatrix;
uniform mat4 reflectionMatrix;
uniform vec3 vReflectionMicrosurfaceInfos;
uniform float fFovMultiplier;
uniform float pointSize;
uniform float shadowLevel;
uniform float alpha;
#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)
uniform vec3 vBackgroundCenter;
#endif
#ifdef REFLECTIONFRESNEL
uniform vec4 vReflectionControl;
#endif
};
#include<sceneUboDeclaration>
`;shaderStore/* ShaderStore.IncludesShadersStore.backgroundUboDeclaration */.v.IncludesShadersStore.backgroundUboDeclaration = backgroundUboDeclaration_shader;const backgroundUboDeclaration = { name: "backgroundUboDeclaration", shader: backgroundUboDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js
var reflectionFunction = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js
var lightFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js
var lightUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js
var lightsFragmentFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js
var shadowsFragmentFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js
var lightFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/background.fragment.js
const background_fragment_name = "backgroundPixelShader",background_fragment_shader = `#ifdef TEXTURELODSUPPORT
#extension GL_EXT_shader_texture_lod : enable
#endif
precision highp float;
#include<__decl__backgroundFragment>
#include<helperFunctions>
#define RECIPROCAL_PI2 0.15915494
varying vec3 vPositionW;
#ifdef MAINUV1
varying vec2 vMainUV1;
#endif 
#ifdef MAINUV2 
varying vec2 vMainUV2; 
#endif 
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef DIFFUSE
#if DIFFUSEDIRECTUV==1
#define vDiffuseUV vMainUV1
#elif DIFFUSEDIRECTUV==2
#define vDiffuseUV vMainUV2
#else
varying vec2 vDiffuseUV;
#endif
uniform sampler2D diffuseSampler;
#endif
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
#define sampleReflection(s,c) textureCube(s,c)
uniform samplerCube reflectionSampler;
#ifdef TEXTURELODSUPPORT
#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
#else
uniform samplerCube reflectionSamplerLow;
uniform samplerCube reflectionSamplerHigh;
#endif
#else
#define sampleReflection(s,c) texture2D(s,c)
uniform sampler2D reflectionSampler;
#ifdef TEXTURELODSUPPORT
#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
#else
uniform samplerCube reflectionSamplerLow;
uniform samplerCube reflectionSamplerHigh;
#endif
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#endif
#include<reflectionFunction>
#endif
#ifndef FROMLINEARSPACE
#define FROMLINEARSPACE;
#endif
#ifndef SHADOWONLY
#define SHADOWONLY;
#endif
#include<imageProcessingDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<imageProcessingFunctions>
#include<clipPlaneFragmentDeclaration>
#include<fogFragmentDeclaration>
#ifdef REFLECTIONFRESNEL
#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
vec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)
{
float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);
return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));
}
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(0.0,1.0,0.0);
#endif
float shadow=1.;
float globalShadow=0.;
float shadowLightCount=0.;
#include<lightFragment>[0..maxSimultaneousLights]
#ifdef SHADOWINUSE
globalShadow/=shadowLightCount;
#else
globalShadow=1.0;
#endif
#ifndef BACKMAT_SHADOWONLY
vec4 reflectionColor=vec4(1.,1.,1.,1.);
#ifdef REFLECTION
vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
vec3 reflectionCoords=reflectionVector;
#else
vec2 reflectionCoords=reflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
reflectionCoords/=reflectionVector.z;
#endif
reflectionCoords.y=1.0-reflectionCoords.y;
#endif
#ifdef REFLECTIONBLUR
float reflectionLOD=vReflectionInfos.y;
#ifdef TEXTURELODSUPPORT
reflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;
reflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);
#else
float lodReflectionNormalized=saturate(reflectionLOD);
float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;
vec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);
if(lodReflectionNormalizedDoubled<1.0){
reflectionColor=mix(
sampleReflection(reflectionSamplerHigh,reflectionCoords),
reflectionSpecularMid,
lodReflectionNormalizedDoubled
);
} else {
reflectionColor=mix(
reflectionSpecularMid,
sampleReflection(reflectionSamplerLow,reflectionCoords),
lodReflectionNormalizedDoubled-1.0
);
}
#endif
#else
vec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);
reflectionColor=reflectionSample;
#endif
#ifdef RGBDREFLECTION
reflectionColor.rgb=fromRGBD(reflectionColor);
#endif
#ifdef GAMMAREFLECTION
reflectionColor.rgb=toLinearSpace(reflectionColor.rgb);
#endif
#ifdef REFLECTIONBGR
reflectionColor.rgb=reflectionColor.bgr;
#endif
reflectionColor.rgb*=vReflectionInfos.x;
#endif
vec3 diffuseColor=vec3(1.,1.,1.);
float finalAlpha=alpha;
#ifdef DIFFUSE
vec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);
#ifdef GAMMADIFFUSE
diffuseMap.rgb=toLinearSpace(diffuseMap.rgb);
#endif
diffuseMap.rgb*=vDiffuseInfos.y;
#ifdef DIFFUSEHASALPHA
finalAlpha*=diffuseMap.a;
#endif
diffuseColor=diffuseMap.rgb;
#endif
#ifdef REFLECTIONFRESNEL
vec3 colorBase=diffuseColor;
#else
vec3 colorBase=reflectionColor.rgb*diffuseColor;
#endif
colorBase=max(colorBase,0.0);
#ifdef USERGBCOLOR
vec3 finalColor=colorBase;
#else
#ifdef USEHIGHLIGHTANDSHADOWCOLORS
vec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);
#else
vec3 mainColor=vPrimaryColor.rgb;
#endif
vec3 finalColor=colorBase*mainColor;
#endif
#ifdef REFLECTIONFRESNEL
vec3 reflectionAmount=vReflectionControl.xxx;
vec3 reflectionReflectance0=vReflectionControl.yyy;
vec3 reflectionReflectance90=vReflectionControl.zzz;
float VdotN=dot(normalize(vEyePosition.xyz),normalW);
vec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);
reflectionAmount*=planarReflectionFresnel;
#ifdef REFLECTIONFALLOFF
float reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);
reflectionDistanceFalloff*=reflectionDistanceFalloff;
reflectionAmount*=reflectionDistanceFalloff;
#endif
finalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));
#endif
#ifdef OPACITYFRESNEL
float viewAngleToFloor=dot(normalW,normalize(vEyePosition.xyz-vBackgroundCenter));
const float startAngle=0.1;
float fadeFactor=saturate(viewAngleToFloor/startAngle);
finalAlpha*=fadeFactor*fadeFactor;
#endif
#ifdef SHADOWINUSE
finalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);
#endif
vec4 color=vec4(finalColor,finalAlpha);
#else
vec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);
#endif
#include<fogFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
#if !defined(SKIPFINALCOLORCLAMP)
color.rgb=clamp(color.rgb,0.,30.0);
#endif
#else
color=applyImageProcessing(color);
#endif
#ifdef PREMULTIPLYALPHA
color.rgb*=color.a;
#endif
#ifdef NOISE
color.rgb+=dither(vPositionW.xy,0.5);
color=max(color,0.0);
#endif
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}
`;shaderStore/* ShaderStore.ShadersStore.backgroundPixelShader */.v.ShadersStore.backgroundPixelShader = background_fragment_shader;const backgroundPixelShader = { name: "backgroundPixelShader", shader: background_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundVertexDeclaration.js
const backgroundVertexDeclaration_name = "backgroundVertexDeclaration",backgroundVertexDeclaration_shader = `uniform mat4 view;
uniform mat4 viewProjection;
uniform float shadowLevel;
#ifdef DIFFUSE
uniform mat4 diffuseMatrix;
uniform vec2 vDiffuseInfos;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;
uniform mat4 reflectionMatrix;
uniform vec3 vReflectionMicrosurfaceInfos;
uniform float fFovMultiplier;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.backgroundVertexDeclaration */.v.IncludesShadersStore.backgroundVertexDeclaration = backgroundVertexDeclaration_shader;const backgroundVertexDeclaration = { name: "backgroundVertexDeclaration", shader: backgroundVertexDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js
var lightVxFragmentDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js
var lightVxUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js
var shadowsVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/background.vertex.js
const background_vertex_name = "backgroundVertexShader",background_vertex_shader = `precision highp float;
#include<__decl__backgroundVertex>
#include<helperFunctions>
attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef MAINUV1
varying vec2 vMainUV1;
#endif
#ifdef MAINUV2
varying vec2 vMainUV2;
#endif
#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0
varying vec2 vDiffuseUV;
#endif
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#ifdef REFLECTIONMAP_SKYBOX
vPositionUVW=position;
#endif
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {
gl_Position=viewProjection*finalWorld*vec4(position,1.0);
} else {
gl_Position=viewProjectionR*finalWorld*vec4(position,1.0);
}
#else
gl_Position=viewProjection*finalWorld*vec4(position,1.0);
#endif
vec4 worldPos=finalWorld*vec4(position,1.0);
vPositionW=vec3(worldPos);
#ifdef NORMAL
mat3 normalWorld=mat3(finalWorld);
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vNormalW=normalize(normalWorld*normal);
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));
#ifdef EQUIRECTANGULAR_RELFECTION_FOV
mat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));
vec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));
if (fFovMultiplier<=1.0) {
vDirectionW=normalize(segment);
} else {
vDirectionW=normalize(vDirectionW+(vDirectionW-segment));
}
#endif
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef MAINUV1
vMainUV1=uv;
#endif
#ifdef MAINUV2
vMainUV2=uv2;
#endif
#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0
if (vDiffuseInfos.x==0.)
{
vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));
}
else
{
vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
}
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#ifdef VERTEXCOLOR
vColor=color;
#endif
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;shaderStore/* ShaderStore.ShadersStore.backgroundVertexShader */.v.ShadersStore.backgroundVertexShader = background_vertex_shader;const backgroundVertexShader = { name: "backgroundVertexShader", shader: background_vertex_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js
var clipPlaneMaterialHelper = __webpack_require__("./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Background/backgroundMaterial.js
class BackgroundMaterialDefines extends materialDefines/* MaterialDefines */.H {constructor() {super(), this.DIFFUSE = !1, this.DIFFUSEDIRECTUV = 0, this.GAMMADIFFUSE = !1, this.DIFFUSEHASALPHA = !1, this.OPACITYFRESNEL = !1, this.REFLECTIONBLUR = !1, this.REFLECTIONFRESNEL = !1, this.REFLECTIONFALLOFF = !1, this.TEXTURELODSUPPORT = !1, this.PREMULTIPLYALPHA = !1, this.USERGBCOLOR = !1, this.USEHIGHLIGHTANDSHADOWCOLORS = !1, this.BACKMAT_SHADOWONLY = !1, this.NOISE = !1, this.REFLECTIONBGR = !1, this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.EXPOSURE = !1, this.MULTIVIEW = !1, this.REFLECTION = !1, this.REFLECTIONMAP_3D = !1, this.REFLECTIONMAP_SPHERICAL = !1, this.REFLECTIONMAP_PLANAR = !1, this.REFLECTIONMAP_CUBIC = !1, this.REFLECTIONMAP_PROJECTION = !1, this.REFLECTIONMAP_SKYBOX = !1, this.REFLECTIONMAP_EXPLICIT = !1, this.REFLECTIONMAP_EQUIRECTANGULAR = !1, this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, this.INVERTCUBICMAP = !1, this.REFLECTIONMAP_OPPOSITEZ = !1, this.LODINREFLECTIONALPHA = !1, this.GAMMAREFLECTION = !1, this.RGBDREFLECTION = !1, this.EQUIRECTANGULAR_RELFECTION_FOV = !1, this.MAINUV1 = !1, this.MAINUV2 = !1, this.UV1 = !1, this.UV2 = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.POINTSIZE = !1, this.FOG = !1, this.NORMAL = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.SHADOWFLOAT = !1, this.LOGARITHMICDEPTH = !1, this.NONUNIFORMSCALING = !1, this.ALPHATEST = !1, this.rebuild();}}class BackgroundMaterial extends pushMaterial/* PushMaterial */.a {get _perceptualColor() {return this.__perceptualColor;}set _perceptualColor(value) {this.__perceptualColor = value, this._computePrimaryColorFromPerceptualColor(), this._markAllSubMeshesAsLightsDirty();}get primaryColorShadowLevel() {return this._primaryColorShadowLevel;}set primaryColorShadowLevel(value) {this._primaryColorShadowLevel = value, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty();}get primaryColorHighlightLevel() {return this._primaryColorHighlightLevel;}set primaryColorHighlightLevel(value) {this._primaryColorHighlightLevel = value, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty();}set reflectionStandardFresnelWeight(value) {let reflectionWeight = value;.5 > reflectionWeight ? (reflectionWeight *= 2, this.reflectionReflectance0 = BackgroundMaterial.StandardReflectance0 * reflectionWeight, this.reflectionReflectance90 = BackgroundMaterial.StandardReflectance90 * reflectionWeight) : (reflectionWeight = 2 * reflectionWeight - 1, this.reflectionReflectance0 = BackgroundMaterial.StandardReflectance0 + (1 - BackgroundMaterial.StandardReflectance0) * reflectionWeight, this.reflectionReflectance90 = BackgroundMaterial.StandardReflectance90 + (1 - BackgroundMaterial.StandardReflectance90) * reflectionWeight);}get fovMultiplier() {return this._fovMultiplier;}set fovMultiplier(value) {isNaN(value) && (value = 1), this._fovMultiplier = Math.max(0, Math.min(2, value));}_attachImageProcessingConfiguration(configuration) {configuration === this._imageProcessingConfiguration || (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = configuration ? configuration : this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {this._computePrimaryColorFromPerceptualColor(), this._markAllSubMeshesAsImageProcessingDirty();})));}get imageProcessingConfiguration() {return this._imageProcessingConfiguration;}set imageProcessingConfiguration(value) {this._attachImageProcessingConfiguration(value), this._markAllSubMeshesAsTexturesDirty();}get cameraColorCurvesEnabled() {return this.imageProcessingConfiguration.colorCurvesEnabled;}set cameraColorCurvesEnabled(value) {this.imageProcessingConfiguration.colorCurvesEnabled = value;}get cameraColorGradingEnabled() {return this.imageProcessingConfiguration.colorGradingEnabled;}set cameraColorGradingEnabled(value) {this.imageProcessingConfiguration.colorGradingEnabled = value;}get cameraToneMappingEnabled() {return this._imageProcessingConfiguration.toneMappingEnabled;}set cameraToneMappingEnabled(value) {this._imageProcessingConfiguration.toneMappingEnabled = value;}get cameraExposure() {return this._imageProcessingConfiguration.exposure;}set cameraExposure(value) {this._imageProcessingConfiguration.exposure = value;}get cameraContrast() {return this._imageProcessingConfiguration.contrast;}set cameraContrast(value) {this._imageProcessingConfiguration.contrast = value;}get cameraColorGradingTexture() {return this._imageProcessingConfiguration.colorGradingTexture;}set cameraColorGradingTexture(value) {this.imageProcessingConfiguration.colorGradingTexture = value;}get cameraColorCurves() {return this.imageProcessingConfiguration.colorCurves;}set cameraColorCurves(value) {this.imageProcessingConfiguration.colorCurves = value;}constructor(name, scene) {super(name, scene), this.primaryColor = math_color/* Color3.White */.Wo.White(), this._primaryColorShadowLevel = 0, this._primaryColorHighlightLevel = 0, this.reflectionTexture = null, this.reflectionBlur = 0, this.diffuseTexture = null, this._shadowLights = null, this.shadowLights = null, this.shadowLevel = 0, this.sceneCenter = math_vector/* Vector3.Zero */.P.Zero(), this.opacityFresnel = !0, this.reflectionFresnel = !1, this.reflectionFalloffDistance = 0, this.reflectionAmount = 1, this.reflectionReflectance0 = .05, this.reflectionReflectance90 = .5, this.useRGBColor = !0, this.enableNoise = !1, this._fovMultiplier = 1, this.useEquirectangularFOV = !1, this._maxSimultaneousLights = 4, this.maxSimultaneousLights = 4, this._shadowOnly = !1, this.shadowOnly = !1, this._imageProcessingObserver = null, this.switchToBGR = !1, this._renderTargets = new smartArray/* SmartArray */.t(16), this._reflectionControls = math_vector/* Vector4.Zero */.Lt.Zero(), this._white = math_color/* Color3.White */.Wo.White(), this._primaryShadowColor = math_color/* Color3.Black */.Wo.Black(), this._primaryHighlightColor = math_color/* Color3.Black */.Wo.Black(), this._attachImageProcessingConfiguration(null), this.getRenderTargetTextures = () => (this._renderTargets.reset(), this._diffuseTexture && this._diffuseTexture.isRenderTarget && this._renderTargets.push(this._diffuseTexture), this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._renderTargets.push(this._reflectionTexture), this._renderTargets);}get hasRenderTargetTextures() {return !!(this._diffuseTexture && this._diffuseTexture.isRenderTarget) || !!(this._reflectionTexture && this._reflectionTexture.isRenderTarget);}needAlphaTesting() {return !0;}needAlphaBlending() {return 1 > this.alpha || null != this._diffuseTexture && this._diffuseTexture.hasAlpha || this._shadowOnly;}isReadyForSubMesh(mesh, subMesh, useInstances = !1) {if (subMesh.effect && this.isFrozen && subMesh.effect._wasPreviouslyReady && subMesh.effect._wasPreviouslyUsingInstances === useInstances) return !0;subMesh.materialDefines || (subMesh.materialDefines = new BackgroundMaterialDefines());const scene = this.getScene(),defines = subMesh.materialDefines;if (this._isReadyForSubMesh(subMesh)) return !0;const engine = scene.getEngine();if (materialHelper/* MaterialHelper.PrepareDefinesForLights */.G.PrepareDefinesForLights(scene, mesh, defines, !1, this._maxSimultaneousLights), defines._needNormals = !0, materialHelper/* MaterialHelper.PrepareDefinesForMultiview */.G.PrepareDefinesForMultiview(scene, defines), defines._areTexturesDirty) {if (defines._needUVs = !1, scene.texturesEnabled) {if (scene.getEngine().getCaps().textureLOD && (defines.TEXTURELODSUPPORT = !0), this._diffuseTexture && materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled) {if (!this._diffuseTexture.isReadyOrNotBlocking()) return !1;materialHelper/* MaterialHelper.PrepareDefinesForMergedUV */.G.PrepareDefinesForMergedUV(this._diffuseTexture, defines, "DIFFUSE"), defines.DIFFUSEHASALPHA = this._diffuseTexture.hasAlpha, defines.GAMMADIFFUSE = this._diffuseTexture.gammaSpace, defines.OPACITYFRESNEL = this._opacityFresnel;} else defines.DIFFUSE = !1, defines.DIFFUSEDIRECTUV = 0, defines.DIFFUSEHASALPHA = !1, defines.GAMMADIFFUSE = !1, defines.OPACITYFRESNEL = !1;const reflectionTexture = this._reflectionTexture;if (reflectionTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled) {if (!reflectionTexture.isReadyOrNotBlocking()) return !1;switch (defines.REFLECTION = !0, defines.GAMMAREFLECTION = reflectionTexture.gammaSpace, defines.RGBDREFLECTION = reflectionTexture.isRGBD, defines.REFLECTIONBLUR = 0 < this._reflectionBlur, defines.LODINREFLECTIONALPHA = reflectionTexture.lodLevelInAlpha, defines.EQUIRECTANGULAR_RELFECTION_FOV = this.useEquirectangularFOV, defines.REFLECTIONBGR = this.switchToBGR, reflectionTexture.coordinatesMode === Textures_texture/* Texture.INVCUBIC_MODE */.x.INVCUBIC_MODE && (defines.INVERTCUBICMAP = !0), defines.REFLECTIONMAP_3D = reflectionTexture.isCube, defines.REFLECTIONMAP_OPPOSITEZ = defines.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !reflectionTexture.invertZ : reflectionTexture.invertZ, reflectionTexture.coordinatesMode) {case Textures_texture/* Texture.EXPLICIT_MODE */.x.EXPLICIT_MODE:defines.REFLECTIONMAP_EXPLICIT = !0;break;case Textures_texture/* Texture.PLANAR_MODE */.x.PLANAR_MODE:defines.REFLECTIONMAP_PLANAR = !0;break;case Textures_texture/* Texture.PROJECTION_MODE */.x.PROJECTION_MODE:defines.REFLECTIONMAP_PROJECTION = !0;break;case Textures_texture/* Texture.SKYBOX_MODE */.x.SKYBOX_MODE:defines.REFLECTIONMAP_SKYBOX = !0;break;case Textures_texture/* Texture.SPHERICAL_MODE */.x.SPHERICAL_MODE:defines.REFLECTIONMAP_SPHERICAL = !0;break;case Textures_texture/* Texture.EQUIRECTANGULAR_MODE */.x.EQUIRECTANGULAR_MODE:defines.REFLECTIONMAP_EQUIRECTANGULAR = !0;break;case Textures_texture/* Texture.FIXED_EQUIRECTANGULAR_MODE */.x.FIXED_EQUIRECTANGULAR_MODE:defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;break;case Textures_texture/* Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE */.x.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;break;case Textures_texture/* Texture.CUBIC_MODE */.x.CUBIC_MODE:case Textures_texture/* Texture.INVCUBIC_MODE */.x.INVCUBIC_MODE:default:defines.REFLECTIONMAP_CUBIC = !0;}this.reflectionFresnel ? (defines.REFLECTIONFRESNEL = !0, defines.REFLECTIONFALLOFF = 0 < this.reflectionFalloffDistance, this._reflectionControls.x = this.reflectionAmount, this._reflectionControls.y = this.reflectionReflectance0, this._reflectionControls.z = this.reflectionReflectance90, this._reflectionControls.w = 1 / this.reflectionFalloffDistance) : (defines.REFLECTIONFRESNEL = !1, defines.REFLECTIONFALLOFF = !1);} else defines.REFLECTION = !1, defines.REFLECTIONFRESNEL = !1, defines.REFLECTIONFALLOFF = !1, defines.REFLECTIONBLUR = !1, defines.REFLECTIONMAP_3D = !1, defines.REFLECTIONMAP_SPHERICAL = !1, defines.REFLECTIONMAP_PLANAR = !1, defines.REFLECTIONMAP_CUBIC = !1, defines.REFLECTIONMAP_PROJECTION = !1, defines.REFLECTIONMAP_SKYBOX = !1, defines.REFLECTIONMAP_EXPLICIT = !1, defines.REFLECTIONMAP_EQUIRECTANGULAR = !1, defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, defines.INVERTCUBICMAP = !1, defines.REFLECTIONMAP_OPPOSITEZ = !1, defines.LODINREFLECTIONALPHA = !1, defines.GAMMAREFLECTION = !1, defines.RGBDREFLECTION = !1;}defines.PREMULTIPLYALPHA = 7 === this.alphaMode || 8 === this.alphaMode, defines.USERGBCOLOR = this._useRGBColor, defines.NOISE = this._enableNoise;}if (defines._areLightsDirty && (defines.USEHIGHLIGHTANDSHADOWCOLORS = !this._useRGBColor && (0 !== this._primaryColorShadowLevel || 0 !== this._primaryColorHighlightLevel), defines.BACKMAT_SHADOWONLY = this._shadowOnly), defines._areImageProcessingDirty && this._imageProcessingConfiguration) {if (!this._imageProcessingConfiguration.isReady()) return !1;this._imageProcessingConfiguration.prepareDefines(defines);}if (materialHelper/* MaterialHelper.PrepareDefinesForMisc */.G.PrepareDefinesForMisc(mesh, scene, !1, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines), materialHelper/* MaterialHelper.PrepareDefinesForFrameBoundValues */.G.PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances, null, subMesh.getRenderingMesh().hasThinInstances), materialHelper/* MaterialHelper.PrepareDefinesForAttributes */.G.PrepareDefinesForAttributes(mesh, defines, !1, !0, !1) && mesh && !scene.getEngine().getCaps().standardDerivatives && !mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind) && (mesh.createNormals(!0), logger/* Logger.Warn */.Y.Warn("BackgroundMaterial: Normals have been created for the mesh: " + mesh.name)), defines.isDirty) {defines.markAsProcessed(), scene.resetCachedMaterial();const fallbacks = new effectFallbacks/* EffectFallbacks */.L();defines.FOG && fallbacks.addFallback(0, "FOG"), defines.POINTSIZE && fallbacks.addFallback(1, "POINTSIZE"), defines.MULTIVIEW && fallbacks.addFallback(0, "MULTIVIEW"), materialHelper/* MaterialHelper.HandleFallbacksForShadows */.G.HandleFallbacksForShadows(defines, fallbacks, this._maxSimultaneousLights);const attribs = [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];defines.NORMAL && attribs.push(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind), defines.UV1 && attribs.push(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), defines.UV2 && attribs.push(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind), materialHelper/* MaterialHelper.PrepareAttributesForBones */.G.PrepareAttributesForBones(attribs, mesh, defines, fallbacks), materialHelper/* MaterialHelper.PrepareAttributesForInstances */.G.PrepareAttributesForInstances(attribs, defines);const uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vFogInfos", "vFogColor", "pointSize", "mBones", "vPrimaryColor", "vPrimaryColorShadow", "vReflectionInfos", "reflectionMatrix", "vReflectionMicrosurfaceInfos", "fFovMultiplier", "shadowLevel", "alpha", "vBackgroundCenter", "vReflectionControl", "vDiffuseInfos", "diffuseMatrix"];(0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(uniforms);const samplers = ["diffuseSampler", "reflectionSampler", "reflectionSamplerLow", "reflectionSamplerHigh"],uniformBuffers = ["Material", "Scene"];Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.$ && (Materials_imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareUniforms */.$.PrepareUniforms(uniforms, defines), Materials_imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareSamplers */.$.PrepareSamplers(samplers, defines)), materialHelper/* MaterialHelper.PrepareUniformsAndSamplersList */.G.PrepareUniformsAndSamplersList({ uniformsNames: uniforms, uniformBuffersNames: uniformBuffers, samplers: samplers, defines: defines, maxSimultaneousLights: this._maxSimultaneousLights });const join = defines.toString(),effect = scene.getEngine().createEffect("background", { attributes: attribs, uniformsNames: uniforms, uniformBuffersNames: uniformBuffers, samplers: samplers, defines: join, fallbacks: fallbacks, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights } }, engine);subMesh.setEffect(effect, defines, this._materialContext), this.buildUniformLayout();}return !!(subMesh.effect && subMesh.effect.isReady()) && (defines._renderId = scene.getRenderId(), subMesh.effect._wasPreviouslyReady = !0, subMesh.effect._wasPreviouslyUsingInstances = useInstances, scene.performancePriority !== core_scene/* ScenePerformancePriority.BackwardCompatible */.a.BackwardCompatible && (this.checkReadyOnlyOnce = !0), !0);}_computePrimaryColorFromPerceptualColor() {this.__perceptualColor && (this._primaryColor.copyFrom(this.__perceptualColor), this._primaryColor.toLinearSpaceToRef(this._primaryColor), this._imageProcessingConfiguration && this._primaryColor.scaleToRef(1 / this._imageProcessingConfiguration.exposure, this._primaryColor), this._computePrimaryColors());}_computePrimaryColors() {0 === this._primaryColorShadowLevel && 0 === this._primaryColorHighlightLevel || (this._primaryColor.scaleToRef(this._primaryColorShadowLevel, this._primaryShadowColor), this._primaryColor.subtractToRef(this._primaryShadowColor, this._primaryShadowColor), this._white.subtractToRef(this._primaryColor, this._primaryHighlightColor), this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel, this._primaryHighlightColor), this._primaryColor.addToRef(this._primaryHighlightColor, this._primaryHighlightColor));}buildUniformLayout() {this._uniformBuffer.addUniform("vPrimaryColor", 4), this._uniformBuffer.addUniform("vPrimaryColorShadow", 4), this._uniformBuffer.addUniform("vDiffuseInfos", 2), this._uniformBuffer.addUniform("vReflectionInfos", 2), this._uniformBuffer.addUniform("diffuseMatrix", 16), this._uniformBuffer.addUniform("reflectionMatrix", 16), this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos", 3), this._uniformBuffer.addUniform("fFovMultiplier", 1), this._uniformBuffer.addUniform("pointSize", 1), this._uniformBuffer.addUniform("shadowLevel", 1), this._uniformBuffer.addUniform("alpha", 1), this._uniformBuffer.addUniform("vBackgroundCenter", 3), this._uniformBuffer.addUniform("vReflectionControl", 4), this._uniformBuffer.create();}unbind() {this._diffuseTexture && this._diffuseTexture.isRenderTarget && this._uniformBuffer.setTexture("diffuseSampler", null), this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._uniformBuffer.setTexture("reflectionSampler", null), super.unbind();}bindOnlyWorldMatrix(world) {this._activeEffect.setMatrix("world", world);}bindForSubMesh(world, mesh, subMesh) {const scene = this.getScene(),defines = subMesh.materialDefines;if (defines) {const effect = subMesh.effect;if (effect) {this._activeEffect = effect, this.bindOnlyWorldMatrix(world), materialHelper/* MaterialHelper.BindBonesParameters */.G.BindBonesParameters(mesh, this._activeEffect);const mustRebind = this._mustRebind(scene, effect, mesh.visibility);if (mustRebind) {this._uniformBuffer.bindToEffect(effect, "Material"), this.bindViewProjection(effect);const reflectionTexture = this._reflectionTexture;this._uniformBuffer.useUbo && this.isFrozen && this._uniformBuffer.isSync || (scene.texturesEnabled && (this._diffuseTexture && materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled && (this._uniformBuffer.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), materialHelper/* MaterialHelper.BindTextureMatrix */.G.BindTextureMatrix(this._diffuseTexture, this._uniformBuffer, "diffuse")), reflectionTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled && (this._uniformBuffer.updateMatrix("reflectionMatrix", reflectionTexture.getReflectionTextureMatrix()), this._uniformBuffer.updateFloat2("vReflectionInfos", reflectionTexture.level, this._reflectionBlur), this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos", reflectionTexture.getSize().width, reflectionTexture.lodGenerationScale, reflectionTexture.lodGenerationOffset))), 0 < this.shadowLevel && this._uniformBuffer.updateFloat("shadowLevel", this.shadowLevel), this._uniformBuffer.updateFloat("alpha", this.alpha), this.pointsCloud && this._uniformBuffer.updateFloat("pointSize", this.pointSize), defines.USEHIGHLIGHTANDSHADOWCOLORS ? (this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryHighlightColor, 1), this._uniformBuffer.updateColor4("vPrimaryColorShadow", this._primaryShadowColor, 1)) : this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryColor, 1)), this._uniformBuffer.updateFloat("fFovMultiplier", this._fovMultiplier), scene.texturesEnabled && (this._diffuseTexture && materialFlags/* MaterialFlags.DiffuseTextureEnabled */.k.DiffuseTextureEnabled && this._uniformBuffer.setTexture("diffuseSampler", this._diffuseTexture), reflectionTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled && (defines.REFLECTIONBLUR && defines.TEXTURELODSUPPORT ? this._uniformBuffer.setTexture("reflectionSampler", reflectionTexture) : defines.REFLECTIONBLUR ? (this._uniformBuffer.setTexture("reflectionSampler", reflectionTexture._lodTextureMid || reflectionTexture), this._uniformBuffer.setTexture("reflectionSamplerLow", reflectionTexture._lodTextureLow || reflectionTexture), this._uniformBuffer.setTexture("reflectionSamplerHigh", reflectionTexture._lodTextureHigh || reflectionTexture)) : this._uniformBuffer.setTexture("reflectionSampler", reflectionTexture), defines.REFLECTIONFRESNEL && (this._uniformBuffer.updateFloat3("vBackgroundCenter", this.sceneCenter.x, this.sceneCenter.y, this.sceneCenter.z), this._uniformBuffer.updateFloat4("vReflectionControl", this._reflectionControls.x, this._reflectionControls.y, this._reflectionControls.z, this._reflectionControls.w)))), (0,clipPlaneMaterialHelper/* bindClipPlane */.an)(this._activeEffect, this, scene), scene.bindEyePosition(effect);} else scene.getEngine()._features.needToAlwaysBindUniformBuffers && (this._uniformBuffer.bindToEffect(effect, "Material"), this._needToBindSceneUbo = !0);(mustRebind || !this.isFrozen) && (scene.lightsEnabled && materialHelper/* MaterialHelper.BindLights */.G.BindLights(scene, mesh, this._activeEffect, defines, this._maxSimultaneousLights), this.bindView(effect), materialHelper/* MaterialHelper.BindFogParameters */.G.BindFogParameters(scene, mesh, this._activeEffect, !0), this._imageProcessingConfiguration && this._imageProcessingConfiguration.bind(this._activeEffect)), this._afterBind(mesh, this._activeEffect), this._uniformBuffer.update();}}}hasTexture(texture) {return !!super.hasTexture(texture) || !(this._reflectionTexture !== texture) || !(this._diffuseTexture !== texture);}dispose(forceDisposeEffect = !1, forceDisposeTextures = !1) {forceDisposeTextures && (this.diffuseTexture && this.diffuseTexture.dispose(), this.reflectionTexture && this.reflectionTexture.dispose()), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), super.dispose(forceDisposeEffect);}clone(name) {return decorators/* SerializationHelper.Clone */.p4.Clone(() => new BackgroundMaterial(name, this.getScene()), this);}serialize() {const serializationObject = super.serialize();return serializationObject.customType = "BABYLON.BackgroundMaterial", serializationObject;}getClassName() {return "BackgroundMaterial";}static Parse(source, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new BackgroundMaterial(source.name, scene), source, scene, rootUrl);}}BackgroundMaterial.StandardReflectance0 = .05, BackgroundMaterial.StandardReflectance90 = .5, (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)()], BackgroundMaterial.prototype, "_primaryColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsLightsDirty")], BackgroundMaterial.prototype, "primaryColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)()], BackgroundMaterial.prototype, "__perceptualColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_primaryColorShadowLevel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_primaryColorHighlightLevel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsLightsDirty")], BackgroundMaterial.prototype, "primaryColorHighlightLevel", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)()], BackgroundMaterial.prototype, "_reflectionTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "reflectionTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_reflectionBlur", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "reflectionBlur", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)()], BackgroundMaterial.prototype, "_diffuseTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "diffuseTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "shadowLights", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_shadowLevel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "shadowLevel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsVector3 */.hd)()], BackgroundMaterial.prototype, "_sceneCenter", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "sceneCenter", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_opacityFresnel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "opacityFresnel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_reflectionFresnel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "reflectionFresnel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_reflectionFalloffDistance", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "reflectionFalloffDistance", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_reflectionAmount", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "reflectionAmount", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_reflectionReflectance0", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "reflectionReflectance0", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_reflectionReflectance90", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "reflectionReflectance90", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_useRGBColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "useRGBColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_enableNoise", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "enableNoise", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_maxSimultaneousLights", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], BackgroundMaterial.prototype, "maxSimultaneousLights", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BackgroundMaterial.prototype, "_shadowOnly", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsLightsDirty")], BackgroundMaterial.prototype, "shadowOnly", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsImageProcessingConfiguration */.rX)()], BackgroundMaterial.prototype, "_imageProcessingConfiguration", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.BackgroundMaterial", BackgroundMaterial);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Helpers/environmentHelper.js
class EnvironmentHelper {static _GetDefaultOptions() {return { createGround: !0, groundSize: 15, groundTexture: this._GroundTextureCDNUrl, groundColor: new math_color/* Color3 */.Wo(.2, .2, .3).toLinearSpace().scale(3), groundOpacity: .9, enableGroundShadow: !0, groundShadowLevel: .5, enableGroundMirror: !1, groundMirrorSizeRatio: .3, groundMirrorBlurKernel: 64, groundMirrorAmount: 1, groundMirrorFresnelWeight: 1, groundMirrorFallOffDistance: 0, groundMirrorTextureType: 0, groundYBias: 1e-5, createSkybox: !0, skyboxSize: 20, skyboxTexture: this._SkyboxTextureCDNUrl, skyboxColor: new math_color/* Color3 */.Wo(.2, .2, .3).toLinearSpace().scale(3), backgroundYRotation: 0, sizeAuto: !0, rootPosition: math_vector/* Vector3.Zero */.P.Zero(), setupImageProcessing: !0, environmentTexture: this._EnvironmentTextureCDNUrl, cameraExposure: .8, cameraContrast: 1.2, toneMappingEnabled: !0 };}get rootMesh() {return this._rootMesh;}get skybox() {return this._skybox;}get skyboxTexture() {return this._skyboxTexture;}get skyboxMaterial() {return this._skyboxMaterial;}get ground() {return this._ground;}get groundTexture() {return this._groundTexture;}get groundMirror() {return this._groundMirror;}get groundMirrorRenderList() {return this._groundMirror ? this._groundMirror.renderList : null;}get groundMaterial() {return this._groundMaterial;}constructor(options, scene) {this._errorHandler = (message, exception) => {this.onErrorObservable.notifyObservers({ message: message, exception: exception });}, this._options = { ...EnvironmentHelper._GetDefaultOptions(), ...options }, this._scene = scene, this.onErrorObservable = new observable/* Observable */.y$(), this._setupBackground(), this._setupImageProcessing();}updateOptions(options) {const newOptions = { ...this._options, ...options };this._ground && !newOptions.createGround && (this._ground.dispose(), this._ground = null), this._groundMaterial && !newOptions.createGround && (this._groundMaterial.dispose(), this._groundMaterial = null), this._groundTexture && this._options.groundTexture != newOptions.groundTexture && (this._groundTexture.dispose(), this._groundTexture = null), this._skybox && !newOptions.createSkybox && (this._skybox.dispose(), this._skybox = null), this._skyboxMaterial && !newOptions.createSkybox && (this._skyboxMaterial.dispose(), this._skyboxMaterial = null), this._skyboxTexture && this._options.skyboxTexture != newOptions.skyboxTexture && (this._skyboxTexture.dispose(), this._skyboxTexture = null), this._groundMirror && !newOptions.enableGroundMirror && (this._groundMirror.dispose(), this._groundMirror = null), this._scene.environmentTexture && this._options.environmentTexture != newOptions.environmentTexture && this._scene.environmentTexture.dispose(), this._options = newOptions, this._setupBackground(), this._setupImageProcessing();}setMainColor(color) {this.groundMaterial && (this.groundMaterial.primaryColor = color), this.skyboxMaterial && (this.skyboxMaterial.primaryColor = color), this.groundMirror && (this.groundMirror.clearColor = new math_color/* Color4 */.HE(color.r, color.g, color.b, 1));}_setupImageProcessing() {this._options.setupImageProcessing && (this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast, this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure, this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled, this._setupEnvironmentTexture());}_setupEnvironmentTexture() {if (!this._scene.environmentTexture) {if (this._options.environmentTexture instanceof baseTexture/* BaseTexture */.V) return void (this._scene.environmentTexture = this._options.environmentTexture);const environmentTexture = Textures_cubeTexture/* CubeTexture.CreateFromPrefilteredData */.B.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);this._scene.environmentTexture = environmentTexture;}}_setupBackground() {this._rootMesh || (this._rootMesh = new Meshes_mesh/* Mesh */.Kj("BackgroundHelper", this._scene)), this._rootMesh.rotation.y = this._options.backgroundYRotation;const sceneSize = this._getSceneSize();this._options.createGround && (this._setupGround(sceneSize), this._setupGroundMaterial(), this._setupGroundDiffuseTexture(), this._options.enableGroundMirror && this._setupGroundMirrorTexture(sceneSize), this._setupMirrorInGroundMaterial()), this._options.createSkybox && (this._setupSkybox(sceneSize), this._setupSkyboxMaterial(), this._setupSkyboxReflectionTexture()), this._rootMesh.position.x = sceneSize.rootPosition.x, this._rootMesh.position.z = sceneSize.rootPosition.z, this._rootMesh.position.y = sceneSize.rootPosition.y;}_getSceneSize() {let groundSize = this._options.groundSize,skyboxSize = this._options.skyboxSize,rootPosition = this._options.rootPosition;if (!this._scene.meshes || 1 === this._scene.meshes.length) return { groundSize, skyboxSize, rootPosition };const sceneExtends = this._scene.getWorldExtends((mesh) => mesh !== this._ground && mesh !== this._rootMesh && mesh !== this._skybox),sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);if (this._options.sizeAuto) {this._scene.activeCamera instanceof ArcRotateCamera && this._scene.activeCamera.upperRadiusLimit && (groundSize = 2 * this._scene.activeCamera.upperRadiusLimit, skyboxSize = groundSize);const sceneDiagonalLenght = sceneDiagonal.length();sceneDiagonalLenght > groundSize && (groundSize = 2 * sceneDiagonalLenght, skyboxSize = groundSize), groundSize *= 1.1, skyboxSize *= 1.5, rootPosition = sceneExtends.min.add(sceneDiagonal.scale(.5)), rootPosition.y = sceneExtends.min.y - this._options.groundYBias;}return { groundSize, skyboxSize, rootPosition };}_setupGround(sceneSize) {(!this._ground || this._ground.isDisposed()) && (this._ground = CreatePlane("BackgroundPlane", { size: sceneSize.groundSize }, this._scene), this._ground.rotation.x = Math.PI / 2, this._ground.parent = this._rootMesh, this._ground.onDisposeObservable.add(() => {this._ground = null;})), this._ground.receiveShadows = this._options.enableGroundShadow;}_setupGroundMaterial() {this._groundMaterial || (this._groundMaterial = new BackgroundMaterial("BackgroundPlaneMaterial", this._scene)), this._groundMaterial.alpha = this._options.groundOpacity, this._groundMaterial.alphaMode = 8, this._groundMaterial.shadowLevel = this._options.groundShadowLevel, this._groundMaterial.primaryColor = this._options.groundColor, this._groundMaterial.useRGBColor = !1, this._groundMaterial.enableNoise = !0, this._ground && (this._ground.material = this._groundMaterial);}_setupGroundDiffuseTexture() {return this._groundMaterial ? this._groundTexture ? void 0 : this._options.groundTexture instanceof baseTexture/* BaseTexture */.V ? void (this._groundMaterial.diffuseTexture = this._options.groundTexture) : void (this._groundTexture = new Textures_texture/* Texture */.x(this._options.groundTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler), this._groundTexture.gammaSpace = !1, this._groundTexture.hasAlpha = !0, this._groundMaterial.diffuseTexture = this._groundTexture) : void 0;}_setupGroundMirrorTexture(sceneSize) {const wrapping = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE;if (!this._groundMirror && (this._groundMirror = new MirrorTexture("BackgroundPlaneMirrorTexture", { ratio: this._options.groundMirrorSizeRatio }, this._scene, !1, this._options.groundMirrorTextureType, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, !0), this._groundMirror.mirrorPlane = new math_plane/* Plane */.J(0, -1, 0, sceneSize.rootPosition.y), this._groundMirror.anisotropicFilteringLevel = 1, this._groundMirror.wrapU = wrapping, this._groundMirror.wrapV = wrapping, this._groundMirror.renderList)) for (let i = 0; i < this._scene.meshes.length; i++) {const mesh = this._scene.meshes[i];mesh !== this._ground && mesh !== this._skybox && mesh !== this._rootMesh && this._groundMirror.renderList.push(mesh);}const gammaGround = this._options.groundColor.toGammaSpace();this._groundMirror.clearColor = new math_color/* Color4 */.HE(gammaGround.r, gammaGround.g, gammaGround.b, 1), this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;}_setupMirrorInGroundMaterial() {this._groundMaterial && (this._groundMaterial.reflectionTexture = this._groundMirror, this._groundMaterial.reflectionFresnel = !0, this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount, this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight, this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance);}_setupSkybox(sceneSize) {(!this._skybox || this._skybox.isDisposed()) && (this._skybox = CreateBox("BackgroundSkybox", { size: sceneSize.skyboxSize, sideOrientation: Meshes_mesh/* Mesh.BACKSIDE */.Kj.BACKSIDE }, this._scene), this._skybox.onDisposeObservable.add(() => {this._skybox = null;})), this._skybox.parent = this._rootMesh;}_setupSkyboxMaterial() {this._skybox && (!this._skyboxMaterial && (this._skyboxMaterial = new BackgroundMaterial("BackgroundSkyboxMaterial", this._scene)), this._skyboxMaterial.useRGBColor = !1, this._skyboxMaterial.primaryColor = this._options.skyboxColor, this._skyboxMaterial.enableNoise = !0, this._skybox.material = this._skyboxMaterial);}_setupSkyboxReflectionTexture() {return this._skyboxMaterial ? this._skyboxTexture ? void 0 : this._options.skyboxTexture instanceof baseTexture/* BaseTexture */.V ? void (this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture) : void (this._skyboxTexture = new Textures_cubeTexture/* CubeTexture */.B(this._options.skyboxTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler), this._skyboxTexture.coordinatesMode = Textures_texture/* Texture.SKYBOX_MODE */.x.SKYBOX_MODE, this._skyboxTexture.gammaSpace = !1, this._skyboxMaterial.reflectionTexture = this._skyboxTexture) : void 0;}dispose() {this._groundMaterial && this._groundMaterial.dispose(!0, !0), this._skyboxMaterial && this._skyboxMaterial.dispose(!0, !0), this._rootMesh.dispose(!1);}}EnvironmentHelper._GroundTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundGround.png", EnvironmentHelper._SkyboxTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundSkybox.dds", EnvironmentHelper._EnvironmentTextureCDNUrl = "https://assets.babylonjs.com/environments/environmentSpecular.env";
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Helpers/textureDome.js
class TextureDome extends transformNode/* TransformNode */.Y {get texture() {return this._texture;}set texture(newTexture) {this._texture === newTexture || (this._texture = newTexture, this._useDirectMapping ? (this._texture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._texture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._material.diffuseTexture = this._texture) : (this._texture.coordinatesMode = Textures_texture/* Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE */.x.FIXED_EQUIRECTANGULAR_MIRRORED_MODE, this._texture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._material.reflectionTexture = this._texture), this._changeTextureMode(this._textureMode));}get mesh() {return this._mesh;}get fovMultiplier() {return this._material.fovMultiplier;}set fovMultiplier(value) {this._material.fovMultiplier = value;}get textureMode() {return this._textureMode;}set textureMode(value) {this._textureMode === value || this._changeTextureMode(value);}get halfDome() {return this._halfDome;}set halfDome(enabled) {this._halfDome = enabled, this._halfDomeMask.setEnabled(enabled), this._changeTextureMode(this._textureMode);}set crossEye(enabled) {this._crossEye = enabled, this._changeTextureMode(this._textureMode);}get crossEye() {return this._crossEye;}get material() {return this._material;}constructor(name, textureUrlOrElement, options, scene, onError = null) {super(name, scene), this.onError = onError, this._halfDome = !1, this._crossEye = !1, this._useDirectMapping = !1, this._textureMode = TextureDome.MODE_MONOSCOPIC, this._onBeforeCameraRenderObserver = null, this.onLoadErrorObservable = new observable/* Observable */.y$(), this.onLoadObservable = new observable/* Observable */.y$(), scene = this.getScene(), name = name || "textureDome", options.resolution = 0 | Math.abs(options.resolution) || 32, options.clickToPlay = !!options.clickToPlay, options.autoPlay = void 0 === options.autoPlay || !!options.autoPlay, options.loop = void 0 === options.loop || !!options.loop, options.size = Math.abs(options.size) || (scene.activeCamera ? .48 * scene.activeCamera.maxZ : 1e3), this._useDirectMapping = void 0 === options.useDirectMapping || options.useDirectMapping, void 0 === options.faceForward && (options.faceForward = !0), this._setReady(!1), this._mesh = options.mesh ? options.mesh : CreateSphere(name + "_mesh", { segments: options.resolution, diameter: options.size, updatable: !1, sideOrientation: Meshes_mesh/* Mesh.BACKSIDE */.Kj.BACKSIDE }, scene);const material = this._material = new BackgroundMaterial(name + "_material", scene);material.useEquirectangularFOV = !0, material.fovMultiplier = 1, material.opacityFresnel = !1;const texture = this._initTexture(textureUrlOrElement, scene, options);if (this.texture = texture, this._mesh.material = material, this._mesh.parent = this, this._halfDomeMask = CreateSphere("", { slice: .5, diameter: .98 * options.size, segments: 2 * options.resolution, sideOrientation: Meshes_mesh/* Mesh.BACKSIDE */.Kj.BACKSIDE }, scene), this._halfDomeMask.rotate(math/* Axis.X */.RD.X, -Math.PI / 2), this._halfDomeMask.parent = this._mesh, this._halfDome = !!options.halfDomeMode, this._halfDomeMask.setEnabled(this._halfDome), this._crossEye = !!options.crossEyeMode, this._texture.anisotropicFilteringLevel = 1, this._texture.onLoadObservable.addOnce(() => {this._setReady(!0);}), options.faceForward && scene.activeCamera) {const camera = scene.activeCamera,forward = math_vector/* Vector3.Forward */.P.Forward(),direction = math_vector/* Vector3.TransformNormal */.P.TransformNormal(forward, camera.getViewMatrix());direction.normalize(), this.rotation.y = Math.acos(math_vector/* Vector3.Dot */.P.Dot(forward, direction));}this._changeTextureMode(this._textureMode);}_changeTextureMode(value) {switch (this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._textureMode = value, this._texture.uScale = 1, this._texture.vScale = 1, this._texture.uOffset = 0, this._texture.vOffset = 0, this._texture.vAng = 0, value) {case TextureDome.MODE_MONOSCOPIC:this._halfDome && (this._texture.uScale = 2, this._texture.uOffset = -1);break;case TextureDome.MODE_SIDEBYSIDE:{this._texture.uScale = this._halfDome ? .99999 : .5;const rightOffset = this._halfDome ? 0 : .5,leftOffset = this._halfDome ? -.5 : 0;this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {let isRightCamera = camera.isRightCamera;this._crossEye && (isRightCamera = !isRightCamera), this._texture.uOffset = isRightCamera ? rightOffset : leftOffset;});break;}case TextureDome.MODE_TOPBOTTOM:this._texture.vScale = this._halfDome ? .99999 : .5, this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {let isRightCamera = camera.isRightCamera;this._crossEye && (isRightCamera = !isRightCamera), this._texture.vOffset = isRightCamera ? .5 : 0;});}}dispose(doNotRecurse, disposeMaterialAndTextures = !1) {this._texture.dispose(), this._mesh.dispose(), this._material.dispose(), this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this.onLoadErrorObservable.clear(), this.onLoadObservable.clear(), super.dispose(doNotRecurse, disposeMaterialAndTextures);}}TextureDome.MODE_MONOSCOPIC = 0, TextureDome.MODE_TOPBOTTOM = 1, TextureDome.MODE_SIDEBYSIDE = 2;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Helpers/photoDome.js
class PhotoDome extends TextureDome {get photoTexture() {return this.texture;}set photoTexture(value) {this.texture = value;}get imageMode() {return this.textureMode;}set imageMode(value) {this.textureMode = value;}_initTexture(urlsOrElement, scene, options) {return new Textures_texture/* Texture */.x(urlsOrElement, scene, !options.generateMipMaps, !this._useDirectMapping, void 0, () => {this.onLoadObservable.notifyObservers();}, (message, exception) => {this.onLoadErrorObservable.notifyObservers(message || "Unknown error occured"), this.onError && this.onError(message, exception);});}}PhotoDome.MODE_MONOSCOPIC = TextureDome.MODE_MONOSCOPIC, PhotoDome.MODE_TOPBOTTOM = TextureDome.MODE_TOPBOTTOM, PhotoDome.MODE_SIDEBYSIDE = TextureDome.MODE_SIDEBYSIDE;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.js
var pbrMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/sphericalPolynomial.js
var sphericalPolynomial = __webpack_require__("./node_modules/@babylonjs/core/Maths/sphericalPolynomial.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js
var cubemapToSphericalPolynomial = __webpack_require__("./node_modules/@babylonjs/core/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/dds.js
const DDS_MAGIC = 542327876,DDSD_MIPMAPCOUNT = 131072,DDSCAPS2_CUBEMAP = 512,DDPF_FOURCC = 4,DDPF_RGB = 64,DDPF_LUMINANCE = 131072;function FourCCToInt32(value) {return value.charCodeAt(0) + (value.charCodeAt(1) << 8) + (value.charCodeAt(2) << 16) + (value.charCodeAt(3) << 24);}function Int32ToFourCC(value) {return String.fromCharCode(255 & value, 255 & value >> 8, 255 & value >> 16, 255 & value >> 24);}const FOURCC_DXT1 = FourCCToInt32("DXT1"),FOURCC_DXT3 = FourCCToInt32("DXT3"),FOURCC_DXT5 = FourCCToInt32("DXT5"),FOURCC_DX10 = FourCCToInt32("DX10"),FOURCC_D3DFMT_R16G16B16A16F = 113,FOURCC_D3DFMT_R32G32B32A32F = 116,DXGI_FORMAT_R32G32B32A32_FLOAT = 2,DXGI_FORMAT_R16G16B16A16_FLOAT = 10,DXGI_FORMAT_B8G8R8X8_UNORM = 88,headerLengthInt = 31,off_magic = 0,off_size = 1,off_flags = 2,off_height = 3,off_width = 4,off_mipmapCount = 7,off_pfFlags = 20,off_pfFourCC = 21,off_RGBbpp = 22,off_RMask = 23,off_GMask = 24,off_BMask = 25,off_AMask = 26,off_caps2 = 28,off_dxgiFormat = 32;class DDSTools {static GetDDSInfo(data) {const header = new Int32Array(data.buffer, data.byteOffset, headerLengthInt),extendedHeader = new Int32Array(data.buffer, data.byteOffset, headerLengthInt + 4);let mipmapCount = 1;header[off_flags] & DDSD_MIPMAPCOUNT && (mipmapCount = Math.max(1, header[off_mipmapCount]));const fourCC = header[off_pfFourCC],dxgiFormat = fourCC === FOURCC_DX10 ? extendedHeader[off_dxgiFormat] : 0;let textureType = 0;switch (fourCC) {case FOURCC_D3DFMT_R16G16B16A16F:textureType = 2;break;case FOURCC_D3DFMT_R32G32B32A32F:textureType = 1;break;case FOURCC_DX10:if (dxgiFormat === DXGI_FORMAT_R16G16B16A16_FLOAT) {textureType = 2;break;}if (dxgiFormat === DXGI_FORMAT_R32G32B32A32_FLOAT) {textureType = 1;break;}}return { width: header[off_width], height: header[off_height], mipmapCount: mipmapCount, isFourCC: (header[off_pfFlags] & DDPF_FOURCC) === DDPF_FOURCC, isRGB: (header[off_pfFlags] & DDPF_RGB) === DDPF_RGB, isLuminance: (header[off_pfFlags] & DDPF_LUMINANCE) === DDPF_LUMINANCE, isCube: (header[off_caps2] & DDSCAPS2_CUBEMAP) === DDSCAPS2_CUBEMAP, isCompressed: fourCC === FOURCC_DXT1 || fourCC === FOURCC_DXT3 || fourCC === FOURCC_DXT5, dxgiFormat: dxgiFormat, textureType: textureType };}static _GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {const destArray = new Float32Array(dataLength),srcData = new Uint16Array(arrayBuffer, dataOffset);let index = 0;for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {const srcPos = 4 * (x + y * width);destArray[index] = (0,textureTools/* FromHalfFloat */.qZ)(srcData[srcPos]), destArray[index + 1] = (0,textureTools/* FromHalfFloat */.qZ)(srcData[srcPos + 1]), destArray[index + 2] = (0,textureTools/* FromHalfFloat */.qZ)(srcData[srcPos + 2]), destArray[index + 3] = DDSTools.StoreLODInAlphaChannel ? lod : (0,textureTools/* FromHalfFloat */.qZ)(srcData[srcPos + 3]), index += 4;}return destArray;}static _GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {if (DDSTools.StoreLODInAlphaChannel) {const destArray = new Uint16Array(dataLength),srcData = new Uint16Array(arrayBuffer, dataOffset);let index = 0;for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {const srcPos = 4 * (x + y * width);destArray[index] = srcData[srcPos], destArray[index + 1] = srcData[srcPos + 1], destArray[index + 2] = srcData[srcPos + 2], destArray[index + 3] = (0,textureTools/* ToHalfFloat */.ay)(lod), index += 4;}return destArray;}return new Uint16Array(arrayBuffer, dataOffset, dataLength);}static _GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {if (DDSTools.StoreLODInAlphaChannel) {const destArray = new Float32Array(dataLength),srcData = new Float32Array(arrayBuffer, dataOffset);let index = 0;for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {const srcPos = 4 * (x + y * width);destArray[index] = srcData[srcPos], destArray[index + 1] = srcData[srcPos + 1], destArray[index + 2] = srcData[srcPos + 2], destArray[index + 3] = lod, index += 4;}return destArray;}return new Float32Array(arrayBuffer, dataOffset, dataLength);}static _GetFloatAsHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {const destArray = new Uint16Array(dataLength),srcData = new Float32Array(arrayBuffer, dataOffset);let index = 0;for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) destArray[index] = (0,textureTools/* ToHalfFloat */.ay)(srcData[index]), destArray[index + 1] = (0,textureTools/* ToHalfFloat */.ay)(srcData[index + 1]), destArray[index + 2] = (0,textureTools/* ToHalfFloat */.ay)(srcData[index + 2]), destArray[index + 3] = DDSTools.StoreLODInAlphaChannel ? (0,textureTools/* ToHalfFloat */.ay)(lod) : (0,textureTools/* ToHalfFloat */.ay)(srcData[index + 3]), index += 4;return destArray;}static _GetFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {const destArray = new Uint8Array(dataLength),srcData = new Float32Array(arrayBuffer, dataOffset);let index = 0;for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {const srcPos = 4 * (x + y * width);destArray[index] = 255 * math_scalar/* Scalar.Clamp */.R.Clamp(srcData[srcPos]), destArray[index + 1] = 255 * math_scalar/* Scalar.Clamp */.R.Clamp(srcData[srcPos + 1]), destArray[index + 2] = 255 * math_scalar/* Scalar.Clamp */.R.Clamp(srcData[srcPos + 2]), destArray[index + 3] = DDSTools.StoreLODInAlphaChannel ? lod : 255 * math_scalar/* Scalar.Clamp */.R.Clamp(srcData[srcPos + 3]), index += 4;}return destArray;}static _GetHalfFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {const destArray = new Uint8Array(dataLength),srcData = new Uint16Array(arrayBuffer, dataOffset);let index = 0;for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {const srcPos = 4 * (x + y * width);destArray[index] = 255 * math_scalar/* Scalar.Clamp */.R.Clamp((0,textureTools/* FromHalfFloat */.qZ)(srcData[srcPos])), destArray[index + 1] = 255 * math_scalar/* Scalar.Clamp */.R.Clamp((0,textureTools/* FromHalfFloat */.qZ)(srcData[srcPos + 1])), destArray[index + 2] = 255 * math_scalar/* Scalar.Clamp */.R.Clamp((0,textureTools/* FromHalfFloat */.qZ)(srcData[srcPos + 2])), destArray[index + 3] = DDSTools.StoreLODInAlphaChannel ? lod : 255 * math_scalar/* Scalar.Clamp */.R.Clamp((0,textureTools/* FromHalfFloat */.qZ)(srcData[srcPos + 3])), index += 4;}return destArray;}static _GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset, aOffset) {const byteArray = new Uint8Array(dataLength),srcData = new Uint8Array(arrayBuffer, dataOffset);let index = 0;for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {const srcPos = 4 * (x + y * width);byteArray[index] = srcData[srcPos + rOffset], byteArray[index + 1] = srcData[srcPos + gOffset], byteArray[index + 2] = srcData[srcPos + bOffset], byteArray[index + 3] = srcData[srcPos + aOffset], index += 4;}return byteArray;}static _ExtractLongWordOrder(value) {return 0 === value || 255 === value || -16777216 === value ? 0 : 1 + DDSTools._ExtractLongWordOrder(value >> 8);}static _GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset) {const byteArray = new Uint8Array(dataLength),srcData = new Uint8Array(arrayBuffer, dataOffset);let index = 0;for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {const srcPos = 3 * (x + y * width);byteArray[index] = srcData[srcPos + rOffset], byteArray[index + 1] = srcData[srcPos + gOffset], byteArray[index + 2] = srcData[srcPos + bOffset], index += 3;}return byteArray;}static _GetLuminanceArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer) {const byteArray = new Uint8Array(dataLength),srcData = new Uint8Array(arrayBuffer, dataOffset);let index = 0;for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {const srcPos = x + y * width;byteArray[index] = srcData[srcPos], index++;}return byteArray;}static UploadDDSLevels(engine, texture, data, info, loadMipmaps, faces, lodIndex = -1, currentFace, destTypeMustBeFilterable = !0) {let sphericalPolynomialFaces = null;info.sphericalPolynomial && (sphericalPolynomialFaces = []);const ext = !!engine.getCaps().s3tc;texture.generateMipMaps = loadMipmaps;const header = new Int32Array(data.buffer, data.byteOffset, headerLengthInt);let fourCC,width,height,dataOffset,byteArray,mipmapCount,mip,dataLength = 0,internalCompressedFormat = 0,blockBytes = 1;if (header[off_magic] !== DDS_MAGIC) return void logger/* Logger.Error */.Y.Error("Invalid magic number in DDS header");if (!info.isFourCC && !info.isRGB && !info.isLuminance) return void logger/* Logger.Error */.Y.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");if (info.isCompressed && !ext) return void logger/* Logger.Error */.Y.Error("Compressed textures are not supported on this platform.");let bpp = header[off_RGBbpp];dataOffset = header[off_size] + 4;let computeFormats = !1;if (info.isFourCC) switch (fourCC = header[off_pfFourCC], fourCC) {case FOURCC_DXT1:blockBytes = 8, internalCompressedFormat = 33777;break;case FOURCC_DXT3:blockBytes = 16, internalCompressedFormat = 33778;break;case FOURCC_DXT5:blockBytes = 16, internalCompressedFormat = 33779;break;case FOURCC_D3DFMT_R16G16B16A16F:computeFormats = !0, bpp = 64;break;case FOURCC_D3DFMT_R32G32B32A32F:computeFormats = !0, bpp = 128;break;case FOURCC_DX10:{dataOffset += 20;let supported = !1;switch (info.dxgiFormat) {case DXGI_FORMAT_R16G16B16A16_FLOAT:computeFormats = !0, bpp = 64, supported = !0;break;case DXGI_FORMAT_R32G32B32A32_FLOAT:computeFormats = !0, bpp = 128, supported = !0;break;case DXGI_FORMAT_B8G8R8X8_UNORM:info.isRGB = !0, info.isFourCC = !1, bpp = 32, supported = !0;}if (supported) break;}default:return void console.error("Unsupported FourCC code:", Int32ToFourCC(fourCC));}const rOffset = DDSTools._ExtractLongWordOrder(header[off_RMask]),gOffset = DDSTools._ExtractLongWordOrder(header[off_GMask]),bOffset = DDSTools._ExtractLongWordOrder(header[off_BMask]),aOffset = DDSTools._ExtractLongWordOrder(header[off_AMask]);computeFormats && (internalCompressedFormat = engine._getRGBABufferInternalSizedFormat(info.textureType)), mipmapCount = 1, header[off_flags] & DDSD_MIPMAPCOUNT && !1 !== loadMipmaps && (mipmapCount = Math.max(1, header[off_mipmapCount]));const caps = engine.getCaps();for (let face = currentFace || 0; face < faces; face++) {for (width = header[off_width], height = header[off_height], mip = 0; mip < mipmapCount; ++mip) {if (-1 === lodIndex || lodIndex === mip) {const i = -1 === lodIndex ? mip : 0;if (!info.isCompressed && info.isFourCC) {texture.format = 5, dataLength = 4 * (width * height);let floatArray = null;if (engine._badOS || engine._badDesktopOS || !caps.textureHalfFloat && !caps.textureFloat) 128 === bpp ? (floatArray = DDSTools._GetFloatAsUIntRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i), sphericalPolynomialFaces && 0 == i && sphericalPolynomialFaces.push(DDSTools._GetFloatRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i))) : 64 == bpp && (floatArray = DDSTools._GetHalfFloatAsUIntRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i), sphericalPolynomialFaces && 0 == i && sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i))), texture.type = 0;else {const floatAvailable = caps.textureFloat && (destTypeMustBeFilterable && caps.textureFloatLinearFiltering || !destTypeMustBeFilterable),halfFloatAvailable = caps.textureHalfFloat && (destTypeMustBeFilterable && caps.textureHalfFloatLinearFiltering || !destTypeMustBeFilterable),destType = (128 === bpp || 64 === bpp && !halfFloatAvailable) && floatAvailable ? 1 : (64 === bpp || 128 === bpp && !floatAvailable) && halfFloatAvailable ? 2 : 0;let dataGetter,dataGetterPolynomial = null;switch (bpp) {case 128:{1 === destType ? (dataGetter = DDSTools._GetFloatRGBAArrayBuffer, dataGetterPolynomial = null) : 2 === destType ? (dataGetter = DDSTools._GetFloatAsHalfFloatRGBAArrayBuffer, dataGetterPolynomial = DDSTools._GetFloatRGBAArrayBuffer) : 0 === destType ? (dataGetter = DDSTools._GetFloatAsUIntRGBAArrayBuffer, dataGetterPolynomial = DDSTools._GetFloatRGBAArrayBuffer) : void 0;break;}default:{1 === destType ? (dataGetter = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer, dataGetterPolynomial = null) : 2 === destType ? (dataGetter = DDSTools._GetHalfFloatRGBAArrayBuffer, dataGetterPolynomial = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer) : 0 === destType ? (dataGetter = DDSTools._GetHalfFloatAsUIntRGBAArrayBuffer, dataGetterPolynomial = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer) : void 0;break;}}texture.type = destType, floatArray = dataGetter(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i), sphericalPolynomialFaces && 0 == i && sphericalPolynomialFaces.push(dataGetterPolynomial ? dataGetterPolynomial(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i) : floatArray);}floatArray && engine._uploadDataToTextureDirectly(texture, floatArray, face, i);} else if (info.isRGB) texture.type = 0, 24 === bpp ? (texture.format = 4, dataLength = 3 * (width * height), byteArray = DDSTools._GetRGBArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, rOffset, gOffset, bOffset), engine._uploadDataToTextureDirectly(texture, byteArray, face, i)) : (texture.format = 5, dataLength = 4 * (width * height), byteArray = DDSTools._GetRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, rOffset, gOffset, bOffset, aOffset), engine._uploadDataToTextureDirectly(texture, byteArray, face, i));else if (info.isLuminance) {const unpackAlignment = engine._getUnpackAlignement(),unpaddedRowSize = width,paddedRowSize = Math.floor((width + unpackAlignment - 1) / unpackAlignment) * unpackAlignment;dataLength = paddedRowSize * (height - 1) + unpaddedRowSize, byteArray = DDSTools._GetLuminanceArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer), texture.format = 1, texture.type = 0, engine._uploadDataToTextureDirectly(texture, byteArray, face, i);} else dataLength = Math.max(4, width) / 4 * Math.max(4, height) / 4 * blockBytes, byteArray = new Uint8Array(data.buffer, data.byteOffset + dataOffset, dataLength), texture.type = 0, engine._uploadCompressedDataToTextureDirectly(texture, internalCompressedFormat, width, height, byteArray, face, i);}dataOffset += bpp ? width * height * (bpp / 8) : dataLength, width *= .5, height *= .5, width = Math.max(1, width), height = Math.max(1, height);}if (currentFace !== void 0) break;}info.sphericalPolynomial = sphericalPolynomialFaces && 0 < sphericalPolynomialFaces.length ? cubemapToSphericalPolynomial/* CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial */.$.ConvertCubeMapToSphericalPolynomial({ size: header[off_width], right: sphericalPolynomialFaces[0], left: sphericalPolynomialFaces[1], up: sphericalPolynomialFaces[2], down: sphericalPolynomialFaces[3], front: sphericalPolynomialFaces[4], back: sphericalPolynomialFaces[5], format: 5, type: 1, gammaSpace: !1 }) : void 0;}}DDSTools.StoreLODInAlphaChannel = !1, thinEngine/* ThinEngine.prototype.createPrefilteredCubeTexture */.B.prototype.createPrefilteredCubeTexture = function (rootUrl, scene, lodScale, lodOffset, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = !0) {const callback = (loadData) => {if (!loadData) return void (onLoad && onLoad(null));const texture = loadData.texture;if (createPolynomials ? loadData.info.sphericalPolynomial && (texture._sphericalPolynomial = loadData.info.sphericalPolynomial) : texture._sphericalPolynomial = new sphericalPolynomial/* SphericalPolynomial */.i(), texture._source = Textures_internalTexture/* InternalTextureSource.CubePrefiltered */.S.CubePrefiltered, this.getCaps().textureLOD) return void (onLoad && onLoad(texture));const gl = this._gl,width = loadData.width;if (width) {const textures = [];for (let i = 0; i < 3; i++) {const smoothness = i / 2,minLODIndex = lodOffset,maxLODIndex = math_scalar/* Scalar.Log2 */.R.Log2(width) * lodScale + lodOffset,mipmapIndex = Math.round(Math.min(Math.max(minLODIndex + (maxLODIndex - minLODIndex) * (1 - smoothness), 0), maxLODIndex)),glTextureFromLod = new Textures_internalTexture/* InternalTexture */.l(this, Textures_internalTexture/* InternalTextureSource.Temp */.S.Temp);if (glTextureFromLod.type = texture.type, glTextureFromLod.format = texture.format, glTextureFromLod.width = Math.pow(2, Math.max(math_scalar/* Scalar.Log2 */.R.Log2(width) - mipmapIndex, 0)), glTextureFromLod.height = glTextureFromLod.width, glTextureFromLod.isCube = !0, glTextureFromLod._cachedWrapU = 0, glTextureFromLod._cachedWrapV = 0, this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, glTextureFromLod, !0), glTextureFromLod.samplingMode = 2, gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE), gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE), loadData.isDDS) {const info = loadData.info,data = loadData.data;this._unpackFlipY(info.isCompressed), DDSTools.UploadDDSLevels(this, glTextureFromLod, data, info, !0, 6, mipmapIndex);} else logger/* Logger.Warn */.Y.Warn("DDS is the only prefiltered cube map supported so far.");this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);const lodTexture = new baseTexture/* BaseTexture */.V(scene);lodTexture._isCube = !0, lodTexture._texture = glTextureFromLod, glTextureFromLod.isReady = !0, textures.push(lodTexture);}texture._lodTextureHigh = textures[2], texture._lodTextureMid = textures[1], texture._lodTextureLow = textures[0], onLoad && onLoad(texture);}};return this.createCubeTexture(rootUrl, scene, null, !1, callback, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/ddsTextureLoader.js
class _DDSTextureLoader {constructor() {this.supportCascades = !0;}canLoad(extension) {return extension.endsWith(".dds");}loadCubeData(imgs, texture, createPolynomials, onLoad) {const engine = texture.getEngine();let info,loadMipmap = !1,maxLevel = 1e3;if (Array.isArray(imgs)) for (let index = 0; index < imgs.length; index++) {const data = imgs[index];info = DDSTools.GetDDSInfo(data), texture.width = info.width, texture.height = info.height, loadMipmap = (info.isRGB || info.isLuminance || 1 < info.mipmapCount) && texture.generateMipMaps, engine._unpackFlipY(info.isCompressed), DDSTools.UploadDDSLevels(engine, texture, data, info, loadMipmap, 6, -1, index), info.isFourCC || 1 !== info.mipmapCount ? maxLevel = info.mipmapCount - 1 : engine.generateMipMapsForCubemap(texture);} else {const data = imgs;info = DDSTools.GetDDSInfo(data), texture.width = info.width, texture.height = info.height, createPolynomials && (info.sphericalPolynomial = new sphericalPolynomial/* SphericalPolynomial */.i()), loadMipmap = (info.isRGB || info.isLuminance || 1 < info.mipmapCount) && texture.generateMipMaps, engine._unpackFlipY(info.isCompressed), DDSTools.UploadDDSLevels(engine, texture, data, info, loadMipmap, 6), info.isFourCC || 1 !== info.mipmapCount ? maxLevel = info.mipmapCount - 1 : engine.generateMipMapsForCubemap(texture, !1);}engine._setCubeMapTextureParams(texture, loadMipmap, maxLevel), texture.isReady = !0, texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear(), onLoad && onLoad({ isDDS: !0, width: texture.width, info, data: imgs, texture });}loadData(data, texture, callback) {const info = DDSTools.GetDDSInfo(data),loadMipmap = (info.isRGB || info.isLuminance || 1 < info.mipmapCount) && texture.generateMipMaps && 1 == info.width >> info.mipmapCount - 1;callback(info.width, info.height, loadMipmap, info.isFourCC, () => {DDSTools.UploadDDSLevels(texture.getEngine(), texture, data, info, loadMipmap, 1);});}}engine/* Engine._TextureLoaders.push */.D._TextureLoaders.push(new _DDSTextureLoader());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/envTextureLoader.js
class _ENVTextureLoader {constructor() {this.supportCascades = !1;}canLoad(extension) {return extension.endsWith(".env");}loadCubeData(data, texture, createPolynomials, onLoad, onError) {if (!Array.isArray(data)) {const info = (0,environmentTextureTools/* GetEnvInfo */.qJ)(data);if (info) {texture.width = info.width, texture.height = info.width;try {(0,environmentTextureTools/* UploadEnvSpherical */.qC)(texture, info), (0,environmentTextureTools/* UploadEnvLevelsAsync */.Ro)(texture, data, info).then(() => {texture.isReady = !0, texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear(), onLoad && onLoad();}, (reason) => {null === onError || void 0 === onError ? void 0 : onError("Can not upload environment levels", reason);});} catch (e) {null === onError || void 0 === onError ? void 0 : onError("Can not upload environment file", e);}} else onError && onError("Can not parse the environment file", null);}}loadData() {throw ".env not supported in 2d.";}}engine/* Engine._TextureLoaders.push */.D._TextureLoaders.push(new _ENVTextureLoader());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/khronosTextureContainer.js
class KhronosTextureContainer {constructor(data, facesExpected) {if (this.data = data, this.isInvalid = !1, !KhronosTextureContainer.IsValid(data)) return this.isInvalid = !0, void logger/* Logger.Error */.Y.Error("texture missing KTX identifier");const dataSize = Uint32Array.BYTES_PER_ELEMENT,headerDataView = new DataView(this.data.buffer, this.data.byteOffset + 12, 13 * dataSize),endianness = headerDataView.getUint32(0, !0),littleEndian = 67305985 === endianness;return (this.glType = headerDataView.getUint32(1 * dataSize, littleEndian), this.glTypeSize = headerDataView.getUint32(2 * dataSize, littleEndian), this.glFormat = headerDataView.getUint32(3 * dataSize, littleEndian), this.glInternalFormat = headerDataView.getUint32(4 * dataSize, littleEndian), this.glBaseInternalFormat = headerDataView.getUint32(5 * dataSize, littleEndian), this.pixelWidth = headerDataView.getUint32(6 * dataSize, littleEndian), this.pixelHeight = headerDataView.getUint32(7 * dataSize, littleEndian), this.pixelDepth = headerDataView.getUint32(8 * dataSize, littleEndian), this.numberOfArrayElements = headerDataView.getUint32(9 * dataSize, littleEndian), this.numberOfFaces = headerDataView.getUint32(10 * dataSize, littleEndian), this.numberOfMipmapLevels = headerDataView.getUint32(11 * dataSize, littleEndian), this.bytesOfKeyValueData = headerDataView.getUint32(12 * dataSize, littleEndian), 0 !== this.glType) ? void logger/* Logger.Error */.Y.Error("only compressed formats currently supported") : (this.numberOfMipmapLevels = Math.max(1, this.numberOfMipmapLevels), 0 === this.pixelHeight || 0 !== this.pixelDepth ? void logger/* Logger.Error */.Y.Error("only 2D textures currently supported") : 0 === this.numberOfArrayElements ? this.numberOfFaces === facesExpected ? void (this.loadType = KhronosTextureContainer.COMPRESSED_2D) : void logger/* Logger.Error */.Y.Error("number of faces expected" + facesExpected + ", but found " + this.numberOfFaces) : void logger/* Logger.Error */.Y.Error("texture arrays not currently supported"));}uploadLevels(texture, loadMipmaps) {switch (this.loadType) {case KhronosTextureContainer.COMPRESSED_2D:this._upload2DCompressedLevels(texture, loadMipmaps);break;case KhronosTextureContainer.TEX_2D:case KhronosTextureContainer.COMPRESSED_3D:case KhronosTextureContainer.TEX_3D:}}_upload2DCompressedLevels(texture, loadMipmaps) {let dataOffset = KhronosTextureContainer.HEADER_LEN + this.bytesOfKeyValueData,width = this.pixelWidth,height = this.pixelHeight;const mipmapCount = loadMipmaps ? this.numberOfMipmapLevels : 1;for (let level = 0; level < mipmapCount; level++) {const imageSize = new Int32Array(this.data.buffer, this.data.byteOffset + dataOffset, 1)[0];dataOffset += 4;for (let face = 0; face < this.numberOfFaces; face++) {const byteArray = new Uint8Array(this.data.buffer, this.data.byteOffset + dataOffset, imageSize),engine = texture.getEngine();engine._uploadCompressedDataToTextureDirectly(texture, texture.format, width, height, byteArray, face, level), dataOffset += imageSize, dataOffset += 3 - (imageSize + 3) % 4;}width = Math.max(1, .5 * width), height = Math.max(1, .5 * height);}}static IsValid(data) {if (12 <= data.byteLength) {const identifier = new Uint8Array(data.buffer, data.byteOffset, 12);if (171 === identifier[0] && 75 === identifier[1] && 84 === identifier[2] && 88 === identifier[3] && 32 === identifier[4] && 49 === identifier[5] && 49 === identifier[6] && 187 === identifier[7] && 13 === identifier[8] && 10 === identifier[9] && 26 === identifier[10] && 10 === identifier[11]) return !0;}return !1;}}KhronosTextureContainer.HEADER_LEN = 64, KhronosTextureContainer.COMPRESSED_2D = 0, KhronosTextureContainer.COMPRESSED_3D = 1, KhronosTextureContainer.TEX_2D = 2, KhronosTextureContainer.TEX_3D = 3;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/workerPool.js
var workerPool = __webpack_require__("./node_modules/@babylonjs/core/Misc/workerPool.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/ktx2decoderTypes.js
var SourceTextureFormat;(function (SourceTextureFormat) {SourceTextureFormat[SourceTextureFormat.ETC1S = 0] = "ETC1S", SourceTextureFormat[SourceTextureFormat.UASTC4x4 = 1] = "UASTC4x4";})(SourceTextureFormat || (SourceTextureFormat = {}));var TranscodeTarget;(function (TranscodeTarget) {TranscodeTarget[TranscodeTarget.ASTC_4X4_RGBA = 0] = "ASTC_4X4_RGBA", TranscodeTarget[TranscodeTarget.BC7_RGBA = 1] = "BC7_RGBA", TranscodeTarget[TranscodeTarget.BC3_RGBA = 2] = "BC3_RGBA", TranscodeTarget[TranscodeTarget.BC1_RGB = 3] = "BC1_RGB", TranscodeTarget[TranscodeTarget.PVRTC1_4_RGBA = 4] = "PVRTC1_4_RGBA", TranscodeTarget[TranscodeTarget.PVRTC1_4_RGB = 5] = "PVRTC1_4_RGB", TranscodeTarget[TranscodeTarget.ETC2_RGBA = 6] = "ETC2_RGBA", TranscodeTarget[TranscodeTarget.ETC1_RGB = 7] = "ETC1_RGB", TranscodeTarget[TranscodeTarget.RGBA32 = 8] = "RGBA32", TranscodeTarget[TranscodeTarget.R8 = 9] = "R8", TranscodeTarget[TranscodeTarget.RG8 = 10] = "RG8";})(TranscodeTarget || (TranscodeTarget = {}));var EngineFormat;(function (EngineFormat) {EngineFormat[EngineFormat.COMPRESSED_RGBA_BPTC_UNORM_EXT = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT", EngineFormat[EngineFormat.COMPRESSED_RGBA_ASTC_4X4_KHR = 37808] = "COMPRESSED_RGBA_ASTC_4X4_KHR", EngineFormat[EngineFormat.COMPRESSED_RGB_S3TC_DXT1_EXT = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT", EngineFormat[EngineFormat.COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT", EngineFormat[EngineFormat.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG", EngineFormat[EngineFormat.COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG", EngineFormat[EngineFormat.COMPRESSED_RGBA8_ETC2_EAC = 37496] = "COMPRESSED_RGBA8_ETC2_EAC", EngineFormat[EngineFormat.COMPRESSED_RGB8_ETC2 = 37492] = "COMPRESSED_RGB8_ETC2", EngineFormat[EngineFormat.COMPRESSED_RGB_ETC1_WEBGL = 36196] = "COMPRESSED_RGB_ETC1_WEBGL", EngineFormat[EngineFormat.RGBA8Format = 32856] = "RGBA8Format", EngineFormat[EngineFormat.R8Format = 33321] = "R8Format", EngineFormat[EngineFormat.RG8Format = 33323] = "RG8Format";})(EngineFormat || (EngineFormat = {}));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/khronosTextureContainer2.js
function getAbsoluteUrlOrNull(url) {return url ? tools/* Tools.GetAbsoluteUrl */.w1.GetAbsoluteUrl(url) : null;}function applyConfig(urls) {null !== urls.wasmUASTCToASTC && (KTX2DECODER.LiteTranscoder_UASTC_ASTC.WasmModuleURL = urls.wasmUASTCToASTC), null !== urls.wasmUASTCToBC7 && (KTX2DECODER.LiteTranscoder_UASTC_BC7.WasmModuleURL = urls.wasmUASTCToBC7), null !== urls.wasmUASTCToRGBA_UNORM && (KTX2DECODER.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL = urls.wasmUASTCToRGBA_UNORM), null !== urls.wasmUASTCToRGBA_SRGB && (KTX2DECODER.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL = urls.wasmUASTCToRGBA_SRGB), null !== urls.wasmUASTCToR8_UNORM && (KTX2DECODER.LiteTranscoder_UASTC_R8_UNORM.WasmModuleURL = urls.wasmUASTCToR8_UNORM), null !== urls.wasmUASTCToRG8_UNORM && (KTX2DECODER.LiteTranscoder_UASTC_RG8_UNORM.WasmModuleURL = urls.wasmUASTCToRG8_UNORM), null !== urls.jsMSCTranscoder && (KTX2DECODER.MSCTranscoder.JSModuleURL = urls.jsMSCTranscoder), null !== urls.wasmMSCTranscoder && (KTX2DECODER.MSCTranscoder.WasmModuleURL = urls.wasmMSCTranscoder), null !== urls.wasmZSTDDecoder && (KTX2DECODER.ZSTDDecoder.WasmModuleURL = urls.wasmZSTDDecoder);}class DefaultKTX2DecoderOptions {constructor() {this._isDirty = !0, this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC = !0, this._ktx2DecoderOptions = {};}get isDirty() {return this._isDirty;}get useRGBAIfASTCBC7NotAvailableWhenUASTC() {return this._useRGBAIfASTCBC7NotAvailableWhenUASTC;}set useRGBAIfASTCBC7NotAvailableWhenUASTC(value) {this._useRGBAIfASTCBC7NotAvailableWhenUASTC === value || (this._useRGBAIfASTCBC7NotAvailableWhenUASTC = value, this._isDirty = !0);}get useRGBAIfOnlyBC1BC3AvailableWhenUASTC() {return this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC;}set useRGBAIfOnlyBC1BC3AvailableWhenUASTC(value) {this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC === value || (this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC = value, this._isDirty = !0);}get forceRGBA() {return this._forceRGBA;}set forceRGBA(value) {this._forceRGBA === value || (this._forceRGBA = value, this._isDirty = !0);}get forceR8() {return this._forceR8;}set forceR8(value) {this._forceR8 === value || (this._forceR8 = value, this._isDirty = !0);}get forceRG8() {return this._forceRG8;}set forceRG8(value) {this._forceRG8 === value || (this._forceRG8 = value, this._isDirty = !0);}get bypassTranscoders() {return this._bypassTranscoders;}set bypassTranscoders(value) {this._bypassTranscoders === value || (this._bypassTranscoders = value, this._isDirty = !0);}_getKTX2DecoderOptions() {if (!this._isDirty) return this._ktx2DecoderOptions;this._isDirty = !1;const options = { useRGBAIfASTCBC7NotAvailableWhenUASTC: this._useRGBAIfASTCBC7NotAvailableWhenUASTC, forceRGBA: this._forceRGBA, forceR8: this._forceR8, forceRG8: this._forceRG8, bypassTranscoders: this._bypassTranscoders };return this.useRGBAIfOnlyBC1BC3AvailableWhenUASTC && (options.transcodeFormatDecisionTree = { UASTC: { transcodeFormat: [TranscodeTarget.BC1_RGB, TranscodeTarget.BC3_RGBA], yes: { transcodeFormat: TranscodeTarget.RGBA32, engineFormat: EngineFormat.RGBA8Format, roundToMultiple4: !1 } } }), this._ktx2DecoderOptions = options, options;}}class KhronosTextureContainer2 {static GetDefaultNumWorkers() {return "object" == typeof navigator && navigator.hardwareConcurrency ? Math.min(Math.floor(.5 * navigator.hardwareConcurrency), 4) : 1;}static _Initialize(numWorkers) {if (KhronosTextureContainer2._WorkerPoolPromise || KhronosTextureContainer2._DecoderModulePromise) return;const urls = { jsDecoderModule: tools/* Tools.GetAbsoluteUrl */.w1.GetAbsoluteUrl(this.URLConfig.jsDecoderModule), wasmUASTCToASTC: getAbsoluteUrlOrNull(this.URLConfig.wasmUASTCToASTC), wasmUASTCToBC7: getAbsoluteUrlOrNull(this.URLConfig.wasmUASTCToBC7), wasmUASTCToRGBA_UNORM: getAbsoluteUrlOrNull(this.URLConfig.wasmUASTCToRGBA_UNORM), wasmUASTCToRGBA_SRGB: getAbsoluteUrlOrNull(this.URLConfig.wasmUASTCToRGBA_SRGB), wasmUASTCToR8_UNORM: getAbsoluteUrlOrNull(this.URLConfig.wasmUASTCToR8_UNORM), wasmUASTCToRG8_UNORM: getAbsoluteUrlOrNull(this.URLConfig.wasmUASTCToRG8_UNORM), jsMSCTranscoder: getAbsoluteUrlOrNull(this.URLConfig.jsMSCTranscoder), wasmMSCTranscoder: getAbsoluteUrlOrNull(this.URLConfig.wasmMSCTranscoder), wasmZSTDDecoder: getAbsoluteUrlOrNull(this.URLConfig.wasmZSTDDecoder) };numWorkers && "function" == typeof Worker && "undefined" != typeof URL ? KhronosTextureContainer2._WorkerPoolPromise = new Promise((resolve) => {const workerBlobUrl = URL.createObjectURL(new Blob([`${applyConfig}(${workerFunc})()`], { type: "application/javascript" }));resolve(new workerPool/* AutoReleaseWorkerPool */.v(numWorkers, () => new Promise((resolve, reject) => {const worker = new Worker(workerBlobUrl),onError = (error) => {worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), reject(error);},onMessage = (message) => {"init" === message.data.action && (worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), resolve(worker));};worker.addEventListener("error", onError), worker.addEventListener("message", onMessage), worker.postMessage({ action: "init", urls: urls });})));}) : "undefined" == typeof KTX2DECODER ? KhronosTextureContainer2._DecoderModulePromise = tools/* Tools.LoadScriptAsync */.w1.LoadScriptAsync(urls.jsDecoderModule).then(() => (KTX2DECODER.MSCTranscoder.UseFromWorkerThread = !1, KTX2DECODER.WASMMemoryManager.LoadBinariesFromCurrentThread = !0, applyConfig(urls), new KTX2DECODER.KTX2Decoder())) : (KTX2DECODER.MSCTranscoder.UseFromWorkerThread = !1, KTX2DECODER.WASMMemoryManager.LoadBinariesFromCurrentThread = !0, KhronosTextureContainer2._DecoderModulePromise = Promise.resolve(new KTX2DECODER.KTX2Decoder()));}constructor(engine, numWorkers = KhronosTextureContainer2.DefaultNumWorkers) {this._engine = engine, KhronosTextureContainer2._Initialize(numWorkers);}uploadAsync(data, internalTexture, options) {const caps = this._engine.getCaps(),compressedTexturesCaps = { astc: !!caps.astc, bptc: !!caps.bptc, s3tc: !!caps.s3tc, pvrtc: !!caps.pvrtc, etc2: !!caps.etc2, etc1: !!caps.etc1 };if (KhronosTextureContainer2._WorkerPoolPromise) return KhronosTextureContainer2._WorkerPoolPromise.then((workerPool) => new Promise((resolve, reject) => {workerPool.push((worker, onComplete) => {const onError = (error) => {worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), reject(error), onComplete();},onMessage = (message) => {if ("decoded" === message.data.action) {if (worker.removeEventListener("error", onError), worker.removeEventListener("message", onMessage), !message.data.success) reject({ message: message.data.msg });else try {this._createTexture(message.data.decodedData, internalTexture, options), resolve();} catch (err) {reject({ message: err });}onComplete();}};worker.addEventListener("error", onError), worker.addEventListener("message", onMessage), KhronosTextureContainer2.DefaultDecoderOptions.isDirty && worker.postMessage({ action: "setDefaultDecoderOptions", options: KhronosTextureContainer2.DefaultDecoderOptions._getKTX2DecoderOptions() });const dataCopy = new Uint8Array(data.byteLength);dataCopy.set(new Uint8Array(data.buffer, data.byteOffset, data.byteLength)), worker.postMessage({ action: "decode", data: dataCopy, caps: compressedTexturesCaps, options }, [dataCopy.buffer]);});}));if (KhronosTextureContainer2._DecoderModulePromise) return KhronosTextureContainer2._DecoderModulePromise.then((decoder) => new Promise((resolve, reject) => {decoder.decode(data, caps).then((data) => {this._createTexture(data, internalTexture), resolve();}).catch((reason) => {reject({ message: reason });});}));throw new Error("KTX2 decoder module is not available");}_createTexture(data, internalTexture, options) {this._engine._bindTextureDirectly(3553, internalTexture), options && (options.transcodedFormat = data.transcodedFormat, options.isInGammaSpace = data.isInGammaSpace, options.hasAlpha = data.hasAlpha, options.transcoderName = data.transcoderName);let isUncompressedFormat = !0;switch (data.transcodedFormat) {case 32856:internalTexture.type = 0, internalTexture.format = 5;break;case 33321:internalTexture.type = 0, internalTexture.format = 6;break;case 33323:internalTexture.type = 0, internalTexture.format = 7;break;default:internalTexture.format = data.transcodedFormat, isUncompressedFormat = !1;}if (internalTexture._gammaSpace = data.isInGammaSpace, internalTexture.generateMipMaps = 1 < data.mipmaps.length, data.errors) throw new Error("KTX2 container - could not transcode the data. " + data.errors);for (let t = 0; t < data.mipmaps.length; ++t) {const mipmap = data.mipmaps[t];if (!mipmap || !mipmap.data) throw new Error("KTX2 container - could not transcode one of the image");isUncompressedFormat ? (internalTexture.width = mipmap.width, internalTexture.height = mipmap.height, this._engine._uploadDataToTextureDirectly(internalTexture, mipmap.data, 0, t, void 0, !0)) : this._engine._uploadCompressedDataToTextureDirectly(internalTexture, data.transcodedFormat, mipmap.width, mipmap.height, mipmap.data, 0, t);}internalTexture._extension = ".ktx2", internalTexture.width = data.mipmaps[0].width, internalTexture.height = data.mipmaps[0].height, internalTexture.isReady = !0, this._engine._bindTextureDirectly(3553, null);}static IsValid(data) {if (12 <= data.byteLength) {const identifier = new Uint8Array(data.buffer, data.byteOffset, 12);if (171 === identifier[0] && 75 === identifier[1] && 84 === identifier[2] && 88 === identifier[3] && 32 === identifier[4] && 50 === identifier[5] && 48 === identifier[6] && 187 === identifier[7] && 13 === identifier[8] && 10 === identifier[9] && 26 === identifier[10] && 10 === identifier[11]) return !0;}return !1;}}KhronosTextureContainer2.URLConfig = { jsDecoderModule: "https://preview.babylonjs.com/babylon.ktx2Decoder.js", wasmUASTCToASTC: null, wasmUASTCToBC7: null, wasmUASTCToRGBA_UNORM: null, wasmUASTCToRGBA_SRGB: null, wasmUASTCToR8_UNORM: null, wasmUASTCToRG8_UNORM: null, jsMSCTranscoder: null, wasmMSCTranscoder: null, wasmZSTDDecoder: null }, KhronosTextureContainer2.DefaultNumWorkers = KhronosTextureContainer2.GetDefaultNumWorkers(), KhronosTextureContainer2.DefaultDecoderOptions = new DefaultKTX2DecoderOptions();function workerFunc() {let ktx2Decoder;onmessage = (event) => {if (event.data) switch (event.data.action) {case "init":{const urls = event.data.urls;importScripts(urls.jsDecoderModule), applyConfig(urls), ktx2Decoder = new KTX2DECODER.KTX2Decoder(), postMessage({ action: "init" });break;}case "setDefaultDecoderOptions":{KTX2DECODER.KTX2Decoder.DefaultDecoderOptions = event.data.options;break;}case "decode":ktx2Decoder.decode(event.data.data, event.data.caps, event.data.options).then((data) => {const buffers = [];for (let mip = 0; mip < data.mipmaps.length; ++mip) {const mipmap = data.mipmaps[mip];mipmap && mipmap.data && buffers.push(mipmap.data.buffer);}postMessage({ action: "decoded", success: !0, decodedData: data }, buffers);}).catch((reason) => {postMessage({ action: "decoded", success: !1, msg: reason });});}};}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/ktxTextureLoader.js
function mapSRGBToLinear(format) {return 35916 === format ? 33776 : 35918 === format ? 33778 : 35919 === format ? 33779 : 37493 === format ? 37492 : 37497 === format ? 37496 : 37495 === format ? 37494 : 37840 === format ? 37808 : 36493 === format ? 36492 : null;}class _KTXTextureLoader {constructor() {this.supportCascades = !1;}canLoad(extension, mimeType) {return extension.endsWith(".ktx") || extension.endsWith(".ktx2") || "image/ktx" === mimeType || "image/ktx2" === mimeType;}loadCubeData(data, texture, createPolynomials, onLoad) {if (Array.isArray(data)) return;texture._invertVScale = !texture.invertY;const engine = texture.getEngine(),ktx = new KhronosTextureContainer(data, 6),loadMipmap = 1 < ktx.numberOfMipmapLevels && texture.generateMipMaps;engine._unpackFlipY(!0), ktx.uploadLevels(texture, texture.generateMipMaps), texture.width = ktx.pixelWidth, texture.height = ktx.pixelHeight, engine._setCubeMapTextureParams(texture, loadMipmap, ktx.numberOfMipmapLevels - 1), texture.isReady = !0, texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear(), onLoad && onLoad();}loadData(data, texture, callback, options) {if (KhronosTextureContainer.IsValid(data)) {texture._invertVScale = !texture.invertY;const ktx = new KhronosTextureContainer(data, 1),mappedFormat = mapSRGBToLinear(ktx.glInternalFormat);mappedFormat ? (texture.format = mappedFormat, texture._useSRGBBuffer = texture.getEngine()._getUseSRGBBuffer(!0, texture.generateMipMaps), texture._gammaSpace = !0) : texture.format = ktx.glInternalFormat, callback(ktx.pixelWidth, ktx.pixelHeight, texture.generateMipMaps, !0, () => {ktx.uploadLevels(texture, texture.generateMipMaps);}, ktx.isInvalid);} else if (KhronosTextureContainer2.IsValid(data)) {const ktx2 = new KhronosTextureContainer2(texture.getEngine());ktx2.uploadAsync(data, texture, options).then(() => {callback(texture.width, texture.height, texture.generateMipMaps, !0, () => {}, !1);}, (error) => {logger/* Logger.Warn */.Y.Warn(`Failed to load KTX2 texture data: ${error.message}`), callback(0, 0, !1, !1, () => {}, !0);});} else logger/* Logger.Error */.Y.Error("texture missing KTX identifier"), callback(0, 0, !1, !1, () => {}, !0);}}engine/* Engine._TextureLoaders.unshift */.D._TextureLoaders.unshift(new _KTXTextureLoader());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRCamera.js
class WebXRCamera extends Cameras_freeCamera/* FreeCamera */.c {constructor(name, scene, _xrSessionManager) {super(name, math_vector/* Vector3.Zero */.P.Zero(), scene), this._xrSessionManager = _xrSessionManager, this._firstFrame = !1, this._referenceQuaternion = math_vector/* Quaternion.Identity */._f.Identity(), this._referencedPosition = new math_vector/* Vector3 */.P(), this._trackingState = WebXRTrackingState.NOT_TRACKING, this.onBeforeCameraTeleport = new observable/* Observable */.y$(), this.onAfterCameraTeleport = new observable/* Observable */.y$(), this.onTrackingStateChanged = new observable/* Observable */.y$(), this.compensateOnFirstFrame = !0, this.minZ = .1, this.rotationQuaternion = new math_vector/* Quaternion */._f(), this.cameraRigMode = Cameras_camera/* Camera.RIG_MODE_CUSTOM */.V.RIG_MODE_CUSTOM, this.updateUpVectorFromRotation = !0, this._updateNumberOfRigCameras(1), this.freezeProjectionMatrix(), this._xrSessionManager.onXRSessionInit.add(() => {this._referencedPosition.copyFromFloats(0, 0, 0), this._referenceQuaternion.copyFromFloats(0, 0, 0, 1), this._firstFrame = this.compensateOnFirstFrame;}), this._xrSessionManager.onXRFrameObservable.add(() => {this._firstFrame && this._updateFromXRSession(), this._updateReferenceSpace(), this._updateFromXRSession();}, void 0, !0);}get trackingState() {return this._trackingState;}_setTrackingState(newState) {this._trackingState !== newState && (this._trackingState = newState, this.onTrackingStateChanged.notifyObservers(newState));}get realWorldHeight() {const basePose = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.baseReferenceSpace);return basePose && basePose.transform ? basePose.transform.position.y : 0;}_updateForDualEyeDebugging() {this._updateNumberOfRigCameras(2), this.rigCameras[0].viewport = new math_viewport/* Viewport */.l(0, 0, .5, 1), this.rigCameras[0].outputRenderTarget = null, this.rigCameras[1].viewport = new math_viewport/* Viewport */.l(.5, 0, .5, 1), this.rigCameras[1].outputRenderTarget = null;}setTransformationFromNonVRCamera(otherCamera = this.getScene().activeCamera, resetToBaseReferenceSpace = !0) {if (otherCamera && otherCamera !== this) {const mat = otherCamera.computeWorldMatrix();mat.decompose(void 0, this.rotationQuaternion, this.position), this.position.y = 0, math_vector/* Quaternion.FromEulerAnglesToRef */._f.FromEulerAnglesToRef(0, this.rotationQuaternion.toEulerAngles().y, 0, this.rotationQuaternion), this._firstFrame = !0, resetToBaseReferenceSpace && this._xrSessionManager.resetReferenceSpace();}}getClassName() {return "WebXRCamera";}dispose() {super.dispose(), this._lastXRViewerPose = void 0;}_updateFromXRSession() {const pose = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.referenceSpace);if (this._lastXRViewerPose = pose || void 0, !pose) return void this._setTrackingState(WebXRTrackingState.NOT_TRACKING);const trackingState = pose.emulatedPosition ? WebXRTrackingState.TRACKING_LOST : WebXRTrackingState.TRACKING;if (this._setTrackingState(trackingState), this.minZ !== this._cache.minZ || this.maxZ !== this._cache.maxZ) {const xrRenderState = { depthFar: this.maxZ || 1e4, depthNear: this.minZ };this._xrSessionManager.updateRenderState(xrRenderState), this._cache.minZ = this.minZ, this._cache.maxZ = this.maxZ;}if (pose.transform) {const orientation = pose.transform.orientation;if (void 0 === pose.transform.orientation.x) return;const pos = pose.transform.position;this._referencedPosition.set(pos.x, pos.y, pos.z), this._referenceQuaternion.set(orientation.x, orientation.y, orientation.z, orientation.w), this._scene.useRightHandedSystem || (this._referencedPosition.z *= -1, this._referenceQuaternion.z *= -1, this._referenceQuaternion.w *= -1), this._firstFrame ? (this._firstFrame = !1, this.position.y += this._referencedPosition.y, this._referenceQuaternion.copyFromFloats(0, 0, 0, 1)) : (this.rotationQuaternion.copyFrom(this._referenceQuaternion), this.position.copyFrom(this._referencedPosition));}this.rigCameras.length !== pose.views.length && this._updateNumberOfRigCameras(pose.views.length), pose.views.forEach((view, i) => {var _a;const currentRig = this.rigCameras[i];currentRig.isLeftCamera || currentRig.isRightCamera || ("right" === view.eye ? currentRig._isRightCamera = !0 : "left" === view.eye && (currentRig._isLeftCamera = !0));const pos = view.transform.position,orientation = view.transform.orientation;currentRig.parent = this.parent, currentRig.position.set(pos.x, pos.y, pos.z), currentRig.rotationQuaternion.set(orientation.x, orientation.y, orientation.z, orientation.w), this._scene.useRightHandedSystem || (currentRig.position.z *= -1, currentRig.rotationQuaternion.z *= -1, currentRig.rotationQuaternion.w *= -1), math_vector/* Matrix.FromFloat32ArrayToRefScaled */.y3.FromFloat32ArrayToRefScaled(view.projectionMatrix, 0, 1, currentRig._projectionMatrix), this._scene.useRightHandedSystem || currentRig._projectionMatrix.toggleProjectionMatrixHandInPlace(), 0 === i && this._projectionMatrix.copyFrom(currentRig._projectionMatrix);const renderTargetTexture = this._xrSessionManager.getRenderTargetTextureForView(view);this._renderingMultiview = (null === (_a = null === renderTargetTexture || void 0 === renderTargetTexture ? void 0 : renderTargetTexture._texture) || void 0 === _a ? void 0 : _a.isMultiview) || !1, this._renderingMultiview ? 0 == i && (this._xrSessionManager.trySetViewportForView(this.viewport, view), this.outputRenderTarget = renderTargetTexture) : (this._xrSessionManager.trySetViewportForView(currentRig.viewport, view), currentRig.outputRenderTarget = renderTargetTexture || this._xrSessionManager.getRenderTargetTextureForView(view)), currentRig.layerMask = this.layerMask;});}_updateNumberOfRigCameras(viewCount = 1) {for (; this.rigCameras.length < viewCount;) {const newCamera = new targetCamera/* TargetCamera */.C("XR-RigCamera: " + this.rigCameras.length, math_vector/* Vector3.Zero */.P.Zero(), this.getScene());newCamera.minZ = .1, newCamera.rotationQuaternion = new math_vector/* Quaternion */._f(), newCamera.updateUpVectorFromRotation = !0, newCamera.isRigCamera = !0, newCamera.rigParent = this, newCamera.freezeProjectionMatrix(), this.rigCameras.push(newCamera);}for (; this.rigCameras.length > viewCount;) {const removedCamera = this.rigCameras.pop();removedCamera && removedCamera.dispose();}}_updateReferenceSpace() {if (!this.position.equals(this._referencedPosition) || !this.rotationQuaternion.equals(this._referenceQuaternion)) {const referencedMat = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],poseMat = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1],transformMat = math_vector/* TmpVectors.Matrix.2 */.jp.Matrix[2];math_vector/* Matrix.ComposeToRef */.y3.ComposeToRef(WebXRCamera._ScaleReadOnly, this._referenceQuaternion, this._referencedPosition, referencedMat), math_vector/* Matrix.ComposeToRef */.y3.ComposeToRef(WebXRCamera._ScaleReadOnly, this.rotationQuaternion, this.position, poseMat), referencedMat.invert().multiplyToRef(poseMat, transformMat), transformMat.invert(), this._scene.useRightHandedSystem || transformMat.toggleModelMatrixHandInPlace(), transformMat.decompose(void 0, this._referenceQuaternion, this._referencedPosition);const transform = new XRRigidTransform({ x: this._referencedPosition.x, y: this._referencedPosition.y, z: this._referencedPosition.z }, { x: this._referenceQuaternion.x, y: this._referenceQuaternion.y, z: this._referenceQuaternion.z, w: this._referenceQuaternion.w });this._xrSessionManager.referenceSpace = this._xrSessionManager.referenceSpace.getOffsetReferenceSpace(transform);}}}WebXRCamera._ScaleReadOnly = math_vector/* Vector3.One */.P.One();
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRExperienceHelper.js
class WebXRExperienceHelper {constructor(_scene) {this._scene = _scene, this._nonVRCamera = null, this._attachedToElement = !1, this._spectatorCamera = null, this._originalSceneAutoClear = !0, this._supported = !1, this._spectatorMode = !1, this._lastTimestamp = 0, this.onInitialXRPoseSetObservable = new observable/* Observable */.y$(), this.onStateChangedObservable = new observable/* Observable */.y$(), this.state = WebXRState.NOT_IN_XR, this.sessionManager = new WebXRSessionManager(_scene), this.camera = new WebXRCamera("webxr", _scene, this.sessionManager), this.featuresManager = new WebXRFeaturesManager(this.sessionManager), _scene.onDisposeObservable.addOnce(() => {this.dispose();});}static CreateAsync(scene) {const helper = new WebXRExperienceHelper(scene);return helper.sessionManager.initializeAsync().then(() => (helper._supported = !0, helper)).catch((e) => {throw helper._setState(WebXRState.NOT_IN_XR), helper.dispose(), e;});}dispose() {var _a;this.exitXRAsync(), this.camera.dispose(), this.onStateChangedObservable.clear(), this.onInitialXRPoseSetObservable.clear(), this.sessionManager.dispose(), null === (_a = this._spectatorCamera) || void 0 === _a ? void 0 : _a.dispose(), this._nonVRCamera && (this._scene.activeCamera = this._nonVRCamera);}async enterXRAsync(sessionMode, referenceSpaceType, renderTarget = this.sessionManager.getWebXRRenderTarget(), sessionCreationOptions = {}) {var _a, _b, _c;if (!this._supported) throw "WebXR not supported in this browser or environment";this._setState(WebXRState.ENTERING_XR), "viewer" !== referenceSpaceType && "local" !== referenceSpaceType && (sessionCreationOptions.optionalFeatures = sessionCreationOptions.optionalFeatures || [], sessionCreationOptions.optionalFeatures.push(referenceSpaceType)), sessionCreationOptions = await this.featuresManager._extendXRSessionInitObject(sessionCreationOptions), "immersive-ar" === sessionMode && "unbounded" !== referenceSpaceType && logger/* Logger.Warn */.Y.Warn("We recommend using 'unbounded' reference space type when using 'immersive-ar' session mode");try {await this.sessionManager.initializeSessionAsync(sessionMode, sessionCreationOptions), await this.sessionManager.setReferenceSpaceTypeAsync(referenceSpaceType);const baseLayer = await renderTarget.initializeXRLayerAsync(this.sessionManager.session),xrRenderState = { depthFar: this.camera.maxZ || 1e4, depthNear: this.camera.minZ };return this.featuresManager.getEnabledFeature(WebXRFeatureName.LAYERS) || (xrRenderState.baseLayer = baseLayer), this.sessionManager.updateRenderState(xrRenderState), this.sessionManager.runXRRenderLoop(), this._originalSceneAutoClear = this._scene.autoClear, this._nonVRCamera = this._scene.activeCamera, this._attachedToElement = null !== (_b = null === (_a = this._nonVRCamera) || void 0 === _a ? void 0 : _a.inputs) && void 0 !== _b && _b.attachedToElement, null === (_c = this._nonVRCamera) || void 0 === _c ? void 0 : _c.detachControl(), this._scene.activeCamera = this.camera, "immersive-ar" === sessionMode ? (this._scene.autoClear = !1, this.camera.compensateOnFirstFrame = !1, this.camera.position.set(0, 0, 0), this.camera.rotationQuaternion.set(0, 0, 0, 1)) : this._nonXRToXRCamera(), this.sessionManager.onXRSessionEnded.addOnce(() => {this.state !== WebXRState.EXITING_XR && this._setState(WebXRState.EXITING_XR), this.camera.rigCameras.forEach((c) => {c.outputRenderTarget = null;}), this._scene.autoClear = this._originalSceneAutoClear, this._scene.activeCamera = this._nonVRCamera, this._attachedToElement && this._nonVRCamera && this._nonVRCamera.attachControl(!!this._nonVRCamera.inputs.noPreventDefault), "immersive-ar" !== sessionMode && this.camera.compensateOnFirstFrame && (this._nonVRCamera.setPosition ? this._nonVRCamera.setPosition(this.camera.position) : this._nonVRCamera.position.copyFrom(this.camera.position)), this._setState(WebXRState.NOT_IN_XR);}), this.sessionManager.onXRFrameObservable.addOnce(() => {this._setState(WebXRState.IN_XR);}), this.sessionManager;} catch (e) {throw console.log(e), console.log(e.message), this._setState(WebXRState.NOT_IN_XR), e;}}exitXRAsync() {return this.state === WebXRState.IN_XR ? (this._setState(WebXRState.EXITING_XR), this.sessionManager.exitXRAsync()) : Promise.resolve();}enableSpectatorMode(options) {this._spectatorMode || (this._spectatorMode = !0, this._switchSpectatorMode(options));}disableSpecatatorMode() {this._spectatorMode && (this._spectatorMode = !1, this._switchSpectatorMode());}_switchSpectatorMode(options) {const fps = (null === options || void 0 === options ? void 0 : options.fps) ? options.fps : 1e3,cameraIndex = (null === options || void 0 === options ? void 0 : options.preferredCameraIndex) ? null === options || void 0 === options ? void 0 : options.preferredCameraIndex : 0,updateSpectatorCamera = () => {if (this._spectatorCamera) {const delta = this.sessionManager.currentTimestamp - this._lastTimestamp;delta >= 1e3 * (1 / fps) && (this._lastTimestamp = this.sessionManager.currentTimestamp, this._spectatorCamera.position.copyFrom(this.camera.rigCameras[cameraIndex].globalPosition), this._spectatorCamera.rotationQuaternion.copyFrom(this.camera.rigCameras[cameraIndex].absoluteRotation));}};if (this._spectatorMode) {if (cameraIndex >= this.camera.rigCameras.length) throw new Error("the preferred camera index is beyond the length of rig camera array.");const onStateChanged = () => {this.state === WebXRState.IN_XR ? (this._spectatorCamera = new UniversalCamera("webxr-spectator", math_vector/* Vector3.Zero */.P.Zero(), this._scene), this._spectatorCamera.rotationQuaternion = new math_vector/* Quaternion */._f(), this._scene.activeCameras = [this.camera, this._spectatorCamera], this.sessionManager.onXRFrameObservable.add(updateSpectatorCamera), this._scene.onAfterRenderCameraObservable.add((camera) => {camera === this.camera && (this._scene.getEngine().framebufferDimensionsObject = null);})) : this.state === WebXRState.EXITING_XR && (this.sessionManager.onXRFrameObservable.removeCallback(updateSpectatorCamera), this._scene.activeCameras = null);};this.onStateChangedObservable.add(onStateChanged), onStateChanged();} else this.sessionManager.onXRFrameObservable.removeCallback(updateSpectatorCamera), this._scene.activeCameras = [this.camera];}_nonXRToXRCamera() {this.camera.setTransformationFromNonVRCamera(this._nonVRCamera), this.onInitialXRPoseSetObservable.notifyObservers(this.camera);}_setState(val) {this.state === val || (this.state = val, this.onStateChangedObservable.notifyObservers(this.state));}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/webXRControllerComponent.js
class WebXRControllerComponent {constructor(id, type, _buttonIndex = -1, _axesIndices = []) {this.id = id, this.type = type, this._buttonIndex = _buttonIndex, this._axesIndices = _axesIndices, this._axes = { x: 0, y: 0 }, this._changes = {}, this._currentValue = 0, this._hasChanges = !1, this._pressed = !1, this._touched = !1, this.onAxisValueChangedObservable = new observable/* Observable */.y$(), this.onButtonStateChangedObservable = new observable/* Observable */.y$();}get axes() {return this._axes;}get changes() {return this._changes;}get hasChanges() {return this._hasChanges;}get pressed() {return this._pressed;}get touched() {return this._touched;}get value() {return this._currentValue;}dispose() {this.onAxisValueChangedObservable.clear(), this.onButtonStateChangedObservable.clear();}isAxes() {return 0 !== this._axesIndices.length;}isButton() {return -1 !== this._buttonIndex;}update(nativeController) {let buttonUpdated = !1,axesUpdate = !1;if (this._hasChanges = !1, this._changes = {}, this.isButton()) {const button = nativeController.buttons[this._buttonIndex];if (!button) return;this._currentValue !== button.value && (this.changes.value = { current: button.value, previous: this._currentValue }, buttonUpdated = !0, this._currentValue = button.value), this._touched !== button.touched && (this.changes.touched = { current: button.touched, previous: this._touched }, buttonUpdated = !0, this._touched = button.touched), this._pressed !== button.pressed && (this.changes.pressed = { current: button.pressed, previous: this._pressed }, buttonUpdated = !0, this._pressed = button.pressed);}this.isAxes() && (this._axes.x !== nativeController.axes[this._axesIndices[0]] && (this.changes.axes = { current: { x: nativeController.axes[this._axesIndices[0]], y: this._axes.y }, previous: { x: this._axes.x, y: this._axes.y } }, this._axes.x = nativeController.axes[this._axesIndices[0]], axesUpdate = !0), this._axes.y !== nativeController.axes[this._axesIndices[1]] && (this.changes.axes ? this.changes.axes.current.y = nativeController.axes[this._axesIndices[1]] : this.changes.axes = { current: { x: this._axes.x, y: nativeController.axes[this._axesIndices[1]] }, previous: { x: this._axes.x, y: this._axes.y } }, this._axes.y = nativeController.axes[this._axesIndices[1]], axesUpdate = !0)), buttonUpdated && (this._hasChanges = !0, this.onButtonStateChangedObservable.notifyObservers(this)), axesUpdate && (this._hasChanges = !0, this.onAxisValueChangedObservable.notifyObservers(this._axes));}}WebXRControllerComponent.BUTTON_TYPE = "button", WebXRControllerComponent.SQUEEZE_TYPE = "squeeze", WebXRControllerComponent.THUMBSTICK_TYPE = "thumbstick", WebXRControllerComponent.TOUCHPAD_TYPE = "touchpad", WebXRControllerComponent.TRIGGER_TYPE = "trigger";
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/webXRAbstractMotionController.js
class WebXRAbstractMotionController {constructor(scene, layout, gamepadObject, handedness, _doNotLoadControllerMesh = !1, _controllerCache) {this.scene = scene, this.layout = layout, this.gamepadObject = gamepadObject, this.handedness = handedness, this._doNotLoadControllerMesh = _doNotLoadControllerMesh, this._controllerCache = _controllerCache, this._initComponent = (id) => {if (!id) return;const componentDef = this.layout.components[id],type = componentDef.type,buttonIndex = componentDef.gamepadIndices.button,axes = [];componentDef.gamepadIndices.xAxis !== void 0 && componentDef.gamepadIndices.yAxis !== void 0 && axes.push(componentDef.gamepadIndices.xAxis, componentDef.gamepadIndices.yAxis), this.components[id] = new WebXRControllerComponent(id, type, buttonIndex, axes);}, this._modelReady = !1, this.components = {}, this.disableAnimation = !1, this.onModelLoadedObservable = new observable/* Observable */.y$(), layout.components && Object.keys(layout.components).forEach(this._initComponent);}dispose() {this.getComponentIds().forEach((id) => this.getComponent(id).dispose()), this.rootMesh && (this.rootMesh.getChildren(void 0, !0).forEach((node) => {node.setEnabled(!1);}), this.rootMesh.dispose(!!this._controllerCache, !this._controllerCache));}getAllComponentsOfType(type) {return this.getComponentIds().map((id) => this.components[id]).filter((component) => component.type === type);}getComponent(id) {return this.components[id];}getComponentIds() {return Object.keys(this.components);}getComponentOfType(type) {return this.getAllComponentsOfType(type)[0] || null;}getMainComponent() {return this.getComponent(this.layout.selectComponentId);}async loadModel() {const useGeneric = !this._getModelLoadingConstraints();let loadingParams = this._getGenericFilenameAndPath();return useGeneric ? logger/* Logger.Warn */.Y.Warn("Falling back to generic models") : loadingParams = this._getFilenameAndPath(), new Promise((resolve, reject) => {const meshesLoaded = (meshes) => {useGeneric ? this._getGenericParentMesh(meshes) : this._setRootMesh(meshes), this._processLoadedModel(meshes), this._modelReady = !0, this.onModelLoadedObservable.notifyObservers(this), resolve(!0);};if (this._controllerCache) {const found = this._controllerCache.filter((c) => c.filename === loadingParams.filename && c.path === loadingParams.path);if (found[0]) return found[0].meshes.forEach((mesh) => mesh.setEnabled(!0)), void meshesLoaded(found[0].meshes);}sceneLoader/* SceneLoader.ImportMesh */.n.ImportMesh("", loadingParams.path, loadingParams.filename, this.scene, (meshes) => {this._controllerCache && this._controllerCache.push({ ...loadingParams, meshes }), meshesLoaded(meshes);}, null, (_scene, message) => {logger/* Logger.Log */.Y.Log(message), logger/* Logger.Warn */.Y.Warn(`Failed to retrieve controller model of type ${this.profileId} from the remote server: ${loadingParams.path}${loadingParams.filename}`), reject(message);});});}updateFromXRFrame(xrFrame) {this.getComponentIds().forEach((id) => this.getComponent(id).update(this.gamepadObject)), this.updateModel(xrFrame);}get handness() {return this.handedness;}pulse(value, duration, hapticActuatorIndex = 0) {return this.gamepadObject.hapticActuators && this.gamepadObject.hapticActuators[hapticActuatorIndex] ? this.gamepadObject.hapticActuators[hapticActuatorIndex].pulse(value, duration) : Promise.resolve(!1);}_getChildByName(node, name) {return node.getChildren((n) => n.name === name, !1)[0];}_getImmediateChildByName(node, name) {return node.getChildren((n) => n.name == name, !0)[0];}_lerpTransform(axisMap, axisValue, fixValueCoordinates) {if (axisMap.minMesh && axisMap.maxMesh && axisMap.valueMesh && axisMap.minMesh.rotationQuaternion && axisMap.maxMesh.rotationQuaternion && axisMap.valueMesh.rotationQuaternion) {const lerpValue = fixValueCoordinates ? .5 * axisValue + .5 : axisValue;math_vector/* Quaternion.SlerpToRef */._f.SlerpToRef(axisMap.minMesh.rotationQuaternion, axisMap.maxMesh.rotationQuaternion, lerpValue, axisMap.valueMesh.rotationQuaternion), math_vector/* Vector3.LerpToRef */.P.LerpToRef(axisMap.minMesh.position, axisMap.maxMesh.position, lerpValue, axisMap.valueMesh.position);}}updateModel(xrFrame) {this._modelReady && this._updateModel(xrFrame);}_getGenericFilenameAndPath() {return { filename: "generic.babylon", path: "https://controllers.babylonjs.com/generic/" };}_getGenericParentMesh(meshes) {this.rootMesh = new Meshes_mesh/* Mesh */.Kj(this.profileId + " " + this.handedness, this.scene), meshes.forEach((mesh) => {mesh.parent || (mesh.isPickable = !1, mesh.setParent(this.rootMesh));}), this.rootMesh.rotationQuaternion = math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(0, Math.PI, 0);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/webXRGenericMotionController.js
class WebXRGenericTriggerMotionController extends WebXRAbstractMotionController {constructor(scene, gamepadObject, handedness) {super(scene, GenericTriggerLayout[handedness], gamepadObject, handedness), this.profileId = WebXRGenericTriggerMotionController.ProfileId;}_getFilenameAndPath() {return { filename: "generic.babylon", path: "https://controllers.babylonjs.com/generic/" };}_getModelLoadingConstraints() {return !0;}_processLoadedModel() {}_setRootMesh(meshes) {this.rootMesh = new Meshes_mesh/* Mesh */.Kj(this.profileId + " " + this.handedness, this.scene), meshes.forEach((mesh) => {mesh.isPickable = !1, mesh.parent || mesh.setParent(this.rootMesh);}), this.rootMesh.rotationQuaternion = math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(0, Math.PI, 0);}_updateModel() {}}WebXRGenericTriggerMotionController.ProfileId = "generic-trigger";const GenericTriggerLayout = { left: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "generic-trigger-left", assetPath: "left.glb" }, right: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "generic-trigger-right", assetPath: "right.glb" }, none: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "generic-trigger-none", assetPath: "none.glb" } };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/webXRProfiledMotionController.js
class WebXRProfiledMotionController extends WebXRAbstractMotionController {constructor(scene, xrInput, _profile, _repositoryUrl, controllerCache) {super(scene, _profile.layouts[xrInput.handedness || "none"], xrInput.gamepad, xrInput.handedness, void 0, controllerCache), this._repositoryUrl = _repositoryUrl, this.controllerCache = controllerCache, this._buttonMeshMapping = {}, this._touchDots = {}, this.profileId = _profile.profileId;}dispose() {super.dispose(), this.controllerCache || Object.keys(this._touchDots).forEach((visResKey) => {this._touchDots[visResKey].dispose();});}_getFilenameAndPath() {return { filename: this.layout.assetPath, path: `${this._repositoryUrl}/profiles/${this.profileId}/` };}_getModelLoadingConstraints() {const glbLoaded = sceneLoader/* SceneLoader.IsPluginForExtensionAvailable */.n.IsPluginForExtensionAvailable(".glb");return glbLoaded || logger/* Logger.Warn */.Y.Warn("glTF / glb loader was not registered, using generic controller instead"), glbLoaded;}_processLoadedModel() {this.getComponentIds().forEach((type) => {const componentInLayout = this.layout.components[type];this._buttonMeshMapping[type] = { mainMesh: this._getChildByName(this.rootMesh, componentInLayout.rootNodeName), states: {} }, Object.keys(componentInLayout.visualResponses).forEach((visualResponseKey) => {const visResponse = componentInLayout.visualResponses[visualResponseKey];if ("transform" === visResponse.valueNodeProperty) this._buttonMeshMapping[type].states[visualResponseKey] = { valueMesh: this._getChildByName(this.rootMesh, visResponse.valueNodeName), minMesh: this._getChildByName(this.rootMesh, visResponse.minNodeName), maxMesh: this._getChildByName(this.rootMesh, visResponse.maxNodeName) };else {const nameOfMesh = componentInLayout.type === WebXRControllerComponent.TOUCHPAD_TYPE && componentInLayout.touchPointNodeName ? componentInLayout.touchPointNodeName : visResponse.valueNodeName;if (this._buttonMeshMapping[type].states[visualResponseKey] = { valueMesh: this._getChildByName(this.rootMesh, nameOfMesh) }, componentInLayout.type === WebXRControllerComponent.TOUCHPAD_TYPE && !this._touchDots[visualResponseKey]) {const dot = CreateSphere(visualResponseKey + "dot", { diameter: .0015, segments: 8 }, this.scene);dot.material = new standardMaterial/* StandardMaterial */.K(visualResponseKey + "mat", this.scene), dot.material.diffuseColor = math_color/* Color3.Red */.Wo.Red(), dot.parent = this._buttonMeshMapping[type].states[visualResponseKey].valueMesh || null, dot.isVisible = !1, this._touchDots[visualResponseKey] = dot;}}});});}_setRootMesh(meshes) {this.rootMesh = new Meshes_mesh/* Mesh */.Kj(this.profileId + "-" + this.handedness, this.scene), this.rootMesh.isPickable = !1;let rootMesh;for (let i = 0; i < meshes.length; i++) {const mesh = meshes[i];mesh.isPickable = !1, mesh.parent || (rootMesh = mesh);}rootMesh && rootMesh.setParent(this.rootMesh), this.scene.useRightHandedSystem || this.rootMesh.rotate(math_axis/* Axis.Y */.RD.Y, Math.PI, math_axis/* Space.WORLD */.T.WORLD);}_updateModel() {this.disableAnimation || this.getComponentIds().forEach((id) => {const component = this.getComponent(id);if (!component.hasChanges) return;const meshes = this._buttonMeshMapping[id],componentInLayout = this.layout.components[id];Object.keys(componentInLayout.visualResponses).forEach((visualResponseKey) => {const visResponse = componentInLayout.visualResponses[visualResponseKey];let value = component.value;if ("xAxis" === visResponse.componentProperty ? value = component.axes.x : "yAxis" === visResponse.componentProperty && (value = component.axes.y), "transform" === visResponse.valueNodeProperty) this._lerpTransform(meshes.states[visualResponseKey], value, "button" !== visResponse.componentProperty);else {const valueMesh = meshes.states[visualResponseKey].valueMesh;valueMesh && (valueMesh.isVisible = component.touched || component.pressed), this._touchDots[visualResponseKey] && (this._touchDots[visualResponseKey].isVisible = component.touched || component.pressed);}});});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/webXRMotionControllerManager.js
const controllerCache = [];class WebXRMotionControllerManager {static ClearProfilesCache() {this._ProfilesList = null, this._ProfileLoadingPromises = {};}static DefaultFallbacks() {this.RegisterFallbacksForProfileId("google-daydream", ["generic-touchpad"]), this.RegisterFallbacksForProfileId("htc-vive-focus", ["generic-trigger-touchpad"]), this.RegisterFallbacksForProfileId("htc-vive", ["generic-trigger-squeeze-touchpad"]), this.RegisterFallbacksForProfileId("magicleap-one", ["generic-trigger-squeeze-touchpad"]), this.RegisterFallbacksForProfileId("windows-mixed-reality", ["generic-trigger-squeeze-touchpad-thumbstick"]), this.RegisterFallbacksForProfileId("microsoft-mixed-reality", ["windows-mixed-reality", "generic-trigger-squeeze-touchpad-thumbstick"]), this.RegisterFallbacksForProfileId("oculus-go", ["generic-trigger-touchpad"]), this.RegisterFallbacksForProfileId("oculus-touch-v2", ["oculus-touch", "generic-trigger-squeeze-thumbstick"]), this.RegisterFallbacksForProfileId("oculus-touch", ["generic-trigger-squeeze-thumbstick"]), this.RegisterFallbacksForProfileId("samsung-gearvr", ["windows-mixed-reality", "generic-trigger-squeeze-touchpad-thumbstick"]), this.RegisterFallbacksForProfileId("samsung-odyssey", ["generic-touchpad"]), this.RegisterFallbacksForProfileId("valve-index", ["generic-trigger-squeeze-touchpad-thumbstick"]), this.RegisterFallbacksForProfileId("generic-hand-select", ["generic-trigger"]);}static FindFallbackWithProfileId(profileId) {const returnArray = this._Fallbacks[profileId] || [];return returnArray.unshift(profileId), returnArray;}static GetMotionControllerWithXRInput(xrInput, scene, forceProfile) {const profileArray = [];if (forceProfile && profileArray.push(forceProfile), profileArray.push(...(xrInput.profiles || [])), profileArray.length && !profileArray[0] && profileArray.pop(), xrInput.gamepad && xrInput.gamepad.id) switch (xrInput.gamepad.id) {case xrInput.gamepad.id.match(/oculus touch/gi) ? xrInput.gamepad.id : void 0:profileArray.push("oculus-touch-v2");}const windowsMRIdx = profileArray.indexOf("windows-mixed-reality");if (-1 !== windowsMRIdx && profileArray.splice(windowsMRIdx, 0, "microsoft-mixed-reality"), profileArray.length || profileArray.push("generic-trigger"), this.UseOnlineRepository) {const firstFunction = this.PrioritizeOnlineRepository ? this._LoadProfileFromRepository : this._LoadProfilesFromAvailableControllers,secondFunction = this.PrioritizeOnlineRepository ? this._LoadProfilesFromAvailableControllers : this._LoadProfileFromRepository;return firstFunction.call(this, profileArray, xrInput, scene).catch(() => secondFunction.call(this, profileArray, xrInput, scene));}return this._LoadProfilesFromAvailableControllers(profileArray, xrInput, scene);}static RegisterController(type, constructFunction) {this._AvailableControllers[type] = constructFunction;}static RegisterFallbacksForProfileId(profileId, fallbacks) {this._Fallbacks[profileId] ? this._Fallbacks[profileId].push(...fallbacks) : this._Fallbacks[profileId] = fallbacks;}static UpdateProfilesList() {return this._ProfilesList = tools/* Tools.LoadFileAsync */.w1.LoadFileAsync(this.BaseRepositoryUrl + "/profiles/profilesList.json", !1).then((data) => JSON.parse(data.toString())), this._ProfilesList;}static ClearControllerCache() {controllerCache.forEach((cacheItem) => {cacheItem.meshes.forEach((mesh) => {mesh.dispose(!1, !0);});}), controllerCache.length = 0;}static _LoadProfileFromRepository(profileArray, xrInput, scene) {return Promise.resolve().then(() => this._ProfilesList ? this._ProfilesList : this.UpdateProfilesList()).then((profilesList) => {for (let i = 0; i < profileArray.length; ++i) if (profileArray[i] && profilesList[profileArray[i]]) return profileArray[i];throw new Error(`neither controller ${profileArray[0]} nor all fallbacks were found in the repository,`);}).then((profileToLoad) => (this._ProfileLoadingPromises[profileToLoad] || (this._ProfileLoadingPromises[profileToLoad] = tools/* Tools.LoadFileAsync */.w1.LoadFileAsync(`${this.BaseRepositoryUrl}/profiles/${profileToLoad}/profile.json`, !1).then((data) => JSON.parse(data))), this._ProfileLoadingPromises[profileToLoad])).then((profile) => new WebXRProfiledMotionController(scene, xrInput, profile, this.BaseRepositoryUrl, this.DisableControllerCache ? void 0 : controllerCache));}static _LoadProfilesFromAvailableControllers(profileArray, xrInput, scene) {for (let i = 0; i < profileArray.length; ++i) {if (!profileArray[i]) continue;const fallbacks = this.FindFallbackWithProfileId(profileArray[i]);for (let j = 0; j < fallbacks.length; ++j) {const constructionFunction = this._AvailableControllers[fallbacks[j]];if (constructionFunction) return Promise.resolve(constructionFunction(xrInput, scene));}}throw new Error(`no controller requested was found in the available controllers list`);}}WebXRMotionControllerManager._AvailableControllers = {}, WebXRMotionControllerManager._Fallbacks = {}, WebXRMotionControllerManager._ProfileLoadingPromises = {}, WebXRMotionControllerManager.BaseRepositoryUrl = "https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist", WebXRMotionControllerManager.PrioritizeOnlineRepository = !0, WebXRMotionControllerManager.UseOnlineRepository = !0, WebXRMotionControllerManager.DisableControllerCache = !0, WebXRMotionControllerManager.RegisterController(WebXRGenericTriggerMotionController.ProfileId, (xrInput, scene) => new WebXRGenericTriggerMotionController(scene, xrInput.gamepad, xrInput.handedness)), WebXRMotionControllerManager.DefaultFallbacks();
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRInputSource.js
let idCount = 0;class WebXRInputSource {constructor(_scene, inputSource, _options = {}) {this._scene = _scene, this.inputSource = inputSource, this._options = _options, this._tmpVector = new math_vector/* Vector3 */.P(), this._disposed = !1, this.onDisposeObservable = new observable/* Observable */.y$(), this.onMeshLoadedObservable = new observable/* Observable */.y$(), this.onMotionControllerInitObservable = new observable/* Observable */.y$(), this._uniqueId = `controller-${idCount++}-${inputSource.targetRayMode}-${inputSource.handedness}`, this.pointer = new abstractMesh/* AbstractMesh */.x(`${this._uniqueId}-pointer`, _scene), this.pointer.rotationQuaternion = new math_vector/* Quaternion */._f(), this.inputSource.gripSpace && (this.grip = new abstractMesh/* AbstractMesh */.x(`${this._uniqueId}-grip`, this._scene), this.grip.rotationQuaternion = new math_vector/* Quaternion */._f()), this._tmpVector.set(0, 0, this._scene.useRightHandedSystem ? -1 : 1), this.inputSource.gamepad && "tracked-pointer" === this.inputSource.targetRayMode && WebXRMotionControllerManager.GetMotionControllerWithXRInput(inputSource, _scene, this._options.forceControllerProfile).then((motionController) => {this.motionController = motionController, this.onMotionControllerInitObservable.notifyObservers(motionController), this._options.doNotLoadControllerMesh || this.motionController._doNotLoadControllerMesh || this.motionController.loadModel().then((success) => {var _a;success && this.motionController && this.motionController.rootMesh && (this._options.renderingGroupId && (this.motionController.rootMesh.renderingGroupId = this._options.renderingGroupId, this.motionController.rootMesh.getChildMeshes(!1).forEach((mesh) => mesh.renderingGroupId = this._options.renderingGroupId)), this.onMeshLoadedObservable.notifyObservers(this.motionController.rootMesh), this.motionController.rootMesh.parent = this.grip || this.pointer, this.motionController.disableAnimation = !!this._options.disableMotionControllerAnimation), this._disposed && (null === (_a = this.motionController) || void 0 === _a ? void 0 : _a.dispose());});}, () => {tools/* Tools.Warn */.w1.Warn(`Could not find a matching motion controller for the registered input source`);});}get uniqueId() {return this._uniqueId;}dispose() {this.grip && this.grip.dispose(!0), this.motionController && this.motionController.dispose(), this.pointer.dispose(!0), this.onMotionControllerInitObservable.clear(), this.onMeshLoadedObservable.clear(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._disposed = !0;}getWorldPointerRayToRef(result, gripIfAvailable = !1) {const object = gripIfAvailable && this.grip ? this.grip : this.pointer;math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(this._tmpVector, object.getWorldMatrix(), result.direction), result.direction.normalize(), result.origin.copyFrom(object.absolutePosition), result.length = 1e3;}updateFromXRFrame(xrFrame, referenceSpace, xrCamera) {const pose = xrFrame.getPose(this.inputSource.targetRaySpace, referenceSpace);if (this._lastXRPose = pose, pose) {const pos = pose.transform.position;this.pointer.position.set(pos.x, pos.y, pos.z);const orientation = pose.transform.orientation;this.pointer.rotationQuaternion.set(orientation.x, orientation.y, orientation.z, orientation.w), this._scene.useRightHandedSystem || (this.pointer.position.z *= -1, this.pointer.rotationQuaternion.z *= -1, this.pointer.rotationQuaternion.w *= -1), this.pointer.parent = xrCamera.parent;}if (this.inputSource.gripSpace && this.grip) {const pose = xrFrame.getPose(this.inputSource.gripSpace, referenceSpace);if (pose) {const pos = pose.transform.position,orientation = pose.transform.orientation;this.grip.position.set(pos.x, pos.y, pos.z), this.grip.rotationQuaternion.set(orientation.x, orientation.y, orientation.z, orientation.w), this._scene.useRightHandedSystem || (this.grip.position.z *= -1, this.grip.rotationQuaternion.z *= -1, this.grip.rotationQuaternion.w *= -1);}this.grip.parent = xrCamera.parent;}this.motionController && this.motionController.updateFromXRFrame(xrFrame);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRInput.js
class WebXRInput {constructor(xrSessionManager, xrCamera, _options = {}) {if (this.xrSessionManager = xrSessionManager, this.xrCamera = xrCamera, this._options = _options, this.controllers = [], this.onControllerAddedObservable = new observable/* Observable */.y$(), this.onControllerRemovedObservable = new observable/* Observable */.y$(), this._onInputSourcesChange = (event) => {this._addAndRemoveControllers(event.added, event.removed);}, this._sessionEndedObserver = this.xrSessionManager.onXRSessionEnded.add(() => {this._addAndRemoveControllers([], this.controllers.map((c) => c.inputSource));}), this._sessionInitObserver = this.xrSessionManager.onXRSessionInit.add((session) => {session.addEventListener("inputsourceschange", this._onInputSourcesChange);}), this._frameObserver = this.xrSessionManager.onXRFrameObservable.add((frame) => {this.controllers.forEach((controller) => {controller.updateFromXRFrame(frame, this.xrSessionManager.referenceSpace, this.xrCamera);});}), this._options.customControllersRepositoryURL && (WebXRMotionControllerManager.BaseRepositoryUrl = this._options.customControllersRepositoryURL), WebXRMotionControllerManager.UseOnlineRepository = !this._options.disableOnlineControllerRepository, WebXRMotionControllerManager.UseOnlineRepository) try {WebXRMotionControllerManager.UpdateProfilesList().catch(() => {WebXRMotionControllerManager.UseOnlineRepository = !1;});} catch (e) {WebXRMotionControllerManager.UseOnlineRepository = !1;}}_addAndRemoveControllers(addInputs, removeInputs) {const sources = this.controllers.map((c) => c.inputSource);for (const input of addInputs) if (-1 === sources.indexOf(input)) {const controller = new WebXRInputSource(this.xrSessionManager.scene, input, { ...(this._options.controllerOptions || {}), forceControllerProfile: this._options.forceInputProfile, doNotLoadControllerMesh: this._options.doNotLoadControllerMeshes, disableMotionControllerAnimation: this._options.disableControllerAnimation });this.controllers.push(controller), this.onControllerAddedObservable.notifyObservers(controller);}const keepControllers = [],removedControllers = [];this.controllers.forEach((c) => {-1 === removeInputs.indexOf(c.inputSource) ? keepControllers.push(c) : removedControllers.push(c);}), this.controllers = keepControllers, removedControllers.forEach((c) => {this.onControllerRemovedObservable.notifyObservers(c), c.dispose();});}dispose() {this.controllers.forEach((c) => {c.dispose();}), this.xrSessionManager.onXRFrameObservable.remove(this._frameObserver), this.xrSessionManager.onXRSessionInit.remove(this._sessionInitObserver), this.xrSessionManager.onXRSessionEnded.remove(this._sessionEndedObserver), this.onControllerAddedObservable.clear(), this.onControllerRemovedObservable.clear(), WebXRMotionControllerManager.ClearControllerCache();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRControllerPointerSelection.js
class WebXRControllerPointerSelection extends WebXRAbstractFeature {constructor(_xrSessionManager, _options) {super(_xrSessionManager), this._options = _options, this._attachController = (xrController) => {if (!this._controllers[xrController.uniqueId]) {const { laserPointer, selectionMesh } = this._generateNewMeshPair(xrController.pointer);switch (this._controllers[xrController.uniqueId] = { xrController, laserPointer, selectionMesh, meshUnderPointer: null, pick: null, tmpRay: new Ray(new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P()), disabledByNearInteraction: !1, id: WebXRControllerPointerSelection._IdCounter++ }, this._attachedController ? !this._options.enablePointerSelectionOnAllControllers && this._options.preferredHandedness && xrController.inputSource.handedness === this._options.preferredHandedness && (this._attachedController = xrController.uniqueId) : !this._options.enablePointerSelectionOnAllControllers && (this._attachedController = xrController.uniqueId), xrController.inputSource.targetRayMode) {case "tracked-pointer":return this._attachTrackedPointerRayMode(xrController);case "gaze":return this._attachGazeMode(xrController);case "screen":return this._attachScreenRayMode(xrController);}}}, this._controllers = {}, this._tmpVectorForPickCompare = new math_vector/* Vector3 */.P(), this.disablePointerLighting = !0, this.disableSelectionMeshLighting = !0, this.displayLaserPointer = !0, this.displaySelectionMesh = !0, this.laserPointerPickedColor = new math_color/* Color3 */.Wo(.9, .9, .9), this.laserPointerDefaultColor = new math_color/* Color3 */.Wo(.7, .7, .7), this.selectionMeshDefaultColor = new math_color/* Color3 */.Wo(.8, .8, .8), this.selectionMeshPickedColor = new math_color/* Color3 */.Wo(.3, .3, 1), this._identityMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this._screenCoordinatesRef = math_vector/* Vector3.Zero */.P.Zero(), this._viewportRef = new math_viewport/* Viewport */.l(0, 0, 0, 0), this._scene = this._xrSessionManager.scene;}attach() {if (!super.attach()) return !1;if (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (controller) => {this._detachController(controller.uniqueId);}), this._scene.constantlyUpdateMeshUnderPointer = !0, this._options.gazeCamera) {const webXRCamera = this._options.gazeCamera,{ laserPointer, selectionMesh } = this._generateNewMeshPair(webXRCamera);this._controllers.camera = { webXRCamera, laserPointer, selectionMesh, meshUnderPointer: null, pick: null, tmpRay: new Ray(new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P()), disabledByNearInteraction: !1, id: WebXRControllerPointerSelection._IdCounter++ }, this._attachGazeMode();}return !0;}detach() {return !!super.detach() && (Object.keys(this._controllers).forEach((controllerId) => {this._detachController(controllerId);}), !0);}getMeshUnderPointer(controllerId) {return this._controllers[controllerId] ? this._controllers[controllerId].meshUnderPointer : null;}getXRControllerByPointerId(id) {const keys = Object.keys(this._controllers);for (let i = 0; i < keys.length; ++i) if (this._controllers[keys[i]].id === id) return this._controllers[keys[i]].xrController || null;return null;}_getPointerSelectionDisabledByPointerId(id) {const keys = Object.keys(this._controllers);for (let i = 0; i < keys.length; ++i) if (this._controllers[keys[i]].id === id) return this._controllers[keys[i]].disabledByNearInteraction;return !0;}_setPointerSelectionDisabledByPointerId(id, state) {const keys = Object.keys(this._controllers);for (let i = 0; i < keys.length; ++i) if (this._controllers[keys[i]].id === id) return void (this._controllers[keys[i]].disabledByNearInteraction = state);}_onXRFrame() {Object.keys(this._controllers).forEach((id) => {const controllerData = this._controllers[id];if (!this._options.enablePointerSelectionOnAllControllers && id !== this._attachedController || controllerData.disabledByNearInteraction) return controllerData.selectionMesh.isVisible = !1, controllerData.laserPointer.isVisible = !1, void (controllerData.pick = null);controllerData.laserPointer.isVisible = this.displayLaserPointer;let controllerGlobalPosition;if (controllerData.xrController) controllerGlobalPosition = controllerData.xrController.pointer.position, controllerData.xrController.getWorldPointerRayToRef(controllerData.tmpRay);else if (controllerData.webXRCamera) controllerGlobalPosition = controllerData.webXRCamera.position, controllerData.webXRCamera.getForwardRayToRef(controllerData.tmpRay);else return;if (this._options.maxPointerDistance && (controllerData.tmpRay.length = this._options.maxPointerDistance), !this._options.disableScenePointerVectorUpdate && controllerGlobalPosition) {const scene = this._xrSessionManager.scene,camera = this._options.xrInput.xrCamera;camera && (camera.viewport.toGlobalToRef(scene.getEngine().getRenderWidth(), scene.getEngine().getRenderHeight(), this._viewportRef), math_vector/* Vector3.ProjectToRef */.P.ProjectToRef(controllerGlobalPosition, this._identityMatrix, scene.getTransformMatrix(), this._viewportRef, this._screenCoordinatesRef), "number" == typeof this._screenCoordinatesRef.x && "number" == typeof this._screenCoordinatesRef.y && !isNaN(this._screenCoordinatesRef.x) && !isNaN(this._screenCoordinatesRef.y) && (scene.pointerX = this._screenCoordinatesRef.x, scene.pointerY = this._screenCoordinatesRef.y, controllerData.screenCoordinates = { x: this._screenCoordinatesRef.x, y: this._screenCoordinatesRef.y }));}let utilityScenePick = null;this._utilityLayerScene && (utilityScenePick = this._utilityLayerScene.pickWithRay(controllerData.tmpRay, this._utilityLayerScene.pointerMovePredicate || this.raySelectionPredicate));const originalScenePick = this._scene.pickWithRay(controllerData.tmpRay, this._scene.pointerMovePredicate || this.raySelectionPredicate);controllerData.pick = utilityScenePick && utilityScenePick.hit ? originalScenePick && originalScenePick.hit ? utilityScenePick.distance < originalScenePick.distance ? utilityScenePick : originalScenePick : utilityScenePick : originalScenePick, controllerData.pick && controllerData.xrController && (controllerData.pick.aimTransform = controllerData.xrController.pointer, controllerData.pick.gripTransform = controllerData.xrController.grip || null);const pick = controllerData.pick;if (pick && pick.pickedPoint && pick.hit) {this._updatePointerDistance(controllerData.laserPointer, pick.distance), controllerData.selectionMesh.position.copyFrom(pick.pickedPoint), controllerData.selectionMesh.scaling.x = Math.sqrt(pick.distance), controllerData.selectionMesh.scaling.y = Math.sqrt(pick.distance), controllerData.selectionMesh.scaling.z = Math.sqrt(pick.distance);const pickNormal = this._convertNormalToDirectionOfRay(pick.getNormal(!0), controllerData.tmpRay);if (controllerData.selectionMesh.position.copyFrom(pick.pickedPoint), pickNormal) {const axis1 = math_vector/* Vector3.Cross */.P.Cross(math_axis/* Axis.Y */.RD.Y, pickNormal),axis2 = math_vector/* Vector3.Cross */.P.Cross(pickNormal, axis1);math_vector/* Vector3.RotationFromAxisToRef */.P.RotationFromAxisToRef(axis2, pickNormal, axis1, controllerData.selectionMesh.rotation), controllerData.selectionMesh.position.addInPlace(pickNormal.scale(.001));}controllerData.selectionMesh.isVisible = this.displaySelectionMesh, controllerData.meshUnderPointer = pick.pickedMesh;} else controllerData.selectionMesh.isVisible = !1, this._updatePointerDistance(controllerData.laserPointer, 1), controllerData.meshUnderPointer = null;});}get _utilityLayerScene() {return this._options.customUtilityLayerScene || UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene;}_attachGazeMode(xrController) {const controllerData = this._controllers[xrController && xrController.uniqueId || "camera"],timeToSelect = this._options.timeToSelect || 3e3,sceneToRenderTo = this._options.useUtilityLayer ? this._utilityLayerScene : this._scene;let oldPick = new Collisions_pickingInfo/* PickingInfo */.p();const discMesh = CreateTorus("selection", { diameter: 15 * .0035, thickness: 6 * .0025, tessellation: 20 }, sceneToRenderTo);discMesh.isVisible = !1, discMesh.isPickable = !1, discMesh.parent = controllerData.selectionMesh;let timer = 0,downTriggered = !1;const pointerEventInit = { pointerId: controllerData.id, pointerType: "xr" };controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {if (controllerData.pick) {if (this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates), controllerData.laserPointer.material.alpha = 0, discMesh.isVisible = !1, !controllerData.pick.hit) downTriggered = !1, timer = 0;else if (!!this._pickingMoved(oldPick, controllerData.pick)) downTriggered && !this._options.disablePointerUpOnTouchOut && this._scene.simulatePointerUp(controllerData.pick, pointerEventInit), downTriggered = !1, timer = 0;else if (timer > timeToSelect / 10 && (discMesh.isVisible = !0), timer += this._scene.getEngine().getDeltaTime(), timer >= timeToSelect) this._scene.simulatePointerDown(controllerData.pick, pointerEventInit), downTriggered = !0, this._options.disablePointerUpOnTouchOut && this._scene.simulatePointerUp(controllerData.pick, pointerEventInit), discMesh.isVisible = !1;else {const scaleFactor = 1 - timer / timeToSelect;discMesh.scaling.set(scaleFactor, scaleFactor, scaleFactor);}this._scene.simulatePointerMove(controllerData.pick, pointerEventInit), oldPick = controllerData.pick;}}), this._options.renderingGroupId !== void 0 && (discMesh.renderingGroupId = this._options.renderingGroupId), xrController && xrController.onDisposeObservable.addOnce(() => {controllerData.pick && !this._options.disablePointerUpOnTouchOut && downTriggered && (this._scene.simulatePointerUp(controllerData.pick, pointerEventInit), controllerData.finalPointerUpTriggered = !0), discMesh.dispose();});}_attachScreenRayMode(xrController) {const controllerData = this._controllers[xrController.uniqueId];let downTriggered = !1;const pointerEventInit = { pointerId: controllerData.id, pointerType: "xr" };controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates);!controllerData.pick || this._options.disablePointerUpOnTouchOut && downTriggered || (downTriggered ? this._scene.simulatePointerMove(controllerData.pick, pointerEventInit) : (this._scene.simulatePointerDown(controllerData.pick, pointerEventInit), controllerData.pointerDownTriggered = !0, downTriggered = !0, this._options.disablePointerUpOnTouchOut && this._scene.simulatePointerUp(controllerData.pick, pointerEventInit)));}), xrController.onDisposeObservable.addOnce(() => {this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates), this._xrSessionManager.runInXRFrame(() => {controllerData.pick && !controllerData.finalPointerUpTriggered && downTriggered && !this._options.disablePointerUpOnTouchOut && (this._scene.simulatePointerUp(controllerData.pick, pointerEventInit), controllerData.finalPointerUpTriggered = !0);});});}_attachTrackedPointerRayMode(xrController) {const controllerData = this._controllers[xrController.uniqueId];if (this._options.forceGazeMode) return this._attachGazeMode(xrController);const pointerEventInit = { pointerId: controllerData.id, pointerType: "xr" };if (controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {controllerData.laserPointer.material.disableLighting = this.disablePointerLighting, controllerData.selectionMesh.material.disableLighting = this.disableSelectionMeshLighting, controllerData.pick && (this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates), this._scene.simulatePointerMove(controllerData.pick, pointerEventInit));}), xrController.inputSource.gamepad) {const init = (motionController) => {this._options.overrideButtonId && (controllerData.selectionComponent = motionController.getComponent(this._options.overrideButtonId)), controllerData.selectionComponent || (controllerData.selectionComponent = motionController.getMainComponent()), controllerData.onButtonChangedObserver = controllerData.selectionComponent.onButtonStateChangedObservable.add((component) => {if (component.changes.pressed) {const pressed = component.changes.pressed.current;controllerData.pick ? (this._options.enablePointerSelectionOnAllControllers || xrController.uniqueId === this._attachedController) && (this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates), pressed ? (this._scene.simulatePointerDown(controllerData.pick, pointerEventInit), controllerData.pointerDownTriggered = !0, controllerData.selectionMesh.material.emissiveColor = this.selectionMeshPickedColor, controllerData.laserPointer.material.emissiveColor = this.laserPointerPickedColor) : (this._scene.simulatePointerUp(controllerData.pick, pointerEventInit), controllerData.selectionMesh.material.emissiveColor = this.selectionMeshDefaultColor, controllerData.laserPointer.material.emissiveColor = this.laserPointerDefaultColor)) : pressed && !this._options.enablePointerSelectionOnAllControllers && !this._options.disableSwitchOnClick && (this._attachedController = xrController.uniqueId);}});};xrController.motionController ? init(xrController.motionController) : xrController.onMotionControllerInitObservable.add(init);} else {const selectStartListener = (event) => {this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates), controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick && (this._scene.simulatePointerDown(controllerData.pick, pointerEventInit), controllerData.pointerDownTriggered = !0, controllerData.selectionMesh.material.emissiveColor = this.selectionMeshPickedColor, controllerData.laserPointer.material.emissiveColor = this.laserPointerPickedColor);},selectEndListener = (event) => {this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates), controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick && (this._scene.simulatePointerUp(controllerData.pick, pointerEventInit), controllerData.selectionMesh.material.emissiveColor = this.selectionMeshDefaultColor, controllerData.laserPointer.material.emissiveColor = this.laserPointerDefaultColor);};controllerData.eventListeners = { selectend: selectEndListener, selectstart: selectStartListener }, this._xrSessionManager.session.addEventListener("selectstart", selectStartListener), this._xrSessionManager.session.addEventListener("selectend", selectEndListener);}}_convertNormalToDirectionOfRay(normal, ray) {if (normal) {const angle = Math.acos(math_vector/* Vector3.Dot */.P.Dot(normal, ray.direction));angle < Math.PI / 2 && normal.scaleInPlace(-1);}return normal;}_detachController(xrControllerUniqueId) {const controllerData = this._controllers[xrControllerUniqueId];if (controllerData) {if (controllerData.selectionComponent && controllerData.onButtonChangedObserver && controllerData.selectionComponent.onButtonStateChangedObservable.remove(controllerData.onButtonChangedObserver), controllerData.onFrameObserver && this._xrSessionManager.onXRFrameObservable.remove(controllerData.onFrameObserver), controllerData.eventListeners && Object.keys(controllerData.eventListeners).forEach((eventName) => {const func = controllerData.eventListeners && controllerData.eventListeners[eventName];func && this._xrSessionManager.session.removeEventListener(eventName, func);}), !controllerData.finalPointerUpTriggered && controllerData.pointerDownTriggered) {const pointerEventInit = { pointerId: controllerData.id, pointerType: "xr" };this._xrSessionManager.runInXRFrame(() => {this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates), this._scene.simulatePointerUp(controllerData.pick || new Collisions_pickingInfo/* PickingInfo */.p(), pointerEventInit), controllerData.finalPointerUpTriggered = !0;});}this._xrSessionManager.scene.onBeforeRenderObservable.addOnce(() => {try {if (controllerData.selectionMesh.dispose(), controllerData.laserPointer.dispose(), delete this._controllers[xrControllerUniqueId], this._attachedController === xrControllerUniqueId) {const keys = Object.keys(this._controllers);this._attachedController = keys.length ? keys[0] : "";}} catch (e) {tools/* Tools.Warn */.w1.Warn("controller already detached.");}});}}_generateNewMeshPair(meshParent) {const sceneToRenderTo = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene : this._scene,laserPointer = this._options.customLasterPointerMeshGenerator ? this._options.customLasterPointerMeshGenerator() : CreateCylinder("laserPointer", { height: 1, diameterTop: 2e-4, diameterBottom: .004, tessellation: 20, subdivisions: 1 }, sceneToRenderTo);laserPointer.parent = meshParent;const laserPointerMaterial = new standardMaterial/* StandardMaterial */.K("laserPointerMat", sceneToRenderTo);laserPointerMaterial.emissiveColor = this.laserPointerDefaultColor, laserPointerMaterial.alpha = .7, laserPointer.material = laserPointerMaterial, laserPointer.rotation.x = Math.PI / 2, this._updatePointerDistance(laserPointer, 1), laserPointer.isPickable = !1, laserPointer.isVisible = !1;const selectionMesh = this._options.customSelectionMeshGenerator ? this._options.customSelectionMeshGenerator() : CreateTorus("gazeTracker", { diameter: .0035 * 3, thickness: .0025 * 3, tessellation: 20 }, sceneToRenderTo);selectionMesh.bakeCurrentTransformIntoVertices(), selectionMesh.isPickable = !1, selectionMesh.isVisible = !1;const targetMat = new standardMaterial/* StandardMaterial */.K("targetMat", sceneToRenderTo);return targetMat.specularColor = math_color/* Color3.Black */.Wo.Black(), targetMat.emissiveColor = this.selectionMeshDefaultColor, targetMat.backFaceCulling = !1, selectionMesh.material = targetMat, void 0 !== this._options.renderingGroupId && (laserPointer.renderingGroupId = this._options.renderingGroupId, selectionMesh.renderingGroupId = this._options.renderingGroupId), { laserPointer, selectionMesh };}_pickingMoved(oldPick, newPick) {var _a;if (!oldPick.hit || !newPick.hit) return !0;if (!oldPick.pickedMesh || !oldPick.pickedPoint || !newPick.pickedMesh || !newPick.pickedPoint) return !0;if (oldPick.pickedMesh !== newPick.pickedMesh) return !0;null === (_a = oldPick.pickedPoint) || void 0 === _a ? void 0 : _a.subtractToRef(newPick.pickedPoint, this._tmpVectorForPickCompare), this._tmpVectorForPickCompare.set(Math.abs(this._tmpVectorForPickCompare.x), Math.abs(this._tmpVectorForPickCompare.y), Math.abs(this._tmpVectorForPickCompare.z));const delta = .01 * (this._options.gazeModePointerMovedFactor || 1) * newPick.distance,length = this._tmpVectorForPickCompare.length();return !!(length > delta);}_updatePointerDistance(_laserPointer, distance = 100) {_laserPointer.scaling.y = distance, this._scene.useRightHandedSystem && (distance *= -1), _laserPointer.position.z = distance / 2 + .05;}_augmentPointerInit(pointerEventInit, id, screenCoordinates) {pointerEventInit.pointerId = id, pointerEventInit.pointerType = "xr", screenCoordinates && (pointerEventInit.screenX = screenCoordinates.x, pointerEventInit.screenY = screenCoordinates.y);}get lasterPointerDefaultColor() {return this.laserPointerDefaultColor;}}WebXRControllerPointerSelection._IdCounter = 200, WebXRControllerPointerSelection.Name = WebXRFeatureName.POINTER_SELECTION, WebXRControllerPointerSelection.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRControllerPointerSelection.Name, (xrSessionManager, options) => () => new WebXRControllerPointerSelection(xrSessionManager, options), WebXRControllerPointerSelection.Version, !0);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/subMesh.js
var subMesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/subMesh.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/subMesh.project.js
subMesh/* SubMesh.prototype._projectOnTrianglesToRef */.P.prototype._projectOnTrianglesToRef = function (vector, positions, indices, step, checkStopper, ref) {const proj = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],tmp = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];let distance = +Infinity;for (let index = this.indexStart; index < this.indexStart + this.indexCount - (3 - step); index += step) {const indexA = indices[index],indexB = indices[index + 1],indexC = indices[index + 2];if (checkStopper && 4294967295 === indexC) {index += 2;continue;}const p0 = positions[indexA],p1 = positions[indexB],p2 = positions[indexC];if (!p0 || !p1 || !p2) continue;const tmpDist = math_vector/* Vector3.ProjectOnTriangleToRef */.P.ProjectOnTriangleToRef(vector, p0, p1, p2, tmp);tmpDist < distance && (proj.copyFrom(tmp), distance = tmpDist);}return ref.copyFrom(proj), distance;}, subMesh/* SubMesh.prototype._projectOnUnIndexedTrianglesToRef */.P.prototype._projectOnUnIndexedTrianglesToRef = function (vector, positions, indices, ref) {const proj = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],tmp = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];let distance = +Infinity;for (let index = this.verticesStart; index < this.verticesStart + this.verticesCount; index += 3) {const p0 = positions[index],p1 = positions[index + 1],p2 = positions[index + 2],tmpDist = math_vector/* Vector3.ProjectOnTriangleToRef */.P.ProjectOnTriangleToRef(vector, p0, p1, p2, tmp);tmpDist < distance && (proj.copyFrom(tmp), distance = tmpDist);}return ref.copyFrom(proj), distance;}, subMesh/* SubMesh.prototype.projectToRef */.P.prototype.projectToRef = function (vector, positions, indices, ref) {const material = this.getMaterial();if (!material) return -1;let step = 3,checkStopper = !1;switch (material.fillMode) {case 3:case 5:case 6:case 8:return -1;case 7:step = 1, checkStopper = !0;break;default:}return 4 === material.fillMode ? -1 : !indices.length && this._mesh._unIndexed ? this._projectOnUnIndexedTrianglesToRef(vector, positions, indices, ref) : this._projectOnTrianglesToRef(vector, positions, indices, step, checkStopper, ref);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRNearInteraction.js
var ControllerOrbAnimationState;(function (ControllerOrbAnimationState) {ControllerOrbAnimationState[ControllerOrbAnimationState.DEHYDRATED = 0] = "DEHYDRATED", ControllerOrbAnimationState[ControllerOrbAnimationState.HOVER = 1] = "HOVER", ControllerOrbAnimationState[ControllerOrbAnimationState.TOUCH = 2] = "TOUCH";})(ControllerOrbAnimationState || (ControllerOrbAnimationState = {}));var WebXRNearControllerMode;(function (WebXRNearControllerMode) {WebXRNearControllerMode[WebXRNearControllerMode.DISABLED = 0] = "DISABLED", WebXRNearControllerMode[WebXRNearControllerMode.CENTERED_ON_CONTROLLER = 1] = "CENTERED_ON_CONTROLLER", WebXRNearControllerMode[WebXRNearControllerMode.CENTERED_IN_FRONT = 2] = "CENTERED_IN_FRONT";})(WebXRNearControllerMode || (WebXRNearControllerMode = {}));class WebXRNearInteraction extends WebXRAbstractFeature {constructor(_xrSessionManager, _options) {super(_xrSessionManager), this._options = _options, this._tmpRay = new Ray(new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P()), this._attachController = (xrController) => {if (this._controllers[xrController.uniqueId]) return;const { touchCollisionMesh, touchCollisionMeshFunction, hydrateCollisionMeshFunction } = this._generateNewTouchPointMesh(),selectionMesh = this._generateVisualCue();switch (this._controllers[xrController.uniqueId] = { xrController, meshUnderPointer: null, nearInteractionTargetMesh: null, pick: null, stalePick: null, touchCollisionMesh, touchCollisionMeshFunction: touchCollisionMeshFunction, hydrateCollisionMeshFunction: hydrateCollisionMeshFunction, currentAnimationState: ControllerOrbAnimationState.DEHYDRATED, grabRay: new Ray(new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P()), hoverInteraction: !1, nearInteraction: !1, grabInteraction: !1, id: WebXRNearInteraction._IdCounter++, pickedPointVisualCue: selectionMesh }, this._attachedController ? !this._options.enableNearInteractionOnAllControllers && this._options.preferredHandedness && xrController.inputSource.handedness === this._options.preferredHandedness && (this._attachedController = xrController.uniqueId) : !this._options.enableNearInteractionOnAllControllers && (this._attachedController = xrController.uniqueId), xrController.inputSource.targetRayMode) {case "tracked-pointer":return this._attachNearInteractionMode(xrController);case "gaze":return null;case "screen":return null;}}, this._controllers = {}, this._farInteractionFeature = null, this.selectionMeshDefaultColor = new math_color/* Color3 */.Wo(.8, .8, .8), this.selectionMeshPickedColor = new math_color/* Color3 */.Wo(.3, .3, 1), this._hoverRadius = .1, this._pickRadius = .02, this._controllerPickRadius = .03, this._nearGrabLengthScale = 5, this._scene = this._xrSessionManager.scene, this._options.nearInteractionControllerMode === void 0 && (this._options.nearInteractionControllerMode = WebXRNearControllerMode.CENTERED_IN_FRONT), this._options.farInteractionFeature && (this._farInteractionFeature = this._options.farInteractionFeature);}attach() {return !!super.attach() && (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (controller) => {this._detachController(controller.uniqueId);}), this._scene.constantlyUpdateMeshUnderPointer = !0, !0);}detach() {return !!super.detach() && (Object.keys(this._controllers).forEach((controllerId) => {this._detachController(controllerId);}), !0);}getMeshUnderPointer(controllerId) {return this._controllers[controllerId] ? this._controllers[controllerId].meshUnderPointer : null;}getXRControllerByPointerId(id) {const keys = Object.keys(this._controllers);for (let i = 0; i < keys.length; ++i) if (this._controllers[keys[i]].id === id) return this._controllers[keys[i]].xrController || null;return null;}setFarInteractionFeature(farInteractionFeature) {this._farInteractionFeature = farInteractionFeature;}_nearPickPredicate(mesh) {return mesh.isEnabled() && mesh.isVisible && mesh.isPickable && mesh.isNearPickable;}_nearGrabPredicate(mesh) {return mesh.isEnabled() && mesh.isVisible && mesh.isPickable && mesh.isNearGrabbable;}_nearInteractionPredicate(mesh) {return mesh.isEnabled() && mesh.isVisible && mesh.isPickable && (mesh.isNearPickable || mesh.isNearGrabbable);}_controllerAvailablePredicate(mesh, controllerId) {for (let parent = mesh; parent;) {if (parent.reservedDataStore && parent.reservedDataStore.nearInteraction && parent.reservedDataStore.nearInteraction.excludedControllerId === controllerId) return !1;parent = parent.parent;}return !0;}_handleTransitionAnimation(controllerData, newState) {var _a;if (controllerData.currentAnimationState !== newState && this._options.nearInteractionControllerMode === WebXRNearControllerMode.CENTERED_IN_FRONT && (null === (_a = controllerData.xrController) || void 0 === _a || !_a.inputSource.hand)) {if (newState > controllerData.currentAnimationState) switch (controllerData.currentAnimationState) {case ControllerOrbAnimationState.DEHYDRATED:if (controllerData.hydrateCollisionMeshFunction(!0), newState === ControllerOrbAnimationState.HOVER) break;case ControllerOrbAnimationState.HOVER:if (controllerData.touchCollisionMeshFunction(!0), newState === ControllerOrbAnimationState.TOUCH) break;} else switch (controllerData.currentAnimationState) {case ControllerOrbAnimationState.TOUCH:if (controllerData.touchCollisionMeshFunction(!1), newState === ControllerOrbAnimationState.HOVER) break;case ControllerOrbAnimationState.HOVER:if (controllerData.hydrateCollisionMeshFunction(!1), newState === ControllerOrbAnimationState.DEHYDRATED) break;}controllerData.currentAnimationState = newState;}}_processTouchPoint(id, position, orientation) {var _a;const controllerData = this._controllers[id];controllerData.grabRay.origin.copyFrom(position), orientation.toEulerAnglesToRef(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]), controllerData.grabRay.direction.copyFrom(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]), this._options.nearInteractionControllerMode !== WebXRNearControllerMode.CENTERED_IN_FRONT || (null === (_a = controllerData.xrController) || void 0 === _a ? void 0 : _a.inputSource.hand) || (controllerData.xrController.getWorldPointerRayToRef(this._tmpRay), controllerData.grabRay.origin.addInPlace(this._tmpRay.direction.scale(.05))), controllerData.grabRay.length = this._nearGrabLengthScale * this._hoverRadius, controllerData.touchCollisionMesh.position.copyFrom(controllerData.grabRay.origin);}_onXRFrame(_xrFrame) {Object.keys(this._controllers).forEach((id) => {var _a;const controllerData = this._controllers[id],handData = null === (_a = controllerData.xrController) || void 0 === _a ? void 0 : _a.inputSource.hand;if (!this._options.enableNearInteractionOnAllControllers && id !== this._attachedController || !controllerData.xrController || !handData && (!this._options.nearInteractionControllerMode || !controllerData.xrController.inputSource.gamepad)) return void (controllerData.pick = null);if (controllerData.hoverInteraction = !1, controllerData.nearInteraction = !1, !controllerData.xrController) return;if (handData) {const xrIndexTip = handData.get("index-finger-tip");if (xrIndexTip) {const indexTipPose = _xrFrame.getJointPose(xrIndexTip, this._xrSessionManager.referenceSpace);if (indexTipPose && indexTipPose.transform) {const axisRHSMultiplier = this._scene.useRightHandedSystem ? 1 : -1;math_vector/* TmpVectors.Vector3.0.set */.jp.Vector3[0].set(indexTipPose.transform.position.x, indexTipPose.transform.position.y, indexTipPose.transform.position.z * axisRHSMultiplier), math_vector/* TmpVectors.Quaternion.0.set */.jp.Quaternion[0].set(indexTipPose.transform.orientation.x, indexTipPose.transform.orientation.y, indexTipPose.transform.orientation.z * axisRHSMultiplier, indexTipPose.transform.orientation.w * axisRHSMultiplier), this._processTouchPoint(id, math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0], math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0]);}}} else if (controllerData.xrController.inputSource.gamepad && this._options.nearInteractionControllerMode !== WebXRNearControllerMode.DISABLED) {let controllerPose = controllerData.xrController.pointer;controllerData.xrController.grip && this._options.nearInteractionControllerMode === WebXRNearControllerMode.CENTERED_ON_CONTROLLER && (controllerPose = controllerData.xrController.grip), this._processTouchPoint(id, controllerPose.position, controllerPose.rotationQuaternion);}const accuratePickInfo = (originalScenePick, utilityScenePick) => {let pick = null;return pick = utilityScenePick && utilityScenePick.hit ? originalScenePick && originalScenePick.hit ? utilityScenePick.distance < originalScenePick.distance ? utilityScenePick : originalScenePick : utilityScenePick : originalScenePick, pick;},populateNearInteractionInfo = (nearInteractionInfo) => {let result = new Collisions_pickingInfo/* PickingInfo */.p(),nearInteractionAtOrigin = !1;const nearInteraction = nearInteractionInfo && nearInteractionInfo.pickedPoint && nearInteractionInfo.hit;return (null === nearInteractionInfo || void 0 === nearInteractionInfo ? void 0 : nearInteractionInfo.pickedPoint) && (nearInteractionAtOrigin = 0 === nearInteractionInfo.pickedPoint.x && 0 === nearInteractionInfo.pickedPoint.y && 0 === nearInteractionInfo.pickedPoint.z), nearInteraction && !nearInteractionAtOrigin && (result = nearInteractionInfo), result;};if (!controllerData.grabInteraction) {let pick = null,utilitySceneHoverPick = null;this._options.useUtilityLayer && this._utilityLayerScene && (utilitySceneHoverPick = this._pickWithSphere(controllerData, this._hoverRadius, this._utilityLayerScene, (mesh) => this._nearInteractionPredicate(mesh)));const originalSceneHoverPick = this._pickWithSphere(controllerData, this._hoverRadius, this._scene, (mesh) => this._nearInteractionPredicate(mesh)),hoverPickInfo = accuratePickInfo(originalSceneHoverPick, utilitySceneHoverPick);if (hoverPickInfo && hoverPickInfo.hit && (pick = populateNearInteractionInfo(hoverPickInfo), pick.hit && (controllerData.hoverInteraction = !0)), controllerData.hoverInteraction) {let utilitySceneNearPick = null;const radius = handData ? this._pickRadius : this._controllerPickRadius;this._options.useUtilityLayer && this._utilityLayerScene && (utilitySceneNearPick = this._pickWithSphere(controllerData, radius, this._utilityLayerScene, (mesh) => this._nearPickPredicate(mesh)));const originalSceneNearPick = this._pickWithSphere(controllerData, radius, this._scene, (mesh) => this._nearPickPredicate(mesh)),pickInfo = accuratePickInfo(originalSceneNearPick, utilitySceneNearPick),nearPick = populateNearInteractionInfo(pickInfo);nearPick.hit && (pick = nearPick, controllerData.nearInteraction = !0);}controllerData.stalePick = controllerData.pick, controllerData.pick = pick, controllerData.pick && controllerData.pick.pickedPoint && controllerData.pick.hit ? (controllerData.meshUnderPointer = controllerData.pick.pickedMesh, controllerData.pickedPointVisualCue.position.copyFrom(controllerData.pick.pickedPoint), controllerData.pickedPointVisualCue.isVisible = !0, this._farInteractionFeature && this._farInteractionFeature.attached && this._farInteractionFeature._setPointerSelectionDisabledByPointerId(controllerData.id, !0)) : (controllerData.meshUnderPointer = null, controllerData.pickedPointVisualCue.isVisible = !1, this._farInteractionFeature && this._farInteractionFeature.attached && this._farInteractionFeature._setPointerSelectionDisabledByPointerId(controllerData.id, !1));}let state = ControllerOrbAnimationState.DEHYDRATED;controllerData.grabInteraction || controllerData.nearInteraction ? state = ControllerOrbAnimationState.TOUCH : controllerData.hoverInteraction && (state = ControllerOrbAnimationState.HOVER), this._handleTransitionAnimation(controllerData, state);});}get _utilityLayerScene() {return this._options.customUtilityLayerScene || UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene;}_generateVisualCue() {const sceneToRenderTo = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene : this._scene,selectionMesh = CreateSphere("nearInteraction", { diameter: .0035 * 3 }, sceneToRenderTo);selectionMesh.bakeCurrentTransformIntoVertices(), selectionMesh.isPickable = !1, selectionMesh.isVisible = !1, selectionMesh.rotationQuaternion = math_vector/* Quaternion.Identity */._f.Identity();const targetMat = new standardMaterial/* StandardMaterial */.K("targetMat", sceneToRenderTo);return targetMat.specularColor = math_color/* Color3.Black */.Wo.Black(), targetMat.emissiveColor = this.selectionMeshDefaultColor, targetMat.backFaceCulling = !1, selectionMesh.material = targetMat, selectionMesh;}_isControllerReadyForNearInteraction(id) {return !this._farInteractionFeature || this._farInteractionFeature._getPointerSelectionDisabledByPointerId(id);}_attachNearInteractionMode(xrController) {const controllerData = this._controllers[xrController.uniqueId],pointerEventInit = { pointerId: controllerData.id, pointerType: "xr-near" };controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {(this._options.enableNearInteractionOnAllControllers || xrController.uniqueId === this._attachedController) && controllerData.xrController && (controllerData.xrController.inputSource.hand || this._options.nearInteractionControllerMode && controllerData.xrController.inputSource.gamepad) && (controllerData.pick && (controllerData.pick.ray = controllerData.grabRay), controllerData.pick && this._isControllerReadyForNearInteraction(controllerData.id) && this._scene.simulatePointerMove(controllerData.pick, pointerEventInit), controllerData.nearInteraction && controllerData.pick && controllerData.pick.hit ? !controllerData.nearInteractionTargetMesh && (this._scene.simulatePointerDown(controllerData.pick, pointerEventInit), controllerData.nearInteractionTargetMesh = controllerData.meshUnderPointer) : controllerData.nearInteractionTargetMesh && controllerData.stalePick && (this._scene.simulatePointerUp(controllerData.stalePick, pointerEventInit), controllerData.nearInteractionTargetMesh = null));});const grabCheck = (pressed) => {this._options.enableNearInteractionOnAllControllers || xrController.uniqueId === this._attachedController && this._isControllerReadyForNearInteraction(controllerData.id) ? (controllerData.pick && (controllerData.pick.ray = controllerData.grabRay), pressed && controllerData.pick && controllerData.meshUnderPointer && this._nearGrabPredicate(controllerData.meshUnderPointer) ? (controllerData.grabInteraction = !0, controllerData.pickedPointVisualCue.isVisible = !1, this._scene.simulatePointerDown(controllerData.pick, pointerEventInit)) : !pressed && controllerData.pick && controllerData.grabInteraction && (this._scene.simulatePointerUp(controllerData.pick, pointerEventInit), controllerData.grabInteraction = !1, controllerData.pickedPointVisualCue.isVisible = !0)) : pressed && !this._options.enableNearInteractionOnAllControllers && !this._options.disableSwitchOnClick && (this._attachedController = xrController.uniqueId);};if (xrController.inputSource.gamepad) {const init = (motionController) => {controllerData.squeezeComponent = motionController.getComponent("grasp"), controllerData.squeezeComponent ? controllerData.onSqueezeButtonChangedObserver = controllerData.squeezeComponent.onButtonStateChangedObservable.add((component) => {if (component.changes.pressed) {const pressed = component.changes.pressed.current;grabCheck(pressed);}}) : (controllerData.selectionComponent = motionController.getMainComponent(), controllerData.onButtonChangedObserver = controllerData.selectionComponent.onButtonStateChangedObservable.add((component) => {if (component.changes.pressed) {const pressed = component.changes.pressed.current;grabCheck(pressed);}}));};xrController.motionController ? init(xrController.motionController) : xrController.onMotionControllerInitObservable.add(init);} else {const selectStartListener = (event) => {controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick && this._isControllerReadyForNearInteraction(controllerData.id) && controllerData.meshUnderPointer && this._nearGrabPredicate(controllerData.meshUnderPointer) && (controllerData.grabInteraction = !0, controllerData.pickedPointVisualCue.isVisible = !1, this._scene.simulatePointerDown(controllerData.pick, pointerEventInit));},selectEndListener = (event) => {controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick && this._isControllerReadyForNearInteraction(controllerData.id) && (this._scene.simulatePointerUp(controllerData.pick, pointerEventInit), controllerData.grabInteraction = !1, controllerData.pickedPointVisualCue.isVisible = !0);};controllerData.eventListeners = { selectend: selectEndListener, selectstart: selectStartListener }, this._xrSessionManager.session.addEventListener("selectstart", selectStartListener), this._xrSessionManager.session.addEventListener("selectend", selectEndListener);}}_detachController(xrControllerUniqueId) {const controllerData = this._controllers[xrControllerUniqueId];if (controllerData && (controllerData.squeezeComponent && controllerData.onSqueezeButtonChangedObserver && controllerData.squeezeComponent.onButtonStateChangedObservable.remove(controllerData.onSqueezeButtonChangedObserver), controllerData.selectionComponent && controllerData.onButtonChangedObserver && controllerData.selectionComponent.onButtonStateChangedObservable.remove(controllerData.onButtonChangedObserver), controllerData.onFrameObserver && this._xrSessionManager.onXRFrameObservable.remove(controllerData.onFrameObserver), controllerData.eventListeners && Object.keys(controllerData.eventListeners).forEach((eventName) => {const func = controllerData.eventListeners && controllerData.eventListeners[eventName];func && this._xrSessionManager.session.removeEventListener(eventName, func);}), controllerData.touchCollisionMesh.dispose(), controllerData.pickedPointVisualCue.dispose(), this._xrSessionManager.runInXRFrame(() => {const pointerEventInit = { pointerId: controllerData.id, pointerType: "xr-near" };this._scene.simulatePointerUp(new Collisions_pickingInfo/* PickingInfo */.p(), pointerEventInit);}), delete this._controllers[xrControllerUniqueId], this._attachedController === xrControllerUniqueId)) {const keys = Object.keys(this._controllers);this._attachedController = keys.length ? keys[0] : "";}}_generateNewTouchPointMesh() {const meshCreationScene = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene : this._scene,touchCollisionMesh = CreateSphere("PickSphere", { diameter: 1 }, meshCreationScene);touchCollisionMesh.isVisible = !1, this._options.motionControllerOrbMaterial ? touchCollisionMesh.material = this._options.motionControllerOrbMaterial : NodeMaterial.ParseFromSnippetAsync("8RUNKL#3", meshCreationScene).then((nodeMaterial) => {touchCollisionMesh.material = nodeMaterial;});const easingFunction = new QuadraticEase();easingFunction.setEasingMode(EasingFunction.EASINGMODE_EASEINOUT);const hoverSizeVec = new math_vector/* Vector3 */.P(this._controllerPickRadius, this._controllerPickRadius, this._controllerPickRadius),touchSize = this._controllerPickRadius * (4 / 3),touchSizeVec = new math_vector/* Vector3 */.P(touchSize, touchSize, touchSize),hydrateTransitionSize = this._controllerPickRadius * (7 / 6),hydrateTransitionSizeVec = new math_vector/* Vector3 */.P(hydrateTransitionSize, hydrateTransitionSize, hydrateTransitionSize),touchHoverTransitionSize = this._controllerPickRadius * (4 / 5),touchHoverTransitionSizeVec = new math_vector/* Vector3 */.P(touchHoverTransitionSize, touchHoverTransitionSize, touchHoverTransitionSize),hoverTouchTransitionSize = this._controllerPickRadius * (3 / 2),hoverTouchTransitionSizeVec = new math_vector/* Vector3 */.P(hoverTouchTransitionSize, hoverTouchTransitionSize, hoverTouchTransitionSize),hydrateKeys = [{ frame: 0, value: math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly }, { frame: 12, value: hydrateTransitionSizeVec }, { frame: 15, value: hoverSizeVec }],dehydrateKeys = [{ frame: 0, value: hoverSizeVec }, { frame: 10, value: math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly }, { frame: 15, value: math_vector/* Vector3.ZeroReadOnly */.P.ZeroReadOnly }],touchAction = new Animations_animation/* Animation */.f("touch", "scaling", 60, Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT),releaseAction = new Animations_animation/* Animation */.f("release", "scaling", 60, Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT),hydrateAction = new Animations_animation/* Animation */.f("hydrate", "scaling", 60, Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT),dehydrateAction = new Animations_animation/* Animation */.f("dehydrate", "scaling", 60, Animations_animation/* Animation.ANIMATIONTYPE_VECTOR3 */.f.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation.ANIMATIONLOOPMODE_CONSTANT */.f.ANIMATIONLOOPMODE_CONSTANT);touchAction.setEasingFunction(easingFunction), releaseAction.setEasingFunction(easingFunction), hydrateAction.setEasingFunction(easingFunction), dehydrateAction.setEasingFunction(easingFunction), touchAction.setKeys([{ frame: 0, value: hoverSizeVec }, { frame: 10, value: hoverTouchTransitionSizeVec }, { frame: 18, value: touchSizeVec }]), releaseAction.setKeys([{ frame: 0, value: touchSizeVec }, { frame: 10, value: touchHoverTransitionSizeVec }, { frame: 18, value: hoverSizeVec }]), hydrateAction.setKeys(hydrateKeys), dehydrateAction.setKeys(dehydrateKeys);return { touchCollisionMesh, touchCollisionMeshFunction: (isTouch) => {const action = isTouch ? touchAction : releaseAction;meshCreationScene.beginDirectAnimation(touchCollisionMesh, [action], 0, 18, !1, 1);}, hydrateCollisionMeshFunction: (isHydration) => {const action = isHydration ? hydrateAction : dehydrateAction;isHydration && (touchCollisionMesh.isVisible = !0), meshCreationScene.beginDirectAnimation(touchCollisionMesh, [action], 0, 15, !1, 1, () => {isHydration || (touchCollisionMesh.isVisible = !1);});} };}_pickWithSphere(controllerData, radius, sceneToUse, predicate) {const pickingInfo = new Collisions_pickingInfo/* PickingInfo */.p();if (pickingInfo.distance = +Infinity, controllerData.touchCollisionMesh && controllerData.xrController) {const position = controllerData.touchCollisionMesh.position,sphere = boundingSphere/* BoundingSphere.CreateFromCenterAndRadius */.K.CreateFromCenterAndRadius(position, radius);for (let meshIndex = 0; meshIndex < sceneToUse.meshes.length; meshIndex++) {const mesh = sceneToUse.meshes[meshIndex];if (!predicate(mesh) || !this._controllerAvailablePredicate(mesh, controllerData.xrController.uniqueId)) continue;const result = WebXRNearInteraction.PickMeshWithSphere(mesh, sphere);result && result.hit && result.distance < pickingInfo.distance && (pickingInfo.hit = result.hit, pickingInfo.pickedMesh = mesh, pickingInfo.pickedPoint = result.pickedPoint, pickingInfo.aimTransform = controllerData.xrController.pointer, pickingInfo.gripTransform = controllerData.xrController.grip || null, pickingInfo.originMesh = controllerData.touchCollisionMesh, pickingInfo.distance = result.distance);}}return pickingInfo;}static PickMeshWithSphere(mesh, sphere, skipBoundingInfo = !1) {const subMeshes = mesh.subMeshes,pi = new Collisions_pickingInfo/* PickingInfo */.p(),boundingInfo = mesh.getBoundingInfo();if (!mesh._generatePointsArray()) return pi;if (!mesh.subMeshes || !boundingInfo) return pi;if (!skipBoundingInfo && !boundingSphere/* BoundingSphere.Intersects */.K.Intersects(boundingInfo.boundingSphere, sphere)) return pi;const result = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],tmpVec = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];let tmp,tmpDistanceSphereToCenter,tmpDistanceSurfaceToCenter,distance = +Infinity;const center = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],worldToMesh = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];worldToMesh.copyFrom(mesh.getWorldMatrix()), worldToMesh.invert(), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(sphere.center, worldToMesh, center);for (let index = 0; index < subMeshes.length; index++) {const subMesh = subMeshes[index];subMesh.projectToRef(center, mesh._positions, mesh.getIndices(), tmpVec), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(tmpVec, mesh.getWorldMatrix(), tmpVec), tmp = math_vector/* Vector3.Distance */.P.Distance(tmpVec, sphere.center), tmpDistanceSurfaceToCenter = math_vector/* Vector3.Distance */.P.Distance(tmpVec, mesh.getAbsolutePosition()), tmpDistanceSphereToCenter = math_vector/* Vector3.Distance */.P.Distance(sphere.center, mesh.getAbsolutePosition()), -1 !== tmpDistanceSphereToCenter && -1 !== tmpDistanceSurfaceToCenter && tmpDistanceSurfaceToCenter > tmpDistanceSphereToCenter && (tmp = 0, tmpVec.copyFrom(sphere.center)), -1 !== tmp && tmp < distance && (distance = tmp, result.copyFrom(tmpVec));}return distance < sphere.radius && (pi.hit = !0, pi.distance = distance, pi.pickedMesh = mesh, pi.pickedPoint = result.clone()), pi;}}WebXRNearInteraction._IdCounter = 200, WebXRNearInteraction.Name = WebXRFeatureName.NEAR_INTERACTION, WebXRNearInteraction.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRNearInteraction.Name, (xrSessionManager, options) => () => new WebXRNearInteraction(xrSessionManager, options), WebXRNearInteraction.Version, !0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXREnterExitUI.js
class WebXREnterExitUIButton {constructor(element, sessionMode, referenceSpaceType) {this.element = element, this.sessionMode = sessionMode, this.referenceSpaceType = referenceSpaceType;}update() {}}class WebXREnterExitUIOptions {}class WebXREnterExitUI {constructor(_scene, options) {if (this._scene = _scene, this.options = options, this._activeButton = null, this._buttons = [], this.activeButtonChangedObservable = new observable/* Observable */.y$(), this._onSessionGranted = () => {this._helper && this._enterXRWithButtonIndex(0);}, this.overlay = document.createElement("div"), this.overlay.classList.add("xr-button-overlay"), !options.ignoreSessionGrantedEvent && navigator.xr && navigator.xr.addEventListener("sessiongranted", this._onSessionGranted), "undefined" != typeof window && window.location && "http:" === window.location.protocol && "localhost" !== window.location.hostname) throw tools/* Tools.Warn */.w1.Warn("WebXR can only be served over HTTPS"), new Error("WebXR can only be served over HTTPS");if (options.customButtons) this._buttons = options.customButtons;else {this.overlay.style.cssText = "z-index:11;position: absolute; right: 20px;bottom: 50px;";const sessionMode = options.sessionMode || "immersive-vr",referenceSpaceType = options.referenceSpaceType || "local-floor",url = "undefined" == typeof SVGSVGElement ? "https://cdn.babylonjs.com/Assets/vrButton.png" : "data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A";let css = ".babylonVRicon { color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(" + url + "); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";css += ".babylonVRicon.vrdisplaypresenting { background-image: none;} .vrdisplaypresenting::after { content: \"EXIT\"} .xr-error::after { content: \"ERROR\"}";const style = document.createElement("style");style.appendChild(document.createTextNode(css)), document.getElementsByTagName("head")[0].appendChild(style);const hmdBtn = document.createElement("button");hmdBtn.className = "babylonVRicon", hmdBtn.title = `${sessionMode} - ${referenceSpaceType}`, this._buttons.push(new WebXREnterExitUIButton(hmdBtn, sessionMode, referenceSpaceType)), this._buttons[this._buttons.length - 1].update = function (activeButton) {this.element.style.display = null === activeButton || activeButton === this ? "" : "none", hmdBtn.className = "babylonVRicon" + (activeButton === this ? " vrdisplaypresenting" : "");}, this._updateButtons(null);}const renderCanvas = _scene.getEngine().getInputElement();renderCanvas && renderCanvas.parentNode && (renderCanvas.parentNode.appendChild(this.overlay), _scene.onDisposeObservable.addOnce(() => {this.dispose();}));}async setHelperAsync(helper, renderTarget) {this._helper = helper, this._renderTarget = renderTarget;const supportedPromises = this._buttons.map((btn) => helper.sessionManager.isSessionSupportedAsync(btn.sessionMode));helper.onStateChangedObservable.add((state) => {state == WebXRState.NOT_IN_XR && this._updateButtons(null);});const results = await Promise.all(supportedPromises);results.forEach((supported, i) => {supported ? (this.overlay.appendChild(this._buttons[i].element), this._buttons[i].element.onclick = this._enterXRWithButtonIndex.bind(this, i)) : tools/* Tools.Warn */.w1.Warn(`Session mode "${this._buttons[i].sessionMode}" not supported in browser`);});}static async CreateAsync(scene, helper, options) {const ui = new WebXREnterExitUI(scene, options);return await ui.setHelperAsync(helper, options.renderTarget || void 0), ui;}async _enterXRWithButtonIndex(idx = 0) {if (this._helper.state == WebXRState.IN_XR) await this._helper.exitXRAsync(), this._updateButtons(null);else if (this._helper.state == WebXRState.NOT_IN_XR) try {await this._helper.enterXRAsync(this._buttons[idx].sessionMode, this._buttons[idx].referenceSpaceType, this._renderTarget, { optionalFeatures: this.options.optionalFeatures, requiredFeatures: this.options.requiredFeatures }), this._updateButtons(this._buttons[idx]);} catch (e) {this._updateButtons(null);const element = this._buttons[idx].element,prevTitle = element.title;element.title = "Error entering XR session : " + prevTitle, element.classList.add("xr-error"), this.options.onError && this.options.onError(e);}}dispose() {const renderCanvas = this._scene.getEngine().getInputElement();renderCanvas && renderCanvas.parentNode && renderCanvas.parentNode.contains(this.overlay) && renderCanvas.parentNode.removeChild(this.overlay), this.activeButtonChangedObservable.clear(), navigator.xr.removeEventListener("sessiongranted", this._onSessionGranted);}_updateButtons(activeButton) {this._activeButton = activeButton, this._buttons.forEach((b) => {b.update(this._activeButton);}), this.activeButtonChangedObservable.notifyObservers(this._activeButton);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/timer.js
var TimerState;(function (TimerState) {TimerState[TimerState.INIT = 0] = "INIT", TimerState[TimerState.STARTED = 1] = "STARTED", TimerState[TimerState.ENDED = 2] = "ENDED";})(TimerState || (TimerState = {}));function setAndStartTimer(options) {var _a;let timer = 0;const startTime = Date.now();options.observableParameters = null !== (_a = options.observableParameters) && void 0 !== _a ? _a : {};const observer = options.contextObservable.add((payload) => {const now = Date.now();timer = now - startTime;const data = { startTime, currentTime: now, deltaTime: timer, completeRate: timer / options.timeout, payload };options.onTick && options.onTick(data), options.breakCondition && options.breakCondition() && (options.contextObservable.remove(observer), options.onAborted && options.onAborted(data)), timer >= options.timeout && (options.contextObservable.remove(observer), options.onEnded && options.onEnded(data));}, options.observableParameters.mask, options.observableParameters.insertFirst, options.observableParameters.scope);return observer;}class AdvancedTimer {constructor(options) {var _a, _b;this.onEachCountObservable = new observable/* Observable */.y$(), this.onTimerAbortedObservable = new observable/* Observable */.y$(), this.onTimerEndedObservable = new observable/* Observable */.y$(), this.onStateChangedObservable = new observable/* Observable */.y$(), this._observer = null, this._breakOnNextTick = !1, this._tick = (payload) => {const now = Date.now();this._timer = now - this._startTime;const data = { startTime: this._startTime, currentTime: now, deltaTime: this._timer, completeRate: this._timer / this._timeToEnd, payload },shouldBreak = this._breakOnNextTick || this._breakCondition(data);shouldBreak || this._timer >= this._timeToEnd ? this._stop(data, shouldBreak) : this.onEachCountObservable.notifyObservers(data);}, this._setState(TimerState.INIT), this._contextObservable = options.contextObservable, this._observableParameters = null !== (_a = options.observableParameters) && void 0 !== _a ? _a : {}, this._breakCondition = null !== (_b = options.breakCondition) && void 0 !== _b ? _b : () => !1, this._timeToEnd = options.timeout, options.onEnded && this.onTimerEndedObservable.add(options.onEnded), options.onTick && this.onEachCountObservable.add(options.onTick), options.onAborted && this.onTimerAbortedObservable.add(options.onAborted);}set breakCondition(predicate) {this._breakCondition = predicate;}clearObservables() {this.onEachCountObservable.clear(), this.onTimerAbortedObservable.clear(), this.onTimerEndedObservable.clear(), this.onStateChangedObservable.clear();}start(timeToEnd = this._timeToEnd) {if (this._state === TimerState.STARTED) throw new Error("Timer already started. Please stop it before starting again");this._timeToEnd = timeToEnd, this._startTime = Date.now(), this._timer = 0, this._observer = this._contextObservable.add(this._tick, this._observableParameters.mask, this._observableParameters.insertFirst, this._observableParameters.scope), this._setState(TimerState.STARTED);}stop() {this._state !== TimerState.STARTED || (this._breakOnNextTick = !0);}dispose() {this._observer && this._contextObservable.remove(this._observer), this.clearObservables();}_setState(newState) {this._state = newState, this.onStateChangedObservable.notifyObservers(this._state);}_stop(data, aborted = !1) {this._contextObservable.remove(this._observer), this._setState(TimerState.ENDED), aborted ? this.onTimerAbortedObservable.notifyObservers(data) : this.onTimerEndedObservable.notifyObservers(data);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRControllerTeleportation.js
class WebXRMotionControllerTeleportation extends WebXRAbstractFeature {get rotationEnabled() {return this._rotationEnabled;}set rotationEnabled(enabled) {if (this._rotationEnabled = enabled, this._options.teleportationTargetMesh) {const children = this._options.teleportationTargetMesh.getChildMeshes(!1, (node) => "rotationCone" === node.name);children[0] && children[0].setEnabled(enabled);}}get teleportationTargetMesh() {return this._options.teleportationTargetMesh || null;}constructor(_xrSessionManager, _options) {super(_xrSessionManager), this._options = _options, this._controllers = {}, this._snappedToPoint = !1, this._tmpRay = new Ray(new math_vector/* Vector3 */.P(), new math_vector/* Vector3 */.P()), this._tmpVector = new math_vector/* Vector3 */.P(), this._tmpQuaternion = new math_vector/* Quaternion */._f(), this.skipNextTeleportation = !1, this.backwardsMovementEnabled = !0, this.backwardsTeleportationDistance = .7, this.parabolicCheckRadius = 5, this.parabolicRayEnabled = !0, this.straightRayEnabled = !0, this.rotationAngle = Math.PI / 8, this.onTargetMeshPositionUpdatedObservable = new observable/* Observable */.y$(), this.teleportationEnabled = !0, this._rotationEnabled = !0, this._attachController = (xrController) => {if (this._controllers[xrController.uniqueId] || this._options.forceHandedness && xrController.inputSource.handedness !== this._options.forceHandedness) return;this._controllers[xrController.uniqueId] = { xrController, teleportationState: { forward: !1, backwards: !1, rotating: !1, currentRotation: 0, baseRotation: 0 } };const controllerData = this._controllers[xrController.uniqueId];if ("tracked-pointer" === controllerData.xrController.inputSource.targetRayMode && controllerData.xrController.inputSource.gamepad) {const initMotionController = () => {if (xrController.motionController) {const movementController = xrController.motionController.getComponentOfType(WebXRControllerComponent.THUMBSTICK_TYPE) || xrController.motionController.getComponentOfType(WebXRControllerComponent.TOUCHPAD_TYPE);if (!movementController || this._options.useMainComponentOnly) {const mainComponent = xrController.motionController.getMainComponent();if (!mainComponent) return;controllerData.teleportationComponent = mainComponent, controllerData.onButtonChangedObserver = mainComponent.onButtonStateChangedObservable.add(() => {if (this.teleportationEnabled && mainComponent.changes.pressed) if (mainComponent.changes.pressed.current) {controllerData.teleportationState.forward = !0, this._currentTeleportationControllerId = controllerData.xrController.uniqueId, controllerData.teleportationState.baseRotation = this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y, controllerData.teleportationState.currentRotation = 0;const timeToSelect = this._options.timeToTeleport || 3e3;setAndStartTimer({ timeout: timeToSelect, contextObservable: this._xrSessionManager.onXRFrameObservable, breakCondition: () => !mainComponent.pressed, onEnded: () => {this._currentTeleportationControllerId === controllerData.xrController.uniqueId && controllerData.teleportationState.forward && this._teleportForward(xrController.uniqueId);} });} else controllerData.teleportationState.forward = !1, this._currentTeleportationControllerId = "";});} else controllerData.teleportationComponent = movementController, controllerData.onAxisChangedObserver = movementController.onAxisValueChangedObservable.add((axesData) => {if (.7 >= axesData.y && controllerData.teleportationState.backwards && (controllerData.teleportationState.backwards = !1), .7 < axesData.y && !controllerData.teleportationState.forward && this.backwardsMovementEnabled && !this.snapPointsOnly && !controllerData.teleportationState.backwards) {controllerData.teleportationState.backwards = !0, this._tmpQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion), this._tmpQuaternion.toEulerAnglesToRef(this._tmpVector), this._tmpVector.x = 0, this._tmpVector.z = 0, math_vector/* Quaternion.FromEulerVectorToRef */._f.FromEulerVectorToRef(this._tmpVector, this._tmpQuaternion), this._tmpVector.set(0, 0, this.backwardsTeleportationDistance * (this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1)), this._tmpVector.rotateByQuaternionToRef(this._tmpQuaternion, this._tmpVector), this._tmpVector.addInPlace(this._options.xrInput.xrCamera.position), this._tmpRay.origin.copyFrom(this._tmpVector), this._tmpRay.length = this._options.xrInput.xrCamera.realWorldHeight + .1, this._tmpRay.direction.set(0, -1, 0);const pick = this._xrSessionManager.scene.pickWithRay(this._tmpRay, (o) => -1 !== this._floorMeshes.indexOf(o));pick && pick.pickedPoint && (this._options.xrInput.xrCamera.position.x = pick.pickedPoint.x, this._options.xrInput.xrCamera.position.z = pick.pickedPoint.z);}if (-.7 > axesData.y && !this._currentTeleportationControllerId && !controllerData.teleportationState.rotating && this.teleportationEnabled && (controllerData.teleportationState.forward = !0, this._currentTeleportationControllerId = controllerData.xrController.uniqueId, controllerData.teleportationState.baseRotation = this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y), !axesData.x) controllerData.teleportationState.rotating = !1;else if (!!controllerData.teleportationState.forward) this._currentTeleportationControllerId === controllerData.xrController.uniqueId && (this.rotationEnabled ? setTimeout(() => {controllerData.teleportationState.currentRotation = Math.atan2(axesData.x, axesData.y * (this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1));}) : controllerData.teleportationState.currentRotation = 0);else if (!controllerData.teleportationState.rotating && .7 < Math.abs(axesData.x)) {controllerData.teleportationState.rotating = !0;const rotation = this.rotationAngle * (0 < axesData.x ? 1 : -1) * (this._xrSessionManager.scene.useRightHandedSystem ? -1 : 1);math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(0, rotation, 0).multiplyToRef(this._options.xrInput.xrCamera.rotationQuaternion, this._options.xrInput.xrCamera.rotationQuaternion);}0 === axesData.x && 0 === axesData.y && controllerData.teleportationState.forward && this._teleportForward(xrController.uniqueId);});}};xrController.motionController ? initMotionController() : xrController.onMotionControllerInitObservable.addOnce(() => {initMotionController();});} else this._xrSessionManager.scene.onPointerObservable.add((pointerInfo) => {if (pointerInfo.type === pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN) {controllerData.teleportationState.forward = !0, this._currentTeleportationControllerId = controllerData.xrController.uniqueId, controllerData.teleportationState.baseRotation = this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y, controllerData.teleportationState.currentRotation = 0;const timeToSelect = this._options.timeToTeleport || 3e3;setAndStartTimer({ timeout: timeToSelect, contextObservable: this._xrSessionManager.onXRFrameObservable, onEnded: () => {this._currentTeleportationControllerId === controllerData.xrController.uniqueId && controllerData.teleportationState.forward && this._teleportForward(xrController.uniqueId);} });} else pointerInfo.type === pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP && (controllerData.teleportationState.forward = !1, this._currentTeleportationControllerId = "");});}, this._options.teleportationTargetMesh || this._createDefaultTargetMesh(), this._floorMeshes = this._options.floorMeshes || [], this._snapToPositions = this._options.snapPositions || [], this._setTargetMeshVisibility(!1);}get snapPointsOnly() {return !!this._options.snapPointsOnly;}set snapPointsOnly(snapToPoints) {this._options.snapPointsOnly = snapToPoints;}addFloorMesh(mesh) {this._floorMeshes.push(mesh);}addBlockerMesh(mesh) {this._options.pickBlockerMeshes = this._options.pickBlockerMeshes || [], this._options.pickBlockerMeshes.push(mesh);}addSnapPoint(newSnapPoint) {this._snapToPositions.push(newSnapPoint);}attach() {return !!super.attach() && (this._currentTeleportationControllerId = "", this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (controller) => {this._detachController(controller.uniqueId);}), !0);}detach() {return !!super.detach() && (Object.keys(this._controllers).forEach((controllerId) => {this._detachController(controllerId);}), this._setTargetMeshVisibility(!1), this._currentTeleportationControllerId = "", this._controllers = {}, !0);}dispose() {super.dispose(), this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.dispose(!1, !0);}removeFloorMesh(mesh) {const index = this._floorMeshes.indexOf(mesh);-1 !== index && this._floorMeshes.splice(index, 1);}removeBlockerMesh(mesh) {this._options.pickBlockerMeshes = this._options.pickBlockerMeshes || [];const index = this._options.pickBlockerMeshes.indexOf(mesh);-1 !== index && this._options.pickBlockerMeshes.splice(index, 1);}removeFloorMeshByName(name) {const mesh = this._xrSessionManager.scene.getMeshByName(name);mesh && this.removeFloorMesh(mesh);}removeSnapPoint(snapPointToRemove) {let index = this._snapToPositions.indexOf(snapPointToRemove);if (-1 === index) for (let i = 0; i < this._snapToPositions.length; ++i) if (this._snapToPositions[i].equals(snapPointToRemove)) {index = i;break;}return -1 !== index && (this._snapToPositions.splice(index, 1), !0);}setSelectionFeature(selectionFeature) {this._selectionFeature = selectionFeature;}_onXRFrame() {const frame = this._xrSessionManager.currentFrame,scene = this._xrSessionManager.scene;if (this.attach && frame) {const targetMesh = this._options.teleportationTargetMesh;if (this._currentTeleportationControllerId) {if (!targetMesh) return;targetMesh.rotationQuaternion = targetMesh.rotationQuaternion || new math_vector/* Quaternion */._f();const controllerData = this._controllers[this._currentTeleportationControllerId];if (controllerData && controllerData.teleportationState.forward) {math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(controllerData.teleportationState.currentRotation + controllerData.teleportationState.baseRotation, 0, 0, targetMesh.rotationQuaternion);let hitPossible = !1;if (controllerData.xrController.getWorldPointerRayToRef(this._tmpRay), this.straightRayEnabled) {const pick = scene.pickWithRay(this._tmpRay, (o) => {if (this._options.pickBlockerMeshes && -1 !== this._options.pickBlockerMeshes.indexOf(o)) return !0;const index = this._floorMeshes.indexOf(o);return -1 !== index && this._floorMeshes[index].absolutePosition.y < this._options.xrInput.xrCamera.globalPosition.y;});if (pick && pick.pickedMesh && this._options.pickBlockerMeshes && -1 !== this._options.pickBlockerMeshes.indexOf(pick.pickedMesh)) return;pick && pick.pickedPoint && (hitPossible = !0, this._setTargetMeshPosition(pick), this._setTargetMeshVisibility(!0), this._showParabolicPath(pick));}if (this.parabolicRayEnabled && !hitPossible) {const xRotation = controllerData.xrController.pointer.rotationQuaternion.toEulerAngles().x,compensation = 1 + (Math.PI / 2 - Math.abs(xRotation)),radius = this.parabolicCheckRadius * compensation;this._tmpRay.origin.addToRef(this._tmpRay.direction.scale(2 * radius), this._tmpVector), this._tmpVector.y = this._tmpRay.origin.y, this._tmpRay.origin.addInPlace(this._tmpRay.direction.scale(radius)), this._tmpVector.subtractToRef(this._tmpRay.origin, this._tmpRay.direction), this._tmpRay.direction.normalize();const pick = scene.pickWithRay(this._tmpRay, (o) => !!(this._options.pickBlockerMeshes && -1 !== this._options.pickBlockerMeshes.indexOf(o)) || -1 !== this._floorMeshes.indexOf(o));if (pick && pick.pickedMesh && this._options.pickBlockerMeshes && -1 !== this._options.pickBlockerMeshes.indexOf(pick.pickedMesh)) return;pick && pick.pickedPoint && (hitPossible = !0, this._setTargetMeshPosition(pick), this._setTargetMeshVisibility(!0), this._showParabolicPath(pick));}this._setTargetMeshVisibility(hitPossible);} else this._setTargetMeshVisibility(!1);} else this._setTargetMeshVisibility(!1);}}_createDefaultTargetMesh() {this._options.defaultTargetMeshOptions = this._options.defaultTargetMeshOptions || {};const sceneToRenderTo = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene : this._xrSessionManager.scene,teleportationTarget = CreateGround("teleportationTarget", { width: 2, height: 2, subdivisions: 2 }, sceneToRenderTo);if (teleportationTarget.isPickable = !1, this._options.defaultTargetMeshOptions.teleportationCircleMaterial) teleportationTarget.material = this._options.defaultTargetMeshOptions.teleportationCircleMaterial;else {const dynamicTexture = new DynamicTexture("teleportationPlaneDynamicTexture", 512, sceneToRenderTo, !0);dynamicTexture.hasAlpha = !0;const context = dynamicTexture.getContext();context.beginPath(), context.arc(256, 256, 200, 0, 2 * Math.PI, !1), context.fillStyle = this._options.defaultTargetMeshOptions.teleportationFillColor || "#444444", context.fill(), context.lineWidth = 10, context.strokeStyle = this._options.defaultTargetMeshOptions.teleportationBorderColor || "#FFFFFF", context.stroke(), context.closePath(), dynamicTexture.update();const teleportationCircleMaterial = new standardMaterial/* StandardMaterial */.K("teleportationPlaneMaterial", sceneToRenderTo);teleportationCircleMaterial.diffuseTexture = dynamicTexture, teleportationTarget.material = teleportationCircleMaterial;}const torus = CreateTorus("torusTeleportation", { diameter: .75, thickness: .1, tessellation: 20 }, sceneToRenderTo);if (torus.isPickable = !1, torus.parent = teleportationTarget, !this._options.defaultTargetMeshOptions.disableAnimation) {const animationInnerCircle = new Animations_animation/* Animation */.f("animationInnerCircle", "position.y", 30, Animations_animation/* Animation.ANIMATIONTYPE_FLOAT */.f.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation.ANIMATIONLOOPMODE_CYCLE */.f.ANIMATIONLOOPMODE_CYCLE),keys = [];keys.push({ frame: 0, value: 0 }), keys.push({ frame: 30, value: .4 }), keys.push({ frame: 60, value: 0 }), animationInnerCircle.setKeys(keys);const easingFunction = new SineEase();easingFunction.setEasingMode(EasingFunction.EASINGMODE_EASEINOUT), animationInnerCircle.setEasingFunction(easingFunction), torus.animations = [], torus.animations.push(animationInnerCircle), sceneToRenderTo.beginAnimation(torus, 0, 60, !0);}const cone = CreateCylinder("rotationCone", { diameterTop: 0, tessellation: 4 }, sceneToRenderTo);if (cone.isPickable = !1, cone.scaling.set(.5, .12, .2), cone.rotate(math_axis/* Axis.X */.RD.X, Math.PI / 2), cone.position.z = .6, cone.parent = torus, this._options.defaultTargetMeshOptions.torusArrowMaterial) torus.material = this._options.defaultTargetMeshOptions.torusArrowMaterial, cone.material = this._options.defaultTargetMeshOptions.torusArrowMaterial;else {const torusConeMaterial = new standardMaterial/* StandardMaterial */.K("torusConsMat", sceneToRenderTo);torusConeMaterial.disableLighting = !!this._options.defaultTargetMeshOptions.disableLighting, torusConeMaterial.disableLighting ? torusConeMaterial.emissiveColor = new math_color/* Color3 */.Wo(.3, .3, 1) : torusConeMaterial.diffuseColor = new math_color/* Color3 */.Wo(.3, .3, 1), torusConeMaterial.alpha = .9, torus.material = torusConeMaterial, cone.material = torusConeMaterial, this._teleportationRingMaterial = torusConeMaterial;}void 0 !== this._options.renderingGroupId && (teleportationTarget.renderingGroupId = this._options.renderingGroupId, torus.renderingGroupId = this._options.renderingGroupId, cone.renderingGroupId = this._options.renderingGroupId), this._options.teleportationTargetMesh = teleportationTarget, this._setTargetMeshVisibility(!1);}_detachController(xrControllerUniqueId) {const controllerData = this._controllers[xrControllerUniqueId];controllerData && (controllerData.teleportationComponent && (controllerData.onAxisChangedObserver && controllerData.teleportationComponent.onAxisValueChangedObservable.remove(controllerData.onAxisChangedObserver), controllerData.onButtonChangedObserver && controllerData.teleportationComponent.onButtonStateChangedObservable.remove(controllerData.onButtonChangedObserver)), delete this._controllers[xrControllerUniqueId]);}_findClosestSnapPointWithRadius(realPosition, radius = this._options.snapToPositionRadius || .8) {let closestPoint = null,closestDistance = Number.MAX_VALUE;if (this._snapToPositions.length) {this._snapToPositions.forEach((position) => {const dist = math_vector/* Vector3.DistanceSquared */.P.DistanceSquared(position, realPosition);dist <= radius * radius && dist < closestDistance && (closestDistance = dist, closestPoint = position);});}return closestPoint;}_setTargetMeshPosition(pickInfo) {const newPosition = pickInfo.pickedPoint;if (this._options.teleportationTargetMesh && newPosition) {const snapPosition = this._findClosestSnapPointWithRadius(newPosition);this._snappedToPoint = !!snapPosition, this.snapPointsOnly && !this._snappedToPoint && this._teleportationRingMaterial ? this._teleportationRingMaterial.diffuseColor.set(1, .3, .3) : this.snapPointsOnly && this._snappedToPoint && this._teleportationRingMaterial && this._teleportationRingMaterial.diffuseColor.set(.3, .3, 1), this._options.teleportationTargetMesh.position.copyFrom(snapPosition || newPosition), this._options.teleportationTargetMesh.position.y += .01, this.onTargetMeshPositionUpdatedObservable.notifyObservers(pickInfo);}}_setTargetMeshVisibility(visible) {this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.isVisible !== visible && (this._options.teleportationTargetMesh.isVisible = visible, this._options.teleportationTargetMesh.getChildren(void 0, !1).forEach((m) => {m.isVisible = visible;}), visible ? this._selectionFeature && this._selectionFeature.detach() : (this._quadraticBezierCurve && (this._quadraticBezierCurve.dispose(), this._quadraticBezierCurve = null), this._selectionFeature && this._selectionFeature.attach()));}_showParabolicPath(pickInfo) {if (!pickInfo.pickedPoint || !this._currentTeleportationControllerId) return;const sceneToRenderTo = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene : this._xrSessionManager.scene,controllerData = this._controllers[this._currentTeleportationControllerId],quadraticBezierVectors = math_path/* Curve3.CreateQuadraticBezier */.j_.CreateQuadraticBezier(controllerData.xrController.pointer.absolutePosition, pickInfo.ray.origin, pickInfo.pickedPoint, 25);this._quadraticBezierCurve = this._options.generateRayPathMesh ? this._options.generateRayPathMesh(quadraticBezierVectors.getPoints(), pickInfo) : CreateLines("teleportation path line", { points: quadraticBezierVectors.getPoints(), instance: this._quadraticBezierCurve, updatable: !0 }, sceneToRenderTo), this._quadraticBezierCurve.isPickable = !1, this._options.renderingGroupId !== void 0 && (this._quadraticBezierCurve.renderingGroupId = this._options.renderingGroupId);}_teleportForward(controllerId) {const controllerData = this._controllers[controllerId];if (controllerData && controllerData.teleportationState.forward && this.teleportationEnabled && (controllerData.teleportationState.forward = !1, this._currentTeleportationControllerId = "", !this.snapPointsOnly || this._snappedToPoint)) {if (this.skipNextTeleportation) return void (this.skipNextTeleportation = !1);if (this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.isVisible) {const height = this._options.xrInput.xrCamera.realWorldHeight;this._options.xrInput.xrCamera.onBeforeCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position), this._options.xrInput.xrCamera.position.copyFrom(this._options.teleportationTargetMesh.position), this._options.xrInput.xrCamera.position.y += height, math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(0, controllerData.teleportationState.currentRotation - (this._xrSessionManager.scene.useRightHandedSystem ? Math.PI : 0), 0).multiplyToRef(this._options.xrInput.xrCamera.rotationQuaternion, this._options.xrInput.xrCamera.rotationQuaternion), this._options.xrInput.xrCamera.onAfterCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position);}}}}WebXRMotionControllerTeleportation.Name = WebXRFeatureName.TELEPORTATION, WebXRMotionControllerTeleportation.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRMotionControllerTeleportation.Name, (xrSessionManager, options) => () => new WebXRMotionControllerTeleportation(xrSessionManager, options), WebXRMotionControllerTeleportation.Version, !0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/webXRDefaultExperience.js
class WebXRDefaultExperienceOptions {}class WebXRDefaultExperience {constructor() {}static CreateAsync(scene, options = {}) {const result = new WebXRDefaultExperience();if (scene.onDisposeObservable.addOnce(() => {result.dispose();}), !options.disableDefaultUI) {const uiOptions = { renderTarget: result.renderTarget, ...(options.uiOptions || {}) };options.optionalFeatures && ("boolean" == typeof options.optionalFeatures ? uiOptions.optionalFeatures = ["hit-test", "anchors", "plane-detection", "hand-tracking"] : uiOptions.optionalFeatures = options.optionalFeatures), result.enterExitUI = new WebXREnterExitUI(scene, uiOptions);}return WebXRExperienceHelper.CreateAsync(scene).then((xrHelper) => {if (result.baseExperience = xrHelper, options.ignoreNativeCameraTransformation && (result.baseExperience.camera.compensateOnFirstFrame = !1), result.input = new WebXRInput(xrHelper.sessionManager, xrHelper.camera, { controllerOptions: { renderingGroupId: options.renderingGroupId }, ...(options.inputOptions || {}) }), !options.disablePointerSelection) {const pointerSelectionOptions = { ...options.pointerSelectionOptions, xrInput: result.input, renderingGroupId: options.renderingGroupId };result.pointerSelection = result.baseExperience.featuresManager.enableFeature(WebXRControllerPointerSelection.Name, options.useStablePlugins ? "stable" : "latest", pointerSelectionOptions), options.disableTeleportation || (result.teleportation = result.baseExperience.featuresManager.enableFeature(WebXRMotionControllerTeleportation.Name, options.useStablePlugins ? "stable" : "latest", { floorMeshes: options.floorMeshes, xrInput: result.input, renderingGroupId: options.renderingGroupId, ...options.teleportationOptions }), result.teleportation.setSelectionFeature(result.pointerSelection));}return options.disableNearInteraction || (result.nearInteraction = result.baseExperience.featuresManager.enableFeature(WebXRNearInteraction.Name, options.useStablePlugins ? "stable" : "latest", { xrInput: result.input, farInteractionFeature: result.pointerSelection, renderingGroupId: options.renderingGroupId, useUtilityLayer: !0, enableNearInteractionOnAllControllers: !0, ...options.nearInteractionOptions })), result.renderTarget = result.baseExperience.sessionManager.getWebXRRenderTarget(options.outputCanvasOptions), options.disableDefaultUI ? void 0 : result.enterExitUI.setHelperAsync(result.baseExperience, result.renderTarget);}).then(() => result).catch((error) => (logger/* Logger.Error */.Y.Error("Error initializing XR"), logger/* Logger.Error */.Y.Error(error), result));}dispose() {this.baseExperience && this.baseExperience.dispose(), this.input && this.input.dispose(), this.enterExitUI && this.enterExitUI.dispose(), this.renderTarget && this.renderTarget.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Helpers/sceneHelpers.js
var _forceSceneHelpersToBundle = !0;core_scene/* Scene.prototype.createDefaultLight */.x.prototype.createDefaultLight = function (replace = !1) {if (replace && this.lights) for (let i = 0; i < this.lights.length; i++) this.lights[i].dispose();0 === this.lights.length && new hemisphericLight/* HemisphericLight */.e("default light", math_vector/* Vector3.Up */.P.Up(), this);}, core_scene/* Scene.prototype.createDefaultCamera */.x.prototype.createDefaultCamera = function (createArcRotateCamera = !1, replace = !1, attachCameraControls = !1) {if (replace && this.activeCamera && (this.activeCamera.dispose(), this.activeCamera = null), !this.activeCamera) {const worldExtends = this.getWorldExtends((mesh) => mesh.isVisible && mesh.isEnabled()),worldSize = worldExtends.max.subtract(worldExtends.min),worldCenter = worldExtends.min.add(worldSize.scale(.5));let camera,radius = 1.5 * worldSize.length();if (isFinite(radius) || (radius = 1, worldCenter.copyFromFloats(0, 0, 0)), createArcRotateCamera) {const arcRotateCamera = new ArcRotateCamera("default camera", -(Math.PI / 2), Math.PI / 2, radius, worldCenter, this);arcRotateCamera.lowerRadiusLimit = .01 * radius, arcRotateCamera.wheelPrecision = 100 / radius, camera = arcRotateCamera;} else {const freeCamera = new Cameras_freeCamera/* FreeCamera */.c("default camera", new math_vector/* Vector3 */.P(worldCenter.x, worldCenter.y, -radius), this);freeCamera.setTarget(worldCenter), camera = freeCamera;}camera.minZ = .01 * radius, camera.maxZ = 1e3 * radius, camera.speed = .2 * radius, this.activeCamera = camera, attachCameraControls && camera.attachControl();}}, core_scene/* Scene.prototype.createDefaultCameraOrLight */.x.prototype.createDefaultCameraOrLight = function (createArcRotateCamera = !1, replace = !1, attachCameraControls = !1) {this.createDefaultLight(replace), this.createDefaultCamera(createArcRotateCamera, replace, attachCameraControls);}, core_scene/* Scene.prototype.createDefaultSkybox */.x.prototype.createDefaultSkybox = function (environmentTexture, pbr = !1, scale = 1e3, blur = 0, setGlobalEnvTexture = !0) {if (!environmentTexture) return logger/* Logger.Warn */.Y.Warn("Can not create default skybox without environment texture."), null;setGlobalEnvTexture && environmentTexture && (this.environmentTexture = environmentTexture);const hdrSkybox = CreateBox("hdrSkyBox", { size: scale }, this);if (pbr) {const hdrSkyboxMaterial = new pbrMaterial/* PBRMaterial */.Y("skyBox", this);hdrSkyboxMaterial.backFaceCulling = !1, hdrSkyboxMaterial.reflectionTexture = environmentTexture.clone(), hdrSkyboxMaterial.reflectionTexture && (hdrSkyboxMaterial.reflectionTexture.coordinatesMode = Textures_texture/* Texture.SKYBOX_MODE */.x.SKYBOX_MODE), hdrSkyboxMaterial.microSurface = 1 - blur, hdrSkyboxMaterial.disableLighting = !0, hdrSkyboxMaterial.twoSidedLighting = !0, hdrSkybox.material = hdrSkyboxMaterial;} else {const skyboxMaterial = new standardMaterial/* StandardMaterial */.K("skyBox", this);skyboxMaterial.backFaceCulling = !1, skyboxMaterial.reflectionTexture = environmentTexture.clone(), skyboxMaterial.reflectionTexture && (skyboxMaterial.reflectionTexture.coordinatesMode = Textures_texture/* Texture.SKYBOX_MODE */.x.SKYBOX_MODE), skyboxMaterial.disableLighting = !0, hdrSkybox.material = skyboxMaterial;}return hdrSkybox.isPickable = !1, hdrSkybox.infiniteDistance = !0, hdrSkybox.ignoreCameraMaxZ = !0, hdrSkybox;}, core_scene/* Scene.prototype.createDefaultEnvironment */.x.prototype.createDefaultEnvironment = function (options) {return EnvironmentHelper ? new EnvironmentHelper(options, this) : null;}, core_scene/* Scene.prototype.createDefaultVRExperience */.x.prototype.createDefaultVRExperience = function (webVROptions = {}) {return new VRExperienceHelper(this, webVROptions);}, core_scene/* Scene.prototype.createDefaultXRExperienceAsync */.x.prototype.createDefaultXRExperienceAsync = function (options = {}) {return WebXRDefaultExperience.CreateAsync(this, options).then((helper) => helper);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/videoTexture.js
function removeSource(video) {for (; video.firstChild;) video.removeChild(video.firstChild);video.srcObject = null, video.src = "", video.removeAttribute("src");}class VideoTexture extends Textures_texture/* Texture */.x {get onUserActionRequestedObservable() {return this._onUserActionRequestedObservable || (this._onUserActionRequestedObservable = new observable/* Observable */.y$()), this._onUserActionRequestedObservable;}_processError(reason) {this._errorFound = !0, this._onError ? this._onError(null === reason || void 0 === reason ? void 0 : reason.message) : logger/* Logger.Error */.Y.Error(null === reason || void 0 === reason ? void 0 : reason.message);}_handlePlay() {this._errorFound = !1, this.video.play().catch((reason) => {if ("NotAllowedError" === (null === reason || void 0 === reason ? void 0 : reason.name)) {if (this._onUserActionRequestedObservable && this._onUserActionRequestedObservable.hasObservers()) return void this._onUserActionRequestedObservable.notifyObservers(this);if (!this.video.muted) return logger/* Logger.Warn */.Y.Warn("Unable to autoplay a video with sound. Trying again with muted turned true"), this.video.muted = !0, this._errorFound = !1, void this.video.play().catch((otherReason) => {this._processError(otherReason);});}this._processError(reason);});}constructor(name, src, scene, generateMipMaps = !1, invertY = !1, samplingMode = Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) {var _a, _b;super(null, scene, !generateMipMaps, invertY), this._onUserActionRequestedObservable = null, this._stillImageCaptured = !1, this._displayingPosterTexture = !1, this._frameId = -1, this._currentSrc = null, this._errorFound = !1, this._resizeInternalTexture = () => {var _a;null != this._texture && this._texture.dispose(), !this._getEngine().needPOTTextures || tools/* Tools.IsExponentOfTwo */.w1.IsExponentOfTwo(this.video.videoWidth) && tools/* Tools.IsExponentOfTwo */.w1.IsExponentOfTwo(this.video.videoHeight) ? (this.wrapU = Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE, this.wrapV = Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE) : (this.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._generateMipMaps = !1), this._texture = this._getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this.samplingMode), this._texture.format = null !== (_a = this._format) && void 0 !== _a ? _a : 5, this._frameId = -1, this._updateInternalTexture();}, this._createInternalTexture = () => {if (null != this._texture) if (this._displayingPosterTexture) this._displayingPosterTexture = !1;else return;if (this.video.addEventListener("resize", this._resizeInternalTexture), this._resizeInternalTexture(), !this.video.autoplay && !this._settings.poster && !this._settings.independentVideoSource) {const oldHandler = this.video.onplaying,oldMuted = this.video.muted;this.video.muted = !0, this.video.onplaying = () => {this.video.muted = oldMuted, this.video.onplaying = oldHandler, this._updateInternalTexture(), this._errorFound || this.video.pause(), this.onLoadObservable.hasObservers() && this.onLoadObservable.notifyObservers(this);}, this._handlePlay();} else this._updateInternalTexture(), this.onLoadObservable.hasObservers() && this.onLoadObservable.notifyObservers(this);}, this._reset = () => {null != this._texture && (this._displayingPosterTexture || (this._texture.dispose(), this._texture = null));}, this._updateInternalTexture = () => {if (null != this._texture && !(this.video.readyState < this.video.HAVE_CURRENT_DATA) && !this._displayingPosterTexture) {const frameId = this.getScene().getFrameId();this._frameId === frameId || (this._frameId = frameId, this._getEngine().updateVideoTexture(this._texture, this._externalTexture ? this._externalTexture : this.video, this._invertY));}}, this._settings = { autoPlay: !0, loop: !0, autoUpdateTexture: !0, ...settings }, this._onError = onError, this._generateMipMaps = generateMipMaps, this._initialSamplingMode = samplingMode, this.autoUpdateTexture = this._settings.autoUpdateTexture, this._currentSrc = src, this.name = name || this._getName(src), this.video = this._getVideo(src), this._externalTexture = null !== (_b = null === (_a = this._engine) || void 0 === _a ? void 0 : _a.createExternalTexture(this.video)) && void 0 !== _b ? _b : null, this._settings.independentVideoSource || (this._settings.poster && (this.video.poster = this._settings.poster), this._settings.autoPlay !== void 0 && (this.video.autoplay = this._settings.autoPlay), this._settings.loop !== void 0 && (this.video.loop = this._settings.loop), this._settings.muted !== void 0 && (this.video.muted = this._settings.muted), this.video.setAttribute("playsinline", ""), this.video.addEventListener("paused", this._updateInternalTexture), this.video.addEventListener("seeked", this._updateInternalTexture), this.video.addEventListener("emptied", this._reset), this._settings.autoPlay && this._handlePlay()), this._createInternalTextureOnEvent = this._settings.poster && !this._settings.autoPlay ? "play" : "canplay", this.video.addEventListener(this._createInternalTextureOnEvent, this._createInternalTexture), this._format = format;const videoHasEnoughData = this.video.readyState >= this.video.HAVE_CURRENT_DATA;!this._settings.poster || this._settings.autoPlay && videoHasEnoughData ? videoHasEnoughData && this._createInternalTexture() : (this._texture = this._getEngine().createTexture(this._settings.poster, !1, !this.invertY, scene), this._displayingPosterTexture = !0);}getClassName() {return "VideoTexture";}_getName(src) {return src instanceof HTMLVideoElement ? src.currentSrc : "object" == typeof src ? src.toString() : src;}_getVideo(src) {if (src.isNative) return src;if (src instanceof HTMLVideoElement) return tools/* Tools.SetCorsBehavior */.w1.SetCorsBehavior(src.currentSrc, src), src;const video = document.createElement("video");return "string" == typeof src ? (tools/* Tools.SetCorsBehavior */.w1.SetCorsBehavior(src, video), video.src = src) : (tools/* Tools.SetCorsBehavior */.w1.SetCorsBehavior(src[0], video), src.forEach((url) => {const source = document.createElement("source");source.src = url, video.appendChild(source);})), this.onDisposeObservable.addOnce(() => {removeSource(video);}), video;}_rebuild() {this.update();}update() {this.autoUpdateTexture && this.updateTexture(!0);}updateTexture(isVisible) {!isVisible || this.video.paused && this._stillImageCaptured || (this._stillImageCaptured = !0, this._updateInternalTexture());}updateURL(url) {this.video.src = url, this._currentSrc = url;}clone() {return new VideoTexture(this.name, this._currentSrc, this.getScene(), this._generateMipMaps, this.invertY, this.samplingMode, this._settings);}dispose() {var _a;super.dispose(), this._currentSrc = null, this._onUserActionRequestedObservable && (this._onUserActionRequestedObservable.clear(), this._onUserActionRequestedObservable = null), this.video.removeEventListener(this._createInternalTextureOnEvent, this._createInternalTexture), this._settings.independentVideoSource || (this.video.removeEventListener("paused", this._updateInternalTexture), this.video.removeEventListener("seeked", this._updateInternalTexture), this.video.removeEventListener("emptied", this._reset), this.video.removeEventListener("resize", this._resizeInternalTexture), this.video.pause()), null === (_a = this._externalTexture) || void 0 === _a ? void 0 : _a.dispose();}static CreateFromStreamAsync(scene, stream, constraints, invertY = !0) {const video = scene.getEngine().createVideoElement(constraints);return scene.getEngine()._badOS && (document.body.appendChild(video), video.style.transform = "scale(0.0001, 0.0001)", video.style.opacity = "0", video.style.position = "fixed", video.style.bottom = "0px", video.style.right = "0px"), video.setAttribute("autoplay", ""), video.setAttribute("muted", "true"), video.setAttribute("playsinline", ""), video.muted = !0, video.isNative || (void 0 === video.mozSrcObject ? "object" == typeof video.srcObject ? video.srcObject = stream : video.src = window.URL && window.URL.createObjectURL(stream) : video.mozSrcObject = stream), new Promise((resolve) => {const onPlaying = () => {const videoTexture = new VideoTexture("video", video, scene, !0, invertY, void 0, void 0, void 0, 4);scene.getEngine()._badOS && videoTexture.onDisposeObservable.addOnce(() => {video.remove();}), videoTexture.onDisposeObservable.addOnce(() => {removeSource(video);}), resolve(videoTexture), video.removeEventListener("playing", onPlaying);};video.addEventListener("playing", onPlaying), video.play();});}static async CreateFromWebCamAsync(scene, constraints, audioConstaints = !1, invertY = !0) {if (navigator.mediaDevices) {const stream = await navigator.mediaDevices.getUserMedia({ video: constraints, audio: audioConstaints }),videoTexture = await this.CreateFromStreamAsync(scene, stream, constraints, invertY);return videoTexture.onDisposeObservable.addOnce(() => {stream.getTracks().forEach((track) => {track.stop();});}), videoTexture;}return Promise.reject("No support for userMedia on this device");}static CreateFromWebCam(scene, onReady, constraints, audioConstaints = !1, invertY = !0) {this.CreateFromWebCamAsync(scene, constraints, audioConstaints, invertY).then(function (videoTexture) {onReady && onReady(videoTexture);}).catch(function (err) {logger/* Logger.Error */.Y.Error(err.name);});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Helpers/videoDome.js
class VideoDome extends TextureDome {get videoTexture() {return this._texture;}get videoMode() {return this.textureMode;}set videoMode(value) {this.textureMode = value;}_initTexture(urlsOrElement, scene, options) {const tempOptions = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: !0, poster: options.poster },texture = new VideoTexture((this.name || "videoDome") + "_texture", urlsOrElement, scene, options.generateMipMaps, this._useDirectMapping, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, tempOptions);return options.clickToPlay && (this._pointerObserver = scene.onPointerObservable.add((data) => {var _a;(null === (_a = data.pickInfo) || void 0 === _a ? void 0 : _a.pickedMesh) === this.mesh && this._texture.video.play();}, pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN)), this._textureObserver = texture.onLoadObservable.add(() => {this.onLoadObservable.notifyObservers();}), texture;}dispose(doNotRecurse, disposeMaterialAndTextures = !1) {this._texture.onLoadObservable.remove(this._textureObserver), this._scene.onPointerObservable.remove(this._pointerObserver), super.dispose(doNotRecurse, disposeMaterialAndTextures);}}VideoDome.MODE_MONOSCOPIC = TextureDome.MODE_MONOSCOPIC, VideoDome.MODE_TOPBOTTOM = TextureDome.MODE_TOPBOTTOM, VideoDome.MODE_SIDEBYSIDE = TextureDome.MODE_SIDEBYSIDE;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Helpers/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Instrumentation/engineInstrumentation.js
class EngineInstrumentation {get gpuFrameTimeCounter() {return this.engine.getGPUFrameTimeCounter();}get captureGPUFrameTime() {return this._captureGPUFrameTime;}set captureGPUFrameTime(value) {value === this._captureGPUFrameTime || (this._captureGPUFrameTime = value, this.engine.captureGPUFrameTime(value));}get shaderCompilationTimeCounter() {return this._shaderCompilationTime;}get captureShaderCompilationTime() {return this._captureShaderCompilationTime;}set captureShaderCompilationTime(value) {value === this._captureShaderCompilationTime || (this._captureShaderCompilationTime = value, value ? (this._onBeforeShaderCompilationObserver = this.engine.onBeforeShaderCompilationObservable.add(() => {this._shaderCompilationTime.fetchNewFrame(), this._shaderCompilationTime.beginMonitoring();}), this._onAfterShaderCompilationObserver = this.engine.onAfterShaderCompilationObservable.add(() => {this._shaderCompilationTime.endMonitoring();})) : (this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null));}constructor(engine) {this.engine = engine, this._captureGPUFrameTime = !1, this._captureShaderCompilationTime = !1, this._shaderCompilationTime = new perfCounter/* PerfCounter */.z(), this._onBeginFrameObserver = null, this._onEndFrameObserver = null, this._onBeforeShaderCompilationObserver = null, this._onAfterShaderCompilationObserver = null;}dispose() {this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.engine.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null, this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null, this.engine = null;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Instrumentation/sceneInstrumentation.js
class SceneInstrumentation {get activeMeshesEvaluationTimeCounter() {return this._activeMeshesEvaluationTime;}get captureActiveMeshesEvaluationTime() {return this._captureActiveMeshesEvaluationTime;}set captureActiveMeshesEvaluationTime(value) {value === this._captureActiveMeshesEvaluationTime || (this._captureActiveMeshesEvaluationTime = value, value ? (this._onBeforeActiveMeshesEvaluationObserver = this.scene.onBeforeActiveMeshesEvaluationObservable.add(() => {tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Active meshes evaluation"), this._activeMeshesEvaluationTime.beginMonitoring();}), this._onAfterActiveMeshesEvaluationObserver = this.scene.onAfterActiveMeshesEvaluationObservable.add(() => {tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Active meshes evaluation"), this._activeMeshesEvaluationTime.endMonitoring();})) : (this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null));}get renderTargetsRenderTimeCounter() {return this._renderTargetsRenderTime;}get captureRenderTargetsRenderTime() {return this._captureRenderTargetsRenderTime;}set captureRenderTargetsRenderTime(value) {value === this._captureRenderTargetsRenderTime || (this._captureRenderTargetsRenderTime = value, value ? (this._onBeforeRenderTargetsRenderObserver = this.scene.onBeforeRenderTargetsRenderObservable.add(() => {tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Render targets rendering"), this._renderTargetsRenderTime.beginMonitoring();}), this._onAfterRenderTargetsRenderObserver = this.scene.onAfterRenderTargetsRenderObservable.add(() => {tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Render targets rendering"), this._renderTargetsRenderTime.endMonitoring(!1);})) : (this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null));}get particlesRenderTimeCounter() {return this._particlesRenderTime;}get captureParticlesRenderTime() {return this._captureParticlesRenderTime;}set captureParticlesRenderTime(value) {value === this._captureParticlesRenderTime || (this._captureParticlesRenderTime = value, value ? (this._onBeforeParticlesRenderingObserver = this.scene.onBeforeParticlesRenderingObservable.add(() => {tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Particles"), this._particlesRenderTime.beginMonitoring();}), this._onAfterParticlesRenderingObserver = this.scene.onAfterParticlesRenderingObservable.add(() => {tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Particles"), this._particlesRenderTime.endMonitoring(!1);})) : (this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null));}get spritesRenderTimeCounter() {return this._spritesRenderTime;}get captureSpritesRenderTime() {return this._captureSpritesRenderTime;}set captureSpritesRenderTime(value) {value !== this._captureSpritesRenderTime && (this._captureSpritesRenderTime = value, this.scene.spriteManagers && (value ? (this._onBeforeSpritesRenderingObserver = this.scene.onBeforeSpritesRenderingObservable.add(() => {tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Sprites"), this._spritesRenderTime.beginMonitoring();}), this._onAfterSpritesRenderingObserver = this.scene.onAfterSpritesRenderingObservable.add(() => {tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Sprites"), this._spritesRenderTime.endMonitoring(!1);})) : (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null, this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null)));}get physicsTimeCounter() {return this._physicsTime;}get capturePhysicsTime() {return this._capturePhysicsTime;}set capturePhysicsTime(value) {value !== this._capturePhysicsTime && this.scene.onBeforePhysicsObservable && (this._capturePhysicsTime = value, value ? (this._onBeforePhysicsObserver = this.scene.onBeforePhysicsObservable.add(() => {tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Physics"), this._physicsTime.beginMonitoring();}), this._onAfterPhysicsObserver = this.scene.onAfterPhysicsObservable.add(() => {tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Physics"), this._physicsTime.endMonitoring();})) : (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null, this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null));}get animationsTimeCounter() {return this._animationsTime;}get captureAnimationsTime() {return this._captureAnimationsTime;}set captureAnimationsTime(value) {value === this._captureAnimationsTime || (this._captureAnimationsTime = value, value ? this._onAfterAnimationsObserver = this.scene.onAfterAnimationsObservable.add(() => {this._animationsTime.endMonitoring();}) : (this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null));}get frameTimeCounter() {return this._frameTime;}get captureFrameTime() {return this._captureFrameTime;}set captureFrameTime(value) {this._captureFrameTime = value;}get interFrameTimeCounter() {return this._interFrameTime;}get captureInterFrameTime() {return this._captureInterFrameTime;}set captureInterFrameTime(value) {this._captureInterFrameTime = value;}get renderTimeCounter() {return this._renderTime;}get captureRenderTime() {return this._captureRenderTime;}set captureRenderTime(value) {value === this._captureRenderTime || (this._captureRenderTime = value, value ? (this._onBeforeDrawPhaseObserver = this.scene.onBeforeDrawPhaseObservable.add(() => {this._renderTime.beginMonitoring(), tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Main render");}), this._onAfterDrawPhaseObserver = this.scene.onAfterDrawPhaseObservable.add(() => {this._renderTime.endMonitoring(!1), tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Main render");})) : (this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null));}get cameraRenderTimeCounter() {return this._cameraRenderTime;}get captureCameraRenderTime() {return this._captureCameraRenderTime;}set captureCameraRenderTime(value) {value === this._captureCameraRenderTime || (this._captureCameraRenderTime = value, value ? (this._onBeforeCameraRenderObserver = this.scene.onBeforeCameraRenderObservable.add((camera) => {this._cameraRenderTime.beginMonitoring(), tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter(`Rendering camera ${camera.name}`);}), this._onAfterCameraRenderObserver = this.scene.onAfterCameraRenderObservable.add((camera) => {this._cameraRenderTime.endMonitoring(!1), tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter(`Rendering camera ${camera.name}`);})) : (this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null));}get drawCallsCounter() {return this.scene.getEngine()._drawCalls;}constructor(scene) {this.scene = scene, this._captureActiveMeshesEvaluationTime = !1, this._activeMeshesEvaluationTime = new perfCounter/* PerfCounter */.z(), this._captureRenderTargetsRenderTime = !1, this._renderTargetsRenderTime = new perfCounter/* PerfCounter */.z(), this._captureFrameTime = !1, this._frameTime = new perfCounter/* PerfCounter */.z(), this._captureRenderTime = !1, this._renderTime = new perfCounter/* PerfCounter */.z(), this._captureInterFrameTime = !1, this._interFrameTime = new perfCounter/* PerfCounter */.z(), this._captureParticlesRenderTime = !1, this._particlesRenderTime = new perfCounter/* PerfCounter */.z(), this._captureSpritesRenderTime = !1, this._spritesRenderTime = new perfCounter/* PerfCounter */.z(), this._capturePhysicsTime = !1, this._physicsTime = new perfCounter/* PerfCounter */.z(), this._captureAnimationsTime = !1, this._animationsTime = new perfCounter/* PerfCounter */.z(), this._captureCameraRenderTime = !1, this._cameraRenderTime = new perfCounter/* PerfCounter */.z(), this._onBeforeActiveMeshesEvaluationObserver = null, this._onAfterActiveMeshesEvaluationObserver = null, this._onBeforeRenderTargetsRenderObserver = null, this._onAfterRenderTargetsRenderObserver = null, this._onAfterRenderObserver = null, this._onBeforeDrawPhaseObserver = null, this._onAfterDrawPhaseObserver = null, this._onBeforeAnimationsObserver = null, this._onBeforeParticlesRenderingObserver = null, this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver = null, this._onAfterSpritesRenderingObserver = null, this._onBeforePhysicsObserver = null, this._onAfterPhysicsObserver = null, this._onAfterAnimationsObserver = null, this._onBeforeCameraRenderObserver = null, this._onAfterCameraRenderObserver = null, this._onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {this._captureActiveMeshesEvaluationTime && this._activeMeshesEvaluationTime.fetchNewFrame(), this._captureRenderTargetsRenderTime && this._renderTargetsRenderTime.fetchNewFrame(), this._captureFrameTime && (tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Scene rendering"), this._frameTime.beginMonitoring()), this._captureInterFrameTime && this._interFrameTime.endMonitoring(), this._captureParticlesRenderTime && this._particlesRenderTime.fetchNewFrame(), this._captureSpritesRenderTime && this._spritesRenderTime.fetchNewFrame(), this._captureAnimationsTime && this._animationsTime.beginMonitoring(), this.scene.getEngine()._drawCalls.fetchNewFrame();}), this._onAfterRenderObserver = scene.onAfterRenderObservable.add(() => {this._captureFrameTime && (tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Scene rendering"), this._frameTime.endMonitoring()), this._captureRenderTime && this._renderTime.endMonitoring(!1), this._captureInterFrameTime && this._interFrameTime.beginMonitoring();});}dispose() {this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = null, this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null, this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null, this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver), this._onBeforeAnimationsObserver = null, this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver && (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null), this._onAfterSpritesRenderingObserver && (this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null), this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null, this._onBeforePhysicsObserver && (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null), this._onAfterPhysicsObserver && (this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null), this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null, this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null, this.scene = null;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Instrumentation/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/glowMapGeneration.fragment.js
const glowMapGeneration_fragment_name = "glowMapGenerationPixelShader",glowMapGeneration_fragment_shader = `#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)
#include<helperFunctions>
#endif
#ifdef DIFFUSE
varying vec2 vUVDiffuse;
uniform sampler2D diffuseSampler;
#endif
#ifdef OPACITY
varying vec2 vUVOpacity;
uniform sampler2D opacitySampler;
uniform float opacityIntensity;
#endif
#ifdef EMISSIVE
varying vec2 vUVEmissive;
uniform sampler2D emissiveSampler;
#endif
#ifdef VERTEXALPHA
varying vec4 vColor;
#endif
uniform vec4 glowColor;
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#include<clipPlaneFragment>
vec4 finalColor=glowColor;
#ifdef DIFFUSE
vec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);
#ifdef DIFFUSE_ISLINEAR
albedoTexture=toGammaSpace(albedoTexture);
#endif
#ifdef GLOW
finalColor.a*=albedoTexture.a;
#endif
#ifdef HIGHLIGHT
finalColor.a=albedoTexture.a;
#endif
#endif
#ifdef OPACITY
vec4 opacityMap=texture2D(opacitySampler,vUVOpacity);
#ifdef OPACITYRGB
finalColor.a*=getLuminance(opacityMap.rgb);
#else
finalColor.a*=opacityMap.a;
#endif
finalColor.a*=opacityIntensity;
#endif
#ifdef VERTEXALPHA
finalColor.a*=vColor.a;
#endif
#ifdef ALPHATEST
if (finalColor.a<ALPHATESTVALUE)
discard;
#endif
#ifdef EMISSIVE
vec4 emissive=texture2D(emissiveSampler,vUVEmissive);
#ifdef EMISSIVE_ISLINEAR
emissive=toGammaSpace(emissive);
#endif
gl_FragColor=emissive*finalColor;
#else
gl_FragColor=finalColor;
#endif
#ifdef HIGHLIGHT
gl_FragColor.a=glowColor.a;
#endif
}`;shaderStore/* ShaderStore.ShadersStore.glowMapGenerationPixelShader */.v.ShadersStore.glowMapGenerationPixelShader = glowMapGeneration_fragment_shader;const glowMapGenerationPixelShader = { name: "glowMapGenerationPixelShader", shader: glowMapGeneration_fragment_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var ShadersInclude_morphTargetsVertexGlobalDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var ShadersInclude_morphTargetsVertexDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var ShadersInclude_morphTargetsVertexGlobal = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var ShadersInclude_morphTargetsVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/glowMapGeneration.vertex.js
const glowMapGeneration_vertex_name = "glowMapGenerationVertexShader",glowMapGeneration_vertex_shader = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform mat4 viewProjection;
varying vec4 vPosition;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef DIFFUSE
varying vec2 vUVDiffuse;
uniform mat4 diffuseMatrix;
#endif
#ifdef OPACITY
varying vec2 vUVOpacity;
uniform mat4 opacityMatrix;
#endif
#ifdef EMISSIVE
varying vec2 vUVEmissive;
uniform mat4 emissiveMatrix;
#endif
#ifdef VERTEXALPHA
attribute vec4 color;
varying vec4 vColor;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{
vec3 positionUpdated=position;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#ifdef CUBEMAP
vPosition=worldPos;
gl_Position=viewProjection*finalWorld*vec4(position,1.0);
#else
vPosition=viewProjection*worldPos;
gl_Position=vPosition;
#endif
#ifdef DIFFUSE
#ifdef DIFFUSEUV1
vUVDiffuse=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef DIFFUSEUV2
vUVDiffuse=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#ifdef OPACITY
#ifdef OPACITYUV1
vUVOpacity=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef OPACITYUV2
vUVOpacity=vec2(opacityMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#ifdef EMISSIVE
#ifdef EMISSIVEUV1
vUVEmissive=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef EMISSIVEUV2
vUVEmissive=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#ifdef VERTEXALPHA
vColor=color;
#endif
#include<clipPlaneVertex>
}`;shaderStore/* ShaderStore.ShadersStore.glowMapGenerationVertexShader */.v.ShadersStore.glowMapGenerationVertexShader = glowMapGeneration_vertex_shader;const glowMapGenerationVertexShader = { name: "glowMapGenerationVertexShader", shader: glowMapGeneration_vertex_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/devTools.js
var devTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Layers/effectLayer.js
class EffectLayer {get camera() {return this._effectLayerOptions.camera;}get renderingGroupId() {return this._effectLayerOptions.renderingGroupId;}set renderingGroupId(renderingGroupId) {this._effectLayerOptions.renderingGroupId = renderingGroupId;}get mainTexture() {return this._mainTexture;}setMaterialForRendering(mesh, material) {if (this._mainTexture.setMaterialForRendering(mesh, material), Array.isArray(mesh)) for (let i = 0; i < mesh.length; ++i) {const currentMesh = mesh[i];material ? this._materialForRendering[currentMesh.uniqueId] = [currentMesh, material] : delete this._materialForRendering[currentMesh.uniqueId];} else material ? this._materialForRendering[mesh.uniqueId] = [mesh, material] : delete this._materialForRendering[mesh.uniqueId];}constructor(name, scene) {this._vertexBuffers = {}, this._maxSize = 0, this._mainTextureDesiredSize = { width: 0, height: 0 }, this._shouldRender = !0, this._postProcesses = [], this._textures = [], this._emissiveTextureAndColor = { texture: null, color: new math_color/* Color4 */.HE() }, this.neutralColor = new math_color/* Color4 */.HE(), this.isEnabled = !0, this.disableBoundingBoxesFromEffectLayer = !1, this.onDisposeObservable = new observable/* Observable */.y$(), this.onBeforeRenderMainTextureObservable = new observable/* Observable */.y$(), this.onBeforeComposeObservable = new observable/* Observable */.y$(), this.onBeforeRenderMeshToEffect = new observable/* Observable */.y$(), this.onAfterRenderMeshToEffect = new observable/* Observable */.y$(), this.onAfterComposeObservable = new observable/* Observable */.y$(), this.onSizeChangedObservable = new observable/* Observable */.y$(), this._materialForRendering = {}, this.name = name, this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, EffectLayer._SceneComponentInitialization(this._scene), this._engine = this._scene.getEngine(), this._maxSize = this._engine.getCaps().maxTextureSize, this._scene.effectLayers.push(this), this._mergeDrawWrapper = [], this._generateIndexBuffer(), this._generateVertexBuffer();}_numInternalDraws() {return 1;}_init(options) {this._effectLayerOptions = { mainTextureRatio: .5, alphaBlendingMode: 2, camera: null, renderingGroupId: -1, mainTextureType: 0, ...options }, this._setMainTextureSize(), this._createMainTexture(), this._createTextureAndPostProcesses();}_generateIndexBuffer() {const indices = [];indices.push(0), indices.push(1), indices.push(2), indices.push(0), indices.push(2), indices.push(3), this._indexBuffer = this._engine.createIndexBuffer(indices);}_generateVertexBuffer() {const vertexBuffer = new Buffers_buffer/* VertexBuffer */.o(this._engine, [1, 1, -1, 1, -1, -1, 1, -1], Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, !1, !1, 2);this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = vertexBuffer;}_setMainTextureSize() {this._effectLayerOptions.mainTextureFixedSize ? (this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize, this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize) : (this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.width = this._engine.needPOTTextures ? engine/* Engine.GetExponentOfTwo */.D.GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize) : this._mainTextureDesiredSize.width, this._mainTextureDesiredSize.height = this._engine.needPOTTextures ? engine/* Engine.GetExponentOfTwo */.D.GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize) : this._mainTextureDesiredSize.height), this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width), this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height);}_createMainTexture() {for (const id in this._mainTexture = new Textures_renderTargetTexture/* RenderTargetTexture */._("EffectLayerMainRTT", { width: this._mainTextureDesiredSize.width, height: this._mainTextureDesiredSize.height }, this._scene, !1, !0, this._effectLayerOptions.mainTextureType), this._mainTexture.activeCamera = this._effectLayerOptions.camera, this._mainTexture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._mainTexture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._mainTexture.anisotropicFilteringLevel = 1, this._mainTexture.updateSamplingMode(Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE), this._mainTexture.renderParticles = !1, this._mainTexture.renderList = null, this._mainTexture.ignoreCameraViewport = !0, this._materialForRendering) {const [mesh, material] = this._materialForRendering[id];this._mainTexture.setMaterialForRendering(mesh, material);}if (this._mainTexture.customIsReadyFunction = (mesh, refreshRate, preWarm) => {if ((preWarm || 0 === refreshRate) && mesh.subMeshes) for (let i = 0; i < mesh.subMeshes.length; ++i) {const subMesh = mesh.subMeshes[i],material = subMesh.getMaterial(),renderingMesh = subMesh.getRenderingMesh();if (!material) continue;const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh()),hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || renderingMesh.hasThinInstances;if (this._setEmissiveTextureAndColor(renderingMesh, subMesh, material), !this._isReady(subMesh, hardwareInstancedRendering, this._emissiveTextureAndColor.texture)) return !1;}return !0;}, this._mainTexture.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => {this.onBeforeRenderMainTextureObservable.notifyObservers(this);let index;const engine = this._scene.getEngine();if (depthOnlySubMeshes.length) {for (engine.setColorWrite(!1), index = 0; index < depthOnlySubMeshes.length; index++) this._renderSubMesh(depthOnlySubMeshes.data[index]);engine.setColorWrite(!0);}for (index = 0; index < opaqueSubMeshes.length; index++) this._renderSubMesh(opaqueSubMeshes.data[index]);for (index = 0; index < alphaTestSubMeshes.length; index++) this._renderSubMesh(alphaTestSubMeshes.data[index]);const previousAlphaMode = engine.getAlphaMode();for (index = 0; index < transparentSubMeshes.length; index++) this._renderSubMesh(transparentSubMeshes.data[index], !0);engine.setAlphaMode(previousAlphaMode);}, this._mainTexture.onClearObservable.add((engine) => {engine.clear(this.neutralColor, !0, !0, !0);}), this._scene.getBoundingBoxRenderer) {const boundingBoxRendererEnabled = this._scene.getBoundingBoxRenderer().enabled;this._mainTexture.onBeforeBindObservable.add(() => {this._scene.getBoundingBoxRenderer().enabled = !this.disableBoundingBoxesFromEffectLayer && boundingBoxRendererEnabled;}), this._mainTexture.onAfterUnbindObservable.add(() => {this._scene.getBoundingBoxRenderer().enabled = boundingBoxRendererEnabled;});}}_addCustomEffectDefines() {}_isReady(subMesh, useInstances, emissiveTexture) {var _a;const engine = this._scene.getEngine(),mesh = subMesh.getMesh(),renderingMaterial = null === (_a = mesh._internalAbstractMeshDataInfo._materialForRenderPass) || void 0 === _a ? void 0 : _a[engine.currentRenderPassId];if (renderingMaterial) return renderingMaterial.isReadyForSubMesh(mesh, subMesh, useInstances);const material = subMesh.getMaterial();if (!material) return !1;if (this._useMeshMaterial(subMesh.getRenderingMesh())) return material.isReadyForSubMesh(subMesh.getMesh(), subMesh, useInstances);const defines = [],attribs = [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];let uv1 = !1,uv2 = !1;if (material) {const needAlphaTest = material.needAlphaTesting(),diffuseTexture = material.getAlphaTestTexture(),needAlphaBlendFromDiffuse = diffuseTexture && diffuseTexture.hasAlpha && (material.useAlphaFromDiffuseTexture || material._useAlphaFromAlbedoTexture);diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse) && (defines.push("#define DIFFUSE"), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind) && 1 === diffuseTexture.coordinatesIndex ? (defines.push("#define DIFFUSEUV2"), uv2 = !0) : mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind) && (defines.push("#define DIFFUSEUV1"), uv1 = !0), needAlphaTest && (defines.push("#define ALPHATEST"), defines.push("#define ALPHATESTVALUE 0.4")), !diffuseTexture.gammaSpace && defines.push("#define DIFFUSE_ISLINEAR"));const opacityTexture = material.opacityTexture;opacityTexture && (defines.push("#define OPACITY"), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind) && 1 === opacityTexture.coordinatesIndex ? (defines.push("#define OPACITYUV2"), uv2 = !0) : mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind) && (defines.push("#define OPACITYUV1"), uv1 = !0));}emissiveTexture && (defines.push("#define EMISSIVE"), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind) && 1 === emissiveTexture.coordinatesIndex ? (defines.push("#define EMISSIVEUV2"), uv2 = !0) : mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind) && (defines.push("#define EMISSIVEUV1"), uv1 = !0), !emissiveTexture.gammaSpace && defines.push("#define EMISSIVE_ISLINEAR")), mesh.useVertexColors && mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind) && mesh.hasVertexAlpha && material.transparencyMode !== Materials_material/* Material.MATERIAL_OPAQUE */.F.MATERIAL_OPAQUE && (attribs.push(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind), defines.push("#define VERTEXALPHA")), uv1 && (attribs.push(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), defines.push("#define UV1")), uv2 && (attribs.push(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind), defines.push("#define UV2"));const fallbacks = new effectFallbacks/* EffectFallbacks */.L();if (mesh.useBones && mesh.computeBonesUsingShaders) {attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind), 4 < mesh.numBoneInfluencers && (attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesExtraKind */.o.MatricesIndicesExtraKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsExtraKind */.o.MatricesWeightsExtraKind)), defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);const skeleton = mesh.skeleton;skeleton && skeleton.isUsingTextureForMatrices ? defines.push("#define BONETEXTURE") : defines.push("#define BonesPerMesh " + (skeleton ? skeleton.bones.length + 1 : 0)), 0 < mesh.numBoneInfluencers && fallbacks.addCPUSkinningFallback(0, mesh);} else defines.push("#define NUM_BONE_INFLUENCERS 0");const manager = mesh.morphTargetManager;let morphInfluencers = 0;manager && 0 < manager.numInfluencers && (defines.push("#define MORPHTARGETS"), morphInfluencers = manager.numInfluencers, defines.push("#define NUM_MORPH_INFLUENCERS " + morphInfluencers), manager.isUsingTextureForTargets && defines.push("#define MORPHTARGETS_TEXTURE"), materialHelper/* MaterialHelper.PrepareAttributesForMorphTargetsInfluencers */.G.PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, morphInfluencers)), useInstances && (defines.push("#define INSTANCES"), materialHelper/* MaterialHelper.PushAttributesForInstances */.G.PushAttributesForInstances(attribs), subMesh.getRenderingMesh().hasThinInstances && defines.push("#define THIN_INSTANCES")), (0,clipPlaneMaterialHelper/* prepareDefinesForClipPlanes */.AN)(material, this._scene, defines), this._addCustomEffectDefines(defines);const drawWrapper = subMesh._getDrawWrapper(void 0, !0),cachedDefines = drawWrapper.defines,join = defines.join("\n");if (cachedDefines !== join) {const uniforms = ["world", "mBones", "viewProjection", "glowColor", "morphTargetInfluences", "boneTextureWidth", "diffuseMatrix", "emissiveMatrix", "opacityMatrix", "opacityIntensity", "morphTargetTextureInfo", "morphTargetTextureIndices"];(0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(uniforms), drawWrapper.setEffect(this._engine.createEffect("glowMapGeneration", attribs, uniforms, ["diffuseSampler", "emissiveSampler", "opacitySampler", "boneSampler", "morphTargets"], join, fallbacks, void 0, void 0, { maxSimultaneousMorphTargets: morphInfluencers }), join);}return drawWrapper.effect.isReady();}render() {for (let i = 0; i < this._postProcesses.length; i++) if (!this._postProcesses[i].isReady()) return;const engine = this._scene.getEngine(),numDraws = this._numInternalDraws();let isReady = !0;for (let currentEffect, i = 0; i < numDraws; ++i) currentEffect = this._mergeDrawWrapper[i], currentEffect || (currentEffect = this._mergeDrawWrapper[i] = new Materials_drawWrapper/* DrawWrapper */.q(this._engine), currentEffect.setEffect(this._createMergeEffect())), isReady = isReady && currentEffect.effect.isReady();if (isReady) {this.onBeforeComposeObservable.notifyObservers(this);const previousAlphaMode = engine.getAlphaMode();for (let i = 0; i < numDraws; ++i) {const currentEffect = this._mergeDrawWrapper[i];engine.enableEffect(currentEffect), engine.setState(!1), engine.bindBuffers(this._vertexBuffers, this._indexBuffer, currentEffect.effect), engine.setAlphaMode(this._effectLayerOptions.alphaBlendingMode), this._internalRender(currentEffect.effect, i);}engine.setAlphaMode(previousAlphaMode), this.onAfterComposeObservable.notifyObservers(this);const size = this._mainTexture.getSize();this._setMainTextureSize(), (size.width !== this._mainTextureDesiredSize.width || size.height !== this._mainTextureDesiredSize.height) && 0 !== this._mainTextureDesiredSize.width && 0 !== this._mainTextureDesiredSize.height && (this.onSizeChangedObservable.notifyObservers(this), this._disposeTextureAndPostProcesses(), this._createMainTexture(), this._createTextureAndPostProcesses());}}hasMesh(mesh) {return !(-1 !== this.renderingGroupId && mesh.renderingGroupId !== this.renderingGroupId);}shouldRender() {return this.isEnabled && this._shouldRender;}_shouldRenderMesh() {return !0;}_canRenderMesh(mesh, material) {return !material.needAlphaBlendingForMesh(mesh);}_shouldRenderEmissiveTextureForMesh() {return !0;}_renderSubMesh(subMesh, enableAlphaMode = !1) {var _a, _b;if (!this.shouldRender()) return;const material = subMesh.getMaterial(),ownerMesh = subMesh.getMesh(),replacementMesh = subMesh.getReplacementMesh(),renderingMesh = subMesh.getRenderingMesh(),effectiveMesh = subMesh.getEffectiveMesh(),scene = this._scene,engine = scene.getEngine();if (effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = !1, !material) return;if (!this._canRenderMesh(renderingMesh, material)) return;let sideOrientation = null !== (_a = renderingMesh.overrideMaterialSideOrientation) && void 0 !== _a ? _a : material.sideOrientation;const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();0 > mainDeterminant && (sideOrientation = sideOrientation === Materials_material/* Material.ClockWiseSideOrientation */.F.ClockWiseSideOrientation ? Materials_material/* Material.CounterClockWiseSideOrientation */.F.CounterClockWiseSideOrientation : Materials_material/* Material.ClockWiseSideOrientation */.F.ClockWiseSideOrientation);const reverse = sideOrientation === Materials_material/* Material.ClockWiseSideOrientation */.F.ClockWiseSideOrientation;engine.setState(material.backFaceCulling, material.zOffset, void 0, reverse, material.cullBackFaces, void 0, material.zOffsetUnits);const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!replacementMesh);if (!batch.mustReturn && this._shouldRenderMesh(renderingMesh)) {const hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || renderingMesh.hasThinInstances;if (this._setEmissiveTextureAndColor(renderingMesh, subMesh, material), this.onBeforeRenderMeshToEffect.notifyObservers(ownerMesh), this._useMeshMaterial(renderingMesh)) renderingMesh.render(subMesh, enableAlphaMode, replacementMesh || void 0);else if (this._isReady(subMesh, hardwareInstancedRendering, this._emissiveTextureAndColor.texture)) {const renderingMaterial = null === (_b = effectiveMesh._internalAbstractMeshDataInfo._materialForRenderPass) || void 0 === _b ? void 0 : _b[engine.currentRenderPassId];let drawWrapper = subMesh._getDrawWrapper();if (!drawWrapper && renderingMaterial && (drawWrapper = renderingMaterial._getDrawWrapper()), !drawWrapper) return;const effect = drawWrapper.effect;if (engine.enableEffect(drawWrapper), !hardwareInstancedRendering) {const fillMode = scene.forcePointsCloud ? Materials_material/* Material.PointFillMode */.F.PointFillMode : scene.forceWireframe ? Materials_material/* Material.WireFrameFillMode */.F.WireFrameFillMode : material.fillMode;renderingMesh._bind(subMesh, effect, fillMode);}if (renderingMaterial ? renderingMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), effectiveMesh, subMesh) : (effect.setMatrix("viewProjection", scene.getTransformMatrix()), effect.setMatrix("world", effectiveMesh.getWorldMatrix()), effect.setFloat4("glowColor", this._emissiveTextureAndColor.color.r, this._emissiveTextureAndColor.color.g, this._emissiveTextureAndColor.color.b, this._emissiveTextureAndColor.color.a)), !renderingMaterial) {const needAlphaTest = material.needAlphaTesting(),diffuseTexture = material.getAlphaTestTexture(),needAlphaBlendFromDiffuse = diffuseTexture && diffuseTexture.hasAlpha && (material.useAlphaFromDiffuseTexture || material._useAlphaFromAlbedoTexture);if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) {effect.setTexture("diffuseSampler", diffuseTexture);const textureMatrix = diffuseTexture.getTextureMatrix();textureMatrix && effect.setMatrix("diffuseMatrix", textureMatrix);}const opacityTexture = material.opacityTexture;if (opacityTexture) {effect.setTexture("opacitySampler", opacityTexture), effect.setFloat("opacityIntensity", opacityTexture.level);const textureMatrix = opacityTexture.getTextureMatrix();textureMatrix && effect.setMatrix("opacityMatrix", textureMatrix);}if (this._emissiveTextureAndColor.texture && (effect.setTexture("emissiveSampler", this._emissiveTextureAndColor.texture), effect.setMatrix("emissiveMatrix", this._emissiveTextureAndColor.texture.getTextureMatrix())), renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {const skeleton = renderingMesh.skeleton;if (skeleton.isUsingTextureForMatrices) {const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);if (!boneTexture) return;effect.setTexture("boneSampler", boneTexture), effect.setFloat("boneTextureWidth", 4 * (skeleton.bones.length + 1));} else effect.setMatrices("mBones", skeleton.getTransformMatrices(renderingMesh));}materialHelper/* MaterialHelper.BindMorphTargetParameters */.G.BindMorphTargetParameters(renderingMesh, effect), renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets && renderingMesh.morphTargetManager._bind(effect), enableAlphaMode && engine.setAlphaMode(material.alphaMode), (0,clipPlaneMaterialHelper/* bindClipPlane */.an)(effect, material, scene);}renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, world) => effect.setMatrix("world", world));} else this._mainTexture.resetRefreshCounter();this.onAfterRenderMeshToEffect.notifyObservers(ownerMesh);}}_useMeshMaterial() {return !1;}_rebuild() {const vb = this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];vb && vb._rebuild(), this._generateIndexBuffer();}_disposeTextureAndPostProcesses() {this._mainTexture.dispose();for (let i = 0; i < this._postProcesses.length; i++) this._postProcesses[i] && this._postProcesses[i].dispose();this._postProcesses = [];for (let i = 0; i < this._textures.length; i++) this._textures[i] && this._textures[i].dispose();this._textures = [];}dispose() {const vertexBuffer = this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];vertexBuffer && (vertexBuffer.dispose(), this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null);for (const drawWrapper of this._mergeDrawWrapper) drawWrapper.dispose();this._mergeDrawWrapper = [], this._disposeTextureAndPostProcesses();const index = this._scene.effectLayers.indexOf(this, 0);-1 < index && this._scene.effectLayers.splice(index, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onBeforeRenderMainTextureObservable.clear(), this.onBeforeComposeObservable.clear(), this.onBeforeRenderMeshToEffect.clear(), this.onAfterRenderMeshToEffect.clear(), this.onAfterComposeObservable.clear(), this.onSizeChangedObservable.clear();}getClassName() {return "EffectLayer";}static Parse(parsedEffectLayer, scene, rootUrl) {const effectLayerType = tools/* Tools.Instantiate */.w1.Instantiate(parsedEffectLayer.customType);return effectLayerType.Parse(parsedEffectLayer, scene, rootUrl);}}EffectLayer._SceneComponentInitialization = () => {throw (0,devTools/* _WarnImport */.S)("EffectLayerSceneComponent");}, (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], EffectLayer.prototype, "name", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor4 */.XX)()], EffectLayer.prototype, "neutralColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], EffectLayer.prototype, "isEnabled", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsCameraReference */.VE)()], EffectLayer.prototype, "camera", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], EffectLayer.prototype, "renderingGroupId", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], EffectLayer.prototype, "disableBoundingBoxesFromEffectLayer", void 0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Layers/effectLayerSceneComponent.js
abstractScene/* AbstractScene.AddParser */.p.AddParser(sceneComponent/* SceneComponentConstants.NAME_EFFECTLAYER */.l.NAME_EFFECTLAYER, (parsedData, scene, container, rootUrl) => {if (parsedData.effectLayers) {container.effectLayers || (container.effectLayers = []);for (let index = 0; index < parsedData.effectLayers.length; index++) {const effectLayer = EffectLayer.Parse(parsedData.effectLayers[index], scene, rootUrl);container.effectLayers.push(effectLayer);}}}), abstractScene/* AbstractScene.prototype.removeEffectLayer */.p.prototype.removeEffectLayer = function (toRemove) {const index = this.effectLayers.indexOf(toRemove);return -1 !== index && this.effectLayers.splice(index, 1), index;}, abstractScene/* AbstractScene.prototype.addEffectLayer */.p.prototype.addEffectLayer = function (newEffectLayer) {this.effectLayers.push(newEffectLayer);};class EffectLayerSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_EFFECTLAYER */.l.NAME_EFFECTLAYER, this._renderEffects = !1, this._needStencil = !1, this._previousStencilState = !1, this.scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;this.scene && (this._engine = this.scene.getEngine(), this.scene.effectLayers = []);}register() {this.scene._isReadyForMeshStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_ISREADYFORMESH_EFFECTLAYER */.l.STEP_ISREADYFORMESH_EFFECTLAYER, this, this._isReadyForMesh), this.scene._cameraDrawRenderTargetStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER */.l.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER, this, this._renderMainTexture), this.scene._beforeCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORECAMERADRAW_EFFECTLAYER */.l.STEP_BEFORECAMERADRAW_EFFECTLAYER, this, this._setStencil), this.scene._afterRenderingGroupDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW */.l.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW, this, this._drawRenderingGroup), this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER */.l.STEP_AFTERCAMERADRAW_EFFECTLAYER, this, this._setStencilBack), this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW */.l.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW, this, this._drawCamera);}rebuild() {const layers = this.scene.effectLayers;for (const effectLayer of layers) effectLayer._rebuild();}serialize(serializationObject) {serializationObject.effectLayers = [];const layers = this.scene.effectLayers;for (const effectLayer of layers) effectLayer.serialize && serializationObject.effectLayers.push(effectLayer.serialize());}addFromContainer(container) {container.effectLayers && container.effectLayers.forEach((o) => {this.scene.addEffectLayer(o);});}removeFromContainer(container, dispose) {container.effectLayers && container.effectLayers.forEach((o) => {this.scene.removeEffectLayer(o), dispose && o.dispose();});}dispose() {for (const layers = this.scene.effectLayers; layers.length;) layers[0].dispose();}_isReadyForMesh(mesh, hardwareInstancedRendering) {const currentRenderPassId = this._engine.currentRenderPassId,layers = this.scene.effectLayers;for (const layer of layers) {if (!layer.hasMesh(mesh)) continue;const renderTarget = layer._mainTexture;this._engine.currentRenderPassId = renderTarget.renderPassId;for (const subMesh of mesh.subMeshes) if (!layer.isReady(subMesh, hardwareInstancedRendering)) return this._engine.currentRenderPassId = currentRenderPassId, !1;}return this._engine.currentRenderPassId = currentRenderPassId, !0;}_renderMainTexture(camera) {this._renderEffects = !1, this._needStencil = !1;let needRebind = !1;const layers = this.scene.effectLayers;if (layers && 0 < layers.length) {this._previousStencilState = this._engine.getStencilBuffer();for (const effectLayer of layers) if (effectLayer.shouldRender() && (!effectLayer.camera || effectLayer.camera.cameraRigMode === Cameras_camera/* Camera.RIG_MODE_NONE */.V.RIG_MODE_NONE && camera === effectLayer.camera || effectLayer.camera.cameraRigMode !== Cameras_camera/* Camera.RIG_MODE_NONE */.V.RIG_MODE_NONE && -1 < effectLayer.camera._rigCameras.indexOf(camera))) {this._renderEffects = !0, this._needStencil = this._needStencil || effectLayer.needStencil();const renderTarget = effectLayer._mainTexture;renderTarget._shouldRender() && (this.scene.incrementRenderId(), renderTarget.render(!1, !1), needRebind = !0);}this.scene.incrementRenderId();}return needRebind;}_setStencil() {this._needStencil && this._engine.setStencilBuffer(!0);}_setStencilBack() {this._needStencil && this._engine.setStencilBuffer(this._previousStencilState);}_draw(renderingGroupId) {if (this._renderEffects) {this._engine.setDepthBuffer(!1);const layers = this.scene.effectLayers;for (let i = 0; i < layers.length; i++) {const effectLayer = layers[i];effectLayer.renderingGroupId === renderingGroupId && effectLayer.shouldRender() && effectLayer.render();}this._engine.setDepthBuffer(!0);}}_drawCamera() {this._renderEffects && this._draw(-1);}_drawRenderingGroup(index) {!this.scene._isInIntermediateRendering() && this._renderEffects && this._draw(index);}}EffectLayer._SceneComponentInitialization = (scene) => {let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_EFFECTLAYER */.l.NAME_EFFECTLAYER);component || (component = new EffectLayerSceneComponent(scene), scene._addComponent(component));};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/glowMapMerge.fragment.js
const glowMapMerge_fragment_name = "glowMapMergePixelShader",glowMapMerge_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
#ifdef EMISSIVE
uniform sampler2D textureSampler2;
#endif
uniform float offset;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 baseColor=texture2D(textureSampler,vUV);
#ifdef EMISSIVE
baseColor+=texture2D(textureSampler2,vUV);
baseColor*=offset;
#else
baseColor.a=abs(offset-baseColor.a);
#ifdef STROKE
float alpha=smoothstep(.0,.1,baseColor.a);
baseColor.a=alpha;
baseColor.rgb=baseColor.rgb*alpha;
#endif
#endif
#if LDR
baseColor=clamp(baseColor,0.,1.0);
#endif
gl_FragColor=baseColor;
#define CUSTOM_FRAGMENT_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.glowMapMergePixelShader */.v.ShadersStore.glowMapMergePixelShader = glowMapMerge_fragment_shader;const glowMapMergePixelShader = { name: "glowMapMergePixelShader", shader: glowMapMerge_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/glowMapMerge.vertex.js
const glowMapMerge_vertex_name = "glowMapMergeVertexShader",glowMapMerge_vertex_shader = `attribute vec2 position;
varying vec2 vUV;
const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=position*madd+madd;
gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.glowMapMergeVertexShader */.v.ShadersStore.glowMapMergeVertexShader = glowMapMerge_vertex_shader;const glowMapMergeVertexShader = { name: "glowMapMergeVertexShader", shader: glowMapMerge_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Layers/glowLayer.js
abstractScene/* AbstractScene.prototype.getGlowLayerByName */.p.prototype.getGlowLayerByName = function (name) {var _a;for (let index = 0; index < (null === (_a = this.effectLayers) || void 0 === _a ? void 0 : _a.length); index++) if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === GlowLayer.EffectName) return this.effectLayers[index];return null;};class GlowLayer extends EffectLayer {set blurKernelSize(value) {if (value !== this._options.blurKernelSize) {this._options.blurKernelSize = value;const effectiveKernel = this._getEffectiveBlurKernelSize();this._horizontalBlurPostprocess1.kernel = effectiveKernel, this._verticalBlurPostprocess1.kernel = effectiveKernel, this._horizontalBlurPostprocess2.kernel = effectiveKernel, this._verticalBlurPostprocess2.kernel = effectiveKernel;}}get blurKernelSize() {return this._options.blurKernelSize;}set intensity(value) {this._intensity = value;}get intensity() {return this._intensity;}constructor(name, scene, options) {super(name, scene), this._intensity = 1, this._includedOnlyMeshes = [], this._excludedMeshes = [], this._meshesUsingTheirOwnMaterials = [], this.neutralColor = new math_color/* Color4 */.HE(0, 0, 0, 1), this._options = { mainTextureRatio: GlowLayer.DefaultTextureRatio, blurKernelSize: 32, mainTextureFixedSize: void 0, camera: null, mainTextureSamples: 1, renderingGroupId: -1, ldrMerge: !1, alphaBlendingMode: 1, mainTextureType: 0, ...options }, this._init({ alphaBlendingMode: this._options.alphaBlendingMode, camera: this._options.camera, mainTextureFixedSize: this._options.mainTextureFixedSize, mainTextureRatio: this._options.mainTextureRatio, renderingGroupId: this._options.renderingGroupId, mainTextureType: this._options.mainTextureType });}getEffectName() {return GlowLayer.EffectName;}_createMergeEffect() {let defines = "#define EMISSIVE \n";return this._options.ldrMerge && (defines += "#define LDR \n"), this._engine.createEffect("glowMapMerge", [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], ["offset"], ["textureSampler", "textureSampler2"], defines);}_createTextureAndPostProcesses() {let blurTextureWidth = this._mainTextureDesiredSize.width,blurTextureHeight = this._mainTextureDesiredSize.height;blurTextureWidth = this._engine.needPOTTextures ? engine/* Engine.GetExponentOfTwo */.D.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth, blurTextureHeight = this._engine.needPOTTextures ? engine/* Engine.GetExponentOfTwo */.D.GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;let textureType = 0;textureType = this._engine.getCaps().textureHalfFloatRender ? 2 : 0, this._blurTexture1 = new Textures_renderTargetTexture/* RenderTargetTexture */._("GlowLayerBlurRTT", { width: blurTextureWidth, height: blurTextureHeight }, this._scene, !1, !0, textureType), this._blurTexture1.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._blurTexture1.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._blurTexture1.updateSamplingMode(Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE), this._blurTexture1.renderParticles = !1, this._blurTexture1.ignoreCameraViewport = !0;const blurTextureWidth2 = Math.floor(blurTextureWidth / 2),blurTextureHeight2 = Math.floor(blurTextureHeight / 2);this._blurTexture2 = new Textures_renderTargetTexture/* RenderTargetTexture */._("GlowLayerBlurRTT2", { width: blurTextureWidth2, height: blurTextureHeight2 }, this._scene, !1, !0, textureType), this._blurTexture2.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._blurTexture2.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._blurTexture2.updateSamplingMode(Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE), this._blurTexture2.renderParticles = !1, this._blurTexture2.ignoreCameraViewport = !0, this._textures = [this._blurTexture1, this._blurTexture2];const effectiveKernel = this._getEffectiveBlurKernelSize();this._horizontalBlurPostprocess1 = new BlurPostProcess("GlowLayerHBP1", new math_vector/* Vector2 */.FM(1, 0), effectiveKernel, { width: blurTextureWidth, height: blurTextureHeight }, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, textureType), this._horizontalBlurPostprocess1.width = blurTextureWidth, this._horizontalBlurPostprocess1.height = blurTextureHeight, this._horizontalBlurPostprocess1.externalTextureSamplerBinding = !0, this._horizontalBlurPostprocess1.onApplyObservable.add((effect) => {effect.setTexture("textureSampler", this._mainTexture);}), this._verticalBlurPostprocess1 = new BlurPostProcess("GlowLayerVBP1", new math_vector/* Vector2 */.FM(0, 1), effectiveKernel, { width: blurTextureWidth, height: blurTextureHeight }, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, textureType), this._horizontalBlurPostprocess2 = new BlurPostProcess("GlowLayerHBP2", new math_vector/* Vector2 */.FM(1, 0), effectiveKernel, { width: blurTextureWidth2, height: blurTextureHeight2 }, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, textureType), this._horizontalBlurPostprocess2.width = blurTextureWidth2, this._horizontalBlurPostprocess2.height = blurTextureHeight2, this._horizontalBlurPostprocess2.externalTextureSamplerBinding = !0, this._horizontalBlurPostprocess2.onApplyObservable.add((effect) => {effect.setTexture("textureSampler", this._blurTexture1);}), this._verticalBlurPostprocess2 = new BlurPostProcess("GlowLayerVBP2", new math_vector/* Vector2 */.FM(0, 1), effectiveKernel, { width: blurTextureWidth2, height: blurTextureHeight2 }, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, textureType), this._postProcesses = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1, this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._postProcesses1 = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1], this._postProcesses2 = [this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._mainTexture.samples = this._options.mainTextureSamples, this._mainTexture.onAfterUnbindObservable.add(() => {const internalTexture = this._blurTexture1.renderTarget;if (internalTexture) {this._scene.postProcessManager.directRender(this._postProcesses1, internalTexture, !0);const internalTexture2 = this._blurTexture2.renderTarget;internalTexture2 && this._scene.postProcessManager.directRender(this._postProcesses2, internalTexture2, !0), this._engine.unBindFramebuffer(null !== internalTexture2 && void 0 !== internalTexture2 ? internalTexture2 : internalTexture, !0);}}), this._postProcesses.map((pp) => {pp.autoClear = !1;});}_getEffectiveBlurKernelSize() {return this._options.blurKernelSize / 2;}isReady(subMesh, useInstances) {const material = subMesh.getMaterial(),mesh = subMesh.getRenderingMesh();if (!material || !mesh) return !1;const emissiveTexture = material.emissiveTexture;return super._isReady(subMesh, useInstances, emissiveTexture);}needStencil() {return !1;}_canRenderMesh() {return !0;}_internalRender(effect) {effect.setTexture("textureSampler", this._blurTexture1), effect.setTexture("textureSampler2", this._blurTexture2), effect.setFloat("offset", this._intensity);const engine = this._engine,previousStencilBuffer = engine.getStencilBuffer();engine.setStencilBuffer(!1), engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, 6), engine.setStencilBuffer(previousStencilBuffer);}_setEmissiveTextureAndColor(mesh, subMesh, material) {var _a;let textureLevel = 1;if (this.customEmissiveTextureSelector ? this._emissiveTextureAndColor.texture = this.customEmissiveTextureSelector(mesh, subMesh, material) : material ? (this._emissiveTextureAndColor.texture = material.emissiveTexture, this._emissiveTextureAndColor.texture && (textureLevel = this._emissiveTextureAndColor.texture.level)) : this._emissiveTextureAndColor.texture = null, this.customEmissiveColorSelector) this.customEmissiveColorSelector(mesh, subMesh, material, this._emissiveTextureAndColor.color);else if (material.emissiveColor) {const emissiveIntensity = null !== (_a = material.emissiveIntensity) && void 0 !== _a ? _a : 1;textureLevel *= emissiveIntensity, this._emissiveTextureAndColor.color.set(material.emissiveColor.r * textureLevel, material.emissiveColor.g * textureLevel, material.emissiveColor.b * textureLevel, material.alpha);} else this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);}_shouldRenderMesh(mesh) {return this.hasMesh(mesh);}_addCustomEffectDefines(defines) {defines.push("#define GLOW");}addExcludedMesh(mesh) {-1 === this._excludedMeshes.indexOf(mesh.uniqueId) && this._excludedMeshes.push(mesh.uniqueId);}removeExcludedMesh(mesh) {const index = this._excludedMeshes.indexOf(mesh.uniqueId);-1 !== index && this._excludedMeshes.splice(index, 1);}addIncludedOnlyMesh(mesh) {-1 === this._includedOnlyMeshes.indexOf(mesh.uniqueId) && this._includedOnlyMeshes.push(mesh.uniqueId);}removeIncludedOnlyMesh(mesh) {const index = this._includedOnlyMeshes.indexOf(mesh.uniqueId);-1 !== index && this._includedOnlyMeshes.splice(index, 1);}hasMesh(mesh) {return !!super.hasMesh(mesh) && (this._includedOnlyMeshes.length ? -1 !== this._includedOnlyMeshes.indexOf(mesh.uniqueId) : !this._excludedMeshes.length || -1 === this._excludedMeshes.indexOf(mesh.uniqueId));}_useMeshMaterial(mesh) {return 0 != this._meshesUsingTheirOwnMaterials.length && -1 < this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);}referenceMeshToUseItsOwnMaterial(mesh) {mesh.resetDrawCache(this._mainTexture.renderPassId), this._meshesUsingTheirOwnMaterials.push(mesh.uniqueId), mesh.onDisposeObservable.add(() => {this._disposeMesh(mesh);});}unReferenceMeshFromUsingItsOwnMaterial(mesh) {for (let index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId); 0 <= index;) this._meshesUsingTheirOwnMaterials.splice(index, 1), index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);mesh.resetDrawCache(this._mainTexture.renderPassId);}_disposeMesh(mesh) {this.removeIncludedOnlyMesh(mesh), this.removeExcludedMesh(mesh);}getClassName() {return "GlowLayer";}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this);serializationObject.customType = "BABYLON.GlowLayer";let index;if (serializationObject.includedMeshes = [], this._includedOnlyMeshes.length) for (index = 0; index < this._includedOnlyMeshes.length; index++) {const mesh = this._scene.getMeshByUniqueId(this._includedOnlyMeshes[index]);mesh && serializationObject.includedMeshes.push(mesh.id);}if (serializationObject.excludedMeshes = [], this._excludedMeshes.length) for (index = 0; index < this._excludedMeshes.length; index++) {const mesh = this._scene.getMeshByUniqueId(this._excludedMeshes[index]);mesh && serializationObject.excludedMeshes.push(mesh.id);}return serializationObject;}static Parse(parsedGlowLayer, scene, rootUrl) {const gl = decorators/* SerializationHelper.Parse */.p4.Parse(() => new GlowLayer(parsedGlowLayer.name, scene, parsedGlowLayer.options), parsedGlowLayer, scene, rootUrl);let index;for (index = 0; index < parsedGlowLayer.excludedMeshes.length; index++) {const mesh = scene.getMeshById(parsedGlowLayer.excludedMeshes[index]);mesh && gl.addExcludedMesh(mesh);}for (index = 0; index < parsedGlowLayer.includedMeshes.length; index++) {const mesh = scene.getMeshById(parsedGlowLayer.includedMeshes[index]);mesh && gl.addIncludedOnlyMesh(mesh);}return gl;}}GlowLayer.EffectName = "GlowLayer", GlowLayer.DefaultBlurKernelSize = 32, GlowLayer.DefaultTextureRatio = .5, (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], GlowLayer.prototype, "blurKernelSize", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], GlowLayer.prototype, "intensity", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("options")], GlowLayer.prototype, "_options", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.GlowLayer", GlowLayer);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/glowBlurPostProcess.fragment.js
const glowBlurPostProcess_fragment_name = "glowBlurPostProcessPixelShader",glowBlurPostProcess_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform vec2 screenSize;
uniform vec2 direction;
uniform float blurWidth;
float getLuminance(vec3 color)
{
return dot(color,vec3(0.2126,0.7152,0.0722));
}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
float weights[7];
weights[0]=0.05;
weights[1]=0.1;
weights[2]=0.2;
weights[3]=0.3;
weights[4]=0.2;
weights[5]=0.1;
weights[6]=0.05;
vec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);
vec2 texelStep=texelSize*direction*blurWidth;
vec2 start=vUV-3.0*texelStep;
vec4 baseColor=vec4(0.,0.,0.,0.);
vec2 texelOffset=vec2(0.,0.);
for (int i=0; i<7; i++)
{
vec4 texel=texture2D(textureSampler,start+texelOffset);
baseColor.a+=texel.a*weights[i];
float luminance=getLuminance(baseColor.rgb);
float luminanceTexel=getLuminance(texel.rgb);
float choice=step(luminanceTexel,luminance);
baseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;
texelOffset+=texelStep;
}
gl_FragColor=baseColor;
}`;shaderStore/* ShaderStore.ShadersStore.glowBlurPostProcessPixelShader */.v.ShadersStore.glowBlurPostProcessPixelShader = glowBlurPostProcess_fragment_shader;const glowBlurPostProcessPixelShader = { name: "glowBlurPostProcessPixelShader", shader: glowBlurPostProcess_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Layers/highlightLayer.js
abstractScene/* AbstractScene.prototype.getHighlightLayerByName */.p.prototype.getHighlightLayerByName = function (name) {var _a;for (let index = 0; index < (null === (_a = this.effectLayers) || void 0 === _a ? void 0 : _a.length); index++) if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === HighlightLayer.EffectName) return this.effectLayers[index];return null;};class GlowBlurPostProcess extends PostProcesses_postProcess/* PostProcess */.D {constructor(name, direction, kernel, options, camera, samplingMode = Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, reusable) {super(name, "glowBlurPostProcess", ["screenSize", "direction", "blurWidth"], null, options, camera, samplingMode, engine, reusable), this.direction = direction, this.kernel = kernel, this.onApplyObservable.add((effect) => {effect.setFloat2("screenSize", this.width, this.height), effect.setVector2("direction", this.direction), effect.setFloat("blurWidth", this.kernel);});}}class HighlightLayer extends EffectLayer {set blurHorizontalSize(value) {this._horizontalBlurPostprocess.kernel = value, this._options.blurHorizontalSize = value;}set blurVerticalSize(value) {this._verticalBlurPostprocess.kernel = value, this._options.blurVerticalSize = value;}get blurHorizontalSize() {return this._horizontalBlurPostprocess.kernel;}get blurVerticalSize() {return this._verticalBlurPostprocess.kernel;}constructor(name, scene, options) {super(name, scene), this.name = name, this.innerGlow = !0, this.outerGlow = !0, this.onBeforeBlurObservable = new observable/* Observable */.y$(), this.onAfterBlurObservable = new observable/* Observable */.y$(), this._instanceGlowingMeshStencilReference = HighlightLayer.GlowingMeshStencilReference++, this._meshes = {}, this._excludedMeshes = {}, this.neutralColor = HighlightLayer.NeutralColor, this._engine.isStencilEnable || logger/* Logger.Warn */.Y.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }"), this._options = { mainTextureRatio: .5, blurTextureSizeRatio: .5, blurHorizontalSize: 1, blurVerticalSize: 1, alphaBlendingMode: 2, camera: null, renderingGroupId: -1, mainTextureType: 0, ...options }, this._init({ alphaBlendingMode: this._options.alphaBlendingMode, camera: this._options.camera, mainTextureFixedSize: this._options.mainTextureFixedSize, mainTextureRatio: this._options.mainTextureRatio, renderingGroupId: this._options.renderingGroupId, mainTextureType: this._options.mainTextureType }), this._shouldRender = !1;}getEffectName() {return HighlightLayer.EffectName;}_numInternalDraws() {return 2;}_createMergeEffect() {return this._engine.createEffect("glowMapMerge", [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], ["offset"], ["textureSampler"], this._options.isStroke ? "#define STROKE \n" : void 0);}_createTextureAndPostProcesses() {let blurTextureWidth = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio,blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;blurTextureWidth = this._engine.needPOTTextures ? engine/* Engine.GetExponentOfTwo */.D.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth, blurTextureHeight = this._engine.needPOTTextures ? engine/* Engine.GetExponentOfTwo */.D.GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;let textureType = 0;textureType = this._engine.getCaps().textureHalfFloatRender ? 2 : 0, this._blurTexture = new Textures_renderTargetTexture/* RenderTargetTexture */._("HighlightLayerBlurRTT", { width: blurTextureWidth, height: blurTextureHeight }, this._scene, !1, !0, textureType), this._blurTexture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._blurTexture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._blurTexture.anisotropicFilteringLevel = 16, this._blurTexture.updateSamplingMode(Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE), this._blurTexture.renderParticles = !1, this._blurTexture.ignoreCameraViewport = !0, this._textures = [this._blurTexture], 2 === this._options.alphaBlendingMode ? (this._downSamplePostprocess = new passPostProcess/* PassPostProcess */.Q("HighlightLayerPPP", this._options.blurTextureSizeRatio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._downSamplePostprocess.externalTextureSamplerBinding = !0, this._downSamplePostprocess.onApplyObservable.add((effect) => {effect.setTexture("textureSampler", this._mainTexture);}), this._horizontalBlurPostprocess = new GlowBlurPostProcess("HighlightLayerHBP", new math_vector/* Vector2 */.FM(1, 0), this._options.blurHorizontalSize, 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {effect.setFloat2("screenSize", blurTextureWidth, blurTextureHeight);}), this._verticalBlurPostprocess = new GlowBlurPostProcess("HighlightLayerVBP", new math_vector/* Vector2 */.FM(0, 1), this._options.blurVerticalSize, 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._verticalBlurPostprocess.onApplyObservable.add((effect) => {effect.setFloat2("screenSize", blurTextureWidth, blurTextureHeight);}), this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess]) : (this._horizontalBlurPostprocess = new BlurPostProcess("HighlightLayerHBP", new math_vector/* Vector2 */.FM(1, 0), this._options.blurHorizontalSize / 2, { width: blurTextureWidth, height: blurTextureHeight }, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, textureType), this._horizontalBlurPostprocess.width = blurTextureWidth, this._horizontalBlurPostprocess.height = blurTextureHeight, this._horizontalBlurPostprocess.externalTextureSamplerBinding = !0, this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {effect.setTexture("textureSampler", this._mainTexture);}), this._verticalBlurPostprocess = new BlurPostProcess("HighlightLayerVBP", new math_vector/* Vector2 */.FM(0, 1), this._options.blurVerticalSize / 2, { width: blurTextureWidth, height: blurTextureHeight }, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, textureType), this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess]), this._mainTexture.onAfterUnbindObservable.add(() => {this.onBeforeBlurObservable.notifyObservers(this);const internalTexture = this._blurTexture.renderTarget;internalTexture && (this._scene.postProcessManager.directRender(this._postProcesses, internalTexture, !0), this._engine.unBindFramebuffer(internalTexture, !0)), this.onAfterBlurObservable.notifyObservers(this);}), this._postProcesses.map((pp) => {pp.autoClear = !1;});}needStencil() {return !0;}isReady(subMesh, useInstances) {const material = subMesh.getMaterial(),mesh = subMesh.getRenderingMesh();if (!material || !mesh || !this._meshes) return !1;let emissiveTexture = null;const highlightLayerMesh = this._meshes[mesh.uniqueId];return highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material && (emissiveTexture = material.emissiveTexture), super._isReady(subMesh, useInstances, emissiveTexture);}_internalRender(effect, renderIndex) {effect.setTexture("textureSampler", this._blurTexture);const engine = this._engine;engine.cacheStencilState(), engine.setStencilOperationPass(7681), engine.setStencilOperationFail(7680), engine.setStencilOperationDepthFail(7680), engine.setStencilMask(0), engine.setStencilBuffer(!0), engine.setStencilFunctionReference(this._instanceGlowingMeshStencilReference), this.outerGlow && 0 === renderIndex && (effect.setFloat("offset", 0), engine.setStencilFunction(517), engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, 6)), this.innerGlow && 1 === renderIndex && (effect.setFloat("offset", 1), engine.setStencilFunction(514), engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, 6)), engine.restoreStencilState();}shouldRender() {return !!super.shouldRender() && !!this._meshes;}_shouldRenderMesh(mesh) {return !(this._excludedMeshes && this._excludedMeshes[mesh.uniqueId]) && !!super.hasMesh(mesh);}_canRenderMesh() {return !0;}_addCustomEffectDefines(defines) {defines.push("#define HIGHLIGHT");}_setEmissiveTextureAndColor(mesh, subMesh, material) {const highlightLayerMesh = this._meshes[mesh.uniqueId];highlightLayerMesh ? this._emissiveTextureAndColor.color.set(highlightLayerMesh.color.r, highlightLayerMesh.color.g, highlightLayerMesh.color.b, 1) : this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a), highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material ? (this._emissiveTextureAndColor.texture = material.emissiveTexture, this._emissiveTextureAndColor.color.set(1, 1, 1, 1)) : this._emissiveTextureAndColor.texture = null;}addExcludedMesh(mesh) {if (this._excludedMeshes) {const meshExcluded = this._excludedMeshes[mesh.uniqueId];meshExcluded || (this._excludedMeshes[mesh.uniqueId] = { mesh: mesh, beforeBind: mesh.onBeforeBindObservable.add((mesh) => {mesh.getEngine().setStencilBuffer(!1);}), afterRender: mesh.onAfterRenderObservable.add((mesh) => {mesh.getEngine().setStencilBuffer(!0);}) });}}removeExcludedMesh(mesh) {if (this._excludedMeshes) {const meshExcluded = this._excludedMeshes[mesh.uniqueId];meshExcluded && (meshExcluded.beforeBind && mesh.onBeforeBindObservable.remove(meshExcluded.beforeBind), meshExcluded.afterRender && mesh.onAfterRenderObservable.remove(meshExcluded.afterRender)), this._excludedMeshes[mesh.uniqueId] = null;}}hasMesh(mesh) {return !!this._meshes && !!super.hasMesh(mesh) && this._meshes[mesh.uniqueId] !== void 0 && null !== this._meshes[mesh.uniqueId];}addMesh(mesh, color, glowEmissiveOnly = !1) {if (this._meshes) {const meshHighlight = this._meshes[mesh.uniqueId];meshHighlight ? meshHighlight.color = color : (this._meshes[mesh.uniqueId] = { mesh: mesh, color: color, observerHighlight: mesh.onBeforeBindObservable.add((mesh) => {this.isEnabled && (this._excludedMeshes && this._excludedMeshes[mesh.uniqueId] ? this._defaultStencilReference(mesh) : mesh.getScene().getEngine().setStencilFunctionReference(this._instanceGlowingMeshStencilReference));}), observerDefault: mesh.onAfterRenderObservable.add((mesh) => {this.isEnabled && this._defaultStencilReference(mesh);}), glowEmissiveOnly: glowEmissiveOnly }, mesh.onDisposeObservable.add(() => {this._disposeMesh(mesh);})), this._shouldRender = !0;}}removeMesh(mesh) {if (this._meshes) {const meshHighlight = this._meshes[mesh.uniqueId];for (const meshHighlightToCheck in meshHighlight && (meshHighlight.observerHighlight && mesh.onBeforeBindObservable.remove(meshHighlight.observerHighlight), meshHighlight.observerDefault && mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault), delete this._meshes[mesh.uniqueId]), this._shouldRender = !1, this._meshes) if (this._meshes[meshHighlightToCheck]) {this._shouldRender = !0;break;}}}removeAllMeshes() {if (this._meshes) for (const uniqueId in this._meshes) if (Object.prototype.hasOwnProperty.call(this._meshes, uniqueId)) {const mesh = this._meshes[uniqueId];mesh && this.removeMesh(mesh.mesh);}}_defaultStencilReference(mesh) {mesh.getScene().getEngine().setStencilFunctionReference(HighlightLayer.NormalMeshStencilReference);}_disposeMesh(mesh) {this.removeMesh(mesh), this.removeExcludedMesh(mesh);}dispose() {if (this._meshes) {for (const id in this._meshes) {const meshHighlight = this._meshes[id];meshHighlight && meshHighlight.mesh && (meshHighlight.observerHighlight && meshHighlight.mesh.onBeforeBindObservable.remove(meshHighlight.observerHighlight), meshHighlight.observerDefault && meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault));}this._meshes = null;}if (this._excludedMeshes) {for (const id in this._excludedMeshes) {const meshHighlight = this._excludedMeshes[id];meshHighlight && (meshHighlight.beforeBind && meshHighlight.mesh.onBeforeBindObservable.remove(meshHighlight.beforeBind), meshHighlight.afterRender && meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.afterRender));}this._excludedMeshes = null;}super.dispose();}getClassName() {return "HighlightLayer";}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this);if (serializationObject.customType = "BABYLON.HighlightLayer", serializationObject.meshes = [], this._meshes) for (const m in this._meshes) {const mesh = this._meshes[m];mesh && serializationObject.meshes.push({ glowEmissiveOnly: mesh.glowEmissiveOnly, color: mesh.color.asArray(), meshId: mesh.mesh.id });}if (serializationObject.excludedMeshes = [], this._excludedMeshes) for (const e in this._excludedMeshes) {const excludedMesh = this._excludedMeshes[e];excludedMesh && serializationObject.excludedMeshes.push(excludedMesh.mesh.id);}return serializationObject;}static Parse(parsedHightlightLayer, scene, rootUrl) {const hl = decorators/* SerializationHelper.Parse */.p4.Parse(() => new HighlightLayer(parsedHightlightLayer.name, scene, parsedHightlightLayer.options), parsedHightlightLayer, scene, rootUrl);let index;for (index = 0; index < parsedHightlightLayer.excludedMeshes.length; index++) {const mesh = scene.getMeshById(parsedHightlightLayer.excludedMeshes[index]);mesh && hl.addExcludedMesh(mesh);}for (index = 0; index < parsedHightlightLayer.meshes.length; index++) {const highlightedMesh = parsedHightlightLayer.meshes[index],mesh = scene.getMeshById(highlightedMesh.meshId);mesh && hl.addMesh(mesh, math_color/* Color3.FromArray */.Wo.FromArray(highlightedMesh.color), highlightedMesh.glowEmissiveOnly);}return hl;}}HighlightLayer.EffectName = "HighlightLayer", HighlightLayer.NeutralColor = new math_color/* Color4 */.HE(0, 0, 0, 0), HighlightLayer.GlowingMeshStencilReference = 2, HighlightLayer.NormalMeshStencilReference = 1, (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], HighlightLayer.prototype, "innerGlow", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], HighlightLayer.prototype, "outerGlow", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], HighlightLayer.prototype, "blurHorizontalSize", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], HighlightLayer.prototype, "blurVerticalSize", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("options")], HighlightLayer.prototype, "_options", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.HighlightLayer", HighlightLayer);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Layers/layerSceneComponent.js
class LayerSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_LAYER */.l.NAME_LAYER, this.scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;this.scene && (this._engine = this.scene.getEngine(), this.scene.layers = []);}register() {this.scene._beforeCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORECAMERADRAW_LAYER */.l.STEP_BEFORECAMERADRAW_LAYER, this, this._drawCameraBackground), this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERCAMERADRAW_LAYER */.l.STEP_AFTERCAMERADRAW_LAYER, this, this._drawCameraForegroundWithPostProcessing), this.scene._afterCameraPostProcessStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERCAMERAPOSTPROCESS_LAYER */.l.STEP_AFTERCAMERAPOSTPROCESS_LAYER, this, this._drawCameraForegroundWithoutPostProcessing), this.scene._beforeRenderTargetDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_LAYER */.l.STEP_BEFORERENDERTARGETDRAW_LAYER, this, this._drawRenderTargetBackground), this.scene._afterRenderTargetDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_LAYER */.l.STEP_AFTERRENDERTARGETDRAW_LAYER, this, this._drawRenderTargetForegroundWithPostProcessing), this.scene._afterRenderTargetPostProcessStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER */.l.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER, this, this._drawRenderTargetForegroundWithoutPostProcessing);}rebuild() {const layers = this.scene.layers;for (const layer of layers) layer._rebuild();}dispose() {for (const layers = this.scene.layers; layers.length;) layers[0].dispose();}_draw(predicate) {const layers = this.scene.layers;if (layers.length) {this._engine.setDepthBuffer(!1);for (const layer of layers) predicate(layer) && layer.render();this._engine.setDepthBuffer(!0);}}_drawCameraPredicate(layer, isBackground, applyPostProcess, cameraLayerMask) {return !layer.renderOnlyInRenderTargetTextures && layer.isBackground === isBackground && layer.applyPostProcess === applyPostProcess && 0 != (layer.layerMask & cameraLayerMask);}_drawCameraBackground(camera) {this._draw((layer) => this._drawCameraPredicate(layer, !0, !0, camera.layerMask));}_drawCameraForegroundWithPostProcessing(camera) {this._draw((layer) => this._drawCameraPredicate(layer, !1, !0, camera.layerMask));}_drawCameraForegroundWithoutPostProcessing(camera) {this._draw((layer) => this._drawCameraPredicate(layer, !1, !1, camera.layerMask));}_drawRenderTargetPredicate(layer, isBackground, applyPostProcess, cameraLayerMask, renderTargetTexture) {return 0 < layer.renderTargetTextures.length && layer.isBackground === isBackground && layer.applyPostProcess === applyPostProcess && -1 < layer.renderTargetTextures.indexOf(renderTargetTexture) && 0 != (layer.layerMask & cameraLayerMask);}_drawRenderTargetBackground(renderTarget) {this._draw((layer) => this._drawRenderTargetPredicate(layer, !0, !0, this.scene.activeCamera.layerMask, renderTarget));}_drawRenderTargetForegroundWithPostProcessing(renderTarget) {this._draw((layer) => this._drawRenderTargetPredicate(layer, !1, !0, this.scene.activeCamera.layerMask, renderTarget));}_drawRenderTargetForegroundWithoutPostProcessing(renderTarget) {this._draw((layer) => this._drawRenderTargetPredicate(layer, !1, !1, this.scene.activeCamera.layerMask, renderTarget));}addFromContainer(container) {container.layers && container.layers.forEach((layer) => {this.scene.layers.push(layer);});}removeFromContainer(container, dispose = !1) {container.layers && container.layers.forEach((layer) => {const index = this.scene.layers.indexOf(layer);-1 !== index && this.scene.layers.splice(index, 1), dispose && layer.dispose();});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/layer.fragment.js
const layer_fragment_name = "layerPixelShader",layer_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform vec4 color;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 baseColor=texture2D(textureSampler,vUV);
#ifdef LINEAR
baseColor.rgb=toGammaSpace(baseColor.rgb);
#endif
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
gl_FragColor=baseColor*color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.layerPixelShader */.v.ShadersStore.layerPixelShader = layer_fragment_shader;const layerPixelShader = { name: "layerPixelShader", shader: layer_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/layer.vertex.js
const layer_vertex_name = "layerVertexShader",layer_vertex_shader = `attribute vec2 position;
uniform vec2 scale;
uniform vec2 offset;
uniform mat4 textureMatrix;
varying vec2 vUV;
const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec2 shiftedPosition=position*scale+offset;
vUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));
gl_Position=vec4(shiftedPosition,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.layerVertexShader */.v.ShadersStore.layerVertexShader = layer_vertex_shader;const layerVertexShader = { name: "layerVertexShader", shader: layer_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Layers/layer.js
class Layer {set applyPostProcess(value) {this._applyPostProcess = value;}get applyPostProcess() {return this.isBackground || this._applyPostProcess;}set onDispose(callback) {this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(callback);}set onBeforeRender(callback) {this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);}set onAfterRender(callback) {this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);}constructor(name, imgUrl, scene, isBackground, color) {this.name = name, this._applyPostProcess = !0, this.scale = new math_vector/* Vector2 */.FM(1, 1), this.offset = new math_vector/* Vector2 */.FM(0, 0), this.alphaBlendingMode = 2, this.layerMask = 268435455, this.renderTargetTextures = [], this.renderOnlyInRenderTargetTextures = !1, this.isEnabled = !0, this._vertexBuffers = {}, this.onDisposeObservable = new observable/* Observable */.y$(), this.onBeforeRenderObservable = new observable/* Observable */.y$(), this.onAfterRenderObservable = new observable/* Observable */.y$(), this.texture = imgUrl ? new Textures_texture/* Texture */.x(imgUrl, scene, !0) : null, this.isBackground = !(isBackground !== void 0) || isBackground, this.color = color === void 0 ? new math_color/* Color4 */.HE(1, 1, 1, 1) : color, this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;let layerComponent = this._scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_LAYER */.l.NAME_LAYER);layerComponent || (layerComponent = new LayerSceneComponent(this._scene), this._scene._addComponent(layerComponent)), this._scene.layers.push(this);const engine = this._scene.getEngine();this._drawWrapper = new Materials_drawWrapper/* DrawWrapper */.q(engine);const vertexBuffer = new Buffers_buffer/* VertexBuffer */.o(engine, [1, 1, -1, 1, -1, -1, 1, -1], Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, !1, !1, 2);this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = vertexBuffer, this._createIndexBuffer();}_createIndexBuffer() {const engine = this._scene.getEngine(),indices = [];indices.push(0), indices.push(1), indices.push(2), indices.push(0), indices.push(2), indices.push(3), this._indexBuffer = engine.createIndexBuffer(indices);}_rebuild() {const vb = this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];vb && vb._rebuild(), this._createIndexBuffer();}render() {if (!this.isEnabled) return;const engine = this._scene.getEngine();let defines = "";this.alphaTest && (defines = "#define ALPHATEST"), this.texture && !this.texture.gammaSpace && (defines += "\r\n#define LINEAR"), this._previousDefines !== defines && (this._previousDefines = defines, this._drawWrapper.effect = engine.createEffect("layer", [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], defines));const currentEffect = this._drawWrapper.effect;currentEffect && currentEffect.isReady() && this.texture && this.texture.isReady() && (this.onBeforeRenderObservable.notifyObservers(this), engine.enableEffect(this._drawWrapper), engine.setState(!1), currentEffect.setTexture("textureSampler", this.texture), currentEffect.setMatrix("textureMatrix", this.texture.getTextureMatrix()), currentEffect.setFloat4("color", this.color.r, this.color.g, this.color.b, this.color.a), currentEffect.setVector2("offset", this.offset), currentEffect.setVector2("scale", this.scale), engine.bindBuffers(this._vertexBuffers, this._indexBuffer, currentEffect), this.alphaTest ? engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, 6) : (engine.setAlphaMode(this.alphaBlendingMode), engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, 6), engine.setAlphaMode(0)), this.onAfterRenderObservable.notifyObservers(this));}dispose() {const vertexBuffer = this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];vertexBuffer && (vertexBuffer.dispose(), this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this.texture && (this.texture.dispose(), this.texture = null), this.renderTargetTextures = [];const index = this._scene.layers.indexOf(this);this._scene.layers.splice(index, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderObservable.clear();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Layers/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/LensFlares/lensFlare.js
class LensFlare {static AddFlare(size, position, color, imgUrl, system) {return new LensFlare(size, position, color, imgUrl, system);}constructor(size, position, color, imgUrl, system) {this.size = size, this.position = position, this.alphaMode = 6, this.color = color || new math_color/* Color3 */.Wo(1, 1, 1), this.texture = imgUrl ? new Textures_texture/* Texture */.x(imgUrl, system.getScene(), !0) : null, this._system = system;const engine = system.scene.getEngine();this._drawWrapper = new Materials_drawWrapper/* DrawWrapper */.q(engine), this._drawWrapper.effect = engine.createEffect("lensFlare", [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], ["color", "viewportMatrix"], ["textureSampler"], ""), system.lensFlares.push(this);}dispose() {this.texture && this.texture.dispose();const index = this._system.lensFlares.indexOf(this);this._system.lensFlares.splice(index, 1);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/lensFlare.fragment.js
const lensFlare_fragment_name = "lensFlarePixelShader",lensFlare_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform vec4 color;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 baseColor=texture2D(textureSampler,vUV);
gl_FragColor=baseColor*color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.lensFlarePixelShader */.v.ShadersStore.lensFlarePixelShader = lensFlare_fragment_shader;const lensFlarePixelShader = { name: "lensFlarePixelShader", shader: lensFlare_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/lensFlare.vertex.js
const lensFlare_vertex_name = "lensFlareVertexShader",lensFlare_vertex_shader = `attribute vec2 position;
uniform mat4 viewportMatrix;
varying vec2 vUV;
const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=position*madd+madd;
gl_Position=viewportMatrix*vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.lensFlareVertexShader */.v.ShadersStore.lensFlareVertexShader = lensFlare_vertex_shader;const lensFlareVertexShader = { name: "lensFlareVertexShader", shader: lensFlare_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/LensFlares/lensFlareSystem.js
class LensFlareSystem {get scene() {return this._scene;}constructor(name, emitter, scene) {this.name = name, this.lensFlares = [], this.borderLimit = 300, this.viewportBorder = 0, this.layerMask = 268435455, this._vertexBuffers = {}, this._isEnabled = !0, this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, LensFlareSystem._SceneComponentInitialization(this._scene), this._emitter = emitter, this.id = name, scene.lensFlareSystems.push(this), this.meshesSelectionPredicate = (m) => scene.activeCamera && m.material && m.isVisible && m.isEnabled() && m.isBlocker && 0 != (m.layerMask & scene.activeCamera.layerMask);const engine = scene.getEngine(),vertices = [];vertices.push(1, 1), vertices.push(-1, 1), vertices.push(-1, -1), vertices.push(1, -1), this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = new Buffers_buffer/* VertexBuffer */.o(engine, vertices, Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, !1, !1, 2), this._createIndexBuffer();}_createIndexBuffer() {const indices = [];indices.push(0), indices.push(1), indices.push(2), indices.push(0), indices.push(2), indices.push(3), this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);}get isEnabled() {return this._isEnabled;}set isEnabled(value) {this._isEnabled = value;}getScene() {return this._scene;}getEmitter() {return this._emitter;}setEmitter(newEmitter) {this._emitter = newEmitter;}getEmitterPosition() {return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;}computeEffectivePosition(globalViewport) {let position = this.getEmitterPosition();position = math_vector/* Vector3.Project */.P.Project(position, math_vector/* Matrix.Identity */.y3.Identity(), this._scene.getTransformMatrix(), globalViewport), this._positionX = position.x, this._positionY = position.y, position = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(this.getEmitterPosition(), this._scene.getViewMatrix()), 0 < this.viewportBorder && (globalViewport.x -= this.viewportBorder, globalViewport.y -= this.viewportBorder, globalViewport.width += 2 * this.viewportBorder, globalViewport.height += 2 * this.viewportBorder, position.x += this.viewportBorder, position.y += this.viewportBorder, this._positionX += this.viewportBorder, this._positionY += this.viewportBorder);const rhs = this._scene.useRightHandedSystem,okZ = 0 < position.z && !rhs || 0 > position.z && rhs;return !!okZ && (!!(this._positionX > globalViewport.x && this._positionX < globalViewport.x + globalViewport.width && this._positionY > globalViewport.y && this._positionY < globalViewport.y + globalViewport.height) || !0);}_isVisible() {if (!this._isEnabled || !this._scene.activeCamera) return !1;const emitterPosition = this.getEmitterPosition(),direction = emitterPosition.subtract(this._scene.activeCamera.globalPosition),distance = direction.length();direction.normalize();const ray = new Ray(this._scene.activeCamera.globalPosition, direction),pickInfo = this._scene.pickWithRay(ray, this.meshesSelectionPredicate, !0);return !pickInfo || !pickInfo.hit || pickInfo.distance > distance;}render() {if (!this._scene.activeCamera) return !1;const engine = this._scene.getEngine(),viewport = this._scene.activeCamera.viewport,globalViewport = viewport.toGlobal(engine.getRenderWidth(!0), engine.getRenderHeight(!0));if (!this.computeEffectivePosition(globalViewport)) return !1;if (!this._isVisible()) return !1;let awayX, awayY;awayX = this._positionX < this.borderLimit + globalViewport.x ? this.borderLimit + globalViewport.x - this._positionX : this._positionX > globalViewport.x + globalViewport.width - this.borderLimit ? this._positionX - globalViewport.x - globalViewport.width + this.borderLimit : 0, awayY = this._positionY < this.borderLimit + globalViewport.y ? this.borderLimit + globalViewport.y - this._positionY : this._positionY > globalViewport.y + globalViewport.height - this.borderLimit ? this._positionY - globalViewport.y - globalViewport.height + this.borderLimit : 0;let away = awayX > awayY ? awayX : awayY;away -= this.viewportBorder, away > this.borderLimit && (away = this.borderLimit);let intensity = 1 - math_scalar/* Scalar.Clamp */.R.Clamp(away / this.borderLimit, 0, 1);if (0 > intensity) return !1;1 < intensity && (intensity = 1), 0 < this.viewportBorder && (globalViewport.x += this.viewportBorder, globalViewport.y += this.viewportBorder, globalViewport.width -= 2 * this.viewportBorder, globalViewport.height -= 2 * this.viewportBorder, this._positionX -= this.viewportBorder, this._positionY -= this.viewportBorder);const centerX = globalViewport.x + globalViewport.width / 2,centerY = globalViewport.y + globalViewport.height / 2,distX = centerX - this._positionX,distY = centerY - this._positionY;engine.setState(!1), engine.setDepthBuffer(!1);for (let index = 0; index < this.lensFlares.length; index++) {const flare = this.lensFlares[index];if (!flare._drawWrapper.effect.isReady() || flare.texture && !flare.texture.isReady()) continue;engine.enableEffect(flare._drawWrapper), engine.bindBuffers(this._vertexBuffers, this._indexBuffer, flare._drawWrapper.effect), engine.setAlphaMode(flare.alphaMode);const x = centerX - distX * flare.position,y = centerY - distY * flare.position,cw = flare.size,ch = flare.size * engine.getAspectRatio(this._scene.activeCamera, !0),cx = 2 * (x / (globalViewport.width + 2 * globalViewport.x)) - 1,cy = 1 - 2 * (y / (globalViewport.height + 2 * globalViewport.y)),viewportMatrix = math_vector/* Matrix.FromValues */.y3.FromValues(cw / 2, 0, 0, 0, 0, ch / 2, 0, 0, 0, 0, 1, 0, cx, cy, 0, 1);flare._drawWrapper.effect.setMatrix("viewportMatrix", viewportMatrix), flare._drawWrapper.effect.setTexture("textureSampler", flare.texture), flare._drawWrapper.effect.setFloat4("color", flare.color.r * intensity, flare.color.g * intensity, flare.color.b * intensity, 1), engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, 6);}return engine.setDepthBuffer(!0), engine.setAlphaMode(0), !0;}rebuild() {var _a;for (const key in this._createIndexBuffer(), this._vertexBuffers) null === (_a = this._vertexBuffers[key]) || void 0 === _a ? void 0 : _a._rebuild();}dispose() {const vertexBuffer = this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];for (vertexBuffer && (vertexBuffer.dispose(), this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null); this.lensFlares.length;) this.lensFlares[0].dispose();const index = this._scene.lensFlareSystems.indexOf(this);this._scene.lensFlareSystems.splice(index, 1);}static Parse(parsedLensFlareSystem, scene, rootUrl) {const emitter = scene.getLastEntryById(parsedLensFlareSystem.emitterId),name = parsedLensFlareSystem.name || "lensFlareSystem#" + parsedLensFlareSystem.emitterId,lensFlareSystem = new LensFlareSystem(name, emitter, scene);lensFlareSystem.id = parsedLensFlareSystem.id || name, lensFlareSystem.borderLimit = parsedLensFlareSystem.borderLimit;for (let index = 0; index < parsedLensFlareSystem.flares.length; index++) {const parsedFlare = parsedLensFlareSystem.flares[index];LensFlare.AddFlare(parsedFlare.size, parsedFlare.position, math_color/* Color3.FromArray */.Wo.FromArray(parsedFlare.color), parsedFlare.textureName ? rootUrl + parsedFlare.textureName : "", lensFlareSystem);}return lensFlareSystem;}serialize() {const serializationObject = { id: this.id, name: this.name, emitterId: this.getEmitter().id, borderLimit: this.borderLimit, flares: [] };for (let index = 0; index < this.lensFlares.length; index++) {const flare = this.lensFlares[index];serializationObject.flares.push({ size: flare.size, position: flare.position, color: flare.color.asArray(), textureName: tools/* Tools.GetFilename */.w1.GetFilename(flare.texture ? flare.texture.name : "") });}return serializationObject;}}LensFlareSystem._SceneComponentInitialization = () => {throw (0,devTools/* _WarnImport */.S)("LensFlareSystemSceneComponent");};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/LensFlares/lensFlareSystemSceneComponent.js
abstractScene/* AbstractScene.AddParser */.p.AddParser(sceneComponent/* SceneComponentConstants.NAME_LENSFLARESYSTEM */.l.NAME_LENSFLARESYSTEM, (parsedData, scene, container, rootUrl) => {if (parsedData.lensFlareSystems !== void 0 && null !== parsedData.lensFlareSystems) {container.lensFlareSystems || (container.lensFlareSystems = []);for (let index = 0, cache = parsedData.lensFlareSystems.length; index < cache; index++) {const parsedLensFlareSystem = parsedData.lensFlareSystems[index],lf = LensFlareSystem.Parse(parsedLensFlareSystem, scene, rootUrl);container.lensFlareSystems.push(lf);}}}), abstractScene/* AbstractScene.prototype.getLensFlareSystemByName */.p.prototype.getLensFlareSystemByName = function (name) {for (let index = 0; index < this.lensFlareSystems.length; index++) if (this.lensFlareSystems[index].name === name) return this.lensFlareSystems[index];return null;}, abstractScene/* AbstractScene.prototype.getLensFlareSystemById */.p.prototype.getLensFlareSystemById = function (id) {for (let index = 0; index < this.lensFlareSystems.length; index++) if (this.lensFlareSystems[index].id === id) return this.lensFlareSystems[index];return null;}, abstractScene/* AbstractScene.prototype.getLensFlareSystemByID */.p.prototype.getLensFlareSystemByID = function (id) {return this.getLensFlareSystemById(id);}, abstractScene/* AbstractScene.prototype.removeLensFlareSystem */.p.prototype.removeLensFlareSystem = function (toRemove) {const index = this.lensFlareSystems.indexOf(toRemove);return -1 !== index && this.lensFlareSystems.splice(index, 1), index;}, abstractScene/* AbstractScene.prototype.addLensFlareSystem */.p.prototype.addLensFlareSystem = function (newLensFlareSystem) {this.lensFlareSystems.push(newLensFlareSystem);};class LensFlareSystemSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_LENSFLARESYSTEM */.l.NAME_LENSFLARESYSTEM, this.scene = scene, scene.lensFlareSystems = [];}register() {this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM */.l.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM, this, this._draw);}rebuild() {for (let index = 0; index < this.scene.lensFlareSystems.length; index++) this.scene.lensFlareSystems[index].rebuild();}addFromContainer(container) {container.lensFlareSystems && container.lensFlareSystems.forEach((o) => {this.scene.addLensFlareSystem(o);});}removeFromContainer(container, dispose) {container.lensFlareSystems && container.lensFlareSystems.forEach((o) => {this.scene.removeLensFlareSystem(o), dispose && o.dispose();});}serialize(serializationObject) {serializationObject.lensFlareSystems = [];const lensFlareSystems = this.scene.lensFlareSystems;for (const lensFlareSystem of lensFlareSystems) serializationObject.lensFlareSystems.push(lensFlareSystem.serialize());}dispose() {for (const lensFlareSystems = this.scene.lensFlareSystems; lensFlareSystems.length;) lensFlareSystems[0].dispose();}_draw(camera) {if (this.scene.lensFlaresEnabled) {const lensFlareSystems = this.scene.lensFlareSystems;tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Lens flares", 0 < lensFlareSystems.length);for (const lensFlareSystem of lensFlareSystems) 0 != (camera.layerMask & lensFlareSystem.layerMask) && lensFlareSystem.render();tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Lens flares", 0 < lensFlareSystems.length);}}}LensFlareSystem._SceneComponentInitialization = (scene) => {let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_LENSFLARESYSTEM */.l.NAME_LENSFLARESYSTEM);component || (component = new LensFlareSystemSceneComponent(scene), scene._addComponent(component));};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/LensFlares/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/shadowLight.js
var shadowLight = __webpack_require__("./node_modules/@babylonjs/core/Lights/shadowLight.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Rendering/renderingManager.js
var renderingManager = __webpack_require__("./node_modules/@babylonjs/core/Rendering/renderingManager.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bayerDitherFunctions.js
const bayerDitherFunctions_name = "bayerDitherFunctions",bayerDitherFunctions_shader = `float bayerDither2(vec2 _P) {
return mod(2.0*_P.y+_P.x+1.0,4.0);
}
float bayerDither4(vec2 _P) {
vec2 P1=mod(_P,2.0); 
vec2 P2=floor(0.5*mod(_P,4.0)); 
return 4.0*bayerDither2(P1)+bayerDither2(P2);
}
float bayerDither8(vec2 _P) {
vec2 P1=mod(_P,2.0); 
vec2 P2=floor(0.5 *mod(_P,4.0)); 
vec2 P4=floor(0.25*mod(_P,8.0)); 
return 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);
}
`;shaderStore/* ShaderStore.IncludesShadersStore.bayerDitherFunctions */.v.IncludesShadersStore.bayerDitherFunctions = bayerDitherFunctions_shader;const bayerDitherFunctions = { name: "bayerDitherFunctions", shader: bayerDitherFunctions_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragmentExtraDeclaration.js
const shadowMapFragmentExtraDeclaration_name = "shadowMapFragmentExtraDeclaration",shadowMapFragmentExtraDeclaration_shader = `#if SM_FLOAT==0
#include<packingFunctions>
#endif
#if SM_SOFTTRANSPARENTSHADOW==1
#include<bayerDitherFunctions>
uniform float softTransparentShadowSM;
#endif
varying float vDepthMetricSM;
#if SM_USEDISTANCE==1
uniform vec3 lightDataSM;
varying vec3 vPositionWSM;
#endif
uniform vec3 biasAndScaleSM;
uniform vec2 depthValuesSM;
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
varying float zSM;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.shadowMapFragmentExtraDeclaration */.v.IncludesShadersStore.shadowMapFragmentExtraDeclaration = shadowMapFragmentExtraDeclaration_shader;const shadowMapFragmentExtraDeclaration = { name: "shadowMapFragmentExtraDeclaration", shader: shadowMapFragmentExtraDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragment.js
const shadowMapFragment_name = "shadowMapFragment",shadowMapFragment_shader = `float depthSM=vDepthMetricSM;
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
#if SM_USEDISTANCE==1
depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#else
#ifdef USE_REVERSE_DEPTHBUFFER
depthSM=(-zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#else
depthSM=(zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#endif
#endif
#ifdef USE_REVERSE_DEPTHBUFFER
gl_FragDepth=clamp(1.0-depthSM,0.0,1.0);
#else
gl_FragDepth=clamp(depthSM,0.0,1.0); 
#endif
#elif SM_USEDISTANCE==1
depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#endif
#if SM_ESM==1
depthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.);
#endif
#if SM_FLOAT==1
gl_FragColor=vec4(depthSM,1.0,1.0,1.0);
#else
gl_FragColor=pack(depthSM);
#endif
return;`;shaderStore/* ShaderStore.IncludesShadersStore.shadowMapFragment */.v.IncludesShadersStore.shadowMapFragment = shadowMapFragment_shader;const shadowMapFragment = { name: "shadowMapFragment", shader: shadowMapFragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/shadowMap.fragment.js
const shadowMap_fragment_name = "shadowMapPixelShader",shadowMap_fragment_shader = `#include<shadowMapFragmentExtraDeclaration>
#ifdef ALPHATEXTURE
varying vec2 vUV;
uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#include<clipPlaneFragment>
#ifdef ALPHATEXTURE
float alphaFromAlphaTexture=texture2D(diffuseSampler,vUV).a;
#ifdef ALPHATESTVALUE
if (alphaFromAlphaTexture<ALPHATESTVALUE)
discard;
#endif
#endif
#if SM_SOFTTRANSPARENTSHADOW==1
#ifdef ALPHATEXTURE
if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alphaFromAlphaTexture) discard;
#else
if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM) discard;
#endif
#endif
#include<shadowMapFragment>
}`;shaderStore/* ShaderStore.ShadersStore.shadowMapPixelShader */.v.ShadersStore.shadowMapPixelShader = shadowMap_fragment_shader;const shadowMapPixelShader = { name: "shadowMapPixelShader", shader: shadowMap_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneVertexDeclaration.js
const sceneVertexDeclaration_name = "sceneVertexDeclaration",sceneVertexDeclaration_shader = `uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
uniform mat4 view;
uniform mat4 projection;
uniform vec4 vEyePosition;
`;shaderStore/* ShaderStore.IncludesShadersStore.sceneVertexDeclaration */.v.IncludesShadersStore.sceneVertexDeclaration = sceneVertexDeclaration_shader;const sceneVertexDeclaration = { name: "sceneVertexDeclaration", shader: sceneVertexDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshVertexDeclaration.js
const meshVertexDeclaration_name = "meshVertexDeclaration",meshVertexDeclaration_shader = `uniform mat4 world;
uniform float visibility;
`;shaderStore/* ShaderStore.IncludesShadersStore.meshVertexDeclaration */.v.IncludesShadersStore.meshVertexDeclaration = meshVertexDeclaration_shader;const meshVertexDeclaration = { name: "meshVertexDeclaration", shader: meshVertexDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexDeclaration.js
const shadowMapVertexDeclaration_name = "shadowMapVertexDeclaration",shadowMapVertexDeclaration_shader = `#include<sceneVertexDeclaration>
#include<meshVertexDeclaration>
`;shaderStore/* ShaderStore.IncludesShadersStore.shadowMapVertexDeclaration */.v.IncludesShadersStore.shadowMapVertexDeclaration = shadowMapVertexDeclaration_shader;const shadowMapVertexDeclaration = { name: "shadowMapVertexDeclaration", shader: shadowMapVertexDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js
var ShadersInclude_meshUboDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapUboDeclaration.js
const shadowMapUboDeclaration_name = "shadowMapUboDeclaration",shadowMapUboDeclaration_shader = `layout(std140,column_major) uniform;
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;shaderStore/* ShaderStore.IncludesShadersStore.shadowMapUboDeclaration */.v.IncludesShadersStore.shadowMapUboDeclaration = shadowMapUboDeclaration_shader;const shadowMapUboDeclaration = { name: "shadowMapUboDeclaration", shader: shadowMapUboDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexExtraDeclaration.js
const shadowMapVertexExtraDeclaration_name = "shadowMapVertexExtraDeclaration",shadowMapVertexExtraDeclaration_shader = `#if SM_NORMALBIAS==1
uniform vec3 lightDataSM;
#endif
uniform vec3 biasAndScaleSM;
uniform vec2 depthValuesSM;
varying float vDepthMetricSM;
#if SM_USEDISTANCE==1
varying vec3 vPositionWSM;
#endif
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
varying float zSM;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.shadowMapVertexExtraDeclaration */.v.IncludesShadersStore.shadowMapVertexExtraDeclaration = shadowMapVertexExtraDeclaration_shader;const shadowMapVertexExtraDeclaration = { name: "shadowMapVertexExtraDeclaration", shader: shadowMapVertexExtraDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexNormalBias.js
const shadowMapVertexNormalBias_name = "shadowMapVertexNormalBias",shadowMapVertexNormalBias_shader = `#if SM_NORMALBIAS==1
#if SM_DIRECTIONINLIGHTDATA==1
vec3 worldLightDirSM=normalize(-lightDataSM.xyz);
#else
vec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;
vec3 worldLightDirSM=normalize(directionToLightSM);
#endif
float ndlSM=dot(vNormalW,worldLightDirSM);
float sinNLSM=sqrt(1.0-ndlSM*ndlSM);
float normalBiasSM=biasAndScaleSM.y*sinNLSM;
worldPos.xyz-=vNormalW*normalBiasSM;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.shadowMapVertexNormalBias */.v.IncludesShadersStore.shadowMapVertexNormalBias = shadowMapVertexNormalBias_shader;const shadowMapVertexNormalBias = { name: "shadowMapVertexNormalBias", shader: shadowMapVertexNormalBias_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexMetric.js
const shadowMapVertexMetric_name = "shadowMapVertexMetric",shadowMapVertexMetric_shader = `#if SM_USEDISTANCE==1
vPositionWSM=worldPos.xyz;
#endif
#if SM_DEPTHTEXTURE==1
#ifdef IS_NDC_HALF_ZRANGE
#define BIASFACTOR 0.5
#else
#define BIASFACTOR 1.0
#endif
#ifdef USE_REVERSE_DEPTHBUFFER
gl_Position.z-=biasAndScaleSM.x*gl_Position.w*BIASFACTOR;
#else
gl_Position.z+=biasAndScaleSM.x*gl_Position.w*BIASFACTOR;
#endif
#endif
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
zSM=gl_Position.z;
gl_Position.z=0.0;
#elif SM_USEDISTANCE==0
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetricSM=(-gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#else
vDepthMetricSM=(gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#endif
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.shadowMapVertexMetric */.v.IncludesShadersStore.shadowMapVertexMetric = shadowMapVertexMetric_shader;const shadowMapVertexMetric = { name: "shadowMapVertexMetric", shader: shadowMapVertexMetric_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/shadowMap.vertex.js
const shadowMap_vertex_name = "shadowMapVertexShader",shadowMap_vertex_shader = `attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef INSTANCES
attribute vec4 world0;
attribute vec4 world1;
attribute vec4 world2;
attribute vec4 world3;
#endif
#include<helperFunctions>
#include<__decl__shadowMapVertex>
#ifdef ALPHATEXTURE
varying vec2 vUV;
uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#include<shadowMapVertexExtraDeclaration>
#include<clipPlaneVertexDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{
vec3 positionUpdated=position;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#ifdef NORMAL
vec3 normalUpdated=normal;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#ifdef NORMAL
mat3 normWorldSM=mat3(finalWorld);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));
vNormalW=normalize(normWorldSM*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normWorldSM=transposeMat3(inverseMat3(normWorldSM));
#endif
vec3 vNormalW=normalize(normWorldSM*normalUpdated);
#endif
#endif
#include<shadowMapVertexNormalBias>
gl_Position=viewProjection*worldPos;
#include<shadowMapVertexMetric>
#ifdef ALPHATEXTURE
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#include<clipPlaneVertex>
}`;shaderStore/* ShaderStore.ShadersStore.shadowMapVertexShader */.v.ShadersStore.shadowMapVertexShader = shadowMap_vertex_shader;const shadowMapVertexShader = { name: "shadowMapVertexShader", shader: shadowMap_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/depthBoxBlur.fragment.js
const depthBoxBlur_fragment_name = "depthBoxBlurPixelShader",depthBoxBlur_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform vec2 screenSize;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec4 colorDepth=vec4(0.0);
for (int x=-OFFSET; x<=OFFSET; x++)
for (int y=-OFFSET; y<=OFFSET; y++)
colorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);
gl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));
}`;shaderStore/* ShaderStore.ShadersStore.depthBoxBlurPixelShader */.v.ShadersStore.depthBoxBlurPixelShader = depthBoxBlur_fragment_shader;const depthBoxBlurPixelShader = { name: "depthBoxBlurPixelShader", shader: depthBoxBlur_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow.js
const shadowMapFragmentSoftTransparentShadow_name = "shadowMapFragmentSoftTransparentShadow",shadowMapFragmentSoftTransparentShadow_shader = `#if SM_SOFTTRANSPARENTSHADOW==1
if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alpha) discard;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow */.v.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow = shadowMapFragmentSoftTransparentShadow_shader;const shadowMapFragmentSoftTransparentShadow = { name: "shadowMapFragmentSoftTransparentShadow", shader: shadowMapFragmentSoftTransparentShadow_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Lights/Shadows/shadowGenerator.js
class ShadowGenerator {get bias() {return this._bias;}set bias(bias) {this._bias = bias;}get normalBias() {return this._normalBias;}set normalBias(normalBias) {this._normalBias = normalBias;}get blurBoxOffset() {return this._blurBoxOffset;}set blurBoxOffset(value) {this._blurBoxOffset === value || (this._blurBoxOffset = value, this._disposeBlurPostProcesses());}get blurScale() {return this._blurScale;}set blurScale(value) {this._blurScale === value || (this._blurScale = value, this._disposeBlurPostProcesses());}get blurKernel() {return this._blurKernel;}set blurKernel(value) {this._blurKernel === value || (this._blurKernel = value, this._disposeBlurPostProcesses());}get useKernelBlur() {return this._useKernelBlur;}set useKernelBlur(value) {this._useKernelBlur === value || (this._useKernelBlur = value, this._disposeBlurPostProcesses());}get depthScale() {return this._depthScale === void 0 ? this._light.getDepthScale() : this._depthScale;}set depthScale(value) {this._depthScale = value;}_validateFilter(filter) {return filter;}get filter() {return this._filter;}set filter(value) {if (value = this._validateFilter(value), this._light.needCube()) {if (value === ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP) return void (this.useExponentialShadowMap = !0);if (value === ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) return void (this.useCloseExponentialShadowMap = !0);if (value === ShadowGenerator.FILTER_PCF || value === ShadowGenerator.FILTER_PCSS) return void (this.usePoissonSampling = !0);}return value !== ShadowGenerator.FILTER_PCF && value !== ShadowGenerator.FILTER_PCSS || this._scene.getEngine()._features.supportShadowSamplers ? void (this._filter === value || (this._filter = value, this._disposeBlurPostProcesses(), this._applyFilterValues(), this._light._markMeshesAsLightDirty())) : void (this.usePoissonSampling = !0);}get usePoissonSampling() {return this.filter === ShadowGenerator.FILTER_POISSONSAMPLING;}set usePoissonSampling(value) {const filter = this._validateFilter(ShadowGenerator.FILTER_POISSONSAMPLING);(value || this.filter === ShadowGenerator.FILTER_POISSONSAMPLING) && (this.filter = value ? filter : ShadowGenerator.FILTER_NONE);}get useExponentialShadowMap() {return this.filter === ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP;}set useExponentialShadowMap(value) {const filter = this._validateFilter(ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP);(value || this.filter === ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP) && (this.filter = value ? filter : ShadowGenerator.FILTER_NONE);}get useBlurExponentialShadowMap() {return this.filter === ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP;}set useBlurExponentialShadowMap(value) {const filter = this._validateFilter(ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP);(value || this.filter === ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP) && (this.filter = value ? filter : ShadowGenerator.FILTER_NONE);}get useCloseExponentialShadowMap() {return this.filter === ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP;}set useCloseExponentialShadowMap(value) {const filter = this._validateFilter(ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP);(value || this.filter === ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP) && (this.filter = value ? filter : ShadowGenerator.FILTER_NONE);}get useBlurCloseExponentialShadowMap() {return this.filter === ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP;}set useBlurCloseExponentialShadowMap(value) {const filter = this._validateFilter(ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);(value || this.filter === ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) && (this.filter = value ? filter : ShadowGenerator.FILTER_NONE);}get usePercentageCloserFiltering() {return this.filter === ShadowGenerator.FILTER_PCF;}set usePercentageCloserFiltering(value) {const filter = this._validateFilter(ShadowGenerator.FILTER_PCF);(value || this.filter === ShadowGenerator.FILTER_PCF) && (this.filter = value ? filter : ShadowGenerator.FILTER_NONE);}get filteringQuality() {return this._filteringQuality;}set filteringQuality(filteringQuality) {this._filteringQuality === filteringQuality || (this._filteringQuality = filteringQuality, this._disposeBlurPostProcesses(), this._applyFilterValues(), this._light._markMeshesAsLightDirty());}get useContactHardeningShadow() {return this.filter === ShadowGenerator.FILTER_PCSS;}set useContactHardeningShadow(value) {const filter = this._validateFilter(ShadowGenerator.FILTER_PCSS);(value || this.filter === ShadowGenerator.FILTER_PCSS) && (this.filter = value ? filter : ShadowGenerator.FILTER_NONE);}get contactHardeningLightSizeUVRatio() {return this._contactHardeningLightSizeUVRatio;}set contactHardeningLightSizeUVRatio(contactHardeningLightSizeUVRatio) {this._contactHardeningLightSizeUVRatio = contactHardeningLightSizeUVRatio;}get darkness() {return this._darkness;}set darkness(value) {this.setDarkness(value);}getDarkness() {return this._darkness;}setDarkness(darkness) {return this._darkness = 1 <= darkness ? 1 : 0 >= darkness ? 0 : darkness, this;}get transparencyShadow() {return this._transparencyShadow;}set transparencyShadow(value) {this.setTransparencyShadow(value);}setTransparencyShadow(transparent) {return this._transparencyShadow = transparent, this;}getShadowMap() {return this._shadowMap;}getShadowMapForRendering() {return this._shadowMap2 ? this._shadowMap2 : this._shadowMap;}getClassName() {return ShadowGenerator.CLASSNAME;}addShadowCaster(mesh, includeDescendants = !0) {if (!this._shadowMap) return this;if (this._shadowMap.renderList || (this._shadowMap.renderList = []), -1 === this._shadowMap.renderList.indexOf(mesh) && this._shadowMap.renderList.push(mesh), includeDescendants) for (const childMesh of mesh.getChildMeshes()) -1 === this._shadowMap.renderList.indexOf(childMesh) && this._shadowMap.renderList.push(childMesh);return this;}removeShadowCaster(mesh, includeDescendants = !0) {if (!this._shadowMap || !this._shadowMap.renderList) return this;const index = this._shadowMap.renderList.indexOf(mesh);if (-1 !== index && this._shadowMap.renderList.splice(index, 1), includeDescendants) for (const child of mesh.getChildren()) this.removeShadowCaster(child);return this;}getLight() {return this._light;}_getCamera() {var _a;return null !== (_a = this._camera) && void 0 !== _a ? _a : this._scene.activeCamera;}get mapSize() {return this._mapSize;}set mapSize(size) {this._mapSize = size, this._light._markMeshesAsLightDirty(), this.recreateShadowMap();}constructor(mapSize, light, usefullFloatFirst, camera) {this.onBeforeShadowMapRenderObservable = new observable/* Observable */.y$(), this.onAfterShadowMapRenderObservable = new observable/* Observable */.y$(), this.onBeforeShadowMapRenderMeshObservable = new observable/* Observable */.y$(), this.onAfterShadowMapRenderMeshObservable = new observable/* Observable */.y$(), this._bias = 5e-5, this._normalBias = 0, this._blurBoxOffset = 1, this._blurScale = 2, this._blurKernel = 1, this._useKernelBlur = !1, this._filter = ShadowGenerator.FILTER_NONE, this._filteringQuality = ShadowGenerator.QUALITY_HIGH, this._contactHardeningLightSizeUVRatio = .1, this._darkness = 0, this._transparencyShadow = !1, this.enableSoftTransparentShadow = !1, this.useOpacityTextureForTransparentShadow = !1, this.frustumEdgeFalloff = 0, this.forceBackFacesOnly = !1, this._lightDirection = math_vector/* Vector3.Zero */.P.Zero(), this._viewMatrix = math_vector/* Matrix.Zero */.y3.Zero(), this._projectionMatrix = math_vector/* Matrix.Zero */.y3.Zero(), this._transformMatrix = math_vector/* Matrix.Zero */.y3.Zero(), this._cachedPosition = new math_vector/* Vector3 */.P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cachedDirection = new math_vector/* Vector3 */.P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._currentFaceIndex = 0, this._currentFaceIndexCache = 0, this._defaultTextureMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this._mapSize = mapSize, this._light = light, this._scene = light.getScene(), this._camera = null !== camera && void 0 !== camera ? camera : null;let shadowGenerators = light._shadowGenerators;shadowGenerators || (shadowGenerators = light._shadowGenerators = new Map()), shadowGenerators.set(this._camera, this), this.id = light.id, this._useUBO = this._scene.getEngine().supportsUniformBuffers, this._useUBO && (this._sceneUBOs = [], this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for Shadow Generator (light "${this._light.name}")`))), ShadowGenerator._SceneComponentInitialization(this._scene);const caps = this._scene.getEngine().getCaps();this._textureType = usefullFloatFirst ? caps.textureFloatRender && caps.textureFloatLinearFiltering ? 1 : caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering ? 2 : 0 : caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering ? 2 : caps.textureFloatRender && caps.textureFloatLinearFiltering ? 1 : 0, this._initializeGenerator(), this._applyFilterValues();}_initializeGenerator() {this._light._markMeshesAsLightDirty(), this._initializeShadowMap();}_createTargetRenderTexture() {const engine = this._scene.getEngine();engine._features.supportDepthStencilTexture ? (this._shadowMap = new Textures_renderTargetTexture/* RenderTargetTexture */._(this._light.name + "_shadowMap", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube(), void 0, !1, !1), this._shadowMap.createDepthStencilTexture(engine.useReverseDepthBuffer ? 516 : 513, !0)) : this._shadowMap = new Textures_renderTargetTexture/* RenderTargetTexture */._(this._light.name + "_shadowMap", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube());}_initializeShadowMap() {if (this._createTargetRenderTexture(), null === this._shadowMap) return;this._shadowMap.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._shadowMap.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._shadowMap.anisotropicFilteringLevel = 1, this._shadowMap.updateSamplingMode(Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE), this._shadowMap.renderParticles = !1, this._shadowMap.ignoreCameraViewport = !0, this._storedUniqueId && (this._shadowMap.uniqueId = this._storedUniqueId), this._shadowMap.customRenderFunction = this._renderForShadowMap.bind(this), this._shadowMap.customIsReadyFunction = () => !0;const engine = this._scene.getEngine();this._shadowMap.onBeforeBindObservable.add(() => {var _a;this._currentSceneUBO = this._scene.getSceneUniformBuffer(), null === (_a = engine._debugPushGroup) || void 0 === _a ? void 0 : _a.call(engine, `shadow map generation for pass id ${engine.currentRenderPassId}`, 1);}), this._shadowMap.onBeforeRenderObservable.add((faceIndex) => {this._sceneUBOs && this._scene.setSceneUniformBuffer(this._sceneUBOs[0]), this._currentFaceIndex = faceIndex, this._filter === ShadowGenerator.FILTER_PCF && engine.setColorWrite(!1), this.getTransformMatrix(), this._scene.setTransformMatrix(this._viewMatrix, this._projectionMatrix), this._useUBO && (this._scene.getSceneUniformBuffer().unbindEffect(), this._scene.finalizeSceneUbo());}), this._shadowMap.onAfterUnbindObservable.add(() => {var _a, _b;if (this._sceneUBOs && this._scene.setSceneUniformBuffer(this._currentSceneUBO), this._scene.updateTransformMatrix(), this._filter === ShadowGenerator.FILTER_PCF && engine.setColorWrite(!0), !this.useBlurExponentialShadowMap && !this.useBlurCloseExponentialShadowMap) return void (null === (_a = engine._debugPopGroup) || void 0 === _a ? void 0 : _a.call(engine, 1));const shadowMap = this.getShadowMapForRendering();shadowMap && (this._scene.postProcessManager.directRender(this._blurPostProcesses, shadowMap.renderTarget, !0), engine.unBindFramebuffer(shadowMap.renderTarget, !0), null === (_b = engine._debugPopGroup) || void 0 === _b ? void 0 : _b.call(engine, 1));});const clearZero = new math_color/* Color4 */.HE(0, 0, 0, 0),clearOne = new math_color/* Color4 */.HE(1, 1, 1, 1);this._shadowMap.onClearObservable.add((engine) => {this._filter === ShadowGenerator.FILTER_PCF ? engine.clear(clearOne, !1, !0, !1) : this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? engine.clear(clearZero, !0, !0, !1) : engine.clear(clearOne, !0, !0, !1);}), this._shadowMap.onResizeObservable.add((rtt) => {this._storedUniqueId = this._shadowMap.uniqueId, this._mapSize = rtt.getRenderSize(), this._light._markMeshesAsLightDirty(), this.recreateShadowMap();});for (let i = renderingManager/* RenderingManager.MIN_RENDERINGGROUPS */.$.MIN_RENDERINGGROUPS; i < renderingManager/* RenderingManager.MAX_RENDERINGGROUPS */.$.MAX_RENDERINGGROUPS; i++) this._shadowMap.setRenderingAutoClearDepthStencil(i, !1);}_initializeBlurRTTAndPostProcesses() {const engine = this._scene.getEngine(),targetSize = this._mapSize / this.blurScale;this.useKernelBlur && 1 === this.blurScale || (this._shadowMap2 = new Textures_renderTargetTexture/* RenderTargetTexture */._(this._light.name + "_shadowMap2", targetSize, this._scene, !1, !0, this._textureType, void 0, void 0, !1), this._shadowMap2.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._shadowMap2.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._shadowMap2.updateSamplingMode(Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE)), this.useKernelBlur ? (this._kernelBlurXPostprocess = new BlurPostProcess(this._light.name + "KernelBlurX", new math_vector/* Vector2 */.FM(1, 0), this.blurKernel, 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, this._textureType), this._kernelBlurXPostprocess.width = targetSize, this._kernelBlurXPostprocess.height = targetSize, this._kernelBlurXPostprocess.externalTextureSamplerBinding = !0, this._kernelBlurXPostprocess.onApplyObservable.add((effect) => {effect.setTexture("textureSampler", this._shadowMap);}), this._kernelBlurYPostprocess = new BlurPostProcess(this._light.name + "KernelBlurY", new math_vector/* Vector2 */.FM(0, 1), this.blurKernel, 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, this._textureType), this._kernelBlurXPostprocess.autoClear = !1, this._kernelBlurYPostprocess.autoClear = !1, 0 === this._textureType && (this._kernelBlurXPostprocess.packedFloat = !0, this._kernelBlurYPostprocess.packedFloat = !0), this._blurPostProcesses = [this._kernelBlurXPostprocess, this._kernelBlurYPostprocess]) : (this._boxBlurPostprocess = new PostProcesses_postProcess/* PostProcess */.D(this._light.name + "DepthBoxBlur", "depthBoxBlur", ["screenSize", "boxOffset"], [], 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, "#define OFFSET " + this._blurBoxOffset, this._textureType), this._boxBlurPostprocess.externalTextureSamplerBinding = !0, this._boxBlurPostprocess.onApplyObservable.add((effect) => {effect.setFloat2("screenSize", targetSize, targetSize), effect.setTexture("textureSampler", this._shadowMap);}), this._boxBlurPostprocess.autoClear = !1, this._blurPostProcesses = [this._boxBlurPostprocess]);}_renderForShadowMap(opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) {let index;if (depthOnlySubMeshes.length) for (index = 0; index < depthOnlySubMeshes.length; index++) this._renderSubMeshForShadowMap(depthOnlySubMeshes.data[index]);for (index = 0; index < opaqueSubMeshes.length; index++) this._renderSubMeshForShadowMap(opaqueSubMeshes.data[index]);for (index = 0; index < alphaTestSubMeshes.length; index++) this._renderSubMeshForShadowMap(alphaTestSubMeshes.data[index]);if (this._transparencyShadow) for (index = 0; index < transparentSubMeshes.length; index++) this._renderSubMeshForShadowMap(transparentSubMeshes.data[index], !0);else for (index = 0; index < transparentSubMeshes.length; index++) transparentSubMeshes.data[index].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = !1;}_bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect) {effect.setMatrix("viewProjection", this.getTransformMatrix());}_renderSubMeshForShadowMap(subMesh, isTransparent = !1) {var _a, _b;const renderingMesh = subMesh.getRenderingMesh(),effectiveMesh = subMesh.getEffectiveMesh(),scene = this._scene,engine = scene.getEngine(),material = subMesh.getMaterial();if (effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = !1, !material || 0 === subMesh.verticesCount || subMesh._renderId === scene.getRenderId()) return;const detNeg = 0 > effectiveMesh._getWorldMatrixDeterminant();let sideOrientation = null !== (_a = renderingMesh.overrideMaterialSideOrientation) && void 0 !== _a ? _a : material.sideOrientation;detNeg && (sideOrientation = 0 === sideOrientation ? 1 : 0);const reverseSideOrientation = 0 === sideOrientation;engine.setState(material.backFaceCulling, void 0, void 0, reverseSideOrientation, material.cullBackFaces);const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());if (!batch.mustReturn) {const hardwareInstancedRendering = engine.getCaps().instancedArrays && (null !== batch.visibleInstances[subMesh._id] && void 0 !== batch.visibleInstances[subMesh._id] || renderingMesh.hasThinInstances);if (!this.customAllowRendering || this.customAllowRendering(subMesh)) if (this.isReady(subMesh, hardwareInstancedRendering, isTransparent)) {subMesh._renderId = scene.getRenderId();const shadowDepthWrapper = material.shadowDepthWrapper,drawWrapper = null !== (_b = null === shadowDepthWrapper || void 0 === shadowDepthWrapper ? void 0 : shadowDepthWrapper.getEffect(subMesh, this, engine.currentRenderPassId)) && void 0 !== _b ? _b : subMesh._getDrawWrapper(),effect = Materials_drawWrapper/* DrawWrapper.GetEffect */.q.GetEffect(drawWrapper);engine.enableEffect(drawWrapper), hardwareInstancedRendering || renderingMesh._bind(subMesh, effect, material.fillMode), this.getTransformMatrix(), effect.setFloat3("biasAndScaleSM", this.bias, this.normalBias, this.depthScale), this.getLight().getTypeID() === Lights_light/* Light.LIGHTTYPEID_DIRECTIONALLIGHT */._.LIGHTTYPEID_DIRECTIONALLIGHT ? effect.setVector3("lightDataSM", this._cachedDirection) : effect.setVector3("lightDataSM", this._cachedPosition);const camera = this._getCamera();if (camera && effect.setFloat2("depthValuesSM", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera)), isTransparent && this.enableSoftTransparentShadow && effect.setFloat("softTransparentShadowSM", effectiveMesh.visibility * material.alpha), shadowDepthWrapper) subMesh._setMainDrawWrapperOverride(drawWrapper), shadowDepthWrapper.standalone ? shadowDepthWrapper.baseMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), renderingMesh, subMesh) : material.bindForSubMesh(effectiveMesh.getWorldMatrix(), renderingMesh, subMesh), subMesh._setMainDrawWrapperOverride(null);else {if (this.useOpacityTextureForTransparentShadow) {const opacityTexture = material.opacityTexture;opacityTexture && (effect.setTexture("diffuseSampler", opacityTexture), effect.setMatrix("diffuseMatrix", opacityTexture.getTextureMatrix() || this._defaultTextureMatrix));} else if (material.needAlphaTesting() || material.needAlphaBlending()) {const alphaTexture = material.getAlphaTestTexture();alphaTexture && (effect.setTexture("diffuseSampler", alphaTexture), effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix() || this._defaultTextureMatrix));}if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {const skeleton = renderingMesh.skeleton;if (skeleton.isUsingTextureForMatrices) {const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);if (!boneTexture) return;effect.setTexture("boneSampler", boneTexture), effect.setFloat("boneTextureWidth", 4 * (skeleton.bones.length + 1));} else effect.setMatrices("mBones", skeleton.getTransformMatrices(renderingMesh));}materialHelper/* MaterialHelper.BindMorphTargetParameters */.G.BindMorphTargetParameters(renderingMesh, effect), renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets && renderingMesh.morphTargetManager._bind(effect), (0,clipPlaneMaterialHelper/* bindClipPlane */.an)(effect, material, scene);}this._useUBO || shadowDepthWrapper || this._bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect, effectiveMesh), materialHelper/* MaterialHelper.BindSceneUniformBuffer */.G.BindSceneUniformBuffer(effect, this._scene.getSceneUniformBuffer()), this._scene.getSceneUniformBuffer().bindUniformBuffer();const world = effectiveMesh.getWorldMatrix();hardwareInstancedRendering && (effectiveMesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh"), effectiveMesh.transferToEffect(world)), this.forceBackFacesOnly && engine.setState(!0, 0, !1, !0, material.cullBackFaces), this.onBeforeShadowMapRenderMeshObservable.notifyObservers(renderingMesh), this.onBeforeShadowMapRenderObservable.notifyObservers(effect), renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, worldOverride) => {effectiveMesh === renderingMesh || isInstance ? (effectiveMesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh"), effectiveMesh.transferToEffect(isInstance ? worldOverride : world)) : (renderingMesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh"), renderingMesh.transferToEffect(worldOverride));}), this.forceBackFacesOnly && engine.setState(!0, 0, !1, !1, material.cullBackFaces), this.onAfterShadowMapRenderObservable.notifyObservers(effect), this.onAfterShadowMapRenderMeshObservable.notifyObservers(renderingMesh);} else this._shadowMap && this._shadowMap.resetRefreshCounter();}}_applyFilterValues() {this._shadowMap && (this.filter === ShadowGenerator.FILTER_NONE || this.filter === ShadowGenerator.FILTER_PCSS ? this._shadowMap.updateSamplingMode(Textures_texture/* Texture.NEAREST_SAMPLINGMODE */.x.NEAREST_SAMPLINGMODE) : this._shadowMap.updateSamplingMode(Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE));}forceCompilation(onCompiled, options) {const localOptions = { useInstances: !1, ...options },shadowMap = this.getShadowMap();if (!shadowMap) return void (onCompiled && onCompiled(this));const renderList = shadowMap.renderList;if (!renderList) return void (onCompiled && onCompiled(this));const subMeshes = [];for (const mesh of renderList) subMeshes.push(...mesh.subMeshes);if (0 === subMeshes.length) return void (onCompiled && onCompiled(this));let currentIndex = 0;const checkReady = () => {var _a, _b;if (this._scene && this._scene.getEngine()) {for (; this.isReady(subMeshes[currentIndex], localOptions.useInstances, null !== (_b = null === (_a = subMeshes[currentIndex].getMaterial()) || void 0 === _a ? void 0 : _a.needAlphaBlendingForMesh(subMeshes[currentIndex].getMesh())) && void 0 !== _b && _b);) if (currentIndex++, currentIndex >= subMeshes.length) return void (onCompiled && onCompiled(this));setTimeout(checkReady, 16);}};checkReady();}forceCompilationAsync(options) {return new Promise((resolve) => {this.forceCompilation(() => {resolve();}, options);});}_isReadyCustomDefines() {}_prepareShadowDefines(subMesh, useInstances, defines, isTransparent) {defines.push("#define SM_LIGHTTYPE_" + this._light.getClassName().toUpperCase()), defines.push("#define SM_FLOAT " + (0 === this._textureType ? "0" : "1")), defines.push("#define SM_ESM " + (this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? "1" : "0")), defines.push("#define SM_DEPTHTEXTURE " + (this.usePercentageCloserFiltering || this.useContactHardeningShadow ? "1" : "0"));const mesh = subMesh.getMesh();return defines.push("#define SM_NORMALBIAS " + (this.normalBias && mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind) ? "1" : "0")), defines.push("#define SM_DIRECTIONINLIGHTDATA " + (this.getLight().getTypeID() === Lights_light/* Light.LIGHTTYPEID_DIRECTIONALLIGHT */._.LIGHTTYPEID_DIRECTIONALLIGHT ? "1" : "0")), defines.push("#define SM_USEDISTANCE " + (this._light.needCube() ? "1" : "0")), defines.push("#define SM_SOFTTRANSPARENTSHADOW " + (this.enableSoftTransparentShadow && isTransparent ? "1" : "0")), this._isReadyCustomDefines(defines, subMesh, useInstances), defines;}isReady(subMesh, useInstances, isTransparent) {var _a;const material = subMesh.getMaterial(),shadowDepthWrapper = null === material || void 0 === material ? void 0 : material.shadowDepthWrapper;if (!material) return !1;const defines = [];if (this._prepareShadowDefines(subMesh, useInstances, defines, isTransparent), !shadowDepthWrapper) {const subMeshEffect = subMesh._getDrawWrapper(void 0, !0);let effect = subMeshEffect.effect,cachedDefines = subMeshEffect.defines;const attribs = [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind],mesh = subMesh.getMesh();this.normalBias && mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind) && (attribs.push(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind), defines.push("#define NORMAL"), mesh.nonUniformScaling && defines.push("#define NONUNIFORMSCALING"));const needAlphaTesting = null === material || void 0 === material ? void 0 : material.needAlphaTesting(),needAlphaBlending = null === material || void 0 === material ? void 0 : material.needAlphaBlending();if (material && (needAlphaTesting || needAlphaBlending)) {let alphaTexture = null;if (alphaTexture = this.useOpacityTextureForTransparentShadow ? material.opacityTexture : material.getAlphaTestTexture(), alphaTexture) {if (!alphaTexture.isReady()) return !1;const alphaCutOff = null !== (_a = material.alphaCutOff) && void 0 !== _a ? _a : ShadowGenerator.DEFAULT_ALPHA_CUTOFF;defines.push("#define ALPHATEXTURE"), needAlphaTesting && defines.push(`#define ALPHATESTVALUE ${alphaCutOff}${0 == alphaCutOff % 1 ? "." : ""}`), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind) && (attribs.push(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), defines.push("#define UV1")), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind) && 1 === alphaTexture.coordinatesIndex && (attribs.push(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind), defines.push("#define UV2"));}}const fallbacks = new effectFallbacks/* EffectFallbacks */.L();if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind), 4 < mesh.numBoneInfluencers && (attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesExtraKind */.o.MatricesIndicesExtraKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsExtraKind */.o.MatricesWeightsExtraKind));const skeleton = mesh.skeleton;defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers), 0 < mesh.numBoneInfluencers && fallbacks.addCPUSkinningFallback(0, mesh), skeleton.isUsingTextureForMatrices ? defines.push("#define BONETEXTURE") : defines.push("#define BonesPerMesh " + (skeleton.bones.length + 1));} else defines.push("#define NUM_BONE_INFLUENCERS 0");const manager = mesh.morphTargetManager;let morphInfluencers = 0;if (manager && 0 < manager.numInfluencers && (defines.push("#define MORPHTARGETS"), morphInfluencers = manager.numInfluencers, defines.push("#define NUM_MORPH_INFLUENCERS " + morphInfluencers), manager.isUsingTextureForTargets && defines.push("#define MORPHTARGETS_TEXTURE"), materialHelper/* MaterialHelper.PrepareAttributesForMorphTargetsInfluencers */.G.PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, morphInfluencers)), (0,clipPlaneMaterialHelper/* prepareDefinesForClipPlanes */.AN)(material, this._scene, defines), useInstances && (defines.push("#define INSTANCES"), materialHelper/* MaterialHelper.PushAttributesForInstances */.G.PushAttributesForInstances(attribs), subMesh.getRenderingMesh().hasThinInstances && defines.push("#define THIN_INSTANCES")), this.customShaderOptions && this.customShaderOptions.defines) for (const define of this.customShaderOptions.defines) -1 === defines.indexOf(define) && defines.push(define);const join = defines.join("\n");if (cachedDefines !== join) {cachedDefines = join;let shaderName = "shadowMap";const uniforms = ["world", "mBones", "viewProjection", "diffuseMatrix", "lightDataSM", "depthValuesSM", "biasAndScaleSM", "morphTargetInfluences", "boneTextureWidth", "softTransparentShadowSM", "morphTargetTextureInfo", "morphTargetTextureIndices"],samplers = ["diffuseSampler", "boneSampler", "morphTargets"];if ((0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(uniforms), this.customShaderOptions) {if (shaderName = this.customShaderOptions.shaderName, this.customShaderOptions.attributes) for (const attrib of this.customShaderOptions.attributes) -1 === attribs.indexOf(attrib) && attribs.push(attrib);if (this.customShaderOptions.uniforms) for (const uniform of this.customShaderOptions.uniforms) -1 === uniforms.indexOf(uniform) && uniforms.push(uniform);if (this.customShaderOptions.samplers) for (const sampler of this.customShaderOptions.samplers) -1 === samplers.indexOf(sampler) && samplers.push(sampler);}const engine = this._scene.getEngine();effect = engine.createEffect(shaderName, { attributes: attribs, uniformsNames: uniforms, uniformBuffersNames: ["Scene", "Mesh"], samplers: samplers, defines: join, fallbacks: fallbacks, onCompiled: null, onError: null, indexParameters: { maxSimultaneousMorphTargets: morphInfluencers } }, engine), subMeshEffect.setEffect(effect, cachedDefines);}if (!effect.isReady()) return !1;} else if (!shadowDepthWrapper.isReadyForSubMesh(subMesh, defines, this, useInstances, this._scene.getEngine().currentRenderPassId)) return !1;return (this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (!this._blurPostProcesses || !this._blurPostProcesses.length) && this._initializeBlurRTTAndPostProcesses(), (!this._kernelBlurXPostprocess || this._kernelBlurXPostprocess.isReady()) && (!this._kernelBlurYPostprocess || this._kernelBlurYPostprocess.isReady()) && (!this._boxBlurPostprocess || this._boxBlurPostprocess.isReady());}prepareDefines(defines, lightIndex) {const scene = this._scene,light = this._light;scene.shadowsEnabled && light.shadowEnabled && (defines["SHADOW" + lightIndex] = !0, this.useContactHardeningShadow ? (defines["SHADOWPCSS" + lightIndex] = !0, this._filteringQuality === ShadowGenerator.QUALITY_LOW ? defines["SHADOWLOWQUALITY" + lightIndex] = !0 : this._filteringQuality === ShadowGenerator.QUALITY_MEDIUM && (defines["SHADOWMEDIUMQUALITY" + lightIndex] = !0)) : this.usePercentageCloserFiltering ? (defines["SHADOWPCF" + lightIndex] = !0, this._filteringQuality === ShadowGenerator.QUALITY_LOW ? defines["SHADOWLOWQUALITY" + lightIndex] = !0 : this._filteringQuality === ShadowGenerator.QUALITY_MEDIUM && (defines["SHADOWMEDIUMQUALITY" + lightIndex] = !0)) : this.usePoissonSampling ? defines["SHADOWPOISSON" + lightIndex] = !0 : this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? defines["SHADOWESM" + lightIndex] = !0 : (this.useCloseExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (defines["SHADOWCLOSEESM" + lightIndex] = !0), light.needCube() && (defines["SHADOWCUBE" + lightIndex] = !0));}bindShadowLight(lightIndex, effect) {const light = this._light,scene = this._scene;if (scene.shadowsEnabled && light.shadowEnabled) {const camera = this._getCamera();if (camera) {const shadowMap = this.getShadowMap();shadowMap && (!light.needCube() && effect.setMatrix("lightMatrix" + lightIndex, this.getTransformMatrix()), this._filter === ShadowGenerator.FILTER_PCF ? (effect.setDepthStencilTexture("shadowSampler" + lightIndex, this.getShadowMapForRendering()), light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), shadowMap.getSize().width, 1 / shadowMap.getSize().width, this.frustumEdgeFalloff, lightIndex)) : this._filter === ShadowGenerator.FILTER_PCSS ? (effect.setDepthStencilTexture("shadowSampler" + lightIndex, this.getShadowMapForRendering()), effect.setTexture("depthSampler" + lightIndex, this.getShadowMapForRendering()), light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), 1 / shadowMap.getSize().width, this._contactHardeningLightSizeUVRatio * shadowMap.getSize().width, this.frustumEdgeFalloff, lightIndex)) : (effect.setTexture("shadowSampler" + lightIndex, this.getShadowMapForRendering()), light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), this.blurScale / shadowMap.getSize().width, this.depthScale, this.frustumEdgeFalloff, lightIndex)), light._uniformBuffer.updateFloat2("depthValues", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera), lightIndex));}}}getTransformMatrix() {const scene = this._scene;if (this._currentRenderId === scene.getRenderId() && this._currentFaceIndexCache === this._currentFaceIndex) return this._transformMatrix;this._currentRenderId = scene.getRenderId(), this._currentFaceIndexCache = this._currentFaceIndex;let lightPosition = this._light.position;if (this._light.computeTransformedInformation() && (lightPosition = this._light.transformedPosition), math_vector/* Vector3.NormalizeToRef */.P.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex), this._lightDirection), 1 === Math.abs(math_vector/* Vector3.Dot */.P.Dot(this._lightDirection, math_vector/* Vector3.Up */.P.Up())) && (this._lightDirection.z = 1e-13), this._light.needProjectionMatrixCompute() || !this._cachedPosition || !this._cachedDirection || !lightPosition.equals(this._cachedPosition) || !this._lightDirection.equals(this._cachedDirection)) {this._cachedPosition.copyFrom(lightPosition), this._cachedDirection.copyFrom(this._lightDirection), math_vector/* Matrix.LookAtLHToRef */.y3.LookAtLHToRef(lightPosition, lightPosition.add(this._lightDirection), math_vector/* Vector3.Up */.P.Up(), this._viewMatrix);const shadowMap = this.getShadowMap();if (shadowMap) {const renderList = shadowMap.renderList;renderList && this._light.setShadowProjectionMatrix(this._projectionMatrix, this._viewMatrix, renderList);}this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);}return this._transformMatrix;}recreateShadowMap() {const shadowMap = this._shadowMap;if (shadowMap) {const renderList = shadowMap.renderList;if (this._disposeRTTandPostProcesses(), this._initializeGenerator(), this.filter = this._filter, this._applyFilterValues(), renderList) {this._shadowMap.renderList || (this._shadowMap.renderList = []);for (const mesh of renderList) this._shadowMap.renderList.push(mesh);} else this._shadowMap.renderList = null;}}_disposeBlurPostProcesses() {this._shadowMap2 && (this._shadowMap2.dispose(), this._shadowMap2 = null), this._boxBlurPostprocess && (this._boxBlurPostprocess.dispose(), this._boxBlurPostprocess = null), this._kernelBlurXPostprocess && (this._kernelBlurXPostprocess.dispose(), this._kernelBlurXPostprocess = null), this._kernelBlurYPostprocess && (this._kernelBlurYPostprocess.dispose(), this._kernelBlurYPostprocess = null), this._blurPostProcesses = [];}_disposeRTTandPostProcesses() {this._shadowMap && (this._shadowMap.dispose(), this._shadowMap = null), this._disposeBlurPostProcesses();}_disposeSceneUBOs() {if (this._sceneUBOs) {for (const ubo of this._sceneUBOs) ubo.dispose();this._sceneUBOs = [];}}dispose() {if (this._disposeRTTandPostProcesses(), this._disposeSceneUBOs(), this._light) {if (this._light._shadowGenerators) {const iterator = this._light._shadowGenerators.entries();for (let entry = iterator.next(); !0 !== entry.done; entry = iterator.next()) {const [camera, shadowGenerator] = entry.value;shadowGenerator === this && this._light._shadowGenerators.delete(camera);}0 === this._light._shadowGenerators.size && (this._light._shadowGenerators = null);}this._light._markMeshesAsLightDirty();}this.onBeforeShadowMapRenderMeshObservable.clear(), this.onBeforeShadowMapRenderObservable.clear(), this.onAfterShadowMapRenderMeshObservable.clear(), this.onAfterShadowMapRenderObservable.clear();}serialize() {var _a;const serializationObject = {},shadowMap = this.getShadowMap();if (!shadowMap) return serializationObject;if (serializationObject.className = this.getClassName(), serializationObject.lightId = this._light.id, serializationObject.cameraId = null === (_a = this._camera) || void 0 === _a ? void 0 : _a.id, serializationObject.id = this.id, serializationObject.mapSize = shadowMap.getRenderSize(), serializationObject.forceBackFacesOnly = this.forceBackFacesOnly, serializationObject.darkness = this.getDarkness(), serializationObject.transparencyShadow = this._transparencyShadow, serializationObject.frustumEdgeFalloff = this.frustumEdgeFalloff, serializationObject.bias = this.bias, serializationObject.normalBias = this.normalBias, serializationObject.usePercentageCloserFiltering = this.usePercentageCloserFiltering, serializationObject.useContactHardeningShadow = this.useContactHardeningShadow, serializationObject.contactHardeningLightSizeUVRatio = this.contactHardeningLightSizeUVRatio, serializationObject.filteringQuality = this.filteringQuality, serializationObject.useExponentialShadowMap = this.useExponentialShadowMap, serializationObject.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap, serializationObject.useCloseExponentialShadowMap = this.useBlurExponentialShadowMap, serializationObject.useBlurCloseExponentialShadowMap = this.useBlurExponentialShadowMap, serializationObject.usePoissonSampling = this.usePoissonSampling, serializationObject.depthScale = this.depthScale, serializationObject.blurBoxOffset = this.blurBoxOffset, serializationObject.blurKernel = this.blurKernel, serializationObject.blurScale = this.blurScale, serializationObject.useKernelBlur = this.useKernelBlur, serializationObject.renderList = [], shadowMap.renderList) for (let meshIndex = 0; meshIndex < shadowMap.renderList.length; meshIndex++) {const mesh = shadowMap.renderList[meshIndex];serializationObject.renderList.push(mesh.id);}return serializationObject;}static Parse(parsedShadowGenerator, scene, constr) {const light = scene.getLightById(parsedShadowGenerator.lightId),camera = void 0 === parsedShadowGenerator.cameraId ? null : scene.getCameraById(parsedShadowGenerator.cameraId),shadowGenerator = constr ? constr(parsedShadowGenerator.mapSize, light, camera) : new ShadowGenerator(parsedShadowGenerator.mapSize, light, void 0, camera),shadowMap = shadowGenerator.getShadowMap();for (let meshIndex = 0; meshIndex < parsedShadowGenerator.renderList.length; meshIndex++) {const meshes = scene.getMeshesById(parsedShadowGenerator.renderList[meshIndex]);meshes.forEach(function (mesh) {shadowMap && (!shadowMap.renderList && (shadowMap.renderList = []), shadowMap.renderList.push(mesh));});}return void 0 !== parsedShadowGenerator.id && (shadowGenerator.id = parsedShadowGenerator.id), shadowGenerator.forceBackFacesOnly = !!parsedShadowGenerator.forceBackFacesOnly, void 0 !== parsedShadowGenerator.darkness && shadowGenerator.setDarkness(parsedShadowGenerator.darkness), parsedShadowGenerator.transparencyShadow && shadowGenerator.setTransparencyShadow(!0), void 0 !== parsedShadowGenerator.frustumEdgeFalloff && (shadowGenerator.frustumEdgeFalloff = parsedShadowGenerator.frustumEdgeFalloff), void 0 !== parsedShadowGenerator.bias && (shadowGenerator.bias = parsedShadowGenerator.bias), void 0 !== parsedShadowGenerator.normalBias && (shadowGenerator.normalBias = parsedShadowGenerator.normalBias), parsedShadowGenerator.usePercentageCloserFiltering ? shadowGenerator.usePercentageCloserFiltering = !0 : parsedShadowGenerator.useContactHardeningShadow ? shadowGenerator.useContactHardeningShadow = !0 : parsedShadowGenerator.usePoissonSampling ? shadowGenerator.usePoissonSampling = !0 : parsedShadowGenerator.useExponentialShadowMap ? shadowGenerator.useExponentialShadowMap = !0 : parsedShadowGenerator.useBlurExponentialShadowMap ? shadowGenerator.useBlurExponentialShadowMap = !0 : parsedShadowGenerator.useCloseExponentialShadowMap ? shadowGenerator.useCloseExponentialShadowMap = !0 : parsedShadowGenerator.useBlurCloseExponentialShadowMap ? shadowGenerator.useBlurCloseExponentialShadowMap = !0 : parsedShadowGenerator.useVarianceShadowMap ? shadowGenerator.useExponentialShadowMap = !0 : parsedShadowGenerator.useBlurVarianceShadowMap && (shadowGenerator.useBlurExponentialShadowMap = !0), void 0 !== parsedShadowGenerator.contactHardeningLightSizeUVRatio && (shadowGenerator.contactHardeningLightSizeUVRatio = parsedShadowGenerator.contactHardeningLightSizeUVRatio), void 0 !== parsedShadowGenerator.filteringQuality && (shadowGenerator.filteringQuality = parsedShadowGenerator.filteringQuality), parsedShadowGenerator.depthScale && (shadowGenerator.depthScale = parsedShadowGenerator.depthScale), parsedShadowGenerator.blurScale && (shadowGenerator.blurScale = parsedShadowGenerator.blurScale), parsedShadowGenerator.blurBoxOffset && (shadowGenerator.blurBoxOffset = parsedShadowGenerator.blurBoxOffset), parsedShadowGenerator.useKernelBlur && (shadowGenerator.useKernelBlur = parsedShadowGenerator.useKernelBlur), parsedShadowGenerator.blurKernel && (shadowGenerator.blurKernel = parsedShadowGenerator.blurKernel), shadowGenerator;}}ShadowGenerator.CLASSNAME = "ShadowGenerator", ShadowGenerator.FILTER_NONE = 0, ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP = 1, ShadowGenerator.FILTER_POISSONSAMPLING = 2, ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP = 3, ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4, ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5, ShadowGenerator.FILTER_PCF = 6, ShadowGenerator.FILTER_PCSS = 7, ShadowGenerator.QUALITY_HIGH = 0, ShadowGenerator.QUALITY_MEDIUM = 1, ShadowGenerator.QUALITY_LOW = 2, ShadowGenerator.DEFAULT_ALPHA_CUTOFF = .5, ShadowGenerator._SceneComponentInitialization = () => {throw (0,devTools/* _WarnImport */.S)("ShadowGeneratorSceneComponent");};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/depth.fragment.js
const depth_fragment_name = "depthPixelShader",depth_fragment_shader = `#ifdef ALPHATEST
varying vec2 vUV;
uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
varying float vDepthMetric;
#ifdef PACKED
#include<packingFunctions>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
#endif
#ifdef NONLINEARDEPTH
#ifdef PACKED
gl_FragColor=pack(gl_FragCoord.z);
#else
gl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0);
#endif
#else
#ifdef PACKED
gl_FragColor=pack(vDepthMetric);
#else
gl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0);
#endif
#endif
}`;shaderStore/* ShaderStore.ShadersStore.depthPixelShader */.v.ShadersStore.depthPixelShader = depth_fragment_shader;const depthPixelShader = { name: "depthPixelShader", shader: depth_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/depth.vertex.js
const depth_vertex_name = "depthVertexShader",depth_vertex_shader = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform mat4 viewProjection;
uniform vec2 depthValues;
#if defined(ALPHATEST) || defined(NEED_UV)
varying vec2 vUV;
uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
varying float vDepthMetric;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{
vec3 positionUpdated=position;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#include<clipPlaneVertex>
gl_Position=viewProjection*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetric=((-gl_Position.z+depthValues.x)/(depthValues.y));
#else
vDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));
#endif
#if defined(ALPHATEST) || defined(BASIC_RENDER)
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.depthVertexShader */.v.ShadersStore.depthVertexShader = depth_vertex_shader;const depthVertexShader = { name: "depthVertexShader", shader: depth_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/depthRenderer.js
class DepthRenderer {setMaterialForRendering(mesh, material) {this._depthMap.setMaterialForRendering(mesh, material);}constructor(scene, type = 1, camera = null, storeNonLinearDepth = !1, samplingMode = Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE) {this.enabled = !0, this.forceDepthWriteTransparentMeshes = !1, this.useOnlyInActiveCamera = !1, this._scene = scene, this._storeNonLinearDepth = storeNonLinearDepth, this.isPacked = 0 === type, this._clearColor = this.isPacked ? new math_color/* Color4 */.HE(1, 1, 1, 1) : new math_color/* Color4 */.HE(1, 0, 0, 1), DepthRenderer._SceneComponentInitialization(this._scene);const engine = scene.getEngine();this._camera = camera, samplingMode !== Textures_texture/* Texture.NEAREST_SAMPLINGMODE */.x.NEAREST_SAMPLINGMODE && (1 === type && !engine._caps.textureFloatLinearFiltering && (samplingMode = Textures_texture/* Texture.NEAREST_SAMPLINGMODE */.x.NEAREST_SAMPLINGMODE), 2 === type && !engine._caps.textureHalfFloatLinearFiltering && (samplingMode = Textures_texture/* Texture.NEAREST_SAMPLINGMODE */.x.NEAREST_SAMPLINGMODE));const format = this.isPacked || !engine._features.supportExtendedTextureFormats ? 5 : 6;this._depthMap = new Textures_renderTargetTexture/* RenderTargetTexture */._("DepthRenderer", { width: engine.getRenderWidth(), height: engine.getRenderHeight() }, this._scene, !1, !0, type, !1, samplingMode, void 0, void 0, void 0, format), this._depthMap.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._depthMap.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._depthMap.refreshRate = 1, this._depthMap.renderParticles = !1, this._depthMap.renderList = null, this._depthMap.activeCamera = this._camera, this._depthMap.ignoreCameraViewport = !0, this._depthMap.useCameraPostProcesses = !1, this._depthMap.onClearObservable.add((engine) => {engine.clear(this._clearColor, !0, !0, !0);}), this._depthMap.onBeforeBindObservable.add(() => {var _a;null === (_a = engine._debugPushGroup) || void 0 === _a ? void 0 : _a.call(engine, "depth renderer", 1);}), this._depthMap.onAfterUnbindObservable.add(() => {var _a;null === (_a = engine._debugPopGroup) || void 0 === _a ? void 0 : _a.call(engine, 1);}), this._depthMap.customIsReadyFunction = (mesh, refreshRate, preWarm) => {if ((preWarm || 0 === refreshRate) && mesh.subMeshes) for (let i = 0; i < mesh.subMeshes.length; ++i) {const subMesh = mesh.subMeshes[i],renderingMesh = subMesh.getRenderingMesh(),batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh()),hardwareInstancedRendering = engine.getCaps().instancedArrays && (null !== batch.visibleInstances[subMesh._id] && void 0 !== batch.visibleInstances[subMesh._id] || renderingMesh.hasThinInstances);if (!this.isReady(subMesh, hardwareInstancedRendering)) return !1;}return !0;};const renderSubMesh = (subMesh) => {var _a, _b;const renderingMesh = subMesh.getRenderingMesh(),effectiveMesh = subMesh.getEffectiveMesh(),scene = this._scene,engine = scene.getEngine(),material = subMesh.getMaterial();if (effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = !1, !material || effectiveMesh.infiniteDistance || material.disableDepthWrite || 0 === subMesh.verticesCount || subMesh._renderId === scene.getRenderId()) return;const detNeg = 0 > effectiveMesh._getWorldMatrixDeterminant();let sideOrientation = null !== (_a = renderingMesh.overrideMaterialSideOrientation) && void 0 !== _a ? _a : material.sideOrientation;detNeg && (sideOrientation = 0 === sideOrientation ? 1 : 0);const reverseSideOrientation = 0 === sideOrientation;engine.setState(material.backFaceCulling, 0, !1, reverseSideOrientation, material.cullBackFaces);const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());if (batch.mustReturn) return;const hardwareInstancedRendering = engine.getCaps().instancedArrays && (null !== batch.visibleInstances[subMesh._id] && void 0 !== batch.visibleInstances[subMesh._id] || renderingMesh.hasThinInstances),camera = this._camera || scene.activeCamera;if (this.isReady(subMesh, hardwareInstancedRendering) && camera) {subMesh._renderId = scene.getRenderId();const renderingMaterial = null === (_b = effectiveMesh._internalAbstractMeshDataInfo._materialForRenderPass) || void 0 === _b ? void 0 : _b[engine.currentRenderPassId];let drawWrapper = subMesh._getDrawWrapper();!drawWrapper && renderingMaterial && (drawWrapper = renderingMaterial._getDrawWrapper());const cameraIsOrtho = camera.mode === Cameras_camera/* Camera.ORTHOGRAPHIC_CAMERA */.V.ORTHOGRAPHIC_CAMERA;if (!drawWrapper) return;const effect = drawWrapper.effect;engine.enableEffect(drawWrapper), hardwareInstancedRendering || renderingMesh._bind(subMesh, effect, material.fillMode), renderingMaterial ? renderingMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), effectiveMesh, subMesh) : (effect.setMatrix("viewProjection", scene.getTransformMatrix()), effect.setMatrix("world", effectiveMesh.getWorldMatrix()));let minZ, maxZ;if (cameraIsOrtho ? (minZ = !engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1, maxZ = engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1) : (minZ = engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? camera.minZ : engine.isNDCHalfZRange ? 0 : camera.minZ, maxZ = engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : camera.maxZ), effect.setFloat2("depthValues", minZ, minZ + maxZ), !renderingMaterial) {if (material.needAlphaTesting()) {const alphaTexture = material.getAlphaTestTexture();alphaTexture && (effect.setTexture("diffuseSampler", alphaTexture), effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix()));}if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {const skeleton = renderingMesh.skeleton;if (skeleton.isUsingTextureForMatrices) {const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);if (!boneTexture) return;effect.setTexture("boneSampler", boneTexture), effect.setFloat("boneTextureWidth", 4 * (skeleton.bones.length + 1));} else effect.setMatrices("mBones", skeleton.getTransformMatrices(renderingMesh));}(0,clipPlaneMaterialHelper/* bindClipPlane */.an)(effect, material, scene), materialHelper/* MaterialHelper.BindMorphTargetParameters */.G.BindMorphTargetParameters(renderingMesh, effect), renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets && renderingMesh.morphTargetManager._bind(effect);}renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, world) => effect.setMatrix("world", world));}};this._depthMap.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => {let index;if (depthOnlySubMeshes.length) for (index = 0; index < depthOnlySubMeshes.length; index++) renderSubMesh(depthOnlySubMeshes.data[index]);for (index = 0; index < opaqueSubMeshes.length; index++) renderSubMesh(opaqueSubMeshes.data[index]);for (index = 0; index < alphaTestSubMeshes.length; index++) renderSubMesh(alphaTestSubMeshes.data[index]);if (this.forceDepthWriteTransparentMeshes) for (index = 0; index < transparentSubMeshes.length; index++) renderSubMesh(transparentSubMeshes.data[index]);else for (index = 0; index < transparentSubMeshes.length; index++) transparentSubMeshes.data[index].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = !1;};}isReady(subMesh, useInstances) {var _a;const engine = this._scene.getEngine(),mesh = subMesh.getMesh(),scene = mesh.getScene(),renderingMaterial = null === (_a = mesh._internalAbstractMeshDataInfo._materialForRenderPass) || void 0 === _a ? void 0 : _a[engine.currentRenderPassId];if (renderingMaterial) return renderingMaterial.isReadyForSubMesh(mesh, subMesh, useInstances);const material = subMesh.getMaterial();if (!material || material.disableDepthWrite) return !1;const defines = [],attribs = [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];if (material && material.needAlphaTesting() && material.getAlphaTestTexture() && (defines.push("#define ALPHATEST"), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind) && (attribs.push(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), defines.push("#define UV1")), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind) && (attribs.push(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind), defines.push("#define UV2"))), mesh.useBones && mesh.computeBonesUsingShaders) {attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind), 4 < mesh.numBoneInfluencers && (attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesExtraKind */.o.MatricesIndicesExtraKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsExtraKind */.o.MatricesWeightsExtraKind)), defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers), defines.push("#define BonesPerMesh " + (mesh.skeleton ? mesh.skeleton.bones.length + 1 : 0));const skeleton = subMesh.getRenderingMesh().skeleton;(null === skeleton || void 0 === skeleton ? void 0 : skeleton.isUsingTextureForMatrices) && defines.push("#define BONETEXTURE");} else defines.push("#define NUM_BONE_INFLUENCERS 0");const morphTargetManager = mesh.morphTargetManager;let numMorphInfluencers = 0;morphTargetManager && 0 < morphTargetManager.numInfluencers && (numMorphInfluencers = morphTargetManager.numInfluencers, defines.push("#define MORPHTARGETS"), defines.push("#define NUM_MORPH_INFLUENCERS " + numMorphInfluencers), morphTargetManager.isUsingTextureForTargets && defines.push("#define MORPHTARGETS_TEXTURE"), materialHelper/* MaterialHelper.PrepareAttributesForMorphTargetsInfluencers */.G.PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, numMorphInfluencers)), useInstances && (defines.push("#define INSTANCES"), materialHelper/* MaterialHelper.PushAttributesForInstances */.G.PushAttributesForInstances(attribs), subMesh.getRenderingMesh().hasThinInstances && defines.push("#define THIN_INSTANCES")), this._storeNonLinearDepth && defines.push("#define NONLINEARDEPTH"), this.isPacked && defines.push("#define PACKED"), (0,clipPlaneMaterialHelper/* prepareDefinesForClipPlanes */.AN)(material, scene, defines);const drawWrapper = subMesh._getDrawWrapper(void 0, !0),cachedDefines = drawWrapper.defines,join = defines.join("\n");if (cachedDefines !== join) {const uniforms = ["world", "mBones", "boneTextureWidth", "viewProjection", "diffuseMatrix", "depthValues", "morphTargetInfluences", "morphTargetTextureInfo", "morphTargetTextureIndices"];(0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(uniforms), drawWrapper.setEffect(engine.createEffect("depth", attribs, uniforms, ["diffuseSampler", "morphTargets", "boneSampler"], join, void 0, void 0, void 0, { maxSimultaneousMorphTargets: numMorphInfluencers }), join);}return drawWrapper.effect.isReady();}getDepthMap() {return this._depthMap;}dispose() {const keysToDelete = [];for (const key in this._scene._depthRenderer) {const depthRenderer = this._scene._depthRenderer[key];depthRenderer === this && keysToDelete.push(key);}if (0 < keysToDelete.length) {this._depthMap.dispose();for (const key of keysToDelete) delete this._scene._depthRenderer[key];}}}DepthRenderer._SceneComponentInitialization = () => {throw (0,devTools/* _WarnImport */.S)("DepthRendererSceneComponent");};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/postProcessManager.js
var postProcessManager = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/postProcessManager.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/minmaxRedux.fragment.js
const minmaxRedux_fragment_name = "minmaxReduxPixelShader",minmaxRedux_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
#if defined(INITIAL)
uniform sampler2D sourceTexture;
uniform vec2 texSize;
void main(void)
{
ivec2 coord=ivec2(vUV*(texSize-1.0));
float f1=texelFetch(sourceTexture,coord,0).r;
float f2=texelFetch(sourceTexture,coord+ivec2(1,0),0).r;
float f3=texelFetch(sourceTexture,coord+ivec2(1,1),0).r;
float f4=texelFetch(sourceTexture,coord+ivec2(0,1),0).r;
float minz=min(min(min(f1,f2),f3),f4);
#ifdef DEPTH_REDUX
float maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4);
#else
float maxz=max(max(max(f1,f2),f3),f4);
#endif
glFragColor=vec4(minz,maxz,0.,0.);
}
#elif defined(MAIN)
uniform vec2 texSize;
void main(void)
{
ivec2 coord=ivec2(vUV*(texSize-1.0));
vec2 f1=texelFetch(textureSampler,coord,0).rg;
vec2 f2=texelFetch(textureSampler,coord+ivec2(1,0),0).rg;
vec2 f3=texelFetch(textureSampler,coord+ivec2(1,1),0).rg;
vec2 f4=texelFetch(textureSampler,coord+ivec2(0,1),0).rg;
float minz=min(min(min(f1.x,f2.x),f3.x),f4.x);
float maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);
glFragColor=vec4(minz,maxz,0.,0.);
}
#elif defined(ONEBEFORELAST)
uniform ivec2 texSize;
void main(void)
{
ivec2 coord=ivec2(vUV*vec2(texSize-1));
vec2 f1=texelFetch(textureSampler,coord % texSize,0).rg;
vec2 f2=texelFetch(textureSampler,(coord+ivec2(1,0)) % texSize,0).rg;
vec2 f3=texelFetch(textureSampler,(coord+ivec2(1,1)) % texSize,0).rg;
vec2 f4=texelFetch(textureSampler,(coord+ivec2(0,1)) % texSize,0).rg;
float minz=min(f1.x,f2.x);
float maxz=max(f1.y,f2.y);
glFragColor=vec4(minz,maxz,0.,0.);
}
#elif defined(LAST)
void main(void)
{
glFragColor=vec4(0.);
if (true) { 
discard;
}
}
#endif
`;shaderStore/* ShaderStore.ShadersStore.minmaxReduxPixelShader */.v.ShadersStore.minmaxReduxPixelShader = minmaxRedux_fragment_shader;const minmaxReduxPixelShader = { name: "minmaxReduxPixelShader", shader: minmaxRedux_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/minMaxReducer.js
class MinMaxReducer {constructor(camera) {this.onAfterReductionPerformed = new observable/* Observable */.y$(), this._forceFullscreenViewport = !0, this._activated = !1, this._camera = camera, this._postProcessManager = new postProcessManager/* PostProcessManager */.O(camera.getScene()), this._onContextRestoredObserver = camera.getEngine().onContextRestoredObservable.add(() => {this._postProcessManager._rebuild();});}get sourceTexture() {return this._sourceTexture;}setSourceTexture(sourceTexture, depthRedux, type = 2, forceFullscreenViewport = !0) {if (sourceTexture === this._sourceTexture) return;this.dispose(!1), this._sourceTexture = sourceTexture, this._reductionSteps = [], this._forceFullscreenViewport = forceFullscreenViewport;const scene = this._camera.getScene(),reductionInitial = new PostProcesses_postProcess/* PostProcess */.D("Initial reduction phase", "minmaxRedux", ["texSize"], ["sourceTexture"], 1, null, 1, scene.getEngine(), !1, "#define INITIAL" + (depthRedux ? "\n#define DEPTH_REDUX" : ""), type, void 0, void 0, void 0, 7);reductionInitial.autoClear = !1, reductionInitial.forceFullscreenViewport = forceFullscreenViewport;let w = this._sourceTexture.getRenderWidth(),h = this._sourceTexture.getRenderHeight();reductionInitial.onApply = ((w, h) => (effect) => {effect.setTexture("sourceTexture", this._sourceTexture), effect.setFloat2("texSize", w, h);})(w, h), this._reductionSteps.push(reductionInitial);for (let index = 1; 1 < w || 1 < h;) {w = Math.max(Math.round(w / 2), 1), h = Math.max(Math.round(h / 2), 1);const reduction = new PostProcesses_postProcess/* PostProcess */.D("Reduction phase " + index, "minmaxRedux", ["texSize"], null, { width: w, height: h }, null, 1, scene.getEngine(), !1, "#define " + (1 == w && 1 == h ? "LAST" : 1 == w || 1 == h ? "ONEBEFORELAST" : "MAIN"), type, void 0, void 0, void 0, 7);if (reduction.autoClear = !1, reduction.forceFullscreenViewport = forceFullscreenViewport, reduction.onApply = ((w, h) => (effect) => {1 == w || 1 == h ? effect.setInt2("texSize", w, h) : effect.setFloat2("texSize", w, h);})(w, h), this._reductionSteps.push(reduction), index++, 1 == w && 1 == h) {const func = (w, h, reduction) => {const buffer = new Float32Array(4 * w * h),minmax = { min: 0, max: 0 };return () => {scene.getEngine()._readTexturePixels(reduction.inputTexture.texture, w, h, -1, 0, buffer, !1), minmax.min = buffer[0], minmax.max = buffer[1], this.onAfterReductionPerformed.notifyObservers(minmax);};};reduction.onAfterRenderObservable.add(func(w, h, reduction));}}}get refreshRate() {return this._sourceTexture ? this._sourceTexture.refreshRate : -1;}set refreshRate(value) {this._sourceTexture && (this._sourceTexture.refreshRate = value);}get activated() {return this._activated;}activate() {this._onAfterUnbindObserver || !this._sourceTexture || (this._onAfterUnbindObserver = this._sourceTexture.onAfterUnbindObservable.add(() => {var _a, _b;const engine = this._camera.getScene().getEngine();null === (_a = engine._debugPushGroup) || void 0 === _a ? void 0 : _a.call(engine, `min max reduction`, 1), this._reductionSteps[0].activate(this._camera), this._postProcessManager.directRender(this._reductionSteps, this._reductionSteps[0].inputTexture, this._forceFullscreenViewport), engine.unBindFramebuffer(this._reductionSteps[0].inputTexture, !1), null === (_b = engine._debugPopGroup) || void 0 === _b ? void 0 : _b.call(engine, 1);}), this._activated = !0);}deactivate() {this._onAfterUnbindObserver && this._sourceTexture && (this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver), this._onAfterUnbindObserver = null, this._activated = !1);}dispose(disposeAll = !0) {if (disposeAll && (this.onAfterReductionPerformed.clear(), this._onContextRestoredObserver && (this._camera.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null)), this.deactivate(), this._reductionSteps) {for (let i = 0; i < this._reductionSteps.length; ++i) this._reductionSteps[i].dispose();this._reductionSteps = null;}this._postProcessManager && disposeAll && this._postProcessManager.dispose(), this._sourceTexture = null;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/depthReducer.js
class DepthReducer extends MinMaxReducer {get depthRenderer() {return this._depthRenderer;}constructor(camera) {super(camera);}setDepthRenderer(depthRenderer = null, type = 2, forceFullscreenViewport = !0) {const scene = this._camera.getScene();this._depthRenderer && (delete scene._depthRenderer[this._depthRendererId], this._depthRenderer.dispose(), this._depthRenderer = null), null === depthRenderer && (!scene._depthRenderer && (scene._depthRenderer = {}), depthRenderer = this._depthRenderer = new DepthRenderer(scene, type, this._camera, !1, 1), depthRenderer.enabled = !1, this._depthRendererId = "minmax" + this._camera.id, scene._depthRenderer[this._depthRendererId] = depthRenderer), super.setSourceTexture(depthRenderer.getDepthMap(), !0, type, forceFullscreenViewport);}setSourceTexture(sourceTexture, depthRedux, type = 2, forceFullscreenViewport = !0) {super.setSourceTexture(sourceTexture, depthRedux, type, forceFullscreenViewport);}activate() {this._depthRenderer && (this._depthRenderer.enabled = !0), super.activate();}deactivate() {super.deactivate(), this._depthRenderer && (this._depthRenderer.enabled = !1);}dispose(disposeAll = !0) {if (super.dispose(disposeAll), this._depthRenderer && disposeAll) {const scene = this._depthRenderer.getDepthMap().getScene();scene && delete scene._depthRenderer[this._depthRendererId], this._depthRenderer.dispose(), this._depthRenderer = null;}}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Lights/Shadows/cascadedShadowGenerator.js
const UpDir = math_vector/* Vector3.Up */.P.Up(),ZeroVec = math_vector/* Vector3.Zero */.P.Zero(),tmpv1 = new math_vector/* Vector3 */.P(),tmpv2 = new math_vector/* Vector3 */.P(),tmpMatrix = new math_vector/* Matrix */.y3();class CascadedShadowGenerator extends ShadowGenerator {_validateFilter(filter) {return filter === ShadowGenerator.FILTER_NONE || filter === ShadowGenerator.FILTER_PCF || filter === ShadowGenerator.FILTER_PCSS ? filter : (console.error("Unsupported filter \"" + filter + "\"!"), ShadowGenerator.FILTER_NONE);}get numCascades() {return this._numCascades;}set numCascades(value) {value = Math.min(Math.max(value, CascadedShadowGenerator.MIN_CASCADES_COUNT), CascadedShadowGenerator.MAX_CASCADES_COUNT);value === this._numCascades || (this._numCascades = value, this.recreateShadowMap(), this._recreateSceneUBOs());}get freezeShadowCastersBoundingInfo() {return this._freezeShadowCastersBoundingInfo;}set freezeShadowCastersBoundingInfo(freeze) {this._freezeShadowCastersBoundingInfoObservable && freeze && (this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable), this._freezeShadowCastersBoundingInfoObservable = null), this._freezeShadowCastersBoundingInfoObservable || freeze || (this._freezeShadowCastersBoundingInfoObservable = this._scene.onBeforeRenderObservable.add(this._computeShadowCastersBoundingInfo.bind(this))), this._freezeShadowCastersBoundingInfo = freeze, freeze && this._computeShadowCastersBoundingInfo();}_computeShadowCastersBoundingInfo() {if (this._scbiMin.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._scbiMax.copyFromFloats(Number.MIN_VALUE, Number.MIN_VALUE, Number.MIN_VALUE), this._shadowMap && this._shadowMap.renderList) {const renderList = this._shadowMap.renderList;for (let meshIndex = 0; meshIndex < renderList.length; meshIndex++) {const mesh = renderList[meshIndex];if (!mesh) continue;const boundingInfo = mesh.getBoundingInfo(),boundingBox = boundingInfo.boundingBox;this._scbiMin.minimizeInPlace(boundingBox.minimumWorld), this._scbiMax.maximizeInPlace(boundingBox.maximumWorld);}const meshes = this._scene.meshes;for (let meshIndex = 0; meshIndex < meshes.length; meshIndex++) {const mesh = meshes[meshIndex];if (!mesh || !mesh.isVisible || !mesh.isEnabled || !mesh.receiveShadows) continue;const boundingInfo = mesh.getBoundingInfo(),boundingBox = boundingInfo.boundingBox;this._scbiMin.minimizeInPlace(boundingBox.minimumWorld), this._scbiMax.maximizeInPlace(boundingBox.maximumWorld);}}this._shadowCastersBoundingInfo.reConstruct(this._scbiMin, this._scbiMax);}get shadowCastersBoundingInfo() {return this._shadowCastersBoundingInfo;}set shadowCastersBoundingInfo(boundingInfo) {this._shadowCastersBoundingInfo = boundingInfo;}setMinMaxDistance(min, max) {this._minDistance === min && this._maxDistance === max || (min > max && (min = 0, max = 1), 0 > min && (min = 0), 1 < max && (max = 1), this._minDistance = min, this._maxDistance = max, this._breaksAreDirty = !0);}get minDistance() {return this._minDistance;}get maxDistance() {return this._maxDistance;}getClassName() {return CascadedShadowGenerator.CLASSNAME;}getCascadeMinExtents(cascadeIndex) {return 0 <= cascadeIndex && cascadeIndex < this._numCascades ? this._cascadeMinExtents[cascadeIndex] : null;}getCascadeMaxExtents(cascadeIndex) {return 0 <= cascadeIndex && cascadeIndex < this._numCascades ? this._cascadeMaxExtents[cascadeIndex] : null;}get shadowMaxZ() {return this._getCamera() ? this._shadowMaxZ : 0;}set shadowMaxZ(value) {const camera = this._getCamera();return camera ? void (this._shadowMaxZ === value || value < camera.minZ || value > camera.maxZ || (this._shadowMaxZ = value, this._light._markMeshesAsLightDirty(), this._breaksAreDirty = !0)) : void (this._shadowMaxZ = value);}get debug() {return this._debug;}set debug(dbg) {this._debug = dbg, this._light._markMeshesAsLightDirty();}get depthClamp() {return this._depthClamp;}set depthClamp(value) {this._depthClamp = value;}get cascadeBlendPercentage() {return this._cascadeBlendPercentage;}set cascadeBlendPercentage(value) {this._cascadeBlendPercentage = value, this._light._markMeshesAsLightDirty();}get lambda() {return this._lambda;}set lambda(value) {const lambda = Math.min(Math.max(value, 0), 1);this._lambda == lambda || (this._lambda = lambda, this._breaksAreDirty = !0);}getCascadeViewMatrix(cascadeNum) {return 0 <= cascadeNum && cascadeNum < this._numCascades ? this._viewMatrices[cascadeNum] : null;}getCascadeProjectionMatrix(cascadeNum) {return 0 <= cascadeNum && cascadeNum < this._numCascades ? this._projectionMatrices[cascadeNum] : null;}getCascadeTransformMatrix(cascadeNum) {return 0 <= cascadeNum && cascadeNum < this._numCascades ? this._transformMatrices[cascadeNum] : null;}setDepthRenderer(depthRenderer) {this._depthRenderer = depthRenderer, this._depthReducer && this._depthReducer.setDepthRenderer(this._depthRenderer);}get autoCalcDepthBounds() {return this._autoCalcDepthBounds;}set autoCalcDepthBounds(value) {const camera = this._getCamera();if (camera) return this._autoCalcDepthBounds = value, value ? void (!this._depthReducer && (this._depthReducer = new DepthReducer(camera), this._depthReducer.onAfterReductionPerformed.add((minmax) => {let min = minmax.min,max = minmax.max;min >= max && (min = 0, max = 1), (min != this._minDistance || max != this._maxDistance) && this.setMinMaxDistance(min, max);}), this._depthReducer.setDepthRenderer(this._depthRenderer)), this._depthReducer.activate()) : (this._depthReducer && this._depthReducer.deactivate(), void this.setMinMaxDistance(0, 1));}get autoCalcDepthBoundsRefreshRate() {var _a, _b, _c;return null !== (_c = null === (_b = null === (_a = this._depthReducer) || void 0 === _a ? void 0 : _a.depthRenderer) || void 0 === _b ? void 0 : _b.getDepthMap().refreshRate) && void 0 !== _c ? _c : -1;}set autoCalcDepthBoundsRefreshRate(value) {var _a;(null === (_a = this._depthReducer) || void 0 === _a ? void 0 : _a.depthRenderer) && (this._depthReducer.depthRenderer.getDepthMap().refreshRate = value);}splitFrustum() {this._breaksAreDirty = !0;}_splitFrustum() {const camera = this._getCamera();if (!camera) return;const near = camera.minZ,far = camera.maxZ,cameraRange = far - near,minDistance = this._minDistance,maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? Math.min((this._shadowMaxZ - near) / (far - near), this._maxDistance) : this._maxDistance,minZ = near + minDistance * cameraRange,maxZ = near + maxDistance * cameraRange;for (let cascadeIndex = 0; cascadeIndex < this._cascades.length; ++cascadeIndex) {const p = (cascadeIndex + 1) / this._numCascades,uniform = minZ + (maxZ - minZ) * p,d = this._lambda * (minZ * (maxZ / minZ) ** p - uniform) + uniform;this._cascades[cascadeIndex].prevBreakDistance = 0 == cascadeIndex ? minDistance : this._cascades[cascadeIndex - 1].breakDistance, this._cascades[cascadeIndex].breakDistance = (d - near) / cameraRange, this._viewSpaceFrustumsZ[cascadeIndex] = d, this._frustumLengths[cascadeIndex] = (this._cascades[cascadeIndex].breakDistance - this._cascades[cascadeIndex].prevBreakDistance) * cameraRange;}this._breaksAreDirty = !1;}_computeMatrices() {const scene = this._scene,camera = this._getCamera();if (camera) {math_vector/* Vector3.NormalizeToRef */.P.NormalizeToRef(this._light.getShadowDirection(0), this._lightDirection), 1 === Math.abs(math_vector/* Vector3.Dot */.P.Dot(this._lightDirection, math_vector/* Vector3.Up */.P.Up())) && (this._lightDirection.z = 1e-13), this._cachedDirection.copyFrom(this._lightDirection);const useReverseDepthBuffer = scene.getEngine().useReverseDepthBuffer;for (let cascadeIndex = 0; cascadeIndex < this._numCascades; ++cascadeIndex) {this._computeFrustumInWorldSpace(cascadeIndex), this._computeCascadeFrustum(cascadeIndex), this._cascadeMaxExtents[cascadeIndex].subtractToRef(this._cascadeMinExtents[cascadeIndex], tmpv1), this._frustumCenter[cascadeIndex].addToRef(this._lightDirection.scale(this._cascadeMinExtents[cascadeIndex].z), this._shadowCameraPos[cascadeIndex]), math_vector/* Matrix.LookAtLHToRef */.y3.LookAtLHToRef(this._shadowCameraPos[cascadeIndex], this._frustumCenter[cascadeIndex], UpDir, this._viewMatrices[cascadeIndex]);let minZ = 0,maxZ = tmpv1.z;const boundingInfo = this._shadowCastersBoundingInfo;boundingInfo.update(this._viewMatrices[cascadeIndex]), maxZ = Math.min(maxZ, boundingInfo.boundingBox.maximumWorld.z), minZ = this._depthClamp && this.filter !== ShadowGenerator.FILTER_PCSS ? Math.max(minZ, boundingInfo.boundingBox.minimumWorld.z) : Math.min(minZ, boundingInfo.boundingBox.minimumWorld.z), math_vector/* Matrix.OrthoOffCenterLHToRef */.y3.OrthoOffCenterLHToRef(this._cascadeMinExtents[cascadeIndex].x, this._cascadeMaxExtents[cascadeIndex].x, this._cascadeMinExtents[cascadeIndex].y, this._cascadeMaxExtents[cascadeIndex].y, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, this._projectionMatrices[cascadeIndex], scene.getEngine().isNDCHalfZRange), this._cascadeMinExtents[cascadeIndex].z = minZ, this._cascadeMaxExtents[cascadeIndex].z = maxZ, this._viewMatrices[cascadeIndex].multiplyToRef(this._projectionMatrices[cascadeIndex], this._transformMatrices[cascadeIndex]), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(ZeroVec, this._transformMatrices[cascadeIndex], tmpv1), tmpv1.scaleInPlace(this._mapSize / 2), tmpv2.copyFromFloats(Math.round(tmpv1.x), Math.round(tmpv1.y), Math.round(tmpv1.z)), tmpv2.subtractInPlace(tmpv1).scaleInPlace(2 / this._mapSize), math_vector/* Matrix.TranslationToRef */.y3.TranslationToRef(tmpv2.x, tmpv2.y, 0, tmpMatrix), this._projectionMatrices[cascadeIndex].multiplyToRef(tmpMatrix, this._projectionMatrices[cascadeIndex]), this._viewMatrices[cascadeIndex].multiplyToRef(this._projectionMatrices[cascadeIndex], this._transformMatrices[cascadeIndex]), this._transformMatrices[cascadeIndex].copyToArray(this._transformMatricesAsArray, 16 * cascadeIndex);}}}_computeFrustumInWorldSpace(cascadeIndex) {const camera = this._getCamera();if (!camera) return;const prevSplitDist = this._cascades[cascadeIndex].prevBreakDistance,splitDist = this._cascades[cascadeIndex].breakDistance,isNDCHalfZRange = this._scene.getEngine().isNDCHalfZRange;camera.getViewMatrix();const invViewProj = math_vector/* Matrix.Invert */.y3.Invert(camera.getTransformationMatrix()),cornerIndexOffset = this._scene.getEngine().useReverseDepthBuffer ? 4 : 0;for (let cornerIndex = 0; cornerIndex < CascadedShadowGenerator._FrustumCornersNDCSpace.length; ++cornerIndex) tmpv1.copyFrom(CascadedShadowGenerator._FrustumCornersNDCSpace[(cornerIndex + cornerIndexOffset) % CascadedShadowGenerator._FrustumCornersNDCSpace.length]), isNDCHalfZRange && -1 === tmpv1.z && (tmpv1.z = 0), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(tmpv1, invViewProj, this._frustumCornersWorldSpace[cascadeIndex][cornerIndex]);for (let cornerIndex = 0; cornerIndex < CascadedShadowGenerator._FrustumCornersNDCSpace.length / 2; ++cornerIndex) tmpv1.copyFrom(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex + 4]).subtractInPlace(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex]), tmpv2.copyFrom(tmpv1).scaleInPlace(prevSplitDist), tmpv1.scaleInPlace(splitDist), tmpv1.addInPlace(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex]), this._frustumCornersWorldSpace[cascadeIndex][cornerIndex + 4].copyFrom(tmpv1), this._frustumCornersWorldSpace[cascadeIndex][cornerIndex].addInPlace(tmpv2);}_computeCascadeFrustum(cascadeIndex) {this._cascadeMinExtents[cascadeIndex].copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cascadeMaxExtents[cascadeIndex].copyFromFloats(Number.MIN_VALUE, Number.MIN_VALUE, Number.MIN_VALUE), this._frustumCenter[cascadeIndex].copyFromFloats(0, 0, 0);const camera = this._getCamera();if (camera) {for (let cornerIndex = 0; cornerIndex < this._frustumCornersWorldSpace[cascadeIndex].length; ++cornerIndex) this._frustumCenter[cascadeIndex].addInPlace(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex]);if (this._frustumCenter[cascadeIndex].scaleInPlace(1 / this._frustumCornersWorldSpace[cascadeIndex].length), this.stabilizeCascades) {let sphereRadius = 0;for (let cornerIndex = 0; cornerIndex < this._frustumCornersWorldSpace[cascadeIndex].length; ++cornerIndex) {const dist = this._frustumCornersWorldSpace[cascadeIndex][cornerIndex].subtractToRef(this._frustumCenter[cascadeIndex], tmpv1).length();sphereRadius = Math.max(sphereRadius, dist);}sphereRadius = Math.ceil(16 * sphereRadius) / 16, this._cascadeMaxExtents[cascadeIndex].copyFromFloats(sphereRadius, sphereRadius, sphereRadius), this._cascadeMinExtents[cascadeIndex].copyFromFloats(-sphereRadius, -sphereRadius, -sphereRadius);} else {const lightCameraPos = this._frustumCenter[cascadeIndex];this._frustumCenter[cascadeIndex].addToRef(this._lightDirection, tmpv1), math_vector/* Matrix.LookAtLHToRef */.y3.LookAtLHToRef(lightCameraPos, tmpv1, UpDir, tmpMatrix);for (let cornerIndex = 0; cornerIndex < this._frustumCornersWorldSpace[cascadeIndex].length; ++cornerIndex) math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex], tmpMatrix, tmpv1), this._cascadeMinExtents[cascadeIndex].minimizeInPlace(tmpv1), this._cascadeMaxExtents[cascadeIndex].maximizeInPlace(tmpv1);}}}_recreateSceneUBOs() {if (this._disposeSceneUBOs(), this._sceneUBOs) for (let i = 0; i < this._numCascades; ++i) this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for CSM Shadow Generator (light "${this._light.name}" cascade #${i})`));}static get IsSupported() {const engine = engineStore/* EngineStore.LastCreatedEngine */.l.LastCreatedEngine;return !!engine && engine._features.supportCSM;}constructor(mapSize, light, usefulFloatFirst, camera) {return CascadedShadowGenerator.IsSupported ? void (super(mapSize, light, usefulFloatFirst, camera), this.usePercentageCloserFiltering = !0) : void logger/* Logger.Error */.Y.Error("CascadedShadowMap is not supported by the current engine.");}_initializeGenerator() {var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;this.penumbraDarkness = null !== (_a = this.penumbraDarkness) && void 0 !== _a ? _a : 1, this._numCascades = null !== (_b = this._numCascades) && void 0 !== _b ? _b : CascadedShadowGenerator.DEFAULT_CASCADES_COUNT, this.stabilizeCascades = !(null === (_c = this.stabilizeCascades) || void 0 === _c) && _c, this._freezeShadowCastersBoundingInfoObservable = null !== (_d = this._freezeShadowCastersBoundingInfoObservable) && void 0 !== _d ? _d : null, this.freezeShadowCastersBoundingInfo = !(null === (_e = this.freezeShadowCastersBoundingInfo) || void 0 === _e) && _e, this._scbiMin = null !== (_f = this._scbiMin) && void 0 !== _f ? _f : new math_vector/* Vector3 */.P(0, 0, 0), this._scbiMax = null !== (_g = this._scbiMax) && void 0 !== _g ? _g : new math_vector/* Vector3 */.P(0, 0, 0), this._shadowCastersBoundingInfo = null !== (_h = this._shadowCastersBoundingInfo) && void 0 !== _h ? _h : new boundingInfo/* BoundingInfo */.j(new math_vector/* Vector3 */.P(0, 0, 0), new math_vector/* Vector3 */.P(0, 0, 0)), this._breaksAreDirty = null === (_j = this._breaksAreDirty) || void 0 === _j || _j, this._minDistance = null !== (_k = this._minDistance) && void 0 !== _k ? _k : 0, this._maxDistance = null !== (_l = this._maxDistance) && void 0 !== _l ? _l : 1, this._currentLayer = null !== (_m = this._currentLayer) && void 0 !== _m ? _m : 0, this._shadowMaxZ = null !== (_q = null !== (_o = this._shadowMaxZ) && void 0 !== _o ? _o : null === (_p = this._getCamera()) || void 0 === _p ? void 0 : _p.maxZ) && void 0 !== _q ? _q : 1e4, this._debug = !(null === (_r = this._debug) || void 0 === _r) && _r, this._depthClamp = null === (_s = this._depthClamp) || void 0 === _s || _s, this._cascadeBlendPercentage = null !== (_t = this._cascadeBlendPercentage) && void 0 !== _t ? _t : .1, this._lambda = null !== (_u = this._lambda) && void 0 !== _u ? _u : .5, this._autoCalcDepthBounds = !(null === (_v = this._autoCalcDepthBounds) || void 0 === _v) && _v, this._recreateSceneUBOs(), super._initializeGenerator();}_createTargetRenderTexture() {const engine = this._scene.getEngine(),size = { width: this._mapSize, height: this._mapSize, layers: this.numCascades };this._shadowMap = new Textures_renderTargetTexture/* RenderTargetTexture */._(this._light.name + "_CSMShadowMap", size, this._scene, !1, !0, this._textureType, !1, void 0, !1, !1, void 0), this._shadowMap.createDepthStencilTexture(engine.useReverseDepthBuffer ? 516 : 513, !0);}_initializeShadowMap() {if (super._initializeShadowMap(), null === this._shadowMap) return;this._transformMatricesAsArray = new Float32Array(16 * this._numCascades), this._viewSpaceFrustumsZ = Array(this._numCascades), this._frustumLengths = Array(this._numCascades), this._lightSizeUVCorrection = Array(2 * this._numCascades), this._depthCorrection = Array(this._numCascades), this._cascades = [], this._viewMatrices = [], this._projectionMatrices = [], this._transformMatrices = [], this._cascadeMinExtents = [], this._cascadeMaxExtents = [], this._frustumCenter = [], this._shadowCameraPos = [], this._frustumCornersWorldSpace = [];for (let cascadeIndex = 0; cascadeIndex < this._numCascades; ++cascadeIndex) {this._cascades[cascadeIndex] = { prevBreakDistance: 0, breakDistance: 0 }, this._viewMatrices[cascadeIndex] = math_vector/* Matrix.Zero */.y3.Zero(), this._projectionMatrices[cascadeIndex] = math_vector/* Matrix.Zero */.y3.Zero(), this._transformMatrices[cascadeIndex] = math_vector/* Matrix.Zero */.y3.Zero(), this._cascadeMinExtents[cascadeIndex] = new math_vector/* Vector3 */.P(), this._cascadeMaxExtents[cascadeIndex] = new math_vector/* Vector3 */.P(), this._frustumCenter[cascadeIndex] = new math_vector/* Vector3 */.P(), this._shadowCameraPos[cascadeIndex] = new math_vector/* Vector3 */.P(), this._frustumCornersWorldSpace[cascadeIndex] = Array(CascadedShadowGenerator._FrustumCornersNDCSpace.length);for (let i = 0; i < CascadedShadowGenerator._FrustumCornersNDCSpace.length; ++i) this._frustumCornersWorldSpace[cascadeIndex][i] = new math_vector/* Vector3 */.P();}const engine = this._scene.getEngine();this._shadowMap.onBeforeBindObservable.clear(), this._shadowMap.onBeforeRenderObservable.clear(), this._shadowMap.onBeforeRenderObservable.add((layer) => {this._sceneUBOs && this._scene.setSceneUniformBuffer(this._sceneUBOs[layer]), this._currentLayer = layer, this._filter === ShadowGenerator.FILTER_PCF && engine.setColorWrite(!1), this._scene.setTransformMatrix(this.getCascadeViewMatrix(layer), this.getCascadeProjectionMatrix(layer)), this._useUBO && (this._scene.getSceneUniformBuffer().unbindEffect(), this._scene.finalizeSceneUbo());}), this._shadowMap.onBeforeBindObservable.add(() => {var _a;this._currentSceneUBO = this._scene.getSceneUniformBuffer(), null === (_a = engine._debugPushGroup) || void 0 === _a ? void 0 : _a.call(engine, `cascaded shadow map generation for pass id ${engine.currentRenderPassId}`, 1), this._breaksAreDirty && this._splitFrustum(), this._computeMatrices();}), this._splitFrustum();}_bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect) {effect.setMatrix("viewProjection", this.getCascadeTransformMatrix(this._currentLayer));}_isReadyCustomDefines(defines) {defines.push("#define SM_DEPTHCLAMP " + (this._depthClamp && this._filter !== ShadowGenerator.FILTER_PCSS ? "1" : "0"));}prepareDefines(defines, lightIndex) {super.prepareDefines(defines, lightIndex);const scene = this._scene,light = this._light;if (scene.shadowsEnabled && light.shadowEnabled) {defines["SHADOWCSM" + lightIndex] = !0, defines["SHADOWCSMDEBUG" + lightIndex] = this.debug, defines["SHADOWCSMNUM_CASCADES" + lightIndex] = this.numCascades, defines["SHADOWCSM_RIGHTHANDED" + lightIndex] = scene.useRightHandedSystem;const camera = this._getCamera();camera && this._shadowMaxZ < camera.maxZ && (defines["SHADOWCSMUSESHADOWMAXZ" + lightIndex] = !0), 0 === this.cascadeBlendPercentage && (defines["SHADOWCSMNOBLEND" + lightIndex] = !0);}}bindShadowLight(lightIndex, effect) {const light = this._light,scene = this._scene;if (scene.shadowsEnabled && light.shadowEnabled) {const camera = this._getCamera();if (camera) {const shadowMap = this.getShadowMap();if (shadowMap) {const width = shadowMap.getSize().width;if (effect.setMatrices("lightMatrix" + lightIndex, this._transformMatricesAsArray), effect.setArray("viewFrustumZ" + lightIndex, this._viewSpaceFrustumsZ), effect.setFloat("cascadeBlendFactor" + lightIndex, 0 === this.cascadeBlendPercentage ? 1e4 : 1 / this.cascadeBlendPercentage), effect.setArray("frustumLengths" + lightIndex, this._frustumLengths), this._filter === ShadowGenerator.FILTER_PCF) effect.setDepthStencilTexture("shadowSampler" + lightIndex, shadowMap), light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), width, 1 / width, this.frustumEdgeFalloff, lightIndex);else if (this._filter === ShadowGenerator.FILTER_PCSS) {for (let cascadeIndex = 0; cascadeIndex < this._numCascades; ++cascadeIndex) this._lightSizeUVCorrection[2 * cascadeIndex + 0] = 0 == cascadeIndex ? 1 : (this._cascadeMaxExtents[0].x - this._cascadeMinExtents[0].x) / (this._cascadeMaxExtents[cascadeIndex].x - this._cascadeMinExtents[cascadeIndex].x), this._lightSizeUVCorrection[2 * cascadeIndex + 1] = 0 == cascadeIndex ? 1 : (this._cascadeMaxExtents[0].y - this._cascadeMinExtents[0].y) / (this._cascadeMaxExtents[cascadeIndex].y - this._cascadeMinExtents[cascadeIndex].y), this._depthCorrection[cascadeIndex] = 0 == cascadeIndex ? 1 : (this._cascadeMaxExtents[cascadeIndex].z - this._cascadeMinExtents[cascadeIndex].z) / (this._cascadeMaxExtents[0].z - this._cascadeMinExtents[0].z);effect.setDepthStencilTexture("shadowSampler" + lightIndex, shadowMap), effect.setTexture("depthSampler" + lightIndex, shadowMap), effect.setArray2("lightSizeUVCorrection" + lightIndex, this._lightSizeUVCorrection), effect.setArray("depthCorrection" + lightIndex, this._depthCorrection), effect.setFloat("penumbraDarkness" + lightIndex, this.penumbraDarkness), light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), 1 / width, this._contactHardeningLightSizeUVRatio * width, this.frustumEdgeFalloff, lightIndex);} else effect.setTexture("shadowSampler" + lightIndex, shadowMap), light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), width, 1 / width, this.frustumEdgeFalloff, lightIndex);light._uniformBuffer.updateFloat2("depthValues", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera), lightIndex);}}}}getTransformMatrix() {return this.getCascadeTransformMatrix(0);}dispose() {super.dispose(), this._freezeShadowCastersBoundingInfoObservable && (this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable), this._freezeShadowCastersBoundingInfoObservable = null), this._depthReducer && (this._depthReducer.dispose(), this._depthReducer = null);}serialize() {const serializationObject = super.serialize(),shadowMap = this.getShadowMap();if (!shadowMap) return serializationObject;if (serializationObject.numCascades = this._numCascades, serializationObject.debug = this._debug, serializationObject.stabilizeCascades = this.stabilizeCascades, serializationObject.lambda = this._lambda, serializationObject.cascadeBlendPercentage = this.cascadeBlendPercentage, serializationObject.depthClamp = this._depthClamp, serializationObject.autoCalcDepthBounds = this.autoCalcDepthBounds, serializationObject.shadowMaxZ = this._shadowMaxZ, serializationObject.penumbraDarkness = this.penumbraDarkness, serializationObject.freezeShadowCastersBoundingInfo = this._freezeShadowCastersBoundingInfo, serializationObject.minDistance = this.minDistance, serializationObject.maxDistance = this.maxDistance, serializationObject.renderList = [], shadowMap.renderList) for (let meshIndex = 0; meshIndex < shadowMap.renderList.length; meshIndex++) {const mesh = shadowMap.renderList[meshIndex];serializationObject.renderList.push(mesh.id);}return serializationObject;}static Parse(parsedShadowGenerator, scene) {const shadowGenerator = ShadowGenerator.Parse(parsedShadowGenerator, scene, (mapSize, light, camera) => new CascadedShadowGenerator(mapSize, light, void 0, camera));return void 0 !== parsedShadowGenerator.numCascades && (shadowGenerator.numCascades = parsedShadowGenerator.numCascades), void 0 !== parsedShadowGenerator.debug && (shadowGenerator.debug = parsedShadowGenerator.debug), void 0 !== parsedShadowGenerator.stabilizeCascades && (shadowGenerator.stabilizeCascades = parsedShadowGenerator.stabilizeCascades), void 0 !== parsedShadowGenerator.lambda && (shadowGenerator.lambda = parsedShadowGenerator.lambda), void 0 !== parsedShadowGenerator.cascadeBlendPercentage && (shadowGenerator.cascadeBlendPercentage = parsedShadowGenerator.cascadeBlendPercentage), void 0 !== parsedShadowGenerator.depthClamp && (shadowGenerator.depthClamp = parsedShadowGenerator.depthClamp), void 0 !== parsedShadowGenerator.autoCalcDepthBounds && (shadowGenerator.autoCalcDepthBounds = parsedShadowGenerator.autoCalcDepthBounds), void 0 !== parsedShadowGenerator.shadowMaxZ && (shadowGenerator.shadowMaxZ = parsedShadowGenerator.shadowMaxZ), void 0 !== parsedShadowGenerator.penumbraDarkness && (shadowGenerator.penumbraDarkness = parsedShadowGenerator.penumbraDarkness), void 0 !== parsedShadowGenerator.freezeShadowCastersBoundingInfo && (shadowGenerator.freezeShadowCastersBoundingInfo = parsedShadowGenerator.freezeShadowCastersBoundingInfo), void 0 !== parsedShadowGenerator.minDistance && void 0 !== parsedShadowGenerator.maxDistance && shadowGenerator.setMinMaxDistance(parsedShadowGenerator.minDistance, parsedShadowGenerator.maxDistance), shadowGenerator;}}CascadedShadowGenerator._FrustumCornersNDCSpace = [new math_vector/* Vector3 */.P(-1, 1, -1), new math_vector/* Vector3 */.P(1, 1, -1), new math_vector/* Vector3 */.P(1, -1, -1), new math_vector/* Vector3 */.P(-1, -1, -1), new math_vector/* Vector3 */.P(-1, 1, 1), new math_vector/* Vector3 */.P(1, 1, 1), new math_vector/* Vector3 */.P(1, -1, 1), new math_vector/* Vector3 */.P(-1, -1, 1)], CascadedShadowGenerator.CLASSNAME = "CascadedShadowGenerator", CascadedShadowGenerator.DEFAULT_CASCADES_COUNT = 4, CascadedShadowGenerator.MIN_CASCADES_COUNT = 2, CascadedShadowGenerator.MAX_CASCADES_COUNT = 4, CascadedShadowGenerator._SceneComponentInitialization = () => {throw (0,devTools/* _WarnImport */.S)("ShadowGeneratorSceneComponent");};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js
abstractScene/* AbstractScene.AddParser */.p.AddParser(sceneComponent/* SceneComponentConstants.NAME_SHADOWGENERATOR */.l.NAME_SHADOWGENERATOR, (parsedData, scene) => {if (parsedData.shadowGenerators !== void 0 && null !== parsedData.shadowGenerators) for (let index = 0, cache = parsedData.shadowGenerators.length; index < cache; index++) {const parsedShadowGenerator = parsedData.shadowGenerators[index];parsedShadowGenerator.className === CascadedShadowGenerator.CLASSNAME ? CascadedShadowGenerator.Parse(parsedShadowGenerator, scene) : ShadowGenerator.Parse(parsedShadowGenerator, scene);}});class ShadowGeneratorSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_SHADOWGENERATOR */.l.NAME_SHADOWGENERATOR, this.scene = scene;}register() {this.scene._gatherRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR */.l.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR, this, this._gatherRenderTargets);}rebuild() {}serialize(serializationObject) {serializationObject.shadowGenerators = [];const lights = this.scene.lights;for (const light of lights) {const shadowGenerators = light.getShadowGenerators();if (shadowGenerators) {const iterator = shadowGenerators.values();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const shadowGenerator = key.value;serializationObject.shadowGenerators.push(shadowGenerator.serialize());}}}}addFromContainer() {}removeFromContainer() {}dispose() {}_gatherRenderTargets(renderTargets) {const scene = this.scene;if (this.scene.shadowsEnabled) for (let lightIndex = 0; lightIndex < scene.lights.length; lightIndex++) {const light = scene.lights[lightIndex],shadowGenerators = light.getShadowGenerators();if (light.isEnabled() && light.shadowEnabled && shadowGenerators) {const iterator = shadowGenerators.values();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const shadowGenerator = key.value,shadowMap = shadowGenerator.getShadowMap();-1 !== scene.textures.indexOf(shadowMap) && renderTargets.push(shadowMap);}}}}}ShadowGenerator._SceneComponentInitialization = (scene) => {let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_SHADOWGENERATOR */.l.NAME_SHADOWGENERATOR);component || (component = new ShadowGeneratorSceneComponent(scene), scene._addComponent(component));};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Lights/Shadows/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/pointLight.js
var pointLight = __webpack_require__("./node_modules/@babylonjs/core/Lights/pointLight.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Lights/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Loading/loadingScreen.js
class DefaultLoadingScreen {constructor(_renderingCanvas, _loadingText = "", _loadingDivBackgroundColor = "black") {this._renderingCanvas = _renderingCanvas, this._loadingText = _loadingText, this._loadingDivBackgroundColor = _loadingDivBackgroundColor, this._resizeLoadingUI = () => {const canvasRect = this._renderingCanvas.getBoundingClientRect(),canvasPositioning = window.getComputedStyle(this._renderingCanvas).position;this._loadingDiv && (this._loadingDiv.style.position = "fixed" === canvasPositioning ? "fixed" : "absolute", this._loadingDiv.style.left = canvasRect.left + "px", this._loadingDiv.style.top = canvasRect.top + "px", this._loadingDiv.style.width = canvasRect.width + "px", this._loadingDiv.style.height = canvasRect.height + "px");};}displayLoadingUI() {if (this._loadingDiv) return;this._loadingDiv = document.createElement("div"), this._loadingDiv.id = "babylonjsLoadingDiv", this._loadingDiv.style.opacity = "0", this._loadingDiv.style.transition = "opacity 1.5s ease", this._loadingDiv.style.pointerEvents = "none", this._loadingDiv.style.display = "grid", this._loadingDiv.style.gridTemplateRows = "100%", this._loadingDiv.style.gridTemplateColumns = "100%", this._loadingDiv.style.justifyItems = "center", this._loadingDiv.style.alignItems = "center", this._loadingTextDiv = document.createElement("div"), this._loadingTextDiv.style.position = "absolute", this._loadingTextDiv.style.left = "0", this._loadingTextDiv.style.top = "50%", this._loadingTextDiv.style.marginTop = "80px", this._loadingTextDiv.style.width = "100%", this._loadingTextDiv.style.height = "20px", this._loadingTextDiv.style.fontFamily = "Arial", this._loadingTextDiv.style.fontSize = "14px", this._loadingTextDiv.style.color = "white", this._loadingTextDiv.style.textAlign = "center", this._loadingTextDiv.style.zIndex = "1", this._loadingTextDiv.innerHTML = "Loading", this._loadingDiv.appendChild(this._loadingTextDiv), this._loadingTextDiv.innerHTML = this._loadingText, this._style = document.createElement("style"), this._style.type = "text/css";this._style.innerHTML = "@-webkit-keyframes spin1 {                    0% { -webkit-transform: rotate(0deg);}\n                    100% { -webkit-transform: rotate(360deg);}\n                }                @keyframes spin1 {                    0% { transform: rotate(0deg);}\n                    100% { transform: rotate(360deg);}\n                }", document.getElementsByTagName("head")[0].appendChild(this._style);const svgSupport = !!window.SVGSVGElement,imgBack = new Image();imgBack.src = DefaultLoadingScreen.DefaultLogoUrl ? DefaultLoadingScreen.DefaultLogoUrl : svgSupport ? `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODAuMTcgMjA4LjA0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6I2UwNjg0Yjt9LmNscy0ze2ZpbGw6I2JiNDY0Yjt9LmNscy00e2ZpbGw6I2UwZGVkODt9LmNscy01e2ZpbGw6I2Q1ZDJjYTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkJhYnlsb25Mb2dvPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iUGFnZV9FbGVtZW50cyIgZGF0YS1uYW1lPSJQYWdlIEVsZW1lbnRzIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05MC4wOSwwLDAsNTJWMTU2bDkwLjA5LDUyLDkwLjA4LTUyVjUyWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxODAuMTcgNTIuMDEgMTUxLjk3IDM1LjczIDEyNC44NSA1MS4zOSAxNTMuMDUgNjcuNjcgMTgwLjE3IDUyLjAxIi8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjI3LjEyIDY3LjY3IDExNy4yMSAxNS42NiA5MC4wOCAwIDAgNTIuMDEgMjcuMTIgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iNjEuODkgMTIwLjMgOTAuMDggMTM2LjU4IDExOC4yOCAxMjAuMyA5MC4wOCAxMDQuMDIgNjEuODkgMTIwLjMiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDE1My4wNSAxNDAuMzcgOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyAwIDUyLjAxIDAgMTU2LjAzIDkwLjA4IDIwOC4wNCAxODAuMTcgMTU2LjAzIDE4MC4xNyA1Mi4wMSAxNTMuMDUgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iOTAuMDggNzEuNDYgNjEuODkgODcuNzQgNjEuODkgMTIwLjMgOTAuMDggMTA0LjAyIDExOC4yOCAxMjAuMyAxMTguMjggODcuNzQgOTAuMDggNzEuNDYiLz48cG9seWdvbiBjbGFzcz0iY2xzLTQiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDExOC4yOCA4Ny43NCAxMTguMjggMTIwLjMgOTAuMDggMTM2LjU4IDkwLjA4IDE3Ni43MiAxNTMuMDUgMTQwLjM3IDE1My4wNSA2Ny42NyIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSIyNy4xMiA2Ny42NyA2MS44OSA4Ny43NCA2MS44OSAxMjAuMyA5MC4wOCAxMzYuNTggOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyIvPjwvZz48L2c+PC9zdmc+` : "https://cdn.babylonjs.com/Assets/babylonLogo.png", imgBack.style.width = "150px", imgBack.style.gridColumn = "1", imgBack.style.gridRow = "1", imgBack.style.top = "50%", imgBack.style.left = "50%", imgBack.style.transform = "translate(-50%, -50%)", imgBack.style.position = "absolute";const imageSpinnerContainer = document.createElement("div");imageSpinnerContainer.style.width = "300px", imageSpinnerContainer.style.gridColumn = "1", imageSpinnerContainer.style.gridRow = "1", imageSpinnerContainer.style.top = "50%", imageSpinnerContainer.style.left = "50%", imageSpinnerContainer.style.transform = "translate(-50%, -50%)", imageSpinnerContainer.style.position = "absolute";const imgSpinner = new Image();if (imgSpinner.src = DefaultLoadingScreen.DefaultSpinnerUrl ? DefaultLoadingScreen.DefaultSpinnerUrl : svgSupport ? `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOTIgMzkyIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UwNjg0Yjt9LmNscy0ye2ZpbGw6bm9uZTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlNwaW5uZXJJY29uPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iU3Bpbm5lciI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDAuMjEsMTI2LjQzYzMuNy03LjMxLDcuNjctMTQuNDQsMTItMjEuMzJsMy4zNi01LjEsMy41Mi01YzEuMjMtMS42MywyLjQxLTMuMjksMy42NS00LjkxczIuNTMtMy4yMSwzLjgyLTQuNzlBMTg1LjIsMTg1LjIsMCwwLDEsODMuNCw2Ny40M2EyMDgsMjA4LDAsMCwxLDE5LTE1LjY2YzMuMzUtMi40MSw2Ljc0LTQuNzgsMTAuMjUtN3M3LjExLTQuMjgsMTAuNzUtNi4zMmM3LjI5LTQsMTQuNzMtOCwyMi41My0xMS40OSwzLjktMS43Miw3Ljg4LTMuMywxMi00LjY0YTEwNC4yMiwxMDQuMjIsMCwwLDEsMTIuNDQtMy4yMyw2Mi40NCw2Mi40NCwwLDAsMSwxMi43OC0xLjM5QTI1LjkyLDI1LjkyLDAsMCwxLDE5NiwyMS40NGE2LjU1LDYuNTUsMCwwLDEsMi4wNSw5LDYuNjYsNi42NiwwLDAsMS0xLjY0LDEuNzhsLS40MS4yOWEyMi4wNywyMi4wNywwLDAsMS01Ljc4LDMsMzAuNDIsMzAuNDIsMCwwLDEtNS42NywxLjYyLDM3LjgyLDM3LjgyLDAsMCwxLTUuNjkuNzFjLTEsMC0xLjkuMTgtMi44NS4yNmwtMi44NS4yNHEtNS43Mi41MS0xMS40OCwxLjFjLTMuODQuNC03LjcxLjgyLTExLjU4LDEuNGExMTIuMzQsMTEyLjM0LDAsMCwwLTIyLjk0LDUuNjFjLTMuNzIsMS4zNS03LjM0LDMtMTAuOTQsNC42NHMtNy4xNCwzLjUxLTEwLjYsNS41MUExNTEuNiwxNTEuNiwwLDAsMCw2OC41Niw4N0M2Ny4yMyw4OC40OCw2Niw5MCw2NC42NCw5MS41NnMtMi41MSwzLjE1LTMuNzUsNC43M2wtMy41NCw0LjljLTEuMTMsMS42Ni0yLjIzLDMuMzUtMy4zMyw1YTEyNywxMjcsMCwwLDAtMTAuOTMsMjEuNDksMS41OCwxLjU4LDAsMSwxLTMtMS4xNVM0MC4xOSwxMjYuNDcsNDAuMjEsMTI2LjQzWiIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjM5MiIgaGVpZ2h0PSIzOTIiLz48L2c+PC9nPjwvc3ZnPg==` : "https://cdn.babylonjs.com/Assets/loadingIcon.png", imgSpinner.style.animation = "spin1 0.75s infinite linear", imgSpinner.style.webkitAnimation = "spin1 0.75s infinite linear", imgSpinner.style.transformOrigin = "50% 50%", imgSpinner.style.webkitTransformOrigin = "50% 50%", !svgSupport) {const logoSize = { w: 16, h: 18.5 },loadingSize = { w: 30, h: 30 };imgBack.style.width = `${logoSize.w}vh`, imgBack.style.height = `${logoSize.h}vh`, imgBack.style.left = `calc(50% - ${logoSize.w / 2}vh)`, imgBack.style.top = `calc(50% - ${logoSize.h / 2}vh)`, imgSpinner.style.width = `${loadingSize.w}vh`, imgSpinner.style.height = `${loadingSize.h}vh`, imgSpinner.style.left = `calc(50% - ${loadingSize.w / 2}vh)`, imgSpinner.style.top = `calc(50% - ${loadingSize.h / 2}vh)`;}imageSpinnerContainer.appendChild(imgSpinner), this._loadingDiv.appendChild(imgBack), this._loadingDiv.appendChild(imageSpinnerContainer), this._resizeLoadingUI(), window.addEventListener("resize", this._resizeLoadingUI), this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor, document.body.appendChild(this._loadingDiv), this._loadingDiv.style.opacity = "1";}hideLoadingUI() {if (this._loadingDiv) {const onTransitionEnd = () => {this._loadingTextDiv && (this._loadingTextDiv.remove(), this._loadingTextDiv = null), this._loadingDiv && (this._loadingDiv.remove(), this._loadingDiv = null), this._style && (this._style.remove(), this._style = null), window.removeEventListener("resize", this._resizeLoadingUI);};this._loadingDiv.style.opacity = "0", this._loadingDiv.addEventListener("transitionend", onTransitionEnd);}}set loadingUIText(text) {this._loadingText = text, this._loadingTextDiv && (this._loadingTextDiv.innerHTML = this._loadingText);}get loadingUIText() {return this._loadingText;}get loadingUIBackgroundColor() {return this._loadingDivBackgroundColor;}set loadingUIBackgroundColor(color) {this._loadingDivBackgroundColor = color;this._loadingDiv && (this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor);}}DefaultLoadingScreen.DefaultLogoUrl = "", DefaultLoadingScreen.DefaultSpinnerUrl = "", engine/* Engine.DefaultLoadingScreenFactory */.D.DefaultLoadingScreenFactory = (canvas) => new DefaultLoadingScreen(canvas);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/geometry.js
var geometry = __webpack_require__("./node_modules/@babylonjs/core/Meshes/geometry.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/multiMaterial.js
var multiMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/multiMaterial.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/HighDynamicRange/panoramaToCubemap.js
class PanoramaToCubeMapTools {static ConvertPanoramaToCubemap(float32Array, inputWidth, inputHeight, size) {if (!float32Array) throw "ConvertPanoramaToCubemap: input cannot be null";if (float32Array.length != 3 * (inputWidth * inputHeight)) throw "ConvertPanoramaToCubemap: input size is wrong";const textureFront = this.CreateCubemapTexture(size, this.FACE_FRONT, float32Array, inputWidth, inputHeight),textureBack = this.CreateCubemapTexture(size, this.FACE_BACK, float32Array, inputWidth, inputHeight),textureLeft = this.CreateCubemapTexture(size, this.FACE_LEFT, float32Array, inputWidth, inputHeight),textureRight = this.CreateCubemapTexture(size, this.FACE_RIGHT, float32Array, inputWidth, inputHeight),textureUp = this.CreateCubemapTexture(size, this.FACE_UP, float32Array, inputWidth, inputHeight),textureDown = this.CreateCubemapTexture(size, this.FACE_DOWN, float32Array, inputWidth, inputHeight);return { front: textureFront, back: textureBack, left: textureLeft, right: textureRight, up: textureUp, down: textureDown, size: size, type: 1, format: 4, gammaSpace: !1 };}static CreateCubemapTexture(texSize, faceData, float32Array, inputWidth, inputHeight) {const buffer = new ArrayBuffer(3 * (4 * (texSize * texSize))),textureArray = new Float32Array(buffer),rotDX1 = faceData[1].subtract(faceData[0]).scale(1 / texSize),rotDX2 = faceData[3].subtract(faceData[2]).scale(1 / texSize);let fy = 0;for (let y = 0; y < texSize; y++) {let xv1 = faceData[0],xv2 = faceData[2];for (let x = 0; x < texSize; x++) {const v = xv2.subtract(xv1).scale(fy).add(xv1);v.normalize();const color = this.CalcProjectionSpherical(v, float32Array, inputWidth, inputHeight);textureArray[3 * (y * texSize) + 3 * x + 0] = color.r, textureArray[3 * (y * texSize) + 3 * x + 1] = color.g, textureArray[3 * (y * texSize) + 3 * x + 2] = color.b, xv1 = xv1.add(rotDX1), xv2 = xv2.add(rotDX2);}fy += 1 / texSize;}return textureArray;}static CalcProjectionSpherical(vDir, float32Array, inputWidth, inputHeight) {let theta = Math.atan2(vDir.z, vDir.x);const phi = Math.acos(vDir.y);for (; theta < -Math.PI;) theta += 2 * Math.PI;for (; theta > Math.PI;) theta -= 2 * Math.PI;let dx = theta / Math.PI;const dy = phi / Math.PI;dx = .5 * dx + .5;let px = Math.round(dx * inputWidth);0 > px ? px = 0 : px >= inputWidth && (px = inputWidth - 1);let py = Math.round(dy * inputHeight);0 > py ? py = 0 : py >= inputHeight && (py = inputHeight - 1);const inputY = inputHeight - py - 1,r = float32Array[3 * (inputY * inputWidth) + 3 * px + 0],g = float32Array[3 * (inputY * inputWidth) + 3 * px + 1],b = float32Array[3 * (inputY * inputWidth) + 3 * px + 2];return { r: r, g: g, b: b };}}PanoramaToCubeMapTools.FACE_LEFT = [new math_vector/* Vector3 */.P(-1, -1, -1), new math_vector/* Vector3 */.P(1, -1, -1), new math_vector/* Vector3 */.P(-1, 1, -1), new math_vector/* Vector3 */.P(1, 1, -1)], PanoramaToCubeMapTools.FACE_RIGHT = [new math_vector/* Vector3 */.P(1, -1, 1), new math_vector/* Vector3 */.P(-1, -1, 1), new math_vector/* Vector3 */.P(1, 1, 1), new math_vector/* Vector3 */.P(-1, 1, 1)], PanoramaToCubeMapTools.FACE_FRONT = [new math_vector/* Vector3 */.P(1, -1, -1), new math_vector/* Vector3 */.P(1, -1, 1), new math_vector/* Vector3 */.P(1, 1, -1), new math_vector/* Vector3 */.P(1, 1, 1)], PanoramaToCubeMapTools.FACE_BACK = [new math_vector/* Vector3 */.P(-1, -1, 1), new math_vector/* Vector3 */.P(-1, -1, -1), new math_vector/* Vector3 */.P(-1, 1, 1), new math_vector/* Vector3 */.P(-1, 1, -1)], PanoramaToCubeMapTools.FACE_DOWN = [new math_vector/* Vector3 */.P(1, 1, -1), new math_vector/* Vector3 */.P(1, 1, 1), new math_vector/* Vector3 */.P(-1, 1, -1), new math_vector/* Vector3 */.P(-1, 1, 1)], PanoramaToCubeMapTools.FACE_UP = [new math_vector/* Vector3 */.P(-1, -1, -1), new math_vector/* Vector3 */.P(-1, -1, 1), new math_vector/* Vector3 */.P(1, -1, -1), new math_vector/* Vector3 */.P(1, -1, 1)];
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/HighDynamicRange/hdr.js
class HDRTools {static _Ldexp(mantissa, exponent) {return 1023 < exponent ? mantissa * Math.pow(2, 1023) * Math.pow(2, exponent - 1023) : -1074 > exponent ? mantissa * Math.pow(2, -1074) * Math.pow(2, exponent + 1074) : mantissa * Math.pow(2, exponent);}static _Rgbe2float(float32array, red, green, blue, exponent, index) {0 < exponent ? (exponent = this._Ldexp(1, exponent - 136), float32array[index + 0] = red * exponent, float32array[index + 1] = green * exponent, float32array[index + 2] = blue * exponent) : (float32array[index + 0] = 0, float32array[index + 1] = 0, float32array[index + 2] = 0);}static _ReadStringLine(uint8array, startIndex) {let line = "",character = "";for (let i = startIndex; i < uint8array.length - startIndex && (character = String.fromCharCode(uint8array[i]), "\n" != character); i++) line += character;return line;}static RGBE_ReadHeader(uint8array) {let height = 0,width = 0,line = this._ReadStringLine(uint8array, 0);if ("#" != line[0] || "?" != line[1]) throw "Bad HDR Format.";let endOfHeader = !1,findFormat = !1,lineIndex = 0;do lineIndex += line.length + 1, line = this._ReadStringLine(uint8array, lineIndex), "FORMAT=32-bit_rle_rgbe" == line ? findFormat = !0 : 0 == line.length && (endOfHeader = !0); while (!endOfHeader);if (!findFormat) throw "HDR Bad header format, unsupported FORMAT";lineIndex += line.length + 1, line = this._ReadStringLine(uint8array, lineIndex);const match = /^-Y (.*) \+X (.*)$/g.exec(line);if (!match || 3 > match.length) throw "HDR Bad header format, no size";if (width = parseInt(match[2]), height = parseInt(match[1]), 8 > width || 32767 < width) throw "HDR Bad header format, unsupported size";return lineIndex += line.length + 1, { height: height, width: width, dataPosition: lineIndex };}static GetCubeMapTextureData(buffer, size) {const uint8array = new Uint8Array(buffer),hdrInfo = this.RGBE_ReadHeader(uint8array),data = this.RGBE_ReadPixels(uint8array, hdrInfo),cubeMapData = PanoramaToCubeMapTools.ConvertPanoramaToCubemap(data, hdrInfo.width, hdrInfo.height, size);return cubeMapData;}static RGBE_ReadPixels(uint8array, hdrInfo) {return this._RGBEReadPixelsRLE(uint8array, hdrInfo);}static _RGBEReadPixelsRLE(uint8array, hdrInfo) {let num_scanlines = hdrInfo.height;const scanline_width = hdrInfo.width;let a,b,c,d,count,dataIndex = hdrInfo.dataPosition,index = 0,endIndex = 0,i = 0;const scanLineArrayBuffer = new ArrayBuffer(4 * scanline_width),scanLineArray = new Uint8Array(scanLineArrayBuffer),resultBuffer = new ArrayBuffer(3 * (4 * (hdrInfo.width * hdrInfo.height))),resultArray = new Float32Array(resultBuffer);for (; 0 < num_scanlines;) {if (a = uint8array[dataIndex++], b = uint8array[dataIndex++], c = uint8array[dataIndex++], d = uint8array[dataIndex++], 2 != a || 2 != b || 128 & c || 8 > hdrInfo.width || 32767 < hdrInfo.width) return this._RGBEReadPixelsNOTRLE(uint8array, hdrInfo);if ((c << 8 | d) != scanline_width) throw "HDR Bad header format, wrong scan line width";for (index = 0, i = 0; 4 > i; i++) for (endIndex = (i + 1) * scanline_width; index < endIndex;) if (a = uint8array[dataIndex++], b = uint8array[dataIndex++], 128 < a) {if (count = a - 128, 0 == count || count > endIndex - index) throw "HDR Bad Format, bad scanline data (run)";for (; 0 < count--;) scanLineArray[index++] = b;} else {if (count = a, 0 == count || count > endIndex - index) throw "HDR Bad Format, bad scanline data (non-run)";if (scanLineArray[index++] = b, 0 < --count) for (let j = 0; j < count; j++) scanLineArray[index++] = uint8array[dataIndex++];}for (i = 0; i < scanline_width; i++) a = scanLineArray[i], b = scanLineArray[i + scanline_width], c = scanLineArray[i + 2 * scanline_width], d = scanLineArray[i + 3 * scanline_width], this._Rgbe2float(resultArray, a, b, c, d, 3 * ((hdrInfo.height - num_scanlines) * scanline_width) + 3 * i);num_scanlines--;}return resultArray;}static _RGBEReadPixelsNOTRLE(uint8array, hdrInfo) {let num_scanlines = hdrInfo.height;const scanline_width = hdrInfo.width;let a,b,c,d,i,dataIndex = hdrInfo.dataPosition;const resultBuffer = new ArrayBuffer(3 * (4 * (hdrInfo.width * hdrInfo.height))),resultArray = new Float32Array(resultBuffer);for (; 0 < num_scanlines;) {for (i = 0; i < hdrInfo.width; i++) a = uint8array[dataIndex++], b = uint8array[dataIndex++], c = uint8array[dataIndex++], d = uint8array[dataIndex++], this._Rgbe2float(resultArray, a, b, c, d, 3 * ((hdrInfo.height - num_scanlines) * scanline_width) + 3 * i);num_scanlines--;}return resultArray;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effectRenderer.js
var effectRenderer = __webpack_require__("./node_modules/@babylonjs/core/Materials/effectRenderer.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/hdrFiltering.vertex.js
const hdrFiltering_vertex_name = "hdrFilteringVertexShader",hdrFiltering_vertex_shader = `attribute vec2 position;
varying vec3 direction;
uniform vec3 up;
uniform vec3 right;
uniform vec3 front;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
mat3 view=mat3(up,right,front);
direction=view*vec3(position,1.0);
gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.hdrFilteringVertexShader */.v.ShadersStore.hdrFilteringVertexShader = hdrFiltering_vertex_shader;const hdrFilteringVertexShader = { name: "hdrFilteringVertexShader", shader: hdrFiltering_vertex_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/importanceSampling.js
var importanceSampling = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/importanceSampling.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBRDFFunctions.js
var pbrBRDFFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBRDFFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/hdrFilteringFunctions.js
var hdrFilteringFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/hdrFilteringFunctions.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/hdrFiltering.fragment.js
const hdrFiltering_fragment_name = "hdrFilteringPixelShader",hdrFiltering_fragment_shader = `#include<helperFunctions>
#include<importanceSampling>
#include<pbrBRDFFunctions>
#include<hdrFilteringFunctions>
uniform float alphaG;
uniform samplerCube inputTexture;
uniform vec2 vFilteringInfo;
uniform float hdrScale;
varying vec3 direction;
void main() {
vec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);
gl_FragColor=vec4(color*hdrScale,1.0);
}`;shaderStore/* ShaderStore.ShadersStore.hdrFilteringPixelShader */.v.ShadersStore.hdrFilteringPixelShader = hdrFiltering_fragment_shader;const hdrFilteringPixelShader = { name: "hdrFilteringPixelShader", shader: hdrFiltering_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Filtering/hdrFiltering.js
class HDRFiltering {constructor(engine, options = {}) {this._lodGenerationOffset = 0, this._lodGenerationScale = .8, this.quality = 4096, this.hdrScale = 1, this._engine = engine, this.hdrScale = options.hdrScale || this.hdrScale, this.quality = options.quality || this.quality;}_createRenderTarget(size) {let textureType = 0;this._engine.getCaps().textureHalfFloatRender ? textureType = 2 : this._engine.getCaps().textureFloatRender && (textureType = 1);const rtWrapper = this._engine.createRenderTargetCubeTexture(size, { format: 5, type: textureType, createMipMaps: !0, generateMipMaps: !1, generateDepthBuffer: !1, generateStencilBuffer: !1, samplingMode: 1 });return this._engine.updateTextureWrappingMode(rtWrapper.texture, 0, 0, 0), this._engine.updateTextureSamplingMode(3, rtWrapper.texture, !0), rtWrapper;}_prefilterInternal(texture) {const width = texture.getSize().width,mipmapsCount = math_scalar/* Scalar.ILog2 */.R.ILog2(width) + 1,effect = this._effectWrapper.effect,outputTexture = this._createRenderTarget(width);this._effectRenderer.setViewport();const intTexture = texture.getInternalTexture();intTexture && this._engine.updateTextureSamplingMode(3, intTexture, !0), this._effectRenderer.applyEffectWrapper(this._effectWrapper);const directions = [[new math/* Vector3 */.P(0, 0, -1), new math/* Vector3 */.P(0, -1, 0), new math/* Vector3 */.P(1, 0, 0)], [new math/* Vector3 */.P(0, 0, 1), new math/* Vector3 */.P(0, -1, 0), new math/* Vector3 */.P(-1, 0, 0)], [new math/* Vector3 */.P(1, 0, 0), new math/* Vector3 */.P(0, 0, 1), new math/* Vector3 */.P(0, 1, 0)], [new math/* Vector3 */.P(1, 0, 0), new math/* Vector3 */.P(0, 0, -1), new math/* Vector3 */.P(0, -1, 0)], [new math/* Vector3 */.P(1, 0, 0), new math/* Vector3 */.P(0, -1, 0), new math/* Vector3 */.P(0, 0, 1)], [new math/* Vector3 */.P(-1, 0, 0), new math/* Vector3 */.P(0, -1, 0), new math/* Vector3 */.P(0, 0, -1)]];effect.setFloat("hdrScale", this.hdrScale), effect.setFloat2("vFilteringInfo", texture.getSize().width, mipmapsCount), effect.setTexture("inputTexture", texture);for (let face = 0; 6 > face; face++) {effect.setVector3("up", directions[face][0]), effect.setVector3("right", directions[face][1]), effect.setVector3("front", directions[face][2]);for (let lod = 0; lod < mipmapsCount; lod++) {this._engine.bindFramebuffer(outputTexture, face, void 0, void 0, !0, lod), this._effectRenderer.applyEffectWrapper(this._effectWrapper);let alpha = Math.pow(2, (lod - this._lodGenerationOffset) / this._lodGenerationScale) / width;0 == lod && (alpha = 0), effect.setFloat("alphaG", alpha), this._effectRenderer.draw();}}return this._effectRenderer.restoreStates(), this._engine.restoreDefaultFramebuffer(), this._engine._releaseTexture(texture._texture), outputTexture._swapAndDie(texture._texture), texture._prefiltered = !0, texture;}_createEffect(texture, onCompiled) {const defines = [];texture.gammaSpace && defines.push("#define GAMMA_INPUT"), defines.push("#define NUM_SAMPLES " + this.quality + "u");const effectWrapper = new effectRenderer/* EffectWrapper */.H({ engine: this._engine, name: "hdrFiltering", vertexShader: "hdrFiltering", fragmentShader: "hdrFiltering", samplerNames: ["inputTexture"], uniformNames: ["vSampleDirections", "vWeights", "up", "right", "front", "vFilteringInfo", "hdrScale", "alphaG"], useShaderStore: !0, defines, onCompiled: onCompiled });return effectWrapper;}isReady(texture) {return texture.isReady() && this._effectWrapper.effect.isReady();}prefilter(texture, onFinished = null) {return this._engine._features.allowTexturePrefiltering ? new Promise((resolve) => {this._effectRenderer = new effectRenderer/* EffectRenderer */.I(this._engine), this._effectWrapper = this._createEffect(texture), this._effectWrapper.effect.executeWhenCompiled(() => {this._prefilterInternal(texture), this._effectRenderer.dispose(), this._effectWrapper.dispose(), resolve(), onFinished && onFinished();});}) : (logger/* Logger.Warn */.Y.Warn("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead."), Promise.reject("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead."));}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.js
var baseTexture_polynomial = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/hdrCubeTexture.js
class HDRCubeTexture extends baseTexture/* BaseTexture */.V {set isBlocking(value) {this._isBlocking = value;}get isBlocking() {return this._isBlocking;}set rotationY(value) {this._rotationY = value, this.setReflectionTextureMatrix(math_vector/* Matrix.RotationY */.y3.RotationY(this._rotationY));}get rotationY() {return this._rotationY;}set boundingBoxSize(value) {if (!(this._boundingBoxSize && this._boundingBoxSize.equals(value))) {this._boundingBoxSize = value;const scene = this.getScene();scene && scene.markAllMaterialsAsDirty(1);}}get boundingBoxSize() {return this._boundingBoxSize;}constructor(url, sceneOrEngine, size, noMipmap = !1, generateHarmonics = !0, gammaSpace = !1, prefilterOnLoad = !1, onLoad = null, onError = null) {var _a;super(sceneOrEngine), this._generateHarmonics = !0, this._onError = null, this._isBlocking = !0, this._rotationY = 0, this.boundingBoxPosition = math_vector/* Vector3.Zero */.P.Zero(), this.onLoadObservable = new observable/* Observable */.y$();url && (this._coordinatesMode = Textures_texture/* Texture.CUBIC_MODE */.x.CUBIC_MODE, this.name = url, this.url = url, this.hasAlpha = !1, this.isCube = !0, this._textureMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this._prefilterOnLoad = prefilterOnLoad, this._onLoad = () => {this.onLoadObservable.notifyObservers(this), onLoad && onLoad();}, this._onError = onError, this.gammaSpace = gammaSpace, this._noMipmap = noMipmap, this._size = size, this._generateHarmonics = generateHarmonics, this._texture = this._getFromCache(url, this._noMipmap, void 0, void 0, void 0, this.isCube), this._texture ? this._texture.isReady ? tools/* Tools.SetImmediate */.w1.SetImmediate(() => this._onLoad()) : this._texture.onLoadedObservable.add(this._onLoad) : (null === (_a = this.getScene()) || void 0 === _a ? void 0 : _a.useDelayedTextureLoading) ? this.delayLoadState = 4 : this._loadTexture());}getClassName() {return "HDRCubeTexture";}_loadTexture() {const engine = this._getEngine(),caps = engine.getCaps();let textureType = 0;caps.textureFloat && caps.textureFloatLinearFiltering ? textureType = 1 : caps.textureHalfFloat && caps.textureHalfFloatLinearFiltering && (textureType = 2);const callback = (buffer) => {this.lodGenerationOffset = 0, this.lodGenerationScale = .8;const data = HDRTools.GetCubeMapTextureData(buffer, this._size);if (this._generateHarmonics) {const sphericalPolynomial = cubemapToSphericalPolynomial/* CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial */.$.ConvertCubeMapToSphericalPolynomial(data);this.sphericalPolynomial = sphericalPolynomial;}const results = [];let byteArray = null,shortArray = null;for (let j = 0; 6 > j; j++) {2 === textureType ? shortArray = new Uint16Array(3 * (this._size * this._size)) : 0 == textureType && (byteArray = new Uint8Array(3 * (this._size * this._size)));const dataFace = data[HDRCubeTexture._FacesMapping[j]];if (this.gammaSpace || shortArray || byteArray) for (let i = 0; i < this._size * this._size; i++) if (this.gammaSpace && (dataFace[3 * i + 0] = Math.pow(dataFace[3 * i + 0], math_constants/* ToGammaSpace */.zp), dataFace[3 * i + 1] = Math.pow(dataFace[3 * i + 1], math_constants/* ToGammaSpace */.zp), dataFace[3 * i + 2] = Math.pow(dataFace[3 * i + 2], math_constants/* ToGammaSpace */.zp)), shortArray && (shortArray[3 * i + 0] = (0,textureTools/* ToHalfFloat */.ay)(dataFace[3 * i + 0]), shortArray[3 * i + 1] = (0,textureTools/* ToHalfFloat */.ay)(dataFace[3 * i + 1]), shortArray[3 * i + 2] = (0,textureTools/* ToHalfFloat */.ay)(dataFace[3 * i + 2])), byteArray) {let r = Math.max(255 * dataFace[3 * i + 0], 0),g = Math.max(255 * dataFace[3 * i + 1], 0),b = Math.max(255 * dataFace[3 * i + 2], 0);const max = Math.max(Math.max(r, g), b);if (255 < max) {const scale = 255 / max;r *= scale, g *= scale, b *= scale;}byteArray[3 * i + 0] = r, byteArray[3 * i + 1] = g, byteArray[3 * i + 2] = b;}shortArray ? results.push(shortArray) : byteArray ? results.push(byteArray) : results.push(dataFace);}return results;};if (engine._features.allowTexturePrefiltering && this._prefilterOnLoad) {const previousOnLoad = this._onLoad,hdrFiltering = new HDRFiltering(engine);this._onLoad = () => {hdrFiltering.prefilter(this, previousOnLoad);};}this._texture = engine.createRawCubeTextureFromUrl(this.url, this.getScene(), this._size, 4, textureType, this._noMipmap, callback, null, this._onLoad, this._onError);}clone() {const newTexture = new HDRCubeTexture(this.url, this.getScene() || this._getEngine(), this._size, this._noMipmap, this._generateHarmonics, this.gammaSpace);return newTexture.level = this.level, newTexture.wrapU = this.wrapU, newTexture.wrapV = this.wrapV, newTexture.coordinatesIndex = this.coordinatesIndex, newTexture.coordinatesMode = this.coordinatesMode, newTexture;}delayLoad() {4 !== this.delayLoadState || (this.delayLoadState = 1, this._texture = this._getFromCache(this.url, this._noMipmap), !this._texture && this._loadTexture());}getReflectionTextureMatrix() {return this._textureMatrix;}setReflectionTextureMatrix(value) {var _a;this._textureMatrix = value;value.updateFlag === this._textureMatrix.updateFlag || value.isIdentity() !== this._textureMatrix.isIdentity() && (null === (_a = this.getScene()) || void 0 === _a ? void 0 : _a.markAllMaterialsAsDirty(1, (mat) => -1 !== mat.getActiveTextures().indexOf(this)));}dispose() {this.onLoadObservable.clear(), super.dispose();}static Parse(parsedTexture, scene, rootUrl) {let texture = null;return parsedTexture.name && !parsedTexture.isRenderTarget && (texture = new HDRCubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.size, parsedTexture.noMipmap, parsedTexture.generateHarmonics, parsedTexture.useInGammaSpace), texture.name = parsedTexture.name, texture.hasAlpha = parsedTexture.hasAlpha, texture.level = parsedTexture.level, texture.coordinatesMode = parsedTexture.coordinatesMode, texture.isBlocking = parsedTexture.isBlocking), texture && (parsedTexture.boundingBoxPosition && (texture.boundingBoxPosition = math_vector/* Vector3.FromArray */.P.FromArray(parsedTexture.boundingBoxPosition)), parsedTexture.boundingBoxSize && (texture.boundingBoxSize = math_vector/* Vector3.FromArray */.P.FromArray(parsedTexture.boundingBoxSize)), parsedTexture.rotationY && (texture.rotationY = parsedTexture.rotationY)), texture;}serialize() {if (!this.name) return null;const serializationObject = { name: this.name, hasAlpha: this.hasAlpha, isCube: !0, level: this.level, size: this._size, coordinatesMode: this.coordinatesMode, useInGammaSpace: this.gammaSpace, generateHarmonics: this._generateHarmonics, customType: "BABYLON.HDRCubeTexture", noMipmap: this._noMipmap, isBlocking: this._isBlocking, rotationY: this._rotationY };return serializationObject;}}HDRCubeTexture._FacesMapping = ["right", "left", "up", "down", "front", "back"], (0,typeStore/* RegisterClass */.H)("BABYLON.HDRCubeTexture", HDRCubeTexture);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Morph/morphTargetManager.js
var morphTargetManager = __webpack_require__("./node_modules/@babylonjs/core/Morph/morphTargetManager.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/physicsRaycastResult.js
class PhysicsRaycastResult {constructor() {this._hasHit = !1, this._hitDistance = 0, this._hitNormalWorld = math_vector/* Vector3.Zero */.P.Zero(), this._hitPointWorld = math_vector/* Vector3.Zero */.P.Zero(), this._rayFromWorld = math_vector/* Vector3.Zero */.P.Zero(), this._rayToWorld = math_vector/* Vector3.Zero */.P.Zero();}get hasHit() {return this._hasHit;}get hitDistance() {return this._hitDistance;}get hitNormalWorld() {return this._hitNormalWorld;}get hitPointWorld() {return this._hitPointWorld;}get rayFromWorld() {return this._rayFromWorld;}get rayToWorld() {return this._rayToWorld;}setHitData(hitNormalWorld, hitPointWorld) {this._hasHit = !0, this._hitNormalWorld = new math_vector/* Vector3 */.P(hitNormalWorld.x, hitNormalWorld.y, hitNormalWorld.z), this._hitPointWorld = new math_vector/* Vector3 */.P(hitPointWorld.x, hitPointWorld.y, hitPointWorld.z);}setHitDistance(distance) {this._hitDistance = distance;}calculateHitDistance() {this._hitDistance = math_vector/* Vector3.Distance */.P.Distance(this._rayFromWorld, this._hitPointWorld);}reset(from = math_vector/* Vector3.Zero */.P.Zero(), to = math_vector/* Vector3.Zero */.P.Zero()) {this._rayFromWorld = from, this._rayToWorld = to, this._hasHit = !1, this._hitDistance = 0, this._hitNormalWorld = math_vector/* Vector3.Zero */.P.Zero(), this._hitPointWorld = math_vector/* Vector3.Zero */.P.Zero();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/physicsEngine.js
class PhysicsEngine {getPluginVersion() {return this._physicsPlugin.getPluginVersion();}static DefaultPluginFactory() {throw (0,devTools/* _WarnImport */.S)("CannonJSPlugin");}constructor(gravity, _physicsPlugin = PhysicsEngine.DefaultPluginFactory()) {if (this._physicsPlugin = _physicsPlugin, this._impostors = [], this._joints = [], this._subTimeStep = 0, this._uniqueIdCounter = 0, !this._physicsPlugin.isSupported()) throw new Error("Physics Engine " + this._physicsPlugin.name + " cannot be found. Please make sure it is included.");gravity = gravity || new math_vector/* Vector3 */.P(0, -9.807, 0), this.setGravity(gravity), this.setTimeStep();}setGravity(gravity) {this.gravity = gravity, this._physicsPlugin.setGravity(this.gravity);}setTimeStep(newTimeStep = 1 / 60) {this._physicsPlugin.setTimeStep(newTimeStep);}getTimeStep() {return this._physicsPlugin.getTimeStep();}setSubTimeStep(subTimeStep = 0) {this._subTimeStep = subTimeStep;}getSubTimeStep() {return this._subTimeStep;}dispose() {this._impostors.forEach(function (impostor) {impostor.dispose();}), this._physicsPlugin.dispose();}getPhysicsPluginName() {return this._physicsPlugin.name;}addImpostor(impostor) {this._impostors.push(impostor), impostor.uniqueId = this._uniqueIdCounter++, impostor.parent || this._physicsPlugin.generatePhysicsBody(impostor);}removeImpostor(impostor) {const index = this._impostors.indexOf(impostor);if (-1 < index) {const removed = this._impostors.splice(index, 1);removed.length && this.getPhysicsPlugin().removePhysicsBody(impostor);}}addJoint(mainImpostor, connectedImpostor, joint) {const impostorJoint = { mainImpostor: mainImpostor, connectedImpostor: connectedImpostor, joint: joint };joint.physicsPlugin = this._physicsPlugin, this._joints.push(impostorJoint), this._physicsPlugin.generateJoint(impostorJoint);}removeJoint(mainImpostor, connectedImpostor, joint) {const matchingJoints = this._joints.filter(function (impostorJoint) {return impostorJoint.connectedImpostor === connectedImpostor && impostorJoint.joint === joint && impostorJoint.mainImpostor === mainImpostor;});matchingJoints.length && this._physicsPlugin.removeJoint(matchingJoints[0]);}_step(delta) {this._impostors.forEach((impostor) => {impostor.isBodyInitRequired() && this._physicsPlugin.generatePhysicsBody(impostor);}), .1 < delta ? delta = .1 : 0 >= delta && (delta = 1 / 60), this._physicsPlugin.executeStep(delta, this._impostors);}getPhysicsPlugin() {return this._physicsPlugin;}getImpostors() {return this._impostors;}getImpostorForPhysicsObject(object) {for (let i = 0; i < this._impostors.length; ++i) if (this._impostors[i].object === object) return this._impostors[i];return null;}getImpostorWithPhysicsBody(body) {for (let i = 0; i < this._impostors.length; ++i) if (this._impostors[i].physicsBody === body) return this._impostors[i];return null;}raycast(from, to) {return this._physicsPlugin.raycast(from, to);}raycastToRef(from, to, result) {return this._physicsPlugin.raycastToRef(from, to, result);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/Plugins/cannonJSPlugin.js
class CannonJSPlugin {constructor(_useDeltaForWorldStep = !0, iterations = 10, cannonInjection = CANNON) {return this._useDeltaForWorldStep = _useDeltaForWorldStep, this.name = "CannonJSPlugin", this._physicsMaterials = [], this._fixedTimeStep = 1 / 60, this._physicsBodiesToRemoveAfterStep = [], this._firstFrame = !0, this._tmpQuaternion = new math_vector/* Quaternion */._f(), this._minus90X = new math_vector/* Quaternion */._f(-.7071067811865475, 0, 0, .7071067811865475), this._plus90X = new math_vector/* Quaternion */._f(.7071067811865475, 0, 0, .7071067811865475), this._tmpPosition = math_vector/* Vector3.Zero */.P.Zero(), this._tmpDeltaPosition = math_vector/* Vector3.Zero */.P.Zero(), this._tmpUnityRotation = new math_vector/* Quaternion */._f(), this.BJSCANNON = cannonInjection, this.isSupported() ? void (this._extendNamespace(), this.world = new this.BJSCANNON.World(), this.world.broadphase = new this.BJSCANNON.NaiveBroadphase(), this.world.solver.iterations = iterations, this._cannonRaycastResult = new this.BJSCANNON.RaycastResult(), this._raycastResult = new PhysicsRaycastResult()) : void logger/* Logger.Error */.Y.Error("CannonJS is not available. Please make sure you included the js file.");}getPluginVersion() {return 1;}setGravity(gravity) {const vec = gravity;this.world.gravity.set(vec.x, vec.y, vec.z);}setTimeStep(timeStep) {this._fixedTimeStep = timeStep;}getTimeStep() {return this._fixedTimeStep;}executeStep(delta, impostors) {if (this._firstFrame) {this._firstFrame = !1;for (const impostor of impostors) impostor.type != PhysicsImpostor.HeightmapImpostor && impostor.type !== PhysicsImpostor.PlaneImpostor && impostor.beforeStep();}this.world.step(this._useDeltaForWorldStep ? delta : this._fixedTimeStep), this._removeMarkedPhysicsBodiesFromWorld();}_removeMarkedPhysicsBodiesFromWorld() {0 < this._physicsBodiesToRemoveAfterStep.length && (this._physicsBodiesToRemoveAfterStep.forEach((physicsBody) => {"function" == typeof this.world.removeBody ? this.world.removeBody(physicsBody) : this.world.remove(physicsBody);}), this._physicsBodiesToRemoveAfterStep.length = 0);}applyImpulse(impostor, force, contactPoint) {const worldPoint = new this.BJSCANNON.Vec3(contactPoint.x, contactPoint.y, contactPoint.z),impulse = new this.BJSCANNON.Vec3(force.x, force.y, force.z);impostor.physicsBody.applyImpulse(impulse, worldPoint);}applyForce(impostor, force, contactPoint) {const worldPoint = new this.BJSCANNON.Vec3(contactPoint.x, contactPoint.y, contactPoint.z),impulse = new this.BJSCANNON.Vec3(force.x, force.y, force.z);impostor.physicsBody.applyForce(impulse, worldPoint);}generatePhysicsBody(impostor) {if (this._removeMarkedPhysicsBodiesFromWorld(), impostor.parent) return void (impostor.physicsBody && (this.removePhysicsBody(impostor), impostor.forceUpdate()));if (impostor.isBodyInitRequired()) {const shape = this._createShape(impostor);if (!shape) return void logger/* Logger.Warn */.Y.Warn("It was not possible to create a physics body for this object.");const oldBody = impostor.physicsBody;oldBody && this.removePhysicsBody(impostor);const material = this._addMaterial("mat-" + impostor.uniqueId, impostor.getParam("friction"), impostor.getParam("restitution")),bodyCreationObject = { mass: impostor.getParam("mass"), material: material },nativeOptions = impostor.getParam("nativeOptions");for (const key in nativeOptions) Object.prototype.hasOwnProperty.call(nativeOptions, key) && (bodyCreationObject[key] = nativeOptions[key]);impostor.physicsBody = new this.BJSCANNON.Body(bodyCreationObject), impostor.physicsBody.addEventListener("collide", impostor.onCollide), this.world.addEventListener("preStep", impostor.beforeStep), this.world.addEventListener("postStep", impostor.afterStep), impostor.physicsBody.addShape(shape), "function" == typeof this.world.addBody ? this.world.addBody(impostor.physicsBody) : this.world.add(impostor.physicsBody), oldBody && ["force", "torque", "velocity", "angularVelocity"].forEach(function (param) {const vec = oldBody[param];impostor.physicsBody[param].set(vec.x, vec.y, vec.z);}), this._processChildMeshes(impostor);}this._updatePhysicsBodyTransformation(impostor);}_processChildMeshes(mainImpostor) {const meshChildren = mainImpostor.object.getChildMeshes ? mainImpostor.object.getChildMeshes(!0) : [],mainRotation = mainImpostor.object.rotationQuaternion;if (mainRotation ? mainRotation.conjugateToRef(this._tmpQuaternion) : this._tmpQuaternion.set(0, 0, 0, 1), meshChildren.length) {const processMesh = (mesh) => {if (mesh.rotationQuaternion) {const childImpostor = mesh.getPhysicsImpostor();if (childImpostor) {const parent = childImpostor.parent;if (parent !== mainImpostor && mesh.parent) {const pPosition = mesh.getAbsolutePosition().subtract(mesh.parent.getAbsolutePosition()),q = mesh.rotationQuaternion.multiply(this._tmpQuaternion);childImpostor.physicsBody && (this.removePhysicsBody(childImpostor), childImpostor.physicsBody = null), childImpostor.parent = mainImpostor, childImpostor.resetUpdateFlags(), mainImpostor.physicsBody.addShape(this._createShape(childImpostor), new this.BJSCANNON.Vec3(pPosition.x, pPosition.y, pPosition.z), new this.BJSCANNON.Quaternion(q.x, q.y, q.z, q.w)), mainImpostor.physicsBody.mass += childImpostor.getParam("mass");}}mesh.getChildMeshes(!0).filter((m) => !!m.physicsImpostor).forEach(processMesh);}};meshChildren.filter((m) => !!m.physicsImpostor).forEach(processMesh);}}removePhysicsBody(impostor) {impostor.physicsBody.removeEventListener("collide", impostor.onCollide), this.world.removeEventListener("preStep", impostor.beforeStep), this.world.removeEventListener("postStep", impostor.afterStep), -1 === this._physicsBodiesToRemoveAfterStep.indexOf(impostor.physicsBody) && this._physicsBodiesToRemoveAfterStep.push(impostor.physicsBody);}generateJoint(impostorJoint) {const mainBody = impostorJoint.mainImpostor.physicsBody,connectedBody = impostorJoint.connectedImpostor.physicsBody;if (!mainBody || !connectedBody) return;let constraint;const jointData = impostorJoint.joint.jointData,constraintData = { pivotA: jointData.mainPivot ? new this.BJSCANNON.Vec3().set(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z) : null, pivotB: jointData.connectedPivot ? new this.BJSCANNON.Vec3().set(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z) : null, axisA: jointData.mainAxis ? new this.BJSCANNON.Vec3().set(jointData.mainAxis.x, jointData.mainAxis.y, jointData.mainAxis.z) : null, axisB: jointData.connectedAxis ? new this.BJSCANNON.Vec3().set(jointData.connectedAxis.x, jointData.connectedAxis.y, jointData.connectedAxis.z) : null, maxForce: jointData.nativeParams.maxForce, collideConnected: !!jointData.collision };switch (impostorJoint.joint.type) {case PhysicsJoint.HingeJoint:case PhysicsJoint.Hinge2Joint:constraint = new this.BJSCANNON.HingeConstraint(mainBody, connectedBody, constraintData);break;case PhysicsJoint.DistanceJoint:constraint = new this.BJSCANNON.DistanceConstraint(mainBody, connectedBody, jointData.maxDistance || 2);break;case PhysicsJoint.SpringJoint:{const springData = jointData;constraint = new this.BJSCANNON.Spring(mainBody, connectedBody, { restLength: springData.length, stiffness: springData.stiffness, damping: springData.damping, localAnchorA: constraintData.pivotA, localAnchorB: constraintData.pivotB });break;}case PhysicsJoint.LockJoint:constraint = new this.BJSCANNON.LockConstraint(mainBody, connectedBody, constraintData);break;case PhysicsJoint.PointToPointJoint:case PhysicsJoint.BallAndSocketJoint:default:constraint = new this.BJSCANNON.PointToPointConstraint(mainBody, constraintData.pivotA, connectedBody, constraintData.pivotB, constraintData.maxForce);}constraint.collideConnected = !!jointData.collision, impostorJoint.joint.physicsJoint = constraint, impostorJoint.joint.type === PhysicsJoint.SpringJoint ? (impostorJoint.joint.jointData.forceApplicationCallback = impostorJoint.joint.jointData.forceApplicationCallback || function () {constraint.applyForce();}, impostorJoint.mainImpostor.registerAfterPhysicsStep(impostorJoint.joint.jointData.forceApplicationCallback)) : this.world.addConstraint(constraint);}removeJoint(impostorJoint) {impostorJoint.joint.type === PhysicsJoint.SpringJoint ? impostorJoint.mainImpostor.unregisterAfterPhysicsStep(impostorJoint.joint.jointData.forceApplicationCallback) : this.world.removeConstraint(impostorJoint.joint.physicsJoint);}_addMaterial(name, friction, restitution) {let index, mat;for (index = 0; index < this._physicsMaterials.length; index++) if (mat = this._physicsMaterials[index], mat.friction === friction && mat.restitution === restitution) return mat;const currentMat = new this.BJSCANNON.Material(name);return currentMat.friction = friction, currentMat.restitution = restitution, this._physicsMaterials.push(currentMat), currentMat;}_checkWithEpsilon(value) {return value < math_constants/* Epsilon */.kn ? math_constants/* Epsilon */.kn : value;}_createShape(impostor) {const object = impostor.object;let returnValue;const impostorExtents = impostor.getObjectExtents();switch (impostor.type) {case PhysicsImpostor.SphereImpostor:{const radiusX = impostorExtents.x,radiusY = impostorExtents.y,radiusZ = impostorExtents.z;returnValue = new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(radiusX), this._checkWithEpsilon(radiusY), this._checkWithEpsilon(radiusZ)) / 2);break;}case PhysicsImpostor.CylinderImpostor:{let nativeParams = impostor.getParam("nativeOptions");nativeParams || (nativeParams = {});const radiusTop = nativeParams.radiusTop === void 0 ? this._checkWithEpsilon(impostorExtents.x) / 2 : nativeParams.radiusTop,radiusBottom = nativeParams.radiusBottom === void 0 ? this._checkWithEpsilon(impostorExtents.x) / 2 : nativeParams.radiusBottom,height = nativeParams.height === void 0 ? this._checkWithEpsilon(impostorExtents.y) : nativeParams.height,numSegments = nativeParams.numSegments === void 0 ? 16 : nativeParams.numSegments;returnValue = new this.BJSCANNON.Cylinder(radiusTop, radiusBottom, height, numSegments);const quat = new this.BJSCANNON.Quaternion();quat.setFromAxisAngle(new this.BJSCANNON.Vec3(1, 0, 0), -Math.PI / 2);const translation = new this.BJSCANNON.Vec3(0, 0, 0);returnValue.transformAllPoints(translation, quat);break;}case PhysicsImpostor.BoxImpostor:{const box = impostorExtents.scale(.5);returnValue = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(this._checkWithEpsilon(box.x), this._checkWithEpsilon(box.y), this._checkWithEpsilon(box.z)));break;}case PhysicsImpostor.PlaneImpostor:logger/* Logger.Warn */.Y.Warn("Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead"), returnValue = new this.BJSCANNON.Plane();break;case PhysicsImpostor.MeshImpostor:{const rawVerts = object.getVerticesData ? object.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind) : [],rawFaces = object.getIndices ? object.getIndices() : [];if (!rawVerts) return void logger/* Logger.Warn */.Y.Warn("Tried to create a MeshImpostor for an object without vertices. This will fail.");const oldPosition = object.position.clone(),oldRotation = object.rotation && object.rotation.clone(),oldQuaternion = object.rotationQuaternion && object.rotationQuaternion.clone();object.position.copyFromFloats(0, 0, 0), object.rotation && object.rotation.copyFromFloats(0, 0, 0), object.rotationQuaternion && object.rotationQuaternion.copyFrom(impostor.getParentsRotation()), object.rotationQuaternion && object.parent && object.rotationQuaternion.conjugateInPlace();const transform = object.computeWorldMatrix(!0),transformedVertices = [];let index;for (index = 0; index < rawVerts.length; index += 3) math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(math_vector/* Vector3.FromArray */.P.FromArray(rawVerts, index), transform).toArray(transformedVertices, index);logger/* Logger.Warn */.Y.Warn("MeshImpostor only collides against spheres."), returnValue = new this.BJSCANNON.Trimesh(transformedVertices, rawFaces), object.position.copyFrom(oldPosition), oldRotation && object.rotation && object.rotation.copyFrom(oldRotation), oldQuaternion && object.rotationQuaternion && object.rotationQuaternion.copyFrom(oldQuaternion);break;}case PhysicsImpostor.HeightmapImpostor:{const oldPosition2 = object.position.clone(),oldRotation2 = object.rotation && object.rotation.clone(),oldQuaternion2 = object.rotationQuaternion && object.rotationQuaternion.clone();object.position.copyFromFloats(0, 0, 0), object.rotation && object.rotation.copyFromFloats(0, 0, 0), object.rotationQuaternion && object.rotationQuaternion.copyFrom(impostor.getParentsRotation()), object.rotationQuaternion && object.parent && object.rotationQuaternion.conjugateInPlace(), object.rotationQuaternion && object.rotationQuaternion.multiplyInPlace(this._minus90X), returnValue = this._createHeightmap(object), object.position.copyFrom(oldPosition2), oldRotation2 && object.rotation && object.rotation.copyFrom(oldRotation2), oldQuaternion2 && object.rotationQuaternion && object.rotationQuaternion.copyFrom(oldQuaternion2), object.computeWorldMatrix(!0);break;}case PhysicsImpostor.ParticleImpostor:returnValue = new this.BJSCANNON.Particle();break;case PhysicsImpostor.NoImpostor:returnValue = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0, 0, 0));}return returnValue;}_createHeightmap(object, pointDepth) {let pos = object.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);const transform = object.computeWorldMatrix(!0),transformedVertices = [];let index;for (index = 0; index < pos.length; index += 3) math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(math_vector/* Vector3.FromArray */.P.FromArray(pos, index), transform).toArray(transformedVertices, index);pos = transformedVertices;const matrix = [],arraySize = pointDepth || ~~(Math.sqrt(pos.length / 3) - 1),boundingInfo = object.getBoundingInfo(),dim = Math.min(boundingInfo.boundingBox.extendSizeWorld.x, boundingInfo.boundingBox.extendSizeWorld.y),minY = boundingInfo.boundingBox.extendSizeWorld.z,elementSize = 2 * dim / arraySize;for (let i = 0; i < pos.length; i += 3) {const x = Math.round(pos[i + 0] / elementSize + arraySize / 2),z = Math.round(-1 * (pos[i + 1] / elementSize - arraySize / 2)),y = -pos[i + 2] + minY;matrix[x] || (matrix[x] = []), matrix[x][z] || (matrix[x][z] = y), matrix[x][z] = Math.max(y, matrix[x][z]);}for (let x = 0; x <= arraySize; ++x) {if (!matrix[x]) {let loc = 1;for (; !matrix[(x + loc) % arraySize];) loc++;matrix[x] = matrix[(x + loc) % arraySize].slice();}for (let z = 0; z <= arraySize; ++z) if (!matrix[x][z]) {let newValue,loc = 1;for (; void 0 === newValue;) newValue = matrix[x][(z + loc++) % arraySize];matrix[x][z] = newValue;}}const shape = new this.BJSCANNON.Heightfield(matrix, { elementSize: elementSize });return shape.minY = minY, shape;}_updatePhysicsBodyTransformation(impostor) {const object = impostor.object;if (object.computeWorldMatrix && object.computeWorldMatrix(!0), !object.getBoundingInfo()) return;const center = impostor.getObjectCenter();this._tmpDeltaPosition.copyFrom(object.getAbsolutePivotPoint().subtract(center)), this._tmpDeltaPosition.divideInPlace(impostor.object.scaling), this._tmpPosition.copyFrom(center);let quaternion = object.rotationQuaternion;if (quaternion) {if ((impostor.type === PhysicsImpostor.PlaneImpostor || impostor.type === PhysicsImpostor.HeightmapImpostor) && (quaternion = quaternion.multiply(this._minus90X), impostor.setDeltaRotation(this._plus90X)), impostor.type === PhysicsImpostor.HeightmapImpostor) {const mesh = object;let boundingInfo = mesh.getBoundingInfo();const rotationQuaternion = mesh.rotationQuaternion;mesh.rotationQuaternion = this._tmpUnityRotation, mesh.computeWorldMatrix(!0);const c = center.clone();let oldPivot = mesh.getPivotMatrix();oldPivot = oldPivot ? oldPivot.clone() : math_vector/* Matrix.Identity */.y3.Identity();const p = math_vector/* Matrix.Translation */.y3.Translation(boundingInfo.boundingBox.extendSizeWorld.x, 0, -boundingInfo.boundingBox.extendSizeWorld.z);mesh.setPreTransformMatrix(p), mesh.computeWorldMatrix(!0), boundingInfo = mesh.getBoundingInfo();const translation = boundingInfo.boundingBox.centerWorld.subtract(center).subtract(mesh.position).negate();this._tmpPosition.copyFromFloats(translation.x, translation.y - boundingInfo.boundingBox.extendSizeWorld.y, translation.z), this._tmpDeltaPosition.copyFrom(boundingInfo.boundingBox.centerWorld.subtract(c)), this._tmpDeltaPosition.y += boundingInfo.boundingBox.extendSizeWorld.y, mesh.rotationQuaternion = rotationQuaternion, mesh.setPreTransformMatrix(oldPivot), mesh.computeWorldMatrix(!0);} else impostor.type === PhysicsImpostor.MeshImpostor && this._tmpDeltaPosition.copyFromFloats(0, 0, 0);impostor.setDeltaPosition(this._tmpDeltaPosition), impostor.physicsBody.position.set(this._tmpPosition.x, this._tmpPosition.y, this._tmpPosition.z), impostor.physicsBody.quaternion.set(quaternion.x, quaternion.y, quaternion.z, quaternion.w);}}setTransformationFromPhysicsBody(impostor) {if (impostor.object.position.set(impostor.physicsBody.position.x, impostor.physicsBody.position.y, impostor.physicsBody.position.z), impostor.object.rotationQuaternion) {const q = impostor.physicsBody.quaternion;impostor.object.rotationQuaternion.set(q.x, q.y, q.z, q.w);}}setPhysicsBodyTransformation(impostor, newPosition, newRotation) {impostor.physicsBody.position.set(newPosition.x, newPosition.y, newPosition.z), impostor.physicsBody.quaternion.set(newRotation.x, newRotation.y, newRotation.z, newRotation.w);}isSupported() {return this.BJSCANNON !== void 0;}setLinearVelocity(impostor, velocity) {impostor.physicsBody.velocity.set(velocity.x, velocity.y, velocity.z);}setAngularVelocity(impostor, velocity) {impostor.physicsBody.angularVelocity.set(velocity.x, velocity.y, velocity.z);}getLinearVelocity(impostor) {const v = impostor.physicsBody.velocity;return v ? new math_vector/* Vector3 */.P(v.x, v.y, v.z) : null;}getAngularVelocity(impostor) {const v = impostor.physicsBody.angularVelocity;return v ? new math_vector/* Vector3 */.P(v.x, v.y, v.z) : null;}setBodyMass(impostor, mass) {impostor.physicsBody.mass = mass, impostor.physicsBody.updateMassProperties();}getBodyMass(impostor) {return impostor.physicsBody.mass;}getBodyFriction(impostor) {return impostor.physicsBody.material.friction;}setBodyFriction(impostor, friction) {impostor.physicsBody.material.friction = friction;}getBodyRestitution(impostor) {return impostor.physicsBody.material.restitution;}setBodyRestitution(impostor, restitution) {impostor.physicsBody.material.restitution = restitution;}sleepBody(impostor) {impostor.physicsBody.sleep();}wakeUpBody(impostor) {impostor.physicsBody.wakeUp();}updateDistanceJoint(joint, maxDistance) {joint.physicsJoint.distance = maxDistance;}setMotor(joint, speed, maxForce, motorIndex) {motorIndex || (joint.physicsJoint.enableMotor(), joint.physicsJoint.setMotorSpeed(speed), maxForce && this.setLimit(joint, maxForce));}setLimit(joint, minForce, maxForce) {joint.physicsJoint.motorEquation.maxForce = maxForce, joint.physicsJoint.motorEquation.minForce = void 0 === minForce ? -minForce : minForce;}syncMeshWithImpostor(mesh, impostor) {const body = impostor.physicsBody;mesh.position.x = body.position.x, mesh.position.y = body.position.y, mesh.position.z = body.position.z, mesh.rotationQuaternion && (mesh.rotationQuaternion.x = body.quaternion.x, mesh.rotationQuaternion.y = body.quaternion.y, mesh.rotationQuaternion.z = body.quaternion.z, mesh.rotationQuaternion.w = body.quaternion.w);}getRadius(impostor) {const shape = impostor.physicsBody.shapes[0];return shape.boundingSphereRadius;}getBoxSizeToRef(impostor, result) {const shape = impostor.physicsBody.shapes[0];result.x = 2 * shape.halfExtents.x, result.y = 2 * shape.halfExtents.y, result.z = 2 * shape.halfExtents.z;}dispose() {}_extendNamespace() {const step_tmp1 = new this.BJSCANNON.Vec3(),engine = this.BJSCANNON;this.BJSCANNON.World.prototype.step = function (dt, timeSinceLastCalled, maxSubSteps) {if (maxSubSteps = maxSubSteps || 10, timeSinceLastCalled = timeSinceLastCalled || 0, 0 === timeSinceLastCalled) this.internalStep(dt), this.time += dt;else {let internalSteps = Math.floor((this.time + timeSinceLastCalled) / dt) - Math.floor(this.time / dt);internalSteps = Math.min(internalSteps, maxSubSteps) || 1;const t0 = performance.now();for (let i = 0; i != internalSteps && (this.internalStep(dt), !(performance.now() - t0 > 1e3 * dt)); i++);this.time += timeSinceLastCalled;const h = this.time % dt,interpvelo = step_tmp1,bodies = this.bodies;for (let j = 0; j !== bodies.length; j++) {const b = bodies[j];b.type !== engine.Body.STATIC && b.sleepState !== engine.Body.SLEEPING ? (b.position.vsub(b.previousPosition, interpvelo), interpvelo.scale(h / dt, interpvelo), b.position.vadd(interpvelo, b.interpolatedPosition)) : (b.interpolatedPosition.set(b.position.x, b.position.y, b.position.z), b.interpolatedQuaternion.set(b.quaternion.x, b.quaternion.y, b.quaternion.z, b.quaternion.w));}}};}raycast(from, to) {return this._raycastResult.reset(from, to), this.raycastToRef(from, to, this._raycastResult), this._raycastResult;}raycastToRef(from, to, result) {this._cannonRaycastResult.reset(), this.world.raycastClosest(from, to, {}, this._cannonRaycastResult), result.reset(from, to), this._cannonRaycastResult.hasHit && (result.setHitData({ x: this._cannonRaycastResult.hitNormalWorld.x, y: this._cannonRaycastResult.hitNormalWorld.y, z: this._cannonRaycastResult.hitNormalWorld.z }, { x: this._cannonRaycastResult.hitPointWorld.x, y: this._cannonRaycastResult.hitPointWorld.y, z: this._cannonRaycastResult.hitPointWorld.z }), result.setHitDistance(this._cannonRaycastResult.distance));}}PhysicsEngine.DefaultPluginFactory = () => new CannonJSPlugin();
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/Plugins/oimoJSPlugin.js
class OimoJSPlugin {constructor(_useDeltaForWorldStep = !0, iterations, oimoInjection = OIMO) {this._useDeltaForWorldStep = _useDeltaForWorldStep, this.name = "OimoJSPlugin", this._fixedTimeStep = 1 / 60, this._tmpImpostorsArray = [], this._tmpPositionVector = math_vector/* Vector3.Zero */.P.Zero(), this.BJSOIMO = oimoInjection, this.world = new this.BJSOIMO.World({ iterations: iterations }), this.world.clear(), this._raycastResult = new PhysicsRaycastResult();}getPluginVersion() {return 1;}setGravity(gravity) {this.world.gravity.set(gravity.x, gravity.y, gravity.z);}setTimeStep(timeStep) {this.world.timeStep = timeStep;}getTimeStep() {return this.world.timeStep;}executeStep(delta, impostors) {impostors.forEach(function (impostor) {impostor.beforeStep();}), this.world.timeStep = this._useDeltaForWorldStep ? delta : this._fixedTimeStep, this.world.step(), impostors.forEach((impostor) => {impostor.afterStep(), this._tmpImpostorsArray[impostor.uniqueId] = impostor;});for (let contact = this.world.contacts; null !== contact;) {if (contact.touching && !contact.body1.sleeping && !contact.body2.sleeping) {contact = contact.next;continue;}const mainImpostor = this._tmpImpostorsArray[+contact.body1.name],collidingImpostor = this._tmpImpostorsArray[+contact.body2.name];if (!mainImpostor || !collidingImpostor) {contact = contact.next;continue;}mainImpostor.onCollide({ body: collidingImpostor.physicsBody, point: null, distance: 0, impulse: 0, normal: null }), collidingImpostor.onCollide({ body: mainImpostor.physicsBody, point: null, distance: 0, impulse: 0, normal: null }), contact = contact.next;}}applyImpulse(impostor, force, contactPoint) {const mass = impostor.physicsBody.mass;impostor.physicsBody.applyImpulse(contactPoint.scale(this.world.invScale), force.scale(this.world.invScale * mass));}applyForce(impostor, force, contactPoint) {logger/* Logger.Warn */.Y.Warn("Oimo doesn't support applying force. Using impulse instead."), this.applyImpulse(impostor, force, contactPoint);}generatePhysicsBody(impostor) {if (impostor.parent) return void (impostor.physicsBody && (this.removePhysicsBody(impostor), impostor.forceUpdate()));if (impostor.isBodyInitRequired()) {const bodyConfig = { name: impostor.uniqueId, config: [impostor.getParam("mass") || .001, impostor.getParam("friction"), impostor.getParam("restitution")], size: [], type: [], pos: [], posShape: [], rot: [], rotShape: [], move: 0 !== impostor.getParam("mass"), density: impostor.getParam("mass"), friction: impostor.getParam("friction"), restitution: impostor.getParam("restitution"), world: this.world },impostors = [impostor];((parent) => {parent.getChildMeshes && parent.getChildMeshes().forEach(function (m) {m.physicsImpostor && impostors.push(m.physicsImpostor);});})(impostor.object);const checkWithEpsilon = (value) => Math.max(value, math_constants/* Epsilon */.kn),globalQuaternion = new math_vector/* Quaternion */._f();impostors.forEach((i) => {if (!i.object.rotationQuaternion) return;const oldQuaternion = i.object.rotationQuaternion;globalQuaternion.copyFrom(oldQuaternion), i.object.rotationQuaternion.set(0, 0, 0, 1), i.object.computeWorldMatrix(!0);const rot = globalQuaternion.toEulerAngles(),impostorExtents = i.getObjectExtents(),radToDeg = 57.29577951308232;if (i === impostor) {const center = impostor.getObjectCenter();impostor.object.getAbsolutePivotPoint().subtractToRef(center, this._tmpPositionVector), this._tmpPositionVector.divideInPlace(impostor.object.scaling), bodyConfig.pos.push(center.x), bodyConfig.pos.push(center.y), bodyConfig.pos.push(center.z), bodyConfig.posShape.push(0, 0, 0), bodyConfig.rotShape.push(0, 0, 0);} else {const localPosition = i.object.position.clone();bodyConfig.posShape.push(localPosition.x), bodyConfig.posShape.push(localPosition.y), bodyConfig.posShape.push(localPosition.z), bodyConfig.rotShape.push(rot.x * radToDeg, rot.y * radToDeg, rot.z * radToDeg);}switch (i.object.rotationQuaternion.copyFrom(globalQuaternion), i.type) {case PhysicsImpostor.ParticleImpostor:logger/* Logger.Warn */.Y.Warn("No Particle support in OIMO.js. using SphereImpostor instead");case PhysicsImpostor.SphereImpostor:{const radiusX = impostorExtents.x,radiusY = impostorExtents.y,radiusZ = impostorExtents.z,size = Math.max(checkWithEpsilon(radiusX), checkWithEpsilon(radiusY), checkWithEpsilon(radiusZ)) / 2;bodyConfig.type.push("sphere"), bodyConfig.size.push(size), bodyConfig.size.push(size), bodyConfig.size.push(size);break;}case PhysicsImpostor.CylinderImpostor:{const sizeX = checkWithEpsilon(impostorExtents.x) / 2,sizeY = checkWithEpsilon(impostorExtents.y);bodyConfig.type.push("cylinder"), bodyConfig.size.push(sizeX), bodyConfig.size.push(sizeY), bodyConfig.size.push(sizeY);break;}case PhysicsImpostor.PlaneImpostor:case PhysicsImpostor.BoxImpostor:default:{const sizeX = checkWithEpsilon(impostorExtents.x),sizeY = checkWithEpsilon(impostorExtents.y),sizeZ = checkWithEpsilon(impostorExtents.z);bodyConfig.type.push("box"), bodyConfig.size.push(sizeX), bodyConfig.size.push(sizeY), bodyConfig.size.push(sizeZ);break;}}i.object.rotationQuaternion = oldQuaternion;}), impostor.physicsBody = this.world.add(bodyConfig), impostor.physicsBody.resetQuaternion(globalQuaternion), impostor.physicsBody.updatePosition(0);} else this._tmpPositionVector.copyFromFloats(0, 0, 0);impostor.setDeltaPosition(this._tmpPositionVector);}removePhysicsBody(impostor) {this.world.removeRigidBody(impostor.physicsBody);}generateJoint(impostorJoint) {const mainBody = impostorJoint.mainImpostor.physicsBody,connectedBody = impostorJoint.connectedImpostor.physicsBody;if (!mainBody || !connectedBody) return;const jointData = impostorJoint.joint.jointData,options = jointData.nativeParams || {};let type;const nativeJointData = { body1: mainBody, body2: connectedBody, axe1: options.axe1 || (jointData.mainAxis ? jointData.mainAxis.asArray() : null), axe2: options.axe2 || (jointData.connectedAxis ? jointData.connectedAxis.asArray() : null), pos1: options.pos1 || (jointData.mainPivot ? jointData.mainPivot.asArray() : null), pos2: options.pos2 || (jointData.connectedPivot ? jointData.connectedPivot.asArray() : null), min: options.min, max: options.max, collision: options.collision || jointData.collision, spring: options.spring, world: this.world };switch (impostorJoint.joint.type) {case PhysicsJoint.BallAndSocketJoint:type = "jointBall";break;case PhysicsJoint.SpringJoint:{logger/* Logger.Warn */.Y.Warn("OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead");nativeJointData.min = jointData.length || nativeJointData.min, nativeJointData.max = Math.max(nativeJointData.min, nativeJointData.max);}case PhysicsJoint.DistanceJoint:type = "jointDistance", nativeJointData.max = jointData.maxDistance;break;case PhysicsJoint.PrismaticJoint:type = "jointPrisme";break;case PhysicsJoint.SliderJoint:type = "jointSlide";break;case PhysicsJoint.WheelJoint:type = "jointWheel";break;case PhysicsJoint.HingeJoint:default:type = "jointHinge";}nativeJointData.type = type, impostorJoint.joint.physicsJoint = this.world.add(nativeJointData);}removeJoint(impostorJoint) {try {this.world.removeJoint(impostorJoint.joint.physicsJoint);} catch (e) {logger/* Logger.Warn */.Y.Warn(e);}}isSupported() {return this.BJSOIMO !== void 0;}setTransformationFromPhysicsBody(impostor) {if (!impostor.physicsBody.sleeping) {if (impostor.physicsBody.shapes.next) {let parent = impostor.physicsBody.shapes;for (; parent.next;) parent = parent.next;impostor.object.position.set(parent.position.x, parent.position.y, parent.position.z);} else {const pos = impostor.physicsBody.getPosition();impostor.object.position.set(pos.x, pos.y, pos.z);}if (impostor.object.rotationQuaternion) {const quat = impostor.physicsBody.getQuaternion();impostor.object.rotationQuaternion.set(quat.x, quat.y, quat.z, quat.w);}}}setPhysicsBodyTransformation(impostor, newPosition, newRotation) {const body = impostor.physicsBody;impostor.physicsBody.shapes.next || (body.position.set(newPosition.x, newPosition.y, newPosition.z), body.orientation.set(newRotation.x, newRotation.y, newRotation.z, newRotation.w), body.syncShapes(), body.awake());}setLinearVelocity(impostor, velocity) {impostor.physicsBody.linearVelocity.set(velocity.x, velocity.y, velocity.z);}setAngularVelocity(impostor, velocity) {impostor.physicsBody.angularVelocity.set(velocity.x, velocity.y, velocity.z);}getLinearVelocity(impostor) {const v = impostor.physicsBody.linearVelocity;return v ? new math_vector/* Vector3 */.P(v.x, v.y, v.z) : null;}getAngularVelocity(impostor) {const v = impostor.physicsBody.angularVelocity;return v ? new math_vector/* Vector3 */.P(v.x, v.y, v.z) : null;}setBodyMass(impostor, mass) {const staticBody = 0 === mass;impostor.physicsBody.shapes.density = staticBody ? 1 : mass, impostor.physicsBody.setupMass(staticBody ? 2 : 1);}getBodyMass(impostor) {return impostor.physicsBody.shapes.density;}getBodyFriction(impostor) {return impostor.physicsBody.shapes.friction;}setBodyFriction(impostor, friction) {impostor.physicsBody.shapes.friction = friction;}getBodyRestitution(impostor) {return impostor.physicsBody.shapes.restitution;}setBodyRestitution(impostor, restitution) {impostor.physicsBody.shapes.restitution = restitution;}sleepBody(impostor) {impostor.physicsBody.sleep();}wakeUpBody(impostor) {impostor.physicsBody.awake();}updateDistanceJoint(joint, maxDistance, minDistance) {joint.physicsJoint.limitMotor.upperLimit = maxDistance, void 0 !== minDistance && (joint.physicsJoint.limitMotor.lowerLimit = minDistance);}setMotor(joint, speed, force, motorIndex) {force === void 0 ? force = 1e6 : logger/* Logger.Warn */.Y.Warn("OimoJS plugin currently has unexpected behavior when using setMotor with force parameter"), speed *= -1;const motor = motorIndex ? joint.physicsJoint.rotationalLimitMotor2 : joint.physicsJoint.rotationalLimitMotor1 || joint.physicsJoint.rotationalLimitMotor || joint.physicsJoint.limitMotor;motor && motor.setMotor(speed, force);}setLimit(joint, upperLimit, lowerLimit, motorIndex) {const motor = motorIndex ? joint.physicsJoint.rotationalLimitMotor2 : joint.physicsJoint.rotationalLimitMotor1 || joint.physicsJoint.rotationalLimitMotor || joint.physicsJoint.limitMotor;motor && motor.setLimit(upperLimit, void 0 === lowerLimit ? -upperLimit : lowerLimit);}syncMeshWithImpostor(mesh, impostor) {const body = impostor.physicsBody;mesh.position.x = body.position.x, mesh.position.y = body.position.y, mesh.position.z = body.position.z, mesh.rotationQuaternion && (mesh.rotationQuaternion.x = body.orientation.x, mesh.rotationQuaternion.y = body.orientation.y, mesh.rotationQuaternion.z = body.orientation.z, mesh.rotationQuaternion.w = body.orientation.w);}getRadius(impostor) {return impostor.physicsBody.shapes.radius;}getBoxSizeToRef(impostor, result) {const shape = impostor.physicsBody.shapes;result.x = 2 * shape.halfWidth, result.y = 2 * shape.halfHeight, result.z = 2 * shape.halfDepth;}dispose() {this.world.clear();}raycast(from, to) {return logger/* Logger.Warn */.Y.Warn("raycast is not currently supported by the Oimo physics plugin"), this._raycastResult.reset(from, to), this._raycastResult;}raycastToRef(from, to, result) {logger/* Logger.Warn */.Y.Warn("raycast is not currently supported by the Oimo physics plugin"), result.reset(from, to);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/Plugins/ammoJSPlugin.js
class AmmoJSPlugin {constructor(_useDeltaForWorldStep = !0, ammoInjection = Ammo, overlappingPairCache = null) {return (this._useDeltaForWorldStep = _useDeltaForWorldStep, this.bjsAMMO = {}, this.name = "AmmoJSPlugin", this._timeStep = 1 / 60, this._fixedTimeStep = 1 / 60, this._maxSteps = 5, this._tmpQuaternion = new math_vector/* Quaternion */._f(), this._tmpContactCallbackResult = !1, this._tmpContactPoint = new math_vector/* Vector3 */.P(), this._tmpContactNormal = new math_vector/* Vector3 */.P(), this._tmpVec3 = new math_vector/* Vector3 */.P(), this._tmpMatrix = new math_vector/* Matrix */.y3(), "function" == typeof ammoInjection) ? void logger/* Logger.Error */.Y.Error("AmmoJS is not ready. Please make sure you await Ammo() before using the plugin.") : (this.bjsAMMO = ammoInjection, this.isSupported() ? void (this._collisionConfiguration = new this.bjsAMMO.btSoftBodyRigidBodyCollisionConfiguration(), this._dispatcher = new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration), this._overlappingPairCache = overlappingPairCache || new this.bjsAMMO.btDbvtBroadphase(), this._solver = new this.bjsAMMO.btSequentialImpulseConstraintSolver(), this._softBodySolver = new this.bjsAMMO.btDefaultSoftBodySolver(), this.world = new this.bjsAMMO.btSoftRigidDynamicsWorld(this._dispatcher, this._overlappingPairCache, this._solver, this._collisionConfiguration, this._softBodySolver), this._tmpAmmoConcreteContactResultCallback = new this.bjsAMMO.ConcreteContactResultCallback(), this._tmpAmmoConcreteContactResultCallback.addSingleResult = (contactPoint) => {contactPoint = this.bjsAMMO.wrapPointer(contactPoint, this.bjsAMMO.btManifoldPoint);const worldPoint = contactPoint.getPositionWorldOnA(),worldNormal = contactPoint.m_normalWorldOnB;this._tmpContactPoint.x = worldPoint.x(), this._tmpContactPoint.y = worldPoint.y(), this._tmpContactPoint.z = worldPoint.z(), this._tmpContactNormal.x = worldNormal.x(), this._tmpContactNormal.y = worldNormal.y(), this._tmpContactNormal.z = worldNormal.z(), this._tmpContactImpulse = contactPoint.getAppliedImpulse(), this._tmpContactDistance = contactPoint.getDistance(), this._tmpContactCallbackResult = !0;}, this._raycastResult = new PhysicsRaycastResult(), this._tmpAmmoTransform = new this.bjsAMMO.btTransform(), this._tmpAmmoTransform.setIdentity(), this._tmpAmmoQuaternion = new this.bjsAMMO.btQuaternion(0, 0, 0, 1), this._tmpAmmoVectorA = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorB = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorC = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorD = new this.bjsAMMO.btVector3(0, 0, 0)) : void logger/* Logger.Error */.Y.Error("AmmoJS is not available. Please make sure you included the js file."));}getPluginVersion() {return 1;}setGravity(gravity) {this._tmpAmmoVectorA.setValue(gravity.x, gravity.y, gravity.z), this.world.setGravity(this._tmpAmmoVectorA), this.world.getWorldInfo().set_m_gravity(this._tmpAmmoVectorA);}setTimeStep(timeStep) {this._timeStep = timeStep;}setFixedTimeStep(fixedTimeStep) {this._fixedTimeStep = fixedTimeStep;}setMaxSteps(maxSteps) {this._maxSteps = maxSteps;}getTimeStep() {return this._timeStep;}_isImpostorInContact(impostor) {return this._tmpContactCallbackResult = !1, this.world.contactTest(impostor.physicsBody, this._tmpAmmoConcreteContactResultCallback), this._tmpContactCallbackResult;}_isImpostorPairInContact(impostorA, impostorB) {return this._tmpContactCallbackResult = !1, this.world.contactPairTest(impostorA.physicsBody, impostorB.physicsBody, this._tmpAmmoConcreteContactResultCallback), this._tmpContactCallbackResult;}_stepSimulation(timeStep = 1 / 60, maxSteps = 10, fixedTimeStep = 1 / 60) {if (0 == maxSteps) this.world.stepSimulation(timeStep, 0);else for (; 0 < maxSteps && 0 < timeStep;) timeStep - fixedTimeStep < fixedTimeStep ? (this.world.stepSimulation(timeStep, 0), timeStep = 0) : (timeStep -= fixedTimeStep, this.world.stepSimulation(fixedTimeStep, 0)), maxSteps--;}executeStep(delta, impostors) {for (const impostor of impostors) impostor.soft || impostor.beforeStep();this._stepSimulation(this._useDeltaForWorldStep ? delta : this._timeStep, this._maxSteps, this._fixedTimeStep);for (const mainImpostor of impostors) if (mainImpostor.soft ? this._afterSoftStep(mainImpostor) : mainImpostor.afterStep(), 0 < mainImpostor._onPhysicsCollideCallbacks.length && this._isImpostorInContact(mainImpostor)) for (const collideCallback of mainImpostor._onPhysicsCollideCallbacks) for (const otherImpostor of collideCallback.otherImpostors) (mainImpostor.physicsBody.isActive() || otherImpostor.physicsBody.isActive()) && this._isImpostorPairInContact(mainImpostor, otherImpostor) && (mainImpostor.onCollide({ body: otherImpostor.physicsBody, point: this._tmpContactPoint, distance: this._tmpContactDistance, impulse: this._tmpContactImpulse, normal: this._tmpContactNormal }), otherImpostor.onCollide({ body: mainImpostor.physicsBody, point: this._tmpContactPoint, distance: this._tmpContactDistance, impulse: this._tmpContactImpulse, normal: this._tmpContactNormal }));}_afterSoftStep(impostor) {impostor.type === PhysicsImpostor.RopeImpostor ? this._ropeStep(impostor) : this._softbodyOrClothStep(impostor);}_ropeStep(impostor) {const bodyVertices = impostor.physicsBody.get_m_nodes(),nbVertices = bodyVertices.size();let node, nodePositions, x, y, z;const path = [];for (let n = 0; n < nbVertices; n++) node = bodyVertices.at(n), nodePositions = node.get_m_x(), x = nodePositions.x(), y = nodePositions.y(), z = nodePositions.z(), path.push(new math_vector/* Vector3 */.P(x, y, z));const object = impostor.object,shape = impostor.getParam("shape");impostor.object = impostor._isFromLine ? CreateLines("lines", { points: path, instance: object }) : ExtrudeShape("ext", { shape: shape, path: path, instance: object });}_softbodyOrClothStep(impostor) {const normalDirection = impostor.type === PhysicsImpostor.ClothImpostor ? 1 : -1,object = impostor.object;let vertexPositions = object.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);vertexPositions || (vertexPositions = []);let vertexNormals = object.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind);vertexNormals || (vertexNormals = []);const nbVertices = vertexPositions.length / 3,bodyVertices = impostor.physicsBody.get_m_nodes();let node, nodePositions, x, y, z, nx, ny, nz;for (let n = 0; n < nbVertices; n++) {node = bodyVertices.at(n), nodePositions = node.get_m_x(), x = nodePositions.x(), y = nodePositions.y(), z = nodePositions.z() * normalDirection;const nodeNormals = node.get_m_n();nx = nodeNormals.x(), ny = nodeNormals.y(), nz = nodeNormals.z() * normalDirection, vertexPositions[3 * n] = x, vertexPositions[3 * n + 1] = y, vertexPositions[3 * n + 2] = z, vertexNormals[3 * n] = nx, vertexNormals[3 * n + 1] = ny, vertexNormals[3 * n + 2] = nz;}const vertex_data = new mesh_vertexData/* VertexData */.x();vertex_data.positions = vertexPositions, vertex_data.normals = vertexNormals, vertex_data.uvs = object.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), vertex_data.colors = object.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind), object && object.getIndices && (vertex_data.indices = object.getIndices()), vertex_data.applyToMesh(object);}applyImpulse(impostor, force, contactPoint) {if (!impostor.soft) {impostor.physicsBody.activate();const worldPoint = this._tmpAmmoVectorA,impulse = this._tmpAmmoVectorB;impostor.object && impostor.object.getWorldMatrix && contactPoint.subtractInPlace(impostor.object.getWorldMatrix().getTranslation()), worldPoint.setValue(contactPoint.x, contactPoint.y, contactPoint.z), impulse.setValue(force.x, force.y, force.z), impostor.physicsBody.applyImpulse(impulse, worldPoint);} else logger/* Logger.Warn */.Y.Warn("Cannot be applied to a soft body");}applyForce(impostor, force, contactPoint) {if (!impostor.soft) {impostor.physicsBody.activate();const worldPoint = this._tmpAmmoVectorA,impulse = this._tmpAmmoVectorB;if (impostor.object && impostor.object.getWorldMatrix) {const localTranslation = impostor.object.getWorldMatrix().getTranslation();worldPoint.setValue(contactPoint.x - localTranslation.x, contactPoint.y - localTranslation.y, contactPoint.z - localTranslation.z);} else worldPoint.setValue(contactPoint.x, contactPoint.y, contactPoint.z);impulse.setValue(force.x, force.y, force.z), impostor.physicsBody.applyForce(impulse, worldPoint);} else logger/* Logger.Warn */.Y.Warn("Cannot be applied to a soft body");}generatePhysicsBody(impostor) {if (impostor._pluginData.toDispose = [], impostor.parent) return void (impostor.physicsBody && (this.removePhysicsBody(impostor), impostor.forceUpdate()));if (impostor.isBodyInitRequired()) {const colShape = this._createShape(impostor),mass = impostor.getParam("mass");if (impostor._pluginData.mass = mass, impostor.soft) colShape.get_m_cfg().set_collisions(17), colShape.get_m_cfg().set_kDP(impostor.getParam("damping")), this.bjsAMMO.castObject(colShape, this.bjsAMMO.btCollisionObject).getCollisionShape().setMargin(impostor.getParam("margin")), colShape.setActivationState(AmmoJSPlugin._DISABLE_DEACTIVATION_FLAG), this.world.addSoftBody(colShape, 1, -1), impostor.physicsBody = colShape, impostor._pluginData.toDispose.push(colShape), this.setBodyPressure(impostor, 0), impostor.type === PhysicsImpostor.SoftbodyImpostor && this.setBodyPressure(impostor, impostor.getParam("pressure")), this.setBodyStiffness(impostor, impostor.getParam("stiffness")), this.setBodyVelocityIterations(impostor, impostor.getParam("velocityIterations")), this.setBodyPositionIterations(impostor, impostor.getParam("positionIterations"));else {const localInertia = new this.bjsAMMO.btVector3(0, 0, 0),startTransform = new this.bjsAMMO.btTransform();impostor.object.computeWorldMatrix(!0), startTransform.setIdentity(), 0 !== mass && colShape.calculateLocalInertia(mass, localInertia), this._tmpAmmoVectorA.setValue(impostor.object.position.x, impostor.object.position.y, impostor.object.position.z), this._tmpAmmoQuaternion.setValue(impostor.object.rotationQuaternion.x, impostor.object.rotationQuaternion.y, impostor.object.rotationQuaternion.z, impostor.object.rotationQuaternion.w), startTransform.setOrigin(this._tmpAmmoVectorA), startTransform.setRotation(this._tmpAmmoQuaternion);const myMotionState = new this.bjsAMMO.btDefaultMotionState(startTransform),rbInfo = new this.bjsAMMO.btRigidBodyConstructionInfo(mass, myMotionState, colShape, localInertia),body = new this.bjsAMMO.btRigidBody(rbInfo);if (0 === mass && (body.setCollisionFlags(body.getCollisionFlags() | AmmoJSPlugin._KINEMATIC_FLAG), body.setActivationState(AmmoJSPlugin._DISABLE_DEACTIVATION_FLAG)), impostor.type != PhysicsImpostor.NoImpostor || colShape.getChildShape || body.setCollisionFlags(body.getCollisionFlags() | AmmoJSPlugin._DISABLE_COLLISION_FLAG), impostor.type !== PhysicsImpostor.MeshImpostor && impostor.type !== PhysicsImpostor.NoImpostor) {const boundingInfo = impostor.object.getBoundingInfo();this._tmpVec3.copyFrom(impostor.object.getAbsolutePosition()), this._tmpVec3.subtractInPlace(boundingInfo.boundingBox.centerWorld), this._tmpVec3.x /= impostor.object.scaling.x, this._tmpVec3.y /= impostor.object.scaling.y, this._tmpVec3.z /= impostor.object.scaling.z, impostor.setDeltaPosition(this._tmpVec3);}const group = impostor.getParam("group"),mask = impostor.getParam("mask");group && mask ? this.world.addRigidBody(body, group, mask) : this.world.addRigidBody(body), impostor.physicsBody = body, impostor._pluginData.toDispose = impostor._pluginData.toDispose.concat([body, rbInfo, myMotionState, startTransform, localInertia, colShape]);}this.setBodyRestitution(impostor, impostor.getParam("restitution")), this.setBodyFriction(impostor, impostor.getParam("friction"));}}removePhysicsBody(impostor) {this.world && (impostor.soft ? this.world.removeSoftBody(impostor.physicsBody) : this.world.removeRigidBody(impostor.physicsBody), impostor._pluginData && (impostor._pluginData.toDispose.forEach((d) => {this.bjsAMMO.destroy(d);}), impostor._pluginData.toDispose = []));}generateJoint(impostorJoint) {const mainBody = impostorJoint.mainImpostor.physicsBody,connectedBody = impostorJoint.connectedImpostor.physicsBody;if (!mainBody || !connectedBody) return;const jointData = impostorJoint.joint.jointData;jointData.mainPivot || (jointData.mainPivot = new math_vector/* Vector3 */.P(0, 0, 0)), jointData.connectedPivot || (jointData.connectedPivot = new math_vector/* Vector3 */.P(0, 0, 0));let joint;switch (impostorJoint.joint.type) {case PhysicsJoint.DistanceJoint:{const distance = jointData.maxDistance;distance && (jointData.mainPivot = new math_vector/* Vector3 */.P(0, -distance / 2, 0), jointData.connectedPivot = new math_vector/* Vector3 */.P(0, distance / 2, 0)), joint = new this.bjsAMMO.btPoint2PointConstraint(mainBody, connectedBody, new this.bjsAMMO.btVector3(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z), new this.bjsAMMO.btVector3(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z));break;}case PhysicsJoint.HingeJoint:{jointData.mainAxis || (jointData.mainAxis = new math_vector/* Vector3 */.P(0, 0, 0)), jointData.connectedAxis || (jointData.connectedAxis = new math_vector/* Vector3 */.P(0, 0, 0));const mainAxis = new this.bjsAMMO.btVector3(jointData.mainAxis.x, jointData.mainAxis.y, jointData.mainAxis.z),connectedAxis = new this.bjsAMMO.btVector3(jointData.connectedAxis.x, jointData.connectedAxis.y, jointData.connectedAxis.z);joint = new this.bjsAMMO.btHingeConstraint(mainBody, connectedBody, new this.bjsAMMO.btVector3(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z), new this.bjsAMMO.btVector3(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z), mainAxis, connectedAxis);break;}case PhysicsJoint.BallAndSocketJoint:joint = new this.bjsAMMO.btPoint2PointConstraint(mainBody, connectedBody, new this.bjsAMMO.btVector3(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z), new this.bjsAMMO.btVector3(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z));break;default:logger/* Logger.Warn */.Y.Warn("JointType not currently supported by the Ammo plugin, falling back to PhysicsJoint.BallAndSocketJoint"), joint = new this.bjsAMMO.btPoint2PointConstraint(mainBody, connectedBody, new this.bjsAMMO.btVector3(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z), new this.bjsAMMO.btVector3(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z));}this.world.addConstraint(joint, !impostorJoint.joint.jointData.collision), impostorJoint.joint.physicsJoint = joint;}removeJoint(impostorJoint) {this.world && this.world.removeConstraint(impostorJoint.joint.physicsJoint);}_addMeshVerts(btTriangleMesh, topLevelObject, object) {let triangleCount = 0;if (object && object.getIndices && object.getWorldMatrix && object.getChildMeshes) {let indices = object.getIndices();indices || (indices = []);let vertexPositions = object.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);vertexPositions || (vertexPositions = []);let localMatrix;if (topLevelObject && topLevelObject !== object) {let topLevelQuaternion = topLevelObject.rotationQuaternion ? topLevelObject.rotationQuaternion : topLevelObject.rotation ? math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(topLevelObject.rotation.x, topLevelObject.rotation.y, topLevelObject.rotation.z) : math_vector/* Quaternion.Identity */._f.Identity();const topLevelMatrix = math_vector/* Matrix.Compose */.y3.Compose(math_vector/* Vector3.One */.P.One(), topLevelQuaternion, topLevelObject.position);topLevelMatrix.invertToRef(this._tmpMatrix);const wm = object.computeWorldMatrix(!1);localMatrix = wm.multiply(this._tmpMatrix);} else math_vector/* Matrix.ScalingToRef */.y3.ScalingToRef(object.scaling.x, object.scaling.y, object.scaling.z, this._tmpMatrix), localMatrix = this._tmpMatrix;const faceCount = indices.length / 3;for (let i = 0; i < faceCount; i++) {const triPoints = [];for (let v, point = 0; 3 > point; point++) {v = new math_vector/* Vector3 */.P(vertexPositions[3 * indices[3 * i + point] + 0], vertexPositions[3 * indices[3 * i + point] + 1], vertexPositions[3 * indices[3 * i + point] + 2]), v = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(v, localMatrix);let vec;vec = 0 == point ? this._tmpAmmoVectorA : 1 == point ? this._tmpAmmoVectorB : this._tmpAmmoVectorC, vec.setValue(v.x, v.y, v.z), triPoints.push(vec);}btTriangleMesh.addTriangle(triPoints[0], triPoints[1], triPoints[2]), triangleCount++;}object.getChildMeshes().forEach((m) => {triangleCount += this._addMeshVerts(btTriangleMesh, topLevelObject, m);});}return triangleCount;}_softVertexData(impostor) {const object = impostor.object;if (object && object.getIndices && object.getWorldMatrix && object.getChildMeshes) {let indices = object.getIndices();indices || (indices = []);let vertexPositions = object.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);vertexPositions || (vertexPositions = []);let vertexNormals = object.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind);vertexNormals || (vertexNormals = []), object.computeWorldMatrix(!1);const newPoints = [],newNorms = [];for (let i = 0; i < vertexPositions.length; i += 3) {let v = new math_vector/* Vector3 */.P(vertexPositions[i], vertexPositions[i + 1], vertexPositions[i + 2]),n = new math_vector/* Vector3 */.P(vertexNormals[i], vertexNormals[i + 1], vertexNormals[i + 2]);v = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(v, object.getWorldMatrix()), n = math_vector/* Vector3.TransformNormal */.P.TransformNormal(n, object.getWorldMatrix()), newPoints.push(v.x, v.y, v.z), newNorms.push(n.x, n.y, n.z);}const vertex_data = new mesh_vertexData/* VertexData */.x();return vertex_data.positions = newPoints, vertex_data.normals = newNorms, vertex_data.uvs = object.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), vertex_data.colors = object.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind), object && object.getIndices && (vertex_data.indices = object.getIndices()), vertex_data.applyToMesh(object), object.position = math_vector/* Vector3.Zero */.P.Zero(), object.rotationQuaternion = null, object.rotation = math_vector/* Vector3.Zero */.P.Zero(), object.computeWorldMatrix(!0), vertex_data;}return mesh_vertexData/* VertexData.ExtractFromMesh */.x.ExtractFromMesh(object);}_createSoftbody(impostor) {const object = impostor.object;if (object && object.getIndices) {let indices = object.getIndices();indices || (indices = []);const vertex_data = this._softVertexData(impostor),vertexPositions = vertex_data.positions,vertexNormals = vertex_data.normals;if (null === vertexPositions || null === vertexNormals) return new this.bjsAMMO.btCompoundShape();else {const triPoints = [],triNorms = [];for (let i = 0; i < vertexPositions.length; i += 3) {const v = new math_vector/* Vector3 */.P(vertexPositions[i], vertexPositions[i + 1], vertexPositions[i + 2]),n = new math_vector/* Vector3 */.P(vertexNormals[i], vertexNormals[i + 1], vertexNormals[i + 2]);triPoints.push(v.x, v.y, -v.z), triNorms.push(n.x, n.y, -n.z);}const softBody = new this.bjsAMMO.btSoftBodyHelpers().CreateFromTriMesh(this.world.getWorldInfo(), triPoints, object.getIndices(), indices.length / 3, !0),nbVertices = vertexPositions.length / 3,bodyVertices = softBody.get_m_nodes();let node, nodeNormals;for (let i = 0; i < nbVertices; i++) node = bodyVertices.at(i), nodeNormals = node.get_m_n(), nodeNormals.setX(triNorms[3 * i]), nodeNormals.setY(triNorms[3 * i + 1]), nodeNormals.setZ(triNorms[3 * i + 2]);return softBody;}}}_createCloth(impostor) {const object = impostor.object;if (object && object.getIndices) {let indices = object.getIndices();indices || (indices = []);const vertex_data = this._softVertexData(impostor),vertexPositions = vertex_data.positions,vertexNormals = vertex_data.normals;if (null === vertexPositions || null === vertexNormals) return new this.bjsAMMO.btCompoundShape();else {const len = vertexPositions.length,segments = Math.sqrt(len / 3);impostor.segments = segments;const segs = segments - 1;this._tmpAmmoVectorA.setValue(vertexPositions[0], vertexPositions[1], vertexPositions[2]), this._tmpAmmoVectorB.setValue(vertexPositions[3 * segs], vertexPositions[3 * segs + 1], vertexPositions[3 * segs + 2]), this._tmpAmmoVectorD.setValue(vertexPositions[len - 3], vertexPositions[len - 2], vertexPositions[len - 1]), this._tmpAmmoVectorC.setValue(vertexPositions[len - 3 - 3 * segs], vertexPositions[len - 2 - 3 * segs], vertexPositions[len - 1 - 3 * segs]);const clothBody = new this.bjsAMMO.btSoftBodyHelpers().CreatePatch(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, this._tmpAmmoVectorC, this._tmpAmmoVectorD, segments, segments, impostor.getParam("fixedPoints"), !0);return clothBody;}}}_createRope(impostor) {let len, segments;const vertex_data = this._softVertexData(impostor),vertexPositions = vertex_data.positions,vertexNormals = vertex_data.normals;if (null === vertexPositions || null === vertexNormals) return new this.bjsAMMO.btCompoundShape();vertex_data.applyToMesh(impostor.object, !0), impostor._isFromLine = !0;const vertexSquared = vertexNormals.map((x) => x * x),reduced = vertexSquared.reduce((accumulator, currentValue) => accumulator + currentValue);if (0 === reduced) len = vertexPositions.length, segments = len / 3 - 1, this._tmpAmmoVectorA.setValue(vertexPositions[0], vertexPositions[1], vertexPositions[2]), this._tmpAmmoVectorB.setValue(vertexPositions[len - 3], vertexPositions[len - 2], vertexPositions[len - 1]);else {impostor._isFromLine = !1;const pathVectors = impostor.getParam("path"),shape = impostor.getParam("shape");if (null === shape) return logger/* Logger.Warn */.Y.Warn("No shape available for extruded mesh"), new this.bjsAMMO.btCompoundShape();len = pathVectors.length, segments = len - 1, this._tmpAmmoVectorA.setValue(pathVectors[0].x, pathVectors[0].y, pathVectors[0].z), this._tmpAmmoVectorB.setValue(pathVectors[len - 1].x, pathVectors[len - 1].y, pathVectors[len - 1].z);}impostor.segments = segments;let fixedPoints = impostor.getParam("fixedPoints");fixedPoints = 3 < fixedPoints ? 3 : fixedPoints;const ropeBody = new this.bjsAMMO.btSoftBodyHelpers().CreateRope(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, segments - 1, fixedPoints);return ropeBody.get_m_cfg().set_collisions(17), ropeBody;}_createCustom(impostor) {let returnValue = null;return this.onCreateCustomShape && (returnValue = this.onCreateCustomShape(impostor)), null == returnValue && (returnValue = new this.bjsAMMO.btCompoundShape()), returnValue;}_addHullVerts(btConvexHullShape, topLevelObject, object) {let triangleCount = 0;if (object && object.getIndices && object.getWorldMatrix && object.getChildMeshes) {let indices = object.getIndices();indices || (indices = []);let vertexPositions = object.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);vertexPositions || (vertexPositions = []), object.computeWorldMatrix(!1);const faceCount = indices.length / 3;for (let i = 0; i < faceCount; i++) {const triPoints = [];for (let v, point = 0; 3 > point; point++) {v = new math_vector/* Vector3 */.P(vertexPositions[3 * indices[3 * i + point] + 0], vertexPositions[3 * indices[3 * i + point] + 1], vertexPositions[3 * indices[3 * i + point] + 2]), math_vector/* Matrix.ScalingToRef */.y3.ScalingToRef(object.scaling.x, object.scaling.y, object.scaling.z, this._tmpMatrix), v = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(v, this._tmpMatrix);let vec;vec = 0 == point ? this._tmpAmmoVectorA : 1 == point ? this._tmpAmmoVectorB : this._tmpAmmoVectorC, vec.setValue(v.x, v.y, v.z), triPoints.push(vec);}btConvexHullShape.addPoint(triPoints[0], !0), btConvexHullShape.addPoint(triPoints[1], !0), btConvexHullShape.addPoint(triPoints[2], !0), triangleCount++;}object.getChildMeshes().forEach((m) => {triangleCount += this._addHullVerts(btConvexHullShape, topLevelObject, m);});}return triangleCount;}_createShape(impostor, ignoreChildren = !1) {const object = impostor.object;let returnValue;const impostorExtents = impostor.getObjectExtents();if (!ignoreChildren) {const meshChildren = impostor.object.getChildMeshes ? impostor.object.getChildMeshes(!0) : [];returnValue = new this.bjsAMMO.btCompoundShape();let childrenAdded = 0;if (meshChildren.forEach((childMesh) => {const childImpostor = childMesh.getPhysicsImpostor();if (childImpostor) {if (childImpostor.type == PhysicsImpostor.MeshImpostor) throw "A child MeshImpostor is not supported. Only primitive impostors are supported as children (eg. box or sphere)";const shape = this._createShape(childImpostor),parentMat = childMesh.parent.getWorldMatrix().clone(),s = new math_vector/* Vector3 */.P();parentMat.decompose(s), this._tmpAmmoTransform.getOrigin().setValue(childMesh.position.x * s.x, childMesh.position.y * s.y, childMesh.position.z * s.z), this._tmpAmmoQuaternion.setValue(childMesh.rotationQuaternion.x, childMesh.rotationQuaternion.y, childMesh.rotationQuaternion.z, childMesh.rotationQuaternion.w), this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion), returnValue.addChildShape(this._tmpAmmoTransform, shape), childImpostor.dispose(), childrenAdded++;}}), 0 < childrenAdded) {if (impostor.type != PhysicsImpostor.NoImpostor) {const shape = this._createShape(impostor, !0);shape && (this._tmpAmmoTransform.getOrigin().setValue(0, 0, 0), this._tmpAmmoQuaternion.setValue(0, 0, 0, 1), this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion), returnValue.addChildShape(this._tmpAmmoTransform, shape));}return returnValue;}this.bjsAMMO.destroy(returnValue), returnValue = null;}switch (impostor.type) {case PhysicsImpostor.SphereImpostor:if (math_scalar/* Scalar.WithinEpsilon */.R.WithinEpsilon(impostorExtents.x, impostorExtents.y, 1e-4) && math_scalar/* Scalar.WithinEpsilon */.R.WithinEpsilon(impostorExtents.x, impostorExtents.z, 1e-4)) returnValue = new this.bjsAMMO.btSphereShape(impostorExtents.x / 2);else {const positions = [new this.bjsAMMO.btVector3(0, 0, 0)];returnValue = new this.bjsAMMO.btMultiSphereShape(positions, [1], 1), returnValue.setLocalScaling(new this.bjsAMMO.btVector3(impostorExtents.x / 2, impostorExtents.y / 2, impostorExtents.z / 2));}break;case PhysicsImpostor.CapsuleImpostor:{const capRadius = impostorExtents.x / 2;returnValue = new this.bjsAMMO.btCapsuleShape(capRadius, impostorExtents.y - 2 * capRadius);}break;case PhysicsImpostor.CylinderImpostor:this._tmpAmmoVectorA.setValue(impostorExtents.x / 2, impostorExtents.y / 2, impostorExtents.z / 2), returnValue = new this.bjsAMMO.btCylinderShape(this._tmpAmmoVectorA);break;case PhysicsImpostor.PlaneImpostor:case PhysicsImpostor.BoxImpostor:this._tmpAmmoVectorA.setValue(impostorExtents.x / 2, impostorExtents.y / 2, impostorExtents.z / 2), returnValue = new this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);break;case PhysicsImpostor.MeshImpostor:if (0 == impostor.getParam("mass")) {if (this.onCreateCustomMeshImpostor) returnValue = this.onCreateCustomMeshImpostor(impostor);else {const triMesh = new this.bjsAMMO.btTriangleMesh();impostor._pluginData.toDispose.push(triMesh);const triangleCount = this._addMeshVerts(triMesh, object, object);returnValue = 0 == triangleCount ? new this.bjsAMMO.btCompoundShape() : new this.bjsAMMO.btBvhTriangleMeshShape(triMesh);}break;}case PhysicsImpostor.ConvexHullImpostor:{if (this.onCreateCustomConvexHullImpostor) returnValue = this.onCreateCustomConvexHullImpostor(impostor);else {const convexHull = new this.bjsAMMO.btConvexHullShape(),triangleCount = this._addHullVerts(convexHull, object, object);0 == triangleCount ? (impostor._pluginData.toDispose.push(convexHull), returnValue = new this.bjsAMMO.btCompoundShape()) : returnValue = convexHull;}break;}case PhysicsImpostor.NoImpostor:returnValue = new this.bjsAMMO.btSphereShape(impostorExtents.x / 2);break;case PhysicsImpostor.CustomImpostor:returnValue = this._createCustom(impostor);break;case PhysicsImpostor.SoftbodyImpostor:returnValue = this._createSoftbody(impostor);break;case PhysicsImpostor.ClothImpostor:returnValue = this._createCloth(impostor);break;case PhysicsImpostor.RopeImpostor:returnValue = this._createRope(impostor);break;default:logger/* Logger.Warn */.Y.Warn("The impostor type is not currently supported by the ammo plugin.");}return returnValue;}setTransformationFromPhysicsBody(impostor) {impostor.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform), impostor.object.position.set(this._tmpAmmoTransform.getOrigin().x(), this._tmpAmmoTransform.getOrigin().y(), this._tmpAmmoTransform.getOrigin().z()), impostor.object.rotationQuaternion ? impostor.object.rotationQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w()) : impostor.object.rotation && (this._tmpQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w()), this._tmpQuaternion.toEulerAnglesToRef(impostor.object.rotation));}setPhysicsBodyTransformation(impostor, newPosition, newRotation) {const trans = impostor.physicsBody.getWorldTransform();if (Math.abs(trans.getOrigin().x() - newPosition.x) > math_constants/* Epsilon */.kn || Math.abs(trans.getOrigin().y() - newPosition.y) > math_constants/* Epsilon */.kn || Math.abs(trans.getOrigin().z() - newPosition.z) > math_constants/* Epsilon */.kn || Math.abs(trans.getRotation().x() - newRotation.x) > math_constants/* Epsilon */.kn || Math.abs(trans.getRotation().y() - newRotation.y) > math_constants/* Epsilon */.kn || Math.abs(trans.getRotation().z() - newRotation.z) > math_constants/* Epsilon */.kn || Math.abs(trans.getRotation().w() - newRotation.w) > math_constants/* Epsilon */.kn) if (this._tmpAmmoVectorA.setValue(newPosition.x, newPosition.y, newPosition.z), trans.setOrigin(this._tmpAmmoVectorA), this._tmpAmmoQuaternion.setValue(newRotation.x, newRotation.y, newRotation.z, newRotation.w), trans.setRotation(this._tmpAmmoQuaternion), impostor.physicsBody.setWorldTransform(trans), 0 == impostor.mass) {const motionState = impostor.physicsBody.getMotionState();motionState && motionState.setWorldTransform(trans);} else impostor.physicsBody.activate();}isSupported() {return this.bjsAMMO !== void 0;}setLinearVelocity(impostor, velocity) {this._tmpAmmoVectorA.setValue(velocity.x, velocity.y, velocity.z), impostor.soft ? impostor.physicsBody.linearVelocity(this._tmpAmmoVectorA) : impostor.physicsBody.setLinearVelocity(this._tmpAmmoVectorA);}setAngularVelocity(impostor, velocity) {this._tmpAmmoVectorA.setValue(velocity.x, velocity.y, velocity.z), impostor.soft ? impostor.physicsBody.angularVelocity(this._tmpAmmoVectorA) : impostor.physicsBody.setAngularVelocity(this._tmpAmmoVectorA);}getLinearVelocity(impostor) {let v;if (v = impostor.soft ? impostor.physicsBody.linearVelocity() : impostor.physicsBody.getLinearVelocity(), !v) return null;const result = new math_vector/* Vector3 */.P(v.x(), v.y(), v.z());return this.bjsAMMO.destroy(v), result;}getAngularVelocity(impostor) {let v;if (v = impostor.soft ? impostor.physicsBody.angularVelocity() : impostor.physicsBody.getAngularVelocity(), !v) return null;const result = new math_vector/* Vector3 */.P(v.x(), v.y(), v.z());return this.bjsAMMO.destroy(v), result;}setBodyMass(impostor, mass) {impostor.soft ? impostor.physicsBody.setTotalMass(mass, !1) : impostor.physicsBody.setMassProps(mass), impostor._pluginData.mass = mass;}getBodyMass(impostor) {return impostor._pluginData.mass || 0;}getBodyFriction(impostor) {return impostor._pluginData.friction || 0;}setBodyFriction(impostor, friction) {impostor.soft ? impostor.physicsBody.get_m_cfg().set_kDF(friction) : impostor.physicsBody.setFriction(friction), impostor._pluginData.friction = friction;}getBodyRestitution(impostor) {return impostor._pluginData.restitution || 0;}setBodyRestitution(impostor, restitution) {impostor.physicsBody.setRestitution(restitution), impostor._pluginData.restitution = restitution;}getBodyPressure(impostor) {return impostor.soft ? impostor._pluginData.pressure || 0 : (logger/* Logger.Warn */.Y.Warn("Pressure is not a property of a rigid body"), 0);}setBodyPressure(impostor, pressure) {impostor.soft ? impostor.type === PhysicsImpostor.SoftbodyImpostor ? (impostor.physicsBody.get_m_cfg().set_kPR(pressure), impostor._pluginData.pressure = pressure) : (impostor.physicsBody.get_m_cfg().set_kPR(0), impostor._pluginData.pressure = 0) : logger/* Logger.Warn */.Y.Warn("Pressure can only be applied to a softbody");}getBodyStiffness(impostor) {return impostor.soft ? impostor._pluginData.stiffness || 0 : (logger/* Logger.Warn */.Y.Warn("Stiffness is not a property of a rigid body"), 0);}setBodyStiffness(impostor, stiffness) {impostor.soft ? (stiffness = 0 > stiffness ? 0 : stiffness, stiffness = 1 < stiffness ? 1 : stiffness, impostor.physicsBody.get_m_materials().at(0).set_m_kLST(stiffness), impostor._pluginData.stiffness = stiffness) : logger/* Logger.Warn */.Y.Warn("Stiffness cannot be applied to a rigid body");}getBodyVelocityIterations(impostor) {return impostor.soft ? impostor._pluginData.velocityIterations || 0 : (logger/* Logger.Warn */.Y.Warn("Velocity iterations is not a property of a rigid body"), 0);}setBodyVelocityIterations(impostor, velocityIterations) {impostor.soft ? (velocityIterations = 0 > velocityIterations ? 0 : velocityIterations, impostor.physicsBody.get_m_cfg().set_viterations(velocityIterations), impostor._pluginData.velocityIterations = velocityIterations) : logger/* Logger.Warn */.Y.Warn("Velocity iterations cannot be applied to a rigid body");}getBodyPositionIterations(impostor) {return impostor.soft ? impostor._pluginData.positionIterations || 0 : (logger/* Logger.Warn */.Y.Warn("Position iterations is not a property of a rigid body"), 0);}setBodyPositionIterations(impostor, positionIterations) {impostor.soft ? (positionIterations = 0 > positionIterations ? 0 : positionIterations, impostor.physicsBody.get_m_cfg().set_piterations(positionIterations), impostor._pluginData.positionIterations = positionIterations) : logger/* Logger.Warn */.Y.Warn("Position iterations cannot be applied to a rigid body");}appendAnchor(impostor, otherImpostor, width, height, influence = 1, noCollisionBetweenLinkedBodies = !1) {const segs = impostor.segments,nbAcross = Math.round((segs - 1) * width),nbUp = Math.round((segs - 1) * height);impostor.physicsBody.appendAnchor(nbAcross + segs * (segs - 1 - nbUp), otherImpostor.physicsBody, noCollisionBetweenLinkedBodies, influence);}appendHook(impostor, otherImpostor, length, influence = 1, noCollisionBetweenLinkedBodies = !1) {const node = Math.round(impostor.segments * length);impostor.physicsBody.appendAnchor(node, otherImpostor.physicsBody, noCollisionBetweenLinkedBodies, influence);}sleepBody(impostor) {impostor.physicsBody.forceActivationState(0);}wakeUpBody(impostor) {impostor.physicsBody.activate();}updateDistanceJoint() {logger/* Logger.Warn */.Y.Warn("updateDistanceJoint is not currently supported by the Ammo physics plugin");}setMotor(joint, speed, maxForce) {joint.physicsJoint.enableAngularMotor(!0, speed, maxForce);}setLimit() {logger/* Logger.Warn */.Y.Warn("setLimit is not currently supported by the Ammo physics plugin");}syncMeshWithImpostor(mesh, impostor) {const body = impostor.physicsBody;body.getMotionState().getWorldTransform(this._tmpAmmoTransform), mesh.position.x = this._tmpAmmoTransform.getOrigin().x(), mesh.position.y = this._tmpAmmoTransform.getOrigin().y(), mesh.position.z = this._tmpAmmoTransform.getOrigin().z(), mesh.rotationQuaternion && (mesh.rotationQuaternion.x = this._tmpAmmoTransform.getRotation().x(), mesh.rotationQuaternion.y = this._tmpAmmoTransform.getRotation().y(), mesh.rotationQuaternion.z = this._tmpAmmoTransform.getRotation().z(), mesh.rotationQuaternion.w = this._tmpAmmoTransform.getRotation().w());}getRadius(impostor) {const extents = impostor.getObjectExtents();return extents.x / 2;}getBoxSizeToRef(impostor, result) {const extents = impostor.getObjectExtents();result.x = extents.x, result.y = extents.y, result.z = extents.z;}dispose() {this.bjsAMMO.destroy(this.world), this.bjsAMMO.destroy(this._solver), this.bjsAMMO.destroy(this._overlappingPairCache), this.bjsAMMO.destroy(this._dispatcher), this.bjsAMMO.destroy(this._collisionConfiguration), this.bjsAMMO.destroy(this._tmpAmmoVectorA), this.bjsAMMO.destroy(this._tmpAmmoVectorB), this.bjsAMMO.destroy(this._tmpAmmoVectorC), this.bjsAMMO.destroy(this._tmpAmmoTransform), this.bjsAMMO.destroy(this._tmpAmmoQuaternion), this.bjsAMMO.destroy(this._tmpAmmoConcreteContactResultCallback), this.world = null;}raycast(from, to) {return this.raycastToRef(from, to, this._raycastResult), this._raycastResult;}raycastToRef(from, to, result) {this._tmpAmmoVectorRCA = new this.bjsAMMO.btVector3(from.x, from.y, from.z), this._tmpAmmoVectorRCB = new this.bjsAMMO.btVector3(to.x, to.y, to.z);const rayCallback = new this.bjsAMMO.ClosestRayResultCallback(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB);this.world.rayTest(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB, rayCallback), result.reset(from, to), rayCallback.hasHit() && (result.setHitData({ x: rayCallback.get_m_hitNormalWorld().x(), y: rayCallback.get_m_hitNormalWorld().y(), z: rayCallback.get_m_hitNormalWorld().z() }, { x: rayCallback.get_m_hitPointWorld().x(), y: rayCallback.get_m_hitPointWorld().y(), z: rayCallback.get_m_hitPointWorld().z() }), result.calculateHitDistance()), this.bjsAMMO.destroy(rayCallback), this.bjsAMMO.destroy(this._tmpAmmoVectorRCA), this.bjsAMMO.destroy(this._tmpAmmoVectorRCB);}}AmmoJSPlugin._DISABLE_COLLISION_FLAG = 4, AmmoJSPlugin._KINEMATIC_FLAG = 2, AmmoJSPlugin._DISABLE_DEACTIVATION_FLAG = 4;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Probes/reflectionProbe.js
abstractScene/* AbstractScene.prototype.removeReflectionProbe */.p.prototype.removeReflectionProbe = function (toRemove) {if (!this.reflectionProbes) return -1;const index = this.reflectionProbes.indexOf(toRemove);return -1 !== index && this.reflectionProbes.splice(index, 1), index;}, abstractScene/* AbstractScene.prototype.addReflectionProbe */.p.prototype.addReflectionProbe = function (newReflectionProbe) {this.reflectionProbes || (this.reflectionProbes = []), this.reflectionProbes.push(newReflectionProbe);};class ReflectionProbe {constructor(name, size, scene, generateMipMaps = !0, useFloat = !1, linearSpace = !1) {if (this.name = name, this._viewMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this._target = math_vector/* Vector3.Zero */.P.Zero(), this._add = math_vector/* Vector3.Zero */.P.Zero(), this._invertYAxis = !1, this.position = math_vector/* Vector3.Zero */.P.Zero(), this.metadata = null, this._parentContainer = null, this._scene = scene, scene.getEngine().supportsUniformBuffers) {this._sceneUBOs = [];for (let i = 0; 6 > i; ++i) this._sceneUBOs.push(scene.createSceneUniformBuffer(`Scene for Reflection Probe (name "${name}") face #${i}`));}this._scene.reflectionProbes || (this._scene.reflectionProbes = []), this._scene.reflectionProbes.push(this);let textureType = 0;if (useFloat) {const caps = this._scene.getEngine().getCaps();caps.textureHalfFloatRender ? textureType = 2 : caps.textureFloatRender && (textureType = 1);}this._renderTargetTexture = new Textures_renderTargetTexture/* RenderTargetTexture */._(name, size, scene, generateMipMaps, !0, textureType, !0), this._renderTargetTexture.gammaSpace = !linearSpace;const useReverseDepthBuffer = scene.getEngine().useReverseDepthBuffer;this._renderTargetTexture.onBeforeRenderObservable.add((faceIndex) => {this._sceneUBOs && (scene.setSceneUniformBuffer(this._sceneUBOs[faceIndex]), scene.getSceneUniformBuffer().unbindEffect()), 0 === faceIndex ? this._add.copyFromFloats(1, 0, 0) : 1 === faceIndex ? this._add.copyFromFloats(-1, 0, 0) : 2 === faceIndex ? this._add.copyFromFloats(0, this._invertYAxis ? 1 : -1, 0) : 3 === faceIndex ? this._add.copyFromFloats(0, this._invertYAxis ? -1 : 1, 0) : 4 === faceIndex ? this._add.copyFromFloats(0, 0, scene.useRightHandedSystem ? -1 : 1) : 5 === faceIndex ? this._add.copyFromFloats(0, 0, scene.useRightHandedSystem ? 1 : -1) : void 0, this._attachedMesh && this.position.copyFrom(this._attachedMesh.getAbsolutePosition()), this.position.addToRef(this._add, this._target);const lookAtFunction = scene.useRightHandedSystem ? math_vector/* Matrix.LookAtRHToRef */.y3.LookAtRHToRef : math_vector/* Matrix.LookAtLHToRef */.y3.LookAtLHToRef,perspectiveFunction = scene.useRightHandedSystem ? math_vector/* Matrix.PerspectiveFovRH */.y3.PerspectiveFovRH : math_vector/* Matrix.PerspectiveFovLH */.y3.PerspectiveFovLH;lookAtFunction(this.position, this._target, math_vector/* Vector3.Up */.P.Up(), this._viewMatrix), scene.activeCamera && (this._projectionMatrix = perspectiveFunction(Math.PI / 2, 1, useReverseDepthBuffer ? scene.activeCamera.maxZ : scene.activeCamera.minZ, useReverseDepthBuffer ? scene.activeCamera.minZ : scene.activeCamera.maxZ, this._scene.getEngine().isNDCHalfZRange), scene.setTransformMatrix(this._viewMatrix, this._projectionMatrix), scene.activeCamera.isRigCamera && !this._renderTargetTexture.activeCamera && (this._renderTargetTexture.activeCamera = scene.activeCamera.rigParent || null)), scene._forcedViewPosition = this.position;});let currentApplyByPostProcess;this._renderTargetTexture.onBeforeBindObservable.add(() => {var _a, _b;this._currentSceneUBO = scene.getSceneUniformBuffer(), null === (_b = (_a = scene.getEngine())._debugPushGroup) || void 0 === _b ? void 0 : _b.call(_a, `reflection probe generation for ${name}`, 1), currentApplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess, linearSpace && (scene.imageProcessingConfiguration.applyByPostProcess = !0);}), this._renderTargetTexture.onAfterUnbindObservable.add(() => {var _a, _b;scene.imageProcessingConfiguration.applyByPostProcess = currentApplyByPostProcess, scene._forcedViewPosition = null, this._sceneUBOs && scene.setSceneUniformBuffer(this._currentSceneUBO), scene.updateTransformMatrix(!0), null === (_b = (_a = scene.getEngine())._debugPopGroup) || void 0 === _b ? void 0 : _b.call(_a, 1);});}get samples() {return this._renderTargetTexture.samples;}set samples(value) {this._renderTargetTexture.samples = value;}get refreshRate() {return this._renderTargetTexture.refreshRate;}set refreshRate(value) {this._renderTargetTexture.refreshRate = value;}getScene() {return this._scene;}get cubeTexture() {return this._renderTargetTexture;}get renderList() {return this._renderTargetTexture.renderList;}attachToMesh(mesh) {this._attachedMesh = mesh;}setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil) {this._renderTargetTexture.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil);}dispose() {const index = this._scene.reflectionProbes.indexOf(this);if (-1 !== index && this._scene.reflectionProbes.splice(index, 1), this._parentContainer) {const index = this._parentContainer.reflectionProbes.indexOf(this);-1 < index && this._parentContainer.reflectionProbes.splice(index, 1), this._parentContainer = null;}if (this._renderTargetTexture && (this._renderTargetTexture.dispose(), this._renderTargetTexture = null), this._sceneUBOs) {for (const ubo of this._sceneUBOs) ubo.dispose();this._sceneUBOs = [];}}toString(fullDetails) {let ret = "Name: " + this.name;return fullDetails && (ret += ", position: " + this.position.toString(), this._attachedMesh && (ret += ", attached mesh: " + this._attachedMesh.name)), ret;}getClassName() {return "ReflectionProbe";}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this, this._renderTargetTexture.serialize());return serializationObject.isReflectionProbe = !0, serializationObject.metadata = this.metadata, serializationObject;}static Parse(parsedReflectionProbe, scene, rootUrl) {let reflectionProbe = null;if (scene.reflectionProbes) for (let index = 0; index < scene.reflectionProbes.length; index++) {const rp = scene.reflectionProbes[index];if (rp.name === parsedReflectionProbe.name) {reflectionProbe = rp;break;}}return reflectionProbe = decorators/* SerializationHelper.Parse */.p4.Parse(() => reflectionProbe || new ReflectionProbe(parsedReflectionProbe.name, parsedReflectionProbe.renderTargetSize, scene, parsedReflectionProbe._generateMipMaps), parsedReflectionProbe, scene, rootUrl), reflectionProbe.cubeTexture._waitingRenderList = parsedReflectionProbe.renderList, parsedReflectionProbe._attachedMesh && reflectionProbe.attachToMesh(scene.getMeshById(parsedReflectionProbe._attachedMesh)), parsedReflectionProbe.metadata && (reflectionProbe.metadata = parsedReflectionProbe.metadata), reflectionProbe;}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsMeshReference */.RR)()], ReflectionProbe.prototype, "_attachedMesh", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsVector3 */.hd)()], ReflectionProbe.prototype, "position", void 0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Loading/Plugins/babylonFileLoader.js
var _BabylonLoaderRegistered = !0;class BabylonFileLoaderConfiguration {}BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine = void 0;let tempIndexContainer = {},tempMaterialIndexContainer = {};const parseMaterialByPredicate = (predicate, parsedData, scene, rootUrl) => {if (!parsedData.materials) return null;for (let index = 0, cache = parsedData.materials.length; index < cache; index++) {const parsedMaterial = parsedData.materials[index];if (predicate(parsedMaterial)) return { parsedMaterial, material: Materials_material/* Material.Parse */.F.Parse(parsedMaterial, scene, rootUrl) };}return null;},isDescendantOf = (mesh, names, hierarchyIds) => {for (const i in names) if (mesh.name === names[i]) return hierarchyIds.push(mesh.id), !0;return !(void 0 === mesh.parentId || -1 === hierarchyIds.indexOf(mesh.parentId)) && (hierarchyIds.push(mesh.id), !0);},logOperation = (operation, producer) => operation + " of " + (producer ? producer.file + " from " + producer.name + " version: " + producer.version + ", exporter version: " + producer.exporter_version : "unknown"),loadDetailLevels = (scene, mesh) => {const mastermesh = mesh;if (mesh._waitingData.lods) {if (mesh._waitingData.lods.ids && 0 < mesh._waitingData.lods.ids.length) {const lodmeshes = mesh._waitingData.lods.ids,wasenabled = mastermesh.isEnabled(!1);if (mesh._waitingData.lods.distances) {const distances = mesh._waitingData.lods.distances;if (distances.length >= lodmeshes.length) {const culling = distances.length > lodmeshes.length ? distances[distances.length - 1] : 0;mastermesh.setEnabled(!1);for (let index = 0; index < lodmeshes.length; index++) {const lodid = lodmeshes[index],lodmesh = scene.getMeshById(lodid);null != lodmesh && mastermesh.addLODLevel(distances[index], lodmesh);}0 < culling && mastermesh.addLODLevel(culling, null), !0 === wasenabled && mastermesh.setEnabled(!0);} else tools/* Tools.Warn */.w1.Warn("Invalid level of detail distances for " + mesh.name);}}mesh._waitingData.lods = null;}},findParent = (parentId, parentInstanceIndex, scene) => {if ("number" != typeof parentId) {const parentEntry = scene.getLastEntryById(parentId);if (parentEntry && parentInstanceIndex !== void 0 && null !== parentInstanceIndex) {const instance = parentEntry.instances[parseInt(parentInstanceIndex)];return instance;}return parentEntry;}const parent = tempIndexContainer[parentId];if (parent && parentInstanceIndex !== void 0 && null !== parentInstanceIndex) {const instance = parent.instances[parseInt(parentInstanceIndex)];return instance;}return parent;},findMaterial = (materialId, scene) => "number" == typeof materialId ? tempMaterialIndexContainer[materialId] : scene.getLastMaterialById(materialId, !0),loadAssetContainer = (scene, data, rootUrl, onError, addToScene = !1) => {const container = new assetContainer/* AssetContainer */.TJ(scene);let log = "importScene has failed JSON parse";try {var parsedData = JSON.parse(data);log = "";const fullDetails = sceneLoader/* SceneLoader.loggingLevel */.n.loggingLevel === sceneLoader/* SceneLoader.DETAILED_LOGGING */.n.DETAILED_LOGGING;let index, cache;if (void 0 !== parsedData.environmentTexture && null !== parsedData.environmentTexture) {const isPBR = void 0 === parsedData.isPBR || parsedData.isPBR;if (parsedData.environmentTextureType && "BABYLON.HDRCubeTexture" === parsedData.environmentTextureType) {const hdrSize = parsedData.environmentTextureSize ? parsedData.environmentTextureSize : 128,hdrTexture = new HDRCubeTexture((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene, hdrSize, !0, !isPBR, void 0, parsedData.environmentTexturePrefilterOnLoad);parsedData.environmentTextureRotationY && (hdrTexture.rotationY = parsedData.environmentTextureRotationY), scene.environmentTexture = hdrTexture;} else if ("object" == typeof parsedData.environmentTexture) {const environmentTexture = Textures_cubeTexture/* CubeTexture.Parse */.B.Parse(parsedData.environmentTexture, scene, rootUrl);scene.environmentTexture = environmentTexture;} else if (parsedData.environmentTexture.endsWith(".env")) {const compressedTexture = new Textures_cubeTexture/* CubeTexture */.B((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene, parsedData.environmentTextureForcedExtension);parsedData.environmentTextureRotationY && (compressedTexture.rotationY = parsedData.environmentTextureRotationY), scene.environmentTexture = compressedTexture;} else {const cubeTexture = Textures_cubeTexture/* CubeTexture.CreateFromPrefilteredData */.B.CreateFromPrefilteredData((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene, parsedData.environmentTextureForcedExtension);parsedData.environmentTextureRotationY && (cubeTexture.rotationY = parsedData.environmentTextureRotationY), scene.environmentTexture = cubeTexture;}if (!0 === parsedData.createDefaultSkybox) {const skyboxScale = void 0 !== scene.activeCamera && null !== scene.activeCamera ? (scene.activeCamera.maxZ - scene.activeCamera.minZ) / 2 : 1e3,skyboxBlurLevel = parsedData.skyboxBlurLevel || 0;scene.createDefaultSkybox(scene.environmentTexture, isPBR, skyboxScale, skyboxBlurLevel);}container.environmentTexture = scene.environmentTexture;}if (void 0 !== parsedData.environmentIntensity && null !== parsedData.environmentIntensity && (scene.environmentIntensity = parsedData.environmentIntensity), void 0 !== parsedData.lights && null !== parsedData.lights) for (index = 0, cache = parsedData.lights.length; index < cache; index++) {const parsedLight = parsedData.lights[index],light = Lights_light/* Light.Parse */._.Parse(parsedLight, scene);light && (tempIndexContainer[parsedLight.uniqueId] = light, container.lights.push(light), light._parentContainer = container, log += 0 === index ? "\n\tLights:" : "", log += "\n\t\t" + light.toString(fullDetails));}if (void 0 !== parsedData.reflectionProbes && null !== parsedData.reflectionProbes) for (index = 0, cache = parsedData.reflectionProbes.length; index < cache; index++) {const parsedReflectionProbe = parsedData.reflectionProbes[index],reflectionProbe = ReflectionProbe.Parse(parsedReflectionProbe, scene, rootUrl);reflectionProbe && (container.reflectionProbes.push(reflectionProbe), reflectionProbe._parentContainer = container, log += 0 === index ? "\n\tReflection Probes:" : "", log += "\n\t\t" + reflectionProbe.toString(fullDetails));}if (void 0 !== parsedData.animations && null !== parsedData.animations) for (index = 0, cache = parsedData.animations.length; index < cache; index++) {const parsedAnimation = parsedData.animations[index],internalClass = (0,typeStore/* GetClass */.q)("BABYLON.Animation");if (internalClass) {const animation = internalClass.Parse(parsedAnimation);scene.animations.push(animation), container.animations.push(animation), log += 0 === index ? "\n\tAnimations:" : "", log += "\n\t\t" + animation.toString(fullDetails);}}if (void 0 !== parsedData.materials && null !== parsedData.materials) for (index = 0, cache = parsedData.materials.length; index < cache; index++) {const parsedMaterial = parsedData.materials[index],mat = Materials_material/* Material.Parse */.F.Parse(parsedMaterial, scene, rootUrl);if (mat) {tempMaterialIndexContainer[parsedMaterial.uniqueId || parsedMaterial.id] = mat, container.materials.push(mat), mat._parentContainer = container, log += 0 === index ? "\n\tMaterials:" : "", log += "\n\t\t" + mat.toString(fullDetails);const textures = mat.getActiveTextures();textures.forEach((t) => {-1 == container.textures.indexOf(t) && (container.textures.push(t), t._parentContainer = container);});}}if (void 0 !== parsedData.multiMaterials && null !== parsedData.multiMaterials) for (index = 0, cache = parsedData.multiMaterials.length; index < cache; index++) {const parsedMultiMaterial = parsedData.multiMaterials[index],mmat = multiMaterial/* MultiMaterial.ParseMultiMaterial */.G.ParseMultiMaterial(parsedMultiMaterial, scene);tempMaterialIndexContainer[parsedMultiMaterial.uniqueId || parsedMultiMaterial.id] = mmat, container.multiMaterials.push(mmat), mmat._parentContainer = container, log += 0 === index ? "\n\tMultiMaterials:" : "", log += "\n\t\t" + mmat.toString(fullDetails);const textures = mmat.getActiveTextures();textures.forEach((t) => {-1 == container.textures.indexOf(t) && (container.textures.push(t), t._parentContainer = container);});}if (void 0 !== parsedData.morphTargetManagers && null !== parsedData.morphTargetManagers) for (const managerData of parsedData.morphTargetManagers) {const manager = morphTargetManager/* MorphTargetManager.Parse */.O.Parse(managerData, scene);container.morphTargetManagers.push(manager), manager._parentContainer = container;}if (void 0 !== parsedData.skeletons && null !== parsedData.skeletons) for (index = 0, cache = parsedData.skeletons.length; index < cache; index++) {const parsedSkeleton = parsedData.skeletons[index],skeleton = Bones_skeleton/* Skeleton.Parse */.O.Parse(parsedSkeleton, scene);container.skeletons.push(skeleton), skeleton._parentContainer = container, log += 0 === index ? "\n\tSkeletons:" : "", log += "\n\t\t" + skeleton.toString(fullDetails);}const geometries = parsedData.geometries;if (void 0 !== geometries && null !== geometries) {const addedGeometry = [],vertexData = geometries.vertexData;if (void 0 !== vertexData && null !== vertexData) for (index = 0, cache = vertexData.length; index < cache; index++) {const parsedVertexData = vertexData[index];addedGeometry.push(geometry/* Geometry.Parse */.Z.Parse(parsedVertexData, scene, rootUrl));}addedGeometry.forEach((g) => {g && (container.geometries.push(g), g._parentContainer = container);});}if (void 0 !== parsedData.transformNodes && null !== parsedData.transformNodes) for (index = 0, cache = parsedData.transformNodes.length; index < cache; index++) {const parsedTransformNode = parsedData.transformNodes[index],node = transformNode/* TransformNode.Parse */.Y.Parse(parsedTransformNode, scene, rootUrl);tempIndexContainer[parsedTransformNode.uniqueId] = node, container.transformNodes.push(node), node._parentContainer = container;}if (void 0 !== parsedData.meshes && null !== parsedData.meshes) for (index = 0, cache = parsedData.meshes.length; index < cache; index++) {const parsedMesh = parsedData.meshes[index],mesh = Meshes_mesh/* Mesh.Parse */.Kj.Parse(parsedMesh, scene, rootUrl);if (tempIndexContainer[parsedMesh.uniqueId] = mesh, container.meshes.push(mesh), mesh._parentContainer = container, mesh.hasInstances) for (const instance of mesh.instances) container.meshes.push(instance), instance._parentContainer = container;log += 0 === index ? "\n\tMeshes:" : "", log += "\n\t\t" + mesh.toString(fullDetails);}if (void 0 !== parsedData.cameras && null !== parsedData.cameras) for (index = 0, cache = parsedData.cameras.length; index < cache; index++) {const parsedCamera = parsedData.cameras[index],camera = Cameras_camera/* Camera.Parse */.V.Parse(parsedCamera, scene);tempIndexContainer[parsedCamera.uniqueId] = camera, container.cameras.push(camera), camera._parentContainer = container, log += 0 === index ? "\n\tCameras:" : "", log += "\n\t\t" + camera.toString(fullDetails);}if (void 0 !== parsedData.postProcesses && null !== parsedData.postProcesses) for (index = 0, cache = parsedData.postProcesses.length; index < cache; index++) {const parsedPostProcess = parsedData.postProcesses[index],postProcess = PostProcesses_postProcess/* PostProcess.Parse */.D.Parse(parsedPostProcess, scene, rootUrl);postProcess && (container.postProcesses.push(postProcess), postProcess._parentContainer = container, log += 0 === index ? "\nPostprocesses:" : "", log += "\n\t\t" + postProcess.toString());}if (void 0 !== parsedData.animationGroups && null !== parsedData.animationGroups) for (index = 0, cache = parsedData.animationGroups.length; index < cache; index++) {const parsedAnimationGroup = parsedData.animationGroups[index],animationGroup = Animations_animationGroup/* AnimationGroup.Parse */.O.Parse(parsedAnimationGroup, scene);container.animationGroups.push(animationGroup), animationGroup._parentContainer = container, log += 0 === index ? "\n\tAnimationGroups:" : "", log += "\n\t\t" + animationGroup.toString(fullDetails);}for (index = 0, cache = scene.cameras.length; index < cache; index++) {const camera = scene.cameras[index];null !== camera._waitingParentId && (camera.parent = findParent(camera._waitingParentId, camera._waitingParentInstanceIndex, scene), camera._waitingParentId = null, camera._waitingParentInstanceIndex = null);}for (index = 0, cache = scene.lights.length; index < cache; index++) {const light = scene.lights[index];light && null !== light._waitingParentId && (light.parent = findParent(light._waitingParentId, light._waitingParentInstanceIndex, scene), light._waitingParentId = null, light._waitingParentInstanceIndex = null);}for (index = 0, cache = scene.transformNodes.length; index < cache; index++) {const transformNode = scene.transformNodes[index];null !== transformNode._waitingParentId && (transformNode.parent = findParent(transformNode._waitingParentId, transformNode._waitingParentInstanceIndex, scene), transformNode._waitingParentId = null, transformNode._waitingParentInstanceIndex = null);}for (index = 0, cache = scene.meshes.length; index < cache; index++) {const mesh = scene.meshes[index];null !== mesh._waitingParentId && (mesh.parent = findParent(mesh._waitingParentId, mesh._waitingParentInstanceIndex, scene), mesh._waitingParentId = null, mesh._waitingParentInstanceIndex = null), mesh._waitingData.lods && loadDetailLevels(scene, mesh);}for (scene.multiMaterials.forEach((multimat) => {multimat._waitingSubMaterialsUniqueIds.forEach((subMaterial) => {multimat.subMaterials.push(findMaterial(subMaterial, scene));}), multimat._waitingSubMaterialsUniqueIds = [];}), scene.meshes.forEach((mesh) => {null !== mesh._waitingMaterialId && (mesh.material = findMaterial(mesh._waitingMaterialId, scene), mesh._waitingMaterialId = null);}), (index = 0, cache = scene.skeletons.length); index < cache; index++) {const skeleton = scene.skeletons[index];skeleton._hasWaitingData && (null != skeleton.bones && skeleton.bones.forEach((bone) => {if (bone._waitingTransformNodeId) {const linkTransformNode = scene.getLastEntryById(bone._waitingTransformNodeId);linkTransformNode && bone.linkTransformNode(linkTransformNode), bone._waitingTransformNodeId = null;}}), skeleton._hasWaitingData = null);}for (index = 0, cache = scene.meshes.length; index < cache; index++) {const currentMesh = scene.meshes[index];currentMesh._waitingData.freezeWorldMatrix ? (currentMesh.freezeWorldMatrix(), currentMesh._waitingData.freezeWorldMatrix = null) : currentMesh.computeWorldMatrix(!0);}for (index = 0, cache = scene.lights.length; index < cache; index++) {const light = scene.lights[index];if (0 < light._excludedMeshesIds.length) {for (let excludedIndex = 0; excludedIndex < light._excludedMeshesIds.length; excludedIndex++) {const excludedMesh = scene.getMeshById(light._excludedMeshesIds[excludedIndex]);excludedMesh && light.excludedMeshes.push(excludedMesh);}light._excludedMeshesIds = [];}if (0 < light._includedOnlyMeshesIds.length) {for (let includedOnlyIndex = 0; includedOnlyIndex < light._includedOnlyMeshesIds.length; includedOnlyIndex++) {const includedOnlyMesh = scene.getMeshById(light._includedOnlyMeshesIds[includedOnlyIndex]);includedOnlyMesh && light.includedOnlyMeshes.push(includedOnlyMesh);}light._includedOnlyMeshesIds = [];}}for (scene.geometries.forEach((g) => {g._loadedUniqueId = "";}), abstractScene/* AbstractScene.Parse */.p.Parse(parsedData, scene, container, rootUrl), (index = 0, cache = scene.meshes.length); index < cache; index++) {const mesh = scene.meshes[index];mesh._waitingData.actions && (ActionManager.Parse(mesh._waitingData.actions, mesh, scene), mesh._waitingData.actions = null);}void 0 !== parsedData.actions && null !== parsedData.actions && ActionManager.Parse(parsedData.actions, null, scene);} catch (err) {const msg = logOperation("loadAssets", parsedData ? parsedData.producer : "Unknown") + log;if (onError) onError(msg, err);else throw logger/* Logger.Log */.Y.Log(msg), err;} finally {tempIndexContainer = {}, tempMaterialIndexContainer = {}, addToScene || container.removeAllFromScene(), null !== log && sceneLoader/* SceneLoader.loggingLevel */.n.loggingLevel !== sceneLoader/* SceneLoader.NO_LOGGING */.n.NO_LOGGING && logger/* Logger.Log */.Y.Log(logOperation("loadAssets", parsedData ? parsedData.producer : "Unknown") + (sceneLoader/* SceneLoader.loggingLevel */.n.loggingLevel === sceneLoader/* SceneLoader.MINIMAL_LOGGING */.n.MINIMAL_LOGGING ? "" : log));}return container;};sceneLoader/* SceneLoader.RegisterPlugin */.n.RegisterPlugin({ name: "babylon.js", extensions: ".babylon", canDirectLoad: (data) => -1 !== data.indexOf("babylon"), importMesh: (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons, onError) => {var _a;let log = "importMesh has failed JSON parse";try {var parsedData = JSON.parse(data);log = "";const fullDetails = sceneLoader/* SceneLoader.loggingLevel */.n.loggingLevel === sceneLoader/* SceneLoader.DETAILED_LOGGING */.n.DETAILED_LOGGING;meshesNames ? !Array.isArray(meshesNames) && (meshesNames = [meshesNames]) : meshesNames = null;const hierarchyIds = [],parsedIdToNodeMap = new Map(),loadedTransformNodes = [];if (void 0 !== parsedData.transformNodes && null !== parsedData.transformNodes) for (let index = 0, cache = parsedData.transformNodes.length; index < cache; index++) {const parsedJSONTransformNode = parsedData.transformNodes[index],parsedTransformNode = transformNode/* TransformNode.Parse */.Y.Parse(parsedJSONTransformNode, scene, rootUrl);loadedTransformNodes.push(parsedTransformNode), parsedIdToNodeMap.set(parsedTransformNode._waitingParsedUniqueId, parsedTransformNode), parsedTransformNode._waitingParsedUniqueId = null;}if (void 0 !== parsedData.meshes && null !== parsedData.meshes) {const loadedSkeletonsIds = [],loadedMaterialsIds = [],loadedMaterialsUniqueIds = [],loadedMorphTargetsIds = [];for (let index = 0, cache = parsedData.meshes.length; index < cache; index++) {const parsedMesh = parsedData.meshes[index];if (null === meshesNames || isDescendantOf(parsedMesh, meshesNames, hierarchyIds)) {if (null !== meshesNames && delete meshesNames[meshesNames.indexOf(parsedMesh.name)], void 0 !== parsedMesh.geometryId && null !== parsedMesh.geometryId && void 0 !== parsedData.geometries && null !== parsedData.geometries) {let found = !1;["boxes", "spheres", "cylinders", "toruses", "grounds", "planes", "torusKnots", "vertexData"].forEach((geometryType) => {!0 !== found && parsedData.geometries[geometryType] && Array.isArray(parsedData.geometries[geometryType]) && parsedData.geometries[geometryType].forEach((parsedGeometryData) => {parsedGeometryData.id === parsedMesh.geometryId && ("vertexData" === geometryType ? geometry/* Geometry.Parse */.Z.Parse(parsedGeometryData, scene, rootUrl) : void 0, found = !0);});}), !1 == found && logger/* Logger.Warn */.Y.Warn("Geometry not found for mesh " + parsedMesh.id);}if (parsedMesh.materialUniqueId || parsedMesh.materialId) {const materialArray = parsedMesh.materialUniqueId ? loadedMaterialsUniqueIds : loadedMaterialsIds;let materialFound = -1 !== materialArray.indexOf(parsedMesh.materialUniqueId || parsedMesh.materialId);if (!1 == materialFound && void 0 !== parsedData.multiMaterials && null !== parsedData.multiMaterials) {const loadSubMaterial = (subMatId, predicate) => {materialArray.push(subMatId);const mat = parseMaterialByPredicate(predicate, parsedData, scene, rootUrl);mat && mat.material && (tempMaterialIndexContainer[mat.parsedMaterial.uniqueId || mat.parsedMaterial.id] = mat.material, log += "\n\tMaterial " + mat.material.toString(fullDetails));};for (let multimatIndex = 0, multimatCache = parsedData.multiMaterials.length; multimatIndex < multimatCache; multimatIndex++) {const parsedMultiMaterial = parsedData.multiMaterials[multimatIndex];if (parsedMesh.materialUniqueId && parsedMultiMaterial.uniqueId === parsedMesh.materialUniqueId || parsedMultiMaterial.id === parsedMesh.materialId) {parsedMultiMaterial.materialsUniqueIds ? parsedMultiMaterial.materialsUniqueIds.forEach((subMatId) => loadSubMaterial(subMatId, (parsedMaterial) => parsedMaterial.uniqueId === subMatId)) : parsedMultiMaterial.materials.forEach((subMatId) => loadSubMaterial(subMatId, (parsedMaterial) => parsedMaterial.id === subMatId)), materialArray.push(parsedMultiMaterial.uniqueId || parsedMultiMaterial.id);const mmat = multiMaterial/* MultiMaterial.ParseMultiMaterial */.G.ParseMultiMaterial(parsedMultiMaterial, scene);tempMaterialIndexContainer[parsedMultiMaterial.uniqueId || parsedMultiMaterial.id] = mmat, mmat && (materialFound = !0, log += "\n\tMulti-Material " + mmat.toString(fullDetails));break;}}}if (!1 == materialFound) {materialArray.push(parsedMesh.materialUniqueId || parsedMesh.materialId);const mat = parseMaterialByPredicate((parsedMaterial) => parsedMesh.materialUniqueId && parsedMaterial.uniqueId === parsedMesh.materialUniqueId || parsedMaterial.id === parsedMesh.materialId, parsedData, scene, rootUrl);mat && mat.material ? (tempMaterialIndexContainer[mat.parsedMaterial.uniqueId || mat.parsedMaterial.id] = mat.material, log += "\n\tMaterial " + mat.material.toString(fullDetails)) : logger/* Logger.Warn */.Y.Warn("Material not found for mesh " + parsedMesh.id);}}if (-1 < parsedMesh.skeletonId && void 0 !== parsedData.skeletons && null !== parsedData.skeletons) {const skeletonAlreadyLoaded = -1 < loadedSkeletonsIds.indexOf(parsedMesh.skeletonId);if (!skeletonAlreadyLoaded) for (let skeletonIndex = 0, skeletonCache = parsedData.skeletons.length; skeletonIndex < skeletonCache; skeletonIndex++) {const parsedSkeleton = parsedData.skeletons[skeletonIndex];if (parsedSkeleton.id === parsedMesh.skeletonId) {const skeleton = Bones_skeleton/* Skeleton.Parse */.O.Parse(parsedSkeleton, scene);skeletons.push(skeleton), loadedSkeletonsIds.push(parsedSkeleton.id), log += "\n\tSkeleton " + skeleton.toString(fullDetails);}}}if (-1 < parsedMesh.morphTargetManagerId && void 0 !== parsedData.morphTargetManagers && null !== parsedData.morphTargetManagers) {const morphTargetAlreadyLoaded = -1 < loadedMorphTargetsIds.indexOf(parsedMesh.morphTargetManagerId);if (!morphTargetAlreadyLoaded) for (let morphTargetIndex = 0, morphTargetCache = parsedData.morphTargetManagers.length; morphTargetIndex < morphTargetCache; morphTargetIndex++) {const parsedMorphTarget = parsedData.morphTargetManagers[morphTargetIndex];if (parsedMorphTarget.id === parsedMesh.morphTargetManagerId) {const morphTarget = morphTargetManager/* MorphTargetManager.Parse */.O.Parse(parsedMorphTarget, scene);loadedMorphTargetsIds.push(morphTarget.uniqueId), log += "\nMorph target " + morphTarget.toString();}}}const mesh = Meshes_mesh/* Mesh.Parse */.Kj.Parse(parsedMesh, scene, rootUrl);meshes.push(mesh), parsedIdToNodeMap.set(mesh._waitingParsedUniqueId, mesh), mesh._waitingParsedUniqueId = null, log += "\n\tMesh " + mesh.toString(fullDetails);}}scene.multiMaterials.forEach((multimat) => {multimat._waitingSubMaterialsUniqueIds.forEach((subMaterial) => {multimat.subMaterials.push(findMaterial(subMaterial, scene));}), multimat._waitingSubMaterialsUniqueIds = [];}), scene.meshes.forEach((mesh) => {null !== mesh._waitingMaterialId && (mesh.material = findMaterial(mesh._waitingMaterialId, scene), mesh._waitingMaterialId = null);});for (let index = 0, cache = scene.transformNodes.length; index < cache; index++) {const transformNode = scene.transformNodes[index];if (null !== transformNode._waitingParentId) {let parent = parsedIdToNodeMap.get(parseInt(transformNode._waitingParentId)) || null;null === parent && (parent = scene.getLastEntryById(transformNode._waitingParentId));let parentNode = parent;transformNode._waitingParentInstanceIndex && (parentNode = parent.instances[parseInt(transformNode._waitingParentInstanceIndex)], transformNode._waitingParentInstanceIndex = null), transformNode.parent = parentNode, transformNode._waitingParentId = null;}}let currentMesh;for (let index = 0, cache = scene.meshes.length; index < cache; index++) {if (currentMesh = scene.meshes[index], currentMesh._waitingParentId) {let parent = parsedIdToNodeMap.get(parseInt(currentMesh._waitingParentId)) || null;null === parent && (parent = scene.getLastEntryById(currentMesh._waitingParentId));let parentNode = parent;if (currentMesh._waitingParentInstanceIndex && (parentNode = parent.instances[parseInt(currentMesh._waitingParentInstanceIndex)], currentMesh._waitingParentInstanceIndex = null), currentMesh.parent = parentNode, "TransformNode" === (null === (_a = currentMesh.parent) || void 0 === _a ? void 0 : _a.getClassName())) {const loadedTransformNodeIndex = loadedTransformNodes.indexOf(currentMesh.parent);-1 < loadedTransformNodeIndex && loadedTransformNodes.splice(loadedTransformNodeIndex, 1);}currentMesh._waitingParentId = null;}currentMesh._waitingData.lods && loadDetailLevels(scene, currentMesh);}for (const transformNode of loadedTransformNodes) transformNode.dispose();for (let index = 0, cache = scene.skeletons.length; index < cache; index++) {const skeleton = scene.skeletons[index];skeleton._hasWaitingData && (null != skeleton.bones && skeleton.bones.forEach((bone) => {if (bone._waitingTransformNodeId) {const linkTransformNode = scene.getLastEntryById(bone._waitingTransformNodeId);linkTransformNode && bone.linkTransformNode(linkTransformNode), bone._waitingTransformNodeId = null;}}), skeleton._hasWaitingData = null);}for (let index = 0, cache = scene.meshes.length; index < cache; index++) currentMesh = scene.meshes[index], currentMesh._waitingData.freezeWorldMatrix ? (currentMesh.freezeWorldMatrix(), currentMesh._waitingData.freezeWorldMatrix = null) : currentMesh.computeWorldMatrix(!0);}if (void 0 !== parsedData.particleSystems && null !== parsedData.particleSystems) {const parser = abstractScene/* AbstractScene.GetIndividualParser */.p.GetIndividualParser(sceneComponent/* SceneComponentConstants.NAME_PARTICLESYSTEM */.l.NAME_PARTICLESYSTEM);if (parser) for (let index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {const parsedParticleSystem = parsedData.particleSystems[index];-1 !== hierarchyIds.indexOf(parsedParticleSystem.emitterId) && particleSystems.push(parser(parsedParticleSystem, scene, rootUrl));}}return scene.geometries.forEach((g) => {g._loadedUniqueId = "";}), !0;} catch (err) {const msg = logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + log;if (onError) onError(msg, err);else throw logger/* Logger.Log */.Y.Log(msg), err;} finally {null !== log && sceneLoader/* SceneLoader.loggingLevel */.n.loggingLevel !== sceneLoader/* SceneLoader.NO_LOGGING */.n.NO_LOGGING && logger/* Logger.Log */.Y.Log(logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + (sceneLoader/* SceneLoader.loggingLevel */.n.loggingLevel === sceneLoader/* SceneLoader.MINIMAL_LOGGING */.n.MINIMAL_LOGGING ? "" : log));}return !1;}, load: (scene, data, rootUrl, onError) => {let log = "importScene has failed JSON parse";try {var parsedData = JSON.parse(data);if (log = "", void 0 !== parsedData.useDelayedTextureLoading && null !== parsedData.useDelayedTextureLoading && (scene.useDelayedTextureLoading = parsedData.useDelayedTextureLoading && !sceneLoader/* SceneLoader.ForceFullSceneLoadingForIncremental */.n.ForceFullSceneLoadingForIncremental), void 0 !== parsedData.autoClear && null !== parsedData.autoClear && (scene.autoClear = parsedData.autoClear), void 0 !== parsedData.clearColor && null !== parsedData.clearColor && (scene.clearColor = math_color/* Color4.FromArray */.HE.FromArray(parsedData.clearColor)), void 0 !== parsedData.ambientColor && null !== parsedData.ambientColor && (scene.ambientColor = math_color/* Color3.FromArray */.Wo.FromArray(parsedData.ambientColor)), void 0 !== parsedData.gravity && null !== parsedData.gravity && (scene.gravity = math_vector/* Vector3.FromArray */.P.FromArray(parsedData.gravity)), void 0 !== parsedData.useRightHandedSystem && (scene.useRightHandedSystem = !!parsedData.useRightHandedSystem), parsedData.fogMode && 0 !== parsedData.fogMode) switch (scene.fogMode = parsedData.fogMode, scene.fogColor = math_color/* Color3.FromArray */.Wo.FromArray(parsedData.fogColor), scene.fogStart = parsedData.fogStart, scene.fogEnd = parsedData.fogEnd, scene.fogDensity = parsedData.fogDensity, log += "\tFog mode for scene:  ", scene.fogMode) {case 1:log += "exp\n";break;case 2:log += "exp2\n";break;case 3:log += "linear\n";}if (parsedData.physicsEnabled) {let physicsPlugin;"cannon" === parsedData.physicsEngine || parsedData.physicsEngine === CannonJSPlugin.name ? physicsPlugin = new CannonJSPlugin(void 0, void 0, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine) : "oimo" === parsedData.physicsEngine || parsedData.physicsEngine === OimoJSPlugin.name ? physicsPlugin = new OimoJSPlugin(void 0, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine) : ("ammo" === parsedData.physicsEngine || parsedData.physicsEngine === AmmoJSPlugin.name) && (physicsPlugin = new AmmoJSPlugin(void 0, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine, void 0)), log = "\tPhysics engine " + (parsedData.physicsEngine ? parsedData.physicsEngine : "oimo") + " enabled\n";const physicsGravity = parsedData.physicsGravity ? math_vector/* Vector3.FromArray */.P.FromArray(parsedData.physicsGravity) : null;scene.enablePhysics(physicsGravity, physicsPlugin);}void 0 !== parsedData.metadata && null !== parsedData.metadata && (scene.metadata = parsedData.metadata), void 0 !== parsedData.collisionsEnabled && null !== parsedData.collisionsEnabled && (scene.collisionsEnabled = parsedData.collisionsEnabled);const container = loadAssetContainer(scene, data, rootUrl, onError, !0);return !!container && (parsedData.autoAnimate && scene.beginAnimation(scene, parsedData.autoAnimateFrom, parsedData.autoAnimateTo, parsedData.autoAnimateLoop, parsedData.autoAnimateSpeed || 1), void 0 !== parsedData.activeCameraID && null !== parsedData.activeCameraID && scene.setActiveCameraById(parsedData.activeCameraID), !0);} catch (err) {const msg = logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + log;if (onError) onError(msg, err);else throw logger/* Logger.Log */.Y.Log(msg), err;} finally {null !== log && sceneLoader/* SceneLoader.loggingLevel */.n.loggingLevel !== sceneLoader/* SceneLoader.NO_LOGGING */.n.NO_LOGGING && logger/* Logger.Log */.Y.Log(logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + (sceneLoader/* SceneLoader.loggingLevel */.n.loggingLevel === sceneLoader/* SceneLoader.MINIMAL_LOGGING */.n.MINIMAL_LOGGING ? "" : log));}return !1;}, loadAssetContainer: (scene, data, rootUrl, onError) => {const container = loadAssetContainer(scene, data, rootUrl, onError);return container;} });
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Loading/Plugins/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Loading/sceneLoaderFlags.js
var sceneLoaderFlags = __webpack_require__("./node_modules/@babylonjs/core/Loading/sceneLoaderFlags.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Loading/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Background/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/colorCurves.js
var colorCurves = __webpack_require__("./node_modules/@babylonjs/core/Materials/colorCurves.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/iEffectFallbacks.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/fresnelParameters.js
class FresnelParameters {get isEnabled() {return this._isEnabled;}set isEnabled(value) {this._isEnabled === value || (this._isEnabled = value, engine/* Engine.MarkAllMaterialsAsDirty */.D.MarkAllMaterialsAsDirty(20));}constructor(options = {}) {this._isEnabled = !0, this.bias = options.bias === void 0 ? 0 : options.bias, this.power = options.power === void 0 ? 1 : options.power, this.leftColor = options.leftColor || math_color/* Color3.White */.Wo.White(), this.rightColor = options.rightColor || math_color/* Color3.Black */.Wo.Black(), !1 === options.isEnabled && (this.isEnabled = !1);}clone() {const newFresnelParameters = new FresnelParameters();return deepCopier/* DeepCopier.DeepCopy */.j.DeepCopy(this, newFresnelParameters), newFresnelParameters;}equals(otherFresnelParameters) {return otherFresnelParameters && this.bias === otherFresnelParameters.bias && this.power === otherFresnelParameters.power && this.leftColor.equals(otherFresnelParameters.leftColor) && this.rightColor.equals(otherFresnelParameters.rightColor) && this.isEnabled === otherFresnelParameters.isEnabled;}serialize() {return { isEnabled: this.isEnabled, leftColor: this.leftColor.asArray(), rightColor: this.rightColor.asArray(), bias: this.bias, power: this.power };}static Parse(parsedFresnelParameters) {return new FresnelParameters({ isEnabled: parsedFresnelParameters.isEnabled, leftColor: math_color/* Color3.FromArray */.Wo.FromArray(parsedFresnelParameters.leftColor), rightColor: math_color/* Color3.FromArray */.Wo.FromArray(parsedFresnelParameters.rightColor), bias: parsedFresnelParameters.bias, power: parsedFresnelParameters.power || 1 });}}decorators/* SerializationHelper._FresnelParametersParser */.p4._FresnelParametersParser = FresnelParameters.Parse;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Occlusion/occlusionMaterial.js
class OcclusionMaterial extends shaderMaterial/* ShaderMaterial */.j {constructor(name, scene) {super(name, scene, "color", { attributes: ["position"], uniforms: ["world", "viewProjection", "color"] }), this.disableColorWrite = !0, this.forceDepthWrite = !0, this.setColor4("color", new math_color/* Color4 */.HE(0, 0, 0, 1));}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Occlusion/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrAnisotropicConfiguration.js
var pbrAnisotropicConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrAnisotropicConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrBaseMaterial.js + 36 modules
var pbrBaseMaterial = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrBaseMaterial.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrBaseSimpleMaterial.js
class PBRBaseSimpleMaterial extends pbrBaseMaterial/* PBRBaseMaterial */.m {get doubleSided() {return this._twoSidedLighting;}set doubleSided(value) {this._twoSidedLighting === value || (this._twoSidedLighting = value, this.backFaceCulling = !value, this._markAllSubMeshesAsTexturesDirty());}constructor(name, scene) {super(name, scene), this.maxSimultaneousLights = 4, this.disableLighting = !1, this.invertNormalMapX = !1, this.invertNormalMapY = !1, this.emissiveColor = new math_color/* Color3 */.Wo(0, 0, 0), this.occlusionStrength = 1, this.useLightmapAsShadowmap = !1, this._useAlphaFromAlbedoTexture = !0, this._useAmbientInGrayScale = !0;}getClassName() {return "PBRBaseSimpleMaterial";}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsLightsDirty")], PBRBaseSimpleMaterial.prototype, "maxSimultaneousLights", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsLightsDirty")], PBRBaseSimpleMaterial.prototype, "disableLighting", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_reflectionTexture")], PBRBaseSimpleMaterial.prototype, "environmentTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], PBRBaseSimpleMaterial.prototype, "invertNormalMapX", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], PBRBaseSimpleMaterial.prototype, "invertNormalMapY", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_bumpTexture")], PBRBaseSimpleMaterial.prototype, "normalTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)("emissive"), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], PBRBaseSimpleMaterial.prototype, "emissiveColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], PBRBaseSimpleMaterial.prototype, "emissiveTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_ambientTextureStrength")], PBRBaseSimpleMaterial.prototype, "occlusionStrength", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_ambientTexture")], PBRBaseSimpleMaterial.prototype, "occlusionTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_alphaCutOff")], PBRBaseSimpleMaterial.prototype, "alphaCutOff", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], PBRBaseSimpleMaterial.prototype, "doubleSided", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", null)], PBRBaseSimpleMaterial.prototype, "lightmapTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], PBRBaseSimpleMaterial.prototype, "useLightmapAsShadowmap", void 0);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrClearCoatConfiguration.js
var pbrClearCoatConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrClearCoatConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrIridescenceConfiguration.js
var pbrIridescenceConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrIridescenceConfiguration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrMetallicRoughnessMaterial.js
class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial {constructor(name, scene) {super(name, scene), this._useRoughnessFromMetallicTextureAlpha = !1, this._useRoughnessFromMetallicTextureGreen = !0, this._useMetallnessFromMetallicTextureBlue = !0, this.metallic = 1, this.roughness = 1;}getClassName() {return "PBRMetallicRoughnessMaterial";}clone(name) {const clone = decorators/* SerializationHelper.Clone */.p4.Clone(() => new PBRMetallicRoughnessMaterial(name, this.getScene()), this);return clone.id = name, clone.name = name, this.clearCoat.copyTo(clone.clearCoat), this.anisotropy.copyTo(clone.anisotropy), this.brdf.copyTo(clone.brdf), this.sheen.copyTo(clone.sheen), this.subSurface.copyTo(clone.subSurface), clone;}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this);return serializationObject.customType = "BABYLON.PBRMetallicRoughnessMaterial", serializationObject.clearCoat = this.clearCoat.serialize(), serializationObject.anisotropy = this.anisotropy.serialize(), serializationObject.brdf = this.brdf.serialize(), serializationObject.sheen = this.sheen.serialize(), serializationObject.subSurface = this.subSurface.serialize(), serializationObject.iridescence = this.iridescence.serialize(), serializationObject;}static Parse(source, scene, rootUrl) {const material = decorators/* SerializationHelper.Parse */.p4.Parse(() => new PBRMetallicRoughnessMaterial(source.name, scene), source, scene, rootUrl);return source.clearCoat && material.clearCoat.parse(source.clearCoat, scene, rootUrl), source.anisotropy && material.anisotropy.parse(source.anisotropy, scene, rootUrl), source.brdf && material.brdf.parse(source.brdf, scene, rootUrl), source.sheen && material.sheen.parse(source.sheen, scene, rootUrl), source.subSurface && material.subSurface.parse(source.subSurface, scene, rootUrl), source.iridescence && material.iridescence.parse(source.iridescence, scene, rootUrl), material;}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_albedoColor")], PBRMetallicRoughnessMaterial.prototype, "baseColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_albedoTexture")], PBRMetallicRoughnessMaterial.prototype, "baseTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], PBRMetallicRoughnessMaterial.prototype, "metallic", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty")], PBRMetallicRoughnessMaterial.prototype, "roughness", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_metallicTexture")], PBRMetallicRoughnessMaterial.prototype, "metallicRoughnessTexture", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.PBRMetallicRoughnessMaterial", PBRMetallicRoughnessMaterial);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrSpecularGlossinessMaterial.js
class PBRSpecularGlossinessMaterial extends PBRBaseSimpleMaterial {get useMicroSurfaceFromReflectivityMapAlpha() {return this._useMicroSurfaceFromReflectivityMapAlpha;}constructor(name, scene) {super(name, scene), this._useMicroSurfaceFromReflectivityMapAlpha = !0;}getClassName() {return "PBRSpecularGlossinessMaterial";}clone(name) {const clone = decorators/* SerializationHelper.Clone */.p4.Clone(() => new PBRSpecularGlossinessMaterial(name, this.getScene()), this);return clone.id = name, clone.name = name, this.clearCoat.copyTo(clone.clearCoat), this.anisotropy.copyTo(clone.anisotropy), this.brdf.copyTo(clone.brdf), this.sheen.copyTo(clone.sheen), this.subSurface.copyTo(clone.subSurface), clone;}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this);return serializationObject.customType = "BABYLON.PBRSpecularGlossinessMaterial", serializationObject.clearCoat = this.clearCoat.serialize(), serializationObject.anisotropy = this.anisotropy.serialize(), serializationObject.brdf = this.brdf.serialize(), serializationObject.sheen = this.sheen.serialize(), serializationObject.subSurface = this.subSurface.serialize(), serializationObject.iridescence = this.iridescence.serialize(), serializationObject;}static Parse(source, scene, rootUrl) {const material = decorators/* SerializationHelper.Parse */.p4.Parse(() => new PBRSpecularGlossinessMaterial(source.name, scene), source, scene, rootUrl);return source.clearCoat && material.clearCoat.parse(source.clearCoat, scene, rootUrl), source.anisotropy && material.anisotropy.parse(source.anisotropy, scene, rootUrl), source.brdf && material.brdf.parse(source.brdf, scene, rootUrl), source.sheen && material.sheen.parse(source.sheen, scene, rootUrl), source.subSurface && material.subSurface.parse(source.subSurface, scene, rootUrl), source.iridescence && material.iridescence.parse(source.iridescence, scene, rootUrl), material;}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)("diffuse"), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_albedoColor")], PBRSpecularGlossinessMaterial.prototype, "diffuseColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_albedoTexture")], PBRSpecularGlossinessMaterial.prototype, "diffuseTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsColor3 */.n9)("specular"), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_reflectivityColor")], PBRSpecularGlossinessMaterial.prototype, "specularColor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_microSurface")], PBRSpecularGlossinessMaterial.prototype, "glossiness", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)(), (0,decorators/* expandToProperty */.wz)("_markAllSubMeshesAsTexturesDirty", "_reflectivityTexture")], PBRSpecularGlossinessMaterial.prototype, "specularGlossinessTexture", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.PBRSpecularGlossinessMaterial", PBRSpecularGlossinessMaterial);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrSheenConfiguration.js
var pbrSheenConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrSheenConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrSubSurfaceConfiguration.js
var pbrSubSurfaceConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrSubSurfaceConfiguration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/PBR/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/colorGradingTexture.js
class ColorGradingTexture extends baseTexture/* BaseTexture */.V {constructor(url, sceneOrEngine, onLoad = null) {if (super(sceneOrEngine), !!url) if (this._textureMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this.name = url, this.url = url, this._onLoad = onLoad, this._texture = this._getFromCache(url, !0), !this._texture) {const scene = this.getScene();scene ? scene.useDelayedTextureLoading ? this.delayLoadState = 4 : this._loadTexture() : this._loadTexture();} else this._triggerOnLoad();}_triggerOnLoad() {this._onLoad && this._onLoad();}getTextureMatrix() {return this._textureMatrix;}_load3dlTexture() {const engine = this._getEngine();let texture;texture = engine._features.support3DTextures ? engine.createRawTexture3D(null, 1, 1, 1, 5, !1, !1, 2, null, 0) : engine.createRawTexture(null, 1, 1, 5, !1, !1, 2, null, 0), this._texture = texture, this._texture.isReady = !1, this.isCube = !1, this.is3D = engine._features.support3DTextures, this.wrapU = 0, this.wrapV = 0, this.wrapR = 0, this.anisotropicFilteringLevel = 1;const callback = (text) => {if ("string" != typeof text) return;let line,data = null,tempData = null;const lines = text.split("\n");let size = 0,pixelIndexW = 0,pixelIndexH = 0,pixelIndexSlice = 0,maxColor = 0;for (let i = 0; i < lines.length; i++) {if (line = lines[i], !ColorGradingTexture._NoneEmptyLineRegex.test(line)) continue;if (0 === line.indexOf("#")) continue;const words = line.split(" ");if (0 === size) {size = words.length, data = new Uint8Array(4 * (size * size * size)), tempData = new Float32Array(4 * (size * size * size));continue;}if (0 != size) {const r = Math.max(parseInt(words[0]), 0),g = Math.max(parseInt(words[1]), 0),b = Math.max(parseInt(words[2]), 0);maxColor = Math.max(r, maxColor), maxColor = Math.max(g, maxColor), maxColor = Math.max(b, maxColor);const pixelStorageIndex = 4 * (pixelIndexW + pixelIndexSlice * size + pixelIndexH * size * size);tempData && (tempData[pixelStorageIndex + 0] = r, tempData[pixelStorageIndex + 1] = g, tempData[pixelStorageIndex + 2] = b), pixelIndexH++, 0 == pixelIndexH % size && (pixelIndexSlice++, pixelIndexH = 0, 0 == pixelIndexSlice % size && (pixelIndexW++, pixelIndexSlice = 0));}}if (tempData && data) for (let i = 0; i < tempData.length; i++) if (0 < i && 0 == (i + 1) % 4) data[i] = 255;else {const value = tempData[i];data[i] = 255 * (value / maxColor);}texture.is3D ? (texture.updateSize(size, size, size), engine.updateRawTexture3D(texture, data, 5, !1)) : (texture.updateSize(size * size, size), engine.updateRawTexture(texture, data, 5, !1)), texture.isReady = !0, this._triggerOnLoad();},scene = this.getScene();return scene ? scene._loadFile(this.url, callback) : engine._loadFile(this.url, callback), this._texture;}_loadTexture() {this.url && this.url.toLocaleLowerCase().indexOf(".3dl") == this.url.length - 4 && this._load3dlTexture();}clone() {const newTexture = new ColorGradingTexture(this.url, this.getScene() || this._getEngine());return newTexture.level = this.level, newTexture;}delayLoad() {4 !== this.delayLoadState || (this.delayLoadState = 1, this._texture = this._getFromCache(this.url, !0), !this._texture && this._loadTexture());}static Parse(parsedTexture, scene) {let texture = null;return parsedTexture.name && !parsedTexture.isRenderTarget && (texture = new ColorGradingTexture(parsedTexture.name, scene), texture.name = parsedTexture.name, texture.level = parsedTexture.level), texture;}serialize() {if (!this.name) return null;const serializationObject = { name: this.name, level: this.level, customType: "BABYLON.ColorGradingTexture" };return serializationObject;}}ColorGradingTexture._NoneEmptyLineRegex = /\S+/, (0,typeStore/* RegisterClass */.H)("BABYLON.ColorGradingTexture", ColorGradingTexture);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/fileTools.js
var fileTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/fileTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/equiRectangularCubeTexture.js
class EquiRectangularCubeTexture extends baseTexture/* BaseTexture */.V {constructor(url, scene, size, noMipmap = !1, gammaSpace = !0, onLoad = null, onError = null) {if (super(scene), this._onLoad = null, this._onError = null, !url) throw new Error("Image url is not set");this._coordinatesMode = Textures_texture/* Texture.CUBIC_MODE */.x.CUBIC_MODE, this.name = url, this.url = url, this._size = size, this._noMipmap = noMipmap, this.gammaSpace = gammaSpace, this._onLoad = onLoad, this._onError = onError, this.hasAlpha = !1, this.isCube = !0, this._texture = this._getFromCache(url, this._noMipmap, void 0, void 0, void 0, this.isCube), this._texture ? onLoad && (this._texture.isReady ? tools/* Tools.SetImmediate */.w1.SetImmediate(() => onLoad()) : this._texture.onLoadedObservable.add(onLoad)) : scene.useDelayedTextureLoading ? this.delayLoadState = 4 : this._loadImage(this._loadTexture.bind(this), this._onError);}_loadImage(loadTextureCallback, onError) {const canvas = document.createElement("canvas");(0,fileTools/* LoadImage */.r6)(this.url, (image) => {this._width = image.width, this._height = image.height, canvas.width = this._width, canvas.height = this._height;const ctx = canvas.getContext("2d");ctx.drawImage(image, 0, 0);const imageData = ctx.getImageData(0, 0, image.width, image.height);this._buffer = imageData.data.buffer, canvas.remove(), loadTextureCallback();}, (_, e) => {onError && onError(`${this.getClassName()} could not be loaded`, e);}, null);}_loadTexture() {const scene = this.getScene(),callback = () => {const imageData = this._getFloat32ArrayFromArrayBuffer(this._buffer),data = PanoramaToCubeMapTools.ConvertPanoramaToCubemap(imageData, this._width, this._height, this._size),results = [];for (let i = 0; 6 > i; i++) {const dataFace = data[EquiRectangularCubeTexture._FacesMapping[i]];results.push(dataFace);}return results;};scene && (this._texture = scene.getEngine().createRawCubeTextureFromUrl(this.url, scene, this._size, 4, scene.getEngine().getCaps().textureFloat ? 1 : 7, this._noMipmap, callback, null, this._onLoad, this._onError));}_getFloat32ArrayFromArrayBuffer(buffer) {const dataView = new DataView(buffer),floatImageData = new Float32Array(3 * buffer.byteLength / 4);let k = 0;for (let i = 0; i < buffer.byteLength; i++) 0 != (i + 1) % 4 && (floatImageData[k++] = dataView.getUint8(i) / 255);return floatImageData;}getClassName() {return "EquiRectangularCubeTexture";}clone() {const scene = this.getScene();if (!scene) return this;const newTexture = new EquiRectangularCubeTexture(this.url, scene, this._size, this._noMipmap, this.gammaSpace);return newTexture.level = this.level, newTexture.wrapU = this.wrapU, newTexture.wrapV = this.wrapV, newTexture.coordinatesIndex = this.coordinatesIndex, newTexture.coordinatesMode = this.coordinatesMode, newTexture;}}EquiRectangularCubeTexture._FacesMapping = ["right", "left", "up", "down", "front", "back"];
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/htmlElementTexture.js
var htmlElementTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/htmlElementTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/internalTextureLoader.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/tga.js
const _TYPE_INDEXED = 1,_TYPE_RGB = 2,_TYPE_GREY = 3,_TYPE_RLE_INDEXED = 9,_TYPE_RLE_RGB = 10,_TYPE_RLE_GREY = 11,_ORIGIN_MASK = 48,_ORIGIN_SHIFT = 4,_ORIGIN_BL = 0,_ORIGIN_BR = 1,_ORIGIN_UL = 2,_ORIGIN_UR = 3;function GetTGAHeader(data) {let offset = 0;const header = { id_length: data[offset++], colormap_type: data[offset++], image_type: data[offset++], colormap_index: data[offset++] | data[offset++] << 8, colormap_length: data[offset++] | data[offset++] << 8, colormap_size: data[offset++], origin: [data[offset++] | data[offset++] << 8, data[offset++] | data[offset++] << 8], width: data[offset++] | data[offset++] << 8, height: data[offset++] | data[offset++] << 8, pixel_size: data[offset++], flags: data[offset++] };return header;}function UploadContent(texture, data) {if (19 > data.length) return void logger/* Logger.Error */.Y.Error("Unable to load TGA file - Not enough data to contain header");let offset = 18;const header = GetTGAHeader(data);if (header.id_length + offset > data.length) return void logger/* Logger.Error */.Y.Error("Unable to load TGA file - Not enough data");offset += header.id_length;let use_rle = !1,use_pal = !1,use_grey = !1;switch (header.image_type) {case _TYPE_RLE_INDEXED:use_rle = !0;case _TYPE_INDEXED:use_pal = !0;break;case _TYPE_RLE_RGB:use_rle = !0;case _TYPE_RGB:break;case _TYPE_RLE_GREY:use_rle = !0;case _TYPE_GREY:use_grey = !0;}let pixel_data;const pixel_size = header.pixel_size >> 3,pixel_total = header.width * header.height * pixel_size;let palettes;if (use_pal && (palettes = data.subarray(offset, offset += header.colormap_length * (header.colormap_size >> 3))), use_rle) {pixel_data = new Uint8Array(pixel_total);let c,count,i,localOffset = 0;for (const pixels = new Uint8Array(pixel_size); offset < pixel_total && localOffset < pixel_total;) if (c = data[offset++], count = (127 & c) + 1, 128 & c) {for (i = 0; i < pixel_size; ++i) pixels[i] = data[offset++];for (i = 0; i < count; ++i) pixel_data.set(pixels, localOffset + i * pixel_size);localOffset += pixel_size * count;} else {for (count *= pixel_size, i = 0; i < count; ++i) pixel_data[localOffset + i] = data[offset++];localOffset += count;}} else pixel_data = data.subarray(offset, offset += use_pal ? header.width * header.height : pixel_total);let x_start, y_start, x_step, y_step, y_end, x_end;switch ((header.flags & _ORIGIN_MASK) >> _ORIGIN_SHIFT) {default:case _ORIGIN_UL:x_start = 0, x_step = 1, x_end = header.width, y_start = 0, y_step = 1, y_end = header.height;break;case _ORIGIN_BL:x_start = 0, x_step = 1, x_end = header.width, y_start = header.height - 1, y_step = -1, y_end = -1;break;case _ORIGIN_UR:x_start = header.width - 1, x_step = -1, x_end = -1, y_start = 0, y_step = 1, y_end = header.height;break;case _ORIGIN_BR:x_start = header.width - 1, x_step = -1, x_end = -1, y_start = header.height - 1, y_step = -1, y_end = -1;}const func = "_getImageData" + (use_grey ? "Grey" : "") + header.pixel_size + "bits",imageData = TGATools[func](header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end),engine = texture.getEngine();engine._uploadDataToTextureDirectly(texture, imageData);}function _getImageData8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {const colormap = palettes,width = header.width,height = header.height;let color,x,y,i = 0;const imageData = new Uint8Array(4 * (width * height));for (y = y_start; y !== y_end; y += y_step) for (x = x_start; x !== x_end; x += x_step, i++) color = pixel_data[i], imageData[4 * (x + width * y) + 3] = 255, imageData[4 * (x + width * y) + 2] = colormap[3 * color + 0], imageData[4 * (x + width * y) + 1] = colormap[3 * color + 1], imageData[4 * (x + width * y) + 0] = colormap[3 * color + 2];return imageData;}function _getImageData16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {const image = pixel_data,width = header.width,height = header.height;let color,x,y,i = 0;const imageData = new Uint8Array(4 * (width * height));for (y = y_start; y !== y_end; y += y_step) for (x = x_start; x !== x_end; x += x_step, i += 2) {color = image[i + 0] + (image[i + 1] << 8);const r = 0 | 255 * ((31744 & color) >> 10) / 31,g = 0 | 255 * ((992 & color) >> 5) / 31,b = 0 | 255 * (31 & color) / 31;imageData[4 * (x + width * y) + 0] = r, imageData[4 * (x + width * y) + 1] = g, imageData[4 * (x + width * y) + 2] = b, imageData[4 * (x + width * y) + 3] = 32768 & color ? 0 : 255;}return imageData;}function _getImageData24bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {const image = pixel_data,width = header.width,height = header.height;let x,y,i = 0;const imageData = new Uint8Array(4 * (width * height));for (y = y_start; y !== y_end; y += y_step) for (x = x_start; x !== x_end; x += x_step, i += 3) imageData[4 * (x + width * y) + 3] = 255, imageData[4 * (x + width * y) + 2] = image[i + 0], imageData[4 * (x + width * y) + 1] = image[i + 1], imageData[4 * (x + width * y) + 0] = image[i + 2];return imageData;}function _getImageData32bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {const image = pixel_data,width = header.width,height = header.height;let x,y,i = 0;const imageData = new Uint8Array(4 * (width * height));for (y = y_start; y !== y_end; y += y_step) for (x = x_start; x !== x_end; x += x_step, i += 4) imageData[4 * (x + width * y) + 2] = image[i + 0], imageData[4 * (x + width * y) + 1] = image[i + 1], imageData[4 * (x + width * y) + 0] = image[i + 2], imageData[4 * (x + width * y) + 3] = image[i + 3];return imageData;}function _getImageDataGrey8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {const width = header.width,height = header.height;let color,x,y,i = 0;const imageData = new Uint8Array(4 * (width * height));for (y = y_start; y !== y_end; y += y_step) for (x = x_start; x !== x_end; x += x_step, i++) color = pixel_data[i], imageData[4 * (x + width * y) + 0] = color, imageData[4 * (x + width * y) + 1] = color, imageData[4 * (x + width * y) + 2] = color, imageData[4 * (x + width * y) + 3] = 255;return imageData;}function _getImageDataGrey16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {const image = pixel_data,width = header.width,height = header.height;let x,y,i = 0;const imageData = new Uint8Array(4 * (width * height));for (y = y_start; y !== y_end; y += y_step) for (x = x_start; x !== x_end; x += x_step, i += 2) imageData[4 * (x + width * y) + 0] = image[i + 0], imageData[4 * (x + width * y) + 1] = image[i + 0], imageData[4 * (x + width * y) + 2] = image[i + 0], imageData[4 * (x + width * y) + 3] = image[i + 1];return imageData;}const TGATools = { GetTGAHeader, UploadContent, _getImageData8bits, _getImageData16bits, _getImageData24bits, _getImageData32bits, _getImageDataGrey8bits, _getImageDataGrey16bits };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/tgaTextureLoader.js
class _TGATextureLoader {constructor() {this.supportCascades = !1;}canLoad(extension) {return extension.endsWith(".tga");}loadCubeData() {throw ".env not supported in Cube.";}loadData(data, texture, callback) {const bytes = new Uint8Array(data.buffer, data.byteOffset, data.byteLength),header = GetTGAHeader(bytes);callback(header.width, header.height, texture.generateMipMaps, !1, () => {UploadContent(texture, bytes);});}}engine/* Engine._TextureLoaders.push */.D._TextureLoaders.push(new _TGATextureLoader());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/hdrTextureLoader.js
class _HDRTextureLoader {constructor() {this.supportCascades = !1;}canLoad(extension) {return extension.endsWith(".hdr");}loadCubeData() {throw ".env not supported in Cube.";}loadData(data, texture, callback) {const uint8array = new Uint8Array(data.buffer, data.byteOffset, data.byteLength),hdrInfo = HDRTools.RGBE_ReadHeader(uint8array),pixelsDataRGB32 = HDRTools.RGBE_ReadPixels(uint8array, hdrInfo),pixels = hdrInfo.width * hdrInfo.height,pixelsDataRGBA32 = new Float32Array(4 * pixels);for (let i = 0; i < pixels; i += 1) pixelsDataRGBA32[4 * i] = pixelsDataRGB32[3 * i], pixelsDataRGBA32[4 * i + 1] = pixelsDataRGB32[3 * i + 1], pixelsDataRGBA32[4 * i + 2] = pixelsDataRGB32[3 * i + 2], pixelsDataRGBA32[4 * i + 3] = 1;callback(hdrInfo.width, hdrInfo.height, texture.generateMipMaps, !1, () => {const engine = texture.getEngine();texture.type = 1, texture.format = 5, texture._gammaSpace = !1, engine._uploadDataToTextureDirectly(texture, pixelsDataRGBA32);});}}engine/* Engine._TextureLoaders.push */.D._TextureLoaders.push(new _HDRTextureLoader());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/basis.js
class BasisFileInfo {}class TranscodeResult {}class BasisTranscodeConfiguration {}var BASIS_FORMATS;(function (BASIS_FORMATS) {BASIS_FORMATS[BASIS_FORMATS.cTFETC1 = 0] = "cTFETC1", BASIS_FORMATS[BASIS_FORMATS.cTFETC2 = 1] = "cTFETC2", BASIS_FORMATS[BASIS_FORMATS.cTFBC1 = 2] = "cTFBC1", BASIS_FORMATS[BASIS_FORMATS.cTFBC3 = 3] = "cTFBC3", BASIS_FORMATS[BASIS_FORMATS.cTFBC4 = 4] = "cTFBC4", BASIS_FORMATS[BASIS_FORMATS.cTFBC5 = 5] = "cTFBC5", BASIS_FORMATS[BASIS_FORMATS.cTFBC7 = 6] = "cTFBC7", BASIS_FORMATS[BASIS_FORMATS.cTFPVRTC1_4_RGB = 8] = "cTFPVRTC1_4_RGB", BASIS_FORMATS[BASIS_FORMATS.cTFPVRTC1_4_RGBA = 9] = "cTFPVRTC1_4_RGBA", BASIS_FORMATS[BASIS_FORMATS.cTFASTC_4x4 = 10] = "cTFASTC_4x4", BASIS_FORMATS[BASIS_FORMATS.cTFATC_RGB = 11] = "cTFATC_RGB", BASIS_FORMATS[BASIS_FORMATS.cTFATC_RGBA_INTERPOLATED_ALPHA = 12] = "cTFATC_RGBA_INTERPOLATED_ALPHA", BASIS_FORMATS[BASIS_FORMATS.cTFRGBA32 = 13] = "cTFRGBA32", BASIS_FORMATS[BASIS_FORMATS.cTFRGB565 = 14] = "cTFRGB565", BASIS_FORMATS[BASIS_FORMATS.cTFBGR565 = 15] = "cTFBGR565", BASIS_FORMATS[BASIS_FORMATS.cTFRGBA4444 = 16] = "cTFRGBA4444", BASIS_FORMATS[BASIS_FORMATS.cTFFXT1_RGB = 17] = "cTFFXT1_RGB", BASIS_FORMATS[BASIS_FORMATS.cTFPVRTC2_4_RGB = 18] = "cTFPVRTC2_4_RGB", BASIS_FORMATS[BASIS_FORMATS.cTFPVRTC2_4_RGBA = 19] = "cTFPVRTC2_4_RGBA", BASIS_FORMATS[BASIS_FORMATS.cTFETC2_EAC_R11 = 20] = "cTFETC2_EAC_R11", BASIS_FORMATS[BASIS_FORMATS.cTFETC2_EAC_RG11 = 21] = "cTFETC2_EAC_RG11";})(BASIS_FORMATS || (BASIS_FORMATS = {}));const BasisToolsOptions = { JSModuleURL: "https://cdn.babylonjs.com/basisTranscoder/1/basis_transcoder.js", WasmModuleURL: "https://cdn.babylonjs.com/basisTranscoder/1/basis_transcoder.wasm" };const GetInternalFormatFromBasisFormat = (basisFormat) => {let format;if (basisFormat === BASIS_FORMATS.cTFETC1 ? format = 36196 : basisFormat === BASIS_FORMATS.cTFBC1 ? format = 33776 : basisFormat === BASIS_FORMATS.cTFBC4 ? format = 33779 : basisFormat === BASIS_FORMATS.cTFASTC_4x4 ? format = 37808 : basisFormat === BASIS_FORMATS.cTFETC2 ? format = 37496 : basisFormat === BASIS_FORMATS.cTFBC7 ? format = 36492 : void 0, void 0 === format) throw "The chosen Basis transcoder format is not currently supported";return format;};let _WorkerPromise = null,_Worker = null,_actionId = 0;const _IgnoreSupportedFormats = !1,_CreateWorkerAsync = () => (_WorkerPromise || (_WorkerPromise = new Promise((res, reject) => {_Worker ? res(_Worker) : tools/* Tools.LoadFileAsync */.w1.LoadFileAsync(BasisToolsOptions.WasmModuleURL).then((wasmBinary) => {if ("function" != typeof URL) return reject("Basis transcoder requires an environment with a URL constructor");const workerBlobUrl = URL.createObjectURL(new Blob([`(${basis_workerFunc})()`], { type: "application/javascript" }));_Worker = new Worker(workerBlobUrl);const initHandler = (msg) => {"init" === msg.data.action ? (_Worker.removeEventListener("message", initHandler), res(_Worker)) : "error" === msg.data.action && reject(msg.data.error || "error initializing worker");};_Worker.addEventListener("message", initHandler), _Worker.postMessage({ action: "init", url: BasisToolsOptions.JSModuleURL, wasmBinary: wasmBinary });}).catch(reject);})), _WorkerPromise);const TranscodeAsync = (data, config) => {const dataView = data instanceof ArrayBuffer ? new Uint8Array(data) : data;return new Promise((res, rej) => {_CreateWorkerAsync().then(() => {const actionId = _actionId++,messageHandler = (msg) => {"transcode" === msg.data.action && msg.data.id === actionId && (_Worker.removeEventListener("message", messageHandler), msg.data.success ? res(msg.data) : rej("Transcode is not supported on this device"));};_Worker.addEventListener("message", messageHandler);const dataViewCopy = new Uint8Array(dataView.byteLength);dataViewCopy.set(new Uint8Array(dataView.buffer, dataView.byteOffset, dataView.byteLength)), _Worker.postMessage({ action: "transcode", id: actionId, imageData: dataViewCopy, config: config, ignoreSupportedFormats: _IgnoreSupportedFormats }, [dataViewCopy.buffer]);}, (error) => {rej(error);});});};const BindTexture = (texture, engine) => {var _a, _b;let target = null === (_a = engine._gl) || void 0 === _a ? void 0 : _a.TEXTURE_2D;texture.isCube && (target = null === (_b = engine._gl) || void 0 === _b ? void 0 : _b.TEXTURE_CUBE_MAP), engine._bindTextureDirectly(target, texture, !0);};const LoadTextureFromTranscodeResult = (texture, transcodeResult) => {const engine = texture.getEngine();for (let i = 0; i < transcodeResult.fileInfo.images.length; i++) {const rootImage = transcodeResult.fileInfo.images[i].levels[0];if (texture._invertVScale = texture.invertY, -1 !== transcodeResult.format && transcodeResult.format !== BASIS_FORMATS.cTFRGB565) {texture.width = rootImage.width, texture.height = rootImage.height, texture.generateMipMaps = 1 < transcodeResult.fileInfo.images[i].levels.length;const format = BasisTools.GetInternalFormatFromBasisFormat(transcodeResult.format, engine);texture.format = format, BindTexture(texture, engine), transcodeResult.fileInfo.images[i].levels.forEach((level, index) => {engine._uploadCompressedDataToTextureDirectly(texture, format, level.width, level.height, level.transcodedPixels, i, index);}), engine._features.basisNeedsPOT && (0 != math_scalar/* Scalar.Log2 */.R.Log2(texture.width) % 1 || 0 != math_scalar/* Scalar.Log2 */.R.Log2(texture.height) % 1) && (tools/* Tools.Warn */.w1.Warn("Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1."), texture._cachedWrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, texture._cachedWrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE);} else if (texture.type = 10, texture.format = 4, engine._features.basisNeedsPOT && (0 != math_scalar/* Scalar.Log2 */.R.Log2(rootImage.width) % 1 || 0 != math_scalar/* Scalar.Log2 */.R.Log2(rootImage.height) % 1)) {const source = new Textures_internalTexture/* InternalTexture */.l(engine, Textures_internalTexture/* InternalTextureSource.Temp */.S.Temp);texture._invertVScale = texture.invertY, source.type = 10, source.format = 4, source.width = -4 & rootImage.width + 3, source.height = -4 & rootImage.height + 3, BindTexture(source, engine), engine._uploadDataToTextureDirectly(source, new Uint16Array(rootImage.transcodedPixels.buffer), i, 0, 4, !0), engine._rescaleTexture(source, texture, engine.scenes[0], engine._getInternalFormat(4), () => {engine._releaseTexture(source), BindTexture(texture, engine);});} else texture._invertVScale = !texture.invertY, texture.width = -4 & rootImage.width + 3, texture.height = -4 & rootImage.height + 3, texture.samplingMode = 2, BindTexture(texture, engine), engine._uploadDataToTextureDirectly(texture, new Uint16Array(rootImage.transcodedPixels.buffer), i, 0, 4, !0);}};const BasisTools = { JSModuleURL: BasisToolsOptions.JSModuleURL, WasmModuleURL: BasisToolsOptions.WasmModuleURL, GetInternalFormatFromBasisFormat, TranscodeAsync, LoadTextureFromTranscodeResult };function basis_workerFunc() {function GetSupportedTranscodeFormat(config, fileInfo) {let format = null;return config.supportedCompressionFormats && (config.supportedCompressionFormats.astc ? format = _BASIS_FORMAT.cTFASTC_4x4 : config.supportedCompressionFormats.bc7 ? format = _BASIS_FORMAT.cTFBC7 : config.supportedCompressionFormats.s3tc ? format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFBC3 : _BASIS_FORMAT.cTFBC1 : config.supportedCompressionFormats.pvrtc ? format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFPVRTC1_4_RGBA : _BASIS_FORMAT.cTFPVRTC1_4_RGB : config.supportedCompressionFormats.etc2 ? format = _BASIS_FORMAT.cTFETC2 : config.supportedCompressionFormats.etc1 ? format = _BASIS_FORMAT.cTFETC1 : format = _BASIS_FORMAT.cTFRGB565), format;}function GetFileInfo(basisFile) {const hasAlpha = basisFile.getHasAlpha(),imageCount = basisFile.getNumImages(),images = [];for (let i = 0; i < imageCount; i++) {const imageInfo = { levels: [] },levelCount = basisFile.getNumLevels(i);for (let level = 0; level < levelCount; level++) {const levelInfo = { width: basisFile.getImageWidth(i, level), height: basisFile.getImageHeight(i, level) };imageInfo.levels.push(levelInfo);}images.push(imageInfo);}return { hasAlpha, images };}function TranscodeLevel(loadedFile, imageIndex, levelIndex, format, convertToRgb565) {const dstSize = loadedFile.getImageTranscodedSizeInBytes(imageIndex, levelIndex, format);let dst = new Uint8Array(dstSize);if (!loadedFile.transcodeImage(dst, imageIndex, levelIndex, format, 1, 0)) return null;if (convertToRgb565) {const alignedWidth = -4 & loadedFile.getImageWidth(imageIndex, levelIndex) + 3,alignedHeight = -4 & loadedFile.getImageHeight(imageIndex, levelIndex) + 3;dst = ConvertDxtToRgb565(dst, 0, alignedWidth, alignedHeight);}return dst;}function ConvertDxtToRgb565(src, srcByteOffset, width, height) {const c = new Uint16Array(4),dst = new Uint16Array(width * height),blockWidth = width / 4;for (let blockY = 0; blockY < height / 4; blockY++) for (let blockX = 0; blockX < blockWidth; blockX++) {const i = srcByteOffset + 8 * (blockY * blockWidth + blockX);c[0] = src[i] | src[i + 1] << 8, c[1] = src[i + 2] | src[i + 3] << 8, c[2] = (2 * (31 & c[0]) + 1 * (31 & c[1])) / 3 | 2016 & (2 * (2016 & c[0]) + 1 * (2016 & c[1])) / 3 | 63488 & (2 * (63488 & c[0]) + 1 * (63488 & c[1])) / 3, c[3] = (2 * (31 & c[1]) + 1 * (31 & c[0])) / 3 | 2016 & (2 * (2016 & c[1]) + 1 * (2016 & c[0])) / 3 | 63488 & (2 * (63488 & c[1]) + 1 * (63488 & c[0])) / 3;for (let row = 0; 4 > row; row++) {const m = src[i + 4 + row];let dstI = (4 * blockY + row) * width + 4 * blockX;dst[dstI++] = c[3 & m], dst[dstI++] = c[3 & m >> 2], dst[dstI++] = c[3 & m >> 4], dst[dstI++] = c[3 & m >> 6];}}return dst;}const _BASIS_FORMAT = { cTFETC1: 0, cTFETC2: 1, cTFBC1: 2, cTFBC3: 3, cTFBC4: 4, cTFBC5: 5, cTFBC7: 6, cTFPVRTC1_4_RGB: 8, cTFPVRTC1_4_RGBA: 9, cTFASTC_4x4: 10, cTFATC_RGB: 11, cTFATC_RGBA_INTERPOLATED_ALPHA: 12, cTFRGBA32: 13, cTFRGB565: 14, cTFBGR565: 15, cTFRGBA4444: 16, cTFFXT1_RGB: 17, cTFPVRTC2_4_RGB: 18, cTFPVRTC2_4_RGBA: 19, cTFETC2_EAC_R11: 20, cTFETC2_EAC_RG11: 21 };let transcoderModulePromise = null;onmessage = (event) => {if ("init" === event.data.action) {if (!transcoderModulePromise) {try {importScripts(event.data.url);} catch (e) {postMessage({ action: "error", error: e });}transcoderModulePromise = BASIS({ wasmBinary: event.data.wasmBinary });}null !== transcoderModulePromise && transcoderModulePromise.then((m) => {BASIS = m, m.initializeBasis(), postMessage({ action: "init" });});} else if ("transcode" === event.data.action) {const config = event.data.config,imgData = event.data.imageData,loadedFile = new BASIS.BasisFile(imgData),fileInfo = GetFileInfo(loadedFile);let format = event.data.ignoreSupportedFormats ? null : GetSupportedTranscodeFormat(event.data.config, fileInfo),needsConversion = !1;null === format && (needsConversion = !0, format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFBC3 : _BASIS_FORMAT.cTFBC1);let success = !0;loadedFile.startTranscoding() || (success = !1);const buffers = [];for (let imageIndex = 0; imageIndex < fileInfo.images.length && !!success; imageIndex++) {const image = fileInfo.images[imageIndex];if (config.loadSingleImage === void 0 || config.loadSingleImage === imageIndex) {let mipCount = image.levels.length;!1 === config.loadMipmapLevels && (mipCount = 1);for (let levelIndex = 0; levelIndex < mipCount; levelIndex++) {const levelInfo = image.levels[levelIndex],pixels = TranscodeLevel(loadedFile, imageIndex, levelIndex, format, needsConversion);if (!pixels) {success = !1;break;}levelInfo.transcodedPixels = pixels, buffers.push(levelInfo.transcodedPixels.buffer);}}}loadedFile.close(), loadedFile.delete(), needsConversion && (format = -1), success ? postMessage({ action: "transcode", success: success, id: event.data.id, fileInfo: fileInfo, format: format }, buffers) : postMessage({ action: "transcode", success: success, id: event.data.id });}};}Object.defineProperty(BasisTools, "JSModuleURL", { get: function () {return BasisToolsOptions.JSModuleURL;}, set: function (value) {BasisToolsOptions.JSModuleURL = value;} }), Object.defineProperty(BasisTools, "WasmModuleURL", { get: function () {return BasisToolsOptions.WasmModuleURL;}, set: function (value) {BasisToolsOptions.WasmModuleURL = value;} });
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/basisTextureLoader.js
class _BasisTextureLoader {constructor() {this.supportCascades = !1;}canLoad(extension) {return extension.endsWith(".basis");}loadCubeData(data, texture, createPolynomials, onLoad, onError) {if (Array.isArray(data)) return;const caps = texture.getEngine().getCaps(),transcodeConfig = { supportedCompressionFormats: { etc1: !!caps.etc1, s3tc: !!caps.s3tc, pvrtc: !!caps.pvrtc, etc2: !!caps.etc2, astc: !!caps.astc, bc7: !!caps.bptc } };TranscodeAsync(data, transcodeConfig).then((result) => {const hasMipmap = 1 < result.fileInfo.images[0].levels.length && texture.generateMipMaps;LoadTextureFromTranscodeResult(texture, result), texture.getEngine()._setCubeMapTextureParams(texture, hasMipmap), texture.isReady = !0, texture.onLoadedObservable.notifyObservers(texture), texture.onLoadedObservable.clear(), onLoad && onLoad();}).catch((err) => {tools/* Tools.Warn */.w1.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"), texture.isReady = !0, onError && onError(err);});}loadData(data, texture, callback) {const caps = texture.getEngine().getCaps(),transcodeConfig = { supportedCompressionFormats: { etc1: !!caps.etc1, s3tc: !!caps.s3tc, pvrtc: !!caps.pvrtc, etc2: !!caps.etc2, astc: !!caps.astc, bc7: !!caps.bptc } };TranscodeAsync(data, transcodeConfig).then((result) => {const rootImage = result.fileInfo.images[0].levels[0],hasMipmap = 1 < result.fileInfo.images[0].levels.length && texture.generateMipMaps;callback(rootImage.width, rootImage.height, hasMipmap, -1 !== result.format, () => {LoadTextureFromTranscodeResult(texture, result);});}).catch((err) => {tools/* Tools.Warn */.w1.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"), tools/* Tools.Warn */.w1.Warn(`Failed to transcode Basis file: ${err}`), callback(0, 0, !1, !1, () => {}, !0);});}}engine/* Engine._TextureLoaders.push */.D._TextureLoaders.push(new _BasisTextureLoader());
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/multiRenderTarget.js
class MultiRenderTarget extends Textures_renderTargetTexture/* RenderTargetTexture */._ {get isSupported() {var _a, _b;return !(null === (_b = null === (_a = this._engine) || void 0 === _a ? void 0 : _a.getCaps().drawBuffersExtension) || void 0 === _b) && _b;}get textures() {return this._textures;}get count() {return this._count;}get depthTexture() {return this._textures[this._textures.length - 1];}set wrapU(wrap) {if (this._textures) for (let i = 0; i < this._textures.length; i++) this._textures[i].wrapU = wrap;}set wrapV(wrap) {if (this._textures) for (let i = 0; i < this._textures.length; i++) this._textures[i].wrapV = wrap;}constructor(name, size, count, scene, options, textureNames) {const generateMipMaps = !!(options && options.generateMipMaps) && options.generateMipMaps,generateDepthTexture = !!(options && options.generateDepthTexture) && options.generateDepthTexture,depthTextureFormat = options && options.depthTextureFormat ? options.depthTextureFormat : 15,doNotChangeAspectRatio = !(options && void 0 !== options.doNotChangeAspectRatio) || options.doNotChangeAspectRatio,drawOnlyOnFirstAttachmentByDefault = !!(options && options.drawOnlyOnFirstAttachmentByDefault) && options.drawOnlyOnFirstAttachmentByDefault;if (super(name, size, scene, generateMipMaps, doNotChangeAspectRatio, void 0, void 0, void 0, void 0, void 0, void 0, void 0, !0), !this.isSupported) return void this.dispose();const types = [],samplingModes = [],useSRGBBuffers = [];this._initTypes(count, types, samplingModes, useSRGBBuffers, options);const generateDepthBuffer = !(options && void 0 !== options.generateDepthBuffer) || options.generateDepthBuffer,generateStencilBuffer = !!(options && void 0 !== options.generateStencilBuffer) && options.generateStencilBuffer;this._size = size, this._multiRenderTargetOptions = { samplingModes: samplingModes, generateMipMaps: generateMipMaps, generateDepthBuffer: generateDepthBuffer, generateStencilBuffer: generateStencilBuffer, generateDepthTexture: generateDepthTexture, depthTextureFormat: depthTextureFormat, types: types, textureCount: count, useSRGBBuffers: useSRGBBuffers }, this._count = count, this._drawOnlyOnFirstAttachmentByDefault = drawOnlyOnFirstAttachmentByDefault, 0 < count && (this._createInternalTextures(), this._createTextures(textureNames));}_initTypes(count, types, samplingModes, useSRGBBuffers, options) {for (let i = 0; i < count; i++) options && options.types && void 0 !== options.types[i] ? types.push(options.types[i]) : types.push(options && options.defaultType ? options.defaultType : 0), options && options.samplingModes && void 0 !== options.samplingModes[i] ? samplingModes.push(options.samplingModes[i]) : samplingModes.push(Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE), options && options.useSRGBBuffers && void 0 !== options.useSRGBBuffers[i] ? useSRGBBuffers.push(options.useSRGBBuffers[i]) : useSRGBBuffers.push(!1);}_rebuild(forceFullRebuild = !1, textureNames) {if (!(1 > this._count)) {this.releaseInternalTextures(), this._createInternalTextures(), forceFullRebuild && (this._releaseTextures(), this._createTextures(textureNames));const internalTextures = this._renderTarget.textures;for (let i = 0; i < internalTextures.length; i++) {const texture = this._textures[i];texture._texture = internalTextures[i];}1 !== this.samples && this._renderTarget.setSamples(this.samples, !this._drawOnlyOnFirstAttachmentByDefault, !0);}}_createInternalTextures() {this._renderTarget = this._getEngine().createMultipleRenderTarget(this._size, this._multiRenderTargetOptions, !this._drawOnlyOnFirstAttachmentByDefault), this._texture = this._renderTarget.texture;}_releaseTextures() {if (this._textures) for (let i = 0; i < this._textures.length; i++) this._textures[i]._texture = null, this._textures[i].dispose();}_createTextures(textureNames) {const internalTextures = this._renderTarget.textures;this._textures = [];for (let i = 0; i < internalTextures.length; i++) {const texture = new Textures_texture/* Texture */.x(null, this.getScene());(null === textureNames || void 0 === textureNames ? void 0 : textureNames[i]) && (texture.name = textureNames[i]), texture._texture = internalTextures[i], this._textures.push(texture);}}setInternalTexture(texture, index, disposePrevious = !0) {this.renderTarget && (0 === index && (this._texture = texture), this.renderTarget.setTexture(texture, index, disposePrevious), !this.textures[index] && (this.textures[index] = new Textures_texture/* Texture */.x(null, this.getScene())), this.textures[index]._texture = texture, this._count = this.renderTarget.textures ? this.renderTarget.textures.length : 0, this._multiRenderTargetOptions.types && (this._multiRenderTargetOptions.types[index] = texture.type), this._multiRenderTargetOptions.samplingModes && (this._multiRenderTargetOptions.samplingModes[index] = texture.samplingMode), this._multiRenderTargetOptions.useSRGBBuffers && (this._multiRenderTargetOptions.useSRGBBuffers[index] = texture._useSRGBBuffer));}get samples() {return this._samples;}set samples(value) {this._samples = this._renderTarget ? this._renderTarget.setSamples(value) : value;}resize(size) {this._size = size, this._rebuild();}updateCount(count, options, textureNames) {this._multiRenderTargetOptions.textureCount = count, this._count = count;const types = [],samplingModes = [],useSRGBBuffers = [];this._initTypes(count, types, samplingModes, useSRGBBuffers, options), this._multiRenderTargetOptions.types = types, this._multiRenderTargetOptions.samplingModes = samplingModes, this._multiRenderTargetOptions.useSRGBBuffers = useSRGBBuffers, this._rebuild(!0, textureNames);}_unbindFrameBuffer(engine, faceIndex) {this._renderTarget && engine.unBindMultiColorAttachmentFramebuffer(this._renderTarget, this.isCube, () => {this.onAfterRenderObservable.notifyObservers(faceIndex);});}dispose(doNotDisposeInternalTextures = !1) {this._releaseTextures(), doNotDisposeInternalTextures ? this._texture = null : this.releaseInternalTextures(), super.dispose();}releaseInternalTextures() {var _a, _b;const internalTextures = null === (_a = this._renderTarget) || void 0 === _a ? void 0 : _a.textures;if (internalTextures) {for (let i = internalTextures.length - 1; 0 <= i; i--) this._textures[i]._texture = null;null === (_b = this._renderTarget) || void 0 === _b ? void 0 : _b.dispose(), this._renderTarget = null;}}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Packer/frame.js
class TexturePackerFrame {constructor(id, scale, offset) {this.id = id, this.scale = scale, this.offset = offset;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Packer/packer.js
class TexturePacker {constructor(name, meshes, options, scene) {var _b, _c, _d, _e, _g, _h, _j, _k, _l, _m, _o, _p, _q;return this.name = name, this.meshes = meshes, this.scene = scene, this.options = options, this.options.map = null !== (_b = this.options.map) && void 0 !== _b ? _b : ["ambientTexture", "bumpTexture", "diffuseTexture", "emissiveTexture", "lightmapTexture", "opacityTexture", "reflectionTexture", "refractionTexture", "specularTexture"], this.options.uvsIn = null !== (_c = this.options.uvsIn) && void 0 !== _c ? _c : Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, this.options.uvsOut = null !== (_d = this.options.uvsOut) && void 0 !== _d ? _d : Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, this.options.layout = null !== (_e = this.options.layout) && void 0 !== _e ? _e : TexturePacker.LAYOUT_STRIP, this.options.layout === TexturePacker.LAYOUT_COLNUM && (this.options.colnum = null !== (_g = this.options.colnum) && void 0 !== _g ? _g : 8), this.options.updateInputMeshes = null === (_h = this.options.updateInputMeshes) || void 0 === _h || _h, this.options.disposeSources = null === (_j = this.options.disposeSources) || void 0 === _j || _j, this._expecting = 0, this.options.fillBlanks = null === (_k = this.options.fillBlanks) || void 0 === _k || _k, !0 === this.options.fillBlanks && (this.options.customFillColor = null !== (_l = this.options.customFillColor) && void 0 !== _l ? _l : "black"), this.options.frameSize = null !== (_m = this.options.frameSize) && void 0 !== _m ? _m : 256, this.options.paddingRatio = null !== (_o = this.options.paddingRatio) && void 0 !== _o ? _o : .0115, this._paddingValue = Math.ceil(this.options.frameSize * this.options.paddingRatio), 0 != this._paddingValue % 2 && this._paddingValue++, this.options.paddingMode = null !== (_p = this.options.paddingMode) && void 0 !== _p ? _p : TexturePacker.SUBUV_WRAP, this.options.paddingMode === TexturePacker.SUBUV_COLOR && (this.options.paddingColor = null !== (_q = this.options.paddingColor) && void 0 !== _q ? _q : new math_color/* Color4 */.HE(0, 0, 0, 1)), this.sets = {}, this.frames = [], this;}_createFrames(resolve) {const dtSize = this._calculateSize(),dtUnits = new math_vector/* Vector2 */.FM(1, 1).divide(dtSize);let doneCount = 0;const expecting = this._expecting,meshLength = this.meshes.length,sKeys = Object.keys(this.sets);for (let i = 0; i < sKeys.length; i++) {const setName = sKeys[i],dt = new DynamicTexture(this.name + ".TexturePack." + setName + "Set", { width: dtSize.x, height: dtSize.y }, this.scene, !0, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, engine/* Engine.TEXTUREFORMAT_RGBA */.D.TEXTUREFORMAT_RGBA),dtx = dt.getContext();dtx.fillStyle = "rgba(0,0,0,0)", dtx.fillRect(0, 0, dtSize.x, dtSize.y), dt.update(!1), this.sets[setName] = dt;}const baseSize = this.options.frameSize || 256,padding = this._paddingValue,tcs = baseSize + 2 * padding,done = () => {this._calculateMeshUVFrames(baseSize, padding, dtSize, dtUnits, this.options.updateInputMeshes || !1);};for (let i = 0; i < meshLength; i++) {const m = this.meshes[i],mat = m.material;for (let j = 0; j < sKeys.length; j++) {const tempTexture = new DynamicTexture("temp", tcs, this.scene, !0),tcx = tempTexture.getContext(),offset = this._getFrameOffset(i),updateDt = () => {doneCount++, tempTexture.update(!1);const iDat = tcx.getImageData(0, 0, tcs, tcs),dt = this.sets[setName],dtx = dt.getContext();if (dtx.putImageData(iDat, dtSize.x * offset.x, dtSize.y * offset.y), tempTexture.dispose(), dt.update(!1), doneCount == expecting) return done(), void resolve();},setName = sKeys[j] || "_blank";if (!mat || null === mat[setName]) tcx.fillStyle = "rgba(0,0,0,0)", this.options.fillBlanks && (tcx.fillStyle = this.options.customFillColor), tcx.fillRect(0, 0, tcs, tcs), updateDt();else {const setTexture = mat[setName],img = new Image();img.src = setTexture instanceof DynamicTexture ? setTexture.getContext().canvas.toDataURL("image/png") : setTexture.url, tools/* Tools.SetCorsBehavior */.w1.SetCorsBehavior(img.src, img), img.onload = () => {tcx.fillStyle = "rgba(0,0,0,0)", tcx.fillRect(0, 0, tcs, tcs), tempTexture.update(!1), tcx.setTransform(1, 0, 0, -1, 0, 0);const cellOffsets = [0, 0, 1, 0, 1, 1, 0, 1, -1, 1, -1, 0, -2, 0, -1, 1, -1];switch (this.options.paddingMode) {case 0:for (let i = 0; 9 > i; i++) tcx.drawImage(img, 0, 0, img.width, img.height, padding + baseSize * cellOffsets[i], padding + baseSize * cellOffsets[i + 1] - tcs, baseSize, baseSize);break;case 1:for (let i = 0; i < padding; i++) tcx.drawImage(img, 0, 0, img.width, img.height, i + baseSize * cellOffsets[0], padding - tcs, baseSize, baseSize), tcx.drawImage(img, 0, 0, img.width, img.height, 2 * padding - i, padding - tcs, baseSize, baseSize), tcx.drawImage(img, 0, 0, img.width, img.height, padding, i - tcs, baseSize, baseSize), tcx.drawImage(img, 0, 0, img.width, img.height, padding, 2 * padding - i - tcs, baseSize, baseSize);tcx.drawImage(img, 0, 0, img.width, img.height, padding + baseSize * cellOffsets[0], padding + baseSize * cellOffsets[1] - tcs, baseSize, baseSize);break;case 2:tcx.fillStyle = (this.options.paddingColor || math_color/* Color3.Black */.Wo.Black()).toHexString(), tcx.fillRect(0, 0, tcs, -tcs), tcx.clearRect(padding, padding, baseSize, baseSize), tcx.drawImage(img, 0, 0, img.width, img.height, padding + baseSize * cellOffsets[0], padding + baseSize * cellOffsets[1] - tcs, baseSize, baseSize);}tcx.setTransform(1, 0, 0, 1, 0, 0), updateDt();};}}}}_calculateSize() {const meshLength = this.meshes.length || 0,baseSize = this.options.frameSize || 0,padding = this._paddingValue || 0;switch (this.options.layout) {case 0:return new math_vector/* Vector2 */.FM(baseSize * meshLength + 2 * padding * meshLength, baseSize + 2 * padding);case 1:{const sqrtCount = Math.max(2, Math.ceil(Math.sqrt(meshLength))),size = baseSize * sqrtCount + 2 * padding * sqrtCount;return new math_vector/* Vector2 */.FM(size, size);}case 2:{const cols = this.options.colnum || 1,rowCnt = Math.max(1, Math.ceil(meshLength / cols));return new math_vector/* Vector2 */.FM(baseSize * cols + 2 * padding * cols, baseSize * rowCnt + 2 * padding * rowCnt);}}return math_vector/* Vector2.Zero */.FM.Zero();}_calculateMeshUVFrames(baseSize, padding, dtSize, dtUnits, update) {const meshLength = this.meshes.length;for (let i = 0; i < meshLength; i++) {const m = this.meshes[i],scale = new math_vector/* Vector2 */.FM(baseSize / dtSize.x, baseSize / dtSize.y),pOffset = dtUnits.clone().scale(padding),frameOffset = this._getFrameOffset(i),offset = frameOffset.add(pOffset),frame = new TexturePackerFrame(i, scale, offset);this.frames.push(frame), update && (this._updateMeshUV(m, i), this._updateTextureReferences(m));}}_getFrameOffset(index) {const meshLength = this.meshes.length;let uvStep, yStep, xStep;switch (this.options.layout) {case 0:return uvStep = 1 / meshLength, new math_vector/* Vector2 */.FM(index * uvStep, 0);case 1:{const sqrtCount = Math.max(2, Math.ceil(Math.sqrt(meshLength)));return yStep = Math.floor(index / sqrtCount), xStep = index - yStep * sqrtCount, uvStep = 1 / sqrtCount, new math_vector/* Vector2 */.FM(xStep * uvStep, yStep * uvStep);}case 2:{const cols = this.options.colnum || 1,rowCnt = Math.max(1, Math.ceil(meshLength / cols));return xStep = Math.floor(index / rowCnt), yStep = index - xStep * rowCnt, uvStep = new math_vector/* Vector2 */.FM(1 / cols, 1 / rowCnt), new math_vector/* Vector2 */.FM(xStep * uvStep.x, yStep * uvStep.y);}}return math_vector/* Vector2.Zero */.FM.Zero();}_updateMeshUV(mesh, frameID) {const frame = this.frames[frameID],uvIn = mesh.getVerticesData(this.options.uvsIn || Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind),uvOut = [];let toCount = 0;uvIn.length && (toCount = uvIn.length || 0);for (let i = 0; i < toCount; i += 2) uvOut.push(uvIn[i] * frame.scale.x + frame.offset.x, uvIn[i + 1] * frame.scale.y + frame.offset.y);mesh.setVerticesData(this.options.uvsOut || Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, uvOut);}_updateTextureReferences(m, force = !1) {const mat = m.material,sKeys = Object.keys(this.sets),_dispose = (_t) => {_t.dispose && _t.dispose();};for (let i = 0; i < sKeys.length; i++) {const setName = sKeys[i];if (!force) {if (!mat) return;null !== mat[setName] && (_dispose(mat[setName]), mat[setName] = this.sets[setName]);} else null !== mat[setName] && _dispose(mat[setName]), mat[setName] = this.sets[setName];}}setMeshToFrame(m, frameID, updateMaterial = !1) {this._updateMeshUV(m, frameID), updateMaterial && this._updateTextureReferences(m, !0);}processAsync() {return new Promise((resolve, reject) => {try {if (0 === this.meshes.length) return void resolve();let done = 0;const doneCheck = (mat) => {if (done++, this.options.map) {for (let j = 0; j < this.options.map.length; j++) {const index = this.options.map[j],t = mat[index];null !== t && (!this.sets[this.options.map[j]] && (this.sets[this.options.map[j]] = !0), this._expecting++);}done === this.meshes.length && this._createFrames(resolve);}};for (let i = 0; i < this.meshes.length; i++) {const mesh = this.meshes[i],material = mesh.material;if (!material) {if (done++, done === this.meshes.length) return this._createFrames(resolve);continue;}material.forceCompilationAsync(mesh).then(() => {doneCheck(material);});}} catch (e) {return reject(e);}});}dispose() {const sKeys = Object.keys(this.sets);for (let i = 0; i < sKeys.length; i++) {const channel = sKeys[i];this.sets[channel].dispose();}}download(imageType = "png", quality = 1) {setTimeout(() => {const pack = { name: this.name, sets: {}, options: {}, frames: [] },sKeys = Object.keys(this.sets),oKeys = Object.keys(this.options);try {for (let i = 0; i < sKeys.length; i++) {const channel = sKeys[i],dt = this.sets[channel];pack.sets[channel] = dt.getContext().canvas.toDataURL("image/" + imageType, quality);}for (let i = 0; i < oKeys.length; i++) {const opt = oKeys[i];pack.options[opt] = this.options[opt];}for (let i = 0; i < this.frames.length; i++) {const _f = this.frames[i];pack.frames.push(_f.scale.x, _f.scale.y, _f.offset.x, _f.offset.y);}} catch (err) {return void logger/* Logger.Warn */.Y.Warn("Unable to download: " + err);}const data = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(pack, null, 4)),_a = document.createElement("a");_a.setAttribute("href", data), _a.setAttribute("download", this.name + "_texurePackage.json"), document.body.appendChild(_a), _a.click(), _a.remove();}, 0);}updateFromJSON(data) {try {const parsedData = JSON.parse(data);this.name = parsedData.name;const _options = Object.keys(parsedData.options);for (let i = 0; i < _options.length; i++) this.options[_options[i]] = parsedData.options[_options[i]];for (let i = 0; i < parsedData.frames.length; i += 4) {const frame = new TexturePackerFrame(i / 4, new math_vector/* Vector2 */.FM(parsedData.frames[i], parsedData.frames[i + 1]), new math_vector/* Vector2 */.FM(parsedData.frames[i + 2], parsedData.frames[i + 3]));this.frames.push(frame);}const channels = Object.keys(parsedData.sets);for (let i = 0; i < channels.length; i++) {const _t = new Textures_texture/* Texture */.x(parsedData.sets[channels[i]], this.scene, !1, !1);this.sets[channels[i]] = _t;}} catch (err) {logger/* Logger.Warn */.Y.Warn("Unable to update from JSON: " + err);}}}TexturePacker.LAYOUT_STRIP = 0, TexturePacker.LAYOUT_POWER2 = 1, TexturePacker.LAYOUT_COLNUM = 2, TexturePacker.SUBUV_WRAP = 0, TexturePacker.SUBUV_EXTEND = 1, TexturePacker.SUBUV_COLOR = 2;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Packer/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/customProceduralTexture.js
class CustomProceduralTexture extends ProceduralTexture {constructor(name, texturePath, size, scene, fallbackTexture, generateMipMaps, skipJson) {super(name, size, null, scene, fallbackTexture, generateMipMaps), this._animate = !0, this._time = 0, this._texturePath = texturePath, skipJson ? this.setFragment(this._texturePath) : this._loadJson(texturePath), this.refreshRate = 1;}_loadJson(jsonUrl) {const noConfigFile = () => {try {this.setFragment(this._texturePath);} catch (ex) {logger/* Logger.Log */.Y.Log("No json or ShaderStore or DOM element found for CustomProceduralTexture");}},xhr = new webRequest/* WebRequest */.g();xhr.open("GET", jsonUrl + "/config.json"), xhr.addEventListener("load", () => {if (200 === xhr.status || xhr.responseText && 0 < xhr.responseText.length) try {this._config = JSON.parse(xhr.response), this.updateShaderUniforms(), this.updateTextures(), this.setFragment(this._texturePath + "/custom"), this._animate = this._config.animate, this.refreshRate = this._config.refreshrate;} catch (ex) {noConfigFile();} else noConfigFile();}, !1), xhr.addEventListener("error", () => {noConfigFile();}, !1);try {xhr.send();} catch (ex) {logger/* Logger.Error */.Y.Error("CustomProceduralTexture: Error on XHR send request.");}}isReady() {if (!super.isReady()) return !1;for (const name in this._textures) {const texture = this._textures[name];if (!texture.isReady()) return !1;}return !0;}render(useCameraPostProcess) {const scene = this.getScene();this._animate && scene && (this._time += .03 * scene.getAnimationRatio(), this.updateShaderUniforms()), super.render(useCameraPostProcess);}updateTextures() {for (let i = 0; i < this._config.sampler2Ds.length; i++) this.setTexture(this._config.sampler2Ds[i].sample2Dname, new Textures_texture/* Texture */.x(this._texturePath + "/" + this._config.sampler2Ds[i].textureRelativeUrl, this.getScene()));}updateShaderUniforms() {if (this._config) for (let j = 0; j < this._config.uniforms.length; j++) {const uniform = this._config.uniforms[j];switch (uniform.type) {case "float":this.setFloat(uniform.name, uniform.value);break;case "color3":this.setColor3(uniform.name, new math_color/* Color3 */.Wo(uniform.r, uniform.g, uniform.b));break;case "color4":this.setColor4(uniform.name, new math_color/* Color4 */.HE(uniform.r, uniform.g, uniform.b, uniform.a));break;case "vector2":this.setVector2(uniform.name, new math_vector/* Vector2 */.FM(uniform.x, uniform.y));break;case "vector3":this.setVector3(uniform.name, new math_vector/* Vector3 */.P(uniform.x, uniform.y, uniform.z));}}this.setFloat("time", this._time);}get animate() {return this._animate;}set animate(value) {this._animate = value;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/noise.fragment.js
const noise_fragment_name = "noisePixelShader",noise_fragment_shader = `uniform float brightness;
uniform float persistence;
uniform float timeScale;
varying vec2 vUV;
vec2 hash22(vec2 p)
{
p=p*mat2(127.1,311.7,269.5,183.3);
p=-1.0+2.0*fract(sin(p)*43758.5453123);
return sin(p*6.283+timeScale);
}
float interpolationNoise(vec2 p)
{
vec2 pi=floor(p);
vec2 pf=p-pi;
vec2 w=pf*pf*(3.-2.*pf);
float f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));
float f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));
float f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));
float f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));
float xm1=mix(f00,f10,w.x);
float xm2=mix(f01,f11,w.x);
float ym=mix(xm1,xm2,w.y); 
return ym;
}
float perlinNoise2D(float x,float y)
{
float sum=0.0;
float frequency=0.0;
float amplitude=0.0;
for(int i=0; i<OCTAVES; i++)
{
frequency=pow(2.0,float(i));
amplitude=pow(persistence,float(i));
sum=sum+interpolationNoise(vec2(x*frequency,y*frequency))*amplitude;
}
return sum;
}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
float x=abs(vUV.x);
float y=abs(vUV.y);
float noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);
gl_FragColor=vec4(noise,noise,noise,1.0);
}
`;shaderStore/* ShaderStore.ShadersStore.noisePixelShader */.v.ShadersStore.noisePixelShader = noise_fragment_shader;const noisePixelShader = { name: "noisePixelShader", shader: noise_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/noiseProceduralTexture.js
class NoiseProceduralTexture extends ProceduralTexture {constructor(name, size = 256, scene = engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, fallbackTexture, generateMipMaps) {super(name, size, "noise", scene, fallbackTexture, generateMipMaps), this.time = 0, this.brightness = .2, this.octaves = 3, this.persistence = .8, this.animationSpeedFactor = 1, this.autoClear = !1, this._updateShaderUniforms();}_updateShaderUniforms() {const scene = this.getScene();scene && (this.time += .01 * (scene.getAnimationRatio() * this.animationSpeedFactor), this.setFloat("brightness", this.brightness), this.setFloat("persistence", this.persistence), this.setFloat("timeScale", this.time));}_getDefines() {return "#define OCTAVES " + (0 | this.octaves);}render(useCameraPostProcess) {this._updateShaderUniforms(), super.render(useCameraPostProcess);}serialize() {const serializationObject = { customType: "BABYLON.NoiseProceduralTexture", brightness: this.brightness, octaves: this.octaves, persistence: this.persistence, animationSpeedFactor: this.animationSpeedFactor, size: this.getSize().width, generateMipMaps: this._generateMipMaps, time: this.time };return serializationObject;}clone() {const textureSize = this.getSize(),newTexture = new NoiseProceduralTexture(this.name, textureSize.width, this.getScene(), this._fallbackTexture ? this._fallbackTexture : void 0, this._generateMipMaps);return newTexture.hasAlpha = this.hasAlpha, newTexture.level = this.level, newTexture.coordinatesMode = this.coordinatesMode, newTexture.brightness = this.brightness, newTexture.octaves = this.octaves, newTexture.persistence = this.persistence, newTexture.animationSpeedFactor = this.animationSpeedFactor, newTexture.time = this.time, newTexture;}static Parse(parsedTexture, scene) {var _a;const texture = new NoiseProceduralTexture(parsedTexture.name, parsedTexture.size, scene, void 0, parsedTexture.generateMipMaps);return texture.brightness = parsedTexture.brightness, texture.octaves = parsedTexture.octaves, texture.persistence = parsedTexture.persistence, texture.animationSpeedFactor = parsedTexture.animationSpeedFactor, texture.time = null !== (_a = parsedTexture.time) && void 0 !== _a ? _a : 0, texture;}}(0,typeStore/* RegisterClass */.H)("BABYLON.NoiseProceduralTexture", NoiseProceduralTexture);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/rawCubeTexture.js
var rawCubeTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/rawCubeTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/rawTexture2DArray.js
var rawTexture2DArray = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/rawTexture2DArray.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/rawTexture3D.js
class RawTexture3D extends Textures_texture/* Texture */.x {constructor(data, width, height, depth, format, scene, generateMipMaps = !0, invertY = !1, samplingMode = Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, textureType = 0) {super(null, scene, !generateMipMaps, invertY), this.format = format, this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType), this.is3D = !0;}update(data) {this._texture && this._getEngine().updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/refractionTexture.js
class RefractionTexture extends Textures_renderTargetTexture/* RenderTargetTexture */._ {constructor(name, size, scene, generateMipMaps) {super(name, size, scene, generateMipMaps, !0), this.refractionPlane = new math_plane/* Plane */.J(0, 1, 0, 1), this.depth = 2, this.onBeforeRenderObservable.add(() => {this.getScene().clipPlane = this.refractionPlane;}), this.onAfterRenderObservable.add(() => {this.getScene().clipPlane = null;});}clone() {const scene = this.getScene();if (!scene) return this;const textureSize = this.getSize(),newTexture = new RefractionTexture(this.name, textureSize.width, scene, this._generateMipMaps);return newTexture.hasAlpha = this.hasAlpha, newTexture.level = this.level, newTexture.refractionPlane = this.refractionPlane.clone(), this.renderList && (newTexture.renderList = this.renderList.slice(0)), newTexture.depth = this.depth, newTexture;}serialize() {if (!this.name) return null;const serializationObject = super.serialize();return serializationObject.mirrorPlane = this.refractionPlane.asArray(), serializationObject.depth = this.depth, serializationObject;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/thinTexture.js
var thinTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/thinTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js
var thinRenderTargetTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Enums/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialConnectionPointCustomObject.js
class NodeMaterialConnectionPointCustomObject extends NodeMaterialConnectionPoint {constructor(name, ownerBlock, direction, _blockType, _blockName) {super(name, ownerBlock, direction), this._blockType = _blockType, this._blockName = _blockName, this.needDualDirectionValidation = !0;}checkCompatibilityState(connectionPoint) {return connectionPoint instanceof NodeMaterialConnectionPointCustomObject && connectionPoint._blockName === this._blockName ? NodeMaterialConnectionPointCompatibilityStates.Compatible : NodeMaterialConnectionPointCompatibilityStates.TypeIncompatible;}createCustomInputBlock() {return [new this._blockType(this._blockName), this.name];}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/bonesBlock.js
class BonesBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Vertex), this.registerInput("matricesIndices", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("matricesWeights", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("matricesIndicesExtra", NodeMaterialBlockConnectionPointTypes.Vector4, !0), this.registerInput("matricesWeightsExtra", NodeMaterialBlockConnectionPointTypes.Vector4, !0), this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix);}initialize(state) {state._excludeVariableName("boneSampler"), state._excludeVariableName("boneTextureWidth"), state._excludeVariableName("mBones"), state._excludeVariableName("BonesPerMesh");}getClassName() {return "BonesBlock";}get matricesIndices() {return this._inputs[0];}get matricesWeights() {return this._inputs[1];}get matricesIndicesExtra() {return this._inputs[2];}get matricesWeightsExtra() {return this._inputs[3];}get world() {return this._inputs[4];}get output() {return this._outputs[0];}autoConfigure(material) {if (!this.matricesIndices.isConnected) {let matricesIndicesInput = material.getInputBlockByPredicate((b) => b.isAttribute && "matricesIndices" === b.name);matricesIndicesInput || (matricesIndicesInput = new InputBlock("matricesIndices"), matricesIndicesInput.setAsAttribute("matricesIndices")), matricesIndicesInput.output.connectTo(this.matricesIndices);}if (!this.matricesWeights.isConnected) {let matricesWeightsInput = material.getInputBlockByPredicate((b) => b.isAttribute && "matricesWeights" === b.name);matricesWeightsInput || (matricesWeightsInput = new InputBlock("matricesWeights"), matricesWeightsInput.setAsAttribute("matricesWeights")), matricesWeightsInput.output.connectTo(this.matricesWeights);}if (!this.world.isConnected) {let worldInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.World);worldInput || (worldInput = new InputBlock("world"), worldInput.setAsSystemValue(NodeMaterialSystemValues.World)), worldInput.output.connectTo(this.world);}}provideFallbacks(mesh, fallbacks) {mesh && mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton && fallbacks.addCPUSkinningFallback(0, mesh);}bind(effect, nodeMaterial, mesh) {materialHelper/* MaterialHelper.BindBonesParameters */.G.BindBonesParameters(mesh, effect);}prepareDefines(mesh, nodeMaterial, defines) {defines._areAttributesDirty && materialHelper/* MaterialHelper.PrepareDefinesForBones */.G.PrepareDefinesForBones(mesh, defines);}_buildBlock(state) {super._buildBlock(state), state.sharedData.blocksWithFallbacks.push(this), state.sharedData.forcedBindableBlocks.push(this), state.sharedData.blocksWithDefines.push(this), state.uniforms.push("boneTextureWidth"), state.uniforms.push("mBones"), state.samplers.push("boneSampler");const comments = `//${this.name}`;state._emitFunctionFromInclude("bonesDeclaration", comments, { removeAttributes: !0, removeUniforms: !1, removeVaryings: !0, removeIfDef: !1 });const influenceVariablename = state._getFreeVariableName("influence");state.compilationString += state._emitCodeFromInclude("bonesVertex", comments, { replaceStrings: [{ search: /finalWorld=finalWorld\*influence;/, replace: "" }, { search: /influence/gm, replace: influenceVariablename }] });const output = this._outputs[0],worldInput = this.world;return state.compilationString += `#if NUM_BONE_INFLUENCERS>0\r\n`, state.compilationString += this._declareOutput(output, state) + ` = ${worldInput.associatedVariableName} * ${influenceVariablename};\r\n`, state.compilationString += `#else\r\n`, state.compilationString += this._declareOutput(output, state) + ` = ${worldInput.associatedVariableName};\r\n`, state.compilationString += `#endif\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.BonesBlock", BonesBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/instancesBlock.js
class InstancesBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Vertex), this.registerInput("world0", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("world1", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("world2", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("world3", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, !0), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix), this.registerOutput("instanceID", NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "InstancesBlock";}get world0() {return this._inputs[0];}get world1() {return this._inputs[1];}get world2() {return this._inputs[2];}get world3() {return this._inputs[3];}get world() {return this._inputs[4];}get output() {return this._outputs[0];}get instanceID() {return this._outputs[1];}autoConfigure(material) {if (!this.world0.connectedPoint) {let world0Input = material.getInputBlockByPredicate((b) => b.isAttribute && "world0" === b.name);world0Input || (world0Input = new InputBlock("world0"), world0Input.setAsAttribute("world0")), world0Input.output.connectTo(this.world0);}if (!this.world1.connectedPoint) {let world1Input = material.getInputBlockByPredicate((b) => b.isAttribute && "world1" === b.name);world1Input || (world1Input = new InputBlock("world1"), world1Input.setAsAttribute("world1")), world1Input.output.connectTo(this.world1);}if (!this.world2.connectedPoint) {let world2Input = material.getInputBlockByPredicate((b) => b.isAttribute && "world2" === b.name);world2Input || (world2Input = new InputBlock("world2"), world2Input.setAsAttribute("world2")), world2Input.output.connectTo(this.world2);}if (!this.world3.connectedPoint) {let world3Input = material.getInputBlockByPredicate((b) => b.isAttribute && "world3" === b.name);world3Input || (world3Input = new InputBlock("world3"), world3Input.setAsAttribute("world3")), world3Input.output.connectTo(this.world3);}if (!this.world.connectedPoint) {let worldInput = material.getInputBlockByPredicate((b) => b.isAttribute && "world" === b.name);worldInput || (worldInput = new InputBlock("world"), worldInput.setAsSystemValue(NodeMaterialSystemValues.World)), worldInput.output.connectTo(this.world);}this.world.define = "!INSTANCES || THIN_INSTANCES";}prepareDefines(mesh, nodeMaterial, defines, useInstances = !1, subMesh) {let changed = !1;defines.INSTANCES !== useInstances && (defines.setValue("INSTANCES", useInstances), changed = !0), subMesh && defines.THIN_INSTANCES !== !(!(null !== subMesh && void 0 !== subMesh) || !subMesh.getRenderingMesh().hasThinInstances) && (defines.setValue("THIN_INSTANCES", !(!(null !== subMesh && void 0 !== subMesh) || !subMesh.getRenderingMesh().hasThinInstances)), changed = !0), changed && defines.markAsUnprocessed();}_buildBlock(state) {super._buildBlock(state);const engine = state.sharedData.scene.getEngine();state.sharedData.blocksWithDefines.push(this);const output = this._outputs[0],instanceID = this._outputs[1],world0 = this.world0,world1 = this.world1,world2 = this.world2,world3 = this.world3;return state.compilationString += `#ifdef INSTANCES\r\n`, state.compilationString += this._declareOutput(output, state) + ` = mat4(${world0.associatedVariableName}, ${world1.associatedVariableName}, ${world2.associatedVariableName}, ${world3.associatedVariableName});\r\n`, state.compilationString += `#ifdef THIN_INSTANCES\r\n`, state.compilationString += `${output.associatedVariableName} = ${this.world.associatedVariableName} * ${output.associatedVariableName};\r\n`, state.compilationString += `#endif\r\n`, state.compilationString += engine._caps.canUseGLInstanceID ? this._declareOutput(instanceID, state) + ` = float(gl_InstanceID);\r\n` : this._declareOutput(instanceID, state) + ` = 0.0;\r\n`, state.compilationString += `#else\r\n`, state.compilationString += this._declareOutput(output, state) + ` = ${this.world.associatedVariableName};\r\n`, state.compilationString += this._declareOutput(instanceID, state) + ` = 0.0;\r\n`, state.compilationString += `#endif\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.InstancesBlock", InstancesBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/morphTargetsBlock.js
class MorphTargetsBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Vertex), this.registerInput("position", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerInput("tangent", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.tangent.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Vector3), this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerOutput("positionOutput", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerOutput("normalOutput", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerOutput("tangentOutput", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerOutput("uvOutput", NodeMaterialBlockConnectionPointTypes.Vector2);}getClassName() {return "MorphTargetsBlock";}get position() {return this._inputs[0];}get normal() {return this._inputs[1];}get tangent() {return this._inputs[2];}get uv() {return this._inputs[3];}get positionOutput() {return this._outputs[0];}get normalOutput() {return this._outputs[1];}get tangentOutput() {return this._outputs[2];}get uvOutput() {return this._outputs[3];}initialize(state) {state._excludeVariableName("morphTargetInfluences");}autoConfigure(material) {if (!this.position.isConnected) {let positionInput = material.getInputBlockByPredicate((b) => b.isAttribute && "position" === b.name);positionInput || (positionInput = new InputBlock("position"), positionInput.setAsAttribute()), positionInput.output.connectTo(this.position);}if (!this.normal.isConnected) {let normalInput = material.getInputBlockByPredicate((b) => b.isAttribute && "normal" === b.name);normalInput || (normalInput = new InputBlock("normal"), normalInput.setAsAttribute("normal")), normalInput.output.connectTo(this.normal);}if (!this.tangent.isConnected) {let tangentInput = material.getInputBlockByPredicate((b) => b.isAttribute && "tangent" === b.name);tangentInput || (tangentInput = new InputBlock("tangent"), tangentInput.setAsAttribute("tangent")), tangentInput.output.connectTo(this.tangent);}if (!this.uv.isConnected) {let uvInput = material.getInputBlockByPredicate((b) => b.isAttribute && "uv" === b.name);uvInput || (uvInput = new InputBlock("uv"), uvInput.setAsAttribute("uv")), uvInput.output.connectTo(this.uv);}}prepareDefines(mesh, nodeMaterial, defines) {if (mesh.morphTargetManager) {const morphTargetManager = mesh.morphTargetManager;(null === morphTargetManager || void 0 === morphTargetManager ? void 0 : morphTargetManager.isUsingTextureForTargets) && morphTargetManager.numInfluencers !== defines.NUM_MORPH_INFLUENCERS && defines.markAsAttributesDirty();}defines._areAttributesDirty && materialHelper/* MaterialHelper.PrepareDefinesForMorphTargets */.G.PrepareDefinesForMorphTargets(mesh, defines);}bind(effect, nodeMaterial, mesh) {mesh && mesh.morphTargetManager && 0 < mesh.morphTargetManager.numInfluencers && (materialHelper/* MaterialHelper.BindMorphTargetParameters */.G.BindMorphTargetParameters(mesh, effect), mesh.morphTargetManager.isUsingTextureForTargets && mesh.morphTargetManager._bind(effect));}replaceRepeatableContent(vertexShaderState, fragmentShaderState, mesh, defines) {const position = this.position,normal = this.normal,tangent = this.tangent,uv = this.uv,positionOutput = this.positionOutput,normalOutput = this.normalOutput,tangentOutput = this.tangentOutput,uvOutput = this.uvOutput,state = vertexShaderState,repeatCount = defines.NUM_MORPH_INFLUENCERS,manager = mesh.morphTargetManager,hasNormals = manager && manager.supportsNormals && defines.NORMAL,hasTangents = manager && manager.supportsTangents && defines.TANGENT,hasUVs = manager && manager.supportsUVs && defines.UV1;let injectionCode = "";(null === manager || void 0 === manager ? void 0 : manager.isUsingTextureForTargets) && 0 < repeatCount && (injectionCode += `float vertexID;\r\n`);for (let index = 0; index < repeatCount; index++) injectionCode += `#ifdef MORPHTARGETS\r\n`, (null === manager || void 0 === manager ? void 0 : manager.isUsingTextureForTargets) ? (injectionCode += `vertexID = float(gl_VertexID) * morphTargetTextureInfo.x;\r\n`, injectionCode += `${positionOutput.associatedVariableName} += (readVector3FromRawSampler(${index}, vertexID) - ${position.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`, injectionCode += `vertexID += 1.0;\r\n`) : injectionCode += `${positionOutput.associatedVariableName} += (position${index} - ${position.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`, hasNormals && (injectionCode += `#ifdef MORPHTARGETS_NORMAL\r\n`, (null === manager || void 0 === manager ? void 0 : manager.isUsingTextureForTargets) ? (injectionCode += `${normalOutput.associatedVariableName} += (readVector3FromRawSampler(${index}, vertexID) - ${normal.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`, injectionCode += `vertexID += 1.0;\r\n`) : injectionCode += `${normalOutput.associatedVariableName} += (normal${index} - ${normal.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`, injectionCode += `#endif\r\n`), hasUVs && (injectionCode += `#ifdef MORPHTARGETS_UV\r\n`, (null === manager || void 0 === manager ? void 0 : manager.isUsingTextureForTargets) ? (injectionCode += `${uvOutput.associatedVariableName} += (readVector3FromRawSampler(${index}, vertexID).xy - ${uv.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`, injectionCode += `vertexID += 1.0;\r\n`) : injectionCode += `${uvOutput.associatedVariableName}.xy += (uv_${index} - ${uv.associatedVariableName}.xy) * morphTargetInfluences[${index}];\r\n`, injectionCode += `#endif\r\n`), hasTangents && (injectionCode += `#ifdef MORPHTARGETS_TANGENT\r\n`, injectionCode += (null === manager || void 0 === manager ? void 0 : manager.isUsingTextureForTargets) ? `${tangentOutput.associatedVariableName}.xyz += (readVector3FromRawSampler(${index}, vertexID) - ${tangent.associatedVariableName}.xyz) * morphTargetInfluences[${index}];\r\n` : `${tangentOutput.associatedVariableName}.xyz += (tangent${index} - ${tangent.associatedVariableName}.xyz) * morphTargetInfluences[${index}];\r\n`, injectionCode += tangent.type === NodeMaterialBlockConnectionPointTypes.Vector4 ? `${tangentOutput.associatedVariableName}.w = ${tangent.associatedVariableName}.w;\r\n` : `${tangentOutput.associatedVariableName}.w = 1.;\r\n`, injectionCode += `#endif\r\n`), injectionCode += `#endif\r\n`;if (state.compilationString = state.compilationString.replace(this._repeatableContentAnchor, injectionCode), 0 < repeatCount) for (let index = 0; index < repeatCount; index++) state.attributes.push(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind + index), hasNormals && state.attributes.push(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind + index), hasTangents && state.attributes.push(Buffers_buffer/* VertexBuffer.TangentKind */.o.TangentKind + index), hasUVs && state.attributes.push(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind + "_" + index);}_buildBlock(state) {super._buildBlock(state), state.sharedData.blocksWithDefines.push(this), state.sharedData.bindableBlocks.push(this), state.sharedData.repeatableContentBlocks.push(this);const position = this.position,normal = this.normal,tangent = this.tangent,uv = this.uv,positionOutput = this.positionOutput,normalOutput = this.normalOutput,tangentOutput = this.tangentOutput,uvOutput = this.uvOutput,comments = `//${this.name}`;return state.uniforms.push("morphTargetInfluences"), state.uniforms.push("morphTargetTextureInfo"), state.uniforms.push("morphTargetTextureIndices"), state.samplers.push("morphTargets"), state._emitFunctionFromInclude("morphTargetsVertexGlobalDeclaration", comments), state._emitFunctionFromInclude("morphTargetsVertexDeclaration", comments, { repeatKey: "maxSimultaneousMorphTargets" }), state.compilationString += `${this._declareOutput(positionOutput, state)} = ${position.associatedVariableName};\r\n`, state.compilationString += `#ifdef NORMAL\r\n`, state.compilationString += `${this._declareOutput(normalOutput, state)} = ${normal.associatedVariableName};\r\n`, state.compilationString += `#else\r\n`, state.compilationString += `${this._declareOutput(normalOutput, state)} = vec3(0., 0., 0.);\r\n`, state.compilationString += `#endif\r\n`, state.compilationString += `#ifdef TANGENT\r\n`, state.compilationString += `${this._declareOutput(tangentOutput, state)} = ${tangent.associatedVariableName};\r\n`, state.compilationString += `#else\r\n`, state.compilationString += `${this._declareOutput(tangentOutput, state)} = vec4(0., 0., 0., 0.);\r\n`, state.compilationString += `#endif\r\n`, state.compilationString += `#ifdef UV1\r\n`, state.compilationString += `${this._declareOutput(uvOutput, state)} = ${uv.associatedVariableName};\r\n`, state.compilationString += `#else\r\n`, state.compilationString += `${this._declareOutput(uvOutput, state)} = vec2(0., 0.);\r\n`, state.compilationString += `#endif\r\n`, this._repeatableContentAnchor = state._repeatableContentAnchor, state.compilationString += this._repeatableContentAnchor, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.MorphTargetsBlock", MorphTargetsBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/lightInformationBlock.js
class LightInformationBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Vertex), this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, !1, NodeMaterialBlockTargets.Vertex), this.registerOutput("direction", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerOutput("color", NodeMaterialBlockConnectionPointTypes.Color3), this.registerOutput("intensity", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("shadowBias", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("shadowNormalBias", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("shadowDepthScale", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("shadowDepthRange", NodeMaterialBlockConnectionPointTypes.Vector2);}getClassName() {return "LightInformationBlock";}get worldPosition() {return this._inputs[0];}get direction() {return this._outputs[0];}get color() {return this._outputs[1];}get intensity() {return this._outputs[2];}get shadowBias() {return this._outputs[3];}get shadowNormalBias() {return this._outputs[4];}get shadowDepthScale() {return this._outputs[5];}get shadowDepthRange() {return this._outputs[6];}bind(effect, nodeMaterial, mesh) {if (!mesh) return;this.light && this.light.isDisposed() && (this.light = null);let light = this.light;const scene = nodeMaterial.getScene();if (!light && scene.lights.length && (light = this.light = scene.lights[0], this._forcePrepareDefines = !0), !light || !light.isEnabled) return effect.setFloat3(this._lightDataUniformName, 0, 0, 0), void effect.setFloat4(this._lightColorUniformName, 0, 0, 0, 0);light.transferToNodeMaterialEffect(effect, this._lightDataUniformName), effect.setColor4(this._lightColorUniformName, light.diffuse, light.intensity);const generator = light.getShadowGenerator();if ((this.shadowBias.hasEndpoints || this.shadowNormalBias.hasEndpoints || this.shadowDepthScale.hasEndpoints) && (generator ? effect.setFloat3(this._lightShadowUniformName, generator.bias, generator.normalBias, generator.depthScale) : effect.setFloat3(this._lightShadowUniformName, 0, 0, 0)), this.shadowDepthRange) if (generator && scene.activeCamera) {const shadowLight = light;effect.setFloat2(this._lightShadowExtraUniformName, shadowLight.getDepthMinZ(scene.activeCamera), shadowLight.getDepthMinZ(scene.activeCamera) + shadowLight.getDepthMaxZ(scene.activeCamera));} else effect.setFloat2(this._lightShadowExtraUniformName, 0, 0);}prepareDefines(mesh, nodeMaterial, defines) {if (defines._areLightsDirty || this._forcePrepareDefines) {this._forcePrepareDefines = !1;const light = this.light;defines.setValue(this._lightTypeDefineName, !!(light && light instanceof pointLight/* PointLight */.c), !0);}}_buildBlock(state) {super._buildBlock(state), state.sharedData.bindableBlocks.push(this), state.sharedData.blocksWithDefines.push(this);const direction = this.direction,color = this.color,intensity = this.intensity,shadowBias = this.shadowBias,shadowNormalBias = this.shadowNormalBias,shadowDepthScale = this.shadowDepthScale,shadowDepthRange = this.shadowDepthRange;return this._lightDataUniformName = state._getFreeVariableName("lightData"), this._lightColorUniformName = state._getFreeVariableName("lightColor"), this._lightShadowUniformName = state._getFreeVariableName("shadowData"), this._lightShadowExtraUniformName = state._getFreeVariableName("shadowExtraData"), this._lightTypeDefineName = state._getFreeDefineName("LIGHTPOINTTYPE"), state._emitUniformFromString(this._lightDataUniformName, "vec3"), state._emitUniformFromString(this._lightColorUniformName, "vec4"), state.compilationString += `#ifdef ${this._lightTypeDefineName}\r\n`, state.compilationString += this._declareOutput(direction, state) + ` = normalize(${this.worldPosition.associatedVariableName}.xyz - ${this._lightDataUniformName});\r\n`, state.compilationString += `#else\r\n`, state.compilationString += this._declareOutput(direction, state) + ` = ${this._lightDataUniformName};\r\n`, state.compilationString += `#endif\r\n`, state.compilationString += this._declareOutput(color, state) + ` = ${this._lightColorUniformName}.rgb;\r\n`, state.compilationString += this._declareOutput(intensity, state) + ` = ${this._lightColorUniformName}.a;\r\n`, (shadowBias.hasEndpoints || shadowNormalBias.hasEndpoints || shadowDepthScale.hasEndpoints) && (state._emitUniformFromString(this._lightShadowUniformName, "vec3"), shadowBias.hasEndpoints && (state.compilationString += this._declareOutput(shadowBias, state) + ` = ${this._lightShadowUniformName}.x;\r\n`), shadowNormalBias.hasEndpoints && (state.compilationString += this._declareOutput(shadowNormalBias, state) + ` = ${this._lightShadowUniformName}.y;\r\n`), shadowDepthScale.hasEndpoints && (state.compilationString += this._declareOutput(shadowDepthScale, state) + ` = ${this._lightShadowUniformName}.z;\r\n`)), shadowDepthRange.hasEndpoints && (state._emitUniformFromString(this._lightShadowExtraUniformName, "vec2"), state.compilationString += this._declareOutput(shadowDepthRange, state) + ` = ${this._lightShadowUniformName};\r\n`), this;}serialize() {const serializationObject = super.serialize();return this.light && (serializationObject.lightId = this.light.id), serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), serializationObject.lightId && (this.light = scene.getLightById(serializationObject.lightId));}}(0,typeStore/* RegisterClass */.H)("BABYLON.LightInformationBlock", LightInformationBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/imageProcessingBlock.js
class ImageProcessingBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.convertInputToLinearSpace = !0, this.registerInput("color", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color4), this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "ImageProcessingBlock";}get color() {return this._inputs[0];}get output() {return this._outputs[0];}get rgb() {return this._outputs[1];}initialize(state) {state._excludeVariableName("exposureLinear"), state._excludeVariableName("contrast"), state._excludeVariableName("vInverseScreenSize"), state._excludeVariableName("vignetteSettings1"), state._excludeVariableName("vignetteSettings2"), state._excludeVariableName("vCameraColorCurveNegative"), state._excludeVariableName("vCameraColorCurveNeutral"), state._excludeVariableName("vCameraColorCurvePositive"), state._excludeVariableName("txColorTransform"), state._excludeVariableName("colorTransformSettings"), state._excludeVariableName("ditherIntensity");}isReady(mesh, nodeMaterial, defines) {return !(defines._areImageProcessingDirty && nodeMaterial.imageProcessingConfiguration && !nodeMaterial.imageProcessingConfiguration.isReady());}prepareDefines(mesh, nodeMaterial, defines) {defines._areImageProcessingDirty && nodeMaterial.imageProcessingConfiguration && nodeMaterial.imageProcessingConfiguration.prepareDefines(defines);}bind(effect, nodeMaterial, mesh) {mesh && nodeMaterial.imageProcessingConfiguration && nodeMaterial.imageProcessingConfiguration.bind(effect);}_buildBlock(state) {var _a;super._buildBlock(state), state.sharedData.blocksWithDefines.push(this), state.sharedData.blockingBlocks.push(this), state.sharedData.bindableBlocks.push(this), state.uniforms.push("exposureLinear"), state.uniforms.push("contrast"), state.uniforms.push("vInverseScreenSize"), state.uniforms.push("vignetteSettings1"), state.uniforms.push("vignetteSettings2"), state.uniforms.push("vCameraColorCurveNegative"), state.uniforms.push("vCameraColorCurveNeutral"), state.uniforms.push("vCameraColorCurvePositive"), state.uniforms.push("txColorTransform"), state.uniforms.push("colorTransformSettings"), state.uniforms.push("ditherIntensity");const color = this.color,output = this._outputs[0],comments = `//${this.name}`;return state._emitFunctionFromInclude("helperFunctions", comments), state._emitFunctionFromInclude("imageProcessingDeclaration", comments), state._emitFunctionFromInclude("imageProcessingFunctions", comments), (null === (_a = color.connectedPoint) || void 0 === _a ? void 0 : _a.isConnected) && (state.compilationString += color.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Color4 || color.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Vector4 ? `${this._declareOutput(output, state)} = ${color.associatedVariableName};\r\n` : `${this._declareOutput(output, state)} = vec4(${color.associatedVariableName}, 1.0);\r\n`, state.compilationString += `#ifdef IMAGEPROCESSINGPOSTPROCESS\r\n`, this.convertInputToLinearSpace && (state.compilationString += `${output.associatedVariableName}.rgb = toLinearSpace(${color.associatedVariableName}.rgb);\r\n`), state.compilationString += `#else\r\n`, state.compilationString += `#ifdef IMAGEPROCESSING\r\n`, this.convertInputToLinearSpace && (state.compilationString += `${output.associatedVariableName}.rgb = toLinearSpace(${color.associatedVariableName}.rgb);\r\n`), state.compilationString += `${output.associatedVariableName} = applyImageProcessing(${output.associatedVariableName});\r\n`, state.compilationString += `#endif\r\n`, state.compilationString += `#endif\r\n`, this.rgb.hasEndpoints && (state.compilationString += this._declareOutput(this.rgb, state) + ` = ${this.output.associatedVariableName}.xyz;\r\n`)), this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return codeString += `${this._codeVariableName}.convertInputToLinearSpace = ${this.convertInputToLinearSpace};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.convertInputToLinearSpace = this.convertInputToLinearSpace, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {var _a;super._deserialize(serializationObject, scene, rootUrl), this.convertInputToLinearSpace = null === (_a = serializationObject.convertInputToLinearSpace) || void 0 === _a || _a;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Convert input to linear space", PropertyTypeForEdition.Boolean, "ADVANCED")], ImageProcessingBlock.prototype, "convertInputToLinearSpace", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ImageProcessingBlock", ImageProcessingBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/TBNBlock.js
class TBNBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment, !0), this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1), this.normal.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Vector3), this.registerInput("tangent", NodeMaterialBlockConnectionPointTypes.Vector4, !1), this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, !1), this.registerOutput("TBN", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("TBN", this, NodeMaterialConnectionPointDirection.Output, TBNBlock, "TBNBlock")), this.registerOutput("row0", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Fragment), this.registerOutput("row1", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Fragment), this.registerOutput("row2", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Fragment);}getClassName() {return "TBNBlock";}initialize(state) {state._excludeVariableName("tbnNormal"), state._excludeVariableName("tbnTangent"), state._excludeVariableName("tbnBitangent"), state._excludeVariableName("TBN");}get normal() {return this._inputs[0];}get tangent() {return this._inputs[1];}get world() {return this._inputs[2];}get TBN() {return this._outputs[0];}get row0() {return this._outputs[1];}get row1() {return this._outputs[2];}get row2() {return this._outputs[3];}get target() {return NodeMaterialBlockTargets.Fragment;}set target(value) {}autoConfigure(material) {if (!this.world.isConnected) {let worldInput = material.getInputBlockByPredicate((b) => b.isSystemValue && b.systemValue === NodeMaterialSystemValues.World);worldInput || (worldInput = new InputBlock("world"), worldInput.setAsSystemValue(NodeMaterialSystemValues.World)), worldInput.output.connectTo(this.world);}if (!this.normal.isConnected) {let normalInput = material.getInputBlockByPredicate((b) => b.isAttribute && "normal" === b.name);normalInput || (normalInput = new InputBlock("normal"), normalInput.setAsAttribute("normal")), normalInput.output.connectTo(this.normal);}if (!this.tangent.isConnected) {let tangentInput = material.getInputBlockByPredicate((b) => b.isAttribute && "tangent" === b.name && b.type === NodeMaterialBlockConnectionPointTypes.Vector4);tangentInput || (tangentInput = new InputBlock("tangent"), tangentInput.setAsAttribute("tangent")), tangentInput.output.connectTo(this.tangent);}}prepareDefines(mesh, nodeMaterial, defines) {var _a, _b, _c, _d;const normal = this.normal,tangent = this.tangent;let normalAvailable = normal.isConnected;(null === (_a = normal.connectInputBlock) || void 0 === _a ? void 0 : _a.isAttribute) && !mesh.isVerticesDataPresent(null === (_b = normal.connectInputBlock) || void 0 === _b ? void 0 : _b.name) && (normalAvailable = !1);let tangentAvailable = tangent.isConnected;(null === (_c = tangent.connectInputBlock) || void 0 === _c ? void 0 : _c.isAttribute) && !mesh.isVerticesDataPresent(null === (_d = tangent.connectInputBlock) || void 0 === _d ? void 0 : _d.name) && (tangentAvailable = !1);const useTBNBlock = normalAvailable && tangentAvailable;defines.setValue("TBNBLOCK", useTBNBlock, !0);}_buildBlock(state) {super._buildBlock(state);const normal = this.normal,tangent = this.tangent,world = this.world,TBN = this.TBN,row0 = this.row0,row1 = this.row1,row2 = this.row2;return state.target === NodeMaterialBlockTargets.Fragment && (state.compilationString += `
                // ${this.name}
                vec3 tbnNormal = normalize(${normal.associatedVariableName}).xyz;
                vec3 tbnTangent = normalize(${tangent.associatedVariableName}.xyz);
                vec3 tbnBitangent = cross(tbnNormal, tbnTangent) * ${tangent.associatedVariableName}.w;
                mat3 ${TBN.associatedVariableName} = mat3(${world.associatedVariableName}) * mat3(tbnTangent, tbnBitangent, tbnNormal);
            `, row0.hasEndpoints && (state.compilationString += this._declareOutput(row0, state) + ` = vec3(${TBN.associatedVariableName}[0][0], ${TBN.associatedVariableName}[0][1], ${TBN.associatedVariableName}[0][2]);\r\n`), row1.hasEndpoints && (state.compilationString += this._declareOutput(row1, state) + ` = vec3(${TBN.associatedVariableName}[1[0], ${TBN.associatedVariableName}[1][1], ${TBN.associatedVariableName}[1][2]);\r\n`), row2.hasEndpoints && (state.compilationString += this._declareOutput(row2, state) + ` = vec3(${TBN.associatedVariableName}[2][0], ${TBN.associatedVariableName}[2][1], ${TBN.associatedVariableName}[2][2]);\r\n`), state.sharedData.blocksWithDefines.push(this)), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.TBNBlock", TBNBlock);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js
var bumpFragmentMainFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js
var bumpFragmentFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js
var bumpFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/perturbNormalBlock.js
class PerturbNormalBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this._tangentSpaceParameterName = "", this._tangentCorrectionFactorName = "", this._worldMatrixName = "", this.invertX = !1, this.invertY = !1, this.useParallaxOcclusion = !1, this.useObjectSpaceNormalMap = !1, this._isUnique = !0, this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, !1), this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, !1), this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.Vector4, !0), this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.Vector2, !1), this.registerInput("normalMapColor", NodeMaterialBlockConnectionPointTypes.Color3, !1), this.registerInput("strength", NodeMaterialBlockConnectionPointTypes.Float, !1), this.registerInput("viewDirection", NodeMaterialBlockConnectionPointTypes.Vector3, !0), this.registerInput("parallaxScale", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("parallaxHeight", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("TBN", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("TBN", this, NodeMaterialConnectionPointDirection.Input, TBNBlock, "TBNBlock")), this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, !0), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerOutput("uvOffset", NodeMaterialBlockConnectionPointTypes.Vector2);}getClassName() {return "PerturbNormalBlock";}get worldPosition() {return this._inputs[0];}get worldNormal() {return this._inputs[1];}get worldTangent() {return this._inputs[2];}get uv() {return this._inputs[3];}get normalMapColor() {return this._inputs[4];}get strength() {return this._inputs[5];}get viewDirection() {return this._inputs[6];}get parallaxScale() {return this._inputs[7];}get parallaxHeight() {return this._inputs[8];}get TBN() {return this._inputs[9];}get world() {return this._inputs[10];}get output() {return this._outputs[0];}get uvOffset() {return this._outputs[1];}prepareDefines(mesh, nodeMaterial, defines) {const normalSamplerName = this.normalMapColor.connectedPoint._ownerBlock.samplerName,useParallax = this.viewDirection.isConnected && (this.useParallaxOcclusion && normalSamplerName || !this.useParallaxOcclusion && this.parallaxHeight.isConnected);defines.setValue("BUMP", !0), defines.setValue("PARALLAX", useParallax, !0), defines.setValue("PARALLAXOCCLUSION", this.useParallaxOcclusion, !0), defines.setValue("OBJECTSPACE_NORMALMAP", this.useObjectSpaceNormalMap, !0);}bind(effect, nodeMaterial, mesh) {nodeMaterial.getScene()._mirroredCameraPosition ? effect.setFloat2(this._tangentSpaceParameterName, this.invertX ? 1 : -1, this.invertY ? 1 : -1) : effect.setFloat2(this._tangentSpaceParameterName, this.invertX ? -1 : 1, this.invertY ? -1 : 1), mesh && (effect.setFloat(this._tangentCorrectionFactorName, 0 > mesh.getWorldMatrix().determinant() ? -1 : 1), this.useObjectSpaceNormalMap && !this.world.isConnected && effect.setMatrix(this._worldMatrixName, mesh.getWorldMatrix()));}autoConfigure(material) {if (!this.uv.isConnected) {let uvInput = material.getInputBlockByPredicate((b) => b.isAttribute && "uv" === b.name);uvInput || (uvInput = new InputBlock("uv"), uvInput.setAsAttribute()), uvInput.output.connectTo(this.uv);}if (!this.strength.isConnected) {const strengthInput = new InputBlock("strength");strengthInput.value = 1, strengthInput.output.connectTo(this.strength);}}_buildBlock(state) {super._buildBlock(state);const comments = `//${this.name}`,uv = this.uv,worldPosition = this.worldPosition,worldNormal = this.worldNormal,worldTangent = this.worldTangent;state.sharedData.blocksWithDefines.push(this), state.sharedData.bindableBlocks.push(this), this._tangentSpaceParameterName = state._getFreeDefineName("tangentSpaceParameter"), state._emitUniformFromString(this._tangentSpaceParameterName, "vec2"), this._tangentCorrectionFactorName = state._getFreeDefineName("tangentCorrectionFactor"), state._emitUniformFromString(this._tangentCorrectionFactorName, "float"), this._worldMatrixName = state._getFreeDefineName("perturbNormalWorldMatrix"), state._emitUniformFromString(this._worldMatrixName, "mat4");let normalSamplerName = null;this.normalMapColor.connectedPoint && (normalSamplerName = this.normalMapColor.connectedPoint._ownerBlock.samplerName);const useParallax = this.viewDirection.isConnected && (this.useParallaxOcclusion && normalSamplerName || !this.useParallaxOcclusion && this.parallaxHeight.isConnected),replaceForParallaxInfos = this.parallaxScale.isConnectedToInputBlock ? this.parallaxScale.connectInputBlock.isConstant ? state._emitFloat(this.parallaxScale.connectInputBlock.value) : this.parallaxScale.associatedVariableName : "0.05",replaceForBumpInfos = this.strength.isConnectedToInputBlock && this.strength.connectInputBlock.isConstant ? `\r\n#if !defined(NORMALXYSCALE)\r\n1.0/\r\n#endif\r\n${state._emitFloat(this.strength.connectInputBlock.value)}` : `\r\n#if !defined(NORMALXYSCALE)\r\n1.0/\r\n#endif\r\n${this.strength.associatedVariableName}`;state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");const tangentReplaceString = { search: /defined\(TANGENT\)/g, replace: worldTangent.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" },TBN = this.TBN;TBN.isConnected ? state.compilationString += `
            #ifdef TBNBLOCK
            mat3 vTBN = ${TBN.associatedVariableName};
            #endif
            ` : worldTangent.isConnected && (state.compilationString += `vec3 tbnNormal = normalize(${worldNormal.associatedVariableName}.xyz);\r\n`, state.compilationString += `vec3 tbnTangent = normalize(${worldTangent.associatedVariableName}.xyz);\r\n`, state.compilationString += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};\r\n`, state.compilationString += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n`), state._emitFunctionFromInclude("bumpFragmentMainFunctions", comments, { replaceStrings: [tangentReplaceString, { search: /varying mat3 vTBN/g, replace: "" }, { search: /uniform mat4 normalMatrix;/g, replace: "" }] }), state._emitFunctionFromInclude("bumpFragmentFunctions", comments, { replaceStrings: [{ search: /#include<samplerFragmentDeclaration>\(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump\)/g, replace: "" }, { search: /uniform sampler2D bumpSampler;/g, replace: "" }, { search: /vec2 parallaxOcclusion\(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale\)/g, replace: "#define inline\r\nvec2 parallaxOcclusion(vec3 vViewDirCoT, vec3 vNormalCoT, vec2 texCoord, float parallaxScale, sampler2D bumpSampler)" }, { search: /vec2 parallaxOffset\(vec3 viewDir,float heightScale\)/g, replace: "vec2 parallaxOffset(vec3 viewDir, float heightScale, float height_)" }, { search: /texture2D\(bumpSampler,vBumpUV\)\.w/g, replace: "height_" }] });const uvForPerturbNormal = useParallax && normalSamplerName ? `texture2D(${normalSamplerName}, ${uv.associatedVariableName} + uvOffset).xyz` : this.normalMapColor.associatedVariableName;return state.compilationString += this._declareOutput(this.output, state) + " = vec4(0.);\r\n", state.compilationString += state._emitCodeFromInclude("bumpFragment", comments, { replaceStrings: [{ search: /texture2D\(bumpSampler,vBumpUV\)/g, replace: `${uvForPerturbNormal}` }, { search: /#define CUSTOM_FRAGMENT_BUMP_FRAGMENT/g, replace: `mat4 normalMatrix = toNormalMatrix(${this.world.isConnected ? this.world.associatedVariableName : this._worldMatrixName});` }, { search: /perturbNormal\(TBN,texture2D\(bumpSampler,vBumpUV\+uvOffset\).xyz,vBumpInfos.y\)/g, replace: `perturbNormal(TBN, ${uvForPerturbNormal}, vBumpInfos.y)` }, { search: /parallaxOcclusion\(invTBN\*-viewDirectionW,invTBN\*normalW,vBumpUV,vBumpInfos.z\)/g, replace: `parallaxOcclusion((invTBN * -viewDirectionW), (invTBN * normalW), vBumpUV, vBumpInfos.z, ${useParallax && this.useParallaxOcclusion ? normalSamplerName : "bumpSampler"})` }, { search: /parallaxOffset\(invTBN\*viewDirectionW,vBumpInfos\.z\)/g, replace: `parallaxOffset(invTBN * viewDirectionW, vBumpInfos.z, ${useParallax ? this.parallaxHeight.associatedVariableName : "0."})` }, { search: /vTangentSpaceParams/g, replace: this._tangentSpaceParameterName }, { search: /vBumpInfos.y/g, replace: replaceForBumpInfos }, { search: /vBumpInfos.z/g, replace: replaceForParallaxInfos }, { search: /vBumpUV/g, replace: uv.associatedVariableName }, { search: /vPositionW/g, replace: worldPosition.associatedVariableName + ".xyz" }, { search: /normalW=/g, replace: this.output.associatedVariableName + ".xyz = " }, { search: /mat3\(normalMatrix\)\*normalW/g, replace: "mat3(normalMatrix) * " + this.output.associatedVariableName + ".xyz" }, { search: /normalW/g, replace: worldNormal.associatedVariableName + ".xyz" }, { search: /viewDirectionW/g, replace: useParallax ? this.viewDirection.associatedVariableName : "vec3(0.)" }, tangentReplaceString] }), this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.invertX = ${this.invertX};\r\n`;return codeString += `${this._codeVariableName}.invertY = ${this.invertY};\r\n`, codeString += `${this._codeVariableName}.useParallaxOcclusion = ${this.useParallaxOcclusion};\r\n`, codeString += `${this._codeVariableName}.useObjectSpaceNormalMap = ${this.useObjectSpaceNormalMap};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.invertX = this.invertX, serializationObject.invertY = this.invertY, serializationObject.useParallaxOcclusion = this.useParallaxOcclusion, serializationObject.useObjectSpaceNormalMap = this.useObjectSpaceNormalMap, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.invertX = serializationObject.invertX, this.invertY = serializationObject.invertY, this.useParallaxOcclusion = !!serializationObject.useParallaxOcclusion, this.useObjectSpaceNormalMap = !!serializationObject.useObjectSpaceNormalMap;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Invert X axis", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !1 } })], PerturbNormalBlock.prototype, "invertX", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Invert Y axis", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !1 } })], PerturbNormalBlock.prototype, "invertY", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Use parallax occlusion", PropertyTypeForEdition.Boolean)], PerturbNormalBlock.prototype, "useParallaxOcclusion", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Object Space Mode", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !1 } })], PerturbNormalBlock.prototype, "useObjectSpaceNormalMap", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.PerturbNormalBlock", PerturbNormalBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/discardBlock.js
class DiscardBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment, !0), this.registerInput("value", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("cutoff", NodeMaterialBlockConnectionPointTypes.Float, !0);}getClassName() {return "DiscardBlock";}get value() {return this._inputs[0];}get cutoff() {return this._inputs[1];}_buildBlock(state) {if (super._buildBlock(state), state.sharedData.hints.needAlphaTesting = !0, this.cutoff.isConnected && this.value.isConnected) return state.compilationString += `if (${this.value.associatedVariableName} < ${this.cutoff.associatedVariableName}) discard;\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.DiscardBlock", DiscardBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/frontFacingBlock.js
class FrontFacingBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);}getClassName() {return "FrontFacingBlock";}get output() {return this._outputs[0];}_buildBlock(state) {if (super._buildBlock(state), state.target === NodeMaterialBlockTargets.Vertex) throw "FrontFacingBlock must only be used in a fragment shader";const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = gl_FrontFacing ? 1.0 : 0.0;\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.FrontFacingBlock", FrontFacingBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/derivativeBlock.js
class DerivativeBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1), this.registerOutput("dx", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this.registerOutput("dy", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._outputs[1]._typeConnectionSource = this._inputs[0];}getClassName() {return "DerivativeBlock";}get input() {return this._inputs[0];}get dx() {return this._outputs[0];}get dy() {return this._outputs[1];}_buildBlock(state) {super._buildBlock(state);const dx = this._outputs[0],dy = this._outputs[1];return state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable"), dx.hasEndpoints && (state.compilationString += this._declareOutput(dx, state) + ` = dFdx(${this.input.associatedVariableName});\r\n`), dy.hasEndpoints && (state.compilationString += this._declareOutput(dy, state) + ` = dFdy(${this.input.associatedVariableName});\r\n`), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.DerivativeBlock", DerivativeBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/fragCoordBlock.js
class FragCoordBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2, NodeMaterialBlockTargets.Fragment), this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Fragment), this.registerOutput("xyzw", NodeMaterialBlockConnectionPointTypes.Vector4, NodeMaterialBlockTargets.Fragment), this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment), this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment), this.registerOutput("z", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment), this.registerOutput("w", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);}getClassName() {return "FragCoordBlock";}get xy() {return this._outputs[0];}get xyz() {return this._outputs[1];}get xyzw() {return this._outputs[2];}get x() {return this._outputs[3];}get y() {return this._outputs[4];}get z() {return this._outputs[5];}get output() {return this._outputs[6];}writeOutputs(state) {let code = "";for (const output of this._outputs) output.hasEndpoints && (code += `${this._declareOutput(output, state)} = gl_FragCoord.${output.name};\r\n`);return code;}_buildBlock(state) {if (super._buildBlock(state), state.target === NodeMaterialBlockTargets.Vertex) throw "FragCoordBlock must only be used in a fragment shader";return state.compilationString += this.writeOutputs(state), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.FragCoordBlock", FragCoordBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/screenSizeBlock.js
class ScreenSizeBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2, NodeMaterialBlockTargets.Fragment), this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment), this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);}getClassName() {return "ScreenSizeBlock";}get xy() {return this._outputs[0];}get x() {return this._outputs[1];}get y() {return this._outputs[2];}bind(effect) {const engine = this._scene.getEngine();effect.setFloat2(this._varName, engine.getRenderWidth(), engine.getRenderHeight());}writeOutputs(state, varName) {let code = "";for (const output of this._outputs) output.hasEndpoints && (code += `${this._declareOutput(output, state)} = ${varName}.${output.name};\r\n`);return code;}_buildBlock(state) {if (super._buildBlock(state), this._scene = state.sharedData.scene, state.target === NodeMaterialBlockTargets.Vertex) throw "ScreenSizeBlock must only be used in a fragment shader";return state.sharedData.bindableBlocks.push(this), this._varName = state._getFreeVariableName("screenSize"), state._emitUniformFromString(this._varName, "vec2"), state.compilationString += this.writeOutputs(state, this._varName), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ScreenSizeBlock", ScreenSizeBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/screenSpaceBlock.js
class ScreenSpaceBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.registerInput("vector", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("worldViewProjection", NodeMaterialBlockConnectionPointTypes.Matrix), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float), this.inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "ScreenSpaceBlock";}get vector() {return this._inputs[0];}get worldViewProjection() {return this._inputs[1];}get output() {return this._outputs[0];}get x() {return this._outputs[1];}get y() {return this._outputs[2];}autoConfigure(material) {if (!this.worldViewProjection.isConnected) {let worldViewProjectionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.WorldViewProjection);worldViewProjectionInput || (worldViewProjectionInput = new InputBlock("worldViewProjection"), worldViewProjectionInput.setAsSystemValue(NodeMaterialSystemValues.WorldViewProjection)), worldViewProjectionInput.output.connectTo(this.worldViewProjection);}}_buildBlock(state) {super._buildBlock(state);const vector = this.vector,worldViewProjection = this.worldViewProjection;if (!vector.connectedPoint) return;const worldViewProjectionName = worldViewProjection.associatedVariableName,tempVariableName = state._getFreeVariableName("screenSpaceTemp");switch (vector.connectedPoint.type) {case NodeMaterialBlockConnectionPointTypes.Vector3:state.compilationString += `vec4 ${tempVariableName} = ${worldViewProjectionName} * vec4(${vector.associatedVariableName}, 1.0);\r\n`;break;case NodeMaterialBlockConnectionPointTypes.Vector4:state.compilationString += `vec4 ${tempVariableName} = ${worldViewProjectionName} * ${vector.associatedVariableName};\r\n`;}return state.compilationString += `${tempVariableName}.xy /= ${tempVariableName}.w;`, state.compilationString += `${tempVariableName}.xy = ${tempVariableName}.xy * 0.5 + vec2(0.5, 0.5);`, this.output.hasEndpoints && (state.compilationString += this._declareOutput(this.output, state) + ` = ${tempVariableName}.xy;\r\n`), this.x.hasEndpoints && (state.compilationString += this._declareOutput(this.x, state) + ` = ${tempVariableName}.x;\r\n`), this.y.hasEndpoints && (state.compilationString += this._declareOutput(this.y, state) + ` = ${tempVariableName}.y;\r\n`), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ScreenSpaceBlock", ScreenSpaceBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/twirlBlock.js
class TwirlBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerInput("strength", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("center", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerInput("offset", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "TwirlBlock";}get input() {return this._inputs[0];}get strength() {return this._inputs[1];}get center() {return this._inputs[2];}get offset() {return this._inputs[3];}get output() {return this._outputs[0];}get x() {return this._outputs[1];}get y() {return this._outputs[2];}autoConfigure() {if (!this.center.isConnected) {const centerInput = new InputBlock("center");centerInput.value = new math_vector/* Vector2 */.FM(.5, .5), centerInput.output.connectTo(this.center);}if (!this.strength.isConnected) {const strengthInput = new InputBlock("strength");strengthInput.value = 1, strengthInput.output.connectTo(this.strength);}if (!this.offset.isConnected) {const offsetInput = new InputBlock("offset");offsetInput.value = new math_vector/* Vector2 */.FM(0, 0), offsetInput.output.connectTo(this.offset);}}_buildBlock(state) {super._buildBlock(state);const tempDelta = state._getFreeVariableName("delta"),tempAngle = state._getFreeVariableName("angle"),tempX = state._getFreeVariableName("x"),tempY = state._getFreeVariableName("y"),tempResult = state._getFreeVariableName("result");return state.compilationString += `
            vec2 ${tempDelta} = ${this.input.associatedVariableName} - ${this.center.associatedVariableName};
            float ${tempAngle} = ${this.strength.associatedVariableName} * length(${tempDelta});
            float ${tempX} = cos(${tempAngle}) * ${tempDelta}.x - sin(${tempAngle}) * ${tempDelta}.y;
            float ${tempY} = sin(${tempAngle}) * ${tempDelta}.x + cos(${tempAngle}) * ${tempDelta}.y;
            vec2 ${tempResult} = vec2(${tempX} + ${this.center.associatedVariableName}.x + ${this.offset.associatedVariableName}.x, ${tempY} + ${this.center.associatedVariableName}.y + ${this.offset.associatedVariableName}.y);
        `, this.output.hasEndpoints && (state.compilationString += this._declareOutput(this.output, state) + ` = ${tempResult};\r\n`), this.x.hasEndpoints && (state.compilationString += this._declareOutput(this.x, state) + ` = ${tempResult}.x;\r\n`), this.y.hasEndpoints && (state.compilationString += this._declareOutput(this.y, state) + ` = ${tempResult}.y;\r\n`), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.TwirlBlock", TwirlBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/heightToNormalBlock.js
class HeightToNormalBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.generateInWorldSpace = !1, this.automaticNormalizationNormal = !0, this.automaticNormalizationTangent = !0, this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.AutoDetect, !0), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3), this._inputs[3].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "HeightToNormalBlock";}get input() {return this._inputs[0];}get worldPosition() {return this._inputs[1];}get worldNormal() {return this._inputs[2];}get worldTangent() {return this._inputs[3];}get output() {return this._outputs[0];}get xyz() {return this._outputs[1];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];this.generateInWorldSpace || this.worldTangent.isConnected || console.error(`You must connect the 'worldTangent' input of the ${this.name} block!`);const startCode = this.generateInWorldSpace ? "" : `
            vec3 biTangent = cross(normal, tangent);
            mat3 TBN = mat3(tangent, biTangent, normal);
            `,endCode = this.generateInWorldSpace ? "" : `
            result = TBN * result;
            result = result * vec3(0.5) + vec3(0.5);
            `,heightToNormal = `
            vec4 heightToNormal(in float height, in vec3 position, in vec3 tangent, in vec3 normal) {
                ${startCode}
                ${this.automaticNormalizationTangent ? "tangent = normalize(tangent);" : ""}
                ${this.automaticNormalizationNormal ? "normal = normalize(normal);" : ""}
                vec3 worlddX = dFdx(position);
                vec3 worlddY = dFdy(position);
                vec3 crossX = cross(normal, worlddX);
                vec3 crossY = cross(normal, worlddY);
                float d = abs(dot(crossY, worlddX));
                vec3 inToNormal = vec3(((((height + dFdx(height)) - height) * crossY) + (((height + dFdy(height)) - height) * crossX)) * sign(d));
                inToNormal.y *= -1.0;
                vec3 result = normalize((d * normal) - inToNormal);
                ${endCode}
                return vec4(result, 0.);
            }`;return state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable"), state._emitFunction("heightToNormal", heightToNormal, "// heightToNormal"), state.compilationString += this._declareOutput(output, state) + ` = heightToNormal(${this.input.associatedVariableName}, ${this.worldPosition.associatedVariableName}, ${this.worldTangent.isConnected ? this.worldTangent.associatedVariableName : "vec3(0.)"}.xyz, ${this.worldNormal.associatedVariableName});\r\n`, this.xyz.hasEndpoints && (state.compilationString += this._declareOutput(this.xyz, state) + ` = ${this.output.associatedVariableName}.xyz;\r\n`), this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return codeString += `${this._codeVariableName}.generateInWorldSpace = ${this.generateInWorldSpace};\r\n`, codeString += `${this._codeVariableName}.automaticNormalizationNormal = ${this.automaticNormalizationNormal};\r\n`, codeString += `${this._codeVariableName}.automaticNormalizationTangent = ${this.automaticNormalizationTangent};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.generateInWorldSpace = this.generateInWorldSpace, serializationObject.automaticNormalizationNormal = this.automaticNormalizationNormal, serializationObject.automaticNormalizationTangent = this.automaticNormalizationTangent, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.generateInWorldSpace = serializationObject.generateInWorldSpace, this.automaticNormalizationNormal = serializationObject.automaticNormalizationNormal, this.automaticNormalizationTangent = serializationObject.automaticNormalizationTangent;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Generate in world space instead of tangent space", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !0 } })], HeightToNormalBlock.prototype, "generateInWorldSpace", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Force normalization for the worldNormal input", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !0 } })], HeightToNormalBlock.prototype, "automaticNormalizationNormal", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Force normalization for the worldTangent input", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !0 } })], HeightToNormalBlock.prototype, "automaticNormalizationTangent", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.HeightToNormalBlock", HeightToNormalBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/fragDepthBlock.js
class FragDepthBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment, !0), this.registerInput("depth", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("worldPos", NodeMaterialBlockConnectionPointTypes.Vector4, !0), this.registerInput("viewProjection", NodeMaterialBlockConnectionPointTypes.Matrix, !0);}getClassName() {return "FragDepthBlock";}get depth() {return this._inputs[0];}get worldPos() {return this._inputs[1];}get viewProjection() {return this._inputs[2];}_buildBlock(state) {return super._buildBlock(state), this.depth.isConnected ? state.compilationString += `gl_FragDepth = ${this.depth.associatedVariableName};\r\n` : this.worldPos.isConnected && this.viewProjection.isConnected ? state.compilationString += `
                vec4 p = ${this.viewProjection.associatedVariableName} * ${this.worldPos.associatedVariableName};
                float v = p.z / p.w;
                #ifndef IS_NDC_HALF_ZRANGE
                    v = v * 0.5 + 0.5;
                #endif
                gl_FragDepth = v;
    
            ` : console.warn("FragDepthBlock: either the depth input or both the worldPos and viewProjection inputs must be connected!"), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.FragDepthBlock", FragDepthBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/shadowMapBlock.js
class ShadowMapBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, !1), this.registerInput("viewProjection", NodeMaterialBlockConnectionPointTypes.Matrix, !1), this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.AutoDetect, !0), this.registerOutput("depth", NodeMaterialBlockConnectionPointTypes.Vector3), this.worldNormal.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "ShadowMapBlock";}initialize(state) {state._excludeVariableName("vPositionWSM"), state._excludeVariableName("lightDataSM"), state._excludeVariableName("biasAndScaleSM"), state._excludeVariableName("depthValuesSM"), state._excludeVariableName("clipPos"), state._excludeVariableName("worldPos"), state._excludeVariableName("zSM");}get worldPosition() {return this._inputs[0];}get viewProjection() {return this._inputs[1];}get worldNormal() {return this._inputs[2];}get depth() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const comments = `//${this.name}`;return state._emitUniformFromString("biasAndScaleSM", "vec3"), state._emitUniformFromString("lightDataSM", "vec3"), state._emitUniformFromString("depthValuesSM", "vec2"), state._emitFunctionFromInclude("packingFunctions", comments), state.compilationString += `vec4 worldPos = ${this.worldPosition.associatedVariableName};\r\n`, state.compilationString += `vec3 vPositionWSM;\r\n`, state.compilationString += `float vDepthMetricSM = 0.0;\r\n`, state.compilationString += `float zSM;\r\n`, this.worldNormal.isConnected && (state.compilationString += `vec3 vNormalW = ${this.worldNormal.associatedVariableName}.xyz;\r\n`, state.compilationString += state._emitCodeFromInclude("shadowMapVertexNormalBias", comments)), state.compilationString += `vec4 clipPos = ${this.viewProjection.associatedVariableName} * worldPos;\r\n`, state.compilationString += state._emitCodeFromInclude("shadowMapVertexMetric", comments, { replaceStrings: [{ search: /gl_Position/g, replace: "clipPos" }] }), state.compilationString += state._emitCodeFromInclude("shadowMapFragment", comments, { replaceStrings: [{ search: /return;/g, replace: "" }] }), state.compilationString += `
            #if SM_DEPTHTEXTURE == 1
                #ifdef IS_NDC_HALF_ZRANGE
                    gl_FragDepth = (clipPos.z / clipPos.w);
                #else
                    gl_FragDepth = (clipPos.z / clipPos.w) * 0.5 + 0.5;
                #endif
            #endif
        `, state.compilationString += `${this._declareOutput(this.depth, state)} = vec3(depthSM, 1., 1.);\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ShadowMapBlock", ShadowMapBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/fogBlock.js
class FogBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.VertexAndFragment, !1), this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, !1, NodeMaterialBlockTargets.Vertex), this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, !1, NodeMaterialBlockTargets.Vertex), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("fogColor", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1, NodeMaterialBlockTargets.Fragment), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.input.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Color4), this.fogColor.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Color4);}getClassName() {return "FogBlock";}get worldPosition() {return this._inputs[0];}get view() {return this._inputs[1];}get input() {return this._inputs[2];}get fogColor() {return this._inputs[3];}get output() {return this._outputs[0];}autoConfigure(material) {if (!this.view.isConnected) {let viewInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.View);viewInput || (viewInput = new InputBlock("view"), viewInput.setAsSystemValue(NodeMaterialSystemValues.View)), viewInput.output.connectTo(this.view);}if (!this.fogColor.isConnected) {let fogColorInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.FogColor);fogColorInput || (fogColorInput = new InputBlock("fogColor", void 0, NodeMaterialBlockConnectionPointTypes.Color3), fogColorInput.setAsSystemValue(NodeMaterialSystemValues.FogColor)), fogColorInput.output.connectTo(this.fogColor);}}prepareDefines(mesh, nodeMaterial, defines) {const scene = mesh.getScene();defines.setValue("FOG", nodeMaterial.fogEnabled && materialHelper/* MaterialHelper.GetFogState */.G.GetFogState(mesh, scene));}bind(effect, nodeMaterial, mesh) {if (mesh) {const scene = mesh.getScene();effect.setFloat4(this._fogParameters, scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity);}}_buildBlock(state) {if (super._buildBlock(state), state.target === NodeMaterialBlockTargets.Fragment) {state.sharedData.blocksWithDefines.push(this), state.sharedData.bindableBlocks.push(this), state._emitFunctionFromInclude("fogFragmentDeclaration", `//${this.name}`, { removeUniforms: !0, removeVaryings: !0, removeIfDef: !1, replaceStrings: [{ search: /float CalcFogFactor\(\)/, replace: "float CalcFogFactor(vec3 vFogDistance, vec4 vFogInfos)" }] });const tempFogVariablename = state._getFreeVariableName("fog"),color = this.input,fogColor = this.fogColor;this._fogParameters = state._getFreeVariableName("fogParameters");const output = this._outputs[0];state._emitUniformFromString(this._fogParameters, "vec4"), state.compilationString += `#ifdef FOG\r\n`, state.compilationString += `float ${tempFogVariablename} = CalcFogFactor(${this._fogDistanceName}, ${this._fogParameters});\r\n`, state.compilationString += this._declareOutput(output, state) + ` = ${tempFogVariablename} * ${color.associatedVariableName}.rgb + (1.0 - ${tempFogVariablename}) * ${fogColor.associatedVariableName}.rgb;\r\n`, state.compilationString += `#else\r\n${this._declareOutput(output, state)} =  ${color.associatedVariableName}.rgb;\r\n`, state.compilationString += `#endif\r\n`;} else {const worldPos = this.worldPosition,view = this.view;this._fogDistanceName = state._getFreeVariableName("vFogDistance"), state._emitVaryingFromString(this._fogDistanceName, "vec3"), state.compilationString += `${this._fogDistanceName} = (${view.associatedVariableName} * ${worldPos.associatedVariableName}).xyz;\r\n`;}return this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.FogBlock", FogBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/lightBlock.js
class LightBlock extends NodeMaterialBlock {static _OnGenerateOnlyFragmentCodeChanged(block) {const that = block;return that.worldPosition.isConnected ? (that.generateOnlyFragmentCode = !that.generateOnlyFragmentCode, console.error("The worldPosition input must not be connected to be able to switch!"), !1) : (that._setTarget(), !0);}_setTarget() {this._setInitialTarget(this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment), this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex;}constructor(name) {super(name, NodeMaterialBlockTargets.VertexAndFragment), this._lightId = 0, this.generateOnlyFragmentCode = !1, this._isUnique = !0, this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, !1, NodeMaterialBlockTargets.Vertex), this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("glossiness", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("glossPower", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("diffuseColor", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("specularColor", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, !0), this.registerOutput("diffuseOutput", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("specularOutput", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("shadow", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);}getClassName() {return "LightBlock";}get worldPosition() {return this._inputs[0];}get worldNormal() {return this._inputs[1];}get cameraPosition() {return this._inputs[2];}get glossiness() {return this._inputs[3];}get glossPower() {return this._inputs[4];}get diffuseColor() {return this._inputs[5];}get specularColor() {return this._inputs[6];}get view() {return this._inputs[7];}get diffuseOutput() {return this._outputs[0];}get specularOutput() {return this._outputs[1];}get shadow() {return this._outputs[2];}autoConfigure(material) {if (!this.cameraPosition.isConnected) {let cameraPositionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.CameraPosition);cameraPositionInput || (cameraPositionInput = new InputBlock("cameraPosition"), cameraPositionInput.setAsSystemValue(NodeMaterialSystemValues.CameraPosition)), cameraPositionInput.output.connectTo(this.cameraPosition);}}prepareDefines(mesh, nodeMaterial, defines) {if (defines._areLightsDirty) {const scene = mesh.getScene();if (!this.light) materialHelper/* MaterialHelper.PrepareDefinesForLights */.G.PrepareDefinesForLights(scene, mesh, defines, !0, nodeMaterial.maxSimultaneousLights);else {const state = { needNormals: !1, needRebuild: !1, lightmapMode: !1, shadowEnabled: !1, specularEnabled: !1 };materialHelper/* MaterialHelper.PrepareDefinesForLight */.G.PrepareDefinesForLight(scene, mesh, this.light, this._lightId, defines, !0, state), state.needRebuild && defines.rebuild();}}}updateUniformsAndSamples(state, nodeMaterial, defines, uniformBuffers) {for (let lightIndex = 0; lightIndex < nodeMaterial.maxSimultaneousLights && !!defines["LIGHT" + lightIndex]; lightIndex++) {const onlyUpdateBuffersList = 0 <= state.uniforms.indexOf("vLightData" + lightIndex);materialHelper/* MaterialHelper.PrepareUniformsAndSamplersForLight */.G.PrepareUniformsAndSamplersForLight(lightIndex, state.uniforms, state.samplers, defines["PROJECTEDLIGHTTEXTURE" + lightIndex], uniformBuffers, onlyUpdateBuffersList);}}bind(effect, nodeMaterial, mesh) {if (mesh) {const scene = mesh.getScene();this.light ? materialHelper/* MaterialHelper.BindLight */.G.BindLight(this.light, this._lightId, scene, effect, !0) : materialHelper/* MaterialHelper.BindLights */.G.BindLights(scene, mesh, effect, !0, nodeMaterial.maxSimultaneousLights);}}_injectVertexCode(state) {const worldPos = this.worldPosition,comments = `//${this.name}`;this.light ? (this._lightId = (state.counters.lightCounter === void 0 ? -1 : state.counters.lightCounter) + 1, state.counters.lightCounter = this._lightId, state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", comments, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString())) : (state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", comments, { repeatKey: "maxSimultaneousLights" }), this._lightId = 0, state.sharedData.dynamicUniformBlocks.push(this));const worldPosVaryingName = "v_" + worldPos.associatedVariableName;state._emitVaryingFromString(worldPosVaryingName, "vec4") && (state.compilationString += `${worldPosVaryingName} = ${worldPos.associatedVariableName};\r\n`), this.light ? state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }, { search: /worldPos/g, replace: worldPos.associatedVariableName }] }) : (state.compilationString += `vec4 worldPos = ${worldPos.associatedVariableName};\r\n`, this.view.isConnected && (state.compilationString += `mat4 view = ${this.view.associatedVariableName};\r\n`), state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, { repeatKey: "maxSimultaneousLights" }));}_buildBlock(state) {if (super._buildBlock(state), state.target !== NodeMaterialBlockTargets.Fragment) return void this._injectVertexCode(state);this.generateOnlyFragmentCode && state.sharedData.dynamicUniformBlocks.push(this), state.sharedData.forcedBindableBlocks.push(this), state.sharedData.blocksWithDefines.push(this);const comments = `//${this.name}`,worldPos = this.worldPosition;let worldPosVariableName = worldPos.associatedVariableName;this.generateOnlyFragmentCode ? (worldPosVariableName = state._getFreeVariableName("globalWorldPos"), state._emitFunction("light_globalworldpos", `vec3 ${worldPosVariableName};\r\n`, comments), state.compilationString += `${worldPosVariableName} = ${worldPos.associatedVariableName}.xyz;\r\n`, state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, { repeatKey: "maxSimultaneousLights", substitutionVars: this.generateOnlyFragmentCode ? `worldPos,${worldPos.associatedVariableName}` : void 0 })) : worldPosVariableName = "v_" + worldPosVariableName + ".xyz", state._emitFunctionFromInclude("helperFunctions", comments), state._emitFunctionFromInclude("lightsFragmentFunctions", comments, { replaceStrings: [{ search: /vPositionW/g, replace: worldPosVariableName }] }), state._emitFunctionFromInclude("shadowsFragmentFunctions", comments, { replaceStrings: [{ search: /vPositionW/g, replace: worldPosVariableName }] }), this.light ? state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", comments, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString()) : state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", comments, { repeatKey: "maxSimultaneousLights", substitutionVars: this.generateOnlyFragmentCode ? "varying," : void 0 }), 0 === this._lightId && (state._registerTempVariable("viewDirectionW") && (state.compilationString += `vec3 viewDirectionW = normalize(${this.cameraPosition.associatedVariableName} - ${worldPosVariableName});\r\n`), state.compilationString += `lightingInfo info;\r\n`, state.compilationString += `float shadow = 1.;\r\n`, state.compilationString += `float glossiness = ${this.glossiness.isConnected ? this.glossiness.associatedVariableName : "1.0"} * ${this.glossPower.isConnected ? this.glossPower.associatedVariableName : "1024.0"};\r\n`, state.compilationString += `vec3 diffuseBase = vec3(0., 0., 0.);\r\n`, state.compilationString += `vec3 specularBase = vec3(0., 0., 0.);\r\n`, state.compilationString += `vec3 normalW = ${this.worldNormal.associatedVariableName}.xyz;\r\n`), state.compilationString += this.light ? state._emitCodeFromInclude("lightFragment", comments, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }) : state._emitCodeFromInclude("lightFragment", comments, { repeatKey: "maxSimultaneousLights" });const diffuseOutput = this.diffuseOutput,specularOutput = this.specularOutput;return state.compilationString += this._declareOutput(diffuseOutput, state) + ` = diffuseBase${this.diffuseColor.isConnected ? " * " + this.diffuseColor.associatedVariableName : ""};\r\n`, specularOutput.hasEndpoints && (state.compilationString += this._declareOutput(specularOutput, state) + ` = specularBase${this.specularColor.isConnected ? " * " + this.specularColor.associatedVariableName : ""};\r\n`), this.shadow.hasEndpoints && (state.compilationString += this._declareOutput(this.shadow, state) + ` = shadow;\r\n`), this;}serialize() {const serializationObject = super.serialize();return serializationObject.generateOnlyFragmentCode = this.generateOnlyFragmentCode, this.light && (serializationObject.lightId = this.light.id), serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), serializationObject.lightId && (this.light = scene.getLightById(serializationObject.lightId)), this.generateOnlyFragmentCode = serializationObject.generateOnlyFragmentCode, this._setTarget();}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Generate only fragment code", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: !0, update: !0, onValidation: LightBlock._OnGenerateOnlyFragmentCodeChanged } })], LightBlock.prototype, "generateOnlyFragmentCode", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.LightBlock", LightBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/imageSourceBlock.js
class ImageSourceBlock extends NodeMaterialBlock {get texture() {return this._texture;}set texture(texture) {var _a;if (this._texture !== texture) {const scene = null !== (_a = null === texture || void 0 === texture ? void 0 : texture.getScene()) && void 0 !== _a ? _a : engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;!texture && scene && scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this._texture)), this._texture = texture, texture && scene && scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(texture));}}get samplerName() {return this._samplerName;}constructor(name) {super(name, NodeMaterialBlockTargets.VertexAndFragment), this.registerOutput("source", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("source", this, NodeMaterialConnectionPointDirection.Output, ImageSourceBlock, "ImageSourceBlock"));}bind(effect) {this.texture && effect.setTexture(this._samplerName, this.texture);}isReady() {return !this.texture || this.texture.isReadyOrNotBlocking();}getClassName() {return "ImageSourceBlock";}get source() {return this._outputs[0];}_buildBlock(state) {return super._buildBlock(state), state.target === NodeMaterialBlockTargets.Vertex && (this._samplerName = state._getFreeVariableName(this.name + "Sampler"), state.sharedData.blockingBlocks.push(this), state.sharedData.textureBlocks.push(this), state.sharedData.bindableBlocks.push(this)), state._emit2DSampler(this._samplerName), this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return this.texture ? (codeString += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});\r\n`, codeString += `${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};\r\n`, codeString += `${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};\r\n`, codeString += `${this._codeVariableName}.texture.uAng = ${this.texture.uAng};\r\n`, codeString += `${this._codeVariableName}.texture.vAng = ${this.texture.vAng};\r\n`, codeString += `${this._codeVariableName}.texture.wAng = ${this.texture.wAng};\r\n`, codeString += `${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};\r\n`, codeString += `${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};\r\n`, codeString += `${this._codeVariableName}.texture.uScale = ${this.texture.uScale};\r\n`, codeString += `${this._codeVariableName}.texture.vScale = ${this.texture.vScale};\r\n`, codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\r\n`, codeString) : codeString;}serialize() {const serializationObject = super.serialize();return this.texture && !this.texture.isRenderTarget && "VideoTexture" !== this.texture.getClassName() && (serializationObject.texture = this.texture.serialize()), serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), serializationObject.texture && !NodeMaterial.IgnoreTexturesAtLoadTime && serializationObject.texture.url !== void 0 && (rootUrl = 0 === serializationObject.texture.url.indexOf("data:") ? "" : rootUrl, this.texture = Textures_texture/* Texture.Parse */.x.Parse(serializationObject.texture, scene, rootUrl));}}(0,typeStore/* RegisterClass */.H)("BABYLON.ImageSourceBlock", ImageSourceBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/textureBlock.js
class TextureBlock extends NodeMaterialBlock {get texture() {var _a;return this.source.isConnected ? (null === (_a = this.source.connectedPoint) || void 0 === _a ? void 0 : _a.ownerBlock).texture : this._texture;}set texture(texture) {var _a;if (this._texture !== texture) {const scene = null !== (_a = null === texture || void 0 === texture ? void 0 : texture.getScene()) && void 0 !== _a ? _a : engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;!texture && scene && scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this._texture)), this._texture = texture, texture && scene && scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(texture));}}get samplerName() {return this._imageSource ? this._imageSource.samplerName : this._samplerName;}get hasImageSource() {return this.source.isConnected;}set convertToGammaSpace(value) {var _a;if (value !== this._convertToGammaSpace && (this._convertToGammaSpace = value, this.texture)) {const scene = null !== (_a = this.texture.getScene()) && void 0 !== _a ? _a : engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;null === scene || void 0 === scene ? void 0 : scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this.texture));}}get convertToGammaSpace() {return this._convertToGammaSpace;}set convertToLinearSpace(value) {var _a;if (value !== this._convertToLinearSpace && (this._convertToLinearSpace = value, this.texture)) {const scene = null !== (_a = this.texture.getScene()) && void 0 !== _a ? _a : engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;null === scene || void 0 === scene ? void 0 : scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this.texture));}}get convertToLinearSpace() {return this._convertToLinearSpace;}constructor(name, fragmentOnly = !1) {super(name, fragmentOnly ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment), this._convertToGammaSpace = !1, this._convertToLinearSpace = !1, this.disableLevelMultiplication = !1, this._fragmentOnly = fragmentOnly, this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1, NodeMaterialBlockTargets.VertexAndFragment), this.registerInput("source", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("source", this, NodeMaterialConnectionPointDirection.Input, ImageSourceBlock, "ImageSourceBlock")), this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Neutral), this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Neutral), this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("level", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4), this._inputs[0]._prioritizeVertex = !fragmentOnly;}getClassName() {return "TextureBlock";}get uv() {return this._inputs[0];}get source() {return this._inputs[1];}get rgba() {return this._outputs[0];}get rgb() {return this._outputs[1];}get r() {return this._outputs[2];}get g() {return this._outputs[3];}get b() {return this._outputs[4];}get a() {return this._outputs[5];}get level() {return this._outputs[6];}get target() {if (this._fragmentOnly) return NodeMaterialBlockTargets.Fragment;if (!this.uv.isConnected) return NodeMaterialBlockTargets.VertexAndFragment;if (this.uv.sourceBlock.isInput) return NodeMaterialBlockTargets.VertexAndFragment;for (let parent = this.uv.connectedPoint; parent;) {if (parent.target === NodeMaterialBlockTargets.Fragment) return NodeMaterialBlockTargets.Fragment;if (parent.target === NodeMaterialBlockTargets.Vertex) return NodeMaterialBlockTargets.VertexAndFragment;if (parent.target === NodeMaterialBlockTargets.Neutral || parent.target === NodeMaterialBlockTargets.VertexAndFragment) {const parentBlock = parent.ownerBlock;if (parentBlock.target === NodeMaterialBlockTargets.Fragment) return NodeMaterialBlockTargets.Fragment;parent = null;for (const input of parentBlock.inputs) if (input.connectedPoint) {parent = input.connectedPoint;break;}}}return NodeMaterialBlockTargets.VertexAndFragment;}set target(value) {}autoConfigure(material) {if (!this.uv.isConnected) if (material.mode === NodeMaterialModes.PostProcess) {const uvInput = material.getBlockByPredicate((b) => "uv" === b.name);uvInput && uvInput.connectTo(this);} else {const attributeName = material.mode === NodeMaterialModes.Particle ? "particle_uv" : "uv";let uvInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === attributeName);uvInput || (uvInput = new InputBlock("uv"), uvInput.setAsAttribute(attributeName)), uvInput.output.connectTo(this.uv);}}initializeDefines(mesh, nodeMaterial, defines) {defines._areTexturesDirty && (this._mainUVDefineName === void 0 || defines.setValue(this._mainUVDefineName, !1, !0));}prepareDefines(mesh, nodeMaterial, defines) {if (!defines._areTexturesDirty) return;if (!this.texture || !this.texture.getTextureMatrix) return void (this._isMixed && (defines.setValue(this._defineName, !1, !0), defines.setValue(this._mainUVDefineName, !0, !0)));const toGamma = this.convertToGammaSpace && this.texture && !this.texture.gammaSpace,toLinear = this.convertToLinearSpace && this.texture && this.texture.gammaSpace;defines.setValue(this._linearDefineName, toGamma, !0), defines.setValue(this._gammaDefineName, toLinear, !0), this._isMixed && (this.texture.getTextureMatrix().isIdentityAs3x2() ? (defines.setValue(this._defineName, !1, !0), defines.setValue(this._mainUVDefineName, !0, !0)) : (defines.setValue(this._defineName, !0), defines[this._mainUVDefineName] == null && defines.setValue(this._mainUVDefineName, !1, !0)));}isReady() {return !this.texture || this.texture.isReadyOrNotBlocking();}bind(effect) {this.texture && (this._isMixed && (effect.setFloat(this._textureInfoName, this.texture.level), effect.setMatrix(this._textureTransformName, this.texture.getTextureMatrix())), !this._imageSource && effect.setTexture(this._samplerName, this.texture));}get _isMixed() {return this.target !== NodeMaterialBlockTargets.Fragment;}_injectVertexCode(state) {const uvInput = this.uv;if (this._defineName = state._getFreeDefineName("UVTRANSFORM"), this._mainUVDefineName = "VMAIN" + uvInput.associatedVariableName.toUpperCase(), this._mainUVName = "vMain" + uvInput.associatedVariableName, this._transformedUVName = state._getFreeVariableName("transformedUV"), this._textureTransformName = state._getFreeVariableName("textureTransform"), this._textureInfoName = state._getFreeVariableName("textureInfoName"), this.level.associatedVariableName = this._textureInfoName, state._emitVaryingFromString(this._transformedUVName, "vec2", this._defineName), state._emitVaryingFromString(this._mainUVName, "vec2", this._mainUVDefineName), state._emitUniformFromString(this._textureTransformName, "mat4", this._defineName), state.compilationString += `#ifdef ${this._defineName}\r\n`, state.compilationString += `${this._transformedUVName} = vec2(${this._textureTransformName} * vec4(${uvInput.associatedVariableName}.xy, 1.0, 0.0));\r\n`, state.compilationString += `#elif defined(${this._mainUVDefineName})\r\n`, state.compilationString += `${this._mainUVName} = ${uvInput.associatedVariableName}.xy;\r\n`, state.compilationString += `#endif\r\n`, !!this._outputs.some((o) => o.isConnectedInVertexShader)) {this._writeTextureRead(state, !0);for (const output of this._outputs) output.hasEndpoints && "level" !== output.name && this._writeOutput(state, output, output.name, !0);}}_generateTextureLookup(state) {const samplerName = this.samplerName;state.compilationString += `#ifdef ${this._defineName}\r\n`, state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${samplerName}, ${this._transformedUVName});\r\n`, state.compilationString += `#elif defined(${this._mainUVDefineName})\r\n`, state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${samplerName}, ${this._mainUVName ? this._mainUVName : this.uv.associatedVariableName});\r\n`, state.compilationString += `#endif\r\n`;}_writeTextureRead(state, vertexMode = !1) {const uvInput = this.uv;return vertexMode ? state.target === NodeMaterialBlockTargets.Fragment ? void 0 : void this._generateTextureLookup(state) : this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment ? void (state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this.samplerName}, ${uvInput.associatedVariableName});\r\n`) : void this._generateTextureLookup(state);}_generateConversionCode(state, output, swizzle) {"a" !== swizzle && ((!this.texture || !this.texture.gammaSpace) && (state.compilationString += `#ifdef ${this._linearDefineName}
                    ${output.associatedVariableName} = toGammaSpace(${output.associatedVariableName});
                    #endif
                `), state.compilationString += `#ifdef ${this._gammaDefineName}
                ${output.associatedVariableName} = toLinearSpace(${output.associatedVariableName});
                #endif
            `);}_writeOutput(state, output, swizzle, vertexMode = !1) {if (vertexMode) return state.target === NodeMaterialBlockTargets.Fragment ? void 0 : (state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle};\r\n`, void this._generateConversionCode(state, output, swizzle));if (this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment) return state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle};\r\n`, void this._generateConversionCode(state, output, swizzle);let complement = "";this.disableLevelMultiplication || (complement = ` * ${this._textureInfoName}`), state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle}${complement};\r\n`, this._generateConversionCode(state, output, swizzle);}_buildBlock(state) {if (super._buildBlock(state), this._imageSource = this.source.isConnected ? this.source.connectedPoint.ownerBlock : null, (state.target === NodeMaterialBlockTargets.Vertex || this._fragmentOnly || state.target === NodeMaterialBlockTargets.Fragment) && (this._tempTextureRead = state._getFreeVariableName("tempTextureRead"), this._linearDefineName = state._getFreeDefineName("ISLINEAR"), this._gammaDefineName = state._getFreeDefineName("ISGAMMA")), (!this._isMixed && state.target === NodeMaterialBlockTargets.Fragment || this._isMixed && state.target === NodeMaterialBlockTargets.Vertex) && (!this._imageSource && (this._samplerName = state._getFreeVariableName(this.name + "Sampler"), state._emit2DSampler(this._samplerName)), state.sharedData.blockingBlocks.push(this), state.sharedData.textureBlocks.push(this), state.sharedData.blocksWithDefines.push(this), state.sharedData.bindableBlocks.push(this)), state.target !== NodeMaterialBlockTargets.Fragment) return void this._injectVertexCode(state);if (this._outputs.some((o) => o.isConnectedInFragmentShader)) {this._isMixed && !this._imageSource && state._emit2DSampler(this._samplerName);const comments = `//${this.name}`;state._emitFunctionFromInclude("helperFunctions", comments), this._isMixed && state._emitUniformFromString(this._textureInfoName, "float"), this._writeTextureRead(state);for (const output of this._outputs) output.hasEndpoints && "level" !== output.name && this._writeOutput(state, output, output.name);return this;}}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return (codeString += `${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};\r\n`, codeString += `${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};\r\n`, codeString += `${this._codeVariableName}.disableLevelMultiplication = ${this.disableLevelMultiplication};\r\n`, !this.texture) ? codeString : (codeString += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});\r\n`, codeString += `${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};\r\n`, codeString += `${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};\r\n`, codeString += `${this._codeVariableName}.texture.uAng = ${this.texture.uAng};\r\n`, codeString += `${this._codeVariableName}.texture.vAng = ${this.texture.vAng};\r\n`, codeString += `${this._codeVariableName}.texture.wAng = ${this.texture.wAng};\r\n`, codeString += `${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};\r\n`, codeString += `${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};\r\n`, codeString += `${this._codeVariableName}.texture.uScale = ${this.texture.uScale};\r\n`, codeString += `${this._codeVariableName}.texture.vScale = ${this.texture.vScale};\r\n`, codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\r\n`, codeString);}serialize() {const serializationObject = super.serialize();return serializationObject.convertToGammaSpace = this.convertToGammaSpace, serializationObject.convertToLinearSpace = this.convertToLinearSpace, serializationObject.fragmentOnly = this._fragmentOnly, serializationObject.disableLevelMultiplication = this.disableLevelMultiplication, this.hasImageSource || !this.texture || this.texture.isRenderTarget || "VideoTexture" === this.texture.getClassName() || (serializationObject.texture = this.texture.serialize()), serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.convertToGammaSpace = serializationObject.convertToGammaSpace, this.convertToLinearSpace = !!serializationObject.convertToLinearSpace, this._fragmentOnly = !!serializationObject.fragmentOnly, this.disableLevelMultiplication = !!serializationObject.disableLevelMultiplication, serializationObject.texture && !NodeMaterial.IgnoreTexturesAtLoadTime && serializationObject.texture.url !== void 0 && (rootUrl = 0 === serializationObject.texture.url.indexOf("data:") ? "" : rootUrl, this.texture = Textures_texture/* Texture.Parse */.x.Parse(serializationObject.texture, scene, rootUrl));}}(0,typeStore/* RegisterClass */.H)("BABYLON.TextureBlock", TextureBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js
class ReflectionTextureBaseBlock extends NodeMaterialBlock {get texture() {return this._texture;}set texture(texture) {var _a;if (this._texture !== texture) {const scene = null !== (_a = null === texture || void 0 === texture ? void 0 : texture.getScene()) && void 0 !== _a ? _a : engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;!texture && scene && scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this._texture)), this._texture = texture, texture && scene && scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(texture));}}static _OnGenerateOnlyFragmentCodeChanged(block) {return block._onGenerateOnlyFragmentCodeChanged();}_onGenerateOnlyFragmentCodeChanged() {return this._setTarget(), !0;}_setTarget() {this._setInitialTarget(this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment);}constructor(name) {super(name, NodeMaterialBlockTargets.VertexAndFragment), this.generateOnlyFragmentCode = !1;}getClassName() {return "ReflectionTextureBaseBlock";}_getTexture() {return this.texture;}autoConfigure(material) {if (!this.position.isConnected) {let positionInput = material.getInputBlockByPredicate((b) => b.isAttribute && "position" === b.name);positionInput || (positionInput = new InputBlock("position"), positionInput.setAsAttribute()), positionInput.output.connectTo(this.position);}if (!this.world.isConnected) {let worldInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.World);worldInput || (worldInput = new InputBlock("world"), worldInput.setAsSystemValue(NodeMaterialSystemValues.World)), worldInput.output.connectTo(this.world);}if (this.view && !this.view.isConnected) {let viewInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.View);viewInput || (viewInput = new InputBlock("view"), viewInput.setAsSystemValue(NodeMaterialSystemValues.View)), viewInput.output.connectTo(this.view);}}prepareDefines(mesh, nodeMaterial, defines) {if (defines._areTexturesDirty) {const texture = this._getTexture();texture && texture.getTextureMatrix && (defines.setValue(this._define3DName, texture.isCube, !0), defines.setValue(this._defineLocalCubicName, !!texture.boundingBoxSize, !0), defines.setValue(this._defineExplicitName, 0 === texture.coordinatesMode, !0), defines.setValue(this._defineSkyboxName, 5 === texture.coordinatesMode, !0), defines.setValue(this._defineCubicName, 3 === texture.coordinatesMode || 6 === texture.coordinatesMode, !0), defines.setValue("INVERTCUBICMAP", 6 === texture.coordinatesMode, !0), defines.setValue(this._defineSphericalName, 1 === texture.coordinatesMode, !0), defines.setValue(this._definePlanarName, 2 === texture.coordinatesMode, !0), defines.setValue(this._defineProjectionName, 4 === texture.coordinatesMode, !0), defines.setValue(this._defineEquirectangularName, 7 === texture.coordinatesMode, !0), defines.setValue(this._defineEquirectangularFixedName, 8 === texture.coordinatesMode, !0), defines.setValue(this._defineMirroredEquirectangularFixedName, 9 === texture.coordinatesMode, !0));}}isReady() {const texture = this._getTexture();return !texture || texture.isReadyOrNotBlocking();}bind(effect, nodeMaterial, mesh) {const texture = this._getTexture();if (mesh && texture && (effect.setMatrix(this._reflectionMatrixName, texture.getReflectionTextureMatrix()), texture.isCube ? effect.setTexture(this._cubeSamplerName, texture) : effect.setTexture(this._2DSamplerName, texture), texture.boundingBoxSize)) {const cubeTexture = texture;effect.setVector3(this._reflectionPositionName, cubeTexture.boundingBoxPosition), effect.setVector3(this._reflectionSizeName, cubeTexture.boundingBoxSize);}}handleVertexSide(state) {if (this.generateOnlyFragmentCode && state.target === NodeMaterialBlockTargets.Vertex) return "";this._define3DName = state._getFreeDefineName("REFLECTIONMAP_3D"), this._defineCubicName = state._getFreeDefineName("REFLECTIONMAP_CUBIC"), this._defineSphericalName = state._getFreeDefineName("REFLECTIONMAP_SPHERICAL"), this._definePlanarName = state._getFreeDefineName("REFLECTIONMAP_PLANAR"), this._defineProjectionName = state._getFreeDefineName("REFLECTIONMAP_PROJECTION"), this._defineExplicitName = state._getFreeDefineName("REFLECTIONMAP_EXPLICIT"), this._defineEquirectangularName = state._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR"), this._defineLocalCubicName = state._getFreeDefineName("USE_LOCAL_REFLECTIONMAP_CUBIC"), this._defineMirroredEquirectangularFixedName = state._getFreeDefineName("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"), this._defineEquirectangularFixedName = state._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR_FIXED"), this._defineSkyboxName = state._getFreeDefineName("REFLECTIONMAP_SKYBOX"), this._defineOppositeZ = state._getFreeDefineName("REFLECTIONMAP_OPPOSITEZ"), this._reflectionMatrixName = state._getFreeVariableName("reflectionMatrix"), state._emitUniformFromString(this._reflectionMatrixName, "mat4");let code = "";this._worldPositionNameInFragmentOnlyMode = state._getFreeVariableName("worldPosition");const worldPosVaryingName = this.generateOnlyFragmentCode ? this._worldPositionNameInFragmentOnlyMode : "v_" + this.worldPosition.associatedVariableName;return (this.generateOnlyFragmentCode || state._emitVaryingFromString(worldPosVaryingName, "vec4")) && (code += `${this.generateOnlyFragmentCode ? "vec4 " : ""}${worldPosVaryingName} = ${this.worldPosition.associatedVariableName};\r\n`), this._positionUVWName = state._getFreeVariableName("positionUVW"), this._directionWName = state._getFreeVariableName("directionW"), (this.generateOnlyFragmentCode || state._emitVaryingFromString(this._positionUVWName, "vec3", this._defineSkyboxName)) && (code += `#ifdef ${this._defineSkyboxName}\r\n`, code += `${this.generateOnlyFragmentCode ? "vec3 " : ""}${this._positionUVWName} = ${this.position.associatedVariableName}.xyz;\r\n`, code += `#endif\r\n`), (this.generateOnlyFragmentCode || state._emitVaryingFromString(this._directionWName, "vec3", `defined(${this._defineEquirectangularFixedName}) || defined(${this._defineMirroredEquirectangularFixedName})`)) && (code += `#if defined(${this._defineEquirectangularFixedName}) || defined(${this._defineMirroredEquirectangularFixedName})\r\n`, code += `${this.generateOnlyFragmentCode ? "vec3 " : ""}${this._directionWName} = normalize(vec3(${this.world.associatedVariableName} * vec4(${this.position.associatedVariableName}.xyz, 0.0)));\r\n`, code += `#endif\r\n`), code;}handleFragmentSideInits(state) {state.sharedData.blockingBlocks.push(this), state.sharedData.textureBlocks.push(this), this._cubeSamplerName = state._getFreeVariableName(this.name + "CubeSampler"), state.samplers.push(this._cubeSamplerName), this._2DSamplerName = state._getFreeVariableName(this.name + "2DSampler"), state.samplers.push(this._2DSamplerName), state._samplerDeclaration += `#ifdef ${this._define3DName}\r\n`, state._samplerDeclaration += `uniform samplerCube ${this._cubeSamplerName};\r\n`, state._samplerDeclaration += `#else\r\n`, state._samplerDeclaration += `uniform sampler2D ${this._2DSamplerName};\r\n`, state._samplerDeclaration += `#endif\r\n`, state.sharedData.blocksWithDefines.push(this), state.sharedData.bindableBlocks.push(this);const comments = `//${this.name}`;state._emitFunction("ReciprocalPI", "#define RECIPROCAL_PI2 0.15915494", ""), state._emitFunctionFromInclude("helperFunctions", comments), state._emitFunctionFromInclude("reflectionFunction", comments, { replaceStrings: [{ search: /vec3 computeReflectionCoords/g, replace: "void DUMMYFUNC" }] }), this._reflectionColorName = state._getFreeVariableName("reflectionColor"), this._reflectionVectorName = state._getFreeVariableName("reflectionUVW"), this._reflectionCoordsName = state._getFreeVariableName("reflectionCoords"), this._reflectionPositionName = state._getFreeVariableName("vReflectionPosition"), state._emitUniformFromString(this._reflectionPositionName, "vec3"), this._reflectionSizeName = state._getFreeVariableName("vReflectionPosition"), state._emitUniformFromString(this._reflectionSizeName, "vec3");}handleFragmentSideCodeReflectionCoords(worldNormalVarName, worldPos, onlyReflectionVector = !1, doNotEmitInvertZ = !1) {worldPos || (worldPos = this.generateOnlyFragmentCode ? this._worldPositionNameInFragmentOnlyMode : `v_${this.worldPosition.associatedVariableName}`);const reflectionMatrix = this._reflectionMatrixName,direction = `normalize(${this._directionWName})`,positionUVW = `${this._positionUVWName}`,vEyePosition = `${this.cameraPosition.associatedVariableName}`,view = `${this.view.associatedVariableName}`;worldNormalVarName += ".xyz";let code = `
            #ifdef ${this._defineMirroredEquirectangularFixedName}
                vec3 ${this._reflectionVectorName} = computeMirroredFixedEquirectangularCoords(${worldPos}, ${worldNormalVarName}, ${direction});
            #endif

            #ifdef ${this._defineEquirectangularFixedName}
                vec3 ${this._reflectionVectorName} = computeFixedEquirectangularCoords(${worldPos}, ${worldNormalVarName}, ${direction});
            #endif

            #ifdef ${this._defineEquirectangularName}
                vec3 ${this._reflectionVectorName} = computeEquirectangularCoords(${worldPos}, ${worldNormalVarName}, ${vEyePosition}.xyz, ${reflectionMatrix});
            #endif

            #ifdef ${this._defineSphericalName}
                vec3 ${this._reflectionVectorName} = computeSphericalCoords(${worldPos}, ${worldNormalVarName}, ${view}, ${reflectionMatrix});
            #endif

            #ifdef ${this._definePlanarName}
                vec3 ${this._reflectionVectorName} = computePlanarCoords(${worldPos}, ${worldNormalVarName}, ${vEyePosition}.xyz, ${reflectionMatrix});
            #endif

            #ifdef ${this._defineCubicName}
                #ifdef ${this._defineLocalCubicName}
                    vec3 ${this._reflectionVectorName} = computeCubicLocalCoords(${worldPos}, ${worldNormalVarName}, ${vEyePosition}.xyz, ${reflectionMatrix}, ${this._reflectionSizeName}, ${this._reflectionPositionName});
                #else
                vec3 ${this._reflectionVectorName} = computeCubicCoords(${worldPos}, ${worldNormalVarName}, ${vEyePosition}.xyz, ${reflectionMatrix});
                #endif
            #endif

            #ifdef ${this._defineProjectionName}
                vec3 ${this._reflectionVectorName} = computeProjectionCoords(${worldPos}, ${view}, ${reflectionMatrix});
            #endif

            #ifdef ${this._defineSkyboxName}
                vec3 ${this._reflectionVectorName} = computeSkyBoxCoords(${positionUVW}, ${reflectionMatrix});
            #endif

            #ifdef ${this._defineExplicitName}
                vec3 ${this._reflectionVectorName} = vec3(0, 0, 0);
            #endif\r\n`;return doNotEmitInvertZ || (code += `#ifdef ${this._defineOppositeZ}
                ${this._reflectionVectorName}.z *= -1.0;
            #endif\r\n`), onlyReflectionVector || (code += `
                #ifdef ${this._define3DName}
                    vec3 ${this._reflectionCoordsName} = ${this._reflectionVectorName};
                #else
                    vec2 ${this._reflectionCoordsName} = ${this._reflectionVectorName}.xy;
                    #ifdef ${this._defineProjectionName}
                        ${this._reflectionCoordsName} /= ${this._reflectionVectorName}.z;
                    #endif
                    ${this._reflectionCoordsName}.y = 1.0 - ${this._reflectionCoordsName}.y;
                #endif\r\n`), code;}handleFragmentSideCodeReflectionColor(lodVarName, swizzleLookupTexture = ".rgb") {const colorType = "vec" + (0 === swizzleLookupTexture.length ? "4" : swizzleLookupTexture.length - 1);let code = `${colorType} ${this._reflectionColorName};
            #ifdef ${this._define3DName}\r\n`;return code += lodVarName ? `${this._reflectionColorName} = textureCubeLodEXT(${this._cubeSamplerName}, ${this._reflectionVectorName}, ${lodVarName})${swizzleLookupTexture};\r\n` : `${this._reflectionColorName} = textureCube(${this._cubeSamplerName}, ${this._reflectionVectorName})${swizzleLookupTexture};\r\n`, code += `
            #else\r\n`, code += lodVarName ? `${this._reflectionColorName} = texture2DLodEXT(${this._2DSamplerName}, ${this._reflectionCoordsName}, ${lodVarName})${swizzleLookupTexture};\r\n` : `${this._reflectionColorName} = texture2D(${this._2DSamplerName}, ${this._reflectionCoordsName})${swizzleLookupTexture};\r\n`, code += `#endif\r\n`, code;}writeOutputs(state, varName) {let code = "";if (state.target === NodeMaterialBlockTargets.Fragment) for (const output of this._outputs) output.hasEndpoints && (code += `${this._declareOutput(output, state)} = ${varName}.${output.name};\r\n`);return code;}_buildBlock(state) {return super._buildBlock(state), this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();if (!this.texture) return codeString;if (this.texture.isCube) {const forcedExtension = this.texture.forcedExtension;codeString += `${this._codeVariableName}.texture = new BABYLON.CubeTexture("${this.texture.name}", undefined, undefined, ${this.texture.noMipmap}, null, undefined, undefined, undefined, ${this.texture._prefiltered}, ${forcedExtension ? "\"" + forcedExtension + "\"" : "null"});\r\n`;} else codeString += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null);\r\n`;return codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return this.texture && !this.texture.isRenderTarget && (serializationObject.texture = this.texture.serialize()), serializationObject.generateOnlyFragmentCode = this.generateOnlyFragmentCode, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), serializationObject.texture && !NodeMaterial.IgnoreTexturesAtLoadTime && (rootUrl = 0 === serializationObject.texture.url.indexOf("data:") ? "" : rootUrl, this.texture = serializationObject.texture.isCube ? Textures_cubeTexture/* CubeTexture.Parse */.B.Parse(serializationObject.texture, scene, rootUrl) : Textures_texture/* Texture.Parse */.x.Parse(serializationObject.texture, scene, rootUrl)), this.generateOnlyFragmentCode = serializationObject.generateOnlyFragmentCode, this._setTarget();}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Generate only fragment code", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: !0, update: !0, onValidation: ReflectionTextureBaseBlock._OnGenerateOnlyFragmentCodeChanged } })], ReflectionTextureBaseBlock.prototype, "generateOnlyFragmentCode", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ReflectionTextureBaseBlock", ReflectionTextureBaseBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/reflectionTextureBlock.js
class ReflectionTextureBlock extends ReflectionTextureBaseBlock {_onGenerateOnlyFragmentCodeChanged() {return this.position.isConnected ? (this.generateOnlyFragmentCode = !this.generateOnlyFragmentCode, console.error("The position input must not be connected to be able to switch!"), !1) : this.worldPosition.isConnected ? (this.generateOnlyFragmentCode = !this.generateOnlyFragmentCode, console.error("The worldPosition input must not be connected to be able to switch!"), !1) : (this._setTarget(), !0);}_setTarget() {super._setTarget(), this.getInputByName("position").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex, this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex;}constructor(name) {super(name), this.registerInput("position", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1, NodeMaterialBlockTargets.Vertex), this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, !1, NodeMaterialBlockTargets.Vertex), this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, !1, NodeMaterialBlockTargets.Vertex), this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, !1, NodeMaterialBlockTargets.Fragment), this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment), this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment), this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment), this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment), this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "ReflectionTextureBlock";}get position() {return this._inputs[0];}get worldPosition() {return this._inputs[1];}get worldNormal() {return this._inputs[2];}get world() {return this._inputs[3];}get cameraPosition() {return this._inputs[4];}get view() {return this._inputs[5];}get rgb() {return this._outputs[0];}get rgba() {return this._outputs[1];}get r() {return this._outputs[2];}get g() {return this._outputs[3];}get b() {return this._outputs[4];}get a() {return this._outputs[5];}autoConfigure(material) {if (super.autoConfigure(material), !this.cameraPosition.isConnected) {let cameraPositionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.CameraPosition);cameraPositionInput || (cameraPositionInput = new InputBlock("cameraPosition"), cameraPositionInput.setAsSystemValue(NodeMaterialSystemValues.CameraPosition)), cameraPositionInput.output.connectTo(this.cameraPosition);}}_buildBlock(state) {if (super._buildBlock(state), !this.texture) return state.compilationString += this.writeOutputs(state, "vec4(0.)"), this;if (state.target !== NodeMaterialBlockTargets.Fragment) return state.compilationString += this.handleVertexSide(state), this;this.generateOnlyFragmentCode && (state.compilationString += this.handleVertexSide(state)), this.handleFragmentSideInits(state);const normalWUnit = state._getFreeVariableName("normalWUnit");return state.compilationString += `vec4 ${normalWUnit} = normalize(${this.worldNormal.associatedVariableName});\r\n`, state.compilationString += this.handleFragmentSideCodeReflectionCoords(normalWUnit), state.compilationString += this.handleFragmentSideCodeReflectionColor(void 0, ""), state.compilationString += this.writeOutputs(state, this._reflectionColorName), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ReflectionTextureBlock", ReflectionTextureBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/sceneDepthBlock.js
class SceneDepthBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.VertexAndFragment), this.useNonLinearDepth = !1, this.force32itsFloat = !1, this._isUnique = !0, this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1, NodeMaterialBlockTargets.VertexAndFragment), this.registerOutput("depth", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4), this._inputs[0]._prioritizeVertex = !1;}getClassName() {return "SceneDepthBlock";}get uv() {return this._inputs[0];}get depth() {return this._outputs[0];}initialize(state) {state._excludeVariableName("textureSampler");}get target() {return this.uv.isConnected ? this.uv.sourceBlock.isInput ? NodeMaterialBlockTargets.VertexAndFragment : NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment;}_getTexture(scene) {const depthRenderer = scene.enableDepthRenderer(void 0, this.useNonLinearDepth, this.force32itsFloat);return depthRenderer.getDepthMap();}bind(effect, nodeMaterial) {const texture = this._getTexture(nodeMaterial.getScene());effect.setTexture(this._samplerName, texture);}_injectVertexCode(state) {const uvInput = this.uv;if (uvInput.connectedPoint.ownerBlock.isInput) {const uvInputOwnerBlock = uvInput.connectedPoint.ownerBlock;uvInputOwnerBlock.isAttribute || state._emitUniformFromString(uvInput.associatedVariableName, "vec" + (uvInput.type === NodeMaterialBlockConnectionPointTypes.Vector3 ? "3" : uvInput.type === NodeMaterialBlockConnectionPointTypes.Vector4 ? "4" : "2"));}if (this._mainUVName = "vMain" + uvInput.associatedVariableName, state._emitVaryingFromString(this._mainUVName, "vec2"), state.compilationString += `${this._mainUVName} = ${uvInput.associatedVariableName}.xy;\r\n`, !!this._outputs.some((o) => o.isConnectedInVertexShader)) {this._writeTextureRead(state, !0);for (const output of this._outputs) output.hasEndpoints && this._writeOutput(state, output, "r", !0);}}_writeTextureRead(state, vertexMode = !1) {const uvInput = this.uv;return vertexMode ? state.target === NodeMaterialBlockTargets.Fragment ? void 0 : void (state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${uvInput.associatedVariableName}.xy);\r\n`) : this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment ? void (state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${uvInput.associatedVariableName}.xy);\r\n`) : void (state.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${this._mainUVName});\r\n`);}_writeOutput(state, output, swizzle, vertexMode = !1) {return vertexMode ? state.target === NodeMaterialBlockTargets.Fragment ? void 0 : void (state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle};\r\n`) : this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment ? void (state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle};\r\n`) : void (state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle};\r\n`);}_buildBlock(state) {if (super._buildBlock(state), this._samplerName = state._getFreeVariableName(this.name + "Sampler"), this._tempTextureRead = state._getFreeVariableName("tempTextureRead"), 0 > state.sharedData.bindableBlocks.indexOf(this) && state.sharedData.bindableBlocks.push(this), state.target !== NodeMaterialBlockTargets.Fragment) return state._emit2DSampler(this._samplerName), void this._injectVertexCode(state);if (this._outputs.some((o) => o.isConnectedInFragmentShader)) {state._emit2DSampler(this._samplerName), this._writeTextureRead(state);for (const output of this._outputs) output.hasEndpoints && this._writeOutput(state, output, "r");return this;}}serialize() {const serializationObject = super.serialize();return serializationObject.useNonLinearDepth = this.useNonLinearDepth, serializationObject.force32itsFloat = this.force32itsFloat, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.useNonLinearDepth = serializationObject.useNonLinearDepth, this.force32itsFloat = serializationObject.force32itsFloat;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Use non linear depth", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { activatePreviewCommand: !0, callback: (scene) => scene.disableDepthRenderer() } })], SceneDepthBlock.prototype, "useNonLinearDepth", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Force 32 bits float", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { activatePreviewCommand: !0, callback: (scene) => scene.disableDepthRenderer() } })], SceneDepthBlock.prototype, "force32itsFloat", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.SceneDepthBlock", SceneDepthBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/clipPlanesBlock.js
class ClipPlanesBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.VertexAndFragment, !0), this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, !1);}getClassName() {return "ClipPlanesBlock";}initialize(state) {state._excludeVariableName("vClipPlane"), state._excludeVariableName("fClipDistance"), state._excludeVariableName("vClipPlane2"), state._excludeVariableName("fClipDistance2"), state._excludeVariableName("vClipPlane3"), state._excludeVariableName("fClipDistance3"), state._excludeVariableName("vClipPlane4"), state._excludeVariableName("fClipDistance4"), state._excludeVariableName("vClipPlane5"), state._excludeVariableName("fClipDistance5"), state._excludeVariableName("vClipPlane6"), state._excludeVariableName("fClipDistance6");}get worldPosition() {return this._inputs[0];}get target() {return NodeMaterialBlockTargets.VertexAndFragment;}set target(value) {}prepareDefines(mesh, nodeMaterial, defines) {var _a, _b, _c, _d, _e, _f;const scene = mesh.getScene(),useClipPlane1 = !(null !== (_a = nodeMaterial.clipPlane) && void 0 !== _a ? !_a : !scene.clipPlane),useClipPlane2 = !(null !== (_b = nodeMaterial.clipPlane2) && void 0 !== _b ? !_b : !scene.clipPlane2),useClipPlane3 = !(null !== (_c = nodeMaterial.clipPlane3) && void 0 !== _c ? !_c : !scene.clipPlane3),useClipPlane4 = !(null !== (_d = nodeMaterial.clipPlane4) && void 0 !== _d ? !_d : !scene.clipPlane4),useClipPlane5 = !(null !== (_e = nodeMaterial.clipPlane5) && void 0 !== _e ? !_e : !scene.clipPlane5),useClipPlane6 = !(null !== (_f = nodeMaterial.clipPlane6) && void 0 !== _f ? !_f : !scene.clipPlane6);defines.setValue("CLIPPLANE", useClipPlane1, !0), defines.setValue("CLIPPLANE2", useClipPlane2, !0), defines.setValue("CLIPPLANE3", useClipPlane3, !0), defines.setValue("CLIPPLANE4", useClipPlane4, !0), defines.setValue("CLIPPLANE5", useClipPlane5, !0), defines.setValue("CLIPPLANE6", useClipPlane6, !0);}bind(effect, nodeMaterial, mesh) {if (mesh) {const scene = mesh.getScene();(0,clipPlaneMaterialHelper/* bindClipPlane */.an)(effect, nodeMaterial, scene);}}_buildBlock(state) {super._buildBlock(state);const comments = `//${this.name}`;if (state.target !== NodeMaterialBlockTargets.Fragment) {const worldPos = this.worldPosition;return state._emitFunctionFromInclude("clipPlaneVertexDeclaration", comments, { replaceStrings: [{ search: /uniform vec4 vClipPlane\d*;/g, replace: "" }] }), state.compilationString += state._emitCodeFromInclude("clipPlaneVertex", comments, { replaceStrings: [{ search: /worldPos/g, replace: worldPos.associatedVariableName }] }), state._emitUniformFromString("vClipPlane", "vec4"), state._emitUniformFromString("vClipPlane2", "vec4"), state._emitUniformFromString("vClipPlane3", "vec4"), state._emitUniformFromString("vClipPlane4", "vec4"), state._emitUniformFromString("vClipPlane5", "vec4"), void state._emitUniformFromString("vClipPlane6", "vec4");}return state.sharedData.bindableBlocks.push(this), state.sharedData.blocksWithDefines.push(this), state._emitFunctionFromInclude("clipPlaneFragmentDeclaration", comments), state.compilationString += state._emitCodeFromInclude("clipPlaneFragment", comments), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ClipPlanesBlock", ClipPlanesBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Input/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/addBlock.js
class AddBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);}getClassName() {return "AddBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = ${this.left.associatedVariableName} + ${this.right.associatedVariableName};\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.AddBlock", AddBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/scaleBlock.js
class ScaleBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("factor", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];}getClassName() {return "ScaleBlock";}get input() {return this._inputs[0];}get factor() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = ${this.input.associatedVariableName} * ${this.factor.associatedVariableName};\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ScaleBlock", ScaleBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/clampBlock.js
class ClampBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.minimum = 0, this.maximum = 1, this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];}getClassName() {return "ClampBlock";}get value() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = clamp(${this.value.associatedVariableName}, ${this._writeFloat(this.minimum)}, ${this._writeFloat(this.maximum)});\r\n`, this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.minimum = ${this.minimum};\r\n`;return codeString += `${this._codeVariableName}.maximum = ${this.maximum};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.minimum = this.minimum, serializationObject.maximum = this.maximum, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.minimum = serializationObject.minimum, this.maximum = serializationObject.maximum;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Minimum", PropertyTypeForEdition.Float)], ClampBlock.prototype, "minimum", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Maximum", PropertyTypeForEdition.Float)], ClampBlock.prototype, "maximum", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ClampBlock", ClampBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/crossBlock.js
class CrossBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3), this._linkConnectionTypes(0, 1), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);}getClassName() {return "CrossBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = cross(${this.left.associatedVariableName}.xyz, ${this.right.associatedVariableName}.xyz);\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.CrossBlock", CrossBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/customBlock.js
class CustomBlock extends NodeMaterialBlock {get options() {return this._options;}set options(options) {this._deserializeOptions(options);}constructor(name) {super(name);}getClassName() {return "CustomBlock";}_buildBlock(state) {super._buildBlock(state);let code = this._code,functionName = this._options.functionName;this._inputs.forEach((input) => {const rexp = new RegExp("\\{TYPE_" + input.name + "\\}", "gm"),type = state._getGLType(input.type);code = code.replace(rexp, type), functionName = functionName.replace(rexp, type);}), this._outputs.forEach((output) => {const rexp = new RegExp("\\{TYPE_" + output.name + "\\}", "gm"),type = state._getGLType(output.type);code = code.replace(rexp, type), functionName = functionName.replace(rexp, type);}), state._emitFunction(functionName, code, ""), this._outputs.forEach((output) => {state.compilationString += this._declareOutput(output, state) + ";\r\n";}), state.compilationString += functionName + "(";let hasInput = !1;return this._inputs.forEach((input, index) => {0 < index && (state.compilationString += ", "), state.compilationString += input.associatedVariableName, hasInput = !0;}), this._outputs.forEach((output, index) => {(0 < index || hasInput) && (state.compilationString += ", "), state.compilationString += output.associatedVariableName;}), state.compilationString += ");\r\n", this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return codeString += `${this._codeVariableName}.options = ${JSON.stringify(this._options)};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.options = this._options, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {this._deserializeOptions(serializationObject.options), super._deserialize(serializationObject, scene, rootUrl);}_deserializeOptions(options) {var _a, _b, _c;this._options = options, this._code = options.code.join("\r\n") + "\r\n", this.name = this.name || options.name, this.target = NodeMaterialBlockTargets[options.target], null === (_a = options.inParameters) || void 0 === _a ? void 0 : _a.forEach((input, index) => {const type = NodeMaterialBlockConnectionPointTypes[input.type];this.registerInput(input.name, type), Object.defineProperty(this, input.name, { get: function () {return this._inputs[index];}, enumerable: !0, configurable: !0 });}), null === (_b = options.outParameters) || void 0 === _b ? void 0 : _b.forEach((output, index) => {this.registerOutput(output.name, NodeMaterialBlockConnectionPointTypes[output.type]), Object.defineProperty(this, output.name, { get: function () {return this._outputs[index];}, enumerable: !0, configurable: !0 }), "BasedOnInput" === output.type && (this._outputs[index]._typeConnectionSource = this._findInputByName(output.typeFromInput)[0]);}), null === (_c = options.inLinkedConnectionTypes) || void 0 === _c ? void 0 : _c.forEach((connection) => {this._linkConnectionTypes(this._findInputByName(connection.input1)[1], this._findInputByName(connection.input2)[1]);});}_findInputByName(name) {if (!name) return null;for (let i = 0; i < this._inputs.length; i++) if (this._inputs[i].name === name) return [this._inputs[i], i];return null;}}(0,typeStore/* RegisterClass */.H)("BABYLON.CustomBlock", CustomBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/dotBlock.js
class DotBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float), this._linkConnectionTypes(0, 1), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "DotBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = dot(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.DotBlock", DotBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/normalizeBlock.js
class NormalizeBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "NormalizeBlock";}get input() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0],input = this._inputs[0];return state.compilationString += this._declareOutput(output, state) + ` = normalize(${input.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.NormalizeBlock", NormalizeBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/colorMergerBlock.js
class ColorMergerBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.rSwizzle = "r", this.gSwizzle = "g", this.bSwizzle = "b", this.aSwizzle = "a", this.registerInput("rgb ", NodeMaterialBlockConnectionPointTypes.Color3, !0), this.registerInput("r", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("g", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("b", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("a", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4), this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3);}getClassName() {return "ColorMergerBlock";}get rgbIn() {return this._inputs[0];}get r() {return this._inputs[1];}get g() {return this._inputs[2];}get b() {return this._inputs[3];}get a() {return this._inputs[4];}get rgba() {return this._outputs[0];}get rgbOut() {return this._outputs[1];}get rgb() {return this.rgbOut;}_inputRename(name) {return "rgb " === name ? "rgbIn" : name;}_buildSwizzle(len) {const swizzle = this.rSwizzle + this.gSwizzle + this.bSwizzle + this.aSwizzle;return "." + swizzle.substr(0, len);}_buildBlock(state) {super._buildBlock(state);const rInput = this.r,gInput = this.g,bInput = this.b,aInput = this.a,rgbInput = this.rgbIn,color4Output = this._outputs[0],color3Output = this._outputs[1];return rgbInput.isConnected ? (color4Output.hasEndpoints && (state.compilationString += this._declareOutput(color4Output, state) + ` = vec4(${rgbInput.associatedVariableName}, ${aInput.isConnected ? this._writeVariable(aInput) : "0.0"})${this._buildSwizzle(4)};\r\n`), color3Output.hasEndpoints && (state.compilationString += this._declareOutput(color3Output, state) + ` = ${rgbInput.associatedVariableName}${this._buildSwizzle(3)};\r\n`)) : (color4Output.hasEndpoints && (state.compilationString += this._declareOutput(color4Output, state) + ` = vec4(${rInput.isConnected ? this._writeVariable(rInput) : "0.0"}, ${gInput.isConnected ? this._writeVariable(gInput) : "0.0"}, ${bInput.isConnected ? this._writeVariable(bInput) : "0.0"}, ${aInput.isConnected ? this._writeVariable(aInput) : "0.0"})${this._buildSwizzle(4)};\r\n`), color3Output.hasEndpoints && (state.compilationString += this._declareOutput(color3Output, state) + ` = vec3(${rInput.isConnected ? this._writeVariable(rInput) : "0.0"}, ${gInput.isConnected ? this._writeVariable(gInput) : "0.0"}, ${bInput.isConnected ? this._writeVariable(bInput) : "0.0"})${this._buildSwizzle(3)};\r\n`)), this;}serialize() {const serializationObject = super.serialize();return serializationObject.rSwizzle = this.rSwizzle, serializationObject.gSwizzle = this.gSwizzle, serializationObject.bSwizzle = this.bSwizzle, serializationObject.aSwizzle = this.aSwizzle, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {var _a, _b, _c, _d;super._deserialize(serializationObject, scene, rootUrl), this.rSwizzle = null !== (_a = serializationObject.rSwizzle) && void 0 !== _a ? _a : "r", this.gSwizzle = null !== (_b = serializationObject.gSwizzle) && void 0 !== _b ? _b : "g", this.bSwizzle = null !== (_c = serializationObject.bSwizzle) && void 0 !== _c ? _c : "b", this.aSwizzle = null !== (_d = serializationObject.aSwizzle) && void 0 !== _d ? _d : "a";}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return codeString += `${this._codeVariableName}.rSwizzle = "${this.rSwizzle}";\r\n`, codeString += `${this._codeVariableName}.gSwizzle = "${this.gSwizzle}";\r\n`, codeString += `${this._codeVariableName}.bSwizzle = "${this.bSwizzle}";\r\n`, codeString += `${this._codeVariableName}.aSwizzle = "${this.aSwizzle}";\r\n`, codeString;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ColorMergerBlock", ColorMergerBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/vectorSplitterBlock.js
class VectorSplitterBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("xyzw", NodeMaterialBlockConnectionPointTypes.Vector4, !0), this.registerInput("xyz ", NodeMaterialBlockConnectionPointTypes.Vector3, !0), this.registerInput("xy ", NodeMaterialBlockConnectionPointTypes.Vector2, !0), this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerOutput("zw", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("z", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("w", NodeMaterialBlockConnectionPointTypes.Float), this.inputsAreExclusive = !0;}getClassName() {return "VectorSplitterBlock";}get xyzw() {return this._inputs[0];}get xyzIn() {return this._inputs[1];}get xyIn() {return this._inputs[2];}get xyzOut() {return this._outputs[0];}get xyOut() {return this._outputs[1];}get zw() {return this._outputs[2];}get x() {return this._outputs[3];}get y() {return this._outputs[4];}get z() {return this._outputs[5];}get w() {return this._outputs[6];}_inputRename(name) {return "xy " === name ? "xyIn" : "xyz " === name ? "xyzIn" : name;}_outputRename(name) {return "xy" === name ? "xyOut" : "xyz" === name ? "xyzOut" : name;}_buildBlock(state) {super._buildBlock(state);const input = this.xyzw.isConnected ? this.xyzw : this.xyzIn.isConnected ? this.xyzIn : this.xyIn,xyzOutput = this._outputs[0],xyOutput = this._outputs[1],zwOutput = this._outputs[2],xOutput = this._outputs[3],yOutput = this._outputs[4],zOutput = this._outputs[5],wOutput = this._outputs[6];return xyzOutput.hasEndpoints && (input === this.xyIn ? state.compilationString += this._declareOutput(xyzOutput, state) + ` = vec3(${input.associatedVariableName}, 0.0);\r\n` : state.compilationString += this._declareOutput(xyzOutput, state) + ` = ${input.associatedVariableName}.xyz;\r\n`), zwOutput.hasEndpoints && this.xyzw.isConnected && (state.compilationString += this._declareOutput(zwOutput, state) + ` = ${this.xyzw.associatedVariableName}.zw;\r\n`), xyOutput.hasEndpoints && (state.compilationString += this._declareOutput(xyOutput, state) + ` = ${input.associatedVariableName}.xy;\r\n`), xOutput.hasEndpoints && (state.compilationString += this._declareOutput(xOutput, state) + ` = ${input.associatedVariableName}.x;\r\n`), yOutput.hasEndpoints && (state.compilationString += this._declareOutput(yOutput, state) + ` = ${input.associatedVariableName}.y;\r\n`), zOutput.hasEndpoints && (state.compilationString += this._declareOutput(zOutput, state) + ` = ${input.associatedVariableName}.z;\r\n`), wOutput.hasEndpoints && (state.compilationString += this._declareOutput(wOutput, state) + ` = ${input.associatedVariableName}.w;\r\n`), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.VectorSplitterBlock", VectorSplitterBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/lerpBlock.js
class LerpBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("gradient", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._linkConnectionTypes(1, 2, !0), this._inputs[2].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "LerpBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get gradient() {return this._inputs[2];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.LerpBlock", LerpBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/divideBlock.js
class DivideBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);}getClassName() {return "DivideBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = ${this.left.associatedVariableName} / ${this.right.associatedVariableName};\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.DivideBlock", DivideBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/subtractBlock.js
class SubtractBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);}getClassName() {return "SubtractBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = ${this.left.associatedVariableName} - ${this.right.associatedVariableName};\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.SubtractBlock", SubtractBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/stepBlock.js
class StepBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("value", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("edge", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "StepBlock";}get value() {return this._inputs[0];}get edge() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = step(${this.edge.associatedVariableName}, ${this.value.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.StepBlock", StepBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/oneMinusBlock.js
class OneMinusBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._outputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "OneMinusBlock";}get input() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = 1. - ${this.input.associatedVariableName};\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.OneMinusBlock", OneMinusBlock), (0,typeStore/* RegisterClass */.H)("BABYLON.OppositeBlock", OneMinusBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/viewDirectionBlock.js
class ViewDirectionBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3);}getClassName() {return "ViewDirectionBlock";}get worldPosition() {return this._inputs[0];}get cameraPosition() {return this._inputs[1];}get output() {return this._outputs[0];}autoConfigure(material) {if (!this.cameraPosition.isConnected) {let cameraPositionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.CameraPosition);cameraPositionInput || (cameraPositionInput = new InputBlock("cameraPosition"), cameraPositionInput.setAsSystemValue(NodeMaterialSystemValues.CameraPosition)), cameraPositionInput.output.connectTo(this.cameraPosition);}}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = normalize(${this.cameraPosition.associatedVariableName} - ${this.worldPosition.associatedVariableName}.xyz);\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ViewDirectionBlock", ViewDirectionBlock);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fresnelFunction.js
var fresnelFunction = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/fresnelFunction.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/fresnelBlock.js
class FresnelBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("viewDirection", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerInput("bias", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("power", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("fresnel", NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "FresnelBlock";}get worldNormal() {return this._inputs[0];}get viewDirection() {return this._inputs[1];}get bias() {return this._inputs[2];}get power() {return this._inputs[3];}get fresnel() {return this._outputs[0];}autoConfigure(material) {if (!this.viewDirection.isConnected) {const viewDirectionInput = new ViewDirectionBlock("View direction");viewDirectionInput.output.connectTo(this.viewDirection), viewDirectionInput.autoConfigure(material);}if (!this.bias.isConnected) {const biasInput = new InputBlock("bias");biasInput.value = 0, biasInput.output.connectTo(this.bias);}if (!this.power.isConnected) {const powerInput = new InputBlock("power");powerInput.value = 1, powerInput.output.connectTo(this.power);}}_buildBlock(state) {super._buildBlock(state);const comments = `//${this.name}`;return state._emitFunctionFromInclude("fresnelFunction", comments, { removeIfDef: !0 }), state.compilationString += this._declareOutput(this.fresnel, state) + ` = computeFresnelTerm(${this.viewDirection.associatedVariableName}.xyz, ${this.worldNormal.associatedVariableName}.xyz, ${this.bias.associatedVariableName}, ${this.power.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.FresnelBlock", FresnelBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/maxBlock.js
class MaxBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);}getClassName() {return "MaxBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = max(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.MaxBlock", MaxBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/minBlock.js
class MinBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);}getClassName() {return "MinBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = min(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.MinBlock", MinBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/distanceBlock.js
class DistanceBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float), this._linkConnectionTypes(0, 1), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "DistanceBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = length(${this.left.associatedVariableName} - ${this.right.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.DistanceBlock", DistanceBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/lengthBlock.js
class LengthBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "LengthBlock";}get value() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = length(${this.value.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.LengthBlock", LengthBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/negateBlock.js
class NegateBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];}getClassName() {return "NegateBlock";}get value() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = -1.0 * ${this.value.associatedVariableName};\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.NegateBlock", NegateBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/powBlock.js
class PowBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("power", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);}getClassName() {return "PowBlock";}get value() {return this._inputs[0];}get power() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = pow(${this.value.associatedVariableName}, ${this.power.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.PowBlock", PowBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/randomNumberBlock.js
class RandomNumberBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4);}getClassName() {return "RandomNumberBlock";}get seed() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0],comments = `//${this.name}`;return state._emitFunctionFromInclude("helperFunctions", comments), state.compilationString += this._declareOutput(output, state) + ` = getRand(${this.seed.associatedVariableName}.xy);\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.RandomNumberBlock", RandomNumberBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/arcTan2Block.js
class ArcTan2Block extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("x", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("y", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "ArcTan2Block";}get x() {return this._inputs[0];}get y() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = atan(${this.x.associatedVariableName}, ${this.y.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ArcTan2Block", ArcTan2Block);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/smoothStepBlock.js
class SmoothStepBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("edge0", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("edge1", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];}getClassName() {return "SmoothStepBlock";}get value() {return this._inputs[0];}get edge0() {return this._inputs[1];}get edge1() {return this._inputs[2];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = smoothstep(${this.edge0.associatedVariableName}, ${this.edge1.associatedVariableName}, ${this.value.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.SmoothStepBlock", SmoothStepBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/reciprocalBlock.js
class ReciprocalBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];}getClassName() {return "ReciprocalBlock";}get input() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this.input.type === NodeMaterialBlockConnectionPointTypes.Matrix ? this._declareOutput(output, state) + ` = inverse(${this.input.associatedVariableName});\r\n` : this._declareOutput(output, state) + ` = 1. / ${this.input.associatedVariableName};\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ReciprocalBlock", ReciprocalBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/replaceColorBlock.js
class ReplaceColorBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("reference", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("distance", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("replacement", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._linkConnectionTypes(0, 3), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix), this._inputs[3].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float), this._inputs[3].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "ReplaceColorBlock";}get value() {return this._inputs[0];}get reference() {return this._inputs[1];}get distance() {return this._inputs[2];}get replacement() {return this._inputs[3];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + `;\r\n`, state.compilationString += `if (length(${this.value.associatedVariableName} - ${this.reference.associatedVariableName}) < ${this.distance.associatedVariableName}) {\r\n`, state.compilationString += `${output.associatedVariableName} = ${this.replacement.associatedVariableName};\r\n`, state.compilationString += `} else {\r\n`, state.compilationString += `${output.associatedVariableName} = ${this.value.associatedVariableName};\r\n`, state.compilationString += `}\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ReplaceColorBlock", ReplaceColorBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/posterizeBlock.js
class PosterizeBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("steps", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix), this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "PosterizeBlock";}get value() {return this._inputs[0];}get steps() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = floor(${this.value.associatedVariableName} / (1.0 / ${this.steps.associatedVariableName})) * (1.0 / ${this.steps.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.PosterizeBlock", PosterizeBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/waveBlock.js
var WaveBlockKind;(function (WaveBlockKind) {WaveBlockKind[WaveBlockKind.SawTooth = 0] = "SawTooth", WaveBlockKind[WaveBlockKind.Square = 1] = "Square", WaveBlockKind[WaveBlockKind.Triangle = 2] = "Triangle";})(WaveBlockKind || (WaveBlockKind = {}));class WaveBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.kind = WaveBlockKind.SawTooth, this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "WaveBlock";}get input() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];switch (this.kind) {case WaveBlockKind.SawTooth:{state.compilationString += this._declareOutput(output, state) + ` = ${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName});\r\n`;break;}case WaveBlockKind.Square:{state.compilationString += this._declareOutput(output, state) + ` = 1.0 - 2.0 * round(fract(${this.input.associatedVariableName}));\r\n`;break;}case WaveBlockKind.Triangle:{state.compilationString += this._declareOutput(output, state) + ` = 2.0 * abs(2.0 * (${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName}))) - 1.0;\r\n`;break;}}return this;}serialize() {const serializationObject = super.serialize();return serializationObject.kind = this.kind, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.kind = serializationObject.kind;}}(0,typeStore/* RegisterClass */.H)("BABYLON.WaveBlock", WaveBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/gradientBlock.js
class GradientBlockColorStep {get step() {return this._step;}set step(val) {this._step = val;}get color() {return this._color;}set color(val) {this._color = val;}constructor(step, color) {this.step = step, this.color = color;}}class GradientBlock extends NodeMaterialBlock {colorStepsUpdated() {this.onValueChangedObservable.notifyObservers(this);}constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.colorSteps = [new GradientBlockColorStep(0, math_color/* Color3.Black */.Wo.Black()), new GradientBlockColorStep(1, math_color/* Color3.White */.Wo.White())], this.onValueChangedObservable = new observable/* Observable */.y$(), this.registerInput("gradient", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Float | NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4);}getClassName() {return "GradientBlock";}get gradient() {return this._inputs[0];}get output() {return this._outputs[0];}_writeColorConstant(index) {const step = this.colorSteps[index];return `vec3(${step.color.r}, ${step.color.g}, ${step.color.b})`;}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];if (!this.colorSteps.length || !this.gradient.connectedPoint) return void (state.compilationString += this._declareOutput(output, state) + ` = vec3(0., 0., 0.);\r\n`);const tempColor = state._getFreeVariableName("gradientTempColor"),tempPosition = state._getFreeVariableName("gradientTempPosition");state.compilationString += `vec3 ${tempColor} = ${this._writeColorConstant(0)};\r\n`, state.compilationString += `float ${tempPosition};\r\n`;let gradientSource = this.gradient.associatedVariableName;this.gradient.connectedPoint.type !== NodeMaterialBlockConnectionPointTypes.Float && (gradientSource += ".x");for (let index = 1; index < this.colorSteps.length; index++) {const step = this.colorSteps[index],previousStep = this.colorSteps[index - 1];state.compilationString += `${tempPosition} = clamp((${gradientSource} - ${state._emitFloat(previousStep.step)}) / (${state._emitFloat(step.step)} -  ${state._emitFloat(previousStep.step)}), 0.0, 1.0) * step(${state._emitFloat(index)}, ${state._emitFloat(this.colorSteps.length - 1)});\r\n`, state.compilationString += `${tempColor} = mix(${tempColor}, ${this._writeColorConstant(index)}, ${tempPosition});\r\n`;}return state.compilationString += this._declareOutput(output, state) + ` = ${tempColor};\r\n`, this;}serialize() {const serializationObject = super.serialize();serializationObject.colorSteps = [];for (const step of this.colorSteps) serializationObject.colorSteps.push({ step: step.step, color: { r: step.color.r, g: step.color.g, b: step.color.b } });return serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.colorSteps.length = 0;for (const step of serializationObject.colorSteps) this.colorSteps.push(new GradientBlockColorStep(step.step, new math_color/* Color3 */.Wo(step.color.r, step.color.g, step.color.b)));}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();codeString += `${this._codeVariableName}.colorSteps = [];\r\n`;for (const colorStep of this.colorSteps) codeString += `${this._codeVariableName}.colorSteps.push(new BABYLON.GradientBlockColorStep(${colorStep.step}, new BABYLON.Color3(${colorStep.color.r}, ${colorStep.color.g}, ${colorStep.color.b})));\r\n`;return codeString;}}(0,typeStore/* RegisterClass */.H)("BABYLON.GradientBlock", GradientBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/nLerpBlock.js
class NLerpBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("gradient", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._linkConnectionTypes(1, 2, !0), this._inputs[2].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "NLerpBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get gradient() {return this._inputs[2];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = normalize(mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName}));\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.NLerpBlock", NLerpBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/worleyNoise3DBlock.js
class WorleyNoise3DBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.manhattanDistance = !1, this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerInput("jitter", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "WorleyNoise3DBlock";}get seed() {return this._inputs[0];}get jitter() {return this._inputs[1];}get output() {return this._outputs[0];}get x() {return this._outputs[1];}get y() {return this._outputs[2];}_buildBlock(state) {if (super._buildBlock(state), !this.seed.isConnected) return;if (!this.output.hasEndpoints && !this.x.hasEndpoints && !this.y.hasEndpoints) return;let functionString = `vec3 permute(vec3 x){\r\n`;functionString += `    return mod((34.0 * x + 1.0) * x, 289.0);\r\n`, functionString += `}\r\n\r\n`, functionString += `vec3 dist(vec3 x, vec3 y, vec3 z,  bool manhattanDistance){\r\n`, functionString += `    return manhattanDistance ?  abs(x) + abs(y) + abs(z) :  (x * x + y * y + z * z);\r\n`, functionString += `}\r\n\r\n`, functionString += `vec2 worley(vec3 P, float jitter, bool manhattanDistance){\r\n`, functionString += `    float K = 0.142857142857; // 1/7\r\n`, functionString += `    float Ko = 0.428571428571; // 1/2-K/2\r\n`, functionString += `    float  K2 = 0.020408163265306; // 1/(7*7)\r\n`, functionString += `    float Kz = 0.166666666667; // 1/6\r\n`, functionString += `    float Kzo = 0.416666666667; // 1/2-1/6*2\r\n`, functionString += `\r\n`, functionString += `    vec3 Pi = mod(floor(P), 289.0);\r\n`, functionString += `    vec3 Pf = fract(P) - 0.5;\r\n`, functionString += `\r\n`, functionString += `    vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0);\r\n`, functionString += `    vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0);\r\n`, functionString += `    vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0);\r\n`, functionString += `\r\n`, functionString += `    vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0));\r\n`, functionString += `    vec3 p1 = permute(p + Pi.y - 1.0);\r\n`, functionString += `    vec3 p2 = permute(p + Pi.y);\r\n`, functionString += `    vec3 p3 = permute(p + Pi.y + 1.0);\r\n`, functionString += `\r\n`, functionString += `    vec3 p11 = permute(p1 + Pi.z - 1.0);\r\n`, functionString += `    vec3 p12 = permute(p1 + Pi.z);\r\n`, functionString += `    vec3 p13 = permute(p1 + Pi.z + 1.0);\r\n`, functionString += `\r\n`, functionString += `    vec3 p21 = permute(p2 + Pi.z - 1.0);\r\n`, functionString += `    vec3 p22 = permute(p2 + Pi.z);\r\n`, functionString += `    vec3 p23 = permute(p2 + Pi.z + 1.0);\r\n`, functionString += `\r\n`, functionString += `    vec3 p31 = permute(p3 + Pi.z - 1.0);\r\n`, functionString += `    vec3 p32 = permute(p3 + Pi.z);\r\n`, functionString += `    vec3 p33 = permute(p3 + Pi.z + 1.0);\r\n`, functionString += `\r\n`, functionString += `    vec3 ox11 = fract(p11*K) - Ko;\r\n`, functionString += `    vec3 oy11 = mod(floor(p11*K), 7.0)*K - Ko;\r\n`, functionString += `    vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed\r\n`, functionString += `\r\n`, functionString += `    vec3 ox12 = fract(p12*K) - Ko;\r\n`, functionString += `    vec3 oy12 = mod(floor(p12*K), 7.0)*K - Ko;\r\n`, functionString += `    vec3 oz12 = floor(p12*K2)*Kz - Kzo;\r\n`, functionString += `\r\n`, functionString += `    vec3 ox13 = fract(p13*K) - Ko;\r\n`, functionString += `    vec3 oy13 = mod(floor(p13*K), 7.0)*K - Ko;\r\n`, functionString += `    vec3 oz13 = floor(p13*K2)*Kz - Kzo;\r\n`, functionString += `\r\n`, functionString += `    vec3 ox21 = fract(p21*K) - Ko;\r\n`, functionString += `    vec3 oy21 = mod(floor(p21*K), 7.0)*K - Ko;\r\n`, functionString += `    vec3 oz21 = floor(p21*K2)*Kz - Kzo;\r\n`, functionString += `\r\n`, functionString += `    vec3 ox22 = fract(p22*K) - Ko;\r\n`, functionString += `    vec3 oy22 = mod(floor(p22*K), 7.0)*K - Ko;\r\n`, functionString += `    vec3 oz22 = floor(p22*K2)*Kz - Kzo;\r\n`, functionString += `\r\n`, functionString += `    vec3 ox23 = fract(p23*K) - Ko;\r\n`, functionString += `    vec3 oy23 = mod(floor(p23*K), 7.0)*K - Ko;\r\n`, functionString += `    vec3 oz23 = floor(p23*K2)*Kz - Kzo;\r\n`, functionString += `\r\n`, functionString += `    vec3 ox31 = fract(p31*K) - Ko;\r\n`, functionString += `    vec3 oy31 = mod(floor(p31*K), 7.0)*K - Ko;\r\n`, functionString += `    vec3 oz31 = floor(p31*K2)*Kz - Kzo;\r\n`, functionString += `\r\n`, functionString += `    vec3 ox32 = fract(p32*K) - Ko;\r\n`, functionString += `    vec3 oy32 = mod(floor(p32*K), 7.0)*K - Ko;\r\n`, functionString += `    vec3 oz32 = floor(p32*K2)*Kz - Kzo;\r\n`, functionString += `\r\n`, functionString += `    vec3 ox33 = fract(p33*K) - Ko;\r\n`, functionString += `    vec3 oy33 = mod(floor(p33*K), 7.0)*K - Ko;\r\n`, functionString += `    vec3 oz33 = floor(p33*K2)*Kz - Kzo;\r\n`, functionString += `\r\n`, functionString += `    vec3 dx11 = Pfx + jitter*ox11;\r\n`, functionString += `    vec3 dy11 = Pfy.x + jitter*oy11;\r\n`, functionString += `    vec3 dz11 = Pfz.x + jitter*oz11;\r\n`, functionString += `\r\n`, functionString += `    vec3 dx12 = Pfx + jitter*ox12;\r\n`, functionString += `    vec3 dy12 = Pfy.x + jitter*oy12;\r\n`, functionString += `    vec3 dz12 = Pfz.y + jitter*oz12;\r\n`, functionString += `\r\n`, functionString += `    vec3 dx13 = Pfx + jitter*ox13;\r\n`, functionString += `    vec3 dy13 = Pfy.x + jitter*oy13;\r\n`, functionString += `    vec3 dz13 = Pfz.z + jitter*oz13;\r\n`, functionString += `\r\n`, functionString += `    vec3 dx21 = Pfx + jitter*ox21;\r\n`, functionString += `    vec3 dy21 = Pfy.y + jitter*oy21;\r\n`, functionString += `    vec3 dz21 = Pfz.x + jitter*oz21;\r\n`, functionString += `\r\n`, functionString += `    vec3 dx22 = Pfx + jitter*ox22;\r\n`, functionString += `    vec3 dy22 = Pfy.y + jitter*oy22;\r\n`, functionString += `    vec3 dz22 = Pfz.y + jitter*oz22;\r\n`, functionString += `\r\n`, functionString += `    vec3 dx23 = Pfx + jitter*ox23;\r\n`, functionString += `    vec3 dy23 = Pfy.y + jitter*oy23;\r\n`, functionString += `    vec3 dz23 = Pfz.z + jitter*oz23;\r\n`, functionString += `\r\n`, functionString += `    vec3 dx31 = Pfx + jitter*ox31;\r\n`, functionString += `    vec3 dy31 = Pfy.z + jitter*oy31;\r\n`, functionString += `    vec3 dz31 = Pfz.x + jitter*oz31;\r\n`, functionString += `\r\n`, functionString += `    vec3 dx32 = Pfx + jitter*ox32;\r\n`, functionString += `    vec3 dy32 = Pfy.z + jitter*oy32;\r\n`, functionString += `    vec3 dz32 = Pfz.y + jitter*oz32;\r\n`, functionString += `\r\n`, functionString += `    vec3 dx33 = Pfx + jitter*ox33;\r\n`, functionString += `    vec3 dy33 = Pfy.z + jitter*oy33;\r\n`, functionString += `    vec3 dz33 = Pfz.z + jitter*oz33;\r\n`, functionString += `\r\n`, functionString += `    vec3 d11 = dist(dx11, dy11, dz11, manhattanDistance);\r\n`, functionString += `    vec3 d12 =dist(dx12, dy12, dz12, manhattanDistance);\r\n`, functionString += `    vec3 d13 = dist(dx13, dy13, dz13, manhattanDistance);\r\n`, functionString += `    vec3 d21 = dist(dx21, dy21, dz21, manhattanDistance);\r\n`, functionString += `    vec3 d22 = dist(dx22, dy22, dz22, manhattanDistance);\r\n`, functionString += `    vec3 d23 = dist(dx23, dy23, dz23, manhattanDistance);\r\n`, functionString += `    vec3 d31 = dist(dx31, dy31, dz31, manhattanDistance);\r\n`, functionString += `    vec3 d32 = dist(dx32, dy32, dz32, manhattanDistance);\r\n`, functionString += `    vec3 d33 = dist(dx33, dy33, dz33, manhattanDistance);\r\n`, functionString += `\r\n`, functionString += `    vec3 d1a = min(d11, d12);\r\n`, functionString += `    d12 = max(d11, d12);\r\n`, functionString += `    d11 = min(d1a, d13); // Smallest now not in d12 or d13\r\n`, functionString += `    d13 = max(d1a, d13);\r\n`, functionString += `    d12 = min(d12, d13); // 2nd smallest now not in d13\r\n`, functionString += `    vec3 d2a = min(d21, d22);\r\n`, functionString += `    d22 = max(d21, d22);\r\n`, functionString += `    d21 = min(d2a, d23); // Smallest now not in d22 or d23\r\n`, functionString += `    d23 = max(d2a, d23);\r\n`, functionString += `    d22 = min(d22, d23); // 2nd smallest now not in d23\r\n`, functionString += `    vec3 d3a = min(d31, d32);\r\n`, functionString += `    d32 = max(d31, d32);\r\n`, functionString += `    d31 = min(d3a, d33); // Smallest now not in d32 or d33\r\n`, functionString += `    d33 = max(d3a, d33);\r\n`, functionString += `    d32 = min(d32, d33); // 2nd smallest now not in d33\r\n`, functionString += `    vec3 da = min(d11, d21);\r\n`, functionString += `    d21 = max(d11, d21);\r\n`, functionString += `    d11 = min(da, d31); // Smallest now in d11\r\n`, functionString += `    d31 = max(da, d31); // 2nd smallest now not in d31\r\n`, functionString += `    d11.xy = (d11.x < d11.y) ? d11.xy : d11.yx;\r\n`, functionString += `    d11.xz = (d11.x < d11.z) ? d11.xz : d11.zx; // d11.x now smallest\r\n`, functionString += `    d12 = min(d12, d21); // 2nd smallest now not in d21\r\n`, functionString += `    d12 = min(d12, d22); // nor in d22\r\n`, functionString += `    d12 = min(d12, d31); // nor in d31\r\n`, functionString += `    d12 = min(d12, d32); // nor in d32\r\n`, functionString += `    d11.yz = min(d11.yz,d12.xy); // nor in d12.yz\r\n`, functionString += `    d11.y = min(d11.y,d12.z); // Only two more to go\r\n`, functionString += `    d11.y = min(d11.y,d11.z); // Done! (Phew!)\r\n`, functionString += `    return sqrt(d11.xy); // F1, F2\r\n`, functionString += `}\r\n\r\n`, state._emitFunction("worley3D", functionString, "// Worley3D");const tempVariable = state._getFreeVariableName("worleyTemp");return state.compilationString += `vec2 ${tempVariable} = worley(${this.seed.associatedVariableName}, ${this.jitter.associatedVariableName}, ${this.manhattanDistance});\r\n`, this.output.hasEndpoints && (state.compilationString += this._declareOutput(this.output, state) + ` = ${tempVariable};\r\n`), this.x.hasEndpoints && (state.compilationString += this._declareOutput(this.x, state) + ` = ${tempVariable}.x;\r\n`), this.y.hasEndpoints && (state.compilationString += this._declareOutput(this.y, state) + ` = ${tempVariable}.y;\r\n`), this;}_dumpPropertiesCode() {const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.manhattanDistance = ${this.manhattanDistance};\r\n`;return codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.manhattanDistance = this.manhattanDistance, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.manhattanDistance = serializationObject.manhattanDistance;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Use Manhattan Distance", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !1 } })], WorleyNoise3DBlock.prototype, "manhattanDistance", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.WorleyNoise3DBlock", WorleyNoise3DBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/simplexPerlin3DBlock.js
class SimplexPerlin3DBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.Vector3), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "SimplexPerlin3DBlock";}get seed() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {if (super._buildBlock(state), !this.seed.isConnected) return;if (!this._outputs[0].hasEndpoints) return;let functionString = `const float SKEWFACTOR = 1.0/3.0;\r\n`;return functionString += `const float UNSKEWFACTOR = 1.0/6.0;\r\n`, functionString += `const float SIMPLEX_CORNER_POS = 0.5;\r\n`, functionString += `const float SIMPLEX_TETRAHADRON_HEIGHT = 0.70710678118654752440084436210485;\r\n`, functionString += `float SimplexPerlin3D( vec3 P ){\r\n`, functionString += `    P.x = P == vec3(0., 0., 0.) ? 0.00001 : P.x;\r\n`, functionString += `    P *= SIMPLEX_TETRAHADRON_HEIGHT;\r\n`, functionString += `    vec3 Pi = floor( P + dot( P, vec3( SKEWFACTOR) ) );`, functionString += `    vec3 x0 = P - Pi + dot(Pi, vec3( UNSKEWFACTOR ) );\r\n`, functionString += `    vec3 g = step(x0.yzx, x0.xyz);\r\n`, functionString += `    vec3 l = 1.0 - g;\r\n`, functionString += `    vec3 Pi_1 = min( g.xyz, l.zxy );\r\n`, functionString += `    vec3 Pi_2 = max( g.xyz, l.zxy );\r\n`, functionString += `    vec3 x1 = x0 - Pi_1 + UNSKEWFACTOR;\r\n`, functionString += `    vec3 x2 = x0 - Pi_2 + SKEWFACTOR;\r\n`, functionString += `    vec3 x3 = x0 - SIMPLEX_CORNER_POS;\r\n`, functionString += `    vec4 v1234_x = vec4( x0.x, x1.x, x2.x, x3.x );\r\n`, functionString += `    vec4 v1234_y = vec4( x0.y, x1.y, x2.y, x3.y );\r\n`, functionString += `    vec4 v1234_z = vec4( x0.z, x1.z, x2.z, x3.z );\r\n`, functionString += `    Pi.xyz = Pi.xyz - floor(Pi.xyz * ( 1.0 / 69.0 )) * 69.0;\r\n`, functionString += `    vec3 Pi_inc1 = step( Pi, vec3( 69.0 - 1.5 ) ) * ( Pi + 1.0 );\r\n`, functionString += `    vec4 Pt = vec4( Pi.xy, Pi_inc1.xy ) + vec2( 50.0, 161.0 ).xyxy;\r\n`, functionString += `    Pt *= Pt;\r\n`, functionString += `    vec4 V1xy_V2xy = mix( Pt.xyxy, Pt.zwzw, vec4( Pi_1.xy, Pi_2.xy ) );\r\n`, functionString += `    Pt = vec4( Pt.x, V1xy_V2xy.xz, Pt.z ) * vec4( Pt.y, V1xy_V2xy.yw, Pt.w );\r\n`, functionString += `    const vec3 SOMELARGEFLOATS = vec3( 635.298681, 682.357502, 668.926525 );\r\n`, functionString += `    const vec3 ZINC = vec3( 48.500388, 65.294118, 63.934599 );\r\n`, functionString += `    vec3 lowz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi.zzz * ZINC.xyz ) );\r\n`, functionString += `    vec3 highz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi_inc1.zzz * ZINC.xyz ) );\r\n`, functionString += `    Pi_1 = ( Pi_1.z < 0.5 ) ? lowz_mods : highz_mods;\r\n`, functionString += `    Pi_2 = ( Pi_2.z < 0.5 ) ? lowz_mods : highz_mods;\r\n`, functionString += `    vec4 hash_0 = fract( Pt * vec4( lowz_mods.x, Pi_1.x, Pi_2.x, highz_mods.x ) ) - 0.49999;\r\n`, functionString += `    vec4 hash_1 = fract( Pt * vec4( lowz_mods.y, Pi_1.y, Pi_2.y, highz_mods.y ) ) - 0.49999;\r\n`, functionString += `    vec4 hash_2 = fract( Pt * vec4( lowz_mods.z, Pi_1.z, Pi_2.z, highz_mods.z ) ) - 0.49999;\r\n`, functionString += `    vec4 grad_results = inversesqrt( hash_0 * hash_0 + hash_1 * hash_1 + hash_2 * hash_2 ) * ( hash_0 * v1234_x + hash_1 * v1234_y + hash_2 * v1234_z );\r\n`, functionString += `    const float FINAL_NORMALIZATION = 37.837227241611314102871574478976;\r\n`, functionString += `    vec4 kernel_weights = v1234_x * v1234_x + v1234_y * v1234_y + v1234_z * v1234_z;\r\n`, functionString += `    kernel_weights = max(0.5 - kernel_weights, 0.0);\r\n`, functionString += `    kernel_weights = kernel_weights*kernel_weights*kernel_weights;\r\n`, functionString += `    return dot( kernel_weights, grad_results ) * FINAL_NORMALIZATION;\r\n`, functionString += `}\r\n`, state._emitFunction("SimplexPerlin3D", functionString, "// SimplexPerlin3D"), state.compilationString += this._declareOutput(this._outputs[0], state) + ` = SimplexPerlin3D(${this.seed.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.SimplexPerlin3DBlock", SimplexPerlin3DBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/normalBlendBlock.js
class NormalBlendBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("normalMap0", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("normalMap1", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4), this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "NormalBlendBlock";}get normalMap0() {return this._inputs[0];}get normalMap1() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0],input0 = this._inputs[0],input1 = this._inputs[1],stepR = state._getFreeVariableName("stepR"),stepG = state._getFreeVariableName("stepG");return state.compilationString += `float ${stepR} = step(0.5, ${input0.associatedVariableName}.r);\r\n`, state.compilationString += `float ${stepG} = step(0.5, ${input0.associatedVariableName}.g);\r\n`, state.compilationString += this._declareOutput(output, state) + `;\r\n`, state.compilationString += `${output.associatedVariableName}.r = (1.0 - ${stepR}) * ${input0.associatedVariableName}.r * ${input1.associatedVariableName}.r * 2.0 + ${stepR} * (1.0 - (1.0 - ${input0.associatedVariableName}.r) * (1.0 - ${input1.associatedVariableName}.r) * 2.0);\r\n`, state.compilationString += `${output.associatedVariableName}.g = (1.0 - ${stepG}) * ${input0.associatedVariableName}.g * ${input1.associatedVariableName}.g * 2.0 + ${stepG} * (1.0 - (1.0 - ${input0.associatedVariableName}.g) * (1.0 - ${input1.associatedVariableName}.g) * 2.0);\r\n`, state.compilationString += `${output.associatedVariableName}.b = ${input0.associatedVariableName}.b * ${input1.associatedVariableName}.b;\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.NormalBlendBlock", NormalBlendBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/rotate2dBlock.js
class Rotate2dBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerInput("angle", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2);}getClassName() {return "Rotate2dBlock";}get input() {return this._inputs[0];}get angle() {return this._inputs[1];}get output() {return this._outputs[0];}autoConfigure() {if (!this.angle.isConnected) {const angleInput = new InputBlock("angle");angleInput.value = 0, angleInput.output.connectTo(this.angle);}}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0],angle = this.angle,input = this.input;return state.compilationString += this._declareOutput(output, state) + ` = vec2(cos(${angle.associatedVariableName}) * ${input.associatedVariableName}.x - sin(${angle.associatedVariableName}) * ${input.associatedVariableName}.y, sin(${angle.associatedVariableName}) * ${input.associatedVariableName}.x + cos(${angle.associatedVariableName}) * ${input.associatedVariableName}.y);\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.Rotate2dBlock", Rotate2dBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/reflectBlock.js
class ReflectBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("incident", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4), this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4);}getClassName() {return "ReflectBlock";}get incident() {return this._inputs[0];}get normal() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ReflectBlock", ReflectBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/refractBlock.js
class RefractBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("incident", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("ior", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4), this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4);}getClassName() {return "RefractBlock";}get incident() {return this._inputs[0];}get normal() {return this._inputs[1];}get ior() {return this._inputs[2];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = refract(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz, ${this.ior.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.RefractBlock", RefractBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/desaturateBlock.js
class DesaturateBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color3), this.registerInput("level", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color3);}getClassName() {return "DesaturateBlock";}get color() {return this._inputs[0];}get level() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0],color = this.color,colorName = color.associatedVariableName,tempMin = state._getFreeVariableName("colorMin"),tempMax = state._getFreeVariableName("colorMax"),tempMerge = state._getFreeVariableName("colorMerge");return state.compilationString += `float ${tempMin} = min(min(${colorName}.x, ${colorName}.y), ${colorName}.z);\r\n`, state.compilationString += `float ${tempMax} = max(max(${colorName}.x, ${colorName}.y), ${colorName}.z);\r\n`, state.compilationString += `float ${tempMerge} = 0.5 * (${tempMin} + ${tempMax});\r\n`, state.compilationString += this._declareOutput(output, state) + ` = mix(${colorName}, vec3(${tempMerge}, ${tempMerge}, ${tempMerge}), ${this.level.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.DesaturateBlock", DesaturateBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/sheenBlock.js
class SheenBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.albedoScaling = !1, this.linkSheenWithAlbedo = !1, this._isUnique = !0, this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("roughness", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerOutput("sheen", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("sheen", this, NodeMaterialConnectionPointDirection.Output, SheenBlock, "SheenBlock"));}initialize(state) {state._excludeVariableName("sheenOut"), state._excludeVariableName("sheenMapData"), state._excludeVariableName("vSheenColor"), state._excludeVariableName("vSheenRoughness");}getClassName() {return "SheenBlock";}get intensity() {return this._inputs[0];}get color() {return this._inputs[1];}get roughness() {return this._inputs[2];}get sheen() {return this._outputs[0];}prepareDefines(mesh, nodeMaterial, defines) {super.prepareDefines(mesh, nodeMaterial, defines), defines.setValue("SHEEN", !0), defines.setValue("SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE", !0, !0), defines.setValue("SHEEN_LINKWITHALBEDO", this.linkSheenWithAlbedo, !0), defines.setValue("SHEEN_ROUGHNESS", this.roughness.isConnected, !0), defines.setValue("SHEEN_ALBEDOSCALING", this.albedoScaling, !0);}getCode(reflectionBlock) {let code = "";const color = this.color.isConnected ? this.color.associatedVariableName : "vec3(1.)",intensity = this.intensity.isConnected ? this.intensity.associatedVariableName : "1.",roughness = this.roughness.isConnected ? this.roughness.associatedVariableName : "0.";return code = `#ifdef SHEEN
            sheenOutParams sheenOut;

            vec4 vSheenColor = vec4(${color}, ${intensity});

            sheenBlock(
                vSheenColor,
            #ifdef SHEEN_ROUGHNESS
                ${roughness},
            #endif
                roughness,
            #ifdef SHEEN_TEXTURE
                ${"vec4(0.)"},
                1.0,
            #endif
                reflectance,
            #ifdef SHEEN_LINKWITHALBEDO
                baseColor,
                surfaceAlbedo,
            #endif
            #ifdef ENVIRONMENTBRDF
                NdotV,
                environmentBrdf,
            #endif
            #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
                AARoughnessFactors,
                ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._vReflectionMicrosurfaceInfosName},
                ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._vReflectionInfosName},
                ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock.reflectionColor},
                vLightingIntensity,
                #ifdef ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName}
                    ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._cubeSamplerName},
                #else
                    ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._2DSamplerName},
                #endif
                reflectionOut.reflectionCoords,
                NdotVUnclamped,
                #ifndef LODBASEDMICROSFURACE
                    #ifdef ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName}
                        ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._cubeSamplerName},
                        ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._cubeSamplerName},
                    #else
                        ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._2DSamplerName},
                        ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._2DSamplerName},
                    #endif
                #endif
                #if !defined(${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineSkyboxName}) && defined(RADIANCEOCCLUSION)
                    seo,
                #endif
                #if !defined(${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineSkyboxName}) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName})
                    eho,
                #endif
            #endif
                sheenOut
            );

            #ifdef SHEEN_LINKWITHALBEDO
                surfaceAlbedo = sheenOut.surfaceAlbedo;
            #endif
        #endif\r\n`, code;}_buildBlock(state) {return state.target === NodeMaterialBlockTargets.Fragment && state.sharedData.blocksWithDefines.push(this), this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return codeString += `${this._codeVariableName}.albedoScaling = ${this.albedoScaling};\r\n`, codeString += `${this._codeVariableName}.linkSheenWithAlbedo = ${this.linkSheenWithAlbedo};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.albedoScaling = this.albedoScaling, serializationObject.linkSheenWithAlbedo = this.linkSheenWithAlbedo, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.albedoScaling = serializationObject.albedoScaling, this.linkSheenWithAlbedo = serializationObject.linkSheenWithAlbedo;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Albedo scaling", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !0 } })], SheenBlock.prototype, "albedoScaling", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Link sheen with albedo", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: !0 } })], SheenBlock.prototype, "linkSheenWithAlbedo", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.SheenBlock", SheenBlock);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/brdfTextureTools.js
var brdfTextureTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/brdfTextureTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/anisotropyBlock.js
class AnisotropyBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this._tangentCorrectionFactorName = "", this._isUnique = !0, this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("direction", NodeMaterialBlockConnectionPointTypes.Vector2, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.Vector2, !0), this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.Vector4, !0), this.registerInput("TBN", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("TBN", this, NodeMaterialConnectionPointDirection.Input, TBNBlock, "TBNBlock")), this.registerOutput("anisotropy", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("anisotropy", this, NodeMaterialConnectionPointDirection.Output, AnisotropyBlock, "AnisotropyBlock"));}initialize(state) {state._excludeVariableName("anisotropicOut"), state._excludeVariableName("TBN");}getClassName() {return "AnisotropyBlock";}get intensity() {return this._inputs[0];}get direction() {return this._inputs[1];}get uv() {return this._inputs[2];}get worldTangent() {return this._inputs[3];}get TBN() {return this._inputs[4];}get anisotropy() {return this._outputs[0];}_generateTBNSpace(state) {let code = "";const comments = `//${this.name}`,uv = this.uv,worldPosition = this.worldPositionConnectionPoint,worldNormal = this.worldNormalConnectionPoint,worldTangent = this.worldTangent;uv.isConnected || console.error("You must connect the 'uv' input of the Anisotropy block!"), state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");const tangentReplaceString = { search: /defined\(TANGENT\)/g, replace: worldTangent.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" },TBN = this.TBN;return TBN.isConnected ? state.compilationString += `
            #ifdef TBNBLOCK
            mat3 vTBN = ${TBN.associatedVariableName};
            #endif
            ` : worldTangent.isConnected && (code += `vec3 tbnNormal = normalize(${worldNormal.associatedVariableName}.xyz);\r\n`, code += `vec3 tbnTangent = normalize(${worldTangent.associatedVariableName}.xyz);\r\n`, code += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};\r\n`, code += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n`), code += `
            #if defined(${worldTangent.isConnected ? "TANGENT" : "IGNORE"}) && defined(NORMAL)
                mat3 TBN = vTBN;
            #else
                mat3 TBN = cotangent_frame(${worldNormal.associatedVariableName + ".xyz"}, ${"v_" + worldPosition.associatedVariableName + ".xyz"}, ${uv.isConnected ? uv.associatedVariableName : "vec2(0.)"}, vec2(1., 1.));
            #endif\r\n`, state._emitFunctionFromInclude("bumpFragmentMainFunctions", comments, { replaceStrings: [tangentReplaceString] }), code;}getCode(state, generateTBNSpace = !1) {let code = "";generateTBNSpace && (code += this._generateTBNSpace(state));const intensity = this.intensity.isConnected ? this.intensity.associatedVariableName : "1.0",direction = this.direction.isConnected ? this.direction.associatedVariableName : "vec2(1., 0.)";return code += `anisotropicOutParams anisotropicOut;
            anisotropicBlock(
                vec3(${direction}, ${intensity}),
            #ifdef ANISOTROPIC_TEXTURE
                vec3(0.),
            #endif
                TBN,
                normalW,
                viewDirectionW,
                anisotropicOut
            );\r\n`, code;}prepareDefines(mesh, nodeMaterial, defines) {super.prepareDefines(mesh, nodeMaterial, defines), defines.setValue("ANISOTROPIC", !0), defines.setValue("ANISOTROPIC_TEXTURE", !1, !0);}bind(effect, nodeMaterial, mesh) {super.bind(effect, nodeMaterial, mesh), mesh && effect.setFloat(this._tangentCorrectionFactorName, 0 > mesh.getWorldMatrix().determinant() ? -1 : 1);}_buildBlock(state) {return state.target === NodeMaterialBlockTargets.Fragment && (state.sharedData.blocksWithDefines.push(this), state.sharedData.bindableBlocks.push(this), this._tangentCorrectionFactorName = state._getFreeDefineName("tangentCorrectionFactor"), state._emitUniformFromString(this._tangentCorrectionFactorName, "float")), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.AnisotropyBlock", AnisotropyBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/reflectionBlock.js
class ReflectionBlock extends ReflectionTextureBaseBlock {_onGenerateOnlyFragmentCodeChanged() {return this.position.isConnected ? (this.generateOnlyFragmentCode = !this.generateOnlyFragmentCode, console.error("The position input must not be connected to be able to switch!"), !1) : (this._setTarget(), !0);}_setTarget() {super._setTarget(), this.getInputByName("position").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex, this.generateOnlyFragmentCode && (this.forceIrradianceInFragment = !0);}constructor(name) {super(name), this.useSphericalHarmonics = !0, this.forceIrradianceInFragment = !1, this._isUnique = !0, this.registerInput("position", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1, NodeMaterialBlockTargets.Vertex), this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, !1, NodeMaterialBlockTargets.Vertex), this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerOutput("reflection", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("reflection", this, NodeMaterialConnectionPointDirection.Output, ReflectionBlock, "ReflectionBlock")), this.position.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "ReflectionBlock";}get position() {return this._inputs[0];}get worldPosition() {return this.worldPositionConnectionPoint;}get worldNormal() {return this.worldNormalConnectionPoint;}get world() {return this._inputs[1];}get cameraPosition() {return this.cameraPositionConnectionPoint;}get view() {return this.viewConnectionPoint;}get color() {return this._inputs[2];}get reflection() {return this._outputs[0];}get hasTexture() {return !!this._getTexture();}get reflectionColor() {return this.color.isConnected ? this.color.associatedVariableName : "vec3(1., 1., 1.)";}_getTexture() {return this.texture ? this.texture : this._scene.environmentTexture;}prepareDefines(mesh, nodeMaterial, defines) {super.prepareDefines(mesh, nodeMaterial, defines);const reflectionTexture = this._getTexture(),reflection = reflectionTexture && reflectionTexture.getTextureMatrix;defines.setValue("REFLECTION", reflection, !0);reflection && (defines.setValue(this._defineLODReflectionAlpha, reflectionTexture.lodLevelInAlpha, !0), defines.setValue(this._defineLinearSpecularReflection, reflectionTexture.linearSpecularLOD, !0), defines.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem ? !reflectionTexture.invertZ : reflectionTexture.invertZ, !0), defines.setValue("SPHERICAL_HARMONICS", this.useSphericalHarmonics, !0), defines.setValue("GAMMAREFLECTION", reflectionTexture.gammaSpace, !0), defines.setValue("RGBDREFLECTION", reflectionTexture.isRGBD, !0), reflectionTexture && reflectionTexture.coordinatesMode !== Textures_texture/* Texture.SKYBOX_MODE */.x.SKYBOX_MODE && reflectionTexture.isCube && (defines.setValue("USESPHERICALFROMREFLECTIONMAP", !0), defines.setValue("USEIRRADIANCEMAP", !1), this.forceIrradianceInFragment || 8 >= this._scene.getEngine().getCaps().maxVaryingVectors ? defines.setValue("USESPHERICALINVERTEX", !1) : defines.setValue("USESPHERICALINVERTEX", !0)));}bind(effect, nodeMaterial, mesh, subMesh) {super.bind(effect, nodeMaterial, mesh);const reflectionTexture = this._getTexture();if (!reflectionTexture || !subMesh) return;reflectionTexture.isCube ? effect.setTexture(this._cubeSamplerName, reflectionTexture) : effect.setTexture(this._2DSamplerName, reflectionTexture);const width = reflectionTexture.getSize().width;effect.setFloat3(this._vReflectionMicrosurfaceInfosName, width, reflectionTexture.lodGenerationScale, reflectionTexture.lodGenerationOffset), effect.setFloat2(this._vReflectionFilteringInfoName, width, math_scalar/* Scalar.Log2 */.R.Log2(width));const defines = subMesh.materialDefines,polynomials = reflectionTexture.sphericalPolynomial;if (defines.USESPHERICALFROMREFLECTIONMAP && polynomials) if (defines.SPHERICAL_HARMONICS) {const preScaledHarmonics = polynomials.preScaledHarmonics;effect.setVector3("vSphericalL00", preScaledHarmonics.l00), effect.setVector3("vSphericalL1_1", preScaledHarmonics.l1_1), effect.setVector3("vSphericalL10", preScaledHarmonics.l10), effect.setVector3("vSphericalL11", preScaledHarmonics.l11), effect.setVector3("vSphericalL2_2", preScaledHarmonics.l2_2), effect.setVector3("vSphericalL2_1", preScaledHarmonics.l2_1), effect.setVector3("vSphericalL20", preScaledHarmonics.l20), effect.setVector3("vSphericalL21", preScaledHarmonics.l21), effect.setVector3("vSphericalL22", preScaledHarmonics.l22);} else effect.setFloat3("vSphericalX", polynomials.x.x, polynomials.x.y, polynomials.x.z), effect.setFloat3("vSphericalY", polynomials.y.x, polynomials.y.y, polynomials.y.z), effect.setFloat3("vSphericalZ", polynomials.z.x, polynomials.z.y, polynomials.z.z), effect.setFloat3("vSphericalXX_ZZ", polynomials.xx.x - polynomials.zz.x, polynomials.xx.y - polynomials.zz.y, polynomials.xx.z - polynomials.zz.z), effect.setFloat3("vSphericalYY_ZZ", polynomials.yy.x - polynomials.zz.x, polynomials.yy.y - polynomials.zz.y, polynomials.yy.z - polynomials.zz.z), effect.setFloat3("vSphericalZZ", polynomials.zz.x, polynomials.zz.y, polynomials.zz.z), effect.setFloat3("vSphericalXY", polynomials.xy.x, polynomials.xy.y, polynomials.xy.z), effect.setFloat3("vSphericalYZ", polynomials.yz.x, polynomials.yz.y, polynomials.yz.z), effect.setFloat3("vSphericalZX", polynomials.zx.x, polynomials.zx.y, polynomials.zx.z);}handleVertexSide(state) {let code = super.handleVertexSide(state);state._emitFunctionFromInclude("harmonicsFunctions", `//${this.name}`, { replaceStrings: [{ search: /uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g, replace: "" }, { search: /uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g, replace: "" }] });const reflectionVectorName = state._getFreeVariableName("reflectionVector");return this._vEnvironmentIrradianceName = state._getFreeVariableName("vEnvironmentIrradiance"), state._emitVaryingFromString(this._vEnvironmentIrradianceName, "vec3", "defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)"), state._emitUniformFromString("vSphericalL00", "vec3", "SPHERICAL_HARMONICS"), state._emitUniformFromString("vSphericalL1_1", "vec3", "SPHERICAL_HARMONICS"), state._emitUniformFromString("vSphericalL10", "vec3", "SPHERICAL_HARMONICS"), state._emitUniformFromString("vSphericalL11", "vec3", "SPHERICAL_HARMONICS"), state._emitUniformFromString("vSphericalL2_2", "vec3", "SPHERICAL_HARMONICS"), state._emitUniformFromString("vSphericalL2_1", "vec3", "SPHERICAL_HARMONICS"), state._emitUniformFromString("vSphericalL20", "vec3", "SPHERICAL_HARMONICS"), state._emitUniformFromString("vSphericalL21", "vec3", "SPHERICAL_HARMONICS"), state._emitUniformFromString("vSphericalL22", "vec3", "SPHERICAL_HARMONICS"), state._emitUniformFromString("vSphericalX", "vec3", "SPHERICAL_HARMONICS", !0), state._emitUniformFromString("vSphericalY", "vec3", "SPHERICAL_HARMONICS", !0), state._emitUniformFromString("vSphericalZ", "vec3", "SPHERICAL_HARMONICS", !0), state._emitUniformFromString("vSphericalXX_ZZ", "vec3", "SPHERICAL_HARMONICS", !0), state._emitUniformFromString("vSphericalYY_ZZ", "vec3", "SPHERICAL_HARMONICS", !0), state._emitUniformFromString("vSphericalZZ", "vec3", "SPHERICAL_HARMONICS", !0), state._emitUniformFromString("vSphericalXY", "vec3", "SPHERICAL_HARMONICS", !0), state._emitUniformFromString("vSphericalYZ", "vec3", "SPHERICAL_HARMONICS", !0), state._emitUniformFromString("vSphericalZX", "vec3", "SPHERICAL_HARMONICS", !0), code += `#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
                vec3 ${reflectionVectorName} = vec3(${this._reflectionMatrixName} * vec4(normalize(${this.worldNormal.associatedVariableName}).xyz, 0)).xyz;
                #ifdef ${this._defineOppositeZ}
                    ${reflectionVectorName}.z *= -1.0;
                #endif
                ${this._vEnvironmentIrradianceName} = computeEnvironmentIrradiance(${reflectionVectorName});
            #endif\r\n`, code;}getCode(state, normalVarName) {let code = "";this.handleFragmentSideInits(state), state._emitFunctionFromInclude("harmonicsFunctions", `//${this.name}`, { replaceStrings: [{ search: /uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g, replace: "" }, { search: /uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g, replace: "" }] }), state._emitFunction("sampleReflection", `
            #ifdef ${this._define3DName}
                #define sampleReflection(s, c) textureCube(s, c)
            #else
                #define sampleReflection(s, c) texture2D(s, c)
            #endif\r\n`, `//${this.name}`), state._emitFunction("sampleReflectionLod", `
            #ifdef ${this._define3DName}
                #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)
            #else
                #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)
            #endif\r\n`, `//${this.name}`);const computeReflectionCoordsFunc = `
            vec3 computeReflectionCoordsPBR(vec4 worldPos, vec3 worldNormal) {
                ${this.handleFragmentSideCodeReflectionCoords("worldNormal", "worldPos", !0, !0)}
                return ${this._reflectionVectorName};
            }\r\n`;return state._emitFunction("computeReflectionCoordsPBR", computeReflectionCoordsFunc, `//${this.name}`), this._vReflectionMicrosurfaceInfosName = state._getFreeVariableName("vReflectionMicrosurfaceInfos"), state._emitUniformFromString(this._vReflectionMicrosurfaceInfosName, "vec3"), this._vReflectionInfosName = state._getFreeVariableName("vReflectionInfos"), this._vReflectionFilteringInfoName = state._getFreeVariableName("vReflectionFilteringInfo"), state._emitUniformFromString(this._vReflectionFilteringInfoName, "vec2"), code += `#ifdef REFLECTION
            vec2 ${this._vReflectionInfosName} = vec2(1., 0.);

            reflectionOutParams reflectionOut;

            reflectionBlock(
                ${this.generateOnlyFragmentCode ? this._worldPositionNameInFragmentOnlyMode : "v_" + this.worldPosition.associatedVariableName}.xyz,
                ${normalVarName},
                alphaG,
                ${this._vReflectionMicrosurfaceInfosName},
                ${this._vReflectionInfosName},
                ${this.reflectionColor},
            #ifdef ANISOTROPIC
                anisotropicOut,
            #endif
            #if defined(${this._defineLODReflectionAlpha}) && !defined(${this._defineSkyboxName})
                NdotVUnclamped,
            #endif
            #ifdef ${this._defineLinearSpecularReflection}
                roughness,
            #endif
            #ifdef ${this._define3DName}
                ${this._cubeSamplerName},
            #else
                ${this._2DSamplerName},
            #endif
            #if defined(NORMAL) && defined(USESPHERICALINVERTEX)
                ${this._vEnvironmentIrradianceName},
            #endif
            #ifdef USESPHERICALFROMREFLECTIONMAP
                #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
                    ${this._reflectionMatrixName},
                #endif
            #endif
            #ifdef USEIRRADIANCEMAP
                irradianceSampler, // ** not handled **
            #endif
            #ifndef LODBASEDMICROSFURACE
                #ifdef ${this._define3DName}
                    ${this._cubeSamplerName},
                    ${this._cubeSamplerName},
                #else
                    ${this._2DSamplerName},
                    ${this._2DSamplerName},
                #endif
            #endif
            #ifdef REALTIME_FILTERING
                ${this._vReflectionFilteringInfoName},
            #endif
                reflectionOut
            );
        #endif\r\n`, code;}_buildBlock(state) {return this._scene = state.sharedData.scene, state.target !== NodeMaterialBlockTargets.Fragment && (this._defineLODReflectionAlpha = state._getFreeDefineName("LODINREFLECTIONALPHA"), this._defineLinearSpecularReflection = state._getFreeDefineName("LINEARSPECULARREFLECTION")), this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return this.texture && (codeString += `${this._codeVariableName}.texture.gammaSpace = ${this.texture.gammaSpace};\r\n`), codeString += `${this._codeVariableName}.useSphericalHarmonics = ${this.useSphericalHarmonics};\r\n`, codeString += `${this._codeVariableName}.forceIrradianceInFragment = ${this.forceIrradianceInFragment};\r\n`, codeString;}serialize() {var _a, _b;const serializationObject = super.serialize();return serializationObject.useSphericalHarmonics = this.useSphericalHarmonics, serializationObject.forceIrradianceInFragment = this.forceIrradianceInFragment, serializationObject.gammaSpace = null === (_b = null === (_a = this.texture) || void 0 === _a ? void 0 : _a.gammaSpace) || void 0 === _b || _b, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.useSphericalHarmonics = serializationObject.useSphericalHarmonics, this.forceIrradianceInFragment = serializationObject.forceIrradianceInFragment, this.texture && (this.texture.gammaSpace = serializationObject.gammaSpace);}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Spherical Harmonics", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], ReflectionBlock.prototype, "useSphericalHarmonics", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Force irradiance in fragment", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], ReflectionBlock.prototype, "forceIrradianceInFragment", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ReflectionBlock", ReflectionBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/clearCoatBlock.js
class ClearCoatBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this._tangentCorrectionFactorName = "", this.remapF0OnInterfaceChange = !0, this._isUnique = !0, this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("roughness", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("indexOfRefraction", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("normalMapColor", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.Vector2, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("tintColor", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("tintAtDistance", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("tintThickness", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.Vector4, !0), this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.AutoDetect, !0), this.worldNormal.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Vector3), this.registerInput("TBN", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("TBN", this, NodeMaterialConnectionPointDirection.Input, TBNBlock, "TBNBlock")), this.registerOutput("clearcoat", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("clearcoat", this, NodeMaterialConnectionPointDirection.Output, ClearCoatBlock, "ClearCoatBlock"));}initialize(state) {state._excludeVariableName("clearcoatOut"), state._excludeVariableName("vClearCoatParams"), state._excludeVariableName("vClearCoatTintParams"), state._excludeVariableName("vClearCoatRefractionParams"), state._excludeVariableName("vClearCoatTangentSpaceParams"), state._excludeVariableName("vGeometricNormaClearCoatW");}getClassName() {return "ClearCoatBlock";}get intensity() {return this._inputs[0];}get roughness() {return this._inputs[1];}get indexOfRefraction() {return this._inputs[2];}get normalMapColor() {return this._inputs[3];}get uv() {return this._inputs[4];}get tintColor() {return this._inputs[5];}get tintAtDistance() {return this._inputs[6];}get tintThickness() {return this._inputs[7];}get worldTangent() {return this._inputs[8];}get worldNormal() {return this._inputs[9];}get TBN() {return this._inputs[10];}get clearcoat() {return this._outputs[0];}autoConfigure() {if (!this.intensity.isConnected) {const intensityInput = new InputBlock("ClearCoat intensity", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);intensityInput.value = 1, intensityInput.output.connectTo(this.intensity);}}prepareDefines(mesh, nodeMaterial, defines) {super.prepareDefines(mesh, nodeMaterial, defines), defines.setValue("CLEARCOAT", !0), defines.setValue("CLEARCOAT_TEXTURE", !1, !0), defines.setValue("CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE", !0, !0), defines.setValue("CLEARCOAT_TINT", this.tintColor.isConnected || this.tintThickness.isConnected || this.tintAtDistance.isConnected, !0), defines.setValue("CLEARCOAT_BUMP", this.normalMapColor.isConnected, !0), defines.setValue("CLEARCOAT_DEFAULTIOR", !this.indexOfRefraction.isConnected || this.indexOfRefraction.connectInputBlock.value === pbrClearCoatConfiguration/* PBRClearCoatConfiguration._DefaultIndexOfRefraction */.Y._DefaultIndexOfRefraction, !0), defines.setValue("CLEARCOAT_REMAP_F0", this.remapF0OnInterfaceChange, !0);}bind(effect, nodeMaterial, mesh) {var _a, _b;super.bind(effect, nodeMaterial, mesh);const indexOfRefraction = null !== (_b = null === (_a = this.indexOfRefraction.connectInputBlock) || void 0 === _a ? void 0 : _a.value) && void 0 !== _b ? _b : pbrClearCoatConfiguration/* PBRClearCoatConfiguration._DefaultIndexOfRefraction */.Y._DefaultIndexOfRefraction,a = 1 - indexOfRefraction,b = 1 + indexOfRefraction,f0 = Math.pow(-a / b, 2);effect.setFloat4("vClearCoatRefractionParams", f0, 1 / indexOfRefraction, a, b);const mainPBRBlock = this.clearcoat.hasEndpoints ? this.clearcoat.endpoints[0].ownerBlock : null,perturbedNormalBlock = (null === mainPBRBlock || void 0 === mainPBRBlock ? void 0 : mainPBRBlock.perturbedNormal.isConnected) ? mainPBRBlock.perturbedNormal.connectedPoint.ownerBlock : null;this._scene._mirroredCameraPosition ? effect.setFloat2("vClearCoatTangentSpaceParams", (null === perturbedNormalBlock || void 0 === perturbedNormalBlock ? void 0 : perturbedNormalBlock.invertX) ? 1 : -1, (null === perturbedNormalBlock || void 0 === perturbedNormalBlock ? void 0 : perturbedNormalBlock.invertY) ? 1 : -1) : effect.setFloat2("vClearCoatTangentSpaceParams", (null === perturbedNormalBlock || void 0 === perturbedNormalBlock ? void 0 : perturbedNormalBlock.invertX) ? -1 : 1, (null === perturbedNormalBlock || void 0 === perturbedNormalBlock ? void 0 : perturbedNormalBlock.invertY) ? -1 : 1), mesh && effect.setFloat(this._tangentCorrectionFactorName, 0 > mesh.getWorldMatrix().determinant() ? -1 : 1);}_generateTBNSpace(state, worldPositionVarName, worldNormalVarName) {let code = "";const comments = `//${this.name}`,worldTangent = this.worldTangent;state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");const tangentReplaceString = { search: /defined\(TANGENT\)/g, replace: worldTangent.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" },TBN = this.TBN;return TBN.isConnected ? state.compilationString += `
            #ifdef TBNBLOCK
            mat3 vTBN = ${TBN.associatedVariableName};
            #endif
            ` : worldTangent.isConnected && (code += `vec3 tbnNormal = normalize(${worldNormalVarName}.xyz);\r\n`, code += `vec3 tbnTangent = normalize(${worldTangent.associatedVariableName}.xyz);\r\n`, code += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};\r\n`, code += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n`), state._emitFunctionFromInclude("bumpFragmentMainFunctions", comments, { replaceStrings: [tangentReplaceString] }), code;}static GetCode(state, ccBlock, reflectionBlock, worldPosVarName, generateTBNSpace, vTBNAvailable, worldNormalVarName) {let code = "";const intensity = (null === ccBlock || void 0 === ccBlock ? void 0 : ccBlock.intensity.isConnected) ? ccBlock.intensity.associatedVariableName : "1.",roughness = (null === ccBlock || void 0 === ccBlock ? void 0 : ccBlock.roughness.isConnected) ? ccBlock.roughness.associatedVariableName : "0.",normalMapColor = (null === ccBlock || void 0 === ccBlock ? void 0 : ccBlock.normalMapColor.isConnected) ? ccBlock.normalMapColor.associatedVariableName : "vec3(0.)",uv = (null === ccBlock || void 0 === ccBlock ? void 0 : ccBlock.uv.isConnected) ? ccBlock.uv.associatedVariableName : "vec2(0.)",tintColor = (null === ccBlock || void 0 === ccBlock ? void 0 : ccBlock.tintColor.isConnected) ? ccBlock.tintColor.associatedVariableName : "vec3(1.)",tintThickness = (null === ccBlock || void 0 === ccBlock ? void 0 : ccBlock.tintThickness.isConnected) ? ccBlock.tintThickness.associatedVariableName : "1.",tintAtDistance = (null === ccBlock || void 0 === ccBlock ? void 0 : ccBlock.tintAtDistance.isConnected) ? ccBlock.tintAtDistance.associatedVariableName : "1.";if (ccBlock) {state._emitUniformFromString("vClearCoatRefractionParams", "vec4"), state._emitUniformFromString("vClearCoatTangentSpaceParams", "vec2");const normalShading = ccBlock.worldNormal;code += `vec3 vGeometricNormaClearCoatW = ${normalShading.isConnected ? "normalize(" + normalShading.associatedVariableName + ".xyz)" : "geometricNormalW"};\r\n`;} else code += `vec3 vGeometricNormaClearCoatW = geometricNormalW;\r\n`;return generateTBNSpace && ccBlock && (code += ccBlock._generateTBNSpace(state, worldPosVarName, worldNormalVarName), vTBNAvailable = ccBlock.worldTangent.isConnected), code += `clearcoatOutParams clearcoatOut;

        #ifdef CLEARCOAT
            vec2 vClearCoatParams = vec2(${intensity}, ${roughness});
            vec4 vClearCoatTintParams = vec4(${tintColor}, ${tintThickness});

            clearcoatBlock(
                ${worldPosVarName}.xyz,
                vGeometricNormaClearCoatW,
                viewDirectionW,
                vClearCoatParams,
                specularEnvironmentR0,
            #ifdef CLEARCOAT_TEXTURE
                vec2(0.),
            #endif
            #ifdef CLEARCOAT_TINT
                vClearCoatTintParams,
                ${tintAtDistance},
                vClearCoatRefractionParams,
                #ifdef CLEARCOAT_TINT_TEXTURE
                    ${"vec4(0.)"},
                #endif
            #endif
            #ifdef CLEARCOAT_BUMP
                vec2(0., 1.),
                vec4(${normalMapColor}, 0.),
                ${uv},
                #if defined(${vTBNAvailable ? "TANGENT" : "IGNORE"}) && defined(NORMAL)
                    vTBN,
                #else
                    vClearCoatTangentSpaceParams,
                #endif
                #ifdef OBJECTSPACE_NORMALMAP
                    normalMatrix,
                #endif
            #endif
            #if defined(FORCENORMALFORWARD) && defined(NORMAL)
                faceNormal,
            #endif
            #ifdef REFLECTION
                ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._vReflectionMicrosurfaceInfosName},
                ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._vReflectionInfosName},
                ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock.reflectionColor},
                vLightingIntensity,
                #ifdef ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName}
                    ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._cubeSamplerName},
                #else
                    ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._2DSamplerName},
                #endif
                #ifndef LODBASEDMICROSFURACE
                    #ifdef ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName}
                        ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._cubeSamplerName},
                        ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._cubeSamplerName},
                    #else
                        ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._2DSamplerName},
                        ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._2DSamplerName},
                    #endif
                #endif
            #endif
            #if defined(ENVIRONMENTBRDF) && !defined(${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineSkyboxName})
                #ifdef RADIANCEOCCLUSION
                    ambientMonochrome,
                #endif
            #endif
            #if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
                (gl_FrontFacing ? 1. : -1.),
            #endif
                clearcoatOut
            );
        #else
            clearcoatOut.specularEnvironmentR0 = specularEnvironmentR0;
        #endif\r\n`, code;}_buildBlock(state) {return this._scene = state.sharedData.scene, state.target === NodeMaterialBlockTargets.Fragment && (state.sharedData.bindableBlocks.push(this), state.sharedData.blocksWithDefines.push(this), this._tangentCorrectionFactorName = state._getFreeDefineName("tangentCorrectionFactor"), state._emitUniformFromString(this._tangentCorrectionFactorName, "float")), this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return codeString += `${this._codeVariableName}.remapF0OnInterfaceChange = ${this.remapF0OnInterfaceChange};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.remapF0OnInterfaceChange = this.remapF0OnInterfaceChange, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {var _a;super._deserialize(serializationObject, scene, rootUrl), this.remapF0OnInterfaceChange = null === (_a = serializationObject.remapF0OnInterfaceChange) || void 0 === _a || _a;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Remap F0 on interface change", PropertyTypeForEdition.Boolean, "ADVANCED")], ClearCoatBlock.prototype, "remapF0OnInterfaceChange", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ClearCoatBlock", ClearCoatBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/iridescenceBlock.js
class IridescenceBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this._isUnique = !0, this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("indexOfRefraction", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("thickness", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerOutput("iridescence", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("iridescence", this, NodeMaterialConnectionPointDirection.Output, IridescenceBlock, "IridescenceBlock"));}initialize(state) {state._excludeVariableName("iridescenceOut"), state._excludeVariableName("vIridescenceParams");}getClassName() {return "IridescenceBlock";}get intensity() {return this._inputs[0];}get indexOfRefraction() {return this._inputs[1];}get thickness() {return this._inputs[2];}get iridescence() {return this._outputs[0];}autoConfigure() {if (!this.intensity.isConnected) {const intensityInput = new InputBlock("Iridescence intensity", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);intensityInput.value = 1, intensityInput.output.connectTo(this.intensity);const indexOfRefractionInput = new InputBlock("Iridescence ior", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);indexOfRefractionInput.value = 1.3, indexOfRefractionInput.output.connectTo(this.indexOfRefraction);const thicknessInput = new InputBlock("Iridescence thickness", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);thicknessInput.value = 400, thicknessInput.output.connectTo(this.thickness);}}prepareDefines(mesh, nodeMaterial, defines) {super.prepareDefines(mesh, nodeMaterial, defines), defines.setValue("IRIDESCENCE", !0, !0), defines.setValue("IRIDESCENCE_TEXTURE", !1, !0), defines.setValue("IRIDESCENCE_THICKNESS_TEXTURE", !1, !0);}static GetCode(iridescenceBlock) {let code = "";const intensityName = (null === iridescenceBlock || void 0 === iridescenceBlock ? void 0 : iridescenceBlock.intensity.isConnected) ? iridescenceBlock.intensity.associatedVariableName : "1.",indexOfRefraction = (null === iridescenceBlock || void 0 === iridescenceBlock ? void 0 : iridescenceBlock.indexOfRefraction.isConnected) ? iridescenceBlock.indexOfRefraction.associatedVariableName : pbrIridescenceConfiguration/* PBRIridescenceConfiguration._DefaultIndexOfRefraction */.B._DefaultIndexOfRefraction,thickness = (null === iridescenceBlock || void 0 === iridescenceBlock ? void 0 : iridescenceBlock.thickness.isConnected) ? iridescenceBlock.thickness.associatedVariableName : pbrIridescenceConfiguration/* PBRIridescenceConfiguration._DefaultMaximumThickness */.B._DefaultMaximumThickness;return code += `iridescenceOutParams iridescenceOut;

        #ifdef IRIDESCENCE
            iridescenceBlock(
                vec4(${intensityName}, ${indexOfRefraction}, 1., ${thickness}),
                NdotV,
                specularEnvironmentR0,
                #ifdef CLEARCOAT
                    NdotVUnclamped,
                #endif
                iridescenceOut
            );

            float iridescenceIntensity = iridescenceOut.iridescenceIntensity;
            specularEnvironmentR0 = iridescenceOut.specularEnvironmentR0;
        #endif\r\n`, code;}_buildBlock(state) {return state.target === NodeMaterialBlockTargets.Fragment && (state.sharedData.bindableBlocks.push(this), state.sharedData.blocksWithDefines.push(this)), this;}serialize() {const serializationObject = super.serialize();return serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl);}}(0,typeStore/* RegisterClass */.H)("BABYLON.IridescenceBlock", IridescenceBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/refractionBlock.js
class RefractionBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this.linkRefractionWithTransparency = !1, this.invertRefractionY = !1, this.useThicknessAsDepth = !1, this._isUnique = !0, this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("tintAtDistance", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("volumeIndexOfRefraction", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerOutput("refraction", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("refraction", this, NodeMaterialConnectionPointDirection.Output, RefractionBlock, "RefractionBlock"));}initialize(state) {state._excludeVariableName("vRefractionPosition"), state._excludeVariableName("vRefractionSize");}getClassName() {return "RefractionBlock";}get intensity() {return this._inputs[0];}get tintAtDistance() {return this._inputs[1];}get volumeIndexOfRefraction() {return this._inputs[2];}get view() {return this.viewConnectionPoint;}get refraction() {return this._outputs[0];}get hasTexture() {return !!this._getTexture();}_getTexture() {return this.texture ? this.texture : this._scene.environmentTexture;}autoConfigure(material) {if (!this.intensity.isConnected) {const intensityInput = new InputBlock("Refraction intensity", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);intensityInput.value = 1, intensityInput.output.connectTo(this.intensity);}if (this.view && !this.view.isConnected) {let viewInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.View);viewInput || (viewInput = new InputBlock("view"), viewInput.setAsSystemValue(NodeMaterialSystemValues.View)), viewInput.output.connectTo(this.view);}}prepareDefines(mesh, nodeMaterial, defines) {super.prepareDefines(mesh, nodeMaterial, defines);const refractionTexture = this._getTexture(),refraction = refractionTexture && refractionTexture.getTextureMatrix;defines.setValue("SS_REFRACTION", refraction, !0);refraction && (defines.setValue(this._define3DName, refractionTexture.isCube, !0), defines.setValue(this._defineLODRefractionAlpha, refractionTexture.lodLevelInAlpha, !0), defines.setValue(this._defineLinearSpecularRefraction, refractionTexture.linearSpecularLOD, !0), defines.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem ? !refractionTexture.invertZ : refractionTexture.invertZ, !0), defines.setValue("SS_LINKREFRACTIONTOTRANSPARENCY", this.linkRefractionWithTransparency, !0), defines.setValue("SS_GAMMAREFRACTION", refractionTexture.gammaSpace, !0), defines.setValue("SS_RGBDREFRACTION", refractionTexture.isRGBD, !0), defines.setValue("SS_USE_LOCAL_REFRACTIONMAP_CUBIC", !!refractionTexture.boundingBoxSize, !0), defines.setValue("SS_USE_THICKNESS_AS_DEPTH", this.useThicknessAsDepth, !0));}isReady() {const texture = this._getTexture();return !texture || texture.isReadyOrNotBlocking();}bind(effect, nodeMaterial, mesh) {var _a, _b, _c, _d;super.bind(effect, nodeMaterial, mesh);const refractionTexture = this._getTexture();if (!refractionTexture) return;refractionTexture.isCube ? effect.setTexture(this._cubeSamplerName, refractionTexture) : effect.setTexture(this._2DSamplerName, refractionTexture), effect.setMatrix(this._refractionMatrixName, refractionTexture.getReflectionTextureMatrix());let depth = 1;!refractionTexture.isCube && refractionTexture.depth && (depth = refractionTexture.depth);const indexOfRefraction = null !== (_d = null !== (_b = null === (_a = this.volumeIndexOfRefraction.connectInputBlock) || void 0 === _a ? void 0 : _a.value) && void 0 !== _b ? _b : null === (_c = this.indexOfRefractionConnectionPoint.connectInputBlock) || void 0 === _c ? void 0 : _c.value) && void 0 !== _d ? _d : 1.5;effect.setFloat4(this._vRefractionInfosName, refractionTexture.level, 1 / indexOfRefraction, depth, this.invertRefractionY ? -1 : 1), effect.setFloat4(this._vRefractionMicrosurfaceInfosName, refractionTexture.getSize().width, refractionTexture.lodGenerationScale, refractionTexture.lodGenerationOffset, 1 / indexOfRefraction);const width = refractionTexture.getSize().width;if (effect.setFloat2(this._vRefractionFilteringInfoName, width, math_scalar/* Scalar.Log2 */.R.Log2(width)), refractionTexture.boundingBoxSize) {const cubeTexture = refractionTexture;effect.setVector3("vRefractionPosition", cubeTexture.boundingBoxPosition), effect.setVector3("vRefractionSize", cubeTexture.boundingBoxSize);}}getCode(state) {return state.sharedData.blockingBlocks.push(this), state.sharedData.textureBlocks.push(this), this._cubeSamplerName = state._getFreeVariableName(this.name + "CubeSampler"), state.samplers.push(this._cubeSamplerName), this._2DSamplerName = state._getFreeVariableName(this.name + "2DSampler"), state.samplers.push(this._2DSamplerName), this._define3DName = state._getFreeDefineName("SS_REFRACTIONMAP_3D"), state._samplerDeclaration += `#ifdef ${this._define3DName}\r\n`, state._samplerDeclaration += `uniform samplerCube ${this._cubeSamplerName};\r\n`, state._samplerDeclaration += `#else\r\n`, state._samplerDeclaration += `uniform sampler2D ${this._2DSamplerName};\r\n`, state._samplerDeclaration += `#endif\r\n`, state.sharedData.blocksWithDefines.push(this), state.sharedData.bindableBlocks.push(this), this._defineLODRefractionAlpha = state._getFreeDefineName("SS_LODINREFRACTIONALPHA"), this._defineLinearSpecularRefraction = state._getFreeDefineName("SS_LINEARSPECULARREFRACTION"), this._defineOppositeZ = state._getFreeDefineName("SS_REFRACTIONMAP_OPPOSITEZ"), this._refractionMatrixName = state._getFreeVariableName("refractionMatrix"), state._emitUniformFromString(this._refractionMatrixName, "mat4"), state._emitFunction("sampleRefraction", `
            #ifdef ${this._define3DName}
                #define sampleRefraction(s, c) textureCube(s, c)
            #else
                #define sampleRefraction(s, c) texture2D(s, c)
            #endif\r\n`, `//${this.name}`), state._emitFunction("sampleRefractionLod", `
            #ifdef ${this._define3DName}
                #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)
            #else
                #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)
            #endif\r\n`, `//${this.name}`), this._vRefractionMicrosurfaceInfosName = state._getFreeVariableName("vRefractionMicrosurfaceInfos"), state._emitUniformFromString(this._vRefractionMicrosurfaceInfosName, "vec4"), this._vRefractionInfosName = state._getFreeVariableName("vRefractionInfos"), state._emitUniformFromString(this._vRefractionInfosName, "vec4"), this._vRefractionFilteringInfoName = state._getFreeVariableName("vRefractionFilteringInfo"), state._emitUniformFromString(this._vRefractionFilteringInfoName, "vec2"), state._emitUniformFromString("vRefractionPosition", "vec3"), state._emitUniformFromString("vRefractionSize", "vec3"), "";}_buildBlock(state) {return this._scene = state.sharedData.scene, this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return this.texture && (codeString = this.texture.isCube ? `${this._codeVariableName}.texture = new BABYLON.CubeTexture("${this.texture.name}");\r\n` : `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}");\r\n`, codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\r\n`), codeString += `${this._codeVariableName}.linkRefractionWithTransparency = ${this.linkRefractionWithTransparency};\r\n`, codeString += `${this._codeVariableName}.invertRefractionY = ${this.invertRefractionY};\r\n`, codeString += `${this._codeVariableName}.useThicknessAsDepth = ${this.useThicknessAsDepth};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return this.texture && !this.texture.isRenderTarget && (serializationObject.texture = this.texture.serialize()), serializationObject.linkRefractionWithTransparency = this.linkRefractionWithTransparency, serializationObject.invertRefractionY = this.invertRefractionY, serializationObject.useThicknessAsDepth = this.useThicknessAsDepth, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), serializationObject.texture && (rootUrl = 0 === serializationObject.texture.url.indexOf("data:") ? "" : rootUrl, this.texture = serializationObject.texture.isCube ? Textures_cubeTexture/* CubeTexture.Parse */.B.Parse(serializationObject.texture, scene, rootUrl) : Textures_texture/* Texture.Parse */.x.Parse(serializationObject.texture, scene, rootUrl)), this.linkRefractionWithTransparency = serializationObject.linkRefractionWithTransparency, this.invertRefractionY = serializationObject.invertRefractionY, this.useThicknessAsDepth = !!serializationObject.useThicknessAsDepth;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Link refraction to transparency", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], RefractionBlock.prototype, "linkRefractionWithTransparency", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Invert refraction Y", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], RefractionBlock.prototype, "invertRefractionY", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Use thickness as depth", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], RefractionBlock.prototype, "useThicknessAsDepth", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.RefractionBlock", RefractionBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/subSurfaceBlock.js
class SubSurfaceBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Fragment), this._isUnique = !0, this.registerInput("thickness", NodeMaterialBlockConnectionPointTypes.Float, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("tintColor", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("translucencyIntensity", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("translucencyDiffusionDist", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("refraction", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("refraction", this, NodeMaterialConnectionPointDirection.Input, RefractionBlock, "RefractionBlock")), this.registerOutput("subsurface", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("subsurface", this, NodeMaterialConnectionPointDirection.Output, SubSurfaceBlock, "SubSurfaceBlock"));}initialize(state) {state._excludeVariableName("subSurfaceOut"), state._excludeVariableName("vThicknessParam"), state._excludeVariableName("vTintColor"), state._excludeVariableName("vSubSurfaceIntensity");}getClassName() {return "SubSurfaceBlock";}get thickness() {return this._inputs[0];}get tintColor() {return this._inputs[1];}get translucencyIntensity() {return this._inputs[2];}get translucencyDiffusionDist() {return this._inputs[3];}get refraction() {return this._inputs[4];}get subsurface() {return this._outputs[0];}autoConfigure() {if (!this.thickness.isConnected) {const thicknessInput = new InputBlock("SubSurface thickness", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);thicknessInput.value = 0, thicknessInput.output.connectTo(this.thickness);}}prepareDefines(mesh, nodeMaterial, defines) {super.prepareDefines(mesh, nodeMaterial, defines);const translucencyEnabled = this.translucencyDiffusionDist.isConnected || this.translucencyIntensity.isConnected;defines.setValue("SUBSURFACE", translucencyEnabled || this.refraction.isConnected, !0), defines.setValue("SS_TRANSLUCENCY", translucencyEnabled, !0), defines.setValue("SS_THICKNESSANDMASK_TEXTURE", !1, !0), defines.setValue("SS_REFRACTIONINTENSITY_TEXTURE", !1, !0), defines.setValue("SS_TRANSLUCENCYINTENSITY_TEXTURE", !1, !0), defines.setValue("SS_MASK_FROM_THICKNESS_TEXTURE", !1, !0), defines.setValue("SS_USE_GLTF_TEXTURES", !1, !0);}static GetCode(state, ssBlock, reflectionBlock, worldPosVarName) {var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;let code = "";const thickness = (null === ssBlock || void 0 === ssBlock ? void 0 : ssBlock.thickness.isConnected) ? ssBlock.thickness.associatedVariableName : "0.",tintColor = (null === ssBlock || void 0 === ssBlock ? void 0 : ssBlock.tintColor.isConnected) ? ssBlock.tintColor.associatedVariableName : "vec3(1.)",translucencyIntensity = (null === ssBlock || void 0 === ssBlock ? void 0 : ssBlock.translucencyIntensity.isConnected) ? null === ssBlock || void 0 === ssBlock ? void 0 : ssBlock.translucencyIntensity.associatedVariableName : "1.",translucencyDiffusionDistance = (null === ssBlock || void 0 === ssBlock ? void 0 : ssBlock.translucencyDiffusionDist.isConnected) ? null === ssBlock || void 0 === ssBlock ? void 0 : ssBlock.translucencyDiffusionDist.associatedVariableName : "vec3(1.)",refractionBlock = (null === ssBlock || void 0 === ssBlock ? void 0 : ssBlock.refraction.isConnected) ? null === (_a = null === ssBlock || void 0 === ssBlock ? void 0 : ssBlock.refraction.connectedPoint) || void 0 === _a ? void 0 : _a.ownerBlock : null,refractionTintAtDistance = (null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock.tintAtDistance.isConnected) ? refractionBlock.tintAtDistance.associatedVariableName : "1.",refractionIntensity = (null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock.intensity.isConnected) ? refractionBlock.intensity.associatedVariableName : "1.",refractionView = (null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock.view.isConnected) ? refractionBlock.view.associatedVariableName : "";return code += null !== (_b = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock.getCode(state)) && void 0 !== _b ? _b : "", code += `subSurfaceOutParams subSurfaceOut;

        #ifdef SUBSURFACE
            vec2 vThicknessParam = vec2(0., ${thickness});
            vec4 vTintColor = vec4(${tintColor}, ${refractionTintAtDistance});
            vec3 vSubSurfaceIntensity = vec3(${refractionIntensity}, ${translucencyIntensity}, 0.);

            subSurfaceBlock(
                vSubSurfaceIntensity,
                vThicknessParam,
                vTintColor,
                normalW,
                specularEnvironmentReflectance,
            #ifdef SS_THICKNESSANDMASK_TEXTURE
                vec4(0.),
            #endif
            #ifdef REFLECTION
                #ifdef SS_TRANSLUCENCY
                    ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._reflectionMatrixName},
                    #ifdef USESPHERICALFROMREFLECTIONMAP
                        #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
                            reflectionOut.irradianceVector,
                        #endif
                        #if defined(REALTIME_FILTERING)
                            ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._cubeSamplerName},
                            ${null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._vReflectionFilteringInfoName},
                        #endif
                        #endif
                    #ifdef USEIRRADIANCEMAP
                        irradianceSampler,
                    #endif
                #endif
            #endif
            #if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
                surfaceAlbedo,
            #endif
            #ifdef SS_REFRACTION
                ${worldPosVarName}.xyz,
                viewDirectionW,
                ${refractionView},
                ${null !== (_c = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._vRefractionInfosName) && void 0 !== _c ? _c : ""},
                ${null !== (_d = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._refractionMatrixName) && void 0 !== _d ? _d : ""},
                ${null !== (_e = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._vRefractionMicrosurfaceInfosName) && void 0 !== _e ? _e : ""},
                vLightingIntensity,
                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY
                    alpha,
                #endif
                #ifdef ${null !== (_f = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._defineLODRefractionAlpha) && void 0 !== _f ? _f : "IGNORE"}
                    NdotVUnclamped,
                #endif
                #ifdef ${null !== (_g = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._defineLinearSpecularRefraction) && void 0 !== _g ? _g : "IGNORE"}
                    roughness,
                #endif
                alphaG,
                #ifdef ${null !== (_h = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._define3DName) && void 0 !== _h ? _h : "IGNORE"}
                    ${null !== (_j = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._cubeSamplerName) && void 0 !== _j ? _j : ""},
                #else
                    ${null !== (_k = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._2DSamplerName) && void 0 !== _k ? _k : ""},
                #endif
                #ifndef LODBASEDMICROSFURACE
                    #ifdef ${null !== (_l = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._define3DName) && void 0 !== _l ? _l : "IGNORE"}
                        ${null !== (_m = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._cubeSamplerName) && void 0 !== _m ? _m : ""},
                        ${null !== (_o = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._cubeSamplerName) && void 0 !== _o ? _o : ""},
                    #else
                        ${null !== (_p = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._2DSamplerName) && void 0 !== _p ? _p : ""},
                        ${null !== (_q = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._2DSamplerName) && void 0 !== _q ? _q : ""},
                    #endif
                #endif
                #ifdef ANISOTROPIC
                    anisotropicOut,
                #endif
                #ifdef REALTIME_FILTERING
                    ${null !== (_r = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._vRefractionFilteringInfoName) && void 0 !== _r ? _r : ""},
                #endif
                #ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
                    vRefractionPosition,
                    vRefractionSize,
                #endif
            #endif
            #ifdef SS_TRANSLUCENCY
                ${translucencyDiffusionDistance},
            #endif
                subSurfaceOut
            );

            #ifdef SS_REFRACTION
                surfaceAlbedo = subSurfaceOut.surfaceAlbedo;
                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY
                    alpha = subSurfaceOut.alpha;
                #endif
            #endif
        #else
            subSurfaceOut.specularEnvironmentReflectance = specularEnvironmentReflectance;
        #endif\r\n`, code;}_buildBlock(state) {return state.target === NodeMaterialBlockTargets.Fragment && state.sharedData.blocksWithDefines.push(this), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.SubSurfaceBlock", SubSurfaceBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js
const mapOutputToVariable = { ambientClr: ["finalAmbient", ""], diffuseDir: ["finalDiffuse", ""], specularDir: ["finalSpecularScaled", "!defined(UNLIT) && defined(SPECULARTERM)"], clearcoatDir: ["finalClearCoatScaled", "!defined(UNLIT) && defined(CLEARCOAT)"], sheenDir: ["finalSheenScaled", "!defined(UNLIT) && defined(SHEEN)"], diffuseInd: ["finalIrradiance", "!defined(UNLIT) && defined(REFLECTION)"], specularInd: ["finalRadianceScaled", "!defined(UNLIT) && defined(REFLECTION)"], clearcoatInd: ["clearcoatOut.finalClearCoatRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)"], sheenInd: ["sheenOut.finalSheenRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)"], refraction: ["subSurfaceOut.finalRefraction", "!defined(UNLIT) && defined(SS_REFRACTION)"], lighting: ["finalColor.rgb", ""], shadow: ["shadow", ""], alpha: ["alpha", ""] };class PBRMetallicRoughnessBlock extends NodeMaterialBlock {static _OnGenerateOnlyFragmentCodeChanged(block) {const that = block;return that.worldPosition.isConnected ? (that.generateOnlyFragmentCode = !that.generateOnlyFragmentCode, console.error("The worldPosition input must not be connected to be able to switch!"), !1) : (that._setTarget(), !0);}_setTarget() {this._setInitialTarget(this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment), this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex;}constructor(name) {super(name, NodeMaterialBlockTargets.VertexAndFragment), this._environmentBRDFTexture = null, this._metallicReflectanceColor = math_color/* Color3.White */.Wo.White(), this._metallicF0Factor = 1, this.directIntensity = 1, this.environmentIntensity = 1, this.specularIntensity = 1, this.lightFalloff = 0, this.useAlphaTest = !1, this.alphaTestCutoff = .5, this.useAlphaBlending = !1, this.useRadianceOverAlpha = !0, this.useSpecularOverAlpha = !0, this.enableSpecularAntiAliasing = !1, this.realTimeFiltering = !1, this.realTimeFilteringQuality = 8, this.useEnergyConservation = !0, this.useRadianceOcclusion = !0, this.useHorizonOcclusion = !0, this.unlit = !1, this.forceNormalForward = !1, this.generateOnlyFragmentCode = !1, this.debugMode = 0, this.debugLimit = 0, this.debugFactor = 1, this._isUnique = !0, this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, !1, NodeMaterialBlockTargets.Vertex), this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, !1), this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("perturbedNormal", NodeMaterialBlockConnectionPointTypes.Vector4, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("baseColor", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("metallic", NodeMaterialBlockConnectionPointTypes.Float, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("roughness", NodeMaterialBlockConnectionPointTypes.Float, !1, NodeMaterialBlockTargets.Fragment), this.registerInput("ambientOcc", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("opacity", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("indexOfRefraction", NodeMaterialBlockConnectionPointTypes.Float, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("ambientColor", NodeMaterialBlockConnectionPointTypes.Color3, !0, NodeMaterialBlockTargets.Fragment), this.registerInput("reflection", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("reflection", this, NodeMaterialConnectionPointDirection.Input, ReflectionBlock, "ReflectionBlock")), this.registerInput("clearcoat", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("clearcoat", this, NodeMaterialConnectionPointDirection.Input, ClearCoatBlock, "ClearCoatBlock")), this.registerInput("sheen", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("sheen", this, NodeMaterialConnectionPointDirection.Input, SheenBlock, "SheenBlock")), this.registerInput("subsurface", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("subsurface", this, NodeMaterialConnectionPointDirection.Input, SubSurfaceBlock, "SubSurfaceBlock")), this.registerInput("anisotropy", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("anisotropy", this, NodeMaterialConnectionPointDirection.Input, AnisotropyBlock, "AnisotropyBlock")), this.registerInput("iridescence", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("iridescence", this, NodeMaterialConnectionPointDirection.Input, IridescenceBlock, "IridescenceBlock")), this.registerOutput("ambientClr", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("diffuseDir", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("specularDir", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("clearcoatDir", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("sheenDir", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("diffuseInd", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("specularInd", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("clearcoatInd", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("sheenInd", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("refraction", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("lighting", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment), this.registerOutput("shadow", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment), this.registerOutput("alpha", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);}initialize(state) {state._excludeVariableName("vLightingIntensity"), state._excludeVariableName("geometricNormalW"), state._excludeVariableName("normalW"), state._excludeVariableName("faceNormal"), state._excludeVariableName("albedoOpacityOut"), state._excludeVariableName("surfaceAlbedo"), state._excludeVariableName("alpha"), state._excludeVariableName("aoOut"), state._excludeVariableName("baseColor"), state._excludeVariableName("reflectivityOut"), state._excludeVariableName("microSurface"), state._excludeVariableName("roughness"), state._excludeVariableName("NdotVUnclamped"), state._excludeVariableName("NdotV"), state._excludeVariableName("alphaG"), state._excludeVariableName("AARoughnessFactors"), state._excludeVariableName("environmentBrdf"), state._excludeVariableName("ambientMonochrome"), state._excludeVariableName("seo"), state._excludeVariableName("eho"), state._excludeVariableName("environmentRadiance"), state._excludeVariableName("irradianceVector"), state._excludeVariableName("environmentIrradiance"), state._excludeVariableName("diffuseBase"), state._excludeVariableName("specularBase"), state._excludeVariableName("preInfo"), state._excludeVariableName("info"), state._excludeVariableName("shadow"), state._excludeVariableName("finalDiffuse"), state._excludeVariableName("finalAmbient"), state._excludeVariableName("ambientOcclusionForDirectDiffuse"), state._excludeVariableName("finalColor"), state._excludeVariableName("vClipSpacePosition"), state._excludeVariableName("vDebugMode");}getClassName() {return "PBRMetallicRoughnessBlock";}get worldPosition() {return this._inputs[0];}get worldNormal() {return this._inputs[1];}get view() {return this._inputs[2];}get cameraPosition() {return this._inputs[3];}get perturbedNormal() {return this._inputs[4];}get baseColor() {return this._inputs[5];}get metallic() {return this._inputs[6];}get roughness() {return this._inputs[7];}get ambientOcc() {return this._inputs[8];}get opacity() {return this._inputs[9];}get indexOfRefraction() {return this._inputs[10];}get ambientColor() {return this._inputs[11];}get reflection() {return this._inputs[12];}get clearcoat() {return this._inputs[13];}get sheen() {return this._inputs[14];}get subsurface() {return this._inputs[15];}get anisotropy() {return this._inputs[16];}get iridescence() {return this._inputs[17];}get ambientClr() {return this._outputs[0];}get diffuseDir() {return this._outputs[1];}get specularDir() {return this._outputs[2];}get clearcoatDir() {return this._outputs[3];}get sheenDir() {return this._outputs[4];}get diffuseInd() {return this._outputs[5];}get specularInd() {return this._outputs[6];}get clearcoatInd() {return this._outputs[7];}get sheenInd() {return this._outputs[8];}get refraction() {return this._outputs[9];}get lighting() {return this._outputs[10];}get shadow() {return this._outputs[11];}get alpha() {return this._outputs[12];}autoConfigure(material) {if (!this.cameraPosition.isConnected) {let cameraPositionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.CameraPosition);cameraPositionInput || (cameraPositionInput = new InputBlock("cameraPosition"), cameraPositionInput.setAsSystemValue(NodeMaterialSystemValues.CameraPosition)), cameraPositionInput.output.connectTo(this.cameraPosition);}if (!this.view.isConnected) {let viewInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.View);viewInput || (viewInput = new InputBlock("view"), viewInput.setAsSystemValue(NodeMaterialSystemValues.View)), viewInput.output.connectTo(this.view);}}prepareDefines(mesh, nodeMaterial, defines) {defines.setValue("PBR", !0), defines.setValue("METALLICWORKFLOW", !0), defines.setValue("DEBUGMODE", this.debugMode, !0), defines.setValue("NORMALXYSCALE", !0), defines.setValue("BUMP", this.perturbedNormal.isConnected, !0), defines.setValue("LODBASEDMICROSFURACE", this._scene.getEngine().getCaps().textureLOD), defines.setValue("ALBEDO", !1, !0), defines.setValue("OPACITY", this.opacity.isConnected, !0), defines.setValue("AMBIENT", !0, !0), defines.setValue("AMBIENTINGRAYSCALE", !1, !0), defines.setValue("REFLECTIVITY", !1, !0), defines.setValue("AOSTOREINMETALMAPRED", !1, !0), defines.setValue("METALLNESSSTOREINMETALMAPBLUE", !1, !0), defines.setValue("ROUGHNESSSTOREINMETALMAPALPHA", !1, !0), defines.setValue("ROUGHNESSSTOREINMETALMAPGREEN", !1, !0), this.lightFalloff === pbrBaseMaterial/* PBRBaseMaterial.LIGHTFALLOFF_STANDARD */.m.LIGHTFALLOFF_STANDARD ? (defines.setValue("USEPHYSICALLIGHTFALLOFF", !1), defines.setValue("USEGLTFLIGHTFALLOFF", !1)) : this.lightFalloff === pbrBaseMaterial/* PBRBaseMaterial.LIGHTFALLOFF_GLTF */.m.LIGHTFALLOFF_GLTF ? (defines.setValue("USEPHYSICALLIGHTFALLOFF", !1), defines.setValue("USEGLTFLIGHTFALLOFF", !0)) : (defines.setValue("USEPHYSICALLIGHTFALLOFF", !0), defines.setValue("USEGLTFLIGHTFALLOFF", !1));const alphaTestCutOffString = this.alphaTestCutoff.toString();defines.setValue("ALPHABLEND", this.useAlphaBlending, !0), defines.setValue("ALPHAFROMALBEDO", !1, !0), defines.setValue("ALPHATEST", this.useAlphaTest, !0), defines.setValue("ALPHATESTVALUE", 0 > alphaTestCutOffString.indexOf(".") ? alphaTestCutOffString + "." : alphaTestCutOffString, !0), defines.setValue("OPACITYRGB", !1, !0), defines.setValue("RADIANCEOVERALPHA", this.useRadianceOverAlpha, !0), defines.setValue("SPECULAROVERALPHA", this.useSpecularOverAlpha, !0), defines.setValue("SPECULARAA", this._scene.getEngine().getCaps().standardDerivatives && this.enableSpecularAntiAliasing, !0), defines.setValue("REALTIME_FILTERING", this.realTimeFiltering, !0);const scene = mesh.getScene(),engine = scene.getEngine();if (engine._features.needTypeSuffixInShaderConstants ? defines.setValue("NUM_SAMPLES", this.realTimeFilteringQuality + "u", !0) : defines.setValue("NUM_SAMPLES", "" + this.realTimeFilteringQuality, !0), defines.setValue("BRDF_V_HEIGHT_CORRELATED", !0), defines.setValue("MS_BRDF_ENERGY_CONSERVATION", this.useEnergyConservation, !0), defines.setValue("RADIANCEOCCLUSION", this.useRadianceOcclusion, !0), defines.setValue("HORIZONOCCLUSION", this.useHorizonOcclusion, !0), defines.setValue("UNLIT", this.unlit, !0), defines.setValue("FORCENORMALFORWARD", this.forceNormalForward, !0), this._environmentBRDFTexture && materialFlags/* MaterialFlags.ReflectionTextureEnabled */.k.ReflectionTextureEnabled ? (defines.setValue("ENVIRONMENTBRDF", !0), defines.setValue("ENVIRONMENTBRDF_RGBD", this._environmentBRDFTexture.isRGBD, !0)) : (defines.setValue("ENVIRONMENTBRDF", !1), defines.setValue("ENVIRONMENTBRDF_RGBD", !1)), defines._areImageProcessingDirty && nodeMaterial.imageProcessingConfiguration && nodeMaterial.imageProcessingConfiguration.prepareDefines(defines), !!defines._areLightsDirty) if (!this.light) materialHelper/* MaterialHelper.PrepareDefinesForLights */.G.PrepareDefinesForLights(scene, mesh, defines, !0, nodeMaterial.maxSimultaneousLights), defines._needNormals = !0, materialHelper/* MaterialHelper.PrepareDefinesForMultiview */.G.PrepareDefinesForMultiview(scene, defines);else {const state = { needNormals: !1, needRebuild: !1, lightmapMode: !1, shadowEnabled: !1, specularEnabled: !1 };materialHelper/* MaterialHelper.PrepareDefinesForLight */.G.PrepareDefinesForLight(scene, mesh, this.light, this._lightId, defines, !0, state), state.needRebuild && defines.rebuild();}}updateUniformsAndSamples(state, nodeMaterial, defines, uniformBuffers) {for (let lightIndex = 0; lightIndex < nodeMaterial.maxSimultaneousLights && !!defines["LIGHT" + lightIndex]; lightIndex++) {const onlyUpdateBuffersList = 0 <= state.uniforms.indexOf("vLightData" + lightIndex);materialHelper/* MaterialHelper.PrepareUniformsAndSamplersForLight */.G.PrepareUniformsAndSamplersForLight(lightIndex, state.uniforms, state.samplers, defines["PROJECTEDLIGHTTEXTURE" + lightIndex], uniformBuffers, onlyUpdateBuffersList);}}isReady(mesh, nodeMaterial, defines) {return (!this._environmentBRDFTexture || this._environmentBRDFTexture.isReady()) && !(defines._areImageProcessingDirty && nodeMaterial.imageProcessingConfiguration && !nodeMaterial.imageProcessingConfiguration.isReady());}bind(effect, nodeMaterial, mesh) {var _a, _b;if (!mesh) return;const scene = mesh.getScene();this.light ? materialHelper/* MaterialHelper.BindLight */.G.BindLight(this.light, this._lightId, scene, effect, !0) : materialHelper/* MaterialHelper.BindLights */.G.BindLights(scene, mesh, effect, !0, nodeMaterial.maxSimultaneousLights), effect.setTexture(this._environmentBrdfSamplerName, this._environmentBRDFTexture), effect.setFloat2("vDebugMode", this.debugLimit, this.debugFactor);const ambientScene = this._scene.ambientColor;ambientScene && effect.setColor3("ambientFromScene", ambientScene);const invertNormal = scene.useRightHandedSystem === (null != scene._mirroredCameraPosition);effect.setFloat(this._invertNormalName, invertNormal ? -1 : 1), effect.setFloat4("vLightingIntensity", this.directIntensity, 1, this.environmentIntensity * this._scene.environmentIntensity, this.specularIntensity);const ior = null !== (_b = null === (_a = this.indexOfRefraction.connectInputBlock) || void 0 === _a ? void 0 : _a.value) && void 0 !== _b ? _b : 1.5,f0 = Math.pow((ior - 1) / (ior + 1), 2);this._metallicReflectanceColor.scaleToRef(f0 * this._metallicF0Factor, math_color/* TmpColors.Color3.0 */.zZ.Color3[0]);const metallicF90 = this._metallicF0Factor;effect.setColor4(this._vMetallicReflectanceFactorsName, math_color/* TmpColors.Color3.0 */.zZ.Color3[0], metallicF90), nodeMaterial.imageProcessingConfiguration && nodeMaterial.imageProcessingConfiguration.bind(effect);}_injectVertexCode(state) {var _a, _b;const worldPos = this.worldPosition,comments = `//${this.name}`;this.light ? (this._lightId = (state.counters.lightCounter === void 0 ? -1 : state.counters.lightCounter) + 1, state.counters.lightCounter = this._lightId, state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", comments, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString())) : (state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", comments, { repeatKey: "maxSimultaneousLights" }), this._lightId = 0, state.sharedData.dynamicUniformBlocks.push(this));const worldPosVaryingName = "v_" + worldPos.associatedVariableName;state._emitVaryingFromString(worldPosVaryingName, "vec4") && (state.compilationString += `${worldPosVaryingName} = ${worldPos.associatedVariableName};\r\n`);const reflectionBlock = this.reflection.isConnected ? null === (_a = this.reflection.connectedPoint) || void 0 === _a ? void 0 : _a.ownerBlock : null;reflectionBlock && (reflectionBlock.viewConnectionPoint = this.view), state.compilationString += null !== (_b = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock.handleVertexSide(state)) && void 0 !== _b ? _b : "", state._emitVaryingFromString("vClipSpacePosition", "vec4", "defined(IGNORE) || DEBUGMODE > 0") && (state._injectAtEnd += `#if DEBUGMODE > 0\r\n`, state._injectAtEnd += `vClipSpacePosition = gl_Position;\r\n`, state._injectAtEnd += `#endif\r\n`), this.light ? state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }, { search: /worldPos/g, replace: worldPos.associatedVariableName }] }) : (state.compilationString += `vec4 worldPos = ${worldPos.associatedVariableName};\r\n`, this.view.isConnected && (state.compilationString += `mat4 view = ${this.view.associatedVariableName};\r\n`), state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, { repeatKey: "maxSimultaneousLights" }));}_getAlbedoOpacityCode() {let code = `albedoOpacityOutParams albedoOpacityOut;\r\n`;const albedoColor = this.baseColor.isConnected ? this.baseColor.associatedVariableName : "vec3(1.)",opacity = this.opacity.isConnected ? this.opacity.associatedVariableName : "1.";return code += `albedoOpacityBlock(
                vec4(${albedoColor}, 1.),
            #ifdef ALBEDO
                vec4(1.),
                vec2(1., 1.),
            #endif
            #ifdef OPACITY
                vec4(${opacity}),
                vec2(1., 1.),
            #endif
                albedoOpacityOut
            );

            vec3 surfaceAlbedo = albedoOpacityOut.surfaceAlbedo;
            float alpha = albedoOpacityOut.alpha;\r\n`, code;}_getAmbientOcclusionCode() {let code = `ambientOcclusionOutParams aoOut;\r\n`;const ao = this.ambientOcc.isConnected ? this.ambientOcc.associatedVariableName : "1.";return code += `ambientOcclusionBlock(
            #ifdef AMBIENT
                vec3(${ao}),
                vec4(0., 1.0, 1.0, 0.),
            #endif
                aoOut
            );\r\n`, code;}_getReflectivityCode(state) {let code = `reflectivityOutParams reflectivityOut;\r\n`;return this._vMetallicReflectanceFactorsName = state._getFreeVariableName("vMetallicReflectanceFactors"), state._emitUniformFromString(this._vMetallicReflectanceFactorsName, "vec4"), code += `vec3 baseColor = surfaceAlbedo;

            reflectivityBlock(
                vec4(${this.metallic.associatedVariableName}, ${this.roughness.associatedVariableName}, 0., 0.),
            #ifdef METALLICWORKFLOW
                surfaceAlbedo,
                ${this._vMetallicReflectanceFactorsName},
            #endif
            #ifdef REFLECTIVITY
                vec3(0., 0., ${"1."}),
                vec4(1.),
            #endif
            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY)  && defined(AOSTOREINMETALMAPRED)
                aoOut.ambientOcclusionColor,
            #endif
            #ifdef MICROSURFACEMAP
                microSurfaceTexel, <== not handled!
            #endif
                reflectivityOut
            );

            float microSurface = reflectivityOut.microSurface;
            float roughness = reflectivityOut.roughness;

            #ifdef METALLICWORKFLOW
                surfaceAlbedo = reflectivityOut.surfaceAlbedo;
            #endif
            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
                aoOut.ambientOcclusionColor = reflectivityOut.ambientOcclusionColor;
            #endif\r\n`, code;}_buildBlock(state) {var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;super._buildBlock(state), this._scene = state.sharedData.scene, this._environmentBRDFTexture || (this._environmentBRDFTexture = (0,brdfTextureTools/* GetEnvironmentBRDFTexture */.$)(this._scene));const reflectionBlock = this.reflection.isConnected ? null === (_a = this.reflection.connectedPoint) || void 0 === _a ? void 0 : _a.ownerBlock : null;if (reflectionBlock && (reflectionBlock.worldPositionConnectionPoint = this.worldPosition, reflectionBlock.cameraPositionConnectionPoint = this.cameraPosition, reflectionBlock.worldNormalConnectionPoint = this.worldNormal, reflectionBlock.viewConnectionPoint = this.view), state.target !== NodeMaterialBlockTargets.Fragment) return this._injectVertexCode(state), this;state.sharedData.forcedBindableBlocks.push(this), state.sharedData.blocksWithDefines.push(this), state.sharedData.blockingBlocks.push(this), this.generateOnlyFragmentCode && state.sharedData.dynamicUniformBlocks.push(this);const comments = `//${this.name}`,normalShading = this.perturbedNormal;let worldPosVarName = this.worldPosition.associatedVariableName;this.generateOnlyFragmentCode ? (worldPosVarName = state._getFreeVariableName("globalWorldPos"), state._emitFunction("pbr_globalworldpos", `vec3 ${worldPosVarName};\r\n`, comments), state.compilationString += `${worldPosVarName} = ${this.worldPosition.associatedVariableName}.xyz;\r\n`, state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, { repeatKey: "maxSimultaneousLights", substitutionVars: this.generateOnlyFragmentCode ? `worldPos,${this.worldPosition.associatedVariableName}` : void 0 }), state.compilationString += `#if DEBUGMODE > 0\r\n`, state.compilationString += `vec4 vClipSpacePosition = vec4((vec2(gl_FragCoord.xy) / vec2(1.0)) * 2.0 - 1.0, 0.0, 1.0);\r\n`, state.compilationString += `#endif\r\n`) : worldPosVarName = "v_" + worldPosVarName, this._environmentBrdfSamplerName = state._getFreeVariableName("environmentBrdfSampler"), state._emit2DSampler(this._environmentBrdfSamplerName), state.sharedData.hints.needAlphaBlending = state.sharedData.hints.needAlphaBlending || this.useAlphaBlending, state.sharedData.hints.needAlphaTesting = state.sharedData.hints.needAlphaTesting || this.useAlphaTest, state._emitExtension("lod", "#extension GL_EXT_shader_texture_lod : enable", "defined(LODBASEDMICROSFURACE)"), state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable"), state._emitUniformFromString("vDebugMode", "vec2", "defined(IGNORE) || DEBUGMODE > 0"), state._emitUniformFromString("ambientFromScene", "vec3"), state.uniforms.push("exposureLinear"), state.uniforms.push("contrast"), state.uniforms.push("vInverseScreenSize"), state.uniforms.push("vignetteSettings1"), state.uniforms.push("vignetteSettings2"), state.uniforms.push("vCameraColorCurveNegative"), state.uniforms.push("vCameraColorCurveNeutral"), state.uniforms.push("vCameraColorCurvePositive"), state.uniforms.push("txColorTransform"), state.uniforms.push("colorTransformSettings"), state.uniforms.push("ditherIntensity"), this.light ? state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", comments, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString()) : state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", comments, { repeatKey: "maxSimultaneousLights", substitutionVars: this.generateOnlyFragmentCode ? "varying," : void 0 }), state._emitFunctionFromInclude("helperFunctions", comments), state._emitFunctionFromInclude("importanceSampling", comments), state._emitFunctionFromInclude("pbrHelperFunctions", comments), state._emitFunctionFromInclude("imageProcessingDeclaration", comments), state._emitFunctionFromInclude("imageProcessingFunctions", comments), state._emitFunctionFromInclude("shadowsFragmentFunctions", comments, { replaceStrings: [{ search: /vPositionW/g, replace: worldPosVarName + ".xyz" }] }), state._emitFunctionFromInclude("pbrDirectLightingSetupFunctions", comments, { replaceStrings: [{ search: /vPositionW/g, replace: worldPosVarName + ".xyz" }] }), state._emitFunctionFromInclude("pbrDirectLightingFalloffFunctions", comments), state._emitFunctionFromInclude("pbrBRDFFunctions", comments, { replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: null !== (_b = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineSkyboxName) && void 0 !== _b ? _b : "REFLECTIONMAP_SKYBOX" }] }), state._emitFunctionFromInclude("hdrFilteringFunctions", comments), state._emitFunctionFromInclude("pbrDirectLightingFunctions", comments, { replaceStrings: [{ search: /vPositionW/g, replace: worldPosVarName + ".xyz" }] }), state._emitFunctionFromInclude("pbrIBLFunctions", comments), state._emitFunctionFromInclude("pbrBlockAlbedoOpacity", comments), state._emitFunctionFromInclude("pbrBlockReflectivity", comments), state._emitFunctionFromInclude("pbrBlockAmbientOcclusion", comments), state._emitFunctionFromInclude("pbrBlockAlphaFresnel", comments), state._emitFunctionFromInclude("pbrBlockAnisotropic", comments), state._emitUniformFromString("vLightingIntensity", "vec4"), (null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock.generateOnlyFragmentCode) && (state.compilationString += reflectionBlock.handleVertexSide(state)), this._vNormalWName = state._getFreeVariableName("vNormalW"), state.compilationString += `vec4 ${this._vNormalWName} = normalize(${this.worldNormal.associatedVariableName});\r\n`, state._registerTempVariable("viewDirectionW") && (state.compilationString += `vec3 viewDirectionW = normalize(${this.cameraPosition.associatedVariableName} - ${worldPosVarName}.xyz);\r\n`), state.compilationString += `vec3 geometricNormalW = ${this._vNormalWName}.xyz;\r\n`, state.compilationString += `vec3 normalW = ${normalShading.isConnected ? "normalize(" + normalShading.associatedVariableName + ".xyz)" : "geometricNormalW"};\r\n`, this._invertNormalName = state._getFreeVariableName("invertNormal"), state._emitUniformFromString(this._invertNormalName, "float"), state.compilationString += state._emitCodeFromInclude("pbrBlockNormalFinal", comments, { replaceStrings: [{ search: /vPositionW/g, replace: worldPosVarName + ".xyz" }, { search: /vEyePosition.w/g, replace: this._invertNormalName }] }), state.compilationString += this._getAlbedoOpacityCode(), state.compilationString += state._emitCodeFromInclude("depthPrePass", comments), state.compilationString += this._getAmbientOcclusionCode(), state.compilationString += state._emitCodeFromInclude("pbrBlockLightmapInit", comments), state.compilationString += `#ifdef UNLIT
                vec3 diffuseBase = vec3(1., 1., 1.);
            #else\r\n`, state.compilationString += this._getReflectivityCode(state), state.compilationString += state._emitCodeFromInclude("pbrBlockGeometryInfo", comments, { replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: null !== (_c = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineSkyboxName) && void 0 !== _c ? _c : "REFLECTIONMAP_SKYBOX" }, { search: /REFLECTIONMAP_3D/g, replace: null !== (_d = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName) && void 0 !== _d ? _d : "REFLECTIONMAP_3D" }] });const anisotropyBlock = this.anisotropy.isConnected ? null === (_e = this.anisotropy.connectedPoint) || void 0 === _e ? void 0 : _e.ownerBlock : null;anisotropyBlock && (anisotropyBlock.worldPositionConnectionPoint = this.worldPosition, anisotropyBlock.worldNormalConnectionPoint = this.worldNormal, state.compilationString += anisotropyBlock.getCode(state, !this.perturbedNormal.isConnected)), reflectionBlock && reflectionBlock.hasTexture && (state.compilationString += reflectionBlock.getCode(state, anisotropyBlock ? "anisotropicOut.anisotropicNormal" : "normalW")), state._emitFunctionFromInclude("pbrBlockReflection", comments, { replaceStrings: [{ search: /computeReflectionCoords/g, replace: "computeReflectionCoordsPBR" }, { search: /REFLECTIONMAP_3D/g, replace: null !== (_f = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName) && void 0 !== _f ? _f : "REFLECTIONMAP_3D" }, { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: null !== (_g = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineOppositeZ) && void 0 !== _g ? _g : "REFLECTIONMAP_OPPOSITEZ" }, { search: /REFLECTIONMAP_PROJECTION/g, replace: null !== (_h = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineProjectionName) && void 0 !== _h ? _h : "REFLECTIONMAP_PROJECTION" }, { search: /REFLECTIONMAP_SKYBOX/g, replace: null !== (_j = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineSkyboxName) && void 0 !== _j ? _j : "REFLECTIONMAP_SKYBOX" }, { search: /LODINREFLECTIONALPHA/g, replace: null !== (_k = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineLODReflectionAlpha) && void 0 !== _k ? _k : "LODINREFLECTIONALPHA" }, { search: /LINEARSPECULARREFLECTION/g, replace: null !== (_l = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineLinearSpecularReflection) && void 0 !== _l ? _l : "LINEARSPECULARREFLECTION" }, { search: /vReflectionFilteringInfo/g, replace: null !== (_m = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._vReflectionFilteringInfoName) && void 0 !== _m ? _m : "vReflectionFilteringInfo" }] }), state.compilationString += state._emitCodeFromInclude("pbrBlockReflectance0", comments, { replaceStrings: [{ search: /metallicReflectanceFactors/g, replace: this._vMetallicReflectanceFactorsName }] });const sheenBlock = this.sheen.isConnected ? null === (_o = this.sheen.connectedPoint) || void 0 === _o ? void 0 : _o.ownerBlock : null;sheenBlock && (state.compilationString += sheenBlock.getCode(reflectionBlock)), state._emitFunctionFromInclude("pbrBlockSheen", comments, { replaceStrings: [{ search: /REFLECTIONMAP_3D/g, replace: null !== (_p = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName) && void 0 !== _p ? _p : "REFLECTIONMAP_3D" }, { search: /REFLECTIONMAP_SKYBOX/g, replace: null !== (_q = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineSkyboxName) && void 0 !== _q ? _q : "REFLECTIONMAP_SKYBOX" }, { search: /LODINREFLECTIONALPHA/g, replace: null !== (_r = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineLODReflectionAlpha) && void 0 !== _r ? _r : "LODINREFLECTIONALPHA" }, { search: /LINEARSPECULARREFLECTION/g, replace: null !== (_s = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineLinearSpecularReflection) && void 0 !== _s ? _s : "LINEARSPECULARREFLECTION" }] });const iridescenceBlock = this.iridescence.isConnected ? null === (_t = this.iridescence.connectedPoint) || void 0 === _t ? void 0 : _t.ownerBlock : null;state.compilationString += IridescenceBlock.GetCode(iridescenceBlock), state._emitFunctionFromInclude("pbrBlockIridescence", comments, { replaceStrings: [] });const clearcoatBlock = this.clearcoat.isConnected ? null === (_u = this.clearcoat.connectedPoint) || void 0 === _u ? void 0 : _u.ownerBlock : null,generateTBNSpace = !this.perturbedNormal.isConnected && !this.anisotropy.isConnected,isTangentConnectedToPerturbNormal = this.perturbedNormal.isConnected && (null === (_w = (null === (_v = this.perturbedNormal.connectedPoint) || void 0 === _v ? void 0 : _v.ownerBlock).worldTangent) || void 0 === _w ? void 0 : _w.isConnected),isTangentConnectedToAnisotropy = this.anisotropy.isConnected && (null === (_x = this.anisotropy.connectedPoint) || void 0 === _x ? void 0 : _x.ownerBlock).worldTangent.isConnected;let vTBNAvailable = isTangentConnectedToPerturbNormal || !this.perturbedNormal.isConnected && isTangentConnectedToAnisotropy;state.compilationString += ClearCoatBlock.GetCode(state, clearcoatBlock, reflectionBlock, worldPosVarName, generateTBNSpace, vTBNAvailable, this.worldNormal.associatedVariableName), generateTBNSpace && (vTBNAvailable = null !== (_y = null === clearcoatBlock || void 0 === clearcoatBlock ? void 0 : clearcoatBlock.worldTangent.isConnected) && void 0 !== _y && _y), state._emitFunctionFromInclude("pbrBlockClearcoat", comments, { replaceStrings: [{ search: /computeReflectionCoords/g, replace: "computeReflectionCoordsPBR" }, { search: /REFLECTIONMAP_3D/g, replace: null !== (_z = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName) && void 0 !== _z ? _z : "REFLECTIONMAP_3D" }, { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: null !== (_0 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineOppositeZ) && void 0 !== _0 ? _0 : "REFLECTIONMAP_OPPOSITEZ" }, { search: /REFLECTIONMAP_PROJECTION/g, replace: null !== (_1 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineProjectionName) && void 0 !== _1 ? _1 : "REFLECTIONMAP_PROJECTION" }, { search: /REFLECTIONMAP_SKYBOX/g, replace: null !== (_2 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineSkyboxName) && void 0 !== _2 ? _2 : "REFLECTIONMAP_SKYBOX" }, { search: /LODINREFLECTIONALPHA/g, replace: null !== (_3 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineLODReflectionAlpha) && void 0 !== _3 ? _3 : "LODINREFLECTIONALPHA" }, { search: /LINEARSPECULARREFLECTION/g, replace: null !== (_4 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineLinearSpecularReflection) && void 0 !== _4 ? _4 : "LINEARSPECULARREFLECTION" }, { search: /defined\(TANGENT\)/g, replace: vTBNAvailable ? "defined(TANGENT)" : "defined(IGNORE)" }] }), state.compilationString += state._emitCodeFromInclude("pbrBlockReflectance", comments, { replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: null !== (_5 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineSkyboxName) && void 0 !== _5 ? _5 : "REFLECTIONMAP_SKYBOX" }, { search: /REFLECTIONMAP_3D/g, replace: null !== (_6 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName) && void 0 !== _6 ? _6 : "REFLECTIONMAP_3D" }] });const subsurfaceBlock = this.subsurface.isConnected ? null === (_7 = this.subsurface.connectedPoint) || void 0 === _7 ? void 0 : _7.ownerBlock : null,refractionBlock = this.subsurface.isConnected ? null === (_9 = (null === (_8 = this.subsurface.connectedPoint) || void 0 === _8 ? void 0 : _8.ownerBlock).refraction.connectedPoint) || void 0 === _9 ? void 0 : _9.ownerBlock : null;refractionBlock && (refractionBlock.viewConnectionPoint = this.view, refractionBlock.indexOfRefractionConnectionPoint = this.indexOfRefraction), state.compilationString += SubSurfaceBlock.GetCode(state, subsurfaceBlock, reflectionBlock, worldPosVarName), state._emitFunctionFromInclude("pbrBlockSubSurface", comments, { replaceStrings: [{ search: /REFLECTIONMAP_3D/g, replace: null !== (_10 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._define3DName) && void 0 !== _10 ? _10 : "REFLECTIONMAP_3D" }, { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: null !== (_11 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineOppositeZ) && void 0 !== _11 ? _11 : "REFLECTIONMAP_OPPOSITEZ" }, { search: /REFLECTIONMAP_PROJECTION/g, replace: null !== (_12 = null === reflectionBlock || void 0 === reflectionBlock ? void 0 : reflectionBlock._defineProjectionName) && void 0 !== _12 ? _12 : "REFLECTIONMAP_PROJECTION" }, { search: /SS_REFRACTIONMAP_3D/g, replace: null !== (_13 = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._define3DName) && void 0 !== _13 ? _13 : "SS_REFRACTIONMAP_3D" }, { search: /SS_LODINREFRACTIONALPHA/g, replace: null !== (_14 = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._defineLODRefractionAlpha) && void 0 !== _14 ? _14 : "SS_LODINREFRACTIONALPHA" }, { search: /SS_LINEARSPECULARREFRACTION/g, replace: null !== (_15 = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._defineLinearSpecularRefraction) && void 0 !== _15 ? _15 : "SS_LINEARSPECULARREFRACTION" }, { search: /SS_REFRACTIONMAP_OPPOSITEZ/g, replace: null !== (_16 = null === refractionBlock || void 0 === refractionBlock ? void 0 : refractionBlock._defineOppositeZ) && void 0 !== _16 ? _16 : "SS_REFRACTIONMAP_OPPOSITEZ" }] }), state.compilationString += state._emitCodeFromInclude("pbrBlockDirectLighting", comments), state.compilationString += this.light ? state._emitCodeFromInclude("lightFragment", comments, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }) : state._emitCodeFromInclude("lightFragment", comments, { repeatKey: "maxSimultaneousLights" }), state.compilationString += state._emitCodeFromInclude("pbrBlockFinalLitComponents", comments), state.compilationString += `#endif\r\n`;const aoColor = this.ambientColor.isConnected ? this.ambientColor.associatedVariableName : "vec3(0., 0., 0.)";let aoDirectLightIntensity = pbrBaseMaterial/* PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS.toString */.m.DEFAULT_AO_ON_ANALYTICAL_LIGHTS.toString();-1 === aoDirectLightIntensity.indexOf(".") && (aoDirectLightIntensity += "."), state.compilationString += state._emitCodeFromInclude("pbrBlockFinalUnlitComponents", comments, { replaceStrings: [{ search: /vec3 finalEmissive[\s\S]*?finalEmissive\*=vLightingIntensity\.y;/g, replace: "" }, { search: /vAmbientColor/g, replace: aoColor + " * ambientFromScene" }, { search: /vAmbientInfos\.w/g, replace: aoDirectLightIntensity }] }), state.compilationString += state._emitCodeFromInclude("pbrBlockFinalColorComposition", comments, { replaceStrings: [{ search: /finalEmissive/g, replace: "vec3(0.)" }] }), state.compilationString += state._emitCodeFromInclude("pbrBlockImageProcessing", comments, { replaceStrings: [{ search: /visibility/g, replace: "1." }] }), state.compilationString += state._emitCodeFromInclude("pbrDebug", comments, { replaceStrings: [{ search: /vNormalW/g, replace: this._vNormalWName }, { search: /vPositionW/g, replace: worldPosVarName }, { search: /albedoTexture\.rgb;/g, replace: "vec3(1.);\r\ngl_FragColor.rgb = toGammaSpace(gl_FragColor.rgb);\r\n" }] });for (const output of this._outputs) if (output.hasEndpoints) {const remap = mapOutputToVariable[output.name];if (remap) {const [varName, conditions] = remap;conditions && (state.compilationString += `#if ${conditions}\r\n`), state.compilationString += `${this._declareOutput(output, state)} = ${varName};\r\n`, conditions && (state.compilationString += `#else\r\n`, state.compilationString += `${this._declareOutput(output, state)} = vec3(0.);\r\n`, state.compilationString += `#endif\r\n`);} else console.error(`There's no remapping for the ${output.name} end point! No code generated`);}return this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return codeString += `${this._codeVariableName}.lightFalloff = ${this.lightFalloff};\r\n`, codeString += `${this._codeVariableName}.useAlphaTest = ${this.useAlphaTest};\r\n`, codeString += `${this._codeVariableName}.alphaTestCutoff = ${this.alphaTestCutoff};\r\n`, codeString += `${this._codeVariableName}.useAlphaBlending = ${this.useAlphaBlending};\r\n`, codeString += `${this._codeVariableName}.useRadianceOverAlpha = ${this.useRadianceOverAlpha};\r\n`, codeString += `${this._codeVariableName}.useSpecularOverAlpha = ${this.useSpecularOverAlpha};\r\n`, codeString += `${this._codeVariableName}.enableSpecularAntiAliasing = ${this.enableSpecularAntiAliasing};\r\n`, codeString += `${this._codeVariableName}.realTimeFiltering = ${this.realTimeFiltering};\r\n`, codeString += `${this._codeVariableName}.realTimeFilteringQuality = ${this.realTimeFilteringQuality};\r\n`, codeString += `${this._codeVariableName}.useEnergyConservation = ${this.useEnergyConservation};\r\n`, codeString += `${this._codeVariableName}.useRadianceOcclusion = ${this.useRadianceOcclusion};\r\n`, codeString += `${this._codeVariableName}.useHorizonOcclusion = ${this.useHorizonOcclusion};\r\n`, codeString += `${this._codeVariableName}.unlit = ${this.unlit};\r\n`, codeString += `${this._codeVariableName}.forceNormalForward = ${this.forceNormalForward};\r\n`, codeString += `${this._codeVariableName}.debugMode = ${this.debugMode};\r\n`, codeString += `${this._codeVariableName}.debugLimit = ${this.debugLimit};\r\n`, codeString += `${this._codeVariableName}.debugFactor = ${this.debugFactor};\r\n`, codeString;}serialize() {const serializationObject = super.serialize();return this.light && (serializationObject.lightId = this.light.id), serializationObject.lightFalloff = this.lightFalloff, serializationObject.useAlphaTest = this.useAlphaTest, serializationObject.alphaTestCutoff = this.alphaTestCutoff, serializationObject.useAlphaBlending = this.useAlphaBlending, serializationObject.useRadianceOverAlpha = this.useRadianceOverAlpha, serializationObject.useSpecularOverAlpha = this.useSpecularOverAlpha, serializationObject.enableSpecularAntiAliasing = this.enableSpecularAntiAliasing, serializationObject.realTimeFiltering = this.realTimeFiltering, serializationObject.realTimeFilteringQuality = this.realTimeFilteringQuality, serializationObject.useEnergyConservation = this.useEnergyConservation, serializationObject.useRadianceOcclusion = this.useRadianceOcclusion, serializationObject.useHorizonOcclusion = this.useHorizonOcclusion, serializationObject.unlit = this.unlit, serializationObject.forceNormalForward = this.forceNormalForward, serializationObject.debugMode = this.debugMode, serializationObject.debugLimit = this.debugLimit, serializationObject.debugFactor = this.debugFactor, serializationObject.generateOnlyFragmentCode = this.generateOnlyFragmentCode, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {var _a, _b;super._deserialize(serializationObject, scene, rootUrl), serializationObject.lightId && (this.light = scene.getLightById(serializationObject.lightId)), this.lightFalloff = null !== (_a = serializationObject.lightFalloff) && void 0 !== _a ? _a : 0, this.useAlphaTest = serializationObject.useAlphaTest, this.alphaTestCutoff = serializationObject.alphaTestCutoff, this.useAlphaBlending = serializationObject.useAlphaBlending, this.useRadianceOverAlpha = serializationObject.useRadianceOverAlpha, this.useSpecularOverAlpha = serializationObject.useSpecularOverAlpha, this.enableSpecularAntiAliasing = serializationObject.enableSpecularAntiAliasing, this.realTimeFiltering = !!serializationObject.realTimeFiltering, this.realTimeFilteringQuality = null !== (_b = serializationObject.realTimeFilteringQuality) && void 0 !== _b ? _b : 8, this.useEnergyConservation = serializationObject.useEnergyConservation, this.useRadianceOcclusion = serializationObject.useRadianceOcclusion, this.useHorizonOcclusion = serializationObject.useHorizonOcclusion, this.unlit = serializationObject.unlit, this.forceNormalForward = !!serializationObject.forceNormalForward, this.debugMode = serializationObject.debugMode, this.debugLimit = serializationObject.debugLimit, this.debugFactor = serializationObject.debugFactor, this.generateOnlyFragmentCode = !!serializationObject.generateOnlyFragmentCode, this._setTarget();}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Direct lights", PropertyTypeForEdition.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "directIntensity", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Environment lights", PropertyTypeForEdition.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "environmentIntensity", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Specular highlights", PropertyTypeForEdition.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "specularIntensity", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Light falloff", PropertyTypeForEdition.List, "LIGHTING & COLORS", { notifiers: { update: !0 }, options: [{ label: "Physical", value: pbrBaseMaterial/* PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL */.m.LIGHTFALLOFF_PHYSICAL }, { label: "GLTF", value: pbrBaseMaterial/* PBRBaseMaterial.LIGHTFALLOFF_GLTF */.m.LIGHTFALLOFF_GLTF }, { label: "Standard", value: pbrBaseMaterial/* PBRBaseMaterial.LIGHTFALLOFF_STANDARD */.m.LIGHTFALLOFF_STANDARD }] })], PBRMetallicRoughnessBlock.prototype, "lightFalloff", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Alpha Testing", PropertyTypeForEdition.Boolean, "OPACITY")], PBRMetallicRoughnessBlock.prototype, "useAlphaTest", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Alpha CutOff", PropertyTypeForEdition.Float, "OPACITY", { min: 0, max: 1, notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "alphaTestCutoff", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Alpha blending", PropertyTypeForEdition.Boolean, "OPACITY")], PBRMetallicRoughnessBlock.prototype, "useAlphaBlending", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Radiance over alpha", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "useRadianceOverAlpha", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Specular over alpha", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "useSpecularOverAlpha", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Specular anti-aliasing", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "enableSpecularAntiAliasing", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Realtime filtering", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "realTimeFiltering", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Realtime filtering quality", PropertyTypeForEdition.List, "RENDERING", { notifiers: { update: !0 }, options: [{ label: "Low", value: 8 }, { label: "Medium", value: 16 }, { label: "High", value: 64 }] })], PBRMetallicRoughnessBlock.prototype, "realTimeFilteringQuality", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Energy Conservation", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "useEnergyConservation", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Radiance occlusion", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "useRadianceOcclusion", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Horizon occlusion", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "useHorizonOcclusion", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Unlit", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "unlit", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Force normal forward", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "forceNormalForward", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Generate only fragment code", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: !0, update: !0, onValidation: PBRMetallicRoughnessBlock._OnGenerateOnlyFragmentCodeChanged } })], PBRMetallicRoughnessBlock.prototype, "generateOnlyFragmentCode", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Debug mode", PropertyTypeForEdition.List, "DEBUG", { notifiers: { update: !0 }, options: [{ label: "None", value: 0 }, { label: "Normalized position", value: 1 }, { label: "Normals", value: 2 }, { label: "Tangents", value: 3 }, { label: "Bitangents", value: 4 }, { label: "Bump Normals", value: 5 }, { label: "ClearCoat Normals", value: 8 }, { label: "ClearCoat Tangents", value: 9 }, { label: "ClearCoat Bitangents", value: 10 }, { label: "Anisotropic Normals", value: 11 }, { label: "Anisotropic Tangents", value: 12 }, { label: "Anisotropic Bitangents", value: 13 }, { label: "Env Refraction", value: 40 }, { label: "Env Reflection", value: 41 }, { label: "Env Clear Coat", value: 42 }, { label: "Direct Diffuse", value: 50 }, { label: "Direct Specular", value: 51 }, { label: "Direct Clear Coat", value: 52 }, { label: "Direct Sheen", value: 53 }, { label: "Env Irradiance", value: 54 }, { label: "Surface Albedo", value: 60 }, { label: "Reflectance 0", value: 61 }, { label: "Metallic", value: 62 }, { label: "Metallic F0", value: 71 }, { label: "Roughness", value: 63 }, { label: "AlphaG", value: 64 }, { label: "NdotV", value: 65 }, { label: "ClearCoat Color", value: 66 }, { label: "ClearCoat Roughness", value: 67 }, { label: "ClearCoat NdotV", value: 68 }, { label: "Transmittance", value: 69 }, { label: "Refraction Transmittance", value: 70 }, { label: "SEO", value: 80 }, { label: "EHO", value: 81 }, { label: "Energy Factor", value: 82 }, { label: "Specular Reflectance", value: 83 }, { label: "Clear Coat Reflectance", value: 84 }, { label: "Sheen Reflectance", value: 85 }, { label: "Luminance Over Alpha", value: 86 }, { label: "Alpha", value: 87 }] })], PBRMetallicRoughnessBlock.prototype, "debugMode", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Split position", PropertyTypeForEdition.Float, "DEBUG", { min: -1, max: 1, notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "debugLimit", void 0), (0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Output factor", PropertyTypeForEdition.Float, "DEBUG", { min: 0, max: 5, notifiers: { update: !0 } })], PBRMetallicRoughnessBlock.prototype, "debugFactor", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.PBRMetallicRoughnessBlock", PBRMetallicRoughnessBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/modBlock.js
class ModBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);}getClassName() {return "ModBlock";}get left() {return this._inputs[0];}get right() {return this._inputs[1];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0];return state.compilationString += this._declareOutput(output, state) + ` = mod(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ModBlock", ModBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/matrixBuilderBlock.js
class MatrixBuilderBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("row0", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("row1", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("row2", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerInput("row3", NodeMaterialBlockConnectionPointTypes.Vector4), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "MatrixBuilder";}get row0() {return this._inputs[0];}get row1() {return this._inputs[1];}get row2() {return this._inputs[2];}get row3() {return this._inputs[3];}get output() {return this._outputs[0];}autoConfigure() {if (!this.row0.isConnected) {const row0Input = new InputBlock("row0");row0Input.value = new math_vector/* Vector4 */.Lt(1, 0, 0, 0), row0Input.output.connectTo(this.row0);}if (!this.row1.isConnected) {const row1Input = new InputBlock("row1");row1Input.value = new math_vector/* Vector4 */.Lt(0, 1, 0, 0), row1Input.output.connectTo(this.row1);}if (!this.row2.isConnected) {const row2Input = new InputBlock("row2");row2Input.value = new math_vector/* Vector4 */.Lt(0, 0, 1, 0), row2Input.output.connectTo(this.row2);}if (!this.row3.isConnected) {const row3Input = new InputBlock("row3");row3Input.value = new math_vector/* Vector4 */.Lt(0, 0, 0, 1), row3Input.output.connectTo(this.row3);}}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0],row0 = this.row0,row1 = this.row1,row2 = this.row2,row3 = this.row3;return state.compilationString += this._declareOutput(output, state) + ` = mat4(${row0.associatedVariableName}, ${row1.associatedVariableName}, ${row2.associatedVariableName}, ${row3.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.MatrixBuilder", MatrixBuilderBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/conditionalBlock.js
var ConditionalBlockConditions;(function (ConditionalBlockConditions) {ConditionalBlockConditions[ConditionalBlockConditions.Equal = 0] = "Equal", ConditionalBlockConditions[ConditionalBlockConditions.NotEqual = 1] = "NotEqual", ConditionalBlockConditions[ConditionalBlockConditions.LessThan = 2] = "LessThan", ConditionalBlockConditions[ConditionalBlockConditions.GreaterThan = 3] = "GreaterThan", ConditionalBlockConditions[ConditionalBlockConditions.LessOrEqual = 4] = "LessOrEqual", ConditionalBlockConditions[ConditionalBlockConditions.GreaterOrEqual = 5] = "GreaterOrEqual", ConditionalBlockConditions[ConditionalBlockConditions.Xor = 6] = "Xor", ConditionalBlockConditions[ConditionalBlockConditions.Or = 7] = "Or", ConditionalBlockConditions[ConditionalBlockConditions.And = 8] = "And";})(ConditionalBlockConditions || (ConditionalBlockConditions = {}));class ConditionalBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.condition = ConditionalBlockConditions.LessThan, this.registerInput("a", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("b", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("true", NodeMaterialBlockConnectionPointTypes.AutoDetect, !0), this.registerInput("false", NodeMaterialBlockConnectionPointTypes.AutoDetect, !0), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._linkConnectionTypes(2, 3), this._outputs[0]._typeConnectionSource = this._inputs[2], this._outputs[0]._defaultConnectionPointType = NodeMaterialBlockConnectionPointTypes.Float;}getClassName() {return "ConditionalBlock";}get a() {return this._inputs[0];}get b() {return this._inputs[1];}get true() {return this._inputs[2];}get false() {return this._inputs[3];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0],trueStatement = this.true.isConnected ? this.true.associatedVariableName : "1.0",falseStatement = this.false.isConnected ? this.false.associatedVariableName : "0.0";switch (this.condition) {case ConditionalBlockConditions.Equal:{state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} == ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\r\n`;break;}case ConditionalBlockConditions.NotEqual:{state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} != ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\r\n`;break;}case ConditionalBlockConditions.LessThan:{state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} < ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\r\n`;break;}case ConditionalBlockConditions.LessOrEqual:{state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} <= ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\r\n`;break;}case ConditionalBlockConditions.GreaterThan:{state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} > ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\r\n`;break;}case ConditionalBlockConditions.GreaterOrEqual:{state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} >= ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\r\n`;break;}case ConditionalBlockConditions.Xor:{state.compilationString += this._declareOutput(output, state) + ` = (mod(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 2.0) > 0.0) ? ${trueStatement} : ${falseStatement};\r\n`;break;}case ConditionalBlockConditions.Or:{state.compilationString += this._declareOutput(output, state) + ` = (min(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 1.0) > 0.0) ? ${trueStatement} : ${falseStatement};\r\n`;break;}case ConditionalBlockConditions.And:{state.compilationString += this._declareOutput(output, state) + ` = (${this.a.associatedVariableName} * ${this.b.associatedVariableName} > 0.0)  ? ${trueStatement} : ${falseStatement};\r\n`;break;}}return this;}serialize() {const serializationObject = super.serialize();return serializationObject.condition = this.condition, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.condition = serializationObject.condition;}_dumpPropertiesCode() {const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.condition = BABYLON.ConditionalBlockConditions.${ConditionalBlockConditions[this.condition]};\r\n`;return codeString;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ConditionalBlock", ConditionalBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/cloudBlock.js
class CloudBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.octaves = 6, this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerInput("chaos", NodeMaterialBlockConnectionPointTypes.AutoDetect, !0), this.registerInput("offsetX", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("offsetY", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("offsetZ", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float), this._inputs[0].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2), this._inputs[0].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector3), this._linkConnectionTypes(0, 1);}getClassName() {return "CloudBlock";}get seed() {return this._inputs[0];}get chaos() {return this._inputs[1];}get offsetX() {return this._inputs[2];}get offsetY() {return this._inputs[3];}get offsetZ() {return this._inputs[4];}get output() {return this._outputs[0];}_buildBlock(state) {var _a, _b;if (super._buildBlock(state), !this.seed.isConnected) return;if (!this._outputs[0].hasEndpoints) return;const fbmNewName = `fbm${this.octaves}`;state._emitFunction("CloudBlockCode", "\n\n        float cloudRandom(in float p) { p = fract(p * 0.011); p *= p + 7.5; p *= p + p; return fract(p); }\n\n        // Based on Morgan McGuire @morgan3d\n        // https://www.shadertoy.com/view/4dS3Wd\n        float cloudNoise(in vec2 x, in vec2 chaos) {\n            vec2 step = chaos * vec2(75., 120.) + vec2(75., 120.);\n\n            vec2 i = floor(x);\n            vec2 f = fract(x);\n\n            float n = dot(i, step);\n\n            vec2 u = f * f * (3.0 - 2.0 * f);\n            return mix(\n                    mix(cloudRandom(n + dot(step, vec2(0, 0))), cloudRandom(n + dot(step, vec2(1, 0))), u.x),\n                    mix(cloudRandom(n + dot(step, vec2(0, 1))), cloudRandom(n + dot(step, vec2(1, 1))), u.x),\n                    u.y\n                );\n        }\n\n        float cloudNoise(in vec3 x, in vec3 chaos) {\n            vec3 step = chaos * vec3(60., 120., 75.) + vec3(60., 120., 75.);\n\n            vec3 i = floor(x);\n            vec3 f = fract(x);\n\n            float n = dot(i, step);\n\n            vec3 u = f * f * (3.0 - 2.0 * f);\n            return mix(mix(mix( cloudRandom(n + dot(step, vec3(0, 0, 0))), cloudRandom(n + dot(step, vec3(1, 0, 0))), u.x),\n                           mix( cloudRandom(n + dot(step, vec3(0, 1, 0))), cloudRandom(n + dot(step, vec3(1, 1, 0))), u.x), u.y),\n                       mix(mix( cloudRandom(n + dot(step, vec3(0, 0, 1))), cloudRandom(n + dot(step, vec3(1, 0, 1))), u.x),\n                           mix( cloudRandom(n + dot(step, vec3(0, 1, 1))), cloudRandom(n + dot(step, vec3(1, 1, 1))), u.x), u.y), u.z);\n        }", "// CloudBlockCode"), state._emitFunction("CloudBlockCodeFBM" + this.octaves, `
        float fbm(in vec2 st, in vec2 chaos) {
            // Initial values
            float value = 0.0;
            float amplitude = .5;
            float frequency = 0.;

            // Loop of octaves
            for (int i = 0; i < OCTAVES; i++) {
                value += amplitude * cloudNoise(st, chaos);
                st *= 2.0;
                amplitude *= 0.5;
            }
            return value;
        }

        float fbm(in vec3 x, in vec3 chaos) {
            // Initial values
            float value = 0.0;
            float amplitude = 0.5;
            for (int i = 0; i < OCTAVES; ++i) {
                value += amplitude * cloudNoise(x, chaos);
                x = x * 2.0;
                amplitude *= 0.5;
            }
            return value;
        }`.replace(/fbm/gi, fbmNewName).replace(/OCTAVES/gi, (0 | this.octaves).toString()), "// CloudBlockCode FBM");const localVariable = state._getFreeVariableName("st"),seedType = (null === (_a = this.seed.connectedPoint) || void 0 === _a ? void 0 : _a.type) === NodeMaterialBlockConnectionPointTypes.Vector2 ? "vec2" : "vec3";state.compilationString += `${seedType} ${localVariable} = ${this.seed.associatedVariableName};\r\n`, this.offsetX.isConnected && (state.compilationString += `${localVariable}.x += 0.1 * ${this.offsetX.associatedVariableName};\r\n`), this.offsetY.isConnected && (state.compilationString += `${localVariable}.y += 0.1 * ${this.offsetY.associatedVariableName};\r\n`), this.offsetZ.isConnected && "vec3" === seedType && (state.compilationString += `${localVariable}.z += 0.1 * ${this.offsetZ.associatedVariableName};\r\n`);let chaosValue = "";return chaosValue = this.chaos.isConnected ? this.chaos.associatedVariableName : (null === (_b = this.seed.connectedPoint) || void 0 === _b ? void 0 : _b.type) === NodeMaterialBlockConnectionPointTypes.Vector2 ? "vec2(0., 0.)" : "vec3(0., 0., 0.)", state.compilationString += this._declareOutput(this._outputs[0], state) + ` = ${fbmNewName}(${localVariable}, ${chaosValue});\r\n`, this;}_dumpPropertiesCode() {const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.octaves = ${this.octaves};\r\n`;return codeString;}serialize() {const serializationObject = super.serialize();return serializationObject.octaves = this.octaves, serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.octaves = serializationObject.octaves;}}(0,tslib_es6/* __decorate */.gn)([editableInPropertyPage("Octaves", PropertyTypeForEdition.Int)], CloudBlock.prototype, "octaves", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.CloudBlock", CloudBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/voronoiNoiseBlock.js
class VoronoiNoiseBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.Vector2), this.registerInput("offset", NodeMaterialBlockConnectionPointTypes.Float), this.registerInput("density", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float), this.registerOutput("cells", NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "VoronoiNoiseBlock";}get seed() {return this._inputs[0];}get offset() {return this._inputs[1];}get density() {return this._inputs[2];}get output() {return this._outputs[0];}get cells() {return this._outputs[1];}_buildBlock(state) {if (super._buildBlock(state), !this.seed.isConnected) return;let functionString = `vec2 voronoiRandom(vec2 seed, float offset){
            mat2 m = mat2(15.27, 47.63, 99.41, 89.98);
            vec2 uv = fract(sin(m * seed) * 46839.32);
            return vec2(sin(uv.y * offset) * 0.5 + 0.5, cos(uv.x * offset) * 0.5 + 0.5);
        }
        `;state._emitFunction("voronoiRandom", functionString, "// Voronoi random generator"), functionString = `void voronoi(vec2 seed, float offset, float density, out float outValue, out float cells){
            vec2 g = floor(seed * density);
            vec2 f = fract(seed * density);
            float t = 8.0;
            vec3 res = vec3(8.0, 0.0, 0.0);

            for(int y=-1; y<=1; y++)
            {
                for(int x=-1; x<=1; x++)
                {
                    vec2 lattice = vec2(x,y);
                    vec2 randomOffset = voronoiRandom(lattice + g, offset);
                    float d = distance(lattice + randomOffset, f);
                    if(d < res.x)
                    {
                        res = vec3(d, randomOffset.x, randomOffset.y);
                        outValue = res.x;
                        cells = res.y;
                    }
                }
            }
        }
        `, state._emitFunction("voronoi", functionString, "// Voronoi");const tempOutput = state._getFreeVariableName("tempOutput"),tempCells = state._getFreeVariableName("tempCells");return state.compilationString += `float ${tempOutput} = 0.0;\r\n`, state.compilationString += `float ${tempCells} = 0.0;\r\n`, state.compilationString += `voronoi(${this.seed.associatedVariableName}, ${this.offset.associatedVariableName}, ${this.density.associatedVariableName}, ${tempOutput}, ${tempCells});\r\n`, this.output.hasEndpoints && (state.compilationString += this._declareOutput(this.output, state) + ` = ${tempOutput};\r\n`), this.cells.hasEndpoints && (state.compilationString += this._declareOutput(this.cells, state) + ` = ${tempCells};\r\n`), this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.VoronoiNoiseBlock", VoronoiNoiseBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/elbowBlock.js
class ElbowBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];}getClassName() {return "ElbowBlock";}get input() {return this._inputs[0];}get output() {return this._outputs[0];}get target() {const input = this._inputs[0];if (input.isConnected) {const block = input.connectedPoint.ownerBlock;if (block.target !== NodeMaterialBlockTargets.VertexAndFragment) return block.target;if (input.connectedPoint.target !== NodeMaterialBlockTargets.VertexAndFragment) return input.connectedPoint.target;}return this._target;}set target(value) {0 != (this._target & value) || (this._target = value);}_buildBlock(state) {super._buildBlock(state);const output = this._outputs[0],input = this._inputs[0];return state.compilationString += this._declareOutput(output, state) + ` = ${input.associatedVariableName};\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ElbowBlock", ElbowBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/triPlanarBlock.js
class TriPlanarBlock extends NodeMaterialBlock {get texture() {var _a;return this.source.isConnected ? (null === (_a = this.source.connectedPoint) || void 0 === _a ? void 0 : _a.ownerBlock).texture : this._texture;}set texture(texture) {var _a;if (this._texture !== texture) {const scene = null !== (_a = null === texture || void 0 === texture ? void 0 : texture.getScene()) && void 0 !== _a ? _a : engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;!texture && scene && scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this._texture)), this._texture = texture, texture && scene && scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(texture));}}get textureY() {var _a;return this.sourceY.isConnected ? (null === (_a = this.sourceY.connectedPoint) || void 0 === _a ? void 0 : _a.ownerBlock).texture : null;}get textureZ() {var _a, _b;return (null === (_a = this.sourceZ) || void 0 === _a ? void 0 : _a.isConnected) ? (null === (_b = this.sourceY.connectedPoint) || void 0 === _b ? void 0 : _b.ownerBlock).texture : null;}_getImageSourceBlock(connectionPoint) {return (null === connectionPoint || void 0 === connectionPoint ? void 0 : connectionPoint.isConnected) ? connectionPoint.connectedPoint.ownerBlock : null;}get samplerName() {const imageSourceBlock = this._getImageSourceBlock(this.source);return imageSourceBlock ? imageSourceBlock.samplerName : this._samplerName;}get samplerYName() {var _a, _b;return null !== (_b = null === (_a = this._getImageSourceBlock(this.sourceY)) || void 0 === _a ? void 0 : _a.samplerName) && void 0 !== _b ? _b : null;}get samplerZName() {var _a, _b;return null !== (_b = null === (_a = this._getImageSourceBlock(this.sourceZ)) || void 0 === _a ? void 0 : _a.samplerName) && void 0 !== _b ? _b : null;}get hasImageSource() {return this.source.isConnected;}set convertToGammaSpace(value) {var _a;if (value !== this._convertToGammaSpace && (this._convertToGammaSpace = value, this.texture)) {const scene = null !== (_a = this.texture.getScene()) && void 0 !== _a ? _a : engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;null === scene || void 0 === scene ? void 0 : scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this.texture));}}get convertToGammaSpace() {return this._convertToGammaSpace;}set convertToLinearSpace(value) {var _a;if (value !== this._convertToLinearSpace && (this._convertToLinearSpace = value, this.texture)) {const scene = null !== (_a = this.texture.getScene()) && void 0 !== _a ? _a : engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;null === scene || void 0 === scene ? void 0 : scene.markAllMaterialsAsDirty(1, (mat) => mat.hasTexture(this.texture));}}get convertToLinearSpace() {return this._convertToLinearSpace;}constructor(name, hideSourceZ = !1) {super(name, NodeMaterialBlockTargets.Neutral), this._convertToGammaSpace = !1, this._convertToLinearSpace = !1, this.disableLevelMultiplication = !1, this.registerInput("position", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1), this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect, !1), this.registerInput("sharpness", NodeMaterialBlockConnectionPointTypes.Float, !0), this.registerInput("source", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("source", this, NodeMaterialConnectionPointDirection.Input, ImageSourceBlock, "ImageSourceBlock")), this.registerInput("sourceY", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("sourceY", this, NodeMaterialConnectionPointDirection.Input, ImageSourceBlock, "ImageSourceBlock")), hideSourceZ || this.registerInput("sourceZ", NodeMaterialBlockConnectionPointTypes.Object, !0, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("sourceZ", this, NodeMaterialConnectionPointDirection.Input, ImageSourceBlock, "ImageSourceBlock")), this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Neutral), this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Neutral), this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this.registerOutput("level", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4), this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);}getClassName() {return "TriPlanarBlock";}get position() {return this._inputs[0];}get normal() {return this._inputs[1];}get sharpness() {return this._inputs[2];}get source() {return this._inputs[3];}get sourceY() {return this._inputs[4];}get sourceZ() {return this._inputs[5];}get rgba() {return this._outputs[0];}get rgb() {return this._outputs[1];}get r() {return this._outputs[2];}get g() {return this._outputs[3];}get b() {return this._outputs[4];}get a() {return this._outputs[5];}get level() {return this._outputs[6];}prepareDefines(mesh, nodeMaterial, defines) {if (!defines._areTexturesDirty) return;const toGamma = this.convertToGammaSpace && this.texture && !this.texture.gammaSpace,toLinear = this.convertToLinearSpace && this.texture && this.texture.gammaSpace;defines.setValue(this._linearDefineName, toGamma, !0), defines.setValue(this._gammaDefineName, toLinear, !0);}isReady() {return !this.texture || this.texture.isReadyOrNotBlocking();}bind(effect) {this.texture && (effect.setFloat(this._textureInfoName, this.texture.level), !this._imageSource && effect.setTexture(this._samplerName, this.texture));}_generateTextureLookup(state) {var _a, _b;const samplerName = this.samplerName,samplerYName = null !== (_a = this.samplerYName) && void 0 !== _a ? _a : samplerName,samplerZName = null !== (_b = this.samplerZName) && void 0 !== _b ? _b : samplerName,sharpness = this.sharpness.isConnected ? this.sharpness.associatedVariableName : "1.0",x = state._getFreeVariableName("x"),y = state._getFreeVariableName("y"),z = state._getFreeVariableName("z"),w = state._getFreeVariableName("z");state.compilationString += `
            vec4 ${x} = texture2D(${samplerName}, ${this.position.associatedVariableName}.yz);
            vec4 ${y} = texture2D(${samplerYName}, ${this.position.associatedVariableName}.zx);
            vec4 ${z} = texture2D(${samplerZName}, ${this.position.associatedVariableName}.xy);
            
            // blend weights
            vec3 ${w} = pow(abs(${this.normal.associatedVariableName}.xyz), vec3(${sharpness}));

            // blend and return
            vec4 ${this._tempTextureRead} = (${x}*${w}.x + ${y}*${w}.y + ${z}*${w}.z) / (${w}.x + ${w}.y + ${w}.z);        
        `;}_generateConversionCode(state, output, swizzle) {"a" !== swizzle && ((!this.texture || !this.texture.gammaSpace) && (state.compilationString += `#ifdef ${this._linearDefineName}
                    ${output.associatedVariableName} = toGammaSpace(${output.associatedVariableName});
                    #endif
                `), state.compilationString += `#ifdef ${this._gammaDefineName}
                ${output.associatedVariableName} = toLinearSpace(${output.associatedVariableName});
                #endif
            `);}_writeOutput(state, output, swizzle) {let complement = "";this.disableLevelMultiplication || (complement = ` * ${this._textureInfoName}`), state.compilationString += `${this._declareOutput(output, state)} = ${this._tempTextureRead}.${swizzle}${complement};\r\n`, this._generateConversionCode(state, output, swizzle);}_buildBlock(state) {super._buildBlock(state), this._imageSource = this.source.isConnected ? this.source.connectedPoint.ownerBlock : null, this._textureInfoName = state._getFreeVariableName("textureInfoName"), this.level.associatedVariableName = this._textureInfoName, this._tempTextureRead = state._getFreeVariableName("tempTextureRead"), this._linearDefineName = state._getFreeDefineName("ISLINEAR"), this._gammaDefineName = state._getFreeDefineName("ISGAMMA"), this._imageSource || (this._samplerName = state._getFreeVariableName(this.name + "Sampler"), state._emit2DSampler(this._samplerName)), state.sharedData.blockingBlocks.push(this), state.sharedData.textureBlocks.push(this), state.sharedData.blocksWithDefines.push(this), state.sharedData.bindableBlocks.push(this);const comments = `//${this.name}`;state._emitFunctionFromInclude("helperFunctions", comments), state._emitUniformFromString(this._textureInfoName, "float"), this._generateTextureLookup(state);for (const output of this._outputs) output.hasEndpoints && "level" !== output.name && this._writeOutput(state, output, output.name);return this;}_dumpPropertiesCode() {let codeString = super._dumpPropertiesCode();return (codeString += `${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};\r\n`, codeString += `${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};\r\n`, codeString += `${this._codeVariableName}.disableLevelMultiplication = ${this.disableLevelMultiplication};\r\n`, !this.texture) ? codeString : (codeString += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});\r\n`, codeString += `${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};\r\n`, codeString += `${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};\r\n`, codeString += `${this._codeVariableName}.texture.uAng = ${this.texture.uAng};\r\n`, codeString += `${this._codeVariableName}.texture.vAng = ${this.texture.vAng};\r\n`, codeString += `${this._codeVariableName}.texture.wAng = ${this.texture.wAng};\r\n`, codeString += `${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};\r\n`, codeString += `${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};\r\n`, codeString += `${this._codeVariableName}.texture.uScale = ${this.texture.uScale};\r\n`, codeString += `${this._codeVariableName}.texture.vScale = ${this.texture.vScale};\r\n`, codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\r\n`, codeString);}serialize() {const serializationObject = super.serialize();return serializationObject.convertToGammaSpace = this.convertToGammaSpace, serializationObject.convertToLinearSpace = this.convertToLinearSpace, serializationObject.disableLevelMultiplication = this.disableLevelMultiplication, this.hasImageSource || !this.texture || this.texture.isRenderTarget || "VideoTexture" === this.texture.getClassName() || (serializationObject.texture = this.texture.serialize()), serializationObject;}_deserialize(serializationObject, scene, rootUrl) {super._deserialize(serializationObject, scene, rootUrl), this.convertToGammaSpace = serializationObject.convertToGammaSpace, this.convertToLinearSpace = !!serializationObject.convertToLinearSpace, this.disableLevelMultiplication = !!serializationObject.disableLevelMultiplication, serializationObject.texture && !NodeMaterial.IgnoreTexturesAtLoadTime && serializationObject.texture.url !== void 0 && (rootUrl = 0 === serializationObject.texture.url.indexOf("data:") ? "" : rootUrl, this.texture = Textures_texture/* Texture.Parse */.x.Parse(serializationObject.texture, scene, rootUrl));}}(0,typeStore/* RegisterClass */.H)("BABYLON.TriPlanarBlock", TriPlanarBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/biPlanarBlock.js
class BiPlanarBlock extends TriPlanarBlock {constructor(name) {super(name, !0);}getClassName() {return "BiPlanarBlock";}_generateTextureLookup(state) {var _a;const samplerName = this.samplerName,samplerYName = null !== (_a = this.samplerYName) && void 0 !== _a ? _a : this.samplerName,sharpness = this.sharpness.isConnected ? this.sharpness.associatedVariableName : "1.0",dpdx = state._getFreeVariableName("dpdx"),dpdy = state._getFreeVariableName("dpdy"),n = state._getFreeVariableName("n"),ma = state._getFreeVariableName("ma"),mi = state._getFreeVariableName("mi"),me = state._getFreeVariableName("me"),x = state._getFreeVariableName("x"),y = state._getFreeVariableName("y"),w = state._getFreeVariableName("y");state.compilationString += `
            // grab coord derivatives for texturing
            vec3 ${dpdx} = dFdx(${this.position.associatedVariableName}.xyz);
            vec3 ${dpdy} = dFdy(${this.position.associatedVariableName}.xyz);
            vec3 ${n} = abs(${this.normal.associatedVariableName}.xyz);
        
            // determine major axis (in x; yz are following axis)
            ivec3 ${ma} = (${n}.x>${n}.y && ${n}.x>${n}.z) ? ivec3(0,1,2) :
                    (${n}.y>${n}.z)            ? ivec3(1,2,0) :
                                            ivec3(2,0,1) ;
            // determine minor axis (in x; yz are following axis)
            ivec3 ${mi} = (${n}.x<${n}.y && ${n}.x<${n}.z) ? ivec3(0,1,2) :
                    (${n}.y<${n}.z)            ? ivec3(1,2,0) :
                                            ivec3(2,0,1) ;
            // determine median axis (in x;  yz are following axis)
            ivec3 ${me} = ivec3(3) - ${mi} - ${ma};
            
            // project+fetch
            vec4 ${x} = textureGrad( ${samplerName}, vec2(   ${this.position.associatedVariableName}[${ma}.y],   ${this.position.associatedVariableName}[${ma}.z]), 
                                    vec2(${dpdx}[${ma}.y],${dpdx}[${ma}.z]), 
                                    vec2(${dpdy}[${ma}.y],${dpdy}[${ma}.z]) );
            vec4 ${y} = textureGrad( ${samplerYName}, vec2(   ${this.position.associatedVariableName}[${me}.y],   ${this.position.associatedVariableName}[${me}.z]), 
                                    vec2(${dpdx}[${me}.y],${dpdx}[${me}.z]),
                                    vec2(${dpdy}[${me}.y],${dpdy}[${me}.z]) );
            
            // blend factors
            vec2 ${w} = vec2(${n}[${ma}.x],${n}[${me}.x]);
            // make local support
            ${w} = clamp( (${w}-0.5773)/(1.0-0.5773), 0.0, 1.0 );
            // shape transition
            ${w} = pow( ${w}, vec2(${sharpness}/8.0) );
            // blend and return
            vec4 ${this._tempTextureRead} = (${x}*${w}.x + ${y}*${w}.y) / (${w}.x + ${w}.y);
        `;}}(0,typeStore/* RegisterClass */.H)("BABYLON.BiPlanarBlock", BiPlanarBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/matrixDeterminantBlock.js
class MatrixDeterminantBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Matrix), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);}getClassName() {return "MatrixDeterminantBlock";}get input() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this.output,input = this.input;return state.compilationString += this._declareOutput(output, state) + `${output.associatedVariableName} = determinant(${input.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.MatrixDeterminantBlock", MatrixDeterminantBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/matrixTransposeBlock.js
class MatrixTransposeBlock extends NodeMaterialBlock {constructor(name) {super(name, NodeMaterialBlockTargets.Neutral), this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Matrix), this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix);}getClassName() {return "MatrixTransposeBlock";}get input() {return this._inputs[0];}get output() {return this._outputs[0];}_buildBlock(state) {super._buildBlock(state);const output = this.output,input = this.input;return state.compilationString += this._declareOutput(output, state) + `${output.associatedVariableName} = transpose(${input.associatedVariableName});\r\n`, this;}}(0,typeStore/* RegisterClass */.H)("BABYLON.MatrixTransposeBlock", MatrixTransposeBlock);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Blocks/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Optimizers/nodeMaterialOptimizer.js
class NodeMaterialOptimizer {optimize() {}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/Optimizers/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Node/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/guid.js
var guid = __webpack_require__("./node_modules/@babylonjs/core/Misc/guid.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/shadowDepthWrapper.js
class MapMap {constructor() {this.mm = new Map();}get(a, b) {const m = this.mm.get(a);return void 0 === m ? void 0 : m.get(b);}set(a, b, v) {let m = this.mm.get(a);m === void 0 && this.mm.set(a, m = new Map()), m.set(b, v);}}class ShadowDepthWrapper {get standalone() {var _a, _b;return !(null === (_b = null === (_a = this._options) || void 0 === _a ? void 0 : _a.standalone) || void 0 === _b) && _b;}get baseMaterial() {return this._baseMaterial;}get doNotInjectCode() {var _a, _b;return !(null === (_b = null === (_a = this._options) || void 0 === _a ? void 0 : _a.doNotInjectCode) || void 0 === _b) && _b;}constructor(baseMaterial, scene, options) {this._baseMaterial = baseMaterial, this._scene = null !== scene && void 0 !== scene ? scene : engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, this._options = options, this._subMeshToEffect = new Map(), this._subMeshToDepthWrapper = new MapMap(), this._meshes = new Map(), this._onEffectCreatedObserver = this._baseMaterial.onEffectCreatedObservable.add((params) => {var _a;const mesh = null === (_a = params.subMesh) || void 0 === _a ? void 0 : _a.getMesh();mesh && !this._meshes.has(mesh) && this._meshes.set(mesh, mesh.onDisposeObservable.add((mesh) => {const iterator = this._subMeshToEffect.keys();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const subMesh = key.value;(null === subMesh || void 0 === subMesh ? void 0 : subMesh.getMesh()) === mesh && (this._subMeshToEffect.delete(subMesh), this._subMeshToDepthWrapper.mm.delete(subMesh));}})), this._subMeshToEffect.set(params.subMesh, [params.effect, this._scene.getEngine().currentRenderPassId]), this._subMeshToDepthWrapper.mm.delete(params.subMesh);});}getEffect(subMesh, shadowGenerator, passIdForDrawWrapper) {var _a;const entry = null === (_a = this._subMeshToDepthWrapper.mm.get(subMesh)) || void 0 === _a ? void 0 : _a.get(shadowGenerator);if (!entry) return null;let drawWrapper = entry.drawWrapper[passIdForDrawWrapper];return drawWrapper || (drawWrapper = entry.drawWrapper[passIdForDrawWrapper] = new Materials_drawWrapper/* DrawWrapper */.q(this._scene.getEngine()), drawWrapper.setEffect(entry.mainDrawWrapper.effect, entry.mainDrawWrapper.defines)), drawWrapper;}isReadyForSubMesh(subMesh, defines, shadowGenerator, useInstances, passIdForDrawWrapper) {var _a, _b;return (!this.standalone || this._baseMaterial.isReadyForSubMesh(subMesh.getMesh(), subMesh, useInstances)) && !(null === (_b = null === (_a = this._makeEffect(subMesh, defines, shadowGenerator, passIdForDrawWrapper)) || void 0 === _a ? void 0 : _a.isReady()) || void 0 === _b) && _b;}dispose() {this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver), this._onEffectCreatedObserver = null;const iterator = this._meshes.entries();for (let entry = iterator.next(); !0 !== entry.done; entry = iterator.next()) {const [mesh, observer] = entry.value;mesh.onDisposeObservable.remove(observer);}}_makeEffect(subMesh, defines, shadowGenerator, passIdForDrawWrapper) {var _a, _b, _c;const engine = this._scene.getEngine(),origEffectAndRenderPassId = this._subMeshToEffect.get(subMesh);if (!origEffectAndRenderPassId) return null;const [origEffect, origRenderPassId] = origEffectAndRenderPassId;let params = this._subMeshToDepthWrapper.get(subMesh, shadowGenerator);if (!params) {const mainDrawWrapper = new Materials_drawWrapper/* DrawWrapper */.q(engine);mainDrawWrapper.defines = null !== (_b = null === (_a = subMesh._getDrawWrapper(origRenderPassId)) || void 0 === _a ? void 0 : _a.defines) && void 0 !== _b ? _b : null, params = { drawWrapper: [], mainDrawWrapper, depthDefines: "", token: (0,guid/* RandomGUID */.f)() }, params.drawWrapper[passIdForDrawWrapper] = mainDrawWrapper, this._subMeshToDepthWrapper.set(subMesh, shadowGenerator, params);}const join = defines.join("\n");if (params.mainDrawWrapper.effect && join === params.depthDefines) return params.mainDrawWrapper.effect;params.depthDefines = join;const uniforms = origEffect.getUniformNames().slice();let vertexCode = origEffect.vertexSourceCodeBeforeMigration,fragmentCode = origEffect.fragmentSourceCodeBeforeMigration;if (!this.doNotInjectCode) {const vertexNormalBiasCode = this._options && this._options.remappedVariables ? `#include<shadowMapVertexNormalBias>(${this._options.remappedVariables.join(",")})` : Materials_effect/* Effect.IncludesShadersStore.shadowMapVertexNormalBias */.Q.IncludesShadersStore.shadowMapVertexNormalBias,vertexMetricCode = this._options && this._options.remappedVariables ? `#include<shadowMapVertexMetric>(${this._options.remappedVariables.join(",")})` : Materials_effect/* Effect.IncludesShadersStore.shadowMapVertexMetric */.Q.IncludesShadersStore.shadowMapVertexMetric,fragmentSoftTransparentShadow = this._options && this._options.remappedVariables ? `#include<shadowMapFragmentSoftTransparentShadow>(${this._options.remappedVariables.join(",")})` : Materials_effect/* Effect.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow */.Q.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow,fragmentBlockCode = Materials_effect/* Effect.IncludesShadersStore.shadowMapFragment */.Q.IncludesShadersStore.shadowMapFragment;vertexCode = vertexCode.replace(/void\s+?main/g, Materials_effect/* Effect.IncludesShadersStore.shadowMapVertexExtraDeclaration */.Q.IncludesShadersStore.shadowMapVertexExtraDeclaration + "\r\nvoid main"), vertexCode = vertexCode.replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g, vertexNormalBiasCode), vertexCode = -1 === vertexCode.indexOf("#define SHADOWDEPTH_METRIC") ? vertexCode.replace(/}\s*$/g, vertexMetricCode + "\r\n}") : vertexCode.replace(/#define SHADOWDEPTH_METRIC/g, vertexMetricCode), vertexCode = vertexCode.replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g, "");const hasLocationForSoftTransparentShadow = 0 <= fragmentCode.indexOf("#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW") || 0 <= fragmentCode.indexOf("#define CUSTOM_FRAGMENT_BEFORE_FOG"),hasLocationForFragment = -1 !== fragmentCode.indexOf("#define SHADOWDEPTH_FRAGMENT");let fragmentCodeToInjectAtEnd = "";hasLocationForSoftTransparentShadow ? fragmentCode = fragmentCode.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g, fragmentSoftTransparentShadow) : fragmentCodeToInjectAtEnd = fragmentSoftTransparentShadow + "\r\n", fragmentCode = fragmentCode.replace(/void\s+?main/g, Materials_effect/* Effect.IncludesShadersStore.shadowMapFragmentExtraDeclaration */.Q.IncludesShadersStore.shadowMapFragmentExtraDeclaration + "\r\nvoid main"), hasLocationForFragment ? fragmentCode = fragmentCode.replace(/#define SHADOWDEPTH_FRAGMENT/g, fragmentBlockCode) : fragmentCodeToInjectAtEnd += fragmentBlockCode + "\r\n", fragmentCodeToInjectAtEnd && (fragmentCode = fragmentCode.replace(/}\s*$/g, fragmentCodeToInjectAtEnd + "}")), uniforms.push("biasAndScaleSM", "depthValuesSM", "lightDataSM", "softTransparentShadowSM");}params.mainDrawWrapper.effect = engine.createEffect({ vertexSource: vertexCode, fragmentSource: fragmentCode, vertexToken: params.token, fragmentToken: params.token }, { attributes: origEffect.getAttributesNames(), uniformsNames: uniforms, uniformBuffersNames: origEffect.getUniformBuffersNames(), samplers: origEffect.getSamplers(), defines: join + "\n" + origEffect.defines.replace("#define SHADOWS", "").replace(/#define SHADOW\d/g, ""), indexParameters: origEffect.getIndexParameters() }, engine);for (let id = 0; id < params.drawWrapper.length; ++id) id !== passIdForDrawWrapper && (null === (_c = params.drawWrapper[id]) || void 0 === _c ? void 0 : _c.setEffect(params.mainDrawWrapper.effect, params.mainDrawWrapper.defines));return params.mainDrawWrapper.effect;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialPluginBase.js
var materialPluginBase = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginBase.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialPluginManager.js
var materialPluginManager = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginManager.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialPluginEvent.js
var materialPluginEvent = __webpack_require__("./node_modules/@babylonjs/core/Materials/materialPluginEvent.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.js
var material_detailMapConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrBRDFConfiguration.js
var pbrBRDFConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/PBR/pbrBRDFConfiguration.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/materialPluginFactoryExport.js
function createPBRAnisotropicPlugin(material) {return material instanceof pbrBaseMaterial/* PBRBaseMaterial */.m ? new pbrAnisotropicConfiguration/* PBRAnisotropicConfiguration */.u(material) : null;}function createPBRBRDFPlugin(material) {return material instanceof pbrBaseMaterial/* PBRBaseMaterial */.m ? new pbrBRDFConfiguration/* PBRBRDFConfiguration */.d(material) : null;}function createPBRClearCoatPlugin(material) {return material instanceof pbrBaseMaterial/* PBRBaseMaterial */.m ? new pbrClearCoatConfiguration/* PBRClearCoatConfiguration */.Y(material) : null;}function createPBRIridescencePlugin(material) {return material instanceof pbrBaseMaterial/* PBRBaseMaterial */.m ? new pbrIridescenceConfiguration/* PBRIridescenceConfiguration */.B(material) : null;}function createPBRSheenPlugin(material) {return material instanceof pbrBaseMaterial/* PBRBaseMaterial */.m ? new pbrSheenConfiguration/* PBRSheenConfiguration */.B(material) : null;}function createPBRSubSurfacePlugin(material) {return material instanceof pbrBaseMaterial/* PBRBaseMaterial */.m ? new pbrSubSurfaceConfiguration/* PBRSubSurfaceConfiguration */.u(material) : null;}function createDetailMapPlugin(material) {return material instanceof pbrBaseMaterial/* PBRBaseMaterial */.m || material instanceof standardMaterial/* StandardMaterial */.K ? new material_detailMapConfiguration/* DetailMapConfiguration */.p(material) : null;}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.functions.js
var math_functions = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.functions.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Maths/math.polar.js
class Polar {constructor(radius, theta) {this.radius = radius, this.theta = theta;}getClassName() {return "Polar";}toString() {return JSON.stringify(this);}asArray() {return [this.radius, this.theta];}addToRef(polar, ref) {return ref.radius = this.radius + polar.radius, ref.theta = this.theta + polar.theta, ref;}add(polar) {const ref = new Polar(0, 0);return this.addToRef(polar, ref), ref;}addInPlace(polar) {return this.addToRef(polar, this), this;}addInPlaceFromFloats(radius, theta) {return this.radius += radius, this.theta += theta, this;}subtractToRef(polar, ref) {return ref.radius = this.radius - polar.radius, ref.theta = this.theta - polar.theta, ref;}subtract(polar) {const ref = new Polar(0, 0);return this.subtractToRef(polar, ref), ref;}subtractInPlace(polar) {return this.subtractToRef(polar, this), this;}subtractFromFloatsToRef(radius, theta, ref) {return ref.radius = this.radius - radius, ref.theta = this.theta - theta, ref;}subtractFromFloats(radius, theta) {const ref = new Polar(0, 0);return this.subtractFromFloatsToRef(radius, theta, ref), ref;}multiplyToRef(polar, ref) {return ref.radius = this.radius * polar.radius, ref.theta = this.theta * polar.theta, ref;}multiply(polar) {const ref = new Polar(0, 0);return this.multiplyToRef(polar, ref), ref;}multiplyInPlace(polar) {return this.multiplyToRef(polar, this), this;}divideToRef(polar, ref) {return ref.radius = this.radius / polar.radius, ref.theta = this.theta / polar.theta, ref;}divide(polar) {const ref = new Polar(0, 0);return this.divideToRef(polar, ref), ref;}divideInPlace(polar) {return this.divideToRef(polar, this), this;}clone() {return new Polar(this.radius, this.theta);}copyFrom(source) {return this.radius = source.radius, this.theta = source.theta, this;}copyFromFloats(radius, theta) {return this.radius = radius, this.theta = theta, this;}scaleToRef(scale, ref) {return ref.radius = this.radius * scale, ref.theta = this.theta * scale, ref;}scale(scale) {const ref = new Polar(0, 0);return this.scaleToRef(scale, ref), ref;}scaleInPlace(scale) {return this.scaleToRef(scale, this), this;}set(radius, theta) {return this.radius = radius, this.theta = theta, this;}setAll(value) {return this.set(value, value), this;}toVector2ToRef(ref) {const x = this.radius * Math.cos(this.theta),y = this.radius * Math.sin(this.theta);return ref.set(x, y), ref;}toVector2() {const ref = new math_vector/* Vector2 */.FM(0, 0);return this.toVector2ToRef(ref);}static FromVector2ToRef(v, ref) {const theta = Math.sign(v.y) * Math.acos(v.x / v.length());return ref.radius = v.length(), ref.theta = theta, ref;}static FromVector2(v) {const polar = new Polar(0, 0);return Polar.FromVector2ToRef(v, polar), polar;}static FromArray(array) {return new Polar(array[0], array[1]);}}class Spherical {constructor(radius, theta, phi) {this.radius = radius, this.theta = theta, this.phi = phi;}getClassName() {return "Spherical";}toString() {return JSON.stringify(this);}asArray() {return [this.radius, this.theta, this.phi];}addToRef(spherical, ref) {return ref.radius = this.radius + spherical.radius, ref.theta = this.theta + spherical.theta, ref.phi = this.phi + spherical.phi, ref;}add(spherical) {const ref = new Spherical(0, 0, 0);return this.addToRef(spherical, ref), ref;}addInPlace(spherical) {return this.addToRef(spherical, this), this;}addInPlaceFromFloats(radius, theta, phi) {return this.radius += radius, this.theta += theta, this.phi += phi, this;}subtractToRef(spherical, ref) {return ref.radius = this.radius - spherical.radius, ref.theta = this.theta - spherical.theta, ref.phi = this.phi - spherical.phi, ref;}subtract(spherical) {const ref = new Spherical(0, 0, 0);return this.subtractToRef(spherical, ref), ref;}subtractInPlace(spherical) {return this.subtractToRef(spherical, this), this;}subtractFromFloatsToRef(radius, theta, phi, ref) {return ref.radius = this.radius - radius, ref.theta = this.theta - theta, ref.phi = this.phi - phi, ref;}subtractFromFloats(radius, theta, phi) {const ref = new Spherical(0, 0, 0);return this.subtractFromFloatsToRef(radius, theta, phi, ref), ref;}multiplyToRef(spherical, ref) {return ref.radius = this.radius * spherical.radius, ref.theta = this.theta * spherical.theta, ref.phi = this.phi * spherical.phi, ref;}multiply(spherical) {const ref = new Spherical(0, 0, 0);return this.multiplyToRef(spherical, ref), ref;}multiplyInPlace(spherical) {return this.multiplyToRef(spherical, this), this;}divideToRef(spherical, ref) {return ref.radius = this.radius / spherical.radius, ref.theta = this.theta / spherical.theta, ref.phi = this.phi / spherical.phi, ref;}divide(spherical) {const ref = new Spherical(0, 0, 0);return this.divideToRef(spherical, ref), ref;}divideInPlace(spherical) {return this.divideToRef(spherical, this), this;}clone() {return new Spherical(this.radius, this.theta, this.phi);}copyFrom(source) {return this.radius = source.radius, this.theta = source.theta, this.phi = source.phi, this;}copyFromFloats(radius, theta, phi) {return this.radius = radius, this.theta = theta, this.phi = phi, this;}scaleToRef(scale, ref) {return ref.radius = this.radius * scale, ref.theta = this.theta * scale, ref.phi = this.phi * scale, ref;}scale(scale) {const ref = new Spherical(0, 0, 0);return this.scaleToRef(scale, ref), ref;}scaleInPlace(scale) {return this.scaleToRef(scale, this), this;}set(radius, theta, phi) {return this.radius = radius, this.theta = theta, this.phi = phi, this;}setAll(value) {return this.set(value, value, value), this;}toVector3ToRef(ref) {const x = this.radius * Math.sin(this.theta) * Math.cos(this.phi),y = this.radius * Math.cos(this.theta),z = this.radius * Math.sin(this.theta) * Math.sin(this.phi);return ref.set(x, y, z), ref;}toVector3() {const ref = new math_vector/* Vector3 */.P(0, 0, 0);return this.toVector3ToRef(ref);}static FromVector3ToRef(vector, ref) {return ref.radius = vector.length(), ref.theta = Math.acos(vector.y / ref.radius), ref.phi = Math.atan2(vector.z, vector.x), ref;}static FromVector3(vector) {const spherical = new Spherical(0, 0, 0);return Spherical.FromVector3ToRef(vector, spherical), spherical;}static FromArray(array) {return new Spherical(array[0], array[1], array[2]);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Maths/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.js
var dracoCompression = __webpack_require__("./node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/Compression/meshoptCompression.js
var meshoptCompression = __webpack_require__("./node_modules/@babylonjs/core/Meshes/Compression/meshoptCompression.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Compression/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/csg.js
let currentCSGMeshId = 0;class Vertex {constructor(pos, normal, uv, vertColor) {this.pos = pos, this.normal = normal, this.uv = uv, this.vertColor = vertColor;}clone() {var _a, _b;return new Vertex(this.pos.clone(), this.normal.clone(), null === (_a = this.uv) || void 0 === _a ? void 0 : _a.clone(), null === (_b = this.vertColor) || void 0 === _b ? void 0 : _b.clone());}flip() {this.normal = this.normal.scale(-1);}interpolate(other, t) {return new Vertex(math_vector/* Vector3.Lerp */.P.Lerp(this.pos, other.pos, t), math_vector/* Vector3.Lerp */.P.Lerp(this.normal, other.normal, t), this.uv && other.uv ? math_vector/* Vector2.Lerp */.FM.Lerp(this.uv, other.uv, t) : void 0, this.vertColor && other.vertColor ? math_color/* Color4.Lerp */.HE.Lerp(this.vertColor, other.vertColor, t) : void 0);}}class Plane {constructor(normal, w) {this.normal = normal, this.w = w;}static FromPoints(a, b, c) {const v0 = c.subtract(a),v1 = b.subtract(a);if (0 === v0.lengthSquared() || 0 === v1.lengthSquared()) return null;const n = math_vector/* Vector3.Normalize */.P.Normalize(math_vector/* Vector3.Cross */.P.Cross(v0, v1));return new Plane(n, math_vector/* Vector3.Dot */.P.Dot(n, a));}clone() {return new Plane(this.normal.clone(), this.w);}flip() {this.normal.scaleInPlace(-1), this.w = -this.w;}splitPolygon(polygon, coplanarFront, coplanarBack, front, back) {const COPLANAR = 0,FRONT = 1,BACK = 2,SPANNING = 3;let polygonType = 0;const types = [];let i, t;for (i = 0; i < polygon.vertices.length; i++) {t = math_vector/* Vector3.Dot */.P.Dot(this.normal, polygon.vertices[i].pos) - this.w;const type = t < -Plane.EPSILON ? BACK : t > Plane.EPSILON ? FRONT : COPLANAR;polygonType |= type, types.push(type);}switch (polygonType) {case COPLANAR:(0 < math_vector/* Vector3.Dot */.P.Dot(this.normal, polygon.plane.normal) ? coplanarFront : coplanarBack).push(polygon);break;case FRONT:front.push(polygon);break;case BACK:back.push(polygon);break;case SPANNING:{const f = [],b = [];for (i = 0; i < polygon.vertices.length; i++) {const j = (i + 1) % polygon.vertices.length,ti = types[i],tj = types[j],vi = polygon.vertices[i],vj = polygon.vertices[j];if (ti !== BACK && f.push(vi), ti !== FRONT && b.push(ti === BACK ? vi : vi.clone()), (ti | tj) === SPANNING) {t = (this.w - math_vector/* Vector3.Dot */.P.Dot(this.normal, vi.pos)) / math_vector/* Vector3.Dot */.P.Dot(this.normal, vj.pos.subtract(vi.pos));const v = vi.interpolate(vj, t);f.push(v), b.push(v.clone());}}let poly;3 <= f.length && (poly = new Polygon(f, polygon.shared), poly.plane && front.push(poly)), 3 <= b.length && (poly = new Polygon(b, polygon.shared), poly.plane && back.push(poly));break;}}}}Plane.EPSILON = 1e-5;class Polygon {constructor(vertices, shared) {this.vertices = vertices, this.shared = shared, this.plane = Plane.FromPoints(vertices[0].pos, vertices[1].pos, vertices[2].pos);}clone() {const vertices = this.vertices.map((v) => v.clone());return new Polygon(vertices, this.shared);}flip() {this.vertices.reverse().map((v) => {v.flip();}), this.plane.flip();}}class csg_Node {constructor(polygons) {this._plane = null, this._front = null, this._back = null, this._polygons = [], polygons && this.build(polygons);}clone() {const node = new csg_Node();return node._plane = this._plane && this._plane.clone(), node._front = this._front && this._front.clone(), node._back = this._back && this._back.clone(), node._polygons = this._polygons.map((p) => p.clone()), node;}invert() {for (let i = 0; i < this._polygons.length; i++) this._polygons[i].flip();this._plane && this._plane.flip(), this._front && this._front.invert(), this._back && this._back.invert();const temp = this._front;this._front = this._back, this._back = temp;}clipPolygons(polygons) {if (!this._plane) return polygons.slice();let front = [],back = [];for (let i = 0; i < polygons.length; i++) this._plane.splitPolygon(polygons[i], front, back, front, back);return this._front && (front = this._front.clipPolygons(front)), back = this._back ? this._back.clipPolygons(back) : [], front.concat(back);}clipTo(bsp) {this._polygons = bsp.clipPolygons(this._polygons), this._front && this._front.clipTo(bsp), this._back && this._back.clipTo(bsp);}allPolygons() {let polygons = this._polygons.slice();return this._front && (polygons = polygons.concat(this._front.allPolygons())), this._back && (polygons = polygons.concat(this._back.allPolygons())), polygons;}build(polygons) {if (polygons.length) {this._plane || (this._plane = polygons[0].plane.clone());const front = [],back = [];for (let i = 0; i < polygons.length; i++) this._plane.splitPolygon(polygons[i], this._polygons, this._polygons, front, back);front.length && (!this._front && (this._front = new csg_Node()), this._front.build(front)), back.length && (!this._back && (this._back = new csg_Node()), this._back.build(back));}}}class CSG {constructor() {this._polygons = [];}static FromMesh(mesh, absolute = !1) {let vertex, normal, uv, position, vertColor, polygon, vertices;const polygons = [];let matrix,meshPosition,meshRotation,meshScaling,meshRotationQuaternion = null,invertWinding = !1;if (mesh instanceof Meshes_mesh/* Mesh */.Kj) mesh.computeWorldMatrix(!0), matrix = mesh.getWorldMatrix(), meshPosition = mesh.position.clone(), meshRotation = mesh.rotation.clone(), mesh.rotationQuaternion && (meshRotationQuaternion = mesh.rotationQuaternion.clone()), meshScaling = mesh.scaling.clone(), mesh.material && absolute && (invertWinding = 0 === mesh.material.sideOrientation);else throw "BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh";const indices = mesh.getIndices(),positions = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),normals = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind),uvs = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind),vertColors = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind),subMeshes = mesh.subMeshes;for (let sm = 0, sml = subMeshes.length; sm < sml; sm++) for (let i = subMeshes[sm].indexStart, il = subMeshes[sm].indexCount + subMeshes[sm].indexStart; i < il; i += 3) {vertices = [];for (let j = 0; 3 > j; j++) {const indexIndices = 0 == j ? i + j : invertWinding ? i + 3 - j : i + j,sourceNormal = new math_vector/* Vector3 */.P(normals[3 * indices[indexIndices]], normals[3 * indices[indexIndices] + 1], normals[3 * indices[indexIndices] + 2]);uvs && (uv = new math_vector/* Vector2 */.FM(uvs[2 * indices[indexIndices]], uvs[2 * indices[indexIndices] + 1])), vertColors && (vertColor = new math_color/* Color4 */.HE(vertColors[4 * indices[indexIndices]], vertColors[4 * indices[indexIndices] + 1], vertColors[4 * indices[indexIndices] + 2], vertColors[4 * indices[indexIndices] + 3]));const sourcePosition = new math_vector/* Vector3 */.P(positions[3 * indices[indexIndices]], positions[3 * indices[indexIndices] + 1], positions[3 * indices[indexIndices] + 2]);position = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(sourcePosition, matrix), normal = math_vector/* Vector3.TransformNormal */.P.TransformNormal(sourceNormal, matrix), vertex = new Vertex(position, normal, uv, vertColor), vertices.push(vertex);}polygon = new Polygon(vertices, { subMeshId: sm, meshId: currentCSGMeshId, materialIndex: subMeshes[sm].materialIndex }), polygon.plane && polygons.push(polygon);}const csg = CSG._FromPolygons(polygons);return csg.matrix = absolute ? math_vector/* Matrix.Identity */.y3.Identity() : matrix, csg.position = absolute ? math_vector/* Vector3.Zero */.P.Zero() : meshPosition, csg.rotation = absolute ? math_vector/* Vector3.Zero */.P.Zero() : meshRotation, csg.scaling = absolute ? math_vector/* Vector3.One */.P.One() : meshScaling, csg.rotationQuaternion = absolute && meshRotationQuaternion ? math_vector/* Quaternion.Identity */._f.Identity() : meshRotationQuaternion, currentCSGMeshId++, csg;}static _FromPolygons(polygons) {const csg = new CSG();return csg._polygons = polygons, csg;}clone() {const csg = new CSG();return csg._polygons = this._polygons.map((p) => p.clone()), csg.copyTransformAttributes(this), csg;}union(csg) {const a = new csg_Node(this.clone()._polygons),b = new csg_Node(csg.clone()._polygons);return a.clipTo(b), b.clipTo(a), b.invert(), b.clipTo(a), b.invert(), a.build(b.allPolygons()), CSG._FromPolygons(a.allPolygons()).copyTransformAttributes(this);}unionInPlace(csg) {const a = new csg_Node(this._polygons),b = new csg_Node(csg._polygons);a.clipTo(b), b.clipTo(a), b.invert(), b.clipTo(a), b.invert(), a.build(b.allPolygons()), this._polygons = a.allPolygons();}subtract(csg) {const a = new csg_Node(this.clone()._polygons),b = new csg_Node(csg.clone()._polygons);return a.invert(), a.clipTo(b), b.clipTo(a), b.invert(), b.clipTo(a), b.invert(), a.build(b.allPolygons()), a.invert(), CSG._FromPolygons(a.allPolygons()).copyTransformAttributes(this);}subtractInPlace(csg) {const a = new csg_Node(this._polygons),b = new csg_Node(csg._polygons);a.invert(), a.clipTo(b), b.clipTo(a), b.invert(), b.clipTo(a), b.invert(), a.build(b.allPolygons()), a.invert(), this._polygons = a.allPolygons();}intersect(csg) {const a = new csg_Node(this.clone()._polygons),b = new csg_Node(csg.clone()._polygons);return a.invert(), b.clipTo(a), b.invert(), a.clipTo(b), b.clipTo(a), a.build(b.allPolygons()), a.invert(), CSG._FromPolygons(a.allPolygons()).copyTransformAttributes(this);}intersectInPlace(csg) {const a = new csg_Node(this._polygons),b = new csg_Node(csg._polygons);a.invert(), b.clipTo(a), b.invert(), a.clipTo(b), b.clipTo(a), a.build(b.allPolygons()), a.invert(), this._polygons = a.allPolygons();}inverse() {const csg = this.clone();return csg.inverseInPlace(), csg;}inverseInPlace() {this._polygons.map((p) => {p.flip();});}copyTransformAttributes(csg) {return this.matrix = csg.matrix, this.position = csg.position, this.rotation = csg.rotation, this.scaling = csg.scaling, this.rotationQuaternion = csg.rotationQuaternion, this;}buildMeshGeometry(name, scene, keepSubMeshes) {const matrix = this.matrix.clone();matrix.invert();const mesh = new Meshes_mesh/* Mesh */.Kj(name, scene),vertices = [],indices = [],normals = [];let uvs = null,vertColors = null;const vertex = math_vector/* Vector3.Zero */.P.Zero(),normal = math_vector/* Vector3.Zero */.P.Zero(),uv = math_vector/* Vector2.Zero */.FM.Zero(),vertColor = new math_color/* Color4 */.HE(0, 0, 0, 0),polygons = this._polygons,polygonIndices = [0, 0, 0];let polygon;const vertice_dict = {};let vertex_idx,currentIndex = 0;const subMeshDict = {};let subMeshObj;keepSubMeshes && polygons.sort((a, b) => a.shared.meshId === b.shared.meshId ? a.shared.subMeshId - b.shared.subMeshId : a.shared.meshId - b.shared.meshId);for (let i = 0, il = polygons.length; i < il; i++) {polygon = polygons[i], subMeshDict[polygon.shared.meshId] || (subMeshDict[polygon.shared.meshId] = {}), subMeshDict[polygon.shared.meshId][polygon.shared.subMeshId] || (subMeshDict[polygon.shared.meshId][polygon.shared.subMeshId] = { indexStart: +Infinity, indexEnd: -Infinity, materialIndex: polygon.shared.materialIndex }), subMeshObj = subMeshDict[polygon.shared.meshId][polygon.shared.subMeshId];for (let j = 2, jl = polygon.vertices.length; j < jl; j++) {polygonIndices[0] = 0, polygonIndices[1] = j - 1, polygonIndices[2] = j;for (let k = 0; 3 > k; k++) {vertex.copyFrom(polygon.vertices[polygonIndices[k]].pos), normal.copyFrom(polygon.vertices[polygonIndices[k]].normal), polygon.vertices[polygonIndices[k]].uv && (!uvs && (uvs = []), uv.copyFrom(polygon.vertices[polygonIndices[k]].uv)), polygon.vertices[polygonIndices[k]].vertColor && (!vertColors && (vertColors = []), vertColor.copyFrom(polygon.vertices[polygonIndices[k]].vertColor));const localVertex = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(vertex, matrix),localNormal = math_vector/* Vector3.TransformNormal */.P.TransformNormal(normal, matrix);vertex_idx = vertice_dict[localVertex.x + "," + localVertex.y + "," + localVertex.z];let areUvsDifferent = !1;uvs && uvs[2 * vertex_idx] !== uv.x && uvs[2 * vertex_idx + 1] !== uv.y && (areUvsDifferent = !0);let areColorsDifferent = !1;vertColors && vertColors[4 * vertex_idx] !== vertColor.r && vertColors[4 * vertex_idx + 1] !== vertColor.g && vertColors[4 * vertex_idx + 2] !== vertColor.b && vertColors[4 * vertex_idx + 3] !== vertColor.a && (areColorsDifferent = !0), ("undefined" == typeof vertex_idx || normals[3 * vertex_idx] !== localNormal.x || normals[3 * vertex_idx + 1] !== localNormal.y || normals[3 * vertex_idx + 2] !== localNormal.z || areUvsDifferent || areColorsDifferent) && (vertices.push(localVertex.x, localVertex.y, localVertex.z), uvs && uvs.push(uv.x, uv.y), normals.push(normal.x, normal.y, normal.z), vertColors && vertColors.push(vertColor.r, vertColor.g, vertColor.b, vertColor.a), vertex_idx = vertice_dict[localVertex.x + "," + localVertex.y + "," + localVertex.z] = vertices.length / 3 - 1), indices.push(vertex_idx), subMeshObj.indexStart = Math.min(currentIndex, subMeshObj.indexStart), subMeshObj.indexEnd = Math.max(currentIndex, subMeshObj.indexEnd), currentIndex++;}}}if (mesh.setVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, vertices), mesh.setVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, normals), uvs && mesh.setVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, uvs), vertColors && mesh.setVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, vertColors), mesh.setIndices(indices, null), keepSubMeshes) {let materialMaxIndex,materialIndexOffset = 0;for (const m in mesh.subMeshes = [], subMeshDict) {for (const sm in materialMaxIndex = -1, subMeshDict[m]) subMeshObj = subMeshDict[m][sm], subMesh/* SubMesh.CreateFromIndices */.P.CreateFromIndices(subMeshObj.materialIndex + materialIndexOffset, subMeshObj.indexStart, subMeshObj.indexEnd - subMeshObj.indexStart + 1, mesh), materialMaxIndex = Math.max(subMeshObj.materialIndex, materialMaxIndex);materialIndexOffset += ++materialMaxIndex;}}return mesh;}toMesh(name, material = null, scene, keepSubMeshes) {const mesh = this.buildMeshGeometry(name, scene, keepSubMeshes);return mesh.material = material, mesh.position.copyFrom(this.position), mesh.rotation.copyFrom(this.rotation), this.rotationQuaternion && (mesh.rotationQuaternion = this.rotationQuaternion.clone()), mesh.scaling.copyFrom(this.scaling), mesh.computeWorldMatrix(!0), mesh;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/goldbergMesh.js
Meshes_mesh/* Mesh._GoldbergMeshParser */.Kj._GoldbergMeshParser = (parsedMesh, scene) => GoldbergMesh.Parse(parsedMesh, scene);class GoldbergMesh extends Meshes_mesh/* Mesh */.Kj {constructor() {super(...arguments), this.goldbergData = { faceColors: [], faceCenters: [], faceZaxis: [], faceXaxis: [], faceYaxis: [], nbSharedFaces: 0, nbUnsharedFaces: 0, nbFaces: 0, nbFacesAtPole: 0, adjacentFaces: [] };}relatedGoldbergFace(poleOrShared, fromPole) {return void 0 === fromPole ? (poleOrShared > this.goldbergData.nbUnsharedFaces - 1 && (logger/* Logger.Warn */.Y.Warn("Maximum number of unshared faces used"), poleOrShared = this.goldbergData.nbUnsharedFaces - 1), this.goldbergData.nbUnsharedFaces + poleOrShared) : (11 < poleOrShared && (logger/* Logger.Warn */.Y.Warn("Last pole used"), poleOrShared = 11), fromPole > this.goldbergData.nbFacesAtPole - 1 && (logger/* Logger.Warn */.Y.Warn("Maximum number of faces at a pole used"), fromPole = this.goldbergData.nbFacesAtPole - 1), 12 + poleOrShared * this.goldbergData.nbFacesAtPole + fromPole);}_changeGoldbergFaceColors(colorRange) {for (let i = 0; i < colorRange.length; i++) {const min = colorRange[i][0],max = colorRange[i][1],col = colorRange[i][2];for (let f = min; f < max + 1; f++) this.goldbergData.faceColors[f] = col;}const newCols = [];for (let f = 0; 12 > f; f++) for (let i = 0; 5 > i; i++) newCols.push(this.goldbergData.faceColors[f].r, this.goldbergData.faceColors[f].g, this.goldbergData.faceColors[f].b, this.goldbergData.faceColors[f].a);for (let f = 12; f < this.goldbergData.faceColors.length; f++) for (let i = 0; 6 > i; i++) newCols.push(this.goldbergData.faceColors[f].r, this.goldbergData.faceColors[f].g, this.goldbergData.faceColors[f].b, this.goldbergData.faceColors[f].a);return newCols;}setGoldbergFaceColors(colorRange) {const newCols = this._changeGoldbergFaceColors(colorRange);this.setVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, newCols);}updateGoldbergFaceColors(colorRange) {const newCols = this._changeGoldbergFaceColors(colorRange);this.updateVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, newCols);}_changeGoldbergFaceUVs(uvRange) {const uvs = this.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind);for (let i = 0; i < uvRange.length; i++) {const min = uvRange[i][0],max = uvRange[i][1],center = uvRange[i][2],radius = uvRange[i][3],angle = uvRange[i][4],points5 = [],points6 = [];let u, v;for (let p = 0; 5 > p; p++) u = center.x + radius * Math.cos(angle + p * Math.PI / 2.5), v = center.y + radius * Math.sin(angle + p * Math.PI / 2.5), 0 > u && (u = 0), 1 < u && (u = 1), points5.push(u, v);for (let p = 0; 6 > p; p++) u = center.x + radius * Math.cos(angle + p * Math.PI / 3), v = center.y + radius * Math.sin(angle + p * Math.PI / 3), 0 > u && (u = 0), 1 < u && (u = 1), points6.push(u, v);for (let f = min; f < Math.min(12, max + 1); f++) for (let p = 0; 5 > p; p++) uvs[10 * f + 2 * p] = points5[2 * p], uvs[10 * f + 2 * p + 1] = points5[2 * p + 1];for (let f = Math.max(12, min); f < max + 1; f++) for (let p = 0; 6 > p; p++) uvs[12 * f - 24 + 2 * p] = points6[2 * p], uvs[12 * f - 23 + 2 * p] = points6[2 * p + 1];}return uvs;}setGoldbergFaceUVs(uvRange) {const newUVs = this._changeGoldbergFaceUVs(uvRange);this.setVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, newUVs);}updateGoldbergFaceUVs(uvRange) {const newUVs = this._changeGoldbergFaceUVs(uvRange);this.updateVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, newUVs);}placeOnGoldbergFaceAt(mesh, face, position) {const orientation = math_vector/* Vector3.RotationFromAxis */.P.RotationFromAxis(this.goldbergData.faceXaxis[face], this.goldbergData.faceYaxis[face], this.goldbergData.faceZaxis[face]);mesh.rotation = orientation, mesh.position = this.goldbergData.faceCenters[face].add(this.goldbergData.faceXaxis[face].scale(position.x)).add(this.goldbergData.faceYaxis[face].scale(position.y)).add(this.goldbergData.faceZaxis[face].scale(position.z));}serialize(serializationObject) {super.serialize(serializationObject), serializationObject.type = "GoldbergMesh";const goldbergData = { adjacentFaces: this.goldbergData.adjacentFaces, nbSharedFaces: this.goldbergData.nbSharedFaces, nbUnsharedFaces: this.goldbergData.nbUnsharedFaces, nbFaces: this.goldbergData.nbFaces, nbFacesAtPole: this.goldbergData.nbFacesAtPole };if (this.goldbergData.faceColors) {goldbergData.faceColors = [];for (const color of this.goldbergData.faceColors) goldbergData.faceColors.push(color.asArray());}if (this.goldbergData.faceCenters) {goldbergData.faceCenters = [];for (const vector of this.goldbergData.faceCenters) goldbergData.faceCenters.push(vector.asArray());}if (this.goldbergData.faceZaxis) {goldbergData.faceZaxis = [];for (const vector of this.goldbergData.faceZaxis) goldbergData.faceZaxis.push(vector.asArray());}if (this.goldbergData.faceYaxis) {goldbergData.faceYaxis = [];for (const vector of this.goldbergData.faceYaxis) goldbergData.faceYaxis.push(vector.asArray());}if (this.goldbergData.faceXaxis) {goldbergData.faceXaxis = [];for (const vector of this.goldbergData.faceXaxis) goldbergData.faceXaxis.push(vector.asArray());}serializationObject.goldbergData = goldbergData;}static Parse(parsedMesh, scene) {const goldbergData = parsedMesh.goldbergData;goldbergData.faceColors = goldbergData.faceColors.map((el) => math_color/* Color4.FromArray */.HE.FromArray(el)), goldbergData.faceCenters = goldbergData.faceCenters.map((el) => math_vector/* Vector3.FromArray */.P.FromArray(el)), goldbergData.faceZaxis = goldbergData.faceZaxis.map((el) => math_vector/* Vector3.FromArray */.P.FromArray(el)), goldbergData.faceXaxis = goldbergData.faceXaxis.map((el) => math_vector/* Vector3.FromArray */.P.FromArray(el)), goldbergData.faceYaxis = goldbergData.faceYaxis.map((el) => math_vector/* Vector3.FromArray */.P.FromArray(el));const goldberg = new GoldbergMesh(parsedMesh.name, scene);return goldberg.goldbergData = goldbergData, goldberg;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/trailMesh.js
class TrailMesh extends Meshes_mesh/* Mesh */.Kj {constructor(name, generator, scene, diameter = 1, length = 60, autoStart = !0) {super(name, scene), this._sectionPolygonPointsCount = 4, this._running = !1, this._autoStart = autoStart, this._generator = generator, this._diameter = diameter, this._length = length, this._sectionVectors = [], this._sectionNormalVectors = [];for (let i = 0; i < this._sectionPolygonPointsCount; i++) this._sectionVectors[i] = math_vector/* Vector3.Zero */.P.Zero(), this._sectionNormalVectors[i] = math_vector/* Vector3.Zero */.P.Zero();this._createMesh();}getClassName() {return "TrailMesh";}_createMesh() {const data = new mesh_vertexData/* VertexData */.x(),positions = [],normals = [],indices = [];let meshCenter = math_vector/* Vector3.Zero */.P.Zero();meshCenter = this._generator instanceof abstractMesh/* AbstractMesh */.x && this._generator.hasBoundingInfo ? this._generator.getBoundingInfo().boundingBox.centerWorld : this._generator.position;const alpha = 2 * Math.PI / this._sectionPolygonPointsCount;for (let i = 0; i < this._sectionPolygonPointsCount; i++) positions.push(meshCenter.x + Math.cos(i * alpha) * this._diameter, meshCenter.y + Math.sin(i * alpha) * this._diameter, meshCenter.z);for (let i = 1; i <= this._length; i++) {for (let j = 0; j < this._sectionPolygonPointsCount; j++) positions.push(meshCenter.x + Math.cos(j * alpha) * this._diameter, meshCenter.y + Math.sin(j * alpha) * this._diameter, meshCenter.z);const l = positions.length / 3 - 2 * this._sectionPolygonPointsCount;for (let j = 0; j < this._sectionPolygonPointsCount - 1; j++) indices.push(l + j, l + j + this._sectionPolygonPointsCount, l + j + this._sectionPolygonPointsCount + 1), indices.push(l + j, l + j + this._sectionPolygonPointsCount + 1, l + j + 1);indices.push(l + this._sectionPolygonPointsCount - 1, l + this._sectionPolygonPointsCount - 1 + this._sectionPolygonPointsCount, l + this._sectionPolygonPointsCount), indices.push(l + this._sectionPolygonPointsCount - 1, l + this._sectionPolygonPointsCount, l);}mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(positions, indices, normals), data.positions = positions, data.normals = normals, data.indices = indices, data.applyToMesh(this, !0), this._autoStart && this.start();}start() {this._running || (this._running = !0, this._beforeRenderObserver = this.getScene().onBeforeRenderObservable.add(() => {this.update();}));}stop() {this._beforeRenderObserver && this._running && (this._running = !1, this.getScene().onBeforeRenderObservable.remove(this._beforeRenderObserver));}update() {const positions = this.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),normals = this.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind),wm = this._generator.getWorldMatrix();if (positions && normals) {for (let i = 3 * this._sectionPolygonPointsCount; i < positions.length; i++) positions[i - 3 * this._sectionPolygonPointsCount] = positions[i] - normals[i] / this._length * this._diameter;for (let i = 3 * this._sectionPolygonPointsCount; i < normals.length; i++) normals[i - 3 * this._sectionPolygonPointsCount] = normals[i];const l = positions.length - 3 * this._sectionPolygonPointsCount,alpha = 2 * Math.PI / this._sectionPolygonPointsCount;for (let i = 0; i < this._sectionPolygonPointsCount; i++) this._sectionVectors[i].copyFromFloats(Math.cos(i * alpha) * this._diameter, Math.sin(i * alpha) * this._diameter, 0), this._sectionNormalVectors[i].copyFromFloats(Math.cos(i * alpha), Math.sin(i * alpha), 0), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._sectionVectors[i], wm, this._sectionVectors[i]), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(this._sectionNormalVectors[i], wm, this._sectionNormalVectors[i]);for (let i = 0; i < this._sectionPolygonPointsCount; i++) positions[l + 3 * i] = this._sectionVectors[i].x, positions[l + 3 * i + 1] = this._sectionVectors[i].y, positions[l + 3 * i + 2] = this._sectionVectors[i].z, normals[l + 3 * i] = this._sectionNormalVectors[i].x, normals[l + 3 * i + 1] = this._sectionNormalVectors[i].y, normals[l + 3 * i + 2] = this._sectionNormalVectors[i].z;this.updateVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, positions, !0, !1), this.updateVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, normals, !0, !1);}}clone(name = "", newGenerator) {return new TrailMesh(name, newGenerator === void 0 ? this._generator : newGenerator, this.getScene(), this._diameter, this._length, this._autoStart);}serialize(serializationObject) {super.serialize(serializationObject);}static Parse(parsedMesh, scene) {return new TrailMesh(parsedMesh.name, parsedMesh._generator, scene, parsedMesh._diameter, parsedMesh._length, parsedMesh._autoStart);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/tiledPlaneBuilder.js
function CreateTiledPlaneVertexData(options) {const flipTile = options.pattern || Meshes_mesh/* Mesh.NO_FLIP */.Kj.NO_FLIP,tileWidth = options.tileWidth || options.tileSize || 1,tileHeight = options.tileHeight || options.tileSize || 1,alignH = options.alignHorizontal || 0,alignV = options.alignVertical || 0,width = options.width || options.size || 1,tilesX = Math.floor(width / tileWidth);let offsetX = width - tilesX * tileWidth;const height = options.height || options.size || 1,tilesY = Math.floor(height / tileHeight);let offsetY = height - tilesY * tileHeight;const halfWidth = tileWidth * tilesX / 2,halfHeight = tileHeight * tilesY / 2;let adjustX = 0,adjustY = 0,startX = 0,startY = 0,endX = 0,endY = 0;(0 < offsetX || 0 < offsetY) && (startX = -halfWidth, startY = -halfHeight, endX = halfWidth, endY = halfHeight, alignH === Meshes_mesh/* Mesh.CENTER */.Kj.CENTER ? (offsetX /= 2, startX -= offsetX, endX += offsetX) : alignH === Meshes_mesh/* Mesh.LEFT */.Kj.LEFT ? (endX += offsetX, adjustX = -offsetX / 2) : alignH === Meshes_mesh/* Mesh.RIGHT */.Kj.RIGHT ? (startX -= offsetX, adjustX = offsetX / 2) : void 0, alignV === Meshes_mesh/* Mesh.CENTER */.Kj.CENTER ? (offsetY /= 2, startY -= offsetY, endY += offsetY) : alignV === Meshes_mesh/* Mesh.BOTTOM */.Kj.BOTTOM ? (endY += offsetY, adjustY = -offsetY / 2) : alignV === Meshes_mesh/* Mesh.TOP */.Kj.TOP ? (startY -= offsetY, adjustY = offsetY / 2) : void 0);const positions = [],normals = [],uvBase = [];uvBase[0] = [0, 0, 1, 0, 1, 1, 0, 1], uvBase[1] = [0, 0, 1, 0, 1, 1, 0, 1], (flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW) && (uvBase[1] = [1, 1, 0, 1, 0, 0, 1, 0]), (flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW) && (uvBase[1] = [1, 0, 0, 0, 0, 1, 1, 1]), (flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW) && (uvBase[1] = [0, 1, 1, 1, 1, 0, 0, 0]);let uvs = [];const colors = [],indices = [];let index = 0;for (let y = 0; y < tilesY; y++) for (let x = 0; x < tilesX; x++) positions.push(-halfWidth + x * tileWidth + adjustX, -halfHeight + y * tileHeight + adjustY, 0), positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, -halfHeight + y * tileHeight + adjustY, 0), positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0), positions.push(-halfWidth + x * tileWidth + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0), indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3), uvs = flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE ? uvs.concat(uvBase[(x % 2 + y % 2) % 2]) : flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW ? uvs.concat(uvBase[y % 2]) : uvs.concat(uvBase[0]), colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1), index += 4;if (0 < offsetX || 0 < offsetY) {const partialBottomRow = 0 < offsetY && (alignV === Meshes_mesh/* Mesh.CENTER */.Kj.CENTER || alignV === Meshes_mesh/* Mesh.TOP */.Kj.TOP),partialTopRow = 0 < offsetY && (alignV === Meshes_mesh/* Mesh.CENTER */.Kj.CENTER || alignV === Meshes_mesh/* Mesh.BOTTOM */.Kj.BOTTOM),partialLeftCol = 0 < offsetX && (alignH === Meshes_mesh/* Mesh.CENTER */.Kj.CENTER || alignH === Meshes_mesh/* Mesh.RIGHT */.Kj.RIGHT),partialRightCol = 0 < offsetX && (alignH === Meshes_mesh/* Mesh.CENTER */.Kj.CENTER || alignH === Meshes_mesh/* Mesh.LEFT */.Kj.LEFT);let a,b,c,d,uvPart = [];if (partialBottomRow && partialLeftCol && (positions.push(startX + adjustX, startY + adjustY, 0), positions.push(-halfWidth + adjustX, startY + adjustY, 0), positions.push(-halfWidth + adjustX, startY + offsetY + adjustY, 0), positions.push(startX + adjustX, startY + offsetY + adjustY, 0), indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3), index += 4, a = 1 - offsetX / tileWidth, b = 1 - offsetY / tileHeight, c = 1, d = 1, uvPart = [a, b, c, b, c, d, a, d], flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW && (uvPart = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d]), flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW && (uvPart = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d]), flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW && (uvPart = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d]), uvs = uvs.concat(uvPart), colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), partialBottomRow && partialRightCol && (positions.push(halfWidth + adjustX, startY + adjustY, 0), positions.push(endX + adjustX, startY + adjustY, 0), positions.push(endX + adjustX, startY + offsetY + adjustY, 0), positions.push(halfWidth + adjustX, startY + offsetY + adjustY, 0), indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3), index += 4, a = 0, b = 1 - offsetY / tileHeight, c = offsetX / tileWidth, d = 1, uvPart = [a, b, c, b, c, d, a, d], (flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE && 0 == tilesX % 2) && (uvPart = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d]), (flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW || flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE && 0 == tilesX % 2) && (uvPart = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d]), (flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE && 0 == tilesX % 2) && (uvPart = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d]), uvs = uvs.concat(uvPart), colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), partialTopRow && partialLeftCol && (positions.push(startX + adjustX, halfHeight + adjustY, 0), positions.push(-halfWidth + adjustX, halfHeight + adjustY, 0), positions.push(-halfWidth + adjustX, endY + adjustY, 0), positions.push(startX + adjustX, endY + adjustY, 0), indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3), index += 4, a = 1 - offsetX / tileWidth, b = 0, c = 1, d = offsetY / tileHeight, uvPart = [a, b, c, b, c, d, a, d], (flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW && 1 == tilesY % 2 || flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE && 0 == tilesY % 1) && (uvPart = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d]), (flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW && 1 == tilesY % 2 || flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE && 0 == tilesY % 2) && (uvPart = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d]), (flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW && 1 == tilesY % 2 || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE && 0 == tilesY % 2) && (uvPart = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d]), uvs = uvs.concat(uvPart), colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), partialTopRow && partialRightCol && (positions.push(halfWidth + adjustX, halfHeight + adjustY, 0), positions.push(endX + adjustX, halfHeight + adjustY, 0), positions.push(endX + adjustX, endY + adjustY, 0), positions.push(halfWidth + adjustX, endY + adjustY, 0), indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3), index += 4, a = 0, b = 0, c = offsetX / tileWidth, d = offsetY / tileHeight, uvPart = [a, b, c, b, c, d, a, d], (flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW && 1 == tilesY % 2 || flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE && 1 == (tilesY + tilesX) % 2) && (uvPart = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d]), (flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW && 1 == tilesY % 2 || flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE && 1 == (tilesY + tilesX) % 2) && (uvPart = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d]), (flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW && 1 == tilesY % 2 || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE && 1 == (tilesY + tilesX) % 2) && (uvPart = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d]), uvs = uvs.concat(uvPart), colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), partialBottomRow) {const uvBaseBR = [];a = 0, b = 1 - offsetY / tileHeight, c = 1, d = 1, uvBaseBR[0] = [a, b, c, b, c, d, a, d], uvBaseBR[1] = [a, b, c, b, c, d, a, d], (flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW) && (uvBaseBR[1] = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d]), (flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW) && (uvBaseBR[1] = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d]), (flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW) && (uvBaseBR[1] = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d]);for (let x = 0; x < tilesX; x++) positions.push(-halfWidth + x * tileWidth + adjustX, startY + adjustY, 0), positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, startY + adjustY, 0), positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, startY + offsetY + adjustY, 0), positions.push(-halfWidth + x * tileWidth + adjustX, startY + offsetY + adjustY, 0), indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3), index += 4, uvs = flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE ? uvs.concat(uvBaseBR[(x + 1) % 2]) : flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW ? uvs.concat(uvBaseBR[1]) : uvs.concat(uvBaseBR[0]), colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);}if (partialTopRow) {const uvBaseTR = [];a = 0, b = 0, c = 1, d = offsetY / tileHeight, uvBaseTR[0] = [a, b, c, b, c, d, a, d], uvBaseTR[1] = [a, b, c, b, c, d, a, d], (flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW) && (uvBaseTR[1] = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d]), (flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW) && (uvBaseTR[1] = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d]), (flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW) && (uvBaseTR[1] = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d]);for (let x = 0; x < tilesX; x++) positions.push(-halfWidth + x * tileWidth + adjustX, endY - offsetY + adjustY, 0), positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, endY - offsetY + adjustY, 0), positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, endY + adjustY, 0), positions.push(-halfWidth + x * tileWidth + adjustX, endY + adjustY, 0), indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3), index += 4, uvs = flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE ? uvs.concat(uvBaseTR[(x + tilesY) % 2]) : flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW ? uvs.concat(uvBaseTR[tilesY % 2]) : uvs.concat(uvBaseTR[0]), colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);}if (partialLeftCol) {const uvBaseLC = [];a = 1 - offsetX / tileWidth, b = 0, c = 1, d = 1, uvBaseLC[0] = [a, b, c, b, c, d, a, d], uvBaseLC[1] = [a, b, c, b, c, d, a, d], (flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW) && (uvBaseLC[1] = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d]), (flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW) && (uvBaseLC[1] = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d]), (flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW) && (uvBaseLC[1] = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d]);for (let y = 0; y < tilesY; y++) positions.push(startX + adjustX, -halfHeight + y * tileHeight + adjustY, 0), positions.push(startX + offsetX + adjustX, -halfHeight + y * tileHeight + adjustY, 0), positions.push(startX + offsetX + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0), positions.push(startX + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0), indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3), index += 4, uvs = flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE ? uvs.concat(uvBaseLC[(y + 1) % 2]) : flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW ? uvs.concat(uvBaseLC[y % 2]) : uvs.concat(uvBaseLC[0]), colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);}if (partialRightCol) {const uvBaseRC = [];a = 0, b = 0, c = offsetX / tileHeight, d = 1, uvBaseRC[0] = [a, b, c, b, c, d, a, d], uvBaseRC[1] = [a, b, c, b, c, d, a, d], (flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW) && (uvBaseRC[1] = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d]), (flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW) && (uvBaseRC[1] = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d]), (flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW) && (uvBaseRC[1] = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d]);for (let y = 0; y < tilesY; y++) positions.push(endX - offsetX + adjustX, -halfHeight + y * tileHeight + adjustY, 0), positions.push(endX + adjustX, -halfHeight + y * tileHeight + adjustY, 0), positions.push(endX + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0), positions.push(endX - offsetX + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0), indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3), index += 4, uvs = flipTile === Meshes_mesh/* Mesh.FLIP_TILE */.Kj.FLIP_TILE || flipTile === Meshes_mesh/* Mesh.ROTATE_TILE */.Kj.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_TILE */.Kj.FLIP_N_ROTATE_TILE ? uvs.concat(uvBaseRC[(y + tilesX) % 2]) : flipTile === Meshes_mesh/* Mesh.FLIP_ROW */.Kj.FLIP_ROW || flipTile === Meshes_mesh/* Mesh.ROTATE_ROW */.Kj.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh.FLIP_N_ROTATE_ROW */.Kj.FLIP_N_ROTATE_ROW ? uvs.concat(uvBaseRC[y % 2]) : uvs.concat(uvBaseRC[0]), colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);}}const sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE;mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs;const totalColors = sideOrientation === mesh_vertexData/* VertexData.DOUBLESIDE */.x.DOUBLESIDE ? colors.concat(colors) : colors;return vertexData.colors = totalColors, vertexData;}function CreateTiledPlane(name, options, scene = null) {const plane = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), plane._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateTiledPlaneVertexData(options);return vertexData.applyToMesh(plane, options.updatable), plane;}const TiledPlaneBuilder = { CreateTiledPlane };mesh_vertexData/* VertexData.CreateTiledPlane */.x.CreateTiledPlane = CreateTiledPlaneVertexData;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/tiledBoxBuilder.js
function CreateTiledBoxVertexData(options) {const nbFaces = 6,faceUV = options.faceUV || [,,,,,,],faceColors = options.faceColors,flipTile = options.pattern || Meshes_mesh/* Mesh.NO_FLIP */.Kj.NO_FLIP,width = options.width || options.size || 1,height = options.height || options.size || 1,depth = options.depth || options.size || 1,tileWidth = options.tileWidth || options.tileSize || 1,tileHeight = options.tileHeight || options.tileSize || 1,alignH = options.alignHorizontal || 0,alignV = options.alignVertical || 0,sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE;for (let f = 0; f < nbFaces; f++) void 0 === faceUV[f] && (faceUV[f] = new math_vector/* Vector4 */.Lt(0, 0, 1, 1)), faceColors && void 0 === faceColors[f] && (faceColors[f] = new math_color/* Color4 */.HE(1, 1, 1, 1));const faceVertexData = [];for (let f = 0; 2 > f; f++) faceVertexData[f] = CreateTiledPlaneVertexData({ pattern: flipTile, tileWidth: tileWidth, tileHeight: tileHeight, width: width, height: height, alignVertical: alignV, alignHorizontal: alignH, sideOrientation: sideOrientation });for (let f = 2; 4 > f; f++) faceVertexData[f] = CreateTiledPlaneVertexData({ pattern: flipTile, tileWidth: tileWidth, tileHeight: tileHeight, width: depth, height: height, alignVertical: alignV, alignHorizontal: alignH, sideOrientation: sideOrientation });let baseAlignV = alignV;alignV === Meshes_mesh/* Mesh.BOTTOM */.Kj.BOTTOM ? baseAlignV = Meshes_mesh/* Mesh.TOP */.Kj.TOP : alignV === Meshes_mesh/* Mesh.TOP */.Kj.TOP && (baseAlignV = Meshes_mesh/* Mesh.BOTTOM */.Kj.BOTTOM);for (let f = 4; 6 > f; f++) faceVertexData[f] = CreateTiledPlaneVertexData({ pattern: flipTile, tileWidth: tileWidth, tileHeight: tileHeight, width: width, height: depth, alignVertical: baseAlignV, alignHorizontal: alignH, sideOrientation: sideOrientation });let positions = [],normals = [],uvs = [],indices = [];const colors = [],facePositions = [],faceNormals = [],newFaceUV = [];let lu = 0,li = 0;for (let f = 0; f < nbFaces; f++) {const len = faceVertexData[f].positions.length;facePositions[f] = [], faceNormals[f] = [];for (let p = 0; p < len / 3; p++) facePositions[f].push(new math_vector/* Vector3 */.P(faceVertexData[f].positions[3 * p], faceVertexData[f].positions[3 * p + 1], faceVertexData[f].positions[3 * p + 2])), faceNormals[f].push(new math_vector/* Vector3 */.P(faceVertexData[f].normals[3 * p], faceVertexData[f].normals[3 * p + 1], faceVertexData[f].normals[3 * p + 2]));lu = faceVertexData[f].uvs.length, newFaceUV[f] = [];for (let i = 0; i < lu; i += 2) newFaceUV[f][i] = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * faceVertexData[f].uvs[i], newFaceUV[f][i + 1] = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * faceVertexData[f].uvs[i + 1], compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV && (newFaceUV[f][i + 1] = 1 - newFaceUV[f][i + 1]);if (uvs = uvs.concat(newFaceUV[f]), indices = indices.concat(faceVertexData[f].indices.map((x) => x + li)), li += facePositions[f].length, faceColors) for (let c = 0; 4 > c; c++) colors.push(faceColors[f].r, faceColors[f].g, faceColors[f].b, faceColors[f].a);}const vec0 = new math_vector/* Vector3 */.P(0, 0, depth / 2),mtrx0 = math_vector/* Matrix.RotationY */.y3.RotationY(Math.PI);positions = facePositions[0].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx0).add(vec0)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), []), normals = faceNormals[0].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx0)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), []), positions = positions.concat(facePositions[1].map((entry) => entry.subtract(vec0)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), [])), normals = normals.concat(faceNormals[1].map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));const vec2 = new math_vector/* Vector3 */.P(width / 2, 0, 0),mtrx2 = math_vector/* Matrix.RotationY */.y3.RotationY(-Math.PI / 2);positions = positions.concat(facePositions[2].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx2).add(vec2)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), [])), normals = normals.concat(faceNormals[2].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx2)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));const mtrx3 = math_vector/* Matrix.RotationY */.y3.RotationY(Math.PI / 2);positions = positions.concat(facePositions[3].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx3).subtract(vec2)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), [])), normals = normals.concat(faceNormals[3].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx3)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));const vec4 = new math_vector/* Vector3 */.P(0, height / 2, 0),mtrx4 = math_vector/* Matrix.RotationX */.y3.RotationX(Math.PI / 2);positions = positions.concat(facePositions[4].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx4).add(vec4)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), [])), normals = normals.concat(faceNormals[4].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx4)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));const mtrx5 = math_vector/* Matrix.RotationX */.y3.RotationX(-Math.PI / 2);positions = positions.concat(facePositions[5].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx5).subtract(vec4)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), [])), normals = normals.concat(faceNormals[5].map((entry) => math_vector/* Vector3.TransformNormal */.P.TransformNormal(entry, mtrx5)).map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), [])), mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs);const vertexData = new mesh_vertexData/* VertexData */.x();if (vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, faceColors) {const totalColors = sideOrientation === mesh_vertexData/* VertexData.DOUBLESIDE */.x.DOUBLESIDE ? colors.concat(colors) : colors;vertexData.colors = totalColors;}return vertexData;}function CreateTiledBox(name, options, scene = null) {const box = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), box._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateTiledBoxVertexData(options);return vertexData.applyToMesh(box, options.updatable), box;}const TiledBoxBuilder = { CreateTiledBox };mesh_vertexData/* VertexData.CreateTiledBox */.x.CreateTiledBox = CreateTiledBoxVertexData;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/torusKnotBuilder.js
function CreateTorusKnotVertexData(options) {const indices = [],positions = [],normals = [],uvs = [],radius = options.radius || 2,tube = options.tube || .5,radialSegments = options.radialSegments || 32,tubularSegments = options.tubularSegments || 32,p = options.p || 2,q = options.q || 3,sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,getPos = (angle) => {const cu = Math.cos(angle),su = Math.sin(angle),quOverP = q / p * angle,cs = Math.cos(quOverP),tz = .5 * (radius * Math.sin(quOverP));return new math_vector/* Vector3 */.P(.5 * (radius * (2 + cs)) * cu, .5 * (radius * (2 + cs) * su), tz);};let i, j;for (i = 0; i <= radialSegments; i++) {const modI = i % radialSegments,u = 2 * (modI / radialSegments) * p * Math.PI,p1 = getPos(u),p2 = getPos(u + .01),tang = p2.subtract(p1);let n = p2.add(p1);const bitan = math_vector/* Vector3.Cross */.P.Cross(tang, n);for (n = math_vector/* Vector3.Cross */.P.Cross(bitan, tang), bitan.normalize(), n.normalize(), j = 0; j < tubularSegments; j++) {const modJ = j % tubularSegments,v = 2 * (modJ / tubularSegments) * Math.PI,cx = -tube * Math.cos(v),cy = tube * Math.sin(v);positions.push(p1.x + cx * n.x + cy * bitan.x), positions.push(p1.y + cx * n.y + cy * bitan.y), positions.push(p1.z + cx * n.z + cy * bitan.z), uvs.push(i / radialSegments), uvs.push(compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - j / tubularSegments : j / tubularSegments);}}for (i = 0; i < radialSegments; i++) for (j = 0; j < tubularSegments; j++) {const jNext = (j + 1) % tubularSegments,a = i * tubularSegments + j,b = (i + 1) * tubularSegments + j,c = (i + 1) * tubularSegments + jNext,d = i * tubularSegments + jNext;indices.push(d), indices.push(b), indices.push(a), indices.push(d), indices.push(c), indices.push(b);}mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(positions, indices, normals), mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreateTorusKnot(name, options = {}, scene) {const torusKnot = new Meshes_mesh/* Mesh */.Kj(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), torusKnot._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateTorusKnotVertexData(options);return vertexData.applyToMesh(torusKnot, options.updatable), torusKnot;}const TorusKnotBuilder = { CreateTorusKnot };mesh_vertexData/* VertexData.CreateTorusKnot */.x.CreateTorusKnot = CreateTorusKnotVertexData, Meshes_mesh/* Mesh.CreateTorusKnot */.Kj.CreateTorusKnot = (name, radius, tube, radialSegments, tubularSegments, p, q, scene, updatable, sideOrientation) => {return CreateTorusKnot(name, { radius, tube, radialSegments, tubularSegments, p, q, sideOrientation, updatable }, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/polygonMesh.js
class IndexedVector2 extends math_vector/* Vector2 */.FM {constructor(original, index) {super(original.x, original.y), this.index = index;}}class PolygonPoints {constructor() {this.elements = [];}add(originalPoints) {const result = [];return originalPoints.forEach((point) => {const newPoint = new IndexedVector2(point, this.elements.length);result.push(newPoint), this.elements.push(newPoint);}), result;}computeBounds() {const lmin = new math_vector/* Vector2 */.FM(this.elements[0].x, this.elements[0].y),lmax = new math_vector/* Vector2 */.FM(this.elements[0].x, this.elements[0].y);return this.elements.forEach((point) => {point.x < lmin.x ? lmin.x = point.x : point.x > lmax.x && (lmax.x = point.x), point.y < lmin.y ? lmin.y = point.y : point.y > lmax.y && (lmax.y = point.y);}), { min: lmin, max: lmax, width: lmax.x - lmin.x, height: lmax.y - lmin.y };}}class polygonMesh_Polygon {static Rectangle(xmin, ymin, xmax, ymax) {return [new math_vector/* Vector2 */.FM(xmin, ymin), new math_vector/* Vector2 */.FM(xmax, ymin), new math_vector/* Vector2 */.FM(xmax, ymax), new math_vector/* Vector2 */.FM(xmin, ymax)];}static Circle(radius, cx = 0, cy = 0, numberOfSides = 32) {const result = [];let angle = 0;const increment = 2 * Math.PI / numberOfSides;for (let i = 0; i < numberOfSides; i++) result.push(new math_vector/* Vector2 */.FM(cx + Math.cos(angle) * radius, cy + Math.sin(angle) * radius)), angle -= increment;return result;}static Parse(input) {const floats = input.split(/[^-+eE.\d]+/).map(parseFloat).filter((val) => !isNaN(val));let i;const result = [];for (i = 0; i < (2147483646 & floats.length); i += 2) result.push(new math_vector/* Vector2 */.FM(floats[i], floats[i + 1]));return result;}static StartingAt(x, y) {return math_path/* Path2.StartingAt */.ZZ.StartingAt(x, y);}}class PolygonMeshBuilder {_addToepoint(points) {for (const p of points) this._epoints.push(p.x, p.y);}constructor(name, contours, scene, earcutInjection = earcut) {this._points = new PolygonPoints(), this._outlinepoints = new PolygonPoints(), this._holes = [], this._epoints = [], this._eholes = [], this.bjsEarcut = earcutInjection, this._name = name, this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;let points;points = contours instanceof math_path/* Path2 */.ZZ ? contours.getPoints() : contours, this._addToepoint(points), this._points.add(points), this._outlinepoints.add(points), "undefined" == typeof this.bjsEarcut && logger/* Logger.Warn */.Y.Warn("Earcut was not found, the polygon will not be built.");}addHole(hole) {this._points.add(hole);const holepoints = new PolygonPoints();return holepoints.add(hole), this._holes.push(holepoints), this._eholes.push(this._epoints.length / 2), this._addToepoint(hole), this;}build(updatable = !1, depth = 0, smoothingThreshold = 2) {const result = new Meshes_mesh/* Mesh */.Kj(this._name, this._scene),vertexData = this.buildVertexData(depth, smoothingThreshold);return result.setVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, vertexData.positions, updatable), result.setVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, vertexData.normals, updatable), result.setVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, vertexData.uvs, updatable), result.setIndices(vertexData.indices), result;}buildVertexData(depth = 0, smoothingThreshold = 2) {const result = new mesh_vertexData/* VertexData */.x(),normals = [],positions = [],uvs = [],bounds = this._points.computeBounds();this._points.elements.forEach((p) => {normals.push(0, 1, 0), positions.push(p.x, 0, p.y), uvs.push((p.x - bounds.min.x) / bounds.width, (p.y - bounds.min.y) / bounds.height);});const indices = [],res = this.bjsEarcut(this._epoints, this._eholes, 2);for (let i = 0; i < res.length; i++) indices.push(res[i]);if (0 < depth) {const positionscount = positions.length / 3;this._points.elements.forEach((p) => {normals.push(0, -1, 0), positions.push(p.x, -depth, p.y), uvs.push(1 - (p.x - bounds.min.x) / bounds.width, 1 - (p.y - bounds.min.y) / bounds.height);});const totalCount = indices.length;for (let i = 0; i < totalCount; i += 3) {const i0 = indices[i + 0],i1 = indices[i + 1],i2 = indices[i + 2];indices.push(i2 + positionscount), indices.push(i1 + positionscount), indices.push(i0 + positionscount);}this._addSide(positions, normals, uvs, indices, bounds, this._outlinepoints, depth, !1, smoothingThreshold), this._holes.forEach((hole) => {this._addSide(positions, normals, uvs, indices, bounds, hole, depth, !0, smoothingThreshold);});}return result.indices = indices, result.positions = positions, result.normals = normals, result.uvs = uvs, result;}_addSide(positions, normals, uvs, indices, bounds, points, depth, flip, smoothingThreshold) {let startIndex = positions.length / 3,ulength = 0;for (let i = 0; i < points.elements.length; i++) {const p = points.elements[i],p1 = points.elements[(i + 1) % points.elements.length];positions.push(p.x, 0, p.y), positions.push(p.x, -depth, p.y), positions.push(p1.x, 0, p1.y), positions.push(p1.x, -depth, p1.y);const p0 = points.elements[(i + points.elements.length - 1) % points.elements.length],p2 = points.elements[(i + 2) % points.elements.length];let vc = new math_vector/* Vector3 */.P(-(p1.y - p.y), 0, p1.x - p.x),vp = new math_vector/* Vector3 */.P(-(p.y - p0.y), 0, p.x - p0.x),vn = new math_vector/* Vector3 */.P(-(p2.y - p1.y), 0, p2.x - p1.x);flip || (vc = vc.scale(-1), vp = vp.scale(-1), vn = vn.scale(-1));const vc_norm = vc.normalizeToNew();let vp_norm = vp.normalizeToNew(),vn_norm = vn.normalizeToNew();const dotp = math_vector/* Vector3.Dot */.P.Dot(vp_norm, vc_norm);vp_norm = dotp > smoothingThreshold ? dotp < math_constants/* Epsilon */.kn - 1 ? new math_vector/* Vector3 */.P(p.x, 0, p.y).subtract(new math_vector/* Vector3 */.P(p1.x, 0, p1.y)).normalize() : vp.add(vc).normalize() : vc_norm;const dotn = math_vector/* Vector3.Dot */.P.Dot(vn, vc);vn_norm = dotn > smoothingThreshold ? dotn < math_constants/* Epsilon */.kn - 1 ? new math_vector/* Vector3 */.P(p1.x, 0, p1.y).subtract(new math_vector/* Vector3 */.P(p.x, 0, p.y)).normalize() : vn.add(vc).normalize() : vc_norm, uvs.push(ulength / bounds.width, 0), uvs.push(ulength / bounds.width, 1), ulength += vc.length(), uvs.push(ulength / bounds.width, 0), uvs.push(ulength / bounds.width, 1), normals.push(vp_norm.x, vp_norm.y, vp_norm.z), normals.push(vp_norm.x, vp_norm.y, vp_norm.z), normals.push(vn_norm.x, vn_norm.y, vn_norm.z), normals.push(vn_norm.x, vn_norm.y, vn_norm.z), flip ? (indices.push(startIndex), indices.push(startIndex + 2), indices.push(startIndex + 1), indices.push(startIndex + 1), indices.push(startIndex + 2), indices.push(startIndex + 3)) : (indices.push(startIndex), indices.push(startIndex + 1), indices.push(startIndex + 2), indices.push(startIndex + 1), indices.push(startIndex + 3), indices.push(startIndex + 2)), startIndex += 4;}}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/polygonBuilder.js
function CreatePolygonVertexData(polygon, sideOrientation, fUV, fColors, frontUVs, backUVs, wrp) {const faceUV = fUV || [,,,],faceColors = fColors,colors = [],wrap = wrp || !1;for (let f = 0; 3 > f; f++) void 0 === faceUV[f] && (faceUV[f] = new math_vector/* Vector4 */.Lt(0, 0, 1, 1)), faceColors && void 0 === faceColors[f] && (faceColors[f] = new math_color/* Color4 */.HE(1, 1, 1, 1));const positions = polygon.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),normals = polygon.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind),uvs = polygon.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind),indices = polygon.getIndices(),startIndex = positions.length / 9;let disp = 0,distX = 0,distZ = 0,dist = 0,totalLen = 0;const cumulate = [0];if (wrap) for (let idx = startIndex; idx < positions.length / 3; idx += 4) distX = positions[3 * (idx + 2)] - positions[3 * idx], distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2], dist = Math.sqrt(distX * distX + distZ * distZ), totalLen += dist, cumulate.push(totalLen);let idx = 0,face = 0;for (let index = 0; index < normals.length; index += 3) .001 > Math.abs(normals[index + 1]) && (face = 1), .001 > Math.abs(normals[index + 1] - 1) && (face = 0), .001 > Math.abs(normals[index + 1] + 1) && (face = 2), idx = index / 3, 1 === face ? (disp = idx - startIndex, uvs[2 * idx] = 1.5 > disp % 4 ? wrap ? faceUV[face].x + (faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)] / totalLen : faceUV[face].x : wrap ? faceUV[face].x + (faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1] / totalLen : faceUV[face].z, uvs[2 * idx + 1] = 0 == disp % 2 ? compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - faceUV[face].w : faceUV[face].w : compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - faceUV[face].y : faceUV[face].y) : (uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z, uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w, compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV && (uvs[2 * idx + 1] = 1 - uvs[2 * idx + 1])), faceColors && colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);const vertexData = new mesh_vertexData/* VertexData */.x();if (vertexData.indices = indices, vertexData.positions = positions, vertexData.normals = normals, vertexData.uvs = uvs, faceColors) {const totalColors = sideOrientation === mesh_vertexData/* VertexData.DOUBLESIDE */.x.DOUBLESIDE ? colors.concat(colors) : colors;vertexData.colors = totalColors;}return vertexData;}function CreatePolygon(name, options, scene = null, earcutInjection = earcut) {options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation);const shape = options.shape,holes = options.holes || [],depth = options.depth || 0,smoothingThreshold = options.smoothingThreshold || 2,contours = [];let hole = [];for (let i = 0; i < shape.length; i++) contours[i] = new math_vector/* Vector2 */.FM(shape[i].x, shape[i].z);contours[0].equalsWithEpsilon(contours[contours.length - 1], 1e-8) && contours.pop();const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, earcutInjection);for (let hNb = 0; hNb < holes.length; hNb++) {hole = [];for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) hole.push(new math_vector/* Vector2 */.FM(holes[hNb][hPoint].x, holes[hNb][hPoint].z));polygonTriangulation.addHole(hole);}const polygon = polygonTriangulation.build(!1, depth, smoothingThreshold);polygon._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);return vertexData.applyToMesh(polygon, options.updatable), polygon;}function ExtrudePolygon(name, options, scene = null, earcutInjection = earcut) {return CreatePolygon(name, options, scene, earcutInjection);}const PolygonBuilder = { ExtrudePolygon, CreatePolygon };mesh_vertexData/* VertexData.CreatePolygon */.x.CreatePolygon = CreatePolygonVertexData, Meshes_mesh/* Mesh.CreatePolygon */.Kj.CreatePolygon = (name, shape, scene, holes, updatable, sideOrientation, earcutInjection = earcut) => {return CreatePolygon(name, { shape: shape, holes: holes, updatable: updatable, sideOrientation: sideOrientation }, scene, earcutInjection);}, Meshes_mesh/* Mesh.ExtrudePolygon */.Kj.ExtrudePolygon = (name, shape, depth, scene, holes, updatable, sideOrientation, earcutInjection = earcut) => {return ExtrudePolygon(name, { shape: shape, holes: holes, depth: depth, updatable: updatable, sideOrientation: sideOrientation }, scene, earcutInjection);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/latheBuilder.js
function CreateLathe(name, options, scene = null) {const arc = options.arc ? 0 >= options.arc || 1 < options.arc ? 1 : options.arc : 1,closed = !(options.closed !== void 0) || options.closed,shape = options.shape,radius = options.radius || 1,tessellation = options.tessellation || 64,clip = options.clip || 0,updatable = options.updatable,sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation),cap = options.cap || Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP,pi2 = 2 * Math.PI,paths = [],invertUV = options.invertUV || !1;let i = 0,p = 0;const step = pi2 / tessellation * arc;let rotated, path;for (i = 0; i <= tessellation - clip; i++) {for (path = [], (cap == Meshes_mesh/* Mesh.CAP_START */.Kj.CAP_START || cap == Meshes_mesh/* Mesh.CAP_ALL */.Kj.CAP_ALL) && (path.push(new math_vector/* Vector3 */.P(0, shape[0].y, 0)), path.push(new math_vector/* Vector3 */.P(Math.cos(i * step) * shape[0].x * radius, shape[0].y, Math.sin(i * step) * shape[0].x * radius))), p = 0; p < shape.length; p++) rotated = new math_vector/* Vector3 */.P(Math.cos(i * step) * shape[p].x * radius, shape[p].y, Math.sin(i * step) * shape[p].x * radius), path.push(rotated);(cap == Meshes_mesh/* Mesh.CAP_END */.Kj.CAP_END || cap == Meshes_mesh/* Mesh.CAP_ALL */.Kj.CAP_ALL) && (path.push(new math_vector/* Vector3 */.P(Math.cos(i * step) * shape[shape.length - 1].x * radius, shape[shape.length - 1].y, Math.sin(i * step) * shape[shape.length - 1].x * radius)), path.push(new math_vector/* Vector3 */.P(0, shape[shape.length - 1].y, 0))), paths.push(path);}const lathe = CreateRibbon(name, { pathArray: paths, closeArray: closed, sideOrientation: sideOrientation, updatable: updatable, invertUV: invertUV, frontUVs: options.frontUVs, backUVs: options.backUVs }, scene);return lathe;}const LatheBuilder = { CreateLathe };Meshes_mesh/* Mesh.CreateLathe */.Kj.CreateLathe = (name, shape, radius, tessellation, scene, updatable, sideOrientation) => {return CreateLathe(name, { shape: shape, radius: radius, tessellation: tessellation, sideOrientation: sideOrientation, updatable: updatable }, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/tubeBuilder.js
function CreateTube(name, options, scene = null) {const path = options.path;let instance = options.instance,radius = 1;void 0 === options.radius ? instance && (radius = instance._creationDataStorage.radius) : radius = options.radius;const tessellation = options.tessellation || 64,radiusFunction = options.radiusFunction || null;let cap = options.cap || Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP;const invertUV = options.invertUV || !1,updatable = options.updatable,sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation);options.arc = options.arc && (0 >= options.arc || 1 < options.arc) ? 1 : options.arc || 1;const tubePathArray = (path, path3D, circlePaths, radius, tessellation, radiusFunction, cap, arc) => {const tangents = path3D.getTangents(),normals = path3D.getNormals(),distances = path3D.getDistances(),pi2 = 2 * Math.PI,radiusFunctionFinal = radiusFunction || (() => radius);let circlePath, rad, normal, rotated;const rotationMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];let index = cap === Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP || cap === Meshes_mesh/* Mesh.CAP_END */.Kj.CAP_END ? 0 : 2;for (let i = 0; i < path.length; i++) {rad = radiusFunctionFinal(i, distances[i]), circlePath = [], normal = normals[i];for (let t = 0; t < tessellation; t++) math_vector/* Matrix.RotationAxisToRef */.y3.RotationAxisToRef(tangents[i], pi2 / tessellation * arc * t, rotationMatrix), rotated = circlePath[t] ? circlePath[t] : math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(normal, rotationMatrix, rotated), rotated.scaleInPlace(rad).addInPlace(path[i]), circlePath[t] = rotated;circlePaths[index] = circlePath, index++;}const capPath = (nbPoints, pathIndex) => {const pointCap = [];for (let i = 0; i < nbPoints; i++) pointCap.push(path[pathIndex]);return pointCap;};switch (cap) {case Meshes_mesh/* Mesh.NO_CAP */.Kj.NO_CAP:break;case Meshes_mesh/* Mesh.CAP_START */.Kj.CAP_START:circlePaths[0] = capPath(tessellation, 0), circlePaths[1] = circlePaths[2].slice(0);break;case Meshes_mesh/* Mesh.CAP_END */.Kj.CAP_END:circlePaths[index] = circlePaths[index - 1].slice(0), circlePaths[index + 1] = capPath(tessellation, path.length - 1);break;case Meshes_mesh/* Mesh.CAP_ALL */.Kj.CAP_ALL:circlePaths[0] = capPath(tessellation, 0), circlePaths[1] = circlePaths[2].slice(0), circlePaths[index] = circlePaths[index - 1].slice(0), circlePaths[index + 1] = capPath(tessellation, path.length - 1);break;default:}return circlePaths;};let path3D, pathArray;if (instance) {const storage = instance._creationDataStorage,arc = options.arc || storage.arc;return path3D = storage.path3D.update(path), pathArray = tubePathArray(path, path3D, storage.pathArray, radius, storage.tessellation, radiusFunction, storage.cap, arc), instance = CreateRibbon("", { pathArray: pathArray, instance: instance }), storage.path3D = path3D, storage.pathArray = pathArray, storage.arc = arc, storage.radius = radius, instance;}path3D = new math_path/* Path3D */.$B(path);cap = 0 > cap || 3 < cap ? 0 : cap, pathArray = tubePathArray(path, path3D, [], radius, tessellation, radiusFunction, cap, options.arc);const tube = CreateRibbon(name, { pathArray: pathArray, closePath: !0, closeArray: !1, updatable: updatable, sideOrientation: sideOrientation, invertUV: invertUV, frontUVs: options.frontUVs, backUVs: options.backUVs }, scene);return tube._creationDataStorage.pathArray = pathArray, tube._creationDataStorage.path3D = path3D, tube._creationDataStorage.tessellation = tessellation, tube._creationDataStorage.cap = cap, tube._creationDataStorage.arc = options.arc, tube._creationDataStorage.radius = radius, tube;}const TubeBuilder = { CreateTube };Meshes_mesh/* Mesh.CreateTube */.Kj.CreateTube = (name, path, radius, tessellation, radiusFunction, cap, scene, updatable, sideOrientation, instance) => {return CreateTube(name, { path: path, radius: radius, tessellation: tessellation, radiusFunction: radiusFunction, arc: 1, cap: cap, updatable: updatable, sideOrientation: sideOrientation, instance: instance }, scene);};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/decalBuilder.js
const xpAxis = new math_vector/* Vector3 */.P(1, 0, 0),xnAxis = new math_vector/* Vector3 */.P(-1, 0, 0),ypAxis = new math_vector/* Vector3 */.P(0, 1, 0),ynAxis = new math_vector/* Vector3 */.P(0, -1, 0),zpAxis = new math_vector/* Vector3 */.P(0, 0, 1),znAxis = new math_vector/* Vector3 */.P(0, 0, -1);class DecalVertex {constructor(position = math_vector/* Vector3.Zero */.P.Zero(), normal = math_vector/* Vector3.Up */.P.Up(), uv = math_vector/* Vector2.Zero */.FM.Zero(), vertexIdx = 0, vertexIdxForBones = 0, localPositionOverride = null, localNormalOverride = null, matrixIndicesOverride = null, matrixWeightsOverride = null) {this.position = position, this.normal = normal, this.uv = uv, this.vertexIdx = vertexIdx, this.vertexIdxForBones = vertexIdxForBones, this.localPositionOverride = localPositionOverride, this.localNormalOverride = localNormalOverride, this.matrixIndicesOverride = matrixIndicesOverride, this.matrixWeightsOverride = matrixWeightsOverride;}clone() {var _a, _b, _c, _d;return new DecalVertex(this.position.clone(), this.normal.clone(), this.uv.clone(), this.vertexIdx, this.vertexIdxForBones, null === (_a = this.localPositionOverride) || void 0 === _a ? void 0 : _a.slice(), null === (_b = this.localNormalOverride) || void 0 === _b ? void 0 : _b.slice(), null === (_c = this.matrixIndicesOverride) || void 0 === _c ? void 0 : _c.slice(), null === (_d = this.matrixWeightsOverride) || void 0 === _d ? void 0 : _d.slice());}}function CreateDecal(name, sourceMesh, options) {const hasSkeleton = !!sourceMesh.skeleton,useLocalComputation = options.localMode || hasSkeleton,meshHasOverridenMaterial = null !== sourceMesh.overrideMaterialSideOrientation && void 0 !== sourceMesh.overrideMaterialSideOrientation,indices = sourceMesh.getIndices(),positions = hasSkeleton ? sourceMesh.getPositionData(!0, !0) : sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),normals = hasSkeleton ? sourceMesh.getNormalsData(!0, !0) : sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind),localPositions = useLocalComputation ? hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind) : positions : null,localNormals = useLocalComputation ? hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind) : normals : null,uvs = sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind),matIndices = hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind) : null,matWeights = hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind) : null,matIndicesExtra = hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer.MatricesIndicesExtraKind */.o.MatricesIndicesExtraKind) : null,matWeightsExtra = hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer.MatricesWeightsExtraKind */.o.MatricesWeightsExtraKind) : null,position = options.position || math_vector/* Vector3.Zero */.P.Zero();let normal = options.normal || math_vector/* Vector3.Up */.P.Up();const size = options.size || math_vector/* Vector3.One */.P.One(),angle = options.angle || 0;if (!normal) {const target = new math_vector/* Vector3 */.P(0, 0, 1),camera = sourceMesh.getScene().activeCamera,cameraWorldTarget = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(target, camera.getWorldMatrix());normal = camera.globalPosition.subtract(cameraWorldTarget);}const yaw = -Math.atan2(normal.z, normal.x) - Math.PI / 2,len = Math.sqrt(normal.x * normal.x + normal.z * normal.z),pitch = Math.atan2(normal.y, len),decalWorldMatrix = math_vector/* Matrix.RotationYawPitchRoll */.y3.RotationYawPitchRoll(yaw, pitch, angle).multiply(math_vector/* Matrix.Translation */.y3.Translation(position.x, position.y, position.z)),inverseDecalWorldMatrix = math_vector/* Matrix.Invert */.y3.Invert(decalWorldMatrix),meshWorldMatrix = sourceMesh.getWorldMatrix(),transformMatrix = meshWorldMatrix.multiply(inverseDecalWorldMatrix),vertexData = new mesh_vertexData/* VertexData */.x();vertexData.indices = [], vertexData.positions = [], vertexData.normals = [], vertexData.uvs = [], vertexData.matricesIndices = hasSkeleton ? [] : null, vertexData.matricesWeights = hasSkeleton ? [] : null, vertexData.matricesIndicesExtra = matIndicesExtra ? [] : null, vertexData.matricesWeightsExtra = matWeightsExtra ? [] : null;let currentVertexDataIndex = 0;const extractDecalVector3 = (indexId) => {const result = new DecalVertex();if (!indices || !positions || !normals) return result;const vertexId = indices[indexId];if (result.vertexIdx = 3 * vertexId, result.vertexIdxForBones = 4 * vertexId, result.position = new math_vector/* Vector3 */.P(positions[3 * vertexId], positions[3 * vertexId + 1], positions[3 * vertexId + 2]), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(result.position, transformMatrix, result.position), result.normal = new math_vector/* Vector3 */.P(normals[3 * vertexId], normals[3 * vertexId + 1], normals[3 * vertexId + 2]), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(result.normal, transformMatrix, result.normal), options.captureUVS && uvs) {const v = uvs[2 * vertexId + 1];result.uv = new math_vector/* Vector2 */.FM(uvs[2 * vertexId], compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v);}return result;},emptyArray = [0, 0, 0, 0],clip = (vertices, axis) => {if (0 === vertices.length) return vertices;const clipSize = .5 * Math.abs(math_vector/* Vector3.Dot */.P.Dot(size, axis)),indexOf = (arr, val, start, num) => {for (let i = 0; i < num; ++i) if (arr[start + i] === val) return start + i;return -1;},clipVertices = (v0, v1) => {var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;const clipFactor = math_vector/* Vector3.GetClipFactor */.P.GetClipFactor(v0.position, v1.position, axis, clipSize);let indices = emptyArray,weights = emptyArray;if (matIndices && matWeights) {const mat0Index = v0.matrixIndicesOverride ? 0 : v0.vertexIdxForBones,v0Indices = null !== (_a = v0.matrixIndicesOverride) && void 0 !== _a ? _a : matIndices,v0Weights = null !== (_b = v0.matrixWeightsOverride) && void 0 !== _b ? _b : matWeights,mat1Index = v1.matrixIndicesOverride ? 0 : v1.vertexIdxForBones,v1Indices = null !== (_c = v1.matrixIndicesOverride) && void 0 !== _c ? _c : matIndices,v1Weights = null !== (_d = v1.matrixWeightsOverride) && void 0 !== _d ? _d : matWeights;indices = [0, 0, 0, 0], weights = [0, 0, 0, 0];let index = 0;for (let i = 0; 4 > i; ++i) if (0 < v0Weights[mat0Index + i]) {const idx = indexOf(v1Indices, v0Indices[mat0Index + i], mat1Index, 4);indices[index] = v0Indices[mat0Index + i], weights[index] = math_scalar/* Scalar.Lerp */.R.Lerp(v0Weights[mat0Index + i], 0 <= idx ? v1Weights[idx] : 0, clipFactor), index++;}for (let i = 0; 4 > i && 4 > index; ++i) {const ind = v1Indices[mat1Index + i];-1 === indexOf(v0Indices, ind, mat0Index, 4) && (indices[index] = ind, weights[index] = math_scalar/* Scalar.Lerp */.R.Lerp(0, v1Weights[mat1Index + i], clipFactor), index++);}const sumw = weights[0] + weights[1] + weights[2] + weights[3];weights[0] /= sumw, weights[1] /= sumw, weights[2] /= sumw, weights[3] /= sumw;}const v0LocalPositionX = v0.localPositionOverride ? v0.localPositionOverride[0] : null !== (_e = null === localPositions || void 0 === localPositions ? void 0 : localPositions[v0.vertexIdx]) && void 0 !== _e ? _e : 0,v0LocalPositionY = v0.localPositionOverride ? v0.localPositionOverride[1] : null !== (_f = null === localPositions || void 0 === localPositions ? void 0 : localPositions[v0.vertexIdx + 1]) && void 0 !== _f ? _f : 0,v0LocalPositionZ = v0.localPositionOverride ? v0.localPositionOverride[2] : null !== (_g = null === localPositions || void 0 === localPositions ? void 0 : localPositions[v0.vertexIdx + 2]) && void 0 !== _g ? _g : 0,v1LocalPositionX = v1.localPositionOverride ? v1.localPositionOverride[0] : null !== (_h = null === localPositions || void 0 === localPositions ? void 0 : localPositions[v1.vertexIdx]) && void 0 !== _h ? _h : 0,v1LocalPositionY = v1.localPositionOverride ? v1.localPositionOverride[1] : null !== (_j = null === localPositions || void 0 === localPositions ? void 0 : localPositions[v1.vertexIdx + 1]) && void 0 !== _j ? _j : 0,v1LocalPositionZ = v1.localPositionOverride ? v1.localPositionOverride[2] : null !== (_k = null === localPositions || void 0 === localPositions ? void 0 : localPositions[v1.vertexIdx + 2]) && void 0 !== _k ? _k : 0,v0LocalNormalX = v0.localNormalOverride ? v0.localNormalOverride[0] : null !== (_l = null === localNormals || void 0 === localNormals ? void 0 : localNormals[v0.vertexIdx]) && void 0 !== _l ? _l : 0,v0LocalNormalY = v0.localNormalOverride ? v0.localNormalOverride[1] : null !== (_m = null === localNormals || void 0 === localNormals ? void 0 : localNormals[v0.vertexIdx + 1]) && void 0 !== _m ? _m : 0,v0LocalNormalZ = v0.localNormalOverride ? v0.localNormalOverride[2] : null !== (_o = null === localNormals || void 0 === localNormals ? void 0 : localNormals[v0.vertexIdx + 2]) && void 0 !== _o ? _o : 0,v1LocalNormalX = v1.localNormalOverride ? v1.localNormalOverride[0] : null !== (_p = null === localNormals || void 0 === localNormals ? void 0 : localNormals[v1.vertexIdx]) && void 0 !== _p ? _p : 0,v1LocalNormalY = v1.localNormalOverride ? v1.localNormalOverride[1] : null !== (_q = null === localNormals || void 0 === localNormals ? void 0 : localNormals[v1.vertexIdx + 1]) && void 0 !== _q ? _q : 0,v1LocalNormalZ = v1.localNormalOverride ? v1.localNormalOverride[2] : null !== (_r = null === localNormals || void 0 === localNormals ? void 0 : localNormals[v1.vertexIdx + 2]) && void 0 !== _r ? _r : 0,interpNormalX = v0LocalNormalX + (v1LocalNormalX - v0LocalNormalX) * clipFactor,interpNormalY = v0LocalNormalY + (v1LocalNormalY - v0LocalNormalY) * clipFactor,interpNormalZ = v0LocalNormalZ + (v1LocalNormalZ - v0LocalNormalZ) * clipFactor,norm = Math.sqrt(interpNormalX * interpNormalX + interpNormalY * interpNormalY + interpNormalZ * interpNormalZ);return new DecalVertex(math_vector/* Vector3.Lerp */.P.Lerp(v0.position, v1.position, clipFactor), math_vector/* Vector3.Lerp */.P.Lerp(v0.normal, v1.normal, clipFactor).normalize(), math_vector/* Vector2.Lerp */.FM.Lerp(v0.uv, v1.uv, clipFactor), -1, -1, localPositions ? [v0LocalPositionX + (v1LocalPositionX - v0LocalPositionX) * clipFactor, v0LocalPositionY + (v1LocalPositionY - v0LocalPositionY) * clipFactor, v0LocalPositionZ + (v1LocalPositionZ - v0LocalPositionZ) * clipFactor] : null, localNormals ? [interpNormalX / norm, interpNormalY / norm, interpNormalZ / norm] : null, indices, weights);};let clipResult = null;3 < vertices.length && (clipResult = []);for (let index = 0; index < vertices.length; index += 3) {let total = 0,nV1 = null,nV2 = null,nV3 = null,nV4 = null;const d1 = math_vector/* Vector3.Dot */.P.Dot(vertices[index].position, axis) - clipSize,d2 = math_vector/* Vector3.Dot */.P.Dot(vertices[index + 1].position, axis) - clipSize,d3 = math_vector/* Vector3.Dot */.P.Dot(vertices[index + 2].position, axis) - clipSize,v1Out = 0 < d1,v2Out = 0 < d2,v3Out = 0 < d3;switch (total = (v1Out ? 1 : 0) + (v2Out ? 1 : 0) + (v3Out ? 1 : 0), total) {case 0:3 < vertices.length ? (clipResult.push(vertices[index]), clipResult.push(vertices[index + 1]), clipResult.push(vertices[index + 2])) : clipResult = vertices;break;case 1:if (clipResult = null !== clipResult && void 0 !== clipResult ? clipResult : [], v1Out && (nV1 = vertices[index + 1], nV2 = vertices[index + 2], nV3 = clipVertices(vertices[index], nV1), nV4 = clipVertices(vertices[index], nV2)), v2Out) {nV1 = vertices[index], nV2 = vertices[index + 2], nV3 = clipVertices(vertices[index + 1], nV1), nV4 = clipVertices(vertices[index + 1], nV2), clipResult.push(nV3), clipResult.push(nV2.clone()), clipResult.push(nV1.clone()), clipResult.push(nV2.clone()), clipResult.push(nV3.clone()), clipResult.push(nV4);break;}v3Out && (nV1 = vertices[index], nV2 = vertices[index + 1], nV3 = clipVertices(vertices[index + 2], nV1), nV4 = clipVertices(vertices[index + 2], nV2)), nV1 && nV2 && nV3 && nV4 && (clipResult.push(nV1.clone()), clipResult.push(nV2.clone()), clipResult.push(nV3), clipResult.push(nV4), clipResult.push(nV3.clone()), clipResult.push(nV2.clone()));break;case 2:clipResult = null !== clipResult && void 0 !== clipResult ? clipResult : [], v1Out || (nV1 = vertices[index].clone(), nV2 = clipVertices(nV1, vertices[index + 1]), nV3 = clipVertices(nV1, vertices[index + 2]), clipResult.push(nV1), clipResult.push(nV2), clipResult.push(nV3)), v2Out || (nV1 = vertices[index + 1].clone(), nV2 = clipVertices(nV1, vertices[index + 2]), nV3 = clipVertices(nV1, vertices[index]), clipResult.push(nV1), clipResult.push(nV2), clipResult.push(nV3)), v3Out || (nV1 = vertices[index + 2].clone(), nV2 = clipVertices(nV1, vertices[index]), nV3 = clipVertices(nV1, vertices[index + 1]), clipResult.push(nV1), clipResult.push(nV2), clipResult.push(nV3));break;case 3:}}return clipResult;},oneFaceVertices = [,,,];for (let faceVertices, index = 0; index < indices.length; index += 3) if ((faceVertices = oneFaceVertices, faceVertices[0] = extractDecalVector3(index), meshHasOverridenMaterial && useLocalComputation ? (faceVertices[1] = extractDecalVector3(index + 2), faceVertices[2] = extractDecalVector3(index + 1)) : (faceVertices[1] = extractDecalVector3(index + 1), faceVertices[2] = extractDecalVector3(index + 2)), !(options.cullBackFaces && 0 >= -faceVertices[0].normal.z && 0 >= -faceVertices[1].normal.z && 0 >= -faceVertices[2].normal.z)) && (faceVertices = clip(faceVertices, xpAxis), faceVertices && (faceVertices = clip(faceVertices, xnAxis), faceVertices && (faceVertices = clip(faceVertices, ypAxis), faceVertices && (faceVertices = clip(faceVertices, ynAxis), faceVertices && (faceVertices = clip(faceVertices, zpAxis), faceVertices && (faceVertices = clip(faceVertices, znAxis), faceVertices))))))) for (let vIndex = 0; vIndex < faceVertices.length; vIndex++) {const vertex = faceVertices[vIndex];if (vertexData.indices.push(currentVertexDataIndex), useLocalComputation ? (vertex.localPositionOverride ? (vertexData.positions[3 * currentVertexDataIndex] = vertex.localPositionOverride[0], vertexData.positions[3 * currentVertexDataIndex + 1] = vertex.localPositionOverride[1], vertexData.positions[3 * currentVertexDataIndex + 2] = vertex.localPositionOverride[2]) : localPositions && (vertexData.positions[3 * currentVertexDataIndex] = localPositions[vertex.vertexIdx], vertexData.positions[3 * currentVertexDataIndex + 1] = localPositions[vertex.vertexIdx + 1], vertexData.positions[3 * currentVertexDataIndex + 2] = localPositions[vertex.vertexIdx + 2]), vertex.localNormalOverride ? (vertexData.normals[3 * currentVertexDataIndex] = vertex.localNormalOverride[0], vertexData.normals[3 * currentVertexDataIndex + 1] = vertex.localNormalOverride[1], vertexData.normals[3 * currentVertexDataIndex + 2] = vertex.localNormalOverride[2]) : localNormals && (vertexData.normals[3 * currentVertexDataIndex] = localNormals[vertex.vertexIdx], vertexData.normals[3 * currentVertexDataIndex + 1] = localNormals[vertex.vertexIdx + 1], vertexData.normals[3 * currentVertexDataIndex + 2] = localNormals[vertex.vertexIdx + 2])) : (vertex.position.toArray(vertexData.positions, 3 * currentVertexDataIndex), vertex.normal.toArray(vertexData.normals, 3 * currentVertexDataIndex)), vertexData.matricesIndices && vertexData.matricesWeights && (vertex.matrixIndicesOverride ? (vertexData.matricesIndices[4 * currentVertexDataIndex] = vertex.matrixIndicesOverride[0], vertexData.matricesIndices[4 * currentVertexDataIndex + 1] = vertex.matrixIndicesOverride[1], vertexData.matricesIndices[4 * currentVertexDataIndex + 2] = vertex.matrixIndicesOverride[2], vertexData.matricesIndices[4 * currentVertexDataIndex + 3] = vertex.matrixIndicesOverride[3]) : (matIndices && (vertexData.matricesIndices[4 * currentVertexDataIndex] = matIndices[vertex.vertexIdxForBones], vertexData.matricesIndices[4 * currentVertexDataIndex + 1] = matIndices[vertex.vertexIdxForBones + 1], vertexData.matricesIndices[4 * currentVertexDataIndex + 2] = matIndices[vertex.vertexIdxForBones + 2], vertexData.matricesIndices[4 * currentVertexDataIndex + 3] = matIndices[vertex.vertexIdxForBones + 3]), matIndicesExtra && vertexData.matricesIndicesExtra && (vertexData.matricesIndicesExtra[4 * currentVertexDataIndex] = matIndicesExtra[vertex.vertexIdxForBones], vertexData.matricesIndicesExtra[4 * currentVertexDataIndex + 1] = matIndicesExtra[vertex.vertexIdxForBones + 1], vertexData.matricesIndicesExtra[4 * currentVertexDataIndex + 2] = matIndicesExtra[vertex.vertexIdxForBones + 2], vertexData.matricesIndicesExtra[4 * currentVertexDataIndex + 3] = matIndicesExtra[vertex.vertexIdxForBones + 3])), vertex.matrixWeightsOverride ? (vertexData.matricesWeights[4 * currentVertexDataIndex] = vertex.matrixWeightsOverride[0], vertexData.matricesWeights[4 * currentVertexDataIndex + 1] = vertex.matrixWeightsOverride[1], vertexData.matricesWeights[4 * currentVertexDataIndex + 2] = vertex.matrixWeightsOverride[2], vertexData.matricesWeights[4 * currentVertexDataIndex + 3] = vertex.matrixWeightsOverride[3]) : (matWeights && (vertexData.matricesWeights[4 * currentVertexDataIndex] = matWeights[vertex.vertexIdxForBones], vertexData.matricesWeights[4 * currentVertexDataIndex + 1] = matWeights[vertex.vertexIdxForBones + 1], vertexData.matricesWeights[4 * currentVertexDataIndex + 2] = matWeights[vertex.vertexIdxForBones + 2], vertexData.matricesWeights[4 * currentVertexDataIndex + 3] = matWeights[vertex.vertexIdxForBones + 3]), matWeightsExtra && vertexData.matricesWeightsExtra && (vertexData.matricesWeightsExtra[4 * currentVertexDataIndex] = matWeightsExtra[vertex.vertexIdxForBones], vertexData.matricesWeightsExtra[4 * currentVertexDataIndex + 1] = matWeightsExtra[vertex.vertexIdxForBones + 1], vertexData.matricesWeightsExtra[4 * currentVertexDataIndex + 2] = matWeightsExtra[vertex.vertexIdxForBones + 2], vertexData.matricesWeightsExtra[4 * currentVertexDataIndex + 3] = matWeightsExtra[vertex.vertexIdxForBones + 3]))), !options.captureUVS) {vertexData.uvs.push(.5 + vertex.position.x / size.x);const v = .5 + vertex.position.y / size.y;vertexData.uvs.push(compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - v : v);} else vertex.uv.toArray(vertexData.uvs, 2 * currentVertexDataIndex);currentVertexDataIndex++;}const decal = new Meshes_mesh/* Mesh */.Kj(name, sourceMesh.getScene());return vertexData.applyToMesh(decal), useLocalComputation ? (decal.skeleton = sourceMesh.skeleton, decal.parent = sourceMesh) : (decal.position = position.clone(), decal.rotation = new math_vector/* Vector3 */.P(pitch, yaw, angle)), decal.computeWorldMatrix(!0), decal.refreshBoundingInfo(!0, !0), decal;}const DecalBuilder = { CreateDecal };Meshes_mesh/* Mesh.CreateDecal */.Kj.CreateDecal = (name, sourceMesh, position, normal, size, angle) => {return CreateDecal(name, sourceMesh, { position, normal, size, angle });};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Maths/math.isovector.js
class _IsoVector {constructor(x = 0, y = 0) {this.x = x, this.y = y, x !== Math.floor(x) && (x === Math.floor(x), logger/* Logger.Warn */.Y.Warn("x is not an integer, floor(x) used")), y !== Math.floor(y) && (y === Math.floor(y), logger/* Logger.Warn */.Y.Warn("y is not an integer, floor(y) used"));}clone() {return new _IsoVector(this.x, this.y);}rotate60About(other) {const x = this.x;return this.x = other.x + other.y - this.y, this.y = x + this.y - other.x, this;}rotateNeg60About(other) {const x = this.x;return this.x = x + this.y - other.y, this.y = other.x + other.y - x, this;}rotate120(m, n) {m !== Math.floor(m) && (m === Math.floor(m), logger/* Logger.Warn */.Y.Warn("m not an integer only floor(m) used")), n !== Math.floor(n) && (n === Math.floor(n), logger/* Logger.Warn */.Y.Warn("n not an integer only floor(n) used"));const x = this.x;return this.x = m - x - this.y, this.y = n + x, this;}rotateNeg120(m, n) {m !== Math.floor(m) && (m === Math.floor(m), logger/* Logger.Warn */.Y.Warn("m is not an integer, floor(m) used")), n !== Math.floor(n) && (n === Math.floor(n), logger/* Logger.Warn */.Y.Warn("n is not an integer,   floor(n) used"));const x = this.x;return this.x = this.y - n, this.y = m + n - x - this.y, this;}toCartesianOrigin(origin, isoGridSize) {const point = math_vector/* Vector3.Zero */.P.Zero();return point.x = origin.x + 2 * this.x * isoGridSize + this.y * isoGridSize, point.y = origin.y + Math.sqrt(3) * this.y * isoGridSize, point;}static Zero() {return new _IsoVector(0, 0);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/geodesicMesh.js
class _PrimaryIsoTriangle {constructor() {this.cartesian = [], this.vertices = [], this.max = [], this.min = [], this.closestTo = [], this.innerFacets = [], this.isoVecsABOB = [], this.isoVecsOBOA = [], this.isoVecsBAOA = [], this.vertexTypes = [], this.IDATA = new PolyhedronData("icosahedron", "Regular", [[0, math_constants/* PHI */.Q_, -1], [-math_constants/* PHI */.Q_, 1, 0], [-1, 0, -math_constants/* PHI */.Q_], [1, 0, -math_constants/* PHI */.Q_], [math_constants/* PHI */.Q_, 1, 0], [0, math_constants/* PHI */.Q_, 1], [-1, 0, math_constants/* PHI */.Q_], [-math_constants/* PHI */.Q_, -1, 0], [0, -math_constants/* PHI */.Q_, -1], [math_constants/* PHI */.Q_, -1, 0], [1, 0, math_constants/* PHI */.Q_], [0, -math_constants/* PHI */.Q_, 1]], [[0, 2, 1], [0, 3, 2], [0, 4, 3], [0, 5, 4], [0, 1, 5], [7, 6, 1], [8, 7, 2], [9, 8, 3], [10, 9, 4], [6, 10, 5], [2, 7, 1], [3, 8, 2], [4, 9, 3], [5, 10, 4], [1, 6, 5], [11, 6, 7], [11, 7, 8], [11, 8, 9], [11, 9, 10], [11, 10, 6]]);}setIndices() {let indexCount = 12;const vecToidx = {},m = this.m,n = this.n;let g = m,m1 = 1,n1 = 0;0 !== n && (g = math_scalar/* Scalar.HCF */.R.HCF(m, n)), m1 = m / g, n1 = n / g;let fr, rot, O, A, B;const oVec = _IsoVector.Zero(),aVec = new _IsoVector(m, n),bVec = new _IsoVector(-n, m + n),oaVec = _IsoVector.Zero(),abVec = _IsoVector.Zero(),obVec = _IsoVector.Zero();let idx,idxR,isoId,isoIdR,verts = [];const closestTo = [],vDist = this.vertByDist,matchIdx = (f, fr, isoId, isoIdR) => {idx = f + "|" + isoId, idxR = fr + "|" + isoIdR, idx in vecToidx || idxR in vecToidx ? idx in vecToidx && !(idxR in vecToidx) ? vecToidx[idxR] = vecToidx[idx] : idxR in vecToidx && !(idx in vecToidx) && (vecToidx[idx] = vecToidx[idxR]) : (vecToidx[idx] = indexCount, vecToidx[idxR] = indexCount, indexCount++), closestTo[vecToidx[idx]] = 2 < vDist[isoId][0] ? [-vDist[isoId][0], vDist[isoId][1], vecToidx[idx]] : [verts[vDist[isoId][0]], vDist[isoId][1], vecToidx[idx]];};this.IDATA.edgematch = [[1, "B"], [2, "B"], [3, "B"], [4, "B"], [0, "B"], [10, "O", 14, "A"], [11, "O", 10, "A"], [12, "O", 11, "A"], [13, "O", 12, "A"], [14, "O", 13, "A"], [0, "O"], [1, "O"], [2, "O"], [3, "O"], [4, "O"], [19, "B", 5, "A"], [15, "B", 6, "A"], [16, "B", 7, "A"], [17, "B", 8, "A"], [18, "B", 9, "A"]];for (let f = 0; 20 > f; f++) {if (verts = this.IDATA.face[f], O = verts[2], A = verts[1], B = verts[0], isoId = oVec.x + "|" + oVec.y, idx = f + "|" + isoId, idx in vecToidx || (vecToidx[idx] = O, closestTo[O] = [verts[vDist[isoId][0]], vDist[isoId][1]]), isoId = aVec.x + "|" + aVec.y, idx = f + "|" + isoId, idx in vecToidx || (vecToidx[idx] = A, closestTo[A] = [verts[vDist[isoId][0]], vDist[isoId][1]]), isoId = bVec.x + "|" + bVec.y, idx = f + "|" + isoId, idx in vecToidx || (vecToidx[idx] = B, closestTo[B] = [verts[vDist[isoId][0]], vDist[isoId][1]]), fr = this.IDATA.edgematch[f][0], rot = this.IDATA.edgematch[f][1], "B" === rot) for (let i = 1; i < g; i++) abVec.x = m - i * (m1 + n1), abVec.y = n + i * m1, obVec.x = -i * n1, obVec.y = i * (m1 + n1), isoId = abVec.x + "|" + abVec.y, isoIdR = obVec.x + "|" + obVec.y, matchIdx(f, fr, isoId, isoIdR);if ("O" === rot) for (let i = 1; i < g; i++) obVec.x = -i * n1, obVec.y = i * (m1 + n1), oaVec.x = i * m1, oaVec.y = i * n1, isoId = obVec.x + "|" + obVec.y, isoIdR = oaVec.x + "|" + oaVec.y, matchIdx(f, fr, isoId, isoIdR);if (fr = this.IDATA.edgematch[f][2], rot = this.IDATA.edgematch[f][3], rot && "A" === rot) for (let i = 1; i < g; i++) oaVec.x = i * m1, oaVec.y = i * n1, abVec.x = m - (g - i) * (m1 + n1), abVec.y = n + (g - i) * m1, isoId = oaVec.x + "|" + oaVec.y, isoIdR = abVec.x + "|" + abVec.y, matchIdx(f, fr, isoId, isoIdR);for (let i = 0; i < this.vertices.length; i++) isoId = this.vertices[i].x + "|" + this.vertices[i].y, idx = f + "|" + isoId, idx in vecToidx || (vecToidx[idx] = indexCount++, closestTo[vecToidx[idx]] = 2 < vDist[isoId][0] ? [-vDist[isoId][0], vDist[isoId][1], vecToidx[idx]] : [verts[vDist[isoId][0]], vDist[isoId][1], vecToidx[idx]]);}this.closestTo = closestTo, this.vecToidx = vecToidx;}calcCoeffs() {const m = this.m,n = this.n,thirdR3 = Math.sqrt(3) / 3,LSQD = m * m + n * n + m * n;this.coau = (m + n) / LSQD, this.cobu = -n / LSQD, this.coav = -thirdR3 * (m - n) / LSQD, this.cobv = thirdR3 * (2 * m + n) / LSQD;}createInnerFacets() {const m = this.m,n = this.n;for (let y = 0; y < n + m + 1; y++) for (let x = this.min[y]; x < this.max[y] + 1; x++) x < this.max[y] && x < this.max[y + 1] + 1 && this.innerFacets.push(["|" + x + "|" + y, "|" + x + "|" + (y + 1), "|" + (x + 1) + "|" + y]), 0 < y && x < this.max[y - 1] && x + 1 < this.max[y] + 1 && this.innerFacets.push(["|" + x + "|" + y, "|" + (x + 1) + "|" + y, "|" + (x + 1) + "|" + (y - 1)]);}edgeVecsABOB() {const m = this.m,n = this.n,B = new _IsoVector(-n, m + n);for (let y = 1; y < m + n; y++) {const point = new _IsoVector(this.min[y], y),prev = new _IsoVector(this.min[y - 1], y - 1),next = new _IsoVector(this.min[y + 1], y + 1),pointR = point.clone(),prevR = prev.clone(),nextR = next.clone();pointR.rotate60About(B), prevR.rotate60About(B), nextR.rotate60About(B);const maxPoint = new _IsoVector(this.max[pointR.y], pointR.y),maxPrev = new _IsoVector(this.max[pointR.y - 1], pointR.y - 1),maxLeftPrev = new _IsoVector(this.max[pointR.y - 1] - 1, pointR.y - 1);(pointR.x !== maxPoint.x || pointR.y !== maxPoint.y) && (pointR.x === maxPrev.x ? pointR.y === nextR.y ? (this.vertexTypes.push([1, 1, 0]), this.isoVecsABOB.push([point, prev, maxPrev]), this.vertexTypes.push([1, 0, 1]), this.isoVecsABOB.push([point, maxPrev, next])) : (this.vertexTypes.push([1, 1, 0]), this.isoVecsABOB.push([point, prev, maxPrev]), this.vertexTypes.push([1, 0, 0]), this.isoVecsABOB.push([point, maxPrev, maxPoint])) : (this.vertexTypes.push([1, 0, 0]), this.isoVecsABOB.push([point, maxPrev, maxLeftPrev]), this.vertexTypes.push([1, 0, 0]), this.isoVecsABOB.push([point, maxLeftPrev, maxPoint])));}}mapABOBtoOBOA() {const point = new _IsoVector(0, 0);for (let i = 0; i < this.isoVecsABOB.length; i++) {const temp = [];for (let j = 0; 3 > j; j++) point.x = this.isoVecsABOB[i][j].x, point.y = this.isoVecsABOB[i][j].y, 0 === this.vertexTypes[i][j] && point.rotateNeg120(this.m, this.n), temp.push(point.clone());this.isoVecsOBOA.push(temp);}}mapABOBtoBAOA() {const point = new _IsoVector(0, 0);for (let i = 0; i < this.isoVecsABOB.length; i++) {const temp = [];for (let j = 0; 3 > j; j++) point.x = this.isoVecsABOB[i][j].x, point.y = this.isoVecsABOB[i][j].y, 1 === this.vertexTypes[i][j] && point.rotate120(this.m, this.n), temp.push(point.clone());this.isoVecsBAOA.push(temp);}}MapToFace(faceNb, geodesicData) {const F = this.IDATA.face[faceNb],oidx = F[2],aidx = F[1],bidx = F[0],O = math_vector/* Vector3.FromArray */.P.FromArray(this.IDATA.vertex[oidx]),A = math_vector/* Vector3.FromArray */.P.FromArray(this.IDATA.vertex[aidx]),B = math_vector/* Vector3.FromArray */.P.FromArray(this.IDATA.vertex[bidx]),OA = A.subtract(O),OB = B.subtract(O),x = OA.scale(this.coau).add(OB.scale(this.cobu)),y = OA.scale(this.coav).add(OB.scale(this.cobv)),mapped = [];let idx,tempVec = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];for (let i = 0; i < this.cartesian.length; i++) tempVec = x.scale(this.cartesian[i].x).add(y.scale(this.cartesian[i].y)).add(O), mapped[i] = [tempVec.x, tempVec.y, tempVec.z], idx = faceNb + "|" + this.vertices[i].x + "|" + this.vertices[i].y, geodesicData.vertex[this.vecToidx[idx]] = [tempVec.x, tempVec.y, tempVec.z];}build(m, n) {const vertices = [],O = _IsoVector.Zero(),A = new _IsoVector(m, n),B = new _IsoVector(-n, m + n);vertices.push(O, A, B);for (let y = n; y < m + 1; y++) for (let x = 0; x < m + 1 - y; x++) vertices.push(new _IsoVector(x, y));if (0 < n) {const g = math_scalar/* Scalar.HCF */.R.HCF(m, n),m1 = m / g,n1 = n / g;for (let i = 1; i < g; i++) vertices.push(new _IsoVector(i * m1, i * n1)), vertices.push(new _IsoVector(-i * n1, i * (m1 + n1))), vertices.push(new _IsoVector(m - i * (m1 + n1), n + i * m1));for (let y = 1; y < n; y++) for (let x = 0; x < y * (m / n); x++) vertices.push(new _IsoVector(x, y)), vertices.push(new _IsoVector(x, y).rotate120(m, n)), vertices.push(new _IsoVector(x, y).rotateNeg120(m, n));}vertices.sort((a, b) => a.x - b.x), vertices.sort((a, b) => a.y - b.y);const min = Array(m + n + 1),max = Array(m + n + 1);for (let i = 0; i < min.length; i++) min[i] = 1 / 0, max[i] = -Infinity;let y = 0,x = 0;const len = vertices.length;for (let i = 0; i < len; i++) x = vertices[i].x, y = vertices[i].y, min[y] = Math.min(x, min[y]), max[y] = Math.max(x, max[y]);const distFrom = (vert, primVert) => {const v = vert.clone();return "A" === primVert && v.rotateNeg120(m, n), "B" === primVert && v.rotate120(m, n), 0 > v.x ? v.y : v.x + v.y;},cartesian = [],distFromO = [],distFromA = [],distFromB = [],vertByDist = {},vertData = [];let closest = -1,dist = -1;for (let i = 0; i < len; i++) cartesian[i] = vertices[i].toCartesianOrigin(new _IsoVector(0, 0), .5), distFromO[i] = distFrom(vertices[i], "O"), distFromA[i] = distFrom(vertices[i], "A"), distFromB[i] = distFrom(vertices[i], "B"), distFromO[i] === distFromA[i] && distFromA[i] === distFromB[i] ? (closest = 3, dist = distFromO[i]) : distFromO[i] === distFromA[i] ? (closest = 4, dist = distFromO[i]) : distFromA[i] === distFromB[i] ? (closest = 5, dist = distFromA[i]) : distFromB[i] === distFromO[i] && (closest = 6, dist = distFromO[i]), distFromO[i] < distFromA[i] && distFromO[i] < distFromB[i] && (closest = 2, dist = distFromO[i]), distFromA[i] < distFromO[i] && distFromA[i] < distFromB[i] && (closest = 1, dist = distFromA[i]), distFromB[i] < distFromA[i] && distFromB[i] < distFromO[i] && (closest = 0, dist = distFromB[i]), vertData.push([closest, dist, vertices[i].x, vertices[i].y]);vertData.sort((a, b) => a[2] - b[2]), vertData.sort((a, b) => a[3] - b[3]), vertData.sort((a, b) => a[1] - b[1]), vertData.sort((a, b) => a[0] - b[0]);for (let v = 0; v < vertData.length; v++) vertByDist[vertData[v][2] + "|" + vertData[v][3]] = [vertData[v][0], vertData[v][1], v];return this.m = m, this.n = n, this.vertices = vertices, this.vertByDist = vertByDist, this.cartesian = cartesian, this.min = min, this.max = max, this;}}class PolyhedronData {constructor(name, category, vertex, face) {this.name = name, this.category = category, this.vertex = vertex, this.face = face;}}class GeodesicData extends PolyhedronData {innerToData(face, primTri) {for (let i = 0; i < primTri.innerFacets.length; i++) this.face.push(primTri.innerFacets[i].map((el) => primTri.vecToidx[face + el]));}mapABOBtoDATA(faceNb, primTri) {const fr = primTri.IDATA.edgematch[faceNb][0];for (let i = 0; i < primTri.isoVecsABOB.length; i++) {const temp = [];for (let j = 0; 3 > j; j++) 0 === primTri.vertexTypes[i][j] ? temp.push(faceNb + "|" + primTri.isoVecsABOB[i][j].x + "|" + primTri.isoVecsABOB[i][j].y) : temp.push(fr + "|" + primTri.isoVecsABOB[i][j].x + "|" + primTri.isoVecsABOB[i][j].y);this.face.push([primTri.vecToidx[temp[0]], primTri.vecToidx[temp[1]], primTri.vecToidx[temp[2]]]);}}mapOBOAtoDATA(faceNb, primTri) {const fr = primTri.IDATA.edgematch[faceNb][0];for (let i = 0; i < primTri.isoVecsOBOA.length; i++) {const temp = [];for (let j = 0; 3 > j; j++) 1 === primTri.vertexTypes[i][j] ? temp.push(faceNb + "|" + primTri.isoVecsOBOA[i][j].x + "|" + primTri.isoVecsOBOA[i][j].y) : temp.push(fr + "|" + primTri.isoVecsOBOA[i][j].x + "|" + primTri.isoVecsOBOA[i][j].y);this.face.push([primTri.vecToidx[temp[0]], primTri.vecToidx[temp[1]], primTri.vecToidx[temp[2]]]);}}mapBAOAtoDATA(faceNb, primTri) {const fr = primTri.IDATA.edgematch[faceNb][2];for (let i = 0; i < primTri.isoVecsBAOA.length; i++) {const temp = [];for (let j = 0; 3 > j; j++) 1 === primTri.vertexTypes[i][j] ? temp.push(faceNb + "|" + primTri.isoVecsBAOA[i][j].x + "|" + primTri.isoVecsBAOA[i][j].y) : temp.push(fr + "|" + primTri.isoVecsBAOA[i][j].x + "|" + primTri.isoVecsBAOA[i][j].y);this.face.push([primTri.vecToidx[temp[0]], primTri.vecToidx[temp[1]], primTri.vecToidx[temp[2]]]);}}orderData(primTri) {const nearTo = [];for (let i = 0; 13 > i; i++) nearTo[i] = [];const close = primTri.closestTo;for (let i = 0; i < close.length; i++) -1 < close[i][0] ? 0 < close[i][1] && nearTo[close[i][0]].push([i, close[i][1]]) : nearTo[12].push([i, close[i][0]]);const near = [];for (let i = 0; 12 > i; i++) near[i] = i;let nearIndex = 12;for (let i = 0; 12 > i; i++) {nearTo[i].sort((a, b) => a[1] - b[1]);for (let j = 0; j < nearTo[i].length; j++) near[nearTo[i][j][0]] = nearIndex++;}for (let j = 0; j < nearTo[12].length; j++) near[nearTo[12][j][0]] = nearIndex++;for (let i = 0; i < this.vertex.length; i++) this.vertex[i].push(near[i]);this.vertex.sort((a, b) => a[3] - b[3]);for (let i = 0; i < this.vertex.length; i++) this.vertex[i].pop();for (let i = 0; i < this.face.length; i++) for (let j = 0; j < this.face[i].length; j++) this.face[i][j] = near[this.face[i][j]];this.sharedNodes = nearTo[12].length, this.poleNodes = this.vertex.length - this.sharedNodes;}setOrder(m, faces) {const adjVerts = [],dualFaces = [];let face = faces.pop();dualFaces.push(face);let index = this.face[face].indexOf(m);index = (index + 2) % 3;let v = this.face[face][index];adjVerts.push(v);for (let f = 0; 0 < faces.length;) face = faces[f], -1 < this.face[face].indexOf(v) ? (index = (this.face[face].indexOf(v) + 1) % 3, v = this.face[face][index], adjVerts.push(v), dualFaces.push(face), faces.splice(f, 1), f = 0) : f++;return this.adjacentFaces.push(adjVerts), dualFaces;}toGoldbergPolyhedronData() {const goldbergPolyhedronData = new PolyhedronData("GeoDual", "Goldberg", [], []);goldbergPolyhedronData.name = "GD dual";const verticesNb = this.vertex.length,map = Array(verticesNb);for (let v = 0; v < verticesNb; v++) map[v] = [];for (let f = 0; f < this.face.length; f++) for (let i = 0; 3 > i; i++) map[this.face[f][i]].push(f);let cx = 0,cy = 0,cz = 0,face = [],vertex = [];this.adjacentFaces = [];for (let m = 0; m < map.length; m++) goldbergPolyhedronData.face[m] = this.setOrder(m, map[m].concat([])), map[m].forEach((el) => {cx = 0, cy = 0, cz = 0, face = this.face[el];for (let i = 0; 3 > i; i++) vertex = this.vertex[face[i]], cx += vertex[0], cy += vertex[1], cz += vertex[2];goldbergPolyhedronData.vertex[el] = [cx / 3, cy / 3, cz / 3];});return goldbergPolyhedronData;}static BuildGeodesicData(primTri) {const geodesicData = new GeodesicData("Geodesic-m-n", "Geodesic", [[0, math_constants/* PHI */.Q_, -1], [-math_constants/* PHI */.Q_, 1, 0], [-1, 0, -math_constants/* PHI */.Q_], [1, 0, -math_constants/* PHI */.Q_], [math_constants/* PHI */.Q_, 1, 0], [0, math_constants/* PHI */.Q_, 1], [-1, 0, math_constants/* PHI */.Q_], [-math_constants/* PHI */.Q_, -1, 0], [0, -math_constants/* PHI */.Q_, -1], [math_constants/* PHI */.Q_, -1, 0], [1, 0, math_constants/* PHI */.Q_], [0, -math_constants/* PHI */.Q_, 1]], []);primTri.setIndices(), primTri.calcCoeffs(), primTri.createInnerFacets(), primTri.edgeVecsABOB(), primTri.mapABOBtoOBOA(), primTri.mapABOBtoBAOA();for (let f = 0; f < primTri.IDATA.face.length; f++) primTri.MapToFace(f, geodesicData), geodesicData.innerToData(f, primTri), "B" === primTri.IDATA.edgematch[f][1] && geodesicData.mapABOBtoDATA(f, primTri), "O" === primTri.IDATA.edgematch[f][1] && geodesicData.mapOBOAtoDATA(f, primTri), "A" === primTri.IDATA.edgematch[f][3] && geodesicData.mapBAOAtoDATA(f, primTri);geodesicData.orderData(primTri);const radius = 1;return geodesicData.vertex = geodesicData.vertex.map(function (el) {const a = el[0],b = el[1],c = el[2],d = Math.sqrt(a * a + b * b + c * c);return el[0] *= radius / d, el[1] *= radius / d, el[2] *= radius / d, el;}), geodesicData;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/geodesicBuilder.js
function CreateGeodesic(name, options, scene = null) {let m = options.m || 1;m !== Math.floor(m) && (m === Math.floor(m), logger/* Logger.Warn */.Y.Warn("m not an integer only floor(m) used"));let n = options.n || 0;if (n !== Math.floor(n) && (n === Math.floor(n), logger/* Logger.Warn */.Y.Warn("n not an integer only floor(n) used")), n > m) {const temp = n;n = m, m = temp, logger/* Logger.Warn */.Y.Warn("n > m therefore m and n swapped");}const primTri = new _PrimaryIsoTriangle();primTri.build(m, n);const geodesicData = GeodesicData.BuildGeodesicData(primTri),geoOptions = { custom: geodesicData, size: options.size, sizeX: options.sizeX, sizeY: options.sizeY, sizeZ: options.sizeZ, faceUV: options.faceUV, faceColors: options.faceColors, flat: options.flat, updatable: options.updatable, sideOrientation: options.sideOrientation, frontUVs: options.frontUVs, backUVs: options.backUVs },geodesic = CreatePolyhedron(name, geoOptions, scene);return geodesic;}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/goldbergBuilder.js
function CreateGoldbergVertexData(options, goldbergData) {const size = options.size,sizeX = options.sizeX || size || 1,sizeY = options.sizeY || size || 1,sizeZ = options.sizeZ || size || 1,sideOrientation = 0 === options.sideOrientation ? 0 : options.sideOrientation || mesh_vertexData/* VertexData.DEFAULTSIDE */.x.DEFAULTSIDE,positions = [],indices = [],normals = [],uvs = [];let minX = 1 / 0,maxX = -Infinity,minY = 1 / 0,maxY = -Infinity;for (let v = 0; v < goldbergData.vertex.length; v++) minX = Math.min(minX, goldbergData.vertex[v][0] * sizeX), maxX = Math.max(maxX, goldbergData.vertex[v][0] * sizeX), minY = Math.min(minY, goldbergData.vertex[v][1] * sizeY), maxY = Math.max(maxY, goldbergData.vertex[v][1] * sizeY);let index = 0;for (let f = 0; f < goldbergData.face.length; f++) {const verts = goldbergData.face[f],a = math_vector/* Vector3.FromArray */.P.FromArray(goldbergData.vertex[verts[0]]),b = math_vector/* Vector3.FromArray */.P.FromArray(goldbergData.vertex[verts[2]]),c = math_vector/* Vector3.FromArray */.P.FromArray(goldbergData.vertex[verts[1]]),ba = b.subtract(a),ca = c.subtract(a),norm = math_vector/* Vector3.Cross */.P.Cross(ca, ba).normalize();for (let v = 0; v < verts.length; v++) {normals.push(norm.x, norm.y, norm.z);const pdata = goldbergData.vertex[verts[v]];positions.push(pdata[0] * sizeX, pdata[1] * sizeY, pdata[2] * sizeZ);const vCoord = (pdata[1] * sizeY - minY) / (maxY - minY);uvs.push((pdata[0] * sizeX - minX) / (maxX - minX), compatibilityOptions/* CompatibilityOptions.UseOpenGLOrientationForUV */.e.UseOpenGLOrientationForUV ? 1 - vCoord : vCoord);}for (let v = 0; v < verts.length - 2; v++) indices.push(index, index + v + 2, index + v + 1);index += verts.length;}mesh_vertexData/* VertexData._ComputeSides */.x._ComputeSides(sideOrientation, positions, indices, normals, uvs);const vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.positions = positions, vertexData.indices = indices, vertexData.normals = normals, vertexData.uvs = uvs, vertexData;}function CreateGoldberg(name, options, scene = null) {const size = options.size,sizeX = options.sizeX || size || 1,sizeY = options.sizeY || size || 1,sizeZ = options.sizeZ || size || 1;let m = options.m || 1;m !== Math.floor(m) && (m === Math.floor(m), logger/* Logger.Warn */.Y.Warn("m not an integer only floor(m) used"));let n = options.n || 0;if (n !== Math.floor(n) && (n === Math.floor(n), logger/* Logger.Warn */.Y.Warn("n not an integer only floor(n) used")), n > m) {const temp = n;n = m, m = temp, logger/* Logger.Warn */.Y.Warn("n > m therefore m and n swapped");}const primTri = new _PrimaryIsoTriangle();primTri.build(m, n);const geodesicData = GeodesicData.BuildGeodesicData(primTri),goldbergData = geodesicData.toGoldbergPolyhedronData(),goldberg = new GoldbergMesh(name, scene);options.sideOrientation = Meshes_mesh/* Mesh._GetDefaultSideOrientation */.Kj._GetDefaultSideOrientation(options.sideOrientation), goldberg._originalBuilderSideOrientation = options.sideOrientation;const vertexData = CreateGoldbergVertexData(options, goldbergData);vertexData.applyToMesh(goldberg, options.updatable), goldberg.goldbergData.nbSharedFaces = geodesicData.sharedNodes, goldberg.goldbergData.nbUnsharedFaces = geodesicData.poleNodes, goldberg.goldbergData.adjacentFaces = geodesicData.adjacentFaces, goldberg.goldbergData.nbFaces = goldberg.goldbergData.nbSharedFaces + goldberg.goldbergData.nbUnsharedFaces, goldberg.goldbergData.nbFacesAtPole = (goldberg.goldbergData.nbUnsharedFaces - 12) / 12;for (let f = 0; f < geodesicData.vertex.length; f++) goldberg.goldbergData.faceCenters.push(math_vector/* Vector3.FromArray */.P.FromArray(geodesicData.vertex[f])), goldberg.goldbergData.faceCenters[f].x *= sizeX, goldberg.goldbergData.faceCenters[f].y *= sizeY, goldberg.goldbergData.faceCenters[f].z *= sizeZ, goldberg.goldbergData.faceColors.push(new math_color/* Color4 */.HE(1, 1, 1, 1));for (let f = 0; f < goldbergData.face.length; f++) {const verts = goldbergData.face[f],a = math_vector/* Vector3.FromArray */.P.FromArray(goldbergData.vertex[verts[0]]),b = math_vector/* Vector3.FromArray */.P.FromArray(goldbergData.vertex[verts[2]]),c = math_vector/* Vector3.FromArray */.P.FromArray(goldbergData.vertex[verts[1]]),ba = b.subtract(a),ca = c.subtract(a),norm = math_vector/* Vector3.Cross */.P.Cross(ca, ba).normalize(),z = math_vector/* Vector3.Cross */.P.Cross(ca, norm).normalize();goldberg.goldbergData.faceXaxis.push(ca.normalize()), goldberg.goldbergData.faceYaxis.push(norm), goldberg.goldbergData.faceZaxis.push(z);}return goldberg;}Meshes_mesh/* Mesh.CreateGoldberg */.Kj.CreateGoldberg = CreateGoldberg;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/meshBuilder.js
const MeshBuilder = { CreateBox: CreateBox, CreateTiledBox: CreateTiledBox, CreateSphere: CreateSphere, CreateDisc: CreateDisc, CreateIcoSphere: CreateIcoSphere, CreateRibbon: CreateRibbon, CreateCylinder: CreateCylinder, CreateTorus: CreateTorus, CreateTorusKnot: CreateTorusKnot, CreateLineSystem: CreateLineSystem, CreateLines: CreateLines, CreateDashedLines: CreateDashedLines, ExtrudeShape: ExtrudeShape, ExtrudeShapeCustom: ExtrudeShapeCustom, CreateLathe: CreateLathe, CreateTiledPlane: CreateTiledPlane, CreatePlane: CreatePlane, CreateGround: CreateGround, CreateTiledGround: CreateTiledGround, CreateGroundFromHeightMap: CreateGroundFromHeightMap, CreatePolygon: CreatePolygon, ExtrudePolygon: ExtrudePolygon, CreateTube: CreateTube, CreatePolyhedron: CreatePolyhedron, CreateGeodesic: CreateGeodesic, CreateGoldberg: CreateGoldberg, CreateDecal: CreateDecal, CreateCapsule: CreateCapsule };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/meshSimplification.js
class SimplificationSettings {constructor(quality, distance, optimizeMesh) {this.quality = quality, this.distance = distance, this.optimizeMesh = optimizeMesh;}}class SimplificationQueue {constructor() {this.running = !1, this._simplificationArray = [];}addTask(task) {this._simplificationArray.push(task);}executeNext() {const task = this._simplificationArray.pop();task ? (this.running = !0, this.runSimplification(task)) : this.running = !1;}runSimplification(task) {if (task.parallelProcessing) task.settings.forEach((setting) => {const simplifier = this._getSimplifier(task);simplifier.simplify(setting, (newMesh) => {void 0 !== setting.distance && task.mesh.addLODLevel(setting.distance, newMesh), newMesh.isVisible = !0, setting.quality === task.settings[task.settings.length - 1].quality && task.successCallback && task.successCallback(), this.executeNext();});});else {const simplifier = this._getSimplifier(task),runDecimation = (setting, callback) => {simplifier.simplify(setting, (newMesh) => {setting.distance !== void 0 && task.mesh.addLODLevel(setting.distance, newMesh), newMesh.isVisible = !0, callback();});};tools/* AsyncLoop.Run */.$g.Run(task.settings.length, (loop) => {runDecimation(task.settings[loop.index], () => {loop.executeNext();});}, () => {task.successCallback && task.successCallback(), this.executeNext();});}}_getSimplifier(task) {switch (task.simplificationType) {case SimplificationType.QUADRATIC:default:return new QuadraticErrorSimplification(task.mesh);}}}var SimplificationType;(function (SimplificationType) {SimplificationType[SimplificationType.QUADRATIC = 0] = "QUADRATIC";})(SimplificationType || (SimplificationType = {}));class DecimationTriangle {constructor(_vertices) {this._vertices = _vertices, this.error = [,,,,], this.deleted = !1, this.isDirty = !1, this.deletePending = !1, this.borderFactor = 0;}}class DecimationVertex {constructor(position, id) {this.position = position, this.id = id, this.isBorder = !0, this.q = new QuadraticMatrix(), this.triangleCount = 0, this.triangleStart = 0, this.originalOffsets = [];}updatePosition(newPosition) {this.position.copyFrom(newPosition);}}class QuadraticMatrix {constructor(data) {this.data = Array(10);for (let i = 0; 10 > i; ++i) this.data[i] = data && data[i] ? data[i] : 0;}det(a11, a12, a13, a21, a22, a23, a31, a32, a33) {const det = this.data[a11] * this.data[a22] * this.data[a33] + this.data[a13] * this.data[a21] * this.data[a32] + this.data[a12] * this.data[a23] * this.data[a31] - this.data[a13] * this.data[a22] * this.data[a31] - this.data[a11] * this.data[a23] * this.data[a32] - this.data[a12] * this.data[a21] * this.data[a33];return det;}addInPlace(matrix) {for (let i = 0; 10 > i; ++i) this.data[i] += matrix.data[i];}addArrayInPlace(data) {for (let i = 0; 10 > i; ++i) this.data[i] += data[i];}add(matrix) {const m = new QuadraticMatrix();for (let i = 0; 10 > i; ++i) m.data[i] = this.data[i] + matrix.data[i];return m;}static FromData(a, b, c, d) {return new QuadraticMatrix(QuadraticMatrix.DataFromNumbers(a, b, c, d));}static DataFromNumbers(a, b, c, d) {return [a * a, a * b, a * c, a * d, b * b, b * c, b * d, c * c, c * d, d * d];}}class Reference {constructor(vertexId, triangleId) {this.vertexId = vertexId, this.triangleId = triangleId;}}class QuadraticErrorSimplification {constructor(_mesh) {this._mesh = _mesh, this.syncIterations = 5e3, this.aggressiveness = 7, this.decimationIterations = 100, this.boundingBoxEpsilon = math_constants/* Epsilon */.kn;}simplify(settings, successCallback) {this._initDecimatedMesh(), tools/* AsyncLoop.Run */.$g.Run(this._mesh.subMeshes.length, (loop) => {this._initWithMesh(loop.index, () => {this._runDecimation(settings, loop.index, () => {loop.executeNext();});}, settings.optimizeMesh);}, () => {setTimeout(() => {successCallback(this._reconstructedMesh);}, 0);});}_runDecimation(settings, submeshIndex, successCallback) {const targetCount = ~~(this._triangles.length * settings.quality);let deletedTriangles = 0;const triangleCount = this._triangles.length,iterationFunction = (iteration, callback) => {setTimeout(() => {0 == iteration % 5 && this._updateMesh(0 === iteration);for (let i = 0; i < this._triangles.length; ++i) this._triangles[i].isDirty = !1;const threshold = 1e-9 * Math.pow(iteration + 3, this.aggressiveness),trianglesIterator = (i) => {const tIdx = ~~((this._triangles.length / 2 + i) % this._triangles.length),t = this._triangles[tIdx];if (t && !(t.error[3] > threshold || t.deleted || t.isDirty)) for (let j = 0; 3 > j; ++j) if (t.error[j] < threshold) {const deleted0 = [],deleted1 = [],v0 = t._vertices[j],v1 = t._vertices[(j + 1) % 3];if (v0.isBorder || v1.isBorder) continue;const p = math_vector/* Vector3.Zero */.P.Zero();this._calculateError(v0, v1, p);const delTr = [];if (this._isFlipped(v0, v1, p, deleted0, delTr)) continue;if (this._isFlipped(v1, v0, p, deleted1, delTr)) continue;if (0 > deleted0.indexOf(!0) || 0 > deleted1.indexOf(!0)) continue;const uniqueArray = [];if (delTr.forEach((deletedT) => {-1 === uniqueArray.indexOf(deletedT) && (deletedT.deletePending = !0, uniqueArray.push(deletedT));}), 0 != uniqueArray.length % 2) continue;v0.q = v1.q.add(v0.q), v0.updatePosition(p);const tStart = this._references.length;deletedTriangles = this._updateTriangles(v0, v0, deleted0, deletedTriangles), deletedTriangles = this._updateTriangles(v0, v1, deleted1, deletedTriangles);const tCount = this._references.length - tStart;if (!(tCount <= v0.triangleCount)) v0.triangleStart = tStart;else if (tCount) for (let c = 0; c < tCount; c++) this._references[v0.triangleStart + c] = this._references[tStart + c];v0.triangleCount = tCount;break;}};tools/* AsyncLoop.SyncAsyncForLoop */.$g.SyncAsyncForLoop(this._triangles.length, this.syncIterations, trianglesIterator, callback, () => triangleCount - deletedTriangles <= targetCount);}, 0);};tools/* AsyncLoop.Run */.$g.Run(this.decimationIterations, (loop) => {triangleCount - deletedTriangles <= targetCount ? loop.breakLoop() : iterationFunction(loop.index, () => {loop.executeNext();});}, () => {setTimeout(() => {this._reconstructMesh(submeshIndex), successCallback();}, 0);});}_initWithMesh(submeshIndex, callback, optimizeMesh) {this._vertices = [], this._triangles = [];const positionData = this._mesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),indices = this._mesh.getIndices(),submesh = this._mesh.subMeshes[submeshIndex],findInVertices = (positionToSearch) => {if (optimizeMesh) for (let ii = 0; ii < this._vertices.length; ++ii) if (this._vertices[ii].position.equalsWithEpsilon(positionToSearch, 1e-4)) return this._vertices[ii];return null;},vertexReferences = [],vertexInit = (i) => {if (!positionData) return;const offset = i + submesh.verticesStart,position = math_vector/* Vector3.FromArray */.P.FromArray(positionData, 3 * offset),vertex = findInVertices(position) || new DecimationVertex(position, this._vertices.length);vertex.originalOffsets.push(offset), vertex.id === this._vertices.length && this._vertices.push(vertex), vertexReferences.push(vertex.id);},totalVertices = submesh.verticesCount;tools/* AsyncLoop.SyncAsyncForLoop */.$g.SyncAsyncForLoop(totalVertices, this.syncIterations / 4 >> 0, vertexInit, () => {const indicesInit = (i) => {if (!indices) return;const offset = submesh.indexStart / 3 + i,pos = 3 * offset,i0 = indices[pos + 0],i1 = indices[pos + 1],i2 = indices[pos + 2],v0 = this._vertices[vertexReferences[i0 - submesh.verticesStart]],v1 = this._vertices[vertexReferences[i1 - submesh.verticesStart]],v2 = this._vertices[vertexReferences[i2 - submesh.verticesStart]],triangle = new DecimationTriangle([v0, v1, v2]);triangle.originalOffset = pos, this._triangles.push(triangle);};tools/* AsyncLoop.SyncAsyncForLoop */.$g.SyncAsyncForLoop(submesh.indexCount / 3, this.syncIterations, indicesInit, () => {this._init(callback);});});}_init(callback) {const triangleInit1 = (i) => {const t = this._triangles[i];t.normal = math_vector/* Vector3.Cross */.P.Cross(t._vertices[1].position.subtract(t._vertices[0].position), t._vertices[2].position.subtract(t._vertices[0].position)).normalize();for (let j = 0; 3 > j; j++) t._vertices[j].q.addArrayInPlace(QuadraticMatrix.DataFromNumbers(t.normal.x, t.normal.y, t.normal.z, -math_vector/* Vector3.Dot */.P.Dot(t.normal, t._vertices[0].position)));};tools/* AsyncLoop.SyncAsyncForLoop */.$g.SyncAsyncForLoop(this._triangles.length, this.syncIterations, triangleInit1, () => {const triangleInit2 = (i) => {const t = this._triangles[i];for (let j = 0; 3 > j; ++j) t.error[j] = this._calculateError(t._vertices[j], t._vertices[(j + 1) % 3]);t.error[3] = Math.min(t.error[0], t.error[1], t.error[2]);};tools/* AsyncLoop.SyncAsyncForLoop */.$g.SyncAsyncForLoop(this._triangles.length, this.syncIterations, triangleInit2, () => {callback();});});}_reconstructMesh(submeshIndex) {const newTriangles = [];let i;for (i = 0; i < this._vertices.length; ++i) this._vertices[i].triangleCount = 0;let t, j;for (i = 0; i < this._triangles.length; ++i) if (!this._triangles[i].deleted) {for (t = this._triangles[i], j = 0; 3 > j; ++j) t._vertices[j].triangleCount = 1;newTriangles.push(t);}const newPositionData = this._reconstructedMesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind) || [],newNormalData = this._reconstructedMesh.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind) || [],newUVsData = this._reconstructedMesh.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind) || [],newColorsData = this._reconstructedMesh.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind) || [],normalData = this._mesh.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind),uvs = this._mesh.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind),colorsData = this._mesh.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind);let vertexCount = 0;for (i = 0; i < this._vertices.length; ++i) {const vertex = this._vertices[i];vertex.id = vertexCount, vertex.triangleCount && vertex.originalOffsets.forEach((originalOffset) => {newPositionData.push(vertex.position.x), newPositionData.push(vertex.position.y), newPositionData.push(vertex.position.z), normalData && normalData.length && (newNormalData.push(normalData[3 * originalOffset]), newNormalData.push(normalData[3 * originalOffset + 1]), newNormalData.push(normalData[3 * originalOffset + 2])), uvs && uvs.length && (newUVsData.push(uvs[2 * originalOffset]), newUVsData.push(uvs[2 * originalOffset + 1])), colorsData && colorsData.length && (newColorsData.push(colorsData[4 * originalOffset]), newColorsData.push(colorsData[4 * originalOffset + 1]), newColorsData.push(colorsData[4 * originalOffset + 2]), newColorsData.push(colorsData[4 * originalOffset + 3])), ++vertexCount;});}const startingIndex = this._reconstructedMesh.getTotalIndices(),startingVertex = this._reconstructedMesh.getTotalVertices(),submeshesArray = this._reconstructedMesh.subMeshes;this._reconstructedMesh.subMeshes = [];const newIndicesArray = this._reconstructedMesh.getIndices(),originalIndices = this._mesh.getIndices();for (i = 0; i < newTriangles.length; ++i) t = newTriangles[i], [0, 1, 2].forEach((idx) => {const id = originalIndices[t.originalOffset + idx];let offset = t._vertices[idx].originalOffsets.indexOf(id);0 > offset && (offset = 0), newIndicesArray.push(t._vertices[idx].id + offset + startingVertex);});this._reconstructedMesh.setIndices(newIndicesArray), this._reconstructedMesh.setVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, newPositionData), 0 < newNormalData.length && this._reconstructedMesh.setVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, newNormalData), 0 < newUVsData.length && this._reconstructedMesh.setVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, newUVsData), 0 < newColorsData.length && this._reconstructedMesh.setVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, newColorsData);const originalSubmesh = this._mesh.subMeshes[submeshIndex];0 < submeshIndex && (this._reconstructedMesh.subMeshes = [], submeshesArray.forEach((submesh) => {subMesh/* SubMesh.AddToMesh */.P.AddToMesh(submesh.materialIndex, submesh.verticesStart, submesh.verticesCount, submesh.indexStart, submesh.indexCount, submesh.getMesh());}), subMesh/* SubMesh.AddToMesh */.P.AddToMesh(originalSubmesh.materialIndex, startingVertex, vertexCount, startingIndex, 3 * newTriangles.length, this._reconstructedMesh));}_initDecimatedMesh() {this._reconstructedMesh = new Meshes_mesh/* Mesh */.Kj(this._mesh.name + "Decimated", this._mesh.getScene()), this._reconstructedMesh.material = this._mesh.material, this._reconstructedMesh.parent = this._mesh.parent, this._reconstructedMesh.isVisible = !1, this._reconstructedMesh.renderingGroupId = this._mesh.renderingGroupId;}_isFlipped(vertex1, vertex2, point, deletedArray, delTr) {for (let i = 0; i < vertex1.triangleCount; ++i) {const t = this._triangles[this._references[vertex1.triangleStart + i].triangleId];if (t.deleted) continue;const s = this._references[vertex1.triangleStart + i].vertexId,v1 = t._vertices[(s + 1) % 3],v2 = t._vertices[(s + 2) % 3];if (v1 === vertex2 || v2 === vertex2) {deletedArray[i] = !0, delTr.push(t);continue;}let d1 = v1.position.subtract(point);d1 = d1.normalize();let d2 = v2.position.subtract(point);if (d2 = d2.normalize(), .999 < Math.abs(math_vector/* Vector3.Dot */.P.Dot(d1, d2))) return !0;const normal = math_vector/* Vector3.Cross */.P.Cross(d1, d2).normalize();if (deletedArray[i] = !1, .2 > math_vector/* Vector3.Dot */.P.Dot(normal, t.normal)) return !0;}return !1;}_updateTriangles(origVertex, vertex, deletedArray, deletedTriangles) {let newDeleted = deletedTriangles;for (let i = 0; i < vertex.triangleCount; ++i) {const ref = this._references[vertex.triangleStart + i],t = this._triangles[ref.triangleId];if (!t.deleted) {if (deletedArray[i] && t.deletePending) {t.deleted = !0, newDeleted++;continue;}t._vertices[ref.vertexId] = origVertex, t.isDirty = !0, t.error[0] = this._calculateError(t._vertices[0], t._vertices[1]) + t.borderFactor / 2, t.error[1] = this._calculateError(t._vertices[1], t._vertices[2]) + t.borderFactor / 2, t.error[2] = this._calculateError(t._vertices[2], t._vertices[0]) + t.borderFactor / 2, t.error[3] = Math.min(t.error[0], t.error[1], t.error[2]), this._references.push(ref);}}return newDeleted;}_identifyBorder() {for (let i = 0; i < this._vertices.length; ++i) {const vCount = [],vId = [],v = this._vertices[i];let j;for (j = 0; j < v.triangleCount; ++j) {const triangle = this._triangles[this._references[v.triangleStart + j].triangleId];for (let ofs, ii = 0; 3 > ii; ii++) {ofs = 0;const vv = triangle._vertices[ii];for (; ofs < vCount.length && !(vId[ofs] === vv.id);) ++ofs;ofs === vCount.length ? (vCount.push(1), vId.push(vv.id)) : vCount[ofs]++;}}for (j = 0; j < vCount.length; ++j) this._vertices[vId[j]].isBorder = !(1 !== vCount[j]);}}_updateMesh(identifyBorders = !1) {let i;if (!identifyBorders) {const newTrianglesVector = [];for (i = 0; i < this._triangles.length; ++i) this._triangles[i].deleted || newTrianglesVector.push(this._triangles[i]);this._triangles = newTrianglesVector;}for (i = 0; i < this._vertices.length; ++i) this._vertices[i].triangleCount = 0, this._vertices[i].triangleStart = 0;let t, j, v;for (i = 0; i < this._triangles.length; ++i) for (t = this._triangles[i], j = 0; 3 > j; ++j) v = t._vertices[j], v.triangleCount++;let tStart = 0;for (i = 0; i < this._vertices.length; ++i) this._vertices[i].triangleStart = tStart, tStart += this._vertices[i].triangleCount, this._vertices[i].triangleCount = 0;const newReferences = Array(3 * this._triangles.length);for (i = 0; i < this._triangles.length; ++i) for (t = this._triangles[i], j = 0; 3 > j; ++j) v = t._vertices[j], newReferences[v.triangleStart + v.triangleCount] = new Reference(j, i), v.triangleCount++;this._references = newReferences, identifyBorders && this._identifyBorder();}_vertexError(q, point) {const x = point.x,y = point.y,z = point.z;return q.data[0] * x * x + 2 * q.data[1] * x * y + 2 * q.data[2] * x * z + 2 * q.data[3] * x + q.data[4] * y * y + 2 * q.data[5] * y * z + 2 * q.data[6] * y + q.data[7] * z * z + 2 * q.data[8] * z + q.data[9];}_calculateError(vertex1, vertex2, pointResult) {const q = vertex1.q.add(vertex2.q),border = vertex1.isBorder && vertex2.isBorder;let error = 0;const qDet = q.det(0, 1, 2, 1, 4, 5, 2, 5, 7);if (0 !== qDet && !border) pointResult || (pointResult = math_vector/* Vector3.Zero */.P.Zero()), pointResult.x = -1 / qDet * q.det(1, 2, 3, 4, 5, 6, 5, 7, 8), pointResult.y = 1 / qDet * q.det(0, 2, 3, 1, 5, 6, 2, 7, 8), pointResult.z = -1 / qDet * q.det(0, 1, 3, 1, 4, 6, 2, 5, 8), error = this._vertexError(q, pointResult);else {const p3 = vertex1.position.add(vertex2.position).divide(new math_vector/* Vector3 */.P(2, 2, 2)),error1 = this._vertexError(q, vertex1.position),error2 = this._vertexError(q, vertex2.position),error3 = this._vertexError(q, p3);error = Math.min(error1, error2, error3), error === error1 ? pointResult && pointResult.copyFrom(vertex1.position) : error === error2 ? pointResult && pointResult.copyFrom(vertex2.position) : pointResult && pointResult.copyFrom(p3);}return error;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/meshSimplificationSceneComponent.js
Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "simplificationQueue", { get: function () {if (!this._simplificationQueue) {this._simplificationQueue = new SimplificationQueue();let component = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE */.l.NAME_SIMPLIFICATIONQUEUE);component || (component = new SimplicationQueueSceneComponent(this), this._addComponent(component));}return this._simplificationQueue;}, set: function (value) {this._simplificationQueue = value;}, enumerable: !0, configurable: !0 }), Meshes_mesh/* Mesh.prototype.simplify */.Kj.prototype.simplify = function (settings, parallelProcessing = !0, simplificationType = SimplificationType.QUADRATIC, successCallback) {return this.getScene().simplificationQueue.addTask({ settings: settings, parallelProcessing: parallelProcessing, mesh: this, simplificationType: simplificationType, successCallback: successCallback }), this;};class SimplicationQueueSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE */.l.NAME_SIMPLIFICATIONQUEUE, this.scene = scene;}register() {this.scene._beforeCameraUpdateStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE */.l.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE, this, this._beforeCameraUpdate);}rebuild() {}dispose() {}_beforeCameraUpdate() {this.scene._simplificationQueue && !this.scene._simplificationQueue.running && this.scene._simplificationQueue.executeNext();}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/meshLODLevel.js
var meshLODLevel = __webpack_require__("./node_modules/@babylonjs/core/Meshes/meshLODLevel.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js
var webGLDataBuffer = __webpack_require__("./node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/thinInstanceMesh.js
var thinInstanceMesh = __webpack_require__("./node_modules/@babylonjs/core/Meshes/thinInstanceMesh.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Meshes/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Morph/morphTarget.js
var morphTarget = __webpack_require__("./node_modules/@babylonjs/core/Morph/morphTarget.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Morph/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Navigation/INavigationEngine.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Navigation/Plugins/recastJSPlugin.js
class RecastJSPlugin {constructor(recastInjection = Recast) {return this.bjsRECAST = {}, this.name = "RecastJSPlugin", this._maximumSubStepCount = 10, this._timeStep = 1 / 60, this._timeFactor = 1, this._worker = null, "function" == typeof recastInjection ? logger/* Logger.Error */.Y.Error("RecastJS is not ready. Please make sure you await Recast() before using the plugin.") : this.bjsRECAST = recastInjection, this.isSupported() ? void (this.setTimeStep(), this._tempVec1 = new this.bjsRECAST.Vec3(), this._tempVec2 = new this.bjsRECAST.Vec3()) : void logger/* Logger.Error */.Y.Error("RecastJS is not available. Please make sure you included the js file.");}setWorkerURL(workerURL) {return !!(window && window.Worker) && (this._worker = new Worker(workerURL), !0);}setTimeStep(newTimeStep = 1 / 60) {this._timeStep = newTimeStep;}getTimeStep() {return this._timeStep;}setMaximumSubStepCount(newStepCount = 10) {this._maximumSubStepCount = newStepCount;}getMaximumSubStepCount() {return this._maximumSubStepCount;}set timeFactor(value) {this._timeFactor = Math.max(value, 0);}get timeFactor() {return this._timeFactor;}createNavMesh(meshes, parameters, completion) {this._worker && !completion ? console.warn("A worker is avaible but no completion callback. Defaulting to blocking navmesh creation") : !this._worker && completion && console.warn("A completion callback is avaible but no worker. Defaulting to blocking navmesh creation"), this.navMesh = new this.bjsRECAST.NavMesh();let index, tri, pt;const indices = [],positions = [];let offset = 0;for (index = 0; index < meshes.length; index++) if (meshes[index]) {const mesh = meshes[index],meshIndices = mesh.getIndices();if (!meshIndices) continue;const meshPositions = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, !1, !1);if (!meshPositions) continue;const worldMatrices = [],worldMatrix = mesh.computeWorldMatrix(!0);if (mesh.hasThinInstances) {const thinMatrices = mesh.thinInstanceGetWorldMatrices();for (let instanceIndex = 0; instanceIndex < thinMatrices.length; instanceIndex++) {const tmpMatrix = new math/* Matrix */.y3(),thinMatrix = thinMatrices[instanceIndex];thinMatrix.multiplyToRef(worldMatrix, tmpMatrix), worldMatrices.push(tmpMatrix);}} else worldMatrices.push(worldMatrix);for (let matrixIndex = 0; matrixIndex < worldMatrices.length; matrixIndex++) {const wm = worldMatrices[matrixIndex];for (tri = 0; tri < meshIndices.length; tri++) indices.push(meshIndices[tri] + offset);const transformed = math/* Vector3.Zero */.P.Zero(),position = math/* Vector3.Zero */.P.Zero();for (pt = 0; pt < meshPositions.length; pt += 3) math/* Vector3.FromArrayToRef */.P.FromArrayToRef(meshPositions, pt, position), math/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(position, wm, transformed), positions.push(transformed.x, transformed.y, transformed.z);offset += meshPositions.length / 3;}}if (this._worker && completion) this._worker.postMessage([positions, offset, indices, indices.length, parameters]), this._worker.onmessage = function (e) {completion(e.data);};else {const rc = new this.bjsRECAST.rcConfig();rc.cs = parameters.cs, rc.ch = parameters.ch, rc.borderSize = parameters.borderSize ? parameters.borderSize : 0, rc.tileSize = parameters.tileSize ? parameters.tileSize : 0, rc.walkableSlopeAngle = parameters.walkableSlopeAngle, rc.walkableHeight = parameters.walkableHeight, rc.walkableClimb = parameters.walkableClimb, rc.walkableRadius = parameters.walkableRadius, rc.maxEdgeLen = parameters.maxEdgeLen, rc.maxSimplificationError = parameters.maxSimplificationError, rc.minRegionArea = parameters.minRegionArea, rc.mergeRegionArea = parameters.mergeRegionArea, rc.maxVertsPerPoly = parameters.maxVertsPerPoly, rc.detailSampleDist = parameters.detailSampleDist, rc.detailSampleMaxError = parameters.detailSampleMaxError, this.navMesh.build(positions, offset, indices, indices.length, rc);}}createDebugNavMesh(scene) {let tri, pt;const debugNavMesh = this.navMesh.getDebugNavMesh(),triangleCount = debugNavMesh.getTriangleCount(),indices = [],positions = [];for (tri = 0; tri < 3 * triangleCount; tri++) indices.push(tri);for (tri = 0; tri < triangleCount; tri++) for (pt = 0; 3 > pt; pt++) {const point = debugNavMesh.getTriangle(tri).getPoint(pt);positions.push(point.x, point.y, point.z);}const mesh = new Meshes_mesh/* Mesh */.Kj("NavMeshDebug", scene),vertexData = new mesh_vertexData/* VertexData */.x();return vertexData.indices = indices, vertexData.positions = positions, vertexData.applyToMesh(mesh, !1), mesh;}getClosestPoint(position) {this._tempVec1.x = position.x, this._tempVec1.y = position.y, this._tempVec1.z = position.z;const ret = this.navMesh.getClosestPoint(this._tempVec1),pr = new math/* Vector3 */.P(ret.x, ret.y, ret.z);return pr;}getClosestPointToRef(position, result) {this._tempVec1.x = position.x, this._tempVec1.y = position.y, this._tempVec1.z = position.z;const ret = this.navMesh.getClosestPoint(this._tempVec1);result.set(ret.x, ret.y, ret.z);}getRandomPointAround(position, maxRadius) {this._tempVec1.x = position.x, this._tempVec1.y = position.y, this._tempVec1.z = position.z;const ret = this.navMesh.getRandomPointAround(this._tempVec1, maxRadius),pr = new math/* Vector3 */.P(ret.x, ret.y, ret.z);return pr;}getRandomPointAroundToRef(position, maxRadius, result) {this._tempVec1.x = position.x, this._tempVec1.y = position.y, this._tempVec1.z = position.z;const ret = this.navMesh.getRandomPointAround(this._tempVec1, maxRadius);result.set(ret.x, ret.y, ret.z);}moveAlong(position, destination) {this._tempVec1.x = position.x, this._tempVec1.y = position.y, this._tempVec1.z = position.z, this._tempVec2.x = destination.x, this._tempVec2.y = destination.y, this._tempVec2.z = destination.z;const ret = this.navMesh.moveAlong(this._tempVec1, this._tempVec2),pr = new math/* Vector3 */.P(ret.x, ret.y, ret.z);return pr;}moveAlongToRef(position, destination, result) {this._tempVec1.x = position.x, this._tempVec1.y = position.y, this._tempVec1.z = position.z, this._tempVec2.x = destination.x, this._tempVec2.y = destination.y, this._tempVec2.z = destination.z;const ret = this.navMesh.moveAlong(this._tempVec1, this._tempVec2);result.set(ret.x, ret.y, ret.z);}computePath(start, end) {let pt;this._tempVec1.x = start.x, this._tempVec1.y = start.y, this._tempVec1.z = start.z, this._tempVec2.x = end.x, this._tempVec2.y = end.y, this._tempVec2.z = end.z;const navPath = this.navMesh.computePath(this._tempVec1, this._tempVec2),pointCount = navPath.getPointCount(),positions = [];for (pt = 0; pt < pointCount; pt++) {const p = navPath.getPoint(pt);positions.push(new math/* Vector3 */.P(p.x, p.y, p.z));}return positions;}createCrowd(maxAgents, maxAgentRadius, scene) {const crowd = new RecastJSCrowd(this, maxAgents, maxAgentRadius, scene);return crowd;}setDefaultQueryExtent(extent) {this._tempVec1.x = extent.x, this._tempVec1.y = extent.y, this._tempVec1.z = extent.z, this.navMesh.setDefaultQueryExtent(this._tempVec1);}getDefaultQueryExtent() {const p = this.navMesh.getDefaultQueryExtent();return new math/* Vector3 */.P(p.x, p.y, p.z);}buildFromNavmeshData(data) {const nDataBytes = data.length * data.BYTES_PER_ELEMENT,dataPtr = this.bjsRECAST._malloc(nDataBytes),dataHeap = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, dataPtr, nDataBytes);dataHeap.set(data);const buf = new this.bjsRECAST.NavmeshData();buf.dataPointer = dataHeap.byteOffset, buf.size = data.length, this.navMesh = new this.bjsRECAST.NavMesh(), this.navMesh.buildFromNavmeshData(buf), this.bjsRECAST._free(dataHeap.byteOffset);}getNavmeshData() {const navmeshData = this.navMesh.getNavmeshData(),arrView = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, navmeshData.dataPointer, navmeshData.size),ret = new Uint8Array(navmeshData.size);return ret.set(arrView), this.navMesh.freeNavmeshData(navmeshData), ret;}getDefaultQueryExtentToRef(result) {const p = this.navMesh.getDefaultQueryExtent();result.set(p.x, p.y, p.z);}dispose() {}addCylinderObstacle(position, radius, height) {return this._tempVec1.x = position.x, this._tempVec1.y = position.y, this._tempVec1.z = position.z, this.navMesh.addCylinderObstacle(this._tempVec1, radius, height);}addBoxObstacle(position, extent, angle) {return this._tempVec1.x = position.x, this._tempVec1.y = position.y, this._tempVec1.z = position.z, this._tempVec2.x = extent.x, this._tempVec2.y = extent.y, this._tempVec2.z = extent.z, this.navMesh.addBoxObstacle(this._tempVec1, this._tempVec2, angle);}removeObstacle(obstacle) {this.navMesh.removeObstacle(obstacle);}isSupported() {return this.bjsRECAST !== void 0;}}class RecastJSCrowd {constructor(plugin, maxAgents, maxAgentRadius, scene) {this.recastCrowd = {}, this.transforms = [], this.agents = [], this.reachRadii = [], this._agentDestinationArmed = [], this._agentDestination = [], this._onBeforeAnimationsObserver = null, this.onReachTargetObservable = new observable/* Observable */.y$(), this.bjsRECASTPlugin = plugin, this.recastCrowd = new this.bjsRECASTPlugin.bjsRECAST.Crowd(maxAgents, maxAgentRadius, this.bjsRECASTPlugin.navMesh.getNavMesh()), this._scene = scene, this._onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {this.update(.001 * scene.getEngine().getDeltaTime() * plugin.timeFactor);});}addAgent(pos, parameters, transform) {const agentParams = new this.bjsRECASTPlugin.bjsRECAST.dtCrowdAgentParams();agentParams.radius = parameters.radius, agentParams.height = parameters.height, agentParams.maxAcceleration = parameters.maxAcceleration, agentParams.maxSpeed = parameters.maxSpeed, agentParams.collisionQueryRange = parameters.collisionQueryRange, agentParams.pathOptimizationRange = parameters.pathOptimizationRange, agentParams.separationWeight = parameters.separationWeight, agentParams.updateFlags = 7, agentParams.obstacleAvoidanceType = 0, agentParams.queryFilterType = 0, agentParams.userData = 0;const agentIndex = this.recastCrowd.addAgent(new this.bjsRECASTPlugin.bjsRECAST.Vec3(pos.x, pos.y, pos.z), agentParams);return this.transforms.push(transform), this.agents.push(agentIndex), this.reachRadii.push(parameters.reachRadius ? parameters.reachRadius : parameters.radius), this._agentDestinationArmed.push(!1), this._agentDestination.push(new math/* Vector3 */.P(0, 0, 0)), agentIndex;}getAgentPosition(index) {const agentPos = this.recastCrowd.getAgentPosition(index);return new math/* Vector3 */.P(agentPos.x, agentPos.y, agentPos.z);}getAgentPositionToRef(index, result) {const agentPos = this.recastCrowd.getAgentPosition(index);result.set(agentPos.x, agentPos.y, agentPos.z);}getAgentVelocity(index) {const agentVel = this.recastCrowd.getAgentVelocity(index);return new math/* Vector3 */.P(agentVel.x, agentVel.y, agentVel.z);}getAgentVelocityToRef(index, result) {const agentVel = this.recastCrowd.getAgentVelocity(index);result.set(agentVel.x, agentVel.y, agentVel.z);}getAgentNextTargetPath(index) {const pathTargetPos = this.recastCrowd.getAgentNextTargetPath(index);return new math/* Vector3 */.P(pathTargetPos.x, pathTargetPos.y, pathTargetPos.z);}getAgentNextTargetPathToRef(index, result) {const pathTargetPos = this.recastCrowd.getAgentNextTargetPath(index);result.set(pathTargetPos.x, pathTargetPos.y, pathTargetPos.z);}getAgentState(index) {return this.recastCrowd.getAgentState(index);}overOffmeshConnection(index) {return this.recastCrowd.overOffmeshConnection(index);}agentGoto(index, destination) {this.recastCrowd.agentGoto(index, new this.bjsRECASTPlugin.bjsRECAST.Vec3(destination.x, destination.y, destination.z));const item = this.agents.indexOf(index);-1 < item && (this._agentDestinationArmed[item] = !0, this._agentDestination[item].set(destination.x, destination.y, destination.z));}agentTeleport(index, destination) {this.recastCrowd.agentTeleport(index, new this.bjsRECASTPlugin.bjsRECAST.Vec3(destination.x, destination.y, destination.z));}updateAgentParameters(index, parameters) {const agentParams = this.recastCrowd.getAgentParameters(index);parameters.radius !== void 0 && (agentParams.radius = parameters.radius), parameters.height !== void 0 && (agentParams.height = parameters.height), parameters.maxAcceleration !== void 0 && (agentParams.maxAcceleration = parameters.maxAcceleration), parameters.maxSpeed !== void 0 && (agentParams.maxSpeed = parameters.maxSpeed), parameters.collisionQueryRange !== void 0 && (agentParams.collisionQueryRange = parameters.collisionQueryRange), parameters.pathOptimizationRange !== void 0 && (agentParams.pathOptimizationRange = parameters.pathOptimizationRange), parameters.separationWeight !== void 0 && (agentParams.separationWeight = parameters.separationWeight), this.recastCrowd.setAgentParameters(index, agentParams);}removeAgent(index) {this.recastCrowd.removeAgent(index);const item = this.agents.indexOf(index);-1 < item && (this.agents.splice(item, 1), this.transforms.splice(item, 1), this.reachRadii.splice(item, 1), this._agentDestinationArmed.splice(item, 1), this._agentDestination.splice(item, 1));}getAgents() {return this.agents;}update(deltaTime) {if (this.bjsRECASTPlugin.navMesh.update(), deltaTime <= math/* Epsilon */.kn) return;const timeStep = this.bjsRECASTPlugin.getTimeStep(),maxStepCount = this.bjsRECASTPlugin.getMaximumSubStepCount();if (timeStep <= math/* Epsilon */.kn) this.recastCrowd.update(deltaTime);else {let iterationCount = Math.floor(deltaTime / timeStep);maxStepCount && iterationCount > maxStepCount && (iterationCount = maxStepCount), 1 > iterationCount && (iterationCount = 1);const step = deltaTime / iterationCount;for (let i = 0; i < iterationCount; i++) this.recastCrowd.update(step);}for (let index = 0; index < this.agents.length; index++) {const agentIndex = this.agents[index],agentPosition = this.getAgentPosition(agentIndex);if (this.transforms[index].position = agentPosition, this._agentDestinationArmed[index]) {const dx = agentPosition.x - this._agentDestination[index].x,dz = agentPosition.z - this._agentDestination[index].z,radius = this.reachRadii[index],groundY = this._agentDestination[index].y - this.reachRadii[index],ceilingY = this._agentDestination[index].y + this.reachRadii[index];agentPosition.y > groundY && agentPosition.y < ceilingY && dx * dx + dz * dz < radius * radius && (this.onReachTargetObservable.notifyObservers({ agentIndex: agentIndex, destination: this._agentDestination[index] }), this._agentDestinationArmed[index] = !1);}}}setDefaultQueryExtent(extent) {const ext = new this.bjsRECASTPlugin.bjsRECAST.Vec3(extent.x, extent.y, extent.z);this.recastCrowd.setDefaultQueryExtent(ext);}getDefaultQueryExtent() {const p = this.recastCrowd.getDefaultQueryExtent();return new math/* Vector3 */.P(p.x, p.y, p.z);}getDefaultQueryExtentToRef(result) {const p = this.recastCrowd.getDefaultQueryExtent();result.set(p.x, p.y, p.z);}getCorners(index) {let pt;const navPath = this.recastCrowd.getCorners(index),pointCount = navPath.getPointCount(),positions = [];for (pt = 0; pt < pointCount; pt++) {const p = navPath.getPoint(pt);positions.push(new math/* Vector3 */.P(p.x, p.y, p.z));}return positions;}dispose() {this.recastCrowd.destroy(), this._scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver), this._onBeforeAnimationsObserver = null, this.onReachTargetObservable.clear();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Navigation/Plugins/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Navigation/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Offline/database.js
engine/* Engine.OfflineProviderFactory */.D.OfflineProviderFactory = (urlToScene, callbackManifestChecked, disableManifestCheck = !1) => new Database(urlToScene, callbackManifestChecked, disableManifestCheck);class Database {get enableSceneOffline() {return this._enableSceneOffline;}get enableTexturesOffline() {return this._enableTexturesOffline;}constructor(urlToScene, callbackManifestChecked, disableManifestCheck = !1) {this._idbFactory = "undefined" == typeof indexedDB ? void 0 : indexedDB, this._currentSceneUrl = Database._ReturnFullUrlLocation(urlToScene), this._db = null, this._enableSceneOffline = !1, this._enableTexturesOffline = !1, this._manifestVersionFound = 0, this._mustUpdateRessources = !1, this._hasReachedQuota = !1, Database.IDBStorageEnabled ? disableManifestCheck ? (this._enableSceneOffline = !0, this._enableTexturesOffline = !0, this._manifestVersionFound = 1, tools/* Tools.SetImmediate */.w1.SetImmediate(() => {callbackManifestChecked(!0);})) : this._checkManifestFile(callbackManifestChecked) : callbackManifestChecked(!0);}_checkManifestFile(callbackManifestChecked) {const noManifestFile = () => {this._enableSceneOffline = !1, this._enableTexturesOffline = !1, callbackManifestChecked(!1);},createManifestURL = () => {try {if ("function" == typeof URL && 0 === this._currentSceneUrl.indexOf("http")) {const url = new URL(this._currentSceneUrl);return url.pathname += ".manifest", url.toString();}} catch (e) {}return `${this._currentSceneUrl}.manifest`;};let timeStampUsed = !1,manifestURL = createManifestURL();const xhr = new webRequest/* WebRequest */.g();navigator.onLine && (timeStampUsed = !0, manifestURL = manifestURL + (null == manifestURL.match(/\?/) ? "?" : "&") + Date.now()), xhr.open("GET", manifestURL), xhr.addEventListener("load", () => {if (200 === xhr.status || Database._ValidateXHRData(xhr, 1)) try {const manifestFile = JSON.parse(xhr.response);this._enableSceneOffline = manifestFile.enableSceneOffline, this._enableTexturesOffline = manifestFile.enableTexturesOffline && Database._IsUASupportingBlobStorage, manifestFile.version && !isNaN(parseInt(manifestFile.version)) && (this._manifestVersionFound = manifestFile.version), callbackManifestChecked(!0);} catch (ex) {noManifestFile();} else noManifestFile();}, !1), xhr.addEventListener("error", () => {if (timeStampUsed) {timeStampUsed = !1;const retryManifestURL = createManifestURL();xhr.open("GET", retryManifestURL), xhr.send();} else noManifestFile();}, !1);try {xhr.send();} catch (ex) {logger/* Logger.Error */.Y.Error("Error on XHR send request."), callbackManifestChecked(!1);}}open(successCallback, errorCallback) {const handleError = () => {this._isSupported = !1, errorCallback && errorCallback();};if (!this._idbFactory || !(this._enableSceneOffline || this._enableTexturesOffline)) this._isSupported = !1, errorCallback && errorCallback();else if (!this._db) {this._hasReachedQuota = !1, this._isSupported = !0;const request = this._idbFactory.open("babylonjs", 1);request.onerror = () => {handleError();}, request.onblocked = () => {logger/* Logger.Error */.Y.Error("IDB request blocked. Please reload the page."), handleError();}, request.onsuccess = () => {this._db = request.result, successCallback();}, request.onupgradeneeded = (event) => {if (this._db = event.target.result, this._db) try {this._db.createObjectStore("scenes", { keyPath: "sceneUrl" }), this._db.createObjectStore("versions", { keyPath: "sceneUrl" }), this._db.createObjectStore("textures", { keyPath: "textureUrl" });} catch (ex) {logger/* Logger.Error */.Y.Error("Error while creating object stores. Exception: " + ex.message), handleError();}};} else successCallback && successCallback();}loadImage(url, image) {const completeURL = Database._ReturnFullUrlLocation(url),saveAndLoadImage = () => {this._hasReachedQuota || null === this._db ? image.src = url : this._saveImageIntoDBAsync(completeURL, image);};this._mustUpdateRessources ? saveAndLoadImage() : this._loadImageFromDBAsync(completeURL, image, saveAndLoadImage);}_loadImageFromDBAsync(url, image, notInDBCallback) {if (this._isSupported && null !== this._db) {let texture;const transaction = this._db.transaction(["textures"]);transaction.onabort = () => {image.src = url;}, transaction.oncomplete = () => {let blobTextureURL;texture && "function" == typeof URL ? (blobTextureURL = URL.createObjectURL(texture.data), image.onerror = () => {logger/* Logger.Error */.Y.Error("Error loading image from blob URL: " + blobTextureURL + " switching back to web url: " + url), image.src = url;}, image.src = blobTextureURL) : notInDBCallback();};const getRequest = transaction.objectStore("textures").get(url);getRequest.onsuccess = (event) => {texture = event.target.result;}, getRequest.onerror = () => {logger/* Logger.Error */.Y.Error("Error loading texture " + url + " from DB."), image.src = url;};} else logger/* Logger.Error */.Y.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."), image.src = url;}_saveImageIntoDBAsync(url, image) {let blob;if (this._isSupported) {const generateBlobUrl = () => {let blobTextureURL;if (blob && "function" == typeof URL) try {blobTextureURL = URL.createObjectURL(blob);} catch (ex) {blobTextureURL = URL.createObjectURL(blob);}blobTextureURL && (image.src = blobTextureURL);};if (Database._IsUASupportingBlobStorage) {const xhr = new webRequest/* WebRequest */.g();xhr.open("GET", url), xhr.responseType = "blob", xhr.addEventListener("load", () => {if (200 === xhr.status && this._db) {blob = xhr.response;const transaction = this._db.transaction(["textures"], "readwrite");transaction.onabort = (event) => {try {const srcElement = event.target,error = srcElement.error;error && "QuotaExceededError" === error.name && (this._hasReachedQuota = !0);} catch (ex) {}generateBlobUrl();}, transaction.oncomplete = () => {generateBlobUrl();};const newTexture = { textureUrl: url, data: blob };try {const addRequest = transaction.objectStore("textures").put(newTexture);addRequest.onsuccess = () => {}, addRequest.onerror = () => {generateBlobUrl();};} catch (ex) {25 === ex.code && (Database._IsUASupportingBlobStorage = !1, this._enableTexturesOffline = !1), image.src = url;}} else image.src = url;}, !1), xhr.addEventListener("error", () => {logger/* Logger.Error */.Y.Error("Error in XHR request in BABYLON.Database."), image.src = url;}, !1), xhr.send();} else image.src = url;} else logger/* Logger.Error */.Y.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."), image.src = url;}_checkVersionFromDB(url, versionLoaded) {const updateVersion = () => {this._saveVersionIntoDBAsync(url, versionLoaded);};this._loadVersionFromDBAsync(url, versionLoaded, updateVersion);}_loadVersionFromDBAsync(url, callback, updateInDBCallback) {if (this._isSupported && this._db) {let version;try {const transaction = this._db.transaction(["versions"]);transaction.oncomplete = () => {version ? this._manifestVersionFound === version.data ? callback(version.data) : (this._mustUpdateRessources = !0, updateInDBCallback()) : (this._mustUpdateRessources = !0, updateInDBCallback());}, transaction.onabort = () => {callback(-1);};const getRequest = transaction.objectStore("versions").get(url);getRequest.onsuccess = (event) => {version = event.target.result;}, getRequest.onerror = () => {logger/* Logger.Error */.Y.Error("Error loading version for scene " + url + " from DB."), callback(-1);};} catch (ex) {logger/* Logger.Error */.Y.Error("Error while accessing 'versions' object store (READ OP). Exception: " + ex.message), callback(-1);}} else logger/* Logger.Error */.Y.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."), callback(-1);}_saveVersionIntoDBAsync(url, callback) {if (this._isSupported && !this._hasReachedQuota && this._db) try {const transaction = this._db.transaction(["versions"], "readwrite");transaction.onabort = (event) => {try {const error = event.target.error;error && "QuotaExceededError" === error.name && (this._hasReachedQuota = !0);} catch (ex) {}callback(-1);}, transaction.oncomplete = () => {callback(this._manifestVersionFound);};const newVersion = { sceneUrl: url, data: this._manifestVersionFound },addRequest = transaction.objectStore("versions").put(newVersion);addRequest.onsuccess = () => {}, addRequest.onerror = () => {logger/* Logger.Error */.Y.Error("Error in DB add version request in BABYLON.Database.");};} catch (ex) {logger/* Logger.Error */.Y.Error("Error while accessing 'versions' object store (WRITE OP). Exception: " + ex.message), callback(-1);} else callback(-1);}loadFile(url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer) {const completeUrl = Database._ReturnFullUrlLocation(url),saveAndLoadFile = () => {this._saveFileAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback);};this._checkVersionFromDB(completeUrl, (version) => {-1 === version ? errorCallback && errorCallback() : this._mustUpdateRessources ? this._saveFileAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback) : this._loadFileAsync(completeUrl, sceneLoaded, saveAndLoadFile);});}_loadFileAsync(url, callback, notInDBCallback) {if (this._isSupported && this._db) {let targetStore = -1 === url.indexOf(".babylon") ? "textures" : "scenes";let file;const transaction = this._db.transaction([targetStore]);transaction.oncomplete = () => {file ? callback(file.data) : notInDBCallback();}, transaction.onabort = () => {notInDBCallback();};const getRequest = transaction.objectStore(targetStore).get(url);getRequest.onsuccess = (event) => {file = event.target.result;}, getRequest.onerror = () => {logger/* Logger.Error */.Y.Error("Error loading file " + url + " from DB."), notInDBCallback();};} else logger/* Logger.Error */.Y.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."), callback();}_saveFileAsync(url, callback, progressCallback, useArrayBuffer, errorCallback) {if (this._isSupported) {let targetStore = -1 === url.indexOf(".babylon") ? "textures" : "scenes";const xhr = new webRequest/* WebRequest */.g();let fileData;xhr.open("GET", url + (null == url.match(/\?/) ? "?" : "&") + Date.now()), useArrayBuffer && (xhr.responseType = "arraybuffer"), progressCallback && (xhr.onprogress = progressCallback), xhr.addEventListener("load", () => {if (!(200 === xhr.status || 400 > xhr.status && Database._ValidateXHRData(xhr, useArrayBuffer ? 6 : 1))) 400 <= xhr.status && errorCallback ? errorCallback(xhr) : callback();else if (fileData = useArrayBuffer ? xhr.response : xhr.responseText, !this._hasReachedQuota && this._db) {const transaction = this._db.transaction([targetStore], "readwrite");transaction.onabort = (event) => {try {const error = event.target.error;error && "QuotaExceededError" === error.name && (this._hasReachedQuota = !0);} catch (ex) {}callback(fileData);}, transaction.oncomplete = () => {callback(fileData);};let newFile = "scenes" === targetStore ? { sceneUrl: url, data: fileData, version: this._manifestVersionFound } : { textureUrl: url, data: fileData };try {const addRequest = transaction.objectStore(targetStore).put(newFile);addRequest.onsuccess = () => {}, addRequest.onerror = () => {logger/* Logger.Error */.Y.Error("Error in DB add file request in BABYLON.Database.");};} catch (ex) {callback(fileData);}} else callback(fileData);}, !1), xhr.addEventListener("error", () => {logger/* Logger.Error */.Y.Error("error on XHR request."), errorCallback && errorCallback();}, !1), xhr.send();} else logger/* Logger.Error */.Y.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."), errorCallback && errorCallback();}static _ValidateXHRData(xhr, dataType = 7) {try {if (1 & dataType) {if (xhr.responseText && 0 < xhr.responseText.length) return !0;if (1 === dataType) return !1;}if (2 & dataType) {const tgaHeader = GetTGAHeader(xhr.response);if (tgaHeader.width && tgaHeader.height && 0 < tgaHeader.width && 0 < tgaHeader.height) return !0;if (2 === dataType) return !1;}if (4 & dataType) {const ddsHeader = new Uint8Array(xhr.response, 0, 3);return 68 === ddsHeader[0] && 68 === ddsHeader[1] && 83 === ddsHeader[2];}} catch (e) {}return !1;}}Database._IsUASupportingBlobStorage = !0, Database.IDBStorageEnabled = !1, Database._ParseURL = (url) => {const a = document.createElement("a");a.href = url;const urlWithoutHash = url.substring(0, url.lastIndexOf("#")),fileName = url.substring(urlWithoutHash.lastIndexOf("/") + 1, url.length),absLocation = url.substring(0, url.indexOf(fileName, 0));return absLocation;}, Database._ReturnFullUrlLocation = (url) => -1 === url.indexOf("http:/") && -1 === url.indexOf("https:/") && "undefined" != typeof window ? Database._ParseURL(window.location.href) + url : url;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Offline/IOfflineProvider.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Offline/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/uniformBufferEffectCommonAccessor.js
class UniformBufferEffectCommonAccessor {_isUbo(uboOrEffect) {return uboOrEffect.addUniform !== void 0;}constructor(uboOrEffect) {this._isUbo(uboOrEffect) ? (this.setMatrix3x3 = uboOrEffect.updateMatrix3x3.bind(uboOrEffect), this.setMatrix2x2 = uboOrEffect.updateMatrix2x2.bind(uboOrEffect), this.setFloat = uboOrEffect.updateFloat.bind(uboOrEffect), this.setFloat2 = uboOrEffect.updateFloat2.bind(uboOrEffect), this.setFloat3 = uboOrEffect.updateFloat3.bind(uboOrEffect), this.setFloat4 = uboOrEffect.updateFloat4.bind(uboOrEffect), this.setFloatArray = uboOrEffect.updateFloatArray.bind(uboOrEffect), this.setArray = uboOrEffect.updateArray.bind(uboOrEffect), this.setIntArray = uboOrEffect.updateIntArray.bind(uboOrEffect), this.setMatrix = uboOrEffect.updateMatrix.bind(uboOrEffect), this.setMatrices = uboOrEffect.updateMatrices.bind(uboOrEffect), this.setVector3 = uboOrEffect.updateVector3.bind(uboOrEffect), this.setVector4 = uboOrEffect.updateVector4.bind(uboOrEffect), this.setColor3 = uboOrEffect.updateColor3.bind(uboOrEffect), this.setColor4 = uboOrEffect.updateColor4.bind(uboOrEffect), this.setDirectColor4 = uboOrEffect.updateDirectColor4.bind(uboOrEffect), this.setInt = uboOrEffect.updateInt.bind(uboOrEffect), this.setInt2 = uboOrEffect.updateInt2.bind(uboOrEffect), this.setInt3 = uboOrEffect.updateInt3.bind(uboOrEffect), this.setInt4 = uboOrEffect.updateInt4.bind(uboOrEffect)) : (this.setMatrix3x3 = uboOrEffect.setMatrix3x3.bind(uboOrEffect), this.setMatrix2x2 = uboOrEffect.setMatrix2x2.bind(uboOrEffect), this.setFloat = uboOrEffect.setFloat.bind(uboOrEffect), this.setFloat2 = uboOrEffect.setFloat2.bind(uboOrEffect), this.setFloat3 = uboOrEffect.setFloat3.bind(uboOrEffect), this.setFloat4 = uboOrEffect.setFloat4.bind(uboOrEffect), this.setFloatArray = uboOrEffect.setFloatArray.bind(uboOrEffect), this.setArray = uboOrEffect.setArray.bind(uboOrEffect), this.setIntArray = uboOrEffect.setIntArray.bind(uboOrEffect), this.setMatrix = uboOrEffect.setMatrix.bind(uboOrEffect), this.setMatrices = uboOrEffect.setMatrices.bind(uboOrEffect), this.setVector3 = uboOrEffect.setVector3.bind(uboOrEffect), this.setVector4 = uboOrEffect.setVector4.bind(uboOrEffect), this.setColor3 = uboOrEffect.setColor3.bind(uboOrEffect), this.setColor4 = uboOrEffect.setColor4.bind(uboOrEffect), this.setDirectColor4 = uboOrEffect.setDirectColor4.bind(uboOrEffect), this.setInt = uboOrEffect.setInt.bind(uboOrEffect), this.setInt2 = uboOrEffect.setInt2.bind(uboOrEffect), this.setInt3 = uboOrEffect.setInt3.bind(uboOrEffect), this.setInt4 = uboOrEffect.setInt4.bind(uboOrEffect));}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/gpuUpdateParticles.fragment.js
const gpuUpdateParticles_fragment_name = "gpuUpdateParticlesPixelShader",gpuUpdateParticles_fragment_shader = `#version 300 es
void main() {
discard;
}
`;shaderStore/* ShaderStore.ShadersStore.gpuUpdateParticlesPixelShader */.v.ShadersStore.gpuUpdateParticlesPixelShader = gpuUpdateParticles_fragment_shader;const gpuUpdateParticlesPixelShader = { name: "gpuUpdateParticlesPixelShader", shader: gpuUpdateParticles_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/gpuUpdateParticles.vertex.js
const gpuUpdateParticles_vertex_name = "gpuUpdateParticlesVertexShader",gpuUpdateParticles_vertex_shader = `#version 300 es
#define PI 3.14159
uniform float currentCount;
uniform float timeDelta;
uniform float stopFactor;
#ifndef LOCAL
uniform mat4 emitterWM;
#endif
uniform vec2 lifeTime;
uniform vec2 emitPower;
uniform vec2 sizeRange;
uniform vec4 scaleRange;
#ifndef COLORGRADIENTS
uniform vec4 color1;
uniform vec4 color2;
#endif
uniform vec3 gravity;
uniform sampler2D randomSampler;
uniform sampler2D randomSampler2;
uniform vec4 angleRange;
#ifdef BOXEMITTER
uniform vec3 direction1;
uniform vec3 direction2;
uniform vec3 minEmitBox;
uniform vec3 maxEmitBox;
#endif
#ifdef POINTEMITTER
uniform vec3 direction1;
uniform vec3 direction2;
#endif
#ifdef HEMISPHERICEMITTER
uniform float radius;
uniform float radiusRange;
uniform float directionRandomizer;
#endif
#ifdef SPHEREEMITTER
uniform float radius;
uniform float radiusRange;
#ifdef DIRECTEDSPHEREEMITTER
uniform vec3 direction1;
uniform vec3 direction2;
#else
uniform float directionRandomizer;
#endif
#endif
#ifdef CYLINDEREMITTER
uniform float radius;
uniform float height;
uniform float radiusRange;
#ifdef DIRECTEDCYLINDEREMITTER
uniform vec3 direction1;
uniform vec3 direction2;
#else
uniform float directionRandomizer;
#endif
#endif
#ifdef CONEEMITTER
uniform vec2 radius;
uniform float coneAngle;
uniform vec2 height;
uniform float directionRandomizer;
#endif
in vec3 position;
#ifdef CUSTOMEMITTER
in vec3 initialPosition;
#endif
in float age;
in float life;
in vec4 seed;
in vec3 size;
#ifndef COLORGRADIENTS
in vec4 color;
#endif
in vec3 direction;
#ifndef BILLBOARD
in vec3 initialDirection;
#endif
#ifdef ANGULARSPEEDGRADIENTS
in float angle;
#else
in vec2 angle;
#endif
#ifdef ANIMATESHEET
in float cellIndex;
#ifdef ANIMATESHEETRANDOMSTART
in float cellStartOffset;
#endif
#endif
#ifdef NOISE
in vec3 noiseCoordinates1;
in vec3 noiseCoordinates2;
#endif
out vec3 outPosition;
#ifdef CUSTOMEMITTER
out vec3 outInitialPosition;
#endif
out float outAge;
out float outLife;
out vec4 outSeed;
out vec3 outSize;
#ifndef COLORGRADIENTS
out vec4 outColor;
#endif
out vec3 outDirection;
#ifndef BILLBOARD
out vec3 outInitialDirection;
#endif
#ifdef ANGULARSPEEDGRADIENTS
out float outAngle;
#else
out vec2 outAngle;
#endif
#ifdef ANIMATESHEET
out float outCellIndex;
#ifdef ANIMATESHEETRANDOMSTART
out float outCellStartOffset;
#endif
#endif
#ifdef NOISE
out vec3 outNoiseCoordinates1;
out vec3 outNoiseCoordinates2;
#endif
#ifdef SIZEGRADIENTS
uniform sampler2D sizeGradientSampler;
#endif 
#ifdef ANGULARSPEEDGRADIENTS
uniform sampler2D angularSpeedGradientSampler;
#endif 
#ifdef VELOCITYGRADIENTS
uniform sampler2D velocityGradientSampler;
#endif
#ifdef LIMITVELOCITYGRADIENTS
uniform sampler2D limitVelocityGradientSampler;
uniform float limitVelocityDamping;
#endif
#ifdef DRAGGRADIENTS
uniform sampler2D dragGradientSampler;
#endif
#ifdef NOISE
uniform vec3 noiseStrength;
uniform sampler2D noiseSampler;
#endif
#ifdef ANIMATESHEET
uniform vec4 cellInfos;
#endif
vec3 getRandomVec3(float offset) {
return texture(randomSampler2,vec2(float(gl_VertexID)*offset/currentCount,0)).rgb;
}
vec4 getRandomVec4(float offset) {
return texture(randomSampler,vec2(float(gl_VertexID)*offset/currentCount,0));
}
void main() {
float newAge=age+timeDelta; 
if (newAge>=life && stopFactor != 0.) {
vec3 newPosition;
vec3 newDirection;
vec4 randoms=getRandomVec4(seed.x);
outLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;
outAge=newAge-life;
outSeed=seed;
#ifdef SIZEGRADIENTS 
outSize.x=texture(sizeGradientSampler,vec2(0,0)).r;
#else
outSize.x=sizeRange.x+(sizeRange.y-sizeRange.x)*randoms.g;
#endif
outSize.y=scaleRange.x+(scaleRange.y-scaleRange.x)*randoms.b;
outSize.z=scaleRange.z+(scaleRange.w-scaleRange.z)*randoms.a; 
#ifndef COLORGRADIENTS
outColor=color1+(color2-color1)*randoms.b;
#endif
#ifndef ANGULARSPEEDGRADIENTS 
outAngle.y=angleRange.x+(angleRange.y-angleRange.x)*randoms.a;
outAngle.x=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;
#else
outAngle=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;
#endif 
#ifdef POINTEMITTER
vec3 randoms2=getRandomVec3(seed.y);
vec3 randoms3=getRandomVec3(seed.z);
newPosition=vec3(0,0,0);
newDirection=direction1+(direction2-direction1)*randoms3;
#elif defined(BOXEMITTER)
vec3 randoms2=getRandomVec3(seed.y);
vec3 randoms3=getRandomVec3(seed.z);
newPosition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;
newDirection=direction1+(direction2-direction1)*randoms3; 
#elif defined(HEMISPHERICEMITTER)
vec3 randoms2=getRandomVec3(seed.y);
vec3 randoms3=getRandomVec3(seed.z);
float phi=2.0*PI*randoms2.x;
float theta=acos(2.0*randoms2.y-1.0);
float randX=cos(phi)*sin(theta);
float randY=cos(theta);
float randZ=sin(phi)*sin(theta);
newPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);
newDirection=newPosition+directionRandomizer*randoms3; 
#elif defined(SPHEREEMITTER)
vec3 randoms2=getRandomVec3(seed.y);
vec3 randoms3=getRandomVec3(seed.z);
float phi=2.0*PI*randoms2.x;
float theta=acos(2.0*randoms2.y-1.0);
float randX=cos(phi)*sin(theta);
float randY=cos(theta);
float randZ=sin(phi)*sin(theta);
newPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);
#ifdef DIRECTEDSPHEREEMITTER
newDirection=normalize(direction1+(direction2-direction1)*randoms3);
#else
newDirection=normalize(newPosition+directionRandomizer*randoms3);
#endif
#elif defined(CYLINDEREMITTER)
vec3 randoms2=getRandomVec3(seed.y);
vec3 randoms3=getRandomVec3(seed.z);
float yPos=(randoms2.x-0.5)*height;
float angle=randoms2.y*PI*2.;
float inverseRadiusRangeSquared=((1.-radiusRange)*(1.-radiusRange));
float positionRadius=radius*sqrt(inverseRadiusRangeSquared+(randoms2.z*(1.-inverseRadiusRangeSquared)));
float xPos=positionRadius*cos(angle);
float zPos=positionRadius*sin(angle);
newPosition=vec3(xPos,yPos,zPos);
#ifdef DIRECTEDCYLINDEREMITTER
newDirection=direction1+(direction2-direction1)*randoms3;
#else
angle=angle+((randoms3.x-0.5)*PI)*directionRandomizer;
newDirection=vec3(cos(angle),(randoms3.y-0.5)*directionRandomizer,sin(angle));
newDirection=normalize(newDirection);
#endif
#elif defined(CONEEMITTER)
vec3 randoms2=getRandomVec3(seed.y);
float s=2.0*PI*randoms2.x;
#ifdef CONEEMITTERSPAWNPOINT
float h=0.0001;
#else
float h=randoms2.y*height.y;
h=1.-h*h; 
#endif
float lRadius=radius.x-radius.x*randoms2.z*radius.y;
lRadius=lRadius*h;
float randX=lRadius*sin(s);
float randZ=lRadius*cos(s);
float randY=h *height.x;
newPosition=vec3(randX,randY,randZ); 
if (abs(cos(coneAngle))==1.0) {
newDirection=vec3(0.,1.0,0.);
} else {
vec3 randoms3=getRandomVec3(seed.z);
newDirection=normalize(newPosition+directionRandomizer*randoms3); 
}
#elif defined(CUSTOMEMITTER)
newPosition=initialPosition;
outInitialPosition=initialPosition;
#else 
newPosition=vec3(0.,0.,0.);
newDirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));
#endif
float power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;
#ifdef LOCAL
outPosition=newPosition;
#else
outPosition=(emitterWM*vec4(newPosition,1.)).xyz;
#endif
#ifdef CUSTOMEMITTER
outDirection=direction;
#ifndef BILLBOARD 
outInitialDirection=direction;
#endif
#else
#ifdef LOCAL
vec3 initial=newDirection;
#else 
vec3 initial=(emitterWM*vec4(newDirection,0.)).xyz;
#endif
outDirection=initial*power;
#ifndef BILLBOARD 
outInitialDirection=initial;
#endif
#endif
#ifdef ANIMATESHEET 
outCellIndex=cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
outCellStartOffset=randoms.a*outLife;
#endif 
#endif
#ifdef NOISE
outNoiseCoordinates1=noiseCoordinates1;
outNoiseCoordinates2=noiseCoordinates2;
#endif
} else {
float directionScale=timeDelta;
outAge=newAge;
float ageGradient=newAge/life;
#ifdef VELOCITYGRADIENTS
directionScale*=texture(velocityGradientSampler,vec2(ageGradient,0)).r;
#endif
#ifdef DRAGGRADIENTS
directionScale*=1.0-texture(dragGradientSampler,vec2(ageGradient,0)).r;
#endif
#if defined(CUSTOMEMITTER)
outPosition=position+(direction-position)*ageGradient; 
outInitialPosition=initialPosition;
#else
outPosition=position+direction*directionScale;
#endif
outLife=life;
outSeed=seed;
#ifndef COLORGRADIENTS 
outColor=color;
#endif
#ifdef SIZEGRADIENTS
outSize.x=texture(sizeGradientSampler,vec2(ageGradient,0)).r;
outSize.yz=size.yz;
#else
outSize=size;
#endif 
#ifndef BILLBOARD 
outInitialDirection=initialDirection;
#endif
#ifdef CUSTOMEMITTER
outDirection=direction;
#else
vec3 updatedDirection=direction+gravity*timeDelta;
#ifdef LIMITVELOCITYGRADIENTS
float limitVelocity=texture(limitVelocityGradientSampler,vec2(ageGradient,0)).r;
float currentVelocity=length(updatedDirection);
if (currentVelocity>limitVelocity) {
updatedDirection=updatedDirection*limitVelocityDamping;
}
#endif
outDirection=updatedDirection;
#ifdef NOISE
float fetchedR=texture(noiseSampler,vec2(noiseCoordinates1.x,noiseCoordinates1.y)*vec2(0.5)+vec2(0.5)).r;
float fetchedG=texture(noiseSampler,vec2(noiseCoordinates1.z,noiseCoordinates2.x)*vec2(0.5)+vec2(0.5)).r;
float fetchedB=texture(noiseSampler,vec2(noiseCoordinates2.y,noiseCoordinates2.z)*vec2(0.5)+vec2(0.5)).r;
vec3 force=vec3(2.*fetchedR-1.,2.*fetchedG-1.,2.*fetchedB-1.)*noiseStrength;
outDirection=outDirection+force*timeDelta;
outNoiseCoordinates1=noiseCoordinates1;
outNoiseCoordinates2=noiseCoordinates2;
#endif 
#endif 
#ifdef ANGULARSPEEDGRADIENTS
float angularSpeed=texture(angularSpeedGradientSampler,vec2(ageGradient,0)).r;
outAngle=angle+angularSpeed*timeDelta;
#else
outAngle=vec2(angle.x+angle.y*timeDelta,angle.y);
#endif
#ifdef ANIMATESHEET 
float offsetAge=outAge;
float dist=cellInfos.y-cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
outCellStartOffset=cellStartOffset;
offsetAge+=cellStartOffset;
#else
float cellStartOffset=0.;
#endif 
float ratio=0.;
if (cellInfos.w==1.0) {
ratio=clamp(mod(cellStartOffset+cellInfos.z*offsetAge,life)/life,0.,1.0);
}
else {
ratio=clamp(cellStartOffset+cellInfos.z*offsetAge/life,0.,1.0);
}
outCellIndex=float(int(cellInfos.x+ratio*dist));
#endif
}
}`;shaderStore/* ShaderStore.ShadersStore.gpuUpdateParticlesVertexShader */.v.ShadersStore.gpuUpdateParticlesVertexShader = gpuUpdateParticles_vertex_shader;const gpuUpdateParticlesVertexShader = { name: "gpuUpdateParticlesVertexShader", shader: gpuUpdateParticles_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/webgl2ParticleSystem.js
class WebGL2ParticleSystem {constructor(parent, engine) {this._renderVAO = [], this._updateVAO = [], this.alignDataInBuffer = !1, this._parent = parent, this._engine = engine, this._updateEffectOptions = { attributes: ["position", "initialPosition", "age", "life", "seed", "size", "color", "direction", "initialDirection", "angle", "cellIndex", "cellStartOffset", "noiseCoordinates1", "noiseCoordinates2"], uniformsNames: ["currentCount", "timeDelta", "emitterWM", "lifeTime", "color1", "color2", "sizeRange", "scaleRange", "gravity", "emitPower", "direction1", "direction2", "minEmitBox", "maxEmitBox", "radius", "directionRandomizer", "height", "coneAngle", "stopFactor", "angleRange", "radiusRange", "cellInfos", "noiseStrength", "limitVelocityDamping"], uniformBuffersNames: [], samplers: ["randomSampler", "randomSampler2", "sizeGradientSampler", "angularSpeedGradientSampler", "velocityGradientSampler", "limitVelocityGradientSampler", "noiseSampler", "dragGradientSampler"], defines: "", fallbacks: null, onCompiled: null, onError: null, indexParameters: null, maxSimultaneousLights: 0, transformFeedbackVaryings: [] };}isUpdateBufferCreated() {return !!this._updateEffect;}isUpdateBufferReady() {var _a, _b;return !(null === (_b = null === (_a = this._updateEffect) || void 0 === _a ? void 0 : _a.isReady()) || void 0 === _b) && _b;}createUpdateBuffer(defines) {return this._updateEffectOptions.transformFeedbackVaryings = ["outPosition"], this._updateEffectOptions.transformFeedbackVaryings.push("outAge"), this._updateEffectOptions.transformFeedbackVaryings.push("outSize"), this._updateEffectOptions.transformFeedbackVaryings.push("outLife"), this._updateEffectOptions.transformFeedbackVaryings.push("outSeed"), this._updateEffectOptions.transformFeedbackVaryings.push("outDirection"), this._parent.particleEmitterType instanceof CustomParticleEmitter && this._updateEffectOptions.transformFeedbackVaryings.push("outInitialPosition"), this._parent._colorGradientsTexture || this._updateEffectOptions.transformFeedbackVaryings.push("outColor"), this._parent._isBillboardBased || this._updateEffectOptions.transformFeedbackVaryings.push("outInitialDirection"), this._parent.noiseTexture && (this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates1"), this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates2")), this._updateEffectOptions.transformFeedbackVaryings.push("outAngle"), this._parent.isAnimationSheetEnabled && (this._updateEffectOptions.transformFeedbackVaryings.push("outCellIndex"), this._parent.spriteRandomStartCell && this._updateEffectOptions.transformFeedbackVaryings.push("outCellStartOffset")), this._updateEffectOptions.defines = defines, this._updateEffect = new Materials_effect/* Effect */.Q("gpuUpdateParticles", this._updateEffectOptions, this._engine), new UniformBufferEffectCommonAccessor(this._updateEffect);}createVertexBuffers(updateBuffer, renderVertexBuffers) {this._updateVAO.push(this._createUpdateVAO(updateBuffer)), this._renderVAO.push(this._engine.recordVertexArrayObject(renderVertexBuffers, null, this._parent._getWrapper(this._parent.blendMode).effect)), this._engine.bindArrayBuffer(null);}createParticleBuffer(data) {return data;}bindDrawBuffers(index) {this._engine.bindVertexArrayObject(this._renderVAO[index], null);}preUpdateParticleBuffer() {const engine = this._engine;if (this._engine.enableEffect(this._updateEffect), !engine.setState) throw new Error("GPU particles cannot work without a full Engine. ThinEngine is not supported");}updateParticleBuffer(index, targetBuffer, currentActiveCount) {this._updateEffect.setTexture("randomSampler", this._parent._randomTexture), this._updateEffect.setTexture("randomSampler2", this._parent._randomTexture2), this._parent._sizeGradientsTexture && this._updateEffect.setTexture("sizeGradientSampler", this._parent._sizeGradientsTexture), this._parent._angularSpeedGradientsTexture && this._updateEffect.setTexture("angularSpeedGradientSampler", this._parent._angularSpeedGradientsTexture), this._parent._velocityGradientsTexture && this._updateEffect.setTexture("velocityGradientSampler", this._parent._velocityGradientsTexture), this._parent._limitVelocityGradientsTexture && this._updateEffect.setTexture("limitVelocityGradientSampler", this._parent._limitVelocityGradientsTexture), this._parent._dragGradientsTexture && this._updateEffect.setTexture("dragGradientSampler", this._parent._dragGradientsTexture), this._parent.noiseTexture && this._updateEffect.setTexture("noiseSampler", this._parent.noiseTexture), this._engine.bindVertexArrayObject(this._updateVAO[index], null);const engine = this._engine;engine.bindTransformFeedbackBuffer(targetBuffer.getBuffer()), engine.setRasterizerState(!1), engine.beginTransformFeedback(!0), engine.drawArraysType(3, 0, currentActiveCount), engine.endTransformFeedback(), engine.setRasterizerState(!0), engine.bindTransformFeedbackBuffer(null);}releaseBuffers() {}releaseVertexBuffers() {for (let index = 0; index < this._updateVAO.length; index++) this._engine.releaseVertexArrayObject(this._updateVAO[index]);this._updateVAO.length = 0;for (let index = 0; index < this._renderVAO.length; index++) this._engine.releaseVertexArrayObject(this._renderVAO[index]);this._renderVAO.length = 0;}_createUpdateVAO(source) {const updateVertexBuffers = { position: source.createVertexBuffer("position", 0, 3) };let offset = 3;updateVertexBuffers.age = source.createVertexBuffer("age", offset, 1), offset += 1, updateVertexBuffers.size = source.createVertexBuffer("size", offset, 3), offset += 3, updateVertexBuffers.life = source.createVertexBuffer("life", offset, 1), offset += 1, updateVertexBuffers.seed = source.createVertexBuffer("seed", offset, 4), offset += 4, updateVertexBuffers.direction = source.createVertexBuffer("direction", offset, 3), offset += 3, this._parent.particleEmitterType instanceof CustomParticleEmitter && (updateVertexBuffers.initialPosition = source.createVertexBuffer("initialPosition", offset, 3), offset += 3), this._parent._colorGradientsTexture || (updateVertexBuffers.color = source.createVertexBuffer("color", offset, 4), offset += 4), this._parent._isBillboardBased || (updateVertexBuffers.initialDirection = source.createVertexBuffer("initialDirection", offset, 3), offset += 3), this._parent.noiseTexture && (updateVertexBuffers.noiseCoordinates1 = source.createVertexBuffer("noiseCoordinates1", offset, 3), offset += 3, updateVertexBuffers.noiseCoordinates2 = source.createVertexBuffer("noiseCoordinates2", offset, 3), offset += 3), this._parent._angularSpeedGradientsTexture ? (updateVertexBuffers.angle = source.createVertexBuffer("angle", offset, 1), offset += 1) : (updateVertexBuffers.angle = source.createVertexBuffer("angle", offset, 2), offset += 2), this._parent._isAnimationSheetEnabled && (updateVertexBuffers.cellIndex = source.createVertexBuffer("cellIndex", offset, 1), offset += 1, this._parent.spriteRandomStartCell && (updateVertexBuffers.cellStartOffset = source.createVertexBuffer("cellStartOffset", offset, 1), offset += 1));const vao = this._engine.recordVertexArrayObject(updateVertexBuffers, null, this._updateEffect);return this._engine.bindArrayBuffer(null), vao;}}(0,typeStore/* RegisterClass */.H)("BABYLON.WebGL2ParticleSystem", WebGL2ParticleSystem);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/gpuUpdateParticles.compute.js
const gpuUpdateParticles_compute_name = "gpuUpdateParticlesComputeShader",gpuUpdateParticles_compute_shader = `struct Particle {
position : vec3<f32>,
age : f32,
size : vec3<f32>,
life : f32,
seed : vec4<f32>,
direction : vec3<f32>,
dummy0: f32,
#ifdef CUSTOMEMITTER
initialPosition : vec3<f32>,
dummy1: f32,
#endif
#ifndef COLORGRADIENTS
color : vec4<f32>,
#endif
#ifndef BILLBOARD
initialDirection : vec3<f32>,
dummy2: f32,
#endif
#ifdef NOISE
noiseCoordinates1 : vec3<f32>,
dummy3: f32,
noiseCoordinates2 : vec3<f32>,
dummy4: f32,
#endif
#ifdef ANGULARSPEEDGRADIENTS
angle : f32,
#else
angle : vec2<f32>,
#endif
#ifdef ANIMATESHEET
cellIndex : f32,
#ifdef ANIMATESHEETRANDOMSTART
cellStartOffset : f32,
#endif
#endif
};
struct Particles {
particles : array<Particle>,
};
struct SimParams {
currentCount : f32,
timeDelta : f32,
stopFactor : f32,
randomTextureSize: i32,
lifeTime : vec2<f32>,
emitPower : vec2<f32>,
#ifndef COLORGRADIENTS
color1 : vec4<f32>,
color2 : vec4<f32>,
#endif
sizeRange : vec2<f32>,
scaleRange : vec4<f32>,
angleRange : vec4<f32>,
gravity : vec3<f32>,
#ifdef LIMITVELOCITYGRADIENTS
limitVelocityDamping : f32,
#endif
#ifdef ANIMATESHEET
cellInfos : vec4<f32>,
#endif
#ifdef NOISE
noiseStrength : vec3<f32>,
#endif
#ifndef LOCAL
emitterWM : mat4x4<f32>,
#endif
#ifdef BOXEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
minEmitBox : vec3<f32>,
maxEmitBox : vec3<f32>,
#endif
#ifdef CONEEMITTER
radius : vec2<f32>,
coneAngle : f32,
height : vec2<f32>,
directionRandomizer : f32,
#endif
#ifdef CYLINDEREMITTER
radius : f32,
height : f32,
radiusRange : f32,
#ifdef DIRECTEDCYLINDEREMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#else
directionRandomizer : f32,
#endif
#endif
#ifdef HEMISPHERICEMITTER
radius : f32,
radiusRange : f32,
directionRandomizer : f32,
#endif
#ifdef POINTEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#endif
#ifdef SPHEREEMITTER
radius : f32,
radiusRange : f32,
#ifdef DIRECTEDSPHEREEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#else
directionRandomizer : f32,
#endif
#endif
};
@binding(0) @group(0) var<uniform> params : SimParams;
@binding(1) @group(0) var<storage,read> particlesIn : Particles;
@binding(2) @group(0) var<storage,read_write> particlesOut : Particles;
@binding(3) @group(0) var randomTexture : texture_2d<f32>;
@binding(4) @group(0) var randomTexture2 : texture_2d<f32>;
#ifdef SIZEGRADIENTS
@binding(0) @group(1) var sizeGradientSampler : sampler;
@binding(1) @group(1) var sizeGradientTexture : texture_2d<f32>;
#endif 
#ifdef ANGULARSPEEDGRADIENTS
@binding(2) @group(1) var angularSpeedGradientSampler : sampler;
@binding(3) @group(1) var angularSpeedGradientTexture : texture_2d<f32>;
#endif 
#ifdef VELOCITYGRADIENTS
@binding(4) @group(1) var velocityGradientSampler : sampler;
@binding(5) @group(1) var velocityGradientTexture : texture_2d<f32>;
#endif
#ifdef LIMITVELOCITYGRADIENTS
@binding(6) @group(1) var limitVelocityGradientSampler : sampler;
@binding(7) @group(1) var limitVelocityGradientTexture : texture_2d<f32>;
#endif
#ifdef DRAGGRADIENTS
@binding(8) @group(1) var dragGradientSampler : sampler;
@binding(9) @group(1) var dragGradientTexture : texture_2d<f32>;
#endif
#ifdef NOISE
@binding(10) @group(1) var noiseSampler : sampler;
@binding(11) @group(1) var noiseTexture : texture_2d<f32>;
#endif
fn getRandomVec3(offset : f32,vertexID : f32)->vec3<f32> {
return textureLoad(randomTexture2,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0).rgb;
}
fn getRandomVec4(offset : f32,vertexID : f32)->vec4<f32> {
return textureLoad(randomTexture,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0);
}
@stage(compute) @workgroup_size(64)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
let index : u32=GlobalInvocationID.x;
let vertexID : f32=f32(index);
if (index>=u32(params.currentCount)) {
return;
}
let PI : f32=3.14159;
let timeDelta : f32=params.timeDelta;
let newAge : f32=particlesIn.particles[index].age+timeDelta;
let life : f32=particlesIn.particles[index].life;
let seed : vec4<f32>=particlesIn.particles[index].seed;
let direction : vec3<f32>=particlesIn.particles[index].direction;
if (newAge>=life && params.stopFactor != 0.) {
var newPosition : vec3<f32>;
var newDirection : vec3<f32>;
let randoms : vec4<f32>=getRandomVec4(seed.x,vertexID);
let outLife : f32=params.lifeTime.x+(params.lifeTime.y-params.lifeTime.x)*randoms.r;
particlesOut.particles[index].life=outLife;
particlesOut.particles[index].age=newAge-life;
particlesOut.particles[index].seed=seed;
var sizex : f32;
#ifdef SIZEGRADIENTS 
sizex=textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(0.,0.),0.).r;
#else
sizex=params.sizeRange.x+(params.sizeRange.y-params.sizeRange.x)*randoms.g;
#endif
particlesOut.particles[index].size=vec3<f32>(
sizex,
params.scaleRange.x+(params.scaleRange.y-params.scaleRange.x)*randoms.b,
params.scaleRange.z+(params.scaleRange.w-params.scaleRange.z)*randoms.a);
#ifndef COLORGRADIENTS
particlesOut.particles[index].color=params.color1+(params.color2-params.color1)*randoms.b;
#endif
#ifndef ANGULARSPEEDGRADIENTS 
particlesOut.particles[index].angle=vec2<f32>(
params.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r,
params.angleRange.x+(params.angleRange.y-params.angleRange.x)*randoms.a);
#else
particlesOut.particles[index].angle=params.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r;
#endif 
#if defined(POINTEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);
let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);
newPosition=vec3<f32>(0.,0.,0.);
newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;
#elif defined(BOXEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);
let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);
newPosition=params.minEmitBox+(params.maxEmitBox-params.minEmitBox)*randoms2;
newDirection=params.direction1+(params.direction2-params.direction1)*randoms3; 
#elif defined(HEMISPHERICEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);
let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);
let phi : f32=2.0*PI*randoms2.x;
let theta : f32=acos(-1.0+2.0*randoms2.y);
let randX : f32=cos(phi)*sin(theta);
let randY : f32=cos(theta);
let randZ : f32=sin(phi)*sin(theta);
newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,abs(randY),randZ);
newDirection=normalize(newPosition+params.directionRandomizer*randoms3);
#elif defined(SPHEREEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);
let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);
let phi : f32=2.0*PI*randoms2.x;
let theta : f32=acos(-1.0+2.0*randoms2.y);
let randX : f32=cos(phi)*sin(theta);
let randY : f32=cos(theta);
let randZ : f32=sin(phi)*sin(theta);
newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,randY,randZ);
#ifdef DIRECTEDSPHEREEMITTER
newDirection=normalize(params.direction1+(params.direction2-params.direction1)*randoms3);
#else
newDirection=normalize(newPosition+params.directionRandomizer*randoms3);
#endif
#elif defined(CYLINDEREMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);
let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);
let yPos : f32=(-0.5+randoms2.x)*params.height;
var angle : f32=randoms2.y*PI*2.;
let inverseRadiusRangeSquared : f32=(1.-params.radiusRange)*(1.-params.radiusRange);
let positionRadius : f32=params.radius*sqrt(inverseRadiusRangeSquared+randoms2.z*(1.-inverseRadiusRangeSquared));
let xPos : f32=positionRadius*cos(angle);
let zPos : f32=positionRadius*sin(angle);
newPosition=vec3<f32>(xPos,yPos,zPos);
#ifdef DIRECTEDCYLINDEREMITTER
newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;
#else
angle=angle+(-0.5+randoms3.x)*PI*params.directionRandomizer;
newDirection=vec3<f32>(cos(angle),(-0.5+randoms3.y)*params.directionRandomizer,sin(angle));
newDirection=normalize(newDirection);
#endif
#elif defined(CONEEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);
let s : f32=2.0*PI*randoms2.x;
#ifdef CONEEMITTERSPAWNPOINT
let h : f32=0.0001;
#else
var h : f32=randoms2.y*params.height.y;
h=1.-h*h; 
#endif
var lRadius : f32=params.radius.x-params.radius.x*randoms2.z*params.radius.y;
lRadius=lRadius*h;
let randX : f32=lRadius*sin(s);
let randZ : f32=lRadius*cos(s);
let randY : f32=h *params.height.x;
newPosition=vec3<f32>(randX,randY,randZ); 
if (abs(cos(params.coneAngle))==1.0) {
newDirection=vec3<f32>(0.,1.0,0.);
} else {
let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);
newDirection=normalize(newPosition+params.directionRandomizer*randoms3); 
}
#elif defined(CUSTOMEMITTER)
newPosition=particlesIn.particles[index].initialPosition;
particlesOut.particles[index].initialPosition=newPosition;
#else 
newPosition=vec3<f32>(0.,0.,0.);
newDirection=2.0*(getRandomVec3(seed.w,vertexID)-vec3<f32>(0.5,0.5,0.5));
#endif
let power : f32=params.emitPower.x+(params.emitPower.y-params.emitPower.x)*randoms.a;
#ifdef LOCAL
particlesOut.particles[index].position=newPosition;
#else
particlesOut.particles[index].position=(params.emitterWM*vec4<f32>(newPosition,1.)).xyz;
#endif
#ifdef CUSTOMEMITTER
particlesOut.particles[index].direction=direction;
#ifndef BILLBOARD 
particlesOut.particles[index].initialDirection=direction;
#endif
#else
#ifdef LOCAL
let initial : vec3<f32>=newDirection;
#else 
let initial : vec3<f32>=(params.emitterWM*vec4<f32>(newDirection,0.)).xyz;
#endif
particlesOut.particles[index].direction=initial*power;
#ifndef BILLBOARD 
particlesOut.particles[index].initialDirection=initial;
#endif
#endif
#ifdef ANIMATESHEET 
particlesOut.particles[index].cellIndex=params.cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
particlesOut.particles[index].cellStartOffset=randoms.a*outLife;
#endif 
#endif
#ifdef NOISE
particlesOut.particles[index].noiseCoordinates1=particlesIn.particles[index].noiseCoordinates1;
particlesOut.particles[index].noiseCoordinates2=particlesIn.particles[index].noiseCoordinates2;
#endif
} else {
var directionScale : f32=timeDelta;
particlesOut.particles[index].age=newAge;
let ageGradient : f32=newAge/life;
#ifdef VELOCITYGRADIENTS
directionScale=directionScale*textureSampleLevel(velocityGradientTexture,velocityGradientSampler,vec2<f32>(ageGradient,0.),0.).r;
#endif
#ifdef DRAGGRADIENTS
directionScale=directionScale*(1.0-textureSampleLevel(dragGradientTexture,dragGradientSampler,vec2<f32>(ageGradient,0.),0.).r);
#endif
let position : vec3<f32>=particlesIn.particles[index].position;
#if defined(CUSTOMEMITTER)
particlesOut.particles[index].position=position+(direction-position)*ageGradient; 
particlesOut.particles[index].initialPosition=particlesIn.particles[index].initialPosition;
#else
particlesOut.particles[index].position=position+direction*directionScale;
#endif
particlesOut.particles[index].life=life;
particlesOut.particles[index].seed=seed;
#ifndef COLORGRADIENTS 
particlesOut.particles[index].color=particlesIn.particles[index].color;
#endif
#ifdef SIZEGRADIENTS
particlesOut.particles[index].size=vec3<f32>(
textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(ageGradient,0.),0.).r,
particlesIn.particles[index].size.yz);
#else
particlesOut.particles[index].size=particlesIn.particles[index].size;
#endif 
#ifndef BILLBOARD 
particlesOut.particles[index].initialDirection=particlesIn.particles[index].initialDirection;
#endif
#ifdef CUSTOMEMITTER
particlesOut.particles[index].direction=direction;
#else
var updatedDirection : vec3<f32>=direction+params.gravity*timeDelta;
#ifdef LIMITVELOCITYGRADIENTS
let limitVelocity : f32=textureSampleLevel(limitVelocityGradientTexture,limitVelocityGradientSampler,vec2<f32>(ageGradient,0.),0.).r;
let currentVelocity : f32=length(updatedDirection);
if (currentVelocity>limitVelocity) {
updatedDirection=updatedDirection*params.limitVelocityDamping;
}
#endif
particlesOut.particles[index].direction=updatedDirection;
#ifdef NOISE
let noiseCoordinates1 : vec3<f32>=particlesIn.particles[index].noiseCoordinates1;
let noiseCoordinates2 : vec3<f32>=particlesIn.particles[index].noiseCoordinates2;
let fetchedR : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.x,noiseCoordinates1.y)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;
let fetchedG : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.z,noiseCoordinates2.x)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;
let fetchedB : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates2.y,noiseCoordinates2.z)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;
let force : vec3<f32>=vec3<f32>(-1.+2.*fetchedR,-1.+2.*fetchedG,-1.+2.*fetchedB)*params.noiseStrength;
particlesOut.particles[index].direction=particlesOut.particles[index].direction+force*timeDelta;
particlesOut.particles[index].noiseCoordinates1=noiseCoordinates1;
particlesOut.particles[index].noiseCoordinates2=noiseCoordinates2;
#endif 
#endif 
#ifdef ANGULARSPEEDGRADIENTS
let angularSpeed : f32=textureSampleLevel(angularSpeedGradientTexture,angularSpeedGradientSampler,vec2<f32>(ageGradient,0.),0.).r;
particlesOut.particles[index].angle=particlesIn.particles[index].angle+angularSpeed*timeDelta;
#else
let angle : vec2<f32>=particlesIn.particles[index].angle;
particlesOut.particles[index].angle=vec2<f32>(angle.x+angle.y*timeDelta,angle.y);
#endif
#ifdef ANIMATESHEET 
var offsetAge : f32=particlesOut.particles[index].age;
let dist : f32=params.cellInfos.y-params.cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
let cellStartOffset : f32=particlesIn.particles[index].cellStartOffset;
particlesOut.particles[index].cellStartOffset=cellStartOffset;
offsetAge=offsetAge+cellStartOffset;
#else
let cellStartOffset : f32=0.;
#endif 
var ratio : f32;
if (params.cellInfos.w==1.0) {
ratio=clamp(((cellStartOffset+params.cellInfos.z*offsetAge) % life)/life,0.,1.0);
}
else {
ratio=clamp((cellStartOffset+params.cellInfos.z*offsetAge)/life,0.,1.0);
}
particlesOut.particles[index].cellIndex=f32(i32(params.cellInfos.x+ratio*dist));
#endif
}
}
`;shaderStore/* ShaderStore.ShadersStoreWGSL.gpuUpdateParticlesComputeShader */.v.ShadersStoreWGSL.gpuUpdateParticlesComputeShader = gpuUpdateParticles_compute_shader;const gpuUpdateParticlesComputeShader = { name: "gpuUpdateParticlesComputeShader", shader: gpuUpdateParticles_compute_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/computeShaderParticleSystem.js
class ComputeShaderParticleSystem {constructor(parent, engine) {this._bufferComputeShader = [], this._renderVertexBuffers = [], this.alignDataInBuffer = !0, this._parent = parent, this._engine = engine;}isUpdateBufferCreated() {return !!this._updateComputeShader;}isUpdateBufferReady() {var _a, _b;return !(null === (_b = null === (_a = this._updateComputeShader) || void 0 === _a ? void 0 : _a.isReady()) || void 0 === _b) && _b;}createUpdateBuffer(defines) {var _a;const bindingsMapping = { params: { group: 0, binding: 0 }, particlesIn: { group: 0, binding: 1 }, particlesOut: { group: 0, binding: 2 }, randomTexture: { group: 0, binding: 3 }, randomTexture2: { group: 0, binding: 4 } };return this._parent._sizeGradientsTexture && (bindingsMapping.sizeGradientTexture = { group: 1, binding: 1 }), this._parent._angularSpeedGradientsTexture && (bindingsMapping.angularSpeedGradientTexture = { group: 1, binding: 3 }), this._parent._velocityGradientsTexture && (bindingsMapping.velocityGradientTexture = { group: 1, binding: 5 }), this._parent._limitVelocityGradientsTexture && (bindingsMapping.limitVelocityGradientTexture = { group: 1, binding: 7 }), this._parent._dragGradientsTexture && (bindingsMapping.dragGradientTexture = { group: 1, binding: 9 }), this._parent.noiseTexture && (bindingsMapping.noiseTexture = { group: 1, binding: 11 }), this._updateComputeShader = new ComputeShader("updateParticles", this._engine, "gpuUpdateParticles", { bindingsMapping, defines: defines.split("\n") }), null === (_a = this._simParamsComputeShader) || void 0 === _a ? void 0 : _a.dispose(), this._simParamsComputeShader = new uniformBuffer/* UniformBuffer */.M(this._engine), this._simParamsComputeShader.addUniform("currentCount", 1), this._simParamsComputeShader.addUniform("timeDelta", 1), this._simParamsComputeShader.addUniform("stopFactor", 1), this._simParamsComputeShader.addUniform("randomTextureSize", 1), this._simParamsComputeShader.addUniform("lifeTime", 2), this._simParamsComputeShader.addUniform("emitPower", 2), this._parent._colorGradientsTexture || (this._simParamsComputeShader.addUniform("color1", 4), this._simParamsComputeShader.addUniform("color2", 4)), this._simParamsComputeShader.addUniform("sizeRange", 2), this._simParamsComputeShader.addUniform("scaleRange", 4), this._simParamsComputeShader.addUniform("angleRange", 4), this._simParamsComputeShader.addUniform("gravity", 3), this._parent._limitVelocityGradientsTexture && this._simParamsComputeShader.addUniform("limitVelocityDamping", 1), this._parent.isAnimationSheetEnabled && this._simParamsComputeShader.addUniform("cellInfos", 4), this._parent.noiseTexture && this._simParamsComputeShader.addUniform("noiseStrength", 3), this._parent.isLocal || this._simParamsComputeShader.addUniform("emitterWM", 16), this._parent.particleEmitterType && this._parent.particleEmitterType.buildUniformLayout(this._simParamsComputeShader), this._updateComputeShader.setUniformBuffer("params", this._simParamsComputeShader), new UniformBufferEffectCommonAccessor(this._simParamsComputeShader);}createVertexBuffers(updateBuffer, renderVertexBuffers) {this._renderVertexBuffers.push(renderVertexBuffers);}createParticleBuffer(data) {const buffer = new StorageBuffer(this._engine, 4 * data.length, 11);return buffer.update(data), this._bufferComputeShader.push(buffer), buffer.getBuffer();}bindDrawBuffers(index, effect) {this._engine.bindBuffers(this._renderVertexBuffers[index], null, effect);}preUpdateParticleBuffer() {}updateParticleBuffer(index, targetBuffer, currentActiveCount) {this._simParamsComputeShader.update(), this._updateComputeShader.setTexture("randomTexture", this._parent._randomTexture, !1), this._updateComputeShader.setTexture("randomTexture2", this._parent._randomTexture2, !1), this._parent._sizeGradientsTexture && this._updateComputeShader.setTexture("sizeGradientTexture", this._parent._sizeGradientsTexture), this._parent._angularSpeedGradientsTexture && this._updateComputeShader.setTexture("angularSpeedGradientTexture", this._parent._angularSpeedGradientsTexture), this._parent._velocityGradientsTexture && this._updateComputeShader.setTexture("velocityGradientTexture", this._parent._velocityGradientsTexture), this._parent._limitVelocityGradientsTexture && this._updateComputeShader.setTexture("limitVelocityGradientTexture", this._parent._limitVelocityGradientsTexture), this._parent._dragGradientsTexture && this._updateComputeShader.setTexture("dragGradientTexture", this._parent._dragGradientsTexture), this._parent.noiseTexture && this._updateComputeShader.setTexture("noiseTexture", this._parent.noiseTexture), this._updateComputeShader.setStorageBuffer("particlesIn", this._bufferComputeShader[index]), this._updateComputeShader.setStorageBuffer("particlesOut", this._bufferComputeShader[1 ^ index]), this._updateComputeShader.dispatch(Math.ceil(currentActiveCount / 64));}releaseBuffers() {var _a;for (let i = 0; i < this._bufferComputeShader.length; ++i) this._bufferComputeShader[i].dispose();this._bufferComputeShader.length = 0, null === (_a = this._simParamsComputeShader) || void 0 === _a ? void 0 : _a.dispose(), this._simParamsComputeShader = null, this._updateComputeShader = null;}releaseVertexBuffers() {this._renderVertexBuffers.length = 0;}}(0,typeStore/* RegisterClass */.H)("BABYLON.ComputeShaderParticleSystem", ComputeShaderParticleSystem);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/gradients.js
class ColorGradient {constructor(gradient, color1, color2) {this.gradient = gradient, this.color1 = color1, this.color2 = color2;}getColorToRef(result) {return this.color2 ? void math_color/* Color4.LerpToRef */.HE.LerpToRef(this.color1, this.color2, Math.random(), result) : void result.copyFrom(this.color1);}}class Color3Gradient {constructor(gradient, color) {this.gradient = gradient, this.color = color;}}class FactorGradient {constructor(gradient, factor1, factor2) {this.gradient = gradient, this.factor1 = factor1, this.factor2 = factor2;}getFactor() {return void 0 === this.factor2 || this.factor2 === this.factor1 ? this.factor1 : this.factor1 + (this.factor2 - this.factor1) * Math.random();}}class GradientHelper {static GetCurrentGradient(ratio, gradients, updateFunc) {if (gradients[0].gradient > ratio) return void updateFunc(gradients[0], gradients[0], 1);for (let gradientIndex = 0; gradientIndex < gradients.length - 1; gradientIndex++) {const currentGradient = gradients[gradientIndex],nextGradient = gradients[gradientIndex + 1];if (ratio >= currentGradient.gradient && ratio <= nextGradient.gradient) {const scale = (ratio - currentGradient.gradient) / (nextGradient.gradient - currentGradient.gradient);return void updateFunc(currentGradient, nextGradient, scale);}}const lastIndex = gradients.length - 1;updateFunc(gradients[lastIndex], gradients[lastIndex], 1);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/particle.js
class Particle {constructor(particleSystem) {this.particleSystem = particleSystem, this.position = math_vector/* Vector3.Zero */.P.Zero(), this.direction = math_vector/* Vector3.Zero */.P.Zero(), this.color = new math_color/* Color4 */.HE(0, 0, 0, 0), this.colorStep = new math_color/* Color4 */.HE(0, 0, 0, 0), this.lifeTime = 1, this.age = 0, this.size = 0, this.scale = new math_vector/* Vector2 */.FM(1, 1), this.angle = 0, this.angularSpeed = 0, this.cellIndex = 0, this._attachedSubEmitters = null, this._currentColor1 = new math_color/* Color4 */.HE(0, 0, 0, 0), this._currentColor2 = new math_color/* Color4 */.HE(0, 0, 0, 0), this._currentSize1 = 0, this._currentSize2 = 0, this._currentAngularSpeed1 = 0, this._currentAngularSpeed2 = 0, this._currentVelocity1 = 0, this._currentVelocity2 = 0, this._currentLimitVelocity1 = 0, this._currentLimitVelocity2 = 0, this._currentDrag1 = 0, this._currentDrag2 = 0, this.id = Particle._Count++;this.particleSystem.isAnimationSheetEnabled && this._updateCellInfoFromSystem();}_updateCellInfoFromSystem() {this.cellIndex = this.particleSystem.startSpriteCellID;}updateCellIndex() {let offsetAge = this.age,changeSpeed = this.particleSystem.spriteCellChangeSpeed;this.particleSystem.spriteRandomStartCell && (this._randomCellOffset === void 0 && (this._randomCellOffset = Math.random() * this.lifeTime), 0 === changeSpeed ? (changeSpeed = 1, offsetAge = this._randomCellOffset) : offsetAge += this._randomCellOffset);const dist = this._initialEndSpriteCellID - this._initialStartSpriteCellID;let ratio;ratio = this._initialSpriteCellLoop ? math_scalar/* Scalar.Clamp */.R.Clamp(offsetAge * changeSpeed % this.lifeTime / this.lifeTime) : math_scalar/* Scalar.Clamp */.R.Clamp(offsetAge * changeSpeed / this.lifeTime), this.cellIndex = 0 | this._initialStartSpriteCellID + ratio * dist;}_inheritParticleInfoToSubEmitter(subEmitter) {if (subEmitter.particleSystem.emitter.position) {const emitterMesh = subEmitter.particleSystem.emitter;if (emitterMesh.position.copyFrom(this.position), subEmitter.inheritDirection) {const temp = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];this.direction.normalizeToRef(temp), emitterMesh.setDirection(temp, 0, Math.PI / 2);}} else {const emitterPosition = subEmitter.particleSystem.emitter;emitterPosition.copyFrom(this.position);}this.direction.scaleToRef(subEmitter.inheritedVelocityAmount / 2, math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]), subEmitter.particleSystem._inheritedVelocityOffset.copyFrom(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]);}_inheritParticleInfoToSubEmitters() {this._attachedSubEmitters && 0 < this._attachedSubEmitters.length && this._attachedSubEmitters.forEach((subEmitter) => {this._inheritParticleInfoToSubEmitter(subEmitter);});}_reset() {this.age = 0, this.id = Particle._Count++, this._currentColorGradient = null, this._currentSizeGradient = null, this._currentAngularSpeedGradient = null, this._currentVelocityGradient = null, this._currentLimitVelocityGradient = null, this._currentDragGradient = null, this.cellIndex = this.particleSystem.startSpriteCellID, this._randomCellOffset = void 0;}copyTo(other) {other.position.copyFrom(this.position), this._initialDirection ? other._initialDirection ? other._initialDirection.copyFrom(this._initialDirection) : other._initialDirection = this._initialDirection.clone() : other._initialDirection = null, other.direction.copyFrom(this.direction), this._localPosition && (other._localPosition ? other._localPosition.copyFrom(this._localPosition) : other._localPosition = this._localPosition.clone()), other.color.copyFrom(this.color), other.colorStep.copyFrom(this.colorStep), other.lifeTime = this.lifeTime, other.age = this.age, other._randomCellOffset = this._randomCellOffset, other.size = this.size, other.scale.copyFrom(this.scale), other.angle = this.angle, other.angularSpeed = this.angularSpeed, other.particleSystem = this.particleSystem, other.cellIndex = this.cellIndex, other.id = this.id, other._attachedSubEmitters = this._attachedSubEmitters, this._currentColorGradient && (other._currentColorGradient = this._currentColorGradient, other._currentColor1.copyFrom(this._currentColor1), other._currentColor2.copyFrom(this._currentColor2)), this._currentSizeGradient && (other._currentSizeGradient = this._currentSizeGradient, other._currentSize1 = this._currentSize1, other._currentSize2 = this._currentSize2), this._currentAngularSpeedGradient && (other._currentAngularSpeedGradient = this._currentAngularSpeedGradient, other._currentAngularSpeed1 = this._currentAngularSpeed1, other._currentAngularSpeed2 = this._currentAngularSpeed2), this._currentVelocityGradient && (other._currentVelocityGradient = this._currentVelocityGradient, other._currentVelocity1 = this._currentVelocity1, other._currentVelocity2 = this._currentVelocity2), this._currentLimitVelocityGradient && (other._currentLimitVelocityGradient = this._currentLimitVelocityGradient, other._currentLimitVelocity1 = this._currentLimitVelocity1, other._currentLimitVelocity2 = this._currentLimitVelocity2), this._currentDragGradient && (other._currentDragGradient = this._currentDragGradient, other._currentDrag1 = this._currentDrag1, other._currentDrag2 = this._currentDrag2), this.particleSystem.isAnimationSheetEnabled && (other._initialStartSpriteCellID = this._initialStartSpriteCellID, other._initialEndSpriteCellID = this._initialEndSpriteCellID, other._initialSpriteCellLoop = this._initialSpriteCellLoop), this.particleSystem.useRampGradients && (other.remapData && this.remapData ? other.remapData.copyFrom(this.remapData) : other.remapData = new math_vector/* Vector4 */.Lt(0, 0, 0, 0)), this._randomNoiseCoordinates1 && (other._randomNoiseCoordinates1 ? (other._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1), other._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)) : (other._randomNoiseCoordinates1 = this._randomNoiseCoordinates1.clone(), other._randomNoiseCoordinates2 = this._randomNoiseCoordinates2.clone()));}}Particle._Count = 0;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/subEmitter.js
var SubEmitterType;(function (SubEmitterType) {SubEmitterType[SubEmitterType.ATTACHED = 0] = "ATTACHED", SubEmitterType[SubEmitterType.END = 1] = "END";})(SubEmitterType || (SubEmitterType = {}));class SubEmitter {constructor(particleSystem) {if (this.particleSystem = particleSystem, this.type = SubEmitterType.END, this.inheritDirection = !1, this.inheritedVelocityAmount = 0, !particleSystem.emitter || !particleSystem.emitter.dispose) {const internalClass = (0,typeStore/* GetClass */.q)("BABYLON.AbstractMesh");particleSystem.emitter = new internalClass("SubemitterSystemEmitter", particleSystem.getScene()), particleSystem._disposeEmitterOnDispose = !0;}}clone() {let emitter = this.particleSystem.emitter;if (!emitter) emitter = new math_vector/* Vector3 */.P();else if (emitter instanceof math_vector/* Vector3 */.P) emitter = emitter.clone();else if (-1 !== emitter.getClassName().indexOf("Mesh")) {const internalClass = (0,typeStore/* GetClass */.q)("BABYLON.Mesh");emitter = new internalClass("", emitter.getScene()), emitter.isVisible = !1;}const clone = new SubEmitter(this.particleSystem.clone(this.particleSystem.name, emitter));return clone.particleSystem.name += "Clone", clone.type = this.type, clone.inheritDirection = this.inheritDirection, clone.inheritedVelocityAmount = this.inheritedVelocityAmount, clone.particleSystem._disposeEmitterOnDispose = !0, clone.particleSystem.disposeOnStop = !0, clone;}serialize(serializeTexture = !1) {const serializationObject = { type: this.type, inheritDirection: this.inheritDirection, inheritedVelocityAmount: this.inheritedVelocityAmount, particleSystem: this.particleSystem.serialize(serializeTexture) };return serializationObject;}static _ParseParticleSystem(doNotStart = !1) {throw (0,devTools/* _WarnImport */.S)("ParseParticle");}static Parse(serializationObject, sceneOrEngine, rootUrl) {const system = serializationObject.particleSystem,subEmitter = new SubEmitter(SubEmitter._ParseParticleSystem(system, sceneOrEngine, rootUrl, !0));return subEmitter.type = serializationObject.type, subEmitter.inheritDirection = serializationObject.inheritDirection, subEmitter.inheritedVelocityAmount = serializationObject.inheritedVelocityAmount, subEmitter.particleSystem._isSubEmitter = !0, subEmitter;}dispose() {this.particleSystem.dispose();}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/particles.fragment.js
const particles_fragment_name = "particlesPixelShader",particles_fragment_shader = `#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
varying vec2 vUV;
varying vec4 vColor;
uniform vec4 textureMask;
uniform sampler2D diffuseSampler;
#include<clipPlaneFragmentDeclaration>
#include<imageProcessingDeclaration>
#include<logDepthDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
#ifdef RAMPGRADIENT
varying vec4 remapRanges;
uniform sampler2D rampSampler;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec4 textureColor=texture2D(diffuseSampler,vUV);
vec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;
#ifdef RAMPGRADIENT
float alpha=baseColor.a;
float remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);
vec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));
baseColor.rgb*=rampColor.rgb;
float finalAlpha=baseColor.a;
baseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);
#endif
#ifdef BLENDMULTIPLYMODE
float sourceAlpha=vColor.a*textureColor.a;
baseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);
#endif
#include<logDepthFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
baseColor.rgb=toLinearSpace(baseColor.rgb);
#else
#ifdef IMAGEPROCESSING
baseColor.rgb=toLinearSpace(baseColor.rgb);
baseColor=applyImageProcessing(baseColor);
#endif
#endif
gl_FragColor=baseColor;
#define CUSTOM_FRAGMENT_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.particlesPixelShader */.v.ShadersStore.particlesPixelShader = particles_fragment_shader;const particlesPixelShader = { name: "particlesPixelShader", shader: particles_fragment_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/particles.vertex.js
const particles_vertex_name = "particlesVertexShader",particles_vertex_shader = `attribute vec3 position;
attribute vec4 color;
attribute float angle;
attribute vec2 size;
#ifdef ANIMATESHEET
attribute float cellIndex;
#endif
#ifndef BILLBOARD
attribute vec3 direction;
#endif
#ifdef BILLBOARDSTRETCHED
attribute vec3 direction;
#endif
#ifdef RAMPGRADIENT
attribute vec4 remapData;
#endif
attribute vec2 offset;
uniform mat4 view;
uniform mat4 projection;
uniform vec2 translationPivot;
#ifdef ANIMATESHEET
uniform vec3 particlesInfos; 
#endif
varying vec2 vUV;
varying vec4 vColor;
varying vec3 vPositionW;
#ifdef RAMPGRADIENT
varying vec4 remapRanges;
#endif
#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)
uniform mat4 invView;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#ifdef BILLBOARD
uniform vec3 eyePosition;
#endif
vec3 rotate(vec3 yaxis,vec3 rotatedCorner) {
vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));
vec3 zaxis=normalize(cross(yaxis,xaxis));
vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);
vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);
vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);
mat3 rotMatrix= mat3(row0,row1,row2);
vec3 alignedCorner=rotMatrix*rotatedCorner;
return position+alignedCorner;
}
#ifdef BILLBOARDSTRETCHED
vec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {
vec3 normalizedToCamera=normalize(toCamera);
vec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));
vec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);
vec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);
#ifdef BILLBOARDSTRETCHED_LOCAL
vec3 row1=direction;
#else
vec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));
vec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);
#endif
mat3 rotMatrix= mat3(row0,row1,row2);
vec3 alignedCorner=rotMatrix*rotatedCorner;
return position+alignedCorner;
}
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec2 cornerPos;
cornerPos=(vec2(offset.x-0.5,offset.y -0.5)-translationPivot)*size+translationPivot;
#ifdef BILLBOARD
vec3 rotatedCorner;
#ifdef BILLBOARDY
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);
rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);
rotatedCorner.y=0.;
vec3 yaxis=position-eyePosition;
yaxis.y=0.;
vPositionW=rotate(normalize(yaxis),rotatedCorner);
vec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;
#elif defined(BILLBOARDSTRETCHED)
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);
rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);
rotatedCorner.z=0.;
vec3 toCamera=position-eyePosition;
vPositionW=rotateAlign(toCamera,rotatedCorner);
vec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;
#else
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);
rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);
rotatedCorner.z=0.;
vec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;
vPositionW=(invView*vec4(viewPos,1)).xyz;
#endif
#ifdef RAMPGRADIENT
remapRanges=remapData;
#endif
gl_Position=projection*vec4(viewPos,1.0);
#else
vec3 rotatedCorner;
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);
rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);
rotatedCorner.y=0.;
vec3 yaxis=normalize(direction);
vPositionW=rotate(yaxis,rotatedCorner);
gl_Position=projection*view*vec4(vPositionW,1.0);
#endif
vColor=color;
#ifdef ANIMATESHEET
float rowOffset=floor(cellIndex*particlesInfos.z);
float columnOffset=cellIndex-rowOffset/particlesInfos.z;
vec2 uvScale=particlesInfos.xy;
vec2 uvOffset=vec2(offset.x ,1.0-offset.y);
vUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;
#else
vUV=offset;
#endif
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
vec4 worldPos=vec4(vPositionW,1.0);
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.particlesVertexShader */.v.ShadersStore.particlesVertexShader = particles_vertex_shader;const particlesVertexShader = { name: "particlesVertexShader", shader: particles_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/particleSystem.js
class ParticleSystem extends BaseParticleSystem {set onDispose(callback) {this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(callback);}get useRampGradients() {return this._useRampGradients;}set useRampGradients(value) {this._useRampGradients === value || (this._useRampGradients = value, this._resetEffect());}get particles() {return this._particles;}getActiveCount() {return this._particles.length;}getClassName() {return "ParticleSystem";}isStopping() {return this._stopped && this.isAlive();}getCustomEffect(blendMode = 0) {var _a, _b;return null !== (_b = null === (_a = this._customWrappers[blendMode]) || void 0 === _a ? void 0 : _a.effect) && void 0 !== _b ? _b : this._customWrappers[0].effect;}_getCustomDrawWrapper(blendMode = 0) {var _a;return null !== (_a = this._customWrappers[blendMode]) && void 0 !== _a ? _a : this._customWrappers[0];}setCustomEffect(effect, blendMode = 0) {this._customWrappers[blendMode] = new Materials_drawWrapper/* DrawWrapper */.q(this._engine), this._customWrappers[blendMode].effect = effect, this._customWrappers[blendMode].drawContext && (this._customWrappers[blendMode].drawContext.useInstancing = this._useInstancing);}get onBeforeDrawParticlesObservable() {return this._onBeforeDrawParticlesObservable || (this._onBeforeDrawParticlesObservable = new observable/* Observable */.y$()), this._onBeforeDrawParticlesObservable;}get vertexShaderName() {return "particles";}get vertexBuffers() {return this._vertexBuffers;}get indexBuffer() {return this._indexBuffer;}constructor(name, capacity, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = !1, epsilon = .01) {super(name), this._emitterInverseWorldMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this._inheritedVelocityOffset = new math_vector/* Vector3 */.P(), this.onDisposeObservable = new observable/* Observable */.y$(), this.onStoppedObservable = new observable/* Observable */.y$(), this._particles = [], this._stockParticles = [], this._newPartsExcess = 0, this._vertexBuffers = {}, this._scaledColorStep = new math_color/* Color4 */.HE(0, 0, 0, 0), this._colorDiff = new math_color/* Color4 */.HE(0, 0, 0, 0), this._scaledDirection = math_vector/* Vector3.Zero */.P.Zero(), this._scaledGravity = math_vector/* Vector3.Zero */.P.Zero(), this._currentRenderId = -1, this._useInstancing = !1, this._started = !1, this._stopped = !1, this._actualFrame = 0, this._currentEmitRate1 = 0, this._currentEmitRate2 = 0, this._currentStartSize1 = 0, this._currentStartSize2 = 0, this.updateInAnimate = !0, this._rawTextureWidth = 256, this._useRampGradients = !1, this._disposeEmitterOnDispose = !1, this.isLocal = !1, this.isGPU = !1, this._onBeforeDrawParticlesObservable = null, this.recycleParticle = (particle) => {const lastParticle = this._particles.pop();lastParticle !== particle && lastParticle.copyTo(particle), this._stockParticles.push(lastParticle);}, this._createParticle = () => {let particle;if (0 === this._stockParticles.length ? particle = new Particle(this) : (particle = this._stockParticles.pop(), particle._reset()), this._subEmitters && 0 < this._subEmitters.length) {const subEmitters = this._subEmitters[Math.floor(Math.random() * this._subEmitters.length)];particle._attachedSubEmitters = [], subEmitters.forEach((subEmitter) => {if (subEmitter.type === SubEmitterType.ATTACHED) {const newEmitter = subEmitter.clone();particle._attachedSubEmitters.push(newEmitter), newEmitter.particleSystem.start();}});}return particle;}, this._emitFromParticle = (particle) => {if (this._subEmitters && 0 !== this._subEmitters.length) {const templateIndex = Math.floor(Math.random() * this._subEmitters.length);this._subEmitters[templateIndex].forEach((subEmitter) => {if (subEmitter.type === SubEmitterType.END) {const subSystem = subEmitter.clone();particle._inheritParticleInfoToSubEmitter(subSystem), subSystem.particleSystem._rootParticleSystem = this, this.activeSubSystems.push(subSystem.particleSystem), subSystem.particleSystem.start();}});}}, this._capacity = capacity, this._epsilon = epsilon, this._isAnimationSheetEnabled = isAnimationSheetEnabled, sceneOrEngine && "Scene" !== sceneOrEngine.getClassName() ? (this._engine = sceneOrEngine, this.defaultProjectionMatrix = math_vector/* Matrix.PerspectiveFovLH */.y3.PerspectiveFovLH(.8, 1, .1, 100, this._engine.isNDCHalfZRange)) : (this._scene = sceneOrEngine || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, this._engine = this._scene.getEngine(), this.uniqueId = this._scene.getUniqueId(), this._scene.particleSystems.push(this)), this._engine.getCaps().vertexArrayObject && (this._vertexArrayObject = null), this._attachImageProcessingConfiguration(null), this._customWrappers = { 0: new Materials_drawWrapper/* DrawWrapper */.q(this._engine) }, this._customWrappers[0].effect = customEffect, this._drawWrappers = [], this._useInstancing = this._engine.getCaps().instancedArrays, this._createIndexBuffer(), this._createVertexBuffers(), this.particleEmitterType = new BoxParticleEmitter();let noiseTextureData = null;this.updateFunction = (particles) => {var _a;let noiseTextureSize = null;this.noiseTexture && (noiseTextureSize = this.noiseTexture.getSize(), null === (_a = this.noiseTexture.getContent()) || void 0 === _a ? void 0 : _a.then((data) => {noiseTextureData = data;}));for (let index = 0; index < particles.length; index++) {const particle = particles[index];let scaledUpdateSpeed = this._scaledUpdateSpeed;const previousAge = particle.age;if (particle.age += scaledUpdateSpeed, particle.age > particle.lifeTime) {const diff = particle.age - previousAge,oldDiff = particle.lifeTime - previousAge;scaledUpdateSpeed = oldDiff * scaledUpdateSpeed / diff, particle.age = particle.lifeTime;}const ratio = particle.age / particle.lifeTime;this._colorGradients && 0 < this._colorGradients.length ? GradientHelper.GetCurrentGradient(ratio, this._colorGradients, (currentGradient, nextGradient, scale) => {currentGradient !== particle._currentColorGradient && (particle._currentColor1.copyFrom(particle._currentColor2), nextGradient.getColorToRef(particle._currentColor2), particle._currentColorGradient = currentGradient), math_color/* Color4.LerpToRef */.HE.LerpToRef(particle._currentColor1, particle._currentColor2, scale, particle.color);}) : (particle.colorStep.scaleToRef(scaledUpdateSpeed, this._scaledColorStep), particle.color.addInPlace(this._scaledColorStep), 0 > particle.color.a && (particle.color.a = 0)), this._angularSpeedGradients && 0 < this._angularSpeedGradients.length && GradientHelper.GetCurrentGradient(ratio, this._angularSpeedGradients, (currentGradient, nextGradient, scale) => {currentGradient !== particle._currentAngularSpeedGradient && (particle._currentAngularSpeed1 = particle._currentAngularSpeed2, particle._currentAngularSpeed2 = nextGradient.getFactor(), particle._currentAngularSpeedGradient = currentGradient), particle.angularSpeed = math_scalar/* Scalar.Lerp */.R.Lerp(particle._currentAngularSpeed1, particle._currentAngularSpeed2, scale);}), particle.angle += particle.angularSpeed * scaledUpdateSpeed;let directionScale = scaledUpdateSpeed;if (this._velocityGradients && 0 < this._velocityGradients.length && GradientHelper.GetCurrentGradient(ratio, this._velocityGradients, (currentGradient, nextGradient, scale) => {currentGradient !== particle._currentVelocityGradient && (particle._currentVelocity1 = particle._currentVelocity2, particle._currentVelocity2 = nextGradient.getFactor(), particle._currentVelocityGradient = currentGradient), directionScale *= math_scalar/* Scalar.Lerp */.R.Lerp(particle._currentVelocity1, particle._currentVelocity2, scale);}), particle.direction.scaleToRef(directionScale, this._scaledDirection), this._limitVelocityGradients && 0 < this._limitVelocityGradients.length && GradientHelper.GetCurrentGradient(ratio, this._limitVelocityGradients, (currentGradient, nextGradient, scale) => {currentGradient !== particle._currentLimitVelocityGradient && (particle._currentLimitVelocity1 = particle._currentLimitVelocity2, particle._currentLimitVelocity2 = nextGradient.getFactor(), particle._currentLimitVelocityGradient = currentGradient);const limitVelocity = math_scalar/* Scalar.Lerp */.R.Lerp(particle._currentLimitVelocity1, particle._currentLimitVelocity2, scale),currentVelocity = particle.direction.length();currentVelocity > limitVelocity && particle.direction.scaleInPlace(this.limitVelocityDamping);}), this._dragGradients && 0 < this._dragGradients.length && GradientHelper.GetCurrentGradient(ratio, this._dragGradients, (currentGradient, nextGradient, scale) => {currentGradient !== particle._currentDragGradient && (particle._currentDrag1 = particle._currentDrag2, particle._currentDrag2 = nextGradient.getFactor(), particle._currentDragGradient = currentGradient);const drag = math_scalar/* Scalar.Lerp */.R.Lerp(particle._currentDrag1, particle._currentDrag2, scale);this._scaledDirection.scaleInPlace(1 - drag);}), this.isLocal && particle._localPosition ? (particle._localPosition.addInPlace(this._scaledDirection), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(particle._localPosition, this._emitterWorldMatrix, particle.position)) : particle.position.addInPlace(this._scaledDirection), noiseTextureData && noiseTextureSize && particle._randomNoiseCoordinates1) {const fetchedColorR = this._fetchR(particle._randomNoiseCoordinates1.x, particle._randomNoiseCoordinates1.y, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData),fetchedColorG = this._fetchR(particle._randomNoiseCoordinates1.z, particle._randomNoiseCoordinates2.x, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData),fetchedColorB = this._fetchR(particle._randomNoiseCoordinates2.y, particle._randomNoiseCoordinates2.z, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData),force = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],scaledForce = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];force.copyFromFloats((2 * fetchedColorR - 1) * this.noiseStrength.x, (2 * fetchedColorG - 1) * this.noiseStrength.y, (2 * fetchedColorB - 1) * this.noiseStrength.z), force.scaleToRef(scaledUpdateSpeed, scaledForce), particle.direction.addInPlace(scaledForce);}if (this.gravity.scaleToRef(scaledUpdateSpeed, this._scaledGravity), particle.direction.addInPlace(this._scaledGravity), this._sizeGradients && 0 < this._sizeGradients.length && GradientHelper.GetCurrentGradient(ratio, this._sizeGradients, (currentGradient, nextGradient, scale) => {currentGradient !== particle._currentSizeGradient && (particle._currentSize1 = particle._currentSize2, particle._currentSize2 = nextGradient.getFactor(), particle._currentSizeGradient = currentGradient), particle.size = math_scalar/* Scalar.Lerp */.R.Lerp(particle._currentSize1, particle._currentSize2, scale);}), this._useRampGradients && (this._colorRemapGradients && 0 < this._colorRemapGradients.length && GradientHelper.GetCurrentGradient(ratio, this._colorRemapGradients, (currentGradient, nextGradient, scale) => {const min = math_scalar/* Scalar.Lerp */.R.Lerp(currentGradient.factor1, nextGradient.factor1, scale),max = math_scalar/* Scalar.Lerp */.R.Lerp(currentGradient.factor2, nextGradient.factor2, scale);particle.remapData.x = min, particle.remapData.y = max - min;}), this._alphaRemapGradients && 0 < this._alphaRemapGradients.length && GradientHelper.GetCurrentGradient(ratio, this._alphaRemapGradients, (currentGradient, nextGradient, scale) => {const min = math_scalar/* Scalar.Lerp */.R.Lerp(currentGradient.factor1, nextGradient.factor1, scale),max = math_scalar/* Scalar.Lerp */.R.Lerp(currentGradient.factor2, nextGradient.factor2, scale);particle.remapData.z = min, particle.remapData.w = max - min;})), this._isAnimationSheetEnabled && particle.updateCellIndex(), particle._inheritParticleInfoToSubEmitters(), particle.age >= particle.lifeTime) {this._emitFromParticle(particle), particle._attachedSubEmitters && (particle._attachedSubEmitters.forEach((subEmitter) => {subEmitter.particleSystem.disposeOnStop = !0, subEmitter.particleSystem.stop();}), particle._attachedSubEmitters = null), this.recycleParticle(particle), index--;continue;}}};}_addFactorGradient(factorGradients, gradient, factor, factor2) {const newGradient = new FactorGradient(gradient, factor, factor2);factorGradients.push(newGradient), factorGradients.sort((a, b) => {if (a.gradient < b.gradient) return -1;return a.gradient > b.gradient ? 1 : 0;});}_removeFactorGradient(factorGradients, gradient) {if (!factorGradients) return;let index = 0;for (const factorGradient of factorGradients) {if (factorGradient.gradient === gradient) {factorGradients.splice(index, 1);break;}index++;}}addLifeTimeGradient(gradient, factor, factor2) {return this._lifeTimeGradients || (this._lifeTimeGradients = []), this._addFactorGradient(this._lifeTimeGradients, gradient, factor, factor2), this;}removeLifeTimeGradient(gradient) {return this._removeFactorGradient(this._lifeTimeGradients, gradient), this;}addSizeGradient(gradient, factor, factor2) {return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, gradient, factor, factor2), this;}removeSizeGradient(gradient) {return this._removeFactorGradient(this._sizeGradients, gradient), this;}addColorRemapGradient(gradient, min, max) {return this._colorRemapGradients || (this._colorRemapGradients = []), this._addFactorGradient(this._colorRemapGradients, gradient, min, max), this;}removeColorRemapGradient(gradient) {return this._removeFactorGradient(this._colorRemapGradients, gradient), this;}addAlphaRemapGradient(gradient, min, max) {return this._alphaRemapGradients || (this._alphaRemapGradients = []), this._addFactorGradient(this._alphaRemapGradients, gradient, min, max), this;}removeAlphaRemapGradient(gradient) {return this._removeFactorGradient(this._alphaRemapGradients, gradient), this;}addAngularSpeedGradient(gradient, factor, factor2) {return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, gradient, factor, factor2), this;}removeAngularSpeedGradient(gradient) {return this._removeFactorGradient(this._angularSpeedGradients, gradient), this;}addVelocityGradient(gradient, factor, factor2) {return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, gradient, factor, factor2), this;}removeVelocityGradient(gradient) {return this._removeFactorGradient(this._velocityGradients, gradient), this;}addLimitVelocityGradient(gradient, factor, factor2) {return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, gradient, factor, factor2), this;}removeLimitVelocityGradient(gradient) {return this._removeFactorGradient(this._limitVelocityGradients, gradient), this;}addDragGradient(gradient, factor, factor2) {return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, gradient, factor, factor2), this;}removeDragGradient(gradient) {return this._removeFactorGradient(this._dragGradients, gradient), this;}addEmitRateGradient(gradient, factor, factor2) {return this._emitRateGradients || (this._emitRateGradients = []), this._addFactorGradient(this._emitRateGradients, gradient, factor, factor2), this;}removeEmitRateGradient(gradient) {return this._removeFactorGradient(this._emitRateGradients, gradient), this;}addStartSizeGradient(gradient, factor, factor2) {return this._startSizeGradients || (this._startSizeGradients = []), this._addFactorGradient(this._startSizeGradients, gradient, factor, factor2), this;}removeStartSizeGradient(gradient) {return this._removeFactorGradient(this._startSizeGradients, gradient), this;}_createRampGradientTexture() {if (!this._rampGradients || !this._rampGradients.length || this._rampGradientsTexture || !this._scene) return;const data = new Uint8Array(4 * this._rawTextureWidth),tmpColor = math_color/* TmpColors.Color3.0 */.zZ.Color3[0];for (let x = 0; x < this._rawTextureWidth; x++) {const ratio = x / this._rawTextureWidth;GradientHelper.GetCurrentGradient(ratio, this._rampGradients, (currentGradient, nextGradient, scale) => {math_color/* Color3.LerpToRef */.Wo.LerpToRef(currentGradient.color, nextGradient.color, scale, tmpColor), data[4 * x] = 255 * tmpColor.r, data[4 * x + 1] = 255 * tmpColor.g, data[4 * x + 2] = 255 * tmpColor.b, data[4 * x + 3] = 255;});}this._rampGradientsTexture = rawTexture/* RawTexture.CreateRGBATexture */.l.CreateRGBATexture(data, this._rawTextureWidth, 1, this._scene, !1, !1, 1);}getRampGradients() {return this._rampGradients;}forceRefreshGradients() {this._syncRampGradientTexture();}_syncRampGradientTexture() {this._rampGradients && (this._rampGradients.sort((a, b) => {if (a.gradient < b.gradient) return -1;return a.gradient > b.gradient ? 1 : 0;}), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._createRampGradientTexture());}addRampGradient(gradient, color) {this._rampGradients || (this._rampGradients = []);const rampGradient = new Color3Gradient(gradient, color);return this._rampGradients.push(rampGradient), this._syncRampGradientTexture(), this;}removeRampGradient(gradient) {return this._removeGradientAndTexture(gradient, this._rampGradients, this._rampGradientsTexture), this._rampGradientsTexture = null, this._rampGradients && 0 < this._rampGradients.length && this._createRampGradientTexture(), this;}addColorGradient(gradient, color1, color2) {this._colorGradients || (this._colorGradients = []);const colorGradient = new ColorGradient(gradient, color1, color2);return this._colorGradients.push(colorGradient), this._colorGradients.sort((a, b) => a.gradient < b.gradient ? -1 : a.gradient > b.gradient ? 1 : 0), this;}removeColorGradient(gradient) {if (!this._colorGradients) return this;let index = 0;for (const colorGradient of this._colorGradients) {if (colorGradient.gradient === gradient) {this._colorGradients.splice(index, 1);break;}index++;}return this;}resetDrawCache() {for (const drawWrappers of this._drawWrappers) if (drawWrappers) for (const drawWrapper of drawWrappers) null === drawWrapper || void 0 === drawWrapper ? void 0 : drawWrapper.dispose();this._drawWrappers = [];}_fetchR(u, v, width, height, pixels) {u = .5 * Math.abs(u) + .5, v = .5 * Math.abs(v) + .5;const wrappedU = 0 | u * width % width,wrappedV = 0 | v * height % height;return pixels[4 * (wrappedU + wrappedV * width)] / 255;}_reset() {this._resetEffect();}_resetEffect() {this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), this._createVertexBuffers();}_createVertexBuffers() {this._vertexBufferSize = this._useInstancing ? 10 : 12, this._isAnimationSheetEnabled && (this._vertexBufferSize += 1), this._isBillboardBased && this.billboardMode !== ParticleSystem.BILLBOARDMODE_STRETCHED && this.billboardMode !== ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL || (this._vertexBufferSize += 3), this._useRampGradients && (this._vertexBufferSize += 4);const engine = this._engine,vertexSize = this._vertexBufferSize * (this._useInstancing ? 1 : 4);this._vertexData = new Float32Array(this._capacity * vertexSize), this._vertexBuffer = new Buffers_buffer/* Buffer */.l(engine, this._vertexData, !0, vertexSize);let dataOffset = 0;const positions = this._vertexBuffer.createVertexBuffer(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, dataOffset, 3, this._vertexBufferSize, this._useInstancing);this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = positions, dataOffset += 3;const colors = this._vertexBuffer.createVertexBuffer(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, dataOffset, 4, this._vertexBufferSize, this._useInstancing);this._vertexBuffers[Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind] = colors, dataOffset += 4;const options = this._vertexBuffer.createVertexBuffer("angle", dataOffset, 1, this._vertexBufferSize, this._useInstancing);this._vertexBuffers.angle = options, dataOffset += 1;const size = this._vertexBuffer.createVertexBuffer("size", dataOffset, 2, this._vertexBufferSize, this._useInstancing);if (this._vertexBuffers.size = size, dataOffset += 2, this._isAnimationSheetEnabled) {const cellIndexBuffer = this._vertexBuffer.createVertexBuffer("cellIndex", dataOffset, 1, this._vertexBufferSize, this._useInstancing);this._vertexBuffers.cellIndex = cellIndexBuffer, dataOffset += 1;}if (!this._isBillboardBased || this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED || this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL) {const directionBuffer = this._vertexBuffer.createVertexBuffer("direction", dataOffset, 3, this._vertexBufferSize, this._useInstancing);this._vertexBuffers.direction = directionBuffer, dataOffset += 3;}if (this._useRampGradients) {const rampDataBuffer = this._vertexBuffer.createVertexBuffer("remapData", dataOffset, 4, this._vertexBufferSize, this._useInstancing);this._vertexBuffers.remapData = rampDataBuffer, dataOffset += 4;}let offsets;if (this._useInstancing) {const spriteData = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);this._spriteBuffer = new Buffers_buffer/* Buffer */.l(engine, spriteData, !1, 2), offsets = this._spriteBuffer.createVertexBuffer("offset", 0, 2);} else offsets = this._vertexBuffer.createVertexBuffer("offset", dataOffset, 2, this._vertexBufferSize, this._useInstancing), dataOffset += 2;this._vertexBuffers.offset = offsets, this.resetDrawCache();}_createIndexBuffer() {if (this._useInstancing) return;const indices = [];let index = 0;for (let count = 0; count < this._capacity; count++) indices.push(index), indices.push(index + 1), indices.push(index + 2), indices.push(index), indices.push(index + 2), indices.push(index + 3), index += 4;this._indexBuffer = this._engine.createIndexBuffer(indices);}getCapacity() {return this._capacity;}isAlive() {return this._alive;}isStarted() {return this._started;}_prepareSubEmitterInternalArray() {this._subEmitters = [], this.subEmitters && this.subEmitters.forEach((subEmitter) => {subEmitter instanceof ParticleSystem ? this._subEmitters.push([new SubEmitter(subEmitter)]) : subEmitter instanceof SubEmitter ? this._subEmitters.push([subEmitter]) : subEmitter instanceof Array && this._subEmitters.push(subEmitter);});}start(delay = this.startDelay) {var _a;if (!this.targetStopDuration && this._hasTargetStopDurationDependantGradient()) throw "Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";if (delay) return void setTimeout(() => {this.start(0);}, delay);if (this._prepareSubEmitterInternalArray(), this._started = !0, this._stopped = !1, this._actualFrame = 0, this._subEmitters && 0 != this._subEmitters.length && (this.activeSubSystems = []), this._emitRateGradients && (0 < this._emitRateGradients.length && (this._currentEmitRateGradient = this._emitRateGradients[0], this._currentEmitRate1 = this._currentEmitRateGradient.getFactor(), this._currentEmitRate2 = this._currentEmitRate1), 1 < this._emitRateGradients.length && (this._currentEmitRate2 = this._emitRateGradients[1].getFactor())), this._startSizeGradients && (0 < this._startSizeGradients.length && (this._currentStartSizeGradient = this._startSizeGradients[0], this._currentStartSize1 = this._currentStartSizeGradient.getFactor(), this._currentStartSize2 = this._currentStartSize1), 1 < this._startSizeGradients.length && (this._currentStartSize2 = this._startSizeGradients[1].getFactor())), this.preWarmCycles) {-1 !== (null === (_a = this.emitter) || void 0 === _a ? void 0 : _a.getClassName().indexOf("Mesh")) && this.emitter.computeWorldMatrix(!0);const noiseTextureAsProcedural = this.noiseTexture;if (noiseTextureAsProcedural && noiseTextureAsProcedural.onGeneratedObservable) noiseTextureAsProcedural.onGeneratedObservable.addOnce(() => {setTimeout(() => {for (let index = 0; index < this.preWarmCycles; index++) this.animate(!0), noiseTextureAsProcedural.render();});});else for (let index = 0; index < this.preWarmCycles; index++) this.animate(!0);}this.beginAnimationOnStart && this.animations && 0 < this.animations.length && this._scene && this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop);}stop(stopSubEmitters = !0) {this._stopped || (this.onStoppedObservable.notifyObservers(this), this._stopped = !0, stopSubEmitters && this._stopSubEmitters());}reset() {this._stockParticles.length = 0, this._particles.length = 0;}_appendParticleVertex(index, particle, offsetX, offsetY) {let offset = index * this._vertexBufferSize;if (this._vertexData[offset++] = particle.position.x + this.worldOffset.x, this._vertexData[offset++] = particle.position.y + this.worldOffset.y, this._vertexData[offset++] = particle.position.z + this.worldOffset.z, this._vertexData[offset++] = particle.color.r, this._vertexData[offset++] = particle.color.g, this._vertexData[offset++] = particle.color.b, this._vertexData[offset++] = particle.color.a, this._vertexData[offset++] = particle.angle, this._vertexData[offset++] = particle.scale.x * particle.size, this._vertexData[offset++] = particle.scale.y * particle.size, this._isAnimationSheetEnabled && (this._vertexData[offset++] = particle.cellIndex), !!this._isBillboardBased) (this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED || this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL) && (this._vertexData[offset++] = particle.direction.x, this._vertexData[offset++] = particle.direction.y, this._vertexData[offset++] = particle.direction.z);else if (particle._initialDirection) {let initialDirection = particle._initialDirection;this.isLocal && (math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(initialDirection, this._emitterWorldMatrix, math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]), initialDirection = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]), 0 === initialDirection.x && 0 === initialDirection.z && (initialDirection.x = .001), this._vertexData[offset++] = initialDirection.x, this._vertexData[offset++] = initialDirection.y, this._vertexData[offset++] = initialDirection.z;} else {let direction = particle.direction;this.isLocal && (math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(direction, this._emitterWorldMatrix, math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]), direction = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0]), 0 === direction.x && 0 === direction.z && (direction.x = .001), this._vertexData[offset++] = direction.x, this._vertexData[offset++] = direction.y, this._vertexData[offset++] = direction.z;}this._useRampGradients && particle.remapData && (this._vertexData[offset++] = particle.remapData.x, this._vertexData[offset++] = particle.remapData.y, this._vertexData[offset++] = particle.remapData.z, this._vertexData[offset++] = particle.remapData.w), this._useInstancing || (this._isAnimationSheetEnabled && (0 === offsetX ? offsetX = this._epsilon : 1 === offsetX && (offsetX = 1 - this._epsilon), 0 === offsetY ? offsetY = this._epsilon : 1 === offsetY && (offsetY = 1 - this._epsilon)), this._vertexData[offset++] = offsetX, this._vertexData[offset++] = offsetY);}_stopSubEmitters() {this.activeSubSystems && (this.activeSubSystems.forEach((subSystem) => {subSystem.stop(!0);}), this.activeSubSystems = []);}_removeFromRoot() {if (this._rootParticleSystem) {const index = this._rootParticleSystem.activeSubSystems.indexOf(this);-1 !== index && this._rootParticleSystem.activeSubSystems.splice(index, 1), this._rootParticleSystem = null;}}_update(newParticles) {if (this._alive = 0 < this._particles.length, this.emitter.position) {const emitterMesh = this.emitter;this._emitterWorldMatrix = emitterMesh.getWorldMatrix();} else {const emitterPosition = this.emitter;this._emitterWorldMatrix = math_vector/* Matrix.Translation */.y3.Translation(emitterPosition.x, emitterPosition.y, emitterPosition.z);}this._emitterWorldMatrix.invertToRef(this._emitterInverseWorldMatrix), this.updateFunction(this._particles);let particle;for (let index = 0; index < newParticles && this._particles.length !== this._capacity; index++) {if (particle = this._createParticle(), this._particles.push(particle), this.targetStopDuration && this._lifeTimeGradients && 0 < this._lifeTimeGradients.length) {const ratio = math_scalar/* Scalar.Clamp */.R.Clamp(this._actualFrame / this.targetStopDuration);GradientHelper.GetCurrentGradient(ratio, this._lifeTimeGradients, (currentGradient, nextGradient) => {const factorGradient1 = currentGradient,factorGradient2 = nextGradient,lifeTime1 = factorGradient1.getFactor(),lifeTime2 = factorGradient2.getFactor(),gradient = (ratio - factorGradient1.gradient) / (factorGradient2.gradient - factorGradient1.gradient);particle.lifeTime = math_scalar/* Scalar.Lerp */.R.Lerp(lifeTime1, lifeTime2, gradient);});} else particle.lifeTime = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minLifeTime, this.maxLifeTime);const emitPower = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minEmitPower, this.maxEmitPower);if (this.startPositionFunction ? this.startPositionFunction(this._emitterWorldMatrix, particle.position, particle, this.isLocal) : this.particleEmitterType.startPositionFunction(this._emitterWorldMatrix, particle.position, particle, this.isLocal), this.isLocal && (particle._localPosition ? particle._localPosition.copyFrom(particle.position) : particle._localPosition = particle.position.clone(), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(particle._localPosition, this._emitterWorldMatrix, particle.position)), this.startDirectionFunction ? this.startDirectionFunction(this._emitterWorldMatrix, particle.direction, particle, this.isLocal) : this.particleEmitterType.startDirectionFunction(this._emitterWorldMatrix, particle.direction, particle, this.isLocal, this._emitterInverseWorldMatrix), 0 === emitPower ? particle._initialDirection ? particle._initialDirection.copyFrom(particle.direction) : particle._initialDirection = particle.direction.clone() : particle._initialDirection = null, particle.direction.scaleInPlace(emitPower), this._sizeGradients && 0 !== this._sizeGradients.length ? (particle._currentSizeGradient = this._sizeGradients[0], particle._currentSize1 = particle._currentSizeGradient.getFactor(), particle.size = particle._currentSize1, particle._currentSize2 = 1 < this._sizeGradients.length ? this._sizeGradients[1].getFactor() : particle._currentSize1) : particle.size = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minSize, this.maxSize), particle.scale.copyFromFloats(math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minScaleX, this.maxScaleX), math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minScaleY, this.maxScaleY)), this._startSizeGradients && this._startSizeGradients[0] && this.targetStopDuration) {const ratio = this._actualFrame / this.targetStopDuration;GradientHelper.GetCurrentGradient(ratio, this._startSizeGradients, (currentGradient, nextGradient, scale) => {currentGradient !== this._currentStartSizeGradient && (this._currentStartSize1 = this._currentStartSize2, this._currentStartSize2 = nextGradient.getFactor(), this._currentStartSizeGradient = currentGradient);const value = math_scalar/* Scalar.Lerp */.R.Lerp(this._currentStartSize1, this._currentStartSize2, scale);particle.scale.scaleInPlace(value);});}if (this._angularSpeedGradients && 0 !== this._angularSpeedGradients.length ? (particle._currentAngularSpeedGradient = this._angularSpeedGradients[0], particle.angularSpeed = particle._currentAngularSpeedGradient.getFactor(), particle._currentAngularSpeed1 = particle.angularSpeed, particle._currentAngularSpeed2 = 1 < this._angularSpeedGradients.length ? this._angularSpeedGradients[1].getFactor() : particle._currentAngularSpeed1) : particle.angularSpeed = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minAngularSpeed, this.maxAngularSpeed), particle.angle = math_scalar/* Scalar.RandomRange */.R.RandomRange(this.minInitialRotation, this.maxInitialRotation), this._velocityGradients && 0 < this._velocityGradients.length && (particle._currentVelocityGradient = this._velocityGradients[0], particle._currentVelocity1 = particle._currentVelocityGradient.getFactor(), particle._currentVelocity2 = 1 < this._velocityGradients.length ? this._velocityGradients[1].getFactor() : particle._currentVelocity1), this._limitVelocityGradients && 0 < this._limitVelocityGradients.length && (particle._currentLimitVelocityGradient = this._limitVelocityGradients[0], particle._currentLimitVelocity1 = particle._currentLimitVelocityGradient.getFactor(), particle._currentLimitVelocity2 = 1 < this._limitVelocityGradients.length ? this._limitVelocityGradients[1].getFactor() : particle._currentLimitVelocity1), this._dragGradients && 0 < this._dragGradients.length && (particle._currentDragGradient = this._dragGradients[0], particle._currentDrag1 = particle._currentDragGradient.getFactor(), particle._currentDrag2 = 1 < this._dragGradients.length ? this._dragGradients[1].getFactor() : particle._currentDrag1), !this._colorGradients || 0 === this._colorGradients.length) {const step = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 1);math_color/* Color4.LerpToRef */.HE.LerpToRef(this.color1, this.color2, step, particle.color), this.colorDead.subtractToRef(particle.color, this._colorDiff), this._colorDiff.scaleToRef(1 / particle.lifeTime, particle.colorStep);} else particle._currentColorGradient = this._colorGradients[0], particle._currentColorGradient.getColorToRef(particle.color), particle._currentColor1.copyFrom(particle.color), 1 < this._colorGradients.length ? this._colorGradients[1].getColorToRef(particle._currentColor2) : particle._currentColor2.copyFrom(particle.color);this._isAnimationSheetEnabled && (particle._initialStartSpriteCellID = this.startSpriteCellID, particle._initialEndSpriteCellID = this.endSpriteCellID, particle._initialSpriteCellLoop = this.spriteCellLoop), particle.direction.addInPlace(this._inheritedVelocityOffset), this._useRampGradients && (particle.remapData = new math_vector/* Vector4 */.Lt(0, 1, 0, 1)), this.noiseTexture && (particle._randomNoiseCoordinates1 ? (particle._randomNoiseCoordinates1.copyFromFloats(Math.random(), Math.random(), Math.random()), particle._randomNoiseCoordinates2.copyFromFloats(Math.random(), Math.random(), Math.random())) : (particle._randomNoiseCoordinates1 = new math_vector/* Vector3 */.P(Math.random(), Math.random(), Math.random()), particle._randomNoiseCoordinates2 = new math_vector/* Vector3 */.P(Math.random(), Math.random(), Math.random()))), particle._inheritParticleInfoToSubEmitters();}}static _GetAttributeNamesOrOptions(isAnimationSheetEnabled = !1, isBillboardBased = !1, useRampGradients = !1) {const attributeNamesOrOptions = [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, "angle", "offset", "size"];return isAnimationSheetEnabled && attributeNamesOrOptions.push("cellIndex"), isBillboardBased || attributeNamesOrOptions.push("direction"), useRampGradients && attributeNamesOrOptions.push("remapData"), attributeNamesOrOptions;}static _GetEffectCreationOptions(isAnimationSheetEnabled = !1, useLogarithmicDepth = !1) {const effectCreationOption = ["invView", "view", "projection", "textureMask", "translationPivot", "eyePosition"];return (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(effectCreationOption), isAnimationSheetEnabled && effectCreationOption.push("particlesInfos"), useLogarithmicDepth && effectCreationOption.push("logarithmicDepthConstant"), effectCreationOption;}fillDefines(defines, blendMode) {if (this._scene && (0,clipPlaneMaterialHelper/* prepareDefinesForClipPlanes */.AN)(this, this._scene, defines), this._isAnimationSheetEnabled && defines.push("#define ANIMATESHEET"), this.useLogarithmicDepth && defines.push("#define LOGARITHMICDEPTH"), blendMode === ParticleSystem.BLENDMODE_MULTIPLY && defines.push("#define BLENDMULTIPLYMODE"), this._useRampGradients && defines.push("#define RAMPGRADIENT"), this._isBillboardBased) switch (defines.push("#define BILLBOARD"), this.billboardMode) {case ParticleSystem.BILLBOARDMODE_Y:defines.push("#define BILLBOARDY");break;case ParticleSystem.BILLBOARDMODE_STRETCHED:case ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL:defines.push("#define BILLBOARDSTRETCHED"), this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL && defines.push("#define BILLBOARDSTRETCHED_LOCAL");break;case ParticleSystem.BILLBOARDMODE_ALL:defines.push("#define BILLBOARDMODE_ALL");break;default:}this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines), defines.push(this._imageProcessingConfigurationDefines.toString()));}fillUniformsAttributesAndSamplerNames(uniforms, attributes, samplers) {attributes.push(...ParticleSystem._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled, this._isBillboardBased && this.billboardMode !== ParticleSystem.BILLBOARDMODE_STRETCHED && this.billboardMode !== ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL, this._useRampGradients)), uniforms.push(...ParticleSystem._GetEffectCreationOptions(this._isAnimationSheetEnabled, this.useLogarithmicDepth)), samplers.push("diffuseSampler", "rampSampler"), this._imageProcessingConfiguration && (Materials_imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareUniforms */.$.PrepareUniforms(uniforms, this._imageProcessingConfigurationDefines), Materials_imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareSamplers */.$.PrepareSamplers(samplers, this._imageProcessingConfigurationDefines));}_getWrapper(blendMode) {const customWrapper = this._getCustomDrawWrapper(blendMode);if (null === customWrapper || void 0 === customWrapper ? void 0 : customWrapper.effect) return customWrapper;const defines = [];this.fillDefines(defines, blendMode);const currentRenderPassId = this._engine._features.supportRenderPasses ? this._engine.currentRenderPassId : 0;let drawWrappers = this._drawWrappers[currentRenderPassId];drawWrappers || (drawWrappers = this._drawWrappers[currentRenderPassId] = []);let drawWrapper = drawWrappers[blendMode];drawWrapper || (drawWrapper = new Materials_drawWrapper/* DrawWrapper */.q(this._engine), drawWrapper.drawContext && (drawWrapper.drawContext.useInstancing = this._useInstancing), drawWrappers[blendMode] = drawWrapper);const join = defines.join("\n");if (drawWrapper.defines !== join) {const attributesNamesOrOptions = [],effectCreationOption = [],samplers = [];this.fillUniformsAttributesAndSamplerNames(effectCreationOption, attributesNamesOrOptions, samplers), drawWrapper.setEffect(this._engine.createEffect("particles", attributesNamesOrOptions, effectCreationOption, samplers, join), join);}return drawWrapper;}animate(preWarmOnly = !1) {var _a;if (!this._started) return;if (!preWarmOnly && this._scene) {if (!this.isReady()) return;if (this._currentRenderId === this._scene.getFrameId()) return;this._currentRenderId = this._scene.getFrameId();}this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : (null === (_a = this._scene) || void 0 === _a ? void 0 : _a.getAnimationRatio()) || 1);let newParticles;if (-1 < this.manualEmitCount) newParticles = this.manualEmitCount, this._newPartsExcess = 0, this.manualEmitCount = 0;else {let rate = this.emitRate;if (this._emitRateGradients && 0 < this._emitRateGradients.length && this.targetStopDuration) {const ratio = this._actualFrame / this.targetStopDuration;GradientHelper.GetCurrentGradient(ratio, this._emitRateGradients, (currentGradient, nextGradient, scale) => {currentGradient !== this._currentEmitRateGradient && (this._currentEmitRate1 = this._currentEmitRate2, this._currentEmitRate2 = nextGradient.getFactor(), this._currentEmitRateGradient = currentGradient), rate = math_scalar/* Scalar.Lerp */.R.Lerp(this._currentEmitRate1, this._currentEmitRate2, scale);});}newParticles = rate * this._scaledUpdateSpeed >> 0, this._newPartsExcess += rate * this._scaledUpdateSpeed - newParticles;}if (1 < this._newPartsExcess && (newParticles += this._newPartsExcess >> 0, this._newPartsExcess -= this._newPartsExcess >> 0), this._alive = !1, this._stopped ? newParticles = 0 : (this._actualFrame += this._scaledUpdateSpeed, this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop()), this._update(newParticles), this._stopped && !this._alive && (this._started = !1, this.onAnimationEnd && this.onAnimationEnd(), this.disposeOnStop && this._scene && this._scene._toBeDisposed.push(this)), !preWarmOnly) {let offset = 0;for (let index = 0; index < this._particles.length; index++) {const particle = this._particles[index];this._appendParticleVertices(offset, particle), offset += this._useInstancing ? 1 : 4;}this._vertexBuffer && this._vertexBuffer.updateDirectly(this._vertexData, 0, this._particles.length);}0 === this.manualEmitCount && this.disposeOnStop && this.stop();}_appendParticleVertices(offset, particle) {this._appendParticleVertex(offset++, particle, 0, 0), this._useInstancing || (this._appendParticleVertex(offset++, particle, 1, 0), this._appendParticleVertex(offset++, particle, 1, 1), this._appendParticleVertex(offset++, particle, 0, 1));}rebuild() {var _a, _b;for (const key in this._engine.getCaps().vertexArrayObject && (this._vertexArrayObject = null), this._createIndexBuffer(), null === (_a = this._spriteBuffer) || void 0 === _a ? void 0 : _a._rebuild(), null === (_b = this._vertexBuffer) || void 0 === _b ? void 0 : _b._rebuild(), this._vertexBuffers) this._vertexBuffers[key]._rebuild();this.resetDrawCache();}isReady() {if (!this.emitter || this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady() || !this.particleTexture || !this.particleTexture.isReady()) return !1;if (this.blendMode === ParticleSystem.BLENDMODE_MULTIPLYADD) {if (!this._getWrapper(ParticleSystem.BLENDMODE_MULTIPLY).effect.isReady()) return !1;if (!this._getWrapper(ParticleSystem.BLENDMODE_ADD).effect.isReady()) return !1;} else if (!this._getWrapper(this.blendMode).effect.isReady()) return !1;return !0;}_render(blendMode) {var _a, _b;const drawWrapper = this._getWrapper(blendMode),effect = drawWrapper.effect,engine = this._engine;engine.enableEffect(drawWrapper);const viewMatrix = null !== (_a = this.defaultViewMatrix) && void 0 !== _a ? _a : this._scene.getViewMatrix();if (effect.setTexture("diffuseSampler", this.particleTexture), effect.setMatrix("view", viewMatrix), effect.setMatrix("projection", null !== (_b = this.defaultProjectionMatrix) && void 0 !== _b ? _b : this._scene.getProjectionMatrix()), this._isAnimationSheetEnabled && this.particleTexture) {const baseSize = this.particleTexture.getBaseSize();effect.setFloat3("particlesInfos", this.spriteCellWidth / baseSize.width, this.spriteCellHeight / baseSize.height, this.spriteCellWidth / baseSize.width);}if (effect.setVector2("translationPivot", this.translationPivot), effect.setFloat4("textureMask", this.textureMask.r, this.textureMask.g, this.textureMask.b, this.textureMask.a), this._isBillboardBased && this._scene) {const camera = this._scene.activeCamera;effect.setVector3("eyePosition", camera.globalPosition);}this._rampGradientsTexture && ((!this._rampGradients || !this._rampGradients.length) && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), effect.setTexture("rampSampler", this._rampGradientsTexture));const defines = effect.defines;return this._scene && (0,clipPlaneMaterialHelper/* bindClipPlane */.an)(effect, this, this._scene), 0 <= defines.indexOf("#define BILLBOARDMODE_ALL") && (viewMatrix.invertToRef(math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), effect.setMatrix("invView", math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0])), void 0 === this._vertexArrayObject ? engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect) : (!this._vertexArrayObject && (this._vertexArrayObject = this._engine.recordVertexArrayObject(this._vertexBuffers, this._indexBuffer, effect)), this._engine.bindVertexArrayObject(this._vertexArrayObject, this._indexBuffer)), this.useLogarithmicDepth && this._scene && materialHelper/* MaterialHelper.BindLogDepth */.G.BindLogDepth(defines, effect, this._scene), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(effect), blendMode === ParticleSystem.BLENDMODE_ADD ? engine.setAlphaMode(1) : blendMode === ParticleSystem.BLENDMODE_ONEONE ? engine.setAlphaMode(6) : blendMode === ParticleSystem.BLENDMODE_STANDARD ? engine.setAlphaMode(2) : blendMode === ParticleSystem.BLENDMODE_MULTIPLY ? engine.setAlphaMode(4) : void 0, (this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.notifyObservers(effect), this._useInstancing ? engine.drawArraysType(7, 0, 4, this._particles.length) : engine.drawElementsType(0, 0, 6 * this._particles.length), this._particles.length);}render() {if (!this.isReady() || !this._particles.length) return 0;const engine = this._engine;engine.setState && (engine.setState(!1), this.forceDepthWrite && engine.setDepthWrite(!0));let outparticles = 0;return outparticles = this.blendMode === ParticleSystem.BLENDMODE_MULTIPLYADD ? this._render(ParticleSystem.BLENDMODE_MULTIPLY) + this._render(ParticleSystem.BLENDMODE_ADD) : this._render(this.blendMode), this._engine.unbindInstanceAttributes(), this._engine.setAlphaMode(0), outparticles;}dispose(disposeTexture = !0) {if (this.resetDrawCache(), this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._indexBuffer && (this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), disposeTexture && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), disposeTexture && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._removeFromRoot(), this.subEmitters && !this._subEmitters && this._prepareSubEmitterInternalArray(), this._subEmitters && this._subEmitters.length) {for (let index = 0; index < this._subEmitters.length; index++) for (const subEmitter of this._subEmitters[index]) subEmitter.dispose();this._subEmitters = [], this.subEmitters = [];}if (this._disposeEmitterOnDispose && this.emitter && this.emitter.dispose && this.emitter.dispose(!0), this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.clear(), this._scene) {const index = this._scene.particleSystems.indexOf(this);-1 < index && this._scene.particleSystems.splice(index, 1), this._scene._activeParticleSystems.dispose();}this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onStoppedObservable.clear(), this.reset();}clone(name, newEmitter, cloneTexture = !1) {const custom = { ...this._customWrappers };let program = null;const engine = this._engine;if (engine.createEffectForParticles && null != this.customShader) {program = this.customShader;const defines = 0 < program.shaderOptions.defines.length ? program.shaderOptions.defines.join("\n") : "",effect = engine.createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines);custom[0] ? custom[0].effect = effect : this.setCustomEffect(effect, 0);}const serialization = this.serialize(cloneTexture),result = ParticleSystem.Parse(serialization, this._scene || this._engine, this._rootUrl);return result.name = name, result.customShader = program, result._customWrappers = custom, void 0 === newEmitter && (newEmitter = this.emitter), this.noiseTexture && (result.noiseTexture = this.noiseTexture.clone()), result.emitter = newEmitter, this.preventAutoStart || result.start(), result;}serialize(serializeTexture = !1) {const serializationObject = {};if (ParticleSystem._Serialize(serializationObject, this, serializeTexture), serializationObject.textureMask = this.textureMask.asArray(), serializationObject.customShader = this.customShader, serializationObject.preventAutoStart = this.preventAutoStart, this.subEmitters) {serializationObject.subEmitters = [], this._subEmitters || this._prepareSubEmitterInternalArray();for (const subs of this._subEmitters) {const cell = [];for (const sub of subs) cell.push(sub.serialize(serializeTexture));serializationObject.subEmitters.push(cell);}}return serializationObject;}static _Serialize(serializationObject, particleSystem, serializeTexture) {if (serializationObject.name = particleSystem.name, serializationObject.id = particleSystem.id, serializationObject.capacity = particleSystem.getCapacity(), serializationObject.disposeOnStop = particleSystem.disposeOnStop, serializationObject.manualEmitCount = particleSystem.manualEmitCount, particleSystem.emitter.position) {const emitterMesh = particleSystem.emitter;serializationObject.emitterId = emitterMesh.id;} else {const emitterPosition = particleSystem.emitter;serializationObject.emitter = emitterPosition.asArray();}particleSystem.particleEmitterType && (serializationObject.particleEmitterType = particleSystem.particleEmitterType.serialize()), particleSystem.particleTexture && (serializeTexture ? serializationObject.texture = particleSystem.particleTexture.serialize() : (serializationObject.textureName = particleSystem.particleTexture.name, serializationObject.invertY = !!particleSystem.particleTexture._invertY)), serializationObject.isLocal = particleSystem.isLocal, decorators/* SerializationHelper.AppendSerializedAnimations */.p4.AppendSerializedAnimations(particleSystem, serializationObject), serializationObject.beginAnimationOnStart = particleSystem.beginAnimationOnStart, serializationObject.beginAnimationFrom = particleSystem.beginAnimationFrom, serializationObject.beginAnimationTo = particleSystem.beginAnimationTo, serializationObject.beginAnimationLoop = particleSystem.beginAnimationLoop, serializationObject.startDelay = particleSystem.startDelay, serializationObject.renderingGroupId = particleSystem.renderingGroupId, serializationObject.isBillboardBased = particleSystem.isBillboardBased, serializationObject.billboardMode = particleSystem.billboardMode, serializationObject.minAngularSpeed = particleSystem.minAngularSpeed, serializationObject.maxAngularSpeed = particleSystem.maxAngularSpeed, serializationObject.minSize = particleSystem.minSize, serializationObject.maxSize = particleSystem.maxSize, serializationObject.minScaleX = particleSystem.minScaleX, serializationObject.maxScaleX = particleSystem.maxScaleX, serializationObject.minScaleY = particleSystem.minScaleY, serializationObject.maxScaleY = particleSystem.maxScaleY, serializationObject.minEmitPower = particleSystem.minEmitPower, serializationObject.maxEmitPower = particleSystem.maxEmitPower, serializationObject.minLifeTime = particleSystem.minLifeTime, serializationObject.maxLifeTime = particleSystem.maxLifeTime, serializationObject.emitRate = particleSystem.emitRate, serializationObject.gravity = particleSystem.gravity.asArray(), serializationObject.noiseStrength = particleSystem.noiseStrength.asArray(), serializationObject.color1 = particleSystem.color1.asArray(), serializationObject.color2 = particleSystem.color2.asArray(), serializationObject.colorDead = particleSystem.colorDead.asArray(), serializationObject.updateSpeed = particleSystem.updateSpeed, serializationObject.targetStopDuration = particleSystem.targetStopDuration, serializationObject.blendMode = particleSystem.blendMode, serializationObject.preWarmCycles = particleSystem.preWarmCycles, serializationObject.preWarmStepOffset = particleSystem.preWarmStepOffset, serializationObject.minInitialRotation = particleSystem.minInitialRotation, serializationObject.maxInitialRotation = particleSystem.maxInitialRotation, serializationObject.startSpriteCellID = particleSystem.startSpriteCellID, serializationObject.spriteCellLoop = particleSystem.spriteCellLoop, serializationObject.endSpriteCellID = particleSystem.endSpriteCellID, serializationObject.spriteCellChangeSpeed = particleSystem.spriteCellChangeSpeed, serializationObject.spriteCellWidth = particleSystem.spriteCellWidth, serializationObject.spriteCellHeight = particleSystem.spriteCellHeight, serializationObject.spriteRandomStartCell = particleSystem.spriteRandomStartCell, serializationObject.isAnimationSheetEnabled = particleSystem.isAnimationSheetEnabled, serializationObject.useLogarithmicDepth = particleSystem.useLogarithmicDepth;const colorGradients = particleSystem.getColorGradients();if (colorGradients) {serializationObject.colorGradients = [];for (const colorGradient of colorGradients) {const serializedGradient = { gradient: colorGradient.gradient, color1: colorGradient.color1.asArray() };serializedGradient.color2 = colorGradient.color2 ? colorGradient.color2.asArray() : colorGradient.color1.asArray(), serializationObject.colorGradients.push(serializedGradient);}}const rampGradients = particleSystem.getRampGradients();if (rampGradients) {serializationObject.rampGradients = [];for (const rampGradient of rampGradients) {const serializedGradient = { gradient: rampGradient.gradient, color: rampGradient.color.asArray() };serializationObject.rampGradients.push(serializedGradient);}serializationObject.useRampGradients = particleSystem.useRampGradients;}const colorRemapGradients = particleSystem.getColorRemapGradients();if (colorRemapGradients) {serializationObject.colorRemapGradients = [];for (const colorRemapGradient of colorRemapGradients) {const serializedGradient = { gradient: colorRemapGradient.gradient, factor1: colorRemapGradient.factor1 };serializedGradient.factor2 = void 0 === colorRemapGradient.factor2 ? colorRemapGradient.factor1 : colorRemapGradient.factor2, serializationObject.colorRemapGradients.push(serializedGradient);}}const alphaRemapGradients = particleSystem.getAlphaRemapGradients();if (alphaRemapGradients) {serializationObject.alphaRemapGradients = [];for (const alphaRemapGradient of alphaRemapGradients) {const serializedGradient = { gradient: alphaRemapGradient.gradient, factor1: alphaRemapGradient.factor1 };serializedGradient.factor2 = void 0 === alphaRemapGradient.factor2 ? alphaRemapGradient.factor1 : alphaRemapGradient.factor2, serializationObject.alphaRemapGradients.push(serializedGradient);}}const sizeGradients = particleSystem.getSizeGradients();if (sizeGradients) {serializationObject.sizeGradients = [];for (const sizeGradient of sizeGradients) {const serializedGradient = { gradient: sizeGradient.gradient, factor1: sizeGradient.factor1 };serializedGradient.factor2 = void 0 === sizeGradient.factor2 ? sizeGradient.factor1 : sizeGradient.factor2, serializationObject.sizeGradients.push(serializedGradient);}}const angularSpeedGradients = particleSystem.getAngularSpeedGradients();if (angularSpeedGradients) {serializationObject.angularSpeedGradients = [];for (const angularSpeedGradient of angularSpeedGradients) {const serializedGradient = { gradient: angularSpeedGradient.gradient, factor1: angularSpeedGradient.factor1 };serializedGradient.factor2 = void 0 === angularSpeedGradient.factor2 ? angularSpeedGradient.factor1 : angularSpeedGradient.factor2, serializationObject.angularSpeedGradients.push(serializedGradient);}}const velocityGradients = particleSystem.getVelocityGradients();if (velocityGradients) {serializationObject.velocityGradients = [];for (const velocityGradient of velocityGradients) {const serializedGradient = { gradient: velocityGradient.gradient, factor1: velocityGradient.factor1 };serializedGradient.factor2 = void 0 === velocityGradient.factor2 ? velocityGradient.factor1 : velocityGradient.factor2, serializationObject.velocityGradients.push(serializedGradient);}}const dragGradients = particleSystem.getDragGradients();if (dragGradients) {serializationObject.dragGradients = [];for (const dragGradient of dragGradients) {const serializedGradient = { gradient: dragGradient.gradient, factor1: dragGradient.factor1 };serializedGradient.factor2 = void 0 === dragGradient.factor2 ? dragGradient.factor1 : dragGradient.factor2, serializationObject.dragGradients.push(serializedGradient);}}const emitRateGradients = particleSystem.getEmitRateGradients();if (emitRateGradients) {serializationObject.emitRateGradients = [];for (const emitRateGradient of emitRateGradients) {const serializedGradient = { gradient: emitRateGradient.gradient, factor1: emitRateGradient.factor1 };serializedGradient.factor2 = void 0 === emitRateGradient.factor2 ? emitRateGradient.factor1 : emitRateGradient.factor2, serializationObject.emitRateGradients.push(serializedGradient);}}const startSizeGradients = particleSystem.getStartSizeGradients();if (startSizeGradients) {serializationObject.startSizeGradients = [];for (const startSizeGradient of startSizeGradients) {const serializedGradient = { gradient: startSizeGradient.gradient, factor1: startSizeGradient.factor1 };serializedGradient.factor2 = void 0 === startSizeGradient.factor2 ? startSizeGradient.factor1 : startSizeGradient.factor2, serializationObject.startSizeGradients.push(serializedGradient);}}const lifeTimeGradients = particleSystem.getLifeTimeGradients();if (lifeTimeGradients) {serializationObject.lifeTimeGradients = [];for (const lifeTimeGradient of lifeTimeGradients) {const serializedGradient = { gradient: lifeTimeGradient.gradient, factor1: lifeTimeGradient.factor1 };serializedGradient.factor2 = void 0 === lifeTimeGradient.factor2 ? lifeTimeGradient.factor1 : lifeTimeGradient.factor2, serializationObject.lifeTimeGradients.push(serializedGradient);}}const limitVelocityGradients = particleSystem.getLimitVelocityGradients();if (limitVelocityGradients) {serializationObject.limitVelocityGradients = [];for (const limitVelocityGradient of limitVelocityGradients) {const serializedGradient = { gradient: limitVelocityGradient.gradient, factor1: limitVelocityGradient.factor1 };serializedGradient.factor2 = void 0 === limitVelocityGradient.factor2 ? limitVelocityGradient.factor1 : limitVelocityGradient.factor2, serializationObject.limitVelocityGradients.push(serializedGradient);}serializationObject.limitVelocityDamping = particleSystem.limitVelocityDamping;}particleSystem.noiseTexture && (serializationObject.noiseTexture = particleSystem.noiseTexture.serialize());}static _Parse(parsedParticleSystem, particleSystem, sceneOrEngine, rootUrl) {var _a, _b, _c;let scene = sceneOrEngine instanceof thinEngine/* ThinEngine */.B ? null : sceneOrEngine;const internalClass = (0,typeStore/* GetClass */.q)("BABYLON.Texture");if (internalClass && scene && (parsedParticleSystem.texture ? particleSystem.particleTexture = internalClass.Parse(parsedParticleSystem.texture, scene, rootUrl) : parsedParticleSystem.textureName && (particleSystem.particleTexture = new internalClass(rootUrl + parsedParticleSystem.textureName, scene, !1, void 0 === parsedParticleSystem.invertY || parsedParticleSystem.invertY), particleSystem.particleTexture.name = parsedParticleSystem.textureName)), particleSystem.emitter = parsedParticleSystem.emitterId || 0 === parsedParticleSystem.emitterId || void 0 !== parsedParticleSystem.emitter ? parsedParticleSystem.emitterId && scene ? scene.getLastMeshById(parsedParticleSystem.emitterId) : math_vector/* Vector3.FromArray */.P.FromArray(parsedParticleSystem.emitter) : math_vector/* Vector3.Zero */.P.Zero(), particleSystem.isLocal = !!parsedParticleSystem.isLocal, void 0 !== parsedParticleSystem.renderingGroupId && (particleSystem.renderingGroupId = parsedParticleSystem.renderingGroupId), void 0 !== parsedParticleSystem.isBillboardBased && (particleSystem.isBillboardBased = parsedParticleSystem.isBillboardBased), void 0 !== parsedParticleSystem.billboardMode && (particleSystem.billboardMode = parsedParticleSystem.billboardMode), void 0 !== parsedParticleSystem.useLogarithmicDepth && (particleSystem.useLogarithmicDepth = parsedParticleSystem.useLogarithmicDepth), parsedParticleSystem.animations) {for (let animationIndex = 0; animationIndex < parsedParticleSystem.animations.length; animationIndex++) {const parsedAnimation = parsedParticleSystem.animations[animationIndex],internalClass = (0,typeStore/* GetClass */.q)("BABYLON.Animation");internalClass && particleSystem.animations.push(internalClass.Parse(parsedAnimation));}particleSystem.beginAnimationOnStart = parsedParticleSystem.beginAnimationOnStart, particleSystem.beginAnimationFrom = parsedParticleSystem.beginAnimationFrom, particleSystem.beginAnimationTo = parsedParticleSystem.beginAnimationTo, particleSystem.beginAnimationLoop = parsedParticleSystem.beginAnimationLoop;}if (parsedParticleSystem.autoAnimate && scene && scene.beginAnimation(particleSystem, parsedParticleSystem.autoAnimateFrom, parsedParticleSystem.autoAnimateTo, parsedParticleSystem.autoAnimateLoop, parsedParticleSystem.autoAnimateSpeed || 1), particleSystem.startDelay = 0 | parsedParticleSystem.startDelay, particleSystem.minAngularSpeed = parsedParticleSystem.minAngularSpeed, particleSystem.maxAngularSpeed = parsedParticleSystem.maxAngularSpeed, particleSystem.minSize = parsedParticleSystem.minSize, particleSystem.maxSize = parsedParticleSystem.maxSize, parsedParticleSystem.minScaleX && (particleSystem.minScaleX = parsedParticleSystem.minScaleX, particleSystem.maxScaleX = parsedParticleSystem.maxScaleX, particleSystem.minScaleY = parsedParticleSystem.minScaleY, particleSystem.maxScaleY = parsedParticleSystem.maxScaleY), void 0 !== parsedParticleSystem.preWarmCycles && (particleSystem.preWarmCycles = parsedParticleSystem.preWarmCycles, particleSystem.preWarmStepOffset = parsedParticleSystem.preWarmStepOffset), void 0 !== parsedParticleSystem.minInitialRotation && (particleSystem.minInitialRotation = parsedParticleSystem.minInitialRotation, particleSystem.maxInitialRotation = parsedParticleSystem.maxInitialRotation), particleSystem.minLifeTime = parsedParticleSystem.minLifeTime, particleSystem.maxLifeTime = parsedParticleSystem.maxLifeTime, particleSystem.minEmitPower = parsedParticleSystem.minEmitPower, particleSystem.maxEmitPower = parsedParticleSystem.maxEmitPower, particleSystem.emitRate = parsedParticleSystem.emitRate, particleSystem.gravity = math_vector/* Vector3.FromArray */.P.FromArray(parsedParticleSystem.gravity), parsedParticleSystem.noiseStrength && (particleSystem.noiseStrength = math_vector/* Vector3.FromArray */.P.FromArray(parsedParticleSystem.noiseStrength)), particleSystem.color1 = math_color/* Color4.FromArray */.HE.FromArray(parsedParticleSystem.color1), particleSystem.color2 = math_color/* Color4.FromArray */.HE.FromArray(parsedParticleSystem.color2), particleSystem.colorDead = math_color/* Color4.FromArray */.HE.FromArray(parsedParticleSystem.colorDead), particleSystem.updateSpeed = parsedParticleSystem.updateSpeed, particleSystem.targetStopDuration = parsedParticleSystem.targetStopDuration, particleSystem.blendMode = parsedParticleSystem.blendMode, parsedParticleSystem.colorGradients) for (const colorGradient of parsedParticleSystem.colorGradients) particleSystem.addColorGradient(colorGradient.gradient, math_color/* Color4.FromArray */.HE.FromArray(colorGradient.color1), colorGradient.color2 ? math_color/* Color4.FromArray */.HE.FromArray(colorGradient.color2) : void 0);if (parsedParticleSystem.rampGradients) {for (const rampGradient of parsedParticleSystem.rampGradients) particleSystem.addRampGradient(rampGradient.gradient, math_color/* Color3.FromArray */.Wo.FromArray(rampGradient.color));particleSystem.useRampGradients = parsedParticleSystem.useRampGradients;}if (parsedParticleSystem.colorRemapGradients) for (const colorRemapGradient of parsedParticleSystem.colorRemapGradients) particleSystem.addColorRemapGradient(colorRemapGradient.gradient, void 0 === colorRemapGradient.factor1 ? colorRemapGradient.factor : colorRemapGradient.factor1, colorRemapGradient.factor2);if (parsedParticleSystem.alphaRemapGradients) for (const alphaRemapGradient of parsedParticleSystem.alphaRemapGradients) particleSystem.addAlphaRemapGradient(alphaRemapGradient.gradient, void 0 === alphaRemapGradient.factor1 ? alphaRemapGradient.factor : alphaRemapGradient.factor1, alphaRemapGradient.factor2);if (parsedParticleSystem.sizeGradients) for (const sizeGradient of parsedParticleSystem.sizeGradients) particleSystem.addSizeGradient(sizeGradient.gradient, void 0 === sizeGradient.factor1 ? sizeGradient.factor : sizeGradient.factor1, sizeGradient.factor2);if (parsedParticleSystem.angularSpeedGradients) for (const angularSpeedGradient of parsedParticleSystem.angularSpeedGradients) particleSystem.addAngularSpeedGradient(angularSpeedGradient.gradient, void 0 === angularSpeedGradient.factor1 ? angularSpeedGradient.factor : angularSpeedGradient.factor1, angularSpeedGradient.factor2);if (parsedParticleSystem.velocityGradients) for (const velocityGradient of parsedParticleSystem.velocityGradients) particleSystem.addVelocityGradient(velocityGradient.gradient, void 0 === velocityGradient.factor1 ? velocityGradient.factor : velocityGradient.factor1, velocityGradient.factor2);if (parsedParticleSystem.dragGradients) for (const dragGradient of parsedParticleSystem.dragGradients) particleSystem.addDragGradient(dragGradient.gradient, void 0 === dragGradient.factor1 ? dragGradient.factor : dragGradient.factor1, dragGradient.factor2);if (parsedParticleSystem.emitRateGradients) for (const emitRateGradient of parsedParticleSystem.emitRateGradients) particleSystem.addEmitRateGradient(emitRateGradient.gradient, void 0 === emitRateGradient.factor1 ? emitRateGradient.factor : emitRateGradient.factor1, emitRateGradient.factor2);if (parsedParticleSystem.startSizeGradients) for (const startSizeGradient of parsedParticleSystem.startSizeGradients) particleSystem.addStartSizeGradient(startSizeGradient.gradient, void 0 === startSizeGradient.factor1 ? startSizeGradient.factor : startSizeGradient.factor1, startSizeGradient.factor2);if (parsedParticleSystem.lifeTimeGradients) for (const lifeTimeGradient of parsedParticleSystem.lifeTimeGradients) particleSystem.addLifeTimeGradient(lifeTimeGradient.gradient, void 0 === lifeTimeGradient.factor1 ? lifeTimeGradient.factor : lifeTimeGradient.factor1, lifeTimeGradient.factor2);if (parsedParticleSystem.limitVelocityGradients) {for (const limitVelocityGradient of parsedParticleSystem.limitVelocityGradients) particleSystem.addLimitVelocityGradient(limitVelocityGradient.gradient, void 0 === limitVelocityGradient.factor1 ? limitVelocityGradient.factor : limitVelocityGradient.factor1, limitVelocityGradient.factor2);particleSystem.limitVelocityDamping = parsedParticleSystem.limitVelocityDamping;}if (parsedParticleSystem.noiseTexture && scene) {const internalClass = (0,typeStore/* GetClass */.q)("BABYLON.ProceduralTexture");particleSystem.noiseTexture = internalClass.Parse(parsedParticleSystem.noiseTexture, scene, rootUrl);}let emitterType;if (parsedParticleSystem.particleEmitterType) {switch (parsedParticleSystem.particleEmitterType.type) {case "SphereParticleEmitter":emitterType = new SphereParticleEmitter();break;case "SphereDirectedParticleEmitter":emitterType = new SphereDirectedParticleEmitter();break;case "ConeEmitter":case "ConeParticleEmitter":emitterType = new ConeParticleEmitter();break;case "CylinderParticleEmitter":emitterType = new CylinderParticleEmitter();break;case "CylinderDirectedParticleEmitter":emitterType = new CylinderDirectedParticleEmitter();break;case "HemisphericParticleEmitter":emitterType = new HemisphericParticleEmitter();break;case "PointParticleEmitter":emitterType = new PointParticleEmitter();break;case "MeshParticleEmitter":emitterType = new MeshParticleEmitter();break;case "BoxEmitter":case "BoxParticleEmitter":default:emitterType = new BoxParticleEmitter();}emitterType.parse(parsedParticleSystem.particleEmitterType, scene);} else emitterType = new BoxParticleEmitter(), emitterType.parse(parsedParticleSystem, scene);particleSystem.particleEmitterType = emitterType, particleSystem.startSpriteCellID = parsedParticleSystem.startSpriteCellID, particleSystem.endSpriteCellID = parsedParticleSystem.endSpriteCellID, particleSystem.spriteCellLoop = null === (_a = parsedParticleSystem.spriteCellLoop) || void 0 === _a || _a, particleSystem.spriteCellWidth = parsedParticleSystem.spriteCellWidth, particleSystem.spriteCellHeight = parsedParticleSystem.spriteCellHeight, particleSystem.spriteCellChangeSpeed = parsedParticleSystem.spriteCellChangeSpeed, particleSystem.spriteRandomStartCell = parsedParticleSystem.spriteRandomStartCell, particleSystem.disposeOnStop = null !== (_b = parsedParticleSystem.disposeOnStop) && void 0 !== _b && _b, particleSystem.manualEmitCount = null !== (_c = parsedParticleSystem.manualEmitCount) && void 0 !== _c ? _c : -1;}static Parse(parsedParticleSystem, sceneOrEngine, rootUrl, doNotStart = !1, capacity) {const name = parsedParticleSystem.name;let engine,scene,custom = null,program = null;if (sceneOrEngine instanceof thinEngine/* ThinEngine */.B ? engine = sceneOrEngine : (scene = sceneOrEngine, engine = scene.getEngine()), parsedParticleSystem.customShader && engine.createEffectForParticles) {program = parsedParticleSystem.customShader;const defines = 0 < program.shaderOptions.defines.length ? program.shaderOptions.defines.join("\n") : "";custom = engine.createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines);}const particleSystem = new ParticleSystem(name, capacity || parsedParticleSystem.capacity, sceneOrEngine, custom, parsedParticleSystem.isAnimationSheetEnabled);if (particleSystem.customShader = program, particleSystem._rootUrl = rootUrl, parsedParticleSystem.id && (particleSystem.id = parsedParticleSystem.id), parsedParticleSystem.subEmitters) {particleSystem.subEmitters = [];for (const cell of parsedParticleSystem.subEmitters) {const cellArray = [];for (const sub of cell) cellArray.push(SubEmitter.Parse(sub, sceneOrEngine, rootUrl));particleSystem.subEmitters.push(cellArray);}}return ParticleSystem._Parse(parsedParticleSystem, particleSystem, sceneOrEngine, rootUrl), parsedParticleSystem.textureMask && (particleSystem.textureMask = math_color/* Color4.FromArray */.HE.FromArray(parsedParticleSystem.textureMask)), parsedParticleSystem.preventAutoStart && (particleSystem.preventAutoStart = parsedParticleSystem.preventAutoStart), doNotStart || particleSystem.preventAutoStart || particleSystem.start(), particleSystem;}}ParticleSystem.BILLBOARDMODE_Y = 2, ParticleSystem.BILLBOARDMODE_ALL = 7, ParticleSystem.BILLBOARDMODE_STRETCHED = 8, ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL = 9, SubEmitter._ParseParticleSystem = ParticleSystem.Parse;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration2.js
const clipPlaneFragmentDeclaration2_name = "clipPlaneFragmentDeclaration2",clipPlaneFragmentDeclaration2_shader = `#ifdef CLIPPLANE
in float fClipDistance;
#endif
#ifdef CLIPPLANE2
in float fClipDistance2;
#endif
#ifdef CLIPPLANE3
in float fClipDistance3;
#endif
#ifdef CLIPPLANE4
in float fClipDistance4;
#endif
#ifdef CLIPPLANE5
in float fClipDistance5;
#endif
#ifdef CLIPPLANE6
in float fClipDistance6;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.clipPlaneFragmentDeclaration2 */.v.IncludesShadersStore.clipPlaneFragmentDeclaration2 = clipPlaneFragmentDeclaration2_shader;const clipPlaneFragmentDeclaration2 = { name: "clipPlaneFragmentDeclaration2", shader: clipPlaneFragmentDeclaration2_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/gpuRenderParticles.fragment.js
const gpuRenderParticles_fragment_name = "gpuRenderParticlesPixelShader",gpuRenderParticles_fragment_shader = `precision highp float;
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
uniform sampler2D diffuseSampler;
varying vec2 vUV;
varying vec4 vColor;
#include<clipPlaneFragmentDeclaration2> 
#include<imageProcessingDeclaration>
#include<logDepthDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
void main() {
#include<clipPlaneFragment> 
vec4 textureColor=texture2D(diffuseSampler,vUV);
gl_FragColor=textureColor*vColor;
#ifdef BLENDMULTIPLYMODE
float alpha=vColor.a*textureColor.a;
gl_FragColor.rgb=gl_FragColor.rgb*alpha+vec3(1.0)*(1.0-alpha);
#endif 
#include<logDepthFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
gl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);
#else
#ifdef IMAGEPROCESSING
gl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);
gl_FragColor=applyImageProcessing(gl_FragColor);
#endif
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.gpuRenderParticlesPixelShader */.v.ShadersStore.gpuRenderParticlesPixelShader = gpuRenderParticles_fragment_shader;const gpuRenderParticlesPixelShader = { name: "gpuRenderParticlesPixelShader", shader: gpuRenderParticles_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration2.js
const clipPlaneVertexDeclaration2_name = "clipPlaneVertexDeclaration2",clipPlaneVertexDeclaration2_shader = `#ifdef CLIPPLANE
uniform vec4 vClipPlane;
out float fClipDistance;
#endif
#ifdef CLIPPLANE2
uniform vec4 vClipPlane2;
out float fClipDistance2;
#endif
#ifdef CLIPPLANE3
uniform vec4 vClipPlane3;
out float fClipDistance3;
#endif
#ifdef CLIPPLANE4
uniform vec4 vClipPlane4;
out float fClipDistance4;
#endif
#ifdef CLIPPLANE5
uniform vec4 vClipPlane5;
out float fClipDistance5;
#endif
#ifdef CLIPPLANE6
uniform vec4 vClipPlane6;
out float fClipDistance6;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.clipPlaneVertexDeclaration2 */.v.IncludesShadersStore.clipPlaneVertexDeclaration2 = clipPlaneVertexDeclaration2_shader;const clipPlaneVertexDeclaration2 = { name: "clipPlaneVertexDeclaration2", shader: clipPlaneVertexDeclaration2_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/gpuRenderParticles.vertex.js
const gpuRenderParticles_vertex_name = "gpuRenderParticlesVertexShader",gpuRenderParticles_vertex_shader = `precision highp float;
uniform mat4 view;
uniform mat4 projection;
uniform vec2 translationPivot;
uniform vec3 worldOffset;
#ifdef LOCAL
uniform mat4 emitterWM;
#endif
attribute vec3 position;
attribute float age;
attribute float life;
attribute vec3 size;
#ifndef BILLBOARD
attribute vec3 initialDirection;
#endif
#ifdef BILLBOARDSTRETCHED
attribute vec3 direction;
#endif
attribute float angle;
#ifdef ANIMATESHEET
attribute float cellIndex;
#endif
attribute vec2 offset;
attribute vec2 uv;
varying vec2 vUV;
varying vec4 vColor;
varying vec3 vPositionW;
#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)
uniform mat4 invView;
#endif
#include<clipPlaneVertexDeclaration2>
#include<logDepthDeclaration>
#ifdef COLORGRADIENTS
uniform sampler2D colorGradientSampler;
#else
uniform vec4 colorDead;
attribute vec4 color;
#endif
#ifdef ANIMATESHEET
uniform vec3 sheetInfos;
#endif
#ifdef BILLBOARD
uniform vec3 eyePosition;
#endif
vec3 rotate(vec3 yaxis,vec3 rotatedCorner) {
vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));
vec3 zaxis=normalize(cross(yaxis,xaxis));
vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);
vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);
vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);
mat3 rotMatrix= mat3(row0,row1,row2);
vec3 alignedCorner=rotMatrix*rotatedCorner;
#ifdef LOCAL
return ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;
#else
return (position+worldOffset)+alignedCorner;
#endif
}
#ifdef BILLBOARDSTRETCHED
vec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {
vec3 normalizedToCamera=normalize(toCamera);
vec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));
vec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));
vec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);
vec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);
vec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);
mat3 rotMatrix= mat3(row0,row1,row2);
vec3 alignedCorner=rotMatrix*rotatedCorner;
#ifdef LOCAL
return ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;
#else
return (position+worldOffset)+alignedCorner;
#endif
}
#endif
void main() {
#ifdef ANIMATESHEET
float rowOffset=floor(cellIndex/sheetInfos.z);
float columnOffset=cellIndex-rowOffset*sheetInfos.z;
vec2 uvScale=sheetInfos.xy;
vec2 uvOffset=vec2(uv.x ,1.0-uv.y);
vUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;
#else
vUV=uv;
#endif
float ratio=age/life;
#ifdef COLORGRADIENTS
vColor=texture2D(colorGradientSampler,vec2(ratio,0));
#else
vColor=color*vec4(1.0-ratio)+colorDead*vec4(ratio);
#endif
vec2 cornerPos=(offset-translationPivot)*size.yz*size.x+translationPivot;
#ifdef BILLBOARD
vec4 rotatedCorner;
rotatedCorner.w=0.;
#ifdef BILLBOARDY
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);
rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);
rotatedCorner.y=0.;
vec3 yaxis=(position+worldOffset)-eyePosition;
yaxis.y=0.;
vPositionW=rotate(normalize(yaxis),rotatedCorner.xyz);
vec4 viewPosition=(view*vec4(vPositionW,1.0));
#elif defined(BILLBOARDSTRETCHED)
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);
rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);
rotatedCorner.z=0.;
vec3 toCamera=(position+worldOffset)-eyePosition;
vPositionW=rotateAlign(toCamera,rotatedCorner.xyz);
vec4 viewPosition=(view*vec4(vPositionW,1.0));
#else
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);
rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);
rotatedCorner.z=0.;
#ifdef LOCAL
vec4 viewPosition=view*vec4(((emitterWM*vec4(position,1.0)).xyz+worldOffset),1.0)+rotatedCorner;
#else
vec4 viewPosition=view*vec4((position+worldOffset),1.0)+rotatedCorner;
#endif
vPositionW=(invView*viewPosition).xyz;
#endif
#else
vec3 rotatedCorner;
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);
rotatedCorner.y=0.;
rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);
vec3 yaxis=normalize(initialDirection);
vPositionW=rotate(yaxis,rotatedCorner);
vec4 viewPosition=view*vec4(vPositionW,1.0);
#endif
gl_Position=projection*viewPosition;
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
vec4 worldPos=vec4(vPositionW,1.0);
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
}`;shaderStore/* ShaderStore.ShadersStore.gpuRenderParticlesVertexShader */.v.ShadersStore.gpuRenderParticlesVertexShader = gpuRenderParticles_vertex_shader;const gpuRenderParticlesVertexShader = { name: "gpuRenderParticlesVertexShader", shader: gpuRenderParticles_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/gpuParticleSystem.js
class GPUParticleSystem extends BaseParticleSystem {static get IsSupported() {if (!engineStore/* EngineStore.LastCreatedEngine */.l.LastCreatedEngine) return !1;const caps = engineStore/* EngineStore.LastCreatedEngine.getCaps */.l.LastCreatedEngine.getCaps();return caps.supportTransformFeedbacks || caps.supportComputeShaders;}getCapacity() {return this._capacity;}get activeParticleCount() {return this._activeCount;}set activeParticleCount(value) {this._activeCount = Math.min(value, this._capacity);}isReady() {if (!this.emitter || this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady() || !this.particleTexture || !this.particleTexture.isReady()) return !1;if (this.blendMode === ParticleSystem.BLENDMODE_MULTIPLYADD) {if (!this._getWrapper(ParticleSystem.BLENDMODE_MULTIPLY).effect.isReady()) return !1;if (!this._getWrapper(ParticleSystem.BLENDMODE_ADD).effect.isReady()) return !1;} else if (!this._getWrapper(this.blendMode).effect.isReady()) return !1;return this._platform.isUpdateBufferCreated() ? this._platform.isUpdateBufferReady() : (this._recreateUpdateEffect(), !1);}isStarted() {return this._started;}isStopped() {return this._stopped;}isStopping() {return !1;}getActiveCount() {return this._currentActiveCount;}start(delay = this.startDelay) {if (!this.targetStopDuration && this._hasTargetStopDurationDependantGradient()) throw "Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";return delay ? void setTimeout(() => {this.start(0);}, delay) : void (this._started = !0, this._stopped = !1, this._preWarmDone = !1, this.beginAnimationOnStart && this.animations && 0 < this.animations.length && this._scene && this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop));}stop() {this._stopped || (this._stopped = !0);}reset() {this._releaseBuffers(), this._platform.releaseVertexBuffers(), this._currentActiveCount = 0, this._targetIndex = 0;}getClassName() {return "GPUParticleSystem";}getCustomEffect(blendMode = 0) {var _a, _b;return null !== (_b = null === (_a = this._customWrappers[blendMode]) || void 0 === _a ? void 0 : _a.effect) && void 0 !== _b ? _b : this._customWrappers[0].effect;}_getCustomDrawWrapper(blendMode = 0) {var _a;return null !== (_a = this._customWrappers[blendMode]) && void 0 !== _a ? _a : this._customWrappers[0];}setCustomEffect(effect, blendMode = 0) {this._customWrappers[blendMode] = new Materials_drawWrapper/* DrawWrapper */.q(this._engine), this._customWrappers[blendMode].effect = effect;}get onBeforeDrawParticlesObservable() {return this._onBeforeDrawParticlesObservable || (this._onBeforeDrawParticlesObservable = new observable/* Observable */.y$()), this._onBeforeDrawParticlesObservable;}get vertexShaderName() {return "gpuRenderParticles";}get vertexBuffers() {return this._renderVertexBuffers[1 ^ this._targetIndex];}get indexBuffer() {return null;}_removeGradientAndTexture(gradient, gradients, texture) {return super._removeGradientAndTexture(gradient, gradients, texture), this._releaseBuffers(), this;}addColorGradient(gradient, color1) {this._colorGradients || (this._colorGradients = []);const colorGradient = new ColorGradient(gradient, color1);return this._colorGradients.push(colorGradient), this._refreshColorGradient(!0), this._releaseBuffers(), this;}_refreshColorGradient(reorder = !1) {this._colorGradients && (reorder && this._colorGradients.sort((a, b) => {if (a.gradient < b.gradient) return -1;return a.gradient > b.gradient ? 1 : 0;}), this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null));}forceRefreshGradients() {this._refreshColorGradient(), this._refreshFactorGradient(this._sizeGradients, "_sizeGradientsTexture"), this._refreshFactorGradient(this._angularSpeedGradients, "_angularSpeedGradientsTexture"), this._refreshFactorGradient(this._velocityGradients, "_velocityGradientsTexture"), this._refreshFactorGradient(this._limitVelocityGradients, "_limitVelocityGradientsTexture"), this._refreshFactorGradient(this._dragGradients, "_dragGradientsTexture"), this.reset();}removeColorGradient(gradient) {return this._removeGradientAndTexture(gradient, this._colorGradients, this._colorGradientsTexture), this._colorGradientsTexture = null, this;}resetDrawCache() {var _a;for (const blendMode in this._drawWrappers) {const drawWrapper = this._drawWrappers[blendMode];null === (_a = drawWrapper.drawContext) || void 0 === _a ? void 0 : _a.reset();}}_addFactorGradient(factorGradients, gradient, factor) {const valueGradient = new FactorGradient(gradient, factor);factorGradients.push(valueGradient), this._releaseBuffers();}addSizeGradient(gradient, factor) {return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, gradient, factor), this._refreshFactorGradient(this._sizeGradients, "_sizeGradientsTexture", !0), this._releaseBuffers(), this;}removeSizeGradient(gradient) {return this._removeGradientAndTexture(gradient, this._sizeGradients, this._sizeGradientsTexture), this._sizeGradientsTexture = null, this;}_refreshFactorGradient(factorGradients, textureName, reorder = !1) {if (factorGradients) {reorder && factorGradients.sort((a, b) => a.gradient < b.gradient ? -1 : a.gradient > b.gradient ? 1 : 0);const that = this;that[textureName] && (that[textureName].dispose(), that[textureName] = null);}}addAngularSpeedGradient(gradient, factor) {return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, gradient, factor), this._refreshFactorGradient(this._angularSpeedGradients, "_angularSpeedGradientsTexture", !0), this._releaseBuffers(), this;}removeAngularSpeedGradient(gradient) {return this._removeGradientAndTexture(gradient, this._angularSpeedGradients, this._angularSpeedGradientsTexture), this._angularSpeedGradientsTexture = null, this;}addVelocityGradient(gradient, factor) {return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, gradient, factor), this._refreshFactorGradient(this._velocityGradients, "_velocityGradientsTexture", !0), this._releaseBuffers(), this;}removeVelocityGradient(gradient) {return this._removeGradientAndTexture(gradient, this._velocityGradients, this._velocityGradientsTexture), this._velocityGradientsTexture = null, this;}addLimitVelocityGradient(gradient, factor) {return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, gradient, factor), this._refreshFactorGradient(this._limitVelocityGradients, "_limitVelocityGradientsTexture", !0), this._releaseBuffers(), this;}removeLimitVelocityGradient(gradient) {return this._removeGradientAndTexture(gradient, this._limitVelocityGradients, this._limitVelocityGradientsTexture), this._limitVelocityGradientsTexture = null, this;}addDragGradient(gradient, factor) {return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, gradient, factor), this._refreshFactorGradient(this._dragGradients, "_dragGradientsTexture", !0), this._releaseBuffers(), this;}removeDragGradient(gradient) {return this._removeGradientAndTexture(gradient, this._dragGradients, this._dragGradientsTexture), this._dragGradientsTexture = null, this;}addEmitRateGradient() {return this;}removeEmitRateGradient() {return this;}addStartSizeGradient() {return this;}removeStartSizeGradient() {return this;}addColorRemapGradient() {return this;}removeColorRemapGradient() {return this;}addAlphaRemapGradient() {return this;}removeAlphaRemapGradient() {return this;}addRampGradient() {return this;}removeRampGradient() {return this;}getRampGradients() {return null;}get useRampGradients() {return !1;}set useRampGradients(value) {}addLifeTimeGradient() {return this;}removeLifeTimeGradient() {return this;}constructor(name, options, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = !1) {if (super(name), this.layerMask = 268435455, this._accumulatedCount = 0, this._renderVertexBuffers = [], this._targetIndex = 0, this._currentRenderId = -1, this._currentRenderingCameraUniqueId = -1, this._started = !1, this._stopped = !1, this._timeDelta = 0, this.updateInAnimate = !1, this._actualFrame = 0, this._rawTextureWidth = 256, this.onDisposeObservable = new observable/* Observable */.y$(), this.onStoppedObservable = new observable/* Observable */.y$(), this.forceDepthWrite = !1, this._preWarmDone = !1, this.isLocal = !1, this.isGPU = !0, this._onBeforeDrawParticlesObservable = null, sceneOrEngine && "Scene" !== sceneOrEngine.getClassName() ? (this._engine = sceneOrEngine, this.defaultProjectionMatrix = math_vector/* Matrix.PerspectiveFovLH */.y3.PerspectiveFovLH(.8, 1, .1, 100, this._engine.isNDCHalfZRange)) : (this._scene = sceneOrEngine || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, this._engine = this._scene.getEngine(), this.uniqueId = this._scene.getUniqueId(), this._scene.particleSystems.push(this)), this._engine.getCaps().supportComputeShaders) {if (!(0,typeStore/* GetClass */.q)("BABYLON.ComputeShaderParticleSystem")) throw new Error("The ComputeShaderParticleSystem class is not available! Make sure you have imported it.");this._platform = new ((0,typeStore/* GetClass */.q)("BABYLON.ComputeShaderParticleSystem"))(this, this._engine);} else {if (!(0,typeStore/* GetClass */.q)("BABYLON.WebGL2ParticleSystem")) throw new Error("The WebGL2ParticleSystem class is not available! Make sure you have imported it.");this._platform = new ((0,typeStore/* GetClass */.q)("BABYLON.WebGL2ParticleSystem"))(this, this._engine);}this._customWrappers = { 0: new Materials_drawWrapper/* DrawWrapper */.q(this._engine) }, this._customWrappers[0].effect = customEffect, this._drawWrappers = { 0: new Materials_drawWrapper/* DrawWrapper */.q(this._engine) }, this._drawWrappers[0].drawContext && (this._drawWrappers[0].drawContext.useInstancing = !0), this._attachImageProcessingConfiguration(null), options = null !== options && void 0 !== options ? options : {}, options.randomTextureSize || delete options.randomTextureSize;const fullOptions = { capacity: 5e4, randomTextureSize: this._engine.getCaps().maxTextureSize, ...options },optionsAsNumber = options;isFinite(optionsAsNumber) && (fullOptions.capacity = optionsAsNumber), this._capacity = fullOptions.capacity, this._activeCount = fullOptions.capacity, this._currentActiveCount = 0, this._isAnimationSheetEnabled = isAnimationSheetEnabled, this.particleEmitterType = new BoxParticleEmitter();const maxTextureSize = Math.min(this._engine.getCaps().maxTextureSize, fullOptions.randomTextureSize);let d = [];for (let i = 0; i < maxTextureSize; ++i) d.push(Math.random()), d.push(Math.random()), d.push(Math.random()), d.push(Math.random());this._randomTexture = new rawTexture/* RawTexture */.l(new Float32Array(d), maxTextureSize, 1, 5, sceneOrEngine, !1, !1, 1, 1), this._randomTexture.name = "GPUParticleSystem_random1", this._randomTexture.wrapU = 1, this._randomTexture.wrapV = 1, d = [];for (let i = 0; i < maxTextureSize; ++i) d.push(Math.random()), d.push(Math.random()), d.push(Math.random()), d.push(Math.random());this._randomTexture2 = new rawTexture/* RawTexture */.l(new Float32Array(d), maxTextureSize, 1, 5, sceneOrEngine, !1, !1, 1, 1), this._randomTexture2.name = "GPUParticleSystem_random2", this._randomTexture2.wrapU = 1, this._randomTexture2.wrapV = 1, this._randomTextureSize = maxTextureSize;}_reset() {this._releaseBuffers();}_createVertexBuffers(updateBuffer, renderBuffer, spriteSource) {const renderVertexBuffers = { position: renderBuffer.createVertexBuffer("position", 0, 3, this._attributesStrideSize, !0) };let offset = 3;renderVertexBuffers.age = renderBuffer.createVertexBuffer("age", offset, 1, this._attributesStrideSize, !0), offset += 1, renderVertexBuffers.size = renderBuffer.createVertexBuffer("size", offset, 3, this._attributesStrideSize, !0), offset += 3, renderVertexBuffers.life = renderBuffer.createVertexBuffer("life", offset, 1, this._attributesStrideSize, !0), offset += 1, offset += 4, this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED && (renderVertexBuffers.direction = renderBuffer.createVertexBuffer("direction", offset, 3, this._attributesStrideSize, !0)), offset += 3, this._platform.alignDataInBuffer && (offset += 1), this.particleEmitterType instanceof CustomParticleEmitter && (offset += 3, this._platform.alignDataInBuffer && (offset += 1)), this._colorGradientsTexture || (renderVertexBuffers.color = renderBuffer.createVertexBuffer("color", offset, 4, this._attributesStrideSize, !0), offset += 4), this._isBillboardBased || (renderVertexBuffers.initialDirection = renderBuffer.createVertexBuffer("initialDirection", offset, 3, this._attributesStrideSize, !0), offset += 3, this._platform.alignDataInBuffer && (offset += 1)), this.noiseTexture && (renderVertexBuffers.noiseCoordinates1 = renderBuffer.createVertexBuffer("noiseCoordinates1", offset, 3, this._attributesStrideSize, !0), offset += 3, this._platform.alignDataInBuffer && (offset += 1), renderVertexBuffers.noiseCoordinates2 = renderBuffer.createVertexBuffer("noiseCoordinates2", offset, 3, this._attributesStrideSize, !0), offset += 3, this._platform.alignDataInBuffer && (offset += 1)), renderVertexBuffers.angle = renderBuffer.createVertexBuffer("angle", offset, 1, this._attributesStrideSize, !0), this._angularSpeedGradientsTexture ? offset++ : offset += 2, this._isAnimationSheetEnabled && (renderVertexBuffers.cellIndex = renderBuffer.createVertexBuffer("cellIndex", offset, 1, this._attributesStrideSize, !0), offset += 1, this.spriteRandomStartCell && (renderVertexBuffers.cellStartOffset = renderBuffer.createVertexBuffer("cellStartOffset", offset, 1, this._attributesStrideSize, !0), offset += 1)), renderVertexBuffers.offset = spriteSource.createVertexBuffer("offset", 0, 2), renderVertexBuffers.uv = spriteSource.createVertexBuffer("uv", 2, 2), this._renderVertexBuffers.push(renderVertexBuffers), this._platform.createVertexBuffers(updateBuffer, renderVertexBuffers), this.resetDrawCache();}_initialize(force = !1) {if (this._buffer0 && !force) return;const engine = this._engine,data = [];this._attributesStrideSize = 21, this._targetIndex = 0, this._platform.alignDataInBuffer && (this._attributesStrideSize += 1), this.particleEmitterType instanceof CustomParticleEmitter && (this._attributesStrideSize += 3, this._platform.alignDataInBuffer && (this._attributesStrideSize += 1)), this.isBillboardBased || (this._attributesStrideSize += 3, this._platform.alignDataInBuffer && (this._attributesStrideSize += 1)), this._colorGradientsTexture && (this._attributesStrideSize -= 4), this._angularSpeedGradientsTexture && (this._attributesStrideSize -= 1), this._isAnimationSheetEnabled && (this._attributesStrideSize += 1, this.spriteRandomStartCell && (this._attributesStrideSize += 1)), this.noiseTexture && (this._attributesStrideSize += 6, this._platform.alignDataInBuffer && (this._attributesStrideSize += 2)), this._platform.alignDataInBuffer && (this._attributesStrideSize += 3 - (3 & this._attributesStrideSize + 3));const usingCustomEmitter = this.particleEmitterType instanceof CustomParticleEmitter,tmpVector = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];let offset = 0;for (let particleIndex = 0; particleIndex < this._capacity; particleIndex++) if (data.push(0), data.push(0), data.push(0), data.push(0), data.push(0), data.push(0), data.push(0), data.push(0), data.push(Math.random()), data.push(Math.random()), data.push(Math.random()), data.push(Math.random()), usingCustomEmitter ? (this.particleEmitterType.particleDestinationGenerator(particleIndex, null, tmpVector), data.push(tmpVector.x), data.push(tmpVector.y), data.push(tmpVector.z)) : (data.push(0), data.push(0), data.push(0)), this._platform.alignDataInBuffer && data.push(0), offset += 16, usingCustomEmitter && (this.particleEmitterType.particlePositionGenerator(particleIndex, null, tmpVector), data.push(tmpVector.x), data.push(tmpVector.y), data.push(tmpVector.z), this._platform.alignDataInBuffer && data.push(0), offset += 4), this._colorGradientsTexture || (data.push(0), data.push(0), data.push(0), data.push(0), offset += 4), this.isBillboardBased || (data.push(0), data.push(0), data.push(0), this._platform.alignDataInBuffer && data.push(0), offset += 4), this.noiseTexture && (data.push(Math.random()), data.push(Math.random()), data.push(Math.random()), this._platform.alignDataInBuffer && data.push(0), data.push(Math.random()), data.push(Math.random()), data.push(Math.random()), this._platform.alignDataInBuffer && data.push(0), offset += 8), data.push(0), offset += 1, this._angularSpeedGradientsTexture || (data.push(0), offset += 1), this._isAnimationSheetEnabled && (data.push(0), offset += 1, this.spriteRandomStartCell && (data.push(0), offset += 1)), this._platform.alignDataInBuffer) {let numDummies = 3 - (3 & offset + 3);for (offset += numDummies; 0 < numDummies--;) data.push(0);}const spriteData = new Float32Array([.5, .5, 1, 1, -.5, .5, 0, 1, .5, -.5, 1, 0, -.5, -.5, 0, 0]),bufferData1 = this._platform.createParticleBuffer(data),bufferData2 = this._platform.createParticleBuffer(data);this._buffer0 = new Buffers_buffer/* Buffer */.l(engine, bufferData1, !1, this._attributesStrideSize), this._buffer1 = new Buffers_buffer/* Buffer */.l(engine, bufferData2, !1, this._attributesStrideSize), this._spriteBuffer = new Buffers_buffer/* Buffer */.l(engine, spriteData, !1, 4), this._renderVertexBuffers = [], this._createVertexBuffers(this._buffer0, this._buffer1, this._spriteBuffer), this._createVertexBuffers(this._buffer1, this._buffer0, this._spriteBuffer), this._sourceBuffer = this._buffer0, this._targetBuffer = this._buffer1;}_recreateUpdateEffect() {let defines = this.particleEmitterType ? this.particleEmitterType.getEffectDefines() : "";return !(this._isBillboardBased && (defines += "\n#define BILLBOARD"), this._colorGradientsTexture && (defines += "\n#define COLORGRADIENTS"), this._sizeGradientsTexture && (defines += "\n#define SIZEGRADIENTS"), this._angularSpeedGradientsTexture && (defines += "\n#define ANGULARSPEEDGRADIENTS"), this._velocityGradientsTexture && (defines += "\n#define VELOCITYGRADIENTS"), this._limitVelocityGradientsTexture && (defines += "\n#define LIMITVELOCITYGRADIENTS"), this._dragGradientsTexture && (defines += "\n#define DRAGGRADIENTS"), this.isAnimationSheetEnabled && (defines += "\n#define ANIMATESHEET", this.spriteRandomStartCell && (defines += "\n#define ANIMATESHEETRANDOMSTART")), this.noiseTexture && (defines += "\n#define NOISE"), this.isLocal && (defines += "\n#define LOCAL"), !(this._platform.isUpdateBufferCreated() && this._cachedUpdateDefines === defines)) || (this._cachedUpdateDefines = defines, this._updateBuffer = this._platform.createUpdateBuffer(defines), this._platform.isUpdateBufferReady());}_getWrapper(blendMode) {const customWrapper = this._getCustomDrawWrapper(blendMode);if (null === customWrapper || void 0 === customWrapper ? void 0 : customWrapper.effect) return customWrapper;const defines = [];this.fillDefines(defines, blendMode);let drawWrapper = this._drawWrappers[blendMode];drawWrapper || (drawWrapper = new Materials_drawWrapper/* DrawWrapper */.q(this._engine), drawWrapper.drawContext && (drawWrapper.drawContext.useInstancing = !0), this._drawWrappers[blendMode] = drawWrapper);const join = defines.join("\n");if (drawWrapper.defines !== join) {const attributes = [],uniforms = [],samplers = [];this.fillUniformsAttributesAndSamplerNames(uniforms, attributes, samplers), drawWrapper.setEffect(this._engine.createEffect("gpuRenderParticles", attributes, uniforms, samplers, join), join);}return drawWrapper;}static _GetAttributeNamesOrOptions(hasColorGradients = !1, isAnimationSheetEnabled = !1, isBillboardBased = !1, isBillboardStretched = !1) {const attributeNamesOrOptions = [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, "age", "life", "size", "angle"];return hasColorGradients || attributeNamesOrOptions.push(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind), isAnimationSheetEnabled && attributeNamesOrOptions.push("cellIndex"), isBillboardBased || attributeNamesOrOptions.push("initialDirection"), isBillboardStretched || attributeNamesOrOptions.push("direction"), attributeNamesOrOptions.push("offset", Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), attributeNamesOrOptions;}static _GetEffectCreationOptions(isAnimationSheetEnabled = !1, useLogarithmicDepth = !1) {const effectCreationOption = ["emitterWM", "worldOffset", "view", "projection", "colorDead", "invView", "translationPivot", "eyePosition"];return (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(effectCreationOption), isAnimationSheetEnabled && effectCreationOption.push("sheetInfos"), useLogarithmicDepth && effectCreationOption.push("logarithmicDepthConstant"), effectCreationOption;}fillDefines(defines, blendMode = 0) {if (this._scene && (0,clipPlaneMaterialHelper/* prepareDefinesForClipPlanes */.AN)(this, this._scene, defines), blendMode === ParticleSystem.BLENDMODE_MULTIPLY && defines.push("#define BLENDMULTIPLYMODE"), this.isLocal && defines.push("#define LOCAL"), this.useLogarithmicDepth && defines.push("#define LOGARITHMICDEPTH"), this._isBillboardBased) switch (defines.push("#define BILLBOARD"), this.billboardMode) {case ParticleSystem.BILLBOARDMODE_Y:defines.push("#define BILLBOARDY");break;case ParticleSystem.BILLBOARDMODE_STRETCHED:defines.push("#define BILLBOARDSTRETCHED");break;case ParticleSystem.BILLBOARDMODE_ALL:defines.push("#define BILLBOARDMODE_ALL");break;default:}this._colorGradientsTexture && defines.push("#define COLORGRADIENTS"), this.isAnimationSheetEnabled && defines.push("#define ANIMATESHEET"), this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines), defines.push("" + this._imageProcessingConfigurationDefines.toString()));}fillUniformsAttributesAndSamplerNames(uniforms, attributes, samplers) {attributes.push(...GPUParticleSystem._GetAttributeNamesOrOptions(!!this._colorGradientsTexture, this._isAnimationSheetEnabled, this._isBillboardBased, this._isBillboardBased && this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED)), uniforms.push(...GPUParticleSystem._GetEffectCreationOptions(this._isAnimationSheetEnabled, this.useLogarithmicDepth)), samplers.push("diffuseSampler", "colorGradientSampler"), this._imageProcessingConfiguration && (Materials_imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareUniforms */.$.PrepareUniforms(uniforms, this._imageProcessingConfigurationDefines), Materials_imageProcessingConfiguration/* ImageProcessingConfiguration.PrepareSamplers */.$.PrepareSamplers(samplers, this._imageProcessingConfigurationDefines));}animate(preWarm = !1) {var _a;this._timeDelta = this.updateSpeed * (preWarm ? this.preWarmStepOffset : (null === (_a = this._scene) || void 0 === _a ? void 0 : _a.getAnimationRatio()) || 1), this._actualFrame += this._timeDelta, !this._stopped && this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop(), this.updateInAnimate && this._update();}_createFactorGradientTexture(factorGradients, textureName) {const texture = this[textureName];if (!factorGradients || !factorGradients.length || texture) return;const data = new Float32Array(this._rawTextureWidth);for (let x = 0; x < this._rawTextureWidth; x++) {const ratio = x / this._rawTextureWidth;GradientHelper.GetCurrentGradient(ratio, factorGradients, (currentGradient, nextGradient, scale) => {data[x] = math_scalar/* Scalar.Lerp */.R.Lerp(currentGradient.factor1, nextGradient.factor1, scale);});}this[textureName] = rawTexture/* RawTexture.CreateRTexture */.l.CreateRTexture(data, this._rawTextureWidth, 1, this._scene || this._engine, !1, !1, 1);}_createSizeGradientTexture() {this._createFactorGradientTexture(this._sizeGradients, "_sizeGradientsTexture");}_createAngularSpeedGradientTexture() {this._createFactorGradientTexture(this._angularSpeedGradients, "_angularSpeedGradientsTexture");}_createVelocityGradientTexture() {this._createFactorGradientTexture(this._velocityGradients, "_velocityGradientsTexture");}_createLimitVelocityGradientTexture() {this._createFactorGradientTexture(this._limitVelocityGradients, "_limitVelocityGradientsTexture");}_createDragGradientTexture() {this._createFactorGradientTexture(this._dragGradients, "_dragGradientsTexture");}_createColorGradientTexture() {if (!this._colorGradients || !this._colorGradients.length || this._colorGradientsTexture) return;const data = new Uint8Array(4 * this._rawTextureWidth),tmpColor = math_color/* TmpColors.Color4.0 */.zZ.Color4[0];for (let x = 0; x < this._rawTextureWidth; x++) {const ratio = x / this._rawTextureWidth;GradientHelper.GetCurrentGradient(ratio, this._colorGradients, (currentGradient, nextGradient, scale) => {math_color/* Color4.LerpToRef */.HE.LerpToRef(currentGradient.color1, nextGradient.color1, scale, tmpColor), data[4 * x] = 255 * tmpColor.r, data[4 * x + 1] = 255 * tmpColor.g, data[4 * x + 2] = 255 * tmpColor.b, data[4 * x + 3] = 255 * tmpColor.a;});}this._colorGradientsTexture = rawTexture/* RawTexture.CreateRGBATexture */.l.CreateRGBATexture(data, this._rawTextureWidth, 1, this._scene, !1, !1, 1);}_render(blendMode, emitterWM) {var _a, _b;const drawWrapper = this._getWrapper(blendMode),effect = drawWrapper.effect;this._engine.enableEffect(drawWrapper);const viewMatrix = (null === (_a = this._scene) || void 0 === _a ? void 0 : _a.getViewMatrix()) || math_vector/* Matrix.IdentityReadOnly */.y3.IdentityReadOnly;if (effect.setMatrix("view", viewMatrix), effect.setMatrix("projection", null !== (_b = this.defaultProjectionMatrix) && void 0 !== _b ? _b : this._scene.getProjectionMatrix()), effect.setTexture("diffuseSampler", this.particleTexture), effect.setVector2("translationPivot", this.translationPivot), effect.setVector3("worldOffset", this.worldOffset), this.isLocal && effect.setMatrix("emitterWM", emitterWM), this._colorGradientsTexture ? effect.setTexture("colorGradientSampler", this._colorGradientsTexture) : effect.setDirectColor4("colorDead", this.colorDead), this._isAnimationSheetEnabled && this.particleTexture) {const baseSize = this.particleTexture.getBaseSize();effect.setFloat3("sheetInfos", this.spriteCellWidth / baseSize.width, this.spriteCellHeight / baseSize.height, baseSize.width / this.spriteCellWidth);}if (this._isBillboardBased && this._scene) {const camera = this._scene.activeCamera;effect.setVector3("eyePosition", camera.globalPosition);}const defines = effect.defines;if (this._scene && (0,clipPlaneMaterialHelper/* bindClipPlane */.an)(effect, this, this._scene), 0 <= defines.indexOf("#define BILLBOARDMODE_ALL")) {const invView = viewMatrix.clone();invView.invert(), effect.setMatrix("invView", invView);}return this.useLogarithmicDepth && this._scene && materialHelper/* MaterialHelper.BindLogDepth */.G.BindLogDepth(defines, effect, this._scene), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(effect), blendMode === ParticleSystem.BLENDMODE_ADD ? this._engine.setAlphaMode(1) : blendMode === ParticleSystem.BLENDMODE_ONEONE ? this._engine.setAlphaMode(6) : blendMode === ParticleSystem.BLENDMODE_STANDARD ? this._engine.setAlphaMode(2) : blendMode === ParticleSystem.BLENDMODE_MULTIPLY ? this._engine.setAlphaMode(4) : void 0, (this._platform.bindDrawBuffers(this._targetIndex, effect), this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.notifyObservers(effect), this._engine.drawArraysType(7, 0, 4, this._currentActiveCount), this._engine.setAlphaMode(0), this._currentActiveCount);}_update(emitterWM) {if (this.emitter && this._recreateUpdateEffect()) {if (this.emitter.position) {const emitterMesh = this.emitter;emitterWM = emitterMesh.getWorldMatrix();} else {const emitterPosition = this.emitter;emitterWM = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0], math_vector/* Matrix.TranslationToRef */.y3.TranslationToRef(emitterPosition.x, emitterPosition.y, emitterPosition.z, emitterWM);}this._platform.preUpdateParticleBuffer(), this._updateBuffer.setFloat("currentCount", this._currentActiveCount), this._updateBuffer.setFloat("timeDelta", this._timeDelta), this._updateBuffer.setFloat("stopFactor", this._stopped ? 0 : 1), this._updateBuffer.setInt("randomTextureSize", this._randomTextureSize), this._updateBuffer.setFloat2("lifeTime", this.minLifeTime, this.maxLifeTime), this._updateBuffer.setFloat2("emitPower", this.minEmitPower, this.maxEmitPower), this._colorGradientsTexture || (this._updateBuffer.setDirectColor4("color1", this.color1), this._updateBuffer.setDirectColor4("color2", this.color2)), this._updateBuffer.setFloat2("sizeRange", this.minSize, this.maxSize), this._updateBuffer.setFloat4("scaleRange", this.minScaleX, this.maxScaleX, this.minScaleY, this.maxScaleY), this._updateBuffer.setFloat4("angleRange", this.minAngularSpeed, this.maxAngularSpeed, this.minInitialRotation, this.maxInitialRotation), this._updateBuffer.setVector3("gravity", this.gravity), this._limitVelocityGradientsTexture && this._updateBuffer.setFloat("limitVelocityDamping", this.limitVelocityDamping), this.particleEmitterType && this.particleEmitterType.applyToShader(this._updateBuffer), this._isAnimationSheetEnabled && this._updateBuffer.setFloat4("cellInfos", this.startSpriteCellID, this.endSpriteCellID, this.spriteCellChangeSpeed, this.spriteCellLoop ? 1 : 0), this.noiseTexture && this._updateBuffer.setVector3("noiseStrength", this.noiseStrength), this.isLocal || this._updateBuffer.setMatrix("emitterWM", emitterWM), this._platform.updateParticleBuffer(this._targetIndex, this._targetBuffer, this._currentActiveCount), this._targetIndex++, 2 === this._targetIndex && (this._targetIndex = 0);const tmpBuffer = this._sourceBuffer;this._sourceBuffer = this._targetBuffer, this._targetBuffer = tmpBuffer;}}render(preWarm = !1, forceUpdateOnly = !1) {if (!this._started) return 0;if (this._createColorGradientTexture(), this._createSizeGradientTexture(), this._createAngularSpeedGradientTexture(), this._createVelocityGradientTexture(), this._createLimitVelocityGradientTexture(), this._createDragGradientTexture(), !this.isReady()) return 0;if (!preWarm && this._scene) {if (!this._preWarmDone && this.preWarmCycles) {for (let index = 0; index < this.preWarmCycles; index++) this.animate(!0), this.render(!0, !0);this._preWarmDone = !0;}if (this._currentRenderId === this._scene.getFrameId() && (!this._scene.activeCamera || this._scene.activeCamera && this._currentRenderingCameraUniqueId === this._scene.activeCamera.uniqueId)) return 0;this._currentRenderId = this._scene.getFrameId(), this._scene.activeCamera && (this._currentRenderingCameraUniqueId = this._scene.activeCamera.uniqueId);}if (this._initialize(), this._accumulatedCount += this.emitRate * this._timeDelta, 1 < this._accumulatedCount) {const intPart = 0 | this._accumulatedCount;this._accumulatedCount -= intPart, this._currentActiveCount = Math.min(this._activeCount, this._currentActiveCount + intPart);}if (!this._currentActiveCount) return 0;let emitterWM;if (this.emitter.position) {const emitterMesh = this.emitter;emitterWM = emitterMesh.getWorldMatrix();} else {const emitterPosition = this.emitter;emitterWM = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0], math_vector/* Matrix.TranslationToRef */.y3.TranslationToRef(emitterPosition.x, emitterPosition.y, emitterPosition.z, emitterWM);}const engine = this._engine;this.updateInAnimate || this._update(emitterWM);let outparticles = 0;return preWarm || forceUpdateOnly || (engine.setState(!1), this.forceDepthWrite && engine.setDepthWrite(!0), outparticles = this.blendMode === ParticleSystem.BLENDMODE_MULTIPLYADD ? this._render(ParticleSystem.BLENDMODE_MULTIPLY, emitterWM) + this._render(ParticleSystem.BLENDMODE_ADD, emitterWM) : this._render(this.blendMode, emitterWM), this._engine.setAlphaMode(0)), outparticles;}rebuild() {this._initialize(!0);}_releaseBuffers() {this._buffer0 && (this._buffer0.dispose(), this._buffer0 = null), this._buffer1 && (this._buffer1.dispose(), this._buffer1 = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._platform.releaseBuffers();}dispose(disposeTexture = !0) {for (const blendMode in this._drawWrappers) {const drawWrapper = this._drawWrappers[blendMode];drawWrapper.dispose();}if (this._drawWrappers = {}, this._scene) {const index = this._scene.particleSystems.indexOf(this);-1 < index && this._scene.particleSystems.splice(index, 1);}this._releaseBuffers(), this._platform.releaseVertexBuffers();for (let i = 0; i < this._renderVertexBuffers.length; ++i) {const rvb = this._renderVertexBuffers[i];for (const key in rvb) rvb[key].dispose();}this._renderVertexBuffers = [], this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null), this._sizeGradientsTexture && (this._sizeGradientsTexture.dispose(), this._sizeGradientsTexture = null), this._angularSpeedGradientsTexture && (this._angularSpeedGradientsTexture.dispose(), this._angularSpeedGradientsTexture = null), this._velocityGradientsTexture && (this._velocityGradientsTexture.dispose(), this._velocityGradientsTexture = null), this._limitVelocityGradientsTexture && (this._limitVelocityGradientsTexture.dispose(), this._limitVelocityGradientsTexture = null), this._dragGradientsTexture && (this._dragGradientsTexture.dispose(), this._dragGradientsTexture = null), this._randomTexture && (this._randomTexture.dispose(), this._randomTexture = null), this._randomTexture2 && (this._randomTexture2.dispose(), this._randomTexture2 = null), disposeTexture && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), disposeTexture && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this.onStoppedObservable.clear(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();}clone(name, newEmitter, cloneTexture = !1) {const custom = { ...this._customWrappers };let program = null;const engine = this._engine;if (engine.createEffectForParticles && null != this.customShader) {program = this.customShader;const defines = 0 < program.shaderOptions.defines.length ? program.shaderOptions.defines.join("\n") : "";custom[0] = engine.createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines, void 0, void 0, void 0, this);}const serialization = this.serialize(cloneTexture),result = GPUParticleSystem.Parse(serialization, this._scene || this._engine, this._rootUrl);return result.name = name, result.customShader = program, result._customWrappers = custom, void 0 === newEmitter && (newEmitter = this.emitter), this.noiseTexture && (result.noiseTexture = this.noiseTexture.clone()), result.emitter = newEmitter, result;}serialize(serializeTexture = !1) {const serializationObject = {};return ParticleSystem._Serialize(serializationObject, this, serializeTexture), serializationObject.activeParticleCount = this.activeParticleCount, serializationObject.randomTextureSize = this._randomTextureSize, serializationObject.customShader = this.customShader, serializationObject;}static Parse(parsedParticleSystem, sceneOrEngine, rootUrl, doNotStart = !1, capacity) {const name = parsedParticleSystem.name;let engine, scene;sceneOrEngine instanceof thinEngine/* ThinEngine */.B ? engine = sceneOrEngine : (scene = sceneOrEngine, engine = scene.getEngine());const particleSystem = new GPUParticleSystem(name, { capacity: capacity || parsedParticleSystem.capacity, randomTextureSize: parsedParticleSystem.randomTextureSize }, sceneOrEngine, null, parsedParticleSystem.isAnimationSheetEnabled);if (particleSystem._rootUrl = rootUrl, parsedParticleSystem.customShader && engine.createEffectForParticles) {const program = parsedParticleSystem.customShader,defines = 0 < program.shaderOptions.defines.length ? program.shaderOptions.defines.join("\n") : "",custom = engine.createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines, void 0, void 0, void 0, particleSystem);particleSystem.setCustomEffect(custom, 0), particleSystem.customShader = program;}return parsedParticleSystem.id && (particleSystem.id = parsedParticleSystem.id), parsedParticleSystem.activeParticleCount && (particleSystem.activeParticleCount = parsedParticleSystem.activeParticleCount), ParticleSystem._Parse(parsedParticleSystem, particleSystem, sceneOrEngine, rootUrl), parsedParticleSystem.preventAutoStart && (particleSystem.preventAutoStart = parsedParticleSystem.preventAutoStart), doNotStart || particleSystem.preventAutoStart || particleSystem.start(), particleSystem;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/IParticleSystem.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/particleSystemSet.js
class ParticleSystemSetEmitterCreationOptions {}class ParticleSystemSet {constructor() {this._emitterNodeIsOwned = !0, this.systems = [];}get emitterNode() {return this._emitterNode;}set emitterNode(value) {this._emitterNodeIsOwned && this._emitterNode && (this._emitterNode.dispose && this._emitterNode.dispose(), this._emitterNodeIsOwned = !1);for (const system of this.systems) system.emitter = value;this._emitterNode = value;}setEmitterAsSphere(options, renderingGroupId, scene) {this._emitterNodeIsOwned && this._emitterNode && this._emitterNode.dispose && this._emitterNode.dispose(), this._emitterNodeIsOwned = !0, this._emitterCreationOptions = { kind: "Sphere", options: options, renderingGroupId: renderingGroupId };const emitterMesh = CreateSphere("emitterSphere", { diameter: options.diameter, segments: options.segments }, scene);emitterMesh.renderingGroupId = renderingGroupId;const material = new standardMaterial/* StandardMaterial */.K("emitterSphereMaterial", scene);material.emissiveColor = options.color, emitterMesh.material = material;for (const system of this.systems) system.emitter = emitterMesh;this._emitterNode = emitterMesh;}start(emitter) {for (const system of this.systems) emitter && (system.emitter = emitter), system.start();}dispose() {for (const system of this.systems) system.dispose();this.systems.length = 0, this._emitterNode && (this._emitterNode.dispose && this._emitterNode.dispose(), this._emitterNode = null);}serialize(serializeTexture = !1) {const result = { systems: [] };for (const system of this.systems) result.systems.push(system.serialize(serializeTexture));return this._emitterNode && (result.emitter = this._emitterCreationOptions), result;}static Parse(data, scene, gpu = !1, capacity) {const result = new ParticleSystemSet(),rootUrl = this.BaseAssetsUrl + "/textures/";scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;for (const system of data.systems) result.systems.push(gpu ? GPUParticleSystem.Parse(system, scene, rootUrl, !0, capacity) : ParticleSystem.Parse(system, scene, rootUrl, !0, capacity));if (data.emitter) {const options = data.emitter.options;switch (data.emitter.kind) {case "Sphere":result.setEmitterAsSphere({ diameter: options.diameter, segments: options.segments, color: math_color/* Color3.FromArray */.Wo.FromArray(options.color) }, data.emitter.renderingGroupId, scene);}}return result;}}ParticleSystemSet.BaseAssetsUrl = "https://assets.babylonjs.com/particles";
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/particleHelper.js
class ParticleHelper {static CreateDefault(emitter, capacity = 500, scene, useGPU = !1) {let system;return system = useGPU ? new GPUParticleSystem("default system", { capacity: capacity }, scene) : new ParticleSystem("default system", capacity, scene), system.emitter = emitter, system.particleTexture = new Textures_texture/* Texture */.x("https://assets.babylonjs.com/textures/flare.png", system.getScene()), system.createConeEmitter(.1, Math.PI / 4), system.color1 = new math_color/* Color4 */.HE(1, 1, 1, 1), system.color2 = new math_color/* Color4 */.HE(1, 1, 1, 1), system.colorDead = new math_color/* Color4 */.HE(1, 1, 1, 0), system.minSize = .1, system.maxSize = .1, system.minEmitPower = 2, system.maxEmitPower = 2, system.updateSpeed = 1 / 60, system.emitRate = 30, system;}static CreateAsync(type, scene, gpu = !1, capacity) {scene || (scene = engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene);const token = {};return scene.addPendingData(token), new Promise((resolve, reject) => gpu && !GPUParticleSystem.IsSupported ? (scene.removePendingData(token), reject("Particle system with GPU is not supported.")) : void tools/* Tools.LoadFile */.w1.LoadFile(`${ParticleHelper.BaseAssetsUrl}/systems/${type}.json`, (data) => {scene.removePendingData(token);const newData = JSON.parse(data.toString());return resolve(ParticleSystemSet.Parse(newData, scene, gpu, capacity));}, void 0, void 0, void 0, () => (scene.removePendingData(token), reject(`An error occurred with the creation of your particle system. Check if your type '${type}' exists.`))));}static ExportSet(systems) {const set = new ParticleSystemSet();for (const system of systems) set.systems.push(system);return set;}static ParseFromFileAsync(name, url, scene, gpu = !1, rootUrl = "", capacity) {return new Promise((resolve, reject) => {const request = new webRequest/* WebRequest */.g();request.addEventListener("readystatechange", () => {if (4 == request.readyState) if (200 == request.status) {const serializationObject = JSON.parse(request.responseText);let output;output = gpu ? GPUParticleSystem.Parse(serializationObject, scene, rootUrl, !1, capacity) : ParticleSystem.Parse(serializationObject, scene, rootUrl, !1, capacity), name && (output.name = name), resolve(output);} else reject("Unable to load the particle system");}), request.open("GET", url), request.send();});}static ParseFromSnippetAsync(snippetId, scene, gpu = !1, rootUrl = "", capacity) {if ("_BLANK" === snippetId) {const system = this.CreateDefault(null);return system.start(), Promise.resolve(system);}return new Promise((resolve, reject) => {const request = new webRequest/* WebRequest */.g();request.addEventListener("readystatechange", () => {if (4 == request.readyState) if (200 == request.status) {const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload),serializationObject = JSON.parse(snippet.particleSystem);let output;output = gpu ? GPUParticleSystem.Parse(serializationObject, scene, rootUrl, !1, capacity) : ParticleSystem.Parse(serializationObject, scene, rootUrl, !1, capacity), output.snippetId = snippetId, resolve(output);} else reject("Unable to load the snippet " + snippetId);}), request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/")), request.send();});}}ParticleHelper.BaseAssetsUrl = ParticleSystemSet.BaseAssetsUrl, ParticleHelper.SnippetUrl = `https://snippet.babylonjs.com`, ParticleHelper.CreateFromSnippetAsync = ParticleHelper.ParseFromSnippetAsync;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/particleSystemComponent.js
abstractScene/* AbstractScene.AddParser */.p.AddParser(sceneComponent/* SceneComponentConstants.NAME_PARTICLESYSTEM */.l.NAME_PARTICLESYSTEM, (parsedData, scene, container, rootUrl) => {const individualParser = abstractScene/* AbstractScene.GetIndividualParser */.p.GetIndividualParser(sceneComponent/* SceneComponentConstants.NAME_PARTICLESYSTEM */.l.NAME_PARTICLESYSTEM);if (individualParser && void 0 !== parsedData.particleSystems && null !== parsedData.particleSystems) for (let index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {const parsedParticleSystem = parsedData.particleSystems[index];container.particleSystems.push(individualParser(parsedParticleSystem, scene, rootUrl));}}), abstractScene/* AbstractScene.AddIndividualParser */.p.AddIndividualParser(sceneComponent/* SceneComponentConstants.NAME_PARTICLESYSTEM */.l.NAME_PARTICLESYSTEM, (parsedParticleSystem, scene, rootUrl) => {if (parsedParticleSystem.activeParticleCount) {const ps = GPUParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);return ps;} else {const ps = ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);return ps;}}), engine/* Engine.prototype.createEffectForParticles */.D.prototype.createEffectForParticles = function (fragmentName, uniformsNames = [], samplers = [], defines = "", fallbacks, onCompiled, onError, particleSystem) {var _a;let attributesNamesOrOptions = [],effectCreationOption = [];const allSamplers = [];return particleSystem ? particleSystem.fillUniformsAttributesAndSamplerNames(effectCreationOption, attributesNamesOrOptions, allSamplers) : (attributesNamesOrOptions = ParticleSystem._GetAttributeNamesOrOptions(), effectCreationOption = ParticleSystem._GetEffectCreationOptions()), -1 === defines.indexOf(" BILLBOARD") && (defines += "\n#define BILLBOARD\n"), (null === particleSystem || void 0 === particleSystem ? void 0 : particleSystem.isAnimationSheetEnabled) && -1 === defines.indexOf(" ANIMATESHEET") && (defines += "\n#define ANIMATESHEET\n"), -1 === samplers.indexOf("diffuseSampler") && samplers.push("diffuseSampler"), this.createEffect({ vertex: null !== (_a = null === particleSystem || void 0 === particleSystem ? void 0 : particleSystem.vertexShaderName) && void 0 !== _a ? _a : "particles", fragmentElement: fragmentName }, attributesNamesOrOptions, effectCreationOption.concat(uniformsNames), allSamplers.concat(samplers), defines, fallbacks, onCompiled, onError);}, Meshes_mesh/* Mesh.prototype.getEmittedParticleSystems */.Kj.prototype.getEmittedParticleSystems = function () {const results = [];for (let index = 0; index < this.getScene().particleSystems.length; index++) {const particleSystem = this.getScene().particleSystems[index];particleSystem.emitter === this && results.push(particleSystem);}return results;}, Meshes_mesh/* Mesh.prototype.getHierarchyEmittedParticleSystems */.Kj.prototype.getHierarchyEmittedParticleSystems = function () {const results = [],descendants = this.getDescendants();descendants.push(this);for (let index = 0; index < this.getScene().particleSystems.length; index++) {const particleSystem = this.getScene().particleSystems[index],emitter = particleSystem.emitter;emitter.position && -1 !== descendants.indexOf(emitter) && results.push(particleSystem);}return results;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/solidParticle.js
class SolidParticle {getBoundingInfo() {return this._boundingInfo;}get hasBoundingInfo() {return null !== this._boundingInfo;}constructor(particleIndex, particleId, positionIndex, indiceIndex, model, shapeId, idxInShape, sps, modelBoundingInfo = null, materialIndex = null) {this.idx = 0, this.id = 0, this.color = new math_color/* Color4 */.HE(1, 1, 1, 1), this.position = math_vector/* Vector3.Zero */.P.Zero(), this.rotation = math_vector/* Vector3.Zero */.P.Zero(), this.scaling = math_vector/* Vector3.One */.P.One(), this.uvs = new math_vector/* Vector4 */.Lt(0, 0, 1, 1), this.velocity = math_vector/* Vector3.Zero */.P.Zero(), this.pivot = math_vector/* Vector3.Zero */.P.Zero(), this.translateFromPivot = !1, this.alive = !0, this.isVisible = !0, this._pos = 0, this._ind = 0, this.shapeId = 0, this.idxInShape = 0, this._stillInvisible = !1, this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1], this.parentId = null, this.materialIndex = null, this.props = null, this.cullingStrategy = abstractMesh/* AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY */.x.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, this._globalPosition = math_vector/* Vector3.Zero */.P.Zero(), this.idx = particleIndex, this.id = particleId, this._pos = positionIndex, this._ind = indiceIndex, this._model = model, this.shapeId = shapeId, this.idxInShape = idxInShape, this._sps = sps, modelBoundingInfo && (this._modelBoundingInfo = modelBoundingInfo, this._boundingInfo = new boundingInfo/* BoundingInfo */.j(modelBoundingInfo.minimum, modelBoundingInfo.maximum)), null !== materialIndex && (this.materialIndex = materialIndex);}copyToRef(target) {return target.position.copyFrom(this.position), target.rotation.copyFrom(this.rotation), this.rotationQuaternion && (target.rotationQuaternion ? target.rotationQuaternion.copyFrom(this.rotationQuaternion) : target.rotationQuaternion = this.rotationQuaternion.clone()), target.scaling.copyFrom(this.scaling), this.color && (target.color ? target.color.copyFrom(this.color) : target.color = this.color.clone()), target.uvs.copyFrom(this.uvs), target.velocity.copyFrom(this.velocity), target.pivot.copyFrom(this.pivot), target.translateFromPivot = this.translateFromPivot, target.alive = this.alive, target.isVisible = this.isVisible, target.parentId = this.parentId, target.cullingStrategy = this.cullingStrategy, null !== this.materialIndex && (target.materialIndex = this.materialIndex), this;}get scale() {return this.scaling;}set scale(scale) {this.scaling = scale;}get quaternion() {return this.rotationQuaternion;}set quaternion(q) {this.rotationQuaternion = q;}intersectsMesh(target) {return !!(this._boundingInfo && target.hasBoundingInfo) && (this._sps._bSphereOnly ? boundingSphere/* BoundingSphere.Intersects */.K.Intersects(this._boundingInfo.boundingSphere, target.getBoundingInfo().boundingSphere) : this._boundingInfo.intersects(target.getBoundingInfo(), !1));}isInFrustum(frustumPlanes) {return null !== this._boundingInfo && this._boundingInfo.isInFrustum(frustumPlanes, this.cullingStrategy);}getRotationMatrix(m) {let quaternion;if (this.rotationQuaternion) quaternion = this.rotationQuaternion;else {quaternion = math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0];const rotation = this.rotation;math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);}quaternion.toRotationMatrix(m);}}class ModelShape {get shapeID() {return this.shapeId;}set shapeID(shapeID) {this.shapeId = shapeID;}constructor(id, shape, indices, normals, colors, shapeUV, posFunction, vtxFunction, material) {this._indicesLength = 0, this.shapeId = id, this._shape = shape, this._indices = indices, this._indicesLength = indices.length, this._shapeUV = shapeUV, this._shapeColors = colors, this._normals = normals, this._positionFunction = posFunction, this._vertexFunction = vtxFunction, this._material = material;}}class DepthSortedParticle {constructor(idx, ind, indLength, materialIndex) {this.idx = 0, this.ind = 0, this.indicesLength = 0, this.sqDistance = 0, this.materialIndex = 0, this.idx = idx, this.ind = ind, this.indicesLength = indLength, this.materialIndex = materialIndex;}}class SolidParticleVertex {constructor() {this.position = math_vector/* Vector3.Zero */.P.Zero(), this.color = new math_color/* Color4 */.HE(1, 1, 1, 1), this.uv = math_vector/* Vector2.Zero */.FM.Zero();}get x() {return this.position.x;}set x(val) {this.position.x = val;}get y() {return this.position.y;}set y(val) {this.position.y = val;}get z() {return this.position.z;}set z(val) {this.position.z = val;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/solidParticleSystem.js
class SolidParticleSystem {constructor(name, scene, options) {this.particles = [], this.nbParticles = 0, this.billboard = !1, this.recomputeNormals = !1, this.counter = 0, this.vars = {}, this._bSphereOnly = !1, this._bSphereRadiusFactor = 1, this._positions = [], this._indices = [], this._normals = [], this._colors = [], this._uvs = [], this._index = 0, this._updatable = !0, this._pickable = !1, this._isVisibilityBoxLocked = !1, this._alwaysVisible = !1, this._depthSort = !1, this._expandable = !1, this._shapeCounter = 0, this._copy = new SolidParticle(0, 0, 0, 0, null, 0, 0, this), this._color = new math_color/* Color4 */.HE(0, 0, 0, 0), this._computeParticleColor = !0, this._computeParticleTexture = !0, this._computeParticleRotation = !0, this._computeParticleVertex = !1, this._computeBoundingBox = !1, this._autoFixFaceOrientation = !1, this._depthSortParticles = !0, this._mustUnrotateFixedNormals = !1, this._particlesIntersect = !1, this._needs32Bits = !1, this._isNotBuilt = !0, this._lastParticleId = 0, this._idxOfId = [], this._multimaterialEnabled = !1, this._useModelMaterial = !1, this._depthSortFunction = (p1, p2) => p2.sqDistance - p1.sqDistance, this._materialSortFunction = (p1, p2) => p1.materialIndex - p2.materialIndex, this._autoUpdateSubMeshes = !1, this._recomputeInvisibles = !1, this.name = name, this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, this._camera = scene.activeCamera, this._pickable = !!options && options.isPickable, this._depthSort = !!options && options.enableDepthSort, this._multimaterialEnabled = !!options && options.enableMultiMaterial, this._useModelMaterial = !!options && options.useModelMaterial, this._multimaterialEnabled = !!this._useModelMaterial || this._multimaterialEnabled, this._expandable = !!options && options.expandable, this._particlesIntersect = !!options && options.particleIntersection, this._bSphereOnly = !!options && options.boundingSphereOnly, this._bSphereRadiusFactor = options && options.bSphereRadiusFactor ? options.bSphereRadiusFactor : 1, this._computeBoundingBox = !(!(null !== options && void 0 !== options) || !options.computeBoundingBox) && options.computeBoundingBox, this._autoFixFaceOrientation = !(!(null !== options && void 0 !== options) || !options.autoFixFaceOrientation) && options.autoFixFaceOrientation, this._updatable = !(options && void 0 !== options.updatable) || options.updatable, this._pickable && (this.pickedBySubMesh = [[]], this.pickedParticles = this.pickedBySubMesh[0]), (this._depthSort || this._multimaterialEnabled) && (this.depthSortedParticles = []), this._multimaterialEnabled && (this._multimaterial = new multiMaterial/* MultiMaterial */.G(this.name + "MultiMaterial", this._scene), this._materials = [], this._materialIndexesById = {}), this._tmpVertex = new SolidParticleVertex();}buildMesh() {if (!this._isNotBuilt && this.mesh) return this.mesh;if (0 === this.nbParticles && !this.mesh) {const triangle = CreateDisc("", { radius: 1, tessellation: 3 }, this._scene);this.addShape(triangle, 1), triangle.dispose();}if (this._indices32 = this._needs32Bits ? new Uint32Array(this._indices) : new Uint16Array(this._indices), this._positions32 = new Float32Array(this._positions), this._uvs32 = new Float32Array(this._uvs), this._colors32 = new Float32Array(this._colors), !this.mesh) {const mesh = new Meshes_mesh/* Mesh */.Kj(this.name, this._scene);this.mesh = mesh;}!this._updatable && this._multimaterialEnabled && this._sortParticlesByMaterial(), this.recomputeNormals && mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(this._positions32, this._indices32, this._normals), this._normals32 = new Float32Array(this._normals), this._fixedNormal32 = new Float32Array(this._normals), this._mustUnrotateFixedNormals && this._unrotateFixedNormals();const vertexData = new mesh_vertexData/* VertexData */.x();if (vertexData.indices = this._depthSort ? this._indices : this._indices32, vertexData.set(this._positions32, Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind), vertexData.set(this._normals32, Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind), 0 < this._uvs32.length && vertexData.set(this._uvs32, Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), 0 < this._colors32.length && vertexData.set(this._colors32, Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind), vertexData.applyToMesh(this.mesh, this._updatable), this.mesh.isPickable = this._pickable, this._pickable) {let faceId = 0;for (let p = 0; p < this.nbParticles; p++) {const part = this.particles[p],lind = part._model._indicesLength;for (let i = 0; i < lind; i++) {const f = i % 3;if (0 == f) {const pickedData = { idx: part.idx, faceId: faceId };this.pickedParticles[faceId] = pickedData, faceId++;}}}}return this._multimaterialEnabled && this.setMultiMaterial(this._materials), this._expandable || (!this._depthSort && !this._multimaterialEnabled && !this._autoFixFaceOrientation && (this._indices = null), this._positions = null, this._normals = null, this._uvs = null, this._colors = null, !this._updatable && (this.particles.length = 0)), this._isNotBuilt = !1, this.recomputeNormals = !1, this._recomputeInvisibles = !0, this.mesh;}digest(mesh, options) {let size = options && options.facetNb || 1,number = options && options.number || 0,delta = options && options.delta || 0;const meshPos = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),meshInd = mesh.getIndices(),meshUV = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind),meshCol = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind),meshNor = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind),storage = options && options.storage ? options.storage : null;let f = 0;const totalFacets = meshInd.length / 3;number ? (number = number > totalFacets ? totalFacets : number, size = Math.round(totalFacets / number), delta = 0) : size = size > totalFacets ? totalFacets : size;const facetPos = [],facetNor = [],facetInd = [],facetUV = [],facetCol = [],barycenter = math_vector/* Vector3.Zero */.P.Zero(),sizeO = size;for (; f < totalFacets;) {size = sizeO + Math.floor((1 + delta) * Math.random()), f > totalFacets - size && (size = totalFacets - f), facetPos.length = 0, facetNor.length = 0, facetInd.length = 0, facetUV.length = 0, facetCol.length = 0;let fi = 0;for (let j = 3 * f; j < 3 * (f + size); j++) {facetInd.push(fi);const i = meshInd[j],i3 = 3 * i;if (facetPos.push(meshPos[i3], meshPos[i3 + 1], meshPos[i3 + 2]), facetNor.push(meshNor[i3], meshNor[i3 + 1], meshNor[i3 + 2]), meshUV) {const i2 = 2 * i;facetUV.push(meshUV[i2], meshUV[i2 + 1]);}if (meshCol) {const i4 = 4 * i;facetCol.push(meshCol[i4], meshCol[i4 + 1], meshCol[i4 + 2], meshCol[i4 + 3]);}fi++;}let idx = this.nbParticles;const shape = this._posToShape(facetPos),shapeUV = this._uvsToShapeUV(facetUV),shapeInd = facetInd.slice(),shapeCol = facetCol.slice(),shapeNor = facetNor.slice();barycenter.copyFromFloats(0, 0, 0);let v;for (v = 0; v < shape.length; v++) barycenter.addInPlace(shape[v]);barycenter.scaleInPlace(1 / shape.length);const minimum = new math_vector/* Vector3 */.P(1 / 0, 1 / 0, 1 / 0),maximum = new math_vector/* Vector3 */.P(-Infinity, -Infinity, -Infinity);for (v = 0; v < shape.length; v++) shape[v].subtractInPlace(barycenter), minimum.minimizeInPlaceFromFloats(shape[v].x, shape[v].y, shape[v].z), maximum.maximizeInPlaceFromFloats(shape[v].x, shape[v].y, shape[v].z);let bInfo;this._particlesIntersect && (bInfo = new boundingInfo/* BoundingInfo */.j(minimum, maximum));let material = null;this._useModelMaterial && (material = mesh.material ? mesh.material : this._setDefaultMaterial());const modelShape = new ModelShape(this._shapeCounter, shape, shapeInd, shapeNor, shapeCol, shapeUV, null, null, material),currentPos = this._positions.length,currentInd = this._indices.length;this._meshBuilder(this._index, currentInd, shape, this._positions, shapeInd, this._indices, facetUV, this._uvs, shapeCol, this._colors, shapeNor, this._normals, idx, 0, null, modelShape), this._addParticle(idx, this._lastParticleId, currentPos, currentInd, modelShape, this._shapeCounter, 0, bInfo, storage), this.particles[this.nbParticles].position.addInPlace(barycenter), storage || (this._index += shape.length, idx++, this.nbParticles++, this._lastParticleId++), this._shapeCounter++, f += size;}return this._isNotBuilt = !0, this;}_unrotateFixedNormals() {let index = 0,idx = 0;const tmpNormal = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],quaternion = math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0],invertedRotMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];for (let p = 0; p < this.particles.length; p++) {const particle = this.particles[p],shape = particle._model._shape;if (particle.rotationQuaternion) particle.rotationQuaternion.conjugateToRef(quaternion);else {const rotation = particle.rotation;math_vector/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion), quaternion.conjugateInPlace();}quaternion.toRotationMatrix(invertedRotMatrix);for (let pt = 0; pt < shape.length; pt++) idx = index + 3 * pt, math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(this._normals32[idx], this._normals32[idx + 1], this._normals32[idx + 2], invertedRotMatrix, tmpNormal), tmpNormal.toArray(this._fixedNormal32, idx);index = idx + 3;}}_resetCopy() {const copy = this._copy;copy.position.setAll(0), copy.rotation.setAll(0), copy.rotationQuaternion = null, copy.scaling.setAll(1), copy.uvs.copyFromFloats(0, 0, 1, 1), copy.color = null, copy.translateFromPivot = !1, copy.shapeId = 0, copy.materialIndex = null;}_meshBuilder(p, ind, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, meshNor, normals, idx, idxInShape, options, model) {let i,u = 0,c = 0,n = 0;this._resetCopy();const copy = this._copy,storeApart = !!(options && options.storage);if (copy.idx = idx, copy.idxInShape = idxInShape, copy.shapeId = model.shapeId, this._useModelMaterial) {const materialId = model._material.uniqueId,materialIndexesById = this._materialIndexesById;Object.prototype.hasOwnProperty.call(materialIndexesById, materialId) || (materialIndexesById[materialId] = this._materials.length, this._materials.push(model._material));const matIdx = materialIndexesById[materialId];copy.materialIndex = matIdx;}if (options && options.positionFunction && (options.positionFunction(copy, idx, idxInShape), this._mustUnrotateFixedNormals = !0), storeApart) return copy;const rotMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],tmpVertex = this._tmpVertex,tmpVector = tmpVertex.position,tmpColor = tmpVertex.color,tmpUV = tmpVertex.uv,tmpRotated = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1],pivotBackTranslation = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],scaledPivot = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3];math_vector/* Matrix.IdentityToRef */.y3.IdentityToRef(rotMatrix), copy.getRotationMatrix(rotMatrix), copy.pivot.multiplyToRef(copy.scaling, scaledPivot), copy.translateFromPivot ? pivotBackTranslation.setAll(0) : pivotBackTranslation.copyFrom(scaledPivot);const someVertexFunction = options && options.vertexFunction;for (i = 0; i < shape.length; i++) {if (tmpVector.copyFrom(shape[i]), copy.color && tmpColor.copyFrom(copy.color), meshUV && tmpUV.copyFromFloats(meshUV[u], meshUV[u + 1]), someVertexFunction && options.vertexFunction(copy, tmpVertex, i), tmpVector.multiplyInPlace(copy.scaling).subtractInPlace(scaledPivot), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(tmpVector, rotMatrix, tmpRotated), tmpRotated.addInPlace(pivotBackTranslation).addInPlace(copy.position), positions.push(tmpRotated.x, tmpRotated.y, tmpRotated.z), meshUV) {const copyUvs = copy.uvs;uvs.push((copyUvs.z - copyUvs.x) * tmpUV.x + copyUvs.x, (copyUvs.w - copyUvs.y) * tmpUV.y + copyUvs.y), u += 2;}if (copy.color) this._color.copyFrom(tmpColor);else {const color = this._color;meshCol && void 0 !== meshCol[c] ? (color.r = meshCol[c], color.g = meshCol[c + 1], color.b = meshCol[c + 2], color.a = meshCol[c + 3]) : (color.r = 1, color.g = 1, color.b = 1, color.a = 1);}colors.push(this._color.r, this._color.g, this._color.b, this._color.a), c += 4, !this.recomputeNormals && meshNor && (math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(meshNor[n], meshNor[n + 1], meshNor[n + 2], rotMatrix, tmpVector), normals.push(tmpVector.x, tmpVector.y, tmpVector.z), n += 3);}for (i = 0; i < meshInd.length; i++) {const current_ind = p + meshInd[i];indices.push(current_ind), 65535 < current_ind && (this._needs32Bits = !0);}if (this._depthSort || this._multimaterialEnabled) {const matIndex = null === copy.materialIndex ? 0 : copy.materialIndex;this.depthSortedParticles.push(new DepthSortedParticle(idx, ind, meshInd.length, matIndex));}return copy;}_posToShape(positions) {const shape = [];for (let i = 0; i < positions.length; i += 3) shape.push(math_vector/* Vector3.FromArray */.P.FromArray(positions, i));return shape;}_uvsToShapeUV(uvs) {const shapeUV = [];if (uvs) for (let i = 0; i < uvs.length; i++) shapeUV.push(uvs[i]);return shapeUV;}_addParticle(idx, id, idxpos, idxind, model, shapeId, idxInShape, bInfo = null, storage = null) {const sp = new SolidParticle(idx, id, idxpos, idxind, model, shapeId, idxInShape, this, bInfo),target = storage ? storage : this.particles;return target.push(sp), sp;}addShape(mesh, nb, options) {const meshPos = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),meshInd = mesh.getIndices(),meshUV = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind),meshCol = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind),meshNor = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind);this.recomputeNormals = !meshNor;const indices = Array.from(meshInd),shapeNormals = Array.from(meshNor),shapeColors = meshCol ? Array.from(meshCol) : [],storage = options && options.storage ? options.storage : null;let bbInfo = null;this._particlesIntersect && (bbInfo = mesh.getBoundingInfo());const shape = this._posToShape(meshPos),shapeUV = this._uvsToShapeUV(meshUV),posfunc = options ? options.positionFunction : null,vtxfunc = options ? options.vertexFunction : null;let material = null;this._useModelMaterial && (material = mesh.material ? mesh.material : this._setDefaultMaterial());const modelShape = new ModelShape(this._shapeCounter, shape, indices, shapeNormals, shapeColors, shapeUV, posfunc, vtxfunc, material);for (let i = 0; i < nb; i++) this._insertNewParticle(this.nbParticles, i, modelShape, shape, meshInd, meshUV, meshCol, meshNor, bbInfo, storage, options);return this._shapeCounter++, this._isNotBuilt = !0, this._shapeCounter - 1;}_rebuildParticle(particle, reset = !1) {this._resetCopy();const copy = this._copy;particle._model._positionFunction && particle._model._positionFunction(copy, particle.idx, particle.idxInShape);const rotMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],tmpVertex = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],tmpRotated = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1],pivotBackTranslation = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2],scaledPivot = math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3];copy.getRotationMatrix(rotMatrix), particle.pivot.multiplyToRef(particle.scaling, scaledPivot), copy.translateFromPivot ? pivotBackTranslation.copyFromFloats(0, 0, 0) : pivotBackTranslation.copyFrom(scaledPivot);const shape = particle._model._shape;for (let pt = 0; pt < shape.length; pt++) tmpVertex.copyFrom(shape[pt]), particle._model._vertexFunction && particle._model._vertexFunction(copy, tmpVertex, pt), tmpVertex.multiplyInPlace(copy.scaling).subtractInPlace(scaledPivot), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(tmpVertex, rotMatrix, tmpRotated), tmpRotated.addInPlace(pivotBackTranslation).addInPlace(copy.position).toArray(this._positions32, particle._pos + 3 * pt);reset && (particle.position.setAll(0), particle.rotation.setAll(0), particle.rotationQuaternion = null, particle.scaling.setAll(1), particle.uvs.setAll(0), particle.pivot.setAll(0), particle.translateFromPivot = !1, particle.parentId = null);}rebuildMesh(reset = !1) {for (let p = 0; p < this.particles.length; p++) this._rebuildParticle(this.particles[p], reset);return this.mesh.updateVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, this._positions32, !1, !1), this;}removeParticles(start, end) {const nb = end - start + 1;if (!this._expandable || 0 >= nb || nb >= this.nbParticles || !this._updatable) return [];const particles = this.particles,currentNb = this.nbParticles;if (end < currentNb - 1) {const firstRemaining = end + 1,shiftPos = particles[firstRemaining]._pos - particles[start]._pos,shifInd = particles[firstRemaining]._ind - particles[start]._ind;for (let i = firstRemaining; i < currentNb; i++) {const part = particles[i];part._pos -= shiftPos, part._ind -= shifInd;}}const removed = particles.splice(start, nb);this._positions.length = 0, this._indices.length = 0, this._colors.length = 0, this._uvs.length = 0, this._normals.length = 0, this._index = 0, this._idxOfId.length = 0, (this._depthSort || this._multimaterialEnabled) && (this.depthSortedParticles = []);let ind = 0;const particlesLength = particles.length;for (let p = 0; p < particlesLength; p++) {const particle = particles[p],model = particle._model,shape = model._shape,modelIndices = model._indices,modelNormals = model._normals,modelColors = model._shapeColors,modelUVs = model._shapeUV;particle.idx = p, this._idxOfId[particle.id] = p, this._meshBuilder(this._index, ind, shape, this._positions, modelIndices, this._indices, modelUVs, this._uvs, modelColors, this._colors, modelNormals, this._normals, particle.idx, particle.idxInShape, null, model), this._index += shape.length, ind += modelIndices.length;}return this.nbParticles -= nb, this._isNotBuilt = !0, removed;}insertParticlesFromArray(solidParticleArray) {if (!this._expandable) return this;let idxInShape = 0,currentShapeId = solidParticleArray[0].shapeId;const nb = solidParticleArray.length;for (let i = 0; i < nb; i++) {const sp = solidParticleArray[i],model = sp._model,shape = model._shape,meshInd = model._indices,meshUV = model._shapeUV,meshCol = model._shapeColors,meshNor = model._normals;this.recomputeNormals = !meshNor || this.recomputeNormals;const bbInfo = sp.getBoundingInfo(),newPart = this._insertNewParticle(this.nbParticles, idxInShape, model, shape, meshInd, meshUV, meshCol, meshNor, bbInfo, null, null);sp.copyToRef(newPart), idxInShape++, currentShapeId != sp.shapeId && (currentShapeId = sp.shapeId, idxInShape = 0);}return this._isNotBuilt = !0, this;}_insertNewParticle(idx, i, modelShape, shape, meshInd, meshUV, meshCol, meshNor, bbInfo, storage, options) {const currentPos = this._positions.length,currentInd = this._indices.length,currentCopy = this._meshBuilder(this._index, currentInd, shape, this._positions, meshInd, this._indices, meshUV, this._uvs, meshCol, this._colors, meshNor, this._normals, idx, i, options, modelShape);let sp = null;return this._updatable && (sp = this._addParticle(this.nbParticles, this._lastParticleId, currentPos, currentInd, modelShape, this._shapeCounter, i, bbInfo, storage), sp.position.copyFrom(currentCopy.position), sp.rotation.copyFrom(currentCopy.rotation), currentCopy.rotationQuaternion && (sp.rotationQuaternion ? sp.rotationQuaternion.copyFrom(currentCopy.rotationQuaternion) : sp.rotationQuaternion = currentCopy.rotationQuaternion.clone()), currentCopy.color && (sp.color ? sp.color.copyFrom(currentCopy.color) : sp.color = currentCopy.color.clone()), sp.scaling.copyFrom(currentCopy.scaling), sp.uvs.copyFrom(currentCopy.uvs), null !== currentCopy.materialIndex && (sp.materialIndex = currentCopy.materialIndex), this.expandable && (this._idxOfId[sp.id] = sp.idx)), storage || (this._index += shape.length, this.nbParticles++, this._lastParticleId++), sp;}setParticles(start = 0, end = this.nbParticles - 1, update = !0) {if (!this._updatable || this._isNotBuilt) return this;this.beforeUpdateParticles(start, end, update);const rotMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],invertedMatrix = math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1],mesh = this.mesh,colors32 = this._colors32,positions32 = this._positions32,normals32 = this._normals32,uvs32 = this._uvs32,indices32 = this._indices32,indices = this._indices,fixedNormal32 = this._fixedNormal32,depthSortParticles = this._depthSort && this._depthSortParticles,tempVectors = math_vector/* TmpVectors.Vector3 */.jp.Vector3,camAxisX = tempVectors[5].copyFromFloats(1, 0, 0),camAxisY = tempVectors[6].copyFromFloats(0, 1, 0),camAxisZ = tempVectors[7].copyFromFloats(0, 0, 1),minimum = tempVectors[8].setAll(Number.MAX_VALUE),maximum = tempVectors[9].setAll(-Number.MAX_VALUE),camInvertedPosition = tempVectors[10].setAll(0),tmpVertex = this._tmpVertex,tmpVector = tmpVertex.position,tmpColor = tmpVertex.color,tmpUV = tmpVertex.uv;if ((this.billboard || this._depthSort) && (this.mesh.computeWorldMatrix(!0), this.mesh._worldMatrix.invertToRef(invertedMatrix)), this.billboard) {const tmpVector0 = tempVectors[0];this._camera.getDirectionToRef(math_axis/* Axis.Z */.RD.Z, tmpVector0), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(tmpVector0, invertedMatrix, camAxisZ), camAxisZ.normalize();const view = this._camera.getViewMatrix(!0);math_vector/* Vector3.TransformNormalFromFloatsToRef */.P.TransformNormalFromFloatsToRef(view.m[1], view.m[5], view.m[9], invertedMatrix, camAxisY), math_vector/* Vector3.CrossToRef */.P.CrossToRef(camAxisY, camAxisZ, camAxisX), camAxisY.normalize(), camAxisX.normalize();}this._depthSort && math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._camera.globalPosition, invertedMatrix, camInvertedPosition), math_vector/* Matrix.IdentityToRef */.y3.IdentityToRef(rotMatrix);let idx = 0,index = 0,colidx = 0,colorIndex = 0,uvidx = 0,uvIndex = 0,pt = 0;if (this.mesh.isFacetDataEnabled && (this._computeBoundingBox = !0), end = end >= this.nbParticles ? this.nbParticles - 1 : end, this._computeBoundingBox && (0 != start || end != this.nbParticles - 1)) {const boundingInfo = this.mesh.getBoundingInfo();boundingInfo && (minimum.copyFrom(boundingInfo.minimum), maximum.copyFrom(boundingInfo.maximum));}index = this.particles[start]._pos;const vpos = 0 | index / 3;colorIndex = 4 * vpos, uvIndex = 2 * vpos;for (let p = start; p <= end; p++) {const particle = this.particles[p];this.updateParticle(particle);const shape = particle._model._shape,shapeUV = particle._model._shapeUV,particleRotationMatrix = particle._rotationMatrix,particlePosition = particle.position,particleRotation = particle.rotation,particleScaling = particle.scaling,particleGlobalPosition = particle._globalPosition;if (depthSortParticles) {const dsp = this.depthSortedParticles[p];dsp.idx = particle.idx, dsp.ind = particle._ind, dsp.indicesLength = particle._model._indicesLength, dsp.sqDistance = math_vector/* Vector3.DistanceSquared */.P.DistanceSquared(particle.position, camInvertedPosition);}if (!particle.alive || particle._stillInvisible && !particle.isVisible && !this._recomputeInvisibles) {pt = shape.length, index += 3 * pt, colorIndex += 4 * pt, uvIndex += 2 * pt;continue;}if (particle.isVisible) {particle._stillInvisible = !1;const scaledPivot = tempVectors[12];particle.pivot.multiplyToRef(particleScaling, scaledPivot), this.billboard && (particleRotation.x = 0, particleRotation.y = 0), (this._computeParticleRotation || this.billboard) && particle.getRotationMatrix(rotMatrix);const particleHasParent = null !== particle.parentId;if (particleHasParent) {const parent = this.getParticleById(particle.parentId);if (parent) {const parentRotationMatrix = parent._rotationMatrix,parentGlobalPosition = parent._globalPosition,rotatedY = particlePosition.x * parentRotationMatrix[1] + particlePosition.y * parentRotationMatrix[4] + particlePosition.z * parentRotationMatrix[7],rotatedX = particlePosition.x * parentRotationMatrix[0] + particlePosition.y * parentRotationMatrix[3] + particlePosition.z * parentRotationMatrix[6],rotatedZ = particlePosition.x * parentRotationMatrix[2] + particlePosition.y * parentRotationMatrix[5] + particlePosition.z * parentRotationMatrix[8];if (particleGlobalPosition.x = parentGlobalPosition.x + rotatedX, particleGlobalPosition.y = parentGlobalPosition.y + rotatedY, particleGlobalPosition.z = parentGlobalPosition.z + rotatedZ, this._computeParticleRotation || this.billboard) {const rotMatrixValues = rotMatrix.m;particleRotationMatrix[0] = rotMatrixValues[0] * parentRotationMatrix[0] + rotMatrixValues[1] * parentRotationMatrix[3] + rotMatrixValues[2] * parentRotationMatrix[6], particleRotationMatrix[1] = rotMatrixValues[0] * parentRotationMatrix[1] + rotMatrixValues[1] * parentRotationMatrix[4] + rotMatrixValues[2] * parentRotationMatrix[7], particleRotationMatrix[2] = rotMatrixValues[0] * parentRotationMatrix[2] + rotMatrixValues[1] * parentRotationMatrix[5] + rotMatrixValues[2] * parentRotationMatrix[8], particleRotationMatrix[3] = rotMatrixValues[4] * parentRotationMatrix[0] + rotMatrixValues[5] * parentRotationMatrix[3] + rotMatrixValues[6] * parentRotationMatrix[6], particleRotationMatrix[4] = rotMatrixValues[4] * parentRotationMatrix[1] + rotMatrixValues[5] * parentRotationMatrix[4] + rotMatrixValues[6] * parentRotationMatrix[7], particleRotationMatrix[5] = rotMatrixValues[4] * parentRotationMatrix[2] + rotMatrixValues[5] * parentRotationMatrix[5] + rotMatrixValues[6] * parentRotationMatrix[8], particleRotationMatrix[6] = rotMatrixValues[8] * parentRotationMatrix[0] + rotMatrixValues[9] * parentRotationMatrix[3] + rotMatrixValues[10] * parentRotationMatrix[6], particleRotationMatrix[7] = rotMatrixValues[8] * parentRotationMatrix[1] + rotMatrixValues[9] * parentRotationMatrix[4] + rotMatrixValues[10] * parentRotationMatrix[7], particleRotationMatrix[8] = rotMatrixValues[8] * parentRotationMatrix[2] + rotMatrixValues[9] * parentRotationMatrix[5] + rotMatrixValues[10] * parentRotationMatrix[8];}} else particle.parentId = null;} else if (particleGlobalPosition.x = particlePosition.x, particleGlobalPosition.y = particlePosition.y, particleGlobalPosition.z = particlePosition.z, this._computeParticleRotation || this.billboard) {const rotMatrixValues = rotMatrix.m;particleRotationMatrix[0] = rotMatrixValues[0], particleRotationMatrix[1] = rotMatrixValues[1], particleRotationMatrix[2] = rotMatrixValues[2], particleRotationMatrix[3] = rotMatrixValues[4], particleRotationMatrix[4] = rotMatrixValues[5], particleRotationMatrix[5] = rotMatrixValues[6], particleRotationMatrix[6] = rotMatrixValues[8], particleRotationMatrix[7] = rotMatrixValues[9], particleRotationMatrix[8] = rotMatrixValues[10];}const pivotBackTranslation = tempVectors[11];for (particle.translateFromPivot ? pivotBackTranslation.setAll(0) : pivotBackTranslation.copyFrom(scaledPivot), pt = 0; pt < shape.length; pt++) {idx = index + 3 * pt, colidx = colorIndex + 4 * pt, uvidx = uvIndex + 2 * pt;const iu = 2 * pt;tmpVector.copyFrom(shape[pt]), this._computeParticleColor && particle.color && tmpColor.copyFrom(particle.color), this._computeParticleTexture && tmpUV.copyFromFloats(shapeUV[iu], shapeUV[iu + 1]), this._computeParticleVertex && this.updateParticleVertex(particle, tmpVertex, pt);const vertexX = tmpVector.x * particleScaling.x - scaledPivot.x,vertexY = tmpVector.y * particleScaling.y - scaledPivot.y,vertexZ = tmpVector.z * particleScaling.z - scaledPivot.z;let rotatedX = vertexX * particleRotationMatrix[0] + vertexY * particleRotationMatrix[3] + vertexZ * particleRotationMatrix[6],rotatedY = vertexX * particleRotationMatrix[1] + vertexY * particleRotationMatrix[4] + vertexZ * particleRotationMatrix[7],rotatedZ = vertexX * particleRotationMatrix[2] + vertexY * particleRotationMatrix[5] + vertexZ * particleRotationMatrix[8];rotatedX += pivotBackTranslation.x, rotatedY += pivotBackTranslation.y, rotatedZ += pivotBackTranslation.z;const px = positions32[idx] = particleGlobalPosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ,py = positions32[idx + 1] = particleGlobalPosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ,pz = positions32[idx + 2] = particleGlobalPosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ;if (this._computeBoundingBox && (minimum.minimizeInPlaceFromFloats(px, py, pz), maximum.maximizeInPlaceFromFloats(px, py, pz)), !this._computeParticleVertex) {const normalx = fixedNormal32[idx],normaly = fixedNormal32[idx + 1],normalz = fixedNormal32[idx + 2],rotatedx = normalx * particleRotationMatrix[0] + normaly * particleRotationMatrix[3] + normalz * particleRotationMatrix[6],rotatedy = normalx * particleRotationMatrix[1] + normaly * particleRotationMatrix[4] + normalz * particleRotationMatrix[7],rotatedz = normalx * particleRotationMatrix[2] + normaly * particleRotationMatrix[5] + normalz * particleRotationMatrix[8];normals32[idx] = camAxisX.x * rotatedx + camAxisY.x * rotatedy + camAxisZ.x * rotatedz, normals32[idx + 1] = camAxisX.y * rotatedx + camAxisY.y * rotatedy + camAxisZ.y * rotatedz, normals32[idx + 2] = camAxisX.z * rotatedx + camAxisY.z * rotatedy + camAxisZ.z * rotatedz;}if (this._computeParticleColor && particle.color) {const colors32 = this._colors32;colors32[colidx] = tmpColor.r, colors32[colidx + 1] = tmpColor.g, colors32[colidx + 2] = tmpColor.b, colors32[colidx + 3] = tmpColor.a;}if (this._computeParticleTexture) {const uvs = particle.uvs;uvs32[uvidx] = tmpUV.x * (uvs.z - uvs.x) + uvs.x, uvs32[uvidx + 1] = tmpUV.y * (uvs.w - uvs.y) + uvs.y;}}} else for (particle._stillInvisible = !0, pt = 0; pt < shape.length; pt++) {if (idx = index + 3 * pt, colidx = colorIndex + 4 * pt, uvidx = uvIndex + 2 * pt, positions32[idx] = positions32[idx + 1] = positions32[idx + 2] = 0, normals32[idx] = normals32[idx + 1] = normals32[idx + 2] = 0, this._computeParticleColor && particle.color) {const color = particle.color;colors32[colidx] = color.r, colors32[colidx + 1] = color.g, colors32[colidx + 2] = color.b, colors32[colidx + 3] = color.a;}if (this._computeParticleTexture) {const uvs = particle.uvs;uvs32[uvidx] = shapeUV[2 * pt] * (uvs.z - uvs.x) + uvs.x, uvs32[uvidx + 1] = shapeUV[2 * pt + 1] * (uvs.w - uvs.y) + uvs.y;}}if (this._particlesIntersect) {const bInfo = particle.getBoundingInfo(),bBox = bInfo.boundingBox,bSphere = bInfo.boundingSphere,modelBoundingInfo = particle._modelBoundingInfo;if (!this._bSphereOnly) {const modelBoundingInfoVectors = modelBoundingInfo.boundingBox.vectors,tempMin = tempVectors[1],tempMax = tempVectors[2];tempMin.setAll(Number.MAX_VALUE), tempMax.setAll(-Number.MAX_VALUE);for (let b = 0; 8 > b; b++) {const scaledX = modelBoundingInfoVectors[b].x * particleScaling.x,scaledY = modelBoundingInfoVectors[b].y * particleScaling.y,scaledZ = modelBoundingInfoVectors[b].z * particleScaling.z,rotatedX = scaledX * particleRotationMatrix[0] + scaledY * particleRotationMatrix[3] + scaledZ * particleRotationMatrix[6],rotatedY = scaledX * particleRotationMatrix[1] + scaledY * particleRotationMatrix[4] + scaledZ * particleRotationMatrix[7],rotatedZ = scaledX * particleRotationMatrix[2] + scaledY * particleRotationMatrix[5] + scaledZ * particleRotationMatrix[8],x = particlePosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ,y = particlePosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ,z = particlePosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ;tempMin.minimizeInPlaceFromFloats(x, y, z), tempMax.maximizeInPlaceFromFloats(x, y, z);}bBox.reConstruct(tempMin, tempMax, mesh._worldMatrix);}const minBbox = modelBoundingInfo.minimum.multiplyToRef(particleScaling, tempVectors[1]),maxBbox = modelBoundingInfo.maximum.multiplyToRef(particleScaling, tempVectors[2]),bSphereCenter = maxBbox.addToRef(minBbox, tempVectors[3]).scaleInPlace(.5).addInPlace(particleGlobalPosition),halfDiag = maxBbox.subtractToRef(minBbox, tempVectors[4]).scaleInPlace(.5 * this._bSphereRadiusFactor),bSphereMinBbox = bSphereCenter.subtractToRef(halfDiag, tempVectors[1]),bSphereMaxBbox = bSphereCenter.addToRef(halfDiag, tempVectors[2]);bSphere.reConstruct(bSphereMinBbox, bSphereMaxBbox, mesh._worldMatrix);}index = idx + 3, colorIndex = colidx + 4, uvIndex = uvidx + 2;}if (update) {if (this._computeParticleColor) {const vb = mesh.getVertexBuffer(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind);vb && !mesh.isPickable ? vb.updateDirectly(colors32, 0) : mesh.updateVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, colors32, !1, !1);}if (this._computeParticleTexture) {const vb = mesh.getVertexBuffer(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind);vb && !mesh.isPickable ? vb.updateDirectly(uvs32, 0) : mesh.updateVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, uvs32, !1, !1);}const vbp = mesh.getVertexBuffer(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);if (vbp && !mesh.isPickable ? vbp.updateDirectly(positions32, 0) : mesh.updateVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, positions32, !1, !1), !mesh.areNormalsFrozen || mesh.isFacetDataEnabled) {if (this._computeParticleVertex || mesh.isFacetDataEnabled) {const params = mesh.isFacetDataEnabled ? mesh.getFacetDataParameters() : null;mesh_vertexData/* VertexData.ComputeNormals */.x.ComputeNormals(positions32, indices32, normals32, params);for (let i = 0; i < normals32.length; i++) fixedNormal32[i] = normals32[i];}if (!mesh.areNormalsFrozen) {const vb = mesh.getVertexBuffer(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind);vb && !mesh.isPickable ? vb.updateDirectly(normals32, 0) : mesh.updateVerticesData(Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, normals32, !1, !1);}}if (depthSortParticles) {const depthSortedParticles = this.depthSortedParticles;depthSortedParticles.sort(this._depthSortFunction);const dspl = depthSortedParticles.length;let sid = 0,faceId = 0;for (let sorted = 0; sorted < dspl; sorted++) {const sortedParticle = depthSortedParticles[sorted],lind = sortedParticle.indicesLength,sind = sortedParticle.ind;for (let i = 0; i < lind; i++) if (indices32[sid] = indices[sind + i], sid++, this._pickable) {const f = i % 3;if (0 == f) {const pickedData = this.pickedParticles[faceId];pickedData.idx = sortedParticle.idx, pickedData.faceId = faceId, faceId++;}}}}if (this._autoFixFaceOrientation) {let particleInd = 0;for (let particleIdx = 0; particleIdx < this.particles.length; particleIdx++) {const particle = depthSortParticles ? this.particles[this.depthSortedParticles[particleIdx].idx] : this.particles[particleIdx],flipFaces = 0 > particle.scale.x * particle.scale.y * particle.scale.z;if (flipFaces) for (let faceInd = 0; faceInd < particle._model._indicesLength; faceInd += 3) {const tmp = indices[particle._ind + faceInd];indices32[particleInd + faceInd] = indices[particle._ind + faceInd + 1], indices32[particleInd + faceInd + 1] = tmp;}particleInd += particle._model._indicesLength;}}(depthSortParticles || this._autoFixFaceOrientation) && mesh.updateIndices(indices32);}return this._computeBoundingBox && (mesh.hasBoundingInfo ? mesh.getBoundingInfo().reConstruct(minimum, maximum, mesh._worldMatrix) : mesh.buildBoundingInfo(minimum, maximum, mesh._worldMatrix)), this._autoUpdateSubMeshes && this.computeSubMeshes(), this._recomputeInvisibles = !1, this.afterUpdateParticles(start, end, update), this;}dispose() {this.mesh.dispose(), this.vars = null, this._positions = null, this._indices = null, this._normals = null, this._uvs = null, this._colors = null, this._indices32 = null, this._positions32 = null, this._normals32 = null, this._fixedNormal32 = null, this._uvs32 = null, this._colors32 = null, this.pickedParticles = null, this.pickedBySubMesh = null, this._materials = null, this._materialIndexes = null, this._indicesByMaterial = null, this._idxOfId = null;}pickedParticle(pickingInfo) {if (pickingInfo.hit) {const subMesh = pickingInfo.subMeshId,faceId = pickingInfo.faceId - this.mesh.subMeshes[subMesh].indexStart / 3,picked = this.pickedBySubMesh;if (picked[subMesh] && picked[subMesh][faceId]) return picked[subMesh][faceId];}return null;}getParticleById(id) {const p = this.particles[id];if (p && p.id == id) return p;const particles = this.particles,idx = this._idxOfId[id];if (idx !== void 0) return particles[idx];let i = 0;for (const nb = this.nbParticles; i < nb;) {const particle = particles[i];if (particle.id == id) return particle;i++;}return null;}getParticlesByShapeId(shapeId) {const ref = [];return this.getParticlesByShapeIdToRef(shapeId, ref), ref;}getParticlesByShapeIdToRef(shapeId, ref) {ref.length = 0;for (let i = 0; i < this.nbParticles; i++) {const p = this.particles[i];p.shapeId == shapeId && ref.push(p);}return this;}computeSubMeshes() {if (!this.mesh || !this._multimaterialEnabled) return this;const depthSortedParticles = this.depthSortedParticles;if (0 < this.particles.length) for (let p = 0; p < this.particles.length; p++) {const part = this.particles[p];part.materialIndex || (part.materialIndex = 0);const sortedPart = depthSortedParticles[p];sortedPart.materialIndex = part.materialIndex, sortedPart.ind = part._ind, sortedPart.indicesLength = part._model._indicesLength, sortedPart.idx = part.idx;}this._sortParticlesByMaterial();const indicesByMaterial = this._indicesByMaterial,materialIndexes = this._materialIndexes,mesh = this.mesh;mesh.subMeshes = [];const vcount = mesh.getTotalVertices();for (let m = 0; m < materialIndexes.length; m++) {const start = indicesByMaterial[m],count = indicesByMaterial[m + 1] - start,matIndex = materialIndexes[m];new subMesh/* SubMesh */.P(matIndex, 0, vcount, start, count, mesh);}return this;}_sortParticlesByMaterial() {const indicesByMaterial = [0];this._indicesByMaterial = indicesByMaterial;const materialIndexes = [];this._materialIndexes = materialIndexes;const depthSortedParticles = this.depthSortedParticles;depthSortedParticles.sort(this._materialSortFunction);const length = depthSortedParticles.length,indices32 = this._indices32,indices = this._indices;let subMeshIndex = 0,subMeshFaceId = 0,sid = 0,lastMatIndex = depthSortedParticles[0].materialIndex;materialIndexes.push(lastMatIndex), this._pickable && (this.pickedBySubMesh = [[]], this.pickedParticles = this.pickedBySubMesh[0]);for (let sorted = 0; sorted < length; sorted++) {const sortedPart = depthSortedParticles[sorted],lind = sortedPart.indicesLength,sind = sortedPart.ind;sortedPart.materialIndex !== lastMatIndex && (lastMatIndex = sortedPart.materialIndex, indicesByMaterial.push(sid), materialIndexes.push(lastMatIndex), this._pickable && (subMeshIndex++, this.pickedBySubMesh[subMeshIndex] = [], subMeshFaceId = 0));let faceId = 0;for (let i = 0; i < lind; i++) {if (indices32[sid] = indices[sind + i], this._pickable) {const f = i % 3;if (0 == f) {const pickedData = this.pickedBySubMesh[subMeshIndex][subMeshFaceId];pickedData ? (pickedData.idx = sortedPart.idx, pickedData.faceId = faceId) : this.pickedBySubMesh[subMeshIndex][subMeshFaceId] = { idx: sortedPart.idx, faceId: faceId }, subMeshFaceId++, faceId++;}}sid++;}}return indicesByMaterial.push(indices32.length), this._updatable && this.mesh.updateIndices(indices32), this;}_setMaterialIndexesById() {this._materialIndexesById = {};for (let i = 0; i < this._materials.length; i++) {const id = this._materials[i].uniqueId;this._materialIndexesById[id] = i;}}_filterUniqueMaterialId(array) {const filtered = array.filter(function (value, index, self) {return self.indexOf(value) === index;});return filtered;}_setDefaultMaterial() {return this._defaultMaterial || (this._defaultMaterial = new standardMaterial/* StandardMaterial */.K(this.name + "DefaultMaterial", this._scene)), this._defaultMaterial;}refreshVisibleSize() {return this._isVisibilityBoxLocked || this.mesh.refreshBoundingInfo(), this;}setVisibilityBox(size) {const vis = size / 2;this.mesh.buildBoundingInfo(new math_vector/* Vector3 */.P(-vis, -vis, -vis), new math_vector/* Vector3 */.P(vis, vis, vis));}get isAlwaysVisible() {return this._alwaysVisible;}set isAlwaysVisible(val) {this._alwaysVisible = val, this.mesh.alwaysSelectAsActiveMesh = val;}set isVisibilityBoxLocked(val) {this._isVisibilityBoxLocked = val;const boundingInfo = this.mesh.getBoundingInfo();boundingInfo.isLocked = val;}get isVisibilityBoxLocked() {return this._isVisibilityBoxLocked;}set computeParticleRotation(val) {this._computeParticleRotation = val;}set computeParticleColor(val) {this._computeParticleColor = val;}set computeParticleTexture(val) {this._computeParticleTexture = val;}set computeParticleVertex(val) {this._computeParticleVertex = val;}set computeBoundingBox(val) {this._computeBoundingBox = val;}set depthSortParticles(val) {this._depthSortParticles = val;}get computeParticleRotation() {return this._computeParticleRotation;}get computeParticleColor() {return this._computeParticleColor;}get computeParticleTexture() {return this._computeParticleTexture;}get computeParticleVertex() {return this._computeParticleVertex;}get computeBoundingBox() {return this._computeBoundingBox;}get depthSortParticles() {return this._depthSortParticles;}get expandable() {return this._expandable;}get multimaterialEnabled() {return this._multimaterialEnabled;}get useModelMaterial() {return this._useModelMaterial;}get materials() {return this._materials;}setMultiMaterial(materials) {this._materials = this._filterUniqueMaterialId(materials), this._setMaterialIndexesById(), this._multimaterial && this._multimaterial.dispose(), this._multimaterial = new multiMaterial/* MultiMaterial */.G(this.name + "MultiMaterial", this._scene);for (let m = 0; m < this._materials.length; m++) this._multimaterial.subMaterials.push(this._materials[m]);this.computeSubMeshes(), this.mesh.material = this._multimaterial;}get multimaterial() {return this._multimaterial;}set multimaterial(mm) {this._multimaterial = mm;}get autoUpdateSubMeshes() {return this._autoUpdateSubMeshes;}set autoUpdateSubMeshes(val) {this._autoUpdateSubMeshes = val;}initParticles() {}recycleParticle(particle) {return particle;}updateParticle(particle) {return particle;}updateParticleVertex() {return this;}beforeUpdateParticles() {}afterUpdateParticles() {}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/cloudPoint.js
class CloudPoint {constructor(particleIndex, group, groupId, idxInGroup, pcs) {this.idx = 0, this.color = new math/* Color4 */.HE(1, 1, 1, 1), this.position = math/* Vector3.Zero */.P.Zero(), this.rotation = math/* Vector3.Zero */.P.Zero(), this.uv = new math/* Vector2 */.FM(0, 0), this.velocity = math/* Vector3.Zero */.P.Zero(), this.pivot = math/* Vector3.Zero */.P.Zero(), this.translateFromPivot = !1, this._pos = 0, this._ind = 0, this.groupId = 0, this.idxInGroup = 0, this._stillInvisible = !1, this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1], this.parentId = null, this._globalPosition = math/* Vector3.Zero */.P.Zero(), this.idx = particleIndex, this._group = group, this.groupId = groupId, this.idxInGroup = idxInGroup, this._pcs = pcs;}get size() {return this.size;}set size(scale) {this.size = scale;}get quaternion() {return this.rotationQuaternion;}set quaternion(q) {this.rotationQuaternion = q;}intersectsMesh(target, isSphere) {if (!target.hasBoundingInfo) return !1;if (!this._pcs.mesh) throw new Error("Point Cloud System doesnt contain the Mesh");if (isSphere) return target.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));const bbox = target.getBoundingInfo().boundingBox,maxX = bbox.maximumWorld.x,minX = bbox.minimumWorld.x,maxY = bbox.maximumWorld.y,minY = bbox.minimumWorld.y,maxZ = bbox.maximumWorld.z,minZ = bbox.minimumWorld.z,x = this.position.x + this._pcs.mesh.position.x,y = this.position.y + this._pcs.mesh.position.y,z = this.position.z + this._pcs.mesh.position.z;return minX <= x && x <= maxX && minY <= y && y <= maxY && minZ <= z && z <= maxZ;}getRotationMatrix(m) {let quaternion;if (this.rotationQuaternion) quaternion = this.rotationQuaternion;else {quaternion = math/* TmpVectors.Quaternion.0 */.jp.Quaternion[0];const rotation = this.rotation;math/* Quaternion.RotationYawPitchRollToRef */._f.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);}quaternion.toRotationMatrix(m);}}class PointsGroup {get groupID() {return this.groupId;}set groupID(groupID) {this.groupId = groupID;}constructor(id, posFunction) {this.groupId = id, this._positionFunction = posFunction;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/pointsCloudSystem.js
var PointColor;(function (PointColor) {PointColor[PointColor.Color = 2] = "Color", PointColor[PointColor.UV = 1] = "UV", PointColor[PointColor.Random = 0] = "Random", PointColor[PointColor.Stated = 3] = "Stated";})(PointColor || (PointColor = {}));class PointsCloudSystem {get positions() {return this._positions32;}get colors() {return this._colors32;}get uvs() {return this._uvs32;}constructor(name, pointSize, scene, options) {this.particles = [], this.nbParticles = 0, this.counter = 0, this.vars = {}, this._promises = [], this._positions = [], this._indices = [], this._normals = [], this._colors = [], this._uvs = [], this._updatable = !0, this._isVisibilityBoxLocked = !1, this._alwaysVisible = !1, this._groups = [], this._groupCounter = 0, this._computeParticleColor = !0, this._computeParticleTexture = !0, this._computeParticleRotation = !0, this._computeBoundingBox = !1, this._isReady = !1, this.name = name, this._size = pointSize, this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, this._updatable = !(options && void 0 !== options.updatable) || options.updatable;}buildMeshAsync(material) {return Promise.all(this._promises).then(() => (this._isReady = !0, this._buildMesh(material)));}_buildMesh(material) {0 === this.nbParticles && this.addPoints(1), this._positions32 = new Float32Array(this._positions), this._uvs32 = new Float32Array(this._uvs), this._colors32 = new Float32Array(this._colors);const vertexData = new mesh_vertexData/* VertexData */.x();vertexData.set(this._positions32, Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind), 0 < this._uvs32.length && vertexData.set(this._uvs32, Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind);let ec = 0;0 < this._colors32.length && (ec = 1, vertexData.set(this._colors32, Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind));const mesh = new Meshes_mesh/* Mesh */.Kj(this.name, this._scene);vertexData.applyToMesh(mesh, this._updatable), this.mesh = mesh, this._positions = null, this._uvs = null, this._colors = null, this._updatable || (this.particles.length = 0);let mat = material;return mat || (mat = new standardMaterial/* StandardMaterial */.K("point cloud material", this._scene), mat.emissiveColor = new math/* Color3 */.Wo(ec, ec, ec), mat.disableLighting = !0, mat.pointsCloud = !0, mat.pointSize = this._size), mesh.material = mat, new Promise((resolve) => resolve(mesh));}_addParticle(idx, group, groupId, idxInGroup) {const cp = new CloudPoint(idx, group, groupId, idxInGroup, this);return this.particles.push(cp), cp;}_randomUnitVector(particle) {particle.position = new math_vector/* Vector3 */.P(Math.random(), Math.random(), Math.random()), particle.color = new math/* Color4 */.HE(1, 1, 1, 1);}_getColorIndicesForCoord(pointsGroup, x, y, width) {const imageData = pointsGroup._groupImageData,color = y * (4 * width) + 4 * x,colorIndices = [color, color + 1, color + 2, color + 3],redIndex = colorIndices[0],greenIndex = colorIndices[1],blueIndex = colorIndices[2],alphaIndex = colorIndices[3],redForCoord = imageData[redIndex],greenForCoord = imageData[greenIndex],blueForCoord = imageData[blueIndex],alphaForCoord = imageData[alphaIndex];return new math/* Color4 */.HE(redForCoord / 255, greenForCoord / 255, blueForCoord / 255, alphaForCoord);}_setPointsColorOrUV(mesh, pointsGroup, isVolume, colorFromTexture, hasTexture, color, range) {isVolume && mesh.updateFacetData();const boundInfo = mesh.getBoundingInfo(),diameter = 2 * boundInfo.boundingSphere.radius;let meshPos = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);const meshInd = mesh.getIndices(),meshUV = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind),meshCol = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind),place = math_vector/* Vector3.Zero */.P.Zero();mesh.computeWorldMatrix();const meshMatrix = mesh.getWorldMatrix();if (!meshMatrix.isIdentity()) {meshPos = meshPos.slice(0);for (let p = 0; p < meshPos.length / 3; p++) math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(meshPos[3 * p], meshPos[3 * p + 1], meshPos[3 * p + 2], meshMatrix, place), meshPos[3 * p] = place.x, meshPos[3 * p + 1] = place.y, meshPos[3 * p + 2] = place.z;}let idxPoints = 0,id0 = 0,id1 = 0,id2 = 0,v0X = 0,v0Y = 0,v0Z = 0,v1X = 0,v1Y = 0,v1Z = 0,v2X = 0,v2Y = 0,v2Z = 0;const vertex0 = math_vector/* Vector3.Zero */.P.Zero(),vertex1 = math_vector/* Vector3.Zero */.P.Zero(),vertex2 = math_vector/* Vector3.Zero */.P.Zero(),vec0 = math_vector/* Vector3.Zero */.P.Zero(),vec1 = math_vector/* Vector3.Zero */.P.Zero();let uv0X = 0,uv0Y = 0,uv1X = 0,uv1Y = 0,uv2X = 0,uv2Y = 0;const uv0 = math_vector/* Vector2.Zero */.FM.Zero(),uv1 = math_vector/* Vector2.Zero */.FM.Zero(),uv2 = math_vector/* Vector2.Zero */.FM.Zero(),uvec0 = math_vector/* Vector2.Zero */.FM.Zero(),uvec1 = math_vector/* Vector2.Zero */.FM.Zero();let col0X = 0,col0Y = 0,col0Z = 0,col0A = 0,col1X = 0,col1Y = 0,col1Z = 0,col1A = 0,col2X = 0,col2Y = 0,col2Z = 0,col2A = 0;const col0 = math_vector/* Vector4.Zero */.Lt.Zero(),col1 = math_vector/* Vector4.Zero */.Lt.Zero(),col2 = math_vector/* Vector4.Zero */.Lt.Zero(),colvec0 = math_vector/* Vector4.Zero */.Lt.Zero(),colvec1 = math_vector/* Vector4.Zero */.Lt.Zero();let lamda = 0,mu = 0;range = range ? range : 0;let facetPoint,uvPoint,colPoint = new math_vector/* Vector4 */.Lt(0, 0, 0, 0),norm = math_vector/* Vector3.Zero */.P.Zero(),tang = math_vector/* Vector3.Zero */.P.Zero(),biNorm = math_vector/* Vector3.Zero */.P.Zero(),angle = 0,facetPlaneVec = math_vector/* Vector3.Zero */.P.Zero(),gap = 0,distance = 0;const ray = new Ray(math_vector/* Vector3.Zero */.P.Zero(), new math_vector/* Vector3 */.P(1, 0, 0));let pickInfo,direction = math_vector/* Vector3.Zero */.P.Zero();for (let index = 0; index < meshInd.length / 3; index++) {id0 = meshInd[3 * index], id1 = meshInd[3 * index + 1], id2 = meshInd[3 * index + 2], v0X = meshPos[3 * id0], v0Y = meshPos[3 * id0 + 1], v0Z = meshPos[3 * id0 + 2], v1X = meshPos[3 * id1], v1Y = meshPos[3 * id1 + 1], v1Z = meshPos[3 * id1 + 2], v2X = meshPos[3 * id2], v2Y = meshPos[3 * id2 + 1], v2Z = meshPos[3 * id2 + 2], vertex0.set(v0X, v0Y, v0Z), vertex1.set(v1X, v1Y, v1Z), vertex2.set(v2X, v2Y, v2Z), vertex1.subtractToRef(vertex0, vec0), vertex2.subtractToRef(vertex1, vec1), meshUV && (uv0X = meshUV[2 * id0], uv0Y = meshUV[2 * id0 + 1], uv1X = meshUV[2 * id1], uv1Y = meshUV[2 * id1 + 1], uv2X = meshUV[2 * id2], uv2Y = meshUV[2 * id2 + 1], uv0.set(uv0X, uv0Y), uv1.set(uv1X, uv1Y), uv2.set(uv2X, uv2Y), uv1.subtractToRef(uv0, uvec0), uv2.subtractToRef(uv1, uvec1)), meshCol && colorFromTexture && (col0X = meshCol[4 * id0], col0Y = meshCol[4 * id0 + 1], col0Z = meshCol[4 * id0 + 2], col0A = meshCol[4 * id0 + 3], col1X = meshCol[4 * id1], col1Y = meshCol[4 * id1 + 1], col1Z = meshCol[4 * id1 + 2], col1A = meshCol[4 * id1 + 3], col2X = meshCol[4 * id2], col2Y = meshCol[4 * id2 + 1], col2Z = meshCol[4 * id2 + 2], col2A = meshCol[4 * id2 + 3], col0.set(col0X, col0Y, col0Z, col0A), col1.set(col1X, col1Y, col1Z, col1A), col2.set(col2X, col2Y, col2Z, col2A), col1.subtractToRef(col0, colvec0), col2.subtractToRef(col1, colvec1));let width, height, deltaS, deltaV, h, s, v, hsvCol;const statedColor = new math/* Color3 */.Wo(0, 0, 0),colPoint3 = new math/* Color3 */.Wo(0, 0, 0);let pointColors, particle;for (let i = 0; i < pointsGroup._groupDensity[index]; i++) idxPoints = this.particles.length, this._addParticle(idxPoints, pointsGroup, this._groupCounter, index + i), particle = this.particles[idxPoints], lamda = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 1), mu = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 1), facetPoint = vertex0.add(vec0.scale(lamda)).add(vec1.scale(lamda * mu)), isVolume && (norm = mesh.getFacetNormal(index).normalize().scale(-1), tang = vec0.clone().normalize(), biNorm = math_vector/* Vector3.Cross */.P.Cross(norm, tang), angle = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 2 * Math.PI), facetPlaneVec = tang.scale(Math.cos(angle)).add(biNorm.scale(Math.sin(angle))), angle = math_scalar/* Scalar.RandomRange */.R.RandomRange(.1, Math.PI / 2), direction = facetPlaneVec.scale(Math.cos(angle)).add(norm.scale(Math.sin(angle))), ray.origin = facetPoint.add(direction.scale(1e-5)), ray.direction = direction, ray.length = diameter, pickInfo = ray.intersectsMesh(mesh), pickInfo.hit && (distance = pickInfo.pickedPoint.subtract(facetPoint).length(), gap = math_scalar/* Scalar.RandomRange */.R.RandomRange(0, 1) * distance, facetPoint.addInPlace(direction.scale(gap)))), particle.position = facetPoint.clone(), this._positions.push(particle.position.x, particle.position.y, particle.position.z), void 0 === colorFromTexture ? (color ? (statedColor.set(color.r, color.g, color.b), deltaS = math_scalar/* Scalar.RandomRange */.R.RandomRange(-range, range), deltaV = math_scalar/* Scalar.RandomRange */.R.RandomRange(-range, range), hsvCol = statedColor.toHSV(), h = hsvCol.r, s = hsvCol.g + deltaS, v = hsvCol.b + deltaV, 0 > s && (s = 0), 1 < s && (s = 1), 0 > v && (v = 0), 1 < v && (v = 1), math/* Color3.HSVtoRGBToRef */.Wo.HSVtoRGBToRef(h, s, v, colPoint3), colPoint.set(colPoint3.r, colPoint3.g, colPoint3.b, 1)) : colPoint = col0.set(Math.random(), Math.random(), Math.random(), 1), particle.color = new math/* Color4 */.HE(colPoint.x, colPoint.y, colPoint.z, colPoint.w), this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w)) : meshUV && (uvPoint = uv0.add(uvec0.scale(lamda)).add(uvec1.scale(lamda * mu)), colorFromTexture ? hasTexture && null !== pointsGroup._groupImageData ? (width = pointsGroup._groupImgWidth, height = pointsGroup._groupImgHeight, pointColors = this._getColorIndicesForCoord(pointsGroup, Math.round(uvPoint.x * width), Math.round(uvPoint.y * height), width), particle.color = pointColors, this._colors.push(pointColors.r, pointColors.g, pointColors.b, pointColors.a)) : meshCol ? (colPoint = col0.add(colvec0.scale(lamda)).add(colvec1.scale(lamda * mu)), particle.color = new math/* Color4 */.HE(colPoint.x, colPoint.y, colPoint.z, colPoint.w), this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w)) : (colPoint = col0.set(Math.random(), Math.random(), Math.random(), 1), particle.color = new math/* Color4 */.HE(colPoint.x, colPoint.y, colPoint.z, colPoint.w), this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w)) : (particle.uv = uvPoint.clone(), this._uvs.push(particle.uv.x, particle.uv.y)));}}_colorFromTexture(mesh, pointsGroup, isVolume) {if (null === mesh.material) return logger/* Logger.Warn */.Y.Warn(mesh.name + "has no material."), pointsGroup._groupImageData = null, void this._setPointsColorOrUV(mesh, pointsGroup, isVolume, !0, !1);const mat = mesh.material,textureList = mat.getActiveTextures();if (0 === textureList.length) return logger/* Logger.Warn */.Y.Warn(mesh.name + "has no usable texture."), pointsGroup._groupImageData = null, void this._setPointsColorOrUV(mesh, pointsGroup, isVolume, !0, !1);const clone = mesh.clone();clone.setEnabled(!1), this._promises.push(new Promise((resolve) => {baseTexture/* BaseTexture.WhenAllReady */.V.WhenAllReady(textureList, () => {let n = pointsGroup._textureNb;0 > n && (n = 0), n > textureList.length - 1 && (n = textureList.length - 1);const finalize = () => {pointsGroup._groupImgWidth = textureList[n].getSize().width, pointsGroup._groupImgHeight = textureList[n].getSize().height, this._setPointsColorOrUV(clone, pointsGroup, isVolume, !0, !0), clone.dispose(), resolve();};pointsGroup._groupImageData = null;const dataPromise = textureList[n].readPixels();dataPromise ? dataPromise.then((data) => {pointsGroup._groupImageData = data, finalize();}) : finalize();});}));}_calculateDensity(nbPoints, positions, indices) {let id0,id1,id2,v0X,v0Y,v0Z,v1X,v1Y,v1Z,v2X,v2Y,v2Z,density = [];const vertex0 = math_vector/* Vector3.Zero */.P.Zero(),vertex1 = math_vector/* Vector3.Zero */.P.Zero(),vertex2 = math_vector/* Vector3.Zero */.P.Zero(),vec0 = math_vector/* Vector3.Zero */.P.Zero(),vec1 = math_vector/* Vector3.Zero */.P.Zero(),vec2 = math_vector/* Vector3.Zero */.P.Zero();let a, b, c, p, area;const areas = [];let surfaceArea = 0;const nbFacets = indices.length / 3;for (let index = 0; index < nbFacets; index++) id0 = indices[3 * index], id1 = indices[3 * index + 1], id2 = indices[3 * index + 2], v0X = positions[3 * id0], v0Y = positions[3 * id0 + 1], v0Z = positions[3 * id0 + 2], v1X = positions[3 * id1], v1Y = positions[3 * id1 + 1], v1Z = positions[3 * id1 + 2], v2X = positions[3 * id2], v2Y = positions[3 * id2 + 1], v2Z = positions[3 * id2 + 2], vertex0.set(v0X, v0Y, v0Z), vertex1.set(v1X, v1Y, v1Z), vertex2.set(v2X, v2Y, v2Z), vertex1.subtractToRef(vertex0, vec0), vertex2.subtractToRef(vertex1, vec1), vertex2.subtractToRef(vertex0, vec2), a = vec0.length(), b = vec1.length(), c = vec2.length(), p = (a + b + c) / 2, area = Math.sqrt(p * (p - a) * (p - b) * (p - c)), surfaceArea += area, areas[index] = area;let pointCount = 0;for (let index = 0; index < nbFacets; index++) density[index] = Math.floor(nbPoints * areas[index] / surfaceArea), pointCount += density[index];const diff = nbPoints - pointCount,pointsPerFacet = Math.floor(diff / nbFacets);0 < pointsPerFacet && (density = density.map((x) => x + pointsPerFacet));for (let index = 0; index < diff % nbFacets; index++) density[index] += 1;return density;}addPoints(nb, pointFunction = this._randomUnitVector) {const pointsGroup = new PointsGroup(this._groupCounter, pointFunction);let cp,idx = this.nbParticles;for (let i = 0; i < nb; i++) cp = this._addParticle(idx, pointsGroup, this._groupCounter, i), pointsGroup && pointsGroup._positionFunction && pointsGroup._positionFunction(cp, idx, i), this._positions.push(cp.position.x, cp.position.y, cp.position.z), cp.color && this._colors.push(cp.color.r, cp.color.g, cp.color.b, cp.color.a), cp.uv && this._uvs.push(cp.uv.x, cp.uv.y), idx++;return this.nbParticles += nb, this._groupCounter++, this._groupCounter;}addSurfacePoints(mesh, nb, colorWith, color, range) {let colored = colorWith ? colorWith : PointColor.Random;(isNaN(colored) || 0 > colored || 3 < colored) && (colored = PointColor.Random);const meshPos = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),meshInd = mesh.getIndices();this._groups.push(this._groupCounter);const pointsGroup = new PointsGroup(this._groupCounter, null);return pointsGroup._groupDensity = this._calculateDensity(nb, meshPos, meshInd), colored === PointColor.Color ? pointsGroup._textureNb = color ? color : 0 : color = color ? color : new math/* Color4 */.HE(1, 1, 1, 1), colored === PointColor.Color ? this._colorFromTexture(mesh, pointsGroup, !1) : colored === PointColor.UV ? this._setPointsColorOrUV(mesh, pointsGroup, !1, !1, !1) : colored === PointColor.Random ? this._setPointsColorOrUV(mesh, pointsGroup, !1) : colored === PointColor.Stated ? this._setPointsColorOrUV(mesh, pointsGroup, !1, void 0, void 0, color, range) : void 0, (this.nbParticles += nb, this._groupCounter++, this._groupCounter - 1);}addVolumePoints(mesh, nb, colorWith, color, range) {let colored = colorWith ? colorWith : PointColor.Random;(isNaN(colored) || 0 > colored || 3 < colored) && (colored = PointColor.Random);const meshPos = mesh.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),meshInd = mesh.getIndices();this._groups.push(this._groupCounter);const pointsGroup = new PointsGroup(this._groupCounter, null);return pointsGroup._groupDensity = this._calculateDensity(nb, meshPos, meshInd), colored === PointColor.Color ? pointsGroup._textureNb = color ? color : 0 : color = color ? color : new math/* Color4 */.HE(1, 1, 1, 1), colored === PointColor.Color ? this._colorFromTexture(mesh, pointsGroup, !0) : colored === PointColor.UV ? this._setPointsColorOrUV(mesh, pointsGroup, !0, !1, !1) : colored === PointColor.Random ? this._setPointsColorOrUV(mesh, pointsGroup, !0) : colored === PointColor.Stated ? this._setPointsColorOrUV(mesh, pointsGroup, !0, void 0, void 0, color, range) : void 0, (this.nbParticles += nb, this._groupCounter++, this._groupCounter - 1);}setParticles(start = 0, end = this.nbParticles - 1, update = !0) {var _a, _b;if (!this._updatable || !this._isReady) return this;this.beforeUpdateParticles(start, end, update);const rotMatrix = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0],mesh = this.mesh,colors32 = this._colors32,positions32 = this._positions32,uvs32 = this._uvs32,tempVectors = math_vector/* TmpVectors.Vector3 */.jp.Vector3,camAxisX = tempVectors[5].copyFromFloats(1, 0, 0),camAxisY = tempVectors[6].copyFromFloats(0, 1, 0),camAxisZ = tempVectors[7].copyFromFloats(0, 0, 1),minimum = tempVectors[8].setAll(Number.MAX_VALUE),maximum = tempVectors[9].setAll(-Number.MAX_VALUE);math_vector/* Matrix.IdentityToRef */.y3.IdentityToRef(rotMatrix);let idx = 0;if ((null === (_a = this.mesh) || void 0 === _a ? void 0 : _a.isFacetDataEnabled) && (this._computeBoundingBox = !0), end = end >= this.nbParticles ? this.nbParticles - 1 : end, this._computeBoundingBox && (0 != start || end != this.nbParticles - 1)) {const boundingInfo = null === (_b = this.mesh) || void 0 === _b ? void 0 : _b.getBoundingInfo();boundingInfo && (minimum.copyFrom(boundingInfo.minimum), maximum.copyFrom(boundingInfo.maximum));}idx = 0;let pindex = 0,cindex = 0,uindex = 0;for (let p = start; p <= end; p++) {const particle = this.particles[p];idx = particle.idx, pindex = 3 * idx, cindex = 4 * idx, uindex = 2 * idx, this.updateParticle(particle);const particleRotationMatrix = particle._rotationMatrix,particlePosition = particle.position,particleGlobalPosition = particle._globalPosition;this._computeParticleRotation && particle.getRotationMatrix(rotMatrix);const particleHasParent = null !== particle.parentId;if (particleHasParent) {const parent = this.particles[particle.parentId],parentRotationMatrix = parent._rotationMatrix,parentGlobalPosition = parent._globalPosition,rotatedY = particlePosition.x * parentRotationMatrix[1] + particlePosition.y * parentRotationMatrix[4] + particlePosition.z * parentRotationMatrix[7],rotatedX = particlePosition.x * parentRotationMatrix[0] + particlePosition.y * parentRotationMatrix[3] + particlePosition.z * parentRotationMatrix[6],rotatedZ = particlePosition.x * parentRotationMatrix[2] + particlePosition.y * parentRotationMatrix[5] + particlePosition.z * parentRotationMatrix[8];if (particleGlobalPosition.x = parentGlobalPosition.x + rotatedX, particleGlobalPosition.y = parentGlobalPosition.y + rotatedY, particleGlobalPosition.z = parentGlobalPosition.z + rotatedZ, this._computeParticleRotation) {const rotMatrixValues = rotMatrix.m;particleRotationMatrix[0] = rotMatrixValues[0] * parentRotationMatrix[0] + rotMatrixValues[1] * parentRotationMatrix[3] + rotMatrixValues[2] * parentRotationMatrix[6], particleRotationMatrix[1] = rotMatrixValues[0] * parentRotationMatrix[1] + rotMatrixValues[1] * parentRotationMatrix[4] + rotMatrixValues[2] * parentRotationMatrix[7], particleRotationMatrix[2] = rotMatrixValues[0] * parentRotationMatrix[2] + rotMatrixValues[1] * parentRotationMatrix[5] + rotMatrixValues[2] * parentRotationMatrix[8], particleRotationMatrix[3] = rotMatrixValues[4] * parentRotationMatrix[0] + rotMatrixValues[5] * parentRotationMatrix[3] + rotMatrixValues[6] * parentRotationMatrix[6], particleRotationMatrix[4] = rotMatrixValues[4] * parentRotationMatrix[1] + rotMatrixValues[5] * parentRotationMatrix[4] + rotMatrixValues[6] * parentRotationMatrix[7], particleRotationMatrix[5] = rotMatrixValues[4] * parentRotationMatrix[2] + rotMatrixValues[5] * parentRotationMatrix[5] + rotMatrixValues[6] * parentRotationMatrix[8], particleRotationMatrix[6] = rotMatrixValues[8] * parentRotationMatrix[0] + rotMatrixValues[9] * parentRotationMatrix[3] + rotMatrixValues[10] * parentRotationMatrix[6], particleRotationMatrix[7] = rotMatrixValues[8] * parentRotationMatrix[1] + rotMatrixValues[9] * parentRotationMatrix[4] + rotMatrixValues[10] * parentRotationMatrix[7], particleRotationMatrix[8] = rotMatrixValues[8] * parentRotationMatrix[2] + rotMatrixValues[9] * parentRotationMatrix[5] + rotMatrixValues[10] * parentRotationMatrix[8];}} else if (particleGlobalPosition.x = 0, particleGlobalPosition.y = 0, particleGlobalPosition.z = 0, this._computeParticleRotation) {const rotMatrixValues = rotMatrix.m;particleRotationMatrix[0] = rotMatrixValues[0], particleRotationMatrix[1] = rotMatrixValues[1], particleRotationMatrix[2] = rotMatrixValues[2], particleRotationMatrix[3] = rotMatrixValues[4], particleRotationMatrix[4] = rotMatrixValues[5], particleRotationMatrix[5] = rotMatrixValues[6], particleRotationMatrix[6] = rotMatrixValues[8], particleRotationMatrix[7] = rotMatrixValues[9], particleRotationMatrix[8] = rotMatrixValues[10];}const pivotBackTranslation = tempVectors[11];particle.translateFromPivot ? pivotBackTranslation.setAll(0) : pivotBackTranslation.copyFrom(particle.pivot);const tmpVertex = tempVectors[0];tmpVertex.copyFrom(particle.position);const vertexX = tmpVertex.x - particle.pivot.x,vertexY = tmpVertex.y - particle.pivot.y,vertexZ = tmpVertex.z - particle.pivot.z;let rotatedX = vertexX * particleRotationMatrix[0] + vertexY * particleRotationMatrix[3] + vertexZ * particleRotationMatrix[6],rotatedY = vertexX * particleRotationMatrix[1] + vertexY * particleRotationMatrix[4] + vertexZ * particleRotationMatrix[7],rotatedZ = vertexX * particleRotationMatrix[2] + vertexY * particleRotationMatrix[5] + vertexZ * particleRotationMatrix[8];rotatedX += pivotBackTranslation.x, rotatedY += pivotBackTranslation.y, rotatedZ += pivotBackTranslation.z;const px = positions32[pindex] = particleGlobalPosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ,py = positions32[pindex + 1] = particleGlobalPosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ,pz = positions32[pindex + 2] = particleGlobalPosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ;if (this._computeBoundingBox && (minimum.minimizeInPlaceFromFloats(px, py, pz), maximum.maximizeInPlaceFromFloats(px, py, pz)), this._computeParticleColor && particle.color) {const color = particle.color,colors32 = this._colors32;colors32[cindex] = color.r, colors32[cindex + 1] = color.g, colors32[cindex + 2] = color.b, colors32[cindex + 3] = color.a;}if (this._computeParticleTexture && particle.uv) {const uv = particle.uv,uvs32 = this._uvs32;uvs32[uindex] = uv.x, uvs32[uindex + 1] = uv.y;}}return mesh && (update && (this._computeParticleColor && mesh.updateVerticesData(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, colors32, !1, !1), this._computeParticleTexture && mesh.updateVerticesData(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind, uvs32, !1, !1), mesh.updateVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, positions32, !1, !1)), this._computeBoundingBox && (mesh.hasBoundingInfo ? mesh.getBoundingInfo().reConstruct(minimum, maximum, mesh._worldMatrix) : mesh.buildBoundingInfo(minimum, maximum, mesh._worldMatrix))), this.afterUpdateParticles(start, end, update), this;}dispose() {var _a;null === (_a = this.mesh) || void 0 === _a ? void 0 : _a.dispose(), this.vars = null, this._positions = null, this._indices = null, this._normals = null, this._uvs = null, this._colors = null, this._indices32 = null, this._positions32 = null, this._uvs32 = null, this._colors32 = null;}refreshVisibleSize() {var _a;return this._isVisibilityBoxLocked || (null === (_a = this.mesh) || void 0 === _a ? void 0 : _a.refreshBoundingInfo()), this;}setVisibilityBox(size) {if (this.mesh) {const vis = size / 2;this.mesh.buildBoundingInfo(new math_vector/* Vector3 */.P(-vis, -vis, -vis), new math_vector/* Vector3 */.P(vis, vis, vis));}}get isAlwaysVisible() {return this._alwaysVisible;}set isAlwaysVisible(val) {this.mesh && (this._alwaysVisible = val, this.mesh.alwaysSelectAsActiveMesh = val);}set computeParticleRotation(val) {this._computeParticleRotation = val;}set computeParticleColor(val) {this._computeParticleColor = val;}set computeParticleTexture(val) {this._computeParticleTexture = val;}get computeParticleColor() {return this._computeParticleColor;}get computeParticleTexture() {return this._computeParticleTexture;}set computeBoundingBox(val) {this._computeBoundingBox = val;}get computeBoundingBox() {return this._computeBoundingBox;}initParticles() {}recycleParticle(particle) {return particle;}updateParticle(particle) {return particle;}beforeUpdateParticles() {}afterUpdateParticles() {}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Particles/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/IPhysicsEnginePlugin.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/physicsEngineComponent.js
Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "physicsImpostor", { get: function () {return this._physicsImpostor;}, set: function (value) {this._physicsImpostor === value || (this._disposePhysicsObserver && this.onDisposeObservable.remove(this._disposePhysicsObserver), this._physicsImpostor = value, value && (this._disposePhysicsObserver = this.onDisposeObservable.add(() => {this.physicsImpostor && (this.physicsImpostor.dispose(), this.physicsImpostor = null);})));}, enumerable: !0, configurable: !0 }), abstractMesh/* AbstractMesh.prototype.getPhysicsImpostor */.x.prototype.getPhysicsImpostor = function () {return this.physicsImpostor;}, abstractMesh/* AbstractMesh.prototype.applyImpulse */.x.prototype.applyImpulse = function (force, contactPoint) {return this.physicsImpostor ? (this.physicsImpostor.applyImpulse(force, contactPoint), this) : this;}, abstractMesh/* AbstractMesh.prototype.setPhysicsLinkWith */.x.prototype.setPhysicsLinkWith = function (otherMesh, pivot1, pivot2, options) {return this.physicsImpostor && otherMesh.physicsImpostor ? (this.physicsImpostor.createJoint(otherMesh.physicsImpostor, PhysicsJoint.HingeJoint, { mainPivot: pivot1, connectedPivot: pivot2, nativeParams: options }), this) : this;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/Plugins/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v1/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v2/physicsEngine.js
class physicsEngine_PhysicsEngine {getPluginVersion() {return this._physicsPlugin.getPluginVersion();}static DefaultPluginFactory() {throw (0,devTools/* _WarnImport */.S)("");}constructor(gravity, _physicsPlugin = physicsEngine_PhysicsEngine.DefaultPluginFactory()) {this._physicsPlugin = _physicsPlugin, this._physicsBodies = [], this._subTimeStep = 0, gravity = gravity || new math_vector/* Vector3 */.P(0, -9.807, 0), this.setGravity(gravity), this.setTimeStep();}setGravity(gravity) {this.gravity = gravity, this._physicsPlugin.setGravity(this.gravity);}setTimeStep(newTimeStep = 1 / 60) {this._physicsPlugin.setTimeStep(newTimeStep);}getTimeStep() {return this._physicsPlugin.getTimeStep();}setSubTimeStep(subTimeStep = 0) {this._subTimeStep = subTimeStep;}getSubTimeStep() {return this._subTimeStep;}dispose() {this._physicsPlugin.dispose();}getPhysicsPluginName() {return this._physicsPlugin.name;}_step(delta) {.1 < delta ? delta = .1 : 0 >= delta && (delta = 1 / 60), this._physicsPlugin.executeStep(delta, this._physicsBodies);}addBody(physicsBody) {this._physicsBodies.push(physicsBody);}removeBody(physicsBody) {const index = this._physicsBodies.indexOf(physicsBody);-1 < index && this._physicsBodies.splice(index, 1);}getBodies() {return this._physicsBodies;}getPhysicsPlugin() {return this._physicsPlugin;}raycastToRef(from, to, result) {this._physicsPlugin.raycast(from, to, result);}raycast(from, to) {const result = new PhysicsRaycastResult();return this._physicsPlugin.raycast(from, to, result), result;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v2/physicsBody.js
class PhysicsBody {constructor(transformNode, scene) {if (this._pluginData = void 0, this._pluginDataInstances = [], this.disablePreStep = !0, !!scene) {const physicsEngine = scene.getPhysicsEngine();if (!physicsEngine) throw new Error("No Physics Engine available.");if (this._physicsEngine = physicsEngine, 2 != physicsEngine.getPluginVersion()) throw new Error("Plugin version is incorrect. Expected version 2.");const physicsPlugin = physicsEngine.getPhysicsPlugin();if (!physicsPlugin) throw new Error("No Physics Plugin available.");this._physicsPlugin = physicsPlugin, transformNode.rotationQuaternion || (transformNode.rotationQuaternion = math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(transformNode.rotation.x, transformNode.rotation.y, transformNode.rotation.z));const m = transformNode;m.hasThinInstances ? this._physicsPlugin.initBodyInstances(this, m) : this._physicsPlugin.initBody(this, transformNode.position, transformNode.rotationQuaternion), this.transformNode = transformNode, transformNode.physicsBody = this, physicsEngine.addBody(this);}}setShape(shape) {this._physicsPlugin.setShape(this, shape);}getShape() {return this._physicsPlugin.getShape(this);}setFilterGroup(group) {this._physicsPlugin.setFilterGroup(this, group);}getFilterGroup() {return this._physicsPlugin.getFilterGroup(this);}setEventMask(eventMask) {this._physicsPlugin.setEventMask(this, eventMask);}getEventMask() {return this._physicsPlugin.getEventMask(this);}setMassProperties(massProps) {this._physicsPlugin.setMassProperties(this, massProps);}getMassProperties() {return this._physicsPlugin.getMassProperties(this);}setLinearDamping(damping) {this._physicsPlugin.setLinearDamping(this, damping);}getLinearDamping() {return this._physicsPlugin.getLinearDamping(this);}setAngularDamping(damping) {this._physicsPlugin.setAngularDamping(this, damping);}getAngularDamping() {return this._physicsPlugin.getAngularDamping(this);}setLinearVelocity(linVel) {this._physicsPlugin.setLinearVelocity(this, linVel);}getLinearVelocityToRef(linVel) {return this._physicsPlugin.getLinearVelocityToRef(this, linVel);}setAngularVelocity(angVel) {this._physicsPlugin.setAngularVelocity(this, angVel);}getAngularVelocityToRef(angVel) {return this._physicsPlugin.getAngularVelocityToRef(this, angVel);}applyImpulse(location, impulse) {this._physicsPlugin.applyImpulse(this, location, impulse);}applyForce(location, force) {this._physicsPlugin.applyForce(this, location, force);}getGeometry() {return this._physicsPlugin.getBodyGeometry(this);}registerOnCollide(func) {return this._physicsPlugin.registerOnBodyCollide(this, func);}unregisterOnCollide(func) {return this._physicsPlugin.unregisterOnBodyCollide(this, func);}getObjectExtents() {const tmAbstractMesh = this.transformNode;if (tmAbstractMesh.getBoundingInfo) {const q = this.transformNode.rotationQuaternion,scaling = this.transformNode.scaling.clone();this.transformNode.rotationQuaternion = PhysicsBody._IDENTITY_QUATERNION;const worldMatrix = this.transformNode.computeWorldMatrix && this.transformNode.computeWorldMatrix(!0);worldMatrix && worldMatrix.decompose(scaling, void 0, void 0);const boundingInfo = tmAbstractMesh.getBoundingInfo(),size = boundingInfo.boundingBox.extendSize.scale(2).multiplyInPlace(scaling);return size.x = Math.abs(size.x), size.y = Math.abs(size.y), size.z = Math.abs(size.z), this.transformNode.rotationQuaternion = q, this.transformNode.computeWorldMatrix && this.transformNode.computeWorldMatrix(!0), size;}return PhysicsBody._DEFAULT_OBJECT_SIZE;}getObjectCenter() {return new math_vector/* Vector3 */.P(0, 0, 0);}addConstraint(childBody, constraint) {this._physicsPlugin.addConstraint(this, childBody, constraint);}dispose() {this._physicsEngine.removeBody(this), this._physicsPlugin.removeBody(this), this._physicsPlugin.disposeBody(this), this._pluginData = null, this._pluginDataInstances.length = 0;}}PhysicsBody._DEFAULT_OBJECT_SIZE = new math_vector/* Vector3 */.P(1, 1, 1), PhysicsBody._IDENTITY_QUATERNION = math_vector/* Quaternion.Identity */._f.Identity();
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v2/IPhysicsEnginePlugin.js
var ConstraintAxisLimitMode;(function (ConstraintAxisLimitMode) {ConstraintAxisLimitMode[ConstraintAxisLimitMode.FREE = 0] = "FREE", ConstraintAxisLimitMode[ConstraintAxisLimitMode.LIMITED = 1] = "LIMITED", ConstraintAxisLimitMode[ConstraintAxisLimitMode.LOCKED = 2] = "LOCKED", ConstraintAxisLimitMode[ConstraintAxisLimitMode.NONE = 3] = "NONE";})(ConstraintAxisLimitMode || (ConstraintAxisLimitMode = {}));var ConstraintAxis;(function (ConstraintAxis) {ConstraintAxis[ConstraintAxis.LINEAR_X = 0] = "LINEAR_X", ConstraintAxis[ConstraintAxis.LINEAR_Y = 1] = "LINEAR_Y", ConstraintAxis[ConstraintAxis.LINEAR_Z = 2] = "LINEAR_Z", ConstraintAxis[ConstraintAxis.ANGULAR_X = 3] = "ANGULAR_X", ConstraintAxis[ConstraintAxis.ANGULAR_Y = 4] = "ANGULAR_Y", ConstraintAxis[ConstraintAxis.ANGULAR_Z = 5] = "ANGULAR_Z", ConstraintAxis[ConstraintAxis.LINEAR_DISTANCE = 6] = "LINEAR_DISTANCE";})(ConstraintAxis || (ConstraintAxis = {}));var ConstraintType;(function (ConstraintType) {ConstraintType[ConstraintType.BALL_AND_SOCKET = 0] = "BALL_AND_SOCKET", ConstraintType[ConstraintType.DISTANCE = 1] = "DISTANCE", ConstraintType[ConstraintType.HINGE = 2] = "HINGE", ConstraintType[ConstraintType.SLIDER = 3] = "SLIDER", ConstraintType[ConstraintType.LOCK = 4] = "LOCK", ConstraintType[ConstraintType.PRISMATIC = 5] = "PRISMATIC";})(ConstraintType || (ConstraintType = {}));var ShapeType;(function (ShapeType) {ShapeType[ShapeType.SPHERE = 0] = "SPHERE", ShapeType[ShapeType.CAPSULE = 1] = "CAPSULE", ShapeType[ShapeType.CYLINDER = 2] = "CYLINDER", ShapeType[ShapeType.BOX = 3] = "BOX", ShapeType[ShapeType.CONVEX_HULL = 4] = "CONVEX_HULL", ShapeType[ShapeType.CONTAINER = 5] = "CONTAINER", ShapeType[ShapeType.MESH = 6] = "MESH", ShapeType[ShapeType.HEIGHTFIELD = 7] = "HEIGHTFIELD";})(ShapeType || (ShapeType = {}));var ConstraintMotorType;(function (ConstraintMotorType) {ConstraintMotorType[ConstraintMotorType.NONE = 0] = "NONE", ConstraintMotorType[ConstraintMotorType.VELOCITY = 1] = "VELOCITY", ConstraintMotorType[ConstraintMotorType.POSITION = 2] = "POSITION";})(ConstraintMotorType || (ConstraintMotorType = {}));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v2/physicsShape.js
class PhysicsShape {constructor(type, options = {}, scene) {if (this._pluginData = void 0, this._type = type, !!scene) {const physicsEngine = scene.getPhysicsEngine();if (!physicsEngine) throw new Error("No Physics Engine available.");if (2 != physicsEngine.getPluginVersion()) throw new Error("Plugin version is incorrect. Expected version 2.");const physicsPlugin = physicsEngine.getPhysicsPlugin();if (!physicsPlugin) throw new Error("No Physics Plugin available.");this._physicsPlugin = physicsPlugin, this._physicsPlugin.initShape(this, type, options);}}get type() {return this._type;}setFilterLayer(layer) {this._physicsPlugin.setFilterLayer(this, layer);}getFilterLayer() {return this._physicsPlugin.getFilterLayer(this);}setMaterial(material) {this._physicsPlugin.setMaterial(this, material);}getMaterial() {return this._physicsPlugin.getMaterial(this);}setDensity(density) {this._physicsPlugin.setDensity(this, density);}getDensity() {return this._physicsPlugin.getDensity(this);}addChild(newChild, childTransform) {this._physicsPlugin.addChild(this, newChild, childTransform);}removeChild(childIndex) {this._physicsPlugin.removeChild(this, childIndex);}getNumChildren() {return this._physicsPlugin.getNumChildren(this);}getBoundingBox() {return this._physicsPlugin.getBoundingBox(this);}dispose() {this._physicsPlugin.disposeShape(this);}}class PhysicsShapeSphere extends PhysicsShape {constructor(center, radius, scene) {super(ShapeType.SPHERE, { center: center, radius: radius }, scene);}}class PhysicsShapeCapsule extends PhysicsShape {constructor(pointA, pointB, radius, scene) {super(ShapeType.CAPSULE, { pointA: pointA, pointB: pointB, radius: radius }, scene);}}class PhysicsShapeCylinder extends PhysicsShape {constructor(pointA, pointB, radius, scene) {super(ShapeType.CYLINDER, { pointA: pointA, pointB: pointB, radius: radius }, scene);}}class PhysicsShapeBox extends PhysicsShape {constructor(center, rotation, extents, scene) {super(ShapeType.BOX, { center: center, rotation: rotation, extents: extents }, scene);}}class PhysicsShapeConvexHull extends PhysicsShape {constructor(mesh, scene) {super(ShapeType.CONVEX_HULL, { mesh: mesh }, scene);}}class PhysicsShapeMesh extends PhysicsShape {constructor(mesh, scene) {super(ShapeType.MESH, { mesh: mesh }, scene);}}class PhysicsShapeContainer extends PhysicsShape {constructor(scene) {super(ShapeType.CONTAINER, {}, scene);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v2/physicsConstraint.js
class PhysicsConstraint {constructor(type, options, scene) {if (this._pluginData = void 0, !!scene) {const physicsEngine = scene.getPhysicsEngine();if (!physicsEngine) throw new Error("No Physics Engine available.");if (2 != physicsEngine.getPluginVersion()) throw new Error("Plugin version is incorrect. Expected version 2.");const physicsPlugin = physicsEngine.getPhysicsPlugin();if (!physicsPlugin) throw new Error("No Physics Plugin available.");this._physicsPlugin = physicsPlugin, this._options = options, this._type = type;}}getType() {return this._type;}getOptions() {return this._options;}setEnabled(isEnabled) {this._physicsPlugin.setEnabled(this, isEnabled);}getEnabled() {return this._physicsPlugin.getEnabled(this);}setCollisionsEnabled(isEnabled) {this._physicsPlugin.setCollisionsEnabled(this, isEnabled);}getCollisionsEnabled() {return this._physicsPlugin.getCollisionsEnabled(this);}setAxisFriction(axis, friction) {this._physicsPlugin.setAxisFriction(this, axis, friction);}getAxisFriction(axis) {return this._physicsPlugin.getAxisFriction(this, axis);}setAxisMode(axis, limitMode) {this._physicsPlugin.setAxisMode(this, axis, limitMode);}getAxisMode(axis) {return this._physicsPlugin.getAxisMode(this, axis);}setAxisMinLimit(axis, minLimit) {this._physicsPlugin.setAxisMinLimit(this, axis, minLimit);}getAxisMinLimit(axis) {return this._physicsPlugin.getAxisMinLimit(this, axis);}setAxisMaxLimit(axis, limit) {this._physicsPlugin.setAxisMaxLimit(this, axis, limit);}getAxisMaxLimit(axis) {return this._physicsPlugin.getAxisMaxLimit(this, axis);}setAxisMotorType(axis, motorType) {this._physicsPlugin.setAxisMotorType(this, axis, motorType);}getAxisMotorType(axis) {return this._physicsPlugin.getAxisMotorType(this, axis);}setAxisMotorTarget(axis, target) {this._physicsPlugin.setAxisMotorTarget(this, axis, target);}getAxisMotorTarget(axis) {return this._physicsPlugin.getAxisMotorTarget(this, axis);}setAxisMotorMaxForce(axis, maxForce) {this._physicsPlugin.setAxisMotorMaxForce(this, axis, maxForce);}getAxisMotorMaxForce(axis) {return this._physicsPlugin.getAxisMotorMaxForce(this, axis);}dispose() {this._physicsPlugin.disposeConstraint(this);}}class BallAndSocketConstraint extends PhysicsConstraint {constructor(pivotA, pivotB, axisA, axisB, scene) {super(ConstraintType.BALL_AND_SOCKET, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);}}class DistanceConstraint extends PhysicsConstraint {constructor(maxDistance, scene) {super(ConstraintType.DISTANCE, { maxDistance: maxDistance }, scene);}}class HingeConstraint extends PhysicsConstraint {constructor(pivotA, pivotB, axisA, axisB, scene) {super(ConstraintType.HINGE, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);}}class SliderConstraint extends PhysicsConstraint {constructor(pivotA, pivotB, axisA, axisB, scene) {super(ConstraintType.SLIDER, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);}}class LockConstraint extends PhysicsConstraint {constructor(pivotA, pivotB, axisA, axisB, scene) {super(ConstraintType.LOCK, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);}}class PrismaticConstraint extends PhysicsConstraint {constructor(pivotA, pivotB, axisA, axisB, scene) {super(ConstraintType.PRISMATIC, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v2/physicsMaterial.js
class PhysicsMaterial {constructor(friction, restitution, scene) {this._pluginData = void 0;const physicsEngine = scene.getPhysicsEngine();if (!physicsEngine) throw new Error("No Physics Engine available.");if (2 != physicsEngine.getPluginVersion()) throw new Error("Plugin version is incorrect. Expected version 2.");const physicsPlugin = physicsEngine.getPhysicsPlugin();if (!physicsPlugin) throw new Error("No Physics Plugin available.");this._physicsPlugin = physicsPlugin, this._physicsPlugin.initMaterial(this);}setFriction(friction) {this._physicsPlugin.setFriction(this, friction);}getFriction() {return this._physicsPlugin.getFriction(this);}setRestitution(restitution) {this._physicsPlugin.setRestitution(this, restitution);}getRestitution() {return this._physicsPlugin.getRestitution(this);}dispose() {this._physicsPlugin.disposeMaterial(this);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v2/physicsAggregate.js
class PhysicsAggregate {constructor(transformNode, type, _options = { mass: 0 }, _scene) {return (this.transformNode = transformNode, this.type = type, this._options = _options, this._scene = _scene, !this.transformNode) ? void logger/* Logger.Error */.Y.Error("No object was provided. A physics object is obligatory") : void (this.transformNode.parent && 0 !== this._options.mass && logger/* Logger.Warn */.Y.Warn("A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur."), !this._scene && transformNode.getScene && (this._scene = transformNode.getScene()), this._scene && (this._options.mass = void 0 === _options.mass ? 0 : _options.mass, this._options.friction = void 0 === _options.friction ? .2 : _options.friction, this._options.restitution = void 0 === _options.restitution ? .2 : _options.restitution, this.body = new PhysicsBody(transformNode, this._scene), this._addSizeOptions(), this.shape = new PhysicsShape(type, this._options, this._scene), this.material = new PhysicsMaterial(this._options.friction, this._options.restitution, this._scene), this.body.setShape(this.shape), this.shape.setMaterial(this.material), this.body.setMassProperties({ centerOfMass: new math_vector/* Vector3 */.P(0, 0, 0), mass: this._options.mass, inertia: new math_vector/* Vector3 */.P(1, 1, 1), inertiaOrientation: math_vector/* Quaternion.Identity */._f.Identity() })));}_addSizeOptions() {var _a, _b, _c;const impostorExtents = this.body.getObjectExtents();switch (this.type) {case ShapeType.SPHERE:math_scalar/* Scalar.WithinEpsilon */.R.WithinEpsilon(impostorExtents.x, impostorExtents.y, 1e-4) && math_scalar/* Scalar.WithinEpsilon */.R.WithinEpsilon(impostorExtents.x, impostorExtents.z, 1e-4) ? this._options.radius = this._options.radius ? this._options.radius : impostorExtents.x / 2 : logger/* Logger.Warn */.Y.Warn("Non uniform scaling is unsupported for sphere shapes.");break;case ShapeType.CAPSULE:{const capRadius = impostorExtents.x / 2;this._options.radius = null !== (_a = this._options.radius) && void 0 !== _a ? _a : capRadius, this._options.pointA = null !== (_b = this._options.pointA) && void 0 !== _b ? _b : new math_vector/* Vector3 */.P(0, .5 * -impostorExtents.y + capRadius, 0), this._options.pointB = null !== (_c = this._options.pointB) && void 0 !== _c ? _c : new math_vector/* Vector3 */.P(0, .5 * impostorExtents.y - capRadius, 0);}break;case ShapeType.CYLINDER:{const capRadius = impostorExtents.x / 2;this._options.radius = this._options.radius ? this._options.radius : capRadius, this._options.pointA = this._options.pointA ? this._options.pointA : new math_vector/* Vector3 */.P(0, .5 * -impostorExtents.y, 0), this._options.pointB = this._options.pointB ? this._options.pointB : new math_vector/* Vector3 */.P(0, .5 * impostorExtents.y, 0);}break;case ShapeType.BOX:this._options.extents = this._options.extents ? this._options.extents : new math_vector/* Vector3 */.P(impostorExtents.x, impostorExtents.y, impostorExtents.z);break;case ShapeType.MESH:case ShapeType.CONVEX_HULL:}}dispose() {this.body.dispose(), this.material.dispose(), this.shape.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/v2/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/joinedPhysicsEngineComponent.js
core_scene/* Scene.prototype.getPhysicsEngine */.x.prototype.getPhysicsEngine = function () {return this._physicsEngine;}, core_scene/* Scene.prototype.enablePhysics */.x.prototype.enablePhysics = function (gravity = null, plugin) {if (this._physicsEngine) return !0;let component = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_PHYSICSENGINE */.l.NAME_PHYSICSENGINE);component || (component = new PhysicsEngineSceneComponent(this), this._addComponent(component));try {if (!plugin || 1 === (null === plugin || void 0 === plugin ? void 0 : plugin.getPluginVersion())) this._physicsEngine = new PhysicsEngine(gravity, plugin);else if (2 === (null === plugin || void 0 === plugin ? void 0 : plugin.getPluginVersion())) this._physicsEngine = new physicsEngine_PhysicsEngine(gravity, plugin);else throw new Error("Unsupported Physics plugin version.");return this._physicsTimeAccumulator = 0, !0;} catch (e) {return logger/* Logger.Error */.Y.Error(e.message), !1;}}, core_scene/* Scene.prototype.disablePhysicsEngine */.x.prototype.disablePhysicsEngine = function () {this._physicsEngine && (this._physicsEngine.dispose(), this._physicsEngine = null);}, core_scene/* Scene.prototype.isPhysicsEnabled */.x.prototype.isPhysicsEnabled = function () {return this._physicsEngine !== void 0;}, core_scene/* Scene.prototype.deleteCompoundImpostor */.x.prototype.deleteCompoundImpostor = function (compound) {const mesh = compound.parts[0].mesh;mesh.physicsImpostor && (mesh.physicsImpostor.dispose(), mesh.physicsImpostor = null);}, core_scene/* Scene.prototype._advancePhysicsEngineStep */.x.prototype._advancePhysicsEngineStep = function (step) {if (this._physicsEngine) {const subTime = this._physicsEngine.getSubTimeStep();if (0 < subTime) for (this._physicsTimeAccumulator += step; this._physicsTimeAccumulator > subTime;) this.onBeforePhysicsObservable.notifyObservers(this), this._physicsEngine._step(subTime / 1e3), this.onAfterPhysicsObservable.notifyObservers(this), this._physicsTimeAccumulator -= subTime;else this.onBeforePhysicsObservable.notifyObservers(this), this._physicsEngine._step(step / 1e3), this.onAfterPhysicsObservable.notifyObservers(this);}};class PhysicsEngineSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_PHYSICSENGINE */.l.NAME_PHYSICSENGINE, this.scene = scene, this.scene.onBeforePhysicsObservable = new observable/* Observable */.y$(), this.scene.onAfterPhysicsObservable = new observable/* Observable */.y$(), this.scene.getDeterministicFrameTime = () => this.scene._physicsEngine ? 1e3 * this.scene._physicsEngine.getTimeStep() : 1e3 / 60;}register() {}rebuild() {}dispose() {this.scene.onBeforePhysicsObservable.clear(), this.scene.onAfterPhysicsObservable.clear(), this.scene._physicsEngine && this.scene.disablePhysicsEngine();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/physicsEngineComponent.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/physicsHelper.js
class PhysicsHelper {constructor(scene) {if (this._hitData = { force: new math_vector/* Vector3 */.P(), contactPoint: new math_vector/* Vector3 */.P(), distanceFromOrigin: 0 }, this._scene = scene, this._physicsEngine = this._scene.getPhysicsEngine(), !this._physicsEngine) return void logger/* Logger.Warn */.Y.Warn("Physics engine not enabled. Please enable the physics before you can use the methods.");}applyRadialExplosionImpulse(origin, radiusOrEventOptions, strength, falloff) {if (!this._physicsEngine) return logger/* Logger.Warn */.Y.Warn("Physics engine not enabled. Please enable the physics before you call this method."), null;if (1 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getImpostors().length) return null;if (2 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getBodies().length) return null;let useCallback = !1;if ("number" == typeof radiusOrEventOptions) {const r = radiusOrEventOptions;radiusOrEventOptions = new PhysicsRadialExplosionEventOptions(), radiusOrEventOptions.radius = r, radiusOrEventOptions.strength = null !== strength && void 0 !== strength ? strength : radiusOrEventOptions.strength, radiusOrEventOptions.falloff = null !== falloff && void 0 !== falloff ? falloff : radiusOrEventOptions.falloff;} else useCallback = !!(radiusOrEventOptions.affectedImpostorsCallback || radiusOrEventOptions.affectedBodiesCallback);const event = new PhysicsRadialExplosionEvent(this._scene, radiusOrEventOptions),hitData = this._hitData;if (1 === this._physicsEngine.getPluginVersion()) {const affectedImpostorsWithData = [],impostors = this._physicsEngine.getImpostors();impostors.forEach((impostor) => {event.getImpostorHitData(impostor, origin, hitData) && (impostor.applyImpulse(hitData.force, hitData.contactPoint), useCallback && affectedImpostorsWithData.push({ impostor: impostor, hitData: this._copyPhysicsHitData(hitData) }));}), event.triggerAffectedImpostorsCallback(affectedImpostorsWithData);} else {const affectedBodiesWithData = [],bodies = this._physicsEngine.getBodies();bodies.forEach((body) => {event.getBodyHitData(body, origin, hitData) && (body.applyImpulse(hitData.force, hitData.contactPoint), useCallback && affectedBodiesWithData.push({ body: body, hitData: this._copyPhysicsHitData(hitData) }));}), event.triggerAffectedBodiesCallback(affectedBodiesWithData);}return event.dispose(!1), event;}applyRadialExplosionForce(origin, radiusOrEventOptions, strength, falloff) {if (!this._physicsEngine) return logger/* Logger.Warn */.Y.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;if (1 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getImpostors().length) return null;if (2 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getBodies().length) return null;let useCallback = !1;if ("number" == typeof radiusOrEventOptions) {const r = radiusOrEventOptions;radiusOrEventOptions = new PhysicsRadialExplosionEventOptions(), radiusOrEventOptions.radius = r, radiusOrEventOptions.strength = null !== strength && void 0 !== strength ? strength : radiusOrEventOptions.strength, radiusOrEventOptions.falloff = null !== falloff && void 0 !== falloff ? falloff : radiusOrEventOptions.falloff;} else useCallback = !!(radiusOrEventOptions.affectedImpostorsCallback || radiusOrEventOptions.affectedBodiesCallback);const event = new PhysicsRadialExplosionEvent(this._scene, radiusOrEventOptions),hitData = this._hitData;if (1 === this._physicsEngine.getPluginVersion()) {const affectedImpostorsWithData = [],impostors = this._physicsEngine.getImpostors();impostors.forEach((impostor) => {event.getImpostorHitData(impostor, origin, hitData) && (impostor.applyForce(hitData.force, hitData.contactPoint), useCallback && affectedImpostorsWithData.push({ impostor: impostor, hitData: this._copyPhysicsHitData(hitData) }));}), event.triggerAffectedImpostorsCallback(affectedImpostorsWithData);} else {const affectedBodiesWithData = [],bodies = this._physicsEngine.getBodies();bodies.forEach((body) => {event.getBodyHitData(body, origin, hitData) && (body.applyForce(hitData.force, hitData.contactPoint), useCallback && affectedBodiesWithData.push({ body: body, hitData: this._copyPhysicsHitData(hitData) }));}), event.triggerAffectedBodiesCallback(affectedBodiesWithData);}return event.dispose(!1), event;}gravitationalField(origin, radiusOrEventOptions, strength, falloff) {if (!this._physicsEngine) return logger/* Logger.Warn */.Y.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;if (1 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getImpostors().length) return null;if (2 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getBodies().length) return null;if ("number" == typeof radiusOrEventOptions) {const r = radiusOrEventOptions;radiusOrEventOptions = new PhysicsRadialExplosionEventOptions(), radiusOrEventOptions.radius = r, radiusOrEventOptions.strength = null !== strength && void 0 !== strength ? strength : radiusOrEventOptions.strength, radiusOrEventOptions.falloff = null !== falloff && void 0 !== falloff ? falloff : radiusOrEventOptions.falloff;}const event = new PhysicsGravitationalFieldEvent(this, this._scene, origin, radiusOrEventOptions);return event.dispose(!1), event;}updraft(origin, radiusOrEventOptions, strength, height, updraftMode) {if (!this._physicsEngine) return logger/* Logger.Warn */.Y.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;if (1 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getImpostors().length) return null;if (2 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getBodies().length) return null;if ("number" == typeof radiusOrEventOptions) {const r = radiusOrEventOptions;radiusOrEventOptions = new PhysicsUpdraftEventOptions(), radiusOrEventOptions.radius = r, radiusOrEventOptions.strength = null !== strength && void 0 !== strength ? strength : radiusOrEventOptions.strength, radiusOrEventOptions.height = null !== height && void 0 !== height ? height : radiusOrEventOptions.height, radiusOrEventOptions.updraftMode = null !== updraftMode && void 0 !== updraftMode ? updraftMode : radiusOrEventOptions.updraftMode;}const event = new PhysicsUpdraftEvent(this._scene, origin, radiusOrEventOptions);return event.dispose(!1), event;}vortex(origin, radiusOrEventOptions, strength, height) {if (!this._physicsEngine) return logger/* Logger.Warn */.Y.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;if (1 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getImpostors().length) return null;if (2 === this._physicsEngine.getPluginVersion() && 0 === this._physicsEngine.getBodies().length) return null;if ("number" == typeof radiusOrEventOptions) {const r = radiusOrEventOptions;radiusOrEventOptions = new PhysicsVortexEventOptions(), radiusOrEventOptions.radius = r, radiusOrEventOptions.strength = null !== strength && void 0 !== strength ? strength : radiusOrEventOptions.strength, radiusOrEventOptions.height = null !== height && void 0 !== height ? height : radiusOrEventOptions.height;}const event = new PhysicsVortexEvent(this._scene, origin, radiusOrEventOptions);return event.dispose(!1), event;}_copyPhysicsHitData(data) {return { force: data.force.clone(), contactPoint: data.contactPoint.clone(), distanceFromOrigin: data.distanceFromOrigin };}}class PhysicsRadialExplosionEvent {constructor(_scene, _options) {this._scene = _scene, this._options = _options, this._dataFetched = !1, this._options = { ...new PhysicsRadialExplosionEventOptions(), ...this._options };}getData() {return this._dataFetched = !0, { sphere: this._sphere };}_getHitData(mesh, center, origin, data) {const direction = center.subtract(origin),ray = new Ray(origin, direction, this._options.radius),hit = ray.intersectsMesh(mesh),contactPoint = hit.pickedPoint;if (!contactPoint) return !1;const distanceFromOrigin = math_vector/* Vector3.Distance */.P.Distance(origin, contactPoint);if (distanceFromOrigin > this._options.radius) return !1;const multiplier = this._options.falloff === PhysicsRadialImpulseFalloff.Constant ? this._options.strength : this._options.strength * (1 - distanceFromOrigin / this._options.radius),force = direction.multiplyByFloats(multiplier, multiplier, multiplier);return data.force = force, data.contactPoint = contactPoint, data.distanceFromOrigin = distanceFromOrigin, !0;}getBodyHitData(body, origin, data) {if ("Mesh" !== body.transformNode.getClassName() && "InstancedMesh" !== body.transformNode.getClassName()) return !1;const mesh = body.transformNode;if (!this._intersectsWithSphere(mesh, origin, this._options.radius)) return !1;const bodyObjectCenter = body.getObjectCenter();return this._getHitData(mesh, bodyObjectCenter, origin, data), !0;}getImpostorHitData(impostor, origin, data) {if (0 === impostor.mass) return !1;if ("Mesh" !== impostor.object.getClassName() && "InstancedMesh" !== impostor.object.getClassName()) return !1;const mesh = impostor.object;if (!this._intersectsWithSphere(mesh, origin, this._options.radius)) return !1;const impostorObjectCenter = impostor.getObjectCenter();return this._getHitData(mesh, impostorObjectCenter, origin, data), !0;}triggerAffectedImpostorsCallback(affectedImpostorsWithData) {this._options.affectedImpostorsCallback && this._options.affectedImpostorsCallback(affectedImpostorsWithData);}triggerAffectedBodiesCallback(affectedBodiesWithData) {this._options.affectedBodiesCallback && this._options.affectedBodiesCallback(affectedBodiesWithData);}dispose(force = !0) {force ? this._sphere.dispose() : setTimeout(() => {this._dataFetched || this._sphere.dispose();}, 0);}_prepareSphere() {this._sphere || (this._sphere = CreateSphere("radialExplosionEventSphere", this._options.sphere, this._scene), this._sphere.isVisible = !1);}_intersectsWithSphere(mesh, origin, radius) {return this._prepareSphere(), this._sphere.position = origin, this._sphere.scaling.setAll(2 * radius), this._sphere._updateBoundingInfo(), this._sphere.computeWorldMatrix(!0), this._sphere.intersectsMesh(mesh, !0);}}class PhysicsGravitationalFieldEvent {constructor(_physicsHelper, _scene, _origin, _options) {this._physicsHelper = _physicsHelper, this._scene = _scene, this._origin = _origin, this._options = _options, this._dataFetched = !1, this._options = { ...new PhysicsRadialExplosionEventOptions(), ...this._options }, this._tickCallback = this._tick.bind(this), this._options.strength *= -1;}getData() {return this._dataFetched = !0, { sphere: this._sphere };}enable() {this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);}disable() {this._scene.unregisterBeforeRender(this._tickCallback);}dispose(force = !0) {force ? this._sphere.dispose() : setTimeout(() => {this._dataFetched || this._sphere.dispose();}, 0);}_tick() {if (this._sphere) this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);else {const radialExplosionEvent = this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);radialExplosionEvent && (this._sphere = radialExplosionEvent.getData().sphere.clone("radialExplosionEventSphereClone"));}}}class PhysicsUpdraftEvent {constructor(_scene, _origin, _options) {this._scene = _scene, this._origin = _origin, this._options = _options, this._originTop = math_vector/* Vector3.Zero */.P.Zero(), this._originDirection = math_vector/* Vector3.Zero */.P.Zero(), this._cylinderPosition = math_vector/* Vector3.Zero */.P.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._options = { ...new PhysicsUpdraftEventOptions(), ...this._options }, this._origin.addToRef(new math_vector/* Vector3 */.P(0, this._options.height / 2, 0), this._cylinderPosition), this._origin.addToRef(new math_vector/* Vector3 */.P(0, this._options.height, 0), this._originTop), this._options.updraftMode === PhysicsUpdraftMode.Perpendicular && (this._originDirection = this._origin.subtract(this._originTop).normalize()), this._tickCallback = this._tick.bind(this), this._prepareCylinder();}getData() {return this._dataFetched = !0, { cylinder: this._cylinder };}enable() {this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);}disable() {this._scene.unregisterBeforeRender(this._tickCallback);}dispose(force = !0) {this._cylinder && (force ? this._cylinder.dispose() : setTimeout(() => {this._dataFetched || this._cylinder.dispose();}, 0));}_getHitData(center, data) {let direction = this._options.updraftMode === PhysicsUpdraftMode.Perpendicular ? this._originDirection : center.subtract(this._originTop);const distanceFromOrigin = math_vector/* Vector3.Distance */.P.Distance(this._origin, center),multiplier = -1 * this._options.strength,force = direction.multiplyByFloats(multiplier, multiplier, multiplier);data.force = force, data.contactPoint = center, data.distanceFromOrigin = distanceFromOrigin;}_getBodyHitData(body, data) {if ("Mesh" !== body.transformNode.getClassName() && "InstancedMesh" !== body.transformNode.getClassName()) return !1;const bodyObject = body.transformNode;if (!this._intersectsWithCylinder(bodyObject)) return !1;const center = body.getObjectCenter();return this._getHitData(center, data), !0;}_getImpostorHitData(impostor, data) {if (0 === impostor.mass) return !1;const impostorObject = impostor.object;if (!this._intersectsWithCylinder(impostorObject)) return !1;const center = impostor.getObjectCenter();return this._getHitData(center, data), !0;}_tick() {const hitData = PhysicsUpdraftEvent.hitData;1 === this._physicsEngine.getPluginVersion() ? this._physicsEngine.getImpostors().forEach((impostor) => {this._getImpostorHitData(impostor, hitData) && impostor.applyForce(hitData.force, hitData.contactPoint);}) : this._physicsEngine.getBodies().forEach((body) => {this._getBodyHitData(body, hitData) && body.applyForce(hitData.force, hitData.contactPoint);});}_prepareCylinder() {this._cylinder || (this._cylinder = CreateCylinder("updraftEventCylinder", { height: this._options.height, diameter: 2 * this._options.radius }, this._scene), this._cylinder.isVisible = !1);}_intersectsWithCylinder(mesh) {return this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(mesh, !0);}}PhysicsUpdraftEvent.hitData = { force: new math_vector/* Vector3 */.P(), contactPoint: new math_vector/* Vector3 */.P(), distanceFromOrigin: 0 };class PhysicsVortexEvent {constructor(_scene, _origin, _options) {this._scene = _scene, this._origin = _origin, this._options = _options, this._originTop = math_vector/* Vector3.Zero */.P.Zero(), this._cylinderPosition = math_vector/* Vector3.Zero */.P.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._options = { ...new PhysicsVortexEventOptions(), ...this._options }, this._origin.addToRef(new math_vector/* Vector3 */.P(0, this._options.height / 2, 0), this._cylinderPosition), this._origin.addToRef(new math_vector/* Vector3 */.P(0, this._options.height, 0), this._originTop), this._tickCallback = this._tick.bind(this), this._prepareCylinder();}getData() {return this._dataFetched = !0, { cylinder: this._cylinder };}enable() {this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);}disable() {this._scene.unregisterBeforeRender(this._tickCallback);}dispose(force = !0) {force ? this._cylinder.dispose() : setTimeout(() => {this._dataFetched || this._cylinder.dispose();}, 0);}_getHitData(mesh, center, data) {const originOnPlane = PhysicsVortexEvent.originOnPlane;originOnPlane.set(this._origin.x, center.y, this._origin.z);const originToImpostorDirection = center.subtract(originOnPlane),ray = new Ray(originOnPlane, originToImpostorDirection, this._options.radius),hit = ray.intersectsMesh(mesh),contactPoint = hit.pickedPoint;if (!contactPoint) return !1;const absoluteDistanceFromOrigin = hit.distance / this._options.radius;let directionToOrigin = contactPoint.normalize();absoluteDistanceFromOrigin > this._options.centripetalForceThreshold && (directionToOrigin = directionToOrigin.negate());let forceX, forceY, forceZ;if (absoluteDistanceFromOrigin > this._options.centripetalForceThreshold) forceX = directionToOrigin.x * this._options.centripetalForceMultiplier, forceY = directionToOrigin.y * this._options.updraftForceMultiplier, forceZ = directionToOrigin.z * this._options.centripetalForceMultiplier;else {const perpendicularDirection = math_vector/* Vector3.Cross */.P.Cross(originOnPlane, center).normalize();forceX = (perpendicularDirection.x + directionToOrigin.x) * this._options.centrifugalForceMultiplier, forceY = this._originTop.y * this._options.updraftForceMultiplier, forceZ = (perpendicularDirection.z + directionToOrigin.z) * this._options.centrifugalForceMultiplier;}let force = new math_vector/* Vector3 */.P(forceX, forceY, forceZ);return force = force.multiplyByFloats(this._options.strength, this._options.strength, this._options.strength), data.force = force, data.contactPoint = center, data.distanceFromOrigin = absoluteDistanceFromOrigin, !0;}_getBodyHitData(body, data) {if ("Mesh" !== body.transformNode.getClassName() && "InstancedMesh" !== body.transformNode.getClassName()) return !1;const bodyObject = body.transformNode;if (!this._intersectsWithCylinder(bodyObject)) return !1;const bodyCenter = body.getObjectCenter();return this._getHitData(bodyObject, bodyCenter, data), !0;}_getImpostorHitData(impostor, data) {if (0 === impostor.mass) return !1;if ("Mesh" !== impostor.object.getClassName() && "InstancedMesh" !== impostor.object.getClassName()) return !1;const impostorObject = impostor.object;if (!this._intersectsWithCylinder(impostorObject)) return !1;const impostorObjectCenter = impostor.getObjectCenter();return this._getHitData(impostorObject, impostorObjectCenter, data), !0;}_tick() {const hitData = PhysicsVortexEvent.hitData;1 === this._physicsEngine.getPluginVersion() ? this._physicsEngine.getImpostors().forEach((impostor) => {this._getImpostorHitData(impostor, hitData) && impostor.applyForce(hitData.force, hitData.contactPoint);}) : this._physicsEngine.getBodies().forEach((body) => {this._getBodyHitData(body, hitData) && body.applyForce(hitData.force, hitData.contactPoint);});}_prepareCylinder() {this._cylinder || (this._cylinder = CreateCylinder("vortexEventCylinder", { height: this._options.height, diameter: 2 * this._options.radius }, this._scene), this._cylinder.isVisible = !1);}_intersectsWithCylinder(mesh) {return this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(mesh, !0);}}PhysicsVortexEvent.originOnPlane = math_vector/* Vector3.Zero */.P.Zero(), PhysicsVortexEvent.hitData = { force: new math_vector/* Vector3 */.P(), contactPoint: new math_vector/* Vector3 */.P(), distanceFromOrigin: 0 };class PhysicsRadialExplosionEventOptions {constructor() {this.radius = 5, this.strength = 10, this.falloff = PhysicsRadialImpulseFalloff.Constant, this.sphere = { segments: 32, diameter: 1 };}}class PhysicsUpdraftEventOptions {constructor() {this.radius = 5, this.strength = 10, this.height = 10, this.updraftMode = PhysicsUpdraftMode.Center;}}class PhysicsVortexEventOptions {constructor() {this.radius = 5, this.strength = 10, this.height = 10, this.centripetalForceThreshold = .7, this.centripetalForceMultiplier = 5, this.centrifugalForceMultiplier = .5, this.updraftForceMultiplier = .02;}}var PhysicsRadialImpulseFalloff;(function (PhysicsRadialImpulseFalloff) {PhysicsRadialImpulseFalloff[PhysicsRadialImpulseFalloff.Constant = 0] = "Constant", PhysicsRadialImpulseFalloff[PhysicsRadialImpulseFalloff.Linear = 1] = "Linear";})(PhysicsRadialImpulseFalloff || (PhysicsRadialImpulseFalloff = {}));var PhysicsUpdraftMode;(function (PhysicsUpdraftMode) {PhysicsUpdraftMode[PhysicsUpdraftMode.Center = 0] = "Center", PhysicsUpdraftMode[PhysicsUpdraftMode.Perpendicular = 1] = "Perpendicular";})(PhysicsUpdraftMode || (PhysicsUpdraftMode = {}));
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Physics/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/blackAndWhite.fragment.js
const blackAndWhite_fragment_name = "blackAndWhitePixelShader",blackAndWhite_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform float degree;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
vec3 color=texture2D(textureSampler,vUV).rgb;
float luminance=dot(color,vec3(0.3,0.59,0.11)); 
vec3 blackAndWhite=vec3(luminance,luminance,luminance);
gl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);
}`;shaderStore/* ShaderStore.ShadersStore.blackAndWhitePixelShader */.v.ShadersStore.blackAndWhitePixelShader = blackAndWhite_fragment_shader;const blackAndWhitePixelShader = { name: "blackAndWhitePixelShader", shader: blackAndWhite_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/blackAndWhitePostProcess.js
class BlackAndWhitePostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "BlackAndWhitePostProcess";}constructor(name, options, camera, samplingMode, engine, reusable) {super(name, "blackAndWhite", ["degree"], null, options, camera, samplingMode, engine, reusable), this.degree = 1, this.onApplyObservable.add((effect) => {effect.setFloat("degree", this.degree);});}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new BlackAndWhitePostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BlackAndWhitePostProcess.prototype, "degree", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.BlackAndWhitePostProcess", BlackAndWhitePostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderEffect.js
class PostProcessRenderEffect {constructor(engine, name, getPostProcesses, singleInstance) {this._name = name, this._singleInstance = singleInstance || !0, this._getPostProcesses = getPostProcesses, this._cameras = {}, this._indicesForCamera = {}, this._postProcesses = {};}get isSupported() {for (const index in this._postProcesses) if (Object.prototype.hasOwnProperty.call(this._postProcesses, index)) {const pps = this._postProcesses[index];for (let ppIndex = 0; ppIndex < pps.length; ppIndex++) if (!pps[ppIndex].isSupported) return !1;}return !0;}_update() {}_attachCameras(cameras) {let cameraKey;const cams = tools/* Tools.MakeArray */.w1.MakeArray(cameras || this._cameras);if (cams) for (let i = 0; i < cams.length; i++) {const camera = cams[i];if (!camera) continue;const cameraName = camera.name;if (cameraKey = this._singleInstance ? 0 : cameraName, !this._postProcesses[cameraKey]) {const postProcess = this._getPostProcesses();postProcess && (this._postProcesses[cameraKey] = Array.isArray(postProcess) ? postProcess : [postProcess]);}this._indicesForCamera[cameraName] || (this._indicesForCamera[cameraName] = []), this._postProcesses[cameraKey].forEach((postProcess) => {const index = camera.attachPostProcess(postProcess);this._indicesForCamera[cameraName].push(index);}), this._cameras[cameraName] || (this._cameras[cameraName] = camera);}}_detachCameras(cameras) {const cams = tools/* Tools.MakeArray */.w1.MakeArray(cameras || this._cameras);if (cams) for (let i = 0; i < cams.length; i++) {const camera = cams[i],cameraName = camera.name,postProcesses = this._postProcesses[this._singleInstance ? 0 : cameraName];postProcesses && postProcesses.forEach((postProcess) => {camera.detachPostProcess(postProcess);}), this._cameras[cameraName] && (this._cameras[cameraName] = null);}}_enable(cameras) {const cams = tools/* Tools.MakeArray */.w1.MakeArray(cameras || this._cameras);if (cams) for (let i = 0; i < cams.length; i++) {const camera = cams[i],cameraName = camera.name;for (let j = 0; j < this._indicesForCamera[cameraName].length; j++) (void 0 === camera._postProcesses[this._indicesForCamera[cameraName][j]] || null === camera._postProcesses[this._indicesForCamera[cameraName][j]]) && this._postProcesses[this._singleInstance ? 0 : cameraName].forEach((postProcess) => {cams[i].attachPostProcess(postProcess, this._indicesForCamera[cameraName][j]);});}}_disable(cameras) {const cams = tools/* Tools.MakeArray */.w1.MakeArray(cameras || this._cameras);if (cams) for (let i = 0; i < cams.length; i++) {const camera = cams[i],cameraName = camera.name;this._postProcesses[this._singleInstance ? 0 : cameraName].forEach((postProcess) => {camera.detachPostProcess(postProcess);});}}getPostProcesses(camera) {return this._singleInstance ? this._postProcesses[0] : camera ? this._postProcesses[camera.name] : null;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/extractHighlights.fragment.js
const extractHighlights_fragment_name = "extractHighlightsPixelShader",extractHighlights_fragment_shader = `#include<helperFunctions>
varying vec2 vUV;
uniform sampler2D textureSampler;
uniform float threshold;
uniform float exposure;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
gl_FragColor=texture2D(textureSampler,vUV);
float luma=dot(LuminanceEncodeApprox,gl_FragColor.rgb*exposure);
gl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;
}`;shaderStore/* ShaderStore.ShadersStore.extractHighlightsPixelShader */.v.ShadersStore.extractHighlightsPixelShader = extractHighlights_fragment_shader;const extractHighlightsPixelShader = { name: "extractHighlightsPixelShader", shader: extractHighlights_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/extractHighlightsPostProcess.js
class ExtractHighlightsPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "ExtractHighlightsPostProcess";}constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "extractHighlights", ["threshold", "exposure"], null, options, camera, samplingMode, engine, reusable, null, textureType, void 0, null, blockCompilation), this.threshold = .9, this._exposure = 1, this._inputPostProcess = null, this.onApplyObservable.add((effect) => {this.externalTextureSamplerBinding = !!this._inputPostProcess, this._inputPostProcess && effect.setTextureFromPostProcess("textureSampler", this._inputPostProcess), effect.setFloat("threshold", Math.pow(this.threshold, math_constants/* ToGammaSpace */.zp)), effect.setFloat("exposure", this._exposure);});}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ExtractHighlightsPostProcess.prototype, "threshold", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ExtractHighlightsPostProcess", ExtractHighlightsPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/bloomMerge.fragment.js
const bloomMerge_fragment_name = "bloomMergePixelShader",bloomMerge_fragment_shader = `uniform sampler2D textureSampler;
uniform sampler2D bloomBlur;
varying vec2 vUV;
uniform float bloomWeight;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
gl_FragColor=texture2D(textureSampler,vUV);
vec3 blurred=texture2D(bloomBlur,vUV).rgb;
gl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight); 
}
`;shaderStore/* ShaderStore.ShadersStore.bloomMergePixelShader */.v.ShadersStore.bloomMergePixelShader = bloomMerge_fragment_shader;const bloomMergePixelShader = { name: "bloomMergePixelShader", shader: bloomMerge_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/bloomMergePostProcess.js
class BloomMergePostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "BloomMergePostProcess";}constructor(name, originalFromInput, blurred, weight, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "bloomMerge", ["bloomWeight"], ["bloomBlur"], options, camera, samplingMode, engine, reusable, null, textureType, void 0, null, !0), this.weight = 1, this.weight = weight, this.externalTextureSamplerBinding = !0, this.onApplyObservable.add((effect) => {effect.setTextureFromPostProcess("textureSampler", originalFromInput), effect.setTextureFromPostProcessOutput("bloomBlur", blurred), effect.setFloat("bloomWeight", this.weight);}), blockCompilation || this.updateEffect();}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], BloomMergePostProcess.prototype, "weight", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.BloomMergePostProcess", BloomMergePostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/bloomEffect.js
class BloomEffect extends PostProcessRenderEffect {get threshold() {return this._downscale.threshold;}set threshold(value) {this._downscale.threshold = value;}get weight() {return this._merge.weight;}set weight(value) {this._merge.weight = value;}get kernel() {return this._blurX.kernel / this._bloomScale;}set kernel(value) {this._blurX.kernel = value * this._bloomScale, this._blurY.kernel = value * this._bloomScale;}constructor(scene, _bloomScale, bloomWeight, bloomKernel, pipelineTextureType = 0, blockCompilation = !1) {super(scene.getEngine(), "bloom", () => this._effects, !0), this._bloomScale = _bloomScale, this._effects = [], this._downscale = new ExtractHighlightsPostProcess("highlights", 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, pipelineTextureType, blockCompilation), this._blurX = new BlurPostProcess("horizontal blur", new math_vector/* Vector2 */.FM(1, 0), 10, _bloomScale, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, pipelineTextureType, void 0, blockCompilation), this._blurX.alwaysForcePOT = !0, this._blurX.autoClear = !1, this._blurY = new BlurPostProcess("vertical blur", new math_vector/* Vector2 */.FM(0, 1), 10, _bloomScale, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, pipelineTextureType, void 0, blockCompilation), this._blurY.alwaysForcePOT = !0, this._blurY.autoClear = !1, this.kernel = bloomKernel, this._effects = [this._downscale, this._blurX, this._blurY], this._merge = new BloomMergePostProcess("bloomMerge", this._downscale, this._blurY, bloomWeight, _bloomScale, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, pipelineTextureType, blockCompilation), this._merge.autoClear = !1, this._effects.push(this._merge);}disposeEffects(camera) {for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) this._effects[effectIndex].dispose(camera);}_updateEffects() {for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) this._effects[effectIndex].updateEffect();}_isReady() {for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) if (!this._effects[effectIndex].isReady()) return !1;return !0;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/chromaticAberration.fragment.js
const chromaticAberration_fragment_name = "chromaticAberrationPixelShader",chromaticAberration_fragment_shader = `uniform sampler2D textureSampler; 
uniform float chromatic_aberration;
uniform float radialIntensity;
uniform vec2 direction;
uniform vec2 centerPosition;
uniform float screen_width;
uniform float screen_height;
varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);
vec2 directionOfEffect=direction;
if(directionOfEffect.x==0. && directionOfEffect.y==0.){
directionOfEffect=normalize(centered_screen_pos);
}
float radius2=centered_screen_pos.x*centered_screen_pos.x
+ centered_screen_pos.y*centered_screen_pos.y;
float radius=sqrt(radius2);
vec4 original=texture2D(textureSampler,vUV);
vec3 ref_indices=vec3(-0.3,0.0,0.3);
float ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;
float ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;
vec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);
vec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);
vec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);
original.r=texture2D(textureSampler,ref_coords_r).r;
original.g=texture2D(textureSampler,ref_coords_g).g;
original.b=texture2D(textureSampler,ref_coords_b).b;
original.a=clamp(texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a,0.,1.);
gl_FragColor=original;
}`;shaderStore/* ShaderStore.ShadersStore.chromaticAberrationPixelShader */.v.ShadersStore.chromaticAberrationPixelShader = chromaticAberration_fragment_shader;const chromaticAberrationPixelShader = { name: "chromaticAberrationPixelShader", shader: chromaticAberration_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/chromaticAberrationPostProcess.js
class ChromaticAberrationPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "ChromaticAberrationPostProcess";}constructor(name, screenWidth, screenHeight, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], options, camera, samplingMode, engine, reusable, null, textureType, void 0, null, blockCompilation), this.aberrationAmount = 30, this.radialIntensity = 0, this.direction = new math_vector/* Vector2 */.FM(.707, .707), this.centerPosition = new math_vector/* Vector2 */.FM(.5, .5), this.screenWidth = screenWidth, this.screenHeight = screenHeight, this.onApplyObservable.add((effect) => {effect.setFloat("chromatic_aberration", this.aberrationAmount), effect.setFloat("screen_width", screenWidth), effect.setFloat("screen_height", screenHeight), effect.setFloat("radialIntensity", this.radialIntensity), effect.setFloat2("direction", this.direction.x, this.direction.y), effect.setFloat2("centerPosition", this.centerPosition.x, this.centerPosition.y);});}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new ChromaticAberrationPostProcess(parsedPostProcess.name, parsedPostProcess.screenWidth, parsedPostProcess.screenHeight, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType, !1), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ChromaticAberrationPostProcess.prototype, "aberrationAmount", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ChromaticAberrationPostProcess.prototype, "radialIntensity", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ChromaticAberrationPostProcess.prototype, "direction", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ChromaticAberrationPostProcess.prototype, "centerPosition", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ChromaticAberrationPostProcess.prototype, "screenWidth", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ChromaticAberrationPostProcess.prototype, "screenHeight", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ChromaticAberrationPostProcess", ChromaticAberrationPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/circleOfConfusion.fragment.js
const circleOfConfusion_fragment_name = "circleOfConfusionPixelShader",circleOfConfusion_fragment_shader = `uniform sampler2D depthSampler;
varying vec2 vUV;
uniform vec2 cameraMinMaxZ;
uniform float focusDistance;
uniform float cocPrecalculation;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
float depth=texture2D(depthSampler,vUV).r;
#define CUSTOM_COC_DEPTH
float pixelDistance=(cameraMinMaxZ.x+cameraMinMaxZ.y*depth)*1000.0; 
#define CUSTOM_COC_PIXELDISTANCE
float coc=abs(cocPrecalculation*((focusDistance-pixelDistance)/pixelDistance));
coc=clamp(coc,0.0,1.0);
gl_FragColor=vec4(coc,coc,coc,1.0);
}
`;shaderStore/* ShaderStore.ShadersStore.circleOfConfusionPixelShader */.v.ShadersStore.circleOfConfusionPixelShader = circleOfConfusion_fragment_shader;const circleOfConfusionPixelShader = { name: "circleOfConfusionPixelShader", shader: circleOfConfusion_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/circleOfConfusionPostProcess.js
class CircleOfConfusionPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "CircleOfConfusionPostProcess";}constructor(name, depthTexture, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "circleOfConfusion", ["cameraMinMaxZ", "focusDistance", "cocPrecalculation"], ["depthSampler"], options, camera, samplingMode, engine, reusable, null, textureType, void 0, null, blockCompilation), this.lensSize = 50, this.fStop = 1.4, this.focusDistance = 2e3, this.focalLength = 50, this._depthTexture = null, this._depthTexture = depthTexture, this.onApplyObservable.add((effect) => {if (!this._depthTexture) return void logger/* Logger.Warn */.Y.Warn("No depth texture set on CircleOfConfusionPostProcess");effect.setTexture("depthSampler", this._depthTexture);const aperture = this.lensSize / this.fStop,cocPrecalculation = aperture * this.focalLength / (this.focusDistance - this.focalLength);effect.setFloat("focusDistance", this.focusDistance), effect.setFloat("cocPrecalculation", cocPrecalculation);const activeCamera = this._depthTexture.activeCamera;effect.setFloat2("cameraMinMaxZ", activeCamera.minZ, activeCamera.maxZ - activeCamera.minZ);});}set depthTexture(value) {this._depthTexture = value;}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], CircleOfConfusionPostProcess.prototype, "lensSize", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], CircleOfConfusionPostProcess.prototype, "fStop", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], CircleOfConfusionPostProcess.prototype, "focusDistance", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], CircleOfConfusionPostProcess.prototype, "focalLength", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.CircleOfConfusionPostProcess", CircleOfConfusionPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/colorCorrection.fragment.js
const colorCorrection_fragment_name = "colorCorrectionPixelShader",colorCorrection_fragment_shader = `uniform sampler2D textureSampler; 
uniform sampler2D colorTable; 
varying vec2 vUV;
const float SLICE_COUNT=16.0; 
vec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {
float sliceSize=1.0/width; 
float slicePixelSize=sliceSize/width; 
float sliceInnerSize=slicePixelSize*(width-1.0); 
float zSlice0=min(floor(uv.z*width),width-1.0);
float zSlice1=min(zSlice0+1.0,width-1.0);
float xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;
float s0=xOffset+(zSlice0*sliceSize);
float s1=xOffset+(zSlice1*sliceSize);
vec4 slice0Color=texture2D(textureSampler,vec2(s0,uv.y));
vec4 slice1Color=texture2D(textureSampler,vec2(s1,uv.y));
float zOffset=mod(uv.z*width,1.0);
vec4 result=mix(slice0Color,slice1Color,zOffset);
return result;
}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec4 screen_color=texture2D(textureSampler,vUV);
gl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);
}`;shaderStore/* ShaderStore.ShadersStore.colorCorrectionPixelShader */.v.ShadersStore.colorCorrectionPixelShader = colorCorrection_fragment_shader;const colorCorrectionPixelShader = { name: "colorCorrectionPixelShader", shader: colorCorrection_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/colorCorrectionPostProcess.js
class ColorCorrectionPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "ColorCorrectionPostProcess";}constructor(name, colorTableUrl, options, camera, samplingMode, engine, reusable) {super(name, "colorCorrection", null, ["colorTable"], options, camera, samplingMode, engine, reusable);const scene = (null === camera || void 0 === camera ? void 0 : camera.getScene()) || null;this._colorTableTexture = new Textures_texture/* Texture */.x(colorTableUrl, scene, !0, !1, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE), this._colorTableTexture.anisotropicFilteringLevel = 1, this._colorTableTexture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._colorTableTexture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this.colorTableUrl = colorTableUrl, this.onApply = (effect) => {effect.setTexture("colorTable", this._colorTableTexture);};}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new ColorCorrectionPostProcess(parsedPostProcess.name, parsedPostProcess.colorTableUrl, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ColorCorrectionPostProcess.prototype, "colorTableUrl", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ColorCorrectionPostProcess", ColorCorrectionPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/convolution.fragment.js
const convolution_fragment_name = "convolutionPixelShader",convolution_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform vec2 screenSize;
uniform float kernel[9];
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec2 onePixel=vec2(1.0,1.0)/screenSize;
vec4 colorSum =
texture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +
texture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +
texture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +
texture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +
texture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +
texture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +
texture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +
texture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +
texture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];
float kernelWeight =
kernel[0] +
kernel[1] +
kernel[2] +
kernel[3] +
kernel[4] +
kernel[5] +
kernel[6] +
kernel[7] +
kernel[8];
if (kernelWeight<=0.0) {
kernelWeight=1.0;
}
gl_FragColor=vec4((colorSum/kernelWeight).rgb,1);
}`;shaderStore/* ShaderStore.ShadersStore.convolutionPixelShader */.v.ShadersStore.convolutionPixelShader = convolution_fragment_shader;const convolutionPixelShader = { name: "convolutionPixelShader", shader: convolution_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/convolutionPostProcess.js
class ConvolutionPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "ConvolutionPostProcess";}constructor(name, kernel, options, camera, samplingMode, engine, reusable, textureType = 0) {super(name, "convolution", ["kernel", "screenSize"], null, options, camera, samplingMode, engine, reusable, null, textureType), this.kernel = kernel, this.onApply = (effect) => {effect.setFloat2("screenSize", this.width, this.height), effect.setArray("kernel", this.kernel);};}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new ConvolutionPostProcess(parsedPostProcess.name, parsedPostProcess.kernel, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType), parsedPostProcess, scene, rootUrl);}}ConvolutionPostProcess.EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1], ConvolutionPostProcess.EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0], ConvolutionPostProcess.EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1], ConvolutionPostProcess.SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0], ConvolutionPostProcess.EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2], ConvolutionPostProcess.GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0], (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ConvolutionPostProcess.prototype, "kernel", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ConvolutionPostProcess", ConvolutionPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/depthOfFieldBlurPostProcess.js
class DepthOfFieldBlurPostProcess extends BlurPostProcess {getClassName() {return "DepthOfFieldBlurPostProcess";}constructor(name, scene, direction, kernel, options, camera, circleOfConfusion, imageToBlur = null, samplingMode = Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, reusable, textureType = 0, blockCompilation = !1, textureFormat = 5) {super(name, direction, kernel, options, camera, samplingMode = 2, engine, reusable, textureType, `#define DOF 1\r\n`, blockCompilation, textureFormat), this.direction = direction, this.externalTextureSamplerBinding = !!imageToBlur, this.onApplyObservable.add((effect) => {null != imageToBlur && effect.setTextureFromPostProcess("textureSampler", imageToBlur), effect.setTextureFromPostProcessOutput("circleOfConfusionSampler", circleOfConfusion);});}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DepthOfFieldBlurPostProcess.prototype, "direction", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.DepthOfFieldBlurPostProcess", DepthOfFieldBlurPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/depthOfFieldMerge.fragment.js
const depthOfFieldMerge_fragment_name = "depthOfFieldMergePixelShader",depthOfFieldMerge_fragment_shader = `uniform sampler2D textureSampler;
varying vec2 vUV;
uniform sampler2D circleOfConfusionSampler;
uniform sampler2D blurStep0;
#if BLUR_LEVEL>0
uniform sampler2D blurStep1;
#endif
#if BLUR_LEVEL>1
uniform sampler2D blurStep2;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
float coc=texture2D(circleOfConfusionSampler,vUV).r;
#if BLUR_LEVEL==0
vec4 original=texture2D(textureSampler,vUV);
vec4 blurred0=texture2D(blurStep0,vUV);
gl_FragColor=mix(original,blurred0,coc);
#endif
#if BLUR_LEVEL==1
if(coc<0.5){
vec4 original=texture2D(textureSampler,vUV);
vec4 blurred1=texture2D(blurStep1,vUV);
gl_FragColor=mix(original,blurred1,coc/0.5);
}else{
vec4 blurred0=texture2D(blurStep0,vUV);
vec4 blurred1=texture2D(blurStep1,vUV);
gl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);
}
#endif
#if BLUR_LEVEL==2
if(coc<0.33){
vec4 original=texture2D(textureSampler,vUV);
vec4 blurred2=texture2D(blurStep2,vUV);
gl_FragColor=mix(original,blurred2,coc/0.33);
}else if(coc<0.66){
vec4 blurred1=texture2D(blurStep1,vUV);
vec4 blurred2=texture2D(blurStep2,vUV);
gl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);
}else{
vec4 blurred0=texture2D(blurStep0,vUV);
vec4 blurred1=texture2D(blurStep1,vUV);
gl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);
}
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.depthOfFieldMergePixelShader */.v.ShadersStore.depthOfFieldMergePixelShader = depthOfFieldMerge_fragment_shader;const depthOfFieldMergePixelShader = { name: "depthOfFieldMergePixelShader", shader: depthOfFieldMerge_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/depthOfFieldMergePostProcess.js
class DepthOfFieldMergePostProcessOptions {}class DepthOfFieldMergePostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "DepthOfFieldMergePostProcess";}constructor(name, originalFromInput, circleOfConfusion, _blurSteps, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "depthOfFieldMerge", [], ["circleOfConfusionSampler", "blurStep0", "blurStep1", "blurStep2"], options, camera, samplingMode, engine, reusable, null, textureType, void 0, null, !0), this._blurSteps = _blurSteps, this.externalTextureSamplerBinding = !0, this.onApplyObservable.add((effect) => {effect.setTextureFromPostProcess("textureSampler", originalFromInput), effect.setTextureFromPostProcessOutput("circleOfConfusionSampler", circleOfConfusion), _blurSteps.forEach((step, index) => {effect.setTextureFromPostProcessOutput("blurStep" + (_blurSteps.length - index - 1), step);});}), blockCompilation || this.updateEffect();}updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError) {defines || (defines = "", defines += "#define BLUR_LEVEL " + (this._blurSteps.length - 1) + "\n"), super.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/depthOfFieldEffect.js
var DepthOfFieldEffectBlurLevel;(function (DepthOfFieldEffectBlurLevel) {DepthOfFieldEffectBlurLevel[DepthOfFieldEffectBlurLevel.Low = 0] = "Low", DepthOfFieldEffectBlurLevel[DepthOfFieldEffectBlurLevel.Medium = 1] = "Medium", DepthOfFieldEffectBlurLevel[DepthOfFieldEffectBlurLevel.High = 2] = "High";})(DepthOfFieldEffectBlurLevel || (DepthOfFieldEffectBlurLevel = {}));class DepthOfFieldEffect extends PostProcessRenderEffect {set focalLength(value) {this._circleOfConfusion.focalLength = value;}get focalLength() {return this._circleOfConfusion.focalLength;}set fStop(value) {this._circleOfConfusion.fStop = value;}get fStop() {return this._circleOfConfusion.fStop;}set focusDistance(value) {this._circleOfConfusion.focusDistance = value;}get focusDistance() {return this._circleOfConfusion.focusDistance;}set lensSize(value) {this._circleOfConfusion.lensSize = value;}get lensSize() {return this._circleOfConfusion.lensSize;}constructor(scene, depthTexture, blurLevel = DepthOfFieldEffectBlurLevel.Low, pipelineTextureType = 0, blockCompilation = !1) {super(scene.getEngine(), "depth of field", () => this._effects, !0), this._effects = [];const engine = scene.getEngine(),circleOfConfusionTextureFormat = engine.isWebGPU || 1 < engine.webGLVersion ? 6 : 5;this._circleOfConfusion = new CircleOfConfusionPostProcess("circleOfConfusion", depthTexture, 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, pipelineTextureType, blockCompilation), this._depthOfFieldBlurY = [], this._depthOfFieldBlurX = [];let blurCount = 1,kernelSize = 15;switch (blurLevel) {case DepthOfFieldEffectBlurLevel.High:{blurCount = 3, kernelSize = 51;break;}case DepthOfFieldEffectBlurLevel.Medium:{blurCount = 2, kernelSize = 31;break;}default:{kernelSize = 15, blurCount = 1;break;}}const adjustedKernelSize = kernelSize / Math.pow(2, blurCount - 1);let ratio = 1;for (let i = 0; i < blurCount; i++) {const blurY = new DepthOfFieldBlurPostProcess("vertical blur", scene, new math_vector/* Vector2 */.FM(0, 1), adjustedKernelSize, ratio, null, this._circleOfConfusion, 0 == i ? this._circleOfConfusion : null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, pipelineTextureType, blockCompilation, 0 == i ? circleOfConfusionTextureFormat : 5);blurY.autoClear = !1, ratio = .75 / Math.pow(2, i);const blurX = new DepthOfFieldBlurPostProcess("horizontal blur", scene, new math_vector/* Vector2 */.FM(1, 0), adjustedKernelSize, ratio, null, this._circleOfConfusion, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, pipelineTextureType, blockCompilation);blurX.autoClear = !1, this._depthOfFieldBlurY.push(blurY), this._depthOfFieldBlurX.push(blurX);}this._effects = [this._circleOfConfusion];for (let i = 0; i < this._depthOfFieldBlurX.length; i++) this._effects.push(this._depthOfFieldBlurY[i]), this._effects.push(this._depthOfFieldBlurX[i]);this._dofMerge = new DepthOfFieldMergePostProcess("dofMerge", this._circleOfConfusion, this._circleOfConfusion, this._depthOfFieldBlurX, ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, pipelineTextureType, blockCompilation), this._dofMerge.autoClear = !1, this._effects.push(this._dofMerge);}getClassName() {return "DepthOfFieldEffect";}set depthTexture(value) {this._circleOfConfusion.depthTexture = value;}disposeEffects(camera) {for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) this._effects[effectIndex].dispose(camera);}_updateEffects() {for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) this._effects[effectIndex].updateEffect();}_isReady() {for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) if (!this._effects[effectIndex].isReady()) return !1;return !0;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/displayPass.fragment.js
const displayPass_fragment_name = "displayPassPixelShader",displayPass_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform sampler2D passSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
gl_FragColor=texture2D(passSampler,vUV);
}`;shaderStore/* ShaderStore.ShadersStore.displayPassPixelShader */.v.ShadersStore.displayPassPixelShader = displayPass_fragment_shader;const displayPassPixelShader = { name: "displayPassPixelShader", shader: displayPass_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/displayPassPostProcess.js
class DisplayPassPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "DisplayPassPostProcess";}constructor(name, options, camera, samplingMode, engine, reusable) {super(name, "displayPass", ["passSampler"], ["passSampler"], options, camera, samplingMode, engine, reusable);}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new DisplayPassPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,typeStore/* RegisterClass */.H)("BABYLON.DisplayPassPostProcess", DisplayPassPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/filter.fragment.js
const filter_fragment_name = "filterPixelShader",filter_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform mat4 kernelMatrix;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec3 baseColor=texture2D(textureSampler,vUV).rgb;
vec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;
gl_FragColor=vec4(updatedColor,1.0);
}`;shaderStore/* ShaderStore.ShadersStore.filterPixelShader */.v.ShadersStore.filterPixelShader = filter_fragment_shader;const filterPixelShader = { name: "filterPixelShader", shader: filter_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/filterPostProcess.js
class FilterPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "FilterPostProcess";}constructor(name, kernelMatrix, options, camera, samplingMode, engine, reusable) {super(name, "filter", ["kernelMatrix"], null, options, camera, samplingMode, engine, reusable), this.kernelMatrix = kernelMatrix, this.onApply = (effect) => {effect.setMatrix("kernelMatrix", this.kernelMatrix);};}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new FilterPostProcess(parsedPostProcess.name, parsedPostProcess.kernelMatrix, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsMatrix */.oQ)()], FilterPostProcess.prototype, "kernelMatrix", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.FilterPostProcess", FilterPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fxaa.fragment.js
const fxaa_fragment_name = "fxaaPixelShader",fxaa_fragment_shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)
#else
#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)
#endif
uniform sampler2D textureSampler;
uniform vec2 texelSize;
varying vec2 vUV;
varying vec2 sampleCoordS;
varying vec2 sampleCoordE;
varying vec2 sampleCoordN;
varying vec2 sampleCoordW;
varying vec2 sampleCoordNW;
varying vec2 sampleCoordSE;
varying vec2 sampleCoordNE;
varying vec2 sampleCoordSW;
const float fxaaQualitySubpix=1.0;
const float fxaaQualityEdgeThreshold=0.166;
const float fxaaQualityEdgeThresholdMin=0.0833;
const vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);
#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)
void main(){
vec2 posM;
posM.x=vUV.x;
posM.y=vUV.y;
vec4 rgbyM=TEXTUREFUNC(textureSampler,vUV,0.0);
float lumaM=FxaaLuma(rgbyM);
float lumaS=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordS,0.0));
float lumaE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordE,0.0));
float lumaN=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordN,0.0));
float lumaW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordW,0.0));
float maxSM=max(lumaS,lumaM);
float minSM=min(lumaS,lumaM);
float maxESM=max(lumaE,maxSM);
float minESM=min(lumaE,minSM);
float maxWN=max(lumaN,lumaW);
float minWN=min(lumaN,lumaW);
float rangeMax=max(maxWN,maxESM);
float rangeMin=min(minWN,minESM);
float rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;
float range=rangeMax-rangeMin;
float rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);
#ifndef MALI
if(range<rangeMaxClamped) 
{
gl_FragColor=rgbyM;
return;
}
#endif
float lumaNW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordNW,0.0));
float lumaSE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordSE,0.0));
float lumaNE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordNE,0.0));
float lumaSW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordSW,0.0));
float lumaNS=lumaN+lumaS;
float lumaWE=lumaW+lumaE;
float subpixRcpRange=1.0/range;
float subpixNSWE=lumaNS+lumaWE;
float edgeHorz1=(-2.0*lumaM)+lumaNS;
float edgeVert1=(-2.0*lumaM)+lumaWE;
float lumaNESE=lumaNE+lumaSE;
float lumaNWNE=lumaNW+lumaNE;
float edgeHorz2=(-2.0*lumaE)+lumaNESE;
float edgeVert2=(-2.0*lumaN)+lumaNWNE;
float lumaNWSW=lumaNW+lumaSW;
float lumaSWSE=lumaSW+lumaSE;
float edgeHorz4=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);
float edgeVert4=(abs(edgeVert1)*2.0)+abs(edgeVert2);
float edgeHorz3=(-2.0*lumaW)+lumaNWSW;
float edgeVert3=(-2.0*lumaS)+lumaSWSE;
float edgeHorz=abs(edgeHorz3)+edgeHorz4;
float edgeVert=abs(edgeVert3)+edgeVert4;
float subpixNWSWNESE=lumaNWSW+lumaNESE;
float lengthSign=texelSize.x;
bool horzSpan=edgeHorz>=edgeVert;
float subpixA=subpixNSWE*2.0+subpixNWSWNESE;
if (!horzSpan)
{
lumaN=lumaW;
}
if (!horzSpan) 
{
lumaS=lumaE;
}
if (horzSpan) 
{
lengthSign=texelSize.y;
}
float subpixB=(subpixA*(1.0/12.0))-lumaM;
float gradientN=lumaN-lumaM;
float gradientS=lumaS-lumaM;
float lumaNN=lumaN+lumaM;
float lumaSS=lumaS+lumaM;
bool pairN=abs(gradientN)>=abs(gradientS);
float gradient=max(abs(gradientN),abs(gradientS));
if (pairN)
{
lengthSign=-lengthSign;
}
float subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);
vec2 posB;
posB.x=posM.x;
posB.y=posM.y;
vec2 offNP;
offNP.x=(!horzSpan) ? 0.0 : texelSize.x;
offNP.y=(horzSpan) ? 0.0 : texelSize.y;
if (!horzSpan) 
{
posB.x+=lengthSign*0.5;
}
if (horzSpan)
{
posB.y+=lengthSign*0.5;
}
vec2 posN;
posN.x=posB.x-offNP.x*1.5;
posN.y=posB.y-offNP.y*1.5;
vec2 posP;
posP.x=posB.x+offNP.x*1.5;
posP.y=posB.y+offNP.y*1.5;
float subpixD=((-2.0)*subpixC)+3.0;
float lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN,0.0));
float subpixE=subpixC*subpixC;
float lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP,0.0));
if (!pairN) 
{
lumaNN=lumaSS;
}
float gradientScaled=gradient*1.0/4.0;
float lumaMM=lumaM-lumaNN*0.5;
float subpixF=subpixD*subpixE;
bool lumaMLTZero=lumaMM<0.0;
lumaEndN-=lumaNN*0.5;
lumaEndP-=lumaNN*0.5;
bool doneN=abs(lumaEndN)>=gradientScaled;
bool doneP=abs(lumaEndP)>=gradientScaled;
if (!doneN) 
{
posN.x-=offNP.x*3.0;
}
if (!doneN) 
{
posN.y-=offNP.y*3.0;
}
bool doneNP=(!doneN) || (!doneP);
if (!doneP) 
{
posP.x+=offNP.x*3.0;
}
if (!doneP)
{
posP.y+=offNP.y*3.0;
}
if (doneNP)
{
if (!doneN) lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN.xy,0.0));
if (!doneP) lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP.xy,0.0));
if (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;
if (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;
doneN=abs(lumaEndN)>=gradientScaled;
doneP=abs(lumaEndP)>=gradientScaled;
if (!doneN) posN.x-=offNP.x*12.0;
if (!doneN) posN.y-=offNP.y*12.0;
doneNP=(!doneN) || (!doneP);
if (!doneP) posP.x+=offNP.x*12.0;
if (!doneP) posP.y+=offNP.y*12.0;
}
float dstN=posM.x-posN.x;
float dstP=posP.x-posM.x;
if (!horzSpan)
{
dstN=posM.y-posN.y;
}
if (!horzSpan) 
{
dstP=posP.y-posM.y;
}
bool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;
float spanLength=(dstP+dstN);
bool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;
float spanLengthRcp=1.0/spanLength;
bool directionN=dstN<dstP;
float dst=min(dstN,dstP);
bool goodSpan=directionN ? goodSpanN : goodSpanP;
float subpixG=subpixF*subpixF;
float pixelOffset=(dst*(-spanLengthRcp))+0.5;
float subpixH=subpixG*fxaaQualitySubpix;
float pixelOffsetGood=goodSpan ? pixelOffset : 0.0;
float pixelOffsetSubpix=max(pixelOffsetGood,subpixH);
if (!horzSpan)
{
posM.x+=pixelOffsetSubpix*lengthSign;
}
if (horzSpan)
{
posM.y+=pixelOffsetSubpix*lengthSign;
}
#ifdef MALI
if(range<rangeMaxClamped) 
{
gl_FragColor=rgbyM;
}
else
{
gl_FragColor=TEXTUREFUNC(textureSampler,posM,0.0);
}
#else
gl_FragColor=TEXTUREFUNC(textureSampler,posM,0.0);
#endif
}`;shaderStore/* ShaderStore.ShadersStore.fxaaPixelShader */.v.ShadersStore.fxaaPixelShader = fxaa_fragment_shader;const fxaaPixelShader = { name: "fxaaPixelShader", shader: fxaa_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fxaa.vertex.js
const fxaa_vertex_name = "fxaaVertexShader",fxaa_vertex_shader = `attribute vec2 position;
uniform vec2 texelSize;
varying vec2 vUV;
varying vec2 sampleCoordS;
varying vec2 sampleCoordE;
varying vec2 sampleCoordN;
varying vec2 sampleCoordW;
varying vec2 sampleCoordNW;
varying vec2 sampleCoordSE;
varying vec2 sampleCoordNE;
varying vec2 sampleCoordSW;
const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=(position*madd+madd);
sampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;
sampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;
sampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;
sampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;
sampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;
sampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;
sampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;
sampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;
gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.fxaaVertexShader */.v.ShadersStore.fxaaVertexShader = fxaa_vertex_shader;const fxaaVertexShader = { name: "fxaaVertexShader", shader: fxaa_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/fxaaPostProcess.js
class FxaaPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "FxaaPostProcess";}constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0) {super(name, "fxaa", ["texelSize"], null, options, camera, samplingMode || Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, reusable, null, textureType, "fxaa", void 0, !0);const defines = this._getDefines();this.updateEffect(defines), this.onApplyObservable.add((effect) => {const texelSize = this.texelSize;effect.setFloat2("texelSize", texelSize.x, texelSize.y);});}_getDefines() {const engine = this.getEngine();if (!engine) return null;const glInfo = engine.getGlInfo();return glInfo && glInfo.renderer && -1 < glInfo.renderer.toLowerCase().indexOf("mali") ? "#define MALI 1\n" : null;}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new FxaaPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,typeStore/* RegisterClass */.H)("BABYLON.FxaaPostProcess", FxaaPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/grain.fragment.js
const grain_fragment_name = "grainPixelShader",grain_fragment_shader = `#include<helperFunctions>
uniform sampler2D textureSampler; 
uniform float intensity;
uniform float animatedSeed;
varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
gl_FragColor=texture2D(textureSampler,vUV);
vec2 seed=vUV*(animatedSeed);
float grain=dither(seed,intensity);
float lum=getLuminance(gl_FragColor.rgb);
float grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;
gl_FragColor.rgb+=grain*grainAmount;
gl_FragColor.rgb=max(gl_FragColor.rgb,0.0);
}`;shaderStore/* ShaderStore.ShadersStore.grainPixelShader */.v.ShadersStore.grainPixelShader = grain_fragment_shader;const grainPixelShader = { name: "grainPixelShader", shader: grain_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/grainPostProcess.js
class GrainPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "GrainPostProcess";}constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "grain", ["intensity", "animatedSeed"], [], options, camera, samplingMode, engine, reusable, null, textureType, void 0, null, blockCompilation), this.intensity = 30, this.animated = !1, this.onApplyObservable.add((effect) => {effect.setFloat("intensity", this.intensity), effect.setFloat("animatedSeed", this.animated ? Math.random() + 1 : 1);});}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new GrainPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], GrainPostProcess.prototype, "intensity", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], GrainPostProcess.prototype, "animated", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.GrainPostProcess", GrainPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/highlights.fragment.js
const highlights_fragment_name = "highlightsPixelShader",highlights_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
const vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
vec4 tex=texture2D(textureSampler,vUV);
vec3 c=tex.rgb;
float luma=dot(c.rgb,RGBLuminanceCoefficients);
gl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a); 
}`;shaderStore/* ShaderStore.ShadersStore.highlightsPixelShader */.v.ShadersStore.highlightsPixelShader = highlights_fragment_shader;const highlightsPixelShader = { name: "highlightsPixelShader", shader: highlights_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/highlightsPostProcess.js
class HighlightsPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "HighlightsPostProcess";}constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0) {super(name, "highlights", null, null, options, camera, samplingMode, engine, reusable, null, textureType);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/mrtFragmentDeclaration.js
const mrtFragmentDeclaration_name = "mrtFragmentDeclaration",mrtFragmentDeclaration_shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
layout(location=0) out vec4 glFragData[{X}];
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.mrtFragmentDeclaration */.v.IncludesShadersStore.mrtFragmentDeclaration = mrtFragmentDeclaration_shader;const mrtFragmentDeclaration = { name: "mrtFragmentDeclaration", shader: mrtFragmentDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/geometry.fragment.js
const geometry_fragment_name = "geometryPixelShader",geometry_fragment_shader = `#extension GL_EXT_draw_buffers : require
#if defined(BUMP) || !defined(NORMAL)
#extension GL_OES_standard_derivatives : enable
#endif
precision highp float;
#ifdef BUMP
varying mat4 vWorldView;
varying vec3 vNormalW;
#else
varying vec3 vNormalV;
#endif
varying vec4 vViewPos;
#if defined(POSITION) || defined(BUMP)
varying vec3 vPositionW;
#endif
#ifdef VELOCITY
varying vec4 vCurrentPosition;
varying vec4 vPreviousPosition;
#endif
#ifdef NEED_UV
varying vec2 vUV;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;
uniform vec2 vTangentSpaceParams;
#endif
#if defined(REFLECTIVITY)
#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
uniform sampler2D reflectivitySampler;
varying vec2 vReflectivityUV;
#endif
#ifdef ALBEDOTEXTURE
varying vec2 vAlbedoUV;
uniform sampler2D albedoSampler;
#endif
#ifdef REFLECTIVITYCOLOR
uniform vec3 reflectivityColor;
#endif
#ifdef ALBEDOCOLOR
uniform vec3 albedoColor;
#endif
#ifdef METALLIC
uniform float metallic;
#endif
#ifdef ROUGHNESS
uniform float glossiness;
#endif
#endif
#ifdef ALPHATEST
uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
#include<mrtFragmentDeclaration>[RENDER_TARGET_COUNT]
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#include<helperFunctions>
void main() {
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
#endif
vec3 normalOutput;
#ifdef BUMP
vec3 normalW=normalize(vNormalW);
#include<bumpFragment>
normalOutput=normalize(vec3(vWorldView*vec4(normalW,0.0)));
#else
normalOutput=normalize(vNormalV);
#endif
#ifdef PREPASS
#ifdef PREPASS_DEPTH
gl_FragData[DEPTH_INDEX]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);
#endif
#ifdef PREPASS_NORMAL
gl_FragData[NORMAL_INDEX]=vec4(normalOutput,1.0);
#endif
#else
gl_FragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);
gl_FragData[1]=vec4(normalOutput,1.0);
#endif
#ifdef POSITION
gl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0);
#endif
#ifdef VELOCITY
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;
vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;
vec2 velocity=abs(a-b);
velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;
gl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);
#endif
#ifdef REFLECTIVITY
vec4 reflectivity=vec4(1.0,1.0,1.0,1.0);
#ifdef METALLICWORKFLOW
float metal=1.0;
float roughness=1.0;
#ifdef ORMTEXTURE
metal*=texture2D(reflectivitySampler,vReflectivityUV).b;
roughness*=texture2D(reflectivitySampler,vReflectivityUV).g;
#endif
#ifdef METALLIC
metal*=metallic;
#endif
#ifdef ROUGHNESS
roughness*=(1.0-glossiness); 
#endif
reflectivity.a-=roughness;
vec3 color=vec3(1.0);
#ifdef ALBEDOTEXTURE
color=texture2D(albedoSampler,vAlbedoUV).rgb;
#ifdef GAMMAALBEDO
color=toLinearSpace(color);
#endif
#endif
#ifdef ALBEDOCOLOR
color*=albedoColor.xyz;
#endif
reflectivity.rgb=mix(vec3(0.04),color,metal);
#else
#ifdef SPECULARGLOSSINESSTEXTURE
reflectivity=texture2D(reflectivitySampler,vReflectivityUV);
#ifdef GAMMAREFLECTIVITYTEXTURE
reflectivity.rgb=toLinearSpace(reflectivity.rgb);
#endif
#ifdef GLOSSINESSS
reflectivity.a*=glossiness;
#endif
#else 
#ifdef REFLECTIVITYTEXTURE
reflectivity.rbg=texture2D(reflectivitySampler,vReflectivityUV).rbg;
#ifdef GAMMAREFLECTIVITYTEXTURE
reflectivity.rgb=toLinearSpace(reflectivity.rgb);
#endif
#else
#ifdef REFLECTIVITYCOLOR
reflectivity.rgb=reflectivityColor.xyz;
reflectivity.a=1.0;
#endif
#endif 
#ifdef GLOSSINESSS
reflectivity.a=glossiness; 
#else
reflectivity.a=1.0; 
#endif
#endif
#endif
reflectivity.rgb=toGammaSpace(reflectivity.rgb); 
gl_FragData[REFLECTIVITY_INDEX]=reflectivity;
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.geometryPixelShader */.v.ShadersStore.geometryPixelShader = geometry_fragment_shader;const geometryPixelShader = { name: "geometryPixelShader", shader: geometry_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/geometryVertexDeclaration.js
const geometryVertexDeclaration_name = "geometryVertexDeclaration",geometryVertexDeclaration_shader = `uniform mat4 viewProjection;
uniform mat4 view;`;shaderStore/* ShaderStore.IncludesShadersStore.geometryVertexDeclaration */.v.IncludesShadersStore.geometryVertexDeclaration = geometryVertexDeclaration_shader;const geometryVertexDeclaration = { name: "geometryVertexDeclaration", shader: geometryVertexDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/geometryUboDeclaration.js
const geometryUboDeclaration_name = "geometryUboDeclaration",geometryUboDeclaration_shader = `#include<sceneUboDeclaration>
`;shaderStore/* ShaderStore.IncludesShadersStore.geometryUboDeclaration */.v.IncludesShadersStore.geometryUboDeclaration = geometryUboDeclaration_shader;const geometryUboDeclaration = { name: "geometryUboDeclaration", shader: geometryUboDeclaration_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js
var bumpVertex = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/geometry.vertex.js
const geometry_vertex_name = "geometryVertexShader",geometry_vertex_shader = `precision highp float;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
#include<__decl__geometryVertex>
#include<clipPlaneVertexDeclaration>
attribute vec3 position;
attribute vec3 normal;
#ifdef NEED_UV
varying vec2 vUV;
#ifdef ALPHATEST
uniform mat4 diffuseMatrix;
#endif
#ifdef BUMP
uniform mat4 bumpMatrix;
varying vec2 vBumpUV;
#endif
#ifdef REFLECTIVITY
uniform mat4 reflectivityMatrix;
uniform mat4 albedoMatrix;
varying vec2 vReflectivityUV;
varying vec2 vAlbedoUV;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#ifdef BUMP
varying mat4 vWorldView;
#endif
#ifdef BUMP
varying vec3 vNormalW;
#else
varying vec3 vNormalV;
#endif
varying vec4 vViewPos;
#if defined(POSITION) || defined(BUMP)
varying vec3 vPositionW;
#endif
#ifdef VELOCITY
uniform mat4 previousViewProjection;
varying vec4 vCurrentPosition;
varying vec4 vPreviousPosition;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{
vec3 positionUpdated=position;
vec3 normalUpdated=normal;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#if defined(VELOCITY) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=vec4(finalWorld*vec4(positionUpdated,1.0));
#ifdef BUMP
vWorldView=view*finalWorld;
vNormalW=normalUpdated;
#else
vNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));
#endif
vViewPos=view*worldPos;
#if defined(VELOCITY) && defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);
#if NUM_BONE_INFLUENCERS>0
mat4 previousInfluence;
previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);
#else
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#endif
#if defined(POSITION) || defined(BUMP)
vPositionW=worldPos.xyz/worldPos.w;
#endif
gl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);
#include<clipPlaneVertex>
#ifdef NEED_UV
#ifdef UV1
#if defined(ALPHATEST) && defined(ALPHATEST_UV1)
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#else
vUV=uv;
#endif
#ifdef BUMP_UV1
vBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef REFLECTIVITY_UV1
vReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef ALBEDO_UV1
vAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#endif
#ifdef UV2
#if defined(ALPHATEST) && defined(ALPHATEST_UV2)
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#else
vUV=uv2;
#endif
#ifdef BUMP_UV2
vBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));
#endif
#ifdef REFLECTIVITY_UV2
vReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));
#endif
#ifdef ALBEDO_UV2
vAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#endif
#include<bumpVertex>
}
`;shaderStore/* ShaderStore.ShadersStore.geometryVertexShader */.v.ShadersStore.geometryVertexShader = geometry_vertex_shader;const geometryVertexShader = { name: "geometryVertexShader", shader: geometry_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/geometryBufferRenderer.js
const uniforms = ["world", "mBones", "viewProjection", "diffuseMatrix", "view", "previousWorld", "previousViewProjection", "mPreviousBones", "bumpMatrix", "reflectivityMatrix", "albedoMatrix", "reflectivityColor", "albedoColor", "metallic", "glossiness", "vTangentSpaceParams", "vBumpInfos", "morphTargetInfluences", "morphTargetTextureInfo", "morphTargetTextureIndices"];(0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(uniforms);class GeometryBufferRenderer {_linkPrePassRenderer(prePassRenderer) {this._linkedWithPrePass = !0, this._prePassRenderer = prePassRenderer, this._multiRenderTarget && (this._multiRenderTarget.onClearObservable.clear(), this._multiRenderTarget.onClearObservable.add(() => {}));}_unlinkPrePassRenderer() {this._linkedWithPrePass = !1, this._createRenderTargets();}_resetLayout() {this._enablePosition = !1, this._enableReflectivity = !1, this._enableVelocity = !1, this._attachments = [];}_forceTextureType(geometryBufferType, index) {geometryBufferType === GeometryBufferRenderer.POSITION_TEXTURE_TYPE ? (this._positionIndex = index, this._enablePosition = !0) : geometryBufferType === GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE ? (this._velocityIndex = index, this._enableVelocity = !0) : geometryBufferType === GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE ? (this._reflectivityIndex = index, this._enableReflectivity = !0) : geometryBufferType === GeometryBufferRenderer.DEPTH_TEXTURE_TYPE ? this._depthIndex = index : geometryBufferType === GeometryBufferRenderer.NORMAL_TEXTURE_TYPE && (this._normalIndex = index);}_setAttachments(attachments) {this._attachments = attachments;}_linkInternalTexture(internalTexture) {this._multiRenderTarget.setInternalTexture(internalTexture, 0, !1);}get renderList() {return this._multiRenderTarget.renderList;}set renderList(meshes) {this._multiRenderTarget.renderList = meshes;}get isSupported() {return this._multiRenderTarget.isSupported;}getTextureIndex(textureType) {return textureType === GeometryBufferRenderer.POSITION_TEXTURE_TYPE ? this._positionIndex : textureType === GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE ? this._velocityIndex : textureType === GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE ? this._reflectivityIndex : -1;}get enablePosition() {return this._enablePosition;}set enablePosition(enable) {this._enablePosition = enable, this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());}get enableVelocity() {return this._enableVelocity;}set enableVelocity(enable) {this._enableVelocity = enable, enable || (this._previousTransformationMatrices = {}), this._linkedWithPrePass || (this.dispose(), this._createRenderTargets()), this._scene.needsPreviousWorldMatrices = enable;}get enableReflectivity() {return this._enableReflectivity;}set enableReflectivity(enable) {this._enableReflectivity = enable, this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());}get scene() {return this._scene;}get ratio() {return this._ratio;}constructor(scene, ratio = 1, depthFormat = 15) {this._previousTransformationMatrices = {}, this._previousBonesTransformationMatrices = {}, this.excludedSkinnedMeshesFromVelocity = [], this.renderTransparentMeshes = !0, this._resizeObserver = null, this._enablePosition = !1, this._enableVelocity = !1, this._enableReflectivity = !1, this._positionIndex = -1, this._velocityIndex = -1, this._reflectivityIndex = -1, this._depthIndex = -1, this._normalIndex = -1, this._linkedWithPrePass = !1, this._scene = scene, this._ratio = ratio, this._useUbo = scene.getEngine().supportsUniformBuffers, this._depthFormat = depthFormat, GeometryBufferRenderer._SceneComponentInitialization(this._scene), this._createRenderTargets();}isReady(subMesh, useInstances) {const material = subMesh.getMaterial();if (material && material.disableDepthWrite) return !1;const defines = [],attribs = [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind],mesh = subMesh.getMesh();if (material) {let needUv = !1;if (material.needAlphaTesting() && material.getAlphaTestTexture() && (defines.push("#define ALPHATEST"), defines.push(`#define ALPHATEST_UV${material.getAlphaTestTexture().coordinatesIndex + 1}`), needUv = !0), material.bumpTexture && materialFlags/* MaterialFlags.BumpTextureEnabled */.k.BumpTextureEnabled && (defines.push("#define BUMP"), defines.push(`#define BUMP_UV${material.bumpTexture.coordinatesIndex + 1}`), needUv = !0), this._enableReflectivity) {let metallicWorkflow = !1;"PBRMetallicRoughnessMaterial" === material.getClassName() ? (null !== material.metallicRoughnessTexture && (defines.push("#define ORMTEXTURE"), defines.push(`#define REFLECTIVITY_UV${material.metallicRoughnessTexture.coordinatesIndex + 1}`), defines.push("#define METALLICWORKFLOW"), needUv = !0, metallicWorkflow = !0), null !== material.metallic && (defines.push("#define METALLIC"), defines.push("#define METALLICWORKFLOW"), metallicWorkflow = !0), null !== material.roughness && (defines.push("#define ROUGHNESS"), defines.push("#define METALLICWORKFLOW"), metallicWorkflow = !0), metallicWorkflow && (null !== material.baseTexture && (defines.push("#define ALBEDOTEXTURE"), defines.push(`#define ALBEDO_UV${material.baseTexture.coordinatesIndex + 1}`), material.baseTexture.gammaSpace && defines.push("#define GAMMAALBEDO"), needUv = !0), null !== material.baseColor && defines.push("#define ALBEDOCOLOR"))) : "PBRSpecularGlossinessMaterial" === material.getClassName() ? (null === material.specularGlossinessTexture ? null !== material.specularColor && defines.push("#define REFLECTIVITYCOLOR") : (defines.push("#define SPECULARGLOSSINESSTEXTURE"), defines.push(`#define REFLECTIVITY_UV${material.specularGlossinessTexture.coordinatesIndex + 1}`), needUv = !0, material.specularGlossinessTexture.gammaSpace && defines.push("#define GAMMAREFLECTIVITYTEXTURE")), null !== material.glossiness && defines.push("#define GLOSSINESSS")) : "PBRMaterial" === material.getClassName() ? (null !== material.metallicTexture && (defines.push("#define ORMTEXTURE"), defines.push(`#define REFLECTIVITY_UV${material.metallicTexture.coordinatesIndex + 1}`), defines.push("#define METALLICWORKFLOW"), needUv = !0, metallicWorkflow = !0), null !== material.metallic && (defines.push("#define METALLIC"), defines.push("#define METALLICWORKFLOW"), metallicWorkflow = !0), null !== material.roughness && (defines.push("#define ROUGHNESS"), defines.push("#define METALLICWORKFLOW"), metallicWorkflow = !0), metallicWorkflow ? (null !== material.albedoTexture && (defines.push("#define ALBEDOTEXTURE"), defines.push(`#define ALBEDO_UV${material.albedoTexture.coordinatesIndex + 1}`), material.albedoTexture.gammaSpace && defines.push("#define GAMMAALBEDO"), needUv = !0), null !== material.albedoColor && defines.push("#define ALBEDOCOLOR")) : (null === material.reflectivityTexture ? null !== material.reflectivityColor && defines.push("#define REFLECTIVITYCOLOR") : (defines.push("#define SPECULARGLOSSINESSTEXTURE"), defines.push(`#define REFLECTIVITY_UV${material.reflectivityTexture.coordinatesIndex + 1}`), material.reflectivityTexture.gammaSpace && defines.push("#define GAMMAREFLECTIVITYTEXTURE"), needUv = !0), null !== material.microSurface && defines.push("#define GLOSSINESSS"))) : "StandardMaterial" === material.getClassName() && (null !== material.specularTexture && (defines.push("#define REFLECTIVITYTEXTURE"), defines.push(`#define REFLECTIVITY_UV${material.specularTexture.coordinatesIndex + 1}`), material.specularTexture.gammaSpace && defines.push("#define GAMMAREFLECTIVITYTEXTURE"), needUv = !0), null !== material.specularColor && defines.push("#define REFLECTIVITYCOLOR"));}needUv && (defines.push("#define NEED_UV"), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind) && (attribs.push(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), defines.push("#define UV1")), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind) && (attribs.push(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind), defines.push("#define UV2")));}this._linkedWithPrePass && (defines.push("#define PREPASS"), -1 !== this._depthIndex && (defines.push("#define DEPTH_INDEX " + this._depthIndex), defines.push("#define PREPASS_DEPTH")), -1 !== this._normalIndex && (defines.push("#define NORMAL_INDEX " + this._normalIndex), defines.push("#define PREPASS_NORMAL"))), this._enablePosition && (defines.push("#define POSITION"), defines.push("#define POSITION_INDEX " + this._positionIndex)), this._enableVelocity && (defines.push("#define VELOCITY"), defines.push("#define VELOCITY_INDEX " + this._velocityIndex), -1 === this.excludedSkinnedMeshesFromVelocity.indexOf(mesh) && defines.push("#define BONES_VELOCITY_ENABLED")), this._enableReflectivity && (defines.push("#define REFLECTIVITY"), defines.push("#define REFLECTIVITY_INDEX " + this._reflectivityIndex)), mesh.useBones && mesh.computeBonesUsingShaders ? (attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind), 4 < mesh.numBoneInfluencers && (attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesExtraKind */.o.MatricesIndicesExtraKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsExtraKind */.o.MatricesWeightsExtraKind)), defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers), defines.push("#define BonesPerMesh " + (mesh.skeleton ? mesh.skeleton.bones.length + 1 : 0))) : defines.push("#define NUM_BONE_INFLUENCERS 0");const morphTargetManager = mesh.morphTargetManager;let numMorphInfluencers = 0;morphTargetManager && 0 < morphTargetManager.numInfluencers && (numMorphInfluencers = morphTargetManager.numInfluencers, defines.push("#define MORPHTARGETS"), defines.push("#define NUM_MORPH_INFLUENCERS " + numMorphInfluencers), morphTargetManager.isUsingTextureForTargets && defines.push("#define MORPHTARGETS_TEXTURE"), materialHelper/* MaterialHelper.PrepareAttributesForMorphTargetsInfluencers */.G.PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, numMorphInfluencers)), useInstances && (defines.push("#define INSTANCES"), materialHelper/* MaterialHelper.PushAttributesForInstances */.G.PushAttributesForInstances(attribs, this._enableVelocity), subMesh.getRenderingMesh().hasThinInstances && defines.push("#define THIN_INSTANCES")), this._linkedWithPrePass ? defines.push("#define RENDER_TARGET_COUNT " + this._attachments.length) : defines.push("#define RENDER_TARGET_COUNT " + this._multiRenderTarget.textures.length), (0,clipPlaneMaterialHelper/* prepareDefinesForClipPlanes */.AN)(material, this._scene, defines);const engine = this._scene.getEngine(),drawWrapper = subMesh._getDrawWrapper(void 0, !0),cachedDefines = drawWrapper.defines,join = defines.join("\n");return cachedDefines !== join && drawWrapper.setEffect(engine.createEffect("geometry", { attributes: attribs, uniformsNames: uniforms, samplers: ["diffuseSampler", "bumpSampler", "reflectivitySampler", "albedoSampler", "morphTargets"], defines: join, onCompiled: null, fallbacks: null, onError: null, uniformBuffersNames: ["Scene"], indexParameters: { buffersCount: this._multiRenderTarget.textures.length - 1, maxSimultaneousMorphTargets: numMorphInfluencers } }, engine), join), drawWrapper.effect.isReady();}getGBuffer() {return this._multiRenderTarget;}get samples() {return this._multiRenderTarget.samples;}set samples(value) {this._multiRenderTarget.samples = value;}dispose() {if (this._resizeObserver) {const engine = this._scene.getEngine();engine.onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null;}this.getGBuffer().dispose();}_assignRenderTargetIndices() {const textureNames = [];let count = 2;return textureNames.push("gBuffer_Depth", "gBuffer_Normal"), this._enablePosition && (this._positionIndex = count, count++, textureNames.push("gBuffer_Position")), this._enableVelocity && (this._velocityIndex = count, count++, textureNames.push("gBuffer_Velocity")), this._enableReflectivity && (this._reflectivityIndex = count, count++, textureNames.push("gBuffer_Reflectivity")), [count, textureNames];}_createRenderTargets() {const engine = this._scene.getEngine(),[count, textureNames] = this._assignRenderTargetIndices();let type = 0;if (engine._caps.textureFloat && engine._caps.textureFloatLinearFiltering ? type = 1 : engine._caps.textureHalfFloat && engine._caps.textureHalfFloatLinearFiltering && (type = 2), this._multiRenderTarget = new MultiRenderTarget("gBuffer", { width: engine.getRenderWidth() * this._ratio, height: engine.getRenderHeight() * this._ratio }, count, this._scene, { generateMipMaps: !1, generateDepthTexture: !0, defaultType: type, depthTextureFormat: this._depthFormat }, textureNames.concat("gBuffer_DepthBuffer")), !this.isSupported) return;this._multiRenderTarget.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._multiRenderTarget.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._multiRenderTarget.refreshRate = 1, this._multiRenderTarget.renderParticles = !1, this._multiRenderTarget.renderList = null, this._multiRenderTarget.onClearObservable.add((engine) => {engine.clear(new math_color/* Color4 */.HE(0, 0, 0, 0), !0, !0, !0);}), this._resizeObserver = engine.onResizeObservable.add(() => {this._multiRenderTarget && this._multiRenderTarget.resize({ width: engine.getRenderWidth() * this._ratio, height: engine.getRenderHeight() * this._ratio });});const renderSubMesh = (subMesh) => {const renderingMesh = subMesh.getRenderingMesh(),effectiveMesh = subMesh.getEffectiveMesh(),scene = this._scene,engine = scene.getEngine(),material = subMesh.getMaterial();if (!material) return;if (effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = !1, this._enableVelocity && !this._previousTransformationMatrices[effectiveMesh.uniqueId] && (this._previousTransformationMatrices[effectiveMesh.uniqueId] = { world: math_vector/* Matrix.Identity */.y3.Identity(), viewProjection: scene.getTransformMatrix() }, renderingMesh.skeleton)) {const bonesTransformations = renderingMesh.skeleton.getTransformMatrices(renderingMesh);this._previousBonesTransformationMatrices[renderingMesh.uniqueId] = this._copyBonesTransformationMatrices(bonesTransformations, new Float32Array(bonesTransformations.length));}const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());if (batch.mustReturn) return;const hardwareInstancedRendering = engine.getCaps().instancedArrays && (null !== batch.visibleInstances[subMesh._id] || renderingMesh.hasThinInstances),world = effectiveMesh.getWorldMatrix();if (this.isReady(subMesh, hardwareInstancedRendering)) {const drawWrapper = subMesh._getDrawWrapper();if (!drawWrapper) return;const effect = drawWrapper.effect;engine.enableEffect(drawWrapper), hardwareInstancedRendering || renderingMesh._bind(subMesh, effect, material.fillMode), this._useUbo ? (materialHelper/* MaterialHelper.BindSceneUniformBuffer */.G.BindSceneUniformBuffer(effect, this._scene.getSceneUniformBuffer()), this._scene.finalizeSceneUbo()) : (effect.setMatrix("viewProjection", scene.getTransformMatrix()), effect.setMatrix("view", scene.getViewMatrix()));let sideOrientation;const instanceDataStorage = renderingMesh._instanceDataStorage;if (!instanceDataStorage.isFrozen && (material.backFaceCulling || null !== renderingMesh.overrideMaterialSideOrientation)) {const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();sideOrientation = renderingMesh.overrideMaterialSideOrientation, null === sideOrientation && (sideOrientation = material.sideOrientation), 0 > mainDeterminant && (sideOrientation = sideOrientation === Materials_material/* Material.ClockWiseSideOrientation */.F.ClockWiseSideOrientation ? Materials_material/* Material.CounterClockWiseSideOrientation */.F.CounterClockWiseSideOrientation : Materials_material/* Material.ClockWiseSideOrientation */.F.ClockWiseSideOrientation);} else sideOrientation = instanceDataStorage.sideOrientation;if (material._preBind(drawWrapper, sideOrientation), material.needAlphaTesting()) {const alphaTexture = material.getAlphaTestTexture();alphaTexture && (effect.setTexture("diffuseSampler", alphaTexture), effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix()));}material.bumpTexture && scene.getEngine().getCaps().standardDerivatives && materialFlags/* MaterialFlags.BumpTextureEnabled */.k.BumpTextureEnabled && (effect.setFloat3("vBumpInfos", material.bumpTexture.coordinatesIndex, 1 / material.bumpTexture.level, material.parallaxScaleBias), effect.setMatrix("bumpMatrix", material.bumpTexture.getTextureMatrix()), effect.setTexture("bumpSampler", material.bumpTexture), effect.setFloat2("vTangentSpaceParams", material.invertNormalMapX ? -1 : 1, material.invertNormalMapY ? -1 : 1)), this._enableReflectivity && ("PBRMetallicRoughnessMaterial" === material.getClassName() ? (null !== material.metallicRoughnessTexture && (effect.setTexture("reflectivitySampler", material.metallicRoughnessTexture), effect.setMatrix("reflectivityMatrix", material.metallicRoughnessTexture.getTextureMatrix())), null !== material.metallic && effect.setFloat("metallic", material.metallic), null !== material.roughness && effect.setFloat("glossiness", 1 - material.roughness), null !== material.baseTexture && (effect.setTexture("albedoSampler", material.baseTexture), effect.setMatrix("albedoMatrix", material.baseTexture.getTextureMatrix())), null !== material.baseColor && effect.setColor3("albedoColor", material.baseColor)) : "PBRSpecularGlossinessMaterial" === material.getClassName() ? (null === material.specularGlossinessTexture ? null !== material.specularColor && effect.setColor3("reflectivityColor", material.specularColor) : (effect.setTexture("reflectivitySampler", material.specularGlossinessTexture), effect.setMatrix("reflectivityMatrix", material.specularGlossinessTexture.getTextureMatrix())), null !== material.glossiness && effect.setFloat("glossiness", material.glossiness)) : "PBRMaterial" === material.getClassName() ? (null !== material.metallicTexture && (effect.setTexture("reflectivitySampler", material.metallicTexture), effect.setMatrix("reflectivityMatrix", material.metallicTexture.getTextureMatrix())), null !== material.metallic && effect.setFloat("metallic", material.metallic), null !== material.roughness && effect.setFloat("glossiness", 1 - material.roughness), null !== material.roughness || null !== material.metallic || null !== material.metallicTexture ? (null !== material.albedoTexture && (effect.setTexture("albedoSampler", material.albedoTexture), effect.setMatrix("albedoMatrix", material.albedoTexture.getTextureMatrix())), null !== material.albedoColor && effect.setColor3("albedoColor", material.albedoColor)) : (null === material.reflectivityTexture ? null !== material.reflectivityColor && effect.setColor3("reflectivityColor", material.reflectivityColor) : (effect.setTexture("reflectivitySampler", material.reflectivityTexture), effect.setMatrix("reflectivityMatrix", material.reflectivityTexture.getTextureMatrix())), null !== material.microSurface && effect.setFloat("glossiness", material.microSurface))) : "StandardMaterial" === material.getClassName() && (null !== material.specularTexture && (effect.setTexture("reflectivitySampler", material.specularTexture), effect.setMatrix("reflectivityMatrix", material.specularTexture.getTextureMatrix())), null !== material.specularColor && effect.setColor3("reflectivityColor", material.specularColor))), (0,clipPlaneMaterialHelper/* bindClipPlane */.an)(effect, material, this._scene), renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton && (effect.setMatrices("mBones", renderingMesh.skeleton.getTransformMatrices(renderingMesh)), this._enableVelocity && effect.setMatrices("mPreviousBones", this._previousBonesTransformationMatrices[renderingMesh.uniqueId])), materialHelper/* MaterialHelper.BindMorphTargetParameters */.G.BindMorphTargetParameters(renderingMesh, effect), renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets && renderingMesh.morphTargetManager._bind(effect), this._enableVelocity && (effect.setMatrix("previousWorld", this._previousTransformationMatrices[effectiveMesh.uniqueId].world), effect.setMatrix("previousViewProjection", this._previousTransformationMatrices[effectiveMesh.uniqueId].viewProjection)), hardwareInstancedRendering && renderingMesh.hasThinInstances && effect.setMatrix("world", world), renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, w) => {isInstance || effect.setMatrix("world", w);});}this._enableVelocity && (this._previousTransformationMatrices[effectiveMesh.uniqueId].world = world.clone(), this._previousTransformationMatrices[effectiveMesh.uniqueId].viewProjection = this._scene.getTransformMatrix().clone(), renderingMesh.skeleton && this._copyBonesTransformationMatrices(renderingMesh.skeleton.getTransformMatrices(renderingMesh), this._previousBonesTransformationMatrices[effectiveMesh.uniqueId]));};this._multiRenderTarget.customIsReadyFunction = (mesh, refreshRate, preWarm) => {if ((preWarm || 0 === refreshRate) && mesh.subMeshes) for (let i = 0; i < mesh.subMeshes.length; ++i) {const subMesh = mesh.subMeshes[i],material = subMesh.getMaterial(),renderingMesh = subMesh.getRenderingMesh();if (!material) continue;const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh()),hardwareInstancedRendering = engine.getCaps().instancedArrays && (null !== batch.visibleInstances[subMesh._id] || renderingMesh.hasThinInstances);if (!this.isReady(subMesh, hardwareInstancedRendering)) return !1;}return !0;}, this._multiRenderTarget.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => {let index;if (this._linkedWithPrePass) {if (!this._prePassRenderer.enabled) return;this._scene.getEngine().bindAttachments(this._attachments);}if (depthOnlySubMeshes.length) {for (engine.setColorWrite(!1), index = 0; index < depthOnlySubMeshes.length; index++) renderSubMesh(depthOnlySubMeshes.data[index]);engine.setColorWrite(!0);}for (index = 0; index < opaqueSubMeshes.length; index++) renderSubMesh(opaqueSubMeshes.data[index]);for (engine.setDepthWrite(!1), index = 0; index < alphaTestSubMeshes.length; index++) renderSubMesh(alphaTestSubMeshes.data[index]);if (this.renderTransparentMeshes) for (index = 0; index < transparentSubMeshes.length; index++) renderSubMesh(transparentSubMeshes.data[index]);engine.setDepthWrite(!0);};}_copyBonesTransformationMatrices(source, target) {for (let i = 0; i < source.length; i++) target[i] = source[i];return target;}}GeometryBufferRenderer.DEPTH_TEXTURE_TYPE = 0, GeometryBufferRenderer.NORMAL_TEXTURE_TYPE = 1, GeometryBufferRenderer.POSITION_TEXTURE_TYPE = 2, GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE = 3, GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE = 4, GeometryBufferRenderer._SceneComponentInitialization = () => {throw (0,devTools/* _WarnImport */.S)("GeometryBufferRendererSceneComponent");};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/motionBlurConfiguration.js
class MotionBlurConfiguration {constructor() {this.enabled = !1, this.name = "motionBlur", this.texturesRequired = [2];}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/geometryBufferRendererSceneComponent.js
Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "geometryBufferRenderer", { get: function () {return this._geometryBufferRenderer;}, set: function (value) {value && value.isSupported && (this._geometryBufferRenderer = value);}, enumerable: !0, configurable: !0 }), core_scene/* Scene.prototype.enableGeometryBufferRenderer */.x.prototype.enableGeometryBufferRenderer = function (ratio = 1, depthFormat = 15) {return this._geometryBufferRenderer ? this._geometryBufferRenderer : (this._geometryBufferRenderer = new GeometryBufferRenderer(this, ratio, depthFormat), this._geometryBufferRenderer.isSupported || (this._geometryBufferRenderer = null), this._geometryBufferRenderer);}, core_scene/* Scene.prototype.disableGeometryBufferRenderer */.x.prototype.disableGeometryBufferRenderer = function () {this._geometryBufferRenderer && (this._geometryBufferRenderer.dispose(), this._geometryBufferRenderer = null);};class GeometryBufferRendererSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER */.l.NAME_GEOMETRYBUFFERRENDERER, this.scene = scene;}register() {this.scene._gatherRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER */.l.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER, this, this._gatherRenderTargets);}rebuild() {}dispose() {}_gatherRenderTargets(renderTargets) {this.scene._geometryBufferRenderer && renderTargets.push(this.scene._geometryBufferRenderer.getGBuffer());}}GeometryBufferRenderer._SceneComponentInitialization = (scene) => {let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER */.l.NAME_GEOMETRYBUFFERRENDERER);component || (component = new GeometryBufferRendererSceneComponent(scene), scene._addComponent(component));};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/motionBlur.fragment.js
const motionBlur_fragment_name = "motionBlurPixelShader",motionBlur_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform float motionStrength;
uniform float motionScale;
uniform vec2 screenSize;
#ifdef OBJECT_BASED
uniform sampler2D velocitySampler;
#else
uniform sampler2D depthSampler;
uniform mat4 inverseViewProjection;
uniform mat4 prevViewProjection;
uniform mat4 projection;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#ifdef GEOMETRY_SUPPORTED
#ifdef OBJECT_BASED
vec2 texelSize=1.0/screenSize;
vec4 velocityColor=texture2D(velocitySampler,vUV);
velocityColor.rg=velocityColor.rg*2.0-vec2(1.0);
vec2 velocity=vec2(pow(velocityColor.r,3.0),pow(velocityColor.g,3.0))*velocityColor.a;
velocity*=motionScale*motionStrength;
float speed=length(velocity/texelSize);
int samplesCount=int(clamp(speed,1.0,SAMPLES));
velocity=normalize(velocity)*texelSize;
float hlim=float(-samplesCount)*0.5+0.5;
vec4 result=texture2D(textureSampler,vUV);
for (int i=1; i<int(SAMPLES); ++i)
{
if (i>=samplesCount)
break;
vec2 offset=vUV+velocity*(hlim+float(i));
result+=texture2D(textureSampler,offset);
}
gl_FragColor=result/float(samplesCount);
gl_FragColor.a=1.0;
#else
vec2 texelSize=1.0/screenSize;
float depth=texture2D(depthSampler,vUV).r;
depth=projection[2].z+projection[3].z/depth; 
vec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);
cpos=inverseViewProjection*cpos;
cpos/=cpos.w;
vec4 ppos=prevViewProjection*cpos;
ppos/=ppos.w;
ppos.xy=ppos.xy*0.5+0.5;
vec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;
float speed=length(velocity/texelSize);
int nSamples=int(clamp(speed,1.0,SAMPLES));
vec4 result=texture2D(textureSampler,vUV);
for (int i=1; i<int(SAMPLES); ++i) {
if (i>=nSamples)
break;
vec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);
result+=texture2D(textureSampler,offset1);
}
gl_FragColor=result/float(nSamples);
#endif
#else
gl_FragColor=texture2D(textureSampler,vUV);
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.motionBlurPixelShader */.v.ShadersStore.motionBlurPixelShader = motionBlur_fragment_shader;const motionBlurPixelShader = { name: "motionBlurPixelShader", shader: motionBlur_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/motionBlurPostProcess.js
class MotionBlurPostProcess extends PostProcesses_postProcess/* PostProcess */.D {get motionBlurSamples() {return this._motionBlurSamples;}set motionBlurSamples(samples) {this._motionBlurSamples = samples, this._updateEffect();}get isObjectBased() {return this._isObjectBased;}set isObjectBased(value) {this._isObjectBased === value || (this._isObjectBased = value, this._applyMode());}get _geometryBufferRenderer() {return this._forceGeometryBuffer ? this._scene.geometryBufferRenderer : null;}get _prePassRenderer() {return this._forceGeometryBuffer ? null : this._scene.prePassRenderer;}getClassName() {return "MotionBlurPostProcess";}constructor(name, scene, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1, forceGeometryBuffer = !1) {super(name, "motionBlur", ["motionStrength", "motionScale", "screenSize", "inverseViewProjection", "prevViewProjection", "projection"], ["velocitySampler", "depthSampler"], options, camera, samplingMode, engine, reusable, "#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0\n#define OBJECT_BASED", textureType, void 0, null, blockCompilation), this.motionStrength = 1, this._motionBlurSamples = 32, this._isObjectBased = !0, this._forceGeometryBuffer = !1, this._invViewProjection = null, this._previousViewProjection = null, this._forceGeometryBuffer = forceGeometryBuffer, this._forceGeometryBuffer ? (scene.enableGeometryBufferRenderer(), this._geometryBufferRenderer && (this._geometryBufferRenderer.enableVelocity = !0)) : (scene.enablePrePassRenderer(), this._prePassRenderer && (this._prePassRenderer.markAsDirty(), this._prePassEffectConfiguration = new MotionBlurConfiguration())), this._applyMode();}excludeSkinnedMesh(skinnedMesh) {if (skinnedMesh.skeleton) {let list;if (this._geometryBufferRenderer) list = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;else if (this._prePassRenderer) list = this._prePassRenderer.excludedSkinnedMesh;else return;list.push(skinnedMesh);}}removeExcludedSkinnedMesh(skinnedMesh) {if (skinnedMesh.skeleton) {let list;if (this._geometryBufferRenderer) list = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;else if (this._prePassRenderer) list = this._prePassRenderer.excludedSkinnedMesh;else return;const index = list.indexOf(skinnedMesh);-1 !== index && list.splice(index, 1);}}dispose(camera) {this._geometryBufferRenderer && (this._geometryBufferRenderer._previousTransformationMatrices = {}, this._geometryBufferRenderer._previousBonesTransformationMatrices = {}, this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity = []), super.dispose(camera);}_applyMode() {return this._geometryBufferRenderer || this._prePassRenderer ? void (this._updateEffect(), this._invViewProjection = null, this._previousViewProjection = null, this.isObjectBased ? (this._prePassRenderer && this._prePassEffectConfiguration && (this._prePassEffectConfiguration.texturesRequired[0] = 2), this.onApply = (effect) => this._onApplyObjectBased(effect)) : (this._invViewProjection = math_vector/* Matrix.Identity */.y3.Identity(), this._previousViewProjection = this._scene.getTransformMatrix().clone(), this._prePassRenderer && this._prePassEffectConfiguration && (this._prePassEffectConfiguration.texturesRequired[0] = 5), this.onApply = (effect) => this._onApplyScreenBased(effect))) : (logger/* Logger.Warn */.Y.Warn("Multiple Render Target support needed to compute object based motion blur"), this.updateEffect());}_onApplyObjectBased(effect) {if (effect.setVector2("screenSize", new math_vector/* Vector2 */.FM(this.width, this.height)), effect.setFloat("motionScale", this._scene.getAnimationRatio()), effect.setFloat("motionStrength", this.motionStrength), this._geometryBufferRenderer) {const velocityIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE);effect.setTexture("velocitySampler", this._geometryBufferRenderer.getGBuffer().textures[velocityIndex]);} else if (this._prePassRenderer) {const velocityIndex = this._prePassRenderer.getIndex(2);effect.setTexture("velocitySampler", this._prePassRenderer.getRenderTarget().textures[velocityIndex]);}}_onApplyScreenBased(effect) {const viewProjection = math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0];if (viewProjection.copyFrom(this._scene.getTransformMatrix()), viewProjection.invertToRef(this._invViewProjection), effect.setMatrix("inverseViewProjection", this._invViewProjection), effect.setMatrix("prevViewProjection", this._previousViewProjection), this._previousViewProjection.copyFrom(viewProjection), effect.setMatrix("projection", this._scene.getProjectionMatrix()), effect.setVector2("screenSize", new math_vector/* Vector2 */.FM(this.width, this.height)), effect.setFloat("motionScale", this._scene.getAnimationRatio()), effect.setFloat("motionStrength", this.motionStrength), this._geometryBufferRenderer) {const depthIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE);effect.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[depthIndex]);} else if (this._prePassRenderer) {const depthIndex = this._prePassRenderer.getIndex(5);effect.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[depthIndex]);}}_updateEffect() {if (this._geometryBufferRenderer || this._prePassRenderer) {const defines = ["#define GEOMETRY_SUPPORTED", "#define SAMPLES " + this._motionBlurSamples.toFixed(1), this._isObjectBased ? "#define OBJECT_BASED" : "#define SCREEN_BASED"];this.updateEffect(defines.join("\n"));}}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new MotionBlurPostProcess(parsedPostProcess.name, scene, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType, !1), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MotionBlurPostProcess.prototype, "motionStrength", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MotionBlurPostProcess.prototype, "motionBlurSamples", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], MotionBlurPostProcess.prototype, "isObjectBased", null), (0,typeStore/* RegisterClass */.H)("BABYLON.MotionBlurPostProcess", MotionBlurPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/refraction.fragment.js
const refraction_fragment_name = "refractionPixelShader",refraction_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform sampler2D refractionSampler;
uniform vec3 baseColor;
uniform float depth;
uniform float colorLevel;
void main() {
float ref=1.0-texture2D(refractionSampler,vUV).r;
vec2 uv=vUV-vec2(0.5);
vec2 offset=uv*depth*ref;
vec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;
gl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);
}`;shaderStore/* ShaderStore.ShadersStore.refractionPixelShader */.v.ShadersStore.refractionPixelShader = refraction_fragment_shader;const refractionPixelShader = { name: "refractionPixelShader", shader: refraction_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/refractionPostProcess.js
class RefractionPostProcess extends PostProcesses_postProcess/* PostProcess */.D {get refractionTexture() {return this._refTexture;}set refractionTexture(value) {this._refTexture && this._ownRefractionTexture && this._refTexture.dispose(), this._refTexture = value, this._ownRefractionTexture = !1;}getClassName() {return "RefractionPostProcess";}constructor(name, refractionTextureUrl, color, depth, colorLevel, options, camera, samplingMode, engine, reusable) {super(name, "refraction", ["baseColor", "depth", "colorLevel"], ["refractionSampler"], options, camera, samplingMode, engine, reusable), this._ownRefractionTexture = !0, this.color = color, this.depth = depth, this.colorLevel = colorLevel, this.refractionTextureUrl = refractionTextureUrl, this.onActivateObservable.add((cam) => {this._refTexture = this._refTexture || new Textures_texture/* Texture */.x(refractionTextureUrl, cam.getScene());}), this.onApplyObservable.add((effect) => {effect.setColor3("baseColor", this.color), effect.setFloat("depth", this.depth), effect.setFloat("colorLevel", this.colorLevel), effect.setTexture("refractionSampler", this._refTexture);});}dispose(camera) {this._refTexture && this._ownRefractionTexture && (this._refTexture.dispose(), this._refTexture = null), super.dispose(camera);}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new RefractionPostProcess(parsedPostProcess.name, parsedPostProcess.refractionTextureUrl, parsedPostProcess.color, parsedPostProcess.depth, parsedPostProcess.colorLevel, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], RefractionPostProcess.prototype, "color", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], RefractionPostProcess.prototype, "depth", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], RefractionPostProcess.prototype, "colorLevel", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], RefractionPostProcess.prototype, "refractionTextureUrl", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.RefractionPostProcess", RefractionPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/sharpen.fragment.js
const sharpen_fragment_name = "sharpenPixelShader",sharpen_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform vec2 screenSize;
uniform vec2 sharpnessAmounts;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec2 onePixel=vec2(1.0,1.0)/screenSize;
vec4 color=texture2D(textureSampler,vUV);
vec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) +
texture2D(textureSampler,vUV+onePixel*vec2(-1,0)) +
texture2D(textureSampler,vUV+onePixel*vec2(1,0)) +
texture2D(textureSampler,vUV+onePixel*vec2(0,1)) -
color*4.0;
gl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);
}`;shaderStore/* ShaderStore.ShadersStore.sharpenPixelShader */.v.ShadersStore.sharpenPixelShader = sharpen_fragment_shader;const sharpenPixelShader = { name: "sharpenPixelShader", shader: sharpen_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/sharpenPostProcess.js
class SharpenPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "SharpenPostProcess";}constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "sharpen", ["sharpnessAmounts", "screenSize"], null, options, camera, samplingMode, engine, reusable, null, textureType, void 0, null, blockCompilation), this.colorAmount = 1, this.edgeAmount = .3, this.onApply = (effect) => {effect.setFloat2("screenSize", this.width, this.height), effect.setFloat2("sharpnessAmounts", this.edgeAmount, this.colorAmount);};}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new SharpenPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.textureType, parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SharpenPostProcess.prototype, "colorAmount", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SharpenPostProcess.prototype, "edgeAmount", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.SharpenPostProcess", SharpenPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipeline.js
class PostProcessRenderPipeline {get name() {return this._name;}get cameras() {return this._cameras;}constructor(_engine, name) {this._engine = _engine, this._name = name, this._renderEffects = {}, this._renderEffectsForIsolatedPass = [], this._cameras = [];}getClassName() {return "PostProcessRenderPipeline";}get isSupported() {for (const renderEffectName in this._renderEffects) if (Object.prototype.hasOwnProperty.call(this._renderEffects, renderEffectName) && !this._renderEffects[renderEffectName].isSupported) return !1;return !0;}addEffect(renderEffect) {this._renderEffects[renderEffect._name] = renderEffect;}_rebuild() {}_enableEffect(renderEffectName, cameras) {const renderEffects = this._renderEffects[renderEffectName];renderEffects && renderEffects._enable(tools/* Tools.MakeArray */.w1.MakeArray(cameras || this._cameras));}_disableEffect(renderEffectName, cameras) {const renderEffects = this._renderEffects[renderEffectName];renderEffects && renderEffects._disable(tools/* Tools.MakeArray */.w1.MakeArray(cameras || this._cameras));}_attachCameras(cameras, unique) {const cams = tools/* Tools.MakeArray */.w1.MakeArray(cameras || this._cameras);if (!cams) return;const indicesToDelete = [];let i;for (i = 0; i < cams.length; i++) {const camera = cams[i];camera && (-1 === this._cameras.indexOf(camera) ? this._cameras.push(camera) : unique && indicesToDelete.push(i));}for (i = 0; i < indicesToDelete.length; i++) cams.splice(indicesToDelete[i], 1);for (const renderEffectName in this._renderEffects) Object.prototype.hasOwnProperty.call(this._renderEffects, renderEffectName) && this._renderEffects[renderEffectName]._attachCameras(cams);}_detachCameras(cameras) {const cams = tools/* Tools.MakeArray */.w1.MakeArray(cameras || this._cameras);if (cams) {for (const renderEffectName in this._renderEffects) Object.prototype.hasOwnProperty.call(this._renderEffects, renderEffectName) && this._renderEffects[renderEffectName]._detachCameras(cams);for (let i = 0; i < cams.length; i++) this._cameras.splice(this._cameras.indexOf(cams[i]), 1);}}_update() {for (const renderEffectName in this._renderEffects) Object.prototype.hasOwnProperty.call(this._renderEffects, renderEffectName) && this._renderEffects[renderEffectName]._update();for (let i = 0; i < this._cameras.length; i++) {if (!this._cameras[i]) continue;const cameraName = this._cameras[i].name;this._renderEffectsForIsolatedPass[cameraName] && this._renderEffectsForIsolatedPass[cameraName]._update();}}_reset() {this._renderEffects = {}, this._renderEffectsForIsolatedPass = [];}_enableMSAAOnFirstPostProcess(sampleCount) {if (!this._engine._features.supportMSAA) return !1;const effectKeys = Object.keys(this._renderEffects);if (0 < effectKeys.length) {const postProcesses = this._renderEffects[effectKeys[0]].getPostProcesses();postProcesses && (postProcesses[0].samples = sampleCount);}return !0;}setPrePassRenderer() {return !1;}dispose() {}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], PostProcessRenderPipeline.prototype, "_name", void 0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js
class PostProcessRenderPipelineManager {constructor() {this._renderPipelines = {};}get supportedPipelines() {const result = [];for (const renderPipelineName in this._renderPipelines) if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {const pipeline = this._renderPipelines[renderPipelineName];pipeline.isSupported && result.push(pipeline);}return result;}addPipeline(renderPipeline) {this._renderPipelines[renderPipeline._name] = renderPipeline;}attachCamerasToRenderPipeline(renderPipelineName, cameras, unique = !1) {const renderPipeline = this._renderPipelines[renderPipelineName];renderPipeline && renderPipeline._attachCameras(cameras, unique);}detachCamerasFromRenderPipeline(renderPipelineName, cameras) {const renderPipeline = this._renderPipelines[renderPipelineName];renderPipeline && renderPipeline._detachCameras(cameras);}enableEffectInPipeline(renderPipelineName, renderEffectName, cameras) {const renderPipeline = this._renderPipelines[renderPipelineName];renderPipeline && renderPipeline._enableEffect(renderEffectName, cameras);}disableEffectInPipeline(renderPipelineName, renderEffectName, cameras) {const renderPipeline = this._renderPipelines[renderPipelineName];renderPipeline && renderPipeline._disableEffect(renderEffectName, cameras);}update() {for (const renderPipelineName in this._renderPipelines) if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {const pipeline = this._renderPipelines[renderPipelineName];pipeline.isSupported ? pipeline._update() : (pipeline.dispose(), delete this._renderPipelines[renderPipelineName]);}}_rebuild() {for (const renderPipelineName in this._renderPipelines) if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {const pipeline = this._renderPipelines[renderPipelineName];pipeline._rebuild();}}dispose() {for (const renderPipelineName in this._renderPipelines) if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {const pipeline = this._renderPipelines[renderPipelineName];pipeline.dispose();}}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js
Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "postProcessRenderPipelineManager", { get: function () {if (!this._postProcessRenderPipelineManager) {let component = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER */.l.NAME_POSTPROCESSRENDERPIPELINEMANAGER);component || (component = new PostProcessRenderPipelineManagerSceneComponent(this), this._addComponent(component)), this._postProcessRenderPipelineManager = new PostProcessRenderPipelineManager();}return this._postProcessRenderPipelineManager;}, enumerable: !0, configurable: !0 });class PostProcessRenderPipelineManagerSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER */.l.NAME_POSTPROCESSRENDERPIPELINEMANAGER, this.scene = scene;}register() {this.scene._gatherRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER */.l.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER, this, this._gatherRenderTargets);}rebuild() {this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager._rebuild();}dispose() {this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.dispose();}_gatherRenderTargets() {this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.update();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js
class DefaultRenderingPipeline extends PostProcessRenderPipeline {get automaticBuild() {return this._buildAllowed;}set automaticBuild(value) {this._buildAllowed = value;}get scene() {return this._scene;}set sharpenEnabled(enabled) {this._sharpenEnabled === enabled || (this._sharpenEnabled = enabled, this._buildPipeline());}get sharpenEnabled() {return this._sharpenEnabled;}get bloomKernel() {return this._bloomKernel;}set bloomKernel(value) {this._bloomKernel = value, this.bloom.kernel = value / this._hardwareScaleLevel;}set bloomWeight(value) {this._bloomWeight === value || (this.bloom.weight = value, this._bloomWeight = value);}get bloomWeight() {return this._bloomWeight;}set bloomThreshold(value) {this._bloomThreshold === value || (this.bloom.threshold = value, this._bloomThreshold = value);}get bloomThreshold() {return this._bloomThreshold;}set bloomScale(value) {this._bloomScale === value || (this._bloomScale = value, this._rebuildBloom(), this._buildPipeline());}get bloomScale() {return this._bloomScale;}set bloomEnabled(enabled) {this._bloomEnabled === enabled || (this._bloomEnabled = enabled, this._buildPipeline());}get bloomEnabled() {return this._bloomEnabled;}_rebuildBloom() {const oldBloom = this.bloom;this.bloom = new BloomEffect(this._scene, this.bloomScale, this._bloomWeight, this.bloomKernel / this._hardwareScaleLevel, this._defaultPipelineTextureType, !1), this.bloom.threshold = oldBloom.threshold;for (let i = 0; i < this._cameras.length; i++) oldBloom.disposeEffects(this._cameras[i]);}get depthOfFieldEnabled() {return this._depthOfFieldEnabled;}set depthOfFieldEnabled(enabled) {this._depthOfFieldEnabled === enabled || (this._depthOfFieldEnabled = enabled, this._buildPipeline());}get depthOfFieldBlurLevel() {return this._depthOfFieldBlurLevel;}set depthOfFieldBlurLevel(value) {if (this._depthOfFieldBlurLevel !== value) {this._depthOfFieldBlurLevel = value;const oldDof = this.depthOfField;this.depthOfField = new DepthOfFieldEffect(this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, !1), this.depthOfField.focalLength = oldDof.focalLength, this.depthOfField.focusDistance = oldDof.focusDistance, this.depthOfField.fStop = oldDof.fStop, this.depthOfField.lensSize = oldDof.lensSize;for (let i = 0; i < this._cameras.length; i++) oldDof.disposeEffects(this._cameras[i]);this._buildPipeline();}}set fxaaEnabled(enabled) {this._fxaaEnabled === enabled || (this._fxaaEnabled = enabled, this._buildPipeline());}get fxaaEnabled() {return this._fxaaEnabled;}set samples(sampleCount) {this._samples === sampleCount || (this._samples = sampleCount, this._buildPipeline());}get samples() {return this._samples;}set imageProcessingEnabled(enabled) {this._imageProcessingEnabled === enabled || (this._scene.imageProcessingConfiguration.isEnabled = enabled);}get imageProcessingEnabled() {return this._imageProcessingEnabled;}set glowLayerEnabled(enabled) {enabled && !this._glowLayer ? this._glowLayer = new GlowLayer("", this._scene) : !enabled && this._glowLayer && (this._glowLayer.dispose(), this._glowLayer = null);}get glowLayerEnabled() {return null != this._glowLayer;}get glowLayer() {return this._glowLayer;}set chromaticAberrationEnabled(enabled) {this._chromaticAberrationEnabled === enabled || (this._chromaticAberrationEnabled = enabled, this._buildPipeline());}get chromaticAberrationEnabled() {return this._chromaticAberrationEnabled;}set grainEnabled(enabled) {this._grainEnabled === enabled || (this._grainEnabled = enabled, this._buildPipeline());}get grainEnabled() {return this._grainEnabled;}constructor(name = "", hdr = !0, scene = engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, cameras, automaticBuild = !0) {super(scene.getEngine(), name), this._camerasToBeAttached = [], this.SharpenPostProcessId = "SharpenPostProcessEffect", this.ImageProcessingPostProcessId = "ImageProcessingPostProcessEffect", this.FxaaPostProcessId = "FxaaPostProcessEffect", this.ChromaticAberrationPostProcessId = "ChromaticAberrationPostProcessEffect", this.GrainPostProcessId = "GrainPostProcessEffect", this._glowLayer = null, this.animations = [], this._imageProcessingConfigurationObserver = null, this._sharpenEnabled = !1, this._bloomEnabled = !1, this._depthOfFieldEnabled = !1, this._depthOfFieldBlurLevel = DepthOfFieldEffectBlurLevel.Low, this._fxaaEnabled = !1, this._imageProcessingEnabled = !0, this._bloomScale = .5, this._chromaticAberrationEnabled = !1, this._grainEnabled = !1, this._buildAllowed = !0, this.onBuildObservable = new observable/* Observable */.y$(), this._resizeObserver = null, this._hardwareScaleLevel = 1, this._bloomKernel = 64, this._bloomWeight = .15, this._bloomThreshold = .9, this._samples = 1, this._hasCleared = !1, this._prevPostProcess = null, this._prevPrevPostProcess = null, this._depthOfFieldSceneObserver = null, this._activeCameraChangedObserver = null, this._activeCamerasChangedObserver = null, this._cameras = cameras || scene.cameras, this._cameras = this._cameras.slice(), this._camerasToBeAttached = this._cameras.slice(), this._buildAllowed = automaticBuild, this._scene = scene;const caps = this._scene.getEngine().getCaps();this._hdr = hdr && (caps.textureHalfFloatRender || caps.textureFloatRender), this._hdr ? caps.textureHalfFloatRender ? this._defaultPipelineTextureType = 2 : caps.textureFloatRender && (this._defaultPipelineTextureType = 1) : this._defaultPipelineTextureType = 0, scene.postProcessRenderPipelineManager.addPipeline(this);const engine = this._scene.getEngine();this.sharpen = new SharpenPostProcess("sharpen", 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, this._defaultPipelineTextureType, !0), this._sharpenEffect = new PostProcessRenderEffect(engine, this.SharpenPostProcessId, () => this.sharpen, !0), this.depthOfField = new DepthOfFieldEffect(this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, !0), this._hardwareScaleLevel = engine.getHardwareScalingLevel(), this._resizeObserver = engine.onResizeObservable.add(() => {this._hardwareScaleLevel = engine.getHardwareScalingLevel(), this.bloomKernel = this._bloomKernel;}), this.bloom = new BloomEffect(this._scene, this._bloomScale, this._bloomWeight, this.bloomKernel / this._hardwareScaleLevel, this._defaultPipelineTextureType, !0), this.chromaticAberration = new ChromaticAberrationPostProcess("ChromaticAberration", engine.getRenderWidth(), engine.getRenderHeight(), 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, this._defaultPipelineTextureType, !0), this._chromaticAberrationEffect = new PostProcessRenderEffect(engine, this.ChromaticAberrationPostProcessId, () => this.chromaticAberration, !0), this.grain = new GrainPostProcess("Grain", 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, this._defaultPipelineTextureType, !0), this._grainEffect = new PostProcessRenderEffect(engine, this.GrainPostProcessId, () => this.grain, !0), this._imageProcessingConfigurationObserver = this._scene.imageProcessingConfiguration.onUpdateParameters.add(() => {this.bloom._downscale._exposure = this._scene.imageProcessingConfiguration.exposure, this.imageProcessingEnabled !== this._scene.imageProcessingConfiguration.isEnabled && (this._imageProcessingEnabled = this._scene.imageProcessingConfiguration.isEnabled, tools/* Tools.SetImmediate */.w1.SetImmediate(() => {this._buildPipeline();}));}), this._buildPipeline();}getClassName() {return "DefaultRenderingPipeline";}prepare() {const previousState = this._buildAllowed;this._buildAllowed = !0, this._buildPipeline(), this._buildAllowed = previousState;}_setAutoClearAndTextureSharing(postProcess, skipTextureSharing = !1) {this._hasCleared ? postProcess.autoClear = !1 : (postProcess.autoClear = !0, this._scene.autoClear = !1, this._hasCleared = !0), skipTextureSharing || (this._prevPrevPostProcess ? postProcess.shareOutputWith(this._prevPrevPostProcess) : postProcess.useOwnOutput(), this._prevPostProcess && (this._prevPrevPostProcess = this._prevPostProcess), this._prevPostProcess = postProcess);}_buildPipeline() {if (this._buildAllowed) {this._scene.autoClear = !0;const engine = this._scene.getEngine();if (this._disposePostProcesses(), null !== this._cameras && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._prevPostProcess = null, this._prevPrevPostProcess = null, this._hasCleared = !1, this.depthOfFieldEnabled) {if (1 < this._cameras.length) {for (const camera of this._cameras) {const depthRenderer = this._scene.enableDepthRenderer(camera);depthRenderer.useOnlyInActiveCamera = !0;}this._depthOfFieldSceneObserver = this._scene.onAfterRenderTargetsRenderObservable.add((scene) => {-1 < this._cameras.indexOf(scene.activeCamera) && (this.depthOfField.depthTexture = scene.enableDepthRenderer(scene.activeCamera).getDepthMap());});} else {this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);const depthRenderer = this._scene.enableDepthRenderer(this._cameras[0]);this.depthOfField.depthTexture = depthRenderer.getDepthMap();}this.depthOfField._isReady() || this.depthOfField._updateEffects(), this.addEffect(this.depthOfField), this._setAutoClearAndTextureSharing(this.depthOfField._effects[0], !0);} else this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);this.bloomEnabled && (!this.bloom._isReady() && this.bloom._updateEffects(), this.addEffect(this.bloom), this._setAutoClearAndTextureSharing(this.bloom._effects[0], !0)), this._imageProcessingEnabled && (this.imageProcessing = new ImageProcessingPostProcess("imageProcessing", 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, this._defaultPipelineTextureType, this.scene.imageProcessingConfiguration), this._hdr ? (this.addEffect(new PostProcessRenderEffect(engine, this.ImageProcessingPostProcessId, () => this.imageProcessing, !0)), this._setAutoClearAndTextureSharing(this.imageProcessing)) : this._scene.imageProcessingConfiguration.applyByPostProcess = !1, (!this._cameras || 0 === this._cameras.length) && (this._scene.imageProcessingConfiguration.applyByPostProcess = !1), !this.imageProcessing.getEffect() && this.imageProcessing._updateParameters()), this.sharpenEnabled && (!this.sharpen.isReady() && this.sharpen.updateEffect(), this.addEffect(this._sharpenEffect), this._setAutoClearAndTextureSharing(this.sharpen)), this.grainEnabled && (!this.grain.isReady() && this.grain.updateEffect(), this.addEffect(this._grainEffect), this._setAutoClearAndTextureSharing(this.grain)), this.chromaticAberrationEnabled && (!this.chromaticAberration.isReady() && this.chromaticAberration.updateEffect(), this.addEffect(this._chromaticAberrationEffect), this._setAutoClearAndTextureSharing(this.chromaticAberration)), this.fxaaEnabled && (this.fxaa = new FxaaPostProcess("fxaa", 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, !1, this._defaultPipelineTextureType), this.addEffect(new PostProcessRenderEffect(engine, this.FxaaPostProcessId, () => this.fxaa, !0)), this._setAutoClearAndTextureSharing(this.fxaa, !0)), null !== this._cameras && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), (this._scene.activeCameras && 1 < this._scene.activeCameras.length || this._scene.activeCamera && -1 === this._cameras.indexOf(this._scene.activeCamera)) && (this._scene.autoClear = !0), this._activeCameraChangedObserver || (this._activeCameraChangedObserver = this._scene.onActiveCameraChanged.add(() => {this._scene.activeCamera && -1 === this._cameras.indexOf(this._scene.activeCamera) && (this._scene.autoClear = !0);})), this._activeCamerasChangedObserver || (this._activeCamerasChangedObserver = this._scene.onActiveCamerasChanged.add(() => {this._scene.activeCameras && 1 < this._scene.activeCameras.length && (this._scene.autoClear = !0);})), !this._enableMSAAOnFirstPostProcess(this.samples) && 1 < this.samples && logger/* Logger.Warn */.Y.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0"), this.onBuildObservable.notifyObservers(this);}}_disposePostProcesses(disposeNonRecreated = !1) {for (let i = 0; i < this._cameras.length; i++) {const camera = this._cameras[i];this.imageProcessing && this.imageProcessing.dispose(camera), this.fxaa && this.fxaa.dispose(camera), disposeNonRecreated && (this.sharpen && this.sharpen.dispose(camera), this.depthOfField && (this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver), this.depthOfField.disposeEffects(camera)), this.bloom && this.bloom.disposeEffects(camera), this.chromaticAberration && this.chromaticAberration.dispose(camera), this.grain && this.grain.dispose(camera), this._glowLayer && this._glowLayer.dispose());}this.imageProcessing = null, this.fxaa = null, disposeNonRecreated && (this.sharpen = null, this._sharpenEffect = null, this.depthOfField = null, this.bloom = null, this.chromaticAberration = null, this._chromaticAberrationEffect = null, this.grain = null, this._grainEffect = null, this._glowLayer = null);}addCamera(camera) {this._camerasToBeAttached.push(camera), this._buildPipeline();}removeCamera(camera) {const index = this._camerasToBeAttached.indexOf(camera);this._camerasToBeAttached.splice(index, 1), this._buildPipeline();}dispose() {this._buildAllowed = !1, this.onBuildObservable.clear(), this._disposePostProcesses(!0), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._scene.autoClear = !0, this._resizeObserver && (this._scene.getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this._scene.onActiveCameraChanged.remove(this._activeCameraChangedObserver), this._scene.onActiveCamerasChanged.remove(this._activeCamerasChangedObserver), this._scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigurationObserver), super.dispose();}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this);return serializationObject.customType = "DefaultRenderingPipeline", serializationObject;}static Parse(source, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new DefaultRenderingPipeline(source._name, source._name._hdr, scene), source, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "sharpenEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "bloomKernel", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "_bloomWeight", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "_bloomThreshold", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "_hdr", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "bloomWeight", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "bloomThreshold", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "bloomScale", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "bloomEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "depthOfFieldEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "depthOfFieldBlurLevel", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "fxaaEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "samples", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "imageProcessingEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "glowLayerEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "chromaticAberrationEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], DefaultRenderingPipeline.prototype, "grainEnabled", null), (0,typeStore/* RegisterClass */.H)("BABYLON.DefaultRenderingPipeline", DefaultRenderingPipeline);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/lensHighlights.fragment.js
const lensHighlights_fragment_name = "lensHighlightsPixelShader",lensHighlights_fragment_shader = `uniform sampler2D textureSampler; 
uniform float gain;
uniform float threshold;
uniform float screen_width;
uniform float screen_height;
varying vec2 vUV;
vec4 highlightColor(vec4 color) {
vec4 highlight=color;
float luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));
float lum_threshold;
if (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }
else { lum_threshold=0.5+0.44*threshold; }
luminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);
highlight*=luminance*gain;
highlight.a=1.0;
return highlight;
}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
vec4 original=texture2D(textureSampler,vUV);
if (gain==-1.0) {
gl_FragColor=vec4(0.0,0.0,0.0,1.0);
return;
}
float w=2.0/screen_width;
float h=2.0/screen_height;
float weight=1.0;
vec4 blurred=vec4(0.0,0.0,0.0,0.0);
#ifdef PENTAGON
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));
#else
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));
#endif
blurred/=39.0;
gl_FragColor=blurred;
}`;shaderStore/* ShaderStore.ShadersStore.lensHighlightsPixelShader */.v.ShadersStore.lensHighlightsPixelShader = lensHighlights_fragment_shader;const lensHighlightsPixelShader = { name: "lensHighlightsPixelShader", shader: lensHighlights_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/depthOfField.fragment.js
const depthOfField_fragment_name = "depthOfFieldPixelShader",depthOfField_fragment_shader = `uniform sampler2D textureSampler;
uniform sampler2D highlightsSampler;
uniform sampler2D depthSampler;
uniform sampler2D grainSampler;
uniform float grain_amount;
uniform bool blur_noise;
uniform float screen_width;
uniform float screen_height;
uniform float distortion;
uniform bool dof_enabled;
uniform float screen_distance; 
uniform float aperture;
uniform float darken;
uniform float edge_blur;
uniform bool highlights;
uniform float near;
uniform float far;
varying vec2 vUV;
#define PI 3.14159265
#define TWOPI 6.28318530
#define inverse_focal_length 0.1 
vec2 centered_screen_pos;
vec2 distorted_coords;
float radius2;
float radius;
vec2 rand(vec2 co)
{
float noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));
float noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));
return clamp(vec2(noise1,noise2),0.0,1.0);
}
vec2 getDistortedCoords(vec2 coords) {
if (distortion==0.0) { return coords; }
vec2 direction=1.0*normalize(centered_screen_pos);
vec2 dist_coords=vec2(0.5,0.5);
dist_coords.x=0.5+direction.x*radius2*1.0;
dist_coords.y=0.5+direction.y*radius2*1.0;
float dist_amount=clamp(distortion*0.23,0.0,1.0);
dist_coords=mix(coords,dist_coords,dist_amount);
return dist_coords;
}
float sampleScreen(inout vec4 color,in vec2 offset,in float weight) {
vec2 coords=distorted_coords;
float angle=rand(coords*100.0).x*TWOPI;
coords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));
color+=texture2D(textureSampler,coords)*weight;
return weight;
}
float getBlurLevel(float size) {
return min(3.0,ceil(size/1.0));
}
vec4 getBlurColor(float size) {
vec4 col=texture2D(textureSampler,distorted_coords);
float blur_level=getBlurLevel(size);
float w=(size/screen_width);
float h=(size/screen_height);
float total_weight=1.0;
vec2 sample_coords;
total_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);
total_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);
total_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);
total_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);
total_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);
total_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);
total_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);
total_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);
total_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);
total_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);
if (blur_level>1.0) {
total_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);
total_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);
total_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);
total_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);
total_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);
total_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);
total_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);
total_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);
total_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);
total_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);
}
if (blur_level>2.0) {
total_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);
total_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);
total_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);
total_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);
total_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);
total_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);
total_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);
total_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);
total_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);
}
col/=total_weight; 
if (darken>0.0) {
col.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);
}
return col;
}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
centered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);
radius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;
radius=sqrt(radius2);
distorted_coords=getDistortedCoords(vUV); 
vec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height); 
float depth=texture2D(depthSampler,distorted_coords).r; 
float distance=near+(far-near)*depth; 
vec4 color=texture2D(textureSampler,vUV); 
float coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));
if (dof_enabled==false || coc<0.07) { coc=0.0; }
float edge_blur_amount=0.0;
if (edge_blur>0.0) {
edge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;
}
float blur_amount=max(edge_blur_amount,coc);
if (blur_amount==0.0) {
gl_FragColor=texture2D(textureSampler,distorted_coords);
}
else {
gl_FragColor=getBlurColor(blur_amount*1.7);
if (highlights) {
gl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;
}
if (blur_noise) {
vec2 noise=rand(distorted_coords)*0.01*blur_amount;
vec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);
gl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;
}
}
if (grain_amount>0.0) {
vec4 grain_color=texture2D(grainSampler,texels_coords*0.003);
gl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;
}
}
`;shaderStore/* ShaderStore.ShadersStore.depthOfFieldPixelShader */.v.ShadersStore.depthOfFieldPixelShader = depthOfField_fragment_shader;const depthOfFieldPixelShader = { name: "depthOfFieldPixelShader", shader: depthOfField_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js
class LensRenderingPipeline extends PostProcessRenderPipeline {constructor(name, parameters, scene, ratio = 1, cameras) {super(scene.getEngine(), name), this.LensChromaticAberrationEffect = "LensChromaticAberrationEffect", this.HighlightsEnhancingEffect = "HighlightsEnhancingEffect", this.LensDepthOfFieldEffect = "LensDepthOfFieldEffect", this._pentagonBokehIsEnabled = !1, this._scene = scene, this._depthTexture = scene.enableDepthRenderer().getDepthMap(), parameters.grain_texture ? this._grainTexture = parameters.grain_texture : this._createGrainTexture(), this._edgeBlur = parameters.edge_blur ? parameters.edge_blur : 0, this._grainAmount = parameters.grain_amount ? parameters.grain_amount : 0, this._chromaticAberration = parameters.chromatic_aberration ? parameters.chromatic_aberration : 0, this._distortion = parameters.distortion ? parameters.distortion : 0, this._highlightsGain = parameters.dof_gain === void 0 ? -1 : parameters.dof_gain, this._highlightsThreshold = parameters.dof_threshold ? parameters.dof_threshold : 1, this._dofDistance = parameters.dof_focus_distance === void 0 ? -1 : parameters.dof_focus_distance, this._dofAperture = parameters.dof_aperture ? parameters.dof_aperture : 1, this._dofDarken = parameters.dof_darken ? parameters.dof_darken : 0, this._dofPentagon = !(parameters.dof_pentagon !== void 0) || parameters.dof_pentagon, this._blurNoise = !(parameters.blur_noise !== void 0) || parameters.blur_noise, this._createChromaticAberrationPostProcess(ratio), this._createHighlightsPostProcess(ratio), this._createDepthOfFieldPostProcess(ratio / 4), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.LensChromaticAberrationEffect, () => this._chromaticAberrationPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.HighlightsEnhancingEffect, () => this._highlightsPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.LensDepthOfFieldEffect, () => this._depthOfFieldPostProcess, !0)), -1 === this._highlightsGain && this._disableEffect(this.HighlightsEnhancingEffect, null), scene.postProcessRenderPipelineManager.addPipeline(this), cameras && scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);}getClassName() {return "LensRenderingPipeline";}get scene() {return this._scene;}get edgeBlur() {return this._edgeBlur;}set edgeBlur(value) {this.setEdgeBlur(value);}get grainAmount() {return this._grainAmount;}set grainAmount(value) {this.setGrainAmount(value);}get chromaticAberration() {return this._chromaticAberration;}set chromaticAberration(value) {this.setChromaticAberration(value);}get dofAperture() {return this._dofAperture;}set dofAperture(value) {this.setAperture(value);}get edgeDistortion() {return this._distortion;}set edgeDistortion(value) {this.setEdgeDistortion(value);}get dofDistortion() {return this._dofDistance;}set dofDistortion(value) {this.setFocusDistance(value);}get darkenOutOfFocus() {return this._dofDarken;}set darkenOutOfFocus(value) {this.setDarkenOutOfFocus(value);}get blurNoise() {return this._blurNoise;}set blurNoise(value) {this._blurNoise = value;}get pentagonBokeh() {return this._pentagonBokehIsEnabled;}set pentagonBokeh(value) {value ? this.enablePentagonBokeh() : this.disablePentagonBokeh();}get highlightsGain() {return this._highlightsGain;}set highlightsGain(value) {this.setHighlightsGain(value);}get highlightsThreshold() {return this._highlightsThreshold;}set highlightsThreshold(value) {this.setHighlightsThreshold(value);}setEdgeBlur(amount) {this._edgeBlur = amount;}disableEdgeBlur() {this._edgeBlur = 0;}setGrainAmount(amount) {this._grainAmount = amount;}disableGrain() {this._grainAmount = 0;}setChromaticAberration(amount) {this._chromaticAberration = amount;}disableChromaticAberration() {this._chromaticAberration = 0;}setEdgeDistortion(amount) {this._distortion = amount;}disableEdgeDistortion() {this._distortion = 0;}setFocusDistance(amount) {this._dofDistance = amount;}disableDepthOfField() {this._dofDistance = -1;}setAperture(amount) {this._dofAperture = amount;}setDarkenOutOfFocus(amount) {this._dofDarken = amount;}enablePentagonBokeh() {this._highlightsPostProcess.updateEffect("#define PENTAGON\n"), this._pentagonBokehIsEnabled = !0;}disablePentagonBokeh() {this._pentagonBokehIsEnabled = !1, this._highlightsPostProcess.updateEffect();}enableNoiseBlur() {this._blurNoise = !0;}disableNoiseBlur() {this._blurNoise = !1;}setHighlightsGain(amount) {this._highlightsGain = amount;}setHighlightsThreshold(amount) {-1 === this._highlightsGain && (this._highlightsGain = 1), this._highlightsThreshold = amount;}disableHighlights() {this._highlightsGain = -1;}dispose(disableDepthRender = !1) {this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), this._chromaticAberrationPostProcess = null, this._highlightsPostProcess = null, this._depthOfFieldPostProcess = null, this._grainTexture.dispose(), disableDepthRender && this._scene.disableDepthRenderer();}_createChromaticAberrationPostProcess(ratio) {this._chromaticAberrationPostProcess = new PostProcesses_postProcess/* PostProcess */.D("LensChromaticAberration", "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], ratio, null, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._chromaticAberrationPostProcess.onApply = (effect) => {effect.setFloat("chromatic_aberration", this._chromaticAberration), effect.setFloat("screen_width", this._scene.getEngine().getRenderWidth()), effect.setFloat("screen_height", this._scene.getEngine().getRenderHeight()), effect.setFloat("radialIntensity", 1), effect.setFloat2("direction", 17, 17), effect.setFloat2("centerPosition", .5, .5);};}_createHighlightsPostProcess(ratio) {this._highlightsPostProcess = new PostProcesses_postProcess/* PostProcess */.D("LensHighlights", "lensHighlights", ["gain", "threshold", "screen_width", "screen_height"], [], ratio, null, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, this._dofPentagon ? "#define PENTAGON\n" : ""), this._highlightsPostProcess.externalTextureSamplerBinding = !0, this._highlightsPostProcess.onApply = (effect) => {effect.setFloat("gain", this._highlightsGain), effect.setFloat("threshold", this._highlightsThreshold), effect.setTextureFromPostProcess("textureSampler", this._chromaticAberrationPostProcess), effect.setFloat("screen_width", this._scene.getEngine().getRenderWidth()), effect.setFloat("screen_height", this._scene.getEngine().getRenderHeight());};}_createDepthOfFieldPostProcess(ratio) {this._depthOfFieldPostProcess = new PostProcesses_postProcess/* PostProcess */.D("LensDepthOfField", "depthOfField", ["grain_amount", "blur_noise", "screen_width", "screen_height", "distortion", "dof_enabled", "screen_distance", "aperture", "darken", "edge_blur", "highlights", "near", "far"], ["depthSampler", "grainSampler", "highlightsSampler"], ratio, null, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._depthOfFieldPostProcess.externalTextureSamplerBinding = !0, this._depthOfFieldPostProcess.onApply = (effect) => {effect.setTexture("depthSampler", this._depthTexture), effect.setTexture("grainSampler", this._grainTexture), effect.setTextureFromPostProcess("textureSampler", this._highlightsPostProcess), effect.setTextureFromPostProcess("highlightsSampler", this._depthOfFieldPostProcess), effect.setFloat("grain_amount", this._grainAmount), effect.setBool("blur_noise", this._blurNoise), effect.setFloat("screen_width", this._scene.getEngine().getRenderWidth()), effect.setFloat("screen_height", this._scene.getEngine().getRenderHeight()), effect.setFloat("distortion", this._distortion), effect.setBool("dof_enabled", -1 !== this._dofDistance), effect.setFloat("screen_distance", 1 / (.1 - 1 / this._dofDistance)), effect.setFloat("aperture", this._dofAperture), effect.setFloat("darken", this._dofDarken), effect.setFloat("edge_blur", this._edgeBlur), effect.setBool("highlights", -1 !== this._highlightsGain), this._scene.activeCamera && (effect.setFloat("near", this._scene.activeCamera.minZ), effect.setFloat("far", this._scene.activeCamera.maxZ));};}_createGrainTexture() {const size = 512;this._grainTexture = new DynamicTexture("LensNoiseTexture", 512, this._scene, !1, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE), this._grainTexture.wrapU = Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE, this._grainTexture.wrapV = Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE;const context = this._grainTexture.getContext(),rand = (min, max) => Math.random() * (max - min) + min;let value;for (let x = 0; x < size; x++) for (let y = 0; y < size; y++) value = Math.floor(255 * rand(.42, .58)), context.fillStyle = "rgb(" + value + ", " + value + ", " + value + ")", context.fillRect(x, y, 1, 1);this._grainTexture.update(!1);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/ssao2Configuration.js
class SSAO2Configuration {constructor() {this.enabled = !1, this.name = "ssao2", this.texturesRequired = [6, 5];}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ssao2.fragment.js
const ssao2_fragment_name = "ssao2PixelShader",ssao2_fragment_shader = `precision highp float;
uniform sampler2D textureSampler;
uniform float near;
uniform float far;
uniform float radius;
float scales[16]=float[16](
0.1,
0.11406250000000001,
0.131640625,
0.15625,
0.187890625,
0.2265625,
0.272265625,
0.325,
0.384765625,
0.4515625,
0.525390625,
0.60625,
0.694140625,
0.7890625,
0.891015625,
1.0
);
varying vec2 vUV;
float perspectiveDepthToViewZ(in float invClipZ,in float near,in float far ) {
return ( near*far )/( ( far-near )*invClipZ-far );
}
float viewZToPerspectiveDepth( in float viewZ,in float near,in float far ) {
return ( near*far/viewZ+far)/( far-near );
}
float viewZToOrthographicDepth( in float viewZ,in float near,in float far ) {
return ( viewZ+near )/( near-far );
}
#ifdef SSAO
uniform sampler2D randomSampler;
uniform sampler2D depthSampler;
uniform sampler2D normalSampler;
uniform float randTextureTiles;
uniform float samplesFactor;
uniform vec3 sampleSphere[SAMPLES];
uniform float totalStrength;
uniform float base;
uniform float xViewport;
uniform float yViewport;
uniform mat3 depthProjection;
uniform float maxZ;
uniform float minZAspect;
uniform vec2 texelSize;
uniform mat4 projection;
void main()
{
vec3 random=texture2D(randomSampler,vUV*randTextureTiles).rgb;
float depth=texture2D(depthSampler,vUV).r;
float depthSign=depth/abs(depth);
depth=depth*depthSign;
vec3 normal=texture2D(normalSampler,vUV).rgb;
float occlusion=0.0;
float correctedRadius=min(radius,minZAspect*depth/near);
vec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);
vec3 vDepthFactor=depthProjection*vec3(1.0,1.0,depth);
vec3 origin=vViewRay*vDepthFactor;
vec3 rvec=random*2.0-1.0;
rvec.z=0.0;
float dotProduct=dot(rvec,normal);
rvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);
vec3 tangent=normalize(rvec-normal*dot(rvec,normal));
vec3 bitangent=cross(normal,tangent);
mat3 tbn=mat3(tangent,bitangent,normal);
float difference;
for (int i=0; i<SAMPLES; ++i) {
vec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];
samplePosition=samplePosition*correctedRadius+origin;
vec4 offset=vec4(samplePosition,1.0);
offset=projection*offset;
offset.xyz/=offset.w;
offset.xy=offset.xy*0.5+0.5;
if (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {
continue;
}
float sampleDepth=abs(texture2D(depthSampler,offset.xy).r);
difference=depthSign*samplePosition.z-sampleDepth;
float rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);
occlusion+=(difference>=0.0 ? 1.0 : 0.0)*rangeCheck;
}
occlusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));
float ao=1.0-totalStrength*occlusion*samplesFactor;
float result=clamp(ao+base,0.0,1.0);
gl_FragColor=vec4(vec3(result),1.0);
}
#endif
#ifdef BILATERAL_BLUR
uniform sampler2D depthSampler;
uniform float outSize;
uniform float samplerOffsets[SAMPLES];
vec4 blur9(sampler2D image,vec2 uv,float resolution,vec2 direction) {
vec4 color=vec4(0.0);
vec2 off1=vec2(1.3846153846)*direction;
vec2 off2=vec2(3.2307692308)*direction;
color+=texture2D(image,uv)*0.2270270270;
color+=texture2D(image,uv+(off1/resolution))*0.3162162162;
color+=texture2D(image,uv-(off1/resolution))*0.3162162162;
color+=texture2D(image,uv+(off2/resolution))*0.0702702703;
color+=texture2D(image,uv-(off2/resolution))*0.0702702703;
return color;
}
vec4 blur13(sampler2D image,vec2 uv,float resolution,vec2 direction) {
vec4 color=vec4(0.0);
vec2 off1=vec2(1.411764705882353)*direction;
vec2 off2=vec2(3.2941176470588234)*direction;
vec2 off3=vec2(5.176470588235294)*direction;
color+=texture2D(image,uv)*0.1964825501511404;
color+=texture2D(image,uv+(off1/resolution))*0.2969069646728344;
color+=texture2D(image,uv-(off1/resolution))*0.2969069646728344;
color+=texture2D(image,uv+(off2/resolution))*0.09447039785044732;
color+=texture2D(image,uv-(off2/resolution))*0.09447039785044732;
color+=texture2D(image,uv+(off3/resolution))*0.010381362401148057;
color+=texture2D(image,uv-(off3/resolution))*0.010381362401148057;
return color;
}
vec4 blur13Bilateral(sampler2D image,vec2 uv,float resolution,vec2 direction) {
vec4 color=vec4(0.0);
vec2 off1=vec2(1.411764705882353)*direction;
vec2 off2=vec2(3.2941176470588234)*direction;
vec2 off3=vec2(5.176470588235294)*direction;
float compareDepth=abs(texture2D(depthSampler,uv).r);
float sampleDepth;
float weight;
float weightSum=30.0;
color+=texture2D(image,uv)*30.0;
sampleDepth=abs(texture2D(depthSampler,uv+(off1/resolution)).r);
weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);
weightSum+= weight;
color+=texture2D(image,uv+(off1/resolution))*weight;
sampleDepth=abs(texture2D(depthSampler,uv-(off1/resolution)).r);
weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);
weightSum+= weight;
color+=texture2D(image,uv-(off1/resolution))*weight;
sampleDepth=abs(texture2D(depthSampler,uv+(off2/resolution)).r);
weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);
weightSum+=weight;
color+=texture2D(image,uv+(off2/resolution))*weight;
sampleDepth=abs(texture2D(depthSampler,uv-(off2/resolution)).r);
weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);
weightSum+=weight;
color+=texture2D(image,uv-(off2/resolution))*weight;
sampleDepth=abs(texture2D(depthSampler,uv+(off3/resolution)).r);
weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);
weightSum+=weight;
color+=texture2D(image,uv+(off3/resolution))*weight;
sampleDepth=abs(texture2D(depthSampler,uv-(off3/resolution)).r);
weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);
weightSum+=weight;
color+=texture2D(image,uv-(off3/resolution))*weight;
return color/weightSum;
}
void main()
{
#if EXPENSIVE
float compareDepth=abs(texture2D(depthSampler,vUV).r);
float texelsize=1.0/outSize;
float result=0.0;
float weightSum=0.0;
for (int i=0; i<SAMPLES; ++i)
{
#ifdef BILATERAL_BLUR_H
vec2 direction=vec2(1.0,0.0);
vec2 sampleOffset=vec2(texelsize*samplerOffsets[i],0.0);
#else
vec2 direction=vec2(0.0,1.0);
vec2 sampleOffset=vec2(0.0,texelsize*samplerOffsets[i]);
#endif
vec2 samplePos=vUV+sampleOffset;
float sampleDepth=abs(texture2D(depthSampler,samplePos).r);
float weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30000.0);
result+=texture2D(textureSampler,samplePos).r*weight;
weightSum+=weight;
}
result/=weightSum;
gl_FragColor.rgb=vec3(result);
gl_FragColor.a=1.0;
#else
vec4 color;
#ifdef BILATERAL_BLUR_H
vec2 direction=vec2(1.0,0.0);
color=blur13Bilateral(textureSampler,vUV,outSize,direction);
#else
vec2 direction=vec2(0.0,1.0);
color=blur13Bilateral(textureSampler,vUV,outSize,direction);
#endif
gl_FragColor.rgb=vec3(color.r);
gl_FragColor.a=1.0;
#endif
}
#endif
`;shaderStore/* ShaderStore.ShadersStore.ssao2PixelShader */.v.ShadersStore.ssao2PixelShader = ssao2_fragment_shader;const ssao2PixelShader = { name: "ssao2PixelShader", shader: ssao2_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ssaoCombine.fragment.js
const ssaoCombine_fragment_name = "ssaoCombinePixelShader",ssaoCombine_fragment_shader = `uniform sampler2D textureSampler;
uniform sampler2D originalColor;
uniform vec4 viewport;
varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 ssaoColor=texture2D(textureSampler,viewport.xy+vUV*viewport.zw);
vec4 sceneColor=texture2D(originalColor,vUV);
gl_FragColor=sceneColor*ssaoColor;
#define CUSTOM_FRAGMENT_MAIN_END
}
`;shaderStore/* ShaderStore.ShadersStore.ssaoCombinePixelShader */.v.ShadersStore.ssaoCombinePixelShader = ssaoCombine_fragment_shader;const ssaoCombinePixelShader = { name: "ssaoCombinePixelShader", shader: ssaoCombine_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js
class SSAO2RenderingPipeline extends PostProcessRenderPipeline {set samples(n) {this._samples = n, this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO()), this._sampleSphere = this._generateHemisphere();}get samples() {return this._samples;}set textureSamples(n) {this._textureSamples = n, this._prePassRenderer ? this._prePassRenderer.samples = n : this._originalColorPostProcess.samples = n;}get textureSamples() {return this._textureSamples;}get _geometryBufferRenderer() {return this._forceGeometryBuffer ? this._scene.geometryBufferRenderer : null;}get _prePassRenderer() {return this._forceGeometryBuffer ? null : this._scene.prePassRenderer;}set expensiveBlur(b) {this._blurHPostProcess.updateEffect("#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE " + (b ? "1" : "0") + "\n", null, ["textureSampler", "depthSampler"]), this._blurVPostProcess.updateEffect("#define BILATERAL_BLUR\n#define SAMPLES 16\n#define EXPENSIVE " + (b ? "1" : "0") + "\n", null, ["textureSampler", "depthSampler"]), this._expensiveBlur = b;}get expensiveBlur() {return this._expensiveBlur;}static get IsSupported() {const engine = engineStore/* EngineStore.LastCreatedEngine */.l.LastCreatedEngine;return !!engine && engine._features.supportSSAO2;}get scene() {return this._scene;}constructor(name, scene, ratio, cameras, forceGeometryBuffer = !1, textureType = 0) {if (super(scene.getEngine(), name), this.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect", this.SSAORenderEffect = "SSAORenderEffect", this.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect", this.SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect", this.SSAOCombineRenderEffect = "SSAOCombineRenderEffect", this.totalStrength = 1, this.maxZ = 100, this.minZAspect = .2, this._samples = 8, this._textureSamples = 1, this._forceGeometryBuffer = !1, this._expensiveBlur = !0, this.radius = 2, this.base = 0, this._bits = new Uint32Array(1), this._scene = scene, this._ratio = ratio, this._forceGeometryBuffer = forceGeometryBuffer, !this.isSupported) return void logger/* Logger.Error */.Y.Error("The current engine does not support SSAO 2.");const ssaoRatio = this._ratio.ssaoRatio || ratio,blurRatio = this._ratio.blurRatio || ratio;this._forceGeometryBuffer ? scene.enableGeometryBufferRenderer() : scene.enablePrePassRenderer(), this._createRandomTexture(), this._originalColorPostProcess = new passPostProcess/* PassPostProcess */.Q("SSAOOriginalSceneColor", 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), void 0, textureType), this._originalColorPostProcess.samples = this.textureSamples, this._createSSAOPostProcess(1, textureType), this._createBlurPostProcess(ssaoRatio, blurRatio, textureType), this._createSSAOCombinePostProcess(blurRatio, textureType), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOOriginalSceneColorEffect, () => this._originalColorPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAORenderEffect, () => this._ssaoPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurHRenderEffect, () => this._blurHPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurVRenderEffect, () => this._blurVPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOCombineRenderEffect, () => this._ssaoCombinePostProcess, !0)), scene.postProcessRenderPipelineManager.addPipeline(this), cameras && scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);}getClassName() {return "SSAO2RenderingPipeline";}dispose(disableGeometryBufferRenderer = !1) {for (let i = 0; i < this._scene.cameras.length; i++) {const camera = this._scene.cameras[i];this._originalColorPostProcess.dispose(camera), this._ssaoPostProcess.dispose(camera), this._blurHPostProcess.dispose(camera), this._blurVPostProcess.dispose(camera), this._ssaoCombinePostProcess.dispose(camera);}this._randomTexture.dispose(), disableGeometryBufferRenderer && this._scene.disableGeometryBufferRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), super.dispose();}_createBlurPostProcess(ssaoRatio, blurRatio, textureType) {this._samplerOffsets = [];const expensive = this.expensiveBlur;for (let i = -8; 8 > i; i++) this._samplerOffsets.push(2 * i + .5);this._blurHPostProcess = new PostProcesses_postProcess/* PostProcess */.D("BlurH", "ssao2", ["outSize", "samplerOffsets", "near", "far", "radius"], ["depthSampler"], ssaoRatio, null, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, "#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE " + (expensive ? "1" : "0") + "\n", textureType), this._blurHPostProcess.onApply = (effect) => {this._scene.activeCamera && (effect.setFloat("outSize", 0 < this._ssaoCombinePostProcess.width ? this._ssaoCombinePostProcess.width : this._originalColorPostProcess.width), effect.setFloat("near", this._scene.activeCamera.minZ), effect.setFloat("far", this._scene.activeCamera.maxZ), effect.setFloat("radius", this.radius), this._geometryBufferRenderer ? effect.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[0]) : this._prePassRenderer && effect.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]), effect.setArray("samplerOffsets", this._samplerOffsets));}, this._blurVPostProcess = new PostProcesses_postProcess/* PostProcess */.D("BlurV", "ssao2", ["outSize", "samplerOffsets", "near", "far", "radius"], ["depthSampler"], blurRatio, null, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, "#define BILATERAL_BLUR\n#define BILATERAL_BLUR_V\n#define SAMPLES 16\n#define EXPENSIVE " + (expensive ? "1" : "0") + "\n", textureType), this._blurVPostProcess.onApply = (effect) => {this._scene.activeCamera && (effect.setFloat("outSize", 0 < this._ssaoCombinePostProcess.height ? this._ssaoCombinePostProcess.height : this._originalColorPostProcess.height), effect.setFloat("near", this._scene.activeCamera.minZ), effect.setFloat("far", this._scene.activeCamera.maxZ), effect.setFloat("radius", this.radius), this._geometryBufferRenderer ? effect.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[0]) : this._prePassRenderer && effect.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]), effect.setArray("samplerOffsets", this._samplerOffsets));}, this._blurHPostProcess.samples = this.textureSamples, this._blurVPostProcess.samples = this.textureSamples;}_rebuild() {super._rebuild();}_radicalInverse_VdC(i) {return this._bits[0] = i, this._bits[0] = (this._bits[0] << 16 | this._bits[0] >> 16) >>> 0, this._bits[0] = (1431655765 & this._bits[0]) << 1 | (2863311530 & this._bits[0]) >>> 1 >>> 0, this._bits[0] = (858993459 & this._bits[0]) << 2 | (3435973836 & this._bits[0]) >>> 2 >>> 0, this._bits[0] = (252645135 & this._bits[0]) << 4 | (4042322160 & this._bits[0]) >>> 4 >>> 0, this._bits[0] = (16711935 & this._bits[0]) << 8 | (4278255360 & this._bits[0]) >>> 8 >>> 0, 23283064365386963e-26 * this._bits[0];}_hammersley(i, n) {return [i / n, this._radicalInverse_VdC(i)];}_hemisphereSample_uniform(u, v) {const phi = 2 * v * Math.PI,cosTheta = 1 - .85 * u,sinTheta = Math.sqrt(1 - cosTheta * cosTheta);return new math_vector/* Vector3 */.P(Math.cos(phi) * sinTheta, Math.sin(phi) * sinTheta, cosTheta);}_generateHemisphere() {const numSamples = this.samples,result = [];let vector,i = 0;for (; i < numSamples;) {if (16 > numSamples) vector = this._hemisphereSample_uniform(Math.random(), Math.random());else {const rand = this._hammersley(i, numSamples);vector = this._hemisphereSample_uniform(rand[0], rand[1]);}result.push(vector.x, vector.y, vector.z), i++;}return result;}_getDefinesForSSAO() {const defines = "#define SAMPLES " + this.samples + "\n#define SSAO";return defines;}_createSSAOPostProcess(ratio, textureType) {this._sampleSphere = this._generateHemisphere();const defines = this._getDefinesForSSAO();this._ssaoPostProcess = new PostProcesses_postProcess/* PostProcess */.D("ssao2", "ssao2", ["sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius", "base", "range", "projection", "near", "far", "texelSize", "xViewport", "yViewport", "maxZ", "minZAspect", "depthProjection"], ["randomSampler", "depthSampler", "normalSampler"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, defines, textureType), this._ssaoPostProcess.onApply = (effect) => {var _a, _b, _c, _d;if (this._scene.activeCamera) {if (effect.setArray3("sampleSphere", this._sampleSphere), effect.setFloat("randTextureTiles", 32), effect.setFloat("samplesFactor", 1 / this.samples), effect.setFloat("totalStrength", this.totalStrength), effect.setFloat2("texelSize", 1 / this._ssaoPostProcess.width, 1 / this._ssaoPostProcess.height), effect.setFloat("radius", this.radius), effect.setFloat("maxZ", this.maxZ), effect.setFloat("minZAspect", this.minZAspect), effect.setFloat("base", this.base), effect.setFloat("near", this._scene.activeCamera.minZ), effect.setFloat("far", this._scene.activeCamera.maxZ), this._scene.activeCamera.mode === Cameras_camera/* Camera.PERSPECTIVE_CAMERA */.V.PERSPECTIVE_CAMERA) effect.setMatrix3x3("depthProjection", SSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION), effect.setFloat("xViewport", Math.tan(this._scene.activeCamera.fov / 2) * this._scene.getEngine().getAspectRatio(this._scene.activeCamera, !0)), effect.setFloat("yViewport", Math.tan(this._scene.activeCamera.fov / 2));else {const halfWidth = this._scene.getEngine().getRenderWidth() / 2,halfHeight = this._scene.getEngine().getRenderHeight() / 2,orthoLeft = null !== (_a = this._scene.activeCamera.orthoLeft) && void 0 !== _a ? _a : -halfWidth,orthoRight = null !== (_b = this._scene.activeCamera.orthoRight) && void 0 !== _b ? _b : halfWidth,orthoBottom = null !== (_c = this._scene.activeCamera.orthoBottom) && void 0 !== _c ? _c : -halfHeight,orthoTop = null !== (_d = this._scene.activeCamera.orthoTop) && void 0 !== _d ? _d : halfHeight;effect.setMatrix3x3("depthProjection", SSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION), effect.setFloat("xViewport", .5 * (orthoRight - orthoLeft)), effect.setFloat("yViewport", .5 * (orthoTop - orthoBottom));}effect.setMatrix("projection", this._scene.getProjectionMatrix()), this._geometryBufferRenderer ? (effect.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[0]), effect.setTexture("normalSampler", this._geometryBufferRenderer.getGBuffer().textures[1])) : this._prePassRenderer && (effect.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]), effect.setTexture("normalSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(6)])), effect.setTexture("randomSampler", this._randomTexture);}}, this._ssaoPostProcess.samples = this.textureSamples, this._forceGeometryBuffer || (this._ssaoPostProcess._prePassEffectConfiguration = new SSAO2Configuration());}_createSSAOCombinePostProcess(ratio, textureType) {this._ssaoCombinePostProcess = new PostProcesses_postProcess/* PostProcess */.D("ssaoCombine", "ssaoCombine", [], ["originalColor", "viewport"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, void 0, textureType), this._ssaoCombinePostProcess.onApply = (effect) => {const viewport = this._scene.activeCamera.viewport;effect.setVector4("viewport", math_vector/* TmpVectors.Vector4.0.copyFromFloats */.jp.Vector4[0].copyFromFloats(viewport.x, viewport.y, viewport.width, viewport.height)), effect.setTextureFromPostProcessOutput("originalColor", this._originalColorPostProcess);}, this._ssaoCombinePostProcess.samples = this.textureSamples;}_createRandomTexture() {const size = 128;this._randomTexture = new DynamicTexture("SSAORandomTexture", 128, this._scene, !1, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE), this._randomTexture.wrapU = Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE, this._randomTexture.wrapV = Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE;const context = this._randomTexture.getContext(),rand = (min, max) => Math.random() * (max - min) + min,randVector = math_vector/* Vector3.Zero */.P.Zero();for (let x = 0; x < size; x++) for (let y = 0; y < size; y++) randVector.x = rand(0, 1), randVector.y = rand(0, 1), randVector.z = 0, randVector.normalize(), randVector.scaleInPlace(255), randVector.x = Math.floor(randVector.x), randVector.y = Math.floor(randVector.y), context.fillStyle = "rgb(" + randVector.x + ", " + randVector.y + ", " + randVector.z + ")", context.fillRect(x, y, 1, 1);this._randomTexture.update(!1);}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this);return serializationObject.customType = "SSAO2RenderingPipeline", serializationObject;}static Parse(source, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new SSAO2RenderingPipeline(source._name, scene, source._ratio), source, scene, rootUrl);}}SSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION = [1, 0, 0, 0, 1, 0, 0, 0, 1], SSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION = [0, 0, 0, 0, 0, 0, 1, 1, 1], (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAO2RenderingPipeline.prototype, "totalStrength", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAO2RenderingPipeline.prototype, "maxZ", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAO2RenderingPipeline.prototype, "minZAspect", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("samples")], SSAO2RenderingPipeline.prototype, "_samples", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("textureSamples")], SSAO2RenderingPipeline.prototype, "_textureSamples", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAO2RenderingPipeline.prototype, "_ratio", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)("expensiveBlur")], SSAO2RenderingPipeline.prototype, "_expensiveBlur", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAO2RenderingPipeline.prototype, "radius", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAO2RenderingPipeline.prototype, "base", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.SSAO2RenderingPipeline", SSAO2RenderingPipeline);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ssao.fragment.js
const ssao_fragment_name = "ssaoPixelShader",ssao_fragment_shader = `uniform sampler2D textureSampler;
varying vec2 vUV;
#ifdef SSAO
uniform sampler2D randomSampler;
uniform float randTextureTiles;
uniform float samplesFactor;
uniform vec3 sampleSphere[SAMPLES];
uniform float totalStrength;
uniform float radius;
uniform float area;
uniform float fallOff;
uniform float base;
vec3 normalFromDepth(float depth,vec2 coords)
{
vec2 offset1=vec2(0.0,radius);
vec2 offset2=vec2(radius,0.0);
float depth1=texture2D(textureSampler,coords+offset1).r;
float depth2=texture2D(textureSampler,coords+offset2).r;
vec3 p1=vec3(offset1,depth1-depth);
vec3 p2=vec3(offset2,depth2-depth);
vec3 normal=cross(p1,p2);
normal.z=-normal.z;
return normalize(normal);
}
void main()
{
vec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);
float depth=texture2D(textureSampler,vUV).r;
vec3 position=vec3(vUV,depth);
vec3 normal=normalFromDepth(depth,vUV);
float radiusDepth=radius/depth;
float occlusion=0.0;
vec3 ray;
vec3 hemiRay;
float occlusionDepth;
float difference;
for (int i=0; i<SAMPLES; i++)
{
ray=radiusDepth*reflect(sampleSphere[i],random);
hemiRay=position+sign(dot(ray,normal))*ray;
occlusionDepth=texture2D(textureSampler,clamp(hemiRay.xy,vec2(0.001,0.001),vec2(0.999,0.999))).r;
difference=depth-occlusionDepth;
occlusion+=step(fallOff,difference)*(1.0-smoothstep(fallOff,area,difference));
}
float ao=1.0-totalStrength*occlusion*samplesFactor;
float result=clamp(ao+base,0.0,1.0);
gl_FragColor.r=result;
gl_FragColor.g=result;
gl_FragColor.b=result;
gl_FragColor.a=1.0;
}
#endif
`;shaderStore/* ShaderStore.ShadersStore.ssaoPixelShader */.v.ShadersStore.ssaoPixelShader = ssao_fragment_shader;const ssaoPixelShader = { name: "ssaoPixelShader", shader: ssao_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js
class SSAORenderingPipeline extends PostProcessRenderPipeline {get scene() {return this._scene;}constructor(name, scene, ratio, cameras) {super(scene.getEngine(), name), this.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect", this.SSAORenderEffect = "SSAORenderEffect", this.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect", this.SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect", this.SSAOCombineRenderEffect = "SSAOCombineRenderEffect", this.totalStrength = 1, this.radius = 1e-4, this.area = .0075, this.fallOff = 1e-6, this.base = .5, this._firstUpdate = !0, this._scene = scene, this._createRandomTexture();const ssaoRatio = ratio.ssaoRatio || ratio,combineRatio = ratio.combineRatio || ratio;this._originalColorPostProcess = new passPostProcess/* PassPostProcess */.Q("SSAOOriginalSceneColor", combineRatio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1), this._createSSAOPostProcess(ssaoRatio), this._createBlurPostProcess(ssaoRatio), this._createSSAOCombinePostProcess(combineRatio), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOOriginalSceneColorEffect, () => this._originalColorPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAORenderEffect, () => this._ssaoPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurHRenderEffect, () => this._blurHPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurVRenderEffect, () => this._blurVPostProcess, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOCombineRenderEffect, () => this._ssaoCombinePostProcess, !0)), scene.postProcessRenderPipelineManager.addPipeline(this), cameras && scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);}_attachCameras(cameras, unique) {super._attachCameras(cameras, unique);for (const camera of this._cameras) this._scene.enableDepthRenderer(camera).getDepthMap();}getClassName() {return "SSAORenderingPipeline";}dispose(disableDepthRender = !1) {for (let i = 0; i < this._scene.cameras.length; i++) {const camera = this._scene.cameras[i];this._originalColorPostProcess.dispose(camera), this._ssaoPostProcess.dispose(camera), this._blurHPostProcess.dispose(camera), this._blurVPostProcess.dispose(camera), this._ssaoCombinePostProcess.dispose(camera);}this._randomTexture.dispose(), disableDepthRender && this._scene.disableDepthRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), super.dispose();}_createBlurPostProcess(ratio) {const size = 16;this._blurHPostProcess = new BlurPostProcess("BlurH", new math_vector/* Vector2 */.FM(1, 0), 16, ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, 0), this._blurVPostProcess = new BlurPostProcess("BlurV", new math_vector/* Vector2 */.FM(0, 1), 16, ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, 0), this._blurHPostProcess.onActivateObservable.add(() => {const dw = this._blurHPostProcess.width / this._scene.getEngine().getRenderWidth();this._blurHPostProcess.kernel = size * dw;}), this._blurVPostProcess.onActivateObservable.add(() => {const dw = this._blurVPostProcess.height / this._scene.getEngine().getRenderHeight();this._blurVPostProcess.kernel = size * dw;});}_rebuild() {this._firstUpdate = !0, super._rebuild();}_createSSAOPostProcess(ratio) {const sampleSphere = [.5381, .1856, -.4319, .1379, .2486, .443, .3371, .5679, -.0057, -.6999, -.0451, -.0019, .0689, -.1598, -.8547, .056, .0069, -.1843, -.0146, .1402, .0762, .01, -.1924, -.0344, -.3577, -.5301, -.4358, -.3169, .1063, .0158, .0103, -.5869, .0046, -.0897, -.494, .3287, .7119, -.0154, -.0918, -.0533, .0596, -.5411, .0352, -.0631, .546, -.4776, .2847, -.0271];this._ssaoPostProcess = new PostProcesses_postProcess/* PostProcess */.D("ssao", "ssao", ["sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius", "area", "fallOff", "base", "range", "viewport"], ["randomSampler"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, "#define SAMPLES 16\n#define SSAO"), this._ssaoPostProcess.externalTextureSamplerBinding = !0, this._ssaoPostProcess.onApply = (effect) => {this._firstUpdate && (effect.setArray3("sampleSphere", sampleSphere), effect.setFloat("samplesFactor", 1 / 16), effect.setFloat("randTextureTiles", 4)), effect.setFloat("totalStrength", this.totalStrength), effect.setFloat("radius", this.radius), effect.setFloat("area", this.area), effect.setFloat("fallOff", this.fallOff), effect.setFloat("base", this.base), effect.setTexture("textureSampler", this._scene.enableDepthRenderer(this._scene.activeCamera).getDepthMap()), effect.setTexture("randomSampler", this._randomTexture);};}_createSSAOCombinePostProcess(ratio) {this._ssaoCombinePostProcess = new PostProcesses_postProcess/* PostProcess */.D("ssaoCombine", "ssaoCombine", [], ["originalColor", "viewport"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._ssaoCombinePostProcess.onApply = (effect) => {effect.setVector4("viewport", math_vector/* TmpVectors.Vector4.0.copyFromFloats */.jp.Vector4[0].copyFromFloats(0, 0, 1, 1)), effect.setTextureFromPostProcess("originalColor", this._originalColorPostProcess);};}_createRandomTexture() {const size = 512;this._randomTexture = new DynamicTexture("SSAORandomTexture", 512, this._scene, !1, Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE), this._randomTexture.wrapU = Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE, this._randomTexture.wrapV = Textures_texture/* Texture.WRAP_ADDRESSMODE */.x.WRAP_ADDRESSMODE;const context = this._randomTexture.getContext(),rand = (min, max) => Math.random() * (max - min) + min,randVector = math_vector/* Vector3.Zero */.P.Zero();for (let x = 0; x < size; x++) for (let y = 0; y < size; y++) randVector.x = Math.floor(255 * Math.max(0, rand(-1, 1))), randVector.y = Math.floor(255 * Math.max(0, rand(-1, 1))), randVector.z = Math.floor(255 * Math.max(0, rand(-1, 1))), context.fillStyle = "rgb(" + randVector.x + ", " + randVector.y + ", " + randVector.z + ")", context.fillRect(x, y, 1, 1);this._randomTexture.update(!1);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAORenderingPipeline.prototype, "totalStrength", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAORenderingPipeline.prototype, "radius", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAORenderingPipeline.prototype, "area", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAORenderingPipeline.prototype, "fallOff", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], SSAORenderingPipeline.prototype, "base", void 0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/screenSpaceReflectionsConfiguration.js
class ScreenSpaceReflectionsConfiguration {constructor() {this.enabled = !1, this.name = "screenSpaceReflections", this.texturesRequired = [6, 3, 1];}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/screenSpaceReflection.fragment.js
const screenSpaceReflection_fragment_name = "screenSpaceReflectionPixelShader",screenSpaceReflection_fragment_shader = `uniform sampler2D textureSampler;
#ifdef SSR_SUPPORTED
uniform sampler2D reflectivitySampler;
uniform sampler2D normalSampler;
uniform sampler2D positionSampler;
#endif
uniform mat4 view;
uniform mat4 projection;
uniform float stepSize;
uniform float strength;
uniform float threshold;
uniform float roughnessFactor;
uniform float reflectionSpecularFalloffExponent;
varying vec2 vUV;
#ifdef SSR_SUPPORTED
struct ReflectionInfo {
vec3 color;
vec4 coords;
};
/**
* According to specular,see https:
*/
vec3 fresnelSchlick(float cosTheta,vec3 F0)
{
return F0+(1.0-F0)*pow(1.0-cosTheta,5.0);
}
/**
* Once the pixel's coordinates has been found,let's adjust (smooth) a little bit
* by sampling multiple reflection pixels.
*/
ReflectionInfo smoothReflectionInfo(vec3 dir,vec3 hitCoord)
{
ReflectionInfo info;
info.color=vec3(0.0);
vec4 projectedCoord;
float sampledDepth;
for(int i=0; i<SMOOTH_STEPS; i++)
{
projectedCoord=projection*vec4(hitCoord,1.0);
projectedCoord.xy/=projectedCoord.w;
projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);
sampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;
float depth=sampledDepth-hitCoord.z;
dir*=0.5;
if(depth>0.0)
hitCoord-=dir;
else
hitCoord+=dir;
info.color+=texture2D(textureSampler,projectedCoord.xy).rgb;
}
projectedCoord=projection*vec4(hitCoord,1.0);
projectedCoord.xy/=projectedCoord.w;
projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);
info.coords=vec4(projectedCoord.xy,sampledDepth,1.0);
info.color+=texture2D(textureSampler,projectedCoord.xy).rgb;
info.color/=float(SMOOTH_STEPS+1);
return info;
}
/**
* Tests the given world position (hitCoord) according to the given reflection vector (dir)
* until it finds a collision (means that depth is enough close to say "it's the pixel to sample!").
*/
ReflectionInfo getReflectionInfo(vec3 dir,vec3 hitCoord)
{
ReflectionInfo info;
vec4 projectedCoord;
float sampledDepth;
dir*=stepSize;
for(int i=0; i<REFLECTION_SAMPLES; i++)
{
hitCoord+=dir;
projectedCoord=projection*vec4(hitCoord,1.0);
projectedCoord.xy/=projectedCoord.w;
projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);
sampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;
float depth=sampledDepth-hitCoord.z;
#ifdef RIGHT_HANDED_SCENE
depth*=-1.0;
#endif
if(((depth-dir.z)<threshold) && depth<=0.0)
{
#ifdef ENABLE_SMOOTH_REFLECTIONS
return smoothReflectionInfo(dir,hitCoord);
#else
info.color=texture2D(textureSampler,projectedCoord.xy).rgb;
info.coords=vec4(projectedCoord.xy,sampledDepth,0.0);
return info;
#endif
}
}
info.color=texture2D(textureSampler,projectedCoord.xy).rgb;
info.coords=vec4(projectedCoord.xy,sampledDepth,0.0);
return info;
}
vec3 hash(vec3 a)
{
a=fract(a*0.8);
a+=dot(a,a.yxz+19.19);
return fract((a.xxy+a.yxx)*a.zyx);
}
#endif
void main()
{
#ifdef SSR_SUPPORTED
vec4 albedoFull=texture2D(textureSampler,vUV);
vec3 albedo=albedoFull.rgb;
float spec=texture2D(reflectivitySampler,vUV).r;
if (spec==0.0) {
gl_FragColor=albedoFull;
return;
}
vec3 normal=(texture2D(normalSampler,vUV)).xyz;
vec3 position=(view*texture2D(positionSampler,vUV)).xyz;
vec3 reflected=normalize(reflect(normalize(position),normalize(normal)));
float roughness=1.0-texture2D(reflectivitySampler,vUV).a;
vec3 jitt=mix(vec3(0.0),hash(position),roughness)*roughnessFactor;
ReflectionInfo info=getReflectionInfo(jitt+reflected,position);
vec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-info.coords.xy));
float screenEdgefactor=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);
vec3 F0=vec3(0.04);
F0 =mix(F0,albedo,spec);
vec3 fresnel=fresnelSchlick(max(dot(normalize(normal),normalize(position)),0.0),F0);
#ifdef RIGHT_HANDED_SCENE
reflected.z*=-1.0;
#endif
float reflectionMultiplier=clamp(pow(spec*strength,reflectionSpecularFalloffExponent)*screenEdgefactor*reflected.z,0.0,0.9);
float albedoMultiplier=1.0-reflectionMultiplier;
vec3 SSR=info.color*fresnel;
gl_FragColor=vec4((albedo*albedoMultiplier)+(SSR*reflectionMultiplier),albedoFull.a);
#else
gl_FragColor=texture2D(textureSampler,vUV);
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.screenSpaceReflectionPixelShader */.v.ShadersStore.screenSpaceReflectionPixelShader = screenSpaceReflection_fragment_shader;const screenSpaceReflectionPixelShader = { name: "screenSpaceReflectionPixelShader", shader: screenSpaceReflection_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/screenSpaceReflectionPostProcess.js
class ScreenSpaceReflectionPostProcess extends PostProcesses_postProcess/* PostProcess */.D {get _geometryBufferRenderer() {return this._forceGeometryBuffer ? this._scene.geometryBufferRenderer : null;}get _prePassRenderer() {return this._forceGeometryBuffer ? null : this._scene.prePassRenderer;}getClassName() {return "ScreenSpaceReflectionPostProcess";}constructor(name, scene, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1, forceGeometryBuffer = !1) {if (super(name, "screenSpaceReflection", ["projection", "view", "threshold", "reflectionSpecularFalloffExponent", "strength", "stepSize", "roughnessFactor"], ["textureSampler", "normalSampler", "positionSampler", "reflectivitySampler"], options, camera, samplingMode, engine, reusable, "#define SSR_SUPPORTED\n#define REFLECTION_SAMPLES 64\n#define SMOOTH_STEPS 5\n", textureType, void 0, null, blockCompilation), this.threshold = 1.2, this.strength = 1, this.reflectionSpecularFalloffExponent = 3, this.step = 1, this.roughnessFactor = .2, this._forceGeometryBuffer = !1, this._enableSmoothReflections = !1, this._reflectionSamples = 64, this._smoothSteps = 5, this._forceGeometryBuffer = forceGeometryBuffer, this._forceGeometryBuffer) {const geometryBufferRenderer = scene.enableGeometryBufferRenderer();geometryBufferRenderer && geometryBufferRenderer.isSupported && (geometryBufferRenderer.enablePosition = !0, geometryBufferRenderer.enableReflectivity = !0);} else {const prePassRenderer = scene.enablePrePassRenderer();null === prePassRenderer || void 0 === prePassRenderer ? void 0 : prePassRenderer.markAsDirty(), this._prePassEffectConfiguration = new ScreenSpaceReflectionsConfiguration();}this._updateEffectDefines(), this.onApply = (effect) => {const geometryBufferRenderer = this._geometryBufferRenderer,prePassRenderer = this._prePassRenderer;if (!prePassRenderer && !geometryBufferRenderer) return;if (geometryBufferRenderer) {const positionIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.POSITION_TEXTURE_TYPE),roughnessIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE);effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[1]), effect.setTexture("positionSampler", geometryBufferRenderer.getGBuffer().textures[positionIndex]), effect.setTexture("reflectivitySampler", geometryBufferRenderer.getGBuffer().textures[roughnessIndex]);} else if (prePassRenderer) {const positionIndex = prePassRenderer.getIndex(1),roughnessIndex = prePassRenderer.getIndex(3),normalIndex = prePassRenderer.getIndex(6);effect.setTexture("normalSampler", prePassRenderer.getRenderTarget().textures[normalIndex]), effect.setTexture("positionSampler", prePassRenderer.getRenderTarget().textures[positionIndex]), effect.setTexture("reflectivitySampler", prePassRenderer.getRenderTarget().textures[roughnessIndex]);}const camera = scene.activeCamera;if (!camera) return;const viewMatrix = camera.getViewMatrix(!0),projectionMatrix = camera.getProjectionMatrix(!0);effect.setMatrix("projection", projectionMatrix), effect.setMatrix("view", viewMatrix), effect.setFloat("threshold", this.threshold), effect.setFloat("reflectionSpecularFalloffExponent", this.reflectionSpecularFalloffExponent), effect.setFloat("strength", this.strength), effect.setFloat("stepSize", this.step), effect.setFloat("roughnessFactor", this.roughnessFactor);}, this._isSceneRightHanded = scene.useRightHandedSystem;}get enableSmoothReflections() {return this._enableSmoothReflections;}set enableSmoothReflections(enabled) {enabled === this._enableSmoothReflections || (this._enableSmoothReflections = enabled, this._updateEffectDefines());}get reflectionSamples() {return this._reflectionSamples;}set reflectionSamples(samples) {samples === this._reflectionSamples || (this._reflectionSamples = samples, this._updateEffectDefines());}get smoothSteps() {return this._smoothSteps;}set smoothSteps(steps) {steps === this._smoothSteps || (this._smoothSteps = steps, this._updateEffectDefines());}_updateEffectDefines() {const defines = [];(this._geometryBufferRenderer || this._prePassRenderer) && defines.push("#define SSR_SUPPORTED"), this._enableSmoothReflections && defines.push("#define ENABLE_SMOOTH_REFLECTIONS"), this._isSceneRightHanded && defines.push("#define RIGHT_HANDED_SCENE"), defines.push("#define REFLECTION_SAMPLES " + (this._reflectionSamples >> 0)), defines.push("#define SMOOTH_STEPS " + (this._smoothSteps >> 0)), this.updateEffect(defines.join("\n"));}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new ScreenSpaceReflectionPostProcess(parsedPostProcess.name, scene, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.textureType, parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceReflectionPostProcess.prototype, "threshold", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceReflectionPostProcess.prototype, "strength", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceReflectionPostProcess.prototype, "reflectionSpecularFalloffExponent", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceReflectionPostProcess.prototype, "step", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceReflectionPostProcess.prototype, "roughnessFactor", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceReflectionPostProcess.prototype, "enableSmoothReflections", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceReflectionPostProcess.prototype, "reflectionSamples", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceReflectionPostProcess.prototype, "smoothSteps", null), (0,typeStore/* RegisterClass */.H)("BABYLON.ScreenSpaceReflectionPostProcess", ScreenSpaceReflectionPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/standard.fragment.js
const standard_fragment_name = "standardPixelShader",standard_fragment_shader = `uniform sampler2D textureSampler;
varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
#if defined(PASS_POST_PROCESS)
void main(void)
{
vec4 color=texture2D(textureSampler,vUV);
gl_FragColor=color;
}
#endif
#if defined(DOWN_SAMPLE_X4)
uniform vec2 dsOffsets[16];
void main(void)
{
vec4 average=vec4(0.0,0.0,0.0,0.0);
average=texture2D(textureSampler,vUV+dsOffsets[0]);
average+=texture2D(textureSampler,vUV+dsOffsets[1]);
average+=texture2D(textureSampler,vUV+dsOffsets[2]);
average+=texture2D(textureSampler,vUV+dsOffsets[3]);
average+=texture2D(textureSampler,vUV+dsOffsets[4]);
average+=texture2D(textureSampler,vUV+dsOffsets[5]);
average+=texture2D(textureSampler,vUV+dsOffsets[6]);
average+=texture2D(textureSampler,vUV+dsOffsets[7]);
average+=texture2D(textureSampler,vUV+dsOffsets[8]);
average+=texture2D(textureSampler,vUV+dsOffsets[9]);
average+=texture2D(textureSampler,vUV+dsOffsets[10]);
average+=texture2D(textureSampler,vUV+dsOffsets[11]);
average+=texture2D(textureSampler,vUV+dsOffsets[12]);
average+=texture2D(textureSampler,vUV+dsOffsets[13]);
average+=texture2D(textureSampler,vUV+dsOffsets[14]);
average+=texture2D(textureSampler,vUV+dsOffsets[15]);
average/=16.0;
gl_FragColor=average;
}
#endif
#if defined(BRIGHT_PASS)
uniform vec2 dsOffsets[4];
uniform float brightThreshold;
void main(void)
{
vec4 average=vec4(0.0,0.0,0.0,0.0);
average=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));
average+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));
average+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));
average+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));
average*=0.25;
float luminance=length(average.rgb);
if (luminance<brightThreshold) {
average=vec4(0.0,0.0,0.0,1.0);
}
gl_FragColor=average;
}
#endif
#if defined(TEXTURE_ADDER)
uniform sampler2D otherSampler;
uniform sampler2D lensSampler;
uniform float exposure;
void main(void)
{
vec3 colour=texture2D(textureSampler,vUV).rgb;
colour*=exposure;
vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);
vec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);
colour=retColor*retColor;
colour+=colour*texture2D(lensSampler,vUV).rgb;
vec4 finalColor=vec4(colour.rgb,1.0)+texture2D(otherSampler,vUV);
gl_FragColor=finalColor;
}
#endif
#if defined(VLS)
#define PI 3.1415926535897932384626433832795
uniform mat4 shadowViewProjection;
uniform mat4 lightWorld;
uniform vec3 cameraPosition;
uniform vec3 sunDirection;
uniform vec3 sunColor;
uniform vec2 depthValues;
uniform float scatteringCoefficient;
uniform float scatteringPower;
uniform sampler2D shadowMapSampler;
uniform sampler2D positionSampler;
float computeScattering(float lightDotView)
{
float result=1.0-scatteringCoefficient*scatteringCoefficient;
result/=(4.0*PI*pow(1.0+scatteringCoefficient*scatteringCoefficient-(2.0*scatteringCoefficient)*lightDotView,1.5));
return result;
}
void main(void)
{
vec3 worldPos=texture2D(positionSampler,vUV).rgb;
vec3 startPosition=cameraPosition;
vec3 rayVector=worldPos-startPosition;
float rayLength=length(rayVector);
vec3 rayDirection=rayVector/rayLength;
float stepLength=rayLength/NB_STEPS;
vec3 stepL=rayDirection*stepLength;
vec3 currentPosition=startPosition;
vec3 accumFog=vec3(0.0);
for (int i=0; i<int(NB_STEPS); i++)
{
vec4 worldInShadowCameraSpace=shadowViewProjection*vec4(currentPosition,1.0);
float depthMetric= (worldInShadowCameraSpace.z+depthValues.x)/(depthValues.y);
float shadowPixelDepth=clamp(depthMetric,0.0,1.0);
worldInShadowCameraSpace.xyz/=worldInShadowCameraSpace.w;
worldInShadowCameraSpace.xyz=0.5*worldInShadowCameraSpace.xyz+vec3(0.5);
float shadowMapValue=texture2D(shadowMapSampler,worldInShadowCameraSpace.xy).r;
if (shadowMapValue>shadowPixelDepth)
accumFog+=sunColor*computeScattering(dot(rayDirection,sunDirection));
currentPosition+=stepL;
}
accumFog/=NB_STEPS;
vec3 color=accumFog*scatteringPower;
gl_FragColor=vec4(color*exp(color) ,1.0);
}
#endif
#if defined(VLSMERGE)
uniform sampler2D originalSampler;
void main(void)
{
gl_FragColor=texture2D(originalSampler,vUV)+texture2D(textureSampler,vUV);
}
#endif
#if defined(LUMINANCE)
uniform vec2 lumOffsets[4];
void main()
{
float average=0.0;
vec4 color=vec4(0.0);
float maximum=-1e20;
vec3 weight=vec3(0.299,0.587,0.114);
for (int i=0; i<4; i++)
{
color=texture2D(textureSampler,vUV+ lumOffsets[i]);
float GreyValue=dot(color.rgb,vec3(0.33,0.33,0.33));
#ifdef WEIGHTED_AVERAGE
float GreyValue=dot(color.rgb,weight);
#endif
#ifdef BRIGHTNESS
float GreyValue=max(color.r,max(color.g,color.b));
#endif
#ifdef HSL_COMPONENT
float GreyValue=0.5*(max(color.r,max(color.g,color.b))+min(color.r,min(color.g,color.b)));
#endif
#ifdef MAGNITUDE
float GreyValue=length(color.rgb);
#endif
maximum=max(maximum,GreyValue);
average+=(0.25*log(1e-5+GreyValue));
}
average=exp(average);
gl_FragColor=vec4(average,maximum,0.0,1.0);
}
#endif
#if defined(LUMINANCE_DOWN_SAMPLE)
uniform vec2 dsOffsets[9];
uniform float halfDestPixelSize;
#ifdef FINAL_DOWN_SAMPLER
#include<packingFunctions>
#endif
void main()
{
vec4 color=vec4(0.0);
float average=0.0;
for (int i=0; i<9; i++)
{
color=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);
average+=color.r;
}
average/=9.0;
#ifdef FINAL_DOWN_SAMPLER
gl_FragColor=pack(average);
#else
gl_FragColor=vec4(average,average,0.0,1.0);
#endif
}
#endif
#if defined(HDR)
uniform sampler2D textureAdderSampler;
uniform float averageLuminance;
void main()
{
vec4 color=texture2D(textureAdderSampler,vUV);
#ifndef AUTO_EXPOSURE
vec4 adjustedColor=color/averageLuminance;
color=adjustedColor;
color.a=1.0;
#endif
gl_FragColor=color;
}
#endif
#if defined(LENS_FLARE)
#define GHOSTS 3
uniform sampler2D lensColorSampler;
uniform float strength;
uniform float ghostDispersal;
uniform float haloWidth;
uniform vec2 resolution;
uniform float distortionStrength;
float hash(vec2 p)
{
float h=dot(p,vec2(127.1,311.7));
return -1.0+2.0*fract(sin(h)*43758.5453123);
}
float noise(in vec2 p)
{
vec2 i=floor(p);
vec2 f=fract(p);
vec2 u=f*f*(3.0-2.0*f);
return mix(mix(hash(i+vec2(0.0,0.0)),
hash(i+vec2(1.0,0.0)),u.x),
mix(hash(i+vec2(0.0,1.0)),
hash(i+vec2(1.0,1.0)),u.x),u.y);
}
float fbm(vec2 p)
{
float f=0.0;
f+=0.5000*noise(p); p*=2.02;
f+=0.2500*noise(p); p*=2.03;
f+=0.1250*noise(p); p*=2.01;
f+=0.0625*noise(p); p*=2.04;
f/=0.9375;
return f;
}
vec3 pattern(vec2 uv)
{
vec2 p=-1.0+2.0*uv;
float p2=dot(p,p);
float f=fbm(vec2(15.0*p2))/2.0;
float r=0.2+0.6*sin(12.5*length(uv-vec2(0.5)));
float g=0.2+0.6*sin(20.5*length(uv-vec2(0.5)));
float b=0.2+0.6*sin(17.2*length(uv-vec2(0.5)));
return (1.0-f)*vec3(r,g,b);
}
float luminance(vec3 color)
{
return dot(color.rgb,vec3(0.2126,0.7152,0.0722));
}
vec4 textureDistorted(sampler2D tex,vec2 texcoord,vec2 direction,vec3 distortion)
{
return vec4(
texture2D(tex,texcoord+direction*distortion.r).r,
texture2D(tex,texcoord+direction*distortion.g).g,
texture2D(tex,texcoord+direction*distortion.b).b,
1.0
);
}
void main(void)
{
vec2 uv=-vUV+vec2(1.0);
vec2 ghostDir=(vec2(0.5)-uv)*ghostDispersal;
vec2 texelSize=1.0/resolution;
vec3 distortion=vec3(-texelSize.x*distortionStrength,0.0,texelSize.x*distortionStrength);
vec4 result=vec4(0.0);
float ghostIndice=1.0;
for (int i=0; i<GHOSTS; ++i)
{
vec2 offset=fract(uv+ghostDir*ghostIndice);
float weight=length(vec2(0.5)-offset)/length(vec2(0.5));
weight=pow(1.0-weight,10.0);
result+=textureDistorted(textureSampler,offset,normalize(ghostDir),distortion)*weight*strength;
ghostIndice+=1.0;
}
vec2 haloVec=normalize(ghostDir)*haloWidth;
float weight=length(vec2(0.5)-fract(uv+haloVec))/length(vec2(0.5));
weight=pow(1.0-weight,10.0);
result+=textureDistorted(textureSampler,fract(uv+haloVec),normalize(ghostDir),distortion)*weight*strength;
result*=texture2D(lensColorSampler,vec2(length(vec2(0.5)-uv)/length(vec2(0.5))));
gl_FragColor=result;
}
#endif
#if defined(LENS_FLARE_COMPOSE)
uniform sampler2D otherSampler;
uniform sampler2D lensDirtSampler;
uniform sampler2D lensStarSampler;
uniform mat4 lensStarMatrix;
void main(void)
{
vec2 lensFlareCoords=(lensStarMatrix*vec4(vUV,1.0,1.0)).xy;
vec4 lensMod=texture2D(lensDirtSampler,vUV);
lensMod+=texture2D(lensStarSampler,vUV/*lensFlareCoords*/);
vec4 result=texture2D(textureSampler,vUV)*lensMod;
gl_FragColor=texture2D(otherSampler,vUV)+result;
}
#endif
#if defined(DEPTH_OF_FIELD)
uniform sampler2D otherSampler;
uniform sampler2D depthSampler;
uniform float distance;
void main(void)
{
vec4 sharp=texture2D(otherSampler,vUV);
vec4 blur=texture2D(textureSampler,vUV);
float dist=clamp(texture2D(depthSampler,vUV).r*distance,0.0,1.0);
float factor=0.0;
if (dist<0.05)
factor=1.0;
else if (dist<0.1)
factor=20.0*(0.1-dist);
else if (dist<0.5)
factor=0.0;
else
factor=2.0*(dist-0.5);
factor=clamp(factor,0.0,0.90);
gl_FragColor=mix(sharp,blur,factor);
}
#endif
#if defined(MOTION_BLUR)
uniform mat4 inverseViewProjection;
uniform mat4 prevViewProjection;
uniform vec2 screenSize;
uniform float motionScale;
uniform float motionStrength;
uniform sampler2D depthSampler;
void main(void)
{
vec2 texelSize=1.0/screenSize;
float depth=texture2D(depthSampler,vUV).r;
vec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);
cpos=cpos*inverseViewProjection;
vec4 ppos=cpos*prevViewProjection;
ppos.xyz/=ppos.w;
ppos.xy=ppos.xy*0.5+0.5;
vec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;
float speed=length(velocity/texelSize);
int nSamples=int(clamp(speed,1.0,MAX_MOTION_SAMPLES));
vec4 result=texture2D(textureSampler,vUV);
for (int i=1; i<int(MAX_MOTION_SAMPLES); ++i) {
if (i>=nSamples)
break;
vec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);
result+=texture2D(textureSampler,offset1);
}
gl_FragColor=result/float(nSamples);
}
#endif
`;shaderStore/* ShaderStore.ShadersStore.standardPixelShader */.v.ShadersStore.standardPixelShader = standard_fragment_shader;const standardPixelShader = { name: "standardPixelShader", shader: standard_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js
class StandardRenderingPipeline extends PostProcessRenderPipeline {get exposure() {return this._fixedExposure;}set exposure(value) {this._fixedExposure = value, this._currentExposure = value;}get hdrAutoExposure() {return this._hdrAutoExposure;}set hdrAutoExposure(value) {if (this._hdrAutoExposure = value, this.hdrPostProcess) {const defines = ["#define HDR"];value && defines.push("#define AUTO_EXPOSURE"), this.hdrPostProcess.updateEffect(defines.join("\n"));}}get motionStrength() {return this._motionStrength;}set motionStrength(strength) {this._motionStrength = strength, this._isObjectBasedMotionBlur && this.motionBlurPostProcess && (this.motionBlurPostProcess.motionStrength = strength);}get objectBasedMotionBlur() {return this._isObjectBasedMotionBlur;}set objectBasedMotionBlur(value) {const shouldRebuild = this._isObjectBasedMotionBlur !== value;this._isObjectBasedMotionBlur = value, shouldRebuild && this._buildPipeline();}get BloomEnabled() {return this._bloomEnabled;}set BloomEnabled(enabled) {this._bloomEnabled === enabled || (this._bloomEnabled = enabled, this._buildPipeline());}get DepthOfFieldEnabled() {return this._depthOfFieldEnabled;}set DepthOfFieldEnabled(enabled) {this._depthOfFieldEnabled === enabled || (this._depthOfFieldEnabled = enabled, this._buildPipeline());}get LensFlareEnabled() {return this._lensFlareEnabled;}set LensFlareEnabled(enabled) {this._lensFlareEnabled === enabled || (this._lensFlareEnabled = enabled, this._buildPipeline());}get HDREnabled() {return this._hdrEnabled;}set HDREnabled(enabled) {this._hdrEnabled === enabled || (this._hdrEnabled = enabled, this._buildPipeline());}get VLSEnabled() {return this._vlsEnabled;}set VLSEnabled(enabled) {if (this._vlsEnabled !== enabled) {if (enabled) {const geometry = this._scene.enableGeometryBufferRenderer();if (!geometry) return void logger/* Logger.Warn */.Y.Warn("Geometry renderer is not supported, cannot create volumetric lights in Standard Rendering Pipeline");}this._vlsEnabled = enabled, this._buildPipeline();}}get MotionBlurEnabled() {return this._motionBlurEnabled;}set MotionBlurEnabled(enabled) {this._motionBlurEnabled === enabled || (this._motionBlurEnabled = enabled, this._buildPipeline());}get fxaaEnabled() {return this._fxaaEnabled;}set fxaaEnabled(enabled) {this._fxaaEnabled === enabled || (this._fxaaEnabled = enabled, this._buildPipeline());}get screenSpaceReflectionsEnabled() {return this._screenSpaceReflectionsEnabled;}set screenSpaceReflectionsEnabled(enabled) {this._screenSpaceReflectionsEnabled === enabled || (this._screenSpaceReflectionsEnabled = enabled, this._buildPipeline());}get volumetricLightStepsCount() {return this._volumetricLightStepsCount;}set volumetricLightStepsCount(count) {this.volumetricLightPostProcess && this.volumetricLightPostProcess.updateEffect("#define VLS\n#define NB_STEPS " + count.toFixed(1)), this._volumetricLightStepsCount = count;}get motionBlurSamples() {return this._motionBlurSamples;}set motionBlurSamples(samples) {this.motionBlurPostProcess && (this._isObjectBasedMotionBlur ? this.motionBlurPostProcess.motionBlurSamples = samples : this.motionBlurPostProcess.updateEffect("#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES " + samples.toFixed(1))), this._motionBlurSamples = samples;}get samples() {return this._samples;}set samples(sampleCount) {this._samples === sampleCount || (this._samples = sampleCount, this._buildPipeline());}constructor(name, scene, ratio, originalPostProcess = null, cameras) {super(scene.getEngine(), name), this.downSampleX4PostProcess = null, this.brightPassPostProcess = null, this.blurHPostProcesses = [], this.blurVPostProcesses = [], this.textureAdderPostProcess = null, this.volumetricLightPostProcess = null, this.volumetricLightSmoothXPostProcess = null, this.volumetricLightSmoothYPostProcess = null, this.volumetricLightMergePostProces = null, this.volumetricLightFinalPostProcess = null, this.luminancePostProcess = null, this.luminanceDownSamplePostProcesses = [], this.hdrPostProcess = null, this.textureAdderFinalPostProcess = null, this.lensFlareFinalPostProcess = null, this.hdrFinalPostProcess = null, this.lensFlarePostProcess = null, this.lensFlareComposePostProcess = null, this.motionBlurPostProcess = null, this.depthOfFieldPostProcess = null, this.fxaaPostProcess = null, this.screenSpaceReflectionPostProcess = null, this.brightThreshold = 1, this.blurWidth = 512, this.horizontalBlur = !1, this.lensTexture = null, this.volumetricLightCoefficient = .2, this.volumetricLightPower = 4, this.volumetricLightBlurScale = 64, this.sourceLight = null, this.hdrMinimumLuminance = 1, this.hdrDecreaseRate = .5, this.hdrIncreaseRate = .5, this.lensColorTexture = null, this.lensFlareStrength = 20, this.lensFlareGhostDispersal = 1.4, this.lensFlareHaloWidth = .7, this.lensFlareDistortionStrength = 16, this.lensFlareBlurWidth = 512, this.lensStarTexture = null, this.lensFlareDirtTexture = null, this.depthOfFieldDistance = 10, this.depthOfFieldBlurWidth = 64, this.animations = [], this._currentDepthOfFieldSource = null, this._fixedExposure = 1, this._currentExposure = 1, this._hdrAutoExposure = !1, this._hdrCurrentLuminance = 1, this._motionStrength = 1, this._isObjectBasedMotionBlur = !1, this._camerasToBeAttached = [], this._bloomEnabled = !1, this._depthOfFieldEnabled = !1, this._vlsEnabled = !1, this._lensFlareEnabled = !1, this._hdrEnabled = !1, this._motionBlurEnabled = !1, this._fxaaEnabled = !1, this._screenSpaceReflectionsEnabled = !1, this._motionBlurSamples = 64, this._volumetricLightStepsCount = 50, this._samples = 1, this._cameras = cameras || scene.cameras, this._cameras = this._cameras.slice(), this._camerasToBeAttached = this._cameras.slice(), this._scene = scene, this._basePostProcess = originalPostProcess, this._ratio = ratio, this._floatTextureType = scene.getEngine().getCaps().textureFloatRender ? 1 : 2, scene.postProcessRenderPipelineManager.addPipeline(this), this._buildPipeline();}_buildPipeline() {const ratio = this._ratio,scene = this._scene;this._disposePostProcesses(), null !== this._cameras && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._screenSpaceReflectionsEnabled && (this.screenSpaceReflectionPostProcess = new ScreenSpaceReflectionPostProcess("HDRPass", scene, ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, this._floatTextureType), this.screenSpaceReflectionPostProcess.onApplyObservable.add(() => {this._currentDepthOfFieldSource = this.screenSpaceReflectionPostProcess;}), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRScreenSpaceReflections", () => this.screenSpaceReflectionPostProcess, !0))), this.originalPostProcess = this._basePostProcess ? this._basePostProcess : new PostProcesses_postProcess/* PostProcess */.D("HDRPass", "standard", [], [], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define PASS_POST_PROCESS", this._floatTextureType), this.originalPostProcess.autoClear = !this.screenSpaceReflectionPostProcess, this.originalPostProcess.onApplyObservable.add(() => {this._currentDepthOfFieldSource = this.originalPostProcess;}), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRPassPostProcess", () => this.originalPostProcess, !0)), this._bloomEnabled && (this._createDownSampleX4PostProcess(scene, ratio / 4), this._createBrightPassPostProcess(scene, ratio / 4), this._createBlurPostProcesses(scene, ratio / 4, 1), this._createTextureAdderPostProcess(scene, ratio), this.textureAdderFinalPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRDepthOfFieldSource", "standard", [], [], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define PASS_POST_PROCESS", 0), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRBaseDepthOfFieldSource", () => this.textureAdderFinalPostProcess, !0))), this._vlsEnabled && (this._createVolumetricLightPostProcess(scene, ratio), this.volumetricLightFinalPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRVLSFinal", "standard", [], [], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define PASS_POST_PROCESS", 0), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRVLSFinal", () => this.volumetricLightFinalPostProcess, !0))), this._lensFlareEnabled && (this._createLensFlarePostProcess(scene, ratio), this.lensFlareFinalPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRPostLensFlareDepthOfFieldSource", "standard", [], [], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define PASS_POST_PROCESS", 0), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRPostLensFlareDepthOfFieldSource", () => this.lensFlareFinalPostProcess, !0))), this._hdrEnabled && (this._createLuminancePostProcesses(scene, this._floatTextureType), this._createHdrPostProcess(scene, ratio), this.hdrFinalPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRPostHDReDepthOfFieldSource", "standard", [], [], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define PASS_POST_PROCESS", 0), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRPostHDReDepthOfFieldSource", () => this.hdrFinalPostProcess, !0))), this._depthOfFieldEnabled && (this._createBlurPostProcesses(scene, ratio / 2, 3, "depthOfFieldBlurWidth"), this._createDepthOfFieldPostProcess(scene, ratio)), this._motionBlurEnabled && this._createMotionBlurPostProcess(scene, ratio), this._fxaaEnabled && (this.fxaaPostProcess = new FxaaPostProcess("fxaa", 1, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, 0), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRFxaa", () => this.fxaaPostProcess, !0))), null !== this._cameras && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), !this._enableMSAAOnFirstPostProcess(this._samples) && 1 < this._samples && logger/* Logger.Warn */.Y.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");}_createDownSampleX4PostProcess(scene, ratio) {const downSampleX4Offsets = Array(32);this.downSampleX4PostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRDownSampleX4", "standard", ["dsOffsets"], [], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define DOWN_SAMPLE_X4", this._floatTextureType), this.downSampleX4PostProcess.onApply = (effect) => {let id = 0;const width = this.downSampleX4PostProcess.width,height = this.downSampleX4PostProcess.height;for (let i = -2; 2 > i; i++) for (let j = -2; 2 > j; j++) downSampleX4Offsets[id] = (i + .5) * (1 / width), downSampleX4Offsets[id + 1] = (j + .5) * (1 / height), id += 2;effect.setArray2("dsOffsets", downSampleX4Offsets);}, this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRDownSampleX4", () => this.downSampleX4PostProcess, !0));}_createBrightPassPostProcess(scene, ratio) {const brightOffsets = Array(8);this.brightPassPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRBrightPass", "standard", ["dsOffsets", "brightThreshold"], [], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define BRIGHT_PASS", this._floatTextureType), this.brightPassPostProcess.onApply = (effect) => {const sU = 1 / this.brightPassPostProcess.width,sV = 1 / this.brightPassPostProcess.height;brightOffsets[0] = -.5 * sU, brightOffsets[1] = .5 * sV, brightOffsets[2] = .5 * sU, brightOffsets[3] = .5 * sV, brightOffsets[4] = -.5 * sU, brightOffsets[5] = -.5 * sV, brightOffsets[6] = .5 * sU, brightOffsets[7] = -.5 * sV, effect.setArray2("dsOffsets", brightOffsets), effect.setFloat("brightThreshold", this.brightThreshold);}, this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRBrightPass", () => this.brightPassPostProcess, !0));}_createBlurPostProcesses(scene, ratio, indice, blurWidthKey = "blurWidth") {const engine = scene.getEngine(),blurX = new BlurPostProcess("HDRBlurH_" + indice, new math_vector/* Vector2 */.FM(1, 0), this[blurWidthKey], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, this._floatTextureType),blurY = new BlurPostProcess("HDRBlurV_" + indice, new math_vector/* Vector2 */.FM(0, 1), this[blurWidthKey], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, this._floatTextureType);blurX.onActivateObservable.add(() => {const dw = blurX.width / engine.getRenderWidth();blurX.kernel = this[blurWidthKey] * dw;}), blurY.onActivateObservable.add(() => {const dw = blurY.height / engine.getRenderHeight();blurY.kernel = this.horizontalBlur ? 64 * dw : this[blurWidthKey] * dw;}), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRBlurH" + indice, () => blurX, !0)), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRBlurV" + indice, () => blurY, !0)), this.blurHPostProcesses.push(blurX), this.blurVPostProcesses.push(blurY);}_createTextureAdderPostProcess(scene, ratio) {this.textureAdderPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRTextureAdder", "standard", ["exposure"], ["otherSampler", "lensSampler"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define TEXTURE_ADDER", this._floatTextureType), this.textureAdderPostProcess.onApply = (effect) => {effect.setTextureFromPostProcess("otherSampler", this._vlsEnabled ? this._currentDepthOfFieldSource : this.originalPostProcess), effect.setTexture("lensSampler", this.lensTexture), effect.setFloat("exposure", this._currentExposure), this._currentDepthOfFieldSource = this.textureAdderFinalPostProcess;}, this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRTextureAdder", () => this.textureAdderPostProcess, !0));}_createVolumetricLightPostProcess(scene, ratio) {const geometryRenderer = scene.enableGeometryBufferRenderer();geometryRenderer.enablePosition = !0;const geometry = geometryRenderer.getGBuffer();this.volumetricLightPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRVLS", "standard", ["shadowViewProjection", "cameraPosition", "sunDirection", "sunColor", "scatteringCoefficient", "scatteringPower", "depthValues"], ["shadowMapSampler", "positionSampler"], ratio / 8, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define VLS\n#define NB_STEPS " + this._volumetricLightStepsCount.toFixed(1));const depthValues = math_vector/* Vector2.Zero */.FM.Zero();this.volumetricLightPostProcess.onApply = (effect) => {if (this.sourceLight && this.sourceLight.getShadowGenerator() && this._scene.activeCamera) {const generator = this.sourceLight.getShadowGenerator();effect.setTexture("shadowMapSampler", generator.getShadowMap()), effect.setTexture("positionSampler", geometry.textures[2]), effect.setColor3("sunColor", this.sourceLight.diffuse), effect.setVector3("sunDirection", this.sourceLight.getShadowDirection()), effect.setVector3("cameraPosition", this._scene.activeCamera.globalPosition), effect.setMatrix("shadowViewProjection", generator.getTransformMatrix()), effect.setFloat("scatteringCoefficient", this.volumetricLightCoefficient), effect.setFloat("scatteringPower", this.volumetricLightPower), depthValues.x = this.sourceLight.getDepthMinZ(this._scene.activeCamera), depthValues.y = this.sourceLight.getDepthMaxZ(this._scene.activeCamera), effect.setVector2("depthValues", depthValues);}}, this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRVLS", () => this.volumetricLightPostProcess, !0)), this._createBlurPostProcesses(scene, ratio / 4, 0, "volumetricLightBlurScale"), this.volumetricLightMergePostProces = new PostProcesses_postProcess/* PostProcess */.D("HDRVLSMerge", "standard", [], ["originalSampler"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define VLSMERGE"), this.volumetricLightMergePostProces.onApply = (effect) => {effect.setTextureFromPostProcess("originalSampler", this._bloomEnabled ? this.textureAdderFinalPostProcess : this.originalPostProcess), this._currentDepthOfFieldSource = this.volumetricLightFinalPostProcess;}, this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRVLSMerge", () => this.volumetricLightMergePostProces, !0));}_createLuminancePostProcesses(scene, textureType) {let size = Math.pow(3, StandardRenderingPipeline.LuminanceSteps);this.luminancePostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRLuminance", "standard", ["lumOffsets"], [], { width: size, height: size }, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define LUMINANCE", textureType);const offsets = [];this.luminancePostProcess.onApply = (effect) => {const sU = 1 / this.luminancePostProcess.width,sV = 1 / this.luminancePostProcess.height;offsets[0] = -.5 * sU, offsets[1] = .5 * sV, offsets[2] = .5 * sU, offsets[3] = .5 * sV, offsets[4] = -.5 * sU, offsets[5] = -.5 * sV, offsets[6] = .5 * sU, offsets[7] = -.5 * sV, effect.setArray2("lumOffsets", offsets);}, this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLuminance", () => this.luminancePostProcess, !0));for (let i = StandardRenderingPipeline.LuminanceSteps - 1; 0 <= i; i--) {size = Math.pow(3, i);let defines = "#define LUMINANCE_DOWN_SAMPLE\n";0 == i && (defines += "#define FINAL_DOWN_SAMPLER");const postProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRLuminanceDownSample" + i, "standard", ["dsOffsets", "halfDestPixelSize"], [], { width: size, height: size }, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, defines, textureType);this.luminanceDownSamplePostProcesses.push(postProcess);}let lastLuminance = this.luminancePostProcess;this.luminanceDownSamplePostProcesses.forEach((pp, index) => {const downSampleOffsets = Array(18);pp.onApply = (effect) => {if (!lastLuminance) return;let id = 0;for (let x = -1; 2 > x; x++) for (let y = -1; 2 > y; y++) downSampleOffsets[id] = x / lastLuminance.width, downSampleOffsets[id + 1] = y / lastLuminance.height, id += 2;effect.setArray2("dsOffsets", downSampleOffsets), effect.setFloat("halfDestPixelSize", .5 / lastLuminance.width), lastLuminance = index === this.luminanceDownSamplePostProcesses.length - 1 ? this.luminancePostProcess : pp;}, index === this.luminanceDownSamplePostProcesses.length - 1 && (pp.onAfterRender = () => {const pixel = scene.getEngine().readPixels(0, 0, 1, 1),bit_shift = new math_vector/* Vector4 */.Lt(1 / 16581375, 1 / 65025, 1 / 255, 1);pixel.then((pixel) => {const data = new Uint8Array(pixel.buffer);this._hdrCurrentLuminance = (data[0] * bit_shift.x + data[1] * bit_shift.y + data[2] * bit_shift.z + data[3] * bit_shift.w) / 100;});}), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLuminanceDownSample" + index, () => pp, !0));});}_createHdrPostProcess(scene, ratio) {const defines = ["#define HDR"];this._hdrAutoExposure && defines.push("#define AUTO_EXPOSURE"), this.hdrPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDR", "standard", ["averageLuminance"], ["textureAdderSampler"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, defines.join("\n"), 0);let outputLiminance = 1,time = 0,lastTime = 0;this.hdrPostProcess.onApply = (effect) => {if (effect.setTextureFromPostProcess("textureAdderSampler", this._currentDepthOfFieldSource), time += scene.getEngine().getDeltaTime(), 0 > outputLiminance) outputLiminance = this._hdrCurrentLuminance;else {const dt = (lastTime - time) / 1e3;this._hdrCurrentLuminance < outputLiminance + this.hdrDecreaseRate * dt ? outputLiminance += this.hdrDecreaseRate * dt : this._hdrCurrentLuminance > outputLiminance - this.hdrIncreaseRate * dt ? outputLiminance -= this.hdrIncreaseRate * dt : outputLiminance = this._hdrCurrentLuminance;}this.hdrAutoExposure ? this._currentExposure = this._fixedExposure / outputLiminance : (outputLiminance = math_scalar/* Scalar.Clamp */.R.Clamp(outputLiminance, this.hdrMinimumLuminance, 1e20), effect.setFloat("averageLuminance", outputLiminance)), lastTime = time, this._currentDepthOfFieldSource = this.hdrFinalPostProcess;}, this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDR", () => this.hdrPostProcess, !0));}_createLensFlarePostProcess(scene, ratio) {this.lensFlarePostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRLensFlare", "standard", ["strength", "ghostDispersal", "haloWidth", "resolution", "distortionStrength"], ["lensColorSampler"], ratio / 2, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define LENS_FLARE", 0), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLensFlare", () => this.lensFlarePostProcess, !0)), this._createBlurPostProcesses(scene, ratio / 4, 2, "lensFlareBlurWidth"), this.lensFlareComposePostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRLensFlareCompose", "standard", ["lensStarMatrix"], ["otherSampler", "lensDirtSampler", "lensStarSampler"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define LENS_FLARE_COMPOSE", 0), this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLensFlareCompose", () => this.lensFlareComposePostProcess, !0));const resolution = new math_vector/* Vector2 */.FM(0, 0);this.lensFlarePostProcess.externalTextureSamplerBinding = !0, this.lensFlarePostProcess.onApply = (effect) => {effect.setTextureFromPostProcess("textureSampler", this._bloomEnabled ? this.blurHPostProcesses[0] : this.originalPostProcess), effect.setTexture("lensColorSampler", this.lensColorTexture), effect.setFloat("strength", this.lensFlareStrength), effect.setFloat("ghostDispersal", this.lensFlareGhostDispersal), effect.setFloat("haloWidth", this.lensFlareHaloWidth), resolution.x = this.lensFlarePostProcess.width, resolution.y = this.lensFlarePostProcess.height, effect.setVector2("resolution", resolution), effect.setFloat("distortionStrength", this.lensFlareDistortionStrength);};const scaleBias1 = math_vector/* Matrix.FromValues */.y3.FromValues(2, 0, -1, 0, 0, 2, -1, 0, 0, 0, 1, 0, 0, 0, 0, 1),scaleBias2 = math_vector/* Matrix.FromValues */.y3.FromValues(.5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1, 0, 0, 0, 0, 1);this.lensFlareComposePostProcess.onApply = (effect) => {if (!this._scene.activeCamera) return;effect.setTextureFromPostProcess("otherSampler", this.lensFlarePostProcess), effect.setTexture("lensDirtSampler", this.lensFlareDirtTexture), effect.setTexture("lensStarSampler", this.lensStarTexture);const camerax = this._scene.activeCamera.getViewMatrix().getRow(0),cameraz = this._scene.activeCamera.getViewMatrix().getRow(2);let camRot = math_vector/* Vector3.Dot */.P.Dot(camerax.toVector3(), new math_vector/* Vector3 */.P(1, 0, 0)) + math_vector/* Vector3.Dot */.P.Dot(cameraz.toVector3(), new math_vector/* Vector3 */.P(0, 0, 1));camRot *= 4;const starRotation = math_vector/* Matrix.FromValues */.y3.FromValues(.5 * Math.cos(camRot), -Math.sin(camRot), 0, 0, Math.sin(camRot), .5 * Math.cos(camRot), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),lensStarMatrix = scaleBias2.multiply(starRotation).multiply(scaleBias1);effect.setMatrix("lensStarMatrix", lensStarMatrix), this._currentDepthOfFieldSource = this.lensFlareFinalPostProcess;};}_createDepthOfFieldPostProcess(scene, ratio) {this.depthOfFieldPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRDepthOfField", "standard", ["distance"], ["otherSampler", "depthSampler"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define DEPTH_OF_FIELD", 0), this.depthOfFieldPostProcess.onApply = (effect) => {effect.setTextureFromPostProcess("otherSampler", this._currentDepthOfFieldSource), effect.setTexture("depthSampler", this._getDepthTexture()), effect.setFloat("distance", this.depthOfFieldDistance);}, this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRDepthOfField", () => this.depthOfFieldPostProcess, !0));}_createMotionBlurPostProcess(scene, ratio) {if (this._isObjectBasedMotionBlur) {const mb = new MotionBlurPostProcess("HDRMotionBlur", scene, ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, 0);mb.motionStrength = this.motionStrength, mb.motionBlurSamples = this.motionBlurSamples, this.motionBlurPostProcess = mb;} else {this.motionBlurPostProcess = new PostProcesses_postProcess/* PostProcess */.D("HDRMotionBlur", "standard", ["inverseViewProjection", "prevViewProjection", "screenSize", "motionScale", "motionStrength"], ["depthSampler"], ratio, null, Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, scene.getEngine(), !1, "#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES " + this.motionBlurSamples.toFixed(1), 0);let motionScale = 0,prevViewProjection = math_vector/* Matrix.Identity */.y3.Identity();const invViewProjection = math_vector/* Matrix.Identity */.y3.Identity();let viewProjection = math_vector/* Matrix.Identity */.y3.Identity();const screenSize = math_vector/* Vector2.Zero */.FM.Zero();this.motionBlurPostProcess.onApply = (effect) => {viewProjection = scene.getProjectionMatrix().multiply(scene.getViewMatrix()), viewProjection.invertToRef(invViewProjection), effect.setMatrix("inverseViewProjection", invViewProjection), effect.setMatrix("prevViewProjection", prevViewProjection), prevViewProjection = viewProjection, screenSize.x = this.motionBlurPostProcess.width, screenSize.y = this.motionBlurPostProcess.height, effect.setVector2("screenSize", screenSize), motionScale = scene.getEngine().getFps() / 60, effect.setFloat("motionScale", motionScale), effect.setFloat("motionStrength", this.motionStrength), effect.setTexture("depthSampler", this._getDepthTexture());};}this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRMotionBlur", () => this.motionBlurPostProcess, !0));}_getDepthTexture() {if (this._scene.getEngine().getCaps().drawBuffersExtension) {const renderer = this._scene.enableGeometryBufferRenderer();return renderer.getGBuffer().textures[0];}return this._scene.enableDepthRenderer().getDepthMap();}_disposePostProcesses() {for (let i = 0; i < this._cameras.length; i++) {const camera = this._cameras[i];this.originalPostProcess && this.originalPostProcess.dispose(camera), this.screenSpaceReflectionPostProcess && this.screenSpaceReflectionPostProcess.dispose(camera), this.downSampleX4PostProcess && this.downSampleX4PostProcess.dispose(camera), this.brightPassPostProcess && this.brightPassPostProcess.dispose(camera), this.textureAdderPostProcess && this.textureAdderPostProcess.dispose(camera), this.volumetricLightPostProcess && this.volumetricLightPostProcess.dispose(camera), this.volumetricLightSmoothXPostProcess && this.volumetricLightSmoothXPostProcess.dispose(camera), this.volumetricLightSmoothYPostProcess && this.volumetricLightSmoothYPostProcess.dispose(camera), this.volumetricLightMergePostProces && this.volumetricLightMergePostProces.dispose(camera), this.volumetricLightFinalPostProcess && this.volumetricLightFinalPostProcess.dispose(camera), this.lensFlarePostProcess && this.lensFlarePostProcess.dispose(camera), this.lensFlareComposePostProcess && this.lensFlareComposePostProcess.dispose(camera);for (let j = 0; j < this.luminanceDownSamplePostProcesses.length; j++) this.luminanceDownSamplePostProcesses[j].dispose(camera);this.luminancePostProcess && this.luminancePostProcess.dispose(camera), this.hdrPostProcess && this.hdrPostProcess.dispose(camera), this.hdrFinalPostProcess && this.hdrFinalPostProcess.dispose(camera), this.depthOfFieldPostProcess && this.depthOfFieldPostProcess.dispose(camera), this.motionBlurPostProcess && this.motionBlurPostProcess.dispose(camera), this.fxaaPostProcess && this.fxaaPostProcess.dispose(camera);for (let j = 0; j < this.blurHPostProcesses.length; j++) this.blurHPostProcesses[j].dispose(camera);for (let j = 0; j < this.blurVPostProcesses.length; j++) this.blurVPostProcesses[j].dispose(camera);}this.originalPostProcess = null, this.downSampleX4PostProcess = null, this.brightPassPostProcess = null, this.textureAdderPostProcess = null, this.textureAdderFinalPostProcess = null, this.volumetricLightPostProcess = null, this.volumetricLightSmoothXPostProcess = null, this.volumetricLightSmoothYPostProcess = null, this.volumetricLightMergePostProces = null, this.volumetricLightFinalPostProcess = null, this.lensFlarePostProcess = null, this.lensFlareComposePostProcess = null, this.luminancePostProcess = null, this.hdrPostProcess = null, this.hdrFinalPostProcess = null, this.depthOfFieldPostProcess = null, this.motionBlurPostProcess = null, this.fxaaPostProcess = null, this.screenSpaceReflectionPostProcess = null, this.luminanceDownSamplePostProcesses.length = 0, this.blurHPostProcesses.length = 0, this.blurVPostProcesses.length = 0;}dispose() {this._disposePostProcesses(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), super.dispose();}serialize() {const serializationObject = decorators/* SerializationHelper.Serialize */.p4.Serialize(this);return this.sourceLight && (serializationObject.sourceLightId = this.sourceLight.id), this.screenSpaceReflectionPostProcess && (serializationObject.screenSpaceReflectionPostProcess = decorators/* SerializationHelper.Serialize */.p4.Serialize(this.screenSpaceReflectionPostProcess)), serializationObject.customType = "StandardRenderingPipeline", serializationObject;}static Parse(source, scene, rootUrl) {const p = decorators/* SerializationHelper.Parse */.p4.Parse(() => new StandardRenderingPipeline(source._name, scene, source._ratio), source, scene, rootUrl);return source.sourceLightId && (p.sourceLight = scene.getLightById(source.sourceLightId)), source.screenSpaceReflectionPostProcess && decorators/* SerializationHelper.Parse */.p4.Parse(() => p.screenSpaceReflectionPostProcess, source.screenSpaceReflectionPostProcess, scene, rootUrl), p;}}StandardRenderingPipeline.LuminanceSteps = 6, (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "brightThreshold", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "blurWidth", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "horizontalBlur", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "exposure", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("lensTexture")], StandardRenderingPipeline.prototype, "lensTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "volumetricLightCoefficient", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "volumetricLightPower", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "volumetricLightBlurScale", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "hdrMinimumLuminance", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "hdrDecreaseRate", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "hdrIncreaseRate", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "hdrAutoExposure", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("lensColorTexture")], StandardRenderingPipeline.prototype, "lensColorTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "lensFlareStrength", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "lensFlareGhostDispersal", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "lensFlareHaloWidth", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "lensFlareDistortionStrength", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "lensFlareBlurWidth", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("lensStarTexture")], StandardRenderingPipeline.prototype, "lensStarTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsTexture */.oU)("lensFlareDirtTexture")], StandardRenderingPipeline.prototype, "lensFlareDirtTexture", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "depthOfFieldDistance", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "depthOfFieldBlurWidth", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "motionStrength", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "objectBasedMotionBlur", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "_ratio", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "BloomEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "DepthOfFieldEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "LensFlareEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "HDREnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "VLSEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "MotionBlurEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "fxaaEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "screenSpaceReflectionsEnabled", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "volumetricLightStepsCount", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "motionBlurSamples", null), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], StandardRenderingPipeline.prototype, "samples", null), (0,typeStore/* RegisterClass */.H)("BABYLON.StandardRenderingPipeline", StandardRenderingPipeline);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/tonemap.fragment.js
const tonemap_fragment_name = "tonemapPixelShader",tonemap_fragment_shader = `varying vec2 vUV;
uniform sampler2D textureSampler;
uniform float _ExposureAdjustment;
#if defined(HABLE_TONEMAPPING)
const float A=0.15;
const float B=0.50;
const float C=0.10;
const float D=0.20;
const float E=0.02;
const float F=0.30;
const float W=11.2;
#endif
float Luminance(vec3 c)
{
return dot(c,vec3(0.22,0.707,0.071));
}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
vec3 colour=texture2D(textureSampler,vUV).rgb;
#if defined(REINHARD_TONEMAPPING)
float lum=Luminance(colour.rgb); 
float lumTm=lum*_ExposureAdjustment;
float scale=lumTm/(1.0+lumTm); 
colour*=scale/lum;
#elif defined(HABLE_TONEMAPPING)
colour*=_ExposureAdjustment;
const float ExposureBias=2.0;
vec3 x=ExposureBias*colour;
vec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;
x=vec3(W,W,W);
vec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);
colour=curr*whiteScale;
#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)
colour*=_ExposureAdjustment;
vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);
vec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);
colour=retColor*retColor;
#elif defined(PHOTOGRAPHIC_TONEMAPPING)
colour= vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);
#endif
gl_FragColor=vec4(colour.rgb,1.0);
}`;shaderStore/* ShaderStore.ShadersStore.tonemapPixelShader */.v.ShadersStore.tonemapPixelShader = tonemap_fragment_shader;const tonemapPixelShader = { name: "tonemapPixelShader", shader: tonemap_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/tonemapPostProcess.js
var TonemappingOperator;(function (TonemappingOperator) {TonemappingOperator[TonemappingOperator.Hable = 0] = "Hable", TonemappingOperator[TonemappingOperator.Reinhard = 1] = "Reinhard", TonemappingOperator[TonemappingOperator.HejiDawson = 2] = "HejiDawson", TonemappingOperator[TonemappingOperator.Photographic = 3] = "Photographic";})(TonemappingOperator || (TonemappingOperator = {}));class TonemapPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "TonemapPostProcess";}constructor(name, _operator, exposureAdjustment, camera, samplingMode = 2, engine, textureFormat = 0, reusable) {super(name, "tonemap", ["_ExposureAdjustment"], null, 1, camera, samplingMode, engine, reusable, null, textureFormat), this._operator = _operator, this.exposureAdjustment = exposureAdjustment;let defines = "#define ";this._operator === TonemappingOperator.Hable ? defines += "HABLE_TONEMAPPING" : this._operator === TonemappingOperator.Reinhard ? defines += "REINHARD_TONEMAPPING" : this._operator === TonemappingOperator.HejiDawson ? defines += "OPTIMIZED_HEJIDAWSON_TONEMAPPING" : this._operator === TonemappingOperator.Photographic && (defines += "PHOTOGRAPHIC_TONEMAPPING"), this.updateEffect(defines), this.onApply = (effect) => {effect.setFloat("_ExposureAdjustment", this.exposureAdjustment);};}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/volumetricLightScattering.fragment.js
const volumetricLightScattering_fragment_name = "volumetricLightScatteringPixelShader",volumetricLightScattering_fragment_shader = `uniform sampler2D textureSampler;
uniform sampler2D lightScatteringSampler;
uniform float decay;
uniform float exposure;
uniform float weight;
uniform float density;
uniform vec2 meshPositionOnScreen;
varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec2 tc=vUV;
vec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);
deltaTexCoord*=1.0/float(NUM_SAMPLES)*density;
float illuminationDecay=1.0;
vec4 color=texture2D(lightScatteringSampler,tc)*0.4;
for(int i=0; i<NUM_SAMPLES; i++) {
tc-=deltaTexCoord;
vec4 dataSample=texture2D(lightScatteringSampler,tc)*0.4;
dataSample*=illuminationDecay*weight;
color+=dataSample;
illuminationDecay*=decay;
}
vec4 realColor=texture2D(textureSampler,vUV);
gl_FragColor=((vec4((vec3(color.r,color.g,color.b)*exposure),1))+(realColor*(1.5-0.4)));
#define CUSTOM_FRAGMENT_MAIN_END
}
`;shaderStore/* ShaderStore.ShadersStore.volumetricLightScatteringPixelShader */.v.ShadersStore.volumetricLightScatteringPixelShader = volumetricLightScattering_fragment_shader;const volumetricLightScatteringPixelShader = { name: "volumetricLightScatteringPixelShader", shader: volumetricLightScattering_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/volumetricLightScatteringPass.vertex.js
const volumetricLightScatteringPass_vertex_name = "volumetricLightScatteringPassVertexShader",volumetricLightScatteringPass_vertex_shader = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
uniform mat4 viewProjection;
uniform vec2 depthValues;
#if defined(ALPHATEST) || defined(NEED_UV)
varying vec2 vUV;
uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{
vec3 positionUpdated=position;
#if (defined(ALPHATEST) || defined(NEED_UV)) && defined(UV1)
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
gl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);
#if defined(ALPHATEST) || defined(BASIC_RENDER)
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.volumetricLightScatteringPassVertexShader */.v.ShadersStore.volumetricLightScatteringPassVertexShader = volumetricLightScatteringPass_vertex_shader;const volumetricLightScatteringPassVertexShader = { name: "volumetricLightScatteringPassVertexShader", shader: volumetricLightScatteringPass_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/volumetricLightScatteringPass.fragment.js
const volumetricLightScatteringPass_fragment_name = "volumetricLightScatteringPassPixelShader",volumetricLightScatteringPass_fragment_shader = `#if defined(ALPHATEST) || defined(NEED_UV)
varying vec2 vUV;
#endif
#if defined(ALPHATEST)
uniform sampler2D diffuseSampler;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#if defined(ALPHATEST)
vec4 diffuseColor=texture2D(diffuseSampler,vUV);
if (diffuseColor.a<0.4)
discard;
#endif
gl_FragColor=vec4(0.0,0.0,0.0,1.0);
}
`;shaderStore/* ShaderStore.ShadersStore.volumetricLightScatteringPassPixelShader */.v.ShadersStore.volumetricLightScatteringPassPixelShader = volumetricLightScatteringPass_fragment_shader;const volumetricLightScatteringPassPixelShader = { name: "volumetricLightScatteringPassPixelShader", shader: volumetricLightScatteringPass_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/volumetricLightScatteringPostProcess.js
class VolumetricLightScatteringPostProcess extends PostProcesses_postProcess/* PostProcess */.D {get useDiffuseColor() {return logger/* Logger.Warn */.Y.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"), !1;}set useDiffuseColor(useDiffuseColor) {logger/* Logger.Warn */.Y.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead");}constructor(name, ratio, camera, mesh, samples = 100, samplingMode = Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, reusable, scene) {var _a, _b;super(name, "volumetricLightScattering", ["decay", "exposure", "weight", "meshPositionOnScreen", "density"], ["lightScatteringSampler"], ratio.postProcessRatio || ratio, camera, samplingMode, engine, reusable, "#define NUM_SAMPLES " + samples), this._screenCoordinates = math_vector/* Vector2.Zero */.FM.Zero(), this.customMeshPosition = math_vector/* Vector3.Zero */.P.Zero(), this.useCustomMeshPosition = !1, this.invert = !0, this.excludedMeshes = [], this.includedMeshes = [], this.exposure = .3, this.decay = .96815, this.weight = .58767, this.density = .926, scene = null !== (_b = null !== (_a = null === camera || void 0 === camera ? void 0 : camera.getScene()) && void 0 !== _a ? _a : scene) && void 0 !== _b ? _b : this._scene, engine = scene.getEngine(), this._viewPort = new math_viewport/* Viewport */.l(0, 0, 1, 1).toGlobal(engine.getRenderWidth(), engine.getRenderHeight()), this.mesh = null !== mesh && void 0 !== mesh ? mesh : VolumetricLightScatteringPostProcess.CreateDefaultMesh("VolumetricLightScatteringMesh", scene), this._createPass(scene, ratio.passRatio || ratio), this.onActivate = (camera) => {this.isSupported || this.dispose(camera), this.onActivate = null;}, this.onApplyObservable.add((effect) => {this._updateMeshScreenCoordinates(scene), effect.setTexture("lightScatteringSampler", this._volumetricLightScatteringRTT), effect.setFloat("exposure", this.exposure), effect.setFloat("decay", this.decay), effect.setFloat("weight", this.weight), effect.setFloat("density", this.density), effect.setVector2("meshPositionOnScreen", this._screenCoordinates);});}getClassName() {return "VolumetricLightScatteringPostProcess";}_isReady(subMesh, useInstances) {var _a;const mesh = subMesh.getMesh();if (mesh === this.mesh && mesh.material) return mesh.material.isReady(mesh);const renderingMaterial = null === (_a = mesh._internalAbstractMeshDataInfo._materialForRenderPass) || void 0 === _a ? void 0 : _a[this._scene.getEngine().currentRenderPassId];if (renderingMaterial) return renderingMaterial.isReadyForSubMesh(mesh, subMesh, useInstances);const defines = [],attribs = [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind],material = subMesh.getMaterial();material && (material.needAlphaTesting() && defines.push("#define ALPHATEST"), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind) && (attribs.push(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), defines.push("#define UV1")), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind) && (attribs.push(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind), defines.push("#define UV2"))), mesh.useBones && mesh.computeBonesUsingShaders ? (attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind), defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers), defines.push("#define BonesPerMesh " + (mesh.skeleton ? mesh.skeleton.bones.length + 1 : 0))) : defines.push("#define NUM_BONE_INFLUENCERS 0"), useInstances && (defines.push("#define INSTANCES"), materialHelper/* MaterialHelper.PushAttributesForInstances */.G.PushAttributesForInstances(attribs), subMesh.getRenderingMesh().hasThinInstances && defines.push("#define THIN_INSTANCES"));const drawWrapper = subMesh._getDrawWrapper(void 0, !0),cachedDefines = drawWrapper.defines,join = defines.join("\n");return cachedDefines !== join && drawWrapper.setEffect(mesh.getScene().getEngine().createEffect("volumetricLightScatteringPass", attribs, ["world", "mBones", "viewProjection", "diffuseMatrix"], ["diffuseSampler"], join, void 0, void 0, void 0, { maxSimultaneousMorphTargets: mesh.numBoneInfluencers }), join), drawWrapper.effect.isReady();}setCustomMeshPosition(position) {this.customMeshPosition = position;}getCustomMeshPosition() {return this.customMeshPosition;}dispose(camera) {const rttIndex = camera.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT);-1 !== rttIndex && camera.getScene().customRenderTargets.splice(rttIndex, 1), this._volumetricLightScatteringRTT.dispose(), super.dispose(camera);}getPass() {return this._volumetricLightScatteringRTT;}_meshExcluded(mesh) {return !!(0 < this.includedMeshes.length && -1 === this.includedMeshes.indexOf(mesh) || 0 < this.excludedMeshes.length && -1 !== this.excludedMeshes.indexOf(mesh));}_createPass(scene, ratio) {const engine = scene.getEngine();this._volumetricLightScatteringRTT = new Textures_renderTargetTexture/* RenderTargetTexture */._("volumetricLightScatteringMap", { width: engine.getRenderWidth() * ratio, height: engine.getRenderHeight() * ratio }, scene, !1, !0, 0), this._volumetricLightScatteringRTT.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.renderList = null, this._volumetricLightScatteringRTT.renderParticles = !1, this._volumetricLightScatteringRTT.ignoreCameraViewport = !0;const camera = this.getCamera();camera ? camera.customRenderTargets.push(this._volumetricLightScatteringRTT) : scene.customRenderTargets.push(this._volumetricLightScatteringRTT);const renderSubMesh = (subMesh) => {var _a;const renderingMesh = subMesh.getRenderingMesh(),effectiveMesh = subMesh.getEffectiveMesh();if (this._meshExcluded(renderingMesh)) return;effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = !1;const material = subMesh.getMaterial();if (!material) return;const scene = renderingMesh.getScene(),engine = scene.getEngine();engine.setState(material.backFaceCulling, void 0, void 0, void 0, material.cullBackFaces);const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());if (!batch.mustReturn) {const hardwareInstancedRendering = engine.getCaps().instancedArrays && (null !== batch.visibleInstances[subMesh._id] || renderingMesh.hasThinInstances);if (this._isReady(subMesh, hardwareInstancedRendering)) {const renderingMaterial = null === (_a = effectiveMesh._internalAbstractMeshDataInfo._materialForRenderPass) || void 0 === _a ? void 0 : _a[engine.currentRenderPassId];let drawWrapper = subMesh._getDrawWrapper();if (renderingMesh !== this.mesh || drawWrapper || (drawWrapper = material._getDrawWrapper()), !drawWrapper) return;const effect = drawWrapper.effect;if (engine.enableEffect(drawWrapper), hardwareInstancedRendering || renderingMesh._bind(subMesh, effect, material.fillMode), renderingMesh === this.mesh) material.bind(effectiveMesh.getWorldMatrix(), renderingMesh);else if (renderingMaterial) renderingMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), effectiveMesh, subMesh);else {if (effect.setMatrix("viewProjection", scene.getTransformMatrix()), material && material.needAlphaTesting()) {const alphaTexture = material.getAlphaTestTexture();effect.setTexture("diffuseSampler", alphaTexture), alphaTexture && effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());}renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton && effect.setMatrices("mBones", renderingMesh.skeleton.getTransformMatrices(renderingMesh));}hardwareInstancedRendering && renderingMesh.hasThinInstances && effect.setMatrix("world", effectiveMesh.getWorldMatrix()), renderingMesh._processRendering(effectiveMesh, subMesh, effect, Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, batch, hardwareInstancedRendering, (isInstance, world) => {isInstance || effect.setMatrix("world", world);});}}};let savedSceneClearColor;const sceneClearColor = new math_color/* Color4 */.HE(0, 0, 0, 1);this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(() => {savedSceneClearColor = scene.clearColor, scene.clearColor = sceneClearColor;}), this._volumetricLightScatteringRTT.onAfterRenderObservable.add(() => {scene.clearColor = savedSceneClearColor;}), this._volumetricLightScatteringRTT.customIsReadyFunction = (mesh, refreshRate, preWarm) => {if ((preWarm || 0 === refreshRate) && mesh.subMeshes) for (let i = 0; i < mesh.subMeshes.length; ++i) {const subMesh = mesh.subMeshes[i],material = subMesh.getMaterial(),renderingMesh = subMesh.getRenderingMesh();if (!material) continue;const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh()),hardwareInstancedRendering = engine.getCaps().instancedArrays && (null !== batch.visibleInstances[subMesh._id] || renderingMesh.hasThinInstances);if (!this._isReady(subMesh, hardwareInstancedRendering)) return !1;}return !0;}, this._volumetricLightScatteringRTT.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => {const engine = scene.getEngine();let index;if (depthOnlySubMeshes.length) {for (engine.setColorWrite(!1), index = 0; index < depthOnlySubMeshes.length; index++) renderSubMesh(depthOnlySubMeshes.data[index]);engine.setColorWrite(!0);}for (index = 0; index < opaqueSubMeshes.length; index++) renderSubMesh(opaqueSubMeshes.data[index]);for (index = 0; index < alphaTestSubMeshes.length; index++) renderSubMesh(alphaTestSubMeshes.data[index]);if (transparentSubMeshes.length) {for (index = 0; index < transparentSubMeshes.length; index++) {const submesh = transparentSubMeshes.data[index],boundingInfo = submesh.getBoundingInfo();boundingInfo && scene.activeCamera && (submesh._alphaIndex = submesh.getMesh().alphaIndex, submesh._distanceToCamera = boundingInfo.boundingSphere.centerWorld.subtract(scene.activeCamera.position).length());}const sortedArray = transparentSubMeshes.data.slice(0, transparentSubMeshes.length);for (sortedArray.sort((a, b) => a._alphaIndex > b._alphaIndex ? 1 : a._alphaIndex < b._alphaIndex ? -1 : a._distanceToCamera < b._distanceToCamera ? 1 : a._distanceToCamera > b._distanceToCamera ? -1 : 0), engine.setAlphaMode(2), index = 0; index < sortedArray.length; index++) renderSubMesh(sortedArray[index]);engine.setAlphaMode(0);}};}_updateMeshScreenCoordinates(scene) {const transform = scene.getTransformMatrix();let meshPosition = this.useCustomMeshPosition ? this.customMeshPosition : this.attachedNode ? this.attachedNode.position : this.mesh.parent ? this.mesh.getAbsolutePosition() : this.mesh.position;const pos = math_vector/* Vector3.Project */.P.Project(meshPosition, math_vector/* Matrix.Identity */.y3.Identity(), transform, this._viewPort);this._screenCoordinates.x = pos.x / this._viewPort.width, this._screenCoordinates.y = pos.y / this._viewPort.height, this.invert && (this._screenCoordinates.y = 1 - this._screenCoordinates.y);}static CreateDefaultMesh(name, scene) {const mesh = CreatePlane(name, { size: 1 }, scene);mesh.billboardMode = abstractMesh/* AbstractMesh.BILLBOARDMODE_ALL */.x.BILLBOARDMODE_ALL;const material = new standardMaterial/* StandardMaterial */.K(name + "Material", scene);return material.emissiveColor = new math_color/* Color3 */.Wo(1, 1, 1), mesh.material = material, mesh;}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsVector3 */.hd)()], VolumetricLightScatteringPostProcess.prototype, "customMeshPosition", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], VolumetricLightScatteringPostProcess.prototype, "useCustomMeshPosition", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], VolumetricLightScatteringPostProcess.prototype, "invert", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serializeAsMeshReference */.RR)()], VolumetricLightScatteringPostProcess.prototype, "mesh", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], VolumetricLightScatteringPostProcess.prototype, "excludedMeshes", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], VolumetricLightScatteringPostProcess.prototype, "includedMeshes", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], VolumetricLightScatteringPostProcess.prototype, "exposure", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], VolumetricLightScatteringPostProcess.prototype, "decay", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], VolumetricLightScatteringPostProcess.prototype, "weight", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], VolumetricLightScatteringPostProcess.prototype, "density", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.VolumetricLightScatteringPostProcess", VolumetricLightScatteringPostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/screenSpaceCurvature.fragment.js
const screenSpaceCurvature_fragment_name = "screenSpaceCurvaturePixelShader",screenSpaceCurvature_fragment_shader = `precision highp float;
varying vec2 vUV;
uniform sampler2D textureSampler;
uniform sampler2D normalSampler;
uniform float curvature_ridge;
uniform float curvature_valley;
#ifndef CURVATURE_OFFSET
#define CURVATURE_OFFSET 1
#endif
float curvature_soft_clamp(float curvature,float control)
{
if (curvature<0.5/control)
return curvature*(1.0-curvature*control);
return 0.25/control;
}
float calculate_curvature(ivec2 texel,float ridge,float valley)
{
vec2 normal_up =texelFetch(normalSampler,texel+ivec2(0, CURVATURE_OFFSET),0).rb;
vec2 normal_down =texelFetch(normalSampler,texel+ivec2(0,-CURVATURE_OFFSET),0).rb;
vec2 normal_left =texelFetch(normalSampler,texel+ivec2(-CURVATURE_OFFSET,0),0).rb;
vec2 normal_right=texelFetch(normalSampler,texel+ivec2( CURVATURE_OFFSET,0),0).rb;
float normal_diff=((normal_up.g-normal_down.g)+(normal_right.r-normal_left.r));
if (normal_diff<0.0)
return -2.0*curvature_soft_clamp(-normal_diff,valley);
return 2.0*curvature_soft_clamp(normal_diff,ridge);
}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
ivec2 texel=ivec2(gl_FragCoord.xy);
vec4 baseColor=texture2D(textureSampler,vUV);
float curvature=calculate_curvature(texel,curvature_ridge,curvature_valley);
baseColor.rgb*=curvature+1.0;
gl_FragColor=baseColor;
}`;shaderStore/* ShaderStore.ShadersStore.screenSpaceCurvaturePixelShader */.v.ShadersStore.screenSpaceCurvaturePixelShader = screenSpaceCurvature_fragment_shader;const screenSpaceCurvaturePixelShader = { name: "screenSpaceCurvaturePixelShader", shader: screenSpaceCurvature_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/screenSpaceCurvaturePostProcess.js
class ScreenSpaceCurvaturePostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "ScreenSpaceCurvaturePostProcess";}constructor(name, scene, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = !1) {super(name, "screenSpaceCurvature", ["curvature_ridge", "curvature_valley"], ["textureSampler", "normalSampler"], options, camera, samplingMode, engine, reusable, void 0, textureType, void 0, null, blockCompilation), this.ridge = 1, this.valley = 1, this._geometryBufferRenderer = scene.enableGeometryBufferRenderer(), this._geometryBufferRenderer ? this.onApply = (effect) => {effect.setFloat("curvature_ridge", .5 / Math.max(this.ridge * this.ridge, 1e-4)), effect.setFloat("curvature_valley", .7 / Math.max(this.valley * this.valley, 1e-4));const normalTexture = this._geometryBufferRenderer.getGBuffer().textures[1];effect.setTexture("normalSampler", normalTexture);} : logger/* Logger.Error */.Y.Error("Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first.");}static get IsSupported() {const engine = engineStore/* EngineStore.LastCreatedEngine */.l.LastCreatedEngine;return !!engine && engine.getCaps().drawBuffersExtension;}static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {return decorators/* SerializationHelper.Parse */.p4.Parse(() => new ScreenSpaceCurvaturePostProcess(parsedPostProcess.name, scene, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.textureType, parsedPostProcess.reusable), parsedPostProcess, scene, rootUrl);}}(0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceCurvaturePostProcess.prototype, "ridge", void 0), (0,tslib_es6/* __decorate */.gn)([(0,decorators/* serialize */.qC)()], ScreenSpaceCurvaturePostProcess.prototype, "valley", void 0), (0,typeStore/* RegisterClass */.H)("BABYLON.ScreenSpaceCurvaturePostProcess", ScreenSpaceCurvaturePostProcess);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Probes/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererFragmentDeclaration.js
const boundingBoxRendererFragmentDeclaration_name = "boundingBoxRendererFragmentDeclaration",boundingBoxRendererFragmentDeclaration_shader = `uniform vec4 color;
`;shaderStore/* ShaderStore.IncludesShadersStore.boundingBoxRendererFragmentDeclaration */.v.IncludesShadersStore.boundingBoxRendererFragmentDeclaration = boundingBoxRendererFragmentDeclaration_shader;const boundingBoxRendererFragmentDeclaration = { name: "boundingBoxRendererFragmentDeclaration", shader: boundingBoxRendererFragmentDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererUboDeclaration.js
const boundingBoxRendererUboDeclaration_name = "boundingBoxRendererUboDeclaration",boundingBoxRendererUboDeclaration_shader = `#ifdef WEBGL2
uniform vec4 color;
uniform mat4 world;
uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
#else
layout(std140,column_major) uniform;
uniform BoundingBoxRenderer {
vec4 color;
mat4 world;
mat4 viewProjection;
mat4 viewProjectionR;
};
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.boundingBoxRendererUboDeclaration */.v.IncludesShadersStore.boundingBoxRendererUboDeclaration = boundingBoxRendererUboDeclaration_shader;const boundingBoxRendererUboDeclaration = { name: "boundingBoxRendererUboDeclaration", shader: boundingBoxRendererUboDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.fragment.js
const boundingBoxRenderer_fragment_name = "boundingBoxRendererPixelShader",boundingBoxRenderer_fragment_shader = `#include<__decl__boundingBoxRendererFragment>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.boundingBoxRendererPixelShader */.v.ShadersStore.boundingBoxRendererPixelShader = boundingBoxRenderer_fragment_shader;const boundingBoxRendererPixelShader = { name: "boundingBoxRendererPixelShader", shader: boundingBoxRenderer_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererVertexDeclaration.js
const boundingBoxRendererVertexDeclaration_name = "boundingBoxRendererVertexDeclaration",boundingBoxRendererVertexDeclaration_shader = `uniform mat4 world;
uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.boundingBoxRendererVertexDeclaration */.v.IncludesShadersStore.boundingBoxRendererVertexDeclaration = boundingBoxRendererVertexDeclaration_shader;const boundingBoxRendererVertexDeclaration = { name: "boundingBoxRendererVertexDeclaration", shader: boundingBoxRendererVertexDeclaration_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.vertex.js
const boundingBoxRenderer_vertex_name = "boundingBoxRendererVertexShader",boundingBoxRenderer_vertex_shader = `attribute vec3 position;
#include<__decl__boundingBoxRendererVertex>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec4 worldPos=world*vec4(position,1.0);
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {
gl_Position=viewProjection*worldPos;
} else {
gl_Position=viewProjectionR*worldPos;
}
#else
gl_Position=viewProjection*worldPos;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;shaderStore/* ShaderStore.ShadersStore.boundingBoxRendererVertexShader */.v.ShadersStore.boundingBoxRendererVertexShader = boundingBoxRenderer_vertex_shader;const boundingBoxRendererVertexShader = { name: "boundingBoxRendererVertexShader", shader: boundingBoxRenderer_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/boundingBoxRenderer.js
Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "forceShowBoundingBoxes", { get: function () {return this._forceShowBoundingBoxes || !1;}, set: function (value) {this._forceShowBoundingBoxes = value, value && this.getBoundingBoxRenderer();}, enumerable: !0, configurable: !0 }), core_scene/* Scene.prototype.getBoundingBoxRenderer */.x.prototype.getBoundingBoxRenderer = function () {return this._boundingBoxRenderer || (this._boundingBoxRenderer = new BoundingBoxRenderer(this)), this._boundingBoxRenderer;}, Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "showBoundingBox", { get: function () {return this._showBoundingBox || !1;}, set: function (value) {this._showBoundingBox = value, value && this.getScene().getBoundingBoxRenderer();}, enumerable: !0, configurable: !0 });class BoundingBoxRenderer {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_BOUNDINGBOXRENDERER */.l.NAME_BOUNDINGBOXRENDERER, this.frontColor = new math_color/* Color3 */.Wo(1, 1, 1), this.backColor = new math_color/* Color3 */.Wo(.1, .1, .1), this.showBackLines = !0, this.onBeforeBoxRenderingObservable = new observable/* Observable */.y$(), this.onAfterBoxRenderingObservable = new observable/* Observable */.y$(), this.onResourcesReadyObservable = new observable/* Observable */.y$(), this.enabled = !0, this.renderList = new smartArray/* SmartArray */.t(32), this._vertexBuffers = {}, this._fillIndexBuffer = null, this._fillIndexData = null, this.scene = scene, scene._addComponent(this), this._uniformBufferFront = new uniformBuffer/* UniformBuffer */.M(this.scene.getEngine(), void 0, void 0, "BoundingBoxRendererFront", !this.scene.getEngine().isWebGPU), this._buildUniformLayout(this._uniformBufferFront), this._uniformBufferBack = new uniformBuffer/* UniformBuffer */.M(this.scene.getEngine(), void 0, void 0, "BoundingBoxRendererBack", !this.scene.getEngine().isWebGPU), this._buildUniformLayout(this._uniformBufferBack);}_buildUniformLayout(ubo) {ubo.addUniform("color", 4), ubo.addUniform("world", 16), ubo.addUniform("viewProjection", 16), ubo.addUniform("viewProjectionR", 16), ubo.create();}register() {this.scene._beforeEvaluateActiveMeshStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER */.l.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER, this, this.reset), this.scene._preActiveMeshStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER */.l.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER, this, this._preActiveMesh), this.scene._evaluateSubMeshStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER */.l.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER, this, this._evaluateSubMesh), this.scene._afterRenderingGroupDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER */.l.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER, this, this.render);}_evaluateSubMesh(mesh, subMesh) {if (mesh.showSubMeshesBoundingBox) {const boundingInfo = subMesh.getBoundingInfo();null !== boundingInfo && boundingInfo !== void 0 && (boundingInfo.boundingBox._tag = mesh.renderingGroupId, this.renderList.push(boundingInfo.boundingBox));}}_preActiveMesh(mesh) {if (mesh.showBoundingBox || this.scene.forceShowBoundingBoxes) {const boundingInfo = mesh.getBoundingInfo();boundingInfo.boundingBox._tag = mesh.renderingGroupId, this.renderList.push(boundingInfo.boundingBox);}}_prepareResources() {if (this._colorShader) return;this._colorShader = new shaderMaterial/* ShaderMaterial */.j("colorShader", this.scene, "boundingBoxRenderer", { attributes: [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], uniforms: ["world", "viewProjection", "viewProjectionR", "color"], uniformBuffers: ["BoundingBoxRenderer"] }, !1), this._colorShader.doNotSerialize = !0, this._colorShader.reservedDataStore = { hidden: !0 }, this._colorShaderForOcclusionQuery = new shaderMaterial/* ShaderMaterial */.j("colorShaderOccQuery", this.scene, "boundingBoxRenderer", { attributes: [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], uniforms: ["world", "viewProjection", "viewProjectionR", "color"], uniformBuffers: ["BoundingBoxRenderer"] }, !0), this._colorShaderForOcclusionQuery.doNotSerialize = !0, this._colorShaderForOcclusionQuery.reservedDataStore = { hidden: !0 };const engine = this.scene.getEngine(),boxdata = CreateBoxVertexData({ size: 1 });this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = new Buffers_buffer/* VertexBuffer */.o(engine, boxdata.positions, Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, !1), this._createIndexBuffer(), this._fillIndexData = boxdata.indices, this.onResourcesReadyObservable.notifyObservers(this);}_createIndexBuffer() {const engine = this.scene.getEngine();this._indexBuffer = engine.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4]);}rebuild() {const vb = this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];vb && vb._rebuild(), this._createIndexBuffer();}reset() {this.renderList.reset();}render(renderingGroupId) {var _a, _b;if (0 === this.renderList.length || !this.enabled) return;if (this._prepareResources(), !this._colorShader.isReady()) return;const engine = this.scene.getEngine();engine.setDepthWrite(!1);const frontColor = this.frontColor.toColor4(),backColor = this.backColor.toColor4(),transformMatrix = this.scene.getTransformMatrix();for (let boundingBoxIndex = 0; boundingBoxIndex < this.renderList.length; boundingBoxIndex++) {const boundingBox = this.renderList.data[boundingBoxIndex];if (boundingBox._tag !== renderingGroupId) continue;this._createWrappersForBoundingBox(boundingBox), this.onBeforeBoxRenderingObservable.notifyObservers(boundingBox);const min = boundingBox.minimum,max = boundingBox.maximum,diff = max.subtract(min),median = min.add(diff.scale(.5)),worldMatrix = math_vector/* Matrix.Scaling */.y3.Scaling(diff.x, diff.y, diff.z).multiply(math_vector/* Matrix.Translation */.y3.Translation(median.x, median.y, median.z)).multiply(boundingBox.getWorldMatrix()),useReverseDepthBuffer = engine.useReverseDepthBuffer;if (this.showBackLines) {const drawWrapperBack = null !== (_a = boundingBox._drawWrapperBack) && void 0 !== _a ? _a : this._colorShader._getDrawWrapper();this._colorShader._preBind(drawWrapperBack), engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect()), useReverseDepthBuffer ? engine.setDepthFunctionToLessOrEqual() : engine.setDepthFunctionToGreaterOrEqual(), this._uniformBufferBack.bindToEffect(drawWrapperBack.effect, "BoundingBoxRenderer"), this._uniformBufferBack.updateDirectColor4("color", backColor), this._uniformBufferBack.updateMatrix("world", worldMatrix), this._uniformBufferBack.updateMatrix("viewProjection", transformMatrix), this._uniformBufferBack.update(), engine.drawElementsType(Materials_material/* Material.LineListDrawMode */.F.LineListDrawMode, 0, 24);}const drawWrapperFront = null !== (_b = boundingBox._drawWrapperFront) && void 0 !== _b ? _b : this._colorShader._getDrawWrapper();this._colorShader._preBind(drawWrapperFront), engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect()), useReverseDepthBuffer ? engine.setDepthFunctionToGreater() : engine.setDepthFunctionToLess(), this._uniformBufferFront.bindToEffect(drawWrapperFront.effect, "BoundingBoxRenderer"), this._uniformBufferFront.updateDirectColor4("color", frontColor), this._uniformBufferFront.updateMatrix("world", worldMatrix), this._uniformBufferFront.updateMatrix("viewProjection", transformMatrix), this._uniformBufferFront.update(), engine.drawElementsType(Materials_material/* Material.LineListDrawMode */.F.LineListDrawMode, 0, 24), this.onAfterBoxRenderingObservable.notifyObservers(boundingBox);}this._colorShader.unbind(), engine.setDepthFunctionToLessOrEqual(), engine.setDepthWrite(!0);}_createWrappersForBoundingBox(boundingBox) {if (!boundingBox._drawWrapperFront) {const engine = this.scene.getEngine();boundingBox._drawWrapperFront = new Materials_drawWrapper/* DrawWrapper */.q(engine), boundingBox._drawWrapperBack = new Materials_drawWrapper/* DrawWrapper */.q(engine), boundingBox._drawWrapperFront.setEffect(this._colorShader.getEffect()), boundingBox._drawWrapperBack.setEffect(this._colorShader.getEffect());}}renderOcclusionBoundingBox(mesh) {const engine = this.scene.getEngine();this._renderPassIdForOcclusionQuery === void 0 && (this._renderPassIdForOcclusionQuery = engine.createRenderPassId(`Render pass for occlusion query`));const currentRenderPassId = engine.currentRenderPassId;engine.currentRenderPassId = this._renderPassIdForOcclusionQuery, this._prepareResources();const subMesh = mesh.subMeshes[0];if (!this._colorShaderForOcclusionQuery.isReady(mesh, void 0, subMesh) || !mesh.hasBoundingInfo) return void (engine.currentRenderPassId = currentRenderPassId);this._fillIndexBuffer || (this._fillIndexBuffer = engine.createIndexBuffer(this._fillIndexData));const useReverseDepthBuffer = engine.useReverseDepthBuffer;engine.setDepthWrite(!1), engine.setColorWrite(!1);const boundingBox = mesh.getBoundingInfo().boundingBox,min = boundingBox.minimum,max = boundingBox.maximum,diff = max.subtract(min),median = min.add(diff.scale(.5)),worldMatrix = math_vector/* Matrix.Scaling */.y3.Scaling(diff.x, diff.y, diff.z).multiply(math_vector/* Matrix.Translation */.y3.Translation(median.x, median.y, median.z)).multiply(boundingBox.getWorldMatrix()),drawWrapper = subMesh._drawWrapper;this._colorShaderForOcclusionQuery._preBind(drawWrapper), engine.bindBuffers(this._vertexBuffers, this._fillIndexBuffer, drawWrapper.effect), useReverseDepthBuffer ? engine.setDepthFunctionToGreater() : engine.setDepthFunctionToLess(), this.scene.resetCachedMaterial(), this._uniformBufferFront.bindToEffect(drawWrapper.effect, "BoundingBoxRenderer"), this._uniformBufferFront.updateMatrix("world", worldMatrix), this._uniformBufferFront.updateMatrix("viewProjection", this.scene.getTransformMatrix()), this._uniformBufferFront.update(), engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, 36), this._colorShaderForOcclusionQuery.unbind(), engine.setDepthFunctionToLessOrEqual(), engine.setDepthWrite(!0), engine.setColorWrite(!0), engine.currentRenderPassId = currentRenderPassId;}dispose() {if (void 0 !== this._renderPassIdForOcclusionQuery && (this.scene.getEngine().releaseRenderPassId(this._renderPassIdForOcclusionQuery), this._renderPassIdForOcclusionQuery = void 0), !!this._colorShader) {this.onBeforeBoxRenderingObservable.clear(), this.onAfterBoxRenderingObservable.clear(), this.onResourcesReadyObservable.clear(), this.renderList.dispose(), this._colorShader.dispose(), this._colorShaderForOcclusionQuery.dispose(), this._uniformBufferFront.dispose(), this._uniformBufferBack.dispose();const buffer = this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];buffer && (buffer.dispose(), this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = null), this.scene.getEngine()._releaseBuffer(this._indexBuffer), this._fillIndexBuffer && (this.scene.getEngine()._releaseBuffer(this._fillIndexBuffer), this._fillIndexBuffer = null);}}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/depthRendererSceneComponent.js
core_scene/* Scene.prototype.enableDepthRenderer */.x.prototype.enableDepthRenderer = function (camera, storeNonLinearDepth = !1, force32bitsFloat = !1, samplingMode = 3) {if (camera = camera || this.activeCamera, !camera) throw "No camera available to enable depth renderer";if (this._depthRenderer || (this._depthRenderer = {}), !this._depthRenderer[camera.id]) {const supportFullfloat = !!this.getEngine().getCaps().textureFloatRender;let textureType = 0;textureType = !this.getEngine().getCaps().textureHalfFloatRender || force32bitsFloat && supportFullfloat ? supportFullfloat ? 1 : 0 : 2, this._depthRenderer[camera.id] = new DepthRenderer(this, textureType, camera, storeNonLinearDepth, samplingMode);}return this._depthRenderer[camera.id];}, core_scene/* Scene.prototype.disableDepthRenderer */.x.prototype.disableDepthRenderer = function (camera) {camera = camera || this.activeCamera;camera && this._depthRenderer && this._depthRenderer[camera.id] && this._depthRenderer[camera.id].dispose();};class DepthRendererSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_DEPTHRENDERER */.l.NAME_DEPTHRENDERER, this.scene = scene;}register() {this.scene._gatherRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER */.l.STEP_GATHERRENDERTARGETS_DEPTHRENDERER, this, this._gatherRenderTargets), this.scene._gatherActiveCameraRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER */.l.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER, this, this._gatherActiveCameraRenderTargets);}rebuild() {}dispose() {for (const key in this.scene._depthRenderer) this.scene._depthRenderer[key].dispose();}_gatherRenderTargets(renderTargets) {if (this.scene._depthRenderer) for (const key in this.scene._depthRenderer) {const depthRenderer = this.scene._depthRenderer[key];depthRenderer.enabled && !depthRenderer.useOnlyInActiveCamera && renderTargets.push(depthRenderer.getDepthMap());}}_gatherActiveCameraRenderTargets(renderTargets) {if (this.scene._depthRenderer) for (const key in this.scene._depthRenderer) {const depthRenderer = this.scene._depthRenderer[key];depthRenderer.enabled && depthRenderer.useOnlyInActiveCamera && this.scene.activeCamera.id === key && renderTargets.push(depthRenderer.getDepthMap());}}}DepthRenderer._SceneComponentInitialization = (scene) => {let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_DEPTHRENDERER */.l.NAME_DEPTHRENDERER);component || (component = new DepthRendererSceneComponent(scene), scene._addComponent(component));};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/oitFinal.fragment.js
const oitFinal_fragment_name = "oitFinalPixelShader",oitFinal_fragment_shader = `precision highp float;
uniform sampler2D uFrontColor;
uniform sampler2D uBackColor;
void main() {
ivec2 fragCoord=ivec2(gl_FragCoord.xy);
vec4 frontColor=texelFetch(uFrontColor,fragCoord,0);
vec4 backColor=texelFetch(uBackColor,fragCoord,0);
float alphaMultiplier=1.0-frontColor.a;
glFragColor=vec4(
frontColor.rgb+alphaMultiplier*backColor.rgb,
frontColor.a+backColor.a
);
}`;shaderStore/* ShaderStore.ShadersStore.oitFinalPixelShader */.v.ShadersStore.oitFinalPixelShader = oitFinal_fragment_shader;const oitFinalPixelShader = { name: "oitFinalPixelShader", shader: oitFinal_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/oitBackBlend.fragment.js
const oitBackBlend_fragment_name = "oitBackBlendPixelShader",oitBackBlend_fragment_shader = `precision highp float;
uniform sampler2D uBackColor;
void main() {
glFragColor=texelFetch(uBackColor,ivec2(gl_FragCoord.xy),0);
if (glFragColor.a==0.0) { 
discard;
}
}`;shaderStore/* ShaderStore.ShadersStore.oitBackBlendPixelShader */.v.ShadersStore.oitBackBlendPixelShader = oitBackBlend_fragment_shader;const oitBackBlendPixelShader = { name: "oitBackBlendPixelShader", shader: oitBackBlend_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/depthPeelingRenderer.js
class DepthPeelingEffectConfiguration {constructor() {this.enabled = !0, this.name = "depthPeeling", this.texturesRequired = [4];}}class DepthPeelingRenderer {get passCount() {return this._passCount;}set passCount(count) {this._passCount === count || (this._passCount = count, this._createRenderPassIds());}get useRenderPasses() {return this._useRenderPasses;}set useRenderPasses(usePasses) {this._useRenderPasses === usePasses || (this._useRenderPasses = usePasses, this._createRenderPassIds());}addExcludedMesh(mesh) {-1 === this._excludedMeshes.indexOf(mesh.uniqueId) && this._excludedMeshes.push(mesh.uniqueId);}removeExcludedMesh(mesh) {const index = this._excludedMeshes.indexOf(mesh.uniqueId);-1 !== index && this._excludedMeshes.splice(index, 1);}constructor(scene, passCount = 5) {if (this._thinTextures = [], this._currentPingPongState = 0, this._layoutCacheFormat = [[!0], [!0, !0], [!0, !0, !0]], this._layoutCache = [], this._candidateSubMeshes = new smartArray/* SmartArray */.t(10), this._excludedSubMeshes = new smartArray/* SmartArray */.t(10), this._excludedMeshes = [], this._colorCache = [new math_color/* Color4 */.HE(DepthPeelingRenderer._DEPTH_CLEAR_VALUE, DepthPeelingRenderer._DEPTH_CLEAR_VALUE, 0, 0), new math_color/* Color4 */.HE(-DepthPeelingRenderer._MIN_DEPTH, DepthPeelingRenderer._MAX_DEPTH, 0, 0), new math_color/* Color4 */.HE(0, 0, 0, 0)], this._scene = scene, this._engine = scene.getEngine(), this._passCount = passCount, !scene.enablePrePassRenderer()) return void logger/* Logger.Warn */.Y.Warn("Depth peeling for order independant transparency could not enable PrePass, aborting.");for (let i = 0; i < this._layoutCacheFormat.length; ++i) this._layoutCache[i] = this._engine.buildTextureLayout(this._layoutCacheFormat[i]);this._renderPassIds = [], this.useRenderPasses = !1, this._prePassEffectConfiguration = new DepthPeelingEffectConfiguration(), this._createTextures(), this._createEffects();}_createRenderPassIds() {if (this._releaseRenderPassIds(), this._useRenderPasses) for (let i = 0; i < this._passCount + 1; ++i) this._renderPassIds[i] || (this._renderPassIds[i] = this._engine.createRenderPassId(`DepthPeelingRenderer - pass #${i}`));}_releaseRenderPassIds() {for (let i = 0; i < this._renderPassIds.length; ++i) this._engine.releaseRenderPassId(this._renderPassIds[i]);this._renderPassIds = [];}_createTextures() {const size = { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() };this._depthMrts = [new MultiRenderTarget("depthPeelingDepth0", size, 3, this._scene), new MultiRenderTarget("depthPeelingDepth1", size, 3, this._scene)], this._colorMrts = [new MultiRenderTarget("depthPeelingColor0", size, 2, this._scene, { generateDepthBuffer: !1 }), new MultiRenderTarget("depthPeelingColor1", size, 2, this._scene, { generateDepthBuffer: !1 })], this._blendBackMrt = new MultiRenderTarget("depthPeelingBack", size, 1, this._scene, { generateDepthBuffer: !1 }), this._outputRT = new Textures_renderTargetTexture/* RenderTargetTexture */._("depthPeelingOutput", size, this._scene, !1);const optionsArray = [{ format: 7, samplingMode: 1, type: this._engine.getCaps().textureFloatLinearFiltering ? 1 : 2 }, { format: 5, samplingMode: 1, type: 2 }];for (let i = 0; 2 > i; i++) {const depthTexture = this._engine._createInternalTexture(size, optionsArray[0], !1),frontColorTexture = this._engine._createInternalTexture(size, optionsArray[1], !1),backColorTexture = this._engine._createInternalTexture(size, optionsArray[1], !1);this._depthMrts[i].setInternalTexture(depthTexture, 0), this._depthMrts[i].setInternalTexture(frontColorTexture, 1), this._depthMrts[i].setInternalTexture(backColorTexture, 2), this._colorMrts[i].setInternalTexture(frontColorTexture, 0), this._colorMrts[i].setInternalTexture(backColorTexture, 1), this._thinTextures.push(new thinTexture/* ThinTexture */.g(depthTexture), new thinTexture/* ThinTexture */.g(frontColorTexture), new thinTexture/* ThinTexture */.g(backColorTexture));}}_disposeTextures() {for (let i = 0; i < this._thinTextures.length; i++) 6 != i && this._thinTextures[i].dispose();for (let i = 0; 2 > i; i++) this._depthMrts[i].dispose(!0), this._colorMrts[i].dispose(!0), this._blendBackMrt.dispose(!0);this._outputRT.dispose(), this._thinTextures = [], this._colorMrts = [], this._depthMrts = [];}_updateTextures() {return (this._depthMrts[0].getSize().width !== this._engine.getRenderWidth() || this._depthMrts[0].getSize().height !== this._engine.getRenderHeight()) && (this._disposeTextures(), this._createTextures()), this._updateTextureReferences();}_updateTextureReferences() {var _a;const prePassRenderer = this._scene.prePassRenderer;if (!prePassRenderer) return !1;const textureIndex = prePassRenderer.getIndex(4),prePassTexture = (null === (_a = prePassRenderer.defaultRT.textures) || void 0 === _a ? void 0 : _a.length) ? prePassRenderer.defaultRT.textures[textureIndex].getInternalTexture() : null;return !!prePassTexture && (this._blendBackTexture !== prePassTexture && (this._blendBackTexture = prePassTexture, this._blendBackMrt.setInternalTexture(this._blendBackTexture, 0), this._thinTextures[6] && this._thinTextures[6].dispose(), this._thinTextures[6] = new thinTexture/* ThinTexture */.g(this._blendBackTexture), prePassRenderer.defaultRT.renderTarget._shareDepth(this._depthMrts[0].renderTarget)), !0);}_createEffects() {this._blendBackEffectWrapper = new effectRenderer/* EffectWrapper */.H({ fragmentShader: "oitBackBlend", useShaderStore: !0, engine: this._engine, samplerNames: ["uBackColor"], uniformNames: [] }), this._blendBackEffectWrapperPingPong = new effectRenderer/* EffectWrapper */.H({ fragmentShader: "oitBackBlend", useShaderStore: !0, engine: this._engine, samplerNames: ["uBackColor"], uniformNames: [] }), this._finalEffectWrapper = new effectRenderer/* EffectWrapper */.H({ fragmentShader: "oitFinal", useShaderStore: !0, engine: this._engine, samplerNames: ["uFrontColor", "uBackColor"], uniformNames: [] }), this._effectRenderer = new effectRenderer/* EffectRenderer */.I(this._engine);}setPrePassRenderer(prePassRenderer) {prePassRenderer.addEffectConfiguration(this._prePassEffectConfiguration);}bind(effect) {effect.setTexture("oitDepthSampler", this._thinTextures[3 * this._currentPingPongState]), effect.setTexture("oitFrontColorSampler", this._thinTextures[3 * this._currentPingPongState + 1]);}_renderSubMeshes(transparentSubMeshes) {let mapMaterialContext;this._useRenderPasses && (mapMaterialContext = {});for (let j = 0; j < transparentSubMeshes.length; j++) {const material = transparentSubMeshes.data[j].getMaterial();let previousShaderHotSwapping = !0,previousBFC = !1;const subMesh = transparentSubMeshes.data[j];let drawWrapper,firstDraw = !1;if (this._useRenderPasses && (drawWrapper = subMesh._getDrawWrapper(), firstDraw = !drawWrapper), material && (previousShaderHotSwapping = material.allowShaderHotSwapping, previousBFC = material.backFaceCulling, material.allowShaderHotSwapping = !1, material.backFaceCulling = !1), subMesh.render(!1), firstDraw && (drawWrapper = subMesh._getDrawWrapper(), drawWrapper.materialContext)) {let newMaterialContext = mapMaterialContext[drawWrapper.materialContext.uniqueId];newMaterialContext || (newMaterialContext = mapMaterialContext[drawWrapper.materialContext.uniqueId] = this._engine.createMaterialContext()), subMesh._getDrawWrapper().materialContext = newMaterialContext;}material && (material.allowShaderHotSwapping = previousShaderHotSwapping, material.backFaceCulling = previousBFC);}}_finalCompose(writeId) {var _a;const output = null === (_a = this._scene.prePassRenderer) || void 0 === _a ? void 0 : _a.setCustomOutput(this._outputRT);output ? this._engine.bindFramebuffer(this._outputRT.renderTarget) : this._engine.restoreDefaultFramebuffer(), this._engine.setAlphaMode(0), this._engine.applyStates(), this._engine.enableEffect(this._finalEffectWrapper._drawWrapper), this._finalEffectWrapper.effect.setTexture("uFrontColor", this._thinTextures[3 * writeId + 1]), this._finalEffectWrapper.effect.setTexture("uBackColor", this._thinTextures[6]), this._effectRenderer.render(this._finalEffectWrapper);}render(transparentSubMeshes) {if (this._candidateSubMeshes.length = 0, this._excludedSubMeshes.length = 0, !this._blendBackEffectWrapper.effect.isReady() || !this._blendBackEffectWrapperPingPong.effect.isReady() || !this._finalEffectWrapper.effect.isReady() || !this._updateTextures()) return this._excludedSubMeshes;for (let i = 0; i < transparentSubMeshes.length; i++) {const subMesh = transparentSubMeshes.data[i],material = subMesh.getMaterial();material && (material.fillMode === Materials_material/* Material.TriangleFanDrawMode */.F.TriangleFanDrawMode || material.fillMode === Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode || material.fillMode === Materials_material/* Material.TriangleStripDrawMode */.F.TriangleStripDrawMode) && -1 === this._excludedMeshes.indexOf(subMesh.getMesh().uniqueId) ? this._candidateSubMeshes.push(subMesh) : this._excludedSubMeshes.push(subMesh);}if (!this._candidateSubMeshes.length) return this._engine.bindFramebuffer(this._colorMrts[1].renderTarget), this._engine.bindAttachments(this._layoutCache[1]), this._engine.clear(this._colorCache[2], !0, !1, !1), this._engine.unBindFramebuffer(this._colorMrts[1].renderTarget), this._finalCompose(1), this._excludedSubMeshes;const currentRenderPassId = this._engine.currentRenderPassId;this._scene.prePassRenderer._enabled = !1, this._useRenderPasses && (this._engine.currentRenderPassId = this._renderPassIds[0]), this._engine.bindFramebuffer(this._depthMrts[0].renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.clear(this._colorCache[0], !0, !1, !1), this._engine.unBindFramebuffer(this._depthMrts[0].renderTarget), this._engine.bindFramebuffer(this._depthMrts[1].renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.clear(this._colorCache[1], !0, !1, !1), this._engine.unBindFramebuffer(this._depthMrts[1].renderTarget), this._engine.bindFramebuffer(this._colorMrts[0].renderTarget), this._engine.bindAttachments(this._layoutCache[1]), this._engine.clear(this._colorCache[2], !0, !1, !1), this._engine.unBindFramebuffer(this._colorMrts[0].renderTarget), this._engine.bindFramebuffer(this._colorMrts[1].renderTarget), this._engine.bindAttachments(this._layoutCache[1]), this._engine.clear(this._colorCache[2], !0, !1, !1), this._engine.unBindFramebuffer(this._colorMrts[1].renderTarget), this._engine.bindFramebuffer(this._depthMrts[0].renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.setAlphaMode(11), this._engine.setAlphaEquation(3), this._engine.depthCullingState.depthMask = !1, this._engine.depthCullingState.depthTest = !0, this._engine.applyStates(), this._currentPingPongState = 1, this._renderSubMeshes(this._candidateSubMeshes), this._engine.unBindFramebuffer(this._depthMrts[0].renderTarget), this._scene.resetCachedMaterial();let readId = 0,writeId = 0;for (let i = 0; i < this._passCount; i++) {readId = i % 2, writeId = 1 - readId, this._currentPingPongState = readId, this._useRenderPasses && (this._engine.currentRenderPassId = this._renderPassIds[i + 1]), this._engine.bindFramebuffer(this._depthMrts[writeId].renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.clear(this._colorCache[0], !0, !1, !1), this._engine.unBindFramebuffer(this._depthMrts[writeId].renderTarget), this._engine.bindFramebuffer(this._colorMrts[writeId].renderTarget), this._engine.bindAttachments(this._layoutCache[1]), this._engine.clear(this._colorCache[2], !0, !1, !1), this._engine.unBindFramebuffer(this._colorMrts[writeId].renderTarget), this._engine.bindFramebuffer(this._depthMrts[writeId].renderTarget), this._engine.bindAttachments(this._layoutCache[2]), this._engine.setAlphaMode(11), this._engine.setAlphaEquation(3), this._engine.depthCullingState.depthTest = !1, this._engine.applyStates(), this._renderSubMeshes(this._candidateSubMeshes), this._engine.unBindFramebuffer(this._depthMrts[writeId].renderTarget), this._scene.resetCachedMaterial(), this._engine.bindFramebuffer(this._blendBackMrt.renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.setAlphaEquation(0), this._engine.setAlphaMode(17), this._engine.applyStates();const blendBackEffectWrapper = 0 !== writeId && this._useRenderPasses ? this._blendBackEffectWrapperPingPong : this._blendBackEffectWrapper;this._engine.enableEffect(blendBackEffectWrapper._drawWrapper), blendBackEffectWrapper.effect.setTexture("uBackColor", this._thinTextures[3 * writeId + 2]), this._effectRenderer.render(blendBackEffectWrapper), this._engine.unBindFramebuffer(this._blendBackMrt.renderTarget);}return this._engine.currentRenderPassId = currentRenderPassId, this._finalCompose(writeId), this._scene.prePassRenderer._enabled = !0, this._engine.depthCullingState.depthMask = !0, this._engine.depthCullingState.depthTest = !0, this._excludedSubMeshes;}dispose() {this._disposeTextures(), this._blendBackEffectWrapper.dispose(), this._finalEffectWrapper.dispose(), this._effectRenderer.dispose(), this._releaseRenderPassIds();}}DepthPeelingRenderer._DEPTH_CLEAR_VALUE = -99999, DepthPeelingRenderer._MIN_DEPTH = 0, DepthPeelingRenderer._MAX_DEPTH = 1;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/depthPeelingSceneComponent.js
Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "depthPeelingRenderer", { get: function () {if (!this._depthPeelingRenderer) {let component = this._getComponent(sceneComponent/* SceneComponentConstants.NAME_DEPTHPEELINGRENDERER */.l.NAME_DEPTHPEELINGRENDERER);component || (component = new DepthPeelingSceneComponent(this), this._addComponent(component));}return this._depthPeelingRenderer;}, set: function (value) {this._depthPeelingRenderer = value;}, enumerable: !0, configurable: !0 }), Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "useOrderIndependentTransparency", { get: function () {return this._useOrderIndependentTransparency;}, set: function (value) {var _a;this._useOrderIndependentTransparency === value || (this._useOrderIndependentTransparency = value, this.markAllMaterialsAsDirty(63), null === (_a = this.prePassRenderer) || void 0 === _a ? void 0 : _a.markAsDirty());}, enumerable: !0, configurable: !0 });class DepthPeelingSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_DEPTHPEELINGRENDERER */.l.NAME_DEPTHPEELINGRENDERER, this.scene = scene, scene.depthPeelingRenderer = new DepthPeelingRenderer(scene);}register() {}rebuild() {}dispose() {var _a;null === (_a = this.scene.depthPeelingRenderer) || void 0 === _a ? void 0 : _a.dispose(), this.scene.depthPeelingRenderer = null;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/line.fragment.js
const line_fragment_name = "linePixelShader",line_fragment_shader = `#include<clipPlaneFragmentDeclaration>
uniform vec4 color;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.linePixelShader */.v.ShadersStore.linePixelShader = line_fragment_shader;const linePixelShader = { name: "linePixelShader", shader: line_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/line.vertex.js
const line_vertex_name = "lineVertexShader",line_vertex_shader = `#include<instancesDeclaration>
#include<clipPlaneVertexDeclaration>
attribute vec3 position;
attribute vec4 normal;
uniform mat4 viewProjection;
uniform float width;
uniform float aspectRatio;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
mat4 worldViewProjection=viewProjection*finalWorld;
vec4 viewPosition=worldViewProjection*vec4(position,1.0);
vec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);
vec2 currentScreen=viewPosition.xy/viewPosition.w;
vec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;
currentScreen.x*=aspectRatio;
nextScreen.x*=aspectRatio;
vec2 dir=normalize(nextScreen-currentScreen);
vec2 normalDir=vec2(-dir.y,dir.x);
normalDir*=width/2.0;
normalDir.x/=aspectRatio;
vec4 offset=vec4(normalDir*normal.w,0.0,0.0);
gl_Position=viewPosition+offset;
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
vec4 worldPos=finalWorld*vec4(position,1.0);
#include<clipPlaneVertex>
#endif
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.lineVertexShader */.v.ShadersStore.lineVertexShader = line_vertex_shader;const lineVertexShader = { name: "lineVertexShader", shader: line_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/edgesRenderer.js
abstractMesh/* AbstractMesh.prototype.disableEdgesRendering */.x.prototype.disableEdgesRendering = function () {return this._edgesRenderer && (this._edgesRenderer.dispose(), this._edgesRenderer = null), this;}, abstractMesh/* AbstractMesh.prototype.enableEdgesRendering */.x.prototype.enableEdgesRendering = function (epsilon = .95, checkVerticesInsteadOfIndices = !1, options) {return this.disableEdgesRendering(), this._edgesRenderer = new EdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices, !0, options), this;}, Object.defineProperty(abstractMesh/* AbstractMesh.prototype */.x.prototype, "edgesRenderer", { get: function () {return this._edgesRenderer;}, enumerable: !0, configurable: !0 }), LinesMesh.prototype.enableEdgesRendering = function (epsilon = .95, checkVerticesInsteadOfIndices = !1) {return this.disableEdgesRendering(), this._edgesRenderer = new LineEdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices), this;}, InstancedLinesMesh.prototype.enableEdgesRendering = function (epsilon = .95, checkVerticesInsteadOfIndices = !1) {return LinesMesh.prototype.enableEdgesRendering.apply(this, arguments), this;};class FaceAdjacencies {constructor() {this.edges = [], this.edgesConnectedCount = 0;}}class EdgesRenderer {get linesPositions() {return this._linesPositions;}get linesNormals() {return this._linesNormals;}get linesIndices() {return this._linesIndices;}get lineShader() {return this._lineShader;}set lineShader(shader) {this._lineShader = shader;}static _GetShader(scene) {if (!scene._edgeRenderLineShader) {const shader = new shaderMaterial/* ShaderMaterial */.j("lineShader", scene, "line", { attributes: ["position", "normal"], uniforms: ["world", "viewProjection", "color", "width", "aspectRatio"] }, !1);shader.disableDepthWrite = !0, shader.backFaceCulling = !1, shader.checkReadyOnEveryCall = scene.getEngine().isWebGPU, scene._edgeRenderLineShader = shader;}return scene._edgeRenderLineShader;}constructor(source, epsilon = .95, checkVerticesInsteadOfIndices = !1, generateEdgesLines = !0, options) {var _a;this.edgesWidthScalerForOrthographic = 1e3, this.edgesWidthScalerForPerspective = 50, this._linesPositions = [], this._linesNormals = [], this._linesIndices = [], this._buffers = {}, this._buffersForInstances = {}, this._checkVerticesInsteadOfIndices = !1, this.isEnabled = !0, this.customInstances = new smartArray/* SmartArray */.t(32), this._source = source, this._checkVerticesInsteadOfIndices = checkVerticesInsteadOfIndices, this._options = null !== options && void 0 !== options ? options : null, this._epsilon = epsilon, this._source.getScene().getEngine().isWebGPU && (this._drawWrapper = new Materials_drawWrapper/* DrawWrapper */.q(source.getEngine())), this._prepareRessources(), generateEdgesLines && (null === (_a = null === options || void 0 === options ? void 0 : options.useAlternateEdgeFinder) || void 0 === _a || _a ? this._generateEdgesLinesAlternate() : this._generateEdgesLines()), this._meshRebuildObserver = this._source.onRebuildObservable.add(() => {this._rebuild();}), this._meshDisposeObserver = this._source.onDisposeObservable.add(() => {this.dispose();});}_prepareRessources() {this._lineShader || (this._lineShader = EdgesRenderer._GetShader(this._source.getScene()));}_rebuild() {let buffer = this._buffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];buffer && buffer._rebuild(), buffer = this._buffers[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind], buffer && buffer._rebuild();const scene = this._source.getScene(),engine = scene.getEngine();this._ib = engine.createIndexBuffer(this._linesIndices);}dispose() {var _a;this._source.onRebuildObservable.remove(this._meshRebuildObserver), this._source.onDisposeObservable.remove(this._meshDisposeObserver);let buffer = this._buffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind];buffer && (buffer.dispose(), this._buffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = null), buffer = this._buffers[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind], buffer && (buffer.dispose(), this._buffers[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind] = null), this._ib && this._source.getScene().getEngine()._releaseBuffer(this._ib), this._lineShader.dispose(), null === (_a = this._drawWrapper) || void 0 === _a ? void 0 : _a.dispose();}_processEdgeForAdjacencies(pa, pb, p0, p1, p2) {return pa === p0 && pb === p1 || pa === p1 && pb === p0 ? 0 : pa === p1 && pb === p2 || pa === p2 && pb === p1 ? 1 : pa === p2 && pb === p0 || pa === p0 && pb === p2 ? 2 : -1;}_processEdgeForAdjacenciesWithVertices(pa, pb, p0, p1, p2) {const eps = 1e-10;return pa.equalsWithEpsilon(p0, eps) && pb.equalsWithEpsilon(p1, eps) || pa.equalsWithEpsilon(p1, eps) && pb.equalsWithEpsilon(p0, eps) ? 0 : pa.equalsWithEpsilon(p1, eps) && pb.equalsWithEpsilon(p2, eps) || pa.equalsWithEpsilon(p2, eps) && pb.equalsWithEpsilon(p1, eps) ? 1 : pa.equalsWithEpsilon(p2, eps) && pb.equalsWithEpsilon(p0, eps) || pa.equalsWithEpsilon(p0, eps) && pb.equalsWithEpsilon(p2, eps) ? 2 : -1;}_checkEdge(faceIndex, edge, faceNormals, p0, p1) {let needToCreateLine;if (edge === void 0) needToCreateLine = !0;else {const dotProduct = math_vector/* Vector3.Dot */.P.Dot(faceNormals[faceIndex], faceNormals[edge]);needToCreateLine = dotProduct < this._epsilon;}needToCreateLine && this.createLine(p0, p1, this._linesPositions.length / 3);}createLine(p0, p1, offset) {this._linesPositions.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z, p1.x, p1.y, p1.z, p1.x, p1.y, p1.z), this._linesNormals.push(p1.x, p1.y, p1.z, -1, p1.x, p1.y, p1.z, 1, p0.x, p0.y, p0.z, -1, p0.x, p0.y, p0.z, 1), this._linesIndices.push(offset, offset + 1, offset + 2, offset, offset + 2, offset + 3);}_tessellateTriangle(edgePoints, indexTriangle, indices, remapVertexIndices) {const makePointList = (edgePoints, pointIndices, firstIndex) => {0 <= firstIndex && pointIndices.push(firstIndex);for (let i = 0; i < edgePoints.length; ++i) pointIndices.push(edgePoints[i][0]);};let startEdge = 0;edgePoints[1].length >= edgePoints[0].length && edgePoints[1].length >= edgePoints[2].length ? startEdge = 1 : edgePoints[2].length >= edgePoints[0].length && edgePoints[2].length >= edgePoints[1].length && (startEdge = 2);for (let e = 0; 3 > e; ++e) e === startEdge ? edgePoints[e].sort((a, b) => a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0) : edgePoints[e].sort((a, b) => a[1] > b[1] ? -1 : a[1] < b[1] ? 1 : 0);const mainPointIndices = [],otherPointIndices = [];makePointList(edgePoints[startEdge], mainPointIndices, -1);const numMainPoints = mainPointIndices.length;for (let i = startEdge + 2; i >= startEdge + 1; --i) makePointList(edgePoints[i % 3], otherPointIndices, i === startEdge + 2 ? -1 : remapVertexIndices[indices[indexTriangle + (i + 1) % 3]]);const numOtherPoints = otherPointIndices.length,idxMain = 0,idxOther = 0;indices.push(remapVertexIndices[indices[indexTriangle + startEdge]], mainPointIndices[0], otherPointIndices[0]), indices.push(remapVertexIndices[indices[indexTriangle + (startEdge + 1) % 3]], otherPointIndices[numOtherPoints - 1], mainPointIndices[numMainPoints - 1]);const bucketIsMain = numMainPoints <= numOtherPoints,bucketStep = bucketIsMain ? numMainPoints : numOtherPoints,bucketLimit = bucketIsMain ? numOtherPoints : numMainPoints,bucketIdxLimit = bucketIsMain ? numMainPoints - 1 : numOtherPoints - 1,winding = bucketIsMain ? 0 : 1;let numTris = numMainPoints + numOtherPoints - 2,bucketIdx = bucketIsMain ? idxMain : idxOther,nbucketIdx = bucketIsMain ? idxOther : idxMain;const bucketPoints = bucketIsMain ? mainPointIndices : otherPointIndices,nbucketPoints = bucketIsMain ? otherPointIndices : mainPointIndices;for (let bucket = 0; 0 < numTris--;) {winding ? indices.push(bucketPoints[bucketIdx], nbucketPoints[nbucketIdx]) : indices.push(nbucketPoints[nbucketIdx], bucketPoints[bucketIdx]), bucket += bucketStep;let lastIdx;bucket >= bucketLimit && bucketIdx < bucketIdxLimit ? (lastIdx = bucketPoints[++bucketIdx], bucket -= bucketLimit) : lastIdx = nbucketPoints[++nbucketIdx], indices.push(lastIdx);}indices[indexTriangle + 0] = indices[indices.length - 3], indices[indexTriangle + 1] = indices[indices.length - 2], indices[indexTriangle + 2] = indices[indices.length - 1], indices.length -= 3;}_generateEdgesLinesAlternate() {var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;const positions = this._source.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind);let indices = this._source.getIndices();if (!indices || !positions) return;Array.isArray(indices) || (indices = Array.from(indices));const useFastVertexMerger = null === (_b = null === (_a = this._options) || void 0 === _a ? void 0 : _a.useFastVertexMerger) || void 0 === _b || _b,epsVertexMerge = useFastVertexMerger ? Math.round(-Math.log(null !== (_d = null === (_c = this._options) || void 0 === _c ? void 0 : _c.epsilonVertexMerge) && void 0 !== _d ? _d : 1e-6) / Math.log(10)) : null !== (_f = null === (_e = this._options) || void 0 === _e ? void 0 : _e.epsilonVertexMerge) && void 0 !== _f ? _f : 1e-6,remapVertexIndices = [],uniquePositions = [];if (useFastVertexMerger) {const mapVertices = {};for (let v1 = 0; v1 < positions.length; v1 += 3) {const x1 = positions[v1 + 0],y1 = positions[v1 + 1],z1 = positions[v1 + 2],key = x1.toFixed(epsVertexMerge) + "|" + y1.toFixed(epsVertexMerge) + "|" + z1.toFixed(epsVertexMerge);if (mapVertices[key] !== void 0) remapVertexIndices.push(mapVertices[key]);else {const idx = v1 / 3;mapVertices[key] = idx, remapVertexIndices.push(idx), uniquePositions.push(idx);}}} else for (let v1 = 0; v1 < positions.length; v1 += 3) {const x1 = positions[v1 + 0],y1 = positions[v1 + 1],z1 = positions[v1 + 2];let found = !1;for (let v2 = 0; v2 < v1 && !found; v2 += 3) {const x2 = positions[v2 + 0],y2 = positions[v2 + 1],z2 = positions[v2 + 2];if (Math.abs(x1 - x2) < epsVertexMerge && Math.abs(y1 - y2) < epsVertexMerge && Math.abs(z1 - z2) < epsVertexMerge) {remapVertexIndices.push(v2 / 3), found = !0;break;}}found || (remapVertexIndices.push(v1 / 3), uniquePositions.push(v1 / 3));}if (null === (_g = this._options) || void 0 === _g ? void 0 : _g.applyTessellation) {const epsVertexAligned = null !== (_j = null === (_h = this._options) || void 0 === _h ? void 0 : _h.epsilonVertexAligned) && void 0 !== _j ? _j : 1e-6,mustTesselate = [];for (let index = 0; index < indices.length; index += 3) {let triangleToTessellate;for (let i = 0; 3 > i; ++i) {const p0Index = remapVertexIndices[indices[index + i]],p1Index = remapVertexIndices[indices[index + (i + 1) % 3]],p2Index = remapVertexIndices[indices[index + (i + 2) % 3]];if (p0Index === p1Index) continue;const p0x = positions[3 * p0Index + 0],p0y = positions[3 * p0Index + 1],p0z = positions[3 * p0Index + 2],p1x = positions[3 * p1Index + 0],p1y = positions[3 * p1Index + 1],p1z = positions[3 * p1Index + 2],p0p1 = Math.sqrt((p1x - p0x) * (p1x - p0x) + (p1y - p0y) * (p1y - p0y) + (p1z - p0z) * (p1z - p0z));for (let v = 0; v < uniquePositions.length - 1; v++) {const vIndex = uniquePositions[v];if (vIndex === p0Index || vIndex === p1Index || vIndex === p2Index) continue;const x = positions[3 * vIndex + 0],y = positions[3 * vIndex + 1],z = positions[3 * vIndex + 2],p0p = Math.sqrt((x - p0x) * (x - p0x) + (y - p0y) * (y - p0y) + (z - p0z) * (z - p0z)),pp1 = Math.sqrt((x - p1x) * (x - p1x) + (y - p1y) * (y - p1y) + (z - p1z) * (z - p1z));Math.abs(p0p + pp1 - p0p1) < epsVertexAligned && (!triangleToTessellate && (triangleToTessellate = { index: index, edgesPoints: [[], [], []] }, mustTesselate.push(triangleToTessellate)), triangleToTessellate.edgesPoints[i].push([vIndex, p0p]));}}}for (let t = 0; t < mustTesselate.length; ++t) {const triangle = mustTesselate[t];this._tessellateTriangle(triangle.edgesPoints, triangle.index, indices, remapVertexIndices);}mustTesselate.length = 0;}const edges = {};for (let index = 0; index < indices.length; index += 3) {let faceNormal;for (let i = 0; 3 > i; ++i) {let p0Index = remapVertexIndices[indices[index + i]],p1Index = remapVertexIndices[indices[index + (i + 1) % 3]];const p2Index = remapVertexIndices[indices[index + (i + 2) % 3]];if (p0Index === p1Index || (p0Index === p2Index || p1Index === p2Index) && (null === (_k = this._options) || void 0 === _k ? void 0 : _k.removeDegeneratedTriangles)) continue;if (math_vector/* TmpVectors.Vector3.0.copyFromFloats */.jp.Vector3[0].copyFromFloats(positions[3 * p0Index + 0], positions[3 * p0Index + 1], positions[3 * p0Index + 2]), math_vector/* TmpVectors.Vector3.1.copyFromFloats */.jp.Vector3[1].copyFromFloats(positions[3 * p1Index + 0], positions[3 * p1Index + 1], positions[3 * p1Index + 2]), math_vector/* TmpVectors.Vector3.2.copyFromFloats */.jp.Vector3[2].copyFromFloats(positions[3 * p2Index + 0], positions[3 * p2Index + 1], positions[3 * p2Index + 2]), faceNormal || (math_vector/* TmpVectors.Vector3.1.subtractToRef */.jp.Vector3[1].subtractToRef(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0], math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3]), math_vector/* TmpVectors.Vector3.2.subtractToRef */.jp.Vector3[2].subtractToRef(math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1], math_vector/* TmpVectors.Vector3.4 */.jp.Vector3[4]), faceNormal = math_vector/* Vector3.Cross */.P.Cross(math_vector/* TmpVectors.Vector3.3 */.jp.Vector3[3], math_vector/* TmpVectors.Vector3.4 */.jp.Vector3[4]), faceNormal.normalize()), p0Index > p1Index) {const tmp = p0Index;p0Index = p1Index, p1Index = tmp;}const key = p0Index + "_" + p1Index,ei = edges[key];if (!ei) edges[key] = { normal: faceNormal, done: !1, index: index, i: i };else if (!ei.done) {const dotProduct = math_vector/* Vector3.Dot */.P.Dot(faceNormal, ei.normal);dotProduct < this._epsilon && this.createLine(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0], math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1], this._linesPositions.length / 3), ei.done = !0;}}}for (const key in edges) {const ei = edges[key];if (!ei.done) {const p0Index = remapVertexIndices[indices[ei.index + ei.i]],p1Index = remapVertexIndices[indices[ei.index + (ei.i + 1) % 3]];math_vector/* TmpVectors.Vector3.0.copyFromFloats */.jp.Vector3[0].copyFromFloats(positions[3 * p0Index + 0], positions[3 * p0Index + 1], positions[3 * p0Index + 2]), math_vector/* TmpVectors.Vector3.1.copyFromFloats */.jp.Vector3[1].copyFromFloats(positions[3 * p1Index + 0], positions[3 * p1Index + 1], positions[3 * p1Index + 2]), this.createLine(math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0], math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1], this._linesPositions.length / 3);}}const engine = this._source.getScene().getEngine();this._buffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = new Buffers_buffer/* VertexBuffer */.o(engine, this._linesPositions, Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, !1), this._buffers[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind] = new Buffers_buffer/* VertexBuffer */.o(engine, this._linesNormals, Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, !1, !1, 4), this._buffersForInstances[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = this._buffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], this._buffersForInstances[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind] = this._buffers[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind], this._ib = engine.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;}_generateEdgesLines() {const positions = this._source.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),indices = this._source.getIndices();if (!indices || !positions) return;const adjacencies = [],faceNormals = [];let index, faceAdjacencies;for (index = 0; index < indices.length; index += 3) {faceAdjacencies = new FaceAdjacencies();const p0Index = indices[index],p1Index = indices[index + 1],p2Index = indices[index + 2];faceAdjacencies.p0 = new math_vector/* Vector3 */.P(positions[3 * p0Index], positions[3 * p0Index + 1], positions[3 * p0Index + 2]), faceAdjacencies.p1 = new math_vector/* Vector3 */.P(positions[3 * p1Index], positions[3 * p1Index + 1], positions[3 * p1Index + 2]), faceAdjacencies.p2 = new math_vector/* Vector3 */.P(positions[3 * p2Index], positions[3 * p2Index + 1], positions[3 * p2Index + 2]);const faceNormal = math_vector/* Vector3.Cross */.P.Cross(faceAdjacencies.p1.subtract(faceAdjacencies.p0), faceAdjacencies.p2.subtract(faceAdjacencies.p1));faceNormal.normalize(), faceNormals.push(faceNormal), adjacencies.push(faceAdjacencies);}for (index = 0; index < adjacencies.length; index++) {faceAdjacencies = adjacencies[index];for (let otherIndex = index + 1; otherIndex < adjacencies.length; otherIndex++) {const otherFaceAdjacencies = adjacencies[otherIndex];if (3 === faceAdjacencies.edgesConnectedCount) break;if (3 === otherFaceAdjacencies.edgesConnectedCount) continue;const otherP0 = indices[3 * otherIndex],otherP1 = indices[3 * otherIndex + 1],otherP2 = indices[3 * otherIndex + 2];for (let otherEdgeIndex, edgeIndex = 0; 3 > edgeIndex && !((otherEdgeIndex = 0, void 0 === faceAdjacencies.edges[edgeIndex]) && (0 == edgeIndex ? otherEdgeIndex = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(faceAdjacencies.p0, faceAdjacencies.p1, otherFaceAdjacencies.p0, otherFaceAdjacencies.p1, otherFaceAdjacencies.p2) : this._processEdgeForAdjacencies(indices[3 * index], indices[3 * index + 1], otherP0, otherP1, otherP2) : 1 === edgeIndex ? otherEdgeIndex = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(faceAdjacencies.p1, faceAdjacencies.p2, otherFaceAdjacencies.p0, otherFaceAdjacencies.p1, otherFaceAdjacencies.p2) : this._processEdgeForAdjacencies(indices[3 * index + 1], indices[3 * index + 2], otherP0, otherP1, otherP2) : 2 === edgeIndex ? otherEdgeIndex = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(faceAdjacencies.p2, faceAdjacencies.p0, otherFaceAdjacencies.p0, otherFaceAdjacencies.p1, otherFaceAdjacencies.p2) : this._processEdgeForAdjacencies(indices[3 * index + 2], indices[3 * index], otherP0, otherP1, otherP2) : void 0, -1 !== otherEdgeIndex) && (faceAdjacencies.edges[edgeIndex] = otherIndex, otherFaceAdjacencies.edges[otherEdgeIndex] = index, faceAdjacencies.edgesConnectedCount++, otherFaceAdjacencies.edgesConnectedCount++, 3 === faceAdjacencies.edgesConnectedCount)); edgeIndex++);}}for (index = 0; index < adjacencies.length; index++) {const current = adjacencies[index];this._checkEdge(index, current.edges[0], faceNormals, current.p0, current.p1), this._checkEdge(index, current.edges[1], faceNormals, current.p1, current.p2), this._checkEdge(index, current.edges[2], faceNormals, current.p2, current.p0);}const engine = this._source.getScene().getEngine();this._buffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = new Buffers_buffer/* VertexBuffer */.o(engine, this._linesPositions, Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, !1), this._buffers[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind] = new Buffers_buffer/* VertexBuffer */.o(engine, this._linesNormals, Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, !1, !1, 4), this._buffersForInstances[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = this._buffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind], this._buffersForInstances[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind] = this._buffers[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind], this._ib = engine.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;}isReady() {return this._lineShader.isReady(this._source, this._source.hasInstances && 0 < this.customInstances.length || this._source.hasThinInstances);}render() {const scene = this._source.getScene(),currentDrawWrapper = this._lineShader._getDrawWrapper();if (this._drawWrapper && this._lineShader._setDrawWrapper(this._drawWrapper), !this.isReady() || !scene.activeCamera) return void this._lineShader._setDrawWrapper(currentDrawWrapper);const hasInstances = this._source.hasInstances && 0 < this.customInstances.length,useBuffersWithInstances = hasInstances || this._source.hasThinInstances;let instanceCount = 0;if (useBuffersWithInstances) if (this._buffersForInstances.world0 = this._source.getVertexBuffer("world0"), this._buffersForInstances.world1 = this._source.getVertexBuffer("world1"), this._buffersForInstances.world2 = this._source.getVertexBuffer("world2"), this._buffersForInstances.world3 = this._source.getVertexBuffer("world3"), hasInstances) {const instanceStorage = this._source._instanceDataStorage;if (instanceCount = this.customInstances.length, !instanceStorage.instancesData) return void (this._source.getScene()._activeMeshesFrozen || this.customInstances.reset());if (!instanceStorage.isFrozen) {let offset = 0;for (let i = 0; i < instanceCount; ++i) this.customInstances.data[i].copyToArray(instanceStorage.instancesData, offset), offset += 16;instanceStorage.instancesBuffer.updateDirectly(instanceStorage.instancesData, 0, instanceCount);}} else instanceCount = this._source.thinInstanceCount;const engine = scene.getEngine();this._lineShader._preBind(), 1 === this._source.edgesColor.a ? engine.setAlphaMode(0) : engine.setAlphaMode(2), engine.bindBuffers(useBuffersWithInstances ? this._buffersForInstances : this._buffers, this._ib, this._lineShader.getEffect()), scene.resetCachedMaterial(), this._lineShader.setColor4("color", this._source.edgesColor), scene.activeCamera.mode === Cameras_camera/* Camera.ORTHOGRAPHIC_CAMERA */.V.ORTHOGRAPHIC_CAMERA ? this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForOrthographic) : this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForPerspective), this._lineShader.setFloat("aspectRatio", engine.getAspectRatio(scene.activeCamera)), this._lineShader.bind(this._source.getWorldMatrix()), engine.drawElementsType(Materials_material/* Material.TriangleFillMode */.F.TriangleFillMode, 0, this._indicesCount, instanceCount), this._lineShader.unbind(), useBuffersWithInstances && engine.unbindInstanceAttributes(), this._source.getScene()._activeMeshesFrozen || this.customInstances.reset(), this._lineShader._setDrawWrapper(currentDrawWrapper);}}class LineEdgesRenderer extends EdgesRenderer {constructor(source, epsilon = .95, checkVerticesInsteadOfIndices = !1) {super(source, epsilon, checkVerticesInsteadOfIndices, !1), this._generateEdgesLines();}_generateEdgesLines() {const positions = this._source.getVerticesData(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind),indices = this._source.getIndices();if (!indices || !positions) return;const p0 = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],p1 = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1],len = indices.length - 1;for (let i = 0, offset = 0; i < len; i += 2, offset += 4) math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(positions, 3 * indices[i], p0), math_vector/* Vector3.FromArrayToRef */.P.FromArrayToRef(positions, 3 * indices[i + 1], p1), this.createLine(p0, p1, offset);const engine = this._source.getScene().getEngine();this._buffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = new Buffers_buffer/* VertexBuffer */.o(engine, this._linesPositions, Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, !1), this._buffers[Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind] = new Buffers_buffer/* VertexBuffer */.o(engine, this._linesNormals, Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind, !1, !1, 4), this._ib = engine.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Materials/Textures/prePassRenderTarget.js
class PrePassRenderTarget extends MultiRenderTarget {constructor(name, renderTargetTexture, size, count, scene, options) {super(name, size, count, scene, options), this._beforeCompositionPostProcesses = [], this._internalTextureDirty = !1, this.enabled = !1, this.renderTargetTexture = null, this.renderTargetTexture = renderTargetTexture;}_createCompositionEffect() {this.imageProcessingPostProcess = new ImageProcessingPostProcess("prePassComposition", 1, null, void 0, this._engine), this.imageProcessingPostProcess._updateParameters();}_checkSize() {const requiredWidth = this._engine.getRenderWidth(!0),requiredHeight = this._engine.getRenderHeight(!0),width = this.getRenderWidth(),height = this.getRenderHeight();(width !== requiredWidth || height !== requiredHeight) && (this.resize({ width: requiredWidth, height: requiredHeight }), this._internalTextureDirty = !0);}updateCount(count, options, textureNames) {super.updateCount(count, options, textureNames), this._internalTextureDirty = !0;}_resetPostProcessChain() {this._beforeCompositionPostProcesses.length = 0;}dispose() {const scene = this._scene;if (super.dispose(), scene && scene.prePassRenderer) {const index = scene.prePassRenderer.renderTargets.indexOf(this);-1 !== index && scene.prePassRenderer.renderTargets.splice(index, 1);}this.imageProcessingPostProcess && this.imageProcessingPostProcess.dispose(), this.renderTargetTexture && (this.renderTargetTexture._prePassRenderTarget = null), this._outputPostProcess && (this._outputPostProcess.autoClear = !0, this._outputPostProcess.restoreDefaultInputTexture());}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/prePassRenderer.js
class PrePassRenderer {getIndex(type) {return this._textureIndices[type];}get samples() {return this.defaultRT.samples;}set samples(n) {this.defaultRT.samples = n;}getRenderTarget() {return this._currentTarget;}_setRenderTarget(prePassRenderTarget) {prePassRenderTarget ? this._currentTarget = prePassRenderTarget : (this._currentTarget = this.defaultRT, this._engine.currentRenderPassId = this._currentTarget.renderPassId);}get currentRTisSceneRT() {return this._currentTarget === this.defaultRT;}_refreshGeometryBufferRendererLink() {if (!this.doNotUseGeometryRendererFallback) {if (this._geometryBuffer = this._scene.enableGeometryBufferRenderer(), !this._geometryBuffer) return void (this.doNotUseGeometryRendererFallback = !0);this._geometryBuffer._linkPrePassRenderer(this);} else this._geometryBuffer && this._geometryBuffer._unlinkPrePassRenderer(), this._geometryBuffer = null, this._scene.disableGeometryBufferRenderer();}get enabled() {return this._enabled;}constructor(scene) {this.excludedSkinnedMesh = [], this.excludedMaterials = [], this.mrtCount = 0, this._mrtFormats = [], this._mrtLayout = [], this._mrtNames = [], this._textureIndices = [], this._isDirty = !0, this._effectConfigurations = [], this.doNotUseGeometryRendererFallback = !0, this.renderTargets = [], this._clearColor = new math_color/* Color4 */.HE(0, 0, 0, 0), this._enabled = !1, this._needsCompositionForThisPass = !1, this.disableGammaTransform = !1, this._scene = scene, this._engine = scene.getEngine(), PrePassRenderer._SceneComponentInitialization(this._scene), this.defaultRT = this._createRenderTarget("sceneprePassRT", null), this._currentTarget = this.defaultRT;}_createRenderTarget(name, renderTargetTexture) {const rt = new PrePassRenderTarget(name, renderTargetTexture, { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, 0, this._scene, { generateMipMaps: !1, generateStencilBuffer: this._engine.isStencilEnable, defaultType: 0, types: [], drawOnlyOnFirstAttachmentByDefault: !0 });return this.renderTargets.push(rt), rt;}get isSupported() {return this._scene.getEngine().getCaps().drawBuffersExtension;}bindAttachmentsForEffect(effect, subMesh) {const material = subMesh.getMaterial(),isPrePassCapable = material && material.isPrePassCapable,excluded = material && -1 !== this.excludedMaterials.indexOf(material);this.enabled && this._currentTarget.enabled && (effect._multiTarget && isPrePassCapable && !excluded ? this._engine.bindAttachments(this._multiRenderAttachments) : (this._engine._currentRenderTarget ? this._engine.bindAttachments(this._defaultAttachments) : this._engine.restoreSingleAttachment(), this._geometryBuffer && this.currentRTisSceneRT && !excluded && this._geometryBuffer.renderList.push(subMesh.getRenderingMesh())));}_reinitializeAttachments() {const multiRenderLayout = [],clearLayout = [!1],defaultLayout = [!0];for (let i = 0; i < this.mrtCount; i++) multiRenderLayout.push(!0), 0 < i && (clearLayout.push(!0), defaultLayout.push(!1));this._multiRenderAttachments = this._engine.buildTextureLayout(multiRenderLayout), this._clearAttachments = this._engine.buildTextureLayout(clearLayout), this._defaultAttachments = this._engine.buildTextureLayout(defaultLayout);}_resetLayout() {for (let i = 0; i < PrePassRenderer._TextureFormats.length; i++) this._textureIndices[PrePassRenderer._TextureFormats[i].type] = -1;this._textureIndices[4] = 0, this._mrtLayout = [4], this._mrtFormats = [PrePassRenderer._TextureFormats[4].format], this._mrtNames = [PrePassRenderer._TextureFormats[4].name], this.mrtCount = 1;}_updateGeometryBufferLayout() {if (this._refreshGeometryBufferRendererLink(), this._geometryBuffer) {this._geometryBuffer._resetLayout();const texturesActivated = [];for (let i = 0; i < this._mrtLayout.length; i++) texturesActivated.push(!1);this._geometryBuffer._linkInternalTexture(this.defaultRT.getInternalTexture());const matches = [{ prePassConstant: 5, geometryBufferConstant: GeometryBufferRenderer.DEPTH_TEXTURE_TYPE }, { prePassConstant: 6, geometryBufferConstant: GeometryBufferRenderer.NORMAL_TEXTURE_TYPE }, { prePassConstant: 1, geometryBufferConstant: GeometryBufferRenderer.POSITION_TEXTURE_TYPE }, { prePassConstant: 3, geometryBufferConstant: GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE }, { prePassConstant: 2, geometryBufferConstant: GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE }];for (let i = 0; i < matches.length; i++) {const index = this._mrtLayout.indexOf(matches[i].prePassConstant);-1 !== index && (this._geometryBuffer._forceTextureType(matches[i].geometryBufferConstant, index), texturesActivated[index] = !0);}this._geometryBuffer._setAttachments(this._engine.buildTextureLayout(texturesActivated));}}restoreAttachments() {this.enabled && this._currentTarget.enabled && this._defaultAttachments && (this._engine._currentRenderTarget ? this._engine.bindAttachments(this._defaultAttachments) : this._engine.restoreSingleAttachment());}_beforeDraw(camera) {this._isDirty && this._update();this._enabled && this._currentTarget.enabled && (this._geometryBuffer && (this._geometryBuffer.renderList = []), this._setupOutputForThisPass(this._currentTarget, camera));}_prepareFrame(prePassRenderTarget, faceIndex, layer) {prePassRenderTarget.renderTargetTexture ? prePassRenderTarget.renderTargetTexture._prepareFrame(this._scene, faceIndex, layer, prePassRenderTarget.renderTargetTexture.useCameraPostProcesses) : this._postProcessesSourceForThisPass.length ? this._scene.postProcessManager._prepareFrame() : this._engine.restoreDefaultFramebuffer();}setCustomOutput(rt) {const firstPP = this._postProcessesSourceForThisPass[0];return !!firstPP && (firstPP.inputTexture = rt.renderTarget, !0);}_renderPostProcesses(prePassRenderTarget, faceIndex) {var _a;const firstPP = this._postProcessesSourceForThisPass[0],outputTexture = firstPP ? firstPP.inputTexture : prePassRenderTarget.renderTargetTexture ? prePassRenderTarget.renderTargetTexture.renderTarget : null;let postProcessChain = this._currentTarget._beforeCompositionPostProcesses;this._needsCompositionForThisPass && (postProcessChain = postProcessChain.concat([this._currentTarget.imageProcessingPostProcess])), postProcessChain.length && (this._scene.postProcessManager._prepareFrame(null === (_a = this._currentTarget.renderTarget) || void 0 === _a ? void 0 : _a.texture, postProcessChain), this._scene.postProcessManager.directRender(postProcessChain, outputTexture, !1, faceIndex));}_afterDraw(faceIndex, layer) {this._enabled && this._currentTarget.enabled && (this._prepareFrame(this._currentTarget, faceIndex, layer), this._renderPostProcesses(this._currentTarget, faceIndex));}_clear() {this._enabled && this._currentTarget.enabled && (this._bindFrameBuffer(this._currentTarget), this._engine.bindAttachments(this._clearAttachments), this._engine.clear(this._clearColor, !0, !1, !1), this._engine.bindAttachments(this._defaultAttachments));}_bindFrameBuffer() {if (this._enabled && this._currentTarget.enabled) {this._currentTarget._checkSize();const internalTexture = this._currentTarget.renderTarget;internalTexture && this._engine.bindFramebuffer(internalTexture);}}_setEnabled(enabled) {this._enabled = enabled;}_setRenderTargetEnabled(prePassRenderTarget, enabled) {prePassRenderTarget.enabled = enabled, enabled || this._unlinkInternalTexture(prePassRenderTarget);}addEffectConfiguration(cfg) {for (let i = 0; i < this._effectConfigurations.length; i++) if (this._effectConfigurations[i].name === cfg.name) return this._effectConfigurations[i];return this._effectConfigurations.push(cfg), cfg;}_enable() {const previousMrtCount = this.mrtCount;for (let i = 0; i < this._effectConfigurations.length; i++) this._effectConfigurations[i].enabled && this._enableTextures(this._effectConfigurations[i].texturesRequired);for (let i = 0; i < this.renderTargets.length; i++) {(this.mrtCount !== previousMrtCount || this.renderTargets[i].count !== this.mrtCount) && this.renderTargets[i].updateCount(this.mrtCount, { types: this._mrtFormats }, this._mrtNames.concat("prePass_DepthBuffer")), this.renderTargets[i]._resetPostProcessChain();for (let j = 0; j < this._effectConfigurations.length; j++) this._effectConfigurations[j].enabled && (!this._effectConfigurations[j].postProcess && this._effectConfigurations[j].createPostProcess && this._effectConfigurations[j].createPostProcess(), this._effectConfigurations[j].postProcess && this.renderTargets[i]._beforeCompositionPostProcesses.push(this._effectConfigurations[j].postProcess));}this._reinitializeAttachments(), this._setEnabled(!0), this._updateGeometryBufferLayout();}_disable() {this._setEnabled(!1);for (let i = 0; i < this.renderTargets.length; i++) this._setRenderTargetEnabled(this.renderTargets[i], !1);this._resetLayout();for (let i = 0; i < this._effectConfigurations.length; i++) this._effectConfigurations[i].enabled = !1;}_getPostProcessesSource(prePassRenderTarget, camera) {if (camera) return camera._postProcesses;if (prePassRenderTarget.renderTargetTexture) {if (prePassRenderTarget.renderTargetTexture.useCameraPostProcesses) {const camera = prePassRenderTarget.renderTargetTexture.activeCamera ? prePassRenderTarget.renderTargetTexture.activeCamera : this._scene.activeCamera;return camera ? camera._postProcesses : [];}return prePassRenderTarget.renderTargetTexture.postProcesses ? prePassRenderTarget.renderTargetTexture.postProcesses : [];}return this._scene.activeCamera ? this._scene.activeCamera._postProcesses : [];}_setupOutputForThisPass(prePassRenderTarget, camera) {const secondaryCamera = camera && this._scene.activeCameras && !!this._scene.activeCameras.length && 0 !== this._scene.activeCameras.indexOf(camera);this._postProcessesSourceForThisPass = this._getPostProcessesSource(prePassRenderTarget, camera), this._postProcessesSourceForThisPass = this._postProcessesSourceForThisPass.filter((pp) => null != pp), this._scene.autoClear = !0;const cameraHasImageProcessing = this._hasImageProcessing(this._postProcessesSourceForThisPass);this._needsCompositionForThisPass = !cameraHasImageProcessing && !this.disableGammaTransform && this._needsImageProcessing() && !secondaryCamera;const firstCameraPP = this._getFirstPostProcess(this._postProcessesSourceForThisPass),firstPrePassPP = prePassRenderTarget._beforeCompositionPostProcesses && prePassRenderTarget._beforeCompositionPostProcesses[0];let firstPP = null;this._scene.imageProcessingConfiguration.applyByPostProcess = this._needsCompositionForThisPass || cameraHasImageProcessing, this._needsCompositionForThisPass && !prePassRenderTarget.imageProcessingPostProcess && prePassRenderTarget._createCompositionEffect(), firstPrePassPP ? firstPP = firstPrePassPP : this._needsCompositionForThisPass ? firstPP = prePassRenderTarget.imageProcessingPostProcess : firstCameraPP && (firstPP = firstCameraPP), this._bindFrameBuffer(prePassRenderTarget), this._linkInternalTexture(prePassRenderTarget, firstPP);}_linkInternalTexture(prePassRenderTarget, postProcess) {postProcess && (postProcess.autoClear = !1, postProcess.inputTexture = prePassRenderTarget.renderTarget), prePassRenderTarget._outputPostProcess !== postProcess && (prePassRenderTarget._outputPostProcess && this._unlinkInternalTexture(prePassRenderTarget), prePassRenderTarget._outputPostProcess = postProcess), prePassRenderTarget._internalTextureDirty && (this._updateGeometryBufferLayout(), prePassRenderTarget._internalTextureDirty = !1);}_unlinkInternalTexture(prePassRenderTarget) {prePassRenderTarget._outputPostProcess && (prePassRenderTarget._outputPostProcess.autoClear = !0, prePassRenderTarget._outputPostProcess.restoreDefaultInputTexture(), prePassRenderTarget._outputPostProcess = null);}_needsImageProcessing() {for (let i = 0; i < this._effectConfigurations.length; i++) if (this._effectConfigurations[i].enabled && this._effectConfigurations[i].needsImageProcessing) return !0;return !1;}_hasImageProcessing(postProcesses) {var _a;let isIPPAlreadyPresent = !1;if (postProcesses) for (let i = 0; i < postProcesses.length; i++) if ("ImageProcessingPostProcess" === (null === (_a = postProcesses[i]) || void 0 === _a ? void 0 : _a.getClassName())) {isIPPAlreadyPresent = !0;break;}return isIPPAlreadyPresent;}_getFirstPostProcess(postProcesses) {for (let ppIndex = 0; ppIndex < postProcesses.length; ppIndex++) if (null !== postProcesses[ppIndex]) return postProcesses[ppIndex];return null;}markAsDirty() {this._isDirty = !0;}_enableTextures(types) {this._scene.needsPreviousWorldMatrices = !1;for (let i = 0; i < types.length; i++) {const type = types[i];-1 === this._textureIndices[type] && (this._textureIndices[type] = this._mrtLayout.length, this._mrtLayout.push(type), this._mrtFormats.push(PrePassRenderer._TextureFormats[type].format), this._mrtNames.push(PrePassRenderer._TextureFormats[type].name), this.mrtCount++), 2 === type && (this._scene.needsPreviousWorldMatrices = !0);}}_update() {this._disable();let enablePrePass = !1;this._scene.imageProcessingConfiguration.applyByPostProcess = !1, this._scene._depthPeelingRenderer && this._scene.useOrderIndependentTransparency && (this._scene._depthPeelingRenderer.setPrePassRenderer(this), enablePrePass = !0);for (let i = 0; i < this._scene.materials.length; i++) this._scene.materials[i].setPrePassRenderer(this) && (enablePrePass = !0);enablePrePass && this._setRenderTargetEnabled(this.defaultRT, !0);let postProcesses;for (let i = 0; i < this.renderTargets.length; i++) {if (this.renderTargets[i].renderTargetTexture) postProcesses = this._getPostProcessesSource(this.renderTargets[i]);else {const camera = this._scene.activeCamera;if (!camera) continue;postProcesses = camera._postProcesses;}if (postProcesses && (postProcesses = postProcesses.filter((pp) => null != pp), postProcesses)) {for (let j = 0; j < postProcesses.length; j++) postProcesses[j].setPrePassRenderer(this) && (this._setRenderTargetEnabled(this.renderTargets[i], !0), enablePrePass = !0);this._hasImageProcessing(postProcesses) && (this._scene.imageProcessingConfiguration.applyByPostProcess = !0);}}this._markAllMaterialsAsPrePassDirty(), this._isDirty = !1, enablePrePass && this._enable();}_markAllMaterialsAsPrePassDirty() {const materials = this._scene.materials;for (let i = 0; i < materials.length; i++) materials[i].markAsDirty(Materials_material/* Material.PrePassDirtyFlag */.F.PrePassDirtyFlag);}dispose() {for (let i = this.renderTargets.length - 1; 0 <= i; i--) this.renderTargets[i].dispose();for (let i = 0; i < this._effectConfigurations.length; i++) this._effectConfigurations[i].dispose && this._effectConfigurations[i].dispose();}}PrePassRenderer._SceneComponentInitialization = () => {throw (0,devTools/* _WarnImport */.S)("PrePassRendererSceneComponent");}, PrePassRenderer._TextureFormats = [{ type: 0, format: 2, name: "prePass_Irradiance" }, { type: 1, format: 2, name: "prePass_Position" }, { type: 2, format: 0, name: "prePass_Velocity" }, { type: 3, format: 0, name: "prePass_Reflectivity" }, { type: 4, format: 2, name: "prePass_Color" }, { type: 5, format: 2, name: "prePass_Depth" }, { type: 6, format: 2, name: "prePass_Normal" }, { type: 7, format: 0, name: "prePass_Albedo" }];
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/prePassRendererSceneComponent.js
Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "prePassRenderer", { get: function () {return this._prePassRenderer;}, set: function (value) {value && value.isSupported && (this._prePassRenderer = value);}, enumerable: !0, configurable: !0 }), core_scene/* Scene.prototype.enablePrePassRenderer */.x.prototype.enablePrePassRenderer = function () {return this._prePassRenderer ? this._prePassRenderer : (this._prePassRenderer = new PrePassRenderer(this), this._prePassRenderer.isSupported || (this._prePassRenderer = null, logger/* Logger.Error */.Y.Error("PrePassRenderer needs WebGL 2 support.\nMaybe you tried to use the following features that need the PrePassRenderer :\n + Subsurface Scattering")), this._prePassRenderer);}, core_scene/* Scene.prototype.disablePrePassRenderer */.x.prototype.disablePrePassRenderer = function () {this._prePassRenderer && (this._prePassRenderer.dispose(), this._prePassRenderer = null);};class PrePassRendererSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_PREPASSRENDERER */.l.NAME_PREPASSRENDERER, this.scene = scene;}register() {this.scene._beforeCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORECAMERADRAW_PREPASS */.l.STEP_BEFORECAMERADRAW_PREPASS, this, this._beforeCameraDraw), this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERCAMERADRAW_PREPASS */.l.STEP_AFTERCAMERADRAW_PREPASS, this, this._afterCameraDraw), this.scene._beforeRenderTargetDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_PREPASS */.l.STEP_BEFORERENDERTARGETDRAW_PREPASS, this, this._beforeRenderTargetDraw), this.scene._afterRenderTargetDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERCAMERADRAW_PREPASS */.l.STEP_AFTERCAMERADRAW_PREPASS, this, this._afterRenderTargetDraw), this.scene._beforeClearStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORECLEAR_PREPASS */.l.STEP_BEFORECLEAR_PREPASS, this, this._beforeClearStage), this.scene._beforeRenderTargetClearStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORERENDERTARGETCLEAR_PREPASS */.l.STEP_BEFORERENDERTARGETCLEAR_PREPASS, this, this._beforeRenderTargetClearStage), this.scene._beforeRenderingMeshStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORERENDERINGMESH_PREPASS */.l.STEP_BEFORERENDERINGMESH_PREPASS, this, this._beforeRenderingMeshStage), this.scene._afterRenderingMeshStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERRENDERINGMESH_PREPASS */.l.STEP_AFTERRENDERINGMESH_PREPASS, this, this._afterRenderingMeshStage);}_beforeRenderTargetDraw(renderTarget, faceIndex, layer) {this.scene.prePassRenderer && (this.scene.prePassRenderer._setRenderTarget(renderTarget._prePassRenderTarget), this.scene.prePassRenderer._beforeDraw(void 0, faceIndex, layer));}_afterRenderTargetDraw(renderTarget, faceIndex, layer) {this.scene.prePassRenderer && this.scene.prePassRenderer._afterDraw(faceIndex, layer);}_beforeRenderTargetClearStage(renderTarget) {this.scene.prePassRenderer && (!renderTarget._prePassRenderTarget && (renderTarget._prePassRenderTarget = this.scene.prePassRenderer._createRenderTarget(renderTarget.name + "_prePassRTT", renderTarget)), this.scene.prePassRenderer._setRenderTarget(renderTarget._prePassRenderTarget), this.scene.prePassRenderer._clear());}_beforeCameraDraw(camera) {this.scene.prePassRenderer && (this.scene.prePassRenderer._setRenderTarget(null), this.scene.prePassRenderer._beforeDraw(camera));}_afterCameraDraw() {this.scene.prePassRenderer && this.scene.prePassRenderer._afterDraw();}_beforeClearStage() {this.scene.prePassRenderer && (this.scene.prePassRenderer._setRenderTarget(null), this.scene.prePassRenderer._clear());}_beforeRenderingMeshStage(mesh, subMesh, batch, effect) {if (effect) {const scene = mesh.getScene();scene.prePassRenderer && scene.prePassRenderer.bindAttachmentsForEffect(effect, subMesh);}}_afterRenderingMeshStage(mesh) {const scene = mesh.getScene();scene.prePassRenderer && scene.prePassRenderer.restoreAttachments();}rebuild() {this.scene.disablePrePassRenderer(), this.scene.enablePrePassRenderer();}dispose() {this.scene.disablePrePassRenderer();}}PrePassRenderer._SceneComponentInitialization = (scene) => {let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_PREPASSRENDERER */.l.NAME_PREPASSRENDERER);component || (component = new PrePassRendererSceneComponent(scene), scene._addComponent(component));};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fibonacci.js
const fibonacci_name = "fibonacci",fibonacci_shader = `#define rcp(x) 1./x
#define GOLDEN_RATIO 1.618033988749895
#define TWO_PI 6.2831855
vec2 Golden2dSeq(int i,float n)
{
return vec2(float(i)/n+(0.5/n),fract(float(i)*rcp(GOLDEN_RATIO)));
}
vec2 SampleDiskGolden(int i,int sampleCount)
{
vec2 f=Golden2dSeq(i,float(sampleCount));
return vec2(sqrt(f.x),TWO_PI*f.y);
}`;shaderStore/* ShaderStore.IncludesShadersStore.fibonacci */.v.IncludesShadersStore.fibonacci = fibonacci_shader;const fibonacci = { name: "fibonacci", shader: fibonacci_shader };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/subSurfaceScatteringFunctions.js
var subSurfaceScatteringFunctions = __webpack_require__("./node_modules/@babylonjs/core/Shaders/ShadersInclude/subSurfaceScatteringFunctions.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/diffusionProfile.js
const diffusionProfile_name = "diffusionProfile",diffusionProfile_shader = `uniform vec3 diffusionS[5];
uniform float diffusionD[5];
uniform float filterRadii[5];`;shaderStore/* ShaderStore.IncludesShadersStore.diffusionProfile */.v.IncludesShadersStore.diffusionProfile = diffusionProfile_shader;const diffusionProfile = { name: "diffusionProfile", shader: diffusionProfile_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/subSurfaceScattering.fragment.js
const subSurfaceScattering_fragment_name = "subSurfaceScatteringPixelShader",subSurfaceScattering_fragment_shader = `#include<fibonacci>
#include<helperFunctions>
#include<subSurfaceScatteringFunctions>
#include<diffusionProfile>
varying vec2 vUV;
uniform vec2 texelSize;
uniform sampler2D textureSampler;
uniform sampler2D irradianceSampler;
uniform sampler2D depthSampler;
uniform sampler2D albedoSampler;
uniform vec2 viewportSize;
uniform float metersPerUnit;
const float LOG2_E=1.4426950408889634;
const float SSS_PIXELS_PER_SAMPLE=4.;
const int _SssSampleBudget=40;
#define rcp(x) 1./x
#define Sq(x) x*x
#define SSS_BILATERAL_FILTER true
vec3 EvalBurleyDiffusionProfile(float r,vec3 S)
{
vec3 exp_13=exp2(((LOG2_E*(-1.0/3.0))*r)*S); 
vec3 expSum=exp_13*(1.+exp_13*exp_13); 
return (S*rcp(8.*PI))*expSum; 
}
vec2 SampleBurleyDiffusionProfile(float u,float rcpS)
{
u=1.-u; 
float g=1.+(4.*u)*(2.*u+sqrt(1.+(4.*u)*u));
float n=exp2(log2(g)*(-1.0/3.0)); 
float p=(g*n)*n; 
float c=1.+p+n; 
float d=(3./LOG2_E*2.)+(3./LOG2_E)*log2(u); 
float x=(3./LOG2_E)*log2(c)-d; 
float rcpExp=((c*c)*c)*rcp((4.*u)*((c*c)+(4.*u)*(4.*u)));
float r=x*rcpS;
float rcpPdf=(8.*PI*rcpS)*rcpExp; 
return vec2(r,rcpPdf);
}
vec3 ComputeBilateralWeight(float xy2,float z,float mmPerUnit,vec3 S,float rcpPdf)
{
#ifndef SSS_BILATERAL_FILTER
z=0.;
#endif
float r=sqrt(xy2+(z*mmPerUnit)*(z*mmPerUnit));
float area=rcpPdf;
#if SSS_CLAMP_ARTIFACT
return clamp(EvalBurleyDiffusionProfile(r,S)*area,0.0,1.0);
#else
return EvalBurleyDiffusionProfile(r,S)*area;
#endif
}
void EvaluateSample(int i,int n,vec3 S,float d,vec3 centerPosVS,float mmPerUnit,float pixelsPerMm,
float phase,inout vec3 totalIrradiance,inout vec3 totalWeight)
{
float scale =rcp(float(n));
float offset=rcp(float(n))*0.5;
float sinPhase,cosPhase;
sinPhase=sin(phase);
cosPhase=cos(phase);
vec2 bdp=SampleBurleyDiffusionProfile(float(i)*scale+offset,d);
float r=bdp.x;
float rcpPdf=bdp.y;
float phi=SampleDiskGolden(i,n).y;
float sinPhi,cosPhi;
sinPhi=sin(phi);
cosPhi=cos(phi);
float sinPsi=cosPhase*sinPhi+sinPhase*cosPhi; 
float cosPsi=cosPhase*cosPhi-sinPhase*sinPhi; 
vec2 vec=r*vec2(cosPsi,sinPsi);
vec2 position; 
float xy2;
position=vUV+round((pixelsPerMm*r)*vec2(cosPsi,sinPsi))*texelSize;
xy2 =r*r;
vec4 textureSample=texture2D(irradianceSampler,position);
float viewZ=texture2D(depthSampler,position).r;
vec3 irradiance =textureSample.rgb;
if (testLightingForSSS(textureSample.a))
{
float relZ=viewZ-centerPosVS.z;
vec3 weight=ComputeBilateralWeight(xy2,relZ,mmPerUnit,S,rcpPdf);
totalIrradiance+=weight*irradiance;
totalWeight +=weight;
}
else
{
}
}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{
vec4 irradianceAndDiffusionProfile =texture2D(irradianceSampler,vUV);
vec3 centerIrradiance=irradianceAndDiffusionProfile.rgb;
int diffusionProfileIndex=int(round(irradianceAndDiffusionProfile.a*255.));
float centerDepth =0.;
vec4 inputColor=texture2D(textureSampler,vUV);
bool passedStencilTest=testLightingForSSS(irradianceAndDiffusionProfile.a);
if (passedStencilTest)
{
centerDepth=texture2D(depthSampler,vUV).r;
}
if (!passedStencilTest) { 
gl_FragColor=inputColor;
return;
}
float distScale =1.;
vec3 S =diffusionS[diffusionProfileIndex];
float d =diffusionD[diffusionProfileIndex];
float filterRadius=filterRadii[diffusionProfileIndex];
vec2 centerPosNDC=vUV;
vec2 cornerPosNDC=vUV+0.5*texelSize;
vec3 centerPosVS =vec3(centerPosNDC*viewportSize,1.0)*centerDepth; 
vec3 cornerPosVS =vec3(cornerPosNDC*viewportSize,1.0)*centerDepth; 
float mmPerUnit =1000.*(metersPerUnit*rcp(distScale));
float unitsPerMm=rcp(mmPerUnit);
float unitsPerPixel=2.*abs(cornerPosVS.x-centerPosVS.x);
float pixelsPerMm =rcp(unitsPerPixel)*unitsPerMm;
float filterArea =PI*Sq(filterRadius*pixelsPerMm);
int sampleCount =int(filterArea*rcp(SSS_PIXELS_PER_SAMPLE));
int sampleBudget=_SssSampleBudget;
int texturingMode=0;
vec3 albedo =texture2D(albedoSampler,vUV).rgb;
if (distScale==0. || sampleCount<1)
{
#ifdef DEBUG_SSS_SAMPLES
vec3 green=vec3(0.,1.,0.);
gl_FragColor=vec4(green,1.0);
return;
#endif
gl_FragColor=vec4(inputColor.rgb+albedo*centerIrradiance,1.0);
return;
}
#ifdef DEBUG_SSS_SAMPLES
vec3 red =vec3(1.,0.,0.);
vec3 blue=vec3(0.,0.,1.);
gl_FragColor=vec4(mix(blue,red,clamp(float(sampleCount)/float(sampleBudget),0.0,1.0)),1.0);
return;
#endif
float phase=0.;
int n=min(sampleCount,sampleBudget);
vec3 centerWeight =vec3(0.); 
vec3 totalIrradiance=vec3(0.);
vec3 totalWeight =vec3(0.);
for (int i=0; i<n; i++)
{
EvaluateSample(i,n,S,d,centerPosVS,mmPerUnit,pixelsPerMm,
phase,totalIrradiance,totalWeight);
}
totalWeight=max(totalWeight,HALF_MIN);
gl_FragColor=vec4(inputColor.rgb+albedo*max(totalIrradiance/totalWeight,vec3(0.0)),1.);
}`;shaderStore/* ShaderStore.ShadersStore.subSurfaceScatteringPixelShader */.v.ShadersStore.subSurfaceScatteringPixelShader = subSurfaceScattering_fragment_shader;const subSurfaceScatteringPixelShader = { name: "subSurfaceScatteringPixelShader", shader: subSurfaceScattering_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/PostProcesses/subSurfaceScatteringPostProcess.js
class SubSurfaceScatteringPostProcess extends PostProcesses_postProcess/* PostProcess */.D {getClassName() {return "SubSurfaceScatteringPostProcess";}constructor(name, scene, options, camera = null, samplingMode, engine, reusable, textureType = 0) {super(name, "subSurfaceScattering", ["texelSize", "viewportSize", "metersPerUnit"], ["diffusionS", "diffusionD", "filterRadii", "irradianceSampler", "depthSampler", "albedoSampler"], options, camera, samplingMode || Textures_texture/* Texture.BILINEAR_SAMPLINGMODE */.x.BILINEAR_SAMPLINGMODE, engine, reusable, null, textureType, "postprocess", void 0, !0), this._scene = scene, this.updateEffect(), this.onApplyObservable.add((effect) => {if (!scene.prePassRenderer || !scene.subSurfaceConfiguration) return void logger/* Logger.Error */.Y.Error("PrePass and subsurface configuration needs to be enabled for subsurface scattering.");const texelSize = this.texelSize;effect.setFloat("metersPerUnit", scene.subSurfaceConfiguration.metersPerUnit), effect.setFloat2("texelSize", texelSize.x, texelSize.y), effect.setTexture("irradianceSampler", scene.prePassRenderer.getRenderTarget().textures[scene.prePassRenderer.getIndex(0)]), effect.setTexture("depthSampler", scene.prePassRenderer.getRenderTarget().textures[scene.prePassRenderer.getIndex(5)]), effect.setTexture("albedoSampler", scene.prePassRenderer.getRenderTarget().textures[scene.prePassRenderer.getIndex(7)]), effect.setFloat2("viewportSize", Math.tan(scene.activeCamera.fov / 2) * scene.getEngine().getAspectRatio(scene.activeCamera, !0), Math.tan(scene.activeCamera.fov / 2)), effect.setArray3("diffusionS", scene.subSurfaceConfiguration.ssDiffusionS), effect.setArray("diffusionD", scene.subSurfaceConfiguration.ssDiffusionD), effect.setArray("filterRadii", scene.subSurfaceConfiguration.ssFilterRadii);});}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/subSurfaceConfiguration.js
class SubSurfaceConfiguration {get ssDiffusionS() {return this._ssDiffusionS;}get ssDiffusionD() {return this._ssDiffusionD;}get ssFilterRadii() {return this._ssFilterRadii;}constructor(scene) {this._ssDiffusionS = [], this._ssFilterRadii = [], this._ssDiffusionD = [], this.enabled = !1, this.needsImageProcessing = !0, this.name = sceneComponent/* SceneComponentConstants.NAME_SUBSURFACE */.l.NAME_SUBSURFACE, this.ssDiffusionProfileColors = [], this.metersPerUnit = 1, this.texturesRequired = [5, 7, 4, 0], this.addDiffusionProfile(new math_color/* Color3 */.Wo(1, 1, 1)), this._scene = scene, SubSurfaceConfiguration._SceneComponentInitialization(this._scene);}addDiffusionProfile(color) {if (5 <= this.ssDiffusionD.length) return logger/* Logger.Error */.Y.Error("You already reached the maximum number of diffusion profiles."), 0;for (let i = 0; i < this._ssDiffusionS.length / 3; i++) if (this._ssDiffusionS[3 * i] === color.r && this._ssDiffusionS[3 * i + 1] === color.g && this._ssDiffusionS[3 * i + 2] === color.b) return i;return this._ssDiffusionS.push(color.r, color.b, color.g), this._ssDiffusionD.push(Math.max(Math.max(color.r, color.b), color.g)), this._ssFilterRadii.push(this.getDiffusionProfileParameters(color)), this.ssDiffusionProfileColors.push(color), this._ssDiffusionD.length - 1;}createPostProcess() {return this.postProcess = new SubSurfaceScatteringPostProcess("subSurfaceScattering", this._scene, 1, null, void 0, this._scene.getEngine()), this.postProcess.autoClear = !1, this.postProcess;}clearAllDiffusionProfiles() {this._ssDiffusionD = [], this._ssDiffusionS = [], this._ssFilterRadii = [], this.ssDiffusionProfileColors = [];}dispose() {this.clearAllDiffusionProfiles(), this.postProcess && this.postProcess.dispose();}getDiffusionProfileParameters(color) {const maxScatteringDistance = Math.max(color.r, color.g, color.b);return this._sampleBurleyDiffusionProfile(.997, maxScatteringDistance);}_sampleBurleyDiffusionProfile(u, rcpS) {u = 1 - u;const g = 1 + 4 * u * (2 * u + Math.sqrt(1 + 4 * u * u)),n = Math.pow(g, -1 / 3),x = 3 * Math.log((1 + g * n * n + n) / (4 * u));return x * rcpS;}}SubSurfaceConfiguration._SceneComponentInitialization = () => {throw (0,devTools/* _WarnImport */.S)("SubSurfaceSceneComponent");};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/subSurfaceSceneComponent.js
abstractScene/* AbstractScene.AddParser */.p.AddParser(sceneComponent/* SceneComponentConstants.NAME_SUBSURFACE */.l.NAME_SUBSURFACE, (parsedData, scene) => {if (void 0 !== parsedData.ssDiffusionProfileColors && null !== parsedData.ssDiffusionProfileColors && (scene.enableSubSurfaceForPrePass(), scene.subSurfaceConfiguration)) for (let index = 0, cache = parsedData.ssDiffusionProfileColors.length; index < cache; index++) {const color = parsedData.ssDiffusionProfileColors[index];scene.subSurfaceConfiguration.addDiffusionProfile(new math_color/* Color3 */.Wo(color.r, color.g, color.b));}}), Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "subSurfaceConfiguration", { get: function () {return this._subSurfaceConfiguration;}, set: function (value) {value && this.enablePrePassRenderer() && (this._subSurfaceConfiguration = value);}, enumerable: !0, configurable: !0 }), core_scene/* Scene.prototype.enableSubSurfaceForPrePass */.x.prototype.enableSubSurfaceForPrePass = function () {if (this._subSurfaceConfiguration) return this._subSurfaceConfiguration;const prePassRenderer = this.enablePrePassRenderer();return prePassRenderer ? (this._subSurfaceConfiguration = new SubSurfaceConfiguration(this), prePassRenderer.addEffectConfiguration(this._subSurfaceConfiguration), this._subSurfaceConfiguration) : null;}, core_scene/* Scene.prototype.disableSubSurfaceForPrePass */.x.prototype.disableSubSurfaceForPrePass = function () {this._subSurfaceConfiguration && (this._subSurfaceConfiguration.dispose(), this._subSurfaceConfiguration = null);};class SubSurfaceSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_PREPASSRENDERER */.l.NAME_PREPASSRENDERER, this.scene = scene;}register() {}serialize(serializationObject) {if (this.scene.subSurfaceConfiguration) {const ssDiffusionProfileColors = this.scene.subSurfaceConfiguration.ssDiffusionProfileColors;serializationObject.ssDiffusionProfileColors = [];for (let i = 0; i < ssDiffusionProfileColors.length; i++) serializationObject.ssDiffusionProfileColors.push({ r: ssDiffusionProfileColors[i].r, g: ssDiffusionProfileColors[i].g, b: ssDiffusionProfileColors[i].b });}}addFromContainer() {}removeFromContainer() {!this.scene.prePassRenderer || this.scene.subSurfaceConfiguration && this.scene.subSurfaceConfiguration.clearAllDiffusionProfiles();}rebuild() {}dispose() {}}SubSurfaceConfiguration._SceneComponentInitialization = (scene) => {let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_SUBSURFACE */.l.NAME_SUBSURFACE);component || (component = new SubSurfaceSceneComponent(scene), scene._addComponent(component));};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/outline.fragment.js
const outline_fragment_name = "outlinePixelShader",outline_fragment_shader = `#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
uniform vec4 color;
#ifdef ALPHATEST
varying vec2 vUV;
uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
#endif
#include<logDepthFragment>
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.outlinePixelShader */.v.ShadersStore.outlinePixelShader = outline_fragment_shader;const outlinePixelShader = { name: "outlinePixelShader", shader: outline_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/outline.vertex.js
const outline_vertex_name = "outlineVertexShader",outline_vertex_shader = `attribute vec3 position;
attribute vec3 normal;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
uniform float offset;
#include<instancesDeclaration>
uniform mat4 viewProjection;
#ifdef ALPHATEST
varying vec2 vUV;
uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{
vec3 positionUpdated=position;
vec3 normalUpdated=normal;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
vec3 offsetPosition=positionUpdated+(normalUpdated*offset);
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(offsetPosition,1.0);
gl_Position=viewProjection*worldPos;
#ifdef ALPHATEST
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
}
`;shaderStore/* ShaderStore.ShadersStore.outlineVertexShader */.v.ShadersStore.outlineVertexShader = outline_vertex_shader;const outlineVertexShader = { name: "outlineVertexShader", shader: outline_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/outlineRenderer.js
core_scene/* Scene.prototype.getOutlineRenderer */.x.prototype.getOutlineRenderer = function () {return this._outlineRenderer || (this._outlineRenderer = new OutlineRenderer(this)), this._outlineRenderer;}, Object.defineProperty(Meshes_mesh/* Mesh.prototype */.Kj.prototype, "renderOutline", { get: function () {return this._renderOutline;}, set: function (value) {value && this.getScene().getOutlineRenderer(), this._renderOutline = value;}, enumerable: !0, configurable: !0 }), Object.defineProperty(Meshes_mesh/* Mesh.prototype */.Kj.prototype, "renderOverlay", { get: function () {return this._renderOverlay;}, set: function (value) {value && this.getScene().getOutlineRenderer(), this._renderOverlay = value;}, enumerable: !0, configurable: !0 });class OutlineRenderer {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_OUTLINERENDERER */.l.NAME_OUTLINERENDERER, this.zOffset = 1, this.zOffsetUnits = 4, this.scene = scene, this._engine = scene.getEngine(), this.scene._addComponent(this), this._passIdForDrawWrapper = [];for (let i = 0; 4 > i; ++i) this._passIdForDrawWrapper[i] = this._engine.createRenderPassId(`Outline Renderer (${i})`);}register() {this.scene._beforeRenderingMeshStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_BEFORERENDERINGMESH_OUTLINE */.l.STEP_BEFORERENDERINGMESH_OUTLINE, this, this._beforeRenderingMesh), this.scene._afterRenderingMeshStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERRENDERINGMESH_OUTLINE */.l.STEP_AFTERRENDERINGMESH_OUTLINE, this, this._afterRenderingMesh);}rebuild() {}dispose() {for (let i = 0; i < this._passIdForDrawWrapper.length; ++i) this._engine.releaseRenderPassId(this._passIdForDrawWrapper[i]);}render(subMesh, batch, useOverlay = !1, renderPassId) {renderPassId = null !== renderPassId && void 0 !== renderPassId ? renderPassId : this._passIdForDrawWrapper[0];const scene = this.scene,engine = scene.getEngine(),hardwareInstancedRendering = engine.getCaps().instancedArrays && (null !== batch.visibleInstances[subMesh._id] && void 0 !== batch.visibleInstances[subMesh._id] || subMesh.getRenderingMesh().hasThinInstances);if (!this.isReady(subMesh, hardwareInstancedRendering, renderPassId)) return;const ownerMesh = subMesh.getMesh(),replacementMesh = ownerMesh._internalAbstractMeshDataInfo._actAsRegularMesh ? ownerMesh : null,renderingMesh = subMesh.getRenderingMesh(),effectiveMesh = replacementMesh ? replacementMesh : renderingMesh,material = subMesh.getMaterial();if (!material || !scene.activeCamera) return;const drawWrapper = subMesh._getDrawWrapper(renderPassId),effect = Materials_drawWrapper/* DrawWrapper.GetEffect */.q.GetEffect(drawWrapper);if (engine.enableEffect(drawWrapper), material.useLogarithmicDepth && effect.setFloat("logarithmicDepthConstant", 2 / (Math.log(scene.activeCamera.maxZ + 1) / Math.LN2)), effect.setFloat("offset", useOverlay ? 0 : renderingMesh.outlineWidth), effect.setColor4("color", useOverlay ? renderingMesh.overlayColor : renderingMesh.outlineColor, useOverlay ? renderingMesh.overlayAlpha : material.alpha), effect.setMatrix("viewProjection", scene.getTransformMatrix()), effect.setMatrix("world", effectiveMesh.getWorldMatrix()), renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton && effect.setMatrices("mBones", renderingMesh.skeleton.getTransformMatrices(renderingMesh)), renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets && renderingMesh.morphTargetManager._bind(effect), materialHelper/* MaterialHelper.BindMorphTargetParameters */.G.BindMorphTargetParameters(renderingMesh, effect), hardwareInstancedRendering || renderingMesh._bind(subMesh, effect, material.fillMode), material && material.needAlphaTesting()) {const alphaTexture = material.getAlphaTestTexture();alphaTexture && (effect.setTexture("diffuseSampler", alphaTexture), effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix()));}(0,clipPlaneMaterialHelper/* bindClipPlane */.an)(effect, material, scene), engine.setZOffset(-this.zOffset), engine.setZOffsetUnits(-this.zOffsetUnits), renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, world) => {effect.setMatrix("world", world);}), engine.setZOffset(0), engine.setZOffsetUnits(0);}isReady(subMesh, useInstances, renderPassId) {renderPassId = null !== renderPassId && void 0 !== renderPassId ? renderPassId : this._passIdForDrawWrapper[0];const defines = [],attribs = [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, Buffers_buffer/* VertexBuffer.NormalKind */.o.NormalKind],mesh = subMesh.getMesh(),material = subMesh.getMaterial();if (!material) return !1;const scene = mesh.getScene();material.needAlphaTesting() && (defines.push("#define ALPHATEST"), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind) && (attribs.push(Buffers_buffer/* VertexBuffer.UVKind */.o.UVKind), defines.push("#define UV1")), mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind) && (attribs.push(Buffers_buffer/* VertexBuffer.UV2Kind */.o.UV2Kind), defines.push("#define UV2"))), material.useLogarithmicDepth && defines.push("#define LOGARITHMICDEPTH"), (0,clipPlaneMaterialHelper/* prepareDefinesForClipPlanes */.AN)(material, scene, defines), mesh.useBones && mesh.computeBonesUsingShaders ? (attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesKind */.o.MatricesIndicesKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsKind */.o.MatricesWeightsKind), 4 < mesh.numBoneInfluencers && (attribs.push(Buffers_buffer/* VertexBuffer.MatricesIndicesExtraKind */.o.MatricesIndicesExtraKind), attribs.push(Buffers_buffer/* VertexBuffer.MatricesWeightsExtraKind */.o.MatricesWeightsExtraKind)), defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers), defines.push("#define BonesPerMesh " + (mesh.skeleton ? mesh.skeleton.bones.length + 1 : 0))) : defines.push("#define NUM_BONE_INFLUENCERS 0");const morphTargetManager = mesh.morphTargetManager;let numMorphInfluencers = 0;morphTargetManager && 0 < morphTargetManager.numInfluencers && (numMorphInfluencers = morphTargetManager.numInfluencers, defines.push("#define MORPHTARGETS"), defines.push("#define NUM_MORPH_INFLUENCERS " + numMorphInfluencers), morphTargetManager.isUsingTextureForTargets && defines.push("#define MORPHTARGETS_TEXTURE"), materialHelper/* MaterialHelper.PrepareAttributesForMorphTargetsInfluencers */.G.PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, numMorphInfluencers)), useInstances && (defines.push("#define INSTANCES"), materialHelper/* MaterialHelper.PushAttributesForInstances */.G.PushAttributesForInstances(attribs), subMesh.getRenderingMesh().hasThinInstances && defines.push("#define THIN_INSTANCES"));const drawWrapper = subMesh._getDrawWrapper(renderPassId, !0),cachedDefines = drawWrapper.defines,join = defines.join("\n");if (cachedDefines !== join) {const uniforms = ["world", "mBones", "viewProjection", "diffuseMatrix", "offset", "color", "logarithmicDepthConstant", "morphTargetInfluences", "morphTargetTextureInfo", "morphTargetTextureIndices"];(0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.qx)(uniforms), drawWrapper.setEffect(this.scene.getEngine().createEffect("outline", attribs, uniforms, ["diffuseSampler", "morphTargets"], join, void 0, void 0, void 0, { maxSimultaneousMorphTargets: numMorphInfluencers }), join);}return drawWrapper.effect.isReady();}_beforeRenderingMesh(mesh, subMesh, batch) {if (this._savedDepthWrite = this._engine.getDepthWrite(), mesh.renderOutline) {const material = subMesh.getMaterial();material && material.needAlphaBlendingForMesh(mesh) && (this._engine.cacheStencilState(), this._engine.setDepthWrite(!1), this._engine.setColorWrite(!1), this._engine.setStencilBuffer(!0), this._engine.setStencilOperationPass(7681), this._engine.setStencilFunction(519), this._engine.setStencilMask(OutlineRenderer._StencilReference), this._engine.setStencilFunctionReference(OutlineRenderer._StencilReference), this._engine.stencilStateComposer.useStencilGlobalOnly = !0, this.render(subMesh, batch, !0, this._passIdForDrawWrapper[1]), this._engine.setColorWrite(!0), this._engine.setStencilFunction(517)), this._engine.setDepthWrite(!1), this.render(subMesh, batch, !1, this._passIdForDrawWrapper[0]), this._engine.setDepthWrite(this._savedDepthWrite), material && material.needAlphaBlendingForMesh(mesh) && (this._engine.stencilStateComposer.useStencilGlobalOnly = !1, this._engine.restoreStencilState());}}_afterRenderingMesh(mesh, subMesh, batch) {if (mesh.renderOverlay) {const currentMode = this._engine.getAlphaMode(),alphaBlendState = this._engine.alphaState.alphaBlend;this._engine.setAlphaMode(2), this.render(subMesh, batch, !0, this._passIdForDrawWrapper[3]), this._engine.setAlphaMode(currentMode), this._engine.setDepthWrite(this._savedDepthWrite), this._engine.alphaState.alphaBlend = alphaBlendState;}mesh.renderOutline && this._savedDepthWrite && (this._engine.setDepthWrite(!0), this._engine.setColorWrite(!1), this.render(subMesh, batch, !1, this._passIdForDrawWrapper[2]), this._engine.setColorWrite(!0));}}OutlineRenderer._StencilReference = 4;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Rendering/renderingGroup.js
var renderingGroup = __webpack_require__("./node_modules/@babylonjs/core/Rendering/renderingGroup.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObject.js
class FluidRenderingObject {get particleSize() {return this._particleSize;}set particleSize(size) {size === this._particleSize || (this._particleSize = size, this.onParticleSizeChanged.notifyObservers(this));}get useInstancing() {return !this.indexBuffer;}get useVelocity() {return this._useVelocity;}set useVelocity(use) {this._useVelocity !== use && this._hasVelocity() && (this._useVelocity = use, this._effectsAreDirty = !0);}_hasVelocity() {var _a;return !(!(null !== (_a = this.vertexBuffers) && void 0 !== _a) || !_a.velocity);}get indexBuffer() {return null;}getClassName() {return "FluidRenderingObject";}constructor(scene) {this.priority = 0, this._particleSize = .1, this.onParticleSizeChanged = new observable/* Observable */.y$(), this.particleThicknessAlpha = .05, this._useVelocity = !1, this._scene = scene, this._engine = scene.getEngine(), this._effectsAreDirty = !0, this._depthEffectWrapper = null, this._thicknessEffectWrapper = null;}_createEffects() {const uniformNames = ["view", "projection", "particleRadius", "size"],attributeNames = ["position", "offset"],defines = [];this._effectsAreDirty = !1, this.useVelocity && (attributeNames.push("velocity"), defines.push("#define FLUIDRENDERING_VELOCITY")), this._scene.useRightHandedSystem && defines.push("#define FLUIDRENDERING_RHS"), this._depthEffectWrapper = new effectRenderer/* EffectWrapper */.H({ engine: this._engine, useShaderStore: !0, vertexShader: "fluidRenderingParticleDepth", fragmentShader: "fluidRenderingParticleDepth", attributeNames, uniformNames, samplerNames: [], defines }), uniformNames.push("particleAlpha"), this._thicknessEffectWrapper = new effectRenderer/* EffectWrapper */.H({ engine: this._engine, useShaderStore: !0, vertexShader: "fluidRenderingParticleThickness", fragmentShader: "fluidRenderingParticleThickness", attributeNames: ["position", "offset"], uniformNames, samplerNames: [] });}isReady() {if (this._effectsAreDirty && this._createEffects(), !this._depthEffectWrapper || !this._thicknessEffectWrapper) return !1;const depthEffect = this._depthEffectWrapper._drawWrapper.effect,thicknessEffect = this._thicknessEffectWrapper._drawWrapper.effect;return depthEffect.isReady() && thicknessEffect.isReady();}renderDepthTexture() {const numParticles = this.numParticles;if (!this._depthEffectWrapper || 0 === numParticles) return;const depthDrawWrapper = this._depthEffectWrapper._drawWrapper,depthEffect = depthDrawWrapper.effect;this._engine.enableEffect(depthDrawWrapper), this._engine.bindBuffers(this.vertexBuffers, this.indexBuffer, depthEffect), depthEffect.setMatrix("view", this._scene.getViewMatrix()), depthEffect.setMatrix("projection", this._scene.getProjectionMatrix()), depthEffect.setFloat2("size", this._particleSize, this._particleSize), depthEffect.setFloat("particleRadius", this._particleSize / 2), this.useInstancing ? this._engine.drawArraysType(7, 0, 4, numParticles) : this._engine.drawElementsType(0, 0, numParticles);}renderThicknessTexture() {const numParticles = this.numParticles;if (!this._thicknessEffectWrapper || 0 === numParticles) return;const thicknessDrawWrapper = this._thicknessEffectWrapper._drawWrapper,thicknessEffect = thicknessDrawWrapper.effect;this._engine.setAlphaMode(6), this._engine.setDepthWrite(!1), this._engine.enableEffect(thicknessDrawWrapper), this._engine.bindBuffers(this.vertexBuffers, this.indexBuffer, thicknessEffect), thicknessEffect.setMatrix("view", this._scene.getViewMatrix()), thicknessEffect.setMatrix("projection", this._scene.getProjectionMatrix()), thicknessEffect.setFloat("particleAlpha", this.particleThicknessAlpha), thicknessEffect.setFloat2("size", this._particleSize, this._particleSize), this.useInstancing ? this._engine.drawArraysType(7, 0, 4, numParticles) : this._engine.drawElementsType(0, 0, numParticles), this._engine.setDepthWrite(!0), this._engine.setAlphaMode(0);}renderDiffuseTexture() {}dispose() {var _a, _b;null === (_a = this._depthEffectWrapper) || void 0 === _a ? void 0 : _a.dispose(), null === (_b = this._thicknessEffectWrapper) || void 0 === _b ? void 0 : _b.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js
class FluidRenderingObjectParticleSystem extends FluidRenderingObject {get particleSystem() {return this._particleSystem;}getClassName() {return "FluidRenderingObjectParticleSystem";}get useTrueRenderingForDiffuseTexture() {return this._useTrueRenderingForDiffuseTexture;}set useTrueRenderingForDiffuseTexture(use) {this._useTrueRenderingForDiffuseTexture === use || (this._useTrueRenderingForDiffuseTexture = use, use ? (this._particleSystem.blendMode = this._blendMode, this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver), this._onBeforeDrawParticleObserver = null) : (this._particleSystem.blendMode = -1, this._onBeforeDrawParticleObserver = this._particleSystem.onBeforeDrawParticlesObservable.add(() => {this._engine.setAlphaMode(2);})));}get vertexBuffers() {return this._particleSystem.vertexBuffers;}get indexBuffer() {return this._particleSystem.indexBuffer;}constructor(scene, ps) {super(scene), this._useTrueRenderingForDiffuseTexture = !0, this._particleSystem = ps, this._originalRender = ps.render.bind(ps), this._blendMode = ps.blendMode, this._onBeforeDrawParticleObserver = null, this._updateInAnimate = this._particleSystem.updateInAnimate, this._particleSystem.updateInAnimate = !0, this._particleSystem.render = () => 0, this.particleSize = (ps.minSize + ps.maxSize) / 2, this.useTrueRenderingForDiffuseTexture = !1;}isReady() {return super.isReady() && this._particleSystem.isReady();}get numParticles() {return this._particleSystem.getActiveCount();}renderDiffuseTexture() {this._originalRender();}dispose() {super.dispose(), this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver), this._onBeforeDrawParticleObserver = null, this._particleSystem.render = this._originalRender, this._particleSystem.blendMode = this._blendMode, this._particleSystem.updateInAnimate = this._updateInAnimate;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingTextures.js
class FluidRenderingTextures {get blurNumIterations() {return this._blurNumIterations;}set blurNumIterations(numIterations) {if (this._blurNumIterations !== numIterations && (this._blurNumIterations = numIterations, null !== this._blurPostProcesses)) {const blurX = this._blurPostProcesses[0],blurY = this._blurPostProcesses[1];this._blurPostProcesses = [];for (let i = 0; i < 2 * this._blurNumIterations; ++i) this._blurPostProcesses[i] = 1 & i ? blurY : blurX;}}get renderTarget() {return this._rt;}get renderTargetBlur() {return this._rtBlur;}get texture() {return this._texture;}get textureBlur() {return this._textureBlurred;}constructor(name, scene, width, height, blurTextureSizeX, blurTextureSizeY, textureType = 1, textureFormat = 6, blurTextureType = 1, blurTextureFormat = 6, useStandardBlur = !1, camera = null, generateDepthBuffer = !0, samples = 1) {this.enableBlur = !0, this.blurSizeDivisor = 1, this.blurFilterSize = 7, this._blurNumIterations = 3, this.blurMaxFilterSize = 100, this.blurDepthScale = 10, this.particleSize = .02, this.onDisposeObservable = new observable/* Observable */.y$(), this._name = name, this._scene = scene, this._camera = camera, this._engine = scene.getEngine(), this._width = width, this._height = height, this._blurTextureSizeX = blurTextureSizeX, this._blurTextureSizeY = blurTextureSizeY, this._textureType = textureType, this._textureFormat = textureFormat, this._blurTextureType = blurTextureType, this._blurTextureFormat = blurTextureFormat, this._useStandardBlur = useStandardBlur, this._generateDepthBuffer = generateDepthBuffer, this._samples = samples, this._postProcessRunningIndex = 0, this.enableBlur = 0 !== blurTextureSizeX && 0 !== blurTextureSizeY, this._rt = null, this._texture = null, this._rtBlur = null, this._textureBlurred = null, this._blurPostProcesses = null;}initialize() {if (this.dispose(), this._createRenderTarget(), this.enableBlur && this._texture) {const [rtBlur, textureBlurred, blurPostProcesses] = this._createBlurPostProcesses(this._texture, this._blurTextureType, this._blurTextureFormat, this.blurSizeDivisor, this._name, this._useStandardBlur);this._rtBlur = rtBlur, this._textureBlurred = textureBlurred, this._blurPostProcesses = blurPostProcesses;}}applyBlurPostProcesses() {this.enableBlur && this._blurPostProcesses && (this._postProcessRunningIndex = 0, this._scene.postProcessManager.directRender(this._blurPostProcesses, this._rtBlur, !0), this._engine.unBindFramebuffer(this._rtBlur));}_createRenderTarget() {this._rt = this._engine.createRenderTargetTexture({ width: this._width, height: this._height }, { generateMipMaps: !1, type: this._textureType, format: this._textureFormat, samplingMode: 1, generateDepthBuffer: this._generateDepthBuffer, generateStencilBuffer: !1, samples: this._samples });const renderTexture = this._rt.texture;renderTexture.incrementReferences(), this._texture = new Textures_texture/* Texture */.x(null, this._scene), this._texture.name = "rtt" + this._name, this._texture._texture = renderTexture, this._texture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._texture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._texture.anisotropicFilteringLevel = 1;}_createBlurPostProcesses(textureBlurSource, textureType, textureFormat, blurSizeDivisor, debugName, useStandardBlur = !1) {const engine = this._scene.getEngine(),targetSize = new math_vector/* Vector2 */.FM(Math.floor(this._blurTextureSizeX / blurSizeDivisor), Math.floor(this._blurTextureSizeY / blurSizeDivisor)),useBilinearFiltering = 1 === textureType && engine.getCaps().textureFloatLinearFiltering || 2 === textureType && engine.getCaps().textureHalfFloatLinearFiltering,rtBlur = this._engine.createRenderTargetTexture({ width: targetSize.x, height: targetSize.y }, { generateMipMaps: !1, type: textureType, format: textureFormat, samplingMode: useBilinearFiltering ? 2 : 1, generateDepthBuffer: !1, generateStencilBuffer: !1, samples: this._samples }),renderTexture = rtBlur.texture;renderTexture.incrementReferences();const texture = new Textures_texture/* Texture */.x(null, this._scene);if (texture.name = "rttBlurred" + debugName, texture._texture = renderTexture, texture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, texture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, texture.anisotropicFilteringLevel = 1, useStandardBlur) {const kernelBlurXPostprocess = new PostProcesses_postProcess/* PostProcess */.D("BilateralBlurX", "fluidRenderingStandardBlur", ["filterSize", "blurDir"], null, 1, null, 1, engine, !0, null, textureType, void 0, void 0, void 0, textureFormat);kernelBlurXPostprocess.samples = this._samples, kernelBlurXPostprocess.externalTextureSamplerBinding = !0, kernelBlurXPostprocess.onApplyObservable.add((effect) => {0 === this._postProcessRunningIndex ? effect.setTexture("textureSampler", textureBlurSource) : effect._bindTexture("textureSampler", kernelBlurXPostprocess.inputTexture.texture), effect.setInt("filterSize", this.blurFilterSize), effect.setFloat2("blurDir", 1 / this._blurTextureSizeX, 0), this._postProcessRunningIndex++;}), kernelBlurXPostprocess.onSizeChangedObservable.add(() => {kernelBlurXPostprocess._textures.forEach((rt) => {rt.texture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, rt.texture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE;});}), this._fixReusablePostProcess(kernelBlurXPostprocess);const kernelBlurYPostprocess = new PostProcesses_postProcess/* PostProcess */.D("BilateralBlurY", "fluidRenderingStandardBlur", ["filterSize", "blurDir"], null, 1, null, 1, engine, !0, null, textureType, void 0, void 0, void 0, textureFormat);kernelBlurYPostprocess.samples = this._samples, kernelBlurYPostprocess.onApplyObservable.add((effect) => {effect.setInt("filterSize", this.blurFilterSize), effect.setFloat2("blurDir", 0, 1 / this._blurTextureSizeY), this._postProcessRunningIndex++;}), kernelBlurYPostprocess.onSizeChangedObservable.add(() => {kernelBlurYPostprocess._textures.forEach((rt) => {rt.texture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, rt.texture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE;});}), this._fixReusablePostProcess(kernelBlurYPostprocess), kernelBlurXPostprocess.autoClear = !1, kernelBlurYPostprocess.autoClear = !1;const blurList = [];for (let i = 0; i < 2 * this._blurNumIterations; ++i) blurList[i] = 1 & i ? kernelBlurYPostprocess : kernelBlurXPostprocess;return [rtBlur, texture, blurList];} else {const uniforms = ["maxFilterSize", "blurDir", "projectedParticleConstant", "depthThreshold"],kernelBlurXPostprocess = new PostProcesses_postProcess/* PostProcess */.D("BilateralBlurX", "fluidRenderingBilateralBlur", uniforms, null, 1, null, 1, engine, !0, null, textureType, void 0, void 0, void 0, textureFormat);kernelBlurXPostprocess.samples = this._samples, kernelBlurXPostprocess.externalTextureSamplerBinding = !0, kernelBlurXPostprocess.onApplyObservable.add((effect) => {0 === this._postProcessRunningIndex ? effect.setTexture("textureSampler", textureBlurSource) : effect._bindTexture("textureSampler", kernelBlurXPostprocess.inputTexture.texture), effect.setInt("maxFilterSize", this.blurMaxFilterSize), effect.setFloat2("blurDir", 1 / this._blurTextureSizeX, 0), effect.setFloat("projectedParticleConstant", this._getProjectedParticleConstant()), effect.setFloat("depthThreshold", this._getDepthThreshold()), this._postProcessRunningIndex++;}), kernelBlurXPostprocess.onSizeChangedObservable.add(() => {kernelBlurXPostprocess._textures.forEach((rt) => {rt.texture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, rt.texture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE;});}), this._fixReusablePostProcess(kernelBlurXPostprocess);const kernelBlurYPostprocess = new PostProcesses_postProcess/* PostProcess */.D("BilateralBlurY", "fluidRenderingBilateralBlur", uniforms, null, 1, null, 1, engine, !0, null, textureType, void 0, void 0, void 0, textureFormat);kernelBlurYPostprocess.samples = this._samples, kernelBlurYPostprocess.onApplyObservable.add((effect) => {effect.setInt("maxFilterSize", this.blurMaxFilterSize), effect.setFloat2("blurDir", 0, 1 / this._blurTextureSizeY), effect.setFloat("projectedParticleConstant", this._getProjectedParticleConstant()), effect.setFloat("depthThreshold", this._getDepthThreshold()), this._postProcessRunningIndex++;}), kernelBlurYPostprocess.onSizeChangedObservable.add(() => {kernelBlurYPostprocess._textures.forEach((rt) => {rt.texture.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, rt.texture.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE;});}), this._fixReusablePostProcess(kernelBlurYPostprocess), kernelBlurXPostprocess.autoClear = !1, kernelBlurYPostprocess.autoClear = !1;const blurList = [];for (let i = 0; i < 2 * this._blurNumIterations; ++i) blurList[i] = 1 & i ? kernelBlurYPostprocess : kernelBlurXPostprocess;return [rtBlur, texture, blurList];}}_fixReusablePostProcess(pp) {pp.isReusable() && (pp.onActivateObservable.add(() => {pp._currentRenderTextureInd = (pp._currentRenderTextureInd + 1) % 2;}), pp.onApplyObservable.add(() => {pp._currentRenderTextureInd = (pp._currentRenderTextureInd + 1) % 2;}));}_getProjectedParticleConstant() {var _a, _b;return .05 * (this.blurFilterSize * this.particleSize) * (this._height / 2) / Math.tan((null !== (_b = null === (_a = this._camera) || void 0 === _a ? void 0 : _a.fov) && void 0 !== _b ? _b : 45 * Math.PI / 180) / 2);}_getDepthThreshold() {return this.particleSize / 2 * this.blurDepthScale;}dispose() {var _a, _b, _c, _d;this.onDisposeObservable.hasObservers() && this.onDisposeObservable.notifyObservers(this), null === (_a = this._rt) || void 0 === _a ? void 0 : _a.dispose(), this._rt = null, null === (_b = this._texture) || void 0 === _b ? void 0 : _b.dispose(), this._texture = null, null === (_c = this._rtBlur) || void 0 === _c ? void 0 : _c.dispose(), this._rtBlur = null, null === (_d = this._textureBlurred) || void 0 === _d ? void 0 : _d.dispose(), this._textureBlurred = null, this._blurPostProcesses && (this._blurPostProcesses[0].dispose(), this._blurPostProcesses[1].dispose()), this._blurPostProcesses = null;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js
var FluidRenderingDebug;(function (FluidRenderingDebug) {FluidRenderingDebug[FluidRenderingDebug.DepthTexture = 0] = "DepthTexture", FluidRenderingDebug[FluidRenderingDebug.DepthBlurredTexture = 1] = "DepthBlurredTexture", FluidRenderingDebug[FluidRenderingDebug.ThicknessTexture = 2] = "ThicknessTexture", FluidRenderingDebug[FluidRenderingDebug.ThicknessBlurredTexture = 3] = "ThicknessBlurredTexture", FluidRenderingDebug[FluidRenderingDebug.DiffuseTexture = 4] = "DiffuseTexture", FluidRenderingDebug[FluidRenderingDebug.Normals = 5] = "Normals", FluidRenderingDebug[FluidRenderingDebug.DiffuseRendering = 6] = "DiffuseRendering";})(FluidRenderingDebug || (FluidRenderingDebug = {}));class FluidRenderingTargetRenderer {get needInitialization() {return this._needInitialization;}get generateDiffuseTexture() {return this._generateDiffuseTexture;}set generateDiffuseTexture(generate) {this._generateDiffuseTexture === generate || (this._generateDiffuseTexture = generate, this._needInitialization = !0);}get debugFeature() {return this._debugFeature;}set debugFeature(feature) {this._debugFeature === feature || (this._needInitialization = !0, this._debugFeature = feature);}get debug() {return this._debug;}set debug(debug) {this._debug === debug || (this._debug = debug, this._needInitialization = !0);}get environmentMap() {return this._environmentMap;}set environmentMap(map) {this._environmentMap === map || (this._needInitialization = !0, this._environmentMap = map);}get enableBlurDepth() {return this._enableBlurDepth;}set enableBlurDepth(enable) {this._enableBlurDepth === enable || (this._enableBlurDepth = enable, this._needInitialization = !0);}get blurDepthSizeDivisor() {return this._blurDepthSizeDivisor;}set blurDepthSizeDivisor(scale) {this._blurDepthSizeDivisor === scale || (this._blurDepthSizeDivisor = scale, this._needInitialization = !0);}get blurDepthFilterSize() {return this._blurDepthFilterSize;}set blurDepthFilterSize(filterSize) {this._blurDepthFilterSize === filterSize || (this._blurDepthFilterSize = filterSize, this._setBlurParameters());}get blurDepthNumIterations() {return this._blurDepthNumIterations;}set blurDepthNumIterations(numIterations) {this._blurDepthNumIterations === numIterations || (this._blurDepthNumIterations = numIterations, this._setBlurParameters());}get blurDepthMaxFilterSize() {return this._blurDepthMaxFilterSize;}set blurDepthMaxFilterSize(maxFilterSize) {this._blurDepthMaxFilterSize === maxFilterSize || (this._blurDepthMaxFilterSize = maxFilterSize, this._setBlurParameters());}get blurDepthDepthScale() {return this._blurDepthDepthScale;}set blurDepthDepthScale(scale) {this._blurDepthDepthScale === scale || (this._blurDepthDepthScale = scale, this._setBlurParameters());}get enableBlurThickness() {return this._enableBlurThickness;}set enableBlurThickness(enable) {this._enableBlurThickness === enable || (this._enableBlurThickness = enable, this._needInitialization = !0);}get blurThicknessSizeDivisor() {return this._blurThicknessSizeDivisor;}set blurThicknessSizeDivisor(scale) {this._blurThicknessSizeDivisor === scale || (this._blurThicknessSizeDivisor = scale, this._needInitialization = !0);}get blurThicknessFilterSize() {return this._blurThicknessFilterSize;}set blurThicknessFilterSize(filterSize) {this._blurThicknessFilterSize === filterSize || (this._blurThicknessFilterSize = filterSize, this._setBlurParameters());}get blurThicknessNumIterations() {return this._blurThicknessNumIterations;}set blurThicknessNumIterations(numIterations) {this._blurThicknessNumIterations === numIterations || (this._blurThicknessNumIterations = numIterations, this._setBlurParameters());}get useFixedThickness() {return this._useFixedThickness;}set useFixedThickness(use) {this._useFixedThickness === use || (this._useFixedThickness = use, this._needInitialization = !0);}get useVelocity() {return this._useVelocity;}set useVelocity(use) {this._useVelocity === use || (this._useVelocity = use, this._needInitialization = !0, this._onUseVelocityChanged.notifyObservers(this));}get depthMapSize() {return this._depthMapSize;}set depthMapSize(size) {this._depthMapSize === size || (this._depthMapSize = size, this._needInitialization = !0);}get thicknessMapSize() {return this._thicknessMapSize;}set thicknessMapSize(size) {this._thicknessMapSize === size || (this._thicknessMapSize = size, this._needInitialization = !0);}get diffuseMapSize() {return this._diffuseMapSize;}set diffuseMapSize(size) {this._diffuseMapSize === size || (this._diffuseMapSize = size, this._needInitialization = !0);}get samples() {return this._samples;}set samples(samples) {this._samples === samples || (this._samples = samples, this._needInitialization = !0);}get camera() {return this._camera;}constructor(scene, camera) {this._generateDiffuseTexture = !1, this.fluidColor = new math_color/* Color3 */.Wo(.085, .6375, .765), this.density = 2, this.refractionStrength = .1, this.fresnelClamp = 1, this.specularPower = 250, this.minimumThickness = 0, this.dirLight = new math_vector/* Vector3 */.P(-2, -1, 1).normalize(), this._debugFeature = FluidRenderingDebug.DepthBlurredTexture, this._debug = !1, this._enableBlurDepth = !0, this._blurDepthSizeDivisor = 1, this._blurDepthFilterSize = 7, this._blurDepthNumIterations = 3, this._blurDepthMaxFilterSize = 100, this._blurDepthDepthScale = 10, this._enableBlurThickness = !0, this._blurThicknessSizeDivisor = 1, this._blurThicknessFilterSize = 5, this._blurThicknessNumIterations = 1, this._useFixedThickness = !1, this._onUseVelocityChanged = new observable/* Observable */.y$(), this._useVelocity = !1, this._depthMapSize = null, this._thicknessMapSize = null, this._diffuseMapSize = null, this._samples = 1, this._scene = scene, this._engine = scene.getEngine(), this._camera = null !== camera && void 0 !== camera ? camera : scene.activeCamera, this._needInitialization = !0, this._bgDepthTexture = null, this._invProjectionMatrix = new math_vector/* Matrix */.y3(), this._depthClearColor = new math_color/* Color4 */.HE(1e6, 1e6, 1e6, 1), this._thicknessClearColor = new math_color/* Color4 */.HE(0, 0, 0, 1), this._depthRenderTarget = null, this._diffuseRenderTarget = null, this._thicknessRenderTarget = null, this._renderPostProcess = null;}_initialize() {var _a, _b, _c;this.dispose(), this._needInitialization = !1;const depthWidth = null !== (_a = this._depthMapSize) && void 0 !== _a ? _a : this._engine.getRenderWidth(),depthHeight = null === this._depthMapSize ? this._engine.getRenderHeight() : Math.round(this._depthMapSize * this._engine.getRenderHeight() / this._engine.getRenderWidth());if (this._depthRenderTarget = new FluidRenderingTextures("Depth", this._scene, depthWidth, depthHeight, depthWidth, depthHeight, 1, 7, 1, 7, !1, this._camera, !0, this._samples), this._initializeRenderTarget(this._depthRenderTarget), this.generateDiffuseTexture) {const diffuseWidth = null !== (_b = this._diffuseMapSize) && void 0 !== _b ? _b : this._engine.getRenderWidth(),diffuseHeight = null === this._diffuseMapSize ? this._engine.getRenderHeight() : Math.round(this._diffuseMapSize * this._engine.getRenderHeight() / this._engine.getRenderWidth());this._diffuseRenderTarget = new FluidRenderingTextures("Diffuse", this._scene, diffuseWidth, diffuseHeight, 0, 0, 0, 5, 0, 5, !0, this._camera, !0, this._samples), this._initializeRenderTarget(this._diffuseRenderTarget);}const thicknessWidth = null !== (_c = this._thicknessMapSize) && void 0 !== _c ? _c : this._engine.getRenderWidth(),thicknessHeight = null === this._thicknessMapSize ? this._engine.getRenderHeight() : Math.round(this._thicknessMapSize * this._engine.getRenderHeight() / this._engine.getRenderWidth());this._useFixedThickness || (this._thicknessRenderTarget = new FluidRenderingTextures("Thickness", this._scene, thicknessWidth, thicknessHeight, thicknessWidth, thicknessHeight, 2, 6, 2, 6, !0, this._camera, !1, this._samples), this._initializeRenderTarget(this._thicknessRenderTarget)), this._createLiquidRenderingPostProcess();}_setBlurParameters(renderTarget = null) {(null === renderTarget || renderTarget === this._depthRenderTarget) && this._setBlurDepthParameters(), (null === renderTarget || renderTarget === this._thicknessRenderTarget) && this._setBlurThicknessParameters();}_setBlurDepthParameters() {this._depthRenderTarget && (this._depthRenderTarget.blurFilterSize = this.blurDepthFilterSize, this._depthRenderTarget.blurMaxFilterSize = this.blurDepthMaxFilterSize, this._depthRenderTarget.blurNumIterations = this.blurDepthNumIterations, this._depthRenderTarget.blurDepthScale = this.blurDepthDepthScale);}_setBlurThicknessParameters() {this._thicknessRenderTarget && (this._thicknessRenderTarget.blurFilterSize = this.blurThicknessFilterSize, this._thicknessRenderTarget.blurNumIterations = this.blurThicknessNumIterations);}_initializeRenderTarget(renderTarget) {renderTarget !== this._diffuseRenderTarget && (renderTarget.enableBlur = renderTarget === this._depthRenderTarget ? this.enableBlurDepth : this.enableBlurThickness, renderTarget.blurSizeDivisor = renderTarget === this._depthRenderTarget ? this.blurDepthSizeDivisor : this.blurThicknessSizeDivisor), this._setBlurParameters(renderTarget), renderTarget.initialize();}_createLiquidRenderingPostProcess() {var _a;const engine = this._scene.getEngine(),uniformNames = ["viewMatrix", "projectionMatrix", "invProjectionMatrix", "texelSize", "dirLight", "cameraFar", "density", "refractionStrength", "fresnelClamp", "specularPower"],samplerNames = ["depthSampler"],defines = [];if (this.dispose(!0), !this._camera) return;const texture = this._depthRenderTarget.enableBlur ? this._depthRenderTarget.textureBlur : this._depthRenderTarget.texture,texelSize = new math_vector/* Vector2 */.FM(1 / texture.getSize().width, 1 / texture.getSize().height);if (this._scene.useRightHandedSystem && defines.push("#define FLUIDRENDERING_RHS"), null !== this._environmentMap) {const envMap = null !== (_a = this._environmentMap) && void 0 !== _a ? _a : this._scene.environmentTexture;envMap && (samplerNames.push("reflectionSampler"), defines.push("#define FLUIDRENDERING_ENVIRONMENT"));}this._diffuseRenderTarget ? (samplerNames.push("diffuseSampler"), defines.push("#define FLUIDRENDERING_DIFFUSETEXTURE")) : uniformNames.push("diffuseColor"), this._useVelocity && (samplerNames.push("velocitySampler"), defines.push("#define FLUIDRENDERING_VELOCITY")), this._useFixedThickness ? (uniformNames.push("thickness"), samplerNames.push("bgDepthSampler"), defines.push("#define FLUIDRENDERING_FIXED_THICKNESS")) : (uniformNames.push("minimumThickness"), samplerNames.push("thicknessSampler")), this._debug && (defines.push("#define FLUIDRENDERING_DEBUG"), this._debugFeature === FluidRenderingDebug.Normals ? defines.push("#define FLUIDRENDERING_DEBUG_SHOWNORMAL") : this._debugFeature === FluidRenderingDebug.DiffuseRendering ? defines.push("#define FLUIDRENDERING_DEBUG_DIFFUSERENDERING") : (defines.push("#define FLUIDRENDERING_DEBUG_TEXTURE"), samplerNames.push("debugSampler"), (this._debugFeature === FluidRenderingDebug.DepthTexture || this._debugFeature === FluidRenderingDebug.DepthBlurredTexture) && defines.push("#define FLUIDRENDERING_DEBUG_DEPTH"))), this._renderPostProcess = new PostProcesses_postProcess/* PostProcess */.D("FluidRendering", "fluidRenderingRender", uniformNames, samplerNames, 1, null, 2, engine, !1, null, 0, void 0, void 0, !0, void 0), this._renderPostProcess.updateEffect(defines.join("\n")), this._renderPostProcess.samples = this._samples, this._renderPostProcess.onApplyObservable.add((effect) => {var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;if (this._invProjectionMatrix.copyFrom(this._scene.getProjectionMatrix()), this._invProjectionMatrix.invert(), engine.isWebGPU && effect.setTextureSampler("textureSamplerSampler", this._renderPostProcess.inputTexture.texture), this._depthRenderTarget.enableBlur ? (effect.setTexture("depthSampler", this._depthRenderTarget.textureBlur), engine.isWebGPU && effect.setTextureSampler("depthSamplerSampler", null !== (_d = null === (_c = this._depthRenderTarget.textureBlur) || void 0 === _c ? void 0 : _c.getInternalTexture()) && void 0 !== _d ? _d : null)) : (effect.setTexture("depthSampler", this._depthRenderTarget.texture), engine.isWebGPU && effect.setTextureSampler("depthSamplerSampler", null !== (_b = null === (_a = this._depthRenderTarget.texture) || void 0 === _a ? void 0 : _a.getInternalTexture()) && void 0 !== _b ? _b : null)), this._diffuseRenderTarget ? this._diffuseRenderTarget.enableBlur ? (effect.setTexture("diffuseSampler", this._diffuseRenderTarget.textureBlur), engine.isWebGPU && effect.setTextureSampler("diffuseSamplerSampler", null !== (_h = null === (_g = this._diffuseRenderTarget.textureBlur) || void 0 === _g ? void 0 : _g.getInternalTexture()) && void 0 !== _h ? _h : null)) : (effect.setTexture("diffuseSampler", this._diffuseRenderTarget.texture), engine.isWebGPU && effect.setTextureSampler("diffuseSamplerSampler", null !== (_f = null === (_e = this._diffuseRenderTarget.texture) || void 0 === _e ? void 0 : _e.getInternalTexture()) && void 0 !== _f ? _f : null)) : effect.setColor3("diffuseColor", this.fluidColor), this._useFixedThickness ? (effect.setFloat("thickness", this.minimumThickness), effect._bindTexture("bgDepthSampler", this._bgDepthTexture), engine.isWebGPU && effect.setTextureSampler("bgDepthSamplerSampler", null !== (_j = this._bgDepthTexture) && void 0 !== _j ? _j : null)) : (this._thicknessRenderTarget.enableBlur ? (effect.setTexture("thicknessSampler", this._thicknessRenderTarget.textureBlur), engine.isWebGPU && effect.setTextureSampler("thicknessSamplerSampler", null !== (_o = null === (_m = this._thicknessRenderTarget.textureBlur) || void 0 === _m ? void 0 : _m.getInternalTexture()) && void 0 !== _o ? _o : null)) : (effect.setTexture("thicknessSampler", this._thicknessRenderTarget.texture), engine.isWebGPU && effect.setTextureSampler("thicknessSamplerSampler", null !== (_l = null === (_k = this._thicknessRenderTarget.texture) || void 0 === _k ? void 0 : _k.getInternalTexture()) && void 0 !== _l ? _l : null)), effect.setFloat("minimumThickness", this.minimumThickness)), null !== this._environmentMap) {const envMap = null !== (_p = this._environmentMap) && void 0 !== _p ? _p : this._scene.environmentTexture;envMap && (effect.setTexture("reflectionSampler", envMap), engine.isWebGPU && effect.setTextureSampler("reflectionSamplerSampler", null !== (_q = null === envMap || void 0 === envMap ? void 0 : envMap.getInternalTexture()) && void 0 !== _q ? _q : null));}if (effect.setMatrix("viewMatrix", this._scene.getViewMatrix()), effect.setMatrix("invProjectionMatrix", this._invProjectionMatrix), effect.setMatrix("projectionMatrix", this._scene.getProjectionMatrix()), effect.setVector2("texelSize", texelSize), effect.setFloat("density", this.density), effect.setFloat("refractionStrength", this.refractionStrength), effect.setFloat("fresnelClamp", this.fresnelClamp), effect.setFloat("specularPower", this.specularPower), effect.setVector3("dirLight", this.dirLight), effect.setFloat("cameraFar", this._camera.maxZ), this._debug) {let texture = null;switch (this._debugFeature) {case FluidRenderingDebug.DepthTexture:texture = this._depthRenderTarget.texture;break;case FluidRenderingDebug.DepthBlurredTexture:texture = this._depthRenderTarget.enableBlur ? this._depthRenderTarget.textureBlur : this._depthRenderTarget.texture;break;case FluidRenderingDebug.ThicknessTexture:texture = null !== (_s = null === (_r = this._thicknessRenderTarget) || void 0 === _r ? void 0 : _r.texture) && void 0 !== _s ? _s : null;break;case FluidRenderingDebug.ThicknessBlurredTexture:texture = (null === (_t = this._thicknessRenderTarget) || void 0 === _t ? void 0 : _t.enableBlur) ? null !== (_v = null === (_u = this._thicknessRenderTarget) || void 0 === _u ? void 0 : _u.textureBlur) && void 0 !== _v ? _v : null : null !== (_x = null === (_w = this._thicknessRenderTarget) || void 0 === _w ? void 0 : _w.texture) && void 0 !== _x ? _x : null;break;case FluidRenderingDebug.DiffuseTexture:this._diffuseRenderTarget && (texture = this._diffuseRenderTarget.texture);}this._debugFeature !== FluidRenderingDebug.Normals && (effect.setTexture("debugSampler", texture), engine.isWebGPU && effect.setTextureSampler("debugSamplerSampler", null !== (_y = null === texture || void 0 === texture ? void 0 : texture.getInternalTexture()) && void 0 !== _y ? _y : null));}});}_clearTargets() {var _a, _b, _c;(null === (_a = this._depthRenderTarget) || void 0 === _a ? void 0 : _a.renderTarget) && (this._engine.bindFramebuffer(this._depthRenderTarget.renderTarget), this._engine.clear(this._depthClearColor, !0, !0, !1), this._engine.unBindFramebuffer(this._depthRenderTarget.renderTarget)), (null === (_b = this._diffuseRenderTarget) || void 0 === _b ? void 0 : _b.renderTarget) && (this._engine.bindFramebuffer(this._diffuseRenderTarget.renderTarget), this._engine.clear(this._thicknessClearColor, !0, !0, !1), this._engine.unBindFramebuffer(this._diffuseRenderTarget.renderTarget)), (null === (_c = this._thicknessRenderTarget) || void 0 === _c ? void 0 : _c.renderTarget) && (this._engine.bindFramebuffer(this._thicknessRenderTarget.renderTarget), this._engine.clear(this._thicknessClearColor, !0, !1, !1), this._engine.unBindFramebuffer(this._thicknessRenderTarget.renderTarget));}_render(fluidObject) {var _a, _b, _c, _d, _e, _f;if (!this._needInitialization && fluidObject.isReady()) {const currentRenderTarget = this._engine._currentRenderTarget;this._engine.setState(!1, void 0, void 0, void 0, !0), this._engine.setDepthBuffer(!0), this._engine.setDepthWrite(!0), this._engine.setAlphaMode(0), (null === (_a = this._depthRenderTarget) || void 0 === _a ? void 0 : _a.renderTarget) && (this._engine.bindFramebuffer(this._depthRenderTarget.renderTarget), fluidObject.renderDepthTexture(), this._engine.unbindInstanceAttributes(), this._engine.unBindFramebuffer(this._depthRenderTarget.renderTarget)), (null === (_b = this._diffuseRenderTarget) || void 0 === _b ? void 0 : _b.renderTarget) && (this._engine.bindFramebuffer(this._diffuseRenderTarget.renderTarget), fluidObject.renderDiffuseTexture(), this._engine.unbindInstanceAttributes(), this._engine.unBindFramebuffer(this._diffuseRenderTarget.renderTarget)), (null === (_c = this._thicknessRenderTarget) || void 0 === _c ? void 0 : _c.renderTarget) && (this._engine.bindFramebuffer(this._thicknessRenderTarget.renderTarget), fluidObject.renderThicknessTexture(), this._engine.unbindInstanceAttributes(), this._engine.unBindFramebuffer(this._thicknessRenderTarget.renderTarget)), null === (_d = this._depthRenderTarget) || void 0 === _d ? void 0 : _d.applyBlurPostProcesses(), null === (_e = this._diffuseRenderTarget) || void 0 === _e ? void 0 : _e.applyBlurPostProcesses(), null === (_f = this._thicknessRenderTarget) || void 0 === _f ? void 0 : _f.applyBlurPostProcesses(), currentRenderTarget && this._engine.bindFramebuffer(currentRenderTarget);}}dispose(onlyPostProcesses = !1) {var _a, _b, _c, _d;onlyPostProcesses || (null === (_a = this._depthRenderTarget) || void 0 === _a ? void 0 : _a.dispose(), this._depthRenderTarget = null, null === (_b = this._diffuseRenderTarget) || void 0 === _b ? void 0 : _b.dispose(), this._diffuseRenderTarget = null, null === (_c = this._thicknessRenderTarget) || void 0 === _c ? void 0 : _c.dispose(), this._thicknessRenderTarget = null), this._renderPostProcess && this._camera && this._camera.detachPostProcess(this._renderPostProcess), null === (_d = this._renderPostProcess) || void 0 === _d ? void 0 : _d.dispose(), this._renderPostProcess = null, this._needInitialization = !1;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js
class FluidRenderingObjectCustomParticles extends FluidRenderingObject {getClassName() {return "FluidRenderingObjectCustomParticles";}get vertexBuffers() {return this._vertexBuffers;}constructor(scene, buffers, numParticles) {super(scene), this._numParticles = numParticles, this._diffuseEffectWrapper = null, this._vertexBuffers = {}, this.addBuffers(buffers);}addBuffers(buffers) {for (const name in buffers) {let stride,instanced = !0;"velocity" == name ? stride = 3 : "offset" === name ? instanced = !1 : void 0;this._vertexBuffers[name] = new Buffers_buffer/* VertexBuffer */.o(this._engine, buffers[name], name, !0, !1, stride, instanced);}}_createEffects() {super._createEffects();this._diffuseEffectWrapper = new effectRenderer/* EffectWrapper */.H({ engine: this._engine, useShaderStore: !0, vertexShader: "fluidRenderingParticleDiffuse", fragmentShader: "fluidRenderingParticleDiffuse", attributeNames: ["position", "offset", "color"], uniformNames: ["view", "projection", "size"], samplerNames: [] });}isReady() {var _a, _b;return this._vertexBuffers.offset || (this._vertexBuffers.offset = new Buffers_buffer/* VertexBuffer */.o(this._engine, [0, 0, 1, 0, 0, 1, 1, 1], "offset", !1, !1, 2)), super.isReady() && null !== (_b = null === (_a = this._diffuseEffectWrapper) || void 0 === _a ? void 0 : _a.effect.isReady()) && void 0 !== _b && _b;}get numParticles() {return this._numParticles;}setNumParticles(num) {this._numParticles = num;}renderDiffuseTexture() {const numParticles = this.numParticles;if (!this._diffuseEffectWrapper || 0 === numParticles) return;const diffuseDrawWrapper = this._diffuseEffectWrapper._drawWrapper,diffuseEffect = diffuseDrawWrapper.effect;this._engine.enableEffect(diffuseDrawWrapper), this._engine.bindBuffers(this.vertexBuffers, this.indexBuffer, diffuseEffect), diffuseEffect.setMatrix("view", this._scene.getViewMatrix()), diffuseEffect.setMatrix("projection", this._scene.getProjectionMatrix()), null !== this._particleSize && diffuseEffect.setFloat2("size", this._particleSize, this._particleSize), this.useInstancing ? this._engine.drawArraysType(7, 0, 4, numParticles) : this._engine.drawElementsType(0, 0, numParticles);}dispose() {var _a;for (const name in super.dispose(), null === (_a = this._diffuseEffectWrapper) || void 0 === _a ? void 0 : _a.dispose(), this._vertexBuffers) this._vertexBuffers[name].dispose();this._vertexBuffers = {};}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/copyTextureToTexture.fragment.js
const copyTextureToTexture_fragment_name = "copyTextureToTexturePixelShader",copyTextureToTexture_fragment_shader = `uniform float conversion;
uniform sampler2D textureSampler;
varying vec2 vUV;
#include<helperFunctions>
void main(void) 
{
vec4 color=texture2D(textureSampler,vUV);
#ifdef DEPTH_TEXTURE
gl_FragDepth=color.r;
#else
if (conversion==1.) {
color=toLinearSpace(color);
} else if (conversion==2.) {
color=toGammaSpace(color);
}
gl_FragColor=color;
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.copyTextureToTexturePixelShader */.v.ShadersStore.copyTextureToTexturePixelShader = copyTextureToTexture_fragment_shader;const copyTextureToTexturePixelShader = { name: "copyTextureToTexturePixelShader", shader: copyTextureToTexture_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/copyTextureToTexture.js
var ConversionMode;(function (ConversionMode) {ConversionMode[ConversionMode.None = 0] = "None", ConversionMode[ConversionMode.ToLinearSpace = 1] = "ToLinearSpace", ConversionMode[ConversionMode.ToGammaSpace = 2] = "ToGammaSpace";})(ConversionMode || (ConversionMode = {}));class CopyTextureToTexture {_textureIsInternal(texture) {return texture.getInternalTexture === void 0;}constructor(engine, isDepthTexture = !1) {this._engine = engine, this._isDepthTexture = isDepthTexture, this._renderer = new effectRenderer/* EffectRenderer */.I(engine), this._effectWrapper = new effectRenderer/* EffectWrapper */.H({ engine: engine, name: "CopyTextureToTexture", fragmentShader: "copyTextureToTexture", useShaderStore: !0, uniformNames: ["conversion"], samplerNames: ["textureSampler"], defines: isDepthTexture ? ["#define DEPTH_TEXTURE"] : [] }), this._effectWrapper.onApplyObservable.add(() => {isDepthTexture && (engine.setState(!1), engine.setDepthBuffer(!0), engine.depthCullingState.depthMask = !0, engine.depthCullingState.depthFunc = 519), this._textureIsInternal(this._source) ? this._effectWrapper.effect._bindTexture("textureSampler", this._source) : this._effectWrapper.effect.setTexture("textureSampler", this._source), this._effectWrapper.effect.setFloat("conversion", this._conversion);});}isReady() {return this._effectWrapper.effect.isReady();}copy(source, destination, conversion = ConversionMode.None) {if (!this.isReady()) return !1;this._source = source, this._conversion = conversion;const engineDepthFunc = this._engine.depthCullingState.depthFunc;return this._renderer.render(this._effectWrapper, destination), this._isDepthTexture && engineDepthFunc && (this._engine.depthCullingState.depthFunc = engineDepthFunc), !0;}dispose() {this._effectWrapper.dispose(), this._renderer.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js
class FluidRenderingDepthTextureCopy {get depthRTWrapper() {return this._depthRTWrapper;}constructor(engine, width, height, samples = 1) {this._engine = engine, this._copyTextureToTexture = new CopyTextureToTexture(engine, !0), this._depthRTWrapper = this._engine.createRenderTargetTexture({ width, height }, { generateMipMaps: !1, type: 0, format: 6, samplingMode: 1, generateDepthBuffer: !0, generateStencilBuffer: !1, samples, noColorAttachment: !0 }), this._depthRTWrapper.createDepthStencilTexture(0, !1, !1, 1);}copy(source) {return this._copyTextureToTexture.copy(source, this._depthRTWrapper);}dispose() {this._depthRTWrapper.dispose(), this._copyTextureToTexture.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDepth.vertex.js
const fluidRenderingParticleDepth_vertex_name = "fluidRenderingParticleDepthVertexShader",fluidRenderingParticleDepth_vertex_shader = `attribute vec3 position;
attribute vec2 offset;
uniform mat4 view;
uniform mat4 projection;
uniform vec2 size;
varying vec2 uv;
varying vec3 viewPos;
varying float sphereRadius;
#ifdef FLUIDRENDERING_VELOCITY
attribute vec3 velocity;
varying float velocityNorm;
#endif
void main(void) {
vec3 cornerPos;
cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;
cornerPos.z=0.0;
viewPos=(view*vec4(position,1.0)).xyz;
gl_Position=projection*vec4(viewPos+cornerPos,1.0);
uv=offset;
sphereRadius=size.x/2.0;
#ifdef FLUIDRENDERING_VELOCITY
velocityNorm=length(velocity);
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.fluidRenderingParticleDepthVertexShader */.v.ShadersStore.fluidRenderingParticleDepthVertexShader = fluidRenderingParticleDepth_vertex_shader;const fluidRenderingParticleDepthVertexShader = { name: "fluidRenderingParticleDepthVertexShader", shader: fluidRenderingParticleDepth_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDepth.fragment.js
const fluidRenderingParticleDepth_fragment_name = "fluidRenderingParticleDepthPixelShader",fluidRenderingParticleDepth_fragment_shader = `uniform mat4 projection;
varying vec2 uv;
varying vec3 viewPos;
varying float sphereRadius;
#ifdef FLUIDRENDERING_VELOCITY
varying float velocityNorm;
#endif
void main(void) {
vec3 normal;
normal.xy=uv*2.0-1.0;
float r2=dot(normal.xy,normal.xy);
if (r2>1.0) discard;
normal.z=sqrt(1.0-r2);
#ifndef FLUIDRENDERING_RHS
normal.z=-normal.z;
#endif
vec4 realViewPos=vec4(viewPos+normal*sphereRadius,1.0);
vec4 clipSpacePos=projection*realViewPos;
#ifdef WEBGPU
gl_FragDepth=clipSpacePos.z/clipSpacePos.w;
#else
gl_FragDepth=(clipSpacePos.z/clipSpacePos.w)*0.5+0.5;
#endif
#ifdef FLUIDRENDERING_RHS
realViewPos.z=-realViewPos.z;
#endif
#ifdef FLUIDRENDERING_VELOCITY
glFragColor=vec4(realViewPos.z,velocityNorm,0.,1.);
#else
glFragColor=vec4(realViewPos.z,0.,0.,1.);
#endif
}
`;shaderStore/* ShaderStore.ShadersStore.fluidRenderingParticleDepthPixelShader */.v.ShadersStore.fluidRenderingParticleDepthPixelShader = fluidRenderingParticleDepth_fragment_shader;const fluidRenderingParticleDepthPixelShader = { name: "fluidRenderingParticleDepthPixelShader", shader: fluidRenderingParticleDepth_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleThickness.vertex.js
const fluidRenderingParticleThickness_vertex_name = "fluidRenderingParticleThicknessVertexShader",fluidRenderingParticleThickness_vertex_shader = `attribute vec3 position;
attribute vec2 offset;
uniform mat4 view;
uniform mat4 projection;
uniform vec2 size;
varying vec2 uv;
void main(void) {
vec3 cornerPos;
cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;
cornerPos.z=0.0;
vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;
gl_Position=projection*vec4(viewPos,1.0);
uv=offset;
}
`;shaderStore/* ShaderStore.ShadersStore.fluidRenderingParticleThicknessVertexShader */.v.ShadersStore.fluidRenderingParticleThicknessVertexShader = fluidRenderingParticleThickness_vertex_shader;const fluidRenderingParticleThicknessVertexShader = { name: "fluidRenderingParticleThicknessVertexShader", shader: fluidRenderingParticleThickness_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleThickness.fragment.js
const fluidRenderingParticleThickness_fragment_name = "fluidRenderingParticleThicknessPixelShader",fluidRenderingParticleThickness_fragment_shader = `uniform float particleAlpha;
varying vec2 uv;
void main(void) {
vec3 normal;
normal.xy=uv*2.0-1.0;
float r2=dot(normal.xy,normal.xy);
if (r2>1.0) discard;
float thickness=sqrt(1.0-r2);
glFragColor=vec4(vec3(particleAlpha*thickness),1.0);
}
`;shaderStore/* ShaderStore.ShadersStore.fluidRenderingParticleThicknessPixelShader */.v.ShadersStore.fluidRenderingParticleThicknessPixelShader = fluidRenderingParticleThickness_fragment_shader;const fluidRenderingParticleThicknessPixelShader = { name: "fluidRenderingParticleThicknessPixelShader", shader: fluidRenderingParticleThickness_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDiffuse.vertex.js
const fluidRenderingParticleDiffuse_vertex_name = "fluidRenderingParticleDiffuseVertexShader",fluidRenderingParticleDiffuse_vertex_shader = `attribute vec3 position;
attribute vec2 offset;
attribute vec4 color;
uniform mat4 view;
uniform mat4 projection;
uniform vec2 size;
varying vec2 uv;
varying vec3 diffuseColor;
void main(void) {
vec3 cornerPos;
cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;
cornerPos.z=0.0;
vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;
gl_Position=projection*vec4(viewPos,1.0);
uv=offset;
diffuseColor=color.rgb;
}
`;shaderStore/* ShaderStore.ShadersStore.fluidRenderingParticleDiffuseVertexShader */.v.ShadersStore.fluidRenderingParticleDiffuseVertexShader = fluidRenderingParticleDiffuse_vertex_shader;const fluidRenderingParticleDiffuseVertexShader = { name: "fluidRenderingParticleDiffuseVertexShader", shader: fluidRenderingParticleDiffuse_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDiffuse.fragment.js
const fluidRenderingParticleDiffuse_fragment_name = "fluidRenderingParticleDiffusePixelShader",fluidRenderingParticleDiffuse_fragment_shader = `uniform float particleAlpha;
varying vec2 uv;
varying vec3 diffuseColor;
void main(void) {
vec3 normal;
normal.xy=uv*2.0-1.0;
float r2=dot(normal.xy,normal.xy);
if (r2>1.0) discard;
glFragColor=vec4(diffuseColor,1.0);
}
`;shaderStore/* ShaderStore.ShadersStore.fluidRenderingParticleDiffusePixelShader */.v.ShadersStore.fluidRenderingParticleDiffusePixelShader = fluidRenderingParticleDiffuse_fragment_shader;const fluidRenderingParticleDiffusePixelShader = { name: "fluidRenderingParticleDiffusePixelShader", shader: fluidRenderingParticleDiffuse_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingBilateralBlur.fragment.js
const fluidRenderingBilateralBlur_fragment_name = "fluidRenderingBilateralBlurPixelShader",fluidRenderingBilateralBlur_fragment_shader = `uniform sampler2D textureSampler;
uniform int maxFilterSize;
uniform vec2 blurDir;
uniform float projectedParticleConstant;
uniform float depthThreshold;
varying vec2 vUV;
void main(void) {
float depth=textureLod(textureSampler,vUV,0.).x;
if (depth>=1e6 || depth<=0.) {
glFragColor=vec4(vec3(depth),1.);
return;
}
int filterSize=min(maxFilterSize,int(ceil(projectedParticleConstant/depth)));
float sigma=float(filterSize)/3.0;
float two_sigma2=2.0*sigma*sigma;
float sigmaDepth=depthThreshold/3.0;
float two_sigmaDepth2=2.0*sigmaDepth*sigmaDepth;
float sum=0.;
float wsum=0.;
float sumVel=0.;
for (int x=-filterSize; x<=filterSize; ++x) {
vec2 coords=vec2(x);
vec2 sampleDepthVel=textureLod(textureSampler,vUV+coords*blurDir,0.).rg;
float r=dot(coords,coords);
float w=exp(-r/two_sigma2);
float rDepth=sampleDepthVel.r-depth;
float wd=exp(-rDepth*rDepth/two_sigmaDepth2);
sum+=sampleDepthVel.r*w*wd;
sumVel+=sampleDepthVel.g*w*wd;
wsum+=w*wd;
}
glFragColor=vec4(sum/wsum,sumVel/wsum,0.,1.);
}
`;shaderStore/* ShaderStore.ShadersStore.fluidRenderingBilateralBlurPixelShader */.v.ShadersStore.fluidRenderingBilateralBlurPixelShader = fluidRenderingBilateralBlur_fragment_shader;const fluidRenderingBilateralBlurPixelShader = { name: "fluidRenderingBilateralBlurPixelShader", shader: fluidRenderingBilateralBlur_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingStandardBlur.fragment.js
const fluidRenderingStandardBlur_fragment_name = "fluidRenderingStandardBlurPixelShader",fluidRenderingStandardBlur_fragment_shader = `uniform sampler2D textureSampler;
uniform int filterSize;
uniform vec2 blurDir;
varying vec2 vUV;
void main(void) {
vec4 s=textureLod(textureSampler,vUV,0.);
if (s.r==0.) {
glFragColor=vec4(0.,0.,0.,1.);
return;
}
float sigma=float(filterSize)/3.0;
float twoSigma2=2.0*sigma*sigma;
vec4 sum=vec4(0.);
float wsum=0.;
for (int x=-filterSize; x<=filterSize; ++x) {
vec2 coords=vec2(x);
vec4 sampl=textureLod(textureSampler,vUV+coords*blurDir,0.);
float w=exp(-coords.x*coords.x/twoSigma2);
sum+=sampl*w;
wsum+=w;
}
sum/=wsum;
glFragColor=vec4(sum.rgb,1.);
}
`;shaderStore/* ShaderStore.ShadersStore.fluidRenderingStandardBlurPixelShader */.v.ShadersStore.fluidRenderingStandardBlurPixelShader = fluidRenderingStandardBlur_fragment_shader;const fluidRenderingStandardBlurPixelShader = { name: "fluidRenderingStandardBlurPixelShader", shader: fluidRenderingStandardBlur_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingRender.fragment.js
const fluidRenderingRender_fragment_name = "fluidRenderingRenderPixelShader",fluidRenderingRender_fragment_shader = `#define IOR 1.333
#define ETA 1.0/IOR
#define F0 0.02
uniform sampler2D textureSampler;
uniform sampler2D depthSampler;
#ifdef FLUIDRENDERING_DIFFUSETEXTURE
uniform sampler2D diffuseSampler;
#else
uniform vec3 diffuseColor;
#endif
#ifdef FLUIDRENDERING_FIXED_THICKNESS
uniform float thickness;
uniform sampler2D bgDepthSampler;
#else
uniform float minimumThickness;
uniform sampler2D thicknessSampler;
#endif
#ifdef FLUIDRENDERING_ENVIRONMENT
uniform samplerCube reflectionSampler;
#endif
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)
uniform sampler2D debugSampler;
#endif
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 invProjectionMatrix;
uniform vec2 texelSize;
uniform vec3 dirLight;
uniform float cameraFar;
uniform float density;
uniform float refractionStrength;
uniform float fresnelClamp;
uniform float specularPower;
varying vec2 vUV;
vec3 computeViewPosFromUVDepth(vec2 texCoord,float depth) {
vec4 ndc;
ndc.xy=texCoord*2.0-1.0;
#ifdef FLUIDRENDERING_RHS
ndc.z=-projectionMatrix[2].z+projectionMatrix[3].z/depth;
#else
ndc.z=projectionMatrix[2].z+projectionMatrix[3].z/depth;
#endif
ndc.w=1.0;
vec4 eyePos=invProjectionMatrix*ndc;
eyePos.xyz/=eyePos.w;
return eyePos.xyz;
}
vec3 getViewPosFromTexCoord(vec2 texCoord) {
float depth=textureLod(depthSampler,texCoord,0.).x;
return computeViewPosFromUVDepth(texCoord,depth);
}
void main(void) {
vec2 texCoord=vUV;
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)
vec4 color=texture2D(debugSampler,texCoord);
#ifdef FLUIDRENDERING_DEBUG_DEPTH
glFragColor=vec4(color.rgb/vec3(2.0),1.);
if (color.r>0.999 && color.g>0.999) {
glFragColor=texture2D(textureSampler,texCoord);
}
#else
glFragColor=vec4(color.rgb,1.);
if (color.r<0.001 && color.g<0.001 && color.b<0.001) {
glFragColor=texture2D(textureSampler,texCoord);
}
#endif
return;
#endif
vec2 depthVel=textureLod(depthSampler,texCoord,0.).rg;
float depth=depthVel.r;
#ifndef FLUIDRENDERING_FIXED_THICKNESS
float thickness=texture2D(thicknessSampler,texCoord).x;
#else
float bgDepth=texture2D(bgDepthSampler,texCoord).x;
float depthNonLinear=projectionMatrix[2].z+projectionMatrix[3].z/depth;
depthNonLinear=depthNonLinear*0.5+0.5;
#endif
vec3 backColor=texture2D(textureSampler,texCoord).rgb;
#ifndef FLUIDRENDERING_FIXED_THICKNESS
if (depth>=cameraFar || depth<=0. || thickness<=minimumThickness) {
#else
if (depth>=cameraFar || depth<=0. || bgDepth<=depthNonLinear) {
#endif
glFragColor=vec4(backColor,1.);
return;
}
vec3 viewPos=computeViewPosFromUVDepth(texCoord,depth);
vec3 ddx=getViewPosFromTexCoord(texCoord+vec2(texelSize.x,0.))-viewPos;
vec3 ddy=getViewPosFromTexCoord(texCoord+vec2(0.,texelSize.y))-viewPos;
vec3 ddx2=viewPos-getViewPosFromTexCoord(texCoord+vec2(-texelSize.x,0.));
if (abs(ddx.z)>abs(ddx2.z)) {
ddx=ddx2;
}
vec3 ddy2=viewPos-getViewPosFromTexCoord(texCoord+vec2(0.,-texelSize.y));
if (abs(ddy.z)>abs(ddy2.z)) {
ddy=ddy2;
}
vec3 normal=normalize(cross(ddy,ddx));
#ifdef FLUIDRENDERING_RHS
normal=-normal;
#endif
#ifndef WEBGPU
if(isnan(normal.x) || isnan(normal.y) || isnan(normal.z) || isinf(normal.x) || isinf(normal.y) || isinf(normal.z)) {
normal=vec3(0.,0.,-1.);
}
#endif
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_SHOWNORMAL)
glFragColor=vec4(normal*0.5+0.5,1.0);
return;
#endif
vec3 rayDir=normalize(viewPos); 
#ifdef FLUIDRENDERING_DIFFUSETEXTURE
vec3 diffuseColor=texture2D(diffuseSampler,texCoord).rgb;
#endif
vec3 lightDir=normalize(vec3(viewMatrix*vec4(-dirLight,0.)));
vec3 H =normalize(lightDir-rayDir);
float specular=pow(max(0.0,dot(H,normal)),specularPower);
#ifdef FLUIDRENDERING_DEBUG_DIFFUSERENDERING
float diffuse =max(0.0,dot(lightDir,normal))*1.0;
glFragColor=vec4(vec3(0.1) /*ambient*/+vec3(0.42,0.50,1.00)*diffuse+vec3(0,0,0.2)+specular,1.);
return;
#endif
vec3 refractionDir=refract(rayDir,normal,ETA);
vec3 transmitted=(texture2D(textureSampler,vec2(texCoord+refractionDir.xy*thickness*refractionStrength)).rgb);
vec3 transmittance=exp(-density*thickness*(1.0-diffuseColor)); 
vec3 refractionColor=transmitted*transmittance;
#ifdef FLUIDRENDERING_ENVIRONMENT
vec3 reflectionDir=reflect(rayDir,normal);
vec3 reflectionColor=(textureCube(reflectionSampler,reflectionDir).rgb);
float fresnel=clamp(F0+(1.0-F0)*pow(1.0-dot(normal,-rayDir),5.0),0.,fresnelClamp);
vec3 finalColor=mix(refractionColor,reflectionColor,fresnel)+specular;
#else
vec3 finalColor=refractionColor+specular;
#endif
#ifdef FLUIDRENDERING_VELOCITY
float velocity=depthVel.g;
finalColor=mix(finalColor,vec3(1.0),smoothstep(0.3,1.0,velocity/6.0));
#endif
glFragColor=vec4(finalColor,1.);
}
`;shaderStore/* ShaderStore.ShadersStore.fluidRenderingRenderPixelShader */.v.ShadersStore.fluidRenderingRenderPixelShader = fluidRenderingRender_fragment_shader;const fluidRenderingRenderPixelShader = { name: "fluidRenderingRenderPixelShader", shader: fluidRenderingRender_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderer.js
Object.defineProperty(core_scene/* Scene.prototype */.x.prototype, "fluidRenderer", { get: function () {return this._fluidRenderer;}, set: function (value) {this._fluidRenderer = value;}, enumerable: !0, configurable: !0 }), core_scene/* Scene.prototype.enableFluidRenderer */.x.prototype.enableFluidRenderer = function () {return this._fluidRenderer ? this._fluidRenderer : (this._fluidRenderer = new FluidRenderer(this), this._fluidRenderer);}, core_scene/* Scene.prototype.disableFluidRenderer */.x.prototype.disableFluidRenderer = function () {var _a;null === (_a = this._fluidRenderer) || void 0 === _a ? void 0 : _a.dispose(), this._fluidRenderer = null;};function IsParticleSystemObject(obj) {return !!obj.particleSystem;}class FluidRendererSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_FLUIDRENDERER */.l.NAME_FLUIDRENDERER, this.scene = scene;}register() {this.scene._gatherActiveCameraRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER */.l.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER, this, this._gatherActiveCameraRenderTargets), this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_AFTERCAMERADRAW_FLUIDRENDERER */.l.STEP_AFTERCAMERADRAW_FLUIDRENDERER, this, this._afterCameraDraw);}_gatherActiveCameraRenderTargets() {var _a;null === (_a = this.scene.fluidRenderer) || void 0 === _a ? void 0 : _a._prepareRendering();}_afterCameraDraw(camera) {var _a;null === (_a = this.scene.fluidRenderer) || void 0 === _a ? void 0 : _a._render(camera);}rebuild() {this.scene._fluidRenderer && (this.scene.disableFluidRenderer(), this.scene.enableFluidRenderer());}dispose() {this.scene.disableFluidRenderer();}}class FluidRenderer {static _SceneComponentInitialization(scene) {let component = scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_FLUIDRENDERER */.l.NAME_FLUIDRENDERER);component || (component = new FluidRendererSceneComponent(scene), scene._addComponent(component));}constructor(scene) {this._scene = scene, this._engine = scene.getEngine(), this._onEngineResizeObserver = null, this.renderObjects = [], this.targetRenderers = [], this._cameras = new Map(), FluidRenderer._SceneComponentInitialization(this._scene), this._onEngineResizeObserver = this._engine.onResizeObservable.add(() => {this._initialize();});}recreate() {this._sortRenderingObjects(), this._initialize();}getRenderObjectFromParticleSystem(ps) {const index = this._getParticleSystemIndex(ps);return -1 === index ? null : this.renderObjects[index];}addParticleSystem(ps, generateDiffuseTexture, targetRenderer, camera) {const object = new FluidRenderingObjectParticleSystem(this._scene, ps);object.onParticleSizeChanged.add(this._setParticleSizeForRenderTargets.bind(this)), targetRenderer || (targetRenderer = new FluidRenderingTargetRenderer(this._scene, camera), this.targetRenderers.push(targetRenderer)), targetRenderer._onUseVelocityChanged.hasObservers() || targetRenderer._onUseVelocityChanged.add(this._setUseVelocityForRenderObject.bind(this)), void 0 !== generateDiffuseTexture && (targetRenderer.generateDiffuseTexture = generateDiffuseTexture);const renderObject = { object, targetRenderer };return this.renderObjects.push(renderObject), this._sortRenderingObjects(), this._setParticleSizeForRenderTargets(), renderObject;}addCustomParticles(buffers, numParticles, generateDiffuseTexture, targetRenderer, camera) {const object = new FluidRenderingObjectCustomParticles(this._scene, buffers, numParticles);object.onParticleSizeChanged.add(this._setParticleSizeForRenderTargets.bind(this)), targetRenderer || (targetRenderer = new FluidRenderingTargetRenderer(this._scene, camera), this.targetRenderers.push(targetRenderer)), targetRenderer._onUseVelocityChanged.hasObservers() || targetRenderer._onUseVelocityChanged.add(this._setUseVelocityForRenderObject.bind(this)), void 0 !== generateDiffuseTexture && (targetRenderer.generateDiffuseTexture = generateDiffuseTexture);const renderObject = { object, targetRenderer };return this.renderObjects.push(renderObject), this._sortRenderingObjects(), this._setParticleSizeForRenderTargets(), renderObject;}removeRenderObject(renderObject, removeUnusedTargetRenderer = !0) {const index = this.renderObjects.indexOf(renderObject);return -1 !== index && (renderObject.object.dispose(), this.renderObjects.splice(index, 1), removeUnusedTargetRenderer && this._removeUnusedTargetRenderers() ? this._initialize() : this._setParticleSizeForRenderTargets(), !0);}_sortRenderingObjects() {this.renderObjects.sort((a, b) => a.object.priority < b.object.priority ? -1 : a.object.priority > b.object.priority ? 1 : 0);}_removeUnusedTargetRenderers() {const indexes = {};for (let i = 0; i < this.renderObjects.length; ++i) {const targetRenderer = this.renderObjects[i].targetRenderer;indexes[this.targetRenderers.indexOf(targetRenderer)] = !0;}let removed = !1;const newList = [];for (let i = 0; i < this.targetRenderers.length; ++i) indexes[i] ? newList.push(this.targetRenderers[i]) : (this.targetRenderers[i].dispose(), removed = !0);return removed && (this.targetRenderers.length = 0, this.targetRenderers.push(...newList)), removed;}_getParticleSystemIndex(ps) {for (let i = 0; i < this.renderObjects.length; ++i) {const obj = this.renderObjects[i].object;if (IsParticleSystemObject(obj) && obj.particleSystem === ps) return i;}return -1;}_initialize() {for (let i = 0; i < this.targetRenderers.length; ++i) this.targetRenderers[i].dispose();const cameras = new Map();for (let i = 0; i < this.targetRenderers.length; ++i) {const targetRenderer = this.targetRenderers[i];if (targetRenderer._initialize(), targetRenderer.camera && targetRenderer._renderPostProcess) {let list = cameras.get(targetRenderer.camera);list || (list = [[], {}], cameras.set(targetRenderer.camera, list)), list[0].push(targetRenderer), targetRenderer.camera.attachPostProcess(targetRenderer._renderPostProcess, i);}}let iterator = cameras.keys();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const camera = key.value,list = cameras.get(camera),firstPostProcess = camera._getFirstPostProcess();if (!firstPostProcess) continue;const [targetRenderers, copyDepthTextures] = list;firstPostProcess.onSizeChangedObservable.add(() => {var _a;firstPostProcess.inputTexture.depthStencilTexture || firstPostProcess.inputTexture.createDepthStencilTexture(0, !0, this._engine.isStencilEnable, targetRenderers[0].samples);for (const targetRenderer of targetRenderers) {const thicknessRT = null === (_a = targetRenderer._thicknessRenderTarget) || void 0 === _a ? void 0 : _a.renderTarget,thicknessTexture = null === thicknessRT || void 0 === thicknessRT ? void 0 : thicknessRT.texture;if (thicknessRT && thicknessTexture) {const key = thicknessTexture.width + "_" + thicknessTexture.height;let copyDepthTexture = copyDepthTextures[key];copyDepthTexture || (copyDepthTexture = copyDepthTextures[key] = new FluidRenderingDepthTextureCopy(this._engine, thicknessTexture.width, thicknessTexture.height)), copyDepthTexture.depthRTWrapper._shareDepth(thicknessRT);}}});}iterator = this._cameras.keys();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const camera = key.value,list = this._cameras.get(camera),copyDepthTextures = list[1],list2 = cameras.get(camera);if (!list2) for (const key in copyDepthTextures) copyDepthTextures[key].dispose();else for (const key in copyDepthTextures) list2[1][key] || copyDepthTextures[key].dispose();}this._cameras.clear(), this._cameras = cameras, this._setParticleSizeForRenderTargets();}_setParticleSizeForRenderTargets() {const particleSizes = new Map();for (let i = 0; i < this.renderObjects.length; ++i) {const renderingObject = this.renderObjects[i];let curSize = particleSizes.get(renderingObject.targetRenderer);curSize === void 0 && (curSize = 0), particleSizes.set(renderingObject.targetRenderer, Math.max(curSize, renderingObject.object.particleSize));}particleSizes.forEach((particleSize, targetRenderer) => {targetRenderer._depthRenderTarget && (targetRenderer._depthRenderTarget.particleSize = particleSize);});}_setUseVelocityForRenderObject() {for (const renderingObject of this.renderObjects) renderingObject.object.useVelocity = renderingObject.targetRenderer.useVelocity;}_prepareRendering() {for (const renderer of this.targetRenderers) if (renderer.needInitialization) return void this._initialize();}_render(forCamera) {var _a;for (let i = 0; i < this.targetRenderers.length; ++i) forCamera && this.targetRenderers[i].camera !== forCamera || this.targetRenderers[i]._clearTargets();const iterator = this._cameras.keys();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const camera = key.value,list = this._cameras.get(camera);if (forCamera && camera !== forCamera) continue;const firstPostProcess = camera._getFirstPostProcess();if (!firstPostProcess) continue;const sourceCopyDepth = null === (_a = firstPostProcess.inputTexture) || void 0 === _a ? void 0 : _a.depthStencilTexture;if (sourceCopyDepth) {const [targetRenderers, copyDepthTextures] = list;for (const targetRenderer of targetRenderers) targetRenderer._bgDepthTexture = sourceCopyDepth;for (const key in copyDepthTextures) copyDepthTextures[key].copy(sourceCopyDepth);}}for (let i = 0; i < this.renderObjects.length; ++i) {const renderingObject = this.renderObjects[i];forCamera && renderingObject.targetRenderer.camera !== forCamera || renderingObject.targetRenderer._render(renderingObject.object);}}dispose() {this._engine.onResizeObservable.remove(this._onEngineResizeObserver), this._onEngineResizeObserver = null;for (let i = 0; i < this.renderObjects.length; ++i) this.renderObjects[i].object.dispose();for (let i = 0; i < this.targetRenderers.length; ++i) this.targetRenderers[i].dispose();this._cameras.forEach((list) => {const copyDepthTextures = list[1];for (const key in copyDepthTextures) copyDepthTextures[key].dispose();}), this.renderObjects = [], this.targetRenderers = [], this._cameras.clear();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/fluidRenderer/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Rendering/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Sprites/thinSprite.js
class ThinSprite {get animationStarted() {return this._animationStarted;}get fromIndex() {return this._fromIndex;}get toIndex() {return this._toIndex;}get loopAnimation() {return this._loopAnimation;}get delay() {return Math.max(this._delay, 1);}constructor() {this.width = 1, this.height = 1, this.angle = 0, this.invertU = !1, this.invertV = !1, this.isVisible = !0, this._animationStarted = !1, this._loopAnimation = !1, this._fromIndex = 0, this._toIndex = 0, this._delay = 0, this._direction = 1, this._time = 0, this._onBaseAnimationEnd = null, this.position = { x: 1, y: 1, z: 1 }, this.color = { r: 1, g: 1, b: 1, a: 1 };}playAnimation(from, to, loop, delay, onAnimationEnd) {this._fromIndex = from, this._toIndex = to, this._loopAnimation = loop, this._delay = delay || 1, this._animationStarted = !0, this._onBaseAnimationEnd = onAnimationEnd, from < to ? this._direction = 1 : (this._direction = -1, this._toIndex = from, this._fromIndex = to), this.cellIndex = from, this._time = 0;}stopAnimation() {this._animationStarted = !1;}_animate(deltaTime) {this._animationStarted && (this._time += deltaTime, this._time > this._delay && (this._time %= this._delay, this.cellIndex += this._direction, (0 < this._direction && this.cellIndex > this._toIndex || 0 > this._direction && this.cellIndex < this._fromIndex) && (this._loopAnimation ? this.cellIndex = 0 < this._direction ? this._fromIndex : this._toIndex : (this.cellIndex = this._toIndex, this._animationStarted = !1, this._onBaseAnimationEnd && this._onBaseAnimationEnd()))));}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Sprites/sprite.js
class Sprite extends ThinSprite {get size() {return this.width;}set size(value) {this.width = value, this.height = value;}get manager() {return this._manager;}constructor(name, manager) {super(), this.name = name, this.animations = [], this.isPickable = !1, this.useAlphaForPicking = !1, this.onDisposeObservable = new observable/* Observable */.y$(), this._onAnimationEnd = null, this._endAnimation = () => {this._onAnimationEnd && this._onAnimationEnd(), this.disposeWhenFinishedAnimating && this.dispose();}, this.color = new math_color/* Color4 */.HE(1, 1, 1, 1), this.position = math_vector/* Vector3.Zero */.P.Zero(), this._manager = manager, this._manager.sprites.push(this), this.uniqueId = this._manager.scene.getUniqueId();}getClassName() {return "Sprite";}get fromIndex() {return this._fromIndex;}set fromIndex(value) {this.playAnimation(value, this._toIndex, this._loopAnimation, this._delay, this._onAnimationEnd);}get toIndex() {return this._toIndex;}set toIndex(value) {this.playAnimation(this._fromIndex, value, this._loopAnimation, this._delay, this._onAnimationEnd);}get loopAnimation() {return this._loopAnimation;}set loopAnimation(value) {this.playAnimation(this._fromIndex, this._toIndex, value, this._delay, this._onAnimationEnd);}get delay() {return Math.max(this._delay, 1);}set delay(value) {this.playAnimation(this._fromIndex, this._toIndex, this._loopAnimation, value, this._onAnimationEnd);}playAnimation(from, to, loop, delay, onAnimationEnd = null) {this._onAnimationEnd = onAnimationEnd, super.playAnimation(from, to, loop, delay, this._endAnimation);}dispose() {for (let i = 0; i < this._manager.sprites.length; i++) this._manager.sprites[i] == this && this._manager.sprites.splice(i, 1);this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();}serialize() {const serializationObject = { name: this.name, position: this.position.asArray(), color: this.color.asArray(), width: this.width, height: this.height, angle: this.angle, cellIndex: this.cellIndex, cellRef: this.cellRef, invertU: this.invertU, invertV: this.invertV, disposeWhenFinishedAnimating: this.disposeWhenFinishedAnimating, isPickable: this.isPickable, isVisible: this.isVisible, useAlphaForPicking: this.useAlphaForPicking, animationStarted: this.animationStarted, fromIndex: this.fromIndex, toIndex: this.toIndex, loopAnimation: this.loopAnimation, delay: this.delay };return serializationObject;}static Parse(parsedSprite, manager) {const sprite = new Sprite(parsedSprite.name, manager);return sprite.position = math_vector/* Vector3.FromArray */.P.FromArray(parsedSprite.position), sprite.color = math_color/* Color4.FromArray */.HE.FromArray(parsedSprite.color), sprite.width = parsedSprite.width, sprite.height = parsedSprite.height, sprite.angle = parsedSprite.angle, sprite.cellIndex = parsedSprite.cellIndex, sprite.cellRef = parsedSprite.cellRef, sprite.invertU = parsedSprite.invertU, sprite.invertV = parsedSprite.invertV, sprite.disposeWhenFinishedAnimating = parsedSprite.disposeWhenFinishedAnimating, sprite.isPickable = parsedSprite.isPickable, sprite.isVisible = parsedSprite.isVisible, sprite.useAlphaForPicking = parsedSprite.useAlphaForPicking, sprite.fromIndex = parsedSprite.fromIndex, sprite.toIndex = parsedSprite.toIndex, sprite.loopAnimation = parsedSprite.loopAnimation, sprite.delay = parsedSprite.delay, parsedSprite.animationStarted && sprite.playAnimation(sprite.fromIndex, sprite.toIndex, sprite.loopAnimation, sprite.delay), sprite;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Sprites/ISprites.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Sprites/spriteSceneComponent.js
core_scene/* Scene.prototype._internalPickSprites */.x.prototype._internalPickSprites = function (ray, predicate, fastCheck, camera) {if (!Collisions_pickingInfo/* PickingInfo */.p) return null;let pickingInfo = null;if (!camera) {if (!this.activeCamera) return null;camera = this.activeCamera;}if (0 < this.spriteManagers.length) for (let spriteIndex = 0; spriteIndex < this.spriteManagers.length; spriteIndex++) {const spriteManager = this.spriteManagers[spriteIndex];if (!spriteManager.isPickable) continue;const result = spriteManager.intersects(ray, camera, predicate, fastCheck);if (result && result.hit && (fastCheck || null == pickingInfo || !(result.distance >= pickingInfo.distance)) && (pickingInfo = result, fastCheck)) break;}return pickingInfo || new Collisions_pickingInfo/* PickingInfo */.p();}, core_scene/* Scene.prototype._internalMultiPickSprites */.x.prototype._internalMultiPickSprites = function (ray, predicate, camera) {if (!Collisions_pickingInfo/* PickingInfo */.p) return null;let pickingInfos = [];if (!camera) {if (!this.activeCamera) return null;camera = this.activeCamera;}if (0 < this.spriteManagers.length) for (let spriteIndex = 0; spriteIndex < this.spriteManagers.length; spriteIndex++) {const spriteManager = this.spriteManagers[spriteIndex];if (!spriteManager.isPickable) continue;const results = spriteManager.multiIntersects(ray, camera, predicate);null !== results && (pickingInfos = pickingInfos.concat(results));}return pickingInfos;}, core_scene/* Scene.prototype.pickSprite */.x.prototype.pickSprite = function (x, y, predicate, fastCheck, camera) {if (!this._tempSpritePickingRay) return null;this.createPickingRayInCameraSpaceToRef(x, y, this._tempSpritePickingRay, camera);const result = this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera);return result && (result.ray = this.createPickingRayInCameraSpace(x, y, camera)), result;}, core_scene/* Scene.prototype.pickSpriteWithRay */.x.prototype.pickSpriteWithRay = function (ray, predicate, fastCheck, camera) {if (!this._tempSpritePickingRay) return null;if (!camera) {if (!this.activeCamera) return null;camera = this.activeCamera;}Ray.TransformToRef(ray, camera.getViewMatrix(), this._tempSpritePickingRay);const result = this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera);return result && (result.ray = ray), result;}, core_scene/* Scene.prototype.multiPickSprite */.x.prototype.multiPickSprite = function (x, y, predicate, camera) {return this.createPickingRayInCameraSpaceToRef(x, y, this._tempSpritePickingRay, camera), this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera);}, core_scene/* Scene.prototype.multiPickSpriteWithRay */.x.prototype.multiPickSpriteWithRay = function (ray, predicate, camera) {if (!this._tempSpritePickingRay) return null;if (!camera) {if (!this.activeCamera) return null;camera = this.activeCamera;}return Ray.TransformToRef(ray, camera.getViewMatrix(), this._tempSpritePickingRay), this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera);}, core_scene/* Scene.prototype.setPointerOverSprite */.x.prototype.setPointerOverSprite = function (sprite) {this._pointerOverSprite === sprite || (this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(10, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(this._pointerOverSprite, this)), this._pointerOverSprite = sprite, this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(9, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(this._pointerOverSprite, this)));}, core_scene/* Scene.prototype.getPointerOverSprite */.x.prototype.getPointerOverSprite = function () {return this._pointerOverSprite;};class SpriteSceneComponent {constructor(scene) {this.name = sceneComponent/* SceneComponentConstants.NAME_SPRITE */.l.NAME_SPRITE, this.scene = scene, this.scene.spriteManagers = [], this.scene._tempSpritePickingRay = Ray ? Ray.Zero() : null, this.scene.onBeforeSpritesRenderingObservable = new observable/* Observable */.y$(), this.scene.onAfterSpritesRenderingObservable = new observable/* Observable */.y$(), this._spritePredicate = (sprite) => !!sprite.actionManager && sprite.isPickable && sprite.actionManager.hasPointerTriggers;}register() {this.scene._pointerMoveStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_POINTERMOVE_SPRITE */.l.STEP_POINTERMOVE_SPRITE, this, this._pointerMove), this.scene._pointerDownStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_POINTERDOWN_SPRITE */.l.STEP_POINTERDOWN_SPRITE, this, this._pointerDown), this.scene._pointerUpStage.registerStep(sceneComponent/* SceneComponentConstants.STEP_POINTERUP_SPRITE */.l.STEP_POINTERUP_SPRITE, this, this._pointerUp);}rebuild() {}dispose() {this.scene.onBeforeSpritesRenderingObservable.clear(), this.scene.onAfterSpritesRenderingObservable.clear();for (const spriteManagers = this.scene.spriteManagers; spriteManagers.length;) spriteManagers[0].dispose();}_pickSpriteButKeepRay(originalPointerInfo, x, y, fastCheck, camera) {const result = this.scene.pickSprite(x, y, this._spritePredicate, fastCheck, camera);return result && (result.ray = originalPointerInfo ? originalPointerInfo.ray : null), result;}_pointerMove(unTranslatedPointerX, unTranslatedPointerY, pickResult, isMeshPicked, element) {const scene = this.scene;return isMeshPicked ? scene.setPointerOverSprite(null) : (pickResult = this._pickSpriteButKeepRay(pickResult, unTranslatedPointerX, unTranslatedPointerY, !1, scene.cameraToUseForPointers || void 0), pickResult && pickResult.hit && pickResult.pickedSprite ? (scene.setPointerOverSprite(pickResult.pickedSprite), !scene.doNotHandleCursors && element && (scene._pointerOverSprite && scene._pointerOverSprite.actionManager && scene._pointerOverSprite.actionManager.hoverCursor ? element.style.cursor = scene._pointerOverSprite.actionManager.hoverCursor : element.style.cursor = scene.hoverCursor)) : scene.setPointerOverSprite(null)), pickResult;}_pointerDown(unTranslatedPointerX, unTranslatedPointerY, pickResult, evt) {const scene = this.scene;if (scene._pickedDownSprite = null, 0 < scene.spriteManagers.length && (pickResult = scene.pickSprite(unTranslatedPointerX, unTranslatedPointerY, this._spritePredicate, !1, scene.cameraToUseForPointers || void 0), pickResult && pickResult.hit && pickResult.pickedSprite && pickResult.pickedSprite.actionManager)) {switch (scene._pickedDownSprite = pickResult.pickedSprite, evt.button) {case 0:pickResult.pickedSprite.actionManager.processTrigger(2, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(pickResult.pickedSprite, scene, evt));break;case 1:pickResult.pickedSprite.actionManager.processTrigger(4, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(pickResult.pickedSprite, scene, evt));break;case 2:pickResult.pickedSprite.actionManager.processTrigger(3, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(pickResult.pickedSprite, scene, evt));}pickResult.pickedSprite.actionManager && pickResult.pickedSprite.actionManager.processTrigger(5, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(pickResult.pickedSprite, scene, evt));}return pickResult;}_pointerUp(unTranslatedPointerX, unTranslatedPointerY, pickResult, evt, doubleClick) {const scene = this.scene;if (0 < scene.spriteManagers.length) {const spritePickResult = scene.pickSprite(unTranslatedPointerX, unTranslatedPointerY, this._spritePredicate, !1, scene.cameraToUseForPointers || void 0);spritePickResult && (spritePickResult.hit && spritePickResult.pickedSprite && spritePickResult.pickedSprite.actionManager && (spritePickResult.pickedSprite.actionManager.processTrigger(7, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(spritePickResult.pickedSprite, scene, evt)), spritePickResult.pickedSprite.actionManager && (!this.scene._inputManager._isPointerSwiping() && spritePickResult.pickedSprite.actionManager.processTrigger(1, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(spritePickResult.pickedSprite, scene, evt)), doubleClick && spritePickResult.pickedSprite.actionManager.processTrigger(6, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(spritePickResult.pickedSprite, scene, evt)))), scene._pickedDownSprite && scene._pickedDownSprite.actionManager && scene._pickedDownSprite !== spritePickResult.pickedSprite && scene._pickedDownSprite.actionManager.processTrigger(16, actionEvent/* ActionEvent.CreateNewFromSprite */.V.CreateNewFromSprite(scene._pickedDownSprite, scene, evt)));}return pickResult;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingCompatibility.js
const imageProcessingCompatibility_name = "imageProcessingCompatibility",imageProcessingCompatibility_shader = `#ifdef IMAGEPROCESSINGPOSTPROCESS
gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(2.2));
#endif
`;shaderStore/* ShaderStore.IncludesShadersStore.imageProcessingCompatibility */.v.IncludesShadersStore.imageProcessingCompatibility = imageProcessingCompatibility_shader;const imageProcessingCompatibility = { name: "imageProcessingCompatibility", shader: imageProcessingCompatibility_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/sprites.fragment.js
const sprites_fragment_name = "spritesPixelShader",sprites_fragment_shader = `uniform bool alphaTest;
varying vec4 vColor;
varying vec2 vUV;
uniform sampler2D diffuseSampler;
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 color=texture2D(diffuseSampler,vUV);
float fAlphaTest=float(alphaTest);
if (fAlphaTest != 0.)
{
if (color.a<0.95)
discard;
}
color*=vColor;
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.spritesPixelShader */.v.ShadersStore.spritesPixelShader = sprites_fragment_shader;const spritesPixelShader = { name: "spritesPixelShader", shader: sprites_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/sprites.vertex.js
const sprites_vertex_name = "spritesVertexShader",sprites_vertex_shader = `attribute vec4 position;
attribute vec2 options;
attribute vec2 offsets;
attribute vec2 inverts;
attribute vec4 cellInfo;
attribute vec4 color;
uniform mat4 view;
uniform mat4 projection;
varying vec2 vUV;
varying vec4 vColor;
#include<fogVertexDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 viewPos=(view*vec4(position.xyz,1.0)).xyz; 
vec2 cornerPos;
float angle=position.w;
vec2 size=vec2(options.x,options.y);
vec2 offset=offsets.xy;
cornerPos=vec2(offset.x-0.5,offset.y -0.5)*size;
vec3 rotatedCorner;
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);
rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);
rotatedCorner.z=0.;
viewPos+=rotatedCorner;
gl_Position=projection*vec4(viewPos,1.0); 
vColor=color;
vec2 uvOffset=vec2(abs(offset.x-inverts.x),abs(1.0-offset.y-inverts.y));
vec2 uvPlace=cellInfo.xy;
vec2 uvSize=cellInfo.zw;
vUV.x=uvPlace.x+uvSize.x*uvOffset.x;
vUV.y=uvPlace.y+uvSize.y*uvOffset.y;
#ifdef FOG
vFogDistance=viewPos;
#endif
#define CUSTOM_VERTEX_MAIN_END
}`;shaderStore/* ShaderStore.ShadersStore.spritesVertexShader */.v.ShadersStore.spritesVertexShader = sprites_vertex_shader;const spritesVertexShader = { name: "spritesVertexShader", shader: sprites_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Sprites/spriteRenderer.js
class SpriteRenderer {get capacity() {return this._capacity;}constructor(engine, capacity, epsilon = .01, scene = null) {this.blendMode = 2, this.autoResetAlpha = !0, this.disableDepthWrite = !1, this.fogEnabled = !0, this._useVAO = !1, this._useInstancing = !1, this._vertexBuffers = {}, this._capacity = capacity, this._epsilon = epsilon, this._engine = engine, this._useInstancing = engine.getCaps().instancedArrays && engine._features.supportSpriteInstancing, this._useVAO = engine.getCaps().vertexArrayObject && !engine.disableVertexArrayObjects, this._scene = scene, this._drawWrapperBase = new Materials_drawWrapper/* DrawWrapper */.q(engine), this._drawWrapperFog = new Materials_drawWrapper/* DrawWrapper */.q(engine), this._drawWrapperDepth = new Materials_drawWrapper/* DrawWrapper */.q(engine, !1), this._drawWrapperFogDepth = new Materials_drawWrapper/* DrawWrapper */.q(engine, !1), this._useInstancing || this._buildIndexBuffer(), this._drawWrapperBase.drawContext && (this._drawWrapperBase.drawContext.useInstancing = this._useInstancing), this._drawWrapperFog.drawContext && (this._drawWrapperFog.drawContext.useInstancing = this._useInstancing), this._drawWrapperDepth.drawContext && (this._drawWrapperDepth.drawContext.useInstancing = this._useInstancing), this._drawWrapperFogDepth.drawContext && (this._drawWrapperFogDepth.drawContext.useInstancing = this._useInstancing), this._vertexBufferSize = this._useInstancing ? 16 : 18, this._vertexData = new Float32Array(capacity * this._vertexBufferSize * (this._useInstancing ? 1 : 4)), this._buffer = new Buffers_buffer/* Buffer */.l(engine, this._vertexData, !0, this._vertexBufferSize);const positions = this._buffer.createVertexBuffer(Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, 0, 4, this._vertexBufferSize, this._useInstancing),options = this._buffer.createVertexBuffer("options", 4, 2, this._vertexBufferSize, this._useInstancing);let offsets,offset = 6;if (this._useInstancing) {const spriteData = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);this._spriteBuffer = new Buffers_buffer/* Buffer */.l(engine, spriteData, !1, 2), offsets = this._spriteBuffer.createVertexBuffer("offsets", 0, 2);} else offsets = this._buffer.createVertexBuffer("offsets", offset, 2, this._vertexBufferSize, this._useInstancing), offset += 2;const inverts = this._buffer.createVertexBuffer("inverts", offset, 2, this._vertexBufferSize, this._useInstancing),cellInfo = this._buffer.createVertexBuffer("cellInfo", offset + 2, 4, this._vertexBufferSize, this._useInstancing),colors = this._buffer.createVertexBuffer(Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind, offset + 6, 4, this._vertexBufferSize, this._useInstancing);this._vertexBuffers[Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind] = positions, this._vertexBuffers.options = options, this._vertexBuffers.offsets = offsets, this._vertexBuffers.inverts = inverts, this._vertexBuffers.cellInfo = cellInfo, this._vertexBuffers[Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind] = colors, this._drawWrapperBase.effect = this._engine.createEffect("sprites", [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, "options", "offsets", "inverts", "cellInfo", Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind], ["view", "projection", "textureInfos", "alphaTest"], ["diffuseSampler"], ""), this._drawWrapperDepth.effect = this._drawWrapperBase.effect, this._drawWrapperDepth.materialContext = this._drawWrapperBase.materialContext, this._scene && (this._drawWrapperFog.effect = this._scene.getEngine().createEffect("sprites", [Buffers_buffer/* VertexBuffer.PositionKind */.o.PositionKind, "options", "offsets", "inverts", "cellInfo", Buffers_buffer/* VertexBuffer.ColorKind */.o.ColorKind], ["view", "projection", "textureInfos", "alphaTest", "vFogInfos", "vFogColor"], ["diffuseSampler"], "#define FOG"), this._drawWrapperFogDepth.effect = this._drawWrapperFog.effect, this._drawWrapperFogDepth.materialContext = this._drawWrapperFog.materialContext);}render(sprites, deltaTime, viewMatrix, projectionMatrix, customSpriteUpdate = null) {if (!this.texture || !this.texture.isReady() || !sprites.length) return;let drawWrapper = this._drawWrapperBase,drawWrapperDepth = this._drawWrapperDepth,shouldRenderFog = !1;this.fogEnabled && this._scene && this._scene.fogEnabled && 0 !== this._scene.fogMode && (drawWrapper = this._drawWrapperFog, drawWrapperDepth = this._drawWrapperFogDepth, shouldRenderFog = !0);const effect = drawWrapper.effect;if (!effect.isReady()) return;const engine = this._engine,useRightHandedSystem = !!(this._scene && this._scene.useRightHandedSystem),baseSize = this.texture.getBaseSize(),max = Math.min(this._capacity, sprites.length);let offset = 0,noSprite = !0;for (let index = 0; index < max; index++) {const sprite = sprites[index];sprite && sprite.isVisible && (noSprite = !1, sprite._animate(deltaTime), this._appendSpriteVertex(offset++, sprite, 0, 0, baseSize, useRightHandedSystem, customSpriteUpdate), this._useInstancing || (this._appendSpriteVertex(offset++, sprite, 1, 0, baseSize, useRightHandedSystem, customSpriteUpdate), this._appendSpriteVertex(offset++, sprite, 1, 1, baseSize, useRightHandedSystem, customSpriteUpdate), this._appendSpriteVertex(offset++, sprite, 0, 1, baseSize, useRightHandedSystem, customSpriteUpdate)));}if (noSprite) return;this._buffer.update(this._vertexData);const culling = !!engine.depthCullingState.cull,zOffset = engine.depthCullingState.zOffset,zOffsetUnits = engine.depthCullingState.zOffsetUnits;if (engine.setState(culling, zOffset, !1, !1, void 0, void 0, zOffsetUnits), engine.enableEffect(drawWrapper), effect.setTexture("diffuseSampler", this.texture), effect.setMatrix("view", viewMatrix), effect.setMatrix("projection", projectionMatrix), shouldRenderFog) {const scene = this._scene;effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity), effect.setColor3("vFogColor", scene.fogColor);}this._useVAO ? (!this._vertexArrayObject && (this._vertexArrayObject = engine.recordVertexArrayObject(this._vertexBuffers, this._indexBuffer, effect)), engine.bindVertexArrayObject(this._vertexArrayObject, this._indexBuffer)) : engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect), engine.depthCullingState.depthFunc = engine.useReverseDepthBuffer ? 518 : 515, this.disableDepthWrite || (effect.setBool("alphaTest", !0), engine.setColorWrite(!1), engine.enableEffect(drawWrapperDepth), this._useInstancing ? engine.drawArraysType(7, 0, 4, offset) : engine.drawElementsType(0, 0, 6 * (offset / 4)), engine.enableEffect(drawWrapper), engine.setColorWrite(!0), effect.setBool("alphaTest", !1)), engine.setAlphaMode(this.blendMode), this._useInstancing ? engine.drawArraysType(7, 0, 4, offset) : engine.drawElementsType(0, 0, 6 * (offset / 4)), this.autoResetAlpha && engine.setAlphaMode(0), useRightHandedSystem && this._scene.getEngine().setState(culling, zOffset, !1, !0, void 0, void 0, zOffsetUnits), engine.unbindInstanceAttributes();}_appendSpriteVertex(index, sprite, offsetX, offsetY, baseSize, useRightHandedSystem, customSpriteUpdate) {let arrayOffset = index * this._vertexBufferSize;if (0 === offsetX ? offsetX = this._epsilon : 1 === offsetX && (offsetX = 1 - this._epsilon), 0 === offsetY ? offsetY = this._epsilon : 1 === offsetY && (offsetY = 1 - this._epsilon), customSpriteUpdate) customSpriteUpdate(sprite, baseSize);else {sprite.cellIndex || (sprite.cellIndex = 0);const rowSize = baseSize.width / this.cellWidth,offset = sprite.cellIndex / rowSize >> 0;sprite._xOffset = (sprite.cellIndex - offset * rowSize) * this.cellWidth / baseSize.width, sprite._yOffset = offset * this.cellHeight / baseSize.height, sprite._xSize = this.cellWidth, sprite._ySize = this.cellHeight;}this._vertexData[arrayOffset] = sprite.position.x, this._vertexData[arrayOffset + 1] = sprite.position.y, this._vertexData[arrayOffset + 2] = sprite.position.z, this._vertexData[arrayOffset + 3] = sprite.angle, this._vertexData[arrayOffset + 4] = sprite.width, this._vertexData[arrayOffset + 5] = sprite.height, this._useInstancing ? arrayOffset -= 2 : (this._vertexData[arrayOffset + 6] = offsetX, this._vertexData[arrayOffset + 7] = offsetY), this._vertexData[arrayOffset + 8] = useRightHandedSystem ? sprite.invertU ? 0 : 1 : sprite.invertU ? 1 : 0, this._vertexData[arrayOffset + 9] = sprite.invertV ? 1 : 0, this._vertexData[arrayOffset + 10] = sprite._xOffset, this._vertexData[arrayOffset + 11] = sprite._yOffset, this._vertexData[arrayOffset + 12] = sprite._xSize / baseSize.width, this._vertexData[arrayOffset + 13] = sprite._ySize / baseSize.height, this._vertexData[arrayOffset + 14] = sprite.color.r, this._vertexData[arrayOffset + 15] = sprite.color.g, this._vertexData[arrayOffset + 16] = sprite.color.b, this._vertexData[arrayOffset + 17] = sprite.color.a;}_buildIndexBuffer() {const indices = [];let index = 0;for (let count = 0; count < this._capacity; count++) indices.push(index), indices.push(index + 1), indices.push(index + 2), indices.push(index), indices.push(index + 2), indices.push(index + 3), index += 4;this._indexBuffer = this._engine.createIndexBuffer(indices);}rebuild() {var _a;for (const key in this._indexBuffer && this._buildIndexBuffer(), this._useVAO && (this._vertexArrayObject = void 0), this._buffer._rebuild(), this._vertexBuffers) {const vertexBuffer = this._vertexBuffers[key];vertexBuffer._rebuild();}null === (_a = this._spriteBuffer) || void 0 === _a ? void 0 : _a._rebuild();}dispose() {this._buffer && (this._buffer.dispose(), this._buffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._indexBuffer && (this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), this.texture && (this.texture.dispose(), this.texture = null), this._drawWrapperBase.dispose(), this._drawWrapperFog.dispose(), this._drawWrapperDepth.dispose(), this._drawWrapperFogDepth.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Sprites/spriteManager.js
class SpriteManager {set onDispose(callback) {this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(callback);}get children() {return this.sprites;}get scene() {return this._scene;}get capacity() {return this._spriteRenderer.capacity;}get texture() {return this._spriteRenderer.texture;}set texture(value) {value.wrapU = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, value.wrapV = Textures_texture/* Texture.CLAMP_ADDRESSMODE */.x.CLAMP_ADDRESSMODE, this._spriteRenderer.texture = value, this._textureContent = null;}get cellWidth() {return this._spriteRenderer.cellWidth;}set cellWidth(value) {this._spriteRenderer.cellWidth = value;}get cellHeight() {return this._spriteRenderer.cellHeight;}set cellHeight(value) {this._spriteRenderer.cellHeight = value;}get fogEnabled() {return this._spriteRenderer.fogEnabled;}set fogEnabled(value) {this._spriteRenderer.fogEnabled = value;}get blendMode() {return this._spriteRenderer.blendMode;}set blendMode(blendMode) {this._spriteRenderer.blendMode = blendMode;}get disableDepthWrite() {return this._disableDepthWrite;}set disableDepthWrite(value) {this._disableDepthWrite = value, this._spriteRenderer.disableDepthWrite = value;}constructor(name, imgUrl, capacity, cellSize, scene, epsilon = .01, samplingMode = Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE, fromPacked = !1, spriteJSON = null) {this.name = name, this.sprites = [], this.renderingGroupId = 0, this.layerMask = 268435455, this.isPickable = !1, this.metadata = null, this._wasDispatched = !1, this.onDisposeObservable = new observable/* Observable */.y$(), this._disableDepthWrite = !1, this._packedAndReady = !1, this._customUpdate = (sprite, baseSize) => {sprite.cellRef || (sprite.cellIndex = 0);const num = sprite.cellIndex;"number" == typeof num && isFinite(num) && Math.floor(num) === num && (sprite.cellRef = this._spriteMap[sprite.cellIndex]), sprite._xOffset = this._cellData[sprite.cellRef].frame.x / baseSize.width, sprite._yOffset = this._cellData[sprite.cellRef].frame.y / baseSize.height, sprite._xSize = this._cellData[sprite.cellRef].frame.w, sprite._ySize = this._cellData[sprite.cellRef].frame.h;}, scene || (scene = engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene), scene._getComponent(sceneComponent/* SceneComponentConstants.NAME_SPRITE */.l.NAME_SPRITE) || scene._addComponent(new SpriteSceneComponent(scene)), this._fromPacked = fromPacked, this._scene = scene;const engine = this._scene.getEngine();if (this._spriteRenderer = new SpriteRenderer(engine, capacity, epsilon, scene), cellSize.width && cellSize.height) this.cellWidth = cellSize.width, this.cellHeight = cellSize.height;else if (void 0 !== cellSize) this.cellWidth = cellSize, this.cellHeight = cellSize;else return void (this._spriteRenderer = null);this._scene.spriteManagers.push(this), this.uniqueId = this.scene.getUniqueId(), imgUrl && (this.texture = new Textures_texture/* Texture */.x(imgUrl, scene, !0, !1, samplingMode)), this._fromPacked && this._makePacked(imgUrl, spriteJSON);}getClassName() {return "SpriteManager";}_makePacked(imgUrl, spriteJSON) {if (null !== spriteJSON) try {let celldata;if (celldata = "string" == typeof spriteJSON ? JSON.parse(spriteJSON) : spriteJSON, celldata.frames.length) {const frametemp = {};for (let i = 0; i < celldata.frames.length; i++) {const _f = celldata.frames[i];if ("string" != typeof Object.keys(_f)[0]) throw new Error("Invalid JSON Format.  Check the frame values and make sure the name is the first parameter.");const name = _f[Object.keys(_f)[0]];frametemp[name] = _f;}celldata.frames = frametemp;}const spritemap = Reflect.ownKeys(celldata.frames);this._spriteMap = spritemap, this._packedAndReady = !0, this._cellData = celldata.frames;} catch (e) {throw this._fromPacked = !1, this._packedAndReady = !1, new Error("Invalid JSON from string. Spritesheet managed with constant cell size.");} else {const re = /\./g;let li;do li = re.lastIndex, re.test(imgUrl); while (0 < re.lastIndex);const jsonUrl = imgUrl.substring(0, li - 1) + ".json",onerror = () => {logger/* Logger.Error */.Y.Error("JSON ERROR: Unable to load JSON file."), this._fromPacked = !1, this._packedAndReady = !1;},onload = (data) => {try {const celldata = JSON.parse(data),spritemap = Reflect.ownKeys(celldata.frames);this._spriteMap = spritemap, this._packedAndReady = !0, this._cellData = celldata.frames;} catch (e) {throw this._fromPacked = !1, this._packedAndReady = !1, new Error("Invalid JSON format. Please check documentation for format specifications.");}};tools/* Tools.LoadFile */.w1.LoadFile(jsonUrl, onload, void 0, void 0, !1, onerror);}}_checkTextureAlpha(sprite, ray, distance, min, max) {if (!sprite.useAlphaForPicking || !this.texture) return !0;const textureSize = this.texture.getSize();this._textureContent || (this._textureContent = new Uint8Array(4 * (textureSize.width * textureSize.height)), this.texture.readPixels(0, 0, this._textureContent));const contactPoint = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];contactPoint.copyFrom(ray.direction), contactPoint.normalize(), contactPoint.scaleInPlace(distance), contactPoint.addInPlace(ray.origin);const contactPointU = (contactPoint.x - min.x) / (max.x - min.x) - .5,contactPointV = 1 - (contactPoint.y - min.y) / (max.y - min.y) - .5,angle = sprite.angle,rotatedU = .5 + (contactPointU * Math.cos(angle) - contactPointV * Math.sin(angle)),rotatedV = .5 + (contactPointU * Math.sin(angle) + contactPointV * Math.cos(angle)),u = 0 | sprite._xOffset * textureSize.width + rotatedU * sprite._xSize,v = 0 | sprite._yOffset * textureSize.height + rotatedV * sprite._ySize,alpha = this._textureContent[4 * (u + v * textureSize.width) + 3];return .5 < alpha;}intersects(ray, camera, predicate, fastCheck) {const count = Math.min(this.capacity, this.sprites.length),min = math_vector/* Vector3.Zero */.P.Zero(),max = math_vector/* Vector3.Zero */.P.Zero();let distance = Number.MAX_VALUE,currentSprite = null;const pickedPoint = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0],cameraSpacePosition = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1],cameraView = camera.getViewMatrix();let activeRay = ray,pickedRay = ray;for (let index = 0; index < count; index++) {const sprite = this.sprites[index];if (sprite) {if (predicate) {if (!predicate(sprite)) continue;} else if (!sprite.isPickable) continue;if (math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(sprite.position, cameraView, cameraSpacePosition), sprite.angle ? (math_vector/* Matrix.TranslationToRef */.y3.TranslationToRef(-cameraSpacePosition.x, -cameraSpacePosition.y, 0, math_vector/* TmpVectors.Matrix.1 */.jp.Matrix[1]), math_vector/* Matrix.TranslationToRef */.y3.TranslationToRef(cameraSpacePosition.x, cameraSpacePosition.y, 0, math_vector/* TmpVectors.Matrix.2 */.jp.Matrix[2]), math_vector/* Matrix.RotationZToRef */.y3.RotationZToRef(sprite.angle, math_vector/* TmpVectors.Matrix.3 */.jp.Matrix[3]), math_vector/* TmpVectors.Matrix.1.multiplyToRef */.jp.Matrix[1].multiplyToRef(math_vector/* TmpVectors.Matrix.3 */.jp.Matrix[3], math_vector/* TmpVectors.Matrix.4 */.jp.Matrix[4]), math_vector/* TmpVectors.Matrix.4.multiplyToRef */.jp.Matrix[4].multiplyToRef(math_vector/* TmpVectors.Matrix.2 */.jp.Matrix[2], math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), activeRay = ray.clone(), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(ray.origin, math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0], activeRay.origin), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(ray.direction, math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0], activeRay.direction)) : activeRay = ray, min.copyFromFloats(cameraSpacePosition.x - sprite.width / 2, cameraSpacePosition.y - sprite.height / 2, cameraSpacePosition.z), max.copyFromFloats(cameraSpacePosition.x + sprite.width / 2, cameraSpacePosition.y + sprite.height / 2, cameraSpacePosition.z), activeRay.intersectsBoxMinMax(min, max)) {const currentDistance = math_vector/* Vector3.Distance */.P.Distance(cameraSpacePosition, activeRay.origin);if (distance > currentDistance) {if (!this._checkTextureAlpha(sprite, activeRay, currentDistance, min, max)) continue;if (pickedRay = activeRay, distance = currentDistance, currentSprite = sprite, fastCheck) break;}}}}if (currentSprite) {const result = new Collisions_pickingInfo/* PickingInfo */.p();cameraView.invertToRef(math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), result.hit = !0, result.pickedSprite = currentSprite, result.distance = distance;const direction = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2];return direction.copyFrom(pickedRay.direction), direction.normalize(), direction.scaleInPlace(distance), pickedRay.origin.addToRef(direction, pickedPoint), result.pickedPoint = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(pickedPoint, math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), result;}return null;}multiIntersects(ray, camera, predicate) {const count = Math.min(this.capacity, this.sprites.length),min = math_vector/* Vector3.Zero */.P.Zero(),max = math_vector/* Vector3.Zero */.P.Zero();let distance;const results = [],pickedPoint = math_vector/* TmpVectors.Vector3.0.copyFromFloats */.jp.Vector3[0].copyFromFloats(0, 0, 0),cameraSpacePosition = math_vector/* TmpVectors.Vector3.1.copyFromFloats */.jp.Vector3[1].copyFromFloats(0, 0, 0),cameraView = camera.getViewMatrix();for (let index = 0; index < count; index++) {const sprite = this.sprites[index];if (sprite) {if (predicate) {if (!predicate(sprite)) continue;} else if (!sprite.isPickable) continue;if (math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(sprite.position, cameraView, cameraSpacePosition), min.copyFromFloats(cameraSpacePosition.x - sprite.width / 2, cameraSpacePosition.y - sprite.height / 2, cameraSpacePosition.z), max.copyFromFloats(cameraSpacePosition.x + sprite.width / 2, cameraSpacePosition.y + sprite.height / 2, cameraSpacePosition.z), ray.intersectsBoxMinMax(min, max)) {if (distance = math_vector/* Vector3.Distance */.P.Distance(cameraSpacePosition, ray.origin), !this._checkTextureAlpha(sprite, ray, distance, min, max)) continue;const result = new Collisions_pickingInfo/* PickingInfo */.p();results.push(result), cameraView.invertToRef(math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]), result.hit = !0, result.pickedSprite = sprite, result.distance = distance;const direction = math_vector/* TmpVectors.Vector3.2 */.jp.Vector3[2];direction.copyFrom(ray.direction), direction.normalize(), direction.scaleInPlace(distance), ray.origin.addToRef(direction, pickedPoint), result.pickedPoint = math_vector/* Vector3.TransformCoordinates */.P.TransformCoordinates(pickedPoint, math_vector/* TmpVectors.Matrix.0 */.jp.Matrix[0]);}}}return results;}render() {if (this._fromPacked && (!this._packedAndReady || !this._spriteMap || !this._cellData)) return;const engine = this._scene.getEngine(),deltaTime = engine.getDeltaTime();this._packedAndReady ? this._spriteRenderer.render(this.sprites, deltaTime, this._scene.getViewMatrix(), this._scene.getProjectionMatrix(), this._customUpdate) : this._spriteRenderer.render(this.sprites, deltaTime, this._scene.getViewMatrix(), this._scene.getProjectionMatrix());}rebuild() {var _a;null === (_a = this._spriteRenderer) || void 0 === _a ? void 0 : _a.rebuild();}dispose() {this._spriteRenderer && (this._spriteRenderer.dispose(), this._spriteRenderer = null), this._textureContent = null;const index = this._scene.spriteManagers.indexOf(this);this._scene.spriteManagers.splice(index, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.metadata = null;}serialize(serializeTexture = !1) {const serializationObject = {};serializationObject.name = this.name, serializationObject.capacity = this.capacity, serializationObject.cellWidth = this.cellWidth, serializationObject.cellHeight = this.cellHeight, this.texture && (serializeTexture ? serializationObject.texture = this.texture.serialize() : (serializationObject.textureUrl = this.texture.name, serializationObject.invertY = this.texture._invertY)), serializationObject.sprites = [];for (const sprite of this.sprites) serializationObject.sprites.push(sprite.serialize());return serializationObject.metadata = this.metadata, serializationObject;}static Parse(parsedManager, scene, rootUrl) {const manager = new SpriteManager(parsedManager.name, "", parsedManager.capacity, { width: parsedManager.cellWidth, height: parsedManager.cellHeight }, scene);parsedManager.metadata !== void 0 && (manager.metadata = parsedManager.metadata), parsedManager.texture ? manager.texture = Textures_texture/* Texture.Parse */.x.Parse(parsedManager.texture, scene, rootUrl) : parsedManager.textureName && (manager.texture = new Textures_texture/* Texture */.x(rootUrl + parsedManager.textureUrl, scene, !1, !(parsedManager.invertY !== void 0) || parsedManager.invertY));for (const parsedSprite of parsedManager.sprites) Sprite.Parse(parsedSprite, manager);return manager;}static ParseFromFileAsync(name, url, scene, rootUrl = "") {return new Promise((resolve, reject) => {const request = new webRequest/* WebRequest */.g();request.addEventListener("readystatechange", () => {if (4 == request.readyState) if (200 == request.status) {const serializationObject = JSON.parse(request.responseText),output = SpriteManager.Parse(serializationObject, scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, rootUrl);name && (output.name = name), resolve(output);} else reject("Unable to load the sprite manager");}), request.open("GET", url), request.send();});}static ParseFromSnippetAsync(snippetId, scene, rootUrl = "") {return "_BLANK" === snippetId ? Promise.resolve(new SpriteManager("Default sprite manager", "//playground.babylonjs.com/textures/player.png", 500, 64, scene)) : new Promise((resolve, reject) => {const request = new webRequest/* WebRequest */.g();request.addEventListener("readystatechange", () => {if (4 == request.readyState) if (200 == request.status) {const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload),serializationObject = JSON.parse(snippet.spriteManager),output = SpriteManager.Parse(serializationObject, scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, rootUrl);output.snippetId = snippetId, resolve(output);} else reject("Unable to load the snippet " + snippetId);}), request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/")), request.send();});}}SpriteManager.SnippetUrl = `https://snippet.babylonjs.com`, SpriteManager.CreateFromSnippetAsync = SpriteManager.ParseFromSnippetAsync;
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/spriteMap.fragment.js
const spriteMap_fragment_name = "spriteMapPixelShader",spriteMap_fragment_shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)
#else
#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)
#endif
precision highp float;
varying vec3 vPosition;
varying vec2 vUV;
varying vec2 tUV;
uniform float time;
uniform float spriteCount;
uniform sampler2D spriteSheet;
uniform vec2 spriteMapSize;
uniform vec2 outputSize;
uniform vec2 stageSize;
uniform sampler2D frameMap;
uniform sampler2D tileMaps[LAYERS];
uniform sampler2D animationMap;
uniform vec3 colorMul;
float mt;
const float fdStep=1./4.;
const float aFrameSteps=1./MAX_ANIMATION_FRAMES;
mat4 getFrameData(float frameID){
float fX=frameID/spriteCount;
return mat4(
texture2D(frameMap,vec2(fX,0.),0.),
texture2D(frameMap,vec2(fX,fdStep*1.),0.),
texture2D(frameMap,vec2(fX,fdStep*2.),0.),
vec4(0.)
);
}
void main(){
vec4 color=vec4(0.);
vec2 tileUV=fract(tUV);
#ifdef FLIPU
tileUV.y=1.0-tileUV.y;
#endif
vec2 tileID=floor(tUV);
vec2 sheetUnits=1./spriteMapSize;
float spriteUnits=1./spriteCount;
vec2 stageUnits=1./stageSize;
for(int i=0; i<LAYERS; i++) {
float frameID;
#define LAYER_ID_SWITCH
vec4 animationData=TEXTUREFUNC(animationMap,vec2((frameID+0.5)/spriteCount,0.),0.);
if(animationData.y>0.) {
mt=mod(time*animationData.z,1.0);
for(float f=0.; f<MAX_ANIMATION_FRAMES; f++){
if(animationData.y>mt){
frameID=animationData.x;
break;
}
animationData=TEXTUREFUNC(animationMap,vec2((frameID+0.5)/spriteCount,aFrameSteps*f),0.);
}
}
mat4 frameData=getFrameData(frameID+0.5);
vec2 frameSize=(frameData[0].zw)/spriteMapSize;
vec2 offset=frameData[0].xy*sheetUnits;
vec2 ratio=frameData[2].xy/frameData[0].zw;
if (frameData[2].z==1.){
tileUV.xy=tileUV.yx;
}
vec4 nc=texture2D(spriteSheet,tileUV*frameSize+offset);
if (i==0){
color=nc;
} else {
float alpha=min(color.a+nc.a,1.0);
vec3 mixed=mix(color.xyz,nc.xyz,nc.a);
color=vec4(mixed,alpha);
}
}
color.xyz*=colorMul;
gl_FragColor=color;
}`;shaderStore/* ShaderStore.ShadersStore.spriteMapPixelShader */.v.ShadersStore.spriteMapPixelShader = spriteMap_fragment_shader;const spriteMapPixelShader = { name: "spriteMapPixelShader", shader: spriteMap_fragment_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Shaders/spriteMap.vertex.js
const spriteMap_vertex_name = "spriteMapVertexShader",spriteMap_vertex_shader = `precision highp float;
attribute vec3 position;
attribute vec3 normal;
attribute vec2 uv;
varying vec3 vPosition;
varying vec2 vUV;
varying vec2 tUV;
varying vec2 stageUnits;
varying vec2 levelUnits;
varying vec2 tileID;
uniform float time;
uniform mat4 worldViewProjection;
uniform vec2 outputSize;
uniform vec2 stageSize;
uniform vec2 spriteMapSize;
uniform float stageScale;
void main() {
vec4 p=vec4( position,1. );
vPosition=p.xyz;
vUV=uv;
tUV=uv*stageSize; 
gl_Position=worldViewProjection*p;
}`;shaderStore/* ShaderStore.ShadersStore.spriteMapVertexShader */.v.ShadersStore.spriteMapVertexShader = spriteMap_vertex_shader;const spriteMapVertexShader = { name: "spriteMapVertexShader", shader: spriteMap_vertex_shader };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Sprites/spriteMap.js
class SpriteMap {get spriteCount() {return this.sprites.length;}get position() {return this._output.position;}set position(v) {this._output.position = v;}get rotation() {return this._output.rotation;}set rotation(v) {this._output.rotation = v;}get animationMap() {return this._animationMap;}set animationMap(v) {const buffer = v._texture._bufferView,am = this._createTileAnimationBuffer(buffer);this._animationMap.dispose(), this._animationMap = am, this._material.setTexture("animationMap", this._animationMap);}constructor(name, atlasJSON, spriteSheet, options, scene) {this.name = name, this.sprites = [], this.atlasJSON = atlasJSON, this.sprites = this.atlasJSON.frames, this.spriteSheet = spriteSheet, this.options = options, options.stageSize = options.stageSize || new math_vector/* Vector2 */.FM(1, 1), options.outputSize = options.outputSize || options.stageSize, options.outputPosition = options.outputPosition || math_vector/* Vector3.Zero */.P.Zero(), options.outputRotation = options.outputRotation || math_vector/* Vector3.Zero */.P.Zero(), options.layerCount = options.layerCount || 1, options.maxAnimationFrames = options.maxAnimationFrames || 0, options.baseTile = options.baseTile || 0, options.flipU = options.flipU || !1, options.colorMultiply = options.colorMultiply || new math_vector/* Vector3 */.P(1, 1, 1), this._scene = scene, this._frameMap = this._createFrameBuffer(), this._tileMaps = [];for (let i = 0; i < options.layerCount; i++) this._tileMaps.push(this._createTileBuffer(null, i));this._animationMap = this._createTileAnimationBuffer(null);const defines = [];defines.push("#define LAYERS " + options.layerCount), options.flipU && defines.push("#define FLIPU"), defines.push(`#define MAX_ANIMATION_FRAMES ${options.maxAnimationFrames}.0`);const shaderString = Materials_effect/* Effect.ShadersStore.spriteMapPixelShader */.Q.ShadersStore.spriteMapPixelShader;let layerSampleString;if (!scene.getEngine()._features.supportSwitchCaseInShader) {layerSampleString = "";for (let i = 0; i < options.layerCount; i++) layerSampleString += `if (${i} == i) { frameID = texture2D(tileMaps[${i}], (tileID + 0.5) / stageSize, 0.).x; }`;} else {layerSampleString = "switch(i) {";for (let i = 0; i < options.layerCount; i++) layerSampleString += "case " + i + " : frameID = texture(tileMaps[" + i + "], (tileID + 0.5) / stageSize, 0.).x;", layerSampleString += "break;";layerSampleString += "}";}Materials_effect/* Effect.ShadersStore */.Q.ShadersStore["spriteMap" + this.name + "PixelShader"] = shaderString.replace("#define LAYER_ID_SWITCH", layerSampleString), this._material = new shaderMaterial/* ShaderMaterial */.j("spriteMap:" + this.name, this._scene, { vertex: "spriteMap", fragment: "spriteMap" + this.name }, { defines, attributes: ["position", "normal", "uv"], uniforms: ["worldViewProjection", "time", "stageSize", "outputSize", "spriteMapSize", "spriteCount", "time", "colorMul", "mousePosition", "curTile", "flipU"], samplers: ["spriteSheet", "frameMap", "tileMaps", "animationMap"], needAlphaBlending: !0 }), this._time = 0, this._material.setFloat("spriteCount", this.spriteCount), this._material.setVector2("stageSize", options.stageSize), this._material.setVector2("outputSize", options.outputSize), this._material.setTexture("spriteSheet", this.spriteSheet), this._material.setVector2("spriteMapSize", new math_vector/* Vector2 */.FM(1, 1)), this._material.setVector3("colorMul", options.colorMultiply);let tickSave = 0;const bindSpriteTexture = () => this.spriteSheet && this.spriteSheet.isReady() && this.spriteSheet._texture ? void this._material.setVector2("spriteMapSize", new math_vector/* Vector2 */.FM(this.spriteSheet._texture.baseWidth || 1, this.spriteSheet._texture.baseHeight || 1)) : void (100 > tickSave && setTimeout(() => {tickSave++, bindSpriteTexture();}, 100));bindSpriteTexture(), this._material.setVector3("colorMul", options.colorMultiply), this._material.setTexture("frameMap", this._frameMap), this._material.setTextureArray("tileMaps", this._tileMaps), this._material.setTexture("animationMap", this._animationMap), this._material.setFloat("time", this._time), this._output = CreatePlane(name + ":output", { size: 1, updatable: !0 }, scene), this._output.scaling.x = options.outputSize.x, this._output.scaling.y = options.outputSize.y, this.position = options.outputPosition, this.rotation = options.outputRotation;const obfunction = () => {this._time += this._scene.getEngine().getDeltaTime(), this._material.setFloat("time", this._time);};this._scene.onBeforeRenderObservable.add(obfunction), this._output.material = this._material;}getTileID() {const p = this.getMousePosition();return p.multiplyInPlace(this.options.stageSize || math_vector/* Vector2.Zero */.FM.Zero()), p.x = Math.floor(p.x), p.y = Math.floor(p.y), p;}getMousePosition() {const out = this._output,pickinfo = this._scene.pick(this._scene.pointerX, this._scene.pointerY, (mesh) => mesh === out);if (!pickinfo || !pickinfo.hit || !pickinfo.getTextureCoordinates) return new math_vector/* Vector2 */.FM(-1, -1);const coords = pickinfo.getTextureCoordinates();return coords ? coords : new math_vector/* Vector2 */.FM(-1, -1);}_createFrameBuffer() {const data = [];for (let i = 0; i < this.spriteCount; i++) data.push(0, 0, 0, 0), data.push(0, 0, 0, 0), data.push(0, 0, 0, 0), data.push(0, 0, 0, 0);for (let i = 0; i < this.spriteCount; i++) {const f = this.sprites[i].frame,sss = this.sprites[i].spriteSourceSize,ss = this.sprites[i].sourceSize,r = this.sprites[i].rotated ? 1 : 0,t = this.sprites[i].trimmed ? 1 : 0;data[4 * i] = f.x, data[4 * i + 1] = f.y, data[4 * i + 2] = f.w, data[4 * i + 3] = f.h, data[4 * i + 4 * this.spriteCount] = sss.x, data[4 * i + 1 + 4 * this.spriteCount] = sss.y, data[4 * i + 3 + 4 * this.spriteCount] = sss.h, data[4 * i + 8 * this.spriteCount] = ss.w, data[4 * i + 1 + 8 * this.spriteCount] = ss.h, data[4 * i + 2 + 8 * this.spriteCount] = r, data[4 * i + 3 + 8 * this.spriteCount] = t;}const floatArray = new Float32Array(data),t = rawTexture/* RawTexture.CreateRGBATexture */.l.CreateRGBATexture(floatArray, this.spriteCount, 4, this._scene, !1, !1, Textures_texture/* Texture.NEAREST_NEAREST */.x.NEAREST_NEAREST, engine/* Engine.TEXTURETYPE_FLOAT */.D.TEXTURETYPE_FLOAT);return t;}_createTileBuffer(buffer, _layer = 0) {let data = [];const _ty = this.options.stageSize.y || 0,_tx = this.options.stageSize.x || 0;if (!buffer) {let bt = this.options.baseTile;0 != _layer && (bt = 0);for (let y = 0; y < _ty; y++) for (let x = 0; x < 4 * _tx; x += 4) data.push(bt, 0, 0, 0);} else data = buffer;const floatArray = new Float32Array(data),t = rawTexture/* RawTexture.CreateRGBATexture */.l.CreateRGBATexture(floatArray, _tx, _ty, this._scene, !1, !1, Textures_texture/* Texture.NEAREST_NEAREST */.x.NEAREST_NEAREST, engine/* Engine.TEXTURETYPE_FLOAT */.D.TEXTURETYPE_FLOAT);return t;}changeTiles(_layer = 0, pos, tile = 0) {const buffer = this._tileMaps[_layer]._texture._bufferView;if (null === buffer) return;let p = [];pos instanceof math_vector/* Vector2 */.FM ? p.push(pos) : p = pos;const _tx = this.options.stageSize.x || 0;for (let i = 0; i < p.length; i++) {const _p = p[i];_p.x = Math.floor(_p.x), _p.y = Math.floor(_p.y);const id = 4 * _p.x + _p.y * (4 * _tx);buffer[id] = tile;}const t = this._createTileBuffer(buffer);this._tileMaps[_layer].dispose(), this._tileMaps[_layer] = t, this._material.setTextureArray("tileMap", this._tileMaps);}_createTileAnimationBuffer(buffer) {const data = [];let floatArray;if (!buffer) {for (let i = 0; i < this.spriteCount; i++) {data.push(0, 0, 0, 0);for (let count = 1; count < (this.options.maxAnimationFrames || 4);) data.push(0, 0, 0, 0), count++;}floatArray = new Float32Array(data);} else floatArray = buffer;const t = rawTexture/* RawTexture.CreateRGBATexture */.l.CreateRGBATexture(floatArray, this.spriteCount, this.options.maxAnimationFrames || 4, this._scene, !1, !1, Textures_texture/* Texture.NEAREST_NEAREST */.x.NEAREST_NEAREST, engine/* Engine.TEXTURETYPE_FLOAT */.D.TEXTURETYPE_FLOAT);return t;}addAnimationToTile(cellID = 0, _frame = 0, toCell = 0, time = 0, speed = 1) {const buffer = this._animationMap._texture._bufferView,id = 4 * cellID + 4 * this.spriteCount * _frame;if (buffer) {buffer[id] = toCell, buffer[id + 1] = time, buffer[id + 2] = speed;const t = this._createTileAnimationBuffer(buffer);this._animationMap.dispose(), this._animationMap = t, this._material.setTexture("animationMap", this._animationMap);}}saveTileMaps() {let maps = "";for (let i = 0; i < this._tileMaps.length; i++) 0 < i && (maps += "\n\r"), maps += this._tileMaps[i]._texture._bufferView.toString();const hiddenElement = document.createElement("a");hiddenElement.href = "data:octet/stream;charset=utf-8," + encodeURI(maps), hiddenElement.target = "_blank", hiddenElement.download = this.name + ".tilemaps", hiddenElement.click(), hiddenElement.remove();}loadTileMaps(url) {const xhr = new XMLHttpRequest();xhr.open("GET", url);const _lc = this.options.layerCount || 0;xhr.onload = () => {const data = xhr.response.split("\n\r");for (let i = 0; i < _lc; i++) {const d = data[i].split(",").map(Number),t = this._createTileBuffer(d);this._tileMaps[i].dispose(), this._tileMaps[i] = t;}this._material.setTextureArray("tileMap", this._tileMaps);}, xhr.send();}dispose() {this._output.dispose(), this._material.dispose(), this._animationMap.dispose(), this._tileMaps.forEach((tm) => {tm.dispose();}), this._frameMap.dispose();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Sprites/spritePackedManager.js
class SpritePackedManager extends SpriteManager {constructor(name, imgUrl, capacity, scene, spriteJSON = null, epsilon = .01, samplingMode = Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE) {super(name, imgUrl, capacity, 64, scene, epsilon, samplingMode, !0, spriteJSON), this.name = name;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Sprites/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/alphaCullingState.js
var alphaCullingState = __webpack_require__("./node_modules/@babylonjs/core/States/alphaCullingState.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/stencilState.js
var stencilState = __webpack_require__("./node_modules/@babylonjs/core/States/stencilState.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/States/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/andOrNotEvaluator.js
var andOrNotEvaluator = __webpack_require__("./node_modules/@babylonjs/core/Misc/andOrNotEvaluator.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/assetsManager.js
var AssetTaskState;(function (AssetTaskState) {AssetTaskState[AssetTaskState.INIT = 0] = "INIT", AssetTaskState[AssetTaskState.RUNNING = 1] = "RUNNING", AssetTaskState[AssetTaskState.DONE = 2] = "DONE", AssetTaskState[AssetTaskState.ERROR = 3] = "ERROR";})(AssetTaskState || (AssetTaskState = {}));class AbstractAssetTask {constructor(name) {this.name = name, this._isCompleted = !1, this._taskState = AssetTaskState.INIT;}get isCompleted() {return this._isCompleted;}get taskState() {return this._taskState;}get errorObject() {return this._errorObject;}_setErrorObject(message, exception) {this._errorObject || (this._errorObject = { message: message, exception: exception });}run(scene, onSuccess, onError) {this._taskState = AssetTaskState.RUNNING, this.runTask(scene, () => {this._onDoneCallback(onSuccess, onError);}, (msg, exception) => {this._onErrorCallback(onError, msg, exception);});}runTask() {throw new Error("runTask is not implemented");}reset() {this._taskState = AssetTaskState.INIT;}_onErrorCallback(onError, message, exception) {this._taskState = AssetTaskState.ERROR, this._errorObject = { message: message, exception: exception }, this.onError && this.onError(this, message, exception), onError();}_onDoneCallback(onSuccess, onError) {try {this._taskState = AssetTaskState.DONE, this._isCompleted = !0, this.onSuccess && this.onSuccess(this), onSuccess();} catch (e) {this._onErrorCallback(onError, "Task is done, error executing success callback(s)", e);}}}class AssetsProgressEvent {constructor(remainingCount, totalCount, task) {this.remainingCount = remainingCount, this.totalCount = totalCount, this.task = task;}}class ContainerAssetTask extends AbstractAssetTask {constructor(name, meshesNames, rootUrl, sceneFilename, extension) {super(name), this.name = name, this.meshesNames = meshesNames, this.rootUrl = rootUrl, this.sceneFilename = sceneFilename, this.extension = extension;}runTask(scene, onSuccess, onError) {sceneLoader/* SceneLoader.LoadAssetContainer */.n.LoadAssetContainer(this.rootUrl, this.sceneFilename, scene, (container) => {this.loadedContainer = container, this.loadedMeshes = container.meshes, this.loadedTransformNodes = container.transformNodes, this.loadedParticleSystems = container.particleSystems, this.loadedSkeletons = container.skeletons, this.loadedAnimationGroups = container.animationGroups, onSuccess();}, null, (scene, message, exception) => {onError(message, exception);}, this.extension);}}class MeshAssetTask extends AbstractAssetTask {constructor(name, meshesNames, rootUrl, sceneFilename, extension) {super(name), this.name = name, this.meshesNames = meshesNames, this.rootUrl = rootUrl, this.sceneFilename = sceneFilename, this.extension = extension;}runTask(scene, onSuccess, onError) {sceneLoader/* SceneLoader.ImportMesh */.n.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, scene, (meshes, particleSystems, skeletons, animationGroups, transformNodes) => {this.loadedMeshes = meshes, this.loadedTransformNodes = transformNodes, this.loadedParticleSystems = particleSystems, this.loadedSkeletons = skeletons, this.loadedAnimationGroups = animationGroups, onSuccess();}, null, (scene, message, exception) => {onError(message, exception);}, this.extension);}}class TextFileAssetTask extends AbstractAssetTask {constructor(name, url) {super(name), this.name = name, this.url = url;}runTask(scene, onSuccess, onError) {scene._loadFile(this.url, (data) => {this.text = data, onSuccess();}, void 0, !1, !1, (request, exception) => {request && onError(request.status + " " + request.statusText, exception);});}}class BinaryFileAssetTask extends AbstractAssetTask {constructor(name, url) {super(name), this.name = name, this.url = url;}runTask(scene, onSuccess, onError) {scene._loadFile(this.url, (data) => {this.data = data, onSuccess();}, void 0, !0, !0, (request, exception) => {request && onError(request.status + " " + request.statusText, exception);});}}class ImageAssetTask extends AbstractAssetTask {constructor(name, url) {super(name), this.name = name, this.url = url;}runTask(scene, onSuccess, onError) {const img = new Image();tools/* Tools.SetCorsBehavior */.w1.SetCorsBehavior(this.url, img), img.onload = () => {this.image = img, onSuccess();}, img.onerror = (err) => {onError("Error loading image", err);}, img.src = this.url;}}class TextureAssetTask extends AbstractAssetTask {constructor(name, url, noMipmap, invertY = !0, samplingMode = Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE) {super(name), this.name = name, this.url = url, this.noMipmap = noMipmap, this.invertY = invertY, this.samplingMode = samplingMode;}runTask(scene, onSuccess, onError) {this.texture = new Textures_texture/* Texture */.x(this.url, scene, this.noMipmap, this.invertY, this.samplingMode, () => {onSuccess();}, (message, exception) => {onError(message, exception);});}}class CubeTextureAssetTask extends AbstractAssetTask {constructor(name, url, extensions, noMipmap, files, prefiltered) {super(name), this.name = name, this.url = url, this.extensions = extensions, this.noMipmap = noMipmap, this.files = files, this.prefiltered = prefiltered;}runTask(scene, onSuccess, onError) {this.texture = new Textures_cubeTexture/* CubeTexture */.B(this.url, scene, this.extensions, this.noMipmap, this.files, () => {onSuccess();}, (message, exception) => {onError(message, exception);}, void 0, this.prefiltered);}}class HDRCubeTextureAssetTask extends AbstractAssetTask {constructor(name, url, size, noMipmap = !1, generateHarmonics = !0, gammaSpace = !1, reserved = !1) {super(name), this.name = name, this.url = url, this.size = size, this.noMipmap = noMipmap, this.generateHarmonics = generateHarmonics, this.gammaSpace = gammaSpace, this.reserved = reserved;}runTask(scene, onSuccess, onError) {this.texture = new HDRCubeTexture(this.url, scene, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, () => {onSuccess();}, (message, exception) => {onError(message, exception);});}}class EquiRectangularCubeTextureAssetTask extends AbstractAssetTask {constructor(name, url, size, noMipmap = !1, gammaSpace = !0) {super(name), this.name = name, this.url = url, this.size = size, this.noMipmap = noMipmap, this.gammaSpace = gammaSpace;}runTask(scene, onSuccess, onError) {this.texture = new EquiRectangularCubeTexture(this.url, scene, this.size, this.noMipmap, this.gammaSpace, () => {onSuccess();}, (message, exception) => {onError(message, exception);});}}class AssetsManager {constructor(scene) {this._isLoading = !1, this._tasks = [], this._waitingTasksCount = 0, this._totalTasksCount = 0, this.onTaskSuccessObservable = new observable/* Observable */.y$(), this.onTaskErrorObservable = new observable/* Observable */.y$(), this.onTasksDoneObservable = new observable/* Observable */.y$(), this.onProgressObservable = new observable/* Observable */.y$(), this.useDefaultLoadingScreen = !0, this.autoHideLoadingUI = !0, this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;}addContainerTask(taskName, meshesNames, rootUrl, sceneFilename, extension) {const task = new ContainerAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);return this._tasks.push(task), task;}addMeshTask(taskName, meshesNames, rootUrl, sceneFilename, extension) {const task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);return this._tasks.push(task), task;}addTextFileTask(taskName, url) {const task = new TextFileAssetTask(taskName, url);return this._tasks.push(task), task;}addBinaryFileTask(taskName, url) {const task = new BinaryFileAssetTask(taskName, url);return this._tasks.push(task), task;}addImageTask(taskName, url) {const task = new ImageAssetTask(taskName, url);return this._tasks.push(task), task;}addTextureTask(taskName, url, noMipmap, invertY, samplingMode = Textures_texture/* Texture.TRILINEAR_SAMPLINGMODE */.x.TRILINEAR_SAMPLINGMODE) {const task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode);return this._tasks.push(task), task;}addCubeTextureTask(taskName, url, extensions, noMipmap, files, prefiltered) {const task = new CubeTextureAssetTask(taskName, url, extensions, noMipmap, files, prefiltered);return this._tasks.push(task), task;}addHDRCubeTextureTask(taskName, url, size, noMipmap = !1, generateHarmonics = !0, gammaSpace = !1, reserved = !1) {const task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, gammaSpace, reserved);return this._tasks.push(task), task;}addEquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap = !1, gammaSpace = !0) {const task = new EquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap, gammaSpace);return this._tasks.push(task), task;}removeTask(task) {const index = this._tasks.indexOf(task);-1 < index && this._tasks.splice(index, 1);}_decreaseWaitingTasksCount(task) {this._waitingTasksCount--;try {this.onProgress && this.onProgress(this._waitingTasksCount, this._totalTasksCount, task), this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this._waitingTasksCount, this._totalTasksCount, task));} catch (e) {logger/* Logger.Error */.Y.Error("Error running progress callbacks."), console.log(e);}if (0 === this._waitingTasksCount) {try {const currentTasks = this._tasks.slice();this.onFinish && this.onFinish(currentTasks);for (const task of currentTasks) if (task.taskState === AssetTaskState.DONE) {const index = this._tasks.indexOf(task);-1 < index && this._tasks.splice(index, 1);}this.onTasksDoneObservable.notifyObservers(this._tasks);} catch (e) {logger/* Logger.Error */.Y.Error("Error running tasks-done callbacks."), console.log(e);}this._isLoading = !1, this.autoHideLoadingUI && this._scene.getEngine().hideLoadingUI();}}_runTask(task) {const done = () => {try {this.onTaskSuccess && this.onTaskSuccess(task), this.onTaskSuccessObservable.notifyObservers(task), this._decreaseWaitingTasksCount(task);} catch (e) {error("Error executing task success callbacks", e);}},error = (message, exception) => {task._setErrorObject(message, exception), this.onTaskError ? this.onTaskError(task) : !task.onError && logger/* Logger.Error */.Y.Error(this._formatTaskErrorMessage(task)), this.onTaskErrorObservable.notifyObservers(task), this._decreaseWaitingTasksCount(task);};task.run(this._scene, done, error);}_formatTaskErrorMessage(task) {let errorMessage = "Unable to complete task " + task.name;return task.errorObject.message && (errorMessage += `: ${task.errorObject.message}`), task.errorObject.exception && (errorMessage += `: ${task.errorObject.exception}`), errorMessage;}reset() {return this._isLoading = !1, this._tasks = [], this;}load() {if (this._isLoading) return this;if (this._isLoading = !0, this._waitingTasksCount = this._tasks.length, this._totalTasksCount = this._tasks.length, 0 === this._waitingTasksCount) return this._isLoading = !1, this.onFinish && this.onFinish(this._tasks), this.onTasksDoneObservable.notifyObservers(this._tasks), this;this.useDefaultLoadingScreen && this._scene.getEngine().displayLoadingUI();for (let index = 0; index < this._tasks.length; index++) {const task = this._tasks[index];task.taskState === AssetTaskState.INIT && this._runTask(task);}return this;}loadAsync() {return new Promise((resolve, reject) => this._isLoading ? void resolve() : void (this.onTasksDoneObservable.addOnce((remainingTasks) => {remainingTasks && remainingTasks.length ? reject(remainingTasks) : resolve();}), this.load()));}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/deferred.js
var deferred = __webpack_require__("./node_modules/@babylonjs/core/Misc/deferred.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/meshExploder.js
class MeshExploder {constructor(meshes, centerMesh) {this._meshesOrigins = [], this._toCenterVectors = [], this._scaledDirection = new math_vector/* Vector3 */.P(1, 1, 1), this._newPosition = math_vector/* Vector3.Zero */.P.Zero(), this._centerPosition = math_vector/* Vector3.Zero */.P.Zero(), this._meshes = meshes.slice(), centerMesh ? this._centerMesh = centerMesh : this._setCenterMesh(), this._centerMesh.computeWorldMatrix(!0);const centerMeshIndex = this._meshes.indexOf(this._centerMesh);0 <= centerMeshIndex && this._meshes.splice(centerMeshIndex, 1), this._centerPosition = this._centerMesh.getAbsolutePosition().clone();for (let index = 0; index < this._meshes.length; index++) if (this._meshes[index]) {const mesh = this._meshes[index];this._meshesOrigins[index] = mesh.getAbsolutePosition().clone(), this._toCenterVectors[index] = math_vector/* Vector3.Zero */.P.Zero(), mesh.hasBoundingInfo && this._centerMesh.hasBoundingInfo && (mesh.computeWorldMatrix(!0), mesh.getBoundingInfo().boundingBox.centerWorld.subtractToRef(this._centerMesh.getBoundingInfo().boundingBox.centerWorld, this._toCenterVectors[index]));}}_setCenterMesh() {let averageCenter = math_vector/* Vector3.Zero */.P.Zero();const totalCenters = math_vector/* Vector3.Zero */.P.Zero();let shortestToCenter = Number.MAX_VALUE;for (let index = 0; index < this._meshes.length; index++) if (this._meshes[index]) {const mesh = this._meshes[index],boundingInfo = mesh.getBoundingInfo();boundingInfo && totalCenters.addInPlace(boundingInfo.boundingBox.centerWorld);}averageCenter = totalCenters.scale(1 / this._meshes.length);for (let index = 0; index < this._meshes.length; index++) if (this._meshes[index]) {const mesh = this._meshes[index],boundingInfo = mesh.getBoundingInfo();if (boundingInfo) {const distanceToCenter = boundingInfo.boundingBox.centerWorld.subtract(averageCenter).lengthSquared();distanceToCenter < shortestToCenter && (this._centerMesh = mesh, shortestToCenter = distanceToCenter);}}}getClassName() {return "MeshExploder";}getMeshes() {const meshArray = this._meshes.slice();return meshArray.unshift(this._centerMesh), meshArray;}explode(direction = 1) {for (let index = 0; index < this._meshes.length; index++) this._meshes[index] && this._meshesOrigins[index] && this._toCenterVectors[index] && (this._toCenterVectors[index].scaleToRef(direction, this._scaledDirection), this._meshesOrigins[index].addToRef(this._scaledDirection, this._newPosition), this._meshes[index].setAbsolutePosition(this._newPosition));this._centerMesh.setAbsolutePosition(this._centerPosition);}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/filesInputStore.js
var filesInputStore = __webpack_require__("./node_modules/@babylonjs/core/Misc/filesInputStore.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/filesInput.js
class FilesInput {static get FilesToLoad() {return filesInputStore/* FilesInputStore.FilesToLoad */.X.FilesToLoad;}constructor(engine, scene, sceneLoadedCallback, progressCallback, additionalRenderLoopLogicCallback, textureLoadingCallback, startingProcessingFilesCallback, onReloadCallback, errorCallback) {this.onProcessFileCallback = () => !0, this.loadAsync = (sceneFile, onProgress) => sceneLoader/* SceneLoader.LoadAsync */.n.LoadAsync("file:", sceneFile, this._engine, onProgress), this._engine = engine, this._currentScene = scene, this._sceneLoadedCallback = sceneLoadedCallback, this._progressCallback = progressCallback, this._additionalRenderLoopLogicCallback = additionalRenderLoopLogicCallback, this._textureLoadingCallback = textureLoadingCallback, this._startingProcessingFilesCallback = startingProcessingFilesCallback, this._onReloadCallback = onReloadCallback, this._errorCallback = errorCallback;}monitorElementForDragNDrop(elementToMonitor) {elementToMonitor && (this._elementToMonitor = elementToMonitor, this._dragEnterHandler = (e) => {this._drag(e);}, this._dragOverHandler = (e) => {this._drag(e);}, this._dropHandler = (e) => {this._drop(e);}, this._elementToMonitor.addEventListener("dragenter", this._dragEnterHandler, !1), this._elementToMonitor.addEventListener("dragover", this._dragOverHandler, !1), this._elementToMonitor.addEventListener("drop", this._dropHandler, !1));}get filesToLoad() {return this._filesToLoad;}dispose() {this._elementToMonitor && (this._elementToMonitor.removeEventListener("dragenter", this._dragEnterHandler), this._elementToMonitor.removeEventListener("dragover", this._dragOverHandler), this._elementToMonitor.removeEventListener("drop", this._dropHandler));}_renderFunction() {if (this._additionalRenderLoopLogicCallback && this._additionalRenderLoopLogicCallback(), this._currentScene) {if (this._textureLoadingCallback) {const remaining = this._currentScene.getWaitingItemsCount();0 < remaining && this._textureLoadingCallback(remaining);}this._currentScene.render();}}_drag(e) {e.stopPropagation(), e.preventDefault();}_drop(eventDrop) {eventDrop.stopPropagation(), eventDrop.preventDefault(), this.loadFiles(eventDrop);}_traverseFolder(folder, files, remaining, callback) {const reader = folder.createReader(),relativePath = folder.fullPath.replace(/^\//, "").replace(/(.+?)\/?$/, "$1/");reader.readEntries((entries) => {remaining.count += entries.length;for (const entry of entries) entry.isFile ? entry.file((file) => {file.correctName = relativePath + file.name, files.push(file), 0 == --remaining.count && callback();}) : entry.isDirectory && this._traverseFolder(entry, files, remaining, callback);0 == --remaining.count && callback();});}_processFiles(files) {for (let i = 0; i < files.length; i++) {const name = files[i].correctName.toLowerCase(),extension = name.split(".").pop();this.onProcessFileCallback(files[i], name, extension, (sceneFile) => this._sceneFileToLoad = sceneFile) && (sceneLoader/* SceneLoader.IsPluginForExtensionAvailable */.n.IsPluginForExtensionAvailable("." + extension) && (this._sceneFileToLoad = files[i]), FilesInput.FilesToLoad[name] = files[i]);}}loadFiles(event) {if ((event && event.dataTransfer && event.dataTransfer.files && (this._filesToLoad = event.dataTransfer.files), event && event.target && event.target.files && (this._filesToLoad = event.target.files), this._filesToLoad && 0 !== this._filesToLoad.length) && (this._startingProcessingFilesCallback && this._startingProcessingFilesCallback(this._filesToLoad), this._filesToLoad && 0 < this._filesToLoad.length)) {const files = [],folders = [],items = event.dataTransfer ? event.dataTransfer.items : null;for (let i = 0; i < this._filesToLoad.length; i++) {const fileToLoad = this._filesToLoad[i],name = fileToLoad.name.toLowerCase();let entry;if (fileToLoad.correctName = name, items) {const item = items[i];item.getAsEntry ? entry = item.getAsEntry() : item.webkitGetAsEntry && (entry = item.webkitGetAsEntry());}entry ? entry.isDirectory ? folders.push(entry) : files.push(fileToLoad) : files.push(fileToLoad);}if (0 === folders.length) this._processFiles(files), this._processReload();else {const remaining = { count: folders.length };for (const folder of folders) this._traverseFolder(folder, files, remaining, () => {this._processFiles(files), 0 === remaining.count && this._processReload();});}}}_processReload() {this._onReloadCallback ? this._onReloadCallback(this._sceneFileToLoad) : this.reload();}reload() {this._sceneFileToLoad ? (this._currentScene && (0 < logger/* Logger.errorsCount */.Y.errorsCount && logger/* Logger.ClearLogCache */.Y.ClearLogCache(), this._engine.stopRenderLoop()), sceneLoader/* SceneLoader.ShowLoadingScreen */.n.ShowLoadingScreen = !1, this._engine.displayLoadingUI(), this.loadAsync(this._sceneFileToLoad, this._progressCallback).then((scene) => {this._currentScene && this._currentScene.dispose(), this._currentScene = scene, this._sceneLoadedCallback && this._sceneLoadedCallback(this._sceneFileToLoad, this._currentScene), this._currentScene.executeWhenReady(() => {this._engine.hideLoadingUI(), this._engine.runRenderLoop(() => {this._renderFunction();});});}).catch((error) => {this._engine.hideLoadingUI(), this._errorCallback && this._errorCallback(this._sceneFileToLoad, this._currentScene, error.message);})) : logger/* Logger.Error */.Y.Error("Please provide a valid .babylon file.");}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/HighDynamicRange/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/observable.extensions.js
class MultiObserver {dispose() {if (this._observers && this._observables) for (let index = 0; index < this._observers.length; index++) this._observables[index].remove(this._observers[index]);this._observers = null, this._observables = null;}static Watch(observables, callback, mask = -1, scope = null) {const result = new MultiObserver();result._observers = [], result._observables = observables;for (const observable of observables) {const observer = observable.add(callback, mask, !1, scope);observer && result._observers.push(observer);}return result;}}observable/* Observable.prototype.notifyObserversWithPromise */.y$.prototype.notifyObserversWithPromise = async function (eventData, mask = -1, target, currentTarget, userInfo) {let p = Promise.resolve(eventData);if (!this.observers.length) return p;const state = this._eventState;return state.mask = mask, state.target = target, state.currentTarget = currentTarget, state.skipNextObservers = !1, state.userInfo = userInfo, this.observers.forEach((obs) => {state.skipNextObservers || obs._willBeUnregistered || obs.mask & mask && (p = obs.scope ? p.then((lastReturnedValue) => (state.lastReturnValue = lastReturnedValue, obs.callback.apply(obs.scope, [eventData, state]))) : p.then((lastReturnedValue) => (state.lastReturnValue = lastReturnedValue, obs.callback(eventData, state))), obs.unregisterOnNextCall && this._deferUnregister(obs));}), await p, eventData;};
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/performanceMonitor.js
var performanceMonitor = __webpack_require__("./node_modules/@babylonjs/core/Misc/performanceMonitor.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/sceneOptimizer.js
class SceneOptimization {getDescription() {return "";}apply() {return !0;}constructor(priority = 0) {this.priority = priority;}}class TextureOptimization extends SceneOptimization {getDescription() {return "Reducing render target texture size to " + this.maximumSize;}constructor(priority = 0, maximumSize = 1024, step = .5) {super(priority), this.priority = priority, this.maximumSize = maximumSize, this.step = step;}apply(scene) {let allDone = !0;for (let index = 0; index < scene.textures.length; index++) {const texture = scene.textures[index];if (!texture.canRescale || texture.getContext) continue;const currentSize = texture.getSize(),maxDimension = Math.max(currentSize.width, currentSize.height);maxDimension > this.maximumSize && (texture.scale(this.step), allDone = !1);}return allDone;}}class HardwareScalingOptimization extends SceneOptimization {getDescription() {return "Setting hardware scaling level to " + this._currentScale;}constructor(priority = 0, maximumScale = 2, step = .25) {super(priority), this.priority = priority, this.maximumScale = maximumScale, this.step = step, this._currentScale = -1, this._directionOffset = 1;}apply(scene) {return -1 === this._currentScale && (this._currentScale = scene.getEngine().getHardwareScalingLevel(), this._currentScale > this.maximumScale && (this._directionOffset = -1)), this._currentScale += this._directionOffset * this.step, scene.getEngine().setHardwareScalingLevel(this._currentScale), 1 === this._directionOffset ? this._currentScale >= this.maximumScale : this._currentScale <= this.maximumScale;}}class ShadowsOptimization extends SceneOptimization {getDescription() {return "Turning shadows on/off";}apply(scene, optimizer) {return scene.shadowsEnabled = optimizer.isInImprovementMode, !0;}}class PostProcessesOptimization extends SceneOptimization {getDescription() {return "Turning post-processes on/off";}apply(scene, optimizer) {return scene.postProcessesEnabled = optimizer.isInImprovementMode, !0;}}class LensFlaresOptimization extends SceneOptimization {getDescription() {return "Turning lens flares on/off";}apply(scene, optimizer) {return scene.lensFlaresEnabled = optimizer.isInImprovementMode, !0;}}class CustomOptimization extends SceneOptimization {getDescription() {return this.onGetDescription ? this.onGetDescription() : "Running user defined callback";}apply(scene, optimizer) {return !this.onApply || this.onApply(scene, optimizer);}}class ParticlesOptimization extends SceneOptimization {getDescription() {return "Turning particles on/off";}apply(scene, optimizer) {return scene.particlesEnabled = optimizer.isInImprovementMode, !0;}}class RenderTargetsOptimization extends SceneOptimization {getDescription() {return "Turning render targets off";}apply(scene, optimizer) {return scene.renderTargetsEnabled = optimizer.isInImprovementMode, !0;}}class MergeMeshesOptimization extends SceneOptimization {constructor() {super(...arguments), this._canBeMerged = (abstractMesh) => {if (!(abstractMesh instanceof Meshes_mesh/* Mesh */.Kj)) return !1;const mesh = abstractMesh;return !mesh.isDisposed() && !!(mesh.isVisible && mesh.isEnabled()) && !(0 < mesh.instances.length) && !(mesh.skeleton || mesh.hasLODLevels);};}static get UpdateSelectionTree() {return MergeMeshesOptimization._UpdateSelectionTree;}static set UpdateSelectionTree(value) {MergeMeshesOptimization._UpdateSelectionTree = value;}getDescription() {return "Merging similar meshes together";}apply(scene, optimizer, updateSelectionTree) {const globalPool = scene.meshes.slice(0);let globalLength = globalPool.length;for (let index = 0; index < globalLength; index++) {const currentPool = [],current = globalPool[index];if (this._canBeMerged(current)) {currentPool.push(current);for (let subIndex = index + 1; subIndex < globalLength; subIndex++) {const otherMesh = globalPool[subIndex];this._canBeMerged(otherMesh) && otherMesh.material === current.material && otherMesh.checkCollisions === current.checkCollisions && (currentPool.push(otherMesh), globalLength--, globalPool.splice(subIndex, 1), subIndex--);}2 > currentPool.length || Meshes_mesh/* Mesh.MergeMeshes */.Kj.MergeMeshes(currentPool, void 0, !0);}}const sceneAsAny = scene;return sceneAsAny.createOrUpdateSelectionOctree && (null == updateSelectionTree ? MergeMeshesOptimization.UpdateSelectionTree && sceneAsAny.createOrUpdateSelectionOctree() : updateSelectionTree && sceneAsAny.createOrUpdateSelectionOctree()), !0;}}MergeMeshesOptimization._UpdateSelectionTree = !1;class SceneOptimizerOptions {constructor(targetFrameRate = 60, trackerDuration = 2e3) {this.targetFrameRate = targetFrameRate, this.trackerDuration = trackerDuration, this.optimizations = [];}addOptimization(optimization) {return this.optimizations.push(optimization), this;}addCustomOptimization(onApply, onGetDescription, priority = 0) {const optimization = new CustomOptimization(priority);return optimization.onApply = onApply, optimization.onGetDescription = onGetDescription, this.optimizations.push(optimization), this;}static LowDegradationAllowed(targetFrameRate) {const result = new SceneOptimizerOptions(targetFrameRate);let priority = 0;return result.addOptimization(new MergeMeshesOptimization(priority)), result.addOptimization(new ShadowsOptimization(priority)), result.addOptimization(new LensFlaresOptimization(priority)), priority++, result.addOptimization(new PostProcessesOptimization(priority)), result.addOptimization(new ParticlesOptimization(priority)), priority++, result.addOptimization(new TextureOptimization(priority, 1024)), result;}static ModerateDegradationAllowed(targetFrameRate) {const result = new SceneOptimizerOptions(targetFrameRate);let priority = 0;return result.addOptimization(new MergeMeshesOptimization(priority)), result.addOptimization(new ShadowsOptimization(priority)), result.addOptimization(new LensFlaresOptimization(priority)), priority++, result.addOptimization(new PostProcessesOptimization(priority)), result.addOptimization(new ParticlesOptimization(priority)), priority++, result.addOptimization(new TextureOptimization(priority, 512)), priority++, result.addOptimization(new RenderTargetsOptimization(priority)), priority++, result.addOptimization(new HardwareScalingOptimization(priority, 2)), result;}static HighDegradationAllowed(targetFrameRate) {const result = new SceneOptimizerOptions(targetFrameRate);let priority = 0;return result.addOptimization(new MergeMeshesOptimization(priority)), result.addOptimization(new ShadowsOptimization(priority)), result.addOptimization(new LensFlaresOptimization(priority)), priority++, result.addOptimization(new PostProcessesOptimization(priority)), result.addOptimization(new ParticlesOptimization(priority)), priority++, result.addOptimization(new TextureOptimization(priority, 256)), priority++, result.addOptimization(new RenderTargetsOptimization(priority)), priority++, result.addOptimization(new HardwareScalingOptimization(priority, 4)), result;}}class SceneOptimizer {get isInImprovementMode() {return this._improvementMode;}set isInImprovementMode(value) {this._improvementMode = value;}get currentPriorityLevel() {return this._currentPriorityLevel;}get currentFrameRate() {return this._currentFrameRate;}get targetFrameRate() {return this._targetFrameRate;}set targetFrameRate(value) {this._targetFrameRate = value;}get trackerDuration() {return this._trackerDuration;}set trackerDuration(value) {this._trackerDuration = value;}get optimizations() {return this._options.optimizations;}constructor(scene, options, autoGeneratePriorities = !0, improvementMode = !1) {if (this._isRunning = !1, this._currentPriorityLevel = 0, this._targetFrameRate = 60, this._trackerDuration = 2e3, this._currentFrameRate = 0, this._improvementMode = !1, this.onSuccessObservable = new observable/* Observable */.y$(), this.onNewOptimizationAppliedObservable = new observable/* Observable */.y$(), this.onFailureObservable = new observable/* Observable */.y$(), this._options = options ? options : new SceneOptimizerOptions(), this._options.targetFrameRate && (this._targetFrameRate = this._options.targetFrameRate), this._options.trackerDuration && (this._trackerDuration = this._options.trackerDuration), autoGeneratePriorities) {let priority = 0;for (const optim of this._options.optimizations) optim.priority = priority++;}this._improvementMode = improvementMode, this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene, this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => {this._sceneDisposeObserver = null, this.dispose();});}stop() {this._isRunning = !1;}reset() {this._currentPriorityLevel = 0;}start() {this._isRunning || (this._isRunning = !0, this._scene.executeWhenReady(() => {setTimeout(() => {this._checkCurrentState();}, this._trackerDuration);}));}_checkCurrentState() {if (!this._isRunning) return;const scene = this._scene,options = this._options;if (this._currentFrameRate = Math.round(scene.getEngine().getFps()), this._improvementMode && this._currentFrameRate <= this._targetFrameRate || !this._improvementMode && this._currentFrameRate >= this._targetFrameRate) return this._isRunning = !1, void this.onSuccessObservable.notifyObservers(this);let allDone = !0,noOptimizationApplied = !0;for (let index = 0; index < options.optimizations.length; index++) {const optimization = options.optimizations[index];optimization.priority === this._currentPriorityLevel && (noOptimizationApplied = !1, allDone = allDone && optimization.apply(scene, this), this.onNewOptimizationAppliedObservable.notifyObservers(optimization));}return noOptimizationApplied ? (this._isRunning = !1, void this.onFailureObservable.notifyObservers(this)) : void (allDone && this._currentPriorityLevel++, scene.executeWhenReady(() => {setTimeout(() => {this._checkCurrentState();}, this._trackerDuration);}));}dispose() {this.stop(), this.onSuccessObservable.clear(), this.onFailureObservable.clear(), this.onNewOptimizationAppliedObservable.clear(), this._sceneDisposeObserver && this._scene.onDisposeObservable.remove(this._sceneDisposeObserver);}static OptimizeAsync(scene, options, onSuccess, onFailure) {const optimizer = new SceneOptimizer(scene, options || SceneOptimizerOptions.ModerateDegradationAllowed(), !1);return onSuccess && optimizer.onSuccessObservable.add(() => {onSuccess();}), onFailure && optimizer.onFailureObservable.add(() => {onFailure();}), optimizer.start(), optimizer;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/sceneSerializer.js
let serializedGeometries = [];const SerializeGeometry = (geometry, serializationGeometries) => {geometry.doNotSerialize || (serializationGeometries.vertexData.push(geometry.serializeVerticeData()), serializedGeometries[geometry.id] = !0);},SerializeMesh = (mesh, serializationScene) => {const serializationObject = {},geometry = mesh._geometry;return geometry && !mesh.getScene().getGeometryById(geometry.id) && SerializeGeometry(geometry, serializationScene.geometries), mesh.serialize && mesh.serialize(serializationObject), serializationObject;},FinalizeSingleMesh = (mesh, serializationObject) => {if (1 === mesh.delayLoadState || 0 === mesh.delayLoadState) {const serializeMaterial = (material) => {serializationObject.materials = serializationObject.materials || [], mesh.material && !serializationObject.materials.some((mat) => mat.id === mesh.material.id) && serializationObject.materials.push(material.serialize());};if (!(mesh.material && !mesh.material.doNotSerialize)) mesh.material || serializeMaterial(mesh.getScene().defaultMaterial);else if (!(mesh.material instanceof multiMaterial/* MultiMaterial */.G)) serializeMaterial(mesh.material);else if (serializationObject.multiMaterials = serializationObject.multiMaterials || [], !serializationObject.multiMaterials.some((mat) => mat.id === mesh.material.id)) {serializationObject.multiMaterials.push(mesh.material.serialize());for (const submaterial of mesh.material.subMaterials) submaterial && serializeMaterial(submaterial);}const geometry = mesh._geometry;geometry && (!serializationObject.geometries && (serializationObject.geometries = {}, serializationObject.geometries.boxes = [], serializationObject.geometries.spheres = [], serializationObject.geometries.cylinders = [], serializationObject.geometries.toruses = [], serializationObject.geometries.grounds = [], serializationObject.geometries.planes = [], serializationObject.geometries.torusKnots = [], serializationObject.geometries.vertexData = []), SerializeGeometry(geometry, serializationObject.geometries)), mesh.skeleton && !mesh.skeleton.doNotSerialize && (serializationObject.skeletons = serializationObject.skeletons || [], serializationObject.skeletons.push(mesh.skeleton.serialize())), serializationObject.meshes = serializationObject.meshes || [], serializationObject.meshes.push(SerializeMesh(mesh, serializationObject));}};class SceneSerializer {static ClearCache() {serializedGeometries = [];}static Serialize(scene) {return SceneSerializer._Serialize(scene);}static _Serialize(scene, checkSyncReadSupported = !0) {const serializationObject = {};if (checkSyncReadSupported && !scene.getEngine()._features.supportSyncTextureRead && Textures_texture/* Texture.ForceSerializeBuffers */.x.ForceSerializeBuffers && console.warn("The serialization object may not contain the proper base64 encoded texture data! You should use the SerializeAsync method instead."), SceneSerializer.ClearCache(), serializationObject.useDelayedTextureLoading = scene.useDelayedTextureLoading, serializationObject.autoClear = scene.autoClear, serializationObject.clearColor = scene.clearColor.asArray(), serializationObject.ambientColor = scene.ambientColor.asArray(), serializationObject.gravity = scene.gravity.asArray(), serializationObject.collisionsEnabled = scene.collisionsEnabled, serializationObject.useRightHandedSystem = scene.useRightHandedSystem, scene.fogMode && 0 !== scene.fogMode && (serializationObject.fogMode = scene.fogMode, serializationObject.fogColor = scene.fogColor.asArray(), serializationObject.fogStart = scene.fogStart, serializationObject.fogEnd = scene.fogEnd, serializationObject.fogDensity = scene.fogDensity), scene.isPhysicsEnabled()) {const physicEngine = scene.getPhysicsEngine();physicEngine && (serializationObject.physicsEnabled = !0, serializationObject.physicsGravity = physicEngine.gravity.asArray(), serializationObject.physicsEngine = physicEngine.getPhysicsPluginName());}scene.metadata && (serializationObject.metadata = scene.metadata), serializationObject.morphTargetManagers = [];for (const abstractMesh of scene.meshes) {const manager = abstractMesh.morphTargetManager;manager && serializationObject.morphTargetManagers.push(manager.serialize());}serializationObject.lights = [];let index, light;for (index = 0; index < scene.lights.length; index++) light = scene.lights[index], light.doNotSerialize || serializationObject.lights.push(light.serialize());for (serializationObject.cameras = [], index = 0; index < scene.cameras.length; index++) {const camera = scene.cameras[index];camera.doNotSerialize || serializationObject.cameras.push(camera.serialize());}if (scene.activeCamera && (serializationObject.activeCameraID = scene.activeCamera.id), decorators/* SerializationHelper.AppendSerializedAnimations */.p4.AppendSerializedAnimations(scene, serializationObject), scene.animationGroups && 0 < scene.animationGroups.length) {serializationObject.animationGroups = [];for (let animationGroupIndex = 0; animationGroupIndex < scene.animationGroups.length; animationGroupIndex++) {const animationGroup = scene.animationGroups[animationGroupIndex];serializationObject.animationGroups.push(animationGroup.serialize());}}if (scene.reflectionProbes && 0 < scene.reflectionProbes.length) for (serializationObject.reflectionProbes = [], index = 0; index < scene.reflectionProbes.length; index++) {const reflectionProbe = scene.reflectionProbes[index];serializationObject.reflectionProbes.push(reflectionProbe.serialize());}serializationObject.materials = [], serializationObject.multiMaterials = [];let material;for (index = 0; index < scene.materials.length; index++) material = scene.materials[index], material.doNotSerialize || serializationObject.materials.push(material.serialize());for (serializationObject.multiMaterials = [], index = 0; index < scene.multiMaterials.length; index++) {const multiMaterial = scene.multiMaterials[index];serializationObject.multiMaterials.push(multiMaterial.serialize());}for (scene.environmentTexture && (scene.environmentTexture._files ? serializationObject.environmentTexture = scene.environmentTexture.serialize() : (serializationObject.environmentTexture = scene.environmentTexture.name, serializationObject.environmentTextureRotationY = scene.environmentTexture.rotationY)), serializationObject.environmentIntensity = scene.environmentIntensity, serializationObject.skeletons = [], index = 0; index < scene.skeletons.length; index++) {const skeleton = scene.skeletons[index];skeleton.doNotSerialize || serializationObject.skeletons.push(skeleton.serialize());}for (serializationObject.transformNodes = [], index = 0; index < scene.transformNodes.length; index++) scene.transformNodes[index].doNotSerialize || serializationObject.transformNodes.push(scene.transformNodes[index].serialize());serializationObject.geometries = {}, serializationObject.geometries.boxes = [], serializationObject.geometries.spheres = [], serializationObject.geometries.cylinders = [], serializationObject.geometries.toruses = [], serializationObject.geometries.grounds = [], serializationObject.geometries.planes = [], serializationObject.geometries.torusKnots = [], serializationObject.geometries.vertexData = [], serializedGeometries = [];const geometries = scene.getGeometries();for (index = 0; index < geometries.length; index++) {const geometry = geometries[index];geometry.isReady() && SerializeGeometry(geometry, serializationObject.geometries);}for (serializationObject.meshes = [], index = 0; index < scene.meshes.length; index++) {const abstractMesh = scene.meshes[index];if (abstractMesh instanceof Meshes_mesh/* Mesh */.Kj) {const mesh = abstractMesh;mesh.doNotSerialize || 1 !== mesh.delayLoadState && 0 !== mesh.delayLoadState || serializationObject.meshes.push(SerializeMesh(mesh, serializationObject));}}for (serializationObject.particleSystems = [], index = 0; index < scene.particleSystems.length; index++) serializationObject.particleSystems.push(scene.particleSystems[index].serialize(!1));for (serializationObject.postProcesses = [], index = 0; index < scene.postProcesses.length; index++) serializationObject.postProcesses.push(scene.postProcesses[index].serialize());scene.actionManager && (serializationObject.actions = scene.actionManager.serialize("scene"));for (const component of scene._serializableComponents) component.serialize(serializationObject);return serializationObject;}static SerializeAsync(scene) {const serializationObject = SceneSerializer._Serialize(scene, !1),promises = [];return this._CollectPromises(serializationObject, promises), Promise.all(promises).then(() => serializationObject);}static _CollectPromises(obj, promises) {if (Array.isArray(obj)) for (let i = 0; i < obj.length; ++i) {const o = obj[i];o instanceof Promise ? promises.push(o.then((res) => obj[i] = res)) : (o instanceof Object || Array.isArray(o)) && this._CollectPromises(o, promises);} else if (obj instanceof Object) for (const name in obj) if (Object.prototype.hasOwnProperty.call(obj, name)) {const o = obj[name];o instanceof Promise ? promises.push(o.then((res) => obj[name] = res)) : (o instanceof Object || Array.isArray(o)) && this._CollectPromises(o, promises);}}static SerializeMesh(toSerialize, withParents = !1, withChildren = !1) {const serializationObject = {};if (SceneSerializer.ClearCache(), toSerialize = toSerialize instanceof Array ? toSerialize : [toSerialize], withParents || withChildren) for (let i = 0; i < toSerialize.length; ++i) withChildren && toSerialize[i].getDescendants().forEach((node) => {node instanceof Meshes_mesh/* Mesh */.Kj && 0 > toSerialize.indexOf(node) && !node.doNotSerialize && toSerialize.push(node);}), withParents && toSerialize[i].parent && 0 > toSerialize.indexOf(toSerialize[i].parent) && !toSerialize[i].parent.doNotSerialize && toSerialize.push(toSerialize[i].parent);return toSerialize.forEach((mesh) => {FinalizeSingleMesh(mesh, serializationObject);}), serializationObject;}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tags.js
var tags = __webpack_require__("./node_modules/@babylonjs/core/Misc/tags.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/videoRecorder.js
class VideoRecorder {static IsSupported(engine) {const canvas = engine.getRenderingCanvas();return !!canvas && "function" == typeof canvas.captureStream;}get isRecording() {return !!this._canvas && this._canvas.isRecording;}constructor(engine, options = {}) {if (!VideoRecorder.IsSupported(engine)) throw "Your browser does not support recording so far.";const canvas = engine.getRenderingCanvas();if (!canvas) throw "The babylon engine must have a canvas to be recorded";this._canvas = canvas, this._canvas.isRecording = !1, this._options = { ...VideoRecorder._DefaultOptions, ...options };const stream = this._canvas.captureStream(this._options.fps);if (this._options.audioTracks) for (const track of this._options.audioTracks) stream.addTrack(track);this._mediaRecorder = new MediaRecorder(stream, { mimeType: this._options.mimeType }), this._mediaRecorder.ondataavailable = this._handleDataAvailable.bind(this), this._mediaRecorder.onerror = this._handleError.bind(this), this._mediaRecorder.onstop = this._handleStop.bind(this);}stopRecording() {this._canvas && this._mediaRecorder && this.isRecording && (this._canvas.isRecording = !1, this._mediaRecorder.stop());}startRecording(fileName = "babylonjs.webm", maxDuration = 7) {if (!this._canvas || !this._mediaRecorder) throw "Recorder has already been disposed";if (this.isRecording) throw "Recording already in progress";return 0 < maxDuration && setTimeout(() => {this.stopRecording();}, 1e3 * maxDuration), this._fileName = fileName, this._recordedChunks = [], this._resolve = null, this._reject = null, this._canvas.isRecording = !0, this._mediaRecorder.start(this._options.recordChunckSize), new Promise((resolve, reject) => {this._resolve = resolve, this._reject = reject;});}dispose() {this._canvas = null, this._mediaRecorder = null, this._recordedChunks = [], this._fileName = null, this._resolve = null, this._reject = null;}_handleDataAvailable(event) {0 < event.data.size && this._recordedChunks.push(event.data);}_handleError(event) {if (this.stopRecording(), this._reject) this._reject(event.error);else throw new event.error();}_handleStop() {this.stopRecording();const superBuffer = new Blob(this._recordedChunks);this._resolve && this._resolve(superBuffer), window.URL.createObjectURL(superBuffer), this._fileName && tools/* Tools.Download */.w1.Download(superBuffer, this._fileName);}}VideoRecorder._DefaultOptions = { mimeType: "video/webm", fps: 25, recordChunckSize: 3e3 };
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/dumpTools.js
var dumpTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/dumpTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/screenshotTools.js
let screenshotCanvas = null;function CreateScreenshot(engine, camera, size, successCallback, mimeType = "image/png", forceDownload = !1) {const { height, width } = _GetScreenshotSize(engine, camera, size);if (!(height && width)) return void logger/* Logger.Error */.Y.Error("Invalid 'size' parameter !");screenshotCanvas || (screenshotCanvas = document.createElement("canvas")), screenshotCanvas.width = width, screenshotCanvas.height = height;const renderContext = screenshotCanvas.getContext("2d"),ratio = engine.getRenderWidth() / engine.getRenderHeight();let newWidth = width,newHeight = newWidth / ratio;newHeight > height && (newHeight = height, newWidth = newHeight * ratio);const offsetX = Math.max(0, width - newWidth) / 2,offsetY = Math.max(0, height - newHeight) / 2,scene = camera.getScene();scene.activeCamera === camera ? engine.onEndFrameObservable.addOnce(() => {const renderingCanvas = engine.getRenderingCanvas();renderContext && renderingCanvas && renderContext.drawImage(renderingCanvas, offsetX, offsetY, newWidth, newHeight), screenshotCanvas && (forceDownload ? (tools/* Tools.EncodeScreenshotCanvasData */.w1.EncodeScreenshotCanvasData(screenshotCanvas, void 0, mimeType), successCallback && successCallback("")) : tools/* Tools.EncodeScreenshotCanvasData */.w1.EncodeScreenshotCanvasData(screenshotCanvas, successCallback, mimeType));}) : CreateScreenshotUsingRenderTarget(engine, camera, size, (data) => {if (forceDownload) {const blob = new Blob([data]);tools/* Tools.DownloadBlob */.w1.DownloadBlob(blob), successCallback && successCallback("");} else successCallback && successCallback(data);}, mimeType, 1, engine.getCreationOptions().antialias);}function CreateScreenshotAsync(engine, camera, size, mimeType = "image/png") {return new Promise((resolve, reject) => {CreateScreenshot(engine, camera, size, (data) => {"undefined" == typeof data ? reject(new Error("Data is undefined")) : resolve(data);}, mimeType);});}function CreateScreenshotWithResizeAsync(engine, camera, width, height, mimeType = "image/png") {return new Promise((resolve) => {CreateScreenshot(engine, camera, { width: width, height: height }, () => {resolve();}, mimeType, !0);});}function CreateScreenshotUsingRenderTarget(engine, camera, size, successCallback, mimeType = "image/png", samples = 1, antialiasing = !1, fileName, renderSprites = !1, enableStencilBuffer = !1, useLayerMask = !0) {const { height, width } = _GetScreenshotSize(engine, camera, size);if (!(height && width)) return void logger/* Logger.Error */.Y.Error("Invalid 'size' parameter !");const originalSize = { width: engine.getRenderWidth(), height: engine.getRenderHeight() };engine.setSize(width, height);const scene = camera.getScene(),texture = new Textures_renderTargetTexture/* RenderTargetTexture */._("screenShot", { width, height }, scene, !1, !1, 0, !1, Textures_texture/* Texture.NEAREST_SAMPLINGMODE */.x.NEAREST_SAMPLINGMODE, void 0, enableStencilBuffer, void 0, void 0, void 0, samples);texture.renderList = scene.meshes.slice(), texture.samples = samples, texture.renderSprites = renderSprites, texture.activeCamera = camera, texture.forceLayerMaskCheck = useLayerMask;const renderToTexture = () => {engine.onEndFrameObservable.addOnce(() => {texture.readPixels(void 0, void 0, void 0, !1).then((data) => {dumpTools/* DumpTools.DumpData */.B.DumpData(width, height, data, successCallback, mimeType, fileName, !0), texture.dispose();});}), scene.incrementRenderId(), scene.resetCachedMaterial(), texture.render(!0), scene.incrementRenderId(), scene.resetCachedMaterial(), engine.setSize(originalSize.width, originalSize.height), camera.getProjectionMatrix(!0), scene.render();};if (antialiasing) {const fxaaPostProcess = new FxaaPostProcess("antialiasing", 1, scene.activeCamera);texture.addPostProcess(fxaaPostProcess), fxaaPostProcess.getEffect().isReady() ? renderToTexture() : fxaaPostProcess.getEffect().onCompiled = () => {renderToTexture();};} else renderToTexture();}function CreateScreenshotUsingRenderTargetAsync(engine, camera, size, mimeType = "image/png", samples = 1, antialiasing = !1, fileName, renderSprites = !1, enableStencilBuffer = !1, useLayerMask = !0) {return new Promise((resolve, reject) => {CreateScreenshotUsingRenderTarget(engine, camera, size, (data) => {"undefined" == typeof data ? reject(new Error("Data is undefined")) : resolve(data);}, mimeType, samples, antialiasing, fileName, renderSprites, enableStencilBuffer, useLayerMask);});}function _GetScreenshotSize(engine, camera, size) {let height = 0,width = 0;if ("object" == typeof size) {const precision = size.precision ? Math.abs(size.precision) : 1;size.width && size.height ? (height = size.height * precision, width = size.width * precision) : size.width && !size.height ? (width = size.width * precision, height = Math.round(width / engine.getAspectRatio(camera))) : size.height && !size.width ? (height = size.height * precision, width = Math.round(height * engine.getAspectRatio(camera))) : (width = Math.round(engine.getRenderWidth() * precision), height = Math.round(width / engine.getAspectRatio(camera)));} else isNaN(size) || (height = size, width = size);return width && (width = Math.floor(width)), height && (height = Math.floor(height)), { height: 0 | height, width: 0 | width };}const ScreenshotTools = { CreateScreenshot, CreateScreenshotAsync, CreateScreenshotWithResizeAsync, CreateScreenshotUsingRenderTarget, CreateScreenshotUsingRenderTargetAsync };const initSideEffects = () => {tools/* Tools.CreateScreenshot */.w1.CreateScreenshot = CreateScreenshot, tools/* Tools.CreateScreenshotAsync */.w1.CreateScreenshotAsync = CreateScreenshotAsync, tools/* Tools.CreateScreenshotUsingRenderTarget */.w1.CreateScreenshotUsingRenderTarget = CreateScreenshotUsingRenderTarget, tools/* Tools.CreateScreenshotUsingRenderTargetAsync */.w1.CreateScreenshotUsingRenderTargetAsync = CreateScreenshotUsingRenderTargetAsync;};initSideEffects();
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/iInspectable.js
var InspectableType;(function (InspectableType) {InspectableType[InspectableType.Checkbox = 0] = "Checkbox", InspectableType[InspectableType.Slider = 1] = "Slider", InspectableType[InspectableType.Vector3 = 2] = "Vector3", InspectableType[InspectableType.Quaternion = 3] = "Quaternion", InspectableType[InspectableType.Color3 = 4] = "Color3", InspectableType[InspectableType.String = 5] = "String", InspectableType[InspectableType.Button = 6] = "Button", InspectableType[InspectableType.Options = 7] = "Options", InspectableType[InspectableType.Tab = 8] = "Tab", InspectableType[InspectableType.FileButton = 9] = "FileButton", InspectableType[InspectableType.Vector2 = 10] = "Vector2";})(InspectableType || (InspectableType = {}));
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/rgbdTextureTools.js
var rgbdTextureTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/rgbdTextureTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/fileRequest.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/customAnimationFrameRequester.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/retryStrategy.js
var retryStrategy = __webpack_require__("./node_modules/@babylonjs/core/Misc/retryStrategy.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/interfaces/screenshotSize.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/interfaces/iPerfViewer.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/dataReader.js
var dataReader = __webpack_require__("./node_modules/@babylonjs/core/Misc/dataReader.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/dataStorage.js
class DataStorage {static _GetStorage() {try {return localStorage.setItem("test", ""), localStorage.removeItem("test"), localStorage;} catch (_a) {const inMemoryStorage = {};return { getItem: (key) => {const value = inMemoryStorage[key];return void 0 === value ? null : value;}, setItem: (key, value) => {inMemoryStorage[key] = value;} };}}static ReadString(key, defaultValue) {const value = this._Storage.getItem(key);return null === value ? defaultValue : value;}static WriteString(key, value) {this._Storage.setItem(key, value);}static ReadBoolean(key, defaultValue) {const value = this._Storage.getItem(key);return null === value ? defaultValue : "true" === value;}static WriteBoolean(key, value) {this._Storage.setItem(key, value ? "true" : "false");}static ReadNumber(key, defaultValue) {const value = this._Storage.getItem(key);return null === value ? defaultValue : parseFloat(value);}static WriteNumber(key, value) {this._Storage.setItem(key, value.toString());}}DataStorage._Storage = DataStorage._GetStorage();
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/sceneRecorder.js
class SceneRecorder {constructor() {this._trackedScene = null;}track(scene) {this._trackedScene = scene, decorators/* SerializationHelper.AllowLoadingUniqueId */.p4.AllowLoadingUniqueId = !0, this._savedJSON = SceneSerializer.Serialize(scene), decorators/* SerializationHelper.AllowLoadingUniqueId */.p4.AllowLoadingUniqueId = !1;}getDelta() {if (!this._trackedScene) return null;const currentForceSerializeBuffers = Textures_texture/* Texture.ForceSerializeBuffers */.x.ForceSerializeBuffers;Textures_texture/* Texture.ForceSerializeBuffers */.x.ForceSerializeBuffers = !1, decorators/* SerializationHelper.AllowLoadingUniqueId */.p4.AllowLoadingUniqueId = !0;const newJSON = SceneSerializer.Serialize(this._trackedScene);decorators/* SerializationHelper.AllowLoadingUniqueId */.p4.AllowLoadingUniqueId = !1;const deltaJSON = {};for (const node in newJSON) this._compareCollections(node, this._savedJSON[node], newJSON[node], deltaJSON);return Textures_texture/* Texture.ForceSerializeBuffers */.x.ForceSerializeBuffers = currentForceSerializeBuffers, deltaJSON;}_compareArray(key, original, current, deltaJSON) {if (0 === original.length && 0 === current.length) return !0;if (original.length && !isNaN(original[0]) || current.length && !isNaN(current[0])) {if (original.length !== current.length) return !1;if (0 === original.length) return !0;for (let index = 0; index < original.length; index++) if (original[index] !== current[index]) return deltaJSON[key] = current, !1;return !0;}const originalUniqueIds = [];for (let index = 0; index < original.length; index++) {const originalObject = original[index],originalUniqueId = originalObject.uniqueId;originalUniqueIds.push(originalUniqueId);const currentObjects = current.filter((c) => c.uniqueId === originalUniqueId);if (currentObjects.length) {const currentObject = currentObjects[0],newObject = {};this._compareObjects(originalObject, currentObject, newObject) || (!deltaJSON[key] && (deltaJSON[key] = []), newObject.__state = { id: currentObject.id || currentObject.name }, deltaJSON[key].push(newObject));} else {const newObject = { __state: { deleteId: originalObject.id || originalObject.name } };deltaJSON[key].push(newObject);}}for (let index = 0; index < current.length; index++) {const currentObject = current[index],currentUniqueId = currentObject.uniqueId;-1 === originalUniqueIds.indexOf(currentUniqueId) && (!deltaJSON[key] && (deltaJSON[key] = []), deltaJSON[key].push(currentObject));}return !0;}_compareObjects(originalObjet, currentObject, deltaJSON) {let aDifferenceWasFound = !1;for (const prop in originalObjet) {if (!Object.prototype.hasOwnProperty.call(originalObjet, prop)) continue;const originalValue = originalObjet[prop],currentValue = currentObject[prop];let diffFound = !1;if (Array.isArray(originalValue)) diffFound = JSON.stringify(originalValue) !== JSON.stringify(currentValue);else if (!isNaN(originalValue) || "[object String]" == Object.prototype.toString.call(originalValue)) diffFound = originalValue !== currentValue;else if ("object" == typeof originalValue && "object" == typeof currentValue) {const newObject = {};this._compareObjects(originalValue, currentValue, newObject) || (deltaJSON[prop] = newObject, aDifferenceWasFound = !0);}diffFound && (aDifferenceWasFound = !0, deltaJSON[prop] = currentValue);}return !aDifferenceWasFound;}_compareCollections(key, original, current, deltaJSON) {if (original !== current && original && current) if (Array.isArray(original) && Array.isArray(current)) {if (this._compareArray(key, original, current, deltaJSON)) return;} else if ("object" == typeof original && "object" == typeof current) {const newObject = {};return void (this._compareObjects(original, current, newObject) || (deltaJSON[key] = newObject));}}static GetShadowGeneratorById(scene, id) {const allGenerators = scene.lights.map((l) => l.getShadowGenerators());for (const generators of allGenerators) if (generators) {const iterator = generators.values();for (let key = iterator.next(); !0 !== key.done; key = iterator.next()) {const generator = key.value;if (generator && generator.id === id) return generator;}}return null;}static ApplyDelta(deltaJSON, scene) {"string" == typeof deltaJSON && (deltaJSON = JSON.parse(deltaJSON));const anyScene = scene;for (const prop in deltaJSON) {const source = deltaJSON[prop],property = anyScene[prop];Array.isArray(property) || "shadowGenerators" === prop ? "cameras" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getCameraById.bind(scene), (data) => Cameras_camera/* Camera.Parse */.V.Parse(data, scene)) : "lights" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getLightById.bind(scene), (data) => Lights_light/* Light.Parse */._.Parse(data, scene)) : "shadowGenerators" === prop ? this._ApplyDeltaForEntity(source, scene, (id) => this.GetShadowGeneratorById(scene, id), (data) => ShadowGenerator.Parse(data, scene)) : "meshes" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getMeshById.bind(scene), (data) => Meshes_mesh/* Mesh.Parse */.Kj.Parse(data, scene, "")) : "skeletons" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getSkeletonById.bind(scene), (data) => Bones_skeleton/* Skeleton.Parse */.O.Parse(data, scene)) : "materials" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getMaterialById.bind(scene), (data) => Materials_material/* Material.Parse */.F.Parse(data, scene, "")) : "multiMaterials" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getMaterialById.bind(scene), (data) => multiMaterial/* MultiMaterial.Parse */.G.Parse(data, scene, "")) : "transformNodes" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getTransformNodeById.bind(scene), (data) => transformNode/* TransformNode.Parse */.Y.Parse(data, scene, "")) : "particleSystems" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getParticleSystemById.bind(scene), (data) => ParticleSystem.Parse(data, scene, "")) : "morphTargetManagers" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getMorphTargetById.bind(scene), (data) => morphTargetManager/* MorphTargetManager.Parse */.O.Parse(data, scene)) : "postProcesses" === prop ? this._ApplyDeltaForEntity(source, scene, scene.getPostProcessByName.bind(scene), (data) => PostProcesses_postProcess/* PostProcess.Parse */.D.Parse(data, scene, "")) : void 0 : isNaN(property) ? property.fromArray && property.fromArray(source) : anyScene[prop] = source;}}static _ApplyPropertiesToEntity(deltaJSON, entity) {for (const prop in deltaJSON) {const source = deltaJSON[prop],property = entity[prop];void 0 !== property && (!isNaN(property) || Array.isArray(property) ? entity[prop] = source : property.fromArray ? property.fromArray(source) : "object" == typeof property && null !== property && this._ApplyPropertiesToEntity(source, property));}}static _ApplyDeltaForEntity(sources, scene, finder, addNew) {for (const source of sources) if (source.__state && source.__state.id !== void 0) {const targetEntity = finder(source.__state.id);targetEntity && this._ApplyPropertiesToEntity(source, targetEntity);} else if (source.__state && source.__state.deleteId !== void 0) {const target = finder(source.__state.deleteId);null === target || void 0 === target ? void 0 : target.dispose();} else addNew(source);}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/trajectoryClassifier.js
var Levenshtein;(function (Levenshtein) {class Alphabet {serialize() {const jsonObject = {},characters = Array(this._characterToIdx.size);return this._characterToIdx.forEach((v, k) => {characters[v] = k;}), jsonObject.characters = characters, jsonObject.insertionCosts = this._insertionCosts, jsonObject.deletionCosts = this._deletionCosts, jsonObject.substitutionCosts = this._substitutionCosts, JSON.stringify(jsonObject);}static Deserialize(json) {const jsonObject = JSON.parse(json),alphabet = new Alphabet(jsonObject.characters);return alphabet._insertionCosts = jsonObject.insertionCosts, alphabet._deletionCosts = jsonObject.deletionCosts, alphabet._substitutionCosts = jsonObject.substitutionCosts, alphabet;}constructor(characters, charToInsertionCost = null, charToDeletionCost = null, charsToSubstitutionCost = null) {charToInsertionCost = null !== charToInsertionCost && void 0 !== charToInsertionCost ? charToInsertionCost : () => 1, charToDeletionCost = null !== charToDeletionCost && void 0 !== charToDeletionCost ? charToDeletionCost : () => 1, charsToSubstitutionCost = null !== charsToSubstitutionCost && void 0 !== charsToSubstitutionCost ? charsToSubstitutionCost : (a, b) => a === b ? 0 : 1, this._characterToIdx = new Map(), this._insertionCosts = Array(characters.length), this._deletionCosts = Array(characters.length), this._substitutionCosts = Array(characters.length);let c;for (let outerIdx = 0; outerIdx < characters.length; ++outerIdx) {c = characters[outerIdx], this._characterToIdx.set(c, outerIdx), this._insertionCosts[outerIdx] = charToInsertionCost(c), this._deletionCosts[outerIdx] = charToDeletionCost(c), this._substitutionCosts[outerIdx] = Array(characters.length);for (let innerIdx = outerIdx; innerIdx < characters.length; ++innerIdx) this._substitutionCosts[outerIdx][innerIdx] = charsToSubstitutionCost(c, characters[innerIdx]);}}getCharacterIdx(char) {return this._characterToIdx.get(char);}getInsertionCost(idx) {return this._insertionCosts[idx];}getDeletionCost(idx) {return this._deletionCosts[idx];}getSubstitutionCost(idx1, idx2) {const min = Math.min(idx1, idx2),max = Math.max(idx1, idx2);return this._substitutionCosts[min][max];}}Levenshtein.Alphabet = Alphabet;class Sequence {serialize() {return JSON.stringify(this._characters);}static Deserialize(json, alphabet) {const sequence = new Sequence([], alphabet);return sequence._characters = JSON.parse(json), sequence;}constructor(characters, alphabet) {if (characters.length > Sequence._MAX_SEQUENCE_LENGTH) throw new Error("Sequences longer than " + Sequence._MAX_SEQUENCE_LENGTH + " not supported.");this._alphabet = alphabet, this._characters = characters.map((c) => this._alphabet.getCharacterIdx(c));}distance(other) {return Sequence._Distance(this, other);}static _Distance(a, b) {const alphabet = a._alphabet;if (alphabet !== b._alphabet) throw new Error("Cannot Levenshtein compare Sequences built from different alphabets.");const aChars = a._characters,bChars = b._characters,aLength = aChars.length,bLength = bChars.length,costMatrix = Sequence._CostMatrix;costMatrix[0][0] = 0;for (let idx = 0; idx < aLength; ++idx) costMatrix[idx + 1][0] = costMatrix[idx][0] + alphabet.getInsertionCost(aChars[idx]);for (let idx = 0; idx < bLength; ++idx) costMatrix[0][idx + 1] = costMatrix[0][idx] + alphabet.getInsertionCost(bChars[idx]);for (let aIdx = 0; aIdx < aLength; ++aIdx) for (let bIdx = 0; bIdx < bLength; ++bIdx) Sequence._InsertionCost = costMatrix[aIdx + 1][bIdx] + alphabet.getInsertionCost(bChars[bIdx]), Sequence._DeletionCost = costMatrix[aIdx][bIdx + 1] + alphabet.getDeletionCost(aChars[aIdx]), Sequence._SubstitutionCost = costMatrix[aIdx][bIdx] + alphabet.getSubstitutionCost(aChars[aIdx], bChars[bIdx]), costMatrix[aIdx + 1][bIdx + 1] = Math.min(Sequence._InsertionCost, Sequence._DeletionCost, Sequence._SubstitutionCost);return costMatrix[aLength][bLength];}}Sequence._MAX_SEQUENCE_LENGTH = 256, Sequence._CostMatrix = [...Array(Sequence._MAX_SEQUENCE_LENGTH + 1)].map(() => Array(Sequence._MAX_SEQUENCE_LENGTH + 1)), Levenshtein.Sequence = Sequence;})(Levenshtein || (Levenshtein = {}));class Trajectory {serialize() {return JSON.stringify(this);}static Deserialize(json) {const jsonObject = JSON.parse(json),trajectory = new Trajectory(jsonObject._segmentLength);return trajectory._points = jsonObject._points.map((pt) => new math_vector/* Vector3 */.P(pt._x, pt._y, pt._z)), trajectory;}constructor(segmentLength = .01) {this._points = [], this._segmentLength = segmentLength;}getLength() {return this._points.length * this._segmentLength;}add(point) {let numPoints = this._points.length;if (0 === numPoints) this._points.push(point.clone());else {const getT = () => this._segmentLength / math_vector/* Vector3.Distance */.P.Distance(this._points[numPoints - 1], point);for (let t = getT(); 1 >= t; t = getT()) {const newPoint = this._points[numPoints - 1].scale(1 - t);point.scaleAndAddToRef(t, newPoint), this._points.push(newPoint), ++numPoints;}}}resampleAtTargetResolution(targetResolution) {const resampled = new Trajectory(this.getLength() / targetResolution);return this._points.forEach((pt) => {resampled.add(pt);}), resampled;}tokenize(tokens) {const tokenization = [],segmentDir = new math_vector/* Vector3 */.P();for (let idx = 2; idx < this._points.length; ++idx) Trajectory._TransformSegmentDirToRef(this._points[idx - 2], this._points[idx - 1], this._points[idx], segmentDir) && tokenization.push(Trajectory._TokenizeSegment(segmentDir, tokens));return tokenization;}static _TransformSegmentDirToRef(priorVec, fromVec, toVec, result) {return (fromVec.subtractToRef(priorVec, Trajectory._ForwardDir), Trajectory._ForwardDir.normalize(), fromVec.scaleToRef(-1, Trajectory._InverseFromVec), Trajectory._InverseFromVec.normalize(), !(Math.abs(math_vector/* Vector3.Dot */.P.Dot(Trajectory._ForwardDir, Trajectory._InverseFromVec)) > .98)) && (math_vector/* Vector3.CrossToRef */.P.CrossToRef(Trajectory._ForwardDir, Trajectory._InverseFromVec, Trajectory._UpDir), Trajectory._UpDir.normalize(), math_vector/* Matrix.LookAtLHToRef */.y3.LookAtLHToRef(priorVec, fromVec, Trajectory._UpDir, Trajectory._LookMatrix), toVec.subtractToRef(fromVec, Trajectory._FromToVec), Trajectory._FromToVec.normalize(), math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(Trajectory._FromToVec, Trajectory._LookMatrix, result), !0);}static _TokenizeSegment(segment, tokens) {Trajectory._BestMatch = 0, Trajectory._Score = math_vector/* Vector3.Dot */.P.Dot(segment, tokens[0]), Trajectory._BestScore = Trajectory._Score;for (let idx = 1; idx < tokens.length; ++idx) Trajectory._Score = math_vector/* Vector3.Dot */.P.Dot(segment, tokens[idx]), Trajectory._Score > Trajectory._BestScore && (Trajectory._BestMatch = idx, Trajectory._BestScore = Trajectory._Score);return Trajectory._BestMatch;}}Trajectory._ForwardDir = new math_vector/* Vector3 */.P(), Trajectory._InverseFromVec = new math_vector/* Vector3 */.P(), Trajectory._UpDir = new math_vector/* Vector3 */.P(), Trajectory._FromToVec = new math_vector/* Vector3 */.P(), Trajectory._LookMatrix = new math_vector/* Matrix */.y3();class Vector3Alphabet {static Generate(alphabetSize = 64, iterations = 256, startingStepSize = .1, endingStepSize = .001, fixedValues = []) {const EPSILON = .001,alphabet = new Vector3Alphabet(alphabetSize);for (let idx = 0; idx < alphabetSize; ++idx) alphabet.chars[idx] = new math_vector/* Vector3 */.P(Math.random() - .5, Math.random() - .5, Math.random() - .5), alphabet.chars[idx].normalize();for (let idx = 0; idx < fixedValues.length; ++idx) alphabet.chars[idx].copyFrom(fixedValues[idx]);let stepSize, distSq;const force = new math_vector/* Vector3 */.P(),scratch = new math_vector/* Vector3 */.P(),lerp = (l, r, t) => (1 - t) * l + t * r;for (let iteration = 0; iteration < iterations; ++iteration) {stepSize = lerp(startingStepSize, endingStepSize, iteration / (iterations - 1));for (let idx = fixedValues.length; idx < alphabet.chars.length; ++idx) force.copyFromFloats(0, 0, 0), alphabet.chars.forEach((pt) => {alphabet.chars[idx].subtractToRef(pt, scratch), distSq = scratch.lengthSquared(), distSq > EPSILON * EPSILON && scratch.scaleAndAddToRef(1 / (scratch.lengthSquared() * distSq), force);}), force.scaleInPlace(stepSize), alphabet.chars[idx].addInPlace(force), alphabet.chars[idx].normalize();}return alphabet;}serialize() {return JSON.stringify(this.chars);}static Deserialize(json) {const jsonObject = JSON.parse(json),alphabet = new Vector3Alphabet(jsonObject.length);for (let idx = 0; idx < jsonObject.length; ++idx) alphabet.chars[idx] = new math_vector/* Vector3 */.P(jsonObject[idx]._x, jsonObject[idx]._y, jsonObject[idx]._z);return alphabet;}constructor(size) {this.chars = Array(size);}}class TrajectoryDescriptor {serialize() {return JSON.stringify(this._sequences.map((sequence) => sequence.serialize()));}static Deserialize(json, alphabet) {const descriptor = new TrajectoryDescriptor();return descriptor._sequences = JSON.parse(json).map((s) => Levenshtein.Sequence.Deserialize(s, alphabet)), descriptor;}static CreateFromTrajectory(trajectory, vector3Alphabet, levenshteinAlphabet) {return TrajectoryDescriptor.CreateFromTokenizationPyramid(TrajectoryDescriptor._GetTokenizationPyramid(trajectory, vector3Alphabet), levenshteinAlphabet);}static CreateFromTokenizationPyramid(pyramid, levenshteinAlphabet) {const descriptor = new TrajectoryDescriptor();return descriptor._sequences = pyramid.map((tokens) => new Levenshtein.Sequence(tokens, levenshteinAlphabet)), descriptor;}constructor() {this._sequences = [];}static _GetTokenizationPyramid(trajectory, alphabet, targetResolution = TrajectoryDescriptor._FINEST_DESCRIPTOR_RESOLUTION) {const pyramid = [];for (let res = targetResolution; 4 < res; res = Math.floor(res / 2)) pyramid.push(trajectory.resampleAtTargetResolution(res).tokenize(alphabet.chars));return pyramid;}distance(other) {let weight,totalDistance = 0;for (let idx = 0; idx < this._sequences.length; ++idx) weight = Math.pow(2, idx), totalDistance += weight * this._sequences[idx].distance(other._sequences[idx]);return totalDistance;}}TrajectoryDescriptor._FINEST_DESCRIPTOR_RESOLUTION = 32;class TrajectoryClass {serialize() {const jsonObject = { descriptors: this._descriptors.map((desc) => desc.serialize()), centroidIdx: this._centroidIdx, averageDistance: this._averageDistance };return JSON.stringify(jsonObject);}static Deserialize(json, alphabet) {const jsonObject = JSON.parse(json),described = new TrajectoryClass();return described._descriptors = jsonObject.descriptors.map((s) => TrajectoryDescriptor.Deserialize(s, alphabet)), described._centroidIdx = jsonObject.centroidIdx, described._averageDistance = jsonObject.averageDistance, described;}constructor(descriptors = []) {this._descriptors = descriptors, this._centroidIdx = -1, this._averageDistance = 0, this._refreshDescription();}add(descriptor) {this._descriptors.push(descriptor), this._refreshDescription();}getMatchCost(descriptor) {return descriptor.distance(this._descriptors[this._centroidIdx]) / this._averageDistance;}getMatchMinimumDistance(descriptor) {return Math.min(...this._descriptors.map((desc) => desc.distance(descriptor)));}_refreshDescription() {this._centroidIdx = -1;let sum;const distances = this._descriptors.map((a) => (sum = 0, this._descriptors.forEach((b) => {sum += a.distance(b);}), sum));for (let idx = 0; idx < distances.length; ++idx) (0 > this._centroidIdx || distances[idx] < distances[this._centroidIdx]) && (this._centroidIdx = idx);this._averageDistance = 0, this._descriptors.forEach((desc) => {this._averageDistance += desc.distance(this._descriptors[this._centroidIdx]);}), 0 < this._descriptors.length && (this._averageDistance = Math.max(this._averageDistance / this._descriptors.length, TrajectoryClass._MIN_AVERAGE_DISTANCE));}}TrajectoryClass._MIN_AVERAGE_DISTANCE = 1;class TrajectoryClassifier {serialize() {const jsonObject = {};return jsonObject.maximumAllowableMatchCost = this._maximumAllowableMatchCost, jsonObject.vector3Alphabet = this._vector3Alphabet.serialize(), jsonObject.levenshteinAlphabet = this._levenshteinAlphabet.serialize(), jsonObject.nameToDescribedTrajectory = [], this._nameToDescribedTrajectory.forEach((described, name) => {jsonObject.nameToDescribedTrajectory.push(name), jsonObject.nameToDescribedTrajectory.push(described.serialize());}), JSON.stringify(jsonObject);}static Deserialize(json) {const jsonObject = JSON.parse(json),classifier = new TrajectoryClassifier();classifier._maximumAllowableMatchCost = jsonObject.maximumAllowableMatchCost, classifier._vector3Alphabet = Vector3Alphabet.Deserialize(jsonObject.vector3Alphabet), classifier._levenshteinAlphabet = Levenshtein.Alphabet.Deserialize(jsonObject.levenshteinAlphabet);for (let idx = 0; idx < jsonObject.nameToDescribedTrajectory.length; idx += 2) classifier._nameToDescribedTrajectory.set(jsonObject.nameToDescribedTrajectory[idx], TrajectoryClass.Deserialize(jsonObject.nameToDescribedTrajectory[idx + 1], classifier._levenshteinAlphabet));return classifier;}static Generate() {const vecs = Vector3Alphabet.Generate(64, 256, .1, .001, [math_vector/* Vector3.Forward */.P.Forward()]),charIdxs = Array(vecs.chars.length);for (let idx = 0; idx < charIdxs.length; ++idx) charIdxs[idx] = idx;const alphabet = new Levenshtein.Alphabet(charIdxs, (idx) => 0 === idx ? 0 : 1, (idx) => 0 === idx ? 0 : 1, (a, b) => Math.min(1 - math_vector/* Vector3.Dot */.P.Dot(vecs.chars[a], vecs.chars[b]), 1)),trajectorySet = new TrajectoryClassifier();return trajectorySet._vector3Alphabet = vecs, trajectorySet._levenshteinAlphabet = alphabet, trajectorySet;}constructor() {this._maximumAllowableMatchCost = 4, this._nameToDescribedTrajectory = new Map();}addTrajectoryToClassification(trajectory, classification) {this._nameToDescribedTrajectory.has(classification) || this._nameToDescribedTrajectory.set(classification, new TrajectoryClass()), this._nameToDescribedTrajectory.get(classification).add(TrajectoryDescriptor.CreateFromTrajectory(trajectory, this._vector3Alphabet, this._levenshteinAlphabet));}deleteClassification(classification) {return this._nameToDescribedTrajectory.delete(classification);}classifyTrajectory(trajectory) {const descriptor = TrajectoryDescriptor.CreateFromTrajectory(trajectory, this._vector3Alphabet, this._levenshteinAlphabet),allowableMatches = [];if (this._nameToDescribedTrajectory.forEach((trajectoryClass, classification) => {trajectoryClass.getMatchCost(descriptor) < this._maximumAllowableMatchCost && allowableMatches.push(classification);}), 0 === allowableMatches.length) return null;let match,bestIdx = 0,bestMatch = this._nameToDescribedTrajectory.get(allowableMatches[bestIdx]).getMatchMinimumDistance(descriptor);for (let idx = 0; idx < allowableMatches.length; ++idx) match = this._nameToDescribedTrajectory.get(allowableMatches[idx]).getMatchMinimumDistance(descriptor), match < bestMatch && (bestMatch = match, bestIdx = idx);return allowableMatches[bestIdx];}}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/copyTools.js
var copyTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/copyTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/reflector.js
class Reflector {constructor(scene, hostname, port) {this._scene = scene, logger/* Logger.Log */.Y.Log(`[Reflector] Connecting to ws://${hostname}:${port}`), this._webSocket = new WebSocket(`ws://${hostname}:${port}`), this._webSocket.onmessage = (event) => {const message = event.data;if (message.startsWith(Reflector._SERVER_PREFIX)) {const serverMessage = message.substr(Reflector._SERVER_PREFIX.length);return logger/* Logger.Log */.Y.Log(`[Reflector] Received server message: ${serverMessage.substr(0, 64)}`), void this._handleServerMessage(serverMessage);}logger/* Logger.Log */.Y.Log(`[Reflector] Received client message: ${message.substr(0, 64)}`), this._handleClientMessage();}, this._webSocket.onclose = (event) => {logger/* Logger.Log */.Y.Log(`[Reflector] Disconnected ${event.code} ${event.reason}`);};}close() {this._webSocket.close();}_handleServerMessage(message) {switch (message) {case "connected":{SceneSerializer.SerializeAsync(this._scene).then((serialized) => {this._webSocket.send(`load|${JSON.stringify(serialized)}`);});break;}}}_handleClientMessage() {}}Reflector._SERVER_PREFIX = "$$";
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/pressureObserverWrapper.js
class PressureObserverWrapper {constructor(options) {this._observer = null, this._currentState = [], this.onPressureChanged = new observable/* Observable */.y$(), PressureObserverWrapper.IsAvailable && (this._observer = new PressureObserver((update) => {this._currentState = update, this.onPressureChanged.notifyObservers(update);}, options));}static get IsAvailable() {return "undefined" != typeof PressureObserver && PressureObserver.supportedSources.includes("cpu");}observe(source) {var _a;try {null === (_a = this._observer) || void 0 === _a ? void 0 : _a.observe(source), this.onPressureChanged.notifyObservers(this._currentState);} catch (_b) {}}unobserve(source) {var _a;try {null === (_a = this._observer) || void 0 === _a ? void 0 : _a.unobserve(source);} catch (_b) {}}dispose() {var _a;null === (_a = this._observer) || void 0 === _a ? void 0 : _a.disconnect(), this._observer = null, this.onPressureChanged.clear();}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/PerformanceViewer/dynamicFloat32Array.js
const growthFactor = 1.5;class DynamicFloat32Array {constructor(itemCapacity) {this._view = new Float32Array(itemCapacity), this._itemLength = 0;}get itemLength() {return this._itemLength;}at(index) {return 0 > index || index >= this._itemLength ? NaN : this._view[index];}subarray(start, end) {return start >= end || 0 > start ? new Float32Array(0) : (end > this._itemLength && (end = this._itemLength), this._view.subarray(start, end));}push(item) {this._view[this._itemLength] = item, this._itemLength++, this._itemLength >= this._view.length && this._growArray();}_growArray() {const newCapacity = Math.floor(this._view.length * growthFactor),view = new Float32Array(newCapacity);view.set(this._view), this._view = view;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollector.js
const InitialArraySize = 1800,NumberOfBitsInHexcode = 24,HexPadding = "0",TimestampColHeader = "timestamp",NumPointsColHeader = "numPoints",CarriageReturnRegex = /\r/g,ExportedDataSeparator = "@";class PerformanceViewerCollector {static get SliceDataOffset() {return 2;}static get NumberOfPointsOffset() {return 1;}constructor(_scene, _enabledStrategyCallbacks) {this._scene = _scene, this._collectDataAtFrame = () => {const timestamp = precisionDate/* PrecisionDate.Now */.F.Now - this._startingTimestamp,numPoints = this.datasets.ids.length,numberOfIndices = this.datasets.startingIndices.itemLength;let startingIndex = 0;if (0 < numberOfIndices) {const previousStartingIndex = this.datasets.startingIndices.at(numberOfIndices - 1);startingIndex = previousStartingIndex + this.datasets.data.at(previousStartingIndex + PerformanceViewerCollector.NumberOfPointsOffset) + PerformanceViewerCollector.SliceDataOffset;}if (this.datasets.startingIndices.push(startingIndex), this.datasets.data.push(timestamp), this.datasets.data.push(numPoints), this.datasets.ids.forEach((id) => {const strategy = this._strategies.get(id);strategy && this.datasets.data.push(strategy.getData());}), this.datasetObservable.hasObservers()) {const slice = [timestamp, numPoints];for (let i = 0; i < numPoints; i++) slice.push(this.datasets.data.at(startingIndex + PerformanceViewerCollector.SliceDataOffset + i));this.datasetObservable.notifyObservers(slice);}}, this.datasets = { ids: [], data: new DynamicFloat32Array(InitialArraySize), startingIndices: new DynamicFloat32Array(InitialArraySize) }, this._strategies = new Map(), this._datasetMeta = new Map(), this._eventRestoreSet = new Set(), this._customEventObservable = new observable/* Observable */.y$(), this.datasetObservable = new observable/* Observable */.y$(), this.metadataObservable = new observable/* Observable */.y$((observer) => observer.callback(this._datasetMeta, new observable/* EventState */.he(0))), _enabledStrategyCallbacks && this.addCollectionStrategies(..._enabledStrategyCallbacks);}registerEvent(name, forceUpdate, category) {var _a;if (this._strategies.has(name) && !forceUpdate) return;this._strategies.has(name) && forceUpdate && (null === (_a = this._strategies.get(name)) || void 0 === _a ? void 0 : _a.dispose(), this._strategies.delete(name));const strategy = (scene) => {let counter = 0,value = 0;const afterRenderObserver = scene.onAfterRenderObservable.add(() => {value = counter, counter = 0;}),stringObserver = this._customEventObservable.add((eventVal) => {name !== eventVal.name || (void 0 === eventVal.value ? counter++ : counter = eventVal.value);});return { id: name, getData: () => value, dispose: () => {scene.onAfterRenderObservable.remove(afterRenderObserver), this._customEventObservable.remove(stringObserver);} };};return this._eventRestoreSet.add(name), this.addCollectionStrategies({ strategyCallback: strategy, category }), { name };}sendEvent(event) {this._customEventObservable.notifyObservers(event);}_restoreStringEvents() {this._eventRestoreSet.size !== this._customEventObservable.observers.length && this._eventRestoreSet.forEach((event) => {this.registerEvent(event, !0);});}addCollectionStrategies(...strategyCallbacks) {for (let { strategyCallback, category, hidden } of strategyCallbacks) {const strategy = strategyCallback(this._scene);if (this._strategies.has(strategy.id)) {strategy.dispose();continue;}this.datasets.ids.push(strategy.id), category && (category = category.replace(new RegExp(ExportedDataSeparator, "g"), "")), this._datasetMeta.set(strategy.id, { color: this._getHexColorFromId(strategy.id), category, hidden }), this._strategies.set(strategy.id, strategy);}this.metadataObservable.notifyObservers(this._datasetMeta);}_getHexColorFromId(id) {let hash = 0;for (let i = 0; i < id.length; i++) hash = id.charCodeAt(i) + ((hash << 5) - hash);let hex = "#";for (let i = 0; i < NumberOfBitsInHexcode; i += 8) {const octet = 255 & hash >> i;hex += (HexPadding + octet.toString(16)).substr(-2);}return hex;}getCurrentSlice() {const timestamp = precisionDate/* PrecisionDate.Now */.F.Now - this._startingTimestamp,numPoints = this.datasets.ids.length,slice = [timestamp, numPoints];this.datasets.ids.forEach((id) => {const strategy = this._strategies.get(id);!strategy || this.datasetObservable.hasObservers() && slice.push(strategy.getData());}), this.datasetObservable.hasObservers() && this.datasetObservable.notifyObservers(slice);}updateMetadata(id, prop, value) {const meta = this._datasetMeta.get(id);meta && (meta[prop] = value, this.metadataObservable.notifyObservers(this._datasetMeta));}clear(preserveStringEventsRestore) {this.datasets.data = new DynamicFloat32Array(InitialArraySize), this.datasets.ids.length = 0, this.datasets.startingIndices = new DynamicFloat32Array(InitialArraySize), this._datasetMeta.clear(), this._strategies.forEach((strategy) => strategy.dispose()), this._strategies.clear(), preserveStringEventsRestore || this._eventRestoreSet.clear(), this._hasLoadedData = !1;}get hasLoadedData() {return this._hasLoadedData;}loadFromFileData(data, keepDatasetMeta) {const lines = data.replace(CarriageReturnRegex, "").split("\n").map((line) => line.split(",").filter((s) => 0 < s.length)).filter((line) => 0 < line.length),timestampIndex = 0,numPointsIndex = PerformanceViewerCollector.NumberOfPointsOffset;if (2 > lines.length) return !1;const parsedDatasets = { ids: [], data: new DynamicFloat32Array(InitialArraySize), startingIndices: new DynamicFloat32Array(InitialArraySize) },[firstLine, ...dataLines] = lines;if (2 > firstLine.length || firstLine[timestampIndex] !== TimestampColHeader || firstLine[numPointsIndex] !== NumPointsColHeader) return !1;const idCategoryMap = new Map();for (let i = PerformanceViewerCollector.SliceDataOffset; i < firstLine.length; i++) {const [id, category] = firstLine[i].split(ExportedDataSeparator);parsedDatasets.ids.push(id), idCategoryMap.set(id, category);}let startingIndex = 0;for (const line of dataLines) {if (2 > line.length) return !1;const timestamp = parseFloat(line[timestampIndex]),numPoints = parseInt(line[numPointsIndex]);if (isNaN(numPoints) || isNaN(timestamp)) return !1;if (parsedDatasets.data.push(timestamp), parsedDatasets.data.push(numPoints), numPoints + PerformanceViewerCollector.SliceDataOffset !== line.length) return !1;for (let i = PerformanceViewerCollector.SliceDataOffset; i < line.length; i++) {const val = parseFloat(line[i]);if (isNaN(val)) return !1;parsedDatasets.data.push(val);}parsedDatasets.startingIndices.push(startingIndex), startingIndex += line.length;}if (this.datasets.ids = parsedDatasets.ids, this.datasets.data = parsedDatasets.data, this.datasets.startingIndices = parsedDatasets.startingIndices, keepDatasetMeta || this._datasetMeta.clear(), this._strategies.forEach((strategy) => strategy.dispose()), this._strategies.clear(), !keepDatasetMeta) for (const id of this.datasets.ids) {const category = idCategoryMap.get(id);this._datasetMeta.set(id, { category, color: this._getHexColorFromId(id) });}return this.metadataObservable.notifyObservers(this._datasetMeta), this._hasLoadedData = !0, !0;}exportDataToCsv() {let csvContent = "";csvContent += `${TimestampColHeader},${NumPointsColHeader}`;for (let i = 0; i < this.datasets.ids.length; i++) if (csvContent += `,${this.datasets.ids[i]}`, this._datasetMeta) {const meta = this._datasetMeta.get(this.datasets.ids[i]);(null === meta || void 0 === meta ? void 0 : meta.category) && (csvContent += `${ExportedDataSeparator}${meta.category}`);}csvContent += "\n";for (let i = 0; i < this.datasets.startingIndices.itemLength; i++) {const startingIndex = this.datasets.startingIndices.at(i),timestamp = this.datasets.data.at(startingIndex),numPoints = this.datasets.data.at(startingIndex + PerformanceViewerCollector.NumberOfPointsOffset);csvContent += `${timestamp},${numPoints}`;for (let offset = 0; offset < numPoints; offset++) csvContent += `,${this.datasets.data.at(startingIndex + PerformanceViewerCollector.SliceDataOffset + offset)}`;for (let diff = 0; diff < this.datasets.ids.length - numPoints; diff++) csvContent += ",";csvContent += "\n";}const fileName = `${new Date().toISOString()}-perfdata.csv`;tools/* Tools.Download */.w1.Download(new Blob([csvContent], { type: "text/csv" }), fileName);}start(shouldPreserve) {shouldPreserve ? this._startingTimestamp === void 0 && (this._startingTimestamp = precisionDate/* PrecisionDate.Now */.F.Now) : (this.datasets.data = new DynamicFloat32Array(InitialArraySize), this.datasets.startingIndices = new DynamicFloat32Array(InitialArraySize), this._startingTimestamp = precisionDate/* PrecisionDate.Now */.F.Now), this._scene.onAfterRenderObservable.add(this._collectDataAtFrame), this._restoreStringEvents(), this._isStarted = !0;}stop() {this._scene.onAfterRenderObservable.removeCallback(this._collectDataAtFrame), this._isStarted = !1;}get isStarted() {return this._isStarted;}dispose() {this._scene.onAfterRenderObservable.removeCallback(this._collectDataAtFrame), this._datasetMeta.clear(), this._strategies.forEach((strategy) => {strategy.dispose();}), this.datasetObservable.clear(), this.metadataObservable.clear(), this._isStarted = !1, this.datasets = null;}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js
const defaultDisposeImpl = () => {};class PerfCollectionStrategy {static FpsStrategy() {return (scene) => {const engine = scene.getEngine();return { id: "FPS", getData: () => engine.getFps(), dispose: defaultDisposeImpl };};}static ThermalStrategy() {return this._PressureStrategy("Thermal utilization", "thermal");}static PowerSupplyStrategy() {return this._PressureStrategy("Power supply utilization", "power-supply");}static PressureStrategy() {return this._PressureStrategy("Pressure");}static _PressureStrategy(name, factor = null) {return () => {let value = 0;const wrapper = new PressureObserverWrapper();return wrapper.observe("cpu"), wrapper.onPressureChanged.add((update) => {for (const record of update) if (factor && record.factors.includes(factor) || !factor && 0 === record.factors.length) switch (record.state) {case "nominal":value = 0;break;case "fair":value = .25;break;case "serious":value = .5;break;case "critical":value = 1;}}), { id: name, getData: () => value, dispose: () => wrapper.dispose() };};}static TotalMeshesStrategy() {return (scene) => ({ id: "Total meshes", getData: () => scene.meshes.length, dispose: defaultDisposeImpl });}static ActiveMeshesStrategy() {return (scene) => ({ id: "Active meshes", getData: () => scene.getActiveMeshes().length, dispose: defaultDisposeImpl });}static ActiveIndicesStrategy() {return (scene) => ({ id: "Active indices", getData: () => scene.getActiveIndices(), dispose: defaultDisposeImpl });}static ActiveFacesStrategy() {return (scene) => ({ id: "Active faces", getData: () => scene.getActiveIndices() / 3, dispose: defaultDisposeImpl });}static ActiveBonesStrategy() {return (scene) => ({ id: "Active bones", getData: () => scene.getActiveBones(), dispose: defaultDisposeImpl });}static ActiveParticlesStrategy() {return (scene) => ({ id: "Active particles", getData: () => scene.getActiveParticles(), dispose: defaultDisposeImpl });}static DrawCallsStrategy() {return (scene) => {let drawCalls = 0;const onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {scene.getEngine()._drawCalls.fetchNewFrame();}),onAfterRenderObserver = scene.onAfterRenderObservable.add(() => {drawCalls = scene.getEngine()._drawCalls.current;});return { id: "Draw calls", getData: () => drawCalls, dispose: () => {scene.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver), scene.onAfterRenderObservable.remove(onAfterRenderObserver);} };};}static TotalLightsStrategy() {return (scene) => ({ id: "Total lights", getData: () => scene.lights.length, dispose: defaultDisposeImpl });}static TotalVerticesStrategy() {return (scene) => ({ id: "Total vertices", getData: () => scene.getTotalVertices(), dispose: defaultDisposeImpl });}static TotalMaterialsStrategy() {return (scene) => ({ id: "Total materials", getData: () => scene.materials.length, dispose: defaultDisposeImpl });}static TotalTexturesStrategy() {return (scene) => ({ id: "Total textures", getData: () => scene.textures.length, dispose: defaultDisposeImpl });}static AbsoluteFpsStrategy() {return (scene) => {const sceneInstrumentation = new SceneInstrumentation(scene);return sceneInstrumentation.captureFrameTime = !0, { id: "Absolute FPS", getData: () => 1e3 / sceneInstrumentation.frameTimeCounter.lastSecAverage, dispose: defaultDisposeImpl };};}static MeshesSelectionStrategy() {return (scene) => {let startTime = precisionDate/* PrecisionDate.Now */.F.Now,timeTaken = 0;const onBeforeActiveMeshesObserver = scene.onBeforeActiveMeshesEvaluationObservable.add(() => {startTime = precisionDate/* PrecisionDate.Now */.F.Now;}),onAfterActiveMeshesObserver = scene.onAfterActiveMeshesEvaluationObservable.add(() => {timeTaken = precisionDate/* PrecisionDate.Now */.F.Now - startTime;});return { id: "Meshes Selection", getData: () => timeTaken, dispose: () => {scene.onBeforeActiveMeshesEvaluationObservable.remove(onBeforeActiveMeshesObserver), scene.onAfterActiveMeshesEvaluationObservable.remove(onAfterActiveMeshesObserver);} };};}static RenderTargetsStrategy() {return (scene) => {let startTime = precisionDate/* PrecisionDate.Now */.F.Now,timeTaken = 0;const onBeforeRenderTargetsObserver = scene.onBeforeRenderTargetsRenderObservable.add(() => {startTime = precisionDate/* PrecisionDate.Now */.F.Now;}),onAfterRenderTargetsObserver = scene.onAfterRenderTargetsRenderObservable.add(() => {timeTaken = precisionDate/* PrecisionDate.Now */.F.Now - startTime;});return { id: "Render Targets", getData: () => timeTaken, dispose: () => {scene.onBeforeRenderTargetsRenderObservable.remove(onBeforeRenderTargetsObserver), scene.onAfterRenderTargetsRenderObservable.remove(onAfterRenderTargetsObserver);} };};}static ParticlesStrategy() {return (scene) => {let startTime = precisionDate/* PrecisionDate.Now */.F.Now,timeTaken = 0;const onBeforeParticlesObserver = scene.onBeforeParticlesRenderingObservable.add(() => {startTime = precisionDate/* PrecisionDate.Now */.F.Now;}),onAfterParticlesObserver = scene.onAfterParticlesRenderingObservable.add(() => {timeTaken = precisionDate/* PrecisionDate.Now */.F.Now - startTime;});return { id: "Particles", getData: () => timeTaken, dispose: () => {scene.onBeforeParticlesRenderingObservable.remove(onBeforeParticlesObserver), scene.onAfterParticlesRenderingObservable.remove(onAfterParticlesObserver);} };};}static SpritesStrategy() {return (scene) => {var _a, _b;let startTime = precisionDate/* PrecisionDate.Now */.F.Now,timeTaken = 0;const onBeforeSpritesObserver = null === (_a = scene.onBeforeSpritesRenderingObservable) || void 0 === _a ? void 0 : _a.add(() => {startTime = precisionDate/* PrecisionDate.Now */.F.Now;}),onAfterSpritesObserver = null === (_b = scene.onAfterSpritesRenderingObservable) || void 0 === _b ? void 0 : _b.add(() => {timeTaken = precisionDate/* PrecisionDate.Now */.F.Now - startTime;});return { id: "Sprites", getData: () => timeTaken, dispose: () => {var _a, _b;null === (_a = scene.onBeforeSpritesRenderingObservable) || void 0 === _a ? void 0 : _a.remove(onBeforeSpritesObserver), null === (_b = scene.onAfterSpritesRenderingObservable) || void 0 === _b ? void 0 : _b.remove(onAfterSpritesObserver);} };};}static AnimationsStrategy() {return (scene) => {let startTime = precisionDate/* PrecisionDate.Now */.F.Now,timeTaken = 0;const onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {startTime = precisionDate/* PrecisionDate.Now */.F.Now;}),onAfterAnimationsObserver = scene.onAfterAnimationsObservable.add(() => {timeTaken = precisionDate/* PrecisionDate.Now */.F.Now - startTime;});return { id: "Animations", getData: () => timeTaken, dispose: () => {scene.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver), scene.onAfterAnimationsObservable.remove(onAfterAnimationsObserver);} };};}static PhysicsStrategy() {return (scene) => {var _a, _b;let startTime = precisionDate/* PrecisionDate.Now */.F.Now,timeTaken = 0;const onBeforePhysicsObserver = null === (_a = scene.onBeforePhysicsObservable) || void 0 === _a ? void 0 : _a.add(() => {startTime = precisionDate/* PrecisionDate.Now */.F.Now;}),onAfterPhysicsObserver = null === (_b = scene.onAfterPhysicsObservable) || void 0 === _b ? void 0 : _b.add(() => {timeTaken = precisionDate/* PrecisionDate.Now */.F.Now - startTime;});return { id: "Physics", getData: () => timeTaken, dispose: () => {var _a, _b;null === (_a = scene.onBeforePhysicsObservable) || void 0 === _a ? void 0 : _a.remove(onBeforePhysicsObserver), null === (_b = scene.onAfterPhysicsObservable) || void 0 === _b ? void 0 : _b.remove(onAfterPhysicsObserver);} };};}static RenderStrategy() {return (scene) => {let startTime = precisionDate/* PrecisionDate.Now */.F.Now,timeTaken = 0;const onBeforeDrawPhaseObserver = scene.onBeforeDrawPhaseObservable.add(() => {startTime = precisionDate/* PrecisionDate.Now */.F.Now;}),onAfterDrawPhaseObserver = scene.onAfterDrawPhaseObservable.add(() => {timeTaken = precisionDate/* PrecisionDate.Now */.F.Now - startTime;});return { id: "Render", getData: () => timeTaken, dispose: () => {scene.onBeforeDrawPhaseObservable.remove(onBeforeDrawPhaseObserver), scene.onAfterDrawPhaseObservable.remove(onAfterDrawPhaseObserver);} };};}static FrameTotalStrategy() {return (scene) => {let startTime = precisionDate/* PrecisionDate.Now */.F.Now,timeTaken = 0;const onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {startTime = precisionDate/* PrecisionDate.Now */.F.Now;}),onAfterRenderObserver = scene.onAfterRenderObservable.add(() => {timeTaken = precisionDate/* PrecisionDate.Now */.F.Now - startTime;});return { id: "Frame Total", getData: () => timeTaken, dispose: () => {scene.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver), scene.onAfterRenderObservable.remove(onAfterRenderObserver);} };};}static InterFrameStrategy() {return (scene) => {let startTime = precisionDate/* PrecisionDate.Now */.F.Now,timeTaken = 0;const onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {timeTaken = precisionDate/* PrecisionDate.Now */.F.Now - startTime;}),onAfterRenderObserver = scene.onAfterRenderObservable.add(() => {startTime = precisionDate/* PrecisionDate.Now */.F.Now;});return { id: "Inter-frame", getData: () => timeTaken, dispose: () => {scene.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver), scene.onAfterRenderObservable.remove(onAfterRenderObserver);} };};}static GpuFrameTimeStrategy() {return (scene) => {const engineInstrumentation = new EngineInstrumentation(scene.getEngine());return engineInstrumentation.captureGPUFrameTime = !0, { id: "GPU frame time", getData: () => Math.max(1e-6 * engineInstrumentation.gpuFrameTimeCounter.current, 0), dispose: () => {engineInstrumentation.dispose();} };};}}
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerSceneExtension.js
core_scene/* Scene.prototype.getPerfCollector */.x.prototype.getPerfCollector = function () {return this._perfCollector || (this._perfCollector = new PerformanceViewerCollector(this)), this._perfCollector;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/PerformanceViewer/index.js

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/coroutine.js
var Misc_coroutine = __webpack_require__("./node_modules/@babylonjs/core/Misc/coroutine.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/observableCoroutine.js
function CreateObservableScheduler(observable) {const coroutines = [],onSteps = [],onErrors = [],observer = observable.add(() => {const count = coroutines.length;for (let i = 0; i < count; i++) (0,Misc_coroutine/* inlineScheduler */.WP)(coroutines.shift(), onSteps.shift(), onErrors.shift());});return { scheduler: (coroutine, onStep, onError) => {coroutines.push(coroutine), onSteps.push(onStep), onErrors.push(onError);}, dispose: () => {observable.remove(observer);} };}observable/* Observable.prototype.runCoroutineAsync */.y$.prototype.runCoroutineAsync = function (coroutine) {if (!this._coroutineScheduler) {const schedulerAndDispose = CreateObservableScheduler(this);this._coroutineScheduler = schedulerAndDispose.scheduler, this._coroutineSchedulerDispose = schedulerAndDispose.dispose;}return (0,Misc_coroutine/* runCoroutineAsync */.sM)(coroutine, this._coroutineScheduler);}, observable/* Observable.prototype.cancelAllCoroutines */.y$.prototype.cancelAllCoroutines = function () {this._coroutineSchedulerDispose && this._coroutineSchedulerDispose(), this._coroutineScheduler = void 0, this._coroutineSchedulerDispose = void 0;};
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Misc/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRHitTestLegacy.js
class WebXRHitTestLegacy extends WebXRAbstractFeature {constructor(_xrSessionManager, options = {}) {super(_xrSessionManager), this.options = options, this._direction = new math_vector/* Vector3 */.P(0, 0, -1), this._mat = new math_vector/* Matrix */.y3(), this._onSelectEnabled = !1, this._origin = new math_vector/* Vector3 */.P(0, 0, 0), this.lastNativeXRHitResults = [], this.onHitTestResultObservable = new observable/* Observable */.y$(), this._onHitTestResults = (xrResults) => {const mats = xrResults.map((result) => {const mat = math_vector/* Matrix.FromArray */.y3.FromArray(result.hitMatrix);return this._xrSessionManager.scene.useRightHandedSystem || mat.toggleModelMatrixHandInPlace(), this.options.worldParentNode && mat.multiplyToRef(this.options.worldParentNode.getWorldMatrix(), mat), { xrHitResult: result, transformationMatrix: mat };});this.lastNativeXRHitResults = xrResults, this.onHitTestResultObservable.notifyObservers(mats);}, this._onSelect = (event) => {this._onSelectEnabled && WebXRHitTestLegacy.XRHitTestWithSelectEvent(event, this._xrSessionManager.referenceSpace);}, this.xrNativeFeatureName = "hit-test", tools/* Tools.Warn */.w1.Warn("A newer version of this plugin is available");}static XRHitTestWithRay(xrSession, xrRay, referenceSpace, filter) {return xrSession.requestHitTest(xrRay, referenceSpace).then((results) => {return results.filter(filter || ((result) => !!result.hitMatrix));});}static XRHitTestWithSelectEvent(event, referenceSpace) {const targetRayPose = event.frame.getPose(event.inputSource.targetRaySpace, referenceSpace);if (!targetRayPose) return Promise.resolve([]);const targetRay = new XRRay(targetRayPose.transform);return this.XRHitTestWithRay(event.frame.session, targetRay, referenceSpace);}attach() {return !!super.attach() && (this.options.testOnPointerDownOnly && this._xrSessionManager.session.addEventListener("select", this._onSelect, !1), !0);}detach() {return !!super.detach() && (this._onSelectEnabled = !1, this._xrSessionManager.session.removeEventListener("select", this._onSelect), !0);}dispose() {super.dispose(), this.onHitTestResultObservable.clear();}_onXRFrame(frame) {if (this.attached && !this.options.testOnPointerDownOnly) {const pose = frame.getViewerPose(this._xrSessionManager.referenceSpace);if (pose) {math_vector/* Matrix.FromArrayToRef */.y3.FromArrayToRef(pose.transform.matrix, 0, this._mat), math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(0, 0, 0, this._mat, this._origin), math_vector/* Vector3.TransformCoordinatesFromFloatsToRef */.P.TransformCoordinatesFromFloatsToRef(0, 0, -1, this._mat, this._direction), this._direction.subtractInPlace(this._origin), this._direction.normalize();const ray = new XRRay({ x: this._origin.x, y: this._origin.y, z: this._origin.z, w: 0 }, { x: this._direction.x, y: this._direction.y, z: this._direction.z, w: 0 });WebXRHitTestLegacy.XRHitTestWithRay(this._xrSessionManager.session, ray, this._xrSessionManager.referenceSpace).then(this._onHitTestResults);}}}}WebXRHitTestLegacy.Name = WebXRFeatureName.HIT_TEST, WebXRHitTestLegacy.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRHitTestLegacy.Name, (xrSessionManager, options) => () => new WebXRHitTestLegacy(xrSessionManager, options), WebXRHitTestLegacy.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRAnchorSystem.js
let anchorIdProvider = 0;class WebXRAnchorSystem extends WebXRAbstractFeature {set referenceSpaceForFrameAnchors(referenceSpace) {this._referenceSpaceForFrameAnchors = referenceSpace;}constructor(_xrSessionManager, _options = {}) {super(_xrSessionManager), this._options = _options, this._lastFrameDetected = new Set(), this._trackedAnchors = [], this._futureAnchors = [], this.onAnchorAddedObservable = new observable/* Observable */.y$(), this.onAnchorRemovedObservable = new observable/* Observable */.y$(), this.onAnchorUpdatedObservable = new observable/* Observable */.y$(), this._tmpVector = new math_vector/* Vector3 */.P(), this._tmpQuaternion = new math_vector/* Quaternion */._f(), this.xrNativeFeatureName = "anchors";}_populateTmpTransformation(position, rotationQuaternion) {return this._tmpVector.copyFrom(position), this._tmpQuaternion.copyFrom(rotationQuaternion), this._xrSessionManager.scene.useRightHandedSystem || (this._tmpVector.z *= -1, this._tmpQuaternion.z *= -1, this._tmpQuaternion.w *= -1), { position: this._tmpVector, rotationQuaternion: this._tmpQuaternion };}async addAnchorPointUsingHitTestResultAsync(hitTestResult, position = new math_vector/* Vector3 */.P(), rotationQuaternion = new math_vector/* Quaternion */._f()) {this._populateTmpTransformation(position, rotationQuaternion);const m = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w });if (!hitTestResult.xrHitResult.createAnchor) throw this.detach(), new Error("Anchors not enabled in this environment/browser");else try {const nativeAnchor = await hitTestResult.xrHitResult.createAnchor(m);return new Promise((resolve, reject) => {this._futureAnchors.push({ nativeAnchor, resolved: !1, submitted: !0, xrTransformation: m, resolve, reject });});} catch (error) {throw new Error(error);}}async addAnchorAtPositionAndRotationAsync(position, rotationQuaternion = new math_vector/* Quaternion */._f(), forceCreateInCurrentFrame = !1) {this._populateTmpTransformation(position, rotationQuaternion);const xrTransformation = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w }),xrAnchor = forceCreateInCurrentFrame && this.attached && this._xrSessionManager.currentFrame ? await this._createAnchorAtTransformation(xrTransformation, this._xrSessionManager.currentFrame) : void 0;return new Promise((resolve, reject) => {this._futureAnchors.push({ nativeAnchor: xrAnchor, resolved: !1, submitted: !1, xrTransformation, resolve, reject });});}get anchors() {return this._trackedAnchors;}detach() {if (!super.detach()) return !1;if (!this._options.doNotRemoveAnchorsOnSessionEnded) for (; this._trackedAnchors.length;) {const toRemove = this._trackedAnchors.pop();if (toRemove) {try {toRemove.remove();} catch (e) {}this.onAnchorRemovedObservable.notifyObservers(toRemove);}}return !0;}dispose() {this._futureAnchors.length = 0, super.dispose(), this.onAnchorAddedObservable.clear(), this.onAnchorRemovedObservable.clear(), this.onAnchorUpdatedObservable.clear();}_onXRFrame(frame) {if (!this.attached || !frame) return;const trackedAnchors = frame.trackedAnchors;if (trackedAnchors) {const toRemove = this._trackedAnchors.filter((anchor) => !trackedAnchors.has(anchor.xrAnchor)).map((anchor) => {const index = this._trackedAnchors.indexOf(anchor);return index;});let idxTracker = 0;toRemove.forEach((index) => {const anchor = this._trackedAnchors.splice(index - idxTracker, 1)[0];this.onAnchorRemovedObservable.notifyObservers(anchor), idxTracker++;}), trackedAnchors.forEach((xrAnchor) => {if (!this._lastFrameDetected.has(xrAnchor)) {const newAnchor = { id: anchorIdProvider++, xrAnchor: xrAnchor, remove: () => xrAnchor.delete() },anchor = this._updateAnchorWithXRFrame(xrAnchor, newAnchor, frame);this._trackedAnchors.push(anchor), this.onAnchorAddedObservable.notifyObservers(anchor);const results = this._futureAnchors.filter((futureAnchor) => futureAnchor.nativeAnchor === xrAnchor),result = results[0];result && (result.resolve(anchor), result.resolved = !0);} else {const index = this._findIndexInAnchorArray(xrAnchor),anchor = this._trackedAnchors[index];try {this._updateAnchorWithXRFrame(xrAnchor, anchor, frame), anchor.attachedNode && (anchor.attachedNode.rotationQuaternion = anchor.attachedNode.rotationQuaternion || new math_vector/* Quaternion */._f(), anchor.transformationMatrix.decompose(anchor.attachedNode.scaling, anchor.attachedNode.rotationQuaternion, anchor.attachedNode.position)), this.onAnchorUpdatedObservable.notifyObservers(anchor);} catch (e) {tools/* Tools.Warn */.w1.Warn(`Anchor could not be updated`);}}}), this._lastFrameDetected = trackedAnchors;}this._futureAnchors.forEach((futureAnchor) => {futureAnchor.resolved || futureAnchor.submitted || (this._createAnchorAtTransformation(futureAnchor.xrTransformation, frame).then((nativeAnchor) => {futureAnchor.nativeAnchor = nativeAnchor;}, (error) => {futureAnchor.resolved = !0, futureAnchor.reject(error);}), futureAnchor.submitted = !0);});}_findIndexInAnchorArray(xrAnchor) {for (let i = 0; i < this._trackedAnchors.length; ++i) if (this._trackedAnchors[i].xrAnchor === xrAnchor) return i;return -1;}_updateAnchorWithXRFrame(xrAnchor, anchor, xrFrame) {const pose = xrFrame.getPose(xrAnchor.anchorSpace, this._xrSessionManager.referenceSpace);if (pose) {const mat = anchor.transformationMatrix || new math_vector/* Matrix */.y3();math_vector/* Matrix.FromArrayToRef */.y3.FromArrayToRef(pose.transform.matrix, 0, mat), this._xrSessionManager.scene.useRightHandedSystem || mat.toggleModelMatrixHandInPlace(), anchor.transformationMatrix = mat, this._options.worldParentNode && mat.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), mat);}return anchor;}async _createAnchorAtTransformation(xrTransformation, xrFrame) {var _a;if (xrFrame.createAnchor) try {return xrFrame.createAnchor(xrTransformation, null !== (_a = this._referenceSpaceForFrameAnchors) && void 0 !== _a ? _a : this._xrSessionManager.referenceSpace);} catch (error) {throw new Error(error);} else throw this.detach(), new Error("Anchors are not enabled in your browser");}}WebXRAnchorSystem.Name = WebXRFeatureName.ANCHOR_SYSTEM, WebXRAnchorSystem.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRAnchorSystem.Name, (xrSessionManager, options) => () => new WebXRAnchorSystem(xrSessionManager, options), WebXRAnchorSystem.Version);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRPlaneDetector.js
let planeIdProvider = 0;class WebXRPlaneDetector extends WebXRAbstractFeature {constructor(_xrSessionManager, _options = {}) {super(_xrSessionManager), this._options = _options, this._detectedPlanes = [], this._enabled = !1, this._lastFrameDetected = new Set(), this.onPlaneAddedObservable = new observable/* Observable */.y$(), this.onPlaneRemovedObservable = new observable/* Observable */.y$(), this.onPlaneUpdatedObservable = new observable/* Observable */.y$(), this.xrNativeFeatureName = "plane-detection", this._xrSessionManager.session ? this._init() : this._xrSessionManager.onXRSessionInit.addOnce(() => {this._init();});}detach() {if (!super.detach()) return !1;if (!this._options.doNotRemovePlanesOnSessionEnded) for (; this._detectedPlanes.length;) {const toRemove = this._detectedPlanes.pop();toRemove && this.onPlaneRemovedObservable.notifyObservers(toRemove);}return !0;}dispose() {super.dispose(), this.onPlaneAddedObservable.clear(), this.onPlaneRemovedObservable.clear(), this.onPlaneUpdatedObservable.clear();}isCompatible() {return "undefined" != typeof XRPlane;}_onXRFrame(frame) {var _a;if (this.attached && this._enabled && frame) {const detectedPlanes = frame.detectedPlanes || (null === (_a = frame.worldInformation) || void 0 === _a ? void 0 : _a.detectedPlanes);if (detectedPlanes) {for (let planeIdx = 0; planeIdx < this._detectedPlanes.length; planeIdx++) {const plane = this._detectedPlanes[planeIdx];detectedPlanes.has(plane.xrPlane) || (this._detectedPlanes.splice(planeIdx--, 1), this.onPlaneRemovedObservable.notifyObservers(plane));}detectedPlanes.forEach((xrPlane) => {if (!this._lastFrameDetected.has(xrPlane)) {const newPlane = { id: planeIdProvider++, xrPlane: xrPlane, polygonDefinition: [] },plane = this._updatePlaneWithXRPlane(xrPlane, newPlane, frame);this._detectedPlanes.push(plane), this.onPlaneAddedObservable.notifyObservers(plane);} else if (xrPlane.lastChangedTime === this._xrSessionManager.currentTimestamp) {const index = this._findIndexInPlaneArray(xrPlane),plane = this._detectedPlanes[index];this._updatePlaneWithXRPlane(xrPlane, plane, frame), this.onPlaneUpdatedObservable.notifyObservers(plane);}}), this._lastFrameDetected = detectedPlanes;}}}_init() {const internalInit = () => {this._enabled = !0, this._detectedPlanes.length && (this._detectedPlanes.length = 0);};return !this._xrSessionManager.isNative || !this._options.preferredDetectorOptions || !this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions || this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions(this._options.preferredDetectorOptions), this._xrSessionManager.session.updateWorldTrackingState ? void (this._xrSessionManager.session.updateWorldTrackingState({ planeDetectionState: { enabled: !0 } }), internalInit()) : void internalInit();}_updatePlaneWithXRPlane(xrPlane, plane, xrFrame) {plane.polygonDefinition = xrPlane.polygon.map((xrPoint) => {const rightHandedSystem = this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1;return new math_vector/* Vector3 */.P(xrPoint.x, xrPoint.y, xrPoint.z * rightHandedSystem);});const pose = xrFrame.getPose(xrPlane.planeSpace, this._xrSessionManager.referenceSpace);if (pose) {const mat = plane.transformationMatrix || new math_vector/* Matrix */.y3();math_vector/* Matrix.FromArrayToRef */.y3.FromArrayToRef(pose.transform.matrix, 0, mat), this._xrSessionManager.scene.useRightHandedSystem || mat.toggleModelMatrixHandInPlace(), plane.transformationMatrix = mat, this._options.worldParentNode && mat.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), mat);}return plane;}_findIndexInPlaneArray(xrPlane) {for (let i = 0; i < this._detectedPlanes.length; ++i) if (this._detectedPlanes[i].xrPlane === xrPlane) return i;return -1;}}WebXRPlaneDetector.Name = WebXRFeatureName.PLANE_DETECTION, WebXRPlaneDetector.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRPlaneDetector.Name, (xrSessionManager, options) => () => new WebXRPlaneDetector(xrSessionManager, options), WebXRPlaneDetector.Version);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRBackgroundRemover.js
class WebXRBackgroundRemover extends WebXRAbstractFeature {constructor(_xrSessionManager, options = {}) {super(_xrSessionManager), this.options = options, this.onBackgroundStateChangedObservable = new observable/* Observable */.y$();}attach() {return this._setBackgroundState(!1), super.attach();}detach() {return this._setBackgroundState(!0), super.detach();}dispose() {super.dispose(), this.onBackgroundStateChangedObservable.clear();}_onXRFrame() {}_setBackgroundState(newState) {const scene = this._xrSessionManager.scene;if (!this.options.ignoreEnvironmentHelper) if (this.options.environmentHelperRemovalFlags) {if (this.options.environmentHelperRemovalFlags.skyBox) {const backgroundSkybox = scene.getMeshByName("BackgroundSkybox");backgroundSkybox && backgroundSkybox.setEnabled(newState);}if (this.options.environmentHelperRemovalFlags.ground) {const backgroundPlane = scene.getMeshByName("BackgroundPlane");backgroundPlane && backgroundPlane.setEnabled(newState);}} else {const backgroundHelper = scene.getMeshByName("BackgroundHelper");backgroundHelper && backgroundHelper.setEnabled(newState);}this.options.backgroundMeshes && this.options.backgroundMeshes.forEach((mesh) => mesh.setEnabled(newState)), this.onBackgroundStateChangedObservable.notifyObservers(newState);}}WebXRBackgroundRemover.Name = WebXRFeatureName.BACKGROUND_REMOVER, WebXRBackgroundRemover.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRBackgroundRemover.Name, (xrSessionManager, options) => () => new WebXRBackgroundRemover(xrSessionManager, options), WebXRBackgroundRemover.Version, !0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRControllerPhysics.js
class IWebXRControllerPhysicsOptions {}class WebXRControllerPhysics extends WebXRAbstractFeature {_createPhysicsImpostor(xrController) {const impostorType = this._options.physicsProperties.impostorType || PhysicsImpostor.SphereImpostor,impostorSize = this._options.physicsProperties.impostorSize || .1,impostorMesh = CreateSphere("impostor-mesh-" + xrController.uniqueId, { diameterX: "number" == typeof impostorSize ? impostorSize : impostorSize.width, diameterY: "number" == typeof impostorSize ? impostorSize : impostorSize.height, diameterZ: "number" == typeof impostorSize ? impostorSize : impostorSize.depth });impostorMesh.isVisible = this._debugMode, impostorMesh.isPickable = !1, impostorMesh.rotationQuaternion = new math_vector/* Quaternion */._f();const controllerMesh = xrController.grip || xrController.pointer;impostorMesh.position.copyFrom(controllerMesh.position), impostorMesh.rotationQuaternion.copyFrom(controllerMesh.rotationQuaternion);const impostor = new PhysicsImpostor(impostorMesh, impostorType, { mass: 0, ...this._options.physicsProperties });this._controllers[xrController.uniqueId] = { xrController, impostor, impostorMesh };}constructor(_xrSessionManager, _options) {super(_xrSessionManager), this._options = _options, this._attachController = (xrController) => {this._controllers[xrController.uniqueId] || (!this._xrSessionManager.scene.isPhysicsEnabled() && logger/* Logger.Warn */.Y.Warn("physics engine not enabled, skipped. Please add this controller manually."), this._options.physicsProperties.useControllerMesh && xrController.inputSource.gamepad ? xrController.onMotionControllerInitObservable.addOnce((motionController) => {motionController._doNotLoadControllerMesh ? this._createPhysicsImpostor(xrController) : motionController.onModelLoadedObservable.addOnce(() => {const impostor = new PhysicsImpostor(motionController.rootMesh, PhysicsImpostor.MeshImpostor, { mass: 0, ...this._options.physicsProperties }),controllerMesh = xrController.grip || xrController.pointer;this._controllers[xrController.uniqueId] = { xrController, impostor, oldPos: controllerMesh.position.clone(), oldRotation: controllerMesh.rotationQuaternion.clone() };});}) : this._createPhysicsImpostor(xrController));}, this._controllers = {}, this._debugMode = !1, this._delta = 0, this._lastTimestamp = 0, this._tmpQuaternion = new math_vector/* Quaternion */._f(), this._tmpVector = new math_vector/* Vector3 */.P(), this._options.physicsProperties || (this._options.physicsProperties = {});}_enablePhysicsDebug() {this._debugMode = !0, Object.keys(this._controllers).forEach((controllerId) => {const controllerData = this._controllers[controllerId];controllerData.impostorMesh && (controllerData.impostorMesh.isVisible = !0);});}addController(xrController) {this._attachController(xrController);}attach() {if (!super.attach()) return !1;if (!this._options.xrInput) return !0;if (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (controller) => {this._detachController(controller.uniqueId);}), this._options.enableHeadsetImpostor) {const params = this._options.headsetImpostorParams || { impostorType: PhysicsImpostor.SphereImpostor, restitution: .8, impostorSize: .3 },impostorSize = params.impostorSize || .3;this._headsetMesh = CreateSphere("headset-mesh", { diameterX: "number" == typeof impostorSize ? impostorSize : impostorSize.width, diameterY: "number" == typeof impostorSize ? impostorSize : impostorSize.height, diameterZ: "number" == typeof impostorSize ? impostorSize : impostorSize.depth }), this._headsetMesh.rotationQuaternion = new math_vector/* Quaternion */._f(), this._headsetMesh.isVisible = !1, this._headsetImpostor = new PhysicsImpostor(this._headsetMesh, params.impostorType, { mass: 0, ...params });}return !0;}detach() {return !!super.detach() && (Object.keys(this._controllers).forEach((controllerId) => {this._detachController(controllerId);}), this._headsetMesh && this._headsetMesh.dispose(), !0);}getHeadsetImpostor() {return this._headsetImpostor;}getImpostorForController(controller) {const id = "string" == typeof controller ? controller : controller.uniqueId;return this._controllers[id] ? this._controllers[id].impostor : null;}setPhysicsProperties(newProperties) {this._options.physicsProperties = { ...this._options.physicsProperties, ...newProperties };}_onXRFrame() {var _a, _b;if (this._delta = this._xrSessionManager.currentTimestamp - this._lastTimestamp, this._lastTimestamp = this._xrSessionManager.currentTimestamp, this._headsetMesh && this._headsetImpostor) {if (this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.globalPosition), this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.absoluteRotation), null === (_a = this._options.xrInput.xrCamera._lastXRViewerPose) || void 0 === _a ? void 0 : _a.linearVelocity) {const lv = this._options.xrInput.xrCamera._lastXRViewerPose.linearVelocity;this._tmpVector.set(lv.x, lv.y, lv.z), this._headsetImpostor.setLinearVelocity(this._tmpVector);}if (null === (_b = this._options.xrInput.xrCamera._lastXRViewerPose) || void 0 === _b ? void 0 : _b.angularVelocity) {const av = this._options.xrInput.xrCamera._lastXRViewerPose.angularVelocity;this._tmpVector.set(av.x, av.y, av.z), this._headsetImpostor.setAngularVelocity(this._tmpVector);}}Object.keys(this._controllers).forEach((controllerId) => {var _a, _b;const controllerData = this._controllers[controllerId],controllerMesh = controllerData.xrController.grip || controllerData.xrController.pointer,comparedPosition = controllerData.oldPos || controllerData.impostorMesh.position;if (null === (_a = controllerData.xrController._lastXRPose) || void 0 === _a ? void 0 : _a.linearVelocity) {const lv = controllerData.xrController._lastXRPose.linearVelocity;this._tmpVector.set(lv.x, lv.y, lv.z), controllerData.impostor.setLinearVelocity(this._tmpVector);} else controllerMesh.position.subtractToRef(comparedPosition, this._tmpVector), this._tmpVector.scaleInPlace(1e3 / this._delta), controllerData.impostor.setLinearVelocity(this._tmpVector);comparedPosition.copyFrom(controllerMesh.position), this._debugMode && console.log(this._tmpVector, "linear");const comparedQuaternion = controllerData.oldRotation || controllerData.impostorMesh.rotationQuaternion;if (null === (_b = controllerData.xrController._lastXRPose) || void 0 === _b ? void 0 : _b.angularVelocity) {const av = controllerData.xrController._lastXRPose.angularVelocity;this._tmpVector.set(av.x, av.y, av.z), controllerData.impostor.setAngularVelocity(this._tmpVector);} else if (!comparedQuaternion.equalsWithEpsilon(controllerMesh.rotationQuaternion)) {comparedQuaternion.conjugateInPlace().multiplyToRef(controllerMesh.rotationQuaternion, this._tmpQuaternion);const len = Math.sqrt(this._tmpQuaternion.x * this._tmpQuaternion.x + this._tmpQuaternion.y * this._tmpQuaternion.y + this._tmpQuaternion.z * this._tmpQuaternion.z);if (this._tmpVector.set(this._tmpQuaternion.x, this._tmpQuaternion.y, this._tmpQuaternion.z), .001 > len) this._tmpVector.scaleInPlace(2);else {const angle = 2 * Math.atan2(len, this._tmpQuaternion.w);this._tmpVector.scaleInPlace(angle / (len * (this._delta / 1e3)));}controllerData.impostor.setAngularVelocity(this._tmpVector);}comparedQuaternion.copyFrom(controllerMesh.rotationQuaternion), this._debugMode && console.log(this._tmpVector, this._tmpQuaternion, "angular");});}_detachController(xrControllerUniqueId) {const controllerData = this._controllers[xrControllerUniqueId];controllerData && (controllerData.impostorMesh && controllerData.impostorMesh.dispose(), delete this._controllers[xrControllerUniqueId]);}}WebXRControllerPhysics.Name = WebXRFeatureName.PHYSICS_CONTROLLERS, WebXRControllerPhysics.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRControllerPhysics.Name, (xrSessionManager, options) => () => new WebXRControllerPhysics(xrSessionManager, options), WebXRControllerPhysics.Version, !0);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRHitTest.js
class WebXRHitTest extends WebXRAbstractFeature {constructor(_xrSessionManager, options = {}) {super(_xrSessionManager), this.options = options, this._tmpMat = new math_vector/* Matrix */.y3(), this._tmpPos = new math_vector/* Vector3 */.P(), this._tmpQuat = new math_vector/* Quaternion */._f(), this._initHitTestSource = (referenceSpace) => {if (!referenceSpace) return;const offsetRay = new XRRay(this.options.offsetRay || {}),hitTestOptions = { space: this.options.useReferenceSpace ? referenceSpace : this._xrSessionManager.viewerReferenceSpace, offsetRay: offsetRay };return this.options.entityTypes && (hitTestOptions.entityTypes = this.options.entityTypes), hitTestOptions.space ? void this._xrSessionManager.session.requestHitTestSource(hitTestOptions).then((hitTestSource) => {this._xrHitTestSource && this._xrHitTestSource.cancel(), this._xrHitTestSource = hitTestSource;}) : void tools/* Tools.Warn */.w1.Warn("waiting for viewer reference space to initialize");}, this.autoCloneTransformation = !1, this.onHitTestResultObservable = new observable/* Observable */.y$(), this.paused = !1, this.xrNativeFeatureName = "hit-test", tools/* Tools.Warn */.w1.Warn("Hit test is an experimental and unstable feature.");}attach() {if (!super.attach()) return !1;if (!this._xrSessionManager.session.requestHitTestSource) return !1;if (this.options.disablePermanentHitTest || (this._xrSessionManager.referenceSpace && this._initHitTestSource(this._xrSessionManager.referenceSpace), this._xrSessionManager.onXRReferenceSpaceChanged.add(this._initHitTestSource)), this.options.enableTransientHitTest) {const offsetRay = new XRRay(this.options.transientOffsetRay || {});this._xrSessionManager.session.requestHitTestSourceForTransientInput({ profile: this.options.transientHitTestProfile || "generic-touchscreen", offsetRay, entityTypes: this.options.entityTypes }).then((hitSource) => {this._transientXrHitTestSource = hitSource;});}return !0;}detach() {return !!super.detach() && (this._xrHitTestSource && (this._xrHitTestSource.cancel(), this._xrHitTestSource = null), this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this._initHitTestSource), this._transientXrHitTestSource && (this._transientXrHitTestSource.cancel(), this._transientXrHitTestSource = null), !0);}dispose() {super.dispose(), this.onHitTestResultObservable.clear();}_onXRFrame(frame) {if (this.attached && !this.paused) {if (this._xrHitTestSource) {const results = frame.getHitTestResults(this._xrHitTestSource);this._processWebXRHitTestResult(results);}if (this._transientXrHitTestSource) {const hitTestResultsPerInputSource = frame.getHitTestResultsForTransientInput(this._transientXrHitTestSource);hitTestResultsPerInputSource.forEach((resultsPerInputSource) => {this._processWebXRHitTestResult(resultsPerInputSource.results, resultsPerInputSource.inputSource);});}}}_processWebXRHitTestResult(hitTestResults, inputSource) {const results = [];hitTestResults.forEach((hitTestResult) => {const pose = hitTestResult.getPose(this._xrSessionManager.referenceSpace);if (!pose) return;const pos = pose.transform.position,quat = pose.transform.orientation;this._tmpPos.set(pos.x, pos.y, pos.z), this._tmpQuat.set(quat.x, quat.y, quat.z, quat.w), math_vector/* Matrix.FromFloat32ArrayToRefScaled */.y3.FromFloat32ArrayToRefScaled(pose.transform.matrix, 0, 1, this._tmpMat), this._xrSessionManager.scene.useRightHandedSystem || (this._tmpPos.z *= -1, this._tmpQuat.z *= -1, this._tmpQuat.w *= -1, this._tmpMat.toggleModelMatrixHandInPlace());const result = { position: this.autoCloneTransformation ? this._tmpPos.clone() : this._tmpPos, rotationQuaternion: this.autoCloneTransformation ? this._tmpQuat.clone() : this._tmpQuat, transformationMatrix: this.autoCloneTransformation ? this._tmpMat.clone() : this._tmpMat, inputSource: inputSource, isTransient: !!inputSource, xrHitResult: hitTestResult };results.push(result);}), this.onHitTestResultObservable.notifyObservers(results);}}WebXRHitTest.Name = WebXRFeatureName.HIT_TEST, WebXRHitTest.Version = 2, WebXRFeaturesManager.AddWebXRFeature(WebXRHitTest.Name, (xrSessionManager, options) => () => new WebXRHitTest(xrSessionManager, options), WebXRHitTest.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRFeaturePointSystem.js
class WebXRFeaturePointSystem extends WebXRAbstractFeature {get featurePointCloud() {return this._featurePointCloud;}constructor(_xrSessionManager) {super(_xrSessionManager), this._enabled = !1, this._featurePointCloud = [], this.onFeaturePointsAddedObservable = new observable/* Observable */.y$(), this.onFeaturePointsUpdatedObservable = new observable/* Observable */.y$(), this.xrNativeFeatureName = "bjsfeature-points", this._xrSessionManager.session ? this._init() : this._xrSessionManager.onXRSessionInit.addOnce(() => {this._init();});}detach() {return !!super.detach() && (this.featurePointCloud.length = 0, !0);}dispose() {super.dispose(), this._featurePointCloud.length = 0, this.onFeaturePointsUpdatedObservable.clear(), this.onFeaturePointsAddedObservable.clear();}_onXRFrame(frame) {if (this.attached && this._enabled && frame) {const featurePointRawData = frame.featurePointCloud;if (!featurePointRawData || 0 === featurePointRawData.length) return;else {if (0 != featurePointRawData.length % 5) throw new Error("Received malformed feature point cloud of length: " + featurePointRawData.length);const numberOfFeaturePoints = featurePointRawData.length / 5,updatedFeaturePoints = [],addedFeaturePoints = [];for (let i = 0; i < numberOfFeaturePoints; i++) {const rawIndex = 5 * i,id = featurePointRawData[rawIndex + 4];this._featurePointCloud[id] ? updatedFeaturePoints.push(id) : (this._featurePointCloud[id] = { position: new math_vector/* Vector3 */.P(), confidenceValue: 0 }, addedFeaturePoints.push(id)), this._featurePointCloud[id].position.x = featurePointRawData[rawIndex], this._featurePointCloud[id].position.y = featurePointRawData[rawIndex + 1], this._featurePointCloud[id].position.z = featurePointRawData[rawIndex + 2], this._featurePointCloud[id].confidenceValue = featurePointRawData[rawIndex + 3];}0 < addedFeaturePoints.length && this.onFeaturePointsAddedObservable.notifyObservers(addedFeaturePoints), 0 < updatedFeaturePoints.length && this.onFeaturePointsUpdatedObservable.notifyObservers(updatedFeaturePoints);}}}_init() {this._xrSessionManager.session.trySetFeaturePointCloudEnabled && this._xrSessionManager.session.trySetFeaturePointCloudEnabled(!0) && (this._enabled = !0);}}WebXRFeaturePointSystem.Name = WebXRFeatureName.FEATURE_POINTS, WebXRFeaturePointSystem.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRFeaturePointSystem.Name, (xrSessionManager) => () => new WebXRFeaturePointSystem(xrSessionManager), WebXRFeaturePointSystem.Version);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRMeshDetector.js
let meshIdProvider = 0;class WebXRMeshDetector extends WebXRAbstractFeature {constructor(_xrSessionManager, _options = {}) {super(_xrSessionManager), this._options = _options, this._detectedMeshes = new Map(), this.onMeshAddedObservable = new observable/* Observable */.y$(), this.onMeshRemovedObservable = new observable/* Observable */.y$(), this.onMeshUpdatedObservable = new observable/* Observable */.y$(), this.xrNativeFeatureName = "mesh-detection", this._xrSessionManager.session ? this._init() : this._xrSessionManager.onXRSessionInit.addOnce(() => {this._init();});}detach() {return !!super.detach() && (!this._xrSessionManager.isNative || !this._xrSessionManager.session.trySetMeshDetectorEnabled || this._xrSessionManager.session.trySetMeshDetectorEnabled(!1), this._options.doNotRemoveMeshesOnSessionEnded || (this._detectedMeshes.forEach((mesh) => {this.onMeshRemovedObservable.notifyObservers(mesh);}), this._detectedMeshes.clear()), !0);}dispose() {super.dispose(), this.onMeshAddedObservable.clear(), this.onMeshRemovedObservable.clear(), this.onMeshUpdatedObservable.clear();}_onXRFrame(frame) {var _a;try {if (!this.attached || !frame) return;const detectedMeshes = null === (_a = frame.worldInformation) || void 0 === _a ? void 0 : _a.detectedMeshes;if (detectedMeshes) {const toRemove = new Set();this._detectedMeshes.forEach((vertexData, xrMesh) => {detectedMeshes.has(xrMesh) || toRemove.add(xrMesh);}), toRemove.forEach((xrMesh) => {const vertexData = this._detectedMeshes.get(xrMesh);vertexData && (this.onMeshRemovedObservable.notifyObservers(vertexData), this._detectedMeshes.delete(xrMesh));}), detectedMeshes.forEach((xrMesh) => {if (!this._detectedMeshes.has(xrMesh)) {const partialVertexData = { id: meshIdProvider++, xrMesh: xrMesh },vertexData = this._updateVertexDataWithXRMesh(xrMesh, partialVertexData, frame);this._detectedMeshes.set(xrMesh, vertexData), this.onMeshAddedObservable.notifyObservers(vertexData);} else if (xrMesh.lastChangedTime === this._xrSessionManager.currentTimestamp) {const vertexData = this._detectedMeshes.get(xrMesh);vertexData && (this._updateVertexDataWithXRMesh(xrMesh, vertexData, frame), this.onMeshUpdatedObservable.notifyObservers(vertexData));}});}} catch (error) {console.log(error.stack);}}_init() {this._xrSessionManager.isNative && (this._xrSessionManager.session.trySetMeshDetectorEnabled && this._xrSessionManager.session.trySetMeshDetectorEnabled(!0), !!this._options.preferredDetectorOptions && !!this._xrSessionManager.session.trySetPreferredMeshDetectorOptions && this._xrSessionManager.session.trySetPreferredMeshDetectorOptions(this._options.preferredDetectorOptions));}_updateVertexDataWithXRMesh(xrMesh, mesh, xrFrame) {if (mesh.xrMesh = xrMesh, mesh.worldParentNode = this._options.worldParentNode, this._options.convertCoordinateSystems) {if (!this._xrSessionManager.scene.useRightHandedSystem) {mesh.positions = new Float32Array(xrMesh.positions.length);for (let i = 0; i < xrMesh.positions.length; i += 3) mesh.positions[i] = xrMesh.positions[i], mesh.positions[i + 1] = xrMesh.positions[i + 1], mesh.positions[i + 2] = -1 * xrMesh.positions[i + 2];if (xrMesh.normals) {mesh.normals = new Float32Array(xrMesh.normals.length);for (let i = 0; i < xrMesh.normals.length; i += 3) mesh.normals[i] = xrMesh.normals[i], mesh.normals[i + 1] = xrMesh.normals[i + 1], mesh.normals[i + 2] = -1 * xrMesh.normals[i + 2];}} else mesh.positions = xrMesh.positions, mesh.normals = xrMesh.normals;mesh.indices = xrMesh.indices;const pose = xrFrame.getPose(xrMesh.meshSpace, this._xrSessionManager.referenceSpace);if (pose) {const mat = mesh.transformationMatrix || new math/* Matrix */.y3();math/* Matrix.FromArrayToRef */.y3.FromArrayToRef(pose.transform.matrix, 0, mat), this._xrSessionManager.scene.useRightHandedSystem || mat.toggleModelMatrixHandInPlace(), mesh.transformationMatrix = mat, this._options.worldParentNode && mat.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), mat);}}return mesh;}}WebXRMeshDetector.Name = WebXRFeatureName.MESH_DETECTION, WebXRMeshDetector.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRMeshDetector.Name, (xrSessionManager, options) => () => new WebXRMeshDetector(xrSessionManager, options), WebXRMeshDetector.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRImageTracking.js
var ImageTrackingScoreStatus;(function (ImageTrackingScoreStatus) {ImageTrackingScoreStatus[ImageTrackingScoreStatus.NotReceived = 0] = "NotReceived", ImageTrackingScoreStatus[ImageTrackingScoreStatus.Waiting = 1] = "Waiting", ImageTrackingScoreStatus[ImageTrackingScoreStatus.Received = 2] = "Received";})(ImageTrackingScoreStatus || (ImageTrackingScoreStatus = {}));class WebXRImageTracking extends WebXRAbstractFeature {constructor(_xrSessionManager, options) {super(_xrSessionManager), this.options = options, this.onUntrackableImageFoundObservable = new observable/* Observable */.y$(), this.onTrackableImageFoundObservable = new observable/* Observable */.y$(), this.onTrackedImageUpdatedObservable = new observable/* Observable */.y$(), this._trackableScoreStatus = ImageTrackingScoreStatus.NotReceived, this._trackedImages = [], this.xrNativeFeatureName = "image-tracking";}attach() {return super.attach();}detach() {return super.detach();}getTrackedImageById(id) {return this._trackedImages[id] || null;}dispose() {super.dispose(), this._trackedImages.forEach((trackedImage) => {trackedImage.originalBitmap.close();}), this._trackedImages.length = 0, this.onTrackableImageFoundObservable.clear(), this.onUntrackableImageFoundObservable.clear(), this.onTrackedImageUpdatedObservable.clear();}async getXRSessionInitExtension() {if (!this.options.images || !this.options.images.length) return {};const promises = this.options.images.map((image) => "string" == typeof image.src ? this._xrSessionManager.scene.getEngine()._createImageBitmapFromSource(image.src) : Promise.resolve(image.src));try {const images = await Promise.all(promises);return this._originalTrackingRequest = images.map((image, idx) => ({ image, widthInMeters: this.options.images[idx].estimatedRealWorldWidth })), { trackedImages: this._originalTrackingRequest };} catch (ex) {return tools/* Tools.Error */.w1.Error("Error loading images for tracking, WebXRImageTracking disabled for this session."), {};}}_onXRFrame(_xrFrame) {if (_xrFrame.getImageTrackingResults && this._trackableScoreStatus !== ImageTrackingScoreStatus.Waiting) {if (this._trackableScoreStatus === ImageTrackingScoreStatus.NotReceived) return void this._checkScoresAsync();const imageTrackedResults = _xrFrame.getImageTrackingResults();for (const result of imageTrackedResults) {let changed = !1;const imageIndex = result.index,imageObject = this._trackedImages[imageIndex];if (!imageObject) continue;imageObject.xrTrackingResult = result, imageObject.realWorldWidth !== result.measuredWidthInMeters && (imageObject.realWorldWidth = result.measuredWidthInMeters, changed = !0);const pose = _xrFrame.getPose(result.imageSpace, this._xrSessionManager.referenceSpace);if (pose) {const mat = imageObject.transformationMatrix;math_vector/* Matrix.FromArrayToRef */.y3.FromArrayToRef(pose.transform.matrix, 0, mat), this._xrSessionManager.scene.useRightHandedSystem || mat.toggleModelMatrixHandInPlace(), changed = !0;}const state = result.trackingState,emulated = "emulated" === state;imageObject.emulated !== emulated && (imageObject.emulated = emulated, changed = !0), changed && this.onTrackedImageUpdatedObservable.notifyObservers(imageObject);}}}async _checkScoresAsync() {if (this._xrSessionManager.session.getTrackedImageScores && this._trackableScoreStatus === ImageTrackingScoreStatus.NotReceived) {this._trackableScoreStatus = ImageTrackingScoreStatus.Waiting;const imageScores = await this._xrSessionManager.session.getTrackedImageScores();if (!imageScores || 0 === imageScores.length) return void (this._trackableScoreStatus = ImageTrackingScoreStatus.NotReceived);for (let idx = 0; idx < imageScores.length; ++idx) if ("untrackable" == imageScores[idx]) this.onUntrackableImageFoundObservable.notifyObservers(idx);else {const originalBitmap = this._originalTrackingRequest[idx].image,imageObject = { id: idx, originalBitmap, transformationMatrix: new math_vector/* Matrix */.y3(), ratio: originalBitmap.width / originalBitmap.height };this._trackedImages[idx] = imageObject, this.onTrackableImageFoundObservable.notifyObservers(imageObject);}this._trackableScoreStatus = 0 < imageScores.length ? ImageTrackingScoreStatus.Received : ImageTrackingScoreStatus.NotReceived;}}}WebXRImageTracking.Name = WebXRFeatureName.IMAGE_TRACKING, WebXRImageTracking.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRImageTracking.Name, (xrSessionManager, options) => () => new WebXRImageTracking(xrSessionManager, options), WebXRImageTracking.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRDOMOverlay.js
class WebXRDomOverlay extends WebXRAbstractFeature {constructor(_xrSessionManager, options) {super(_xrSessionManager), this.options = options, this._domOverlayType = null, this._beforeXRSelectListener = null, this._element = null, this.xrNativeFeatureName = "dom-overlay", tools/* Tools.Warn */.w1.Warn("dom-overlay is an experimental and unstable feature.");}attach() {return !!super.attach() && !!(this._xrSessionManager.session.domOverlayState && null !== this._xrSessionManager.session.domOverlayState.type) && (this._domOverlayType = this._xrSessionManager.session.domOverlayState.type, null !== this._element && !0 === this.options.supressXRSelectEvents && (this._beforeXRSelectListener = (ev) => {ev.preventDefault();}, this._element.addEventListener("beforexrselect", this._beforeXRSelectListener)), !0);}get domOverlayType() {return this._domOverlayType;}dispose() {super.dispose(), null !== this._element && this._beforeXRSelectListener && this._element.removeEventListener("beforexrselect", this._beforeXRSelectListener);}_onXRFrame() {}async getXRSessionInitExtension() {if (void 0 === this.options.element) return tools/* Tools.Warn */.w1.Warn("\"element\" option must be provided to attach xr-dom-overlay feature."), {};if ("string" == typeof this.options.element) {const selectedElement = document.querySelector(this.options.element);if (null === selectedElement) return tools/* Tools.Warn */.w1.Warn(`element not found '${this.options.element}' (not requesting xr-dom-overlay)`), {};this._element = selectedElement;} else this._element = this.options.element;return { domOverlay: { root: this._element } };}}WebXRDomOverlay.Name = WebXRFeatureName.DOM_OVERLAY, WebXRDomOverlay.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRDomOverlay.Name, (xrSessionManager, options) => () => new WebXRDomOverlay(xrSessionManager, options), WebXRDomOverlay.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRControllerMovement.js
class WebXRControllerMovement extends WebXRAbstractFeature {get movementDirection() {return this._movementDirection;}get movementEnabled() {return this._featureContext.movementEnabled;}set movementEnabled(enabled) {this._featureContext.movementEnabled = enabled;}get movementOrientationFollowsViewerPose() {return this._featureContext.movementOrientationFollowsViewerPose;}set movementOrientationFollowsViewerPose(followsPose) {this._featureContext.movementOrientationFollowsViewerPose = followsPose;}get movementSpeed() {return this._featureContext.movementSpeed;}set movementSpeed(movementSpeed) {this._featureContext.movementSpeed = movementSpeed;}get movementThreshold() {return this._featureContext.movementThreshold;}set movementThreshold(movementThreshold) {this._featureContext.movementThreshold = movementThreshold;}get rotationEnabled() {return this._featureContext.rotationEnabled;}set rotationEnabled(enabled) {this._featureContext.rotationEnabled = enabled;}get rotationSpeed() {return this._featureContext.rotationSpeed;}set rotationSpeed(rotationSpeed) {this._featureContext.rotationSpeed = rotationSpeed;}get rotationThreshold() {return this._featureContext.rotationThreshold;}set rotationThreshold(threshold) {this._featureContext.rotationThreshold = threshold;}constructor(_xrSessionManager, options) {var _a, _b, _c, _d, _e, _f;return super(_xrSessionManager), this._controllers = {}, this._currentRegistrationConfigurations = [], this._movementDirection = null, this._tmpRotationMatrix = math_vector/* Matrix.Identity */.y3.Identity(), this._tmpTranslationDirection = new math_vector/* Vector3 */.P(), this._tmpMovementTranslation = new math_vector/* Vector3 */.P(), this._attachController = (xrController) => {if (this._controllers[xrController.uniqueId]) return;this._controllers[xrController.uniqueId] = { xrController, registeredComponents: [] };const controllerData = this._controllers[xrController.uniqueId];if ("tracked-pointer" === controllerData.xrController.inputSource.targetRayMode && controllerData.xrController.inputSource.gamepad) {const initController = () => {if (xrController.motionController) for (const registration of this._currentRegistrationConfigurations) {let component = null;if (registration.allowedComponentTypes) for (const componentType of registration.allowedComponentTypes) {const componentOfType = xrController.motionController.getComponentOfType(componentType);if (null !== componentOfType) {component = componentOfType;break;}}if (registration.mainComponentOnly) {const mainComponent = xrController.motionController.getMainComponent();if (null === mainComponent) continue;component = mainComponent;}if ("function" == typeof registration.componentSelectionPredicate && (component = registration.componentSelectionPredicate(xrController)), component && registration.forceHandedness && xrController.inputSource.handedness !== registration.forceHandedness) continue;if (null === component) continue;const registeredComponent = { registrationConfiguration: registration, component };controllerData.registeredComponents.push(registeredComponent), "axisChangedHandler" in registration && (registeredComponent.onAxisChangedObserver = component.onAxisValueChangedObservable.add((axesData) => {registration.axisChangedHandler(axesData, this._movementState, this._featureContext, this._xrInput);})), "buttonChangedhandler" in registration && (registeredComponent.onButtonChangedObserver = component.onButtonStateChangedObservable.add(() => {component.changes.pressed && registration.buttonChangedhandler(component.changes.pressed, this._movementState, this._featureContext, this._xrInput);}));}};xrController.motionController ? initController() : xrController.onMotionControllerInitObservable.addOnce(() => {initController();});}}, options && void 0 !== options.xrInput ? void (this._currentRegistrationConfigurations = Array.isArray(options.customRegistrationConfigurations) ? options.customRegistrationConfigurations : WebXRControllerMovement.REGISTRATIONS.default, this._featureContext = { movementEnabled: options.movementEnabled || !0, movementOrientationFollowsViewerPose: null === (_a = options.movementOrientationFollowsViewerPose) || void 0 === _a || _a, movementSpeed: null !== (_b = options.movementSpeed) && void 0 !== _b ? _b : 1, movementThreshold: null !== (_c = options.movementThreshold) && void 0 !== _c ? _c : .25, rotationEnabled: null === (_d = options.rotationEnabled) || void 0 === _d || _d, rotationSpeed: null !== (_e = options.rotationSpeed) && void 0 !== _e ? _e : 1, rotationThreshold: null !== (_f = options.rotationThreshold) && void 0 !== _f ? _f : .25 }, this._movementState = { moveX: 0, moveY: 0, rotateX: 0, rotateY: 0 }, this._xrInput = options.xrInput) : void tools/* Tools.Error */.w1.Error("WebXRControllerMovement feature requires \"xrInput\" option.");}attach() {return !!super.attach() && (this._xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._xrInput.onControllerRemovedObservable, (controller) => {this._detachController(controller.uniqueId);}), !0);}detach() {return !!super.detach() && (Object.keys(this._controllers).forEach((controllerId) => {this._detachController(controllerId);}), this._controllers = {}, !0);}_onXRFrame() {if (this.attach) {if (null === this._movementDirection && (this._movementDirection = this._xrInput.xrCamera.rotationQuaternion.clone()), 0 !== this._movementState.rotateX && this._featureContext.rotationEnabled) {const deltaMillis = this._xrSessionManager.scene.getEngine().getDeltaTime(),rotationY = .001 * deltaMillis * this._featureContext.rotationSpeed * this._movementState.rotateX * (this._xrSessionManager.scene.useRightHandedSystem ? -1 : 1);!0 === this._featureContext.movementOrientationFollowsViewerPose ? (this._xrInput.xrCamera.cameraRotation.y += rotationY, this._movementDirection = this._xrInput.xrCamera.rotationQuaternion.multiply(math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(rotationY, 0, 0))) : this._movementDirection.multiplyInPlace(math_vector/* Quaternion.RotationYawPitchRoll */._f.RotationYawPitchRoll(3 * rotationY, 0, 0));} else !0 === this._featureContext.movementOrientationFollowsViewerPose && this._movementDirection.copyFrom(this._xrInput.xrCamera.rotationQuaternion);(0 !== this._movementState.moveX || 0 !== this._movementState.moveY) && this._featureContext.movementEnabled && (math_vector/* Matrix.FromQuaternionToRef */.y3.FromQuaternionToRef(this._movementDirection, this._tmpRotationMatrix), this._tmpTranslationDirection.set(this._movementState.moveX, 0, this._movementState.moveY * (this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1)), math_vector/* Vector3.TransformCoordinatesToRef */.P.TransformCoordinatesToRef(this._tmpTranslationDirection, this._tmpRotationMatrix, this._tmpMovementTranslation), this._tmpMovementTranslation.scaleInPlace(this._xrInput.xrCamera._computeLocalCameraSpeed() * this._featureContext.movementSpeed), this._xrInput.xrCamera.cameraDirection.addInPlace(this._tmpMovementTranslation));}}_detachController(xrControllerUniqueId) {const controllerData = this._controllers[xrControllerUniqueId];if (controllerData) {for (const registeredComponent of controllerData.registeredComponents) registeredComponent.onAxisChangedObserver && registeredComponent.component.onAxisValueChangedObservable.remove(registeredComponent.onAxisChangedObserver), registeredComponent.onButtonChangedObserver && registeredComponent.component.onButtonStateChangedObservable.remove(registeredComponent.onButtonChangedObserver);delete this._controllers[xrControllerUniqueId];}}}WebXRControllerMovement.Name = WebXRFeatureName.MOVEMENT, WebXRControllerMovement.REGISTRATIONS = { default: [{ allowedComponentTypes: [WebXRControllerComponent.THUMBSTICK_TYPE, WebXRControllerComponent.TOUCHPAD_TYPE], forceHandedness: "left", axisChangedHandler: (axes, movementState, featureContext) => {movementState.rotateX = Math.abs(axes.x) > featureContext.rotationThreshold ? axes.x : 0, movementState.rotateY = Math.abs(axes.y) > featureContext.rotationThreshold ? axes.y : 0;} }, { allowedComponentTypes: [WebXRControllerComponent.THUMBSTICK_TYPE, WebXRControllerComponent.TOUCHPAD_TYPE], forceHandedness: "right", axisChangedHandler: (axes, movementState, featureContext) => {movementState.moveX = Math.abs(axes.x) > featureContext.movementThreshold ? axes.x : 0, movementState.moveY = Math.abs(axes.y) > featureContext.movementThreshold ? axes.y : 0;} }] }, WebXRControllerMovement.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRControllerMovement.Name, (xrSessionManager, options) => () => new WebXRControllerMovement(xrSessionManager, options), WebXRControllerMovement.Version, !0);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/lightConstants.js
var lightConstants = __webpack_require__("./node_modules/@babylonjs/core/Lights/lightConstants.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRLightEstimation.js
class WebXRLightEstimation extends WebXRAbstractFeature {constructor(_xrSessionManager, options) {super(_xrSessionManager), this.options = options, this._canvasContext = null, this._reflectionCubeMap = null, this._xrLightEstimate = null, this._xrLightProbe = null, this._xrWebGLBinding = null, this._lightDirection = math_vector/* Vector3.Up */.P.Up().negateInPlace(), this._lightColor = math_color/* Color3.White */.Wo.White(), this._intensity = 1, this._sphericalHarmonics = new sphericalPolynomial/* SphericalHarmonics */._(), this._cubeMapPollTime = Date.now(), this._lightEstimationPollTime = Date.now(), this._reflectionCubeMapTextureSize = 16, this.directionalLight = null, this.onReflectionCubeMapUpdatedObservable = new observable/* Observable */.y$(), this._updateReflectionCubeMap = () => {var _a;if (this._xrLightProbe) {if (this.options.cubeMapPollInterval) {const now = Date.now();if (now - this._cubeMapPollTime < this.options.cubeMapPollInterval) return;this._cubeMapPollTime = now;}const lp = this._getXRGLBinding().getReflectionCubeMap(this._xrLightProbe);if (lp && this._reflectionCubeMap) {if (!this._reflectionCubeMap._texture) {const internalTexture = new Textures_internalTexture/* InternalTexture */.l(this._xrSessionManager.scene.getEngine(), Textures_internalTexture/* InternalTextureSource.Unknown */.S.Unknown);internalTexture.isCube = !0, internalTexture.invertY = !1, internalTexture._useSRGBBuffer = "srgba8" === this.options.reflectionFormat, internalTexture.format = 5, internalTexture.generateMipMaps = !0, internalTexture.type = "srgba8" === this.options.reflectionFormat ? 0 : 2, internalTexture.samplingMode = 3, internalTexture.width = this._reflectionCubeMapTextureSize, internalTexture.height = this._reflectionCubeMapTextureSize, internalTexture._cachedWrapU = 1, internalTexture._cachedWrapV = 1, internalTexture._hardwareTexture = new webGLHardwareTexture/* WebGLHardwareTexture */.B(lp, this._getCanvasContext()), this._reflectionCubeMap._texture = internalTexture;} else null === (_a = this._reflectionCubeMap._texture._hardwareTexture) || void 0 === _a ? void 0 : _a.set(lp), this._reflectionCubeMap._texture.getEngine().resetTextureCache();this._reflectionCubeMap._texture.isReady = !0, this._xrSessionManager.scene.markAllMaterialsAsDirty(1), this.onReflectionCubeMapUpdatedObservable.notifyObservers(this._reflectionCubeMap);}}}, this.xrNativeFeatureName = "light-estimation", this.options.createDirectionalLightSource && (this.directionalLight = new directionalLight/* DirectionalLight */.O("light estimation directional", this._lightDirection, this._xrSessionManager.scene), this.directionalLight.position = new math_vector/* Vector3 */.P(0, 8, 0), this.directionalLight.intensity = 0, this.directionalLight.falloffType = lightConstants/* LightConstants.FALLOFF_GLTF */.m.FALLOFF_GLTF), tools/* Tools.Warn */.w1.Warn("light-estimation is an experimental and unstable feature.");}get reflectionCubeMapTexture() {return this._reflectionCubeMap;}get xrLightingEstimate() {return this._xrLightEstimate ? { lightColor: this._lightColor, lightDirection: this._lightDirection, lightIntensity: this._intensity, sphericalHarmonics: this._sphericalHarmonics } : this._xrLightEstimate;}_getCanvasContext() {return null === this._canvasContext && (this._canvasContext = this._xrSessionManager.scene.getEngine()._gl), this._canvasContext;}_getXRGLBinding() {if (null === this._xrWebGLBinding) {const context = this._getCanvasContext();this._xrWebGLBinding = new XRWebGLBinding(this._xrSessionManager.session, context);}return this._xrWebGLBinding;}attach() {var _a;if (!super.attach()) return !1;const reflectionFormat = null !== (_a = this.options.reflectionFormat) && void 0 !== _a ? _a : this._xrSessionManager.session.preferredReflectionFormat || "srgba8";return this.options.reflectionFormat = reflectionFormat, this._xrSessionManager.session.requestLightProbe({ reflectionFormat }).then((xrLightProbe) => {this._xrLightProbe = xrLightProbe, this.options.disableCubeMapReflection || (!this._reflectionCubeMap && (this._reflectionCubeMap = new baseTexture/* BaseTexture */.V(this._xrSessionManager.scene), this._reflectionCubeMap._isCube = !0, this._reflectionCubeMap.coordinatesMode = 3, this.options.setSceneEnvironmentTexture && (this._xrSessionManager.scene.environmentTexture = this._reflectionCubeMap)), this._xrLightProbe.addEventListener("reflectionchange", this._updateReflectionCubeMap));}), !0;}detach() {const detached = super.detach();return null === this._xrLightProbe || this.options.disableCubeMapReflection || (this._xrLightProbe.removeEventListener("reflectionchange", this._updateReflectionCubeMap), this._xrLightProbe = null), this._canvasContext = null, this._xrLightEstimate = null, this._xrWebGLBinding = null, detached;}dispose() {super.dispose(), this.onReflectionCubeMapUpdatedObservable.clear(), this.directionalLight && (this.directionalLight.dispose(), this.directionalLight = null), null !== this._reflectionCubeMap && (this._reflectionCubeMap._texture && this._reflectionCubeMap._texture.dispose(), this._reflectionCubeMap.dispose(), this._reflectionCubeMap = null);}_onXRFrame(_xrFrame) {var _a;if (null !== this._xrLightProbe) {if (this.options.lightEstimationPollInterval) {const now = Date.now();if (now - this._lightEstimationPollTime < this.options.lightEstimationPollInterval) return;this._lightEstimationPollTime = now;}if (this._xrLightEstimate = _xrFrame.getLightEstimate(this._xrLightProbe), this._xrLightEstimate) {this._intensity = Math.max(1, this._xrLightEstimate.primaryLightIntensity.x, this._xrLightEstimate.primaryLightIntensity.y, this._xrLightEstimate.primaryLightIntensity.z);const rhsFactor = this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1;this.options.disableVectorReuse && (this._lightDirection = new math_vector/* Vector3 */.P(), this._lightColor = new math_color/* Color3 */.Wo(), this.directionalLight && (this.directionalLight.direction = this._lightDirection, this.directionalLight.diffuse = this._lightColor)), this._lightDirection.copyFromFloats(this._xrLightEstimate.primaryLightDirection.x, this._xrLightEstimate.primaryLightDirection.y, this._xrLightEstimate.primaryLightDirection.z * rhsFactor), this._lightColor.copyFromFloats(this._xrLightEstimate.primaryLightIntensity.x / this._intensity, this._xrLightEstimate.primaryLightIntensity.y / this._intensity, this._xrLightEstimate.primaryLightIntensity.z / this._intensity), this._sphericalHarmonics.updateFromFloatsArray(this._xrLightEstimate.sphericalHarmonicsCoefficients), this._reflectionCubeMap && !this.options.disableSphericalPolynomial && (this._reflectionCubeMap.sphericalPolynomial = this._reflectionCubeMap.sphericalPolynomial || new sphericalPolynomial/* SphericalPolynomial */.i(), null === (_a = this._reflectionCubeMap.sphericalPolynomial) || void 0 === _a ? void 0 : _a.updateFromHarmonics(this._sphericalHarmonics)), this._lightDirection.negateInPlace(), this.directionalLight && (this.directionalLight.direction.copyFrom(this._lightDirection), this.directionalLight.intensity = Math.min(this._intensity, 1), this.directionalLight.diffuse.copyFrom(this._lightColor));}}}}WebXRLightEstimation.Name = WebXRFeatureName.LIGHT_ESTIMATION, WebXRLightEstimation.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRLightEstimation.Name, (xrSessionManager, options) => () => new WebXRLightEstimation(xrSessionManager, options), WebXRLightEstimation.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXREyeTracking.js
class WebXREyeTracking extends WebXRAbstractFeature {constructor(_xrSessionManager) {super(_xrSessionManager), this.onEyeTrackingStartedObservable = new observable/* Observable */.y$(), this.onEyeTrackingEndedObservable = new observable/* Observable */.y$(), this.onEyeTrackingFrameUpdateObservable = new observable/* Observable */.y$(), this._eyeTrackingStartListener = (event) => {this._latestEyeSpace = event.gazeSpace, this._gazeRay = new Ray(math_vector/* Vector3.Zero */.P.Zero(), math_vector/* Vector3.Forward */.P.Forward()), this.onEyeTrackingStartedObservable.notifyObservers(this._gazeRay);}, this._eyeTrackingEndListener = () => {this._latestEyeSpace = null, this._gazeRay = null, this.onEyeTrackingEndedObservable.notifyObservers();}, this.xrNativeFeatureName = "eye-tracking", this._xrSessionManager.session ? this._init() : this._xrSessionManager.onXRSessionInit.addOnce(() => {this._init();});}dispose() {super.dispose(), this._xrSessionManager.session.removeEventListener("eyetrackingstart", this._eyeTrackingStartListener), this._xrSessionManager.session.removeEventListener("eyetrackingend", this._eyeTrackingEndListener), this.onEyeTrackingStartedObservable.clear(), this.onEyeTrackingEndedObservable.clear(), this.onEyeTrackingFrameUpdateObservable.clear();}get isEyeGazeValid() {return !!this._gazeRay;}getEyeGaze() {return this._gazeRay;}_onXRFrame(frame) {if (this.attached && frame && this._latestEyeSpace && this._gazeRay) {const pose = frame.getPose(this._latestEyeSpace, this._xrSessionManager.referenceSpace);if (pose) {this._gazeRay.origin.set(pose.transform.position.x, pose.transform.position.y, pose.transform.position.z);const quat = pose.transform.orientation;math_vector/* TmpVectors.Quaternion.0.set */.jp.Quaternion[0].set(quat.x, quat.y, quat.z, quat.w), this._xrSessionManager.scene.useRightHandedSystem ? math_vector/* Vector3.RightHandedForwardReadOnly.rotateByQuaternionToRef */.P.RightHandedForwardReadOnly.rotateByQuaternionToRef(math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], this._gazeRay.direction) : (this._gazeRay.origin.z *= -1, math_vector/* TmpVectors.Quaternion.0.z */.jp.Quaternion[0].z *= -1, math_vector/* TmpVectors.Quaternion.0.w */.jp.Quaternion[0].w *= -1, math_vector/* Vector3.LeftHandedForwardReadOnly.rotateByQuaternionToRef */.P.LeftHandedForwardReadOnly.rotateByQuaternionToRef(math_vector/* TmpVectors.Quaternion.0 */.jp.Quaternion[0], this._gazeRay.direction)), this.onEyeTrackingFrameUpdateObservable.notifyObservers(this._gazeRay);}}}_init() {this._xrSessionManager.isNative && (this._xrSessionManager.session.addEventListener("eyetrackingstart", this._eyeTrackingStartListener), this._xrSessionManager.session.addEventListener("eyetrackingend", this._eyeTrackingEndListener));}}WebXREyeTracking.Name = WebXRFeatureName.EYE_TRACKING, WebXREyeTracking.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXREyeTracking.Name, (xrSessionManager) => () => new WebXREyeTracking(xrSessionManager), WebXREyeTracking.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRWalkingLocomotion.js
class CircleBuffer {constructor(numSamples, initializer) {this._samples = [], this._idx = 0;for (let idx = 0; idx < numSamples; ++idx) this._samples.push(initializer ? initializer() : math_vector/* Vector2.Zero */.FM.Zero());}get length() {return this._samples.length;}push(x, y) {this._idx = (this._idx + this._samples.length - 1) % this._samples.length, this.at(0).copyFromFloats(x, y);}at(idx) {if (idx >= this._samples.length) throw new Error("Index out of bounds");return this._samples[(this._idx + idx) % this._samples.length];}}class FirstStepDetector {constructor() {this._samples = new CircleBuffer(20), this._entropy = 0, this.onFirstStepDetected = new observable/* Observable */.y$();}update(posX, posY, forwardX, forwardY) {this._samples.push(posX, posY);const origin = this._samples.at(0);if (this._entropy *= this._entropyDecayFactor, this._entropy += math_vector/* Vector2.Distance */.FM.Distance(origin, this._samples.at(1)), this._entropy > this._entropyThreshold) return;let samePointIdx;for (samePointIdx = this._samePointCheckStartIdx; samePointIdx < this._samples.length && !(math_vector/* Vector2.DistanceSquared */.FM.DistanceSquared(origin, this._samples.at(samePointIdx)) < this._samePointSquaredDistanceThreshold); ++samePointIdx);if (samePointIdx === this._samples.length) return;let apexDistSquared = -1,apexIdx = 0;for (let distSquared, idx = 1; idx < samePointIdx; ++idx) distSquared = math_vector/* Vector2.DistanceSquared */.FM.DistanceSquared(origin, this._samples.at(idx)), distSquared > apexDistSquared && (apexIdx = idx, apexDistSquared = distSquared);if (apexDistSquared < this._apexSquaredDistanceThreshold) return;const apex = this._samples.at(apexIdx),axis = apex.subtract(origin);axis.normalize();const vec = math_vector/* TmpVectors.Vector2.0 */.jp.Vector2[0];let dot,sample,sumSquaredProjectionDistances = 0;for (let idx = 1; idx < samePointIdx; ++idx) sample = this._samples.at(idx), sample.subtractToRef(origin, vec), dot = math_vector/* Vector2.Dot */.FM.Dot(axis, vec), sumSquaredProjectionDistances += vec.lengthSquared() - dot * dot;if (sumSquaredProjectionDistances > samePointIdx * this._squaredProjectionDistanceThreshold) return;const forwardVec = math_vector/* TmpVectors.Vector3.0 */.jp.Vector3[0];forwardVec.set(forwardX, forwardY, 0);const axisVec = math_vector/* TmpVectors.Vector3.1 */.jp.Vector3[1];axisVec.set(axis.x, axis.y, 0);const isApexLeft = 0 < math_vector/* Vector3.Cross */.P.Cross(forwardVec, axisVec).z,leftApex = origin.clone(),rightApex = origin.clone();apex.subtractToRef(origin, axis), isApexLeft ? (axis.scaleAndAddToRef(this._axisToApexShrinkFactor, leftApex), axis.scaleAndAddToRef(this._axisToApexExtendFactor, rightApex)) : (axis.scaleAndAddToRef(this._axisToApexExtendFactor, leftApex), axis.scaleAndAddToRef(this._axisToApexShrinkFactor, rightApex)), this.onFirstStepDetected.notifyObservers({ leftApex: leftApex, rightApex: rightApex, currentPosition: origin, currentStepDirection: isApexLeft ? "right" : "left" });}reset() {for (let idx = 0; idx < this._samples.length; ++idx) this._samples.at(idx).copyFromFloats(0, 0);}get _samePointCheckStartIdx() {return Math.floor(this._samples.length / 3);}get _samePointSquaredDistanceThreshold() {return .03 * .03;}get _apexSquaredDistanceThreshold() {return .09 * .09;}get _squaredProjectionDistanceThreshold() {return .03 * .03;}get _axisToApexShrinkFactor() {return .8;}get _axisToApexExtendFactor() {return -1.6;}get _entropyDecayFactor() {return .93;}get _entropyThreshold() {return .4;}}class WalkingTracker {constructor(leftApex, rightApex, currentPosition, currentStepDirection) {this._leftApex = new math_vector/* Vector2 */.FM(), this._rightApex = new math_vector/* Vector2 */.FM(), this._currentPosition = new math_vector/* Vector2 */.FM(), this._axis = new math_vector/* Vector2 */.FM(), this._axisLength = -1, this._forward = new math_vector/* Vector2 */.FM(), this._steppingLeft = !1, this._t = -1, this._maxT = -1, this._maxTPosition = new math_vector/* Vector2 */.FM(), this._vitality = 0, this.onMovement = new observable/* Observable */.y$(), this.onFootfall = new observable/* Observable */.y$(), this._reset(leftApex, rightApex, currentPosition, "left" === currentStepDirection);}_reset(leftApex, rightApex, currentPosition, steppingLeft) {this._leftApex.copyFrom(leftApex), this._rightApex.copyFrom(rightApex), this._steppingLeft = steppingLeft, this._steppingLeft ? (this._leftApex.subtractToRef(this._rightApex, this._axis), this._forward.copyFromFloats(-this._axis.y, this._axis.x)) : (this._rightApex.subtractToRef(this._leftApex, this._axis), this._forward.copyFromFloats(this._axis.y, -this._axis.x)), this._axisLength = this._axis.length(), this._forward.scaleInPlace(1 / this._axisLength), this._updateTAndVitality(currentPosition.x, currentPosition.y), this._maxT = this._t, this._maxTPosition.copyFrom(currentPosition), this._vitality = 1;}_updateTAndVitality(x, y) {this._currentPosition.copyFromFloats(x, y), this._steppingLeft ? this._currentPosition.subtractInPlace(this._rightApex) : this._currentPosition.subtractInPlace(this._leftApex);const priorT = this._t,dot = math_vector/* Vector2.Dot */.FM.Dot(this._currentPosition, this._axis);this._t = dot / (this._axisLength * this._axisLength);const projDistSquared = this._currentPosition.lengthSquared() - dot / this._axisLength * (dot / this._axisLength);this._vitality *= .92 - 100 * Math.max(projDistSquared - .0016, 0) + Math.max(this._t - priorT, 0);}update(x, y) {if (this._vitality < this._vitalityThreshold) return !1;const priorT = this._t;return (this._updateTAndVitality(x, y), this._t > this._maxT && (this._maxT = this._t, this._maxTPosition.copyFromFloats(x, y)), !(this._vitality < this._vitalityThreshold)) && (this._t > priorT && (this.onMovement.notifyObservers({ deltaT: this._t - priorT }), .5 > priorT && .5 <= this._t && this.onFootfall.notifyObservers({ foot: this._steppingLeft ? "left" : "right" })), this._t < .95 * this._maxT && (this._currentPosition.copyFromFloats(x, y), this._steppingLeft ? this._leftApex.copyFrom(this._maxTPosition) : this._rightApex.copyFrom(this._maxTPosition), this._reset(this._leftApex, this._rightApex, this._currentPosition, !this._steppingLeft)), !(.03 > this._axisLength));}get _vitalityThreshold() {return .1;}get forward() {return this._forward;}}class Walker {static get _MillisecondsPerUpdate() {return 1e3 / 15;}constructor(engine) {this._detector = new FirstStepDetector(), this._walker = null, this._movement = new math_vector/* Vector2 */.FM(), this._millisecondsSinceLastUpdate = Walker._MillisecondsPerUpdate, this.movementThisFrame = math_vector/* Vector3.Zero */.P.Zero(), this._engine = engine, this._detector.onFirstStepDetected.add((event) => {this._walker || (this._walker = new WalkingTracker(event.leftApex, event.rightApex, event.currentPosition, event.currentStepDirection), this._walker.onFootfall.add(() => {console.log("Footfall!");}), this._walker.onMovement.add((event) => {this._walker.forward.scaleAndAddToRef(.024 * event.deltaT, this._movement);}));});}update(position, forward) {if (forward.y = 0, forward.normalize(), this._millisecondsSinceLastUpdate += this._engine.getDeltaTime(), this._millisecondsSinceLastUpdate >= Walker._MillisecondsPerUpdate) {if (this._millisecondsSinceLastUpdate -= Walker._MillisecondsPerUpdate, this._detector.update(position.x, position.z, forward.x, forward.z), this._walker) {const updated = this._walker.update(position.x, position.z);updated || (this._walker = null);}this._movement.scaleInPlace(.85);}this.movementThisFrame.set(this._movement.x, 0, this._movement.y);}}class WebXRWalkingLocomotion extends WebXRAbstractFeature {static get Name() {return WebXRFeatureName.WALKING_LOCOMOTION;}static get Version() {return 1;}get locomotionTarget() {return this._locomotionTarget;}set locomotionTarget(locomotionTarget) {this._locomotionTarget = locomotionTarget, this._isLocomotionTargetWebXRCamera = "WebXRCamera" === this._locomotionTarget.getClassName();}constructor(sessionManager, options) {super(sessionManager), this._up = new math_vector/* Vector3 */.P(), this._forward = new math_vector/* Vector3 */.P(), this._position = new math_vector/* Vector3 */.P(), this._movement = new math_vector/* Vector3 */.P(), this._sessionManager = sessionManager, this.locomotionTarget = options.locomotionTarget, this._isLocomotionTargetWebXRCamera && logger/* Logger.Warn */.Y.Warn("Using walking locomotion directly on a WebXRCamera may have unintended interactions with other XR techniques. Using an XR space parent is highly recommended");}isCompatible() {return this._sessionManager.sessionMode === void 0 || "immersive-vr" === this._sessionManager.sessionMode;}attach() {return !!(this.isCompatible && super.attach()) && (this._walker = new Walker(this._sessionManager.scene.getEngine()), !0);}detach() {return !!super.detach() && (this._walker = null, !0);}_onXRFrame(frame) {const pose = frame.getViewerPose(this._sessionManager.baseReferenceSpace);if (!pose) return;const handednessScalar = this.locomotionTarget.getScene().useRightHandedSystem ? 1 : -1,m = pose.transform.matrix;this._up.copyFromFloats(m[4], m[5], handednessScalar * m[6]), this._forward.copyFromFloats(m[8], m[9], handednessScalar * m[10]), this._position.copyFromFloats(m[12], m[13], handednessScalar * m[14]), this._forward.scaleAndAddToRef(.05, this._position), this._up.scaleAndAddToRef(-.05, this._position), this._walker.update(this._position, this._forward), this._movement.copyFrom(this._walker.movementThisFrame), this._isLocomotionTargetWebXRCamera || math_vector/* Vector3.TransformNormalToRef */.P.TransformNormalToRef(this._movement, this.locomotionTarget.getWorldMatrix(), this._movement), this.locomotionTarget.position.addInPlace(this._movement);}}WebXRFeaturesManager.AddWebXRFeature(WebXRWalkingLocomotion.Name, (xrSessionManager, options) => () => new WebXRWalkingLocomotion(xrSessionManager, options), WebXRWalkingLocomotion.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/WebXRLayers.js
class WebXRCompositionLayerWrapper extends WebXRLayerWrapper {constructor(getWidth, getHeight, layer, layerType, isMultiview, createRTTProvider) {super(getWidth, getHeight, layer, layerType, createRTTProvider), this.getWidth = getWidth, this.getHeight = getHeight, this.layer = layer, this.layerType = layerType, this.isMultiview = isMultiview, this.createRTTProvider = createRTTProvider;}}class WebXRCompositionLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetTextureProvider {constructor(_xrSessionManager, _xrWebGLBinding, layerWrapper) {super(_xrSessionManager.scene, layerWrapper), this._xrSessionManager = _xrSessionManager, this._xrWebGLBinding = _xrWebGLBinding, this.layerWrapper = layerWrapper, this._lastSubImages = new Map(), this._compositionLayer = layerWrapper.layer;}_getRenderTargetForSubImage(subImage, eye) {const lastSubImage = this._lastSubImages.get(eye),eyeIndex = "left" == eye ? 0 : 1;return this._renderTargetTextures[eyeIndex] && (null === lastSubImage || void 0 === lastSubImage ? void 0 : lastSubImage.textureWidth) === subImage.textureWidth && (null === lastSubImage || void 0 === lastSubImage ? void 0 : lastSubImage.textureHeight) == subImage.textureHeight || (this._renderTargetTextures[eyeIndex] = this._createRenderTargetTexture(subImage.textureWidth, subImage.textureHeight, null, subImage.colorTexture, subImage.depthStencilTexture, this.layerWrapper.isMultiview), this._framebufferDimensions = { framebufferWidth: subImage.textureWidth, framebufferHeight: subImage.textureHeight }), this._lastSubImages.set(eye, subImage), this._renderTargetTextures[eyeIndex];}_getSubImageForEye(eye) {const currentFrame = this._xrSessionManager.currentFrame;return currentFrame ? this._xrWebGLBinding.getSubImage(this._compositionLayer, currentFrame, eye) : null;}getRenderTargetTextureForEye(eye) {const subImage = this._getSubImageForEye(eye);return subImage ? this._getRenderTargetForSubImage(subImage, eye) : null;}getRenderTargetTextureForView(view) {return this.getRenderTargetTextureForEye(view.eye);}_setViewportForSubImage(viewport, subImage) {const textureWidth = subImage.textureWidth,textureHeight = subImage.textureHeight,xrViewport = subImage.viewport;viewport.x = xrViewport.x / textureWidth, viewport.y = xrViewport.y / textureHeight, viewport.width = xrViewport.width / textureWidth, viewport.height = xrViewport.height / textureHeight;}trySetViewportForView(viewport, view) {const subImage = this._lastSubImages.get(view.eye) || this._getSubImageForEye(view.eye);return !!subImage && (this._setViewportForSubImage(viewport, subImage), !0);}}class WebXRProjectionLayerWrapper extends WebXRCompositionLayerWrapper {constructor(layer, isMultiview, xrGLBinding) {super(() => layer.textureWidth, () => layer.textureHeight, layer, "XRProjectionLayer", isMultiview, (sessionManager) => new WebXRProjectionLayerRenderTargetTextureProvider(sessionManager, xrGLBinding, this)), this.layer = layer;}}class WebXRProjectionLayerRenderTargetTextureProvider extends WebXRCompositionLayerRenderTargetTextureProvider {constructor(_xrSessionManager, _xrWebGLBinding, layerWrapper) {super(_xrSessionManager, _xrWebGLBinding, layerWrapper), this.layerWrapper = layerWrapper, this._projectionLayer = layerWrapper.layer;}_getSubImageForView(view) {return this._xrWebGLBinding.getViewSubImage(this._projectionLayer, view);}getRenderTargetTextureForView(view) {return this._getRenderTargetForSubImage(this._getSubImageForView(view), view.eye);}getRenderTargetTextureForEye(eye) {const lastSubImage = this._lastSubImages.get(eye);return lastSubImage ? this._getRenderTargetForSubImage(lastSubImage, eye) : null;}trySetViewportForView(viewport, view) {const subImage = this._lastSubImages.get(view.eye) || this._getSubImageForView(view);return !!subImage && (this._setViewportForSubImage(viewport, subImage), !0);}}const defaultXRWebGLLayerInit = {},defaultXRProjectionLayerInit = { textureType: "texture", colorFormat: 6408, depthFormat: 35056, scaleFactor: 1 };class WebXRLayers extends WebXRAbstractFeature {constructor(_xrSessionManager, _options = {}) {super(_xrSessionManager), this._options = _options, this._existingLayers = [], this.xrNativeFeatureName = "layers";}attach() {if (!super.attach()) return !1;const engine = this._xrSessionManager.scene.getEngine();this._glContext = engine._gl, this._xrWebGLBinding = new XRWebGLBinding(this._xrSessionManager.session, this._glContext), this._existingLayers.length = 0;const projectionLayerInit = { ...defaultXRProjectionLayerInit },projectionLayerMultiview = this._options.preferMultiviewOnInit && engine.getCaps().multiview;return projectionLayerMultiview && (projectionLayerInit.textureType = "texture-array"), this.addXRSessionLayer(this.createProjectionLayer(projectionLayerInit, projectionLayerMultiview)), !0;}detach() {return !!super.detach() && (this._existingLayers.length = 0, !0);}createXRWebGLLayer(params = defaultXRWebGLLayerInit) {const layer = new XRWebGLLayer(this._xrSessionManager.session, this._glContext, params);return new WebXRWebGLLayerWrapper(layer);}createProjectionLayer(params = defaultXRProjectionLayerInit, multiview = !1) {if (multiview && "texture-array" !== params.textureType) throw new Error("Projection layers can only be made multiview if they use texture arrays. Set the textureType parameter to 'texture-array'.");if (!multiview && "texture-array" === params.textureType) throw new Error("We currently only support multiview rendering when the textureType parameter is set to 'texture-array'.");const projLayer = this._xrWebGLBinding.createProjectionLayer(params);return new WebXRProjectionLayerWrapper(projLayer, multiview, this._xrWebGLBinding);}addXRSessionLayer(wrappedLayer) {this.setXRSessionLayers([...this._existingLayers, wrappedLayer]);}setXRSessionLayers(wrappedLayers) {this._existingLayers = wrappedLayers;const renderStateInit = { ...this._xrSessionManager.session.renderState };renderStateInit.baseLayer = void 0, renderStateInit.layers = wrappedLayers.map((wrappedLayer) => wrappedLayer.layer), this._xrSessionManager.updateRenderState(renderStateInit), this._xrSessionManager._setBaseLayerWrapper(0 < wrappedLayers.length ? wrappedLayers[0] : null);}isCompatible() {return !this._xrSessionManager.isNative && "undefined" != typeof XRWebGLBinding && !!XRWebGLBinding.prototype.createProjectionLayer;}dispose() {super.dispose();}_onXRFrame() {}}WebXRLayers.Name = WebXRFeatureName.LAYERS, WebXRLayers.Version = 1, WebXRFeaturesManager.AddWebXRFeature(WebXRLayers.Name, (xrSessionManager, options) => () => new WebXRLayers(xrSessionManager, options), WebXRLayers.Version, !1);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/features/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/webXRGenericHandController.js
class WebXRGenericHandController extends WebXRAbstractMotionController {constructor(scene, gamepadObject, handedness) {super(scene, GenericHandSelectGraspProfile[handedness], gamepadObject, handedness, !0), this.profileId = "generic-hand-select-grasp";}_getFilenameAndPath() {return { filename: "generic.babylon", path: "https://controllers.babylonjs.com/generic/" };}_getModelLoadingConstraints() {return !0;}_processLoadedModel() {}_setRootMesh() {}_updateModel() {}}WebXRMotionControllerManager.RegisterController("generic-hand-select-grasp", (xrInput, scene) => new WebXRGenericHandController(scene, xrInput.gamepad, xrInput.handedness));const GenericHandSelectGraspProfile = { left: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr-standard-trigger", visualResponses: {} }, grasp: { type: "trigger", gamepadIndices: { button: 4 }, rootNodeName: "grasp", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "generic-hand-select-grasp-left", assetPath: "left.glb" }, right: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr-standard-trigger", visualResponses: {} }, grasp: { type: "trigger", gamepadIndices: { button: 4 }, rootNodeName: "grasp", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "generic-hand-select-grasp-right", assetPath: "right.glb" }, none: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr-standard-trigger", visualResponses: {} }, grasp: { type: "trigger", gamepadIndices: { button: 4 }, rootNodeName: "grasp", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "generic-hand-select-grasp-none", assetPath: "none.glb" } };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/webXRMicrosoftMixedRealityController.js
class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {constructor(scene, gamepadObject, handedness) {super(scene, MixedRealityProfile["left-right"], gamepadObject, handedness), this._mapping = { defaultButton: { valueNodeName: "VALUE", unpressedNodeName: "UNPRESSED", pressedNodeName: "PRESSED" }, defaultAxis: { valueNodeName: "VALUE", minNodeName: "MIN", maxNodeName: "MAX" }, buttons: { "xr-standard-trigger": { rootNodeName: "SELECT", componentProperty: "button", states: ["default", "touched", "pressed"] }, "xr-standard-squeeze": { rootNodeName: "GRASP", componentProperty: "state", states: ["pressed"] }, "xr-standard-touchpad": { rootNodeName: "TOUCHPAD_PRESS", labelAnchorNodeName: "squeeze-label", touchPointNodeName: "TOUCH" }, "xr-standard-thumbstick": { rootNodeName: "THUMBSTICK_PRESS", componentProperty: "state", states: ["pressed"] } }, axes: { "xr-standard-touchpad": { "x-axis": { rootNodeName: "TOUCHPAD_TOUCH_X" }, "y-axis": { rootNodeName: "TOUCHPAD_TOUCH_Y" } }, "xr-standard-thumbstick": { "x-axis": { rootNodeName: "THUMBSTICK_X" }, "y-axis": { rootNodeName: "THUMBSTICK_Y" } } } }, this.profileId = "microsoft-mixed-reality";}_getFilenameAndPath() {let filename = "";filename = "left" === this.handedness ? WebXRMicrosoftMixedRealityController.MODEL_LEFT_FILENAME : WebXRMicrosoftMixedRealityController.MODEL_RIGHT_FILENAME;const path = WebXRMicrosoftMixedRealityController.MODEL_BASE_URL + "default" + "/";return { filename, path };}_getModelLoadingConstraints() {const glbLoaded = sceneLoader/* SceneLoader.IsPluginForExtensionAvailable */.n.IsPluginForExtensionAvailable(".glb");return glbLoaded || logger/* Logger.Warn */.Y.Warn("glTF / glb loaded was not registered, using generic controller instead"), glbLoaded;}_processLoadedModel() {this.rootMesh && (this.getComponentIds().forEach((id, i) => {if (!this.disableAnimation && id && this.rootMesh) {const buttonMap = this._mapping.buttons[id],buttonMeshName = buttonMap.rootNodeName;if (!buttonMeshName) return void logger/* Logger.Log */.Y.Log("Skipping unknown button at index: " + i + " with mapped name: " + id);const buttonMesh = this._getChildByName(this.rootMesh, buttonMeshName);if (!buttonMesh) return void logger/* Logger.Warn */.Y.Warn("Missing button mesh with name: " + buttonMeshName);if (buttonMap.valueMesh = this._getImmediateChildByName(buttonMesh, this._mapping.defaultButton.valueNodeName), buttonMap.pressedMesh = this._getImmediateChildByName(buttonMesh, this._mapping.defaultButton.pressedNodeName), buttonMap.unpressedMesh = this._getImmediateChildByName(buttonMesh, this._mapping.defaultButton.unpressedNodeName), buttonMap.valueMesh && buttonMap.pressedMesh && buttonMap.unpressedMesh) {const comp = this.getComponent(id);comp && comp.onButtonStateChangedObservable.add((component) => {this._lerpTransform(buttonMap, component.value);}, void 0, !0);} else logger/* Logger.Warn */.Y.Warn("Missing button submesh under mesh with name: " + buttonMeshName);}}), this.getComponentIds().forEach((id) => {const comp = this.getComponent(id);comp.isAxes() && ["x-axis", "y-axis"].forEach((axis) => {if (!this.rootMesh) return;const axisMap = this._mapping.axes[id][axis],axisMesh = this._getChildByName(this.rootMesh, axisMap.rootNodeName);return axisMesh ? void (axisMap.valueMesh = this._getImmediateChildByName(axisMesh, this._mapping.defaultAxis.valueNodeName), axisMap.minMesh = this._getImmediateChildByName(axisMesh, this._mapping.defaultAxis.minNodeName), axisMap.maxMesh = this._getImmediateChildByName(axisMesh, this._mapping.defaultAxis.maxNodeName), axisMap.valueMesh && axisMap.minMesh && axisMap.maxMesh ? comp && comp.onAxisValueChangedObservable.add((axisValues) => {const value = "x-axis" === axis ? axisValues.x : axisValues.y;this._lerpTransform(axisMap, value, !0);}, void 0, !0) : logger/* Logger.Warn */.Y.Warn("Missing axis submesh under mesh with name: " + axisMap.rootNodeName)) : void logger/* Logger.Warn */.Y.Warn("Missing axis mesh with name: " + axisMap.rootNodeName);});}));}_setRootMesh(meshes) {this.rootMesh = new Meshes_mesh/* Mesh */.Kj(this.profileId + " " + this.handedness, this.scene), this.rootMesh.isPickable = !1;let rootMesh;for (let i = 0; i < meshes.length; i++) {const mesh = meshes[i];mesh.isPickable = !1, mesh.parent || (rootMesh = mesh);}rootMesh && rootMesh.setParent(this.rootMesh), this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(0, Math.PI, 0));}_updateModel() {}}WebXRMicrosoftMixedRealityController.MODEL_BASE_URL = "https://controllers.babylonjs.com/microsoft/", WebXRMicrosoftMixedRealityController.MODEL_LEFT_FILENAME = "left.glb", WebXRMicrosoftMixedRealityController.MODEL_RIGHT_FILENAME = "right.glb", WebXRMotionControllerManager.RegisterController("windows-mixed-reality", (xrInput, scene) => new WebXRMicrosoftMixedRealityController(scene, xrInput.gamepad, xrInput.handedness));const MixedRealityProfile = { left: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: { xr_standard_trigger_pressed: { componentProperty: "button", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_trigger_pressed_value", minNodeName: "xr_standard_trigger_pressed_min", maxNodeName: "xr_standard_trigger_pressed_max" } } }, "xr-standard-squeeze": { type: "squeeze", gamepadIndices: { button: 1 }, rootNodeName: "xr_standard_squeeze", visualResponses: { xr_standard_squeeze_pressed: { componentProperty: "button", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_squeeze_pressed_value", minNodeName: "xr_standard_squeeze_pressed_min", maxNodeName: "xr_standard_squeeze_pressed_max" } } }, "xr-standard-touchpad": { type: "touchpad", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: "xr_standard_touchpad", visualResponses: { xr_standard_touchpad_pressed: { componentProperty: "button", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_pressed_value", minNodeName: "xr_standard_touchpad_pressed_min", maxNodeName: "xr_standard_touchpad_pressed_max" }, xr_standard_touchpad_xaxis_pressed: { componentProperty: "xAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_xaxis_pressed_value", minNodeName: "xr_standard_touchpad_xaxis_pressed_min", maxNodeName: "xr_standard_touchpad_xaxis_pressed_max" }, xr_standard_touchpad_yaxis_pressed: { componentProperty: "yAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_yaxis_pressed_value", minNodeName: "xr_standard_touchpad_yaxis_pressed_min", maxNodeName: "xr_standard_touchpad_yaxis_pressed_max" }, xr_standard_touchpad_xaxis_touched: { componentProperty: "xAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_xaxis_touched_value", minNodeName: "xr_standard_touchpad_xaxis_touched_min", maxNodeName: "xr_standard_touchpad_xaxis_touched_max" }, xr_standard_touchpad_yaxis_touched: { componentProperty: "yAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_yaxis_touched_value", minNodeName: "xr_standard_touchpad_yaxis_touched_min", maxNodeName: "xr_standard_touchpad_yaxis_touched_max" }, xr_standard_touchpad_axes_touched: { componentProperty: "state", states: ["touched", "pressed"], valueNodeProperty: "visibility", valueNodeName: "xr_standard_touchpad_axes_touched_value" } }, touchPointNodeName: "xr_standard_touchpad_axes_touched_value" }, "xr-standard-thumbstick": { type: "thumbstick", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: "xr_standard_thumbstick", visualResponses: { xr_standard_thumbstick_pressed: { componentProperty: "button", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_thumbstick_pressed_value", minNodeName: "xr_standard_thumbstick_pressed_min", maxNodeName: "xr_standard_thumbstick_pressed_max" }, xr_standard_thumbstick_xaxis_pressed: { componentProperty: "xAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value", minNodeName: "xr_standard_thumbstick_xaxis_pressed_min", maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max" }, xr_standard_thumbstick_yaxis_pressed: { componentProperty: "yAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value", minNodeName: "xr_standard_thumbstick_yaxis_pressed_min", maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max" } } } }, gamepadMapping: "xr-standard", rootNodeName: "microsoft-mixed-reality-left", assetPath: "left.glb" }, right: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: { xr_standard_trigger_pressed: { componentProperty: "button", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_trigger_pressed_value", minNodeName: "xr_standard_trigger_pressed_min", maxNodeName: "xr_standard_trigger_pressed_max" } } }, "xr-standard-squeeze": { type: "squeeze", gamepadIndices: { button: 1 }, rootNodeName: "xr_standard_squeeze", visualResponses: { xr_standard_squeeze_pressed: { componentProperty: "button", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_squeeze_pressed_value", minNodeName: "xr_standard_squeeze_pressed_min", maxNodeName: "xr_standard_squeeze_pressed_max" } } }, "xr-standard-touchpad": { type: "touchpad", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: "xr_standard_touchpad", visualResponses: { xr_standard_touchpad_pressed: { componentProperty: "button", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_pressed_value", minNodeName: "xr_standard_touchpad_pressed_min", maxNodeName: "xr_standard_touchpad_pressed_max" }, xr_standard_touchpad_xaxis_pressed: { componentProperty: "xAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_xaxis_pressed_value", minNodeName: "xr_standard_touchpad_xaxis_pressed_min", maxNodeName: "xr_standard_touchpad_xaxis_pressed_max" }, xr_standard_touchpad_yaxis_pressed: { componentProperty: "yAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_yaxis_pressed_value", minNodeName: "xr_standard_touchpad_yaxis_pressed_min", maxNodeName: "xr_standard_touchpad_yaxis_pressed_max" }, xr_standard_touchpad_xaxis_touched: { componentProperty: "xAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_xaxis_touched_value", minNodeName: "xr_standard_touchpad_xaxis_touched_min", maxNodeName: "xr_standard_touchpad_xaxis_touched_max" }, xr_standard_touchpad_yaxis_touched: { componentProperty: "yAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_touchpad_yaxis_touched_value", minNodeName: "xr_standard_touchpad_yaxis_touched_min", maxNodeName: "xr_standard_touchpad_yaxis_touched_max" }, xr_standard_touchpad_axes_touched: { componentProperty: "state", states: ["touched", "pressed"], valueNodeProperty: "visibility", valueNodeName: "xr_standard_touchpad_axes_touched_value" } }, touchPointNodeName: "xr_standard_touchpad_axes_touched_value" }, "xr-standard-thumbstick": { type: "thumbstick", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: "xr_standard_thumbstick", visualResponses: { xr_standard_thumbstick_pressed: { componentProperty: "button", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_thumbstick_pressed_value", minNodeName: "xr_standard_thumbstick_pressed_min", maxNodeName: "xr_standard_thumbstick_pressed_max" }, xr_standard_thumbstick_xaxis_pressed: { componentProperty: "xAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value", minNodeName: "xr_standard_thumbstick_xaxis_pressed_min", maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max" }, xr_standard_thumbstick_yaxis_pressed: { componentProperty: "yAxis", states: ["default", "touched", "pressed"], valueNodeProperty: "transform", valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value", minNodeName: "xr_standard_thumbstick_yaxis_pressed_min", maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max" } } } }, gamepadMapping: "xr-standard", rootNodeName: "microsoft-mixed-reality-right", assetPath: "right.glb" } };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/webXROculusTouchMotionController.js
class WebXROculusTouchMotionController extends WebXRAbstractMotionController {constructor(scene, gamepadObject, handedness, _legacyMapping = !1, _forceLegacyControllers = !1) {super(scene, OculusTouchLayouts[handedness], gamepadObject, handedness), this._forceLegacyControllers = _forceLegacyControllers, this.profileId = "oculus-touch";}_getFilenameAndPath() {let filename = "";filename = "left" === this.handedness ? WebXROculusTouchMotionController.MODEL_LEFT_FILENAME : WebXROculusTouchMotionController.MODEL_RIGHT_FILENAME;const path = this._isQuest() ? WebXROculusTouchMotionController.QUEST_MODEL_BASE_URL : WebXROculusTouchMotionController.MODEL_BASE_URL;return { filename, path };}_getModelLoadingConstraints() {return !0;}_processLoadedModel() {const isQuest = this._isQuest(),triggerDirection = "right" === this.handedness ? -1 : 1;this.getComponentIds().forEach((id) => {const comp = id && this.getComponent(id);comp && comp.onButtonStateChangedObservable.add((component) => {if (this.rootMesh && !this.disableAnimation) return "xr-standard-trigger" === id ? void (isQuest || (this._modelRootNode.getChildren()[3].rotation.x = .2 * -component.value, this._modelRootNode.getChildren()[3].position.y = .005 * -component.value, this._modelRootNode.getChildren()[3].position.z = .005 * -component.value)) : "xr-standard-squeeze" === id ? void (isQuest || (this._modelRootNode.getChildren()[4].position.x = .0035 * (triggerDirection * component.value))) : "xr-standard-thumbstick" === id ? void 0 : "a-button" === id || "x-button" === id ? void (isQuest || (component.pressed ? this._modelRootNode.getChildren()[1].position.y = -.001 : this._modelRootNode.getChildren()[1].position.y = 0)) : "b-button" === id || "y-button" === id ? void (isQuest || (component.pressed ? this._modelRootNode.getChildren()[2].position.y = -.001 : this._modelRootNode.getChildren()[2].position.y = 0)) : void 0;}, void 0, !0);});}_setRootMesh(meshes) {this.rootMesh = new Meshes_mesh/* Mesh */.Kj(this.profileId + " " + this.handedness, this.scene), this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(0, Math.PI, 0)), meshes.forEach((mesh) => {mesh.isPickable = !1;}), this._isQuest() ? this._modelRootNode = meshes[0] : (this._modelRootNode = meshes[1], this.rootMesh.position.y = .034, this.rootMesh.position.z = .052), this._modelRootNode.parent = this.rootMesh;}_updateModel() {}_isQuest() {return !!navigator.userAgent.match(/Quest/gi) && !this._forceLegacyControllers;}}WebXROculusTouchMotionController.MODEL_BASE_URL = "https://controllers.babylonjs.com/oculus/", WebXROculusTouchMotionController.MODEL_LEFT_FILENAME = "left.babylon", WebXROculusTouchMotionController.MODEL_RIGHT_FILENAME = "right.babylon", WebXROculusTouchMotionController.QUEST_MODEL_BASE_URL = "https://controllers.babylonjs.com/oculusQuest/", WebXRMotionControllerManager.RegisterController("oculus-touch", (xrInput, scene) => new WebXROculusTouchMotionController(scene, xrInput.gamepad, xrInput.handedness)), WebXRMotionControllerManager.RegisterController("oculus-touch-legacy", (xrInput, scene) => new WebXROculusTouchMotionController(scene, xrInput.gamepad, xrInput.handedness, !0));const OculusTouchLayouts = { left: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: {} }, "xr-standard-squeeze": { type: "squeeze", gamepadIndices: { button: 1 }, rootNodeName: "xr_standard_squeeze", visualResponses: {} }, "xr-standard-thumbstick": { type: "thumbstick", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: "xr_standard_thumbstick", visualResponses: {} }, "x-button": { type: "button", gamepadIndices: { button: 4 }, rootNodeName: "x_button", visualResponses: {} }, "y-button": { type: "button", gamepadIndices: { button: 5 }, rootNodeName: "y_button", visualResponses: {} }, thumbrest: { type: "button", gamepadIndices: { button: 6 }, rootNodeName: "thumbrest", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "oculus-touch-v2-left", assetPath: "left.glb" }, right: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: {} }, "xr-standard-squeeze": { type: "squeeze", gamepadIndices: { button: 1 }, rootNodeName: "xr_standard_squeeze", visualResponses: {} }, "xr-standard-thumbstick": { type: "thumbstick", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: "xr_standard_thumbstick", visualResponses: {} }, "a-button": { type: "button", gamepadIndices: { button: 4 }, rootNodeName: "a_button", visualResponses: {} }, "b-button": { type: "button", gamepadIndices: { button: 5 }, rootNodeName: "b_button", visualResponses: {} }, thumbrest: { type: "button", gamepadIndices: { button: 6 }, rootNodeName: "thumbrest", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "oculus-touch-v2-right", assetPath: "right.glb" } };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/webXRHTCViveMotionController.js
class WebXRHTCViveMotionController extends WebXRAbstractMotionController {constructor(scene, gamepadObject, handedness) {super(scene, HTCViveLayout[handedness], gamepadObject, handedness), this.profileId = "htc-vive";}_getFilenameAndPath() {const filename = WebXRHTCViveMotionController.MODEL_FILENAME,path = WebXRHTCViveMotionController.MODEL_BASE_URL;return { filename, path };}_getModelLoadingConstraints() {return !0;}_processLoadedModel() {this.getComponentIds().forEach((id) => {const comp = id && this.getComponent(id);comp && comp.onButtonStateChangedObservable.add((component) => {if (this.rootMesh && !this.disableAnimation) return "xr-standard-trigger" === id ? void (this._modelRootNode.getChildren()[6].rotation.x = .15 * -component.value) : "xr-standard-touchpad" === id ? void 0 : ("xr-standard-squeeze" === id, void 0);}, void 0, !0);});}_setRootMesh(meshes) {this.rootMesh = new Meshes_mesh/* Mesh */.Kj(this.profileId + " " + this.handedness, this.scene), meshes.forEach((mesh) => {mesh.isPickable = !1;}), this._modelRootNode = meshes[1], this._modelRootNode.parent = this.rootMesh, this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = math_vector/* Quaternion.FromEulerAngles */._f.FromEulerAngles(0, Math.PI, 0));}_updateModel() {}}WebXRHTCViveMotionController.MODEL_BASE_URL = "https://controllers.babylonjs.com/vive/", WebXRHTCViveMotionController.MODEL_FILENAME = "wand.babylon", WebXRMotionControllerManager.RegisterController("htc-vive", (xrInput, scene) => new WebXRHTCViveMotionController(scene, xrInput.gamepad, xrInput.handedness));const HTCViveLayout = { left: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: {} }, "xr-standard-squeeze": { type: "squeeze", gamepadIndices: { button: 1 }, rootNodeName: "xr_standard_squeeze", visualResponses: {} }, "xr-standard-touchpad": { type: "touchpad", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: "xr_standard_touchpad", visualResponses: {} }, menu: { type: "button", gamepadIndices: { button: 4 }, rootNodeName: "menu", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "htc_vive_none", assetPath: "none.glb" }, right: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: {} }, "xr-standard-squeeze": { type: "squeeze", gamepadIndices: { button: 1 }, rootNodeName: "xr_standard_squeeze", visualResponses: {} }, "xr-standard-touchpad": { type: "touchpad", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: "xr_standard_touchpad", visualResponses: {} }, menu: { type: "button", gamepadIndices: { button: 4 }, rootNodeName: "menu", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "htc_vive_none", assetPath: "none.glb" }, none: { selectComponentId: "xr-standard-trigger", components: { "xr-standard-trigger": { type: "trigger", gamepadIndices: { button: 0 }, rootNodeName: "xr_standard_trigger", visualResponses: {} }, "xr-standard-squeeze": { type: "squeeze", gamepadIndices: { button: 1 }, rootNodeName: "xr_standard_squeeze", visualResponses: {} }, "xr-standard-touchpad": { type: "touchpad", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: "xr_standard_touchpad", visualResponses: {} }, menu: { type: "button", gamepadIndices: { button: 4 }, rootNodeName: "menu", visualResponses: {} } }, gamepadMapping: "xr-standard", rootNodeName: "htc-vive-none", assetPath: "none.glb" } };
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/motionController/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/native/nativeXRFrame.js
class NativeXRFrame {get session() {return this._nativeImpl.session;}constructor(_nativeImpl) {this._nativeImpl = _nativeImpl, this._xrTransform = new XRRigidTransform(), this._xrPose = { transform: this._xrTransform, emulatedPosition: !1 }, this._xrPoseVectorData = new Float32Array(8), this.fillPoses = this._nativeImpl.fillPoses.bind(this._nativeImpl), this.getViewerPose = this._nativeImpl.getViewerPose.bind(this._nativeImpl), this.getHitTestResults = this._nativeImpl.getHitTestResults.bind(this._nativeImpl), this.getHitTestResultsForTransientInput = () => {throw new Error("XRFrame.getHitTestResultsForTransientInput not supported on native.");}, this.createAnchor = this._nativeImpl.createAnchor.bind(this._nativeImpl), this.getJointPose = this._nativeImpl.getJointPose.bind(this._nativeImpl), this.fillJointRadii = this._nativeImpl.fillJointRadii.bind(this._nativeImpl), this.getLightEstimate = () => {throw new Error("XRFrame.getLightEstimate not supported on native.");}, this.getImageTrackingResults = () => {var _a;return null !== (_a = this._nativeImpl._imageTrackingResults) && void 0 !== _a ? _a : [];};}getPose(space, baseSpace) {if (this._nativeImpl.getPoseData(space, baseSpace, this._xrPoseVectorData.buffer, this._xrTransform.matrix.buffer)) {const position = this._xrTransform.position;position.x = this._xrPoseVectorData[0], position.y = this._xrPoseVectorData[1], position.z = this._xrPoseVectorData[2], position.w = this._xrPoseVectorData[3];const orientation = this._xrTransform.orientation;return orientation.x = this._xrPoseVectorData[4], orientation.y = this._xrPoseVectorData[5], orientation.z = this._xrPoseVectorData[6], orientation.w = this._xrPoseVectorData[7], this._xrPose;}}get trackedAnchors() {return this._nativeImpl.trackedAnchors;}get worldInformation() {return this._nativeImpl.worldInformation;}get detectedPlanes() {return this._nativeImpl.detectedPlanes;}get featurePointCloud() {return this._nativeImpl.featurePointCloud;}}RegisterNativeTypeAsync("NativeXRFrame", NativeXRFrame);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/native/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/XR/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/types.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Compat/index.js

;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/index.js


/***/ }),

/***/ "./node_modules/@babylonjs/core/node.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "N": () => (/* binding */ Node)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babylonjs/core/tslib.es6.js");
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/decorators.js");
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
class _InternalNodeDataInfo {constructor() {this._doNotSerialize = !1, this._isDisposed = !1, this._sceneRootNodesIndex = -1, this._isEnabled = !0, this._isParentEnabled = !0, this._isReady = !0, this._onEnabledStateChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .y$(), this._onClonedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .y$();}}class Node {static AddNodeConstructor(type, constructorFunc) {this._NodeConstructors[type] = constructorFunc;}static Construct(type, name, scene, options) {const constructorFunc = this._NodeConstructors[type];return constructorFunc ? constructorFunc(name, scene, options) : null;}set accessibilityTag(value) {this._accessibilityTag = value, this.onAccessibilityTagChangedObservable.notifyObservers(value);}get accessibilityTag() {return this._accessibilityTag;}get doNotSerialize() {return !!this._nodeDataStorage._doNotSerialize || !!this._parentNode && this._parentNode.doNotSerialize;}set doNotSerialize(value) {this._nodeDataStorage._doNotSerialize = value;}isDisposed() {return this._nodeDataStorage._isDisposed;}set parent(parent) {if (this._parentNode !== parent) {const previousParentNode = this._parentNode;if (this._parentNode && void 0 !== this._parentNode._children && null !== this._parentNode._children) {const index = this._parentNode._children.indexOf(this);-1 !== index && this._parentNode._children.splice(index, 1), parent || this._nodeDataStorage._isDisposed || this._addToSceneRootNodes();}this._parentNode = parent, this._parentNode && ((void 0 === this._parentNode._children || null === this._parentNode._children) && (this._parentNode._children = []), this._parentNode._children.push(this), !previousParentNode && this._removeFromSceneRootNodes()), this._syncParentEnabledState();}}get parent() {return this._parentNode;}_serializeAsParent(serializationObject) {serializationObject.parentId = this.uniqueId;}_addToSceneRootNodes() {-1 === this._nodeDataStorage._sceneRootNodesIndex && (this._nodeDataStorage._sceneRootNodesIndex = this._scene.rootNodes.length, this._scene.rootNodes.push(this));}_removeFromSceneRootNodes() {if (-1 !== this._nodeDataStorage._sceneRootNodesIndex) {const rootNodes = this._scene.rootNodes,lastIdx = rootNodes.length - 1;rootNodes[this._nodeDataStorage._sceneRootNodesIndex] = rootNodes[lastIdx], rootNodes[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex = this._nodeDataStorage._sceneRootNodesIndex, this._scene.rootNodes.pop(), this._nodeDataStorage._sceneRootNodesIndex = -1;}}get animationPropertiesOverride() {return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride;}set animationPropertiesOverride(value) {this._animationPropertiesOverride = value;}getClassName() {return "Node";}set onDispose(callback) {this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(callback);}get onEnabledStateChangedObservable() {return this._nodeDataStorage._onEnabledStateChangedObservable;}get onClonedObservable() {return this._nodeDataStorage._onClonedObservable;}constructor(name, scene = null) {this._isDirty = !1, this._nodeDataStorage = new _InternalNodeDataInfo(), this.state = "", this.metadata = null, this.reservedDataStore = null, this._accessibilityTag = null, this.onAccessibilityTagChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .y$(), this._parentContainer = null, this.animations = [], this._ranges = {}, this.onReady = null, this._currentRenderId = -1, this._parentUpdateId = -1, this._childUpdateId = -1, this._waitingParentId = null, this._waitingParentInstanceIndex = null, this._waitingParsedUniqueId = null, this._cache = {}, this._parentNode = null, this._children = null, this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.Identity */ .y3.Identity(), this._worldMatrixDeterminant = 0, this._worldMatrixDeterminantIsDirty = !0, this._animationPropertiesOverride = null, this._isNode = !0, this.onDisposeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .y$(), this._onDisposeObserver = null, this._behaviors = [], this.name = name, this.id = name, this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore.LastCreatedScene */ .l.LastCreatedScene, this.uniqueId = this._scene.getUniqueId(), this._initCache();}getScene() {return this._scene;}getEngine() {return this._scene.getEngine();}addBehavior(behavior, attachImmediately = !1) {const index = this._behaviors.indexOf(behavior);return -1 === index ? (behavior.init(), this._scene.isLoading && !attachImmediately ? this._scene.onDataLoadedObservable.addOnce(() => {behavior.attach(this);}) : behavior.attach(this), this._behaviors.push(behavior), this) : this;}removeBehavior(behavior) {const index = this._behaviors.indexOf(behavior);return -1 === index ? this : (this._behaviors[index].detach(), this._behaviors.splice(index, 1), this);}get behaviors() {return this._behaviors;}getBehaviorByName(name) {for (const behavior of this._behaviors) if (behavior.name === name) return behavior;return null;}getWorldMatrix() {return this._currentRenderId !== this._scene.getRenderId() && this.computeWorldMatrix(), this._worldMatrix;}_getWorldMatrixDeterminant() {return this._worldMatrixDeterminantIsDirty && (this._worldMatrixDeterminantIsDirty = !1, this._worldMatrixDeterminant = this._worldMatrix.determinant()), this._worldMatrixDeterminant;}get worldMatrixFromCache() {return this._worldMatrix;}_initCache() {this._cache = {}, this._cache.parent = void 0;}updateCache(force) {!force && this.isSynchronized() || (this._cache.parent = this.parent, this._updateCache());}_getActionManagerForTrigger(trigger, _initialCall = !0) {return this.parent ? this.parent._getActionManagerForTrigger(trigger, !1) : null;}_updateCache() {}_isSynchronized() {return !0;}_markSyncedWithParent() {this._parentNode && (this._parentUpdateId = this._parentNode._childUpdateId);}isSynchronizedWithParent() {return !this._parentNode || !(this._parentNode._isDirty || this._parentUpdateId !== this._parentNode._childUpdateId) && this._parentNode.isSynchronized();}isSynchronized() {return this._cache.parent === this._parentNode ? (!this._parentNode || this.isSynchronizedWithParent()) && this._isSynchronized() : (this._cache.parent = this._parentNode, !1);}isReady(_completeCheck = !1) {return this._nodeDataStorage._isReady;}markAsDirty() {return this._currentRenderId = Number.MAX_VALUE, this._isDirty = !0, this;}isEnabled(checkAncestors = !0) {return !1 === checkAncestors ? this._nodeDataStorage._isEnabled : !!this._nodeDataStorage._isEnabled && this._nodeDataStorage._isParentEnabled;}_syncParentEnabledState() {this._nodeDataStorage._isParentEnabled = !this._parentNode || this._parentNode.isEnabled(), this._children && this._children.forEach((c) => {c._syncParentEnabledState();});}setEnabled(value) {this._nodeDataStorage._isEnabled === value || (this._nodeDataStorage._isEnabled = value, this._syncParentEnabledState(), this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(value));}isDescendantOf(ancestor) {return !!this.parent && (this.parent === ancestor || this.parent.isDescendantOf(ancestor));}_getDescendants(results, directDescendantsOnly = !1, predicate) {if (this._children) for (let index = 0; index < this._children.length; index++) {const item = this._children[index];(!predicate || predicate(item)) && results.push(item), directDescendantsOnly || item._getDescendants(results, !1, predicate);}}getDescendants(directDescendantsOnly, predicate) {const results = [];return this._getDescendants(results, directDescendantsOnly, predicate), results;}getChildMeshes(directDescendantsOnly, predicate) {const results = [];return this._getDescendants(results, directDescendantsOnly, (node) => (!predicate || predicate(node)) && void 0 !== node.cullingStrategy), results;}getChildren(predicate, directDescendantsOnly = !0) {return this.getDescendants(directDescendantsOnly, predicate);}_setReady(state) {return state === this._nodeDataStorage._isReady ? void 0 : state ? void (this.onReady && this.onReady(this), this._nodeDataStorage._isReady = !0) : void (this._nodeDataStorage._isReady = !1);}getAnimationByName(name) {for (let i = 0; i < this.animations.length; i++) {const animation = this.animations[i];if (animation.name === name) return animation;}return null;}createAnimationRange(name, from, to) {if (!this._ranges[name]) {this._ranges[name] = Node._AnimationRangeFactory(name, from, to);for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) this.animations[i] && this.animations[i].createRange(name, from, to);}}deleteAnimationRange(name, deleteFrames = !0) {for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) this.animations[i] && this.animations[i].deleteRange(name, deleteFrames);this._ranges[name] = null;}getAnimationRange(name) {return this._ranges[name] || null;}getAnimationRanges() {const animationRanges = [];for (var name in this._ranges) animationRanges.push(this._ranges[name]);return animationRanges;}beginAnimation(name, loop, speedRatio, onAnimationEnd) {const range = this.getAnimationRange(name);return range ? this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd) : null;}serializeAnimationRanges() {const serializationRanges = [];for (const name in this._ranges) {const localRange = this._ranges[name];if (!localRange) continue;const range = {};range.name = name, range.from = localRange.from, range.to = localRange.to, serializationRanges.push(range);}return serializationRanges;}computeWorldMatrix() {return this._worldMatrix || (this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix.Identity */ .y3.Identity()), this._worldMatrix;}dispose(doNotRecurse, disposeMaterialAndTextures = !1) {if (this._nodeDataStorage._isDisposed = !0, !doNotRecurse) {const nodes = this.getDescendants(!0);for (const node of nodes) node.dispose(doNotRecurse, disposeMaterialAndTextures);}this.parent ? this.parent = null : this._removeFromSceneRootNodes(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onEnabledStateChangedObservable.clear(), this.onClonedObservable.clear();for (const behavior of this._behaviors) behavior.detach();this._behaviors.length = 0, this.metadata = null;}static ParseAnimationRanges(node, parsedNode) {if (parsedNode.ranges) for (let index = 0; index < parsedNode.ranges.length; index++) {const data = parsedNode.ranges[index];node.createAnimationRange(data.name, data.from, data.to);}}getHierarchyBoundingVectors(includeDescendants = !0, predicate = null) {this.getScene().incrementRenderId(), this.computeWorldMatrix(!0);let min, max;const thisAbstractMesh = this;if (thisAbstractMesh.getBoundingInfo && thisAbstractMesh.subMeshes) {const boundingInfo = thisAbstractMesh.getBoundingInfo();min = boundingInfo.boundingBox.minimumWorld.clone(), max = boundingInfo.boundingBox.maximumWorld.clone();} else min = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), max = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .P(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);if (includeDescendants) {const descendants = this.getDescendants(!1);for (const descendant of descendants) {const childMesh = descendant;if (childMesh.computeWorldMatrix(!0), predicate && !predicate(childMesh)) continue;if (!childMesh.getBoundingInfo || 0 === childMesh.getTotalVertices()) continue;const childBoundingInfo = childMesh.getBoundingInfo(),boundingBox = childBoundingInfo.boundingBox,minBox = boundingBox.minimumWorld,maxBox = boundingBox.maximumWorld;_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.CheckExtends */ .P.CheckExtends(minBox, min, max), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3.CheckExtends */ .P.CheckExtends(maxBox, min, max);}}return { min: min, max: max };}}Node._AnimationRangeFactory = () => {throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .S)("AnimationRange");}, Node._NodeConstructors = {}, (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], Node.prototype, "name", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], Node.prototype, "id", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], Node.prototype, "uniqueId", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], Node.prototype, "state", void 0), (0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .gn)([(0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .qC)()], Node.prototype, "metadata", void 0);

/***/ }),

/***/ "./node_modules/@babylonjs/core/scene.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "x": () => (/* binding */ Scene),
  "a": () => (/* binding */ ScenePerformancePriority)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__("./node_modules/@babylonjs/core/Misc/tools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/precisionDate.js
var precisionDate = __webpack_require__("./node_modules/@babylonjs/core/Misc/precisionDate.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__("./node_modules/@babylonjs/core/Misc/observable.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/smartArray.js
var smartArray = __webpack_require__("./node_modules/@babylonjs/core/Misc/smartArray.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/stringDictionary.js
var stringDictionary = __webpack_require__("./node_modules/@babylonjs/core/Misc/stringDictionary.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tags.js
var tags = __webpack_require__("./node_modules/@babylonjs/core/Misc/tags.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.vector.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/abstractScene.js
var abstractScene = __webpack_require__("./node_modules/@babylonjs/core/abstractScene.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js
var imageProcessingConfiguration = __webpack_require__("./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/uniformBuffer.js
var uniformBuffer = __webpack_require__("./node_modules/@babylonjs/core/Materials/uniformBuffer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Collisions/pickingInfo.js
var pickingInfo = __webpack_require__("./node_modules/@babylonjs/core/Collisions/pickingInfo.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Actions/actionEvent.js
var actionEvent = __webpack_require__("./node_modules/@babylonjs/core/Actions/actionEvent.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/postProcessManager.js
var postProcessManager = __webpack_require__("./node_modules/@babylonjs/core/PostProcesses/postProcessManager.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Rendering/renderingManager.js
var renderingManager = __webpack_require__("./node_modules/@babylonjs/core/Rendering/renderingManager.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/sceneComponent.js
var sceneComponent = __webpack_require__("./node_modules/@babylonjs/core/sceneComponent.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/domManagement.js
var domManagement = __webpack_require__("./node_modules/@babylonjs/core/Misc/domManagement.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engineStore.js
var engineStore = __webpack_require__("./node_modules/@babylonjs/core/Engines/engineStore.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/devTools.js
var devTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/devTools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/pointerEvents.js
var pointerEvents = __webpack_require__("./node_modules/@babylonjs/core/Events/pointerEvents.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Actions/abstractActionManager.js
var abstractActionManager = __webpack_require__("./node_modules/@babylonjs/core/Actions/abstractActionManager.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/keyboardEvents.js
var keyboardEvents = __webpack_require__("./node_modules/@babylonjs/core/Events/keyboardEvents.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js
var deviceEnums = __webpack_require__("./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js + 4 modules
var deviceSourceManager = __webpack_require__("./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/Inputs/scene.inputManager.js
class _ClickInfo {constructor() {this._singleClick = !1, this._doubleClick = !1, this._hasSwiped = !1, this._ignore = !1;}get singleClick() {return this._singleClick;}get doubleClick() {return this._doubleClick;}get hasSwiped() {return this._hasSwiped;}get ignore() {return this._ignore;}set singleClick(b) {this._singleClick = b;}set doubleClick(b) {this._doubleClick = b;}set hasSwiped(b) {this._hasSwiped = b;}set ignore(b) {this._ignore = b;}}class InputManager {constructor(scene) {this._alreadyAttached = !1, this._meshPickProceed = !1, this._currentPickResult = null, this._previousPickResult = null, this._totalPointersPressed = 0, this._doubleClickOccured = !1, this._isSwiping = !1, this._swipeButtonPressed = -1, this._skipPointerTap = !1, this._isMultiTouchGesture = !1, this._pointerX = 0, this._pointerY = 0, this._startingPointerPosition = new math_vector/* Vector2 */.FM(0, 0), this._previousStartingPointerPosition = new math_vector/* Vector2 */.FM(0, 0), this._startingPointerTime = 0, this._previousStartingPointerTime = 0, this._pointerCaptures = {}, this._meshUnderPointerId = {}, this._movePointerInfo = null, this._cameraObserverCount = 0, this._deviceSourceManager = null, this._scene = scene || engineStore/* EngineStore.LastCreatedScene */.l.LastCreatedScene;!this._scene;}get meshUnderPointer() {return this._movePointerInfo && (this._movePointerInfo._generatePickInfo(), this._movePointerInfo = null), this._pointerOverMesh;}getMeshUnderPointerByPointerId(pointerId) {return this._meshUnderPointerId[pointerId] || null;}get unTranslatedPointer() {return new math_vector/* Vector2 */.FM(this._unTranslatedPointerX, this._unTranslatedPointerY);}get pointerX() {return this._pointerX;}set pointerX(value) {this._pointerX = value;}get pointerY() {return this._pointerY;}set pointerY(value) {this._pointerY = value;}_updatePointerPosition(evt) {const canvasRect = this._scene.getEngine().getInputElementClientRect();canvasRect && (this._pointerX = evt.clientX - canvasRect.left, this._pointerY = evt.clientY - canvasRect.top, this._unTranslatedPointerX = this._pointerX, this._unTranslatedPointerY = this._pointerY);}_processPointerMove(pickResult, evt) {const scene = this._scene,engine = scene.getEngine(),canvas = engine.getInputElement();canvas && (canvas.tabIndex = engine.canvasTabIndex, !scene.doNotHandleCursors && (canvas.style.cursor = scene.defaultCursor)), this._setCursorAndPointerOverMesh(pickResult, evt, scene);for (const step of scene._pointerMoveStage) {const isMeshPicked = !(!(null !== pickResult && void 0 !== pickResult) || !pickResult.pickedMesh);pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, isMeshPicked, canvas);}const type = evt.inputIndex >= deviceEnums/* PointerInput.MouseWheelX */.Fz.MouseWheelX && evt.inputIndex <= deviceEnums/* PointerInput.MouseWheelZ */.Fz.MouseWheelZ ? pointerEvents/* PointerEventTypes.POINTERWHEEL */.kD.POINTERWHEEL : pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE;scene.onPointerMove && (pickResult = pickResult || this._pickMove(evt), scene.onPointerMove(evt, pickResult, type));let pointerInfo;pickResult ? (pointerInfo = new pointerEvents/* PointerInfo */.R5(type, evt, pickResult), this._setRayOnPointerInfo(pickResult, evt)) : (pointerInfo = new pointerEvents/* PointerInfo */.R5(type, evt, null, this), this._movePointerInfo = pointerInfo), scene.onPointerObservable.hasObservers() && scene.onPointerObservable.notifyObservers(pointerInfo, type);}_setRayOnPointerInfo(pickInfo, event) {const scene = this._scene;pickInfo && scene._pickingAvailable && !pickInfo.ray && (pickInfo.ray = scene.createPickingRay(event.offsetX, event.offsetY, math_vector/* Matrix.Identity */.y3.Identity(), scene.activeCamera));}_addCameraPointerObserver(observer, mask) {return this._cameraObserverCount++, this._scene.onPointerObservable.add(observer, mask);}_removeCameraPointerObserver(observer) {return this._cameraObserverCount--, this._scene.onPointerObservable.remove(observer);}_checkForPicking() {return !!(this._scene.onPointerObservable.observers.length > this._cameraObserverCount || this._scene.onPointerPick);}_checkPrePointerObservable(pickResult, evt, type) {const scene = this._scene,pi = new pointerEvents/* PointerInfoPre */.FV(type, evt, this._unTranslatedPointerX, this._unTranslatedPointerY);return pickResult && (pi.originalPickingInfo = pickResult, pi.ray = pickResult.ray, pickResult.originMesh && (pi.nearInteractionPickingInfo = pickResult)), scene.onPrePointerObservable.notifyObservers(pi, type), !!pi.skipOnPointerObservable;}_pickMove(evt) {const scene = this._scene,pickResult = scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, scene.pointerMovePredicate, !1, scene.cameraToUseForPointers, scene.pointerMoveTrianglePredicate);return this._setCursorAndPointerOverMesh(pickResult, evt, scene), pickResult;}_setCursorAndPointerOverMesh(pickResult, evt, scene) {const engine = scene.getEngine(),canvas = engine.getInputElement();if (!(null !== pickResult && void 0 !== pickResult) || !pickResult.pickedMesh) this.setPointerOverMesh(null, evt.pointerId, pickResult, evt);else if (this.setPointerOverMesh(pickResult.pickedMesh, evt.pointerId, pickResult, evt), !scene.doNotHandleCursors && canvas && this._pointerOverMesh) {const actionManager = this._pointerOverMesh._getActionManagerForTrigger();actionManager && actionManager.hasPointerTriggers && (canvas.style.cursor = actionManager.hoverCursor || scene.hoverCursor);}}simulatePointerMove(pickResult, pointerEventInit) {const evt = new PointerEvent("pointermove", pointerEventInit);evt.inputIndex = deviceEnums/* PointerInput.Move */.Fz.Move;this._checkPrePointerObservable(pickResult, evt, pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE) || this._processPointerMove(pickResult, evt);}simulatePointerDown(pickResult, pointerEventInit) {const evt = new PointerEvent("pointerdown", pointerEventInit);evt.inputIndex = evt.button + 2;this._checkPrePointerObservable(pickResult, evt, pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN) || this._processPointerDown(pickResult, evt);}_processPointerDown(pickResult, evt) {const scene = this._scene;if (null === pickResult || void 0 === pickResult ? void 0 : pickResult.pickedMesh) {this._pickedDownMesh = pickResult.pickedMesh;const actionManager = pickResult.pickedMesh._getActionManagerForTrigger();if (actionManager) {if (actionManager.hasPickTriggers) switch (actionManager.processTrigger(5, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(pickResult.pickedMesh, evt)), evt.button) {case 0:actionManager.processTrigger(2, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(pickResult.pickedMesh, evt));break;case 1:actionManager.processTrigger(4, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(pickResult.pickedMesh, evt));break;case 2:actionManager.processTrigger(3, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(pickResult.pickedMesh, evt));}actionManager.hasSpecificTrigger(8) && window.setTimeout(() => {const pickResult = scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, (mesh) => mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.actionManager && mesh.actionManager.hasSpecificTrigger(8) && mesh === this._pickedDownMesh, !1, scene.cameraToUseForPointers);(null === pickResult || void 0 === pickResult ? void 0 : pickResult.pickedMesh) && actionManager && 0 !== this._totalPointersPressed && Date.now() - this._startingPointerTime > InputManager.LongPressDelay && !this._isPointerSwiping() && (this._startingPointerTime = 0, actionManager.processTrigger(8, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(pickResult.pickedMesh, evt)));}, InputManager.LongPressDelay);}} else for (const step of scene._pointerDownStage) pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, evt, !1);let pointerInfo;const type = pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN;pickResult ? (scene.onPointerDown && scene.onPointerDown(evt, pickResult, type), pointerInfo = new pointerEvents/* PointerInfo */.R5(type, evt, pickResult), this._setRayOnPointerInfo(pickResult, evt)) : pointerInfo = new pointerEvents/* PointerInfo */.R5(type, evt, null, this), scene.onPointerObservable.hasObservers() && scene.onPointerObservable.notifyObservers(pointerInfo, type);}_isPointerSwiping() {return this._isSwiping;}simulatePointerUp(pickResult, pointerEventInit, doubleTap) {const evt = new PointerEvent("pointerup", pointerEventInit);evt.inputIndex = deviceEnums/* PointerInput.Move */.Fz.Move;const clickInfo = new _ClickInfo();doubleTap ? clickInfo.doubleClick = !0 : clickInfo.singleClick = !0;this._checkPrePointerObservable(pickResult, evt, pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP) || this._processPointerUp(pickResult, evt, clickInfo);}_processPointerUp(pickResult, evt, clickInfo) {const scene = this._scene;if (null === pickResult || void 0 === pickResult ? void 0 : pickResult.pickedMesh) {if (this._pickedUpMesh = pickResult.pickedMesh, this._pickedDownMesh === this._pickedUpMesh && (scene.onPointerPick && scene.onPointerPick(evt, pickResult), clickInfo.singleClick && !clickInfo.ignore && scene.onPointerObservable.observers.length > this._cameraObserverCount)) {const type = pointerEvents/* PointerEventTypes.POINTERPICK */.kD.POINTERPICK,pi = new pointerEvents/* PointerInfo */.R5(type, evt, pickResult);this._setRayOnPointerInfo(pickResult, evt), scene.onPointerObservable.notifyObservers(pi, type);}const actionManager = pickResult.pickedMesh._getActionManagerForTrigger();if (actionManager && !clickInfo.ignore) {actionManager.processTrigger(7, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(pickResult.pickedMesh, evt, pickResult)), !clickInfo.hasSwiped && clickInfo.singleClick && actionManager.processTrigger(1, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(pickResult.pickedMesh, evt, pickResult));const doubleClickActionManager = pickResult.pickedMesh._getActionManagerForTrigger(6);clickInfo.doubleClick && doubleClickActionManager && doubleClickActionManager.processTrigger(6, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(pickResult.pickedMesh, evt, pickResult));}} else if (!clickInfo.ignore) for (const step of scene._pointerUpStage) pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, evt, clickInfo.doubleClick);if (this._pickedDownMesh && this._pickedDownMesh !== this._pickedUpMesh) {const pickedDownActionManager = this._pickedDownMesh._getActionManagerForTrigger(16);pickedDownActionManager && pickedDownActionManager.processTrigger(16, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(this._pickedDownMesh, evt));}if (!clickInfo.ignore) {const pi = new pointerEvents/* PointerInfo */.R5(pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP, evt, pickResult);if (this._setRayOnPointerInfo(pickResult, evt), scene.onPointerObservable.notifyObservers(pi, pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP), scene.onPointerUp && scene.onPointerUp(evt, pickResult, pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP), !clickInfo.hasSwiped && !this._skipPointerTap && !this._isMultiTouchGesture) {let type = 0;if (clickInfo.singleClick ? type = pointerEvents/* PointerEventTypes.POINTERTAP */.kD.POINTERTAP : clickInfo.doubleClick && (type = pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP), type) {const pi = new pointerEvents/* PointerInfo */.R5(type, evt, pickResult);scene.onPointerObservable.hasObservers() && scene.onPointerObservable.hasSpecificMask(type) && scene.onPointerObservable.notifyObservers(pi, type);}}}}isPointerCaptured(pointerId = 0) {return this._pointerCaptures[pointerId];}attachControl(attachUp = !0, attachDown = !0, attachMove = !0, elementToAttachTo = null) {const scene = this._scene,engine = scene.getEngine();elementToAttachTo || (elementToAttachTo = engine.getInputElement()), this._alreadyAttached && this.detachControl(), elementToAttachTo && (this._alreadyAttachedTo = elementToAttachTo), this._deviceSourceManager = new deviceSourceManager/* DeviceSourceManager */.U(engine), this._initActionManager = (act) => {if (!this._meshPickProceed) {const pickResult = !scene.skipPointerUpPicking && (0 !== scene._registeredActions || this._checkForPicking() || scene.onPointerUp) ? scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, scene.pointerUpPredicate, !1, scene.cameraToUseForPointers) : null;this._currentPickResult = pickResult, pickResult && (act = pickResult.hit && pickResult.pickedMesh ? pickResult.pickedMesh._getActionManagerForTrigger() : null), this._meshPickProceed = !0;}return act;}, this._delayedSimpleClick = (btn, clickInfo, cb) => {(Date.now() - this._previousStartingPointerTime > InputManager.DoubleClickDelay && !this._doubleClickOccured || btn !== this._previousButtonPressed) && (this._doubleClickOccured = !1, clickInfo.singleClick = !0, clickInfo.ignore = !1, cb(clickInfo, this._currentPickResult));}, this._initClickEvent = (obs1, obs2, evt, cb) => {const clickInfo = new _ClickInfo();this._currentPickResult = null;let act = null,checkPicking = obs1.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERPICK */.kD.POINTERPICK) || obs2.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERPICK */.kD.POINTERPICK) || obs1.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERTAP */.kD.POINTERTAP) || obs2.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERTAP */.kD.POINTERTAP) || obs1.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP) || obs2.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP);!checkPicking && abstractActionManager/* AbstractActionManager */.O && (act = this._initActionManager(act, clickInfo), act && (checkPicking = act.hasPickTriggers));let needToIgnoreNext = !1;if (checkPicking) {const btn = evt.button;if (clickInfo.hasSwiped = this._isPointerSwiping(), !clickInfo.hasSwiped) {let checkSingleClickImmediately = !InputManager.ExclusiveDoubleClickMode;checkSingleClickImmediately || (checkSingleClickImmediately = !obs1.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP) && !obs2.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP), checkSingleClickImmediately && !abstractActionManager/* AbstractActionManager.HasSpecificTrigger */.O.HasSpecificTrigger(6) && (act = this._initActionManager(act, clickInfo), act && (checkSingleClickImmediately = !act.hasSpecificTrigger(6)))), checkSingleClickImmediately ? (Date.now() - this._previousStartingPointerTime > InputManager.DoubleClickDelay || btn !== this._previousButtonPressed) && (clickInfo.singleClick = !0, cb(clickInfo, this._currentPickResult), needToIgnoreNext = !0) : (this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout, this._delayedSimpleClickTimeout = window.setTimeout(this._delayedSimpleClick.bind(this, btn, clickInfo, cb), InputManager.DoubleClickDelay));let checkDoubleClick = obs1.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP) || obs2.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP);!checkDoubleClick && abstractActionManager/* AbstractActionManager.HasSpecificTrigger */.O.HasSpecificTrigger(6) && (act = this._initActionManager(act, clickInfo), act && (checkDoubleClick = act.hasSpecificTrigger(6))), checkDoubleClick && (btn === this._previousButtonPressed && Date.now() - this._previousStartingPointerTime < InputManager.DoubleClickDelay && !this._doubleClickOccured ? (clickInfo.hasSwiped || this._isPointerSwiping() ? (this._doubleClickOccured = !1, this._previousStartingPointerTime = this._startingPointerTime, this._previousStartingPointerPosition.x = this._startingPointerPosition.x, this._previousStartingPointerPosition.y = this._startingPointerPosition.y, this._previousButtonPressed = btn, InputManager.ExclusiveDoubleClickMode ? (this._previousDelayedSimpleClickTimeout && clearTimeout(this._previousDelayedSimpleClickTimeout), this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout, cb(clickInfo, this._previousPickResult)) : cb(clickInfo, this._currentPickResult)) : (this._previousStartingPointerTime = 0, this._doubleClickOccured = !0, clickInfo.doubleClick = !0, clickInfo.ignore = !1, InputManager.ExclusiveDoubleClickMode && this._previousDelayedSimpleClickTimeout && clearTimeout(this._previousDelayedSimpleClickTimeout), this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout, cb(clickInfo, this._currentPickResult)), needToIgnoreNext = !0) : (this._doubleClickOccured = !1, this._previousStartingPointerTime = this._startingPointerTime, this._previousStartingPointerPosition.x = this._startingPointerPosition.x, this._previousStartingPointerPosition.y = this._startingPointerPosition.y, this._previousButtonPressed = btn));}}needToIgnoreNext || cb(clickInfo, this._currentPickResult);}, this._onPointerMove = (evt) => {if ((void 0 === evt.pointerId && (evt.pointerId = 0), this._updatePointerPosition(evt), this._isSwiping || -1 === this._swipeButtonPressed || (this._isSwiping = Math.abs(this._startingPointerPosition.x - this._pointerX) > InputManager.DragMovementThreshold || Math.abs(this._startingPointerPosition.y - this._pointerY) > InputManager.DragMovementThreshold), !this._checkPrePointerObservable(null, evt, evt.inputIndex >= deviceEnums/* PointerInput.MouseWheelX */.Fz.MouseWheelX && evt.inputIndex <= deviceEnums/* PointerInput.MouseWheelZ */.Fz.MouseWheelZ ? pointerEvents/* PointerEventTypes.POINTERWHEEL */.kD.POINTERWHEEL : pointerEvents/* PointerEventTypes.POINTERMOVE */.kD.POINTERMOVE)) && (scene.cameraToUseForPointers || scene.activeCamera)) {if (scene.skipPointerMovePicking) return void this._processPointerMove(new pickingInfo/* PickingInfo */.p(), evt);scene.pointerMovePredicate || (scene.pointerMovePredicate = (mesh) => mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (mesh.enablePointerMoveEvents || scene.constantlyUpdateMeshUnderPointer || null !== mesh._getActionManagerForTrigger()) && (!scene.cameraToUseForPointers || 0 != (scene.cameraToUseForPointers.layerMask & mesh.layerMask)));const pickResult = 0 < scene._registeredActions ? this._pickMove(evt) : null;this._processPointerMove(pickResult, evt);}}, this._onPointerDown = (evt) => {if (this._totalPointersPressed++, this._pickedDownMesh = null, this._meshPickProceed = !1, void 0 === evt.pointerId && (evt.pointerId = 0), this._updatePointerPosition(evt), -1 === this._swipeButtonPressed && (this._swipeButtonPressed = evt.button), scene.preventDefaultOnPointerDown && elementToAttachTo && (evt.preventDefault(), elementToAttachTo.focus()), this._startingPointerPosition.x = this._pointerX, this._startingPointerPosition.y = this._pointerY, this._startingPointerTime = Date.now(), this._checkPrePointerObservable(null, evt, pointerEvents/* PointerEventTypes.POINTERDOWN */.kD.POINTERDOWN)) return;if (!scene.cameraToUseForPointers && !scene.activeCamera) return;this._pointerCaptures[evt.pointerId] = !0, scene.pointerDownPredicate || (scene.pointerDownPredicate = (mesh) => mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (!scene.cameraToUseForPointers || 0 != (scene.cameraToUseForPointers.layerMask & mesh.layerMask))), this._pickedDownMesh = null;let pickResult;pickResult = !scene.skipPointerDownPicking && (0 !== scene._registeredActions || this._checkForPicking() || scene.onPointerDown) ? scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, scene.pointerDownPredicate, !1, scene.cameraToUseForPointers) : new pickingInfo/* PickingInfo */.p(), this._processPointerDown(pickResult, evt);}, this._onPointerUp = (evt) => {0 === this._totalPointersPressed || (this._totalPointersPressed--, this._pickedUpMesh = null, this._meshPickProceed = !1, evt.pointerId === void 0 && (evt.pointerId = 0), this._updatePointerPosition(evt), scene.preventDefaultOnPointerUp && elementToAttachTo && (evt.preventDefault(), elementToAttachTo.focus()), this._initClickEvent(scene.onPrePointerObservable, scene.onPointerObservable, evt, (clickInfo, pickResult) => {if (scene.onPrePointerObservable.hasObservers() && (this._skipPointerTap = !1, !clickInfo.ignore)) {if (this._checkPrePointerObservable(null, evt, pointerEvents/* PointerEventTypes.POINTERUP */.kD.POINTERUP)) return void (this._swipeButtonPressed === evt.button && (this._isSwiping = !1, this._swipeButtonPressed = -1));clickInfo.hasSwiped || (clickInfo.singleClick && scene.onPrePointerObservable.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERTAP */.kD.POINTERTAP) && this._checkPrePointerObservable(null, evt, pointerEvents/* PointerEventTypes.POINTERTAP */.kD.POINTERTAP) && (this._skipPointerTap = !0), clickInfo.doubleClick && scene.onPrePointerObservable.hasSpecificMask(pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP) && this._checkPrePointerObservable(null, evt, pointerEvents/* PointerEventTypes.POINTERDOUBLETAP */.kD.POINTERDOUBLETAP) && (this._skipPointerTap = !0));}if (!this._pointerCaptures[evt.pointerId]) return void (this._swipeButtonPressed === evt.button && (this._isSwiping = !1, this._swipeButtonPressed = -1));0 === evt.buttons && (this._pointerCaptures[evt.pointerId] = !1);(scene.cameraToUseForPointers || scene.activeCamera) && (!scene.pointerUpPredicate && (scene.pointerUpPredicate = (mesh) => mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (!scene.cameraToUseForPointers || 0 != (scene.cameraToUseForPointers.layerMask & mesh.layerMask))), !this._meshPickProceed && (abstractActionManager/* AbstractActionManager */.O && abstractActionManager/* AbstractActionManager.HasTriggers */.O.HasTriggers || this._checkForPicking() || scene.onPointerUp) && this._initActionManager(null, clickInfo), !pickResult && (pickResult = this._currentPickResult), this._processPointerUp(pickResult, evt, clickInfo), this._previousPickResult = this._currentPickResult, this._swipeButtonPressed === evt.button && (this._isSwiping = !1, this._swipeButtonPressed = -1));}));}, this._onKeyDown = (evt) => {const type = keyboardEvents/* KeyboardEventTypes.KEYDOWN */.OG.KEYDOWN;if (scene.onPreKeyboardObservable.hasObservers()) {const pi = new keyboardEvents/* KeyboardInfoPre */.WZ(type, evt);if (scene.onPreKeyboardObservable.notifyObservers(pi, type), pi.skipOnKeyboardObservable) return;}if (scene.onKeyboardObservable.hasObservers()) {const pi = new keyboardEvents/* KeyboardInfo */.NG(type, evt);scene.onKeyboardObservable.notifyObservers(pi, type);}scene.actionManager && scene.actionManager.processTrigger(14, actionEvent/* ActionEvent.CreateNewFromScene */.V.CreateNewFromScene(scene, evt));}, this._onKeyUp = (evt) => {const type = keyboardEvents/* KeyboardEventTypes.KEYUP */.OG.KEYUP;if (scene.onPreKeyboardObservable.hasObservers()) {const pi = new keyboardEvents/* KeyboardInfoPre */.WZ(type, evt);if (scene.onPreKeyboardObservable.notifyObservers(pi, type), pi.skipOnKeyboardObservable) return;}if (scene.onKeyboardObservable.hasObservers()) {const pi = new keyboardEvents/* KeyboardInfo */.NG(type, evt);scene.onKeyboardObservable.notifyObservers(pi, type);}scene.actionManager && scene.actionManager.processTrigger(15, actionEvent/* ActionEvent.CreateNewFromScene */.V.CreateNewFromScene(scene, evt));}, this._deviceSourceManager.onDeviceConnectedObservable.add((deviceSource) => {deviceSource.deviceType === deviceEnums/* DeviceType.Mouse */.Yi.Mouse ? deviceSource.onInputChangedObservable.add((eventData) => {eventData.inputIndex === deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick || eventData.inputIndex === deviceEnums/* PointerInput.MiddleClick */.Fz.MiddleClick || eventData.inputIndex === deviceEnums/* PointerInput.RightClick */.Fz.RightClick || eventData.inputIndex === deviceEnums/* PointerInput.BrowserBack */.Fz.BrowserBack || eventData.inputIndex === deviceEnums/* PointerInput.BrowserForward */.Fz.BrowserForward ? attachDown && 1 === deviceSource.getInput(eventData.inputIndex) ? this._onPointerDown(eventData) : attachUp && 0 === deviceSource.getInput(eventData.inputIndex) && this._onPointerUp(eventData) : attachMove && (eventData.inputIndex === deviceEnums/* PointerInput.Move */.Fz.Move ? this._onPointerMove(eventData) : (eventData.inputIndex === deviceEnums/* PointerInput.MouseWheelX */.Fz.MouseWheelX || eventData.inputIndex === deviceEnums/* PointerInput.MouseWheelY */.Fz.MouseWheelY || eventData.inputIndex === deviceEnums/* PointerInput.MouseWheelZ */.Fz.MouseWheelZ) && this._onPointerMove(eventData));}) : deviceSource.deviceType === deviceEnums/* DeviceType.Touch */.Yi.Touch ? deviceSource.onInputChangedObservable.add((eventData) => {eventData.inputIndex === deviceEnums/* PointerInput.LeftClick */.Fz.LeftClick && (attachDown && 1 === deviceSource.getInput(eventData.inputIndex) ? (this._onPointerDown(eventData), 1 < this._totalPointersPressed && (this._isMultiTouchGesture = !0)) : attachUp && 0 === deviceSource.getInput(eventData.inputIndex) && (this._onPointerUp(eventData), 0 === this._totalPointersPressed && (this._isMultiTouchGesture = !1))), attachMove && eventData.inputIndex === deviceEnums/* PointerInput.Move */.Fz.Move && this._onPointerMove(eventData);}) : deviceSource.deviceType === deviceEnums/* DeviceType.Keyboard */.Yi.Keyboard && deviceSource.onInputChangedObservable.add((eventData) => {"keydown" === eventData.type ? this._onKeyDown(eventData) : "keyup" === eventData.type && this._onKeyUp(eventData);});}), this._alreadyAttached = !0;}detachControl() {this._alreadyAttached && (this._deviceSourceManager.dispose(), this._deviceSourceManager = null, this._alreadyAttachedTo && !this._scene.doNotHandleCursors && (this._alreadyAttachedTo.style.cursor = this._scene.defaultCursor), this._alreadyAttached = !1, this._alreadyAttachedTo = null);}setPointerOverMesh(mesh, pointerId = 0, pickResult, evt) {if (this._meshUnderPointerId[pointerId] === mesh && (!mesh || !mesh._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting)) return;const underPointerMesh = this._meshUnderPointerId[pointerId];let actionManager;underPointerMesh && (actionManager = underPointerMesh._getActionManagerForTrigger(10), actionManager && actionManager.processTrigger(10, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(underPointerMesh, evt, { pointerId }))), mesh ? (this._meshUnderPointerId[pointerId] = mesh, this._pointerOverMesh = mesh, actionManager = mesh._getActionManagerForTrigger(9), actionManager && actionManager.processTrigger(9, actionEvent/* ActionEvent.CreateNew */.V.CreateNew(mesh, evt, { pointerId, pickResult }))) : (delete this._meshUnderPointerId[pointerId], this._pointerOverMesh = null);}getPointerOverMesh() {return this.meshUnderPointer;}_invalidateMesh(mesh) {for (const pointerId in this._pointerOverMesh === mesh && (this._pointerOverMesh = null), this._pickedDownMesh === mesh && (this._pickedDownMesh = null), this._pickedUpMesh === mesh && (this._pickedUpMesh = null), this._meshUnderPointerId) this._meshUnderPointerId[pointerId] === mesh && delete this._meshUnderPointerId[pointerId];}}InputManager.DragMovementThreshold = 10, InputManager.LongPressDelay = 500, InputManager.DoubleClickDelay = 300, InputManager.ExclusiveDoubleClickMode = !1;
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/perfCounter.js
var perfCounter = __webpack_require__("./node_modules/@babylonjs/core/Misc/perfCounter.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.color.js
var math_color = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.color.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.frustum.js
var math_frustum = __webpack_require__("./node_modules/@babylonjs/core/Maths/math.frustum.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/uniqueIdGenerator.js
var uniqueIdGenerator = __webpack_require__("./node_modules/@babylonjs/core/Misc/uniqueIdGenerator.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/fileTools.js
var fileTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/fileTools.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/lightConstants.js
var lightConstants = __webpack_require__("./node_modules/@babylonjs/core/Lights/lightConstants.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/arrayTools.js
var arrayTools = __webpack_require__("./node_modules/@babylonjs/core/Misc/arrayTools.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/core/scene.js
var ScenePerformancePriority;(function (ScenePerformancePriority) {ScenePerformancePriority[ScenePerformancePriority.BackwardCompatible = 0] = "BackwardCompatible", ScenePerformancePriority[ScenePerformancePriority.Intermediate = 1] = "Intermediate", ScenePerformancePriority[ScenePerformancePriority.Aggressive = 2] = "Aggressive";})(ScenePerformancePriority || (ScenePerformancePriority = {}));class Scene extends abstractScene/* AbstractScene */.p {static DefaultMaterialFactory() {throw (0,devTools/* _WarnImport */.S)("StandardMaterial");}static CollisionCoordinatorFactory() {throw (0,devTools/* _WarnImport */.S)("DefaultCollisionCoordinator");}get environmentTexture() {return this._environmentTexture;}set environmentTexture(value) {this._environmentTexture === value || (this._environmentTexture = value, this.markAllMaterialsAsDirty(1));}get imageProcessingConfiguration() {return this._imageProcessingConfiguration;}get performancePriority() {return this._performancePriority;}set performancePriority(value) {value !== this._performancePriority && (this._performancePriority = value, value === ScenePerformancePriority.BackwardCompatible ? (this.skipFrustumClipping = !1, this._renderingManager.maintainStateBetweenFrames = !1, this.skipPointerMovePicking = !1, this.autoClear = !0) : value === ScenePerformancePriority.Intermediate ? (this.skipFrustumClipping = !1, this._renderingManager.maintainStateBetweenFrames = !1, this.skipPointerMovePicking = !0, this.autoClear = !1) : value === ScenePerformancePriority.Aggressive ? (this.skipFrustumClipping = !0, this._renderingManager.maintainStateBetweenFrames = !0, this.skipPointerMovePicking = !0, this.autoClear = !1) : void 0);}set forceWireframe(value) {this._forceWireframe === value || (this._forceWireframe = value, this.markAllMaterialsAsDirty(16));}get forceWireframe() {return this._forceWireframe;}set skipFrustumClipping(value) {this._skipFrustumClipping === value || (this._skipFrustumClipping = value);}get skipFrustumClipping() {return this._skipFrustumClipping;}set forcePointsCloud(value) {this._forcePointsCloud === value || (this._forcePointsCloud = value, this.markAllMaterialsAsDirty(16));}get forcePointsCloud() {return this._forcePointsCloud;}get animationPropertiesOverride() {return this._animationPropertiesOverride;}set animationPropertiesOverride(value) {this._animationPropertiesOverride = value;}set onDispose(callback) {this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(callback);}set beforeRender(callback) {this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), callback && (this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback));}set afterRender(callback) {this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), callback && (this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback));}set beforeCameraRender(callback) {this._onBeforeCameraRenderObserver && this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = this.onBeforeCameraRenderObservable.add(callback);}set afterCameraRender(callback) {this._onAfterCameraRenderObserver && this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = this.onAfterCameraRenderObservable.add(callback);}get unTranslatedPointer() {return this._inputManager.unTranslatedPointer;}static get DragMovementThreshold() {return InputManager.DragMovementThreshold;}static set DragMovementThreshold(value) {InputManager.DragMovementThreshold = value;}static get LongPressDelay() {return InputManager.LongPressDelay;}static set LongPressDelay(value) {InputManager.LongPressDelay = value;}static get DoubleClickDelay() {return InputManager.DoubleClickDelay;}static set DoubleClickDelay(value) {InputManager.DoubleClickDelay = value;}static get ExclusiveDoubleClickMode() {return InputManager.ExclusiveDoubleClickMode;}static set ExclusiveDoubleClickMode(value) {InputManager.ExclusiveDoubleClickMode = value;}bindEyePosition(effect, variableName = "vEyePosition", isVector3 = !1) {var _a;const eyePosition = this._forcedViewPosition ? this._forcedViewPosition : this._mirroredCameraPosition ? this._mirroredCameraPosition : null !== (_a = this.activeCamera.globalPosition) && void 0 !== _a ? _a : this.activeCamera.devicePosition,invertNormal = this.useRightHandedSystem === (null != this._mirroredCameraPosition);return math_vector/* TmpVectors.Vector4.0.set */.jp.Vector4[0].set(eyePosition.x, eyePosition.y, eyePosition.z, invertNormal ? -1 : 1), effect && (isVector3 ? effect.setFloat3(variableName, math_vector/* TmpVectors.Vector4.0.x */.jp.Vector4[0].x, math_vector/* TmpVectors.Vector4.0.y */.jp.Vector4[0].y, math_vector/* TmpVectors.Vector4.0.z */.jp.Vector4[0].z) : effect.setVector4(variableName, math_vector/* TmpVectors.Vector4.0 */.jp.Vector4[0])), math_vector/* TmpVectors.Vector4.0 */.jp.Vector4[0];}finalizeSceneUbo() {const ubo = this.getSceneUniformBuffer(),eyePosition = this.bindEyePosition(null);return ubo.updateFloat4("vEyePosition", eyePosition.x, eyePosition.y, eyePosition.z, eyePosition.w), ubo.update(), ubo;}set useRightHandedSystem(value) {this._useRightHandedSystem === value || (this._useRightHandedSystem = value, this.markAllMaterialsAsDirty(16));}get useRightHandedSystem() {return this._useRightHandedSystem;}setStepId(newStepId) {this._currentStepId = newStepId;}getStepId() {return this._currentStepId;}getInternalStep() {return this._currentInternalStep;}set fogEnabled(value) {this._fogEnabled === value || (this._fogEnabled = value, this.markAllMaterialsAsDirty(16));}get fogEnabled() {return this._fogEnabled;}set fogMode(value) {this._fogMode === value || (this._fogMode = value, this.markAllMaterialsAsDirty(16));}get fogMode() {return this._fogMode;}get prePass() {return !!this.prePassRenderer && this.prePassRenderer.defaultRT.enabled;}set shadowsEnabled(value) {this._shadowsEnabled === value || (this._shadowsEnabled = value, this.markAllMaterialsAsDirty(2));}get shadowsEnabled() {return this._shadowsEnabled;}set lightsEnabled(value) {this._lightsEnabled === value || (this._lightsEnabled = value, this.markAllMaterialsAsDirty(2));}get lightsEnabled() {return this._lightsEnabled;}get activeCameras() {return this._activeCameras;}set activeCameras(cameras) {this._unObserveActiveCameras && (this._unObserveActiveCameras(), this._unObserveActiveCameras = null), cameras && (this._unObserveActiveCameras = (0,arrayTools/* _ObserveArray */.M)(cameras, () => {this.onActiveCamerasChanged.notifyObservers(this);})), this._activeCameras = cameras;}get activeCamera() {return this._activeCamera;}set activeCamera(value) {value === this._activeCamera || (this._activeCamera = value, this.onActiveCameraChanged.notifyObservers(this));}get defaultMaterial() {return this._defaultMaterial || (this._defaultMaterial = Scene.DefaultMaterialFactory(this)), this._defaultMaterial;}set defaultMaterial(value) {this._defaultMaterial = value;}set texturesEnabled(value) {this._texturesEnabled === value || (this._texturesEnabled = value, this.markAllMaterialsAsDirty(1));}get texturesEnabled() {return this._texturesEnabled;}set skeletonsEnabled(value) {this._skeletonsEnabled === value || (this._skeletonsEnabled = value, this.markAllMaterialsAsDirty(8));}get skeletonsEnabled() {return this._skeletonsEnabled;}get collisionCoordinator() {return this._collisionCoordinator || (this._collisionCoordinator = Scene.CollisionCoordinatorFactory(), this._collisionCoordinator.init(this)), this._collisionCoordinator;}get renderingManager() {return this._renderingManager;}get frustumPlanes() {return this._frustumPlanes;}_registerTransientComponents() {if (0 < this._transientComponents.length) {for (const component of this._transientComponents) component.register();this._transientComponents.length = 0;}}_addComponent(component) {this._components.push(component), this._transientComponents.push(component);const serializableComponent = component;serializableComponent.addFromContainer && serializableComponent.serialize && this._serializableComponents.push(serializableComponent);}_getComponent(name) {for (const component of this._components) if (component.name === name) return component;return null;}constructor(engine, options) {super(), this._inputManager = new InputManager(this), this.cameraToUseForPointers = null, this._isScene = !0, this._blockEntityCollection = !1, this.autoClear = !0, this.autoClearDepthAndStencil = !0, this.clearColor = new math_color/* Color4 */.HE(.2, .2, .3, 1), this.ambientColor = new math_color/* Color3 */.Wo(0, 0, 0), this.environmentIntensity = 1, this._performancePriority = ScenePerformancePriority.BackwardCompatible, this._forceWireframe = !1, this._skipFrustumClipping = !1, this._forcePointsCloud = !1, this.animationsEnabled = !0, this._animationPropertiesOverride = null, this.useConstantAnimationDeltaTime = !1, this.constantlyUpdateMeshUnderPointer = !1, this.hoverCursor = "pointer", this.defaultCursor = "", this.doNotHandleCursors = !1, this.preventDefaultOnPointerDown = !0, this.preventDefaultOnPointerUp = !0, this.metadata = null, this.reservedDataStore = null, this.disableOfflineSupportExceptionRules = [], this.onDisposeObservable = new observable/* Observable */.y$(), this._onDisposeObserver = null, this.onBeforeRenderObservable = new observable/* Observable */.y$(), this._onBeforeRenderObserver = null, this.onAfterRenderObservable = new observable/* Observable */.y$(), this.onAfterRenderCameraObservable = new observable/* Observable */.y$(), this._onAfterRenderObserver = null, this.onBeforeAnimationsObservable = new observable/* Observable */.y$(), this.onAfterAnimationsObservable = new observable/* Observable */.y$(), this.onBeforeDrawPhaseObservable = new observable/* Observable */.y$(), this.onAfterDrawPhaseObservable = new observable/* Observable */.y$(), this.onReadyObservable = new observable/* Observable */.y$(), this.onBeforeCameraRenderObservable = new observable/* Observable */.y$(), this._onBeforeCameraRenderObserver = null, this.onAfterCameraRenderObservable = new observable/* Observable */.y$(), this._onAfterCameraRenderObserver = null, this.onBeforeActiveMeshesEvaluationObservable = new observable/* Observable */.y$(), this.onAfterActiveMeshesEvaluationObservable = new observable/* Observable */.y$(), this.onBeforeParticlesRenderingObservable = new observable/* Observable */.y$(), this.onAfterParticlesRenderingObservable = new observable/* Observable */.y$(), this.onDataLoadedObservable = new observable/* Observable */.y$(), this.onNewCameraAddedObservable = new observable/* Observable */.y$(), this.onCameraRemovedObservable = new observable/* Observable */.y$(), this.onNewLightAddedObservable = new observable/* Observable */.y$(), this.onLightRemovedObservable = new observable/* Observable */.y$(), this.onNewGeometryAddedObservable = new observable/* Observable */.y$(), this.onGeometryRemovedObservable = new observable/* Observable */.y$(), this.onNewTransformNodeAddedObservable = new observable/* Observable */.y$(), this.onTransformNodeRemovedObservable = new observable/* Observable */.y$(), this.onNewMeshAddedObservable = new observable/* Observable */.y$(), this.onMeshRemovedObservable = new observable/* Observable */.y$(), this.onNewSkeletonAddedObservable = new observable/* Observable */.y$(), this.onSkeletonRemovedObservable = new observable/* Observable */.y$(), this.onNewMaterialAddedObservable = new observable/* Observable */.y$(), this.onNewMultiMaterialAddedObservable = new observable/* Observable */.y$(), this.onMaterialRemovedObservable = new observable/* Observable */.y$(), this.onMultiMaterialRemovedObservable = new observable/* Observable */.y$(), this.onNewTextureAddedObservable = new observable/* Observable */.y$(), this.onTextureRemovedObservable = new observable/* Observable */.y$(), this.onBeforeRenderTargetsRenderObservable = new observable/* Observable */.y$(), this.onAfterRenderTargetsRenderObservable = new observable/* Observable */.y$(), this.onBeforeStepObservable = new observable/* Observable */.y$(), this.onAfterStepObservable = new observable/* Observable */.y$(), this.onActiveCameraChanged = new observable/* Observable */.y$(), this.onActiveCamerasChanged = new observable/* Observable */.y$(), this.onBeforeRenderingGroupObservable = new observable/* Observable */.y$(), this.onAfterRenderingGroupObservable = new observable/* Observable */.y$(), this.onMeshImportedObservable = new observable/* Observable */.y$(), this.onAnimationFileImportedObservable = new observable/* Observable */.y$(), this._registeredForLateAnimationBindings = new smartArray/* SmartArrayNoDuplicate */.f(256), this.skipPointerMovePicking = !1, this.skipPointerDownPicking = !1, this.skipPointerUpPicking = !1, this.onPrePointerObservable = new observable/* Observable */.y$(), this.onPointerObservable = new observable/* Observable */.y$(), this.onPreKeyboardObservable = new observable/* Observable */.y$(), this.onKeyboardObservable = new observable/* Observable */.y$(), this._useRightHandedSystem = !1, this._timeAccumulator = 0, this._currentStepId = 0, this._currentInternalStep = 0, this._fogEnabled = !0, this._fogMode = Scene.FOGMODE_NONE, this.fogColor = new math_color/* Color3 */.Wo(.2, .2, .3), this.fogDensity = .1, this.fogStart = 0, this.fogEnd = 1e3, this.needsPreviousWorldMatrices = !1, this._shadowsEnabled = !0, this._lightsEnabled = !0, this._unObserveActiveCameras = null, this._texturesEnabled = !0, this.physicsEnabled = !0, this.particlesEnabled = !0, this.spritesEnabled = !0, this._skeletonsEnabled = !0, this.lensFlaresEnabled = !0, this.collisionsEnabled = !0, this.gravity = new math_vector/* Vector3 */.P(0, -9.807, 0), this.postProcessesEnabled = !0, this.renderTargetsEnabled = !0, this.dumpNextRenderTargets = !1, this.customRenderTargets = [], this.importedMeshesFiles = [], this.probesEnabled = !0, this._meshesForIntersections = new smartArray/* SmartArrayNoDuplicate */.f(256), this.proceduralTexturesEnabled = !0, this._totalVertices = new perfCounter/* PerfCounter */.z(), this._activeIndices = new perfCounter/* PerfCounter */.z(), this._activeParticles = new perfCounter/* PerfCounter */.z(), this._activeBones = new perfCounter/* PerfCounter */.z(), this._animationTime = 0, this.animationTimeScale = 1, this._renderId = 0, this._frameId = 0, this._executeWhenReadyTimeoutId = null, this._intermediateRendering = !1, this._defaultFrameBufferCleared = !1, this._viewUpdateFlag = -1, this._projectionUpdateFlag = -1, this._toBeDisposed = Array(256), this._activeRequests = [], this._pendingData = [], this._isDisposed = !1, this.dispatchAllSubMeshesOfActiveMeshes = !1, this._activeMeshes = new smartArray/* SmartArray */.t(256), this._processedMaterials = new smartArray/* SmartArray */.t(256), this._renderTargets = new smartArray/* SmartArrayNoDuplicate */.f(256), this._materialsRenderTargets = new smartArray/* SmartArrayNoDuplicate */.f(256), this._activeParticleSystems = new smartArray/* SmartArray */.t(256), this._activeSkeletons = new smartArray/* SmartArrayNoDuplicate */.f(32), this._softwareSkinnedMeshes = new smartArray/* SmartArrayNoDuplicate */.f(32), this._activeAnimatables = [], this._transformMatrix = math_vector/* Matrix.Zero */.y3.Zero(), this.requireLightSorting = !1, this._components = [], this._serializableComponents = [], this._transientComponents = [], this._beforeCameraUpdateStage = sceneComponent/* Stage.Create */.H.Create(), this._beforeClearStage = sceneComponent/* Stage.Create */.H.Create(), this._beforeRenderTargetClearStage = sceneComponent/* Stage.Create */.H.Create(), this._gatherRenderTargetsStage = sceneComponent/* Stage.Create */.H.Create(), this._gatherActiveCameraRenderTargetsStage = sceneComponent/* Stage.Create */.H.Create(), this._isReadyForMeshStage = sceneComponent/* Stage.Create */.H.Create(), this._beforeEvaluateActiveMeshStage = sceneComponent/* Stage.Create */.H.Create(), this._evaluateSubMeshStage = sceneComponent/* Stage.Create */.H.Create(), this._preActiveMeshStage = sceneComponent/* Stage.Create */.H.Create(), this._cameraDrawRenderTargetStage = sceneComponent/* Stage.Create */.H.Create(), this._beforeCameraDrawStage = sceneComponent/* Stage.Create */.H.Create(), this._beforeRenderTargetDrawStage = sceneComponent/* Stage.Create */.H.Create(), this._beforeRenderingGroupDrawStage = sceneComponent/* Stage.Create */.H.Create(), this._beforeRenderingMeshStage = sceneComponent/* Stage.Create */.H.Create(), this._afterRenderingMeshStage = sceneComponent/* Stage.Create */.H.Create(), this._afterRenderingGroupDrawStage = sceneComponent/* Stage.Create */.H.Create(), this._afterCameraDrawStage = sceneComponent/* Stage.Create */.H.Create(), this._afterCameraPostProcessStage = sceneComponent/* Stage.Create */.H.Create(), this._afterRenderTargetDrawStage = sceneComponent/* Stage.Create */.H.Create(), this._afterRenderTargetPostProcessStage = sceneComponent/* Stage.Create */.H.Create(), this._afterRenderStage = sceneComponent/* Stage.Create */.H.Create(), this._pointerMoveStage = sceneComponent/* Stage.Create */.H.Create(), this._pointerDownStage = sceneComponent/* Stage.Create */.H.Create(), this._pointerUpStage = sceneComponent/* Stage.Create */.H.Create(), this._geometriesByUniqueId = null, this._defaultMeshCandidates = { data: [], length: 0 }, this._defaultSubMeshCandidates = { data: [], length: 0 }, this._preventFreeActiveMeshesAndRenderingGroups = !1, this._activeMeshesFrozen = !1, this._activeMeshesFrozenButKeepClipping = !1, this._skipEvaluateActiveMeshesCompletely = !1, this._allowPostProcessClearColor = !0, this.getDeterministicFrameTime = () => this._engine.getTimeStep(), this._registeredActions = 0, this._blockMaterialDirtyMechanism = !1, this._perfCollector = null, this.activeCameras = [];const fullOptions = { useGeometryUniqueIdsMap: !0, useMaterialMeshMap: !0, useClonedMeshMap: !0, virtual: !1, ...options };this._engine = engine || engineStore/* EngineStore.LastCreatedEngine */.l.LastCreatedEngine, fullOptions.virtual ? this._engine._virtualScenes.push(this) : (engineStore/* EngineStore._LastCreatedScene */.l._LastCreatedScene = this, this._engine.scenes.push(this)), this._uid = null, this._renderingManager = new renderingManager/* RenderingManager */.$(this), postProcessManager/* PostProcessManager */.O && (this.postProcessManager = new postProcessManager/* PostProcessManager */.O(this)), (0,domManagement/* IsWindowObjectExist */.CG)() && this.attachControl(), this._createUbo(), imageProcessingConfiguration/* ImageProcessingConfiguration */.$ && (this._imageProcessingConfiguration = new imageProcessingConfiguration/* ImageProcessingConfiguration */.$()), this.setDefaultCandidateProviders(), fullOptions.useGeometryUniqueIdsMap && (this._geometriesByUniqueId = {}), this.useMaterialMeshMap = fullOptions.useMaterialMeshMap, this.useClonedMeshMap = fullOptions.useClonedMeshMap, options && options.virtual || this._engine.onNewSceneAddedObservable.notifyObservers(this);}getClassName() {return "Scene";}_getDefaultMeshCandidates() {return this._defaultMeshCandidates.data = this.meshes, this._defaultMeshCandidates.length = this.meshes.length, this._defaultMeshCandidates;}_getDefaultSubMeshCandidates(mesh) {return this._defaultSubMeshCandidates.data = mesh.subMeshes, this._defaultSubMeshCandidates.length = mesh.subMeshes.length, this._defaultSubMeshCandidates;}setDefaultCandidateProviders() {this.getActiveMeshCandidates = this._getDefaultMeshCandidates.bind(this), this.getActiveSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getIntersectingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getCollidingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this);}get meshUnderPointer() {return this._inputManager.meshUnderPointer;}get pointerX() {return this._inputManager.pointerX;}set pointerX(value) {this._inputManager.pointerX = value;}get pointerY() {return this._inputManager.pointerY;}set pointerY(value) {this._inputManager.pointerY = value;}getCachedMaterial() {return this._cachedMaterial;}getCachedEffect() {return this._cachedEffect;}getCachedVisibility() {return this._cachedVisibility;}isCachedMaterialInvalid(material, effect, visibility = 1) {return this._cachedEffect !== effect || this._cachedMaterial !== material || this._cachedVisibility !== visibility;}getEngine() {return this._engine;}getTotalVertices() {return this._totalVertices.current;}get totalVerticesPerfCounter() {return this._totalVertices;}getActiveIndices() {return this._activeIndices.current;}get totalActiveIndicesPerfCounter() {return this._activeIndices;}getActiveParticles() {return this._activeParticles.current;}get activeParticlesPerfCounter() {return this._activeParticles;}getActiveBones() {return this._activeBones.current;}get activeBonesPerfCounter() {return this._activeBones;}getActiveMeshes() {return this._activeMeshes;}getAnimationRatio() {return this._animationRatio === void 0 ? 1 : this._animationRatio;}getRenderId() {return this._renderId;}getFrameId() {return this._frameId;}incrementRenderId() {this._renderId++;}_createUbo() {this.setSceneUniformBuffer(this.createSceneUniformBuffer());}simulatePointerMove(pickResult, pointerEventInit) {return this._inputManager.simulatePointerMove(pickResult, pointerEventInit), this;}simulatePointerDown(pickResult, pointerEventInit) {return this._inputManager.simulatePointerDown(pickResult, pointerEventInit), this;}simulatePointerUp(pickResult, pointerEventInit, doubleTap) {return this._inputManager.simulatePointerUp(pickResult, pointerEventInit, doubleTap), this;}isPointerCaptured(pointerId = 0) {return this._inputManager.isPointerCaptured(pointerId);}attachControl(attachUp = !0, attachDown = !0, attachMove = !0) {this._inputManager.attachControl(attachUp, attachDown, attachMove);}detachControl() {this._inputManager.detachControl();}isReady(checkRenderTargets = !0) {if (this._isDisposed) return !1;let index;const engine = this.getEngine();let isReady = !0;for (0 < this._pendingData.length && (isReady = !1), checkRenderTargets && (this._processedMaterials.reset(), this._materialsRenderTargets.reset()), index = 0; index < this.meshes.length; index++) {const mesh = this.meshes[index];if (!mesh.subMeshes || 0 === mesh.subMeshes.length) continue;if (!mesh.isReady(!0)) {isReady = !1;continue;}const hardwareInstancedRendering = mesh.hasThinInstances || "InstancedMesh" === mesh.getClassName() || "InstancedLinesMesh" === mesh.getClassName() || engine.getCaps().instancedArrays && 0 < mesh.instances.length;for (const step of this._isReadyForMeshStage) step.action(mesh, hardwareInstancedRendering) || (isReady = !1);if (!checkRenderTargets) continue;const mat = mesh.material || this.defaultMaterial;if (mat) if (mat._storeEffectOnSubMeshes) for (const subMesh of mesh.subMeshes) {const material = subMesh.getMaterial();material && material.hasRenderTargetTextures && null != material.getRenderTargetTextures && -1 === this._processedMaterials.indexOf(material) && (this._processedMaterials.push(material), this._materialsRenderTargets.concatWithNoDuplicate(material.getRenderTargetTextures()));} else mat.hasRenderTargetTextures && null != mat.getRenderTargetTextures && -1 === this._processedMaterials.indexOf(mat) && (this._processedMaterials.push(mat), this._materialsRenderTargets.concatWithNoDuplicate(mat.getRenderTargetTextures()));}if (!isReady) return !1;if (!engine.areAllEffectsReady()) return !1;if (checkRenderTargets) for (index = 0; index < this._materialsRenderTargets.length; ++index) {const rtt = this._materialsRenderTargets.data[index];if (!rtt.isReadyForRendering()) return !1;}for (index = 0; index < this.geometries.length; index++) {const geometry = this.geometries[index];if (2 === geometry.delayLoadState) return !1;}if (this.activeCameras && 0 < this.activeCameras.length) {for (const camera of this.activeCameras) if (!camera.isReady(!0)) return !1;} else if (this.activeCamera && !this.activeCamera.isReady(!0)) return !1;for (const particleSystem of this.particleSystems) if (!particleSystem.isReady()) return !1;return !0;}resetCachedMaterial() {this._cachedMaterial = null, this._cachedEffect = null, this._cachedVisibility = null;}registerBeforeRender(func) {this.onBeforeRenderObservable.add(func);}unregisterBeforeRender(func) {this.onBeforeRenderObservable.removeCallback(func);}registerAfterRender(func) {this.onAfterRenderObservable.add(func);}unregisterAfterRender(func) {this.onAfterRenderObservable.removeCallback(func);}_executeOnceBeforeRender(func) {const execFunc = () => {func(), setTimeout(() => {this.unregisterBeforeRender(execFunc);});};this.registerBeforeRender(execFunc);}executeOnceBeforeRender(func, timeout) {timeout === void 0 ? this._executeOnceBeforeRender(func) : setTimeout(() => {this._executeOnceBeforeRender(func);}, timeout);}addPendingData(data) {this._pendingData.push(data);}removePendingData(data) {const wasLoading = this.isLoading,index = this._pendingData.indexOf(data);-1 !== index && this._pendingData.splice(index, 1), wasLoading && !this.isLoading && this.onDataLoadedObservable.notifyObservers(this);}getWaitingItemsCount() {return this._pendingData.length;}get isLoading() {return 0 < this._pendingData.length;}executeWhenReady(func, checkRenderTargets = !1) {this.onReadyObservable.addOnce(func);null !== this._executeWhenReadyTimeoutId || this._checkIsReady(checkRenderTargets);}whenReadyAsync(checkRenderTargets = !1) {return new Promise((resolve) => {this.executeWhenReady(() => {resolve();}, checkRenderTargets);});}_checkIsReady(checkRenderTargets = !1) {return this._registerTransientComponents(), this.isReady(checkRenderTargets) ? (this.onReadyObservable.notifyObservers(this), this.onReadyObservable.clear(), void (this._executeWhenReadyTimeoutId = null)) : this._isDisposed ? (this.onReadyObservable.clear(), void (this._executeWhenReadyTimeoutId = null)) : void (this._executeWhenReadyTimeoutId = setTimeout(() => {this.incrementRenderId(), this._checkIsReady(checkRenderTargets);}, 100));}get animatables() {return this._activeAnimatables;}resetLastAnimationTimeFrame() {this._animationTimeLast = precisionDate/* PrecisionDate.Now */.F.Now;}getViewMatrix() {return this._viewMatrix;}getProjectionMatrix() {return this._projectionMatrix;}getTransformMatrix() {return this._transformMatrix;}setTransformMatrix(viewL, projectionL, viewR, projectionR) {viewR || projectionR || !this._multiviewSceneUbo || (this._multiviewSceneUbo.dispose(), this._multiviewSceneUbo = null);this._viewUpdateFlag === viewL.updateFlag && this._projectionUpdateFlag === projectionL.updateFlag || (this._viewUpdateFlag = viewL.updateFlag, this._projectionUpdateFlag = projectionL.updateFlag, this._viewMatrix = viewL, this._projectionMatrix = projectionL, this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._frustumPlanes ? math_frustum/* Frustum.GetPlanesToRef */.i.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = math_frustum/* Frustum.GetPlanes */.i.GetPlanes(this._transformMatrix), this._multiviewSceneUbo && this._multiviewSceneUbo.useUbo ? this._updateMultiviewUbo(viewR, projectionR) : this._sceneUbo.useUbo && (this._sceneUbo.updateMatrix("viewProjection", this._transformMatrix), this._sceneUbo.updateMatrix("view", this._viewMatrix), this._sceneUbo.updateMatrix("projection", this._projectionMatrix)));}getSceneUniformBuffer() {return this._multiviewSceneUbo ? this._multiviewSceneUbo : this._sceneUbo;}createSceneUniformBuffer(name) {const sceneUbo = new uniformBuffer/* UniformBuffer */.M(this._engine, void 0, !1, null !== name && void 0 !== name ? name : "scene");return sceneUbo.addUniform("viewProjection", 16), sceneUbo.addUniform("view", 16), sceneUbo.addUniform("projection", 16), sceneUbo.addUniform("vEyePosition", 4), sceneUbo;}setSceneUniformBuffer(ubo) {this._sceneUbo = ubo, this._viewUpdateFlag = -1, this._projectionUpdateFlag = -1;}getUniqueId() {return uniqueIdGenerator/* UniqueIdGenerator.UniqueId */.K.UniqueId;}addMesh(newMesh, recursive = !1) {this._blockEntityCollection || (this.meshes.push(newMesh), newMesh._resyncLightSources(), !newMesh.parent && newMesh._addToSceneRootNodes(), this.onNewMeshAddedObservable.notifyObservers(newMesh), recursive && newMesh.getChildMeshes().forEach((m) => {this.addMesh(m);}));}removeMesh(toRemove, recursive = !1) {const index = this.meshes.indexOf(toRemove);return -1 !== index && (this.meshes[index] = this.meshes[this.meshes.length - 1], this.meshes.pop(), !toRemove.parent && toRemove._removeFromSceneRootNodes()), this._inputManager._invalidateMesh(toRemove), this.onMeshRemovedObservable.notifyObservers(toRemove), recursive && toRemove.getChildMeshes().forEach((m) => {this.removeMesh(m);}), index;}addTransformNode(newTransformNode) {this._blockEntityCollection || newTransformNode.getScene() === this && -1 !== newTransformNode._indexInSceneTransformNodesArray || (newTransformNode._indexInSceneTransformNodesArray = this.transformNodes.length, this.transformNodes.push(newTransformNode), !newTransformNode.parent && newTransformNode._addToSceneRootNodes(), this.onNewTransformNodeAddedObservable.notifyObservers(newTransformNode));}removeTransformNode(toRemove) {const index = toRemove._indexInSceneTransformNodesArray;if (-1 !== index) {if (index !== this.transformNodes.length - 1) {const lastNode = this.transformNodes[this.transformNodes.length - 1];this.transformNodes[index] = lastNode, lastNode._indexInSceneTransformNodesArray = index;}toRemove._indexInSceneTransformNodesArray = -1, this.transformNodes.pop(), toRemove.parent || toRemove._removeFromSceneRootNodes();}return this.onTransformNodeRemovedObservable.notifyObservers(toRemove), index;}removeSkeleton(toRemove) {const index = this.skeletons.indexOf(toRemove);return -1 !== index && (this.skeletons.splice(index, 1), this.onSkeletonRemovedObservable.notifyObservers(toRemove), this._executeActiveContainerCleanup(this._activeSkeletons)), index;}removeMorphTargetManager(toRemove) {const index = this.morphTargetManagers.indexOf(toRemove);return -1 !== index && this.morphTargetManagers.splice(index, 1), index;}removeLight(toRemove) {const index = this.lights.indexOf(toRemove);if (-1 !== index) {for (const mesh of this.meshes) mesh._removeLightSource(toRemove, !1);this.lights.splice(index, 1), this.sortLightsByPriority(), toRemove.parent || toRemove._removeFromSceneRootNodes();}return this.onLightRemovedObservable.notifyObservers(toRemove), index;}removeCamera(toRemove) {const index = this.cameras.indexOf(toRemove);if (-1 !== index && (this.cameras.splice(index, 1), !toRemove.parent && toRemove._removeFromSceneRootNodes()), this.activeCameras) {const index2 = this.activeCameras.indexOf(toRemove);-1 !== index2 && this.activeCameras.splice(index2, 1);}return this.activeCamera === toRemove && (0 < this.cameras.length ? this.activeCamera = this.cameras[0] : this.activeCamera = null), this.onCameraRemovedObservable.notifyObservers(toRemove), index;}removeParticleSystem(toRemove) {const index = this.particleSystems.indexOf(toRemove);return -1 !== index && (this.particleSystems.splice(index, 1), this._executeActiveContainerCleanup(this._activeParticleSystems)), index;}removeAnimation(toRemove) {const index = this.animations.indexOf(toRemove);return -1 !== index && this.animations.splice(index, 1), index;}stopAnimation() {}removeAnimationGroup(toRemove) {const index = this.animationGroups.indexOf(toRemove);return -1 !== index && this.animationGroups.splice(index, 1), index;}removeMultiMaterial(toRemove) {const index = this.multiMaterials.indexOf(toRemove);return -1 !== index && this.multiMaterials.splice(index, 1), this.onMultiMaterialRemovedObservable.notifyObservers(toRemove), index;}removeMaterial(toRemove) {const index = toRemove._indexInSceneMaterialArray;if (-1 !== index && index < this.materials.length) {if (index !== this.materials.length - 1) {const lastMaterial = this.materials[this.materials.length - 1];this.materials[index] = lastMaterial, lastMaterial._indexInSceneMaterialArray = index;}toRemove._indexInSceneMaterialArray = -1, this.materials.pop();}return this.onMaterialRemovedObservable.notifyObservers(toRemove), index;}removeActionManager(toRemove) {const index = this.actionManagers.indexOf(toRemove);return -1 !== index && this.actionManagers.splice(index, 1), index;}removeTexture(toRemove) {const index = this.textures.indexOf(toRemove);return -1 !== index && this.textures.splice(index, 1), this.onTextureRemovedObservable.notifyObservers(toRemove), index;}addLight(newLight) {if (!this._blockEntityCollection) {this.lights.push(newLight), this.sortLightsByPriority(), newLight.parent || newLight._addToSceneRootNodes();for (const mesh of this.meshes) -1 === mesh.lightSources.indexOf(newLight) && (mesh.lightSources.push(newLight), mesh._resyncLightSources());this.onNewLightAddedObservable.notifyObservers(newLight);}}sortLightsByPriority() {this.requireLightSorting && this.lights.sort(lightConstants/* LightConstants.CompareLightsPriority */.m.CompareLightsPriority);}addCamera(newCamera) {this._blockEntityCollection || (this.cameras.push(newCamera), this.onNewCameraAddedObservable.notifyObservers(newCamera), !newCamera.parent && newCamera._addToSceneRootNodes());}addSkeleton(newSkeleton) {this._blockEntityCollection || (this.skeletons.push(newSkeleton), this.onNewSkeletonAddedObservable.notifyObservers(newSkeleton));}addParticleSystem(newParticleSystem) {this._blockEntityCollection || this.particleSystems.push(newParticleSystem);}addAnimation(newAnimation) {this._blockEntityCollection || this.animations.push(newAnimation);}addAnimationGroup(newAnimationGroup) {this._blockEntityCollection || this.animationGroups.push(newAnimationGroup);}addMultiMaterial(newMultiMaterial) {this._blockEntityCollection || (this.multiMaterials.push(newMultiMaterial), this.onNewMultiMaterialAddedObservable.notifyObservers(newMultiMaterial));}addMaterial(newMaterial) {this._blockEntityCollection || newMaterial.getScene() === this && -1 !== newMaterial._indexInSceneMaterialArray || (newMaterial._indexInSceneMaterialArray = this.materials.length, this.materials.push(newMaterial), this.onNewMaterialAddedObservable.notifyObservers(newMaterial));}addMorphTargetManager(newMorphTargetManager) {this._blockEntityCollection || this.morphTargetManagers.push(newMorphTargetManager);}addGeometry(newGeometry) {this._blockEntityCollection || (this._geometriesByUniqueId && (this._geometriesByUniqueId[newGeometry.uniqueId] = this.geometries.length), this.geometries.push(newGeometry));}addActionManager(newActionManager) {this.actionManagers.push(newActionManager);}addTexture(newTexture) {this._blockEntityCollection || (this.textures.push(newTexture), this.onNewTextureAddedObservable.notifyObservers(newTexture));}switchActiveCamera(newCamera, attachControl = !0) {const canvas = this._engine.getInputElement();canvas && (this.activeCamera && this.activeCamera.detachControl(), this.activeCamera = newCamera, attachControl && newCamera.attachControl());}setActiveCameraById(id) {const camera = this.getCameraById(id);return camera ? (this.activeCamera = camera, camera) : null;}setActiveCameraByName(name) {const camera = this.getCameraByName(name);return camera ? (this.activeCamera = camera, camera) : null;}getAnimationGroupByName(name) {for (let index = 0; index < this.animationGroups.length; index++) if (this.animationGroups[index].name === name) return this.animationGroups[index];return null;}_getMaterial(allowMultiMaterials, predicate) {for (let index = 0; index < this.materials.length; index++) {const material = this.materials[index];if (predicate(material)) return material;}if (allowMultiMaterials) for (let index = 0; index < this.multiMaterials.length; index++) {const material = this.multiMaterials[index];if (predicate(material)) return material;}return null;}getMaterialByUniqueID(uniqueId, allowMultiMaterials = !1) {return this._getMaterial(allowMultiMaterials, (m) => m.uniqueId === uniqueId);}getMaterialById(id, allowMultiMaterials = !1) {return this._getMaterial(allowMultiMaterials, (m) => m.id === id);}getMaterialByName(name, allowMultiMaterials = !1) {return this._getMaterial(allowMultiMaterials, (m) => m.name === name);}getLastMaterialById(id, allowMultiMaterials = !1) {for (let index = this.materials.length - 1; 0 <= index; index--) if (this.materials[index].id === id) return this.materials[index];if (allowMultiMaterials) for (let index = this.multiMaterials.length - 1; 0 <= index; index--) if (this.multiMaterials[index].id === id) return this.multiMaterials[index];return null;}getTextureByUniqueId(uniqueId) {for (let index = 0; index < this.textures.length; index++) if (this.textures[index].uniqueId === uniqueId) return this.textures[index];return null;}getTextureByName(name) {for (let index = 0; index < this.textures.length; index++) if (this.textures[index].name === name) return this.textures[index];return null;}getCameraById(id) {for (let index = 0; index < this.cameras.length; index++) if (this.cameras[index].id === id) return this.cameras[index];return null;}getCameraByUniqueId(uniqueId) {for (let index = 0; index < this.cameras.length; index++) if (this.cameras[index].uniqueId === uniqueId) return this.cameras[index];return null;}getCameraByName(name) {for (let index = 0; index < this.cameras.length; index++) if (this.cameras[index].name === name) return this.cameras[index];return null;}getBoneById(id) {for (let skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) {const skeleton = this.skeletons[skeletonIndex];for (let boneIndex = 0; boneIndex < skeleton.bones.length; boneIndex++) if (skeleton.bones[boneIndex].id === id) return skeleton.bones[boneIndex];}return null;}getBoneByName(name) {for (let skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) {const skeleton = this.skeletons[skeletonIndex];for (let boneIndex = 0; boneIndex < skeleton.bones.length; boneIndex++) if (skeleton.bones[boneIndex].name === name) return skeleton.bones[boneIndex];}return null;}getLightByName(name) {for (let index = 0; index < this.lights.length; index++) if (this.lights[index].name === name) return this.lights[index];return null;}getLightById(id) {for (let index = 0; index < this.lights.length; index++) if (this.lights[index].id === id) return this.lights[index];return null;}getLightByUniqueId(uniqueId) {for (let index = 0; index < this.lights.length; index++) if (this.lights[index].uniqueId === uniqueId) return this.lights[index];return null;}getParticleSystemById(id) {for (let index = 0; index < this.particleSystems.length; index++) if (this.particleSystems[index].id === id) return this.particleSystems[index];return null;}getGeometryById(id) {for (let index = 0; index < this.geometries.length; index++) if (this.geometries[index].id === id) return this.geometries[index];return null;}_getGeometryByUniqueId(uniqueId) {if (this._geometriesByUniqueId) {const index = this._geometriesByUniqueId[uniqueId];if (index !== void 0) return this.geometries[index];} else for (let index = 0; index < this.geometries.length; index++) if (this.geometries[index].uniqueId === uniqueId) return this.geometries[index];return null;}pushGeometry(geometry, force) {return (force || !this._getGeometryByUniqueId(geometry.uniqueId)) && (this.addGeometry(geometry), this.onNewGeometryAddedObservable.notifyObservers(geometry), !0);}removeGeometry(geometry) {let index;if (this._geometriesByUniqueId) {if (index = this._geometriesByUniqueId[geometry.uniqueId], void 0 === index) return !1;} else if (index = this.geometries.indexOf(geometry), 0 > index) return !1;if (index !== this.geometries.length - 1) {const lastGeometry = this.geometries[this.geometries.length - 1];lastGeometry && (this.geometries[index] = lastGeometry, this._geometriesByUniqueId && (this._geometriesByUniqueId[lastGeometry.uniqueId] = index));}return this._geometriesByUniqueId && (this._geometriesByUniqueId[geometry.uniqueId] = void 0), this.geometries.pop(), this.onGeometryRemovedObservable.notifyObservers(geometry), !0;}getGeometries() {return this.geometries;}getMeshById(id) {for (let index = 0; index < this.meshes.length; index++) if (this.meshes[index].id === id) return this.meshes[index];return null;}getMeshesById(id) {return this.meshes.filter(function (m) {return m.id === id;});}getTransformNodeById(id) {for (let index = 0; index < this.transformNodes.length; index++) if (this.transformNodes[index].id === id) return this.transformNodes[index];return null;}getTransformNodeByUniqueId(uniqueId) {for (let index = 0; index < this.transformNodes.length; index++) if (this.transformNodes[index].uniqueId === uniqueId) return this.transformNodes[index];return null;}getTransformNodesById(id) {return this.transformNodes.filter(function (m) {return m.id === id;});}getMeshByUniqueId(uniqueId) {for (let index = 0; index < this.meshes.length; index++) if (this.meshes[index].uniqueId === uniqueId) return this.meshes[index];return null;}getLastMeshById(id) {for (let index = this.meshes.length - 1; 0 <= index; index--) if (this.meshes[index].id === id) return this.meshes[index];return null;}getLastEntryById(id) {let index;for (index = this.meshes.length - 1; 0 <= index; index--) if (this.meshes[index].id === id) return this.meshes[index];for (index = this.transformNodes.length - 1; 0 <= index; index--) if (this.transformNodes[index].id === id) return this.transformNodes[index];for (index = this.cameras.length - 1; 0 <= index; index--) if (this.cameras[index].id === id) return this.cameras[index];for (index = this.lights.length - 1; 0 <= index; index--) if (this.lights[index].id === id) return this.lights[index];return null;}getNodeById(id) {const mesh = this.getMeshById(id);if (mesh) return mesh;const transformNode = this.getTransformNodeById(id);if (transformNode) return transformNode;const light = this.getLightById(id);if (light) return light;const camera = this.getCameraById(id);if (camera) return camera;const bone = this.getBoneById(id);return bone ? bone : null;}getNodeByName(name) {const mesh = this.getMeshByName(name);if (mesh) return mesh;const transformNode = this.getTransformNodeByName(name);if (transformNode) return transformNode;const light = this.getLightByName(name);if (light) return light;const camera = this.getCameraByName(name);if (camera) return camera;const bone = this.getBoneByName(name);return bone ? bone : null;}getMeshByName(name) {for (let index = 0; index < this.meshes.length; index++) if (this.meshes[index].name === name) return this.meshes[index];return null;}getTransformNodeByName(name) {for (let index = 0; index < this.transformNodes.length; index++) if (this.transformNodes[index].name === name) return this.transformNodes[index];return null;}getLastSkeletonById(id) {for (let index = this.skeletons.length - 1; 0 <= index; index--) if (this.skeletons[index].id === id) return this.skeletons[index];return null;}getSkeletonByUniqueId(uniqueId) {for (let index = 0; index < this.skeletons.length; index++) if (this.skeletons[index].uniqueId === uniqueId) return this.skeletons[index];return null;}getSkeletonById(id) {for (let index = 0; index < this.skeletons.length; index++) if (this.skeletons[index].id === id) return this.skeletons[index];return null;}getSkeletonByName(name) {for (let index = 0; index < this.skeletons.length; index++) if (this.skeletons[index].name === name) return this.skeletons[index];return null;}getMorphTargetManagerById(id) {for (let index = 0; index < this.morphTargetManagers.length; index++) if (this.morphTargetManagers[index].uniqueId === id) return this.morphTargetManagers[index];return null;}getMorphTargetById(id) {for (let managerIndex = 0; managerIndex < this.morphTargetManagers.length; ++managerIndex) {const morphTargetManager = this.morphTargetManagers[managerIndex];for (let index = 0; index < morphTargetManager.numTargets; ++index) {const target = morphTargetManager.getTarget(index);if (target.id === id) return target;}}return null;}getMorphTargetByName(name) {for (let managerIndex = 0; managerIndex < this.morphTargetManagers.length; ++managerIndex) {const morphTargetManager = this.morphTargetManagers[managerIndex];for (let index = 0; index < morphTargetManager.numTargets; ++index) {const target = morphTargetManager.getTarget(index);if (target.name === name) return target;}}return null;}getPostProcessByName(name) {for (let postProcessIndex = 0; postProcessIndex < this.postProcesses.length; ++postProcessIndex) {const postProcess = this.postProcesses[postProcessIndex];if (postProcess.name === name) return postProcess;}return null;}isActiveMesh(mesh) {return -1 !== this._activeMeshes.indexOf(mesh);}get uid() {return this._uid || (this._uid = tools/* Tools.RandomId */.w1.RandomId()), this._uid;}addExternalData(key, data) {return this._externalData || (this._externalData = new stringDictionary/* StringDictionary */.x()), this._externalData.add(key, data);}getExternalData(key) {return this._externalData ? this._externalData.get(key) : null;}getOrAddExternalDataWithFactory(key, factory) {return this._externalData || (this._externalData = new stringDictionary/* StringDictionary */.x()), this._externalData.getOrAddWithFactory(key, factory);}removeExternalData(key) {return this._externalData.remove(key);}_evaluateSubMesh(subMesh, mesh, initialMesh, forcePush) {if (forcePush || subMesh.isInFrustum(this._frustumPlanes)) {for (const step of this._evaluateSubMeshStage) step.action(mesh, subMesh);const material = subMesh.getMaterial();null !== material && material !== void 0 && (material.hasRenderTargetTextures && null != material.getRenderTargetTextures && -1 === this._processedMaterials.indexOf(material) && (this._processedMaterials.push(material), this._materialsRenderTargets.concatWithNoDuplicate(material.getRenderTargetTextures())), this._renderingManager.dispatch(subMesh, mesh, material));}}freeProcessedMaterials() {this._processedMaterials.dispose();}get blockfreeActiveMeshesAndRenderingGroups() {return this._preventFreeActiveMeshesAndRenderingGroups;}set blockfreeActiveMeshesAndRenderingGroups(value) {this._preventFreeActiveMeshesAndRenderingGroups === value || (value && (this.freeActiveMeshes(), this.freeRenderingGroups()), this._preventFreeActiveMeshesAndRenderingGroups = value);}freeActiveMeshes() {if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._activeMeshes.dispose(), this.activeCamera && this.activeCamera._activeMeshes && this.activeCamera._activeMeshes.dispose(), this.activeCameras)) for (let i = 0; i < this.activeCameras.length; i++) {const activeCamera = this.activeCameras[i];activeCamera && activeCamera._activeMeshes && activeCamera._activeMeshes.dispose();}}freeRenderingGroups() {if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._renderingManager && this._renderingManager.freeRenderingGroups(), this.textures)) for (let i = 0; i < this.textures.length; i++) {const texture = this.textures[i];texture && texture.renderList && texture.freeRenderingGroups();}}_isInIntermediateRendering() {return this._intermediateRendering;}freezeActiveMeshes(skipEvaluateActiveMeshes = !1, onSuccess, onError, freezeMeshes = !0, keepFrustumCulling = !1) {return this.executeWhenReady(() => {if (!this.activeCamera) return void (onError && onError("No active camera found"));if (this._frustumPlanes || this.updateTransformMatrix(), this._evaluateActiveMeshes(), this._activeMeshesFrozen = !0, this._activeMeshesFrozenButKeepClipping = keepFrustumCulling, this._skipEvaluateActiveMeshesCompletely = skipEvaluateActiveMeshes, freezeMeshes) for (let index = 0; index < this._activeMeshes.length; index++) this._activeMeshes.data[index]._freeze();onSuccess && onSuccess();}), this;}unfreezeActiveMeshes() {for (let index = 0; index < this.meshes.length; index++) {const mesh = this.meshes[index];mesh._internalAbstractMeshDataInfo && (mesh._internalAbstractMeshDataInfo._isActive = !1);}for (let index = 0; index < this._activeMeshes.length; index++) this._activeMeshes.data[index]._unFreeze();return this._activeMeshesFrozen = !1, this;}_executeActiveContainerCleanup(container) {const isInFastMode = this._engine.snapshotRendering && 1 === this._engine.snapshotRenderingMode;!isInFastMode && this._activeMeshesFrozen && this._activeMeshes.length || this.onBeforeRenderObservable.addOnce(() => container.dispose());}_evaluateActiveMeshes() {var _a;if (this._engine.snapshotRendering && 1 === this._engine.snapshotRenderingMode) return void (0 < this._activeMeshes.length && (null === (_a = this.activeCamera) || void 0 === _a ? void 0 : _a._activeMeshes.reset(), this._activeMeshes.reset(), this._renderingManager.reset(), this._processedMaterials.reset(), this._activeParticleSystems.reset(), this._activeSkeletons.reset(), this._softwareSkinnedMeshes.reset()));if (this._activeMeshesFrozen && this._activeMeshes.length) {if (!this._skipEvaluateActiveMeshesCompletely) {const len = this._activeMeshes.length;for (let i = 0; i < len; i++) {const mesh = this._activeMeshes.data[i];mesh.computeWorldMatrix();}}if (this._activeParticleSystems) {const psLength = this._activeParticleSystems.length;for (let i = 0; i < psLength; i++) this._activeParticleSystems.data[i].animate();}return void this._renderingManager.resetSprites();}if (!this.activeCamera) return;this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this), this.activeCamera._activeMeshes.reset(), this._activeMeshes.reset(), this._renderingManager.reset(), this._processedMaterials.reset(), this._activeParticleSystems.reset(), this._activeSkeletons.reset(), this._softwareSkinnedMeshes.reset(), this._materialsRenderTargets.reset();for (const step of this._beforeEvaluateActiveMeshStage) step.action();const meshes = this.getActiveMeshCandidates(),len = meshes.length;for (let i = 0; i < len; i++) {const mesh = meshes.data[i];if (mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate = !1, mesh.isBlocked) continue;if (this._totalVertices.addCount(mesh.getTotalVertices(), !1), !mesh.isReady() || !mesh.isEnabled() || mesh.scaling.hasAZeroComponent) continue;mesh.computeWorldMatrix(), mesh.actionManager && mesh.actionManager.hasSpecificTriggers2(12, 13) && this._meshesForIntersections.pushNoDuplicate(mesh);let meshToRender = this.customLODSelector ? this.customLODSelector(mesh, this.activeCamera) : mesh.getLOD(this.activeCamera);if ((mesh._internalAbstractMeshDataInfo._currentLOD = meshToRender, mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate = !0, void 0 !== meshToRender && null !== meshToRender) && (meshToRender !== mesh && 0 !== meshToRender.billboardMode && meshToRender.computeWorldMatrix(), mesh._preActivate(), mesh.isVisible && 0 < mesh.visibility && 0 != (mesh.layerMask & this.activeCamera.layerMask) && (this._skipFrustumClipping || mesh.alwaysSelectAsActiveMesh || mesh.isInFrustum(this._frustumPlanes)))) {this._activeMeshes.push(mesh), this.activeCamera._activeMeshes.push(mesh), meshToRender !== mesh && meshToRender._activate(this._renderId, !1);for (const step of this._preActiveMeshStage) step.action(mesh);mesh._activate(this._renderId, !1) && (mesh.isAnInstance ? mesh._internalAbstractMeshDataInfo._actAsRegularMesh && (meshToRender = mesh) : meshToRender._internalAbstractMeshDataInfo._onlyForInstances = !1, meshToRender._internalAbstractMeshDataInfo._isActive = !0, this._activeMesh(mesh, meshToRender)), mesh._postActivate();}}if (this.particlesEnabled) {this.onBeforeParticlesRenderingObservable.notifyObservers(this);for (let particleIndex = 0; particleIndex < this.particleSystems.length; particleIndex++) {const particleSystem = this.particleSystems[particleIndex];if (!particleSystem.isStarted() || !particleSystem.emitter) continue;const emitter = particleSystem.emitter;(!emitter.position || emitter.isEnabled()) && (this._activeParticleSystems.push(particleSystem), particleSystem.animate(), this._renderingManager.dispatchParticles(particleSystem));}this.onAfterParticlesRenderingObservable.notifyObservers(this);}}_activeMesh(sourceMesh, mesh) {this._skeletonsEnabled && null !== mesh.skeleton && mesh.skeleton !== void 0 && (this._activeSkeletons.pushNoDuplicate(mesh.skeleton) && (mesh.skeleton.prepare(), this._activeBones.addCount(mesh.skeleton.bones.length, !1)), !mesh.computeBonesUsingShaders && this._softwareSkinnedMeshes.pushNoDuplicate(mesh));let forcePush = sourceMesh.hasInstances || sourceMesh.isAnInstance || this.dispatchAllSubMeshesOfActiveMeshes || this._skipFrustumClipping || mesh.alwaysSelectAsActiveMesh;if (mesh && mesh.subMeshes && 0 < mesh.subMeshes.length) {const subMeshes = this.getActiveSubMeshCandidates(mesh),len = subMeshes.length;forcePush = forcePush || 1 === len;for (let i = 0; i < len; i++) {const subMesh = subMeshes.data[i];this._evaluateSubMesh(subMesh, mesh, sourceMesh, forcePush);}}}updateTransformMatrix(force) {if (this.activeCamera) if (this.activeCamera._renderingMultiview) {const leftCamera = this.activeCamera._rigCameras[0],rightCamera = this.activeCamera._rigCameras[1];this.setTransformMatrix(leftCamera.getViewMatrix(), leftCamera.getProjectionMatrix(force), rightCamera.getViewMatrix(), rightCamera.getProjectionMatrix(force));} else this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(force));}_bindFrameBuffer(camera, clear = !0) {camera && camera._multiviewTexture ? camera._multiviewTexture._bindFrameBuffer() : camera && camera.outputRenderTarget ? camera.outputRenderTarget._bindFrameBuffer() : !this._engine._currentFrameBufferIsDefaultFrameBuffer() && this._engine.restoreDefaultFramebuffer(), clear && this._clearFrameBuffer(camera);}_clearFrameBuffer(camera) {if (camera && camera._multiviewTexture) ;else if (camera && camera.outputRenderTarget && !camera._renderingMultiview) {const rtt = camera.outputRenderTarget;rtt.onClearObservable.hasObservers() ? rtt.onClearObservable.notifyObservers(this._engine) : !rtt.skipInitialClear && (this.autoClear && this._engine.clear(rtt.clearColor || this.clearColor, !rtt._cleared, !0, !0), rtt._cleared = !0);} else this._defaultFrameBufferCleared ? this._engine.clear(null, !1, !0, !0) : (this._defaultFrameBufferCleared = !0, this._clear());}_renderForCamera(camera, rigParent, bindFrameBuffer = !0) {var _a, _b, _c;if (camera && camera._skipRendering) return;const engine = this._engine;if (this._activeCamera = camera, !this.activeCamera) throw new Error("Active camera not set");if (engine.setViewport(this.activeCamera.viewport), this.resetCachedMaterial(), this._renderId++, !this.prePass && bindFrameBuffer) {let skipInitialClear = !0;camera._renderingMultiview && camera.outputRenderTarget && (skipInitialClear = camera.outputRenderTarget.skipInitialClear, this.autoClear && (camera.outputRenderTarget.skipInitialClear = !1)), this._bindFrameBuffer(this._activeCamera), camera._renderingMultiview && camera.outputRenderTarget && (camera.outputRenderTarget.skipInitialClear = skipInitialClear);}this.updateTransformMatrix(), this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera), this._evaluateActiveMeshes();for (let softwareSkinnedMeshIndex = 0; softwareSkinnedMeshIndex < this._softwareSkinnedMeshes.length; softwareSkinnedMeshIndex++) {const mesh = this._softwareSkinnedMeshes.data[softwareSkinnedMeshIndex];mesh.applySkeleton(mesh.skeleton);}this.onBeforeRenderTargetsRenderObservable.notifyObservers(this), this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets), camera.customRenderTargets && 0 < camera.customRenderTargets.length && this._renderTargets.concatWithNoDuplicate(camera.customRenderTargets), rigParent && rigParent.customRenderTargets && 0 < rigParent.customRenderTargets.length && this._renderTargets.concatWithNoDuplicate(rigParent.customRenderTargets), this.environmentTexture && this.environmentTexture.isRenderTarget && this._renderTargets.pushNoDuplicate(this.environmentTexture);for (const step of this._gatherActiveCameraRenderTargetsStage) step.action(this._renderTargets);let needRebind = !1;if (this.renderTargetsEnabled) {if (this._intermediateRendering = !0, 0 < this._renderTargets.length) {tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Render targets", 0 < this._renderTargets.length);for (let renderIndex = 0; renderIndex < this._renderTargets.length; renderIndex++) {const renderTarget = this._renderTargets.data[renderIndex];if (renderTarget._shouldRender()) {this._renderId++;const hasSpecialRenderTargetCamera = renderTarget.activeCamera && renderTarget.activeCamera !== this.activeCamera;renderTarget.render(hasSpecialRenderTargetCamera, this.dumpNextRenderTargets), needRebind = !0;}}tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Render targets", 0 < this._renderTargets.length), this._renderId++;}for (const step of this._cameraDrawRenderTargetStage) needRebind = step.action(this.activeCamera) || needRebind;this._intermediateRendering = !1;}this._engine.currentRenderPassId = null !== (_c = null !== (_b = null === (_a = camera.outputRenderTarget) || void 0 === _a ? void 0 : _a.renderPassId) && void 0 !== _b ? _b : camera.renderPassId) && void 0 !== _c ? _c : 0, needRebind && !this.prePass && this._bindFrameBuffer(this._activeCamera, !1), this.onAfterRenderTargetsRenderObservable.notifyObservers(this), !this.postProcessManager || camera._multiviewTexture || this.prePass || this.postProcessManager._prepareFrame();for (const step of this._beforeCameraDrawStage) step.action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this), engine.snapshotRendering && 1 === engine.snapshotRenderingMode && this.finalizeSceneUbo(), this._renderingManager.render(null, null, !0, !0), this.onAfterDrawPhaseObservable.notifyObservers(this);for (const step of this._afterCameraDrawStage) step.action(this.activeCamera);if (this.postProcessManager && !camera._multiviewTexture) {const texture = camera.outputRenderTarget ? camera.outputRenderTarget.renderTarget : void 0;this.postProcessManager._finalizeFrame(camera.isIntermediate, texture);}for (const step of this._afterCameraPostProcessStage) step.action(this.activeCamera);this._renderTargets.reset(), this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera);}_processSubCameras(camera, bindFrameBuffer = !0) {if (0 === camera.cameraRigMode || camera._renderingMultiview) return camera._renderingMultiview && !this._multiviewSceneUbo && this._createMultiviewUbo(), this._renderForCamera(camera, void 0, bindFrameBuffer), void this.onAfterRenderCameraObservable.notifyObservers(camera);if (camera._useMultiviewToSingleView) this._renderMultiviewToSingleView(camera);else {this.onBeforeCameraRenderObservable.notifyObservers(camera);for (let index = 0; index < camera._rigCameras.length; index++) this._renderForCamera(camera._rigCameras[index], camera);}this._activeCamera = camera, this.updateTransformMatrix(), this.onAfterRenderCameraObservable.notifyObservers(camera);}_checkIntersections() {for (let index = 0; index < this._meshesForIntersections.length; index++) {const sourceMesh = this._meshesForIntersections.data[index];if (sourceMesh.actionManager) for (let actionIndex = 0; sourceMesh.actionManager && actionIndex < sourceMesh.actionManager.actions.length; actionIndex++) {const action = sourceMesh.actionManager.actions[actionIndex];if (12 === action.trigger || 13 === action.trigger) {const parameters = action.getTriggerParameter(),otherMesh = parameters.mesh ? parameters.mesh : parameters,areIntersecting = otherMesh.intersectsMesh(sourceMesh, parameters.usePreciseIntersection),currentIntersectionInProgress = sourceMesh._intersectionsInProgress.indexOf(otherMesh);areIntersecting && -1 === currentIntersectionInProgress ? 12 === action.trigger ? (action._executeCurrent(actionEvent/* ActionEvent.CreateNew */.V.CreateNew(sourceMesh, void 0, otherMesh)), sourceMesh._intersectionsInProgress.push(otherMesh)) : 13 === action.trigger && sourceMesh._intersectionsInProgress.push(otherMesh) : !areIntersecting && -1 < currentIntersectionInProgress && (13 === action.trigger && action._executeCurrent(actionEvent/* ActionEvent.CreateNew */.V.CreateNew(sourceMesh, void 0, otherMesh)), (!sourceMesh.actionManager.hasSpecificTrigger(13, (parameter) => {const parameterMesh = parameter.mesh ? parameter.mesh : parameter;return otherMesh === parameterMesh;}) || 13 === action.trigger) && sourceMesh._intersectionsInProgress.splice(currentIntersectionInProgress, 1));}}}}_advancePhysicsEngineStep() {}_animate() {}animate() {if (this._engine.isDeterministicLockStep()) {let deltaTime = Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime)) + this._timeAccumulator;const defaultFrameTime = this._engine.getTimeStep();let stepsTaken = 0;const maxSubSteps = this._engine.getLockstepMaxSteps();let internalSteps = Math.floor(deltaTime / defaultFrameTime);for (internalSteps = Math.min(internalSteps, maxSubSteps); 0 < deltaTime && stepsTaken < internalSteps;) this.onBeforeStepObservable.notifyObservers(this), this._animationRatio = defaultFrameTime * (1e3 / defaultFrameTime / 1e3), this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(defaultFrameTime), this.onAfterStepObservable.notifyObservers(this), this._currentStepId++, stepsTaken++, deltaTime -= defaultFrameTime;this._timeAccumulator = 0 > deltaTime ? 0 : deltaTime;} else {const deltaTime = this.useConstantAnimationDeltaTime ? 16 : Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime));this._animationRatio = deltaTime * (60 / 1e3), this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(deltaTime);}}_clear() {(this.autoClearDepthAndStencil || this.autoClear) && this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);}_checkCameraRenderTarget(camera) {var _a;if ((null === camera || void 0 === camera ? void 0 : camera.outputRenderTarget) && (null === camera || void 0 === camera || !camera.isRigCamera) && (camera.outputRenderTarget._cleared = !1), null === (_a = null === camera || void 0 === camera ? void 0 : camera.rigCameras) || void 0 === _a ? void 0 : _a.length) for (let i = 0; i < camera.rigCameras.length; ++i) {const rtt = camera.rigCameras[i].outputRenderTarget;rtt && (rtt._cleared = !1);}}resetDrawCache(passId) {if (this.meshes) for (const mesh of this.meshes) mesh.resetDrawCache(passId);}render(updateCameras = !0, ignoreAnimations = !1) {var _a, _b, _c;if (!this.isDisposed) {this.onReadyObservable.hasObservers() && null === this._executeWhenReadyTimeoutId && this._checkIsReady(), this._frameId++, this._defaultFrameBufferCleared = !1, this._checkCameraRenderTarget(this.activeCamera), (null === (_a = this.activeCameras) || void 0 === _a ? void 0 : _a.length) && this.activeCameras.forEach(this._checkCameraRenderTarget), this._registerTransientComponents(), this._activeParticles.fetchNewFrame(), this._totalVertices.fetchNewFrame(), this._activeIndices.fetchNewFrame(), this._activeBones.fetchNewFrame(), this._meshesForIntersections.reset(), this.resetCachedMaterial(), this.onBeforeAnimationsObservable.notifyObservers(this), this.actionManager && this.actionManager.processTrigger(11), ignoreAnimations || this.animate();for (const step of this._beforeCameraUpdateStage) step.action();if (updateCameras) if (this.activeCameras && 0 < this.activeCameras.length) for (let cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {const camera = this.activeCameras[cameraIndex];if (camera.update(), 0 !== camera.cameraRigMode) for (let index = 0; index < camera._rigCameras.length; index++) camera._rigCameras[index].update();} else if (this.activeCamera && (this.activeCamera.update(), 0 !== this.activeCamera.cameraRigMode)) for (let index = 0; index < this.activeCamera._rigCameras.length; index++) this.activeCamera._rigCameras[index].update();this.onBeforeRenderObservable.notifyObservers(this);const engine = this.getEngine();this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);const currentActiveCamera = (null === (_b = this.activeCameras) || void 0 === _b ? void 0 : _b.length) ? this.activeCameras[0] : this.activeCamera;if (this.renderTargetsEnabled) {tools/* Tools.StartPerformanceCounter */.w1.StartPerformanceCounter("Custom render targets", 0 < this.customRenderTargets.length), this._intermediateRendering = !0;for (let customIndex = 0; customIndex < this.customRenderTargets.length; customIndex++) {const renderTarget = this.customRenderTargets[customIndex];if (renderTarget._shouldRender()) {if (this._renderId++, this.activeCamera = renderTarget.activeCamera || this.activeCamera, !this.activeCamera) throw new Error("Active camera not set");engine.setViewport(this.activeCamera.viewport), this.updateTransformMatrix(), renderTarget.render(currentActiveCamera !== this.activeCamera, this.dumpNextRenderTargets);}}tools/* Tools.EndPerformanceCounter */.w1.EndPerformanceCounter("Custom render targets", 0 < this.customRenderTargets.length), this._intermediateRendering = !1, this._renderId++;}this._engine.currentRenderPassId = null !== (_c = null === currentActiveCamera || void 0 === currentActiveCamera ? void 0 : currentActiveCamera.renderPassId) && void 0 !== _c ? _c : 0, this.activeCamera = currentActiveCamera, this._activeCamera && 22 !== this._activeCamera.cameraRigMode && !this.prePass && this._bindFrameBuffer(this._activeCamera, !1), this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for (const step of this._beforeClearStage) step.action();this._clearFrameBuffer(this.activeCamera);for (const step of this._gatherRenderTargetsStage) step.action(this._renderTargets);if (this.activeCameras && 0 < this.activeCameras.length) for (let cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) this._processSubCameras(this.activeCameras[cameraIndex], 0 < cameraIndex);else {if (!this.activeCamera) throw new Error("No camera defined");this._processSubCameras(this.activeCamera, !!this.activeCamera.outputRenderTarget);}this._checkIntersections();for (const step of this._afterRenderStage) step.action();if (this.afterRender && this.afterRender(), this.onAfterRenderObservable.notifyObservers(this), this._toBeDisposed.length) {for (let index = 0; index < this._toBeDisposed.length; index++) {const data = this._toBeDisposed[index];data && data.dispose();}this._toBeDisposed.length = 0;}this.dumpNextRenderTargets && (this.dumpNextRenderTargets = !1), this._activeBones.addCount(0, !0), this._activeIndices.addCount(0, !0), this._activeParticles.addCount(0, !0), this._engine.restoreDefaultFramebuffer();}}freezeMaterials() {for (let i = 0; i < this.materials.length; i++) this.materials[i].freeze();}unfreezeMaterials() {for (let i = 0; i < this.materials.length; i++) this.materials[i].unfreeze();}dispose() {if (this.isDisposed) return;this.beforeRender = null, this.afterRender = null, this.metadata = null, this.skeletons.length = 0, this.morphTargetManagers.length = 0, this._transientComponents.length = 0, this._isReadyForMeshStage.clear(), this._beforeEvaluateActiveMeshStage.clear(), this._evaluateSubMeshStage.clear(), this._preActiveMeshStage.clear(), this._cameraDrawRenderTargetStage.clear(), this._beforeCameraDrawStage.clear(), this._beforeRenderTargetDrawStage.clear(), this._beforeRenderingGroupDrawStage.clear(), this._beforeRenderingMeshStage.clear(), this._afterRenderingMeshStage.clear(), this._afterRenderingGroupDrawStage.clear(), this._afterCameraDrawStage.clear(), this._afterRenderTargetDrawStage.clear(), this._afterRenderStage.clear(), this._beforeCameraUpdateStage.clear(), this._beforeClearStage.clear(), this._gatherRenderTargetsStage.clear(), this._gatherActiveCameraRenderTargetsStage.clear(), this._pointerMoveStage.clear(), this._pointerDownStage.clear(), this._pointerUpStage.clear(), this.importedMeshesFiles = [], this.stopAllAnimations && this.stopAllAnimations(), this.resetCachedMaterial(), this.activeCamera && (this.activeCamera._activeMeshes.dispose(), this.activeCamera = null), this.activeCameras = null, this._activeMeshes.dispose(), this._renderingManager.dispose(), this._processedMaterials.dispose(), this._activeParticleSystems.dispose(), this._activeSkeletons.dispose(), this._softwareSkinnedMeshes.dispose(), this._renderTargets.dispose(), this._materialsRenderTargets.dispose(), this._registeredForLateAnimationBindings.dispose(), this._meshesForIntersections.dispose(), this._toBeDisposed.length = 0;const activeRequests = this._activeRequests.slice();for (const request of activeRequests) request.abort();this._activeRequests.length = 0;try {this.onDisposeObservable.notifyObservers(this);} catch (e) {console.error("An error occurred while calling onDisposeObservable!", e);}this.onDisposeObservable.clear(), this.onBeforeRenderObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderTargetsRenderObservable.clear(), this.onAfterRenderTargetsRenderObservable.clear(), this.onAfterStepObservable.clear(), this.onBeforeStepObservable.clear(), this.onBeforeActiveMeshesEvaluationObservable.clear(), this.onAfterActiveMeshesEvaluationObservable.clear(), this.onBeforeParticlesRenderingObservable.clear(), this.onAfterParticlesRenderingObservable.clear(), this.onBeforeDrawPhaseObservable.clear(), this.onAfterDrawPhaseObservable.clear(), this.onBeforeAnimationsObservable.clear(), this.onAfterAnimationsObservable.clear(), this.onDataLoadedObservable.clear(), this.onBeforeRenderingGroupObservable.clear(), this.onAfterRenderingGroupObservable.clear(), this.onMeshImportedObservable.clear(), this.onBeforeCameraRenderObservable.clear(), this.onAfterCameraRenderObservable.clear(), this.onReadyObservable.clear(), this.onNewCameraAddedObservable.clear(), this.onCameraRemovedObservable.clear(), this.onNewLightAddedObservable.clear(), this.onLightRemovedObservable.clear(), this.onNewGeometryAddedObservable.clear(), this.onGeometryRemovedObservable.clear(), this.onNewTransformNodeAddedObservable.clear(), this.onTransformNodeRemovedObservable.clear(), this.onNewMeshAddedObservable.clear(), this.onMeshRemovedObservable.clear(), this.onNewSkeletonAddedObservable.clear(), this.onSkeletonRemovedObservable.clear(), this.onNewMaterialAddedObservable.clear(), this.onNewMultiMaterialAddedObservable.clear(), this.onMaterialRemovedObservable.clear(), this.onMultiMaterialRemovedObservable.clear(), this.onNewTextureAddedObservable.clear(), this.onTextureRemovedObservable.clear(), this.onPrePointerObservable.clear(), this.onPointerObservable.clear(), this.onPreKeyboardObservable.clear(), this.onKeyboardObservable.clear(), this.onActiveCameraChanged.clear(), this.detachControl();const canvas = this._engine.getInputElement();if (canvas) for (let index = 0; index < this.cameras.length; index++) this.cameras[index].detachControl();this._disposeList(this.animationGroups), this._disposeList(this.lights), this._disposeList(this.meshes, (item) => item.dispose(!0)), this._disposeList(this.transformNodes, (item) => item.dispose(!0));const cameras = this.cameras;this._disposeList(cameras), this._defaultMaterial && this._defaultMaterial.dispose(), this._disposeList(this.multiMaterials), this._disposeList(this.materials), this._disposeList(this.particleSystems), this._disposeList(this.postProcesses), this._disposeList(this.textures), this._disposeList(this.morphTargetManagers), this._sceneUbo.dispose(), this._multiviewSceneUbo && this._multiviewSceneUbo.dispose(), this.postProcessManager.dispose(), this._disposeList(this._components);let index = this._engine.scenes.indexOf(this);-1 < index && this._engine.scenes.splice(index, 1), engineStore/* EngineStore._LastCreatedScene */.l._LastCreatedScene === this && (0 < this._engine.scenes.length ? engineStore/* EngineStore._LastCreatedScene */.l._LastCreatedScene = this._engine.scenes[this._engine.scenes.length - 1] : engineStore/* EngineStore._LastCreatedScene */.l._LastCreatedScene = null), index = this._engine._virtualScenes.indexOf(this), -1 < index && this._engine._virtualScenes.splice(index, 1), this._engine.wipeCaches(!0), this._isDisposed = !0;}_disposeList(items, callback) {const itemsCopy = items.slice(0);callback = null !== callback && void 0 !== callback ? callback : (item) => item.dispose();for (const item of itemsCopy) callback(item);items.length = 0;}get isDisposed() {return this._isDisposed;}clearCachedVertexData() {for (let meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) {const mesh = this.meshes[meshIndex],geometry = mesh.geometry;geometry && geometry.clearCachedData();}}cleanCachedTextureBuffer() {for (const baseTexture of this.textures) {const buffer = baseTexture._buffer;buffer && (baseTexture._buffer = null);}}getWorldExtends(filterPredicate) {const min = new math_vector/* Vector3 */.P(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE),max = new math_vector/* Vector3 */.P(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);return filterPredicate = filterPredicate || (() => !0), this.meshes.filter(filterPredicate).forEach((mesh) => {if (mesh.computeWorldMatrix(!0), !mesh.subMeshes || 0 === mesh.subMeshes.length || mesh.infiniteDistance) return;const boundingInfo = mesh.getBoundingInfo(),minBox = boundingInfo.boundingBox.minimumWorld,maxBox = boundingInfo.boundingBox.maximumWorld;math_vector/* Vector3.CheckExtends */.P.CheckExtends(minBox, min, max), math_vector/* Vector3.CheckExtends */.P.CheckExtends(maxBox, min, max);}), { min: min, max: max };}createPickingRay(cameraViewSpace = !1) {throw (0,devTools/* _WarnImport */.S)("Ray");}createPickingRayToRef(cameraViewSpace = !1, enableDistantPicking = !1) {throw (0,devTools/* _WarnImport */.S)("Ray");}createPickingRayInCameraSpace() {throw (0,devTools/* _WarnImport */.S)("Ray");}createPickingRayInCameraSpaceToRef() {throw (0,devTools/* _WarnImport */.S)("Ray");}get _pickingAvailable() {return !1;}pick() {return new pickingInfo/* PickingInfo */.p();}pickWithBoundingInfo() {return new pickingInfo/* PickingInfo */.p();}pickWithRay() {throw (0,devTools/* _WarnImport */.S)("Ray");}multiPick() {throw (0,devTools/* _WarnImport */.S)("Ray");}multiPickWithRay() {throw (0,devTools/* _WarnImport */.S)("Ray");}setPointerOverMesh(mesh, pointerId, pickResult) {this._inputManager.setPointerOverMesh(mesh, pointerId, pickResult);}getPointerOverMesh() {return this._inputManager.getPointerOverMesh();}_rebuildGeometries() {for (const geometry of this.geometries) geometry._rebuild();for (const mesh of this.meshes) mesh._rebuild();this.postProcessManager && this.postProcessManager._rebuild();for (const component of this._components) component.rebuild();for (const system of this.particleSystems) system.rebuild();if (this.spriteManagers) for (const spriteMgr of this.spriteManagers) spriteMgr.rebuild();}_rebuildTextures() {for (const texture of this.textures) texture._rebuild();this.markAllMaterialsAsDirty(1);}_getByTags(list, tagsQuery, forEach) {if (void 0 === tagsQuery) return list;const listByTags = [];for (const i in forEach = forEach || (() => {}), list) {const item = list[i];tags/* Tags */.$ && tags/* Tags.MatchesQuery */.$.MatchesQuery(item, tagsQuery) && (listByTags.push(item), forEach(item));}return listByTags;}getMeshesByTags(tagsQuery, forEach) {return this._getByTags(this.meshes, tagsQuery, forEach);}getCamerasByTags(tagsQuery, forEach) {return this._getByTags(this.cameras, tagsQuery, forEach);}getLightsByTags(tagsQuery, forEach) {return this._getByTags(this.lights, tagsQuery, forEach);}getMaterialByTags(tagsQuery, forEach) {return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach));}getTransformNodesByTags(tagsQuery, forEach) {return this._getByTags(this.transformNodes, tagsQuery, forEach);}setRenderingOrder(renderingGroupId, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {this._renderingManager.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn);}setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil, depth = !0, stencil = !0) {this._renderingManager.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil, depth, stencil);}getAutoClearDepthStencilSetup(index) {return this._renderingManager.getAutoClearDepthStencilSetup(index);}get blockMaterialDirtyMechanism() {return this._blockMaterialDirtyMechanism;}set blockMaterialDirtyMechanism(value) {this._blockMaterialDirtyMechanism === value || (this._blockMaterialDirtyMechanism = value, !value && this.markAllMaterialsAsDirty(63));}markAllMaterialsAsDirty(flag, predicate) {if (!this._blockMaterialDirtyMechanism) for (const material of this.materials) (!predicate || predicate(material)) && material.markAsDirty(flag);}_loadFile(fileOrUrl, onSuccess, onProgress, useOfflineSupport, useArrayBuffer, onError, onOpened) {const request = (0,fileTools/* LoadFile */.vP)(fileOrUrl, onSuccess, onProgress, useOfflineSupport ? this.offlineProvider : void 0, useArrayBuffer, onError, onOpened);return this._activeRequests.push(request), request.onCompleteObservable.add((request) => {this._activeRequests.splice(this._activeRequests.indexOf(request), 1);}), request;}_loadFileAsync(fileOrUrl, onProgress, useOfflineSupport, useArrayBuffer, onOpened) {return new Promise((resolve, reject) => {this._loadFile(fileOrUrl, (data) => {resolve(data);}, onProgress, useOfflineSupport, useArrayBuffer, (request, exception) => {reject(exception);}, onOpened);});}_requestFile(url, onSuccess, onProgress, useOfflineSupport, useArrayBuffer, onError, onOpened) {const request = (0,fileTools/* RequestFile */.FV)(url, onSuccess, onProgress, useOfflineSupport ? this.offlineProvider : void 0, useArrayBuffer, onError, onOpened);return this._activeRequests.push(request), request.onCompleteObservable.add((request) => {this._activeRequests.splice(this._activeRequests.indexOf(request), 1);}), request;}_requestFileAsync(url, onProgress, useOfflineSupport, useArrayBuffer, onOpened) {return new Promise((resolve, reject) => {this._requestFile(url, (data) => {resolve(data);}, onProgress, useOfflineSupport, useArrayBuffer, (error) => {reject(error);}, onOpened);});}_readFile(file, onSuccess, onProgress, useArrayBuffer, onError) {const request = (0,fileTools/* ReadFile */.Ip)(file, onSuccess, onProgress, useArrayBuffer, onError);return this._activeRequests.push(request), request.onCompleteObservable.add((request) => {this._activeRequests.splice(this._activeRequests.indexOf(request), 1);}), request;}_readFileAsync(file, onProgress, useArrayBuffer) {return new Promise((resolve, reject) => {this._readFile(file, (data) => {resolve(data);}, onProgress, useArrayBuffer, (error) => {reject(error);});});}getPerfCollector() {throw (0,devTools/* _WarnImport */.S)("performanceViewerSceneExtension");}}Scene.FOGMODE_NONE = 0, Scene.FOGMODE_EXP = 1, Scene.FOGMODE_EXP2 = 2, Scene.FOGMODE_LINEAR = 3, Scene.MinDeltaTime = 1, Scene.MaxDeltaTime = 1e3, Scene.prototype.setActiveCameraByID = function (id) {return this.setActiveCameraById(id);}, Scene.prototype.getLastMaterialByID = function (id) {return this.getLastMaterialById(id);}, Scene.prototype.getMaterialByID = function (id) {return this.getMaterialById(id);}, Scene.prototype.getTextureByUniqueID = function (uniqueId) {return this.getTextureByUniqueId(uniqueId);}, Scene.prototype.getCameraByID = function (id) {return this.getCameraById(id);}, Scene.prototype.getCameraByUniqueID = function (uniqueId) {return this.getCameraByUniqueId(uniqueId);}, Scene.prototype.getBoneByID = function (id) {return this.getBoneById(id);}, Scene.prototype.getLightByID = function (id) {return this.getLightById(id);}, Scene.prototype.getLightByUniqueID = function (uniqueId) {return this.getLightByUniqueId(uniqueId);}, Scene.prototype.getParticleSystemByID = function (id) {return this.getParticleSystemById(id);}, Scene.prototype.getGeometryByID = function (id) {return this.getGeometryById(id);}, Scene.prototype.getMeshByID = function (id) {return this.getMeshById(id);}, Scene.prototype.getMeshesByID = function (id) {return this.getMeshesById(id);}, Scene.prototype.getTransformNodeByID = function (id) {return this.getTransformNodeById(id);}, Scene.prototype.getTransformNodeByUniqueID = function (uniqueId) {return this.getTransformNodeByUniqueId(uniqueId);}, Scene.prototype.getTransformNodesByID = function (id) {return this.getTransformNodesById(id);}, Scene.prototype.getMeshByUniqueID = function (uniqueId) {return this.getMeshByUniqueId(uniqueId);}, Scene.prototype.getLastMeshByID = function (id) {return this.getLastMeshById(id);}, Scene.prototype.getLastEntryByID = function (id) {return this.getLastEntryById(id);}, Scene.prototype.getNodeByID = function (id) {return this.getNodeById(id);}, Scene.prototype.getLastSkeletonByID = function (id) {return this.getLastSkeletonById(id);};

/***/ }),

/***/ "./node_modules/@babylonjs/core/sceneComponent.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "H": () => (/* binding */ Stage),
/* harmony export */   "l": () => (/* binding */ SceneComponentConstants)
/* harmony export */ });
class SceneComponentConstants {}SceneComponentConstants.NAME_EFFECTLAYER = "EffectLayer", SceneComponentConstants.NAME_LAYER = "Layer", SceneComponentConstants.NAME_LENSFLARESYSTEM = "LensFlareSystem", SceneComponentConstants.NAME_BOUNDINGBOXRENDERER = "BoundingBoxRenderer", SceneComponentConstants.NAME_PARTICLESYSTEM = "ParticleSystem", SceneComponentConstants.NAME_GAMEPAD = "Gamepad", SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE = "SimplificationQueue", SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER = "GeometryBufferRenderer", SceneComponentConstants.NAME_PREPASSRENDERER = "PrePassRenderer", SceneComponentConstants.NAME_DEPTHRENDERER = "DepthRenderer", SceneComponentConstants.NAME_DEPTHPEELINGRENDERER = "DepthPeelingRenderer", SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER = "PostProcessRenderPipelineManager", SceneComponentConstants.NAME_SPRITE = "Sprite", SceneComponentConstants.NAME_SUBSURFACE = "SubSurface", SceneComponentConstants.NAME_OUTLINERENDERER = "Outline", SceneComponentConstants.NAME_PROCEDURALTEXTURE = "ProceduralTexture", SceneComponentConstants.NAME_SHADOWGENERATOR = "ShadowGenerator", SceneComponentConstants.NAME_OCTREE = "Octree", SceneComponentConstants.NAME_PHYSICSENGINE = "PhysicsEngine", SceneComponentConstants.NAME_AUDIO = "Audio", SceneComponentConstants.NAME_FLUIDRENDERER = "FluidRenderer", SceneComponentConstants.STEP_ISREADYFORMESH_EFFECTLAYER = 0, SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0, SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0, SceneComponentConstants.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER = 0, SceneComponentConstants.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1, SceneComponentConstants.STEP_BEFORECAMERADRAW_PREPASS = 0, SceneComponentConstants.STEP_BEFORECAMERADRAW_EFFECTLAYER = 1, SceneComponentConstants.STEP_BEFORECAMERADRAW_LAYER = 2, SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_PREPASS = 0, SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_LAYER = 1, SceneComponentConstants.STEP_BEFORERENDERINGMESH_PREPASS = 0, SceneComponentConstants.STEP_BEFORERENDERINGMESH_OUTLINE = 1, SceneComponentConstants.STEP_AFTERRENDERINGMESH_PREPASS = 0, SceneComponentConstants.STEP_AFTERRENDERINGMESH_OUTLINE = 1, SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0, SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1, SceneComponentConstants.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0, SceneComponentConstants.STEP_BEFORECAMERAUPDATE_GAMEPAD = 1, SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0, SceneComponentConstants.STEP_BEFORECLEAR_PREPASS = 1, SceneComponentConstants.STEP_BEFORERENDERTARGETCLEAR_PREPASS = 0, SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_PREPASS = 0, SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_LAYER = 1, SceneComponentConstants.STEP_AFTERCAMERADRAW_PREPASS = 0, SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER = 1, SceneComponentConstants.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 2, SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 3, SceneComponentConstants.STEP_AFTERCAMERADRAW_LAYER = 4, SceneComponentConstants.STEP_AFTERCAMERADRAW_FLUIDRENDERER = 5, SceneComponentConstants.STEP_AFTERCAMERAPOSTPROCESS_LAYER = 0, SceneComponentConstants.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER = 0, SceneComponentConstants.STEP_AFTERRENDER_AUDIO = 0, SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 0, SceneComponentConstants.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1, SceneComponentConstants.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 2, SceneComponentConstants.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3, SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0, SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER = 1, SceneComponentConstants.STEP_POINTERMOVE_SPRITE = 0, SceneComponentConstants.STEP_POINTERDOWN_SPRITE = 0, SceneComponentConstants.STEP_POINTERUP_SPRITE = 0;class Stage extends Array {constructor(items) {super(...items);}static Create() {return Object.create(Stage.prototype);}registerStep(index, component, action) {let i = 0,maxIndex = Number.MAX_VALUE;for (; i < this.length; i++) {const step = this[i];if (maxIndex = step.index, index < maxIndex) break;}this.splice(i, 0, { index, component, action: action.bind(component) });}clear() {this.length = 0;}}

/***/ }),

/***/ "./node_modules/@babylonjs/core/tslib.es6.js":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "gn": () => (/* binding */ __decorate)
/* harmony export */ });
/* unused harmony exports __extends, __assign, __rest, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn */
var extendStatics = function (d, b) {return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {d.__proto__ = b;} || function (d, b) {for (var p in b) Object.prototype.hasOwnProperty.call(b, p) && (d[p] = b[p]);}, extendStatics(d, b);};function __extends(d, b) {function __() {this.constructor = d;}if ("function" != typeof b && null !== b) throw new TypeError("Class extends value " + (b + "") + " is not a constructor or null");extendStatics(d, b), d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());}var __assign = function () {return __assign = Object.assign || function (t) {for (var s, i = 1, n = arguments.length; i < n; i++) for (var p in s = arguments[i], s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);return t;}, __assign.apply(this, arguments);};function __rest(s, e) {var t = {};for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && 0 > e.indexOf(p) && (t[p] = s[p]);if (null != s && "function" == typeof Object.getOwnPropertySymbols) for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) 0 > e.indexOf(p[i]) && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);return t;}function __decorate(decorators, target, key, desc) {var d,c = arguments.length,r = 3 > c ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; 0 <= i; i--) (d = decorators[i]) && (r = (3 > c ? d(r) : 3 < c ? d(target, key, r) : d(target, key)) || r);return 3 < c && r && Object.defineProperty(target, key, r), r;}function __param(paramIndex, decorator) {return function (target, key) {decorator(target, key, paramIndex);};}function __metadata(metadataKey, metadataValue) {if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(metadataKey, metadataValue);}function __awaiter(thisArg, _arguments, P, generator) {function adopt(value) {return value instanceof P ? value : new P(function (resolve) {resolve(value);});}return new (P || (P = Promise))(function (resolve, reject) {function fulfilled(value) {try {step(generator.next(value));} catch (e) {reject(e);}}function rejected(value) {try {step(generator["throw"](value));} catch (e) {reject(e);}}function step(result) {result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);}step((generator = generator.apply(thisArg, _arguments || [])).next());});}function __generator(thisArg, body) {function verb(n) {return function (v) {return step([n, v]);};}function step(op) {if (f) throw new TypeError("Generator is already executing.");for (; _;) try {if (f = 1, y && (t = 2 & op[0] ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;switch ((y = 0, t) && (op = [2 & op[0], t.value]), op[0]) {case 0:case 1:t = op;break;case 4:return _.label++, { value: op[1], done: !1 };case 5:_.label++, y = op[1], op = [0];continue;case 7:op = _.ops.pop(), _.trys.pop();continue;default:if ((t = _.trys, !(t = 0 < t.length && t[t.length - 1])) && (6 === op[0] || 2 === op[0])) {_ = 0;continue;}if (3 === op[0] && (!t || op[1] > t[0] && op[1] < t[3])) {_.label = op[1];break;}if (6 === op[0] && _.label < t[1]) {_.label = t[1], t = op;break;}if (t && _.label < t[2]) {_.label = t[2], _.ops.push(op);break;}t[2] && _.ops.pop(), _.trys.pop();continue;}op = body.call(thisArg, _);} catch (e) {op = [6, e], y = 0;} finally {f = t = 0;}if (5 & op[0]) throw op[1];return { value: op[0] ? op[1] : void 0, done: !0 };}var f,y,t,g,_ = { label: 0, sent: function () {if (1 & t[0]) throw t[1];return t[1];}, trys: [], ops: [] };return g = { next: verb(0), throw: verb(1), return: verb(2) }, "function" == typeof Symbol && (g[Symbol.iterator] = function () {return this;}), g;}var __createBinding = Object.create ? function (o, m, k, k2) {k2 === void 0 && (k2 = k);var desc = Object.getOwnPropertyDescriptor(m, k);(!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function () {return m[k];} }), Object.defineProperty(o, k2, desc);} : function (o, m, k, k2) {k2 === void 0 && (k2 = k), o[k2] = m[k];};function __exportStar(m, o) {for (var p in m) "default" == p || Object.prototype.hasOwnProperty.call(o, p) || __createBinding(o, m, p);}function __values(o) {var s = "function" == typeof Symbol && Symbol.iterator,m = s && o[s],i = 0;if (m) return m.call(o);if (o && "number" == typeof o.length) return { next: function () {return o && i >= o.length && (o = void 0), { value: o && o[i++], done: !o };} };throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");}function __read(o, n) {var m = "function" == typeof Symbol && o[Symbol.iterator];if (!m) return o;var r,e,i = m.call(o),ar = [];try {for (; (void 0 === n || 0 < n--) && !(r = i.next()).done;) ar.push(r.value);} catch (error) {e = { error: error };} finally {try {r && !r.done && (m = i["return"]) && m.call(i);} finally {if (e) throw e.error;}}return ar;}function __spread() {for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));return ar;}function __spreadArrays() {for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];return r;}function __spreadArray(to, from, pack) {if (pack || 2 === arguments.length) for (var ar, i = 0, l = from.length; i < l; i++) (ar || !(i in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);return to.concat(ar || Array.prototype.slice.call(from));}function __await(v) {return this instanceof __await ? (this.v = v, this) : new __await(v);}function __asyncGenerator(thisArg, _arguments, generator) {function verb(n) {g[n] && (i[n] = function (v) {return new Promise(function (a, b) {1 < q.push([n, v, a, b]) || resume(n, v);});});}function resume(n, v) {try {step(g[n](v));} catch (e) {settle(q[0][3], e);}}function step(r) {r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);}function fulfill(value) {resume("next", value);}function reject(value) {resume("throw", value);}function settle(f, v) {(f(v), q.shift(), q.length) && resume(q[0][0], q[0][1]);}if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");var i,g = generator.apply(thisArg, _arguments || []),q = [];return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {return this;}, i;}function __asyncDelegator(o) {function verb(n, f) {i[n] = o[n] ? function (v) {return (p = !p) ? { value: __await(o[n](v)), done: "return" === n } : f ? f(v) : v;} : f;}var i, p;return i = {}, verb("next"), verb("throw", function (e) {throw e;}), verb("return"), i[Symbol.iterator] = function () {return this;}, i;}function __asyncValues(o) {function verb(n) {i[n] = o[n] && function (v) {return new Promise(function (resolve, reject) {v = o[n](v), settle(resolve, reject, v.done, v.value);});};}function settle(resolve, reject, d, v) {Promise.resolve(v).then(function (v) {resolve({ value: v, done: d });}, reject);}if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");var i,m = o[Symbol.asyncIterator];return m ? m.call(o) : (o = "function" == typeof __values ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {return this;}, i);}function __makeTemplateObject(cooked, raw) {return Object.defineProperty ? Object.defineProperty(cooked, "raw", { value: raw }) : cooked.raw = raw, cooked;}var __setModuleDefault = Object.create ? function (o, v) {Object.defineProperty(o, "default", { enumerable: !0, value: v });} : function (o, v) {o["default"] = v;};function __importStar(mod) {if (mod && mod.__esModule) return mod;var result = {};if (null != mod) for (var k in mod) "default" != k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);return __setModuleDefault(result, mod), result;}function __importDefault(mod) {return mod && mod.__esModule ? mod : { default: mod };}function __classPrivateFieldGet(receiver, state, kind, f) {if ("a" === kind && !f) throw new TypeError("Private accessor was defined without a getter");if ("function" == typeof state ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");return "m" === kind ? f : "a" === kind ? f.call(receiver) : f ? f.value : state.get(receiver);}function __classPrivateFieldSet(receiver, state, value, kind, f) {if ("m" === kind) throw new TypeError("Private method is not writable");if ("a" === kind && !f) throw new TypeError("Private accessor was defined without a setter");if ("function" == typeof state ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");return "a" === kind ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;}function __classPrivateFieldIn(state, receiver) {if (null === receiver || "object" != typeof receiver && "function" != typeof receiver) throw new TypeError("Cannot use 'in' operator on non-object");return "function" == typeof state ? receiver === state : state.has(receiver);}

/***/ }),

/***/ "./node_modules/decimal.js/decimal.mjs":
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Decimal": () => (/* binding */ Decimal),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
var inexact,quadrant,EXP_LIMIT = 9e15,MAX_DIGITS = 1e9,NUMERALS = "0123456789abcdef",LN10 = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",PI = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",DEFAULTS = { precision: 20, rounding: 4, modulo: 1, toExpNeg: -7, toExpPos: 21, minE: -9000000000000000, maxE: 9000000000000000, crypto: !1 },external = !0,decimalError = "[DecimalError] ",invalidArgument = "[DecimalError] Invalid argument: ",precisionLimitExceeded = "[DecimalError] Precision limit exceeded",cryptoUnavailable = "[DecimalError] crypto unavailable",mathfloor = Math.floor,mathpow = Math.pow,isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,BASE = 1e7,LOG_BASE = 7,MAX_SAFE_INTEGER = 9007199254740991,LN10_PRECISION = LN10.length - 1,PI_PRECISION = PI.length - 1,P = { name: "[object Decimal]" };P.absoluteValue = P.abs = function () {var x = new this.constructor(this);return 0 > x.s && (x.s = 1), finalise(x);}, P.ceil = function () {return finalise(new this.constructor(this), this.e + 1, 2);}, P.comparedTo = P.cmp = function (y) {var i,j,xdL,ydL,x = this,xd = x.d,yd = (y = new x.constructor(y)).d,xs = x.s,ys = y.s;if (!xd || !yd) return xs && ys ? xs === ys ? xd === yd ? 0 : !xd ^ 0 > xs ? 1 : -1 : xs : NaN;if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;if (xs !== ys) return xs;if (x.e !== y.e) return x.e > y.e ^ 0 > xs ? 1 : -1;for (xdL = xd.length, ydL = yd.length, (i = 0, j = xdL < ydL ? xdL : ydL); i < j; ++i) if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ 0 > xs ? 1 : -1;return xdL === ydL ? 0 : xdL > ydL ^ 0 > xs ? 1 : -1;}, P.cosine = P.cos = function () {var pr,rm,x = this,Ctor = x.constructor;return x.d ? x.d[0] ? (pr = Ctor.precision, rm = Ctor.rounding, Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE, Ctor.rounding = 1, x = cosine(Ctor, toLessThanHalfPi(Ctor, x)), Ctor.precision = pr, Ctor.rounding = rm, finalise(2 == quadrant || 3 == quadrant ? x.neg() : x, pr, rm, !0)) : new Ctor(1) : new Ctor(NaN);}, P.cubeRoot = P.cbrt = function () {var e,m,n,r,rep,s,sd,t,t3,t3plusx,x = this,Ctor = x.constructor;if (!x.isFinite() || x.isZero()) return new Ctor(x);for (external = !1, s = x.s * mathpow(x.s * x, 1 / 3), s && Math.abs(s) != 1 / 0 ? r = new Ctor(s.toString()) : (n = digitsToString(x.d), e = x.e, (s = (e - n.length + 1) % 3) && (n += 1 == s || -2 == s ? "0" : "00"), s = mathpow(n, 1 / 3), e = mathfloor((e + 1) / 3) - (e % 3 == (0 > e ? -1 : 2)), s == 1 / 0 ? n = "5e" + e : (n = s.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + e), r = new Ctor(n), r.s = x.s), sd = (e = Ctor.precision) + 3;;) if (t = r, t3 = t.times(t).times(t), t3plusx = t3.plus(x), r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1), digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) if (n = n.slice(sd - 3, sd + 1), "9999" == n || !rep && "4999" == n) {if (!rep && (finalise(t, e + 1, 0), t.times(t).times(t).eq(x))) {r = t;break;}sd += 4, rep = 1;} else {+n && (+n.slice(1) || "5" != n.charAt(0)) || (finalise(r, e + 1, 1), m = !r.times(r).times(r).eq(x));break;}return external = !0, finalise(r, e, Ctor.rounding, m);}, P.decimalPlaces = P.dp = function () {var w,d = this.d,n = NaN;if (d) {if (w = d.length - 1, n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE, w = d[w], w) for (; 0 == w % 10; w /= 10) n--;0 > n && (n = 0);}return n;}, P.dividedBy = P.div = function (y) {return divide(this, new this.constructor(y));}, P.dividedToIntegerBy = P.divToInt = function (y) {var x = this,Ctor = x.constructor;return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);}, P.equals = P.eq = function (y) {return 0 === this.cmp(y);}, P.floor = function () {return finalise(new this.constructor(this), this.e + 1, 3);}, P.greaterThan = P.gt = function (y) {return 0 < this.cmp(y);}, P.greaterThanOrEqualTo = P.gte = function (y) {var k = this.cmp(y);return 1 == k || 0 === k;}, P.hyperbolicCosine = P.cosh = function () {var k,n,pr,rm,len,x = this,Ctor = x.constructor,one = new Ctor(1);if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);if (x.isZero()) return one;pr = Ctor.precision, rm = Ctor.rounding, Ctor.precision = pr + Math.max(x.e, x.sd()) + 4, Ctor.rounding = 1, len = x.d.length, 32 > len ? (k = Math.ceil(len / 3), n = (1 / tinyPow(4, k)).toString()) : (k = 16, n = "2.3283064365386962890625e-10"), x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), !0);for (var cosh2_x, i = k, d8 = new Ctor(8); i--;) cosh2_x = x.times(x), x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, !0);}, P.hyperbolicSine = P.sinh = function () {var k,pr,rm,len,x = this,Ctor = x.constructor;if (!x.isFinite() || x.isZero()) return new Ctor(x);if (pr = Ctor.precision, rm = Ctor.rounding, Ctor.precision = pr + Math.max(x.e, x.sd()) + 4, Ctor.rounding = 1, len = x.d.length, 3 > len) x = taylorSeries(Ctor, 2, x, x, !0);else {k = 1.4 * Math.sqrt(len), k = 16 < k ? 16 : 0 | k, x = x.times(1 / tinyPow(5, k)), x = taylorSeries(Ctor, 2, x, x, !0);for (var sinh2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); k--;) sinh2_x = x.times(x), x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));}return Ctor.precision = pr, Ctor.rounding = rm, finalise(x, pr, rm, !0);}, P.hyperbolicTangent = P.tanh = function () {var pr,rm,x = this,Ctor = x.constructor;return x.isFinite() ? x.isZero() ? new Ctor(x) : (pr = Ctor.precision, rm = Ctor.rounding, Ctor.precision = pr + 7, Ctor.rounding = 1, divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm)) : new Ctor(x.s);}, P.inverseCosine = P.acos = function () {var halfPi,x = this,Ctor = x.constructor,k = x.abs().cmp(1),pr = Ctor.precision,rm = Ctor.rounding;return -1 === k ? x.isZero() ? getPi(Ctor, pr + 4, rm).times(.5) : (Ctor.precision = pr + 6, Ctor.rounding = 1, x = x.asin(), halfPi = getPi(Ctor, pr + 4, rm).times(.5), Ctor.precision = pr, Ctor.rounding = rm, halfPi.minus(x)) : 0 === k ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) : new Ctor(NaN);}, P.inverseHyperbolicCosine = P.acosh = function () {var pr,rm,x = this,Ctor = x.constructor;return x.lte(1) ? new Ctor(x.eq(1) ? 0 : NaN) : x.isFinite() ? (pr = Ctor.precision, rm = Ctor.rounding, Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4, Ctor.rounding = 1, external = !1, x = x.times(x).minus(1).sqrt().plus(x), external = !0, Ctor.precision = pr, Ctor.rounding = rm, x.ln()) : new Ctor(x);}, P.inverseHyperbolicSine = P.asinh = function () {var pr,rm,x = this,Ctor = x.constructor;return !x.isFinite() || x.isZero() ? new Ctor(x) : (pr = Ctor.precision, rm = Ctor.rounding, Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6, Ctor.rounding = 1, external = !1, x = x.times(x).plus(1).sqrt().plus(x), external = !0, Ctor.precision = pr, Ctor.rounding = rm, x.ln());}, P.inverseHyperbolicTangent = P.atanh = function () {var pr,rm,wpr,xsd,x = this,Ctor = x.constructor;return x.isFinite() ? 0 <= x.e ? new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN) : (pr = Ctor.precision, rm = Ctor.rounding, xsd = x.sd(), Math.max(xsd, pr) < 2 * -x.e - 1) ? finalise(new Ctor(x), pr, rm, !0) : (Ctor.precision = wpr = xsd - x.e, x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1), Ctor.precision = pr + 4, Ctor.rounding = 1, x = x.ln(), Ctor.precision = pr, Ctor.rounding = rm, x.times(.5)) : new Ctor(NaN);}, P.inverseSine = P.asin = function () {var halfPi,k,pr,rm,x = this,Ctor = x.constructor;return x.isZero() ? new Ctor(x) : (k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding, -1 !== k) ? 0 === k ? (halfPi = getPi(Ctor, pr + 4, rm).times(.5), halfPi.s = x.s, halfPi) : new Ctor(NaN) : (Ctor.precision = pr + 6, Ctor.rounding = 1, x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan(), Ctor.precision = pr, Ctor.rounding = rm, x.times(2));}, P.inverseTangent = P.atan = function () {var i,j,k,n,px,t,r,wpr,x2,x = this,Ctor = x.constructor,pr = Ctor.precision,rm = Ctor.rounding;if (!x.isFinite()) {if (!x.s) return new Ctor(NaN);if (pr + 4 <= PI_PRECISION) return r = getPi(Ctor, pr + 4, rm).times(.5), r.s = x.s, r;} else {if (x.isZero()) return new Ctor(x);if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) return r = getPi(Ctor, pr + 4, rm).times(.25), r.s = x.s, r;}for (Ctor.precision = wpr = pr + 10, Ctor.rounding = 1, k = Math.min(28, 0 | wpr / LOG_BASE + 2), i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));for (external = !1, j = Math.ceil(wpr / LOG_BASE), n = 1, x2 = x.times(x), r = new Ctor(x), px = x; -1 !== i;) if (px = px.times(x2), t = r.minus(px.div(n += 2)), px = px.times(x2), r = t.plus(px.div(n += 2)), void 0 !== r.d[j]) for (i = j; r.d[i] === t.d[i] && i--;);return k && (r = r.times(2 << k - 1)), external = !0, finalise(r, Ctor.precision = pr, Ctor.rounding = rm, !0);}, P.isFinite = function () {return !!this.d;}, P.isInteger = P.isInt = function () {return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;}, P.isNaN = function () {return !this.s;}, P.isNegative = P.isNeg = function () {return 0 > this.s;}, P.isPositive = P.isPos = function () {return 0 < this.s;}, P.isZero = function () {return !!this.d && 0 === this.d[0];}, P.lessThan = P.lt = function (y) {return 0 > this.cmp(y);}, P.lessThanOrEqualTo = P.lte = function (y) {return 1 > this.cmp(y);}, P.logarithm = P.log = function (base) {var isBase10,d,denominator,k,inf,num,sd,r,arg = this,Ctor = arg.constructor,pr = Ctor.precision,rm = Ctor.rounding;if (null == base) base = new Ctor(10), isBase10 = !0;else {if (base = new Ctor(base), d = base.d, 0 > base.s || !d || !d[0] || base.eq(1)) return new Ctor(NaN);isBase10 = base.eq(10);}if (d = arg.d, 0 > arg.s || !d || !d[0] || arg.eq(1)) return new Ctor(d && !d[0] ? -1 / 0 : 1 == arg.s ? d ? 0 : 1 / 0 : NaN);if (isBase10) if (1 < d.length) inf = !0;else {for (k = d[0]; 0 == k % 10;) k /= 10;inf = 1 !== k;}if (external = !1, sd = pr + 5, num = naturalLogarithm(arg, sd), denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd), r = divide(num, denominator, sd, 1), checkRoundingDigits(r.d, k = pr, rm)) do if (sd += 10, num = naturalLogarithm(arg, sd), denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd), r = divide(num, denominator, sd, 1), !inf) {1e14 == +digitsToString(r.d).slice(k + 1, k + 15) + 1 && (r = finalise(r, pr + 1, 0));break;} while (checkRoundingDigits(r.d, k += 10, rm));return external = !0, finalise(r, pr, rm);}, P.minus = P.sub = function (y) {var d,e,i,j,k,len,pr,rm,xd,xe,xLTy,yd,x = this,Ctor = x.constructor;if (y = new Ctor(y), !x.d || !y.d) return x.s && y.s ? x.d ? y.s = -y.s : y = new Ctor(y.d || x.s !== y.s ? x : NaN) : y = new Ctor(NaN), y;if (x.s != y.s) return y.s = -y.s, x.plus(y);if (xd = x.d, yd = y.d, pr = Ctor.precision, rm = Ctor.rounding, !xd[0] || !yd[0]) {if (yd[0]) y.s = -y.s;else if (xd[0]) y = new Ctor(x);else return new Ctor(3 === rm ? -0 : 0);return external ? finalise(y, pr, rm) : y;}if (e = mathfloor(y.e / LOG_BASE), xe = mathfloor(x.e / LOG_BASE), xd = xd.slice(), k = xe - e, k) {for (xLTy = 0 > k, xLTy ? (d = xd, k = -k, len = yd.length) : (d = yd, e = xe, len = xd.length), i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2, k > i && (k = i, d.length = 1), d.reverse(), i = k; i--;) d.push(0);d.reverse();} else {for (i = xd.length, len = yd.length, xLTy = i < len, xLTy && (len = i), i = 0; i < len; i++) if (xd[i] != yd[i]) {xLTy = xd[i] < yd[i];break;}k = 0;}for (xLTy && (d = xd, xd = yd, yd = d, y.s = -y.s), len = xd.length, i = yd.length - len; 0 < i; --i) xd[len++] = 0;for (i = yd.length; i > k;) {if (xd[--i] < yd[i]) {for (j = i; j && 0 === xd[--j];) xd[j] = 9999999;--xd[j], xd[i] += BASE;}xd[i] -= yd[i];}for (; 0 === xd[--len];) xd.pop();for (; 0 === xd[0]; xd.shift()) --e;return xd[0] ? (y.d = xd, y.e = getBase10Exponent(xd, e), external ? finalise(y, pr, rm) : y) : new Ctor(3 === rm ? -0 : 0);}, P.modulo = P.mod = function (y) {var q,x = this,Ctor = x.constructor;return (y = new Ctor(y), !x.d || !y.s || y.d && !y.d[0]) ? new Ctor(NaN) : y.d && (!x.d || x.d[0]) ? (external = !1, 9 == Ctor.modulo ? (q = divide(x, y.abs(), 0, 3, 1), q.s *= y.s) : q = divide(x, y, 0, Ctor.modulo, 1), q = q.times(y), external = !0, x.minus(q)) : finalise(new Ctor(x), Ctor.precision, Ctor.rounding);}, P.naturalExponential = P.exp = function () {return naturalExponential(this);}, P.naturalLogarithm = P.ln = function () {return naturalLogarithm(this);}, P.negated = P.neg = function () {var x = new this.constructor(this);return x.s = -x.s, finalise(x);}, P.plus = P.add = function (y) {var carry,d,e,i,k,len,pr,rm,xd,yd,x = this,Ctor = x.constructor;if (y = new Ctor(y), !x.d || !y.d) return x.s && y.s ? !x.d && (y = new Ctor(y.d || x.s === y.s ? x : NaN)) : y = new Ctor(NaN), y;if (x.s != y.s) return y.s = -y.s, x.minus(y);if (xd = x.d, yd = y.d, pr = Ctor.precision, rm = Ctor.rounding, !xd[0] || !yd[0]) return yd[0] || (y = new Ctor(x)), external ? finalise(y, pr, rm) : y;if (k = mathfloor(x.e / LOG_BASE), e = mathfloor(y.e / LOG_BASE), xd = xd.slice(), i = k - e, i) {for (0 > i ? (d = xd, i = -i, len = yd.length) : (d = yd, e = k, len = xd.length), k = Math.ceil(pr / LOG_BASE), len = k > len ? k + 1 : len + 1, i > len && (i = len, d.length = 1), d.reverse(); i--;) d.push(0);d.reverse();}for (len = xd.length, i = yd.length, 0 > len - i && (i = len, d = yd, yd = xd, xd = d), carry = 0; i;) carry = 0 | (xd[--i] = xd[i] + yd[i] + carry) / BASE, xd[i] %= BASE;for (carry && (xd.unshift(carry), ++e), len = xd.length; 0 == xd[--len];) xd.pop();return y.d = xd, y.e = getBase10Exponent(xd, e), external ? finalise(y, pr, rm) : y;}, P.precision = P.sd = function (z) {var k,x = this;if (void 0 !== z && z !== !!z && 1 !== z && 0 !== z) throw Error(invalidArgument + z);return x.d ? (k = getPrecision(x.d), z && x.e + 1 > k && (k = x.e + 1)) : k = NaN, k;}, P.round = function () {var x = this,Ctor = x.constructor;return finalise(new Ctor(x), x.e + 1, Ctor.rounding);}, P.sine = P.sin = function () {var pr,rm,x = this,Ctor = x.constructor;return x.isFinite() ? x.isZero() ? new Ctor(x) : (pr = Ctor.precision, rm = Ctor.rounding, Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE, Ctor.rounding = 1, x = sine(Ctor, toLessThanHalfPi(Ctor, x)), Ctor.precision = pr, Ctor.rounding = rm, finalise(2 < quadrant ? x.neg() : x, pr, rm, !0)) : new Ctor(NaN);}, P.squareRoot = P.sqrt = function () {var m,n,sd,r,rep,t,x = this,d = x.d,e = x.e,s = x.s,Ctor = x.constructor;if (1 !== s || !d || !d[0]) return new Ctor(!s || 0 > s && (!d || d[0]) ? NaN : d ? x : 1 / 0);for (external = !1, s = Math.sqrt(+x), 0 == s || s == 1 / 0 ? (n = digitsToString(d), 0 == (n.length + e) % 2 && (n += "0"), s = Math.sqrt(n), e = mathfloor((e + 1) / 2) - (0 > e || e % 2), s == 1 / 0 ? n = "5e" + e : (n = s.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + e), r = new Ctor(n)) : r = new Ctor(s.toString()), sd = (e = Ctor.precision) + 3;;) if (t = r, r = t.plus(divide(x, t, sd + 2, 1)).times(.5), digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) if (n = n.slice(sd - 3, sd + 1), "9999" == n || !rep && "4999" == n) {if (!rep && (finalise(t, e + 1, 0), t.times(t).eq(x))) {r = t;break;}sd += 4, rep = 1;} else {+n && (+n.slice(1) || "5" != n.charAt(0)) || (finalise(r, e + 1, 1), m = !r.times(r).eq(x));break;}return external = !0, finalise(r, e, Ctor.rounding, m);}, P.tangent = P.tan = function () {var pr,rm,x = this,Ctor = x.constructor;return x.isFinite() ? x.isZero() ? new Ctor(x) : (pr = Ctor.precision, rm = Ctor.rounding, Ctor.precision = pr + 10, Ctor.rounding = 1, x = x.sin(), x.s = 1, x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0), Ctor.precision = pr, Ctor.rounding = rm, finalise(2 == quadrant || 4 == quadrant ? x.neg() : x, pr, rm, !0)) : new Ctor(NaN);}, P.times = P.mul = function (y) {var carry,e,i,k,r,rL,t,xdL,ydL,x = this,Ctor = x.constructor,xd = x.d,yd = (y = new Ctor(y)).d;if (y.s *= x.s, !xd || !xd[0] || !yd || !yd[0]) return new Ctor(y.s && (!xd || xd[0] || yd) && (!yd || yd[0] || xd) ? xd && yd ? 0 * y.s : y.s / 0 : NaN);for (e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE), xdL = xd.length, ydL = yd.length, xdL < ydL && (r = xd, xd = yd, yd = r, rL = xdL, xdL = ydL, ydL = rL), r = [], rL = xdL + ydL, i = rL; i--;) r.push(0);for (i = ydL; 0 <= --i;) {for (carry = 0, k = xdL + i; k > i;) t = r[k] + yd[i] * xd[k - i - 1] + carry, r[k--] = 0 | t % BASE, carry = 0 | t / BASE;r[k] = 0 | (r[k] + carry) % BASE;}for (; !r[--rL];) r.pop();return carry ? ++e : r.shift(), y.d = r, y.e = getBase10Exponent(r, e), external ? finalise(y, Ctor.precision, Ctor.rounding) : y;}, P.toBinary = function (sd, rm) {return toStringBinary(this, 2, sd, rm);}, P.toDecimalPlaces = P.toDP = function (dp, rm) {var x = this,Ctor = x.constructor;return (x = new Ctor(x), void 0 === dp) ? x : (checkInt32(dp, 0, MAX_DIGITS), void 0 === rm ? rm = Ctor.rounding : checkInt32(rm, 0, 8), finalise(x, dp + x.e + 1, rm));}, P.toExponential = function (dp, rm) {var str,x = this,Ctor = x.constructor;return void 0 === dp ? str = finiteToString(x, !0) : (checkInt32(dp, 0, MAX_DIGITS), void 0 === rm ? rm = Ctor.rounding : checkInt32(rm, 0, 8), x = finalise(new Ctor(x), dp + 1, rm), str = finiteToString(x, !0, dp + 1)), x.isNeg() && !x.isZero() ? "-" + str : str;}, P.toFixed = function (dp, rm) {var str,y,x = this,Ctor = x.constructor;return void 0 === dp ? str = finiteToString(x) : (checkInt32(dp, 0, MAX_DIGITS), void 0 === rm ? rm = Ctor.rounding : checkInt32(rm, 0, 8), y = finalise(new Ctor(x), dp + x.e + 1, rm), str = finiteToString(y, !1, dp + y.e + 1)), x.isNeg() && !x.isZero() ? "-" + str : str;}, P.toFraction = function (maxD) {var d,d0,d1,d2,e,k,n,n0,n1,pr,q,r,x = this,xd = x.d,Ctor = x.constructor;if (!xd) return new Ctor(x);if (n1 = d0 = new Ctor(1), d1 = n0 = new Ctor(0), d = new Ctor(d1), e = d.e = getPrecision(xd) - x.e - 1, k = e % LOG_BASE, d.d[0] = mathpow(10, 0 > k ? LOG_BASE + k : k), null == maxD) maxD = 0 < e ? d : n1;else {if (n = new Ctor(maxD), !n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);maxD = n.gt(d) ? 0 < e ? d : n1 : n;}for (external = !1, n = new Ctor(digitsToString(xd)), pr = Ctor.precision, Ctor.precision = e = 2 * (xd.length * LOG_BASE);;) {if (q = divide(n, d, 0, 1, 1), d2 = d0.plus(q.times(d1)), 1 == d2.cmp(maxD)) break;d0 = d1, d1 = d2, d2 = n1, n1 = n0.plus(q.times(d2)), n0 = d2, d2 = d, d = n.minus(q.times(d2)), n = d2;}return d2 = divide(maxD.minus(d0), d1, 0, 1, 1), n0 = n0.plus(d2.times(n1)), d0 = d0.plus(d2.times(d1)), n0.s = n1.s = x.s, r = 1 > divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) ? [n1, d1] : [n0, d0], Ctor.precision = pr, external = !0, r;}, P.toHexadecimal = P.toHex = function (sd, rm) {return toStringBinary(this, 16, sd, rm);}, P.toNearest = function (y, rm) {var x = this,Ctor = x.constructor;if (x = new Ctor(x), null == y) {if (!x.d) return x;y = new Ctor(1), rm = Ctor.rounding;} else {if (y = new Ctor(y), void 0 === rm ? rm = Ctor.rounding : checkInt32(rm, 0, 8), !x.d) return y.s ? x : y;if (!y.d) return y.s && (y.s = x.s), y;}return y.d[0] ? (external = !1, x = divide(x, y, 0, rm, 1).times(y), external = !0, finalise(x)) : (y.s = x.s, x = y), x;}, P.toNumber = function () {return +this;}, P.toOctal = function (sd, rm) {return toStringBinary(this, 8, sd, rm);}, P.toPower = P.pow = function (y) {var e,k,pr,r,rm,s,x = this,Ctor = x.constructor,yn = +(y = new Ctor(y));if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));if (x = new Ctor(x), x.eq(1)) return x;if (pr = Ctor.precision, rm = Ctor.rounding, y.eq(1)) return finalise(x, pr, rm);if (e = mathfloor(y.e / LOG_BASE), e >= y.d.length - 1 && (k = 0 > yn ? -yn : yn) <= MAX_SAFE_INTEGER) return r = intPow(Ctor, x, k, pr), 0 > y.s ? new Ctor(1).div(r) : finalise(r, pr, rm);if (s = x.s, 0 > s) {if (e < y.d.length - 1) return new Ctor(NaN);if (0 == (1 & y.d[e]) && (s = 1), 0 == x.e && 1 == x.d[0] && 1 == x.d.length) return x.s = s, x;}return (k = mathpow(+x, yn), e = 0 != k && isFinite(k) ? new Ctor(k + "").e : mathfloor(yn * (Math.log("0." + digitsToString(x.d)) / Math.LN10 + x.e + 1)), e > Ctor.maxE + 1 || e < Ctor.minE - 1) ? new Ctor(0 < e ? s / 0 : 0) : (external = !1, Ctor.rounding = x.s = 1, k = Math.min(12, (e + "").length), r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr), r.d && (r = finalise(r, pr + 5, 1), checkRoundingDigits(r.d, pr, rm) && (e = pr + 10, r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1), 1e14 == +digitsToString(r.d).slice(pr + 1, pr + 15) + 1 && (r = finalise(r, pr + 1, 0)))), r.s = s, external = !0, Ctor.rounding = rm, finalise(r, pr, rm));}, P.toPrecision = function (sd, rm) {var str,x = this,Ctor = x.constructor;return void 0 === sd ? str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos) : (checkInt32(sd, 1, MAX_DIGITS), void 0 === rm ? rm = Ctor.rounding : checkInt32(rm, 0, 8), x = finalise(new Ctor(x), sd, rm), str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd)), x.isNeg() && !x.isZero() ? "-" + str : str;}, P.toSignificantDigits = P.toSD = function (sd, rm) {var x = this,Ctor = x.constructor;return void 0 === sd ? (sd = Ctor.precision, rm = Ctor.rounding) : (checkInt32(sd, 1, MAX_DIGITS), void 0 === rm ? rm = Ctor.rounding : checkInt32(rm, 0, 8)), finalise(new Ctor(x), sd, rm);}, P.toString = function () {var x = this,Ctor = x.constructor,str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);return x.isNeg() && !x.isZero() ? "-" + str : str;}, P.truncated = P.trunc = function () {return finalise(new this.constructor(this), this.e + 1, 1);}, P.valueOf = P.toJSON = function () {var x = this,Ctor = x.constructor,str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);return x.isNeg() ? "-" + str : str;};function digitsToString(d) {var i,k,ws,indexOfLastWord = d.length - 1,str = "",w = d[0];if (0 < indexOfLastWord) {for (str += w, i = 1; i < indexOfLastWord; i++) ws = d[i] + "", k = LOG_BASE - ws.length, k && (str += getZeroString(k)), str += ws;w = d[i], ws = w + "", k = LOG_BASE - ws.length, k && (str += getZeroString(k));} else if (0 === w) return "0";for (; 0 == w % 10;) w /= 10;return str + w;}function checkInt32(i, min, max) {if (i !== ~~i || i < min || i > max) throw Error(invalidArgument + i);}function checkRoundingDigits(d, i, rm, repeating) {var di, k, r, rd;for (k = d[0]; 10 <= k; k /= 10) --i;return 0 > --i ? (i += LOG_BASE, di = 0) : (di = Math.ceil((i + 1) / LOG_BASE), i %= LOG_BASE), k = mathpow(10, LOG_BASE - i), rd = 0 | d[di] % k, null == repeating ? 3 > i ? (0 == i ? rd = 0 | rd / 100 : 1 == i && (rd = 0 | rd / 10), r = 4 > rm && 99999 == rd || 3 < rm && 49999 == rd || 5e4 == rd || 0 == rd) : r = (4 > rm && rd + 1 == k || 3 < rm && rd + 1 == k / 2) && (0 | d[di + 1] / k / 100) == mathpow(10, i - 2) - 1 || (rd == k / 2 || 0 == rd) && 0 == (0 | d[di + 1] / k / 100) : 4 > i ? (0 == i ? rd = 0 | rd / 1e3 : 1 == i ? rd = 0 | rd / 100 : 2 == i && (rd = 0 | rd / 10), r = (repeating || 4 > rm) && 9999 == rd || !repeating && 3 < rm && 4999 == rd) : r = ((repeating || 4 > rm) && rd + 1 == k || !repeating && 3 < rm && rd + 1 == k / 2) && (0 | d[di + 1] / k / 1e3) == mathpow(10, i - 3) - 1, r;}function convertBase(str, baseIn, baseOut) {for (var j, arrL, arr = [0], i = 0, strL = str.length; i < strL;) {for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;for (arr[0] += NUMERALS.indexOf(str.charAt(i++)), j = 0; j < arr.length; j++) arr[j] > baseOut - 1 && (void 0 === arr[j + 1] && (arr[j + 1] = 0), arr[j + 1] += 0 | arr[j] / baseOut, arr[j] %= baseOut);}return arr.reverse();}function cosine(Ctor, x) {var k,y,len = x.d.length;32 > len ? (k = Math.ceil(len / 3), y = (1 / tinyPow(4, k)).toString()) : (k = 16, y = "2.3283064365386962890625e-10"), Ctor.precision += k, x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));for (var cos2x, i = k; i--;) cos2x = x.times(x), x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);return Ctor.precision -= k, x;}var divide = function () {function multiplyInteger(x, k, base) {var temp,carry = 0,i = x.length;for (x = x.slice(); i--;) temp = x[i] * k + carry, x[i] = 0 | temp % base, carry = 0 | temp / base;return carry && x.unshift(carry), x;}function compare(a, b, aL, bL) {var i, r;if (aL != bL) r = aL > bL ? 1 : -1;else for (i = r = 0; i < aL; i++) if (a[i] != b[i]) {r = a[i] > b[i] ? 1 : -1;break;}return r;}function subtract(a, b, aL, base) {for (var i = 0; aL--;) a[aL] -= i, i = a[aL] < b[aL] ? 1 : 0, a[aL] = i * base + a[aL] - b[aL];for (; !a[0] && 1 < a.length;) a.shift();}return function (x, y, pr, rm, dp, base) {var cmp,e,i,k,logBase,more,prod,prodL,q,qd,rem,remL,rem0,sd,t,xi,xL,yd0,yL,yz,Ctor = x.constructor,sign = x.s == y.s ? 1 : -1,xd = x.d,yd = y.d;if (!xd || !xd[0] || !yd || !yd[0]) return new Ctor(x.s && y.s && (xd ? !(yd && xd[0] == yd[0]) : !!yd) ? xd && 0 == xd[0] || !yd ? 0 * sign : sign / 0 : NaN);for (base ? (logBase = 1, e = x.e - y.e) : (base = BASE, logBase = LOG_BASE, e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase)), yL = yd.length, xL = xd.length, q = new Ctor(sign), qd = q.d = [], i = 0; yd[i] == (xd[i] || 0); i++);if (yd[i] > (xd[i] || 0) && e--, null == pr ? (sd = pr = Ctor.precision, rm = Ctor.rounding) : dp ? sd = pr + (x.e - y.e) + 1 : sd = pr, 0 > sd) qd.push(1), more = !0;else {if (sd = 0 | sd / logBase + 2, i = 0, 1 == yL) {for (k = 0, yd = yd[0], sd++; (i < xL || k) && sd--; i++) t = k * base + (xd[i] || 0), qd[i] = 0 | t / yd, k = 0 | t % yd;more = k || i < xL;} else {for (k = 0 | base / (yd[0] + 1), 1 < k && (yd = multiplyInteger(yd, k, base), xd = multiplyInteger(xd, k, base), yL = yd.length, xL = xd.length), xi = yL, rem = xd.slice(0, yL), remL = rem.length; remL < yL;) rem[remL++] = 0;yz = yd.slice(), yz.unshift(0), yd0 = yd[0], yd[1] >= base / 2 && ++yd0;do k = 0, cmp = compare(yd, rem, yL, remL), 0 > cmp ? (rem0 = rem[0], yL != remL && (rem0 = rem0 * base + (rem[1] || 0)), k = 0 | rem0 / yd0, 1 < k ? (k >= base && (k = base - 1), prod = multiplyInteger(yd, k, base), prodL = prod.length, remL = rem.length, cmp = compare(prod, rem, prodL, remL), 1 == cmp && (k--, subtract(prod, yL < prodL ? yz : yd, prodL, base))) : (0 == k && (cmp = k = 1), prod = yd.slice()), prodL = prod.length, prodL < remL && prod.unshift(0), subtract(rem, prod, remL, base), -1 == cmp && (remL = rem.length, cmp = compare(yd, rem, yL, remL), 1 > cmp && (k++, subtract(rem, yL < remL ? yz : yd, remL, base))), remL = rem.length) : 0 === cmp && (k++, rem = [0]), qd[i++] = k, cmp && rem[0] ? rem[remL++] = xd[xi] || 0 : (rem = [xd[xi]], remL = 1); while ((xi++ < xL || void 0 !== rem[0]) && sd--);more = void 0 !== rem[0];}qd[0] || qd.shift();}if (1 == logBase) q.e = e, inexact = more;else {for (i = 1, k = qd[0]; 10 <= k; k /= 10) i++;q.e = i + e * logBase - 1, finalise(q, dp ? pr + q.e + 1 : pr, rm, more);}return q;};}();function finalise(x, sd, rm, isTruncated) {var digits,i,j,k,rd,roundUp,w,xd,xdi,Ctor = x.constructor;out: if (null != sd) {if (xd = x.d, !xd) return x;for (digits = 1, k = xd[0]; 10 <= k; k /= 10) digits++;if (i = sd - digits, 0 > i) i += LOG_BASE, j = sd, w = xd[xdi = 0], rd = 0 | w / mathpow(10, digits - j - 1) % 10;else if (xdi = Math.ceil((i + 1) / LOG_BASE), k = xd.length, !(xdi >= k)) {for (w = k = xd[xdi], digits = 1; 10 <= k; k /= 10) digits++;i %= LOG_BASE, j = i - LOG_BASE + digits, rd = 0 > j ? 0 : 0 | w / mathpow(10, digits - j - 1) % 10;} else if (isTruncated) {for (; k++ <= xdi;) xd.push(0);w = rd = 0, digits = 1, i %= LOG_BASE, j = i - LOG_BASE + 1;} else break out;if (isTruncated = isTruncated || 0 > sd || void 0 !== xd[xdi + 1] || (0 > j ? w : w % mathpow(10, digits - j - 1)), roundUp = 4 > rm ? (rd || isTruncated) && (0 == rm || rm == (0 > x.s ? 3 : 2)) : 5 < rd || 5 == rd && (4 == rm || isTruncated || 6 == rm && 1 & (0 < i ? 0 < j ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 || rm == (0 > x.s ? 8 : 7)), 1 > sd || !xd[0]) return xd.length = 0, roundUp ? (sd -= x.e + 1, xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE), x.e = -sd || 0) : xd[0] = x.e = 0, x;if (0 == i ? (xd.length = xdi, k = 1, xdi--) : (xd.length = xdi + 1, k = mathpow(10, LOG_BASE - i), xd[xdi] = 0 < j ? (0 | w / mathpow(10, digits - j) % mathpow(10, j)) * k : 0), roundUp) for (;;) if (0 == xdi) {for (i = 1, j = xd[0]; 10 <= j; j /= 10) i++;for (j = xd[0] += k, k = 1; 10 <= j; j /= 10) k++;i != k && (x.e++, xd[0] == BASE && (xd[0] = 1));break;} else {if (xd[xdi] += k, xd[xdi] != BASE) break;xd[xdi--] = 0, k = 1;}for (i = xd.length; 0 === xd[--i];) xd.pop();}return external && (x.e > Ctor.maxE ? (x.d = null, x.e = NaN) : x.e < Ctor.minE && (x.e = 0, x.d = [0])), x;}function finiteToString(x, isExp, sd) {if (!x.isFinite()) return nonFiniteToString(x);var k,e = x.e,str = digitsToString(x.d),len = str.length;return isExp ? (sd && 0 < (k = sd - len) ? str = str.charAt(0) + "." + str.slice(1) + getZeroString(k) : 1 < len && (str = str.charAt(0) + "." + str.slice(1)), str = str + (0 > x.e ? "e" : "e+") + x.e) : 0 > e ? (str = "0." + getZeroString(-e - 1) + str, sd && 0 < (k = sd - len) && (str += getZeroString(k))) : e >= len ? (str += getZeroString(e + 1 - len), sd && 0 < (k = sd - e - 1) && (str = str + "." + getZeroString(k))) : ((k = e + 1) < len && (str = str.slice(0, k) + "." + str.slice(k)), sd && 0 < (k = sd - len) && (e + 1 === len && (str += "."), str += getZeroString(k))), str;}function getBase10Exponent(digits, e) {var w = digits[0];for (e *= LOG_BASE; 10 <= w; w /= 10) e++;return e;}function getLn10(Ctor, sd, pr) {if (sd > LN10_PRECISION) throw external = !0, pr && (Ctor.precision = pr), Error(precisionLimitExceeded);return finalise(new Ctor(LN10), sd, 1, !0);}function getPi(Ctor, sd, rm) {if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);return finalise(new Ctor(PI), sd, rm, !0);}function getPrecision(digits) {var w = digits.length - 1,len = w * LOG_BASE + 1;if (w = digits[w], w) {for (; 0 == w % 10; w /= 10) len--;for (w = digits[0]; 10 <= w; w /= 10) len++;}return len;}function getZeroString(k) {for (var zs = ""; k--;) zs += "0";return zs;}function intPow(Ctor, x, n, pr) {var isTruncated,r = new Ctor(1),k = Math.ceil(pr / LOG_BASE + 4);for (external = !1;;) {if (n % 2 && (r = r.times(x), truncate(r.d, k) && (isTruncated = !0)), n = mathfloor(n / 2), 0 === n) {n = r.d.length - 1, isTruncated && 0 === r.d[n] && ++r.d[n];break;}x = x.times(x), truncate(x.d, k);}return external = !0, r;}function isOdd(n) {return 1 & n.d[n.d.length - 1];}function maxOrMin(Ctor, args, ltgt) {for (var y, x = new Ctor(args[0]), i = 0; ++i < args.length;) if (y = new Ctor(args[i]), !y.s) {x = y;break;} else x[ltgt](y) && (x = y);return x;}function naturalExponential(x, sd) {var denominator,guard,j,pow,sum,t,wpr,rep = 0,i = 0,k = 0,Ctor = x.constructor,rm = Ctor.rounding,pr = Ctor.precision;if (!x.d || !x.d[0] || 17 < x.e) return new Ctor(x.d ? x.d[0] ? 0 > x.s ? 0 : 1 / 0 : 1 : x.s ? 0 > x.s ? 0 : x : 0 / 0);for (null == sd ? (external = !1, wpr = pr) : wpr = sd, t = new Ctor(.03125); -2 < x.e;) x = x.times(t), k += 5;for (guard = 0 | 2 * (Math.log(mathpow(2, k)) / Math.LN10) + 5, wpr += guard, denominator = pow = sum = new Ctor(1), Ctor.precision = wpr;;) {if (pow = finalise(pow.times(x), wpr, 1), denominator = denominator.times(++i), t = sum.plus(divide(pow, denominator, wpr, 1)), digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {for (j = k; j--;) sum = finalise(sum.times(sum), wpr, 1);if (null != sd) return Ctor.precision = pr, sum;if (3 > rep && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) Ctor.precision = wpr += 10, denominator = pow = t = new Ctor(1), i = 0, rep++;else return finalise(sum, Ctor.precision = pr, rm, external = !0);}sum = t;}}function naturalLogarithm(y, sd) {var c,c0,denominator,e,numerator,rep,sum,t,wpr,x1,x2,n = 1,x = y,xd = x.d,Ctor = x.constructor,rm = Ctor.rounding,pr = Ctor.precision;if (0 > x.s || !xd || !xd[0] || !x.e && 1 == xd[0] && 1 == xd.length) return new Ctor(xd && !xd[0] ? -1 / 0 : 1 == x.s ? xd ? 0 : x : NaN);if (null == sd ? (external = !1, wpr = pr) : wpr = sd, Ctor.precision = wpr += 10, c = digitsToString(xd), c0 = c.charAt(0), 15e14 > Math.abs(e = x.e)) {for (; 7 > c0 && 1 != c0 || 1 == c0 && 3 < c.charAt(1);) x = x.times(y), c = digitsToString(x.d), c0 = c.charAt(0), n++;e = x.e, 1 < c0 ? (x = new Ctor("0." + c), e++) : x = new Ctor(c0 + "." + c.slice(1));} else return t = getLn10(Ctor, wpr + 2, pr).times(e + ""), x = naturalLogarithm(new Ctor(c0 + "." + c.slice(1)), wpr - 10).plus(t), Ctor.precision = pr, null == sd ? finalise(x, pr, rm, external = !0) : x;for (x1 = x, sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1), x2 = finalise(x.times(x), wpr, 1), denominator = 3;;) {if (numerator = finalise(numerator.times(x2), wpr, 1), t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1)), digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {if (sum = sum.times(2), 0 !== e && (sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ""))), sum = divide(sum, new Ctor(n), wpr, 1), null != sd) return Ctor.precision = pr, sum;if (checkRoundingDigits(sum.d, wpr - 10, rm, rep)) Ctor.precision = wpr += 10, t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1), x2 = finalise(x.times(x), wpr, 1), denominator = rep = 1;else return finalise(sum, Ctor.precision = pr, rm, external = !0);}sum = t, denominator += 2;}}function nonFiniteToString(x) {return x.s * x.s / 0 + "";}function parseDecimal(x, str) {var e, i, len;for (-1 < (e = str.indexOf(".")) && (str = str.replace(".", "")), 0 < (i = str.search(/e/i)) ? (0 > e && (e = i), e += +str.slice(i + 1), str = str.substring(0, i)) : 0 > e && (e = str.length), i = 0; 48 === str.charCodeAt(i); i++);for (len = str.length; 48 === str.charCodeAt(len - 1); --len);if (str = str.slice(i, len), str) {if (len -= i, x.e = e = e - i - 1, x.d = [], i = (e + 1) % LOG_BASE, 0 > e && (i += LOG_BASE), i < len) {for (i && x.d.push(+str.slice(0, i)), len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));str = str.slice(i), i = LOG_BASE - str.length;} else i -= len;for (; i--;) str += "0";x.d.push(+str), external && (x.e > x.constructor.maxE ? (x.d = null, x.e = NaN) : x.e < x.constructor.minE && (x.e = 0, x.d = [0]));} else x.e = 0, x.d = [0];return x;}function parseOther(x, str) {var base, Ctor, divisor, i, isFloat, len, p, xd, xe;if ("Infinity" === str || "NaN" === str) return +str || (x.s = NaN), x.e = NaN, x.d = null, x;if (isHex.test(str)) base = 16, str = str.toLowerCase();else if (isBinary.test(str)) base = 2;else if (isOctal.test(str)) base = 8;else throw Error(invalidArgument + str);for (i = str.search(/p/i), 0 < i ? (p = +str.slice(i + 1), str = str.substring(2, i)) : str = str.slice(2), i = str.indexOf("."), isFloat = 0 <= i, Ctor = x.constructor, isFloat && (str = str.replace(".", ""), len = str.length, i = len - i, divisor = intPow(Ctor, new Ctor(base), i, 2 * i)), xd = convertBase(str, base, BASE), xe = xd.length - 1, i = xe; 0 === xd[i]; --i) xd.pop();return 0 > i ? new Ctor(0 * x.s) : (x.e = getBase10Exponent(xd, xe), x.d = xd, external = !1, isFloat && (x = divide(x, divisor, 4 * len)), p && (x = x.times(54 > Math.abs(p) ? mathpow(2, p) : Decimal.pow(2, p))), external = !0, x);}function sine(Ctor, x) {var k,len = x.d.length;if (3 > len) return taylorSeries(Ctor, 2, x, x);k = 1.4 * Math.sqrt(len), k = 16 < k ? 16 : 0 | k, x = x.times(1 / tinyPow(5, k)), x = taylorSeries(Ctor, 2, x, x);for (var sin2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); k--;) sin2_x = x.times(x), x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));return x;}function taylorSeries(Ctor, n, x, y, isHyperbolic) {var j,t,u,x2,i = 1,pr = Ctor.precision,k = Math.ceil(pr / LOG_BASE);for (external = !1, x2 = x.times(x), u = new Ctor(y);;) {if (t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1), u = isHyperbolic ? y.plus(t) : y.minus(t), y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1), t = u.plus(y), void 0 !== t.d[k]) {for (j = k; t.d[j] === u.d[j] && j--;);if (-1 == j) break;}j = u, u = y, y = t, t = j, i++;}return external = !0, t.d.length = k + 1, t;}function tinyPow(b, e) {for (var n = b; --e;) n *= b;return n;}function toLessThanHalfPi(Ctor, x) {var t,isNeg = 0 > x.s,pi = getPi(Ctor, Ctor.precision, 1),halfPi = pi.times(.5);if (x = x.abs(), x.lte(halfPi)) return quadrant = isNeg ? 4 : 1, x;if (t = x.divToInt(pi), t.isZero()) quadrant = isNeg ? 3 : 2;else {if (x = x.minus(t.times(pi)), x.lte(halfPi)) return quadrant = isOdd(t) ? isNeg ? 2 : 3 : isNeg ? 4 : 1, x;quadrant = isOdd(t) ? isNeg ? 1 : 4 : isNeg ? 3 : 2;}return x.minus(pi).abs();}function toStringBinary(x, baseOut, sd, rm) {var base,e,i,k,len,roundUp,str,xd,y,Ctor = x.constructor,isExp = void 0 !== sd;if (isExp ? (checkInt32(sd, 1, MAX_DIGITS), void 0 === rm ? rm = Ctor.rounding : checkInt32(rm, 0, 8)) : (sd = Ctor.precision, rm = Ctor.rounding), !x.isFinite()) str = nonFiniteToString(x);else {for (str = finiteToString(x), i = str.indexOf("."), isExp ? (base = 2, 16 == baseOut ? sd = 4 * sd - 3 : 8 == baseOut && (sd = 3 * sd - 2)) : base = baseOut, 0 <= i && (str = str.replace(".", ""), y = new Ctor(1), y.e = str.length - i, y.d = convertBase(finiteToString(y), 10, base), y.e = y.d.length), xd = convertBase(str, 10, base), e = len = xd.length; 0 == xd[--len];) xd.pop();if (!xd[0]) str = isExp ? "0p+0" : "0";else {if (0 > i ? e-- : (x = new Ctor(x), x.d = xd, x.e = e, x = divide(x, y, sd, rm, 0, base), xd = x.d, e = x.e, roundUp = inexact), i = xd[sd], k = base / 2, roundUp = roundUp || void 0 !== xd[sd + 1], roundUp = 4 > rm ? (void 0 !== i || roundUp) && (0 === rm || rm === (0 > x.s ? 3 : 2)) : i > k || i === k && (4 === rm || roundUp || 6 === rm && 1 & xd[sd - 1] || rm === (0 > x.s ? 8 : 7)), xd.length = sd, roundUp) for (; ++xd[--sd] > base - 1;) xd[sd] = 0, sd || (++e, xd.unshift(1));for (len = xd.length; !xd[len - 1]; --len);for (i = 0, str = ""; i < len; i++) str += NUMERALS.charAt(xd[i]);if (isExp) {if (1 < len) if (16 == baseOut || 8 == baseOut) {for (i = 16 == baseOut ? 4 : 3, --len; len % i; len++) str += "0";for (xd = convertBase(str, base, baseOut), len = xd.length; !xd[len - 1]; --len);for (i = 1, str = "1."; i < len; i++) str += NUMERALS.charAt(xd[i]);} else str = str.charAt(0) + "." + str.slice(1);str = str + (0 > e ? "p" : "p+") + e;} else if (0 > e) {for (; ++e;) str = "0" + str;str = "0." + str;} else if (++e > len) for (e -= len; e--;) str += "0";else e < len && (str = str.slice(0, e) + "." + str.slice(e));}str = (16 == baseOut ? "0x" : 2 == baseOut ? "0b" : 8 == baseOut ? "0o" : "") + str;}return 0 > x.s ? "-" + str : str;}function truncate(arr, len) {if (arr.length > len) return arr.length = len, !0;}function abs(x) {return new this(x).abs();}function acos(x) {return new this(x).acos();}function acosh(x) {return new this(x).acosh();}function add(x, y) {return new this(x).plus(y);}function asin(x) {return new this(x).asin();}function asinh(x) {return new this(x).asinh();}function atan(x) {return new this(x).atan();}function atanh(x) {return new this(x).atanh();}function atan2(y, x) {y = new this(y), x = new this(x);var r,pr = this.precision,rm = this.rounding,wpr = pr + 4;return y.s && x.s ? y.d || x.d ? !x.d || y.isZero() ? (r = 0 > x.s ? getPi(this, pr, rm) : new this(0), r.s = y.s) : !y.d || x.isZero() ? (r = getPi(this, wpr, 1).times(.5), r.s = y.s) : 0 > x.s ? (this.precision = wpr, this.rounding = 1, r = this.atan(divide(y, x, wpr, 1)), x = getPi(this, wpr, 1), this.precision = pr, this.rounding = rm, r = 0 > y.s ? r.minus(x) : r.plus(x)) : r = this.atan(divide(y, x, wpr, 1)) : (r = getPi(this, wpr, 1).times(0 < x.s ? .25 : .75), r.s = y.s) : r = new this(NaN), r;}function cbrt(x) {return new this(x).cbrt();}function ceil(x) {return finalise(x = new this(x), x.e + 1, 2);}function config(obj) {if (!obj || "object" != typeof obj) throw Error("[DecimalError] Object expected");var i,p,v,useDefaults = !0 === obj.defaults,ps = ["precision", 1, MAX_DIGITS, "rounding", 0, 8, "toExpNeg", -9000000000000000, 0, "toExpPos", 0, EXP_LIMIT, "maxE", 0, EXP_LIMIT, "minE", -9000000000000000, 0, "modulo", 0, 9];for (i = 0; i < ps.length; i += 3) if ((p = ps[i], useDefaults) && (this[p] = DEFAULTS[p]), void 0 !== (v = obj[p])) if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;else throw Error(invalidArgument + p + ": " + v);if ((p = "crypto", useDefaults) && (this[p] = DEFAULTS[p]), void 0 !== (v = obj[p])) if (!0 !== v && !1 !== v && 0 !== v && 1 !== v) throw Error(invalidArgument + p + ": " + v);else if (!v) this[p] = !1;else if ("undefined" != typeof crypto && crypto && (crypto.getRandomValues || crypto.randomBytes)) this[p] = !0;else throw Error(cryptoUnavailable);return this;}function cos(x) {return new this(x).cos();}function cosh(x) {return new this(x).cosh();}function clone(obj) {function Decimal(v) {var e,i,t,x = this;if (!(x instanceof Decimal)) return new Decimal(v);if (x.constructor = Decimal, v instanceof Decimal) return x.s = v.s, void (external ? !v.d || v.e > Decimal.maxE ? (x.e = NaN, x.d = null) : v.e < Decimal.minE ? (x.e = 0, x.d = [0]) : (x.e = v.e, x.d = v.d.slice()) : (x.e = v.e, x.d = v.d ? v.d.slice() : v.d));if (t = typeof v, "number" === t) {if (0 === v) return x.s = 0 > 1 / v ? -1 : 1, x.e = 0, void (x.d = [0]);if (0 > v ? (v = -v, x.s = -1) : x.s = 1, v === ~~v && 1e7 > v) {for (e = 0, i = v; 10 <= i; i /= 10) e++;return void (external ? e > Decimal.maxE ? (x.e = NaN, x.d = null) : e < Decimal.minE ? (x.e = 0, x.d = [0]) : (x.e = e, x.d = [v]) : (x.e = e, x.d = [v]));}return 0 == 0 * v ? parseDecimal(x, v.toString()) : (v || (x.s = NaN), x.e = NaN, void (x.d = null));}if ("string" !== t) throw Error(invalidArgument + v);return 45 === (i = v.charCodeAt(0)) ? (v = v.slice(1), x.s = -1) : (43 === i && (v = v.slice(1)), x.s = 1), isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);}var i, p, ps;if (Decimal.prototype = P, Decimal.ROUND_UP = 0, Decimal.ROUND_DOWN = 1, Decimal.ROUND_CEIL = 2, Decimal.ROUND_FLOOR = 3, Decimal.ROUND_HALF_UP = 4, Decimal.ROUND_HALF_DOWN = 5, Decimal.ROUND_HALF_EVEN = 6, Decimal.ROUND_HALF_CEIL = 7, Decimal.ROUND_HALF_FLOOR = 8, Decimal.EUCLID = 9, Decimal.config = Decimal.set = config, Decimal.clone = clone, Decimal.isDecimal = isDecimalInstance, Decimal.abs = abs, Decimal.acos = acos, Decimal.acosh = acosh, Decimal.add = add, Decimal.asin = asin, Decimal.asinh = asinh, Decimal.atan = atan, Decimal.atanh = atanh, Decimal.atan2 = atan2, Decimal.cbrt = cbrt, Decimal.ceil = ceil, Decimal.cos = cos, Decimal.cosh = cosh, Decimal.div = div, Decimal.exp = exp, Decimal.floor = floor, Decimal.hypot = hypot, Decimal.ln = ln, Decimal.log = log, Decimal.log10 = log10, Decimal.log2 = log2, Decimal.max = max, Decimal.min = min, Decimal.mod = mod, Decimal.mul = mul, Decimal.pow = pow, Decimal.random = random, Decimal.round = round, Decimal.sign = sign, Decimal.sin = sin, Decimal.sinh = sinh, Decimal.sqrt = sqrt, Decimal.sub = sub, Decimal.tan = tan, Decimal.tanh = tanh, Decimal.trunc = trunc, void 0 === obj && (obj = {}), obj && !0 !== obj.defaults) for (ps = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], i = 0; i < ps.length;) obj.hasOwnProperty(p = ps[i++]) || (obj[p] = this[p]);return Decimal.config(obj), Decimal;}function div(x, y) {return new this(x).div(y);}function exp(x) {return new this(x).exp();}function floor(x) {return finalise(x = new this(x), x.e + 1, 3);}function hypot() {var i,n,t = new this(0);for (external = !1, i = 0; i < arguments.length;) if (n = new this(arguments[i++]), !n.d) {if (n.s) return external = !0, new this(1 / 0);t = n;} else t.d && (t = t.plus(n.times(n)));return external = !0, t.sqrt();}function isDecimalInstance(obj) {return obj instanceof Decimal || obj && "[object Decimal]" === obj.name || !1;}function ln(x) {return new this(x).ln();}function log(x, y) {return new this(x).log(y);}function log2(x) {return new this(x).log(2);}function log10(x) {return new this(x).log(10);}function max() {return maxOrMin(this, arguments, "lt");}function min() {return maxOrMin(this, arguments, "gt");}function mod(x, y) {return new this(x).mod(y);}function mul(x, y) {return new this(x).mul(y);}function pow(x, y) {return new this(x).pow(y);}function random(sd) {var d,e,k,n,i = 0,r = new this(1),rd = [];if (void 0 === sd ? sd = this.precision : checkInt32(sd, 1, MAX_DIGITS), k = Math.ceil(sd / LOG_BASE), !this.crypto) for (; i < k;) rd[i++] = 0 | 1e7 * Math.random();else if (crypto.getRandomValues) for (d = crypto.getRandomValues(new Uint32Array(k)); i < k;) n = d[i], 429e7 <= n ? d[i] = crypto.getRandomValues(new Uint32Array(1))[0] : rd[i++] = n % 1e7;else if (crypto.randomBytes) {for (d = crypto.randomBytes(k *= 4); i < k;) n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((127 & d[i + 3]) << 24), 214e7 <= n ? crypto.randomBytes(4).copy(d, i) : (rd.push(n % 1e7), i += 4);i = k / 4;} else throw Error(cryptoUnavailable);for (k = rd[--i], sd %= LOG_BASE, k && sd && (n = mathpow(10, LOG_BASE - sd), rd[i] = (0 | k / n) * n); 0 === rd[i]; i--) rd.pop();if (0 > i) e = 0, rd = [0];else {for (e = -1; 0 === rd[0]; e -= LOG_BASE) rd.shift();for (k = 1, n = rd[0]; 10 <= n; n /= 10) k++;k < LOG_BASE && (e -= LOG_BASE - k);}return r.e = e, r.d = rd, r;}function round(x) {return finalise(x = new this(x), x.e + 1, this.rounding);}function sign(x) {return x = new this(x), x.d ? x.d[0] ? x.s : 0 * x.s : x.s || NaN;}function sin(x) {return new this(x).sin();}function sinh(x) {return new this(x).sinh();}function sqrt(x) {return new this(x).sqrt();}function sub(x, y) {return new this(x).sub(y);}function tan(x) {return new this(x).tan();}function tanh(x) {return new this(x).tanh();}function trunc(x) {return finalise(x = new this(x), x.e + 1, 1);}P[Symbol.for("nodejs.util.inspect.custom")] = P.toString, P[Symbol.toStringTag] = "Decimal";var Decimal = clone(DEFAULTS);LN10 = new Decimal(LN10), PI = new Decimal(PI);/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Decimal);

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			loaded: false,
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/amd define */
/******/ 	(() => {
/******/ 		__webpack_require__.amdD = function () {
/******/ 			throw new Error('define cannot be used indirect');
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/amd options */
/******/ 	(() => {
/******/ 		__webpack_require__.amdO = {};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/node module decorator */
/******/ 	(() => {
/******/ 		__webpack_require__.nmd = (module) => {
/******/ 			module.paths = [];
/******/ 			if (!module.children) module.children = [];
/******/ 			return module;
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.at.js
var es_array_at = __webpack_require__("./node_modules/core-js/modules/es.array.at.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.from-async.js
var esnext_array_from_async = __webpack_require__("./node_modules/core-js/modules/esnext.array.from-async.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.filter-out.js
var esnext_array_filter_out = __webpack_require__("./node_modules/core-js/modules/esnext.array.filter-out.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.filter-reject.js
var esnext_array_filter_reject = __webpack_require__("./node_modules/core-js/modules/esnext.array.filter-reject.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.find-last.js
var esnext_array_find_last = __webpack_require__("./node_modules/core-js/modules/esnext.array.find-last.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.find-last-index.js
var esnext_array_find_last_index = __webpack_require__("./node_modules/core-js/modules/esnext.array.find-last-index.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.group-by.js
var esnext_array_group_by = __webpack_require__("./node_modules/core-js/modules/esnext.array.group-by.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.is-template-object.js
var esnext_array_is_template_object = __webpack_require__("./node_modules/core-js/modules/esnext.array.is-template-object.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.last-index.js
var esnext_array_last_index = __webpack_require__("./node_modules/core-js/modules/esnext.array.last-index.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.last-item.js
var esnext_array_last_item = __webpack_require__("./node_modules/core-js/modules/esnext.array.last-item.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.array.unique-by.js
var esnext_array_unique_by = __webpack_require__("./node_modules/core-js/modules/esnext.array.unique-by.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.at-alternative.js
var es_string_at_alternative = __webpack_require__("./node_modules/core-js/modules/es.string.at-alternative.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.string.at.js
var esnext_string_at = __webpack_require__("./node_modules/core-js/modules/esnext.string.at.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.string.code-points.js
var esnext_string_code_points = __webpack_require__("./node_modules/core-js/modules/esnext.string.code-points.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.clamp.js
var esnext_math_clamp = __webpack_require__("./node_modules/core-js/modules/esnext.math.clamp.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.deg-per-rad.js
var esnext_math_deg_per_rad = __webpack_require__("./node_modules/core-js/modules/esnext.math.deg-per-rad.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.degrees.js
var esnext_math_degrees = __webpack_require__("./node_modules/core-js/modules/esnext.math.degrees.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.fscale.js
var esnext_math_fscale = __webpack_require__("./node_modules/core-js/modules/esnext.math.fscale.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.iaddh.js
var esnext_math_iaddh = __webpack_require__("./node_modules/core-js/modules/esnext.math.iaddh.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.imulh.js
var esnext_math_imulh = __webpack_require__("./node_modules/core-js/modules/esnext.math.imulh.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.isubh.js
var esnext_math_isubh = __webpack_require__("./node_modules/core-js/modules/esnext.math.isubh.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.rad-per-deg.js
var esnext_math_rad_per_deg = __webpack_require__("./node_modules/core-js/modules/esnext.math.rad-per-deg.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.radians.js
var esnext_math_radians = __webpack_require__("./node_modules/core-js/modules/esnext.math.radians.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.scale.js
var esnext_math_scale = __webpack_require__("./node_modules/core-js/modules/esnext.math.scale.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.seeded-prng.js
var esnext_math_seeded_prng = __webpack_require__("./node_modules/core-js/modules/esnext.math.seeded-prng.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.signbit.js
var esnext_math_signbit = __webpack_require__("./node_modules/core-js/modules/esnext.math.signbit.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.math.umulh.js
var esnext_math_umulh = __webpack_require__("./node_modules/core-js/modules/esnext.math.umulh.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.has-own.js
var es_object_has_own = __webpack_require__("./node_modules/core-js/modules/es.object.has-own.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.reflect.to-string-tag.js
var es_reflect_to_string_tag = __webpack_require__("./node_modules/core-js/modules/es.reflect.to-string-tag.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.object.iterate-entries.js
var esnext_object_iterate_entries = __webpack_require__("./node_modules/core-js/modules/esnext.object.iterate-entries.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.object.iterate-keys.js
var esnext_object_iterate_keys = __webpack_require__("./node_modules/core-js/modules/esnext.object.iterate-keys.js");
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.object.iterate-values.js
var esnext_object_iterate_values = __webpack_require__("./node_modules/core-js/modules/esnext.object.iterate-values.js");
// EXTERNAL MODULE: ./src/main.js
var main = __webpack_require__("./src/main.js");
// EXTERNAL MODULE: ./src/mod_babylon.js + 53 modules
var mod_babylon = __webpack_require__("./src/mod_babylon.js");
// EXTERNAL MODULE: ./src/attributes.js
var attributes = __webpack_require__("./src/attributes.js");
// EXTERNAL MODULE: ./src/util.js + 917 modules
var util = __webpack_require__("./src/util.js");
;// CONCATENATED MODULE: ./src/mod_mv.js



const mz3d = window.mz3d;

//setup was here	

const _graphics_updateAllElements = Graphics._updateAllElements;
Graphics._updateAllElements = function () {
  _graphics_updateAllElements.apply(this, arguments);
  if (mz3d.canvas) {
    mz3d.updateCanvas();
  }
};

const _sceneMap_update = Scene_Map.prototype.update;
Scene_Map.prototype.update = function () {
  _sceneMap_update.apply(this, arguments);
  if (!mz3d.isDisabled()) {
    mz3d.update();
    if (!mz3d._renderLoopStarted && !mz3d.isWebGPU()) {
      mz3d.render();
    }
  }
};

const _createTilemap = Spriteset_Map.prototype.createTilemap;
Spriteset_Map.prototype.createTilemap = function () {
  _createTilemap.apply(this, arguments);
  mz3d.mapDisabled = mz3d.isDisabled();
  mz3d.pixiSprite = new PIXI.Sprite(mz3d.texture);
  mz3d.pixiSprite.scale.set(1 / mz3d.RES_SCALE, 1 / mz3d.RES_SCALE);
  mz3d.pixiContainer = new PIXI.Container();
  mz3d.viewContainer = new PIXI.Container();
  mz3d.pixiContainer.addChild(mz3d.viewContainer);
  mz3d.viewContainer.addChild(mz3d.pixiSprite);
  mz3d.mv_baseSprite = this._baseSprite;
  if (!mz3d.mapDisabled) {
    this._tilemap.visible = false;
    this._baseSprite.addChild(mz3d.pixiContainer);
  }
};

const _sprite_char_setchar = Sprite_Character.prototype.setCharacter;
Sprite_Character.prototype.setCharacter = function (character) {
  _sprite_char_setchar.apply(this, arguments);
  Object.defineProperty(character, 'mv_sprite', {
    value: this,
    configurable: true,
    enumerable: false });

};

// Player Transfer

const _performTransfer = Game_Player.prototype.performTransfer;
Game_Player.prototype.performTransfer = function () {
  const newmap = this._newMapId !== $gameMap.mapId();
  _performTransfer.apply(this, arguments);
  if (mz3d.is1stPerson()) {
    mz3d.blendCameraYaw.setValue(mz3d.dirToYaw($gamePlayer.direction(), 0));
  }
  if (!newmap) {
    this.z = mz3d.getWalkHeight(this.x, this.y);
    for (const follower of this._followers._data) {
      follower.z = this.z;
    }
  }
};

const _fadeInForTransfer = Scene_Map.prototype.fadeInForTransfer;
Scene_Map.prototype.fadeInForTransfer = function () {
  _fadeInForTransfer.apply(this, arguments);
  mz3d.updateBlenders(true);
};

// On Map Load

let tilesetLoaded = false;

const _onMapLoaded = Scene_Map.prototype.onMapLoaded;
Scene_Map.prototype.onMapLoaded = function () {
  const newmap = this._transfer && $gamePlayer._newMapId !== $gameMap.mapId();
  Input.clear();
  if (newmap || mz3d.needClearMap) {
    mz3d.clearMap();
    mz3d.needClearMap = false;
  } else if (mz3d.needReloadMap && mz3d.mapLoaded) {
    mz3d.reloadMap();
  }
  mz3d.needReloadMap = false;

  if (!mz3d.mapLoaded) {
    mz3d.beforeMapLoad(newmap);
    mz3d.loadMapSettings();
  }
  if (newmap || !mz3d.mapLoaded) {
    mz3d.tilesetLoaded = false;
  }
  _onMapLoaded.apply(this, arguments);
  if (!tilesetLoaded) {mz3d.loadTilesetSettings();}
  if (!mz3d.mapLoaded) {
    if (newmap) {mz3d.applyMapSettings();}
    mz3d.afterMapLoad(newmap);
    if (mz3d.isDisabled()) {
      mz3d.mapReady = true;
      //mv3d.createCharacters();
    } else {
      mz3d.mapReady = false;
      //mv3d.mapReady=true;
      if (mz3d.tilesetLoaded === 'loading') {
        (0,util.sleepUntil)(() => mz3d.tilesetLoaded === true).then(() => mz3d.loadMap());
      } else {
        mz3d.loadMap();
      }
    }
  }
  mz3d.updateBlenders(true);
};

// onMapLoaded > performTransfer > map setup
// hook into map setup before Qmovement's setup.
const _map_battleback_Setup = Game_Map.prototype.setupBattleback;
Game_Map.prototype.setupBattleback = function () {
  _map_battleback_Setup.apply(this, arguments);
  if (!mz3d.tilesetLoaded) {
    mz3d.loadTilesetSettings();
  }
};

const _onLoadSuccess = Scene_Load.prototype.onLoadSuccess;
Scene_Load.prototype.onLoadSuccess = function () {
  _onLoadSuccess.apply(this, arguments);
  mz3d.needClearMap = true;
  attributes/* Attribute.onLoad */.a.onLoad();
};

const _map_isReady = Scene_Map.prototype.isReady;
Scene_Map.prototype.isReady = function () {
  let ready = _map_isReady.apply(this, arguments);
  return ready && mz3d.mapReady;
};

// Title

const _title_start = Scene_Title.prototype.start;
Scene_Title.prototype.start = function () {
  _title_start.apply(this, arguments);
  mz3d.clearMap();
  mz3d.clearCameraTarget();
};

const _initGraphics = SceneManager.initGraphics;
SceneManager.initGraphics = function () {
  _initGraphics.apply(this, arguments);
  if (mz3d.isMV && !Graphics.isWebGL()) {
    throw new Error("MV3D requires WebGL");
  }
};

// force webgl
SceneManager.preferableRendererType = function () {
  if (Utils.isOptionValid('canvas')) {
    return 'canvas';
  } else if (Utils.isOptionValid('webgl')) {
    return 'webgl';
  } else {
    if (Graphics.hasWebGL()) {return 'webgl';}
    return 'auto';
  }
};

const _jsonex_decode = JsonEx._decode;
JsonEx._decode = function (value) {
  value = _jsonex_decode.apply(this, arguments);
  const type = Object.prototype.toString.call(value);
  if (type === "[object Object]" || type === "[object Array]") {
    if (value["@"] && !window[value["@"]] && (value.constructor === Object || value.constructor === Array)) {
      const constructor = BABYLON[value["@"]];
      if (constructor) {
        Object.setPrototypeOf(value, constructor.prototype);
        delete value["@"];
      }
    }
  }
  return value;
};
// EXTERNAL MODULE: ./src/parameters.js
var parameters = __webpack_require__("./src/parameters.js");
// EXTERNAL MODULE: ./src/blenders.js
var blenders = __webpack_require__("./src/blenders.js");
// EXTERNAL MODULE: ./src/blendModes.js
var blendModes = __webpack_require__("./src/blendModes.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/index.js + 828 modules
var core = __webpack_require__("./node_modules/@babylonjs/core/index.js");
;// CONCATENATED MODULE: ./src/input.js
const input_mz3d = window.mz3d;



input_mz3d._gamepadStick = {
  left: new core.Vector2(0, 0),
  right: new core.Vector2(0, 0) };



input_mz3d._touchState = {
  lastX: 0,
  lastY: 0,
  isTouching: false };


(0,util.override)(Input, '_pollGamepads', (o) => function (gamepad) {
  input_mz3d._gamepadStick.left.x = 0;
  input_mz3d._gamepadStick.left.y = 0;
  input_mz3d._gamepadStick.right.x = 0;
  input_mz3d._gamepadStick.right.y = 0;
  o.apply(this, arguments);
}, true);

(0,util.override)(Input, '_updateGamepadState', (o) => function (gamepad) {
  o.apply(this, arguments);
  const threshold = 0.1;
  const max = 1 - threshold;
  const axes = gamepad.axes;
  if (Math.abs(axes[0]) > threshold) {
    input_mz3d._gamepadStick.left.x += (axes[0] - Math.sign(axes[0]) * threshold) / max;
  }
  if (Math.abs(axes[1]) > threshold) {
    input_mz3d._gamepadStick.left.y -= (axes[1] - Math.sign(axes[1]) * threshold) / max;
  }
  if (Math.abs(axes[2]) > threshold) {
    input_mz3d._gamepadStick.right.x += (axes[2] - Math.sign(axes[2]) * threshold) / max;
  }
  if (Math.abs(axes[3]) > threshold) {
    input_mz3d._gamepadStick.right.y -= (axes[3] - Math.sign(axes[3]) * threshold) / max;
  }
});

Object.assign(input_mz3d, {
  updateInput() {
    input_mz3d.updateInputCamera();
  },

  updateInputCamera() {
    if (this.isDisabled() || this.lockCamera || !$gamePlayer.canMove()) {return;}
    const is1stPerson = this.is1stPerson();
    const allowRotation = this.allowRotation || is1stPerson;
    const allowPitch = this.allowPitch;
    if (allowRotation) {
      const leftKey = input_mz3d.getTurnKey('left'),rightKey = input_mz3d.getTurnKey('right');
      if (input_mz3d.TURN_INCREMENT > 1) {
        const turning = this.blendCameraYaw.currentValue() !== this.blendCameraYaw.targetValue() || !isFinite(this.turnSpeed);
        const turnTime = input_mz3d.turnIncrement / input_mz3d.turnSpeed;
        if (Input.isTriggered(leftKey) || Input.isPressed(leftKey) && !turning) {
          this.blendCameraYaw.inputValue(input_mz3d.TURN_INCREMENT, turnTime, false);
        } else if (Input.isTriggered(rightKey) || Input.isPressed(rightKey) && !turning) {
          this.blendCameraYaw.inputValue(-input_mz3d.TURN_INCREMENT, turnTime, false);
        }
      } else {
        const increment = input_mz3d.turnSpeed / 60;
        if (Input.isPressed(leftKey) && Input.isPressed(rightKey)) {
          // do nothing
        } else if (Input.isPressed(leftKey)) {
          this.blendCameraYaw.inputValue(increment, 0.1);
        } else if (Input.isPressed(rightKey)) {
          this.blendCameraYaw.inputValue(-increment, 0.1);
        }
      }
    }
    if (allowPitch) {
      const increment = input_mz3d.PITCH_SPEED / 60;
      if (Input.isPressed('pageup') && Input.isPressed('pagedown')) {
        // do nothing
      } else if (Input.isPressed('pageup')) {
        this.blendCameraPitch.inputValue(increment, 0.1);
      } else if (Input.isPressed('pagedown')) {
        this.blendCameraPitch.inputValue(-increment, 0.1);
      }
    }

    if (input_mz3d.inputCameraGamepad) {
      if (input_mz3d._gamepadStick.right.x && allowRotation) {
        if (isFinite(input_mz3d.turnSpeed)) {
          const increment = input_mz3d.turnSpeed / 60 * input_mz3d.lookSensitivity;
          this.blendCameraYaw.inputValue(-input_mz3d._gamepadStick.right.x * increment, 0.1);
        } else {
          this.blendCameraYaw.inputValue(-Math.sign(input_mz3d._gamepadStick.right.x) * input_mz3d.turnIncrement, 0);
        }
      }
      if (input_mz3d._gamepadStick.right.y && allowPitch) {
        const increment = input_mz3d.PITCH_SPEED / 60 * input_mz3d.lookSensitivity;
        this.blendCameraPitch.inputValue(input_mz3d._gamepadStick.right.y * increment * (input_mz3d.invertY * -2 + 1), 0.1);
      }
    }

    if (input_mz3d.inputCameraMouse) {
      input_mz3d._touchState.isTapped = !TouchInput._screenPressed && input_mz3d._touchState.touchCount > 0 && input_mz3d._touchState.touchCount < 15 && Math.abs(input_mz3d._touchState.deltaX) < 5 && Math.abs(input_mz3d._touchState.deltaY) < 5;
      if (TouchInput._screenPressed) {
        if (input_mz3d._touchState.isTouching) {
          input_mz3d._touchState.deltaX = TouchInput.x - input_mz3d._touchState.lastX;
          input_mz3d._touchState.deltaY = TouchInput.y - input_mz3d._touchState.lastY;
          if (input_mz3d._touchState.deltaX && allowRotation) {
            const increment = input_mz3d._touchState.deltaX / Graphics.width * 180;
            this.blendCameraYaw.inputValue(-increment * input_mz3d.lookSensitivity, 0.1);
          }
          if (input_mz3d._touchState.deltaY && allowPitch) {
            const increment = input_mz3d._touchState.deltaY / Graphics.width * 180;
            this.blendCameraPitch.inputValue(-increment * input_mz3d.lookSensitivity * (input_mz3d.invertY * -2 + 1), 0.1);
          }
          ++input_mz3d._touchState.touchCount;
        } else {
          input_mz3d._touchState.isTouching = true;
        }
      } else {
        input_mz3d._touchState.isTouching = false;
        input_mz3d._touchState.touchCount = 0;
      }
      input_mz3d._touchState.lastX = TouchInput.x;
      input_mz3d._touchState.lastY = TouchInput.y;
    }
  },

  getStrafeKey(keyname) {
    if (input_mz3d.is1stPerson()) {
      switch (input_mz3d.KEYBOARD_STRAFE) {
        case 'QE':return 'rot' + keyname;
        case 'AD':return keyname;
        default:return false;}

    } else {
      switch (input_mz3d.KEYBOARD_TURN) {
        case 'QE':return keyname;
        case 'AD':return 'rot' + keyname;
        default:return keyname;}

    }
  },

  getTurnKey(keyname) {
    if (input_mz3d.is1stPerson()) {
      switch (input_mz3d.KEYBOARD_STRAFE) {
        case 'QE':return keyname;
        case 'AD':return 'rot' + keyname;
        default:return keyname;}

    } else {
      switch (input_mz3d.KEYBOARD_TURN) {
        case 'QE':return 'rot' + keyname;
        case 'AD':return keyname;
        default:return 'rot' + keyname;}

    }
  } });


(0,util.override)(Input, '_signX', (o) => function _signX() {
  if (!input_mz3d.KEYBOARD_STRAFE && input_mz3d.is1stPerson()) {return 0;}
  const leftKey = input_mz3d.getStrafeKey('left'),rightKey = input_mz3d.getStrafeKey('right');

  let x = 0;
  if (input_mz3d.instantMovement) {
    if (this.isTriggered(leftKey)) {--x;}
    if (this.isTriggered(rightKey)) {++x;}
  } else {
    if (this.isPressed(leftKey)) {--x;}
    if (this.isPressed(rightKey)) {++x;}
  }
  return x;
});

(0,util.override)(Input, '_signY', (o) => function () {
  const up = this.isTriggered("up") ? 1 : 0;
  const down = this.isTriggered("down") ? 1 : 0;
  return down - up;
}, () => !input_mz3d.isDisabled() && input_mz3d.instantMovement);

(0,util.override)(Game_Player.prototype, 'realMoveSpeed', (o) => function () {
  return Infinity;
}, () => !input_mz3d.isDisabled() && input_mz3d.instantMovement);

(0,util.override)(Game_Vehicle.prototype, 'realMoveSpeed', (o) => function () {
  if ($gamePlayer.vehicle() !== this) {return o.apply(this, arguments);}
  return Infinity;
}, () => !input_mz3d.isDisabled() && input_mz3d.instantMovement);

(0,util.override)(Game_Player.prototype, "increaseSteps", (o) => function () {
  this.mv3d_temp._startedMoving = true;
  o.apply(this, arguments);
}, true);

(0,util.override)(Game_Player.prototype, "update", (o) => function () {
  o.apply(this, arguments);
  this.mv3d_temp._startedMoving = false;
}, true);

(0,util.override)(Game_Player.prototype, "isMoving", (o) => function () {
  if (o.apply(this, arguments)) {return true;}
  if (this.mv3d_temp._startedMoving) {
    return true;
  }
  return false;
}, () => input_mz3d.instantMovement);

input_mz3d.setupInput = function () {
  if (!input_mz3d.WASD) {return;}
  Object.assign(Input.keyMapper, {
    81: 'rotleft', // Q
    69: 'rotright', // E
    87: 'up', // W
    65: 'left', // A
    83: 'down', // S
    68: 'right' // D
  });

  if (input_mz3d.GAMEPAD_TURN_BUTTON) {
    Object.assign(Input.gamepadMapper, input_mz3d.GAMEPAD_TURN_BUTTON === 1 ? {
      4: 'rotleft', // LB
      5: 'rotright', // RB
      6: 'pageup', // LT
      7: 'pagedown' // RT
    } : {
      4: 'pageup', // LB
      5: 'pagedown', // RB
      6: 'rotleft', // LT
      7: 'rotright' // RT
    });
  }
  const descriptors = {
    rotleft: getInputDescriptor('pageup', 'rotleft', 'rotleft'),
    rotright: getInputDescriptor('pagedown', 'rotright', 'rotright') };

  Object.defineProperties(Input.keyMapper, {
    81: descriptors.rotleft, //Q
    69: descriptors.rotright //E
  });
};

function getInputDescriptor(menumode, p3mode, p1mode) {
  let assignedValue = undefined;
  return {
    configurable: true,
    get() {
      if (assignedValue != undefined) {return assignedValue;}
      if (!(SceneManager._scene instanceof Scene_Map)) {return menumode;}
      if (input_mz3d.isDisabled()) {return p3mode;}
      if (input_mz3d.is1stPerson()) {return p1mode;}
      return p3mode;
    },
    set(v) {assignedValue = v;} };

}

const _getInputDirection = Game_Player.prototype.getInputDirection;
Game_Player.prototype.getInputDirection = function () {
  if (input_mz3d.isDisabled()) {
    if (input_mz3d.DIR8MOVE && input_mz3d.DIR8_2D) {return Input.dir8;}
    return _getInputDirection.apply(this, arguments);
  }
  return input_mz3d.getInputDirection();
};

input_mz3d.getInputDirection = function () {
  let dir = input_mz3d.DIR8MOVE ? Input.dir8 : Input.dir4;
  return input_mz3d.transformDirection(dir, input_mz3d.blendCameraYaw.currentValue());
};


const raycastPredicate = (mesh) => {
  if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) {return false;}
  if (mesh.character) {
    if (mesh.character.isFollower || mesh.character.isPlayer) {return false;}
  }
  return true;
};

const _process_map_touch = Scene_Map.prototype.processMapTouch;
Scene_Map.prototype.processMapTouch = function () {
  if (input_mz3d.isDisabled()) {return _process_map_touch.apply(this, arguments);}
  if (TouchInput.isTriggered() || this._touchCount > 0) {

    if (input_mz3d.inputCameraMouse && !input_mz3d._touchState.isTapped) {
      Graphics._canvas.requestPointerLock().catch(console.error);
      this._touchCount = 0;
      return;
    }

    if (TouchInput.isPressed() || input_mz3d._touchState.isTapped) {

      if (this._touchCount === 0 || this._touchCount >= 15 || input_mz3d._touchState.isTapped) {

        input_mz3d.processMapTouch();

      }
      this._touchCount++;
    } else {
      this._touchCount = 0;
    }
  }
};

input_mz3d.processMapTouch = (0,util.throttle)(function () {
  const intersection = input_mz3d.scene.pick(TouchInput.x * input_mz3d.RES_SCALE, TouchInput.y * input_mz3d.RES_SCALE, raycastPredicate);
  if (intersection.hit) {
    //const point = {x:intersection.pickedPoint.x, y:-intersection.pickedPoint.z};
    const point = intersection.pickedPoint.clone();
    const mesh = intersection.pickedMesh;
    if (mesh.character) {
      if (Math.abs(point.x - mesh.character.x) <= 1 && Math.abs(point.y - mesh.character.y) <= 1) {
        point.$x = mesh.character.x;
        point.$y = mesh.character.y;
        point.$z = mesh.character.z;
      }
    }
    input_mz3d.setDestination(point.$x, point.$y, point.$z);
  }
}, 100);

(0,util.override)(TouchInput, '_onMouseMove', (o) => function (e) {
  const allowRotation = input_mz3d.allowRotation || input_mz3d.is1stPerson();
  const allowPitch = input_mz3d.allowPitch;
  const movementX = e.movementX.clamp(-10, 10);
  const movementY = e.movementY.clamp(-10, 10);
  if (movementX && allowRotation) {
    const increment = movementX / Graphics.width * 180 * input_mz3d.lookSensitivity;
    input_mz3d.blendCameraYaw.inputValue(-increment, 0.1, false);
  }
  if (movementY && allowPitch) {
    const increment = movementY / Graphics.width * 180 * input_mz3d.lookSensitivity;
    input_mz3d.blendCameraPitch.inputValue(-increment * (input_mz3d.invertY * -2 + 1), 0.1, false);
  }
}, () => !input_mz3d.isDisabled() && !input_mz3d.lockCamera && input_mz3d.inputCameraMouse && document.pointerLockElement && input_mz3d.blendCameraYaw);

input_mz3d._relockPointer = false;
(0,util.override)(Scene_Map.prototype, 'isMapTouchOk', (o) => function () {
  const isOk = o.apply(this, arguments);
  if (!isOk || !input_mz3d.inputCameraMouse) {
    if (document.pointerLockElement) {
      document.exitPointerLock();
      input_mz3d._relockPointer = true;
    }
  } else {
    if (!document.pointerLockElement && input_mz3d._relockPointer) {
      Graphics._canvas.requestPointerLock().catch(console.error);
      input_mz3d._relockPointer = false;
    }
    if (Input.isPressed('escape') && document.pointerLockElement) {
      document.exitPointerLock();
      input_mz3d._relockPointer = false;
    }
  }
  return isOk;
}, true);

(0,util.override)(Scene_Map.prototype, 'stop', (o) => function () {
  o.apply(this, arguments);
  document.exitPointerLock();
  if (document.pointerLockElement) {input_mz3d._relockPointer = true;}
}, true);

input_mz3d.setDestination = function (x, y, z) {
  $gameTemp.setDestination(Math.round(x), Math.round(y), z);
};

const _player_findDirectionTo = Game_Player.prototype.findDirectionTo;
Game_Player.prototype.findDirectionTo = function () {
  const dir = _player_findDirectionTo.apply(this, arguments);
  if (input_mz3d.isDisabled()) {return dir;}
  if (input_mz3d.is1stPerson() && !input_mz3d.isVR() && dir) {
    let yaw = input_mz3d.dirToYaw(dir);
    input_mz3d.blendCameraYaw.setValue(yaw, 90 / input_mz3d.turnSpeed);
  }
  return dir;
};
;// CONCATENATED MODULE: ./src/input_directions.js
const input_directions_mz3d = window.mz3d;



Object.assign(input_directions_mz3d, {

  playerFaceYaw() {
    let dir = this.yawToDir(input_directions_mz3d.blendCameraYaw.targetValue(), true);
    $gamePlayer.mv3d_setDirection(dir);
  },

  yawToDir(yaw = input_directions_mz3d.blendCameraYaw.targetValue(), dir8 = false) {
    const divisor = dir8 ? 45 : 90;
    yaw = Math.round(yaw / divisor) * divisor;
    while (yaw < 0) {yaw += 360;}while (yaw >= 360) {yaw -= 360;}
    switch (yaw) {
      case 0:return 8;
      case 45:return 7;
      case 90:return 4;
      case 135:return 1;
      case 180:return 2;
      case 225:return 3;
      case 270:return 6;
      case 315:return 9;
      default:return 0;}

  },

  dirToYaw(dir) {
    switch (dir) {
      case 3:return -135;
      case 6:return -90;
      case 9:return -45;
      case 8:return 0;
      case 7:return 45;
      case 4:return 90;
      case 1:return 135;
      case 2:return 180;
      default:return NaN;}

  },

  transformDirection(dir, yaw = this.blendCameraYaw.currentValue(), dir8 = input_directions_mz3d.DIR8MOVE) {
    return input_directions_mz3d.yawToDir(input_directions_mz3d.dirToYaw(dir) + yaw, dir8);
  },

  transformFacing(dir, yaw = this.blendCameraYaw.currentValue(), dir8 = false) {
    return input_directions_mz3d.yawToDir(input_directions_mz3d.dirToYaw(dir) - yaw, dir8);
  },

  updateDirection() {
    if (input_directions_mz3d.is1stPerson()) {
      input_directions_mz3d.playerFaceYaw();
    }
  } });


let _oldDir = 0;
(0,util.override)(Game_Player.prototype, 'update', (o) => function update() {
  o.apply(this, arguments);
  if (this._direction !== _oldDir) {
    input_directions_mz3d.updateDirection();
    _oldDir = this._direction;
  }
});

(0,util.override)(Game_Player.prototype, 'moveStraight', (o) => function moveStraight() {
  o.apply(this, arguments);
  input_directions_mz3d.updateDirection();
});

(0,util.override)(Game_Player.prototype, 'direction', (o) => function direction() {
  if (input_directions_mz3d.is1stPerson() && this.isMoving() && !this.isDirectionFixed()) {
    return input_directions_mz3d.yawToDir(input_directions_mz3d.blendCameraYaw.targetValue(), false);
  } else {
    return o.apply(this, arguments);
  }
});


const _setDirection = Game_CharacterBase.prototype.setDirection;
Game_CharacterBase.prototype.setDirection = function () {
  _setDirection.apply(this, arguments);
  this.mv3d_data.direction = this._direction;
};
Game_CharacterBase.prototype.mv3d_setDirection = function (d) {
  if (this.isDirectionFixed()) {return;}
  this._direction = input_directions_mz3d.yawToDir(input_directions_mz3d.dirToYaw(d), false);
  if (input_directions_mz3d.DIR8MOVE) {
    this.mv3d_data.direction = d;
  } else {
    this.mv3d_data.direction = this._direction;
  }
};
Game_CharacterBase.prototype.mv3d_direction = function () {
  return this.mv3d_data.direction || this.direction();
};

(0,util.override)(Game_CharacterBase.prototype, 'copyPosition', (o) => function (character) {
  o.apply(this, arguments);
  this.mv3d_data.direction = character.mv3d_data.direction;
});

(0,util.override)(Game_Player.prototype, 'processMoveCommand', (o) => function processMoveCommand(command) {
  o.apply(this, arguments);
  const gc = Game_Character;
  switch (command.code) {
    case gc.ROUTE_TURN_DOWN:
    case gc.ROUTE_TURN_LEFT:
    case gc.ROUTE_TURN_RIGHT:
    case gc.ROUTE_TURN_UP:
    case gc.ROUTE_TURN_90D_R:
    case gc.ROUTE_TURN_90D_L:
    case gc.ROUTE_TURN_180D:
    case gc.ROUTE_TURN_90D_R_L:
    case gc.ROUTE_TURN_RANDOM:
    case gc.ROUTE_TURN_TOWARD:
    case gc.ROUTE_TURN_AWAY:
      let yaw = input_directions_mz3d.dirToYaw(this._direction);
      input_directions_mz3d.blendCameraYaw.setValue(yaw, 0.25);}

}, () => !input_directions_mz3d.isDisabled() && input_directions_mz3d.is1stPerson());
// EXTERNAL MODULE: ./src/configuration.js
var configuration = __webpack_require__("./src/configuration.js");
// EXTERNAL MODULE: ./src/characters.js
var characters = __webpack_require__("./src/characters.js");
;// CONCATENATED MODULE: ./src/plugin_commands.js
const plugin_commands_mz3d = window.mz3d;



const _pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
  if (command.toLowerCase() !== 'mv3d') {
    return _pluginCommand.apply(this, arguments);
  }
  runPluginCommand(this, args);
};

function runPluginCommand(interpreter, args) {
  const pc = new plugin_commands_mz3d.PluginCommand();
  pc.INTERPRETER = interpreter;
  pc.FULL_COMMAND = ['mv3d', ...args].join(' ');
  args = args.filter((v) => v);
  //args=args.join(' ').match(/"[^"]+"|[^\s]+/g).map(a=>a.replace(/^"(.+)"$/,"$1").trim());
  pc.CHAR = $gameMap.event(interpreter._eventId) || $gamePlayer;
  if (args[0]) {
    const firstChar = args[0][0];
    if (firstChar === '@' || firstChar === '＠') {
      pc.CHAR = pc.TARGET_CHAR(args.shift());
    }
  }

  const com = args.shift().toLowerCase();
  if (com in pc) {
    waitPluginCommand(interpreter, pc[com](...args));
  }
}

function waitPluginCommand(interpreter, promise) {
  if (!(promise instanceof Promise)) return;
  interpreter.mv3d_promises ??= [];
  interpreter.mv3d_promises.push(promise);
  interpreter.setWaitMode('mv3d_promise');
  promise.then(() => {
    const index = interpreter.mv3d_promises.indexOf(promise);
    if (index >= 0) interpreter.mv3d_promises.splice(index, 1);
  });
}

const _updateWaitMode = Game_Interpreter.prototype.updateWaitMode;
Game_Interpreter.prototype.updateWaitMode = function () {
  if (this._waitMode === 'mv3d_promise') {var _this$mv3d_promises;
    if ((_this$mv3d_promises = this.mv3d_promises) !== null && _this$mv3d_promises !== void 0 && _this$mv3d_promises.length) return true;
  }
  return _updateWaitMode.apply(this, arguments);
};

plugin_commands_mz3d.PluginCommand = class {
  async animation(id, ...a) {
    const char = (await this.AWAIT_CHAR(this.CHAR)).char;
    char.requestAnimation(id);
    if (plugin_commands_mz3d.isDisabled()) {return;}
    let depth = true,scale = 1;
    for (let i = 0; i < a.length; ++i) {
      switch (a[i].toLowerCase()) {
        case 'depth':if (a[i + 1] != null) depth = (0,util.booleanString)(a[i + 1]);break;
        case 'scale':if (a[i + 1] != null) scale = Number(a[i + 1]);break;}

    }
    char._mv3d_animationSettings = { depth, scale };
  }
  resolution(...a) {
    let i = 0;
    if (a[i].toLowerCase() === 'scale') {++i;}
    let time = this._TIME(a[2]);
    this._RELATIVE_BLEND(plugin_commands_mz3d.blendResolutionScale, a[1], time);
  }
  camera(...a) {
    let time = this._TIME(a[2]);
    switch (a[0].toLowerCase()) {
      case 'pitch':this.pitch(a[1], time);return;
      case 'yaw':this.yaw(a[1], time);return;
      case 'roll':this.roll(a[1], time);return;
      case 'dist':
      case 'distance':this.dist(a[1], time);return;
      case 'zoom':this.zoom(a[1], time);return;
      case 'height':this.height(a[1], time);return;
      case 'mode':this.cameramode(a[1]);return;
      case 'follow':
      case 'target':this._cameraTarget(a[1], time);return;
      case 'track':this._cameraTrack(...a);return;
      case 'pan':this.pan(a[1], a[2], a[3]);return;}

  }
  yaw(deg, time = 1) {
    this._RELATIVE_BLEND(plugin_commands_mz3d.blendCameraYaw, deg, time);
    if (plugin_commands_mz3d.is1stPerson()) {plugin_commands_mz3d.playerFaceYaw();}
  }
  pitch(deg, time = 1) {this._RELATIVE_BLEND(plugin_commands_mz3d.blendCameraPitch, deg, time);}
  roll(deg, time = 1) {this._RELATIVE_BLEND(plugin_commands_mz3d.blendCameraRoll, deg, time);}
  dist(n, time = 1) {this._RELATIVE_BLEND(plugin_commands_mz3d.blendCameraDist, n, time);}
  zoom(n, time = 1) {this._RELATIVE_BLEND(plugin_commands_mz3d.blendCameraZoom, n, time);}
  height(n, time = 1) {this._RELATIVE_BLEND(plugin_commands_mz3d.blendCameraHeight, n, time);}
  _cameraTarget(target, time) {
    plugin_commands_mz3d.setCameraTarget(this.TARGET_CHAR(target), time);
  }
  _cameraTrack(...a) {
    a.shift();
    let mode = 3;
    switch (a[0].toLowerCase()) {
      case 'pitch':mode = 2;a.shift();break;
      case 'yaw':mode = 1;a.shift();break;}

    let target = (0,util.falseString)(a[0]);
    if (target) {target = this.TARGET_CHAR(target);}
    const time = this._TIME(a[1]);
    plugin_commands_mz3d.setCameraTrack(target, time, mode);
  }
  pan(x, y, time = 1) {
    time = this._TIME(time);
    this._RELATIVE_BLEND(plugin_commands_mz3d.blendPanX, x, time);
    this._RELATIVE_BLEND(plugin_commands_mz3d.blendPanY, y, time);
  }

  get rotationmode() {return this.allowrotation;}
  get pitchmode() {return this.allowpitch;}

  allowrotation(b) {plugin_commands_mz3d.allowRotation = (0,util.booleanString)(b);}
  allowpitch(b) {plugin_commands_mz3d.allowPitch = (0,util.booleanString)(b);}
  lockcamera(b) {plugin_commands_mz3d.lockCamera = (0,util.booleanString)(b);}

  cameramode(mode) {plugin_commands_mz3d.cameraMode = mode;}
  fog(...a) {
    var time = this._TIME(a[2]);
    switch (a[0].toLowerCase()) {
      case 'color':this._fogColor(a[1], time);return;
      case 'near':this._fogNear(a[1], time);return;
      case 'far':this._fogFar(a[1], time);return;
      case 'dist':case 'distance':
        time = this._TIME(a[3]);
        this._fogNear(a[1], time);
        this._fogFar(a[2], time);
        return;}

    time = this._TIME(a[3]);
    this._fogColor(a[0], time);
    this._fogNear(a[1], time);
    this._fogFar(a[2], time);
  }
  _fogColor(color, time) {plugin_commands_mz3d.blendFogColor.setValue((0,util.makeColor)(color).toNumber(), time);}
  _fogNear(n, time) {this._RELATIVE_BLEND(plugin_commands_mz3d.blendFogNear, n, time);}
  _fogFar(n, time) {this._RELATIVE_BLEND(plugin_commands_mz3d.blendFogFar, n, time);}
  get ambient() {return this.light;}
  light(...a) {
    var time = this._TIME(a[2]);
    switch (a[0].toLowerCase()) {
      case 'color':this._lightColor(a[1], time);return;
      //case 'intensity': this._lightIntensity(a[1],time); return;
    }
    time = this._TIME(a[1]);
    this._lightColor(a[0], time);
    //this._lightintensity(a[0],time);
  }
  _lightColor(color, time = 1) {plugin_commands_mz3d.blendAmbientColor.setValue((0,util.makeColor)(color).toNumber(), time);}
  //_lightIntensity(n,time=1){ this._RELATIVE_BLEND(mv3d.blendLightIntensity,n,time); }
  async lamp(...a) {
    const char = await this.AWAIT_CHAR(this.CHAR);
    char.setupLamp();
    var time = this._TIME(a[2]);
    switch (a[0].toLowerCase()) {
      case 'color':this._lampColor(char, a[1], time);return;
      case 'intensity':this._lampIntensity(char, a[1], time);return;
      case 'dist':
      case 'distance':this._lampDistance(char, a[1], time);return;
      case 'shadow':this._lampShadow(char);return;}

    time = this._TIME(a[3]);
    this._lampColor(char, a[0], time);
    this._lampIntensity(char, a[1], time);
    this._lampDistance(char, a[2], time);
  }
  _lampColor(char, color, time = 1) {char.blendLampColor.setValue((0,util.makeColor)(color).toNumber(), time);}
  _lampIntensity(char, n, time = 1) {this._RELATIVE_BLEND(char.blendLampIntensity, n, time);}
  _lampDistance(char, n, time = 1) {this._RELATIVE_BLEND(char.blendLampDistance, n, time);}
  _lampShadow(char) {var _char$setupLampShadow;(_char$setupLampShadow = char.setupLampShadow) === null || _char$setupLampShadow === void 0 ? void 0 : _char$setupLampShadow.call(char);}
  async flashlight(...a) {
    const char = await this.AWAIT_CHAR(this.CHAR);
    char.setupFlashlight();
    var time = this._TIME(a[2]);
    switch (a[0].toLowerCase()) {
      case 'color':this._flashlightColor(char, a[1], time);return;
      case 'intensity':this._flashlightIntensity(char, a[1], time);return;
      case 'dist':
      case 'distance':this._flashlightDistance(char, a[1], time);return;
      case 'angle':this._flashlightAngle(char, a[1], time);return;
      case 'yaw':this._flashlightYaw(char, a[1]);return;
      case 'pitch':this._flashlightPitch(char, a[1], time);return;
      case 'shadow':this._flashlightShadow(char);return;}

    time = this._TIME(a[4]);
    this._flashlightColor(char, a[0], time);
    this._flashlightIntensity(char, a[1], time);
    this._flashlightDistance(char, a[2], time);
    this._flashlightAngle(char, a[3], time);
  }
  _flashlightColor(char, color, time) {char.blendFlashlightColor.setValue((0,util.makeColor)(color).toNumber(), time);}
  _flashlightIntensity(char, n, time) {this._RELATIVE_BLEND(char.blendFlashlightIntensity, n, time);}
  _flashlightDistance(char, n, time) {this._RELATIVE_BLEND(char.blendFlashlightDistance, n, time);}
  _flashlightAngle(char, n, time) {this._RELATIVE_BLEND(char.blendFlashlightAngle, n, time);}
  _flashlightPitch(char, n, time) {this._RELATIVE_BLEND(char.blendFlashlightPitch, n, time);}
  _flashlightYaw(char, yaw) {this.configure(`flashlightYaw(${yaw})`);}
  _flashlightShadow(char) {var _char$setupFlashlight;(_char$setupFlashlight = char.setupFlashlightShadow) === null || _char$setupFlashlight === void 0 ? void 0 : _char$setupFlashlight.call(char);}
  async elevation(...a) {
    const char = await this.AWAIT_CHAR(this.CHAR);
    let time = this._TIME(a[1]);
    this._RELATIVE_BLEND(char.blendElevation, a[0], time);
  }
  async configure(...a) {
    let time = null;
    if (isFinite(a[a.length - 1]) && a.length >= 2) {
      time = Number(a.pop());
    }
    this.CHAR.mv3d_configure(a.join(' '), time);
    /*
    const char = await this.AWAIT_CHAR(this.CHAR);
    mv3d.readConfigurationFunctions(
    	a.join(' '),
    	mv3d.eventConfigurationFunctions,
    	char.settings,
    );
    char.pageConfigure(char.settings);
    */
  }
  set(key, ...a) {
    //key=key.toLowerCase().replace(/\s+/,'');
    key = key.toLowerCase();
    let time = 0;
    if (isFinite(a[a.length - 1]) && a.length >= 2) {
      time = Number(a.pop());
    }
    const value = a.join(' ');
    if (key in plugin_commands_mz3d.attributes) {
      if (time) {
        plugin_commands_mz3d.blendAttribute(key, value, time);
      } else {
        plugin_commands_mz3d.attributes[key] = value;
      }
    }
  }
  disable(fadeType) {plugin_commands_mz3d.disable(fadeType);}
  enable(fadeType) {plugin_commands_mz3d.enable(fadeType);}
  get _RELATIVE_BLEND() {return util.relativeBlend;}
  _TIME(time) {
    return plugin_commands_mz3d.PluginCommand.TIME(time);
  }
  static TIME(t) {
    return isNaN(t) ? 1 : Number(t);
  }
  static WAIT(v) {return (0,util.booleanString)(v);}
  ERROR_CHAR() {
    console.warn(`MV3D: Plugin command \`${this.FULL_COMMAND}\` failed because target character was invalid.`);
    //console.log(this.CHAR);
  }
  async AWAIT_CHAR(char) {
    if (!plugin_commands_mz3d.characters.length) {
      plugin_commands_mz3d.createCharacters();
    }
    if (!char) {return this.ERROR_CHAR();}
    let w = 0;
    while (!char.mv3d_sprite) {
      await (0,util.sleep)(100);
      if (++w > 10) {return this.ERROR_CHAR();}
    }
    return char.mv3d_sprite;
  }
  TARGET_CHAR(target) {
    return plugin_commands_mz3d.targetChar(target, $gameMap.event(this.INTERPRETER._eventId), this.CHAR);
  }};



plugin_commands_mz3d.targetChar = function (target, self = null, dfault = self) {
  if (!target) {return dfault;}
  let m = target.toLowerCase().match(/[a-z]+/);
  const mode = m ? m[0] : 'e';
  m = target.match(/\d+/);
  const id = m ? Number(m[0]) : 0;
  switch (mode[0]) {
    case 's':return self;
    case 'p':return $gamePlayer;
    case 'e':
      if (!id) {return self;}
      return $gameMap.event(id);
    case 'v':
      return $gameMap.vehicle(id);
    case 'f':
      return $gamePlayer.followers()._data[id];}

  return char;
};
plugin_commands_mz3d.getTargetString = function (char) {
  if (char instanceof Game_Player) {
    return `@p`;
  }
  if (char instanceof Game_Event) {
    return `@e${char._eventId}`;
  }
  if (char instanceof Game_Follower) {
    return `@f${$gamePlayer._followers._data.indexOf(char)}`;
  }
  if (char instanceof Game_Vehicle) {
    return `@v${$gameMap._vehicles.indexOf(char)}`;
  }
};

Game_CharacterBase.prototype.mv3d_requestAnimation = function (id, opts = {}) {
  this.requestAnimation(id);
  this._mv3d_animationSettings = opts;
};

Game_Character.prototype.mv3d_configure = function (data, time = null) {
  if (!this.mv3d_sprite) {return;}
  const sprite = this.mv3d_sprite;
  const target = plugin_commands_mz3d.getTargetString(this);
  plugin_commands_mz3d.$saveData.tempBlenders ??= [];
  const config = plugin_commands_mz3d.readConfigurationFunctions(
  data,
  plugin_commands_mz3d.eventConfigurationFunctions).
  _proxyTarget;
  for (let i = plugin_commands_mz3d.$saveData.tempBlenders.length - 1; i >= 0; --i) {
    const tempBlender = plugin_commands_mz3d.$saveData.tempBlenders[i];
    if (tempBlender.target !== target) {continue;}
    for (const key of Object.keys(config)) {
      if (key in tempBlender.endValue) {
        delete tempBlender.startValue[key];
        delete tempBlender.endValue[key];
        //console.log('deleting values early',key);
      }
    }
    if (!Object.keys(tempBlender.endValue).length) {
      plugin_commands_mz3d.$saveData.tempBlenders.splice(i, 1);
    }
  }
  if (isFinite(time) && time !== '' && time !== null) {
    const endConfig = config;
    const startConfig = {};
    for (const key of Object.keys(endConfig)) {
      if (key in mapConfigsToBlenders) {
        mapConfigsToBlenders[key].call(sprite, endConfig[key], time);
        delete endConfig[key];
        //console.log('using blender instead',key);
        continue;
      }

      startConfig[key] = sprite.getConfig(key, (0,util.access)(plugin_commands_mz3d.defaultEventConfigurations, key, sprite));
      endConfig[key] = sprite._finalizeConfig(endConfig[key]);
    }
    if (!Object.keys(endConfig).length) {return;}
    //const duration = Math.max(1,Math.floor(time*60));
    const duration = time;
    plugin_commands_mz3d.$saveData.tempBlenders.push({
      target, duration, elapsed: 0,
      startValue: startConfig,
      endValue: endConfig });

  } else {
    Object.assign(this.mv3d_data.settings, config);
    sprite.pageConfigure(this.mv3d_data.settings);
  }
};
const mapConfigsToBlenders = {
  height(value, time) {
    this.blendElevation.setValue(value, time);
  },
  lamp(value, time) {
    this.setupLamp();
    this.blendLampColor.setValue(value.color, time);
    this.blendLampIntensity.setValue(value.intensity, time);
    this.blendLampDistance.setValue(value.distance, time);
  },
  flashlight(value, time) {
    this.setupFlashlight();
    this.blendFlashlightColor.setValue(value.color, time);
    this.blendFlashlightIntensity.setValue(value.intensity, time);
    this.blendFlashlightDistance.setValue(value.distance, time);
    this.blendFlashlightAngle.setValue(value.angle, time);
  },
  flashlightPitch(value, time) {
    this.setupFlashlight();
    this.blendFlashlightPitch.setValue(value, time);
  },
  flashlightYaw(value, time) {
    this.setupFlashlight();
    this.blendFlashlightYaw.setValue(value, time);
  } };


plugin_commands_mz3d.command = function (...s) {
  s = s.join(' ').split(' ');
  const fakeInterpreter = new Game_Interpreter();
  fakeInterpreter._mapId = $gameMap.mapId();
  runPluginCommand(fakeInterpreter, s);
};
plugin_commands_mz3d.command.interpret = function (interpreter, ...s) {
  s = s.join(' ').split(' ');
  runPluginCommand(interpreter, s);
};



plugin_commands_mz3d.registerCommand = function (name, argsFunc, execFunc) {
  const lowercaseName = String(name).toLowerCase();

  if (typeof PluginManager.registerCommand === 'function') {
    if (typeof argsFunc === 'function') {
      PluginManager.registerCommand('mz3d', name, function (args) {waitPluginCommand(this, execFunc.call(this, args));});
    } else if (typeof argsFunc === 'object') {
      PluginManager.registerCommand('mz3d', name, plugin_commands_mz3d.registerCommand.executeWithTypes(execFunc, argsFunc.types || {}));
    }
  }

  if (typeof argsFunc === 'function') {
    const commandFunc = function (...args) {
      return execFunc.call(this.INTERPRETER, argsFunc.call(this.INTERPRETER, ...args));
    };
    plugin_commands_mz3d.PluginCommand.prototype[lowercaseName] = commandFunc;
  } else if (typeof argsFunc === 'object') {
    const commandFunc = function (...args) {
      return execFunc.call(this.INTERPRETER, this.getKeywords(args, argsFunc.types || {}, argsFunc.aliases || []));
    };
    plugin_commands_mz3d.PluginCommand.prototype[lowercaseName] = commandFunc;
  }

};

plugin_commands_mz3d.registerCommand.executeWithTypes = function (execFunc, types) {
  types = Object.assign({}, plugin_commands_mz3d.PluginCommand.defaultTypes, types);
  return function (args) {
    const typedArgs = {};
    for (const key in args) {
      const arg = args[key];
      switch (types[key]) {
        case String:
        case undefined:
          typedArgs[key] = String(arg);
          break;
        case Boolean:
          typedArgs[key] = (0,util.booleanString)(arg);
          break;
        case characters/* Character */.z:
          typedArgs[key] = plugin_commands_mz3d.targetChar(arg, $gameMap.event(this._eventId), this.CHAR);
          break;
        default:
          typedArgs[key] = types[key](arg);}

    }
    waitPluginCommand(this, execFunc.call(this, typedArgs));
  };
};

plugin_commands_mz3d.PluginCommand.defaultTypes = {
  target: characters/* Character */.z,
  time: plugin_commands_mz3d.PluginCommand.TIME,
  wait: plugin_commands_mz3d.PluginCommand.WAIT };

plugin_commands_mz3d.PluginCommand.prototype.getKeywords = function (words, types, aliases) {
  const params = {};
  if (!words.length) return params;

  types = Object.assign({}, plugin_commands_mz3d.PluginCommand.defaultTypes, types);
  const keywords = {};
  const indexes = {};
  for (let key in types) {
    keywords[key.toLowerCase()] = key;
  }
  for (let key in aliases) {
    if (isFinite(key)) {
      indexes[Number(key)] = aliases[key];
    } else {
      keywords[key.toLowerCase()] = aliases[key];
    }
    if (!(aliases[key] in types)) {
      keywords[aliases[key].toLowerCase()] = aliases[key];
      types[aliases[key]] = String;
    }
  }

  words = new plugin_commands_mz3d.PluginCommand.WordList(words);
  let i = 0;
  for (let word of words) try {
    word = String(word).toLowerCase();
    if (!(word in keywords) && i in indexes) {
      word = indexes[i++].toLowerCase();
      words.insertValue(word);
    };
    if (word in keywords) {
      let name = keywords[word];
      let type = types[name];
      /*if(type instanceof Array){
      }else */
      switch (type) {
        case plugin_commands_mz3d.PluginCommand.WAIT:
          params[name] = true;
          if (!params.time && words.hasValue(1) && isFinite(words.getValue(1))) {
            name = 'time';type = plugin_commands_mz3d.PluginCommand.TIME;
            //fallthrough
          } else {
            break;
          }
        case plugin_commands_mz3d.PluginCommand.TIME:
          params[name] = type(words.removeAndNext());
          if (words.hasValue(1)) {
            const unit = words.getValue(1).toLowerCase();
            if (unit === 'second' || unit === 'seconds') {
              words.removeValue();
            } else if (unit === 'frame' || unit === 'frames') {
              params[name] /= 60;
              words.removeValue();
            }
          }
          break;
        case Boolean:
          if (words.hasValue(1) && (0,util.isBoolean)(words.getValue(1))) {
            params[name] = (0,util.booleanString)(words.removeAndNext());
          } else {
            params[name] = true;
          }
          break;
        case characters/* Character */.z:
          params[name] = this.TARGET_CHAR(words.removeAndNext());
          break;
        default:
          params[name] = type(words.removeAndNext());}

      words.removeValue();
    }
  } catch (err) {
    //console.error(err);
  }
  return Object.assign({ time: 1, target: this.CHAR }, params);
};

plugin_commands_mz3d.PluginCommand.WordList = class {
  constructor(array) {
    this.array = array;
    this.currentIndex = -1;
  }
  [Symbol.iterator]() {
    return this;
  }
  reset() {this.currentIndex = -1;}
  next() {
    if (this.currentIndex < this.array.length) ++this.currentIndex;
    return { value: this.array[this.currentIndex], done: !(this.currentIndex < this.array.length) };
  }
  nextValue() {
    if (!this.hasNextValue()) {throw RangeError("can't fetch next value");}
    return this.array[++this.currentIndex];
  }
  hasNextValue() {
    return this.hasValue(1);
  }
  hasValue(offset = 0) {
    return this.currentIndex + offset < this.array.length;
  }
  getValue(offset = 0) {
    return this.array[this.currentIndex + offset];
  }
  insertValue(value) {
    this.array.splice(this.currentIndex, 0, value);
  }
  removeValue() {
    this.array.splice(this.currentIndex, 1);
    //move index back one so we don't skip a value when next is called.
    if (this.currentIndex > -1) this.currentIndex -= 1;
  }
  removeAndNext() {
    this.removeValue();
    return this.nextValue();
  }};




plugin_commands_mz3d.registerCommand('action', {
  types: { loop: Boolean, important: Boolean },
  aliases: ['playback', 'name'] },
async (args) => {
  if (!args.playback || !args.name) return;
  const name = args.name.toLowerCase();
  const sprite = args.target.mv3d_sprite;
  if (!sprite) return;
  switch (args.playback.toLowerCase()) {
    case 'play':
      sprite.playAction(name, args.loop, args.important);
      if (args.wait) await sprite.waitForAction(name);
      break;
    case 'stop':
      sprite.stopAction(name);
      break;
    case 'pause':
      sprite.pauseAction(name);
      break;}

});
// EXTERNAL MODULE: ./src/MeshBuilder.js
var MeshBuilder = __webpack_require__("./src/MeshBuilder.js");
;// CONCATENATED MODULE: ./src/MapCellBuilder.js
const MapCellBuilder_mz3d = window.mz3d;





class CellMeshBuilder extends MeshBuilder/* AbstractMeshBuilder */.AL {
  constructor() {
    super(CellSubMeshBuilder);
  }
  addWallFace(material, rect, x, y, z, w, h, rot, options = {}) {
    const builder = this.getBuilder(material);
    const uvRect = this.getUvRect(material.diffuseTexture, rect);
    builder.addWallFace(x, y, z, w, h, rot, uvRect, options);
    if (options.double) {
      options.flip = !options.flip;
      builder.addWallFace(x, y, z, w, h, rot, uvRect, options);
    }
  }
  addFloorFace(material, rect, x, y, z, w, h, rot, options = {}) {
    const builder = this.getBuilder(material);
    const uvRect = this.getUvRect(material.diffuseTexture, rect);
    builder.addFloorFace(x, y, z, w, h, rot, uvRect, options);
    if (options.double) {
      options.flip = !options.flip;
      builder.addFloorFace(x, y, z, w, h, rot, uvRect, options);
    }
  }
  addSlopeFace(material, rect, x, y, z, w, h, rot, options = {}) {
    const builder = this.getBuilder(material);
    const uvRect = this.getUvRect(material.diffuseTexture, rect);
    if (options.diag) {
      builder.addSlopeDiag(x, y, z, w, h, rot, uvRect, options);
    } else {
      builder.addSlopeFace(x, y, z, w, h, rot, uvRect, options);
    }
    if (options.double) {
      options.flip = !options.flip;
      if (options.diag) {
        builder.addSlopeDiag(x, y, z, w, h, rot, uvRect, options);
      } else {
        builder.addSlopeFace(x, y, z, w, h, rot, uvRect, options);
      }
    }
  }
  addSlopeTop(material, rect, x, y, z, w, h, rot, options = {}) {
    const builder = this.getBuilder(material);
    const uvRect = this.getUvRect(material.diffuseTexture, rect);
    builder.addSlopeTop(x, y, z, w, h, rot, uvRect, options);
    if (options.double) {
      options.flip = !options.flip;
      builder.addSlopeTop(x, y, z, w, h, rot, uvRect, options);
    }
  }
  addSlopeSide(material, rect, x, y, z, w, h, rot, options = {}) {
    const builder = this.getBuilder(material);
    const uvRect = this.getUvRect(material.diffuseTexture, rect);
    builder.addSlopeSide(x, y, z, w, h, rot, uvRect, options);
    if (options.double) {
      options.flip = !options.flip;
      builder.addSlopeSide(x, y, z, w, h, rot, uvRect, options);
    }
  }}


class CellSubMeshBuilder extends MeshBuilder/* AbstractSubMeshBuilder */.x1 {
  constructor(material) {
    super(material);
    this.submeshName = 'cell mesh';
  }
  addWallFace(x, z, y, w, h, rot, uvr, options) {
    z = -z;y = y;
    const xf = (0,util.cos)(rot);
    const zf = (0,util.sin)(rot);
    const ww = w / 2,hh = h / 2;
    const positions = [
    x - ww * xf, y + hh, z + ww * zf,
    x + ww * xf, y + hh, z - ww * zf,
    x - ww * xf, y - hh, z + ww * zf,
    x + ww * xf, y - hh, z - ww * zf];

    if (options.slant) {
      const { slant = 0, leftSlant = 0, rightSlant = 0, slantIndex: si = 0 } = options;
      arrayAdditionStartingAtIndex(0, positions, [
      -slant * si * zf - leftSlant * si * xf, 0, -slant * si * xf + leftSlant * si * zf,
      -slant * si * zf + rightSlant * si * xf, 0, -slant * si * xf - rightSlant * si * zf,
      -slant * (si + 1) * zf - leftSlant * (si + 1) * xf, 0, -slant * (si + 1) * xf + leftSlant * (si + 1) * zf,
      -slant * (si + 1) * zf + rightSlant * (si + 1) * xf, 0, -slant * (si + 1) * xf - rightSlant * (si + 1) * zf]);

    }
    let normals = [-zf, 0, -xf, -zf, 0, -xf, -zf, 0, -xf, -zf, 0, -xf];
    const uvs = CellSubMeshBuilder.getDefaultUvs(uvr);
    const indices = CellSubMeshBuilder.getDefaultIndices();
    if (options.flip) {MeshBuilder/* MeshBuilder.flipFace */.VO.flipFace(indices, normals);}
    if (options.abnormal) {normals = [0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0];}
    this.pushNewData(positions, indices, normals, uvs);
  }
  addFloorFace(x, z, y, w, h, rot, uvr, options) {
    rot += Math.PI / 4;
    z = -z;y = y;
    //const f=Boolean(options.flip)*-2+1;
    //const ww=f*w/2, hh=h/2;
    const ww = w * Math.SQRT1_2,hh = h * Math.SQRT1_2;
    const xf = (0,util.cos)(rot);
    const zf = (0,util.sin)(rot);
    const positions = [
    x - ww * xf, y, z + hh * zf,
    x + ww * zf, y, z + hh * xf,
    x - ww * zf, y, z - hh * xf,
    x + ww * xf, y, z - hh * zf];

    //const normals=[ 0,f,0, 0,f,0, 0,f,0, 0,f,0 ];
    const normals = [0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0];
    const uvs = CellSubMeshBuilder.getDefaultUvs(uvr);
    const indices = CellSubMeshBuilder.getDefaultIndices();
    if (options.flip) {MeshBuilder/* MeshBuilder.flipFace */.VO.flipFace(indices, normals);}
    this.pushNewData(positions, indices, normals, uvs);
  }
  addSlopeFace(x, z, y, w, h, rot, uvr, options) {
    z = -z;y = y;
    const xf = (0,util.cos)(rot);
    const zf = (0,util.sin)(rot);
    const ww = w / 2,hh = h / 2;
    const positions = options.autotile || !options.texrot ? [
    x - ww, y + hh + hh * Math.round((0,util.sin)(-rot + util.PI * 1 / 4)), z + ww,
    x + ww, y + hh + hh * Math.round((0,util.sin)(-rot + util.PI * 3 / 4)), z + ww,
    x - ww, y + hh + hh * Math.round((0,util.sin)(-rot + util.PI * 7 / 4)), z - ww,
    x + ww, y + hh + hh * Math.round((0,util.sin)(-rot + util.PI * 5 / 4)), z - ww] :
    [
    x - ww * xf + ww * zf, y + h, z + ww * zf + ww * xf,
    x + ww * xf + ww * zf, y + h, z - ww * zf + ww * xf,
    x - ww * xf - ww * zf, y, z + ww * zf - ww * xf,
    x + ww * xf - ww * zf, y, z - ww * zf - ww * xf];

    const hn = Math.pow(2, -h / w);
    const ihn = 1 - hn;
    const normals = [-zf * ihn, hn, -xf * ihn, -zf * ihn, hn, -xf * ihn, -zf * ihn, hn, -xf * ihn, -zf * ihn, hn, -xf * ihn];
    let uvs = CellSubMeshBuilder.getDefaultUvs(uvr);
    const indices = CellSubMeshBuilder.getDefaultIndices();
    if (options.flip) {MeshBuilder/* MeshBuilder.flipFace */.VO.flipFace(indices, normals);}
    this.pushNewData(positions, indices, normals, uvs);
  }
  addSlopeSide(x, z, y, w, h, rot, uvr, options) {
    z = -z;y = y;
    const xf = (0,util.cos)(rot);
    const zf = (0,util.sin)(rot);
    const ww = w / 2,hh = h / 2;
    const positions = [
    x - ww * xf, y + h, z + ww * zf,
    x - ww * xf, y, z + ww * zf,
    x + ww * xf, y, z - ww * zf];

    if (options.slant) {
      const slant = options.slant;
      positions[3] -= slant * xf;
      positions[3] -= slant * zf * (options.flip ? -1 : 1);
      positions[5] += slant * zf;
      positions[5] -= slant * xf * (options.flip ? -1 : 1);
    }
    const normals = [-zf, 0, -xf, -zf, 0, -xf, -zf, 0, -xf];
    const uvs = [
    uvr.x1, uvr.y1,
    uvr.x1, uvr.y2,
    uvr.x2, uvr.y2];

    const indices = [0, 1, 2];
    if (options.flip) {MeshBuilder/* MeshBuilder.flipFace */.VO.flipFace(indices, normals);}
    this.pushNewData(positions, indices, normals, uvs);
  }
  addSlopeDiag(x, z, y, w, h, rot, uvr, options) {
    if (options.diag && !options.noTop && !options.noBottom && !options.autotile && options.texrot && options.texrotDiag) {
      this.addSlopeDiag(x, z, y, w, h, rot, uvr, { ...options, noTop: true });
      this.addSlopeDiag(x, z, y + h, w, h, rot, uvr, { ...options, noBottom: true });
      return;
    }
    if (options.noTop && options.noBottom) {return;}
    z = -z;h *= 2;
    rot += (0,util.degtorad)(45);
    let xf = (0,util.cos)(rot);
    let zf = (0,util.sin)(rot);
    let ww = w / 2,hh = h / 2;
    //if(options.noBottom||options.noTop){hh=h;h*=2;}
    if (options.noBottom) y -= hh;
    const positions = [
    ...rotatePoint(x, y, z, ww, hh, ww, rot),
    ...rotatePoint(x, y, z, -ww, hh, -ww, rot)];

    const indices = [];
    const uvs = CellSubMeshBuilder.getDefaultUvs(uvr);
    if (!options.noTop) {
      positions.unshift(...rotatePoint(x, y, z, -ww, options.noTop ? hh : h, ww, rot));
      indices.push(1, 0, 2);
    }
    if (!options.noBottom) {
      positions.push(...rotatePoint(x, y, z, ww, options.noBottom ? hh : 0, -ww, rot));
      const s = options.noTop ? 0 : 1;
      indices.push(s, s + 1, s + 2);
    }

    if (!options.autotile && options.texrot && options.texrotDiag) {
      const xmid = (uvr.x1 + uvr.x2) / 2;
      uvs[0] = uvs[6] = xmid;
      if (options.noBottom) {
        uvs[3] = uvr.y2;
      } else if (options.noTop) {
        uvs[5] = uvr.y1;
      }
    }
    if (options.autotile || !options.texrot) {
      let ir = rot / 2 / Math.PI;
      while (ir >= 0.125) {
        ir -= .25;
        uvs.push(...uvs.splice(0, 2));
        uvs.push(...uvs.splice(2, 2));
      }
    }
    if (options.noBottom) {
      uvs.splice(-2);
    } else if (options.noTop) {
      uvs.splice(0, 2);
    }
    const hn = Math.pow(2, -h / w);
    const ihn = 1 - hn;
    rot -= (0,util.degtorad)(45);
    xf = (0,util.cos)(rot);
    zf = (0,util.sin)(rot);
    const normals = [-zf * ihn, hn, -xf * ihn, -zf * ihn, hn, -xf * ihn, -zf * ihn, hn, -xf * ihn];
    if (!options.noBottom && !options.noTop) {
      normals.push(-zf * ihn, hn, -xf * ihn);
    }

    this.pushNewData(positions, indices, normals, uvs);
  }
  addSlopeTop(x, z, y, w, h, rot, uvr, options) {
    if (options.noTop && options.noBottom || !options.noTop && !options.noBottom) {return;}
    z = -z;h *= 2;
    rot += (0,util.degtorad)(45);
    let ww = w / 2,hh = h / 2;
    //if(options.noBottom||options.noTop){hh=h;h*=2;}
    if (options.noBottom) y -= hh;
    const positions = [
    ...rotatePoint(x, y, z, ww, hh, ww, rot),
    ...rotatePoint(x, y, z, -ww, hh, -ww, rot)];

    const indices = [];
    const uvs = CellSubMeshBuilder.getDefaultUvs(uvr);
    let ir = rot / 2 / Math.PI;
    while (ir >= 0.125) {
      ir -= .25;
      uvs.push(...uvs.splice(0, 2));
      uvs.push(...uvs.splice(2, 2));
    }
    const normals = [0, 1, 0, 0, 1, 0, 0, 1, 0];
    if (options.noTop) {
      positions.unshift(...rotatePoint(x, y, z, -ww, hh, ww, rot));
      indices.push(1, 0, 2);
      uvs.splice(-2);
    } else if (options.noBottom) {
      positions.push(...rotatePoint(x, y, z, ww, hh, -ww, rot));
      indices.push(0, 1, 2);
      uvs.splice(0, 2);
    }
    this.pushNewData(positions, indices, normals, uvs);
  }
  static getDefaultUvs(uvr) {
    return [
    uvr.x1, uvr.y1,
    uvr.x2, uvr.y1,
    uvr.x1, uvr.y2,
    uvr.x2, uvr.y2];

  }
  static getDefaultIndices() {return [1, 0, 2, 1, 2, 3];}}



function rotatePoint(x, y, z, xoff, yoff, zoff, rot = 0) {
  return core.Vector3.TransformCoordinates(new core.Vector3(xoff, yoff, zoff), core.Matrix.RotationAxis(BABYLON.Axis.Y, rot)).addInPlaceFromFloats(x, y, z).asArray();
}

function arrayAdditionStartingAtIndex(startIndex, arr1, arr2) {
  for (let i = 0; i < arr2.length; ++i) {
    arr1[startIndex + i] += arr2[i];
  }
}
// EXTERNAL MODULE: ./src/model.js
var model = __webpack_require__("./src/model.js");
;// CONCATENATED MODULE: ./src/mapCell.js
const mapCell_mz3d = window.mz3d;





class MapCell extends core.TransformNode {
  constructor(cx, cy) {
    const key = [cx, cy].toString();
    super(`MapCell[${key}]`, mapCell_mz3d.scene);
    this.parent = mapCell_mz3d.map;
    //mv3d.cells[key]=this;
    this.cx = cx;this.cy = cy;
    this.ox = cx * mapCell_mz3d.CELL_SIZE;this.oy = cy * mapCell_mz3d.CELL_SIZE;
    this.x = this.ox;this.y = this.oy;
    this.key = key;
    this.characters = [];
    this.doodads = [];

    //this.load();
  }
  update() {
    const loopPos = mapCell_mz3d.loopCoords((this.cx + 0.5) * mapCell_mz3d.CELL_SIZE, (this.cy + 0.5) * mapCell_mz3d.CELL_SIZE);
    this.x = loopPos.x - mapCell_mz3d.CELL_SIZE / 2;
    this.y = loopPos.y - mapCell_mz3d.CELL_SIZE / 2;
    for (let i = 0; i < this.doodads.length; ++i) {
      const doodad = this.doodads[i];
      if (!doodad.conf || !doodad.doodadNeedsUpdate) continue;
      const useSpriteOffset = doodad.shape === mapCell_mz3d.enumShapes.SPRITE || doodad.needsProjectionFix();
      const doff = mapCell_mz3d.getConfig(doodad.conf, 'dynamicOffset', useSpriteOffset ? mapCell_mz3d.SPRITE_OFFSET : 0);
      if (doff) {
        const cameraRotation = mapCell_mz3d.cameraRotation();
        const dpitch = mapCell_mz3d.getConfig(doodad.conf, 'dynamicOffsetPitch', doodad.shape === mapCell_mz3d.enumShapes.SPRITE ? mapCell_mz3d.SPRITE_OFFSET_PITCH : false);
        const billboardOffset = new core.Vector2(Math.sin(-cameraRotation.y), Math.cos(cameraRotation.y));
        const spriteOffset = doff * (dpitch ? Math.sin(Math.max(0, cameraRotation.x)) : 1);
        doodad.x = doodad.doodadPosition.x + billboardOffset.x * spriteOffset;
        doodad.y = -doodad.doodadPosition.z + billboardOffset.y * spriteOffset;
      }
      doodad.update();
    }
  }
  async load() {
    const shapes = mapCell_mz3d.enumShapes;
    this.builder = new CellMeshBuilder();
    // load all tiles in mesh
    let cellWidth = mapCell_mz3d.CELL_SIZE,cellHeight = mapCell_mz3d.CELL_SIZE;
    if (mapCell_mz3d.getMapConfig('edge') !== 'clamp') {
      cellWidth = Math.min(mapCell_mz3d.CELL_SIZE, mapCell_mz3d.mapWidth() - this.cx * mapCell_mz3d.CELL_SIZE);
      cellHeight = Math.min(mapCell_mz3d.CELL_SIZE, mapCell_mz3d.mapHeight() - this.cy * mapCell_mz3d.CELL_SIZE);
    }
    const ceilingConf = mapCell_mz3d.getCeilingConfig();
    for (let ty = 0; ty < cellHeight; ++ty)
    for (let tx = 0; tx < cellWidth; ++tx) {
      this.tx = tx;this.ty = ty;
      this.xx = this.ox + tx;this.yy = this.oy + ty;
      let ceiling = ceilingConf;
      const tileData = mapCell_mz3d.getTileData(this.xx, this.yy);
      const zeroConf = mapCell_mz3d.getTileTextureOffsets(tileData[0], this.xx, this.yy, 0);
      if (zeroConf.ceiling_changed) {
        ceiling = mapCell_mz3d.getCeilingConfig(zeroConf);
      }
      ceiling.cull = false;
      const cullHeight = mapCell_mz3d.getCullingHeight(this.xx, this.yy);
      const layerData = [];
      for (let l = 0; l < tileData.length; ++l) {
        if (mapCell_mz3d.isTileEmpty(tileData[l])) {continue;}
        const tz = mapCell_mz3d.getStackHeight(this.xx, this.yy, l);
        const tileConf = l === 0 ? zeroConf : mapCell_mz3d.getTileTextureOffsets(tileData[l], this.xx, this.yy, l);
        const wallHeight = mapCell_mz3d.getTileHeight(this.xx, this.yy, l, tileConf) || mapCell_mz3d.getConfig(tileConf, 'height', 0);
        const shape = tileConf.shape;
        tileConf.realId = tileData[l];
        let x, y, z;
        x = tx + mapCell_mz3d.getConfig(tileConf, 'xoff', 0);
        y = ty + mapCell_mz3d.getConfig(tileConf, 'yoff', 0);
        if (tileConf.tileOffset) {
          const to = tileConf.tileOffset;
          x += to.x;
          y += to.y;
          z = mapCell_mz3d.getStackHeight(this.xx + to.x, this.yy + to.y) + mapCell_mz3d.getTileFringe(this.xx, this.yy, l, tileConf) + wallHeight;
        } else {
          z = tz + mapCell_mz3d.getConfig(tileConf, 'zoff', 0);
        }
        layerData[l] = { tz, tileConf, wallHeight, shape, x, y, z };
        if (!shape || shape === shapes.FLAT || shape === shapes.SLOPE) {continue;}
        if (shape === shapes.FENCE) {
          await this.loadFence(tileConf, x, y, z, l, wallHeight);
        } else if (shape === shapes.WALL) {
          await this.loadShapeWall(tileConf, x, y, z, l, wallHeight);
        } else if (shape === shapes.CROSS || shape === shapes.XCROSS) {
          await this.loadCross(tileConf, x, y, z, l, wallHeight, shape === shapes.XCROSS ? 45 : 0);
        } else if (shape === shapes['8CROSS']) {
          await this.loadCross(tileConf, x, y, z, l, wallHeight, 0);
          await this.loadCross(tileConf, x, y, z, l, wallHeight, 45);
        } else if (shape === shapes.SPRITE || shape === shapes.BOARD || shape === shapes.MODEL || shape === shapes.MESH) {
          //await
          if (mapCell_mz3d.PRELOAD_MODELS) {
            await this.loadDoodad(tileConf, x, y, z - wallHeight, l, shape);
          } else {
            this.loadDoodad(tileConf, x, y, z - wallHeight, l, shape);
          }
        }
      }
      let lastZ = Infinity;
      for (let l = tileData.length - 1; l >= 0; --l) {
        if (mapCell_mz3d.isTileEmpty(tileData[l])) {continue;}
        const { tz, tileConf, wallHeight, shape, x, y, z } = layerData[l];
        let pitCull = false;
        if (lastZ < tz) {pitCull = true;}
        if (!mapCell_mz3d.getTileFringe(this.xx, this.yy, l)) {
          lastZ = tz;
        }
        //z+=tileConf.fringe;
        //if(mv3d.isStarTile(tileData[l])){ z+=tileConf.fringeHeight; }
        if (!shape || shape === shapes.FLAT || shape === shapes.SLOPE) {
          const hasWall = wallHeight || l === 0;
          const hasBottom = wallHeight > 0 && tz - wallHeight > cullHeight || mapCell_mz3d.getConfig(tileConf, 'fringe', 0) > 0;
          if (!shape || shape === shapes.FLAT) {
            if (!pitCull) {
              await this.loadTile(tileConf, x, y, z + l * mapCell_mz3d.LAYER_DIST * !hasWall, l);
              if (hasWall) {
                await this.loadWalls(tileConf, x, y, z, l, wallHeight);
              }
              if (hasBottom) {
                await this.loadTile(tileConf, x, y, z - wallHeight, l, true);
              }
            }
          } else if (shape === shapes.SLOPE) {
            const slopeHeight = mapCell_mz3d.getConfig(tileConf, 'slopeHeight', 1);
            await this.loadSlope(tileConf, x, y, z, l, slopeHeight);
            if (hasWall) {
              await this.loadWalls(tileConf, x, y, z - slopeHeight, l, wallHeight - slopeHeight);
            }
            if (hasBottom) {
              await this.loadTile(tileConf, x, y, z - slopeHeight - Math.max(0, wallHeight - slopeHeight), l, true);
            }
          }
          if (tz >= ceiling.height) {ceiling.cull = true;}
        }
      }
      if (!mapCell_mz3d.isTileEmpty(ceiling.bottom_id) && !ceiling.cull) {
        await this.loadTile(ceiling, tx, ty, ceiling.height, 0, true, false);
      }

      //if(mv3d.mapReady){ await sleep(); }
      //if(!mv3d.mapLoaded){ this.earlyExit(); return; }
    }

    this.mesh = this.builder.build();

    /*
    if(mz3d.PRELOAD_MODELS){
    	const models = this.doodads.filter((doodad,index)=>{
    		if(doodad.isComplexMesh()){
    			this.doodads.splice(index,1);
    			return true;
    		}
    		return false;
    	}).flatMap(doodad=>{
    		let meshes = doodad.meshes;
    		mz3d.callFeatures('destroyCharMesh',doodad.mesh);
    		delete doodad.mesh;
    		doodad.dispose(true,false);
    		return meshes;
    	});
    	if(this.mesh && models.length){
    		models.push(this.mesh);
    		console.log(models);
    		this.mesh = Mesh.MergeMeshes(models,true,true,undefined,false,true);
    	}
    }
    */

    if (this.mesh) {
      this.mesh.isPickable = false;
      (0,util.sleep)(10).then(() => this.mesh.isPickable = true);
      this.mesh.parent = this;
      this.mesh.alphaIndex = 0;
      this.mesh.renderingGroupId = mapCell_mz3d.enumRenderGroups.MAIN;
      mapCell_mz3d.callFeatures('createCellMesh', this.mesh);
    }
    delete this.builder;
  }
  dispose() {
    super.dispose(...arguments);
    if (this.mesh) {
      mapCell_mz3d.callFeatures('destroyCellMesh', this.mesh);
    }
    for (let i = 0; i < this.doodads.length; ++i) {
      const doodad = this.doodads[i];
      doodad.dispose(true, false);
    }
  }
  async loadDoodad(tileConf, x, y, z, l, shape) {
    const tileId = tileConf.top_id;
    const configRect = tileConf.top_rect;
    const rect = configRect ? configRect : mapCell_mz3d.getTileRects(tileId)[0];
    tileConf.cropTexture = rect;
    tileConf.twosided = true;
    const complexShape = shape === mapCell_mz3d.enumShapes.MODEL || shape === mapCell_mz3d.enumShapes.MESH;
    if (complexShape) {
    } else {
      var tsMaterial = await mapCell_mz3d.getCachedTilesetMaterialForTile(tileConf, 'top');
    }
    const doodad = new model/* Model */.Hn({ orphan: false });
    this.doodads.push(doodad);
    this.doodads[[this.tx, this.ty, l]] = doodad;
    if (shape === mapCell_mz3d.enumShapes.MESH) {
      await doodad.buildMesh(tileConf.meshparts, this.xx, this.yy, l);
    } else if (shape === mapCell_mz3d.enumShapes.MODEL) {
      const useInstance = mapCell_mz3d.getConfig(tileConf, 'model_instance', mapCell_mz3d.MODEL_OPTIMIZATION);
      await doodad.importModel(tileConf.model, {
        nodelay: true,
        useInstance,
        flip: tileConf.model_flip,
        alpha: tileConf.model_alpha,
        textures: tileConf.model_textures });

    } else {
      doodad.setMeshForShape(shape);
    }
    if (tsMaterial) {
      doodad.mesh.material = tsMaterial;
    }
    doodad.parent = this;
    doodad.x = x;doodad.y = y;doodad.z = z;
    doodad.conf = tileConf;
    doodad.doodadPosition = doodad.position.clone();

    doodad._needsProjectionFix = mapCell_mz3d.getConfig(tileConf, 'projectionfix', this.isGltf);

    if (shape !== mapCell_mz3d.enumShapes.SPRITE) {
      doodad.mesh.yaw = mapCell_mz3d.getTileRot(tileConf, this.xx, this.yy);
      doodad.yaw = mapCell_mz3d.getConfig(tileConf, 'yaw', 0);
      doodad.pitch = mapCell_mz3d.getConfig(tileConf, 'pitch', 0);
      if (shape !== mapCell_mz3d.enumShapes.BOARD) {
        doodad.roll = mapCell_mz3d.getConfig(tileConf, 'roll', 0);
      } else {
        if (doodad.yaw || doodad.pitch) {
          doodad.mesh.billboardMode = core.Mesh.BILLBOARDMODE_NONE;
        }
      }

    }

    if (complexShape) {
      const scale = mapCell_mz3d.getConfig(tileConf, 'scale') ?? core.Vector2.One();
      if (scale instanceof core.Vector3) {
        doodad.scaling.set(scale.x, scale.z, scale.y);
      } else {
        doodad.scaling.set(scale.x, scale.y, scale.x);
      }
      if (doodad.mesh.mv3d_importedModelData) {
        const { isObj, isGltf } = doodad.mesh.mv3d_importedModelData;
        if (doodad.mesh.mv3d_needsFlip) {
          if (isObj) {
            doodad.mesh.scaling.set(1, 1, -1);
          } else if (isGltf) {
            doodad.mesh.scaling.set(-1, 1, -1);
          }
        }
      }

    } else {
      const scaleX = mapCell_mz3d.getConfig(tileConf, 'width', 0) || rect.width / (0,util.tileWidth)() || 1;
      const scaleY = mapCell_mz3d.getConfig(tileConf, 'height', 0) || rect.height / (0,util.tileHeight)() || 1;
      doodad.scaling.set(scaleX, scaleY, scaleX);
    }

    if (shape === mapCell_mz3d.enumShapes.SPRITE ||
    shape === mapCell_mz3d.enumShapes.BOARD && !doodad.mesh.billboardMode ||
    tileConf.dynamicOffset) {
      doodad.doodadNeedsUpdate = true;
    }

    mapCell_mz3d.callFeatures('configureDoodad', doodad);
  }
  async loadTile(tileConf, x, y, z, l, ceiling = false, double = false) {
    const tileId = ceiling ? tileConf.bottom_id : tileConf.top_id;
    if (mapCell_mz3d.isTileEmpty(tileId)) {return;}
    const configRect = ceiling ? tileConf.bottom_rect : tileConf.top_rect;
    const isAutotile = Tilemap.isAutotile(tileId) && !configRect;
    let rects;
    if (configRect) {
      rects = [configRect];
    } else {
      rects = mapCell_mz3d.getTileRects(tileId);
    }
    const width = mapCell_mz3d.getConfig(tileConf, 'width', 1) || 1;
    const tsMaterial = await mapCell_mz3d.getCachedTilesetMaterialForTile(tileConf, ceiling ? 'bottom' : 'top');
    const rot = -(0,util.degtorad)(mapCell_mz3d.getConfig(tileConf, 'rot', 0));
    for (const rect of rects) {
      const tx = (rect.ox | 0) / (0,util.tileWidth)() - 0.25 * isAutotile;
      const ty = (rect.oy | 0) / (0,util.tileHeight)() - 0.25 * isAutotile;
      this.builder.addFloorFace(tsMaterial, rect,
      x + (tx * Math.cos(rot) - ty * Math.sin(rot)) * width,
      y + (tx * Math.sin(rot) + ty * Math.cos(rot)) * width,
      z,
      (1 - isAutotile / 2) * width, (1 - isAutotile / 2) * width, rot, { flip: ceiling, double: double });

    }
  }
  async loadWalls(tileConf, x, y, z, l, wallHeight) {
    for (const np of MapCell.neighborPositions) {
      await this.loadWall(tileConf, x, y, z, l, wallHeight, np);
    }
  }
  async loadWall(tileConf, x, y, z, l, wallHeight, np) {
    //const isFringe = mz3d.isStarTile(tileConf.realId)||tileConf.fringe>0;
    const isFringe = mapCell_mz3d.getConfig(tileConf, 'fringe', 0) > 0;
    // don't render walls on edge of map (unless it loops)
    if (!mapCell_mz3d.getMapConfig('edge', true))
    if ((this.xx + np.x >= mapCell_mz3d.mapWidth() || this.xx + np.x < 0) && !mapCell_mz3d.loopHorizontal() ||
    (this.yy + np.y >= mapCell_mz3d.mapHeight() || this.yy + np.y < 0) && !mapCell_mz3d.loopVertical()) {
      return;
    }

    const rrot = -(0,util.degtorad)(mapCell_mz3d.getConfig(tileConf, 'rot', 0));
    const width = mapCell_mz3d.getConfig(tileConf, 'width', 1) || 1;

    let neededHeight = wallHeight;
    let textureChanged = ('side_changed' in tileConf);
    let tileId = tileConf.side_id,configRect,texture_side = 'side';
    if (mapCell_mz3d.isTileEmpty(tileId)) {return;}

    if (rrot === 0 && width === 1) {
      const depth = mapCell_mz3d.getConfig(tileConf, 'depth', 0);
      const neighborHeight = mapCell_mz3d.getCullingHeight(this.xx + np.x, this.yy + np.y, depth > 0 ? 3 : l, {
        ignorePits: !(depth > 0),
        dir: Input._makeNumpadDirection(np.x, np.y) });

      neededHeight = z - neighborHeight;
      if (neededHeight > 0 && wallHeight >= 0 && (l > 0 || isFringe)) {neededHeight = Math.min(wallHeight, neededHeight);}
      if (depth > 0 && neededHeight < 0) {
        if (mapCell_mz3d.isEdgeOrEmpty(this.xx + np.x, this.yy + np.y)) {return;}
        if (mapCell_mz3d.tileHasPit(this.xx + np.x, this.yy + np.y, 3)) {return;}
        //if(mv3d.isTilePit(this.xx+np.x,this.yy+np.y,l)){ return; }
        neededHeight = Math.max(neededHeight, -depth);
        if (tileConf.inside_changed) {
          texture_side = 'inside';
        }
      } else
      if (neededHeight <= 0) {return;}
    } else {
      neededHeight = wallHeight;
    }


    if (texture_side === 'inside') {
      textureChanged = textureChanged || 'inside_changed' in tileConf;
      tileId = tileConf.inside_id;
      if (tileConf.inside_rect) {configRect = tileConf.inside_rect;}
    } else {
      if (np.y > 0) {
        if (tileConf.south_changed) {texture_side = 'south';}
      } else if (np.y < 0) {
        if (tileConf.north_changed) {texture_side = 'north';}
      } else if (np.x > 0) {
        if (tileConf.east_changed) {texture_side = 'east';}
      } else if (np.x < 0) {
        if (tileConf.west_changed) {texture_side = 'west';}
      }
      textureChanged = textureChanged || `${texture_side}_changed` in tileConf;
      const side_id = tileConf[`${texture_side}_id`];
      if (side_id != null) {tileId = side_id;}
      const side_rect = tileConf[`${texture_side}_rect`];
      if (side_rect) {configRect = side_rect;}
    }
    if (mapCell_mz3d.isTileEmpty(tileId)) {return;}

    const tsMaterial = await mapCell_mz3d.getCachedTilesetMaterialForTile(tileConf, texture_side);

    const wallPos = new core.Vector3(x + (np.x / 2 * Math.cos(rrot) - np.y / 2 * Math.sin(rrot)) * width, y + (np.x / 2 * Math.sin(rrot) + np.y / 2 * Math.cos(rrot)) * width, z);
    const rot = -Math.atan2(np.x, np.y) + rrot;
    const slant = mapCell_mz3d.getConfig(tileConf, 'slant', 0);
    if (slant && neededHeight > 0) {
      neededHeight = wallHeight;
    }
    if (configRect || !Tilemap.isAutotile(tileId)) {
      const rect = configRect ? configRect : mapCell_mz3d.getTileRects(tileId)[0];
      const builderOptions = {};
      if (slant) {
        const [leftHeight, rightHeight] = this.getNeighborHeights(np, l);
        const hasLeftEdge = leftHeight < z - neededHeight;
        const hasRightEdge = rightHeight < z - neededHeight;
        builderOptions.slant = slant * (neededHeight < 0 ? -1 : 1);
        builderOptions.leftSlant = slant * hasLeftEdge;
        builderOptions.rightSlant = slant * hasRightEdge;
      }
      if (neededHeight < 0) {builderOptions.flip = true;}
      this.builder.addWallFace(tsMaterial, rect,
      wallPos.x,
      wallPos.y,
      z - neededHeight / 2,
      width, Math.abs(neededHeight), rot, builderOptions);

    } else {// Autotile
      //const npl=MapCell.neighborPositions[(+ni-1).mod(4)];
      //const npr=MapCell.neighborPositions[(+ni+1).mod(4)];
      const [leftHeight, rightHeight] = this.getNeighborHeights(np, l);
      const { x: bx, y: by } = this.getAutotileCorner(tileId, textureChanged, true);
      let wallParts = Math.max(1, Math.abs(Math.round(neededHeight * 2)));
      let partHeight = Math.abs(neededHeight / wallParts);
      let sw = (0,util.tileSize)() / 2;
      let sh = (0,util.tileSize)() / 2;
      if (mapCell_mz3d.isTableTile(tileConf.realId)) {
        sh = (0,util.tileSize)() / 3;
        wallParts = 1;
        partHeight = wallHeight;
        //partHeight=neededHeight;
      }

      let hasLeftEdge, hasRightEdge;
      for (let az = 0; az < wallParts; ++az) {
        if (mapCell_mz3d.isTableTile(tileConf.realId)) {
          hasLeftEdge = leftHeight != z;
          hasRightEdge = rightHeight != z;
        } else if (slant) {
          hasLeftEdge ||= leftHeight < z - az * partHeight;
          hasRightEdge ||= rightHeight < z - az * partHeight;
        } else {
          hasLeftEdge = leftHeight < z - az * partHeight;
          hasRightEdge = rightHeight < z - az * partHeight;
        }
        for (let ax = -1; ax <= 1; ax += 2) {

          let sx, sy;
          sx = bx * (0,util.tileSize)();
          sy = by * (0,util.tileSize)();
          sx = (bx + (ax > 0 ? 0.5 + hasRightEdge : 1 - hasLeftEdge)) * (0,util.tileSize)();
          if (mapCell_mz3d.isWaterfallTile(tileId)) {
            sy = (by + az % 2 / 2) * (0,util.tileSize)();
          } else if (mapCell_mz3d.isTableTile(tileId)) {
            sy = (by + 5 / 3) * (0,util.tileSize)();
          } else {
            sy = (by + (az === 0 ? 0 : az === wallParts - 1 ? 1.5 : 1 - az % 2 * 0.5)) * (0,util.tileSize)();
          }
          const builderOptions = {};
          const partSlant = slant / wallParts;
          if (slant) {
            builderOptions.slant = partSlant * (neededHeight < 0 ? -1 : 1);
            builderOptions.leftSlant = partSlant * (ax < 0 && hasLeftEdge);
            builderOptions.rightSlant = partSlant * (ax > 0 && hasRightEdge);
            builderOptions.slantIndex = az;
          }
          if (neededHeight < 0) {builderOptions.flip = true;}
          const sourceRect = new PIXI.Rectangle(sx, sy, sw, sh);
          this.builder.addWallFace(tsMaterial, sourceRect,
          wallPos.x + width / 4 * ax * Math.cos(rot),
          wallPos.y + width / 4 * ax * Math.sin(rot),
          z - neededHeight * (neededHeight < 0) - partHeight / 2 - partHeight * az,
          width / 2, partHeight, rot, builderOptions);

        }
      }
    }
  }
  getNeighborHeights(np, l) {
    const npl = new core.Vector2(-np.y, np.x);
    const npr = new core.Vector2(np.y, -np.x);
    const ndir = Input._makeNumpadDirection(-np.x, -np.y);
    const leftHeight = mapCell_mz3d.getCullingHeight(this.xx + npl.x, this.yy + npl.y, l, { dir: Input._makeNumpadDirection(npl.x, npl.y), dir2: ndir });
    const rightHeight = mapCell_mz3d.getCullingHeight(this.xx + npr.x, this.yy + npr.y, l, { dir: Input._makeNumpadDirection(npr.x, npr.y), dir2: ndir });
    return [leftHeight, rightHeight];
  }
  async loadFence(tileConf, x, y, z, l, wallHeight) {
    const tileId = tileConf.side_id;
    if (mapCell_mz3d.isTileEmpty(tileId)) {return;}
    const configRect = tileConf.side_rect;
    const tsMaterial = await mapCell_mz3d.getCachedTilesetMaterialForTile(tileConf, 'side');
    const isAutotile = Tilemap.isAutotile(tileId);
    const edges = [];
    const fenceposts = tileConf.fencePosts == null ? true : tileConf.fencePosts;
    for (let ni = 0; ni < MapCell.neighborPositions.length; ++ni) {
      const np = MapCell.neighborPositions[ni];
      const neighborHeight = mapCell_mz3d.getTileHeight(this.xx + np.x, this.yy + np.y, l);
      if (neighborHeight !== wallHeight) {edges.push(ni);}
    }
    for (let ni = 0; ni < MapCell.neighborPositions.length; ++ni) {
      const np = MapCell.neighborPositions[ni];

      let edge = edges.includes(ni);
      if (!isAutotile || !fenceposts) {
        let connect = !(edge && edges.length < 4);
        if (edges.length === 3 && !edges.includes((ni + 2) % 4)) {connect = true;}
        if (!connect) {continue;}
      }

      const rightSide = np.x > 0 || np.y < 0;
      let rot = Math.atan2(np.x, np.y) + Math.PI / 2;
      if (rightSide) {
        rot -= Math.PI;
      }

      if (isAutotile && !configRect) {
        const { x: bx, y: by } = this.getAutotileCorner(tileId, 'side_changed' in tileConf, true);
        for (let az = 0; az <= 1; ++az) {
          const sourceRect = new PIXI.Rectangle(
          (edge ? bx + rightSide * 1.5 : bx + 1 - rightSide * 0.5) * (0,util.tileWidth)(),
          (by + az * 1.5) * (0,util.tileHeight)(),
          (0,util.tileWidth)() / 2, (0,util.tileHeight)() / 2);

          this.builder.addWallFace(tsMaterial, sourceRect,
          x + np.x / 4,
          y + np.y / 4,
          z - wallHeight / 4 - az * wallHeight / 2,
          0.5, wallHeight / 2, -rot, { double: true, abnormal: mapCell_mz3d.ABNORMAL });

        }
      } else {
        const rect = configRect ? configRect : mapCell_mz3d.getTileRects(tileId)[0];
        const sourceRect = new PIXI.Rectangle(
        rect.x + rect.width / 2 * (np.x > 0 || np.y > 0),
        rect.y,
        rect.width / 2, rect.height);

        this.builder.addWallFace(tsMaterial, sourceRect,
        x + np.x / 4,
        y + np.y / 4,
        z - wallHeight / 2,
        0.5, wallHeight, rot, { double: true });

      }
    }
  }
  async loadCross(tileConf, x, y, z, l, wallHeight, angle = 0) {
    const tileId = tileConf.side_id;
    if (mapCell_mz3d.isTileEmpty(tileId)) {return;}
    const configRect = tileConf.side_rect;
    const tsMaterial = await mapCell_mz3d.getCachedTilesetMaterialForTile(tileConf, 'side');
    let isAutotile = Tilemap.isAutotile(tileId);
    let rects;
    if (configRect) {
      rects = [configRect];
      isAutotile = false;
    } else {
      rects = mapCell_mz3d.getTileRects(tileId);
    }
    angle += mapCell_mz3d.getTileRot(tileConf, this.xx, this.yy);
    const rot = (0,util.degtorad)(angle);
    const partHeight = isAutotile ? wallHeight / 2 : wallHeight;
    const partWidth = (mapCell_mz3d.getConfig(tileConf, 'width', 0) || rects[0].width / (0,util.tileWidth)()) / (isAutotile ? 2 : 1);
    for (let i = 0; i <= 1; ++i) {
      for (const rect of rects) {
        const irot = -Math.PI / 2 * i + rot;
        const trans = isAutotile ? -partWidth / 2 + Math.sign(rect.ox | 0) * partWidth : 0;
        this.builder.addWallFace(tsMaterial, rect,
        x + trans * Math.cos(irot),
        y + trans * Math.sin(irot),
        z - (rect.oy | 0) / (0,util.tileHeight)() * wallHeight - partHeight / 2,
        partWidth, partHeight, irot, { double: true, abnormal: mapCell_mz3d.ABNORMAL });

      }
    }
  }
  async loadShapeWall(tileConf, x, y, z, l, wallHeight, angle = 0) {
    const tileId = tileConf.side_id;
    if (mapCell_mz3d.isTileEmpty(tileId)) {return;}
    const configRect = tileConf.side_rect;
    const tsMaterial = await mapCell_mz3d.getCachedTilesetMaterialForTile(tileConf, 'side');
    const isAutotile = Tilemap.isAutotile(tileId);
    let rects;
    if (configRect) {
      rects = [configRect];
    } else {
      rects = mapCell_mz3d.getTileRects(tileId);
    }
    angle += mapCell_mz3d.getTileRot(tileConf, this.xx, this.yy);
    const rot = (0,util.degtorad)(angle);
    const partHeight = isAutotile ? wallHeight / 2 : wallHeight;
    const partWidth = (mapCell_mz3d.getConfig(tileConf, 'width', 0) || rects[0].width / (0,util.tileWidth)()) / (isAutotile ? 2 : 1);
    for (const rect of rects) {
      const trans = isAutotile ? -partWidth / 2 + Math.sign(rect.ox) * partWidth : 0;
      this.builder.addWallFace(tsMaterial, rect,
      x + trans * Math.cos(rot),
      y + trans * Math.sin(rot),
      z - (rect.oy | 0) / (0,util.tileHeight)() * wallHeight - partHeight / 2,
      partWidth, partHeight, rot, { double: true, abnormal: mapCell_mz3d.ABNORMAL });

    }
  }
  async loadSlope(tileConf, x, y, z, l, slopeHeight) {
    //const rot = Math.random()*Math.PI*2;
    //const rot = Math.round((Math.random()*Math.PI*2)/(Math.PI/2))*Math.PI/2;
    const slopeData = mapCell_mz3d.getSlopeDirection(this.xx, this.yy, l, true);
    const { dir, rot } = slopeData;
    if (slopeData.diag) {// diagonal
      if (slopeData.noBottom) {
        await this.slopeNeighborSide(-(0,util.sin)(rot + Math.PI * 3 / 4), (0,util.cos)(rot + Math.PI * 3 / 4), tileConf, x, y, z, l, slopeHeight, dir, rot + Math.PI / 4);
        await this.slopeNeighborSide(-(0,util.sin)(rot + Math.PI * 5 / 4), (0,util.cos)(rot + Math.PI * 5 / 4), tileConf, x, y, z, l, slopeHeight, dir, rot - Math.PI / 4, { flip: true });
      } else {
        await this.slopeNeighborBack(-(0,util.sin)(rot + Math.PI * 3 / 4), (0,util.cos)(rot + Math.PI * 3 / 4), tileConf, x, y, z, l, slopeHeight);
        await this.slopeNeighborBack(-(0,util.sin)(rot + Math.PI * 5 / 4), (0,util.cos)(rot + Math.PI * 5 / 4), tileConf, x, y, z, l, slopeHeight);
        await this.slopeNeighborSide(-(0,util.sin)(rot + Math.PI * 1 / 4), (0,util.cos)(rot + Math.PI * 1 / 4), tileConf, x, y, z, l, slopeHeight, dir, rot - Math.PI / 4);
        await this.slopeNeighborSide(-(0,util.sin)(rot + Math.PI * 7 / 4), (0,util.cos)(rot + Math.PI * 7 / 4), tileConf, x, y, z, l, slopeHeight, dir, rot + Math.PI / 4, { flip: true });
        if (!slopeData.noTop) {
          await this.slopeNeighborSide(-(0,util.sin)(rot + Math.PI * 3 / 4), (0,util.cos)(rot + Math.PI * 3 / 4), tileConf, x, y, z + slopeHeight, l, slopeHeight, dir, rot + Math.PI / 4);
          await this.slopeNeighborSide(-(0,util.sin)(rot + Math.PI * 5 / 4), (0,util.cos)(rot + Math.PI * 5 / 4), tileConf, x, y, z + slopeHeight, l, slopeHeight, dir, rot - Math.PI / 4, { flip: true });
        }
      }
    } else {// straight slopes
      const n1 = await this.slopeNeighborBack(-(0,util.sin)(rot + Math.PI), (0,util.cos)(rot + Math.PI), tileConf, x, y, z, l, slopeHeight);
      await this.slopeNeighborSide(n1.y, -n1.x, tileConf, x, y, z, l, slopeHeight, dir, rot);
      await this.slopeNeighborSide(-n1.y, n1.x, tileConf, x, y, z, l, slopeHeight, dir, rot, { flip: true });
    }

    slopeData.texrot = tileConf.slopeTexrot ?? true;
    slopeData.texrotDiag = tileConf.slopeTexrotDiag ?? true;

    await this.loadSlopeTop(tileConf, x, y, z, l, slopeHeight, rot, slopeData);
  }
  async slopeNeighborBack(nx, ny, tileConf, x, y, z, l, slopeHeight) {
    const n1 = new core.Vector2(nx, ny);
    if (mapCell_mz3d.getCullingHeight(this.xx + n1.x, this.yy + n1.y, l) < z) {
      await this.loadWall(tileConf, x, y, z, l + 1, slopeHeight, n1);
    }
    return n1;
  }
  async slopeNeighborSide(nx, ny, tileConf, x, y, z, l, slopeHeight, dir, rot, opts = {}) {
    const n2 = new core.Vector2(nx, ny);
    const n2x = this.xx + n2.x,n2y = this.yy + n2.y;
    if (mapCell_mz3d.getCullingHeight(n2x, n2y, l) < z) {
      const otherslope = mapCell_mz3d.isRampAt(n2x, n2y, z);
      let renderSide = true;
      if (otherslope) {
        const sdir = mapCell_mz3d.yawToDir(180 - (0,util.radtodeg)(rot));
        const otherslopeData = mapCell_mz3d.getSlopeDirection(n2x, n2y, otherslope.l, true);
        const otherdir = otherslopeData.dir;
        let sizeMatch = otherslope.z2 === z && otherslope.z1 === z - slopeHeight;
        if (otherslopeData.diag) {
          let { inner, outer } = otherslopeData;
          if (!inner && !outer) {
            const sizeMatch1 = otherslope.z2 - slopeHeight === z && otherslope.z1 === z - slopeHeight;
            const sizeMatch2 = otherslope.z2 === z && otherslope.z1 + slopeHeight === z - slopeHeight;
            if (sizeMatch1) {inner = true;} else
            if (sizeMatch2) {outer = true;}
            sizeMatch = sizeMatch1 || sizeMatch2;
          }
          const hdir = (0,util.dirtoh)(otherdir),vdir = (0,util.dirtov)(otherdir);
          if (inner) {
            renderSide = !sizeMatch || sdir === 10 - hdir || sdir === 10 - vdir;
          } else if (outer) {
            const ndir = (0,util.vectodir)(n2);
            renderSide = !sizeMatch || sdir === 10 - hdir || sdir === 10 - vdir || ndir === 10 - hdir || ndir === 10 - vdir;
          }
        } else {
          renderSide = !sizeMatch || sdir !== otherdir;
        }
      };
      if (renderSide) {
        await this.loadSlopeSide(tileConf, x + n2.x / 2, y + n2.y / 2, z, l, slopeHeight, rot + Math.PI / 2, opts);
      }
    }
    return n2;
  }
  async loadSlopeTop(tileConf, x, y, z, l, slopeHeight, rot, opts = {}) {
    const tileId = opts.build_diag_tops ? tileConf.top_id : tileConf.slopeTop_id;
    const tsMaterial = await mapCell_mz3d.getCachedTilesetMaterialForTile(tileConf, opts.build_diag_tops ? 'top' : 'slopeTop');
    const isAutotile = Tilemap.isAutotile(tileId) && !tileConf[opts.build_diag_tops ? 'top_rect' : 'slopeTop_rect'];
    if (isAutotile) {
      const rects = mapCell_mz3d.getTileRects(tileId);
      for (let i = 0; i < rects.length; ++i) {
        const rect = rects[i];
        const ix = (i + 1) % 2 * -2 + 1,iy = (Math.floor(i / 2) + 1) % 2 * 2 - 1;
        let h = 0;
        let slopeshape = 0b11;
        if (opts.diag) {
          const hx = Math.round(Math.max(0, (0,util.sin)(rot) * ix)) * slopeHeight / 2;
          const hy = Math.round(Math.max(0, (0,util.cos)(rot) * iy)) * slopeHeight / 2;
          h += hx + hy;
          if (opts.noBottom) {
            //h-=slopeHeight/2
            h = 0;
            if (!hx && !hy) {
              slopeshape = 0;
            } else if (!hx ^ !hy) {
              slopeshape &= 0b01;
            }
          } else if (opts.noTop) {
            if (hx && hy) {
              slopeshape = 0;
            } else if (hx || hy) {
              slopeshape &= 0b10;
            }
          }
        } else {
          const hx = Math.max(0, (0,util.sin)(rot) * ix) * slopeHeight / 2;
          const hy = Math.max(0, (0,util.cos)(rot) * iy) * slopeHeight / 2;
          h += hx + hy;
        }
        const buildParams = [tsMaterial, rect,
        x + rect.ox / (0,util.tileSize)() - 0.25,
        y + rect.oy / (0,util.tileSize)() - 0.25,
        z - slopeHeight + h,
        0.5, slopeshape ? slopeHeight / 2 : 0, rot, { autotile: true, ...opts, noBottom: slopeshape === 0b01, noTop: slopeshape === 0b10 }];

        if (opts.build_diag_tops) {
          this.builder.addSlopeTop(...buildParams);
        } else {
          this.builder.addSlopeFace(...buildParams);
        }
      }
    } else {
      const rect = tileConf[opts.build_diag_tops ? 'top_rect' : 'slopeTop_rect'] || mapCell_mz3d.getTileRects(tileId)[0];
      const buildParams = [tsMaterial, rect,
      x, y, z - slopeHeight,
      1, slopeHeight, rot, opts];

      if (opts.build_diag_tops) {
        this.builder.addSlopeTop(...buildParams);
      } else {
        this.builder.addSlopeFace(...buildParams);
      }
    }
    if (!opts.build_diag_tops) {
      this.loadSlopeTop(tileConf, x, y, z, l, slopeHeight, rot, { ...opts, build_diag_tops: true });
    }
  }
  async loadSlopeSide(tileConf, x, y, z, l, slopeHeight, rot, options = {}) {
    const tileId = tileConf.slopeSide_id;
    if (mapCell_mz3d.isTileEmpty(tileId)) {return;}
    const tsMaterial = await mapCell_mz3d.getCachedTilesetMaterialForTile(tileConf, 'slopeSide');
    const isAutotile = Tilemap.isAutotile(tileId) && !tileConf.slopeSide_rect;
    let rect;
    if (isAutotile) {
      const { x: bx, y: by } = this.getAutotileCorner(tileId, tileConf.side_changed || tileConf.slopeSide_changed, true);
      rect = { x: (bx + 0.5) * (0,util.tileWidth)(), y: (by + 0.5) * (0,util.tileHeight)(), width: (0,util.tileWidth)(), height: (0,util.tileHeight)() };
    } else {
      rect = tileConf.slopeSide_rect ? tileConf.slopeSide_rect : mapCell_mz3d.getTileRects(tileId)[0];
    }
    const slant = mapCell_mz3d.getConfig(tileConf, 'slant', 0);
    if (slant) {
      options.slant = slant;
    }
    this.builder.addSlopeSide(tsMaterial, rect,
    x, y, z - slopeHeight,
    1, slopeHeight, rot, options);

  }
  getAutotileCorner(tileId, textureChanged, excludeTop = true) {
    return mapCell_mz3d.getTileCorner(tileId, {
      useSideWall: !textureChanged,
      excludeTop });

  }}

MapCell.neighborPositions = [
new core.Vector2(0, 1),
new core.Vector2(1, 0),
new core.Vector2(0, -1),
new core.Vector2(-1, 0)];

MapCell.diagPositions = [
new core.Vector2(1, 1),
new core.Vector2(-1, 1),
new core.Vector2(1, -1),
new core.Vector2(-1, -1)];

MapCell.allNeighborPositions = [...MapCell.neighborPositions, ...MapCell.diagPositions];
MapCell.meshCache = {};

mapCell_mz3d.getTileCorner = function (tileId, opts = {}) {
  const useSideWall = Boolean(opts.useSideWall);
  const excludeTop = Boolean(opts.excludeTop);
  const kind = Tilemap.getAutotileKind(tileId);
  let tx = kind % 8;
  let ty = Math.floor(kind / 8);
  if (useSideWall && mapCell_mz3d.isWallTile(tileId) == 1) {++ty;}
  var bx, by;
  bx = tx * 2;
  by = ty;
  if (Tilemap.isAutotile(tileId)) {
    if (Tilemap.isTileA1(tileId)) {
      if (kind < 4) {
        bx = 6 * Math.floor(kind / 2);
        by = 3 * (kind % 2) + excludeTop;
      } else {
        bx = 8 * Math.floor(tx / 4) + kind % 2 * 6;
        by = ty * 6 + Math.floor(tx % 4 / 2) * 3 + excludeTop * !(tx % 2);
        //if(excludeTop&&!(kind%2)){ by+=1; }
      }
      if (excludeTop && kind >= 4 && !(kind % 2)) {by += 1;}
    } else if (Tilemap.isTileA2(tileId)) {
      by = (ty - 2) * 3 + excludeTop;
    } else if (Tilemap.isTileA3(tileId)) {
      by = (ty - 6) * 2;
    } else if (Tilemap.isTileA4(tileId)) {
      if (excludeTop) {
        by = Math.ceil((ty - 10) * 2.5 + 0.5);
      } else {
        by = (ty - 10) * 2.5 + (ty % 2 ? 0.5 : 0);
      }
    }
  } else {
    bx = Math.floor(tileId / 128) % 2 * 8 + tileId % 8;
    by = Math.floor(tileId % 256 / 8) % 16;
  }

  return { x: bx, y: by };
};
;// CONCATENATED MODULE: ./src/tileData.js
const tileData_mz3d = window.mz3d;



Object.assign(tileData_mz3d, {

  _tilemap: null,
  getTilemap() {
    if (SceneManager._scene && SceneManager._scene._spriteset) {
      this._tilemap = SceneManager._scene._spriteset._tilemap;
    }
    return this._tilemap;
  },
  getDataMap() {
    if ($dataMap) {this._dataMap = $dataMap;}
    return this._dataMap;
  },
  mapWidth() {return this.getDataMap().width;},
  mapHeight() {return this.getDataMap().height;},
  loopHorizontal() {return this.getDataMap().scrollType & 2;},
  loopVertical() {return this.getDataMap().scrollType & 1;},

  getRegion(x, y) {
    return this.getTileId(x, y, 5);
  },

  getSetNumber(id) {
    if (Tilemap.isAutotile(id)) {
      return Tilemap.isTileA1(id) ? 0 :
      Tilemap.isTileA2(id) ? 1 : Tilemap.isTileA3(id) ? 2 : 3;
    } else {
      return Tilemap.isTileA5(id) ? 4 : 5 + Math.floor(id / 256);
    }
  },
  SETNUMBERS: { A1: 0, A2: 1, A3: 2, A4: 3, A5: 4, B: 5, C: 6, D: 7, E: 8 },
  SETNAMES: ['A1', 'A2', 'A3', 'A4', 'A5', 'B', 'C', 'D', 'E'],
  getSetName(id) {
    return this.SETNAMES[this.getSetNumber(id)];
  },
  getTsImgUrl(name) {
    if (name in this.SETNUMBERS) {
      const setN = this.SETNUMBERS[name];
      const tsName = $gameMap.tileset().tilesetNames[setN];
      if (!tsName) {return (0,util.file)(tileData_mz3d.MV3D_FOLDER, `${tileData_mz3d.TEXTURE_ERROR}.png`);}
      //return ImageManager.loadTileset(tsName)._url;
      return (0,util.file)('./', ImageManager.loadTileset(tsName)._url, 'png');
    }
    return (0,util.file)(tileData_mz3d.MV3D_FOLDER, name);
  },

  getShadowBits(x, y) {
    return this.getTileId(x, y, 4);
  },

  getTerrainTag(tileId) {
    return $gameMap.tilesetFlags()[tileId] >> 12;
  },

  getTilePassage: (0,util.overload)({
    1(tileId) {return this.getTilePassage(tileId, this.getTileConfig(tileId));},
    2(tileId, conf) {
      if ('pass' in conf) {
        return conf.pass;
      }
      const flag = $gameMap.tilesetFlags()[tileId];
      if (flag & 0x10) {return this.enumPassage.THROUGH;}
      if ((flag & 0x0f) === 0x0f) {return this.enumPassage.WALL;} else
      {return this.enumPassage.FLOOR;}
    },
    3(x, y, l) {
      const tileId = this.getTileId(x, y, l);
      return this.getTilePassage(tileId, this.getTileConfig(tileId, x, y, l));
    },
    default(tileId, x, y, l) {
      return this.getTilePassage(tileId, this.getTileConfig(tileId, x, y, l));
    } }),


  getTileAnimationData(tileConf, side) {
    const tileId = tileConf[`${side}_id`];
    if (`${side}_animData` in tileConf) {
      return tileConf[`${side}_animData`];
    }
    const animData = { animX: 0, animY: 0 };
    if (`${side}_rect` in tileConf) {return animData;}
    if (Tilemap.isTileA1(tileId)) {
      const kind = Tilemap.getAutotileKind(tileId);
      animData.animX = kind <= 1 ? 2 : kind <= 3 ? 0 : kind % 2 ? 0 : 2;
      animData.animY = kind <= 3 ? 0 : kind % 2 ? 1 : 0;
    }
    return animData;
  },

  getTileConfig: (0,util.overload)({
    2(x, y) {return this.getTileConfig(x, y, 0);},
    3(x, y, l) {return this.getTileConfig(this.getTileData(x, y)[l], x, y, l);},
    default(tileId, x, y, l) {
      const conf = {};
      if (!this.isTileEmpty(tileId)) {
        if (this.isWallTile(tileId)) {
          (0,util.assign)(conf, this.TILE_SETTINGS_WALL);
        } else if (this.isTableTile(tileId)) {
          (0,util.assign)(conf, this.TILE_SETTINGS_TABLE);
        }
        if (this.isStarTile(tileId)) {
          (0,util.assign)(conf, this.TILE_SETTINGS_STAR);
        }
        const ttag = this.getTerrainTag(tileId);
        if (ttag && ttag in this.TTAG_DATA) {
          (0,util.assign)(conf, this.TTAG_DATA[ttag]);
        }
        const ts_conf = this.tilesetConfigurations[this.normalizeAutotileId(tileId)];
        if (ts_conf) {
          (0,util.assign)(conf, ts_conf);
        }
      }
      const region = this.getRegion(x, y);
      const key = `${region},${l + 1}`;
      if (region && key in tileData_mz3d.REGION_DATA) {
        (0,util.assign)(conf, this.REGION_DATA[key]);
      }
      conf._x = x || 0;
      conf._y = y || 0;
      conf._l = l || 0;
      return conf;
    } }),


  getTileTextureOffsets(tileId, x, y, l) {
    const conf = this.getTileConfig(tileId, x, y, l);
    this._tileTextureOffset(conf, 'top', tileId, tileId);
    this._tileTextureOffset(conf, 'side', tileId, tileId);
    this._tileTextureOffset(conf, 'inside', tileId, 'side');
    this._tileTextureOffset(conf, 'bottom', tileId, 'top');
    this._tileTextureOffset(conf, 'north', tileId, 'side');
    this._tileTextureOffset(conf, 'south', tileId, 'side');
    this._tileTextureOffset(conf, 'east', tileId, 'side');
    this._tileTextureOffset(conf, 'west', tileId, 'side');

    this._tileTextureOffset(conf, 'slopeSide', tileId, 'side');
    this._tileTextureOffset(conf, 'slopeTop', tileId, 'top');
    if (!('pass' in conf)) {
      conf.pass = this.getTilePassage(tileId, conf);
    }
    return conf;
  },

  _tileTextureOffset(conf, side, tileId, dfault) {
    const tileRange = Tilemap.isAutotile(tileId) ? 48 : 1;
    let id = conf[`${side}_id`];
    if (id == null) {
      let offset = conf[`${side}_offset`];
      if (offset) {
        id = conf[`${side}_id`] = tileId + offset.x * tileRange + offset.y * tileRange * 8;
      } else {
        if (typeof dfault === 'string') {
          id = conf[`${side}_id`] = conf[`${dfault}_id`];
          conf[`${side}_img`] = conf[`${dfault}_img`];
          if (conf[`${dfault}_rect`] != null) {conf[`${side}_rect`] = conf[`${dfault}_rect`];}
        } else {
          id = conf[`${side}_id`] = dfault;
        }
      }
    }
    let img = conf[`${side}_img`];
    if (img == null) {
      conf[`${side}_img`] = this.getSetName(id);
    }
  },

  getTileId(x, y, l = 0) {
    const dataMap = this.getDataMap();if (!dataMap) {return 0;}
    const { data, width, height } = dataMap;
    if (this.loopHorizontal()) {x = x.mod(width);}
    if (this.loopVertical()) {y = y.mod(height);}
    if (x < 0 || x >= width || y < 0 || y >= height) {
      if (this.getMapConfig('edge') === 'clamp') {
        const clamp = this.getMapConfig('edgeData', 1);
        if (x >= width) {x = width + (x - width).mod(clamp) - clamp;} else
        if (x < 0) {x = x.mod(clamp);}
        if (y >= height) {y = height + (y - height).mod(clamp) - clamp;} else
        if (y < 0) {y = y.mod(clamp);}
      } else {
        return 0;
      }
    }
    return data[(l * height + y) * width + x] || 0;
  },

  getTileData(x, y) {
    const dataMap = this.getDataMap();if (!dataMap) {return [0, 0, 0, 0];}
    const { data, width, height } = dataMap;
    if (this.loopHorizontal()) {
      x = x.mod(width);
    }
    if (this.loopVertical()) {
      y = y.mod(height);
    }
    if (x < 0 || x >= width || y < 0 || y >= height) {
      if (this.getMapConfig('edge') === 'clamp') {
        const clamp = this.getMapConfig('edgeData', 1);
        if (x >= width) {x = width + (x - width).mod(clamp) - clamp;} else
        if (x < 0) {x = x.mod(clamp);}
        if (y >= height) {y = height + (y - height).mod(clamp) - clamp;} else
        if (y < 0) {y = y.mod(clamp);}
      } else {
        return [0, 0, 0, 0];
      }
    }
    if (x < 0 || x >= width || y < 0 || y >= height) {return [0, 0, 0, 0];}
    const tileData = [];
    for (let z = 0; z < 4; ++z) {//4 tile layers. Ignore shadow bits.
      tileData[z] = data[(z * height + y) * width + x] || 0;
    }
    if ([x, y] in tileData_mz3d.extraLayers) {
      tileData.push(...tileData_mz3d.extraLayers[[x, y]].map((layer) => layer.tileId));
    }
    return tileData;
  },

  getDoodad(x, y, l) {
    const cellX = Math.floor(x / tileData_mz3d.CELL_SIZE);
    const cellY = Math.floor(y / tileData_mz3d.CELL_SIZE);
    const cell = tileData_mz3d.cells[[cellX, cellY]];
    if (!cell) return null;
    x -= cell.ox;y -= cell.oy;
    return cell.doodads[[x, y, l]];
  },

  getTileHeight(x, y, l = 0, conf) {

    if (this.loopHorizontal()) {x = x.mod(this.mapWidth());}
    if (this.loopVertical()) {y = y.mod(this.mapHeight());}

    if (!conf) {
      const tileId = this.getTileData(x, y)[l];
      if (this.isTileEmpty(tileId) && l > 0) {return 0;}
      conf = this.getTileConfig(tileId, x, y, l);
    }
    // finge tiles don't stack normally. fringeHeight property should be used when drawing them.
    //if(this.isStarTile(tileId)){ return 0; }

    const shapes = this.enumShapes;

    let height = 0;
    if ('height' in conf) {
      height = tileData_mz3d.getConfig(conf, 'height', 0);
    } else if (this.isComplexShape(conf.shape)) {var _doodad$mesh;
      const doodad = this.getDoodad(x, y, l);
      height = (doodad === null || doodad === void 0 ? void 0 : (_doodad$mesh = doodad.mesh) === null || _doodad$mesh === void 0 ? void 0 : _doodad$mesh.getBoundingInfo().boundingBox.maximum.y) ?? 1;
    } else if (this.isSpecialShape(conf.shape)) {
      switch (conf.shape) {
        case shapes.SLOPE:height = 0;break;
        default:height = 1;break;}

    }
    if ('depth' in conf) {
      height -= tileData_mz3d.getConfig(conf, 'depth', 0);
    }
    if (conf.shape === shapes.SLOPE) {
      height += tileData_mz3d.getConfig(conf, 'slopeHeight', 1);
    }
    return height;
  },

  getStackHeight(x, y, layerId = 3) {
    let height = 0;
    for (let l = 0; l <= layerId; ++l) {
      const tileId = this.getTileData(x, y)[l];
      if (this.isTileEmpty(tileId)) {continue;}
      const conf = this.getTileConfig(tileId, x, y, l);
      if (conf.tileOffset) {continue;}

      height += this.getTileFringe(x, y, l, conf);
      height += this.getTileHeight(x, y, l, conf);
    }
    return height;
  },

  getTileRot(tileConf, x, y) {
    let defaultRot = 0;
    const shadowBits = this.getShadowBits(x, y);
    if (shadowBits in this._SHADOWBIT_DATA) {defaultRot = this._SHADOWBIT_DATA[shadowBits].rot;}
    return this.getConfig(tileConf, 'rot', defaultRot);
  },
  _SHADOWBIT_DATA: {
    0b0011: { dir: 2, rot: 180 },
    0b1010: { dir: 4, rot: 90 },
    0b0101: { dir: 6, rot: 270 },
    0b1100: { dir: 8, rot: 0 },
    0b0010: { dir: 1, outer: true, rot: 45 },
    0b1011: { dir: 1, inner: true, rot: 45 },
    0b0001: { dir: 3, outer: true, rot: 315 },
    0b0111: { dir: 3, inner: true, rot: 315 },
    0b1000: { dir: 7, outer: true, rot: 135 },
    0b1110: { dir: 7, inner: true, rot: 135 },
    0b0100: { dir: 9, outer: true, rot: 225 },
    0b1101: { dir: 9, inner: true, rot: 225 } },

  _SHADOWBIT_EXTRA_DATA: {
    0b1001: [3, 7],
    0b0110: [1, 9] },


  getSlopeDirection(x, y, l, fullData = false) {
    const stackHeight = this.getStackHeight(x, y, l);
    const tileId = this.getTileData(x, y)[l];
    const conf = this.getTileConfig(tileId, x, y, l);
    const slopeHeight = tileData_mz3d.getConfig(conf, 'slopeHeight', 1);
    const neighborPositions = MapCell.allNeighborPositions;
    const flag = $gameMap.tilesetFlags()[tileId];
    const shadowBits = this.getShadowBits(x, y);
    //const shadowBitDirections=[0,0b1100,0b0101,0b1010,0b0011];
    let direction;
    for (let i = 0; i < neighborPositions.length; ++i) {
      const n = neighborPositions[i];
      const d = { neighbor: n, favor: 0 };
      d.dir = 5 - 3 * n.y + n.x;
      if (d.dir % 2) {
        d.diag = true;
        d.favor -= 3; // reduce favor for diagonal directions
        if (conf.slopeInner) d.inner = true;else
        if (conf.slopeOuter) d.outer = true;
      } else {
        if (flag & 1 << d.dir / 2 - 1) {d.favor = -2;} // if direction impassable, reduce favor
        if (flag & 1 << (10 - d.dir) / 2 - 1) {d.favor = -1;} // if opposite direction impassable, reduce favor
      }
      if (shadowBits in tileData_mz3d._SHADOWBIT_DATA) {
        const shadowbitData = tileData_mz3d._SHADOWBIT_DATA[shadowBits];
        if (d.dir === shadowbitData.dir) {
          d.favor = 30;
          if (!d.outer) d.inner = shadowbitData.inner;
          if (!d.inner) d.outer = shadowbitData.outer;
        }
      } else if (shadowBits in tileData_mz3d._SHADOWBIT_EXTRA_DATA) {
        const shadowbitData = tileData_mz3d._SHADOWBIT_EXTRA_DATA[shadowBits];
        if (shadowbitData.includes(d.dir)) {
          d.favor = 30;
          // determine the inner and outer shadows corresponding to this diagonal shadow
          const index = shadowbitData.indexOf(d.dir);
          const outerShadow = shadowBits & (index ? 0b1100 : 0b0011);
          const innerShadow = ~outerShadow & 0b1111;
          // apply favor according to neighboring shadows
          if (this.getShadowBits(x + n.x, y + n.y) == outerShadow ||
          this.getShadowBits(x + n.x, y) == outerShadow ||
          this.getShadowBits(x, y + n.y) == outerShadow) {d.favor += 1;}
          if (this.getShadowBits(x - n.x, y - n.y) == innerShadow ||
          this.getShadowBits(x - n.x, y) == innerShadow ||
          this.getShadowBits(x, y - n.y) == innerShadow) {d.favor += 1;}
        }
      }
      // compare neighbor heights
      const nHeights = this.getCollisionHeights(x + n.x, y + n.y, { slopeMax: true });
      const oHeights = this.getCollisionHeights(x - n.x, y - n.y, { slopeMin: true });
      if (nHeights.some((c) => Math.abs(stackHeight - slopeHeight - c.z2) <= tileData_mz3d.STAIR_THRESH)) {d.favor += 1;}
      if (oHeights.some((c) => Math.abs(stackHeight - c.z2) <= tileData_mz3d.STAIR_THRESH)) {d.favor += 1;}

      if (conf.slopeDirection === d.dir) {d.favor = 100;} // configurated direction
      if (!direction || d.favor > direction.favor) {direction = d;}
    }
    direction.noTop = direction.inner;
    direction.noBottom = direction.outer;
    direction.rot = (0,util.degtorad)(180 - this.dirToYaw(direction.dir));
    if (fullData) {return direction;}
    return direction.rot;
  },

  getWalkHeight(x, y) {
    // get top height at x,y. Used for jumping and initializing z.
    const heights = this.getCollisionHeights(x, y);
    return heights[heights.length - 1].z2;
  },

  getSlopeHeight(x, y, l, opts = {}) {
    if (opts.slopeMin) {return 0;}
    const rx = Math.round(x),ry = Math.round(y);
    const data = opts.data ?? this.getTileConfig(this.getTileData(rx, ry)[l], rx, ry, l);
    const slopeData = opts.slopeData ?? this.getSlopeDirection(rx, ry, l, true);
    const slopeHeight = data.slopeHeight || 1;
    const { rot, dir } = slopeData;
    if (opts.slopeMax) {
      if (slopeData.diag && !slopeData.inner && !slopeData.outer) {
        return slopeHeight * 2;
      } else {
        return slopeHeight;
      }
    }
    if (slopeData.diag) {
      const xd = (0,util.dirtoh)(dir),yd = (0,util.dirtov)(dir);
      const xrot = (0,util.degtorad)(180 - this.dirToYaw(xd));
      const yrot = (0,util.degtorad)(180 - this.dirToYaw(yd));
      const xh = this.getSlopeHeight(x, y, l, { data, slopeData: { dir: xd, rot: xrot } });
      const yh = this.getSlopeHeight(x, y, l, { data, slopeData: { dir: yd, rot: yrot } });
      if (slopeData.outer) {
        return Math.max(0, xh + yh - slopeHeight);
      } else if (slopeData.inner) {
        return Math.min(slopeHeight, xh + yh);
      } else {
        return xh + yh;
      }
    } else {
      const xf = (0,util.sin)(rot),yf = -(0,util.cos)(rot);
      let px = (x + 0.5) % 1,py = (y + 0.5) % 1;
      if (Math.sign(xf < 0)) {px = 1 - px;}
      if (Math.sign(yf < 0)) {py = 1 - py;}
      const sf = Math.abs(xf) * px + Math.abs(yf) * py;
      return slopeHeight * sf;
    }
  },

  getCollisionHeights(x, y, opts = {}) {
    const rx = Math.round(x),ry = Math.round(y);
    let z = 0;
    const collisions = [{ z1: -Infinity, z2: 0 }];
    if (opts.layers) {collisions.layers = [];}
    const tileData = this.getTileData(rx, ry);
    for (let l = 0; l <= 3; ++l) {
      let h = this.getTileHeight(rx, ry, l);
      const tileId = tileData[l];
      const conf = this.getTileConfig(tileId, rx, ry, l);
      const shape = conf.shape;
      const passage = this.getTilePassage(tileId, conf);
      let skip = false;
      if (passage === this.enumPassage.THROUGH) {
        h = 0;skip = true;
      } else if (shape === this.enumShapes.SLOPE) {
        if (opts.slopeMax) {
          h = h;
        } else if (opts.slopeMin) {
          h = h - tileData_mz3d.getConfig(conf, 'slopeHeight', 1);
        } else {
          h = h - tileData_mz3d.getConfig(conf, 'slopeHeight', 1) + this.getSlopeHeight(x, y, l, conf);
        }
      }
      const fringe = this.getTileFringe(rx, ry, l);
      z += fringe;
      if (skip) {continue;}
      if (opts.onlyPlatforms && !this.isPlatformShape(shape) && passage === this.enumPassage.WALL && h > 0) {z += h;continue;}
      if (h < 0) {
        if (fringe + h < 0) {
          collisions[collisions.length - 1].z2 += fringe + h;
        }
      } else if (l === 0) {
        collisions[0].z2 = z + h;
      } else {
        collisions.push({ z1: z, z2: z + h });
      }
      z += h;
      const collision = collisions[collisions.length - 1];
      collision.l = l;
      collision.tileId = tileId;
      if (opts.layers) {collisions.layers[l] = collision;}
      if (shape === this.enumShapes.SLOPE) {collision.isSlope = true;}
      //collisions[collisions.length-1].passage=passage;
    }
    return collisions;
  },

  getTileLayers(x, y, z, gte = true) {
    const heights = tileData_mz3d.getCollisionHeights(x, y, { layers: true, slopeMin: true }).layers;
    let closest_diff = Infinity;
    let layers = [0];
    for (let l = 0; l <= 3; ++l) {
      if (!(l in heights)) {continue;}
      const conf = this.getTileConfig(x, y, l);
      const isSlope = conf.shape === this.enumShapes.SLOPE;
      const h = heights[l].z2;
      const diff = z - h;
      if (gte ? z >= h : z > h) {
        if (diff < closest_diff || isSlope && diff <= closest_diff) {
          layers = [l];
          closest_diff = diff;
        } else if (diff === closest_diff) {
          layers.push(l);
        }
      }
    }
    return layers;
  },

  getFloatHeight(x, y, z = null, gte = true) {
    const tileData = this.getTileData(x, y);
    const layers = z == null ? [0, 1, 2, 3] : this.getTileLayers(x, y, z, gte);
    let float = 0;
    for (const l of layers) {
      const tileId = tileData[l];
      if (this.isTileEmpty(tileId)) {continue;}
      const conf = this.getTileConfig(tileId, x, y, l);
      if (conf && 'float' in conf) {
        float += tileData_mz3d.getConfig(conf, 'float', 0);
      }
    }
    return float;
  },

  getStackFringeHeight(x, y, l = 3) {
    return this.getStackHeight(x, y, l);
  },

  getTileFringe(x, y, l, conf) {
    if (!conf) {
      const tileId = this.getTileData(x, y)[l];
      if (this.isTileEmpty(tileId)) {return 0;}
      conf = this.getTileConfig(tileId, x, y, l);
    }

    if (conf && 'fringe' in conf) {return tileData_mz3d.getConfig(conf, 'fringe', 0);}
    //if(this.isStarTile(tileId)){
    //	return this.FRINGE_HEIGHT;
    //}
    return 0;
  },

  getCullingHeight(x, y, layerId = 3, opts = {}) {
    let height = 0;
    const isEdge = this.isEdge(x, y);
    if (isEdge) {
      if (!this.getMapConfig('edge', true)) {return Infinity;}
    }
    if (opts.ignorePits && (isEdge || this.isTileEmpty(this.getTileId(x, y, 0)) && !this.tileHasPit(x, y))) {
      height = -this.getMapConfig('baseHeight', tileData_mz3d.BASE_HEIGHT);
    }
    const tileData = this.getTileData(x, y);
    for (let l = 0; l <= layerId; ++l) {
      if (this.getTileFringe(x, y, l)) {return height;}
      const tileId = tileData[l];
      const data = this.getTileConfig(tileId, x, y, l);
      const shape = data.shape;
      if (this.isSpecialShape(shape)) {
        if (shape === this.enumShapes.SLOPE) {
          height += this.getTileHeight(x, y, l);
          const slopeData = this.getSlopeDirection(x, y, l, true);
          const slopeDir = slopeData.dir;
          let shouldLower = false;
          if (slopeData.diag) {
            if (slopeData.outer) {
              shouldLower = true;
            } else {
              if ((!opts.dir || opts.dir !== Math.ceil(slopeDir / 3) * 3 - 1 && opts.dir !== (slopeDir - 1) % 3 + 4) && (
              !opts.dir2 || opts.dir2 !== Math.ceil(slopeDir / 3) * 3 - 1 && opts.dir2 !== (slopeDir - 1) % 3 + 4)) {
                shouldLower = true;
              }
            }
          } else {
            if ((!opts.dir || opts.dir !== slopeDir) && (
            !opts.dir2 || opts.dir2 !== slopeDir)) {
              shouldLower = true;
            }
          }

          if (shouldLower) {
            height -= data.slopeHeight || 1;
          }
        }
        return height;
      }
      if (tileData_mz3d.getConfig(data, 'rot', 0) !== 0 || tileData_mz3d.getConfig(data, 'width', 1) < 1) {
        return height;
      }
      if (opts.ignorePits && data.depth > 0) {
        height += data.depth;
      }
      height += this.getTileHeight(x, y, l);
    }
    return height;
  },

  tileHasPit(x, y, layerId = 3) {
    const tileData = this.getTileData(x, y);
    for (let l = 0; l <= layerId; ++l) {
      const tileId = tileData[l];
      const conf = this.getTileConfig(tileId, x, y, l);
      if (tileData_mz3d.getConfig(conf, 'depth', 0) > 0) {return true;}
    }
    return false;
  },

  isTilePit(x, y, l) {
    const tileId = this.getTileData(x, y)[l];
    const conf = this.getTileConfig(tileId, x, y, l);
    return tileData_mz3d.getConfig(conf, 'depth', 0) > 0;
  },

  isTileEmpty(tileId) {
    return !tileId || tileId === 1544;
  },
  isEdge(x, y) {
    if (this.getMapConfig('edge') === 'clamp') {return false;}
    const dataMap = this.getDataMap();
    return !this.loopHorizontal() && (x < 0 || x >= dataMap.width) ||
    !this.loopVertical() && (y < 0 || y >= dataMap.height);
  },
  isEdgeOrEmpty(x, y) {
    const tileData = this.getTileData(x, y);
    for (const id of tileData) {
      if (!this.isTileEmpty(id)) {return false;}
    }
    return true;
  },

  isWallTile(tileId) {
    const kind = Tilemap.getAutotileKind(tileId);
    const ty = Math.floor(kind / 8);
    const isWall = Tilemap.isTileA3(tileId) || Tilemap.isTileA4(tileId);
    if (isWall && ty % 2) {return 2;}
    return isWall;
  },

  isTableTile(tileId) {
    return Boolean(Tilemap.isTileA2(tileId) && $gameMap.tilesetFlags()[tileId] & 0x80);
  },

  isStarTile(tileId) {
    return Boolean($gameMap.tilesetFlags()[tileId] & 0x10);
  },

  isWaterfallTile(tileId) {
    const kind = Tilemap.getAutotileKind(tileId);
    return Tilemap.isTileA1(tileId) && kind >= 4 && kind % 2;
  },

  isSpecialShape(shape) {
    const shapes = tileData_mz3d.enumShapes;
    return shape && shape !== shapes.FLAT;
  },
  isComplexShape(shape) {
    return shape === tileData_mz3d.enumShapes.MODEL || shape === tileData_mz3d.enumShapes.MESH;
  },
  isPlatformShape(shape) {
    const shapes = tileData_mz3d.enumShapes;
    return shape == null || shape === shapes.FLAT || shape === shapes.SLOPE;
  },

  deconstructTileId(tileId = 0) {
    tileId = this.normalizeAutotileId(tileId);
    const tileRange = Tilemap.isAutotile(tileId) ? 48 : 1;
    const img = tileData_mz3d.getSetName(tileId) || 'B';
    const startTile = Tilemap[`TILE_ID_${img}`] || 0;
    const tx = (tileId - startTile) / tileRange % 8,ty = Math.floor((tileId - startTile) / tileRange / 8);
    return [img, tx, ty];
  },
  constructTileId(img, x, y) {
    const key = `TILE_ID_${img.toUpperCase()}`;
    let tileId = key in Tilemap ? Tilemap[key] : 0;
    const tileRange = Tilemap.isAutotile(tileId) ? 48 : 1;
    tileId += Number(x) * tileRange + Number(y) * tileRange * 8;
    return tileId;
  },
  normalizeAutotileId(tileId) {
    if (!Tilemap.isAutotile(tileId)) {return tileId;}
    const kind = Tilemap.getAutotileKind(tileId);
    return Tilemap.TILE_ID_A1 + kind * 48;
  } });
;// CONCATENATED MODULE: ./src/tileDataRects.js


const tileDataRects_mz3d = window.mz3d;

Object.assign(tileDataRects_mz3d, {

  getRectFromConf(conf, texturename) {
    const configRect = conf[`${texturename}_rect`];
    if (configRect) {
      var rect = configRect;
    } else {
      var rect = tileDataRects_mz3d.getTileRect(conf[`${texturename}_id`]);
    }
    //const uvrot = conf[`${texturename}_uvrot`];
    //if(uvrot&&!rect.uvrot)rect.uvrot=uvrot;
    return rect;
  },

  getTileRects(tileId) {
    const rects = [];
    const isTable = tileDataRects_mz3d.isTableTile(tileId);
    addTile(rects, tileId, 0, 0);
    if (isTable) for (let i = rects.length - 1; i >= 0; --i) {
      if (rects[i].oy > (0,util.tileHeight)() / 2) {
        rects[i - 1].y += (0,util.tileHeight)() * 2 / 3;
        rects.splice(i, 1);
      }
    }
    return rects;
  },
  getTileRect(tileId) {
    const rects = [];
    if (Tilemap.isAutotile(tileId)) {
      addNormalizedAutotile(rects, tileId, 0, 0);
    } else {
      addNormalTile(rects, tileId, 0, 0);
    }
    return rects[0];
  } });



const addRect = (rects, setNumber, sx, sy, dx, dy, width, height, animX, animY) => {
  rects.push({ setN: setNumber, x: sx, y: sy, width: width, height: height, ox: dx, oy: dy });
};

// The following is a modified version of MV's draw tile functions.
function addTile(rects, tileId, dx, dy) {
  if (Tilemap.isVisibleTile(tileId)) {
    if (Tilemap.isAutotile(tileId)) {
      addAutotile(rects, tileId, dx, dy);
    } else {
      addNormalTile(rects, tileId, dx, dy);
    }
  }
}

function addNormalTile(rects, tileId, dx, dy) {
  let setNumber = 0;

  if (Tilemap.isTileA5(tileId)) {
    setNumber = 4;
  } else {
    setNumber = 5 + Math.floor(tileId / 256);
  }

  const tilemap = tileDataRects_mz3d.getTilemap();

  const w = tilemap.tileWidth;
  const h = tilemap.tileHeight;
  const sx = (Math.floor(tileId / 128) % 2 * 8 + tileId % 8) * w;
  const sy = Math.floor(tileId % 256 / 8) % 16 * h;

  addRect(rects, setNumber, sx, sy, dx, dy, w, h);
}


function addAutotile(rects, tileId, dx, dy) {
  var autotileTable = Tilemap.FLOOR_AUTOTILE_TABLE;
  var kind = Tilemap.getAutotileKind(tileId);
  var shape = Tilemap.getAutotileShape(tileId);
  var tx = kind % 8;
  var ty = Math.floor(kind / 8);
  var bx = 0;
  var by = 0;
  var setNumber = 0;
  var isTable = false;
  var animX = 0,animY = 0;

  const tilemap = tileDataRects_mz3d.getTilemap();

  if (Tilemap.isTileA1(tileId)) {
    setNumber = 0;
    if (kind === 0) {
      animX = 2;
      by = 0;
    } else if (kind === 1) {
      animX = 2;
      by = 3;
    } else if (kind === 2) {
      bx = 6;
      by = 0;
    } else if (kind === 3) {
      bx = 6;
      by = 3;
    } else {
      bx = Math.floor(tx / 4) * 8;
      by = ty * 6 + Math.floor(tx / 2) % 2 * 3;
      if (kind % 2 === 0) {
        animX = 2;
      } else
      {
        bx += 6;
        autotileTable = Tilemap.WATERFALL_AUTOTILE_TABLE;
        animY = 1;
      }
    }
  } else if (Tilemap.isTileA2(tileId)) {
    setNumber = 1;
    bx = tx * 2;
    by = (ty - 2) * 3;
    isTable = tilemap._isTableTile(tileId);
  } else if (Tilemap.isTileA3(tileId)) {
    setNumber = 2;
    bx = tx * 2;
    by = (ty - 6) * 2;
    autotileTable = Tilemap.WALL_AUTOTILE_TABLE;
  } else if (Tilemap.isTileA4(tileId)) {
    setNumber = 3;
    bx = tx * 2;
    by = Math.floor((ty - 10) * 2.5 + (ty % 2 === 1 ? 0.5 : 0));
    if (ty % 2 === 1) {
      autotileTable = Tilemap.WALL_AUTOTILE_TABLE;
    }
  }

  var table = autotileTable[shape];
  var w1 = tilemap.tileWidth / 2;
  var h1 = tilemap.tileHeight / 2;
  for (var i = 0; i < 4; i++) {
    var qsx = table[i][0];
    var qsy = table[i][1];
    var sx1 = (bx * 2 + qsx) * w1;
    var sy1 = (by * 2 + qsy) * h1;
    var dx1 = dx + i % 2 * w1;
    var dy1 = dy + Math.floor(i / 2) * h1;
    if (isTable && (qsy === 1 || qsy === 5)) {
      var qsx2 = qsx;
      var qsy2 = 3;
      if (qsy === 1) {
        //qsx2 = [0, 3, 2, 1][qsx];
        qsx2 = (4 - qsx) % 4;
      }
      var sx2 = (bx * 2 + qsx2) * w1;
      var sy2 = (by * 2 + qsy2) * h1;
      addRect(rects, setNumber, sx2, sy2, dx1, dy1, w1, h1, animX, animY);
      addRect(rects, setNumber, sx1, sy1, dx1, dy1 + h1 / 2, w1, h1 / 2, animX, animY);
    } else {
      addRect(rects, setNumber, sx1, sy1, dx1, dy1, w1, h1, animX, animY);
    }
  }
}

function addNormalizedAutotile(rects, tileId) {
  tileId = tileDataRects_mz3d.normalizeAutotileId(tileId);

  const { x: sx, y: sy } = tileDataRects_mz3d.getTileCorner(tileId, { excludeTop: true });

  var kind = Tilemap.getAutotileKind(tileId);
  var setNumber = 0;
  var animX = 0,animY = 0;
  let isWaterfall = false;

  if (Tilemap.isTileA1(tileId)) {
    setNumber = 0;
    if (kind < 2) {
      animX = 2;
    } else if (kind > 3) {
      if (kind % 2 === 0) {
        animX = 2;
      } else {
        animY = 1;
        isWaterfall = true;
      }
    }
  } else if (Tilemap.isTileA2(tileId)) {
    setNumber = 1;
  } else if (Tilemap.isTileA3(tileId)) {
    setNumber = 2;
  } else if (Tilemap.isTileA4(tileId)) {
    setNumber = 3;
  }

  const tilemap = tileDataRects_mz3d.getTilemap();
  const w = tilemap.tileWidth;
  const h = tilemap.tileHeight;

  addRect(rects, setNumber, (sx + 0.5) * w, (sy + (isWaterfall ? 0 : 0.5)) * h, 0, 0, w, h, animX, animY);

}
;// CONCATENATED MODULE: ./src/loadMap.js
const loadMap_mz3d = window.mz3d;




Object.assign(loadMap_mz3d, {

  extraLayers: {},

  mapLoaded: false,
  mapReady: false,
  clearMap() {
    if (!this.setupComplete) return;
    this.extraLayers = {};
    this.mapLoaded = false;
    this.clearMapCells(true);
    this.clearModelCache();
    for (let i = this.characters.length - 1; i >= 0; --i) {
      delete this.characters[i].char.mv3d_sprite;
      this.characters[i].dispose(false, true);
    }
    this.characters.length = 0;
    this.resetCameraTarget();

    this.callFeatures('clearMap');
  },
  clearMapCells(clearCaches = false) {
    // clear materials and textures
    if (clearCaches) {
      for (const key in this.textureCache) if (this.textureCache[key] instanceof core.Texture) {
        this.textureCache[key].dispose();
      }
      for (const key in this.materialCache) if (this.textureCache[key] instanceof core.Material) {
        this.materialCache[key].dispose();
      }
      this.animatedTextures.length = 0;
      this.textureCache = {};
      this.materialCache = {};
    }

    // clear map cells
    for (const key in this.cells) {
      this.cells[key].dispose(false, clearCaches);
    }
    this.cells = {};

    for (const character of this.characters) {
      character.clearLightInclusionLists();
    }
  },
  reloadMap() {
    this.clearMapCells(false);
    if (loadMap_mz3d.mapReady) {this.updateMap();}
    this.callFeatures('reloadMap');
  },

  loadMap() {
    //this.cameraStick.x=$gamePlayer._realX;
    //this.cameraStick.y=$gamePlayer._realY;
    this.updateBlenders();
    this.updateMap();
    this.createCharacters();
    this.rememberCameraTarget();

    this.callFeatures('loadMap');
  },

  async updateMap() {
    if (this.mapUpdating) {return;}
    this.mapLoaded = true;
    this.mapUpdating = true;
    // unload Far cells
    for (const key in this.cells) {
      this.cells[key].unload = true;
    }
    // get range of cells based on render distance
    const bounds = {
      left: Math.floor((this.cameraStick.x - this.renderDist) / this.CELL_SIZE),
      right: Math.floor((this.cameraStick.x + this.renderDist) / this.CELL_SIZE),
      top: Math.floor((this.cameraStick.y - this.renderDist) / this.CELL_SIZE),
      bottom: Math.floor((this.cameraStick.y + this.renderDist) / this.CELL_SIZE) };

    //clamp cell range to map
    if (this.getMapConfig('edge') !== 'clamp') {
      if (!this.loopHorizontal()) {
        bounds.left = Math.max(0, bounds.left);
        bounds.right = Math.min(bounds.right, Math.ceil(this.mapWidth() / this.CELL_SIZE) - 1);
      }
      if (!this.loopVertical()) {
        bounds.top = Math.max(0, bounds.top);
        bounds.bottom = Math.min(bounds.bottom, Math.ceil(this.mapHeight() / this.CELL_SIZE) - 1);
      }
    }
    const cellsToLoad = [];
    for (let ix = bounds.left; ix <= bounds.right; ++ix)
    for (let iy = bounds.top; iy <= bounds.bottom; ++iy) {
      let cx = ix,cy = iy;
      if (this.loopHorizontal()) {cx = cx.mod(Math.ceil(this.mapWidth() / this.CELL_SIZE));}
      if (this.loopVertical()) {cy = cy.mod(Math.ceil(this.mapHeight() / this.CELL_SIZE));}
      const key = [cx, cy].toString();
      if (key in this.cells) {
        this.cells[key].unload = false;
      } else {
        cellsToLoad.push(new core.Vector2(cx, cy));
      }
    }
    for (const key in this.cells) {
      if (loadMap_mz3d.UNLOAD_CELLS && this.cells[key].unload) {
        this.cells[key].dispose();
        delete this.cells[key];
      }
    }
    const cameraCellPos = new core.Vector2(Math.round(this.cameraStick.x / this.CELL_SIZE - 0.5), Math.round(this.cameraStick.y / this.CELL_SIZE - 0.5));
    cellsToLoad.sort((a, b) => core.Vector2.DistanceSquared(a, cameraCellPos) - core.Vector2.DistanceSquared(b, cameraCellPos));
    if (this.mapReady) {
      cellsToLoad.length = Math.min(25, cellsToLoad.length);
    }
    for (const cellpos of cellsToLoad) {
      let { x: cx, y: cy } = cellpos;
      await this.loadMapCell(cx, cy);
      if (this.mapReady) {await (0,util.sleep)(10);}
      if (!this.mapLoaded) {this.endMapUpdate();return;}
    }
    this.endMapUpdate();
  },

  endMapUpdate() {
    this.mapUpdating = false;
    this.mapReady = true;
    /*
    for(const cell of Object.values(this.cells)){
    	cell._lastIntensiveUpdate=Date.now()+3000+9000*Math.random();
    	for(const character of cell.characters){
    		character.intensiveUpdate();
    	}
    }
    */
  },

  async loadMapCell(cx, cy) {
    const key = [cx, cy].toString();
    if (key in this.cells) {return;}
    const cell = new MapCell(cx, cy);
    this.cells[key] = cell;
    await cell.load();
    // update positions of all events to assign character cells
    if (this.mapReady) for (const character of this.characters) {
      character.needsPositionUpdate = true;
    }
  },

  _cellsNeedingIntensiveUpdate: [],
  intensiveUpdate() {
    if (this._cellsNeedingIntensiveUpdate.length === 0) {return;}
    const now = performance.now();
    let cell,index = null;
    for (cell of this._cellsNeedingIntensiveUpdate) {
      if (now - cell._lastIntensiveUpdate <= loadMap_mz3d.intensiveUpdate.interval) {continue;}
      index = this._cellsNeedingIntensiveUpdate.indexOf(cell);
      break;
    }
    if (index == null || index < 0) {return;}
    this._cellsNeedingIntensiveUpdate.splice(index, 1);
    cell._lastIntensiveUpdate = now;
    cell._needsIntensiveUpdate = false;
    for (let character of cell.characters) {
      character.intensiveUpdate();
    }
    loadMap_mz3d.scene.sortLightsByPriority();
  } });


loadMap_mz3d.intensiveUpdate.interval = 300;
;// CONCATENATED MODULE: ./src/assets.js
const assets_mz3d = window.mz3d;



Object.assign(assets_mz3d, {

  animatedTextures: [],
  textureCache: {},
  materialCache: {},

  // createTexture was here

  // getTextureUrl was here

  waitTextureLoaded(texture) {return new Promise((resolve, reject) => {
      if (texture.isReady()) {resolve(texture);}
      texture.onLoadObservable.addOnce(() => {
        resolve(texture);
      });
    });},

  waitBitmapLoaded(bitmap) {
    return new Promise((resolve) => bitmap.addLoadListener(() => resolve(bitmap)));
  },

  insertTextureExtension(filename, extension) {
    if (!extension) return filename;
    const index = filename.lastIndexOf('.');
    if (index < 0) {
      return filename + extension;
    } else {
      return filename.slice(0, index) + extension + filename.slice(index);
    }
  },

  async checkFileExists(filename) {
    this.checkFileExists.fileExistenceCache ??= {};
    if (filename in this.checkFileExists.fileExistenceCache) return this.checkFileExists.fileExistenceCache[filename];
    try {
      if (assets_mz3d.isPlaytest) {
        const fs = (__webpack_require__("fs").promises);
        await fs.access(filename, fs.constants.R_OK);
        return true;
      } else {
        const response = await fetch(filename, { method: 'HEAD' });
        this.checkFileExists.fileExistenceCache[filename] = response.ok;
        return response.ok;
      }
    } catch (err) {
      if (err.code !== 'ENOENT') console.error(err);
      this.checkFileExists.fileExistenceCache[filename] = false;
      return false;
    }
  },

  async getCachedTilesetTexture(setN, animX = 0, animY = 0, options = {}) {
    const setImg = options.img || this.SETNAMES[setN];
    const key = `TS:${this.insertTextureExtension(setImg, options.textureExtension)}|${animX},${animY}${this.getExtraBit2(options)}`;
    if (key in this.textureCache) {
      if (this.textureCache[key] === 'loading') await (0,util.sleepUntil)(() => this.textureCache[key] !== 'loading');
      return this.textureCache[key];
    }
    this.textureCache[key] = 'loading';

    const textureSrc = this.insertTextureExtension(assets_mz3d.getTsImgUrl(setImg), options.textureExtension);

    if (options.checkExists) {
      const exists = await this.checkFileExists(textureSrc);
      if (!exists) {
        this.textureCache[key] = undefined;
        return undefined;
      }
    }
    const texture = await this.createTexture(textureSrc);
    texture.hasAlpha = true;

    await this.waitTextureLoaded(texture);
    this.textureCache[key] = texture;

    if (assets_mz3d.USE_TEXTURE_DATA && !options.textureExtension) {
      const dataSrc = textureSrc.replace(/\.[0-9a-z]+$/i, '.json');
      const dataFile = await assets_mz3d.getDataFile(dataSrc);
      texture.mv3d_texture_data = dataFile;
    }
    if (this.textureCache[key] !== texture) {return await this.getErrorTexture();}
    //texture.updateSamplingMode(1);
    //texture.wrapU = Texture.CLAMP_ADDRESSMODE;
    //texture.wrapV = Texture.CLAMP_ADDRESSMODE;
    if (options.cropTexture) {
      const { width, height } = texture.getBaseSize();
      let { x, y, width: w, height: h } = assets_mz3d.finalizeTextureRect(options.cropTexture, width, height);
      texture.crop(x, y, w, h);
    }
    if (animX || animY) {
      const { width, height } = texture.getBaseSize();
      texture.frameData = options.cropTexture || { x: 0, y: 0, width, height };
      texture.animX = animX;
      texture.animY = animY;
      this.animatedTextures.push(texture);
    }
    return texture;

  },

  async getErrorTexture() {
    if (this.errorTexture) {return this.errorTexture;}
    this.errorTexture = await this.createTexture(`${assets_mz3d.MV3D_FOLDER}/${assets_mz3d.TEXTURE_ERROR}.png`);
    this.errorTexture.isError = true;
    this.errorTexture.dispose = () => {};
    return this.errorTexture;
  },

  async getBushAlphaTexture() {
    if (this.bushAlphaTexture) {return this.bushAlphaTexture;}
    this.getBushAlphaTexture.getting = true;
    this.bushAlphaTexture = await this.createTexture(`${assets_mz3d.MV3D_FOLDER}/${assets_mz3d.TEXTURE_BUSHALPHA}.png`);
    this.bushAlphaTexture.getAlphaFromRGB = true;
    this.bushAlphaTexture.dispose = () => {};
    this.getBushAlphaTexture.getting = false;
    return this.bushAlphaTexture;
  },
  getBushAlphaTextureSync() {
    if (this.bushAlphaTexture) {return this.bushAlphaTexture;}
    if (!this.getBushAlphaTexture.getting) {
      this.getBushAlphaTexture();
    }
    return null;
  },

  async getCachedTilesetMaterial(setN, animX = 0, animY = 0, options = {}) {
    this.processMaterialOptions(options);
    const key = `TS:${options.img || this.SETNAMES[setN]}|${animX},${animY}|${this.getExtraBit(options)}${this.getExtraBit2(options)}`;
    if (key in this.materialCache) {
      if (this.materialCache[key] === 'loading') await (0,util.sleepUntil)(() => this.materialCache[key] !== 'loading');
      return this.materialCache[key];
    }
    this.materialCache[key] = 'loading';
    const texture = await this.getCachedTilesetTexture(setN, animX, animY, options);
    const material = new core.StandardMaterial(key, this.scene);
    material.diffuseTexture = texture;
    if (assets_mz3d.USE_DIFFUSE_AS_SPECULAR) {material.specularTexture = material.diffuseTexture;}
    if (options.transparent) {
      material.alphaCutOff = 0;
      material.opacityTexture = texture;
      material.alpha = options.alpha;
      material.alphaCutOff = assets_mz3d.ALPHA_NO_CUTOFF;
    } else {
      material.alphaCutOff = assets_mz3d.ALPHA_CUTOFF;
    }
    if (options.through) {
      material.mv3d_through = true;
    }
    material.mv3d_noShadow = !options.shadow;
    //material.ambientColor.set(1,1,1);
    material.ambientColor.copyFrom(options.ambient);
    material.mv3d_glowColor = options.glow;
    material.emissiveColor.copyFrom(options.glow);
    if (assets_mz3d.DEFAULT_SPECULAR_COLOR) {
      material.specularColor.copyFrom(assets_mz3d.DEFAULT_SPECULAR_COLOR);
    } else {
      material.specularColor.set(0, 0, 0);
    }
    material.backFaceCulling = options.backfaceCulling;
    material.twoSidedLighting = options.twosided;
    material.maxSimultaneousLights = this.LIGHT_LIMIT;
    //material.mv3d_is_cached=true;
    this.materialCache[key] = material;

    const textureData = material.diffuseTexture.mv3d_texture_data;
    if (textureData) for (const key of ['useAlphaFromDiffuseTexture', 'alphaCutoff', 'cullBackFaces', 'specularPower']) {
      if (textureData[key] != null) {
        material[key] = textureData[key];
      }
    }

    const promises = [];

    if (assets_mz3d.USE_BUMP_TEXTURE) promises.push(this.getCachedTilesetTexture(setN, animX, animY, { ...options, textureExtension: '.bump', checkExists: true }).
    then(assets_mz3d._applyTextureDataCallback.bump(material, textureData)));
    if (assets_mz3d.USE_SPECULAR_TEXTURE) promises.push(this.getCachedTilesetTexture(setN, animX, animY, { ...options, textureExtension: '.specular', checkExists: true }).
    then(assets_mz3d._applyTextureDataCallback.specular(material, textureData)));
    if (assets_mz3d.USE_EMISSIVE_TEXTURE && !options.glow.a) promises.push(this.getCachedTilesetTexture(setN, animX, animY, { ...options, textureExtension: '.emissive', checkExists: true }).
    then(assets_mz3d._applyTextureDataCallback.emissive(material, textureData)));
    if (assets_mz3d.USE_AMBIENT_TEXTURE) promises.push(this.getCachedTilesetTexture(setN, animX, animY, { ...options, textureExtension: '.ambient', checkExists: true }).
    then(assets_mz3d._applyTextureDataCallback.ambient(material, textureData)));

    if (!assets_mz3d.mapReady) {
      await Promise.all(promises);
    }

    material.mv3d_noDispose = true;

    return material;
  },

  _applyTextureDataCallback: {
    bump: (material, textureData) => function (bumpTexture) {
      if (!bumpTexture) return;
      material.bumpTexture = bumpTexture;
      if (assets_mz3d.USE_PARALLAX_TEXTURE) {
        material.useParallax = true;
        material.useParallaxOcclusion = true;
        material.parallaxScaleBias = assets_mz3d.PARALLAX_SCALE || 0.1;
      }

      if (textureData) for (const key of ['parallaxScaleBias', 'useParallax', 'useParallaxOcclusion', 'invertNormalMapX', 'invertNormalMapY', 'useObjectSpaceNormalMap']) {
        if (textureData[key] != null) {
          material[key] = textureData[key];
        }
      }
      (0,util.lerpValue)(1000, (t) => bumpTexture.level = t);
    },
    specular: (material, textureData) => function (specularTexture) {
      if (!specularTexture) return;
      material.specularTexture = specularTexture;

      if (textureData) for (const key of ['useGlossinessFromSpecularMapAlpha', 'useSpecularOverAlpha']) {
        if (textureData[key] != null) {
          material[key] = textureData[key];
        }
      }
      if (assets_mz3d.mapReady) (0,util.lerpValue)(1000, (t) => specularTexture.level = t);
    },
    emissive: (material, textureData) => function (emissiveTexture) {
      if (!emissiveTexture) return;
      material.emissiveTexture = emissiveTexture;

      if ((textureData === null || textureData === void 0 ? void 0 : textureData.useEmissiveAsIllumination) != null) {
        material.useEmissiveAsIllumination = textureData.useEmissiveAsIllumination;
      }
      if (assets_mz3d.mapReady) (0,util.lerpValue)(1000, (t) => emissiveTexture.level = t);
    },
    ambient: (material, textureData) => function (ambientTexture) {
      if (!ambientTexture) return;
      material.ambientTexture = ambientTexture;
      if (assets_mz3d.mapReady) (0,util.lerpValue)(1000, (t) => ambientTexture.level = t);
    } },


  async getCachedTilesetMaterialForTile(tileConf, side) {
    const setN = assets_mz3d.getSetNumber(tileConf[`${side}_id`]);
    const options = assets_mz3d.getMaterialOptions(tileConf, side);
    const animData = assets_mz3d.getTileAnimationData(tileConf, side);
    //console.log(options);
    return await assets_mz3d.getCachedTilesetMaterial(setN, animData.animX, animData.animY, options);
  },

  getMaterialOptions(conf, side) {
    const options = {};
    if ('cropTexture' in conf) {options.cropTexture = conf.cropTexture;}
    if ('pass' in conf) {options.through = conf.pass === this.enumPassage.THROUGH;}
    if ('alpha' in conf) {options.alpha = conf.alpha;}
    if ('glow' in conf) {options.glow = conf.glow;}
    if ('ambient' in conf) {options.ambient = conf.ambient;}
    if ('shadow' in conf) {options.shadow = conf.shadow;}
    if (side) {
      if (`${side}_alpha` in conf) {options.alpha = conf[`${side}_alpha`];}
      if (`${side}_glow` in conf) {options.glow = conf[`${side}_glow`];}
      if (`${side}_shadow` in conf) {options.shadow = conf[`${side}_shadow`];}
      if (`${side}_img` in conf) {options.img = conf[`${side}_img`];}
    }
    if (conf.isCeiling) {
      options.through = !conf.twosided;
    }
    if (conf.twosided) {options.backfaceCulling = false;options.twosided = true;}
    if ('alpha' in options) {options.transparent = true;}
    return options;
  },

  processMaterialOptions(options) {
    if ('alpha' in options) {
      options.alpha = Math.round(options.alpha * 7) / 7;
      if (options.alph < 1) {
        options.transparent = true;
      }
    } else {options.alpha = 1;}
    if ('glow' in options) {
      options.glow.r = (0,util.unround)(options.glow.r, 255);
      options.glow.g = (0,util.unround)(options.glow.g, 255);
      options.glow.b = (0,util.unround)(options.glow.b, 255);
      options.glow.a = (0,util.unround)(options.glow.a, 7);
    } else {options.glow = new core.Color4(0, 0, 0, 0);}
    if ('ambient' in options) {
      options.ambient.r = (0,util.unround)(options.ambient.r, 255);
      options.ambient.g = (0,util.unround)(options.ambient.g, 255);
      options.ambient.b = (0,util.unround)(options.ambient.b, 255);
    } else {options.ambient = new core.Color3(1, 1, 1);}
    if (!('shadow' in options)) {options.shadow = true;}
    if (!('backfaceCulling' in options)) {options.backfaceCulling = assets_mz3d.BACKFACE_CULLING;}
  },

  getExtraBit(options) {
    // bitwise operations can play with up to 32 bits
    let extra = 0;
    extra |= Boolean(options.transparent) << 0;
    extra |= 7 - options.alpha * 7 << 1;
    extra |= !options.shadow << 4;
    extra |= options.glow.a * 7 << 5;
    extra |= options.glow.toNumber() << 8;
    // out of bits.
    let string = extra.toString(36);
    extra = 0;
    extra |= Boolean(options.through) << 0;
    extra |= !options.backfaceCulling << 1;
    extra |= Boolean(options.twosided) << 2;
    // 5 empty bits here
    extra |= 0xffffff - options.ambient.toNumber() << 8;
    // 
    string += ',' + extra.toString(36);
    return string;
  },

  getExtraBit2(options) {
    let string = '';
    if (options.cropTexture) {
      const ct = options.cropTexture;
      string += `|crop:${assets_mz3d.createRectString(ct)}`;
    }
    return string;
  },

  // animations

  lastAnimUpdate: 0,
  animXFrame: 0,
  animYFrame: 0,
  animDirection: 1,
  updateAnimations() {
    if (performance.now() - this.lastAnimUpdate <= this.ANIM_DELAY) {return;}
    this.lastAnimUpdate = performance.now();

    if (this.animXFrame <= 0) {
      this.animDirection = 1;
    } else if (this.animXFrame >= 2) {
      this.animDirection = -1;
    }
    this.animXFrame += this.animDirection;
    this.animYFrame = (this.animYFrame + 1) % 3;
    for (const texture of this.animatedTextures) {
      texture.crop(
      texture.frameData.x + texture.animX * this.animXFrame * (0,util.tileWidth)(),
      texture.frameData.y + texture.animY * this.animYFrame * (0,util.tileHeight)(),
      texture.frameData.width,
      texture.frameData.height);

    }
  } });
;// CONCATENATED MODULE: ./src/parallax.js
const parallax_mz3d = window.mz3d;


(0,util.override)(Game_Map.prototype, 'setupParallax', (o) => function () {
  o.apply(this, arguments);
  this.mv3d_parallaxX = 0;
  this.mv3d_parallaxY = 0;
}, true);

(0,util.override)(Game_Map.prototype, 'changeParallax', (o) => function (name, loopX, loopY, sx, sy) {
  if (this._parallaxLoopX && !loopX || this._parallaxSx && !sx) {
    this.mv3d_parallaxX = 0;
  }
  if (this._parallaxLoopY && !loopY || this._parallaxSy && !sy) {
    this.mv3d_parallaxY = 0;
  }
  o.apply(this, arguments);
});

(0,util.override)(Game_Map.prototype, 'updateParallax', (o) => function () {
  if (this._parallaxLoopX) {
    this.mv3d_parallaxX += this._parallaxSx / 8;
  }
  if (this._parallaxLoopY) {
    this.mv3d_parallaxY += this._parallaxSy / 8;
  }
});

(0,util.override)(Game_Map.prototype, 'parallaxOx', (o) => function () {
  let ox = this.mv3d_parallaxX;
  if (this._parallaxLoopX) {
    return ox - parallax_mz3d.blendCameraYaw.currentValue() * 816 / 90;
  }
  return ox;
});

(0,util.override)(Game_Map.prototype, 'parallaxOy', (o) => function () {
  let oy = this.mv3d_parallaxY;
  if (this._parallaxLoopY) {
    return oy - parallax_mz3d.blendCameraPitch.currentValue() * 816 / 90;
  }
  return 0;
});

/*
['setDisplayPos','scrollUp','scrollDown','scrollLeft','scrollRight'].forEach(method=>{
	const _oldMethod=Game_Map.prototype[method];
	Game_Map.prototype[method]=function(){
		if (mv3d.isDisabled()){ _oldMethod.apply(this,arguments); }
	}
});
const _updateScroll = Game_Map.prototype.updateScroll;
Game_Map.prototype.updateScroll = function() {
	if (mv3d.mapDisabled){ return _updateScroll.apply(this,arguments); }
	this._displayX = -mv3d.blendCameraYaw.currentValue()*816/3600;
	this._displayY = -mv3d.blendCameraPitch.currentValue()*816/3600;
};
*/

Game_CharacterBase.prototype.mv3d_inRenderDist = function () {
  const loopPos = parallax_mz3d.loopCoords(this.x, this.y);
  return Math.abs(loopPos.x - parallax_mz3d.cameraStick.x) <= parallax_mz3d.renderDist &&
  Math.abs(loopPos.y - parallax_mz3d.cameraStick.y) <= parallax_mz3d.renderDist;
};

(0,util.override)(Game_CharacterBase.prototype, 'isNearTheScreen', (o) => function () {
  if (!parallax_mz3d.EVENTS_UPDATE_NEAR) {return o.apply(this, arguments);}
  return this.mv3d_inRenderDist() || o.apply(this, arguments);
});


(0,util.override)(Game_Screen.prototype, 'shake', (o) => function () {
  return 0;
}, () => !parallax_mz3d.isDisabled() && SceneManager._scene instanceof Scene_Map);

(0,util.override)(Game_CharacterBase.prototype, 'screenX', (o) => function () {
  const sprite = this.mv3d_sprite;
  if (!sprite) {return o.apply(this, arguments);}
  if (SceneManager.isNextScene(Scene_Battle) && this === $gamePlayer) {
    return Graphics.width / 2;
  }
  return parallax_mz3d.getScreenPosition(sprite).x;
});

(0,util.override)(Game_CharacterBase.prototype, 'screenY', (o) => function () {
  const sprite = this.mv3d_sprite;
  if (!sprite) {return o.apply(this, arguments);}
  if (SceneManager.isNextScene(Scene_Battle) && this === $gamePlayer) {
    return Graphics.height / 2;
  }
  return parallax_mz3d.getScreenPosition(sprite).y;
});

Game_CharacterBase.prototype.mv3d_screenWidth = function () {
  const sprite = this.mv3d_sprite;if (!sprite) return this.mv_sprite ? this.mv_sprite.width : 0;
  return sprite.spriteWidth * (0,util.tileWidth)() * parallax_mz3d.getScaleForDist();
};

Game_CharacterBase.prototype.mv3d_screenHeight = function () {
  const sprite = this.mv3d_sprite;if (!sprite) return this.mv_sprite ? this.mv_sprite.height : 0;
  return sprite.spriteHeight * (0,util.tileHeight)() * parallax_mz3d.getScaleForDist();
};

Game_CharacterBase.prototype.mv3d_screenBounds = function () {
  const sprite = this.mv3d_sprite;
  if (!sprite) {
    const width = this.mv3d_screenWidth();
    const height = this.mv3d_screenHeight();
    return new PIXI.Rectangle(this.screenX() - width / 2, this.screenY() - height, width / 2, height);
  }
  const bbox = sprite.mesh.getBoundingInfo().boundingBox;
  const projections = bbox.vectorsWorld.map((v) => parallax_mz3d.getScreenPosition(v));
  let minX = Graphics.width,minY = Graphics.height,maxX = 0,maxY = 0;
  let pointsBehindCamera = 0;
  for (const projection of projections) {
    if (projection.x < minX) {minX = projection.x;}
    if (projection.y < minY) {minY = projection.y;}
    if (projection.x > maxX) {maxX = projection.x;}
    if (projection.y > maxY) {maxY = projection.y;}
    if (projection.behindCamera) {++pointsBehindCamera;}
  }
  const rect = new PIXI.Rectangle(minX, minY, maxX - minX, maxY - minY);
  rect.behindCamera = pointsBehindCamera < 8;
  return rect;
};
// EXTERNAL MODULE: ./src/data.js
var data = __webpack_require__("./src/data.js");
// EXTERNAL MODULE: ./src/features.js
var features = __webpack_require__("./src/features.js");
// EXTERNAL MODULE: ./src/plugin_support/plugin_support.js
var plugin_support = __webpack_require__("./src/plugin_support/plugin_support.js");
;// CONCATENATED MODULE: ./src/index.js




























//import './premium/index.js';
})();

// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";

// EXTERNAL MODULE: ./src/plugin_commands_mz.js
var plugin_commands_mz = __webpack_require__("./src/plugin_commands_mz.js");
// EXTERNAL MODULE: ./src/feature-effekseer.js
var feature_effekseer = __webpack_require__("./src/feature-effekseer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/index.js + 828 modules
var core = __webpack_require__("./node_modules/@babylonjs/core/index.js");
// EXTERNAL MODULE: ./src/mod_babylon.js + 53 modules
var mod_babylon = __webpack_require__("./src/mod_babylon.js");
// EXTERNAL MODULE: ./src/util.js + 917 modules
var util = __webpack_require__("./src/util.js");
;// CONCATENATED MODULE: ./src/animations.js
const animations_mz3d = window.mz3d;




Object.assign(animations_mz3d, {
  showBalloon(char) {
    if (!char) {char = $gamePlayer.mv3d_sprite;}
    return new Balloon(char);
  } });


class AnimSprite extends core.TransformNode {
  constructor(src, w, h, smooth, hue = 0) {
    super('animSprite', animations_mz3d.scene);
    this.cellWidth = w;this.cellHeight = h;
    this.cellIndex = 0;
    this.isSmooth = smooth;
    this.mesh = animations_mz3d.Meshes.BASIC.clone();
    this.mesh.isPickable = false;
    this.mesh.parent = this;
    this.mesh.setEnabled(false);
    this.material = new core.StandardMaterial('anim material', animations_mz3d.scene);
    this.mesh.material = this.material;
    this.material.useAlphaFromDiffuseTexture = true;
    //this.material.alphaCutOff = mv3d.ALPHA_CUTOFF;
    this.material.alphaCutOff = 0;
    this.material.disableLighting = true;
    this.material.emissiveColor.set(1, 1, 1);
    this.material.ambientColor.set(1, 1, 1);
    this.material.specularColor.set(0, 0, 0);
    //this.material.mv3d_glowColor = new Color4(1,1,1,1);
    this.loadTexture(src, hue);
    //this.material.emissiveTexture=this.material.diffuseTexture;

    animations_mz3d.callFeature('highlight', 'excludeHighlightMesh', this.mesh);

  }
  async loadTexture(src, hue = 0) {
    this.texture = await animations_mz3d.createTexture(src, hue);
    this.texture.hasAlpha = true;
    this.material.diffuseTexture = this.texture;
    await animations_mz3d.waitTextureLoaded(this.texture);
    this.texture.updateSamplingMode(this.isSmooth ?
    core.Texture.BILINEAR_SAMPLINGMODE :
    core.Texture.NEAREST_SAMPLINGMODE);

    this.textureLoaded = true;
    const size = this.texture.getBaseSize();
    this.cellCols = Math.floor(size.width / this.cellWidth);
  }
  update() {
    if (!this.textureLoaded) {return;}
    if (!this.mesh.isEnabled()) {this.mesh.setEnabled(true);}
    this.pitch = animations_mz3d.blendCameraPitch.currentValue() - 90;
    this.yaw = animations_mz3d.blendCameraYaw.currentValue();
    this.texture.crop(
    this.cellIndex % this.cellCols * this.cellWidth,
    Math.floor(this.cellIndex / this.cellCols) * this.cellHeight,
    this.cellWidth, this.cellHeight);

  }
  dispose() {
    if (this.keepMaterial) {
      super.dispose(false, false);
    } else {
      super.dispose(false, true);
    }

    animations_mz3d.callFeature('highlight', 'disposeHighlightMesh', this.mesh);
  }}

animations_mz3d.AnimSprite = AnimSprite;

// Balloons
class Balloon extends AnimSprite {
  constructor(char) {
    super('img/system/Balloon.png', 48, 48, false);
    this.char = char;
  }
  update() {
    if (!this.char) {return;}
    const pos = transformVectorForCharacter(new core.Vector3(0, 0.5 + this.char.spriteHeight, 0), this.char);
    this.position.copyFrom(pos);
    const bs = this.char.char.mv_sprite._balloonSprite;
    if (!bs) {return;}
    this.cellIndex = (bs._balloonId - 1) * 8 + Math.max(0, bs.frameIndex());
    super.update();
  }}

animations_mz3d.Balloon = Balloon;

const _condition_isMZ_and_enabled = () => animations_mz3d.isMZ && !animations_mz3d.isDisabled();

(0,util.override)(Sprite_Balloon.prototype, 'setup', (o) => function () {
  o.apply(this, arguments);
  if (this._target) {
    this._target._balloonSprite = this;
  }
}, _condition_isMZ_and_enabled);

(0,util.override)(Game_CharacterBase.prototype, 'endBalloon', (o) => function () {var _SceneManager$_scene$;
  const balloons = (_SceneManager$_scene$ = SceneManager._scene._spriteset) === null || _SceneManager$_scene$ === void 0 ? void 0 : _SceneManager$_scene$._balloonSprites;
  if (!balloons || !balloons.find((b) => b.targetObject === this)) {
    o.apply(this, arguments);
  }
}, _condition_isMZ_and_enabled);

// depth animations

class MV3D_Animation {
  constructor(animation) {
    this.animation = animation;
    this.spriteList = [];
    this.char = getAnimationTarget(animation).mv3d_sprite;
    MV3D_Animation.list.push(this);
    this.preloadSprites();
  }
  preloadSprites() {
    let anim1Count = 0;
    let anim2Count = 0;
    for (let f = 0; f < this.animation._animation.frames.length; ++f) {
      const frame = this.animation._animation.frames[f];
      for (let c = 0; c < frame.length; ++c) {
        const cell = frame[c];
        const pattern = cell[0];
        pattern < 100 ? ++anim1Count : ++anim2Count;
      }
    }
    for (let i = 0; i < anim1Count; ++i) {
      this.getAnimationSprite(this.animation._bitmap1._url, this.animation._animation.animation1Hue);
    }
    for (let i = 0; i < anim2Count; ++i) {
      this.getAnimationSprite(this.animation._bitmap2._url, this.animation._animation.animation2Hue);
    }
  }
  resetSpriteList() {
    for (const animationSprite of this.spriteList) {
      animationSprite.unused = true;
    }
  }
  clearUnusedSprites() {
    for (let i = this.spriteList.length - 1; i >= 0; --i) {
      const animationSprite = this.spriteList[i];
      if (animationSprite.unused) {
        animationSprite.setEnabled(false);
      }
    }
  }
  isReady() {
    for (let i = 0; i < Math.min(this.spriteList.length); ++i) {
      const anim = this.spriteList[i];
      if (!anim.textureLoaded) {
        return false;
      }
    }
    return true;
  }
  update() {
    const char = this.char;
    if (!char) {return;}
    //const cameraDirection = mv3d.camera.getDirection(mv3d.camera.getTarget());
    this.resetSpriteList();
    const frameData = this.animation._animation.frames[this.animation.currentFrameIndex()];
    if (frameData)
    for (let i = 0; i < Math.min(this.animation._cellSprites.length); ++i) {
      const cell = this.animation._cellSprites[i];
      if (!cell.visible || !cell.bitmap) {continue;}
      const pattern = frameData[i][0];
      const anim = this.getAnimationSprite(cell.bitmap._url, pattern < 100 ? this.animation._animation.animation1Hue : this.animation._animation.animation2Hue);
      anim.material.alphaMode = animations_mz3d.blendModes[cell.blendMode];

      anim.mesh.roll = (0,util.radtodeg)(cell.rotation);
      const scale = this.animation._mv3d_animationSettings.scale || 1;
      anim.mesh.scaling.x = 4 * cell.scale.x * scale;
      anim.mesh.scaling.y = 4 * cell.scale.y * scale;
      anim.material.alpha = cell.opacity / 255;

      const offsetVector = new core.Vector3(
      cell.position.x / 48 * scale,
      getAnimationOffset(this.animation) - cell.position.y / 48 * scale,
      0);
      const animationOrigin = transformVectorForCharacter(offsetVector, char);
      anim.position.copyFrom(animationOrigin);
      const scale2 = Math.pow(scale, 2);
      /*
      anim.mesh.position.set(
      	-cameraDirection.x*0.1*(i+1)*scale2,
      	-cameraDirection.y*0.1*(i+1)*scale2,
      	-cameraDirection.z*0.1*(i+1)*scale2
      );
      */
      anim.mesh.position.set(
      0,
      0,
      -0.1 * (i + 1) * scale2);


      anim.cellIndex = pattern;
      anim.update();
      //console.log(anim.isVisible);
    }
    this.clearUnusedSprites();


    if (this.animation._duration === 0) {
      this.remove();
    }
  }
  getAnimationSprite(url, hue = 0) {
    let sprite;
    const key = url + '#' + hue;
    for (const animationSprite of this.spriteList) {
      if (animationSprite._mv3d_sprite_url === key &&
      animationSprite.unused) {
        //console.log("Found reusable sprite!", animationSprite);
        animationSprite.unused = false;
        animationSprite.setEnabled(true);
        sprite = animationSprite;
        break;
      }
    }
    if (!sprite) {
      sprite = new AnimSprite(url, 192, 192, true, hue);
      this.spriteList.push(sprite);
      sprite._mv3d_sprite_url = key;
      //sprite.parent=this.char.spriteOrigin;
      const settings = this.animation._mv3d_animationSettings;
      if (settings.depth == false && settings.depth != null) {
        sprite.mesh.renderingGroupId = animations_mz3d.enumRenderGroups.FRONT;
      }
    }
    return sprite;
  }
  remove() {
    for (const animationSprite of this.spriteList) {
      animationSprite.dispose();
    }
    this.spriteList.length = 0;
    const index = MV3D_Animation.list.indexOf(this);
    if (index >= 0) {
      MV3D_Animation.list.splice(index, 1);
    }
  }}

MV3D_Animation.list = [];
animations_mz3d.Animation = MV3D_Animation;

function transformVectorForCharacter(vector, char) {
  if (!char) {return vector;}
  if (!char.isEmpty && char.shape === animations_mz3d.enumShapes.SPRITE) {
    return core.Vector3.TransformCoordinates(vector, animations_mz3d.getUnscaledMatrix(char.model.mesh));
  } else {
    return core.Vector3.TransformCoordinates(vector, animations_mz3d.getTranslationMatrix(char.model.mesh));
  }
}


// mod animations


const _map_terminate = Scene_Map.prototype.terminate;
Scene_Map.prototype.terminate = function () {
  _map_terminate.apply(this, arguments);
  for (let i = MV3D_Animation.list.length - 1; i >= 0; --i) {
    MV3D_Animation.list[i].remove();
  }
};

function getAnimationTarget(animation) {var _animation$_target;
  return ((_animation$_target = animation._target) === null || _animation$_target === void 0 ? void 0 : _animation$_target._character) ?? animation._targets[0]._character;
}

function getAnimationOffset(animation) {
  const p = animation._animation.position;
  const offset = p === 3 ? 0 : 1 - p / 2;
  const char = getAnimationTarget(animation);
  if (!char.mv3d_sprite) {return offset;}
  return offset * char.mv3d_sprite.spriteHeight;
}

function transformAnimation(animationSprite) {
  const offsetVector = new core.Vector3(0, getAnimationOffset(animationSprite), 0);
  const animationOrigin = transformVectorForCharacter(offsetVector, getAnimationTarget(animationSprite).mv3d_sprite);
  const pos = animations_mz3d.getScreenPosition(animationOrigin);

  let scale;
  if (animations_mz3d.camera.mode === mod_babylon/* ORTHOGRAPHIC_CAMERA */._P) {
    scale = animations_mz3d.getScaleForDist();
  } else {
    const dist = core.Vector3.Distance(animations_mz3d.camera.globalPosition, animationOrigin);
    scale = animations_mz3d.getScaleForDist(dist);
  }

  animationSprite.behindCamera = pos.behindCamera;
  animationSprite.x = pos.x;
  animationSprite.y = pos.y;
  animationSprite.scale.set(scale, scale);

}

const MV_Animation = window.Sprite_AnimationMV ?? Sprite_Animation;

const _animation_remove = MV_Animation.prototype.remove;
MV_Animation.prototype.remove = function () {
  if (!animations_mz3d.mapDisabled && this.mv3d_animation) {
    if (this._screenFlashSprite) {
      this.addChild(this._screenFlashSprite);
    }
    this.mv3d_animation.remove();
  }
  _animation_remove.apply(this, arguments);
};

const _animation_updateScreenFlash = MV_Animation.prototype.updateScreenFlash;
MV_Animation.prototype.updateScreenFlash = function () {
  _animation_updateScreenFlash.apply(this, arguments);
  if (!animations_mz3d.mapDisabled && SceneManager._scene instanceof Scene_Map) {
    if (this._screenFlashSprite) {
      this._screenFlashSprite.x = 0;
      this._screenFlashSprite.y = 0;
    }
  }
};

const _update_cell = MV_Animation.prototype.updateCellSprite;
MV_Animation.prototype.updateCellSprite = function (sprite, cell) {
  _update_cell.apply(this, arguments);
  if (this.behindCamera) {sprite.visible = false;}
};


const _isReady = MV_Animation.prototype.isReady;
MV_Animation.prototype.isReady = function () {
  return _isReady.apply(this, arguments) && (!animations_mz3d.is3D() || !this.mv3d_animation || this.mv3d_animation.isReady());
};
;// CONCATENATED MODULE: ./src/animations_mz.js



(0,util.override)(Spriteset_Base.prototype, 'createAnimationSprite', (o) => function (targets, animation, mirror, delay) {
  if (!this.isMVAnimation(animation)) {
    return void o.apply(this, arguments);
  }
  let opts = null;
  if (typeof mirror === 'object') {
    opts = mirror;
    o.call(this, targets, animation, false, delay);
  } else {
    o.apply(this, arguments);
  }
  const animationSprite = this._animationSprites[this._animationSprites.length - 1];
  if (!opts && mz3d.animationDepth) {
    opts = { scale: 1, depth: true };
  }
  if (opts) {
    animationSprite._mv3d_animationSettings = opts;
    animationSprite.mv3d_animation = new MV3D_Animation(animationSprite);
    if (animationSprite._screenFlashSprite) {
      mz3d.pixiContainer.addChild(animationSprite._screenFlashSprite);
    }
  } else {
    mz3d.pixiContainer.addChild(animationSprite);
  }


}, mz3d.is3D);

(0,util.override)(Spriteset_Base.prototype, 'update', (o) => function () {
  o.apply(this, arguments);
  for (const animationSprite of this._animationSprites) {
    if (animationSprite.mv3d_animation) {continue;}
    transformAnimation(animationSprite);
    animationSprite.update();
  }
}, mz3d.is3D);

(0,util.override)(Sprite_AnimationMV.prototype, 'update', (o) => function () {
  o.apply(this, arguments);
  if (this.mv3d_animation) {
    this.mv3d_animation.update();
  }
}, mz3d.is3D);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/controls/node_modules/tslib/tslib.es6.js
var extendStatics = function (d, b) {return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {d.__proto__ = b;} || function (d, b) {for (var p in b) Object.prototype.hasOwnProperty.call(b, p) && (d[p] = b[p]);}, extendStatics(d, b);};function __extends(d, b) {function __() {this.constructor = d;}if ("function" != typeof b && null !== b) throw new TypeError("Class extends value " + (b + "") + " is not a constructor or null");extendStatics(d, b), d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());}var __assign = function () {return __assign = Object.assign || function (t) {for (var s, i = 1, n = arguments.length; i < n; i++) for (var p in s = arguments[i], s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);return t;}, __assign.apply(this, arguments);};function __rest(s, e) {var t = {};for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && 0 > e.indexOf(p) && (t[p] = s[p]);if (null != s && "function" == typeof Object.getOwnPropertySymbols) for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) 0 > e.indexOf(p[i]) && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);return t;}function __decorate(decorators, target, key, desc) {var d,c = arguments.length,r = 3 > c ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; 0 <= i; i--) (d = decorators[i]) && (r = (3 > c ? d(r) : 3 < c ? d(target, key, r) : d(target, key)) || r);return 3 < c && r && Object.defineProperty(target, key, r), r;}function __param(paramIndex, decorator) {return function (target, key) {decorator(target, key, paramIndex);};}function __metadata(metadataKey, metadataValue) {if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(metadataKey, metadataValue);}function __awaiter(thisArg, _arguments, P, generator) {function adopt(value) {return value instanceof P ? value : new P(function (resolve) {resolve(value);});}return new (P || (P = Promise))(function (resolve, reject) {function fulfilled(value) {try {step(generator.next(value));} catch (e) {reject(e);}}function rejected(value) {try {step(generator["throw"](value));} catch (e) {reject(e);}}function step(result) {result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);}step((generator = generator.apply(thisArg, _arguments || [])).next());});}function __generator(thisArg, body) {function verb(n) {return function (v) {return step([n, v]);};}function step(op) {if (f) throw new TypeError("Generator is already executing.");for (; _;) try {if (f = 1, y && (t = 2 & op[0] ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;switch ((y = 0, t) && (op = [2 & op[0], t.value]), op[0]) {case 0:case 1:t = op;break;case 4:return _.label++, { value: op[1], done: !1 };case 5:_.label++, y = op[1], op = [0];continue;case 7:op = _.ops.pop(), _.trys.pop();continue;default:if ((t = _.trys, !(t = 0 < t.length && t[t.length - 1])) && (6 === op[0] || 2 === op[0])) {_ = 0;continue;}if (3 === op[0] && (!t || op[1] > t[0] && op[1] < t[3])) {_.label = op[1];break;}if (6 === op[0] && _.label < t[1]) {_.label = t[1], t = op;break;}if (t && _.label < t[2]) {_.label = t[2], _.ops.push(op);break;}t[2] && _.ops.pop(), _.trys.pop();continue;}op = body.call(thisArg, _);} catch (e) {op = [6, e], y = 0;} finally {f = t = 0;}if (5 & op[0]) throw op[1];return { value: op[0] ? op[1] : void 0, done: !0 };}var f,y,t,g,_ = { label: 0, sent: function () {if (1 & t[0]) throw t[1];return t[1];}, trys: [], ops: [] };return g = { next: verb(0), throw: verb(1), return: verb(2) }, "function" == typeof Symbol && (g[Symbol.iterator] = function () {return this;}), g;}var __createBinding = Object.create ? function (o, m, k, k2) {k2 === void 0 && (k2 = k);var desc = Object.getOwnPropertyDescriptor(m, k);(!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function () {return m[k];} }), Object.defineProperty(o, k2, desc);} : function (o, m, k, k2) {k2 === void 0 && (k2 = k), o[k2] = m[k];};function __exportStar(m, o) {for (var p in m) "default" == p || Object.prototype.hasOwnProperty.call(o, p) || __createBinding(o, m, p);}function __values(o) {var s = "function" == typeof Symbol && Symbol.iterator,m = s && o[s],i = 0;if (m) return m.call(o);if (o && "number" == typeof o.length) return { next: function () {return o && i >= o.length && (o = void 0), { value: o && o[i++], done: !o };} };throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");}function __read(o, n) {var m = "function" == typeof Symbol && o[Symbol.iterator];if (!m) return o;var r,e,i = m.call(o),ar = [];try {for (; (void 0 === n || 0 < n--) && !(r = i.next()).done;) ar.push(r.value);} catch (error) {e = { error: error };} finally {try {r && !r.done && (m = i["return"]) && m.call(i);} finally {if (e) throw e.error;}}return ar;}function __spread() {for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));return ar;}function __spreadArrays() {for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];return r;}function __spreadArray(to, from, pack) {if (pack || 2 === arguments.length) for (var ar, i = 0, l = from.length; i < l; i++) (ar || !(i in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);return to.concat(ar || Array.prototype.slice.call(from));}function __await(v) {return this instanceof __await ? (this.v = v, this) : new __await(v);}function __asyncGenerator(thisArg, _arguments, generator) {function verb(n) {g[n] && (i[n] = function (v) {return new Promise(function (a, b) {1 < q.push([n, v, a, b]) || resume(n, v);});});}function resume(n, v) {try {step(g[n](v));} catch (e) {settle(q[0][3], e);}}function step(r) {r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);}function fulfill(value) {resume("next", value);}function reject(value) {resume("throw", value);}function settle(f, v) {(f(v), q.shift(), q.length) && resume(q[0][0], q[0][1]);}if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");var i,g = generator.apply(thisArg, _arguments || []),q = [];return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {return this;}, i;}function __asyncDelegator(o) {function verb(n, f) {i[n] = o[n] ? function (v) {return (p = !p) ? { value: __await(o[n](v)), done: "return" === n } : f ? f(v) : v;} : f;}var i, p;return i = {}, verb("next"), verb("throw", function (e) {throw e;}), verb("return"), i[Symbol.iterator] = function () {return this;}, i;}function __asyncValues(o) {function verb(n) {i[n] = o[n] && function (v) {return new Promise(function (resolve, reject) {v = o[n](v), settle(resolve, reject, v.done, v.value);});};}function settle(resolve, reject, d, v) {Promise.resolve(v).then(function (v) {resolve({ value: v, done: d });}, reject);}if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");var i,m = o[Symbol.asyncIterator];return m ? m.call(o) : (o = "function" == typeof __values ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {return this;}, i);}function __makeTemplateObject(cooked, raw) {return Object.defineProperty ? Object.defineProperty(cooked, "raw", { value: raw }) : cooked.raw = raw, cooked;}var __setModuleDefault = Object.create ? function (o, v) {Object.defineProperty(o, "default", { enumerable: !0, value: v });} : function (o, v) {o["default"] = v;};function __importStar(mod) {if (mod && mod.__esModule) return mod;var result = {};if (null != mod) for (var k in mod) "default" != k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);return __setModuleDefault(result, mod), result;}function __importDefault(mod) {return mod && mod.__esModule ? mod : { default: mod };}function __classPrivateFieldGet(receiver, state, kind, f) {if ("a" === kind && !f) throw new TypeError("Private accessor was defined without a getter");if ("function" == typeof state ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");return "m" === kind ? f : "a" === kind ? f.call(receiver) : f ? f.value : state.get(receiver);}function __classPrivateFieldSet(receiver, state, value, kind, f) {if ("m" === kind) throw new TypeError("Private method is not writable");if ("a" === kind && !f) throw new TypeError("Private accessor was defined without a setter");if ("function" == typeof state ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");return "a" === kind ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;}function __classPrivateFieldIn(state, receiver) {if (null === receiver || "object" != typeof receiver && "function" != typeof receiver) throw new TypeError("Cannot use 'in' operator on non-object");return "function" == typeof state ? receiver === state : state.has(receiver);}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effectRenderer.js
var effectRenderer = __webpack_require__("./node_modules/@babylonjs/core/Materials/effectRenderer.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js
var thinRenderTargetTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/constants.js
var constants = __webpack_require__("./node_modules/@babylonjs/core/Engines/constants.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__("./node_modules/@babylonjs/core/Misc/logger.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/thinEngine.js + 1 modules
var thinEngine = __webpack_require__("./node_modules/@babylonjs/core/Engines/thinEngine.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/controls/dist/src/coreControls/baseControl.js
var BaseControl = function () {function BaseControl(parent) {parent instanceof HTMLCanvasElement ? (this._canvas = parent, this._engine = new thinEngine/* ThinEngine */.B(this._canvas, !1)) : parent instanceof thinEngine/* ThinEngine */.B ? (this._canvas = parent.getRenderingCanvas(), this._engine = parent) : (this._canvas = parent.canvas, this._engine = parent.engine), this._engine.getCaps().parallelShaderCompile = null;}return Object.defineProperty(BaseControl.prototype, "engine", { get: function () {return this._engine;}, enumerable: !1, configurable: !0 }), Object.defineProperty(BaseControl.prototype, "canvas", { get: function () {return this._canvas;}, enumerable: !1, configurable: !0 }), BaseControl.prototype.dispose = function () {this.engine.dispose();}, BaseControl;}();
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/thinTexture.js
var thinTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/thinTexture.js");
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/htmlElementTexture.js
var htmlElementTexture = __webpack_require__("./node_modules/@babylonjs/core/Materials/Textures/htmlElementTexture.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/controls/dist/src/coreControls/elementToTexture.js
function elementToTexture(engine, textureData, name, generateMipMaps, filteringType, invertY) {void 0 === generateMipMaps && (generateMipMaps = !1), void 0 === filteringType && (filteringType = constants/* Constants.TEXTURE_BILINEAR_SAMPLINGMODE */.g.TEXTURE_BILINEAR_SAMPLINGMODE), void 0 === invertY && (invertY = !0);var texture;if (textureData instanceof thinTexture/* ThinTexture */.g) texture = textureData;else if ("string" == typeof textureData) {var internalTexture = engine.createTexture(textureData, !generateMipMaps, invertY, null, filteringType);texture = new thinTexture/* ThinTexture */.g(internalTexture);} else {var htmlElementTexture_1 = new htmlElementTexture/* HtmlElementTexture */.s(name, textureData, { engine: engine, generateMipMaps: generateMipMaps, samplingMode: filteringType, scene: null });texture = htmlElementTexture_1;var onTextureUpdated_1 = function () {setTimeout(function () {htmlElementTexture_1.element = null;}, 500);};if (textureData instanceof HTMLVideoElement && textureData.readyState < textureData.HAVE_ENOUGH_DATA) {var checkIsReady_1 = function () {textureData.readyState < textureData.HAVE_ENOUGH_DATA || (engine.stopRenderLoop(checkIsReady_1), htmlElementTexture_1.update(!invertY), onTextureUpdated_1());}.bind(this);engine.runRenderLoop(checkIsReady_1);} else textureData instanceof HTMLVideoElement ? (htmlElementTexture_1.update(!invertY), onTextureUpdated_1()) : (htmlElementTexture_1.update(invertY), onTextureUpdated_1());}return texture.wrapU = constants/* Constants.TEXTURE_CLAMP_ADDRESSMODE */.g.TEXTURE_CLAMP_ADDRESSMODE, texture.wrapV = constants/* Constants.TEXTURE_CLAMP_ADDRESSMODE */.g.TEXTURE_CLAMP_ADDRESSMODE, texture;}
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js + 1 modules
var engine_renderTarget = __webpack_require__("./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js");
;// CONCATENATED MODULE: ./node_modules/@babylonjs/controls/dist/src/imageFilter/imageFilter.js
var ImageFilter = function (_super) {function ImageFilter(parent, options) {var _this = _super.call(this, parent) || this;return _this._options = options || {}, void 0 === _this._options.generateMipMaps && (_this._options.generateMipMaps = !0), void 0 === _this._options.linearFiltering && (_this._options.linearFiltering = !0), _this._generateMipMaps = _this._options.generateMipMaps && 1 < _this.engine.webGLVersion, _this._textureFiltering = _this._options.linearFiltering ? _this._generateMipMaps ? constants/* Constants.TEXTURE_TRILINEAR_SAMPLINGMODE */.g.TEXTURE_TRILINEAR_SAMPLINGMODE : constants/* Constants.TEXTURE_BILINEAR_SAMPLINGMODE */.g.TEXTURE_BILINEAR_SAMPLINGMODE : _this._generateMipMaps ? constants/* Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR */.g.TEXTURE_NEAREST_NEAREST_MIPLINEAR : constants/* Constants.TEXTURE_NEAREST_NEAREST */.g.TEXTURE_NEAREST_NEAREST, _this._initializeRenderer(), _this;}return __extends(ImageFilter, _super), ImageFilter.prototype.filter = function (textureData, filter) {var _this = this,inputTexture = elementToTexture(this.engine, textureData, "input", this._generateMipMaps, this._textureFiltering);return new Promise(function (success) {var checkIsReady = function () {inputTexture.isReady() && (_this.engine.stopRenderLoop(checkIsReady), _this.render(inputTexture, filter), inputTexture.dispose(), success());}.bind(_this);_this.engine.runRenderLoop(checkIsReady);});}, ImageFilter.prototype.getFilteredTexture = function (textureData, size, filter) {var _this = this,inputTexture = elementToTexture(this.engine, textureData, "input", this._generateMipMaps, this._textureFiltering),outputTexture = new thinRenderTargetTexture/* ThinRenderTargetTexture */.R(this.engine, size, { format: constants/* Constants.TEXTUREFORMAT_RGBA */.g.TEXTUREFORMAT_RGBA, generateDepthBuffer: !1, generateMipMaps: !1, generateStencilBuffer: !1, samplingMode: constants/* Constants.TEXTURE_BILINEAR_SAMPLINGMODE */.g.TEXTURE_BILINEAR_SAMPLINGMODE, type: constants/* Constants.TEXTURETYPE_UNSIGNED_BYTE */.g.TEXTURETYPE_UNSIGNED_BYTE });outputTexture._texture.isReady = !1;var render = function () {_this.engine.bindFramebuffer(outputTexture.renderTarget), _this._effectRenderer.setViewport(), _this.render(inputTexture, filter), _this.engine.unBindFramebuffer(outputTexture.renderTarget), _this._effectRenderer.setViewport(), outputTexture._texture.isReady = !0, outputTexture.dispose(!0), inputTexture.dispose();},checkIsReady = function () {inputTexture.isReady() && (_this.engine.stopRenderLoop(checkIsReady), render());}.bind(this);return this.engine.runRenderLoop(checkIsReady), outputTexture;}, ImageFilter.prototype.render = function (inputTexture, filter) {if (!filter) return void logger/* Logger.Error */.Y.Error("Please, specify at least a post process or an effectWrapper in the options.");if (inputTexture.isReady()) {var effect;filter instanceof effectRenderer/* EffectWrapper */.H ? (effect = filter.effect, this._effectRenderer.applyEffectWrapper(filter)) : (effect = filter.getEffect(), this._effectRenderer.bindBuffers(effect), filter.apply()), effect.setTexture("textureSampler", inputTexture), this._effectRenderer.draw();}}, ImageFilter.prototype.resize = function () {this.engine.resize(), this._effectRenderer.setViewport();}, ImageFilter.prototype.dispose = function () {this._effectRenderer.dispose(), _super.prototype.dispose.call(this);}, ImageFilter.prototype._initializeRenderer = function () {this._effectRenderer = new effectRenderer/* EffectRenderer */.I(this.engine), this._effectRenderer.setViewport();}, ImageFilter;}(BaseControl);
;// CONCATENATED MODULE: ./node_modules/@babylonjs/controls/dist/src/imageFilter/index.js

// EXTERNAL MODULE: ./src/features.js
var features = __webpack_require__("./src/features.js");
;// CONCATENATED MODULE: ./src/mz.js
const mz_mz3d = window.mz3d;









mz_mz3d.isMV = false;
mz_mz3d.isMZ = true;
mz_mz3d.MV3D_FOLDER = "img/MZ3D";

//Tilemap.prototype._mv3d_addTile = Tilemap.prototype._addTile;

const _renderWebGL = Tilemap.prototype.render;
Tilemap.prototype.render = function (renderer) {
  if (mz_mz3d.mapDisabled) {_renderWebGL.apply(this, arguments);}
};

const _boot_start = Scene_Boot.prototype.start;
Scene_Boot.prototype.start = function () {
  _boot_start.apply(this, arguments);
  mz_mz3d.setup();
  mz_mz3d.updateCanvas();
};

Object.assign(mz_mz3d, {

  async createTexture(url, hue = 0) {
    const textureUrl = await this.getTextureUrl(url);
    const texture = new BABYLON.Texture(textureUrl, mz_mz3d.scene, !mz_mz3d.MIPMAP, true, mz_mz3d.SAMPLING_MODE);
    if (hue) {
      return await hueShift(texture, hue);
    } else {
      return texture;
    }
  },

  async getTextureUrl(url) {
    const bitmap = ImageManager.loadBitmapFromUrl(encodeURI(url));
    return bitmap._image.src;
  } });



function getImageFilter() {
  if (!getImageFilter.imageFilter) {
    getImageFilter.imageFilter = new ImageFilter(mz_mz3d.engine);
  }
  window.imageFilter = getImageFilter.imageFilter;
  return getImageFilter.imageFilter;
}

function getHueShiftEffect() {
  if (getHueShiftEffect.hueShiftEffect) return getHueShiftEffect.hueShiftEffect;
  getHueShiftEffect.hueShiftEffect = new core.EffectWrapper({
    name: "HueShift",
    engine: mz_mz3d.engine,
    fragmentShader: `
			varying vec2 vUV;
			
			// Default Sampler
			uniform sampler2D textureSampler;
	
			// Custom uniforms
			uniform float hue;
	
			const vec2 scale = vec2(0.25, 1.);

			vec3 rgb2hsl(vec3 rgb){
				float r = rgb.r;
				float g = rgb.g;
				float b = rgb.b;
				float cmin = min(r,min(g,b));
				float cmax = max(r,max(g,b));
				float h = 0.0;
				float s = 0.0;
				float l = (cmin+cmax)/2.0;
				float delta = cmax - cmin;
				if(delta > 0.0){
					if(r==cmax){
						h = mod((g - b) / delta + 6.0, 6.0) / 6.0;
					}else if(g==cmax){
						h = ((b - r) / delta + 2.0) / 6.0;
					}else if(b==cmax){
						h = ((r - g) / delta + 4.0) / 6.0;
					}
					if(l<1.0){
						s = delta / (1.0 - abs(2.0 * l - 1.0));
					}
				}
				return vec3(h, s, l);
			}
			vec3 hsl2rgb(vec3 hsl){
				float h = hsl.x;
				float s = hsl.y;
				float l = hsl.z;
				float c = (1.0 - abs(2.0 * l - 1.0)) * s;
				float x = c * (1.0 - abs((mod(h * 6.0, 2.0)) - 1.0));
				float m = l - c / 2.0;
				float cm = c + m;
				float xm = x + m;
				if (h < 1.0 / 6.0) {
				  return vec3(cm, xm, m);
				} else if (h < 2.0 / 6.0) {
				  return vec3(xm, cm, m);
				} else if (h < 3.0 / 6.0) {
				  return vec3(m, cm, xm);
				} else if (h < 4.0 / 6.0) {
				  return vec3(m, xm, cm);
				} else if (h < 5.0 / 6.0) {
				  return vec3(xm, m, cm);
				} else {
				  return vec3(cm, m, xm);
				}
			}

			void main(void) 
			{
				gl_FragColor = texture2D(textureSampler, vUV);
	
				vec3 hsl = rgb2hsl(gl_FragColor.rgb);
				hsl.x = mod(hsl.x + hue, 1.0);
				gl_FragColor.rgb = hsl2rgb(hsl);

			}
		`,
    // Defines the list of existing samplers (default + customs).
    samplerNames: ["textureSampler"],
    // Defines the list of existing uniform to be bound.
    uniformNames: ["hue"] });

  return getHueShiftEffect.hueShiftEffect;
}

async function hueShift(texture, hue = 0) {
  await mz_mz3d.waitTextureLoaded(texture);
  const imageFilter = getImageFilter();
  const hueShiftEffect = getHueShiftEffect();

  hueShiftEffect.onApplyObservable.addOnce(() => {
    hueShiftEffect.effect.setFloat("hue", hue / 360);
  });

  const outputTexture = await imageFilter.mz3d_filterTexture(texture, hueShiftEffect);
  return outputTexture;
}

// takes texture, returns texture
ImageFilter.prototype.mz3d_filterTexture = async function (inputTexture, filter) {
  await mz_mz3d.waitTextureLoaded(inputTexture);
  const outputTexture = new core.RenderTargetTexture('filter texture', inputTexture.getSize(), mz_mz3d.scene, mz_mz3d.MIPMAP, true, core.Constants.TEXTURETYPE_UNSIGNED_INT, false, core.Texture.NEAREST_SAMPLINGMODE);
  outputTexture._texture.isReady = false;
  // Sets the output texture.
  this.engine.bindFramebuffer(outputTexture.renderTarget);
  // Sets the viewport to the render target texture size.
  this._effectRenderer.setViewport();
  // Render the texture as a full target quad.
  this.render(inputTexture, filter);
  // Unsets the output texture.
  this.engine.unBindFramebuffer(outputTexture.renderTarget);
  // Resets the viewport to the canvas size.
  this._effectRenderer.setViewport();
  // Notify that the texture is ready for consumption.
  outputTexture._texture.isReady = true;
  // Free up input and output resources.
  outputTexture.disposeFramebufferObjects();
  inputTexture.dispose();
  this.engine.depthCullingState.reset();
  return outputTexture;
};


// Hook into render loop
//Graphics.app.render
})();

// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/index.js + 828 modules
var core = __webpack_require__("./node_modules/@babylonjs/core/index.js");
// EXTERNAL MODULE: ./src/attributes.js
var attributes = __webpack_require__("./src/attributes.js");
// EXTERNAL MODULE: ./src/parameters.js
var parameters = __webpack_require__("./src/parameters.js");
// EXTERNAL MODULE: ./src/util.js + 917 modules
var util = __webpack_require__("./src/util.js");
;// CONCATENATED MODULE: ./src/premium/parameters_premium.js





const parameters_premium_mz3d = window.mz3d;



(0,util.assign)(parameters_premium_mz3d, {
  DYNAMIC_SHADOWS: (0,util.booleanString)(parameters/* default.dynShadowEnabled */.Z.dynShadowEnabled),
  DEFAULT_SHADOW_QUALITY: Math.max(0, ['OFF', 'LOW', 'MEDIUM', 'HIGH', 'ULTRA'].
  indexOf(parameters/* default.defShadowQuality.toUpperCase */.Z.defShadowQuality.toUpperCase())),
  SOFT_SHADOWS: (0,util.booleanString)(parameters/* default.softShadows */.Z.softShadows),
  //BACK_SHADOWS:booleanString(parameters.backShadows),
  DYNAMIC_SHADOW_RES: 1024,

  OPTION_NAME_DYNAMIC_SHADOWS: (0,parameters/* parameter */.o)('shadowQualityOptionName', "Shadow Quality", String),

  ABNORMAL: (0,util.booleanString)(parameters/* default.abnormal */.Z.abnormal),
  DYNAMIC_NORMALS: (0,util.booleanString)(parameters/* default.dynamicNormals */.Z.dynamicNormals),

  AMBIENT_OCCLUSION: (0,util.booleanString)(parameters/* default.ambientOcclusion */.Z.ambientOcclusion),
  //AMBIENT_OCCLUSION: true,

  GLOW: Number(parameters_premium_mz3d.util.booleanNumber(parameters/* default.glow */.Z.glow)), // this one should be the initial glow parameter, not the glow attribute
  get GLOW_RADIUS() {return this.glowRadius;},

  PRELOAD_MODELS: (0,parameters/* parameter */.o)('preloadModels', true, util.booleanString),
  MODEL_OPTIMIZATION: (0,parameters/* parameter */.o)('modelOptimization', parameters_premium_mz3d.enumModelOptimization.CLONING, (p) => parameters_premium_mz3d.enumModelOptimization[p.toUpperCase()]),

  HIGHLIGHT: (0,parameters/* parameter */.o)('highlight', true, util.booleanString),


  USE_BUMP_TEXTURE: (0,parameters/* parameter */.o)('useBumpTexture', true, util.booleanString),
  USE_PARALLAX_TEXTURE: (0,parameters/* parameter */.o)('useParallaxOcclusion', false, util.booleanString),
  PARALLAX_SCALE: (0,parameters/* parameter */.o)('parallaxScale', 0.01, Number),

  USE_SPECULAR_TEXTURE: (0,parameters/* parameter */.o)('useSpecularTexture', true, util.booleanString),
  USE_DIFFUSE_AS_SPECULAR: (0,parameters/* parameter */.o)('diffuseAsSpecular', false, util.booleanString),
  SPECULAR_MODE: (0,parameters/* parameter */.o)('specularMode', parameters_premium_mz3d.enumSpecularMode.AVERAGE_DIFFUSE, (v) => parameters_premium_mz3d.enumSpecularMode[v]),
  //DEFAULT_SPECULAR_COLOR: new Color3(.333,.333,.333),//#555

  USE_EMISSIVE_TEXTURE: (0,parameters/* parameter */.o)('useEmissiveTexture', true, util.booleanString),

  USE_AMBIENT_TEXTURE: (0,parameters/* parameter */.o)('useAmbientTexture', false, util.booleanString) });
;// CONCATENATED MODULE: ./src/premium/mod_babylon_premium.js


const mod_babylon_premium_mz3d = window.mz3d;
const { MaterialHelper } = BABYLON;

mod_babylon_premium_mz3d.getDepthMap = function (camera = mod_babylon_premium_mz3d.camera) {
  const depthRenderer = camera.getScene().enableDepthRenderer(camera);
  const depthMap = depthRenderer.getDepthMap();
  if (depthMap.mv3d_modded) {return depthMap;}
  depthRenderer._mv3d_modDepthRenderer();
  depthMap.mv3d_modded = true;
  return depthMap;
};

core.DepthRenderer.prototype._mv3d_modDepthRenderer = function () {
  const _oldCustomRenderFunction = this._depthMap.customRenderFunction;
  this._depthMap.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => {
    _oldCustomRenderFunction(opaqueSubMeshes, alphaTestSubMeshes, [], depthOnlySubMeshes);
    _oldCustomRenderFunction([], transparentSubMeshes, [], []);
  };
  this._depthMap.getCustomRenderList = () => {
    return this._camera.getActiveMeshes().data;
  };
  this._depthMap.mv3d_modded = true;
};

const _renderSubMeshForShadowMap = core.ShadowGenerator.prototype._renderSubMeshForShadowMap;
core.ShadowGenerator.prototype._renderSubMeshForShadowMap = function (subMesh) {
  const material = subMesh.getMaterial();
  if (!material || material.mv3d_noShadow) {return;}
  _renderSubMeshForShadowMap.apply(this, arguments);
};


// fix enabling and disabling postprocesses

core.PostProcessRenderEffect.prototype._enable = function (cameras) {
  const cams = core.Tools.MakeArray(cameras || Object.values(this._cameras));
  if (!cams) {return;}

  for (let i = 0; i < cams.length; i++) {
    const camera = cams[i];
    const cameraName = camera.name;
    const postProcesses = this._postProcesses[this._singleInstance ? 0 : cameraName];

    for (let j = 0; j < this._indicesForCamera[cameraName].length; j++) {
      if (camera._postProcesses[this._indicesForCamera[cameraName][j]] === undefined || camera._postProcesses[this._indicesForCamera[cameraName][j]] === null) {
        camera.attachPostProcess(postProcesses[j], this._indicesForCamera[cameraName][j]);
      }
    }
  }
};

core.PostProcessRenderEffect.prototype._disable = function (cameras) {
  const cams = core.Tools.MakeArray(cameras || Object.values(this._cameras));
  if (!cams) {return;}

  for (let i = 0; i < cams.length; i++) {
    const camera = cams[i];
    const cameraName = camera.name;
    for (const postProcess of this._postProcesses[this._singleInstance ? 0 : cameraName]) {
      camera.detachPostProcess(postProcess);
    }
  }
};

core.PostProcessRenderEffect.prototype._enablePostProcess = function (postProcess, cameras = null) {
  const cams = core.Tools.MakeArray(cameras || Object.values(this._cameras));
  if (!cams) {return;}

  for (let i = 0; i < cams.length; i++) {
    const camera = cams[i];
    const cameraName = camera.name;

    const j = this._postProcesses[this._singleInstance ? 0 : cameraName].indexOf(postProcess);
    if (j < 0) {continue;}

    if (camera._postProcesses[this._indicesForCamera[cameraName][j]] === undefined || camera._postProcesses[this._indicesForCamera[cameraName][j]] === null) {
      camera.attachPostProcess(postProcess, this._indicesForCamera[cameraName][j]);
    }
  }
};

core.PostProcessRenderEffect.prototype._disablePostProcess = function (postProcess, cameras = null) {
  const cams = core.Tools.MakeArray(cameras || Object.values(this._cameras));
  if (!cams) {return;}

  for (let i = 0; i < cams.length; i++) {
    const camera = cams[i];
    camera.detachPostProcess(postProcess);
  }
};
// EXTERNAL MODULE: ./src/premium/views.js
var views = __webpack_require__("./src/premium/views.js");
;// CONCATENATED MODULE: ./src/premium/feature-dynamicShadows.js


const feature_dynamicShadows_mz3d = window.mz3d;
const { util: feature_dynamicShadows_util, Feature, Blender, ColorBlender } = feature_dynamicShadows_mz3d;
const { makeColor } = feature_dynamicShadows_util;
const {
  TransformNode, DirectionalLight, ShadowGenerator, Vector3, Mesh } =
window.BABYLON;

//const { BILLBOARDMODE_X, BILLBOARDMODE_Y, BILLBOARDMODE_Z, BILLBOARDMODE_ALL, BILLBOARDMODE_NONE, BILLBOARDMODE_USE_POSITION } = BABYLON.Mesh;

new Feature('dynamicShadows', {
  setup() {
    feature_dynamicShadows_mz3d.sunNode = new TransformNode("sunNode", feature_dynamicShadows_mz3d.scene);
    feature_dynamicShadows_mz3d.sunlight = new DirectionalLight('sunlight', new Vector3(0, -1, 0), feature_dynamicShadows_mz3d.scene);
    feature_dynamicShadows_mz3d.sunlight.renderPriority = 10;
    feature_dynamicShadows_mz3d.sunlight.parent = feature_dynamicShadows_mz3d.sunNode;
    feature_dynamicShadows_mz3d.sunlight.specular.set(1, 1, 1);
    feature_dynamicShadows_mz3d.shadowGenerator = new ShadowGenerator(feature_dynamicShadows_mz3d.DYNAMIC_SHADOW_RES, feature_dynamicShadows_mz3d.sunlight);
    //setupShadowGeneratorObservers(mv3d.shadowGenerator);
    feature_dynamicShadows_mz3d.shadowGenerator.transparencyShadow = true;
    feature_dynamicShadows_mz3d.shadowGenerator.enableSoftTransparentShadow = true;
    //mv3d.shadowGenerator.forceBackFacesOnly=mv3d.BACK_SHADOWS;
    //mv3d.shadowGenerator.useCloseExponentialShadowMap=true;
    feature_dynamicShadows_mz3d.shadowGenerator.usePercentageCloserFiltering = feature_dynamicShadows_mz3d.SOFT_SHADOWS;
    //mv3d.shadowGenerator.usePoissonSampling=true;

    feature_dynamicShadows_mz3d.blendSunYaw = new Blender('sunYaw', 45);
    feature_dynamicShadows_mz3d.blendSunYaw.cycle = 360;
    feature_dynamicShadows_mz3d.blendSunPitch = new Blender('sunPitch', 45);
    feature_dynamicShadows_mz3d.blendSunPitch.cycle = 360;
    feature_dynamicShadows_mz3d.blendSunColor = new ColorBlender('sunColor', 0xffffff);
    applyShadowSettings();
  },
  update() {
    feature_dynamicShadows_mz3d.sunNode.position.copyFrom(feature_dynamicShadows_mz3d.cameraStick.position);
    for (const lightsource of shadowLights) {
      if (!lightsource.shadowGenerator) continue;
      if (lightsource._mv3d_updated_range !== lightsource.range) updateShadowGenerator(lightsource);
    }
  },
  blend(reorient) {
    if (reorient | feature_dynamicShadows_mz3d.blendSunYaw.update() | feature_dynamicShadows_mz3d.blendSunPitch.update() |
    feature_dynamicShadows_mz3d.blendSunColor.update()) {
      feature_dynamicShadows_mz3d.sunNode.yaw = feature_dynamicShadows_mz3d.blendSunYaw.currentValue();
      feature_dynamicShadows_mz3d.sunNode.pitch = feature_dynamicShadows_mz3d.blendSunPitch.currentValue();
      feature_dynamicShadows_mz3d.sunlight.diffuse.set(...feature_dynamicShadows_mz3d.blendSunColor.currentComponents());
      feature_dynamicShadows_mz3d.sunlight.mv3d_updateSpecularFromDiffuse();
      this._updateEnabled();
    }
  },
  _updateEnabled() {
    if (feature_dynamicShadows_mz3d.blendSunColor.currentValue()) {
      if (!feature_dynamicShadows_mz3d.sunlight.isEnabled()) {feature_dynamicShadows_mz3d.sunlight.setEnabled(true);}
    } else {
      if (feature_dynamicShadows_mz3d.sunlight.isEnabled()) {feature_dynamicShadows_mz3d.sunlight.setEnabled(false);}
    }
  },
  clearMap() {
    feature_dynamicShadows_mz3d.shadowGenerator.getShadowMap().renderList.splice(0, Infinity);
  },
  createCellMesh(mesh) {
    mesh.receiveShadows = true;
    //mv3d.shadowGenerator.getShadowMap().renderList.push(mesh);
    feature_dynamicShadows_mz3d.shadowGenerator.addShadowCaster(mesh);
  },
  destroyCellMesh(mesh) {
    feature_dynamicShadows_mz3d.shadowGenerator.removeShadowCaster(mesh);
  },
  createCharMesh(mesh) {
    const index = feature_dynamicShadows_mz3d.shadowGenerator.getShadowMap().renderList.indexOf(mesh);
    if (index === -1) {
      if (!mesh.isAnInstance) {
        mesh.receiveShadows = true;
      }
      feature_dynamicShadows_mz3d.shadowGenerator.addShadowCaster(mesh);
    }
  },
  destroyCharMesh(mesh) {
    feature_dynamicShadows_mz3d.shadowGenerator.removeShadowCaster(mesh);
  },
  updateParameters() {
    applyShadowSettings();
    this._updateEnabled();
  },
  applyMapSettings(mapconf) {
    if ('sunColor' in mapconf) {
      feature_dynamicShadows_mz3d.blendSunColor.setValue(mapconf.sunColor, 0);
    }
    if ('sunYaw' in mapconf) {
      feature_dynamicShadows_mz3d.blendSunYaw.setValue(mapconf.sunYaw, 0);
    }
    if ('sunPitch' in mapconf) {
      feature_dynamicShadows_mz3d.blendSunPitch.setValue(mapconf.sunPitch, 0);
    }
    this._updateEnabled();
  },

  disposeCharacter(char) {var _char$lamp, _char$flashlight;
    if ((_char$lamp = char.lamp) !== null && _char$lamp !== void 0 && _char$lamp.shadowGenerator) {
      const index = shadowLights.indexOf(char.lamp);
      if (index >= 0) shadowLights.splice(index, 1);
      char.lamp.shadowGenerator.dispose();
    }
    if ((_char$flashlight = char.flashlight) !== null && _char$flashlight !== void 0 && _char$flashlight.shadowGenerator) {
      const index = shadowLights.indexOf(char.flashlight);
      if (index >= 0) shadowLights.splice(index, 1);
      char.flashlight.shadowGenerator.dispose();
    }
  },

  setupLightInclusionList(lightsource) {
    if (!lightsource.shadowGenerator) {return;}
    //lightsource.shadowGenerator._shadowMap.renderList = lightsource.includedOnlyMeshes;
    lightsource.mv3d_meshesInRange ??= [];
    if (lightsource.shadowGenerator._shadowMap.renderList !== lightsource.mv3d_meshesInRange) {
      lightsource.shadowGenerator._shadowMap.renderList = lightsource.mv3d_meshesInRange;
    }
    return;
  } },
() => feature_dynamicShadows_mz3d.DYNAMIC_SHADOWS);

let shadowQuality = feature_dynamicShadows_mz3d.DEFAULT_SHADOW_QUALITY;

if (feature_dynamicShadows_mz3d.DYNAMIC_SHADOWS) feature_dynamicShadows_mz3d.options['mv3d-dynShadow'] = {
  name: feature_dynamicShadows_mz3d.OPTION_NAME_DYNAMIC_SHADOWS,
  values: ['OFF', 'LOW', 'MEDIUM', 'HIGH', 'ULTRA'],
  default: feature_dynamicShadows_mz3d.DEFAULT_SHADOW_QUALITY,
  apply(v) {
    v = !v ? 0 : Math.pow(2, v - 1);
    shadowQuality = v;
  } };


function applyShadowSettings() {
  feature_dynamicShadows_mz3d.sunlight.shadowFrustumSize = feature_dynamicShadows_mz3d.RENDER_DIST * 2;
  feature_dynamicShadows_mz3d.sunlight.shadowMinZ = -feature_dynamicShadows_mz3d.RENDER_DIST;
  feature_dynamicShadows_mz3d.sunlight.shadowMaxZ = feature_dynamicShadows_mz3d.RENDER_DIST;
  feature_dynamicShadows_mz3d.shadowGenerator.mv3d_biasStrength = 10;
  updateShadowGenerator(feature_dynamicShadows_mz3d.sunlight, feature_dynamicShadows_mz3d.shadowGenerator, feature_dynamicShadows_mz3d.RENDER_DIST);
  for (const lightsource of shadowLights) {
    if (!lightsource.shadowGenerator) continue;
    updateShadowGenerator(lightsource);
  }
  if (feature_dynamicShadows_mz3d.MODEL_OPTIMIZATION === feature_dynamicShadows_mz3d.enumModelOptimization.INSTANCING) for (const mesh of Object.values(feature_dynamicShadows_mz3d.modelInstanceCache)) {
    // fixes bug where instanced models disappear when turning shadows off.
    mesh.receiveShadows = shadowQuality ? mesh._mv3d_receiveShadows : false;
  }
}

function updateShadowGenerator(lightsource, shadowGenerator = lightsource.shadowGenerator, range = lightsource.range) {
  shadowGenerator.frustumEdgeFalloff = 0;
  lightsource._mv3d_updated_range = range;
  if (shadowQuality) {
    lightsource.shadowEnabled = true;
    const res = Math.min(4096, range * 24 * shadowQuality);
    shadowGenerator._mapSize = res;
    shadowGenerator.recreateShadowMap();
    const bias = (shadowGenerator.mv3d_biasStrength || 0) / res;
    shadowGenerator.bias = bias;
  } else {
    lightsource.shadowEnabled = false;
  }
}

if (feature_dynamicShadows_mz3d.DYNAMIC_SHADOWS) Object.assign(feature_dynamicShadows_mz3d.PluginCommand.prototype, {
  sun(...a) {
    var time = this._TIME(a[2]);
    switch (a[0].toLowerCase()) {
      case 'color':this._sunColor(a[1], time);return;
      case 'yaw':this._sunYaw(a[1], time);return;
      case 'pitch':this._sunPitch(a[1], time);return;
      case 'angle':
        time = this._TIME(a[3]);
        this._sunYaw(a[1], time);
        this._sunPitch(a[2], time);
        return;
      //case 'intensity': this._lightIntensity(a[1],time); return;
    }
    time = this._TIME(a[3]);
    this._sunColor(a[0], time);
    this._sunYaw(a[1], time);
    this._sunPitch(a[2], time);
  },
  _sunColor(color, time = 1) {feature_dynamicShadows_mz3d.blendSunColor.setValue(makeColor(color).toNumber(), time);},
  _sunYaw(deg, time = 1) {this._RELATIVE_BLEND(feature_dynamicShadows_mz3d.blendSunYaw, deg, time);},
  _sunPitch(deg, time = 1) {this._RELATIVE_BLEND(feature_dynamicShadows_mz3d.blendSunPitch, deg, time);} });


if (feature_dynamicShadows_mz3d.DYNAMIC_SHADOWS) Object.assign(feature_dynamicShadows_mz3d.mapConfigurationFunctions, {
  sun: new feature_dynamicShadows_mz3d.ConfigurationFunction('color[dir]yaw,pitch', function (conf, params) {
    const { color, yaw, pitch } = params;
    if (color) {conf.sunColor = makeColor(color).toNumber();}
    if (yaw) {conf.sunYaw = Number(yaw);}
    if (pitch) {conf.sunPitch = Number(pitch);}
  }) });


const shadowLights = [];

feature_dynamicShadows_mz3d.Character.prototype.setupLampShadow = function () {
  setupShadowGenerator(this.lamp, 1);
};

feature_dynamicShadows_mz3d.Character.prototype.setupFlashlightShadow = function () {
  setupShadowGenerator(this.flashlight, 2);
};

function setupShadowGenerator(lightsource, biasStrength = 1) {
  if (lightsource.shadowGenerator) {return;}
  lightsource.shadowGenerator = new ShadowGenerator(10, lightsource);
  //setupShadowGeneratorObservers(lightsource.shadowGenerator);
  lightsource.shadowGenerator.transparencyShadow = true;
  lightsource.shadowGenerator.enableSoftTransparentShadow = true;
  lightsource.shadowGenerator.usePercentageCloserFiltering = feature_dynamicShadows_mz3d.SOFT_SHADOWS;
  shadowLights.push(lightsource);
  lightsource.shadowGenerator.mv3d_biasStrength = biasStrength;
  updateShadowGenerator(lightsource);
}

/*
// make billboards face shadow generator before rendering shadows
// cool idea but a few issues
// characters cast a shadow onto themselves
// and shadow is facing the wrong way sometimes
function setupShadowGeneratorObservers(shadowGenerator){
	// TODO: mess with this later :>
	shadowGenerator.onBeforeShadowMapRenderMeshObservable.add(mesh=>{
		if(!mesh.billboardMode){ return; }
		mesh._mv3d_shadowgen_billboardMode = mesh.billboardMode;
		mesh._mv3d_shadowgen_rotation = mesh.rotation.clone();
		mesh.billboardMode = BILLBOARDMODE_NONE;
		if(shadowGenerator._light instanceof DirectionalLight){
			mesh.rotation.copyFrom(shadowGenerator._light.direction);
		}
		mesh._isDirty=true;
		mesh.computeWorldMatrix();
	});
	shadowGenerator.onAfterShadowMapRenderMeshObservable.add(mesh=>{
		if(!mesh._mv3d_shadowgen_billboardMode){ return; }
		mesh.billboardMode = mesh._mv3d_shadowgen_billboardMode;
		mesh.rotation.copyFrom(mesh._mv3d_shadowgen_rotation);
		delete mesh._mv3d_shadowgen_billboardMode;
	});
}
*/
// EXTERNAL MODULE: ./src/mod_babylon.js + 53 modules
var mod_babylon = __webpack_require__("./src/mod_babylon.js");
;// CONCATENATED MODULE: ./src/premium/feature-alphaFog.js


const feature_alphaFog_mz3d = window.mz3d;
const { Attribute, Feature: feature_alphaFog_Feature } = feature_alphaFog_mz3d;
const { assign: feature_alphaFog_assign, override } = feature_alphaFog_mz3d.util;

const {
  Vector2, PostProcess } =
window.BABYLON;

const { NEAREST_SAMPLINGMODE, BILINEAR_SAMPLINGMODE } = BABYLON.Texture;

var alphaFogEffect;

new feature_alphaFog_Feature('alphaFog', {
  setup() {
    alphaFogEffect = new AlphaFogPostProcess('alphaFog', feature_alphaFog_mz3d.getDepthMap(feature_alphaFog_mz3d.camera));
    feature_alphaFog_mz3d.effects.alphaFog = alphaFogEffect;
  },
  lateSetup() {
    updateAlphaFog();
  },
  updateCameraMode: updateAlphaFog,
  loadMap: updateAlphaFog,
  blend(reorient) {
    if (reorient) {updateAlphaFog();}
  } });

const feature = feature_alphaFog_mz3d.features.alphaFog.methods;

override(Game_Map.prototype, "changeParallax", (o) => function () {
  o.apply(this, arguments);
  feature_alphaFog_mz3d.updateClearColor();
  feature_alphaFog_mz3d.updateBlenders(true);
});

function updateAlphaFog() {
  //addOrRemoveEffect(alphaFogEffect,mv3d.hasAlphaFog&&!mv3d.lensEffect);
  addOrRemoveEffect(alphaFogEffect, feature_alphaFog_mz3d.hasAlphaFog);
}
feature_alphaFog_mz3d.updateAlphaFog = updateAlphaFog;

function addOrRemoveEffect(effect, shouldBeOn) {
  //const index = mv3d.camera._postProcesses.indexOf(effect);
  if (shouldBeOn) {
    //if(index<0){ mv3d.camera._postProcesses.push(effect); }
    feature_alphaFog_mz3d.enablePostProcessEffect(effect);
  } else {
    //if(index>=0){ mv3d.camera._postProcesses.splice(index,1); }
    feature_alphaFog_mz3d.disablePostProcessEffect(effect);
  }
}

feature_alphaFog_assign(feature_alphaFog_mz3d, {

  alphaFog: new Attribute('alphaFog', feature_alphaFog_mz3d.parameters.alphaFog, (n) => {
    return Number(n);
  }).onChange(() => {
    if (!$gameMap) {return;}
    //updateAlphaFog(); //gets called from updateBlenders now
    feature_alphaFog_mz3d.updateClearColor();
    feature_alphaFog_mz3d.updateBlenders(true);

  }),
  get ALPHA_FOG() {return this.alphaFog;},

  get hasAlphaFog() {
    return Boolean(feature_alphaFog_mz3d.camera.mode !== mod_babylon/* ORTHOGRAPHIC_CAMERA */._P && feature_alphaFog_mz3d.ALPHA_FOG && feature_alphaFog_mz3d.hasBackground && feature_alphaFog_mz3d.scene.postProcessesEnabled);
  } });


class AlphaFogPostProcess extends PostProcess {
  constructor(name, depthMap) {
    super(name, "alphaFog", ['alphaFog'], ['depthMap'], 1, null, NEAREST_SAMPLINGMODE, feature_alphaFog_mz3d.engine);
    this.depthMap = depthMap;
    this.depthMap.resize({ width: Graphics.width, height: Graphics.height });

    this.onApplyObservable.add((effect) => {
      effect.setTexture("depthMap", this.depthMap);
      effect.setFloat("alphaFog", feature_alphaFog_mz3d.ALPHA_FOG);
    });

  }}

BABYLON.Effect.ShadersStore.alphaFogPixelShader = `
varying vec2 vUV;
uniform sampler2D textureSampler;
uniform sampler2D depthMap;
uniform float alphaFog;
void main(void) {
	gl_FragColor=texture2D(textureSampler,vUV).rgba;
	gl_FragColor.a *= min(1.0,(1.0-texture2D(depthMap,vUV).r)/alphaFog);
	//gl_FragColor.a = min(1.0,(1.0-texture2D(depthMap,vUV).r)/alphaFog);
	//gl_FragColor.a ${feature_alphaFog_mz3d.isMV ? '*' : ''}= min(1.0,(1.0-texture2D(depthMap,vUV).r)/alphaFog);
	gl_FragColor.rgb*=gl_FragColor.a;

	//gl_FragColor=texture2D(depthMap,vUV).rgba;
	//gl_FragColor.b=(0.5-texture2D(depthMap,vUV).r)*2.0-0.5;
}
`;
// EXTERNAL MODULE: ./src/features.js
var features = __webpack_require__("./src/features.js");
;// CONCATENATED MODULE: ./src/premium/feature-glow.js






const feature_glow_mz3d = window.mz3d;


new features/* Feature */.L('glowLayer', {
  setup() {
    feature_glow_mz3d.glowLayer = new core.GlowLayer('glow', feature_glow_mz3d.scene, {
      mainTextureRatio: 0.5,
      blurKernelSize: feature_glow_mz3d.GLOW_RADIUS });

    feature_glow_mz3d.glowLayer.intensity = feature_glow_mz3d.GLOW;
    feature_glow_mz3d.glowLayer.customEmissiveColorSelector = getGlowColor;
  },

  blend() {
    if (feature_glow_mz3d.blendResolutionScale.updated && feature_glow_mz3d.glowLayer.mainTexture.isReady() || feature_glow_mz3d.blendResolutionScale.updatedFinal) {
      feature_glow_mz3d.glowRadius = feature_glow_mz3d.glowRadius;
    }
  } },

() => feature_glow_mz3d.GLOW);

function getGlowColor(mesh, subMesh, material, result) {var _this$_emissiveTextur;
  const glow = material.mv3d_glowColor;

  if (!glow) {
    result.copyFrom(new core.Color4(0, 0, 0, 0));
    return result;
  }

  result.copyFrom(glow);
  result.r *= glow.a;result.g *= glow.a;result.b *= glow.a;

  let textureLevel = ((_this$_emissiveTextur = this._emissiveTextureAndColor.texture) === null || _this$_emissiveTextur === void 0 ? void 0 : _this$_emissiveTextur.level) ?? 1.0;
  const emissiveIntensity = material.emissiveIntensity ?? 1;
  textureLevel *= emissiveIntensity;

  result.r *= textureLevel;result.g *= textureLevel;result.b *= textureLevel;


  if (feature_glow_mz3d.glowThroughWalls) {
    result.a = material.alpha * glow.a;
  } else {
    result.a = material.alpha;
  }

  return result;
}

if (feature_glow_mz3d.GLOW) (0,util.assign)(feature_glow_mz3d, {
  glowIntensity: new attributes/* Attribute */.a('glowIntensity', parameters/* default.glow */.Z.glow, util.booleanNumber).onChange(() => {
    feature_glow_mz3d.glowLayer.intensity = feature_glow_mz3d.glowIntensity;
  }),
  glowRadius: new attributes/* Attribute */.a('glowRadius', parameters/* default.glowRadius */.Z.glowRadius, Number).onChange(() => {
    const resScale = feature_glow_mz3d.blendResolutionScale.currentValue();
    feature_glow_mz3d.glowLayer.blurKernelSize = feature_glow_mz3d.glowRadius * resScale;
  }),
  glowThroughWalls: new attributes/* Attribute */.a('glowThroughWalls', (0,util.booleanString)(parameters/* default.glowThroughWalls */.Z.glowThroughWalls), util.booleanString) });
// EXTERNAL MODULE: ./src/model.js
var model = __webpack_require__("./src/model.js");
;// CONCATENATED MODULE: ./src/premium/feature-highlight.js







const feature_highlight_mz3d = window.mz3d;


new features/* Feature */.L('highlight', {
  setup() {
    feature_highlight_mz3d.highlightLayer = new core.HighlightLayer('highlight', feature_highlight_mz3d.scene);

    const compareFunc = function (a, b) {
      if (feature_highlight_mz3d.highlightLayer._meshes[a._mesh.uniqueId] && feature_highlight_mz3d.highlightLayer._excludedMeshes[b._mesh.uniqueId]) {
        return -1;
      }
      if (feature_highlight_mz3d.highlightLayer._meshes[b._mesh.uniqueId] && feature_highlight_mz3d.highlightLayer._excludedMeshes[a._mesh.uniqueId]) {
        return 1;
      }
      //return 0;
      return core.RenderingGroup.frontToBackSortCompare(a, b);

    };
    feature_highlight_mz3d.scene.setRenderingOrder(feature_highlight_mz3d.enumRenderGroups.MAIN, null, compareFunc, null);
  },

  blend() {
    if (feature_highlight_mz3d.blendResolutionScale.updated) {
      feature_highlight_mz3d.highlightRadius = feature_highlight_mz3d.highlightRadius;
    }
  },

  highlightMesh(mesh, color = 'white') {
    feature_highlight_mz3d.highlightLayer.addMesh(mesh, (0,util.makeColor)(color));
    this.unexcludeHighlightMesh(mesh);
  },

  unHighlightMesh(mesh) {
    if (!feature_highlight_mz3d.highlightLayer._meshes[mesh.uniqueId]) return;
    feature_highlight_mz3d.highlightLayer.removeMesh(mesh);
    delete feature_highlight_mz3d.highlightLayer._meshes[mesh.uniqueId];
  },

  excludeHighlightMesh(mesh) {
    if (feature_highlight_mz3d.highlightLayer._excludedMeshes[mesh.uniqueId]) return;
    if (feature_highlight_mz3d.highlightLayer._meshes[mesh.uniqueId]) return;
    feature_highlight_mz3d.highlightLayer.addExcludedMesh(mesh);
  },
  unexcludeHighlightMesh(mesh) {
    if (!feature_highlight_mz3d.highlightLayer._excludedMeshes[mesh.uniqueId]) return;
    feature_highlight_mz3d.highlightLayer.removeExcludedMesh(mesh);
    delete feature_highlight_mz3d.highlightLayer._excludedMeshes[mesh.uniqueId];
  },
  disposeHighlightMesh(mesh) {
    this.unHighlightMesh(mesh);
    this.unexcludeHighlightMesh(mesh);
  },

  createCellMesh(mesh) {
    if (feature_highlight_mz3d.highlightThroughWalls) {
      this.excludeHighlightMesh(mesh);
    }
  },

  destroyCellMesh(mesh) {
    this.disposeHighlightMesh(mesh);
  },
  destroyCharMesh(mesh) {
    this.disposeHighlightMesh(mesh);
  },

  updateCharacterAlpha(char) {
    // thanks yorae
    for (const mesh of char.model.meshes) excludeOrUnexcludeMesh(mesh);
  },

  configureChar(char) {
    const color = char.getConfig('highlight', null);
    for (const mesh of char.model.meshes) {
      if (color) {
        this.highlightMesh(mesh, color);
      } else {
        this.unHighlightMesh(mesh);
        excludeOrUnexcludeMesh(mesh);
      }
    }

  },

  configureDoodad(doodad) {
    const color = feature_highlight_mz3d.getConfig(doodad.conf, 'highlight', null);
    for (const mesh of doodad.meshes) {
      if (color) {
        this.highlightMesh(mesh, color);
      } else {
        excludeOrUnexcludeMesh(mesh);
      }
    }
  },

  disposeCharacter(char) {
    this.disposeHighlightMesh(char.shadow);
  } },

() => feature_highlight_mz3d.HIGHLIGHT);
const feature_highlight_feature = feature_highlight_mz3d.features.highlight.methods;

if (feature_highlight_mz3d.HIGHLIGHT) {
  (0,util.assign)(feature_highlight_mz3d.eventConfigurationFunctions, {
    highlight(conf, color = 'none') {
      // throughWalls can be true, false, or auto
      if (!(0,util.booleanString)(color)) {
        delete conf.highlight;
      } else {
        conf.highlight = (0,util.makeColor)(color);
      }

    } });


  feature_highlight_mz3d.tilesetConfigurationFunctions.highlight = feature_highlight_mz3d.eventConfigurationFunctions.highlight;
}


if (feature_highlight_mz3d.HIGHLIGHT) (0,util.assign)(feature_highlight_mz3d, {
  highlight: new attributes/* Attribute */.a('highlight', (0,parameters/* parameter */.o)('highlight', 'true'), (v) => (0,util.booleanString)(v, 'inner', 'outer')).onChange(() => {
    if (feature_highlight_mz3d.highlight === 'inner') {
      feature_highlight_mz3d.highlightLayer.innerGlow = true;
      feature_highlight_mz3d.highlightLayer.outerGlow = false;
    } else if (feature_highlight_mz3d.highlight === 'outer') {
      feature_highlight_mz3d.highlightLayer.innerGlow = false;
      feature_highlight_mz3d.highlightLayer.outerGlow = true;
    } else if (feature_highlight_mz3d.highlight) {
      feature_highlight_mz3d.highlightLayer.innerGlow = feature_highlight_mz3d.highlightLayer.outerGlow = true;
    } else {
      feature_highlight_mz3d.highlightLayer.innerGlow = feature_highlight_mz3d.highlightLayer.outerGlow = false;
    }
  }),
  highlightRadius: new attributes/* Attribute */.a('highlightRadius', (0,parameters/* parameter */.o)('highlightRadius', 1), parseFloat).onChange(() => {
    const resScale = feature_highlight_mz3d.blendResolutionScale.currentValue();
    feature_highlight_mz3d.highlightLayer.blurHorizontalSize = feature_highlight_mz3d.highlightLayer.blurVerticalSize = resScale * feature_highlight_mz3d.highlightRadius;
  }),
  highlightThroughWalls: new attributes/* Attribute */.a('highlightThroughWalls', parameters/* default.highlightThroughWalls */.Z.highlightThroughWalls, util.booleanString).onChange(() => {
    for (const cell of Object.values(feature_highlight_mz3d.cells)) {
      if (cell.mesh) (0,model/* withMesh */.gn)(cell.mesh, excludeOrUnexcludeMesh);
      for (let i = 0; i < cell.doodads.length; ++i) {
        const doodad = cell.doodads[i];
        if (feature_highlight_mz3d.getConfig(doodad.conf, 'highlight', null)) continue;
        (0,model/* withMesh */.gn)(doodad.mesh, excludeOrUnexcludeMesh);
      }
    }
    for (const char of feature_highlight_mz3d.characters) {
      if (char.getConfig('highlight', null)) continue;
      (0,model/* withMesh */.gn)(char.model.mesh, excludeOrUnexcludeMesh);
    }
  }) });


function excludeOrUnexcludeMesh(mesh) {var _mesh$material;
  if (feature_highlight_mz3d.highlightThroughWalls || (_mesh$material = mesh.material) !== null && _mesh$material !== void 0 && _mesh$material.needAlphaBlendingForMesh(mesh)) {
    feature_highlight_feature.excludeHighlightMesh(mesh);
  } else {
    feature_highlight_feature.unexcludeHighlightMesh(mesh);
  }
}
;// CONCATENATED MODULE: ./src/premium/feature-skybox-material.js
function createSkyboxMaterial(reflectiontexture) {
  // from https://nodematerial-editor.babylonjs.com/#DQCKTU
  var nodeMaterial = new BABYLON.NodeMaterial("node");

  nodeMaterial.backFaceCulling = true;
  nodeMaterial.sideOrientation = BABYLON.Orientation.CW;

  // InputBlock
  var position = new BABYLON.InputBlock("position");
  position.visibleInInspector = false;
  position.visibleOnFrame = false;
  position.target = 1;
  position.setAsAttribute("position");

  // TransformBlock
  var Worldposition = new BABYLON.TransformBlock("World position");
  Worldposition.visibleInInspector = false;
  Worldposition.visibleOnFrame = false;
  Worldposition.target = 1;
  Worldposition.complementZ = 0;
  Worldposition.complementW = 1;

  // InputBlock
  var World = new BABYLON.InputBlock("World");
  World.visibleInInspector = false;
  World.visibleOnFrame = false;
  World.target = 1;
  World.setAsSystemValue(BABYLON.NodeMaterialSystemValues.World);

  // ReflectionTextureBlock
  var Reflectiontexture = new BABYLON.ReflectionTextureBlock("Reflection texture");
  Reflectiontexture.visibleInInspector = true;
  Reflectiontexture.visibleOnFrame = false;
  Reflectiontexture.target = 3;
  /*
  Reflectiontexture.texture = new BABYLON.CubeTexture(
          "textures/skybox",
           scene,
           [],
           true,
           [
               "textures/skybox_px.jpg",
               transparentPixel,//"textures/skybox_py.jpg",
               "textures/skybox_pz.jpg",
               "textures/skybox_nx.jpg",
               "textures/skybox_ny.jpg",
               "textures/skybox_nz.jpg"
          ]);
  Reflectiontexture.texture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
  */

  // TransformBlock
  var Worldnormal = new BABYLON.TransformBlock("World normal");
  Worldnormal.visibleInInspector = false;
  Worldnormal.visibleOnFrame = false;
  Worldnormal.target = 1;
  Worldnormal.complementZ = 0;
  Worldnormal.complementW = 0;

  // InputBlock
  var normal = new BABYLON.InputBlock("normal");
  normal.visibleInInspector = false;
  normal.visibleOnFrame = false;
  normal.target = 1;
  normal.setAsAttribute("normal");

  // InputBlock
  var Cameraposition = new BABYLON.InputBlock("Camera position");
  Cameraposition.visibleInInspector = false;
  Cameraposition.visibleOnFrame = false;
  Cameraposition.target = 1;
  Cameraposition.setAsSystemValue(BABYLON.NodeMaterialSystemValues.CameraPosition);

  // InputBlock
  var View = new BABYLON.InputBlock("View");
  View.visibleInInspector = false;
  View.visibleOnFrame = false;
  View.target = 1;
  View.setAsSystemValue(BABYLON.NodeMaterialSystemValues.View);

  // FragmentOutputBlock
  var FragmentOutput = new BABYLON.FragmentOutputBlock("FragmentOutput");
  FragmentOutput.visibleInInspector = false;
  FragmentOutput.visibleOnFrame = false;
  FragmentOutput.target = 2;
  FragmentOutput.convertToGammaSpace = false;
  FragmentOutput.convertToLinearSpace = false;
  FragmentOutput.useLogarithmicDepth = false;

  // MultiplyBlock
  var Multiply = new BABYLON.MultiplyBlock("Multiply");
  Multiply.visibleInInspector = false;
  Multiply.visibleOnFrame = false;
  Multiply.target = 4;

  // InputBlock
  var Opacity = new BABYLON.InputBlock("Opacity");
  Opacity.visibleInInspector = false;
  Opacity.visibleOnFrame = false;
  Opacity.target = 1;
  Opacity.value = 1;
  Opacity.min = 0;
  Opacity.max = 0;
  Opacity.isBoolean = false;
  Opacity.matrixMode = 0;
  Opacity.animationType = BABYLON.AnimatedInputBlockTypes.None;
  Opacity.isConstant = false;

  // TransformBlock
  var projector = new BABYLON.TransformBlock("projector");
  projector.visibleInInspector = false;
  projector.visibleOnFrame = false;
  projector.target = 1;
  projector.complementZ = 0;
  projector.complementW = 1;

  // InputBlock
  var ViewxProjection = new BABYLON.InputBlock("View x Projection");
  ViewxProjection.visibleInInspector = false;
  ViewxProjection.visibleOnFrame = false;
  ViewxProjection.target = 1;
  ViewxProjection.setAsSystemValue(BABYLON.NodeMaterialSystemValues.ViewProjection);

  // VertexOutputBlock
  var VertexOutput = new BABYLON.VertexOutputBlock("VertexOutput");
  VertexOutput.visibleInInspector = false;
  VertexOutput.visibleOnFrame = false;
  VertexOutput.target = 1;

  // Connections
  position.output.connectTo(Worldposition.vector);
  World.output.connectTo(Worldposition.transform);
  Worldposition.output.connectTo(projector.vector);
  ViewxProjection.output.connectTo(projector.transform);
  projector.output.connectTo(VertexOutput.vector);
  position.output.connectTo(Reflectiontexture.position);
  Worldposition.output.connectTo(Reflectiontexture.worldPosition);
  normal.output.connectTo(Worldnormal.vector);
  World.output.connectTo(Worldnormal.transform);
  Worldnormal.output.connectTo(Reflectiontexture.worldNormal);
  World.output.connectTo(Reflectiontexture.world);
  Cameraposition.output.connectTo(Reflectiontexture.cameraPosition);
  View.output.connectTo(Reflectiontexture.view);
  Reflectiontexture.rgb.connectTo(FragmentOutput.rgb);
  Reflectiontexture.a.connectTo(Multiply.left);
  Opacity.output.connectTo(Multiply.right);
  Multiply.output.connectTo(FragmentOutput.a);

  // Output nodes
  nodeMaterial.addOutputNode(VertexOutput);
  nodeMaterial.addOutputNode(FragmentOutput);
  nodeMaterial.build();

  Object.defineProperty(nodeMaterial, 'reflectionTexture', {
    get() {return Reflectiontexture.texture;},
    set(v) {Reflectiontexture.texture = v;nodeMaterial.build();} });

  Object.defineProperty(nodeMaterial, 'alpha', {
    get() {return Opacity.value;},
    set(v) {Opacity.value = v;nodeMaterial.build();} });


  return nodeMaterial;
}
;// CONCATENATED MODULE: ./src/premium/feature-skybox.js




const feature_skybox_mz3d = window.mz3d;
const {
  Feature: feature_skybox_Feature, ConfigurationFunction, util: feature_skybox_util } = feature_skybox_mz3d;

const {
  file, booleanString } =
feature_skybox_util;
const {
  MeshBuilder, StandardMaterial, CubeTexture, Color3, Vector3: feature_skybox_Vector3, Quaternion,
  FreeCamera, RenderTargetTexture, TransformNode: feature_skybox_TransformNode } =
window.BABYLON;
const SKYBOX_MODE = BABYLON.Texture.SKYBOX_MODE;

Object.defineProperties(feature_skybox_mz3d, {
  hasSkybox: {
    get() {return Boolean(feature_skybox_mz3d._hasSkybox);} } });



new feature_skybox_Feature('skybox', {
  setup() {
    feature_skybox_mz3d.skyboxScene = new core.Scene(this.engine);
    feature_skybox_mz3d.skyboxScene.clearColor.set(0, 0, 0, 0);

    feature_skybox_mz3d.skyboxes = Skyboxes.list;
    feature_skybox_mz3d.skyballs = Skyballs.list;

    feature_skybox_mz3d.skyboxCamera = new FreeCamera("skyboxCamera", new feature_skybox_Vector3(0, 0, 0), feature_skybox_mz3d.skyboxScene);
    feature_skybox_mz3d.skyboxCamera.minZ = 0.1;
    feature_skybox_mz3d.skyboxCamera.maxZ = 2;

    feature_skybox_mz3d.skyboxNode = new feature_skybox_TransformNode('skyboxNode', feature_skybox_mz3d.skyboxScene);
    //mv3d.skyboxCamera.z=-1000;
    feature_skybox_mz3d.skyboxCamera.fov = feature_skybox_mz3d.camera.fov;
    feature_skybox_mz3d.skyboxNode.parent = feature_skybox_mz3d.skyboxCamera;
  },
  createViews() {
    if (!feature_skybox_mz3d.skyboxView) {
      feature_skybox_mz3d.skyboxView = new feature_skybox_mz3d.View({ camera: feature_skybox_mz3d.skyboxCamera, index: -1 });
      feature_skybox_mz3d.skyboxView.disable();
    }
  },
  blend(reorient) {
    if (!feature_skybox_mz3d.hasSkybox) {return;}
    if (reorient) {
      enableOrDisableSkybox();
    }

    let blendUpdated = false;
    if (!reorient) {
      for (const key in feature_skybox_mz3d.skyboxes) {
        if (updateSkyboxBlend(feature_skybox_mz3d.skyboxes[key])) blendUpdated = true;
      }
      for (const key in feature_skybox_mz3d.skyballs) {
        if (updateSkyboxBlend(feature_skybox_mz3d.skyballs[key])) blendUpdated = true;
      }
    }

    if (reorient || blendUpdated || feature_skybox_mz3d.blendCameraPitch.updated || feature_skybox_mz3d.blendCameraYaw.updated || feature_skybox_mz3d.blendCameraRoll.updated || feature_skybox_mz3d.blendResolutionScale.updated) {
      updateSkyboxTransform();
    }
  },
  updateParameters() {
    feature_skybox_mz3d.skyboxCamera.fov = feature_skybox_mz3d.camera.fov;
  },

  beforeMapLoad(newmap) {
    if (newmap) {
      feature_skybox_mz3d.clearData('skyboxes');
      feature_skybox_mz3d.clearData('skyballs');
    }
  },

  async afterMapLoad(newmap) {
    refreshSkyboxes(true);
  } });


const feature_skybox_feature = feature_skybox_mz3d.features.skybox.methods;

const skyboxFolder = 'img/parallaxes';

const transparentPixel = feature_skybox_mz3d.isMV ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" : "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
const transparentImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAzAAAAMwAQMAAADFxhdYAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAGdJREFUeF7twAENAAAAwiD7p7bHB0sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgSF8AAeKuOtcAAAAASUVORK5CYII=";

function createSkyboxTextureList(params) {
  const {
    bottom = params.default || params.top || params.north || params.south || params.east || params.west,
    top = params.default || params.bottom || params.north || params.south || params.east || params.west,
    north = params.default || params.south || params.east || params.west || params.top || params.bottom,
    south = params.default || params.north || params.east || params.west || params.top || params.bottom,
    east = params.default || params.west || params.north || params.south || params.top || params.bottom,
    west = params.default || params.east || params.north || params.south || params.top || params.bottom } =
  params;
  const textures = [east, top, north, west, bottom, south];
  for (let i = 0; i < textures.length; ++i) {
    if (!booleanString(textures[i])) {
      textures[i] = i === 0 ? transparentImage : transparentPixel;
    }
  }
  return textures.map((u) => file(skyboxFolder, u, 'png'));
}

feature_skybox_mz3d.mapConfigurationFunctions.skybox = new ConfigurationFunction(
'default,top,bottom,north,west,south,east|index,alpha[autorotate]aryaw,arpitch,arroll[rotation]yaw,pitch,roll', function (conf, params) {
  const index = Number(params.index || 0);
  const alpha = Number(params.alpha ?? 1);
  const autoRotate = new feature_skybox_Vector3(+params.arpitch || 0, +params.aryaw || 0, +params.arroll || 0);
  const rotation = new feature_skybox_Vector3(+params.pitch || 0, +params.yaw || 0, +params.roll || 0);
  //conf.skybox=[east,top,north,west,bottom,south].map(u=>file(skyboxFolder,u,'png'));
  conf.skyboxes ??= [];
  conf.skyboxes[index] = {
    textures: createSkyboxTextureList(params),
    alpha, autoRotate, rotation };

});
feature_skybox_mz3d.mapConfigurationFunctions.skyball = new ConfigurationFunction(
'texture,repeat|index,alpha[autorotate]aryaw,arpitch,arroll[rotation]yaw,pitch,roll', function (conf, params) {
  const texture = file(skyboxFolder, params.texture, 'png');
  const index = Number(params.index || 0);
  const repeat = Number(params.repeat ?? 1);
  const alpha = Number(params.alpha ?? 1);
  const autoRotate = new feature_skybox_Vector3(+params.arpitch || 0, +params.aryaw || 0, +params.arroll || 0);
  const rotation = new feature_skybox_Vector3(+params.pitch || 0, +params.yaw || 0, +params.roll || 0);

  conf.skyballs ??= [];
  conf.skyballs[index] = {
    texture, repeat, alpha, autoRotate, rotation };

});


function interpretSkyboxArgs(a) {
  if ((0,util.booleanNumber)(a[0]) === false) {
    if (a[1] >= 0) {
      Skyballs.clear(Number(a[1]));
      return [0, { index: a[1], clear: true }];
    } else {
      return [0, { clear: true }];
    }

  }
  let i = 0;
  let index = 0;
  if (a[0] >= 0) {
    i = 1;
    index = a[0];
    if (!booleanString(a[1]) && a.length === 2) {
      return [i, { index, clear: true }];
    }
  }
  return [i, { index }];
}

feature_skybox_mz3d.registerCommand('skyball', (...a) => {
  let [i, settings] = interpretSkyboxArgs(a);
  if (settings.clear) return settings;

  settings.time = 0;
  for (; i < a.length; ++i) {
    const side = a[i].toLowerCase();
    switch (side) {
      case 'texture':
        if (a[i + 1] != null) settings[side] = a[i + 1];++i;break;
      case 'alpha':case 'repeat':
        if (a[i + 1] != null) settings[side] = Number(a[i + 1]);++i;break;
      case 'autorotate':
        settings.autoRotate ??= { x: 0, y: 0, z: 0 };
        switch (a[i + 1].toLowerCase()) {
          case 'yaw':
            settings.autoRotate.y = a[i + 2] || 0;
            i += 2;break;
          case 'pitch':
            settings.autoRotate.x = a[i + 2] || 0;
            i += 2;break;
          case 'roll':
            settings.autoRotate.z = a[i + 2] || 0;
            i += 2;break;
          default:
            settings.autoRotate = {
              x: +a[i + 2] || 0,
              y: +a[i + 1] || 0,
              z: +a[i + 3] || 0 };

            i += 3;break;}

        break;
      default:
        if (i === a.length - 1 && isFinite(a[i])) {
          settings.time = Number(a[i]);
        } else if (!settings.texture) {settings.texture = a[i];}}

  }



  return settings;

}, (args) => {
  const index = Number(args.index) || 0;
  if (!args.clear) {
    if (!args.texture) {var _Skyballs$getData;
      args.texture = (_Skyballs$getData = Skyballs.getData(index)) === null || _Skyballs$getData === void 0 ? void 0 : _Skyballs$getData.texture;
    }
  }
  if (args.clear || !booleanString(args.texture)) {
    if (!args.index) {
      Skyballs.clearAll();
    } else {
      Skyballs.clear(index);
    }
    refreshSkyboxes(false);
    return;
  }
  let settings = {
    texture: file(skyboxFolder, args.texture, 'png'),
    repeat: (0,util.voidNaN)(args.repeat),
    alpha: (0,util.voidNaN)(args.alpha),
    autoRotate: (0,util.parseVector3)(args.autoRotate) };

  Skyballs.apply(index, settings, Number(args.time));
});

feature_skybox_mz3d.registerCommand('skybox', (...a) => {
  let [i, settings] = interpretSkyboxArgs(a);
  if (settings.clear) return settings;

  settings.time = 0;
  for (; i < a.length; ++i) {
    const side = a[i].toLowerCase();
    switch (side) {
      case 'north':case 'south':case 'east':case 'west':case 'top':case 'bottom':case 'default':
        if (a[i + 1] != null) settings[side] = a[i + 1];++i;break;
      case 'alpha':
        if (a[i + 1] != null) settings[side] = Number(a[i + 1]);++i;break;
      case 'autorotate':
        settings.autoRotate ??= { x: 0, y: 0, z: 0 };
        switch (a[i + 1].toLowerCase()) {
          case 'yaw':
            settings.autoRotate.y = a[i + 2] || 0;
            i += 2;break;
          case 'pitch':
            settings.autoRotate.x = a[i + 2] || 0;
            i += 2;break;
          case 'roll':
            settings.autoRotate.z = a[i + 2] || 0;
            i += 2;break;
          default:
            settings.autoRotate = {
              x: +a[i + 2] || 0,
              y: +a[i + 1] || 0,
              z: +a[i + 3] || 0 };

            i += 3;break;}

        break;
      default:
        if (i === a.length - 1 && isFinite(a[i])) {
          settings.time = Number(a[i]);
        } else if (!settings.default) {settings.default = a[i];}}

  }
  return settings;
}, (args) => {
  const index = Number(args.index) || 0;
  let top, bottom, north, south, east, west, dfault, textureSettings;
  if (!args.clear) {
    ({ top, bottom, north, south, east, west, default: dfault } = args);
    textureSettings = { top, bottom, north, south, east, west, default: dfault };
    for (const key of Object.keys(textureSettings)) {
      if (!textureSettings[key]) {delete textureSettings[key];}
    }
    if (!dfault) {
      const oldsettings = Skyboxes.decode(index);
      textureSettings = { ...oldsettings, ...textureSettings };
      ({ top, bottom, north, south, east, west, default: dfault } = textureSettings);
    }
  }
  if (args.clear ||
  !booleanString(top) && !booleanString(bottom) && !booleanString(north) && !booleanString(south) && !booleanString(east) && !booleanString(west) && !booleanString(dfault)) {
    if (!args.index) {
      Skyboxes.clearAll();
    } else {
      Skyboxes.clear(index);
    }
    refreshSkyboxes(false);
    return;
  }
  let settings = {
    textures: createSkyboxTextureList(textureSettings),
    alpha: (0,util.voidNaN)(args.alpha),
    autoRotate: (0,util.parseVector3)(args.autoRotate) };



  Skyboxes.apply(index, settings, Number(args.time));
});



// new stuff below

class AbstractSkyboxes {
  constructor(dataKey) {
    this.dataKey = dataKey;
    this.list = [];
  }

  setData(index, data) {
    let skyboxes = feature_skybox_mz3d.loadData(this.dataKey);
    if (!skyboxes) {
      skyboxes = [];
      feature_skybox_mz3d.saveData(this.dataKey, skyboxes);
    }
    skyboxes[index] = data;
  }

  getData(index) {
    let skyboxes = feature_skybox_mz3d.loadData(this.dataKey);
    if ((skyboxes === null || skyboxes === void 0 ? void 0 : skyboxes[index]) === undefined) {var _mz3d$getMapConfig;
      return (_mz3d$getMapConfig = feature_skybox_mz3d.getMapConfig(this.dataKey)) === null || _mz3d$getMapConfig === void 0 ? void 0 : _mz3d$getMapConfig[index];
    } else {
      return skyboxes[index];
    }
  }

  setupCreatedMesh(mesh) {
    mesh.setEnabled(false);
    mesh.isPickable = false;
    mesh.material.backFaceCulling = false;
    mesh.material.diffuseColor = Color3.Black();
    mesh.material.specularColor = Color3.Black();
    mesh.material.fogEnabled = false;
    mesh.material.alpha = 0;
    mesh.material.useAlphaFromDiffuseTexture = true;
    mesh.renderingGroupId = feature_skybox_mz3d.enumRenderGroups.BACK;
    mesh.parent = feature_skybox_mz3d.skyboxNode;

    return mesh;
  }

  clear(index) {
    this.setData(index, null);
    const mesh = this.list[index];
    if (!mesh) return;
    mesh.setEnabled(false);
    this.reset(index);
    delete mesh.mv3d_configured_alpha;
    mesh.material.alpha = 0;
    renderSkybox();
  }

  reset(index) {
    const mesh = this.list[index];
    if (!mesh) return;
    mesh.rotation.set(0, 0, 0);
    delete mesh.mv3d_autoRotateVector;
  }

  clearAll() {
    for (let i = 0; i < this.length; ++i) {
      this.clear(i);
    }
  }

  apply(index, settings, time = 0) {
    this.setData(index, settings);
    this.create(index, time);
    refreshSkyboxes(false);
  }

  get length() {var _mz3d$loadData, _mz3d$getMapConfig2;
    return Math.max(
    ((_mz3d$loadData = feature_skybox_mz3d.loadData(this.dataKey)) === null || _mz3d$loadData === void 0 ? void 0 : _mz3d$loadData.length) ?? 0,
    ((_mz3d$getMapConfig2 = feature_skybox_mz3d.getMapConfig(this.dataKey)) === null || _mz3d$getMapConfig2 === void 0 ? void 0 : _mz3d$getMapConfig2.length) ?? 0);

  }

  countSkyboxes(refresh = false) {
    let skyboxCount = 0;
    for (let i = 0; i < this.length; ++i) {
      if (this.getData(i)) {var _this$list$i;
        if (refresh) this.create(i);
        if ((_this$list$i = this.list[i]) !== null && _this$list$i !== void 0 && _this$list$i.isEnabled()) ++skyboxCount;
      } else {
        if (refresh) this.clear(i);
      }

    }
    return skyboxCount;
  }}


const Skyboxes = new class Skyboxes extends AbstractSkyboxes {
  constructor() {
    super('skyboxes');
  }
  createMesh(order = 0) {
    const box = MeshBuilder.CreateBox("skybox", { size: 1 }, feature_skybox_mz3d.skyboxScene);
    //box.material = new StandardMaterial("skybox",mv3d.skyboxScene);
    box.material = createSkyboxMaterial();
    box.order = order + 1;
    return super.setupCreatedMesh(box);
  }
  async create(index, time = 0) {
    this.list[index] ??= this.createMesh(index);
    const box = this.list[index];
    const skyboxData = this.getData(index);
    if (skyboxData === box.mv3d_skyboxData) {return;}
    const oldSkyboxData = box.mv3d_skyboxData;
    box.mv3d_skyboxData = skyboxData;

    let { textures: filenames, alpha, autoRotate } = skyboxData;

    let textureChanged = false;
    for (let i = 0; i < Math.max(filenames.length, (oldSkyboxData === null || oldSkyboxData === void 0 ? void 0 : oldSkyboxData.textures.length) ?? 0); ++i) {
      if (filenames[i] != (oldSkyboxData === null || oldSkyboxData === void 0 ? void 0 : oldSkyboxData.textures[i])) {
        textureChanged = true;
        break;
      }
    }

    if (textureChanged) {
      const files = [];
      for (let i = 0; i < filenames.length; ++i) {
        files[i] = await feature_skybox_mz3d.getTextureUrl(filenames[i]);
      }
      if (skyboxData !== this.getData(index)) {return;}

      const reflectionTexture = CubeTexture.CreateFromImages(files, feature_skybox_mz3d.skyboxScene, true);
      reflectionTexture.coordinatesMode = SKYBOX_MODE;
      reflectionTexture.hasAlpha = true;

      await feature_skybox_mz3d.waitTextureLoaded(reflectionTexture);

      if (skyboxData !== this.getData(index)) {
        reflectionTexture.dispose();
        return;
      }
      reflectionTexture.updateSamplingMode(1);
      if (box.material.reflectionTexture) {
        box.material.reflectionTexture.dispose();
      }
      box.material.reflectionTexture = reflectionTexture;

      this.reset(index);
    }

    if (autoRotate) box.mv3d_autoRotateVector = autoRotate;

    if (alpha == null && box.mv3d_configured_alpha == null) {
      alpha = 1;
    }
    if (alpha != null) {
      box.mv3d_configured_alpha = alpha;
      if (time) {
        feature_skybox_mz3d.createTempBlender(['skyboxes', index, 'material', 'alpha'], box.material.alpha, alpha, time, renderSkybox);
      } else {
        box.material.alpha = alpha;
        //box.visibility=alpha;
      }
    }

    box.setEnabled(true);
    refreshSkyboxes(false);
    if (feature_skybox_mz3d.skyboxView.enabled) feature_skybox_mz3d.skyboxView.requestRender(2);
  }
  clear(index) {
    super.clear(index);
    const box = this.list[index];
    if (box) {var _box$material$reflect;
      (_box$material$reflect = box.material.reflectionTexture) === null || _box$material$reflect === void 0 ? void 0 : _box$material$reflect.dispose();
      box.material.reflectionTexture = null;
      delete box.mv3d_skyboxData;
    }
  }

  decode(index) {var _this$getData;
    const oldData = (_this$getData = this.getData(index)) === null || _this$getData === void 0 ? void 0 : _this$getData.textures;
    if (!oldData) {
      return { east: 0, top: 0, north: 0, west: 0, bottom: 0, south: 0 };
    }
    const [east, top, north, west, bottom, south] = oldData;
    return { east, top, north, west, bottom, south };
  }}();


const Skyballs = new class Skyballs extends AbstractSkyboxes {
  constructor() {
    super('skyballs');
  }
  createMesh(order = 0) {
    const ball = MeshBuilder.CreateSphere("skyball", { diameter: 1 }, feature_skybox_mz3d.skyboxScene);
    ball.material = new StandardMaterial("skyball", feature_skybox_mz3d.skyboxScene);
    ball.material.emissiveColor.set(1, 1, 1);
    ball.order = order + 1.5;
    ball.scaling.y = -1;
    return super.setupCreatedMesh(ball);
  }
  async create(index, time = 0) {
    this.list[index] ??= this.createMesh(index);
    const ball = this.list[index];

    const skyballData = this.getData(index);
    if (skyballData === ball.mv3d_skyballData) {return;}
    const oldSkyballData = ball.mv3d_skyballData;
    ball.mv3d_skyballData = skyballData;
    let { texture: filename, repeat, alpha, autoRotate } = skyballData;

    if (filename != (oldSkyballData === null || oldSkyballData === void 0 ? void 0 : oldSkyballData.texture)) {
      const texture = await feature_skybox_mz3d.createTexture(filename);
      texture.hasAlpha = true;
      await feature_skybox_mz3d.waitTextureLoaded(texture);

      if (skyballData !== this.getData(index)) {
        texture.dispose();
        return;
      }
      texture.updateSamplingMode(1);
      if (ball.material.diffuseTexture) {
        ball.material.diffuseTexture.dispose();
      }
      ball.material.diffuseTexture = texture;

      this.reset(index);
    }
    if (repeat != null) ball.material.diffuseTexture.uScale = repeat;

    if (autoRotate) ball.mv3d_autoRotateVector = autoRotate;

    if (alpha == null && ball.mv3d_configured_alpha == null) {
      alpha = 1;
    }
    if (alpha != null) {
      ball.mv3d_configured_alpha = alpha;
      if (time) {
        feature_skybox_mz3d.createTempBlender(['skyballs', index, 'material', 'alpha'], ball.material.alpha, alpha, time, renderSkybox);
      } else {
        ball.material.alpha = alpha;
      }
    }

    ball.setEnabled(true);
    refreshSkyboxes(false);
    if (feature_skybox_mz3d.skyboxView.enabled) feature_skybox_mz3d.skyboxView.requestRender(2);
  }
  clear(index) {
    super.clear(index);
    const ball = this.list[index];
    if (ball) {var _ball$material$diffus;
      (_ball$material$diffus = ball.material.diffuseTexture) === null || _ball$material$diffus === void 0 ? void 0 : _ball$material$diffus.dispose();
      ball.material.diffuseTexture = null;
      delete ball.mv3d_skyballData;
    }
  }}();


function refreshSkyboxes(refresh = true) {
  let skyboxCount = Skyboxes.countSkyboxes(refresh) + Skyballs.countSkyboxes(refresh);
  feature_skybox_mz3d._hasSkybox = Boolean(skyboxCount);
  enableOrDisableSkybox();
}

function enableOrDisableSkybox() {
  //if(mv3d.hasSkybox&&(mv3d.hasAlphaFog||mv3d.cameraMode==="ORTHOGRAPHIC"||mv3d.isPostProcessEffectEnabled('depthOfField'))){
  if (feature_skybox_mz3d.hasSkybox) {
    //mv3d.skyboxNode.parent=mv3d.skyboxCamera;
    if (!feature_skybox_mz3d.skyboxView.enabled) {
      feature_skybox_mz3d.skyboxView.enable();
      updateSkyboxTransform();
    }
  } else {
    //mv3d.skyboxNode.parent=mv3d.camera;
    if (feature_skybox_mz3d.skyboxView.enabled) {feature_skybox_mz3d.skyboxView.disable();}
  }
  feature_skybox_mz3d.updateClearColor();
  feature_skybox_mz3d.updateAlphaFog();
}

function updateSkyboxTransform() {
  const cameraRotation = feature_skybox_mz3d.cameraRotation();
  feature_skybox_mz3d.skyboxNode.rotation.copyFrom(
  Quaternion.Inverse(cameraRotation.toQuaternion()).toEulerAngles());

  feature_skybox_mz3d.skyboxCamera.rotation.copyFrom(cameraRotation);
  renderSkybox();
}

function renderSkybox(n = true) {
  if (feature_skybox_mz3d.skyboxView.enabled) {
    feature_skybox_mz3d.skyboxView.requestRender(n);
  }
}

function updateSkyboxBlend(mesh) {
  if (!mesh.mv3d_autoRotateVector) return false;
  const arv = mesh.mv3d_autoRotateVector;
  if (!arv.x && !arv.y && !arv.z) {return false;}
  //mesh.rotation.addInPlace(arv);
  mesh.pitch += arv.x / 60;
  mesh.yaw += arv.y / 60;
  mesh.roll += arv.z / 60;
  return true;
}
// EXTERNAL MODULE: ./src/configuration.js
var configuration = __webpack_require__("./src/configuration.js");
// EXTERNAL MODULE: ./src/main.js
var main = __webpack_require__("./src/main.js");
// EXTERNAL MODULE: ./src/util_parsing.js
var util_parsing = __webpack_require__("./src/util_parsing.js");
;// CONCATENATED MODULE: ./src/premium/model-import.js









new features/* Feature */.L('model-import', {
  applyTextureConfigs(conf, img, tx, ty) {
    if (!conf.model_textures) return;
    for (const key in conf.model_textures) {
      main/* default.applyTextureSideConfigs */.Z.applyTextureSideConfigs(conf.model_textures[key], 'texture', img, tx, ty);
      main/* default.applyCropTexture */.Z.applyCropTexture(conf.model_textures[key], 'texture', { flip: true });
    }
  } });


const configurationFunctions = {
  model: new configuration/* ConfigurationFunction */.py(`filename|instance|flip|alpha|actions{*{alias,speed}},bones{*{scale}},textures{*{${configuration/* textureParameters */.aK}}}|projectionfix`, function (conf, params) {
    conf.model = (0,util.file)("./models/", params.filename);
    conf.shape = main/* default.enumShapes.MODEL */.Z.enumShapes.MODEL;
    conf.model_flip = (0,util.booleanString)(params.flip);
    conf.model_alpha = (0,util.booleanString)(params.alpha);
    delete conf.dynamicOffset;
    delete conf.dynamicOffsetPitch;
    if ('instance' in params) {
      conf.model_instance = (0,util.booleanString)(params.instance) ? main/* default.enumModelOptimization.INSTANCING */.Z.enumModelOptimization.INSTANCING : main/* default.enumModelOptimization.NONE */.Z.enumModelOptimization.NONE;
      if (params.instance.toLowerCase().startsWith('clon')) conf.model_instance = main/* default.enumModelOptimization.CLONING */.Z.enumModelOptimization.CLONING;
    }
    if (params.bones instanceof util_parsing.ParameterList) {
      conf.boneData = params.bones.toObject();
      for (const key in conf.boneData) {
        const data = conf.boneData[key];
        if (data.scale) data.scale = (0,util.MathExpression)(data.scale);
      }
    }
    if (params.actions instanceof util_parsing.ParameterList) {
      conf.actionData = params.actions.toObject();
      for (const key in conf.actionData) {
        const data = conf.actionData[key];
        if (data.speed) data.speed = (0,util.MathExpression)(data.speed);
      }
    }
    if (params.textures instanceof util_parsing.ParameterList) {
      const textures = params.textures.parameters;
      conf.model_textures = {};
      for (const key in textures) {
        conf.model_textures[key] = {};
        (0,configuration/* interpretTextureParameters */.Ce)('texture', textures[key], conf.model_textures[key]);
        if (conf.functionset === main/* default.eventConfigurationFunctions */.Z.eventConfigurationFunctions) {
          conf.model_textures[key]._eventTileId = conf._eventTileId;
          main/* default.applyEventTextureSideConfigs */.Z.applyEventTextureSideConfigs(conf.model_textures[key], 'texture');
          main/* default.applyCropTexture */.Z.applyCropTexture(conf.model_textures[key], 'texture', { flip: true });
        }
      }
    }
    if ('projectionfix' in params) {
      conf.projectionfix = (0,util.booleanString)(params.projectionfix);
    }
  }) };


(0,util.assign)(main/* default.tilesetConfigurationFunctions */.Z.tilesetConfigurationFunctions, configurationFunctions);
(0,util.assign)(main/* default.eventConfigurationFunctions */.Z.eventConfigurationFunctions, configurationFunctions);

main/* default.tilesetConfigurationFunctions.scale */.Z.tilesetConfigurationFunctions.scale = main/* default.eventConfigurationFunctions.scale */.Z.eventConfigurationFunctions.scale;


main/* default.loadAssetContainer */.Z.loadAssetContainer = (url, opts) => new Promise((resolve, reject) => {
  core.SceneLoader.LoadAssetContainer((0,util.foldername)(url), (0,util.filename)(url), main/* default.scene */.Z.scene, (container) => {
    try {
      const isObj = /.+\.obj$/i.test(url);
      const isGltf = /.+\.gl(?:b|tf)$/i.test(url);
      //console.log("MODEL IMPORTED",url);
      if (opts.useInstance && container.skeletons.length) {
        opts.cloneAssetContainer = true;
      }
      if (isGltf) {opts.merge = false;} else
      if (opts.merge == null) {opts.merge = true;}
      const meshes = container.meshes;
      /*
      for(let i=meshes.length-1;i>=0;--i){
      	if(meshes[i].getTotalVertices()===0){
      		meshes[i].dispose(true,false);
      		meshes.splice(i,1);
      	}
      }
      */
      if (!meshes.length) {
        //console.log(foldername(url), filename(url));
        return reject(new Error(`Empty model loaded! ${url}`));
      }
      const materials = container.materials;
      if (opts.fixmat !== false) {
        for (let i = 0; i < materials.length; ++i) {
          if (materials[i] instanceof core.PBRMaterial) {
            const pbr = materials[i];
            materials[i] = pbr2standard(pbr);
            pbr.mv3d_material_index = i;
          }
        }
      }
      for (const mat of materials) {
        if (opts.useInstance) mat.mv3d_noDispose = true;
        if (!opts.alpha) {
          mat.opacityTexture = null;
          mat.useAlphaFromDiffuseTexture = false;
          if (mat.diffuseTexture) {mat.diffuseTexture.hasAlpha = true;}
          mat.alphaCutOff = main/* default.ALPHA_CUTOFF */.Z.ALPHA_CUTOFF;
        }
        mat.ambientColor.set(1, 1, 1);
        const texture = mat.diffuseTexture;
        if (texture) {
          ++main/* default._model_textures_loaded_total */.Z._model_textures_loaded_total;

          // if texture doesn't load within 5 seconds, assume failure
          let timedOut = false;
          const timeOut = setTimeout(() => {
            --main/* default._model_textures_loaded_total */.Z._model_textures_loaded_total;
            timedOut = true;
          }, 5000);

          main/* default.waitTextureLoaded */.Z.waitTextureLoaded(texture).then((texture) => {
            clearTimeout(timeOut);
            texture.updateSamplingMode(1);
            if (!timedOut) {++main/* default._model_textures_loaded */.Z._model_textures_loaded;}
          });
        }

        if (main/* default.USE_PARALLAX_TEXTURE */.Z.USE_PARALLAX_TEXTURE && mat.bumpTexture) {
          mat.useParallax = true;
          mat.useParallaxOcclusion = true;
          mat.parallaxScaleBias = main/* default.PARALLAX_SCALE */.Z.PARALLAX_SCALE || 0.1;
        }
      }
      //let totalVertices = 0;
      for (const mesh of meshes) {var _mesh$material, _mesh$metadata, _mesh$metadata$gltf, _mesh$metadata$gltf$e;
        mesh.receiveShadows = true;
        if (((_mesh$material = mesh.material) === null || _mesh$material === void 0 ? void 0 : _mesh$material.mv3d_material_index) >= 0) {
          mesh.material = materials[mesh.material.mv3d_material_index];
        }
        if (mesh.material && (_mesh$metadata = mesh.metadata) !== null && _mesh$metadata !== void 0 && (_mesh$metadata$gltf = _mesh$metadata.gltf) !== null && _mesh$metadata$gltf !== void 0 && (_mesh$metadata$gltf$e = _mesh$metadata$gltf.extras) !== null && _mesh$metadata$gltf$e !== void 0 && _mesh$metadata$gltf$e.mv3d_glowColor) {
          mesh.material.mv3d_glowColor = (0,util.makeColor)(mesh.metadata.gltf.extras.mv3d_glowColor);
          mesh.material.mv3d_glowColor_extra = true;
        }
        //totalVertices += mesh.getTotalVertices();
        /*
        if((isObj) && !opts.flip && mesh.geometry){
        	const vdata = mesh.geometry.getVerticesData(BABYLON.VertexBuffer.PositionKind);
        	const normaldata = mesh.geometry.getVerticesData(BABYLON.VertexBuffer.NormalKind);
        	const flipAxis = isObj?2:0;
        	for (let i=flipAxis;i<vdata.length;i+=3){
        		vdata[i]*=-1;
        		normaldata[i]*=-1;
        	}
        	mesh.flipFaces();
        	//mesh.overrideMaterialSideOrientation = 0;
        }
        */
        if (!opts.merge) {
          mesh.renderingGroupId = main/* default.enumRenderGroups.MAIN */.Z.enumRenderGroups.MAIN;
        }
      }

      for (const animationGroup of container.animationGroups) {
        animationGroup.stop();
        for (const tanim of animationGroup.targetedAnimations) {
          tanim.animation.enableBlending = true;
          tanim.animation.blendingSpeed = 0.1;
        }
      }

      if (container.rootNodes.length === 0) {
        container.rootNodes = [...container.transformNodes, ...container.meshes].filter((n) => !n.parent);
      }

      container.mv3d_importedModelData = {
        isGltf, isObj,
        needsFlip: !opts.flip,
        assetContainer: container };

      resolve(container);
      /*
      let importedMesh;
      if(opts.cloneAssetContainer){
      	//container.removeAllFromScene();
      	assetContainers[url]=container;
      	importedMesh = cloneAssetContainer(container);
      	resolve();
      }else if(opts.merge && !isGltf){
      	importedMesh = Mesh.MergeMeshes(isGltf ? meshes.filter(m=>m.getTotalVertices()) : meshes,true,totalVertices>64000,undefined,false,true);;
      	importedMesh.renderingGroupId=mz3d.enumRenderGroups.MAIN;
      	importedMesh.mv3d_materials=materials;
      	resolve(importedMesh);
      }else{
      	const group = new MeshGroup();
      	importedMesh = group;
      	container.addAllToScene();
      	group.addMesh(...meshes);
      	group.mv3d_materials = materials;
      	group.renderingGroupId=mz3d.enumRenderGroups.MAIN;
      			resolve(group);
      }
      */

    } catch (err) {
      console.error(err);
    }
  });
});

main/* default.mergeAssetContainer */.Z.mergeAssetContainer = function (container) {
  const meshes = container.meshes.filter((m) => m.getTotalVertices());
  const totalVertices = meshes.reduce((tv, m) => tv + m.getTotalVertices(), 0);
  const mergedMesh = core.Mesh.MergeMeshes(meshes, true, totalVertices > 64000, undefined, false, true);;
  mergedMesh.renderingGroupId = main/* default.enumRenderGroups.MAIN */.Z.enumRenderGroups.MAIN;
  mergedMesh.mv3d_materials = container.materials;
  mergedMesh.mv3d_importedModelData = container.mv3d_importedModelData;
  mergedMesh.receiveShadows = true;
  return mergedMesh;
};

model/* MeshGroup.cloneAssetContainer */.BM.cloneAssetContainer = function (container) {
  const entries = container.instantiateModelsToScene(util.identity);
  entries.materials = container.materials;
  entries.mv3d_importedModelData = container.mv3d_importedModelData;
  return main/* default.MeshGroup.fromAssetContainer */.Z.MeshGroup.fromAssetContainer(entries);
};

model/* MeshGroup.fromAssetContainer */.BM.fromAssetContainer = function (container) {var _container$addAllToSc;
  (_container$addAllToSc = container.addAllToScene) === null || _container$addAllToSc === void 0 ? void 0 : _container$addAllToSc.call(container);
  const group = new model/* MeshGroup */.BM();
  group.skeletons = container.skeletons;
  group.animationGroups = container.animationGroups;
  group.addMesh(...container.rootNodes);
  group.mv3d_materials = container.materials;
  group.renderingGroupId = main/* default.enumRenderGroups.MAIN */.Z.enumRenderGroups.MAIN;
  group.mv3d_importedModelData = container.mv3d_importedModelData;
  return group;
};

(0,util.override)(Scene_Base.prototype, 'isReady', (o) => function () {
  if (main/* default.PRELOAD_MODELS */.Z.PRELOAD_MODELS && main/* default._model_textures_loaded */.Z._model_textures_loaded < main/* default._model_textures_loaded_total */.Z._model_textures_loaded_total) {return false;}
  return o.apply(this, arguments);
});

function pbr2standard(pbr) {
  const mat = new core.StandardMaterial(pbr.name, pbr.getScene());

  mat.diffuseTexture = pbr.albedoTexture;
  mat.diffuseColor = pbr.albedoColor;

  mat.opacityTexture = pbr.opacityTexture;
  mat.useAlphaFromDiffuseTexture = pbr.useAlphaFromDiffuseTexture;
  mat.alphaCutOff = pbr.alphaCutOff;
  mat.alpha = pbr.alpha;

  mat.ambientTexture = pbr.ambientTexture;
  mat.ambientColor = pbr.ambientColor;

  mat.emissiveTexture = pbr.emissiveTexture;
  mat.emissiveColor = pbr.emissiveColor;

  mat.bumpTexture = pbr.bumpTexture;
  mat.useParallax = pbr.useParallax;
  mat.useParallaxOcclusion = pbr.useParallaxOcclusion;
  mat.parallaxScaleBias = pbr.parallaxScaleBias;

  //if(mz3d.USE_DIFFUSE_AS_SPECULAR){ mat.specularTexture = mat.diffuseTexture; }
  mat.specularColor.set(0, 0, 0);

  mat.twoSidedLighting = pbr.twoSidedLighting;
  mat.sideOrientation = pbr.sideOrientation;
  mat.backFaceCulling = pbr.backFaceCulling;

  return mat;
}
// EXTERNAL MODULE: ./src/MeshBuilder.js
var src_MeshBuilder = __webpack_require__("./src/MeshBuilder.js");
;// CONCATENATED MODULE: ./src/premium/mesh.js






const mesh_mz3d = window.mz3d;
const { util: mesh_util, ConfigurationFunction: mesh_ConfigurationFunction } = mesh_mz3d;
const { assign: mesh_assign, file: mesh_file, foldername, filename, booleanString: mesh_booleanString, override: mesh_override } = mesh_util;
const { SceneLoader, Mesh: mesh_Mesh } = BABYLON;

const meshPartTypes = {
  cube: 'c',
  quad: 'q',
  points: 'p' };


const meshTexture = (0,configuration/* TextureConfigurator */.Mr)('texture');

const mesh_configurationFunctions = {
  mesh: new mesh_ConfigurationFunction(null, function (conf, rawparams) {
    // find start of function
    const r = /(([cqp])[a-z]*){/i;
    let line = rawparams;
    let match;
    const parts = [];
    part: while (match = line.match(r)) {
      line = line.substr(match.index + match[0].length);
      const content = (0,util_parsing.parseNestedParentheses)('{', '}', line);
      line = line.substr(content.length + 1); //the +1 is for the closing '}'
      // do the thing
      const fullType = match[1].toLowerCase();
      const partType = match[2].toLowerCase();
      let part = { fullType: partType, type: partType };
      switch (partType) {
        case meshPartTypes.points:{
            const params = (0,util_parsing.parseParameters)(content, `positions...|indices...|uvs...|texture{${configuration/* textureParameters */.aK}}`);
            if (!params.texture) params.texture = (0,util_parsing.parseParameters)('+0,+0', configuration/* textureParameters */.aK);
            const toNumbers = (p) => Number(p);
            part.positions = (params.positions || []).map(toNumbers);
            const pointCount = Math.floor(part.positions.length / 3);
            part.positions.length = pointCount * 3;
            if (pointCount < 3) continue part;

            part.indices = (params.indices || []).map(toNumbers);
            part.indices.length = Math.floor(part.indices.length / 3) * 3;
            if (!part.indices.length) {
              const faceCount = pointCount - 2;
              for (let i = 0; i < faceCount; ++i) {
                if (i % 2) part.indices.push(i, i + 1, i + 2);else
                part.indices.push(i + 1, i, i + 2);
              }
            };

            part.uvs = (params.uvs || []).map(toNumbers);
            part.uvs.length = Math.floor(part.uvs.length / 2) * 2;
            const uvsLength = pointCount * 2;
            if (part.uvs.length < uvsLength) {
              const uvPattern = [0, 0, 0, 1, 1, 0, 1, 1];
              for (let i = part.uvs.length; i < uvsLength; ++i) {
                part.uvs[i] = uvPattern[i % uvPattern.length];
              }
            }

            (0,configuration/* interpretTextureParameters */.Ce)('texture', params.texture, part);
            if (conf.functionset === mesh_mz3d.eventConfigurationFunctions) {
              part._eventTileId = conf._eventTileId;
              mesh_mz3d.applyEventTextureSideConfigs(part, 'texture');
            }
          }break;
        case meshPartTypes.quad:{
            const params = (0,util_parsing.parseParameters)(content, `xsize,ysize|xoff,yoff,zoff|yaw,pitch,roll|texture{${configuration/* textureParameters */.aK}}`);
            if (!params.texture) params.texture = (0,util_parsing.parseParameters)('+0,+0', configuration/* textureParameters */.aK);
            part.xsize = (0,util.MathExpression)(params.xsize || 1);
            part.ysize = (0,util.MathExpression)(params.ysize || 1);
            part.xoff = (0,util.MathExpression)(params.xoff || 0);
            part.yoff = (0,util.MathExpression)(params.yoff || 0);
            part.zoff = (0,util.MathExpression)(params.zoff || 0);
            part.yaw = (0,util.MathExpression)(params.yaw || 0);
            part.pitch = (0,util.MathExpression)(params.pitch || 0);
            part.roll = (0,util.MathExpression)(params.roll || 0);
            (0,configuration/* interpretTextureParameters */.Ce)('texture', params.texture, part);
            if (conf.functionset === mesh_mz3d.eventConfigurationFunctions) {
              part._eventTileId = conf._eventTileId;
              mesh_mz3d.applyEventTextureSideConfigs(part, 'texture');
            }
          }break;
        case meshPartTypes.cube:{
            const params = (0,util_parsing.parseParameters)(content, `xsize,ysize,zsize|xoff,yoff,zoff|yaw,pitch,roll[texture]top{${configuration/* textureParameters */.aK}},bottom{${configuration/* textureParameters */.aK}},south{${configuration/* textureParameters */.aK}},east{${configuration/* textureParameters */.aK}},north{${configuration/* textureParameters */.aK}},west{${configuration/* textureParameters */.aK}}`);
            part.xsize = (0,util.MathExpression)(params.xsize || 1);
            part.ysize = (0,util.MathExpression)(params.ysize || 1);
            part.zsize = (0,util.MathExpression)(params.zsize || 1);
            part.xoff = (0,util.MathExpression)(params.xoff || 0);
            part.yoff = (0,util.MathExpression)(params.yoff || 0);
            part.zoff = (0,util.MathExpression)(params.zoff || 0);
            part.yaw = (0,util.MathExpression)(params.yaw || 0);
            part.pitch = (0,util.MathExpression)(params.pitch || 0);
            part.roll = (0,util.MathExpression)(params.roll || 0);
            const textures = ['top', 'bottom', 'south', 'east', 'north', 'west'];
            let textureFound;
            for (const textureName of textures) {
              if (!params[textureName]) continue;
              textureFound = true;
              (0,configuration/* interpretTextureParameters */.Ce)(textureName, params[textureName], part);
              if (conf.functionset === mesh_mz3d.eventConfigurationFunctions) {
                part._eventTileId = conf._eventTileId;
                mesh_mz3d.applyEventTextureSideConfigs(part, textureName);
              }
            }
            if (!textureFound) continue part;
          }break;
        default:continue part;}

      if (fullType.includes('d') || fullType[1] === partType) {
        part.backface = true;
        part.fullType += 'd';
      } else if (fullType.includes('f')) {
        part.flip = true;
        part.fullType += 'f';
      }
      // future part types
      // y: cylinder
      // s: sphere
      parts.push(part);
    }
    if (parts.length) {
      conf.meshparts = parts;
      conf.shape = mesh_mz3d.enumShapes.MESH;
      delete conf.dynamicOffset;
      delete conf.dynamicOffsetPitch;
    }
  }) };


mesh_assign(mesh_mz3d.tilesetConfigurationFunctions, mesh_configurationFunctions);
mesh_assign(mesh_mz3d.eventConfigurationFunctions, mesh_configurationFunctions);

new features/* Feature */.L('mesh', {
  applyTextureConfigs(conf, img, tx, ty) {
    if (!conf.meshparts) return;
    const meshparts = [];
    for (let i = 0; i < conf.meshparts.length; ++i) {
      const part = Object.assign({}, conf.meshparts[i]);
      meshparts.push(part);
      let sides;
      switch (part.type) {
        default:
        case meshPartTypes.points:
        case meshPartTypes.quad:sides = ['texture'];break;
        case meshPartTypes.cube:sides = ['top', 'bottom', 'south', 'east', 'north', 'west'];break;}

      for (const side of sides) {
        mesh_mz3d.applyTextureSideConfigs(part, side, img, tx, ty);
      }
    }
    conf.meshparts = meshparts;
  } });


mesh_mz3d.buildMesh = async function (parts) {
  const builder = new src_MeshBuilder/* MeshBuilder */.VO();
  for (const part of parts) switch (part.type) {
    case meshPartTypes.points:{
        const material = await mesh_mz3d.getCachedTilesetMaterialForTile(part, 'texture');
        const rect = mesh_mz3d.getRectFromConf(part, 'texture');
        const { positions, indices, uvs, backface, flip } = part;
        builder.addPointData(material, rect, Array.from(positions), Array.from(indices), Array.from(uvs), { backface, flip });
      }break;
    case meshPartTypes.quad:{
        const material = await mesh_mz3d.getCachedTilesetMaterialForTile(part, 'texture');
        const rect = mesh_mz3d.getRectFromConf(part, 'texture');
        const { xsize, ysize, xoff, yoff, zoff, backface, flip } = part;
        const yaw = (0,util.degtorad)(part.yaw),pitch = (0,util.degtorad)(part.pitch),roll = (0,util.degtorad)(part.roll);
        builder.addQuad(material, rect, xsize, ysize, xoff, yoff, zoff, yaw, pitch, roll, { backface, flip });
      }break;
    case meshPartTypes.cube:{
        const textures = ['top', 'bottom', 'south', 'east', 'north', 'west'];
        const dfault = textures.slice().reverse().find((name) => part[`${name}_changed`]);
        const materials = [],rects = [];
        for (let name of textures) {
          if (!part[`${name}_changed`]) name = dfault;
          if (mesh_mz3d.isTileEmpty(part[`${name}_id`])) {materials.push(null);rects.push(null);continue;}
          materials.push(await mesh_mz3d.getCachedTilesetMaterialForTile(part, name));
          rects.push(mesh_mz3d.getRectFromConf(part, name));
        }
        const { xsize, ysize, zsize, xoff, yoff, zoff, backface, flip } = part;
        const yaw = (0,util.degtorad)(part.yaw),pitch = (0,util.degtorad)(part.pitch),roll = (0,util.degtorad)(part.roll);
        builder.addCube(materials, rects, xsize, ysize, zsize, xoff, yoff, zoff, yaw, pitch, roll, { flip });
        if (backface) {
          builder.addCube(materials, rects, xsize, ysize, zsize, xoff, yoff, zoff, yaw, pitch, roll, { flip: !flip });
        }
      }break;}

  const mesh = builder.build();
  if (mesh) {
    mesh.alphaIndex = 0;
    mesh.renderingGroupId = mesh_mz3d.enumRenderGroups.MAIN;
    mesh.receiveShadows = true;
  }
  return mesh;
};

mesh_mz3d.finalizeMeshParts = function (parts, x = 0, y = 0, l = 0) {
  const newparts = [];
  let cacheKey = '';
  for (let i = 0; i < parts.length; ++i) {
    parts[i]._x = x;parts[i]._y = y;parts[i]._l = l;
    const part = mesh_mz3d.finalizeConfigs(parts[i]);
    newparts.push(part);
    switch (part.type) {
      case meshPartTypes.points:{
          const { positions, indices, uvs } = part;
          cacheKey += `${part.fullType}{${positions}|${indices}|${uvs}|{${(0,configuration/* createTextureSymbol */.oX)(part, 'texture')}}}`;
        }break;
      case meshPartTypes.quad:{
          const { xsize, ysize, xoff, yoff, zoff, yaw, pitch, roll } = part;
          cacheKey += `${part.fullType}{${xsize},${ysize}|${xoff},${yoff},${zoff}|${yaw},${pitch},${roll}|{${(0,configuration/* createTextureSymbol */.oX)(part, 'texture')}}}`;
        }break;
      case meshPartTypes.cube:{
          const { xsize, ysize, zsize, xoff, yoff, zoff, yaw, pitch, roll } = part;
          cacheKey += `${part.fullType}{${xsize},${ysize},${zsize}|${xoff},${yoff},${zoff}|${yaw},${pitch},${roll}|{${(0,configuration/* createTextureSymbol */.oX)(part, 'top')}},{${(0,configuration/* createTextureSymbol */.oX)(part, 'bottom')}},{${(0,configuration/* createTextureSymbol */.oX)(part, 'south')}},{${(0,configuration/* createTextureSymbol */.oX)(part, 'east')}},{${(0,configuration/* createTextureSymbol */.oX)(part, 'north')}},{${(0,configuration/* createTextureSymbol */.oX)(part, 'west')}}}`;
        }break;}

  }
  newparts.cacheKey = cacheKey;
  //should return the parts object with all MathExpressions evaluated and with a mesh key for caching.
  return newparts;
};
;// CONCATENATED MODULE: ./src/premium/feature-postprocessing.js







const { NEAREST_SAMPLINGMODE: feature_postprocessing_NEAREST_SAMPLINGMODE, BILINEAR_SAMPLINGMODE: feature_postprocessing_BILINEAR_SAMPLINGMODE } = BABYLON.Texture;
const { TEXTURETYPE_UNSIGNED_INT } = BABYLON.Constants;
const { MakeArray } = BABYLON.Tools;

var targetFocusDistance = 5000;
var lastCameraDist = 0;

var bloomOptionLevel = 0;

const raycastPredicate = (mesh) => {
  if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) {return false;}
  if (mesh.character) {
    //if(mesh.character.isFollower||mesh.character.isPlayer){ return false; }
    if (mesh.character.isPlayer) {return false;}
  }
  return true;
};

new features/* Feature */.L('postprocessing', {
  setup() {

    if (mz3d.ANTIALIASING && !mz3d.isWebGPU()) {
      const antialiasing = new BABYLON.FxaaPostProcess("fxaa", 1.0, null, feature_postprocessing_NEAREST_SAMPLINGMODE, mz3d.engine);
      antialiasing.samples = 4;
      mz3d.effects.antialiasing = antialiasing;
    }

    mz3d.effects.depthOfField = new MV3d_DepthOfFieldEffect('depthOfField', mz3d.camera, core.DepthOfFieldEffectBlurLevel.High);
    mz3d.effects.depthOfField.focusDistance = 5000;
    mz3d.effects.depthOfField.focalLength = 50;

    mz3d.effects.chromaticAberration = new core.ChromaticAberrationPostProcess('chromaticAberration', mz3d.engine.getRenderWidth(), mz3d.engine.getRenderHeight(), 1.0, null, feature_postprocessing_NEAREST_SAMPLINGMODE, mz3d.engine);
    mz3d.effects.chromaticAberration.aberrationAmount = 30;
    mz3d.effects.chromaticAberration.radialIntensity = 1;

    mz3d.effects.bloom = new core.BloomEffect(mz3d.scene, 0.5, 0.15, 64);


    mz3d.pipeline = new MV3D_RenderPipeline("mv3d_pipeline", mz3d.camera, ['antialiasing', 'bloom', 'chromaticAberration', 'alphaFog', 'depthOfField']);



    if (mz3d.skyboxCamera) {
      const skyboxEffects = ['bloom', 'chromaticAberration'];
      const BLOOM_SKYBOXES = (0,parameters/* parameter */.o)('bloomSkyboxes', true, util.booleanString);
      if (!BLOOM_SKYBOXES) {
        const index = skyboxEffects.indexOf('bloom');
        skyboxEffects.splice(index, 1);
      }
      mz3d.skyboxPipeline = new MV3D_RenderPipeline("mv3d_SkyboxPipeline", mz3d.skyboxCamera, skyboxEffects);
    }

  },

  blend(reorient) {
    if (reorient || mz3d.camera.dist !== lastCameraDist || SceneManager._scene._fadeDuration || mz3d._updateCycle === 0) {
      lastCameraDist = mz3d.camera.dist;
      if (typeof mz3d.focusDistance === 'number' && isFinite(mz3d.focusDistance)) {
        targetFocusDistance = mz3d.focusDistance * 1000;
      } else if (mz3d.focusDistance !== 'mouse') {
        if (mz3d.blendCameraDist.currentValue() <= 0 || mz3d.focusDistance === 'center') {
          const intersection = mz3d.scene.pick(mz3d.engine.getRenderWidth() / 2, mz3d.engine.getRenderHeight() / 2, raycastPredicate);
          if (intersection.hit) {
            //targetFocusDistance=intersection.distance*1000;
            targetFocusDistance = (intersection.distance + mz3d.camera.minZ) * 1000;
            //targetFocusDistance=BABYLON.Vector3.Distance(mv3d.globalPosition(mv3d.camera),intersection.pickedPoint)*1000;
          }

        } else {
          let dist;
          if (!mz3d.scene._projectionMatrix) {
            dist = mz3d.camera.dist;
          } else {
            dist = mz3d.getScreenDepth(mz3d.cameraStick);
          }
          mz3d.effects.depthOfField.focusDistance = targetFocusDistance = dist * 1000;
        }
      }
    }
    if (mz3d.effects.depthOfField.focusDistance !== targetFocusDistance) {
      const focusDistance = mz3d.effects.depthOfField.focusDistance;
      mz3d.effects.depthOfField.focusDistance = focusDistance + (targetFocusDistance - focusDistance) / 5;
    }

  },


  hackShaders() {
    mz3d.hackShaderReplace('chromaticAberrationPixelShader',
    'original.a=clamp(texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a,0.,1.);',
    'original.a=clamp( (texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a)/3.0 ,0.,1.);');

  },


  applyMapSettings(mapconf) {
    if (mapconf.bloomIntensity) {
      mz3d.bloom = mapconf.bloomIntensity;
    }
    if (mapconf.bloomThreshold) {
      mz3d.bloomThreshold = mapconf.bloomThreshold;
    }
    if (mapconf.bloomRadius) {
      mz3d.bloomRadius = mapconf.bloomRadius;
    }
  } },

() => true);

(0,util.override)(TouchInput, '_onMouseMove', (o) => function (e) {
  const x = Graphics.pageToCanvasX(e.pageX);
  const y = Graphics.pageToCanvasY(e.pageY);

  const intersection = mz3d.scene.pick(x, y, raycastPredicate);
  if (intersection.hit) {
    targetFocusDistance = (intersection.distance + mz3d.camera.minZ) * 1000;
  }

}, () => mz3d.is3D() && mz3d.focusDistance === 'mouse');

class MV3D_RenderPipeline extends core.PostProcessRenderPipeline {

  constructor(name, cameras, effects = []) {
    super(mz3d.engine, name);
    cameras = MakeArray(cameras);

    for (let effect of effects) {
      this.addEffect(effect);
    }
    //if(mv3d.effects.antialiasing) this.addEffect(mv3d.effects.antialiasing);

    const pipelineManager = mz3d.scene.postProcessRenderPipelineManager;
    pipelineManager.addPipeline(this);
    pipelineManager.attachCamerasToRenderPipeline(name, cameras);
  }

  addEffect(effect) {
    if (typeof effect === 'string') effect = mz3d.effects[effect];
    if (!effect) return;
    if (effect instanceof core.PostProcess) {
      const postprocess = effect;
      if (!postprocess._mv3d_effect) {
        postprocess._mv3d_effect = new core.PostProcessRenderEffect(
        mz3d.engine,
        effect.name,
        () => postprocess,
        true);

      }
      effect = postprocess._mv3d_effect;
    }
    effect._mv3d_enabled = true;
    super.addEffect(effect);
  }

  enableEffect(effect) {
    if (typeof effect !== 'string') effect = effect.name || effect._name;
    const effectName = effect;
    effect = this._renderEffects[effect];
    if (effect) {
      this._enableEffect(effectName, this.cameras);
      effect._mv3d_enabled = true;
    }
  }

  disableEffect(effect) {
    if (typeof effect !== 'string') effect = effect.name || effect._name;
    const effectName = effect;
    effect = this._renderEffects[effect];
    if (effect) {
      this._disableEffect(effectName, this.cameras);
      effect._mv3d_enabled = false;
    }
  }}


class MV3d_DepthOfFieldEffect extends core.DepthOfFieldEffect {
  constructor(name, camera, blurLevel) {
    super(mz3d.scene, mz3d.getDepthMap(camera), core.DepthOfFieldEffectBlurLevel.High);
    this._name = name;
    this._camera = camera;
    this._mergeBlurX = this._depthOfFieldBlurX;
    this._mergeBlurY = this._depthOfFieldBlurY;
    this._depthOfFieldBlurX = [...this._depthOfFieldBlurX];
    this._depthOfFieldBlurY = [...this._depthOfFieldBlurY];
    this._blurLevel = blurLevel;
    this._blurStrength = 1;
    this.rebuildEffects(true);
  }

  get blurLevel() {
    return this._blurLevel;
  }

  set blurLevel(v) {
    if (v === this._blurLevel) {return;}
    this._blurLevel = v;
    this.rebuildEffects(true);
  }

  get blurStrength() {return this._blurStrength;}
  set blurStrength(v) {
    if (v === this._blurStrength) {return;}
    this._blurStrength = v;
    this.rebuildEffects(false);
  }

  rebuildEffects(rebuildArrays) {
    const [blurCount, kernelSize] = { [core.DepthOfFieldEffectBlurLevel.High]: [3, 51], [core.DepthOfFieldEffectBlurLevel.Medium]: [2, 31] }[this.blurLevel] ?? [1, 15];
    const adjustedKernelSize = kernelSize / Math.pow(2, blurCount - 1) * this._blurStrength;
    if (rebuildArrays) {
      this._effects = [this._circleOfConfusion];
      this._mergeBlurX.length = 0;
      this._mergeBlurY.length = 0;
    }
    let i = 0;
    for (; i < Math.min(blurCount, this._depthOfFieldBlurX.length); ++i) {
      const blurY = this._depthOfFieldBlurY[i];
      const blurX = this._depthOfFieldBlurX[i];
      if (rebuildArrays) {
        this._effects.push(blurY);
        this._effects.push(blurX);
        this._mergeBlurX.push(blurY);
        this._mergeBlurY.push(blurX);
        this._enablePostProcess(blurY);
        this._enablePostProcess(blurX);
      }
      blurY.kernel = adjustedKernelSize;
      blurX.kernel = adjustedKernelSize;
    }
    if (rebuildArrays) {
      for (; i < this._depthOfFieldBlurX.length; ++i) {
        const blurY = this._depthOfFieldBlurY[i];
        const blurX = this._depthOfFieldBlurX[i];
        this._disablePostProcess(blurY);
        this._disablePostProcess(blurX);
        blurY.kernel = adjustedKernelSize;
        blurX.kernel = adjustedKernelSize;
      }
      this._effects.push(this._dofMerge);
      this._dofMerge.updateEffect();
    }
    //mv3d.scene.resetDrawCache();
  }}


(0,util.assign)(mz3d, {
  enablePostProcessEffect(effect) {var _this$skyboxPipeline;
    this.pipeline.enableEffect(effect);
    (_this$skyboxPipeline = this.skyboxPipeline) === null || _this$skyboxPipeline === void 0 ? void 0 : _this$skyboxPipeline.enableEffect(effect);
  },
  disablePostProcessEffect(effect) {var _this$skyboxPipeline2;
    this.pipeline.disableEffect(effect);
    (_this$skyboxPipeline2 = this.skyboxPipeline) === null || _this$skyboxPipeline2 === void 0 ? void 0 : _this$skyboxPipeline2.disableEffect(effect);
  },
  isPostProcessEffectEnabled(effect) {var _mz3d$skyboxPipeline;
    if (typeof effect !== 'string') effect = effect.name || effect._name;
    effect = mz3d.pipeline._renderEffects[effect] || ((_mz3d$skyboxPipeline = mz3d.skyboxPipeline) === null || _mz3d$skyboxPipeline === void 0 ? void 0 : _mz3d$skyboxPipeline._renderEffects[effect]);
    if (!effect) {return false;}
    return Boolean(effect._mv3d_enabled);
  },

  chromaticAberration: new attributes/* Attribute */.a('chromaticAberration', (0,parameters/* parameter */.o)('chromaticAberration', '0'), Number).onChange((v) => {var _mz3d$skyboxView;
    mz3d.effects.chromaticAberration.aberrationAmount = v;
    (_mz3d$skyboxView = mz3d.skyboxView) === null || _mz3d$skyboxView === void 0 ? void 0 : _mz3d$skyboxView.requestRender();
  }),
  chromaticAberrationAngle: new attributes/* Attribute */.a('chromaticAberrationAngle', (0,parameters/* parameter */.o)('chromaticAberrationAngle', '45'), Number).onChange((v) => {var _mz3d$skyboxView2;
    new core.Vector2(1, 0).rotateToRef(mz3d.util.degtorad(v), mz3d.effects.chromaticAberration.direction);
    (_mz3d$skyboxView2 = mz3d.skyboxView) === null || _mz3d$skyboxView2 === void 0 ? void 0 : _mz3d$skyboxView2.requestRender();
  }),
  /*
  focalLength: new Attribute('focalLength',parameter('focalLength','50'),Number).onChange(v=>{
      const aperture = mv3d.effects.depthOfField.focalLength / mv3d.effects.depthOfField.fStop;
      mv3d.effects.depthOfField.focalLength=v;
      mv3d.aperture=aperture;
  }),
  fStop: new Attribute('fstop',parameter('fStop','1.4'),Number).onChange(v=>{
      mv3d.effects.depthOfField.fStop=v;
  }),
  aperture: Attribute.alias('fstop','aperture',()=>mv3d.focalLength/mv3d.fStop,v=>mv3d.focalLength/v),
  */

  aperture: new attributes/* Attribute */.a('aperture', (0,parameters/* parameter */.o)('aperture', 36), Number).onChange((v) => {
    mz3d.effects.depthOfField.fStop = mz3d.effects.depthOfField.focalLength / v;
    // todo: disable depthOfField when aperture or blurLevel are zero?
  }),
  blurStrength: new attributes/* Attribute */.a('blurStrength', (0,parameters/* parameter */.o)('blurStrength', 1), Number).onChange((v) => {
    mz3d.effects.depthOfField.blurStrength = v;
  }),
  focusDistance: new attributes/* Attribute */.a('focusDistance', (0,parameters/* parameter */.o)('focusDistance', 'auto'), (n) => isNaN(n) ? String(n).toLowerCase() : Number(n)),

  bloom: new attributes/* Attribute */.a('bloom', (0,parameters/* parameter */.o)('bloom', 1), Number).onChange((v) => {var _mz3d$skyboxView3;
    mz3d.effects.bloom.weight = v * bloomOptionLevel;
    (_mz3d$skyboxView3 = mz3d.skyboxView) === null || _mz3d$skyboxView3 === void 0 ? void 0 : _mz3d$skyboxView3.requestRender();
  }),
  bloomThreshold: new attributes/* Attribute */.a('bloomThreshold', (0,parameters/* parameter */.o)('bloomThreshold', 0.9), Number).onChange((v) => {var _mz3d$skyboxView4;
    mz3d.effects.bloom.threshold = v;
    (_mz3d$skyboxView4 = mz3d.skyboxView) === null || _mz3d$skyboxView4 === void 0 ? void 0 : _mz3d$skyboxView4.requestRender();
  }),
  bloomRadius: new attributes/* Attribute */.a('bloomRadius', (0,parameters/* parameter */.o)('bloomRadius', 128), Number).onChange((v) => {var _mz3d$skyboxView5;
    mz3d.effects.bloom.kernel = v;
    (_mz3d$skyboxView5 = mz3d.skyboxView) === null || _mz3d$skyboxView5 === void 0 ? void 0 : _mz3d$skyboxView5.requestRender();
  }) });



(0,util.assign)(mz3d.mapConfigurationFunctions, {
  bloom: new configuration/* ConfigurationFunction */.py('intensity,threshold,radius', function (conf, params) {
    const { intensity, threshold, radius } = params;
    if (intensity) {conf.bloomIntensity = Number(intensity);}
    if (threshold) {conf.bloomThreshold = Number(threshold);}
    if (radius) {conf.bloomRadius = Number(radius);}
  }) });


if ((0,parameters/* parameter */.o)('dofOption', true, util.booleanString)) mz3d.options['mv3d-blurLevel'] = {
  name: (0,parameters/* parameter */.o)('dofOptionName', 'Depth of Field', String),
  values: ['OFF', 'LOW', 'MEDIUM', 'HIGH'],
  default: Math.max(0, ['OFF', 'LOW', 'MEDIUM', 'HIGH'].indexOf((0,parameters/* parameter */.o)('dofDefault', 'MEDIUM', String).toUpperCase())),
  apply(v) {
    if (v) {
      mz3d.enablePostProcessEffect('depthOfField');
      mz3d.effects.depthOfField.blurLevel = v - 1;
    } else {
      mz3d.disablePostProcessEffect('depthOfField');
    }
  } };



if ((0,parameters/* parameter */.o)('bloomOption', true, util.booleanString)) mz3d.options['mv3d-bloomLevel'] = {
  name: (0,parameters/* parameter */.o)('bloomOptionName', 'Bloom', String),
  values: ['OFF', 'LOW', 'MEDIUM', 'HIGH'],
  default: Math.max(0, ['OFF', 'LOW', 'MEDIUM', 'HIGH'].indexOf((0,parameters/* parameter */.o)('bloomDefault', 'MEDIUM', String).toUpperCase())),
  apply(v) {
    bloomOptionLevel = v / 2;
    mz3d.bloom = mz3d.bloom;
  } };



if ((0,parameters/* parameter */.o)('chromaticAberrationOption', true, util.booleanString)) mz3d.options['mv3d-chromaticAberration'] = {
  name: (0,parameters/* parameter */.o)('chromaticAberrationOptionName', 'Chromatic Aberration', String),
  type: 'bool',
  apply(v) {
    if (v) {
      mz3d.enablePostProcessEffect('chromaticAberration');
    } else {
      mz3d.disablePostProcessEffect('chromaticAberration');
    }
  },
  default: (0,parameters/* parameter */.o)('chromaticAberrationDefault', true, util.booleanString) };
;// CONCATENATED MODULE: ./src/premium/index.js

//import './data.js';




//features

//import './feature-ambientOcclusion.js';



//import './feature-lensEffects.js';





const premium_mz3d = window.mz3d;
premium_mz3d.isPremium = true;
})();

/******/ })()
;
//# sourceMappingURL=mz3d.js.map